@eclipse-glsp/server 1.1.0-RC05
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 +642 -0
- package/README.md +8 -0
- package/browser.d.ts +16 -0
- package/browser.js +18 -0
- package/lib/browser/di/app-module.d.ts +24 -0
- package/lib/browser/di/app-module.d.ts.map +1 -0
- package/lib/browser/di/app-module.js +55 -0
- package/lib/browser/di/app-module.js.map +1 -0
- package/lib/browser/di/console-logger.d.ts +29 -0
- package/lib/browser/di/console-logger.d.ts.map +1 -0
- package/lib/browser/di/console-logger.js +81 -0
- package/lib/browser/di/console-logger.js.map +1 -0
- package/lib/browser/index.d.ts +20 -0
- package/lib/browser/index.d.ts.map +1 -0
- package/lib/browser/index.js +36 -0
- package/lib/browser/index.js.map +1 -0
- package/lib/browser/launch/worker-server-launcher.d.ts +26 -0
- package/lib/browser/launch/worker-server-launcher.d.ts.map +1 -0
- package/lib/browser/launch/worker-server-launcher.js +65 -0
- package/lib/browser/launch/worker-server-launcher.js.map +1 -0
- package/lib/common/actions/action-dispatcher.d.ts +74 -0
- package/lib/common/actions/action-dispatcher.d.ts.map +1 -0
- package/lib/common/actions/action-dispatcher.js +128 -0
- package/lib/common/actions/action-dispatcher.js.map +1 -0
- package/lib/common/actions/action-dispatcher.spec.d.ts +2 -0
- package/lib/common/actions/action-dispatcher.spec.d.ts.map +1 -0
- package/lib/common/actions/action-dispatcher.spec.js +264 -0
- package/lib/common/actions/action-dispatcher.spec.js.map +1 -0
- package/lib/common/actions/action-handler-registry.d.ts +40 -0
- package/lib/common/actions/action-handler-registry.d.ts.map +1 -0
- package/lib/common/actions/action-handler-registry.js +65 -0
- package/lib/common/actions/action-handler-registry.js.map +1 -0
- package/lib/common/actions/action-handler-registry.spec.d.ts +2 -0
- package/lib/common/actions/action-handler-registry.spec.d.ts.map +1 -0
- package/lib/common/actions/action-handler-registry.spec.js +50 -0
- package/lib/common/actions/action-handler-registry.spec.js.map +1 -0
- package/lib/common/actions/action-handler.d.ts +55 -0
- package/lib/common/actions/action-handler.d.ts.map +1 -0
- package/lib/common/actions/action-handler.js +7 -0
- package/lib/common/actions/action-handler.js.map +1 -0
- package/lib/common/actions/client-action-handler.d.ts +30 -0
- package/lib/common/actions/client-action-handler.d.ts.map +1 -0
- package/lib/common/actions/client-action-handler.js +56 -0
- package/lib/common/actions/client-action-handler.js.map +1 -0
- package/lib/common/actions/global-action-provider.d.ts +30 -0
- package/lib/common/actions/global-action-provider.d.ts.map +1 -0
- package/lib/common/actions/global-action-provider.js +81 -0
- package/lib/common/actions/global-action-provider.js.map +1 -0
- package/lib/common/actions/global-action-provider.spec.d.ts +2 -0
- package/lib/common/actions/global-action-provider.spec.d.ts.map +1 -0
- package/lib/common/actions/global-action-provider.spec.js +70 -0
- package/lib/common/actions/global-action-provider.spec.js.map +1 -0
- package/lib/common/command/command-stack.d.ts +67 -0
- package/lib/common/command/command-stack.d.ts.map +1 -0
- package/lib/common/command/command-stack.js +117 -0
- package/lib/common/command/command-stack.js.map +1 -0
- package/lib/common/command/command-stack.spec.d.ts +2 -0
- package/lib/common/command/command-stack.spec.d.ts.map +1 -0
- package/lib/common/command/command-stack.spec.js +207 -0
- package/lib/common/command/command-stack.spec.js.map +1 -0
- package/lib/common/command/command.d.ts +63 -0
- package/lib/common/command/command.d.ts.map +1 -0
- package/lib/common/command/command.js +87 -0
- package/lib/common/command/command.js.map +1 -0
- package/lib/common/command/command.spec.d.ts +2 -0
- package/lib/common/command/command.spec.d.ts.map +1 -0
- package/lib/common/command/command.spec.js +86 -0
- package/lib/common/command/command.spec.js.map +1 -0
- package/lib/common/command/recording-command.d.ts +75 -0
- package/lib/common/command/recording-command.d.ts.map +1 -0
- package/lib/common/command/recording-command.js +99 -0
- package/lib/common/command/recording-command.js.map +1 -0
- package/lib/common/command/recording-command.spec.d.ts +17 -0
- package/lib/common/command/recording-command.spec.d.ts.map +1 -0
- package/lib/common/command/recording-command.spec.js +62 -0
- package/lib/common/command/recording-command.spec.js.map +1 -0
- package/lib/common/command/undo-redo-action-handler.d.ts +28 -0
- package/lib/common/command/undo-redo-action-handler.d.ts.map +1 -0
- package/lib/common/command/undo-redo-action-handler.js +72 -0
- package/lib/common/command/undo-redo-action-handler.js.map +1 -0
- package/lib/common/di/binding-target.d.ts +73 -0
- package/lib/common/di/binding-target.d.ts.map +1 -0
- package/lib/common/di/binding-target.js +143 -0
- package/lib/common/di/binding-target.js.map +1 -0
- package/lib/common/di/binding-target.spec.d.ts +2 -0
- package/lib/common/di/binding-target.spec.d.ts.map +1 -0
- package/lib/common/di/binding-target.spec.js +121 -0
- package/lib/common/di/binding-target.spec.js.map +1 -0
- package/lib/common/di/client-session-module.d.ts +19 -0
- package/lib/common/di/client-session-module.d.ts.map +1 -0
- package/lib/common/di/client-session-module.js +34 -0
- package/lib/common/di/client-session-module.js.map +1 -0
- package/lib/common/di/diagram-module.d.ts +130 -0
- package/lib/common/di/diagram-module.d.ts.map +1 -0
- package/lib/common/di/diagram-module.js +295 -0
- package/lib/common/di/diagram-module.js.map +1 -0
- package/lib/common/di/glsp-module.d.ts +47 -0
- package/lib/common/di/glsp-module.d.ts.map +1 -0
- package/lib/common/di/glsp-module.js +59 -0
- package/lib/common/di/glsp-module.js.map +1 -0
- package/lib/common/di/multi-binding.d.ts +41 -0
- package/lib/common/di/multi-binding.d.ts.map +1 -0
- package/lib/common/di/multi-binding.js +82 -0
- package/lib/common/di/multi-binding.js.map +1 -0
- package/lib/common/di/multi-bindings.spec.d.ts +2 -0
- package/lib/common/di/multi-bindings.spec.d.ts.map +1 -0
- package/lib/common/di/multi-bindings.spec.js +137 -0
- package/lib/common/di/multi-bindings.spec.js.map +1 -0
- package/lib/common/di/server-module.d.ts +73 -0
- package/lib/common/di/server-module.d.ts.map +1 -0
- package/lib/common/di/server-module.js +103 -0
- package/lib/common/di/server-module.js.map +1 -0
- package/lib/common/di/service-identifiers.d.ts +29 -0
- package/lib/common/di/service-identifiers.d.ts.map +1 -0
- package/lib/common/di/service-identifiers.js +14 -0
- package/lib/common/di/service-identifiers.js.map +1 -0
- package/lib/common/diagram/diagram-configuration.d.ts +89 -0
- package/lib/common/diagram/diagram-configuration.d.ts.map +1 -0
- package/lib/common/diagram/diagram-configuration.js +30 -0
- package/lib/common/diagram/diagram-configuration.js.map +1 -0
- package/lib/common/diagram/request-type-hints-action-handler.d.ts +25 -0
- package/lib/common/diagram/request-type-hints-action-handler.d.ts.map +1 -0
- package/lib/common/diagram/request-type-hints-action-handler.js +53 -0
- package/lib/common/diagram/request-type-hints-action-handler.js.map +1 -0
- package/lib/common/diagram/request-type-hints-action-handler.spec.d.ts +2 -0
- package/lib/common/diagram/request-type-hints-action-handler.spec.d.ts.map +1 -0
- package/lib/common/diagram/request-type-hints-action-handler.spec.js +57 -0
- package/lib/common/diagram/request-type-hints-action-handler.spec.js.map +1 -0
- package/lib/common/features/clipboard/request-clipboard-data-action-handler.d.ts +26 -0
- package/lib/common/features/clipboard/request-clipboard-data-action-handler.d.ts.map +1 -0
- package/lib/common/features/clipboard/request-clipboard-data-action-handler.js +61 -0
- package/lib/common/features/clipboard/request-clipboard-data-action-handler.js.map +1 -0
- package/lib/common/features/contextactions/command-palette-action-provider.d.ts +63 -0
- package/lib/common/features/contextactions/command-palette-action-provider.d.ts.map +1 -0
- package/lib/common/features/contextactions/command-palette-action-provider.js +72 -0
- package/lib/common/features/contextactions/command-palette-action-provider.js.map +1 -0
- package/lib/common/features/contextactions/context-actions-provider-registry.d.ts +12 -0
- package/lib/common/features/contextactions/context-actions-provider-registry.d.ts.map +1 -0
- package/lib/common/features/contextactions/context-actions-provider-registry.js +70 -0
- package/lib/common/features/contextactions/context-actions-provider-registry.js.map +1 -0
- package/lib/common/features/contextactions/context-actions-provider-registry.spec.d.ts +2 -0
- package/lib/common/features/contextactions/context-actions-provider-registry.spec.d.ts.map +1 -0
- package/lib/common/features/contextactions/context-actions-provider-registry.spec.js +34 -0
- package/lib/common/features/contextactions/context-actions-provider-registry.spec.js.map +1 -0
- package/lib/common/features/contextactions/context-actions-provider.d.ts +34 -0
- package/lib/common/features/contextactions/context-actions-provider.d.ts.map +1 -0
- package/lib/common/features/contextactions/context-actions-provider.js +5 -0
- package/lib/common/features/contextactions/context-actions-provider.js.map +1 -0
- package/lib/common/features/contextactions/context-menu-item-provider.d.ts +43 -0
- package/lib/common/features/contextactions/context-menu-item-provider.d.ts.map +1 -0
- package/lib/common/features/contextactions/context-menu-item-provider.js +36 -0
- package/lib/common/features/contextactions/context-menu-item-provider.js.map +1 -0
- package/lib/common/features/contextactions/request-context-actions-handler.d.ts +24 -0
- package/lib/common/features/contextactions/request-context-actions-handler.d.ts.map +1 -0
- package/lib/common/features/contextactions/request-context-actions-handler.js +53 -0
- package/lib/common/features/contextactions/request-context-actions-handler.js.map +1 -0
- package/lib/common/features/contextactions/request-context-actions-handler.spec.d.ts +2 -0
- package/lib/common/features/contextactions/request-context-actions-handler.spec.d.ts.map +1 -0
- package/lib/common/features/contextactions/request-context-actions-handler.spec.js +63 -0
- package/lib/common/features/contextactions/request-context-actions-handler.spec.js.map +1 -0
- package/lib/common/features/contextactions/tool-palette-item-provider.d.ts +50 -0
- package/lib/common/features/contextactions/tool-palette-item-provider.d.ts.map +1 -0
- package/lib/common/features/contextactions/tool-palette-item-provider.js +86 -0
- package/lib/common/features/contextactions/tool-palette-item-provider.js.map +1 -0
- package/lib/common/features/contextactions/tool-palette-item-provider.spec.d.ts +2 -0
- package/lib/common/features/contextactions/tool-palette-item-provider.spec.d.ts.map +1 -0
- package/lib/common/features/contextactions/tool-palette-item-provider.spec.js +48 -0
- package/lib/common/features/contextactions/tool-palette-item-provider.spec.js.map +1 -0
- package/lib/common/features/directediting/context-edit-validator-registry.d.ts +14 -0
- package/lib/common/features/directediting/context-edit-validator-registry.d.ts.map +1 -0
- package/lib/common/features/directediting/context-edit-validator-registry.js +57 -0
- package/lib/common/features/directediting/context-edit-validator-registry.js.map +1 -0
- package/lib/common/features/directediting/context-edit-validator-registry.spec.d.ts +2 -0
- package/lib/common/features/directediting/context-edit-validator-registry.spec.d.ts.map +1 -0
- package/lib/common/features/directediting/context-edit-validator-registry.spec.js +44 -0
- package/lib/common/features/directediting/context-edit-validator-registry.spec.js.map +1 -0
- package/lib/common/features/directediting/context-edit-validator.d.ts +25 -0
- package/lib/common/features/directediting/context-edit-validator.d.ts.map +1 -0
- package/lib/common/features/directediting/context-edit-validator.js +40 -0
- package/lib/common/features/directediting/context-edit-validator.js.map +1 -0
- package/lib/common/features/directediting/label-edit-validator.d.ts +32 -0
- package/lib/common/features/directediting/label-edit-validator.d.ts.map +1 -0
- package/lib/common/features/directediting/label-edit-validator.js +21 -0
- package/lib/common/features/directediting/label-edit-validator.js.map +1 -0
- package/lib/common/features/directediting/request-edit-validation-handler.d.ts +26 -0
- package/lib/common/features/directediting/request-edit-validation-handler.d.ts.map +1 -0
- package/lib/common/features/directediting/request-edit-validation-handler.js +61 -0
- package/lib/common/features/directediting/request-edit-validation-handler.js.map +1 -0
- package/lib/common/features/directediting/request-edit-validation-handler.spec.d.ts +2 -0
- package/lib/common/features/directediting/request-edit-validation-handler.spec.d.ts.map +1 -0
- package/lib/common/features/directediting/request-edit-validation-handler.spec.js +97 -0
- package/lib/common/features/directediting/request-edit-validation-handler.spec.js.map +1 -0
- package/lib/common/features/layout/computed-bounds-action-handler.d.ts +34 -0
- package/lib/common/features/layout/computed-bounds-action-handler.d.ts.map +1 -0
- package/lib/common/features/layout/computed-bounds-action-handler.js +55 -0
- package/lib/common/features/layout/computed-bounds-action-handler.js.map +1 -0
- package/lib/common/features/layout/layout-engine.d.ts +29 -0
- package/lib/common/features/layout/layout-engine.d.ts.map +1 -0
- package/lib/common/features/layout/layout-engine.js +20 -0
- package/lib/common/features/layout/layout-engine.js.map +1 -0
- package/lib/common/features/layout/layout-operation-handler.d.ts +37 -0
- package/lib/common/features/layout/layout-operation-handler.d.ts.map +1 -0
- package/lib/common/features/layout/layout-operation-handler.js +82 -0
- package/lib/common/features/layout/layout-operation-handler.js.map +1 -0
- package/lib/common/features/model/gmodel-factory.d.ts +39 -0
- package/lib/common/features/model/gmodel-factory.d.ts.map +1 -0
- package/lib/common/features/model/gmodel-factory.js +39 -0
- package/lib/common/features/model/gmodel-factory.js.map +1 -0
- package/lib/common/features/model/gmodel-index.d.ts +107 -0
- package/lib/common/features/model/gmodel-index.d.ts.map +1 -0
- package/lib/common/features/model/gmodel-index.js +193 -0
- package/lib/common/features/model/gmodel-index.js.map +1 -0
- package/lib/common/features/model/gmodel-serializer.d.ts +67 -0
- package/lib/common/features/model/gmodel-serializer.d.ts.map +1 -0
- package/lib/common/features/model/gmodel-serializer.js +143 -0
- package/lib/common/features/model/gmodel-serializer.js.map +1 -0
- package/lib/common/features/model/gmodel-serializer.spec.d.ts +2 -0
- package/lib/common/features/model/gmodel-serializer.spec.d.ts.map +1 -0
- package/lib/common/features/model/gmodel-serializer.spec.js +124 -0
- package/lib/common/features/model/gmodel-serializer.spec.js.map +1 -0
- package/lib/common/features/model/model-state.d.ts +51 -0
- package/lib/common/features/model/model-state.d.ts.map +1 -0
- package/lib/common/features/model/model-state.js +74 -0
- package/lib/common/features/model/model-state.js.map +1 -0
- package/lib/common/features/model/model-submission-handler.d.ts +58 -0
- package/lib/common/features/model/model-submission-handler.d.ts.map +1 -0
- package/lib/common/features/model/model-submission-handler.js +102 -0
- package/lib/common/features/model/model-submission-handler.js.map +1 -0
- package/lib/common/features/model/request-model-action-handler.d.ts +37 -0
- package/lib/common/features/model/request-model-action-handler.d.ts.map +1 -0
- package/lib/common/features/model/request-model-action-handler.js +83 -0
- package/lib/common/features/model/request-model-action-handler.js.map +1 -0
- package/lib/common/features/model/save-model-action-handler.d.ts +26 -0
- package/lib/common/features/model/save-model-action-handler.d.ts.map +1 -0
- package/lib/common/features/model/save-model-action-handler.js +54 -0
- package/lib/common/features/model/save-model-action-handler.js.map +1 -0
- package/lib/common/features/model/source-model-storage.d.ts +47 -0
- package/lib/common/features/model/source-model-storage.d.ts.map +1 -0
- package/lib/common/features/model/source-model-storage.js +5 -0
- package/lib/common/features/model/source-model-storage.js.map +1 -0
- package/lib/common/features/navigation/json-opener-options.d.ts +36 -0
- package/lib/common/features/navigation/json-opener-options.d.ts.map +1 -0
- package/lib/common/features/navigation/json-opener-options.js +60 -0
- package/lib/common/features/navigation/json-opener-options.js.map +1 -0
- package/lib/common/features/navigation/navigation-target-provider-registry.d.ts +12 -0
- package/lib/common/features/navigation/navigation-target-provider-registry.d.ts.map +1 -0
- package/lib/common/features/navigation/navigation-target-provider-registry.js +47 -0
- package/lib/common/features/navigation/navigation-target-provider-registry.js.map +1 -0
- package/lib/common/features/navigation/navigation-target-provider.d.ts +48 -0
- package/lib/common/features/navigation/navigation-target-provider.d.ts.map +1 -0
- package/lib/common/features/navigation/navigation-target-provider.js +5 -0
- package/lib/common/features/navigation/navigation-target-provider.js.map +1 -0
- package/lib/common/features/navigation/navigation-target-resolution.d.ts +23 -0
- package/lib/common/features/navigation/navigation-target-resolution.d.ts.map +1 -0
- package/lib/common/features/navigation/navigation-target-resolution.js +12 -0
- package/lib/common/features/navigation/navigation-target-resolution.js.map +1 -0
- package/lib/common/features/navigation/navigation-target-resolver.d.ts +31 -0
- package/lib/common/features/navigation/navigation-target-resolver.d.ts.map +1 -0
- package/lib/common/features/navigation/navigation-target-resolver.js +49 -0
- package/lib/common/features/navigation/navigation-target-resolver.js.map +1 -0
- package/lib/common/features/navigation/request-navigation-targets-action-handler.d.ts +24 -0
- package/lib/common/features/navigation/request-navigation-targets-action-handler.d.ts.map +1 -0
- package/lib/common/features/navigation/request-navigation-targets-action-handler.js +55 -0
- package/lib/common/features/navigation/request-navigation-targets-action-handler.js.map +1 -0
- package/lib/common/features/navigation/resolve-navigation-targets-action-handler.d.ts +26 -0
- package/lib/common/features/navigation/resolve-navigation-targets-action-handler.d.ts.map +1 -0
- package/lib/common/features/navigation/resolve-navigation-targets-action-handler.js +59 -0
- package/lib/common/features/navigation/resolve-navigation-targets-action-handler.js.map +1 -0
- package/lib/common/features/popup/popup-model-factory.d.ts +36 -0
- package/lib/common/features/popup/popup-model-factory.d.ts.map +1 -0
- package/lib/common/features/popup/popup-model-factory.js +20 -0
- package/lib/common/features/popup/popup-model-factory.js.map +1 -0
- package/lib/common/features/popup/request-popup-model-action-handler.d.ts +31 -0
- package/lib/common/features/popup/request-popup-model-action-handler.d.ts.map +1 -0
- package/lib/common/features/popup/request-popup-model-action-handler.js +77 -0
- package/lib/common/features/popup/request-popup-model-action-handler.js.map +1 -0
- package/lib/common/features/validation/model-validator.d.ts +33 -0
- package/lib/common/features/validation/model-validator.d.ts.map +1 -0
- package/lib/common/features/validation/model-validator.js +5 -0
- package/lib/common/features/validation/model-validator.js.map +1 -0
- package/lib/common/features/validation/request-markers-handler.d.ts +11 -0
- package/lib/common/features/validation/request-markers-handler.d.ts.map +1 -0
- package/lib/common/features/validation/request-markers-handler.js +70 -0
- package/lib/common/features/validation/request-markers-handler.js.map +1 -0
- package/lib/common/gmodel/apply-label-edit-operation-handler.d.ts +8 -0
- package/lib/common/gmodel/apply-label-edit-operation-handler.d.ts.map +1 -0
- package/lib/common/gmodel/apply-label-edit-operation-handler.js +46 -0
- package/lib/common/gmodel/apply-label-edit-operation-handler.js.map +1 -0
- package/lib/common/gmodel/change-bounds-operation-handler.d.ts +13 -0
- package/lib/common/gmodel/change-bounds-operation-handler.d.ts.map +1 -0
- package/lib/common/gmodel/change-bounds-operation-handler.js +71 -0
- package/lib/common/gmodel/change-bounds-operation-handler.js.map +1 -0
- package/lib/common/gmodel/change-routing-points-operation-handler.d.ts +24 -0
- package/lib/common/gmodel/change-routing-points-operation-handler.d.ts.map +1 -0
- package/lib/common/gmodel/change-routing-points-operation-handler.js +50 -0
- package/lib/common/gmodel/change-routing-points-operation-handler.js.map +1 -0
- package/lib/common/gmodel/cut-operation-handler.d.ts +26 -0
- package/lib/common/gmodel/cut-operation-handler.d.ts.map +1 -0
- package/lib/common/gmodel/cut-operation-handler.js +55 -0
- package/lib/common/gmodel/cut-operation-handler.js.map +1 -0
- package/lib/common/gmodel/delete-operation-handler.d.ts +32 -0
- package/lib/common/gmodel/delete-operation-handler.d.ts.map +1 -0
- package/lib/common/gmodel/delete-operation-handler.js +119 -0
- package/lib/common/gmodel/delete-operation-handler.js.map +1 -0
- package/lib/common/gmodel/gmodel-create-edge-operation-handler.d.ts +35 -0
- package/lib/common/gmodel/gmodel-create-edge-operation-handler.d.ts.map +1 -0
- package/lib/common/gmodel/gmodel-create-edge-operation-handler.js +64 -0
- package/lib/common/gmodel/gmodel-create-edge-operation-handler.js.map +1 -0
- package/lib/common/gmodel/gmodel-create-node-operation-handler.d.ts +58 -0
- package/lib/common/gmodel/gmodel-create-node-operation-handler.d.ts.map +1 -0
- package/lib/common/gmodel/gmodel-create-node-operation-handler.js +100 -0
- package/lib/common/gmodel/gmodel-create-node-operation-handler.js.map +1 -0
- package/lib/common/gmodel/gmodel-diagram-module.d.ts +31 -0
- package/lib/common/gmodel/gmodel-diagram-module.d.ts.map +1 -0
- package/lib/common/gmodel/gmodel-diagram-module.js +80 -0
- package/lib/common/gmodel/gmodel-diagram-module.js.map +1 -0
- package/lib/common/gmodel/gmodel-operation-handler.d.ts +23 -0
- package/lib/common/gmodel/gmodel-operation-handler.d.ts.map +1 -0
- package/lib/common/gmodel/gmodel-operation-handler.js +43 -0
- package/lib/common/gmodel/gmodel-operation-handler.js.map +1 -0
- package/lib/common/gmodel/index.d.ts +27 -0
- package/lib/common/gmodel/index.d.ts.map +1 -0
- package/lib/common/gmodel/index.js +43 -0
- package/lib/common/gmodel/index.js.map +1 -0
- package/lib/common/gmodel/paste-operation-handler.d.ts +36 -0
- package/lib/common/gmodel/paste-operation-handler.d.ts.map +1 -0
- package/lib/common/gmodel/paste-operation-handler.js +136 -0
- package/lib/common/gmodel/paste-operation-handler.js.map +1 -0
- package/lib/common/gmodel/reconnect-edge-operation-handler.d.ts +9 -0
- package/lib/common/gmodel/reconnect-edge-operation-handler.d.ts.map +1 -0
- package/lib/common/gmodel/reconnect-edge-operation-handler.js +64 -0
- package/lib/common/gmodel/reconnect-edge-operation-handler.js.map +1 -0
- package/lib/common/index.d.ts +89 -0
- package/lib/common/index.d.ts.map +1 -0
- package/lib/common/index.js +105 -0
- package/lib/common/index.js.map +1 -0
- package/lib/common/launch/glsp-server-launcher.d.ts +34 -0
- package/lib/common/launch/glsp-server-launcher.d.ts.map +1 -0
- package/lib/common/launch/glsp-server-launcher.js +64 -0
- package/lib/common/launch/glsp-server-launcher.js.map +1 -0
- package/lib/common/operations/compound-operation-handler.d.ts +25 -0
- package/lib/common/operations/compound-operation-handler.d.ts.map +1 -0
- package/lib/common/operations/compound-operation-handler.js +82 -0
- package/lib/common/operations/compound-operation-handler.js.map +1 -0
- package/lib/common/operations/create-operation-handler.d.ts +32 -0
- package/lib/common/operations/create-operation-handler.d.ts.map +1 -0
- package/lib/common/operations/create-operation-handler.js +31 -0
- package/lib/common/operations/create-operation-handler.js.map +1 -0
- package/lib/common/operations/operation-action-handler.d.ts +42 -0
- package/lib/common/operations/operation-action-handler.d.ts.map +1 -0
- package/lib/common/operations/operation-action-handler.js +109 -0
- package/lib/common/operations/operation-action-handler.js.map +1 -0
- package/lib/common/operations/operation-handler-registry.d.ts +38 -0
- package/lib/common/operations/operation-handler-registry.d.ts.map +1 -0
- package/lib/common/operations/operation-handler-registry.js +87 -0
- package/lib/common/operations/operation-handler-registry.js.map +1 -0
- package/lib/common/operations/operation-handler-registry.spec.d.ts +2 -0
- package/lib/common/operations/operation-handler-registry.spec.d.ts.map +1 -0
- package/lib/common/operations/operation-handler-registry.spec.js +50 -0
- package/lib/common/operations/operation-handler-registry.spec.js.map +1 -0
- package/lib/common/operations/operation-handler.d.ts +67 -0
- package/lib/common/operations/operation-handler.d.ts.map +1 -0
- package/lib/common/operations/operation-handler.js +56 -0
- package/lib/common/operations/operation-handler.js.map +1 -0
- package/lib/common/protocol/glsp-client-proxy.d.ts +45 -0
- package/lib/common/protocol/glsp-client-proxy.d.ts.map +1 -0
- package/lib/common/protocol/glsp-client-proxy.js +53 -0
- package/lib/common/protocol/glsp-client-proxy.js.map +1 -0
- package/lib/common/protocol/glsp-server-listener.d.ts +37 -0
- package/lib/common/protocol/glsp-server-listener.d.ts.map +1 -0
- package/lib/common/protocol/glsp-server-listener.js +5 -0
- package/lib/common/protocol/glsp-server-listener.js.map +1 -0
- package/lib/common/protocol/glsp-server.d.ts +150 -0
- package/lib/common/protocol/glsp-server.d.ts.map +1 -0
- package/lib/common/protocol/glsp-server.js +188 -0
- package/lib/common/protocol/glsp-server.js.map +1 -0
- package/lib/common/protocol/glsp-server.spec.d.ts +2 -0
- package/lib/common/protocol/glsp-server.spec.d.ts.map +1 -0
- package/lib/common/protocol/glsp-server.spec.js +119 -0
- package/lib/common/protocol/glsp-server.spec.js.map +1 -0
- package/lib/common/session/client-session-factory.d.ts +42 -0
- package/lib/common/session/client-session-factory.d.ts.map +1 -0
- package/lib/common/session/client-session-factory.js +54 -0
- package/lib/common/session/client-session-factory.js.map +1 -0
- package/lib/common/session/client-session-factory.spec.d.ts +2 -0
- package/lib/common/session/client-session-factory.spec.d.ts.map +1 -0
- package/lib/common/session/client-session-factory.spec.js +56 -0
- package/lib/common/session/client-session-factory.spec.js.map +1 -0
- package/lib/common/session/client-session-initializer.d.ts +26 -0
- package/lib/common/session/client-session-initializer.d.ts.map +1 -0
- package/lib/common/session/client-session-initializer.js +5 -0
- package/lib/common/session/client-session-initializer.js.map +1 -0
- package/lib/common/session/client-session-listener.d.ts +40 -0
- package/lib/common/session/client-session-listener.d.ts.map +1 -0
- package/lib/common/session/client-session-listener.js +3 -0
- package/lib/common/session/client-session-listener.js.map +1 -0
- package/lib/common/session/client-session-manager.d.ts +102 -0
- package/lib/common/session/client-session-manager.d.ts.map +1 -0
- package/lib/common/session/client-session-manager.js +116 -0
- package/lib/common/session/client-session-manager.js.map +1 -0
- package/lib/common/session/client-session-manager.spec.d.ts +2 -0
- package/lib/common/session/client-session-manager.spec.d.ts.map +1 -0
- package/lib/common/session/client-session-manager.spec.js +74 -0
- package/lib/common/session/client-session-manager.spec.js.map +1 -0
- package/lib/common/session/client-session.d.ts +52 -0
- package/lib/common/session/client-session.d.ts.map +1 -0
- package/lib/common/session/client-session.js +34 -0
- package/lib/common/session/client-session.js.map +1 -0
- package/lib/common/test/mock-util.d.ts +117 -0
- package/lib/common/test/mock-util.d.ts.map +1 -0
- package/lib/common/test/mock-util.js +194 -0
- package/lib/common/test/mock-util.js.map +1 -0
- package/lib/common/utils/args-util.d.ts +38 -0
- package/lib/common/utils/args-util.d.ts.map +1 -0
- package/lib/common/utils/args-util.js +81 -0
- package/lib/common/utils/args-util.js.map +1 -0
- package/lib/common/utils/client-options-util.d.ts +20 -0
- package/lib/common/utils/client-options-util.d.ts.map +1 -0
- package/lib/common/utils/client-options-util.js +26 -0
- package/lib/common/utils/client-options-util.js.map +1 -0
- package/lib/common/utils/glsp-server-error.d.ts +21 -0
- package/lib/common/utils/glsp-server-error.d.ts.map +1 -0
- package/lib/common/utils/glsp-server-error.js +33 -0
- package/lib/common/utils/glsp-server-error.js.map +1 -0
- package/lib/common/utils/layout-util.d.ts +74 -0
- package/lib/common/utils/layout-util.d.ts.map +1 -0
- package/lib/common/utils/layout-util.js +166 -0
- package/lib/common/utils/layout-util.js.map +1 -0
- package/lib/common/utils/logger.d.ts +27 -0
- package/lib/common/utils/logger.d.ts.map +1 -0
- package/lib/common/utils/logger.js +67 -0
- package/lib/common/utils/logger.js.map +1 -0
- package/lib/common/utils/promise-queue.d.ts +48 -0
- package/lib/common/utils/promise-queue.d.ts.map +1 -0
- package/lib/common/utils/promise-queue.js +93 -0
- package/lib/common/utils/promise-queue.js.map +1 -0
- package/lib/common/utils/promise-queue.spec.d.ts +2 -0
- package/lib/common/utils/promise-queue.spec.d.ts.map +1 -0
- package/lib/common/utils/promise-queue.spec.js +117 -0
- package/lib/common/utils/promise-queue.spec.js.map +1 -0
- package/lib/common/utils/registry.d.ts +73 -0
- package/lib/common/utils/registry.d.ts.map +1 -0
- package/lib/common/utils/registry.js +160 -0
- package/lib/common/utils/registry.js.map +1 -0
- package/lib/common/utils/registry.spec.d.ts +2 -0
- package/lib/common/utils/registry.spec.d.ts.map +1 -0
- package/lib/common/utils/registry.spec.js +199 -0
- package/lib/common/utils/registry.spec.js.map +1 -0
- package/lib/node/abstract-json-model-storage.d.ts +45 -0
- package/lib/node/abstract-json-model-storage.d.ts.map +1 -0
- package/lib/node/abstract-json-model-storage.js +103 -0
- package/lib/node/abstract-json-model-storage.js.map +1 -0
- package/lib/node/di/app-module.d.ts +36 -0
- package/lib/node/di/app-module.d.ts.map +1 -0
- package/lib/node/di/app-module.js +91 -0
- package/lib/node/di/app-module.js.map +1 -0
- package/lib/node/di/winston-logger.d.ts +32 -0
- package/lib/node/di/winston-logger.d.ts.map +1 -0
- package/lib/node/di/winston-logger.js +57 -0
- package/lib/node/di/winston-logger.js.map +1 -0
- package/lib/node/gmodel/gmodel-storage.d.ts +34 -0
- package/lib/node/gmodel/gmodel-storage.d.ts.map +1 -0
- package/lib/node/gmodel/gmodel-storage.js +68 -0
- package/lib/node/gmodel/gmodel-storage.js.map +1 -0
- package/lib/node/index.d.ts +24 -0
- package/lib/node/index.d.ts.map +1 -0
- package/lib/node/index.js +40 -0
- package/lib/node/index.js.map +1 -0
- package/lib/node/launch/cli-parser.d.ts +34 -0
- package/lib/node/launch/cli-parser.d.ts.map +1 -0
- package/lib/node/launch/cli-parser.js +71 -0
- package/lib/node/launch/cli-parser.js.map +1 -0
- package/lib/node/launch/cli-parser.spec.d.ts +2 -0
- package/lib/node/launch/cli-parser.spec.d.ts.map +1 -0
- package/lib/node/launch/cli-parser.spec.js +56 -0
- package/lib/node/launch/cli-parser.spec.js.map +1 -0
- package/lib/node/launch/socket-cli-parser.d.ts +9 -0
- package/lib/node/launch/socket-cli-parser.d.ts.map +1 -0
- package/lib/node/launch/socket-cli-parser.js +43 -0
- package/lib/node/launch/socket-cli-parser.js.map +1 -0
- package/lib/node/launch/socket-cli-parser.spec.d.ts +2 -0
- package/lib/node/launch/socket-cli-parser.spec.d.ts.map +1 -0
- package/lib/node/launch/socket-cli-parser.spec.js +66 -0
- package/lib/node/launch/socket-cli-parser.spec.js.map +1 -0
- package/lib/node/launch/socket-server-launcher.d.ts +34 -0
- package/lib/node/launch/socket-server-launcher.d.ts.map +1 -0
- package/lib/node/launch/socket-server-launcher.js +104 -0
- package/lib/node/launch/socket-server-launcher.js.map +1 -0
- package/lib/node/launch/socket-server-launcher.spec.d.ts +17 -0
- package/lib/node/launch/socket-server-launcher.spec.d.ts.map +1 -0
- package/lib/node/launch/socket-server-launcher.spec.js +70 -0
- package/lib/node/launch/socket-server-launcher.spec.js.map +1 -0
- package/node.d.ts +16 -0
- package/node.js +18 -0
- package/package.json +77 -0
- package/src/browser/di/app-module.ts +55 -0
- package/src/browser/di/console-logger.ts +71 -0
- package/src/browser/index.ts +19 -0
- package/src/browser/launch/worker-server-launcher.ts +58 -0
- package/src/common/actions/action-dispatcher.spec.ts +290 -0
- package/src/common/actions/action-dispatcher.ts +152 -0
- package/src/common/actions/action-handler-registry.spec.ts +52 -0
- package/src/common/actions/action-handler-registry.ts +60 -0
- package/src/common/actions/action-handler.ts +62 -0
- package/src/common/actions/client-action-handler.ts +50 -0
- package/src/common/actions/global-action-provider.spec.ts +79 -0
- package/src/common/actions/global-action-provider.ts +72 -0
- package/src/common/command/command-stack.spec.ts +239 -0
- package/src/common/command/command-stack.ts +159 -0
- package/src/common/command/command.spec.ts +93 -0
- package/src/common/command/command.ts +124 -0
- package/src/common/command/recording-command.spec.ts +74 -0
- package/src/common/command/recording-command.ts +119 -0
- package/src/common/command/undo-redo-action-handler.ts +57 -0
- package/src/common/di/binding-target.spec.ts +147 -0
- package/src/common/di/binding-target.ts +188 -0
- package/src/common/di/client-session-module.ts +29 -0
- package/src/common/di/diagram-module.ts +410 -0
- package/src/common/di/glsp-module.ts +66 -0
- package/src/common/di/multi-binding.ts +89 -0
- package/src/common/di/multi-bindings.spec.ts +133 -0
- package/src/common/di/server-module.ts +131 -0
- package/src/common/di/service-identifiers.ts +39 -0
- package/src/common/diagram/diagram-configuration.ts +97 -0
- package/src/common/diagram/request-type-hints-action-handler.spec.ts +59 -0
- package/src/common/diagram/request-type-hints-action-handler.ts +36 -0
- package/src/common/features/clipboard/request-clipboard-data-action-handler.ts +51 -0
- package/src/common/features/contextactions/command-palette-action-provider.ts +94 -0
- package/src/common/features/contextactions/context-actions-provider-registry.spec.ts +69 -0
- package/src/common/features/contextactions/context-actions-provider-registry.ts +47 -0
- package/src/common/features/contextactions/context-actions-provider.ts +36 -0
- package/src/common/features/contextactions/context-menu-item-provider.ts +52 -0
- package/src/common/features/contextactions/request-context-actions-handler.spec.ts +75 -0
- package/src/common/features/contextactions/request-context-actions-handler.ts +37 -0
- package/src/common/features/contextactions/tool-palette-item-provider.spec.ts +46 -0
- package/src/common/features/contextactions/tool-palette-item-provider.ts +88 -0
- package/src/common/features/directediting/context-edit-validator-registry.spec.ts +54 -0
- package/src/common/features/directediting/context-edit-validator-registry.ts +43 -0
- package/src/common/features/directediting/context-edit-validator.ts +55 -0
- package/src/common/features/directediting/label-edit-validator.ts +35 -0
- package/src/common/features/directediting/request-edit-validation-handler.spec.ts +131 -0
- package/src/common/features/directediting/request-edit-validation-handler.ts +43 -0
- package/src/common/features/layout/computed-bounds-action-handler.ts +56 -0
- package/src/common/features/layout/layout-engine.ts +31 -0
- package/src/common/features/layout/layout-operation-handler.ts +62 -0
- package/src/common/features/model/gmodel-factory.ts +60 -0
- package/src/common/features/model/gmodel-index.ts +195 -0
- package/src/common/features/model/gmodel-serializer.spec.ts +141 -0
- package/src/common/features/model/gmodel-serializer.ts +175 -0
- package/src/common/features/model/model-state.ts +98 -0
- package/src/common/features/model/model-submission-handler.ts +110 -0
- package/src/common/features/model/request-model-action-handler.ts +67 -0
- package/src/common/features/model/save-model-action-handler.ts +37 -0
- package/src/common/features/model/source-model-storage.ts +49 -0
- package/src/common/features/navigation/json-opener-options.ts +69 -0
- package/src/common/features/navigation/navigation-target-provider-registry.ts +36 -0
- package/src/common/features/navigation/navigation-target-provider.ts +50 -0
- package/src/common/features/navigation/navigation-target-resolution.ts +22 -0
- package/src/common/features/navigation/navigation-target-resolver.ts +61 -0
- package/src/common/features/navigation/request-navigation-targets-action-handler.ts +39 -0
- package/src/common/features/navigation/resolve-navigation-targets-action-handler.ts +42 -0
- package/src/common/features/popup/popup-model-factory.ts +38 -0
- package/src/common/features/popup/request-popup-model-action-handler.ts +60 -0
- package/src/common/features/validation/model-validator.ts +34 -0
- package/src/common/features/validation/request-markers-handler.ts +51 -0
- package/src/common/gmodel/README.md +7 -0
- package/src/common/gmodel/apply-label-edit-operation-handler.ts +36 -0
- package/src/common/gmodel/change-bounds-operation-handler.ts +62 -0
- package/src/common/gmodel/change-routing-points-operation-handler.ts +40 -0
- package/src/common/gmodel/cut-operation-handler.ts +39 -0
- package/src/common/gmodel/delete-operation-handler.ts +121 -0
- package/src/common/gmodel/gmodel-create-edge-operation-handler.ts +64 -0
- package/src/common/gmodel/gmodel-create-node-operation-handler.ts +95 -0
- package/src/common/gmodel/gmodel-diagram-module.ts +76 -0
- package/src/common/gmodel/gmodel-operation-handler.ts +31 -0
- package/src/common/gmodel/index.ts +27 -0
- package/src/common/gmodel/paste-operation-handler.ts +127 -0
- package/src/common/gmodel/reconnect-edge-operation-handler.ts +56 -0
- package/src/common/index.ts +89 -0
- package/src/common/launch/glsp-server-launcher.ts +70 -0
- package/src/common/operations/compound-operation-handler.ts +40 -0
- package/src/common/operations/create-operation-handler.ts +49 -0
- package/src/common/operations/operation-action-handler.ts +93 -0
- package/src/common/operations/operation-handler-registry.spec.ts +50 -0
- package/src/common/operations/operation-handler-registry.ts +66 -0
- package/src/common/operations/operation-handler.ts +82 -0
- package/src/common/protocol/glsp-client-proxy.ts +65 -0
- package/src/common/protocol/glsp-server-listener.ts +39 -0
- package/src/common/protocol/glsp-server.spec.ts +150 -0
- package/src/common/protocol/glsp-server.ts +320 -0
- package/src/common/session/client-session-factory.spec.ts +60 -0
- package/src/common/session/client-session-factory.ts +70 -0
- package/src/common/session/client-session-initializer.ts +27 -0
- package/src/common/session/client-session-listener.ts +41 -0
- package/src/common/session/client-session-manager.spec.ts +82 -0
- package/src/common/session/client-session-manager.ts +182 -0
- package/src/common/session/client-session.ts +62 -0
- package/src/common/test/mock-util.ts +241 -0
- package/src/common/utils/args-util.ts +98 -0
- package/src/common/utils/client-options-util.ts +22 -0
- package/src/common/utils/glsp-server-error.ts +27 -0
- package/src/common/utils/layout-util.ts +164 -0
- package/src/common/utils/logger.ts +72 -0
- package/src/common/utils/promise-queue.spec.ts +138 -0
- package/src/common/utils/promise-queue.ts +103 -0
- package/src/common/utils/registry.spec.ts +223 -0
- package/src/common/utils/registry.ts +154 -0
- package/src/node/abstract-json-model-storage.ts +114 -0
- package/src/node/di/app-module.ts +102 -0
- package/src/node/di/winston-logger.ts +76 -0
- package/src/node/gmodel/gmodel-storage.ts +53 -0
- package/src/node/index.ts +23 -0
- package/src/node/launch/cli-parser.spec.ts +61 -0
- package/src/node/launch/cli-parser.ts +86 -0
- package/src/node/launch/socket-cli-parser.spec.ts +73 -0
- package/src/node/launch/socket-cli-parser.ts +52 -0
- package/src/node/launch/socket-server-launcher.spec.ts +68 -0
- package/src/node/launch/socket-server-launcher.ts +90 -0
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/********************************************************************************
|
|
3
|
+
* Copyright (c) 2022-2023 EclipseSource and others.
|
|
4
|
+
*
|
|
5
|
+
* This program and the accompanying materials are made available under the
|
|
6
|
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
+
* http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
+
*
|
|
9
|
+
* This Source Code may also be made available under the following Secondary
|
|
10
|
+
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
+
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
+
* with the GNU Classpath Exception which is available at
|
|
13
|
+
* https://www.gnu.org/software/classpath/license.html.
|
|
14
|
+
*
|
|
15
|
+
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
16
|
+
********************************************************************************/
|
|
17
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
18
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
19
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
20
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
21
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
22
|
+
};
|
|
23
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
+
exports.GModelChangeRoutingPointsOperationHandler = void 0;
|
|
25
|
+
const protocol_1 = require("@eclipse-glsp/protocol");
|
|
26
|
+
const inversify_1 = require("inversify");
|
|
27
|
+
const glsp_server_error_1 = require("../utils/glsp-server-error");
|
|
28
|
+
const layout_util_1 = require("../utils/layout-util");
|
|
29
|
+
const gmodel_operation_handler_1 = require("./gmodel-operation-handler");
|
|
30
|
+
let GModelChangeRoutingPointsOperationHandler = class GModelChangeRoutingPointsOperationHandler extends gmodel_operation_handler_1.GModelOperationHandler {
|
|
31
|
+
constructor() {
|
|
32
|
+
super(...arguments);
|
|
33
|
+
this.operationType = protocol_1.ChangeRoutingPointsOperation.KIND;
|
|
34
|
+
}
|
|
35
|
+
createCommand(operation) {
|
|
36
|
+
return this.commandOf(() => this.executeChangeRoutingPoints(operation));
|
|
37
|
+
}
|
|
38
|
+
executeChangeRoutingPoints(operation) {
|
|
39
|
+
if (!operation.newRoutingPoints) {
|
|
40
|
+
throw new glsp_server_error_1.GLSPServerError('Incomplete change routingPoints action');
|
|
41
|
+
}
|
|
42
|
+
const index = this.modelState.index;
|
|
43
|
+
operation.newRoutingPoints.forEach(routingPoints => (0, layout_util_1.applyRoutingPoints)(routingPoints, index));
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
GModelChangeRoutingPointsOperationHandler = __decorate([
|
|
47
|
+
(0, inversify_1.injectable)()
|
|
48
|
+
], GModelChangeRoutingPointsOperationHandler);
|
|
49
|
+
exports.GModelChangeRoutingPointsOperationHandler = GModelChangeRoutingPointsOperationHandler;
|
|
50
|
+
//# sourceMappingURL=change-routing-points-operation-handler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"change-routing-points-operation-handler.js","sourceRoot":"","sources":["../../../src/common/gmodel/change-routing-points-operation-handler.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;;;;;;;AAElF,qDAAoF;AACpF,yCAAuC;AAEvC,kEAA6D;AAC7D,sDAA0D;AAC1D,yEAAoE;AAG7D,IAAM,yCAAyC,GAA/C,MAAM,yCAA0C,SAAQ,iDAAsB;IAA9E;;QACH,kBAAa,GAAG,uCAA4B,CAAC,IAAI,CAAC;IActD,CAAC;IAZG,aAAa,CAAC,SAAuC;QACjD,OAAO,IAAI,CAAC,SAAS,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,0BAA0B,CAAC,SAAS,CAAC,CAAC,CAAC;IAC5E,CAAC;IAED,0BAA0B,CAAC,SAAuC;QAC9D,IAAI,CAAC,SAAS,CAAC,gBAAgB,EAAE;YAC7B,MAAM,IAAI,mCAAe,CAAC,yCAAyC,CAAC,CAAC;SACxE;QAED,MAAM,KAAK,GAAG,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC;QACpC,SAAS,CAAC,gBAAgB,CAAC,OAAO,CAAC,aAAa,CAAC,EAAE,CAAC,IAAA,gCAAkB,EAAC,aAAa,EAAE,KAAK,CAAC,CAAC,CAAC;IAClG,CAAC;CACJ,CAAA;AAfY,yCAAyC;IADrD,IAAA,sBAAU,GAAE;GACA,yCAAyC,CAerD;AAfY,8FAAyC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2022-2023 STMicroelectronics and others.
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made available under the
|
|
5
|
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
+
* http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
+
*
|
|
8
|
+
* This Source Code may also be made available under the following Secondary
|
|
9
|
+
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
+
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
+
* with the GNU Classpath Exception which is available at
|
|
12
|
+
* https://www.gnu.org/software/classpath/license.html.
|
|
13
|
+
*
|
|
14
|
+
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
|
+
********************************************************************************/
|
|
16
|
+
import { CutOperation, MaybePromise } from '@eclipse-glsp/protocol';
|
|
17
|
+
import { ActionDispatcher } from '../actions/action-dispatcher';
|
|
18
|
+
import { Command } from '../command/command';
|
|
19
|
+
import { GModelOperationHandler } from './gmodel-operation-handler';
|
|
20
|
+
export declare class GModelCutOperationHandler extends GModelOperationHandler {
|
|
21
|
+
readonly operationType = "cut";
|
|
22
|
+
protected actionDispatcher: ActionDispatcher;
|
|
23
|
+
createCommand(operation: CutOperation): MaybePromise<Command | undefined>;
|
|
24
|
+
protected getElementToCut(cutOperation: CutOperation): string[];
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=cut-operation-handler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cut-operation-handler.d.ts","sourceRoot":"","sources":["../../../src/common/gmodel/cut-operation-handler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EAAE,YAAY,EAA0B,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAE5F,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAEpE,qBACa,yBAA0B,SAAQ,sBAAsB;IACjE,QAAQ,CAAC,aAAa,SAAqB;IAG3C,SAAS,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;IAE7C,aAAa,CAAC,SAAS,EAAE,YAAY,GAAG,YAAY,CAAC,OAAO,GAAG,SAAS,CAAC;IAOzE,SAAS,CAAC,eAAe,CAAC,YAAY,EAAE,YAAY,GAAG,MAAM,EAAE;CAGlE"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.GModelCutOperationHandler = void 0;
|
|
13
|
+
/********************************************************************************
|
|
14
|
+
* Copyright (c) 2022-2023 STMicroelectronics and others.
|
|
15
|
+
*
|
|
16
|
+
* This program and the accompanying materials are made available under the
|
|
17
|
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
18
|
+
* http://www.eclipse.org/legal/epl-2.0.
|
|
19
|
+
*
|
|
20
|
+
* This Source Code may also be made available under the following Secondary
|
|
21
|
+
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
22
|
+
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
23
|
+
* with the GNU Classpath Exception which is available at
|
|
24
|
+
* https://www.gnu.org/software/classpath/license.html.
|
|
25
|
+
*
|
|
26
|
+
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
27
|
+
********************************************************************************/
|
|
28
|
+
const protocol_1 = require("@eclipse-glsp/protocol");
|
|
29
|
+
const inversify_1 = require("inversify");
|
|
30
|
+
const action_dispatcher_1 = require("../actions/action-dispatcher");
|
|
31
|
+
const gmodel_operation_handler_1 = require("./gmodel-operation-handler");
|
|
32
|
+
let GModelCutOperationHandler = class GModelCutOperationHandler extends gmodel_operation_handler_1.GModelOperationHandler {
|
|
33
|
+
constructor() {
|
|
34
|
+
super(...arguments);
|
|
35
|
+
this.operationType = protocol_1.CutOperation.KIND;
|
|
36
|
+
}
|
|
37
|
+
createCommand(operation) {
|
|
38
|
+
const cuttableElementIds = this.getElementToCut(operation);
|
|
39
|
+
return cuttableElementIds.length > 0 //
|
|
40
|
+
? this.commandOf(() => this.actionDispatcher.dispatch(protocol_1.DeleteElementOperation.create(cuttableElementIds)))
|
|
41
|
+
: undefined;
|
|
42
|
+
}
|
|
43
|
+
getElementToCut(cutOperation) {
|
|
44
|
+
return cutOperation.editorContext.selectedElementIds;
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
__decorate([
|
|
48
|
+
(0, inversify_1.inject)(action_dispatcher_1.ActionDispatcher),
|
|
49
|
+
__metadata("design:type", Object)
|
|
50
|
+
], GModelCutOperationHandler.prototype, "actionDispatcher", void 0);
|
|
51
|
+
GModelCutOperationHandler = __decorate([
|
|
52
|
+
(0, inversify_1.injectable)()
|
|
53
|
+
], GModelCutOperationHandler);
|
|
54
|
+
exports.GModelCutOperationHandler = GModelCutOperationHandler;
|
|
55
|
+
//# sourceMappingURL=cut-operation-handler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cut-operation-handler.js","sourceRoot":"","sources":["../../../src/common/gmodel/cut-operation-handler.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,qDAA4F;AAC5F,yCAA+C;AAC/C,oEAAgE;AAEhE,yEAAoE;AAG7D,IAAM,yBAAyB,GAA/B,MAAM,yBAA0B,SAAQ,iDAAsB;IAA9D;;QACM,kBAAa,GAAG,uBAAY,CAAC,IAAI,CAAC;IAe/C,CAAC;IAVG,aAAa,CAAC,SAAuB;QACjC,MAAM,kBAAkB,GAAG,IAAI,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC;QAC3D,OAAO,kBAAkB,CAAC,MAAM,GAAG,CAAC,CAAC,EAAE;YACnC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,iCAAsB,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC,CAAC;YACzG,CAAC,CAAC,SAAS,CAAC;IACpB,CAAC;IAES,eAAe,CAAC,YAA0B;QAChD,OAAO,YAAY,CAAC,aAAa,CAAC,kBAAkB,CAAC;IACzD,CAAC;CACJ,CAAA;AAbG;IAAC,IAAA,kBAAM,EAAC,oCAAgB,CAAC;;mEACoB;AAJpC,yBAAyB;IADrC,IAAA,sBAAU,GAAE;GACA,yBAAyB,CAgBrC;AAhBY,8DAAyB"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2022-2023 STMicroelectronics and others.
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made available under the
|
|
5
|
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
+
* http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
+
*
|
|
8
|
+
* This Source Code may also be made available under the following Secondary
|
|
9
|
+
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
+
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
+
* with the GNU Classpath Exception which is available at
|
|
12
|
+
* https://www.gnu.org/software/classpath/license.html.
|
|
13
|
+
*
|
|
14
|
+
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
|
+
********************************************************************************/
|
|
16
|
+
import { GModelElement } from '@eclipse-glsp/graph';
|
|
17
|
+
import { DeleteElementOperation, MaybePromise } from '@eclipse-glsp/protocol';
|
|
18
|
+
import { Command } from '../command/command';
|
|
19
|
+
import { GModelIndex } from '../features/model/gmodel-index';
|
|
20
|
+
import { Logger } from '../utils/logger';
|
|
21
|
+
import { GModelOperationHandler } from './gmodel-operation-handler';
|
|
22
|
+
export declare class GModelDeleteOperationHandler extends GModelOperationHandler {
|
|
23
|
+
protected logger: Logger;
|
|
24
|
+
protected allDependentsIds: Set<string>;
|
|
25
|
+
get operationType(): string;
|
|
26
|
+
createCommand(operation: DeleteElementOperation): MaybePromise<Command | undefined>;
|
|
27
|
+
deleteElements(elementIds: string[]): MaybePromise<void>;
|
|
28
|
+
protected delete(elementId: string, index: GModelIndex): boolean;
|
|
29
|
+
protected collectDependents(dependents: Set<GModelElement>, nodeToDelete: GModelElement): void;
|
|
30
|
+
protected findTopLevelElement(element: GModelElement): GModelElement;
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=delete-operation-handler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delete-operation-handler.d.ts","sourceRoot":"","sources":["../../../src/common/gmodel/delete-operation-handler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EAAS,aAAa,EAAS,MAAM,qBAAqB,CAAC;AAClE,OAAO,EAAE,sBAAsB,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAE9E,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAC7D,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAEpE,qBACa,4BAA6B,SAAQ,sBAAsB;IAEpE,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC;IAEzB,SAAS,CAAC,gBAAgB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAExC,IAAI,aAAa,IAAI,MAAM,CAE1B;IAED,aAAa,CAAC,SAAS,EAAE,sBAAsB,GAAG,YAAY,CAAC,OAAO,GAAG,SAAS,CAAC;IASnF,cAAc,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,YAAY,CAAC,IAAI,CAAC;IAaxD,SAAS,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,GAAG,OAAO;IA+BhE,SAAS,CAAC,iBAAiB,CAAC,UAAU,EAAE,GAAG,CAAC,aAAa,CAAC,EAAE,YAAY,EAAE,aAAa,GAAG,IAAI;IAsB9F,SAAS,CAAC,mBAAmB,CAAC,OAAO,EAAE,aAAa,GAAG,aAAa;CAWvE"}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.GModelDeleteOperationHandler = void 0;
|
|
13
|
+
/********************************************************************************
|
|
14
|
+
* Copyright (c) 2022-2023 STMicroelectronics and others.
|
|
15
|
+
*
|
|
16
|
+
* This program and the accompanying materials are made available under the
|
|
17
|
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
18
|
+
* http://www.eclipse.org/legal/epl-2.0.
|
|
19
|
+
*
|
|
20
|
+
* This Source Code may also be made available under the following Secondary
|
|
21
|
+
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
22
|
+
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
23
|
+
* with the GNU Classpath Exception which is available at
|
|
24
|
+
* https://www.gnu.org/software/classpath/license.html.
|
|
25
|
+
*
|
|
26
|
+
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
27
|
+
********************************************************************************/
|
|
28
|
+
const graph_1 = require("@eclipse-glsp/graph");
|
|
29
|
+
const protocol_1 = require("@eclipse-glsp/protocol");
|
|
30
|
+
const inversify_1 = require("inversify");
|
|
31
|
+
const logger_1 = require("../utils/logger");
|
|
32
|
+
const gmodel_operation_handler_1 = require("./gmodel-operation-handler");
|
|
33
|
+
let GModelDeleteOperationHandler = class GModelDeleteOperationHandler extends gmodel_operation_handler_1.GModelOperationHandler {
|
|
34
|
+
get operationType() {
|
|
35
|
+
return protocol_1.DeleteElementOperation.KIND;
|
|
36
|
+
}
|
|
37
|
+
createCommand(operation) {
|
|
38
|
+
const elementIds = operation.elementIds;
|
|
39
|
+
if (!elementIds || elementIds.length === 0) {
|
|
40
|
+
this.logger.warn('Elements to delete are not specified');
|
|
41
|
+
return undefined;
|
|
42
|
+
}
|
|
43
|
+
return this.commandOf(() => this.deleteElements(elementIds));
|
|
44
|
+
}
|
|
45
|
+
deleteElements(elementIds) {
|
|
46
|
+
if (!elementIds || elementIds.length === 0) {
|
|
47
|
+
this.logger.warn('Elements to delete are not specified');
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
const index = this.modelState.index;
|
|
51
|
+
this.allDependentsIds = new Set();
|
|
52
|
+
const success = elementIds.every(eId => this.delete(eId, index));
|
|
53
|
+
if (!success) {
|
|
54
|
+
this.logger.warn('Could not delete all elements as requested (see messages above to find out why)');
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
delete(elementId, index) {
|
|
58
|
+
if (this.allDependentsIds.has(elementId)) {
|
|
59
|
+
return true;
|
|
60
|
+
}
|
|
61
|
+
const element = index.find(elementId);
|
|
62
|
+
if (!element) {
|
|
63
|
+
this.logger.warn('Element not found: ' + elementId);
|
|
64
|
+
return false;
|
|
65
|
+
}
|
|
66
|
+
const nodeToDelete = this.findTopLevelElement(element);
|
|
67
|
+
if (!nodeToDelete.parent) {
|
|
68
|
+
this.logger.warn("The requested node doesn't have a parent; it can't be deleted");
|
|
69
|
+
return false;
|
|
70
|
+
}
|
|
71
|
+
const dependents = new Set();
|
|
72
|
+
this.collectDependents(dependents, nodeToDelete);
|
|
73
|
+
dependents.forEach(dependant => {
|
|
74
|
+
const index = this.modelState.root.children.findIndex(element => element === dependant);
|
|
75
|
+
if (index > -1) {
|
|
76
|
+
this.modelState.root.children.splice(index, 1);
|
|
77
|
+
}
|
|
78
|
+
this.allDependentsIds.add(dependant.id);
|
|
79
|
+
});
|
|
80
|
+
return true;
|
|
81
|
+
}
|
|
82
|
+
collectDependents(dependents, nodeToDelete) {
|
|
83
|
+
if (dependents.has(nodeToDelete)) {
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
if (nodeToDelete.children.length > 0) {
|
|
87
|
+
nodeToDelete.children.forEach(child => this.collectDependents(dependents, child));
|
|
88
|
+
}
|
|
89
|
+
if (nodeToDelete instanceof graph_1.GNode) {
|
|
90
|
+
const index = this.modelState.index;
|
|
91
|
+
index.getIncomingEdges(nodeToDelete).forEach(incoming => {
|
|
92
|
+
this.collectDependents(dependents, incoming);
|
|
93
|
+
});
|
|
94
|
+
index.getOutgoingEdges(nodeToDelete).forEach(outgoing => {
|
|
95
|
+
this.collectDependents(dependents, outgoing);
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
dependents.add(nodeToDelete);
|
|
99
|
+
}
|
|
100
|
+
findTopLevelElement(element) {
|
|
101
|
+
if (element instanceof graph_1.GNode || element instanceof graph_1.GEdge) {
|
|
102
|
+
return element;
|
|
103
|
+
}
|
|
104
|
+
const parent = element.parent;
|
|
105
|
+
if (!parent) {
|
|
106
|
+
return element;
|
|
107
|
+
}
|
|
108
|
+
return this.findTopLevelElement(parent);
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
__decorate([
|
|
112
|
+
(0, inversify_1.inject)(logger_1.Logger),
|
|
113
|
+
__metadata("design:type", logger_1.Logger)
|
|
114
|
+
], GModelDeleteOperationHandler.prototype, "logger", void 0);
|
|
115
|
+
GModelDeleteOperationHandler = __decorate([
|
|
116
|
+
(0, inversify_1.injectable)()
|
|
117
|
+
], GModelDeleteOperationHandler);
|
|
118
|
+
exports.GModelDeleteOperationHandler = GModelDeleteOperationHandler;
|
|
119
|
+
//# sourceMappingURL=delete-operation-handler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delete-operation-handler.js","sourceRoot":"","sources":["../../../src/common/gmodel/delete-operation-handler.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,+CAAkE;AAClE,qDAA8E;AAC9E,yCAA+C;AAG/C,4CAAyC;AACzC,yEAAoE;AAG7D,IAAM,4BAA4B,GAAlC,MAAM,4BAA6B,SAAQ,iDAAsB;IAMpE,IAAI,aAAa;QACb,OAAO,iCAAsB,CAAC,IAAI,CAAC;IACvC,CAAC;IAED,aAAa,CAAC,SAAiC;QAC3C,MAAM,UAAU,GAAG,SAAS,CAAC,UAAU,CAAC;QACxC,IAAI,CAAC,UAAU,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE;YACxC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,sCAAsC,CAAC,CAAC;YACzD,OAAO,SAAS,CAAC;SACpB;QACD,OAAO,IAAI,CAAC,SAAS,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC,CAAC;IACjE,CAAC;IAED,cAAc,CAAC,UAAoB;QAC/B,IAAI,CAAC,UAAU,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE;YACxC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,sCAAsC,CAAC,CAAC;YACzD,OAAO;SACV;QACD,MAAM,KAAK,GAAG,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC;QACpC,IAAI,CAAC,gBAAgB,GAAG,IAAI,GAAG,EAAU,CAAC;QAC1C,MAAM,OAAO,GAAG,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC;QACjE,IAAI,CAAC,OAAO,EAAE;YACV,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,iFAAiF,CAAC,CAAC;SACvG;IACL,CAAC;IAES,MAAM,CAAC,SAAiB,EAAE,KAAkB;QAClD,IAAI,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE;YACtC,OAAO,IAAI,CAAC;SACf;QAED,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACtC,IAAI,CAAC,OAAO,EAAE;YACV,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,qBAAqB,GAAG,SAAS,CAAC,CAAC;YACpD,OAAO,KAAK,CAAC;SAChB;QAED,MAAM,YAAY,GAAG,IAAI,CAAC,mBAAmB,CAAC,OAAO,CAAC,CAAC;QACvD,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE;YACtB,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,+DAA+D,CAAC,CAAC;YAClF,OAAO,KAAK,CAAC;SAChB;QAED,MAAM,UAAU,GAAG,IAAI,GAAG,EAAiB,CAAC;QAC5C,IAAI,CAAC,iBAAiB,CAAC,UAAU,EAAE,YAAY,CAAC,CAAC;QAEjD,UAAU,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE;YAC3B,MAAM,KAAK,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC;YACxF,IAAI,KAAK,GAAG,CAAC,CAAC,EAAE;gBACZ,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;aAClD;YACD,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;QAC5C,CAAC,CAAC,CAAC;QAEH,OAAO,IAAI,CAAC;IAChB,CAAC;IAES,iBAAiB,CAAC,UAA8B,EAAE,YAA2B;QACnF,IAAI,UAAU,CAAC,GAAG,CAAC,YAAY,CAAC,EAAE;YAC9B,OAAO;SACV;QAED,IAAI,YAAY,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE;YAClC,YAAY,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,IAAI,CAAC,iBAAiB,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC,CAAC;SACrF;QAED,IAAI,YAAY,YAAY,aAAK,EAAE;YAC/B,MAAM,KAAK,GAAG,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC;YACpC,KAAK,CAAC,gBAAgB,CAAC,YAAY,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;gBACpD,IAAI,CAAC,iBAAiB,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;YACjD,CAAC,CAAC,CAAC;YACH,KAAK,CAAC,gBAAgB,CAAC,YAAY,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;gBACpD,IAAI,CAAC,iBAAiB,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;YACjD,CAAC,CAAC,CAAC;SACN;QAED,UAAU,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;IACjC,CAAC;IAES,mBAAmB,CAAC,OAAsB;QAChD,IAAI,OAAO,YAAY,aAAK,IAAI,OAAO,YAAY,aAAK,EAAE;YACtD,OAAO,OAAO,CAAC;SAClB;QAED,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;QAC9B,IAAI,CAAC,MAAM,EAAE;YACT,OAAO,OAAO,CAAC;SAClB;QACD,OAAO,IAAI,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC;IAC5C,CAAC;CACJ,CAAA;AA/FG;IAAC,IAAA,kBAAM,EAAC,eAAM,CAAC;8BACG,eAAM;4DAAC;AAFhB,4BAA4B;IADxC,IAAA,sBAAU,GAAE;GACA,4BAA4B,CAgGxC;AAhGY,oEAA4B"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2022-2023 STMicroelectronics and others.
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made available under the
|
|
5
|
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
+
* http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
+
*
|
|
8
|
+
* This Source Code may also be made available under the following Secondary
|
|
9
|
+
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
+
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
+
* with the GNU Classpath Exception which is available at
|
|
12
|
+
* https://www.gnu.org/software/classpath/license.html.
|
|
13
|
+
*
|
|
14
|
+
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
|
+
********************************************************************************/
|
|
16
|
+
import { GEdge, GModelElement } from '@eclipse-glsp/graph';
|
|
17
|
+
import { CreateEdgeOperation, MaybePromise, TriggerEdgeCreationAction } from '@eclipse-glsp/protocol';
|
|
18
|
+
import { Command } from '../command/command';
|
|
19
|
+
import { CreateOperationHandler, CreateOperationKind } from '../operations/create-operation-handler';
|
|
20
|
+
import { GModelOperationHandler } from './gmodel-operation-handler';
|
|
21
|
+
/**
|
|
22
|
+
* An abstract base implementation of {@link CreateEdgeOperation} handlers for diagram implementations
|
|
23
|
+
* where the graphical model is also directly used as source model.
|
|
24
|
+
* (i.e. all operation handlers directly modify the graphical model).
|
|
25
|
+
*/
|
|
26
|
+
export declare abstract class GModelCreateEdgeOperationHandler extends GModelOperationHandler implements CreateOperationHandler {
|
|
27
|
+
readonly operationType: CreateOperationKind;
|
|
28
|
+
abstract label: string;
|
|
29
|
+
abstract elementTypeIds: string[];
|
|
30
|
+
createCommand(operation: CreateEdgeOperation): MaybePromise<Command | undefined>;
|
|
31
|
+
getTriggerActions(): TriggerEdgeCreationAction[];
|
|
32
|
+
executeCreation(operation: CreateEdgeOperation): void;
|
|
33
|
+
abstract createEdge(source: GModelElement, target: GModelElement): GEdge | undefined;
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=gmodel-create-edge-operation-handler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gmodel-create-edge-operation-handler.d.ts","sourceRoot":"","sources":["../../../src/common/gmodel/gmodel-create-edge-operation-handler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAElF,OAAO,EAAE,KAAK,EAAE,aAAa,EAAS,MAAM,qBAAqB,CAAC;AAElE,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AAEtG,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AACrG,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAEpE;;;;GAIG;AACH,8BACsB,gCAAiC,SAAQ,sBAAuB,YAAW,sBAAsB;IACnH,SAAkB,aAAa,EAAE,mBAAmB,CAA4B;IAChF,SAAkB,KAAK,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,cAAc,EAAE,MAAM,EAAE,CAAC;IAEzB,aAAa,CAAC,SAAS,EAAE,mBAAmB,GAAG,YAAY,CAAC,OAAO,GAAG,SAAS,CAAC;IAIzF,iBAAiB,IAAI,yBAAyB,EAAE;IAIhD,eAAe,CAAC,SAAS,EAAE,mBAAmB,GAAG,IAAI;IAmBrD,QAAQ,CAAC,UAAU,CAAC,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,aAAa,GAAG,KAAK,GAAG,SAAS;CACvF"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/********************************************************************************
|
|
3
|
+
* Copyright (c) 2022-2023 STMicroelectronics and others.
|
|
4
|
+
*
|
|
5
|
+
* This program and the accompanying materials are made available under the
|
|
6
|
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
+
* http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
+
*
|
|
9
|
+
* This Source Code may also be made available under the following Secondary
|
|
10
|
+
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
+
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
+
* with the GNU Classpath Exception which is available at
|
|
13
|
+
* https://www.gnu.org/software/classpath/license.html.
|
|
14
|
+
*
|
|
15
|
+
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
16
|
+
********************************************************************************/
|
|
17
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
18
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
19
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
20
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
21
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
22
|
+
};
|
|
23
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
+
exports.GModelCreateEdgeOperationHandler = void 0;
|
|
25
|
+
const graph_1 = require("@eclipse-glsp/graph");
|
|
26
|
+
const gnode_1 = require("@eclipse-glsp/graph/lib/gnode");
|
|
27
|
+
const protocol_1 = require("@eclipse-glsp/protocol");
|
|
28
|
+
const inversify_1 = require("inversify");
|
|
29
|
+
const gmodel_operation_handler_1 = require("./gmodel-operation-handler");
|
|
30
|
+
/**
|
|
31
|
+
* An abstract base implementation of {@link CreateEdgeOperation} handlers for diagram implementations
|
|
32
|
+
* where the graphical model is also directly used as source model.
|
|
33
|
+
* (i.e. all operation handlers directly modify the graphical model).
|
|
34
|
+
*/
|
|
35
|
+
let GModelCreateEdgeOperationHandler = class GModelCreateEdgeOperationHandler extends gmodel_operation_handler_1.GModelOperationHandler {
|
|
36
|
+
constructor() {
|
|
37
|
+
super(...arguments);
|
|
38
|
+
this.operationType = protocol_1.CreateEdgeOperation.KIND;
|
|
39
|
+
}
|
|
40
|
+
createCommand(operation) {
|
|
41
|
+
return this.commandOf(() => this.executeCreation(operation));
|
|
42
|
+
}
|
|
43
|
+
getTriggerActions() {
|
|
44
|
+
return this.elementTypeIds.map(typeId => protocol_1.TriggerEdgeCreationAction.create(typeId));
|
|
45
|
+
}
|
|
46
|
+
executeCreation(operation) {
|
|
47
|
+
const index = this.modelState.index;
|
|
48
|
+
const source = index.find(operation.sourceElementId, element => element instanceof gnode_1.GNode || element instanceof graph_1.GPort);
|
|
49
|
+
const target = index.find(operation.targetElementId, element => element instanceof gnode_1.GNode || element instanceof graph_1.GPort);
|
|
50
|
+
if (!source || !target) {
|
|
51
|
+
throw new Error(`Invalid source or target for source ID ${operation.sourceElementId} and target ID ${operation.targetElementId}`);
|
|
52
|
+
}
|
|
53
|
+
const connection = this.createEdge(source, target);
|
|
54
|
+
if (connection) {
|
|
55
|
+
const currentModel = this.modelState.root;
|
|
56
|
+
currentModel.children.push(connection);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
GModelCreateEdgeOperationHandler = __decorate([
|
|
61
|
+
(0, inversify_1.injectable)()
|
|
62
|
+
], GModelCreateEdgeOperationHandler);
|
|
63
|
+
exports.GModelCreateEdgeOperationHandler = GModelCreateEdgeOperationHandler;
|
|
64
|
+
//# sourceMappingURL=gmodel-create-edge-operation-handler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gmodel-create-edge-operation-handler.js","sourceRoot":"","sources":["../../../src/common/gmodel/gmodel-create-edge-operation-handler.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;;;;;;;AAElF,+CAAkE;AAClE,yDAAsD;AACtD,qDAAsG;AACtG,yCAAuC;AAGvC,yEAAoE;AAEpE;;;;GAIG;AAEI,IAAe,gCAAgC,GAA/C,MAAe,gCAAiC,SAAQ,iDAAsB;IAA9E;;QACe,kBAAa,GAAwB,8BAAmB,CAAC,IAAI,CAAC;IAgCpF,CAAC;IA5BY,aAAa,CAAC,SAA8B;QACjD,OAAO,IAAI,CAAC,SAAS,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC,CAAC;IACjE,CAAC;IAED,iBAAiB;QACb,OAAO,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,oCAAyB,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;IACvF,CAAC;IAED,eAAe,CAAC,SAA8B;QAC1C,MAAM,KAAK,GAAG,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC;QAEpC,MAAM,MAAM,GAAG,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,eAAe,EAAE,OAAO,CAAC,EAAE,CAAC,OAAO,YAAY,aAAK,IAAI,OAAO,YAAY,aAAK,CAAC,CAAC;QACtH,MAAM,MAAM,GAAG,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,eAAe,EAAE,OAAO,CAAC,EAAE,CAAC,OAAO,YAAY,aAAK,IAAI,OAAO,YAAY,aAAK,CAAC,CAAC;QAEtH,IAAI,CAAC,MAAM,IAAI,CAAC,MAAM,EAAE;YACpB,MAAM,IAAI,KAAK,CACX,0CAA0C,SAAS,CAAC,eAAe,kBAAkB,SAAS,CAAC,eAAe,EAAE,CACnH,CAAC;SACL;QAED,MAAM,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QACnD,IAAI,UAAU,EAAE;YACZ,MAAM,YAAY,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;YAC1C,YAAY,CAAC,QAAQ,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;SAC1C;IACL,CAAC;CAGJ,CAAA;AAjCqB,gCAAgC;IADrD,IAAA,sBAAU,GAAE;GACS,gCAAgC,CAiCrD;AAjCqB,4EAAgC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2022-2023 EclipseSource and others.
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made available under the
|
|
5
|
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
+
* http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
+
*
|
|
8
|
+
* This Source Code may also be made available under the following Secondary
|
|
9
|
+
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
+
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
+
* with the GNU Classpath Exception which is available at
|
|
12
|
+
* https://www.gnu.org/software/classpath/license.html.
|
|
13
|
+
*
|
|
14
|
+
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
|
+
********************************************************************************/
|
|
16
|
+
import { GModelElement, GNode } from '@eclipse-glsp/graph';
|
|
17
|
+
import { CreateNodeOperation, MaybePromise, Point, TriggerNodeCreationAction } from '@eclipse-glsp/protocol';
|
|
18
|
+
import { ActionDispatcher } from '../actions/action-dispatcher';
|
|
19
|
+
import { Command } from '../command/command';
|
|
20
|
+
import { CreateOperationHandler, CreateOperationKind } from '../operations/create-operation-handler';
|
|
21
|
+
import { GModelOperationHandler } from './gmodel-operation-handler';
|
|
22
|
+
/**
|
|
23
|
+
* An abstract base implementation of {@link CreateNodeOperationHandler} for diagram implementations
|
|
24
|
+
* where the graphical model is also directly used as source model.
|
|
25
|
+
* (i.e. all operation handlers directly modify the graphical model).
|
|
26
|
+
*/
|
|
27
|
+
export declare abstract class GModelCreateNodeOperationHandler extends GModelOperationHandler implements CreateOperationHandler {
|
|
28
|
+
protected actionDispatcher: ActionDispatcher;
|
|
29
|
+
abstract elementTypeIds: string[];
|
|
30
|
+
abstract label: string;
|
|
31
|
+
operationType: CreateOperationKind;
|
|
32
|
+
createCommand(operation: CreateNodeOperation): MaybePromise<Command | undefined>;
|
|
33
|
+
executeCreation(operation: CreateNodeOperation): void;
|
|
34
|
+
getTriggerActions(): TriggerNodeCreationAction[];
|
|
35
|
+
/**
|
|
36
|
+
* Return the GModelElement that will contain the newly created node. It is usually
|
|
37
|
+
* the target element ({@link CreateNodeOperation.containerId}), but could also
|
|
38
|
+
* be e.g. an intermediate compartment, or even a different Node.
|
|
39
|
+
*
|
|
40
|
+
* @param operation
|
|
41
|
+
* @return the GModelElement that will contain the newly created node.
|
|
42
|
+
*/
|
|
43
|
+
getContainer(operation: CreateNodeOperation): GModelElement | undefined;
|
|
44
|
+
getLocation(operation: CreateNodeOperation): Point | undefined;
|
|
45
|
+
/**
|
|
46
|
+
* Retrieves the diagram absolute location and the target container from the given {@link CreateNodeOperation}
|
|
47
|
+
* and converts the absolute location to coordinates relative to the given container.
|
|
48
|
+
* Relative coordinates can only be retrieved if the given container element is part of
|
|
49
|
+
* a hierarchy of {@link GBoundsAware} elements. This means each (recursive) parent element need to
|
|
50
|
+
* implement {@link GBoundsAware}. If that is not the case this method returns `undefined`.
|
|
51
|
+
* @param absoluteLocation The diagram absolute position.
|
|
52
|
+
* @param container The container element.
|
|
53
|
+
* @returns The relative position or `undefined`.
|
|
54
|
+
*/
|
|
55
|
+
getRelativeLocation(operation: CreateNodeOperation): Point | undefined;
|
|
56
|
+
abstract createNode(operation: CreateNodeOperation, relativeLocation?: Point): GNode | undefined;
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=gmodel-create-node-operation-handler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gmodel-create-node-operation-handler.d.ts","sourceRoot":"","sources":["../../../src/common/gmodel/gmodel-create-node-operation-handler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAElF,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAE,KAAK,EAAgB,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AAE3H,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAErG,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAEpE;;;;GAIG;AACH,8BACsB,gCAAiC,SAAQ,sBAAuB,YAAW,sBAAsB;IAEnH,SAAS,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;IAE7C,QAAQ,CAAC,cAAc,EAAE,MAAM,EAAE,CAAC;IAElC,SAAkB,KAAK,EAAE,MAAM,CAAC;IAEvB,aAAa,EAAE,mBAAmB,CAA4B;IAE9D,aAAa,CAAC,SAAS,EAAE,mBAAmB,GAAG,YAAY,CAAC,OAAO,GAAG,SAAS,CAAC;IAIzF,eAAe,CAAC,SAAS,EAAE,mBAAmB,GAAG,IAAI;IAWrD,iBAAiB,IAAI,yBAAyB,EAAE;IAIhD;;;;;;;OAOG;IACH,YAAY,CAAC,SAAS,EAAE,mBAAmB,GAAG,aAAa,GAAG,SAAS;IAKvE,WAAW,CAAC,SAAS,EAAE,mBAAmB,GAAG,KAAK,GAAG,SAAS;IAI9D;;;;;;;;;OASG;IACH,mBAAmB,CAAC,SAAS,EAAE,mBAAmB,GAAG,KAAK,GAAG,SAAS;IAMtE,QAAQ,CAAC,UAAU,CAAC,SAAS,EAAE,mBAAmB,EAAE,gBAAgB,CAAC,EAAE,KAAK,GAAG,KAAK,GAAG,SAAS;CACnG"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/********************************************************************************
|
|
3
|
+
* Copyright (c) 2022-2023 EclipseSource and others.
|
|
4
|
+
*
|
|
5
|
+
* This program and the accompanying materials are made available under the
|
|
6
|
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
+
* http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
+
*
|
|
9
|
+
* This Source Code may also be made available under the following Secondary
|
|
10
|
+
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
+
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
+
* with the GNU Classpath Exception which is available at
|
|
13
|
+
* https://www.gnu.org/software/classpath/license.html.
|
|
14
|
+
*
|
|
15
|
+
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
16
|
+
********************************************************************************/
|
|
17
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
18
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
19
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
20
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
21
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
22
|
+
};
|
|
23
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
24
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
25
|
+
};
|
|
26
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
+
exports.GModelCreateNodeOperationHandler = void 0;
|
|
28
|
+
const protocol_1 = require("@eclipse-glsp/protocol");
|
|
29
|
+
const inversify_1 = require("inversify");
|
|
30
|
+
const action_dispatcher_1 = require("../actions/action-dispatcher");
|
|
31
|
+
const layout_util_1 = require("../utils/layout-util");
|
|
32
|
+
const gmodel_operation_handler_1 = require("./gmodel-operation-handler");
|
|
33
|
+
/**
|
|
34
|
+
* An abstract base implementation of {@link CreateNodeOperationHandler} for diagram implementations
|
|
35
|
+
* where the graphical model is also directly used as source model.
|
|
36
|
+
* (i.e. all operation handlers directly modify the graphical model).
|
|
37
|
+
*/
|
|
38
|
+
let GModelCreateNodeOperationHandler = class GModelCreateNodeOperationHandler extends gmodel_operation_handler_1.GModelOperationHandler {
|
|
39
|
+
constructor() {
|
|
40
|
+
super(...arguments);
|
|
41
|
+
this.operationType = protocol_1.CreateNodeOperation.KIND;
|
|
42
|
+
}
|
|
43
|
+
createCommand(operation) {
|
|
44
|
+
return this.commandOf(() => this.executeCreation(operation));
|
|
45
|
+
}
|
|
46
|
+
executeCreation(operation) {
|
|
47
|
+
var _a;
|
|
48
|
+
const container = (_a = this.getContainer(operation)) !== null && _a !== void 0 ? _a : this.modelState.root;
|
|
49
|
+
const relativeLocation = this.getRelativeLocation(operation);
|
|
50
|
+
const element = this.createNode(operation, relativeLocation);
|
|
51
|
+
if (element) {
|
|
52
|
+
container.children.push(element);
|
|
53
|
+
element.parent = container;
|
|
54
|
+
this.actionDispatcher.dispatchAfterNextUpdate(protocol_1.SelectAction.create({ selectedElementsIDs: [element.id] }));
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
getTriggerActions() {
|
|
58
|
+
return this.elementTypeIds.map(typeId => protocol_1.TriggerNodeCreationAction.create(typeId));
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Return the GModelElement that will contain the newly created node. It is usually
|
|
62
|
+
* the target element ({@link CreateNodeOperation.containerId}), but could also
|
|
63
|
+
* be e.g. an intermediate compartment, or even a different Node.
|
|
64
|
+
*
|
|
65
|
+
* @param operation
|
|
66
|
+
* @return the GModelElement that will contain the newly created node.
|
|
67
|
+
*/
|
|
68
|
+
getContainer(operation) {
|
|
69
|
+
const index = this.modelState.index;
|
|
70
|
+
return operation.containerId ? index.get(operation.containerId) : undefined;
|
|
71
|
+
}
|
|
72
|
+
getLocation(operation) {
|
|
73
|
+
return operation.location;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Retrieves the diagram absolute location and the target container from the given {@link CreateNodeOperation}
|
|
77
|
+
* and converts the absolute location to coordinates relative to the given container.
|
|
78
|
+
* Relative coordinates can only be retrieved if the given container element is part of
|
|
79
|
+
* a hierarchy of {@link GBoundsAware} elements. This means each (recursive) parent element need to
|
|
80
|
+
* implement {@link GBoundsAware}. If that is not the case this method returns `undefined`.
|
|
81
|
+
* @param absoluteLocation The diagram absolute position.
|
|
82
|
+
* @param container The container element.
|
|
83
|
+
* @returns The relative position or `undefined`.
|
|
84
|
+
*/
|
|
85
|
+
getRelativeLocation(operation) {
|
|
86
|
+
var _a, _b;
|
|
87
|
+
const container = (_a = this.getContainer(operation)) !== null && _a !== void 0 ? _a : this.modelState.root;
|
|
88
|
+
const absoluteLocation = (_b = this.getLocation(operation)) !== null && _b !== void 0 ? _b : protocol_1.Point.ORIGIN;
|
|
89
|
+
return (0, layout_util_1.getRelativeLocation)(absoluteLocation, container);
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
__decorate([
|
|
93
|
+
(0, inversify_1.inject)(action_dispatcher_1.ActionDispatcher),
|
|
94
|
+
__metadata("design:type", Object)
|
|
95
|
+
], GModelCreateNodeOperationHandler.prototype, "actionDispatcher", void 0);
|
|
96
|
+
GModelCreateNodeOperationHandler = __decorate([
|
|
97
|
+
(0, inversify_1.injectable)()
|
|
98
|
+
], GModelCreateNodeOperationHandler);
|
|
99
|
+
exports.GModelCreateNodeOperationHandler = GModelCreateNodeOperationHandler;
|
|
100
|
+
//# sourceMappingURL=gmodel-create-node-operation-handler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gmodel-create-node-operation-handler.js","sourceRoot":"","sources":["../../../src/common/gmodel/gmodel-create-node-operation-handler.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;;;;;;;;;;AAGlF,qDAA2H;AAC3H,yCAA+C;AAC/C,oEAAgE;AAGhE,sDAA2D;AAC3D,yEAAoE;AAEpE;;;;GAIG;AAEI,IAAe,gCAAgC,GAA/C,MAAe,gCAAiC,SAAQ,iDAAsB;IAA9E;;QAQM,kBAAa,GAAwB,8BAAmB,CAAC,IAAI,CAAC;IAuD3E,CAAC;IArDY,aAAa,CAAC,SAA8B;QACjD,OAAO,IAAI,CAAC,SAAS,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC,CAAC;IACjE,CAAC;IAED,eAAe,CAAC,SAA8B;;QAC1C,MAAM,SAAS,GAAG,MAAA,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC,mCAAI,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;QACvE,MAAM,gBAAgB,GAAG,IAAI,CAAC,mBAAmB,CAAC,SAAS,CAAC,CAAC;QAC7D,MAAM,OAAO,GAAG,IAAI,CAAC,UAAU,CAAC,SAAS,EAAE,gBAAgB,CAAC,CAAC;QAC7D,IAAI,OAAO,EAAE;YACT,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YACjC,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;YAC3B,IAAI,CAAC,gBAAgB,CAAC,uBAAuB,CAAC,uBAAY,CAAC,MAAM,CAAC,EAAE,mBAAmB,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;SAC7G;IACL,CAAC;IAED,iBAAiB;QACb,OAAO,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,oCAAyB,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;IACvF,CAAC;IAED;;;;;;;OAOG;IACH,YAAY,CAAC,SAA8B;QACvC,MAAM,KAAK,GAAG,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC;QACpC,OAAO,SAAS,CAAC,WAAW,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAChF,CAAC;IAED,WAAW,CAAC,SAA8B;QACtC,OAAO,SAAS,CAAC,QAAQ,CAAC;IAC9B,CAAC;IAED;;;;;;;;;OASG;IACH,mBAAmB,CAAC,SAA8B;;QAC9C,MAAM,SAAS,GAAG,MAAA,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC,mCAAI,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;QACvE,MAAM,gBAAgB,GAAG,MAAA,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,mCAAI,gBAAK,CAAC,MAAM,CAAC;QACrE,OAAO,IAAA,iCAAmB,EAAC,gBAAgB,EAAE,SAAS,CAAC,CAAC;IAC5D,CAAC;CAGJ,CAAA;AA9DG;IAAC,IAAA,kBAAM,EAAC,oCAAgB,CAAC;;0EACoB;AAF3B,gCAAgC;IADrD,IAAA,sBAAU,GAAE;GACS,gCAAgC,CA+DrD;AA/DqB,4EAAgC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ActionHandlerConstructor } from '../actions/action-handler';
|
|
2
|
+
import { BindingTarget } from '../di/binding-target';
|
|
3
|
+
import { DiagramModule } from '../di/diagram-module';
|
|
4
|
+
import { InstanceMultiBinding } from '../di/multi-binding';
|
|
5
|
+
import { GModelFactory } from '../features/model/gmodel-factory';
|
|
6
|
+
import { ModelState } from '../features/model/model-state';
|
|
7
|
+
import { OperationHandlerConstructor } from '../operations/operation-handler';
|
|
8
|
+
/**
|
|
9
|
+
* Extension of the {@link DiagramModule} to provide GModel integration.
|
|
10
|
+
*
|
|
11
|
+
* Contains all bindings of {@link DiagramModule}.
|
|
12
|
+
*
|
|
13
|
+
* Additionally binds:
|
|
14
|
+
* - {@link GModelFactory} to {@link GModelFactoryNullImpl}
|
|
15
|
+
* - {@link RequestClipboardDataActionHandler} to {@link ActionHandler}
|
|
16
|
+
* - {@link GModelApplyLabelEditOperationHandler} to {@link OperationHandler}
|
|
17
|
+
* - {@link GModelChangeBoundsOperationHandler} to {@link OperationHandler}
|
|
18
|
+
* - {@link GModelCutOperationHandler} to {@link OperationHandler}
|
|
19
|
+
* - {@link GModelDeleteOperationHandler} to {@link OperationHandler}
|
|
20
|
+
* - {@link GModelPasteOperationHandler} to {@link OperationHandler}
|
|
21
|
+
* - {@link GModelReconnectEdgeOperationHandler} to {@link OperationHandler}
|
|
22
|
+
* - {@link GModelChangeRoutingPointsOperationHandler} to {@link OperationHandler}
|
|
23
|
+
|
|
24
|
+
*/
|
|
25
|
+
export declare abstract class GModelDiagramModule extends DiagramModule {
|
|
26
|
+
protected bindGModelFactory(): BindingTarget<GModelFactory>;
|
|
27
|
+
protected bindModelState(): BindingTarget<ModelState>;
|
|
28
|
+
protected configureActionHandlers(binding: InstanceMultiBinding<ActionHandlerConstructor>): void;
|
|
29
|
+
protected configureOperationHandlers(binding: InstanceMultiBinding<OperationHandlerConstructor>): void;
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=gmodel-diagram-module.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gmodel-diagram-module.d.ts","sourceRoot":"","sources":["../../../src/common/gmodel/gmodel-diagram-module.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAE3D,OAAO,EAAE,aAAa,EAAyB,MAAM,kCAAkC,CAAC;AACxF,OAAO,EAAqB,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAE9E,OAAO,EAAoB,2BAA2B,EAAE,MAAM,iCAAiC,CAAC;AAShG;;;;;;;;;;;;;;;;GAgBG;AACH,8BACsB,mBAAoB,SAAQ,aAAa;cACxC,iBAAiB,IAAI,aAAa,CAAC,aAAa,CAAC;IAIpE,SAAS,CAAC,cAAc,IAAI,aAAa,CAAC,UAAU,CAAC;cAIlC,uBAAuB,CAAC,OAAO,EAAE,oBAAoB,CAAC,wBAAwB,CAAC,GAAG,IAAI;cAKtF,0BAA0B,CAAC,OAAO,EAAE,oBAAoB,CAAC,2BAA2B,CAAC,GAAG,IAAI;CAUlH"}
|