@jupytergis/jupytergis-core 0.2.1 → 0.3.0
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.js +2 -1
- package/lib/plugin.js +4 -3
- package/lib/schemaregistry.d.ts +4 -1
- package/lib/schemaregistry.js +5 -1
- package/package.json +3 -3
package/lib/factory.js
CHANGED
|
@@ -37,7 +37,8 @@ export class JupyterGISWidgetFactory extends ABCWidgetFactory {
|
|
|
37
37
|
}
|
|
38
38
|
const { model } = context;
|
|
39
39
|
if (this._contentsManager) {
|
|
40
|
-
model.
|
|
40
|
+
model.contentsManager = this._contentsManager;
|
|
41
|
+
model.filePath = context.path;
|
|
41
42
|
}
|
|
42
43
|
const content = new JupyterGISPanel({
|
|
43
44
|
model,
|
package/lib/plugin.js
CHANGED
|
@@ -3,6 +3,7 @@ import { IAnnotationToken, IJGISExternalCommandRegistryToken, IJGISFormSchemaReg
|
|
|
3
3
|
import { WidgetTracker } from '@jupyterlab/apputils';
|
|
4
4
|
import { IMainMenu } from '@jupyterlab/mainmenu';
|
|
5
5
|
import { ITranslator } from '@jupyterlab/translation';
|
|
6
|
+
import { IDocumentManager } from '@jupyterlab/docmanager';
|
|
6
7
|
import { JupyterGISExternalCommandRegistry } from './externalcommand';
|
|
7
8
|
import { JupyterGISLayerBrowserRegistry } from './layerBrowserRegistry';
|
|
8
9
|
import { JupyterGISFormSchemaRegistry } from './schemaregistry';
|
|
@@ -24,10 +25,10 @@ export const trackerPlugin = {
|
|
|
24
25
|
export const formSchemaRegistryPlugin = {
|
|
25
26
|
id: 'jupytergis:core:form-schema-registry',
|
|
26
27
|
autoStart: true,
|
|
27
|
-
requires: [],
|
|
28
|
+
requires: [IDocumentManager],
|
|
28
29
|
provides: IJGISFormSchemaRegistryToken,
|
|
29
|
-
activate: (app) => {
|
|
30
|
-
const registry = new JupyterGISFormSchemaRegistry();
|
|
30
|
+
activate: (app, docmanager) => {
|
|
31
|
+
const registry = new JupyterGISFormSchemaRegistry(docmanager);
|
|
31
32
|
return registry;
|
|
32
33
|
}
|
|
33
34
|
};
|
package/lib/schemaregistry.d.ts
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { IDict, IJGISFormSchemaRegistry } from '@jupytergis/schema';
|
|
2
|
+
import { IDocumentManager } from '@jupyterlab/docmanager';
|
|
2
3
|
export declare class JupyterGISFormSchemaRegistry implements IJGISFormSchemaRegistry {
|
|
3
|
-
|
|
4
|
+
private _docManager;
|
|
5
|
+
constructor(docManager: IDocumentManager);
|
|
4
6
|
registerSchema(name: string, schema: IDict): void;
|
|
5
7
|
has(name: string): boolean;
|
|
6
8
|
getSchemas(): Map<string, IDict>;
|
|
9
|
+
getDocManager(): IDocumentManager;
|
|
7
10
|
private _registry;
|
|
8
11
|
}
|
package/lib/schemaregistry.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import formSchema from '@jupytergis/schema/lib/_interface/forms.json';
|
|
2
2
|
export class JupyterGISFormSchemaRegistry {
|
|
3
|
-
constructor() {
|
|
3
|
+
constructor(docManager) {
|
|
4
4
|
this._registry = new Map(Object.entries(formSchema));
|
|
5
|
+
this._docManager = docManager;
|
|
5
6
|
}
|
|
6
7
|
registerSchema(name, schema) {
|
|
7
8
|
if (!this._registry.has(name)) {
|
|
@@ -17,4 +18,7 @@ export class JupyterGISFormSchemaRegistry {
|
|
|
17
18
|
getSchemas() {
|
|
18
19
|
return this._registry;
|
|
19
20
|
}
|
|
21
|
+
getDocManager() {
|
|
22
|
+
return this._docManager;
|
|
23
|
+
}
|
|
20
24
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jupytergis/jupytergis-core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
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.
|
|
57
|
-
"@jupytergis/schema": "^0.
|
|
56
|
+
"@jupytergis/base": "^0.3.0",
|
|
57
|
+
"@jupytergis/schema": "^0.3.0",
|
|
58
58
|
"@jupyterlab/application": "^4.3.0",
|
|
59
59
|
"@jupyterlab/apputils": "^4.3.0",
|
|
60
60
|
"@jupyterlab/docregistry": "^4.3.0",
|