@difizen/libro-core 0.1.0 → 0.1.2
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/es/add-cell/index.less +1 -1
- package/es/add-cell/libro-add-cell-slot-contribution.d.ts +1 -2
- package/es/add-cell/libro-add-cell-slot-contribution.d.ts.map +1 -1
- package/es/add-cell/libro-add-cell-slot-contribution.js +12 -6
- package/es/add-cell/libro-add-cell-view.d.ts +4 -4
- package/es/add-cell/libro-add-cell-view.d.ts.map +1 -1
- package/es/add-cell/libro-add-cell-view.js +4 -6
- package/es/cell/libro-cell-contribution.d.ts +1 -2
- package/es/cell/libro-cell-contribution.d.ts.map +1 -1
- package/es/cell/libro-cell-contribution.js +14 -8
- package/es/cell/libro-cell-model.d.ts +9 -0
- package/es/cell/libro-cell-model.d.ts.map +1 -1
- package/es/cell/libro-cell-model.js +53 -11
- package/es/cell/libro-cell-protocol.d.ts +2 -0
- package/es/cell/libro-cell-protocol.d.ts.map +1 -1
- package/es/cell/libro-cell-view.d.ts +39 -3
- package/es/cell/libro-cell-view.d.ts.map +1 -1
- package/es/cell/libro-cell-view.js +54 -24
- package/es/cell/libro-edit-cell-view.d.ts +6 -12
- package/es/cell/libro-edit-cell-view.d.ts.map +1 -1
- package/es/cell/libro-edit-cell-view.js +9 -4
- package/es/cell/libro-executable-cell-view.d.ts +2 -0
- package/es/cell/libro-executable-cell-view.d.ts.map +1 -1
- package/es/cell/libro-executable-cell-view.js +4 -1
- package/es/collapse-service.d.ts +1 -1
- package/es/collapse-service.d.ts.map +1 -1
- package/es/collapse-service.js +1 -1
- 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 +3 -2
- 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 +3 -0
- package/es/command/libro-command-contribution.d.ts +0 -1
- package/es/command/libro-command-contribution.d.ts.map +1 -1
- package/es/command/libro-command-contribution.js +179 -129
- package/es/command/libro-command-register.d.ts +0 -1
- package/es/command/libro-command-register.d.ts.map +1 -1
- package/es/command/libro-command-register.js +13 -7
- 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 +17 -4
- package/es/components/cell-protocol.d.ts +5 -5
- package/es/components/cell-protocol.d.ts.map +1 -1
- package/es/components/dnd-cell-item-render.d.ts +6 -2
- package/es/components/dnd-cell-item-render.d.ts.map +1 -1
- package/es/components/dnd-cell-item-render.js +194 -89
- package/es/components/dnd-component/custom-drag-layer.d.ts +1 -1
- package/es/components/dnd-component/custom-drag-layer.d.ts.map +1 -1
- package/es/components/dnd-component/custom-drag-layer.js +3 -4
- package/es/components/dnd-component/default-dnd-content.d.ts +2 -1
- package/es/components/dnd-component/default-dnd-content.d.ts.map +1 -1
- package/es/components/dnd-component/default-dnd-content.js +100 -44
- package/es/components/dnd-component/dnd-context.js +1 -1
- package/es/components/dnd-component/dnd-list.d.ts +9 -5
- package/es/components/dnd-component/dnd-list.d.ts.map +1 -1
- package/es/components/dnd-component/dnd-list.js +93 -26
- package/es/components/dnd-component/index.d.ts +1 -1
- package/es/components/dnd-component/index.d.ts.map +1 -1
- package/es/components/dnd-component/index.js +2 -2
- 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 +2 -2
- package/es/components/index.d.ts.map +1 -1
- package/es/components/index.js +2 -2
- 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 +1 -0
- package/es/content/index.d.ts.map +1 -1
- package/es/content/index.js +2 -1
- package/es/content/libro-content-contribution.d.ts +2 -2
- package/es/content/libro-content-contribution.d.ts.map +1 -1
- package/es/content/libro-content-contribution.js +2 -3
- package/es/content/libro-content-module.d.ts.map +1 -1
- package/es/content/libro-content-module.js +3 -2
- package/es/content/libro-content-protocol.d.ts +5 -0
- package/es/content/libro-content-protocol.d.ts.map +1 -1
- package/es/content/libro-content-protocol.js +2 -1
- package/es/content/libro-content-service.d.ts +6 -4
- package/es/content/libro-content-service.d.ts.map +1 -1
- package/es/content/libro-content-service.js +36 -8
- 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 +5 -1
- package/es/index.d.ts.map +1 -1
- package/es/index.js +6 -2
- package/es/index.less +135 -58
- package/es/libro-context-key.d.ts.map +1 -1
- package/es/libro-keybind-registry.d.ts +5 -0
- package/es/libro-keybind-registry.d.ts.map +1 -0
- package/es/libro-model.d.ts +13 -2
- package/es/libro-model.d.ts.map +1 -1
- package/es/libro-model.js +149 -70
- package/es/libro-protocol.d.ts +44 -2
- package/es/libro-protocol.d.ts.map +1 -1
- package/es/libro-protocol.js +16 -3
- package/es/libro-service.d.ts +1 -1
- package/es/libro-service.d.ts.map +1 -1
- package/es/libro-service.js +29 -20
- package/es/libro-setting-contribution.d.ts +5 -0
- package/es/libro-setting-contribution.d.ts.map +1 -0
- package/es/{configuration/libro-configuration-contribution.js → libro-setting-contribution.js} +8 -9
- package/es/libro-setting.d.ts +11 -0
- package/es/libro-setting.d.ts.map +1 -0
- package/es/{configuration/libro-configuration.js → libro-setting.js} +17 -7
- package/es/libro-view.d.ts +21 -8
- package/es/libro-view.d.ts.map +1 -1
- package/es/libro-view.js +477 -338
- package/es/material-from-designer.d.ts +30 -0
- package/es/material-from-designer.d.ts.map +1 -0
- package/es/material-from-designer.js +112 -1
- package/es/module.d.ts.map +1 -1
- package/es/module.js +20 -5
- package/es/output/output-area.d.ts +3 -4
- package/es/output/output-area.d.ts.map +1 -1
- package/es/output/output-area.js +23 -16
- package/es/output/output-contribution.d.ts +0 -1
- package/es/output/output-contribution.d.ts.map +1 -1
- package/es/output/output-contribution.js +14 -9
- package/es/output/output-model.d.ts +2 -2
- package/es/output/output-model.d.ts.map +1 -1
- package/es/output/output-model.js +2 -2
- package/es/output/output-protocol.d.ts.map +1 -1
- package/es/output/output-protocol.js +0 -2
- 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 +7 -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 +88 -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/libro-slot-manager.d.ts +2 -2
- package/es/slot/libro-slot-manager.d.ts.map +1 -1
- package/es/slot/libro-slot-manager.js +14 -8
- package/es/slot/libro-slot-view.d.ts +3 -3
- package/es/slot/libro-slot-view.d.ts.map +1 -1
- package/es/slot/libro-slot-view.js +2 -2
- 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 +7 -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/libro-toolbar.d.ts +2 -1
- package/es/toolbar/libro-toolbar.d.ts.map +1 -1
- package/es/toolbar/libro-toolbar.js +44 -8
- package/es/toolbar/restart-clear-outputs-modal.d.ts +1 -2
- package/es/toolbar/restart-clear-outputs-modal.d.ts.map +1 -1
- package/es/toolbar/restart-clear-outputs-modal.js +2 -2
- package/es/toolbar/shutdown-modal.d.ts +1 -2
- package/es/toolbar/shutdown-modal.d.ts.map +1 -1
- package/es/toolbar/shutdown-modal.js +2 -2
- package/es/toolbar/side-toolar-more-select.d.ts.map +1 -1
- package/es/toolbar/side-toolar-more-select.js +2 -2
- 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 +19 -0
- package/es/virtualized-manager.d.ts.map +1 -0
- package/es/virtualized-manager.js +61 -0
- package/package.json +9 -6
- package/src/add-cell/index.less +1 -1
- package/src/add-cell/libro-add-cell-slot-contribution.ts +1 -4
- package/src/add-cell/libro-add-cell-view.tsx +13 -6
- package/src/cell/libro-cell-contribution.ts +2 -6
- package/src/cell/libro-cell-model.ts +57 -4
- package/src/cell/libro-cell-protocol.ts +2 -0
- package/src/cell/libro-cell-view.tsx +21 -9
- package/src/cell/libro-edit-cell-view.tsx +10 -9
- package/src/cell/libro-executable-cell-view.ts +6 -1
- package/src/collapse-service.ts +1 -1
- package/src/command/document-commands.ts +3 -5
- package/src/command/kernel-command.ts +3 -0
- package/src/command/libro-command-contribution.ts +107 -91
- package/src/command/libro-command-register.ts +1 -4
- package/src/command/notebook-commands.ts +16 -3
- package/src/components/cell-protocol.ts +5 -5
- package/src/components/dnd-cell-item-render.tsx +239 -92
- package/src/components/dnd-component/custom-drag-layer.tsx +5 -6
- package/src/components/dnd-component/default-dnd-content.tsx +113 -42
- package/src/components/dnd-component/dnd-context.tsx +1 -1
- package/src/components/dnd-component/dnd-list.tsx +135 -43
- package/src/components/dnd-component/index.less +8 -0
- package/src/components/dnd-component/index.tsx +1 -1
- 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 +2 -2
- package/src/components/libro-virtualized-render.tsx +178 -0
- package/src/content/index.ts +1 -0
- package/src/content/libro-content-contribution.ts +2 -3
- package/src/content/libro-content-module.ts +11 -3
- package/src/content/libro-content-protocol.ts +6 -0
- package/src/content/libro-content-service.ts +26 -8
- 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 +135 -58
- package/src/index.tsx +6 -1
- package/src/libro-context-key.ts +3 -3
- package/src/libro-model.ts +87 -23
- package/src/libro-protocol.ts +81 -4
- package/src/libro-service.ts +4 -13
- package/src/{configuration/libro-configuration-contribution.ts → libro-setting-contribution.ts} +7 -8
- package/src/{configuration/libro-configuration.ts → libro-setting.ts} +18 -7
- package/src/libro-view.tsx +273 -141
- package/src/material-from-designer.tsx +93 -1
- package/src/module.ts +29 -7
- package/src/output/output-area.tsx +18 -12
- package/src/output/output-contribution.ts +2 -6
- package/src/output/output-model.tsx +3 -3
- package/src/output/output-protocol.ts +0 -1
- 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 +50 -0
- package/src/settings/settings-protocol.ts +7 -0
- package/src/slot/libro-slot-manager.ts +1 -3
- package/src/slot/libro-slot-view.tsx +2 -5
- package/src/theme/libro-color-registry.ts +6 -0
- package/src/toolbar/all-outputs-scroll-icon.tsx +19 -0
- package/src/toolbar/libro-toolbar.tsx +30 -5
- package/src/toolbar/restart-clear-outputs-modal.tsx +3 -3
- package/src/toolbar/shutdown-modal.tsx +3 -3
- package/src/toolbar/side-toolar-more-select.tsx +2 -1
- package/src/virtualized-manager-helper.ts +29 -0
- package/src/virtualized-manager.ts +34 -0
|
@@ -9,7 +9,6 @@ export interface GeneralLibroCommandHandler extends CommandHandler {
|
|
|
9
9
|
}
|
|
10
10
|
export declare class LibroCommandRegister {
|
|
11
11
|
protected readonly libroService: LibroService;
|
|
12
|
-
constructor(libroService: LibroService);
|
|
13
12
|
registerKeybinds(keybindings: KeybindingRegistry, commands: Record<string, Command & {
|
|
14
13
|
keybind?: string | string[];
|
|
15
14
|
when?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"libro-command-register.d.ts","sourceRoot":"","sources":["../../src/command/libro-command-register.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,OAAO,EACP,cAAc,EAEd,eAAe,EACf,kBAAkB,EACnB,MAAM,mBAAmB,CAAC;AAG3B,OAAO,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEnE,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEnD,MAAM,WAAW,0BAA2B,SAAQ,cAAc;IAChE,OAAO,EAAE,CACP,IAAI,CAAC,EAAE,QAAQ,EACf,KAAK,CAAC,EAAE,YAAY,EACpB,QAAQ,CAAC,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE,GAAG,KACV,IAAI,CAAC;IACV,SAAS,CAAC,EAAE,CACV,IAAI,CAAC,EAAE,QAAQ,EACf,KAAK,CAAC,EAAE,YAAY,EACpB,QAAQ,CAAC,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE,GAAG,KACV,OAAO,CAAC;IACb,SAAS,CAAC,EAAE,CACV,IAAI,CAAC,EAAE,QAAQ,EACf,KAAK,CAAC,EAAE,YAAY,EACpB,QAAQ,CAAC,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE,GAAG,KACV,OAAO,CAAC;IACb,QAAQ,CAAC,EAAE,CACT,IAAI,CAAC,EAAE,QAAQ,EACf,KAAK,CAAC,EAAE,YAAY,EACpB,QAAQ,CAAC,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE,GAAG,KACV,OAAO,CAAC;CACd;AAED,qBACa,oBAAoB;
|
|
1
|
+
{"version":3,"file":"libro-command-register.d.ts","sourceRoot":"","sources":["../../src/command/libro-command-register.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,OAAO,EACP,cAAc,EAEd,eAAe,EACf,kBAAkB,EACnB,MAAM,mBAAmB,CAAC;AAG3B,OAAO,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEnE,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEnD,MAAM,WAAW,0BAA2B,SAAQ,cAAc;IAChE,OAAO,EAAE,CACP,IAAI,CAAC,EAAE,QAAQ,EACf,KAAK,CAAC,EAAE,YAAY,EACpB,QAAQ,CAAC,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE,GAAG,KACV,IAAI,CAAC;IACV,SAAS,CAAC,EAAE,CACV,IAAI,CAAC,EAAE,QAAQ,EACf,KAAK,CAAC,EAAE,YAAY,EACpB,QAAQ,CAAC,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE,GAAG,KACV,OAAO,CAAC;IACb,SAAS,CAAC,EAAE,CACV,IAAI,CAAC,EAAE,QAAQ,EACf,KAAK,CAAC,EAAE,YAAY,EACpB,QAAQ,CAAC,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE,GAAG,KACV,OAAO,CAAC;IACb,QAAQ,CAAC,EAAE,CACT,IAAI,CAAC,EAAE,QAAQ,EACf,KAAK,CAAC,EAAE,YAAY,EACpB,QAAQ,CAAC,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE,GAAG,KACV,OAAO,CAAC;CACd;AAED,qBACa,oBAAoB;IACT,SAAS,CAAC,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC;IACpE,gBAAgB,CACd,WAAW,EAAE,kBAAkB,EAC/B,QAAQ,EAAE,MAAM,CACd,MAAM,EACN,OAAO,GAAG;QACR,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;QAC5B,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,cAAc,CAAC,EAAE,OAAO,CAAC;QACzB,eAAe,CAAC,EAAE,OAAO,CAAC;KAC3B,CACF,EACD,UAAU,UAAO,EACjB,SAAS,UAAO;IAiClB,oBAAoB,QACb,oBAAoB,SAClB,QAAQ,UACP,YAAY,aACT,MAAM,YACP,GAAG,KACZ,CAAC,QAAQ,GAAG,SAAS,EAAE,YAAY,GAAG,SAAS,EAAE,MAAM,GAAG,SAAS,EAAE,GAAG,CAAC,CAI1E;IACF,oBAAoB,CAClB,QAAQ,EAAE,eAAe,EACzB,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,0BAA0B;CAiEtC"}
|
|
@@ -1,32 +1,33 @@
|
|
|
1
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, _class;
|
|
2
|
+
var _dec, _dec2, _class, _class2, _descriptor;
|
|
3
3
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
4
4
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
5
5
|
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); }
|
|
6
6
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
7
7
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
8
8
|
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; }
|
|
9
|
+
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 }); }
|
|
9
10
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
10
11
|
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); } }
|
|
11
12
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
12
13
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
13
14
|
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
15
|
+
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; }
|
|
16
|
+
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.'); }
|
|
14
17
|
import { inject, singleton } from '@difizen/mana-app';
|
|
15
18
|
import { LibroContextKeys } from "../libro-protocol.js";
|
|
16
19
|
import { LibroService } from "../libro-service.js";
|
|
17
|
-
export var LibroCommandRegister = (_dec = singleton(), _dec(_class = /*#__PURE__*/function () {
|
|
18
|
-
function LibroCommandRegister(
|
|
20
|
+
export var LibroCommandRegister = (_dec = singleton(), _dec2 = inject(LibroService), _dec(_class = (_class2 = /*#__PURE__*/function () {
|
|
21
|
+
function LibroCommandRegister() {
|
|
19
22
|
_classCallCheck(this, LibroCommandRegister);
|
|
20
|
-
this
|
|
23
|
+
_initializerDefineProperty(this, "libroService", _descriptor, this);
|
|
21
24
|
this.toGeneralCommandArgs = function (ctx, cell, libro, position, options) {
|
|
22
25
|
var _libroView$model;
|
|
23
26
|
var libroView = libro || ctx.libroService.active;
|
|
24
27
|
var cellView = cell || (libroView === null || libroView === void 0 || (_libroView$model = libroView.model) === null || _libroView$model === void 0 ? void 0 : _libroView$model.active);
|
|
25
28
|
return [cellView, libroView, position, options];
|
|
26
29
|
};
|
|
27
|
-
this.libroService = libroService;
|
|
28
30
|
}
|
|
29
|
-
LibroCommandRegister = inject(LibroService)(LibroCommandRegister, undefined, 0) || LibroCommandRegister;
|
|
30
31
|
_createClass(LibroCommandRegister, [{
|
|
31
32
|
key: "registerKeybinds",
|
|
32
33
|
value: function registerKeybinds(keybindings, commands) {
|
|
@@ -102,4 +103,9 @@ export var LibroCommandRegister = (_dec = singleton(), _dec(_class = /*#__PURE__
|
|
|
102
103
|
}
|
|
103
104
|
}]);
|
|
104
105
|
return LibroCommandRegister;
|
|
105
|
-
}()
|
|
106
|
+
}(), (_descriptor = _applyDecoratedDescriptor(_class2.prototype, "libroService", [_dec2], {
|
|
107
|
+
configurable: true,
|
|
108
|
+
enumerable: true,
|
|
109
|
+
writable: true,
|
|
110
|
+
initializer: null
|
|
111
|
+
})), _class2)) || _class);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notebook-commands.d.ts","sourceRoot":"","sources":["../../src/command/notebook-commands.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAejD,eAAO,MAAM,gBAAgB,EAAE,MAAM,CACnC,MAAM,EACN,OAAO,GAAG;IAAE,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,CAydjF,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { PlusOutlined, PlayCircleOutlined, CopyOutlined, ScissorOutlined, SnippetsOutlined,
|
|
1
|
+
import { PlusOutlined, PlayCircleOutlined, CopyOutlined, ScissorOutlined, SnippetsOutlined, EyeOutlined, EyeInvisibleOutlined,
|
|
2
2
|
// ReloadOutlined,
|
|
3
3
|
PoweroffOutlined } from '@ant-design/icons';
|
|
4
4
|
import { l10n } from '@difizen/mana-l10n';
|
|
5
|
-
import { Undo, Redo, Reload, ClearOutlined, MoveUpOutlined, MoveDownOutlined, DeleteOutlined, MoreOutlined } from "../material-from-designer.js";
|
|
5
|
+
import { Undo, Redo, Reload, ClearOutlined, MoveUpOutlined, MoveDownOutlined, DeleteOutlined, MoreOutlined, PauseCircleOutlined } from "../material-from-designer.js";
|
|
6
6
|
export var NotebookCommands = {
|
|
7
7
|
//#region libro command
|
|
8
8
|
ChangeCellTo: {
|
|
@@ -81,7 +81,7 @@ export var NotebookCommands = {
|
|
|
81
81
|
},
|
|
82
82
|
CloseAndShutdown: {
|
|
83
83
|
id: 'notebook:close-and-shutdown',
|
|
84
|
-
label: "Close
|
|
84
|
+
label: "Close Editor and Shut Down Kernel",
|
|
85
85
|
icon: PoweroffOutlined
|
|
86
86
|
},
|
|
87
87
|
// TODO: 确定命令含义
|
|
@@ -97,6 +97,16 @@ export var NotebookCommands = {
|
|
|
97
97
|
icon: CopyOutlined,
|
|
98
98
|
when: 'commandMode'
|
|
99
99
|
},
|
|
100
|
+
// TODO: 确定命令含义
|
|
101
|
+
CopyToClipboard: {
|
|
102
|
+
id: 'notebook:copy-to-clipboard',
|
|
103
|
+
label: "Copy Output to Clipboard"
|
|
104
|
+
},
|
|
105
|
+
// TODO: 确定命令含义
|
|
106
|
+
CreateOutputView: {
|
|
107
|
+
id: 'notebook:create-output-view',
|
|
108
|
+
label: "Create New View for Cell Output"
|
|
109
|
+
},
|
|
100
110
|
CutCell: {
|
|
101
111
|
id: 'notebook:cut-cell',
|
|
102
112
|
label: "Cut Cells",
|
|
@@ -127,6 +137,10 @@ export var NotebookCommands = {
|
|
|
127
137
|
id: 'notebook:enable-output-scrolling',
|
|
128
138
|
label: "Enable Scrolling for Outputs"
|
|
129
139
|
},
|
|
140
|
+
EnableOrDisableAllOutputScrolling: {
|
|
141
|
+
id: 'notebook:enable-or-disable-all-output-scrolling',
|
|
142
|
+
label: "Enable Or Disable Scrolling for all Outputs"
|
|
143
|
+
},
|
|
130
144
|
EnterCommandMode: {
|
|
131
145
|
id: 'notebook:enter-command-mode',
|
|
132
146
|
label: "Enter Command Mode",
|
|
@@ -300,7 +314,6 @@ export var NotebookCommands = {
|
|
|
300
314
|
icon: SnippetsOutlined,
|
|
301
315
|
when: 'commandMode'
|
|
302
316
|
},
|
|
303
|
-
// TODO: register keybind
|
|
304
317
|
Redo: {
|
|
305
318
|
id: 'notebook:redo',
|
|
306
319
|
label: "Redo"
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import type { FC } from 'react';
|
|
2
2
|
import type { CellOptions, CellView } from '../libro-protocol.js';
|
|
3
|
-
export type CellExecutionTimeProvider =
|
|
3
|
+
export type CellExecutionTimeProvider = FC<{
|
|
4
4
|
cell: CellView;
|
|
5
5
|
}>;
|
|
6
6
|
export declare const CellExecutionTimeProvider: unique symbol;
|
|
7
|
-
export type CellInputBottonBlankProvider =
|
|
7
|
+
export type CellInputBottonBlankProvider = FC<{
|
|
8
8
|
cell: CellView;
|
|
9
9
|
}>;
|
|
10
10
|
export declare const CellInputBottonBlankProvider: unique symbol;
|
|
11
|
-
export type CellOutputVisulizationProvider =
|
|
11
|
+
export type CellOutputVisulizationProvider = FC<{
|
|
12
12
|
cell: CellView;
|
|
13
13
|
}>;
|
|
14
14
|
export declare const CellOutputVisulizationProvider: unique symbol;
|
|
15
|
-
export type BetweenCellProvider =
|
|
15
|
+
export type BetweenCellProvider = FC<{
|
|
16
16
|
index: number;
|
|
17
17
|
addCell: (option: CellOptions, position?: number | undefined) => Promise<void>;
|
|
18
18
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cell-protocol.d.ts","sourceRoot":"","sources":["../../src/components/cell-protocol.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"cell-protocol.d.ts","sourceRoot":"","sources":["../../src/components/cell-protocol.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAEhC,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAElE,MAAM,MAAM,yBAAyB,GAAG,EAAE,CAAC;IAAE,IAAI,EAAE,QAAQ,CAAA;CAAE,CAAC,CAAC;AAE/D,eAAO,MAAM,yBAAyB,eAAsC,CAAC;AAE7E,MAAM,MAAM,4BAA4B,GAAG,EAAE,CAAC;IAAE,IAAI,EAAE,QAAQ,CAAA;CAAE,CAAC,CAAC;AAElE,eAAO,MAAM,4BAA4B,eAAyC,CAAC;AAEnF,MAAM,MAAM,8BAA8B,GAAG,EAAE,CAAC;IAAE,IAAI,EAAE,QAAQ,CAAA;CAAE,CAAC,CAAC;AAEpE,eAAO,MAAM,8BAA8B,eAA2C,CAAC;AAEvF,MAAM,MAAM,mBAAmB,GAAG,EAAE,CAAC;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,CAAC,MAAM,EAAE,WAAW,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CAChF,CAAC,CAAC;AAEH,eAAO,MAAM,mBAAmB,eAAgC,CAAC"}
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import '../index.less';
|
|
3
3
|
import type { CellView, DndItemProps } from '../libro-protocol.js';
|
|
4
|
-
import {
|
|
4
|
+
import { CellExecutionTimeProvider, CellInputBottonBlankProvider, CellOutputVisulizationProvider } from './cell-protocol.js';
|
|
5
5
|
export declare const CellOutputContent: React.FC<{
|
|
6
6
|
cell: CellView;
|
|
7
7
|
}>;
|
|
8
8
|
export declare const LibroCellExecutionTime: CellExecutionTimeProvider;
|
|
9
9
|
export declare const LibroCellInputBottonBlank: CellInputBottonBlankProvider;
|
|
10
10
|
export declare const LibroCellVisualization: CellOutputVisulizationProvider;
|
|
11
|
-
export declare const
|
|
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>>>;
|
|
12
16
|
//# sourceMappingURL=dnd-cell-item-render.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dnd-cell-item-render.d.ts","sourceRoot":"","sources":["../../src/components/dnd-cell-item-render.tsx"],"names":[],"mappings":"
|
|
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,0CA0C/B,CAAC;AAyCH,eAAO,MAAM,iBAAiB,gHAA+B,CAAC"}
|
|
@@ -4,18 +4,20 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
4
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
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
6
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
|
-
|
|
8
|
-
import { ToolbarRender, useInject, useObserve, ViewInstance, ViewRender } from '@difizen/mana-app';
|
|
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';
|
|
9
10
|
import classnames from 'classnames';
|
|
10
|
-
import React, {
|
|
11
|
-
import "../index.less";
|
|
11
|
+
import React, { forwardRef, memo, useLayoutEffect, useMemo, useRef } from 'react';
|
|
12
12
|
import { EditorCellView, ExecutableCellModel, ExecutableCellView, isLibroCellModel } from "../cell/index.js";
|
|
13
13
|
import { CellCollapsible } from "../collapse-service.js";
|
|
14
|
-
import {
|
|
15
|
-
import
|
|
16
|
-
import {
|
|
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";
|
|
17
19
|
import { hasErrorOutput } from "../output/index.js";
|
|
18
|
-
import {
|
|
20
|
+
import { CellExecutionTimeProvider, CellInputBottonBlankProvider, CellOutputVisulizationProvider } from "./cell-protocol.js";
|
|
19
21
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
20
22
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
21
23
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
@@ -45,34 +47,39 @@ var CellInputContent = /*#__PURE__*/memo(function CellInputContent(props) {
|
|
|
45
47
|
})]
|
|
46
48
|
});
|
|
47
49
|
});
|
|
48
|
-
var
|
|
50
|
+
var CellInputInnner = /*#__PURE__*/forwardRef(function CellInput(props, ref) {
|
|
49
51
|
var cell = props.cell;
|
|
52
|
+
var observableCell = useObserve(cell);
|
|
50
53
|
var inputCollapserRef = useRef(null);
|
|
51
|
-
var _useConfigurationValu = useConfigurationValue(
|
|
54
|
+
var _useConfigurationValu = useConfigurationValue(CollapserClickActive),
|
|
52
55
|
_useConfigurationValu2 = _slicedToArray(_useConfigurationValu, 1),
|
|
53
56
|
collapserClickActive = _useConfigurationValu2[0];
|
|
54
57
|
var handleCellInputCollapser = function handleCellInputCollapser() {
|
|
55
58
|
if (collapserClickActive) {
|
|
56
|
-
|
|
59
|
+
observableCell.hasInputHidden = !observableCell.hasInputHidden;
|
|
57
60
|
}
|
|
58
61
|
};
|
|
59
|
-
var hasErrorOutputs = EditorCellView.is(
|
|
60
|
-
|
|
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]);
|
|
61
68
|
return /*#__PURE__*/_jsxs("div", {
|
|
62
69
|
className: "libro-cell-container",
|
|
63
70
|
tabIndex: 10,
|
|
64
71
|
ref: ref,
|
|
65
72
|
children: [/*#__PURE__*/_jsx("div", {
|
|
66
|
-
className: "libro-cell-input-collapser ".concat(isFirstCell ? '
|
|
73
|
+
className: "libro-cell-input-collapser ".concat(isFirstCell ? 'firstCell' : '', " ").concat(hasErrorOutputs ? 'error' : '', " "),
|
|
67
74
|
ref: inputCollapserRef,
|
|
68
75
|
onClick: handleCellInputCollapser
|
|
69
76
|
}), /*#__PURE__*/_jsx(CellInputContent, {
|
|
70
|
-
cell:
|
|
77
|
+
cell: observableCell
|
|
71
78
|
})]
|
|
72
79
|
});
|
|
73
80
|
});
|
|
81
|
+
var CellInput = /*#__PURE__*/memo(CellInputInnner);
|
|
74
82
|
export var CellOutputContent = /*#__PURE__*/memo(function CellOutputContent(props) {
|
|
75
|
-
var _observableCell$outpu;
|
|
76
83
|
var cell = props.cell;
|
|
77
84
|
var observableCell = useObserve(cell);
|
|
78
85
|
var CellOutputVisulization = useInject(CellOutputVisulizationProvider);
|
|
@@ -84,7 +91,7 @@ export var CellOutputContent = /*#__PURE__*/memo(function CellOutputContent(prop
|
|
|
84
91
|
}
|
|
85
92
|
var hasOutputsScrolled = observableCell.model.hasOutputsScrolled;
|
|
86
93
|
var isHidden = observableCell.model.hasOutputHidden;
|
|
87
|
-
if (isHidden
|
|
94
|
+
if (isHidden) {
|
|
88
95
|
return /*#__PURE__*/_jsx("div", {
|
|
89
96
|
className: "libro-cell-output-hidden",
|
|
90
97
|
children: /*#__PURE__*/_jsx(ContentMore, {})
|
|
@@ -111,10 +118,45 @@ export var LibroCellVisualization = /*#__PURE__*/forwardRef(function LibroCellVi
|
|
|
111
118
|
var CellOutput = /*#__PURE__*/forwardRef(function CellOutput(props, ref) {
|
|
112
119
|
var _cell$outputArea;
|
|
113
120
|
var cell = props.cell;
|
|
121
|
+
var outputRef = useRef(null);
|
|
114
122
|
var outputCollapserRef = useRef(null);
|
|
115
|
-
var _useConfigurationValu3 = useConfigurationValue(
|
|
123
|
+
var _useConfigurationValu3 = useConfigurationValue(CollapserClickActive),
|
|
116
124
|
_useConfigurationValu4 = _slicedToArray(_useConfigurationValu3, 1),
|
|
117
|
-
|
|
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
|
+
useLayoutEffect(function () {
|
|
139
|
+
if (!outputRef || !isExecutingRef || !(outputRef !== null && outputRef !== void 0 && outputRef.current)) {
|
|
140
|
+
return function () {
|
|
141
|
+
//
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
var el = outputRef === null || outputRef === void 0 ? void 0 : outputRef.current;
|
|
145
|
+
var resizeObserver = new ResizeObserver(function (entries) {
|
|
146
|
+
entries.forEach(function () {
|
|
147
|
+
var _outputRef$current;
|
|
148
|
+
var outputAreaHeight = (outputRef === null || outputRef === void 0 || (_outputRef$current = outputRef.current) === null || _outputRef$current === void 0 ? void 0 : _outputRef$current.clientHeight) || 0;
|
|
149
|
+
if (isExecutingRef.current && outputAreaHeight > 495) {
|
|
150
|
+
command.executeCommand(NotebookCommands['EnableOutputScrolling'].id);
|
|
151
|
+
}
|
|
152
|
+
});
|
|
153
|
+
});
|
|
154
|
+
resizeObserver.observe(el);
|
|
155
|
+
return function () {
|
|
156
|
+
resizeObserver.unobserve(el);
|
|
157
|
+
resizeObserver.disconnect();
|
|
158
|
+
};
|
|
159
|
+
}, [outputRef.current, cell, isExecutingRef]);
|
|
118
160
|
if (!ExecutableCellView.is(cell)) {
|
|
119
161
|
return null;
|
|
120
162
|
}
|
|
@@ -122,29 +164,51 @@ var CellOutput = /*#__PURE__*/forwardRef(function CellOutput(props, ref) {
|
|
|
122
164
|
return null;
|
|
123
165
|
}
|
|
124
166
|
var handleCellOutputCollapser = function handleCellOutputCollapser() {
|
|
125
|
-
if (ExecutableCellModel.is(cell.model) &&
|
|
167
|
+
if (ExecutableCellModel.is(cell.model) && collapserClickActive) {
|
|
126
168
|
cell.model.hasOutputHidden = !cell.model.hasOutputHidden;
|
|
127
169
|
}
|
|
128
170
|
};
|
|
129
|
-
var
|
|
130
|
-
|
|
171
|
+
var handleOutputScroll = function handleOutputScroll() {
|
|
172
|
+
if (!ExecutableCellModel.is(cell.model)) {
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
175
|
+
if (cell.model.hasOutputsScrolled) {
|
|
176
|
+
command.executeCommand(NotebookCommands['DisableOutputScrolling'].id);
|
|
177
|
+
} else {
|
|
178
|
+
command.executeCommand(NotebookCommands['EnableOutputScrolling'].id);
|
|
179
|
+
}
|
|
180
|
+
};
|
|
181
|
+
return /*#__PURE__*/_jsx("div", {
|
|
131
182
|
className: "libro-cell-output-container",
|
|
132
183
|
ref: ref,
|
|
133
|
-
children:
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
184
|
+
children: /*#__PURE__*/_jsxs("div", {
|
|
185
|
+
ref: outputRef,
|
|
186
|
+
children: [/*#__PURE__*/_jsx("div", {
|
|
187
|
+
className: 'libro-cell-output-collapser',
|
|
188
|
+
ref: outputCollapserRef,
|
|
189
|
+
onClick: handleCellOutputCollapser
|
|
190
|
+
}), outputScrollBtnVisiable && /*#__PURE__*/_jsx("div", {
|
|
191
|
+
className: "libro-cell-output-scroll",
|
|
192
|
+
children: /*#__PURE__*/_jsx(Tooltip, {
|
|
193
|
+
title: "".concat(cell.model.hasOutputsScrolled ? '取消固定 Output 高度' : '固定 Output 高度'),
|
|
194
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
195
|
+
className: "libro-cell-output-scroll-button ",
|
|
196
|
+
onClick: handleOutputScroll,
|
|
197
|
+
children: cell.model.hasOutputsScrolled ? /*#__PURE__*/_jsx(DisableOutputScroll, {}) : /*#__PURE__*/_jsx(EnableOutputScroll, {})
|
|
198
|
+
})
|
|
199
|
+
})
|
|
200
|
+
}), /*#__PURE__*/_jsx(CellOutputContent, {
|
|
201
|
+
cell: cell
|
|
202
|
+
})]
|
|
203
|
+
})
|
|
140
204
|
});
|
|
141
205
|
});
|
|
142
206
|
var HideCellContent = function HideCellContent(props) {
|
|
143
207
|
var cell = props.cell;
|
|
144
208
|
var cellCollapserRef = useRef(null);
|
|
145
|
-
var
|
|
146
|
-
|
|
147
|
-
collapserClickActive =
|
|
209
|
+
var _useConfigurationValu7 = useConfigurationValue(CollapserClickActive),
|
|
210
|
+
_useConfigurationValu8 = _slicedToArray(_useConfigurationValu7, 1),
|
|
211
|
+
collapserClickActive = _useConfigurationValu8[0];
|
|
148
212
|
var handleCellCollapser = function handleCellCollapser() {
|
|
149
213
|
if (collapserClickActive) {
|
|
150
214
|
cell.hasInputHidden = !cell.hasInputHidden;
|
|
@@ -162,26 +226,61 @@ var HideCellContent = function HideCellContent(props) {
|
|
|
162
226
|
})]
|
|
163
227
|
});
|
|
164
228
|
};
|
|
165
|
-
|
|
229
|
+
var ExecuteTooltipArea = /*#__PURE__*/memo(function ExecuteTooltipArea(props) {
|
|
230
|
+
var isMouseOverDragArea = props.isMouseOverDragArea,
|
|
231
|
+
cell = props.cell;
|
|
232
|
+
var observableCell = useObserve(cell);
|
|
233
|
+
var executable = ExecutableCellModel.is(observableCell.model);
|
|
234
|
+
var executeState = ExecutableCellModel.is(observableCell.model) && !observableCell.model.executing ? observableCell.model.executeCount || ' ' : '*';
|
|
235
|
+
return /*#__PURE__*/_jsx(_Fragment, {
|
|
236
|
+
children: executable && !isMouseOverDragArea && /*#__PURE__*/_jsx("div", {
|
|
237
|
+
className: "libro-execute-tooltip-area",
|
|
238
|
+
children: /*#__PURE__*/_jsx("pre", {
|
|
239
|
+
className: "libro-execute-state-tip",
|
|
240
|
+
children: "[".concat(executeState, "]:")
|
|
241
|
+
})
|
|
242
|
+
})
|
|
243
|
+
});
|
|
244
|
+
});
|
|
245
|
+
export var DndCellItemContent = /*#__PURE__*/memo(function DndCellItemContent(props) {
|
|
246
|
+
var instance = useInject(ViewInstance);
|
|
247
|
+
var cell = props.cell;
|
|
248
|
+
var observableCell = useObserve(cell);
|
|
249
|
+
var isCollapsible = CellCollapsible.is(observableCell);
|
|
250
|
+
var hasCellHidden = useMemo(function () {
|
|
251
|
+
return observableCell.hasCellHidden();
|
|
252
|
+
}, [observableCell]);
|
|
253
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
254
|
+
children: [hasCellHidden && /*#__PURE__*/_jsx(HideCellContent, {
|
|
255
|
+
cell: observableCell
|
|
256
|
+
}), !hasCellHidden && /*#__PURE__*/_jsxs(_Fragment, {
|
|
257
|
+
children: [instance.collapserVisible && isCollapsible && /*#__PURE__*/_jsx("div", {
|
|
258
|
+
className: "libro-markdown-collapser",
|
|
259
|
+
onClick: function onClick() {
|
|
260
|
+
instance.collapseCell(observableCell, !observableCell.headingCollapsed);
|
|
261
|
+
},
|
|
262
|
+
children: observableCell.headingCollapsed ? /*#__PURE__*/_jsx(ArrowRight, {}) : /*#__PURE__*/_jsx(ArrowDown, {})
|
|
263
|
+
}), /*#__PURE__*/_jsx(CellInput, {
|
|
264
|
+
cell: observableCell
|
|
265
|
+
}), /*#__PURE__*/_jsx(CellOutput, {
|
|
266
|
+
cell: observableCell
|
|
267
|
+
})]
|
|
268
|
+
})]
|
|
269
|
+
});
|
|
270
|
+
});
|
|
271
|
+
export var DndCellItemContainer = /*#__PURE__*/memo(function DndCellItemContainer(props) {
|
|
166
272
|
var _instance$activeCell;
|
|
167
273
|
var isDrag = props.isDrag,
|
|
168
274
|
isMouseOverDragArea = props.isMouseOverDragArea,
|
|
169
275
|
cell = props.cell;
|
|
170
|
-
var
|
|
171
|
-
_useConfigurationValu8 = _slicedToArray(_useConfigurationValu7, 1),
|
|
172
|
-
topToolbarVisible = _useConfigurationValu8[0];
|
|
173
|
-
var _useConfigurationValu9 = useConfigurationValue(CellSideToolbarVisible),
|
|
276
|
+
var _useConfigurationValu9 = useConfigurationValue(CellTopToolbarSetting),
|
|
174
277
|
_useConfigurationValu10 = _slicedToArray(_useConfigurationValu9, 1),
|
|
175
|
-
|
|
278
|
+
topToolbarVisible = _useConfigurationValu10[0];
|
|
279
|
+
var _useConfigurationValu11 = useConfigurationValue(CellSideToolbarVisible),
|
|
280
|
+
_useConfigurationValu12 = _slicedToArray(_useConfigurationValu11, 1),
|
|
281
|
+
sideToolbarVisible = _useConfigurationValu12[0];
|
|
176
282
|
var instance = useInject(ViewInstance);
|
|
177
283
|
var isActive = ((_instance$activeCell = instance.activeCell) === null || _instance$activeCell === void 0 ? void 0 : _instance$activeCell.id) === cell.id;
|
|
178
|
-
var executable = ExecutableCellModel.is(cell.model);
|
|
179
|
-
var isCollapsible = CellCollapsible.is(cell);
|
|
180
|
-
var executeState = ExecutableCellModel.is(cell.model) && !cell.model.executing ? cell.model.executeCount || ' ' : '*';
|
|
181
|
-
// const hasExecuteCount =
|
|
182
|
-
// ExecutableCellModel.is(cell.model) &&
|
|
183
|
-
// typeof cell.model.executeCount === 'number' &&
|
|
184
|
-
// cell.model.executeCount > 0;
|
|
185
284
|
var topToolbarArgs = useMemo(function () {
|
|
186
285
|
return [cell, instance, LibroToolbarArea.CellTop];
|
|
187
286
|
}, [cell, instance]);
|
|
@@ -191,8 +290,41 @@ export var DndCellItemRender = /*#__PURE__*/forwardRef(function DndCellItemRende
|
|
|
191
290
|
if (!isLibroCellModel(cell.model)) {
|
|
192
291
|
return null;
|
|
193
292
|
}
|
|
194
|
-
|
|
195
|
-
|
|
293
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
294
|
+
children: [topToolbarVisible && isActive && /*#__PURE__*/_jsx("div", {
|
|
295
|
+
className: "libro-cell-top-toolbar",
|
|
296
|
+
children: /*#__PURE__*/_jsx(ToolbarRender, {
|
|
297
|
+
data: topToolbarArgs
|
|
298
|
+
})
|
|
299
|
+
}), /*#__PURE__*/_jsx(ExecuteTooltipArea, {
|
|
300
|
+
cell: cell,
|
|
301
|
+
isMouseOverDragArea: isMouseOverDragArea
|
|
302
|
+
}), /*#__PURE__*/_jsx(DndCellItemContent, {
|
|
303
|
+
cell: cell
|
|
304
|
+
}), sideToolbarVisible && /*#__PURE__*/_jsx("div", {
|
|
305
|
+
className: "libro-cell-right-toolbar",
|
|
306
|
+
children: isActive && !isDrag && instance.model.readOnly !== true && /*#__PURE__*/_jsx(ToolbarRender, {
|
|
307
|
+
data: rightToolbarArgs,
|
|
308
|
+
tooltip: {
|
|
309
|
+
placement: LibroToolbarArea.CellRight
|
|
310
|
+
}
|
|
311
|
+
})
|
|
312
|
+
})]
|
|
313
|
+
});
|
|
314
|
+
});
|
|
315
|
+
var DndCellItemRenderInner = /*#__PURE__*/forwardRef(function DndCellItemRender(props, ref) {
|
|
316
|
+
var _instance$activeCell2;
|
|
317
|
+
var isDrag = props.isDrag,
|
|
318
|
+
isMouseOverDragArea = props.isMouseOverDragArea,
|
|
319
|
+
cell = props.cell,
|
|
320
|
+
isDragOver = props.isDragOver;
|
|
321
|
+
var observableCell = useObserve(cell);
|
|
322
|
+
var instance = useInject(ViewInstance);
|
|
323
|
+
var isActive = ((_instance$activeCell2 = instance.activeCell) === null || _instance$activeCell2 === void 0 ? void 0 : _instance$activeCell2.id) === observableCell.id;
|
|
324
|
+
var hasErrorOutputs = hasErrorOutput(observableCell);
|
|
325
|
+
var hasCellHidden = useMemo(function () {
|
|
326
|
+
return observableCell.hasCellHidden();
|
|
327
|
+
}, [observableCell]);
|
|
196
328
|
var classNames = ['libro-dnd-cell', {
|
|
197
329
|
active: isActive
|
|
198
330
|
}, {
|
|
@@ -204,50 +336,23 @@ export var DndCellItemRender = /*#__PURE__*/forwardRef(function DndCellItemRende
|
|
|
204
336
|
}, {
|
|
205
337
|
hidden: hasCellHidden
|
|
206
338
|
}];
|
|
207
|
-
if (
|
|
208
|
-
classNames.push(
|
|
339
|
+
if (observableCell.wrapperCls) {
|
|
340
|
+
classNames.push(observableCell.wrapperCls);
|
|
209
341
|
}
|
|
210
342
|
return /*#__PURE__*/_jsx("div", {
|
|
211
|
-
className: "libro-dnd-cell-border
|
|
212
|
-
children: /*#__PURE__*/
|
|
343
|
+
className: "libro-dnd-cell-border",
|
|
344
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
213
345
|
className: classnames(classNames),
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
className: "libro-execute-state-tip",
|
|
223
|
-
children: "[".concat(executeState, "]:")
|
|
224
|
-
})
|
|
225
|
-
}), /*#__PURE__*/_jsx("div", {
|
|
226
|
-
className: "libro-dnd-cell-preview",
|
|
227
|
-
ref: ref
|
|
228
|
-
}), cell.hasCellHidden() && /*#__PURE__*/_jsx(HideCellContent, {
|
|
229
|
-
cell: cell
|
|
230
|
-
}), !cell.hasCellHidden() && /*#__PURE__*/_jsxs(_Fragment, {
|
|
231
|
-
children: [instance.collapserVisible && isCollapsible && /*#__PURE__*/_jsx("div", {
|
|
232
|
-
className: "libro-markdown-collapser",
|
|
233
|
-
onClick: function onClick() {
|
|
234
|
-
instance.collapseCell(cell, !cell.headingCollapsed);
|
|
235
|
-
},
|
|
236
|
-
children: cell.headingCollapsed ? /*#__PURE__*/_jsx(ArrowRight, {}) : /*#__PURE__*/_jsx(ArrowDown, {})
|
|
237
|
-
}), /*#__PURE__*/_jsx(CellInput, {
|
|
238
|
-
cell: cell
|
|
239
|
-
}), /*#__PURE__*/_jsx(CellOutput, {
|
|
240
|
-
cell: cell
|
|
241
|
-
})]
|
|
242
|
-
}), sideToolbarVisible && /*#__PURE__*/_jsx("div", {
|
|
243
|
-
className: "libro-cell-right-toolbar",
|
|
244
|
-
children: isActive && !isDrag && instance.model.readOnly !== true && /*#__PURE__*/_jsx(ToolbarRender, {
|
|
245
|
-
data: rightToolbarArgs,
|
|
246
|
-
tooltip: {
|
|
247
|
-
placement: LibroToolbarArea.CellRight
|
|
248
|
-
}
|
|
249
|
-
})
|
|
250
|
-
})]
|
|
346
|
+
ref: ref,
|
|
347
|
+
children: /*#__PURE__*/_jsx(DndCellItemContainer, {
|
|
348
|
+
cell: observableCell,
|
|
349
|
+
isDrag: isDrag,
|
|
350
|
+
isDragOver: isDragOver,
|
|
351
|
+
isMouseOverDragArea: isMouseOverDragArea
|
|
352
|
+
// ref={ref}
|
|
353
|
+
})
|
|
251
354
|
})
|
|
252
355
|
});
|
|
253
|
-
});
|
|
356
|
+
});
|
|
357
|
+
|
|
358
|
+
export var DndCellItemRender = /*#__PURE__*/memo(DndCellItemRenderInner);
|
|
@@ -5,5 +5,5 @@ export interface SelectionPreviewProps {
|
|
|
5
5
|
}
|
|
6
6
|
export declare const MultipleSelectionPreviewMemo: FC<SelectionPreviewProps>;
|
|
7
7
|
export declare const SingleSelectionPreviewMemo: FC<SelectionPreviewProps>;
|
|
8
|
-
export declare const CustomDragLayer:
|
|
8
|
+
export declare const CustomDragLayer: () => import("react/jsx-runtime").JSX.Element | null;
|
|
9
9
|
//# sourceMappingURL=custom-drag-layer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"custom-drag-layer.d.ts","sourceRoot":"","sources":["../../../src/components/dnd-component/custom-drag-layer.tsx"],"names":[],"mappings":"
|
|
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"}
|
|
@@ -10,6 +10,7 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
10
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
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
12
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
13
|
+
/* eslint-disable react-hooks/exhaustive-deps */
|
|
13
14
|
import { useInject, ViewInstance } from '@difizen/mana-app';
|
|
14
15
|
import { ViewRender } from '@difizen/mana-app';
|
|
15
16
|
import { useState, useEffect, memo } from 'react';
|
|
@@ -52,10 +53,9 @@ var MultipleSelectionPreview = function MultipleSelectionPreview(_ref) {
|
|
|
52
53
|
cellService.getOrCreateView(activeCell.model.options, activeCell.parent.id).then(function (view) {
|
|
53
54
|
setMultipleSelectionPreview(view);
|
|
54
55
|
return;
|
|
55
|
-
}).catch(function () {
|
|
56
|
+
}).catch(function (e) {
|
|
56
57
|
//
|
|
57
58
|
});
|
|
58
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
59
59
|
}, []);
|
|
60
60
|
return /*#__PURE__*/_jsxs("div", {
|
|
61
61
|
className: "libro-dnd-multiple-selection-preview",
|
|
@@ -84,10 +84,9 @@ var SingleSelectionDragPreview = function SingleSelectionDragPreview(_ref2) {
|
|
|
84
84
|
}), activeCell.parent.id).then(function (view) {
|
|
85
85
|
setSingleSelectionPreview(view);
|
|
86
86
|
return;
|
|
87
|
-
}).catch(function () {
|
|
87
|
+
}).catch(function (e) {
|
|
88
88
|
//
|
|
89
89
|
});
|
|
90
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
91
90
|
}, []);
|
|
92
91
|
return /*#__PURE__*/_jsx("div", {
|
|
93
92
|
className: "libro-dnd-active-selection",
|