@difizen/libro-core 0.0.2-alpha.0
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/LICENSE +21 -0
- package/README.md +3 -0
- package/es/add-cell/index.d.ts +4 -0
- package/es/add-cell/index.d.ts.map +1 -0
- package/es/add-cell/index.js +3 -0
- package/es/add-cell/index.less +38 -0
- package/es/add-cell/libro-add-cell-module.d.ts +3 -0
- package/es/add-cell/libro-add-cell-module.d.ts.map +1 -0
- package/es/add-cell/libro-add-cell-module.js +4 -0
- package/es/add-cell/libro-add-cell-slot-contribution.d.ts +12 -0
- package/es/add-cell/libro-add-cell-slot-contribution.d.ts.map +1 -0
- package/es/add-cell/libro-add-cell-slot-contribution.js +53 -0
- package/es/add-cell/libro-add-cell-view.d.ts +21 -0
- package/es/add-cell/libro-add-cell-view.d.ts.map +1 -0
- package/es/add-cell/libro-add-cell-view.js +129 -0
- package/es/cell/index.d.ts +10 -0
- package/es/cell/index.d.ts.map +1 -0
- package/es/cell/index.js +9 -0
- package/es/cell/libro-cell-contribution.d.ts +13 -0
- package/es/cell/libro-cell-contribution.d.ts.map +1 -0
- package/es/cell/libro-cell-contribution.js +41 -0
- package/es/cell/libro-cell-model.d.ts +19 -0
- package/es/cell/libro-cell-model.d.ts.map +1 -0
- package/es/cell/libro-cell-model.js +103 -0
- package/es/cell/libro-cell-module.d.ts +10 -0
- package/es/cell/libro-cell-module.d.ts.map +1 -0
- package/es/cell/libro-cell-module.js +30 -0
- package/es/cell/libro-cell-protocol.d.ts +42 -0
- package/es/cell/libro-cell-protocol.d.ts.map +1 -0
- package/es/cell/libro-cell-protocol.js +11 -0
- package/es/cell/libro-cell-service.d.ts +28 -0
- package/es/cell/libro-cell-service.d.ts.map +1 -0
- package/es/cell/libro-cell-service.js +242 -0
- package/es/cell/libro-cell-view.d.ts +65 -0
- package/es/cell/libro-cell-view.d.ts.map +1 -0
- package/es/cell/libro-cell-view.js +191 -0
- package/es/cell/libro-edit-cell-view.d.ts +32 -0
- package/es/cell/libro-edit-cell-view.d.ts.map +1 -0
- package/es/cell/libro-edit-cell-view.js +72 -0
- package/es/cell/libro-executable-cell-model.d.ts +14 -0
- package/es/cell/libro-executable-cell-model.d.ts.map +1 -0
- package/es/cell/libro-executable-cell-model.js +7 -0
- package/es/cell/libro-executable-cell-view.d.ts +27 -0
- package/es/cell/libro-executable-cell-view.d.ts.map +1 -0
- package/es/cell/libro-executable-cell-view.js +66 -0
- package/es/cell/libro-markdown-cell-model.d.ts +9 -0
- package/es/cell/libro-markdown-cell-model.d.ts.map +1 -0
- package/es/cell/libro-markdown-cell-model.js +7 -0
- package/es/collapse-service.d.ts +36 -0
- package/es/collapse-service.d.ts.map +1 -0
- package/es/collapse-service.js +55 -0
- package/es/command/document-commands.d.ts +6 -0
- package/es/command/document-commands.d.ts.map +1 -0
- package/es/command/document-commands.js +13 -0
- package/es/command/index.d.ts +7 -0
- package/es/command/index.d.ts.map +1 -0
- package/es/command/index.js +6 -0
- package/es/command/kernel-command.d.ts +5 -0
- package/es/command/kernel-command.d.ts.map +1 -0
- package/es/command/kernel-command.js +39 -0
- package/es/command/libro-command-contribution.d.ts +14 -0
- package/es/command/libro-command-contribution.d.ts.map +1 -0
- package/es/command/libro-command-contribution.js +1751 -0
- package/es/command/libro-command-register.d.ts +22 -0
- package/es/command/libro-command-register.d.ts.map +1 -0
- package/es/command/libro-command-register.js +105 -0
- package/es/command/module.d.ts +3 -0
- package/es/command/module.d.ts.map +1 -0
- package/es/command/module.js +4 -0
- package/es/command/notebook-commands.d.ts +6 -0
- package/es/command/notebook-commands.d.ts.map +1 -0
- package/es/command/notebook-commands.js +468 -0
- package/es/components/cell-protocol.d.ts +20 -0
- package/es/components/cell-protocol.d.ts.map +1 -0
- package/es/components/cell-protocol.js +4 -0
- package/es/components/dnd-cell-item-render.d.ts +12 -0
- package/es/components/dnd-cell-item-render.d.ts.map +1 -0
- package/es/components/dnd-cell-item-render.js +253 -0
- package/es/components/dnd-component/custom-drag-layer.d.ts +9 -0
- package/es/components/dnd-component/custom-drag-layer.d.ts.map +1 -0
- package/es/components/dnd-component/custom-drag-layer.js +141 -0
- package/es/components/dnd-component/default-dnd-content.d.ts +10 -0
- package/es/components/dnd-component/default-dnd-content.d.ts.map +1 -0
- package/es/components/dnd-component/default-dnd-content.js +257 -0
- package/es/components/dnd-component/dnd-context.d.ts +3 -0
- package/es/components/dnd-component/dnd-context.d.ts.map +1 -0
- package/es/components/dnd-component/dnd-context.js +20 -0
- package/es/components/dnd-component/dnd-list.d.ts +10 -0
- package/es/components/dnd-component/dnd-list.d.ts.map +1 -0
- package/es/components/dnd-component/dnd-list.js +115 -0
- package/es/components/dnd-component/index.d.ts +5 -0
- package/es/components/dnd-component/index.d.ts.map +1 -0
- package/es/components/dnd-component/index.js +4 -0
- package/es/components/index.d.ts +6 -0
- package/es/components/index.d.ts.map +1 -0
- package/es/components/index.js +5 -0
- package/es/components/libro-component.d.ts +5 -0
- package/es/components/libro-component.d.ts.map +1 -0
- package/es/components/libro-component.js +35 -0
- package/es/components/libro-side-toolbar-menu.d.ts +21 -0
- package/es/components/libro-side-toolbar-menu.d.ts.map +1 -0
- package/es/components/libro-side-toolbar-menu.js +58 -0
- package/es/components/libro-view-header.d.ts +3 -0
- package/es/components/libro-view-header.d.ts.map +1 -0
- package/es/components/libro-view-header.js +37 -0
- package/es/configuration/libro-configuration-contribution.d.ts +5 -0
- package/es/configuration/libro-configuration-contribution.d.ts.map +1 -0
- package/es/configuration/libro-configuration-contribution.js +24 -0
- package/es/configuration/libro-configuration.d.ts +10 -0
- package/es/configuration/libro-configuration.d.ts.map +1 -0
- package/es/configuration/libro-configuration.js +81 -0
- package/es/content/index.d.ts +5 -0
- package/es/content/index.d.ts.map +1 -0
- package/es/content/index.js +4 -0
- package/es/content/libro-content-contribution.d.ts +11 -0
- package/es/content/libro-content-contribution.d.ts.map +1 -0
- package/es/content/libro-content-contribution.js +32 -0
- package/es/content/libro-content-module.d.ts +3 -0
- package/es/content/libro-content-module.d.ts.map +1 -0
- package/es/content/libro-content-module.js +5 -0
- package/es/content/libro-content-protocol.d.ts +8 -0
- package/es/content/libro-content-protocol.d.ts.map +1 -0
- package/es/content/libro-content-protocol.js +2 -0
- package/es/content/libro-content-service.d.ts +9 -0
- package/es/content/libro-content-service.d.ts.map +1 -0
- package/es/content/libro-content-service.js +35 -0
- package/es/index.d.ts +20 -0
- package/es/index.d.ts.map +1 -0
- package/es/index.js +19 -0
- package/es/index.less +682 -0
- package/es/libro-context-key.d.ts +22 -0
- package/es/libro-context-key.d.ts.map +1 -0
- package/es/libro-context-key.js +80 -0
- package/es/libro-keybind-registry.d.ts +5 -0
- package/es/libro-keybind-registry.d.ts.map +1 -0
- package/es/libro-keybind-registry.js +68 -0
- package/es/libro-model.d.ts +129 -0
- package/es/libro-model.d.ts.map +1 -0
- package/es/libro-model.js +803 -0
- package/es/libro-protocol.d.ts +241 -0
- package/es/libro-protocol.d.ts.map +1 -0
- package/es/libro-protocol.js +34 -0
- package/es/libro-service.d.ts +34 -0
- package/es/libro-service.d.ts.map +1 -0
- package/es/libro-service.js +180 -0
- package/es/libro-view-tracker.d.ts +6 -0
- package/es/libro-view-tracker.d.ts.map +1 -0
- package/es/libro-view-tracker.js +13 -0
- package/es/libro-view.d.ts +151 -0
- package/es/libro-view.d.ts.map +1 -0
- package/es/libro-view.js +1963 -0
- package/es/material-from-designer.d.ts +27 -0
- package/es/material-from-designer.d.ts.map +1 -0
- package/es/material-from-designer.js +550 -0
- package/es/module.d.ts +3 -0
- package/es/module.d.ts.map +1 -0
- package/es/module.js +55 -0
- package/es/output/index.d.ts +6 -0
- package/es/output/index.d.ts.map +1 -0
- package/es/output/index.js +5 -0
- package/es/output/output-area.d.ts +51 -0
- package/es/output/output-area.d.ts.map +1 -0
- package/es/output/output-area.js +346 -0
- package/es/output/output-contribution.d.ts +11 -0
- package/es/output/output-contribution.d.ts.map +1 -0
- package/es/output/output-contribution.js +31 -0
- package/es/output/output-model.d.ts +27 -0
- package/es/output/output-model.d.ts.map +1 -0
- package/es/output/output-model.js +95 -0
- package/es/output/output-module.d.ts +3 -0
- package/es/output/output-module.d.ts.map +1 -0
- package/es/output/output-module.js +6 -0
- package/es/output/output-protocol.d.ts +130 -0
- package/es/output/output-protocol.d.ts.map +1 -0
- package/es/output/output-protocol.js +18 -0
- package/es/slot/index.d.ts +5 -0
- package/es/slot/index.d.ts.map +1 -0
- package/es/slot/index.js +4 -0
- package/es/slot/libro-slot-manager.d.ts +13 -0
- package/es/slot/libro-slot-manager.d.ts.map +1 -0
- package/es/slot/libro-slot-manager.js +57 -0
- package/es/slot/libro-slot-protocol.d.ts +19 -0
- package/es/slot/libro-slot-protocol.d.ts.map +1 -0
- package/es/slot/libro-slot-protocol.js +5 -0
- package/es/slot/libro-slot-view.d.ts +9 -0
- package/es/slot/libro-slot-view.d.ts.map +1 -0
- package/es/slot/libro-slot-view.js +81 -0
- package/es/slot/module.d.ts +3 -0
- package/es/slot/module.d.ts.map +1 -0
- package/es/slot/module.js +5 -0
- package/es/theme/libro-color-registry.d.ts +6 -0
- package/es/theme/libro-color-registry.d.ts.map +1 -0
- package/es/theme/libro-color-registry.js +494 -0
- package/es/toolbar/change-cell-to-selector.d.ts +5 -0
- package/es/toolbar/change-cell-to-selector.d.ts.map +1 -0
- package/es/toolbar/change-cell-to-selector.js +48 -0
- package/es/toolbar/hide-all-selector.d.ts +5 -0
- package/es/toolbar/hide-all-selector.d.ts.map +1 -0
- package/es/toolbar/hide-all-selector.js +99 -0
- package/es/toolbar/index.d.ts +4 -0
- package/es/toolbar/index.d.ts.map +1 -0
- package/es/toolbar/index.js +3 -0
- package/es/toolbar/index.less +59 -0
- package/es/toolbar/libro-toolbar-protocol.d.ts +4 -0
- package/es/toolbar/libro-toolbar-protocol.d.ts.map +1 -0
- package/es/toolbar/libro-toolbar-protocol.js +1 -0
- package/es/toolbar/libro-toolbar.d.ts +8 -0
- package/es/toolbar/libro-toolbar.d.ts.map +1 -0
- package/es/toolbar/libro-toolbar.js +223 -0
- package/es/toolbar/module.d.ts +3 -0
- package/es/toolbar/module.d.ts.map +1 -0
- package/es/toolbar/module.js +5 -0
- package/es/toolbar/restart-clear-outputs-contribution.d.ts +5 -0
- package/es/toolbar/restart-clear-outputs-contribution.d.ts.map +1 -0
- package/es/toolbar/restart-clear-outputs-contribution.js +23 -0
- package/es/toolbar/restart-clear-outputs-modal.d.ts +6 -0
- package/es/toolbar/restart-clear-outputs-modal.d.ts.map +1 -0
- package/es/toolbar/restart-clear-outputs-modal.js +30 -0
- package/es/toolbar/save-icon.d.ts +3 -0
- package/es/toolbar/save-icon.d.ts.map +1 -0
- package/es/toolbar/save-icon.js +54 -0
- package/es/toolbar/shutdown-contribution.d.ts +5 -0
- package/es/toolbar/shutdown-contribution.d.ts.map +1 -0
- package/es/toolbar/shutdown-contribution.js +23 -0
- package/es/toolbar/shutdown-modal.d.ts +6 -0
- package/es/toolbar/shutdown-modal.d.ts.map +1 -0
- package/es/toolbar/shutdown-modal.js +30 -0
- package/es/toolbar/side-toolar-more-select.d.ts +4 -0
- package/es/toolbar/side-toolar-more-select.d.ts.map +1 -0
- package/es/toolbar/side-toolar-more-select.js +161 -0
- package/es/typings/index.d.ts +1 -0
- package/package.json +70 -0
- package/src/add-cell/index.less +38 -0
- package/src/add-cell/index.ts +3 -0
- package/src/add-cell/libro-add-cell-module.ts +9 -0
- package/src/add-cell/libro-add-cell-slot-contribution.ts +31 -0
- package/src/add-cell/libro-add-cell-view.tsx +101 -0
- package/src/cell/README.md +14 -0
- package/src/cell/index.ts +9 -0
- package/src/cell/libro-cell-contribution.ts +38 -0
- package/src/cell/libro-cell-model.ts +61 -0
- package/src/cell/libro-cell-module.ts +40 -0
- package/src/cell/libro-cell-protocol.ts +53 -0
- package/src/cell/libro-cell-service.ts +157 -0
- package/src/cell/libro-cell-view.tsx +128 -0
- package/src/cell/libro-edit-cell-view.tsx +60 -0
- package/src/cell/libro-executable-cell-model.ts +32 -0
- package/src/cell/libro-executable-cell-view.ts +74 -0
- package/src/cell/libro-markdown-cell-model.ts +20 -0
- package/src/collapse-service.ts +69 -0
- package/src/command/document-commands.ts +18 -0
- package/src/command/index.ts +6 -0
- package/src/command/kernel-command.ts +41 -0
- package/src/command/libro-command-contribution.ts +1339 -0
- package/src/command/libro-command-register.ts +171 -0
- package/src/command/module.ts +9 -0
- package/src/command/notebook-commands.ts +498 -0
- package/src/components/cell-protocol.ts +22 -0
- package/src/components/dnd-cell-item-render.tsx +308 -0
- package/src/components/dnd-component/custom-drag-layer.tsx +145 -0
- package/src/components/dnd-component/default-dnd-content.tsx +275 -0
- package/src/components/dnd-component/dnd-context.tsx +28 -0
- package/src/components/dnd-component/dnd-list.tsx +116 -0
- package/src/components/dnd-component/index.tsx +4 -0
- package/src/components/index.ts +5 -0
- package/src/components/libro-component.tsx +30 -0
- package/src/components/libro-side-toolbar-menu.tsx +82 -0
- package/src/components/libro-view-header.tsx +33 -0
- package/src/configuration/libro-configuration-contribution.ts +29 -0
- package/src/configuration/libro-configuration.ts +88 -0
- package/src/content/index.ts +4 -0
- package/src/content/libro-content-contribution.ts +17 -0
- package/src/content/libro-content-module.ts +9 -0
- package/src/content/libro-content-protocol.ts +8 -0
- package/src/content/libro-content-service.ts +30 -0
- package/src/index.less +682 -0
- package/src/index.tsx +19 -0
- package/src/libro-context-key.ts +80 -0
- package/src/libro-keybind-registry.ts +43 -0
- package/src/libro-model.ts +614 -0
- package/src/libro-protocol.ts +322 -0
- package/src/libro-service.ts +121 -0
- package/src/libro-view-tracker.ts +9 -0
- package/src/libro-view.tsx +1399 -0
- package/src/material-from-designer.tsx +457 -0
- package/src/module.ts +90 -0
- package/src/output/index.ts +5 -0
- package/src/output/output-area.tsx +255 -0
- package/src/output/output-contribution.ts +18 -0
- package/src/output/output-model.tsx +66 -0
- package/src/output/output-module.ts +10 -0
- package/src/output/output-protocol.ts +164 -0
- package/src/slot/index.ts +4 -0
- package/src/slot/libro-slot-manager.ts +37 -0
- package/src/slot/libro-slot-protocol.ts +28 -0
- package/src/slot/libro-slot-view.tsx +51 -0
- package/src/slot/module.ts +9 -0
- package/src/theme/libro-color-registry.ts +371 -0
- package/src/toolbar/change-cell-to-selector.tsx +58 -0
- package/src/toolbar/hide-all-selector.tsx +126 -0
- package/src/toolbar/index.less +59 -0
- package/src/toolbar/index.ts +3 -0
- package/src/toolbar/libro-toolbar-protocol.ts +4 -0
- package/src/toolbar/libro-toolbar.tsx +192 -0
- package/src/toolbar/module.ts +11 -0
- package/src/toolbar/restart-clear-outputs-contribution.tsx +10 -0
- package/src/toolbar/restart-clear-outputs-modal.tsx +37 -0
- package/src/toolbar/save-icon.tsx +47 -0
- package/src/toolbar/shutdown-contribution.tsx +10 -0
- package/src/toolbar/shutdown-modal.tsx +37 -0
- package/src/toolbar/side-toolar-more-select.tsx +172 -0
- package/src/typings/index.d.ts +1 -0
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
import type { IOutput } from '@difizen/libro-common';
|
|
2
|
+
import { isError, isStream } from '@difizen/libro-common';
|
|
3
|
+
import type { ViewComponent } from '@difizen/mana-app';
|
|
4
|
+
import type { Contribution } from '@difizen/mana-app';
|
|
5
|
+
import {
|
|
6
|
+
ViewOption,
|
|
7
|
+
getOrigin,
|
|
8
|
+
ViewRender,
|
|
9
|
+
BaseView,
|
|
10
|
+
Priority,
|
|
11
|
+
useInject,
|
|
12
|
+
view,
|
|
13
|
+
ViewInstance,
|
|
14
|
+
} from '@difizen/mana-app';
|
|
15
|
+
import { Emitter } from '@difizen/mana-app';
|
|
16
|
+
import { contrib, inject, transient } from '@difizen/mana-app';
|
|
17
|
+
import { prop } from '@difizen/mana-app';
|
|
18
|
+
import React, { useEffect } from 'react';
|
|
19
|
+
import { v4 } from 'uuid';
|
|
20
|
+
|
|
21
|
+
import { ExecutableCellView } from '../cell/index.js';
|
|
22
|
+
import type { CellView } from '../libro-protocol.js';
|
|
23
|
+
|
|
24
|
+
import type {
|
|
25
|
+
BaseOutputArea,
|
|
26
|
+
BaseOutputView,
|
|
27
|
+
IOutputAreaOption,
|
|
28
|
+
} from './output-protocol.js';
|
|
29
|
+
import { OutputContribution } from './output-protocol.js';
|
|
30
|
+
|
|
31
|
+
const LibroOutputAreaRender = React.forwardRef<HTMLDivElement>(
|
|
32
|
+
function LibroOutputAreaRender(_props, ref) {
|
|
33
|
+
const outputArea = useInject<LibroOutputArea>(ViewInstance);
|
|
34
|
+
|
|
35
|
+
useEffect(() => {
|
|
36
|
+
outputArea.onUpdateEmitter.fire();
|
|
37
|
+
}, [outputArea.onUpdateEmitter, outputArea.outputs]);
|
|
38
|
+
|
|
39
|
+
return (
|
|
40
|
+
<div className="libro-output-area" ref={ref}>
|
|
41
|
+
{outputArea.outputs.map((output) => {
|
|
42
|
+
return <ViewRender view={output} key={output.id} />;
|
|
43
|
+
})}
|
|
44
|
+
</div>
|
|
45
|
+
);
|
|
46
|
+
},
|
|
47
|
+
);
|
|
48
|
+
|
|
49
|
+
@transient()
|
|
50
|
+
@view('libro-output-area')
|
|
51
|
+
export class LibroOutputArea extends BaseView implements BaseOutputArea {
|
|
52
|
+
override view: ViewComponent = LibroOutputAreaRender;
|
|
53
|
+
cell: CellView;
|
|
54
|
+
@prop()
|
|
55
|
+
outputs: BaseOutputView[] = [];
|
|
56
|
+
|
|
57
|
+
@contrib(OutputContribution)
|
|
58
|
+
outputProvider: Contribution.Provider<OutputContribution>;
|
|
59
|
+
|
|
60
|
+
constructor(@inject(ViewOption) option: IOutputAreaOption) {
|
|
61
|
+
super();
|
|
62
|
+
this.cell = option.cell;
|
|
63
|
+
}
|
|
64
|
+
disposed?: boolean | undefined;
|
|
65
|
+
|
|
66
|
+
get length() {
|
|
67
|
+
return this.outputs.length;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
protected clearNext = false;
|
|
71
|
+
protected lastStream = '';
|
|
72
|
+
|
|
73
|
+
protected lastName?: 'stdout' | 'stderr';
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* @internal
|
|
77
|
+
*/
|
|
78
|
+
onUpdateEmitter = new Emitter<void>();
|
|
79
|
+
|
|
80
|
+
get onUpdate() {
|
|
81
|
+
return this.onUpdateEmitter.event;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
get(index: number): BaseOutputView {
|
|
85
|
+
if (index >= 0 && index < this.outputs.length) {
|
|
86
|
+
return this.outputs[index];
|
|
87
|
+
}
|
|
88
|
+
throw new Error('index out of range');
|
|
89
|
+
}
|
|
90
|
+
protected doCreateOutput(options: IOutput): Promise<BaseOutputView> {
|
|
91
|
+
const provider = this.findProvider(options);
|
|
92
|
+
|
|
93
|
+
return provider.factory({
|
|
94
|
+
output: { _librOutputId: v4(), ...options },
|
|
95
|
+
trusted: this.cell.model.trusted,
|
|
96
|
+
cell: this.cell,
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
add = async (output: IOutput): Promise<number> => {
|
|
100
|
+
// if (this.clearNext) {
|
|
101
|
+
// this.clear();
|
|
102
|
+
// this.clearNext = false;
|
|
103
|
+
// }
|
|
104
|
+
// Consolidate outputs if they are stream outputs of the same kind.
|
|
105
|
+
if (
|
|
106
|
+
isStream(output) &&
|
|
107
|
+
this.lastStream &&
|
|
108
|
+
output.name === this.lastName &&
|
|
109
|
+
this.shouldCombine({
|
|
110
|
+
output,
|
|
111
|
+
lastModel: this.outputs[this.length - 1],
|
|
112
|
+
})
|
|
113
|
+
) {
|
|
114
|
+
// In order to get a list change event, we add the previous
|
|
115
|
+
// text to the current item and replace the previous item.
|
|
116
|
+
// This also replaces the metadata of the last item.
|
|
117
|
+
this.lastStream += normalize(output.text);
|
|
118
|
+
this.lastStream = removeOverwrittenChars(this.lastStream);
|
|
119
|
+
output.text = this.lastStream;
|
|
120
|
+
const index = this.length - 1;
|
|
121
|
+
this.set(index, output);
|
|
122
|
+
return this.length;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
if (isStream(output)) {
|
|
126
|
+
output.text = removeOverwrittenChars(normalize(output.text));
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
const outputModel = this.doCreateOutput(output);
|
|
130
|
+
|
|
131
|
+
// Update the stream information.
|
|
132
|
+
if (isStream(output)) {
|
|
133
|
+
this.lastStream = normalize(output.text);
|
|
134
|
+
this.lastName = output.name;
|
|
135
|
+
} else {
|
|
136
|
+
this.lastStream = '';
|
|
137
|
+
}
|
|
138
|
+
return this.outputs.push(await outputModel);
|
|
139
|
+
};
|
|
140
|
+
set = async (index: number, output: IOutput) => {
|
|
141
|
+
const outputModel = this.doCreateOutput(output);
|
|
142
|
+
const current = this.outputs[index];
|
|
143
|
+
current.dispose();
|
|
144
|
+
this.outputs[index] = await outputModel;
|
|
145
|
+
};
|
|
146
|
+
clear(wait?: boolean | undefined) {
|
|
147
|
+
this.lastStream = '';
|
|
148
|
+
if (wait) {
|
|
149
|
+
this.clearNext = true;
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
152
|
+
this.outputs.forEach((output) => {
|
|
153
|
+
output.dispose();
|
|
154
|
+
});
|
|
155
|
+
this.outputs = [];
|
|
156
|
+
}
|
|
157
|
+
fromJSON = async (values: IOutput[]) => {
|
|
158
|
+
if (!values) {
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
161
|
+
// this.clear();
|
|
162
|
+
for (const value of values) {
|
|
163
|
+
await this.add(value);
|
|
164
|
+
}
|
|
165
|
+
};
|
|
166
|
+
toJSON = (): IOutput[] => {
|
|
167
|
+
return this.outputs.map((output) => output.toJSON());
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
setupCellView(cell: CellView) {
|
|
171
|
+
this.cell = cell;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
protected findProvider(options: IOutput): OutputContribution {
|
|
175
|
+
const prioritized = Priority.sortSync(
|
|
176
|
+
this.outputProvider.getContributions(),
|
|
177
|
+
(contribution) => contribution.canHandle(options),
|
|
178
|
+
);
|
|
179
|
+
const sorted = prioritized.map((c) => c.value);
|
|
180
|
+
return sorted[0]!;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* Whether a new value should be consolidated with the previous output.
|
|
185
|
+
*
|
|
186
|
+
* This will only be called if the minimal criteria of both being stream
|
|
187
|
+
* messages of the same type.
|
|
188
|
+
*/
|
|
189
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
190
|
+
protected shouldCombine(_options: {
|
|
191
|
+
output: IOutput;
|
|
192
|
+
lastModel: BaseOutputView;
|
|
193
|
+
}): boolean {
|
|
194
|
+
return true;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* Remove characters that are overridden by backspace characters.
|
|
200
|
+
*/
|
|
201
|
+
function fixBackspace(txt: string): string {
|
|
202
|
+
let tmp = txt;
|
|
203
|
+
do {
|
|
204
|
+
// eslint-disable-next-line no-param-reassign
|
|
205
|
+
txt = tmp;
|
|
206
|
+
// Cancel out anything-but-newline followed by backspace
|
|
207
|
+
tmp = txt.replace(/[^\n]\x08/gm, ''); // eslint-disable-line no-control-regex
|
|
208
|
+
} while (tmp.length < txt.length);
|
|
209
|
+
return txt;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* Remove chunks that should be overridden by the effect of
|
|
214
|
+
* carriage return characters.
|
|
215
|
+
*/
|
|
216
|
+
function fixCarriageReturn(txt: string): string {
|
|
217
|
+
// eslint-disable-next-line no-param-reassign
|
|
218
|
+
txt = txt.replace(/\r+\n/gm, '\n'); // \r followed by \n --> newline
|
|
219
|
+
while (txt.search(/\r[^$]/g) > -1) {
|
|
220
|
+
const base = txt.match(/^(.*)\r+/m)![1];
|
|
221
|
+
let insert = txt.match(/\r+(.*)$/m)![1];
|
|
222
|
+
insert = insert + base.slice(insert.length, base.length);
|
|
223
|
+
// eslint-disable-next-line no-param-reassign
|
|
224
|
+
txt = txt.replace(/\r+.*$/m, '\r').replace(/^.*\r/m, insert);
|
|
225
|
+
}
|
|
226
|
+
return txt;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
/*
|
|
230
|
+
* Remove characters overridden by backspaces and carriage returns
|
|
231
|
+
*/
|
|
232
|
+
export function removeOverwrittenChars(text: string): string {
|
|
233
|
+
return fixCarriageReturn(fixBackspace(text));
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
/**
|
|
237
|
+
* Normalize an output.
|
|
238
|
+
*/
|
|
239
|
+
//TODO: output处理
|
|
240
|
+
export function normalize(value: string[] | string): string {
|
|
241
|
+
if (Array.isArray(value)) {
|
|
242
|
+
return value.join('');
|
|
243
|
+
}
|
|
244
|
+
return value;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
export function hasErrorOutput(cell: CellView): boolean {
|
|
248
|
+
if (!ExecutableCellView.is(cell)) {
|
|
249
|
+
return false;
|
|
250
|
+
}
|
|
251
|
+
if (cell.outputArea && cell.outputArea.length) {
|
|
252
|
+
return !!cell.outputArea.outputs.find((output) => isError(getOrigin(output.raw)));
|
|
253
|
+
}
|
|
254
|
+
return false;
|
|
255
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ViewManager } from '@difizen/mana-app';
|
|
2
|
+
import { inject, singleton } from '@difizen/mana-app';
|
|
3
|
+
|
|
4
|
+
import { LibroOutputView } from './output-model.js';
|
|
5
|
+
import type { IOutputOptions } from './output-protocol.js';
|
|
6
|
+
import { OutputContribution } from './output-protocol.js';
|
|
7
|
+
|
|
8
|
+
@singleton({ contrib: OutputContribution })
|
|
9
|
+
export class DefaultOutputContribution implements OutputContribution {
|
|
10
|
+
viewManager: ViewManager;
|
|
11
|
+
constructor(@inject(ViewManager) viewManager: ViewManager) {
|
|
12
|
+
this.viewManager = viewManager;
|
|
13
|
+
}
|
|
14
|
+
canHandle = () => 1;
|
|
15
|
+
factory(output: IOutputOptions) {
|
|
16
|
+
return this.viewManager.getOrCreateView(LibroOutputView, output);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import type { IOutput, JSONObject, PartialJSONObject } from '@difizen/libro-common';
|
|
2
|
+
import { BaseView, prop, view, ViewOption } from '@difizen/mana-app';
|
|
3
|
+
import { inject, transient } from '@difizen/mana-app';
|
|
4
|
+
import type { FC } from 'react';
|
|
5
|
+
import { v4 } from 'uuid';
|
|
6
|
+
|
|
7
|
+
import type { CellView } from '../libro-protocol.js';
|
|
8
|
+
|
|
9
|
+
import type { IOutputOptions } from './output-protocol.js';
|
|
10
|
+
import type { ISetDataOptions, BaseOutputView } from './output-protocol.js';
|
|
11
|
+
|
|
12
|
+
const LibroOutputModelRender: FC<{ output: BaseOutputView }> = (props: {
|
|
13
|
+
output: BaseOutputView;
|
|
14
|
+
}) => {
|
|
15
|
+
const { output } = props;
|
|
16
|
+
return <div>{JSON.stringify(output.toJSON(), null, 2)}</div>;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
@transient()
|
|
20
|
+
@view('libro-output-model')
|
|
21
|
+
export class LibroOutputView extends BaseView implements BaseOutputView {
|
|
22
|
+
override id = v4();
|
|
23
|
+
|
|
24
|
+
// 增加cell属性,使得通过output可以找到Cell
|
|
25
|
+
cell: CellView;
|
|
26
|
+
type: string;
|
|
27
|
+
|
|
28
|
+
@prop()
|
|
29
|
+
raw: IOutput;
|
|
30
|
+
|
|
31
|
+
@prop()
|
|
32
|
+
data: JSONObject;
|
|
33
|
+
@prop()
|
|
34
|
+
metadata: PartialJSONObject;
|
|
35
|
+
constructor(@inject(ViewOption) options: IOutputOptions) {
|
|
36
|
+
super();
|
|
37
|
+
this.raw = options.output;
|
|
38
|
+
this.trusted = options.trusted;
|
|
39
|
+
this.cell = options.cell;
|
|
40
|
+
this.type = 'libro-default-output';
|
|
41
|
+
this.data = {};
|
|
42
|
+
this.metadata = {};
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
render: FC<{ output: BaseOutputView }> = LibroOutputModelRender;
|
|
46
|
+
trusted: boolean;
|
|
47
|
+
override dispose() {
|
|
48
|
+
//
|
|
49
|
+
}
|
|
50
|
+
toJSON() {
|
|
51
|
+
return this.raw;
|
|
52
|
+
}
|
|
53
|
+
setData(options: ISetDataOptions): void {
|
|
54
|
+
if (options.data) {
|
|
55
|
+
this.data = options.data;
|
|
56
|
+
}
|
|
57
|
+
if (options.metadata) {
|
|
58
|
+
this.metadata = options.metadata;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* @deprecated use LibroOutputView instead.
|
|
65
|
+
*/
|
|
66
|
+
export const LibroOutputModel = LibroOutputView;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ManaModule } from '@difizen/mana-app';
|
|
2
|
+
|
|
3
|
+
import { LibroOutputArea } from './output-area.js';
|
|
4
|
+
import { DefaultOutputContribution } from './output-contribution.js';
|
|
5
|
+
import { LibroOutputModel } from './output-model.js';
|
|
6
|
+
import { OutputContribution } from './output-protocol.js';
|
|
7
|
+
|
|
8
|
+
export const OutputModule = ManaModule.create()
|
|
9
|
+
.contribution(OutputContribution)
|
|
10
|
+
.register(LibroOutputArea, LibroOutputModel, DefaultOutputContribution);
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
IOutput,
|
|
3
|
+
ReadonlyPartialJSONObject,
|
|
4
|
+
JSONObject,
|
|
5
|
+
} from '@difizen/libro-common';
|
|
6
|
+
import type { Event } from '@difizen/mana-app';
|
|
7
|
+
import type { View } from '@difizen/mana-app';
|
|
8
|
+
import { Syringe } from '@difizen/mana-app';
|
|
9
|
+
|
|
10
|
+
import type { CellView } from '../libro-protocol.js';
|
|
11
|
+
// import type { CellModel } from '../libro-protocol';
|
|
12
|
+
|
|
13
|
+
export const CellOption = Symbol('CellOption');
|
|
14
|
+
|
|
15
|
+
export interface IOutputAreaOption {
|
|
16
|
+
cellId: string;
|
|
17
|
+
outputAreaId?: string;
|
|
18
|
+
cell: CellView;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface BaseOutputArea extends View {
|
|
22
|
+
/**
|
|
23
|
+
* The length of the items in the model.
|
|
24
|
+
*/
|
|
25
|
+
readonly length: number;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Whether the output area is trusted.
|
|
29
|
+
*/
|
|
30
|
+
// trusted: boolean;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Get an item at the specified index.
|
|
34
|
+
*/
|
|
35
|
+
get: (index: number) => BaseOutputModel;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Add an output, which may be combined with previous output.
|
|
39
|
+
*
|
|
40
|
+
* @returns The total number of outputs.
|
|
41
|
+
*
|
|
42
|
+
* #### Notes
|
|
43
|
+
* The output bundle is copied.
|
|
44
|
+
* Contiguous stream outputs of the same `name` are combined.
|
|
45
|
+
*/
|
|
46
|
+
add: (output: IOutput) => Promise<number>;
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Set the value at the specified index.
|
|
50
|
+
*/
|
|
51
|
+
set: (index: number, output: IOutput) => Promise<void>;
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Clear all of the output.
|
|
55
|
+
*
|
|
56
|
+
* @param wait - Delay clearing the output until the next message is added.
|
|
57
|
+
*/
|
|
58
|
+
clear: (wait?: boolean) => void;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Deserialize the model from JSON.
|
|
62
|
+
*
|
|
63
|
+
* #### Notes
|
|
64
|
+
* This will clear any existing data.
|
|
65
|
+
*/
|
|
66
|
+
fromJSON: (values: IOutput[]) => Promise<void>;
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Serialize the model to JSON.
|
|
70
|
+
*/
|
|
71
|
+
toJSON: () => IOutput[];
|
|
72
|
+
|
|
73
|
+
outputs: BaseOutputModel[];
|
|
74
|
+
|
|
75
|
+
cell: CellView;
|
|
76
|
+
|
|
77
|
+
setupCellView: (cell: CellView) => void;
|
|
78
|
+
|
|
79
|
+
get onUpdate(): Event<void>;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* The interface for an output model.
|
|
84
|
+
*/
|
|
85
|
+
export interface BaseOutputView extends View {
|
|
86
|
+
id: string;
|
|
87
|
+
|
|
88
|
+
raw: IOutput;
|
|
89
|
+
|
|
90
|
+
cell: CellView;
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* The output type.
|
|
94
|
+
*/
|
|
95
|
+
readonly type: string;
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Whether the output is trusted.
|
|
99
|
+
*/
|
|
100
|
+
trusted: boolean;
|
|
101
|
+
/**
|
|
102
|
+
* The data associated with the model.
|
|
103
|
+
*/
|
|
104
|
+
readonly data: JSONObject;
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* The metadata associated with the model.
|
|
108
|
+
*
|
|
109
|
+
* Among others, it can include an attribute named `fragment`
|
|
110
|
+
* that stores a URI fragment identifier for the MIME resource.
|
|
111
|
+
*/
|
|
112
|
+
readonly metadata: ReadonlyPartialJSONObject;
|
|
113
|
+
/**
|
|
114
|
+
* Dispose of the resources used by the output model.
|
|
115
|
+
*/
|
|
116
|
+
dispose: () => void;
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Serialize the model to JSON.
|
|
120
|
+
*/
|
|
121
|
+
toJSON: () => IOutput;
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Set the data associated with the model.
|
|
125
|
+
*
|
|
126
|
+
* #### Notes
|
|
127
|
+
* Depending on the implementation of the mime model,
|
|
128
|
+
*/
|
|
129
|
+
setData(options: ISetDataOptions): void;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* @deprecated use BaseOutputView instead
|
|
134
|
+
*/
|
|
135
|
+
export type BaseOutputModel = BaseOutputView;
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* The options used to update a output model.
|
|
139
|
+
*/
|
|
140
|
+
export interface ISetDataOptions {
|
|
141
|
+
/**
|
|
142
|
+
* The new data object.
|
|
143
|
+
*/
|
|
144
|
+
data?: JSONObject;
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* The new metadata object.
|
|
148
|
+
*/
|
|
149
|
+
metadata?: JSONObject;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
export interface IOutputOptions {
|
|
153
|
+
output: IOutput;
|
|
154
|
+
trusted: boolean;
|
|
155
|
+
cell: CellView;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
export type OutputModelFactory = (options: IOutputOptions) => Promise<BaseOutputModel>;
|
|
159
|
+
|
|
160
|
+
export const OutputContribution = Syringe.defineToken('OutputContribution');
|
|
161
|
+
export interface OutputContribution {
|
|
162
|
+
canHandle: (output: IOutput) => number;
|
|
163
|
+
factory: OutputModelFactory;
|
|
164
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { Contribution } from '@difizen/mana-app';
|
|
2
|
+
import { SlotViewManager } from '@difizen/mana-app';
|
|
3
|
+
import { contrib, inject, singleton } from '@difizen/mana-app';
|
|
4
|
+
|
|
5
|
+
import type { LibroView } from '../libro-view.js';
|
|
6
|
+
|
|
7
|
+
import type { LibroSlot } from './libro-slot-protocol.js';
|
|
8
|
+
import { LibroExtensionSlotContribution } from './libro-slot-protocol.js';
|
|
9
|
+
|
|
10
|
+
@singleton()
|
|
11
|
+
export class LibroSlotManager {
|
|
12
|
+
protected slotViewManager: SlotViewManager;
|
|
13
|
+
protected readonly libroExtraProvider: Contribution.Provider<LibroExtensionSlotContribution>;
|
|
14
|
+
constructor(
|
|
15
|
+
@inject(SlotViewManager) slotViewManager: SlotViewManager,
|
|
16
|
+
@contrib(LibroExtensionSlotContribution)
|
|
17
|
+
libroExtraProvider: Contribution.Provider<LibroExtensionSlotContribution>,
|
|
18
|
+
) {
|
|
19
|
+
this.libroExtraProvider = libroExtraProvider;
|
|
20
|
+
this.slotViewManager = slotViewManager;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
getSlotName(libro: LibroView, slot: LibroSlot): string {
|
|
24
|
+
return `libro-slot-${slot}-${libro.id}`;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
setup(libro: LibroView) {
|
|
28
|
+
this.libroExtraProvider.getContributions().forEach(async (item) => {
|
|
29
|
+
const extra = await item.factory(libro);
|
|
30
|
+
this.slotViewManager.addView(
|
|
31
|
+
extra,
|
|
32
|
+
this.getSlotName(libro, item.slot),
|
|
33
|
+
item.viewOpenOption,
|
|
34
|
+
);
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { View } from '@difizen/mana-app';
|
|
2
|
+
import { Syringe } from '@difizen/mana-app';
|
|
3
|
+
|
|
4
|
+
import type { LibroView } from '../libro-view.js';
|
|
5
|
+
|
|
6
|
+
export type LibroExtensionSlotFactory = (view: LibroView) => Promise<View>;
|
|
7
|
+
|
|
8
|
+
export const LibroExtensionSlotContribution = Syringe.defineToken(
|
|
9
|
+
'LibroExtensionSlotContribution',
|
|
10
|
+
);
|
|
11
|
+
export interface LibroExtensionSlotContribution {
|
|
12
|
+
factory: LibroExtensionSlotFactory;
|
|
13
|
+
slot: LibroSlot;
|
|
14
|
+
viewOpenOption?: {
|
|
15
|
+
order?: string;
|
|
16
|
+
reveal?: boolean;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export type LibroSlot = 'content' | 'container' | 'list' | 'right' | 'containerLog';
|
|
21
|
+
|
|
22
|
+
export interface DisplayView {
|
|
23
|
+
isDisplay: boolean;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export function isDisplayView(object: any): object is DisplayView {
|
|
27
|
+
return 'isDisplay' in object;
|
|
28
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { DefaultSlotView, view, ViewRender, ViewInstance } from '@difizen/mana-app';
|
|
2
|
+
import { transient } from '@difizen/mana-app';
|
|
3
|
+
import { equals, prop, useInject } from '@difizen/mana-app';
|
|
4
|
+
import React, { forwardRef } from 'react';
|
|
5
|
+
|
|
6
|
+
import { isDisplayView } from './libro-slot-protocol.js';
|
|
7
|
+
|
|
8
|
+
export const LibroExtensionViewComponent = forwardRef(
|
|
9
|
+
function LibroExtensionViewComponent(
|
|
10
|
+
_props,
|
|
11
|
+
ref: React.ForwardedRef<HTMLDivElement>,
|
|
12
|
+
) {
|
|
13
|
+
const instance = useInject<LibroSlotView>(ViewInstance);
|
|
14
|
+
//过滤出实现了DisplayView接口的View,用于控制抢占逻辑
|
|
15
|
+
const filteredChildren = instance.children.filter((item) => {
|
|
16
|
+
return isDisplayView(item) && item.isDisplay;
|
|
17
|
+
});
|
|
18
|
+
if (filteredChildren.length < 1) {
|
|
19
|
+
return (
|
|
20
|
+
<div className={'libro-slot-container'} ref={ref}>
|
|
21
|
+
{instance.children.map(
|
|
22
|
+
(item) => !isDisplayView(item) && <ViewRender view={item} key={item.id} />,
|
|
23
|
+
)}
|
|
24
|
+
</div>
|
|
25
|
+
);
|
|
26
|
+
} else {
|
|
27
|
+
const activeView =
|
|
28
|
+
filteredChildren.find(
|
|
29
|
+
(item) => instance.active && equals(item, instance.active),
|
|
30
|
+
) || filteredChildren[filteredChildren.length - 1];
|
|
31
|
+
return (
|
|
32
|
+
<div className={'libro-slot-container'} ref={ref}>
|
|
33
|
+
<ViewRender view={activeView} />
|
|
34
|
+
{instance.children.map(
|
|
35
|
+
(item) => !isDisplayView(item) && <ViewRender view={item} key={item.id} />,
|
|
36
|
+
)}
|
|
37
|
+
</div>
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
);
|
|
42
|
+
|
|
43
|
+
@transient()
|
|
44
|
+
@view('libro-slot-view')
|
|
45
|
+
export class LibroSlotView extends DefaultSlotView {
|
|
46
|
+
override label: React.ReactNode = null;
|
|
47
|
+
override view = LibroExtensionViewComponent;
|
|
48
|
+
@prop()
|
|
49
|
+
override sort?: boolean = false;
|
|
50
|
+
// sort?: boolean = true;
|
|
51
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ManaModule } from '@difizen/mana-app';
|
|
2
|
+
|
|
3
|
+
import { LibroSlotManager } from './libro-slot-manager.js';
|
|
4
|
+
import { LibroExtensionSlotContribution } from './libro-slot-protocol.js';
|
|
5
|
+
import { LibroSlotView } from './libro-slot-view.js';
|
|
6
|
+
|
|
7
|
+
export const LibroSlotModule = ManaModule.create()
|
|
8
|
+
.contribution(LibroExtensionSlotContribution)
|
|
9
|
+
.register(LibroSlotManager, LibroSlotView);
|