@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,62 @@
|
|
|
1
|
+
import { EventHandler } from '../event-handler.mjs';
|
|
2
|
+
|
|
3
|
+
const RELINKING_MISSING_TARGET_ERROR = (event) => `[ngDiagram] Relinking event missing target edge.
|
|
4
|
+
|
|
5
|
+
Event details:
|
|
6
|
+
\u2022 Phase: ${event.phase}
|
|
7
|
+
\u2022 End: ${event.end}
|
|
8
|
+
\u2022 Target type: ${event.targetType}
|
|
9
|
+
\u2022 Pointer position: (${event.lastInputPoint.x}, ${event.lastInputPoint.y})
|
|
10
|
+
|
|
11
|
+
This indicates a programming error. Relinking start events must have a target edge.
|
|
12
|
+
`;
|
|
13
|
+
class RelinkingEventHandler extends EventHandler {
|
|
14
|
+
handle(event) {
|
|
15
|
+
if (this.flow.isCancellingInteraction()) {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
const relink = () => this.flow.actionStateManager.linking?.relink;
|
|
19
|
+
switch (event.phase) {
|
|
20
|
+
case "start": {
|
|
21
|
+
const edgeId = event.target?.id;
|
|
22
|
+
if (!edgeId) {
|
|
23
|
+
throw new Error(RELINKING_MISSING_TARGET_ERROR(event));
|
|
24
|
+
}
|
|
25
|
+
this.flow.commandHandler.emit("startRelinking", {
|
|
26
|
+
edgeId,
|
|
27
|
+
end: event.end
|
|
28
|
+
});
|
|
29
|
+
break;
|
|
30
|
+
}
|
|
31
|
+
case "continue": {
|
|
32
|
+
if (!relink())
|
|
33
|
+
break;
|
|
34
|
+
const flowPosition = this.flow.clientToFlowPosition(event.lastInputPoint);
|
|
35
|
+
if (this.flow.config.viewportPanningEnabled && event.panningForce) {
|
|
36
|
+
this.flow.commandHandler.emit("moveViewportBy", { x: event.panningForce.x, y: event.panningForce.y });
|
|
37
|
+
}
|
|
38
|
+
this.flow.commandHandler.emit("moveTemporaryEdge", {
|
|
39
|
+
position: flowPosition
|
|
40
|
+
});
|
|
41
|
+
break;
|
|
42
|
+
}
|
|
43
|
+
case "end": {
|
|
44
|
+
if (!relink())
|
|
45
|
+
break;
|
|
46
|
+
if (event.takenOver) {
|
|
47
|
+
this.flow.commandHandler.emit("cancelLinking");
|
|
48
|
+
break;
|
|
49
|
+
}
|
|
50
|
+
const flowPosition = this.flow.clientToFlowPosition(event.lastInputPoint);
|
|
51
|
+
this.flow.commandHandler.emit("finishRelinking", { position: flowPosition });
|
|
52
|
+
break;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
// No cancel() override: the interaction coordinator's `linking` entry covers
|
|
57
|
+
// relinks too — `isLinking()` is true during a relink and `cancelLinking`
|
|
58
|
+
// branches on `linking.relink`, so Escape reaches the right teardown through
|
|
59
|
+
// the LinkingEventHandler.
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export { RELINKING_MISSING_TARGET_ERROR, RelinkingEventHandler };
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import { EventHandler } from '../event-handler.mjs';
|
|
2
|
+
import { isSamePoint } from '../../../utils/rects-points-sizes.mjs';
|
|
3
|
+
|
|
4
|
+
const RESIZE_MISSING_TARGET_ERROR = (event) => `[ngDiagram] Resize event missing target node.
|
|
5
|
+
|
|
6
|
+
Event details:
|
|
7
|
+
\u2022 Phase: ${event.phase}
|
|
8
|
+
\u2022 Direction: ${event.direction}
|
|
9
|
+
\u2022 Target type: ${event.targetType}
|
|
10
|
+
\u2022 Pointer position: (${event.lastInputPoint.x}, ${event.lastInputPoint.y})
|
|
11
|
+
|
|
12
|
+
This indicates a programming error. Resize events must have a target node.
|
|
13
|
+
|
|
14
|
+
Documentation: https://www.ngdiagram.dev/docs/guides/nodes/resizing/`;
|
|
15
|
+
class ResizeEventHandler extends EventHandler {
|
|
16
|
+
constructor() {
|
|
17
|
+
super(...arguments);
|
|
18
|
+
// Last continue point of the current gesture; reset on every gesture start.
|
|
19
|
+
this.lastContinuePoint = null;
|
|
20
|
+
}
|
|
21
|
+
async handle(event) {
|
|
22
|
+
if (this.flow.isCancellingInteraction()) {
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
if (!event.target) {
|
|
26
|
+
throw new Error(RESIZE_MISSING_TARGET_ERROR(event));
|
|
27
|
+
}
|
|
28
|
+
const { x, y } = this.flow.clientToFlowPosition(event.lastInputPoint);
|
|
29
|
+
switch (event.phase) {
|
|
30
|
+
case "start": {
|
|
31
|
+
const node = this.flow.getNodeById(event.target.id);
|
|
32
|
+
if (node && node.size) {
|
|
33
|
+
this.lastContinuePoint = null;
|
|
34
|
+
this.flow.actionStateManager.resize = {
|
|
35
|
+
startX: x,
|
|
36
|
+
startY: y,
|
|
37
|
+
startWidth: node.size.width,
|
|
38
|
+
startHeight: node.size.height,
|
|
39
|
+
startNodePositionX: node.position.x,
|
|
40
|
+
startNodePositionY: node.position.y,
|
|
41
|
+
resizingNode: node
|
|
42
|
+
};
|
|
43
|
+
await this.flow.commandHandler.emit("resizeNodeStart", { nodeId: node.id });
|
|
44
|
+
}
|
|
45
|
+
break;
|
|
46
|
+
}
|
|
47
|
+
case "continue": {
|
|
48
|
+
const resizeState = this.flow.actionStateManager.resize;
|
|
49
|
+
if (!resizeState) {
|
|
50
|
+
break;
|
|
51
|
+
}
|
|
52
|
+
this.lastContinuePoint = { x, y };
|
|
53
|
+
this.flow.commandHandler.emit(
|
|
54
|
+
"resizeNode",
|
|
55
|
+
this.buildResizeCommand(resizeState, event.target.id, event.direction, { x, y })
|
|
56
|
+
);
|
|
57
|
+
break;
|
|
58
|
+
}
|
|
59
|
+
case "end": {
|
|
60
|
+
const resizeState = this.flow.actionStateManager.resize;
|
|
61
|
+
this.claimTeardown(resizeState);
|
|
62
|
+
try {
|
|
63
|
+
if (resizeState && resizeState.resizingNode.id === event.target.id) {
|
|
64
|
+
const reference = this.lastContinuePoint ?? { x: resizeState.startX, y: resizeState.startY };
|
|
65
|
+
if (!isSamePoint({ x, y }, reference)) {
|
|
66
|
+
await this.flow.commandHandler.emit(
|
|
67
|
+
"resizeNode",
|
|
68
|
+
this.buildResizeCommand(resizeState, event.target.id, event.direction, { x, y })
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
} finally {
|
|
73
|
+
try {
|
|
74
|
+
await this.flow.commandHandler.emit("resizeNodeStop", { nodeId: resizeState?.resizingNode.id });
|
|
75
|
+
} finally {
|
|
76
|
+
if (this.flow.actionStateManager.resize === resizeState) {
|
|
77
|
+
this.flow.actionStateManager.clearResize();
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
break;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
/** Direction math shared by continue and end: the resize command for the pointer at `point` (flow coordinates). */
|
|
86
|
+
buildResizeCommand(resizeState, nodeId, direction, point) {
|
|
87
|
+
const { startHeight, startNodePositionX, startNodePositionY, startWidth, startX, startY } = resizeState;
|
|
88
|
+
const deltaX = Math.round(point.x - startX);
|
|
89
|
+
const deltaY = Math.round(point.y - startY);
|
|
90
|
+
let newWidth = startWidth;
|
|
91
|
+
let newHeight = startHeight;
|
|
92
|
+
let newX = startNodePositionX;
|
|
93
|
+
let newY = startNodePositionY;
|
|
94
|
+
switch (direction) {
|
|
95
|
+
case "top-left": {
|
|
96
|
+
newWidth = startWidth - deltaX;
|
|
97
|
+
newX = startNodePositionX + (startWidth - newWidth);
|
|
98
|
+
newHeight = startHeight - deltaY;
|
|
99
|
+
newY = startNodePositionY + (startHeight - newHeight);
|
|
100
|
+
break;
|
|
101
|
+
}
|
|
102
|
+
case "top": {
|
|
103
|
+
newHeight = startHeight - deltaY;
|
|
104
|
+
newY = startNodePositionY + (startHeight - newHeight);
|
|
105
|
+
break;
|
|
106
|
+
}
|
|
107
|
+
case "top-right": {
|
|
108
|
+
newWidth = startWidth + deltaX;
|
|
109
|
+
newHeight = startHeight - deltaY;
|
|
110
|
+
newY = startNodePositionY + (startHeight - newHeight);
|
|
111
|
+
break;
|
|
112
|
+
}
|
|
113
|
+
case "right": {
|
|
114
|
+
newWidth = startWidth + deltaX;
|
|
115
|
+
break;
|
|
116
|
+
}
|
|
117
|
+
case "bottom-right": {
|
|
118
|
+
newWidth = startWidth + deltaX;
|
|
119
|
+
newHeight = startHeight + deltaY;
|
|
120
|
+
break;
|
|
121
|
+
}
|
|
122
|
+
case "bottom": {
|
|
123
|
+
newHeight = startHeight + deltaY;
|
|
124
|
+
break;
|
|
125
|
+
}
|
|
126
|
+
case "bottom-left": {
|
|
127
|
+
newWidth = startWidth - deltaX;
|
|
128
|
+
newX = startNodePositionX + (startWidth - newWidth);
|
|
129
|
+
newHeight = startHeight + deltaY;
|
|
130
|
+
break;
|
|
131
|
+
}
|
|
132
|
+
case "left": {
|
|
133
|
+
newWidth = startWidth - deltaX;
|
|
134
|
+
newX = startNodePositionX + (startWidth - newWidth);
|
|
135
|
+
break;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
const resizeCommand = {
|
|
139
|
+
id: nodeId,
|
|
140
|
+
disableAutoSize: true,
|
|
141
|
+
size: { width: Math.round(newWidth), height: Math.round(newHeight) }
|
|
142
|
+
};
|
|
143
|
+
if (newX !== startNodePositionX || newY !== startNodePositionY) {
|
|
144
|
+
resizeCommand.position = { x: Math.round(newX), y: Math.round(newY) };
|
|
145
|
+
}
|
|
146
|
+
return resizeCommand;
|
|
147
|
+
}
|
|
148
|
+
async cancel() {
|
|
149
|
+
const resize = this.flow.actionStateManager.resize;
|
|
150
|
+
if (!resize || this.isTeardownClaimed(resize)) {
|
|
151
|
+
return false;
|
|
152
|
+
}
|
|
153
|
+
this.claimTeardown(resize);
|
|
154
|
+
resize.cancelReason = "cancelled";
|
|
155
|
+
const { startWidth, startHeight, startNodePositionX, startNodePositionY, resizingNode } = resize;
|
|
156
|
+
await this.flow.transaction("cancelResize", async (tx) => {
|
|
157
|
+
await tx.emit("updateNode", {
|
|
158
|
+
id: resizingNode.id,
|
|
159
|
+
nodeChanges: {
|
|
160
|
+
size: { width: startWidth, height: startHeight },
|
|
161
|
+
position: { x: startNodePositionX, y: startNodePositionY },
|
|
162
|
+
autoSize: resizingNode.autoSize
|
|
163
|
+
}
|
|
164
|
+
});
|
|
165
|
+
await tx.emit("resizeNodeStop", { nodeId: resizingNode.id });
|
|
166
|
+
});
|
|
167
|
+
if (this.flow.actionStateManager.resize === resize) {
|
|
168
|
+
this.flow.actionStateManager.clearResize();
|
|
169
|
+
}
|
|
170
|
+
return true;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
export { ResizeEventHandler };
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { EventHandler } from '../event-handler.mjs';
|
|
2
|
+
import { NgDiagramMath } from '../../../math/ng-diagram-math.mjs';
|
|
3
|
+
|
|
4
|
+
const MIN_DISTANCE_TO_CENTER = 30;
|
|
5
|
+
const ROTATE_MISSING_TARGET_ERROR = (event) => `[ngDiagram] Rotate event missing target node.
|
|
6
|
+
|
|
7
|
+
Event details:
|
|
8
|
+
\u2022 Phase: ${event.phase}
|
|
9
|
+
\u2022 Target type: ${event.targetType}
|
|
10
|
+
\u2022 Pointer position: (${event.lastInputPoint.x}, ${event.lastInputPoint.y})
|
|
11
|
+
\u2022 Center: (${event.center.x}, ${event.center.y})
|
|
12
|
+
|
|
13
|
+
This indicates a programming error. Rotation events must have a target node.
|
|
14
|
+
|
|
15
|
+
Documentation: https://www.ngdiagram.dev/docs/guides/nodes/rotation/`;
|
|
16
|
+
class RotateEventHandler extends EventHandler {
|
|
17
|
+
async handle(event) {
|
|
18
|
+
if (this.flow.isCancellingInteraction()) {
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
const { center, lastInputPoint, target, phase } = event;
|
|
22
|
+
if (!target) {
|
|
23
|
+
throw new Error(ROTATE_MISSING_TARGET_ERROR(event));
|
|
24
|
+
}
|
|
25
|
+
const nodeId = target?.id;
|
|
26
|
+
const pointer = this.flow.clientToFlowPosition(lastInputPoint);
|
|
27
|
+
switch (phase) {
|
|
28
|
+
case "start": {
|
|
29
|
+
const node = this.flow.getNodeById(nodeId);
|
|
30
|
+
if (!node) {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
const initialAngle = NgDiagramMath.angleBetweenPoints(center, pointer);
|
|
34
|
+
this.flow.actionStateManager.rotation = {
|
|
35
|
+
startAngle: initialAngle,
|
|
36
|
+
initialNodeAngle: node.angle ?? 0,
|
|
37
|
+
nodeId
|
|
38
|
+
};
|
|
39
|
+
await this.flow.commandHandler.emit("rotateNodeStart", { nodeId });
|
|
40
|
+
break;
|
|
41
|
+
}
|
|
42
|
+
case "continue": {
|
|
43
|
+
const rotationState = this.flow.actionStateManager.rotation;
|
|
44
|
+
if (!rotationState || rotationState.nodeId !== nodeId) {
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
const angle = this.computeTargetAngle(rotationState, pointer, center);
|
|
48
|
+
if (angle === null) {
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
this.flow.commandHandler.emit("rotateNodeTo", { nodeId, angle });
|
|
52
|
+
break;
|
|
53
|
+
}
|
|
54
|
+
case "end": {
|
|
55
|
+
const rotationState = this.flow.actionStateManager.rotation;
|
|
56
|
+
this.claimTeardown(rotationState);
|
|
57
|
+
try {
|
|
58
|
+
if (rotationState && rotationState.nodeId === nodeId) {
|
|
59
|
+
const angle = this.computeTargetAngle(rotationState, pointer, center);
|
|
60
|
+
if (angle !== null) {
|
|
61
|
+
await this.flow.commandHandler.emit("rotateNodeTo", { nodeId, angle });
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
} finally {
|
|
65
|
+
try {
|
|
66
|
+
await this.flow.commandHandler.emit("rotateNodeStop", { nodeId: rotationState?.nodeId });
|
|
67
|
+
} finally {
|
|
68
|
+
if (this.flow.actionStateManager.rotation === rotationState) {
|
|
69
|
+
this.flow.actionStateManager.clearRotation();
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
break;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
/** Angle math shared by continue and end; null inside the dead zone around the center. */
|
|
78
|
+
computeTargetAngle(rotationState, pointer, center) {
|
|
79
|
+
if (NgDiagramMath.distanceBetweenPoints(pointer, center) < MIN_DISTANCE_TO_CENTER) {
|
|
80
|
+
return null;
|
|
81
|
+
}
|
|
82
|
+
const currentAngle = NgDiagramMath.angleBetweenPoints(center, pointer);
|
|
83
|
+
const angleDelta = currentAngle - rotationState.startAngle;
|
|
84
|
+
return rotationState.initialNodeAngle + angleDelta;
|
|
85
|
+
}
|
|
86
|
+
async cancel() {
|
|
87
|
+
const rotation = this.flow.actionStateManager.rotation;
|
|
88
|
+
if (!rotation || this.isTeardownClaimed(rotation)) {
|
|
89
|
+
return false;
|
|
90
|
+
}
|
|
91
|
+
this.claimTeardown(rotation);
|
|
92
|
+
rotation.cancelReason = "cancelled";
|
|
93
|
+
await this.flow.transaction("cancelRotate", async (tx) => {
|
|
94
|
+
await tx.emit("updateNode", {
|
|
95
|
+
id: rotation.nodeId,
|
|
96
|
+
nodeChanges: { angle: rotation.initialNodeAngle }
|
|
97
|
+
});
|
|
98
|
+
await tx.emit("rotateNodeStop", { nodeId: rotation.nodeId });
|
|
99
|
+
});
|
|
100
|
+
if (this.flow.actionStateManager.rotation === rotation) {
|
|
101
|
+
this.flow.actionStateManager.clearRotation();
|
|
102
|
+
}
|
|
103
|
+
return true;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export { MIN_DISTANCE_TO_CENTER, RotateEventHandler };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { EventHandler } from '../event-handler.mjs';
|
|
2
|
+
|
|
3
|
+
class SelectEventHandler extends EventHandler {
|
|
4
|
+
handle(event) {
|
|
5
|
+
if (event.phase === "end") {
|
|
6
|
+
this.flow.commandHandler.emit("selectEnd");
|
|
7
|
+
return;
|
|
8
|
+
}
|
|
9
|
+
const targetElements = this.getTargetElements(event);
|
|
10
|
+
const isModifierPressed = this.flow.shortcutManager.matchesAction("multiSelection", {
|
|
11
|
+
modifiers: event.modifiers
|
|
12
|
+
});
|
|
13
|
+
if (!targetElements && !isModifierPressed) {
|
|
14
|
+
this.flow.commandHandler.emit("deselectAll");
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
if (!targetElements) {
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
const { target: clickedElement } = event;
|
|
21
|
+
const isAlreadySelected = clickedElement?.selected;
|
|
22
|
+
if (isAlreadySelected && isModifierPressed) {
|
|
23
|
+
this.flow.commandHandler.emit("deselect", targetElements);
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
this.flow.commandHandler.emit("select", {
|
|
27
|
+
...targetElements,
|
|
28
|
+
multiSelection: isAlreadySelected || isModifierPressed
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
getTargetElements(event) {
|
|
32
|
+
if (event.targetType === "diagram" || !event.target) {
|
|
33
|
+
return null;
|
|
34
|
+
} else if (event.targetType === "node") {
|
|
35
|
+
return { nodeIds: [event.target.id], edgeIds: void 0 };
|
|
36
|
+
} else if (event.targetType === "edge") {
|
|
37
|
+
return { nodeIds: void 0, edgeIds: [event.target.id] };
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export { SelectEventHandler };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { EventHandler } from '../event-handler.mjs';
|
|
2
|
+
|
|
3
|
+
class UndoEventHandler extends EventHandler {
|
|
4
|
+
/**
|
|
5
|
+
* Handles undo input events.
|
|
6
|
+
*
|
|
7
|
+
* @todo Implement full undo event handling logic.
|
|
8
|
+
*/
|
|
9
|
+
handle() {
|
|
10
|
+
this.flow.model.undo();
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export { UndoEventHandler };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { EventHandler } from '../event-handler.mjs';
|
|
2
|
+
|
|
3
|
+
const WHEEL_IDLE_TIMEOUT_MS = 100;
|
|
4
|
+
class WheelPanningEventHandler extends EventHandler {
|
|
5
|
+
handle(event) {
|
|
6
|
+
const { deltaX, deltaY } = event;
|
|
7
|
+
if (deltaX === 0 && deltaY === 0) {
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
this.activatePanning();
|
|
11
|
+
this.flow.commandHandler.emit("moveViewportBy", { x: -deltaX || 0, y: -deltaY || 0 });
|
|
12
|
+
}
|
|
13
|
+
activatePanning() {
|
|
14
|
+
this.flow.actionStateManager.panning = { active: true };
|
|
15
|
+
if (this.idleTimeout !== void 0) {
|
|
16
|
+
clearTimeout(this.idleTimeout);
|
|
17
|
+
}
|
|
18
|
+
this.idleTimeout = setTimeout(() => {
|
|
19
|
+
this.flow.actionStateManager.clearPanning();
|
|
20
|
+
this.idleTimeout = void 0;
|
|
21
|
+
}, WHEEL_IDLE_TIMEOUT_MS);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export { WheelPanningEventHandler };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { EventHandler } from '../event-handler.mjs';
|
|
2
|
+
import { NgDiagramMath } from '../../../math/ng-diagram-math.mjs';
|
|
3
|
+
|
|
4
|
+
class ZoomingEventHandler extends EventHandler {
|
|
5
|
+
handle(event) {
|
|
6
|
+
const {
|
|
7
|
+
centerPoint: { x: centerX, y: centerY },
|
|
8
|
+
zoomFactor
|
|
9
|
+
} = event;
|
|
10
|
+
let { x, y, scale } = this.flow.getState().metadata.viewport;
|
|
11
|
+
const { x: offsetX, y: offsetY } = this.flow.getFlowOffset();
|
|
12
|
+
const beforeZoomX = (centerX - x - offsetX) / scale;
|
|
13
|
+
const beforeZoomY = (centerY - y - offsetY) / scale;
|
|
14
|
+
scale *= zoomFactor;
|
|
15
|
+
scale = NgDiagramMath.clamp({
|
|
16
|
+
min: this.flow.config.zoom.min,
|
|
17
|
+
value: scale,
|
|
18
|
+
max: this.flow.config.zoom.max
|
|
19
|
+
});
|
|
20
|
+
const afterZoomX = (centerX - x - offsetX) / scale;
|
|
21
|
+
const afterZoomY = (centerY - y - offsetY) / scale;
|
|
22
|
+
x += (afterZoomX - beforeZoomX) * scale;
|
|
23
|
+
y += (afterZoomY - beforeZoomY) * scale;
|
|
24
|
+
this.flow.commandHandler.emit("zoom", { x, y, scale });
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export { ZoomingEventHandler };
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { BoxSelectionEventHandler } from './handlers/box-selection/box-selection.handler.mjs';
|
|
2
|
+
import { CancelInteractionEventHandler } from './handlers/cancel-interaction/cancel-interaction.handler.mjs';
|
|
3
|
+
import { CopyEventHandler } from './handlers/copy/copy.handler.mjs';
|
|
4
|
+
import { CutEventHandler } from './handlers/cut/cut.handler.mjs';
|
|
5
|
+
import { DeleteSelectionEventHandler } from './handlers/delete-selection/delete-selection.handler.mjs';
|
|
6
|
+
import { KeyboardMoveSelectionEventHandler } from './handlers/keyboard-move-selection/keyboard-move-selection.handler.mjs';
|
|
7
|
+
import { KeyboardPanningEventHandler } from './handlers/keyboard-panning/keyboard-panning.handler.mjs';
|
|
8
|
+
import { LinkingEventHandler } from './handlers/linking/linking.handler.mjs';
|
|
9
|
+
import { RelinkingEventHandler } from './handlers/relinking/relinking.handler.mjs';
|
|
10
|
+
import { PaletteDropEventHandler } from './handlers/palette-drop/palette-drop.handler.mjs';
|
|
11
|
+
import { panningHandlerFactory } from './handlers/panning/panning-handler-factory.mjs';
|
|
12
|
+
import { PasteEventHandler } from './handlers/paste/paste.handler.mjs';
|
|
13
|
+
import { PointerMoveSelectionEventHandler } from './handlers/pointer-move-selection/pointer-move-selection.handler.mjs';
|
|
14
|
+
import { RedoEventHandler } from './handlers/redo/redo.handler.mjs';
|
|
15
|
+
import { ResizeEventHandler } from './handlers/resize/resize.handler.mjs';
|
|
16
|
+
import { RotateEventHandler } from './handlers/rotate/rotate.handler.mjs';
|
|
17
|
+
import { SelectAllEventHandler } from './handlers/select-all/select-all.handler.mjs';
|
|
18
|
+
import { SelectEventHandler } from './handlers/select/select.handler.mjs';
|
|
19
|
+
import { UndoEventHandler } from './handlers/undo/undo.handler.mjs';
|
|
20
|
+
import { WheelPanningEventHandler } from './handlers/wheel-panning/wheel-panning.handler.mjs';
|
|
21
|
+
import { ZoomingEventHandler } from './handlers/zooming/zooming.handler.mjs';
|
|
22
|
+
|
|
23
|
+
class InputEventsRouter {
|
|
24
|
+
constructor() {
|
|
25
|
+
this.handlers = {};
|
|
26
|
+
}
|
|
27
|
+
emit(event) {
|
|
28
|
+
const handler = this.handlers[event.name];
|
|
29
|
+
if (!handler) {
|
|
30
|
+
console.warn(`No handler registered for event: ${event.name}`);
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
return handler.handle(event);
|
|
34
|
+
}
|
|
35
|
+
register(eventName, handler) {
|
|
36
|
+
this.handlers[eventName] = handler;
|
|
37
|
+
}
|
|
38
|
+
registerDefaultCallbacks(flow) {
|
|
39
|
+
this.register("copy", new CopyEventHandler(flow));
|
|
40
|
+
this.register("select", new SelectEventHandler(flow));
|
|
41
|
+
this.register("selectAll", new SelectAllEventHandler(flow));
|
|
42
|
+
this.register("panning", panningHandlerFactory(flow));
|
|
43
|
+
this.register("keyboardPanning", new KeyboardPanningEventHandler(flow));
|
|
44
|
+
this.register("wheelPanning", new WheelPanningEventHandler(flow));
|
|
45
|
+
this.register("pointerMoveSelection", new PointerMoveSelectionEventHandler(flow));
|
|
46
|
+
this.register("keyboardMoveSelection", new KeyboardMoveSelectionEventHandler(flow));
|
|
47
|
+
this.register("resize", new ResizeEventHandler(flow));
|
|
48
|
+
this.register("paste", new PasteEventHandler(flow));
|
|
49
|
+
this.register("deleteSelection", new DeleteSelectionEventHandler(flow));
|
|
50
|
+
this.register("zoom", new ZoomingEventHandler(flow));
|
|
51
|
+
this.register("linking", new LinkingEventHandler(flow));
|
|
52
|
+
this.register("relinking", new RelinkingEventHandler(flow));
|
|
53
|
+
this.register("rotate", new RotateEventHandler(flow));
|
|
54
|
+
this.register("paletteDrop", new PaletteDropEventHandler(flow));
|
|
55
|
+
this.register("cut", new CutEventHandler(flow));
|
|
56
|
+
this.register("boxSelection", new BoxSelectionEventHandler(flow));
|
|
57
|
+
this.register("undo", new UndoEventHandler(flow));
|
|
58
|
+
this.register("redo", new RedoEventHandler(flow));
|
|
59
|
+
this.register("cancelInteraction", new CancelInteractionEventHandler(flow));
|
|
60
|
+
}
|
|
61
|
+
hasHandler(eventName) {
|
|
62
|
+
return !!this.handlers[eventName];
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Aborts the gesture tracked by the handler registered for `eventName`.
|
|
66
|
+
* No-op when the handler is missing or has no gesture in progress.
|
|
67
|
+
*
|
|
68
|
+
* @returns Whether the handler actually tore anything down
|
|
69
|
+
*/
|
|
70
|
+
async cancel(eventName) {
|
|
71
|
+
return await this.handlers[eventName]?.cancel() ?? false;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export { InputEventsRouter };
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
class InteractionCoordinator {
|
|
2
|
+
constructor(flowCore) {
|
|
3
|
+
this.flowCore = flowCore;
|
|
4
|
+
this.cleanups = /* @__PURE__ */ new Set();
|
|
5
|
+
this.cancelling = false;
|
|
6
|
+
/**
|
|
7
|
+
* Every cancellable gesture: the action-state probe paired with the input
|
|
8
|
+
* event name its handler is registered under. A new cancellable gesture
|
|
9
|
+
* joins {@link hasActiveInteraction} and {@link cancelActiveInteraction} by
|
|
10
|
+
* adding one entry here.
|
|
11
|
+
*/
|
|
12
|
+
this.cancellableGestures = [
|
|
13
|
+
// The `linking` entry covers relinking too: a relink keeps `isLinking()`
|
|
14
|
+
// true and `cancelLinking` branches on `linking.relink`.
|
|
15
|
+
{ event: "linking", isActive: () => this.flowCore.actionStateManager.isLinking() },
|
|
16
|
+
{ event: "pointerMoveSelection", isActive: () => this.flowCore.actionStateManager.isDragging() },
|
|
17
|
+
{ event: "resize", isActive: () => this.flowCore.actionStateManager.isResizing() },
|
|
18
|
+
{ event: "rotate", isActive: () => this.flowCore.actionStateManager.isRotating() },
|
|
19
|
+
{ event: "panning", isActive: () => this.flowCore.actionStateManager.isPanning() }
|
|
20
|
+
];
|
|
21
|
+
}
|
|
22
|
+
/** See {@link FlowCore.registerInteractionCleanup}. */
|
|
23
|
+
registerInteractionCleanup(cleanup) {
|
|
24
|
+
this.cleanups.add(cleanup);
|
|
25
|
+
return () => {
|
|
26
|
+
this.cleanups.delete(cleanup);
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
/** See {@link FlowCore.isCancellingInteraction}. */
|
|
30
|
+
isCancellingInteraction() {
|
|
31
|
+
return this.cancelling;
|
|
32
|
+
}
|
|
33
|
+
/** See {@link FlowCore.hasActiveInteraction}. */
|
|
34
|
+
hasActiveInteraction() {
|
|
35
|
+
return this.cancellableGestures.some((gesture) => gesture.isActive()) || this.cleanups.size > 0;
|
|
36
|
+
}
|
|
37
|
+
/** See {@link FlowCore.cancelActiveInteraction}. */
|
|
38
|
+
async cancelActiveInteraction() {
|
|
39
|
+
if (this.cancelling) {
|
|
40
|
+
return false;
|
|
41
|
+
}
|
|
42
|
+
if (this.flowCore.transactionManager.isActive()) {
|
|
43
|
+
console.warn(
|
|
44
|
+
"[ngDiagram] cancelActiveInteraction() called while a transaction is active \u2014 ignored. The rollback would merge into the transaction and could be discarded with it; await the transaction and cancel afterwards."
|
|
45
|
+
);
|
|
46
|
+
return false;
|
|
47
|
+
}
|
|
48
|
+
const activeGestures = this.cancellableGestures.filter((gesture) => gesture.isActive()).map((gesture) => gesture.event);
|
|
49
|
+
this.cancelling = true;
|
|
50
|
+
try {
|
|
51
|
+
const cleanups = [...this.cleanups];
|
|
52
|
+
this.cleanups.clear();
|
|
53
|
+
for (const cleanup of cleanups) {
|
|
54
|
+
cleanup();
|
|
55
|
+
}
|
|
56
|
+
let cancelledAny = false;
|
|
57
|
+
const errors = [];
|
|
58
|
+
for (const gesture of activeGestures) {
|
|
59
|
+
try {
|
|
60
|
+
cancelledAny = await this.flowCore.inputEventsRouter.cancel(gesture) || cancelledAny;
|
|
61
|
+
} catch (error) {
|
|
62
|
+
errors.push(error);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
if (errors.length > 0) {
|
|
66
|
+
throw errors[0];
|
|
67
|
+
}
|
|
68
|
+
return cancelledAny || cleanups.length > 0;
|
|
69
|
+
} finally {
|
|
70
|
+
this.cancelling = false;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export { InteractionCoordinator };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { BatchProcessor } from '../batch-processor/batch-processor.mjs';
|
|
2
|
+
import { isValidSize } from '../utils/measurement-validation.mjs';
|
|
3
|
+
|
|
4
|
+
class LabelBatchProcessor extends BatchProcessor {
|
|
5
|
+
constructor(getEdgeById) {
|
|
6
|
+
super((edgeId) => {
|
|
7
|
+
const labels = getEdgeById(edgeId)?.measuredLabels ?? [];
|
|
8
|
+
const measured = /* @__PURE__ */ new Set();
|
|
9
|
+
for (const label of labels) {
|
|
10
|
+
if (isValidSize(label.size)) {
|
|
11
|
+
measured.add(label.id);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
return measured;
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export { LabelBatchProcessor };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { normalizeAngle } from '../normalize-angle/normalize-angle.mjs';
|
|
2
|
+
|
|
3
|
+
const angleToSide = (angleDegrees, inverse = false) => {
|
|
4
|
+
const angle = normalizeAngle(angleDegrees);
|
|
5
|
+
let side;
|
|
6
|
+
if (angle >= 315 || angle < 45) {
|
|
7
|
+
side = "right";
|
|
8
|
+
} else if (angle >= 45 && angle < 135) {
|
|
9
|
+
side = "bottom";
|
|
10
|
+
} else if (angle >= 135 && angle < 225) {
|
|
11
|
+
side = "left";
|
|
12
|
+
} else {
|
|
13
|
+
side = "top";
|
|
14
|
+
}
|
|
15
|
+
if (inverse) {
|
|
16
|
+
const opposites = {
|
|
17
|
+
right: "left",
|
|
18
|
+
left: "right",
|
|
19
|
+
top: "bottom",
|
|
20
|
+
bottom: "top"
|
|
21
|
+
};
|
|
22
|
+
return opposites[side];
|
|
23
|
+
}
|
|
24
|
+
return side;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export { angleToSide };
|