@difizen/libro-core 0.1.30 → 0.1.32

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,13 @@
1
1
  import type { CommandRegistry } from '@difizen/mana-app';
2
2
  import { ModalService, CommandContribution } from '@difizen/mana-app';
3
- import { LirboContextKey } from '../libro-context-key.js';
3
+ import { LibroContextKey } from '../libro-context-key.js';
4
4
  import { LibroService } from '../libro-service.js';
5
5
  import { LibroCommandRegister } from './libro-command-register.js';
6
6
  export declare class LibroCommandContribution implements CommandContribution {
7
7
  protected readonly modalService: ModalService;
8
8
  protected readonly libroCommand: LibroCommandRegister;
9
9
  protected readonly libroService: LibroService;
10
- protected readonly lirboContextKey: LirboContextKey;
10
+ protected readonly libroContextKey: LibroContextKey;
11
11
  registerCommands(command: CommandRegistry): void;
12
12
  }
13
13
  //# sourceMappingURL=libro-command-contribution.d.ts.map
@@ -16,7 +16,7 @@ import { inject, ModalService, singleton, CommandContribution } from '@difizen/m
16
16
  import { equals } from '@difizen/mana-app';
17
17
  import { v4 } from 'uuid';
18
18
  import { LibroCellView, ExecutableCellModel, EditorCellView } from "../cell/index.js";
19
- import { LirboContextKey } from "../libro-context-key.js";
19
+ import { LibroContextKey } from "../libro-context-key.js";
20
20
  import { LibroToolbarArea } from "../libro-protocol.js";
21
21
  import { LibroService } from "../libro-service.js";
22
22
  import { LibroView } from "../libro-view.js";
@@ -28,13 +28,13 @@ import { LibroCommandRegister } from "./libro-command-register.js";
28
28
  import { NotebookCommands } from "./notebook-commands.js";
