@difizen/libro-code-cell 0.2.29 → 0.2.31
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.
|
@@ -1,12 +1,15 @@
|
|
|
1
|
+
import type { LanguageSpecRegistry } from '@difizen/libro-code-editor';
|
|
2
|
+
import { LanguageSpecContribution } from '@difizen/libro-code-editor';
|
|
1
3
|
import { CellModelContribution, CellViewContribution } from '@difizen/libro-core';
|
|
2
4
|
import type { CellMeta, CellModel, CellOptions } from '@difizen/libro-core';
|
|
3
5
|
import { CodeCellModelFactory } from './code-cell-protocol.js';
|
|
4
6
|
import { LibroCodeCellView } from './code-cell-view.js';
|
|
5
|
-
export declare class CodeEditorCellContribution implements CellModelContribution, CellViewContribution {
|
|
7
|
+
export declare class CodeEditorCellContribution implements CellModelContribution, CellViewContribution, LanguageSpecContribution {
|
|
6
8
|
libroCellModelFactory: CodeCellModelFactory;
|
|
7
9
|
cellMeta: CellMeta;
|
|
8
10
|
canHandle(options: CellOptions): number;
|
|
9
11
|
createModel(options: CellOptions): Promise<CellModel>;
|
|
10
12
|
view: typeof LibroCodeCellView;
|
|
13
|
+
registerLanguageSpec: (register: LanguageSpecRegistry) => void;
|
|
11
14
|
}
|
|
12
15
|
//# sourceMappingURL=code-cell-contribution.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"code-cell-contribution.d.ts","sourceRoot":"","sources":["../src/code-cell-contribution.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAClF,OAAO,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAG5E,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,
|
|
1
|
+
{"version":3,"file":"code-cell-contribution.d.ts","sourceRoot":"","sources":["../src/code-cell-contribution.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AACvE,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAClF,OAAO,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAG5E,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,qBAGa,0BACX,YAAW,qBAAqB,EAAE,oBAAoB,EAAE,wBAAwB;IAElD,qBAAqB,EAAE,oBAAoB,CAAC;IAE1E,QAAQ,EAAE,QAAQ,CAIhB;IAEF,SAAS,CAAC,OAAO,EAAE,WAAW,GAAG,MAAM;IAIjC,WAAW,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,SAAS,CAAC;IAO3D,IAAI,2BAAqB;IAEzB,oBAAoB,aAAc,oBAAoB,UAOpD;CACH"}
|
|
@@ -11,12 +11,13 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
|
|
|
11
11
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
12
12
|
function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object.keys(descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object.defineProperty(target, property, desc); desc = null; } return desc; }
|
|
13
13
|
function _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that ' + 'transform-class-properties is enabled and runs after the decorators transform.'); }
|
|
14
|
+
import { LanguageSpecContribution } from '@difizen/libro-code-editor';
|
|
14
15
|
import { CellModelContribution, CellViewContribution } from '@difizen/libro-core';
|
|
15
16
|
import { inject, singleton } from '@difizen/mana-app';
|
|
16
17
|
import { CodeCellModelFactory } from "./code-cell-protocol.js";
|
|
17
18
|
import { LibroCodeCellView } from "./code-cell-view.js";
|
|
18
19
|
export var CodeEditorCellContribution = (_dec = singleton({
|
|
19
|
-
contrib: [CellModelContribution, CellViewContribution]
|
|
20
|
+
contrib: [CellModelContribution, CellViewContribution, LanguageSpecContribution]
|
|
20
21
|
}), _dec2 = inject(CodeCellModelFactory), _dec(_class = (_class2 = /*#__PURE__*/function () {
|
|
21
22
|
function CodeEditorCellContribution() {
|
|
22
23
|
_classCallCheck(this, CodeEditorCellContribution);
|
|
@@ -27,6 +28,14 @@ export var CodeEditorCellContribution = (_dec = singleton({
|
|
|
27
28
|
order: 'b'
|
|
28
29
|
};
|
|
29
30
|
this.view = LibroCodeCellView;
|
|
31
|
+
this.registerLanguageSpec = function (register) {
|
|
32
|
+
register.registerLanguageSpec({
|
|
33
|
+
name: 'Python',
|
|
34
|
+
language: 'python',
|
|
35
|
+
ext: ['.py'],
|
|
36
|
+
mime: 'text/x-python'
|
|
37
|
+
});
|
|
38
|
+
};
|
|
30
39
|
}
|
|
31
40
|
_createClass(CodeEditorCellContribution, [{
|
|
32
41
|
key: "canHandle",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@difizen/libro-code-cell",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.31",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"libro",
|
|
@@ -32,9 +32,9 @@
|
|
|
32
32
|
"src"
|
|
33
33
|
],
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@difizen/libro-code-editor": "^0.2.
|
|
36
|
-
"@difizen/libro-common": "^0.2.
|
|
37
|
-
"@difizen/libro-core": "^0.2.
|
|
35
|
+
"@difizen/libro-code-editor": "^0.2.31",
|
|
36
|
+
"@difizen/libro-common": "^0.2.31",
|
|
37
|
+
"@difizen/libro-core": "^0.2.31",
|
|
38
38
|
"@difizen/mana-app": "latest"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { LanguageSpecRegistry } from '@difizen/libro-code-editor';
|
|
2
|
+
import { LanguageSpecContribution } from '@difizen/libro-code-editor';
|
|
1
3
|
import { CellModelContribution, CellViewContribution } from '@difizen/libro-core';
|
|
2
4
|
import type { CellMeta, CellModel, CellOptions } from '@difizen/libro-core';
|
|
3
5
|
import { inject, singleton } from '@difizen/mana-app';
|
|
@@ -5,9 +7,11 @@ import { inject, singleton } from '@difizen/mana-app';
|
|
|
5
7
|
import { CodeCellModelFactory } from './code-cell-protocol.js';
|
|
6
8
|
import { LibroCodeCellView } from './code-cell-view.js';
|
|
7
9
|
|
|
8
|
-
@singleton({
|
|
10
|
+
@singleton({
|
|
11
|
+
contrib: [CellModelContribution, CellViewContribution, LanguageSpecContribution],
|
|
12
|
+
})
|
|
9
13
|
export class CodeEditorCellContribution
|
|
10
|
-
implements CellModelContribution, CellViewContribution
|
|
14
|
+
implements CellModelContribution, CellViewContribution, LanguageSpecContribution
|
|
11
15
|
{
|
|
12
16
|
@inject(CodeCellModelFactory) libroCellModelFactory: CodeCellModelFactory;
|
|
13
17
|
|
|
@@ -29,4 +33,13 @@ export class CodeEditorCellContribution
|
|
|
29
33
|
}
|
|
30
34
|
|
|
31
35
|
view = LibroCodeCellView;
|
|
36
|
+
|
|
37
|
+
registerLanguageSpec = (register: LanguageSpecRegistry) => {
|
|
38
|
+
register.registerLanguageSpec({
|
|
39
|
+
name: 'Python',
|
|
40
|
+
language: 'python',
|
|
41
|
+
ext: ['.py'],
|
|
42
|
+
mime: 'text/x-python',
|
|
43
|
+
});
|
|
44
|
+
};
|
|
32
45
|
}
|