@difizen/libro-prompt-cell 1.0.1 → 1.0.3

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,8 +1,8 @@
1
1
  import type { IRange } from '@difizen/libro-code-editor';
2
2
  import type { IOutput } from '@difizen/libro-common';
3
+ import { ViewManager, Deferred, ConfigurationService } from '@difizen/libro-common/app';
3
4
  import type { KernelMessage, LibroCell, CellViewOptions } from '@difizen/libro-jupyter';
4
5
  import { CellService, LibroEditableExecutableCellView, LibroOutputArea } from '@difizen/libro-jupyter';
5
- import { ViewManager, Deferred } from '@difizen/libro-common/app';
6
6
  import type { DefaultOptionType } from 'antd/es/select/index.js';
7
7
  import React from 'react';
8
8
  import { LibroPromptCellModel } from './prompt-cell-model.js';
@@ -38,7 +38,7 @@ export declare class LibroPromptCellView extends LibroEditableExecutableCellView
38
38
  outputs: IOutput[];
39
39
  protected outputAreaDeferred: Deferred<LibroOutputArea>;
40
40
  get outputAreaReady(): Promise<LibroOutputArea>;
41
- constructor(options: CellViewOptions, cellService: CellService, viewManager: ViewManager);
41
+ constructor(options: CellViewOptions, cellService: CellService, configurationService: ConfigurationService, viewManager: ViewManager);
42
42
  outputWatch(): void;
43
43
  toJSON(): LibroCell;
44
44
  shouldEnterEditorMode(e: React.FocusEvent<HTMLElement>): boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"prompt-cell-view.d.ts","sourceRoot":"","sources":["../src/prompt-cell-view.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,KAAK,EAAa,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAGhE,OAAO,KAAK,EAEV,aAAa,EAEb,SAAS,EACT,eAAe,EAChB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAGL,WAAW,EACX,+BAA+B,EAC/B,eAAe,EAChB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAQL,WAAW,EA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AO,EAAE,eAAe,EACvB,WAAW,EAAE,WAAW,EACf,oBAAoB,EAAE,oBAAoB,EACnD,WAAW,EAAE,WAAW;IA4CtC,WAAW;IAQX,MAAM,IAAI,SAAS;IASnB,qBAAqB,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC;IAQtD,IAAI,aAGX;IAEO,cAAc,aAGrB;IAEF,aAAa,QAAO,EAAE,CAEpB;IAEF,qBAAqB,cAAe,MAAM;;;MAKxC;IAEa,GAAG;IA4EZ,kBAAkB;IA2ExB,KAAK,YACM,cAAc,kBAAkB,CAAC,SAAS,CAAC,oBAClC,cAAc,aAAa,KAAK,GAAG,6CAUrD;IAEF,iBAAiB,gDAmBf;IAEF,qBAAqB,YAAmB,MAAM,QAAQ,OAAO,6CAU3D;IAEF,iBAAiB,gDAef;IAEF,iBAAiB,SAAU,UAAU;;;;;MAOnC;IAEF,mBAAmB,aACP,cAAc,aAAa,eACxB,MAAM,KAAK,IAAI,UA6B5B;IAEF,0BAA0B,kBAAmB,MAAM,aAQjD;IACF,qBAAqB,UAAW,MAAM,WAAW,iBAAiB,UAKhE;IACF,wBAAwB,WAAY,MAAM,UAExC;IACF,kBAAkB,UAAW,MAAM,GAAG,SAAS,UAE7C;CACH"}
@@ -36,10 +36,10 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
36
36
  import { EditOutlined } from '@ant-design/icons';
37
37
  import { MIME } from '@difizen/libro-common';
38
38
  import { isOutput } from '@difizen/libro-common';
39
+ import { getOrigin, inject, prop, transient, useInject, view, ViewInstance, ViewManager, ViewOption, ViewRender, watch, Deferred, ConfigurationService } from '@difizen/libro-common/app';
40
+ import { l10n } from '@difizen/libro-common/l10n';
39
41
  import { KernelError, LibroJupyterModel, CellService, LibroEditableExecutableCellView, LibroOutputArea } from '@difizen/libro-jupyter';
40
42
  import { ChatComponents } from '@difizen/magent-chat';
41
- import { getOrigin, inject, prop, transient, useInject, view, ViewInstance, ViewManager, ViewOption, ViewRender, watch, Deferred } from '@difizen/libro-common/app';
42
- import { l10n } from '@difizen/libro-common/l10n';
43
43
  import { Select, Tag } from 'antd';
44
44
  import classNames from 'classnames';
45
45
  import React, { useEffect, useState } from 'react';
