@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,34 @@
|
|
|
1
|
+
import { clamp } from '../clamp/clamp.mjs';
|
|
2
|
+
|
|
3
|
+
const calculateEdgePanningForce = (containerBox, clientPosition, detectionThreshold, forceMultiplier) => {
|
|
4
|
+
const { x: containerX, y: containerY, width: containerWidth, height: containerHeight } = containerBox;
|
|
5
|
+
const { x: clientX, y: clientY } = clientPosition;
|
|
6
|
+
let deltaX = 0;
|
|
7
|
+
let deltaY = 0;
|
|
8
|
+
const deltaLeft = clientX - containerX;
|
|
9
|
+
const deltaRight = containerX + containerWidth - clientX;
|
|
10
|
+
const deltaTop = clientY - containerY;
|
|
11
|
+
const deltaBottom = containerY + containerHeight - clientY;
|
|
12
|
+
if (deltaLeft < detectionThreshold) {
|
|
13
|
+
deltaX = clamp({ min: 0, max: detectionThreshold, value: -(deltaLeft - detectionThreshold) });
|
|
14
|
+
} else if (deltaRight < detectionThreshold) {
|
|
15
|
+
deltaX = -clamp({ min: 0, max: detectionThreshold, value: -(deltaRight - detectionThreshold) });
|
|
16
|
+
}
|
|
17
|
+
if (deltaTop < detectionThreshold) {
|
|
18
|
+
deltaY = clamp({ min: 0, max: detectionThreshold, value: -(deltaTop - detectionThreshold) });
|
|
19
|
+
} else if (deltaBottom < detectionThreshold) {
|
|
20
|
+
deltaY = -clamp({ min: 0, max: detectionThreshold, value: -(deltaBottom - detectionThreshold) });
|
|
21
|
+
}
|
|
22
|
+
if (deltaX === 0 && deltaY === 0) {
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
let normalizedX = deltaX / detectionThreshold;
|
|
26
|
+
let normalizedY = deltaY / detectionThreshold;
|
|
27
|
+
normalizedX = isFinite(normalizedX) ? normalizedX : 1;
|
|
28
|
+
normalizedY = isFinite(normalizedY) ? normalizedY : 1;
|
|
29
|
+
const forceX = normalizedX * forceMultiplier;
|
|
30
|
+
const forceY = normalizedY * forceMultiplier;
|
|
31
|
+
return { x: forceX, y: forceY };
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export { calculateEdgePanningForce };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { angleBetweenPoints } from './angle-between-points/angle-between-points.mjs';
|
|
2
|
+
import { angleToSide } from './angle-to-side/angle-to-side.mjs';
|
|
3
|
+
import { calculateEdgePanningForce } from './calculate-edge-panning-force/calculate-edge-panning-force.mjs';
|
|
4
|
+
import { clamp } from './clamp/clamp.mjs';
|
|
5
|
+
import { distanceBetweenPoints } from './distance-between-points/distance-between-points.mjs';
|
|
6
|
+
import { normalizeAngle } from './normalize-angle/normalize-angle.mjs';
|
|
7
|
+
import { snapAngle } from './snap-angle/snap-angle.mjs';
|
|
8
|
+
import { snapNumber } from './snap-number/snap-number.mjs';
|
|
9
|
+
import { snapPoint } from './snap-point/snap-point.mjs';
|
|
10
|
+
import { subtractPoints } from './subtract-points/subtract-points.mjs';
|
|
11
|
+
|
|
12
|
+
const NgDiagramMath = {
|
|
13
|
+
angleBetweenPoints,
|
|
14
|
+
angleToSide,
|
|
15
|
+
clamp,
|
|
16
|
+
distanceBetweenPoints,
|
|
17
|
+
normalizeAngle,
|
|
18
|
+
snapAngle,
|
|
19
|
+
snapNumber,
|
|
20
|
+
snapPoint,
|
|
21
|
+
subtractPoints,
|
|
22
|
+
calculateEdgePanningForce
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export { NgDiagramMath };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { clamp } from '../clamp/clamp.mjs';
|
|
2
|
+
import { normalizeAngle } from '../normalize-angle/normalize-angle.mjs';
|
|
3
|
+
|
|
4
|
+
const EPSILON = 1e-4;
|
|
5
|
+
const RIGHT_ANGLE_SNAP_THRESHOLD = 0.9;
|
|
6
|
+
function fractionalPart(n) {
|
|
7
|
+
return Math.abs(n - Math.trunc(n));
|
|
8
|
+
}
|
|
9
|
+
function snapAngle(angle, step) {
|
|
10
|
+
const numberOfStepsToAdd = Math.round(angle / step);
|
|
11
|
+
if (numberOfStepsToAdd === 0 && step > 1) {
|
|
12
|
+
return 0;
|
|
13
|
+
}
|
|
14
|
+
const isAngleBellowOneStep = Math.abs(numberOfStepsToAdd) === 1 && Math.abs(angle) < step;
|
|
15
|
+
const snapIfLessThanDegrees = clamp({
|
|
16
|
+
min: 1,
|
|
17
|
+
max: step / 2 - 1,
|
|
18
|
+
value: Math.floor(step / 2 - 1)
|
|
19
|
+
});
|
|
20
|
+
const isCloserToNextButNotEnoughToSnap = isAngleBellowOneStep && step - Math.abs(angle) > snapIfLessThanDegrees;
|
|
21
|
+
if (isCloserToNextButNotEnoughToSnap) {
|
|
22
|
+
return 0;
|
|
23
|
+
}
|
|
24
|
+
let snappedAngle = numberOfStepsToAdd * step;
|
|
25
|
+
if (step === 1) {
|
|
26
|
+
const isJustBeforeRightAngle = (snappedAngle + 1) % 90 === 0;
|
|
27
|
+
const isJustAfterRightAngle = (snappedAngle - 1) % 90 === 0;
|
|
28
|
+
if (isJustBeforeRightAngle) {
|
|
29
|
+
const diff = 1 - fractionalPart(angle);
|
|
30
|
+
if (diff < RIGHT_ANGLE_SNAP_THRESHOLD + EPSILON) {
|
|
31
|
+
snappedAngle = snappedAngle + 1;
|
|
32
|
+
}
|
|
33
|
+
} else if (isJustAfterRightAngle) {
|
|
34
|
+
const diff = fractionalPart(angle);
|
|
35
|
+
if (diff < RIGHT_ANGLE_SNAP_THRESHOLD + EPSILON) {
|
|
36
|
+
snappedAngle = snappedAngle - 1;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return normalizeAngle(snappedAngle);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export { snapAngle };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { snapNumber } from '../snap-number/snap-number.mjs';
|
|
2
|
+
|
|
3
|
+
const snapPoint = (point, step, offset = { width: 0, height: 0 }) => ({
|
|
4
|
+
x: snapNumber(point.x, step.width, offset.width),
|
|
5
|
+
y: snapNumber(point.y, step.height, offset.height)
|
|
6
|
+
});
|
|
7
|
+
|
|
8
|
+
export { snapPoint };
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
const DEFAULT_DISCOVERY_WINDOW_TIMEOUT = 70;
|
|
2
|
+
const DEFAULT_DEBOUNCE_TIMEOUT = 50;
|
|
3
|
+
const OBSERVER_ACTIVITY_MIN_REMAINING = 40;
|
|
4
|
+
class MeasurementTracker {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.phase = "idle";
|
|
7
|
+
this.participantIds = /* @__PURE__ */ new Set();
|
|
8
|
+
this.pendingConfig = null;
|
|
9
|
+
this.discoveryWindow = { timeoutId: null, expiresAt: 0, durationMs: DEFAULT_DISCOVERY_WINDOW_TIMEOUT };
|
|
10
|
+
this.debounce = { timeoutId: null, expiresAt: 0, durationMs: DEFAULT_DEBOUNCE_TIMEOUT };
|
|
11
|
+
this.settlementPromise = null;
|
|
12
|
+
this.settlementResolve = null;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Stages tracking configuration for the next middleware-driven registration pass.
|
|
16
|
+
* Called before `applyUpdate()` when `waitForMeasurements` is requested.
|
|
17
|
+
*/
|
|
18
|
+
requestTracking(config) {
|
|
19
|
+
this.pendingConfig = config ?? {};
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Returns true if tracking has been requested via `requestTracking()`.
|
|
23
|
+
* Used by the measurement-tracking middleware to decide first-pass vs subsequent-pass mode.
|
|
24
|
+
*/
|
|
25
|
+
isTrackingRequested() {
|
|
26
|
+
return this.pendingConfig !== null;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Clears a staged tracking request.
|
|
30
|
+
*/
|
|
31
|
+
cancelTrackingRequest() {
|
|
32
|
+
this.pendingConfig = null;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Registers entities that participated in the transaction.
|
|
36
|
+
* Consumes the pending config from `requestTracking()`.
|
|
37
|
+
*
|
|
38
|
+
* If entityIds is empty (full no-op), just clears the pending config.
|
|
39
|
+
* Otherwise, adds IDs to `participantIds` and starts the discovery window.
|
|
40
|
+
*
|
|
41
|
+
* @param entityIds - Prefixed entity IDs (e.g. 'node:abc', 'edge:xyz')
|
|
42
|
+
*/
|
|
43
|
+
registerParticipants(entityIds) {
|
|
44
|
+
const config = this.pendingConfig;
|
|
45
|
+
this.pendingConfig = null;
|
|
46
|
+
this.register(entityIds, config);
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Registers participants outside the middleware-driven transaction flow — used by
|
|
50
|
+
* `invalidateMeasurements`, where measurements come from re-observing DOM elements
|
|
51
|
+
* rather than a state-update pass. Settles like the transaction path (the discovery
|
|
52
|
+
* window expires on its own, so `waitForMeasurements()` cannot hang), never consumes
|
|
53
|
+
* a staged tracking request, and joining an active round keeps its window durations
|
|
54
|
+
* unless an explicit config is given.
|
|
55
|
+
*
|
|
56
|
+
* @param entityIds - Prefixed entity IDs (e.g. 'node:abc', 'edge:xyz')
|
|
57
|
+
*/
|
|
58
|
+
trackParticipants(entityIds, config) {
|
|
59
|
+
this.register(entityIds, config ?? null);
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Removes entities from the current tracking round — used when an entity
|
|
63
|
+
* becomes effectively hidden, which clears its pending measurement
|
|
64
|
+
* expectations. Signals for removed ids no longer extend the observation
|
|
65
|
+
* window; settlement stays timer-driven, so the round still resolves on its
|
|
66
|
+
* own schedule.
|
|
67
|
+
*
|
|
68
|
+
* @param entityIds - Prefixed entity IDs (e.g. 'node:abc', 'edge:xyz')
|
|
69
|
+
*/
|
|
70
|
+
unregisterParticipants(entityIds) {
|
|
71
|
+
if (this.phase === "idle")
|
|
72
|
+
return;
|
|
73
|
+
for (const id of entityIds) {
|
|
74
|
+
this.participantIds.delete(id);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
/** Shared registration body; `null` config keeps the current window durations. */
|
|
78
|
+
register(entityIds, config) {
|
|
79
|
+
if (entityIds.length === 0)
|
|
80
|
+
return;
|
|
81
|
+
if (config) {
|
|
82
|
+
this.discoveryWindow.durationMs = config.discoveryWindowMs ?? DEFAULT_DISCOVERY_WINDOW_TIMEOUT;
|
|
83
|
+
this.debounce.durationMs = config.debounceMs ?? DEFAULT_DEBOUNCE_TIMEOUT;
|
|
84
|
+
}
|
|
85
|
+
for (const id of entityIds) {
|
|
86
|
+
this.participantIds.add(id);
|
|
87
|
+
}
|
|
88
|
+
this.clearTimer(this.debounce);
|
|
89
|
+
this.phase = "discoveryWindow";
|
|
90
|
+
this.startTimer(this.discoveryWindow);
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Signals that a ResizeObserver fired for a participant entity before batch processing.
|
|
94
|
+
* This is an early indicator that measurements are in the pipeline (the double-RAF
|
|
95
|
+
* processing hasn't delivered them yet).
|
|
96
|
+
*
|
|
97
|
+
* In both phases, if the remaining time is below `OBSERVER_ACTIVITY_MIN_REMAINING`,
|
|
98
|
+
* the active timer resets to its full duration.
|
|
99
|
+
*/
|
|
100
|
+
signalObserverActivity(entityId) {
|
|
101
|
+
if (this.phase === "idle")
|
|
102
|
+
return;
|
|
103
|
+
if (!this.participantIds.has(entityId))
|
|
104
|
+
return;
|
|
105
|
+
const timer = this.activeTimer();
|
|
106
|
+
if (this.remainingTime(timer) < OBSERVER_ACTIVITY_MIN_REMAINING) {
|
|
107
|
+
this.startTimer(timer);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Signals that an actual measurement arrived for a participant entity
|
|
112
|
+
* (e.g., `measuredPorts`, `size`, `position`, `measuredLabels` changed via `setState`).
|
|
113
|
+
*
|
|
114
|
+
* - During discovery window: transitions to debounce phase.
|
|
115
|
+
* - During debounce phase: resets the debounce timer.
|
|
116
|
+
*/
|
|
117
|
+
signalMeasurement(entityId) {
|
|
118
|
+
if (this.phase === "idle")
|
|
119
|
+
return;
|
|
120
|
+
if (!this.participantIds.has(entityId))
|
|
121
|
+
return;
|
|
122
|
+
if (this.phase === "discoveryWindow") {
|
|
123
|
+
this.clearTimer(this.discoveryWindow);
|
|
124
|
+
}
|
|
125
|
+
this.phase = "debounce";
|
|
126
|
+
this.startTimer(this.debounce);
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Returns a promise that resolves when all currently pending measurements are complete.
|
|
130
|
+
* If there are no pending measurements, resolves immediately.
|
|
131
|
+
*/
|
|
132
|
+
waitForMeasurements() {
|
|
133
|
+
if (!this.hasPendingMeasurements()) {
|
|
134
|
+
return Promise.resolve();
|
|
135
|
+
}
|
|
136
|
+
if (this.settlementPromise) {
|
|
137
|
+
return this.settlementPromise;
|
|
138
|
+
}
|
|
139
|
+
this.settlementPromise = new Promise((resolve) => {
|
|
140
|
+
this.settlementResolve = resolve;
|
|
141
|
+
});
|
|
142
|
+
return this.settlementPromise;
|
|
143
|
+
}
|
|
144
|
+
hasPendingMeasurements() {
|
|
145
|
+
return this.phase !== "idle";
|
|
146
|
+
}
|
|
147
|
+
// -- State machine internals --
|
|
148
|
+
activeTimer() {
|
|
149
|
+
return this.phase === "discoveryWindow" ? this.discoveryWindow : this.debounce;
|
|
150
|
+
}
|
|
151
|
+
remainingTime(timer) {
|
|
152
|
+
return timer.expiresAt - Date.now();
|
|
153
|
+
}
|
|
154
|
+
startTimer(timer) {
|
|
155
|
+
this.clearTimer(timer);
|
|
156
|
+
timer.expiresAt = Date.now() + timer.durationMs;
|
|
157
|
+
timer.timeoutId = setTimeout(() => {
|
|
158
|
+
this.resolve();
|
|
159
|
+
}, timer.durationMs);
|
|
160
|
+
}
|
|
161
|
+
clearTimer(timer) {
|
|
162
|
+
if (timer.timeoutId) {
|
|
163
|
+
clearTimeout(timer.timeoutId);
|
|
164
|
+
timer.timeoutId = null;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
resolve() {
|
|
168
|
+
this.phase = "idle";
|
|
169
|
+
this.participantIds.clear();
|
|
170
|
+
this.clearTimer(this.discoveryWindow);
|
|
171
|
+
this.clearTimer(this.debounce);
|
|
172
|
+
this.discoveryWindow.durationMs = DEFAULT_DISCOVERY_WINDOW_TIMEOUT;
|
|
173
|
+
this.debounce.durationMs = DEFAULT_DEBOUNCE_TIMEOUT;
|
|
174
|
+
if (this.settlementResolve) {
|
|
175
|
+
this.settlementResolve();
|
|
176
|
+
this.settlementResolve = null;
|
|
177
|
+
this.settlementPromise = null;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
export { DEFAULT_DEBOUNCE_TIMEOUT, DEFAULT_DISCOVERY_WINDOW_TIMEOUT, MeasurementTracker, OBSERVER_ACTIVITY_MIN_REMAINING };
|
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
import { PassSettlement } from './pass-settlement.mjs';
|
|
2
|
+
import { isSamePoint, isSameSize } from '../utils/rects-points-sizes.mjs';
|
|
3
|
+
|
|
4
|
+
class MiddlewareExecutor {
|
|
5
|
+
constructor(flowCore, middlewareChain) {
|
|
6
|
+
this.history = [];
|
|
7
|
+
this.edgesMap = /* @__PURE__ */ new Map();
|
|
8
|
+
this.nodesMap = /* @__PURE__ */ new Map();
|
|
9
|
+
this.initialNodesMap = /* @__PURE__ */ new Map();
|
|
10
|
+
this.initialEdgesMap = /* @__PURE__ */ new Map();
|
|
11
|
+
this.initialConnectedEdgesMap = /* @__PURE__ */ new Map();
|
|
12
|
+
this.addedNodesIds = /* @__PURE__ */ new Set();
|
|
13
|
+
this.removedNodesIds = /* @__PURE__ */ new Set();
|
|
14
|
+
this.addedEdgesIds = /* @__PURE__ */ new Set();
|
|
15
|
+
this.removedEdgesIds = /* @__PURE__ */ new Set();
|
|
16
|
+
this.updatedPropsToNodeIds = /* @__PURE__ */ new Map();
|
|
17
|
+
this.updatedPropsToEdgeIds = /* @__PURE__ */ new Map();
|
|
18
|
+
this.updatedNodeIdsToProps = /* @__PURE__ */ new Map();
|
|
19
|
+
this.updatedEdgeIdsToProps = /* @__PURE__ */ new Map();
|
|
20
|
+
this.helpers = () => ({
|
|
21
|
+
checkIfNodeChanged: (id) => this.updatedNodeIdsToProps.has(id),
|
|
22
|
+
checkIfEdgeChanged: (id) => this.updatedEdgeIdsToProps.has(id),
|
|
23
|
+
checkIfNodeAdded: (id) => this.addedNodesIds.has(id),
|
|
24
|
+
checkIfNodeRemoved: (id) => this.removedNodesIds.has(id),
|
|
25
|
+
checkIfEdgeAdded: (id) => this.addedEdgesIds.has(id),
|
|
26
|
+
checkIfEdgeRemoved: (id) => this.removedEdgesIds.has(id),
|
|
27
|
+
checkIfAnyNodePropsChanged: (props) => props.some((prop) => this.updatedPropsToNodeIds.has(prop)),
|
|
28
|
+
checkIfAnyEdgePropsChanged: (props) => props.some((prop) => this.updatedPropsToEdgeIds.has(prop)),
|
|
29
|
+
anyNodesAdded: () => this.addedNodesIds.size > 0,
|
|
30
|
+
anyEdgesAdded: () => this.addedEdgesIds.size > 0,
|
|
31
|
+
anyNodesRemoved: () => this.removedNodesIds.size > 0,
|
|
32
|
+
anyEdgesRemoved: () => this.removedEdgesIds.size > 0,
|
|
33
|
+
getAffectedNodeIds: (props) => props.flatMap((prop) => [...this.updatedPropsToNodeIds.get(prop) ?? []]),
|
|
34
|
+
getAffectedEdgeIds: (props) => props.flatMap((prop) => [...this.updatedPropsToEdgeIds.get(prop) ?? []]),
|
|
35
|
+
getChangedNodeIds: () => [...this.updatedNodeIdsToProps.keys()],
|
|
36
|
+
getChangedEdgeIds: () => [...this.updatedEdgeIdsToProps.keys()],
|
|
37
|
+
getAddedNodes: () => Array.from(this.addedNodesIds).map((id) => this.nodesMap.get(id)).filter((node) => node !== void 0),
|
|
38
|
+
getAddedEdges: () => Array.from(this.addedEdgesIds).map((id) => this.edgesMap.get(id)).filter((edge) => edge !== void 0),
|
|
39
|
+
getRemovedNodes: () => Array.from(this.removedNodesIds).map((id) => this.initialNodesMap.get(id)).filter((node) => node !== void 0),
|
|
40
|
+
getRemovedEdges: () => Array.from(this.removedEdgesIds).map((id) => this.initialEdgesMap.get(id)).filter((edge) => edge !== void 0)
|
|
41
|
+
});
|
|
42
|
+
this.getState = () => ({
|
|
43
|
+
nodes: Array.from(this.nodesMap.values()),
|
|
44
|
+
edges: Array.from(this.edgesMap.values()),
|
|
45
|
+
metadata: this.metadata
|
|
46
|
+
});
|
|
47
|
+
this.getContext = () => ({
|
|
48
|
+
state: this.getState(),
|
|
49
|
+
nodesMap: this.nodesMap,
|
|
50
|
+
edgesMap: this.edgesMap,
|
|
51
|
+
initialNodesMap: this.initialNodesMap,
|
|
52
|
+
initialEdgesMap: this.initialEdgesMap,
|
|
53
|
+
initialConnectedEdgesMap: this.initialConnectedEdgesMap,
|
|
54
|
+
initialState: this.initialState,
|
|
55
|
+
modelActionType: this.modelActionTypes[0],
|
|
56
|
+
modelActionTypes: this.modelActionTypes,
|
|
57
|
+
actionStateManager: this.flowCore.actionStateManager,
|
|
58
|
+
edgeRoutingManager: this.flowCore.edgeRoutingManager,
|
|
59
|
+
helpers: this.helpers(),
|
|
60
|
+
history: this.history,
|
|
61
|
+
initialUpdate: this.initialStateUpdate,
|
|
62
|
+
config: this.flowCore.config,
|
|
63
|
+
environment: this.flowCore.environment
|
|
64
|
+
});
|
|
65
|
+
this.resolveMiddlewares = () => {
|
|
66
|
+
return new Promise((finalResolve, finalReject) => {
|
|
67
|
+
const settlement = new PassSettlement(finalResolve, finalReject);
|
|
68
|
+
const fail = (error) => settlement.settle({ kind: "failed", error });
|
|
69
|
+
const dispatch = (i) => new Promise((resolve, reject) => {
|
|
70
|
+
const middleware = this.middlewareChain[i];
|
|
71
|
+
if (!middleware) {
|
|
72
|
+
settlement.settle({ kind: "completed", state: this.getState() });
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
const middlewareName = middleware.name;
|
|
76
|
+
settlement.suspend({ resolve, reject });
|
|
77
|
+
let nextCalled = false;
|
|
78
|
+
const next = (stateUpdate) => {
|
|
79
|
+
let state;
|
|
80
|
+
if (nextCalled) {
|
|
81
|
+
const error = new Error(`Middleware ${middlewareName} executed next() multiple times`);
|
|
82
|
+
settlement.reportStrayError(error);
|
|
83
|
+
state = Promise.reject(error);
|
|
84
|
+
} else if (settlement.isSettled()) {
|
|
85
|
+
nextCalled = true;
|
|
86
|
+
state = settlement.lateNextResult();
|
|
87
|
+
} else {
|
|
88
|
+
nextCalled = true;
|
|
89
|
+
if (stateUpdate && Object.keys(stateUpdate).length > 0) {
|
|
90
|
+
this.applyStateUpdate(stateUpdate, middlewareName);
|
|
91
|
+
}
|
|
92
|
+
state = dispatch(i + 1);
|
|
93
|
+
}
|
|
94
|
+
state.then(void 0, () => void 0);
|
|
95
|
+
return state;
|
|
96
|
+
};
|
|
97
|
+
const cancel = () => settlement.settle({ kind: "cancelled", state: this.initialState });
|
|
98
|
+
const context = this.getContext();
|
|
99
|
+
try {
|
|
100
|
+
const result = middleware.execute(context, next, cancel);
|
|
101
|
+
if (result && typeof result.then === "function") {
|
|
102
|
+
result.then(void 0, fail);
|
|
103
|
+
}
|
|
104
|
+
} catch (error) {
|
|
105
|
+
fail(error);
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
dispatch(0).catch(() => void 0);
|
|
109
|
+
});
|
|
110
|
+
};
|
|
111
|
+
this.applyStateUpdate = (stateUpdate, middlewareName) => {
|
|
112
|
+
if (middlewareName) {
|
|
113
|
+
this.history.push({ name: middlewareName, stateUpdate });
|
|
114
|
+
}
|
|
115
|
+
stateUpdate.nodesToAdd?.forEach((node) => this.addNode(node));
|
|
116
|
+
stateUpdate.edgesToAdd?.forEach((edge) => this.addEdge(edge));
|
|
117
|
+
stateUpdate.edgesToRemove?.forEach((id) => this.removeEdge(id));
|
|
118
|
+
stateUpdate.nodesToRemove?.forEach((id) => this.removeNode(id));
|
|
119
|
+
stateUpdate.nodesToUpdate?.forEach((node) => this.updateNode(node));
|
|
120
|
+
stateUpdate.edgesToUpdate?.forEach((edge) => this.updateEdge(edge));
|
|
121
|
+
if (stateUpdate.metadataUpdate) {
|
|
122
|
+
this.metadata = { ...this.metadata, ...stateUpdate.metadataUpdate };
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
this.removeNode = (id) => {
|
|
126
|
+
this.nodesMap.delete(id);
|
|
127
|
+
this.removedNodesIds.add(id);
|
|
128
|
+
this.addedNodesIds.delete(id);
|
|
129
|
+
};
|
|
130
|
+
this.removeEdge = (id) => {
|
|
131
|
+
this.edgesMap.delete(id);
|
|
132
|
+
this.removedEdgesIds.add(id);
|
|
133
|
+
this.addedEdgesIds.delete(id);
|
|
134
|
+
};
|
|
135
|
+
this.addEdge = (edge) => {
|
|
136
|
+
this.edgesMap.set(edge.id, edge);
|
|
137
|
+
this.addedEdgesIds.add(edge.id);
|
|
138
|
+
this.removedEdgesIds.delete(edge.id);
|
|
139
|
+
};
|
|
140
|
+
this.addNode = (node) => {
|
|
141
|
+
this.nodesMap.set(node.id, node);
|
|
142
|
+
this.addedNodesIds.add(node.id);
|
|
143
|
+
this.removedNodesIds.delete(node.id);
|
|
144
|
+
};
|
|
145
|
+
this.updateNode = ({ id, ...node }) => {
|
|
146
|
+
const finalUpdate = {};
|
|
147
|
+
const prevNode = this.nodesMap.get(id);
|
|
148
|
+
if (!prevNode) {
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
Object.entries(node).forEach(([key, value]) => {
|
|
152
|
+
if (key === "position") {
|
|
153
|
+
if (!isSamePoint(prevNode.position, value)) {
|
|
154
|
+
finalUpdate.position = value;
|
|
155
|
+
this.updateNodeProp(id, "position");
|
|
156
|
+
}
|
|
157
|
+
} else if (key === "size") {
|
|
158
|
+
if (!isSameSize(prevNode.size, value)) {
|
|
159
|
+
finalUpdate.size = value;
|
|
160
|
+
this.updateNodeProp(id, "size");
|
|
161
|
+
}
|
|
162
|
+
} else if (prevNode[key] !== value) {
|
|
163
|
+
finalUpdate[key] = value;
|
|
164
|
+
this.updateNodeProp(id, key);
|
|
165
|
+
}
|
|
166
|
+
});
|
|
167
|
+
if (Object.keys(finalUpdate).length > 0) {
|
|
168
|
+
this.nodesMap.set(id, { ...prevNode, ...finalUpdate });
|
|
169
|
+
}
|
|
170
|
+
};
|
|
171
|
+
this.updateNodeProp = (id, propName) => {
|
|
172
|
+
if (!this.updatedPropsToNodeIds.has(propName)) {
|
|
173
|
+
this.updatedPropsToNodeIds.set(propName, /* @__PURE__ */ new Set([]));
|
|
174
|
+
}
|
|
175
|
+
this.updatedPropsToNodeIds.get(propName).add(id);
|
|
176
|
+
if (!this.updatedNodeIdsToProps.has(id)) {
|
|
177
|
+
this.updatedNodeIdsToProps.set(id, /* @__PURE__ */ new Set([]));
|
|
178
|
+
}
|
|
179
|
+
this.updatedNodeIdsToProps.get(id).add(propName);
|
|
180
|
+
};
|
|
181
|
+
this.updateEdge = ({ id, ...edge }) => {
|
|
182
|
+
const finalUpdate = {};
|
|
183
|
+
const prevEdge = this.edgesMap.get(id);
|
|
184
|
+
if (!prevEdge) {
|
|
185
|
+
return;
|
|
186
|
+
}
|
|
187
|
+
Object.entries(edge).forEach(([key, value]) => {
|
|
188
|
+
if (key === "targetPosition") {
|
|
189
|
+
if (!isSamePoint(prevEdge.targetPosition, value)) {
|
|
190
|
+
finalUpdate.targetPosition = value;
|
|
191
|
+
this.updateEdgeProp(id, "targetPosition");
|
|
192
|
+
}
|
|
193
|
+
} else if (key === "sourcePosition") {
|
|
194
|
+
if (!isSamePoint(prevEdge.sourcePosition, value)) {
|
|
195
|
+
finalUpdate.sourcePosition = value;
|
|
196
|
+
this.updateEdgeProp(id, "sourcePosition");
|
|
197
|
+
}
|
|
198
|
+
} else if (prevEdge[key] !== value) {
|
|
199
|
+
finalUpdate[key] = value;
|
|
200
|
+
this.updateEdgeProp(id, key);
|
|
201
|
+
}
|
|
202
|
+
});
|
|
203
|
+
if (Object.keys(finalUpdate).length > 0) {
|
|
204
|
+
this.edgesMap.set(id, { ...prevEdge, ...finalUpdate });
|
|
205
|
+
}
|
|
206
|
+
};
|
|
207
|
+
this.updateEdgeProp = (id, propName) => {
|
|
208
|
+
if (!this.updatedPropsToEdgeIds.has(propName)) {
|
|
209
|
+
this.updatedPropsToEdgeIds.set(propName, /* @__PURE__ */ new Set([]));
|
|
210
|
+
}
|
|
211
|
+
this.updatedPropsToEdgeIds.get(propName).add(id);
|
|
212
|
+
if (!this.updatedEdgeIdsToProps.has(id)) {
|
|
213
|
+
this.updatedEdgeIdsToProps.set(id, /* @__PURE__ */ new Set([]));
|
|
214
|
+
}
|
|
215
|
+
this.updatedEdgeIdsToProps.get(id).add(propName);
|
|
216
|
+
};
|
|
217
|
+
this.flowCore = flowCore;
|
|
218
|
+
this.middlewareChain = middlewareChain;
|
|
219
|
+
}
|
|
220
|
+
async run(initialState, stateUpdate, modelActionTypes) {
|
|
221
|
+
this.initialState = initialState;
|
|
222
|
+
this.modelActionTypes = modelActionTypes;
|
|
223
|
+
this.metadata = initialState.metadata;
|
|
224
|
+
const isMetadataOnly = this.isMetadataOnlyUpdate(stateUpdate);
|
|
225
|
+
if (isMetadataOnly) {
|
|
226
|
+
this.nodesMap = this.flowCore.modelLookup.nodesMap;
|
|
227
|
+
this.edgesMap = this.flowCore.modelLookup.edgesMap;
|
|
228
|
+
this.initialNodesMap = this.nodesMap;
|
|
229
|
+
this.initialEdgesMap = this.edgesMap;
|
|
230
|
+
} else {
|
|
231
|
+
this.nodesMap = new Map(this.flowCore.modelLookup.nodesMap);
|
|
232
|
+
this.edgesMap = new Map(this.flowCore.modelLookup.edgesMap);
|
|
233
|
+
this.initialNodesMap = new Map(this.flowCore.modelLookup.nodesMap);
|
|
234
|
+
this.initialEdgesMap = new Map(this.flowCore.modelLookup.edgesMap);
|
|
235
|
+
}
|
|
236
|
+
this.initialConnectedEdgesMap = this.flowCore.modelLookup.connectedEdgesMap;
|
|
237
|
+
this.initialStateUpdate = stateUpdate;
|
|
238
|
+
this.applyStateUpdate(stateUpdate);
|
|
239
|
+
return await this.resolveMiddlewares();
|
|
240
|
+
}
|
|
241
|
+
isMetadataOnlyUpdate(stateUpdate) {
|
|
242
|
+
return !stateUpdate.nodesToAdd?.length && !stateUpdate.nodesToUpdate?.length && !stateUpdate.nodesToRemove?.length && !stateUpdate.edgesToAdd?.length && !stateUpdate.edgesToUpdate?.length && !stateUpdate.edgesToRemove?.length && !!stateUpdate.metadataUpdate;
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
export { MiddlewareExecutor };
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { MiddlewareExecutor } from './middleware-executor.mjs';
|
|
2
|
+
import { createEventEmitterMiddleware } from './middlewares/event-emitter/event-emitter.middleware.mjs';
|
|
3
|
+
import { createMeasurementTrackingMiddleware } from './middlewares/measurement-tracking/measurement-tracking.middleware.mjs';
|
|
4
|
+
import { createMeasuredBoundsMiddleware } from './middlewares/measured-bounds-assignment/measured-bounds-assignment.mjs';
|
|
5
|
+
import { createHiddenComputationMiddleware } from './middlewares/hidden-computation/hidden-computation.mjs';
|
|
6
|
+
import { loggerMiddleware } from './middlewares/logger/logger.mjs';
|
|
7
|
+
|
|
8
|
+
class MiddlewareManager {
|
|
9
|
+
constructor(flowCore, middlewares) {
|
|
10
|
+
this.middlewareChain = [];
|
|
11
|
+
this.eventEmitterMiddleware = null;
|
|
12
|
+
this.measurementTrackingMiddleware = null;
|
|
13
|
+
this.hiddenComputationMiddleware = null;
|
|
14
|
+
this.hiddenComputationFinalizeMiddleware = null;
|
|
15
|
+
this.measuredBoundsMiddleware = null;
|
|
16
|
+
this.flowCore = flowCore;
|
|
17
|
+
if (middlewares) {
|
|
18
|
+
middlewares.forEach((middleware) => this.register(middleware));
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
isRegistered(name) {
|
|
22
|
+
return !!this.middlewareChain.find((m) => m.name === name);
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Registers a new middleware in the chain
|
|
26
|
+
* @param middleware Middleware to register
|
|
27
|
+
* @returns Function to unregister the middleware
|
|
28
|
+
*/
|
|
29
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
30
|
+
register(middleware) {
|
|
31
|
+
if (this.isRegistered(middleware.name)) {
|
|
32
|
+
throw new Error(`Middleware ${middleware.name} already registered`);
|
|
33
|
+
}
|
|
34
|
+
this.middlewareChain.push(middleware);
|
|
35
|
+
return () => this.unregister(middleware.name);
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Unregister a middleware from the chain
|
|
39
|
+
* @param name Name of the middleware to unregister
|
|
40
|
+
*/
|
|
41
|
+
unregister(name) {
|
|
42
|
+
const index = this.middlewareChain.findIndex((middleware) => middleware.name === name);
|
|
43
|
+
if (index !== -1) {
|
|
44
|
+
this.middlewareChain.splice(index, 1);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Executes all registered middlewares in sequence
|
|
49
|
+
* @param initialState Initial state to be transformed
|
|
50
|
+
* @param stateUpdate State update to be applied
|
|
51
|
+
* @param modelActionTypes Model action types which trigger the middleware (array for transactions, single-element for direct calls)
|
|
52
|
+
* @returns State after all middlewares have been applied
|
|
53
|
+
*/
|
|
54
|
+
async execute(initialState, stateUpdate, modelActionTypes) {
|
|
55
|
+
if (!this.eventEmitterMiddleware && this.flowCore.eventManager) {
|
|
56
|
+
this.eventEmitterMiddleware = createEventEmitterMiddleware(
|
|
57
|
+
this.flowCore.eventManager,
|
|
58
|
+
this.flowCore.templateVisibilityRegistry
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
if (!this.measurementTrackingMiddleware && this.flowCore.measurementTracker) {
|
|
62
|
+
this.measurementTrackingMiddleware = createMeasurementTrackingMiddleware(this.flowCore.measurementTracker);
|
|
63
|
+
}
|
|
64
|
+
if (!this.measuredBoundsMiddleware) {
|
|
65
|
+
this.measuredBoundsMiddleware = createMeasuredBoundsMiddleware(this.flowCore.templateVisibilityRegistry);
|
|
66
|
+
}
|
|
67
|
+
if (!this.hiddenComputationMiddleware && this.flowCore.templateVisibilityRegistry) {
|
|
68
|
+
const visibilityGeneration = this.flowCore.visibilityGeneration;
|
|
69
|
+
this.hiddenComputationMiddleware = createHiddenComputationMiddleware(this.flowCore.templateVisibilityRegistry, {
|
|
70
|
+
name: "hidden-computation",
|
|
71
|
+
cleanupRemovedEntries: true,
|
|
72
|
+
visibilityGeneration
|
|
73
|
+
});
|
|
74
|
+
this.hiddenComputationFinalizeMiddleware = createHiddenComputationMiddleware(
|
|
75
|
+
this.flowCore.templateVisibilityRegistry,
|
|
76
|
+
{ name: "hidden-computation-finalize", visibilityGeneration }
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
const finalChain = [
|
|
80
|
+
...this.hiddenComputationMiddleware ? [this.hiddenComputationMiddleware] : [],
|
|
81
|
+
...this.middlewareChain,
|
|
82
|
+
...this.hiddenComputationFinalizeMiddleware ? [this.hiddenComputationFinalizeMiddleware] : [],
|
|
83
|
+
this.measuredBoundsMiddleware,
|
|
84
|
+
loggerMiddleware,
|
|
85
|
+
...this.measurementTrackingMiddleware ? [this.measurementTrackingMiddleware] : [],
|
|
86
|
+
...this.eventEmitterMiddleware ? [this.eventEmitterMiddleware] : []
|
|
87
|
+
];
|
|
88
|
+
const middlewareExecutor = new MiddlewareExecutor(this.flowCore, finalChain);
|
|
89
|
+
return await middlewareExecutor.run(initialState, stateUpdate, modelActionTypes);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export { MiddlewareManager };
|