@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,52 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { RxModel, NsModel } from '../common/rx-model';
|
|
3
|
+
/** 判断model是否Mount */
|
|
4
|
+
const isRefMounted = (ref) => {
|
|
5
|
+
return ref && ref.current;
|
|
6
|
+
};
|
|
7
|
+
/** 用于判断model是否Mount */
|
|
8
|
+
const useIsMoutedRef = () => {
|
|
9
|
+
/** 记录当前组件的加载状态 */
|
|
10
|
+
const ref = React.useRef(true);
|
|
11
|
+
React.useEffect(() => {
|
|
12
|
+
return () => {
|
|
13
|
+
ref.current = false;
|
|
14
|
+
};
|
|
15
|
+
}, []);
|
|
16
|
+
return ref;
|
|
17
|
+
};
|
|
18
|
+
/** 将model和react绑定 */
|
|
19
|
+
export const useModel = (model) => {
|
|
20
|
+
/** 记录当前组件的加载状态 */
|
|
21
|
+
const ref = useIsMoutedRef();
|
|
22
|
+
const [state, setState] = React.useState(model.getValue());
|
|
23
|
+
React.useEffect(() => {
|
|
24
|
+
const disposeable = model.watch(val => {
|
|
25
|
+
if (isRefMounted(ref)) {
|
|
26
|
+
setState(val);
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
return () => {
|
|
30
|
+
disposeable.dispose();
|
|
31
|
+
};
|
|
32
|
+
/* eslint-disable-next-line */
|
|
33
|
+
}, [model]);
|
|
34
|
+
const value = state;
|
|
35
|
+
const canRender = NsModel.isValidValue(value);
|
|
36
|
+
const setValue = React.useCallback(val => model.setValue(val), [model]);
|
|
37
|
+
return [value, setValue, canRender];
|
|
38
|
+
};
|
|
39
|
+
/** 在组件内新建一个model */
|
|
40
|
+
export const useComponentCtx = (initialState) => {
|
|
41
|
+
const model = React.useMemo(() => new RxModel(initialState), [initialState]);
|
|
42
|
+
/** model 和 state 绑定触发view刷新 */
|
|
43
|
+
const [modelValue, setModelValue, canRender] = useModel(model);
|
|
44
|
+
/** unMount时dispose */
|
|
45
|
+
React.useEffect(() => {
|
|
46
|
+
return () => {
|
|
47
|
+
model.dispose();
|
|
48
|
+
};
|
|
49
|
+
}, [model]);
|
|
50
|
+
return [modelValue, setModelValue, model, canRender];
|
|
51
|
+
};
|
|
52
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/model-service/utils.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAA;AAErD,qBAAqB;AACrB,MAAM,YAAY,GAAG,CAAC,GAA6B,EAAE,EAAE;IACrD,OAAO,GAAG,IAAI,GAAG,CAAC,OAAO,CAAA;AAC3B,CAAC,CAAA;AAED,uBAAuB;AACvB,MAAM,cAAc,GAAG,GAAG,EAAE;IAC1B,kBAAkB;IAClB,MAAM,GAAG,GAAG,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;IAC9B,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,OAAO,GAAG,EAAE;YACV,GAAG,CAAC,OAAO,GAAG,KAAK,CAAA;QACrB,CAAC,CAAA;IACH,CAAC,EAAE,EAAE,CAAC,CAAA;IACN,OAAO,GAAG,CAAA;AACZ,CAAC,CAAA;AAED,qBAAqB;AACrB,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAK,KAAiB,EAAE,EAAE;IAChD,kBAAkB;IAClB,MAAM,GAAG,GAAG,cAAc,EAAE,CAAA;IAC5B,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAA;IAC1D,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,MAAM,WAAW,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE;YACpC,IAAI,YAAY,CAAC,GAAG,CAAC,EAAE;gBACrB,QAAQ,CAAC,GAAG,CAAC,CAAA;aACd;QACH,CAAC,CAAC,CAAA;QACF,OAAO,GAAG,EAAE;YACV,WAAW,CAAC,OAAO,EAAE,CAAA;QACvB,CAAC,CAAA;QACD,+BAA+B;IACjC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAA;IACX,MAAM,KAAK,GAAG,KAAK,CAAA;IACnB,MAAM,SAAS,GAAG,OAAO,CAAC,YAAY,CAAC,KAAK,CAAC,CAAA;IAC7C,MAAM,QAAQ,GAAG,KAAK,CAAC,WAAW,CAAuB,GAAG,CAAC,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAA;IAC7F,OAAO,CAAC,KAAK,EAAE,QAAQ,EAAE,SAAS,CAAuC,CAAA;AAC3E,CAAC,CAAA;AACD,oBAAoB;AACpB,MAAM,CAAC,MAAM,eAAe,GAAG,CAAK,YAAe,EAAE,EAAE;IACrD,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,IAAI,OAAO,CAAC,YAAY,CAAC,EAAE,CAAC,YAAY,CAAC,CAAC,CAAA;IAC5E,+BAA+B;IAC/B,MAAM,CAAC,UAAU,EAAE,aAAa,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAA;IAC9D,sBAAsB;IACtB,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,OAAO,GAAG,EAAE;YACV,KAAK,CAAC,OAAO,EAAE,CAAA;QACjB,CAAC,CAAA;IACH,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAA;IACX,OAAO,CAAC,UAAU,EAAE,aAAa,EAAE,KAAK,EAAE,SAAS,CAKlD,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
.xflow-default-node {
|
|
2
|
+
z-index: 10;
|
|
3
|
+
display: flex;
|
|
4
|
+
width: 180px;
|
|
5
|
+
height: 36px;
|
|
6
|
+
line-height: 36px;
|
|
7
|
+
text-align: center;
|
|
8
|
+
background-color: #fff;
|
|
9
|
+
border: 1px solid #c1cdf7;
|
|
10
|
+
border-radius: 2px;
|
|
11
|
+
box-shadow: -1px -1px 4px 0 rgba(223,223,223,0.50), -2px 2px 4px 0 rgba(244,244,244,0.50), 2px 3px 8px 2px rgba(151,151,151,0.05);
|
|
12
|
+
transition: all ease-in-out 0.15s;
|
|
13
|
+
}
|
|
14
|
+
.xflow-default-node:hover {
|
|
15
|
+
background-color: #fff;
|
|
16
|
+
border: 1px solid #3057e3;
|
|
17
|
+
box-shadow: 0 0 3px 3px rgba(48, 86, 227, 0.15);
|
|
18
|
+
cursor: move;
|
|
19
|
+
}
|
|
20
|
+
.xflow-default-node .icon {
|
|
21
|
+
width: 36px;
|
|
22
|
+
}
|
|
23
|
+
.xflow-default-node .label {
|
|
24
|
+
width: 108px;
|
|
25
|
+
overflow: hidden;
|
|
26
|
+
text-overflow: ellipsis;
|
|
27
|
+
}
|
|
28
|
+
.xflow-default-node .status {
|
|
29
|
+
width: 36px;
|
|
30
|
+
}
|
|
31
|
+
.xflow-default-node.panel-node {
|
|
32
|
+
border: 0;
|
|
33
|
+
}
|
|
34
|
+
.x6-node-selected .xflow-default-node {
|
|
35
|
+
background-color: rgba(48, 86, 227, 0.05);
|
|
36
|
+
border: 1px solid #3057e3;
|
|
37
|
+
box-shadow: 0 0 3px 3px rgba(48, 86, 227, 0.15);
|
|
38
|
+
}
|
|
39
|
+
.x6-node-selected .xflow-default-node:hover {
|
|
40
|
+
background-color: #fff;
|
|
41
|
+
box-shadow: 0 0 5px 5px rgba(48, 86, 227, 0.15);
|
|
42
|
+
}
|
|
43
|
+
.xflow-default-group-node {
|
|
44
|
+
z-index: 9;
|
|
45
|
+
width: 100%;
|
|
46
|
+
height: 100%;
|
|
47
|
+
background-color: rgba(255, 255, 255, 0.65);
|
|
48
|
+
border: 1px solid rgba(255, 255, 255, 0.25);
|
|
49
|
+
border-radius: 4px;
|
|
50
|
+
box-shadow: rgb(17 49 96 / 12%) 0px 1px 3px 0px, rgb(17 49 96 / 4%) 0px 0px 0px 1px;
|
|
51
|
+
cursor: grab;
|
|
52
|
+
}
|
|
53
|
+
.xflow-default-group-node:hover {
|
|
54
|
+
background-color: rgba(227, 244, 255, 0.45);
|
|
55
|
+
border: 1px solid #c1cdf7;
|
|
56
|
+
box-shadow: 0 0 3px 3px rgba(64, 169, 255, 0.2);
|
|
57
|
+
cursor: move;
|
|
58
|
+
}
|
|
59
|
+
.xflow-default-group-node .xflow-group-header {
|
|
60
|
+
display: flex;
|
|
61
|
+
justify-content: space-between;
|
|
62
|
+
padding: 0 12px;
|
|
63
|
+
font-size: 14px;
|
|
64
|
+
line-height: 38px;
|
|
65
|
+
}
|
|
66
|
+
.xflow-default-group-node .xflow-group-header .header-left {
|
|
67
|
+
width: 80%;
|
|
68
|
+
overflow: hidden;
|
|
69
|
+
white-space: nowrap;
|
|
70
|
+
text-overflow: ellipsis;
|
|
71
|
+
}
|
|
72
|
+
.xflow-default-group-node .xflow-group-header .header-right {
|
|
73
|
+
display: inline-flex;
|
|
74
|
+
align-items: center;
|
|
75
|
+
}
|
|
76
|
+
.xflow-default-group-node .xflow-group-header .header-right span.anticon {
|
|
77
|
+
margin-left: 8px;
|
|
78
|
+
}
|
|
79
|
+
.x6-node-selected .xflow-default-group-node {
|
|
80
|
+
background-color: rgba(243, 249, 255, 0.92);
|
|
81
|
+
border: 1px solid #c1cdf7;
|
|
82
|
+
box-shadow: 0 0 3px 3px rgba(64, 169, 255, 0.2);
|
|
83
|
+
}
|
|
84
|
+
.x6-node-selected .xflow-default-group-node:hover {
|
|
85
|
+
background-color: rgba(243, 249, 255, 0.6);
|
|
86
|
+
}
|
|
87
|
+
.xflow-canvas-root {
|
|
88
|
+
position: absolute;
|
|
89
|
+
top: 0;
|
|
90
|
+
right: 0;
|
|
91
|
+
bottom: 0;
|
|
92
|
+
left: 0;
|
|
93
|
+
}
|
|
94
|
+
.xflow-x6-canvas {
|
|
95
|
+
width: 100%;
|
|
96
|
+
height: 100%;
|
|
97
|
+
}
|
|
98
|
+
.xflow-app-workspace {
|
|
99
|
+
position: relative;
|
|
100
|
+
width: 100%;
|
|
101
|
+
height: 100%;
|
|
102
|
+
}
|
|
103
|
+
.xflow-hide {
|
|
104
|
+
display: none;
|
|
105
|
+
}
|
|
106
|
+
.x6-widget-dnd.dragging {
|
|
107
|
+
cursor: grabbing !important;
|
|
108
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import "../xflow-main/style/index.less";
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import './themes/index';
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import './default.less';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { __awaiter } from "tslib";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { createModule } from '../module';
|
|
4
|
+
import { useExtensionRegistry } from '../../xflow-main/components/extension-context';
|
|
5
|
+
export const ToolbarRegistry = props => {
|
|
6
|
+
const {} = props;
|
|
7
|
+
/** 获取配置中心 */
|
|
8
|
+
const extensionRegistry = useExtensionRegistry();
|
|
9
|
+
React.useEffect(() => {
|
|
10
|
+
const disposable = extensionRegistry.addCoreModule({
|
|
11
|
+
config: { CONFIG_TYPE: 'ToolbarRegistry', getConfig: () => __awaiter(void 0, void 0, void 0, function* () { }) },
|
|
12
|
+
createModule,
|
|
13
|
+
});
|
|
14
|
+
return () => {
|
|
15
|
+
disposable.dispose();
|
|
16
|
+
};
|
|
17
|
+
}, [extensionRegistry]);
|
|
18
|
+
return null;
|
|
19
|
+
};
|
|
20
|
+
ToolbarRegistry.defaultProps = { XFlowModuleType: 'ToolbarRegistry' };
|
|
21
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/toolbar/components/index.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AACxC,OAAO,EAAE,oBAAoB,EAAE,MAAM,+CAA+C,CAAA;AAIpF,MAAM,CAAC,MAAM,eAAe,GAAqB,KAAK,CAAC,EAAE;IACvD,MAAM,EAAE,GAAG,KAAK,CAAA;IAChB,aAAa;IACb,MAAM,iBAAiB,GAAG,oBAAoB,EAAE,CAAA;IAEhD,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,MAAM,UAAU,GAAG,iBAAiB,CAAC,aAAa,CAAC;YACjD,MAAM,EAAE,EAAE,WAAW,EAAE,iBAAiB,EAAE,SAAS,EAAE,GAAS,EAAE,kDAAE,CAAC,CAAA,EAAE;YACrE,YAAY;SACb,CAAC,CAAA;QACF,OAAO,GAAG,EAAE;YACV,UAAU,CAAC,OAAO,EAAE,CAAA;QACtB,CAAC,CAAA;IACH,CAAC,EAAE,CAAC,iBAAiB,CAAC,CAAC,CAAA;IAEvB,OAAO,IAAI,CAAA;AACb,CAAC,CAAA;AAED,eAAe,CAAC,YAAY,GAAG,EAAE,eAAe,EAAE,iBAAiB,EAAE,CAAA"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { IToolbarService, IToolbarModel, IToolbarLayout, IToolbarContribution, IRegisterToolbarItemFunction, IToolbarOptions, IToolbarItemOptions, IToolbarGroupOptions } from './interface';
|
|
2
|
+
import { ToolbarRegistry } from './components';
|
|
3
|
+
export { ToolbarRegistry, IToolbarService, IToolbarContribution, IToolbarModel, IToolbarLayout, IToolbarOptions, IToolbarItemOptions, IToolbarGroupOptions, IRegisterToolbarItemFunction, };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/toolbar/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EAGf,oBAAoB,GAMrB,MAAM,aAAa,CAAA;AACpB,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAE9C,OAAO;AACL,YAAY;AACZ,eAAe;AACf,SAAS;AACT,eAAe,EACf,oBAAoB,GAUrB,CAAA"}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import { Syringe } from 'mana-syringe';
|
|
3
|
+
/** 工具类型 */
|
|
4
|
+
import type { Disposable } from '../common/disposable';
|
|
5
|
+
import type { NsModel } from '../common/rx-model';
|
|
6
|
+
/** context 类型 */
|
|
7
|
+
import type { IModelService, IUseModel } from '../model-service';
|
|
8
|
+
/** command 类型 */
|
|
9
|
+
import type { IGraphCommandService } from '../command/interface';
|
|
10
|
+
/** 组件类型定义 */
|
|
11
|
+
import type { Toolbar as X6Toolbar } from '@antv/x6-react-components/es/toolbar/toolbar';
|
|
12
|
+
import type { ToolbarGroup as X6ToolbarGroup } from '@antv/x6-react-components/es/toolbar/group';
|
|
13
|
+
import type { ToolbarItem as X6ToolbarItem } from '@antv/x6-react-components/es/toolbar/item';
|
|
14
|
+
import type { Simplify } from '../common/types';
|
|
15
|
+
import type { ReactElement } from 'react';
|
|
16
|
+
/** 用于了批量注册 可销毁的 Toolbar Item*/
|
|
17
|
+
export interface IStandaloneToolbarService {
|
|
18
|
+
/** 注册Toolbar Item */
|
|
19
|
+
registerToolbarItem: (config: IToolbarItemOptions) => Disposable;
|
|
20
|
+
}
|
|
21
|
+
/** 用于临时注册 toolbar*/
|
|
22
|
+
export interface IRegisterToolbarItemFunction {
|
|
23
|
+
(registry: IStandaloneToolbarService): void;
|
|
24
|
+
}
|
|
25
|
+
/** IToolbarService: 用于注册/消费item */
|
|
26
|
+
export declare const IToolbarService: unique symbol;
|
|
27
|
+
/** IToolbarService: 用于注册/消费item */
|
|
28
|
+
export interface IToolbarService {
|
|
29
|
+
/** 注册item */
|
|
30
|
+
registerItem: (config: IToolbarItemOptions) => Disposable;
|
|
31
|
+
/** 注册可注销的item */
|
|
32
|
+
registerDisposableToolbar?: (externalRegisterFn: IRegisterToolbarItemFunction) => Disposable;
|
|
33
|
+
/** 获取toolbar渲染需要 的 model */
|
|
34
|
+
getToolbarModel: (toolbarConfig: IToolbarOptions) => IToolbarModel;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Clients should implement this interface if they want to contribute to the tab-bar toolbar.
|
|
38
|
+
*/
|
|
39
|
+
export declare const IToolbarContribution: Syringe.DefinedToken;
|
|
40
|
+
/**
|
|
41
|
+
* Representation of a toolbar contribution.
|
|
42
|
+
*/
|
|
43
|
+
export interface IToolbarContribution {
|
|
44
|
+
/**
|
|
45
|
+
* Registers toolbar items.
|
|
46
|
+
* @param registry the tabbar toolbar registry.
|
|
47
|
+
*/
|
|
48
|
+
registerToolbarItems: (registry: IToolbarService) => void;
|
|
49
|
+
}
|
|
50
|
+
export interface ICustomRenderProps extends Omit<IToolbarItemOptions, 'onClick'> {
|
|
51
|
+
/** call IToolbarItemOptions.onClick with args */
|
|
52
|
+
onClick: () => void;
|
|
53
|
+
}
|
|
54
|
+
/** 描述toolbar的一个按钮 */
|
|
55
|
+
export interface IToolbarItemOptions extends Omit<X6ToolbarItem.Props, 'onClick' | 'hidden' | 'disabled'> {
|
|
56
|
+
/** The unique ID of the toolbar item. */
|
|
57
|
+
id: string;
|
|
58
|
+
/** 是否可见 */
|
|
59
|
+
isVisible?: boolean;
|
|
60
|
+
/** 是否可用 */
|
|
61
|
+
isEnabled?: boolean;
|
|
62
|
+
/** Optional text of the item. */
|
|
63
|
+
text?: string;
|
|
64
|
+
/** Optional tooltip for the item. */
|
|
65
|
+
tooltip?: string;
|
|
66
|
+
/** React element to be used as an icon for the menu item; optional */
|
|
67
|
+
icon?: ReactElement;
|
|
68
|
+
/** Optional icon for the item. */
|
|
69
|
+
iconName?: string;
|
|
70
|
+
/** runtime 处理context */
|
|
71
|
+
useModel?: IUseModel<IToolbarItemOptions>;
|
|
72
|
+
/** 自定义渲染 */
|
|
73
|
+
render?: React.FC<ICustomRenderProps>;
|
|
74
|
+
/** Optional icon for the item. */
|
|
75
|
+
onClick?: (args: IClickArgs) => void;
|
|
76
|
+
}
|
|
77
|
+
export interface IClickArgs {
|
|
78
|
+
toolbarItem: IToolbarItemOptions;
|
|
79
|
+
commandService: IGraphCommandService;
|
|
80
|
+
modelService: IModelService;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Toolbar的布局方向
|
|
84
|
+
* horizontal:水平
|
|
85
|
+
* vertical:竖直
|
|
86
|
+
*/
|
|
87
|
+
export type IToolbarLayout = 'horizontal' | 'vertical' | 'vertical' | 'horizontal-center';
|
|
88
|
+
/**
|
|
89
|
+
* ToolbarGroup的json配置
|
|
90
|
+
* items是id string的集合
|
|
91
|
+
*/
|
|
92
|
+
export interface IToolbarGroupOptions extends X6ToolbarGroup.Props {
|
|
93
|
+
name?: string;
|
|
94
|
+
items: IToolbarItemOptions[];
|
|
95
|
+
}
|
|
96
|
+
/** Toolbar的json配置 */
|
|
97
|
+
export interface IToolbarOptions extends X6Toolbar.Props {
|
|
98
|
+
name?: string;
|
|
99
|
+
layout: IToolbarLayout;
|
|
100
|
+
mainGroups: IToolbarGroupOptions[];
|
|
101
|
+
extraGroups: IToolbarGroupOptions[];
|
|
102
|
+
}
|
|
103
|
+
/** ToolbarItem的 Model: 渲染时生成 */
|
|
104
|
+
export type IToolbarModel = Simplify<NsModel.IModel<IToolbarOptions>>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Syringe } from 'mana-syringe';
|
|
2
|
+
/** IToolbarService: 用于注册/消费item */
|
|
3
|
+
export const IToolbarService = Symbol('IToolbarService');
|
|
4
|
+
/**
|
|
5
|
+
* Clients should implement this interface if they want to contribute to the tab-bar toolbar.
|
|
6
|
+
*/
|
|
7
|
+
export const IToolbarContribution = Syringe.defineToken('IToolbarContribution');
|
|
8
|
+
//# sourceMappingURL=interface.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interface.js","sourceRoot":"","sources":["../../src/toolbar/interface.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAwBtC,mCAAmC;AACnC,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC,iBAAiB,CAAC,CAAA;AAYxD;;GAEG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,OAAO,CAAC,WAAW,CAAC,sBAAsB,CAAC,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import 'reflect-metadata';
|
|
2
|
+
/** Application 扩展依赖 */
|
|
3
|
+
/** Toolbar扩展点依赖 */
|
|
4
|
+
import { ToolbarRegistry } from './toolbar-registry';
|
|
5
|
+
import { IToolbarContribution } from './interface';
|
|
6
|
+
export { IToolbarContribution, ToolbarRegistry };
|
|
7
|
+
/** 依赖扩展模块,必须要加载 */
|
|
8
|
+
export declare const createModule: () => import("mana-syringe").SyringeModule;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import 'reflect-metadata';
|
|
2
|
+
/** Application 扩展依赖 */
|
|
3
|
+
/** Toolbar扩展点依赖 */
|
|
4
|
+
import { ToolbarRegistry } from './toolbar-registry';
|
|
5
|
+
import { Contribution, Module } from 'mana-syringe';
|
|
6
|
+
import { IToolbarContribution } from './interface';
|
|
7
|
+
export { IToolbarContribution, ToolbarRegistry };
|
|
8
|
+
/** 依赖扩展模块,必须要加载 */
|
|
9
|
+
export const createModule = () => {
|
|
10
|
+
return Module(register => {
|
|
11
|
+
/** 注册 IToolbarContribution扩展点 */
|
|
12
|
+
Contribution.register(register, IToolbarContribution);
|
|
13
|
+
/** 注册 ToolbarRegistry 到 IFrontendApplicationContribution */
|
|
14
|
+
/** 注册 ToolbarRegistry */
|
|
15
|
+
register(ToolbarRegistry);
|
|
16
|
+
});
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module.js","sourceRoot":"","sources":["../../src/toolbar/module.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAA;AACzB,uBAAuB;AACvB,mBAAmB;AACnB,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAClD,OAAO,EAAE,oBAAoB,EAAE,eAAe,EAAE,CAAA;AAEhD,mBAAmB;AACnB,MAAM,CAAC,MAAM,YAAY,GAAG,GAAG,EAAE;IAC/B,OAAO,MAAM,CAAC,QAAQ,CAAC,EAAE;QACvB,iCAAiC;QACjC,YAAY,CAAC,QAAQ,CAAC,QAAQ,EAAE,oBAAoB,CAAC,CAAA;QAErD,4DAA4D;QAC5D,yBAAyB;QACzB,QAAQ,CAAC,eAAe,CAAC,CAAA;IAC3B,CAAC,CAAC,CAAA;AACJ,CAAC,CAAA"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import 'reflect-metadata';
|
|
2
|
+
import { Contribution } from 'mana-syringe';
|
|
3
|
+
import { DisposableCollection } from '../common/disposable';
|
|
4
|
+
import { IFrontendApplicationContribution } from '../xflow-main/interface';
|
|
5
|
+
import type { NsModel } from '../common/rx-model';
|
|
6
|
+
import { RxModel } from '../common/rx-model';
|
|
7
|
+
import { IGraphCommandService } from '../command';
|
|
8
|
+
import { IModelService } from '../model-service';
|
|
9
|
+
import type { IToolbarItemOptions, IToolbarOptions, IToolbarGroupOptions, IRegisterToolbarItemFunction } from './interface';
|
|
10
|
+
import { IToolbarContribution } from './interface';
|
|
11
|
+
/**
|
|
12
|
+
* Main, shared registry for toolbar items.
|
|
13
|
+
*/
|
|
14
|
+
export declare class ToolbarRegistry implements IFrontendApplicationContribution {
|
|
15
|
+
/** disposables */
|
|
16
|
+
protected readonly toDispose: DisposableCollection;
|
|
17
|
+
/** 储存所有toolbar items */
|
|
18
|
+
protected toolbarItems: Map<string, IToolbarItemOptions>;
|
|
19
|
+
/** CommandRegistry */
|
|
20
|
+
protected readonly commandService: IGraphCommandService;
|
|
21
|
+
/** IModelService */
|
|
22
|
+
protected readonly modelService: IModelService;
|
|
23
|
+
/** ToolbarItems的扩展 */
|
|
24
|
+
protected readonly contributionProvider: Contribution.Provider<IToolbarContribution>;
|
|
25
|
+
/** 注册ToolbarRegistry的onChange的事件 */
|
|
26
|
+
protected readonly onDidChangeEvent: RxModel<null>;
|
|
27
|
+
/** 通过ToolbarRegistry.onDidChange监听ToolbarRegistry items的变化 */
|
|
28
|
+
readonly onDidChange: NsModel.IWatch<void>;
|
|
29
|
+
/** debounce in order to avoid to fire more than once in the same tick */
|
|
30
|
+
protected fireOnDidChange: any;
|
|
31
|
+
/** App启动时,收集Toolbar扩展点的注册项 */
|
|
32
|
+
onStart(): void;
|
|
33
|
+
/**
|
|
34
|
+
* App 销毁时调用
|
|
35
|
+
* dispose toolbarProvider
|
|
36
|
+
*/
|
|
37
|
+
onStop(): void;
|
|
38
|
+
/**
|
|
39
|
+
* 注册ToolbarItem
|
|
40
|
+
* item所需的command需要提前在command registry注册
|
|
41
|
+
* @param config IToolbarItem
|
|
42
|
+
*/
|
|
43
|
+
registerItem(config: IToolbarItemOptions): DisposableCollection;
|
|
44
|
+
/**
|
|
45
|
+
* 批量注册可单独dispose的扩展项目
|
|
46
|
+
* @param externalRegisterFn IRegisterMenuFunction
|
|
47
|
+
*/
|
|
48
|
+
registerDisposableToolbar: (externalRegisterFn: IRegisterToolbarItemFunction) => DisposableCollection;
|
|
49
|
+
/**
|
|
50
|
+
* 获取 ToolbarModel
|
|
51
|
+
* @param toolbarConfig IToolbarOptions
|
|
52
|
+
*/
|
|
53
|
+
getToolbarModel: (toolbarConfig: IToolbarOptions) => RxModel<{
|
|
54
|
+
layout: import("./interface").IToolbarLayout;
|
|
55
|
+
mainGroups: {
|
|
56
|
+
items: IToolbarItemOptions[];
|
|
57
|
+
name?: string;
|
|
58
|
+
className?: string;
|
|
59
|
+
}[];
|
|
60
|
+
extraGroups: {
|
|
61
|
+
items: IToolbarItemOptions[];
|
|
62
|
+
name?: string;
|
|
63
|
+
className?: string;
|
|
64
|
+
}[];
|
|
65
|
+
}>;
|
|
66
|
+
/**
|
|
67
|
+
* 创建 ToolbarModel
|
|
68
|
+
* @param groups IToolbarGroupOptions[]
|
|
69
|
+
*/
|
|
70
|
+
protected createToolbarGroupModel: (groups: IToolbarGroupOptions[]) => {
|
|
71
|
+
items: IToolbarItemOptions[];
|
|
72
|
+
name?: string;
|
|
73
|
+
className?: string;
|
|
74
|
+
}[];
|
|
75
|
+
/**
|
|
76
|
+
* 创建 ToolbarModel
|
|
77
|
+
* @param option IToolbarItem
|
|
78
|
+
*/
|
|
79
|
+
protected createToolbarModel(option: Partial<IToolbarItemOptions>): IToolbarItemOptions;
|
|
80
|
+
}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { __decorate, __metadata } from "tslib";
|
|
2
|
+
import 'reflect-metadata';
|
|
3
|
+
import { singleton, inject, contrib, Contribution } from 'mana-syringe';
|
|
4
|
+
import debounce from 'lodash/debounce';
|
|
5
|
+
import cloneDeep from 'lodash/cloneDeep';
|
|
6
|
+
import isBoolean from 'lodash/isBoolean';
|
|
7
|
+
import { Disposable, DisposableCollection } from '../common/disposable';
|
|
8
|
+
import { IFrontendApplicationContribution } from '../xflow-main/interface';
|
|
9
|
+
import { RxModel } from '../common/rx-model';
|
|
10
|
+
import { IGraphCommandService } from '../command';
|
|
11
|
+
import { IModelService } from '../model-service';
|
|
12
|
+
import { IToolbarService, IToolbarContribution } from './interface';
|
|
13
|
+
/**
|
|
14
|
+
* Main, shared registry for toolbar items.
|
|
15
|
+
*/
|
|
16
|
+
let ToolbarRegistry = class ToolbarRegistry {
|
|
17
|
+
constructor() {
|
|
18
|
+
/** disposables */
|
|
19
|
+
this.toDispose = new DisposableCollection();
|
|
20
|
+
/** 储存所有toolbar items */
|
|
21
|
+
this.toolbarItems = new Map();
|
|
22
|
+
/** 注册ToolbarRegistry的onChange的事件 */
|
|
23
|
+
this.onDidChangeEvent = new RxModel(null);
|
|
24
|
+
/** 通过ToolbarRegistry.onDidChange监听ToolbarRegistry items的变化 */
|
|
25
|
+
this.onDidChange = this.onDidChangeEvent.watch;
|
|
26
|
+
/** debounce in order to avoid to fire more than once in the same tick */
|
|
27
|
+
this.fireOnDidChange = debounce(() => this.onDidChangeEvent.setValue(undefined), 16);
|
|
28
|
+
/**
|
|
29
|
+
* 批量注册可单独dispose的扩展项目
|
|
30
|
+
* @param externalRegisterFn IRegisterMenuFunction
|
|
31
|
+
*/
|
|
32
|
+
this.registerDisposableToolbar = (externalRegisterFn) => {
|
|
33
|
+
const toDispose = new DisposableCollection();
|
|
34
|
+
const disposableRegistry = {
|
|
35
|
+
registerToolbarItem: config => {
|
|
36
|
+
const disposable = this.registerItem(config);
|
|
37
|
+
toDispose.push(disposable);
|
|
38
|
+
return disposable;
|
|
39
|
+
},
|
|
40
|
+
};
|
|
41
|
+
externalRegisterFn(disposableRegistry);
|
|
42
|
+
this.toDispose.push(toDispose);
|
|
43
|
+
return toDispose;
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* 获取 ToolbarModel
|
|
47
|
+
* @param toolbarConfig IToolbarOptions
|
|
48
|
+
*/
|
|
49
|
+
this.getToolbarModel = (toolbarConfig) => {
|
|
50
|
+
const { layout, mainGroups = [], extraGroups = [] } = toolbarConfig;
|
|
51
|
+
return new RxModel({
|
|
52
|
+
layout,
|
|
53
|
+
mainGroups: this.createToolbarGroupModel(mainGroups),
|
|
54
|
+
extraGroups: this.createToolbarGroupModel(extraGroups),
|
|
55
|
+
});
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* 创建 ToolbarModel
|
|
59
|
+
* @param groups IToolbarGroupOptions[]
|
|
60
|
+
*/
|
|
61
|
+
this.createToolbarGroupModel = (groups) => {
|
|
62
|
+
const groupModels = groups.map(group => {
|
|
63
|
+
const { items = [] } = group;
|
|
64
|
+
return Object.assign(Object.assign({}, group), { items: items.map(item => this.createToolbarModel({ id: item.id })).filter(i => !!i) });
|
|
65
|
+
});
|
|
66
|
+
return groupModels;
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
/** App启动时,收集Toolbar扩展点的注册项 */
|
|
70
|
+
onStart() {
|
|
71
|
+
const contributions = this.contributionProvider.getContributions();
|
|
72
|
+
for (const contribution of contributions) {
|
|
73
|
+
contribution.registerToolbarItems(this);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* App 销毁时调用
|
|
78
|
+
* dispose toolbarProvider
|
|
79
|
+
*/
|
|
80
|
+
onStop() {
|
|
81
|
+
this.toDispose.dispose();
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* 注册ToolbarItem
|
|
85
|
+
* item所需的command需要提前在command registry注册
|
|
86
|
+
* @param config IToolbarItem
|
|
87
|
+
*/
|
|
88
|
+
registerItem(config) {
|
|
89
|
+
if (this.toolbarItems.has(config.id)) {
|
|
90
|
+
console.warn(`ToolbarRegistry ${config.id} is duplicated, in`, config);
|
|
91
|
+
}
|
|
92
|
+
/** 注册 */
|
|
93
|
+
this.toolbarItems.set(config.id, config);
|
|
94
|
+
/** 通知更新 */
|
|
95
|
+
this.fireOnDidChange();
|
|
96
|
+
const toDispose = new DisposableCollection(Disposable.create(() => this.fireOnDidChange()), Disposable.create(() => this.toolbarItems.delete(config.id)));
|
|
97
|
+
return toDispose;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* 创建 ToolbarModel
|
|
101
|
+
* @param option IToolbarItem
|
|
102
|
+
*/
|
|
103
|
+
createToolbarModel(option) {
|
|
104
|
+
const item = cloneDeep(this.toolbarItems.get(option.id));
|
|
105
|
+
const isEnabled = isBoolean(item.isEnabled) ? item.isEnabled : true;
|
|
106
|
+
const isVisible = isBoolean(item.isVisible) ? item.isVisible : true;
|
|
107
|
+
const toolbarItem = Object.assign(Object.assign({}, item), { isEnabled: isEnabled, isVisible: isVisible, iconName: item.iconName, text: item.text });
|
|
108
|
+
return toolbarItem;
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
__decorate([
|
|
112
|
+
inject(IGraphCommandService),
|
|
113
|
+
__metadata("design:type", Object)
|
|
114
|
+
], ToolbarRegistry.prototype, "commandService", void 0);
|
|
115
|
+
__decorate([
|
|
116
|
+
inject(IModelService),
|
|
117
|
+
__metadata("design:type", Object)
|
|
118
|
+
], ToolbarRegistry.prototype, "modelService", void 0);
|
|
119
|
+
__decorate([
|
|
120
|
+
contrib(IToolbarContribution),
|
|
121
|
+
__metadata("design:type", Object)
|
|
122
|
+
], ToolbarRegistry.prototype, "contributionProvider", void 0);
|
|
123
|
+
ToolbarRegistry = __decorate([
|
|
124
|
+
singleton({ contrib: [IFrontendApplicationContribution, IToolbarService] })
|
|
125
|
+
], ToolbarRegistry);
|
|
126
|
+
export { ToolbarRegistry };
|
|
127
|
+
//# sourceMappingURL=toolbar-registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toolbar-registry.js","sourceRoot":"","sources":["../../src/toolbar/toolbar-registry.tsx"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import 'reflect-metadata';
|
|
2
|
+
/** Application */
|
|
3
|
+
import { FrontendApplication } from './application';
|
|
4
|
+
/** Extension 注册中心 */
|
|
5
|
+
import { ExtensionRegistry } from './components/extension-registry';
|
|
6
|
+
export { ExtensionRegistry };
|
|
7
|
+
export type ICreateApp = (registry: ExtensionRegistry) => FrontendApplication;
|
|
8
|
+
export declare const initApp: ICreateApp;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-redeclare */
|
|
2
|
+
import 'reflect-metadata';
|
|
3
|
+
/** Application */
|
|
4
|
+
import { FrontendApplication, IFrontendApplicationContribution } from './application';
|
|
5
|
+
/** Command 模块 */
|
|
6
|
+
import { commandRegistryModule } from '../command/module';
|
|
7
|
+
import { modelServiceModule } from '../model-service/module';
|
|
8
|
+
/** Extension 注册中心 */
|
|
9
|
+
import { ExtensionRegistry } from './components/extension-registry';
|
|
10
|
+
/** 类型定义 */
|
|
11
|
+
import { Contribution, Container, Module } from 'mana-syringe';
|
|
12
|
+
export { ExtensionRegistry };
|
|
13
|
+
/** application */
|
|
14
|
+
const appMainModule = Module(register => {
|
|
15
|
+
/** 声明IFrontendApplicationContribution扩展点*/
|
|
16
|
+
Contribution.register(register, IFrontendApplicationContribution);
|
|
17
|
+
/** 声明 FrontendApplication */
|
|
18
|
+
register(FrontendApplication);
|
|
19
|
+
});
|
|
20
|
+
export const initApp = (moduleRegistry) => {
|
|
21
|
+
const extensions = moduleRegistry.getAllExtensions();
|
|
22
|
+
const container = new Container();
|
|
23
|
+
/** command */
|
|
24
|
+
/** react renderer */
|
|
25
|
+
/** 批量创建 extension module */
|
|
26
|
+
const modules = extensions.map(module => {
|
|
27
|
+
const { createModule, config } = module;
|
|
28
|
+
return createModule(config);
|
|
29
|
+
});
|
|
30
|
+
/** 单独加载 appMainModule */
|
|
31
|
+
container.load(appMainModule);
|
|
32
|
+
/** 单独加载 commandRegistryModule */
|
|
33
|
+
container.load(commandRegistryModule);
|
|
34
|
+
// /** 单独加载 modelServiceModule */
|
|
35
|
+
container.load(modelServiceModule);
|
|
36
|
+
/**
|
|
37
|
+
* 批量加载 extension module
|
|
38
|
+
* 包括:menu/toolbar/keybinding/graph
|
|
39
|
+
*/
|
|
40
|
+
modules.forEach(module => {
|
|
41
|
+
container.load(module);
|
|
42
|
+
});
|
|
43
|
+
const app = container.get(FrontendApplication);
|
|
44
|
+
return app;
|
|
45
|
+
};
|
|
46
|
+
//# sourceMappingURL=application-module.js.map
|