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