@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,8 @@
|
|
|
1
|
+
/** https://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid#answer-2117523 */
|
|
2
|
+
export function uuidv4() {
|
|
3
|
+
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
|
|
4
|
+
const r = (Math.random() * 16) | 0, v = c == 'x' ? r : (r & 0x3) | 0x8;
|
|
5
|
+
return v.toString(16);
|
|
6
|
+
});
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=uuid.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uuid.js","sourceRoot":"","sources":["../../src/common/uuid.ts"],"names":[],"mappings":"AAAA,0FAA0F;AAC1F,MAAM,UAAU,MAAM;IACpB,OAAO,sCAAsC,CAAC,OAAO,CAAC,OAAO,EAAE,UAAU,CAAC;QACxE,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,EAChC,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,GAAG,GAAG,CAAA;QACpC,OAAO,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAA;IACvB,CAAC,CAAC,CAAA;AACJ,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export declare const X6_NODE_PORTAL_NODE_VIEW = "X6_NODE_PORTAL_NODE_VIEW";
|
|
2
|
+
export declare const XFLOW_PREFIX_CLS = "xflow";
|
|
3
|
+
/** 画布缩放最小倍数 */
|
|
4
|
+
export declare const MIN_ZOOM = 0.01;
|
|
5
|
+
/** 画布缩放最大倍数 */
|
|
6
|
+
export declare const MAX_ZOOM = 1.5;
|
|
7
|
+
/** node render 的默认key值 */
|
|
8
|
+
export declare const XFLOW_DEFAULT_NODE = "XFLOW_DEFAULT_NODE";
|
|
9
|
+
/** node render 的默认key值 */
|
|
10
|
+
export declare const XFLOW_DEFAULT_GROUP_NODE = "XFLOW_DEFAULT_GROUP_NODE";
|
|
11
|
+
/** edge render 的默认key值 */
|
|
12
|
+
export declare const XFLOW_DEFAULT_EDGE = "XFLOW_DEFAULT_EDGE";
|
|
13
|
+
/** 扩展事件:事件参数 */
|
|
14
|
+
export interface XFlowEventRecord {
|
|
15
|
+
TOGGLE_MULTI_SELECT: {
|
|
16
|
+
isEnable: boolean;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
/** 事件名: 扩展事件 */
|
|
20
|
+
export type XFlowEventName = keyof XFlowEventRecord;
|
|
21
|
+
/** localStorage key */
|
|
22
|
+
export declare const LOCAL_STORAGE_KEY = "XFLOW_COPY_ITEMS";
|
|
23
|
+
/** node height */
|
|
24
|
+
export declare const DEFAULT_NODE_HEIGHT = 36;
|
|
25
|
+
/** node width */
|
|
26
|
+
export declare const DEFAULT_NODE_WIDTH = 180;
|
|
27
|
+
/** default group size */
|
|
28
|
+
export declare const XFLOW_GROUP_DEFAULT_COLLAPSED_SIZE: {
|
|
29
|
+
width: number;
|
|
30
|
+
height: number;
|
|
31
|
+
};
|
package/es/constants.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// node portal id
|
|
2
|
+
export const X6_NODE_PORTAL_NODE_VIEW = 'X6_NODE_PORTAL_NODE_VIEW';
|
|
3
|
+
// style classname prefix
|
|
4
|
+
export const XFLOW_PREFIX_CLS = 'xflow';
|
|
5
|
+
/** 画布缩放最小倍数 */
|
|
6
|
+
export const MIN_ZOOM = 0.01;
|
|
7
|
+
/** 画布缩放最大倍数 */
|
|
8
|
+
export const MAX_ZOOM = 1.5;
|
|
9
|
+
/** node render 的默认key值 */
|
|
10
|
+
export const XFLOW_DEFAULT_NODE = 'XFLOW_DEFAULT_NODE';
|
|
11
|
+
/** node render 的默认key值 */
|
|
12
|
+
export const XFLOW_DEFAULT_GROUP_NODE = 'XFLOW_DEFAULT_GROUP_NODE';
|
|
13
|
+
/** edge render 的默认key值 */
|
|
14
|
+
export const XFLOW_DEFAULT_EDGE = 'XFLOW_DEFAULT_EDGE';
|
|
15
|
+
/** localStorage key */
|
|
16
|
+
export const LOCAL_STORAGE_KEY = 'XFLOW_COPY_ITEMS';
|
|
17
|
+
/** node height */
|
|
18
|
+
export const DEFAULT_NODE_HEIGHT = 36;
|
|
19
|
+
/** node width */
|
|
20
|
+
export const DEFAULT_NODE_WIDTH = 180;
|
|
21
|
+
/** default group size */
|
|
22
|
+
export const XFLOW_GROUP_DEFAULT_COLLAPSED_SIZE = {
|
|
23
|
+
width: DEFAULT_NODE_WIDTH,
|
|
24
|
+
height: DEFAULT_NODE_HEIGHT,
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,iBAAiB;AACjB,MAAM,CAAC,MAAM,wBAAwB,GAAG,0BAA0B,CAAA;AAElE,yBAAyB;AACzB,MAAM,CAAC,MAAM,gBAAgB,GAAG,OAAO,CAAA;AAEvC,eAAe;AACf,MAAM,CAAC,MAAM,QAAQ,GAAG,IAAI,CAAA;AAE5B,eAAe;AACf,MAAM,CAAC,MAAM,QAAQ,GAAG,GAAG,CAAA;AAE3B,0BAA0B;AAC1B,MAAM,CAAC,MAAM,kBAAkB,GAAG,oBAAoB,CAAA;AAEtD,0BAA0B;AAC1B,MAAM,CAAC,MAAM,wBAAwB,GAAG,0BAA0B,CAAA;AAElE,0BAA0B;AAC1B,MAAM,CAAC,MAAM,kBAAkB,GAAG,oBAAoB,CAAA;AAYtD,uBAAuB;AACvB,MAAM,CAAC,MAAM,iBAAiB,GAAG,kBAAkB,CAAA;AAEnD,kBAAkB;AAClB,MAAM,CAAC,MAAM,mBAAmB,GAAG,EAAE,CAAA;AAErC,iBAAiB;AACjB,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAG,CAAA;AAErC,yBAAyB;AACzB,MAAM,CAAC,MAAM,kCAAkC,GAAG;IAChD,KAAK,EAAE,kBAAkB;IACzB,MAAM,EAAE,mBAAmB;CAC5B,CAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { XFlowHookConfig } from '../module';
|
|
3
|
+
import { HookConfig } from '../config';
|
|
4
|
+
export interface IProps {
|
|
5
|
+
config?: XFlowHookConfig;
|
|
6
|
+
XFlowModuleType?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare const HookRegistry: React.FC<IProps>;
|
|
9
|
+
interface IValueProxy<T> {
|
|
10
|
+
getValue: () => T;
|
|
11
|
+
}
|
|
12
|
+
export declare const createHookConfig: <T extends unknown = any>(addOptions: (config: HookConfig, container: IValueProxy<T>) => void) => (value?: T) => any;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { XFlowHookConfig, createModule } from '../module';
|
|
3
|
+
import { useExtensionRegistry } from '../../xflow-main/components/extension-context';
|
|
4
|
+
import { HookConfig } from '../config';
|
|
5
|
+
export const HookRegistry = props => {
|
|
6
|
+
/** 获取配置中心 */
|
|
7
|
+
const extensionRegistry = useExtensionRegistry();
|
|
8
|
+
/** 获取ContextService的配置 */
|
|
9
|
+
const hookConfig = React.useMemo(() => (props.config ? props.config : new XFlowHookConfig()),
|
|
10
|
+
// 不要移除:保证config只生成一次
|
|
11
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
12
|
+
[]);
|
|
13
|
+
React.useEffect(() => {
|
|
14
|
+
const disposable = extensionRegistry.addCoreModule({
|
|
15
|
+
config: hookConfig,
|
|
16
|
+
createModule,
|
|
17
|
+
});
|
|
18
|
+
return () => {
|
|
19
|
+
disposable.dispose();
|
|
20
|
+
hookConfig.dispose();
|
|
21
|
+
};
|
|
22
|
+
}, [extensionRegistry, hookConfig]);
|
|
23
|
+
return null;
|
|
24
|
+
};
|
|
25
|
+
export const createHookConfig = (addOptions) => (value) => {
|
|
26
|
+
/** bridge config and value */
|
|
27
|
+
const valueContainer = React.useMemo(() => ({ getValue: () => ({}) }), []);
|
|
28
|
+
valueContainer.getValue = () => value;
|
|
29
|
+
const hookConfig = React.useMemo(() => {
|
|
30
|
+
const config = new HookConfig();
|
|
31
|
+
addOptions(config, valueContainer);
|
|
32
|
+
return config;
|
|
33
|
+
}, [valueContainer]);
|
|
34
|
+
return hookConfig;
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/hooks/components/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AACzD,OAAO,EAAE,oBAAoB,EAAE,MAAM,+CAA+C,CAAA;AACpF,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAA;AAOtC,MAAM,CAAC,MAAM,YAAY,GAAqB,KAAK,CAAC,EAAE;IACpD,aAAa;IACb,MAAM,iBAAiB,GAAG,oBAAoB,EAAE,CAAA;IAChD,0BAA0B;IAC1B,MAAM,UAAU,GAAG,KAAK,CAAC,OAAO,CAC9B,GAAG,EAAE,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,eAAe,EAAE,CAAC;IAC3D,qBAAqB;IACrB,uDAAuD;IACvD,EAAE,CACH,CAAA;IAED,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,MAAM,UAAU,GAAG,iBAAiB,CAAC,aAAa,CAAC;YACjD,MAAM,EAAE,UAAU;YAClB,YAAY;SACb,CAAC,CAAA;QACF,OAAO,GAAG,EAAE;YACV,UAAU,CAAC,OAAO,EAAE,CAAA;YACpB,UAAU,CAAC,OAAO,EAAE,CAAA;QACtB,CAAC,CAAA;IACH,CAAC,EAAE,CAAC,iBAAiB,EAAE,UAAU,CAAC,CAAC,CAAA;IACnC,OAAO,IAAI,CAAA;AACb,CAAC,CAAA;AAMD,MAAM,CAAC,MAAM,gBAAgB,GAC3B,CAA0B,UAAmE,EAAE,EAAE,CACjG,CAAC,KAAS,EAAE,EAAE;IACZ,8BAA8B;IAC9B,MAAM,cAAc,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,CAAC,EAAQ,CAAA,EAAE,CAAC,EAAE,EAAE,CAAC,CAAA;IAC/E,cAAc,CAAC,QAAQ,GAAG,GAAG,EAAE,CAAC,KAAK,CAAA;IAErC,MAAM,UAAU,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE;QACpC,MAAM,MAAM,GAAG,IAAI,UAAU,EAAE,CAAA;QAC/B,UAAU,CAAC,MAAM,EAAE,cAAc,CAAC,CAAA;QAClC,OAAO,MAAM,CAAA;IACf,CAAC,EAAE,CAAC,cAAc,CAAC,CAAC,CAAA;IAEpB,OAAO,UAAU,CAAA;AACnB,CAAC,CAAA"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { IRegisterHookHubFn, IRegisterHookFn } from './interface';
|
|
2
|
+
import type { IModuleConfig } from '../xflow-main/interface';
|
|
3
|
+
export declare const noop: () => {
|
|
4
|
+
dispose: () => void;
|
|
5
|
+
};
|
|
6
|
+
export declare namespace NsXFlowHook {
|
|
7
|
+
const CONFIG_TYPE = "XFlowHook";
|
|
8
|
+
}
|
|
9
|
+
export declare class HookConfig implements IModuleConfig {
|
|
10
|
+
/** CONFIG_TYPE */
|
|
11
|
+
readonly CONFIG_TYPE = "XFlowHook";
|
|
12
|
+
time: number;
|
|
13
|
+
/** 外部注册hook的方法 */
|
|
14
|
+
private hookRegisterFunc?;
|
|
15
|
+
/** 外部注册hookhub的方法 */
|
|
16
|
+
private hookhubRegisterFn?;
|
|
17
|
+
/** 提供一个runtime注册hook的方式 */
|
|
18
|
+
setRegisterHook: (fn: IRegisterHookFn) => void;
|
|
19
|
+
/** 这里在canvas上提供一个runtime注册hookhub的方式 */
|
|
20
|
+
setRegisterHookhub: (fn: IRegisterHookHubFn) => void;
|
|
21
|
+
getConfig: () => Promise<{
|
|
22
|
+
CONFIG_TYPE: string;
|
|
23
|
+
hookRegisterFn: IRegisterHookFn<{
|
|
24
|
+
graphOptions: import("@sunspirytus/xflow-hook").HookHub<import("@antv/x6").Graph.Options, import("@antv/x6").Graph.Options>;
|
|
25
|
+
reactNodeRender: import("@sunspirytus/xflow-hook").HookHub<Map<string, React.ComponentType<import("..").NsGraph.IReactNodeProps<T>>>, Map<string, React.ComponentType<import("..").NsGraph.IReactNodeProps<T>>>>;
|
|
26
|
+
reactEdgeLabelRender: import("@sunspirytus/xflow-hook").HookHub<Map<string, React.ComponentType<import("..").NsGraph.IReactEdgeProps<T_1>>>, Map<string, React.ComponentType<import("..").NsGraph.IReactEdgeProps<T_1>>>>;
|
|
27
|
+
afterGraphInit: import("@sunspirytus/xflow-hook").HookHub<import("./interface").IGeneralAppService, import("./interface").IGeneralAppService>;
|
|
28
|
+
beforeGraphDestroy: import("@sunspirytus/xflow-hook").HookHub<import("./interface").IGeneralAppService, import("./interface").IGeneralAppService>;
|
|
29
|
+
x6Events: import("@sunspirytus/xflow-hook").HookHub<import("./interface").IEventCollection, import("./interface").IEventSubscription>;
|
|
30
|
+
}>;
|
|
31
|
+
hookhubRegisterFn: IRegisterHookHubFn<{
|
|
32
|
+
graphOptions: import("@sunspirytus/xflow-hook").HookHub<import("@antv/x6").Graph.Options, import("@antv/x6").Graph.Options>;
|
|
33
|
+
reactNodeRender: import("@sunspirytus/xflow-hook").HookHub<Map<string, React.ComponentType<import("..").NsGraph.IReactNodeProps<T>>>, Map<string, React.ComponentType<import("..").NsGraph.IReactNodeProps<T>>>>;
|
|
34
|
+
reactEdgeLabelRender: import("@sunspirytus/xflow-hook").HookHub<Map<string, React.ComponentType<import("..").NsGraph.IReactEdgeProps<T_1>>>, Map<string, React.ComponentType<import("..").NsGraph.IReactEdgeProps<T_1>>>>;
|
|
35
|
+
afterGraphInit: import("@sunspirytus/xflow-hook").HookHub<import("./interface").IGeneralAppService, import("./interface").IGeneralAppService>;
|
|
36
|
+
beforeGraphDestroy: import("@sunspirytus/xflow-hook").HookHub<import("./interface").IGeneralAppService, import("./interface").IGeneralAppService>;
|
|
37
|
+
x6Events: import("@sunspirytus/xflow-hook").HookHub<import("./interface").IEventCollection, import("./interface").IEventSubscription>;
|
|
38
|
+
}>;
|
|
39
|
+
}>;
|
|
40
|
+
dispose: () => void;
|
|
41
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { __awaiter } from "tslib";
|
|
2
|
+
export const noop = () => {
|
|
3
|
+
return {
|
|
4
|
+
dispose: () => { },
|
|
5
|
+
};
|
|
6
|
+
};
|
|
7
|
+
export var NsXFlowHook;
|
|
8
|
+
(function (NsXFlowHook) {
|
|
9
|
+
NsXFlowHook.CONFIG_TYPE = 'XFlowHook';
|
|
10
|
+
})(NsXFlowHook || (NsXFlowHook = {}));
|
|
11
|
+
export class HookConfig {
|
|
12
|
+
constructor() {
|
|
13
|
+
/** CONFIG_TYPE */
|
|
14
|
+
this.CONFIG_TYPE = NsXFlowHook.CONFIG_TYPE;
|
|
15
|
+
this.time = Date.now();
|
|
16
|
+
/** 提供一个runtime注册hook的方式 */
|
|
17
|
+
this.setRegisterHook = (fn) => {
|
|
18
|
+
this.hookRegisterFunc = fn;
|
|
19
|
+
};
|
|
20
|
+
/** 这里在canvas上提供一个runtime注册hookhub的方式 */
|
|
21
|
+
this.setRegisterHookhub = (fn) => {
|
|
22
|
+
this.hookhubRegisterFn = fn;
|
|
23
|
+
};
|
|
24
|
+
this.getConfig = () => __awaiter(this, void 0, void 0, function* () {
|
|
25
|
+
const options = {
|
|
26
|
+
CONFIG_TYPE: this.CONFIG_TYPE,
|
|
27
|
+
hookRegisterFn: this.hookRegisterFunc || noop,
|
|
28
|
+
hookhubRegisterFn: this.hookhubRegisterFn || noop,
|
|
29
|
+
};
|
|
30
|
+
return options;
|
|
31
|
+
});
|
|
32
|
+
this.dispose = () => { };
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/hooks/config.tsx"],"names":[],"mappings":";AAGA,MAAM,CAAC,MAAM,IAAI,GAAG,GAAG,EAAE;IACvB,OAAO;QACL,OAAO,EAAE,GAAG,EAAE,GAAE,CAAC;KAClB,CAAA;AACH,CAAC,CAAA;AACD,MAAM,KAAW,WAAW,CAE3B;AAFD,WAAiB,WAAW;IACb,uBAAW,GAAG,WAAW,CAAA;AACxC,CAAC,EAFgB,WAAW,KAAX,WAAW,QAE3B;AAED,MAAM,OAAO,UAAU;IAAvB;QACE,kBAAkB;QACT,gBAAW,GAAG,WAAW,CAAC,WAAW,CAAA;QAEvC,SAAI,GAAG,IAAI,CAAC,GAAG,EAAE,CAAA;QAQxB,2BAA2B;QAC3B,oBAAe,GAAG,CAAC,EAAmB,EAAE,EAAE;YACxC,IAAI,CAAC,gBAAgB,GAAG,EAAE,CAAA;QAC5B,CAAC,CAAA;QAED,wCAAwC;QACxC,uBAAkB,GAAG,CAAC,EAAsB,EAAE,EAAE;YAC9C,IAAI,CAAC,iBAAiB,GAAG,EAAE,CAAA;QAC7B,CAAC,CAAA;QAED,cAAS,GAAG,GAAS,EAAE;YACrB,MAAM,OAAO,GAAG;gBACd,WAAW,EAAE,IAAI,CAAC,WAAW;gBAC7B,cAAc,EAAE,IAAI,CAAC,gBAAgB,IAAI,IAAI;gBAC7C,iBAAiB,EAAE,IAAI,CAAC,iBAAiB,IAAI,IAAI;aAClD,CAAA;YACD,OAAO,OAAO,CAAA;QAChB,CAAC,CAAA,CAAA;QAED,YAAO,GAAG,GAAG,EAAE,GAAE,CAAC,CAAA;IACpB,CAAC;CAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { DisposableCollection, Disposable } from '../../common/disposable';
|
|
2
|
+
import { HookConfig } from '../config';
|
|
3
|
+
import type { IHookService } from '../index';
|
|
4
|
+
import type { IHooks } from '../interface';
|
|
5
|
+
import { IHookContribution } from '../interface';
|
|
6
|
+
export declare namespace NsGraphEventPlugin {
|
|
7
|
+
const pluginId = "GraphEventPlugin";
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* 内置的hook contribution
|
|
11
|
+
* 处理 config上的runtime的注册项
|
|
12
|
+
*/
|
|
13
|
+
export declare class RuntimeContribution implements IHookContribution<IHooks> {
|
|
14
|
+
toDispose: DisposableCollection;
|
|
15
|
+
/** 通过optionProvider获取配置 */
|
|
16
|
+
hookConfig: HookConfig;
|
|
17
|
+
registerHook: (hooks: any) => Promise<Disposable>;
|
|
18
|
+
registerHookHub: (registry: IHookService<IHooks>) => Promise<Disposable>;
|
|
19
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { __awaiter, __decorate, __metadata } from "tslib";
|
|
2
|
+
import { DisposableCollection, Disposable } from '../../common/disposable';
|
|
3
|
+
import { HookConfig } from '../config';
|
|
4
|
+
import { singleton, inject } from 'mana-syringe';
|
|
5
|
+
import { IHookContribution } from '../interface';
|
|
6
|
+
export var NsGraphEventPlugin;
|
|
7
|
+
(function (NsGraphEventPlugin) {
|
|
8
|
+
NsGraphEventPlugin.pluginId = 'GraphEventPlugin';
|
|
9
|
+
})(NsGraphEventPlugin || (NsGraphEventPlugin = {}));
|
|
10
|
+
/**
|
|
11
|
+
* 内置的hook contribution
|
|
12
|
+
* 处理 config上的runtime的注册项
|
|
13
|
+
*/
|
|
14
|
+
let RuntimeContribution = class RuntimeContribution {
|
|
15
|
+
constructor() {
|
|
16
|
+
this.toDispose = new DisposableCollection();
|
|
17
|
+
this.registerHook = (hooks) => __awaiter(this, void 0, void 0, function* () {
|
|
18
|
+
const { hookRegisterFn } = yield this.hookConfig.getConfig();
|
|
19
|
+
const d = hookRegisterFn(hooks);
|
|
20
|
+
return Disposable.create(() => {
|
|
21
|
+
d.dispose();
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
this.registerHookHub = (registry) => __awaiter(this, void 0, void 0, function* () {
|
|
25
|
+
const { hookhubRegisterFn } = yield this.hookConfig.getConfig();
|
|
26
|
+
const d = hookhubRegisterFn(registry);
|
|
27
|
+
return Disposable.create(() => {
|
|
28
|
+
d.dispose();
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
__decorate([
|
|
34
|
+
inject(HookConfig),
|
|
35
|
+
__metadata("design:type", HookConfig)
|
|
36
|
+
], RuntimeContribution.prototype, "hookConfig", void 0);
|
|
37
|
+
RuntimeContribution = __decorate([
|
|
38
|
+
singleton({ contrib: IHookContribution })
|
|
39
|
+
], RuntimeContribution);
|
|
40
|
+
export { RuntimeContribution };
|
|
41
|
+
//# sourceMappingURL=default.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"default.js","sourceRoot":"","sources":["../../../src/hooks/contributions/default.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,oBAAoB,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AAC1E,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAA;AAEtC,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAEhD,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA;AAChD,MAAM,KAAW,kBAAkB,CAElC;AAFD,WAAiB,kBAAkB;IACpB,2BAAQ,GAAG,kBAAkB,CAAA;AAC5C,CAAC,EAFgB,kBAAkB,KAAlB,kBAAkB,QAElC;AAED;;;GAGG;AAEI,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;IAAzB;QACL,cAAS,GAAG,IAAI,oBAAoB,EAAE,CAAA;QAKtC,iBAAY,GAAG,CAAM,KAAK,EAAC,EAAE;YAC3B,MAAM,EAAE,cAAc,EAAE,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,SAAS,EAAE,CAAA;YAC5D,MAAM,CAAC,GAAG,cAAc,CAAC,KAAK,CAAC,CAAA;YAC/B,OAAO,UAAU,CAAC,MAAM,CAAC,GAAG,EAAE;gBAC5B,CAAC,CAAC,OAAO,EAAE,CAAA;YACb,CAAC,CAAC,CAAA;QACJ,CAAC,CAAA,CAAA;QAED,oBAAe,GAAG,CAAO,QAA8B,EAAE,EAAE;YACzD,MAAM,EAAE,iBAAiB,EAAE,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,SAAS,EAAE,CAAA;YAC/D,MAAM,CAAC,GAAG,iBAAiB,CAAC,QAAQ,CAAC,CAAA;YACrC,OAAO,UAAU,CAAC,MAAM,CAAC,GAAG,EAAE;gBAC5B,CAAC,CAAC,OAAO,EAAE,CAAA;YACb,CAAC,CAAC,CAAA;QACJ,CAAC,CAAA,CAAA;IACH,CAAC;CAAA,CAAA;AAjBC;IAAC,MAAM,CAAC,UAAU,CAAC;8BAAa,UAAU;uDAAA;AAJ/B,mBAAmB;IAD/B,SAAS,CAAC,EAAE,OAAO,EAAE,iBAAiB,EAAE,CAAC;GAC7B,mBAAmB,CAqB/B;SArBY,mBAAmB"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { IGraphOptionProvider } from '../../xflow-main/graph/config';
|
|
2
|
+
import { DisposableCollection, Disposable } from '../../common/disposable';
|
|
3
|
+
import { IHookContribution } from '../interface';
|
|
4
|
+
import type { IHooks } from '../interface';
|
|
5
|
+
export declare namespace NsGraphEventPlugin {
|
|
6
|
+
const pluginId = "base-graph-events";
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* 内置的hook contribution
|
|
10
|
+
* 处理graph config 的 evnets props
|
|
11
|
+
*/
|
|
12
|
+
export declare class GraphEventContribution implements IHookContribution<IHooks> {
|
|
13
|
+
/** 通过optionProvider获取配置 */
|
|
14
|
+
graphOptions: IGraphOptionProvider;
|
|
15
|
+
toDispose: DisposableCollection;
|
|
16
|
+
registerHookHub: () => Promise<Disposable>;
|
|
17
|
+
/** 扩展Hook */
|
|
18
|
+
registerHook: (hooks: IHooks) => Promise<DisposableCollection>;
|
|
19
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { __awaiter, __decorate, __metadata } from "tslib";
|
|
2
|
+
import { singleton, inject } from 'mana-syringe';
|
|
3
|
+
import { IGraphOptionProvider } from '../../xflow-main/graph/config';
|
|
4
|
+
import { XFlowGraphCommands } from '../../command-contributions/constant';
|
|
5
|
+
import { DisposableCollection, Disposable } from '../../common/disposable';
|
|
6
|
+
import { IHookContribution } from '../interface';
|
|
7
|
+
import { throttle } from '../../common/utils';
|
|
8
|
+
export var NsGraphEventPlugin;
|
|
9
|
+
(function (NsGraphEventPlugin) {
|
|
10
|
+
NsGraphEventPlugin.pluginId = 'base-graph-events';
|
|
11
|
+
})(NsGraphEventPlugin || (NsGraphEventPlugin = {}));
|
|
12
|
+
/**
|
|
13
|
+
* 内置的hook contribution
|
|
14
|
+
* 处理graph config 的 evnets props
|
|
15
|
+
*/
|
|
16
|
+
let GraphEventContribution = class GraphEventContribution {
|
|
17
|
+
constructor() {
|
|
18
|
+
this.toDispose = new DisposableCollection();
|
|
19
|
+
this.registerHookHub = () => __awaiter(this, void 0, void 0, function* () {
|
|
20
|
+
return Disposable.create(() => { });
|
|
21
|
+
});
|
|
22
|
+
/** 扩展Hook */
|
|
23
|
+
this.registerHook = (hooks) => __awaiter(this, void 0, void 0, function* () {
|
|
24
|
+
const toDispose = new DisposableCollection();
|
|
25
|
+
const disposables = [
|
|
26
|
+
/** 在graph启动前, 注册外部事件到x6Events的hooks上*/
|
|
27
|
+
hooks.x6Events.registerHook({
|
|
28
|
+
name: NsGraphEventPlugin.pluginId,
|
|
29
|
+
handler: (args) => __awaiter(this, void 0, void 0, function* () {
|
|
30
|
+
const { events } = yield this.graphOptions.getOptions();
|
|
31
|
+
events.forEach(event => {
|
|
32
|
+
args.push(event);
|
|
33
|
+
});
|
|
34
|
+
}),
|
|
35
|
+
}),
|
|
36
|
+
/** 在graph init后, 外部事件 */
|
|
37
|
+
hooks.afterGraphInit.registerHook({
|
|
38
|
+
name: NsGraphEventPlugin.pluginId,
|
|
39
|
+
handler: (args) => __awaiter(this, void 0, void 0, function* () {
|
|
40
|
+
const { commandService, modelService, graph } = args;
|
|
41
|
+
/** 注册事件 */
|
|
42
|
+
const todo = yield hooks.x6Events.call([], (mergedEvents) => __awaiter(this, void 0, void 0, function* () {
|
|
43
|
+
return mergedEvents.map(e => {
|
|
44
|
+
const handler = handlerArgs => {
|
|
45
|
+
e.callback(handlerArgs, commandService, modelService, graph);
|
|
46
|
+
};
|
|
47
|
+
graph.on(e.eventName, handler);
|
|
48
|
+
return {
|
|
49
|
+
dispose: () => {
|
|
50
|
+
graph.off(e.eventName, handler);
|
|
51
|
+
},
|
|
52
|
+
};
|
|
53
|
+
});
|
|
54
|
+
}));
|
|
55
|
+
toDispose.pushAll(todo);
|
|
56
|
+
}),
|
|
57
|
+
}),
|
|
58
|
+
/** 监听window的resize事件,实现自动resize */
|
|
59
|
+
hooks.afterGraphInit.registerHook({
|
|
60
|
+
name: 'add auto resize event',
|
|
61
|
+
handler: (args) => __awaiter(this, void 0, void 0, function* () {
|
|
62
|
+
const { commandService, options, graph } = args;
|
|
63
|
+
const resizeHandler = throttle(() => {
|
|
64
|
+
commandService.executeCommand(XFlowGraphCommands.GRAPH_RESIZE.id, {});
|
|
65
|
+
});
|
|
66
|
+
window.addEventListener('resize', resizeHandler);
|
|
67
|
+
const { rootContainer } = options;
|
|
68
|
+
const resizeObserver = new ResizeObserver(() => graph.resize(rootContainer.clientWidth));
|
|
69
|
+
rootContainer && resizeObserver.observe(rootContainer);
|
|
70
|
+
toDispose.push(Disposable.create(() => {
|
|
71
|
+
window.removeEventListener('resize', resizeHandler);
|
|
72
|
+
}));
|
|
73
|
+
}),
|
|
74
|
+
}),
|
|
75
|
+
/** 在graph停止时 取消外部事件 */
|
|
76
|
+
hooks.beforeGraphDestroy.registerHook({
|
|
77
|
+
name: NsGraphEventPlugin.pluginId,
|
|
78
|
+
handler: () => __awaiter(this, void 0, void 0, function* () {
|
|
79
|
+
toDispose.dispose();
|
|
80
|
+
}),
|
|
81
|
+
}),
|
|
82
|
+
];
|
|
83
|
+
toDispose.pushAll(disposables);
|
|
84
|
+
return toDispose;
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
__decorate([
|
|
89
|
+
inject(IGraphOptionProvider),
|
|
90
|
+
__metadata("design:type", Object)
|
|
91
|
+
], GraphEventContribution.prototype, "graphOptions", void 0);
|
|
92
|
+
GraphEventContribution = __decorate([
|
|
93
|
+
singleton({ contrib: IHookContribution })
|
|
94
|
+
], GraphEventContribution);
|
|
95
|
+
export { GraphEventContribution };
|
|
96
|
+
//# sourceMappingURL=graph.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graph.js","sourceRoot":"","sources":["../../../src/hooks/contributions/graph.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAChD,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAA;AACpE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAA;AACzE,OAAO,EAAE,oBAAoB,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AAC1E,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAG7C,MAAM,KAAW,kBAAkB,CAElC;AAFD,WAAiB,kBAAkB;IACpB,2BAAQ,GAAG,mBAAmB,CAAA;AAC7C,CAAC,EAFgB,kBAAkB,KAAlB,kBAAkB,QAElC;AAED;;;GAGG;AAEI,IAAM,sBAAsB,GAA5B,MAAM,sBAAsB;IAA5B;QAIL,cAAS,GAAG,IAAI,oBAAoB,EAAE,CAAA;QAEtC,oBAAe,GAAG,GAAS,EAAE;YAC3B,OAAO,UAAU,CAAC,MAAM,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAA;QACpC,CAAC,CAAA,CAAA;QAED,aAAa;QACb,iBAAY,GAAG,CAAO,KAAa,EAAE,EAAE;YACrC,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAA;YAE5C,MAAM,WAAW,GAAG;gBAClB,uCAAuC;gBACvC,KAAK,CAAC,QAAQ,CAAC,YAAY,CAAC;oBAC1B,IAAI,EAAE,kBAAkB,CAAC,QAAQ;oBACjC,OAAO,EAAE,CAAM,IAAI,EAAC,EAAE;wBACpB,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,IAAI,CAAC,YAAY,CAAC,UAAU,EAAE,CAAA;wBACvD,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;4BACrB,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;wBAClB,CAAC,CAAC,CAAA;oBACJ,CAAC,CAAA;iBACF,CAAC;gBAEF,yBAAyB;gBACzB,KAAK,CAAC,cAAc,CAAC,YAAY,CAAC;oBAChC,IAAI,EAAE,kBAAkB,CAAC,QAAQ;oBACjC,OAAO,EAAE,CAAM,IAAI,EAAC,EAAE;wBACpB,MAAM,EAAE,cAAc,EAAE,YAAY,EAAE,KAAK,EAAE,GAAG,IAAI,CAAA;wBACpD,WAAW;wBACX,MAAM,IAAI,GAAG,MAAM,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,EAAE,CAAM,YAAY,EAAC,EAAE;4BAC9D,OAAO,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE;gCAC1B,MAAM,OAAO,GAAG,WAAW,CAAC,EAAE;oCAC5B,CAAC,CAAC,QAAQ,CAAC,WAAW,EAAE,cAAc,EAAE,YAAY,EAAE,KAAK,CAAC,CAAA;gCAC9D,CAAC,CAAA;gCACD,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,EAAE,OAAO,CAAC,CAAA;gCAC9B,OAAO;oCACL,OAAO,EAAE,GAAG,EAAE;wCACZ,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,EAAE,OAAO,CAAC,CAAA;oCACjC,CAAC;iCACF,CAAA;4BACH,CAAC,CAAC,CAAA;wBACJ,CAAC,CAAA,CAAC,CAAA;wBACF,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;oBACzB,CAAC,CAAA;iBACF,CAAC;gBACF,mCAAmC;gBACnC,KAAK,CAAC,cAAc,CAAC,YAAY,CAAC;oBAChC,IAAI,EAAE,uBAAuB;oBAC7B,OAAO,EAAE,CAAM,IAAI,EAAC,EAAE;wBACpB,MAAM,EAAE,cAAc,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,IAAI,CAAA;wBAC/C,MAAM,aAAa,GAAG,QAAQ,CAAC,GAAG,EAAE;4BAClC,cAAc,CAAC,cAAc,CAAC,kBAAkB,CAAC,YAAY,CAAC,EAAE,EAAE,EAAE,CAAC,CAAA;wBACvE,CAAC,CAAC,CAAA;wBAEF,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAA;wBAEhD,MAAM,EAAE,aAAa,EAAE,GAAI,OAAO,CAAC;wBACnC,MAAM,cAAc,GAAG,IAAI,cAAc,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC,CAAA;wBACxF,aAAa,IAAI,cAAc,CAAC,OAAO,CAAC,aAAa,CAAC,CAAA;wBAEtD,SAAS,CAAC,IAAI,CACZ,UAAU,CAAC,MAAM,CAAC,GAAG,EAAE;4BACrB,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAA;wBACrD,CAAC,CAAC,CACH,CAAA;oBACH,CAAC,CAAA;iBACF,CAAC;gBAEF,uBAAuB;gBACvB,KAAK,CAAC,kBAAkB,CAAC,YAAY,CAAC;oBACpC,IAAI,EAAE,kBAAkB,CAAC,QAAQ;oBACjC,OAAO,EAAE,GAAS,EAAE;wBAClB,SAAS,CAAC,OAAO,EAAE,CAAA;oBACrB,CAAC,CAAA;iBACF,CAAC;aACH,CAAA;YAED,SAAS,CAAC,OAAO,CAAC,WAAW,CAAC,CAAA;YAC9B,OAAO,SAAS,CAAA;QAClB,CAAC,CAAA,CAAA;IACH,CAAC;CAAA,CAAA;AAjFC;IAAC,MAAM,CAAC,oBAAoB,CAAC;;4DAAmC;AAFrD,sBAAsB;IADlC,SAAS,CAAC,EAAE,OAAO,EAAE,iBAAiB,EAAE,CAAC;GAC7B,sBAAsB,CAmFlC;SAnFY,sBAAsB"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { Disposable } from '../common/disposable';
|
|
2
|
+
import type { HookHub } from '@sunspirytus/xflow-hook';
|
|
3
|
+
import type { IHooks } from './interface';
|
|
4
|
+
import { Contribution } from 'mana-syringe';
|
|
5
|
+
import { IFrontendApplicationContribution } from '../xflow-main/interface';
|
|
6
|
+
import { IHookService, IHookContribution } from './interface';
|
|
7
|
+
export declare class HookRegistry<T extends IHooks> implements IFrontendApplicationContribution, IHookService<T> {
|
|
8
|
+
/** disposables */
|
|
9
|
+
private toDispose;
|
|
10
|
+
/** hooks */
|
|
11
|
+
hooks: T;
|
|
12
|
+
constructor();
|
|
13
|
+
/** hooks */
|
|
14
|
+
hookProvider: () => T;
|
|
15
|
+
/** 注册hook插件 */
|
|
16
|
+
registerHook: (fn: (hooks: T) => Disposable) => Disposable;
|
|
17
|
+
/** 注册hook */
|
|
18
|
+
registerHookHub: (hookName: string, hook: HookHub) => {
|
|
19
|
+
dispose: () => void;
|
|
20
|
+
};
|
|
21
|
+
/** hook扩展 */
|
|
22
|
+
protected readonly contributionProvider: Contribution.Provider<IHookContribution<T>>;
|
|
23
|
+
/** app启动时,收集hook扩展点的注册项 */
|
|
24
|
+
onStart: () => Promise<void>;
|
|
25
|
+
/** app的停止逻辑 */
|
|
26
|
+
onStop(): void;
|
|
27
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { __awaiter, __decorate, __metadata } from "tslib";
|
|
2
|
+
import { singleton, Contribution, contrib } from 'mana-syringe';
|
|
3
|
+
import { DisposableCollection } from '../common/disposable';
|
|
4
|
+
import { IFrontendApplicationContribution } from '../xflow-main/interface';
|
|
5
|
+
import { initHooks, IHookService, IHookContribution } from './interface';
|
|
6
|
+
let HookRegistry = class HookRegistry {
|
|
7
|
+
constructor() {
|
|
8
|
+
/** disposables */
|
|
9
|
+
this.toDispose = new DisposableCollection();
|
|
10
|
+
/** hooks */
|
|
11
|
+
this.hookProvider = () => this.hooks;
|
|
12
|
+
/** 注册hook插件 */
|
|
13
|
+
this.registerHook = (fn) => {
|
|
14
|
+
return fn(this.hooks);
|
|
15
|
+
};
|
|
16
|
+
/** 注册hook */
|
|
17
|
+
this.registerHookHub = (hookName, hook) => {
|
|
18
|
+
this.hooks[hookName] = hook;
|
|
19
|
+
return {
|
|
20
|
+
dispose: () => {
|
|
21
|
+
delete this.hooks[hookName];
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
/** app启动时,收集hook扩展点的注册项 */
|
|
26
|
+
this.onStart = () => __awaiter(this, void 0, void 0, function* () {
|
|
27
|
+
const contributions = this.contributionProvider.getContributions();
|
|
28
|
+
for (const contribution of contributions) {
|
|
29
|
+
contribution.registerHookHub(this);
|
|
30
|
+
}
|
|
31
|
+
for (const contribution of contributions) {
|
|
32
|
+
contribution.registerHook(this.hooks);
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
this.hooks = initHooks();
|
|
36
|
+
}
|
|
37
|
+
/** app的停止逻辑 */
|
|
38
|
+
onStop() {
|
|
39
|
+
this.toDispose.dispose();
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
__decorate([
|
|
43
|
+
contrib(IHookContribution),
|
|
44
|
+
__metadata("design:type", Object)
|
|
45
|
+
], HookRegistry.prototype, "contributionProvider", void 0);
|
|
46
|
+
HookRegistry = __decorate([
|
|
47
|
+
singleton({ contrib: [IFrontendApplicationContribution, IHookService] }),
|
|
48
|
+
__metadata("design:paramtypes", [])
|
|
49
|
+
], HookRegistry);
|
|
50
|
+
export { HookRegistry };
|
|
51
|
+
//# sourceMappingURL=hook-registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hook-registry.js","sourceRoot":"","sources":["../../src/hooks/hook-registry.ts"],"names":[],"mappings":";AAGA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAC/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AAC3D,OAAO,EAAE,gCAAgC,EAAE,MAAM,yBAAyB,CAAA;AAC1E,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AAGjE,IAAM,YAAY,GAAlB,MAAM,YAAY;IASvB;QANA,kBAAkB;QACV,cAAS,GAAG,IAAI,oBAAoB,EAAE,CAAA;QAS9C,YAAY;QACZ,iBAAY,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,KAAK,CAAA;QAE/B,eAAe;QACf,iBAAY,GAAG,CAAC,EAA4B,EAAE,EAAE;YAC9C,OAAO,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;QACvB,CAAC,CAAA;QAED,cAAc;QACd,oBAAe,GAAG,CAAC,QAAgB,EAAE,IAAa,EAAE,EAAE;YACpD,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAA;YAC3B,OAAO;gBACL,OAAO,EAAE,GAAG,EAAE;oBACZ,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAA;gBAC7B,CAAC;aACF,CAAA;QACH,CAAC,CAAA;QAMD,2BAA2B;QAC3B,YAAO,GAAG,GAAS,EAAE;YACnB,MAAM,aAAa,GAAG,IAAI,CAAC,oBAAoB,CAAC,gBAAgB,EAAE,CAAA;YAClE,KAAK,MAAM,YAAY,IAAI,aAAa,EAAE;gBACxC,YAAY,CAAC,eAAe,CAAC,IAAI,CAAC,CAAA;aACnC;YACD,KAAK,MAAM,YAAY,IAAI,aAAa,EAAE;gBACxC,YAAY,CAAC,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;aACtC;QACH,CAAC,CAAA,CAAA;QAlCC,IAAI,CAAC,KAAK,GAAG,SAAS,EAAO,CAAA;IAC/B,CAAC;IAmCD,eAAe;IACf,MAAM;QACJ,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,CAAA;IAC1B,CAAC;CACF,CAAA;AAlBC;IAAC,OAAO,CAAC,iBAAiB,CAAC;;0DACyD;AAjCzE,YAAY;IADxB,SAAS,CAAC,EAAE,OAAO,EAAE,CAAC,gCAAgC,EAAE,YAAY,CAAC,EAAE,CAAC;;GAC5D,YAAY,CAkDxB;SAlDY,YAAY"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { IHookService, IRegisterHookFn, IRegisterHookHubFn, IHookContribution, IEvent, IHooks } from './interface';
|
|
2
|
+
import { createHookConfig, HookRegistry } from './components';
|
|
3
|
+
import { HookConfig } from './config';
|
|
4
|
+
export { HookConfig, HookRegistry, IHookService, IRegisterHookFn, IRegisterHookHubFn, IHookContribution, IEvent, IHooks, createHookConfig, };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IHookService, IHookContribution, } from './interface';
|
|
2
|
+
import { createHookConfig, HookRegistry } from './components';
|
|
3
|
+
import { HookConfig } from './config';
|
|
4
|
+
export { HookConfig, HookRegistry,
|
|
5
|
+
// 扩展Hooks
|
|
6
|
+
IHookService, IHookContribution,
|
|
7
|
+
// React config hook
|
|
8
|
+
createHookConfig, };
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAGZ,iBAAiB,GAGlB,MAAM,aAAa,CAAA;AAEpB,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAErC,OAAO,EACL,UAAU,EACV,YAAY;AACZ,UAAU;AACV,YAAY,EAGZ,iBAAiB;AAKjB,oBAAoB;AACpB,gBAAgB,GACjB,CAAA"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import type { Graph } from '@antv/x6';
|
|
2
|
+
import type { NsGraph } from '../interface';
|
|
3
|
+
import type { Disposable } from '../common/disposable';
|
|
4
|
+
import type { IGraphCommandService } from '../command/interface';
|
|
5
|
+
import type { IModelService } from '../model-service/interface';
|
|
6
|
+
import { HookHub } from '@sunspirytus/xflow-hook';
|
|
7
|
+
import { Syringe } from 'mana-syringe';
|
|
8
|
+
import type { EventArgs } from '@antv/x6/es/graph/events';
|
|
9
|
+
import type { IGraphConfig } from '../xflow-main/graph/config';
|
|
10
|
+
export interface IRegisterHookFn<T = IHooks> {
|
|
11
|
+
(hooks: T): Disposable;
|
|
12
|
+
}
|
|
13
|
+
export interface IRegisterHookHubFn<T = IHooks> {
|
|
14
|
+
(registry: IHookService<T>): Disposable;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* extension 应该实现这个扩展点来注册更多的hook
|
|
18
|
+
*/
|
|
19
|
+
export declare const IHookService: Syringe.DefinedToken;
|
|
20
|
+
export interface IHookService<T = IHooks> {
|
|
21
|
+
registerHookHub: (hookName: string, hook: HookHub) => Disposable;
|
|
22
|
+
registerHook: (registerHookFunc: IRegisterHookFn<T>) => Disposable;
|
|
23
|
+
hookProvider: () => T;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* extension 应该实现这个扩展点来注册更多的hook
|
|
27
|
+
*/
|
|
28
|
+
export declare const IHookContribution: Syringe.DefinedToken;
|
|
29
|
+
/**
|
|
30
|
+
* 扩展hook
|
|
31
|
+
*/
|
|
32
|
+
export interface IHookContribution<T extends IHooks> {
|
|
33
|
+
/**
|
|
34
|
+
* 注册hook
|
|
35
|
+
* @param registry the HookRegistry.
|
|
36
|
+
*/
|
|
37
|
+
registerHook: (hooks: T) => Promise<Disposable>;
|
|
38
|
+
/**
|
|
39
|
+
* 注册hookhub
|
|
40
|
+
* @param registry the HookRegistry.
|
|
41
|
+
*/
|
|
42
|
+
registerHookHub: (registry: IHookService<T>) => Promise<Disposable>;
|
|
43
|
+
}
|
|
44
|
+
/** 内置的Hooks */
|
|
45
|
+
export type IEvent<Key extends keyof EventArgs> = NsGraph.IEvent<Key>;
|
|
46
|
+
export type IEventCollection = NsGraph.IEvent[];
|
|
47
|
+
export type IEventSubscription = Disposable[];
|
|
48
|
+
export interface IGeneralAppService {
|
|
49
|
+
graph: Graph;
|
|
50
|
+
commandService: IGraphCommandService;
|
|
51
|
+
modelService: IModelService;
|
|
52
|
+
options: IGraphConfig;
|
|
53
|
+
}
|
|
54
|
+
export declare const initHooks: () => {
|
|
55
|
+
graphOptions: HookHub<Graph.Options, Graph.Options>;
|
|
56
|
+
reactNodeRender: HookHub<Map<string, React.ComponentType<NsGraph.IReactNodeProps<T>>>, Map<string, React.ComponentType<NsGraph.IReactNodeProps<T>>>>;
|
|
57
|
+
reactEdgeLabelRender: HookHub<Map<string, React.ComponentType<NsGraph.IReactEdgeProps<T_1>>>, Map<string, React.ComponentType<NsGraph.IReactEdgeProps<T_1>>>>;
|
|
58
|
+
afterGraphInit: HookHub<IGeneralAppService, IGeneralAppService>;
|
|
59
|
+
beforeGraphDestroy: HookHub<IGeneralAppService, IGeneralAppService>;
|
|
60
|
+
x6Events: HookHub<IEventCollection, IEventSubscription>;
|
|
61
|
+
};
|
|
62
|
+
export type IHooks = ReturnType<typeof initHooks>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { HookHub } from '@sunspirytus/xflow-hook';
|
|
2
|
+
import { Syringe } from 'mana-syringe';
|
|
3
|
+
/**
|
|
4
|
+
* extension 应该实现这个扩展点来注册更多的hook
|
|
5
|
+
*/
|
|
6
|
+
export const IHookService = Syringe.defineToken('IHookService');
|
|
7
|
+
/**
|
|
8
|
+
* extension 应该实现这个扩展点来注册更多的hook
|
|
9
|
+
*/
|
|
10
|
+
export const IHookContribution = Syringe.defineToken('IHookContribution');
|
|
11
|
+
export const initHooks = () => ({
|
|
12
|
+
graphOptions: new HookHub(),
|
|
13
|
+
reactNodeRender: new HookHub(),
|
|
14
|
+
reactEdgeLabelRender: new HookHub(),
|
|
15
|
+
afterGraphInit: new HookHub(),
|
|
16
|
+
beforeGraphDestroy: new HookHub(),
|
|
17
|
+
x6Events: new HookHub(),
|
|
18
|
+
});
|
|
19
|
+
//# sourceMappingURL=interface.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interface.js","sourceRoot":"","sources":["../../src/hooks/interface.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAWtC;;GAEG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,OAAO,CAAC,WAAW,CAAC,cAAc,CAAC,CAAA;AAO/D;;GAEG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,OAAO,CAAC,WAAW,CAAC,mBAAmB,CAAC,CAAA;AA6BzE,MAAM,CAAC,MAAM,SAAS,GAAG,GAAG,EAAE,CAAC,CAAC;IAC9B,YAAY,EAAE,IAAI,OAAO,EAAiB;IAC1C,eAAe,EAAE,IAAI,OAAO,EAAoC;IAChE,oBAAoB,EAAE,IAAI,OAAO,EAAoC;IACrE,cAAc,EAAE,IAAI,OAAO,EAAsB;IACjD,kBAAkB,EAAE,IAAI,OAAO,EAAsB;IACrD,QAAQ,EAAE,IAAI,OAAO,EAAwC;CAC9D,CAAC,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import 'reflect-metadata';
|
|
2
|
+
/** Application 扩展依赖 */
|
|
3
|
+
import { HookConfig } from './config';
|
|
4
|
+
import { HookRegistry } from './hook-registry';
|
|
5
|
+
import { IHookContribution } from './interface';
|
|
6
|
+
/** 依赖扩展模块,必须要加载 */
|
|
7
|
+
declare const createModule: (config: HookConfig) => import("mana-syringe").SyringeModule;
|
|
8
|
+
export { HookRegistry, createModule, IHookContribution, HookConfig as XFlowHookConfig };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import 'reflect-metadata';
|
|
2
|
+
/** Application 扩展依赖 */
|
|
3
|
+
import { HookConfig } from './config';
|
|
4
|
+
import { HookRegistry } from './hook-registry';
|
|
5
|
+
import { Contribution, Module } from 'mana-syringe';
|
|
6
|
+
import { RuntimeContribution } from './contributions/default';
|
|
7
|
+
import { GraphEventContribution } from './contributions/graph';
|
|
8
|
+
import { IHookContribution } from './interface';
|
|
9
|
+
/** 依赖扩展模块,必须要加载 */
|
|
10
|
+
const createModule = (config) => {
|
|
11
|
+
return Module(register => {
|
|
12
|
+
/** 注册 IGraphHookContribution 成为一个新扩展点 */
|
|
13
|
+
Contribution.register(register, IHookContribution);
|
|
14
|
+
/** 扩展 runtime hook */
|
|
15
|
+
register(RuntimeContribution);
|
|
16
|
+
/** 扩展 graph event hook */
|
|
17
|
+
register(GraphEventContribution);
|
|
18
|
+
/** 注册 HookRegistry 到 IFrontendApplicationContribution */
|
|
19
|
+
/** 注册 HookRegistry */
|
|
20
|
+
register(HookRegistry);
|
|
21
|
+
/** 注册 XFlowHookConfig */
|
|
22
|
+
register(HookConfig, { useValue: config });
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
export { HookRegistry, createModule, IHookContribution, HookConfig as XFlowHookConfig };
|
|
26
|
+
//# sourceMappingURL=module.js.map
|