likec4 1.12.2 → 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.
@@ -1216,6 +1216,36 @@ function useMounted() {
1216
1216
  const [mounted, setMounted] = useState(!1);
1217
1217
  return useEffect(() => setMounted(!0), []), mounted;
1218
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
+ }
1219
1249
  function getEnv() {
1220
1250
  return typeof process < "u" && process.env ? "production" : "development";
1221
1251
  }
@@ -12393,70 +12423,72 @@ function themeToVars(theme) {
12393
12423
  };
12394
12424
  }
12395
12425
  export {
12396
- Tabs as $,
12426
+ UnstyledButton as $,
12397
12427
  ActionIcon as A,
12398
12428
  Box as B,
12399
12429
  Card as C,
12400
- ColorSwatch as D,
12401
- Divider as E,
12402
- Flex as F,
12430
+ MenuTarget as D,
12431
+ MenuDropdown as E,
12432
+ MenuLabel as F,
12403
12433
  Group as G,
12404
- CheckIcon as H,
12434
+ MenuDivider as H,
12405
12435
  Image as I,
12406
- rem as J,
12407
- Slider as K,
12408
- SegmentedControl as L,
12436
+ Stack as J,
12437
+ TooltipGroup as K,
12438
+ MenuItem as L,
12409
12439
  MantineContext as M,
12410
- useDebouncedValue as N,
12411
- HoverCard as O,
12440
+ CloseButton as N,
12441
+ keys as O,
12412
12442
  Paper as P,
12413
- HoverCardTarget as Q,
12414
- HoverCardDropdown as R,
12415
- Stack as S,
12443
+ ColorSwatch as Q,
12444
+ Divider as R,
12445
+ ScrollAreaAutosize as S,
12416
12446
  ThemeIcon as T,
12417
- UnstyledButton as U,
12418
- Anchor as V,
12419
- CopyButton as W,
12420
- useLocalStorage as X,
12421
- Spoiler as Y,
12422
- Badge as Z,
12423
- 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 _,
12424
12454
  Text as a,
12425
- TabsList as a0,
12426
- TabsTab as a1,
12427
- TabsPanel as a2,
12428
- useHover$1 as a3,
12429
- FloatingIndicator as a4,
12430
- useUncontrolled as a5,
12431
- clampUseMovePosition as a6,
12432
- useMove as a7,
12433
- useMergedRef as a8,
12434
- ActionIconGroup as a9,
12435
- Overlay as aa,
12436
- Notification as ab,
12437
- Code as ac,
12438
- createTheme as ad,
12439
- MantineProvider as ae,
12440
- useInViewport as af,
12441
- SimpleGrid as ag,
12442
- useTree as ah,
12443
- useComputedColorScheme as ai,
12444
- Tree as aj,
12445
- Drawer as ak,
12446
- ScrollArea as al,
12447
- Alert as am,
12448
- Select as an,
12449
- ModalRoot as ao,
12450
- ModalOverlay as ap,
12451
- ModalContent as aq,
12452
- ModalBody as ar,
12453
- useMantineTheme as as,
12454
- useMediaQuery as at,
12455
- useDisclosure as au,
12456
- LoadingOverlay as av,
12457
- useCallbackRef as aw,
12458
- Burger as ax,
12459
- Loader as ay,
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,
12460
12492
  CardSection as b,
12461
12493
  clsx as c,
12462
12494
  Center as d,
@@ -12464,22 +12496,22 @@ export {
12464
12496
  Title as f,
12465
12497
  Button as g,
12466
12498
  useMantineStyleNonce as h,
12467
- useHotkeys as i,
12468
- Tooltip as j,
12469
- Menu as k,
12470
- MenuTarget as l,
12471
- MenuDropdown as m,
12472
- MenuLabel as n,
12473
- MenuDivider as o,
12474
- TooltipGroup as p,
12475
- Space as q,
12476
- MenuItem as r,
12477
- 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,
12478
12510
  themeToVars as t,
12479
12511
  useMantineColorScheme as u,
12480
- PopoverTarget as v,
12481
- PopoverDropdown as w,
12482
- ScrollAreaAutosize as x,
12483
- CloseButton as y,
12484
- keys as z
12512
+ Space as v,
12513
+ SegmentedControl as w,
12514
+ useHotkeys as x,
12515
+ Tooltip as y,
12516
+ Menu as z
12485
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-BqtsxvKL.js";
2
+ import "./chunks/main-Bb3q3o7f.js";
3
3
  import "react";
4
4
  import "react-dom/client";