@jupyterlab/application 0.18.4 → 0.19.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,34 @@
1
+ Copyright (c) 2015 Project Jupyter Contributors
2
+ All rights reserved.
3
+
4
+ Redistribution and use in source and binary forms, with or without
5
+ modification, are permitted provided that the following conditions are met:
6
+
7
+ 1. Redistributions of source code must retain the above copyright notice, this
8
+ list of conditions and the following disclaimer.
9
+
10
+ 2. Redistributions in binary form must reproduce the above copyright notice,
11
+ this list of conditions and the following disclaimer in the documentation
12
+ and/or other materials provided with the distribution.
13
+
14
+ 3. Neither the name of the copyright holder nor the names of its
15
+ contributors may be used to endorse or promote products derived from
16
+ this software without specific prior written permission.
17
+
18
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
22
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
25
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
26
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28
+
29
+ Semver File License
30
+ ===================
31
+
32
+ The semver.py file is from https://github.com/podhmo/python-semver
33
+ which is licensed under the "MIT" license. See the semver.py file for details.
34
+
package/lib/index.d.ts CHANGED
@@ -53,11 +53,6 @@ export declare class JupyterLab extends Application<ApplicationShell> {
53
53
  * A subclass may reimplement this method as needed.
54
54
  */
55
55
  protected evtContextMenu(event: MouseEvent): void;
56
- /**
57
- * Gets the hierarchy of html nodes that was under the cursor
58
- * when the most recent contextmenu event was issued
59
- */
60
- readonly contextMenuNodes: HTMLElement[];
61
56
  /**
62
57
  * Whether the application is dirty.
63
58
  */
@@ -86,16 +81,16 @@ export declare class JupyterLab extends Application<ApplicationShell> {
86
81
  */
87
82
  readonly restored: Promise<ApplicationShell.ILayout>;
88
83
  /**
89
- * Gets all of the valid, non-empty values of a given property
90
- * across all of the nodes in the hierarchy returned by contextMenuNodes
91
- */
92
- contextMenuValues(prop: string): any[];
93
- /**
94
- * Gets the first valid, non-empty value of a property
95
- * in the node hierarchy returned by contextMenuNodes.
96
- * Optionally, gets the first value that matches a passed-in RegExp
84
+ * Walks up the DOM hierarchy of the target of the active `contextmenu`
85
+ * event, testing the nodes for a user-supplied funcion. This can
86
+ * be used to find a node on which to operate, given a context menu click.
87
+ *
88
+ * @param test - a function that takes an `HTMLElement` and returns a
89
+ * boolean for whether it is the element the requester is seeking.
90
+ *
91
+ * @returns an HTMLElement or undefined, if none is found.
97
92
  */
98
- contextMenuFirst(prop: string, regexp?: RegExp | null): any | null;
93
+ contextMenuFirst(test: (node: HTMLElement) => boolean): HTMLElement | undefined;
99
94
  /**
100
95
  * Set the application state to dirty.
101
96
  *
@@ -120,6 +115,11 @@ export declare class JupyterLab extends Application<ApplicationShell> {
120
115
  * @param mods - The plugin modules to register.
121
116
  */
122
117
  registerPluginModules(mods: JupyterLab.IPluginModule[]): void;
118
+ /**
119
+ * Gets the hierarchy of html nodes that was under the cursor
120
+ * when the most recent contextmenu event was issued
121
+ */
122
+ private _getContextMenuNodes;
123
123
  private _contextMenuEvent;
124
124
  private _info;
125
125
  private _dirtyCount;
@@ -135,6 +135,18 @@ export declare namespace JupyterLab {
135
135
  * The options used to initialize a JupyterLab object.
136
136
  */
137
137
  interface IOptions extends Partial<IInfo> {
138
+ /**
139
+ * The document registry instance used by the application.
140
+ */
141
+ docRegistry?: DocumentRegistry;
142
+ /**
143
+ * The command linker used by the application.
144
+ */
145
+ commandLinker?: CommandLinker;
146
+ /**
147
+ * The service manager used by the application.
148
+ */
149
+ serviceManager?: ServiceManager;
138
150
  }
139
151
  /**
140
152
  * The information about a JupyterLab application.
package/lib/index.js CHANGED
@@ -44,6 +44,15 @@ class JupyterLab extends application_1.Application {
44
44
  const defaultWorkspace = coreutils_1.URLExt.join(coreutils_1.PageConfig.getOption('baseUrl'), coreutils_1.PageConfig.getOption('pageUrl'));
45
45
  // Set default workspace in page config.
46
46
  coreutils_1.PageConfig.setOption('defaultWorkspace', defaultWorkspace);
47
+ // Instantiate public resources.
48
+ this.serviceManager = options.serviceManager || new services_1.ServiceManager();
49
+ this.commandLinker =
50
+ options.commandLinker || new apputils_1.CommandLinker({ commands: this.commands });
51
+ this.docRegistry = options.docRegistry || new docregistry_1.DocumentRegistry();
52
+ // Remove extra resources (non-IInfo) from options object.
53
+ delete options.serviceManager;
54
+ delete options.commandLinker;
55
+ delete options.docRegistry;
47
56
  // Populate application info.
48
57
  this._info = Object.assign({}, JupyterLab.defaultInfo, options, { defaultWorkspace });
49
58
  if (this._info.devMode) {
@@ -53,10 +62,6 @@ class JupyterLab extends application_1.Application {
53
62
  Object.defineProperty(this._info, 'workspace', {
54
63
  get: () => coreutils_1.PageConfig.getOption('workspace') || ''
55
64
  });
56
- // Instantiate public resources.
57
- this.serviceManager = new services_1.ServiceManager();
58
- this.commandLinker = new apputils_1.CommandLinker({ commands: this.commands });
59
- this.docRegistry = new docregistry_1.DocumentRegistry();
60
65
  // Add initial model factory.
61
66
  this.docRegistry.addModelFactory(new docregistry_1.Base64ModelFactory());
62
67
  if (options.mimeExtensions) {
@@ -88,25 +93,6 @@ class JupyterLab extends application_1.Application {
88
93
  event.stopPropagation();
89
94
  }
90
95
  }
91
- /**
92
- * Gets the hierarchy of html nodes that was under the cursor
93
- * when the most recent contextmenu event was issued
94
- */
95
- get contextMenuNodes() {
96
- if (!this._contextMenuEvent) {
97
- return [];
98
- }
99
- // this one-liner doesn't work, but should at some point
100
- // in the future (https://developer.mozilla.org/en-US/docs/Web/API/Event)
101
- // return this._contextMenuEvent.composedPath() as HTMLElement[];
102
- let nodes = [this._contextMenuEvent.target];
103
- while ('parentNode' in nodes[nodes.length - 1] &&
104
- nodes[nodes.length - 1].parentNode &&
105
- nodes[nodes.length - 1] !== nodes[nodes.length - 1].parentNode) {
106
- nodes.push(nodes[nodes.length - 1].parentNode);
107
- }
108
- return nodes;
109
- }
110
96
  /**
111
97
  * Whether the application is dirty.
112
98
  */
@@ -147,42 +133,22 @@ class JupyterLab extends application_1.Application {
147
133
  return this.shell.restored;
148
134
  }
149
135
  /**
150
- * Gets all of the valid, non-empty values of a given property
151
- * across all of the nodes in the hierarchy returned by contextMenuNodes
152
- */
153
- contextMenuValues(prop) {
154
- let vals = [];
155
- for (let node of this.contextMenuNodes) {
156
- if (prop in node && node[prop]) {
157
- vals.push(node[prop]);
158
- }
159
- }
160
- return vals;
161
- }
162
- /**
163
- * Gets the first valid, non-empty value of a property
164
- * in the node hierarchy returned by contextMenuNodes.
165
- * Optionally, gets the first value that matches a passed-in RegExp
136
+ * Walks up the DOM hierarchy of the target of the active `contextmenu`
137
+ * event, testing the nodes for a user-supplied funcion. This can
138
+ * be used to find a node on which to operate, given a context menu click.
139
+ *
140
+ * @param test - a function that takes an `HTMLElement` and returns a
141
+ * boolean for whether it is the element the requester is seeking.
142
+ *
143
+ * @returns an HTMLElement or undefined, if none is found.
166
144
  */
167
- contextMenuFirst(prop, regexp = null) {
168
- if (regexp) {
169
- for (let node of this.contextMenuNodes) {
170
- if (prop in node && node[prop]) {
171
- let match = node[prop].match(regexp);
172
- if (match) {
173
- return match;
174
- }
175
- }
145
+ contextMenuFirst(test) {
146
+ for (let node of this._getContextMenuNodes()) {
147
+ if (test(node)) {
148
+ return node;
176
149
  }
177
150
  }
178
- else {
179
- for (let node of this.contextMenuNodes) {
180
- if (prop in node && node[prop]) {
181
- return node[prop];
182
- }
183
- }
184
- }
185
- return;
151
+ return undefined;
186
152
  }
187
153
  /**
188
154
  * Set the application state to dirty.
@@ -255,6 +221,25 @@ class JupyterLab extends application_1.Application {
255
221
  this.registerPluginModule(mod);
256
222
  });
257
223
  }
224
+ /**
225
+ * Gets the hierarchy of html nodes that was under the cursor
226
+ * when the most recent contextmenu event was issued
227
+ */
228
+ _getContextMenuNodes() {
229
+ if (!this._contextMenuEvent) {
230
+ return [];
231
+ }
232
+ // this one-liner doesn't work, but should at some point
233
+ // in the future (https://developer.mozilla.org/en-US/docs/Web/API/Event)
234
+ // return this._contextMenuEvent.composedPath() as HTMLElement[];
235
+ let nodes = [this._contextMenuEvent.target];
236
+ while ('parentNode' in nodes[nodes.length - 1] &&
237
+ nodes[nodes.length - 1].parentNode &&
238
+ nodes[nodes.length - 1] !== nodes[nodes.length - 1].parentNode) {
239
+ nodes.push(nodes[nodes.length - 1].parentNode);
240
+ }
241
+ return nodes;
242
+ }
258
243
  }
259
244
  exports.JupyterLab = JupyterLab;
260
245
  /**
@@ -92,6 +92,9 @@ function createRendermimePlugin(tracker, item) {
92
92
  });
93
93
  }
94
94
  options.forEach(option => {
95
+ const toolbarFactory = option.toolbarFactory
96
+ ? (w) => option.toolbarFactory(w.content.renderer)
97
+ : undefined;
95
98
  let factory = new docregistry_1.MimeDocumentFactory({
96
99
  renderTimeout: item.renderTimeout,
97
100
  dataType: item.dataType,
@@ -101,7 +104,8 @@ function createRendermimePlugin(tracker, item) {
101
104
  primaryFileType: registry.getFileType(option.primaryFileType),
102
105
  fileTypes: option.fileTypes,
103
106
  defaultFor: option.defaultFor,
104
- defaultRendered: option.defaultRendered
107
+ defaultRendered: option.defaultRendered,
108
+ toolbarFactory
105
109
  });
106
110
  registry.addWidgetFactory(factory);
107
111
  factory.widgetCreated.connect((sender, widget) => {
package/lib/shell.d.ts CHANGED
@@ -171,8 +171,6 @@ export declare class ApplicationShell extends Widget {
171
171
  private _cachedLayout;
172
172
  private _currentChanged;
173
173
  private _dockPanel;
174
- private _hboxPanel;
175
- private _hsplitPanel;
176
174
  private _isRestored;
177
175
  private _layoutModified;
178
176
  private _leftHandler;
@@ -183,6 +181,7 @@ export declare class ApplicationShell extends Widget {
183
181
  private _bottomPanel;
184
182
  private _debouncer;
185
183
  private _addOptionsCache;
184
+ private _sideOptionsCache;
186
185
  }
187
186
  /**
188
187
  * The namespace for `ApplicationShell` class statics.
package/lib/shell.js CHANGED
@@ -68,14 +68,15 @@ class ApplicationShell extends widgets_1.Widget {
68
68
  this._tracker = new widgets_1.FocusTracker();
69
69
  this._debouncer = 0;
70
70
  this._addOptionsCache = new Map();
71
+ this._sideOptionsCache = new Map();
71
72
  this.addClass(APPLICATION_SHELL_CLASS);
72
73
  this.id = 'main';
73
74
  let bottomPanel = (this._bottomPanel = new widgets_1.BoxPanel());
74
75
  let topPanel = (this._topPanel = new widgets_1.Panel());
75
- let hboxPanel = (this._hboxPanel = new widgets_1.BoxPanel());
76
+ let hboxPanel = new widgets_1.BoxPanel();
76
77
  let dockPanel = (this._dockPanel = new widgets_1.DockPanel());
77
78
  messaging_1.MessageLoop.installMessageHook(dockPanel, this._dockChildHook);
78
- let hsplitPanel = (this._hsplitPanel = new widgets_1.SplitPanel());
79
+ let hsplitPanel = new widgets_1.SplitPanel();
79
80
  let leftHandler = (this._leftHandler = new Private.SideBarHandler('left'));
80
81
  let rightHandler = (this._rightHandler = new Private.SideBarHandler('right'));
81
82
  let rootLayout = new widgets_1.BoxLayout();
@@ -110,6 +111,9 @@ class ApplicationShell extends widgets_1.Widget {
110
111
  hboxPanel.addWidget(rightHandler.sideBar);
111
112
  rootLayout.direction = 'top-to-bottom';
112
113
  rootLayout.spacing = 0; // TODO make this configurable?
114
+ // Use relative sizing to set the width of the side panels.
115
+ // This will still respect the min-size of children widget in the stacked panel.
116
+ hsplitPanel.setRelativeSizes([1, 2.5, 1]);
113
117
  widgets_1.BoxLayout.setStretch(topPanel, 0);
114
118
  widgets_1.BoxLayout.setStretch(hboxPanel, 1);
115
119
  widgets_1.BoxLayout.setStretch(bottomPanel, 0);
@@ -326,11 +330,13 @@ class ApplicationShell extends widgets_1.Widget {
326
330
  * #### Notes
327
331
  * Widgets must have a unique `id` property, which will be used as the DOM id.
328
332
  */
329
- addToLeftArea(widget, options = {}) {
333
+ addToLeftArea(widget, options) {
330
334
  if (!widget.id) {
331
335
  console.error('Widgets added to app shell must have unique id property.');
332
336
  return;
333
337
  }
338
+ options = options || this._sideOptionsCache.get(widget) || {};
339
+ this._sideOptionsCache.set(widget, options);
334
340
  let rank = 'rank' in options ? options.rank : DEFAULT_RANK;
335
341
  this._leftHandler.addWidget(widget, rank);
336
342
  this._onLayoutModified();
@@ -375,11 +381,13 @@ class ApplicationShell extends widgets_1.Widget {
375
381
  * #### Notes
376
382
  * Widgets must have a unique `id` property, which will be used as the DOM id.
377
383
  */
378
- addToRightArea(widget, options = {}) {
384
+ addToRightArea(widget, options) {
379
385
  if (!widget.id) {
380
386
  console.error('Widgets added to app shell must have unique id property.');
381
387
  return;
382
388
  }
389
+ options = options || this._sideOptionsCache.get(widget) || {};
390
+ this._sideOptionsCache.set(widget, options);
383
391
  let rank = 'rank' in options ? options.rank : DEFAULT_RANK;
384
392
  this._rightHandler.addWidget(widget, rank);
385
393
  this._onLayoutModified();
@@ -575,7 +583,9 @@ class ApplicationShell extends widgets_1.Widget {
575
583
  // Otherwise, direction is 'next'.
576
584
  return index < len - 1
577
585
  ? bars[index + 1]
578
- : index === len - 1 ? bars[0] : null;
586
+ : index === len - 1
587
+ ? bars[0]
588
+ : null;
579
589
  }
580
590
  /*
581
591
  * Return the TabBar that has the currently active Widget or null.
@@ -740,7 +750,10 @@ var Private;
740
750
  let index = this._findInsertIndex(item);
741
751
  algorithm_1.ArrayExt.insert(this._items, index, item);
742
752
  this._stackedPanel.insertWidget(index, widget);
743
- this._sideBar.insertTab(index, widget.title);
753
+ const title = this._sideBar.insertTab(index, widget.title);
754
+ // Store the parent id in the title dataset
755
+ // in order to dispatch click events to the right widget.
756
+ title.dataset = { id: widget.id };
744
757
  this._refreshVisibility();
745
758
  }
746
759
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jupyterlab/application",
3
- "version": "0.18.4",
3
+ "version": "0.19.1",
4
4
  "description": "JupyterLab - Application",
5
5
  "homepage": "https://github.com/jupyterlab/jupyterlab",
6
6
  "bugs": {
@@ -25,21 +25,22 @@
25
25
  "url": "https://github.com/jupyterlab/jupyterlab.git"
26
26
  },
27
27
  "scripts": {
28
- "build": "tsc",
28
+ "build": "tsc -b",
29
29
  "clean": "rimraf lib",
30
+ "docs": "typedoc --options tdoptions.json --theme ../../typedoc-theme src",
30
31
  "prepublishOnly": "npm run build",
31
- "watch": "tsc -w --listEmittedFiles"
32
+ "watch": "tsc -b --watch"
32
33
  },
33
34
  "dependencies": {
34
- "@jupyterlab/apputils": "^0.18.4",
35
- "@jupyterlab/coreutils": "^2.1.4",
36
- "@jupyterlab/docregistry": "^0.18.4",
37
- "@jupyterlab/rendermime": "^0.18.4",
38
- "@jupyterlab/rendermime-interfaces": "^1.1.7",
39
- "@jupyterlab/services": "^3.1.4",
35
+ "@jupyterlab/apputils": "^0.19.1",
36
+ "@jupyterlab/coreutils": "^2.2.1",
37
+ "@jupyterlab/docregistry": "^0.19.1",
38
+ "@jupyterlab/rendermime": "^0.19.1",
39
+ "@jupyterlab/rendermime-interfaces": "^1.2.1",
40
+ "@jupyterlab/services": "^3.2.1",
40
41
  "@phosphor/algorithm": "^1.1.2",
41
42
  "@phosphor/application": "^1.6.0",
42
- "@phosphor/commands": "^1.5.0",
43
+ "@phosphor/commands": "^1.6.1",
43
44
  "@phosphor/coreutils": "^1.3.0",
44
45
  "@phosphor/disposable": "^1.1.2",
45
46
  "@phosphor/messaging": "^1.2.2",
@@ -49,6 +50,11 @@
49
50
  },
50
51
  "devDependencies": {
51
52
  "rimraf": "~2.6.2",
52
- "typescript": "~2.9.2"
53
- }
53
+ "typedoc": "~0.12.0",
54
+ "typescript": "~3.1.1"
55
+ },
56
+ "publishConfig": {
57
+ "access": "public"
58
+ },
59
+ "gitHead": "7fc900168981e58051253ecc66a18015a052cd2f"
54
60
  }
package/style/index.css CHANGED
@@ -50,7 +50,6 @@ body {
50
50
  @import './dockpanel.css';
51
51
  @import './images.css';
52
52
  @import './icons.css';
53
- @import './materialcolors.css';
54
53
  @import './menus.css';
55
54
  @import './scrollbar.css';
56
55
  @import './tabs.css';
@@ -176,7 +176,7 @@
176
176
 
177
177
  #jp-left-stack > .p-Widget,
178
178
  #jp-right-stack > .p-Widget {
179
- min-width: 300px;
179
+ min-width: var(--jp-sidebar-min-width);
180
180
  }
181
181
 
182
182
  #jp-right-stack {
package/lib/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../application/src/index.ts"],"names":[],"mappings":";AAAA,0CAA0C;AAC1C,2DAA2D;;AAE3D,wDAAwD;AACxD,8BAA4B;AAE5B,qDAA2D;AAE3D,mDAAqD;AAErD,yDAA+E;AAI/E,mDAAsD;AAEtD,uDAA6D;AAE7D,qDAAuE;AAEvE,mDAA0D;AAE1D,mCAA2C;AAC3C,mDAAsD;AAEtD,mDAAmE;AAA1D,2CAAA,eAAe,CAAA;AAAE,0CAAA,cAAc,CAAA;AACxC,iDAAuD;AAA9C,+CAAA,oBAAoB,CAAA;AAC7B,mCAA2C;AAAlC,2BAAA,OAAO,CAAA;AAAE,0BAAA,MAAM,CAAA;AACxB,iCAA2C;AAAlC,mCAAA,gBAAgB,CAAA;AAOzB;;GAEG;AACH,gBAAwB,SAAQ,yBAA6B;IAC3D;;OAEG;IACH,YAAY,UAA+B,EAAE;QAC3C,KAAK,CAAC,EAAE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AAE,EAAE;QACvC,cAAc,EAAE,EAAE;QAClB,IAAI,EAAE;YACJ,IAAI,EAAE,sBAAU,CAAC,SAAS,CAAC,SAAS,CAAC;YACrC,IAAI,EAAE,sBAAU,CAAC,SAAS,CAAC,SAAS,CAAC;YACrC,MAAM,EAAE,sBAAU,CAAC,SAAS,CAAC,WAAW,CAAC;YACzC,QAAQ,EAAE,sBAAU,CAAC,SAAS,CAAC,aAAa,CAAC;YAC7C,MAAM,EAAE,sBAAU,CAAC,SAAS,CAAC,WAAW,CAAC;YACzC,IAAI,EAAE,sBAAU,CAAC,SAAS,CAAC,SAAS,CAAC;YACrC,UAAU,EAAE,sBAAU,CAAC,SAAS,CAAC,eAAe,CAAC;SAClD;QACD,WAAW,EAAE;YACX,WAAW,EAAE,sBAAU,CAAC,SAAS,CAAC,gBAAgB,CAAC;YACnD,OAAO,EAAE,sBAAU,CAAC,SAAS,CAAC,YAAY,CAAC;YAC3C,MAAM,EAAE,sBAAU,CAAC,SAAS,CAAC,WAAW,CAAC;YACzC,SAAS,EAAE,sBAAU,CAAC,SAAS,CAAC,cAAc,CAAC;YAC/C,MAAM,EAAE,sBAAU,CAAC,SAAS,CAAC,WAAW,CAAC;YACzC,YAAY,EAAE,sBAAU,CAAC,SAAS,CAAC,iBAAiB,CAAC;YACrD,UAAU,EAAE,sBAAU,CAAC,SAAS,CAAC,YAAY,CAAC;YAC9C,UAAU,EAAE,sBAAU,CAAC,SAAS,CAAC,eAAe,CAAC;SAClD;QACD,WAAW,EAAE,sBAAU,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC,WAAW,EAAE,KAAK,MAAM;QACxE,SAAS,EAAE,EAAE;QACb,gBAAgB,EAAE,EAAE;KACrB,CAAC;AAYJ,CAAC,EArIgB,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAqI1B","sourcesContent":["// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n\n// Local CSS must be loaded prior to loading other libs.\nimport '../style/index.css';\n\nimport { PageConfig, URLExt } from '@jupyterlab/coreutils';\n\nimport { CommandLinker } from '@jupyterlab/apputils';\n\nimport { Base64ModelFactory, DocumentRegistry } from '@jupyterlab/docregistry';\n\nimport { IRenderMime } from '@jupyterlab/rendermime-interfaces';\n\nimport { ServiceManager } from '@jupyterlab/services';\n\nimport { Application, IPlugin } from '@phosphor/application';\n\nimport { DisposableDelegate, IDisposable } from '@phosphor/disposable';\n\nimport { createRendermimePlugins } from './mimerenderers';\n\nimport { ApplicationShell } from './shell';\nimport { ISignal, Signal } from '@phosphor/signaling';\n\nexport { ILayoutRestorer, LayoutRestorer } from './layoutrestorer';\nexport { IMimeDocumentTracker } from './mimerenderers';\nexport { IRouter, Router } from './router';\nexport { ApplicationShell } from './shell';\n\n/**\n * The type for all JupyterLab plugins.\n */\nexport type JupyterLabPlugin<T> = IPlugin<JupyterLab, T>;\n\n/**\n * JupyterLab is the main application class. It is instantiated once and shared.\n */\nexport class JupyterLab extends Application<ApplicationShell> {\n /**\n * Construct a new JupyterLab object.\n */\n constructor(options: JupyterLab.IOptions = {}) {\n super({ shell: new ApplicationShell() });\n this._busySignal = new Signal(this);\n this._dirtySignal = new Signal(this);\n\n // Construct the default workspace name.\n const defaultWorkspace = URLExt.join(\n PageConfig.getOption('baseUrl'),\n PageConfig.getOption('pageUrl')\n );\n\n // Set default workspace in page config.\n PageConfig.setOption('defaultWorkspace', defaultWorkspace);\n\n // Populate application info.\n this._info = {\n ...JupyterLab.defaultInfo,\n ...options,\n ...{ defaultWorkspace }\n };\n\n if (this._info.devMode) {\n this.shell.addClass('jp-mod-devMode');\n }\n\n // Make workspace accessible via a getter because it is set at runtime.\n Object.defineProperty(this._info, 'workspace', {\n get: () => PageConfig.getOption('workspace') || ''\n });\n\n // Instantiate public resources.\n this.serviceManager = new ServiceManager();\n this.commandLinker = new CommandLinker({ commands: this.commands });\n this.docRegistry = new DocumentRegistry();\n\n // Add initial model factory.\n this.docRegistry.addModelFactory(new Base64ModelFactory());\n\n if (options.mimeExtensions) {\n for (let plugin of createRendermimePlugins(options.mimeExtensions)) {\n this.registerPlugin(plugin);\n }\n }\n }\n\n /**\n * The document registry instance used by the application.\n */\n readonly docRegistry: DocumentRegistry;\n\n /**\n * The command linker used by the application.\n */\n readonly commandLinker: CommandLinker;\n\n /**\n * The service manager used by the application.\n */\n readonly serviceManager: ServiceManager;\n\n /**\n * A list of all errors encountered when registering plugins.\n */\n readonly registerPluginErrors: Array<Error> = [];\n\n /**\n * A method invoked on a document `'contextmenu'` event.\n *\n * #### Notes\n * The default implementation of this method opens the application\n * `contextMenu` at the current mouse position.\n *\n * If the application context menu has no matching content *or* if\n * the shift key is pressed, the default browser context menu will\n * be opened instead.\n *\n * A subclass may reimplement this method as needed.\n */\n protected evtContextMenu(event: MouseEvent): void {\n if (event.shiftKey) {\n return;\n }\n\n this._contextMenuEvent = event;\n if (this.contextMenu.open(event)) {\n event.preventDefault();\n event.stopPropagation();\n }\n }\n\n /**\n * Gets the hierarchy of html nodes that was under the cursor\n * when the most recent contextmenu event was issued\n */\n get contextMenuNodes(): HTMLElement[] {\n if (!this._contextMenuEvent) {\n return [];\n }\n\n // this one-liner doesn't work, but should at some point\n // in the future (https://developer.mozilla.org/en-US/docs/Web/API/Event)\n // return this._contextMenuEvent.composedPath() as HTMLElement[];\n\n let nodes: HTMLElement[] = [this._contextMenuEvent.target as HTMLElement];\n while (\n 'parentNode' in nodes[nodes.length - 1] &&\n nodes[nodes.length - 1].parentNode &&\n nodes[nodes.length - 1] !== nodes[nodes.length - 1].parentNode\n ) {\n nodes.push(nodes[nodes.length - 1].parentNode as HTMLElement);\n }\n return nodes;\n }\n\n /**\n * Whether the application is dirty.\n */\n get isDirty(): boolean {\n return this._dirtyCount > 0;\n }\n\n /**\n * Whether the application is busy.\n */\n get isBusy(): boolean {\n return this._busyCount > 0;\n }\n\n /**\n * Returns a signal for when application changes its busy status.\n */\n get busySignal(): ISignal<JupyterLab, boolean> {\n return this._busySignal;\n }\n\n /**\n * Returns a signal for when application changes its dirty status.\n */\n get dirtySignal(): ISignal<JupyterLab, boolean> {\n return this._dirtySignal;\n }\n\n /**\n * The information about the application.\n */\n get info(): JupyterLab.IInfo {\n return this._info;\n }\n\n /**\n * Promise that resolves when state is first restored, returning layout description.\n *\n * #### Notes\n * This is just a reference to `shell.restored`.\n */\n get restored(): Promise<ApplicationShell.ILayout> {\n return this.shell.restored;\n }\n\n /**\n * Gets all of the valid, non-empty values of a given property\n * across all of the nodes in the hierarchy returned by contextMenuNodes\n */\n contextMenuValues(prop: string): any[] {\n let vals: any[] = [];\n for (let node of this.contextMenuNodes as any[]) {\n if (prop in node && node[prop]) {\n vals.push(node[prop]);\n }\n }\n return vals;\n }\n\n /**\n * Gets the first valid, non-empty value of a property\n * in the node hierarchy returned by contextMenuNodes.\n * Optionally, gets the first value that matches a passed-in RegExp\n */\n contextMenuFirst(prop: string, regexp: RegExp | null = null): any | null {\n if (regexp) {\n for (let node of this.contextMenuNodes as any[]) {\n if (prop in node && node[prop]) {\n let match = node[prop].match(regexp);\n if (match) {\n return match;\n }\n }\n }\n } else {\n for (let node of this.contextMenuNodes as any[]) {\n if (prop in node && node[prop]) {\n return node[prop];\n }\n }\n }\n\n return;\n }\n\n /**\n * Set the application state to dirty.\n *\n * @returns A disposable used to clear the dirty state for the caller.\n */\n setDirty(): IDisposable {\n const oldDirty = this.isDirty;\n this._dirtyCount++;\n if (this.isDirty !== oldDirty) {\n this._dirtySignal.emit(this.isDirty);\n }\n return new DisposableDelegate(() => {\n const oldDirty = this.isDirty;\n this._dirtyCount = Math.max(0, this._dirtyCount - 1);\n if (this.isDirty !== oldDirty) {\n this._dirtySignal.emit(this.isDirty);\n }\n });\n }\n\n /**\n * Set the application state to busy.\n *\n * @returns A disposable used to clear the busy state for the caller.\n */\n setBusy(): IDisposable {\n const oldBusy = this.isBusy;\n this._busyCount++;\n if (this.isBusy !== oldBusy) {\n this._busySignal.emit(this.isBusy);\n }\n return new DisposableDelegate(() => {\n const oldBusy = this.isBusy;\n this._busyCount--;\n if (this.isBusy !== oldBusy) {\n this._busySignal.emit(this.isBusy);\n }\n });\n }\n\n /**\n * Register plugins from a plugin module.\n *\n * @param mod - The plugin module to register.\n */\n registerPluginModule(mod: JupyterLab.IPluginModule): void {\n let data = mod.default;\n // Handle commonjs exports.\n if (!mod.hasOwnProperty('__esModule')) {\n data = mod as any;\n }\n if (!Array.isArray(data)) {\n data = [data];\n }\n data.forEach(item => {\n try {\n this.registerPlugin(item);\n } catch (error) {\n this.registerPluginErrors.push(error);\n }\n });\n }\n\n /**\n * Register the plugins from multiple plugin modules.\n *\n * @param mods - The plugin modules to register.\n */\n registerPluginModules(mods: JupyterLab.IPluginModule[]): void {\n mods.forEach(mod => {\n this.registerPluginModule(mod);\n });\n }\n\n private _contextMenuEvent: MouseEvent;\n private _info: JupyterLab.IInfo;\n private _dirtyCount = 0;\n private _busyCount = 0;\n private _busySignal: Signal<JupyterLab, boolean>;\n private _dirtySignal: Signal<JupyterLab, boolean>;\n}\n\n/**\n * The namespace for `JupyterLab` class statics.\n */\nexport namespace JupyterLab {\n /**\n * The options used to initialize a JupyterLab object.\n */\n export interface IOptions extends Partial<IInfo> {}\n\n /**\n * The information about a JupyterLab application.\n */\n export interface IInfo {\n /**\n * The name of the JupyterLab application.\n */\n readonly name: string;\n\n /**\n * The version of the JupyterLab application.\n */\n readonly version: string;\n\n /**\n * The namespace/prefix plugins may use to denote their origin.\n */\n readonly namespace: string;\n\n /**\n * Whether the application is in dev mode.\n */\n readonly devMode: boolean;\n\n /**\n * The collection of deferred extension patterns and matched extensions.\n */\n readonly deferred: { patterns: string[]; matches: string[] };\n\n /**\n * The collection of disabled extension patterns and matched extensions.\n */\n readonly disabled: { patterns: string[]; matches: string[] };\n\n /**\n * The mime renderer extensions.\n */\n readonly mimeExtensions: IRenderMime.IExtensionModule[];\n\n /**\n * The urls used by the application.\n */\n readonly urls: {\n readonly base: string;\n readonly page: string;\n readonly public: string;\n readonly settings: string;\n readonly themes: string;\n readonly tree: string;\n readonly workspaces: string;\n };\n\n /**\n * The local directories used by the application.\n */\n readonly directories: {\n readonly appSettings: string;\n readonly schemas: string;\n readonly static: string;\n readonly templates: string;\n readonly themes: string;\n readonly userSettings: string;\n readonly serverRoot: string;\n readonly workspaces: string;\n };\n\n /**\n * Whether files are cached on the server.\n */\n readonly filesCached: boolean;\n\n /**\n * The name of the current workspace.\n */\n readonly workspace: string;\n\n /**\n * The name of the default workspace.\n */\n readonly defaultWorkspace: string;\n }\n\n /**\n * The default application info.\n */\n export const defaultInfo: IInfo = {\n name: PageConfig.getOption('appName') || 'JupyterLab',\n namespace: PageConfig.getOption('appNamespace'),\n version: PageConfig.getOption('appVersion') || 'unknown',\n devMode: PageConfig.getOption('devMode').toLowerCase() === 'true',\n deferred: { patterns: [], matches: [] },\n disabled: { patterns: [], matches: [] },\n mimeExtensions: [],\n urls: {\n base: PageConfig.getOption('baseUrl'),\n page: PageConfig.getOption('pageUrl'),\n public: PageConfig.getOption('publicUrl'),\n settings: PageConfig.getOption('settingsUrl'),\n themes: PageConfig.getOption('themesUrl'),\n tree: PageConfig.getOption('treeUrl'),\n workspaces: PageConfig.getOption('workspacesUrl')\n },\n directories: {\n appSettings: PageConfig.getOption('appSettingsDir'),\n schemas: PageConfig.getOption('schemasDir'),\n static: PageConfig.getOption('staticDir'),\n templates: PageConfig.getOption('templatesDir'),\n themes: PageConfig.getOption('themesDir'),\n userSettings: PageConfig.getOption('userSettingsDir'),\n serverRoot: PageConfig.getOption('serverRoot'),\n workspaces: PageConfig.getOption('workspacesDir')\n },\n filesCached: PageConfig.getOption('cacheFiles').toLowerCase() === 'true',\n workspace: '',\n defaultWorkspace: ''\n };\n\n /**\n * The interface for a module that exports a plugin or plugins as\n * the default value.\n */\n export interface IPluginModule {\n /**\n * The default export.\n */\n default: JupyterLabPlugin<any> | JupyterLabPlugin<any>[];\n }\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"layoutrestorer.js","sourceRo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CAAC,CAAC,IAAI;SAC3E,CAAC;IACJ,CAAC;IAlBe,uBAAe,kBAkB9B,CAAA;AACH,CAAC,EApQS,OAAO,KAAP,OAAO,QAoQhB","sourcesContent":["/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\nimport { InstanceTracker } from '@jupyterlab/apputils';\n\nimport { IStateDB } from '@jupyterlab/coreutils';\n\nimport { CommandRegistry } from '@phosphor/commands';\n\nimport {\n JSONObject,\n PromiseDelegate,\n ReadonlyJSONObject,\n Token\n} from '@phosphor/coreutils';\n\nimport { AttachedProperty } from '@phosphor/properties';\n\nimport { DockPanel, Widget } from '@phosphor/widgets';\n\nimport { ApplicationShell } from './shell';\n\n/* tslint:disable */\n/**\n * The layout restorer token.\n */\nexport const ILayoutRestorer = new Token<ILayoutRestorer>(\n '@jupyterlab/application:ILayoutRestorer'\n);\n/* tslint:enable */\n\n/**\n * A static class that restores the widgets of the application when it reloads.\n */\nexport interface ILayoutRestorer {\n /**\n * A promise resolved when the layout restorer is ready to receive signals.\n */\n restored: Promise<void>;\n\n /**\n * Add a widget to be tracked by the layout restorer.\n */\n add(widget: Widget, name: string): void;\n\n /**\n * Restore the widgets of a particular instance tracker.\n *\n * @param tracker - The instance tracker whose widgets will be restored.\n *\n * @param options - The restoration options.\n */\n restore(\n tracker: InstanceTracker<any>,\n options: ILayoutRestorer.IRestoreOptions<any>\n ): void;\n}\n\n/**\n * A namespace for the layout restorer.\n */\nexport namespace ILayoutRestorer {\n /**\n * The state restoration configuration options.\n */\n export interface IRestoreOptions<T extends Widget> {\n /**\n * The command to execute when restoring instances.\n */\n command: string;\n\n /**\n * A function that returns the args needed to restore an instance.\n */\n args: (widget: T) => ReadonlyJSONObject;\n\n /**\n * A function that returns a unique persistent name for this instance.\n */\n name: (widget: T) => string;\n\n /**\n * The point after which it is safe to restore state.\n *\n * #### Notes\n * By definition, this promise or promises will happen after the application\n * has `started`.\n */\n when?: Promise<any> | Array<Promise<any>>;\n }\n}\n\n/**\n * The state database key for restorer data.\n */\nconst KEY = 'layout-restorer:data';\n\n/**\n * The default implementation of a layout restorer.\n *\n * #### Notes\n * The lifecycle for state restoration is subtle. The sequence of events is:\n *\n * 1. The layout restorer plugin is instantiated and makes a `fetch` call to\n * the database that stores the layout restoration data. The `fetch` call\n * returns a promise that resolves in step 6, below.\n *\n * 2. Other plugins that care about state restoration require the layout\n * restorer as a dependency.\n *\n * 3. As each load-time plugin initializes (which happens before the lab\n * application has `started`), it instructs the layout restorer whether\n * the restorer ought to `restore` its state by passing in its tracker.\n * Alternatively, a plugin that does not require its own instance tracker\n * (because perhaps it only creates a single widget, like a command palette),\n * can simply `add` its widget along with a persistent unique name to the\n * layout restorer so that its layout state can be restored when the lab\n * application restores.\n *\n * 4. After all the load-time plugins have finished initializing, the lab\n * application `started` promise will resolve. This is the `first`\n * promise that the layout restorer waits for. By this point, all of the\n * plugins that care about restoration will have instructed the layout\n * restorer to `restore` their state.\n *\n * 5. The layout restorer will then instruct each plugin's instance tracker\n * to restore its state and reinstantiate whichever widgets it wants. The\n * tracker returns a promise to the layout restorer that resolves when it\n * has completed restoring the tracked widgets it cares about.\n *\n * 6. As each instance tracker finishes restoring the widget instances it cares\n * about, it resolves the promise that was made to the layout restorer\n * (in step 5). After all of the promises that the restorer is awaiting have\n * resolved, the restorer then resolves the outstanding `fetch` promise\n * (from step 1) and hands off a layout state object to the application\n * shell's `restoreLayout` method for restoration.\n *\n * 7. Once the application shell has finished restoring the layout, the\n * JupyterLab application's `restored` promise is resolved.\n *\n * Of particular note are steps 5 and 6: since state restoration of plugins\n * is accomplished by executing commands, the command that is used to restore\n * the state of each plugin must return a promise that only resolves when the\n * widget has been created and added to the plugin's instance tracker.\n */\nexport class LayoutRestorer implements ILayoutRestorer {\n /**\n * Create a layout restorer.\n */\n constructor(options: LayoutRestorer.IOptions) {\n this._registry = options.registry;\n this._state = options.state;\n this._first = options.first;\n\n this._first\n .then(() => {\n this._firstDone = true;\n })\n .then(() => Promise.all(this._promises))\n .then(() => {\n this._promisesDone = true;\n\n // Release the tracker set.\n this._trackers.clear();\n })\n .then(() => {\n this._restored.resolve(void 0);\n });\n }\n\n /**\n * A promise resolved when the layout restorer is ready to receive signals.\n */\n get restored(): Promise<void> {\n return this._restored.promise;\n }\n\n /**\n * Add a widget to be tracked by the layout restorer.\n */\n add(widget: Widget, name: string): void {\n Private.nameProperty.set(widget, name);\n this._widgets.set(name, widget);\n widget.disposed.connect(this._onWidgetDisposed, this);\n }\n\n /**\n * Fetch the layout state for the application.\n *\n * #### Notes\n * Fetching the layout relies on all widget restoration to be complete, so\n * calls to `fetch` are guaranteed to return after restoration is complete.\n */\n fetch(): Promise<ApplicationShell.ILayout> {\n const blank: ApplicationShell.ILayout = {\n fresh: true,\n mainArea: null,\n leftArea: null,\n rightArea: null\n };\n let layout = this._state.fetch(KEY);\n\n return Promise.all([layout, this.restored])\n .then(([data]) => {\n if (!data) {\n return blank;\n }\n\n const { main, left, right } = data as Private.ILayout;\n\n // If any data exists, then this is not a fresh session.\n const fresh = false;\n\n // Rehydrate main area.\n const mainArea = this._rehydrateMainArea(main);\n\n // Rehydrate left area.\n const leftArea = this._rehydrateSideArea(left);\n\n // Rehydrate right area.\n const rightArea = this._rehydrateSideArea(right);\n\n return { fresh, mainArea, leftArea, rightArea };\n })\n .catch(() => blank); // Let fetch fail gracefully; return blank slate.\n }\n\n /**\n * Restore the widgets of a particular instance tracker.\n *\n * @param tracker - The instance tracker whose widgets will be restored.\n *\n * @param options - The restoration options.\n */\n restore(\n tracker: InstanceTracker<Widget>,\n options: ILayoutRestorer.IRestoreOptions<Widget>\n ): Promise<any> {\n const warning = 'restore() can only be called before `first` has resolved.';\n\n if (this._firstDone) {\n console.warn(warning);\n return Promise.reject(warning);\n }\n\n const { namespace } = tracker;\n if (this._trackers.has(namespace)) {\n let warning = `A tracker namespaced ${namespace} was already restored.`;\n console.warn(warning);\n return Promise.reject(warning);\n }\n\n const { args, command, name, when } = options;\n\n // Add the tracker to the private trackers collection.\n this._trackers.add(namespace);\n\n // Whenever a new widget is added to the tracker, record its name.\n tracker.widgetAdded.connect((sender: any, widget: Widget) => {\n const widgetName = name(widget);\n if (widgetName) {\n this.add(widget, `${namespace}:${widgetName}`);\n }\n }, this);\n\n // Whenever a widget is updated, get its new name.\n tracker.widgetUpdated.connect((sender, widget) => {\n const widgetName = name(widget);\n if (widgetName) {\n let name = `${namespace}:${widgetName}`;\n Private.nameProperty.set(widget, name);\n this._widgets.set(name, widget);\n }\n });\n\n const first = this._first;\n const promise = tracker\n .restore({\n args,\n command,\n name,\n registry: this._registry,\n state: this._state,\n when: when ? [first].concat(when) : first\n })\n .catch(error => {\n console.error(error);\n });\n\n this._promises.push(promise);\n return promise;\n }\n\n /**\n * Save the layout state for the application.\n */\n save(data: ApplicationShell.ILayout): Promise<void> {\n // If there are promises that are unresolved, bail.\n if (!this._promisesDone) {\n let warning = 'save() was called prematurely.';\n console.warn(warning);\n return Promise.reject(warning);\n }\n\n let dehydrated: Private.ILayout = {};\n\n // Dehydrate main area.\n dehydrated.main = this._dehydrateMainArea(data.mainArea);\n\n // Dehydrate left area.\n dehydrated.left = this._dehydrateSideArea(data.leftArea);\n\n // Dehydrate right area.\n dehydrated.right = this._dehydrateSideArea(data.rightArea);\n\n return this._state.save(KEY, dehydrated);\n }\n\n /**\n * Dehydrate a main area description into a serializable object.\n */\n private _dehydrateMainArea(\n area: ApplicationShell.IMainArea | null\n ): Private.IMainArea | null {\n if (!area) {\n return null;\n }\n return Private.serializeMain(area);\n }\n\n /**\n * Reydrate a serialized main area description object.\n *\n * #### Notes\n * This function consumes data that can become corrupted, so it uses type\n * coercion to guarantee the dehydrated object is safely processed.\n */\n private _rehydrateMainArea(\n area?: Private.IMainArea | null\n ): ApplicationShell.IMainArea | null {\n if (!area) {\n return null;\n }\n return Private.deserializeMain(area, this._widgets);\n }\n\n /**\n * Dehydrate a side area description into a serializable object.\n */\n private _dehydrateSideArea(\n area?: ApplicationShell.ISideArea | null\n ): Private.ISideArea | null {\n if (!area) {\n return null;\n }\n let dehydrated: Private.ISideArea = { collapsed: area.collapsed };\n if (area.currentWidget) {\n let current = Private.nameProperty.get(area.currentWidget);\n if (current) {\n dehydrated.current = current;\n }\n }\n if (area.widgets) {\n dehydrated.widgets = area.widgets\n .map(widget => Private.nameProperty.get(widget))\n .filter(name => !!name);\n }\n return dehydrated;\n }\n\n /**\n * Reydrate a serialized side area description object.\n *\n * #### Notes\n * This function consumes data that can become corrupted, so it uses type\n * coercion to guarantee the dehydrated object is safely processed.\n */\n private _rehydrateSideArea(\n area?: Private.ISideArea | null\n ): ApplicationShell.ISideArea {\n if (!area) {\n return { collapsed: true, currentWidget: null, widgets: null };\n }\n let internal = this._widgets;\n const collapsed = area.hasOwnProperty('collapsed')\n ? !!area.collapsed\n : false;\n const currentWidget =\n area.current && internal.has(`${area.current}`)\n ? internal.get(`${area.current}`)\n : null;\n const widgets = !Array.isArray(area.widgets)\n ? null\n : area.widgets\n .map(\n name => (internal.has(`${name}`) ? internal.get(`${name}`) : null)\n )\n .filter(widget => !!widget);\n return {\n collapsed,\n currentWidget: currentWidget!,\n widgets: widgets as Widget[] | null\n };\n }\n\n /**\n * Handle a widget disposal.\n */\n private _onWidgetDisposed(widget: Widget): void {\n let name = Private.nameProperty.get(widget);\n this._widgets.delete(name);\n }\n\n private _first: Promise<any>;\n private _firstDone = false;\n private _promisesDone = false;\n private _promises: Promise<any>[] = [];\n private _restored = new PromiseDelegate<void>();\n private _registry: CommandRegistry;\n private _state: IStateDB;\n private _trackers = new Set<string>();\n private _widgets = new Map<string, Widget>();\n}\n\n/**\n * A namespace for `LayoutRestorer` statics.\n */\nexport namespace LayoutRestorer {\n /**\n * The configuration options for layout restorer instantiation.\n */\n export interface IOptions {\n /**\n * The initial promise that has to be resolved before restoration.\n *\n * #### Notes\n * This promise should equal the JupyterLab application `started` notifier.\n */\n first: Promise<any>;\n\n /**\n * The application command registry.\n */\n registry: CommandRegistry;\n\n /**\n * The state database instance.\n */\n state: IStateDB;\n }\n}\n\n/*\n * A namespace for private data.\n */\nnamespace Private {\n /**\n * The dehydrated state of the application layout.\n *\n * #### Notes\n * This format is JSON serializable and saved in the state database.\n * It is meant to be a data structure can translate into an\n * `ApplicationShell.ILayout` data structure for consumption by\n * the application shell.\n */\n export interface ILayout extends JSONObject {\n /**\n * The main area of the user interface.\n */\n main?: IMainArea | null;\n\n /**\n * The left area of the user interface.\n */\n left?: ISideArea | null;\n\n /**\n * The right area of the user interface.\n */\n right?: ISideArea | null;\n }\n\n /**\n * The restorable description of the main application area.\n */\n export interface IMainArea extends JSONObject {\n /**\n * The current widget that has application focus.\n */\n current?: string | null;\n\n /**\n * The main application dock panel.\n */\n dock?: ISplitArea | ITabArea | null;\n\n /**\n * The document mode (i.e., multiple/single) of the main dock panel.\n */\n mode?: DockPanel.Mode | null;\n }\n\n /**\n * The restorable description of a sidebar in the user interface.\n */\n export interface ISideArea extends JSONObject {\n /**\n * A flag denoting whether the sidebar has been collapsed.\n */\n collapsed?: boolean | null;\n\n /**\n * The current widget that has side area focus.\n */\n current?: string | null;\n\n /**\n * The collection of widgets held by the sidebar.\n */\n widgets?: Array<string> | null;\n }\n\n /**\n * The restorable description of a tab area in the user interface.\n */\n export interface ITabArea extends JSONObject {\n /**\n * The type indicator of the serialized tab area.\n */\n type: 'tab-area';\n\n /**\n * The widgets in the tab area.\n */\n widgets: Array<string> | null;\n\n /**\n * The index of the selected tab.\n */\n currentIndex: number;\n }\n\n /**\n * The restorable description of a split area in the user interface.\n */\n export interface ISplitArea extends JSONObject {\n /**\n * The type indicator of the serialized split area.\n */\n type: 'split-area';\n\n /**\n * The orientation of the split area.\n */\n orientation: 'horizontal' | 'vertical';\n\n /**\n * The children in the split area.\n */\n children: Array<ITabArea | ISplitArea> | null;\n\n /**\n * The sizes of the children.\n */\n sizes: Array<number>;\n }\n\n /**\n * An attached property for a widget's ID in the state database.\n */\n export const nameProperty = new AttachedProperty<Widget, string>({\n name: 'name',\n create: owner => ''\n });\n\n /**\n * Serialize individual areas within the main area.\n */\n function serializeArea(\n area: ApplicationShell.AreaConfig | null\n ): ITabArea | ISplitArea | null {\n if (!area || !area.type) {\n return null;\n }\n\n if (area.type === 'tab-area') {\n return {\n type: 'tab-area',\n currentIndex: area.currentIndex,\n widgets: area.widgets\n .map(widget => nameProperty.get(widget))\n .filter(name => !!name)\n };\n }\n\n return {\n type: 'split-area',\n orientation: area.orientation,\n sizes: area.sizes,\n children: area.children.map(serializeArea).filter(area => !!area) as (\n | ITabArea\n | ISplitArea)[]\n };\n }\n\n /**\n * Return a dehydrated, serializable version of the main dock panel.\n */\n export function serializeMain(area: ApplicationShell.IMainArea): IMainArea {\n let dehydrated: IMainArea = {\n dock: (area && area.dock && serializeArea(area.dock.main)) || null\n };\n if (area) {\n dehydrated.mode = area.mode;\n if (area.currentWidget) {\n let current = Private.nameProperty.get(area.currentWidget);\n if (current) {\n dehydrated.current = current;\n }\n }\n }\n return dehydrated;\n }\n\n /**\n * Deserialize individual areas within the main area.\n *\n * #### Notes\n * Because this data comes from a potentially unreliable foreign source, it is\n * typed as a `JSONObject`; but the actual expected type is:\n * `ITabArea | ISplitArea`.\n *\n * For fault tolerance, types are manually checked in deserialization.\n */\n function deserializeArea(\n area: JSONObject,\n names: Map<string, Widget>\n ): ApplicationShell.AreaConfig | null {\n if (!area) {\n return null;\n }\n\n // Because this data is saved to a foreign data source, its type safety is\n // not guaranteed when it is retrieved, so exhaustive checks are necessary.\n const type = ((area as any).type as string) || 'unknown';\n if (type === 'unknown' || (type !== 'tab-area' && type !== 'split-area')) {\n console.warn(`Attempted to deserialize unknown type: ${type}`);\n return null;\n }\n\n if (type === 'tab-area') {\n const { currentIndex, widgets } = area as ITabArea;\n let hydrated: ApplicationShell.AreaConfig = {\n type: 'tab-area',\n currentIndex: currentIndex || 0,\n widgets:\n (widgets &&\n (widgets\n .map(widget => names.get(widget))\n .filter(widget => !!widget) as Widget[])) ||\n []\n };\n\n // Make sure the current index is within bounds.\n if (hydrated.currentIndex > hydrated.widgets.length - 1) {\n hydrated.currentIndex = 0;\n }\n\n return hydrated;\n }\n\n const { orientation, sizes, children } = area as ISplitArea;\n let hydrated: ApplicationShell.AreaConfig = {\n type: 'split-area',\n orientation: orientation,\n sizes: sizes || [],\n children:\n (children &&\n (children\n .map(child => deserializeArea(child, names))\n .filter(widget => !!widget) as ApplicationShell.AreaConfig[])) ||\n []\n };\n\n return hydrated;\n }\n\n /**\n * Return the hydrated version of the main dock panel, ready to restore.\n *\n * #### Notes\n * Because this data comes from a potentially unreliable foreign source, it is\n * typed as a `JSONObject`; but the actual expected type is: `IMainArea`.\n *\n * For fault tolerance, types are manually checked in deserialization.\n */\n export function deserializeMain(\n area: JSONObject,\n names: Map<string, Widget>\n ): ApplicationShell.IMainArea | null {\n if (!area) {\n return null;\n }\n\n const name = (area as any).current || null;\n const dock = (area as any).dock || null;\n const mode = (area as any).mode || null;\n\n return {\n currentWidget: (name && names.has(name) && names.get(name)) || null,\n dock: dock ? { main: deserializeArea(dock, names) } : null,\n mode:\n mode === 'multiple-document' || mode === 'single-document' ? mode : null\n };\n }\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"mimerenderers.js","sourceRoot":"","sources":["../../../../application/src/mimerenderers.ts"],"names":[],"mappings":";AAAA,0CAA0C;AAC1C,2DAA2D;;AAE3D,mDAAyE;AAEzE,yDAIiC;AAEjC,uDAA6D;AAI7D,mDAA4C;AAE5C,qDAAwD;AAIxD,qDAAmD;AAOnD,oBAAoB;AACpB;;GAEG;AACU,QAAA,oBAAoB,GAAG,IAAI,iBAAK,CAC3C,8CAA8C,CAC/C,CAAC;AACF,mBAAmB;AAEnB;;GAEG;AACH,iCACE,UAA0C;IAE1C,MAAM,OAAO,GAAoD,EAAE,CAAC;IAEpE,MAAM,SAAS,GAAG,2BAA2B,CAAC;IAC9C,MAAM,OAAO,GAAG,IAAI,0BA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oBACvB,UAAU;oBACV,SAAS,EAAE,MAAM,CAAC,SAAS;oBAC3B,IAAI,EAAE,MAAM,CAAC,IAAI;oBACjB,eAAe,EAAE,QAAQ,CAAC,WAAW,CAAC,MAAM,CAAC,eAAe,CAAC;oBAC7D,SAAS,EAAE,MAAM,CAAC,SAAS;oBAC3B,UAAU,EAAE,MAAM,CAAC,UAAU;oBAC7B,eAAe,EAAE,MAAM,CAAC,eAAe;iBACxC,CAAC,CAAC;gBACH,QAAQ,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC;gBAEnC,OAAO,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE;oBAC/C,OAAO,CAAC,mBAAmB,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;oBACtD,+DAA+D;oBAC/D,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,GAAG,EAAE;wBACtC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;oBACvB,CAAC,CAAC,CAAC;oBACH,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;gBACtB,CAAC,CAAC,CAAC;YACL,CAAC,CAAC,CAAC;QACL,CAAC;KACF,CAAC;AACJ,CAAC;AAlED,wDAkEC;AAED;;GAEG;AACH,IAAU,OAAO,CAWhB;AAXD,WAAU,OAAO;IACf;;;OAGG;IACU,2BAAmB,GAAG,IAAI,6BAAgB,CACrD;QACE,IAAI,EAAE,aAAa;QACnB,MAAM,EAAE,GAAG,EAAE,CAAC,SAAS;KACxB,CACF,CAAC;AACJ,CAAC,EAXS,OAAO,KAAP,OAAO,QAWhB","sourcesContent":["// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n\nimport { IInstanceTracker, InstanceTracker } from '@jupyterlab/apputils';\n\nimport {\n MimeDocumentFactory,\n DocumentRegistry,\n MimeDocument\n} from '@jupyterlab/docregistry';\n\nimport { IRenderMimeRegistry } from '@jupyterlab/rendermime';\n\nimport { IRenderMime } from '@jupyterlab/rendermime-interfaces';\n\nimport { Token } from '@phosphor/coreutils';\n\nimport { AttachedProperty } from '@phosphor/properties';\n\nimport { JupyterLab, JupyterLabPlugin } from './index';\n\nimport { ILayoutRestorer } from './layoutrestorer';\n\n/**\n * A class that tracks mime documents.\n */\nexport interface IMimeDocumentTracker extends IInstanceTracker<MimeDocument> {}\n\n/* tslint:disable */\n/**\n * The mime document tracker token.\n */\nexport const IMimeDocumentTracker = new Token<IMimeDocumentTracker>(\n '@jupyterlab/application:IMimeDocumentTracker'\n);\n/* tslint:enable */\n\n/**\n * Create rendermime plugins for rendermime extension modules.\n */\nexport function createRendermimePlugins(\n extensions: IRenderMime.IExtensionModule[]\n): JupyterLabPlugin<void | IMimeDocumentTracker>[] {\n const plugins: JupyterLabPlugin<void | IMimeDocumentTracker>[] = [];\n\n const namespace = 'application-mimedocuments';\n const tracker = new InstanceTracker<MimeDocument>({ namespace });\n\n extensions.forEach(mod => {\n let data = mod.default;\n\n // Handle CommonJS exports.\n if (!mod.hasOwnProperty('__esModule')) {\n data = mod as any;\n }\n if (!Array.isArray(data)) {\n data = [data] as ReadonlyArray<IRenderMime.IExtension>;\n }\n (data as ReadonlyArray<IRenderMime.IExtension>).forEach(item => {\n plugins.push(createRendermimePlugin(tracker, item));\n });\n });\n\n // Also add a meta-plugin handling state restoration\n // and exposing the mime document instance tracker.\n plugins.push({\n id: '@jupyterlab/application:mimedocument',\n requires: [ILayoutRestorer],\n provides: IMimeDocumentTracker,\n autoStart: true,\n activate: (app: JupyterLab, restorer: ILayoutRestorer) => {\n restorer.restore(tracker, {\n command: 'docmanager:open',\n args: widget => ({\n path: widget.context.path,\n factory: Private.factoryNameProperty.get(widget)\n }),\n name: widget =>\n `${widget.context.path}:${Private.factoryNameProperty.get(widget)}`\n });\n return tracker;\n }\n });\n\n return plugins;\n}\n\n/**\n * Create rendermime plugins for rendermime extension modules.\n */\nexport function createRendermimePlugin(\n tracker: InstanceTracker<MimeDocument>,\n item: IRenderMime.IExtension\n): JupyterLabPlugin<void> {\n return {\n id: item.id,\n requires: [ILayoutRestorer, IRenderMimeRegistry],\n autoStart: true,\n activate: (\n app: JupyterLab,\n restorer: ILayoutRestorer,\n rendermime: IRenderMimeRegistry\n ) => {\n // Add the mime renderer.\n if (item.rank !== undefined) {\n rendermime.addFactory(item.rendererFactory, item.rank);\n } else {\n rendermime.addFactory(item.rendererFactory);\n }\n\n // Handle the widget factory.\n if (!item.documentWidgetFactoryOptions) {\n return;\n }\n\n let registry = app.docRegistry;\n let options: IRenderMime.IDocumentWidgetFactoryOptions[] = [];\n if (Array.isArray(item.documentWidgetFactoryOptions)) {\n options = item.documentWidgetFactoryOptions;\n } else {\n options = [\n item.documentWidgetFactoryOptions as IRenderMime.IDocumentWidgetFactoryOptions\n ];\n }\n\n if (item.fileTypes) {\n item.fileTypes.forEach(ft => {\n app.docRegistry.addFileType(ft as DocumentRegistry.IFileType);\n });\n }\n\n options.forEach(option => {\n let factory = new MimeDocumentFactory({\n renderTimeout: item.renderTimeout,\n dataType: item.dataType,\n rendermime,\n modelName: option.modelName,\n name: option.name,\n primaryFileType: registry.getFileType(option.primaryFileType),\n fileTypes: option.fileTypes,\n defaultFor: option.defaultFor,\n defaultRendered: option.defaultRendered\n });\n registry.addWidgetFactory(factory);\n\n factory.widgetCreated.connect((sender, widget) => {\n Private.factoryNameProperty.set(widget, factory.name);\n // Notify the instance tracker if restore data needs to update.\n widget.context.pathChanged.connect(() => {\n tracker.save(widget);\n });\n tracker.add(widget);\n });\n });\n }\n };\n}\n\n/**\n * Private namespace for the module.\n */\nnamespace Private {\n /**\n * An attached property for keeping the factory name\n * that was used to create a mimedocument.\n */\n export const factoryNameProperty = new AttachedProperty<MimeDocument, string>(\n {\n name: 'factoryName',\n create: () => undefined\n }\n );\n}\n"]}
package/lib/router.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"router.js","sourceRoot":"","sources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AAO,OAAO,SAAS,EAAE,MAAM,CAAC,CAAC;gBAChE,IAAI,EAAE,CAAC;YACT,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,EAAE,CAAC;IACP,CAAC;CAIF;AA1JD,wBA0JC","sourcesContent":["/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\nimport { URLExt } from '@jupyterlab/coreutils';\n\nimport { CommandRegistry } from '@phosphor/commands';\n\nimport { ReadonlyJSONObject, Token } from '@phosphor/coreutils';\n\nimport { DisposableDelegate, IDisposable } from '@phosphor/disposable';\n\nimport { ISignal, Signal } from '@phosphor/signaling';\n\n/* tslint:disable */\n/**\n * The URL Router token.\n */\nexport const IRouter = new Token<IRouter>('@jupyterlab/application:IRouter');\n/* tslint:enable */\n\n/**\n * A static class that routes URLs within the application.\n */\nexport interface IRouter {\n /**\n * The base URL for the router.\n */\n readonly base: string;\n\n /**\n * The command registry used by the router.\n */\n readonly commands: CommandRegistry;\n\n /**\n * The parsed current URL of the application.\n */\n readonly current: IRouter.ILocation;\n\n /**\n * A signal emitted when the router routes a route.\n */\n readonly routed: ISignal<IRouter, IRouter.ILocation>;\n\n /**\n * If a matching rule's command resolves with the `stop` token during routing,\n * no further matches will execute.\n */\n readonly stop: Token<void>;\n\n /**\n * Navigate to a new path within the application.\n *\n * @param path - The new path or empty string if redirecting to root.\n *\n * @param options - The navigation options.\n */\n navigate(path: string, options?: IRouter.INavOptions): void;\n\n /**\n * Register a rule that maps a path pattern to a command.\n *\n * @param options - The route registration options.\n *\n * @returns A disposable that removes the registered rule from the router.\n */\n register(options: IRouter.IRegisterOptions): IDisposable;\n\n /**\n * Cause a hard reload of the document.\n */\n reload(): void;\n\n /**\n * Route a specific path to an action.\n *\n * @param url - The URL string that will be routed.\n *\n * #### Notes\n * If a pattern is matched, its command will be invoked with arguments that\n * match the `IRouter.ILocation` interface.\n */\n route(url: string): void;\n}\n\n/**\n * A namespace for the `IRouter` specification.\n */\nexport namespace IRouter {\n /**\n * The parsed location currently being routed.\n */\n export interface ILocation extends ReadonlyJSONObject {\n /**\n * The location hash.\n */\n hash: string;\n\n /**\n * The path that matched a routing pattern.\n */\n path: string;\n\n /**\n * The request being routed with the router `base` omitted.\n *\n * #### Notes\n * This field includes the query string and hash, if they exist.\n */\n request: string;\n\n /**\n * The search element, including leading question mark (`'?'`), if any,\n * of the path.\n */\n search: string;\n }\n\n /**\n * The options passed into a navigation request.\n */\n export interface INavOptions {\n /**\n * Whether the navigation should be hard URL change instead of an HTML\n * history API change.\n */\n hard?: boolean;\n\n /**\n * Whether the navigation should be added to the browser's history.\n */\n silent?: boolean;\n }\n\n /**\n * The specification for registering a route with the router.\n */\n export interface IRegisterOptions {\n /**\n * The command string that will be invoked upon matching.\n */\n command: string;\n\n /**\n * The regular expression that will be matched against URLs.\n */\n pattern: RegExp;\n\n /**\n * The rank order of the registered rule. A lower rank denotes a higher\n * priority. The default rank is `100`.\n */\n rank?: number;\n }\n}\n\n/**\n * A static class that routes URLs within the application.\n */\nexport class Router implements IRouter {\n /**\n * Create a URL router.\n */\n constructor(options: Router.IOptions) {\n this.base = options.base;\n this.commands = options.commands;\n }\n\n /**\n * The base URL for the router.\n */\n readonly base: string;\n\n /**\n * The command registry used by the router.\n */\n readonly commands: CommandRegistry;\n\n /**\n * Returns the parsed current URL of the application.\n */\n get current(): IRouter.ILocation {\n const { base } = this;\n const parsed = URLExt.parse(window.location.href);\n const { search, hash } = parsed;\n const path = parsed.pathname.replace(base, '/');\n const request = path + search + hash;\n\n return { hash, path, request, search };\n }\n\n /**\n * A signal emitted when the router routes a route.\n */\n get routed(): ISignal<this, IRouter.ILocation> {\n return this._routed;\n }\n\n /**\n * If a matching rule's command resolves with the `stop` token during routing,\n * no further matches will execute.\n */\n readonly stop = new Token<void>('@jupyterlab/application:Router#stop');\n\n /**\n * Navigate to a new path within the application.\n *\n * @param path - The new path or empty string if redirecting to root.\n *\n * @param options - The navigation options.\n */\n navigate(path: string, options: IRouter.INavOptions = {}): void {\n const { base } = this;\n const { history } = window;\n const { hard, silent } = options;\n const url =\n path && path.indexOf(base) === 0 ? path : URLExt.join(base, path);\n\n if (silent) {\n history.replaceState({}, '', url);\n } else {\n history.pushState({}, '', url);\n }\n\n if (hard) {\n return this.reload();\n }\n\n // Because a `route()` call may still be in the stack after having received\n // a `stop` token, wait for the next stack frame before calling `route()`.\n requestAnimationFrame(() => {\n this.route();\n });\n }\n\n /**\n * Register to route a path pattern to a command.\n *\n * @param options - The route registration options.\n *\n * @returns A disposable that removes the registered rule from the router.\n */\n register(options: IRouter.IRegisterOptions): IDisposable {\n const { command, pattern } = options;\n const rank = 'rank' in options ? options.rank : 100;\n const rules = this._rules;\n\n rules.set(pattern, { command, rank });\n\n return new DisposableDelegate(() => {\n rules.delete(pattern);\n });\n }\n\n /**\n * Cause a hard reload of the document.\n */\n reload(): void {\n window.location.reload();\n }\n\n /**\n * Route a specific path to an action.\n *\n * #### Notes\n * If a pattern is matched, its command will be invoked with arguments that\n * match the `IRouter.ILocation` interface.\n */\n route(): void {\n const { commands, current, stop } = this;\n const { request } = current;\n const routed = this._routed;\n const rules = this._rules;\n const matches: Private.Rule[] = [];\n\n // Collect all rules that match the URL.\n rules.forEach((rule, pattern) => {\n if (request.match(pattern)) {\n matches.push(rule);\n }\n });\n\n // Order the matching rules by rank and enqueue them.\n const queue = matches.sort((a, b) => b.rank - a.rank);\n\n // Process each enqueued command sequentially and short-circuit if a promise\n // resolves with the `stop` token.\n (function next() {\n if (!queue.length) {\n routed.emit(current);\n return;\n }\n\n const { command } = queue.pop();\n\n commands\n .execute(command, current)\n .then(result => {\n if (result === stop) {\n queue.length = 0;\n console.log(`Routing ${request} was short-circuited by ${command}`);\n }\n next();\n })\n .catch(reason => {\n console.warn(`Routing ${request} to ${command} failed`, reason);\n next();\n });\n })();\n }\n\n private _routed = new Signal<this, IRouter.ILocation>(this);\n private _rules = new Map<RegExp, Private.Rule>();\n}\n\n/**\n * A namespace for `Router` class statics.\n */\nexport namespace Router {\n /**\n * The options for instantiating a JupyterLab URL router.\n */\n export interface IOptions {\n /**\n * The fully qualified base URL for the router.\n */\n base: string;\n\n /**\n * The command registry used by the router.\n */\n commands: CommandRegistry;\n }\n}\n\n/**\n * A namespace for private module data.\n */\nnamespace Private {\n /**\n * The internal representation of a routing rule.\n */\n export type Rule = { command: string; rank: number };\n}\n"]}
package/lib/shell.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"shell.js","sourceRoot":"","sources":["../../../../application/src/shell.ts"],"names":[],"mappings":";AAAA,0CAA0C;AAC1C,2DAA2D;;AAE3D,mDAA+E;AAE/E,mDAAsD;AAEtD,mDAA4E;AAE5E,mDAAsD;AAEtD,+CAY2B;AAI3B;;GAEG;AACH,MAAM,uBAAuB,GAAG,qBAAqB,CAAC;AAEtD;;GAEG;AACH,MAAM,aAAa,GAAG,YAAY,CAAC;AAEnC;;GAEG;AACH,MAAM,aAAa,GAAG,gBAAgB,CAAC;AAEvC;;GAEG;AACH,MAAM,YAAY,GAAG,eAAe,CAAC;AAErC;;GAEG;AACH,MAAM,YAAY,GAAG,GAAG,CAAC;AAEzB;;GAEG;AACH,MAAM,cAAc,GAAG,iBAAiB,CAAC;AAEzC,MAAM,cAAc,GAAG,aAAa,CAAC;AAErC;;GAEG;AACH,sBAA8B,SAAQ,gBAAM;IAC1C;;OAEG;IACH;QACE,KAAK,EAAE,CAAC;QAmrBV;;WAEG;QACK,mBAAc,GAAG,CACvB,OAAwB,EACxB,GAAY,EACH,EAAE;YACX,QAAQ,GAAG,CAAC,IAAI,EAAE;gBAChB,KAAK,aAAa;oBACf,GAA2B,CAAC,KAAK,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC;oBAC5D,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAE,GAA2B,CAAC,KAAK,CAAC,CAAC;oBACtD,MAAM;gBACR,KAAK,eAAe;oBACjB,GAA2B,CAAC,KAAK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Y,sBAAc,iBAkN1B,CAAA;AACH,CAAC,EAlQS,OAAO,KAAP,OAAO,QAkQhB","sourcesContent":["// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n\nimport { ArrayExt, find, IIterator, iter, toArray } from '@phosphor/algorithm';\n\nimport { PromiseDelegate } from '@phosphor/coreutils';\n\nimport { Message, MessageLoop, IMessageHandler } from '@phosphor/messaging';\n\nimport { ISignal, Signal } from '@phosphor/signaling';\n\nimport {\n BoxLayout,\n BoxPanel,\n DockLayout,\n DockPanel,\n FocusTracker,\n Panel,\n SplitPanel,\n StackedPanel,\n TabBar,\n Title,\n Widget\n} from '@phosphor/widgets';\n\nimport { DocumentRegistry } from '@jupyterlab/docregistry';\n\n/**\n * The class name added to AppShell instances.\n */\nconst APPLICATION_SHELL_CLASS = 'jp-ApplicationShell';\n\n/**\n * The class name added to side bar instances.\n */\nconst SIDEBAR_CLASS = 'jp-SideBar';\n\n/**\n * The class name added to the current widget's title.\n */\nconst CURRENT_CLASS = 'jp-mod-current';\n\n/**\n * The class name added to the active widget's title.\n */\nconst ACTIVE_CLASS = 'jp-mod-active';\n\n/**\n * The default rank of items added to a sidebar.\n */\nconst DEFAULT_RANK = 500;\n\n/**\n * The data attribute added to the document body indicating shell's mode.\n */\nconst MODE_ATTRIBUTE = 'data-shell-mode';\n\nconst ACTIVITY_CLASS = 'jp-Activity';\n\n/**\n * The application shell for JupyterLab.\n */\nexport class ApplicationShell extends Widget {\n /**\n * Construct a new application shell.\n */\n constructor() {\n super();\n this.addClass(APPLICATION_SHELL_CLASS);\n this.id = 'main';\n\n let bottomPanel = (this._bottomPanel = new BoxPanel());\n let topPanel = (this._topPanel = new Panel());\n let hboxPanel = (this._hboxPanel = new BoxPanel());\n let dockPanel = (this._dockPanel = new DockPanel());\n MessageLoop.installMessageHook(dockPanel, this._dockChildHook);\n\n let hsplitPanel = (this._hsplitPanel = new SplitPanel());\n let leftHandler = (this._leftHandler = new Private.SideBarHandler('left'));\n let rightHandler = (this._rightHandler = new Private.SideBarHandler(\n 'right'\n ));\n let rootLayout = new BoxLayout();\n\n bottomPanel.id = 'jp-bottom-panel';\n topPanel.id = 'jp-top-panel';\n hboxPanel.id = 'jp-main-content-panel';\n dockPanel.id = 'jp-main-dock-panel';\n hsplitPanel.id = 'jp-main-split-panel';\n\n leftHandler.sideBar.addClass(SIDEBAR_CLASS);\n leftHandler.sideBar.addClass('jp-mod-left');\n leftHandler.stackedPanel.id = 'jp-left-stack';\n\n rightHandler.sideBar.addClass(SIDEBAR_CLASS);\n rightHandler.sideBar.addClass('jp-mod-right');\n rightHandler.stackedPanel.id = 'jp-right-stack';\n\n bottomPanel.direction = 'bottom-to-top';\n hboxPanel.spacing = 0;\n dockPanel.spacing = 5;\n hsplitPanel.spacing = 1;\n\n hboxPanel.direction = 'left-to-right';\n hsplitPanel.orientation = 'horizontal';\n\n SplitPanel.setStretch(leftHandler.stackedPanel, 0);\n SplitPanel.setStretch(dockPanel, 1);\n SplitPanel.setStretch(rightHandler.stackedPanel, 0);\n\n BoxPanel.setStretch(leftHandler.sideBar, 0);\n BoxPanel.setStretch(hsplitPanel, 1);\n BoxPanel.setStretch(rightHandler.sideBar, 0);\n\n hsplitPanel.addWidget(leftHandler.stackedPanel);\n hsplitPanel.addWidget(dockPanel);\n hsplitPanel.addWidget(rightHandler.stackedPanel);\n\n hboxPanel.addWidget(leftHandler.sideBar);\n hboxPanel.addWidget(hsplitPanel);\n hboxPanel.addWidget(rightHandler.sideBar);\n\n rootLayout.direction = 'top-to-bottom';\n rootLayout.spacing = 0; // TODO make this configurable?\n\n BoxLayout.setStretch(topPanel, 0);\n BoxLayout.setStretch(hboxPanel, 1);\n BoxLayout.setStretch(bottomPanel, 0);\n\n rootLayout.addWidget(topPanel);\n rootLayout.addWidget(hboxPanel);\n rootLayout.addWidget(bottomPanel);\n\n // initially hiding bottom panel when no elements inside\n this._bottomPanel.hide();\n\n this.layout = rootLayout;\n\n // Connect change listeners.\n this._tracker.currentChanged.connect(this._onCurrentChanged, this);\n this._tracker.activeChanged.connect(this._onActiveChanged, this);\n\n // Connect main layout change listener.\n this._dockPanel.layoutModified.connect(this._onLayoutModified, this);\n\n // Catch current changed events on the side handlers.\n this._leftHandler.sideBar.currentChanged.connect(\n this._onLayoutModified,\n this\n );\n this._rightHandler.sideBar.currentChanged.connect(\n this._onLayoutModified,\n this\n );\n }\n\n /**\n * A signal emitted when main area's active focus changes.\n */\n get activeChanged(): ISignal<this, ApplicationShell.IChangedArgs> {\n return this._activeChanged;\n }\n\n /**\n * The active widget in the shell's main area.\n */\n get activeWidget(): Widget | null {\n return this._tracker.activeWidget;\n }\n\n /**\n * A signal emitted when main area's current focus changes.\n */\n get currentChanged(): ISignal<this, ApplicationShell.IChangedArgs> {\n return this._currentChanged;\n }\n\n /**\n * The current widget in the shell's main area.\n */\n get currentWidget(): Widget | null {\n return this._tracker.currentWidget;\n }\n\n /**\n * A signal emitted when the main area's layout is modified.\n */\n get layoutModified(): ISignal<this, void> {\n return this._layoutModified;\n }\n\n /**\n * Whether the left area is collapsed.\n */\n get leftCollapsed(): boolean {\n return !this._leftHandler.sideBar.currentTitle;\n }\n\n /**\n * Whether the left area is collapsed.\n */\n get rightCollapsed(): boolean {\n return !this._rightHandler.sideBar.currentTitle;\n }\n\n /**\n * Whether JupyterLab is in presentation mode with the `jp-mod-presentationMode` CSS class.\n */\n get presentationMode(): boolean {\n return this.hasClass('jp-mod-presentationMode');\n }\n\n /**\n * Enable/disable presentation mode (`jp-mod-presentationMode` CSS class) with a boolean.\n */\n set presentationMode(value: boolean) {\n this.toggleClass('jp-mod-presentationMode', value);\n }\n\n /**\n * The main dock area's user interface mode.\n */\n get mode(): DockPanel.Mode {\n return this._dockPanel.mode;\n }\n set mode(mode: DockPanel.Mode) {\n const dock = this._dockPanel;\n if (mode === dock.mode) {\n return;\n }\n\n const applicationCurrentWidget = this.currentWidget;\n\n if (mode === 'single-document') {\n this._cachedLayout = dock.saveLayout();\n dock.mode = mode;\n\n // In case the active widget in the dock panel is *not* the active widget\n // of the application, defer to the application.\n if (this.currentWidget) {\n dock.activateWidget(this.currentWidget);\n }\n\n // Set the mode data attribute on the document body.\n document.body.setAttribute(MODE_ATTRIBUTE, mode);\n return;\n }\n\n // Cache a reference to every widget currently in the dock panel.\n const widgets = toArray(dock.widgets());\n\n // Toggle back to multiple document mode.\n dock.mode = mode;\n\n // Restore the original layout.\n if (this._cachedLayout) {\n // Remove any disposed widgets in the cached layout and restore.\n Private.normalizeAreaConfig(dock, this._cachedLayout.main);\n dock.restoreLayout(this._cachedLayout);\n this._cachedLayout = null;\n }\n\n // Add any widgets created during single document mode, which have\n // subsequently been removed from the dock panel after the multiple document\n // layout has been restored. If the widget has add options cached for\n // it (i.e., if it has been placed with respect to another widget),\n // then take that into account.\n widgets.forEach(widget => {\n if (!widget.parent) {\n this.addToMainArea(widget, {\n ...this._addOptionsCache.get(widget),\n activate: false\n });\n }\n });\n this._addOptionsCache.clear();\n\n // In case the active widget in the dock panel is *not* the active widget\n // of the application, defer to the application.\n if (applicationCurrentWidget) {\n dock.activateWidget(applicationCurrentWidget);\n }\n\n // Set the mode data attribute on the document body.\n document.body.setAttribute(MODE_ATTRIBUTE, mode);\n }\n\n /**\n * Promise that resolves when state is first restored, returning layout\n * description.\n */\n get restored(): Promise<ApplicationShell.ILayout> {\n return this._restored.promise;\n }\n\n /**\n * Activate a widget in its area.\n */\n activateById(id: string): void {\n if (this._leftHandler.has(id)) {\n this._leftHandler.activate(id);\n return;\n }\n\n if (this._rightHandler.has(id)) {\n this._rightHandler.activate(id);\n return;\n }\n\n const dock = this._dockPanel;\n const widget = find(dock.widgets(), value => value.id === id);\n\n if (widget) {\n dock.activateWidget(widget);\n }\n }\n\n /*\n * Activate the next Tab in the active TabBar.\n */\n activateNextTab(): void {\n let current = this._currentTabBar();\n if (!current) {\n return;\n }\n\n let ci = current.currentIndex;\n if (ci === -1) {\n return;\n }\n\n if (ci < current.titles.length - 1) {\n current.currentIndex += 1;\n if (current.currentTitle) {\n current.currentTitle.owner.activate();\n }\n return;\n }\n\n if (ci === current.titles.length - 1) {\n let nextBar = this._adjacentBar('next');\n if (nextBar) {\n nextBar.currentIndex = 0;\n if (nextBar.currentTitle) {\n nextBar.currentTitle.owner.activate();\n }\n }\n }\n }\n\n /*\n * Activate the previous Tab in the active TabBar.\n */\n activatePreviousTab(): void {\n let current = this._currentTabBar();\n if (!current) {\n return;\n }\n\n let ci = current.currentIndex;\n if (ci === -1) {\n return;\n }\n\n if (ci > 0) {\n current.currentIndex -= 1;\n if (current.currentTitle) {\n current.currentTitle.owner.activate();\n }\n return;\n }\n\n if (ci === 0) {\n let prevBar = this._adjacentBar('previous');\n if (prevBar) {\n let len = prevBar.titles.length;\n prevBar.currentIndex = len - 1;\n if (prevBar.currentTitle) {\n prevBar.currentTitle.owner.activate();\n }\n }\n }\n }\n\n /**\n * Add a widget to the left content area.\n *\n * #### Notes\n * Widgets must have a unique `id` property, which will be used as the DOM id.\n */\n addToLeftArea(\n widget: Widget,\n options: ApplicationShell.ISideAreaOptions = {}\n ): void {\n if (!widget.id) {\n console.error('Widgets added to app shell must have unique id property.');\n return;\n }\n let rank = 'rank' in options ? options.rank : DEFAULT_RANK;\n this._leftHandler.addWidget(widget, rank!);\n this._onLayoutModified();\n }\n\n /**\n * Add a widget to the main content area.\n *\n * #### Notes\n * Widgets must have a unique `id` property, which will be used as the DOM id.\n * All widgets added to the main area should be disposed after removal\n * (disposal before removal will remove the widget automatically).\n *\n * In the options, `ref` defaults to `null`, `mode` defaults to `'tab-after'`,\n * and `activate` defaults to `true`.\n */\n addToMainArea(\n widget: Widget,\n options: ApplicationShell.IMainAreaOptions = {}\n ): void {\n if (!widget.id) {\n console.error('Widgets added to app shell must have unique id property.');\n return;\n }\n\n let dock = this._dockPanel;\n\n let ref: Widget | null = null;\n if (options.ref) {\n ref = find(dock.widgets(), value => value.id === options.ref!) || null;\n }\n\n let mode = options.mode || 'tab-after';\n\n dock.addWidget(widget, { mode, ref });\n\n // The dock panel doesn't account for placement information while\n // in single document mode, so upon rehydrating any widgets that were\n // added will not be in the correct place. Cache the placement information\n // here so that we can later rehydrate correctly.\n if (dock.mode === 'single-document') {\n this._addOptionsCache.set(widget, options);\n }\n\n if (options.activate !== false) {\n dock.activateWidget(widget);\n }\n }\n\n /**\n * Add a widget to the right content area.\n *\n * #### Notes\n * Widgets must have a unique `id` property, which will be used as the DOM id.\n */\n addToRightArea(\n widget: Widget,\n options: ApplicationShell.ISideAreaOptions = {}\n ): void {\n if (!widget.id) {\n console.error('Widgets added to app shell must have unique id property.');\n return;\n }\n let rank = 'rank' in options ? options.rank : DEFAULT_RANK;\n this._rightHandler.addWidget(widget, rank!);\n this._onLayoutModified();\n }\n\n /**\n * Add a widget to the top content area.\n *\n * #### Notes\n * Widgets must have a unique `id` property, which will be used as the DOM id.\n */\n addToTopArea(\n widget: Widget,\n options: ApplicationShell.ISideAreaOptions = {}\n ): void {\n if (!widget.id) {\n console.error('Widgets added to app shell must have unique id property.');\n return;\n }\n // Temporary: widgets are added to the panel in order of insertion.\n this._topPanel.addWidget(widget);\n this._onLayoutModified();\n }\n\n /**\n * Add a widget to the bottom content area.\n *\n * #### Notes\n * Widgets must have a unique `id` property, which will be used as the DOM id.\n */\n\n addToBottomArea(\n widget: Widget,\n options: ApplicationShell.ISideAreaOptions = {}\n ): void {\n if (!widget.id) {\n console.error('Widgets added to app shell must have unique id property.');\n return;\n }\n // Temporary: widgets are added to the panel in order of insertion.\n this._bottomPanel.addWidget(widget);\n this._onLayoutModified();\n\n if (this._bottomPanel.isHidden) {\n this._bottomPanel.show();\n }\n }\n\n /**\n * Collapse the left area.\n */\n collapseLeft(): void {\n this._leftHandler.collapse();\n this._onLayoutModified();\n }\n\n /**\n * Collapse the right area.\n */\n collapseRight(): void {\n this._rightHandler.collapse();\n this._onLayoutModified();\n }\n\n /**\n * Expand the left area.\n *\n * #### Notes\n * This will open the most recently used tab,\n * or the first tab if there is no most recently used.\n */\n expandLeft(): void {\n this._leftHandler.expand();\n this._onLayoutModified();\n }\n\n /**\n * Expand the right area.\n *\n * #### Notes\n * This will open the most recently used tab,\n * or the first tab if there is no most recently used.\n */\n expandRight(): void {\n this._rightHandler.expand();\n this._onLayoutModified();\n }\n\n /**\n * Close all widgets in the main area.\n */\n closeAll(): void {\n // Make a copy of all the widget in the dock panel (using `toArray()`)\n // before removing them because removing them while iterating through them\n // modifies the underlying data of the iterator.\n toArray(this._dockPanel.widgets()).forEach(widget => widget.close());\n }\n\n /**\n * True if the given area is empty.\n */\n isEmpty(area: ApplicationShell.Area): boolean {\n switch (area) {\n case 'left':\n return this._leftHandler.stackedPanel.widgets.length === 0;\n case 'main':\n return this._dockPanel.isEmpty;\n case 'top':\n return this._topPanel.widgets.length === 0;\n case 'bottom':\n return this._bottomPanel.widgets.length === 0;\n case 'right':\n return this._rightHandler.stackedPanel.widgets.length === 0;\n default:\n return true;\n }\n }\n\n /**\n * Restore the layout state for the application shell.\n */\n restoreLayout(layout: ApplicationShell.ILayout): void {\n const { mainArea, leftArea, rightArea } = layout;\n\n // Rehydrate the main area.\n if (mainArea) {\n const { currentWidget, dock, mode } = mainArea;\n\n if (dock) {\n this._dockPanel.restoreLayout(dock);\n }\n if (mode) {\n this.mode = mode;\n }\n if (currentWidget) {\n this.activateById(currentWidget.id);\n }\n }\n\n // Rehydrate the left area.\n if (leftArea) {\n this._leftHandler.rehydrate(leftArea);\n }\n\n // Rehydrate the right area.\n if (rightArea) {\n this._rightHandler.rehydrate(rightArea);\n }\n\n if (!this._isRestored) {\n // Make sure all messages in the queue are finished before notifying\n // any extensions that are waiting for the promise that guarantees the\n // application state has been restored.\n MessageLoop.flush();\n this._restored.resolve(layout);\n }\n }\n\n /**\n * Save the dehydrated state of the application shell.\n */\n saveLayout(): ApplicationShell.ILayout {\n // If the application is in single document mode, use the cached layout if\n // available. Otherwise, default to querying the dock panel for layout.\n return {\n mainArea: {\n currentWidget: this._tracker.currentWidget,\n dock:\n this.mode === 'single-document'\n ? this._cachedLayout || this._dockPanel.saveLayout()\n : this._dockPanel.saveLayout(),\n mode: this._dockPanel.mode\n },\n leftArea: this._leftHandler.dehydrate(),\n rightArea: this._rightHandler.dehydrate()\n };\n }\n\n /**\n * Returns the widgets for an application area.\n */\n widgets(area: ApplicationShell.Area): IIterator<Widget> {\n switch (area) {\n case 'main':\n return this._dockPanel.widgets();\n case 'left':\n return iter(this._leftHandler.sideBar.titles.map(t => t.owner));\n case 'right':\n return iter(this._rightHandler.sideBar.titles.map(t => t.owner));\n case 'top':\n return this._topPanel.children();\n case 'bottom':\n return this._bottomPanel.children();\n default:\n throw new Error('Invalid area');\n }\n }\n\n /**\n * Handle `after-attach` messages for the application shell.\n */\n protected onAfterAttach(msg: Message): void {\n document.body.setAttribute(MODE_ATTRIBUTE, this.mode);\n }\n\n /*\n * Return the tab bar adjacent to the current TabBar or `null`.\n */\n private _adjacentBar(direction: 'next' | 'previous'): TabBar<Widget> | null {\n const current = this._currentTabBar();\n if (!current) {\n return null;\n }\n\n const bars = toArray(this._dockPanel.tabBars());\n const len = bars.length;\n const index = bars.indexOf(current);\n\n if (direction === 'previous') {\n return index > 0 ? bars[index - 1] : index === 0 ? bars[len - 1] : null;\n }\n\n // Otherwise, direction is 'next'.\n return index < len - 1\n ? bars[index + 1]\n : index === len - 1 ? bars[0] : null;\n }\n\n /*\n * Return the TabBar that has the currently active Widget or null.\n */\n private _currentTabBar(): TabBar<Widget> | null {\n const current = this._tracker.currentWidget;\n if (!current) {\n return null;\n }\n\n const title = current.title;\n const bars = this._dockPanel.tabBars();\n return find(bars, bar => bar.titles.indexOf(title) > -1) || null;\n }\n\n /**\n * Handle a change to the dock area active widget.\n */\n private _onActiveChanged(\n sender: any,\n args: FocusTracker.IChangedArgs<Widget>\n ): void {\n if (args.newValue) {\n args.newValue.title.className += ` ${ACTIVE_CLASS}`;\n }\n if (args.oldValue) {\n args.oldValue.title.className = args.oldValue.title.className.replace(\n ACTIVE_CLASS,\n ''\n );\n }\n this._activeChanged.emit(args);\n }\n\n /**\n * Handle a change to the dock area current widget.\n */\n private _onCurrentChanged(\n sender: any,\n args: FocusTracker.IChangedArgs<Widget>\n ): void {\n if (args.newValue) {\n args.newValue.title.className += ` ${CURRENT_CLASS}`;\n }\n if (args.oldValue) {\n args.oldValue.title.className = args.oldValue.title.className.replace(\n CURRENT_CLASS,\n ''\n );\n }\n this._currentChanged.emit(args);\n this._onLayoutModified();\n }\n\n /**\n * Handle a change to the layout.\n */\n private _onLayoutModified(): void {\n // The dock can emit layout modified signals while in transient\n // states (for instance, when switching from single-document to\n // multiple-document mode). In those states, it can be unreliable\n // for the signal consumers to query layout properties.\n // We fix this by debouncing the layout modified signal so that it\n // is only emitted after rearranging is done.\n window.clearTimeout(this._debouncer);\n this._debouncer = window.setTimeout(() => {\n this._layoutModified.emit(undefined);\n }, 0);\n }\n\n /**\n * A message hook for child add/remove messages on the main area dock panel.\n */\n private _dockChildHook = (\n handler: IMessageHandler,\n msg: Message\n ): boolean => {\n switch (msg.type) {\n case 'child-added':\n (msg as Widget.ChildMessage).child.addClass(ACTIVITY_CLASS);\n this._tracker.add((msg as Widget.ChildMessage).child);\n break;\n case 'child-removed':\n (msg as Widget.ChildMessage).child.removeClass(ACTIVITY_CLASS);\n this._tracker.remove((msg as Widget.ChildMessage).child);\n break;\n default:\n break;\n }\n return true;\n };\n\n private _activeChanged = new Signal<this, ApplicationShell.IChangedArgs>(\n this\n );\n private _cachedLayout: DockLayout.ILayoutConfig | null = null;\n private _currentChanged = new Signal<this, ApplicationShell.IChangedArgs>(\n this\n );\n private _dockPanel: DockPanel;\n private _hboxPanel: BoxPanel;\n private _hsplitPanel: SplitPanel;\n private _isRestored = false;\n private _layoutModified = new Signal<this, void>(this);\n private _leftHandler: Private.SideBarHandler;\n private _restored = new PromiseDelegate<ApplicationShell.ILayout>();\n private _rightHandler: Private.SideBarHandler;\n private _tracker = new FocusTracker<Widget>();\n private _topPanel: Panel;\n private _bottomPanel: Panel;\n private _debouncer = 0;\n private _addOptionsCache = new Map<\n Widget,\n ApplicationShell.IMainAreaOptions\n >();\n}\n\n/**\n * The namespace for `ApplicationShell` class statics.\n */\nexport namespace ApplicationShell {\n /**\n * The areas of the application shell where widgets can reside.\n */\n export type Area = 'main' | 'top' | 'left' | 'right' | 'bottom';\n\n /**\n * The restorable description of an area within the main dock panel.\n */\n export type AreaConfig = DockLayout.AreaConfig;\n\n /**\n * An arguments object for the changed signals.\n */\n export type IChangedArgs = FocusTracker.IChangedArgs<Widget>;\n\n /**\n * A description of the application's user interface layout.\n */\n export interface ILayout {\n /**\n * Indicates whether fetched session restore data was actually retrieved\n * from the state database or whether it is a fresh blank slate.\n *\n * #### Notes\n * This attribute is only relevant when the layout data is retrieved via a\n * `fetch` call. If it is set when being passed into `save`, it will be\n * ignored.\n */\n readonly fresh?: boolean;\n\n /**\n * The main area of the user interface.\n */\n readonly mainArea: IMainArea | null;\n\n /**\n * The left area of the user interface.\n */\n readonly leftArea: ISideArea | null;\n\n /**\n * The right area of the user interface.\n */\n readonly rightArea: ISideArea | null;\n }\n\n /**\n * The restorable description of the main application area.\n */\n export interface IMainArea {\n /**\n * The current widget that has application focus.\n */\n readonly currentWidget: Widget | null;\n\n /**\n * The contents of the main application dock panel.\n */\n readonly dock: DockLayout.ILayoutConfig | null;\n\n /**\n * The document mode (i.e., multiple/single) of the main dock panel.\n */\n readonly mode: DockPanel.Mode | null;\n }\n\n /**\n * The restorable description of a sidebar in the user interface.\n */\n export interface ISideArea {\n /**\n * A flag denoting whether the sidebar has been collapsed.\n */\n readonly collapsed: boolean;\n\n /**\n * The current widget that has side area focus.\n */\n readonly currentWidget: Widget | null;\n\n /**\n * The collection of widgets held by the sidebar.\n */\n readonly widgets: Array<Widget> | null;\n }\n\n /**\n * The options for adding a widget to a side area of the shell.\n */\n export interface ISideAreaOptions {\n /**\n * The rank order of the widget among its siblings.\n */\n rank?: number;\n }\n\n /**\n * The options for adding a widget to a side area of the shell.\n */\n export interface IMainAreaOptions extends DocumentRegistry.IOpenOptions {}\n}\n\nnamespace Private {\n /**\n * An object which holds a widget and its sort rank.\n */\n export interface IRankItem {\n /**\n * The widget for the item.\n */\n widget: Widget;\n\n /**\n * The sort rank of the widget.\n */\n rank: number;\n }\n\n /**\n * A less-than comparison function for side bar rank items.\n */\n export function itemCmp(first: IRankItem, second: IRankItem): number {\n return first.rank - second.rank;\n }\n\n /**\n * Removes widgets that have been disposed from an area config, mutates area.\n */\n export function normalizeAreaConfig(\n parent: DockPanel,\n area?: DockLayout.AreaConfig | null\n ): void {\n if (!area) {\n return;\n }\n if (area.type === 'tab-area') {\n area.widgets = area.widgets.filter(\n widget => !widget.isDisposed && widget.parent === parent\n ) as Widget[];\n return;\n }\n area.children.forEach(child => {\n normalizeAreaConfig(parent, child);\n });\n }\n\n /**\n * A class which manages a side bar and related stacked panel.\n */\n export class SideBarHandler {\n /**\n * Construct a new side bar handler.\n */\n constructor(side: string) {\n this._side = side;\n this._sideBar = new TabBar<Widget>({\n insertBehavior: 'none',\n removeBehavior: 'none',\n allowDeselect: true\n });\n this._stackedPanel = new StackedPanel();\n this._sideBar.hide();\n this._stackedPanel.hide();\n this._lastCurrent = null;\n this._sideBar.currentChanged.connect(this._onCurrentChanged, this);\n this._sideBar.tabActivateRequested.connect(\n this._onTabActivateRequested,\n this\n );\n this._stackedPanel.widgetRemoved.connect(this._onWidgetRemoved, this);\n }\n\n /**\n * Get the tab bar managed by the handler.\n */\n get sideBar(): TabBar<Widget> {\n return this._sideBar;\n }\n\n /**\n * Get the stacked panel managed by the handler\n */\n get stackedPanel(): StackedPanel {\n return this._stackedPanel;\n }\n\n /**\n * Expand the sidebar.\n *\n * #### Notes\n * This will open the most recently used tab, or the first tab\n * if there is no most recently used.\n */\n expand(): void {\n const previous =\n this._lastCurrent || (this._items.length > 0 && this._items[0].widget);\n if (previous) {\n this.activate(previous.id);\n }\n }\n\n /**\n * Activate a widget residing in the side bar by ID.\n *\n * @param id - The widget's unique ID.\n */\n activate(id: string): void {\n let widget = this._findWidgetByID(id);\n if (widget) {\n this._sideBar.currentTitle = widget.title;\n widget.activate();\n }\n }\n\n /**\n * Test whether the sidebar has the given widget by id.\n */\n has(id: string): boolean {\n return this._findWidgetByID(id) !== null;\n }\n\n /**\n * Collapse the sidebar so no items are expanded.\n */\n collapse(): void {\n this._sideBar.currentTitle = null;\n }\n\n /**\n * Add a widget and its title to the stacked panel and side bar.\n *\n * If the widget is already added, it will be moved.\n */\n addWidget(widget: Widget, rank: number): void {\n widget.parent = null;\n widget.hide();\n let item = { widget, rank };\n let index = this._findInsertIndex(item);\n ArrayExt.insert(this._items, index, item);\n this._stackedPanel.insertWidget(index, widget);\n this._sideBar.insertTab(index, widget.title);\n this._refreshVisibility();\n }\n\n /**\n * Dehydrate the side bar data.\n */\n dehydrate(): ApplicationShell.ISideArea {\n let collapsed = this._sideBar.currentTitle === null;\n let widgets = toArray(this._stackedPanel.widgets);\n let currentWidget = widgets[this._sideBar.currentIndex];\n return { collapsed, currentWidget, widgets };\n }\n\n /**\n * Rehydrate the side bar.\n */\n rehydrate(data: ApplicationShell.ISideArea): void {\n if (data.currentWidget) {\n this.activate(data.currentWidget.id);\n } else if (data.collapsed) {\n this.collapse();\n }\n }\n\n /**\n * Find the insertion index for a rank item.\n */\n private _findInsertIndex(item: Private.IRankItem): number {\n return ArrayExt.upperBound(this._items, item, Private.itemCmp);\n }\n\n /**\n * Find the index of the item with the given widget, or `-1`.\n */\n private _findWidgetIndex(widget: Widget): number {\n return ArrayExt.findFirstIndex(this._items, i => i.widget === widget);\n }\n\n /**\n * Find the widget which owns the given title, or `null`.\n */\n private _findWidgetByTitle(title: Title<Widget>): Widget | null {\n let item = find(this._items, value => value.widget.title === title);\n return item ? item.widget : null;\n }\n\n /**\n * Find the widget with the given id, or `null`.\n */\n private _findWidgetByID(id: string): Widget | null {\n let item = find(this._items, value => value.widget.id === id);\n return item ? item.widget : null;\n }\n\n /**\n * Refresh the visibility of the side bar and stacked panel.\n */\n private _refreshVisibility(): void {\n this._sideBar.setHidden(this._sideBar.titles.length === 0);\n this._stackedPanel.setHidden(this._sideBar.currentTitle === null);\n }\n\n /**\n * Handle the `currentChanged` signal from the sidebar.\n */\n private _onCurrentChanged(\n sender: TabBar<Widget>,\n args: TabBar.ICurrentChangedArgs<Widget>\n ): void {\n const oldWidget = args.previousTitle\n ? this._findWidgetByTitle(args.previousTitle)\n : null;\n const newWidget = args.currentTitle\n ? this._findWidgetByTitle(args.currentTitle)\n : null;\n if (oldWidget) {\n oldWidget.hide();\n }\n if (newWidget) {\n newWidget.show();\n }\n this._lastCurrent = newWidget || oldWidget;\n if (newWidget) {\n const id = newWidget.id;\n document.body.setAttribute(`data-${this._side}-sidebar-widget`, id);\n } else {\n document.body.removeAttribute(`data-${this._side}-sidebar-widget`);\n }\n this._refreshVisibility();\n }\n\n /**\n * Handle a `tabActivateRequest` signal from the sidebar.\n */\n private _onTabActivateRequested(\n sender: TabBar<Widget>,\n args: TabBar.ITabActivateRequestedArgs<Widget>\n ): void {\n args.title.owner.activate();\n }\n\n /*\n * Handle the `widgetRemoved` signal from the stacked panel.\n */\n private _onWidgetRemoved(sender: StackedPanel, widget: Widget): void {\n if (widget === this._lastCurrent) {\n this._lastCurrent = null;\n }\n ArrayExt.removeAt(this._items, this._findWidgetIndex(widget));\n this._sideBar.removeTab(widget.title);\n this._refreshVisibility();\n }\n\n private _items = new Array<Private.IRankItem>();\n private _side: string;\n private _sideBar: TabBar<Widget>;\n private _stackedPanel: StackedPanel;\n private _lastCurrent: Widget | null;\n }\n}\n"]}
@@ -1,278 +0,0 @@
1
- /**
2
- * google-material-color v1.2.6
3
- * https://github.com/danlevan/google-material-color
4
- */
5
- :root {
6
- --md-red-50: #ffebee;
7
- --md-red-100: #ffcdd2;
8
- --md-red-200: #ef9a9a;
9
- --md-red-300: #e57373;
10
- --md-red-400: #ef5350;
11
- --md-red-500: #f44336;
12
- --md-red-600: #e53935;
13
- --md-red-700: #d32f2f;
14
- --md-red-800: #c62828;
15
- --md-red-900: #b71c1c;
16
- --md-red-A100: #ff8a80;
17
- --md-red-A200: #ff5252;
18
- --md-red-A400: #ff1744;
19
- --md-red-A700: #d50000;
20
-
21
- --md-pink-50: #fce4ec;
22
- --md-pink-100: #f8bbd0;
23
- --md-pink-200: #f48fb1;
24
- --md-pink-300: #f06292;
25
- --md-pink-400: #ec407a;
26
- --md-pink-500: #e91e63;
27
- --md-pink-600: #d81b60;
28
- --md-pink-700: #c2185b;
29
- --md-pink-800: #ad1457;
30
- --md-pink-900: #880e4f;
31
- --md-pink-A100: #ff80ab;
32
- --md-pink-A200: #ff4081;
33
- --md-pink-A400: #f50057;
34
- --md-pink-A700: #c51162;
35
-
36
- --md-purple-50: #f3e5f5;
37
- --md-purple-100: #e1bee7;
38
- --md-purple-200: #ce93d8;
39
- --md-purple-300: #ba68c8;
40
- --md-purple-400: #ab47bc;
41
- --md-purple-500: #9c27b0;
42
- --md-purple-600: #8e24aa;
43
- --md-purple-700: #7b1fa2;
44
- --md-purple-800: #6a1b9a;
45
- --md-purple-900: #4a148c;
46
- --md-purple-A100: #ea80fc;
47
- --md-purple-A200: #e040fb;
48
- --md-purple-A400: #d500f9;
49
- --md-purple-A700: #aa00ff;
50
-
51
- --md-deep-purple-50: #ede7f6;
52
- --md-deep-purple-100: #d1c4e9;
53
- --md-deep-purple-200: #b39ddb;
54
- --md-deep-purple-300: #9575cd;
55
- --md-deep-purple-400: #7e57c2;
56
- --md-deep-purple-500: #673ab7;
57
- --md-deep-purple-600: #5e35b1;
58
- --md-deep-purple-700: #512da8;
59
- --md-deep-purple-800: #4527a0;
60
- --md-deep-purple-900: #311b92;
61
- --md-deep-purple-A100: #b388ff;
62
- --md-deep-purple-A200: #7c4dff;
63
- --md-deep-purple-A400: #651fff;
64
- --md-deep-purple-A700: #6200ea;
65
-
66
- --md-indigo-50: #e8eaf6;
67
- --md-indigo-100: #c5cae9;
68
- --md-indigo-200: #9fa8da;
69
- --md-indigo-300: #7986cb;
70
- --md-indigo-400: #5c6bc0;
71
- --md-indigo-500: #3f51b5;
72
- --md-indigo-600: #3949ab;
73
- --md-indigo-700: #303f9f;
74
- --md-indigo-800: #283593;
75
- --md-indigo-900: #1a237e;
76
- --md-indigo-A100: #8c9eff;
77
- --md-indigo-A200: #536dfe;
78
- --md-indigo-A400: #3d5afe;
79
- --md-indigo-A700: #304ffe;
80
-
81
- --md-blue-50: #e3f2fd;
82
- --md-blue-100: #bbdefb;
83
- --md-blue-200: #90caf9;
84
- --md-blue-300: #64b5f6;
85
- --md-blue-400: #42a5f5;
86
- --md-blue-500: #2196f3;
87
- --md-blue-600: #1e88e5;
88
- --md-blue-700: #1976d2;
89
- --md-blue-800: #1565c0;
90
- --md-blue-900: #0d47a1;
91
- --md-blue-A100: #82b1ff;
92
- --md-blue-A200: #448aff;
93
- --md-blue-A400: #2979ff;
94
- --md-blue-A700: #2962ff;
95
-
96
- --md-light-blue-50: #e1f5fe;
97
- --md-light-blue-100: #b3e5fc;
98
- --md-light-blue-200: #81d4fa;
99
- --md-light-blue-300: #4fc3f7;
100
- --md-light-blue-400: #29b6f6;
101
- --md-light-blue-500: #03a9f4;
102
- --md-light-blue-600: #039be5;
103
- --md-light-blue-700: #0288d1;
104
- --md-light-blue-800: #0277bd;
105
- --md-light-blue-900: #01579b;
106
- --md-light-blue-A100: #80d8ff;
107
- --md-light-blue-A200: #40c4ff;
108
- --md-light-blue-A400: #00b0ff;
109
- --md-light-blue-A700: #0091ea;
110
-
111
- --md-cyan-50: #e0f7fa;
112
- --md-cyan-100: #b2ebf2;
113
- --md-cyan-200: #80deea;
114
- --md-cyan-300: #4dd0e1;
115
- --md-cyan-400: #26c6da;
116
- --md-cyan-500: #00bcd4;
117
- --md-cyan-600: #00acc1;
118
- --md-cyan-700: #0097a7;
119
- --md-cyan-800: #00838f;
120
- --md-cyan-900: #006064;
121
- --md-cyan-A100: #84ffff;
122
- --md-cyan-A200: #18ffff;
123
- --md-cyan-A400: #00e5ff;
124
- --md-cyan-A700: #00b8d4;
125
-
126
- --md-teal-50: #e0f2f1;
127
- --md-teal-100: #b2dfdb;
128
- --md-teal-200: #80cbc4;
129
- --md-teal-300: #4db6ac;
130
- --md-teal-400: #26a69a;
131
- --md-teal-500: #009688;
132
- --md-teal-600: #00897b;
133
- --md-teal-700: #00796b;
134
- --md-teal-800: #00695c;
135
- --md-teal-900: #004d40;
136
- --md-teal-A100: #a7ffeb;
137
- --md-teal-A200: #64ffda;
138
- --md-teal-A400: #1de9b6;
139
- --md-teal-A700: #00bfa5;
140
-
141
- --md-green-50: #e8f5e9;
142
- --md-green-100: #c8e6c9;
143
- --md-green-200: #a5d6a7;
144
- --md-green-300: #81c784;
145
- --md-green-400: #66bb6a;
146
- --md-green-500: #4caf50;
147
- --md-green-600: #43a047;
148
- --md-green-700: #388e3c;
149
- --md-green-800: #2e7d32;
150
- --md-green-900: #1b5e20;
151
- --md-green-A100: #b9f6ca;
152
- --md-green-A200: #69f0ae;
153
- --md-green-A400: #00e676;
154
- --md-green-A700: #00c853;
155
-
156
- --md-light-green-50: #f1f8e9;
157
- --md-light-green-100: #dcedc8;
158
- --md-light-green-200: #c5e1a5;
159
- --md-light-green-300: #aed581;
160
- --md-light-green-400: #9ccc65;
161
- --md-light-green-500: #8bc34a;
162
- --md-light-green-600: #7cb342;
163
- --md-light-green-700: #689f38;
164
- --md-light-green-800: #558b2f;
165
- --md-light-green-900: #33691e;
166
- --md-light-green-A100: #ccff90;
167
- --md-light-green-A200: #b2ff59;
168
- --md-light-green-A400: #76ff03;
169
- --md-light-green-A700: #64dd17;
170
-
171
- --md-lime-50: #f9fbe7;
172
- --md-lime-100: #f0f4c3;
173
- --md-lime-200: #e6ee9c;
174
- --md-lime-300: #dce775;
175
- --md-lime-400: #d4e157;
176
- --md-lime-500: #cddc39;
177
- --md-lime-600: #c0ca33;
178
- --md-lime-700: #afb42b;
179
- --md-lime-800: #9e9d24;
180
- --md-lime-900: #827717;
181
- --md-lime-A100: #f4ff81;
182
- --md-lime-A200: #eeff41;
183
- --md-lime-A400: #c6ff00;
184
- --md-lime-A700: #aeea00;
185
-
186
- --md-yellow-50: #fffde7;
187
- --md-yellow-100: #fff9c4;
188
- --md-yellow-200: #fff59d;
189
- --md-yellow-300: #fff176;
190
- --md-yellow-400: #ffee58;
191
- --md-yellow-500: #ffeb3b;
192
- --md-yellow-600: #fdd835;
193
- --md-yellow-700: #fbc02d;
194
- --md-yellow-800: #f9a825;
195
- --md-yellow-900: #f57f17;
196
- --md-yellow-A100: #ffff8d;
197
- --md-yellow-A200: #ffff00;
198
- --md-yellow-A400: #ffea00;
199
- --md-yellow-A700: #ffd600;
200
-
201
- --md-amber-50: #fff8e1;
202
- --md-amber-100: #ffecb3;
203
- --md-amber-200: #ffe082;
204
- --md-amber-300: #ffd54f;
205
- --md-amber-400: #ffca28;
206
- --md-amber-500: #ffc107;
207
- --md-amber-600: #ffb300;
208
- --md-amber-700: #ffa000;
209
- --md-amber-800: #ff8f00;
210
- --md-amber-900: #ff6f00;
211
- --md-amber-A100: #ffe57f;
212
- --md-amber-A200: #ffd740;
213
- --md-amber-A400: #ffc400;
214
- --md-amber-A700: #ffab00;
215
-
216
- --md-orange-50: #fff3e0;
217
- --md-orange-100: #ffe0b2;
218
- --md-orange-200: #ffcc80;
219
- --md-orange-300: #ffb74d;
220
- --md-orange-400: #ffa726;
221
- --md-orange-500: #ff9800;
222
- --md-orange-600: #fb8c00;
223
- --md-orange-700: #f57c00;
224
- --md-orange-800: #ef6c00;
225
- --md-orange-900: #e65100;
226
- --md-orange-A100: #ffd180;
227
- --md-orange-A200: #ffab40;
228
- --md-orange-A400: #ff9100;
229
- --md-orange-A700: #ff6d00;
230
-
231
- --md-deep-orange-50: #fbe9e7;
232
- --md-deep-orange-100: #ffccbc;
233
- --md-deep-orange-200: #ffab91;
234
- --md-deep-orange-300: #ff8a65;
235
- --md-deep-orange-400: #ff7043;
236
- --md-deep-orange-500: #ff5722;
237
- --md-deep-orange-600: #f4511e;
238
- --md-deep-orange-700: #e64a19;
239
- --md-deep-orange-800: #d84315;
240
- --md-deep-orange-900: #bf360c;
241
- --md-deep-orange-A100: #ff9e80;
242
- --md-deep-orange-A200: #ff6e40;
243
- --md-deep-orange-A400: #ff3d00;
244
- --md-deep-orange-A700: #dd2c00;
245
-
246
- --md-brown-50: #efebe9;
247
- --md-brown-100: #d7ccc8;
248
- --md-brown-200: #bcaaa4;
249
- --md-brown-300: #a1887f;
250
- --md-brown-400: #8d6e63;
251
- --md-brown-500: #795548;
252
- --md-brown-600: #6d4c41;
253
- --md-brown-700: #5d4037;
254
- --md-brown-800: #4e342e;
255
- --md-brown-900: #3e2723;
256
-
257
- --md-grey-50: #fafafa;
258
- --md-grey-100: #f5f5f5;
259
- --md-grey-200: #eeeeee;
260
- --md-grey-300: #e0e0e0;
261
- --md-grey-400: #bdbdbd;
262
- --md-grey-500: #9e9e9e;
263
- --md-grey-600: #757575;
264
- --md-grey-700: #616161;
265
- --md-grey-800: #424242;
266
- --md-grey-900: #212121;
267
-
268
- --md-blue-grey-50: #eceff1;
269
- --md-blue-grey-100: #cfd8dc;
270
- --md-blue-grey-200: #b0bec5;
271
- --md-blue-grey-300: #90a4ae;
272
- --md-blue-grey-400: #78909c;
273
- --md-blue-grey-500: #607d8b;
274
- --md-blue-grey-600: #546e7a;
275
- --md-blue-grey-700: #455a64;
276
- --md-blue-grey-800: #37474f;
277
- --md-blue-grey-900: #263238;
278
- }