@likec4/diagram 1.47.0 → 1.49.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/LICENSE +1 -1
- package/README.md +8 -10
- package/adhoc-editor/package.json +4 -0
- package/dist/LikeC4Diagram.d.ts +2 -1
- package/dist/LikeC4Diagram.js +85 -81
- package/dist/LikeC4Diagram.props.d.ts +10 -6
- 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 +10 -8
- package/dist/LikeC4Styles.d.ts +3 -6
- package/dist/LikeC4Styles.js +44 -43
- package/dist/LikeC4View.d.ts +22 -1
- package/dist/LikeC4View.js +40 -25
- package/dist/ReactLikeC4.d.ts +13 -2
- package/dist/ReactLikeC4.js +8 -4
- 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 +4 -0
- package/dist/adhoc-editor/LikeC4AdHocViewEditor.js +74 -0
- 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 +14 -0
- package/dist/adhoc-editor/hooks.js +29 -0
- package/dist/adhoc-editor/index.d.ts +2 -0
- package/dist/adhoc-editor/index.js +1 -0
- package/dist/adhoc-editor/state/ActorProvider.d.ts +5 -0
- package/dist/adhoc-editor/state/ActorProvider.js +40 -0
- package/dist/adhoc-editor/state/actor.d.ts +13 -0
- package/dist/adhoc-editor/state/actor.editor.d.ts +56 -0
- package/dist/adhoc-editor/state/actor.editor.js +205 -0
- package/dist/adhoc-editor/state/actor.js +16 -0
- package/dist/adhoc-editor/state/actor.layouter.d.ts +51 -0
- package/dist/adhoc-editor/state/actor.layouter.js +70 -0
- package/dist/adhoc-editor/state/actor.types.d.ts +63 -0
- package/dist/adhoc-editor/state/actor.types.js +29 -0
- 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 +6 -0
- package/dist/base/const.d.ts +2 -0
- package/dist/base/const.js +2 -1
- package/dist/base/updateEdges.js +26 -3
- package/dist/base/updateNodes.js +8 -5
- package/dist/base-primitives/Markdown.d.ts +1 -1
- package/dist/base-primitives/Markdown.js +1 -1
- package/dist/base-primitives/NodeHandles.d.ts +4 -2
- package/dist/base-primitives/NodeHandles.js +46 -19
- package/dist/base-primitives/compound/CompoundActionButton.js +28 -12
- package/dist/base-primitives/compound/CompoundDetailsButton.js +24 -9
- package/dist/base-primitives/compound/CompoundNodeContainer.js +11 -8
- package/dist/base-primitives/compound/CompoundTitle.js +1 -2
- package/dist/base-primitives/compound/actionbtns.css.d.ts +1 -1
- package/dist/base-primitives/edge/EdgeActionButton.js +1 -1
- package/dist/base-primitives/edge/EdgeContainer.js +5 -2
- 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 +17 -20
- package/dist/base-primitives/element/ElementActionButtons.js +57 -59
- package/dist/base-primitives/element/ElementData.d.ts +7 -7
- package/dist/base-primitives/element/ElementData.js +61 -48
- package/dist/base-primitives/element/ElementDetailsButton.js +48 -18
- package/dist/base-primitives/element/ElementNodeContainer.d.ts +5 -5
- package/dist/base-primitives/element/ElementNodeContainer.js +24 -10
- package/dist/base-primitives/element/ElementShape.d.ts +2 -2
- package/dist/base-primitives/element/ElementShape.js +70 -7
- package/dist/base-primitives/element/ElementTags.d.ts +6 -2
- package/dist/base-primitives/element/ElementTags.js +55 -32
- package/dist/base-primitives/index.d.ts +1 -1
- package/dist/base-primitives/memoEdge.js +1 -1
- package/dist/base-primitives/memoNode.js +1 -1
- package/dist/components/ErrorFallback.js +1 -1
- package/dist/components/Link.js +3 -3
- package/dist/components/NavigationPanel.d.ts +2 -2
- package/dist/components/NavigationPanel.js +5 -26
- package/dist/components/PortalToContainer.js +3 -4
- package/dist/components/RootContainer.js +9 -19
- 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 +2 -0
- package/dist/context/DefaultMantineProvider.js +75 -0
- 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 +16 -13
- package/dist/context/EnsureMantine.d.ts +0 -3
- package/dist/context/EnsureMantine.js +3 -4
- package/dist/context/FramerMotionConfig.d.ts +1 -3
- package/dist/context/IconRenderer.d.ts +19 -4
- package/dist/context/IconRenderer.js +52 -25
- 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 +13 -5
- package/dist/custom/hooks.d.ts +2 -2
- package/dist/custom/index.d.ts +1 -1
- package/dist/custom/index.js +16 -15
- package/dist/editor/LikeC4EditorCallbacks.d.ts +18 -0
- package/dist/editor/LikeC4EditorCallbacks.js +5 -0
- package/dist/editor/LikeC4EditorProvider.d.ts +30 -18
- package/dist/editor/LikeC4EditorProvider.js +3 -3
- package/dist/editor/applyChangesToManualLayout.js +7 -6
- package/dist/editor/editorActor.actions.d.ts +25 -25
- package/dist/editor/editorActor.actions.js +22 -22
- package/dist/editor/editorActor.setup.d.ts +84 -0
- package/dist/editor/editorActor.setup.js +38 -0
- package/dist/editor/editorActor.states.d.ts +9 -0
- package/dist/editor/{editorActor.js → editorActor.states.js} +21 -72
- package/dist/editor/index.d.ts +4 -3
- package/dist/editor/useEditorActorLogic.d.ts +2 -565
- package/dist/editor/useEditorActorLogic.js +14 -21
- package/dist/hooks/index.d.ts +3 -3
- package/dist/hooks/safeContext.d.ts +4 -5
- package/dist/hooks/useCallbackRef.d.ts +6 -0
- package/dist/hooks/useCallbackRef.js +7 -6
- package/dist/hooks/useCurrentView.js +5 -10
- package/dist/hooks/useCurrentViewModel.d.ts +8 -2
- package/dist/hooks/useCurrentViewModel.js +3 -7
- package/dist/hooks/useDiagram.d.ts +9 -1
- package/dist/hooks/useDiagram.js +10 -4
- package/dist/hooks/useDiagramCompareLayout.d.ts +6 -6
- package/dist/hooks/useDiagramCompareLayout.js +1 -1
- package/dist/hooks/useLikeC4ElementsTree.d.ts +1 -1
- package/dist/hooks/useLikeC4ElementsTree.js +2 -2
- 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/hooks/useSetState.d.ts +6 -1
- package/dist/hooks/useSetState.js +7 -4
- package/dist/hooks/useXYFlow.d.ts +7 -1
- package/dist/hooks/useXYFlow.js +4 -4
- package/dist/index.d.ts +5 -4
- package/dist/index.js +3 -1
- package/dist/likec4diagram/DiagramUI.js +1 -3
- package/dist/likec4diagram/DiagramXYFlow.d.ts +2 -1
- package/dist/likec4diagram/DiagramXYFlow.js +29 -18
- package/dist/likec4diagram/convert-to-xyflow.d.ts +2 -1
- package/dist/likec4diagram/convert-to-xyflow.js +2 -6
- package/dist/likec4diagram/custom/edges/RelationshipEdge.js +34 -37
- package/dist/likec4diagram/custom/edges/edges.css.js +2 -1
- package/dist/likec4diagram/custom/edges/useControlPoints.js +3 -3
- package/dist/likec4diagram/custom/edges/useRelationshipEdgePath.d.ts +3 -0
- package/dist/likec4diagram/custom/edges/useRelationshipEdgePath.js +52 -34
- package/dist/likec4diagram/custom/nodes/ElementActions.d.ts +1 -2
- package/dist/likec4diagram/custom/nodes/ElementActions.js +7 -10
- 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 +10 -6
- package/dist/likec4diagram/custom/nodes/nodes.js +30 -8
- package/dist/likec4diagram/custom/nodes/toolbar/ColorButton.js +5 -4
- package/dist/likec4diagram/custom/nodes/toolbar/ElementToolbar.d.ts +6 -1
- package/dist/likec4diagram/custom/nodes/toolbar/ElementToolbar.js +14 -9
- package/dist/likec4diagram/custom/nodes/toolbar/_shared.js +4 -4
- package/dist/likec4diagram/custom/nodes/toolbar/styles.css.js +3 -3
- package/dist/likec4diagram/relationship-popover/RelationshipPopover.js +16 -36
- package/dist/likec4diagram/relationship-popover/components.d.ts +7 -0
- package/dist/likec4diagram/relationship-popover/components.js +39 -0
- package/dist/likec4diagram/state/DiagramActorProvider.d.ts +4 -3
- package/dist/likec4diagram/state/DiagramActorProvider.js +39 -66
- package/dist/likec4diagram/state/assign.d.ts +1 -1
- package/dist/likec4diagram/state/createViewChange.js +16 -4
- 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 +92 -0
- package/dist/likec4diagram/state/machine.actions.js +127 -58
- package/dist/likec4diagram/state/machine.actions.layout.d.ts +23 -2
- package/dist/likec4diagram/state/machine.actions.layout.js +68 -15
- package/dist/likec4diagram/state/machine.d.ts +1 -1
- package/dist/likec4diagram/state/machine.js +35 -31
- package/dist/likec4diagram/state/machine.setup.d.ts +40 -7
- package/dist/likec4diagram/state/machine.setup.js +13 -4
- package/dist/likec4diagram/state/machine.state.initializing.d.ts +32 -2
- package/dist/likec4diagram/state/machine.state.navigating.d.ts +1 -1
- package/dist/likec4diagram/state/machine.state.navigating.js +82 -50
- package/dist/likec4diagram/state/machine.state.ready.d.ts +565 -579
- package/dist/likec4diagram/state/machine.state.ready.focused.d.ts +17 -148
- package/dist/likec4diagram/state/machine.state.ready.focused.js +6 -14
- package/dist/likec4diagram/state/machine.state.ready.idle.d.ts +11 -96
- package/dist/likec4diagram/state/machine.state.ready.idle.js +7 -12
- package/dist/likec4diagram/state/machine.state.ready.js +89 -70
- package/dist/likec4diagram/state/machine.state.ready.printing.d.ts +4 -0
- package/dist/likec4diagram/state/machine.state.ready.printing.js +4 -3
- package/dist/likec4diagram/state/machine.state.ready.walkthrough.d.ts +145 -2
- package/dist/likec4diagram/state/machine.state.ready.walkthrough.js +29 -21
- package/dist/likec4diagram/state/types.d.ts +1 -1
- package/dist/likec4diagram/state/utils.d.ts +14 -14
- package/dist/likec4diagram/state/utils.js +12 -4
- package/dist/likec4diagram/types.d.ts +11 -3
- package/dist/likec4diagram/ui/notation/NotationPanel.css.js +2 -2
- package/dist/likec4diagram/ui/notation/NotationPanel.js +3 -3
- package/dist/likec4diagram/useLayoutConstraints.d.ts +12 -12
- package/dist/likec4diagram/useLayoutConstraints.js +126 -84
- package/dist/likec4diagram/xyflow-diagram/diagram-view.d.ts +11 -3
- package/dist/likec4diagram/xyflow-diagram/diagram-view.js +7 -3
- package/dist/likec4diagram/xyflow-sequence/sequence-layout.d.ts +7 -3
- package/dist/likec4diagram/xyflow-sequence/sequence-layout.js +15 -8
- package/dist/navigationpanel/NavigationPanel.js +4 -3
- package/dist/navigationpanel/NavigationPanelControls.js +4 -2
- package/dist/navigationpanel/NavigationPanelDropdown.js +13 -13
- package/dist/navigationpanel/_common.d.ts +1 -1
- package/dist/navigationpanel/_common.js +2 -3
- 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/comparepanel/LayoutTypeSwitcher.js +4 -5
- package/dist/navigationpanel/controls/DetailsControls.js +7 -7
- package/dist/navigationpanel/controls/LayoutWarning.js +2 -2
- 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.d.ts +1 -2
- package/dist/navigationpanel/controls/SearchControl.js +8 -12
- package/dist/navigationpanel/controls/ToggleReadonly.js +5 -6
- package/dist/navigationpanel/dropdown/ProjectsMenu.js +12 -6
- 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/editorpanel/styles.js +4 -4
- package/dist/navigationpanel/styles.css.d.ts +1 -1
- package/dist/navigationpanel/styles.css.js +1 -1
- package/dist/navigationpanel/walkthrough/ActiveWalkthroughControls.js +6 -6
- package/dist/navigationpanel/walkthrough/DynamicViewControls.d.ts +77 -77
- package/dist/navigationpanel/walkthrough/DynamicViewControls.js +1 -1
- package/dist/navigationpanel/walkthrough/WalkthroughPanel.js +2 -2
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @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.3 → @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.3 → @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.3 → @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.3 → @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.3 → @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.3 → @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.3 → @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.3 → @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.3 → @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.3 → @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.3 → @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.3 → @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.3 → @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.3 → @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.3 → @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.3 → @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.3 → @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.3 → @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.3 → @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.3 → @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.3 → @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.3 → @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.3 → @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.3 → @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.3 → @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.3 → @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.3 → @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.3 → @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.3 → @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.3 → @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.3 → @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.3 → @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.3 → @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.3 → @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.3 → @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.3 → @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.3 → @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.3 → @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.3 → @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.3 → @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.3 → @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.3 → @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.3 → @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.3 → @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.1_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconTrash.js +14 -0
- package/dist/node_modules/.pnpm/{@tabler_icons-react@3.36.0_react@19.2.3 → @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.3 → @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.3 → @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 +15 -15
- package/dist/overlays/element-details/ElementDetailsCard.js +39 -40
- package/dist/overlays/element-details/MetadataValue.js +11 -12
- package/dist/overlays/element-details/TabPanelDeployments.js +8 -6
- package/dist/overlays/element-details/TabPanelRelationships.css.js +10 -30
- 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 +3 -2
- package/dist/overlays/overlaysActor.js +19 -1
- package/dist/overlays/relationship-details/RelationshipDetails.d.ts +0 -5
- package/dist/overlays/relationship-details/RelationshipDetails.js +4 -4
- package/dist/overlays/relationship-details/SelectEdge.css.js +6 -6
- package/dist/overlays/relationship-details/SelectEdge.js +2 -2
- package/dist/overlays/relationship-details/compute.js +1 -1
- package/dist/overlays/relationship-details/custom/ElementActions.js +3 -3
- package/dist/overlays/relationship-details/custom/nodeTypes.js +14 -1
- package/dist/overlays/relationship-details/layout.js +1 -1
- package/dist/overlays/relationships-browser/RelationshipsBrowser.d.ts +0 -5
- package/dist/overlays/relationships-browser/RelationshipsBrowser.js +116 -21
- 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 +21 -6
- package/dist/overlays/relationships-browser/custom/nodeTypes.js +14 -1
- package/dist/overlays/relationships-browser/layout.d.ts +1 -1
- package/dist/overlays/relationships-browser/layout.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/actor.js +8 -31
- 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/projects-overview/panel/ProjectsOverviewPanel.js +1 -1
- package/dist/search/Search.d.ts +2 -4
- package/dist/search/Search.js +67 -44
- package/dist/search/components/ElementsColumn.css.js +6 -6
- package/dist/search/components/ElementsColumn.js +93 -60
- package/dist/search/components/PickView.d.ts +3 -1
- package/dist/search/components/PickView.js +12 -7
- 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.d.ts +1 -1
- package/dist/search/components/_shared.css.js +12 -12
- package/dist/search/components/utils.js +1 -4
- package/dist/search/hooks.d.ts +1 -6
- package/dist/search/hooks.js +15 -9
- 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 +25 -22
- package/dist/shadowroot/styles.css.d.ts +0 -2
- package/dist/shadowroot/styles.css.js +4 -36
- package/dist/styles-font.css2.js +1 -1
- package/dist/styles.css2.js +1 -1
- package/dist/utils/view-bounds.d.ts +3 -2
- package/dist/utils/view-bounds.js +10 -6
- package/dist/utils/xyflow.d.ts +27 -6
- package/dist/utils/xyflow.js +68 -23
- package/package.json +39 -37
- package/panda.buildinfo.json +226 -161
- package/styles-font.css +1 -1
- package/styles-min.css +1 -1
- package/styles.css +1 -1
- package/bundle/index.js +0 -51974
- package/bundle/package.json +0 -4
- package/dist/editor/__tests__/fixture.d.ts +0 -205
- package/dist/editor/editorActor.d.ts +0 -653
- package/dist/likec4diagram/relationship-popover/styles.css.d.ts +0 -2
- package/dist/likec4diagram/relationship-popover/styles.css.js +0 -28
- package/dist/node_modules/.pnpm/@tabler_icons-react@3.36.0_react@19.2.3/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.3/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.3/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.3/node_modules/@tabler/icons-react/dist/esm/icons/IconRouteOff.js +0 -14
- package/dist/overlays/relationships-browser/custom/styles.css.d.ts +0 -1
- package/dist/overlays/relationships-browser/custom/styles.css.js +0 -14
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { FocusTrap, Group, Title, ActionIcon, ScrollAreaAutosize, Stack } from '@mantine/core';
|
|
3
|
-
import { useWindowEvent } from '@mantine/hooks';
|
|
3
|
+
import { useWindowEvent, useCallbackRef } from '@mantine/hooks';
|
|
4
4
|
import * as m from 'motion/react-m';
|
|
5
|
+
import { useCurrentViewId } from '../../hooks/useCurrentView.js';
|
|
5
6
|
import { useLikeC4Model } from '../../hooks/useLikeC4Model.js';
|
|
6
|
-
import { useSearchActor } from '../hooks.js';
|
|
7
7
|
import { pickviewBackdrop, pickview, pickviewGroup } from './styles.css.js';
|
|
8
8
|
import { ViewButton } from './ViewsColum.js';
|
|
9
|
-
import IconX from '../../node_modules/.pnpm/@tabler_icons-react@3.36.
|
|
9
|
+
import IconX from '../../node_modules/.pnpm/@tabler_icons-react@3.36.1_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconX.js';
|
|
10
10
|
|
|
11
|
-
function PickView({
|
|
12
|
-
|
|
11
|
+
function PickView({
|
|
12
|
+
searchActorRef,
|
|
13
|
+
elementFqn
|
|
14
|
+
}) {
|
|
15
|
+
const currentViewId = useCurrentViewId();
|
|
13
16
|
const element = useLikeC4Model().element(elementFqn);
|
|
14
17
|
const scoped = [];
|
|
15
18
|
const others = [];
|
|
@@ -25,7 +28,7 @@ function PickView({ elementFqn }) {
|
|
|
25
28
|
};
|
|
26
29
|
useWindowEvent(
|
|
27
30
|
"keydown",
|
|
28
|
-
(event) => {
|
|
31
|
+
useCallbackRef((event) => {
|
|
29
32
|
try {
|
|
30
33
|
if (event.key === "Escape") {
|
|
31
34
|
event.stopPropagation();
|
|
@@ -35,7 +38,7 @@ function PickView({ elementFqn }) {
|
|
|
35
38
|
} catch (e) {
|
|
36
39
|
console.warn(e);
|
|
37
40
|
}
|
|
38
|
-
},
|
|
41
|
+
}),
|
|
39
42
|
{
|
|
40
43
|
capture: true
|
|
41
44
|
}
|
|
@@ -100,6 +103,7 @@ function PickView({ elementFqn }) {
|
|
|
100
103
|
ViewButton,
|
|
101
104
|
{
|
|
102
105
|
view,
|
|
106
|
+
currentViewId,
|
|
103
107
|
search: "",
|
|
104
108
|
loop: true,
|
|
105
109
|
focusOnElement: elementFqn,
|
|
@@ -116,6 +120,7 @@ function PickView({ elementFqn }) {
|
|
|
116
120
|
ViewButton,
|
|
117
121
|
{
|
|
118
122
|
view,
|
|
123
|
+
currentViewId,
|
|
119
124
|
search: "",
|
|
120
125
|
loop: true,
|
|
121
126
|
focusOnElement: elementFqn,
|
|
@@ -7,7 +7,7 @@ import { useLikeC4Model } from '../../hooks/useLikeC4Model.js';
|
|
|
7
7
|
import { useUpdateSearch, useNormalizedSearch } from '../hooks.js';
|
|
8
8
|
import { focusToFirstFoundElement, moveFocusToSearchInput } from './utils.js';
|
|
9
9
|
import { ElementTag } from '../../base-primitives/element/ElementTags.js';
|
|
10
|
-
import IconX from '../../node_modules/.pnpm/@tabler_icons-react@3.36.
|
|
10
|
+
import IconX from '../../node_modules/.pnpm/@tabler_icons-react@3.36.1_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconX.js';
|
|
11
11
|
|
|
12
12
|
function SearchByTags() {
|
|
13
13
|
const ref = useRef(null);
|
|
@@ -7,7 +7,7 @@ import { useLikeC4Model } from '../../hooks/useLikeC4Model.js';
|
|
|
7
7
|
import { useSearchActor, useSearch } from '../hooks.js';
|
|
8
8
|
import { input } from './styles.css.js';
|
|
9
9
|
import { moveFocusToSearchInput, stopAndPrevent, focusToFirstFoundElement } from './utils.js';
|
|
10
|
-
import IconSearch from '../../node_modules/.pnpm/@tabler_icons-react@3.36.
|
|
10
|
+
import IconSearch from '../../node_modules/.pnpm/@tabler_icons-react@3.36.1_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconSearch.js';
|
|
11
11
|
|
|
12
12
|
function startingWithKind(search) {
|
|
13
13
|
return search.match(/^(k|ki|kin|kind|kind:)$/) != null;
|
|
@@ -56,7 +56,7 @@ const LikeC4SearchInput = memo(() => {
|
|
|
56
56
|
/* @__PURE__ */ jsx(ComboboxEmpty, { children: "No tags found" }, "empty-tags")
|
|
57
57
|
];
|
|
58
58
|
} else {
|
|
59
|
-
isExactMatch =
|
|
59
|
+
isExactMatch = alloptions.some((tag) => tag.toLocaleLowerCase() === searchTag);
|
|
60
60
|
options = alloptions.map((tag) => /* @__PURE__ */ jsxs(ComboboxOption, { value: `#${tag}`, children: [
|
|
61
61
|
/* @__PURE__ */ jsx(Text, { component: "span", opacity: 0.5, mr: 1, fz: "sm", children: "#" }),
|
|
62
62
|
tag
|
|
@@ -4,8 +4,9 @@ import { ElementProps, UnstyledButtonProps } from '@mantine/core';
|
|
|
4
4
|
import { MemoExoticComponent } from 'react';
|
|
5
5
|
export declare const NothingFound: () => import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
export declare const ViewsColumn: MemoExoticComponent<() => import("react/jsx-runtime").JSX.Element>;
|
|
7
|
-
export declare function ViewButton({ className, view, loop, search, focusOnElement, ...props }: {
|
|
7
|
+
export declare function ViewButton({ className, view, loop, search, focusOnElement, currentViewId, ...props }: {
|
|
8
8
|
view: LikeC4Model.View;
|
|
9
|
+
currentViewId: string;
|
|
9
10
|
search: string;
|
|
10
11
|
loop?: boolean;
|
|
11
12
|
focusOnElement?: Fqn;
|
|
@@ -1,39 +1,47 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { preferSummary } from '@likec4/core/types';
|
|
2
3
|
import { cx } from '@likec4/styles/css';
|
|
3
4
|
import { Box } from '@likec4/styles/jsx';
|
|
4
|
-
import { Stack, VisuallyHidden, UnstyledButton,
|
|
5
|
+
import { Stack, VisuallyHidden, UnstyledButton, ThemeIcon, Group, Highlight, Badge, createScopedKeydownHandler } from '@mantine/core';
|
|
5
6
|
import * as m from 'motion/react-m';
|
|
6
|
-
import { memo, useRef } from 'react';
|
|
7
|
+
import { memo, useRef, useMemo } from 'react';
|
|
7
8
|
import { first } from 'remeda';
|
|
8
9
|
import { useCurrentViewId } from '../../hooks/useCurrentView.js';
|
|
9
|
-
import '@xstate/react';
|
|
10
|
-
import 'fast-equals';
|
|
11
|
-
import { useDiagram } from '../../hooks/safeContext.js';
|
|
12
10
|
import { useLikeC4Model } from '../../hooks/useLikeC4Model.js';
|
|
13
11
|
import { useNormalizedSearch, useSearchActor } from '../hooks.js';
|
|
14
|
-
import { emptyBoX,
|
|
15
|
-
import { moveFocusToSearchInput, queryAllFocusable, centerY
|
|
12
|
+
import { emptyBoX, focusable, buttonsva } from './_shared.css.js';
|
|
13
|
+
import { moveFocusToSearchInput, queryAllFocusable, centerY } from './utils.js';
|
|
16
14
|
import { viewButton } from './ViewsColumn.css.js';
|
|
17
|
-
import IconStack2 from '../../node_modules/.pnpm/@tabler_icons-react@3.36.
|
|
18
|
-
import IconZoomScan from '../../node_modules/.pnpm/@tabler_icons-react@3.36.
|
|
15
|
+
import IconStack2 from '../../node_modules/.pnpm/@tabler_icons-react@3.36.1_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconStack2.js';
|
|
16
|
+
import IconZoomScan from '../../node_modules/.pnpm/@tabler_icons-react@3.36.1_react@19.2.4/node_modules/@tabler/icons-react/dist/esm/icons/IconZoomScan.js';
|
|
19
17
|
|
|
20
18
|
const NothingFound = () => /* @__PURE__ */ jsx(Box, { className: emptyBoX, children: "Nothing found" });
|
|
19
|
+
const useFoundViews = () => {
|
|
20
|
+
const currentViewId = useCurrentViewId();
|
|
21
|
+
const likec4model = useLikeC4Model();
|
|
22
|
+
const search = useNormalizedSearch();
|
|
23
|
+
return useMemo(() => {
|
|
24
|
+
let views = [...likec4model.views()];
|
|
25
|
+
if (search) {
|
|
26
|
+
if (search.startsWith("kind:")) {
|
|
27
|
+
views = [];
|
|
28
|
+
} else {
|
|
29
|
+
const searchTag = search.startsWith("#") ? search.slice(1) : null;
|
|
30
|
+
views = views.filter((view) => {
|
|
31
|
+
if (searchTag) {
|
|
32
|
+
return view.tags.some((tag) => tag.toLocaleLowerCase().includes(searchTag));
|
|
33
|
+
}
|
|
34
|
+
const desc = preferSummary(view.$view)?.md || " ";
|
|
35
|
+
return `${view.id} ${view.title} ${desc}`.toLocaleLowerCase().includes(search);
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return [views, search, currentViewId];
|
|
40
|
+
}, [likec4model, search, currentViewId]);
|
|
41
|
+
};
|
|
21
42
|
const ViewsColumn = memo(() => {
|
|
22
43
|
const ref = useRef(null);
|
|
23
|
-
|
|
24
|
-
let search = useNormalizedSearch();
|
|
25
|
-
if (search) {
|
|
26
|
-
if (search.startsWith("kind:")) {
|
|
27
|
-
views = [];
|
|
28
|
-
} else {
|
|
29
|
-
views = views.filter((view) => {
|
|
30
|
-
if (search.startsWith("#")) {
|
|
31
|
-
return view.tags.some((tag) => tag.toLocaleLowerCase().includes(search.slice(1)));
|
|
32
|
-
}
|
|
33
|
-
return `${view.id} ${view.title} ${view.description.text}`.toLocaleLowerCase().includes(search);
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
}
|
|
44
|
+
const [views, search, currentViewId] = useFoundViews();
|
|
37
45
|
return /* @__PURE__ */ jsxs(
|
|
38
46
|
Stack,
|
|
39
47
|
{
|
|
@@ -71,6 +79,7 @@ const ViewsColumn = memo(() => {
|
|
|
71
79
|
ViewButton,
|
|
72
80
|
{
|
|
73
81
|
view,
|
|
82
|
+
currentViewId,
|
|
74
83
|
search,
|
|
75
84
|
tabIndex: i === 0 ? 0 : -1
|
|
76
85
|
}
|
|
@@ -80,20 +89,15 @@ const ViewsColumn = memo(() => {
|
|
|
80
89
|
);
|
|
81
90
|
});
|
|
82
91
|
const btn = buttonsva();
|
|
83
|
-
function ViewButton({ className, view, loop = false, search, focusOnElement, ...props }) {
|
|
92
|
+
function ViewButton({ className, view, loop = false, search, focusOnElement, currentViewId, ...props }) {
|
|
84
93
|
const searchActorRef = useSearchActor();
|
|
85
|
-
const diagram = useDiagram();
|
|
86
94
|
const nextViewId = view.id;
|
|
87
|
-
const currentViewId = useCurrentViewId();
|
|
88
95
|
const isCurrentView = nextViewId === currentViewId;
|
|
89
96
|
const navigate = () => {
|
|
90
|
-
searchActorRef.send({
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
return;
|
|
95
|
-
}
|
|
96
|
-
diagram.navigateTo(nextViewId, void 0, focusOnElement);
|
|
97
|
+
searchActorRef.send({
|
|
98
|
+
type: "navigate.to",
|
|
99
|
+
viewId: nextViewId,
|
|
100
|
+
focusOnElement
|
|
97
101
|
});
|
|
98
102
|
};
|
|
99
103
|
return /* @__PURE__ */ jsxs(
|
|
@@ -124,7 +128,7 @@ function ViewButton({ className, view, loop = false, search, focusOnElement, ...
|
|
|
124
128
|
/* @__PURE__ */ jsx(ThemeIcon, { variant: "transparent", className: btn.icon, children: view.isDeploymentView() ? /* @__PURE__ */ jsx(IconStack2, { stroke: 1.8 }) : /* @__PURE__ */ jsx(IconZoomScan, { stroke: 1.8 }) }),
|
|
125
129
|
/* @__PURE__ */ jsxs(Box, { style: { flexGrow: 1 }, children: [
|
|
126
130
|
/* @__PURE__ */ jsxs(Group, { gap: "xs", wrap: "nowrap", align: "center", children: [
|
|
127
|
-
/* @__PURE__ */ jsx(Highlight, { component: "div", highlight: search, className: btn.title, children: view.
|
|
131
|
+
/* @__PURE__ */ jsx(Highlight, { component: "div", highlight: search, className: btn.title, children: view.titleOrUntitled }),
|
|
128
132
|
isCurrentView && /* @__PURE__ */ jsx(Badge, { size: "xs", fz: 9, radius: "sm", children: "current" })
|
|
129
133
|
] }),
|
|
130
134
|
/* @__PURE__ */ jsx(
|
|
@@ -18,7 +18,7 @@ const viewButton = cx(
|
|
|
18
18
|
css({
|
|
19
19
|
marginTop: "1",
|
|
20
20
|
// transition: transitions.fast,
|
|
21
|
-
// color: `[var(${descriptionColor}, {colors.
|
|
21
|
+
// color: `[var(${descriptionColor}, {colors.text.dimmed})]`,
|
|
22
22
|
fontSize: "13px",
|
|
23
23
|
lineHeight: "1.4",
|
|
24
24
|
[`:where(.likec4-view-btn[data-disabled]) &`]: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SlotRecipeRuntimeFn, SlotRecipeVariantRecord } from '
|
|
1
|
+
import { SlotRecipeRuntimeFn, SlotRecipeVariantRecord } from '@likec4/styles';
|
|
2
2
|
export declare const focusable = "likec4-focusable";
|
|
3
3
|
export declare const emptyBoX: string;
|
|
4
4
|
export declare const buttonsva: SlotRecipeRuntimeFn<"title" | "description" | "icon" | "root" | "descriptionColor", SlotRecipeVariantRecord<"title" | "description" | "icon" | "root" | "descriptionColor">>;
|
|
@@ -9,7 +9,7 @@ const _treenodefocus = ".mantine-Tree-node:focus > .mantine-Tree-label &";
|
|
|
9
9
|
const button = css.raw({
|
|
10
10
|
display: "flex",
|
|
11
11
|
width: "100%",
|
|
12
|
-
background: "
|
|
12
|
+
background: "body",
|
|
13
13
|
rounded: "sm",
|
|
14
14
|
padding: `[12px 8px 12px 14px]`,
|
|
15
15
|
minHeight: "60px",
|
|
@@ -17,10 +17,10 @@ const button = css.raw({
|
|
|
17
17
|
// alignItems: 'flex-start',
|
|
18
18
|
// transition: `all 50ms ${easings.inOut}`,
|
|
19
19
|
border: `1px solid`,
|
|
20
|
-
borderColor: "
|
|
20
|
+
borderColor: "default.border",
|
|
21
21
|
// [titleColor]: '{colors.mantine.colors.dark[1]}',
|
|
22
|
-
// [iconColor]: '{colors.
|
|
23
|
-
// [descriptionColor]: '{colors.
|
|
22
|
+
// [iconColor]: '{colors.text.dimmed}',
|
|
23
|
+
// [descriptionColor]: '{colors.text.dimmed}',
|
|
24
24
|
_hover: {
|
|
25
25
|
...buttonFocused,
|
|
26
26
|
borderColor: "mantine.colors.primary[9]",
|
|
@@ -52,7 +52,7 @@ const iconSize = {
|
|
|
52
52
|
};
|
|
53
53
|
const icon = css.raw({
|
|
54
54
|
color: {
|
|
55
|
-
base: "
|
|
55
|
+
base: "text.dimmed",
|
|
56
56
|
_light: "mantine.colors.gray[5]",
|
|
57
57
|
_groupHover: "mantine.colors.primary[0]",
|
|
58
58
|
_groupFocus: "mantine.colors.primary[0]"
|
|
@@ -88,7 +88,7 @@ const icon = css.raw({
|
|
|
88
88
|
});
|
|
89
89
|
const title = css.raw({
|
|
90
90
|
fontSize: "16px",
|
|
91
|
-
fontWeight:
|
|
91
|
+
fontWeight: "medium",
|
|
92
92
|
lineHeight: "1.1",
|
|
93
93
|
[`:where([data-disabled]) &`]: {
|
|
94
94
|
opacity: 0.4
|
|
@@ -98,23 +98,23 @@ const title = css.raw({
|
|
|
98
98
|
_light: "mantine.colors.gray[7]",
|
|
99
99
|
_groupHover: {
|
|
100
100
|
base: "mantine.colors.primary[1]",
|
|
101
|
-
_light: "
|
|
101
|
+
_light: "white"
|
|
102
102
|
},
|
|
103
103
|
_groupFocus: {
|
|
104
104
|
base: "mantine.colors.primary[1]",
|
|
105
|
-
_light: "
|
|
105
|
+
_light: "white"
|
|
106
106
|
}
|
|
107
107
|
},
|
|
108
108
|
[_treenodefocus]: {
|
|
109
109
|
color: {
|
|
110
110
|
base: "mantine.colors.primary[1]",
|
|
111
|
-
_light: "
|
|
111
|
+
_light: "white"
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
114
|
});
|
|
115
115
|
const descriptionColor = css.raw({
|
|
116
116
|
color: {
|
|
117
|
-
base: "
|
|
117
|
+
base: "text.dimmed",
|
|
118
118
|
_groupHover: {
|
|
119
119
|
base: "mantine.colors.primary[1]",
|
|
120
120
|
_light: "mantine.colors.primary[0]"
|
|
@@ -137,13 +137,13 @@ const emptyBoX = css({
|
|
|
137
137
|
width: "100%",
|
|
138
138
|
height: "100%",
|
|
139
139
|
border: `2px dashed`,
|
|
140
|
-
borderColor: "
|
|
140
|
+
borderColor: "default.border",
|
|
141
141
|
rounded: "md",
|
|
142
142
|
display: "flex",
|
|
143
143
|
justifyContent: "center",
|
|
144
144
|
alignItems: "center",
|
|
145
145
|
fontSize: "md",
|
|
146
|
-
color: "
|
|
146
|
+
color: "text.dimmed",
|
|
147
147
|
padding: "md",
|
|
148
148
|
paddingBlock: "xl"
|
|
149
149
|
});
|
|
@@ -54,8 +54,5 @@ function queryAllFocusable(from, where, selector = `.${focusable}`) {
|
|
|
54
54
|
const elements = root.querySelectorAll(`[data-likec4-search-${where}] ${selector}`);
|
|
55
55
|
return [...elements];
|
|
56
56
|
}
|
|
57
|
-
function whenSearchAnimationEnds(callback) {
|
|
58
|
-
setTimeout(callback, 300);
|
|
59
|
-
}
|
|
60
57
|
|
|
61
|
-
export { centerY, focusToFirstFoundElement, moveFocusToSearchInput, queryAllFocusable, stopAndPrevent
|
|
58
|
+
export { centerY, focusToFirstFoundElement, moveFocusToSearchInput, queryAllFocusable, stopAndPrevent };
|
package/dist/search/hooks.d.ts
CHANGED
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
import { SearchActorRef } from './searchActor';
|
|
2
|
-
|
|
3
|
-
export declare const SearchActorContext: ({ children, value }: {
|
|
4
|
-
value: SearchActorRef;
|
|
5
|
-
children: React.ReactNode;
|
|
6
|
-
}) => import("react/jsx-runtime").JSX.Element, useSearchActor: () => SearchActorRef;
|
|
2
|
+
export declare function useSearchActor(): SearchActorRef;
|
|
7
3
|
export declare function useSearch(): [string, (search: string) => void];
|
|
8
4
|
export declare function useNormalizedSearch(): string;
|
|
9
5
|
export declare function useUpdateSearch(): (search: string) => void;
|
|
10
|
-
export declare function usePickViewFor(): Fqn | null;
|
package/dist/search/hooks.js
CHANGED
|
@@ -1,8 +1,14 @@
|
|
|
1
|
-
import { createSafeContext } from '@mantine/core';
|
|
2
1
|
import { useSelector } from '@xstate/react';
|
|
3
2
|
import { useCallback, useDeferredValue } from 'react';
|
|
3
|
+
import { useSearchActorRef } from '../hooks/useSearchActor.js';
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
function useSearchActor() {
|
|
6
|
+
const searchActorRef = useSearchActorRef();
|
|
7
|
+
if (!searchActorRef) {
|
|
8
|
+
throw new Error("Search actor not found");
|
|
9
|
+
}
|
|
10
|
+
return searchActorRef;
|
|
11
|
+
}
|
|
6
12
|
const selectSearchValue = (s) => s.context.searchValue;
|
|
7
13
|
function useSearch() {
|
|
8
14
|
const searchActorRef = useSearchActor();
|
|
@@ -13,7 +19,12 @@ function useSearch() {
|
|
|
13
19
|
return [searchValue, updateSearch];
|
|
14
20
|
}
|
|
15
21
|
const selectNormalizedSearchValue = (s) => {
|
|
16
|
-
|
|
22
|
+
let v = selectSearchValue(s);
|
|
23
|
+
if (v === "") return v;
|
|
24
|
+
v = v.trim().toLowerCase();
|
|
25
|
+
if (v.startsWith("#") && v.length <= 2) {
|
|
26
|
+
return "";
|
|
27
|
+
}
|
|
17
28
|
return v.length > 1 ? v : "";
|
|
18
29
|
};
|
|
19
30
|
function useNormalizedSearch() {
|
|
@@ -26,10 +37,5 @@ function useUpdateSearch() {
|
|
|
26
37
|
searchActorRef.send({ type: "change.search", search });
|
|
27
38
|
}, [searchActorRef]);
|
|
28
39
|
}
|
|
29
|
-
const selectPickViewFor = (s) => s.context.pickViewFor;
|
|
30
|
-
function usePickViewFor() {
|
|
31
|
-
const searchActorRef = useSearchActor();
|
|
32
|
-
return useSelector(searchActorRef, selectPickViewFor);
|
|
33
|
-
}
|
|
34
40
|
|
|
35
|
-
export {
|
|
41
|
+
export { useNormalizedSearch, useSearch, useSearchActor, useUpdateSearch };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Fqn } from '@likec4/core/types';
|
|
1
|
+
import { Fqn, ViewId } from '@likec4/core/types';
|
|
2
2
|
import { ActorRef, SnapshotFrom, StateMachine } from 'xstate';
|
|
3
3
|
export type SearchActorEvent = {
|
|
4
4
|
type: 'open';
|
|
@@ -11,6 +11,12 @@ export type SearchActorEvent = {
|
|
|
11
11
|
} | {
|
|
12
12
|
type: 'pickview.open';
|
|
13
13
|
elementFqn: Fqn;
|
|
14
|
+
} | {
|
|
15
|
+
type: 'navigate.to';
|
|
16
|
+
viewId: ViewId;
|
|
17
|
+
focusOnElement?: Fqn | undefined;
|
|
18
|
+
} | {
|
|
19
|
+
type: 'animation.presence.end';
|
|
14
20
|
} | {
|
|
15
21
|
type: 'pickview.close';
|
|
16
22
|
};
|
|
@@ -18,8 +24,12 @@ export interface SearchContext {
|
|
|
18
24
|
openedWithSearch: string | null;
|
|
19
25
|
searchValue: string;
|
|
20
26
|
pickViewFor: Fqn | null;
|
|
27
|
+
navigateTo: {
|
|
28
|
+
viewId: ViewId;
|
|
29
|
+
focusOnElement?: Fqn | undefined;
|
|
30
|
+
} | null;
|
|
21
31
|
}
|
|
22
|
-
export interface SearchActorLogic extends StateMachine<SearchContext, SearchActorEvent, {}, any, any, any, any,
|
|
32
|
+
export interface SearchActorLogic extends StateMachine<SearchContext, SearchActorEvent, {}, any, any, any, any, 'inactive' | 'opened' | 'pickView' | 'waitAnimationEnd', never, never, any, any, any, any> {
|
|
23
33
|
}
|
|
24
34
|
export declare const searchActorLogic: SearchActorLogic;
|
|
25
35
|
export type SearchActorSnapshot = SnapshotFrom<SearchActorLogic>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { setup, assign, assertEvent } from 'xstate';
|
|
1
|
+
import { setup, assign, assertEvent, enqueueActions } from 'xstate';
|
|
2
|
+
import { typedSystem } from '../likec4diagram/state/utils.js';
|
|
2
3
|
|
|
3
4
|
const _searchActorLogic = setup({
|
|
4
5
|
types: {
|
|
@@ -6,6 +7,18 @@ const _searchActorLogic = setup({
|
|
|
6
7
|
events: {}
|
|
7
8
|
},
|
|
8
9
|
actions: {
|
|
10
|
+
"reset navigateTo": assign({
|
|
11
|
+
navigateTo: () => null
|
|
12
|
+
}),
|
|
13
|
+
"assign navigateTo": assign(({ event }) => {
|
|
14
|
+
assertEvent(event, ["navigate.to"]);
|
|
15
|
+
return {
|
|
16
|
+
navigateTo: {
|
|
17
|
+
viewId: event.viewId,
|
|
18
|
+
focusOnElement: event.focusOnElement
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
}),
|
|
9
22
|
"change searchValue": assign({
|
|
10
23
|
searchValue: ({ event, context }) => {
|
|
11
24
|
assertEvent(event, ["change.search", "open"]);
|
|
@@ -21,17 +34,21 @@ const _searchActorLogic = setup({
|
|
|
21
34
|
context: {
|
|
22
35
|
openedWithSearch: null,
|
|
23
36
|
searchValue: "",
|
|
24
|
-
pickViewFor: null
|
|
37
|
+
pickViewFor: null,
|
|
38
|
+
navigateTo: null
|
|
25
39
|
},
|
|
26
40
|
initial: "inactive",
|
|
27
41
|
on: {
|
|
28
42
|
"close": {
|
|
29
|
-
target: ".inactive"
|
|
30
|
-
actions: "reset pickViewFor"
|
|
43
|
+
target: ".inactive"
|
|
31
44
|
}
|
|
32
45
|
},
|
|
33
46
|
states: {
|
|
34
47
|
inactive: {
|
|
48
|
+
entry: [
|
|
49
|
+
"reset navigateTo",
|
|
50
|
+
"reset pickViewFor"
|
|
51
|
+
],
|
|
35
52
|
on: {
|
|
36
53
|
"open": {
|
|
37
54
|
target: "opened",
|
|
@@ -57,6 +74,10 @@ const _searchActorLogic = setup({
|
|
|
57
74
|
actions: assign({
|
|
58
75
|
pickViewFor: ({ event }) => event.elementFqn
|
|
59
76
|
})
|
|
77
|
+
},
|
|
78
|
+
"navigate.to": {
|
|
79
|
+
target: "waitAnimationEnd",
|
|
80
|
+
actions: "assign navigateTo"
|
|
60
81
|
}
|
|
61
82
|
}
|
|
62
83
|
},
|
|
@@ -65,6 +86,41 @@ const _searchActorLogic = setup({
|
|
|
65
86
|
"pickview.close": {
|
|
66
87
|
target: "opened",
|
|
67
88
|
actions: "reset pickViewFor"
|
|
89
|
+
},
|
|
90
|
+
"navigate.to": {
|
|
91
|
+
target: "waitAnimationEnd",
|
|
92
|
+
actions: "assign navigateTo"
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
/**
|
|
97
|
+
* Wait for animation end before triggering navigation
|
|
98
|
+
* Otherwise, there could be weird artifacts when navigating to large diagrams.
|
|
99
|
+
*/
|
|
100
|
+
waitAnimationEnd: {
|
|
101
|
+
on: {
|
|
102
|
+
"animation.presence.end": {
|
|
103
|
+
target: "inactive",
|
|
104
|
+
actions: enqueueActions(({ context, system, enqueue }) => {
|
|
105
|
+
const navigateTo = context.navigateTo;
|
|
106
|
+
if (!navigateTo) return;
|
|
107
|
+
enqueue("reset navigateTo");
|
|
108
|
+
const diagramActor = typedSystem(system).diagramActorRef;
|
|
109
|
+
if (navigateTo.focusOnElement) {
|
|
110
|
+
const viewId = diagramActor.getSnapshot().context.view.id;
|
|
111
|
+
if (viewId === navigateTo.viewId) {
|
|
112
|
+
enqueue.sendTo(diagramActor, {
|
|
113
|
+
type: "focus.node",
|
|
114
|
+
nodeId: navigateTo.focusOnElement
|
|
115
|
+
});
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
enqueue.sendTo(diagramActor, {
|
|
120
|
+
type: "navigate.to",
|
|
121
|
+
...navigateTo
|
|
122
|
+
});
|
|
123
|
+
})
|
|
68
124
|
}
|
|
69
125
|
}
|
|
70
126
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { MantineThemeOverride } from '@mantine/core';
|
|
2
1
|
import { HTMLAttributes, ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
3
2
|
export declare const ShadowRoot: ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & {
|
|
4
3
|
injectFontCss?: boolean | undefined;
|
|
@@ -10,5 +9,9 @@ export declare const ShadowRoot: ForwardRefExoticComponent<HTMLAttributes<HTMLDi
|
|
|
10
9
|
width: number;
|
|
11
10
|
height: number;
|
|
12
11
|
};
|
|
13
|
-
|
|
12
|
+
/**
|
|
13
|
+
* Mantine theme override to apply within the shadow root
|
|
14
|
+
* @see https://mantine.dev/theming/mantine-provider/#theme-prop
|
|
15
|
+
*/
|
|
16
|
+
theme?: any;
|
|
14
17
|
} & RefAttributes<HTMLDivElement>>;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { MantineProvider } from '@mantine/core';
|
|
3
2
|
import { useMergedRef } from '@mantine/hooks';
|
|
4
|
-
import { forwardRef, useRef,
|
|
3
|
+
import { forwardRef, useRef, useState, memo } from 'react';
|
|
5
4
|
import root from 'react-shadow';
|
|
6
5
|
import { isDefined } from 'remeda';
|
|
6
|
+
import { DefaultMantineProvider } from '../context/DefaultMantineProvider.js';
|
|
7
7
|
import { FramerMotionConfig } from '../context/FramerMotionConfig.js';
|
|
8
8
|
import { useCallbackRef } from '../hooks/useCallbackRef.js';
|
|
9
9
|
import { useId } from '../hooks/useId.js';
|
|
10
|
-
import { useColorScheme, useBundledStyleSheet
|
|
10
|
+
import { useColorScheme, useBundledStyleSheet } from './styles.css.js';
|
|
11
11
|
|
|
12
12
|
const Root = root["div"];
|
|
13
13
|
function useShadowRootStyle(instanceId, keepAspectRatio = false) {
|
|
@@ -28,7 +28,8 @@ function useShadowRootStyle(instanceId, keepAspectRatio = false) {
|
|
|
28
28
|
}
|
|
29
29
|
`.trim();
|
|
30
30
|
}
|
|
31
|
-
const
|
|
31
|
+
const width = Math.ceil(keepAspectRatio.width);
|
|
32
|
+
const height = Math.ceil(keepAspectRatio.height);
|
|
32
33
|
const isLandscape = width > height;
|
|
33
34
|
return `
|
|
34
35
|
:where([data-likec4-instance="${instanceId}"]) {
|
|
@@ -38,21 +39,21 @@ function useShadowRootStyle(instanceId, keepAspectRatio = false) {
|
|
|
38
39
|
background: transparent;
|
|
39
40
|
padding: 0;
|
|
40
41
|
overflow: hidden;
|
|
41
|
-
aspect-ratio: ${
|
|
42
|
+
aspect-ratio: ${width} / ${height};
|
|
42
43
|
${isLandscape ? "" : `
|
|
43
|
-
max-width: min(100%, var(--likec4-view-max-width, ${
|
|
44
|
+
max-width: min(100%, var(--likec4-view-max-width, ${width}px));
|
|
44
45
|
margin-left: auto;
|
|
45
46
|
margin-right: auto;`}
|
|
46
47
|
width: ${isLandscape ? "100%" : "auto"};
|
|
47
48
|
height: ${isLandscape ? "auto" : "100%"};
|
|
48
49
|
${isLandscape ? `min-width: 80px;` : `min-height: 80px;`}
|
|
49
|
-
max-height: min(100%, var(--likec4-view-max-height, ${
|
|
50
|
+
max-height: min(100%, var(--likec4-view-max-height, ${height}px));
|
|
50
51
|
}
|
|
51
52
|
`.trim();
|
|
52
53
|
}
|
|
53
54
|
const ShadowRoot = forwardRef(({
|
|
54
55
|
children,
|
|
55
|
-
theme
|
|
56
|
+
theme,
|
|
56
57
|
injectFontCss = true,
|
|
57
58
|
styleNonce,
|
|
58
59
|
colorScheme: explicitColorScheme,
|
|
@@ -64,7 +65,7 @@ const ShadowRoot = forwardRef(({
|
|
|
64
65
|
const cssstyle = useShadowRootStyle(id, keepAspectRatio);
|
|
65
66
|
const rootRef = useRef(null);
|
|
66
67
|
const styleSheets = useBundledStyleSheet(injectFontCss, styleNonce);
|
|
67
|
-
const getRootElement =
|
|
68
|
+
const getRootElement = useCallbackRef(() => rootRef.current ?? void 0);
|
|
68
69
|
const getStyleNonce = useCallbackRef(() => {
|
|
69
70
|
if (isDefined(styleNonce)) {
|
|
70
71
|
if (typeof styleNonce === "string") {
|
|
@@ -75,16 +76,9 @@ const ShadowRoot = forwardRef(({
|
|
|
75
76
|
}
|
|
76
77
|
return "";
|
|
77
78
|
});
|
|
78
|
-
|
|
79
|
+
const [nonce] = useState(getStyleNonce);
|
|
79
80
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
80
|
-
/* @__PURE__ */ jsx(
|
|
81
|
-
"style",
|
|
82
|
-
{
|
|
83
|
-
type: "text/css",
|
|
84
|
-
nonce,
|
|
85
|
-
dangerouslySetInnerHTML: { __html: cssstyle }
|
|
86
|
-
}
|
|
87
|
-
),
|
|
81
|
+
/* @__PURE__ */ jsx(MemoizedStyle, { nonce, cssstyle }),
|
|
88
82
|
/* @__PURE__ */ jsx(Root, { ssr: false, ...props, styleSheets, "data-likec4-instance": id, children: /* @__PURE__ */ jsx(
|
|
89
83
|
"div",
|
|
90
84
|
{
|
|
@@ -92,14 +86,15 @@ const ShadowRoot = forwardRef(({
|
|
|
92
86
|
"data-mantine-color-scheme": colorScheme,
|
|
93
87
|
className: "likec4-shadow-root",
|
|
94
88
|
children: /* @__PURE__ */ jsx(
|
|
95
|
-
|
|
89
|
+
DefaultMantineProvider,
|
|
96
90
|
{
|
|
97
|
-
...explicitColorScheme && { forceColorScheme: explicitColorScheme },
|
|
98
91
|
defaultColorScheme: colorScheme,
|
|
99
92
|
getRootElement,
|
|
100
|
-
...!!nonce && { getStyleNonce },
|
|
101
93
|
cssVariablesSelector: ".likec4-shadow-root",
|
|
94
|
+
withCssVariables: true,
|
|
95
|
+
getStyleNonce,
|
|
102
96
|
theme,
|
|
97
|
+
...explicitColorScheme && { forceColorScheme: explicitColorScheme },
|
|
103
98
|
children: /* @__PURE__ */ jsx(FramerMotionConfig, { children })
|
|
104
99
|
}
|
|
105
100
|
)
|
|
@@ -107,6 +102,14 @@ const ShadowRoot = forwardRef(({
|
|
|
107
102
|
) })
|
|
108
103
|
] });
|
|
109
104
|
});
|
|
110
|
-
|
|
105
|
+
const MemoizedStyle = memo(({ nonce, cssstyle }) => /* @__PURE__ */ jsx(
|
|
106
|
+
"style",
|
|
107
|
+
{
|
|
108
|
+
type: "text/css",
|
|
109
|
+
nonce,
|
|
110
|
+
dangerouslySetInnerHTML: { __html: cssstyle }
|
|
111
|
+
}
|
|
112
|
+
));
|
|
113
|
+
MemoizedStyle.displayName = "MemoizedStyle";
|
|
111
114
|
|
|
112
115
|
export { ShadowRoot };
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { MantineThemeOverride } from '@mantine/core';
|
|
2
|
-
export declare const DefaultTheme: MantineThemeOverride;
|
|
3
1
|
export declare const cssInteractive: string;
|
|
4
2
|
export declare function useBundledStyleSheet(injectFontCss: boolean, styleNonce?: string | (() => string) | undefined): CSSStyleSheet[];
|
|
5
3
|
export type ColorScheme = 'light' | 'dark';
|