likec4 1.12.1 → 1.13.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.
@@ -1157,6 +1157,15 @@ function useHotkeys(hotkeys, tagsToIgnore = ["INPUT", "TEXTAREA", "SELECT"], tri
1157
1157
  return document.documentElement.addEventListener("keydown", keydownListener), () => document.documentElement.removeEventListener("keydown", keydownListener);
1158
1158
  }, [hotkeys]);
1159
1159
  }
1160
+ function useHover$1() {
1161
+ const [hovered, setHovered] = useState(!1), ref = useRef(null), onMouseEnter = useCallback(() => setHovered(!0), []), onMouseLeave = useCallback(() => setHovered(!1), []);
1162
+ return useEffect(() => {
1163
+ if (ref.current)
1164
+ return ref.current.addEventListener("mouseenter", onMouseEnter), ref.current.addEventListener("mouseleave", onMouseLeave), () => {
1165
+ ref.current?.removeEventListener("mouseenter", onMouseEnter), ref.current?.removeEventListener("mouseleave", onMouseLeave);
1166
+ };
1167
+ }, [ref.current]), { ref, hovered };
1168
+ }
1160
1169
  function useDisclosure(initialState = !1, callbacks) {
1161
1170
  const { onOpen, onClose } = callbacks || {}, [opened, setOpened] = useState(initialState), open = useCallback(() => {
1162
1171
  setOpened((isOpened) => isOpened || (onOpen?.(), !0));
@@ -1207,6 +1216,36 @@ function useMounted() {
1207
1216
  const [mounted, setMounted] = useState(!1);
1208
1217
  return useEffect(() => setMounted(!0), []), mounted;
1209
1218
  }
1219
+ function useStateHistory(initialValue) {
1220
+ const [state, setState] = useState({
1221
+ history: [initialValue],
1222
+ current: 0
1223
+ }), set = useCallback(
1224
+ (val) => setState((currentState) => {
1225
+ const nextState = [...currentState.history.slice(0, currentState.current + 1), val];
1226
+ return {
1227
+ history: nextState,
1228
+ current: nextState.length - 1
1229
+ };
1230
+ }),
1231
+ []
1232
+ ), back = useCallback(
1233
+ (steps = 1) => setState((currentState) => ({
1234
+ history: currentState.history,
1235
+ current: Math.max(0, currentState.current - steps)
1236
+ })),
1237
+ []
1238
+ ), forward = useCallback(
1239
+ (steps = 1) => setState((currentState) => ({
1240
+ history: currentState.history,
1241
+ current: Math.min(currentState.history.length - 1, currentState.current + steps)
1242
+ })),
1243
+ []
1244
+ ), reset = useCallback(() => {
1245
+ setState({ history: [initialValue], current: 0 });
1246
+ }, [initialValue]), handlers = useMemo(() => ({ back, forward, reset, set }), [back, forward, reset, set]);
1247
+ return [state.history[state.current], handlers, state];
1248
+ }
1210
1249
  function getEnv() {
1211
1250
  return typeof process < "u" && process.env ? "production" : "development";
1212
1251
  }
@@ -12384,68 +12423,72 @@ function themeToVars(theme) {
12384
12423
  };
12385
12424
  }
12386
12425
  export {
12387
- Tabs as $,
12426
+ UnstyledButton as $,
12388
12427
  ActionIcon as A,
12389
12428
  Box as B,
12390
12429
  Card as C,
12391
- ColorSwatch as D,
12392
- Divider as E,
12393
- Flex as F,
12430
+ MenuTarget as D,
12431
+ MenuDropdown as E,
12432
+ MenuLabel as F,
12394
12433
  Group as G,
12395
- CheckIcon as H,
12434
+ MenuDivider as H,
12396
12435
  Image as I,
12397
- rem as J,
12398
- Slider as K,
12399
- SegmentedControl as L,
12436
+ Stack as J,
12437
+ TooltipGroup as K,
12438
+ MenuItem as L,
12400
12439
  MantineContext as M,
12401
- useDebouncedValue as N,
12402
- HoverCard as O,
12440
+ CloseButton as N,
12441
+ keys as O,
12403
12442
  Paper as P,
12404
- HoverCardTarget as Q,
12405
- HoverCardDropdown as R,
12406
- Stack as S,
12443
+ ColorSwatch as Q,
12444
+ Divider as R,
12445
+ ScrollAreaAutosize as S,
12407
12446
  ThemeIcon as T,
12408
- UnstyledButton as U,
12409
- Anchor as V,
12410
- CopyButton as W,
12411
- useLocalStorage as X,
12412
- Spoiler as Y,
12413
- Badge as Z,
12414
- ButtonGroup as _,
12447
+ Flex as U,
12448
+ CheckIcon as V,
12449
+ rem as W,
12450
+ Slider as X,
12451
+ useDebouncedValue as Y,
12452
+ HoverCard as Z,
12453
+ HoverCardTarget as _,
12415
12454
  Text as a,
12416
- TabsList as a0,
12417
- TabsTab as a1,
12418
- TabsPanel as a2,
12419
- FloatingIndicator as a3,
12420
- useUncontrolled as a4,
12421
- clampUseMovePosition as a5,
12422
- useMove as a6,
12423
- ActionIconGroup as a7,
12424
- Overlay as a8,
12425
- Notification as a9,
12426
- Code as aa,
12427
- createTheme as ab,
12428
- MantineProvider as ac,
12429
- useInViewport as ad,
12430
- SimpleGrid as ae,
12431
- useTree as af,
12432
- useComputedColorScheme as ag,
12433
- Tree as ah,
12434
- Drawer as ai,
12435
- ScrollArea as aj,
12436
- Alert as ak,
12437
- Select as al,
12438
- ModalRoot as am,
12439
- ModalOverlay as an,
12440
- ModalContent as ao,
12441
- ModalBody as ap,
12442
- useMantineTheme as aq,
12443
- useMediaQuery as ar,
12444
- useDisclosure as as,
12445
- LoadingOverlay as at,
12446
- useCallbackRef as au,
12447
- Burger as av,
12448
- Loader as aw,
12455
+ HoverCardDropdown as a0,
12456
+ Anchor as a1,
12457
+ CopyButton as a2,
12458
+ Spoiler as a3,
12459
+ Badge as a4,
12460
+ ButtonGroup as a5,
12461
+ Tabs as a6,
12462
+ TabsList as a7,
12463
+ TabsTab as a8,
12464
+ TabsPanel as a9,
12465
+ Loader as aA,
12466
+ useHover$1 as aa,
12467
+ FloatingIndicator as ab,
12468
+ useUncontrolled as ac,
12469
+ clampUseMovePosition as ad,
12470
+ useMove as ae,
12471
+ ActionIconGroup as af,
12472
+ Overlay as ag,
12473
+ Notification as ah,
12474
+ createTheme as ai,
12475
+ MantineProvider as aj,
12476
+ useInViewport as ak,
12477
+ SimpleGrid as al,
12478
+ Drawer as am,
12479
+ ScrollArea as an,
12480
+ Alert as ao,
12481
+ Select as ap,
12482
+ ModalRoot as aq,
12483
+ ModalOverlay as ar,
12484
+ ModalContent as as,
12485
+ ModalBody as at,
12486
+ useMantineTheme as au,
12487
+ useMediaQuery as av,
12488
+ useDisclosure as aw,
12489
+ LoadingOverlay as ax,
12490
+ useCallbackRef as ay,
12491
+ Burger as az,
12449
12492
  CardSection as b,
12450
12493
  clsx as c,
12451
12494
  Center as d,
@@ -12453,22 +12496,22 @@ export {
12453
12496
  Title as f,
12454
12497
  Button as g,
12455
12498
  useMantineStyleNonce as h,
12456
- useHotkeys as i,
12457
- Tooltip as j,
12458
- Menu as k,
12459
- MenuTarget as l,
12460
- MenuDropdown as m,
12461
- MenuLabel as n,
12462
- MenuDivider as o,
12463
- TooltipGroup as p,
12464
- Space as q,
12465
- MenuItem as r,
12466
- Popover as s,
12499
+ useMergedRef as i,
12500
+ useTimeout as j,
12501
+ Code as k,
12502
+ useTree as l,
12503
+ useComputedColorScheme as m,
12504
+ Popover as n,
12505
+ PopoverTarget as o,
12506
+ PopoverDropdown as p,
12507
+ Tree as q,
12508
+ useLocalStorage as r,
12509
+ useStateHistory as s,
12467
12510
  themeToVars as t,
12468
12511
  useMantineColorScheme as u,
12469
- PopoverTarget as v,
12470
- PopoverDropdown as w,
12471
- ScrollAreaAutosize as x,
12472
- CloseButton as y,
12473
- keys as z
12512
+ Space as v,
12513
+ SegmentedControl as w,
12514
+ useHotkeys as x,
12515
+ Tooltip as y,
12516
+ Menu as z
12474
12517
  };
@@ -1,7 +1,7 @@
1
1
  import { jsxs, jsx, Fragment } from "react/jsx-runtime";
2
2
  import * as React from "react";
3
3
  import { flushSync } from "react-dom";
4
- import { w as withSelectorExports } from "./likec4-CNg5BLwi.js";
4
+ import { w as withSelectorExports } from "./likec4-B4TbAFjc.js";
5
5
  const pushStateEvent = "pushstate", popStateEvent = "popstate", beforeUnloadEvent = "beforeunload", beforeUnloadListener = (event) => (event.preventDefault(), event.returnValue = ""), stopBlocking = () => {
6
6
  removeEventListener(beforeUnloadEvent, beforeUnloadListener, {
7
7
  capture: !0
@@ -1,4 +1,4 @@
1
1
  import "react/jsx-runtime";
2
- import "./chunks/main-TBVrmxK9.js";
2
+ import "./chunks/main-Bb3q3o7f.js";
3
3
  import "react";
4
4
  import "react-dom/client";