@epoch32/visage 1.3.0 → 1.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/index.js +4 -4
- package/dist/charts/index.js +5 -5
- package/dist/devtools/index.js +7 -7
- package/dist/dom/index.js +3 -3
- package/dist/form/index.js +2 -2
- package/dist/{index-h6tjqk6e.js → index-1jcd8gjf.js} +28 -17
- package/dist/{index-6kfe1nr4.js → index-1yhbg34h.js} +41 -9
- package/dist/{index-9fvarkrx.js → index-3y73zgbk.js} +1 -1
- package/dist/{index-y9bq7h9g.js → index-5jhzwtdz.js} +2 -2
- package/dist/{index-a4xns6cc.js → index-65j7a9et.js} +1 -1
- package/dist/{index-dyvgtp43.js → index-9bez1tmf.js} +2 -2
- package/dist/{index-df5e614s.js → index-awcrz19g.js} +1 -1
- package/dist/{index-061jf06a.js → index-cgepvvd4.js} +1 -1
- package/dist/{index-1xtrtz1t.js → index-dmhmde2z.js} +2 -2
- package/dist/{index-zr6cvset.js → index-dz6n88aq.js} +5 -5
- package/dist/{index-0madxn60.js → index-enc8cmea.js} +1 -1
- package/dist/{index-js199er4.js → index-g1drdx7k.js} +12 -1
- package/dist/{index-grhdtcb5.js → index-k7zd3awa.js} +14 -5
- package/dist/{index-8x8xz80v.js → index-kykzcs7p.js} +5 -4
- package/dist/{index-dvq5f3s8.js → index-vbsc8z8h.js} +121 -52
- package/dist/{index-8czhpea8.js → index-x6whpv54.js} +30 -19
- package/dist/{index-5s255b3w.js → index-xby428n5.js} +23 -22
- package/dist/{index-x2rs3vab.js → index-y3nprgn7.js} +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +20 -18
- package/dist/jsx-runtime/index.js +4 -4
- package/dist/query/index.js +3 -3
- package/dist/router/index.js +5 -5
- package/dist/router/router.d.ts +1 -0
- package/dist/rpc/index.js +4 -4
- package/dist/server/index.js +2 -2
- package/dist/signals/index.js +1 -1
- package/dist/signals/system.d.ts +2 -0
- package/dist/style/index.js +6 -6
- package/dist/template/index.js +2 -2
- package/dist/ui/dropdown-menu.d.ts +1 -1
- package/dist/ui/index.d.ts +1 -0
- package/dist/ui/index.js +9 -7
- package/dist/ui/overlay.d.ts +53 -0
- package/dist/ui/popover.d.ts +1 -1
- package/dist/ui/utils.d.ts +1 -1
- package/dist/virtual/index.js +5 -5
- package/package.json +1 -1
- package/src/dom/control-flow.ts +31 -21
- package/src/form/form.ts +29 -17
- package/src/index.ts +2 -0
- package/src/router/router.tsx +12 -2
- package/src/signals/effect.ts +2 -2
- package/src/signals/scope.ts +10 -8
- package/src/signals/store.ts +32 -1
- package/src/signals/system.ts +8 -0
- package/src/template/template.ts +12 -1
- package/src/ui/command-dialog.tsx +18 -1
- package/src/ui/dialog.tsx +16 -14
- package/src/ui/dropdown-menu.tsx +17 -14
- package/src/ui/index.ts +4 -0
- package/src/ui/overlay.ts +130 -0
- package/src/ui/popover.tsx +20 -22
- package/src/ui/utils.ts +8 -2
- package/src/virtual/virtualizer.ts +31 -18
|
@@ -5,23 +5,23 @@ import {
|
|
|
5
5
|
useContext2,
|
|
6
6
|
signal2,
|
|
7
7
|
createSignal2
|
|
8
|
-
} from "./index-
|
|
8
|
+
} from "./index-1yhbg34h.js";
|
|
9
9
|
import {
|
|
10
10
|
Show2,
|
|
11
11
|
For2,
|
|
12
12
|
Portal2
|
|
13
|
-
} from "./index-
|
|
13
|
+
} from "./index-xby428n5.js";
|
|
14
14
|
import {
|
|
15
15
|
Fragment2,
|
|
16
16
|
jsx2,
|
|
17
17
|
jsxs2
|
|
18
|
-
} from "./index-
|
|
18
|
+
} from "./index-3y73zgbk.js";
|
|
19
19
|
import {
|
|
20
20
|
createId2,
|
|
21
21
|
createControllableSignal2,
|
|
22
22
|
trapFocus2,
|
|
23
23
|
onClickOutside2
|
|
24
|
-
} from "./index-
|
|
24
|
+
} from "./index-kykzcs7p.js";
|
|
25
25
|
|
|
26
26
|
// src/ui/accordion.tsx
|
|
27
27
|
var AccordionContext = createContext2(null);
|
|
@@ -539,6 +539,67 @@ var BottomBar2 = Object.assign(BottomBarRoot2, {
|
|
|
539
539
|
Badge: BottomBarBadge2,
|
|
540
540
|
Separator: BottomBarSeparator2
|
|
541
541
|
});
|
|
542
|
+
// src/ui/overlay.ts
|
|
543
|
+
function useDismiss2(element, options) {
|
|
544
|
+
const isEnabled = () => {
|
|
545
|
+
if (typeof options.enabled === "function")
|
|
546
|
+
return options.enabled();
|
|
547
|
+
return options.enabled ?? true;
|
|
548
|
+
};
|
|
549
|
+
const handleKeyDown = (e) => {
|
|
550
|
+
if (!isEnabled() || e.defaultPrevented)
|
|
551
|
+
return;
|
|
552
|
+
if (e.key === "Escape" && (options.escapeKey ?? true)) {
|
|
553
|
+
if (options.onEscapeKeyDown) {
|
|
554
|
+
options.onEscapeKeyDown(e);
|
|
555
|
+
}
|
|
556
|
+
if (!e.defaultPrevented) {
|
|
557
|
+
options.onDismiss();
|
|
558
|
+
e.stopPropagation();
|
|
559
|
+
}
|
|
560
|
+
} else if (e.key === "Tab" && options.trapFocus) {
|
|
561
|
+
const el = element();
|
|
562
|
+
if (el) {
|
|
563
|
+
trapFocus2(el, e);
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
};
|
|
567
|
+
const handleClick = (e) => {
|
|
568
|
+
if (!isEnabled() || e.defaultPrevented)
|
|
569
|
+
return;
|
|
570
|
+
if (options.closeSelector) {
|
|
571
|
+
const target = e.target;
|
|
572
|
+
if (target?.closest(options.closeSelector)) {
|
|
573
|
+
options.onDismiss();
|
|
574
|
+
}
|
|
575
|
+
}
|
|
576
|
+
};
|
|
577
|
+
if (typeof document !== "undefined") {
|
|
578
|
+
const unbind = onClickOutside2(() => {
|
|
579
|
+
const el = element();
|
|
580
|
+
const rawIgnores = typeof options.outsideIgnore === "function" ? options.outsideIgnore() : options.outsideIgnore;
|
|
581
|
+
const ignores = Array.isArray(rawIgnores) ? rawIgnores : rawIgnores ? [rawIgnores] : [];
|
|
582
|
+
return [el, ...ignores];
|
|
583
|
+
}, (event) => {
|
|
584
|
+
if (!isEnabled())
|
|
585
|
+
return;
|
|
586
|
+
if (options.outsidePointer === false)
|
|
587
|
+
return;
|
|
588
|
+
if (options.onOutsidePointer) {
|
|
589
|
+
options.onOutsidePointer(event);
|
|
590
|
+
}
|
|
591
|
+
if (!event.defaultPrevented) {
|
|
592
|
+
options.onDismiss();
|
|
593
|
+
}
|
|
594
|
+
});
|
|
595
|
+
onCleanup2(unbind);
|
|
596
|
+
}
|
|
597
|
+
return {
|
|
598
|
+
handleKeyDown,
|
|
599
|
+
handleClick
|
|
600
|
+
};
|
|
601
|
+
}
|
|
602
|
+
|
|
542
603
|
// src/ui/command-dialog.tsx
|
|
543
604
|
function CommandDialog2(props) {
|
|
544
605
|
const [open, setOpen] = createControllableSignal2({
|
|
@@ -546,6 +607,13 @@ function CommandDialog2(props) {
|
|
|
546
607
|
defaultValue: props.defaultOpen ?? false,
|
|
547
608
|
onChange: props.onOpenChange
|
|
548
609
|
});
|
|
610
|
+
const contentRef = { current: null };
|
|
611
|
+
const dismiss = useDismiss2(() => contentRef.current, {
|
|
612
|
+
enabled: () => open(),
|
|
613
|
+
onDismiss: () => setOpen(false),
|
|
614
|
+
escapeKey: true,
|
|
615
|
+
outsidePointer: false
|
|
616
|
+
});
|
|
549
617
|
const { overlayClass, contentClass, style, ...rest } = props;
|
|
550
618
|
return /* @__PURE__ */ jsx2(Portal2, {
|
|
551
619
|
children: /* @__PURE__ */ jsx2("div", {
|
|
@@ -565,7 +633,11 @@ function CommandDialog2(props) {
|
|
|
565
633
|
if (e.target === e.currentTarget)
|
|
566
634
|
setOpen(false);
|
|
567
635
|
},
|
|
636
|
+
onKeyDown: dismiss.handleKeyDown,
|
|
568
637
|
children: /* @__PURE__ */ jsx2("div", {
|
|
638
|
+
ref: (el) => {
|
|
639
|
+
contentRef.current = el;
|
|
640
|
+
},
|
|
569
641
|
style: { width: "100%", maxWidth: "560px" },
|
|
570
642
|
class: contentClass,
|
|
571
643
|
children: /* @__PURE__ */ jsx2(CommandRoot, {
|
|
@@ -1251,27 +1323,27 @@ function DialogOverlay2(props) {
|
|
|
1251
1323
|
}
|
|
1252
1324
|
function DialogContent2(props) {
|
|
1253
1325
|
const ctx = useContext2(DialogContext);
|
|
1326
|
+
const dismiss = useDismiss2(() => ctx?.contentRef.current, {
|
|
1327
|
+
enabled: () => ctx?.open() ?? false,
|
|
1328
|
+
onDismiss: () => ctx?.setOpen(false),
|
|
1329
|
+
escapeKey: true,
|
|
1330
|
+
trapFocus: true,
|
|
1331
|
+
outsidePointer: false,
|
|
1332
|
+
closeSelector: "[data-dialog-close]",
|
|
1333
|
+
onEscapeKeyDown: (e) => {
|
|
1334
|
+
if (props.onKeyDown)
|
|
1335
|
+
props.onKeyDown(e);
|
|
1336
|
+
}
|
|
1337
|
+
});
|
|
1254
1338
|
const handleKeyDown = (e) => {
|
|
1255
1339
|
if (props.onKeyDown)
|
|
1256
1340
|
props.onKeyDown(e);
|
|
1257
|
-
|
|
1258
|
-
return;
|
|
1259
|
-
if (e.key === "Escape") {
|
|
1260
|
-
ctx?.setOpen(false);
|
|
1261
|
-
e.stopPropagation();
|
|
1262
|
-
} else if (e.key === "Tab" && ctx?.contentRef.current) {
|
|
1263
|
-
trapFocus2(ctx.contentRef.current, e);
|
|
1264
|
-
}
|
|
1341
|
+
dismiss.handleKeyDown(e);
|
|
1265
1342
|
};
|
|
1266
1343
|
const handleClick = (e) => {
|
|
1267
1344
|
if (props.onClick)
|
|
1268
1345
|
props.onClick(e);
|
|
1269
|
-
|
|
1270
|
-
return;
|
|
1271
|
-
const target = e.target;
|
|
1272
|
-
if (target?.closest("[data-dialog-close]")) {
|
|
1273
|
-
ctx?.setOpen(false);
|
|
1274
|
-
}
|
|
1346
|
+
dismiss.handleClick(e);
|
|
1275
1347
|
};
|
|
1276
1348
|
const {
|
|
1277
1349
|
as: Tag = "div",
|
|
@@ -1502,6 +1574,18 @@ function DropdownMenuPortal2(props) {
|
|
|
1502
1574
|
}
|
|
1503
1575
|
function DropdownMenuContent2(props) {
|
|
1504
1576
|
const ctx = useContext2(DropdownMenuContext);
|
|
1577
|
+
const dismiss = useDismiss2(() => ctx?.contentRef.current, {
|
|
1578
|
+
enabled: () => ctx?.open() ?? false,
|
|
1579
|
+
onDismiss: () => {
|
|
1580
|
+
if (ctx) {
|
|
1581
|
+
ctx.setOpen(false);
|
|
1582
|
+
ctx.triggerRef.current?.focus();
|
|
1583
|
+
}
|
|
1584
|
+
},
|
|
1585
|
+
escapeKey: true,
|
|
1586
|
+
outsidePointer: true,
|
|
1587
|
+
outsideIgnore: () => [ctx?.triggerRef.current]
|
|
1588
|
+
});
|
|
1505
1589
|
const handleKeyDown = (e) => {
|
|
1506
1590
|
if (props.onKeyDown)
|
|
1507
1591
|
props.onKeyDown(e);
|
|
@@ -1528,10 +1612,7 @@ function DropdownMenuContent2(props) {
|
|
|
1528
1612
|
items[items.length - 1]?.focus();
|
|
1529
1613
|
e.preventDefault();
|
|
1530
1614
|
} else if (e.key === "Escape") {
|
|
1531
|
-
|
|
1532
|
-
ctx.setOpen(false);
|
|
1533
|
-
ctx.triggerRef.current?.focus();
|
|
1534
|
-
}
|
|
1615
|
+
dismiss.handleKeyDown(e);
|
|
1535
1616
|
e.preventDefault();
|
|
1536
1617
|
} else if (e.key === "Tab") {
|
|
1537
1618
|
if (ctx)
|
|
@@ -1552,14 +1633,6 @@ function DropdownMenuContent2(props) {
|
|
|
1552
1633
|
ref: (el) => {
|
|
1553
1634
|
if (ctx) {
|
|
1554
1635
|
ctx.contentRef.current = el;
|
|
1555
|
-
if (el) {
|
|
1556
|
-
const cleanup = onClickOutside2([ctx.triggerRef.current, el], () => {
|
|
1557
|
-
if (ctx.open()) {
|
|
1558
|
-
ctx.setOpen(false);
|
|
1559
|
-
}
|
|
1560
|
-
});
|
|
1561
|
-
onCleanup2(cleanup);
|
|
1562
|
-
}
|
|
1563
1636
|
}
|
|
1564
1637
|
},
|
|
1565
1638
|
id: ctx?.menuId,
|
|
@@ -1776,26 +1849,30 @@ function PopoverPortal2(props) {
|
|
|
1776
1849
|
}
|
|
1777
1850
|
function PopoverContent2(props) {
|
|
1778
1851
|
const ctx = useContext2(PopoverContext);
|
|
1852
|
+
const dismiss = useDismiss2(() => ctx?.contentRef.current, {
|
|
1853
|
+
enabled: () => ctx?.open() ?? false,
|
|
1854
|
+
onDismiss: () => ctx?.setOpen(false),
|
|
1855
|
+
escapeKey: true,
|
|
1856
|
+
outsidePointer: true,
|
|
1857
|
+
outsideIgnore: () => [ctx?.triggerRef.current],
|
|
1858
|
+
closeSelector: "[data-popover-close]",
|
|
1859
|
+
onEscapeKeyDown: (e) => {
|
|
1860
|
+
if (props.onKeyDown)
|
|
1861
|
+
props.onKeyDown(e);
|
|
1862
|
+
if (!e.defaultPrevented) {
|
|
1863
|
+
ctx?.triggerRef.current?.focus();
|
|
1864
|
+
}
|
|
1865
|
+
}
|
|
1866
|
+
});
|
|
1779
1867
|
const handleKeyDown = (e) => {
|
|
1780
1868
|
if (props.onKeyDown)
|
|
1781
1869
|
props.onKeyDown(e);
|
|
1782
|
-
|
|
1783
|
-
return;
|
|
1784
|
-
if (e.key === "Escape" && ctx) {
|
|
1785
|
-
ctx.setOpen(false);
|
|
1786
|
-
ctx.triggerRef.current?.focus();
|
|
1787
|
-
e.stopPropagation();
|
|
1788
|
-
}
|
|
1870
|
+
dismiss.handleKeyDown(e);
|
|
1789
1871
|
};
|
|
1790
1872
|
const handleClick = (e) => {
|
|
1791
1873
|
if (props.onClick)
|
|
1792
1874
|
props.onClick(e);
|
|
1793
|
-
|
|
1794
|
-
return;
|
|
1795
|
-
const target = e.target;
|
|
1796
|
-
if (target?.closest("[data-popover-close]")) {
|
|
1797
|
-
ctx?.setOpen(false);
|
|
1798
|
-
}
|
|
1875
|
+
dismiss.handleClick(e);
|
|
1799
1876
|
};
|
|
1800
1877
|
const {
|
|
1801
1878
|
as: Tag = "div",
|
|
@@ -1812,14 +1889,6 @@ function PopoverContent2(props) {
|
|
|
1812
1889
|
ref: (el) => {
|
|
1813
1890
|
if (ctx) {
|
|
1814
1891
|
ctx.contentRef.current = el;
|
|
1815
|
-
if (el) {
|
|
1816
|
-
const cleanup = onClickOutside2([ctx.triggerRef.current, el], () => {
|
|
1817
|
-
if (ctx.open()) {
|
|
1818
|
-
ctx.setOpen(false);
|
|
1819
|
-
}
|
|
1820
|
-
});
|
|
1821
|
-
onCleanup2(cleanup);
|
|
1822
|
-
}
|
|
1823
1892
|
}
|
|
1824
1893
|
},
|
|
1825
1894
|
id: ctx?.contentId,
|
|
@@ -2034,4 +2103,4 @@ var Toast2 = Object.assign(ToastRoot, {
|
|
|
2034
2103
|
Description: ToastDescription2,
|
|
2035
2104
|
Close: ToastClose2
|
|
2036
2105
|
});
|
|
2037
|
-
export { useAccordionContext2, useAccordionItemContext2, AccordionItem2, AccordionTrigger2, AccordionContent2, Accordion2, BottomBarAction2, BottomBarBadge2, useBottomBarContext2, BottomBarItem2, BottomBarRoot2, BottomBarSeparator2, BottomBar2, CommandDialog2, useCommandContext2, CommandInput2, CommandList2, CommandEmpty2, CommandGroup2, CommandItem2, Command2, DataTable2, useDialogContext2, DialogTrigger2, DialogPortal2, DialogOverlay2, DialogContent2, DialogTitle2, DialogDescription2, DialogClose2, Dialog2, useDropdownMenuContext2, DropdownMenuTrigger2, DropdownMenuPortal2, DropdownMenuContent2, DropdownMenuItem2, DropdownMenuSeparator2, DropdownMenu2, createIcon2, usePopoverContext2, PopoverTrigger2, PopoverPortal2, PopoverContent2, PopoverClose2, Popover2, createToastManager2, defaultToastManager2, toast2, useToast2, ToastProvider2, ToastViewport2, ToastTitle2, ToastDescription2, ToastClose2, Toast2 };
|
|
2106
|
+
export { useAccordionContext2, useAccordionItemContext2, AccordionItem2, AccordionTrigger2, AccordionContent2, Accordion2, BottomBarAction2, BottomBarBadge2, useBottomBarContext2, BottomBarItem2, BottomBarRoot2, BottomBarSeparator2, BottomBar2, useDismiss2, CommandDialog2, useCommandContext2, CommandInput2, CommandList2, CommandEmpty2, CommandGroup2, CommandItem2, Command2, DataTable2, useDialogContext2, DialogTrigger2, DialogPortal2, DialogOverlay2, DialogContent2, DialogTitle2, DialogDescription2, DialogClose2, Dialog2, useDropdownMenuContext2, DropdownMenuTrigger2, DropdownMenuPortal2, DropdownMenuContent2, DropdownMenuItem2, DropdownMenuSeparator2, DropdownMenu2, createIcon2, usePopoverContext2, PopoverTrigger2, PopoverPortal2, PopoverContent2, PopoverClose2, Popover2, createToastManager2, defaultToastManager2, toast2, useToast2, ToastProvider2, ToastViewport2, ToastTitle2, ToastDescription2, ToastClose2, Toast2 };
|
|
@@ -3,13 +3,13 @@ import {
|
|
|
3
3
|
onCleanup2,
|
|
4
4
|
effect2,
|
|
5
5
|
signal2
|
|
6
|
-
} from "./index-
|
|
6
|
+
} from "./index-1yhbg34h.js";
|
|
7
7
|
import {
|
|
8
8
|
For2
|
|
9
|
-
} from "./index-
|
|
9
|
+
} from "./index-xby428n5.js";
|
|
10
10
|
import {
|
|
11
11
|
jsx2
|
|
12
|
-
} from "./index-
|
|
12
|
+
} from "./index-3y73zgbk.js";
|
|
13
13
|
|
|
14
14
|
// src/virtual/virtualizer.ts
|
|
15
15
|
function createVirtualizer2(options) {
|
|
@@ -26,27 +26,35 @@ function createVirtualizer2(options) {
|
|
|
26
26
|
return cached;
|
|
27
27
|
return getItemHeight(index);
|
|
28
28
|
};
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
let total = 0;
|
|
35
|
-
for (let i = 0;i < count; i++) {
|
|
36
|
-
total += getItemSize(i);
|
|
37
|
-
}
|
|
38
|
-
return total;
|
|
39
|
-
});
|
|
29
|
+
const offsetsCache = [0];
|
|
30
|
+
let offsetsValidUpTo = 0;
|
|
31
|
+
const invalidateOffsetsFrom = (index) => {
|
|
32
|
+
offsetsValidUpTo = Math.min(offsetsValidUpTo, index);
|
|
33
|
+
};
|
|
40
34
|
const getOffsetForIndex = (targetIndex) => {
|
|
35
|
+
if (targetIndex <= 0)
|
|
36
|
+
return 0;
|
|
41
37
|
if (typeof options.itemHeight === "number" && dynamicSizeCache.size === 0) {
|
|
42
38
|
return targetIndex * options.itemHeight;
|
|
43
39
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
40
|
+
if (targetIndex <= offsetsValidUpTo) {
|
|
41
|
+
return offsetsCache[targetIndex];
|
|
42
|
+
}
|
|
43
|
+
for (let i = offsetsValidUpTo;i < targetIndex; i++) {
|
|
44
|
+
offsetsCache[i + 1] = (offsetsCache[i] ?? 0) + getItemSize(i);
|
|
47
45
|
}
|
|
48
|
-
|
|
46
|
+
offsetsValidUpTo = targetIndex;
|
|
47
|
+
return offsetsCache[targetIndex];
|
|
49
48
|
};
|
|
49
|
+
const measurementVersion = signal2(0, { internal: true });
|
|
50
|
+
const totalSize = computed2(() => {
|
|
51
|
+
measurementVersion();
|
|
52
|
+
const count = getCount();
|
|
53
|
+
if (typeof options.itemHeight === "number" && dynamicSizeCache.size === 0) {
|
|
54
|
+
return count * options.itemHeight;
|
|
55
|
+
}
|
|
56
|
+
return getOffsetForIndex(count);
|
|
57
|
+
});
|
|
50
58
|
const findIndexAtOffset = (offset) => {
|
|
51
59
|
const count = getCount();
|
|
52
60
|
if (count === 0)
|
|
@@ -72,11 +80,13 @@ function createVirtualizer2(options) {
|
|
|
72
80
|
return Math.max(0, Math.min(count - 1, low));
|
|
73
81
|
};
|
|
74
82
|
const startIndex = computed2(() => {
|
|
83
|
+
measurementVersion();
|
|
75
84
|
const offset = scrollOffset();
|
|
76
85
|
const rawStart = findIndexAtOffset(offset);
|
|
77
86
|
return Math.max(0, rawStart - overscan);
|
|
78
87
|
});
|
|
79
88
|
const endIndex = computed2(() => {
|
|
89
|
+
measurementVersion();
|
|
80
90
|
const count = getCount();
|
|
81
91
|
if (count === 0)
|
|
82
92
|
return 0;
|
|
@@ -193,7 +203,8 @@ function createVirtualizer2(options) {
|
|
|
193
203
|
const measuredSize = isHorizontal ? element.getBoundingClientRect().width : element.getBoundingClientRect().height;
|
|
194
204
|
if (measuredSize > 0 && dynamicSizeCache.get(index) !== measuredSize) {
|
|
195
205
|
dynamicSizeCache.set(index, measuredSize);
|
|
196
|
-
|
|
206
|
+
invalidateOffsetsFrom(index);
|
|
207
|
+
measurementVersion.update((v) => v + 1);
|
|
197
208
|
}
|
|
198
209
|
};
|
|
199
210
|
return {
|
|
@@ -7,12 +7,13 @@ import {
|
|
|
7
7
|
runInScope2,
|
|
8
8
|
getActiveScope2,
|
|
9
9
|
useContext2,
|
|
10
|
-
effect2
|
|
11
|
-
|
|
10
|
+
effect2,
|
|
11
|
+
signal2
|
|
12
|
+
} from "./index-1yhbg34h.js";
|
|
12
13
|
import {
|
|
13
14
|
SuspenseContext2,
|
|
14
15
|
createResource2
|
|
15
|
-
} from "./index-
|
|
16
|
+
} from "./index-65j7a9et.js";
|
|
16
17
|
|
|
17
18
|
// src/dom/lazy.ts
|
|
18
19
|
function lazy2(importer) {
|
|
@@ -176,26 +177,24 @@ function For2(props) {
|
|
|
176
177
|
const newItems = [];
|
|
177
178
|
const prevMap = new Map;
|
|
178
179
|
for (const rec of items) {
|
|
179
|
-
prevMap.
|
|
180
|
+
const group = prevMap.get(rec.item);
|
|
181
|
+
if (group) {
|
|
182
|
+
group.push(rec);
|
|
183
|
+
} else {
|
|
184
|
+
prevMap.set(rec.item, [rec]);
|
|
185
|
+
}
|
|
180
186
|
}
|
|
181
187
|
for (let i = 0;i < list.length; i++) {
|
|
182
188
|
const item = list[i];
|
|
183
|
-
const
|
|
189
|
+
const existingGroup = prevMap.get(item);
|
|
190
|
+
const existing = existingGroup && existingGroup.length > 0 ? existingGroup.shift() : undefined;
|
|
184
191
|
if (existing) {
|
|
185
|
-
|
|
192
|
+
untrack2(() => {
|
|
193
|
+
existing.indexSignal.set(i);
|
|
194
|
+
});
|
|
186
195
|
newItems.push(existing);
|
|
187
|
-
prevMap.delete(item);
|
|
188
196
|
} else {
|
|
189
|
-
|
|
190
|
-
const indexSubscribers = new Set;
|
|
191
|
-
const indexSignal = (...args) => {
|
|
192
|
-
if (args.length > 0 && args[0] !== undefined && args[0] !== indexVal) {
|
|
193
|
-
indexVal = args[0];
|
|
194
|
-
for (const sub of Array.from(indexSubscribers))
|
|
195
|
-
sub();
|
|
196
|
-
}
|
|
197
|
-
return indexVal;
|
|
198
|
-
};
|
|
197
|
+
const indexSignal = signal2(i, { internal: true });
|
|
199
198
|
const itemScope = new Scope2(getActiveScope2());
|
|
200
199
|
let itemNodes = [];
|
|
201
200
|
untrack2(() => {
|
|
@@ -214,11 +213,13 @@ function For2(props) {
|
|
|
214
213
|
});
|
|
215
214
|
}
|
|
216
215
|
}
|
|
217
|
-
for (const [,
|
|
218
|
-
removed
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
node.parentNode
|
|
216
|
+
for (const [, remainingGroup] of prevMap) {
|
|
217
|
+
for (const removed of remainingGroup) {
|
|
218
|
+
removed.scope.dispose();
|
|
219
|
+
for (const node of removed.nodes) {
|
|
220
|
+
if (node.parentNode)
|
|
221
|
+
node.parentNode.removeChild(node);
|
|
222
|
+
}
|
|
222
223
|
}
|
|
223
224
|
}
|
|
224
225
|
if (marker.parentNode) {
|
package/dist/index.d.ts
CHANGED
|
@@ -11,5 +11,5 @@ export { hydrate, renderChildToString, renderToStream, renderToString, type Stre
|
|
|
11
11
|
export { batch, type CleanupFn, Computed, type Context, computed, createContext, createEffect, createMemo, createRoot, createSignal, createStore, type Dependency, Effect, effect, getActiveScope, isSignal, mutateStore, onCleanup, type ReadonlySignal, runInScope, Scope, Signal, type Store, type Subscriber, signal, untrack, unwrapStore, useContext, type WritableSignal } from "./signals";
|
|
12
12
|
export { type BaseLayoutProps, Center, type CenterProps, type ClassValue, createStyle, css, cx, DIMENSION_KEYWORDS, em, extractStyleTags, fluid, formatStyleProp, type GlassOptions, Grid, type GridProps, getScopeId, glass, hashString, hasReactiveClass, normalizeClass, px, type RadiusVariant, Row, type RowProps, radius, rem, type ScopeOptions, type ShadowVariant, Spacer, type SpacerProps, Stack, type StackProps, Style, type StyleClasses, StyleManager, type StyleProps, scopeCSS, scopeSelector, shadow, space, styleManager, UNITLESS_PROPERTIES, useStyle } from "./style";
|
|
13
13
|
export { html, template } from "./template";
|
|
14
|
-
export { Accordion, AccordionContent, AccordionItem, type AccordionItemProps, type AccordionMultipleProps, type AccordionProps, type AccordionSingleProps, AccordionTrigger, BottomBar, BottomBarAction, type BottomBarActionProps, BottomBarBadge, type BottomBarBadgeProps, type BottomBarContextValue, BottomBarItem, type BottomBarItemConfig, type BottomBarItemProps, type BottomBarProps, BottomBarRoot, BottomBarSeparator, type BottomBarSeparatorProps, type ColumnDef, Command, CommandDialog, type CommandDialogProps, CommandEmpty, CommandGroup, type CommandGroupData, CommandInput, type CommandInputProps, CommandItem, type CommandItemData, type CommandItemProps, CommandList, type CommandProps, type CreateTabsOptions, createControllableSignal, createIcon, createId, createTabs, createToastManager, DataTable, type DataTableProps, Dialog, DialogClose, DialogContent, type DialogContentProps, DialogDescription, DialogOverlay, DialogPortal, type DialogProps, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuContent, DropdownMenuItem, type DropdownMenuItemProps, DropdownMenuPortal, type DropdownMenuProps, DropdownMenuSeparator, DropdownMenuTrigger, defaultToastManager, type IconNode, type IconProps, onClickOutside, Popover, PopoverClose, PopoverContent, type PopoverContentProps, PopoverPortal, type PopoverProps, PopoverTrigger, type SortDirection, type SortState, Switch, type SwitchProps, SwitchThumb, type SwitchThumbProps, Tabs, TabsContent, type TabsContentProps, TabsList, type TabsProps, TabsTrigger, Toast, ToastClose, type ToastData, ToastDescription, type ToastManager, type ToastOptions, type ToastProps, ToastProvider, type ToastProviderProps, ToastTitle, type ToastVariant, ToastViewport, type ToastViewportProps, Tooltip, TooltipContent, type TooltipContentProps, TooltipPortal, type TooltipProps, TooltipTrigger, toast, trapFocus, useAccordionContext, useAccordionItemContext, useBottomBarContext, useCommandContext, useDialogContext, useDropdownMenuContext, usePopoverContext, useTabsContext, useToast, useTooltipContext } from "./ui";
|
|
14
|
+
export { Accordion, AccordionContent, AccordionItem, type AccordionItemProps, type AccordionMultipleProps, type AccordionProps, type AccordionSingleProps, AccordionTrigger, BottomBar, BottomBarAction, type BottomBarActionProps, BottomBarBadge, type BottomBarBadgeProps, type BottomBarContextValue, BottomBarItem, type BottomBarItemConfig, type BottomBarItemProps, type BottomBarProps, BottomBarRoot, BottomBarSeparator, type BottomBarSeparatorProps, type ColumnDef, Command, CommandDialog, type CommandDialogProps, CommandEmpty, CommandGroup, type CommandGroupData, CommandInput, type CommandInputProps, CommandItem, type CommandItemData, type CommandItemProps, CommandList, type CommandProps, type CreateTabsOptions, createControllableSignal, createIcon, createId, createTabs, createToastManager, DataTable, type DataTableProps, Dialog, DialogClose, DialogContent, type DialogContentProps, DialogDescription, DialogOverlay, DialogPortal, type DialogProps, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuContent, DropdownMenuItem, type DropdownMenuItemProps, DropdownMenuPortal, type DropdownMenuProps, DropdownMenuSeparator, DropdownMenuTrigger, defaultToastManager, type IconNode, type IconProps, onClickOutside, Popover, PopoverClose, PopoverContent, type PopoverContentProps, PopoverPortal, type PopoverProps, PopoverTrigger, type SortDirection, type SortState, Switch, type SwitchProps, SwitchThumb, type SwitchThumbProps, Tabs, TabsContent, type TabsContentProps, TabsList, type TabsProps, TabsTrigger, Toast, ToastClose, type ToastData, ToastDescription, type ToastManager, type ToastOptions, type ToastProps, ToastProvider, type ToastProviderProps, ToastTitle, type ToastVariant, ToastViewport, type ToastViewportProps, Tooltip, TooltipContent, type TooltipContentProps, TooltipPortal, type TooltipProps, TooltipTrigger, toast, trapFocus, type UseDismissOptions, useAccordionContext, useAccordionItemContext, useBottomBarContext, useCommandContext, useDialogContext, useDismiss, useDropdownMenuContext, usePopoverContext, useTabsContext, useToast, useTooltipContext } from "./ui";
|
|
15
15
|
export { createVirtualizer, VirtualGrid, type VirtualGridProps, type VirtualItem, type Virtualizer, type VirtualizerOptions, VirtualList, type VirtualListProps } from "./virtual";
|
package/dist/index.js
CHANGED
|
@@ -40,7 +40,7 @@ import {
|
|
|
40
40
|
createStore2,
|
|
41
41
|
mutateStore2,
|
|
42
42
|
unwrapStore2
|
|
43
|
-
} from "./index-
|
|
43
|
+
} from "./index-1yhbg34h.js";
|
|
44
44
|
import {
|
|
45
45
|
createApiClient2,
|
|
46
46
|
buildFileRouter2,
|
|
@@ -49,24 +49,24 @@ import {
|
|
|
49
49
|
defineMiddleware2,
|
|
50
50
|
ProcedureBuilder2,
|
|
51
51
|
procedure2
|
|
52
|
-
} from "./index-
|
|
52
|
+
} from "./index-cgepvvd4.js";
|
|
53
53
|
import {
|
|
54
54
|
lazy2,
|
|
55
55
|
Show2,
|
|
56
56
|
For2,
|
|
57
57
|
Portal2
|
|
58
|
-
} from "./index-
|
|
59
|
-
import"./index-
|
|
58
|
+
} from "./index-xby428n5.js";
|
|
59
|
+
import"./index-3y73zgbk.js";
|
|
60
60
|
import {
|
|
61
61
|
DevToolsHub2,
|
|
62
62
|
devtoolsHub2,
|
|
63
63
|
highlightElement2,
|
|
64
64
|
VisageDevTools2,
|
|
65
65
|
connectDevTools2
|
|
66
|
-
} from "./index-
|
|
66
|
+
} from "./index-dz6n88aq.js";
|
|
67
67
|
import {
|
|
68
68
|
createForm2
|
|
69
|
-
} from "./index-
|
|
69
|
+
} from "./index-1jcd8gjf.js";
|
|
70
70
|
import"./index-921pn75b.js";
|
|
71
71
|
import {
|
|
72
72
|
Router2,
|
|
@@ -77,7 +77,7 @@ import {
|
|
|
77
77
|
useNavigate2,
|
|
78
78
|
useParams2,
|
|
79
79
|
useSearchParams2
|
|
80
|
-
} from "./index-
|
|
80
|
+
} from "./index-k7zd3awa.js";
|
|
81
81
|
import {
|
|
82
82
|
createClient2,
|
|
83
83
|
RouterImpl2,
|
|
@@ -85,17 +85,17 @@ import {
|
|
|
85
85
|
query3,
|
|
86
86
|
mutation3,
|
|
87
87
|
subscription3
|
|
88
|
-
} from "./index-
|
|
88
|
+
} from "./index-awcrz19g.js";
|
|
89
89
|
import {
|
|
90
90
|
hydrate2,
|
|
91
91
|
renderChildToString2,
|
|
92
92
|
renderToString2,
|
|
93
93
|
renderToStream2
|
|
94
|
-
} from "./index-
|
|
94
|
+
} from "./index-y3nprgn7.js";
|
|
95
95
|
import {
|
|
96
96
|
template2,
|
|
97
97
|
html2
|
|
98
|
-
} from "./index-
|
|
98
|
+
} from "./index-g1drdx7k.js";
|
|
99
99
|
import {
|
|
100
100
|
useAccordionContext2,
|
|
101
101
|
useAccordionItemContext2,
|
|
@@ -110,6 +110,7 @@ import {
|
|
|
110
110
|
BottomBarRoot2,
|
|
111
111
|
BottomBarSeparator2,
|
|
112
112
|
BottomBar2,
|
|
113
|
+
useDismiss2,
|
|
113
114
|
CommandDialog2,
|
|
114
115
|
useCommandContext2,
|
|
115
116
|
CommandInput2,
|
|
@@ -152,12 +153,12 @@ import {
|
|
|
152
153
|
ToastDescription2,
|
|
153
154
|
ToastClose2,
|
|
154
155
|
Toast2
|
|
155
|
-
} from "./index-
|
|
156
|
+
} from "./index-vbsc8z8h.js";
|
|
156
157
|
import {
|
|
157
158
|
createVirtualizer2,
|
|
158
159
|
VirtualList2,
|
|
159
160
|
VirtualGrid2
|
|
160
|
-
} from "./index-
|
|
161
|
+
} from "./index-x6whpv54.js";
|
|
161
162
|
import {
|
|
162
163
|
ChartContext2,
|
|
163
164
|
useChartContext2,
|
|
@@ -179,7 +180,7 @@ import {
|
|
|
179
180
|
Line2,
|
|
180
181
|
Pie2,
|
|
181
182
|
ChartTooltip2
|
|
182
|
-
} from "./index-
|
|
183
|
+
} from "./index-9bez1tmf.js";
|
|
183
184
|
import {
|
|
184
185
|
createId2,
|
|
185
186
|
createControllableSignal2,
|
|
@@ -198,7 +199,7 @@ import {
|
|
|
198
199
|
Tooltip3,
|
|
199
200
|
SwitchThumb2,
|
|
200
201
|
Switch2
|
|
201
|
-
} from "./index-
|
|
202
|
+
} from "./index-kykzcs7p.js";
|
|
202
203
|
import {
|
|
203
204
|
ERROR_CODE_TO_STATUS2,
|
|
204
205
|
STATUS_TO_ERROR_CODE2,
|
|
@@ -228,7 +229,7 @@ import {
|
|
|
228
229
|
createMutation2,
|
|
229
230
|
createQuery2,
|
|
230
231
|
createInfiniteQuery2
|
|
231
|
-
} from "./index-
|
|
232
|
+
} from "./index-5jhzwtdz.js";
|
|
232
233
|
import {
|
|
233
234
|
hashString2,
|
|
234
235
|
getScopeId2,
|
|
@@ -241,19 +242,19 @@ import {
|
|
|
241
242
|
css2,
|
|
242
243
|
useStyle2,
|
|
243
244
|
Style2
|
|
244
|
-
} from "./index-
|
|
245
|
+
} from "./index-enc8cmea.js";
|
|
245
246
|
import {
|
|
246
247
|
Stack2,
|
|
247
248
|
Row2,
|
|
248
249
|
Center2,
|
|
249
250
|
Grid2,
|
|
250
251
|
Spacer2
|
|
251
|
-
} from "./index-
|
|
252
|
+
} from "./index-dmhmde2z.js";
|
|
252
253
|
import {
|
|
253
254
|
createResource2,
|
|
254
255
|
Suspense2,
|
|
255
256
|
ErrorBoundary2
|
|
256
|
-
} from "./index-
|
|
257
|
+
} from "./index-65j7a9et.js";
|
|
257
258
|
export {
|
|
258
259
|
Accordion2 as Accordion,
|
|
259
260
|
AccordionContent2 as AccordionContent,
|
|
@@ -459,6 +460,7 @@ export {
|
|
|
459
460
|
useCommandContext2 as useCommandContext,
|
|
460
461
|
useContext2 as useContext,
|
|
461
462
|
useDialogContext2 as useDialogContext,
|
|
463
|
+
useDismiss2 as useDismiss,
|
|
462
464
|
useDropdownMenuContext2 as useDropdownMenuContext,
|
|
463
465
|
useLocation2 as useLocation,
|
|
464
466
|
useNavigate2 as useNavigate,
|
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
jsx2,
|
|
4
4
|
jsxs2,
|
|
5
5
|
jsxDEV2
|
|
6
|
-
} from "../index-
|
|
7
|
-
import"../index-
|
|
8
|
-
import"../index-
|
|
9
|
-
import"../index-
|
|
6
|
+
} from "../index-3y73zgbk.js";
|
|
7
|
+
import"../index-xby428n5.js";
|
|
8
|
+
import"../index-65j7a9et.js";
|
|
9
|
+
import"../index-1yhbg34h.js";
|
|
10
10
|
export {
|
|
11
11
|
Fragment2 as Fragment,
|
|
12
12
|
jsx2 as jsx,
|
package/dist/query/index.js
CHANGED
|
@@ -21,9 +21,9 @@ import {
|
|
|
21
21
|
createMutation2,
|
|
22
22
|
createQuery2,
|
|
23
23
|
createInfiniteQuery2
|
|
24
|
-
} from "../index-
|
|
25
|
-
import"../index-
|
|
26
|
-
import"../index-
|
|
24
|
+
} from "../index-5jhzwtdz.js";
|
|
25
|
+
import"../index-65j7a9et.js";
|
|
26
|
+
import"../index-1yhbg34h.js";
|
|
27
27
|
export {
|
|
28
28
|
FocusManager2 as FocusManager,
|
|
29
29
|
Mutation2 as Mutation,
|
package/dist/router/index.js
CHANGED
|
@@ -7,13 +7,13 @@ import {
|
|
|
7
7
|
useNavigate2,
|
|
8
8
|
useParams2,
|
|
9
9
|
useSearchParams2
|
|
10
|
-
} from "../index-
|
|
11
|
-
import"../index-
|
|
10
|
+
} from "../index-k7zd3awa.js";
|
|
11
|
+
import"../index-3y73zgbk.js";
|
|
12
12
|
import {
|
|
13
13
|
lazy2
|
|
14
|
-
} from "../index-
|
|
15
|
-
import"../index-
|
|
16
|
-
import"../index-
|
|
14
|
+
} from "../index-xby428n5.js";
|
|
15
|
+
import"../index-65j7a9et.js";
|
|
16
|
+
import"../index-1yhbg34h.js";
|
|
17
17
|
export {
|
|
18
18
|
Link2 as Link,
|
|
19
19
|
Route2 as Route,
|
package/dist/router/router.d.ts
CHANGED