@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 @@
|
|
|
1
|
+
{"version":3,"file":"libro-edit-cell-view.d.ts","sourceRoot":"","sources":["../../src/cell/libro-edit-cell-view.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,qBAAqB,EACrB,OAAO,EACR,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAE/D,OAAO,EAEL,oBAAoB,EAOrB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,KAAK,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAGpD,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAErD,MAAM,WAAW,cAAe,SAAQ,QAAQ;IAC9C,MAAM,EAAE,OAAO,GAAG,SAAS,CAAC;IAE5B,IAAI,EAAE,MAAM,IAAI,CAAC;IAEjB,IAAI,EAAE,MAAM,IAAI,CAAC;IAEjB,YAAY,EAAE,MAAM,SAAS,CAAC;CAC/B;AAED,eAAO,MAAM,cAAc;cACf,OAAO,GAAG,EAAE,GAAG,CAAC,GAAG,SAAS;CAWvC,CAAC;AAEF;;;GAGG;AACH,8BAAsB,mBACpB,SAAQ,aACR,YAAW,cAAc;IAEzB,SAAS,CAAC,iBAAiB,uBAA8B;IAEzD,MAAM,EAAE,OAAO,GAAG,SAAS,CAAC;IAEH,SAAS,CAAC,QAAQ,CAAC,eAAe,EAAE,eAAe,CAAC;IAClD,iBAAiB,EAAE,iBAAiB,CAAC;IAGhE,UAAU,CAAC,EAAE,cAAc,CAAC;gBAGN,OAAO,EAAE,eAAe,EACvB,WAAW,EAAE,WAAW;IAK/C,SAAS,CAAC,eAAe,IAAI,qBAAqB;cAalC,gBAAgB;IAoB1B,YAAY;IA2BlB,YAAY,EAAE,YAAY,CAA0B;IAEpD,YAAY,uDAKV;IAEO,WAAW;IAQX,qBAAqB,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC;IAQ/D,SAAS,CAAC,WAAW;IAgBZ,KAAK,WAAY,OAAO,UAS/B;IAEO,IAAI,aAGX;IAEF,IAAI,UAAU,WAEb;IAED,IAAI,IAAI,IAAI;IAIZ,IAAI,IAAI,IAAI;CAGb"}
|
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
var _dec, _dec2, _dec3, _dec4, _dec5, _class, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5;
|
|
3
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
4
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
5
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
6
|
+
function _initializerDefineProperty(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); }
|
|
7
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
8
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
9
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
10
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
11
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
12
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
13
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
14
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
15
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
16
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
17
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
18
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
19
|
+
function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object.keys(descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object.defineProperty(target, property, desc); desc = null; } return desc; }
|
|
20
|
+
function _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that ' + 'transform-class-properties is enabled and runs after the decorators transform.'); }
|
|
21
|
+
import { CodeEditorManager } from '@difizen/libro-code-editor';
|
|
22
|
+
import { CellUri } from '@difizen/libro-common';
|
|
23
|
+
import { Disposable, DisposableCollection, getOrigin, inject, prop, ViewOption, ViewRender, watch } from '@difizen/mana-app';
|
|
24
|
+
import { LibroContextKey } from "../libro-context-key.js";
|
|
25
|
+
import { EditorStatus } from "../libro-protocol.js";
|
|
26
|
+
import { isCellView } from "../libro-protocol.js";
|
|
27
|
+
import { CellService } from "./libro-cell-protocol.js";
|
|
28
|
+
import { LibroCellView } from "./libro-cell-view.js";
|
|
29
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
30
|
+
export var EditorCellView = {
|
|
31
|
+
is: function is(arg) {
|
|
32
|
+
return !!arg && isCellView(arg) &&
|
|
33
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
34
|
+
'redo' in arg && typeof arg.redo === 'function' && 'undo' in arg && typeof arg.undo === 'function';
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* 带有编辑器能力的cell view,例如raw、markdown、python、sql等
|
|
40
|
+
* 超出编辑器的相关能力放在其他的更高抽象中
|
|
41
|
+
*/
|
|
42
|
+
export var LibroEditorCellView = (_dec = prop(), _dec2 = inject(LibroContextKey), _dec3 = inject(CodeEditorManager), _dec4 = prop(), _dec5 = prop(), (_class = /*#__PURE__*/function (_LibroCellView) {
|
|
43
|
+
_inherits(LibroEditorCellView, _LibroCellView);
|
|
44
|
+
var _super = _createSuper(LibroEditorCellView);
|
|
45
|
+
function LibroEditorCellView(options, cellService) {
|
|
46
|
+
var _this;
|
|
47
|
+
_classCallCheck(this, LibroEditorCellView);
|
|
48
|
+
_this = _super.call(this, options, cellService);
|
|
49
|
+
_this.toDisposeOnEditor = new DisposableCollection();
|
|
50
|
+
_initializerDefineProperty(_this, "editor", _descriptor, _assertThisInitialized(_this));
|
|
51
|
+
_initializerDefineProperty(_this, "libroContextKey", _descriptor2, _assertThisInitialized(_this));
|
|
52
|
+
_initializerDefineProperty(_this, "codeEditorManager", _descriptor3, _assertThisInitialized(_this));
|
|
53
|
+
_initializerDefineProperty(_this, "editorView", _descriptor4, _assertThisInitialized(_this));
|
|
54
|
+
_initializerDefineProperty(_this, "editorStatus", _descriptor5, _assertThisInitialized(_this));
|
|
55
|
+
_this.renderEditor = function () {
|
|
56
|
+
if (_this.editorView) {
|
|
57
|
+
return /*#__PURE__*/_jsx(ViewRender, {
|
|
58
|
+
view: _this.editorView
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
return null;
|
|
62
|
+
};
|
|
63
|
+
_this.focus = function (toEdit) {
|
|
64
|
+
if (toEdit) {
|
|
65
|
+
_this.focusEditor();
|
|
66
|
+
} else {
|
|
67
|
+
var _this$container, _this$container2;
|
|
68
|
+
if ((_this$container = _this.container) !== null && _this$container !== void 0 && (_this$container = _this$container.current) !== null && _this$container !== void 0 && (_this$container = _this$container.parentElement) !== null && _this$container !== void 0 && _this$container.contains(document.activeElement)) {
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
(_this$container2 = _this.container) === null || _this$container2 === void 0 || (_this$container2 = _this$container2.current) === null || _this$container2 === void 0 || (_this$container2 = _this$container2.parentElement) === null || _this$container2 === void 0 || _this$container2.focus();
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
_this.blur = function () {
|
|
75
|
+
var _this$editorView, _this$editorView2;
|
|
76
|
+
(_this$editorView = _this.editorView) === null || _this$editorView === void 0 || (_this$editorView = _this$editorView.editor) === null || _this$editorView === void 0 || _this$editorView.setOption('styleActiveLine', false);
|
|
77
|
+
(_this$editorView2 = _this.editorView) === null || _this$editorView2 === void 0 || (_this$editorView2 = _this$editorView2.editor) === null || _this$editorView2 === void 0 || _this$editorView2.setOption('highlightActiveLineGutter', false);
|
|
78
|
+
};
|
|
79
|
+
return _this;
|
|
80
|
+
}
|
|
81
|
+
LibroEditorCellView = inject(CellService)(LibroEditorCellView, undefined, 1) || LibroEditorCellView;
|
|
82
|
+
LibroEditorCellView = inject(ViewOption)(LibroEditorCellView, undefined, 0) || LibroEditorCellView;
|
|
83
|
+
_createClass(LibroEditorCellView, [{
|
|
84
|
+
key: "getEditorOption",
|
|
85
|
+
value: function getEditorOption() {
|
|
86
|
+
var option = {
|
|
87
|
+
uuid: CellUri.from(this.parent.model.id, this.model.id).toString(),
|
|
88
|
+
editorHostId: this.parent.id + this.id,
|
|
89
|
+
model: this.model,
|
|
90
|
+
config: {
|
|
91
|
+
readOnly: !this.parent.model.inputEditable,
|
|
92
|
+
editable: this.parent.model.inputEditable
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
return option;
|
|
96
|
+
}
|
|
97
|
+
}, {
|
|
98
|
+
key: "afterEditorReady",
|
|
99
|
+
value: function () {
|
|
100
|
+
var _afterEditorReady = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
101
|
+
var _this2 = this,
|
|
102
|
+
_this$editorView$onMo,
|
|
103
|
+
_this$editorView3,
|
|
104
|
+
_this$editor$onModelC,
|
|
105
|
+
_this$editor,
|
|
106
|
+
_this$editor$onModelC2;
|
|
107
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
108
|
+
while (1) switch (_context.prev = _context.next) {
|
|
109
|
+
case 0:
|
|
110
|
+
this.focusEditor();
|
|
111
|
+
this.toDisposeOnEditor.push(watch(this.parent.model, 'inputEditable', function () {
|
|
112
|
+
var _this2$editorView;
|
|
113
|
+
(_this2$editorView = _this2.editorView) === null || _this2$editorView === void 0 || (_this2$editorView = _this2$editorView.editor) === null || _this2$editorView === void 0 || _this2$editorView.setOption('readOnly', getOrigin(!_this2.parent.model.inputEditable));
|
|
114
|
+
}));
|
|
115
|
+
this.toDisposeOnEditor.push((_this$editorView$onMo = (_this$editorView3 = this.editorView) === null || _this$editorView3 === void 0 ? void 0 : _this$editorView3.onModalChange(function (val) {
|
|
116
|
+
return _this2.hasModal = val;
|
|
117
|
+
})) !== null && _this$editorView$onMo !== void 0 ? _this$editorView$onMo : Disposable.NONE);
|
|
118
|
+
this.toDisposeOnEditor.push((_this$editor$onModelC = (_this$editor = this.editor) === null || _this$editor === void 0 || (_this$editor$onModelC2 = _this$editor.onModelContentChanged) === null || _this$editor$onModelC2 === void 0 ? void 0 : _this$editor$onModelC2.call(_this$editor, function (e) {
|
|
119
|
+
_this2.parent.model.onCellContentChange({
|
|
120
|
+
cell: _this2,
|
|
121
|
+
changes: e
|
|
122
|
+
});
|
|
123
|
+
})) !== null && _this$editor$onModelC !== void 0 ? _this$editor$onModelC : Disposable.NONE);
|
|
124
|
+
case 4:
|
|
125
|
+
case "end":
|
|
126
|
+
return _context.stop();
|
|
127
|
+
}
|
|
128
|
+
}, _callee, this);
|
|
129
|
+
}));
|
|
130
|
+
function afterEditorReady() {
|
|
131
|
+
return _afterEditorReady.apply(this, arguments);
|
|
132
|
+
}
|
|
133
|
+
return afterEditorReady;
|
|
134
|
+
}()
|
|
135
|
+
}, {
|
|
136
|
+
key: "createEditor",
|
|
137
|
+
value: function () {
|
|
138
|
+
var _createEditor = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
139
|
+
var _this3 = this;
|
|
140
|
+
var option, editorView;
|
|
141
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
142
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
143
|
+
case 0:
|
|
144
|
+
option = this.getEditorOption();
|
|
145
|
+
this.editorStatus = EditorStatus.LOADING;
|
|
146
|
+
|
|
147
|
+
// 防止虚拟滚动中编辑器被频繁创建
|
|
148
|
+
if (!this.editorView) {
|
|
149
|
+
_context2.next = 5;
|
|
150
|
+
break;
|
|
151
|
+
}
|
|
152
|
+
this.editorStatus = EditorStatus.LOADED;
|
|
153
|
+
return _context2.abrupt("return");
|
|
154
|
+
case 5:
|
|
155
|
+
_context2.next = 7;
|
|
156
|
+
return this.codeEditorManager.getOrCreateEditorView(option);
|
|
157
|
+
case 7:
|
|
158
|
+
editorView = _context2.sent;
|
|
159
|
+
this.editorView = editorView;
|
|
160
|
+
this.editorStatus = EditorStatus.LOADED;
|
|
161
|
+
editorView.onEditorStatusChange(function (e) {
|
|
162
|
+
if (e.status === 'ready') {
|
|
163
|
+
_this3.editor = _this3.editorView.editor;
|
|
164
|
+
_this3.afterEditorReady();
|
|
165
|
+
} else if (e.status === 'disposed') {
|
|
166
|
+
_this3.toDisposeOnEditor.dispose();
|
|
167
|
+
}
|
|
168
|
+
});
|
|
169
|
+
case 11:
|
|
170
|
+
case "end":
|
|
171
|
+
return _context2.stop();
|
|
172
|
+
}
|
|
173
|
+
}, _callee2, this);
|
|
174
|
+
}));
|
|
175
|
+
function createEditor() {
|
|
176
|
+
return _createEditor.apply(this, arguments);
|
|
177
|
+
}
|
|
178
|
+
return createEditor;
|
|
179
|
+
}()
|
|
180
|
+
}, {
|
|
181
|
+
key: "onViewMount",
|
|
182
|
+
value: function onViewMount() {
|
|
183
|
+
var _this$parent$model$ac;
|
|
184
|
+
this.createEditor();
|
|
185
|
+
//选中cell时才focus
|
|
186
|
+
if (((_this$parent$model$ac = this.parent.model.active) === null || _this$parent$model$ac === void 0 ? void 0 : _this$parent$model$ac.id) === this.id) {
|
|
187
|
+
this.focus(!this.parent.model.commandMode);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
}, {
|
|
191
|
+
key: "shouldEnterEditorMode",
|
|
192
|
+
value: function shouldEnterEditorMode(e) {
|
|
193
|
+
var _getOrigin;
|
|
194
|
+
return (_getOrigin = getOrigin(this.editorView)) !== null && _getOrigin !== void 0 && (_getOrigin = _getOrigin.editor) !== null && _getOrigin !== void 0 && (_getOrigin = _getOrigin.host) !== null && _getOrigin !== void 0 && _getOrigin.contains(e.target) && this.parent.model.commandMode ? true : false;
|
|
195
|
+
}
|
|
196
|
+
}, {
|
|
197
|
+
key: "focusEditor",
|
|
198
|
+
value: function focusEditor() {
|
|
199
|
+
var _this$editorView4, _this$parent$model$ac2;
|
|
200
|
+
//选中cell、编辑模式、非只读时才focus
|
|
201
|
+
if ((_this$editorView4 = this.editorView) !== null && _this$editorView4 !== void 0 && _this$editorView4.editor && this.editorView.editorStatus === 'ready' && ((_this$parent$model$ac2 = this.parent.model.active) === null || _this$parent$model$ac2 === void 0 ? void 0 : _this$parent$model$ac2.id) === this.id && !this.parent.model.commandMode && this.libroContextKey.commandModeEnabled === true &&
|
|
202
|
+
// 排除弹窗等情况
|
|
203
|
+
this.parent.model.inputEditable) {
|
|
204
|
+
var _this$editorView5, _this$editorView6, _this$editorView7;
|
|
205
|
+
(_this$editorView5 = this.editorView) === null || _this$editorView5 === void 0 || _this$editorView5.editor.setOption('styleActiveLine', true);
|
|
206
|
+
(_this$editorView6 = this.editorView) === null || _this$editorView6 === void 0 || _this$editorView6.editor.setOption('highlightActiveLineGutter', true);
|
|
207
|
+
(_this$editorView7 = this.editorView) === null || _this$editorView7 === void 0 || _this$editorView7.editor.focus();
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
}, {
|
|
211
|
+
key: "wrapperCls",
|
|
212
|
+
get: function get() {
|
|
213
|
+
return '';
|
|
214
|
+
}
|
|
215
|
+
}, {
|
|
216
|
+
key: "redo",
|
|
217
|
+
value: function redo() {
|
|
218
|
+
var _this$editor2;
|
|
219
|
+
(_this$editor2 = this.editor) === null || _this$editor2 === void 0 || _this$editor2.redo();
|
|
220
|
+
}
|
|
221
|
+
}, {
|
|
222
|
+
key: "undo",
|
|
223
|
+
value: function undo() {
|
|
224
|
+
var _this$editor3;
|
|
225
|
+
(_this$editor3 = this.editor) === null || _this$editor3 === void 0 || _this$editor3.undo();
|
|
226
|
+
}
|
|
227
|
+
}]);
|
|
228
|
+
return LibroEditorCellView;
|
|
229
|
+
}(LibroCellView), (_descriptor = _applyDecoratedDescriptor(_class.prototype, "editor", [_dec], {
|
|
230
|
+
configurable: true,
|
|
231
|
+
enumerable: true,
|
|
232
|
+
writable: true,
|
|
233
|
+
initializer: null
|
|
234
|
+
}), _descriptor2 = _applyDecoratedDescriptor(_class.prototype, "libroContextKey", [_dec2], {
|
|
235
|
+
configurable: true,
|
|
236
|
+
enumerable: true,
|
|
237
|
+
writable: true,
|
|
238
|
+
initializer: null
|
|
239
|
+
}), _descriptor3 = _applyDecoratedDescriptor(_class.prototype, "codeEditorManager", [_dec3], {
|
|
240
|
+
configurable: true,
|
|
241
|
+
enumerable: true,
|
|
242
|
+
writable: true,
|
|
243
|
+
initializer: null
|
|
244
|
+
}), _descriptor4 = _applyDecoratedDescriptor(_class.prototype, "editorView", [_dec4], {
|
|
245
|
+
configurable: true,
|
|
246
|
+
enumerable: true,
|
|
247
|
+
writable: true,
|
|
248
|
+
initializer: null
|
|
249
|
+
}), _descriptor5 = _applyDecoratedDescriptor(_class.prototype, "editorStatus", [_dec5], {
|
|
250
|
+
configurable: true,
|
|
251
|
+
enumerable: true,
|
|
252
|
+
writable: true,
|
|
253
|
+
initializer: function initializer() {
|
|
254
|
+
return EditorStatus.NOTLOADED;
|
|
255
|
+
}
|
|
256
|
+
})), _class));
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ExecutionCount } from '@difizen/libro-common';
|
|
2
|
+
import type { Emitter } from '@difizen/mana-app';
|
|
3
|
+
export interface ExecutableCellModel {
|
|
4
|
+
executing: boolean;
|
|
5
|
+
executeCount: ExecutionCount;
|
|
6
|
+
hasOutputHidden: boolean;
|
|
7
|
+
hasOutputsScrolled: boolean;
|
|
8
|
+
msgChangeEmitter: Emitter<any>;
|
|
9
|
+
clearExecution: () => void;
|
|
10
|
+
}
|
|
11
|
+
export declare const ExecutableCellModel: {
|
|
12
|
+
is: (arg: Record<any, any> | undefined) => arg is ExecutableCellModel;
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=libro-executable-cell-model.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"libro-executable-cell-model.d.ts","sourceRoot":"","sources":["../../src/cell/libro-executable-cell-model.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAEjD,MAAM,WAAW,mBAAmB;IAElC,SAAS,EAAE,OAAO,CAAC;IAGnB,YAAY,EAAE,cAAc,CAAC;IAE7B,eAAe,EAAE,OAAO,CAAC;IAEzB,kBAAkB,EAAE,OAAO,CAAC;IAG5B,gBAAgB,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC;IAE/B,cAAc,EAAE,MAAM,IAAI,CAAC;CAC5B;AAED,eAAO,MAAM,mBAAmB;cACpB,OAAO,GAAG,EAAE,GAAG,CAAC,GAAG,SAAS;CAUvC,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export var ExecutableCellModel = {
|
|
2
|
+
is: function is(arg) {
|
|
3
|
+
return !!arg &&
|
|
4
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5
|
+
'executing' in arg && typeof arg.executing === 'boolean' && 'executeCount' in arg && (typeof arg.executeCount === 'number' || !arg.executeCount);
|
|
6
|
+
}
|
|
7
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { CellModel } from '../libro-protocol.js';
|
|
2
|
+
import type { CellViewOptions } from '../libro-protocol.js';
|
|
3
|
+
import type { BaseOutputArea } from '../output/index.js';
|
|
4
|
+
import { CellService } from './libro-cell-protocol.js';
|
|
5
|
+
import { EditorCellView, LibroEditorCellView } from './libro-edit-cell-view.js';
|
|
6
|
+
import { ExecutableCellModel } from './libro-executable-cell-model.js';
|
|
7
|
+
interface ExecutableCellView extends EditorCellView {
|
|
8
|
+
run: () => Promise<boolean>;
|
|
9
|
+
clearExecution: () => void;
|
|
10
|
+
outputArea: BaseOutputArea;
|
|
11
|
+
noEditorAreaHeight: number;
|
|
12
|
+
}
|
|
13
|
+
export declare const ExecutableCellView: {
|
|
14
|
+
is: (arg: Record<any, any> | undefined) => arg is ExecutableCellView;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* 带有编辑器、执行、output相关能力的cell view,例如python、sql
|
|
18
|
+
* model 必须为 ExecutableCellModel
|
|
19
|
+
*/
|
|
20
|
+
export declare abstract class LibroEditableExecutableCellView extends LibroEditorCellView implements ExecutableCellView {
|
|
21
|
+
model: CellModel & ExecutableCellModel;
|
|
22
|
+
outputArea: BaseOutputArea;
|
|
23
|
+
noEditorAreaHeight: number;
|
|
24
|
+
constructor(options: CellViewOptions, cellService: CellService);
|
|
25
|
+
clearExecution: () => void;
|
|
26
|
+
hasCellHidden(): boolean;
|
|
27
|
+
outputWatch(): void;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* @deprecated use LibroEditableExecutableCellView instead.
|
|
31
|
+
*/
|
|
32
|
+
export declare const LibroExecutableCellView: typeof LibroEditableExecutableCellView;
|
|
33
|
+
export {};
|
|
34
|
+
//# sourceMappingURL=libro-executable-cell-view.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"libro-executable-cell-view.d.ts","sourceRoot":"","sources":["../../src/cell/libro-executable-cell-view.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEzD,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChF,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAEvE,UAAU,kBAAmB,SAAQ,cAAc;IACjD,GAAG,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;IAC5B,cAAc,EAAE,MAAM,IAAI,CAAC;IAE3B,UAAU,EAAE,cAAc,CAAC;IAE3B,kBAAkB,EAAE,MAAM,CAAC;CAC5B;AAED,eAAO,MAAM,kBAAkB;cACnB,OAAO,GAAG,EAAE,GAAG,CAAC,GAAG,SAAS;CAYvC,CAAC;AAEF;;;GAGG;AACH,8BAAsB,+BACpB,SAAQ,mBACR,YAAW,kBAAkB;IAErB,KAAK,EAAE,SAAS,GAAG,mBAAmB,CAAC;IAE/C,UAAU,EAAE,cAAc,CAAC;IAEnB,kBAAkB,EAAE,MAAM,CAAC;gBAGb,OAAO,EAAE,eAAe,EACvB,WAAW,EAAE,WAAW;IAM/C,cAAc,EAAE,MAAM,IAAI,CAExB;IAGO,aAAa;IAUtB,WAAW;CAOZ;AAED;;GAEG;AACH,eAAO,MAAM,uBAAuB,wCAAkC,CAAC"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
2
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
3
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
4
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
5
|
+
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); }
|
|
6
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
7
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
8
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
9
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
10
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
11
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
12
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
13
|
+
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); }
|
|
14
|
+
import { watch } from '@difizen/mana-app';
|
|
15
|
+
import { ViewOption } from '@difizen/mana-app';
|
|
16
|
+
import { inject } from '@difizen/mana-app';
|
|
17
|
+
import { CellService } from "./libro-cell-protocol.js";
|
|
18
|
+
import { EditorCellView, LibroEditorCellView } from "./libro-edit-cell-view.js";
|
|
19
|
+
import { ExecutableCellModel } from "./libro-executable-cell-model.js";
|
|
20
|
+
export var ExecutableCellView = {
|
|
21
|
+
is: function is(arg) {
|
|
22
|
+
return !!arg && EditorCellView.is(arg) &&
|
|
23
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
24
|
+
'outputArea' in arg && _typeof(arg.outputArea) === 'object' && 'clearExecution' in arg && typeof arg.clearExecution === 'function' && typeof arg.run === 'function';
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* 带有编辑器、执行、output相关能力的cell view,例如python、sql
|
|
30
|
+
* model 必须为 ExecutableCellModel
|
|
31
|
+
*/
|
|
32
|
+
export var LibroEditableExecutableCellView = /*#__PURE__*/function (_LibroEditorCellView) {
|
|
33
|
+
_inherits(LibroEditableExecutableCellView, _LibroEditorCellView);
|
|
34
|
+
var _super = _createSuper(LibroEditableExecutableCellView);
|
|
35
|
+
function LibroEditableExecutableCellView(options, cellService) {
|
|
36
|
+
var _this;
|
|
37
|
+
_classCallCheck(this, LibroEditableExecutableCellView);
|
|
38
|
+
_this = _super.call(this, options, cellService);
|
|
39
|
+
_this.outputArea = void 0;
|
|
40
|
+
_this.clearExecution = function () {
|
|
41
|
+
//
|
|
42
|
+
};
|
|
43
|
+
_this.outputWatch();
|
|
44
|
+
return _this;
|
|
45
|
+
}
|
|
46
|
+
LibroEditableExecutableCellView = inject(CellService)(LibroEditableExecutableCellView, undefined, 1) || LibroEditableExecutableCellView;
|
|
47
|
+
LibroEditableExecutableCellView = inject(ViewOption)(LibroEditableExecutableCellView, undefined, 0) || LibroEditableExecutableCellView;
|
|
48
|
+
_createClass(LibroEditableExecutableCellView, [{
|
|
49
|
+
key: "hasCellHidden",
|
|
50
|
+
value:
|
|
51
|
+
// TODO: 性能!
|
|
52
|
+
function hasCellHidden() {
|
|
53
|
+
if (!ExecutableCellModel.is(this.model) || this.outputArea && this.outputArea.length < 1) {
|
|
54
|
+
return this.hasInputHidden;
|
|
55
|
+
}
|
|
56
|
+
return this.hasInputHidden && this.model.hasOutputHidden;
|
|
57
|
+
}
|
|
58
|
+
}, {
|
|
59
|
+
key: "outputWatch",
|
|
60
|
+
value: function outputWatch() {
|
|
61
|
+
var _this2 = this;
|
|
62
|
+
this.toDispose.push(watch(this.outputArea, 'outputs', function () {
|
|
63
|
+
var _this2$parent$model$o, _this2$parent$model;
|
|
64
|
+
(_this2$parent$model$o = (_this2$parent$model = _this2.parent.model).onChange) === null || _this2$parent$model$o === void 0 || _this2$parent$model$o.call(_this2$parent$model);
|
|
65
|
+
}));
|
|
66
|
+
}
|
|
67
|
+
}]);
|
|
68
|
+
return LibroEditableExecutableCellView;
|
|
69
|
+
}(LibroEditorCellView);
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* @deprecated use LibroEditableExecutableCellView instead.
|
|
73
|
+
*/
|
|
74
|
+
export var LibroExecutableCellView = LibroEditableExecutableCellView;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { CellModel } from '../libro-protocol.js';
|
|
2
|
+
export interface LibroMarkdownCellModel extends CellModel {
|
|
3
|
+
isEdit: boolean;
|
|
4
|
+
preview: string;
|
|
5
|
+
}
|
|
6
|
+
export declare const LibroMarkdownCellModel: {
|
|
7
|
+
is: (arg: Record<any, any> | undefined) => arg is LibroMarkdownCellModel;
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=libro-markdown-cell-model.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"libro-markdown-cell-model.d.ts","sourceRoot":"","sources":["../../src/cell/libro-markdown-cell-model.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEtD,MAAM,WAAW,sBAAuB,SAAQ,SAAS;IACvD,MAAM,EAAE,OAAO,CAAC;IAEhB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,sBAAsB;cACvB,OAAO,GAAG,EAAE,GAAG,CAAC,GAAG,SAAS;CAUvC,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { CellView } from './libro-protocol.js';
|
|
2
|
+
import type { LibroView } from './libro-view.js';
|
|
3
|
+
export interface CollapseServiceOption {
|
|
4
|
+
view: LibroView;
|
|
5
|
+
}
|
|
6
|
+
export declare const CollapseServiceOption: unique symbol;
|
|
7
|
+
export type CollapseServiceFactory = (option: CollapseServiceOption) => CollapseService;
|
|
8
|
+
export declare const CollapseServiceFactory: unique symbol;
|
|
9
|
+
export interface CellCollapsible {
|
|
10
|
+
/**
|
|
11
|
+
* 是否折叠子项
|
|
12
|
+
*/
|
|
13
|
+
headingCollapsed: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* 折叠的子项的数量
|
|
16
|
+
*/
|
|
17
|
+
collapsibleChildNumber: number;
|
|
18
|
+
}
|
|
19
|
+
export declare const CellCollapsible: {
|
|
20
|
+
is: (arg: Record<any, any> | undefined) => arg is CellCollapsible;
|
|
21
|
+
};
|
|
22
|
+
export interface CollapseService {
|
|
23
|
+
collapserVisible: boolean;
|
|
24
|
+
view: LibroView;
|
|
25
|
+
setHeadingCollapse: (cell: CellView, collapsing: boolean) => void;
|
|
26
|
+
getCollapsibleChildNumber: (cell: CellView) => number;
|
|
27
|
+
}
|
|
28
|
+
export declare const CollapseService: unique symbol;
|
|
29
|
+
export declare class DefaultCollapseService implements CollapseService {
|
|
30
|
+
collapserVisible: boolean;
|
|
31
|
+
view: LibroView;
|
|
32
|
+
constructor(option: CollapseServiceOption);
|
|
33
|
+
setHeadingCollapse(cell: CellView, collapsing: boolean): void;
|
|
34
|
+
getCollapsibleChildNumber(cell: CellView): number;
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=collapse-service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collapse-service.d.ts","sourceRoot":"","sources":["../src/collapse-service.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAEjD,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,SAAS,CAAC;CACjB;AACD,eAAO,MAAM,qBAAqB,eAAkC,CAAC;AAErE,MAAM,MAAM,sBAAsB,GAAG,CAAC,MAAM,EAAE,qBAAqB,KAAK,eAAe,CAAC;AACxF,eAAO,MAAM,sBAAsB,eAAmC,CAAC;AAEvE,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,gBAAgB,EAAE,OAAO,CAAC;IAC1B;;OAEG;IACH,sBAAsB,EAAE,MAAM,CAAC;CAChC;AAED,eAAO,MAAM,eAAe;cAChB,OAAO,GAAG,EAAE,GAAG,CAAC,GAAG,SAAS;CAQvC,CAAC;AAEF,MAAM,WAAW,eAAe;IAC9B,gBAAgB,EAAE,OAAO,CAAC;IAE1B,IAAI,EAAE,SAAS,CAAC;IAEhB,kBAAkB,EAAE,CAAC,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,OAAO,KAAK,IAAI,CAAC;IAElE,yBAAyB,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,MAAM,CAAC;CACvD;AAED,eAAO,MAAM,eAAe,eAA4B,CAAC;AAEzD,qBACa,sBAAuB,YAAW,eAAe;IAE5D,gBAAgB,UAAS;IAEzB,IAAI,EAAE,SAAS,CAAC;gBAE2B,MAAM,EAAE,qBAAqB;IAIxE,kBAAkB,CAAC,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,OAAO;IAOtD,yBAAyB,CAAC,IAAI,EAAE,QAAQ;CAGzC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
var _dec, _dec2, _class, _class2, _descriptor;
|
|
3
|
+
function _initializerDefineProperty(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); }
|
|
4
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
5
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
6
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
7
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
8
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
9
|
+
function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object.keys(descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object.defineProperty(target, property, desc); desc = null; } return desc; }
|
|
10
|
+
function _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that ' + 'transform-class-properties is enabled and runs after the decorators transform.'); }
|
|
11
|
+
import { inject, prop, transient } from '@difizen/mana-app';
|
|
12
|
+
export var CollapseServiceOption = Symbol('CollapseServiceOption');
|
|
13
|
+
export var CollapseServiceFactory = Symbol('CollapseServiceFactory');
|
|
14
|
+
export var CellCollapsible = {
|
|
15
|
+
is: function is(arg) {
|
|
16
|
+
return !!arg &&
|
|
17
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
18
|
+
'headingCollapsed' in arg && typeof arg.headingCollapsed === 'boolean';
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
export var CollapseService = Symbol('CollapseService');
|
|
22
|
+
export var DefaultCollapseService = (_dec = transient({
|
|
23
|
+
token: CollapseService
|
|
24
|
+
}), _dec2 = prop(), _dec(_class = (_class2 = /*#__PURE__*/function () {
|
|
25
|
+
function DefaultCollapseService(option) {
|
|
26
|
+
_classCallCheck(this, DefaultCollapseService);
|
|
27
|
+
_initializerDefineProperty(this, "collapserVisible", _descriptor, this);
|
|
28
|
+
this.view = void 0;
|
|
29
|
+
this.view = option.view;
|
|
30
|
+
}
|
|
31
|
+
DefaultCollapseService = inject(CollapseServiceOption)(DefaultCollapseService, undefined, 0) || DefaultCollapseService;
|
|
32
|
+
_createClass(DefaultCollapseService, [{
|
|
33
|
+
key: "setHeadingCollapse",
|
|
34
|
+
value: function setHeadingCollapse(cell, collapsing) {
|
|
35
|
+
if (CellCollapsible.is(cell)) {
|
|
36
|
+
cell.headingCollapsed = collapsing;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
41
|
+
}, {
|
|
42
|
+
key: "getCollapsibleChildNumber",
|
|
43
|
+
value: function getCollapsibleChildNumber(cell) {
|
|
44
|
+
return 0;
|
|
45
|
+
}
|
|
46
|
+
}]);
|
|
47
|
+
return DefaultCollapseService;
|
|
48
|
+
}(), (_descriptor = _applyDecoratedDescriptor(_class2.prototype, "collapserVisible", [_dec2], {
|
|
49
|
+
configurable: true,
|
|
50
|
+
enumerable: true,
|
|
51
|
+
writable: true,
|
|
52
|
+
initializer: function initializer() {
|
|
53
|
+
return false;
|
|
54
|
+
}
|
|
55
|
+
})), _class2)) || _class);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"document-commands.d.ts","sourceRoot":"","sources":["../../src/command/document-commands.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAIjD,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,GAAG;IAAE,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,CAkB3E,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { SaveOutlined, SettingOutlined } from '@ant-design/icons';
|
|
2
|
+
import { FormatCellIcon } from "../material-from-designer.js";
|
|
3
|
+
export var DocumentCommands = {
|
|
4
|
+
Save: {
|
|
5
|
+
id: 'document:save',
|
|
6
|
+
icon: SaveOutlined,
|
|
7
|
+
label: 'SAVE',
|
|
8
|
+
keybind: 'ctrlcmd+s'
|
|
9
|
+
},
|
|
10
|
+
OpenSettings: {
|
|
11
|
+
id: 'document.notebook.open_setting',
|
|
12
|
+
icon: SettingOutlined,
|
|
13
|
+
label: 'Setting'
|
|
14
|
+
},
|
|
15
|
+
FormatCell: {
|
|
16
|
+
id: 'document.notebook.format_cell',
|
|
17
|
+
icon: FormatCellIcon,
|
|
18
|
+
label: 'format cell code',
|
|
19
|
+
keybind: 'shift+alt+f'
|
|
20
|
+
}
|
|
21
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from './notebook-commands.js';
|
|
2
|
+
export * from './document-commands.js';
|
|
3
|
+
export * from './kernel-command.js';
|
|
4
|
+
export * from './libro-command-contribution.js';
|
|
5
|
+
export * from './libro-command-register.js';
|
|
6
|
+
export * from './module.js';
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/command/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,cAAc,iCAAiC,CAAC;AAChD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,aAAa,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kernel-command.d.ts","sourceRoot":"","sources":["../../src/command/kernel-command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAGjD,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,GAAG;IAAE,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,CAsCzE,CAAC"}
|