29
29
  export var LibroCommandContribution = (_dec = singleton({
30
30
  contrib: CommandContribution
31
- }), _dec2 = inject(ModalService), _dec3 = inject(LibroCommandRegister), _dec4 = inject(LibroService), _dec5 = inject(LirboContextKey), _dec(_class = (_class2 = /*#__PURE__*/function () {
31
+ }), _dec2 = inject(ModalService), _dec3 = inject(LibroCommandRegister), _dec4 = inject(LibroService), _dec5 = inject(LibroContextKey), _dec(_class = (_class2 = /*#__PURE__*/function () {
32
32
  function LibroCommandContribution() {
33
33
  _classCallCheck(this, LibroCommandContribution);
34
34
  _initializerDefineProperty(this, "modalService", _descriptor, this);
35
35
  _initializerDefineProperty(this, "libroCommand", _descriptor2, this);
36
36
  _initializerDefineProperty(this, "libroService", _descriptor3, this);
37
- _initializerDefineProperty(this, "lirboContextKey", _descriptor4, this);
37
+ _initializerDefineProperty(this, "libroContextKey", _descriptor4, this);
38
38
  }
39
39
  _createClass(LibroCommandContribution, [{
40
40
  key: "registerCommands",
@@ -1822,7 +1822,7 @@ export var LibroCommandContribution = (_dec = singleton({
1822
1822
  enumerable: true,
1823
1823
  writable: true,
1824
1824
  initializer: null
1825
- }), _descriptor4 = _applyDecoratedDescriptor(_class2.prototype, "lirboContextKey", [_dec5], {
1825
+ }), _descriptor4 = _applyDecoratedDescriptor(_class2.prototype, "libroContextKey", [_dec5], {
1826
1826
  configurable: true,
1827
1827
  enumerable: true,
1828
1828
  writable: true,
@@ -2,7 +2,7 @@ import type { Disposable } from '@difizen/mana-app';
2
2
  import type { IContextKey } from '@difizen/mana-app';
3
3
  import { ContextKeyService } from '@difizen/mana-app';
4
4
  import { LibroService } from './libro-service.js';
5
- export declare class LirboContextKey {
5
+ export declare class LibroContextKey {
6
6
  protected readonly contextKeyService: ContextKeyService;
7
7
  protected readonly libroService: LibroService;
8
8
  protected toDisposeOnActiveChanged?: Disposable;
@@ -19,4 +19,8 @@ export declare class LirboContextKey {
19
19
  protected setupCommandMode(): void;
20
20
  protected listenToActive: () => void;
21
21
  }
22
+ /**
23
+ * @deprecated use LibroContextKey instead.
24
+ */
25
+ export declare const LirboContextKey: typeof LibroContextKey;
22
26
  //# sourceMappingURL=libro-context-key.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"libro-context-key.d.ts","sourceRoot":"","sources":["../src/libro-context-key.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD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;IAChD,kBAAkB,UAAQ;IAC1B,SAAS,CAAC,aAAa,UAAS;IAChC,MAAM,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IAC7B,KAAK,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IAC5B,WAAW,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;gBAGL,iBAAiB,EAAE,iBAAiB,EACzC,YAAY,EAAE,YAAY;IASlD,kBAAkB,aAGhB;IAEF,iBAAiB,aAGf;IAEF,SAAS,CAAC,WAAW;IAarB,SAAS,CAAC,UAAU;IAUpB,SAAS,CAAC,gBAAgB;IAO1B,SAAS,CAAC,cAAc,aAQtB;CACH;AACD;;GAEG;AACH,eAAO,MAAM,eAAe,wBAAkB,CAAC"}
@@ -9,10 +9,10 @@ import { ContextKeyService } from '@difizen/mana-app';
9
9
  import { inject, singleton } from '@difizen/mana-app';
10
10
  import { LibroContextKeys } from "./libro-protocol.js";
11
11
  import { LibroService } from "./libro-service.js";
12
- export var LirboContextKey = (_dec = singleton(), _dec(_class = /*#__PURE__*/function () {
13
- function LirboContextKey(contextKeyService, libroService) {
12
+ export var LibroContextKey = (_dec = singleton(), _dec(_class = /*#__PURE__*/function () {
13
+ function LibroContextKey(contextKeyService, libroService) {
14
14
  var _this = this;
15
- _classCallCheck(this, LirboContextKey);
15
+ _classCallCheck(this, LibroContextKey);
16
16
  this.contextKeyService = void 0;
17
17
  this.libroService = void 0;
18
18
  this.toDisposeOnActiveChanged = void 0;
@@ -44,9 +44,9 @@ export var LirboContextKey = (_dec = singleton(), _dec(_class = /*#__PURE__*/fun
44
44
  this.setupFocus();
45
45
  this.setupCommandMode();
46
46
  }
47
- LirboContextKey = inject(LibroService)(LirboContextKey, undefined, 1) || LirboContextKey;
48
- LirboContextKey = inject(ContextKeyService)(LirboContextKey, undefined, 0) || LirboContextKey;
49
- _createClass(LirboContextKey, [{
47
+ LibroContextKey = inject(LibroService)(LibroContextKey, undefined, 1) || LibroContextKey;
48
+ LibroContextKey = inject(ContextKeyService)(LibroContextKey, undefined, 0) || LibroContextKey;
49
+ _createClass(LibroContextKey, [{
50
50
  key: "setupActive",
51
51
  value: function setupActive() {
52
52
  var _this2 = this;
@@ -76,5 +76,9 @@ export var LirboContextKey = (_dec = singleton(), _dec(_class = /*#__PURE__*/fun
76
76
  this.listenToActive();
77
77
  }
78
78
  }]);
79
- return LirboContextKey;
80
- }()) || _class);
79
+ return LibroContextKey;
80
+ }()) || _class);
81
+ /**
82
+ * @deprecated use LibroContextKey instead.
83
+ */
84
+ export var LirboContextKey = LibroContextKey;
@@ -149,7 +149,7 @@ export var LibroService = (_dec = singleton({
149
149
  }
150
150
  }
151
151
  var model = this.libroModelFactory(options);
152
- this.libroViewTracker.modelCache.set(model.id, model);
152
+ this.libroViewTracker.modelCache.set(options.modelId || model.id, model);
153
153
  return model;
154
154
  }
155
155
  }, {
@@ -5,7 +5,7 @@ import { CellService } from './cell/index.js';
5
5
  import type { LibroCell } from './cell/index.js';
6
6
  import { CollapseServiceFactory } from './collapse-service.js';
7
7
  import type { CollapseService } from './collapse-service.js';
8
- import { LirboContextKey } from './libro-context-key.js';
8
+ import { LibroContextKey } from './libro-context-key.js';
9
9
  import { NotebookService } from './libro-protocol.js';
10
10
  import type { CellOptions, CellView, DndContentProps, DndItemProps, NotebookView, NotebookModel, NotebookOption } from './libro-protocol.js';
11
11
  import { LibroService } from './libro-service.js';
@@ -35,7 +35,7 @@ export declare class LibroView extends BaseView implements NotebookView {
35
35
  cellService: CellService;
36
36
  libroService: LibroService;
37
37
  libroSlotManager: LibroSlotManager;
38
- contextKey: LirboContextKey;
38
+ contextKey: LibroContextKey;
39
39
  protected viewManager: ViewManager;
40
40
  protected configurationService: ConfigurationService;
41
41
  protected virtualizedManager: VirtualizedManager;
package/es/libro-view.js CHANGED
@@ -38,7 +38,7 @@ import { CellService, EditorCellView, ExecutableCellModel, ExecutableCellView }
38
38
  import { CollapseServiceFactory } from "./collapse-service.js";
39
39
  import { CustomDragLayer, DndCellContainer, DndCellItemRender, DndContext, DndList } from "./components/index.js";
40
40
  import { LibroViewHeader } from "./components/libro-view-header.js";
41
- import { LirboContextKey } from "./libro-context-key.js";
41
+ import { LibroContextKey } from "./libro-context-key.js";
42
42
  import { LibroModel } from "./libro-model.js";
43
43
  import { NotebookService, notebookViewFactoryId } from "./libro-protocol.js";
44
44
  import { LibroService } from "./libro-service.js";
@@ -195,7 +195,7 @@ export var LibroRender = /*#__PURE__*/forwardRef(function LibroRender(props, ref
195
195
  children: /*#__PURE__*/_jsx(LibroContentComponent, {})
196
196
  });
197
197
  });
198
- export var LibroView = (_dec = transient(), _dec2 = view(notebookViewFactoryId), _dec3 = inject(CellService), _dec4 = inject(LibroService), _dec5 = inject(LibroSlotManager), _dec6 = inject(LirboContextKey), _dec7 = inject(ViewManager), _dec8 = inject(ConfigurationService), _dec9 = prop(), _dec10 = prop(), _dec11 = prop(), _dec(_class = _dec2(_class = (_class2 = /*#__PURE__*/function (_BaseView) {
198
+ export var LibroView = (_dec = transient(), _dec2 = view(notebookViewFactoryId), _dec3 = inject(CellService), _dec4 = inject(LibroService), _dec5 = inject(LibroSlotManager), _dec6 = inject(LibroContextKey), _dec7 = inject(ViewManager), _dec8 = inject(ConfigurationService), _dec9 = prop(), _dec10 = prop(), _dec11 = prop(), _dec(_class = _dec2(_class = (_class2 = /*#__PURE__*/function (_BaseView) {
199
199
  _inherits(LibroView, _BaseView);
200
200
  var _super = _createSuper(LibroView);
201
201
  function LibroView(_options, collapseServiceFactory, notebookService, virtualizedManagerHelper) {
package/es/module.js CHANGED
@@ -7,7 +7,7 @@ import { LibroCommandModule } from "./command/index.js";
7
7
  import { BetweenCellProvider, CellExecutionTimeProvider, CellInputBottonBlankProvider, CellOutputVisulizationProvider, LibroBetweenCellContent, LibroCellExecutionTime, LibroCellInputBottonBlank, LibroCellVisualization } from "./components/index.js";
8
8
  import { LibroContentModule } from "./content/index.js";
9
9
  import { LibroFormatterModule } from "./formatter/index.js";
10
- import { LirboContextKey } from "./libro-context-key.js";
10
+ import { LibroContextKey } from "./libro-context-key.js";
11
11
  import { LibroModel } from "./libro-model.js";
12
12
  import { ModelFactory, NotebookOption, VirtualizedManagerOption, VirtualizedManagerOptionFactory } from "./libro-protocol.js";
13
13
  import { LibroService } from "./libro-service.js";
@@ -20,7 +20,7 @@ import { LibroSlotModule } from "./slot/index.js";
20
20
  import { LibroColorRegistry } from "./theme/libro-color-registry.js";
21
21
  import { VirtualizedManagerHelper } from "./virtualized-manager-helper.js";
22
22
  import { VirtualizedManager } from "./virtualized-manager.js";
23
- export var LibroModule = ManaModule.create().register(BaseWorkspaceService, VirtualizedManager, LibroService, LirboContextKey, LibroModel, LibroView, LibroSettingContribution, LibroColorRegistry, LibroViewTracker, {
23
+ export var LibroModule = ManaModule.create().register(BaseWorkspaceService, VirtualizedManager, LibroService, LibroContextKey, LibroModel, LibroView, LibroSettingContribution, LibroColorRegistry, LibroViewTracker, {
24
24
  token: ModelFactory,
25
25
  useFactory: function useFactory(ctx) {
26
26
  return function (options) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@difizen/libro-core",
3
- "version": "0.1.30",
3
+ "version": "0.1.32",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "libro",
@@ -34,10 +34,10 @@
34
34
  ],
35
35
  "dependencies": {
36
36
  "@ant-design/icons": "^5.1.0",
37
- "@difizen/libro-code-editor": "^0.1.30",
38
- "@difizen/libro-common": "^0.1.30",
39
- "@difizen/libro-shared-model": "^0.1.30",
40
- "@difizen/libro-virtualized": "^0.1.30",
37
+ "@difizen/libro-code-editor": "^0.1.32",
38
+ "@difizen/libro-common": "^0.1.32",
39
+ "@difizen/libro-shared-model": "^0.1.32",
40
+ "@difizen/libro-virtualized": "^0.1.32",
41
41
  "@difizen/mana-app": "latest",
42
42
  "@difizen/mana-l10n": "latest",
43
43
  "@difizen/mana-react": "latest",
@@ -11,7 +11,7 @@ import { v4 } from 'uuid';
11
11
 
12
12
  import { LibroCellView, ExecutableCellModel, EditorCellView } from '../cell/index.js';
13
13
  import type { LibroEditorCellView } from '../cell/index.js';
14
- import { LirboContextKey } from '../libro-context-key.js';
14
+ import { LibroContextKey } from '../libro-context-key.js';
15
15
  import type { CellView, NotebookView } from '../libro-protocol.js';
16
16
  import { LibroToolbarArea } from '../libro-protocol.js';
17
17
  import { LibroService } from '../libro-service.js';
@@ -29,7 +29,7 @@ export class LibroCommandContribution implements CommandContribution {
29
29
  @inject(ModalService) protected readonly modalService: ModalService;
30
30
  @inject(LibroCommandRegister) protected readonly libroCommand: LibroCommandRegister;
31
31
  @inject(LibroService) protected readonly libroService: LibroService;
32
- @inject(LirboContextKey) protected readonly lirboContextKey: LirboContextKey;
32
+ @inject(LibroContextKey) protected readonly libroContextKey: LibroContextKey;
33
33
 
34
34
  registerCommands(command: CommandRegistry): void {
35
35
  this.libroCommand.registerLibroCommand(command, NotebookCommands['EnterEditMode'], {
@@ -7,7 +7,7 @@ import { LibroContextKeys } from './libro-protocol.js';
7
7
  import { LibroService } from './libro-service.js';
8
8
 
9
9
  @singleton()
10
- export class LirboContextKey {
10
+ export class LibroContextKey {
11
11
  protected readonly contextKeyService: ContextKeyService;
12
12
  protected readonly libroService: LibroService;
13
13
  protected toDisposeOnActiveChanged?: Disposable;
@@ -78,3 +78,7 @@ export class LirboContextKey {
78
78
  }
79
79
  };
80
80
  }
81
+ /**
82
+ * @deprecated use LibroContextKey instead.
83
+ */
84
+ export const LirboContextKey = LibroContextKey;
@@ -138,7 +138,7 @@ export class LibroService implements NotebookService, Disposable {
138
138
  }
139
139
  }
140
140
  const model = this.libroModelFactory(options);
141
- this.libroViewTracker.modelCache.set(model.id, model);
141
+ this.libroViewTracker.modelCache.set(options.modelId || model.id, model);
142
142
  return model;
143
143
  }
144
144
  async getOrCreateView(options: NotebookOption): Promise<NotebookView> {
@@ -49,7 +49,7 @@ import {
49
49
  DndList,
50
50
  } from './components/index.js';
51
51
  import { LibroViewHeader } from './components/libro-view-header.js';
52
- import { LirboContextKey } from './libro-context-key.js';
52
+ import { LibroContextKey } from './libro-context-key.js';
53
53
  import { LibroModel } from './libro-model.js';
54
54
  import { NotebookService, notebookViewFactoryId } from './libro-protocol.js';
55
55
  import type {
@@ -295,7 +295,7 @@ export class LibroView extends BaseView implements NotebookView {
295
295
  @inject(CellService) cellService: CellService;
296
296
  @inject(LibroService) libroService: LibroService;
297
297
  @inject(LibroSlotManager) libroSlotManager: LibroSlotManager;
298
- @inject(LirboContextKey) contextKey: LirboContextKey;
298
+ @inject(LibroContextKey) contextKey: LibroContextKey;
299
299
 
300
300
  @inject(ViewManager) protected viewManager: ViewManager;
301
301
  @inject(ConfigurationService) protected configurationService: ConfigurationService;
package/src/module.ts CHANGED
@@ -22,7 +22,7 @@ import {
22
22
  } from './components/index.js';
23
23
  import { LibroContentModule } from './content/index.js';
24
24
  import { LibroFormatterModule } from './formatter/index.js';
25
- import { LirboContextKey } from './libro-context-key.js';
25
+ import { LibroContextKey } from './libro-context-key.js';
26
26
  import { LibroModel } from './libro-model.js';
27
27
  import {
28
28
  ModelFactory,
@@ -46,7 +46,7 @@ export const LibroModule = ManaModule.create()
46
46
  BaseWorkspaceService,
47
47
  VirtualizedManager,
48
48
  LibroService,
49
- LirboContextKey,
49
+ LibroContextKey,
50
50
  LibroModel,
51
51
  LibroView,
52
52
  LibroSettingContribution,