@jupytergis/jupytergis-core 0.3.0 → 0.4.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/lib/factory.d.ts CHANGED
@@ -5,7 +5,7 @@ import { IRenderMimeRegistry } from '@jupyterlab/rendermime';
5
5
  import { IEditorMimeTypeService } from '@jupyterlab/codeeditor';
6
6
  import { ABCWidgetFactory, DocumentRegistry } from '@jupyterlab/docregistry';
7
7
  import { CommandRegistry } from '@lumino/commands';
8
- import { JupyterGISWidget } from '@jupytergis/base';
8
+ import { JupyterGISDocumentWidget } from '@jupytergis/base';
9
9
  import { ServiceManager } from '@jupyterlab/services';
10
10
  interface IOptions extends DocumentRegistry.IWidgetFactoryOptions {
11
11
  tracker: IJupyterGISTracker;
@@ -19,7 +19,7 @@ interface IOptions extends DocumentRegistry.IWidgetFactoryOptions {
19
19
  backendCheck?: () => boolean;
20
20
  drive?: ICollaborativeDrive | null;
21
21
  }
22
- export declare class JupyterGISWidgetFactory extends ABCWidgetFactory<JupyterGISWidget, JupyterGISModel> {
22
+ export declare class JupyterGISDocumentWidgetFactory extends ABCWidgetFactory<JupyterGISDocumentWidget, JupyterGISModel> {
23
23
  private options;
24
24
  constructor(options: IOptions);
25
25
  /**
@@ -28,7 +28,7 @@ export declare class JupyterGISWidgetFactory extends ABCWidgetFactory<JupyterGIS
28
28
  * @param context Contains the information of the file
29
29
  * @returns The widget
30
30
  */
31
- protected createNewWidget(context: DocumentRegistry.IContext<JupyterGISModel>): JupyterGISWidget;
31
+ protected createNewWidget(context: DocumentRegistry.IContext<JupyterGISModel>): JupyterGISDocumentWidget;
32
32
  private _commands;
33
33
  private _externalCommandRegistry;
34
34
  private _backendCheck?;
package/lib/factory.js CHANGED
@@ -10,8 +10,8 @@ var __rest = (this && this.__rest) || function (s, e) {
10
10
  return t;
11
11
  };
12
12
  import { ABCWidgetFactory } from '@jupyterlab/docregistry';
13
- import { JupyterGISPanel, JupyterGISWidget, ToolbarWidget } from '@jupytergis/base';
14
- export class JupyterGISWidgetFactory extends ABCWidgetFactory {
13
+ import { JupyterGISPanel, JupyterGISDocumentWidget, ToolbarWidget } from '@jupytergis/base';
14
+ export class JupyterGISDocumentWidgetFactory extends ABCWidgetFactory {
15
15
  constructor(options) {
16
16
  var _a;
17
17
  const { backendCheck, externalCommandRegistry } = options, rest = __rest(options, ["backendCheck", "externalCommandRegistry"]);
@@ -36,9 +36,9 @@ export class JupyterGISWidgetFactory extends ABCWidgetFactory {
36
36
  }
37
37
  }
38
38
  const { model } = context;
39
+ model.filePath = context.localPath;
39
40
  if (this._contentsManager) {
40
41
  model.contentsManager = this._contentsManager;
41
- model.filePath = context.path;
42
42
  }
43
43
  const content = new JupyterGISPanel({
44
44
  model,
@@ -54,6 +54,6 @@ export class JupyterGISWidgetFactory extends ABCWidgetFactory {
54
54
  model,
55
55
  externalCommands: this._externalCommandRegistry.getCommands()
56
56
  });
57
- return new JupyterGISWidget({ context, content, toolbar });
57
+ return new JupyterGISDocumentWidget({ context, content, toolbar });
58
58
  }
59
59
  }
@@ -9,7 +9,7 @@ export declare class JupyterGISModelFactory implements DocumentRegistry.IModelFa
9
9
  /**
10
10
  * Whether the model is collaborative or not.
11
11
  */
12
- readonly collaborative: boolean;
12
+ readonly collaborative = true;
13
13
  /**
14
14
  * The name of the model.
15
15
  *
@@ -7,7 +7,7 @@ export class JupyterGISModelFactory {
7
7
  /**
8
8
  * Whether the model is collaborative or not.
9
9
  */
10
- this.collaborative = document.querySelectorAll('[data-jupyter-lite-root]')[0] === undefined;
10
+ this.collaborative = true;
11
11
  this._disposed = false;
12
12
  this._annotationModel = options.annotationModel;
13
13
  }
@@ -8,7 +8,7 @@ import { IFileBrowserFactory } from '@jupyterlab/filebrowser';
8
8
  import { ILauncher } from '@jupyterlab/launcher';
9
9
  import { IRenderMimeRegistry } from '@jupyterlab/rendermime';
10
10
  import { CommandIDs, logoIcon, logoMiniIcon } from '@jupytergis/base';
11
- import { JupyterGISWidgetFactory } from '../factory';
11
+ import { JupyterGISDocumentWidgetFactory } from '../factory';
12
12
  import { JupyterGISModelFactory } from './modelfactory';
13
13
  import { MimeDocumentFactory } from '@jupyterlab/docregistry';
14
14
  const FACTORY = 'JupyterGIS .jgis Viewer';
@@ -19,7 +19,7 @@ const activate = (app, tracker, themeManager, browserFactory, externalCommandReg
19
19
  if (PageConfig.getOption('jgis_expose_maps')) {
20
20
  window.jupytergisMaps = {};
21
21
  }
22
- const widgetFactory = new JupyterGISWidgetFactory({
22
+ const widgetFactory = new JupyterGISDocumentWidgetFactory({
23
23
  name: FACTORY,
24
24
  modelName: MODEL_NAME,
25
25
  fileTypes: [CONTENT_TYPE],
@@ -68,7 +68,7 @@ const activate = (app, tracker, themeManager, browserFactory, externalCommandReg
68
68
  widget.context.pathChanged.connect(() => {
69
69
  tracker.save(widget);
70
70
  });
71
- themeManager.themeChanged.connect((_, changes) => widget.context.model.themeChanged.emit(changes));
71
+ themeManager.themeChanged.connect((_, changes) => widget.model.themeChanged.emit(changes));
72
72
  app.shell.activateById('jupytergis::leftControlPanel');
73
73
  app.shell.activateById('jupytergis::rightControlPanel');
74
74
  tracker
package/lib/plugin.js CHANGED
@@ -61,10 +61,10 @@ export const annotationPlugin = {
61
61
  activate: (app, tracker) => {
62
62
  var _a;
63
63
  const annotationModel = new AnnotationModel({
64
- context: (_a = tracker.currentWidget) === null || _a === void 0 ? void 0 : _a.context
64
+ model: (_a = tracker.currentWidget) === null || _a === void 0 ? void 0 : _a.model
65
65
  });
66
66
  tracker.currentChanged.connect((_, changed) => {
67
- annotationModel.context = (changed === null || changed === void 0 ? void 0 : changed.context) || undefined;
67
+ annotationModel.model = (changed === null || changed === void 0 ? void 0 : changed.model) || undefined;
68
68
  });
69
69
  return annotationModel;
70
70
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jupytergis/jupytergis-core",
3
- "version": "0.3.0",
3
+ "version": "0.4.1",
4
4
  "description": "JupyterGIS core extension",
5
5
  "keywords": [
6
6
  "jupyter",
@@ -53,8 +53,8 @@
53
53
  },
54
54
  "dependencies": {
55
55
  "@jupyter/collaborative-drive": "^3.0.0",
56
- "@jupytergis/base": "^0.3.0",
57
- "@jupytergis/schema": "^0.3.0",
56
+ "@jupytergis/base": "^0.4.1",
57
+ "@jupytergis/schema": "^0.4.1",
58
58
  "@jupyterlab/application": "^4.3.0",
59
59
  "@jupyterlab/apputils": "^4.3.0",
60
60
  "@jupyterlab/docregistry": "^4.3.0",