@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,20 @@
|
|
|
1
|
+
import { QuestionCircleOutlined } from '@ant-design/icons';
|
|
2
|
+
export type IconComponent = typeof QuestionCircleOutlined;
|
|
3
|
+
export interface IReactComponentStore {
|
|
4
|
+
has: (id: string) => boolean;
|
|
5
|
+
get: (id: string) => IconComponent;
|
|
6
|
+
set: (id: string, component: IconComponent) => void;
|
|
7
|
+
}
|
|
8
|
+
export declare class IconStoreBase implements IReactComponentStore {
|
|
9
|
+
/** icon map */
|
|
10
|
+
private map;
|
|
11
|
+
constructor();
|
|
12
|
+
/** 获取全局的icon component */
|
|
13
|
+
get(id: string): IconComponent;
|
|
14
|
+
/** 设置全局的icon component */
|
|
15
|
+
set(id: string, component: IconComponent): void;
|
|
16
|
+
/** 判断是否有值 */
|
|
17
|
+
has(id: string): boolean;
|
|
18
|
+
}
|
|
19
|
+
export declare const IconStore: IconStoreBase;
|
|
20
|
+
export default IconStore;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { QuestionCircleOutlined } from '@ant-design/icons';
|
|
2
|
+
export class IconStoreBase {
|
|
3
|
+
constructor() {
|
|
4
|
+
/** icon map */
|
|
5
|
+
this.map = new Map([
|
|
6
|
+
['default', QuestionCircleOutlined],
|
|
7
|
+
['QuestionCircleOutlined', QuestionCircleOutlined],
|
|
8
|
+
]);
|
|
9
|
+
this.map.set('default', QuestionCircleOutlined);
|
|
10
|
+
this.map.set('QuestionCircleOutlined', QuestionCircleOutlined);
|
|
11
|
+
}
|
|
12
|
+
/** 获取全局的icon component */
|
|
13
|
+
//@ts-ignore
|
|
14
|
+
get(id) {
|
|
15
|
+
const component = this.map.get(id);
|
|
16
|
+
return component;
|
|
17
|
+
}
|
|
18
|
+
/** 设置全局的icon component */
|
|
19
|
+
set(id, component) {
|
|
20
|
+
this.map.set(id, component);
|
|
21
|
+
}
|
|
22
|
+
/** 判断是否有值 */
|
|
23
|
+
has(id) {
|
|
24
|
+
return this.map.has(id);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
export const IconStore = new IconStoreBase();
|
|
28
|
+
export default IconStore;
|
|
29
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/antd-icons/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAA;AAU1D,MAAM,OAAO,aAAa;IAOxB;QANA,eAAe;QACP,QAAG,GAAG,IAAI,GAAG,CAAwB;YAC3C,CAAC,SAAS,EAAE,sBAAsB,CAAC;YACnC,CAAC,wBAAwB,EAAE,sBAAsB,CAAC;SACnD,CAAC,CAAA;QAGA,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,SAAS,EAAE,sBAAsB,CAAC,CAAA;QAC/C,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,wBAAwB,EAAE,sBAAsB,CAAC,CAAA;IAChE,CAAC;IAED,0BAA0B;IAC1B,YAAY;IACZ,GAAG,CAAC,EAAU;QACZ,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,CAAA;QAClC,OAAO,SAAS,CAAA;IAClB,CAAC;IAED,0BAA0B;IAC1B,GAAG,CAAC,EAAU,EAAE,SAAwB;QACtC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,EAAE,SAAS,CAAC,CAAA;IAC7B,CAAC;IAED,aAAa;IACb,GAAG,CAAC,EAAU;QACZ,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,CAAA;IACzB,CAAC;CACF;AAED,MAAM,CAAC,MAAM,SAAS,GAAG,IAAI,aAAa,EAAE,CAAA;AAE5C,eAAe,SAAS,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { __awaiter, __decorate } from "tslib";
|
|
2
|
+
import { Container, injectable } from 'mana-syringe';
|
|
3
|
+
import { commandRegistryModule } from '../module';
|
|
4
|
+
import { IGraphCommandService, ICommandHandler, IGraphCommandFactory } from '../interface';
|
|
5
|
+
import { GraphCommandRegistry } from '../graph-command';
|
|
6
|
+
describe('GraphCommandRegistry Test', () => {
|
|
7
|
+
let container = null;
|
|
8
|
+
let commandService = null;
|
|
9
|
+
let commandRegistry = null;
|
|
10
|
+
let commandFactory = null;
|
|
11
|
+
beforeEach(() => {
|
|
12
|
+
container = new Container();
|
|
13
|
+
/** ICommandHandler 工厂 */
|
|
14
|
+
container.register(IGraphCommandFactory, {
|
|
15
|
+
useFactory: context => {
|
|
16
|
+
return (commandId) => {
|
|
17
|
+
const child = context.container.createChild();
|
|
18
|
+
/** 实例化CommandHandler */
|
|
19
|
+
const commandHandler = child.getNamed(ICommandHandler, commandId);
|
|
20
|
+
return commandHandler;
|
|
21
|
+
};
|
|
22
|
+
},
|
|
23
|
+
});
|
|
24
|
+
container.load(commandRegistryModule);
|
|
25
|
+
commandService = container.get(IGraphCommandService);
|
|
26
|
+
commandRegistry = container.get(GraphCommandRegistry);
|
|
27
|
+
commandFactory = container.get(IGraphCommandFactory);
|
|
28
|
+
});
|
|
29
|
+
it('should register new command', () => {
|
|
30
|
+
// given
|
|
31
|
+
const mockCommnad = {
|
|
32
|
+
id: 'test-id',
|
|
33
|
+
label: 'test-node-command-label',
|
|
34
|
+
category: 'node',
|
|
35
|
+
};
|
|
36
|
+
let MockCommand = class MockCommand {
|
|
37
|
+
constructor() {
|
|
38
|
+
this.contextProvider = () => {
|
|
39
|
+
return {};
|
|
40
|
+
};
|
|
41
|
+
this.execute = () => __awaiter(this, void 0, void 0, function* () {
|
|
42
|
+
return this;
|
|
43
|
+
});
|
|
44
|
+
this.undo = () => __awaiter(this, void 0, void 0, function* () {
|
|
45
|
+
return this;
|
|
46
|
+
});
|
|
47
|
+
this.redo = () => __awaiter(this, void 0, void 0, function* () {
|
|
48
|
+
return this;
|
|
49
|
+
});
|
|
50
|
+
this.isUndoable = () => {
|
|
51
|
+
return false;
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
MockCommand = __decorate([
|
|
56
|
+
injectable({
|
|
57
|
+
token: { token: ICommandHandler, named: mockCommnad.id },
|
|
58
|
+
})
|
|
59
|
+
], MockCommand);
|
|
60
|
+
// when
|
|
61
|
+
container.register(MockCommand);
|
|
62
|
+
commandRegistry.registerCommand(mockCommnad, {
|
|
63
|
+
createCommand: commandFactory,
|
|
64
|
+
});
|
|
65
|
+
// then
|
|
66
|
+
expect(commandRegistry.hasCommand(mockCommnad.id)).toBe(true);
|
|
67
|
+
});
|
|
68
|
+
it('should create command after exxcute command', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
69
|
+
// given
|
|
70
|
+
const mockCommnad = {
|
|
71
|
+
id: 'test-id',
|
|
72
|
+
label: 'test-node-command-label',
|
|
73
|
+
category: 'node',
|
|
74
|
+
};
|
|
75
|
+
let MockCommand = class MockCommand {
|
|
76
|
+
constructor() {
|
|
77
|
+
this.contextProvider = () => {
|
|
78
|
+
return {};
|
|
79
|
+
};
|
|
80
|
+
this.isUndoable = () => {
|
|
81
|
+
return false;
|
|
82
|
+
};
|
|
83
|
+
this.execute = () => __awaiter(this, void 0, void 0, function* () {
|
|
84
|
+
return this;
|
|
85
|
+
});
|
|
86
|
+
this.undo = () => __awaiter(this, void 0, void 0, function* () {
|
|
87
|
+
return this;
|
|
88
|
+
});
|
|
89
|
+
this.redo = () => __awaiter(this, void 0, void 0, function* () {
|
|
90
|
+
return this;
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
MockCommand = __decorate([
|
|
95
|
+
injectable({
|
|
96
|
+
token: { token: ICommandHandler, named: mockCommnad.id },
|
|
97
|
+
})
|
|
98
|
+
], MockCommand);
|
|
99
|
+
container.register(MockCommand);
|
|
100
|
+
commandRegistry.registerCommand(mockCommnad, {
|
|
101
|
+
createCommand: commandFactory,
|
|
102
|
+
});
|
|
103
|
+
// when
|
|
104
|
+
const cmdHandler = yield commandService.executeCommand(mockCommnad.id, {});
|
|
105
|
+
// then
|
|
106
|
+
expect(cmdHandler instanceof MockCommand).toBe(true);
|
|
107
|
+
}));
|
|
108
|
+
});
|
|
109
|
+
//# sourceMappingURL=graph-command.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graph-command.spec.js","sourceRoot":"","sources":["../../../src/command/__test__/graph-command.spec.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACpD,OAAO,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAA;AAEjD,OAAO,EAAE,oBAAoB,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAA;AAE1F,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAA;AAEvD,QAAQ,CAAC,2BAA2B,EAAE,GAAG,EAAE;IACzC,IAAI,SAAS,GAAc,IAAI,CAAA;IAC/B,IAAI,cAAc,GAAyB,IAAI,CAAA;IAC/C,IAAI,eAAe,GAAyB,IAAI,CAAA;IAChD,IAAI,cAAc,GAAyB,IAAI,CAAA;IAE/C,UAAU,CAAC,GAAG,EAAE;QACd,SAAS,GAAG,IAAI,SAAS,EAAE,CAAA;QAC3B,yBAAyB;QACzB,SAAS,CAAC,QAAQ,CAAkB,oBAAoB,EAAE;YACxD,UAAU,EAAE,OAAO,CAAC,EAAE;gBACpB,OAAO,CAAC,SAAiB,EAAE,EAAE;oBAC3B,MAAM,KAAK,GAAG,OAAO,CAAC,SAAS,CAAC,WAAW,EAAE,CAAA;oBAC7C,wBAAwB;oBACxB,MAAM,cAAc,GAAG,KAAK,CAAC,QAAQ,CAAkB,eAAe,EAAE,SAAS,CAAC,CAAA;oBAClF,OAAO,cAAc,CAAA;gBACvB,CAAC,CAAA;YACH,CAAC;SACF,CAAC,CAAA;QACF,SAAS,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAA;QACrC,cAAc,GAAG,SAAS,CAAC,GAAG,CAAuB,oBAAoB,CAAC,CAAA;QAC1E,eAAe,GAAG,SAAS,CAAC,GAAG,CAAuB,oBAAoB,CAAC,CAAA;QAC3E,cAAc,GAAG,SAAS,CAAC,GAAG,CAAuB,oBAAoB,CAAC,CAAA;IAC5E,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,6BAA6B,EAAE,GAAG,EAAE;QACrC,QAAQ;QACR,MAAM,WAAW,GAAkB;YACjC,EAAE,EAAE,SAAS;YACb,KAAK,EAAE,yBAAyB;YAChC,QAAQ,EAAE,MAAM;SACjB,CAAA;QAID,IAAM,WAAW,GAAjB,MAAM,WAAW;YAAjB;gBACE,oBAAe,GAAG,GAAG,EAAE;oBACrB,OAAO,EAAS,CAAA;gBAClB,CAAC,CAAA;gBACD,YAAO,GAAG,GAAS,EAAE;oBACnB,OAAO,IAAI,CAAA;gBACb,CAAC,CAAA,CAAA;gBACD,SAAI,GAAG,GAAS,EAAE;oBAChB,OAAO,IAAI,CAAA;gBACb,CAAC,CAAA,CAAA;gBACD,SAAI,GAAG,GAAS,EAAE;oBAChB,OAAO,IAAI,CAAA;gBACb,CAAC,CAAA,CAAA;gBACD,eAAU,GAAG,GAAG,EAAE;oBAChB,OAAO,KAAK,CAAA;gBACd,CAAC,CAAA;YACH,CAAC;SAAA,CAAA;QAhBK,WAAW;YAHhB,UAAU,CAAC;gBACV,KAAK,EAAE,EAAE,KAAK,EAAE,eAAe,EAAE,KAAK,EAAE,WAAW,CAAC,EAAE,EAAE;aACzD,CAAC;WACI,WAAW,CAgBhB;QACD,OAAO;QACP,SAAS,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAA;QAC/B,eAAe,CAAC,eAAe,CAAC,WAAW,EAAE;YAC3C,aAAa,EAAE,cAAc;SAC9B,CAAC,CAAA;QACF,OAAO;QACP,MAAM,CAAC,eAAe,CAAC,UAAU,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAC/D,CAAC,CAAC,CAAA;IACF,EAAE,CAAC,6CAA6C,EAAE,GAAS,EAAE;QAC3D,QAAQ;QACR,MAAM,WAAW,GAAkB;YACjC,EAAE,EAAE,SAAS;YACb,KAAK,EAAE,yBAAyB;YAChC,QAAQ,EAAE,MAAM;SACjB,CAAA;QAID,IAAM,WAAW,GAAjB,MAAM,WAAW;YAAjB;gBACE,oBAAe,GAAG,GAAG,EAAE;oBACrB,OAAO,EAAS,CAAA;gBAClB,CAAC,CAAA;gBACD,eAAU,GAAG,GAAG,EAAE;oBAChB,OAAO,KAAK,CAAA;gBACd,CAAC,CAAA;gBACD,YAAO,GAAG,GAAS,EAAE;oBACnB,OAAO,IAAI,CAAA;gBACb,CAAC,CAAA,CAAA;gBACD,SAAI,GAAG,GAAS,EAAE;oBAChB,OAAO,IAAI,CAAA;gBACb,CAAC,CAAA,CAAA;gBACD,SAAI,GAAG,GAAS,EAAE;oBAChB,OAAO,IAAI,CAAA;gBACb,CAAC,CAAA,CAAA;YACH,CAAC;SAAA,CAAA;QAhBK,WAAW;YAHhB,UAAU,CAAC;gBACV,KAAK,EAAE,EAAE,KAAK,EAAE,eAAe,EAAE,KAAK,EAAE,WAAW,CAAC,EAAE,EAAE;aACzD,CAAC;WACI,WAAW,CAgBhB;QACD,SAAS,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAA;QAC/B,eAAe,CAAC,eAAe,CAAC,WAAW,EAAE;YAC3C,aAAa,EAAE,cAAc;SAC9B,CAAC,CAAA;QACF,OAAO;QACP,MAAM,UAAU,GAAG,MAAM,cAAc,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,EAAE,EAAE,CAAC,CAAA;QAC1E,OAAO;QACP,MAAM,CAAC,UAAU,YAAY,WAAW,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IACtD,CAAC,CAAA,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import { Contribution } from 'mana-syringe';
|
|
2
|
+
import { RxModel } from '../common/rx-model';
|
|
3
|
+
import { Disposable, DisposableCollection } from '../common/disposable';
|
|
4
|
+
import { IFrontendApplicationContribution } from '../xflow-main/interface';
|
|
5
|
+
import type { ICommandHandler, IGraphCommand, ICommandFactory, IGraphPipelineCommand, ICommandRegisterFunction } from './interface';
|
|
6
|
+
import { IGraphCommandService, IGraphCommandContribution } from './interface';
|
|
7
|
+
import type { IRuntimeHook } from '@sunspirytus/xflow-hook/es/interface';
|
|
8
|
+
import 'reflect-metadata';
|
|
9
|
+
export declare namespace NCommand {
|
|
10
|
+
function is(arg: IGraphCommand | any): arg is IGraphCommand;
|
|
11
|
+
/** Comparator function for when sorting commands */
|
|
12
|
+
function compareCommands(a: IGraphCommand, b: IGraphCommand): number;
|
|
13
|
+
/**
|
|
14
|
+
* Determine if two commands are equal.
|
|
15
|
+
*
|
|
16
|
+
* @param a the first command for comparison.
|
|
17
|
+
* @param b the second command for comparison.
|
|
18
|
+
*/
|
|
19
|
+
function equals(a: IGraphCommand, b: IGraphCommand): boolean;
|
|
20
|
+
}
|
|
21
|
+
export declare class GraphCommandRegistry implements IGraphCommandService, IFrontendApplicationContribution {
|
|
22
|
+
protected readonly contributionProvider: Contribution.Provider<IGraphCommandContribution>;
|
|
23
|
+
/**
|
|
24
|
+
* undo cmd后将命令存储在队列中给redo调用
|
|
25
|
+
*/
|
|
26
|
+
protected readonly redoStack: ICommandHandler[];
|
|
27
|
+
/**
|
|
28
|
+
* executeCommand后将命令存储在队列中给undo调用
|
|
29
|
+
*/
|
|
30
|
+
protected readonly undoStack: ICommandHandler[];
|
|
31
|
+
/**
|
|
32
|
+
* 储存所有注册的command
|
|
33
|
+
*/
|
|
34
|
+
protected readonly commands: Map<string, IGraphCommand>;
|
|
35
|
+
/**
|
|
36
|
+
* 储存所有注册的command factory
|
|
37
|
+
*/
|
|
38
|
+
protected readonly factories: Map<string, ICommandFactory<any, any, {
|
|
39
|
+
graphOptions: import("@sunspirytus/xflow-hook").HookHub<import("@antv/x6").Graph.Options, import("@antv/x6").Graph.Options>;
|
|
40
|
+
reactNodeRender: import("@sunspirytus/xflow-hook").HookHub<Map<string, React.ComponentType<import("..").NsGraph.IReactNodeProps<T>>>, Map<string, React.ComponentType<import("..").NsGraph.IReactNodeProps<T>>>>;
|
|
41
|
+
reactEdgeLabelRender: import("@sunspirytus/xflow-hook").HookHub<Map<string, React.ComponentType<import("..").NsGraph.IReactEdgeProps<T_1>>>, Map<string, React.ComponentType<import("..").NsGraph.IReactEdgeProps<T_1>>>>;
|
|
42
|
+
afterGraphInit: import("@sunspirytus/xflow-hook").HookHub<import("../hooks/interface").IGeneralAppService, import("../hooks/interface").IGeneralAppService>;
|
|
43
|
+
beforeGraphDestroy: import("@sunspirytus/xflow-hook").HookHub<import("../hooks/interface").IGeneralAppService, import("../hooks/interface").IGeneralAppService>;
|
|
44
|
+
x6Events: import("@sunspirytus/xflow-hook").HookHub<import("../hooks/interface").IEventCollection, import("../hooks/interface").IEventSubscription>;
|
|
45
|
+
}>>;
|
|
46
|
+
/**
|
|
47
|
+
* 储存所有注册的command handler disposables
|
|
48
|
+
*/
|
|
49
|
+
protected readonly disposables: Map<string, DisposableCollection>;
|
|
50
|
+
/**
|
|
51
|
+
* 监听cmdregistry的变化
|
|
52
|
+
*/
|
|
53
|
+
private readonly cmdChangeEvent;
|
|
54
|
+
/**
|
|
55
|
+
* 监听cmdregistry的变化
|
|
56
|
+
*/
|
|
57
|
+
get watchChange(): import("../common/rx-model").NsModel.IWatch<null>;
|
|
58
|
+
/**
|
|
59
|
+
* 在Command实例间共享变量
|
|
60
|
+
*/
|
|
61
|
+
readonly Globals: RxModel<Map<any, any>>;
|
|
62
|
+
/** 设置command间的共享变量 */
|
|
63
|
+
setGlobal: (key: string, value: any) => void;
|
|
64
|
+
/** 获取共享变量 */
|
|
65
|
+
getGlobal: (key: string) => any;
|
|
66
|
+
constructor(contributionProvider: Contribution.Provider<IGraphCommandContribution>);
|
|
67
|
+
onStart(): void;
|
|
68
|
+
executeCommandPipeline(cmdOptions: IGraphPipelineCommand[]): Promise<ICommandHandler<any, any, {
|
|
69
|
+
graphOptions: import("@sunspirytus/xflow-hook").HookHub<import("@antv/x6").Graph.Options, import("@antv/x6").Graph.Options>;
|
|
70
|
+
reactNodeRender: import("@sunspirytus/xflow-hook").HookHub<Map<string, React.ComponentType<import("..").NsGraph.IReactNodeProps<T>>>, Map<string, React.ComponentType<import("..").NsGraph.IReactNodeProps<T>>>>;
|
|
71
|
+
reactEdgeLabelRender: import("@sunspirytus/xflow-hook").HookHub<Map<string, React.ComponentType<import("..").NsGraph.IReactEdgeProps<T_1>>>, Map<string, React.ComponentType<import("..").NsGraph.IReactEdgeProps<T_1>>>>;
|
|
72
|
+
afterGraphInit: import("@sunspirytus/xflow-hook").HookHub<import("../hooks/interface").IGeneralAppService, import("../hooks/interface").IGeneralAppService>;
|
|
73
|
+
beforeGraphDestroy: import("@sunspirytus/xflow-hook").HookHub<import("../hooks/interface").IGeneralAppService, import("../hooks/interface").IGeneralAppService>;
|
|
74
|
+
x6Events: import("@sunspirytus/xflow-hook").HookHub<import("../hooks/interface").IEventCollection, import("../hooks/interface").IEventSubscription>;
|
|
75
|
+
}>>;
|
|
76
|
+
/** 执行 Command:会在undo stack中push cmd */
|
|
77
|
+
executeCommand<Args = any, Result = any>(commandId: string, cmdArgs: Args, hook?: IRuntimeHook<Args, Result>): Promise<ICommandHandler<Args, Result, {
|
|
78
|
+
graphOptions: import("@sunspirytus/xflow-hook").HookHub<import("@antv/x6").Graph.Options, import("@antv/x6").Graph.Options>;
|
|
79
|
+
reactNodeRender: import("@sunspirytus/xflow-hook").HookHub<Map<string, React.ComponentType<import("..").NsGraph.IReactNodeProps<T>>>, Map<string, React.ComponentType<import("..").NsGraph.IReactNodeProps<T>>>>;
|
|
80
|
+
reactEdgeLabelRender: import("@sunspirytus/xflow-hook").HookHub<Map<string, React.ComponentType<import("..").NsGraph.IReactEdgeProps<T_1>>>, Map<string, React.ComponentType<import("..").NsGraph.IReactEdgeProps<T_1>>>>;
|
|
81
|
+
afterGraphInit: import("@sunspirytus/xflow-hook").HookHub<import("../hooks/interface").IGeneralAppService, import("../hooks/interface").IGeneralAppService>;
|
|
82
|
+
beforeGraphDestroy: import("@sunspirytus/xflow-hook").HookHub<import("../hooks/interface").IGeneralAppService, import("../hooks/interface").IGeneralAppService>;
|
|
83
|
+
x6Events: import("@sunspirytus/xflow-hook").HookHub<import("../hooks/interface").IEventCollection, import("../hooks/interface").IEventSubscription>;
|
|
84
|
+
}>>;
|
|
85
|
+
/** 执行 unod Command:不会在undo stack中push新的command记录 */
|
|
86
|
+
executeUndoCommand<T = any>(commandId: string, cmdArgs: T, hook?: IRuntimeHook<T, any>): Promise<ICommandHandler<any, any, {
|
|
87
|
+
graphOptions: import("@sunspirytus/xflow-hook").HookHub<import("@antv/x6").Graph.Options, import("@antv/x6").Graph.Options>;
|
|
88
|
+
reactNodeRender: import("@sunspirytus/xflow-hook").HookHub<Map<string, React.ComponentType<import("..").NsGraph.IReactNodeProps<T_1>>>, Map<string, React.ComponentType<import("..").NsGraph.IReactNodeProps<T_1>>>>;
|
|
89
|
+
reactEdgeLabelRender: import("@sunspirytus/xflow-hook").HookHub<Map<string, React.ComponentType<import("..").NsGraph.IReactEdgeProps<T_2>>>, Map<string, React.ComponentType<import("..").NsGraph.IReactEdgeProps<T_2>>>>;
|
|
90
|
+
afterGraphInit: import("@sunspirytus/xflow-hook").HookHub<import("../hooks/interface").IGeneralAppService, import("../hooks/interface").IGeneralAppService>;
|
|
91
|
+
beforeGraphDestroy: import("@sunspirytus/xflow-hook").HookHub<import("../hooks/interface").IGeneralAppService, import("../hooks/interface").IGeneralAppService>;
|
|
92
|
+
x6Events: import("@sunspirytus/xflow-hook").HookHub<import("../hooks/interface").IEventCollection, import("../hooks/interface").IEventSubscription>;
|
|
93
|
+
}>>;
|
|
94
|
+
/**
|
|
95
|
+
* Execute the active handler for the given command and arguments.
|
|
96
|
+
*
|
|
97
|
+
* Reject if a command cannot be executed.
|
|
98
|
+
*/
|
|
99
|
+
createCommand<T = any>(commandId: string, cmdArgs: T, hook?: IRuntimeHook<T, any>): Promise<ICommandHandler<any, any, {
|
|
100
|
+
graphOptions: import("@sunspirytus/xflow-hook").HookHub<import("@antv/x6").Graph.Options, import("@antv/x6").Graph.Options>;
|
|
101
|
+
reactNodeRender: import("@sunspirytus/xflow-hook").HookHub<Map<string, React.ComponentType<import("..").NsGraph.IReactNodeProps<T_1>>>, Map<string, React.ComponentType<import("..").NsGraph.IReactNodeProps<T_1>>>>;
|
|
102
|
+
reactEdgeLabelRender: import("@sunspirytus/xflow-hook").HookHub<Map<string, React.ComponentType<import("..").NsGraph.IReactEdgeProps<T_2>>>, Map<string, React.ComponentType<import("..").NsGraph.IReactEdgeProps<T_2>>>>;
|
|
103
|
+
afterGraphInit: import("@sunspirytus/xflow-hook").HookHub<import("../hooks/interface").IGeneralAppService, import("../hooks/interface").IGeneralAppService>;
|
|
104
|
+
beforeGraphDestroy: import("@sunspirytus/xflow-hook").HookHub<import("../hooks/interface").IGeneralAppService, import("../hooks/interface").IGeneralAppService>;
|
|
105
|
+
x6Events: import("@sunspirytus/xflow-hook").HookHub<import("../hooks/interface").IEventCollection, import("../hooks/interface").IEventSubscription>;
|
|
106
|
+
}>>;
|
|
107
|
+
/**
|
|
108
|
+
* 执行undo stack中最后一条Command
|
|
109
|
+
*/
|
|
110
|
+
undoCommand: () => Promise<void>;
|
|
111
|
+
/**
|
|
112
|
+
* 执行redo stack中最后一条Command
|
|
113
|
+
*/
|
|
114
|
+
redoCommand: () => Promise<void>;
|
|
115
|
+
/**
|
|
116
|
+
* 检查是否注册了Command
|
|
117
|
+
*/
|
|
118
|
+
get isUndoable(): boolean;
|
|
119
|
+
/**
|
|
120
|
+
* 检查是否注册了Command
|
|
121
|
+
*/
|
|
122
|
+
get isRedoable(): boolean;
|
|
123
|
+
/**
|
|
124
|
+
* 检查是否注册了Command
|
|
125
|
+
*/
|
|
126
|
+
hasCommand(commandId: string): boolean;
|
|
127
|
+
/**
|
|
128
|
+
* Get a command for the given command identifier.
|
|
129
|
+
*/
|
|
130
|
+
getCommand(id: string): IGraphCommand | undefined;
|
|
131
|
+
/**
|
|
132
|
+
* Register the given command and handler if present.
|
|
133
|
+
*
|
|
134
|
+
* Throw if a command is already registered for the given command identifier.
|
|
135
|
+
*/
|
|
136
|
+
registerCommand(command: IGraphCommand, factory: ICommandFactory): Disposable;
|
|
137
|
+
/**
|
|
138
|
+
* 注册一批可单独dispose的Command
|
|
139
|
+
* @param externalRegisterFn ICommandRegisterFunction
|
|
140
|
+
*/
|
|
141
|
+
registerDisposableCommand: (externalRegisterFn: ICommandRegisterFunction) => DisposableCollection;
|
|
142
|
+
protected doRegisterCommand(command: IGraphCommand): Disposable;
|
|
143
|
+
/**
|
|
144
|
+
* Unregister command from the registry
|
|
145
|
+
*
|
|
146
|
+
* @param command
|
|
147
|
+
*/
|
|
148
|
+
unregisterCommand(command: IGraphCommand): void;
|
|
149
|
+
/**
|
|
150
|
+
* 检查commandId是否有Factory
|
|
151
|
+
*/
|
|
152
|
+
hasFactory(commandId: string): boolean;
|
|
153
|
+
/**
|
|
154
|
+
* Get a visible handler for the given command or `undefined`.
|
|
155
|
+
*/
|
|
156
|
+
getFactory(commandId: string): ICommandFactory | undefined;
|
|
157
|
+
/**
|
|
158
|
+
* Register the given handler for the given command identifier.
|
|
159
|
+
*
|
|
160
|
+
* If there is already a handler for the given command
|
|
161
|
+
* then the given handler is registered as more specific, and
|
|
162
|
+
* has higher priority during enablement, visibility and toggle state evaluations.
|
|
163
|
+
*/
|
|
164
|
+
registerFactory(commandId: string, factory: ICommandFactory, force?: boolean): Disposable;
|
|
165
|
+
/**
|
|
166
|
+
* Returns with all handlers for the given command. If the command does not have any handlers,
|
|
167
|
+
* or the command is not registered, returns an empty array.
|
|
168
|
+
*/
|
|
169
|
+
getAllFactories(): [string, ICommandFactory<any, any, {
|
|
170
|
+
graphOptions: import("@sunspirytus/xflow-hook").HookHub<import("@antv/x6").Graph.Options, import("@antv/x6").Graph.Options>;
|
|
171
|
+
reactNodeRender: import("@sunspirytus/xflow-hook").HookHub<Map<string, React.ComponentType<import("..").NsGraph.IReactNodeProps<T>>>, Map<string, React.ComponentType<import("..").NsGraph.IReactNodeProps<T>>>>;
|
|
172
|
+
reactEdgeLabelRender: import("@sunspirytus/xflow-hook").HookHub<Map<string, React.ComponentType<import("..").NsGraph.IReactEdgeProps<T_1>>>, Map<string, React.ComponentType<import("..").NsGraph.IReactEdgeProps<T_1>>>>;
|
|
173
|
+
afterGraphInit: import("@sunspirytus/xflow-hook").HookHub<import("../hooks/interface").IGeneralAppService, import("../hooks/interface").IGeneralAppService>;
|
|
174
|
+
beforeGraphDestroy: import("@sunspirytus/xflow-hook").HookHub<import("../hooks/interface").IGeneralAppService, import("../hooks/interface").IGeneralAppService>;
|
|
175
|
+
x6Events: import("@sunspirytus/xflow-hook").HookHub<import("../hooks/interface").IEventCollection, import("../hooks/interface").IEventSubscription>;
|
|
176
|
+
}>][];
|
|
177
|
+
}
|
|
@@ -0,0 +1,300 @@
|
|
|
1
|
+
import { __awaiter, __decorate, __metadata, __param } from "tslib";
|
|
2
|
+
import { contrib, Contribution, singleton } from 'mana-syringe';
|
|
3
|
+
import { RxModel } from '../common/rx-model';
|
|
4
|
+
import { Disposable, DisposableCollection } from '../common/disposable';
|
|
5
|
+
import { IFrontendApplicationContribution } from '../xflow-main/interface';
|
|
6
|
+
import { IGraphCommandService, IGraphCommandContribution } from './interface';
|
|
7
|
+
import 'reflect-metadata';
|
|
8
|
+
export var NCommand;
|
|
9
|
+
(function (NCommand) {
|
|
10
|
+
/* Determine whether object is a Command */
|
|
11
|
+
function is(arg) {
|
|
12
|
+
return !!arg && arg === Object(arg) && 'id' in arg;
|
|
13
|
+
}
|
|
14
|
+
NCommand.is = is;
|
|
15
|
+
/** Comparator function for when sorting commands */
|
|
16
|
+
function compareCommands(a, b) {
|
|
17
|
+
if (a.label && b.label) {
|
|
18
|
+
const aCommand = (a.category ? `${a.category}: ${a.label}` : a.label).toLowerCase();
|
|
19
|
+
const bCommand = (b.category ? `${b.category}: ${b.label}` : b.label).toLowerCase();
|
|
20
|
+
return aCommand.localeCompare(bCommand);
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
return 0;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
NCommand.compareCommands = compareCommands;
|
|
27
|
+
/**
|
|
28
|
+
* Determine if two commands are equal.
|
|
29
|
+
*
|
|
30
|
+
* @param a the first command for comparison.
|
|
31
|
+
* @param b the second command for comparison.
|
|
32
|
+
*/
|
|
33
|
+
function equals(a, b) {
|
|
34
|
+
return (a.id === b.id && a.label === b.label && a.iconName === b.iconName && a.category === b.category);
|
|
35
|
+
}
|
|
36
|
+
NCommand.equals = equals;
|
|
37
|
+
})(NCommand || (NCommand = {}));
|
|
38
|
+
let GraphCommandRegistry = class GraphCommandRegistry {
|
|
39
|
+
/**
|
|
40
|
+
* 监听cmdregistry的变化
|
|
41
|
+
*/
|
|
42
|
+
get watchChange() {
|
|
43
|
+
return this.cmdChangeEvent.watch;
|
|
44
|
+
}
|
|
45
|
+
constructor(contributionProvider) {
|
|
46
|
+
this.contributionProvider = contributionProvider;
|
|
47
|
+
/**
|
|
48
|
+
* undo cmd后将命令存储在队列中给redo调用
|
|
49
|
+
*/
|
|
50
|
+
this.redoStack = [];
|
|
51
|
+
/**
|
|
52
|
+
* executeCommand后将命令存储在队列中给undo调用
|
|
53
|
+
*/
|
|
54
|
+
this.undoStack = [];
|
|
55
|
+
/**
|
|
56
|
+
* 储存所有注册的command
|
|
57
|
+
*/
|
|
58
|
+
this.commands = new Map();
|
|
59
|
+
/**
|
|
60
|
+
* 储存所有注册的command factory
|
|
61
|
+
*/
|
|
62
|
+
this.factories = new Map();
|
|
63
|
+
/**
|
|
64
|
+
* 储存所有注册的command handler disposables
|
|
65
|
+
*/
|
|
66
|
+
this.disposables = new Map();
|
|
67
|
+
/**
|
|
68
|
+
* 监听cmdregistry的变化
|
|
69
|
+
*/
|
|
70
|
+
this.cmdChangeEvent = new RxModel(null);
|
|
71
|
+
/**
|
|
72
|
+
* 在Command实例间共享变量
|
|
73
|
+
*/
|
|
74
|
+
this.Globals = new RxModel(new Map());
|
|
75
|
+
/** 设置command间的共享变量 */
|
|
76
|
+
this.setGlobal = (key, value) => {
|
|
77
|
+
this.Globals.setValue(map => {
|
|
78
|
+
map.set(key, value);
|
|
79
|
+
});
|
|
80
|
+
};
|
|
81
|
+
/** 获取共享变量 */
|
|
82
|
+
this.getGlobal = (key) => {
|
|
83
|
+
const map = this.Globals.getValue();
|
|
84
|
+
return map.get(key);
|
|
85
|
+
};
|
|
86
|
+
/**
|
|
87
|
+
* 执行undo stack中最后一条Command
|
|
88
|
+
*/
|
|
89
|
+
this.undoCommand = () => __awaiter(this, void 0, void 0, function* () {
|
|
90
|
+
/* 获取可以undo的Command */
|
|
91
|
+
const cmd = this.undoStack.pop();
|
|
92
|
+
if (!cmd) {
|
|
93
|
+
console.error('empty undo stack');
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
/* 执行命令的undo方法 */
|
|
97
|
+
yield cmd.undo();
|
|
98
|
+
/* 执行后塞到redo的栈中 */
|
|
99
|
+
this.redoStack.push(cmd);
|
|
100
|
+
/* 触发事件回调 */
|
|
101
|
+
this.cmdChangeEvent.setValue(null);
|
|
102
|
+
});
|
|
103
|
+
/**
|
|
104
|
+
* 执行redo stack中最后一条Command
|
|
105
|
+
*/
|
|
106
|
+
this.redoCommand = () => __awaiter(this, void 0, void 0, function* () {
|
|
107
|
+
/* 获取可以redo的Command */
|
|
108
|
+
const cmd = this.redoStack.pop();
|
|
109
|
+
if (!cmd) {
|
|
110
|
+
console.error('empty undo stack');
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
/* 执行命令的undo */
|
|
114
|
+
yield cmd.redo();
|
|
115
|
+
/* 执行后塞到undo的栈中 */
|
|
116
|
+
this.undoStack.push(cmd);
|
|
117
|
+
/* 触发事件回调 */
|
|
118
|
+
this.cmdChangeEvent.setValue(null);
|
|
119
|
+
});
|
|
120
|
+
/**
|
|
121
|
+
* 注册一批可单独dispose的Command
|
|
122
|
+
* @param externalRegisterFn ICommandRegisterFunction
|
|
123
|
+
*/
|
|
124
|
+
this.registerDisposableCommand = (externalRegisterFn) => {
|
|
125
|
+
const toDispose = new DisposableCollection();
|
|
126
|
+
const disposableRegistry = {
|
|
127
|
+
registerCommand: (command, factory) => {
|
|
128
|
+
const disposable = this.registerCommand(command, factory);
|
|
129
|
+
toDispose.push(disposable);
|
|
130
|
+
return disposable;
|
|
131
|
+
},
|
|
132
|
+
};
|
|
133
|
+
externalRegisterFn(disposableRegistry);
|
|
134
|
+
return toDispose;
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
onStart() {
|
|
138
|
+
const contributions = this.contributionProvider.getContributions();
|
|
139
|
+
for (const contribItem of contributions) {
|
|
140
|
+
contribItem.registerGraphCommands(this);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
executeCommandPipeline(cmdOptions) {
|
|
144
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
145
|
+
let res = null;
|
|
146
|
+
for (const cmdOption of cmdOptions) {
|
|
147
|
+
const cmdCtx = res === null || res === void 0 ? void 0 : res.contextProvider();
|
|
148
|
+
const { args, hooks } = yield (cmdOption === null || cmdOption === void 0 ? void 0 : cmdOption.getCommandOption(cmdCtx));
|
|
149
|
+
res = yield this.executeCommand(cmdOption === null || cmdOption === void 0 ? void 0 : cmdOption.commandId, args, hooks);
|
|
150
|
+
}
|
|
151
|
+
/* 触发事件回调 */
|
|
152
|
+
this.cmdChangeEvent.setValue(null);
|
|
153
|
+
return res;
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
/** 执行 Command:会在undo stack中push cmd */
|
|
157
|
+
executeCommand(commandId, cmdArgs, hook = []) {
|
|
158
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
159
|
+
const factory = this.getFactory(commandId);
|
|
160
|
+
if (factory) {
|
|
161
|
+
const cmd = (yield factory.createCommand(commandId, cmdArgs, hook));
|
|
162
|
+
yield cmd.execute();
|
|
163
|
+
if (cmd.isUndoable()) {
|
|
164
|
+
this.undoStack.push(cmd);
|
|
165
|
+
}
|
|
166
|
+
/* 触发事件回调 */
|
|
167
|
+
this.cmdChangeEvent.setValue(null);
|
|
168
|
+
return cmd;
|
|
169
|
+
}
|
|
170
|
+
throw Object.assign(new Error(`The command '${commandId}' cannot be executed. There are no active handlers available for the command.`), { code: 'NO_ACTIVE_HANDLER' });
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
/** 执行 unod Command:不会在undo stack中push新的command记录 */
|
|
174
|
+
executeUndoCommand(commandId, cmdArgs, hook = []) {
|
|
175
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
176
|
+
const factory = this.getFactory(commandId);
|
|
177
|
+
if (factory) {
|
|
178
|
+
const cmd = yield factory.createCommand(commandId, cmdArgs, hook);
|
|
179
|
+
yield cmd.execute();
|
|
180
|
+
return cmd;
|
|
181
|
+
}
|
|
182
|
+
throw Object.assign(new Error(`The command '${commandId}' cannot be executed. There are no active handlers available for the command.`), { code: 'NO_ACTIVE_HANDLER' });
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Execute the active handler for the given command and arguments.
|
|
187
|
+
*
|
|
188
|
+
* Reject if a command cannot be executed.
|
|
189
|
+
*/
|
|
190
|
+
createCommand(commandId, cmdArgs, hook = []) {
|
|
191
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
192
|
+
const factory = this.getFactory(commandId);
|
|
193
|
+
if (factory) {
|
|
194
|
+
const cmd = yield factory.createCommand(commandId, cmdArgs, hook);
|
|
195
|
+
return cmd;
|
|
196
|
+
}
|
|
197
|
+
throw Object.assign(new Error(`The command '${commandId}' cannot be executed. There are no active handlers available for the command.`), { code: 'NO_ACTIVE_HANDLER' });
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* 检查是否注册了Command
|
|
202
|
+
*/
|
|
203
|
+
get isUndoable() {
|
|
204
|
+
return this.undoStack.length > 0;
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* 检查是否注册了Command
|
|
208
|
+
*/
|
|
209
|
+
get isRedoable() {
|
|
210
|
+
return this.redoStack.length > 0;
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* 检查是否注册了Command
|
|
214
|
+
*/
|
|
215
|
+
hasCommand(commandId) {
|
|
216
|
+
return this.commands.has(commandId);
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* Get a command for the given command identifier.
|
|
220
|
+
*/
|
|
221
|
+
getCommand(id) {
|
|
222
|
+
return this.commands.get(id);
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* Register the given command and handler if present.
|
|
226
|
+
*
|
|
227
|
+
* Throw if a command is already registered for the given command identifier.
|
|
228
|
+
*/
|
|
229
|
+
registerCommand(command, factory) {
|
|
230
|
+
if (this.factories.has(command.id)) {
|
|
231
|
+
console.warn(`A command ${command.id} is already registered.`);
|
|
232
|
+
return Disposable.NULL;
|
|
233
|
+
}
|
|
234
|
+
const toDispose = new DisposableCollection(this.doRegisterCommand(command), this.registerFactory(command.id, factory), Disposable.create(() => this.disposables.delete(command.id)));
|
|
235
|
+
this.disposables.set(command.id, toDispose);
|
|
236
|
+
return toDispose;
|
|
237
|
+
}
|
|
238
|
+
doRegisterCommand(command) {
|
|
239
|
+
this.commands.set(command.id, command);
|
|
240
|
+
return Disposable.create(() => this.disposables.delete(command.id));
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* Unregister command from the registry
|
|
244
|
+
*
|
|
245
|
+
* @param id
|
|
246
|
+
*/
|
|
247
|
+
unregisterCommand(commandOrId) {
|
|
248
|
+
const id = NCommand.is(commandOrId) ? commandOrId.id : commandOrId;
|
|
249
|
+
const disposableCmd = this.disposables.get(id);
|
|
250
|
+
if (disposableCmd) {
|
|
251
|
+
disposableCmd.dispose();
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
/**
|
|
255
|
+
* 检查commandId是否有Factory
|
|
256
|
+
*/
|
|
257
|
+
hasFactory(commandId) {
|
|
258
|
+
const factory = this.factories.get(commandId);
|
|
259
|
+
return !!factory;
|
|
260
|
+
}
|
|
261
|
+
/**
|
|
262
|
+
* Get a visible handler for the given command or `undefined`.
|
|
263
|
+
*/
|
|
264
|
+
getFactory(commandId) {
|
|
265
|
+
const factory = this.factories.get(commandId);
|
|
266
|
+
return factory;
|
|
267
|
+
}
|
|
268
|
+
/**
|
|
269
|
+
* Register the given handler for the given command identifier.
|
|
270
|
+
*
|
|
271
|
+
* If there is already a handler for the given command
|
|
272
|
+
* then the given handler is registered as more specific, and
|
|
273
|
+
* has higher priority during enablement, visibility and toggle state evaluations.
|
|
274
|
+
*/
|
|
275
|
+
registerFactory(commandId, factory, force = false) {
|
|
276
|
+
if (this.hasFactory(commandId) && force === false) {
|
|
277
|
+
console.error('cannot register command:', commandId);
|
|
278
|
+
}
|
|
279
|
+
this.factories.set(commandId, factory);
|
|
280
|
+
return Disposable.create(() => {
|
|
281
|
+
this.factories.delete(commandId);
|
|
282
|
+
});
|
|
283
|
+
}
|
|
284
|
+
/**
|
|
285
|
+
* Returns with all handlers for the given command. If the command does not have any handlers,
|
|
286
|
+
* or the command is not registered, returns an empty array.
|
|
287
|
+
*/
|
|
288
|
+
getAllFactories() {
|
|
289
|
+
return Array.from(this.factories.entries());
|
|
290
|
+
}
|
|
291
|
+
};
|
|
292
|
+
GraphCommandRegistry = __decorate([
|
|
293
|
+
singleton({
|
|
294
|
+
contrib: [IFrontendApplicationContribution, IGraphCommandService],
|
|
295
|
+
}),
|
|
296
|
+
__param(0, contrib(IGraphCommandContribution)),
|
|
297
|
+
__metadata("design:paramtypes", [Object])
|
|
298
|
+
], GraphCommandRegistry);
|
|
299
|
+
export { GraphCommandRegistry };
|
|
300
|
+
//# sourceMappingURL=graph-command.js.map
|