@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,298 @@
|
|
|
1
|
+
import { html, nothing, svg } from 'lit';
|
|
2
|
+
import { property } from 'lit/decorators.js';
|
|
3
|
+
import { guard } from 'lit/directives/guard.js';
|
|
4
|
+
import { repeat } from 'lit/directives/repeat.js';
|
|
5
|
+
import { styleMap } from 'lit/directives/style-map.js';
|
|
6
|
+
import { combineDiagramAndViewportBounds, convertViewportToDiagramBounds, calculateMinimapTransform, transformViewportToMinimapSpace } from '../../diagram/minimap/minimap-calculations.mjs';
|
|
7
|
+
import { MinimapNavigationController } from '../../diagram/minimap/minimap-navigation-controller.mjs';
|
|
8
|
+
import { DirectMinimapStrategy, VirtualizedMinimapStrategy } from '../../diagram/minimap/minimap-strategies.mjs';
|
|
9
|
+
import { DiagramReferenceController, DIAGRAM_TOKENS_ATTRIBUTE, isInsideDiagramTokens } from '../../diagram/runtime/diagram-reference.mjs';
|
|
10
|
+
import { DiagramObserver } from '../../diagram/runtime/observable.mjs';
|
|
11
|
+
import { createMinimapNodeTemplateResolver } from '../../diagram/runtime/template-resolver.mjs';
|
|
12
|
+
import customBooleanConverter from '../../internal/custom-boolean-converter.mjs';
|
|
13
|
+
import FlowRdfElement from '../../internal/flow-ui-rdf-element.mjs';
|
|
14
|
+
import FlowUiDiagramZoomControls from '../diagram-zoom-controls/diagram-zoom-controls.component.mjs';
|
|
15
|
+
import styles from './diagram-minimap.styles.mjs';
|
|
16
|
+
|
|
17
|
+
var __defProp = Object.defineProperty;
|
|
18
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
19
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
20
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
21
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
22
|
+
if (decorator = decorators[i])
|
|
23
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
24
|
+
if (kind && result)
|
|
25
|
+
__defProp(target, key, result);
|
|
26
|
+
return result;
|
|
27
|
+
};
|
|
28
|
+
const VIEWPORT_STROKE_WIDTH_PROPERTY = "--flow-ui-diagram-minimap-viewport-stroke-width";
|
|
29
|
+
const ZERO_RECT = { x: 0, y: 0, width: 0, height: 0 };
|
|
30
|
+
const DEFAULT_VIEWPORT = { x: 0, y: 0, scale: 1 };
|
|
31
|
+
const isInteracting = (actionState) => !!actionState?.dragging?.movementStarted || !!actionState?.resize || !!actionState?.rotation;
|
|
32
|
+
class FlowUiDiagramMinimap extends FlowRdfElement {
|
|
33
|
+
constructor() {
|
|
34
|
+
super();
|
|
35
|
+
this.position = "bottom-right";
|
|
36
|
+
this.width = 200;
|
|
37
|
+
this.height = 150;
|
|
38
|
+
this.showZoomControls = true;
|
|
39
|
+
this.deferNodeUpdates = false;
|
|
40
|
+
this.nodesObserver = new DiagramObserver(this);
|
|
41
|
+
this.viewportObserver = new DiagramObserver(this);
|
|
42
|
+
this.initializedObserver = new DiagramObserver(this);
|
|
43
|
+
this.actionStateObserver = new DiagramObserver(this);
|
|
44
|
+
this.flowCoreObserver = new DiagramObserver(this);
|
|
45
|
+
this.templates = createMinimapNodeTemplateResolver();
|
|
46
|
+
this.templateLookup = (type) => this.templates.resolve(type);
|
|
47
|
+
this.directStrategy = new DirectMinimapStrategy(() => this.nodesObserver.value ?? []);
|
|
48
|
+
this.virtualizedStrategy = new VirtualizedMinimapStrategy(
|
|
49
|
+
() => this.flowCoreObserver.value?.getState().nodes ?? []
|
|
50
|
+
);
|
|
51
|
+
/** Cached stroke width, read once from CSS, so rendering does not call `getComputedStyle()`. */
|
|
52
|
+
this.strokePadding = 1;
|
|
53
|
+
// Memoized per render input, so a pan (only the viewport changes) does not recompute the nodes
|
|
54
|
+
this.memoKey = [];
|
|
55
|
+
this.minimapNodes = [];
|
|
56
|
+
this.diagramBounds = ZERO_RECT;
|
|
57
|
+
this.transform = { scale: 1, offsetX: 0, offsetY: 0 };
|
|
58
|
+
this.viewportRect = { x: 0, y: 0, width: 0, height: 0 };
|
|
59
|
+
this.reference = new DiagramReferenceController(this, {
|
|
60
|
+
getReference: () => this.diagram,
|
|
61
|
+
onChange: (runtime) => this.observeRuntime(runtime)
|
|
62
|
+
});
|
|
63
|
+
this.navigation = new MinimapNavigationController(this, () => this.reference.runtime, {
|
|
64
|
+
getTransform: () => this.transform,
|
|
65
|
+
getViewport: () => this.viewport,
|
|
66
|
+
getViewportRect: () => this.viewportRect,
|
|
67
|
+
getSize: () => ({ width: this.width, height: this.height })
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
connectedCallback() {
|
|
71
|
+
super.connectedCallback();
|
|
72
|
+
if (!this.hasAttribute("slot") && this.parentElement?.localName === "flow-ui-diagram") {
|
|
73
|
+
this.setAttribute("slot", "overlay");
|
|
74
|
+
}
|
|
75
|
+
this.toggleAttribute(DIAGRAM_TOKENS_ATTRIBUTE, !isInsideDiagramTokens(this));
|
|
76
|
+
}
|
|
77
|
+
willUpdate(changed) {
|
|
78
|
+
if (changed.has("diagram")) {
|
|
79
|
+
this.reference.update();
|
|
80
|
+
}
|
|
81
|
+
if (changed.has("nodeTemplateMap")) {
|
|
82
|
+
this.templates.setMap(this.nodeTemplateMap);
|
|
83
|
+
this.templateLookup = (type) => this.templates.resolve(type);
|
|
84
|
+
}
|
|
85
|
+
this.computeLayout();
|
|
86
|
+
}
|
|
87
|
+
firstUpdated() {
|
|
88
|
+
const strokeWidth = parseFloat(getComputedStyle(this).getPropertyValue(VIEWPORT_STROKE_WIDTH_PROPERTY).trim());
|
|
89
|
+
if (strokeWidth && strokeWidth !== this.strokePadding) {
|
|
90
|
+
this.strokePadding = strokeWidth;
|
|
91
|
+
this.requestUpdate();
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
observeRuntime(runtime) {
|
|
95
|
+
this.nodesObserver.setSource(runtime?.renderer.nodes);
|
|
96
|
+
this.viewportObserver.setSource(runtime?.renderer.viewport);
|
|
97
|
+
this.initializedObserver.setSource(runtime?.isInitialized);
|
|
98
|
+
this.actionStateObserver.setSource(runtime?.actionState);
|
|
99
|
+
this.flowCoreObserver.setSource(runtime?.flowCore);
|
|
100
|
+
}
|
|
101
|
+
get viewport() {
|
|
102
|
+
return this.viewportObserver.value ?? DEFAULT_VIEWPORT;
|
|
103
|
+
}
|
|
104
|
+
get initialized() {
|
|
105
|
+
return !!this.initializedObserver.value;
|
|
106
|
+
}
|
|
107
|
+
/** The strategy for the rendering mode. Switching virtualization re-creates the engine, so this is stable. */
|
|
108
|
+
get strategy() {
|
|
109
|
+
return this.initialized && this.flowCoreObserver.value?.isVirtualizationActive ? this.virtualizedStrategy : this.directStrategy;
|
|
110
|
+
}
|
|
111
|
+
get showDiagramBounds() {
|
|
112
|
+
return this.initialized && !!this.flowCoreObserver.value?.isVirtualizationActive;
|
|
113
|
+
}
|
|
114
|
+
computeLayout() {
|
|
115
|
+
const strategy = this.strategy;
|
|
116
|
+
const deferring = this.deferNodeUpdates && isInteracting(this.actionStateObserver.value);
|
|
117
|
+
if (!deferring) {
|
|
118
|
+
const key = [
|
|
119
|
+
strategy,
|
|
120
|
+
this.nodesObserver.value,
|
|
121
|
+
this.nodeStyle,
|
|
122
|
+
this.templateLookup,
|
|
123
|
+
this.flowCoreObserver.value
|
|
124
|
+
];
|
|
125
|
+
if (key.length !== this.memoKey.length || key.some((value, index) => value !== this.memoKey[index])) {
|
|
126
|
+
this.memoKey = key;
|
|
127
|
+
this.minimapNodes = strategy.computeMinimapNodes(this.nodeStyle, this.templateLookup);
|
|
128
|
+
this.diagramBounds = strategy.computeDiagramBounds();
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
const viewport = this.viewport;
|
|
132
|
+
const bounds = combineDiagramAndViewportBounds(this.diagramBounds, convertViewportToDiagramBounds(viewport));
|
|
133
|
+
this.transform = calculateMinimapTransform(bounds, this.width, this.height, this.strokePadding);
|
|
134
|
+
this.viewportRect = transformViewportToMinimapSpace(viewport, this.transform);
|
|
135
|
+
}
|
|
136
|
+
render() {
|
|
137
|
+
const { width, height } = this;
|
|
138
|
+
const initialized = this.initialized;
|
|
139
|
+
return html`
|
|
140
|
+
<div part="base" class="panel minimap">
|
|
141
|
+
<div class="minimap__stage" style=${styleMap({ width: `${width}px`, height: `${height}px` })}>
|
|
142
|
+
${initialized ? this.renderNodeLayer() : nothing}
|
|
143
|
+
<svg
|
|
144
|
+
part="svg"
|
|
145
|
+
class="minimap__svg"
|
|
146
|
+
viewBox="0 0 ${width} ${height}"
|
|
147
|
+
width=${width}
|
|
148
|
+
height=${height}
|
|
149
|
+
role="img"
|
|
150
|
+
aria-label="Diagram overview"
|
|
151
|
+
@pointerdown=${(event) => this.navigation.onPointerDown(event)}
|
|
152
|
+
>
|
|
153
|
+
<rect class="minimap__background" x="0" y="0" width=${width} height=${height}></rect>
|
|
154
|
+
${initialized ? this.renderOverlay() : nothing}
|
|
155
|
+
</svg>
|
|
156
|
+
</div>
|
|
157
|
+
${this.showZoomControls && initialized ? html`
|
|
158
|
+
<flow-ui-diagram-zoom-controls
|
|
159
|
+
part="zoom-controls"
|
|
160
|
+
class="minimap__zoom-controls"
|
|
161
|
+
.diagram=${this.reference.target}
|
|
162
|
+
></flow-ui-diagram-zoom-controls>
|
|
163
|
+
` : nothing}
|
|
164
|
+
</div>
|
|
165
|
+
`;
|
|
166
|
+
}
|
|
167
|
+
// The nodes are in their own SVG beneath the map's, moved and scaled with a CSS transform on that SVG's element:
|
|
168
|
+
// the transform changes on most pans, and changing an SVG transform attribute (on a group around the nodes)
|
|
169
|
+
// re-lays out every node in it on each frame
|
|
170
|
+
renderNodeLayer() {
|
|
171
|
+
const t = this.transform;
|
|
172
|
+
return html`
|
|
173
|
+
<div class="minimap__node-layer">
|
|
174
|
+
<div
|
|
175
|
+
class="minimap__nodes-transform"
|
|
176
|
+
style=${styleMap({ transform: `translate(${t.offsetX}px, ${t.offsetY}px) scale(${t.scale})` })}
|
|
177
|
+
>
|
|
178
|
+
<svg class="minimap__nodes" width="1" height="1" aria-hidden="true">
|
|
179
|
+
${guard(
|
|
180
|
+
[this.minimapNodes],
|
|
181
|
+
() => repeat(
|
|
182
|
+
this.minimapNodes,
|
|
183
|
+
(item) => item.bounds.id,
|
|
184
|
+
(item) => this.renderNode(item)
|
|
185
|
+
)
|
|
186
|
+
)}
|
|
187
|
+
</svg>
|
|
188
|
+
</div>
|
|
189
|
+
</div>
|
|
190
|
+
`;
|
|
191
|
+
}
|
|
192
|
+
// The diagram extent (virtualized mode) and the visible-area rectangle, in minimap coordinates
|
|
193
|
+
renderOverlay() {
|
|
194
|
+
const t = this.transform;
|
|
195
|
+
const viewport = this.viewport;
|
|
196
|
+
const rect = this.viewportRect;
|
|
197
|
+
const bounds = this.diagramBounds;
|
|
198
|
+
const validViewport = !!viewport.width && !!viewport.height && viewport.width > 0 && viewport.height > 0;
|
|
199
|
+
return svg`
|
|
200
|
+
${this.showDiagramBounds ? svg`<rect
|
|
201
|
+
part="diagram-bounds"
|
|
202
|
+
class="minimap__diagram-bounds"
|
|
203
|
+
x=${bounds.x * t.scale + t.offsetX}
|
|
204
|
+
y=${bounds.y * t.scale + t.offsetY}
|
|
205
|
+
width=${bounds.width * t.scale}
|
|
206
|
+
height=${bounds.height * t.scale}
|
|
207
|
+
></rect>` : nothing}
|
|
208
|
+
${validViewport ? svg`<rect
|
|
209
|
+
part="viewport"
|
|
210
|
+
class="minimap__viewport"
|
|
211
|
+
x=${rect.x}
|
|
212
|
+
y=${rect.y}
|
|
213
|
+
width=${rect.width}
|
|
214
|
+
height=${rect.height}
|
|
215
|
+
></rect>` : nothing}
|
|
216
|
+
`;
|
|
217
|
+
}
|
|
218
|
+
renderNode(item) {
|
|
219
|
+
const { bounds, nodeStyle } = item;
|
|
220
|
+
if (item.template) {
|
|
221
|
+
return svg`
|
|
222
|
+
<foreignObject
|
|
223
|
+
class="minimap__template"
|
|
224
|
+
x=${bounds.x}
|
|
225
|
+
y=${bounds.y}
|
|
226
|
+
width=${bounds.width}
|
|
227
|
+
height=${bounds.height}
|
|
228
|
+
transform=${bounds.transform}
|
|
229
|
+
>${this.renderTemplate(item)}</foreignObject>
|
|
230
|
+
`;
|
|
231
|
+
}
|
|
232
|
+
const cssClass = nodeStyle.cssClass?.trim();
|
|
233
|
+
const style = styleMap({
|
|
234
|
+
fill: nodeStyle.fill,
|
|
235
|
+
stroke: nodeStyle.stroke,
|
|
236
|
+
"stroke-width": nodeStyle.strokeWidth !== void 0 ? `${nodeStyle.strokeWidth}px` : void 0,
|
|
237
|
+
opacity: nodeStyle.opacity !== void 0 ? `${nodeStyle.opacity}` : void 0
|
|
238
|
+
});
|
|
239
|
+
const { x, y, width, height } = bounds;
|
|
240
|
+
let shape;
|
|
241
|
+
switch (nodeStyle.shape) {
|
|
242
|
+
case "circle":
|
|
243
|
+
shape = svg`<circle cx=${x + width / 2} cy=${y + height / 2} r=${Math.min(width, height) / 2}></circle>`;
|
|
244
|
+
break;
|
|
245
|
+
case "ellipse":
|
|
246
|
+
shape = svg`<ellipse cx=${x + width / 2} cy=${y + height / 2} rx=${width / 2} ry=${height / 2}></ellipse>`;
|
|
247
|
+
break;
|
|
248
|
+
default:
|
|
249
|
+
shape = svg`<rect x=${x} y=${y} width=${width} height=${height}></rect>`;
|
|
250
|
+
}
|
|
251
|
+
return svg`
|
|
252
|
+
<g
|
|
253
|
+
part=${cssClass ? `node ${cssClass}` : "node"}
|
|
254
|
+
class=${cssClass ? `minimap__node ${cssClass}` : "minimap__node"}
|
|
255
|
+
data-node-id=${bounds.id}
|
|
256
|
+
transform=${bounds.transform}
|
|
257
|
+
style=${style}
|
|
258
|
+
>${shape}</g>
|
|
259
|
+
`;
|
|
260
|
+
}
|
|
261
|
+
renderTemplate(item) {
|
|
262
|
+
try {
|
|
263
|
+
return item.template({ node: item.diagramNode, nodeStyle: item.nodeStyle });
|
|
264
|
+
} catch (error) {
|
|
265
|
+
console.error(`[flow-ui-diagram] The minimap template for node "${item.diagramNode.id}" threw an error.`, error);
|
|
266
|
+
return null;
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
FlowUiDiagramMinimap.tagName = "flow-ui-diagram-minimap";
|
|
271
|
+
FlowUiDiagramMinimap.styles = styles;
|
|
272
|
+
FlowUiDiagramMinimap.dependencies = [FlowUiDiagramZoomControls];
|
|
273
|
+
__decorateClass([
|
|
274
|
+
property()
|
|
275
|
+
], FlowUiDiagramMinimap.prototype, "diagram", 2);
|
|
276
|
+
__decorateClass([
|
|
277
|
+
property({ reflect: true })
|
|
278
|
+
], FlowUiDiagramMinimap.prototype, "position", 2);
|
|
279
|
+
__decorateClass([
|
|
280
|
+
property({ type: Number })
|
|
281
|
+
], FlowUiDiagramMinimap.prototype, "width", 2);
|
|
282
|
+
__decorateClass([
|
|
283
|
+
property({ type: Number })
|
|
284
|
+
], FlowUiDiagramMinimap.prototype, "height", 2);
|
|
285
|
+
__decorateClass([
|
|
286
|
+
property({ attribute: "show-zoom-controls", converter: customBooleanConverter })
|
|
287
|
+
], FlowUiDiagramMinimap.prototype, "showZoomControls", 2);
|
|
288
|
+
__decorateClass([
|
|
289
|
+
property({ attribute: "defer-node-updates", type: Boolean })
|
|
290
|
+
], FlowUiDiagramMinimap.prototype, "deferNodeUpdates", 2);
|
|
291
|
+
__decorateClass([
|
|
292
|
+
property({ attribute: false })
|
|
293
|
+
], FlowUiDiagramMinimap.prototype, "nodeStyle", 2);
|
|
294
|
+
__decorateClass([
|
|
295
|
+
property({ attribute: false })
|
|
296
|
+
], FlowUiDiagramMinimap.prototype, "nodeTemplateMap", 2);
|
|
297
|
+
|
|
298
|
+
export { FlowUiDiagramMinimap as default };
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { css } from 'lit';
|
|
2
|
+
import componentStyles from '../../styles/component.styles.mjs';
|
|
3
|
+
import panelStyles from '../diagram/diagram-panel.styles.mjs';
|
|
4
|
+
import { standaloneDiagramTokens } from '../diagram/diagram-tokens.styles.mjs';
|
|
5
|
+
|
|
6
|
+
const styles = css`
|
|
7
|
+
${componentStyles}
|
|
8
|
+
${standaloneDiagramTokens}
|
|
9
|
+
${panelStyles}
|
|
10
|
+
|
|
11
|
+
:host {
|
|
12
|
+
display: block;
|
|
13
|
+
pointer-events: auto;
|
|
14
|
+
cursor: default;
|
|
15
|
+
font-family: var(--flow-ui-font-sans);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.minimap__stage {
|
|
19
|
+
position: relative;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/* The nodes, beneath the map's SVG, clipped to the map */
|
|
23
|
+
.minimap__node-layer {
|
|
24
|
+
position: absolute;
|
|
25
|
+
inset: 0;
|
|
26
|
+
overflow: hidden;
|
|
27
|
+
pointer-events: none;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.minimap__nodes-transform {
|
|
31
|
+
width: 1px;
|
|
32
|
+
height: 1px;
|
|
33
|
+
transform-origin: 0 0;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.minimap__nodes {
|
|
37
|
+
display: block;
|
|
38
|
+
overflow: visible;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.minimap__svg {
|
|
42
|
+
position: relative;
|
|
43
|
+
display: block;
|
|
44
|
+
cursor: pointer;
|
|
45
|
+
touch-action: none;
|
|
46
|
+
user-select: none;
|
|
47
|
+
-webkit-user-select: none;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.minimap__background {
|
|
51
|
+
fill: transparent;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.minimap__node {
|
|
55
|
+
fill: var(--flow-ui-diagram-minimap-node-color);
|
|
56
|
+
opacity: var(--flow-ui-diagram-minimap-node-opacity);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.minimap__template {
|
|
60
|
+
overflow: hidden;
|
|
61
|
+
pointer-events: none;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.minimap__viewport {
|
|
65
|
+
stroke: var(--flow-ui-diagram-minimap-viewport-stroke-color);
|
|
66
|
+
stroke-width: var(--flow-ui-diagram-minimap-viewport-stroke-width);
|
|
67
|
+
fill: transparent;
|
|
68
|
+
pointer-events: none;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.minimap__diagram-bounds {
|
|
72
|
+
fill: var(--flow-ui-diagram-minimap-diagram-bounds-color);
|
|
73
|
+
opacity: var(--flow-ui-diagram-minimap-diagram-bounds-opacity);
|
|
74
|
+
stroke: none;
|
|
75
|
+
pointer-events: none;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.minimap__zoom-controls {
|
|
79
|
+
align-self: center;
|
|
80
|
+
}
|
|
81
|
+
`;
|
|
82
|
+
|
|
83
|
+
export { styles as default };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { css } from 'lit';
|
|
2
|
+
|
|
3
|
+
const nodeTemplateStyles = css`
|
|
4
|
+
/* Templates using the diagramNodeSelected() / diagramGroupHighlighted() directives */
|
|
5
|
+
::slotted(.flow-ui-diagram-node-wrapper:not(.flow-ui-diagram-node-selected)) {
|
|
6
|
+
transition: box-shadow 0.1s ease-in-out;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
/* The built-in group template (see default-node-templates.ts) */
|
|
10
|
+
::slotted(.flow-ui-diagram-default-group) {
|
|
11
|
+
display: flex;
|
|
12
|
+
box-sizing: border-box;
|
|
13
|
+
width: 100%;
|
|
14
|
+
height: 100%;
|
|
15
|
+
padding: 0.625rem;
|
|
16
|
+
background-color: var(--flow-ui-diagram-node-background-color);
|
|
17
|
+
border: var(--flow-ui-diagram-node-border-size) solid var(--flow-ui-diagram-group-border-color);
|
|
18
|
+
border-radius: var(--flow-ui-diagram-group-border-radius);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
:host(:hover) ::slotted(.flow-ui-diagram-default-group) {
|
|
22
|
+
border-color: var(--flow-ui-diagram-group-border-color-hover);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
::slotted(.flow-ui-diagram-node-wrapper.flow-ui-diagram-group-highlight) {
|
|
26
|
+
border-color: var(--flow-ui-diagram-group-border-color-highlight);
|
|
27
|
+
box-shadow: 0 0 var(--flow-ui-diagram-group-highlight-size) 0
|
|
28
|
+
var(--flow-ui-diagram-group-box-shadow-color-highlight) inset;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
::slotted(.flow-ui-diagram-node-wrapper.flow-ui-diagram-node-selected) {
|
|
32
|
+
box-shadow: var(--flow-ui-diagram-selected-node-box-shadow);
|
|
33
|
+
}
|
|
34
|
+
`;
|
|
35
|
+
|
|
36
|
+
export { nodeTemplateStyles as default };
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import { html } from 'lit';
|
|
2
|
+
import { property } from 'lit/decorators.js';
|
|
3
|
+
import { styleMap } from 'lit/directives/style-map.js';
|
|
4
|
+
import { toPortUpdates } from '../../diagram-core/port-batch-processor/port-batch-processor.mjs';
|
|
5
|
+
import { ContextMenuTargetController } from '../../diagram/input/context-menu-controller.mjs';
|
|
6
|
+
import { ObjectSelectionController } from '../../diagram/input/object-selection-controller.mjs';
|
|
7
|
+
import { PointerMoveSelectionController } from '../../diagram/input/pointer-move-selection-controller.mjs';
|
|
8
|
+
import { ContextConsumer, ContextProvider } from '../../diagram/runtime/context.mjs';
|
|
9
|
+
import { diagramRuntimeContext, diagramNodeContext } from '../../diagram/runtime/contexts.mjs';
|
|
10
|
+
import { Observable } from '../../diagram/runtime/observable.mjs';
|
|
11
|
+
import FlowRdfElement from '../../internal/flow-ui-rdf-element.mjs';
|
|
12
|
+
import styles from './diagram-node.styles.mjs';
|
|
13
|
+
import { DEFAULT_NODE_MIN_SIZE } from '../../diagram-core/flow-config/default-flow-config.mjs';
|
|
14
|
+
import { isGroup } from '../../diagram-core/utils/is-group.mjs';
|
|
15
|
+
|
|
16
|
+
var __defProp = Object.defineProperty;
|
|
17
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
18
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
19
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
20
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
21
|
+
if (decorator = decorators[i])
|
|
22
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
23
|
+
if (kind && result)
|
|
24
|
+
__defProp(target, key, result);
|
|
25
|
+
return result;
|
|
26
|
+
};
|
|
27
|
+
const DEFAULT_NODE_SIZE = { width: "11.25rem", height: "2rem" };
|
|
28
|
+
const DEFAULT_GROUP_SIZE = { width: "9.0625rem", height: "9.0625rem" };
|
|
29
|
+
class FlowUiDiagramNode extends FlowRdfElement {
|
|
30
|
+
constructor() {
|
|
31
|
+
super();
|
|
32
|
+
this.nodeObservable = new Observable(void 0);
|
|
33
|
+
this.hasSynced = false;
|
|
34
|
+
new ContextConsumer(this, {
|
|
35
|
+
context: diagramRuntimeContext,
|
|
36
|
+
callback: (runtime2) => this.attachRuntime(runtime2)
|
|
37
|
+
});
|
|
38
|
+
const contextValue = { element: this, node: this.nodeObservable.asReadonly() };
|
|
39
|
+
new ContextProvider(this, { context: diagramNodeContext, initialValue: contextValue });
|
|
40
|
+
const runtime = () => this.runtime;
|
|
41
|
+
new ObjectSelectionController(this, runtime, "node", () => this.node);
|
|
42
|
+
new PointerMoveSelectionController(this, runtime, () => this.node);
|
|
43
|
+
new ContextMenuTargetController(this, runtime, "node", () => this.node);
|
|
44
|
+
}
|
|
45
|
+
disconnectedCallback() {
|
|
46
|
+
super.disconnectedCallback();
|
|
47
|
+
queueMicrotask(() => {
|
|
48
|
+
if (!this.isConnected) {
|
|
49
|
+
this.unobserve();
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
willUpdate(changed) {
|
|
54
|
+
if (changed.has("node") && this.node) {
|
|
55
|
+
this.nodeObservable.set(this.node);
|
|
56
|
+
if (this.runtime && this.observedNodeId !== this.node.id) {
|
|
57
|
+
this.observe();
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
updated(changed) {
|
|
62
|
+
if (changed.has("node") && this.node) {
|
|
63
|
+
this.syncHostStyles(this.node);
|
|
64
|
+
this.syncPortsOnGeometryChange(this.node);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
render() {
|
|
68
|
+
const angle = this.node?.angle;
|
|
69
|
+
return html`
|
|
70
|
+
<div part="content" class="node-content" style=${styleMap({ transform: angle ? `rotate(${angle}deg)` : null })}>
|
|
71
|
+
<slot></slot>
|
|
72
|
+
</div>
|
|
73
|
+
`;
|
|
74
|
+
}
|
|
75
|
+
attachRuntime(runtime) {
|
|
76
|
+
if (this.runtime !== runtime) {
|
|
77
|
+
this.unobserve();
|
|
78
|
+
this.runtime = runtime;
|
|
79
|
+
}
|
|
80
|
+
if (this.node && this.observedNodeId !== this.node.id) {
|
|
81
|
+
this.observe();
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
observe() {
|
|
85
|
+
if (!this.runtime || !this.node) {
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
this.runtime.resizeObserver.observe(this, { type: "node", nodeId: this.node.id });
|
|
89
|
+
this.observedNodeId = this.node.id;
|
|
90
|
+
}
|
|
91
|
+
unobserve() {
|
|
92
|
+
if (this.runtime && this.observedNodeId !== void 0) {
|
|
93
|
+
this.runtime.resizeObserver.unobserve(this);
|
|
94
|
+
}
|
|
95
|
+
this.observedNodeId = void 0;
|
|
96
|
+
}
|
|
97
|
+
// Position, z-index, visibility, selection and size: ngDiagram's NodePositionDirective, ZIndexDirective,
|
|
98
|
+
// NodeSizeDirective and the host bindings of NgDiagramNodeComponent
|
|
99
|
+
syncHostStyles(node) {
|
|
100
|
+
const style = this.style;
|
|
101
|
+
style.transform = `translate(${node.position.x}px, ${node.position.y}px)`;
|
|
102
|
+
style.zIndex = String(node.computedZIndex ?? 0);
|
|
103
|
+
style.display = node.computedHidden ? "none" : "";
|
|
104
|
+
this.toggleAttribute("selected", !!node.selected);
|
|
105
|
+
this.dataset.nodeId = node.id;
|
|
106
|
+
const autoSize = node.autoSize ?? true;
|
|
107
|
+
const { width, height } = node.size ?? {};
|
|
108
|
+
if (!autoSize && width !== void 0 && height !== void 0) {
|
|
109
|
+
this.applyExplicitSize(node, width, height);
|
|
110
|
+
} else if (node.type) {
|
|
111
|
+
this.setSizeStyles("", "", "", "");
|
|
112
|
+
} else if (isGroup(node)) {
|
|
113
|
+
const { width: width2, height: height2 } = DEFAULT_GROUP_SIZE;
|
|
114
|
+
this.setSizeStyles(width2, height2, width2, height2);
|
|
115
|
+
} else {
|
|
116
|
+
this.setSizeStyles("", "", DEFAULT_NODE_SIZE.width, DEFAULT_NODE_SIZE.height);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
applyExplicitSize(node, width, height) {
|
|
120
|
+
const minSize = this.runtime?.flowCore.value?.config.resize.getMinNodeSize(node);
|
|
121
|
+
if (minSize || !node.type) {
|
|
122
|
+
const minWidth = minSize?.width ?? DEFAULT_NODE_MIN_SIZE.width;
|
|
123
|
+
const minHeight = minSize?.height ?? DEFAULT_NODE_MIN_SIZE.height;
|
|
124
|
+
this.setSizeStyles(`${width}px`, `${height}px`, `${minWidth}px`, `${minHeight}px`);
|
|
125
|
+
} else {
|
|
126
|
+
this.setSizeStyles(`${width}px`, `${height}px`, "", "");
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
setSizeStyles(width, height, minWidth, minHeight) {
|
|
130
|
+
const style = this.style;
|
|
131
|
+
style.width = width;
|
|
132
|
+
style.height = height;
|
|
133
|
+
style.minWidth = minWidth;
|
|
134
|
+
style.minHeight = minHeight;
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Re-measures the node's ports after its size or rotation changed (NgDiagramNodeComponent's port sync). The
|
|
138
|
+
* first render is skipped: the resize observer measures the ports initially. Does nothing until a port measurer
|
|
139
|
+
* is installed (ISSUE-ecbd).
|
|
140
|
+
*/
|
|
141
|
+
syncPortsOnGeometryChange(node) {
|
|
142
|
+
const size = node.size;
|
|
143
|
+
const angle = node.angle;
|
|
144
|
+
if (!this.hasSynced) {
|
|
145
|
+
this.hasSynced = true;
|
|
146
|
+
this.lastSize = size;
|
|
147
|
+
this.lastAngle = angle;
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
const sizeChanged = size?.width !== this.lastSize?.width || size?.height !== this.lastSize?.height;
|
|
151
|
+
const angleChanged = angle !== this.lastAngle;
|
|
152
|
+
this.lastSize = size;
|
|
153
|
+
this.lastAngle = angle;
|
|
154
|
+
if (!sizeChanged && !angleChanged) {
|
|
155
|
+
return;
|
|
156
|
+
}
|
|
157
|
+
const flowCore = this.runtime?.flowCore.value;
|
|
158
|
+
const measurer = this.runtime?.resizeProcessor.portMeasurer;
|
|
159
|
+
if (!flowCore || !measurer) {
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
const sync = () => {
|
|
163
|
+
const portsData = measurer.getNodePortsData(this, node.id);
|
|
164
|
+
flowCore.updater.applyPortChanges(node.id, toPortUpdates(portsData));
|
|
165
|
+
};
|
|
166
|
+
if (flowCore.actionStateManager.isResizing()) {
|
|
167
|
+
sync();
|
|
168
|
+
} else {
|
|
169
|
+
queueMicrotask(() => {
|
|
170
|
+
if (this.isConnected) {
|
|
171
|
+
sync();
|
|
172
|
+
}
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
FlowUiDiagramNode.tagName = "flow-ui-diagram-node";
|
|
178
|
+
FlowUiDiagramNode.styles = styles;
|
|
179
|
+
__decorateClass([
|
|
180
|
+
property({ attribute: false })
|
|
181
|
+
], FlowUiDiagramNode.prototype, "node", 2);
|
|
182
|
+
|
|
183
|
+
export { DEFAULT_GROUP_SIZE, DEFAULT_NODE_SIZE, FlowUiDiagramNode as default };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { css } from 'lit';
|
|
2
|
+
import componentStyles from '../../styles/component.styles.mjs';
|
|
3
|
+
import nodeTemplateStyles from './diagram-node-template.styles.mjs';
|
|
4
|
+
|
|
5
|
+
const styles = css`
|
|
6
|
+
${componentStyles}
|
|
7
|
+
${nodeTemplateStyles}
|
|
8
|
+
|
|
9
|
+
:host {
|
|
10
|
+
display: block;
|
|
11
|
+
position: absolute;
|
|
12
|
+
top: 0;
|
|
13
|
+
left: 0;
|
|
14
|
+
transform-origin: 0 0;
|
|
15
|
+
pointer-events: none;
|
|
16
|
+
user-select: none;
|
|
17
|
+
cursor: pointer;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.node-content {
|
|
21
|
+
position: relative;
|
|
22
|
+
width: 100%;
|
|
23
|
+
height: 100%;
|
|
24
|
+
transform-origin: center center;
|
|
25
|
+
pointer-events: all;
|
|
26
|
+
}
|
|
27
|
+
`;
|
|
28
|
+
|
|
29
|
+
export { styles as default };
|