@difizen/libro-core 0.0.0-snapshot-20241017072317
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 +280 -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 +11 -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 +59 -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 +121 -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 +12 -0
- package/es/cell/libro-cell-contribution.d.ts.map +1 -0
- package/es/cell/libro-cell-contribution.js +47 -0
- package/es/cell/libro-cell-model.d.ts +29 -0
- package/es/cell/libro-cell-model.d.ts.map +1 -0
- package/es/cell/libro-cell-model.js +130 -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 +44 -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 +245 -0
- package/es/cell/libro-cell-view.d.ts +74 -0
- package/es/cell/libro-cell-view.d.ts.map +1 -0
- package/es/cell/libro-cell-view.js +239 -0
- package/es/cell/libro-edit-cell-view.d.ts +44 -0
- package/es/cell/libro-edit-cell-view.d.ts.map +1 -0
- package/es/cell/libro-edit-cell-view.js +256 -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 +34 -0
- package/es/cell/libro-executable-cell-view.d.ts.map +1 -0
- package/es/cell/libro-executable-cell-view.js +74 -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 +5 -0
- package/es/command/document-commands.d.ts.map +1 -0
- package/es/command/document-commands.js +21 -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 +40 -0
- package/es/command/libro-command-contribution.d.ts +13 -0
- package/es/command/libro-command-contribution.d.ts.map +1 -0
- package/es/command/libro-command-contribution.js +1842 -0
- package/es/command/libro-command-register.d.ts +21 -0
- package/es/command/libro-command-register.d.ts.map +1 -0
- package/es/command/libro-command-register.js +111 -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 +472 -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 +16 -0
- package/es/components/dnd-cell-item-render.d.ts.map +1 -0
- package/es/components/dnd-cell-item-render.js +364 -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 +140 -0
- package/es/components/dnd-component/default-dnd-content.d.ts +11 -0
- package/es/components/dnd-component/default-dnd-content.d.ts.map +1 -0
- package/es/components/dnd-component/default-dnd-content.js +292 -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 +14 -0
- package/es/components/dnd-component/dnd-list.d.ts.map +1 -0
- package/es/components/dnd-component/dnd-list.js +182 -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/dnd-component/index.less +8 -0
- package/es/components/dnd-component/overscanIndices-getter.d.ts +22 -0
- package/es/components/dnd-component/overscanIndices-getter.d.ts.map +1 -0
- package/es/components/dnd-component/overscanIndices-getter.js +58 -0
- package/es/components/dnd-component/virtualized-manager.d.ts +19 -0
- package/es/components/dnd-component/virtualized-manager.d.ts.map +1 -0
- package/es/components/dnd-component/virtualized-manager.js +60 -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/components/libro-virtualized-render.d.ts +15 -0
- package/es/components/libro-virtualized-render.d.ts.map +1 -0
- package/es/components/libro-virtualized-render.js +174 -0
- package/es/content/index.d.ts +6 -0
- package/es/content/index.d.ts.map +1 -0
- package/es/content/index.js +5 -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 +31 -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 +6 -0
- package/es/content/libro-content-protocol.d.ts +13 -0
- package/es/content/libro-content-protocol.d.ts.map +1 -0
- package/es/content/libro-content-protocol.js +3 -0
- package/es/content/libro-content-service.d.ts +11 -0
- package/es/content/libro-content-service.d.ts.map +1 -0
- package/es/content/libro-content-service.js +63 -0
- package/es/content/libro-save-content-contribution.d.ts +6 -0
- package/es/content/libro-save-content-contribution.d.ts.map +1 -0
- package/es/content/libro-save-content-contribution.js +27 -0
- package/es/formatter/index.d.ts +6 -0
- package/es/formatter/index.d.ts.map +1 -0
- package/es/formatter/index.js +5 -0
- package/es/formatter/libro-formatter-json-contribution.d.ts +18 -0
- package/es/formatter/libro-formatter-json-contribution.d.ts.map +1 -0
- package/es/formatter/libro-formatter-json-contribution.js +41 -0
- package/es/formatter/libro-formatter-manager.d.ts +16 -0
- package/es/formatter/libro-formatter-manager.d.ts.map +1 -0
- package/es/formatter/libro-formatter-manager.js +86 -0
- package/es/formatter/libro-formatter-module.d.ts +3 -0
- package/es/formatter/libro-formatter-module.d.ts.map +1 -0
- package/es/formatter/libro-formatter-module.js +7 -0
- package/es/formatter/libro-formatter-protocol.d.ts +37 -0
- package/es/formatter/libro-formatter-protocol.d.ts.map +1 -0
- package/es/formatter/libro-formatter-protocol.js +18 -0
- package/es/formatter/libro-formatter-string-contribution.d.ts +18 -0
- package/es/formatter/libro-formatter-string-contribution.d.ts.map +1 -0
- package/es/formatter/libro-formatter-string-contribution.js +41 -0
- package/es/formatter/libro-formatter-trans-default-contribution.d.ts +7 -0
- package/es/formatter/libro-formatter-trans-default-contribution.d.ts.map +1 -0
- package/es/formatter/libro-formatter-trans-default-contribution.js +19 -0
- package/es/index.d.ts +26 -0
- package/es/index.d.ts.map +1 -0
- package/es/index.js +25 -0
- package/es/index.less +781 -0
- package/es/libro-context-key.d.ts +26 -0
- package/es/libro-context-key.d.ts.map +1 -0
- package/es/libro-context-key.js +84 -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 +145 -0
- package/es/libro-model.d.ts.map +1 -0
- package/es/libro-model.js +921 -0
- package/es/libro-protocol.d.ts +315 -0
- package/es/libro-protocol.d.ts.map +1 -0
- package/es/libro-protocol.js +47 -0
- package/es/libro-service.d.ts +69 -0
- package/es/libro-service.d.ts.map +1 -0
- package/es/libro-service.js +303 -0
- package/es/libro-setting-contribution.d.ts +5 -0
- package/es/libro-setting-contribution.d.ts.map +1 -0
- package/es/libro-setting-contribution.js +23 -0
- package/es/libro-setting.d.ts +12 -0
- package/es/libro-setting.d.ts.map +1 -0
- package/es/libro-setting.js +101 -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 +170 -0
- package/es/libro-view.d.ts.map +1 -0
- package/es/libro-view.js +2077 -0
- package/es/libro-workspace-service.d.ts +17 -0
- package/es/libro-workspace-service.d.ts.map +1 -0
- package/es/libro-workspace-service.js +36 -0
- package/es/material-from-designer.d.ts +31 -0
- package/es/material-from-designer.d.ts.map +1 -0
- package/es/material-from-designer.js +697 -0
- package/es/module.d.ts +3 -0
- package/es/module.d.ts.map +1 -0
- package/es/module.js +71 -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 +399 -0
- package/es/output/output-contribution.d.ts +10 -0
- package/es/output/output-contribution.d.ts.map +1 -0
- package/es/output/output-contribution.js +36 -0
- package/es/output/output-model.d.ts +28 -0
- package/es/output/output-model.d.ts.map +1 -0
- package/es/output/output-model.js +105 -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 +134 -0
- package/es/output/output-protocol.d.ts.map +1 -0
- package/es/output/output-protocol.js +16 -0
- package/es/settings/index.d.ts +5 -0
- package/es/settings/index.d.ts.map +1 -0
- package/es/settings/index.js +4 -0
- package/es/settings/index.less +3 -0
- package/es/settings/module.d.ts +3 -0
- package/es/settings/module.d.ts.map +1 -0
- package/es/settings/module.js +4 -0
- package/es/settings/setting-editor/configuration-panel-view.d.ts +13 -0
- package/es/settings/setting-editor/configuration-panel-view.d.ts.map +1 -0
- package/es/settings/setting-editor/configuration-panel-view.js +115 -0
- package/es/settings/setting-editor/configuration-render-contribution.d.ts +6 -0
- package/es/settings/setting-editor/configuration-render-contribution.d.ts.map +1 -0
- package/es/settings/setting-editor/configuration-render-contribution.js +77 -0
- package/es/settings/setting-editor/default-node-render.d.ts +9 -0
- package/es/settings/setting-editor/default-node-render.d.ts.map +1 -0
- package/es/settings/setting-editor/default-node-render.js +79 -0
- package/es/settings/setting-editor/index.d.ts +7 -0
- package/es/settings/setting-editor/index.d.ts.map +1 -0
- package/es/settings/setting-editor/index.js +6 -0
- package/es/settings/setting-editor/index.less +12 -0
- package/es/settings/setting-editor/module.d.ts +3 -0
- package/es/settings/setting-editor/module.d.ts.map +1 -0
- package/es/settings/setting-editor/module.js +11 -0
- package/es/settings/setting-editor/setting-editor-view.d.ts +15 -0
- package/es/settings/setting-editor/setting-editor-view.d.ts.map +1 -0
- package/es/settings/setting-editor/setting-editor-view.js +169 -0
- package/es/settings/setting-editor/setting-tree-service.d.ts +9 -0
- package/es/settings/setting-editor/setting-tree-service.d.ts.map +1 -0
- package/es/settings/setting-editor/setting-tree-service.js +118 -0
- package/es/settings/setting-editor/setting-tree-view.d.ts +19 -0
- package/es/settings/setting-editor/setting-tree-view.d.ts.map +1 -0
- package/es/settings/setting-editor/setting-tree-view.js +87 -0
- package/es/settings/settings-contribution.d.ts +7 -0
- package/es/settings/settings-contribution.d.ts.map +1 -0
- package/es/settings/settings-contribution.js +36 -0
- package/es/settings/settings-modal.d.ts +5 -0
- package/es/settings/settings-modal.d.ts.map +1 -0
- package/es/settings/settings-modal.js +53 -0
- package/es/settings/settings-modal.less +3 -0
- package/es/settings/settings-protocol.d.ts +4 -0
- package/es/settings/settings-protocol.d.ts.map +1 -0
- package/es/settings/settings-protocol.js +5 -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 +66 -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 +515 -0
- package/es/toolbar/all-outputs-scroll-icon.d.ts +3 -0
- package/es/toolbar/all-outputs-scroll-icon.d.ts.map +1 -0
- package/es/toolbar/all-outputs-scroll-icon.js +10 -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 +51 -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 +9 -0
- package/es/toolbar/libro-toolbar.d.ts.map +1 -0
- package/es/toolbar/libro-toolbar.js +275 -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 +5 -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 +5 -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/es/virtualized-manager-helper.d.ts +11 -0
- package/es/virtualized-manager-helper.d.ts.map +1 -0
- package/es/virtualized-manager-helper.js +51 -0
- package/es/virtualized-manager.d.ts +23 -0
- package/es/virtualized-manager.d.ts.map +1 -0
- package/es/virtualized-manager.js +65 -0
- package/package.json +73 -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 +28 -0
- package/src/add-cell/libro-add-cell-view.tsx +99 -0
- package/src/cell/README.md +14 -0
- package/src/cell/index.ts +9 -0
- package/src/cell/libro-cell-contribution.ts +34 -0
- package/src/cell/libro-cell-model.ts +119 -0
- package/src/cell/libro-cell-module.ts +40 -0
- package/src/cell/libro-cell-protocol.ts +55 -0
- package/src/cell/libro-cell-service.ts +158 -0
- package/src/cell/libro-cell-view.tsx +156 -0
- package/src/cell/libro-edit-cell-view.tsx +205 -0
- package/src/cell/libro-executable-cell-model.ts +32 -0
- package/src/cell/libro-executable-cell-view.ts +86 -0
- package/src/cell/libro-markdown-cell-model.ts +20 -0
- package/src/collapse-service.ts +69 -0
- package/src/command/document-commands.ts +24 -0
- package/src/command/index.ts +6 -0
- package/src/command/kernel-command.ts +42 -0
- package/src/command/libro-command-contribution.ts +1346 -0
- package/src/command/libro-command-register.ts +168 -0
- package/src/command/module.ts +9 -0
- package/src/command/notebook-commands.ts +502 -0
- package/src/components/cell-protocol.ts +26 -0
- package/src/components/dnd-cell-item-render.tsx +465 -0
- package/src/components/dnd-component/custom-drag-layer.tsx +144 -0
- package/src/components/dnd-component/default-dnd-content.tsx +330 -0
- package/src/components/dnd-component/dnd-context.tsx +28 -0
- package/src/components/dnd-component/dnd-list.tsx +211 -0
- package/src/components/dnd-component/index.less +12 -0
- package/src/components/dnd-component/index.tsx +4 -0
- package/src/components/dnd-component/overscanIndices-getter.ts +92 -0
- package/src/components/dnd-component/virtualized-manager.ts +34 -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/components/libro-virtualized-render.tsx +178 -0
- package/src/content/index.ts +5 -0
- package/src/content/libro-content-contribution.ts +16 -0
- package/src/content/libro-content-module.ts +17 -0
- package/src/content/libro-content-protocol.ts +14 -0
- package/src/content/libro-content-service.ts +48 -0
- package/src/content/libro-save-content-contribution.ts +12 -0
- package/src/formatter/index.ts +5 -0
- package/src/formatter/libro-formatter-json-contribution.ts +42 -0
- package/src/formatter/libro-formatter-manager.ts +85 -0
- package/src/formatter/libro-formatter-module.ts +19 -0
- package/src/formatter/libro-formatter-protocol.ts +63 -0
- package/src/formatter/libro-formatter-string-contribution.ts +41 -0
- package/src/formatter/libro-formatter-trans-default-contribution.ts +15 -0
- package/src/index.less +789 -0
- package/src/index.spec.ts +12 -0
- package/src/index.tsx +25 -0
- package/src/libro-context-key.ts +84 -0
- package/src/libro-keybind-registry.ts +43 -0
- package/src/libro-model.ts +710 -0
- package/src/libro-protocol.ts +435 -0
- package/src/libro-service.ts +234 -0
- package/src/libro-setting-contribution.ts +28 -0
- package/src/libro-setting.ts +110 -0
- package/src/libro-view-tracker.ts +9 -0
- package/src/libro-view.tsx +1532 -0
- package/src/libro-workspace-service.ts +28 -0
- package/src/material-from-designer.tsx +579 -0
- package/src/module.ts +121 -0
- package/src/output/index.ts +5 -0
- package/src/output/output-area.tsx +286 -0
- package/src/output/output-contribution.ts +14 -0
- package/src/output/output-model.tsx +70 -0
- package/src/output/output-module.ts +10 -0
- package/src/output/output-protocol.ts +168 -0
- package/src/settings/index.less +3 -0
- package/src/settings/index.ts +4 -0
- package/src/settings/module.ts +8 -0
- package/src/settings/setting-editor/configuration-panel-view.tsx +89 -0
- package/src/settings/setting-editor/configuration-render-contribution.ts +81 -0
- package/src/settings/setting-editor/default-node-render.tsx +65 -0
- package/src/settings/setting-editor/index.less +12 -0
- package/src/settings/setting-editor/index.ts +6 -0
- package/src/settings/setting-editor/module.ts +17 -0
- package/src/settings/setting-editor/setting-editor-view.tsx +93 -0
- package/src/settings/setting-editor/setting-tree-service.ts +82 -0
- package/src/settings/setting-editor/setting-tree-view.tsx +95 -0
- package/src/settings/settings-contribution.tsx +24 -0
- package/src/settings/settings-modal.less +3 -0
- package/src/settings/settings-modal.tsx +51 -0
- package/src/settings/settings-protocol.ts +7 -0
- package/src/slot/index.ts +4 -0
- package/src/slot/libro-slot-manager.ts +38 -0
- package/src/slot/libro-slot-protocol.ts +28 -0
- package/src/slot/libro-slot-view.tsx +48 -0
- package/src/slot/module.ts +9 -0
- package/src/theme/libro-color-registry.ts +386 -0
- package/src/toolbar/all-outputs-scroll-icon.tsx +19 -0
- package/src/toolbar/change-cell-to-selector.tsx +67 -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 +231 -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 +177 -0
- package/src/typings/index.d.ts +1 -0
- package/src/virtualized-manager-helper.ts +29 -0
- package/src/virtualized-manager.ts +47 -0
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
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 _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
5
|
+
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); } }
|
|
6
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
7
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
8
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
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
|
+
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 e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
19
|
+
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); } }
|
|
20
|
+
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); }); }; }
|
|
21
|
+
import { DisplayWrapComponent } from '@difizen/libro-common';
|
|
22
|
+
import { inject, transient, prop, useInject, BaseView, CommandRegistry, view, ViewInstance } from '@difizen/mana-app';
|
|
23
|
+
import { Button } from 'antd';
|
|
24
|
+
import { forwardRef } from 'react';
|
|
25
|
+
import { CellService } from "../cell/index.js";
|
|
26
|
+
import { NotebookCommands } from "../command/index.js";
|
|
27
|
+
import { PlusOutlined } from "../material-from-designer.js";
|
|
28
|
+
import "./index.less";
|
|
29
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
30
|
+
export var LibroAddCell = function LibroAddCell() {
|
|
31
|
+
var instance = useInject(ViewInstance);
|
|
32
|
+
var command = useInject(CommandRegistry);
|
|
33
|
+
var addCell = /*#__PURE__*/function () {
|
|
34
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(type) {
|
|
35
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
36
|
+
while (1) switch (_context.prev = _context.next) {
|
|
37
|
+
case 0:
|
|
38
|
+
command.executeCommand(NotebookCommands['InsertCellBottom'].id, instance.parent, type);
|
|
39
|
+
case 1:
|
|
40
|
+
case "end":
|
|
41
|
+
return _context.stop();
|
|
42
|
+
}
|
|
43
|
+
}, _callee);
|
|
44
|
+
}));
|
|
45
|
+
return function addCell(_x) {
|
|
46
|
+
return _ref.apply(this, arguments);
|
|
47
|
+
};
|
|
48
|
+
}();
|
|
49
|
+
return /*#__PURE__*/_jsx("div", {
|
|
50
|
+
className: "libro-add-cell-container default-add-cell-container",
|
|
51
|
+
children: instance.getCellList().map(function (item) {
|
|
52
|
+
return /*#__PURE__*/_jsx(Button, {
|
|
53
|
+
className: "libro-add-cell-container-item ",
|
|
54
|
+
onClick: function onClick() {
|
|
55
|
+
addCell(item.type);
|
|
56
|
+
},
|
|
57
|
+
icon: /*#__PURE__*/_jsx(PlusOutlined, {
|
|
58
|
+
className: "libro-add-cell-icon"
|
|
59
|
+
}),
|
|
60
|
+
children: item.name
|
|
61
|
+
}, item.name);
|
|
62
|
+
})
|
|
63
|
+
});
|
|
64
|
+
};
|
|
65
|
+
export var LibroWrappedAddCell = /*#__PURE__*/forwardRef(function LibroWrappedAddCell() {
|
|
66
|
+
var _instance$parent;
|
|
67
|
+
var instance = useInject(ViewInstance);
|
|
68
|
+
return /*#__PURE__*/_jsx(DisplayWrapComponent, {
|
|
69
|
+
mode: !((_instance$parent = instance.parent) !== null && _instance$parent !== void 0 && _instance$parent.model.cellsEditable),
|
|
70
|
+
children: /*#__PURE__*/_jsx(LibroAddCell, {})
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
export var LibroAddCellView = (_dec = transient(), _dec2 = view('libro-add-cell-view'), _dec3 = prop(), _dec(_class = _dec2(_class = (_class2 = /*#__PURE__*/function (_BaseView) {
|
|
74
|
+
_inherits(LibroAddCellView, _BaseView);
|
|
75
|
+
var _super = _createSuper(LibroAddCellView);
|
|
76
|
+
function LibroAddCellView(cellService) {
|
|
77
|
+
var _this;
|
|
78
|
+
_classCallCheck(this, LibroAddCellView);
|
|
79
|
+
_this = _super.call(this);
|
|
80
|
+
_this.parent = undefined;
|
|
81
|
+
_this.view = LibroWrappedAddCell;
|
|
82
|
+
_initializerDefineProperty(_this, "addList", _descriptor, _assertThisInitialized(_this));
|
|
83
|
+
_this.cellService = void 0;
|
|
84
|
+
_this.defaultFilter = function (cellmeta) {
|
|
85
|
+
return cellmeta.type !== 'raw';
|
|
86
|
+
};
|
|
87
|
+
_this.cellService = cellService;
|
|
88
|
+
return _this;
|
|
89
|
+
}
|
|
90
|
+
LibroAddCellView = inject(CellService)(LibroAddCellView, undefined, 0) || LibroAddCellView;
|
|
91
|
+
_createClass(LibroAddCellView, [{
|
|
92
|
+
key: "onViewMount",
|
|
93
|
+
value: function onViewMount() {
|
|
94
|
+
this.addList = this.cellService.cellsMeta;
|
|
95
|
+
}
|
|
96
|
+
}, {
|
|
97
|
+
key: "onViewUnmount",
|
|
98
|
+
value: function onViewUnmount() {
|
|
99
|
+
//
|
|
100
|
+
}
|
|
101
|
+
}, {
|
|
102
|
+
key: "onViewResize",
|
|
103
|
+
value: function onViewResize() {
|
|
104
|
+
//
|
|
105
|
+
}
|
|
106
|
+
}, {
|
|
107
|
+
key: "getCellList",
|
|
108
|
+
value: function getCellList() {
|
|
109
|
+
var filter = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.defaultFilter;
|
|
110
|
+
return this.addList.filter(filter);
|
|
111
|
+
}
|
|
112
|
+
}]);
|
|
113
|
+
return LibroAddCellView;
|
|
114
|
+
}(BaseView), (_descriptor = _applyDecoratedDescriptor(_class2.prototype, "addList", [_dec3], {
|
|
115
|
+
configurable: true,
|
|
116
|
+
enumerable: true,
|
|
117
|
+
writable: true,
|
|
118
|
+
initializer: function initializer() {
|
|
119
|
+
return [];
|
|
120
|
+
}
|
|
121
|
+
})), _class2)) || _class) || _class);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * from './libro-cell-protocol.js';
|
|
2
|
+
export * from './libro-cell-service.js';
|
|
3
|
+
export * from './libro-cell-view.js';
|
|
4
|
+
export * from './libro-cell-contribution.js';
|
|
5
|
+
export * from './libro-cell-model.js';
|
|
6
|
+
export * from './libro-edit-cell-view.js';
|
|
7
|
+
export * from './libro-executable-cell-model.js';
|
|
8
|
+
export * from './libro-markdown-cell-model.js';
|
|
9
|
+
export * from './libro-executable-cell-view.js';
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cell/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,kCAAkC,CAAC;AACjD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,iCAAiC,CAAC"}
|
package/es/cell/index.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from "./libro-cell-protocol.js";
|
|
2
|
+
export * from "./libro-cell-service.js";
|
|
3
|
+
export * from "./libro-cell-view.js";
|
|
4
|
+
export * from "./libro-cell-contribution.js";
|
|
5
|
+
export * from "./libro-cell-model.js";
|
|
6
|
+
export * from "./libro-edit-cell-view.js";
|
|
7
|
+
export * from "./libro-executable-cell-model.js";
|
|
8
|
+
export * from "./libro-markdown-cell-model.js";
|
|
9
|
+
export * from "./libro-executable-cell-view.js";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { CellModel, CellOptions } from '../libro-protocol.js';
|
|
2
|
+
import type { CellMeta } from './libro-cell-protocol.js';
|
|
3
|
+
import { CellModelContribution, CellModelFactory, CellViewContribution } from './libro-cell-protocol.js';
|
|
4
|
+
import { LibroCellView } from './libro-cell-view.js';
|
|
5
|
+
export declare class LibroCellContribution implements CellModelContribution, CellViewContribution {
|
|
6
|
+
libroCellModelFactory: CellModelFactory;
|
|
7
|
+
cellMeta: CellMeta;
|
|
8
|
+
canHandle(options: CellOptions): number;
|
|
9
|
+
createModel(options: CellOptions): CellModel;
|
|
10
|
+
view: typeof LibroCellView;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=libro-cell-contribution.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"libro-cell-contribution.d.ts","sourceRoot":"","sources":["../../src/cell/libro-cell-contribution.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAEnE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EACL,qBAAqB,EACrB,gBAAgB,EAChB,oBAAoB,EACrB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAErD,qBACa,qBACX,YAAW,qBAAqB,EAAE,oBAAoB;IAE5B,qBAAqB,EAAE,gBAAgB,CAAC;IAElE,QAAQ,EAAE,QAAQ,CAIhB;IAGF,SAAS,CAAC,OAAO,EAAE,WAAW,GAAG,MAAM;IAGvC,WAAW,CAAC,OAAO,EAAE,WAAW,GAAG,SAAS;IAI5C,IAAI,uBAAiB;CACtB"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
var _dec, _dec2, _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 _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
5
|
+
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); } }
|
|
6
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
7
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
8
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
9
|
+
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; }
|
|
10
|
+
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.'); }
|
|
11
|
+
import { inject, singleton } from '@difizen/mana-app';
|
|
12
|
+
import { CellModelContribution, CellModelFactory, CellViewContribution } from "./libro-cell-protocol.js";
|
|
13
|
+
import { LibroCellView } from "./libro-cell-view.js";
|
|
14
|
+
export var LibroCellContribution = (_dec = singleton({
|
|
15
|
+
contrib: [CellModelContribution, CellViewContribution]
|
|
16
|
+
}), _dec2 = inject(CellModelFactory), _dec(_class = (_class2 = /*#__PURE__*/function () {
|
|
17
|
+
function LibroCellContribution() {
|
|
18
|
+
_classCallCheck(this, LibroCellContribution);
|
|
19
|
+
_initializerDefineProperty(this, "libroCellModelFactory", _descriptor, this);
|
|
20
|
+
this.cellMeta = {
|
|
21
|
+
type: 'raw',
|
|
22
|
+
name: 'Raw',
|
|
23
|
+
order: 'a'
|
|
24
|
+
};
|
|
25
|
+
this.view = LibroCellView;
|
|
26
|
+
}
|
|
27
|
+
_createClass(LibroCellContribution, [{
|
|
28
|
+
key: "canHandle",
|
|
29
|
+
value:
|
|
30
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
31
|
+
function canHandle(options) {
|
|
32
|
+
return 1;
|
|
33
|
+
}
|
|
34
|
+
}, {
|
|
35
|
+
key: "createModel",
|
|
36
|
+
value: function createModel(options) {
|
|
37
|
+
var model = this.libroCellModelFactory(options);
|
|
38
|
+
return model;
|
|
39
|
+
}
|
|
40
|
+
}]);
|
|
41
|
+
return LibroCellContribution;
|
|
42
|
+
}(), (_descriptor = _applyDecoratedDescriptor(_class2.prototype, "libroCellModelFactory", [_dec2], {
|
|
43
|
+
configurable: true,
|
|
44
|
+
enumerable: true,
|
|
45
|
+
writable: true,
|
|
46
|
+
initializer: null
|
|
47
|
+
})), _class2)) || _class);
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Model } from '@difizen/libro-code-editor';
|
|
2
|
+
import type { ICell } from '@difizen/libro-common';
|
|
3
|
+
import { DisposableCollection } from '@difizen/mana-app';
|
|
4
|
+
import type { DefaultDecodedFormatter } from '../formatter/index.js';
|
|
5
|
+
import { LibroFormatterManager } from '../formatter/index.js';
|
|
6
|
+
import { CellOptions } from '../libro-protocol.js';
|
|
7
|
+
import type { CellModel } from '../libro-protocol.js';
|
|
8
|
+
import type { LibroCellMetadata } from './libro-cell-protocol.js';
|
|
9
|
+
export declare class LibroCellModel extends Model implements CellModel {
|
|
10
|
+
toDispose: DisposableCollection;
|
|
11
|
+
options: CellOptions;
|
|
12
|
+
libroFormatType: string;
|
|
13
|
+
_decodeObject: DefaultDecodedFormatter;
|
|
14
|
+
libroFormatterManager: LibroFormatterManager<DefaultDecodedFormatter, DefaultDecodedFormatter>;
|
|
15
|
+
metadata: Partial<LibroCellMetadata>;
|
|
16
|
+
trusted: boolean;
|
|
17
|
+
version: number;
|
|
18
|
+
constructor(options: CellOptions);
|
|
19
|
+
init(): void;
|
|
20
|
+
updateVersion: () => void;
|
|
21
|
+
get source(): string;
|
|
22
|
+
set decodeObject(data: DefaultDecodedFormatter);
|
|
23
|
+
get decodeObject(): DefaultDecodedFormatter;
|
|
24
|
+
toJSON(): Omit<ICell, 'outputs'>;
|
|
25
|
+
disposed: boolean;
|
|
26
|
+
dispose(): void;
|
|
27
|
+
}
|
|
28
|
+
export declare function isLibroCellModel(model: CellModel): model is LibroCellModel;
|
|
29
|
+
//# sourceMappingURL=libro-cell-model.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"libro-cell-model.d.ts","sourceRoot":"","sources":["../../src/cell/libro-cell-model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AACnD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAEnD,OAAO,EAAE,oBAAoB,EAAS,MAAM,mBAAmB,CAAC;AAGhE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AACrE,OAAO,EAA2B,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AACvF,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEtD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAGlE,qBACa,cAAe,SAAQ,KAAM,YAAW,SAAS;IAC5D,SAAS,uBAA8B;IAEvC,OAAO,EAAE,WAAW,CAAC;IAErB,eAAe,EAAE,MAAM,CAAC;IAExB,aAAa,EAAE,uBAAuB,CAAC;IAGvC,qBAAqB,EAAE,qBAAqB,CAC1C,uBAAuB,EACvB,uBAAuB,CACxB,CAAC;IAGF,QAAQ,EAAE,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAGrC,OAAO,EAAE,OAAO,CAAC;IAEjB,OAAO,SAAK;gBAEqB,OAAO,EAAE,WAAW;IAiBrD,IAAI;IAoBJ,aAAa,aAIX;IAEF,IAAI,MAAM,IAAI,MAAM,CAMnB;IAED,IAAI,YAAY,CAAC,IAAI,EAAE,uBAAuB,EAG7C;IAED,IAAI,YAAY,IALO,uBAAuB,CAO7C;IAED,MAAM,IAAI,IAAI,CAAC,KAAK,EAAE,SAAS,CAAC;IAShC,QAAQ,UAAS;IACR,OAAO;CAMjB;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,SAAS,GAAG,KAAK,IAAI,cAAc,CAE1E"}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
var _dec, _dec2, _dec3, _dec4, _dec5, _class, _class2, _descriptor, _descriptor2, _descriptor3;
|
|
3
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
|
+
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 }); }
|
|
7
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
8
|
+
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); } }
|
|
9
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
10
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
11
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
12
|
+
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); }
|
|
13
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
14
|
+
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); }; }
|
|
15
|
+
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); }
|
|
16
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
17
|
+
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; } }
|
|
18
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
19
|
+
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; }
|
|
20
|
+
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.'); }
|
|
21
|
+
import { Model } from '@difizen/libro-code-editor';
|
|
22
|
+
import { concatMultilineString } from '@difizen/libro-common';
|
|
23
|
+
import { DisposableCollection, watch } from '@difizen/mana-app';
|
|
24
|
+
import { prop, inject, postConstruct, transient } from '@difizen/mana-app';
|
|
25
|
+
import { DefaultEncodedFormatter, LibroFormatterManager } from "../formatter/index.js";
|
|
26
|
+
import { CellOptions } from "../libro-protocol.js";
|
|
27
|
+
import { getLibroCellType } from "./libro-cell-protocol.js";
|
|
28
|
+
export var LibroCellModel = (_dec = transient(), _dec2 = inject(LibroFormatterManager), _dec3 = prop(), _dec4 = prop(), _dec5 = postConstruct(), _dec(_class = (_class2 = /*#__PURE__*/function (_Model) {
|
|
29
|
+
_inherits(LibroCellModel, _Model);
|
|
30
|
+
var _super = _createSuper(LibroCellModel);
|
|
31
|
+
function LibroCellModel(options) {
|
|
32
|
+
var _options$cell$source, _options$cell, _options$cell2, _options$cell$metadat, _options$cell3;
|
|
33
|
+
var _this;
|
|
34
|
+
_classCallCheck(this, LibroCellModel);
|
|
35
|
+
_this = _super.call(this, {
|
|
36
|
+
id: options.cell.id,
|
|
37
|
+
value: concatMultilineString((_options$cell$source = options === null || options === void 0 || (_options$cell = options.cell) === null || _options$cell === void 0 ? void 0 : _options$cell.source) !== null && _options$cell$source !== void 0 ? _options$cell$source : '')
|
|
38
|
+
});
|
|
39
|
+
_this.toDispose = new DisposableCollection();
|
|
40
|
+
_this.options = void 0;
|
|
41
|
+
_this.libroFormatType = void 0;
|
|
42
|
+
_this._decodeObject = void 0;
|
|
43
|
+
_initializerDefineProperty(_this, "libroFormatterManager", _descriptor, _assertThisInitialized(_this));
|
|
44
|
+
_initializerDefineProperty(_this, "metadata", _descriptor2, _assertThisInitialized(_this));
|
|
45
|
+
_initializerDefineProperty(_this, "trusted", _descriptor3, _assertThisInitialized(_this));
|
|
46
|
+
_this.version = 0;
|
|
47
|
+
_this.updateVersion = function () {
|
|
48
|
+
watch(_assertThisInitialized(_this), 'value', function () {
|
|
49
|
+
_this.version++;
|
|
50
|
+
});
|
|
51
|
+
};
|
|
52
|
+
_this.disposed = false;
|
|
53
|
+
_this.options = options;
|
|
54
|
+
_this.type = getLibroCellType(options);
|
|
55
|
+
_this.libroFormatType = 'formatter-string';
|
|
56
|
+
_this.metadata = _objectSpread(_objectSpread({}, options === null || options === void 0 || (_options$cell2 = options.cell) === null || _options$cell2 === void 0 ? void 0 : _options$cell2.metadata), {}, {
|
|
57
|
+
libroFormatter: _this.libroFormatType
|
|
58
|
+
});
|
|
59
|
+
_this.trusted = (_options$cell$metadat = options === null || options === void 0 || (_options$cell3 = options.cell) === null || _options$cell3 === void 0 || (_options$cell3 = _options$cell3.metadata) === null || _options$cell3 === void 0 ? void 0 : _options$cell3.trusted) !== null && _options$cell$metadat !== void 0 ? _options$cell$metadat : false;
|
|
60
|
+
return _this;
|
|
61
|
+
}
|
|
62
|
+
LibroCellModel = inject(CellOptions)(LibroCellModel, undefined, 0) || LibroCellModel;
|
|
63
|
+
_createClass(LibroCellModel, [{
|
|
64
|
+
key: "init",
|
|
65
|
+
value: function init() {
|
|
66
|
+
var _this$options, _this$options2, _this$options3, _this$options4;
|
|
67
|
+
var formatValue = DefaultEncodedFormatter.is((_this$options = this.options) === null || _this$options === void 0 ? void 0 : _this$options.cell) ? (_this$options2 = this.options) === null || _this$options2 === void 0 ? void 0 : _this$options2.cell : _objectSpread(_objectSpread({}, (_this$options3 = this.options) === null || _this$options3 === void 0 ? void 0 : _this$options3.cell), {}, {
|
|
68
|
+
metadata: _objectSpread(_objectSpread({}, (_this$options4 = this.options) === null || _this$options4 === void 0 ? void 0 : _this$options4.cell.metadata), {}, {
|
|
69
|
+
libroFormatter: this.libroFormatType
|
|
70
|
+
})
|
|
71
|
+
});
|
|
72
|
+
this.decodeObject = this.libroFormatterManager.adapter(this.libroFormatType, formatValue);
|
|
73
|
+
this.updateVersion();
|
|
74
|
+
}
|
|
75
|
+
}, {
|
|
76
|
+
key: "source",
|
|
77
|
+
get: function get() {
|
|
78
|
+
var encodedValue = this.libroFormatterManager.encode(this.libroFormatType, this.decodeObject);
|
|
79
|
+
return concatMultilineString(encodedValue.source);
|
|
80
|
+
}
|
|
81
|
+
}, {
|
|
82
|
+
key: "decodeObject",
|
|
83
|
+
get: function get() {
|
|
84
|
+
return _objectSpread(_objectSpread({}, this._decodeObject), {}, {
|
|
85
|
+
value: this.value
|
|
86
|
+
});
|
|
87
|
+
},
|
|
88
|
+
set: function set(data) {
|
|
89
|
+
this.value = data.value;
|
|
90
|
+
this._decodeObject = data;
|
|
91
|
+
}
|
|
92
|
+
}, {
|
|
93
|
+
key: "toJSON",
|
|
94
|
+
value: function toJSON() {
|
|
95
|
+
return {
|
|
96
|
+
id: this.id,
|
|
97
|
+
cell_type: this.type,
|
|
98
|
+
metadata: this.metadata,
|
|
99
|
+
source: this.source
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
}, {
|
|
103
|
+
key: "dispose",
|
|
104
|
+
value: function dispose() {
|
|
105
|
+
if (!this.disposed) {
|
|
106
|
+
this.toDispose.dispose();
|
|
107
|
+
}
|
|
108
|
+
this.disposed = true;
|
|
109
|
+
}
|
|
110
|
+
}]);
|
|
111
|
+
return LibroCellModel;
|
|
112
|
+
}(Model), (_descriptor = _applyDecoratedDescriptor(_class2.prototype, "libroFormatterManager", [_dec2], {
|
|
113
|
+
configurable: true,
|
|
114
|
+
enumerable: true,
|
|
115
|
+
writable: true,
|
|
116
|
+
initializer: null
|
|
117
|
+
}), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, "metadata", [_dec3], {
|
|
118
|
+
configurable: true,
|
|
119
|
+
enumerable: true,
|
|
120
|
+
writable: true,
|
|
121
|
+
initializer: null
|
|
122
|
+
}), _descriptor3 = _applyDecoratedDescriptor(_class2.prototype, "trusted", [_dec4], {
|
|
123
|
+
configurable: true,
|
|
124
|
+
enumerable: true,
|
|
125
|
+
writable: true,
|
|
126
|
+
initializer: null
|
|
127
|
+
}), _applyDecoratedDescriptor(_class2.prototype, "init", [_dec5], Object.getOwnPropertyDescriptor(_class2.prototype, "init"), _class2.prototype)), _class2)) || _class);
|
|
128
|
+
export function isLibroCellModel(model) {
|
|
129
|
+
return model instanceof LibroCellModel;
|
|
130
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ManaModule } from '@difizen/mana-app';
|
|
2
|
+
/**
|
|
3
|
+
* 基础的cell实现,作为实现更复杂的cell的参考,一般不用加载到实际应用中
|
|
4
|
+
*/
|
|
5
|
+
export declare const LibroBaseCellModule: ManaModule;
|
|
6
|
+
/**
|
|
7
|
+
* cell 定义
|
|
8
|
+
*/
|
|
9
|
+
export declare const LibroCellModule: ManaModule;
|
|
10
|
+
//# sourceMappingURL=libro-cell-module.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"libro-cell-module.d.ts","sourceRoot":"","sources":["../../src/cell/libro-cell-module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAc/C;;GAEG;AACH,eAAO,MAAM,mBAAmB,YAe5B,CAAC;AAEL;;GAEG;AACH,eAAO,MAAM,eAAe,YAEC,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { ManaModule } from '@difizen/mana-app';
|
|
2
|
+
import { CellOptions } from "../libro-protocol.js";
|
|
3
|
+
import { LibroCellContribution } from "./libro-cell-contribution.js";
|
|
4
|
+
import { LibroCellModel } from "./libro-cell-model.js";
|
|
5
|
+
import { CellModelContribution, CellModelFactory, CellViewContribution } from "./libro-cell-protocol.js";
|
|
6
|
+
import { LibroCellService } from "./libro-cell-service.js";
|
|
7
|
+
import { LibroCellView } from "./libro-cell-view.js";
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* 基础的cell实现,作为实现更复杂的cell的参考,一般不用加载到实际应用中
|
|
11
|
+
*/
|
|
12
|
+
export var LibroBaseCellModule = ManaModule.create().register(LibroCellContribution, LibroCellView, LibroCellModel).register({
|
|
13
|
+
token: CellModelFactory,
|
|
14
|
+
useFactory: function useFactory(ctx) {
|
|
15
|
+
return function (options) {
|
|
16
|
+
var child = ctx.container.createChild();
|
|
17
|
+
child.register({
|
|
18
|
+
token: CellOptions,
|
|
19
|
+
useValue: options
|
|
20
|
+
});
|
|
21
|
+
var model = child.get(LibroCellModel);
|
|
22
|
+
return model;
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* cell 定义
|
|
29
|
+
*/
|
|
30
|
+
export var LibroCellModule = ManaModule.create().contribution(CellViewContribution, CellModelContribution).register(LibroCellService);
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { IBaseCell, ICell, ICellMetadata } from '@difizen/libro-common';
|
|
2
|
+
import type { MaybePromise, Newable } from '@difizen/mana-app';
|
|
3
|
+
import { Syringe } from '@difizen/mana-app';
|
|
4
|
+
import type { CellModel, CellOptions, CellView } from '../libro-protocol.js';
|
|
5
|
+
export type LibroCellMetadata = ICellMetadata & {
|
|
6
|
+
libroCellType?: string;
|
|
7
|
+
libroFormatter?: string;
|
|
8
|
+
libroFormatterOptions?: object;
|
|
9
|
+
};
|
|
10
|
+
export interface LibroCustomCell extends IBaseCell {
|
|
11
|
+
metadata: Partial<LibroCellMetadata>;
|
|
12
|
+
}
|
|
13
|
+
export type LibroCell = LibroCustomCell | ICell;
|
|
14
|
+
export type CellModelFactory = (options: CellOptions) => CellModel;
|
|
15
|
+
export declare const CellModelFactory: unique symbol;
|
|
16
|
+
export declare const getLibroCellType: (options: CellOptions) => string;
|
|
17
|
+
export declare const CellModelContribution: Syringe.DefinedToken;
|
|
18
|
+
export interface CellModelContribution {
|
|
19
|
+
cellMeta: CellMeta;
|
|
20
|
+
canHandle: (options: CellOptions, libroType?: string) => number;
|
|
21
|
+
createModel: (options: CellOptions) => MaybePromise<CellModel>;
|
|
22
|
+
getDefaultCellOption?: () => CellOptions;
|
|
23
|
+
}
|
|
24
|
+
export declare const CellViewContribution: Syringe.DefinedToken;
|
|
25
|
+
export interface CellViewContribution {
|
|
26
|
+
canHandle: (options: CellOptions) => number;
|
|
27
|
+
view: Newable<CellView>;
|
|
28
|
+
}
|
|
29
|
+
export interface CellMeta {
|
|
30
|
+
type: string;
|
|
31
|
+
name: string;
|
|
32
|
+
order: string;
|
|
33
|
+
nbformatType?: string;
|
|
34
|
+
}
|
|
35
|
+
export declare const CellService: unique symbol;
|
|
36
|
+
export interface CellService {
|
|
37
|
+
cellsMeta: CellMeta[];
|
|
38
|
+
getModelFromCache: (groupId: string, modelId: string) => CellModel | undefined;
|
|
39
|
+
getOrCreateModel: (options: CellOptions, cacheGroupId?: string) => Promise<CellModel>;
|
|
40
|
+
getOrCreateView: (options: CellOptions, parentId: string) => Promise<CellView>;
|
|
41
|
+
findModelProvider: (options: CellOptions) => CellModelContribution | undefined;
|
|
42
|
+
findViewProvider: (options: CellOptions) => CellViewContribution | undefined;
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=libro-cell-protocol.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"libro-cell-protocol.d.ts","sourceRoot":"","sources":["../../src/cell/libro-cell-protocol.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC7E,OAAO,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAE5C,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAE7E,MAAM,MAAM,iBAAiB,GAAG,aAAa,GAAG;IAC9C,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,qBAAqB,CAAC,EAAE,MAAM,CAAC;CAChC,CAAC;AACF,MAAM,WAAW,eAAgB,SAAQ,SAAS;IAChD,QAAQ,EAAE,OAAO,CAAC,iBAAiB,CAAC,CAAC;CACtC;AACD,MAAM,MAAM,SAAS,GAAG,eAAe,GAAG,KAAK,CAAC;AAEhD,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,EAAE,WAAW,KAAK,SAAS,CAAC;AACnE,eAAO,MAAM,gBAAgB,eAA6B,CAAC;AAE3D,eAAO,MAAM,gBAAgB,YAAa,WAAW,WAEpD,CAAC;AAEF,eAAO,MAAM,qBAAqB,sBAA+C,CAAC;AAClF,MAAM,WAAW,qBAAqB;IACpC,QAAQ,EAAE,QAAQ,CAAC;IACnB,SAAS,EAAE,CAAC,OAAO,EAAE,WAAW,EAAE,SAAS,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;IAChE,WAAW,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,YAAY,CAAC,SAAS,CAAC,CAAC;IAC/D,oBAAoB,CAAC,EAAE,MAAM,WAAW,CAAC;CAC1C;AAED,eAAO,MAAM,oBAAoB,sBAA8C,CAAC;AAChF,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,MAAM,CAAC;IAC5C,IAAI,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC;CACzB;AAED,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAID,eAAO,MAAM,WAAW,eAAwB,CAAC;AACjD,MAAM,WAAW,WAAW;IAC1B,SAAS,EAAE,QAAQ,EAAE,CAAC;IACtB,iBAAiB,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,SAAS,GAAG,SAAS,CAAC;IAC/E,gBAAgB,EAAE,CAAC,OAAO,EAAE,WAAW,EAAE,YAAY,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,SAAS,CAAC,CAAC;IACtF,eAAe,EAAE,CAAC,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC/E,iBAAiB,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,qBAAqB,GAAG,SAAS,CAAC;IAC/E,gBAAgB,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,oBAAoB,GAAG,SAAS,CAAC;CAC9E"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Syringe } from '@difizen/mana-app';
|
|
2
|
+
export var CellModelFactory = Symbol('CellModelFactory');
|
|
3
|
+
export var getLibroCellType = function getLibroCellType(options) {
|
|
4
|
+
var _ref, _options$cell$metadat;
|
|
5
|
+
return (_ref = (_options$cell$metadat = options.cell.metadata) === null || _options$cell$metadat === void 0 ? void 0 : _options$cell$metadat.libroCellType) !== null && _ref !== void 0 ? _ref : options.cell.cell_type;
|
|
6
|
+
};
|
|
7
|
+
export var CellModelContribution = Syringe.defineToken('CellModelContribution');
|
|
8
|
+
export var CellViewContribution = Syringe.defineToken('CellViewContribution');
|
|
9
|
+
//
|
|
10
|
+
|
|
11
|
+
export var CellService = Symbol('CellService');
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { Contribution } from '@difizen/mana-app';
|
|
2
|
+
import { ApplicationContribution, ViewManager } from '@difizen/mana-app';
|
|
3
|
+
import type { CellView, CellModel, CellOptions } from '../libro-protocol.js';
|
|
4
|
+
import { LibroService } from '../libro-service.js';
|
|
5
|
+
import type { CellMeta } from './libro-cell-protocol.js';
|
|
6
|
+
import { CellService, CellViewContribution, CellModelContribution } from './libro-cell-protocol.js';
|
|
7
|
+
export declare class LibroCellService implements CellService, ApplicationContribution {
|
|
8
|
+
cellsMeta: CellMeta[];
|
|
9
|
+
protected readonly modelProvider: Contribution.Provider<CellModelContribution>;
|
|
10
|
+
protected readonly viewProvider: Contribution.Provider<CellViewContribution>;
|
|
11
|
+
protected cellTypeToModelContribution: Map<string, CellModelContribution>;
|
|
12
|
+
protected readonly viewManager: ViewManager;
|
|
13
|
+
protected modelCache: Map<string, Map<string, CellModel>>;
|
|
14
|
+
libroService: LibroService;
|
|
15
|
+
constructor(viewManager: ViewManager, libroService: LibroService, modelProvider: Contribution.Provider<CellModelContribution>, viewProvider: Contribution.Provider<CellViewContribution>);
|
|
16
|
+
protected getContributionDefaultCellOption(ctb: CellModelContribution): CellOptions;
|
|
17
|
+
initialize(): void;
|
|
18
|
+
getDefaultCellOption(cellType: string): CellOptions;
|
|
19
|
+
protected cellTypeToOption(cellType: string): CellOptions;
|
|
20
|
+
getModelFromCache(groupId: string, modelId: string): CellModel | undefined;
|
|
21
|
+
getOrCreateModel(options: CellOptions, cacheGroupId?: string): Promise<CellModel>;
|
|
22
|
+
getOrCreateView(options: CellOptions, parentId: string): Promise<CellView>;
|
|
23
|
+
findViewProvider(options: CellOptions): CellViewContribution | undefined;
|
|
24
|
+
findModelProvider(options: CellOptions): CellModelContribution | undefined;
|
|
25
|
+
protected getDefaultOptionModelContributionPrioritized(): CellModelContribution[];
|
|
26
|
+
protected canHandleOption(ctb: CellModelContribution | CellViewContribution, options: CellOptions): number;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=libro-cell-service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"libro-cell-service.d.ts","sourceRoot":"","sources":["../../src/cell/libro-cell-service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEtD,OAAO,EAAE,uBAAuB,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGzE,OAAO,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAC7E,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEnD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EACL,WAAW,EAEX,oBAAoB,EACpB,qBAAqB,EACtB,MAAM,0BAA0B,CAAC;AAElC,qBACa,gBAAiB,YAAW,WAAW,EAAE,uBAAuB;IAE3E,SAAS,EAAE,QAAQ,EAAE,CAAM;IAE3B,SAAS,CAAC,QAAQ,CAAC,aAAa,EAAE,YAAY,CAAC,QAAQ,CAAC,qBAAqB,CAAC,CAAC;IAC/E,SAAS,CAAC,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC,QAAQ,CAAC,oBAAoB,CAAC,CAAC;IAC7E,SAAS,CAAC,2BAA2B,EAAE,GAAG,CAAC,MAAM,EAAE,qBAAqB,CAAC,CAAa;IACtF,SAAS,CAAC,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC;IAC5C,SAAS,CAAC,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,CAAa;IAEtE,YAAY,EAAE,YAAY,CAAC;gBAGzB,WAAW,EAAE,WAAW,EACF,YAAY,EAAE,YAAY,EAEhD,aAAa,EAAE,YAAY,CAAC,QAAQ,CAAC,qBAAqB,CAAC,EAE3D,YAAY,EAAE,YAAY,CAAC,QAAQ,CAAC,oBAAoB,CAAC;IAQ3D,SAAS,CAAC,gCAAgC,CAAC,GAAG,EAAE,qBAAqB,GAAG,WAAW;IAOnF,UAAU;IAaV,oBAAoB,CAAC,QAAQ,EAAE,MAAM;IAQrC,SAAS,CAAC,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,WAAW;IAIzD,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM;IAK5C,gBAAgB,CAAC,OAAO,EAAE,WAAW,EAAE,YAAY,SAAK,GAAG,OAAO,CAAC,SAAS,CAAC;IAqB7E,eAAe,CAAC,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC;IAqBhF,gBAAgB,CAAC,OAAO,EAAE,WAAW,GAAG,oBAAoB,GAAG,SAAS;IASxE,iBAAiB,CAAC,OAAO,EAAE,WAAW,GAAG,qBAAqB,GAAG,SAAS;IAS1E,SAAS,CAAC,4CAA4C,IAAI,qBAAqB,EAAE;IAWjF,SAAS,CAAC,eAAe,CACvB,GAAG,EAAE,qBAAqB,GAAG,oBAAoB,EACjD,OAAO,EAAE,WAAW;CAIvB"}
|