@jupyterlab/docregistry
Advanced tools
Comparing version 4.4.0-alpha.1 to 4.4.0-alpha.2
@@ -226,2 +226,3 @@ import { ISessionContext, SessionContext } from '@jupyterlab/apputils'; | ||
private _trans; | ||
private _contentProviderId?; | ||
private _manager; | ||
@@ -288,3 +289,8 @@ private _opener; | ||
lastModifiedCheckMargin?: number; | ||
/** | ||
* Identifier of the content provider used for file operations. | ||
* @experimental | ||
*/ | ||
contentProviderId?: string; | ||
} | ||
} |
@@ -37,2 +37,3 @@ // Copyright (c) Jupyter Development Team. | ||
this.translator = options.translator || nullTranslator; | ||
this._contentProviderId = options.contentProviderId; | ||
this._trans = this.translator.load('jupyterlab'); | ||
@@ -47,3 +48,3 @@ this._factory = options.factory; | ||
const lang = this._factory.preferredLanguage(PathExt.basename(localPath)); | ||
const sharedFactory = this._manager.contents.getSharedModelFactory(this._path); | ||
const sharedFactory = this._manager.contents.getSharedModelFactory(this._path, { contentProviderId: options.contentProviderId }); | ||
const sharedModel = sharedFactory === null || sharedFactory === void 0 ? void 0 : sharedFactory.createNew({ | ||
@@ -249,3 +250,5 @@ path: localPath, | ||
await this._manager.ready; | ||
await this._manager.contents.get(newPath); | ||
await this._manager.contents.get(newPath, { | ||
contentProviderId: this._contentProviderId | ||
}); | ||
await this._maybeOverWrite(newPath); | ||
@@ -569,3 +572,4 @@ } | ||
? { format: this._factory.fileFormat } | ||
: {}) | ||
: {}), | ||
contentProviderId: this._contentProviderId | ||
}; | ||
@@ -625,3 +629,4 @@ const path = this._path; | ||
content: false, | ||
hash: true | ||
hash: true, | ||
contentProviderId: this._contentProviderId | ||
}); | ||
@@ -665,3 +670,4 @@ return promise.then(model => { | ||
content: false, | ||
hash: true | ||
hash: true, | ||
contentProviderId: this._contentProviderId | ||
}); | ||
@@ -681,3 +687,4 @@ return { | ||
content: false, | ||
hash: true | ||
hash: true, | ||
contentProviderId: this._contentProviderId | ||
}); | ||
@@ -757,3 +764,6 @@ return { | ||
if (result.button.actions.includes('overwrite')) { | ||
return this._manager.contents.save(this._path, options); | ||
return this._manager.contents.save(this._path, { | ||
...options, | ||
contentProviderId: this._contentProviderId | ||
}); | ||
} | ||
@@ -760,0 +770,0 @@ if (result.button.actions.includes('revert')) { |
@@ -261,2 +261,11 @@ import { MainAreaWidget } from '@jupyterlab/apputils'; | ||
/** | ||
* Identifier of the content provider required for the widget (if any). | ||
* | ||
* Throws Error if the content provider was already set. | ||
* | ||
* @experimental | ||
*/ | ||
get contentProviderId(): string | undefined; | ||
set contentProviderId(value: string); | ||
/** | ||
* Create a widget for a context. | ||
@@ -269,2 +278,3 @@ */ | ||
protected defaultToolbarFactory(widget: T): DocumentRegistry.IToolbarItem[]; | ||
private _contentProviderId?; | ||
private _toolbarFactory; | ||
@@ -271,0 +281,0 @@ private _isDisposed; |
@@ -298,2 +298,3 @@ // Copyright (c) Jupyter Development Team. | ||
this._toolbarFactory = options.toolbarFactory; | ||
this._contentProviderId = options.contentProviderId; | ||
} | ||
@@ -419,2 +420,18 @@ /** | ||
/** | ||
* Identifier of the content provider required for the widget (if any). | ||
* | ||
* Throws Error if the content provider was already set. | ||
* | ||
* @experimental | ||
*/ | ||
get contentProviderId() { | ||
return this._contentProviderId; | ||
} | ||
set contentProviderId(value) { | ||
if (this._contentProviderId && value !== this._contentProviderId) { | ||
throw Error(`Cannot change content provider on factory with an existing provider: ${this._contentProviderId}`); | ||
} | ||
this._contentProviderId = value; | ||
} | ||
/** | ||
* Default factory for toolbar items to be added after the widget is created. | ||
@@ -421,0 +438,0 @@ */ |
@@ -494,2 +494,7 @@ import { ISessionContext, ToolbarRegistry } from '@jupyterlab/apputils'; | ||
/** | ||
* Identifier of the content provider required for the widget (if any). | ||
* @experimental | ||
*/ | ||
readonly contentProviderId?: string; | ||
/** | ||
* Whether the widget factory is read only. | ||
@@ -569,2 +574,7 @@ */ | ||
createNew(context: IContext<U>, source?: T): T; | ||
/** | ||
* Identifier of the content provider required for the widget (if any). | ||
* @experimental | ||
*/ | ||
contentProviderId?: string; | ||
} | ||
@@ -571,0 +581,0 @@ /** |
{ | ||
"name": "@jupyterlab/docregistry", | ||
"version": "4.4.0-alpha.1", | ||
"version": "4.4.0-alpha.2", | ||
"description": "JupyterLab - Document Registry", | ||
@@ -45,11 +45,11 @@ "homepage": "https://github.com/jupyterlab/jupyterlab", | ||
"@jupyter/ydoc": "^3.0.0", | ||
"@jupyterlab/apputils": "^4.5.0-alpha.1", | ||
"@jupyterlab/codeeditor": "^4.4.0-alpha.1", | ||
"@jupyterlab/coreutils": "^6.4.0-alpha.1", | ||
"@jupyterlab/observables": "^5.4.0-alpha.1", | ||
"@jupyterlab/rendermime": "^4.4.0-alpha.1", | ||
"@jupyterlab/rendermime-interfaces": "^3.12.0-alpha.1", | ||
"@jupyterlab/services": "^7.4.0-alpha.1", | ||
"@jupyterlab/translation": "^4.4.0-alpha.1", | ||
"@jupyterlab/ui-components": "^4.4.0-alpha.1", | ||
"@jupyterlab/apputils": "^4.5.0-alpha.2", | ||
"@jupyterlab/codeeditor": "^4.4.0-alpha.2", | ||
"@jupyterlab/coreutils": "^6.4.0-alpha.2", | ||
"@jupyterlab/observables": "^5.4.0-alpha.2", | ||
"@jupyterlab/rendermime": "^4.4.0-alpha.2", | ||
"@jupyterlab/rendermime-interfaces": "^3.12.0-alpha.2", | ||
"@jupyterlab/services": "^7.4.0-alpha.2", | ||
"@jupyterlab/translation": "^4.4.0-alpha.2", | ||
"@jupyterlab/ui-components": "^4.4.0-alpha.2", | ||
"@lumino/algorithm": "^2.0.2", | ||
@@ -65,3 +65,3 @@ "@lumino/coreutils": "^2.2.0", | ||
"devDependencies": { | ||
"@jupyterlab/testing": "^4.4.0-alpha.1", | ||
"@jupyterlab/testing": "^4.4.0-alpha.2", | ||
"@types/jest": "^29.2.0", | ||
@@ -68,0 +68,0 @@ "jest": "^29.2.0", |
@@ -48,2 +48,3 @@ // Copyright (c) Jupyter Development Team. | ||
this.translator = options.translator || nullTranslator; | ||
this._contentProviderId = options.contentProviderId; | ||
this._trans = this.translator.load('jupyterlab'); | ||
@@ -61,3 +62,4 @@ this._factory = options.factory; | ||
const sharedFactory = this._manager.contents.getSharedModelFactory( | ||
this._path | ||
this._path, | ||
{ contentProviderId: options.contentProviderId } | ||
); | ||
@@ -300,3 +302,5 @@ const sharedModel = sharedFactory?.createNew({ | ||
await this._manager.ready; | ||
await this._manager.contents.get(newPath); | ||
await this._manager.contents.get(newPath, { | ||
contentProviderId: this._contentProviderId | ||
}); | ||
await this._maybeOverWrite(newPath); | ||
@@ -659,3 +663,4 @@ } catch (err) { | ||
? { format: this._factory.fileFormat } | ||
: {}) | ||
: {}), | ||
contentProviderId: this._contentProviderId | ||
}; | ||
@@ -719,3 +724,4 @@ const path = this._path; | ||
content: false, | ||
hash: true | ||
hash: true, | ||
contentProviderId: this._contentProviderId | ||
}); | ||
@@ -766,3 +772,4 @@ return promise.then( | ||
content: false, | ||
hash: true | ||
hash: true, | ||
contentProviderId: this._contentProviderId | ||
}); | ||
@@ -783,3 +790,4 @@ return { | ||
content: false, | ||
hash: true | ||
hash: true, | ||
contentProviderId: this._contentProviderId | ||
}); | ||
@@ -870,3 +878,6 @@ return { | ||
if (result.button.actions.includes('overwrite')) { | ||
return this._manager.contents.save(this._path, options); | ||
return this._manager.contents.save(this._path, { | ||
...options, | ||
contentProviderId: this._contentProviderId | ||
}); | ||
} | ||
@@ -975,2 +986,3 @@ if (result.button.actions.includes('revert')) { | ||
private _trans: TranslationBundle; | ||
private _contentProviderId?: string; | ||
private _manager: ServiceManager.IManager; | ||
@@ -1053,2 +1065,8 @@ private _opener: ( | ||
lastModifiedCheckMargin?: number; | ||
/** | ||
* Identifier of the content provider used for file operations. | ||
* @experimental | ||
*/ | ||
contentProviderId?: string; | ||
} | ||
@@ -1055,0 +1073,0 @@ } |
@@ -348,2 +348,3 @@ // Copyright (c) Jupyter Development Team. | ||
this._toolbarFactory = options.toolbarFactory; | ||
this._contentProviderId = options.contentProviderId; | ||
} | ||
@@ -492,2 +493,21 @@ | ||
/** | ||
* Identifier of the content provider required for the widget (if any). | ||
* | ||
* Throws Error if the content provider was already set. | ||
* | ||
* @experimental | ||
*/ | ||
get contentProviderId(): string | undefined { | ||
return this._contentProviderId; | ||
} | ||
set contentProviderId(value: string) { | ||
if (this._contentProviderId && value !== this._contentProviderId) { | ||
throw Error( | ||
`Cannot change content provider on factory with an existing provider: ${this._contentProviderId}` | ||
); | ||
} | ||
this._contentProviderId = value; | ||
} | ||
/** | ||
* Create a widget for a context. | ||
@@ -507,2 +527,3 @@ */ | ||
private _contentProviderId?: string; | ||
private _toolbarFactory: | ||
@@ -509,0 +530,0 @@ | (( |
@@ -1057,2 +1057,8 @@ // Copyright (c) Jupyter Development Team. | ||
/** | ||
* Identifier of the content provider required for the widget (if any). | ||
* @experimental | ||
*/ | ||
readonly contentProviderId?: string; | ||
/** | ||
* Whether the widget factory is read only. | ||
@@ -1149,2 +1155,8 @@ */ | ||
createNew(context: IContext<U>, source?: T): T; | ||
/** | ||
* Identifier of the content provider required for the widget (if any). | ||
* @experimental | ||
*/ | ||
contentProviderId?: string; | ||
} | ||
@@ -1151,0 +1163,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
331669
8229