@emuanalytics/flow-rdf-ui 4.2.0 → 4.3.0
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/README.md +58 -0
- package/THIRD_PARTY_NOTICES.md +220 -0
- package/dist/components/alert/alert.component.mjs +3 -0
- package/dist/components/animation/animation.component.mjs +1 -0
- package/dist/components/autocomplete/autocomplete.component.mjs +38 -14
- package/dist/components/avatar/avatar.component.mjs +3 -0
- package/dist/components/badge/badge.component.mjs +1 -0
- package/dist/components/base-control/base-control.component.mjs +3 -0
- package/dist/components/breadcrumb/breadcrumb.component.mjs +3 -0
- package/dist/components/breadcrumb-item/breadcrumb-item.component.mjs +1 -0
- package/dist/components/busy-overlay/busy-overlay.component.mjs +3 -0
- package/dist/components/button/button.component.mjs +4 -0
- package/dist/components/button-group/button-group.component.mjs +1 -0
- package/dist/components/calendar/calendar.component.mjs +6 -0
- package/dist/components/card/card.component.mjs +1 -0
- package/dist/components/carousel/carousel.component.mjs +3 -0
- package/dist/components/carousel-item/carousel-item.component.mjs +1 -0
- package/dist/components/chart/chart.component.mjs +1 -0
- package/dist/components/chart/chartjs-plugins/luxon.adapter.mjs +78 -0
- package/dist/components/chart/chartjs-support.mjs +2 -0
- package/dist/components/checkbox/checkbox.component.mjs +3 -0
- package/dist/components/checkbox-group/checkbox-group.component.mjs +3 -0
- package/dist/components/color-mapper/color-mapper.component.mjs +21 -0
- package/dist/components/color-picker/color-picker.component.mjs +8 -0
- package/dist/components/color-stop/color-stop.component.mjs +17 -0
- package/dist/components/date-time-picker/date-time-picker.component.mjs +6 -0
- package/dist/components/details/details.component.mjs +3 -0
- package/dist/components/diagram/diagram-panel.styles.mjs +44 -0
- package/dist/components/diagram/diagram-tokens.styles.mjs +148 -0
- package/dist/components/diagram/diagram.component.mjs +355 -0
- package/dist/components/diagram/diagram.mjs +5 -0
- package/dist/components/diagram/diagram.styles.mjs +95 -0
- package/dist/components/diagram-background/diagram-background.component.mjs +163 -0
- package/dist/components/diagram-background/diagram-background.mjs +5 -0
- package/dist/components/diagram-background/diagram-background.styles.mjs +58 -0
- package/dist/components/diagram-base-edge/diagram-base-edge.component.mjs +326 -0
- package/dist/components/diagram-base-edge/diagram-base-edge.mjs +5 -0
- package/dist/components/diagram-base-edge/diagram-base-edge.styles.mjs +147 -0
- package/dist/components/diagram-base-node/diagram-base-node.component.mjs +84 -0
- package/dist/components/diagram-base-node/diagram-base-node.mjs +5 -0
- package/dist/components/diagram-base-node/diagram-base-node.styles.mjs +37 -0
- package/dist/components/diagram-edge/diagram-edge.component.mjs +56 -0
- package/dist/components/diagram-edge/diagram-edge.mjs +5 -0
- package/dist/components/diagram-edge/diagram-edge.styles.mjs +37 -0
- package/dist/components/diagram-edge-label/diagram-edge-label.component.mjs +202 -0
- package/dist/components/diagram-edge-label/diagram-edge-label.mjs +5 -0
- package/dist/components/diagram-edge-label/diagram-edge-label.styles.mjs +54 -0
- package/dist/components/diagram-marker/diagram-marker.component.mjs +84 -0
- package/dist/components/diagram-marker/diagram-marker.mjs +5 -0
- package/dist/components/diagram-marker/diagram-marker.styles.mjs +9 -0
- package/dist/components/diagram-minimap/diagram-minimap.component.mjs +298 -0
- package/dist/components/diagram-minimap/diagram-minimap.mjs +5 -0
- package/dist/components/diagram-minimap/diagram-minimap.styles.mjs +83 -0
- package/dist/components/diagram-node/diagram-node-template.styles.mjs +36 -0
- package/dist/components/diagram-node/diagram-node.component.mjs +183 -0
- package/dist/components/diagram-node/diagram-node.mjs +6 -0
- package/dist/components/diagram-node/diagram-node.styles.mjs +29 -0
- package/dist/components/diagram-palette-item/diagram-palette-item.component.mjs +168 -0
- package/dist/components/diagram-palette-item/diagram-palette-item.mjs +5 -0
- package/dist/components/diagram-palette-item/diagram-palette-item.styles.mjs +20 -0
- package/dist/components/diagram-palette-item-preview/diagram-palette-item-preview.component.mjs +245 -0
- package/dist/components/diagram-palette-item-preview/diagram-palette-item-preview.mjs +6 -0
- package/dist/components/diagram-palette-item-preview/diagram-palette-item-preview.styles.mjs +41 -0
- package/dist/components/diagram-port/diagram-port.component.mjs +273 -0
- package/dist/components/diagram-port/diagram-port.mjs +5 -0
- package/dist/components/diagram-port/diagram-port.styles.mjs +116 -0
- package/dist/components/diagram-resize-adornment/diagram-resize-adornment.component.mjs +124 -0
- package/dist/components/diagram-resize-adornment/diagram-resize-adornment.mjs +5 -0
- package/dist/components/diagram-resize-adornment/diagram-resize-adornment.styles.mjs +136 -0
- package/dist/components/diagram-rotate-adornment/diagram-rotate-adornment.component.mjs +125 -0
- package/dist/components/diagram-rotate-adornment/diagram-rotate-adornment.mjs +5 -0
- package/dist/components/diagram-rotate-adornment/diagram-rotate-adornment.styles.mjs +65 -0
- package/dist/components/diagram-zoom-controls/diagram-zoom-controls.component.mjs +158 -0
- package/dist/components/diagram-zoom-controls/diagram-zoom-controls.mjs +5 -0
- package/dist/components/diagram-zoom-controls/diagram-zoom-controls.styles.mjs +66 -0
- package/dist/components/dialog/dialog.component.mjs +4 -0
- package/dist/components/divider/divider.component.mjs +1 -0
- package/dist/components/drawer/drawer.component.mjs +3 -0
- package/dist/components/dropdown/dropdown.component.mjs +2 -1
- package/dist/components/form-group/form-group.component.mjs +1 -0
- package/dist/components/gauge/gauge.component.mjs +6 -0
- package/dist/components/icon/icon.component.mjs +1 -0
- package/dist/components/icon/library.system.mjs +2 -0
- package/dist/components/icon-button/icon-button.component.mjs +5 -0
- package/dist/components/input/input.component.mjs +5 -0
- package/dist/components/list/list.component.mjs +1 -0
- package/dist/components/list-item/list-item.component.mjs +17 -0
- package/dist/components/map/map.component.mjs +3 -0
- package/dist/components/map/map.styles.mjs +10 -0
- package/dist/components/menu/menu.component.mjs +1 -0
- package/dist/components/menu-item/menu-item.component.mjs +3 -0
- package/dist/components/menu-label/menu-label.component.mjs +1 -0
- package/dist/components/mutation-observer/mutation-observer.component.mjs +1 -0
- package/dist/components/option/option.component.mjs +2 -1
- package/dist/components/panel/panel.component.mjs +85 -1
- package/dist/components/panel/panel.styles.mjs +29 -0
- package/dist/components/panel-header/panel-header.component.mjs +3 -0
- package/dist/components/popup/popup.component.mjs +1 -0
- package/dist/components/progress-bar/progress-bar.component.mjs +1 -0
- package/dist/components/progress-ring/progress-ring.component.mjs +1 -0
- package/dist/components/query-builder/query-builder.component.mjs +27 -0
- package/dist/components/radio/radio.component.mjs +3 -0
- package/dist/components/radio-group/radio-group.component.mjs +3 -0
- package/dist/components/range/range.component.mjs +9 -0
- package/dist/components/resize-observer/resize-observer.component.mjs +1 -0
- package/dist/components/scroll-view/scroll-view.component.mjs +1 -0
- package/dist/components/select/select.component.mjs +3 -5
- package/dist/components/split-view/split-view-layout-registry.mjs +44 -0
- package/dist/components/split-view/split-view-layout.mjs +607 -0
- package/dist/components/split-view/split-view.component.mjs +502 -468
- package/dist/components/split-view/split-view.styles.mjs +25 -0
- package/dist/components/split-view-divider/split-view-divider.component.mjs +2 -53
- package/dist/components/split-view-divider/split-view-divider.styles.mjs +28 -16
- package/dist/components/split-view-pane/split-view-pane.component.mjs +197 -18
- package/dist/components/split-view-pane/split-view-pane.styles.mjs +52 -0
- package/dist/components/split-view-toggle-button/split-view-toggle-button.component.mjs +5 -0
- package/dist/components/stepper/stepper.component.mjs +1 -0
- package/dist/components/stepper-panel/stepper-panel.component.mjs +1 -0
- package/dist/components/switch/switch.component.mjs +3 -0
- package/dist/components/tab/tab.component.mjs +4 -0
- package/dist/components/tab-group/tab-group.component.mjs +176 -6
- package/dist/components/tab-group/tab-group.styles.mjs +44 -0
- package/dist/components/tab-panel/tab-panel.component.mjs +1 -0
- package/dist/components/tag/tag.component.mjs +2 -1
- package/dist/components/textarea/textarea.component.mjs +1 -0
- package/dist/components/timer/ticker.mjs +7 -0
- package/dist/components/timer/timer.component.mjs +44 -3
- package/dist/components/timer/timer.styles.mjs +6 -2
- package/dist/components/tool-button/tool-button.component.mjs +4 -0
- package/dist/components/tool-button-group/tool-button-group.component.mjs +3 -0
- package/dist/components/tooltip/tooltip.component.mjs +3 -0
- package/dist/components/tree/tree.component.mjs +1 -0
- package/dist/components/tree-item/tree-item.component.mjs +5 -0
- package/dist/components/visually-hidden/visually-hidden.component.mjs +1 -0
- package/dist/custom-elements.json +11803 -5676
- package/dist/diagram/api/diagram-api-base.mjs +16 -0
- package/dist/diagram/api/diagram-api.mjs +399 -0
- package/dist/diagram/api/diagram-clipboard-api.mjs +52 -0
- package/dist/diagram/api/diagram-groups-api.mjs +46 -0
- package/dist/diagram/api/diagram-model-api.mjs +447 -0
- package/dist/diagram/api/diagram-nodes-api.mjs +61 -0
- package/dist/diagram/api/diagram-selection-api.mjs +56 -0
- package/dist/diagram/api/diagram-viewport-api.mjs +169 -0
- package/dist/diagram/api/emit-with-measurement-option.mjs +21 -0
- package/dist/diagram/input/box-selection-controller.mjs +104 -0
- package/dist/diagram/input/context-menu-controller.mjs +196 -0
- package/dist/diagram/input/cursor-position-tracker-controller.mjs +18 -0
- package/dist/diagram/input/input-controller.mjs +31 -0
- package/dist/diagram/input/keyboard-actions/moving-action.mjs +27 -0
- package/dist/diagram/input/keyboard-actions/panning-action.mjs +27 -0
- package/dist/diagram/input/keyboard-actions/paste-action.mjs +17 -0
- package/dist/diagram/input/keyboard-actions/zoom-action.mjs +30 -0
- package/dist/diagram/input/keyboard-inputs-controller.mjs +121 -0
- package/dist/diagram/input/linking-controller.mjs +127 -0
- package/dist/diagram/input/linking-events.mjs +61 -0
- package/dist/diagram/input/manual-linking.mjs +101 -0
- package/dist/diagram/input/mobile-box-selection-controller.mjs +133 -0
- package/dist/diagram/input/mobile-panning-controller.mjs +114 -0
- package/dist/diagram/input/mobile-zooming-controller.mjs +110 -0
- package/dist/diagram/input/object-selection-controller.mjs +152 -0
- package/dist/diagram/input/palette-drop-controller.mjs +92 -0
- package/dist/diagram/input/panning-controller.mjs +147 -0
- package/dist/diagram/input/pointer-move-selection-controller.mjs +191 -0
- package/dist/diagram/input/relinking-gesture.mjs +182 -0
- package/dist/diagram/input/resize-controller.mjs +122 -0
- package/dist/diagram/input/rotate-controller.mjs +126 -0
- package/dist/diagram/input/zooming-wheel-controller.mjs +55 -0
- package/dist/diagram/minimap/minimap-calculations.mjs +83 -0
- package/dist/diagram/minimap/minimap-navigation-controller.mjs +150 -0
- package/dist/diagram/minimap/minimap-node-cache.mjs +19 -0
- package/dist/diagram/minimap/minimap-strategies.mjs +44 -0
- package/dist/diagram/model/diagram-model-adapter.mjs +97 -0
- package/dist/diagram/model/initialize-model.mjs +31 -0
- package/dist/diagram/model/strip-runtime-properties.mjs +30 -0
- package/dist/diagram/runtime/attribute-converters.mjs +11 -0
- package/dist/diagram/runtime/batched-resize-observer.mjs +168 -0
- package/dist/diagram/runtime/box-selection-provider.mjs +9 -0
- package/dist/diagram/runtime/context.mjs +132 -0
- package/dist/diagram/runtime/contexts.mjs +8 -0
- package/dist/diagram/runtime/cursor-position-tracker.mjs +20 -0
- package/dist/diagram/runtime/default-edge-templates.mjs +21 -0
- package/dist/diagram/runtime/default-node-templates.mjs +20 -0
- package/dist/diagram/runtime/diagram-reference.mjs +126 -0
- package/dist/diagram/runtime/diagram-runtime.mjs +214 -0
- package/dist/diagram/runtime/dom-input-events-router.mjs +88 -0
- package/dist/diagram/runtime/environment.mjs +59 -0
- package/dist/diagram/runtime/event-bridge.mjs +31 -0
- package/dist/diagram/runtime/flow-offset.mjs +45 -0
- package/dist/diagram/runtime/group-highlighted.mjs +25 -0
- package/dist/diagram/runtime/hidden.mjs +147 -0
- package/dist/diagram/runtime/lit-renderer.mjs +33 -0
- package/dist/diagram/runtime/marker-registry.mjs +108 -0
- package/dist/diagram/runtime/middlewares.mjs +14 -0
- package/dist/diagram/runtime/model-owner.mjs +11 -0
- package/dist/diagram/runtime/node-selected.mjs +25 -0
- package/dist/diagram/runtime/observable.mjs +205 -0
- package/dist/diagram/runtime/palette-drag.mjs +56 -0
- package/dist/diagram/runtime/port-hover.mjs +27 -0
- package/dist/diagram/runtime/port-registry.mjs +87 -0
- package/dist/diagram/runtime/resize-processor.mjs +207 -0
- package/dist/diagram/runtime/template-resolver.mjs +98 -0
- package/dist/diagram/runtime/touch-events-state.mjs +52 -0
- package/dist/diagram/utilities.mjs +27 -0
- package/dist/diagram-core/action-state-manager/action-state-manager.mjs +238 -0
- package/dist/diagram-core/batch-processor/batch-processor.mjs +144 -0
- package/dist/diagram-core/command-handler/command-handler.mjs +62 -0
- package/dist/diagram-core/command-handler/commands/add-to-group.mjs +32 -0
- package/dist/diagram-core/command-handler/commands/add-update-delete.mjs +196 -0
- package/dist/diagram-core/command-handler/commands/centering.mjs +73 -0
- package/dist/diagram-core/command-handler/commands/copy-paste.mjs +223 -0
- package/dist/diagram-core/command-handler/commands/cut.mjs +9 -0
- package/dist/diagram-core/command-handler/commands/delete-selection.mjs +32 -0
- package/dist/diagram-core/command-handler/commands/detach-on-node-delete.mjs +77 -0
- package/dist/diagram-core/command-handler/commands/highlight-group.mjs +45 -0
- package/dist/diagram-core/command-handler/commands/index.mjs +88 -0
- package/dist/diagram-core/command-handler/commands/init.mjs +11 -0
- package/dist/diagram-core/command-handler/commands/linking/cancel-linking.mjs +26 -0
- package/dist/diagram-core/command-handler/commands/linking/finish-linking-to-position.mjs +33 -0
- package/dist/diagram-core/command-handler/commands/linking/finish-linking.mjs +108 -0
- package/dist/diagram-core/command-handler/commands/linking/finish-relinking.mjs +91 -0
- package/dist/diagram-core/command-handler/commands/linking/linking-gesture.mjs +13 -0
- package/dist/diagram-core/command-handler/commands/linking/move-temporary-edge.mjs +98 -0
- package/dist/diagram-core/command-handler/commands/linking/start-linking-from-position.mjs +23 -0
- package/dist/diagram-core/command-handler/commands/linking/start-linking.mjs +47 -0
- package/dist/diagram-core/command-handler/commands/linking/start-relinking.mjs +51 -0
- package/dist/diagram-core/command-handler/commands/linking/utils.mjs +103 -0
- package/dist/diagram-core/command-handler/commands/move-nodes-lifecycle.mjs +14 -0
- package/dist/diagram-core/command-handler/commands/move-viewport.mjs +48 -0
- package/dist/diagram-core/command-handler/commands/move.mjs +90 -0
- package/dist/diagram-core/command-handler/commands/remove-from-group.mjs +22 -0
- package/dist/diagram-core/command-handler/commands/resize-node-lifecycle.mjs +14 -0
- package/dist/diagram-core/command-handler/commands/resize-node.mjs +214 -0
- package/dist/diagram-core/command-handler/commands/rotate-node-lifecycle.mjs +14 -0
- package/dist/diagram-core/command-handler/commands/rotate-node.mjs +53 -0
- package/dist/diagram-core/command-handler/commands/selection.mjs +69 -0
- package/dist/diagram-core/command-handler/commands/z-order.mjs +125 -0
- package/dist/diagram-core/command-handler/commands/zoom-to-fit.mjs +118 -0
- package/dist/diagram-core/command-handler/commands/zoom.mjs +26 -0
- package/dist/diagram-core/edge-routing-manager/edge-routing-manager.mjs +253 -0
- package/dist/diagram-core/edge-routing-manager/resolve-label-position.mjs +13 -0
- package/dist/diagram-core/edge-routing-manager/routings/bezier/bezier-routing.mjs +73 -0
- package/dist/diagram-core/edge-routing-manager/routings/bezier/compute-bezier-path.mjs +24 -0
- package/dist/diagram-core/edge-routing-manager/routings/bezier/compute-bezier-point-at-distance.mjs +37 -0
- package/dist/diagram-core/edge-routing-manager/routings/bezier/compute-bezier-point-on-path.mjs +33 -0
- package/dist/diagram-core/edge-routing-manager/routings/bezier/compute-bezier-points.mjs +31 -0
- package/dist/diagram-core/edge-routing-manager/routings/orthogonal/compute-orthogonal-path.mjs +56 -0
- package/dist/diagram-core/edge-routing-manager/routings/orthogonal/compute-orthogonal-point-at-distance.mjs +12 -0
- package/dist/diagram-core/edge-routing-manager/routings/orthogonal/compute-orthogonal-point-on-path.mjs +38 -0
- package/dist/diagram-core/edge-routing-manager/routings/orthogonal/compute-orthogonal-points.mjs +26 -0
- package/dist/diagram-core/edge-routing-manager/routings/orthogonal/orthogonal-routing.mjs +69 -0
- package/dist/diagram-core/edge-routing-manager/routings/orthogonal/utils/get-offset-point.mjs +14 -0
- package/dist/diagram-core/edge-routing-manager/routings/orthogonal/utils/pathpoints/get-pathpoints-from-bottom.mjs +104 -0
- package/dist/diagram-core/edge-routing-manager/routings/orthogonal/utils/pathpoints/get-pathpoints-from-left.mjs +91 -0
- package/dist/diagram-core/edge-routing-manager/routings/orthogonal/utils/pathpoints/get-pathpoints-from-right.mjs +88 -0
- package/dist/diagram-core/edge-routing-manager/routings/orthogonal/utils/pathpoints/get-pathpoints-from-top.mjs +168 -0
- package/dist/diagram-core/edge-routing-manager/routings/orthogonal/utils/pathpoints/get-pathpoints.mjs +23 -0
- package/dist/diagram-core/edge-routing-manager/routings/polyline/compute-polyline-point-at-distance.mjs +12 -0
- package/dist/diagram-core/edge-routing-manager/routings/polyline/compute-polyline-point-on-path.mjs +41 -0
- package/dist/diagram-core/edge-routing-manager/routings/polyline/polyline-routing.mjs +81 -0
- package/dist/diagram-core/edge-routing-manager/utils/linear-segment-utils.mjs +27 -0
- package/dist/diagram-core/edge-routing-manager/utils/normalize-distance.mjs +6 -0
- package/dist/diagram-core/event-manager/event-manager.mjs +164 -0
- package/dist/diagram-core/flow-config/default-flow-config.mjs +143 -0
- package/dist/diagram-core/flow-core.mjs +541 -0
- package/dist/diagram-core/input-events/handlers/box-selection/box-selection.handler.mjs +69 -0
- package/dist/diagram-core/input-events/handlers/cancel-interaction/cancel-interaction.handler.mjs +9 -0
- package/dist/diagram-core/input-events/handlers/copy/copy.handler.mjs +9 -0
- package/dist/diagram-core/input-events/handlers/cut/cut.handler.mjs +9 -0
- package/dist/diagram-core/input-events/handlers/delete-selection/delete-selection.handler.mjs +9 -0
- package/dist/diagram-core/input-events/handlers/event-handler.mjs +29 -0
- package/dist/diagram-core/input-events/handlers/keyboard-move-selection/keyboard-move-selection.handler.mjs +130 -0
- package/dist/diagram-core/input-events/handlers/keyboard-panning/keyboard-panning.handler.mjs +31 -0
- package/dist/diagram-core/input-events/handlers/linking/linking.handler.mjs +77 -0
- package/dist/diagram-core/input-events/handlers/movable-selection.mjs +26 -0
- package/dist/diagram-core/input-events/handlers/palette-drop/palette-drop.handler.mjs +20 -0
- package/dist/diagram-core/input-events/handlers/panning/panning-handler-factory.mjs +8 -0
- package/dist/diagram-core/input-events/handlers/panning/panning.handler.mjs +41 -0
- package/dist/diagram-core/input-events/handlers/panning/virtualized-panning.handler.mjs +77 -0
- package/dist/diagram-core/input-events/handlers/paste/paste.handler.mjs +17 -0
- package/dist/diagram-core/input-events/handlers/pointer-move-selection/pointer-move-selection.handler.mjs +220 -0
- package/dist/diagram-core/input-events/handlers/redo/redo.handler.mjs +14 -0
- package/dist/diagram-core/input-events/handlers/relinking/relinking.handler.mjs +62 -0
- package/dist/diagram-core/input-events/handlers/resize/resize.handler.mjs +174 -0
- package/dist/diagram-core/input-events/handlers/rotate/rotate.handler.mjs +107 -0
- package/dist/diagram-core/input-events/handlers/select/select.handler.mjs +42 -0
- package/dist/diagram-core/input-events/handlers/select-all/select-all.handler.mjs +10 -0
- package/dist/diagram-core/input-events/handlers/undo/undo.handler.mjs +14 -0
- package/dist/diagram-core/input-events/handlers/wheel-panning/wheel-panning.handler.mjs +25 -0
- package/dist/diagram-core/input-events/handlers/zooming/zooming.handler.mjs +28 -0
- package/dist/diagram-core/input-events/input-events.router.mjs +75 -0
- package/dist/diagram-core/interaction-coordinator/interaction-coordinator.mjs +75 -0
- package/dist/diagram-core/label-batch-processor/label-batch-processor.mjs +19 -0
- package/dist/diagram-core/math/angle-between-points/angle-between-points.mjs +5 -0
- package/dist/diagram-core/math/angle-to-side/angle-to-side.mjs +27 -0
- package/dist/diagram-core/math/calculate-edge-panning-force/calculate-edge-panning-force.mjs +34 -0
- package/dist/diagram-core/math/clamp/clamp.mjs +5 -0
- package/dist/diagram-core/math/distance-between-points/distance-between-points.mjs +5 -0
- package/dist/diagram-core/math/ng-diagram-math.mjs +25 -0
- package/dist/diagram-core/math/normalize-angle/normalize-angle.mjs +5 -0
- package/dist/diagram-core/math/snap-angle/snap-angle.mjs +43 -0
- package/dist/diagram-core/math/snap-number/snap-number.mjs +3 -0
- package/dist/diagram-core/math/snap-point/snap-point.mjs +8 -0
- package/dist/diagram-core/math/subtract-points/subtract-points.mjs +5 -0
- package/dist/diagram-core/measurement-tracker/measurement-tracker.mjs +182 -0
- package/dist/diagram-core/middleware-manager/middleware-executor.mjs +246 -0
- package/dist/diagram-core/middleware-manager/middleware-manager.mjs +93 -0
- package/dist/diagram-core/middleware-manager/middlewares/edges-routing/edges-routing.mjs +149 -0
- package/dist/diagram-core/middleware-manager/middlewares/edges-routing/get-edge-points.mjs +93 -0
- package/dist/diagram-core/middleware-manager/middlewares/edges-routing/get-source-target-positions.mjs +90 -0
- package/dist/diagram-core/middleware-manager/middlewares/event-emitter/emitters/clipboard-paste.emitter.mjs +34 -0
- package/dist/diagram-core/middleware-manager/middlewares/event-emitter/emitters/diagram-init.emitter.mjs +190 -0
- package/dist/diagram-core/middleware-manager/middlewares/event-emitter/emitters/edge-draw-ended.emitter.mjs +51 -0
- package/dist/diagram-core/middleware-manager/middlewares/event-emitter/emitters/edge-drawn.emitter.mjs +35 -0
- package/dist/diagram-core/middleware-manager/middlewares/event-emitter/emitters/edge-relink.emitter.mjs +58 -0
- package/dist/diagram-core/middleware-manager/middlewares/event-emitter/emitters/group-membership-changed.emitter.mjs +49 -0
- package/dist/diagram-core/middleware-manager/middlewares/event-emitter/emitters/node-drag-lifecycle.emitter.mjs +54 -0
- package/dist/diagram-core/middleware-manager/middlewares/event-emitter/emitters/node-resize-lifecycle.emitter.mjs +44 -0
- package/dist/diagram-core/middleware-manager/middlewares/event-emitter/emitters/node-rotate-lifecycle.emitter.mjs +44 -0
- package/dist/diagram-core/middleware-manager/middlewares/event-emitter/emitters/palette-item-dropped.emitter.mjs +26 -0
- package/dist/diagram-core/middleware-manager/middlewares/event-emitter/emitters/selection-changed.emitter.mjs +61 -0
- package/dist/diagram-core/middleware-manager/middlewares/event-emitter/emitters/selection-gesture-ended.emitter.mjs +32 -0
- package/dist/diagram-core/middleware-manager/middlewares/event-emitter/emitters/selection-moved.emitter.mjs +57 -0
- package/dist/diagram-core/middleware-manager/middlewares/event-emitter/emitters/selection-removed.emitter.mjs +40 -0
- package/dist/diagram-core/middleware-manager/middlewares/event-emitter/emitters/selection-rotated.emitter.mjs +33 -0
- package/dist/diagram-core/middleware-manager/middlewares/event-emitter/emitters/size-changed.emitter.mjs +33 -0
- package/dist/diagram-core/middleware-manager/middlewares/event-emitter/emitters/viewport-changed.emitter.mjs +19 -0
- package/dist/diagram-core/middleware-manager/middlewares/event-emitter/event-emitter.middleware.mjs +69 -0
- package/dist/diagram-core/middleware-manager/middlewares/hidden-computation/hidden-computation.mjs +66 -0
- package/dist/diagram-core/middleware-manager/middlewares/internal-id-assignment/internal-id-assignment.mjs +24 -0
- package/dist/diagram-core/middleware-manager/middlewares/logger/logger.mjs +18 -0
- package/dist/diagram-core/middleware-manager/middlewares/measured-bounds-assignment/is-node-fully-measured.mjs +20 -0
- package/dist/diagram-core/middleware-manager/middlewares/measured-bounds-assignment/measured-bounds-assignment.mjs +59 -0
- package/dist/diagram-core/middleware-manager/middlewares/measurement-tracking/measurement-tracking.middleware.mjs +55 -0
- package/dist/diagram-core/middleware-manager/middlewares/z-index-assignment/utils/assign-edges-z-index.mjs +12 -0
- package/dist/diagram-core/middleware-manager/middlewares/z-index-assignment/utils/assign-node-z-index.mjs +61 -0
- package/dist/diagram-core/middleware-manager/middlewares/z-index-assignment/utils/create-group-children-map.mjs +14 -0
- package/dist/diagram-core/middleware-manager/middlewares/z-index-assignment/utils/initialize-z-index.mjs +30 -0
- package/dist/diagram-core/middleware-manager/middlewares/z-index-assignment/utils/sort-children.mjs +36 -0
- package/dist/diagram-core/middleware-manager/middlewares/z-index-assignment/z-index-assignment.mjs +240 -0
- package/dist/diagram-core/middleware-manager/pass-settlement.mjs +68 -0
- package/dist/diagram-core/model-lookup/model-lookup.mjs +394 -0
- package/dist/diagram-core/port-batch-processor/port-batch-processor.mjs +20 -0
- package/dist/diagram-core/render-strategy/base-render-strategy.mjs +26 -0
- package/dist/diagram-core/render-strategy/direct/direct-render-strategy.mjs +33 -0
- package/dist/diagram-core/render-strategy/render-performance-logger.mjs +42 -0
- package/dist/diagram-core/render-strategy/virtualized/idle-render-scheduler.mjs +43 -0
- package/dist/diagram-core/render-strategy/virtualized/result-cache.mjs +63 -0
- package/dist/diagram-core/render-strategy/virtualized/viewport-utils.mjs +40 -0
- package/dist/diagram-core/render-strategy/virtualized/virtualized-render-strategy.mjs +91 -0
- package/dist/diagram-core/render-strategy/virtualized/visible-elements-resolver.mjs +120 -0
- package/dist/diagram-core/render-strategy/virtualized/zoom-tracker.mjs +38 -0
- package/dist/diagram-core/set.polyfill.mjs +24 -0
- package/dist/diagram-core/shortcut-manager/default-shortcuts.mjs +99 -0
- package/dist/diagram-core/shortcut-manager/shortcut-manager.mjs +140 -0
- package/dist/diagram-core/spatial-hash/collision-detection.mjs +74 -0
- package/dist/diagram-core/spatial-hash/spatial-hash.mjs +161 -0
- package/dist/diagram-core/spatial-hash/utils.mjs +92 -0
- package/dist/diagram-core/transaction-manager/transaction-context.mjs +40 -0
- package/dist/diagram-core/transaction-manager/transaction-manager.mjs +94 -0
- package/dist/diagram-core/transaction-manager/transaction.mjs +179 -0
- package/dist/diagram-core/types/edge.interface.mjs +3 -0
- package/dist/diagram-core/types/node.interface.mjs +3 -0
- package/dist/diagram-core/types/utils.mjs +3 -0
- package/dist/diagram-core/updater/init-updater/init-state.mjs +356 -0
- package/dist/diagram-core/updater/init-updater/init-updater.mjs +275 -0
- package/dist/diagram-core/updater/init-updater/late-arrival-queue.mjs +71 -0
- package/dist/diagram-core/updater/init-updater/stability-detector.mjs +63 -0
- package/dist/diagram-core/updater/internal-updater/internal-updater.mjs +166 -0
- package/dist/diagram-core/utils/change-generation.mjs +13 -0
- package/dist/diagram-core/utils/compute-floating-edge-side.mjs +35 -0
- package/dist/diagram-core/utils/constants.mjs +3 -0
- package/dist/diagram-core/utils/dangling-edges.mjs +89 -0
- package/dist/diagram-core/utils/deep-merge.mjs +22 -0
- package/dist/diagram-core/utils/dimensions.mjs +52 -0
- package/dist/diagram-core/utils/get-node-border-intersection.mjs +99 -0
- package/dist/diagram-core/utils/get-port-flow-position.mjs +55 -0
- package/dist/diagram-core/utils/group-size.mjs +32 -0
- package/dist/diagram-core/utils/is-group.mjs +5 -0
- package/dist/diagram-core/utils/measurement-validation.mjs +11 -0
- package/dist/diagram-core/utils/object-properties.mjs +22 -0
- package/dist/diagram-core/utils/rects-points-sizes.mjs +148 -0
- package/dist/diagram-core/utils/relinking.mjs +6 -0
- package/dist/diagram-core/utils/semaphore.mjs +43 -0
- package/dist/diagram-core/utils/snap-node-position.mjs +11 -0
- package/dist/diagram-core/utils/sort-nodes-by-z-index.mjs +22 -0
- package/dist/diagram-core/visibility/effective-visibility.mjs +28 -0
- package/dist/diagram-core/visibility/template-visibility-registry.mjs +87 -0
- package/dist/index.d.mts +13416 -3794
- package/dist/index.d.ts +13416 -3794
- package/dist/index.mjs +34 -0
- package/dist/internal/content-size.mjs +14 -0
- package/dist/internal/custom-boolean-converter.mjs +18 -0
- package/dist/internal/flow-ui-rdf-element.mjs +57 -5
- package/dist/package.json.mjs +1 -1
- package/dist/utilities/register-components.mjs +77 -142
- package/dist/vscode.html-custom-data.json +460 -187
- package/package.json +16 -8
- package/themes/dark.css +2 -0
- package/themes/dark.styles.js +2 -0
- package/themes/light.css +2 -0
- package/themes/light.styles.js +2 -0
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { EventHandler } from '../event-handler.mjs';
|
|
2
|
+
import { getMovableSelection } from '../movable-selection.mjs';
|
|
3
|
+
import { getRotatedBoundingRect } from '../../../utils/rects-points-sizes.mjs';
|
|
4
|
+
import { DIRECTIONS } from '../../../types/utils.mjs';
|
|
5
|
+
import { snapNodePosition } from '../../../utils/snap-node-position.mjs';
|
|
6
|
+
|
|
7
|
+
const UNKNOWN_DIRECTION_ERROR = (direction) => `[ngDiagram] Unknown keyboard move direction: "${direction}"
|
|
8
|
+
|
|
9
|
+
Valid directions are: ${DIRECTIONS.map((d) => `'${d}'`).join(", ")}
|
|
10
|
+
|
|
11
|
+
This indicates a programming error. Check keyboard shortcut configuration.
|
|
12
|
+
|
|
13
|
+
Documentation: https://www.ngdiagram.dev/docs/guides/shortcut-manager/
|
|
14
|
+
`;
|
|
15
|
+
const DIRECTION_VECTORS = {
|
|
16
|
+
top: { x: 0, y: -1 },
|
|
17
|
+
bottom: { x: 0, y: 1 },
|
|
18
|
+
left: { x: -1, y: 0 },
|
|
19
|
+
right: { x: 1, y: 0 }
|
|
20
|
+
};
|
|
21
|
+
class KeyboardMoveSelectionEventHandler extends EventHandler {
|
|
22
|
+
handle(event) {
|
|
23
|
+
const nodesToMove = getMovableSelection(this.flow);
|
|
24
|
+
if (nodesToMove.length === 0) {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
const rootNodes = this.getRootNodes(nodesToMove);
|
|
28
|
+
const delta = this.getDelta(event.direction, rootNodes);
|
|
29
|
+
this.flow.commandHandler.emit("moveNodesBy", { nodes: nodesToMove, delta });
|
|
30
|
+
if (this.flow.config.viewportPanningEnabled) {
|
|
31
|
+
this.panViewportIfNeeded(event.direction, nodesToMove, delta);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
getRootNodes(nodes) {
|
|
35
|
+
const nodeIds = new Set(nodes.map((node) => node.id));
|
|
36
|
+
return nodes.filter((node) => node.groupId == null || !nodeIds.has(node.groupId));
|
|
37
|
+
}
|
|
38
|
+
getDelta(direction, rootNodes) {
|
|
39
|
+
const { computeSnapForNodeDrag, defaultDragSnap } = this.flow.config.snapping;
|
|
40
|
+
const maxSnap = rootNodes.reduce(
|
|
41
|
+
(max, node) => {
|
|
42
|
+
const { width, height } = computeSnapForNodeDrag(node) ?? defaultDragSnap;
|
|
43
|
+
return { width: Math.max(max.width, width), height: Math.max(max.height, height) };
|
|
44
|
+
},
|
|
45
|
+
{ width: 0, height: 0 }
|
|
46
|
+
);
|
|
47
|
+
const vector = DIRECTION_VECTORS[direction];
|
|
48
|
+
if (!vector) {
|
|
49
|
+
throw new Error(UNKNOWN_DIRECTION_ERROR(direction));
|
|
50
|
+
}
|
|
51
|
+
return {
|
|
52
|
+
x: vector.x * maxSnap.width,
|
|
53
|
+
y: vector.y * maxSnap.height
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
panViewportIfNeeded(direction, nodes, delta) {
|
|
57
|
+
const panAmount = this.calculatePanAmount(direction, nodes, delta);
|
|
58
|
+
if (panAmount > 0) {
|
|
59
|
+
this.emitViewportPan(direction, panAmount);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
calculatePanAmount(direction, nodes, delta) {
|
|
63
|
+
const { viewport } = this.flow.model.getMetadata();
|
|
64
|
+
if (!viewport.width || !viewport.height) {
|
|
65
|
+
return 0;
|
|
66
|
+
}
|
|
67
|
+
const viewportBounds = this.getViewportBounds(
|
|
68
|
+
viewport.x,
|
|
69
|
+
viewport.y,
|
|
70
|
+
viewport.width,
|
|
71
|
+
viewport.height,
|
|
72
|
+
viewport.scale
|
|
73
|
+
);
|
|
74
|
+
return nodes.reduce((maxOverflow, node) => {
|
|
75
|
+
const overflow = this.calculateNodeOverflow(node, delta, direction, viewportBounds);
|
|
76
|
+
return Math.max(maxOverflow, overflow);
|
|
77
|
+
}, 0);
|
|
78
|
+
}
|
|
79
|
+
getViewportBounds(x, y, width, height, scale) {
|
|
80
|
+
const { edgePanningThreshold } = this.flow.config.selectionMoving;
|
|
81
|
+
const threshold = edgePanningThreshold / scale;
|
|
82
|
+
return {
|
|
83
|
+
left: -x / scale + threshold,
|
|
84
|
+
top: -y / scale + threshold,
|
|
85
|
+
right: (-x + width) / scale - threshold,
|
|
86
|
+
bottom: (-y + height) / scale - threshold
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
calculateNodeOverflow(node, delta, direction, bounds) {
|
|
90
|
+
const snappedPosition = this.getSnappedPosition(node, delta);
|
|
91
|
+
const nodeBounds = this.getNodeBounds(node, snappedPosition);
|
|
92
|
+
switch (direction) {
|
|
93
|
+
case "left":
|
|
94
|
+
return bounds.left - nodeBounds.left;
|
|
95
|
+
case "right":
|
|
96
|
+
return nodeBounds.right - bounds.right;
|
|
97
|
+
case "top":
|
|
98
|
+
return bounds.top - nodeBounds.top;
|
|
99
|
+
case "bottom":
|
|
100
|
+
return nodeBounds.bottom - bounds.bottom;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
getNodeBounds(node, newPosition) {
|
|
104
|
+
const width = node.size?.width ?? 100;
|
|
105
|
+
const height = node.size?.height ?? 50;
|
|
106
|
+
const rect = { x: newPosition.x, y: newPosition.y, width, height };
|
|
107
|
+
const boundingRect = getRotatedBoundingRect(rect, node.angle ?? 0);
|
|
108
|
+
return {
|
|
109
|
+
left: boundingRect.x,
|
|
110
|
+
top: boundingRect.y,
|
|
111
|
+
right: boundingRect.x + boundingRect.width,
|
|
112
|
+
bottom: boundingRect.y + boundingRect.height
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
getSnappedPosition(node, delta) {
|
|
116
|
+
const newPosition = { x: node.position.x + delta.x, y: node.position.y + delta.y };
|
|
117
|
+
return snapNodePosition(this.flow.config, node, newPosition);
|
|
118
|
+
}
|
|
119
|
+
emitViewportPan(direction, amount) {
|
|
120
|
+
const { viewport } = this.flow.model.getMetadata();
|
|
121
|
+
const screenAmount = amount * viewport.scale;
|
|
122
|
+
const vector = DIRECTION_VECTORS[direction];
|
|
123
|
+
this.flow.commandHandler.emit("moveViewportBy", {
|
|
124
|
+
x: vector.x === 0 ? 0 : -vector.x * screenAmount,
|
|
125
|
+
y: vector.y === 0 ? 0 : -vector.y * screenAmount
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
export { KeyboardMoveSelectionEventHandler, UNKNOWN_DIRECTION_ERROR };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { EventHandler } from '../event-handler.mjs';
|
|
2
|
+
|
|
3
|
+
class KeyboardPanningEventHandler extends EventHandler {
|
|
4
|
+
handle(event) {
|
|
5
|
+
let x = 0;
|
|
6
|
+
let y = 0;
|
|
7
|
+
switch (event.direction) {
|
|
8
|
+
case "top": {
|
|
9
|
+
y = -10;
|
|
10
|
+
break;
|
|
11
|
+
}
|
|
12
|
+
case "bottom": {
|
|
13
|
+
y = 10;
|
|
14
|
+
break;
|
|
15
|
+
}
|
|
16
|
+
case "left": {
|
|
17
|
+
x = -10;
|
|
18
|
+
break;
|
|
19
|
+
}
|
|
20
|
+
case "right": {
|
|
21
|
+
x = 10;
|
|
22
|
+
break;
|
|
23
|
+
}
|
|
24
|
+
default:
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
this.flow.commandHandler.emit("moveViewportBy", { x, y });
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export { KeyboardPanningEventHandler };
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { createLinkingState } from '../../../command-handler/commands/linking/linking-gesture.mjs';
|
|
2
|
+
import { EventHandler } from '../event-handler.mjs';
|
|
3
|
+
|
|
4
|
+
const LINKING_MISSING_TARGET_ERROR = (event) => `[ngDiagram] Linking event missing target node.
|
|
5
|
+
|
|
6
|
+
Event details:
|
|
7
|
+
\u2022 Phase: ${event.phase}
|
|
8
|
+
\u2022 Port ID: ${event.portId}
|
|
9
|
+
\u2022 Target type: ${event.targetType}
|
|
10
|
+
\u2022 Pointer position: (${event.lastInputPoint.x}, ${event.lastInputPoint.y})
|
|
11
|
+
|
|
12
|
+
This indicates a programming error. Linking start events must have a target node.
|
|
13
|
+
|
|
14
|
+
Documentation: https://www.ngdiagram.dev/docs/guides/edges/edges/
|
|
15
|
+
`;
|
|
16
|
+
class LinkingEventHandler extends EventHandler {
|
|
17
|
+
handle(event) {
|
|
18
|
+
if (this.flow.isCancellingInteraction()) {
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
switch (event.phase) {
|
|
22
|
+
case "start": {
|
|
23
|
+
const sourceNodeId = event.target?.id;
|
|
24
|
+
if (!sourceNodeId) {
|
|
25
|
+
throw new Error(LINKING_MISSING_TARGET_ERROR(event));
|
|
26
|
+
}
|
|
27
|
+
if (this.flow.actionStateManager.isLinking()) {
|
|
28
|
+
console.warn("[ngDiagram] startLinking ignored: another linking or relinking gesture is in progress.");
|
|
29
|
+
break;
|
|
30
|
+
}
|
|
31
|
+
this.flow.actionStateManager.linking = createLinkingState({
|
|
32
|
+
sourceNodeId,
|
|
33
|
+
sourcePortId: event.portId,
|
|
34
|
+
temporaryEdge: null
|
|
35
|
+
});
|
|
36
|
+
this.flow.commandHandler.emit("startLinking", {
|
|
37
|
+
source: sourceNodeId,
|
|
38
|
+
sourcePort: event.portId
|
|
39
|
+
});
|
|
40
|
+
break;
|
|
41
|
+
}
|
|
42
|
+
case "continue": {
|
|
43
|
+
if (!this.flow.actionStateManager.isLinking())
|
|
44
|
+
break;
|
|
45
|
+
const flowPosition = this.flow.clientToFlowPosition(event.lastInputPoint);
|
|
46
|
+
if (this.flow.config.viewportPanningEnabled && event.panningForce) {
|
|
47
|
+
this.flow.commandHandler.emit("moveViewportBy", { x: event.panningForce.x, y: event.panningForce.y });
|
|
48
|
+
}
|
|
49
|
+
this.flow.commandHandler.emit("moveTemporaryEdge", {
|
|
50
|
+
position: flowPosition
|
|
51
|
+
});
|
|
52
|
+
break;
|
|
53
|
+
}
|
|
54
|
+
case "end": {
|
|
55
|
+
if (!this.flow.actionStateManager.isLinking())
|
|
56
|
+
break;
|
|
57
|
+
if (event.takenOver) {
|
|
58
|
+
this.flow.commandHandler.emit("cancelLinking");
|
|
59
|
+
break;
|
|
60
|
+
}
|
|
61
|
+
const flowPosition = this.flow.clientToFlowPosition(event.lastInputPoint);
|
|
62
|
+
this.flow.commandHandler.emit("finishLinking", { position: flowPosition });
|
|
63
|
+
break;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
async cancel() {
|
|
68
|
+
const linking = this.flow.actionStateManager.linking;
|
|
69
|
+
if (!linking || linking._finishing) {
|
|
70
|
+
return false;
|
|
71
|
+
}
|
|
72
|
+
await this.flow.commandHandler.emit("cancelLinking");
|
|
73
|
+
return true;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export { LINKING_MISSING_TARGET_ERROR, LinkingEventHandler };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
const getMovableSelection = (flow) => {
|
|
2
|
+
const selectedWithChildren = flow.modelLookup.getSelectedNodesWithChildren({ directOnly: false });
|
|
3
|
+
const movingRoots = selectedWithChildren.filter(
|
|
4
|
+
(node) => node.selected && !node.computedHidden && (node.draggable ?? true)
|
|
5
|
+
);
|
|
6
|
+
const hasHidden = selectedWithChildren.some((node) => node.computedHidden);
|
|
7
|
+
if (!hasHidden) {
|
|
8
|
+
return selectedWithChildren.filter((node) => node.draggable ?? true);
|
|
9
|
+
}
|
|
10
|
+
const coveredByMovingRoots = /* @__PURE__ */ new Set();
|
|
11
|
+
for (const root of movingRoots) {
|
|
12
|
+
for (const descendantId of flow.modelLookup.getAllDescendantIds(root.id)) {
|
|
13
|
+
coveredByMovingRoots.add(descendantId);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
return selectedWithChildren.filter((node) => {
|
|
17
|
+
if (!(node.draggable ?? true))
|
|
18
|
+
return false;
|
|
19
|
+
if (!node.computedHidden)
|
|
20
|
+
return true;
|
|
21
|
+
return coveredByMovingRoots.has(node.id);
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
const hasMovableSelection = (flow) => flow.config.nodeDraggingEnabled && getMovableSelection(flow).length > 0;
|
|
25
|
+
|
|
26
|
+
export { getMovableSelection, hasMovableSelection };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { EventHandler } from '../event-handler.mjs';
|
|
2
|
+
|
|
3
|
+
class PaletteDropEventHandler extends EventHandler {
|
|
4
|
+
handle(event) {
|
|
5
|
+
const { data, lastInputPoint } = event;
|
|
6
|
+
const node = data;
|
|
7
|
+
this.flow.commandHandler.emit("paletteDropNode", {
|
|
8
|
+
node: {
|
|
9
|
+
...node,
|
|
10
|
+
id: this.flow.config.computeNodeId(),
|
|
11
|
+
position: this.flow.clientToFlowPosition({
|
|
12
|
+
x: lastInputPoint.x,
|
|
13
|
+
y: lastInputPoint.y
|
|
14
|
+
})
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export { PaletteDropEventHandler };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { PanningEventHandler } from './panning.handler.mjs';
|
|
2
|
+
import { VirtualizedPanningEventHandler } from './virtualized-panning.handler.mjs';
|
|
3
|
+
|
|
4
|
+
function panningHandlerFactory(flow) {
|
|
5
|
+
return flow.isVirtualizationActive ? new VirtualizedPanningEventHandler(flow) : new PanningEventHandler(flow);
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export { panningHandlerFactory };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { EventHandler } from '../event-handler.mjs';
|
|
2
|
+
|
|
3
|
+
class PanningEventHandler extends EventHandler {
|
|
4
|
+
handle(event) {
|
|
5
|
+
if (this.flow.isCancellingInteraction()) {
|
|
6
|
+
return;
|
|
7
|
+
}
|
|
8
|
+
switch (event.phase) {
|
|
9
|
+
case "start": {
|
|
10
|
+
this.lastPoint = event.lastInputPoint;
|
|
11
|
+
this.flow.actionStateManager.panning = { active: true };
|
|
12
|
+
break;
|
|
13
|
+
}
|
|
14
|
+
case "continue": {
|
|
15
|
+
if (!this.flow.actionStateManager.isPanning() || !this.lastPoint) {
|
|
16
|
+
break;
|
|
17
|
+
}
|
|
18
|
+
const x = event.lastInputPoint.x - this.lastPoint.x;
|
|
19
|
+
const y = event.lastInputPoint.y - this.lastPoint.y;
|
|
20
|
+
this.flow.commandHandler.emit("moveViewportBy", { x, y });
|
|
21
|
+
this.lastPoint = event.lastInputPoint;
|
|
22
|
+
break;
|
|
23
|
+
}
|
|
24
|
+
case "end": {
|
|
25
|
+
this.lastPoint = void 0;
|
|
26
|
+
this.flow.actionStateManager.clearPanning();
|
|
27
|
+
break;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
cancel() {
|
|
32
|
+
if (!this.flow.actionStateManager.isPanning()) {
|
|
33
|
+
return false;
|
|
34
|
+
}
|
|
35
|
+
this.lastPoint = void 0;
|
|
36
|
+
this.flow.actionStateManager.clearPanning();
|
|
37
|
+
return true;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export { PanningEventHandler };
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { EventHandler } from '../event-handler.mjs';
|
|
2
|
+
|
|
3
|
+
class VirtualizedPanningEventHandler extends EventHandler {
|
|
4
|
+
constructor() {
|
|
5
|
+
super(...arguments);
|
|
6
|
+
this.accumulatedDelta = { x: 0, y: 0 };
|
|
7
|
+
this.rafScheduled = false;
|
|
8
|
+
}
|
|
9
|
+
handle(event) {
|
|
10
|
+
if (this.flow.isCancellingInteraction()) {
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
switch (event.phase) {
|
|
14
|
+
case "start": {
|
|
15
|
+
this.lastPoint = event.lastInputPoint;
|
|
16
|
+
this.accumulatedDelta = { x: 0, y: 0 };
|
|
17
|
+
this.flow.actionStateManager.panning = { active: true };
|
|
18
|
+
break;
|
|
19
|
+
}
|
|
20
|
+
case "continue": {
|
|
21
|
+
if (!this.flow.actionStateManager.isPanning() || !this.lastPoint) {
|
|
22
|
+
break;
|
|
23
|
+
}
|
|
24
|
+
const x = event.lastInputPoint.x - this.lastPoint.x;
|
|
25
|
+
const y = event.lastInputPoint.y - this.lastPoint.y;
|
|
26
|
+
this.accumulatedDelta.x += x;
|
|
27
|
+
this.accumulatedDelta.y += y;
|
|
28
|
+
this.lastPoint = event.lastInputPoint;
|
|
29
|
+
this.scheduleFlush();
|
|
30
|
+
break;
|
|
31
|
+
}
|
|
32
|
+
case "end": {
|
|
33
|
+
this.flushDelta();
|
|
34
|
+
this.lastPoint = void 0;
|
|
35
|
+
this.rafScheduled = false;
|
|
36
|
+
this.flow.actionStateManager.clearPanning();
|
|
37
|
+
break;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
cancel() {
|
|
42
|
+
if (!this.flow.actionStateManager.isPanning()) {
|
|
43
|
+
return false;
|
|
44
|
+
}
|
|
45
|
+
this.accumulatedDelta = { x: 0, y: 0 };
|
|
46
|
+
this.lastPoint = void 0;
|
|
47
|
+
this.rafScheduled = false;
|
|
48
|
+
this.flow.actionStateManager.clearPanning();
|
|
49
|
+
return true;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Schedules a RAF callback to flush accumulated delta.
|
|
53
|
+
* Only one callback is scheduled at a time.
|
|
54
|
+
*/
|
|
55
|
+
scheduleFlush() {
|
|
56
|
+
if (this.rafScheduled) {
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
this.rafScheduled = true;
|
|
60
|
+
requestAnimationFrame(() => {
|
|
61
|
+
this.flushDelta();
|
|
62
|
+
this.rafScheduled = false;
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Emits the accumulated viewport delta if non-zero, then resets it.
|
|
67
|
+
*/
|
|
68
|
+
flushDelta() {
|
|
69
|
+
const { x, y } = this.accumulatedDelta;
|
|
70
|
+
if (x !== 0 || y !== 0) {
|
|
71
|
+
this.flow.commandHandler.emit("moveViewportBy", { x, y });
|
|
72
|
+
this.accumulatedDelta = { x: 0, y: 0 };
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export { VirtualizedPanningEventHandler };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { EventHandler } from '../event-handler.mjs';
|
|
2
|
+
|
|
3
|
+
class PasteEventHandler extends EventHandler {
|
|
4
|
+
handle(event) {
|
|
5
|
+
this.flow.commandHandler.emit("paste", this.getPasteParameters(event));
|
|
6
|
+
}
|
|
7
|
+
getPasteParameters(event) {
|
|
8
|
+
if (!event.lastInputPoint) {
|
|
9
|
+
return {};
|
|
10
|
+
}
|
|
11
|
+
return {
|
|
12
|
+
position: this.flow.clientToFlowPosition(event.lastInputPoint)
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export { PasteEventHandler };
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
import { EventHandler } from '../event-handler.mjs';
|
|
2
|
+
import { getMovableSelection } from '../movable-selection.mjs';
|
|
3
|
+
import { sortNodesByZIndex } from '../../../utils/sort-nodes-by-z-index.mjs';
|
|
4
|
+
import { isSamePoint } from '../../../utils/rects-points-sizes.mjs';
|
|
5
|
+
import { NgDiagramMath } from '../../../math/ng-diagram-math.mjs';
|
|
6
|
+
import { isGroup } from '../../../utils/is-group.mjs';
|
|
7
|
+
|
|
8
|
+
const MOVE_THRESHOLD = 5;
|
|
9
|
+
class PointerMoveSelectionEventHandler extends EventHandler {
|
|
10
|
+
constructor() {
|
|
11
|
+
super(...arguments);
|
|
12
|
+
this.gesture = null;
|
|
13
|
+
}
|
|
14
|
+
async handle(event) {
|
|
15
|
+
if (this.flow.isCancellingInteraction()) {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
switch (event.phase) {
|
|
19
|
+
case "start": {
|
|
20
|
+
const flowPosition = this.flow.clientToFlowPosition(event.lastInputPoint);
|
|
21
|
+
this.gesture = {
|
|
22
|
+
startPoint: flowPosition,
|
|
23
|
+
lastPointerPosition: flowPosition,
|
|
24
|
+
hasMoved: false,
|
|
25
|
+
ended: false
|
|
26
|
+
};
|
|
27
|
+
this.flow.actionStateManager.dragging = {
|
|
28
|
+
nodeIds: [],
|
|
29
|
+
modifiers: { ...event.modifiers },
|
|
30
|
+
accumulatedDeltas: /* @__PURE__ */ new Map(),
|
|
31
|
+
movementStarted: false
|
|
32
|
+
};
|
|
33
|
+
break;
|
|
34
|
+
}
|
|
35
|
+
case "continue": {
|
|
36
|
+
const selectedNodesWithChildren = this.draggableSelection();
|
|
37
|
+
const selectedNodes = this.visibleSelection();
|
|
38
|
+
const gesture = this.gesture;
|
|
39
|
+
if (selectedNodesWithChildren.length === 0 || !gesture || gesture.ended) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
const { startPoint, lastPointerPosition } = gesture;
|
|
43
|
+
const pointer = this.flow.clientToFlowPosition(event.lastInputPoint);
|
|
44
|
+
const crossedThreshold = !gesture.hasMoved && NgDiagramMath.distanceBetweenPoints(startPoint, pointer) >= MOVE_THRESHOLD;
|
|
45
|
+
const draggedNodeIds = selectedNodesWithChildren.map((n) => n.id);
|
|
46
|
+
if (crossedThreshold) {
|
|
47
|
+
gesture.hasMoved = true;
|
|
48
|
+
gesture.initialPositions = new Map(selectedNodesWithChildren.map((n) => [n.id, { ...n.position }]));
|
|
49
|
+
this.flow.actionStateManager.dragging = {
|
|
50
|
+
nodeIds: draggedNodeIds,
|
|
51
|
+
modifiers: { ...event.modifiers },
|
|
52
|
+
movementStarted: true,
|
|
53
|
+
accumulatedDeltas: /* @__PURE__ */ new Map()
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
const delta = NgDiagramMath.subtractPoints(pointer, lastPointerPosition);
|
|
57
|
+
const shouldMove = gesture.hasMoved;
|
|
58
|
+
if (this.flow.actionStateManager.dragging) {
|
|
59
|
+
this.flow.actionStateManager.dragging.modifiers = { ...event.modifiers };
|
|
60
|
+
}
|
|
61
|
+
gesture.lastPointerPosition = pointer;
|
|
62
|
+
if (crossedThreshold) {
|
|
63
|
+
await this.flow.commandHandler.emit("moveNodesStart", { nodeIds: draggedNodeIds });
|
|
64
|
+
if (this.gesture !== gesture || gesture.ended) {
|
|
65
|
+
break;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
if (shouldMove) {
|
|
69
|
+
this.flow.transaction("moveNodes", async (tx) => {
|
|
70
|
+
await tx.emit("moveNodesBy", {
|
|
71
|
+
delta,
|
|
72
|
+
nodes: selectedNodesWithChildren
|
|
73
|
+
});
|
|
74
|
+
this.updateGroupHighlightOnDrag(tx, pointer, selectedNodes);
|
|
75
|
+
});
|
|
76
|
+
this.panDiagramOnScreenEdge(event.panningForce);
|
|
77
|
+
}
|
|
78
|
+
break;
|
|
79
|
+
}
|
|
80
|
+
case "end": {
|
|
81
|
+
const gesture = this.gesture;
|
|
82
|
+
if (gesture) {
|
|
83
|
+
gesture.ended = true;
|
|
84
|
+
}
|
|
85
|
+
const draggedNodeIds = this.flow.actionStateManager.dragging?.nodeIds ?? [];
|
|
86
|
+
const pointer = this.flow.clientToFlowPosition(event.lastInputPoint);
|
|
87
|
+
try {
|
|
88
|
+
if (gesture?.hasMoved) {
|
|
89
|
+
try {
|
|
90
|
+
if (!isSamePoint(pointer, gesture.lastPointerPosition)) {
|
|
91
|
+
await this.flow.commandHandler.emit("moveNodesBy", {
|
|
92
|
+
delta: NgDiagramMath.subtractPoints(pointer, gesture.lastPointerPosition),
|
|
93
|
+
nodes: this.draggableSelection()
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
await this.handleDrop(pointer);
|
|
97
|
+
} finally {
|
|
98
|
+
await this.flow.commandHandler.emit("moveNodesStop", { nodeIds: draggedNodeIds });
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
} finally {
|
|
102
|
+
if (this.gesture === gesture) {
|
|
103
|
+
if (this.flow.actionStateManager.highlightGroup) {
|
|
104
|
+
void this.flow.commandHandler.emit("highlightGroupClear");
|
|
105
|
+
}
|
|
106
|
+
this.flow.actionStateManager.clearDragging();
|
|
107
|
+
this.gesture = null;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
async cancel() {
|
|
114
|
+
const gesture = this.gesture;
|
|
115
|
+
const dragging = this.flow.actionStateManager.dragging;
|
|
116
|
+
if (!gesture && !dragging) {
|
|
117
|
+
return false;
|
|
118
|
+
}
|
|
119
|
+
if (gesture?.ended) {
|
|
120
|
+
return false;
|
|
121
|
+
}
|
|
122
|
+
const needsStop = !!dragging && (gesture?.hasMoved ?? false);
|
|
123
|
+
const needsHighlightClear = !!this.flow.actionStateManager.highlightGroup;
|
|
124
|
+
if (gesture) {
|
|
125
|
+
gesture.ended = true;
|
|
126
|
+
}
|
|
127
|
+
if (needsStop && dragging) {
|
|
128
|
+
dragging.cancelReason = "cancelled";
|
|
129
|
+
}
|
|
130
|
+
if (needsStop || needsHighlightClear) {
|
|
131
|
+
await this.flow.transaction("cancelDrag", async (tx) => {
|
|
132
|
+
if (needsStop) {
|
|
133
|
+
const initialPositions = gesture?.initialPositions;
|
|
134
|
+
if (initialPositions?.size) {
|
|
135
|
+
await tx.emit("updateNodes", {
|
|
136
|
+
nodes: [...initialPositions].map(([id, position]) => ({ id, position }))
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
await tx.emit("moveNodesStop", { nodeIds: dragging?.nodeIds ?? [] });
|
|
140
|
+
}
|
|
141
|
+
if (needsHighlightClear) {
|
|
142
|
+
await tx.emit("highlightGroupClear");
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
if (dragging && this.flow.actionStateManager.dragging === dragging) {
|
|
147
|
+
this.flow.actionStateManager.clearDragging();
|
|
148
|
+
}
|
|
149
|
+
if (this.gesture === gesture) {
|
|
150
|
+
this.gesture = null;
|
|
151
|
+
}
|
|
152
|
+
return true;
|
|
153
|
+
}
|
|
154
|
+
/** Selected nodes (with children) that can actually be dragged. */
|
|
155
|
+
draggableSelection() {
|
|
156
|
+
return getMovableSelection(this.flow);
|
|
157
|
+
}
|
|
158
|
+
updateGroupHighlightOnDrag(tx, point, selectedNodes) {
|
|
159
|
+
const topLevelGroupNode = this.getTopGroupAtPoint(point);
|
|
160
|
+
const currentHighlightedGroup = this.flow.actionStateManager.highlightGroup?.highlightedGroupId;
|
|
161
|
+
if (topLevelGroupNode) {
|
|
162
|
+
const shouldHighlight = selectedNodes.some((node) => node.groupId !== topLevelGroupNode.id);
|
|
163
|
+
if (shouldHighlight) {
|
|
164
|
+
if (currentHighlightedGroup !== topLevelGroupNode.id) {
|
|
165
|
+
tx.emit("highlightGroup", { groupId: topLevelGroupNode.id, nodes: selectedNodes });
|
|
166
|
+
}
|
|
167
|
+
} else {
|
|
168
|
+
if (currentHighlightedGroup) {
|
|
169
|
+
tx.emit("highlightGroupClear");
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
} else {
|
|
173
|
+
if (currentHighlightedGroup) {
|
|
174
|
+
tx.emit("highlightGroupClear");
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
getTopGroupAtPoint(point) {
|
|
179
|
+
const nodes = this.flow.getNodesInRange(point, 1);
|
|
180
|
+
const groups = nodes.filter((node) => isGroup(node) && !node.selected);
|
|
181
|
+
const sortedGroups = sortNodesByZIndex(groups, this.flow.getState().nodes);
|
|
182
|
+
return sortedGroups[0];
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* The visible selected nodes — the set group interactions act on.
|
|
186
|
+
* A still-selected but effectively hidden node did not take part in the
|
|
187
|
+
* gesture and must not be re-parented (addToGroup/removeFromGroup) or
|
|
188
|
+
* influence the group highlight.
|
|
189
|
+
*/
|
|
190
|
+
visibleSelection() {
|
|
191
|
+
return this.flow.modelLookup.getSelectedNodes().filter((node) => !node.computedHidden);
|
|
192
|
+
}
|
|
193
|
+
async handleDrop(point) {
|
|
194
|
+
const topLevelGroupNode = this.getTopGroupAtPoint(point);
|
|
195
|
+
const selectedNodes = this.visibleSelection();
|
|
196
|
+
if (!topLevelGroupNode) {
|
|
197
|
+
for (const node of selectedNodes) {
|
|
198
|
+
if (node.groupId !== void 0 && !selectedNodes.find((n) => n.id === node.groupId)) {
|
|
199
|
+
await this.flow.commandHandler.emit("removeFromGroup", {
|
|
200
|
+
groupId: node.groupId,
|
|
201
|
+
nodeIds: [node.id]
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
return;
|
|
206
|
+
}
|
|
207
|
+
await this.flow.commandHandler.emit("addToGroup", {
|
|
208
|
+
groupId: topLevelGroupNode.id,
|
|
209
|
+
nodeIds: selectedNodes.map((node) => node.id)
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
panDiagramOnScreenEdge(panningForce) {
|
|
213
|
+
if (!panningForce) {
|
|
214
|
+
return;
|
|
215
|
+
}
|
|
216
|
+
this.flow.commandHandler.emit("moveViewportBy", { x: panningForce.x, y: panningForce.y });
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
export { MOVE_THRESHOLD, PointerMoveSelectionEventHandler };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { EventHandler } from '../event-handler.mjs';
|
|
2
|
+
|
|
3
|
+
class RedoEventHandler extends EventHandler {
|
|
4
|
+
/**
|
|
5
|
+
* Handles redo input events.
|
|
6
|
+
*
|
|
7
|
+
* @todo Implement full redo event handling logic.
|
|
8
|
+
*/
|
|
9
|
+
handle() {
|
|
10
|
+
this.flow.model.redo();
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export { RedoEventHandler };
|