@@ -298,11 +298,11 @@ var PropmtEditorViewComponent = /*#__PURE__*/React.forwardRef(function PropmtEdi
298
298
  export var LibroPromptCellView = (_dec = transient(), _dec2 = view('prompt-editor-cell-view'), _dec3 = prop(), _dec4 = prop(), _dec5 = inject(PromptScript), _dec(_class = _dec2(_class = (_class2 = /*#__PURE__*/function (_LibroEditableExecuta) {
299
299
  _inherits(LibroPromptCellView, _LibroEditableExecuta);
300
300
  var _super = _createSuper(LibroPromptCellView);
301
- function LibroPromptCellView(options, cellService, viewManager) {
301
+ function LibroPromptCellView(options, cellService, configurationService, viewManager) {
302
302
  var _options$cell;
303
303
  var _this;
304
304
  _classCallCheck(this, LibroPromptCellView);
305
- _this = _super.call(this, options, cellService);
305
+ _this = _super.call(this, options, cellService, configurationService);
306
306
  _this.view = PropmtEditorViewComponent;
307
307
  // TODO: Chat objects and chat message records should belong to libro rather than cell
308
308
  _initializerDefineProperty(_this, "chatObjects", _descriptor, _assertThisInitialized(_this));
@@ -577,7 +577,8 @@ export var LibroPromptCellView = (_dec = transient(), _dec2 = view('prompt-edito
577
577
  });
578
578
  return _this;
579
579
  }
580
- LibroPromptCellView = inject(ViewManager)(LibroPromptCellView, undefined, 2) || LibroPromptCellView;
580
+ LibroPromptCellView = inject(ViewManager)(LibroPromptCellView, undefined, 3) || LibroPromptCellView;
581
+ LibroPromptCellView = inject(ConfigurationService)(LibroPromptCellView, undefined, 2) || LibroPromptCellView;
581
582
  LibroPromptCellView = inject(CellService)(LibroPromptCellView, undefined, 1) || LibroPromptCellView;
582
583
  LibroPromptCellView = inject(ViewOption)(LibroPromptCellView, undefined, 0) || LibroPromptCellView;
583
584
  _createClass(LibroPromptCellView, [{
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@difizen/libro-prompt-cell",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "libro",
@@ -32,11 +32,11 @@
32
32
  "src"
33
33
  ],
34
34
  "dependencies": {
35
- "@difizen/libro-code-editor": "^1.0.1",
36
- "@difizen/libro-jupyter": "^1.0.1",
37
- "@difizen/libro-rendermime": "^1.0.1",
38
- "@difizen/libro-common": "^1.0.1",
39
- "@difizen/libro-core": "^1.0.1",
35
+ "@difizen/libro-code-editor": "^1.0.3",
36
+ "@difizen/libro-jupyter": "^1.0.3",
37
+ "@difizen/libro-rendermime": "^1.0.3",
38
+ "@difizen/libro-common": "^1.0.3",
39
+ "@difizen/libro-core": "^1.0.3",
40
40
  "@ant-design/icons": "^5.1.0",
41
41
  "@difizen/magent-chat": "^0.1.27",
42
42
  "react-syntax-highlighter": "^15.5.0",
@@ -3,21 +3,6 @@ import type { IRange } from '@difizen/libro-code-editor';
3
3
  import type { ICodeCell, IOutput } from '@difizen/libro-common';
4
4
  import { MIME } from '@difizen/libro-common';
5
5
  import { isOutput } from '@difizen/libro-common';
6
- import type {
7
- ExecutionMeta,
8
- KernelMessage,
9
- IOutputAreaOption,
10
- LibroCell,
11
- CellViewOptions,
12
- } from '@difizen/libro-jupyter';
13
- import {
14
- KernelError,
15
- LibroJupyterModel,
16
- CellService,
17
- LibroEditableExecutableCellView,
18
- LibroOutputArea,
19
- } from '@difizen/libro-jupyter';
20
- import { ChatComponents } from '@difizen/magent-chat';
21
6
  import {
22
7
  getOrigin,
23
8
  inject,
@@ -31,8 +16,24 @@ import {
31
16
  ViewRender,
32
17
  watch,
33
18
  Deferred,
19
+ ConfigurationService,
34
20
  } from '@difizen/libro-common/app';
35
21
  import { l10n } from '@difizen/libro-common/l10n';
22
+ import type {
23
+ ExecutionMeta,
24
+ KernelMessage,
25
+ IOutputAreaOption,
26
+ LibroCell,
27
+ CellViewOptions,
28
+ } from '@difizen/libro-jupyter';
29
+ import {
30
+ KernelError,
31
+ LibroJupyterModel,
32
+ CellService,
33
+ LibroEditableExecutableCellView,
34
+ LibroOutputArea,
35
+ } from '@difizen/libro-jupyter';
36
+ import { ChatComponents } from '@difizen/magent-chat';
36
37
  import { Select, Tag } from 'antd';
37
38
  import type { DefaultOptionType } from 'antd/es/select/index.js';
38
39
  import classNames from 'classnames';
@@ -420,9 +421,10 @@ export class LibroPromptCellView extends LibroEditableExecutableCellView {
420
421
  constructor(
421
422
  @inject(ViewOption) options: CellViewOptions,
422
423
  @inject(CellService) cellService: CellService,
424
+ @inject(ConfigurationService) configurationService: ConfigurationService,
423
425
  @inject(ViewManager) viewManager: ViewManager,
424
426
  ) {
425
- super(options, cellService);
427
+ super(options, cellService, configurationService);
426
428
  this.options = options;
427
429
  this.viewManager = viewManager;
428
430
  this.className = this.className + ' prompt';