@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,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import '../index.less';
|
|
3
|
+
import type { CellView, DndItemProps } from '../libro-protocol.js';
|
|
4
|
+
import { CellExecutionTimeProvider, CellInputBottonBlankProvider, CellOutputVisulizationProvider } from './cell-protocol.js';
|
|
5
|
+
export declare const CellOutputContent: React.FC<{
|
|
6
|
+
cell: CellView;
|
|
7
|
+
}>;
|
|
8
|
+
export declare const LibroCellExecutionTime: CellExecutionTimeProvider;
|
|
9
|
+
export declare const LibroCellInputBottonBlank: CellInputBottonBlankProvider;
|
|
10
|
+
export declare const LibroCellVisualization: CellOutputVisulizationProvider;
|
|
11
|
+
export declare const DndCellItemContent: React.NamedExoticComponent<{
|
|
12
|
+
cell: CellView;
|
|
13
|
+
}>;
|
|
14
|
+
export declare const DndCellItemContainer: React.NamedExoticComponent<DndItemProps>;
|
|
15
|
+
export declare const DndCellItemRender: React.MemoExoticComponent<React.ForwardRefExoticComponent<DndItemProps & React.RefAttributes<HTMLDivElement>>>;
|
|
16
|
+
//# sourceMappingURL=dnd-cell-item-render.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dnd-cell-item-render.d.ts","sourceRoot":"","sources":["../../src/components/dnd-cell-item-render.tsx"],"names":[],"mappings":"AAcA,OAAO,KAA6D,MAAM,OAAO,CAAC;AAUlF,OAAO,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAkBnE,OAAO,EACL,yBAAyB,EACzB,4BAA4B,EAC5B,8BAA8B,EAC/B,MAAM,oBAAoB,CAAC;AA4E5B,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC;IAAE,IAAI,EAAE,QAAQ,CAAA;CAAE,CAoC1D,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,yBAIpC,CAAC;AAEF,eAAO,MAAM,yBAAyB,EAAE,4BAIvC,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,8BAIpC,CAAC;AAgKF,eAAO,MAAM,kBAAkB;UACvB,QAAQ;EA+Bd,CAAC;AAEH,eAAO,MAAM,oBAAoB,0CAgD/B,CAAC;AAyCH,eAAO,MAAM,iBAAiB,gHAA+B,CAAC"}
|
|
@@ -0,0 +1,364 @@
|
|
|
1
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
4
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
5
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
6
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
|
+
/* eslint-disable react-hooks/exhaustive-deps */
|
|
8
|
+
import { useConfigurationValue, CommandRegistry, equals, ToolbarRender, useInject, useObserve, ViewInstance, ViewRender } from '@difizen/mana-app';
|
|
9
|
+
import { Tooltip } from 'antd';
|
|
10
|
+
import classnames from 'classnames';
|
|
11
|
+
import React, { forwardRef, memo, useLayoutEffect, useMemo, useRef } from 'react';
|
|
12
|
+
import { EditorCellView, ExecutableCellModel, ExecutableCellView, isLibroCellModel } from "../cell/index.js";
|
|
13
|
+
import { CellCollapsible } from "../collapse-service.js";
|
|
14
|
+
import { NotebookCommands } from "../command/index.js";
|
|
15
|
+
import "../index.less";
|
|
16
|
+
import { isCellView, LibroToolbarArea } from "../libro-protocol.js";
|
|
17
|
+
import { CellSideToolbarVisible, CellTopToolbarSetting, CollapserClickActive, OutputScrollBtnVisiable } from "../libro-setting.js";
|
|
18
|
+
import { ArrowDown, ArrowRight, ContentMore, DisableOutputScroll, EnableOutputScroll } from "../material-from-designer.js";
|
|
19
|
+
import { hasErrorOutput } from "../output/index.js";
|
|
20
|
+
import { CellExecutionTimeProvider, CellInputBottonBlankProvider, CellOutputVisulizationProvider } from "./cell-protocol.js";
|
|
21
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
22
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
23
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
24
|
+
var CellInputContent = /*#__PURE__*/memo(function CellInputContent(props) {
|
|
25
|
+
var cell = props.cell;
|
|
26
|
+
var observableCell = useObserve(cell);
|
|
27
|
+
var CellExecutionTime = useInject(CellExecutionTimeProvider);
|
|
28
|
+
var CellInputBottonBlank = useInject(CellInputBottonBlankProvider);
|
|
29
|
+
if (!(observableCell !== null && observableCell !== void 0 && observableCell.view) || !isCellView(observableCell)) {
|
|
30
|
+
return null;
|
|
31
|
+
}
|
|
32
|
+
var isHidden = observableCell.hasInputHidden;
|
|
33
|
+
if (isHidden) {
|
|
34
|
+
return /*#__PURE__*/_jsx("div", {
|
|
35
|
+
className: "libro-input-hidden",
|
|
36
|
+
children: /*#__PURE__*/_jsx(ContentMore, {})
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
40
|
+
className: "libro-cell-input-content",
|
|
41
|
+
children: [/*#__PURE__*/_jsx(CellExecutionTime, {
|
|
42
|
+
cell: cell
|
|
43
|
+
}), /*#__PURE__*/_jsx(ViewRender, {
|
|
44
|
+
view: observableCell
|
|
45
|
+
}), /*#__PURE__*/_jsx(CellInputBottonBlank, {
|
|
46
|
+
cell: cell
|
|
47
|
+
})]
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
var CellInputInnner = /*#__PURE__*/forwardRef(function CellInput(props, ref) {
|
|
51
|
+
var cell = props.cell;
|
|
52
|
+
var observableCell = useObserve(cell);
|
|
53
|
+
var inputCollapserRef = useRef(null);
|
|
54
|
+
var _useConfigurationValu = useConfigurationValue(CollapserClickActive),
|
|
55
|
+
_useConfigurationValu2 = _slicedToArray(_useConfigurationValu, 1),
|
|
56
|
+
collapserClickActive = _useConfigurationValu2[0];
|
|
57
|
+
var handleCellInputCollapser = function handleCellInputCollapser() {
|
|
58
|
+
if (collapserClickActive) {
|
|
59
|
+
observableCell.hasInputHidden = !observableCell.hasInputHidden;
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
var hasErrorOutputs = EditorCellView.is(observableCell) ? hasErrorOutput(observableCell) : false;
|
|
63
|
+
// TODO: 性能!
|
|
64
|
+
// const isFirstCell = cell.parent.model.cells.indexOf(cell) === 0 ? true : false;
|
|
65
|
+
var isFirstCell = useMemo(function () {
|
|
66
|
+
return observableCell.parent.model.cells[0] && equals(observableCell.parent.model.cells[0], observableCell) ? true : false;
|
|
67
|
+
}, [observableCell]);
|
|
68
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
69
|
+
className: "libro-cell-container",
|
|
70
|
+
tabIndex: 10,
|
|
71
|
+
ref: ref,
|
|
72
|
+
children: [/*#__PURE__*/_jsx("div", {
|
|
73
|
+
className: "libro-cell-input-collapser ".concat(isFirstCell ? 'firstCell' : '', " ").concat(hasErrorOutputs ? 'error' : '', " "),
|
|
74
|
+
ref: inputCollapserRef,
|
|
75
|
+
onClick: handleCellInputCollapser
|
|
76
|
+
}), /*#__PURE__*/_jsx(CellInputContent, {
|
|
77
|
+
cell: observableCell
|
|
78
|
+
})]
|
|
79
|
+
});
|
|
80
|
+
});
|
|
81
|
+
var CellInput = /*#__PURE__*/memo(CellInputInnner);
|
|
82
|
+
export var CellOutputContent = /*#__PURE__*/memo(function CellOutputContent(props) {
|
|
83
|
+
var cell = props.cell;
|
|
84
|
+
var observableCell = useObserve(cell);
|
|
85
|
+
var CellOutputVisulization = useInject(CellOutputVisulizationProvider);
|
|
86
|
+
if (!ExecutableCellView.is(cell) || !ExecutableCellView.is(observableCell)) {
|
|
87
|
+
return null;
|
|
88
|
+
}
|
|
89
|
+
if (!ExecutableCellModel.is(observableCell.model)) {
|
|
90
|
+
return null;
|
|
91
|
+
}
|
|
92
|
+
var hasOutputsScrolled = observableCell.model.hasOutputsScrolled;
|
|
93
|
+
var isHidden = observableCell.model.hasOutputHidden;
|
|
94
|
+
if (isHidden) {
|
|
95
|
+
return /*#__PURE__*/_jsx("div", {
|
|
96
|
+
className: "libro-cell-output-hidden",
|
|
97
|
+
children: /*#__PURE__*/_jsx(ContentMore, {})
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
101
|
+
className: "libro-cell-output-content ".concat(hasOutputsScrolled ? 'scrolled' : '', " "),
|
|
102
|
+
children: [/*#__PURE__*/_jsx(CellOutputVisulization, {
|
|
103
|
+
cell: cell
|
|
104
|
+
}), /*#__PURE__*/_jsx(ViewRender, {
|
|
105
|
+
view: cell.outputArea
|
|
106
|
+
})]
|
|
107
|
+
});
|
|
108
|
+
});
|
|
109
|
+
export var LibroCellExecutionTime = /*#__PURE__*/forwardRef(function LibroCellExecutionTime() {
|
|
110
|
+
return null;
|
|
111
|
+
});
|
|
112
|
+
export var LibroCellInputBottonBlank = /*#__PURE__*/forwardRef(function LibroCellInputBottonBlank() {
|
|
113
|
+
return null;
|
|
114
|
+
});
|
|
115
|
+
export var LibroCellVisualization = /*#__PURE__*/forwardRef(function LibroCellVisualization() {
|
|
116
|
+
return null;
|
|
117
|
+
});
|
|
118
|
+
var CellOutput = /*#__PURE__*/forwardRef(function CellOutput(props, ref) {
|
|
119
|
+
var _cell$outputArea;
|
|
120
|
+
var cell = props.cell;
|
|
121
|
+
var outputRef = useRef(null);
|
|
122
|
+
var outputCollapserRef = useRef(null);
|
|
123
|
+
var _useConfigurationValu3 = useConfigurationValue(CollapserClickActive),
|
|
124
|
+
_useConfigurationValu4 = _slicedToArray(_useConfigurationValu3, 1),
|
|
125
|
+
collapserClickActive = _useConfigurationValu4[0];
|
|
126
|
+
var _useConfigurationValu5 = useConfigurationValue(OutputScrollBtnVisiable),
|
|
127
|
+
_useConfigurationValu6 = _slicedToArray(_useConfigurationValu5, 1),
|
|
128
|
+
outputScrollBtnVisiable = _useConfigurationValu6[0];
|
|
129
|
+
var command = useInject(CommandRegistry);
|
|
130
|
+
var isExecutingRef = useRef(null);
|
|
131
|
+
var executing = false;
|
|
132
|
+
if (ExecutableCellModel.is(cell.model)) {
|
|
133
|
+
executing = cell.model.executing;
|
|
134
|
+
}
|
|
135
|
+
useLayoutEffect(function () {
|
|
136
|
+
isExecutingRef.current = !!executing;
|
|
137
|
+
}, [executing]);
|
|
138
|
+
|
|
139
|
+
// useLayoutEffect(() => {
|
|
140
|
+
// if (!outputRef || !isExecutingRef || !outputRef?.current) {
|
|
141
|
+
// return () => {
|
|
142
|
+
// //
|
|
143
|
+
// };
|
|
144
|
+
// }
|
|
145
|
+
// const el = outputRef?.current;
|
|
146
|
+
|
|
147
|
+
// const resizeObserver = new ResizeObserver((entries) => {
|
|
148
|
+
// entries.forEach(() => {
|
|
149
|
+
// const outputAreaHeight = outputRef?.current?.clientHeight || 0;
|
|
150
|
+
// if (isExecutingRef.current && outputAreaHeight > 495) {
|
|
151
|
+
// command.executeCommand(NotebookCommands['EnableOutputScrolling'].id);
|
|
152
|
+
// }
|
|
153
|
+
// });
|
|
154
|
+
// });
|
|
155
|
+
|
|
156
|
+
// resizeObserver.observe(el as HTMLElement);
|
|
157
|
+
// return () => {
|
|
158
|
+
// resizeObserver.unobserve(el as HTMLElement);
|
|
159
|
+
// resizeObserver.disconnect();
|
|
160
|
+
// };
|
|
161
|
+
// }, [outputRef.current, cell, isExecutingRef]);
|
|
162
|
+
|
|
163
|
+
if (!ExecutableCellView.is(cell)) {
|
|
164
|
+
return null;
|
|
165
|
+
}
|
|
166
|
+
if (!isCellView(cell) || !ExecutableCellModel.is(cell.model) || !((_cell$outputArea = cell.outputArea) !== null && _cell$outputArea !== void 0 && _cell$outputArea.length)) {
|
|
167
|
+
return null;
|
|
168
|
+
}
|
|
169
|
+
var handleCellOutputCollapser = function handleCellOutputCollapser() {
|
|
170
|
+
if (ExecutableCellModel.is(cell.model) && collapserClickActive) {
|
|
171
|
+
cell.model.hasOutputHidden = !cell.model.hasOutputHidden;
|
|
172
|
+
}
|
|
173
|
+
};
|
|
174
|
+
var handleOutputScroll = function handleOutputScroll() {
|
|
175
|
+
if (!ExecutableCellModel.is(cell.model)) {
|
|
176
|
+
return;
|
|
177
|
+
}
|
|
178
|
+
if (cell.model.hasOutputsScrolled) {
|
|
179
|
+
command.executeCommand(NotebookCommands['DisableOutputScrolling'].id);
|
|
180
|
+
} else {
|
|
181
|
+
command.executeCommand(NotebookCommands['EnableOutputScrolling'].id);
|
|
182
|
+
}
|
|
183
|
+
};
|
|
184
|
+
return /*#__PURE__*/_jsx("div", {
|
|
185
|
+
className: "libro-cell-output-container",
|
|
186
|
+
ref: ref,
|
|
187
|
+
children: /*#__PURE__*/_jsxs("div", {
|
|
188
|
+
ref: outputRef,
|
|
189
|
+
children: [/*#__PURE__*/_jsx("div", {
|
|
190
|
+
className: 'libro-cell-output-collapser',
|
|
191
|
+
ref: outputCollapserRef,
|
|
192
|
+
onClick: handleCellOutputCollapser
|
|
193
|
+
}), outputScrollBtnVisiable && /*#__PURE__*/_jsx("div", {
|
|
194
|
+
className: "libro-cell-output-scroll",
|
|
195
|
+
children: /*#__PURE__*/_jsx(Tooltip, {
|
|
196
|
+
title: "".concat(cell.model.hasOutputsScrolled ? '取消固定 Output 高度' : '固定 Output 高度'),
|
|
197
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
198
|
+
className: "libro-cell-output-scroll-button ",
|
|
199
|
+
onClick: handleOutputScroll,
|
|
200
|
+
children: cell.model.hasOutputsScrolled ? /*#__PURE__*/_jsx(DisableOutputScroll, {}) : /*#__PURE__*/_jsx(EnableOutputScroll, {})
|
|
201
|
+
})
|
|
202
|
+
})
|
|
203
|
+
}), /*#__PURE__*/_jsx(CellOutputContent, {
|
|
204
|
+
cell: cell
|
|
205
|
+
})]
|
|
206
|
+
})
|
|
207
|
+
});
|
|
208
|
+
});
|
|
209
|
+
var HideCellContent = function HideCellContent(props) {
|
|
210
|
+
var cell = props.cell;
|
|
211
|
+
var cellCollapserRef = useRef(null);
|
|
212
|
+
var _useConfigurationValu7 = useConfigurationValue(CollapserClickActive),
|
|
213
|
+
_useConfigurationValu8 = _slicedToArray(_useConfigurationValu7, 1),
|
|
214
|
+
collapserClickActive = _useConfigurationValu8[0];
|
|
215
|
+
var handleCellCollapser = function handleCellCollapser() {
|
|
216
|
+
if (collapserClickActive) {
|
|
217
|
+
cell.hasInputHidden = !cell.hasInputHidden;
|
|
218
|
+
}
|
|
219
|
+
};
|
|
220
|
+
var hasErrorOutputs = hasErrorOutput(cell);
|
|
221
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
222
|
+
children: [/*#__PURE__*/_jsx("div", {
|
|
223
|
+
className: "libro-cell-collapser ".concat(hasErrorOutputs ? 'error' : ''),
|
|
224
|
+
ref: cellCollapserRef,
|
|
225
|
+
onClick: handleCellCollapser
|
|
226
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
227
|
+
className: "libro-cell-hidden",
|
|
228
|
+
children: /*#__PURE__*/_jsx(ContentMore, {})
|
|
229
|
+
})]
|
|
230
|
+
});
|
|
231
|
+
};
|
|
232
|
+
var ExecuteTooltipArea = /*#__PURE__*/memo(function ExecuteTooltipArea(props) {
|
|
233
|
+
var isMouseOverDragArea = props.isMouseOverDragArea,
|
|
234
|
+
cell = props.cell;
|
|
235
|
+
var observableCell = useObserve(cell);
|
|
236
|
+
var executable = ExecutableCellModel.is(observableCell.model);
|
|
237
|
+
var executeState = ExecutableCellModel.is(observableCell.model) && !observableCell.model.executing ? observableCell.model.executeCount || ' ' : '*';
|
|
238
|
+
return /*#__PURE__*/_jsx(_Fragment, {
|
|
239
|
+
children: executable && !isMouseOverDragArea && /*#__PURE__*/_jsx("div", {
|
|
240
|
+
className: "libro-execute-tooltip-area",
|
|
241
|
+
children: /*#__PURE__*/_jsx("pre", {
|
|
242
|
+
className: "libro-execute-state-tip",
|
|
243
|
+
children: "[".concat(executeState, "]:")
|
|
244
|
+
})
|
|
245
|
+
})
|
|
246
|
+
});
|
|
247
|
+
});
|
|
248
|
+
export var DndCellItemContent = /*#__PURE__*/memo(function DndCellItemContent(props) {
|
|
249
|
+
var instance = useInject(ViewInstance);
|
|
250
|
+
var cell = props.cell;
|
|
251
|
+
var observableCell = useObserve(cell);
|
|
252
|
+
var isCollapsible = CellCollapsible.is(observableCell);
|
|
253
|
+
var hasCellHidden = useMemo(function () {
|
|
254
|
+
return observableCell.hasCellHidden();
|
|
255
|
+
}, [observableCell]);
|
|
256
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
257
|
+
children: [hasCellHidden && /*#__PURE__*/_jsx(HideCellContent, {
|
|
258
|
+
cell: observableCell
|
|
259
|
+
}), !hasCellHidden && /*#__PURE__*/_jsxs(_Fragment, {
|
|
260
|
+
children: [instance.collapserVisible && isCollapsible && /*#__PURE__*/_jsx("div", {
|
|
261
|
+
className: "libro-markdown-collapser",
|
|
262
|
+
onClick: function onClick() {
|
|
263
|
+
instance.collapseCell(observableCell, !observableCell.headingCollapsed);
|
|
264
|
+
},
|
|
265
|
+
children: observableCell.headingCollapsed ? /*#__PURE__*/_jsx(ArrowRight, {}) : /*#__PURE__*/_jsx(ArrowDown, {})
|
|
266
|
+
}), /*#__PURE__*/_jsx(CellInput, {
|
|
267
|
+
cell: observableCell
|
|
268
|
+
}), /*#__PURE__*/_jsx(CellOutput, {
|
|
269
|
+
cell: observableCell
|
|
270
|
+
})]
|
|
271
|
+
})]
|
|
272
|
+
});
|
|
273
|
+
});
|
|
274
|
+
export var DndCellItemContainer = /*#__PURE__*/memo(function DndCellItemContainer(props) {
|
|
275
|
+
var _instance$activeCell;
|
|
276
|
+
var isDrag = props.isDrag,
|
|
277
|
+
isMouseOverDragArea = props.isMouseOverDragArea,
|
|
278
|
+
cell = props.cell;
|
|
279
|
+
var _useConfigurationValu9 = useConfigurationValue(CellTopToolbarSetting),
|
|
280
|
+
_useConfigurationValu10 = _slicedToArray(_useConfigurationValu9, 1),
|
|
281
|
+
topToolbarVisible = _useConfigurationValu10[0];
|
|
282
|
+
var _useConfigurationValu11 = useConfigurationValue(CellSideToolbarVisible),
|
|
283
|
+
_useConfigurationValu12 = _slicedToArray(_useConfigurationValu11, 1),
|
|
284
|
+
sideToolbarVisible = _useConfigurationValu12[0];
|
|
285
|
+
var instance = useInject(ViewInstance);
|
|
286
|
+
var isActive = ((_instance$activeCell = instance.activeCell) === null || _instance$activeCell === void 0 ? void 0 : _instance$activeCell.id) === cell.id;
|
|
287
|
+
var topToolbarArgs = useMemo(function () {
|
|
288
|
+
return [cell, instance, LibroToolbarArea.CellTop];
|
|
289
|
+
}, [cell, instance]);
|
|
290
|
+
var rightToolbarArgs = useMemo(function () {
|
|
291
|
+
return [cell, instance, LibroToolbarArea.CellRight];
|
|
292
|
+
}, [cell, instance]);
|
|
293
|
+
if (!isLibroCellModel(cell.model)) {
|
|
294
|
+
return null;
|
|
295
|
+
}
|
|
296
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
297
|
+
children: [topToolbarVisible && isActive && /*#__PURE__*/_jsx("div", {
|
|
298
|
+
className: "libro-cell-top-toolbar",
|
|
299
|
+
children: /*#__PURE__*/_jsx(ToolbarRender, {
|
|
300
|
+
data: topToolbarArgs
|
|
301
|
+
})
|
|
302
|
+
}), /*#__PURE__*/_jsx(ExecuteTooltipArea, {
|
|
303
|
+
cell: cell,
|
|
304
|
+
isMouseOverDragArea: isMouseOverDragArea
|
|
305
|
+
}), /*#__PURE__*/_jsx(DndCellItemContent, {
|
|
306
|
+
cell: cell
|
|
307
|
+
}), sideToolbarVisible && /*#__PURE__*/_jsx("div", {
|
|
308
|
+
className: "libro-cell-right-toolbar",
|
|
309
|
+
tabIndex: 0,
|
|
310
|
+
onFocus: function onFocus(e) {
|
|
311
|
+
e.stopPropagation();
|
|
312
|
+
},
|
|
313
|
+
children: isActive && !isDrag && instance.model.cellsEditable && /*#__PURE__*/_jsx(ToolbarRender, {
|
|
314
|
+
data: rightToolbarArgs,
|
|
315
|
+
tooltip: {
|
|
316
|
+
placement: LibroToolbarArea.CellRight
|
|
317
|
+
}
|
|
318
|
+
})
|
|
319
|
+
})]
|
|
320
|
+
});
|
|
321
|
+
});
|
|
322
|
+
var DndCellItemRenderInner = /*#__PURE__*/forwardRef(function DndCellItemRender(props, ref) {
|
|
323
|
+
var _instance$activeCell2;
|
|
324
|
+
var isDrag = props.isDrag,
|
|
325
|
+
isMouseOverDragArea = props.isMouseOverDragArea,
|
|
326
|
+
cell = props.cell,
|
|
327
|
+
isDragOver = props.isDragOver;
|
|
328
|
+
var observableCell = useObserve(cell);
|
|
329
|
+
var instance = useInject(ViewInstance);
|
|
330
|
+
var isActive = ((_instance$activeCell2 = instance.activeCell) === null || _instance$activeCell2 === void 0 ? void 0 : _instance$activeCell2.id) === observableCell.id;
|
|
331
|
+
var hasErrorOutputs = hasErrorOutput(observableCell);
|
|
332
|
+
var hasCellHidden = useMemo(function () {
|
|
333
|
+
return observableCell.hasCellHidden();
|
|
334
|
+
}, [observableCell]);
|
|
335
|
+
var classNames = ['libro-dnd-cell', {
|
|
336
|
+
active: isActive
|
|
337
|
+
}, {
|
|
338
|
+
'command-mode': instance.model.commandMode
|
|
339
|
+
}, {
|
|
340
|
+
'edit-mode': !instance.model.commandMode
|
|
341
|
+
}, {
|
|
342
|
+
error: hasErrorOutputs
|
|
343
|
+
}, {
|
|
344
|
+
hidden: hasCellHidden
|
|
345
|
+
}];
|
|
346
|
+
if (observableCell.wrapperCls) {
|
|
347
|
+
classNames.push(observableCell.wrapperCls);
|
|
348
|
+
}
|
|
349
|
+
return /*#__PURE__*/_jsx("div", {
|
|
350
|
+
className: "libro-dnd-cell-border",
|
|
351
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
352
|
+
className: classnames(classNames),
|
|
353
|
+
ref: ref,
|
|
354
|
+
children: /*#__PURE__*/_jsx(DndCellItemContainer, {
|
|
355
|
+
cell: observableCell,
|
|
356
|
+
isDrag: isDrag,
|
|
357
|
+
isDragOver: isDragOver,
|
|
358
|
+
isMouseOverDragArea: isMouseOverDragArea
|
|
359
|
+
// ref={ref}
|
|
360
|
+
})
|
|
361
|
+
})
|
|
362
|
+
});
|
|
363
|
+
});
|
|
364
|
+
export var DndCellItemRender = /*#__PURE__*/memo(DndCellItemRenderInner);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { FC } from 'react';
|
|
2
|
+
import type { CellView } from '../../libro-protocol.js';
|
|
3
|
+
export interface SelectionPreviewProps {
|
|
4
|
+
activeCell: CellView;
|
|
5
|
+
}
|
|
6
|
+
export declare const MultipleSelectionPreviewMemo: FC<SelectionPreviewProps>;
|
|
7
|
+
export declare const SingleSelectionPreviewMemo: FC<SelectionPreviewProps>;
|
|
8
|
+
export declare const CustomDragLayer: () => import("react/jsx-runtime").JSX.Element | null;
|
|
9
|
+
//# sourceMappingURL=custom-drag-layer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"custom-drag-layer.d.ts","sourceRoot":"","sources":["../../../src/components/dnd-component/custom-drag-layer.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,EAAE,EAAiB,MAAM,OAAO,CAAC;AAO/C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAGxD,MAAM,WAAW,qBAAqB;IACpC,UAAU,EAAE,QAAQ,CAAC;CACtB;AAoDD,eAAO,MAAM,4BAA4B,EAAE,EAAE,CAAC,qBAAqB,CAElE,CAAC;AA+BF,eAAO,MAAM,0BAA0B,EAAE,EAAE,CAAC,qBAAqB,CAEhE,CAAC;AAEF,eAAO,MAAM,eAAe,sDAuC3B,CAAC"}
|
|
@@ -0,0 +1,140 @@
|
|
|
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
|
+
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; }
|
|
3
|
+
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; }
|
|
4
|
+
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; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
+
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); }
|
|
7
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
8
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
9
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
10
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
11
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
12
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
13
|
+
/* eslint-disable react-hooks/exhaustive-deps */
|
|
14
|
+
import { useInject, ViewInstance } from '@difizen/mana-app';
|
|
15
|
+
import { ViewRender } from '@difizen/mana-app';
|
|
16
|
+
import { useState, useEffect, memo } from 'react';
|
|
17
|
+
import { useDragLayer } from 'react-dnd';
|
|
18
|
+
import { LibroCellService } from "../../cell/index.js";
|
|
19
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
20
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
21
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
22
|
+
var layerStyles = {
|
|
23
|
+
position: 'fixed',
|
|
24
|
+
pointerEvents: 'none',
|
|
25
|
+
zIndex: 1000,
|
|
26
|
+
left: 0,
|
|
27
|
+
top: 0,
|
|
28
|
+
width: '300px',
|
|
29
|
+
height: '50px'
|
|
30
|
+
};
|
|
31
|
+
var getItemStyles = function getItemStyles(currentOffset) {
|
|
32
|
+
if (!currentOffset) {
|
|
33
|
+
return {
|
|
34
|
+
display: 'none'
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
var x = currentOffset.x,
|
|
38
|
+
y = currentOffset.y;
|
|
39
|
+
var transform = "translate(".concat(x, "px, ").concat(y, "px)");
|
|
40
|
+
return {
|
|
41
|
+
transform: transform,
|
|
42
|
+
WebkitTransform: transform
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
var MultipleSelectionPreview = function MultipleSelectionPreview(_ref) {
|
|
46
|
+
var activeCell = _ref.activeCell;
|
|
47
|
+
var cellService = useInject(LibroCellService);
|
|
48
|
+
var _useState = useState(),
|
|
49
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
50
|
+
multipleSelectionPreview = _useState2[0],
|
|
51
|
+
setMultipleSelectionPreview = _useState2[1];
|
|
52
|
+
useEffect(function () {
|
|
53
|
+
cellService.getOrCreateView(activeCell.model.options, activeCell.parent.id).then(function (view) {
|
|
54
|
+
setMultipleSelectionPreview(view);
|
|
55
|
+
return;
|
|
56
|
+
}).catch(function (e) {
|
|
57
|
+
//
|
|
58
|
+
});
|
|
59
|
+
}, []);
|
|
60
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
61
|
+
className: "libro-dnd-multiple-selection-preview",
|
|
62
|
+
children: [/*#__PURE__*/_jsx("div", {
|
|
63
|
+
className: "libro-dnd-active-selection",
|
|
64
|
+
children: multipleSelectionPreview && /*#__PURE__*/_jsx(ViewRender, {
|
|
65
|
+
view: multipleSelectionPreview
|
|
66
|
+
})
|
|
67
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
68
|
+
className: "libro-dnd-cascading-multiple-selection"
|
|
69
|
+
})]
|
|
70
|
+
});
|
|
71
|
+
};
|
|
72
|
+
export var MultipleSelectionPreviewMemo = /*#__PURE__*/memo(MultipleSelectionPreview);
|
|
73
|
+
var SingleSelectionDragPreview = function SingleSelectionDragPreview(_ref2) {
|
|
74
|
+
var activeCell = _ref2.activeCell;
|
|
75
|
+
var cellService = useInject(LibroCellService);
|
|
76
|
+
var _useState3 = useState(),
|
|
77
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
78
|
+
singleSelectionPreview = _useState4[0],
|
|
79
|
+
setSingleSelectionPreview = _useState4[1];
|
|
80
|
+
useEffect(function () {
|
|
81
|
+
cellService.getOrCreateView(_objectSpread(_objectSpread({}, activeCell.model.options), {}, {
|
|
82
|
+
modelId: activeCell.model.id,
|
|
83
|
+
singleSelectionDragPreview: true
|
|
84
|
+
}), activeCell.parent.id).then(function (view) {
|
|
85
|
+
setSingleSelectionPreview(view);
|
|
86
|
+
return;
|
|
87
|
+
}).catch(function (e) {
|
|
88
|
+
//
|
|
89
|
+
});
|
|
90
|
+
}, []);
|
|
91
|
+
return /*#__PURE__*/_jsx("div", {
|
|
92
|
+
className: "libro-dnd-active-selection",
|
|
93
|
+
children: singleSelectionPreview && /*#__PURE__*/_jsx(ViewRender, {
|
|
94
|
+
view: singleSelectionPreview
|
|
95
|
+
})
|
|
96
|
+
});
|
|
97
|
+
};
|
|
98
|
+
export var SingleSelectionPreviewMemo = /*#__PURE__*/memo(SingleSelectionDragPreview);
|
|
99
|
+
export var CustomDragLayer = function CustomDragLayer() {
|
|
100
|
+
var _useDragLayer = useDragLayer(function (monitor) {
|
|
101
|
+
return {
|
|
102
|
+
item: monitor.getItem(),
|
|
103
|
+
itemType: monitor.getItemType(),
|
|
104
|
+
currentOffset: monitor.getClientOffset(),
|
|
105
|
+
isDragging: monitor.isDragging()
|
|
106
|
+
};
|
|
107
|
+
}),
|
|
108
|
+
isDragging = _useDragLayer.isDragging,
|
|
109
|
+
item = _useDragLayer.item,
|
|
110
|
+
currentOffset = _useDragLayer.currentOffset;
|
|
111
|
+
var instance = useInject(ViewInstance);
|
|
112
|
+
function renderItem() {
|
|
113
|
+
var isItemSelected = instance.model.selections.findIndex(function (select) {
|
|
114
|
+
return select.id === item.cell.id;
|
|
115
|
+
}) >= 0;
|
|
116
|
+
if (instance.model.selections.length !== 0 && isItemSelected) {
|
|
117
|
+
return /*#__PURE__*/_jsx(_Fragment, {
|
|
118
|
+
children: instance.model.active && /*#__PURE__*/_jsx(MultipleSelectionPreviewMemo, {
|
|
119
|
+
activeCell: instance.model.active
|
|
120
|
+
})
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
return /*#__PURE__*/_jsx(_Fragment, {
|
|
124
|
+
children: instance.model.active && /*#__PURE__*/_jsx(SingleSelectionPreviewMemo, {
|
|
125
|
+
activeCell: instance.model.active
|
|
126
|
+
})
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
if (!isDragging) {
|
|
130
|
+
return null;
|
|
131
|
+
}
|
|
132
|
+
return /*#__PURE__*/_jsx("div", {
|
|
133
|
+
className: "libro-custom-drag-layer",
|
|
134
|
+
style: layerStyles,
|
|
135
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
136
|
+
style: getItemStyles(currentOffset),
|
|
137
|
+
children: renderItem()
|
|
138
|
+
})
|
|
139
|
+
});
|
|
140
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import 'resize-observer-polyfill';
|
|
3
|
+
import type { CellView, DndContentProps } from '../../libro-protocol.js';
|
|
4
|
+
import { BetweenCellProvider } from '../cell-protocol.js';
|
|
5
|
+
export interface Dragparams {
|
|
6
|
+
cell: CellView;
|
|
7
|
+
index: number;
|
|
8
|
+
}
|
|
9
|
+
export declare const DndCellContainer: React.FC<DndContentProps>;
|
|
10
|
+
export declare const LibroBetweenCellContent: BetweenCellProvider;
|
|
11
|
+
//# sourceMappingURL=default-dnd-content.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"default-dnd-content.d.ts","sourceRoot":"","sources":["../../../src/components/dnd-component/default-dnd-content.tsx"],"names":[],"mappings":"AAIA,OAAO,KAQN,MAAM,OAAO,CAAC;AAGf,OAAO,0BAA0B,CAAC;AAMlC,OAAO,KAAK,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAIzE,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAE1D,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,QAAQ,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf;AAED,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAmStD,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,mBAIrC,CAAC"}
|