@likec4/diagram 1.48.0 → 1.50.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 +7 -9
- package/adhoc-editor/package.json +4 -0
- package/dist/LikeC4Diagram.d.ts +2 -1
- package/dist/LikeC4Diagram.js +77 -79
- package/dist/LikeC4Diagram.props.d.ts +9 -1
- package/dist/LikeC4ModelProvider.d.ts +4 -4
- package/dist/LikeC4ModelProvider.js +2 -2
- package/dist/LikeC4ProjectsOverview.d.ts +3 -2
- package/dist/LikeC4ProjectsProvider.d.ts +2 -1
- package/dist/LikeC4ProjectsProvider.js +4 -4
- package/dist/LikeC4Styles.d.ts +2 -1
- package/dist/LikeC4View.d.ts +14 -1
- package/dist/LikeC4View.js +31 -18
- package/dist/ReactLikeC4.d.ts +2 -1
- package/dist/ReactLikeC4.js +3 -1
- package/dist/StaticLikeC4Diagram.d.ts +2 -1
- package/dist/StaticLikeC4Diagram.js +1 -0
- package/dist/_virtual/store-1b2fbb72.cjs.js +3 -0
- package/dist/_virtual/xstate-store-react.cjs.js +5 -0
- package/dist/_virtual/xstate-store-react.cjs2.js +3 -0
- package/dist/adhoc-editor/EditorPanel.d.ts +1 -0
- package/dist/adhoc-editor/EditorPanel.js +105 -0
- package/dist/adhoc-editor/ElementsTree.d.ts +2 -0
- package/dist/adhoc-editor/ElementsTree.js +142 -0
- package/dist/adhoc-editor/LikeC4AdHocViewEditor.d.ts +1 -1
- package/dist/adhoc-editor/LikeC4AdHocViewEditor.js +46 -43
- package/dist/adhoc-editor/components/Tree.d.ts +48 -0
- package/dist/adhoc-editor/components/Tree.js +296 -0
- package/dist/adhoc-editor/hooks.d.ts +3 -3
- package/dist/adhoc-editor/hooks.js +5 -23
- package/dist/adhoc-editor/index.d.ts +1 -1
- package/dist/adhoc-editor/index.js +1 -0
- package/dist/adhoc-editor/{ActorProvider.d.ts → state/ActorProvider.d.ts} +1 -3
- package/dist/adhoc-editor/{ActorProvider.js → state/ActorProvider.js} +10 -11
- package/dist/adhoc-editor/state/actor.d.ts +13 -0
- package/dist/adhoc-editor/{actor.editor.d.ts → state/actor.editor.d.ts} +6 -4
- package/dist/adhoc-editor/state/actor.editor.js +205 -0
- package/dist/adhoc-editor/{actor.js → state/actor.js} +2 -6
- package/dist/adhoc-editor/{actor.layouter.d.ts → state/actor.layouter.d.ts} +7 -4
- package/dist/adhoc-editor/{actor.layouter.js → state/actor.layouter.js} +17 -13
- package/dist/adhoc-editor/{actor.types.d.ts → state/actor.types.d.ts} +12 -6
- package/dist/adhoc-editor/{actor.types.js → state/actor.types.js} +8 -1
- package/dist/adhoc-editor/state/panel.d.ts +95 -0
- package/dist/adhoc-editor/state/panel.js +139 -0
- package/dist/adhoc-editor/state/utils.d.ts +17 -0
- package/dist/adhoc-editor/state/utils.js +32 -0
- package/dist/adhoc-editor/useElementsTree.d.ts +18 -0
- package/dist/adhoc-editor/useElementsTree.js +130 -0
- package/dist/adhoc-editor/viewrules/ViewRulesPanel.d.ts +1 -1
- package/dist/base/const.d.ts +1 -0
- package/dist/base-primitives/compound/CompoundActionButton.js +26 -12
- package/dist/base-primitives/compound/CompoundDetailsButton.js +22 -9
- package/dist/base-primitives/compound/CompoundNodeContainer.js +5 -4
- package/dist/base-primitives/edge/EdgeActionButton.js +1 -1
- package/dist/base-primitives/edge/EdgeLabel.js +3 -4
- package/dist/base-primitives/edge/EdgeLabelContainer.d.ts +2 -1
- package/dist/base-primitives/edge/EdgeLabelContainer.js +12 -19
- package/dist/base-primitives/edge/EdgeMarkers.js +3 -3
- package/dist/base-primitives/element/ElementActionButtons.js +35 -10
- package/dist/base-primitives/element/ElementDetailsButton.js +47 -18
- package/dist/base-primitives/element/ElementNodeContainer.d.ts +3 -3
- package/dist/base-primitives/element/ElementNodeContainer.js +23 -10
- package/dist/base-primitives/element/ElementShape.d.ts +4 -4
- package/dist/base-primitives/element/ElementShape.js +71 -8
- package/dist/components/ErrorFallback.js +1 -1
- package/dist/components/Link.js +3 -3
- package/dist/components/Logo.js +1 -1
- package/dist/components/NavigationPanel.js +2 -4
- package/dist/components/PortalToContainer.js +3 -4
- package/dist/components/RootContainer.js +9 -16
- package/dist/components/ViewNotFound.d.ts +3 -3
- package/dist/components/ViewNotFound.js +30 -26
- package/dist/context/CurrentViewModelProvider.d.ts +2 -0
- package/dist/context/CurrentViewModelProvider.js +12 -0
- package/dist/context/DefaultMantineProvider.d.ts +1 -1
- package/dist/context/DefaultMantineProvider.js +10 -1
- package/dist/context/DiagramEventHandlers.d.ts +5 -5
- package/dist/context/DiagramEventHandlers.js +10 -4
- package/dist/context/DiagramFeatures.d.ts +8 -7
- package/dist/context/DiagramFeatures.js +5 -3
- package/dist/context/FramerMotionConfig.d.ts +1 -3
- package/dist/context/IconRenderer.d.ts +5 -4
- package/dist/context/IconRenderer.js +51 -24
- package/dist/context/LikeC4ModelContext.d.ts +10 -5
- package/dist/context/LikeC4ModelContext.js +11 -3
- package/dist/context/LikeC4ProjectsContext.d.ts +3 -2
- package/dist/context/LikeC4ProjectsContext.js +6 -2
- package/dist/context/RootContainerContext.d.ts +10 -3
- package/dist/context/RootContainerContext.js +8 -3
- package/dist/context/TagStylesContext.js +1 -1
- package/dist/custom/index.js +16 -15
- package/dist/editor/LikeC4EditorProvider.js +1 -1
- package/dist/editor/applyChangesToManualLayout.js +7 -7
- package/dist/editor/editorActor.actions.js +20 -20
- package/dist/editor/editorActor.setup.js +1 -1
- package/dist/editor/editorActor.states.js +0 -9
- package/dist/editor/useEditorActorLogic.d.ts +1 -2
- package/dist/editor/useEditorActorLogic.js +8 -11
- package/dist/hooks/index.d.ts +2 -2
- package/dist/hooks/safeContext.d.ts +4 -5
- package/dist/hooks/useCallbackRef.js +7 -6
- package/dist/hooks/useCurrentView.js +5 -10
- package/dist/hooks/useCurrentViewModel.d.ts +2 -6
- package/dist/hooks/useCurrentViewModel.js +3 -7
- package/dist/hooks/useDiagram.d.ts +9 -1
- package/dist/hooks/useDiagram.js +8 -2
- package/dist/hooks/useDiagramCompareLayout.d.ts +5 -5
- package/dist/hooks/useLikeC4ElementsTree.d.ts +1 -1
- package/dist/hooks/useLikeC4ElementsTree.js +1 -1
- package/dist/hooks/useLikeC4Model.d.ts +6 -2
- package/dist/hooks/useLikeC4Model.js +7 -9
- package/dist/hooks/useLikeC4Project.d.ts +4 -6
- package/dist/hooks/useLikeC4Project.js +19 -31
- package/dist/hooks/useLikeC4Styles.js +3 -9
- package/dist/hooks/useMantinePortalProps.d.ts +1 -1
- package/dist/hooks/useMediaPrint.d.ts +0 -2
- package/dist/hooks/useOverlaysActor.js +4 -4
- package/dist/hooks/useSearchActor.js +4 -4
- package/dist/index.d.ts +1 -3
- package/dist/index.js +2 -2
- package/dist/likec4diagram/DiagramXYFlow.d.ts +2 -1
- package/dist/likec4diagram/DiagramXYFlow.js +5 -7
- package/dist/likec4diagram/custom/edges/RelationshipEdge.js +22 -24
- package/dist/likec4diagram/custom/edges/edges.css.js +2 -1
- package/dist/likec4diagram/custom/edges/useRelationshipEdgePath.js +40 -55
- package/dist/likec4diagram/custom/nodes/ElementActions.js +2 -2
- package/dist/likec4diagram/custom/nodes/NodeDrifts.d.ts +1 -2
- package/dist/likec4diagram/custom/nodes/NodeDrifts.js +3 -20
- package/dist/likec4diagram/custom/nodes/NodeNotes.d.ts +6 -0
- package/dist/likec4diagram/custom/nodes/NodeNotes.js +286 -0
- package/dist/likec4diagram/custom/nodes/SequenceActorNode.js +4 -2
- package/dist/likec4diagram/custom/nodes/nodes.js +5 -2
- package/dist/likec4diagram/custom/nodes/toolbar/ElementToolbar.js +12 -8
- package/dist/likec4diagram/custom/nodes/toolbar/_shared.js +3 -3
- package/dist/likec4diagram/custom/nodes/toolbar/styles.css.js +1 -1
- package/dist/likec4diagram/relationship-popover/RelationshipPopover.js +8 -28
- package/dist/likec4diagram/state/DiagramActorProvider.js +30 -56
- package/dist/likec4diagram/state/diagram-api.d.ts +11 -0
- package/dist/likec4diagram/state/diagram-api.js +15 -0
- package/dist/likec4diagram/state/machine.actions.d.ts +27 -0
- package/dist/likec4diagram/state/machine.actions.js +78 -21
- package/dist/likec4diagram/state/machine.actions.layout.d.ts +1 -0
- package/dist/likec4diagram/state/machine.actions.layout.js +38 -3
- package/dist/likec4diagram/state/machine.js +4 -1
- package/dist/likec4diagram/state/machine.setup.d.ts +19 -2
- package/dist/likec4diagram/state/machine.state.navigating.js +1 -1
- package/dist/likec4diagram/state/machine.state.ready.d.ts +61 -1
- package/dist/likec4diagram/state/machine.state.ready.js +11 -3
- package/dist/likec4diagram/state/utils.d.ts +2 -1
- package/dist/likec4diagram/state/utils.js +1 -1
- package/dist/likec4diagram/types.d.ts +2 -2
- package/dist/likec4diagram/ui/notation/NotationPanel.css.js +1 -1
- package/dist/likec4diagram/ui/notation/NotationPanel.d.ts +1 -1
- package/dist/likec4diagram/ui/notation/NotationPanel.js +6 -29
- package/dist/likec4diagram/useLayoutConstraints.d.ts +12 -12
- package/dist/likec4diagram/useLayoutConstraints.js +125 -86
- package/dist/likec4diagram/xyflow-diagram/diagram-view.js +2 -0
- package/dist/likec4diagram/xyflow-sequence/sequence-layout.js +7 -2
- package/dist/navigationpanel/NavigationPanel.js +2 -2
- package/dist/navigationpanel/NavigationPanelDropdown.js +13 -13
- package/dist/navigationpanel/_common.js +2 -2
- package/dist/navigationpanel/actor.js +1 -1
- package/dist/navigationpanel/comparepanel/CompareActionsMenu.js +2 -2
- package/dist/navigationpanel/comparepanel/ComparePanel.js +155 -29
- package/dist/navigationpanel/comparepanel/ComparePanelControls.js +1 -1
- package/dist/navigationpanel/comparepanel/DriftsSummary.d.ts +1 -0
- package/dist/navigationpanel/comparepanel/DriftsSummary.js +264 -0
- package/dist/navigationpanel/controls/DetailsControls.js +4 -4
- package/dist/navigationpanel/controls/LayoutWarning.js +1 -1
- package/dist/navigationpanel/controls/LogoButton.js +1 -1
- package/dist/navigationpanel/controls/NavigationButtons.js +2 -2
- package/dist/navigationpanel/controls/OpenSource.js +1 -1
- package/dist/navigationpanel/controls/SearchControl.js +1 -1
- package/dist/navigationpanel/controls/ToggleReadonly.js +3 -3
- package/dist/navigationpanel/dropdown/ProjectsMenu.js +1 -1
- package/dist/navigationpanel/editorpanel/CenterCamera.js +1 -1
- package/dist/navigationpanel/editorpanel/ChangeAutoLayoutButton.js +1 -1
- package/dist/navigationpanel/editorpanel/ManualLayoutToolsButton.js +9 -9
- package/dist/navigationpanel/editorpanel/ToggleReadonly.js +1 -1
- package/dist/navigationpanel/walkthrough/ActiveWalkthroughControls.js +6 -6
- package/dist/navigationpanel/walkthrough/DynamicViewControls.d.ts +16 -16
- package/dist/navigationpanel/walkthrough/DynamicViewControls.js +1 -1
- package/dist/navigationpanel/walkthrough/WalkthroughPanel.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/createReactComponent.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/defaultAttributes.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconAlertTriangle.js +2 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowDownRight.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowLeft.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowRight.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconBolt.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconBrowser.js +2 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconCheck.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronDown.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronLeft.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconChevronRight.js +1 -1
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.36.1_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconCopy.js +14 -0
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconCylinder.js +2 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconDeviceMobile.js +2 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconDirectionSignFilled.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconExternalLink.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconFileSymlink.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconFileText.js +2 -2
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.36.1_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconFocusCentered.js +14 -0
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconFolderFilled.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconHelpCircle.js +1 -1
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.36.1_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconId.js +14 -0
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconInfoCircle.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignBottom.js +2 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignCenter.js +2 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignLeft.js +2 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignMiddle.js +2 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignRight.js +2 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutAlignTop.js +2 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutBoardSplit.js +2 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutCollage.js +2 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLayoutDashboard.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLink.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLock.js +2 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconLockOpen2.js +2 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerPlayFilled.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerSkipBackFilled.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerSkipForwardFilled.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconPlayerStopFilled.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconRectangularPrism.js +2 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconReorder.js +2 -2
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.36.1_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconRouteOff.js +14 -0
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconSearch.js +2 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconSelector.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconStack2.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconStarFilled.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconTarget.js +2 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconTransform.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconTrash.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconUser.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconX.js +1 -1
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.4 → @tabler_icons-react@3.36.1_react@19.2.4}/node_modules/@tabler/icons-react/dist/esm/icons/IconZoomScan.js +1 -1
- package/dist/node_modules/.pnpm/@xstate_store@3.14.0_react@19.2.4/node_modules/@xstate/store/dist/store-1b2fbb72.cjs.js +742 -0
- package/dist/node_modules/.pnpm/@xstate_store@3.14.0_react@19.2.4/node_modules/@xstate/store/react/dist/xstate-store-react.cjs.js +175 -0
- package/dist/overlays/element-details/ElementDetailsCard.css.js +11 -11
- package/dist/overlays/element-details/ElementDetailsCard.js +44 -45
- package/dist/overlays/element-details/MetadataValue.js +7 -7
- package/dist/overlays/element-details/TabPanelDeployments.js +4 -4
- package/dist/overlays/element-details/TabPanelRelationships.css.js +5 -5
- package/dist/overlays/element-details/TabPanelRelationships.js +4 -5
- package/dist/overlays/element-details/TabPanelStructure.css.js +3 -3
- package/dist/overlays/element-details/TabPanelStructure.js +1 -1
- package/dist/overlays/element-details/actorContext.d.ts +1 -1
- package/dist/overlays/overlaysActor.js +1 -1
- package/dist/overlays/relationship-details/RelationshipDetails.js +3 -3
- package/dist/overlays/relationship-details/SelectEdge.css.js +4 -4
- package/dist/overlays/relationship-details/SelectEdge.js +2 -2
- package/dist/overlays/relationship-details/custom/ElementActions.js +3 -3
- package/dist/overlays/relationships-browser/RelationshipsBrowser.js +6 -6
- package/dist/overlays/relationships-browser/SelectElement.css.js +2 -2
- package/dist/overlays/relationships-browser/SelectElement.js +2 -2
- package/dist/overlays/relationships-browser/actor.js +1 -1
- package/dist/overlays/relationships-browser/custom/ElementActions.js +3 -3
- package/dist/overlays/relationships-browser/custom/EmptyNode.js +1 -1
- package/dist/overlays/relationships-browser/useViewToNodesEdges.js +1 -1
- package/dist/projects-overview/ProjectsOverview.js +2 -2
- package/dist/projects-overview/ProjectsOverviewXY.d.ts +1 -5
- package/dist/projects-overview/ProjectsOverviewXY.js +1 -1
- package/dist/projects-overview/actor.d.ts +1 -1
- package/dist/projects-overview/context.d.ts +2 -2
- package/dist/projects-overview/context.js +2 -1
- package/dist/projects-overview/custom/nodeTypes.js +1 -1
- package/dist/search/Search.d.ts +2 -1
- package/dist/search/Search.js +108 -87
- package/dist/search/components/ElementsColumn.css.js +3 -3
- package/dist/search/components/ElementsColumn.js +93 -59
- package/dist/search/components/PickView.js +8 -4
- package/dist/search/components/SearchByTags.js +1 -1
- package/dist/search/components/SearchInput.js +2 -2
- package/dist/search/components/ViewsColum.d.ts +2 -1
- package/dist/search/components/ViewsColum.js +39 -35
- package/dist/search/components/ViewsColumn.css.js +1 -1
- package/dist/search/components/_shared.css.js +11 -11
- package/dist/search/components/utils.js +1 -4
- package/dist/search/hooks.js +4 -1
- package/dist/search/searchActor.d.ts +12 -2
- package/dist/search/searchActor.js +60 -4
- package/dist/shadowroot/ShadowRoot.d.ts +5 -2
- package/dist/shadowroot/ShadowRoot.js +7 -5
- package/dist/shadowroot/styles.css.js +3 -2
- package/dist/styles.css2.js +1 -1
- package/dist/utils/view-bounds.d.ts +3 -2
- package/dist/utils/view-bounds.js +1 -1
- package/dist/utils/xyflow.d.ts +10 -5
- package/dist/utils/xyflow.js +24 -22
- package/package.json +33 -32
- package/panda.buildinfo.json +176 -87
- package/styles-min.css +1 -1
- package/styles.css +1 -1
- package/bundle/index.js +0 -52554
- package/bundle/package.json +0 -4
- package/dist/adhoc-editor/EditorNavigationPanel.d.ts +0 -1
- package/dist/adhoc-editor/EditorNavigationPanel.js +0 -32
- package/dist/adhoc-editor/SelectElementOverlay.d.ts +0 -1
- package/dist/adhoc-editor/SelectElementOverlay.js +0 -124
- package/dist/adhoc-editor/actor.d.ts +0 -131
- package/dist/adhoc-editor/actor.editor.js +0 -96
- package/dist/adhoc-editor/viewrules/ViewRulesPanel.js +0 -104
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconCirclePlus.js +0 -14
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconCopy.js +0 -14
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconFocusCentered.js +0 -14
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconId.js +0 -14
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconRouteOff.js +0 -14
|
@@ -0,0 +1,742 @@
|
|
|
1
|
+
import { __exports as store1b2fbb72_cjs } from '../../../../../../../_virtual/store-1b2fbb72.cjs.js';
|
|
2
|
+
|
|
3
|
+
var hasRequiredStore1b2fbb72_cjs;
|
|
4
|
+
|
|
5
|
+
function requireStore1b2fbb72_cjs () {
|
|
6
|
+
if (hasRequiredStore1b2fbb72_cjs) return store1b2fbb72_cjs;
|
|
7
|
+
hasRequiredStore1b2fbb72_cjs = 1;
|
|
8
|
+
|
|
9
|
+
/* eslint-disable */
|
|
10
|
+
function createReactiveSystem({
|
|
11
|
+
update,
|
|
12
|
+
notify,
|
|
13
|
+
unwatched
|
|
14
|
+
}) {
|
|
15
|
+
let currentVersion = 0;
|
|
16
|
+
return {
|
|
17
|
+
link,
|
|
18
|
+
unlink,
|
|
19
|
+
propagate,
|
|
20
|
+
checkDirty,
|
|
21
|
+
endTracking,
|
|
22
|
+
startTracking,
|
|
23
|
+
shallowPropagate
|
|
24
|
+
};
|
|
25
|
+
function link(dep, sub) {
|
|
26
|
+
const prevDep = sub._depsTail;
|
|
27
|
+
if (prevDep !== undefined && prevDep.dep === dep) {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
const nextDep = prevDep !== undefined ? prevDep.nextDep : sub._deps;
|
|
31
|
+
if (nextDep !== undefined && nextDep.dep === dep) {
|
|
32
|
+
nextDep.version = currentVersion;
|
|
33
|
+
sub._depsTail = nextDep;
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
const prevSub = dep._subsTail;
|
|
37
|
+
if (prevSub !== undefined && prevSub.version === currentVersion && prevSub.sub === sub) {
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
const newLink = sub._depsTail = dep._subsTail = {
|
|
41
|
+
version: currentVersion,
|
|
42
|
+
dep,
|
|
43
|
+
sub,
|
|
44
|
+
prevDep,
|
|
45
|
+
nextDep,
|
|
46
|
+
prevSub,
|
|
47
|
+
nextSub: undefined
|
|
48
|
+
};
|
|
49
|
+
if (nextDep !== undefined) {
|
|
50
|
+
nextDep.prevDep = newLink;
|
|
51
|
+
}
|
|
52
|
+
if (prevDep !== undefined) {
|
|
53
|
+
prevDep.nextDep = newLink;
|
|
54
|
+
} else {
|
|
55
|
+
sub._deps = newLink;
|
|
56
|
+
}
|
|
57
|
+
if (prevSub !== undefined) {
|
|
58
|
+
prevSub.nextSub = newLink;
|
|
59
|
+
} else {
|
|
60
|
+
dep._subs = newLink;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
function unlink(link, sub = link.sub) {
|
|
64
|
+
const dep = link.dep;
|
|
65
|
+
const prevDep = link.prevDep;
|
|
66
|
+
const nextDep = link.nextDep;
|
|
67
|
+
const nextSub = link.nextSub;
|
|
68
|
+
const prevSub = link.prevSub;
|
|
69
|
+
if (nextDep !== undefined) {
|
|
70
|
+
nextDep.prevDep = prevDep;
|
|
71
|
+
} else {
|
|
72
|
+
sub._depsTail = prevDep;
|
|
73
|
+
}
|
|
74
|
+
if (prevDep !== undefined) {
|
|
75
|
+
prevDep.nextDep = nextDep;
|
|
76
|
+
} else {
|
|
77
|
+
sub._deps = nextDep;
|
|
78
|
+
}
|
|
79
|
+
if (nextSub !== undefined) {
|
|
80
|
+
nextSub.prevSub = prevSub;
|
|
81
|
+
} else {
|
|
82
|
+
dep._subsTail = prevSub;
|
|
83
|
+
}
|
|
84
|
+
if (prevSub !== undefined) {
|
|
85
|
+
prevSub.nextSub = nextSub;
|
|
86
|
+
} else if ((dep._subs = nextSub) === undefined) {
|
|
87
|
+
unwatched(dep);
|
|
88
|
+
}
|
|
89
|
+
return nextDep;
|
|
90
|
+
}
|
|
91
|
+
function propagate(link) {
|
|
92
|
+
let next = link.nextSub;
|
|
93
|
+
let stack;
|
|
94
|
+
top: do {
|
|
95
|
+
const sub = link.sub;
|
|
96
|
+
let flags = sub._flags;
|
|
97
|
+
if (!(flags & 60)) {
|
|
98
|
+
sub._flags = flags | 32;
|
|
99
|
+
} else if (!(flags & 12)) {
|
|
100
|
+
flags = 0;
|
|
101
|
+
} else if (!(flags & 4)) {
|
|
102
|
+
sub._flags = flags & -9 | 32;
|
|
103
|
+
} else if (!(flags & 48) && isValidLink(link, sub)) {
|
|
104
|
+
sub._flags = flags | 40;
|
|
105
|
+
flags &= 1;
|
|
106
|
+
} else {
|
|
107
|
+
flags = 0;
|
|
108
|
+
}
|
|
109
|
+
if (flags & 2) {
|
|
110
|
+
notify(sub);
|
|
111
|
+
}
|
|
112
|
+
if (flags & 1) {
|
|
113
|
+
const subSubs = sub._subs;
|
|
114
|
+
if (subSubs !== undefined) {
|
|
115
|
+
const nextSub = (link = subSubs).nextSub;
|
|
116
|
+
if (nextSub !== undefined) {
|
|
117
|
+
stack = {
|
|
118
|
+
value: next,
|
|
119
|
+
prev: stack
|
|
120
|
+
};
|
|
121
|
+
next = nextSub;
|
|
122
|
+
}
|
|
123
|
+
continue;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
if ((link = next) !== undefined) {
|
|
127
|
+
next = link.nextSub;
|
|
128
|
+
continue;
|
|
129
|
+
}
|
|
130
|
+
while (stack !== undefined) {
|
|
131
|
+
link = stack.value;
|
|
132
|
+
stack = stack.prev;
|
|
133
|
+
if (link !== undefined) {
|
|
134
|
+
next = link.nextSub;
|
|
135
|
+
continue top;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
break;
|
|
139
|
+
} while (true);
|
|
140
|
+
}
|
|
141
|
+
function startTracking(sub) {
|
|
142
|
+
++currentVersion;
|
|
143
|
+
sub._depsTail = undefined;
|
|
144
|
+
sub._flags = sub._flags & -57 | 4;
|
|
145
|
+
}
|
|
146
|
+
function endTracking(sub) {
|
|
147
|
+
const depsTail = sub._depsTail;
|
|
148
|
+
let toRemove = depsTail !== undefined ? depsTail.nextDep : sub._deps;
|
|
149
|
+
while (toRemove !== undefined) {
|
|
150
|
+
toRemove = unlink(toRemove, sub);
|
|
151
|
+
}
|
|
152
|
+
sub._flags &= -5;
|
|
153
|
+
}
|
|
154
|
+
function checkDirty(link, sub) {
|
|
155
|
+
let stack;
|
|
156
|
+
let checkDepth = 0;
|
|
157
|
+
top: do {
|
|
158
|
+
const dep = link.dep;
|
|
159
|
+
const flags = dep._flags;
|
|
160
|
+
let dirty = false;
|
|
161
|
+
if (sub._flags & 16) {
|
|
162
|
+
dirty = true;
|
|
163
|
+
} else if ((flags & 17) === 17) {
|
|
164
|
+
if (update(dep)) {
|
|
165
|
+
const subs = dep._subs;
|
|
166
|
+
if (subs.nextSub !== undefined) {
|
|
167
|
+
shallowPropagate(subs);
|
|
168
|
+
}
|
|
169
|
+
dirty = true;
|
|
170
|
+
}
|
|
171
|
+
} else if ((flags & 33) === 33) {
|
|
172
|
+
if (link.nextSub !== undefined || link.prevSub !== undefined) {
|
|
173
|
+
stack = {
|
|
174
|
+
value: link,
|
|
175
|
+
prev: stack
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
link = dep._deps;
|
|
179
|
+
sub = dep;
|
|
180
|
+
++checkDepth;
|
|
181
|
+
continue;
|
|
182
|
+
}
|
|
183
|
+
if (!dirty) {
|
|
184
|
+
const nextDep = link.nextDep;
|
|
185
|
+
if (nextDep !== undefined) {
|
|
186
|
+
link = nextDep;
|
|
187
|
+
continue;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
while (checkDepth--) {
|
|
191
|
+
const firstSub = sub._subs;
|
|
192
|
+
const hasMultipleSubs = firstSub.nextSub !== undefined;
|
|
193
|
+
if (hasMultipleSubs) {
|
|
194
|
+
link = stack.value;
|
|
195
|
+
stack = stack.prev;
|
|
196
|
+
} else {
|
|
197
|
+
link = firstSub;
|
|
198
|
+
}
|
|
199
|
+
if (dirty) {
|
|
200
|
+
if (update(sub)) {
|
|
201
|
+
if (hasMultipleSubs) {
|
|
202
|
+
shallowPropagate(firstSub);
|
|
203
|
+
}
|
|
204
|
+
sub = link.sub;
|
|
205
|
+
continue;
|
|
206
|
+
}
|
|
207
|
+
} else {
|
|
208
|
+
sub._flags &= -33;
|
|
209
|
+
}
|
|
210
|
+
sub = link.sub;
|
|
211
|
+
const nextDep = link.nextDep;
|
|
212
|
+
if (nextDep !== undefined) {
|
|
213
|
+
link = nextDep;
|
|
214
|
+
continue top;
|
|
215
|
+
}
|
|
216
|
+
dirty = false;
|
|
217
|
+
}
|
|
218
|
+
return dirty;
|
|
219
|
+
} while (true);
|
|
220
|
+
}
|
|
221
|
+
function shallowPropagate(link) {
|
|
222
|
+
do {
|
|
223
|
+
const sub = link.sub;
|
|
224
|
+
const flags = sub._flags;
|
|
225
|
+
if ((flags & 48) === 32) {
|
|
226
|
+
sub._flags = flags | 16;
|
|
227
|
+
if (flags & 2) {
|
|
228
|
+
notify(sub);
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
} while ((link = link.nextSub) !== undefined);
|
|
232
|
+
}
|
|
233
|
+
function isValidLink(checkLink, sub) {
|
|
234
|
+
let link = sub._depsTail;
|
|
235
|
+
while (link !== undefined) {
|
|
236
|
+
if (link === checkLink) {
|
|
237
|
+
return true;
|
|
238
|
+
}
|
|
239
|
+
link = link.prevDep;
|
|
240
|
+
}
|
|
241
|
+
return false;
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
function toObserver(nextHandler, errorHandler, completionHandler) {
|
|
246
|
+
const isObserver = typeof nextHandler === 'object';
|
|
247
|
+
const self = isObserver ? nextHandler : undefined;
|
|
248
|
+
return {
|
|
249
|
+
next: (isObserver ? nextHandler.next : nextHandler)?.bind(self),
|
|
250
|
+
error: (isObserver ? nextHandler.error : errorHandler)?.bind(self),
|
|
251
|
+
complete: (isObserver ? nextHandler.complete : completionHandler)?.bind(self)
|
|
252
|
+
};
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
const queuedEffects = [];
|
|
256
|
+
const {
|
|
257
|
+
link,
|
|
258
|
+
unlink,
|
|
259
|
+
propagate,
|
|
260
|
+
checkDirty,
|
|
261
|
+
endTracking,
|
|
262
|
+
startTracking,
|
|
263
|
+
shallowPropagate
|
|
264
|
+
} = createReactiveSystem({
|
|
265
|
+
update(atom) {
|
|
266
|
+
return atom._update();
|
|
267
|
+
},
|
|
268
|
+
notify(effect) {
|
|
269
|
+
queuedEffects[queuedEffectsLength++] = effect;
|
|
270
|
+
},
|
|
271
|
+
unwatched(atom) {
|
|
272
|
+
let toRemove = atom._deps;
|
|
273
|
+
if (toRemove !== undefined) {
|
|
274
|
+
atom._flags = 17;
|
|
275
|
+
do {
|
|
276
|
+
toRemove = unlink(toRemove, atom);
|
|
277
|
+
} while (toRemove !== undefined);
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
});
|
|
281
|
+
let notifyIndex = 0;
|
|
282
|
+
let queuedEffectsLength = 0;
|
|
283
|
+
let activeSub;
|
|
284
|
+
function flush() {
|
|
285
|
+
while (notifyIndex < queuedEffectsLength) {
|
|
286
|
+
const effect = queuedEffects[notifyIndex];
|
|
287
|
+
queuedEffects[notifyIndex++] = undefined;
|
|
288
|
+
effect.notify();
|
|
289
|
+
}
|
|
290
|
+
notifyIndex = 0;
|
|
291
|
+
queuedEffectsLength = 0;
|
|
292
|
+
}
|
|
293
|
+
function createAsyncAtom(getValue, options) {
|
|
294
|
+
const atom = createAtom(() => {
|
|
295
|
+
getValue().then(data => {
|
|
296
|
+
if (atom._update({
|
|
297
|
+
status: 'done',
|
|
298
|
+
data
|
|
299
|
+
})) {
|
|
300
|
+
const subs = atom._subs;
|
|
301
|
+
if (subs !== undefined) {
|
|
302
|
+
propagate(subs);
|
|
303
|
+
shallowPropagate(subs);
|
|
304
|
+
flush();
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
}, error => {
|
|
308
|
+
if (atom._update({
|
|
309
|
+
status: 'error',
|
|
310
|
+
error
|
|
311
|
+
})) {
|
|
312
|
+
const subs = atom._subs;
|
|
313
|
+
if (subs !== undefined) {
|
|
314
|
+
propagate(subs);
|
|
315
|
+
shallowPropagate(subs);
|
|
316
|
+
flush();
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
});
|
|
320
|
+
return {
|
|
321
|
+
status: 'pending'
|
|
322
|
+
};
|
|
323
|
+
}, options);
|
|
324
|
+
return atom;
|
|
325
|
+
}
|
|
326
|
+
function createAtom(valueOrFn, options) {
|
|
327
|
+
const isComputed = typeof valueOrFn === 'function';
|
|
328
|
+
const getter = valueOrFn;
|
|
329
|
+
|
|
330
|
+
// Create plain object atom
|
|
331
|
+
const atom = {
|
|
332
|
+
_snapshot: isComputed ? undefined : valueOrFn,
|
|
333
|
+
_subs: undefined,
|
|
334
|
+
_subsTail: undefined,
|
|
335
|
+
_flags: 0,
|
|
336
|
+
get() {
|
|
337
|
+
if (activeSub !== undefined) {
|
|
338
|
+
link(atom, activeSub);
|
|
339
|
+
}
|
|
340
|
+
return atom._snapshot;
|
|
341
|
+
},
|
|
342
|
+
subscribe(observerOrFn) {
|
|
343
|
+
const obs = toObserver(observerOrFn);
|
|
344
|
+
const observed = {
|
|
345
|
+
current: false
|
|
346
|
+
};
|
|
347
|
+
const e = effect(() => {
|
|
348
|
+
atom.get();
|
|
349
|
+
if (!observed.current) {
|
|
350
|
+
observed.current = true;
|
|
351
|
+
} else {
|
|
352
|
+
obs.next?.(atom._snapshot);
|
|
353
|
+
}
|
|
354
|
+
});
|
|
355
|
+
return {
|
|
356
|
+
unsubscribe: () => {
|
|
357
|
+
e.stop();
|
|
358
|
+
}
|
|
359
|
+
};
|
|
360
|
+
},
|
|
361
|
+
_update(getValue) {
|
|
362
|
+
const prevSub = activeSub;
|
|
363
|
+
const compare = options?.compare ?? Object.is;
|
|
364
|
+
activeSub = atom;
|
|
365
|
+
startTracking(atom);
|
|
366
|
+
try {
|
|
367
|
+
const oldValue = atom._snapshot;
|
|
368
|
+
const read = atom => atom.get();
|
|
369
|
+
const newValue = typeof getValue === 'function' ? getValue(oldValue) : getValue === undefined && isComputed ? getter(read, oldValue) : getValue;
|
|
370
|
+
if (oldValue === undefined || !compare(oldValue, newValue)) {
|
|
371
|
+
atom._snapshot = newValue;
|
|
372
|
+
return true;
|
|
373
|
+
}
|
|
374
|
+
return false;
|
|
375
|
+
} finally {
|
|
376
|
+
activeSub = prevSub;
|
|
377
|
+
endTracking(atom);
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
};
|
|
381
|
+
if (isComputed) {
|
|
382
|
+
Object.assign(atom, {
|
|
383
|
+
_deps: undefined,
|
|
384
|
+
_depsTail: undefined,
|
|
385
|
+
_flags: 17,
|
|
386
|
+
get() {
|
|
387
|
+
const flags = this._flags;
|
|
388
|
+
if (flags & 16 || flags & 32 && checkDirty(atom._deps, atom)) {
|
|
389
|
+
if (atom._update()) {
|
|
390
|
+
const subs = atom._subs;
|
|
391
|
+
if (subs !== undefined) {
|
|
392
|
+
shallowPropagate(subs);
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
} else if (flags & 32) {
|
|
396
|
+
atom._flags = flags & -33;
|
|
397
|
+
}
|
|
398
|
+
if (activeSub !== undefined) {
|
|
399
|
+
link(atom, activeSub);
|
|
400
|
+
}
|
|
401
|
+
return atom._snapshot;
|
|
402
|
+
}
|
|
403
|
+
});
|
|
404
|
+
} else {
|
|
405
|
+
Object.assign(atom, {
|
|
406
|
+
set(valueOrFn) {
|
|
407
|
+
if (atom._update(valueOrFn)) {
|
|
408
|
+
const subs = atom._subs;
|
|
409
|
+
if (subs !== undefined) {
|
|
410
|
+
propagate(subs);
|
|
411
|
+
shallowPropagate(subs);
|
|
412
|
+
flush();
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
});
|
|
417
|
+
}
|
|
418
|
+
return atom;
|
|
419
|
+
}
|
|
420
|
+
function effect(fn) {
|
|
421
|
+
const run = () => {
|
|
422
|
+
const prevSub = activeSub;
|
|
423
|
+
activeSub = effectObj;
|
|
424
|
+
startTracking(effectObj);
|
|
425
|
+
try {
|
|
426
|
+
return fn();
|
|
427
|
+
} finally {
|
|
428
|
+
activeSub = prevSub;
|
|
429
|
+
endTracking(effectObj);
|
|
430
|
+
}
|
|
431
|
+
};
|
|
432
|
+
const effectObj = {
|
|
433
|
+
_deps: undefined,
|
|
434
|
+
_depsTail: undefined,
|
|
435
|
+
_flags: 2,
|
|
436
|
+
notify() {
|
|
437
|
+
const flags = this._flags;
|
|
438
|
+
if (flags & 16 || flags & 32 && checkDirty(this._deps, this)) {
|
|
439
|
+
run();
|
|
440
|
+
} else if (flags & 32) {
|
|
441
|
+
this._flags = flags & -33;
|
|
442
|
+
}
|
|
443
|
+
},
|
|
444
|
+
stop() {
|
|
445
|
+
startTracking(this);
|
|
446
|
+
endTracking(this);
|
|
447
|
+
}
|
|
448
|
+
};
|
|
449
|
+
run();
|
|
450
|
+
return effectObj;
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
const symbolObservable = (() => typeof Symbol === 'function' && Symbol.observable || '@@observable')();
|
|
454
|
+
const inspectionObservers = new WeakMap();
|
|
455
|
+
function createStoreCore(logic, emits) {
|
|
456
|
+
let listeners;
|
|
457
|
+
const initialSnapshot = logic.getInitialSnapshot();
|
|
458
|
+
let currentSnapshot = initialSnapshot;
|
|
459
|
+
const atom = createAtom(currentSnapshot);
|
|
460
|
+
const emit = ev => {
|
|
461
|
+
if (!listeners) {
|
|
462
|
+
return;
|
|
463
|
+
}
|
|
464
|
+
const type = ev.type;
|
|
465
|
+
const typeListeners = listeners.get(type);
|
|
466
|
+
if (typeListeners) {
|
|
467
|
+
typeListeners.forEach(listener => listener(ev));
|
|
468
|
+
}
|
|
469
|
+
};
|
|
470
|
+
const transition = logic.transition;
|
|
471
|
+
function receive(event) {
|
|
472
|
+
const [nextSnapshot, effects] = transition(currentSnapshot, event);
|
|
473
|
+
currentSnapshot = nextSnapshot;
|
|
474
|
+
inspectionObservers.get(store)?.forEach(observer => {
|
|
475
|
+
observer.next?.({
|
|
476
|
+
type: '@xstate.snapshot',
|
|
477
|
+
event,
|
|
478
|
+
snapshot: nextSnapshot,
|
|
479
|
+
actorRef: store,
|
|
480
|
+
rootId: store.sessionId
|
|
481
|
+
});
|
|
482
|
+
});
|
|
483
|
+
atom.set(nextSnapshot);
|
|
484
|
+
for (const effect of effects) {
|
|
485
|
+
if (typeof effect === 'function') {
|
|
486
|
+
effect();
|
|
487
|
+
} else {
|
|
488
|
+
// handle the inherent effect first
|
|
489
|
+
emits?.[effect.type]?.(effect);
|
|
490
|
+
emit(effect);
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
const store = {
|
|
495
|
+
get _snapshot() {
|
|
496
|
+
return atom._snapshot;
|
|
497
|
+
},
|
|
498
|
+
on(emittedEventType, handler) {
|
|
499
|
+
if (!listeners) {
|
|
500
|
+
listeners = new Map();
|
|
501
|
+
}
|
|
502
|
+
let eventListeners = listeners.get(emittedEventType);
|
|
503
|
+
if (!eventListeners) {
|
|
504
|
+
eventListeners = new Set();
|
|
505
|
+
listeners.set(emittedEventType, eventListeners);
|
|
506
|
+
}
|
|
507
|
+
const wrappedHandler = handler.bind(undefined);
|
|
508
|
+
eventListeners.add(wrappedHandler);
|
|
509
|
+
return {
|
|
510
|
+
unsubscribe() {
|
|
511
|
+
eventListeners.delete(wrappedHandler);
|
|
512
|
+
}
|
|
513
|
+
};
|
|
514
|
+
},
|
|
515
|
+
transition: logic.transition,
|
|
516
|
+
// TODO: fix this
|
|
517
|
+
sessionId: uniqueId(),
|
|
518
|
+
send(event) {
|
|
519
|
+
inspectionObservers.get(store)?.forEach(observer => {
|
|
520
|
+
observer.next?.({
|
|
521
|
+
type: '@xstate.event',
|
|
522
|
+
event,
|
|
523
|
+
sourceRef: undefined,
|
|
524
|
+
actorRef: store,
|
|
525
|
+
rootId: store.sessionId
|
|
526
|
+
});
|
|
527
|
+
});
|
|
528
|
+
receive(event);
|
|
529
|
+
},
|
|
530
|
+
getSnapshot() {
|
|
531
|
+
return currentSnapshot;
|
|
532
|
+
},
|
|
533
|
+
get() {
|
|
534
|
+
return atom.get();
|
|
535
|
+
},
|
|
536
|
+
getInitialSnapshot() {
|
|
537
|
+
return initialSnapshot;
|
|
538
|
+
},
|
|
539
|
+
subscribe: atom.subscribe.bind(atom),
|
|
540
|
+
[symbolObservable]() {
|
|
541
|
+
return this;
|
|
542
|
+
},
|
|
543
|
+
inspect: observerOrFn => {
|
|
544
|
+
const observer = toObserver(observerOrFn);
|
|
545
|
+
inspectionObservers.set(store, inspectionObservers.get(store) ?? new Set());
|
|
546
|
+
inspectionObservers.get(store).add(observer);
|
|
547
|
+
observer.next?.({
|
|
548
|
+
type: '@xstate.actor',
|
|
549
|
+
actorRef: store,
|
|
550
|
+
rootId: store.sessionId
|
|
551
|
+
});
|
|
552
|
+
observer.next?.({
|
|
553
|
+
type: '@xstate.snapshot',
|
|
554
|
+
snapshot: initialSnapshot,
|
|
555
|
+
event: {
|
|
556
|
+
type: '@xstate.init'
|
|
557
|
+
},
|
|
558
|
+
actorRef: store,
|
|
559
|
+
rootId: store.sessionId
|
|
560
|
+
});
|
|
561
|
+
return {
|
|
562
|
+
unsubscribe() {
|
|
563
|
+
return inspectionObservers.get(store)?.delete(observer);
|
|
564
|
+
}
|
|
565
|
+
};
|
|
566
|
+
},
|
|
567
|
+
trigger: new Proxy({}, {
|
|
568
|
+
get: (_, eventType) => {
|
|
569
|
+
return payload => {
|
|
570
|
+
store.send({
|
|
571
|
+
...payload,
|
|
572
|
+
type: eventType
|
|
573
|
+
});
|
|
574
|
+
};
|
|
575
|
+
}
|
|
576
|
+
}),
|
|
577
|
+
select(selector, equalityFn = Object.is) {
|
|
578
|
+
return createAtom(() => selector(store.get().context), {
|
|
579
|
+
compare: equalityFn
|
|
580
|
+
});
|
|
581
|
+
},
|
|
582
|
+
with(extension) {
|
|
583
|
+
const extendedLogic = extension(logic);
|
|
584
|
+
return createStoreCore(extendedLogic);
|
|
585
|
+
}
|
|
586
|
+
};
|
|
587
|
+
return store;
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
/**
|
|
591
|
+
* Creates a **store** that has its own internal state and can be sent events
|
|
592
|
+
* that update its internal state based on transitions.
|
|
593
|
+
*
|
|
594
|
+
* @example
|
|
595
|
+
*
|
|
596
|
+
* ```ts
|
|
597
|
+
* const store = createStore({
|
|
598
|
+
* context: { count: 0, name: 'Ada' },
|
|
599
|
+
* on: {
|
|
600
|
+
* inc: (context, event: { by: number }) => ({
|
|
601
|
+
* ...context,
|
|
602
|
+
* count: context.count + event.by
|
|
603
|
+
* })
|
|
604
|
+
* }
|
|
605
|
+
* });
|
|
606
|
+
*
|
|
607
|
+
* store.subscribe((snapshot) => {
|
|
608
|
+
* console.log(snapshot);
|
|
609
|
+
* });
|
|
610
|
+
*
|
|
611
|
+
* store.send({ type: 'inc', by: 5 });
|
|
612
|
+
* // Logs { context: { count: 5, name: 'Ada' }, status: 'active', ... }
|
|
613
|
+
* ```
|
|
614
|
+
*
|
|
615
|
+
* @param config - The store configuration object
|
|
616
|
+
* @param config.context - The initial state of the store
|
|
617
|
+
* @param config.on - An object mapping event types to transition functions
|
|
618
|
+
* @param config.emits - An object mapping emitted event types to handlers
|
|
619
|
+
* @returns A store instance with methods to send events and subscribe to state
|
|
620
|
+
* changes
|
|
621
|
+
*/
|
|
622
|
+
|
|
623
|
+
function createStore(definitionOrLogic) {
|
|
624
|
+
if ('transition' in definitionOrLogic) {
|
|
625
|
+
return createStoreCore(definitionOrLogic);
|
|
626
|
+
}
|
|
627
|
+
const transition = createStoreTransition(definitionOrLogic.on);
|
|
628
|
+
const logic = {
|
|
629
|
+
getInitialSnapshot: () => ({
|
|
630
|
+
status: 'active',
|
|
631
|
+
context: definitionOrLogic.context,
|
|
632
|
+
output: undefined,
|
|
633
|
+
error: undefined
|
|
634
|
+
}),
|
|
635
|
+
transition
|
|
636
|
+
};
|
|
637
|
+
return createStoreCore(logic, definitionOrLogic.emits);
|
|
638
|
+
}
|
|
639
|
+
function _createStoreConfig(definition) {
|
|
640
|
+
return definition;
|
|
641
|
+
}
|
|
642
|
+
const createStoreConfig = _createStoreConfig;
|
|
643
|
+
|
|
644
|
+
/**
|
|
645
|
+
* Creates a `Store` with a provided producer (such as Immer's `producer(…)` A
|
|
646
|
+
* store has its own internal state and can receive events.
|
|
647
|
+
*
|
|
648
|
+
* @example
|
|
649
|
+
*
|
|
650
|
+
* ```ts
|
|
651
|
+
* import { produce } from 'immer';
|
|
652
|
+
*
|
|
653
|
+
* const store = createStoreWithProducer(produce, {
|
|
654
|
+
* context: { count: 0 },
|
|
655
|
+
* on: {
|
|
656
|
+
* inc: (context, event: { by: number }) => {
|
|
657
|
+
* context.count += event.by;
|
|
658
|
+
* }
|
|
659
|
+
* }
|
|
660
|
+
* });
|
|
661
|
+
*
|
|
662
|
+
* store.subscribe((snapshot) => {
|
|
663
|
+
* console.log(snapshot);
|
|
664
|
+
* });
|
|
665
|
+
*
|
|
666
|
+
* store.send({ type: 'inc', by: 5 });
|
|
667
|
+
* // Logs { context: { count: 5 }, status: 'active', ... }
|
|
668
|
+
* ```
|
|
669
|
+
*/
|
|
670
|
+
function createStoreWithProducer(producer, config) {
|
|
671
|
+
const transition = createStoreTransition(config.on, producer);
|
|
672
|
+
const logic = {
|
|
673
|
+
getInitialSnapshot: () => ({
|
|
674
|
+
status: 'active',
|
|
675
|
+
context: config.context,
|
|
676
|
+
output: undefined,
|
|
677
|
+
error: undefined
|
|
678
|
+
}),
|
|
679
|
+
transition
|
|
680
|
+
};
|
|
681
|
+
return createStoreCore(logic, config.emits);
|
|
682
|
+
}
|
|
683
|
+
/**
|
|
684
|
+
* Creates a store transition function that handles state updates based on
|
|
685
|
+
* events.
|
|
686
|
+
*
|
|
687
|
+
* @param transitions - An object mapping event types to transition functions
|
|
688
|
+
* @param producer - Optional producer function (e.g., Immer's produce) for
|
|
689
|
+
* immutable updates
|
|
690
|
+
* @returns A transition function that takes a snapshot and event and returns a
|
|
691
|
+
* new snapshot with effects
|
|
692
|
+
*/
|
|
693
|
+
function createStoreTransition(transitions, producer) {
|
|
694
|
+
return (snapshot, event) => {
|
|
695
|
+
const currentContext = snapshot.context;
|
|
696
|
+
const assigner = transitions?.[event.type];
|
|
697
|
+
const effects = [];
|
|
698
|
+
const enqueue = {
|
|
699
|
+
emit: new Proxy({}, {
|
|
700
|
+
get: (_, eventType) => {
|
|
701
|
+
return payload => {
|
|
702
|
+
effects.push({
|
|
703
|
+
...payload,
|
|
704
|
+
type: eventType
|
|
705
|
+
});
|
|
706
|
+
};
|
|
707
|
+
}
|
|
708
|
+
}),
|
|
709
|
+
effect: fn => {
|
|
710
|
+
effects.push(fn);
|
|
711
|
+
}
|
|
712
|
+
};
|
|
713
|
+
if (!assigner) {
|
|
714
|
+
return [snapshot, effects];
|
|
715
|
+
}
|
|
716
|
+
const nextContext = producer ? producer(currentContext, draftContext => assigner(draftContext, event, enqueue)) : assigner(currentContext, event, enqueue) ?? currentContext;
|
|
717
|
+
return [nextContext === currentContext ? snapshot : {
|
|
718
|
+
...snapshot,
|
|
719
|
+
context: nextContext
|
|
720
|
+
}, effects];
|
|
721
|
+
};
|
|
722
|
+
}
|
|
723
|
+
|
|
724
|
+
/**
|
|
725
|
+
* Generates a unique 6-character identifier.
|
|
726
|
+
*
|
|
727
|
+
* @returns A random string identifier
|
|
728
|
+
*/
|
|
729
|
+
function uniqueId() {
|
|
730
|
+
return Math.random().toString(36).slice(6);
|
|
731
|
+
}
|
|
732
|
+
|
|
733
|
+
store1b2fbb72_cjs.createAsyncAtom = createAsyncAtom;
|
|
734
|
+
store1b2fbb72_cjs.createAtom = createAtom;
|
|
735
|
+
store1b2fbb72_cjs.createStore = createStore;
|
|
736
|
+
store1b2fbb72_cjs.createStoreConfig = createStoreConfig;
|
|
737
|
+
store1b2fbb72_cjs.createStoreTransition = createStoreTransition;
|
|
738
|
+
store1b2fbb72_cjs.createStoreWithProducer = createStoreWithProducer;
|
|
739
|
+
return store1b2fbb72_cjs;
|
|
740
|
+
}
|
|
741
|
+
|
|
742
|
+
export { requireStore1b2fbb72_cjs as __require };
|