@sunspirytus/xflow-core 1.0.52
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 +21 -0
- package/dist/index.css +108 -0
- package/dist/index.umd.js +35 -0
- package/dist/index.umd.js.map +1 -0
- package/es/antd-icons/index.d.ts +20 -0
- package/es/antd-icons/index.js +29 -0
- package/es/antd-icons/index.js.map +1 -0
- package/es/command/__test__/graph-command.spec.d.ts +1 -0
- package/es/command/__test__/graph-command.spec.js +109 -0
- package/es/command/__test__/graph-command.spec.js.map +1 -0
- package/es/command/graph-command.d.ts +177 -0
- package/es/command/graph-command.js +300 -0
- package/es/command/graph-command.js.map +1 -0
- package/es/command/index.d.ts +7 -0
- package/es/command/index.js +6 -0
- package/es/command/index.js.map +1 -0
- package/es/command/interface.d.ts +221 -0
- package/es/command/interface.js +23 -0
- package/es/command/interface.js.map +1 -0
- package/es/command/module.d.ts +2 -0
- package/es/command/module.js +15 -0
- package/es/command/module.js.map +1 -0
- package/es/command-contributions/cmd-context.d.ts +76 -0
- package/es/command-contributions/cmd-context.js +123 -0
- package/es/command-contributions/cmd-context.js.map +1 -0
- package/es/command-contributions/command-contribution.d.ts +23 -0
- package/es/command-contributions/command-contribution.js +182 -0
- package/es/command-contributions/command-contribution.js.map +1 -0
- package/es/command-contributions/components/context.d.ts +11 -0
- package/es/command-contributions/components/context.js +86 -0
- package/es/command-contributions/components/context.js.map +1 -0
- package/es/command-contributions/components/index.d.ts +11 -0
- package/es/command-contributions/components/index.js +32 -0
- package/es/command-contributions/components/index.js.map +1 -0
- package/es/command-contributions/config.d.ts +39 -0
- package/es/command-contributions/config.js +64 -0
- package/es/command-contributions/config.js.map +1 -0
- package/es/command-contributions/constant.d.ts +98 -0
- package/es/command-contributions/constant.js +272 -0
- package/es/command-contributions/constant.js.map +1 -0
- package/es/command-contributions/edge/edge-add.d.ts +83 -0
- package/es/command-contributions/edge/edge-add.js +134 -0
- package/es/command-contributions/edge/edge-add.js.map +1 -0
- package/es/command-contributions/edge/edge-back.d.ts +27 -0
- package/es/command-contributions/edge/edge-back.js +72 -0
- package/es/command-contributions/edge/edge-back.js.map +1 -0
- package/es/command-contributions/edge/edge-del.d.ts +67 -0
- package/es/command-contributions/edge/edge-del.js +129 -0
- package/es/command-contributions/edge/edge-del.js.map +1 -0
- package/es/command-contributions/edge/edge-front.d.ts +27 -0
- package/es/command-contributions/edge/edge-front.js +72 -0
- package/es/command-contributions/edge/edge-front.js.map +1 -0
- package/es/command-contributions/edge/edge-highlight.d.ts +32 -0
- package/es/command-contributions/edge/edge-highlight.js +92 -0
- package/es/command-contributions/edge/edge-highlight.js.map +1 -0
- package/es/command-contributions/edge/edge-update.d.ts +46 -0
- package/es/command-contributions/edge/edge-update.js +99 -0
- package/es/command-contributions/edge/edge-update.js.map +1 -0
- package/es/command-contributions/edge/index.d.ts +50 -0
- package/es/command-contributions/edge/index.js +19 -0
- package/es/command-contributions/edge/index.js.map +1 -0
- package/es/command-contributions/graph/graph-add-tool.d.ts +49 -0
- package/es/command-contributions/graph/graph-add-tool.js +74 -0
- package/es/command-contributions/graph/graph-add-tool.js.map +1 -0
- package/es/command-contributions/graph/graph-cmd-redo.d.ts +40 -0
- package/es/command-contributions/graph/graph-cmd-redo.js +77 -0
- package/es/command-contributions/graph/graph-cmd-redo.js.map +1 -0
- package/es/command-contributions/graph/graph-cmd-undo.d.ts +36 -0
- package/es/command-contributions/graph/graph-cmd-undo.js +77 -0
- package/es/command-contributions/graph/graph-cmd-undo.js.map +1 -0
- package/es/command-contributions/graph/graph-copy.d.ts +39 -0
- package/es/command-contributions/graph/graph-copy.js +102 -0
- package/es/command-contributions/graph/graph-copy.js.map +1 -0
- package/es/command-contributions/graph/graph-del-tool.d.ts +47 -0
- package/es/command-contributions/graph/graph-del-tool.js +68 -0
- package/es/command-contributions/graph/graph-del-tool.js.map +1 -0
- package/es/command-contributions/graph/graph-fulllscreen.d.ts +37 -0
- package/es/command-contributions/graph/graph-fulllscreen.js +84 -0
- package/es/command-contributions/graph/graph-fulllscreen.js.map +1 -0
- package/es/command-contributions/graph/graph-history-redo.d.ts +33 -0
- package/es/command-contributions/graph/graph-history-redo.js +69 -0
- package/es/command-contributions/graph/graph-history-redo.js.map +1 -0
- package/es/command-contributions/graph/graph-history-reset.d.ts +33 -0
- package/es/command-contributions/graph/graph-history-reset.js +59 -0
- package/es/command-contributions/graph/graph-history-reset.js.map +1 -0
- package/es/command-contributions/graph/graph-history-toggle.d.ts +35 -0
- package/es/command-contributions/graph/graph-history-toggle.js +75 -0
- package/es/command-contributions/graph/graph-history-toggle.js.map +1 -0
- package/es/command-contributions/graph/graph-history-undo.d.ts +35 -0
- package/es/command-contributions/graph/graph-history-undo.js +69 -0
- package/es/command-contributions/graph/graph-history-undo.js.map +1 -0
- package/es/command-contributions/graph/graph-layout.d.ts +43 -0
- package/es/command-contributions/graph/graph-layout.js +71 -0
- package/es/command-contributions/graph/graph-layout.js.map +1 -0
- package/es/command-contributions/graph/graph-load-data.d.ts +37 -0
- package/es/command-contributions/graph/graph-load-data.js +68 -0
- package/es/command-contributions/graph/graph-load-data.js.map +1 -0
- package/es/command-contributions/graph/graph-meta.d.ts +47 -0
- package/es/command-contributions/graph/graph-meta.js +78 -0
- package/es/command-contributions/graph/graph-meta.js.map +1 -0
- package/es/command-contributions/graph/graph-paste.d.ts +52 -0
- package/es/command-contributions/graph/graph-paste.js +129 -0
- package/es/command-contributions/graph/graph-paste.js.map +1 -0
- package/es/command-contributions/graph/graph-render.d.ts +53 -0
- package/es/command-contributions/graph/graph-render.js +249 -0
- package/es/command-contributions/graph/graph-render.js.map +1 -0
- package/es/command-contributions/graph/graph-resize.d.ts +40 -0
- package/es/command-contributions/graph/graph-resize.js +75 -0
- package/es/command-contributions/graph/graph-resize.js.map +1 -0
- package/es/command-contributions/graph/graph-save-data.d.ts +43 -0
- package/es/command-contributions/graph/graph-save-data.js +101 -0
- package/es/command-contributions/graph/graph-save-data.js.map +1 -0
- package/es/command-contributions/graph/graph-toggle-multi-select.d.ts +38 -0
- package/es/command-contributions/graph/graph-toggle-multi-select.js +96 -0
- package/es/command-contributions/graph/graph-toggle-multi-select.js.map +1 -0
- package/es/command-contributions/graph/graph-zoom.d.ts +51 -0
- package/es/command-contributions/graph/graph-zoom.js +89 -0
- package/es/command-contributions/graph/graph-zoom.js.map +1 -0
- package/es/command-contributions/graph/index.d.ts +114 -0
- package/es/command-contributions/graph/index.js +83 -0
- package/es/command-contributions/graph/index.js.map +1 -0
- package/es/command-contributions/group/group-add.d.ts +56 -0
- package/es/command-contributions/group/group-add.js +114 -0
- package/es/command-contributions/group/group-add.js.map +1 -0
- package/es/command-contributions/group/group-del.d.ts +43 -0
- package/es/command-contributions/group/group-del.js +100 -0
- package/es/command-contributions/group/group-del.js.map +1 -0
- package/es/command-contributions/group/group-init.d.ts +40 -0
- package/es/command-contributions/group/group-init.js +97 -0
- package/es/command-contributions/group/group-init.js.map +1 -0
- package/es/command-contributions/group/group-toggle-collapse.d.ts +47 -0
- package/es/command-contributions/group/group-toggle-collapse.js +123 -0
- package/es/command-contributions/group/group-toggle-collapse.js.map +1 -0
- package/es/command-contributions/group/index.d.ts +39 -0
- package/es/command-contributions/group/index.js +14 -0
- package/es/command-contributions/group/index.js.map +1 -0
- package/es/command-contributions/index.d.ts +10 -0
- package/es/command-contributions/index.js +13 -0
- package/es/command-contributions/index.js.map +1 -0
- package/es/command-contributions/interface.d.ts +17 -0
- package/es/command-contributions/interface.js +2 -0
- package/es/command-contributions/interface.js.map +1 -0
- package/es/command-contributions/mapping-service.d.ts +20 -0
- package/es/command-contributions/mapping-service.js +91 -0
- package/es/command-contributions/mapping-service.js.map +1 -0
- package/es/command-contributions/models/index.d.ts +24 -0
- package/es/command-contributions/models/index.js +9 -0
- package/es/command-contributions/models/index.js.map +1 -0
- package/es/command-contributions/models/update-model.d.ts +45 -0
- package/es/command-contributions/models/update-model.js +70 -0
- package/es/command-contributions/models/update-model.js.map +1 -0
- package/es/command-contributions/module.d.ts +5 -0
- package/es/command-contributions/module.js +45 -0
- package/es/command-contributions/module.js.map +1 -0
- package/es/command-contributions/node/index.d.ts +70 -0
- package/es/command-contributions/node/index.js +38 -0
- package/es/command-contributions/node/index.js.map +1 -0
- package/es/command-contributions/node/node-add.d.ts +58 -0
- package/es/command-contributions/node/node-add.js +131 -0
- package/es/command-contributions/node/node-add.js.map +1 -0
- package/es/command-contributions/node/node-back.d.ts +32 -0
- package/es/command-contributions/node/node-back.js +74 -0
- package/es/command-contributions/node/node-back.js.map +1 -0
- package/es/command-contributions/node/node-center.d.ts +30 -0
- package/es/command-contributions/node/node-center.js +60 -0
- package/es/command-contributions/node/node-center.js.map +1 -0
- package/es/command-contributions/node/node-del.d.ts +51 -0
- package/es/command-contributions/node/node-del.js +102 -0
- package/es/command-contributions/node/node-del.js.map +1 -0
- package/es/command-contributions/node/node-front.d.ts +27 -0
- package/es/command-contributions/node/node-front.js +73 -0
- package/es/command-contributions/node/node-front.js.map +1 -0
- package/es/command-contributions/node/node-highlight.d.ts +39 -0
- package/es/command-contributions/node/node-highlight.js +85 -0
- package/es/command-contributions/node/node-highlight.js.map +1 -0
- package/es/command-contributions/node/node-move.d.ts +51 -0
- package/es/command-contributions/node/node-move.js +94 -0
- package/es/command-contributions/node/node-move.js.map +1 -0
- package/es/command-contributions/node/node-select.d.ts +30 -0
- package/es/command-contributions/node/node-select.js +73 -0
- package/es/command-contributions/node/node-select.js.map +1 -0
- package/es/command-contributions/node/node-update-port.d.ts +54 -0
- package/es/command-contributions/node/node-update-port.js +105 -0
- package/es/command-contributions/node/node-update-port.js.map +1 -0
- package/es/command-contributions/node/node-update.d.ts +53 -0
- package/es/command-contributions/node/node-update.js +122 -0
- package/es/command-contributions/node/node-update.js.map +1 -0
- package/es/common/deferred.d.ts +8 -0
- package/es/common/deferred.js +17 -0
- package/es/common/deferred.js.map +1 -0
- package/es/common/delay.d.ts +1 -0
- package/es/common/delay.js +5 -0
- package/es/common/delay.js.map +1 -0
- package/es/common/disposable.d.ts +28 -0
- package/es/common/disposable.js +81 -0
- package/es/common/disposable.js.map +1 -0
- package/es/common/event-helper.d.ts +7 -0
- package/es/common/event-helper.js +8 -0
- package/es/common/event-helper.js.map +1 -0
- package/es/common/graph-utils.d.ts +22 -0
- package/es/common/graph-utils.js +34 -0
- package/es/common/graph-utils.js.map +1 -0
- package/es/common/position.d.ts +10 -0
- package/es/common/position.js +12 -0
- package/es/common/position.js.map +1 -0
- package/es/common/rx-model-hook.d.ts +16 -0
- package/es/common/rx-model-hook.js +92 -0
- package/es/common/rx-model-hook.js.map +1 -0
- package/es/common/rx-model.d.ts +66 -0
- package/es/common/rx-model.js +101 -0
- package/es/common/rx-model.js.map +1 -0
- package/es/common/safe-json.d.ts +1 -0
- package/es/common/safe-json.js +12 -0
- package/es/common/safe-json.js.map +1 -0
- package/es/common/types.d.ts +15 -0
- package/es/common/types.js +2 -0
- package/es/common/types.js.map +1 -0
- package/es/common/utils.d.ts +11 -0
- package/es/common/utils.js +48 -0
- package/es/common/utils.js.map +1 -0
- package/es/common/uuid.d.ts +2 -0
- package/es/common/uuid.js +8 -0
- package/es/common/uuid.js.map +1 -0
- package/es/constants.d.ts +31 -0
- package/es/constants.js +26 -0
- package/es/constants.js.map +1 -0
- package/es/hooks/components/index.d.ts +13 -0
- package/es/hooks/components/index.js +36 -0
- package/es/hooks/components/index.js.map +1 -0
- package/es/hooks/config.d.ts +41 -0
- package/es/hooks/config.js +35 -0
- package/es/hooks/config.js.map +1 -0
- package/es/hooks/contributions/default.d.ts +19 -0
- package/es/hooks/contributions/default.js +41 -0
- package/es/hooks/contributions/default.js.map +1 -0
- package/es/hooks/contributions/graph.d.ts +19 -0
- package/es/hooks/contributions/graph.js +96 -0
- package/es/hooks/contributions/graph.js.map +1 -0
- package/es/hooks/hook-registry.d.ts +27 -0
- package/es/hooks/hook-registry.js +51 -0
- package/es/hooks/hook-registry.js.map +1 -0
- package/es/hooks/index.d.ts +4 -0
- package/es/hooks/index.js +9 -0
- package/es/hooks/index.js.map +1 -0
- package/es/hooks/interface.d.ts +62 -0
- package/es/hooks/interface.js +19 -0
- package/es/hooks/interface.js.map +1 -0
- package/es/hooks/module.d.ts +8 -0
- package/es/hooks/module.js +26 -0
- package/es/hooks/module.js.map +1 -0
- package/es/index.d.ts +85 -0
- package/es/index.js +97 -0
- package/es/index.js.map +1 -0
- package/es/interface.d.ts +161 -0
- package/es/interface.js +21 -0
- package/es/interface.js.map +1 -0
- package/es/keybinding/components/index.d.ts +13 -0
- package/es/keybinding/components/index.js +36 -0
- package/es/keybinding/components/index.js.map +1 -0
- package/es/keybinding/config.d.ts +23 -0
- package/es/keybinding/config.js +36 -0
- package/es/keybinding/config.js.map +1 -0
- package/es/keybinding/index.d.ts +4 -0
- package/es/keybinding/index.js +5 -0
- package/es/keybinding/index.js.map +1 -0
- package/es/keybinding/interface.d.ts +52 -0
- package/es/keybinding/interface.js +6 -0
- package/es/keybinding/interface.js.map +1 -0
- package/es/keybinding/keybinding-registry.d.ts +52 -0
- package/es/keybinding/keybinding-registry.js +129 -0
- package/es/keybinding/keybinding-registry.js.map +1 -0
- package/es/keybinding/module.d.ts +8 -0
- package/es/keybinding/module.js +33 -0
- package/es/keybinding/module.js.map +1 -0
- package/es/menu/components/index.d.ts +4 -0
- package/es/menu/components/index.js +22 -0
- package/es/menu/components/index.js.map +1 -0
- package/es/menu/index.d.ts +3 -0
- package/es/menu/index.js +10 -0
- package/es/menu/index.js.map +1 -0
- package/es/menu/interface.d.ts +114 -0
- package/es/menu/interface.js +18 -0
- package/es/menu/interface.js.map +1 -0
- package/es/menu/menu-registry.d.ts +32 -0
- package/es/menu/menu-registry.js +65 -0
- package/es/menu/menu-registry.js.map +1 -0
- package/es/menu/module.d.ts +3 -0
- package/es/menu/module.js +17 -0
- package/es/menu/module.js.map +1 -0
- package/es/model-service/components/index.d.ts +12 -0
- package/es/model-service/components/index.js +40 -0
- package/es/model-service/components/index.js.map +1 -0
- package/es/model-service/config.d.ts +20 -0
- package/es/model-service/config.js +36 -0
- package/es/model-service/config.js.map +1 -0
- package/es/model-service/constant.d.ts +174 -0
- package/es/model-service/constant.js +162 -0
- package/es/model-service/constant.js.map +1 -0
- package/es/model-service/contributions/command-model.d.ts +9 -0
- package/es/model-service/contributions/command-model.js +48 -0
- package/es/model-service/contributions/command-model.js.map +1 -0
- package/es/model-service/contributions/graph-model.d.ts +12 -0
- package/es/model-service/contributions/graph-model.js +250 -0
- package/es/model-service/contributions/graph-model.js.map +1 -0
- package/es/model-service/index.d.ts +6 -0
- package/es/model-service/index.js +7 -0
- package/es/model-service/index.js.map +1 -0
- package/es/model-service/interface.d.ts +66 -0
- package/es/model-service/interface.js +11 -0
- package/es/model-service/interface.js.map +1 -0
- package/es/model-service/model-registry.d.ts +49 -0
- package/es/model-service/model-registry.js +117 -0
- package/es/model-service/model-registry.js.map +1 -0
- package/es/model-service/module.d.ts +9 -0
- package/es/model-service/module.js +42 -0
- package/es/model-service/module.js.map +1 -0
- package/es/model-service/utils.d.ts +5 -0
- package/es/model-service/utils.js +52 -0
- package/es/model-service/utils.js.map +1 -0
- package/es/style/components.css +108 -0
- package/es/style/components.less +1 -0
- package/es/style/index.css +0 -0
- package/es/style/index.less +1 -0
- package/es/style/themes/default.css +0 -0
- package/es/style/themes/default.less +2 -0
- package/es/style/themes/index.css +0 -0
- package/es/style/themes/index.less +1 -0
- package/es/toolbar/components/index.d.ts +4 -0
- package/es/toolbar/components/index.js +21 -0
- package/es/toolbar/components/index.js.map +1 -0
- package/es/toolbar/index.d.ts +3 -0
- package/es/toolbar/index.js +8 -0
- package/es/toolbar/index.js.map +1 -0
- package/es/toolbar/interface.d.ts +104 -0
- package/es/toolbar/interface.js +8 -0
- package/es/toolbar/interface.js.map +1 -0
- package/es/toolbar/module.d.ts +8 -0
- package/es/toolbar/module.js +18 -0
- package/es/toolbar/module.js.map +1 -0
- package/es/toolbar/toolbar-registry.d.ts +80 -0
- package/es/toolbar/toolbar-registry.js +127 -0
- package/es/toolbar/toolbar-registry.js.map +1 -0
- package/es/xflow-main/application-module.d.ts +8 -0
- package/es/xflow-main/application-module.js +46 -0
- package/es/xflow-main/application-module.js.map +1 -0
- package/es/xflow-main/application.d.ts +77 -0
- package/es/xflow-main/application.js +178 -0
- package/es/xflow-main/application.js.map +1 -0
- package/es/xflow-main/components/app-context.d.ts +14 -0
- package/es/xflow-main/components/app-context.js +75 -0
- package/es/xflow-main/components/app-context.js.map +1 -0
- package/es/xflow-main/components/app-extension-module.d.ts +7 -0
- package/es/xflow-main/components/app-extension-module.js +32 -0
- package/es/xflow-main/components/app-extension-module.js.map +1 -0
- package/es/xflow-main/components/canvas.d.ts +11 -0
- package/es/xflow-main/components/canvas.js +62 -0
- package/es/xflow-main/components/canvas.js.map +1 -0
- package/es/xflow-main/components/extension-context.d.ts +5 -0
- package/es/xflow-main/components/extension-context.js +9 -0
- package/es/xflow-main/components/extension-context.js.map +1 -0
- package/es/xflow-main/components/extension-registry.d.ts +22 -0
- package/es/xflow-main/components/extension-registry.js +61 -0
- package/es/xflow-main/components/extension-registry.js.map +1 -0
- package/es/xflow-main/components/global-config-context.d.ts +3 -0
- package/es/xflow-main/components/global-config-context.js +31 -0
- package/es/xflow-main/components/global-config-context.js.map +1 -0
- package/es/xflow-main/components/index.d.ts +58 -0
- package/es/xflow-main/components/index.js +116 -0
- package/es/xflow-main/components/index.js.map +1 -0
- package/es/xflow-main/graph/config.d.ts +102 -0
- package/es/xflow-main/graph/config.js +233 -0
- package/es/xflow-main/graph/config.js.map +1 -0
- package/es/xflow-main/graph/graph-provider.d.ts +47 -0
- package/es/xflow-main/graph/graph-provider.js +196 -0
- package/es/xflow-main/graph/graph-provider.js.map +1 -0
- package/es/xflow-main/graph/index.d.ts +4 -0
- package/es/xflow-main/graph/index.js +5 -0
- package/es/xflow-main/graph/index.js.map +1 -0
- package/es/xflow-main/graph/module.d.ts +4 -0
- package/es/xflow-main/graph/module.js +16 -0
- package/es/xflow-main/graph/module.js.map +1 -0
- package/es/xflow-main/graph/react-group-node/index.css +44 -0
- package/es/xflow-main/graph/react-group-node/index.d.ts +2 -0
- package/es/xflow-main/graph/react-group-node/index.js +32 -0
- package/es/xflow-main/graph/react-group-node/index.js.map +1 -0
- package/es/xflow-main/graph/react-group-node/index.less +50 -0
- package/es/xflow-main/graph/react-node/index.css +42 -0
- package/es/xflow-main/graph/react-node/index.d.ts +20 -0
- package/es/xflow-main/graph/react-node/index.js +50 -0
- package/es/xflow-main/graph/react-node/index.js.map +1 -0
- package/es/xflow-main/graph/react-node/index.less +49 -0
- package/es/xflow-main/index.d.ts +19 -0
- package/es/xflow-main/index.js +26 -0
- package/es/xflow-main/index.js.map +1 -0
- package/es/xflow-main/interface.d.ts +33 -0
- package/es/xflow-main/interface.js +3 -0
- package/es/xflow-main/interface.js.map +1 -0
- package/es/xflow-main/style/index.css +108 -0
- package/es/xflow-main/style/index.less +31 -0
- package/lib/antd-icons/index.d.ts +20 -0
- package/lib/antd-icons/index.js +34 -0
- package/lib/antd-icons/index.js.map +1 -0
- package/lib/command/__test__/graph-command.spec.d.ts +1 -0
- package/lib/command/__test__/graph-command.spec.js +136 -0
- package/lib/command/__test__/graph-command.spec.js.map +1 -0
- package/lib/command/graph-command.d.ts +177 -0
- package/lib/command/graph-command.js +390 -0
- package/lib/command/graph-command.js.map +1 -0
- package/lib/command/index.d.ts +7 -0
- package/lib/command/index.js +15 -0
- package/lib/command/index.js.map +1 -0
- package/lib/command/interface.d.ts +221 -0
- package/lib/command/interface.js +26 -0
- package/lib/command/interface.js.map +1 -0
- package/lib/command/module.d.ts +2 -0
- package/lib/command/module.js +18 -0
- package/lib/command/module.js.map +1 -0
- package/lib/command-contributions/cmd-context.d.ts +76 -0
- package/lib/command-contributions/cmd-context.js +160 -0
- package/lib/command-contributions/cmd-context.js.map +1 -0
- package/lib/command-contributions/command-contribution.d.ts +23 -0
- package/lib/command-contributions/command-contribution.js +205 -0
- package/lib/command-contributions/command-contribution.js.map +1 -0
- package/lib/command-contributions/components/context.d.ts +11 -0
- package/lib/command-contributions/components/context.js +95 -0
- package/lib/command-contributions/components/context.js.map +1 -0
- package/lib/command-contributions/components/index.d.ts +11 -0
- package/lib/command-contributions/components/index.js +40 -0
- package/lib/command-contributions/components/index.js.map +1 -0
- package/lib/command-contributions/config.d.ts +39 -0
- package/lib/command-contributions/config.js +79 -0
- package/lib/command-contributions/config.js.map +1 -0
- package/lib/command-contributions/constant.d.ts +98 -0
- package/lib/command-contributions/constant.js +275 -0
- package/lib/command-contributions/constant.js.map +1 -0
- package/lib/command-contributions/edge/edge-add.d.ts +83 -0
- package/lib/command-contributions/edge/edge-add.js +179 -0
- package/lib/command-contributions/edge/edge-add.js.map +1 -0
- package/lib/command-contributions/edge/edge-back.d.ts +27 -0
- package/lib/command-contributions/edge/edge-back.js +107 -0
- package/lib/command-contributions/edge/edge-back.js.map +1 -0
- package/lib/command-contributions/edge/edge-del.d.ts +67 -0
- package/lib/command-contributions/edge/edge-del.js +170 -0
- package/lib/command-contributions/edge/edge-del.js.map +1 -0
- package/lib/command-contributions/edge/edge-front.d.ts +27 -0
- package/lib/command-contributions/edge/edge-front.js +107 -0
- package/lib/command-contributions/edge/edge-front.js.map +1 -0
- package/lib/command-contributions/edge/edge-highlight.d.ts +32 -0
- package/lib/command-contributions/edge/edge-highlight.js +121 -0
- package/lib/command-contributions/edge/edge-highlight.js.map +1 -0
- package/lib/command-contributions/edge/edge-update.d.ts +46 -0
- package/lib/command-contributions/edge/edge-update.js +148 -0
- package/lib/command-contributions/edge/edge-update.js.map +1 -0
- package/lib/command-contributions/edge/index.d.ts +50 -0
- package/lib/command-contributions/edge/index.js +23 -0
- package/lib/command-contributions/edge/index.js.map +1 -0
- package/lib/command-contributions/graph/graph-add-tool.d.ts +49 -0
- package/lib/command-contributions/graph/graph-add-tool.js +111 -0
- package/lib/command-contributions/graph/graph-add-tool.js.map +1 -0
- package/lib/command-contributions/graph/graph-cmd-redo.d.ts +40 -0
- package/lib/command-contributions/graph/graph-cmd-redo.js +104 -0
- package/lib/command-contributions/graph/graph-cmd-redo.js.map +1 -0
- package/lib/command-contributions/graph/graph-cmd-undo.d.ts +36 -0
- package/lib/command-contributions/graph/graph-cmd-undo.js +104 -0
- package/lib/command-contributions/graph/graph-cmd-undo.js.map +1 -0
- package/lib/command-contributions/graph/graph-copy.d.ts +39 -0
- package/lib/command-contributions/graph/graph-copy.js +137 -0
- package/lib/command-contributions/graph/graph-copy.js.map +1 -0
- package/lib/command-contributions/graph/graph-del-tool.d.ts +47 -0
- package/lib/command-contributions/graph/graph-del-tool.js +101 -0
- package/lib/command-contributions/graph/graph-del-tool.js.map +1 -0
- package/lib/command-contributions/graph/graph-fulllscreen.d.ts +37 -0
- package/lib/command-contributions/graph/graph-fulllscreen.js +116 -0
- package/lib/command-contributions/graph/graph-fulllscreen.js.map +1 -0
- package/lib/command-contributions/graph/graph-history-redo.d.ts +33 -0
- package/lib/command-contributions/graph/graph-history-redo.js +106 -0
- package/lib/command-contributions/graph/graph-history-redo.js.map +1 -0
- package/lib/command-contributions/graph/graph-history-reset.d.ts +33 -0
- package/lib/command-contributions/graph/graph-history-reset.js +91 -0
- package/lib/command-contributions/graph/graph-history-reset.js.map +1 -0
- package/lib/command-contributions/graph/graph-history-toggle.d.ts +35 -0
- package/lib/command-contributions/graph/graph-history-toggle.js +112 -0
- package/lib/command-contributions/graph/graph-history-toggle.js.map +1 -0
- package/lib/command-contributions/graph/graph-history-undo.d.ts +35 -0
- package/lib/command-contributions/graph/graph-history-undo.js +106 -0
- package/lib/command-contributions/graph/graph-history-undo.js.map +1 -0
- package/lib/command-contributions/graph/graph-layout.d.ts +43 -0
- package/lib/command-contributions/graph/graph-layout.js +104 -0
- package/lib/command-contributions/graph/graph-layout.js.map +1 -0
- package/lib/command-contributions/graph/graph-load-data.d.ts +37 -0
- package/lib/command-contributions/graph/graph-load-data.js +104 -0
- package/lib/command-contributions/graph/graph-load-data.js.map +1 -0
- package/lib/command-contributions/graph/graph-meta.d.ts +47 -0
- package/lib/command-contributions/graph/graph-meta.js +116 -0
- package/lib/command-contributions/graph/graph-meta.js.map +1 -0
- package/lib/command-contributions/graph/graph-paste.d.ts +52 -0
- package/lib/command-contributions/graph/graph-paste.js +196 -0
- package/lib/command-contributions/graph/graph-paste.js.map +1 -0
- package/lib/command-contributions/graph/graph-render.d.ts +53 -0
- package/lib/command-contributions/graph/graph-render.js +360 -0
- package/lib/command-contributions/graph/graph-render.js.map +1 -0
- package/lib/command-contributions/graph/graph-resize.d.ts +40 -0
- package/lib/command-contributions/graph/graph-resize.js +110 -0
- package/lib/command-contributions/graph/graph-resize.js.map +1 -0
- package/lib/command-contributions/graph/graph-save-data.d.ts +43 -0
- package/lib/command-contributions/graph/graph-save-data.js +141 -0
- package/lib/command-contributions/graph/graph-save-data.js.map +1 -0
- package/lib/command-contributions/graph/graph-toggle-multi-select.d.ts +38 -0
- package/lib/command-contributions/graph/graph-toggle-multi-select.js +133 -0
- package/lib/command-contributions/graph/graph-toggle-multi-select.js.map +1 -0
- package/lib/command-contributions/graph/graph-zoom.d.ts +51 -0
- package/lib/command-contributions/graph/graph-zoom.js +122 -0
- package/lib/command-contributions/graph/graph-zoom.js.map +1 -0
- package/lib/command-contributions/graph/index.d.ts +114 -0
- package/lib/command-contributions/graph/index.js +87 -0
- package/lib/command-contributions/graph/index.js.map +1 -0
- package/lib/command-contributions/group/group-add.d.ts +56 -0
- package/lib/command-contributions/group/group-add.js +156 -0
- package/lib/command-contributions/group/group-add.js.map +1 -0
- package/lib/command-contributions/group/group-del.d.ts +43 -0
- package/lib/command-contributions/group/group-del.js +146 -0
- package/lib/command-contributions/group/group-del.js.map +1 -0
- package/lib/command-contributions/group/group-init.d.ts +40 -0
- package/lib/command-contributions/group/group-init.js +139 -0
- package/lib/command-contributions/group/group-init.js.map +1 -0
- package/lib/command-contributions/group/group-toggle-collapse.d.ts +47 -0
- package/lib/command-contributions/group/group-toggle-collapse.js +161 -0
- package/lib/command-contributions/group/group-toggle-collapse.js.map +1 -0
- package/lib/command-contributions/group/index.d.ts +39 -0
- package/lib/command-contributions/group/index.js +18 -0
- package/lib/command-contributions/group/index.js.map +1 -0
- package/lib/command-contributions/index.d.ts +10 -0
- package/lib/command-contributions/index.js +25 -0
- package/lib/command-contributions/index.js.map +1 -0
- package/lib/command-contributions/interface.d.ts +17 -0
- package/lib/command-contributions/interface.js +3 -0
- package/lib/command-contributions/interface.js.map +1 -0
- package/lib/command-contributions/mapping-service.d.ts +20 -0
- package/lib/command-contributions/mapping-service.js +96 -0
- package/lib/command-contributions/mapping-service.js.map +1 -0
- package/lib/command-contributions/models/index.d.ts +24 -0
- package/lib/command-contributions/models/index.js +13 -0
- package/lib/command-contributions/models/index.js.map +1 -0
- package/lib/command-contributions/models/update-model.d.ts +45 -0
- package/lib/command-contributions/models/update-model.js +110 -0
- package/lib/command-contributions/models/update-model.js.map +1 -0
- package/lib/command-contributions/module.d.ts +5 -0
- package/lib/command-contributions/module.js +49 -0
- package/lib/command-contributions/module.js.map +1 -0
- package/lib/command-contributions/node/index.d.ts +70 -0
- package/lib/command-contributions/node/index.js +42 -0
- package/lib/command-contributions/node/index.js.map +1 -0
- package/lib/command-contributions/node/node-add.d.ts +58 -0
- package/lib/command-contributions/node/node-add.js +192 -0
- package/lib/command-contributions/node/node-add.js.map +1 -0
- package/lib/command-contributions/node/node-back.d.ts +32 -0
- package/lib/command-contributions/node/node-back.js +109 -0
- package/lib/command-contributions/node/node-back.js.map +1 -0
- package/lib/command-contributions/node/node-center.d.ts +30 -0
- package/lib/command-contributions/node/node-center.js +91 -0
- package/lib/command-contributions/node/node-center.js.map +1 -0
- package/lib/command-contributions/node/node-del.d.ts +51 -0
- package/lib/command-contributions/node/node-del.js +145 -0
- package/lib/command-contributions/node/node-del.js.map +1 -0
- package/lib/command-contributions/node/node-front.d.ts +27 -0
- package/lib/command-contributions/node/node-front.js +108 -0
- package/lib/command-contributions/node/node-front.js.map +1 -0
- package/lib/command-contributions/node/node-highlight.d.ts +39 -0
- package/lib/command-contributions/node/node-highlight.js +116 -0
- package/lib/command-contributions/node/node-highlight.js.map +1 -0
- package/lib/command-contributions/node/node-move.d.ts +51 -0
- package/lib/command-contributions/node/node-move.js +130 -0
- package/lib/command-contributions/node/node-move.js.map +1 -0
- package/lib/command-contributions/node/node-select.d.ts +30 -0
- package/lib/command-contributions/node/node-select.js +104 -0
- package/lib/command-contributions/node/node-select.js.map +1 -0
- package/lib/command-contributions/node/node-update-port.d.ts +54 -0
- package/lib/command-contributions/node/node-update-port.js +147 -0
- package/lib/command-contributions/node/node-update-port.js.map +1 -0
- package/lib/command-contributions/node/node-update.d.ts +53 -0
- package/lib/command-contributions/node/node-update.js +159 -0
- package/lib/command-contributions/node/node-update.js.map +1 -0
- package/lib/common/deferred.d.ts +8 -0
- package/lib/common/deferred.js +31 -0
- package/lib/common/deferred.js.map +1 -0
- package/lib/common/delay.d.ts +1 -0
- package/lib/common/delay.js +9 -0
- package/lib/common/delay.js.map +1 -0
- package/lib/common/disposable.d.ts +28 -0
- package/lib/common/disposable.js +116 -0
- package/lib/common/disposable.js.map +1 -0
- package/lib/common/event-helper.d.ts +7 -0
- package/lib/common/event-helper.js +12 -0
- package/lib/common/event-helper.js.map +1 -0
- package/lib/common/graph-utils.d.ts +22 -0
- package/lib/common/graph-utils.js +41 -0
- package/lib/common/graph-utils.js.map +1 -0
- package/lib/common/position.d.ts +10 -0
- package/lib/common/position.js +18 -0
- package/lib/common/position.js.map +1 -0
- package/lib/common/rx-model-hook.d.ts +16 -0
- package/lib/common/rx-model-hook.js +108 -0
- package/lib/common/rx-model-hook.js.map +1 -0
- package/lib/common/rx-model.d.ts +66 -0
- package/lib/common/rx-model.js +112 -0
- package/lib/common/rx-model.js.map +1 -0
- package/lib/common/safe-json.d.ts +1 -0
- package/lib/common/safe-json.js +17 -0
- package/lib/common/safe-json.js.map +1 -0
- package/lib/common/types.d.ts +15 -0
- package/lib/common/types.js +3 -0
- package/lib/common/types.js.map +1 -0
- package/lib/common/utils.d.ts +11 -0
- package/lib/common/utils.js +58 -0
- package/lib/common/utils.js.map +1 -0
- package/lib/common/uuid.d.ts +2 -0
- package/lib/common/uuid.js +12 -0
- package/lib/common/uuid.js.map +1 -0
- package/lib/constants.d.ts +31 -0
- package/lib/constants.js +29 -0
- package/lib/constants.js.map +1 -0
- package/lib/hooks/components/index.d.ts +13 -0
- package/lib/hooks/components/index.js +44 -0
- package/lib/hooks/components/index.js.map +1 -0
- package/lib/hooks/config.d.ts +41 -0
- package/lib/hooks/config.js +45 -0
- package/lib/hooks/config.js.map +1 -0
- package/lib/hooks/contributions/default.d.ts +19 -0
- package/lib/hooks/contributions/default.js +60 -0
- package/lib/hooks/contributions/default.js.map +1 -0
- package/lib/hooks/contributions/graph.d.ts +19 -0
- package/lib/hooks/contributions/graph.js +133 -0
- package/lib/hooks/contributions/graph.js.map +1 -0
- package/lib/hooks/hook-registry.d.ts +27 -0
- package/lib/hooks/hook-registry.js +62 -0
- package/lib/hooks/hook-registry.js.map +1 -0
- package/lib/hooks/index.d.ts +4 -0
- package/lib/hooks/index.js +12 -0
- package/lib/hooks/index.js.map +1 -0
- package/lib/hooks/interface.d.ts +62 -0
- package/lib/hooks/interface.js +23 -0
- package/lib/hooks/interface.js.map +1 -0
- package/lib/hooks/module.d.ts +8 -0
- package/lib/hooks/module.js +32 -0
- package/lib/hooks/module.js.map +1 -0
- package/lib/index.d.ts +85 -0
- package/lib/index.js +155 -0
- package/lib/index.js.map +1 -0
- package/lib/interface.d.ts +161 -0
- package/lib/interface.js +24 -0
- package/lib/interface.js.map +1 -0
- package/lib/keybinding/components/index.d.ts +13 -0
- package/lib/keybinding/components/index.js +44 -0
- package/lib/keybinding/components/index.js.map +1 -0
- package/lib/keybinding/config.d.ts +23 -0
- package/lib/keybinding/config.js +48 -0
- package/lib/keybinding/config.js.map +1 -0
- package/lib/keybinding/index.d.ts +4 -0
- package/lib/keybinding/index.js +11 -0
- package/lib/keybinding/index.js.map +1 -0
- package/lib/keybinding/interface.d.ts +52 -0
- package/lib/keybinding/interface.js +9 -0
- package/lib/keybinding/interface.js.map +1 -0
- package/lib/keybinding/keybinding-registry.d.ts +52 -0
- package/lib/keybinding/keybinding-registry.js +166 -0
- package/lib/keybinding/keybinding-registry.js.map +1 -0
- package/lib/keybinding/module.d.ts +8 -0
- package/lib/keybinding/module.js +40 -0
- package/lib/keybinding/module.js.map +1 -0
- package/lib/menu/components/index.d.ts +4 -0
- package/lib/menu/components/index.js +28 -0
- package/lib/menu/components/index.js.map +1 -0
- package/lib/menu/index.d.ts +3 -0
- package/lib/menu/index.js +10 -0
- package/lib/menu/index.js.map +1 -0
- package/lib/menu/interface.d.ts +114 -0
- package/lib/menu/interface.js +21 -0
- package/lib/menu/interface.js.map +1 -0
- package/lib/menu/menu-registry.d.ts +32 -0
- package/lib/menu/menu-registry.js +72 -0
- package/lib/menu/menu-registry.js.map +1 -0
- package/lib/menu/module.d.ts +3 -0
- package/lib/menu/module.js +21 -0
- package/lib/menu/module.js.map +1 -0
- package/lib/model-service/components/index.d.ts +12 -0
- package/lib/model-service/components/index.js +48 -0
- package/lib/model-service/components/index.js.map +1 -0
- package/lib/model-service/config.d.ts +20 -0
- package/lib/model-service/config.js +48 -0
- package/lib/model-service/config.js.map +1 -0
- package/lib/model-service/constant.d.ts +174 -0
- package/lib/model-service/constant.js +186 -0
- package/lib/model-service/constant.js.map +1 -0
- package/lib/model-service/contributions/command-model.d.ts +9 -0
- package/lib/model-service/contributions/command-model.js +63 -0
- package/lib/model-service/contributions/command-model.js.map +1 -0
- package/lib/model-service/contributions/graph-model.d.ts +12 -0
- package/lib/model-service/contributions/graph-model.js +370 -0
- package/lib/model-service/contributions/graph-model.js.map +1 -0
- package/lib/model-service/index.d.ts +6 -0
- package/lib/model-service/index.js +17 -0
- package/lib/model-service/index.js.map +1 -0
- package/lib/model-service/interface.d.ts +66 -0
- package/lib/model-service/interface.js +14 -0
- package/lib/model-service/interface.js.map +1 -0
- package/lib/model-service/model-registry.d.ts +49 -0
- package/lib/model-service/model-registry.js +133 -0
- package/lib/model-service/model-registry.js.map +1 -0
- package/lib/model-service/module.d.ts +9 -0
- package/lib/model-service/module.js +49 -0
- package/lib/model-service/module.js.map +1 -0
- package/lib/model-service/utils.d.ts +5 -0
- package/lib/model-service/utils.js +58 -0
- package/lib/model-service/utils.js.map +1 -0
- package/lib/style/components.css +108 -0
- package/lib/style/components.less +1 -0
- package/lib/style/index.css +0 -0
- package/lib/style/index.less +1 -0
- package/lib/style/themes/default.css +0 -0
- package/lib/style/themes/default.less +2 -0
- package/lib/style/themes/index.css +0 -0
- package/lib/style/themes/index.less +1 -0
- package/lib/toolbar/components/index.d.ts +4 -0
- package/lib/toolbar/components/index.js +27 -0
- package/lib/toolbar/components/index.js.map +1 -0
- package/lib/toolbar/index.d.ts +3 -0
- package/lib/toolbar/index.js +9 -0
- package/lib/toolbar/index.js.map +1 -0
- package/lib/toolbar/interface.d.ts +104 -0
- package/lib/toolbar/interface.js +11 -0
- package/lib/toolbar/interface.js.map +1 -0
- package/lib/toolbar/module.d.ts +8 -0
- package/lib/toolbar/module.js +23 -0
- package/lib/toolbar/module.js.map +1 -0
- package/lib/toolbar/toolbar-registry.d.ts +80 -0
- package/lib/toolbar/toolbar-registry.js +134 -0
- package/lib/toolbar/toolbar-registry.js.map +1 -0
- package/lib/xflow-main/application-module.d.ts +8 -0
- package/lib/xflow-main/application-module.js +50 -0
- package/lib/xflow-main/application-module.js.map +1 -0
- package/lib/xflow-main/application.d.ts +77 -0
- package/lib/xflow-main/application.js +296 -0
- package/lib/xflow-main/application.js.map +1 -0
- package/lib/xflow-main/components/app-context.d.ts +14 -0
- package/lib/xflow-main/components/app-context.js +87 -0
- package/lib/xflow-main/components/app-context.js.map +1 -0
- package/lib/xflow-main/components/app-extension-module.d.ts +7 -0
- package/lib/xflow-main/components/app-extension-module.js +39 -0
- package/lib/xflow-main/components/app-extension-module.js.map +1 -0
- package/lib/xflow-main/components/canvas.d.ts +11 -0
- package/lib/xflow-main/components/canvas.js +69 -0
- package/lib/xflow-main/components/canvas.js.map +1 -0
- package/lib/xflow-main/components/extension-context.d.ts +5 -0
- package/lib/xflow-main/components/extension-context.js +14 -0
- package/lib/xflow-main/components/extension-context.js.map +1 -0
- package/lib/xflow-main/components/extension-registry.d.ts +22 -0
- package/lib/xflow-main/components/extension-registry.js +69 -0
- package/lib/xflow-main/components/extension-registry.js.map +1 -0
- package/lib/xflow-main/components/global-config-context.d.ts +3 -0
- package/lib/xflow-main/components/global-config-context.js +39 -0
- package/lib/xflow-main/components/global-config-context.js.map +1 -0
- package/lib/xflow-main/components/index.d.ts +58 -0
- package/lib/xflow-main/components/index.js +153 -0
- package/lib/xflow-main/components/index.js.map +1 -0
- package/lib/xflow-main/graph/config.d.ts +102 -0
- package/lib/xflow-main/graph/config.js +266 -0
- package/lib/xflow-main/graph/config.js.map +1 -0
- package/lib/xflow-main/graph/graph-provider.d.ts +47 -0
- package/lib/xflow-main/graph/graph-provider.js +259 -0
- package/lib/xflow-main/graph/graph-provider.js.map +1 -0
- package/lib/xflow-main/graph/index.d.ts +4 -0
- package/lib/xflow-main/graph/index.js +11 -0
- package/lib/xflow-main/graph/index.js.map +1 -0
- package/lib/xflow-main/graph/module.d.ts +4 -0
- package/lib/xflow-main/graph/module.js +20 -0
- package/lib/xflow-main/graph/module.js.map +1 -0
- package/lib/xflow-main/graph/react-group-node/index.css +44 -0
- package/lib/xflow-main/graph/react-group-node/index.d.ts +2 -0
- package/lib/xflow-main/graph/react-group-node/index.js +37 -0
- package/lib/xflow-main/graph/react-group-node/index.js.map +1 -0
- package/lib/xflow-main/graph/react-group-node/index.less +50 -0
- package/lib/xflow-main/graph/react-node/index.css +42 -0
- package/lib/xflow-main/graph/react-node/index.d.ts +20 -0
- package/lib/xflow-main/graph/react-node/index.js +56 -0
- package/lib/xflow-main/graph/react-node/index.js.map +1 -0
- package/lib/xflow-main/graph/react-node/index.less +49 -0
- package/lib/xflow-main/index.d.ts +19 -0
- package/lib/xflow-main/index.js +35 -0
- package/lib/xflow-main/index.js.map +1 -0
- package/lib/xflow-main/interface.d.ts +33 -0
- package/lib/xflow-main/interface.js +6 -0
- package/lib/xflow-main/interface.js.map +1 -0
- package/lib/xflow-main/style/index.css +108 -0
- package/lib/xflow-main/style/index.less +31 -0
- package/package.json +119 -0
|
@@ -0,0 +1,390 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GraphCommandRegistry = exports.NCommand = void 0;
|
|
4
|
+
var tslib_1 = require("tslib");
|
|
5
|
+
var mana_syringe_1 = require("mana-syringe");
|
|
6
|
+
var rx_model_1 = require("../common/rx-model");
|
|
7
|
+
var disposable_1 = require("../common/disposable");
|
|
8
|
+
var interface_1 = require("../xflow-main/interface");
|
|
9
|
+
var interface_2 = require("./interface");
|
|
10
|
+
require("reflect-metadata");
|
|
11
|
+
var NCommand;
|
|
12
|
+
(function (NCommand) {
|
|
13
|
+
/* Determine whether object is a Command */
|
|
14
|
+
function is(arg) {
|
|
15
|
+
return !!arg && arg === Object(arg) && 'id' in arg;
|
|
16
|
+
}
|
|
17
|
+
NCommand.is = is;
|
|
18
|
+
/** Comparator function for when sorting commands */
|
|
19
|
+
function compareCommands(a, b) {
|
|
20
|
+
if (a.label && b.label) {
|
|
21
|
+
var aCommand = (a.category ? "".concat(a.category, ": ").concat(a.label) : a.label).toLowerCase();
|
|
22
|
+
var bCommand = (b.category ? "".concat(b.category, ": ").concat(b.label) : b.label).toLowerCase();
|
|
23
|
+
return aCommand.localeCompare(bCommand);
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
return 0;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
NCommand.compareCommands = compareCommands;
|
|
30
|
+
/**
|
|
31
|
+
* Determine if two commands are equal.
|
|
32
|
+
*
|
|
33
|
+
* @param a the first command for comparison.
|
|
34
|
+
* @param b the second command for comparison.
|
|
35
|
+
*/
|
|
36
|
+
function equals(a, b) {
|
|
37
|
+
return (a.id === b.id && a.label === b.label && a.iconName === b.iconName && a.category === b.category);
|
|
38
|
+
}
|
|
39
|
+
NCommand.equals = equals;
|
|
40
|
+
})(NCommand = exports.NCommand || (exports.NCommand = {}));
|
|
41
|
+
var GraphCommandRegistry = /** @class */ (function () {
|
|
42
|
+
function GraphCommandRegistry(contributionProvider) {
|
|
43
|
+
var _this = this;
|
|
44
|
+
this.contributionProvider = contributionProvider;
|
|
45
|
+
/**
|
|
46
|
+
* undo cmd后将命令存储在队列中给redo调用
|
|
47
|
+
*/
|
|
48
|
+
this.redoStack = [];
|
|
49
|
+
/**
|
|
50
|
+
* executeCommand后将命令存储在队列中给undo调用
|
|
51
|
+
*/
|
|
52
|
+
this.undoStack = [];
|
|
53
|
+
/**
|
|
54
|
+
* 储存所有注册的command
|
|
55
|
+
*/
|
|
56
|
+
this.commands = new Map();
|
|
57
|
+
/**
|
|
58
|
+
* 储存所有注册的command factory
|
|
59
|
+
*/
|
|
60
|
+
this.factories = new Map();
|
|
61
|
+
/**
|
|
62
|
+
* 储存所有注册的command handler disposables
|
|
63
|
+
*/
|
|
64
|
+
this.disposables = new Map();
|
|
65
|
+
/**
|
|
66
|
+
* 监听cmdregistry的变化
|
|
67
|
+
*/
|
|
68
|
+
this.cmdChangeEvent = new rx_model_1.RxModel(null);
|
|
69
|
+
/**
|
|
70
|
+
* 在Command实例间共享变量
|
|
71
|
+
*/
|
|
72
|
+
this.Globals = new rx_model_1.RxModel(new Map());
|
|
73
|
+
/** 设置command间的共享变量 */
|
|
74
|
+
this.setGlobal = function (key, value) {
|
|
75
|
+
_this.Globals.setValue(function (map) {
|
|
76
|
+
map.set(key, value);
|
|
77
|
+
});
|
|
78
|
+
};
|
|
79
|
+
/** 获取共享变量 */
|
|
80
|
+
this.getGlobal = function (key) {
|
|
81
|
+
var map = _this.Globals.getValue();
|
|
82
|
+
return map.get(key);
|
|
83
|
+
};
|
|
84
|
+
/**
|
|
85
|
+
* 执行undo stack中最后一条Command
|
|
86
|
+
*/
|
|
87
|
+
this.undoCommand = function () { return tslib_1.__awaiter(_this, void 0, void 0, function () {
|
|
88
|
+
var cmd;
|
|
89
|
+
return tslib_1.__generator(this, function (_a) {
|
|
90
|
+
switch (_a.label) {
|
|
91
|
+
case 0:
|
|
92
|
+
cmd = this.undoStack.pop();
|
|
93
|
+
if (!cmd) {
|
|
94
|
+
console.error('empty undo stack');
|
|
95
|
+
return [2 /*return*/];
|
|
96
|
+
}
|
|
97
|
+
/* 执行命令的undo方法 */
|
|
98
|
+
return [4 /*yield*/, cmd.undo()
|
|
99
|
+
/* 执行后塞到redo的栈中 */
|
|
100
|
+
];
|
|
101
|
+
case 1:
|
|
102
|
+
/* 执行命令的undo方法 */
|
|
103
|
+
_a.sent();
|
|
104
|
+
/* 执行后塞到redo的栈中 */
|
|
105
|
+
this.redoStack.push(cmd);
|
|
106
|
+
/* 触发事件回调 */
|
|
107
|
+
this.cmdChangeEvent.setValue(null);
|
|
108
|
+
return [2 /*return*/];
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
}); };
|
|
112
|
+
/**
|
|
113
|
+
* 执行redo stack中最后一条Command
|
|
114
|
+
*/
|
|
115
|
+
this.redoCommand = function () { return tslib_1.__awaiter(_this, void 0, void 0, function () {
|
|
116
|
+
var cmd;
|
|
117
|
+
return tslib_1.__generator(this, function (_a) {
|
|
118
|
+
switch (_a.label) {
|
|
119
|
+
case 0:
|
|
120
|
+
cmd = this.redoStack.pop();
|
|
121
|
+
if (!cmd) {
|
|
122
|
+
console.error('empty undo stack');
|
|
123
|
+
return [2 /*return*/];
|
|
124
|
+
}
|
|
125
|
+
/* 执行命令的undo */
|
|
126
|
+
return [4 /*yield*/, cmd.redo()
|
|
127
|
+
/* 执行后塞到undo的栈中 */
|
|
128
|
+
];
|
|
129
|
+
case 1:
|
|
130
|
+
/* 执行命令的undo */
|
|
131
|
+
_a.sent();
|
|
132
|
+
/* 执行后塞到undo的栈中 */
|
|
133
|
+
this.undoStack.push(cmd);
|
|
134
|
+
/* 触发事件回调 */
|
|
135
|
+
this.cmdChangeEvent.setValue(null);
|
|
136
|
+
return [2 /*return*/];
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
}); };
|
|
140
|
+
/**
|
|
141
|
+
* 注册一批可单独dispose的Command
|
|
142
|
+
* @param externalRegisterFn ICommandRegisterFunction
|
|
143
|
+
*/
|
|
144
|
+
this.registerDisposableCommand = function (externalRegisterFn) {
|
|
145
|
+
var toDispose = new disposable_1.DisposableCollection();
|
|
146
|
+
var disposableRegistry = {
|
|
147
|
+
registerCommand: function (command, factory) {
|
|
148
|
+
var disposable = _this.registerCommand(command, factory);
|
|
149
|
+
toDispose.push(disposable);
|
|
150
|
+
return disposable;
|
|
151
|
+
},
|
|
152
|
+
};
|
|
153
|
+
externalRegisterFn(disposableRegistry);
|
|
154
|
+
return toDispose;
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
Object.defineProperty(GraphCommandRegistry.prototype, "watchChange", {
|
|
158
|
+
/**
|
|
159
|
+
* 监听cmdregistry的变化
|
|
160
|
+
*/
|
|
161
|
+
get: function () {
|
|
162
|
+
return this.cmdChangeEvent.watch;
|
|
163
|
+
},
|
|
164
|
+
enumerable: false,
|
|
165
|
+
configurable: true
|
|
166
|
+
});
|
|
167
|
+
GraphCommandRegistry.prototype.onStart = function () {
|
|
168
|
+
var contributions = this.contributionProvider.getContributions();
|
|
169
|
+
for (var _i = 0, contributions_1 = contributions; _i < contributions_1.length; _i++) {
|
|
170
|
+
var contribItem = contributions_1[_i];
|
|
171
|
+
contribItem.registerGraphCommands(this);
|
|
172
|
+
}
|
|
173
|
+
};
|
|
174
|
+
GraphCommandRegistry.prototype.executeCommandPipeline = function (cmdOptions) {
|
|
175
|
+
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
176
|
+
var res, _i, cmdOptions_1, cmdOption, cmdCtx, _a, args, hooks;
|
|
177
|
+
return tslib_1.__generator(this, function (_b) {
|
|
178
|
+
switch (_b.label) {
|
|
179
|
+
case 0:
|
|
180
|
+
res = null;
|
|
181
|
+
_i = 0, cmdOptions_1 = cmdOptions;
|
|
182
|
+
_b.label = 1;
|
|
183
|
+
case 1:
|
|
184
|
+
if (!(_i < cmdOptions_1.length)) return [3 /*break*/, 5];
|
|
185
|
+
cmdOption = cmdOptions_1[_i];
|
|
186
|
+
cmdCtx = res === null || res === void 0 ? void 0 : res.contextProvider();
|
|
187
|
+
return [4 /*yield*/, (cmdOption === null || cmdOption === void 0 ? void 0 : cmdOption.getCommandOption(cmdCtx))];
|
|
188
|
+
case 2:
|
|
189
|
+
_a = _b.sent(), args = _a.args, hooks = _a.hooks;
|
|
190
|
+
return [4 /*yield*/, this.executeCommand(cmdOption === null || cmdOption === void 0 ? void 0 : cmdOption.commandId, args, hooks)];
|
|
191
|
+
case 3:
|
|
192
|
+
res = _b.sent();
|
|
193
|
+
_b.label = 4;
|
|
194
|
+
case 4:
|
|
195
|
+
_i++;
|
|
196
|
+
return [3 /*break*/, 1];
|
|
197
|
+
case 5:
|
|
198
|
+
/* 触发事件回调 */
|
|
199
|
+
this.cmdChangeEvent.setValue(null);
|
|
200
|
+
return [2 /*return*/, res];
|
|
201
|
+
}
|
|
202
|
+
});
|
|
203
|
+
});
|
|
204
|
+
};
|
|
205
|
+
/** 执行 Command:会在undo stack中push cmd */
|
|
206
|
+
GraphCommandRegistry.prototype.executeCommand = function (commandId, cmdArgs, hook) {
|
|
207
|
+
if (hook === void 0) { hook = []; }
|
|
208
|
+
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
209
|
+
var factory, cmd;
|
|
210
|
+
return tslib_1.__generator(this, function (_a) {
|
|
211
|
+
switch (_a.label) {
|
|
212
|
+
case 0:
|
|
213
|
+
factory = this.getFactory(commandId);
|
|
214
|
+
if (!factory) return [3 /*break*/, 3];
|
|
215
|
+
return [4 /*yield*/, factory.createCommand(commandId, cmdArgs, hook)];
|
|
216
|
+
case 1:
|
|
217
|
+
cmd = (_a.sent());
|
|
218
|
+
return [4 /*yield*/, cmd.execute()];
|
|
219
|
+
case 2:
|
|
220
|
+
_a.sent();
|
|
221
|
+
if (cmd.isUndoable()) {
|
|
222
|
+
this.undoStack.push(cmd);
|
|
223
|
+
}
|
|
224
|
+
/* 触发事件回调 */
|
|
225
|
+
this.cmdChangeEvent.setValue(null);
|
|
226
|
+
return [2 /*return*/, cmd];
|
|
227
|
+
case 3: throw Object.assign(new Error("The command '".concat(commandId, "' cannot be executed. There are no active handlers available for the command.")), { code: 'NO_ACTIVE_HANDLER' });
|
|
228
|
+
}
|
|
229
|
+
});
|
|
230
|
+
});
|
|
231
|
+
};
|
|
232
|
+
/** 执行 unod Command:不会在undo stack中push新的command记录 */
|
|
233
|
+
GraphCommandRegistry.prototype.executeUndoCommand = function (commandId, cmdArgs, hook) {
|
|
234
|
+
if (hook === void 0) { hook = []; }
|
|
235
|
+
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
236
|
+
var factory, cmd;
|
|
237
|
+
return tslib_1.__generator(this, function (_a) {
|
|
238
|
+
switch (_a.label) {
|
|
239
|
+
case 0:
|
|
240
|
+
factory = this.getFactory(commandId);
|
|
241
|
+
if (!factory) return [3 /*break*/, 3];
|
|
242
|
+
return [4 /*yield*/, factory.createCommand(commandId, cmdArgs, hook)];
|
|
243
|
+
case 1:
|
|
244
|
+
cmd = _a.sent();
|
|
245
|
+
return [4 /*yield*/, cmd.execute()];
|
|
246
|
+
case 2:
|
|
247
|
+
_a.sent();
|
|
248
|
+
return [2 /*return*/, cmd];
|
|
249
|
+
case 3: throw Object.assign(new Error("The command '".concat(commandId, "' cannot be executed. There are no active handlers available for the command.")), { code: 'NO_ACTIVE_HANDLER' });
|
|
250
|
+
}
|
|
251
|
+
});
|
|
252
|
+
});
|
|
253
|
+
};
|
|
254
|
+
/**
|
|
255
|
+
* Execute the active handler for the given command and arguments.
|
|
256
|
+
*
|
|
257
|
+
* Reject if a command cannot be executed.
|
|
258
|
+
*/
|
|
259
|
+
GraphCommandRegistry.prototype.createCommand = function (commandId, cmdArgs, hook) {
|
|
260
|
+
if (hook === void 0) { hook = []; }
|
|
261
|
+
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
262
|
+
var factory, cmd;
|
|
263
|
+
return tslib_1.__generator(this, function (_a) {
|
|
264
|
+
switch (_a.label) {
|
|
265
|
+
case 0:
|
|
266
|
+
factory = this.getFactory(commandId);
|
|
267
|
+
if (!factory) return [3 /*break*/, 2];
|
|
268
|
+
return [4 /*yield*/, factory.createCommand(commandId, cmdArgs, hook)];
|
|
269
|
+
case 1:
|
|
270
|
+
cmd = _a.sent();
|
|
271
|
+
return [2 /*return*/, cmd];
|
|
272
|
+
case 2: throw Object.assign(new Error("The command '".concat(commandId, "' cannot be executed. There are no active handlers available for the command.")), { code: 'NO_ACTIVE_HANDLER' });
|
|
273
|
+
}
|
|
274
|
+
});
|
|
275
|
+
});
|
|
276
|
+
};
|
|
277
|
+
Object.defineProperty(GraphCommandRegistry.prototype, "isUndoable", {
|
|
278
|
+
/**
|
|
279
|
+
* 检查是否注册了Command
|
|
280
|
+
*/
|
|
281
|
+
get: function () {
|
|
282
|
+
return this.undoStack.length > 0;
|
|
283
|
+
},
|
|
284
|
+
enumerable: false,
|
|
285
|
+
configurable: true
|
|
286
|
+
});
|
|
287
|
+
Object.defineProperty(GraphCommandRegistry.prototype, "isRedoable", {
|
|
288
|
+
/**
|
|
289
|
+
* 检查是否注册了Command
|
|
290
|
+
*/
|
|
291
|
+
get: function () {
|
|
292
|
+
return this.redoStack.length > 0;
|
|
293
|
+
},
|
|
294
|
+
enumerable: false,
|
|
295
|
+
configurable: true
|
|
296
|
+
});
|
|
297
|
+
/**
|
|
298
|
+
* 检查是否注册了Command
|
|
299
|
+
*/
|
|
300
|
+
GraphCommandRegistry.prototype.hasCommand = function (commandId) {
|
|
301
|
+
return this.commands.has(commandId);
|
|
302
|
+
};
|
|
303
|
+
/**
|
|
304
|
+
* Get a command for the given command identifier.
|
|
305
|
+
*/
|
|
306
|
+
GraphCommandRegistry.prototype.getCommand = function (id) {
|
|
307
|
+
return this.commands.get(id);
|
|
308
|
+
};
|
|
309
|
+
/**
|
|
310
|
+
* Register the given command and handler if present.
|
|
311
|
+
*
|
|
312
|
+
* Throw if a command is already registered for the given command identifier.
|
|
313
|
+
*/
|
|
314
|
+
GraphCommandRegistry.prototype.registerCommand = function (command, factory) {
|
|
315
|
+
var _this = this;
|
|
316
|
+
if (this.factories.has(command.id)) {
|
|
317
|
+
console.warn("A command ".concat(command.id, " is already registered."));
|
|
318
|
+
return disposable_1.Disposable.NULL;
|
|
319
|
+
}
|
|
320
|
+
var toDispose = new disposable_1.DisposableCollection(this.doRegisterCommand(command), this.registerFactory(command.id, factory), disposable_1.Disposable.create(function () { return _this.disposables.delete(command.id); }));
|
|
321
|
+
this.disposables.set(command.id, toDispose);
|
|
322
|
+
return toDispose;
|
|
323
|
+
};
|
|
324
|
+
GraphCommandRegistry.prototype.doRegisterCommand = function (command) {
|
|
325
|
+
var _this = this;
|
|
326
|
+
this.commands.set(command.id, command);
|
|
327
|
+
return disposable_1.Disposable.create(function () { return _this.disposables.delete(command.id); });
|
|
328
|
+
};
|
|
329
|
+
/**
|
|
330
|
+
* Unregister command from the registry
|
|
331
|
+
*
|
|
332
|
+
* @param id
|
|
333
|
+
*/
|
|
334
|
+
GraphCommandRegistry.prototype.unregisterCommand = function (commandOrId) {
|
|
335
|
+
var id = NCommand.is(commandOrId) ? commandOrId.id : commandOrId;
|
|
336
|
+
var disposableCmd = this.disposables.get(id);
|
|
337
|
+
if (disposableCmd) {
|
|
338
|
+
disposableCmd.dispose();
|
|
339
|
+
}
|
|
340
|
+
};
|
|
341
|
+
/**
|
|
342
|
+
* 检查commandId是否有Factory
|
|
343
|
+
*/
|
|
344
|
+
GraphCommandRegistry.prototype.hasFactory = function (commandId) {
|
|
345
|
+
var factory = this.factories.get(commandId);
|
|
346
|
+
return !!factory;
|
|
347
|
+
};
|
|
348
|
+
/**
|
|
349
|
+
* Get a visible handler for the given command or `undefined`.
|
|
350
|
+
*/
|
|
351
|
+
GraphCommandRegistry.prototype.getFactory = function (commandId) {
|
|
352
|
+
var factory = this.factories.get(commandId);
|
|
353
|
+
return factory;
|
|
354
|
+
};
|
|
355
|
+
/**
|
|
356
|
+
* Register the given handler for the given command identifier.
|
|
357
|
+
*
|
|
358
|
+
* If there is already a handler for the given command
|
|
359
|
+
* then the given handler is registered as more specific, and
|
|
360
|
+
* has higher priority during enablement, visibility and toggle state evaluations.
|
|
361
|
+
*/
|
|
362
|
+
GraphCommandRegistry.prototype.registerFactory = function (commandId, factory, force) {
|
|
363
|
+
var _this = this;
|
|
364
|
+
if (force === void 0) { force = false; }
|
|
365
|
+
if (this.hasFactory(commandId) && force === false) {
|
|
366
|
+
console.error('cannot register command:', commandId);
|
|
367
|
+
}
|
|
368
|
+
this.factories.set(commandId, factory);
|
|
369
|
+
return disposable_1.Disposable.create(function () {
|
|
370
|
+
_this.factories.delete(commandId);
|
|
371
|
+
});
|
|
372
|
+
};
|
|
373
|
+
/**
|
|
374
|
+
* Returns with all handlers for the given command. If the command does not have any handlers,
|
|
375
|
+
* or the command is not registered, returns an empty array.
|
|
376
|
+
*/
|
|
377
|
+
GraphCommandRegistry.prototype.getAllFactories = function () {
|
|
378
|
+
return Array.from(this.factories.entries());
|
|
379
|
+
};
|
|
380
|
+
GraphCommandRegistry = tslib_1.__decorate([
|
|
381
|
+
(0, mana_syringe_1.singleton)({
|
|
382
|
+
contrib: [interface_1.IFrontendApplicationContribution, interface_2.IGraphCommandService],
|
|
383
|
+
}),
|
|
384
|
+
tslib_1.__param(0, (0, mana_syringe_1.contrib)(interface_2.IGraphCommandContribution)),
|
|
385
|
+
tslib_1.__metadata("design:paramtypes", [Object])
|
|
386
|
+
], GraphCommandRegistry);
|
|
387
|
+
return GraphCommandRegistry;
|
|
388
|
+
}());
|
|
389
|
+
exports.GraphCommandRegistry = GraphCommandRegistry;
|
|
390
|
+
//# sourceMappingURL=graph-command.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graph-command.js","sourceRoot":"","sources":["../../src/command/graph-command.ts"],"names":[],"mappings":";;;;AAAA,6CAA+D;AAC/D,+CAA4C;AAC5C,mDAAuE;AACvE,qDAA0E;AAQ1E,yCAA6E;AAE7E,4BAAyB;AAEzB,IAAiB,QAAQ,CA4BxB;AA5BD,WAAiB,QAAQ;IACvB,2CAA2C;IAC3C,SAAgB,EAAE,CAAC,GAAwB;QACzC,OAAO,CAAC,CAAC,GAAG,IAAI,GAAG,KAAK,MAAM,CAAC,GAAG,CAAC,IAAI,IAAI,IAAI,GAAG,CAAA;IACpD,CAAC;IAFe,WAAE,KAEjB,CAAA;IAED,oDAAoD;IACpD,SAAgB,eAAe,CAAC,CAAgB,EAAE,CAAgB;QAChE,IAAI,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,KAAK,EAAE;YACtB,IAAM,QAAQ,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,UAAG,CAAC,CAAC,QAAQ,eAAK,CAAC,CAAC,KAAK,CAAE,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,WAAW,EAAE,CAAA;YACnF,IAAM,QAAQ,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,UAAG,CAAC,CAAC,QAAQ,eAAK,CAAC,CAAC,KAAK,CAAE,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,WAAW,EAAE,CAAA;YACnF,OAAO,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAA;SACxC;aAAM;YACL,OAAO,CAAC,CAAA;SACT;IACH,CAAC;IARe,wBAAe,kBAQ9B,CAAA;IAED;;;;;OAKG;IACH,SAAgB,MAAM,CAAC,CAAgB,EAAE,CAAgB;QACvD,OAAO,CACL,CA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AAS,CAAC,GAAG,CAAC,SAAS,CAAC,CAAA;QAC7C,OAAO,OAAO,CAAA;IAChB,CAAC;IACD;;;;;;OAMG;IACH,8CAAe,GAAf,UAAgB,SAAiB,EAAE,OAAwB,EAAE,KAAsB;QAAnF,iBAQC;QAR4D,sBAAA,EAAA,aAAsB;QACjF,IAAI,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,IAAI,KAAK,KAAK,KAAK,EAAE;YACjD,OAAO,CAAC,KAAK,CAAC,0BAA0B,EAAE,SAAS,CAAC,CAAA;SACrD;QACD,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,SAAS,EAAE,OAAO,CAAC,CAAA;QACtC,OAAO,uBAAU,CAAC,MAAM,CAAC;YACvB,KAAI,CAAC,SAAS,CAAC,MAAM,CAAC,SAAS,CAAC,CAAA;QAClC,CAAC,CAAC,CAAA;IACJ,CAAC;IAED;;;OAGG;IACH,8CAAe,GAAf;QACE,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC,CAAA;IAC7C,CAAC;IA3SU,oBAAoB;QAHhC,IAAA,wBAAS,EAAC;YACT,OAAO,EAAE,CAAC,4CAAgC,EAAE,gCAAoB,CAAC;SAClE,CAAC;QAmDG,mBAAA,IAAA,sBAAO,EAAC,qCAAyB,CAAC,CAAA;;OAlD1B,oBAAoB,CA4ShC;IAAD,2BAAC;CAAA,AA/SD,IA+SC;AA5SY,oDAAoB"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** Command */
|
|
2
|
+
import { GraphCommandRegistry } from './graph-command';
|
|
3
|
+
import { commandRegistryModule } from './module';
|
|
4
|
+
import type { IArgsBase, IGraphCommand, ICommandConfig, IGraphPipelineCommand } from './interface';
|
|
5
|
+
import { IGraphCommandContribution, ICommandHandler, IGraphCommandService, IGraphCommandFactory, ICommandContextProvider } from './interface';
|
|
6
|
+
export type { IArgsBase, IGraphCommand, ICommandConfig, IGraphPipelineCommand };
|
|
7
|
+
export { ICommandHandler, IGraphCommandService, ICommandContextProvider, IGraphCommandContribution, IGraphCommandFactory, GraphCommandRegistry, commandRegistryModule, };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.commandRegistryModule = exports.GraphCommandRegistry = exports.IGraphCommandFactory = exports.IGraphCommandContribution = exports.ICommandContextProvider = exports.IGraphCommandService = exports.ICommandHandler = void 0;
|
|
4
|
+
/** Command */
|
|
5
|
+
var graph_command_1 = require("./graph-command");
|
|
6
|
+
Object.defineProperty(exports, "GraphCommandRegistry", { enumerable: true, get: function () { return graph_command_1.GraphCommandRegistry; } });
|
|
7
|
+
var module_1 = require("./module");
|
|
8
|
+
Object.defineProperty(exports, "commandRegistryModule", { enumerable: true, get: function () { return module_1.commandRegistryModule; } });
|
|
9
|
+
var interface_1 = require("./interface");
|
|
10
|
+
Object.defineProperty(exports, "IGraphCommandContribution", { enumerable: true, get: function () { return interface_1.IGraphCommandContribution; } });
|
|
11
|
+
Object.defineProperty(exports, "ICommandHandler", { enumerable: true, get: function () { return interface_1.ICommandHandler; } });
|
|
12
|
+
Object.defineProperty(exports, "IGraphCommandService", { enumerable: true, get: function () { return interface_1.IGraphCommandService; } });
|
|
13
|
+
Object.defineProperty(exports, "IGraphCommandFactory", { enumerable: true, get: function () { return interface_1.IGraphCommandFactory; } });
|
|
14
|
+
Object.defineProperty(exports, "ICommandContextProvider", { enumerable: true, get: function () { return interface_1.ICommandContextProvider; } });
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/command/index.ts"],"names":[],"mappings":";;;AAAA,cAAc;AACd,iDAAsD;AAmBpD,qGAnBO,oCAAoB,OAmBP;AAlBtB,mCAAgD;AAmB9C,sGAnBO,8BAAqB,OAmBP;AAjBvB,yCAMoB;AAQlB,0GAbA,qCAAyB,OAaA;AAHzB,gGATA,2BAAe,OASA;AACf,qGATA,gCAAoB,OASA;AAGpB,qGAXA,gCAAoB,OAWA;AAFpB,wGARA,mCAAuB,OAQA"}
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
import { Syringe } from 'mana-syringe';
|
|
2
|
+
import type { Disposable, DisposableCollection } from '../common/disposable';
|
|
3
|
+
import type { Graph as X6Graph } from '@antv/x6';
|
|
4
|
+
import type { IGraphConfig } from '../xflow-main/graph/config';
|
|
5
|
+
import type { NsModel, RxModel } from '../common/rx-model';
|
|
6
|
+
import type { IModelService } from '../model-service';
|
|
7
|
+
import type { IHooks } from '../command-contributions/interface';
|
|
8
|
+
import type { IRuntimeHook } from '@sunspirytus/xflow-hook/es/interface';
|
|
9
|
+
import type { NsGraph } from '../interface';
|
|
10
|
+
/**
|
|
11
|
+
* A command is a unique identifier of a function
|
|
12
|
+
* which can be executed by a user via a keyboard shortcut,
|
|
13
|
+
* a menu action or directly.
|
|
14
|
+
*/
|
|
15
|
+
export interface IGraphCommand {
|
|
16
|
+
/**
|
|
17
|
+
* A unique identifier of this command.
|
|
18
|
+
*/
|
|
19
|
+
id: string;
|
|
20
|
+
/**
|
|
21
|
+
* A label of this command.
|
|
22
|
+
*/
|
|
23
|
+
label?: string;
|
|
24
|
+
/**
|
|
25
|
+
* An icon class of this command.
|
|
26
|
+
*/
|
|
27
|
+
iconName?: string;
|
|
28
|
+
/**
|
|
29
|
+
* A category of this command.
|
|
30
|
+
*/
|
|
31
|
+
category?: string;
|
|
32
|
+
}
|
|
33
|
+
/** Command 状态 */
|
|
34
|
+
export interface ICommandState {
|
|
35
|
+
/**
|
|
36
|
+
* cmd是否可以执行
|
|
37
|
+
*/
|
|
38
|
+
isEnabled: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* cmd是否可见
|
|
41
|
+
*/
|
|
42
|
+
isVisible: boolean;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* IGraphCommandService
|
|
46
|
+
* 声明执行Command的接口
|
|
47
|
+
*/
|
|
48
|
+
export declare const IGraphCommandService: unique symbol;
|
|
49
|
+
export interface IGraphCommandService {
|
|
50
|
+
/** event:可以监听CommandService的变化 */
|
|
51
|
+
watchChange: NsModel.IWatch<null>;
|
|
52
|
+
/** 撤销命令 */
|
|
53
|
+
undoCommand: () => Promise<void>;
|
|
54
|
+
/** 重做命令 */
|
|
55
|
+
redoCommand: () => Promise<void>;
|
|
56
|
+
/** 是否可重做 */
|
|
57
|
+
isRedoable: boolean;
|
|
58
|
+
/** 是否可撤销 */
|
|
59
|
+
isUndoable: boolean;
|
|
60
|
+
/** 执行原子命令:会在undo stack中push cmd */
|
|
61
|
+
executeCommand: <Args = any, Result = any>(commandId: string, args: Args, hooks?: IRuntimeHook<Args, Result>) => Promise<ICommandHandler<Args, Result> | undefined>;
|
|
62
|
+
/** 用pipeline执行命令 */
|
|
63
|
+
executeCommandPipeline: (cmdOptions: IGraphPipelineCommand[]) => Promise<ICommandHandler | undefined>;
|
|
64
|
+
/** 执行撤销命令:不会在undo stack中push新的command记录 */
|
|
65
|
+
executeUndoCommand: <Args, Result = any>(commandId: string, args: Args, hooks?: IRuntimeHook<Args, Result>) => Promise<ICommandHandler<Args, Result> | undefined>;
|
|
66
|
+
/** 注册Command */
|
|
67
|
+
registerCommand: (command: IGraphCommand, factory: ICommandFactory) => Disposable;
|
|
68
|
+
/** 注册Command */
|
|
69
|
+
setGlobal: (key: string, value: any) => void;
|
|
70
|
+
/** 注册Command */
|
|
71
|
+
getGlobal: (key: string) => void;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Command factory
|
|
75
|
+
* 负责创建Command实例
|
|
76
|
+
*/
|
|
77
|
+
export interface ICommandFactory<Args = any, Result = any, ICmdHooks = IHooks> {
|
|
78
|
+
/**
|
|
79
|
+
* 生成一个command
|
|
80
|
+
*/
|
|
81
|
+
createCommand: (commandId: string, args: Args, hooks: IRuntimeHook<Args, Result>) => ICommandHandler<Args, Result, ICmdHooks>;
|
|
82
|
+
/**
|
|
83
|
+
* 创建cmd state
|
|
84
|
+
*/
|
|
85
|
+
createCmdState?: (IContextService: IModelService) => Promise<RxModel<ICommandState>>;
|
|
86
|
+
/**
|
|
87
|
+
* cmd是否可用的state
|
|
88
|
+
*/
|
|
89
|
+
cmdState?: RxModel<ICommandState>;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Command Handler 的 Token
|
|
93
|
+
*/
|
|
94
|
+
export declare const ICommandHandler: Syringe.DefinedToken;
|
|
95
|
+
/**
|
|
96
|
+
* Command Handler
|
|
97
|
+
* 负责Command的执行逻辑
|
|
98
|
+
*/
|
|
99
|
+
export interface ICommandHandler<Args = any, Result = any, ICmdHooks = IHooks> {
|
|
100
|
+
/**
|
|
101
|
+
* 执行cmd返回的disposables
|
|
102
|
+
*
|
|
103
|
+
* Reject if a command cannot be executed.
|
|
104
|
+
*/
|
|
105
|
+
execute: () => Promise<ICommandHandler>;
|
|
106
|
+
/**
|
|
107
|
+
* 执行 undo
|
|
108
|
+
*/
|
|
109
|
+
undo: () => Promise<ICommandHandler>;
|
|
110
|
+
/**
|
|
111
|
+
* 执行 redo
|
|
112
|
+
*/
|
|
113
|
+
redo: () => Promise<ICommandHandler>;
|
|
114
|
+
/**
|
|
115
|
+
* isUndoable
|
|
116
|
+
*/
|
|
117
|
+
isUndoable: () => boolean;
|
|
118
|
+
/**
|
|
119
|
+
* 获取执行cmd的context
|
|
120
|
+
*/
|
|
121
|
+
contextProvider: () => IContext<Args, Result, ICmdHooks>;
|
|
122
|
+
}
|
|
123
|
+
/** Command Context Provider 的 Symbol 提供执行需要的各种api */
|
|
124
|
+
export declare const ICommandContextProvider: unique symbol;
|
|
125
|
+
/**
|
|
126
|
+
* Command Context Provider: 返回Command执行需要的IContext
|
|
127
|
+
*/
|
|
128
|
+
export interface ICommandContextProvider<Args = any, Result = any, ICmdHooks = IHooks> {
|
|
129
|
+
(): IContext<Args, Result, ICmdHooks>;
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Command Context: 提供Command执行需要的各种api
|
|
133
|
+
*/
|
|
134
|
+
export interface IContext<Args extends IArgsBase = any, Result = any, Hooks = IHooks> {
|
|
135
|
+
/** 执行undo */
|
|
136
|
+
undo: () => Promise<void>;
|
|
137
|
+
/** 添加undo */
|
|
138
|
+
addUndo: (disposable: Disposable) => Disposable;
|
|
139
|
+
/** 是否可以undo */
|
|
140
|
+
isUndoable: () => boolean;
|
|
141
|
+
/** 获取参数 */
|
|
142
|
+
getArgs: () => {
|
|
143
|
+
args: Args;
|
|
144
|
+
hooks: IRuntimeHook<Args, Result>;
|
|
145
|
+
};
|
|
146
|
+
/** 设置参数 */
|
|
147
|
+
setArgs: (args: Args, hooks: IRuntimeHook<Args, Result>) => {
|
|
148
|
+
args: Args;
|
|
149
|
+
hooks: IRuntimeHook<Args, Result>;
|
|
150
|
+
};
|
|
151
|
+
/** 获取结果 */
|
|
152
|
+
getResult: () => Result;
|
|
153
|
+
/** 设置结果 */
|
|
154
|
+
setResult: (result: Result) => Result;
|
|
155
|
+
/** 获取hooks */
|
|
156
|
+
getHooks: () => Hooks;
|
|
157
|
+
/** 获取Graph */
|
|
158
|
+
getX6Graph: () => Promise<X6Graph>;
|
|
159
|
+
/** 获取GraphMeta */
|
|
160
|
+
getGraphMeta: () => Promise<NsGraph.IGraphMeta>;
|
|
161
|
+
/** 获取Graph配置 */
|
|
162
|
+
getGraphConfig: () => Promise<IGraphConfig>;
|
|
163
|
+
/** 获取Command */
|
|
164
|
+
getCommands: () => IGraphCommandService;
|
|
165
|
+
/** 获取ModelService */
|
|
166
|
+
getModelService: () => IModelService;
|
|
167
|
+
/** 获取Disposables */
|
|
168
|
+
getDisposables: () => DisposableCollection;
|
|
169
|
+
/** 设置command间的共享变量 */
|
|
170
|
+
setGlobal: <T extends unknown = any>(key: string, value: T) => void;
|
|
171
|
+
/** 获取共享变量 */
|
|
172
|
+
getGlobal: <T extends unknown = any>(key: string) => T;
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* IGraphCommandFactory
|
|
176
|
+
* Command工厂方法
|
|
177
|
+
*/
|
|
178
|
+
export declare const IGraphCommandFactory: unique symbol;
|
|
179
|
+
export interface IGraphCommandFactory<Args = any, Result = any> {
|
|
180
|
+
(cmdId: string, cmdArgs: Args, hooks?: IRuntimeHook<Args, Result>): ICommandHandler<Args, Result>;
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* Command注册扩展的Symbol
|
|
184
|
+
*/
|
|
185
|
+
export declare const IGraphCommandContribution: Syringe.DefinedToken;
|
|
186
|
+
/**
|
|
187
|
+
* Command的扩展类型
|
|
188
|
+
*/
|
|
189
|
+
export interface IGraphCommandContribution {
|
|
190
|
+
/**
|
|
191
|
+
* Register commands and handlers.
|
|
192
|
+
*/
|
|
193
|
+
registerGraphCommands: (commands: IGraphCommandService) => void;
|
|
194
|
+
}
|
|
195
|
+
/** 执行command需要的参数 */
|
|
196
|
+
export interface ICommandConfig<Args extends IArgsBase = any> {
|
|
197
|
+
/** command id */
|
|
198
|
+
commandId?: string;
|
|
199
|
+
/** command 参数 */
|
|
200
|
+
args: Args;
|
|
201
|
+
/** command hook */
|
|
202
|
+
hooks?: IRuntimeHook;
|
|
203
|
+
}
|
|
204
|
+
/** 执行command参数的基类 */
|
|
205
|
+
export interface IArgsBase {
|
|
206
|
+
commandService?: IGraphCommandService;
|
|
207
|
+
modelService?: IModelService;
|
|
208
|
+
}
|
|
209
|
+
/** Pipeline命令参数 */
|
|
210
|
+
export interface IGraphPipelineCommand<Args extends IArgsBase = any, Result = any, ICmdHooks = IHooks> {
|
|
211
|
+
commandId: string;
|
|
212
|
+
getCommandOption: (ctx: IContext<Args, Result, ICmdHooks>) => Promise<ICommandConfig<Args>>;
|
|
213
|
+
}
|
|
214
|
+
/** 执行command需要的参数 */
|
|
215
|
+
export interface IGenericCmdOptions<T = any, Args extends IArgsBase = any> {
|
|
216
|
+
(item: T, modelService: IModelService, cmd: IGraphCommandService): Promise<ICommandConfig<Args>>;
|
|
217
|
+
}
|
|
218
|
+
/** Command 注册函数 */
|
|
219
|
+
export interface ICommandRegisterFunction {
|
|
220
|
+
(registry: Pick<IGraphCommandService, 'registerCommand'>): void;
|
|
221
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.IGraphCommandContribution = exports.IGraphCommandFactory = exports.ICommandContextProvider = exports.ICommandHandler = exports.IGraphCommandService = void 0;
|
|
4
|
+
// utils
|
|
5
|
+
var mana_syringe_1 = require("mana-syringe");
|
|
6
|
+
/**
|
|
7
|
+
* IGraphCommandService
|
|
8
|
+
* 声明执行Command的接口
|
|
9
|
+
*/
|
|
10
|
+
exports.IGraphCommandService = Symbol('IGraphCommandService');
|
|
11
|
+
/**
|
|
12
|
+
* Command Handler 的 Token
|
|
13
|
+
*/
|
|
14
|
+
exports.ICommandHandler = mana_syringe_1.Syringe.defineToken('ICommandHandler');
|
|
15
|
+
/** Command Context Provider 的 Symbol 提供执行需要的各种api */
|
|
16
|
+
exports.ICommandContextProvider = Symbol('ICommandContextProvider');
|
|
17
|
+
/**
|
|
18
|
+
* IGraphCommandFactory
|
|
19
|
+
* Command工厂方法
|
|
20
|
+
*/
|
|
21
|
+
exports.IGraphCommandFactory = Symbol('IGraphCommandFactory');
|
|
22
|
+
/**
|
|
23
|
+
* Command注册扩展的Symbol
|
|
24
|
+
*/
|
|
25
|
+
exports.IGraphCommandContribution = mana_syringe_1.Syringe.defineToken('IGraphCommandContribution');
|
|
26
|
+
//# sourceMappingURL=interface.js.map
|