@difizen/libro-prompt-cell 0.2.29 → 0.2.30

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,13 +1,16 @@
1
+ import type { LanguageSpecRegistry } from '@difizen/libro-code-editor';
2
+ import { LanguageSpecContribution } from '@difizen/libro-code-editor';
1
3
  import type { CellModel } from '@difizen/libro-core';
2
4
  import type { CellMeta, CellOptions } from '@difizen/libro-core';
3
5
  import { CellViewContribution, CellModelContribution } from '@difizen/libro-core';
4
6
  import { LibroPromptCellModelFactory } from './prompt-cell-protocol.js';
5
7
  import { LibroPromptCellView } from './prompt-cell-view.js';
6
- export declare class PromptCellContribution implements CellModelContribution, CellViewContribution {
8
+ export declare class PromptCellContribution implements CellModelContribution, CellViewContribution, LanguageSpecContribution {
7
9
  libroCellModelFactory: LibroPromptCellModelFactory;
8
10
  cellMeta: CellMeta;
9
11
  canHandle(options: CellOptions, libroType?: string): number;
10
12
  createModel(options: CellOptions): Promise<CellModel>;
11
13
  view: typeof LibroPromptCellView;
14
+ registerLanguageSpec: (register: LanguageSpecRegistry) => void;
12
15
  }
13
16
  //# sourceMappingURL=prompt-cell-contribution.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"prompt-cell-contribution.d.ts","sourceRoot":"","sources":["../src/prompt-cell-contribution.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACjE,OAAO,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAIlF,OAAO,EAAE,2BAA2B,EAAE,MAAM,2BAA2B,CAAC;AACxE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,qBACa,sBACX,YAAW,qBAAqB,EAAE,oBAAoB;IAGtD,qBAAqB,EAAE,2BAA2B,CAAC;IAEnD,QAAQ,EAAE,QAAQ,CAKhB;IAEF,SAAS,CAAC,OAAO,EAAE,WAAW,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM;IAIrD,WAAW,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,SAAS,CAAC;IAK3D,IAAI,6BAAuB;CAC5B"}
1
+ {"version":3,"file":"prompt-cell-contribution.d.ts","sourceRoot":"","sources":["../src/prompt-cell-contribution.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AACvE,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACjE,OAAO,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAIlF,OAAO,EAAE,2BAA2B,EAAE,MAAM,2BAA2B,CAAC;AACxE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,qBAGa,sBACX,YAAW,qBAAqB,EAAE,oBAAoB,EAAE,wBAAwB;IAGhF,qBAAqB,EAAE,2BAA2B,CAAC;IAEnD,QAAQ,EAAE,QAAQ,CAKhB;IAEF,SAAS,CAAC,OAAO,EAAE,WAAW,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM;IAIrD,WAAW,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,SAAS,CAAC;IAK3D,IAAI,6BAAuB;IAE3B,oBAAoB,aAAc,oBAAoB,UAOpD;CACH"}
@@ -11,13 +11,14 @@ 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 { CellViewContribution, CellModelContribution } from '@difizen/libro-core';
15
16
  import { inject } from '@difizen/mana-app';
16
17
  import { singleton } from '@difizen/mana-app';
17
18
  import { LibroPromptCellModelFactory } from "./prompt-cell-protocol.js";
18
19
  import { LibroPromptCellView } from "./prompt-cell-view.js";
19
20
  export var PromptCellContribution = (_dec = singleton({
20
- contrib: [CellModelContribution, CellViewContribution]
21
+ contrib: [CellModelContribution, CellViewContribution, LanguageSpecContribution]
21
22
  }), _dec2 = inject(LibroPromptCellModelFactory), _dec(_class = (_class2 = /*#__PURE__*/function () {
22
23
  function PromptCellContribution() {
23
24
  _classCallCheck(this, PromptCellContribution);
@@ -29,6 +30,14 @@ export var PromptCellContribution = (_dec = singleton({
29
30
  nbformatType: 'code'
30
31
  };
31
32
  this.view = LibroPromptCellView;
33
+ this.registerLanguageSpec = function (register) {
34
+ register.registerLanguageSpec({
35
+ name: 'Prompt',
36
+ language: 'prompt',
37
+ mime: 'application/vnd.libro.prompt+json',
38
+ ext: []
39
+ });
40
+ };
32
41
  }
33
42
  _createClass(PromptCellContribution, [{
34
43
  key: "canHandle",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@difizen/libro-prompt-cell",
3
- "version": "0.2.29",
3
+ "version": "0.2.30",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "libro",
@@ -32,12 +32,12 @@
32
32
  "src"
33
33
  ],
34
34
  "dependencies": {
35
- "@difizen/libro-code-editor": "^0.2.29",
36
- "@difizen/libro-jupyter": "^0.2.29",
37
- "@difizen/libro-rendermime": "^0.2.29",
38
- "@difizen/libro-codemirror": "^0.2.29",
39
- "@difizen/libro-common": "^0.2.29",
40
- "@difizen/libro-core": "^0.2.29",
35
+ "@difizen/libro-code-editor": "^0.2.30",
36
+ "@difizen/libro-jupyter": "^0.2.30",
37
+ "@difizen/libro-rendermime": "^0.2.30",
38
+ "@difizen/libro-codemirror": "^0.2.30",
39
+ "@difizen/libro-common": "^0.2.30",
40
+ "@difizen/libro-core": "^0.2.30",
41
41
  "@ant-design/icons": "^5.1.0",
42
42
  "@difizen/mana-l10n": "latest",
43
43
  "@difizen/mana-app": "latest",
@@ -1,3 +1,5 @@
1
+ import type { LanguageSpecRegistry } from '@difizen/libro-code-editor';
2
+ import { LanguageSpecContribution } from '@difizen/libro-code-editor';
1
3
  import type { CellModel } from '@difizen/libro-core';
2
4
  import type { CellMeta, CellOptions } from '@difizen/libro-core';
3
5
  import { CellViewContribution, CellModelContribution } from '@difizen/libro-core';
@@ -7,9 +9,11 @@ import { singleton } from '@difizen/mana-app';
7
9
  import { LibroPromptCellModelFactory } from './prompt-cell-protocol.js';
8
10
  import { LibroPromptCellView } from './prompt-cell-view.js';
9
11
 
10
- @singleton({ contrib: [CellModelContribution, CellViewContribution] })
12
+ @singleton({
13
+ contrib: [CellModelContribution, CellViewContribution, LanguageSpecContribution],
14
+ })
11
15
  export class PromptCellContribution
12
- implements CellModelContribution, CellViewContribution
16
+ implements CellModelContribution, CellViewContribution, LanguageSpecContribution
13
17
  {
14
18
  @inject(LibroPromptCellModelFactory)
15
19
  libroCellModelFactory: LibroPromptCellModelFactory;
@@ -31,4 +35,13 @@ export class PromptCellContribution
31
35
  }
32
36
 
33
37
  view = LibroPromptCellView;
38
+
39
+ registerLanguageSpec = (register: LanguageSpecRegistry) => {
40
+ register.registerLanguageSpec({
41
+ name: 'Prompt',
42
+ language: 'prompt',
43
+ mime: 'application/vnd.libro.prompt+json',
44
+ ext: [],
45
+ });
46
+ };
34
47
  }