@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,147 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UpdateNodePort = exports.NsUpdateNodePort = void 0;
|
|
4
|
+
var tslib_1 = require("tslib");
|
|
5
|
+
var mana_syringe_1 = require("mana-syringe");
|
|
6
|
+
var constant_1 = require("../constant");
|
|
7
|
+
var disposable_1 = require("../../common/disposable");
|
|
8
|
+
var interface_1 = require("../../command/interface");
|
|
9
|
+
var NsUpdateNodePort;
|
|
10
|
+
(function (NsUpdateNodePort) {
|
|
11
|
+
/** Command: 用于注册named factory */
|
|
12
|
+
NsUpdateNodePort.command = constant_1.XFlowNodeCommands.UPDATE_NODE_PORT;
|
|
13
|
+
/** hookName */
|
|
14
|
+
NsUpdateNodePort.hookKey = 'updateNodePort';
|
|
15
|
+
})(NsUpdateNodePort = exports.NsUpdateNodePort || (exports.NsUpdateNodePort = {}));
|
|
16
|
+
var UpdateNodePort = /** @class */ (function () {
|
|
17
|
+
/** 创建节点命令 */
|
|
18
|
+
function UpdateNodePort() {
|
|
19
|
+
var _this = this;
|
|
20
|
+
this.getCell = function (graph, node) {
|
|
21
|
+
if (typeof node === 'string') {
|
|
22
|
+
return graph.getCellById(node);
|
|
23
|
+
}
|
|
24
|
+
return node;
|
|
25
|
+
};
|
|
26
|
+
this.getNodeConfig = function (x6Node) {
|
|
27
|
+
var data = x6Node.getData();
|
|
28
|
+
var position = x6Node.getPosition();
|
|
29
|
+
var size = x6Node.getSize();
|
|
30
|
+
return tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({}, data), position), size);
|
|
31
|
+
};
|
|
32
|
+
this.updatePortsOfNodeConfig = function (cell, ports, options) {
|
|
33
|
+
var nodeConfig = _this.getNodeConfig(cell);
|
|
34
|
+
if (_this.isNodeAnchors(nodeConfig.ports)) {
|
|
35
|
+
nodeConfig.ports = tslib_1.__spreadArray([], ports, true);
|
|
36
|
+
}
|
|
37
|
+
if (_this.isPortMetaData(nodeConfig.ports)) {
|
|
38
|
+
nodeConfig.ports.items = tslib_1.__spreadArray([], ports, true);
|
|
39
|
+
}
|
|
40
|
+
cell.setData(nodeConfig, options);
|
|
41
|
+
};
|
|
42
|
+
/** 执行Cmd */
|
|
43
|
+
this.execute = function () { return tslib_1.__awaiter(_this, void 0, void 0, function () {
|
|
44
|
+
var ctx, _a, args, runtimeHook, hooks, graph, result;
|
|
45
|
+
var _this = this;
|
|
46
|
+
return tslib_1.__generator(this, function (_b) {
|
|
47
|
+
switch (_b.label) {
|
|
48
|
+
case 0:
|
|
49
|
+
ctx = this.contextProvider();
|
|
50
|
+
_a = ctx.getArgs(), args = _a.args, runtimeHook = _a.hooks;
|
|
51
|
+
hooks = ctx.getHooks();
|
|
52
|
+
return [4 /*yield*/, ctx.getX6Graph()];
|
|
53
|
+
case 1:
|
|
54
|
+
graph = _b.sent();
|
|
55
|
+
return [4 /*yield*/, hooks.updateNodePort.call(args, function (handlerArgs) { return tslib_1.__awaiter(_this, void 0, void 0, function () {
|
|
56
|
+
var node, updatePorts, options, commandService, cell, currentPorts, nextPorts;
|
|
57
|
+
var _this = this;
|
|
58
|
+
return tslib_1.__generator(this, function (_a) {
|
|
59
|
+
switch (_a.label) {
|
|
60
|
+
case 0:
|
|
61
|
+
node = handlerArgs.node, updatePorts = handlerArgs.updatePorts, options = handlerArgs.options, commandService = handlerArgs.commandService;
|
|
62
|
+
cell = this.getCell(graph, node);
|
|
63
|
+
if (!cell || cell.isEdge()) {
|
|
64
|
+
console.error('node_is _not_exsit', node);
|
|
65
|
+
return [2 /*return*/, { err: 'node_is _not_exsit' }];
|
|
66
|
+
}
|
|
67
|
+
currentPorts = cell.getPorts();
|
|
68
|
+
return [4 /*yield*/, updatePorts(tslib_1.__spreadArray([], currentPorts, true), cell, graph)];
|
|
69
|
+
case 1:
|
|
70
|
+
nextPorts = _a.sent();
|
|
71
|
+
if (nextPorts === false) {
|
|
72
|
+
return [2 /*return*/, { err: 'service rejected' }];
|
|
73
|
+
}
|
|
74
|
+
cell.setPropByPath('ports/items', nextPorts, tslib_1.__assign({ rewrite: true }, options));
|
|
75
|
+
/** update nodeConfig */
|
|
76
|
+
this.updatePortsOfNodeConfig(cell, nextPorts, options);
|
|
77
|
+
/** add undo */
|
|
78
|
+
ctx.addUndo(disposable_1.Disposable.create(function () { return tslib_1.__awaiter(_this, void 0, void 0, function () {
|
|
79
|
+
var _this = this;
|
|
80
|
+
return tslib_1.__generator(this, function (_a) {
|
|
81
|
+
commandService.executeCommand(constant_1.XFlowNodeCommands.UPDATE_NODE_PORT.id, { node: node, updatePorts: function () { return tslib_1.__awaiter(_this, void 0, void 0, function () { return tslib_1.__generator(this, function (_a) {
|
|
82
|
+
return [2 /*return*/, currentPorts];
|
|
83
|
+
}); }); } });
|
|
84
|
+
return [2 /*return*/];
|
|
85
|
+
});
|
|
86
|
+
}); }));
|
|
87
|
+
return [2 /*return*/, { ports: nextPorts }];
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
}); }, runtimeHook)];
|
|
91
|
+
case 2:
|
|
92
|
+
result = _b.sent();
|
|
93
|
+
ctx.setResult(result);
|
|
94
|
+
return [2 /*return*/, this];
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
}); };
|
|
98
|
+
/** undo cmd */
|
|
99
|
+
this.undo = function () { return tslib_1.__awaiter(_this, void 0, void 0, function () {
|
|
100
|
+
var ctx;
|
|
101
|
+
return tslib_1.__generator(this, function (_a) {
|
|
102
|
+
ctx = this.contextProvider();
|
|
103
|
+
if (this.isUndoable()) {
|
|
104
|
+
ctx.undo();
|
|
105
|
+
}
|
|
106
|
+
return [2 /*return*/, this];
|
|
107
|
+
});
|
|
108
|
+
}); };
|
|
109
|
+
/** redo cmd */
|
|
110
|
+
this.redo = function () { return tslib_1.__awaiter(_this, void 0, void 0, function () {
|
|
111
|
+
return tslib_1.__generator(this, function (_a) {
|
|
112
|
+
switch (_a.label) {
|
|
113
|
+
case 0:
|
|
114
|
+
if (!!this.isUndoable()) return [3 /*break*/, 2];
|
|
115
|
+
return [4 /*yield*/, this.execute()];
|
|
116
|
+
case 1:
|
|
117
|
+
_a.sent();
|
|
118
|
+
_a.label = 2;
|
|
119
|
+
case 2: return [2 /*return*/, this];
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
}); };
|
|
123
|
+
}
|
|
124
|
+
UpdateNodePort.prototype.isNodeAnchors = function (ports) {
|
|
125
|
+
return Array.isArray(ports);
|
|
126
|
+
};
|
|
127
|
+
UpdateNodePort.prototype.isPortMetaData = function (ports) {
|
|
128
|
+
return ports.items && Array.isArray(ports.items);
|
|
129
|
+
};
|
|
130
|
+
UpdateNodePort.prototype.isUndoable = function () {
|
|
131
|
+
var ctx = this.contextProvider();
|
|
132
|
+
return ctx.isUndoable();
|
|
133
|
+
};
|
|
134
|
+
tslib_1.__decorate([
|
|
135
|
+
(0, mana_syringe_1.inject)(interface_1.ICommandContextProvider),
|
|
136
|
+
tslib_1.__metadata("design:type", Object)
|
|
137
|
+
], UpdateNodePort.prototype, "contextProvider", void 0);
|
|
138
|
+
UpdateNodePort = tslib_1.__decorate([
|
|
139
|
+
(0, mana_syringe_1.injectable)({
|
|
140
|
+
token: { token: interface_1.ICommandHandler, named: NsUpdateNodePort.command.id },
|
|
141
|
+
})
|
|
142
|
+
/** 创建节点命令 */
|
|
143
|
+
], UpdateNodePort);
|
|
144
|
+
return UpdateNodePort;
|
|
145
|
+
}());
|
|
146
|
+
exports.UpdateNodePort = UpdateNodePort;
|
|
147
|
+
//# sourceMappingURL=node-update-port.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node-update-port.js","sourceRoot":"","sources":["../../../src/command-contributions/node/node-update-port.ts"],"names":[],"mappings":";;;;AAOA,6CAAiD;AACjD,wCAA+C;AAC/C,sDAAoD;AACpD,qDAAkF;AAQlF,IAAiB,gBAAgB,CAgChC;AAhCD,WAAiB,gBAAgB;IAC/B,iCAAiC;IACpB,wBAAO,GAAG,4BAAiB,CAAC,gBAAgB,CAAA;IACzD,eAAe;IACF,wBAAO,GAAG,gBAAgB,CAAA;AA4BzC,CAAC,EAhCgB,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAgChC;AAMD;IADA,aAAa;IACb;QAAA,iBA4GC;QAxGC,YAAO,GAAG,UAAC,KAAc,EAAE,IAAqB;YAC9C,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;gBAC5B,OAAO,KAAK,CAAC,WAAW,CAAC,IAAI,CAAC,CAAA;aAC/B;YACD,OAAO,IAAI,CAAA;QACb,CAAC,CAAA;QAED,kBAAa,GAAG,UAAC,MAAc;YAC7B,IAAM,IAAI,GAAG,MAAM,CAAC,OAAO,EAAE,CAAA;YAC7B,IAAM,QAAQ,GAAG,MAAM,CAAC,WAAW,EAAE,CAAA;YACrC,IAAM,IAAI,GAAG,MAAM,CAAC,OAAO,EAAE,CAAA;YAC7B,OAAO,uDACF,IAAI,GACJ,QAAQ,GACR,IAAI,CACe,CAAA;QAC1B,CAAC,CAAA;QAUD,4BAAuB,GAAG,UACxB,IAAY,EACZ,KAA4B,EAC5B,OAA0B;YAE1B,IAAM,UAAU,GAAG,KAAI,CAAC,aAAa,CAAC,IAAI,CAAC,CAAA;YAC3C,IAAI,KAAI,CAAC,aAAa,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE;gBACxC,UAAU,CAAC,KAAK,6BAAO,KAAK,OAAC,CAAA;aAC9B;YACD,IAAI,KAAI,CAAC,cAAc,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE;gBACzC,UAAU,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,IAAM,GAAG,GAAG,IAAI,CAAC,eAAe,EAAE,CAAA;QAClC,OAAO,GAAG,CAAC,UAAU,EAAE,CAAA;IACzB,CAAC;IAzGD;QAAC,IAAA,qBAAM,EAAC,mCAAuB,CAAC;;2DAA6C;IAFlE,cAAc;QAJ1B,IAAA,yBAAU,EAAC;YACV,KAAK,EAAE,EAAE,KAAK,EAAE,2BAAe,EAAE,KAAK,EAAE,gBAAgB,CAAC,OAAO,CAAC,EAAE,EAAE;SACtE,CAAC;QACF,aAAa;OACA,cAAc,CA4G1B;IAAD,qBAAC;CAAA,AA5GD,IA4GC;AA5GY,wCAAc"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { Graph as X6Graph } from '@antv/x6';
|
|
2
|
+
import { Node as X6Node } from '@antv/x6';
|
|
3
|
+
import type { HookHub } from '@sunspirytus/xflow-hook';
|
|
4
|
+
import type { IHooks } from '../../hooks/interface';
|
|
5
|
+
import type { NsGraph } from '../../interface';
|
|
6
|
+
import type { IContext, IArgsBase } from '../../command/interface';
|
|
7
|
+
import { ICommandHandler } from '../../command/interface';
|
|
8
|
+
type ICommand = ICommandHandler<NsUpdateNode.IArgs, NsUpdateNode.IResult, NsUpdateNode.ICmdHooks>;
|
|
9
|
+
export declare namespace NsUpdateNode {
|
|
10
|
+
const command: import("../../command/interface").IGraphCommand;
|
|
11
|
+
const hookKey = "updateNode";
|
|
12
|
+
interface IArgs extends IArgsBase {
|
|
13
|
+
/** 节点的新元数据 */
|
|
14
|
+
nodeConfig?: NsGraph.INodeConfig;
|
|
15
|
+
/** 更新节点元数据 */
|
|
16
|
+
setNodeConfig?: ISetNodeConfig;
|
|
17
|
+
/** setOptions:https://x6.antv.vision/zh/docs/api/model/cell/#setdata */
|
|
18
|
+
options?: X6Node.SetOptions;
|
|
19
|
+
/** 更新节点的服务 */
|
|
20
|
+
updateNodeService?: IUpdateNodeService;
|
|
21
|
+
}
|
|
22
|
+
const XFlowNodeSetOptions: X6Node.SetOptions;
|
|
23
|
+
interface ISetNodeConfig {
|
|
24
|
+
node: string | X6Node;
|
|
25
|
+
callback: (node: NsGraph.INodeConfig) => Promise<NsGraph.INodeConfig>;
|
|
26
|
+
}
|
|
27
|
+
interface IResult {
|
|
28
|
+
nodeConfig: NsGraph.INodeConfig;
|
|
29
|
+
nodeCell: X6Node;
|
|
30
|
+
}
|
|
31
|
+
interface IUpdateNodeService {
|
|
32
|
+
(args: IArgs): Promise<NsGraph.INodeConfig>;
|
|
33
|
+
}
|
|
34
|
+
interface ICmdHooks extends IHooks {
|
|
35
|
+
updateNode: HookHub<IArgs, IResult>;
|
|
36
|
+
}
|
|
37
|
+
const NODE_WIDTH = 200;
|
|
38
|
+
const NODE_HEIGHT = 40;
|
|
39
|
+
}
|
|
40
|
+
export declare class UpdateNodeCommand implements ICommand {
|
|
41
|
+
contextProvider: ICommand['contextProvider'];
|
|
42
|
+
ctx: IContext<NsUpdateNode.IArgs, NsUpdateNode.IResult, NsUpdateNode.ICmdHooks>;
|
|
43
|
+
init(): void;
|
|
44
|
+
setNodeConfig: (x6Node: X6Node, nodeConfig: NsGraph.INodeConfig, options: X6Node.SetOptions) => void;
|
|
45
|
+
getNodeConfig: (x6Node: X6Node) => any;
|
|
46
|
+
getNodeCell: (x6Graph: X6Graph, handlerArgs: NsUpdateNode.IArgs) => X6Node<X6Node.Properties>;
|
|
47
|
+
getNextNodeConfig: (handlerArgs: NsUpdateNode.IArgs, x6Node: X6Node) => Promise<NsGraph.INodeConfig>;
|
|
48
|
+
execute: () => Promise<this>;
|
|
49
|
+
undo: () => Promise<this>;
|
|
50
|
+
redo: () => Promise<this>;
|
|
51
|
+
isUndoable(): boolean;
|
|
52
|
+
}
|
|
53
|
+
export {};
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UpdateNodeCommand = exports.NsUpdateNode = void 0;
|
|
4
|
+
var tslib_1 = require("tslib");
|
|
5
|
+
var mana_syringe_1 = require("mana-syringe");
|
|
6
|
+
var x6_1 = require("@antv/x6");
|
|
7
|
+
var isBoolean_1 = tslib_1.__importDefault(require("lodash/isBoolean"));
|
|
8
|
+
var constant_1 = require("../constant");
|
|
9
|
+
var interface_1 = require("../../command/interface");
|
|
10
|
+
var x6_react_shape_1 = require("@antv/x6-react-shape");
|
|
11
|
+
var NsUpdateNode;
|
|
12
|
+
(function (NsUpdateNode) {
|
|
13
|
+
NsUpdateNode.command = constant_1.XFlowNodeCommands.UPDATE_NODE;
|
|
14
|
+
NsUpdateNode.hookKey = 'updateNode';
|
|
15
|
+
NsUpdateNode.XFlowNodeSetOptions = { overwrite: true };
|
|
16
|
+
NsUpdateNode.NODE_WIDTH = 200;
|
|
17
|
+
NsUpdateNode.NODE_HEIGHT = 40;
|
|
18
|
+
})(NsUpdateNode = exports.NsUpdateNode || (exports.NsUpdateNode = {}));
|
|
19
|
+
var UpdateNodeCommand = /** @class */ (function () {
|
|
20
|
+
/** 节点更新命令 */
|
|
21
|
+
function UpdateNodeCommand() {
|
|
22
|
+
var _this = this;
|
|
23
|
+
this.setNodeConfig = function (x6Node, nodeConfig, options) {
|
|
24
|
+
x6Node.setData(nodeConfig, options);
|
|
25
|
+
x6Node.setPosition((nodeConfig === null || nodeConfig === void 0 ? void 0 : nodeConfig.x) || 0, (nodeConfig === null || nodeConfig === void 0 ? void 0 : nodeConfig.y) || 0);
|
|
26
|
+
x6Node.setSize((nodeConfig === null || nodeConfig === void 0 ? void 0 : nodeConfig.width) || NsUpdateNode.NODE_WIDTH, (nodeConfig === null || nodeConfig === void 0 ? void 0 : nodeConfig.height) || NsUpdateNode.NODE_HEIGHT);
|
|
27
|
+
x6Node.angle((nodeConfig === null || nodeConfig === void 0 ? void 0 : nodeConfig.angle) || 0, {
|
|
28
|
+
absolute: true,
|
|
29
|
+
});
|
|
30
|
+
if ((0, isBoolean_1.default)(nodeConfig === null || nodeConfig === void 0 ? void 0 : nodeConfig.visible)) {
|
|
31
|
+
x6Node.setVisible(nodeConfig === null || nodeConfig === void 0 ? void 0 : nodeConfig.visible);
|
|
32
|
+
}
|
|
33
|
+
// SVG 元素更新label
|
|
34
|
+
if (!(x6Node instanceof x6_react_shape_1.ReactShape) && !!x6Node.getAttrByPath('text/text')) {
|
|
35
|
+
x6Node.setAttrByPath('text/text', nodeConfig.label);
|
|
36
|
+
}
|
|
37
|
+
// 支持nodeAttrs
|
|
38
|
+
if (nodeConfig.attrs) {
|
|
39
|
+
x6Node.setAttrs(nodeConfig.attrs);
|
|
40
|
+
}
|
|
41
|
+
// 更新ports
|
|
42
|
+
if (Array.isArray(nodeConfig.ports)) {
|
|
43
|
+
x6Node.setPropByPath('ports/items', nodeConfig.ports, tslib_1.__assign({ rewrite: true }, options));
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
this.getNodeConfig = function (x6Node) {
|
|
47
|
+
var data = x6Node.getData();
|
|
48
|
+
var position = x6Node.getPosition();
|
|
49
|
+
var size = x6Node.getSize();
|
|
50
|
+
return tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({}, data), position), size);
|
|
51
|
+
};
|
|
52
|
+
this.getNodeCell = function (x6Graph, handlerArgs) {
|
|
53
|
+
var nodeConfig = handlerArgs.nodeConfig, setNodeConfig = handlerArgs.setNodeConfig;
|
|
54
|
+
var nodeId = '';
|
|
55
|
+
if (setNodeConfig && setNodeConfig.node && typeof setNodeConfig.node === 'string') {
|
|
56
|
+
nodeId = setNodeConfig.node;
|
|
57
|
+
}
|
|
58
|
+
else if (nodeConfig && nodeConfig.id && typeof nodeConfig.id === 'string') {
|
|
59
|
+
nodeId = nodeConfig.id;
|
|
60
|
+
}
|
|
61
|
+
if (nodeId) {
|
|
62
|
+
return x6Graph === null || x6Graph === void 0 ? void 0 : x6Graph.getCellById(nodeId);
|
|
63
|
+
}
|
|
64
|
+
if (setNodeConfig && setNodeConfig.node instanceof x6_1.Node) {
|
|
65
|
+
return setNodeConfig.node;
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
this.getNextNodeConfig = function (handlerArgs, x6Node) { return tslib_1.__awaiter(_this, void 0, void 0, function () {
|
|
69
|
+
var nodeData;
|
|
70
|
+
return tslib_1.__generator(this, function (_a) {
|
|
71
|
+
if (handlerArgs && handlerArgs.setNodeConfig && handlerArgs.setNodeConfig.callback) {
|
|
72
|
+
nodeData = this.getNodeConfig(x6Node);
|
|
73
|
+
return [2 /*return*/, handlerArgs.setNodeConfig.callback(nodeData)];
|
|
74
|
+
}
|
|
75
|
+
return [2 /*return*/, handlerArgs.nodeConfig];
|
|
76
|
+
});
|
|
77
|
+
}); };
|
|
78
|
+
this.execute = function () { return tslib_1.__awaiter(_this, void 0, void 0, function () {
|
|
79
|
+
var _a, args, runtimeHook, hooks, result;
|
|
80
|
+
var _this = this;
|
|
81
|
+
return tslib_1.__generator(this, function (_b) {
|
|
82
|
+
switch (_b.label) {
|
|
83
|
+
case 0:
|
|
84
|
+
_a = this.ctx.getArgs(), args = _a.args, runtimeHook = _a.hooks;
|
|
85
|
+
hooks = this.ctx.getHooks();
|
|
86
|
+
return [4 /*yield*/, hooks.updateNode.call(args, function (handlerArgs) { return tslib_1.__awaiter(_this, void 0, void 0, function () {
|
|
87
|
+
var _a, options, graph, x6Node, nextNodeConfig;
|
|
88
|
+
return tslib_1.__generator(this, function (_b) {
|
|
89
|
+
switch (_b.label) {
|
|
90
|
+
case 0:
|
|
91
|
+
_a = handlerArgs.options, options = _a === void 0 ? NsUpdateNode.XFlowNodeSetOptions : _a;
|
|
92
|
+
return [4 /*yield*/, this.ctx.getX6Graph()];
|
|
93
|
+
case 1:
|
|
94
|
+
graph = _b.sent();
|
|
95
|
+
x6Node = this.getNodeCell(graph, handlerArgs);
|
|
96
|
+
return [4 /*yield*/, this.getNextNodeConfig(handlerArgs, x6Node)];
|
|
97
|
+
case 2:
|
|
98
|
+
nextNodeConfig = _b.sent();
|
|
99
|
+
this.setNodeConfig(x6Node, nextNodeConfig, options);
|
|
100
|
+
return [2 /*return*/, {
|
|
101
|
+
nodeConfig: nextNodeConfig,
|
|
102
|
+
nodeCell: x6Node,
|
|
103
|
+
}];
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
}); }, runtimeHook)];
|
|
107
|
+
case 1:
|
|
108
|
+
result = _b.sent();
|
|
109
|
+
this.ctx.setResult(result);
|
|
110
|
+
return [2 /*return*/, this];
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
}); };
|
|
114
|
+
this.undo = function () { return tslib_1.__awaiter(_this, void 0, void 0, function () {
|
|
115
|
+
return tslib_1.__generator(this, function (_a) {
|
|
116
|
+
this.ctx.undo();
|
|
117
|
+
return [2 /*return*/, this];
|
|
118
|
+
});
|
|
119
|
+
}); };
|
|
120
|
+
this.redo = function () { return tslib_1.__awaiter(_this, void 0, void 0, function () {
|
|
121
|
+
return tslib_1.__generator(this, function (_a) {
|
|
122
|
+
switch (_a.label) {
|
|
123
|
+
case 0:
|
|
124
|
+
if (!!this.ctx.isUndoable) return [3 /*break*/, 2];
|
|
125
|
+
return [4 /*yield*/, this.execute()];
|
|
126
|
+
case 1:
|
|
127
|
+
_a.sent();
|
|
128
|
+
_a.label = 2;
|
|
129
|
+
case 2: return [2 /*return*/, this];
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
}); };
|
|
133
|
+
}
|
|
134
|
+
UpdateNodeCommand.prototype.init = function () {
|
|
135
|
+
this.ctx = this.contextProvider();
|
|
136
|
+
};
|
|
137
|
+
UpdateNodeCommand.prototype.isUndoable = function () {
|
|
138
|
+
return this.ctx.isUndoable();
|
|
139
|
+
};
|
|
140
|
+
tslib_1.__decorate([
|
|
141
|
+
(0, mana_syringe_1.inject)(interface_1.ICommandContextProvider),
|
|
142
|
+
tslib_1.__metadata("design:type", Object)
|
|
143
|
+
], UpdateNodeCommand.prototype, "contextProvider", void 0);
|
|
144
|
+
tslib_1.__decorate([
|
|
145
|
+
(0, mana_syringe_1.postConstruct)(),
|
|
146
|
+
tslib_1.__metadata("design:type", Function),
|
|
147
|
+
tslib_1.__metadata("design:paramtypes", []),
|
|
148
|
+
tslib_1.__metadata("design:returntype", void 0)
|
|
149
|
+
], UpdateNodeCommand.prototype, "init", null);
|
|
150
|
+
UpdateNodeCommand = tslib_1.__decorate([
|
|
151
|
+
(0, mana_syringe_1.injectable)({
|
|
152
|
+
token: { token: interface_1.ICommandHandler, named: NsUpdateNode.command.id },
|
|
153
|
+
})
|
|
154
|
+
/** 节点更新命令 */
|
|
155
|
+
], UpdateNodeCommand);
|
|
156
|
+
return UpdateNodeCommand;
|
|
157
|
+
}());
|
|
158
|
+
exports.UpdateNodeCommand = UpdateNodeCommand;
|
|
159
|
+
//# sourceMappingURL=node-update.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node-update.js","sourceRoot":"","sources":["../../../src/command-contributions/node/node-update.ts"],"names":[],"mappings":";;;;AAAA,6CAAgE;AAEhE,+BAAyC;AAEzC,uEAAwC;AAExC,wCAA+C;AAG/C,qDAAkF;AAClF,uDAAiD;AAIjD,IAAiB,YAAY,CAmC5B;AAnCD,WAAiB,YAAY;IACd,oBAAO,GAAG,4BAAiB,CAAC,WAAW,CAAA;IACvC,oBAAO,GAAG,YAAY,CAAA;IAatB,gCAAmB,GAAsB,EAAE,SAAS,EAAE,IAAI,EAAE,CAAA;IAkB5D,uBAAU,GAAG,GAAG,CAAA;IAChB,wBAAW,GAAG,EAAE,CAAA;AAC/B,CAAC,EAnCgB,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAmC5B;AAMD;IADA,aAAa;IACb;QAAA,iBAiHC;QAvGC,kBAAa,GAAG,UAAC,MAAc,EAAE,UAA+B,EAAE,OAA0B;YAC1F,MAAM,CAAC,OAAO,CAAC,UAAU,EAAE,OAAO,CAAC,CAAA;YACnC,MAAM,CAAC,WAAW,CAAC,CAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,CAAC,KAAI,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AC;IAsGD,sCAAU,GAAV;QACE,OAAO,IAAI,CAAC,GAAG,CAAC,UAAU,EAAE,CAAA;IAC9B,CAAC;IA/GD;QAAC,IAAA,qBAAM,EAAC,mCAAuB,CAAC;;8DAA6C;IAI7E;QAAC,IAAA,4BAAa,GAAE;;;;iDAGf;IARU,iBAAiB;QAJ7B,IAAA,yBAAU,EAAC;YACV,KAAK,EAAE,EAAE,KAAK,EAAE,2BAAe,EAAE,KAAK,EAAE,YAAY,CAAC,OAAO,CAAC,EAAE,EAAE;SAClE,CAAC;QACF,aAAa;OACA,iBAAiB,CAiH7B;IAAD,wBAAC;CAAA,AAjHD,IAiHC;AAjHY,8CAAiB"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Deferred = void 0;
|
|
4
|
+
var Deferred = /** @class */ (function () {
|
|
5
|
+
function Deferred() {
|
|
6
|
+
var _this = this;
|
|
7
|
+
this.isResolved = false;
|
|
8
|
+
this.isRejected = false;
|
|
9
|
+
this.promise = new Promise(function (resolve, reject) {
|
|
10
|
+
_this.resolve = function () {
|
|
11
|
+
var args = [];
|
|
12
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
13
|
+
args[_i] = arguments[_i];
|
|
14
|
+
}
|
|
15
|
+
_this.isResolved = true;
|
|
16
|
+
resolve.apply(void 0, args);
|
|
17
|
+
};
|
|
18
|
+
_this.reject = function () {
|
|
19
|
+
var args = [];
|
|
20
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
21
|
+
args[_i] = arguments[_i];
|
|
22
|
+
}
|
|
23
|
+
_this.isRejected = true;
|
|
24
|
+
reject.apply(void 0, args);
|
|
25
|
+
};
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
return Deferred;
|
|
29
|
+
}());
|
|
30
|
+
exports.Deferred = Deferred;
|
|
31
|
+
//# sourceMappingURL=deferred.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deferred.js","sourceRoot":"","sources":["../../src/common/deferred.ts"],"names":[],"mappings":";;;AAAA;IAWE;QAAA,iBAWC;QArBD,eAAU,GAAY,KAAK,CAAA;QAE3B,eAAU,GAAY,KAAK,CAAA;QASzB,IAAI,CAAC,OAAO,GAAG,IAAI,OAAO,CAAI,UAAC,OAAO,EAAE,MAAM;YAC5C,KAAI,CAAC,OAAO,GAAG;gBAAC,cAAO;qBAAP,UAAO,EAAP,qBAAO,EAAP,IAAO;oBAAP,yBAAO;;gBACrB,KAAI,CAAC,UAAU,GAAG,IAAI,CAAA;gBACtB,OAAO,eAAI,IAAI,EAAC;YAClB,CAAC,CAAA;YACD,KAAI,CAAC,MAAM,GAAG;gBAAC,cAAO;qBAAP,UAAO,EAAP,qBAAO,EAAP,IAAO;oBAAP,yBAAO;;gBACpB,KAAI,CAAC,UAAU,GAAG,IAAI,CAAA;gBACtB,MAAM,eAAI,IAAI,EAAC;YACjB,CAAC,CAAA;QACH,CAAC,CAAC,CAAA;IACJ,CAAC;IACH,eAAC;AAAD,CAAC,AAvBD,IAuBC;AAvBY,4BAAQ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function delay(ms: number): Promise<unknown>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.delay = void 0;
|
|
4
|
+
// yield delay(1000)
|
|
5
|
+
function delay(ms) {
|
|
6
|
+
return new Promise(function (resolve) { return setTimeout(function () { return resolve(true); }, ms); });
|
|
7
|
+
}
|
|
8
|
+
exports.delay = delay;
|
|
9
|
+
//# sourceMappingURL=delay.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delay.js","sourceRoot":"","sources":["../../src/common/delay.ts"],"names":[],"mappings":";;;AAAA,oBAAoB;AACpB,SAAgB,KAAK,CAAC,EAAU;IAC9B,OAAO,IAAI,OAAO,CAAC,UAAA,OAAO,IAAI,OAAA,UAAU,CAAC,cAAM,OAAA,OAAO,CAAC,IAAI,CAAC,EAAb,CAAa,EAAE,EAAE,CAAC,EAAnC,CAAmC,CAAC,CAAA;AACpE,CAAC;AAFD,sBAEC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Emitter } from 'mana-common';
|
|
2
|
+
export interface Disposable {
|
|
3
|
+
/**
|
|
4
|
+
* Dispose this object.
|
|
5
|
+
*/
|
|
6
|
+
dispose: () => void;
|
|
7
|
+
}
|
|
8
|
+
export declare namespace Disposable {
|
|
9
|
+
function is(arg: any): arg is Disposable;
|
|
10
|
+
function create(func: () => void): Disposable;
|
|
11
|
+
const NULL: Disposable;
|
|
12
|
+
}
|
|
13
|
+
export declare class DisposableCollection implements Disposable {
|
|
14
|
+
protected readonly disposables: Disposable[];
|
|
15
|
+
protected readonly onDisposeEmitter: Emitter<void>;
|
|
16
|
+
constructor(...toDispose: Disposable[]);
|
|
17
|
+
/**
|
|
18
|
+
* This event is fired only once
|
|
19
|
+
* on first dispose of not empty collection.
|
|
20
|
+
*/
|
|
21
|
+
get onDispose(): import("mana-common").Event<void>;
|
|
22
|
+
protected checkDisposed(): void;
|
|
23
|
+
get disposed(): boolean;
|
|
24
|
+
private disposingElements;
|
|
25
|
+
dispose(): Promise<void>;
|
|
26
|
+
push(disposable: Disposable): Disposable;
|
|
27
|
+
pushAll(disposables: Disposable[]): Disposable[];
|
|
28
|
+
}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DisposableCollection = exports.Disposable = void 0;
|
|
4
|
+
var tslib_1 = require("tslib");
|
|
5
|
+
var mana_common_1 = require("mana-common");
|
|
6
|
+
var Disposable;
|
|
7
|
+
(function (Disposable) {
|
|
8
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9
|
+
function is(arg) {
|
|
10
|
+
return !!arg && typeof arg === 'object' && 'dispose' in arg && typeof arg.dispose === 'function';
|
|
11
|
+
}
|
|
12
|
+
Disposable.is = is;
|
|
13
|
+
function create(func) {
|
|
14
|
+
return {
|
|
15
|
+
dispose: func,
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
Disposable.create = create;
|
|
19
|
+
Disposable.NULL = create(function () { });
|
|
20
|
+
})(Disposable = exports.Disposable || (exports.Disposable = {}));
|
|
21
|
+
var DisposableCollection = /** @class */ (function () {
|
|
22
|
+
function DisposableCollection() {
|
|
23
|
+
var toDispose = [];
|
|
24
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
25
|
+
toDispose[_i] = arguments[_i];
|
|
26
|
+
}
|
|
27
|
+
var _this = this;
|
|
28
|
+
this.disposables = [];
|
|
29
|
+
this.onDisposeEmitter = new mana_common_1.Emitter();
|
|
30
|
+
this.disposingElements = false;
|
|
31
|
+
toDispose.forEach(function (d) { return _this.push(d); });
|
|
32
|
+
}
|
|
33
|
+
Object.defineProperty(DisposableCollection.prototype, "onDispose", {
|
|
34
|
+
/**
|
|
35
|
+
* This event is fired only once
|
|
36
|
+
* on first dispose of not empty collection.
|
|
37
|
+
*/
|
|
38
|
+
get: function () {
|
|
39
|
+
return this.onDisposeEmitter.event;
|
|
40
|
+
},
|
|
41
|
+
enumerable: false,
|
|
42
|
+
configurable: true
|
|
43
|
+
});
|
|
44
|
+
DisposableCollection.prototype.checkDisposed = function () {
|
|
45
|
+
if (this.disposed && !this.disposingElements) {
|
|
46
|
+
this.onDisposeEmitter.fire(undefined);
|
|
47
|
+
this.onDisposeEmitter.dispose();
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
Object.defineProperty(DisposableCollection.prototype, "disposed", {
|
|
51
|
+
get: function () {
|
|
52
|
+
return this.disposables.length === 0;
|
|
53
|
+
},
|
|
54
|
+
enumerable: false,
|
|
55
|
+
configurable: true
|
|
56
|
+
});
|
|
57
|
+
DisposableCollection.prototype.dispose = function () {
|
|
58
|
+
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
59
|
+
var d, e_1;
|
|
60
|
+
return tslib_1.__generator(this, function (_a) {
|
|
61
|
+
switch (_a.label) {
|
|
62
|
+
case 0:
|
|
63
|
+
if (this.disposed || this.disposingElements) {
|
|
64
|
+
return [2 /*return*/];
|
|
65
|
+
}
|
|
66
|
+
this.disposingElements = true;
|
|
67
|
+
_a.label = 1;
|
|
68
|
+
case 1:
|
|
69
|
+
if (!!this.disposed) return [3 /*break*/, 6];
|
|
70
|
+
_a.label = 2;
|
|
71
|
+
case 2:
|
|
72
|
+
_a.trys.push([2, 4, , 5]);
|
|
73
|
+
d = this.disposables.pop();
|
|
74
|
+
return [4 /*yield*/, d.dispose()];
|
|
75
|
+
case 3:
|
|
76
|
+
_a.sent();
|
|
77
|
+
return [3 /*break*/, 5];
|
|
78
|
+
case 4:
|
|
79
|
+
e_1 = _a.sent();
|
|
80
|
+
console.error(e_1);
|
|
81
|
+
return [3 /*break*/, 5];
|
|
82
|
+
case 5: return [3 /*break*/, 1];
|
|
83
|
+
case 6:
|
|
84
|
+
this.disposingElements = false;
|
|
85
|
+
this.checkDisposed();
|
|
86
|
+
return [2 /*return*/];
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
});
|
|
90
|
+
};
|
|
91
|
+
DisposableCollection.prototype.push = function (disposable) {
|
|
92
|
+
var _this = this;
|
|
93
|
+
var disposables = this.disposables;
|
|
94
|
+
disposables.push(disposable);
|
|
95
|
+
var originalDispose = disposable.dispose.bind(disposable);
|
|
96
|
+
var toRemove = Disposable.create(function () {
|
|
97
|
+
var index = disposables.indexOf(disposable);
|
|
98
|
+
if (index !== -1) {
|
|
99
|
+
disposables.splice(index, 1);
|
|
100
|
+
}
|
|
101
|
+
_this.checkDisposed();
|
|
102
|
+
});
|
|
103
|
+
disposable.dispose = function () {
|
|
104
|
+
toRemove.dispose();
|
|
105
|
+
originalDispose();
|
|
106
|
+
};
|
|
107
|
+
return toRemove;
|
|
108
|
+
};
|
|
109
|
+
DisposableCollection.prototype.pushAll = function (disposables) {
|
|
110
|
+
var _this = this;
|
|
111
|
+
return disposables.map(function (disposable) { return _this.push(disposable); });
|
|
112
|
+
};
|
|
113
|
+
return DisposableCollection;
|
|
114
|
+
}());
|
|
115
|
+
exports.DisposableCollection = DisposableCollection;
|
|
116
|
+
//# sourceMappingURL=disposable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"disposable.js","sourceRoot":"","sources":["../../src/common/disposable.ts"],"names":[],"mappings":";;;;AAAA,2CAAqC;AAQrC,IAAiB,UAAU,CAW1B;AAXD,WAAiB,UAAU;IACzB,8DAA8D;IAC9D,SAAgB,EAAE,CAAC,GAAQ;QACzB,OAAO,CAAC,CAAC,GAAG,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,SAAS,IAAI,GAAG,IAAI,OAAO,GAAG,CAAC,OAAO,KAAK,UAAU,CAAA;IAClG,CAAC;IAFe,aAAE,KAEjB,CAAA;IACD,SAAgB,MAAM,CAAC,IAAgB;QACrC,OAAO;YACL,OAAO,EAAE,IAAI;SACd,CAAA;IACH,CAAC;IAJe,iBAAM,SAIrB,CAAA;IACY,eAAI,GAAG,MAAM,CAAC,cAAO,CAAC,CAAC,CAAA;AACtC,CAAC,EAXgB,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAW1B;AAED;IAIE;QAAY,mBAA0B;aAA1B,UAA0B,EAA1B,qBAA0B,EAA1B,IAA0B;YAA1B,8BAA0B;;QAAtC,iBAEC;QALkB,gBAAW,GAAiB,EAAE,CAAA;QAC9B,qBAAgB,GAAG,IAAI,qBAAO,EAAQ,CAAA;QAyBjD,sBAAiB,GAAG,KAAK,CAAA;QAtB/B,SAAS,CAAC,OAAO,CAAC,UAAA,CAAC,IAAI,OAAA,KAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAZ,CAAY,CAAC,CAAA;IACtC,CAAC;IAMD,sBAAI,2C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AC7C,IAAI,KAAK,KAAK,CAAC,CAAC,EAAE;gBAChB,WAAW,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAA;aAC7B;YACD,KAAI,CAAC,aAAa,EAAE,CAAA;QACtB,CAAC,CAAC,CAAA;QACF,UAAU,CAAC,OAAO,GAAG;YACnB,QAAQ,CAAC,OAAO,EAAE,CAAA;YAClB,eAAe,EAAE,CAAA;QACnB,CAAC,CAAA;QACD,OAAO,QAAQ,CAAA;IACjB,CAAC;IAED,sCAAO,GAAP,UAAQ,WAAyB;QAAjC,iBAEC;QADC,OAAO,WAAW,CAAC,GAAG,CAAC,UAAA,UAAU,IAAI,OAAA,KAAI,CAAC,IAAI,CAAC,UAAU,CAAC,EAArB,CAAqB,CAAC,CAAA;IAC7D,CAAC;IACH,2BAAC;AAAD,CAAC,AAnED,IAmEC;AAnEY,oDAAoB"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.disposableSubscribe = void 0;
|
|
4
|
+
var disposable_1 = require("./disposable");
|
|
5
|
+
var disposableSubscribe = function (target, eventName, cb) {
|
|
6
|
+
target.on(eventName, cb);
|
|
7
|
+
return disposable_1.Disposable.create(function () {
|
|
8
|
+
target.off(eventName, cb);
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
exports.disposableSubscribe = disposableSubscribe;
|
|
12
|
+
//# sourceMappingURL=event-helper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event-helper.js","sourceRoot":"","sources":["../../src/common/event-helper.ts"],"names":[],"mappings":";;;AAAA,2CAAyC;AAOlC,IAAM,mBAAmB,GAAG,UAAC,MAAc,EAAE,SAAiB,EAAE,EAAY;IACjF,MAAM,CAAC,EAAE,CAAC,SAAS,EAAE,EAAE,CAAC,CAAA;IACxB,OAAO,uBAAU,CAAC,MAAM,CAAC;QACvB,MAAM,CAAC,GAAG,CAAC,SAAS,EAAE,EAAE,CAAC,CAAA;IAC3B,CAAC,CAAC,CAAA;AACJ,CAAC,CAAA;AALY,QAAA,mBAAmB,uBAK/B"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { Cell, Node, Edge } from '@antv/x6';
|
|
2
|
+
import type { NsGraph } from '../interface';
|
|
3
|
+
export declare const node2Json: (cell: Node) => {
|
|
4
|
+
id: string;
|
|
5
|
+
width: number;
|
|
6
|
+
height: number;
|
|
7
|
+
x: number;
|
|
8
|
+
y: number;
|
|
9
|
+
group: string;
|
|
10
|
+
groupChildren: string[];
|
|
11
|
+
groupCollapsedSize: any;
|
|
12
|
+
label?: string;
|
|
13
|
+
renderKey?: string;
|
|
14
|
+
isGroup?: boolean;
|
|
15
|
+
ports?: NsGraph.INodeAnchor[] | NsGraph.INodePortMeta;
|
|
16
|
+
attrs?: import("@antv/x6/lib/registry").Attr.CellAttrs;
|
|
17
|
+
};
|
|
18
|
+
export declare const edge2Json: (cell: Edge) => any;
|
|
19
|
+
export declare const cellsToJson: (cells: Cell<Cell.Properties>[]) => {
|
|
20
|
+
nodes: NsGraph.INodeConfig[];
|
|
21
|
+
edges: NsGraph.IEdgeConfig[];
|
|
22
|
+
};
|