@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,89 @@
|
|
|
1
|
+
import type { ConfigurationNode } from '@difizen/mana-app';
|
|
2
|
+
import {
|
|
3
|
+
BaseView,
|
|
4
|
+
prop,
|
|
5
|
+
transient,
|
|
6
|
+
useInject,
|
|
7
|
+
view,
|
|
8
|
+
ViewInstance,
|
|
9
|
+
ConfigurationRenderRegistry,
|
|
10
|
+
useConfigurationValue,
|
|
11
|
+
SchemaValidator,
|
|
12
|
+
} from '@difizen/mana-app';
|
|
13
|
+
import { Form } from 'antd';
|
|
14
|
+
import React from 'react';
|
|
15
|
+
|
|
16
|
+
import './index.less';
|
|
17
|
+
|
|
18
|
+
const layout = {
|
|
19
|
+
labelCol: { span: 8 },
|
|
20
|
+
wrapperCol: { span: 16 },
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export const ConfigurationNodeRender: React.FC<{ node: ConfigurationNode<any> }> = ({
|
|
24
|
+
node,
|
|
25
|
+
}) => {
|
|
26
|
+
const configurationRenderRegistry = useInject(ConfigurationRenderRegistry);
|
|
27
|
+
const schemaValidator = useInject(SchemaValidator);
|
|
28
|
+
const Render = configurationRenderRegistry.getConfigurationRender(node);
|
|
29
|
+
const [value, setValue] = useConfigurationValue(node);
|
|
30
|
+
return (
|
|
31
|
+
<div key={node.id}>
|
|
32
|
+
{Render && (
|
|
33
|
+
<div id={node.id}>
|
|
34
|
+
<Form.Item
|
|
35
|
+
label={node.title}
|
|
36
|
+
extra={node.description}
|
|
37
|
+
rules={[
|
|
38
|
+
{
|
|
39
|
+
validator: (_, currentVal) => {
|
|
40
|
+
const valid = schemaValidator.validateNode(node, currentVal);
|
|
41
|
+
if (valid) {
|
|
42
|
+
return Promise.resolve();
|
|
43
|
+
}
|
|
44
|
+
return Promise.reject(new Error('invalid value'));
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
]}
|
|
48
|
+
hasFeedback
|
|
49
|
+
>
|
|
50
|
+
<Render
|
|
51
|
+
label={node.title}
|
|
52
|
+
value={value}
|
|
53
|
+
schema={node.schema}
|
|
54
|
+
onChange={(val) => {
|
|
55
|
+
setValue(val);
|
|
56
|
+
}}
|
|
57
|
+
/>
|
|
58
|
+
</Form.Item>
|
|
59
|
+
</div>
|
|
60
|
+
)}
|
|
61
|
+
</div>
|
|
62
|
+
);
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
export const DefaultConfigurationViewComponent: React.FC = () => {
|
|
66
|
+
const [form] = Form.useForm();
|
|
67
|
+
const viewInstance = useInject<ConfigurationPanelView>(ViewInstance);
|
|
68
|
+
const configs = viewInstance.configurationNodes;
|
|
69
|
+
return (
|
|
70
|
+
<Form
|
|
71
|
+
{...layout}
|
|
72
|
+
form={form}
|
|
73
|
+
className={`libro-configuration-site-card ${viewInstance.className}`}
|
|
74
|
+
>
|
|
75
|
+
{configs?.map((config) => {
|
|
76
|
+
return <ConfigurationNodeRender node={config} key={config.id} />;
|
|
77
|
+
})}
|
|
78
|
+
</Form>
|
|
79
|
+
);
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
@transient()
|
|
83
|
+
@view('ConfigurationPanel')
|
|
84
|
+
export class ConfigurationPanelView extends BaseView {
|
|
85
|
+
override view = DefaultConfigurationViewComponent;
|
|
86
|
+
|
|
87
|
+
@prop()
|
|
88
|
+
configurationNodes: ConfigurationNode<any>[] = [];
|
|
89
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import type { ConfigurationRender } from '@difizen/mana-app';
|
|
2
|
+
import { singleton, ConfigurationRenderContribution } from '@difizen/mana-app';
|
|
3
|
+
|
|
4
|
+
import {
|
|
5
|
+
DefaultCheckbox,
|
|
6
|
+
DefaultInput,
|
|
7
|
+
DefaultInputNumber,
|
|
8
|
+
DefaultSelect,
|
|
9
|
+
DefaultSwitch,
|
|
10
|
+
DefaultDatePicker,
|
|
11
|
+
} from './default-node-render.js';
|
|
12
|
+
|
|
13
|
+
@singleton({ contrib: [ConfigurationRenderContribution] })
|
|
14
|
+
export class DefaultConfigurationRenderContribution
|
|
15
|
+
implements ConfigurationRenderContribution
|
|
16
|
+
{
|
|
17
|
+
registerConfigurationRenders(): ConfigurationRender[] {
|
|
18
|
+
return [
|
|
19
|
+
{
|
|
20
|
+
canHandle: (config) => {
|
|
21
|
+
if (config.type === 'input') {
|
|
22
|
+
return 1;
|
|
23
|
+
} else {
|
|
24
|
+
return false;
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
component: DefaultInput,
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
canHandle: (config) => {
|
|
31
|
+
if (config.type === 'checkbox') {
|
|
32
|
+
return 1;
|
|
33
|
+
} else {
|
|
34
|
+
return false;
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
component: DefaultCheckbox,
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
canHandle: (config) => {
|
|
41
|
+
if (config.type === 'switch') {
|
|
42
|
+
return 1;
|
|
43
|
+
} else {
|
|
44
|
+
return false;
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
component: DefaultSwitch,
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
canHandle: (config) => {
|
|
51
|
+
if (config.type === 'inputnumber') {
|
|
52
|
+
return 1;
|
|
53
|
+
} else {
|
|
54
|
+
return false;
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
component: DefaultInputNumber,
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
canHandle: (config) => {
|
|
61
|
+
if (config.type === 'select') {
|
|
62
|
+
return 1;
|
|
63
|
+
} else {
|
|
64
|
+
return false;
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
component: DefaultSelect,
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
canHandle: (config) => {
|
|
71
|
+
if (config.type === 'datepicker') {
|
|
72
|
+
return 1;
|
|
73
|
+
} else {
|
|
74
|
+
return false;
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
component: DefaultDatePicker,
|
|
78
|
+
},
|
|
79
|
+
];
|
|
80
|
+
}
|
|
81
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import type { RenderProps } from '@difizen/mana-app';
|
|
2
|
+
import { l10n } from '@difizen/mana-l10n';
|
|
3
|
+
import { Checkbox, DatePicker, Input, InputNumber, Select, Switch } from 'antd';
|
|
4
|
+
import dayjs from 'dayjs';
|
|
5
|
+
import React from 'react';
|
|
6
|
+
|
|
7
|
+
const { Option } = Select;
|
|
8
|
+
|
|
9
|
+
export const DefaultInput: React.FC<RenderProps<string>> = ({ value, onChange }) => (
|
|
10
|
+
<Input value={value} onChange={(event) => onChange(event.target.value)} />
|
|
11
|
+
);
|
|
12
|
+
|
|
13
|
+
export const DefaultInputNumber: React.FC<RenderProps<number>> = ({
|
|
14
|
+
value,
|
|
15
|
+
onChange,
|
|
16
|
+
schema,
|
|
17
|
+
}) => (
|
|
18
|
+
<InputNumber
|
|
19
|
+
value={value}
|
|
20
|
+
min={schema.minimum ?? Number.MIN_SAFE_INTEGER}
|
|
21
|
+
max={schema.maximum ?? Number.MAX_SAFE_INTEGER}
|
|
22
|
+
onChange={(val) => onChange(val)}
|
|
23
|
+
/>
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
export const DefaultCheckbox: React.FC<RenderProps<boolean>> = ({
|
|
27
|
+
value,
|
|
28
|
+
onChange,
|
|
29
|
+
}) => {
|
|
30
|
+
return (
|
|
31
|
+
<Checkbox checked={value} onChange={(event) => onChange(event.target.checked)}>
|
|
32
|
+
{value ? l10n.t('开启') : l10n.t('关闭')}
|
|
33
|
+
</Checkbox>
|
|
34
|
+
);
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export const DefaultSwitch: React.FC<RenderProps<boolean>> = ({ value, onChange }) => (
|
|
38
|
+
<Switch checked={value} onChange={(checked: boolean) => onChange(checked)} />
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
export const DefaultSelect: React.FC<RenderProps<string>> = ({
|
|
42
|
+
value,
|
|
43
|
+
onChange,
|
|
44
|
+
schema,
|
|
45
|
+
}) => (
|
|
46
|
+
<Select value={value} onChange={(val: string) => onChange(val)}>
|
|
47
|
+
{schema['enum'].map((val: string) => (
|
|
48
|
+
<Option key={val} value={val}>
|
|
49
|
+
{val}
|
|
50
|
+
</Option>
|
|
51
|
+
))}
|
|
52
|
+
</Select>
|
|
53
|
+
);
|
|
54
|
+
|
|
55
|
+
const dateFormat = 'YYYY/MM/DD';
|
|
56
|
+
|
|
57
|
+
export const DefaultDatePicker: React.FC<RenderProps<string>> = ({
|
|
58
|
+
value,
|
|
59
|
+
onChange,
|
|
60
|
+
}) => (
|
|
61
|
+
<DatePicker
|
|
62
|
+
value={dayjs(value, dateFormat)}
|
|
63
|
+
onChange={(date, dateString) => onChange(dateString.toString())}
|
|
64
|
+
/>
|
|
65
|
+
);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ManaModule, ConfigurationModule } from '@difizen/mana-app';
|
|
2
|
+
|
|
3
|
+
import { ConfigurationPanelView } from './configuration-panel-view.js';
|
|
4
|
+
import { DefaultConfigurationRenderContribution } from './configuration-render-contribution.js';
|
|
5
|
+
import { SettingEditorView } from './setting-editor-view.js';
|
|
6
|
+
// import { SettingTreeService } from './setting-tree-service.js';
|
|
7
|
+
// import { SettingTreeView } from './setting-tree-view.js';
|
|
8
|
+
|
|
9
|
+
export const SettingEditorModule = ManaModule.create()
|
|
10
|
+
.register(
|
|
11
|
+
SettingEditorView,
|
|
12
|
+
DefaultConfigurationRenderContribution,
|
|
13
|
+
ConfigurationPanelView,
|
|
14
|
+
// SettingTreeView,
|
|
15
|
+
// SettingTreeService,
|
|
16
|
+
)
|
|
17
|
+
.dependOn(ConfigurationModule);
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import {
|
|
2
|
+
BaseView,
|
|
3
|
+
view,
|
|
4
|
+
singleton,
|
|
5
|
+
ViewRender,
|
|
6
|
+
inject,
|
|
7
|
+
ViewManager,
|
|
8
|
+
useInject,
|
|
9
|
+
ViewInstance,
|
|
10
|
+
prop,
|
|
11
|
+
URI,
|
|
12
|
+
ConfigurationRegistry,
|
|
13
|
+
} from '@difizen/mana-app';
|
|
14
|
+
import { SplitPanel } from '@difizen/mana-react';
|
|
15
|
+
import { useEffect, useState } from 'react';
|
|
16
|
+
|
|
17
|
+
import { ConfigurationPanelView } from './configuration-panel-view.js';
|
|
18
|
+
import { SettingTreeView } from './setting-tree-view.js';
|
|
19
|
+
|
|
20
|
+
export const SettingEditorComponent: React.FC = () => {
|
|
21
|
+
const viewInstance = useInject<SettingEditorView>(ViewInstance);
|
|
22
|
+
const viewManager = useInject<ViewManager>(ViewManager);
|
|
23
|
+
const PanelView = viewInstance.configurationPanel?.view;
|
|
24
|
+
|
|
25
|
+
const [treeView, setTreeView] = useState<SettingTreeView>();
|
|
26
|
+
useEffect(() => {
|
|
27
|
+
viewManager
|
|
28
|
+
.getOrCreateView(SettingTreeView)
|
|
29
|
+
.then((item) => {
|
|
30
|
+
setTreeView(item);
|
|
31
|
+
return;
|
|
32
|
+
})
|
|
33
|
+
.catch(console.error);
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
return (
|
|
37
|
+
<SplitPanel id="">
|
|
38
|
+
<SplitPanel.Pane className="" id="" defaultSize={200}>
|
|
39
|
+
{treeView && <ViewRender view={treeView} />}
|
|
40
|
+
</SplitPanel.Pane>
|
|
41
|
+
<SplitPanel.Pane className="" id="" flex={1}>
|
|
42
|
+
{PanelView && <PanelView />}
|
|
43
|
+
</SplitPanel.Pane>
|
|
44
|
+
</SplitPanel>
|
|
45
|
+
);
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
@singleton()
|
|
49
|
+
@view('SettingEditor')
|
|
50
|
+
export class SettingEditorView extends BaseView {
|
|
51
|
+
override view = SettingEditorComponent;
|
|
52
|
+
|
|
53
|
+
protected readonly configurationRegistry: ConfigurationRegistry;
|
|
54
|
+
protected readonly viewManager: ViewManager;
|
|
55
|
+
|
|
56
|
+
constructor(
|
|
57
|
+
@inject(ConfigurationRegistry) configurationRegistry: ConfigurationRegistry,
|
|
58
|
+
@inject(ViewManager) viewManager: ViewManager,
|
|
59
|
+
) {
|
|
60
|
+
super();
|
|
61
|
+
this.configurationRegistry = configurationRegistry;
|
|
62
|
+
this.viewManager = viewManager;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
@prop()
|
|
66
|
+
configurationPanel?: ConfigurationPanelView;
|
|
67
|
+
|
|
68
|
+
override async onViewMount() {
|
|
69
|
+
await this.initFileView();
|
|
70
|
+
await this.initPanel();
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
async initPanel() {
|
|
74
|
+
const namespace = this.configurationRegistry.getRootNamespaces().at(0);
|
|
75
|
+
if (namespace) {
|
|
76
|
+
this.configurationPanel =
|
|
77
|
+
await this.viewManager.getOrCreateView<ConfigurationPanelView>(
|
|
78
|
+
ConfigurationPanelView,
|
|
79
|
+
);
|
|
80
|
+
this.configurationPanel.configurationNodes =
|
|
81
|
+
this.configurationRegistry.getConfigurationByNamespace([namespace], false);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
async initFileView() {
|
|
86
|
+
const treeView =
|
|
87
|
+
await this.viewManager.getOrCreateView<SettingTreeView>(SettingTreeView);
|
|
88
|
+
// if (!this.viewStorage.canStoreView) {
|
|
89
|
+
treeView.model.rootVisible = false;
|
|
90
|
+
treeView.model.location = new URI('file:///');
|
|
91
|
+
// }
|
|
92
|
+
}
|
|
93
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { inject, ConfigurationRegistry, URI } from '@difizen/mana-app';
|
|
2
|
+
import { FileService, singleton } from '@difizen/mana-app';
|
|
3
|
+
import type { FileStatWithMetadata } from '@difizen/mana-app';
|
|
4
|
+
|
|
5
|
+
const defaultFileMeta = {
|
|
6
|
+
mtime: 0,
|
|
7
|
+
ctime: 0,
|
|
8
|
+
etag: '',
|
|
9
|
+
size: 0,
|
|
10
|
+
isFile: false,
|
|
11
|
+
isDirectory: false,
|
|
12
|
+
isSymbolicLink: false,
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
@singleton({ contrib: FileService })
|
|
16
|
+
export class SettingTreeService extends FileService {
|
|
17
|
+
protected readonly configurationRegistry: ConfigurationRegistry;
|
|
18
|
+
constructor(
|
|
19
|
+
@inject(ConfigurationRegistry) configurationRegistry: ConfigurationRegistry,
|
|
20
|
+
) {
|
|
21
|
+
super();
|
|
22
|
+
this.configurationRegistry = configurationRegistry;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
override async resolve(
|
|
26
|
+
resource: URI,
|
|
27
|
+
// options?: ResolveFileOptions | undefined,
|
|
28
|
+
): Promise<FileStatWithMetadata> {
|
|
29
|
+
if (resource.path.isRoot) {
|
|
30
|
+
const roots = this.configurationRegistry.getRootNamespaces().map((item) => {
|
|
31
|
+
return {
|
|
32
|
+
...defaultFileMeta,
|
|
33
|
+
isFile: false,
|
|
34
|
+
isDirectory: true,
|
|
35
|
+
name: item,
|
|
36
|
+
resource: URI.resolve(resource, item),
|
|
37
|
+
};
|
|
38
|
+
});
|
|
39
|
+
return {
|
|
40
|
+
...defaultFileMeta,
|
|
41
|
+
isDirectory: true,
|
|
42
|
+
name: resource.displayName,
|
|
43
|
+
resource,
|
|
44
|
+
children: roots,
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const name = resource.path.name;
|
|
49
|
+
|
|
50
|
+
const namespaces = this.configurationRegistry
|
|
51
|
+
.getChildNamespaces([name])
|
|
52
|
+
.map((item) => {
|
|
53
|
+
return {
|
|
54
|
+
...defaultFileMeta,
|
|
55
|
+
isFile: false,
|
|
56
|
+
isDirectory: true,
|
|
57
|
+
name: item.join('.'),
|
|
58
|
+
resource: URI.resolve(resource, item.join('.')),
|
|
59
|
+
};
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
const configs = this.configurationRegistry
|
|
63
|
+
.getConfigurationByNamespace([name])
|
|
64
|
+
.map((item) => {
|
|
65
|
+
return {
|
|
66
|
+
...defaultFileMeta,
|
|
67
|
+
isFile: true,
|
|
68
|
+
name: item.title ?? '',
|
|
69
|
+
resource: URI.resolve(resource, item.id),
|
|
70
|
+
};
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
return {
|
|
74
|
+
...defaultFileMeta,
|
|
75
|
+
isFile: false,
|
|
76
|
+
isDirectory: true,
|
|
77
|
+
name: resource.displayName,
|
|
78
|
+
resource,
|
|
79
|
+
children: [...namespaces, ...configs],
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CommandRegistry,
|
|
3
|
+
FileStatNode,
|
|
4
|
+
FileTreeModel,
|
|
5
|
+
FileTreeView,
|
|
6
|
+
FileTreeViewModule,
|
|
7
|
+
inject,
|
|
8
|
+
LabelProvider,
|
|
9
|
+
SelectionService,
|
|
10
|
+
singleton,
|
|
11
|
+
TreeDecoratorService,
|
|
12
|
+
TreeProps,
|
|
13
|
+
TreeViewComponent,
|
|
14
|
+
TreeViewDecorator,
|
|
15
|
+
view,
|
|
16
|
+
} from '@difizen/mana-app';
|
|
17
|
+
import type { TreeNode } from '@difizen/mana-app';
|
|
18
|
+
import { l10n } from '@difizen/mana-l10n';
|
|
19
|
+
import React, { forwardRef } from 'react';
|
|
20
|
+
import './index.less';
|
|
21
|
+
|
|
22
|
+
export const SettingTreeFactoryId = 'setting-editor-tree';
|
|
23
|
+
export const FileTreeComponent = forwardRef<HTMLDivElement, any>(
|
|
24
|
+
function FileTreeComponent(props, containerRef: React.ForwardedRef<HTMLDivElement>) {
|
|
25
|
+
return (
|
|
26
|
+
<div className="libro-configuration-tree" ref={containerRef}>
|
|
27
|
+
<div className="ai-infra-configuration-header">{l10n.t('文件')}</div>
|
|
28
|
+
<div className="libro-configuration-content">
|
|
29
|
+
<TreeViewComponent />
|
|
30
|
+
</div>
|
|
31
|
+
</div>
|
|
32
|
+
);
|
|
33
|
+
},
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
export const SettingTreeComponent: React.FC = () => {
|
|
37
|
+
return <></>;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
function jump(h: string) {
|
|
41
|
+
const url = location.href; //Save down the URL without hash.
|
|
42
|
+
location.href = '#' + h; //Go to the target element.
|
|
43
|
+
history.replaceState(null, '', url); //Don't like hashes. Changing it back.
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
@singleton()
|
|
47
|
+
@view(SettingTreeFactoryId, FileTreeViewModule)
|
|
48
|
+
export class SettingTreeView extends FileTreeView {
|
|
49
|
+
protected command: CommandRegistry;
|
|
50
|
+
override readonly props: TreeProps;
|
|
51
|
+
override readonly model: FileTreeModel;
|
|
52
|
+
override readonly treeViewDecorator: TreeViewDecorator;
|
|
53
|
+
override readonly selectionService: SelectionService;
|
|
54
|
+
override readonly labelProvider: LabelProvider;
|
|
55
|
+
protected override readonly decoratorService: TreeDecoratorService;
|
|
56
|
+
|
|
57
|
+
constructor(
|
|
58
|
+
@inject(CommandRegistry) command: CommandRegistry,
|
|
59
|
+
@inject(TreeProps) props: TreeProps,
|
|
60
|
+
@inject(FileTreeModel) model: FileTreeModel,
|
|
61
|
+
@inject(TreeViewDecorator) treeViewDecorator: TreeViewDecorator,
|
|
62
|
+
@inject(SelectionService) selectionService: SelectionService,
|
|
63
|
+
@inject(LabelProvider) labelProvider: LabelProvider,
|
|
64
|
+
@inject(TreeDecoratorService)
|
|
65
|
+
decoratorService: TreeDecoratorService,
|
|
66
|
+
) {
|
|
67
|
+
super(
|
|
68
|
+
props,
|
|
69
|
+
model,
|
|
70
|
+
treeViewDecorator,
|
|
71
|
+
selectionService,
|
|
72
|
+
labelProvider,
|
|
73
|
+
decoratorService,
|
|
74
|
+
);
|
|
75
|
+
this.command = command;
|
|
76
|
+
this.props = props;
|
|
77
|
+
this.model = model;
|
|
78
|
+
this.treeViewDecorator = treeViewDecorator;
|
|
79
|
+
this.selectionService = selectionService;
|
|
80
|
+
this.labelProvider = labelProvider;
|
|
81
|
+
this.decoratorService = decoratorService;
|
|
82
|
+
|
|
83
|
+
this.className += ` libro-configuration-tree`;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
override handleClickEvent(
|
|
87
|
+
node: TreeNode | undefined,
|
|
88
|
+
event: React.MouseEvent<HTMLElement>,
|
|
89
|
+
): void {
|
|
90
|
+
if (node && FileStatNode.is(node) && node.fileStat.isFile) {
|
|
91
|
+
jump(node.fileStat.resource.path.base);
|
|
92
|
+
}
|
|
93
|
+
super.handleClickEvent(node, event);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ModalContribution, singleton, ToolbarContribution } from '@difizen/mana-app';
|
|
2
|
+
import type { ToolbarRegistry } from '@difizen/mana-app';
|
|
3
|
+
import { l10n } from '@difizen/mana-l10n';
|
|
4
|
+
|
|
5
|
+
import { DocumentCommands } from '../command/document-commands.js';
|
|
6
|
+
|
|
7
|
+
import { SettingsModal } from './settings-modal.js';
|
|
8
|
+
|
|
9
|
+
@singleton({ contrib: [ModalContribution, ToolbarContribution] })
|
|
10
|
+
export class SettingsContribution implements ModalContribution, ToolbarContribution {
|
|
11
|
+
registerModal() {
|
|
12
|
+
return SettingsModal;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
registerToolbarItems(registry: ToolbarRegistry) {
|
|
16
|
+
registry.registerItem({
|
|
17
|
+
id: DocumentCommands['OpenSettings'].id,
|
|
18
|
+
icon: DocumentCommands['OpenSettings'].icon,
|
|
19
|
+
command: DocumentCommands['OpenSettings'].id,
|
|
20
|
+
order: 'z',
|
|
21
|
+
tooltip: l10n.t('设置'),
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { ModalItem, ModalItemProps } from '@difizen/mana-app';
|
|
2
|
+
import { ConfigurationRegistry } from '@difizen/mana-app';
|
|
3
|
+
import { useInject, ViewManager, ViewRender } from '@difizen/mana-app';
|
|
4
|
+
import { l10n } from '@difizen/mana-l10n';
|
|
5
|
+
import { Modal } from 'antd';
|
|
6
|
+
import { useEffect, useState } from 'react';
|
|
7
|
+
|
|
8
|
+
import { ConfigurationPanelView } from './setting-editor/index.js';
|
|
9
|
+
import { LibroUserSettingsNamespace } from './settings-protocol.js';
|
|
10
|
+
import './settings-modal.less';
|
|
11
|
+
|
|
12
|
+
export function SettingsModalComponent({ visible, close }: ModalItemProps<void>) {
|
|
13
|
+
const viewManager = useInject(ViewManager);
|
|
14
|
+
const configRegistry = useInject(ConfigurationRegistry);
|
|
15
|
+
const [settingEditorView, setSettingEditorView] = useState<ConfigurationPanelView>();
|
|
16
|
+
|
|
17
|
+
useEffect(() => {
|
|
18
|
+
viewManager
|
|
19
|
+
.getOrCreateView<ConfigurationPanelView>(ConfigurationPanelView)
|
|
20
|
+
.then((view) => {
|
|
21
|
+
const config = configRegistry.getConfigurationByNamespace(
|
|
22
|
+
[LibroUserSettingsNamespace],
|
|
23
|
+
false,
|
|
24
|
+
);
|
|
25
|
+
view.configurationNodes = config;
|
|
26
|
+
view.className = 'libro-settings-modal';
|
|
27
|
+
setSettingEditorView(view);
|
|
28
|
+
return;
|
|
29
|
+
})
|
|
30
|
+
.catch((e) => {
|
|
31
|
+
//
|
|
32
|
+
});
|
|
33
|
+
}, [configRegistry, viewManager]);
|
|
34
|
+
|
|
35
|
+
return (
|
|
36
|
+
<Modal
|
|
37
|
+
title={l10n.t('设置')}
|
|
38
|
+
open={visible}
|
|
39
|
+
onOk={() => close()}
|
|
40
|
+
onCancel={() => close()}
|
|
41
|
+
width={600}
|
|
42
|
+
>
|
|
43
|
+
{settingEditorView && <ViewRender view={settingEditorView} />}
|
|
44
|
+
</Modal>
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export const SettingsModal: ModalItem = {
|
|
49
|
+
id: 'settings.modal',
|
|
50
|
+
component: SettingsModalComponent,
|
|
51
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { Contribution } from '@difizen/mana-app';
|
|
2
|
+
import { SlotViewManager } from '@difizen/mana-app';
|
|
3
|
+
import { contrib, inject, singleton } from '@difizen/mana-app';
|
|
4
|
+
|
|
5
|
+
import type { LibroView } from '../libro-view.js';
|
|
6
|
+
|
|
7
|
+
import type { LibroSlot } from './libro-slot-protocol.js';
|
|
8
|
+
import { LibroExtensionSlotContribution } from './libro-slot-protocol.js';
|
|
9
|
+
|
|
10
|
+
@singleton()
|
|
11
|
+
export class LibroSlotManager {
|
|
12
|
+
@inject(SlotViewManager) slotViewManager: SlotViewManager;
|
|
13
|
+
protected readonly libroExtraProvider: Contribution.Provider<LibroExtensionSlotContribution>;
|
|
14
|
+
constructor(
|
|
15
|
+
@contrib(LibroExtensionSlotContribution)
|
|
16
|
+
libroExtraProvider: Contribution.Provider<LibroExtensionSlotContribution>,
|
|
17
|
+
) {
|
|
18
|
+
this.libroExtraProvider = libroExtraProvider;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
getSlotName(libro: LibroView, slot: LibroSlot): string {
|
|
22
|
+
return `libro-slot-${slot}-${libro.id}`;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
setup(libro: LibroView) {
|
|
26
|
+
this.libroExtraProvider.getContributions().forEach(async (item) => {
|
|
27
|
+
const extra = await item.factory(libro);
|
|
28
|
+
this.slotViewManager.addView(
|
|
29
|
+
extra,
|
|
30
|
+
this.getSlotName(libro, item.slot),
|
|
31
|
+
item.viewOpenOption,
|
|
32
|
+
);
|
|
33
|
+
libro.onDisposed(() => {
|
|
34
|
+
extra.dispose();
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
}
|