Skip to content

Commit

Permalink
Bump to drawio 15.8.7 (#75)
Browse files Browse the repository at this point in the history
  • Loading branch information
bollwyvl authored Nov 29, 2021
1 parent 1921c34 commit 0fd7fed
Show file tree
Hide file tree
Showing 11 changed files with 1,663 additions and 2,867 deletions.
2 changes: 1 addition & 1 deletion .github/environment-conda-build-win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ channels:
- nodefaults

dependencies:
- pywin32 !=302
- pywin32 !=302,!=301
### ipydrawio-conda-build-deps ###

- boa
Expand Down
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@

#### @deathbeds/ipydrawio-notebook 1.1.2

#### @deathbeds/ipydrawio-webpack 15.8.600
#### @deathbeds/ipydrawio-webpack 15.8.700

- upgrade to drawio v15.8.6 for enhancements and bug fixes
- upgrade to drawio v15.8.7 for enhancements and bug fixes

#### @deathbeds/ipydrawio-jupyter-templates 1.1.2

Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"lerna": "3.2.1",
"lerna": "4.0.0",
"npmClient": "jlpm",
"useWorkspaces": true,
"version": "independent"
Expand Down
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,16 @@
"eslint-plugin-jest": "^24.1.3",
"eslint-plugin-prettier": "^3.1.4",
"eslint-plugin-react": "^7.21.5",
"lerna": "^3.22.1",
"lerna": "^4.0.0",
"prettier": "^2.1.1",
"prettier-plugin-sort-json": "^0.0.2",
"typedoc": "^0.20.36",
"typedoc-plugin-markdown": "~3.9.0"
},
"resolutions": {
"ansi-regex": ">=5.0.1",
"json-schema": ">=0.4.0"
},
"prettier": {
"singleQuote": true,
"proseWrap": "always",
Expand Down
2 changes: 1 addition & 1 deletion packages/ipydrawio-webpack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,5 @@
"build:pre": "python scripts/patch.py && python scripts/static.py"
},
"types": "lib/index.d.ts",
"version": "15.8.600"
"version": "15.8.700"
}
2 changes: 1 addition & 1 deletion packages/ipydrawio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"@jupyterlab/application": "^3.1.0",
"@jupyterlab/launcher": "^3.1.0",
"@jupyterlab/mainmenu": "^3.1.0",
"@deathbeds/ipydrawio-webpack": "^15.8.600"
"@deathbeds/ipydrawio-webpack": "^15.8.700"
},
"description": "A JupyterLab extension for embedding interactive drawio / mxgraph diagrams.",
"devDependencies": {
Expand Down
16 changes: 15 additions & 1 deletion packages/ipydrawio/src/createCustom.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,15 @@ export class CreateCustom extends VDomRenderer<CreateCustom.Model> {
return [
<header key="header">
<h1>New Diagram</h1>
<label>{this.model.cwd ? <pre>/{this.model.cwd}/</pre> : ''}</label>
<input
type="text"
className="jp-mod-styled"
defaultValue={this.model.name}
placeholder="untitled"
onChange={(evt) => (this.model.name = evt.currentTarget.value)}
/>
<label><pre>{this.model.format.ext}</pre></label>
<button
onClick={this.model.requestDocument}
type="button"
Expand Down Expand Up @@ -167,7 +169,7 @@ export class CreateCustom extends VDomRenderer<CreateCustom.Model> {
defaultChecked={index === -1}
/>
<label htmlFor={id}>
{effectiveTheme}
{`${effectiveTheme} ${theme ? '' : '(default)'}`}
<icon.react width={100} tag="span" />
{this.renderTags(tags)}
</label>
Expand Down Expand Up @@ -211,6 +213,7 @@ export class CreateCustom extends VDomRenderer<CreateCustom.Model> {
export namespace CreateCustom {
export interface IOptions {
manager: IDiagramManager;
cwd?: string;
}

export class Model extends VDomModel {
Expand All @@ -222,10 +225,12 @@ export namespace CreateCustom {
private _documentRequested = new Signal<Model, void>(this);
private _format: IFormat = IO.XML_NATIVE;
private _name: string = '';
private _cwd: string | null = null;

constructor(options: IOptions) {
super();
this._manager = options.manager;
this._cwd = options.cwd || null;
this._manager
.templates()
.then((templates) => {
Expand All @@ -252,6 +257,15 @@ export namespace CreateCustom {
return this._manager;
}

get cwd() {
return this._cwd;
}

set cwd(cwd: string | null) {
this._cwd = cwd;
this.stateChanged.emit(void 0);
}

get name() {
return this._name;
}
Expand Down
11 changes: 11 additions & 0 deletions packages/ipydrawio/src/manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,15 @@ export class DiagramManager implements IDiagramManager {
execute: () => {
const model = new CreateCustom.Model({ manager: this });
const onChange = () => model.stateChanged.emit(void 0);
const onPath = () => (model.cwd = defaultBrowser.model.path);
const { defaultBrowser } = this._browserFactory || {};

this._settings.changed.connect(onChange);
this._templatesChanged.connect(onChange);
if (defaultBrowser) {
defaultBrowser.model.pathChanged.connect(onPath);
onPath();
}
const content = new CreateCustom(model);
const main = new MainAreaWidget({ content });
const promiseDelegate = new PromiseDelegate<DiagramDocument>();
Expand All @@ -122,6 +129,10 @@ export class DiagramManager implements IDiagramManager {
);
this._settings.changed.disconnect(onChange);
this._templatesChanged.disconnect(onChange);
if (defaultBrowser) {
defaultBrowser.model.pathChanged.disconnect(onPath);
}

main.disposed.disconnect(onDisposed);
promiseDelegate.resolve(diagramDocument);
main.dispose();
Expand Down
12 changes: 9 additions & 3 deletions packages/ipydrawio/style/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@

.jp-IPyDiagram-CreateCustom.jp-RenderedHTMLCommon ul {
padding: 0;
margin: 0;
margin: 0 1em;
}

.jp-IPyDiagram-CreateCustom header {
Expand All @@ -62,6 +62,7 @@
display: flex;
border-bottom: solid 1px var(--jp-border-color0);
align-items: center;
flex-wrap: wrap;
}

.jp-IPyDiagram-CreateCustom header h1 {
Expand All @@ -72,18 +73,22 @@

.jp-RenderedHTMLCommon.jp-IPyDiagram-CreateCustom h1,
.jp-RenderedHTMLCommon.jp-IPyDiagram-CreateCustom h2 {
min-width: 260px;
white-space: nowrap;
display: flex;
align-items: center;
padding: 0 0.5em;
}

.jp-IPyDiagram-CreateCustom header button {
display: flex;
align-items: center;
padding: 1.5em;
margin-left: 1em;
}

.jp-IPyDiagram-CreateCustom input {
flex: 1;
margin-right: 1em;
margin: 0 1em;
}

.jp-IPyDiagram-CreateCustom header button > * {
Expand All @@ -109,6 +114,7 @@

.jp-IPyDiagram-CreateCustom section {
display: flex;
flex-direction: column;
margin-bottom: 1em;
}

Expand Down
Loading

0 comments on commit 0fd7fed

Please sign in to comment.