@difizen/libro-core 0.2.0 → 0.2.2
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.
- package/es/add-cell/libro-add-cell-view.js +1 -1
- package/es/cell/libro-cell-model.d.ts +2 -0
- package/es/cell/libro-cell-model.d.ts.map +1 -1
- package/es/cell/libro-cell-model.js +8 -1
- package/es/cell/libro-cell-view.d.ts +6 -1
- package/es/cell/libro-cell-view.d.ts.map +1 -1
- package/es/cell/libro-cell-view.js +17 -1
- package/es/command/document-commands.d.ts.map +1 -1
- package/es/command/document-commands.js +5 -3
- package/es/command/libro-command-contribution.d.ts +2 -2
- package/es/command/libro-command-contribution.d.ts.map +1 -1
- package/es/command/libro-command-contribution.js +71 -59
- package/es/components/dnd-cell-item-render.js +1 -1
- package/es/components/dnd-component/default-dnd-content.js +1 -1
- package/es/index.d.ts +2 -0
- package/es/index.d.ts.map +1 -1
- package/es/index.js +3 -1
- package/es/index.less +5 -3
- package/es/libro-context-key.d.ts +5 -1
- package/es/libro-context-key.d.ts.map +1 -1
- package/es/libro-context-key.js +12 -8
- package/es/libro-model.d.ts +8 -2
- package/es/libro-model.d.ts.map +1 -1
- package/es/libro-model.js +81 -47
- package/es/libro-protocol.d.ts +15 -4
- package/es/libro-protocol.d.ts.map +1 -1
- package/es/libro-service.d.ts +1 -0
- package/es/libro-service.d.ts.map +1 -1
- package/es/libro-service.js +17 -9
- package/es/libro-setting.d.ts +1 -0
- package/es/libro-setting.d.ts.map +1 -1
- package/es/libro-setting.js +10 -0
- package/es/libro-view.d.ts +3 -3
- package/es/libro-view.d.ts.map +1 -1
- package/es/libro-view.js +7 -5
- package/es/libro-workspace-service.d.ts +17 -0
- package/es/libro-workspace-service.d.ts.map +1 -0
- package/es/libro-workspace-service.js +36 -0
- package/es/material-from-designer.d.ts +1 -0
- package/es/material-from-designer.d.ts.map +1 -1
- package/es/material-from-designer.js +38 -2
- package/es/module.d.ts.map +1 -1
- package/es/module.js +3 -2
- package/es/output/output-area.d.ts +1 -0
- package/es/output/output-area.d.ts.map +1 -1
- package/es/output/output-area.js +70 -24
- package/es/output/output-model.d.ts +1 -0
- package/es/output/output-model.d.ts.map +1 -1
- package/es/output/output-model.js +17 -7
- package/es/output/output-protocol.d.ts +4 -0
- package/es/output/output-protocol.d.ts.map +1 -1
- package/es/theme/libro-color-registry.js +1 -1
- package/es/toolbar/change-cell-to-selector.d.ts.map +1 -1
- package/es/toolbar/change-cell-to-selector.js +7 -4
- package/package.json +6 -6
- package/src/add-cell/libro-add-cell-view.tsx +1 -1
- package/src/cell/libro-cell-model.ts +10 -1
- package/src/cell/libro-cell-view.tsx +17 -1
- package/src/command/document-commands.ts +5 -2
- package/src/command/libro-command-contribution.ts +86 -59
- package/src/components/dnd-cell-item-render.tsx +1 -1
- package/src/components/dnd-component/default-dnd-content.tsx +1 -1
- package/src/index.less +5 -3
- package/src/index.tsx +2 -1
- package/src/libro-context-key.ts +5 -1
- package/src/libro-model.ts +24 -5
- package/src/libro-protocol.ts +18 -5
- package/src/libro-service.ts +5 -1
- package/src/libro-setting.ts +11 -0
- package/src/libro-view.tsx +16 -7
- package/src/libro-workspace-service.ts +28 -0
- package/src/material-from-designer.tsx +32 -2
- package/src/module.ts +4 -2
- package/src/output/output-area.tsx +34 -9
- package/src/output/output-model.tsx +5 -1
- package/src/output/output-protocol.ts +5 -0
- package/src/theme/libro-color-registry.ts +1 -1
- package/src/toolbar/change-cell-to-selector.tsx +12 -3
|
@@ -72,7 +72,7 @@ export var LibroWrappedAddCell = /*#__PURE__*/forwardRef(function LibroWrappedAd
|
|
|
72
72
|
var _instance$parent;
|
|
73
73
|
var instance = useInject(ViewInstance);
|
|
74
74
|
return /*#__PURE__*/_jsx(DisplayWrapComponent, {
|
|
75
|
-
mode: (_instance$parent = instance.parent)
|
|
75
|
+
mode: !((_instance$parent = instance.parent) !== null && _instance$parent !== void 0 && _instance$parent.model.cellsEditable),
|
|
76
76
|
children: /*#__PURE__*/_jsx(LibroAddCell, {})
|
|
77
77
|
});
|
|
78
78
|
});
|
|
@@ -14,8 +14,10 @@ export declare class LibroCellModel extends Model implements CellModel {
|
|
|
14
14
|
libroFormatterManager: LibroFormatterManager<DefaultDecodedFormatter, DefaultDecodedFormatter>;
|
|
15
15
|
metadata: Partial<LibroCellMetadata>;
|
|
16
16
|
trusted: boolean;
|
|
17
|
+
version: number;
|
|
17
18
|
constructor(options: CellOptions);
|
|
18
19
|
init(): void;
|
|
20
|
+
updateVersion: () => void;
|
|
19
21
|
get source(): string;
|
|
20
22
|
set decodeObject(data: DefaultDecodedFormatter);
|
|
21
23
|
get decodeObject(): DefaultDecodedFormatter;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"libro-cell-model.d.ts","sourceRoot":"","sources":["../../src/cell/libro-cell-model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AACnD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAEnD,OAAO,EAAE,oBAAoB,
|
|
1
|
+
{"version":3,"file":"libro-cell-model.d.ts","sourceRoot":"","sources":["../../src/cell/libro-cell-model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AACnD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAEnD,OAAO,EAAE,oBAAoB,EAAS,MAAM,mBAAmB,CAAC;AAGhE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AACrE,OAAO,EAA2B,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AACvF,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEtD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAGlE,qBACa,cAAe,SAAQ,KAAM,YAAW,SAAS;IAC5D,SAAS,uBAA8B;IAEvC,OAAO,EAAE,WAAW,CAAC;IAErB,eAAe,EAAE,MAAM,CAAC;IAExB,aAAa,EAAE,uBAAuB,CAAC;IAGvC,qBAAqB,EAAE,qBAAqB,CAC1C,uBAAuB,EACvB,uBAAuB,CACxB,CAAC;IAGF,QAAQ,EAAE,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAGrC,OAAO,EAAE,OAAO,CAAC;IAEjB,OAAO,SAAK;gBAEqB,OAAO,EAAE,WAAW;IAiBrD,IAAI;IAoBJ,aAAa,aAIX;IAEF,IAAI,MAAM,IAAI,MAAM,CAMnB;IAED,IAAI,YAAY,CAAC,IAAI,EAAE,uBAAuB,EAG7C;IAED,IAAI,YAAY,IALO,uBAAuB,CAO7C;IAEK,GAAG;IAIT,MAAM,IAAI,IAAI,CAAC,KAAK,EAAE,SAAS,CAAC;IAShC,QAAQ,UAAS;IACR,OAAO;CAMjB;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,SAAS,GAAG,KAAK,IAAI,cAAc,CAE1E"}
|
|
@@ -23,7 +23,7 @@ function _applyDecoratedDescriptor(target, property, decorators, descriptor, con
|
|
|
23
23
|
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.'); }
|
|
24
24
|
import { Model } from '@difizen/libro-code-editor';
|
|
25
25
|
import { concatMultilineString } from '@difizen/libro-common';
|
|
26
|
-
import { DisposableCollection } from '@difizen/mana-app';
|
|
26
|
+
import { DisposableCollection, watch } from '@difizen/mana-app';
|
|
27
27
|
import { prop, inject, postConstruct, transient } from '@difizen/mana-app';
|
|
28
28
|
import { DefaultEncodedFormatter, LibroFormatterManager } from "../formatter/index.js";
|
|
29
29
|
import { CellOptions } from "../libro-protocol.js";
|
|
@@ -46,6 +46,12 @@ export var LibroCellModel = (_dec = transient(), _dec2 = inject(LibroFormatterMa
|
|
|
46
46
|
_initializerDefineProperty(_this, "libroFormatterManager", _descriptor, _assertThisInitialized(_this));
|
|
47
47
|
_initializerDefineProperty(_this, "metadata", _descriptor2, _assertThisInitialized(_this));
|
|
48
48
|
_initializerDefineProperty(_this, "trusted", _descriptor3, _assertThisInitialized(_this));
|
|
49
|
+
_this.version = 0;
|
|
50
|
+
_this.updateVersion = function () {
|
|
51
|
+
watch(_assertThisInitialized(_this), 'value', function () {
|
|
52
|
+
_this.version++;
|
|
53
|
+
});
|
|
54
|
+
};
|
|
49
55
|
_this.disposed = false;
|
|
50
56
|
_this.options = options;
|
|
51
57
|
_this.type = getLibroCellType(options);
|
|
@@ -67,6 +73,7 @@ export var LibroCellModel = (_dec = transient(), _dec2 = inject(LibroFormatterMa
|
|
|
67
73
|
})
|
|
68
74
|
});
|
|
69
75
|
this.decodeObject = this.libroFormatterManager.adapter(this.libroFormatType, formatValue);
|
|
76
|
+
this.updateVersion();
|
|
70
77
|
}
|
|
71
78
|
}, {
|
|
72
79
|
key: "source",
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ViewComponent } from '@difizen/mana-app';
|
|
2
|
+
import { Deferred } from '@difizen/mana-app';
|
|
2
3
|
import { BaseView } from '@difizen/mana-app';
|
|
3
4
|
import { DisposableCollection } from '@difizen/mana-app';
|
|
4
5
|
import React from 'react';
|
|
@@ -16,7 +17,11 @@ export declare class LibroCellView extends BaseView implements CellView {
|
|
|
16
17
|
model: CellModel;
|
|
17
18
|
protected cellService: CellService;
|
|
18
19
|
view: ViewComponent;
|
|
19
|
-
|
|
20
|
+
protected _parent: NotebookView;
|
|
21
|
+
get parent(): NotebookView;
|
|
22
|
+
set parent(value: NotebookView);
|
|
23
|
+
protected parentDefer: Deferred<import("../libro-view.js").LibroView>;
|
|
24
|
+
get parentReady(): Promise<import("../libro-view.js").LibroView>;
|
|
20
25
|
className?: string | undefined;
|
|
21
26
|
hasInputHidden: boolean;
|
|
22
27
|
collapsedHidden: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"libro-cell-view.d.ts","sourceRoot":"","sources":["../../src/cell/libro-cell-view.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"libro-cell-view.d.ts","sourceRoot":"","sources":["../../src/cell/libro-cell-view.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C,OAAO,EAAE,QAAQ,EAAkC,MAAM,mBAAmB,CAAC;AAE7E,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAEzD,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACvE,OAAO,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEnE,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAG1D,eAAO,MAAM,kBAAkB,+DAG7B,CAAC;AAEH,qBACa,aAAc,SAAQ,QAAS,YAAW,QAAQ;IAC7D,UAAmB,SAAS,uBAA8B;IAC1D,OAAO,EAAE,eAAe,CAAC;IAGzB,kBAAkB,SAAK;IAGvB,cAAc,SAAK;IAGnB,2BAA2B,UAAS;IAGpC,KAAK,EAAE,SAAS,CAAC;IACjB,SAAS,CAAC,WAAW,EAAE,WAAW,CAAC;IAC1B,IAAI,EAAE,aAAa,CAAsB;IAElD,SAAS,CAAC,OAAO,EAAE,YAAY,CAAC;IAEhC,IAAI,MAAM,IAGQ,YAAY,CAD7B;IACD,IAAI,MAAM,CAAC,KAAK,EAAE,YAAY,EAG7B;IAED,SAAS,CAAC,WAAW,iDAAgC;IAErD,IAAI,WAAW,kDAEd;IAGQ,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAA+B;IAGtE,cAAc,EAAE,OAAO,CAAC;IAGxB,eAAe,UAAS;IAGxB,QAAQ,UAAS;gBAGK,OAAO,EAAE,eAAe,EACvB,WAAW,EAAE,WAAW;IAe/C,SAAS;IAuBT,gBAAgB;IAIhB,aAAa;IAIP,GAAG;IAKT,qBAAqB,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC;IAItD,IAAI;IAIJ,KAAK,CAAC,MAAM,EAAE,OAAO;IAIrB,QAAQ,UAAS;IACR,OAAO;IAIhB,MAAM,IAAI,SAAS;IAUnB,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAMb;CACH"}
|
|
@@ -23,6 +23,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
23
23
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
24
24
|
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; }
|
|
25
25
|
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.'); }
|
|
26
|
+
import { Deferred } from '@difizen/mana-app';
|
|
26
27
|
import { useInject, watch } from '@difizen/mana-app';
|
|
27
28
|
import { BaseView, view, ViewInstance, ViewOption } from '@difizen/mana-app';
|
|
28
29
|
import { inject } from '@difizen/mana-app';
|
|
@@ -54,7 +55,8 @@ export var LibroCellView = (_dec = view('libro-cell-view'), _dec2 = prop(), _dec
|
|
|
54
55
|
_initializerDefineProperty(_this, "model", _descriptor4, _assertThisInitialized(_this));
|
|
55
56
|
_this.cellService = void 0;
|
|
56
57
|
_this.view = LibroCellComponent;
|
|
57
|
-
_this.
|
|
58
|
+
_this._parent = void 0;
|
|
59
|
+
_this.parentDefer = new Deferred();
|
|
58
60
|
_initializerDefineProperty(_this, "className", _descriptor5, _assertThisInitialized(_this));
|
|
59
61
|
_initializerDefineProperty(_this, "hasInputHidden", _descriptor6, _assertThisInitialized(_this));
|
|
60
62
|
_initializerDefineProperty(_this, "collapsedHidden", _descriptor7, _assertThisInitialized(_this));
|
|
@@ -80,6 +82,20 @@ export var LibroCellView = (_dec = view('libro-cell-view'), _dec2 = prop(), _dec
|
|
|
80
82
|
LibroCellView = inject(CellService)(LibroCellView, undefined, 1) || LibroCellView;
|
|
81
83
|
LibroCellView = inject(ViewOption)(LibroCellView, undefined, 0) || LibroCellView;
|
|
82
84
|
_createClass(LibroCellView, [{
|
|
85
|
+
key: "parent",
|
|
86
|
+
get: function get() {
|
|
87
|
+
return this._parent;
|
|
88
|
+
},
|
|
89
|
+
set: function set(value) {
|
|
90
|
+
this._parent = value;
|
|
91
|
+
this.parentDefer.resolve(this.parent);
|
|
92
|
+
}
|
|
93
|
+
}, {
|
|
94
|
+
key: "parentReady",
|
|
95
|
+
get: function get() {
|
|
96
|
+
return this.parentDefer.promise;
|
|
97
|
+
}
|
|
98
|
+
}, {
|
|
83
99
|
key: "cellWatch",
|
|
84
100
|
value: function cellWatch() {
|
|
85
101
|
var _this2 = this;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"document-commands.d.ts","sourceRoot":"","sources":["../../src/command/document-commands.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"document-commands.d.ts","sourceRoot":"","sources":["../../src/command/document-commands.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAIjD,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,GAAG;IAAE,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,CAkB3E,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { SaveOutlined, SettingOutlined } from '@ant-design/icons';
|
|
2
|
+
import { FormatCellIcon } from "../material-from-designer.js";
|
|
2
3
|
export var DocumentCommands = {
|
|
3
4
|
Save: {
|
|
4
5
|
id: 'document:save',
|
|
@@ -13,7 +14,8 @@ export var DocumentCommands = {
|
|
|
13
14
|
},
|
|
14
15
|
FormatCell: {
|
|
15
16
|
id: 'document.notebook.format_cell',
|
|
16
|
-
icon:
|
|
17
|
-
label: 'format cell code'
|
|
17
|
+
icon: FormatCellIcon,
|
|
18
|
+
label: 'format cell code',
|
|
19
|
+
keybind: 'shift+alt+f'
|
|
18
20
|
}
|
|
19
21
|
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import type { CommandRegistry } from '@difizen/mana-app';
|
|
2
2
|
import { ModalService, CommandContribution } from '@difizen/mana-app';
|
|
3
|
-
import {
|
|
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
|
|
10
|
+
protected readonly libroContextKey: LibroContextKey;
|
|
11
11
|
registerCommands(command: CommandRegistry): void;
|
|
12
12
|
}
|
|
13
13
|
//# sourceMappingURL=libro-command-contribution.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"libro-command-contribution.d.ts","sourceRoot":"","sources":["../../src/command/libro-command-contribution.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAEL,YAAY,EAEZ,mBAAmB,EACpB,MAAM,mBAAmB,CAAC;AAM3B,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"libro-command-contribution.d.ts","sourceRoot":"","sources":["../../src/command/libro-command-contribution.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAEL,YAAY,EAEZ,mBAAmB,EACpB,MAAM,mBAAmB,CAAC;AAM3B,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAI1D,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAOnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAGnE,qBACa,wBAAyB,YAAW,mBAAmB;IAC5C,SAAS,CAAC,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC;IACtC,SAAS,CAAC,QAAQ,CAAC,YAAY,EAAE,oBAAoB,CAAC;IAC9D,SAAS,CAAC,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC;IAC3C,SAAS,CAAC,QAAQ,CAAC,eAAe,EAAE,eAAe,CAAC;IAE7E,gBAAgB,CAAC,OAAO,EAAE,eAAe,GAAG,IAAI;CAs1CjD"}
|