@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,40 @@
|
|
|
1
|
+
const DEFAULT_VIEWPORT_WIDTH = 1920;
|
|
2
|
+
const DEFAULT_VIEWPORT_HEIGHT = 1080;
|
|
3
|
+
const RECOMPUTE_THRESHOLD = 0.25;
|
|
4
|
+
const PAN_DISTANCE_THRESHOLD = 0.4;
|
|
5
|
+
const DIMENSION_CHANGE_TOLERANCE = 0.1;
|
|
6
|
+
function isViewportValid(viewport) {
|
|
7
|
+
return !!viewport;
|
|
8
|
+
}
|
|
9
|
+
function getViewportRect(viewport, paddingMultiplier) {
|
|
10
|
+
const { x, y, scale, width, height } = viewport;
|
|
11
|
+
const effectiveWidth = width || DEFAULT_VIEWPORT_WIDTH;
|
|
12
|
+
const effectiveHeight = height || DEFAULT_VIEWPORT_HEIGHT;
|
|
13
|
+
const flowX = -x / scale;
|
|
14
|
+
const flowY = -y / scale;
|
|
15
|
+
const flowWidth = effectiveWidth / scale;
|
|
16
|
+
const flowHeight = effectiveHeight / scale;
|
|
17
|
+
const scaleAdjustedMultiplier = paddingMultiplier * Math.min(1, scale);
|
|
18
|
+
const maxScreenDimension = Math.max(effectiveWidth, effectiveHeight);
|
|
19
|
+
const padding = maxScreenDimension * scaleAdjustedMultiplier / scale;
|
|
20
|
+
return {
|
|
21
|
+
x: flowX - padding,
|
|
22
|
+
y: flowY - padding,
|
|
23
|
+
width: flowWidth + padding * 2,
|
|
24
|
+
height: flowHeight + padding * 2
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
function isViewportSimilar(prev, current) {
|
|
28
|
+
const xThreshold = prev.width * RECOMPUTE_THRESHOLD;
|
|
29
|
+
const yThreshold = prev.height * RECOMPUTE_THRESHOLD;
|
|
30
|
+
const widthTolerance = prev.width * DIMENSION_CHANGE_TOLERANCE;
|
|
31
|
+
const heightTolerance = prev.height * DIMENSION_CHANGE_TOLERANCE;
|
|
32
|
+
return Math.abs(prev.x - current.x) < xThreshold && Math.abs(prev.y - current.y) < yThreshold && Math.abs(prev.width - current.width) < widthTolerance && Math.abs(prev.height - current.height) < heightTolerance;
|
|
33
|
+
}
|
|
34
|
+
function hasMovedTooFar(current, cached) {
|
|
35
|
+
const xThreshold = cached.width * PAN_DISTANCE_THRESHOLD;
|
|
36
|
+
const yThreshold = cached.height * PAN_DISTANCE_THRESHOLD;
|
|
37
|
+
return Math.abs(current.x - cached.x) > xThreshold || Math.abs(current.y - cached.y) > yThreshold;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export { getViewportRect, hasMovedTooFar, isViewportSimilar, isViewportValid };
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { BaseRenderStrategy } from '../base-render-strategy.mjs';
|
|
2
|
+
import { IdleRenderScheduler } from './idle-render-scheduler.mjs';
|
|
3
|
+
import { ResultCache } from './result-cache.mjs';
|
|
4
|
+
import { isViewportValid, getViewportRect } from './viewport-utils.mjs';
|
|
5
|
+
import { VisibleElementsResolver } from './visible-elements-resolver.mjs';
|
|
6
|
+
import { ZoomTracker } from './zoom-tracker.mjs';
|
|
7
|
+
|
|
8
|
+
const EMPTY_SET = /* @__PURE__ */ new Set();
|
|
9
|
+
class VirtualizedRenderStrategy extends BaseRenderStrategy {
|
|
10
|
+
constructor(flowCore) {
|
|
11
|
+
super(flowCore);
|
|
12
|
+
this.cache = new ResultCache();
|
|
13
|
+
// Track nodes reference for optimization (skip spatialHash update during panning/zooming)
|
|
14
|
+
this.lastNodesRef = null;
|
|
15
|
+
// Effective-visibility tracking: the result cache keys on element COUNTS and
|
|
16
|
+
// viewport only, so a hidden/unhidden toggle (counts unchanged) would keep
|
|
17
|
+
// serving a stale render set until the next pan/zoom. The hidden-computation
|
|
18
|
+
// middleware bumps flowCore.visibilityGeneration whenever effective
|
|
19
|
+
// visibility actually changed — an O(1) signal checked per model change,
|
|
20
|
+
// keeping this hot path free of per-element work.
|
|
21
|
+
this.lastVisibilityVersion = 0;
|
|
22
|
+
this.visibleElementsResolver = new VisibleElementsResolver(flowCore);
|
|
23
|
+
this.zoomTracker = new ZoomTracker(() => this.invalidateAndRender());
|
|
24
|
+
this.idleRenderScheduler = new IdleRenderScheduler(flowCore, () => this.invalidateAndRender());
|
|
25
|
+
}
|
|
26
|
+
init() {
|
|
27
|
+
this.flowCore.spatialHash.process(this.flowCore.model.getNodes());
|
|
28
|
+
this.lastVisibilityVersion = this.flowCore.visibilityGeneration.version;
|
|
29
|
+
this.flowCore.model.onChange((state) => {
|
|
30
|
+
if (state.nodes !== this.lastNodesRef) {
|
|
31
|
+
this.flowCore.spatialHash.process(state.nodes);
|
|
32
|
+
this.flowCore.modelLookup.desynchronize();
|
|
33
|
+
this.lastNodesRef = state.nodes;
|
|
34
|
+
}
|
|
35
|
+
if (this.flowCore.visibilityGeneration.version !== this.lastVisibilityVersion) {
|
|
36
|
+
this.lastVisibilityVersion = this.flowCore.visibilityGeneration.version;
|
|
37
|
+
this.cache.invalidate();
|
|
38
|
+
}
|
|
39
|
+
this.render();
|
|
40
|
+
});
|
|
41
|
+
this.idleRenderScheduler.init();
|
|
42
|
+
this.render();
|
|
43
|
+
const { nodes, edges, metadata } = this.flowCore.getState();
|
|
44
|
+
const result = this.process(nodes, edges, metadata.viewport);
|
|
45
|
+
this.flowCore.initUpdater.start(result.nodes, result.edges, async () => {
|
|
46
|
+
await this.flowCore.commandHandler.emit("init", {
|
|
47
|
+
renderedNodeIds: result.nodes.map((n) => n.id),
|
|
48
|
+
renderedEdgeIds: result.edges.map((e) => e.id)
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
process(nodes, edges, viewport) {
|
|
53
|
+
const config = this.flowCore.config.virtualization;
|
|
54
|
+
if (!isViewportValid(viewport)) {
|
|
55
|
+
return { nodes, edges, nodeIds: EMPTY_SET, edgeIds: EMPTY_SET };
|
|
56
|
+
}
|
|
57
|
+
this.zoomTracker.handleScaleChange(viewport.scale);
|
|
58
|
+
const padding = config.padding;
|
|
59
|
+
const viewportRect = getViewportRect(viewport, padding);
|
|
60
|
+
const hasCache = this.cache.hasCache();
|
|
61
|
+
if (this.zoomTracker.getIsZooming() && hasCache) {
|
|
62
|
+
return this.cache.get(nodes, edges);
|
|
63
|
+
}
|
|
64
|
+
if (this.flowCore.actionStateManager.isPanning() && hasCache) {
|
|
65
|
+
return this.cache.get(nodes, edges);
|
|
66
|
+
}
|
|
67
|
+
if (this.cache.canUse(nodes.length, edges.length, viewportRect)) {
|
|
68
|
+
return this.cache.get(nodes, edges);
|
|
69
|
+
}
|
|
70
|
+
const result = this.visibleElementsResolver.resolve(viewportRect);
|
|
71
|
+
this.cache.set(result, nodes, edges, viewportRect);
|
|
72
|
+
return result;
|
|
73
|
+
}
|
|
74
|
+
destroy() {
|
|
75
|
+
this.zoomTracker.destroy();
|
|
76
|
+
this.idleRenderScheduler.destroy();
|
|
77
|
+
}
|
|
78
|
+
isNodeRendered(nodeId) {
|
|
79
|
+
const viewport = this.flowCore.model.getMetadata().viewport;
|
|
80
|
+
if (!isViewportValid(viewport)) {
|
|
81
|
+
return true;
|
|
82
|
+
}
|
|
83
|
+
return this.cache.isNodeInCache(nodeId);
|
|
84
|
+
}
|
|
85
|
+
invalidateAndRender() {
|
|
86
|
+
this.cache.invalidateViewport();
|
|
87
|
+
this.render();
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export { VirtualizedRenderStrategy };
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { doesRectsIntersect, boundingRectOfPoints } from '../../utils/rects-points-sizes.mjs';
|
|
2
|
+
import { isGroup } from '../../utils/is-group.mjs';
|
|
3
|
+
|
|
4
|
+
class VisibleElementsResolver {
|
|
5
|
+
constructor(flowCore) {
|
|
6
|
+
this.flowCore = flowCore;
|
|
7
|
+
}
|
|
8
|
+
resolve(viewportRect) {
|
|
9
|
+
const primaryVisibleIds = this.getPrimaryVisibleIds(viewportRect);
|
|
10
|
+
const { edges, edgeIds, externalNodeIds } = this.collectVisibleEdges(primaryVisibleIds);
|
|
11
|
+
this.collectVisibleDanglingEdges(viewportRect, primaryVisibleIds, edges, edgeIds, externalNodeIds);
|
|
12
|
+
const { nodes, nodeIds } = this.buildNodeList(primaryVisibleIds, externalNodeIds);
|
|
13
|
+
return { nodes, edges, nodeIds, edgeIds };
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Adds dangling edges whose visible geometry intersects the viewport.
|
|
17
|
+
* Edge discovery walks connected edges of visible nodes, which can never
|
|
18
|
+
* reach an edge through a free ('' ) endpoint — a dual dangling edge is
|
|
19
|
+
* unreachable that way, and a single-dangling edge disappears the moment its
|
|
20
|
+
* only node scrolls out even when its free endpoint is still on screen.
|
|
21
|
+
*/
|
|
22
|
+
collectVisibleDanglingEdges(viewportRect, primaryVisibleIds, edges, edgeIds, externalNodeIds) {
|
|
23
|
+
for (const edge of this.flowCore.modelLookup.danglingEdges) {
|
|
24
|
+
if (edgeIds.has(edge.id) || edge.computedHidden) {
|
|
25
|
+
continue;
|
|
26
|
+
}
|
|
27
|
+
if (!this.intersectsViewport(edge, viewportRect)) {
|
|
28
|
+
continue;
|
|
29
|
+
}
|
|
30
|
+
edges.push(edge);
|
|
31
|
+
edgeIds.add(edge.id);
|
|
32
|
+
const connectedNodeId = edge.source || edge.target;
|
|
33
|
+
if (connectedNodeId && !primaryVisibleIds.has(connectedNodeId)) {
|
|
34
|
+
externalNodeIds.add(connectedNodeId);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Whether the bounding box of the edge's routed points and free-endpoint
|
|
40
|
+
* anchors intersects the rect. Bounding-box overlap can render an edge whose
|
|
41
|
+
* path merely skirts the viewport (a benign false positive) but never drops
|
|
42
|
+
* one that crosses it.
|
|
43
|
+
*/
|
|
44
|
+
intersectsViewport(edge, rect) {
|
|
45
|
+
const anchors = [
|
|
46
|
+
...edge.points ?? [],
|
|
47
|
+
...!edge.source && edge.sourcePosition ? [edge.sourcePosition] : [],
|
|
48
|
+
...!edge.target && edge.targetPosition ? [edge.targetPosition] : []
|
|
49
|
+
];
|
|
50
|
+
if (anchors.length === 0) {
|
|
51
|
+
return false;
|
|
52
|
+
}
|
|
53
|
+
return doesRectsIntersect(boundingRectOfPoints(anchors), rect);
|
|
54
|
+
}
|
|
55
|
+
getPrimaryVisibleIds(viewportRect) {
|
|
56
|
+
const primaryVisibleIds = new Set(this.flowCore.spatialHash.queryIds(viewportRect));
|
|
57
|
+
this.addGroupDescendants(primaryVisibleIds);
|
|
58
|
+
return primaryVisibleIds;
|
|
59
|
+
}
|
|
60
|
+
addGroupDescendants(nodeIds) {
|
|
61
|
+
const nodesMap = this.flowCore.modelLookup.nodesMap;
|
|
62
|
+
const currentIds = Array.from(nodeIds);
|
|
63
|
+
for (const nodeId of currentIds) {
|
|
64
|
+
const node = nodesMap.get(nodeId);
|
|
65
|
+
if (node && isGroup(node)) {
|
|
66
|
+
for (const descendantId of this.flowCore.modelLookup.getAllDescendantIds(nodeId)) {
|
|
67
|
+
if (nodesMap.get(descendantId)?.computedHidden) {
|
|
68
|
+
continue;
|
|
69
|
+
}
|
|
70
|
+
nodeIds.add(descendantId);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Collects edges connected to primary visible nodes and identifies external nodes.
|
|
77
|
+
* External nodes are nodes outside viewport but connected to visible nodes.
|
|
78
|
+
*/
|
|
79
|
+
collectVisibleEdges(primaryVisibleIds) {
|
|
80
|
+
const edges = [];
|
|
81
|
+
const edgeIds = /* @__PURE__ */ new Set();
|
|
82
|
+
const externalNodeIds = /* @__PURE__ */ new Set();
|
|
83
|
+
for (const nodeId of primaryVisibleIds) {
|
|
84
|
+
for (const edge of this.flowCore.modelLookup.getConnectedEdges(nodeId)) {
|
|
85
|
+
if (edgeIds.has(edge.id)) {
|
|
86
|
+
continue;
|
|
87
|
+
}
|
|
88
|
+
if (edge.computedHidden) {
|
|
89
|
+
continue;
|
|
90
|
+
}
|
|
91
|
+
edges.push(edge);
|
|
92
|
+
edgeIds.add(edge.id);
|
|
93
|
+
if (!primaryVisibleIds.has(edge.source)) {
|
|
94
|
+
externalNodeIds.add(edge.source);
|
|
95
|
+
}
|
|
96
|
+
if (!primaryVisibleIds.has(edge.target)) {
|
|
97
|
+
externalNodeIds.add(edge.target);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
return { edges, edgeIds, externalNodeIds };
|
|
102
|
+
}
|
|
103
|
+
buildNodeList(primaryVisibleIds, externalNodeIds) {
|
|
104
|
+
const nodesMap = this.flowCore.modelLookup.nodesMap;
|
|
105
|
+
const nodeIds = new Set(primaryVisibleIds);
|
|
106
|
+
for (const id of externalNodeIds) {
|
|
107
|
+
nodeIds.add(id);
|
|
108
|
+
}
|
|
109
|
+
const nodes = [];
|
|
110
|
+
for (const id of nodeIds) {
|
|
111
|
+
const node = nodesMap.get(id);
|
|
112
|
+
if (node) {
|
|
113
|
+
nodes.push(node);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
return { nodes, nodeIds };
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export { VisibleElementsResolver };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
const ZOOM_IDLE_DELAY = 300;
|
|
2
|
+
class ZoomTracker {
|
|
3
|
+
constructor(onZoomEnd) {
|
|
4
|
+
this.onZoomEnd = onZoomEnd;
|
|
5
|
+
this.lastScale = null;
|
|
6
|
+
this.isZooming = false;
|
|
7
|
+
this.zoomIdleTimeout = null;
|
|
8
|
+
}
|
|
9
|
+
handleScaleChange(currentScale) {
|
|
10
|
+
const scaleChanged = this.lastScale !== null && this.lastScale !== currentScale;
|
|
11
|
+
if (scaleChanged) {
|
|
12
|
+
this.isZooming = true;
|
|
13
|
+
this.scheduleZoomIdle();
|
|
14
|
+
}
|
|
15
|
+
this.lastScale = currentScale;
|
|
16
|
+
}
|
|
17
|
+
getIsZooming() {
|
|
18
|
+
return this.isZooming;
|
|
19
|
+
}
|
|
20
|
+
destroy() {
|
|
21
|
+
if (this.zoomIdleTimeout) {
|
|
22
|
+
clearTimeout(this.zoomIdleTimeout);
|
|
23
|
+
this.zoomIdleTimeout = null;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
scheduleZoomIdle() {
|
|
27
|
+
if (this.zoomIdleTimeout) {
|
|
28
|
+
clearTimeout(this.zoomIdleTimeout);
|
|
29
|
+
}
|
|
30
|
+
this.zoomIdleTimeout = setTimeout(() => {
|
|
31
|
+
this.isZooming = false;
|
|
32
|
+
this.zoomIdleTimeout = null;
|
|
33
|
+
this.onZoomEnd();
|
|
34
|
+
}, ZOOM_IDLE_DELAY);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export { ZoomTracker };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
(function() {
|
|
2
|
+
if (!Set.prototype.difference) {
|
|
3
|
+
Set.prototype.difference = function(other) {
|
|
4
|
+
const result = /* @__PURE__ */ new Set();
|
|
5
|
+
for (const elem of this) {
|
|
6
|
+
if (!other.has(elem)) {
|
|
7
|
+
result.add(elem);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
return result;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
if (!Set.prototype.intersection) {
|
|
14
|
+
Set.prototype.intersection = function(other) {
|
|
15
|
+
const result = /* @__PURE__ */ new Set();
|
|
16
|
+
for (const elem of this) {
|
|
17
|
+
if (other.has(elem)) {
|
|
18
|
+
result.add(elem);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
return result;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
})();
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
const DEFAULT_SHORTCUTS = [
|
|
2
|
+
// Clipboard operations
|
|
3
|
+
{
|
|
4
|
+
actionName: "copy",
|
|
5
|
+
bindings: [{ key: "c", modifiers: { primary: true } }]
|
|
6
|
+
},
|
|
7
|
+
{
|
|
8
|
+
actionName: "cut",
|
|
9
|
+
bindings: [{ key: "x", modifiers: { primary: true } }]
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
actionName: "paste",
|
|
13
|
+
bindings: [{ key: "v", modifiers: { primary: true } }]
|
|
14
|
+
},
|
|
15
|
+
// Delete selection
|
|
16
|
+
{
|
|
17
|
+
actionName: "deleteSelection",
|
|
18
|
+
bindings: [{ key: "Delete" }, { key: "Backspace" }]
|
|
19
|
+
},
|
|
20
|
+
// Abort the in-progress interactive gesture (linking, drag, resize, rotate, pan)
|
|
21
|
+
{
|
|
22
|
+
actionName: "cancelInteraction",
|
|
23
|
+
bindings: [{ key: "Escape" }]
|
|
24
|
+
},
|
|
25
|
+
// Move selected nodes with arrow keys
|
|
26
|
+
{
|
|
27
|
+
actionName: "keyboardMoveSelectionUp",
|
|
28
|
+
bindings: [{ key: "ArrowUp" }]
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
actionName: "keyboardMoveSelectionDown",
|
|
32
|
+
bindings: [{ key: "ArrowDown" }]
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
actionName: "keyboardMoveSelectionLeft",
|
|
36
|
+
bindings: [{ key: "ArrowLeft" }]
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
actionName: "keyboardMoveSelectionRight",
|
|
40
|
+
bindings: [{ key: "ArrowRight" }]
|
|
41
|
+
},
|
|
42
|
+
// Pan viewport with arrow keys
|
|
43
|
+
{
|
|
44
|
+
actionName: "keyboardPanUp",
|
|
45
|
+
bindings: [{ key: "ArrowUp" }]
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
actionName: "keyboardPanDown",
|
|
49
|
+
bindings: [{ key: "ArrowDown" }]
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
actionName: "keyboardPanLeft",
|
|
53
|
+
bindings: [{ key: "ArrowLeft" }]
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
actionName: "keyboardPanRight",
|
|
57
|
+
bindings: [{ key: "ArrowRight" }]
|
|
58
|
+
},
|
|
59
|
+
// Box selection (modifier-only shortcut)
|
|
60
|
+
{
|
|
61
|
+
actionName: "boxSelection",
|
|
62
|
+
bindings: [{ modifiers: { shift: true } }]
|
|
63
|
+
},
|
|
64
|
+
// Preserve selection when clicking another node (modifier-only shortcut)
|
|
65
|
+
{
|
|
66
|
+
actionName: "multiSelection",
|
|
67
|
+
bindings: [{ modifiers: { primary: true } }]
|
|
68
|
+
},
|
|
69
|
+
// Select all nodes and edges
|
|
70
|
+
{
|
|
71
|
+
actionName: "selectAll",
|
|
72
|
+
bindings: [{ key: "a", modifiers: { primary: true } }]
|
|
73
|
+
},
|
|
74
|
+
// Undo/Redo operations
|
|
75
|
+
{
|
|
76
|
+
actionName: "undo",
|
|
77
|
+
bindings: [{ key: "z", modifiers: { primary: true } }]
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
actionName: "redo",
|
|
81
|
+
bindings: [{ key: "y", modifiers: { primary: true } }]
|
|
82
|
+
},
|
|
83
|
+
// Zoom In/Out (modifier-only shortcut)
|
|
84
|
+
{
|
|
85
|
+
actionName: "zoom",
|
|
86
|
+
bindings: [{ modifiers: { primary: true } }]
|
|
87
|
+
},
|
|
88
|
+
// Zoom In/Out with keyboard
|
|
89
|
+
{
|
|
90
|
+
actionName: "keyboardZoomIn",
|
|
91
|
+
bindings: [{ key: "=" }]
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
actionName: "keyboardZoomOut",
|
|
95
|
+
bindings: [{ key: "-" }]
|
|
96
|
+
}
|
|
97
|
+
];
|
|
98
|
+
|
|
99
|
+
export { DEFAULT_SHORTCUTS };
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { DEFAULT_SHORTCUTS } from './default-shortcuts.mjs';
|
|
2
|
+
|
|
3
|
+
function configureShortcuts(userShortcuts, baseShortcuts = DEFAULT_SHORTCUTS) {
|
|
4
|
+
const shortcutMap = /* @__PURE__ */ new Map();
|
|
5
|
+
for (const shortcut of baseShortcuts) {
|
|
6
|
+
shortcutMap.set(shortcut.actionName, shortcut);
|
|
7
|
+
}
|
|
8
|
+
for (const shortcut of userShortcuts) {
|
|
9
|
+
shortcutMap.set(shortcut.actionName, shortcut);
|
|
10
|
+
}
|
|
11
|
+
return Array.from(shortcutMap.values());
|
|
12
|
+
}
|
|
13
|
+
class ShortcutManager {
|
|
14
|
+
constructor(flowCore) {
|
|
15
|
+
this.flowCore = flowCore;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Find all matching shortcuts for normalized keyboard input
|
|
19
|
+
*
|
|
20
|
+
* Each shortcut must have a binding that matches the input
|
|
21
|
+
*
|
|
22
|
+
* @param input - Normalized keyboard input (key + already-normalized modifiers)
|
|
23
|
+
* @returns Array of matching shortcut definitions (empty if no matches)
|
|
24
|
+
*/
|
|
25
|
+
match(input) {
|
|
26
|
+
const { shortcuts } = this.flowCore.config;
|
|
27
|
+
const matches = [];
|
|
28
|
+
for (const shortcut of shortcuts) {
|
|
29
|
+
for (const binding of shortcut.bindings) {
|
|
30
|
+
if (this.matchBinding(input, binding)) {
|
|
31
|
+
matches.push(shortcut);
|
|
32
|
+
break;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return matches;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Check if the current modifiers match any binding for a specific action
|
|
40
|
+
*
|
|
41
|
+
* Useful for checking modifier-only shortcuts (like box-selection triggered by pointer events)
|
|
42
|
+
*
|
|
43
|
+
* @param actionName - The action name to check
|
|
44
|
+
* @param modifiers - The current modifier state
|
|
45
|
+
* @returns true if any binding for this action matches the modifiers
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* // Check if current modifiers match box selection shortcut
|
|
49
|
+
* if (shortcutManager.matchesAction('boxSelection', { modifiers: event.modifiers })) {
|
|
50
|
+
* // Start box selection
|
|
51
|
+
* }
|
|
52
|
+
*/
|
|
53
|
+
matchesAction(actionName, input) {
|
|
54
|
+
const { shortcuts } = this.flowCore.config;
|
|
55
|
+
const shortcut = shortcuts.find((s) => s.actionName === actionName);
|
|
56
|
+
if (!shortcut) {
|
|
57
|
+
return false;
|
|
58
|
+
}
|
|
59
|
+
return shortcut.bindings.some((binding) => this.matchBinding(input, binding));
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Check if a normalized keyboard input matches a shortcut binding
|
|
63
|
+
*
|
|
64
|
+
* Compares:
|
|
65
|
+
* - Key values (if specified in binding) - case-insensitive for single letters
|
|
66
|
+
* - Modifier states
|
|
67
|
+
*
|
|
68
|
+
* Matching rules:
|
|
69
|
+
* - If binding has a key: input must have the same key (case-insensitive for letters)
|
|
70
|
+
* - If binding has no key (modifier-only): input must also have no key
|
|
71
|
+
* (modifier-only shortcuts are for pointer events, not keyboard events)
|
|
72
|
+
*
|
|
73
|
+
* @param input - Normalized keyboard input
|
|
74
|
+
* @param binding - Shortcut binding to match against
|
|
75
|
+
* @returns true if the input matches the binding
|
|
76
|
+
*/
|
|
77
|
+
matchBinding(input, binding) {
|
|
78
|
+
if (binding.key !== void 0 && !this.keysMatch(input.key, binding.key)) {
|
|
79
|
+
return false;
|
|
80
|
+
}
|
|
81
|
+
if (binding.key === void 0 && input.key !== void 0) {
|
|
82
|
+
return false;
|
|
83
|
+
}
|
|
84
|
+
return this.matchModifiers(input.modifiers, binding);
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Check if modifiers match a binding's modifier requirements
|
|
88
|
+
*
|
|
89
|
+
* Ensures exact modifier matching:
|
|
90
|
+
* - All modifiers specified in binding must match the input
|
|
91
|
+
* - All modifiers NOT specified in binding must be false in the input
|
|
92
|
+
* - Exception: meta modifier is ignored when checking if not explicitly specified in binding,
|
|
93
|
+
* because on macOS, meta and primary both map to the Command key
|
|
94
|
+
*
|
|
95
|
+
* @param modifiers - Current modifier state
|
|
96
|
+
* @param binding - Shortcut binding to match against
|
|
97
|
+
* @returns true if modifiers match the binding's requirements exactly
|
|
98
|
+
*/
|
|
99
|
+
matchModifiers(modifiers, binding) {
|
|
100
|
+
const expectedPrimary = binding.modifiers?.primary ?? false;
|
|
101
|
+
if (modifiers.primary !== expectedPrimary) {
|
|
102
|
+
return false;
|
|
103
|
+
}
|
|
104
|
+
const expectedShift = binding.modifiers?.shift ?? false;
|
|
105
|
+
if (modifiers.shift !== expectedShift) {
|
|
106
|
+
return false;
|
|
107
|
+
}
|
|
108
|
+
const expectedSecondary = binding.modifiers?.secondary ?? false;
|
|
109
|
+
if (modifiers.secondary !== expectedSecondary) {
|
|
110
|
+
return false;
|
|
111
|
+
}
|
|
112
|
+
if (binding.modifiers?.meta !== void 0) {
|
|
113
|
+
if (modifiers.meta !== binding.modifiers.meta) {
|
|
114
|
+
return false;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
return true;
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Check if two keys match, using case-insensitive comparison for single letters
|
|
121
|
+
*
|
|
122
|
+
* This ensures shortcuts work regardless of CapsLock state.
|
|
123
|
+
* Special keys like "Delete", "ArrowUp", etc. are compared as-is.
|
|
124
|
+
*
|
|
125
|
+
* @param inputKey - The key from the keyboard input
|
|
126
|
+
* @param bindingKey - The key defined in the shortcut binding
|
|
127
|
+
* @returns true if the keys match
|
|
128
|
+
*/
|
|
129
|
+
keysMatch(inputKey, bindingKey) {
|
|
130
|
+
if (inputKey === void 0) {
|
|
131
|
+
return false;
|
|
132
|
+
}
|
|
133
|
+
if (inputKey.length === 1 && bindingKey.length === 1) {
|
|
134
|
+
return inputKey.toLowerCase() === bindingKey.toLowerCase();
|
|
135
|
+
}
|
|
136
|
+
return inputKey === bindingKey;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
export { ShortcutManager, configureShortcuts };
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { getRotatedCorners, getRect } from '../utils/rects-points-sizes.mjs';
|
|
2
|
+
|
|
3
|
+
const checkCollision = (a, b) => {
|
|
4
|
+
if (isNode(a) && !a.size) {
|
|
5
|
+
return false;
|
|
6
|
+
}
|
|
7
|
+
if (isNode(b) && !b.size) {
|
|
8
|
+
return false;
|
|
9
|
+
}
|
|
10
|
+
const cornersA = getCollisionCorners(a);
|
|
11
|
+
const cornersB = getCollisionCorners(b);
|
|
12
|
+
if (cornersA.length === 0 || cornersB.length === 0) {
|
|
13
|
+
return false;
|
|
14
|
+
}
|
|
15
|
+
const axes = [...getRectangleAxes(cornersA), ...getRectangleAxes(cornersB)];
|
|
16
|
+
for (const axis of axes) {
|
|
17
|
+
const projA = projectRectangle(cornersA, axis);
|
|
18
|
+
const projB = projectRectangle(cornersB, axis);
|
|
19
|
+
if (!projectionsOverlap(projA, projB)) {
|
|
20
|
+
return false;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return true;
|
|
24
|
+
};
|
|
25
|
+
const isNode = (obj) => {
|
|
26
|
+
return "position" in obj;
|
|
27
|
+
};
|
|
28
|
+
const getCollisionCorners = (obj) => {
|
|
29
|
+
if (isNode(obj)) {
|
|
30
|
+
if (!obj.size) {
|
|
31
|
+
return [];
|
|
32
|
+
}
|
|
33
|
+
return getRotatedCorners(getRect(obj), obj.angle ?? 0);
|
|
34
|
+
}
|
|
35
|
+
return getRotatedCorners(obj, obj.angle ?? 0);
|
|
36
|
+
};
|
|
37
|
+
const projectRectangle = (corners, axis) => {
|
|
38
|
+
let min = corners[0].x * axis.x + corners[0].y * axis.y;
|
|
39
|
+
let max = min;
|
|
40
|
+
for (let i = 1; i < corners.length; i++) {
|
|
41
|
+
const projection = corners[i].x * axis.x + corners[i].y * axis.y;
|
|
42
|
+
if (projection < min) {
|
|
43
|
+
min = projection;
|
|
44
|
+
}
|
|
45
|
+
if (projection > max) {
|
|
46
|
+
max = projection;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
return { min, max };
|
|
50
|
+
};
|
|
51
|
+
const projectionsOverlap = (proj1, proj2) => {
|
|
52
|
+
return !(proj1.max < proj2.min || proj2.max < proj1.min);
|
|
53
|
+
};
|
|
54
|
+
const getRectangleAxes = (corners) => {
|
|
55
|
+
const axes = [];
|
|
56
|
+
for (let i = 0; i < corners.length; i++) {
|
|
57
|
+
const p1 = corners[i];
|
|
58
|
+
const p2 = corners[(i + 1) % corners.length];
|
|
59
|
+
const edge = {
|
|
60
|
+
x: p2.x - p1.x,
|
|
61
|
+
y: p2.y - p1.y
|
|
62
|
+
};
|
|
63
|
+
const length = Math.sqrt(edge.x * edge.x + edge.y * edge.y);
|
|
64
|
+
if (length > 0) {
|
|
65
|
+
axes.push({
|
|
66
|
+
x: -edge.y / length,
|
|
67
|
+
y: edge.x / length
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return axes;
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
export { checkCollision };
|