@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,130 @@
|
|
|
1
|
+
import type { IOutput, ReadonlyPartialJSONObject, JSONObject } from '@difizen/libro-common';
|
|
2
|
+
import type { Event } from '@difizen/mana-app';
|
|
3
|
+
import type { View } from '@difizen/mana-app';
|
|
4
|
+
import { Syringe } from '@difizen/mana-app';
|
|
5
|
+
import type { CellView } from '../libro-protocol.js';
|
|
6
|
+
export declare const CellOption: unique symbol;
|
|
7
|
+
export interface IOutputAreaOption {
|
|
8
|
+
cellId: string;
|
|
9
|
+
outputAreaId?: string;
|
|
10
|
+
cell: CellView;
|
|
11
|
+
}
|
|
12
|
+
export interface BaseOutputArea extends View {
|
|
13
|
+
/**
|
|
14
|
+
* The length of the items in the model.
|
|
15
|
+
*/
|
|
16
|
+
readonly length: number;
|
|
17
|
+
/**
|
|
18
|
+
* Whether the output area is trusted.
|
|
19
|
+
*/
|
|
20
|
+
/**
|
|
21
|
+
* Get an item at the specified index.
|
|
22
|
+
*/
|
|
23
|
+
get: (index: number) => BaseOutputModel;
|
|
24
|
+
/**
|
|
25
|
+
* Add an output, which may be combined with previous output.
|
|
26
|
+
*
|
|
27
|
+
* @returns The total number of outputs.
|
|
28
|
+
*
|
|
29
|
+
* #### Notes
|
|
30
|
+
* The output bundle is copied.
|
|
31
|
+
* Contiguous stream outputs of the same `name` are combined.
|
|
32
|
+
*/
|
|
33
|
+
add: (output: IOutput) => Promise<number>;
|
|
34
|
+
/**
|
|
35
|
+
* Set the value at the specified index.
|
|
36
|
+
*/
|
|
37
|
+
set: (index: number, output: IOutput) => Promise<void>;
|
|
38
|
+
/**
|
|
39
|
+
* Clear all of the output.
|
|
40
|
+
*
|
|
41
|
+
* @param wait - Delay clearing the output until the next message is added.
|
|
42
|
+
*/
|
|
43
|
+
clear: (wait?: boolean) => void;
|
|
44
|
+
/**
|
|
45
|
+
* Deserialize the model from JSON.
|
|
46
|
+
*
|
|
47
|
+
* #### Notes
|
|
48
|
+
* This will clear any existing data.
|
|
49
|
+
*/
|
|
50
|
+
fromJSON: (values: IOutput[]) => Promise<void>;
|
|
51
|
+
/**
|
|
52
|
+
* Serialize the model to JSON.
|
|
53
|
+
*/
|
|
54
|
+
toJSON: () => IOutput[];
|
|
55
|
+
outputs: BaseOutputModel[];
|
|
56
|
+
cell: CellView;
|
|
57
|
+
setupCellView: (cell: CellView) => void;
|
|
58
|
+
get onUpdate(): Event<void>;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* The interface for an output model.
|
|
62
|
+
*/
|
|
63
|
+
export interface BaseOutputView extends View {
|
|
64
|
+
id: string;
|
|
65
|
+
raw: IOutput;
|
|
66
|
+
cell: CellView;
|
|
67
|
+
/**
|
|
68
|
+
* The output type.
|
|
69
|
+
*/
|
|
70
|
+
readonly type: string;
|
|
71
|
+
/**
|
|
72
|
+
* Whether the output is trusted.
|
|
73
|
+
*/
|
|
74
|
+
trusted: boolean;
|
|
75
|
+
/**
|
|
76
|
+
* The data associated with the model.
|
|
77
|
+
*/
|
|
78
|
+
readonly data: JSONObject;
|
|
79
|
+
/**
|
|
80
|
+
* The metadata associated with the model.
|
|
81
|
+
*
|
|
82
|
+
* Among others, it can include an attribute named `fragment`
|
|
83
|
+
* that stores a URI fragment identifier for the MIME resource.
|
|
84
|
+
*/
|
|
85
|
+
readonly metadata: ReadonlyPartialJSONObject;
|
|
86
|
+
/**
|
|
87
|
+
* Dispose of the resources used by the output model.
|
|
88
|
+
*/
|
|
89
|
+
dispose: () => void;
|
|
90
|
+
/**
|
|
91
|
+
* Serialize the model to JSON.
|
|
92
|
+
*/
|
|
93
|
+
toJSON: () => IOutput;
|
|
94
|
+
/**
|
|
95
|
+
* Set the data associated with the model.
|
|
96
|
+
*
|
|
97
|
+
* #### Notes
|
|
98
|
+
* Depending on the implementation of the mime model,
|
|
99
|
+
*/
|
|
100
|
+
setData(options: ISetDataOptions): void;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* @deprecated use BaseOutputView instead
|
|
104
|
+
*/
|
|
105
|
+
export type BaseOutputModel = BaseOutputView;
|
|
106
|
+
/**
|
|
107
|
+
* The options used to update a output model.
|
|
108
|
+
*/
|
|
109
|
+
export interface ISetDataOptions {
|
|
110
|
+
/**
|
|
111
|
+
* The new data object.
|
|
112
|
+
*/
|
|
113
|
+
data?: JSONObject;
|
|
114
|
+
/**
|
|
115
|
+
* The new metadata object.
|
|
116
|
+
*/
|
|
117
|
+
metadata?: JSONObject;
|
|
118
|
+
}
|
|
119
|
+
export interface IOutputOptions {
|
|
120
|
+
output: IOutput;
|
|
121
|
+
trusted: boolean;
|
|
122
|
+
cell: CellView;
|
|
123
|
+
}
|
|
124
|
+
export type OutputModelFactory = (options: IOutputOptions) => Promise<BaseOutputModel>;
|
|
125
|
+
export declare const OutputContribution: Syringe.DefinedToken;
|
|
126
|
+
export interface OutputContribution {
|
|
127
|
+
canHandle: (output: IOutput) => number;
|
|
128
|
+
factory: OutputModelFactory;
|
|
129
|
+
}
|
|
130
|
+
//# sourceMappingURL=output-protocol.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"output-protocol.d.ts","sourceRoot":"","sources":["../../src/output/output-protocol.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,OAAO,EACP,yBAAyB,EACzB,UAAU,EACX,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAE5C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAGrD,eAAO,MAAM,UAAU,eAAuB,CAAC;AAE/C,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,IAAI,EAAE,QAAQ,CAAC;CAChB;AAED,MAAM,WAAW,cAAe,SAAQ,IAAI;IAC1C;;OAEG;IACH,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAExB;;OAEG;IAGH;;OAEG;IACH,GAAG,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,eAAe,CAAC;IAExC;;;;;;;;OAQG;IACH,GAAG,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IAE1C;;OAEG;IACH,GAAG,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAEvD;;;;OAIG;IACH,KAAK,EAAE,CAAC,IAAI,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IAEhC;;;;;OAKG;IACH,QAAQ,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAE/C;;OAEG;IACH,MAAM,EAAE,MAAM,OAAO,EAAE,CAAC;IAExB,OAAO,EAAE,eAAe,EAAE,CAAC;IAE3B,IAAI,EAAE,QAAQ,CAAC;IAEf,aAAa,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,IAAI,CAAC;IAExC,IAAI,QAAQ,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC;CAC7B;AAED;;GAEG;AACH,MAAM,WAAW,cAAe,SAAQ,IAAI;IAC1C,EAAE,EAAE,MAAM,CAAC;IAEX,GAAG,EAAE,OAAO,CAAC;IAEb,IAAI,EAAE,QAAQ,CAAC;IAEf;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC;IACjB;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAE1B;;;;;OAKG;IACH,QAAQ,CAAC,QAAQ,EAAE,yBAAyB,CAAC;IAC7C;;OAEG;IACH,OAAO,EAAE,MAAM,IAAI,CAAC;IAEpB;;OAEG;IACH,MAAM,EAAE,MAAM,OAAO,CAAC;IAEtB;;;;;OAKG;IACH,OAAO,CAAC,OAAO,EAAE,eAAe,GAAG,IAAI,CAAC;CACzC;AAED;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,cAAc,CAAC;AAE7C;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,IAAI,CAAC,EAAE,UAAU,CAAC;IAElB;;OAEG;IACH,QAAQ,CAAC,EAAE,UAAU,CAAC;CACvB;AAED,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,QAAQ,CAAC;CAChB;AAED,MAAM,MAAM,kBAAkB,GAAG,CAAC,OAAO,EAAE,cAAc,KAAK,OAAO,CAAC,eAAe,CAAC,CAAC;AAEvF,eAAO,MAAM,kBAAkB,sBAA4C,CAAC;AAC5E,MAAM,WAAW,kBAAkB;IACjC,SAAS,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,MAAM,CAAC;IACvC,OAAO,EAAE,kBAAkB,CAAC;CAC7B"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Syringe } from '@difizen/mana-app';
|
|
2
|
+
// import type { CellModel } from '../libro-protocol';
|
|
3
|
+
|
|
4
|
+
export var CellOption = Symbol('CellOption');
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The interface for an output model.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* @deprecated use BaseOutputView instead
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* The options used to update a output model.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
export var OutputContribution = Syringe.defineToken('OutputContribution');
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/slot/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,aAAa,CAAC"}
|
package/es/slot/index.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Contribution } from '@difizen/mana-app';
|
|
2
|
+
import { SlotViewManager } from '@difizen/mana-app';
|
|
3
|
+
import type { LibroView } from '../libro-view.js';
|
|
4
|
+
import type { LibroSlot } from './libro-slot-protocol.js';
|
|
5
|
+
import { LibroExtensionSlotContribution } from './libro-slot-protocol.js';
|
|
6
|
+
export declare class LibroSlotManager {
|
|
7
|
+
protected slotViewManager: SlotViewManager;
|
|
8
|
+
protected readonly libroExtraProvider: Contribution.Provider<LibroExtensionSlotContribution>;
|
|
9
|
+
constructor(slotViewManager: SlotViewManager, libroExtraProvider: Contribution.Provider<LibroExtensionSlotContribution>);
|
|
10
|
+
getSlotName(libro: LibroView, slot: LibroSlot): string;
|
|
11
|
+
setup(libro: LibroView): void;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=libro-slot-manager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"libro-slot-manager.d.ts","sourceRoot":"","sources":["../../src/slot/libro-slot-manager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAGpD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAElD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,8BAA8B,EAAE,MAAM,0BAA0B,CAAC;AAE1E,qBACa,gBAAgB;IAC3B,SAAS,CAAC,eAAe,EAAE,eAAe,CAAC;IAC3C,SAAS,CAAC,QAAQ,CAAC,kBAAkB,EAAE,YAAY,CAAC,QAAQ,CAAC,8BAA8B,CAAC,CAAC;gBAElE,eAAe,EAAE,eAAe,EAEzD,kBAAkB,EAAE,YAAY,CAAC,QAAQ,CAAC,8BAA8B,CAAC;IAM3E,WAAW,CAAC,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,GAAG,MAAM;IAItD,KAAK,CAAC,KAAK,EAAE,SAAS;CAUvB"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
var _dec, _class;
|
|
3
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
4
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
5
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
6
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
7
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
8
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
9
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
10
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
11
|
+
import { SlotViewManager } from '@difizen/mana-app';
|
|
12
|
+
import { contrib, inject, singleton } from '@difizen/mana-app';
|
|
13
|
+
import { LibroExtensionSlotContribution } from "./libro-slot-protocol.js";
|
|
14
|
+
export var LibroSlotManager = (_dec = singleton(), _dec(_class = /*#__PURE__*/function () {
|
|
15
|
+
function LibroSlotManager(slotViewManager, libroExtraProvider) {
|
|
16
|
+
_classCallCheck(this, LibroSlotManager);
|
|
17
|
+
this.slotViewManager = void 0;
|
|
18
|
+
this.libroExtraProvider = void 0;
|
|
19
|
+
this.libroExtraProvider = libroExtraProvider;
|
|
20
|
+
this.slotViewManager = slotViewManager;
|
|
21
|
+
}
|
|
22
|
+
LibroSlotManager = contrib(LibroExtensionSlotContribution)(LibroSlotManager, undefined, 1) || LibroSlotManager;
|
|
23
|
+
LibroSlotManager = inject(SlotViewManager)(LibroSlotManager, undefined, 0) || LibroSlotManager;
|
|
24
|
+
_createClass(LibroSlotManager, [{
|
|
25
|
+
key: "getSlotName",
|
|
26
|
+
value: function getSlotName(libro, slot) {
|
|
27
|
+
return "libro-slot-".concat(slot, "-").concat(libro.id);
|
|
28
|
+
}
|
|
29
|
+
}, {
|
|
30
|
+
key: "setup",
|
|
31
|
+
value: function setup(libro) {
|
|
32
|
+
var _this = this;
|
|
33
|
+
this.libroExtraProvider.getContributions().forEach( /*#__PURE__*/function () {
|
|
34
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(item) {
|
|
35
|
+
var extra;
|
|
36
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
37
|
+
while (1) switch (_context.prev = _context.next) {
|
|
38
|
+
case 0:
|
|
39
|
+
_context.next = 2;
|
|
40
|
+
return item.factory(libro);
|
|
41
|
+
case 2:
|
|
42
|
+
extra = _context.sent;
|
|
43
|
+
_this.slotViewManager.addView(extra, _this.getSlotName(libro, item.slot), item.viewOpenOption);
|
|
44
|
+
case 4:
|
|
45
|
+
case "end":
|
|
46
|
+
return _context.stop();
|
|
47
|
+
}
|
|
48
|
+
}, _callee);
|
|
49
|
+
}));
|
|
50
|
+
return function (_x) {
|
|
51
|
+
return _ref.apply(this, arguments);
|
|
52
|
+
};
|
|
53
|
+
}());
|
|
54
|
+
}
|
|
55
|
+
}]);
|
|
56
|
+
return LibroSlotManager;
|
|
57
|
+
}()) || _class);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { View } from '@difizen/mana-app';
|
|
2
|
+
import { Syringe } from '@difizen/mana-app';
|
|
3
|
+
import type { LibroView } from '../libro-view.js';
|
|
4
|
+
export type LibroExtensionSlotFactory = (view: LibroView) => Promise<View>;
|
|
5
|
+
export declare const LibroExtensionSlotContribution: Syringe.DefinedToken;
|
|
6
|
+
export interface LibroExtensionSlotContribution {
|
|
7
|
+
factory: LibroExtensionSlotFactory;
|
|
8
|
+
slot: LibroSlot;
|
|
9
|
+
viewOpenOption?: {
|
|
10
|
+
order?: string;
|
|
11
|
+
reveal?: boolean;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
export type LibroSlot = 'content' | 'container' | 'list' | 'right' | 'containerLog';
|
|
15
|
+
export interface DisplayView {
|
|
16
|
+
isDisplay: boolean;
|
|
17
|
+
}
|
|
18
|
+
export declare function isDisplayView(object: any): object is DisplayView;
|
|
19
|
+
//# sourceMappingURL=libro-slot-protocol.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"libro-slot-protocol.d.ts","sourceRoot":"","sources":["../../src/slot/libro-slot-protocol.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAE5C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAElD,MAAM,MAAM,yBAAyB,GAAG,CAAC,IAAI,EAAE,SAAS,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;AAE3E,eAAO,MAAM,8BAA8B,sBAE1C,CAAC;AACF,MAAM,WAAW,8BAA8B;IAC7C,OAAO,EAAE,yBAAyB,CAAC;IACnC,IAAI,EAAE,SAAS,CAAC;IAChB,cAAc,CAAC,EAAE;QACf,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,MAAM,CAAC,EAAE,OAAO,CAAC;KAClB,CAAC;CACH;AAED,MAAM,MAAM,SAAS,GAAG,SAAS,GAAG,WAAW,GAAG,MAAM,GAAG,OAAO,GAAG,cAAc,CAAC;AAEpF,MAAM,WAAW,WAAW;IAC1B,SAAS,EAAE,OAAO,CAAC;CACpB;AAED,wBAAgB,aAAa,CAAC,MAAM,EAAE,GAAG,GAAG,MAAM,IAAI,WAAW,CAEhE"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { DefaultSlotView } from '@difizen/mana-app';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export declare const LibroExtensionViewComponent: React.ForwardRefExoticComponent<React.RefAttributes<HTMLDivElement>>;
|
|
4
|
+
export declare class LibroSlotView extends DefaultSlotView {
|
|
5
|
+
label: React.ReactNode;
|
|
6
|
+
view: React.ForwardRefExoticComponent<React.RefAttributes<HTMLDivElement>>;
|
|
7
|
+
sort?: boolean;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=libro-slot-view.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"libro-slot-view.d.ts","sourceRoot":"","sources":["../../src/slot/libro-slot-view.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAkC,MAAM,mBAAmB,CAAC;AAGpF,OAAO,KAAqB,MAAM,OAAO,CAAC;AAI1C,eAAO,MAAM,2BAA2B,sEAiCvC,CAAC;AAEF,qBAEa,aAAc,SAAQ,eAAe;IACvC,KAAK,EAAE,KAAK,CAAC,SAAS,CAAQ;IAC9B,IAAI,uEAA+B;IAEnC,IAAI,CAAC,EAAE,OAAO,CAAS;CAEjC"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
var _dec, _dec2, _dec3, _class, _class2, _descriptor;
|
|
3
|
+
function _initializerDefineProperty(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); }
|
|
4
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
5
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
6
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
7
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
8
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
9
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
10
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
11
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
12
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
13
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
14
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
15
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
16
|
+
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; }
|
|
17
|
+
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.'); }
|
|
18
|
+
import { DefaultSlotView, view, ViewRender, ViewInstance } from '@difizen/mana-app';
|
|
19
|
+
import { transient } from '@difizen/mana-app';
|
|
20
|
+
import { equals, prop, useInject } from '@difizen/mana-app';
|
|
21
|
+
import React, { forwardRef } from 'react';
|
|
22
|
+
import { isDisplayView } from "./libro-slot-protocol.js";
|
|
23
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
24
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
25
|
+
export var LibroExtensionViewComponent = /*#__PURE__*/forwardRef(function LibroExtensionViewComponent(_props, ref) {
|
|
26
|
+
var instance = useInject(ViewInstance);
|
|
27
|
+
//过滤出实现了DisplayView接口的View,用于控制抢占逻辑
|
|
28
|
+
var filteredChildren = instance.children.filter(function (item) {
|
|
29
|
+
return isDisplayView(item) && item.isDisplay;
|
|
30
|
+
});
|
|
31
|
+
if (filteredChildren.length < 1) {
|
|
32
|
+
return /*#__PURE__*/_jsx("div", {
|
|
33
|
+
className: 'libro-slot-container',
|
|
34
|
+
ref: ref,
|
|
35
|
+
children: instance.children.map(function (item) {
|
|
36
|
+
return !isDisplayView(item) && /*#__PURE__*/_jsx(ViewRender, {
|
|
37
|
+
view: item
|
|
38
|
+
}, item.id);
|
|
39
|
+
})
|
|
40
|
+
});
|
|
41
|
+
} else {
|
|
42
|
+
var activeView = filteredChildren.find(function (item) {
|
|
43
|
+
return instance.active && equals(item, instance.active);
|
|
44
|
+
}) || filteredChildren[filteredChildren.length - 1];
|
|
45
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
46
|
+
className: 'libro-slot-container',
|
|
47
|
+
ref: ref,
|
|
48
|
+
children: [/*#__PURE__*/_jsx(ViewRender, {
|
|
49
|
+
view: activeView
|
|
50
|
+
}), instance.children.map(function (item) {
|
|
51
|
+
return !isDisplayView(item) && /*#__PURE__*/_jsx(ViewRender, {
|
|
52
|
+
view: item
|
|
53
|
+
}, item.id);
|
|
54
|
+
})]
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
export var LibroSlotView = (_dec = transient(), _dec2 = view('libro-slot-view'), _dec3 = prop(), _dec(_class = _dec2(_class = (_class2 = /*#__PURE__*/function (_DefaultSlotView) {
|
|
59
|
+
_inherits(LibroSlotView, _DefaultSlotView);
|
|
60
|
+
var _super = _createSuper(LibroSlotView);
|
|
61
|
+
function LibroSlotView() {
|
|
62
|
+
var _this;
|
|
63
|
+
_classCallCheck(this, LibroSlotView);
|
|
64
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
65
|
+
args[_key] = arguments[_key];
|
|
66
|
+
}
|
|
67
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
68
|
+
_this.label = null;
|
|
69
|
+
_this.view = LibroExtensionViewComponent;
|
|
70
|
+
_initializerDefineProperty(_this, "sort", _descriptor, _assertThisInitialized(_this));
|
|
71
|
+
return _this;
|
|
72
|
+
} // sort?: boolean = true;
|
|
73
|
+
return _createClass(LibroSlotView);
|
|
74
|
+
}(DefaultSlotView), (_descriptor = _applyDecoratedDescriptor(_class2.prototype, "sort", [_dec3], {
|
|
75
|
+
configurable: true,
|
|
76
|
+
enumerable: true,
|
|
77
|
+
writable: true,
|
|
78
|
+
initializer: function initializer() {
|
|
79
|
+
return false;
|
|
80
|
+
}
|
|
81
|
+
})), _class2)) || _class) || _class);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../src/slot/module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAM/C,eAAO,MAAM,eAAe,YAEgB,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ManaModule } from '@difizen/mana-app';
|
|
2
|
+
import { LibroSlotManager } from "./libro-slot-manager.js";
|
|
3
|
+
import { LibroExtensionSlotContribution } from "./libro-slot-protocol.js";
|
|
4
|
+
import { LibroSlotView } from "./libro-slot-view.js";
|
|
5
|
+
export var LibroSlotModule = ManaModule.create().contribution(LibroExtensionSlotContribution).register(LibroSlotManager, LibroSlotView);
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ColorRegistry } from '@difizen/mana-app';
|
|
2
|
+
import { ColorContribution } from '@difizen/mana-app';
|
|
3
|
+
export declare class LibroColorRegistry implements ColorContribution {
|
|
4
|
+
registerColors(colors: ColorRegistry): void;
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=libro-color-registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"libro-color-registry.d.ts","sourceRoot":"","sources":["../../src/theme/libro-color-registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAS,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAG7D,qBACa,kBAAmB,YAAW,iBAAiB;IAC1D,cAAc,CAAC,MAAM,EAAE,aAAa,GAAG,IAAI;CA4W5C"}
|