likec4 1.50.0 → 1.52.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/__app__/src/ProjectsOverview.js +1 -1
- package/__app__/src/likec4.js +277 -164
- package/__app__/src/main.js +2 -56
- package/__app__/src/routes/index.js +85 -18
- package/__app__/src/routes/projects.js +1 -1
- package/__app__/src/routes/single.js +433 -53
- package/__app__/src/style.css +1 -1
- package/__app__/src/vendors.js +18646 -17381
- package/__app__/src/webcomponent.js +1 -1
- package/config/schema.json +1 -1
- package/dist/THIRD-PARTY-LICENSES.md +183 -285
- package/dist/_chunks/LikeC4.mjs +1 -1154
- package/dist/_chunks/filesystem.mjs +1229 -0
- package/dist/_chunks/index2.d.mts +49 -18
- package/dist/_chunks/libs/@hono/mcp.mjs +9 -9
- package/dist/_chunks/libs/@hono/node-server.mjs +1 -1
- package/dist/_chunks/libs/@logtape/logtape.mjs +1 -1
- package/dist/_chunks/libs/@modelcontextprotocol/sdk.d.mts +13 -13
- package/dist/_chunks/libs/ansi-align.mjs +2 -0
- package/dist/_chunks/libs/ansi-regex.mjs +1 -0
- package/dist/_chunks/libs/ansi-styles.mjs +1 -0
- package/dist/_chunks/libs/atomically.mjs +1 -1
- package/dist/_chunks/libs/boxen.d.mts +1 -0
- package/dist/_chunks/libs/boxen.mjs +22 -0
- package/dist/_chunks/libs/conf.mjs +1 -1
- package/dist/_chunks/libs/langium.d.mts +1 -1
- package/dist/_chunks/libs/langium.mjs +17 -17
- package/dist/_chunks/libs/remeda.mjs +2 -2
- package/dist/_chunks/libs/tinyrainbow.mjs +1 -1
- package/dist/_chunks/libs/vscode-languageserver.mjs +1 -0
- package/dist/_chunks/sequence.mjs +1 -1
- package/dist/_chunks/src.mjs +1 -1
- package/dist/_chunks/src2.mjs +64 -64
- package/dist/cli/index.mjs +84 -74
- package/dist/index.d.mts +836 -1
- package/dist/index.mjs +1 -1
- package/dist/vite-plugin/index.mjs +1 -1
- package/dist/vite-plugin/internal.mjs +1 -1
- package/package.json +23 -24
- package/react/index.d.mts +56 -2
- package/react/index.mjs +1575 -595
- package/dist/_chunks/binary.mjs +0 -72
- package/dist/_chunks/libs/@logtape/logtape.d.mts +0 -741
- package/dist/_chunks/libs/@msgpack/msgpack.mjs +0 -1
- package/dist/_chunks/libs/@smithy/is-array-buffer.mjs +0 -1
- package/dist/_chunks/libs/@smithy/util-base64.mjs +0 -1
package/__app__/src/likec4.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { forwardRef, createElement, useContext, createContext as createContext$1, memo as memo$1, useRef, useMemo, useCallback, useState, useEffect, Fragment as Fragment$1, useDeferredValue, useLayoutEffect, Suspense, Profiler } from "react";
|
|
2
2
|
import { BBox, vector, convertPoint } from "@likec4/core/geometry";
|
|
3
3
|
import { jsx, Fragment, jsxs } from "react/jsx-runtime";
|
|
4
|
-
import { B as Background$1, a as BackgroundVariant, d as deepEqual, u as useFirstMountState, b as useCustomCompareEffect, s as shallowEqual, c as useStore, e as useStoreApi, f as useReactFlow, t, g as e, h as t$1, i as Bezier, j as getNodeDimensions, n, k as useMantineColorScheme, l as index, m as e$1, o as t$2, p as t$3, q as createSafeContext$1, r as atom, v as useStore$1, w as useSyncedRef, x as e$2, y as t$4, z as t$5, M as MantineProvider, A as createTheme, T as Tooltip$7, P as Portal, S as SegmentedControl, C as MantineContext, D as useMantineStyleNonce, L as LazyMotion, E as domMax, F as MotionConfig, G as useSelector, H as e$3, I as t$6, J as t$7, K as t$8, N as t$9, O as useId$1, Q as m, R as ThemeIcon, U as Text, V as ScrollAreaAutosize, W as Button, X as setup, Y as emit, Z as assign, _ as raise, $ as assertEvent, a0 as t$a, a1 as fromCallback, a2 as getHotkeyHandler, a3 as fromPromise, a4 as t$b, a5 as n$1, a6 as n$2, a7 as e$4, a8 as enqueueActions, a9 as r, aa as log, ab as sendTo, ac as getViewportForBounds, ad as getNodesBounds, ae as getEdgePosition, af as t$c, ag as t$d, ah as e$5, ai as t$e, aj as t$f, ak as n$3, al as dagre, am as t$g, an as t$h, ao as t$i, ap as cancel, aq as applyEdgeChanges, ar as applyNodeChanges, as as e$6, at as stopChild, au as spawnChild, av as e$7, aw as not, ax as t$j, ay as t$k, az as e$8, aA as ActionIcon, aB as MotionButton, aC as Breadcrumbs, aD as Menu, aE as UnstyledButton, aF as MotionDiv, aG as Divider$2, aH as useDebouncedCallback, aI as AnimatePresence, aJ as m$1, aK as stagger, aL as useIsMounted, aM as useHover, aN as Popover, aO as PopoverTarget, aP as PopoverDropdown, aQ as Box$1, aR as FloatingIndicator, aS as Flex$1, aT as useDebouncedCallback$1, aU as useUncontrolled, aV as clampUseMovePosition, aW as useMove, aX as useMergedRef, aY as TooltipGroup, aZ as useDebouncedValue, a_ as EdgeLabelRenderer, a$ as e$9, b0 as useDebouncedState, b1 as NodeToolbar, b2 as Position, b3 as Handle, b4 as Badge, b5 as CopyButton, b6 as HoverCard, b7 as HoverCardTarget, b8 as HoverCardDropdown, b9 as Notification, ba as isMacOs, bb as NavLink, bc as MenuTarget, bd as MenuDropdown, be as MenuItem, bf as useThrottledCallback, bg as Input, bh as rem, bi as t$l, bj as createScopedKeydownHandler, bk as Highlight, bl as useMountEffect, bm as e$a, bn as useActorRef, bo as LayoutGroup, bp as Stack, bq as useTree, br as Alert, bs as Tree$1, bt as Group, bu as getBezierPath, bv as ReactFlowProvider, bw as useStateHistory, bx as Panel, by as useClipboard, bz as Paper, bA as Anchor, bB as Pill, bC as useViewportSize, bD as useSessionStorage, bE as t$m, bF as useDragControls, bG as useMotionValue, bH as useTimeoutEffect, bI as ReactRemoveScroll, bJ as CloseButton, bK as ActionIconGroup, bL as Tabs, bM as TabsList, bN as TabsTab, bO as TabsPanel, bP as ScrollArea, bQ as useFocusTrap, bR as useReducedMotionConfig, bS as useCallbackRef$1, bT as animate, bU as e$b, bV as VisuallyHidden, bW as n$4, bX as useWindowEvent, bY as FocusTrap, bZ as Title$1, b_ as useFocusWithin, b$ as useCombobox, c0 as ComboboxOption, c1 as Combobox, c2 as ComboboxTarget, c3 as ComboboxDropdown, c4 as ComboboxOptions, c5 as ComboboxEmpty, c6 as
|
|
4
|
+
import { B as Background$1, a as BackgroundVariant, d as deepEqual, u as useFirstMountState, b as useCustomCompareEffect, s as shallowEqual, c as useStore, e as useStoreApi, f as useReactFlow, t, g as e, h as t$1, i as Bezier, j as getNodeDimensions, n, k as useMantineColorScheme, l as index, m as e$1, o as t$2, p as t$3, q as createSafeContext$1, r as atom, v as useStore$1, w as useSyncedRef, x as e$2, y as t$4, z as t$5, M as MantineProvider, A as createTheme, T as Tooltip$7, P as Portal, S as SegmentedControl, C as MantineContext, D as useMantineStyleNonce, L as LazyMotion, E as domMax, F as MotionConfig, G as useSelector, H as e$3, I as t$6, J as t$7, K as t$8, N as t$9, O as useId$1, Q as m, R as ThemeIcon, U as Text, V as ScrollAreaAutosize, W as Button, X as setup, Y as emit, Z as assign, _ as raise, $ as assertEvent, a0 as t$a, a1 as fromCallback, a2 as getHotkeyHandler, a3 as fromPromise, a4 as t$b, a5 as n$1, a6 as n$2, a7 as e$4, a8 as enqueueActions, a9 as r, aa as log, ab as sendTo, ac as getViewportForBounds, ad as getNodesBounds, ae as getEdgePosition, af as t$c, ag as t$d, ah as e$5, ai as t$e, aj as t$f, ak as n$3, al as dagre, am as t$g, an as t$h, ao as t$i, ap as cancel, aq as applyEdgeChanges, ar as applyNodeChanges, as as e$6, at as stopChild, au as spawnChild, av as e$7, aw as not, ax as t$j, ay as t$k, az as e$8, aA as ActionIcon, aB as MotionButton, aC as Breadcrumbs, aD as Menu, aE as UnstyledButton, aF as MotionDiv, aG as Divider$2, aH as useDebouncedCallback, aI as AnimatePresence, aJ as m$1, aK as stagger, aL as useIsMounted, aM as useHover, aN as Popover, aO as PopoverTarget, aP as PopoverDropdown, aQ as Box$1, aR as FloatingIndicator, aS as Flex$1, aT as useDebouncedCallback$1, aU as useUncontrolled, aV as clampUseMovePosition, aW as useMove, aX as useMergedRef, aY as TooltipGroup, aZ as useDebouncedValue, a_ as EdgeLabelRenderer, a$ as e$9, b0 as useDebouncedState, b1 as NodeToolbar, b2 as Position, b3 as Handle, b4 as Badge, b5 as CopyButton, b6 as HoverCard, b7 as HoverCardTarget, b8 as HoverCardDropdown, b9 as Notification, ba as isMacOs, bb as NavLink, bc as MenuTarget, bd as MenuDropdown, be as MenuItem, bf as useThrottledCallback, bg as Input, bh as rem, bi as t$l, bj as createScopedKeydownHandler, bk as Highlight, bl as useMountEffect, bm as e$a, bn as useActorRef, bo as LayoutGroup, bp as Stack, bq as useTree, br as Alert, bs as Tree$1, bt as Group, bu as getBezierPath, bv as ReactFlowProvider, bw as useStateHistory, bx as Panel, by as useClipboard, bz as Paper, bA as Anchor, bB as Pill, bC as useViewportSize, bD as useSessionStorage, bE as t$m, bF as useDragControls, bG as useMotionValue, bH as useTimeoutEffect, bI as ReactRemoveScroll, bJ as CloseButton, bK as ActionIconGroup, bL as Tabs, bM as TabsList, bN as TabsTab, bO as TabsPanel, bP as ScrollArea, bQ as useFocusTrap, bR as useReducedMotionConfig, bS as useCallbackRef$1, bT as animate, bU as e$b, bV as VisuallyHidden, bW as n$4, bX as useWindowEvent, bY as FocusTrap, bZ as Title$1, b_ as useFocusWithin, b$ as useCombobox, c0 as ComboboxOption, c1 as Combobox, c2 as ComboboxTarget, c3 as ComboboxDropdown, c4 as ComboboxOptions, c5 as ComboboxEmpty, c6 as Grid, c7 as GridCol, c8 as createEmptyActor, c9 as useHotkeys, ca as usePresence, cb as autoUpdate, cc as computePosition, cd as offset, ce as autoPlacement, cf as size, cg as hide, ch as useLocalStorage, ci as Card, cj as n$5, ck as useRerender, cl as d3line, cm as curveCatmullRomOpen, cn as useRafEffect, co as getSmoothStepPath, cp as e$c, cq as useDisclosure, cr as ViewportPortal, cs as ColorSwatch, ct as Space, cu as CheckIcon, cv as useUpdateEffect$1, cw as Slider, cx as r$1, cy as produce, cz as useTimeout, cA as useCustomCompareMemo, cB as setAutoFreeze, cC as castDraft, cD as n$6, cE as t$n, cF as nodeToRect$1, cG as and, cH as or, cI as e$d, cJ as e$e, cK as motionValue, cL as mapValue, cM as styleEffect, cN as isValidMotionProp, cO as collection, cP as useMachine, cQ as machine$6, cR as connect, cS as normalizeProps, cT as createStore, cU as shallowEqual$1, cV as useSelector$1, cW as mergeProps$1, cX as t$o } from "./vendors.js";
|
|
5
5
|
import { nonexhaustive, isTagColorSpecified, invariant as invariant$1, Queue, GroupElementKind, nonNullable as nonNullable$1, isStepEdgeId, extractStep, RichText as RichText$1, ancestorsFqn, nameFromFqn, isAncestor as isAncestor$1, hasProp, DefaultMap as DefaultMap$1, whereOperatorAsPredicate, isNonEmptyArray, BBox as BBox$1, exact as exact$1, getParallelStepsPrefix, ModelFqnExpr } from "@likec4/core";
|
|
6
6
|
import { invariant, nonNullable, nonexhaustive as nonexhaustive$1, toArray, ifind, DefaultMap, delay, ifirst, ifilter, compareNaturalHierarchically, compareNatural, isAncestor, sortParentsFirst, imap, stringHash, nameFromFqn as nameFromFqn$1, isome, difference, toSet, objectHash } from "@likec4/core/utils";
|
|
7
7
|
import { computeRelationshipsView, treeFromElements } from "@likec4/core/compute-view";
|
|
@@ -370,23 +370,25 @@ const createReactComponent = (type, iconName, iconNamePascal, iconNode) => {
|
|
|
370
370
|
);
|
|
371
371
|
return Component.displayName = `${iconNamePascal}`, Component;
|
|
372
372
|
};
|
|
373
|
-
const __iconNode$
|
|
374
|
-
const __iconNode$
|
|
375
|
-
const __iconNode$
|
|
376
|
-
const __iconNode$
|
|
377
|
-
const __iconNode$
|
|
378
|
-
const __iconNode$
|
|
379
|
-
const __iconNode$
|
|
380
|
-
const __iconNode$
|
|
381
|
-
const __iconNode$
|
|
382
|
-
const __iconNode$
|
|
383
|
-
const __iconNode$
|
|
384
|
-
const __iconNode$
|
|
385
|
-
const __iconNode$
|
|
386
|
-
const __iconNode$
|
|
387
|
-
const __iconNode$
|
|
388
|
-
const __iconNode$
|
|
389
|
-
const __iconNode$
|
|
373
|
+
const __iconNode$T = [["path", { d: "M12 9v4", key: "svg-0" }], ["path", { d: "M10.363 3.591l-8.106 13.534a1.914 1.914 0 0 0 1.636 2.871h16.214a1.914 1.914 0 0 0 1.636 -2.87l-8.106 -13.536a1.914 1.914 0 0 0 -3.274 0", key: "svg-1" }], ["path", { d: "M12 16h.01", key: "svg-2" }]], IconAlertTriangle = createReactComponent("outline", "alert-triangle", "AlertTriangle", __iconNode$T);
|
|
374
|
+
const __iconNode$S = [["path", { d: "M7 7l10 10", key: "svg-0" }], ["path", { d: "M17 8l0 9l-9 0", key: "svg-1" }]], IconArrowDownRight = createReactComponent("outline", "arrow-down-right", "ArrowDownRight", __iconNode$S);
|
|
375
|
+
const __iconNode$R = [["path", { d: "M5 12l14 0", key: "svg-0" }], ["path", { d: "M5 12l6 6", key: "svg-1" }], ["path", { d: "M5 12l6 -6", key: "svg-2" }]], IconArrowLeft = createReactComponent("outline", "arrow-left", "ArrowLeft", __iconNode$R);
|
|
376
|
+
const __iconNode$Q = [["path", { d: "M5 12l14 0", key: "svg-0" }], ["path", { d: "M13 18l6 -6", key: "svg-1" }], ["path", { d: "M13 6l6 6", key: "svg-2" }]], IconArrowRight = createReactComponent("outline", "arrow-right", "ArrowRight", __iconNode$Q);
|
|
377
|
+
const __iconNode$P = [["path", { d: "M13 3l0 7l6 0l-8 11l0 -7l-6 0l8 -11", key: "svg-0" }]], IconBolt = createReactComponent("outline", "bolt", "Bolt", __iconNode$P);
|
|
378
|
+
const __iconNode$O = [["path", { d: "M4 8h16", key: "svg-0" }], ["path", { d: "M4 6a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2l0 -12", key: "svg-1" }], ["path", { d: "M8 4v4", key: "svg-2" }]], IconBrowser = createReactComponent("outline", "browser", "Browser", __iconNode$O);
|
|
379
|
+
const __iconNode$N = [["path", { d: "M5 12l5 5l10 -10", key: "svg-0" }]], IconCheck = createReactComponent("outline", "check", "Check", __iconNode$N);
|
|
380
|
+
const __iconNode$M = [["path", { d: "M6 9l6 6l6 -6", key: "svg-0" }]], IconChevronDown = createReactComponent("outline", "chevron-down", "ChevronDown", __iconNode$M);
|
|
381
|
+
const __iconNode$L = [["path", { d: "M15 6l-6 6l6 6", key: "svg-0" }]], IconChevronLeft = createReactComponent("outline", "chevron-left", "ChevronLeft", __iconNode$L);
|
|
382
|
+
const __iconNode$K = [["path", { d: "M9 6l6 6l-6 6", key: "svg-0" }]], IconChevronRight = createReactComponent("outline", "chevron-right", "ChevronRight", __iconNode$K);
|
|
383
|
+
const __iconNode$J = [["path", { d: "M7 9.667a2.667 2.667 0 0 1 2.667 -2.667h8.666a2.667 2.667 0 0 1 2.667 2.667v8.666a2.667 2.667 0 0 1 -2.667 2.667h-8.666a2.667 2.667 0 0 1 -2.667 -2.667l0 -8.666", key: "svg-0" }], ["path", { d: "M4.012 16.737a2.005 2.005 0 0 1 -1.012 -1.737v-10c0 -1.1 .9 -2 2 -2h10c.75 0 1.158 .385 1.5 1", key: "svg-1" }]], IconCopy = createReactComponent("outline", "copy", "Copy", __iconNode$J);
|
|
384
|
+
const __iconNode$I = [["path", { d: "M5 6a7 3 0 1 0 14 0a7 3 0 1 0 -14 0", key: "svg-0" }], ["path", { d: "M5 6v12c0 1.657 3.134 3 7 3s7 -1.343 7 -3v-12", key: "svg-1" }]], IconCylinder = createReactComponent("outline", "cylinder", "Cylinder", __iconNode$I);
|
|
385
|
+
const __iconNode$H = [["path", { d: "M6 5a2 2 0 0 1 2 -2h8a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-8a2 2 0 0 1 -2 -2v-14", key: "svg-0" }], ["path", { d: "M11 4h2", key: "svg-1" }], ["path", { d: "M12 17v.01", key: "svg-2" }]], IconDeviceMobile = createReactComponent("outline", "device-mobile", "DeviceMobile", __iconNode$H);
|
|
386
|
+
const __iconNode$G = [["path", { d: "M12 6h-6a2 2 0 0 0 -2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-6", key: "svg-0" }], ["path", { d: "M11 13l9 -9", key: "svg-1" }], ["path", { d: "M15 4h5v5", key: "svg-2" }]], IconExternalLink = createReactComponent("outline", "external-link", "ExternalLink", __iconNode$G);
|
|
387
|
+
const __iconNode$F = [["path", { d: "M14 3v4a1 1 0 0 0 1 1h4", key: "svg-0" }], ["path", { d: "M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2", key: "svg-1" }], ["path", { d: "M10 13l-1 2l1 2", key: "svg-2" }], ["path", { d: "M14 13l1 2l-1 2", key: "svg-3" }]], IconFileCode = createReactComponent("outline", "file-code", "FileCode", __iconNode$F);
|
|
388
|
+
const __iconNode$E = [["path", { d: "M4 21v-4a3 3 0 0 1 3 -3h5", key: "svg-0" }], ["path", { d: "M9 17l3 -3l-3 -3", key: "svg-1" }], ["path", { d: "M14 3v4a1 1 0 0 0 1 1h4", key: "svg-2" }], ["path", { d: "M5 11v-6a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2h-9.5", key: "svg-3" }]], IconFileSymlink = createReactComponent("outline", "file-symlink", "FileSymlink", __iconNode$E);
|
|
389
|
+
const __iconNode$D = [["path", { d: "M14 3v4a1 1 0 0 0 1 1h4", key: "svg-0" }], ["path", { d: "M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2", key: "svg-1" }], ["path", { d: "M9 9l1 0", key: "svg-2" }], ["path", { d: "M9 13l6 0", key: "svg-3" }], ["path", { d: "M9 17l6 0", key: "svg-4" }]], IconFileText = createReactComponent("outline", "file-text", "FileText", __iconNode$D);
|
|
390
|
+
const __iconNode$C = [["path", { d: "M11 12a1 1 0 1 0 2 0a1 1 0 1 0 -2 0", key: "svg-0" }], ["path", { d: "M4 8v-2a2 2 0 0 1 2 -2h2", key: "svg-1" }], ["path", { d: "M4 16v2a2 2 0 0 0 2 2h2", key: "svg-2" }], ["path", { d: "M16 4h2a2 2 0 0 1 2 2v2", key: "svg-3" }], ["path", { d: "M16 20h2a2 2 0 0 0 2 -2v-2", key: "svg-4" }]], IconFocusCentered = createReactComponent("outline", "focus-centered", "FocusCentered", __iconNode$C);
|
|
391
|
+
const __iconNode$B = [["path", { d: "M5 19l2.757 -7.351a1 1 0 0 1 .936 -.649h12.307a1 1 0 0 1 .986 1.164l-.996 5.211a2 2 0 0 1 -1.964 1.625h-14.026a2 2 0 0 1 -2 -2v-11a2 2 0 0 1 2 -2h4l3 3h7a2 2 0 0 1 2 2v2", key: "svg-0" }]], IconFolderOpen = createReactComponent("outline", "folder-open", "FolderOpen", __iconNode$B);
|
|
390
392
|
const __iconNode$A = [["path", { d: "M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0", key: "svg-0" }], ["path", { d: "M12 16v.01", key: "svg-1" }], ["path", { d: "M12 13a2 2 0 0 0 .914 -3.782a1.98 1.98 0 0 0 -2.414 .483", key: "svg-2" }]], IconHelpCircle = createReactComponent("outline", "help-circle", "HelpCircle", __iconNode$A);
|
|
391
393
|
const __iconNode$z = [["path", { d: "M3 7a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v10a3 3 0 0 1 -3 3h-12a3 3 0 0 1 -3 -3l0 -10", key: "svg-0" }], ["path", { d: "M7 10a2 2 0 1 0 4 0a2 2 0 1 0 -4 0", key: "svg-1" }], ["path", { d: "M15 8l2 0", key: "svg-2" }], ["path", { d: "M15 12l2 0", key: "svg-3" }], ["path", { d: "M7 16l10 0", key: "svg-4" }]], IconId = createReactComponent("outline", "id", "Id", __iconNode$z);
|
|
392
394
|
const __iconNode$y = [["path", { d: "M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0", key: "svg-0" }], ["path", { d: "M12 9h.01", key: "svg-1" }], ["path", { d: "M11 12h1v4h1", key: "svg-2" }]], IconInfoCircle = createReactComponent("outline", "info-circle", "InfoCircle", __iconNode$y);
|
|
@@ -5034,7 +5036,7 @@ function DriftsSummary() {
|
|
|
5034
5036
|
onMouseLeave: onMouseLeaveDebounced,
|
|
5035
5037
|
onClick
|
|
5036
5038
|
}, { view, nodes, edges } = selected;
|
|
5037
|
-
return view.length === 0 && nodes.length === 0 && edges.length === 0 ? null : /* @__PURE__ */ jsx(AnimatePresence, {
|
|
5039
|
+
return view.length === 0 && nodes.length === 0 && edges.length === 0 ? null : /* @__PURE__ */ jsx(AnimatePresence, { children: /* @__PURE__ */ jsxs(
|
|
5038
5040
|
m$1.div,
|
|
5039
5041
|
{
|
|
5040
5042
|
layout: "size",
|
|
@@ -5053,16 +5055,16 @@ function DriftsSummary() {
|
|
|
5053
5055
|
}),
|
|
5054
5056
|
children: [
|
|
5055
5057
|
t$1(view, 1) && /* @__PURE__ */ jsx(ViewDrifts, { drifts: view }),
|
|
5056
|
-
nodes.length > 0 && /* @__PURE__ */ jsxs(m$1.div, { layout:
|
|
5058
|
+
nodes.length > 0 && /* @__PURE__ */ jsxs(m$1.div, { layout: !0, children: [
|
|
5057
5059
|
/* @__PURE__ */ jsx(SectionHeader$2, { children: "Elements:" }),
|
|
5058
|
-
/* @__PURE__ */ jsx(
|
|
5060
|
+
/* @__PURE__ */ jsx("div", { className: vstack({ mt: "2", gap: "2" }), children: t$a(
|
|
5059
5061
|
nodes,
|
|
5060
5062
|
(node2) => /* @__PURE__ */ jsx(NodeDrifts$1, { ...node2, ...handlers }, node2.id)
|
|
5061
5063
|
) })
|
|
5062
5064
|
] }, "nodes-drifts"),
|
|
5063
|
-
edges.length > 0 && /* @__PURE__ */ jsxs(m$1.div, { layout:
|
|
5065
|
+
edges.length > 0 && /* @__PURE__ */ jsxs(m$1.div, { layout: !0, children: [
|
|
5064
5066
|
/* @__PURE__ */ jsx(SectionHeader$2, { children: "Relationships:" }),
|
|
5065
|
-
/* @__PURE__ */ jsx(
|
|
5067
|
+
/* @__PURE__ */ jsx("div", { className: vstack({ mt: "2", gap: "2" }), children: t$a(edges, (edge) => /* @__PURE__ */ jsx(EdgeDrifts$1, { ...edge, ...handlers }, edge.edgeId)) })
|
|
5066
5068
|
] }, "edges-drifts")
|
|
5067
5069
|
]
|
|
5068
5070
|
},
|
|
@@ -5086,6 +5088,7 @@ function ViewDrifts({ drifts }) {
|
|
|
5086
5088
|
) });
|
|
5087
5089
|
}
|
|
5088
5090
|
function NodeDrifts$1({ id, name, drifts, ...handlers }) {
|
|
5091
|
+
const key2 = `node-drifts-${id}`;
|
|
5089
5092
|
return /* @__PURE__ */ jsxs(
|
|
5090
5093
|
DriftsGroup,
|
|
5091
5094
|
{
|
|
@@ -5111,28 +5114,29 @@ function NodeDrifts$1({ id, name, drifts, ...handlers }) {
|
|
|
5111
5114
|
children: name
|
|
5112
5115
|
}
|
|
5113
5116
|
),
|
|
5114
|
-
t$a(drifts, (drift) => /* @__PURE__ */ jsx(DriftLabel, { children: drift },
|
|
5117
|
+
t$a(drifts, (drift, i) => /* @__PURE__ */ jsx(DriftLabel, { children: drift }, key2 + drift + i))
|
|
5115
5118
|
]
|
|
5116
5119
|
},
|
|
5117
|
-
|
|
5120
|
+
key2
|
|
5118
5121
|
);
|
|
5119
5122
|
}
|
|
5120
5123
|
function EdgeDrifts$1({ edgeId, drifts, ...handlers }) {
|
|
5124
|
+
const key2 = `edge-drifts-${edgeId}`;
|
|
5121
5125
|
return /* @__PURE__ */ jsx(
|
|
5122
5126
|
DriftsGroup,
|
|
5123
5127
|
{
|
|
5124
5128
|
"data-drift-type": "edge",
|
|
5125
5129
|
"data-drift-id": edgeId,
|
|
5126
5130
|
...handlers,
|
|
5127
|
-
children: t$a(drifts, (drift) => /* @__PURE__ */ jsx(
|
|
5131
|
+
children: t$a(drifts, (drift, i) => /* @__PURE__ */ jsx(
|
|
5128
5132
|
DriftLabel,
|
|
5129
5133
|
{
|
|
5130
5134
|
children: drift
|
|
5131
5135
|
},
|
|
5132
|
-
|
|
5136
|
+
key2 + drift + i
|
|
5133
5137
|
))
|
|
5134
5138
|
},
|
|
5135
|
-
|
|
5139
|
+
key2
|
|
5136
5140
|
);
|
|
5137
5141
|
}
|
|
5138
5142
|
const DriftsGroup = styled(m$1.div, {
|
|
@@ -5153,7 +5157,7 @@ const DriftsGroup = styled(m$1.div, {
|
|
|
5153
5157
|
defaultProps: {
|
|
5154
5158
|
className: "group",
|
|
5155
5159
|
variants: variants$7,
|
|
5156
|
-
layout:
|
|
5160
|
+
layout: !0,
|
|
5157
5161
|
initial: "initial",
|
|
5158
5162
|
animate: "animate",
|
|
5159
5163
|
exit: "exit"
|
|
@@ -7860,7 +7864,7 @@ const Logo$1 = forwardRef(
|
|
|
7860
7864
|
}
|
|
7861
7865
|
) }) : null;
|
|
7862
7866
|
};
|
|
7863
|
-
function SearchControl() {
|
|
7867
|
+
function SearchControl$1() {
|
|
7864
7868
|
const diagram = useDiagram(), isMac = isMacOs();
|
|
7865
7869
|
return /* @__PURE__ */ jsxs(
|
|
7866
7870
|
UnstyledButton,
|
|
@@ -8014,17 +8018,9 @@ const selector$5 = (ctx) => {
|
|
|
8014
8018
|
}
|
|
8015
8019
|
));
|
|
8016
8020
|
function StartWalkthroughButton() {
|
|
8017
|
-
const {
|
|
8021
|
+
const { enableCompareWithLatest } = useEnabledFeatures(), diagram = useDiagram(), actor = useNavigationActor();
|
|
8018
8022
|
let tooltipLabel = "Start Dynamic View Walkthrough";
|
|
8019
|
-
|
|
8020
|
-
case !enableReadOnly:
|
|
8021
|
-
tooltipLabel = "Walkthrough not available in Edit mode";
|
|
8022
|
-
break;
|
|
8023
|
-
case enableCompareWithLatest:
|
|
8024
|
-
tooltipLabel = "Walkthrough not available when Compare is active";
|
|
8025
|
-
break;
|
|
8026
|
-
}
|
|
8027
|
-
return /* @__PURE__ */ jsx(Tooltip$6, { label: tooltipLabel, children: /* @__PURE__ */ jsx(
|
|
8023
|
+
return !0 === enableCompareWithLatest && (tooltipLabel = "Walkthrough not available when Compare is active"), /* @__PURE__ */ jsx(Tooltip$6, { label: tooltipLabel, children: /* @__PURE__ */ jsx(
|
|
8028
8024
|
TriggerWalkthroughButton,
|
|
8029
8025
|
{
|
|
8030
8026
|
onClick: (e2) => {
|
|
@@ -8035,7 +8031,7 @@ function StartWalkthroughButton() {
|
|
|
8035
8031
|
exit: { opacity: 0, translateX: -20 },
|
|
8036
8032
|
size: "compact-xs",
|
|
8037
8033
|
h: 26,
|
|
8038
|
-
disabled:
|
|
8034
|
+
disabled: enableCompareWithLatest,
|
|
8039
8035
|
classNames: {
|
|
8040
8036
|
label: css({
|
|
8041
8037
|
display: {
|
|
@@ -8331,7 +8327,7 @@ const selectBreadcrumbs = ({ context: context2 }) => {
|
|
|
8331
8327
|
"actions"
|
|
8332
8328
|
),
|
|
8333
8329
|
enableDynamicViewWalkthrough && isDynamicView && /* @__PURE__ */ jsx(DynamicViewControls, {}, "dynamic-view-controls"),
|
|
8334
|
-
enableSearch && !enableCompareWithLatest && /* @__PURE__ */ jsx(SearchControl, {}, "search-control"),
|
|
8330
|
+
enableSearch && !enableCompareWithLatest && /* @__PURE__ */ jsx(SearchControl$1, {}, "search-control"),
|
|
8335
8331
|
/* @__PURE__ */ jsx(LayoutWarning, {}, "outdated-manual-layout-warning")
|
|
8336
8332
|
] });
|
|
8337
8333
|
});
|
|
@@ -9043,7 +9039,7 @@ const useElementDetailsActorRef = () => {
|
|
|
9043
9039
|
if (ctx === null)
|
|
9044
9040
|
throw new Error("ElementDetailsActorRef is not provided");
|
|
9045
9041
|
return ctx;
|
|
9046
|
-
}, backdropBlur$1 = "--_blur", backdropOpacity$1 = "--_opacity", dialog
|
|
9042
|
+
}, backdropBlur$1 = "--_blur", backdropOpacity$1 = "--_opacity", dialog = css({
|
|
9047
9043
|
boxSizing: "border-box",
|
|
9048
9044
|
margin: "0",
|
|
9049
9045
|
padding: "0",
|
|
@@ -10007,7 +10003,7 @@ const node = css({
|
|
|
10007
10003
|
color: "white"
|
|
10008
10004
|
}
|
|
10009
10005
|
}
|
|
10010
|
-
}), scrollArea$
|
|
10006
|
+
}), scrollArea$1 = css({
|
|
10011
10007
|
maxHeight: [
|
|
10012
10008
|
"70vh",
|
|
10013
10009
|
"calc(100cqh - 70px)"
|
|
@@ -10016,7 +10012,7 @@ const node = css({
|
|
|
10016
10012
|
__proto__: null,
|
|
10017
10013
|
label,
|
|
10018
10014
|
node,
|
|
10019
|
-
scrollArea: scrollArea$
|
|
10015
|
+
scrollArea: scrollArea$1
|
|
10020
10016
|
}, Symbol.toStringTag, { value: "Module" })), selector2$1 = (state) => {
|
|
10021
10017
|
const subjectExistsInScope = state.context.layouted?.subjectExistsInScope ?? !1;
|
|
10022
10018
|
return {
|
|
@@ -10036,14 +10032,14 @@ const node = css({
|
|
|
10036
10032
|
subjectExistsInScope,
|
|
10037
10033
|
enableSelectSubject,
|
|
10038
10034
|
enableChangeScope
|
|
10039
|
-
} = useRelationshipsBrowserState(selector2$1),
|
|
10035
|
+
} = useRelationshipsBrowserState(selector2$1), root2 = useRef(null), viewport = useRef(null), subject = useLikeC4Model().findElement(subjectId), data2 = useLikeC4ElementsTree(scope === "view" && viewId ? viewId : void 0), tree2 = useTree({
|
|
10040
10036
|
multiple: !1
|
|
10041
10037
|
});
|
|
10042
10038
|
return tree2.setHoveredNode = setHoveredNode$2, useEffect(() => {
|
|
10043
10039
|
ancestorsFqn(subjectId).reverse().forEach((id) => {
|
|
10044
10040
|
tree2.expand(id);
|
|
10045
10041
|
}), tree2.select(subjectId);
|
|
10046
|
-
}, [subjectId]), /* @__PURE__ */ jsxs(Group, { ref:
|
|
10042
|
+
}, [subjectId]), /* @__PURE__ */ jsxs(Group, { ref: root2, gap: "xs", pos: "relative", children: [
|
|
10047
10043
|
enableSelectSubject && /* @__PURE__ */ jsxs(Group, { gap: 4, wrap: "nowrap", children: [
|
|
10048
10044
|
/* @__PURE__ */ jsx(
|
|
10049
10045
|
Box$1,
|
|
@@ -10080,7 +10076,7 @@ const node = css({
|
|
|
10080
10076
|
children: /* @__PURE__ */ jsx(Text, { fz: "xs", fw: "500", truncate: !0, children: subject?.title ?? "???" })
|
|
10081
10077
|
}
|
|
10082
10078
|
) }),
|
|
10083
|
-
/* @__PURE__ */ jsx(PopoverDropdown, { p: 0, miw: 250, maw: 400, children: /* @__PURE__ */ jsx(ScrollAreaAutosize, { scrollbars: "y", type: "never", viewportRef: viewport, className: scrollArea$
|
|
10079
|
+
/* @__PURE__ */ jsx(PopoverDropdown, { p: 0, miw: 250, maw: 400, children: /* @__PURE__ */ jsx(ScrollAreaAutosize, { scrollbars: "y", type: "never", viewportRef: viewport, className: scrollArea$1, children: /* @__PURE__ */ jsx(
|
|
10084
10080
|
Tree$1,
|
|
10085
10081
|
{
|
|
10086
10082
|
allowRangeSelection: !1,
|
|
@@ -10175,7 +10171,7 @@ const node = css({
|
|
|
10175
10171
|
position: "bottom-start",
|
|
10176
10172
|
disabled: subjectExistsInScope,
|
|
10177
10173
|
portalProps: {
|
|
10178
|
-
target:
|
|
10174
|
+
target: root2.current
|
|
10179
10175
|
},
|
|
10180
10176
|
children: /* @__PURE__ */ jsx(
|
|
10181
10177
|
SegmentedControl,
|
|
@@ -10841,7 +10837,7 @@ function ElementDetailsCard({
|
|
|
10841
10837
|
m$1.dialog,
|
|
10842
10838
|
{
|
|
10843
10839
|
ref,
|
|
10844
|
-
className: cx(dialog
|
|
10840
|
+
className: cx(dialog, ReactRemoveScroll.classNames.fullWidth),
|
|
10845
10841
|
layout: !0,
|
|
10846
10842
|
initial: {
|
|
10847
10843
|
[backdropBlur$1]: "0px",
|
|
@@ -11886,7 +11882,7 @@ css({
|
|
|
11886
11882
|
alignItems: "baseline",
|
|
11887
11883
|
justifyItems: "start"
|
|
11888
11884
|
});
|
|
11889
|
-
const scrollArea
|
|
11885
|
+
const scrollArea = css({
|
|
11890
11886
|
maxHeight: [
|
|
11891
11887
|
"70vh",
|
|
11892
11888
|
"calc(100cqh - 70px)"
|
|
@@ -11956,7 +11952,7 @@ const scrollArea$1 = css({
|
|
|
11956
11952
|
]
|
|
11957
11953
|
}
|
|
11958
11954
|
) }),
|
|
11959
|
-
/* @__PURE__ */ jsx(PopoverDropdown, { p: 0, miw: 250, maw: 400, children: /* @__PURE__ */ jsx(ScrollAreaAutosize, { className: scrollArea
|
|
11955
|
+
/* @__PURE__ */ jsx(PopoverDropdown, { p: 0, miw: 250, maw: 400, children: /* @__PURE__ */ jsx(ScrollAreaAutosize, { className: scrollArea, scrollbars: "y", type: "never", viewportRef: viewport, children: /* @__PURE__ */ jsx(Box$1, { className: edgeGrid, p: "xs", maw: 400, children: edges.map((e2) => /* @__PURE__ */ jsxs(
|
|
11960
11956
|
"div",
|
|
11961
11957
|
{
|
|
11962
11958
|
className: edgeRow,
|
|
@@ -12267,32 +12263,27 @@ const select$1 = (s) => s.children.search ?? null;
|
|
|
12267
12263
|
function useSearchActorRef() {
|
|
12268
12264
|
return useDiagramSnapshot(select$1, Object.is);
|
|
12269
12265
|
}
|
|
12270
|
-
|
|
12271
|
-
|
|
12272
|
-
|
|
12273
|
-
|
|
12274
|
-
|
|
12266
|
+
const SearchContext = createContext$1(null);
|
|
12267
|
+
function useSearchContext() {
|
|
12268
|
+
const ctx = useContext(SearchContext);
|
|
12269
|
+
if (!ctx)
|
|
12270
|
+
throw new Error("useSearchContext must be used within a SearchContext.Provider");
|
|
12271
|
+
return ctx;
|
|
12275
12272
|
}
|
|
12276
|
-
|
|
12277
|
-
|
|
12278
|
-
const
|
|
12279
|
-
|
|
12280
|
-
}, [searchActorRef]);
|
|
12281
|
-
return [searchValue, updateSearch];
|
|
12273
|
+
function normalizeSearch(value) {
|
|
12274
|
+
if (value === "") return value;
|
|
12275
|
+
const v = value.trim().toLowerCase();
|
|
12276
|
+
return v.startsWith("#") && v.length <= 2 ? "" : v.length > 1 ? v : "";
|
|
12282
12277
|
}
|
|
12283
|
-
const selectNormalizedSearchValue = (s) => {
|
|
12284
|
-
let v = selectSearchValue(s);
|
|
12285
|
-
return v === "" ? v : (v = v.trim().toLowerCase(), v.startsWith("#") && v.length <= 2 ? "" : v.length > 1 ? v : "");
|
|
12286
|
-
};
|
|
12287
12278
|
function useNormalizedSearch() {
|
|
12288
|
-
const
|
|
12289
|
-
return useDeferredValue(
|
|
12279
|
+
const ctx = useSearchContext();
|
|
12280
|
+
return useDeferredValue(ctx.normalizedSearch);
|
|
12290
12281
|
}
|
|
12291
12282
|
function useUpdateSearch() {
|
|
12292
|
-
const
|
|
12283
|
+
const { setSearchValue } = useSearchContext();
|
|
12293
12284
|
return useCallback((search) => {
|
|
12294
|
-
|
|
12295
|
-
}, [
|
|
12285
|
+
setSearchValue(search);
|
|
12286
|
+
}, [setSearchValue]);
|
|
12296
12287
|
}
|
|
12297
12288
|
const buttonFocused = css.raw({
|
|
12298
12289
|
outline: "none",
|
|
@@ -12508,12 +12499,12 @@ function moveFocusToSearchInput(from) {
|
|
|
12508
12499
|
console.error("moveFocusToSearchInput: from is null or undefined");
|
|
12509
12500
|
return;
|
|
12510
12501
|
}
|
|
12511
|
-
const
|
|
12512
|
-
if (!e$2(
|
|
12502
|
+
const root2 = from.getRootNode();
|
|
12503
|
+
if (!e$2(root2.querySelector)) {
|
|
12513
12504
|
console.error("moveFocusToSearchInput: root.querySelector is not a function");
|
|
12514
12505
|
return;
|
|
12515
12506
|
}
|
|
12516
|
-
let input2 =
|
|
12507
|
+
let input2 = root2.querySelector("[data-likec4-search-input]");
|
|
12517
12508
|
if (input2) {
|
|
12518
12509
|
const length = input2.value.length;
|
|
12519
12510
|
input2.focus(), input2.setSelectionRange(length, length);
|
|
@@ -12524,18 +12515,18 @@ function focusToFirstFoundElement(from) {
|
|
|
12524
12515
|
console.error("focusToFirstFoundElement: from is null or undefined");
|
|
12525
12516
|
return;
|
|
12526
12517
|
}
|
|
12527
|
-
const
|
|
12528
|
-
if (!e$2(
|
|
12518
|
+
const root2 = from.getRootNode();
|
|
12519
|
+
if (!e$2(root2.querySelector)) {
|
|
12529
12520
|
console.error("focusToFirstFoundElement: root.querySelector is not a function");
|
|
12530
12521
|
return;
|
|
12531
12522
|
}
|
|
12532
|
-
|
|
12523
|
+
root2.querySelector(`[data-likec4-search] .${focusable}`)?.focus();
|
|
12533
12524
|
}
|
|
12534
12525
|
function queryAllFocusable(from, where, selector3 = `.${focusable}`) {
|
|
12535
12526
|
if (!from)
|
|
12536
12527
|
return console.error("queryAllFocusable: from is null or undefined"), [];
|
|
12537
|
-
const
|
|
12538
|
-
return e$2(
|
|
12528
|
+
const root2 = from.getRootNode();
|
|
12529
|
+
return e$2(root2.querySelectorAll) ? [...root2.querySelectorAll(`[data-likec4-search-${where}] ${selector3}`)] : (console.error("queryAllFocusable: root.querySelectorAll is not a function"), []);
|
|
12539
12530
|
}
|
|
12540
12531
|
const _viewBtn = "likec4-view-btn", viewButton = cx(
|
|
12541
12532
|
css({
|
|
@@ -12562,7 +12553,7 @@ css({
|
|
|
12562
12553
|
}
|
|
12563
12554
|
});
|
|
12564
12555
|
const NothingFound = () => /* @__PURE__ */ jsx(Box, { className: emptyBoX, children: "Nothing found" }), useFoundViews = () => {
|
|
12565
|
-
const currentViewId =
|
|
12556
|
+
const { currentViewId } = useSearchContext(), likec4model = useLikeC4Model(), search = useNormalizedSearch();
|
|
12566
12557
|
return useMemo(() => {
|
|
12567
12558
|
let views = [...likec4model.views()];
|
|
12568
12559
|
if (search)
|
|
@@ -12612,7 +12603,7 @@ const NothingFound = () => /* @__PURE__ */ jsx(Box, { className: emptyBoX, child
|
|
|
12612
12603
|
ViewButton,
|
|
12613
12604
|
{
|
|
12614
12605
|
view,
|
|
12615
|
-
currentViewId,
|
|
12606
|
+
currentViewId: currentViewId ?? "",
|
|
12616
12607
|
search,
|
|
12617
12608
|
tabIndex: i === 0 ? 0 : -1
|
|
12618
12609
|
}
|
|
@@ -12622,12 +12613,8 @@ const NothingFound = () => /* @__PURE__ */ jsx(Box, { className: emptyBoX, child
|
|
|
12622
12613
|
);
|
|
12623
12614
|
}), btn$1 = buttonsva();
|
|
12624
12615
|
function ViewButton({ className, view, loop = !1, search, focusOnElement, currentViewId, ...props }) {
|
|
12625
|
-
const
|
|
12626
|
-
|
|
12627
|
-
type: "navigate.to",
|
|
12628
|
-
viewId: nextViewId,
|
|
12629
|
-
focusOnElement
|
|
12630
|
-
});
|
|
12616
|
+
const ctx = useSearchContext(), nextViewId = view.id, isCurrentView = nextViewId === currentViewId, navigate = () => {
|
|
12617
|
+
ctx.navigateTo(nextViewId, focusOnElement);
|
|
12631
12618
|
};
|
|
12632
12619
|
return /* @__PURE__ */ jsxs(
|
|
12633
12620
|
UnstyledButton,
|
|
@@ -12717,7 +12704,7 @@ function useElementsColumnData() {
|
|
|
12717
12704
|
elements,
|
|
12718
12705
|
t$g((acc, treeItem) => {
|
|
12719
12706
|
treeItem.children = [], byid[treeItem.value] = treeItem;
|
|
12720
|
-
const parent = acc.all.findLast((
|
|
12707
|
+
const parent = acc.all.findLast((root2) => isAncestor(root2.value, treeItem.value));
|
|
12721
12708
|
return parent ? parent.children.push(treeItem) : acc.roots.push(treeItem), acc.all.push(treeItem), acc.hash = stringHash(acc.hash + treeItem.value), acc;
|
|
12722
12709
|
}, {
|
|
12723
12710
|
hash: "empty",
|
|
@@ -12883,21 +12870,17 @@ function ElementTreeNode({ node: node2, elementProps, hasChildren, expanded, han
|
|
|
12883
12870
|
] });
|
|
12884
12871
|
}
|
|
12885
12872
|
function useHandleElementSelection() {
|
|
12886
|
-
const
|
|
12873
|
+
const ctx = useSearchContext();
|
|
12887
12874
|
return useCallbackRef((element) => {
|
|
12888
12875
|
const views = [...element.views()];
|
|
12889
12876
|
if (views.length === 0)
|
|
12890
12877
|
return;
|
|
12891
12878
|
const elementFqn = element.id, onlyOneViewId = t$f(views)?.id;
|
|
12892
12879
|
if (!onlyOneViewId) {
|
|
12893
|
-
|
|
12880
|
+
ctx.openPickView(elementFqn);
|
|
12894
12881
|
return;
|
|
12895
12882
|
}
|
|
12896
|
-
|
|
12897
|
-
type: "navigate.to",
|
|
12898
|
-
viewId: onlyOneViewId,
|
|
12899
|
-
focusOnElement: elementFqn
|
|
12900
|
-
});
|
|
12883
|
+
ctx.navigateTo(onlyOneViewId, elementFqn);
|
|
12901
12884
|
});
|
|
12902
12885
|
}
|
|
12903
12886
|
const input = css({
|
|
@@ -12954,14 +12937,13 @@ css({
|
|
|
12954
12937
|
}
|
|
12955
12938
|
});
|
|
12956
12939
|
function PickView({
|
|
12957
|
-
searchActorRef,
|
|
12958
12940
|
elementFqn
|
|
12959
12941
|
}) {
|
|
12960
|
-
const
|
|
12942
|
+
const ctx = useSearchContext(), currentViewId = ctx.currentViewId ?? "", element = useLikeC4Model().element(elementFqn), scoped = [], others = [];
|
|
12961
12943
|
for (const view of element.views())
|
|
12962
12944
|
view.viewOf === element ? scoped.push(view) : others.push(view);
|
|
12963
12945
|
const closePickView = () => {
|
|
12964
|
-
|
|
12946
|
+
ctx.closePickView();
|
|
12965
12947
|
};
|
|
12966
12948
|
return useWindowEvent(
|
|
12967
12949
|
"keydown",
|
|
@@ -13143,7 +13125,7 @@ function startingWithKind(search) {
|
|
|
13143
13125
|
return search.match(/^(k|ki|kin|kind|kind:)$/) != null;
|
|
13144
13126
|
}
|
|
13145
13127
|
const SEARCH_PREFIXES = ["#", "kind:"], LikeC4SearchInput = memo$1(() => {
|
|
13146
|
-
const
|
|
13128
|
+
const searchCtx = useSearchContext(), likec4model = useLikeC4Model(), inputRef = useRef(null), { ref, focused: focused2 } = useFocusWithin(), { searchValue: search, setSearchValue: setSearch } = searchCtx, combobox = useCombobox({
|
|
13147
13129
|
scrollBehavior: "smooth",
|
|
13148
13130
|
loop: !1
|
|
13149
13131
|
});
|
|
@@ -13228,9 +13210,7 @@ const SEARCH_PREFIXES = ["#", "kind:"], LikeC4SearchInput = memo$1(() => {
|
|
|
13228
13210
|
Input.ClearButton,
|
|
13229
13211
|
{
|
|
13230
13212
|
onClick: (e2) => {
|
|
13231
|
-
e2.stopPropagation();
|
|
13232
|
-
const openedWithSearch = searchActorRef.getSnapshot().context.openedWithSearch;
|
|
13233
|
-
search === "" || search === openedWithSearch ? searchActorRef.send({ type: "close" }) : setSearch("");
|
|
13213
|
+
e2.stopPropagation(), search === "" || search === searchCtx.openedWithSearch ? searchCtx.close() : setSearch("");
|
|
13234
13214
|
}
|
|
13235
13215
|
}
|
|
13236
13216
|
),
|
|
@@ -13281,23 +13261,58 @@ const SEARCH_PREFIXES = ["#", "kind:"], LikeC4SearchInput = memo$1(() => {
|
|
|
13281
13261
|
]
|
|
13282
13262
|
}
|
|
13283
13263
|
);
|
|
13284
|
-
}),
|
|
13264
|
+
}), selectSearchValue = (s) => s.context.searchValue, selectPickViewFor = (s) => s.context.pickViewFor, selectOpenedWithSearch = (s) => s.context.openedWithSearch;
|
|
13265
|
+
function XStateSearchAdapter({
|
|
13266
|
+
searchActorRef,
|
|
13267
|
+
children
|
|
13268
|
+
}) {
|
|
13269
|
+
const searchValue = useSelector(searchActorRef, selectSearchValue), pickViewFor = useSelector(searchActorRef, selectPickViewFor), openedWithSearch = useSelector(searchActorRef, selectOpenedWithSearch), currentViewId = useCurrentViewId(), setSearchValue = useCallbackRef((search) => {
|
|
13270
|
+
searchActorRef.send({ type: "change.search", search });
|
|
13271
|
+
}), navigateTo = useCallbackRef((viewId, focusOnElement) => {
|
|
13272
|
+
searchActorRef.send({
|
|
13273
|
+
type: "navigate.to",
|
|
13274
|
+
viewId,
|
|
13275
|
+
focusOnElement
|
|
13276
|
+
});
|
|
13277
|
+
}), openPickView = useCallbackRef((elementFqn) => {
|
|
13278
|
+
searchActorRef.send({ type: "pickview.open", elementFqn });
|
|
13279
|
+
}), closePickView = useCallbackRef(() => {
|
|
13280
|
+
searchActorRef.send({ type: "pickview.close" });
|
|
13281
|
+
}), close = useCallbackRef(() => {
|
|
13282
|
+
searchActorRef.send({ type: "close" });
|
|
13283
|
+
}), value = useMemo(() => ({
|
|
13284
|
+
searchValue,
|
|
13285
|
+
setSearchValue,
|
|
13286
|
+
normalizedSearch: normalizeSearch(searchValue),
|
|
13287
|
+
navigateTo,
|
|
13288
|
+
openPickView,
|
|
13289
|
+
closePickView,
|
|
13290
|
+
pickViewFor,
|
|
13291
|
+
close,
|
|
13292
|
+
currentViewId,
|
|
13293
|
+
openedWithSearch
|
|
13294
|
+
}), [
|
|
13295
|
+
searchValue,
|
|
13296
|
+
pickViewFor,
|
|
13297
|
+
currentViewId,
|
|
13298
|
+
openedWithSearch,
|
|
13299
|
+
// stable refs from useCallbackRef — listed for exhaustive-deps lint rule
|
|
13300
|
+
setSearchValue,
|
|
13301
|
+
navigateTo,
|
|
13302
|
+
openPickView,
|
|
13303
|
+
closePickView,
|
|
13304
|
+
close
|
|
13305
|
+
]);
|
|
13306
|
+
return /* @__PURE__ */ jsx(SearchContext.Provider, { value, children });
|
|
13307
|
+
}
|
|
13308
|
+
const dialogCss = css({
|
|
13285
13309
|
backgroundColor: "[rgb(34 34 34 / var(--_opacity, 95%))]",
|
|
13286
13310
|
_light: {
|
|
13287
13311
|
backgroundColor: "[rgb(250 250 250 / var(--_opacity, 95%))]"
|
|
13288
13312
|
},
|
|
13289
13313
|
backdropFilter: "auto",
|
|
13290
13314
|
backdropBlur: "var(--_blur, 10px)"
|
|
13291
|
-
|
|
13292
|
-
// _light: `[rgb(255 255 255/ var(${backdropOpacity}))]`,
|
|
13293
|
-
// },
|
|
13294
|
-
}), body = css({
|
|
13295
|
-
// containerName: 'likec4-search',
|
|
13296
|
-
// containerType: 'size',
|
|
13297
|
-
// position: 'fixed',
|
|
13298
|
-
// zIndex: 901,
|
|
13299
|
-
// top: '0',
|
|
13300
|
-
// left: '0',
|
|
13315
|
+
}), bodyCss = css({
|
|
13301
13316
|
width: "100%",
|
|
13302
13317
|
height: "100%",
|
|
13303
13318
|
maxHeight: "100vh",
|
|
@@ -13311,11 +13326,7 @@ const SEARCH_PREFIXES = ["#", "kind:"], LikeC4SearchInput = memo$1(() => {
|
|
|
13311
13326
|
paddingRight: "md",
|
|
13312
13327
|
paddingBottom: "sm",
|
|
13313
13328
|
background: "transparent"
|
|
13314
|
-
|
|
13315
|
-
// _dark: `[rgb(34 34 34 / 0.95)]`,
|
|
13316
|
-
// _light: `[rgb(255 255 255/ 0.95)]`,
|
|
13317
|
-
// },
|
|
13318
|
-
}), scrollArea = css({
|
|
13329
|
+
}), scrollAreaCss = css({
|
|
13319
13330
|
height: [
|
|
13320
13331
|
"100%",
|
|
13321
13332
|
"100cqh"
|
|
@@ -13358,33 +13369,20 @@ const SEARCH_PREFIXES = ["#", "kind:"], LikeC4SearchInput = memo$1(() => {
|
|
|
13358
13369
|
opacity: 0.9
|
|
13359
13370
|
},
|
|
13360
13371
|
classes: {
|
|
13361
|
-
dialog,
|
|
13362
|
-
body
|
|
13372
|
+
dialog: dialogCss,
|
|
13373
|
+
body: bodyCss
|
|
13363
13374
|
},
|
|
13364
13375
|
openDelay: 0,
|
|
13365
13376
|
onClose: close,
|
|
13366
13377
|
"data-likec4-search": "true",
|
|
13367
|
-
children: /* @__PURE__ */ jsx(SearchOverlayBody, { searchActorRef })
|
|
13378
|
+
children: /* @__PURE__ */ jsx(XStateSearchAdapter, { searchActorRef, children: /* @__PURE__ */ jsx(SearchOverlayBody, { searchActorRef }) })
|
|
13368
13379
|
}
|
|
13369
13380
|
) });
|
|
13370
13381
|
});
|
|
13371
13382
|
Search.displayName = "Search";
|
|
13372
|
-
const
|
|
13373
|
-
const ref = useRef(null), pickViewFor =
|
|
13374
|
-
|
|
13375
|
-
e$8(searchActorRef.getSnapshot().context.openedWithSearch) && focusToFirstFoundElement(ref.current);
|
|
13376
|
-
}, 150);
|
|
13377
|
-
const [isPresent, safeToRemove] = usePresence();
|
|
13378
|
-
return useEffect(() => {
|
|
13379
|
-
if (!isPresent) {
|
|
13380
|
-
safeToRemove();
|
|
13381
|
-
try {
|
|
13382
|
-
searchActorRef.send({ type: "animation.presence.end" });
|
|
13383
|
-
} catch (e2) {
|
|
13384
|
-
console.debug("SearchOverlayBody: animation.presence.end failed", e2);
|
|
13385
|
-
}
|
|
13386
|
-
}
|
|
13387
|
-
}, [isPresent, searchActorRef, safeToRemove]), /* @__PURE__ */ jsxs(Box, { ref, display: "contents", children: [
|
|
13383
|
+
const SearchPanelContent = memo$1(() => {
|
|
13384
|
+
const ref = useRef(null), { pickViewFor } = useSearchContext();
|
|
13385
|
+
return /* @__PURE__ */ jsxs(Box, { ref, display: "contents", children: [
|
|
13388
13386
|
/* @__PURE__ */ jsx(
|
|
13389
13387
|
Group,
|
|
13390
13388
|
{
|
|
@@ -13417,7 +13415,7 @@ const selectPickViewFor = (s) => s.context.pickViewFor, SearchOverlayBody = memo
|
|
|
13417
13415
|
ScrollArea,
|
|
13418
13416
|
{
|
|
13419
13417
|
type: "scroll",
|
|
13420
|
-
className:
|
|
13418
|
+
className: scrollAreaCss,
|
|
13421
13419
|
pr: "xs",
|
|
13422
13420
|
scrollbars: "y",
|
|
13423
13421
|
children: /* @__PURE__ */ jsx(LayoutGroup, { id: "likec4-search-elements", children: /* @__PURE__ */ jsx(Suspense, { children: /* @__PURE__ */ jsx(ElementsColumn, {}) }) })
|
|
@@ -13427,7 +13425,7 @@ const selectPickViewFor = (s) => s.context.pickViewFor, SearchOverlayBody = memo
|
|
|
13427
13425
|
ScrollArea,
|
|
13428
13426
|
{
|
|
13429
13427
|
type: "scroll",
|
|
13430
|
-
className:
|
|
13428
|
+
className: scrollAreaCss,
|
|
13431
13429
|
pr: "xs",
|
|
13432
13430
|
scrollbars: "y",
|
|
13433
13431
|
children: /* @__PURE__ */ jsx(Suspense, { children: /* @__PURE__ */ jsx(LayoutGroup, { id: "likec4-search-views", children: /* @__PURE__ */ jsx(ViewsColumn, {}) }) })
|
|
@@ -13436,9 +13434,27 @@ const selectPickViewFor = (s) => s.context.pickViewFor, SearchOverlayBody = memo
|
|
|
13436
13434
|
]
|
|
13437
13435
|
}
|
|
13438
13436
|
),
|
|
13439
|
-
pickViewFor && /* @__PURE__ */ jsx(PickView, {
|
|
13437
|
+
pickViewFor && /* @__PURE__ */ jsx(PickView, { elementFqn: pickViewFor })
|
|
13440
13438
|
] });
|
|
13441
13439
|
});
|
|
13440
|
+
SearchPanelContent.displayName = "SearchPanelContent";
|
|
13441
|
+
const SearchOverlayBody = memo$1(function({ searchActorRef }) {
|
|
13442
|
+
const ref = useRef(null);
|
|
13443
|
+
useTimeoutEffect(() => {
|
|
13444
|
+
e$8(searchActorRef.getSnapshot().context.openedWithSearch) && focusToFirstFoundElement(ref.current);
|
|
13445
|
+
}, 150);
|
|
13446
|
+
const [isPresent, safeToRemove] = usePresence();
|
|
13447
|
+
return useEffect(() => {
|
|
13448
|
+
if (!isPresent) {
|
|
13449
|
+
safeToRemove();
|
|
13450
|
+
try {
|
|
13451
|
+
searchActorRef.send({ type: "animation.presence.end" });
|
|
13452
|
+
} catch (e2) {
|
|
13453
|
+
console.debug("SearchOverlayBody: animation.presence.end failed", e2);
|
|
13454
|
+
}
|
|
13455
|
+
}
|
|
13456
|
+
}, [isPresent, searchActorRef, safeToRemove]), /* @__PURE__ */ jsx(Box, { ref, display: "contents", children: /* @__PURE__ */ jsx(SearchPanelContent, {}) });
|
|
13457
|
+
});
|
|
13442
13458
|
function PortalToContainer({ children }) {
|
|
13443
13459
|
const ctx = useRootContainerContext();
|
|
13444
13460
|
if (!ctx)
|
|
@@ -20079,6 +20095,87 @@ function LikeC4ProjectsOverview({
|
|
|
20079
20095
|
) })
|
|
20080
20096
|
] }) });
|
|
20081
20097
|
}
|
|
20098
|
+
const root = css({
|
|
20099
|
+
height: "30px",
|
|
20100
|
+
paddingLeft: "sm",
|
|
20101
|
+
paddingRight: "1",
|
|
20102
|
+
borderRadius: "sm",
|
|
20103
|
+
// TODO
|
|
20104
|
+
// color: fallbackVar('var(--search-color)', 'mantine.colors.placeholder)',
|
|
20105
|
+
border: "1px solid",
|
|
20106
|
+
borderColor: {
|
|
20107
|
+
base: "default.border",
|
|
20108
|
+
_light: "mantine.colors.gray[4]",
|
|
20109
|
+
_dark: "mantine.colors.dark[4]",
|
|
20110
|
+
_hover: "default.border"
|
|
20111
|
+
},
|
|
20112
|
+
cursor: "pointer",
|
|
20113
|
+
background: {
|
|
20114
|
+
base: "default",
|
|
20115
|
+
_light: "white",
|
|
20116
|
+
_dark: "mantine.colors.dark[6]",
|
|
20117
|
+
_hover: "default.hover"
|
|
20118
|
+
},
|
|
20119
|
+
width: "100%",
|
|
20120
|
+
"& .tabler-icon": {
|
|
20121
|
+
color: "text"
|
|
20122
|
+
},
|
|
20123
|
+
transition: {
|
|
20124
|
+
base: "fast",
|
|
20125
|
+
_whenPanning: "none !important"
|
|
20126
|
+
},
|
|
20127
|
+
boxShadow: {
|
|
20128
|
+
base: "xs",
|
|
20129
|
+
_hover: "sm",
|
|
20130
|
+
_whenPanning: "none !important"
|
|
20131
|
+
}
|
|
20132
|
+
}), placeholder = css({
|
|
20133
|
+
fontSize: "sm",
|
|
20134
|
+
// mantine.fontSizes.sm,
|
|
20135
|
+
fontWeight: "medium",
|
|
20136
|
+
paddingRight: "2.5",
|
|
20137
|
+
// 10px
|
|
20138
|
+
color: "text.placeholder",
|
|
20139
|
+
flex: "1",
|
|
20140
|
+
sm: {
|
|
20141
|
+
paddingRight: "[30px]"
|
|
20142
|
+
},
|
|
20143
|
+
md: {
|
|
20144
|
+
paddingRight: "[50px]"
|
|
20145
|
+
}
|
|
20146
|
+
}), shortcut = css({
|
|
20147
|
+
fontSize: "11px",
|
|
20148
|
+
fontWeight: "bold",
|
|
20149
|
+
lineHeight: 1,
|
|
20150
|
+
padding: "[4px 7px]",
|
|
20151
|
+
borderRadius: "sm",
|
|
20152
|
+
border: "1px solid",
|
|
20153
|
+
transition: "fast",
|
|
20154
|
+
_light: {
|
|
20155
|
+
color: "mantine.colors.gray[7]",
|
|
20156
|
+
borderColor: "mantine.colors.gray[2]"
|
|
20157
|
+
},
|
|
20158
|
+
_dark: {
|
|
20159
|
+
color: "mantine.colors.dark[0]",
|
|
20160
|
+
borderColor: "mantine.colors.dark[7]"
|
|
20161
|
+
},
|
|
20162
|
+
backgroundColor: {
|
|
20163
|
+
_light: "mantine.colors.gray[2]/70",
|
|
20164
|
+
_dark: "mantine.colors.dark[8]/70",
|
|
20165
|
+
_groupHover: {
|
|
20166
|
+
_light: "mantine.colors.gray[2]",
|
|
20167
|
+
_dark: "mantine.colors.dark[8]"
|
|
20168
|
+
}
|
|
20169
|
+
}
|
|
20170
|
+
});
|
|
20171
|
+
function SearchControl({ className, ...others }) {
|
|
20172
|
+
const isMac = isMacOs();
|
|
20173
|
+
return /* @__PURE__ */ jsx(UnstyledButton, { ...others, className: cx("group", root, className), children: /* @__PURE__ */ jsxs(Group, { gap: "xs", children: [
|
|
20174
|
+
/* @__PURE__ */ jsx(IconSearch, { style: { width: "15px", height: "15px" }, stroke: 2 }),
|
|
20175
|
+
/* @__PURE__ */ jsx(Text, { component: "div", className: placeholder, children: "Search" }),
|
|
20176
|
+
/* @__PURE__ */ jsx(Text, { component: "div", className: shortcut, children: isMac ? "⌘ + K" : "Ctrl + K" })
|
|
20177
|
+
] }) });
|
|
20178
|
+
}
|
|
20082
20179
|
const statebtn = cva({
|
|
20083
20180
|
base: {
|
|
20084
20181
|
border: "none",
|
|
@@ -21088,35 +21185,51 @@ const LikeC4AdHocView = memo$1(({ id }) => {
|
|
|
21088
21185
|
}, [actorRef, diagram]), null;
|
|
21089
21186
|
});
|
|
21090
21187
|
export {
|
|
21188
|
+
IconAlertTriangle as A,
|
|
21091
21189
|
Box as B,
|
|
21190
|
+
IconCheck as C,
|
|
21191
|
+
IconCopy as D,
|
|
21192
|
+
IconExternalLink as E,
|
|
21193
|
+
FramerMotionConfig as F,
|
|
21194
|
+
IconShare as G,
|
|
21195
|
+
pickViewBounds as H,
|
|
21092
21196
|
IconRendererProvider as I,
|
|
21197
|
+
LikeC4Diagram as J,
|
|
21198
|
+
useDiagramContext as K,
|
|
21093
21199
|
LikeC4ProjectsProvider as L,
|
|
21094
21200
|
Markdown as M,
|
|
21095
|
-
|
|
21201
|
+
NavigationPanel as N,
|
|
21202
|
+
Overlay as O,
|
|
21203
|
+
useDiagram as P,
|
|
21204
|
+
useOnDiagramEvent as Q,
|
|
21205
|
+
LikeC4EditorProvider as R,
|
|
21206
|
+
SearchContext as S,
|
|
21207
|
+
useChangeLikeC4Project as T,
|
|
21208
|
+
LikeC4ProjectsOverview as U,
|
|
21096
21209
|
LikeC4ModelProvider as a,
|
|
21097
|
-
|
|
21210
|
+
IconMoonStars as b,
|
|
21098
21211
|
css as c,
|
|
21099
|
-
|
|
21100
|
-
|
|
21101
|
-
|
|
21102
|
-
|
|
21103
|
-
|
|
21104
|
-
|
|
21105
|
-
|
|
21106
|
-
|
|
21107
|
-
|
|
21108
|
-
|
|
21109
|
-
|
|
21110
|
-
|
|
21111
|
-
|
|
21112
|
-
|
|
21113
|
-
|
|
21212
|
+
IconSun as d,
|
|
21213
|
+
SearchControl as e,
|
|
21214
|
+
bodyCss as f,
|
|
21215
|
+
dialogCss as g,
|
|
21216
|
+
SearchPanelContent as h,
|
|
21217
|
+
useLikeC4Model as i,
|
|
21218
|
+
StaticLikeC4Diagram as j,
|
|
21219
|
+
IconStarFilled as k,
|
|
21220
|
+
IconStack2 as l,
|
|
21221
|
+
IconLayoutDashboard as m,
|
|
21222
|
+
normalizeSearch as n,
|
|
21223
|
+
IconFileCode as o,
|
|
21224
|
+
IconFolderOpen as p,
|
|
21225
|
+
IconFolderFilled as q,
|
|
21226
|
+
IconArrowLeft as r,
|
|
21114
21227
|
styled as s,
|
|
21115
|
-
|
|
21228
|
+
LikeC4AdHocViewEditor as t,
|
|
21116
21229
|
useUpdateEffect as u,
|
|
21117
|
-
|
|
21118
|
-
|
|
21119
|
-
|
|
21120
|
-
|
|
21121
|
-
|
|
21230
|
+
createStyleContext as v,
|
|
21231
|
+
navigationPanel as w,
|
|
21232
|
+
isCssProperty as x,
|
|
21233
|
+
useLikeC4Projects as y,
|
|
21234
|
+
IconChevronDown as z
|
|
21122
21235
|
};
|