@sanity/ui 3.0.0-static.25 → 3.0.0-static.27
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/_chunks-cjs/_visual-editing.cjs +197 -197
- package/dist/_chunks-cjs/_visual-editing.cjs.map +1 -1
- package/dist/_chunks-es/_visual-editing.js +199 -199
- package/dist/_chunks-es/_visual-editing.js.map +1 -1
- package/dist/_visual-editing.d.cts +1 -0
- package/dist/_visual-editing.d.ts +1 -0
- package/dist/css.cjs +1 -1
- package/dist/css.d.cts +1 -1
- package/dist/css.d.ts +1 -1
- package/dist/css.js +1 -1
- package/dist/index.cjs +141 -141
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +143 -143
- package/dist/index.js.map +1 -1
- package/dist/theme.cjs +2605 -1075
- package/dist/theme.cjs.map +1 -1
- package/dist/theme.d.cts +1 -1
- package/dist/theme.d.ts +1 -1
- package/dist/theme.js +2689 -1159
- package/dist/theme.js.map +1 -1
- package/dist/ui.css +1 -1
- package/exports/_visual-editing.ts +1 -1
- package/package.json +13 -26
- package/src/core/components/dialog/dialog.tsx +2 -9
- package/src/core/components/dialog/dialogCard.tsx +2 -1
- package/src/core/components/index.ts +1 -0
- package/src/core/components/menu/menu.tsx +1 -2
- package/src/core/components/toast/toastLayer.tsx +1 -2
- package/src/core/components/toast/toastProvider.tsx +1 -1
- package/src/core/{utils → components}/virtualList/__workshop__/index.ts +1 -1
- package/src/core/primitives/badge/badge.tsx +2 -1
- package/src/core/primitives/index.ts +3 -0
- package/src/core/{utils → primitives}/layer/__workshop__/index.ts +1 -1
- package/src/core/primitives/popover/__workshop__/SidePanelStory.tsx +1 -0
- package/src/core/primitives/popover/popover.tsx +2 -1
- package/src/core/primitives/popover/popoverLayer.tsx +2 -1
- package/src/core/primitives/stack/stack.tsx +1 -0
- package/src/core/primitives/switch/switch.tsx +1 -1
- package/src/core/primitives/tooltip/tooltip.tsx +2 -1
- package/src/core/primitives/tooltip/tooltipLayer.tsx +2 -1
- package/src/core/utils/getElementRef.ts +1 -0
- package/src/core/utils/index.ts +0 -4
- package/src/css/primitives/avatar/avatar.css.ts +21 -4
- package/src/css/primitives/badge/badge.css.ts +2 -1
- package/src/css/primitives/label/label.css.ts +1 -0
- package/src/css/props/textOverflow/textOverflow.css.ts +2 -0
- package/src/css/props/width/types.ts +1 -1
- package/src/css/props/width/width.css.ts +3 -0
- package/src/theme/v2/build/buildTheme.test.ts +8 -8
- package/src/theme/v2/build/buildTheme.ts +32 -7
- /package/src/core/{utils → components}/virtualList/__workshop__/changingProps.tsx +0 -0
- /package/src/core/{utils → components}/virtualList/__workshop__/elementScroll.tsx +0 -0
- /package/src/core/{utils → components}/virtualList/__workshop__/infiniteList.tsx +0 -0
- /package/src/core/{utils → components}/virtualList/__workshop__/windowScrolll.tsx +0 -0
- /package/src/core/{utils → components}/virtualList/index.ts +0 -0
- /package/src/core/{utils → components}/virtualList/virtualList.tsx +0 -0
- /package/src/core/{utils → primitives}/arrow/arrow.tsx +0 -0
- /package/src/core/{utils → primitives}/arrow/cmds.ts +0 -0
- /package/src/core/{utils → primitives}/arrow/index.ts +0 -0
- /package/src/core/{utils → primitives}/layer/__workshop__/_debug.tsx +0 -0
- /package/src/core/{utils → primitives}/layer/__workshop__/multipleRoots.tsx +0 -0
- /package/src/core/{utils → primitives}/layer/__workshop__/nested.tsx +0 -0
- /package/src/core/{utils → primitives}/layer/__workshop__/responsiveZOffset.tsx +0 -0
- /package/src/core/{utils → primitives}/layer/getLayerContext.test.ts +0 -0
- /package/src/core/{utils → primitives}/layer/getLayerContext.ts +0 -0
- /package/src/core/{utils → primitives}/layer/index.ts +0 -0
- /package/src/core/{utils → primitives}/layer/layer.test.tsx +0 -0
- /package/src/core/{utils → primitives}/layer/layer.tsx +0 -0
- /package/src/core/{utils → primitives}/layer/layerCard.tsx +0 -0
- /package/src/core/{utils → primitives}/layer/layerContext.ts +0 -0
- /package/src/core/{utils → primitives}/layer/layerProvider.tsx +0 -0
- /package/src/core/{utils → primitives}/layer/types.ts +0 -0
- /package/src/core/{utils → primitives}/layer/useLayer.ts +0 -0
- /package/src/core/{utils → primitives}/srOnly/index.ts +0 -0
- /package/src/core/{utils → primitives}/srOnly/srOnly.tsx +0 -0
package/dist/css.cjs
CHANGED
|
@@ -194,7 +194,7 @@ var options$1 = { clip: { 0: "ui-e4u24p0", 1: "ui-e4u24p1", 2: "ui-e4u24p2", 3:
|
|
|
194
194
|
function textOverflow(props) {
|
|
195
195
|
return _responsiveClassName(options$1, props.textOverflow);
|
|
196
196
|
}
|
|
197
|
-
var options = { 0: { 0: "ui-
|
|
197
|
+
var options = { 0: { 0: "ui-nswtc7s", 1: "ui-nswtc7t", 2: "ui-nswtc7u", 3: "ui-nswtc7v", 4: "ui-nswtc7w", 5: "ui-nswtc7x", 6: "ui-nswtc7y" }, 1: { 0: "ui-nswtc7z", 1: "ui-nswtc710", 2: "ui-nswtc711", 3: "ui-nswtc712", 4: "ui-nswtc713", 5: "ui-nswtc714", 6: "ui-nswtc715" }, 2: { 0: "ui-nswtc716", 1: "ui-nswtc717", 2: "ui-nswtc718", 3: "ui-nswtc719", 4: "ui-nswtc71a", 5: "ui-nswtc71b", 6: "ui-nswtc71c" }, 3: { 0: "ui-nswtc71d", 1: "ui-nswtc71e", 2: "ui-nswtc71f", 3: "ui-nswtc71g", 4: "ui-nswtc71h", 5: "ui-nswtc71i", 6: "ui-nswtc71j" }, 4: { 0: "ui-nswtc71k", 1: "ui-nswtc71l", 2: "ui-nswtc71m", 3: "ui-nswtc71n", 4: "ui-nswtc71o", 5: "ui-nswtc71p", 6: "ui-nswtc71q" }, 5: { 0: "ui-nswtc71r", 1: "ui-nswtc71s", 2: "ui-nswtc71t", 3: "ui-nswtc71u", 4: "ui-nswtc71v", 5: "ui-nswtc71w", 6: "ui-nswtc71x" }, auto: { 0: "ui-nswtc70", 1: "ui-nswtc71", 2: "ui-nswtc72", 3: "ui-nswtc73", 4: "ui-nswtc74", 5: "ui-nswtc75", 6: "ui-nswtc76" }, fill: { 0: "ui-nswtc77", 1: "ui-nswtc78", 2: "ui-nswtc79", 3: "ui-nswtc7a", 4: "ui-nswtc7b", 5: "ui-nswtc7c", 6: "ui-nswtc7d" }, min: { 0: "ui-nswtc7e", 1: "ui-nswtc7f", 2: "ui-nswtc7g", 3: "ui-nswtc7h", 4: "ui-nswtc7i", 5: "ui-nswtc7j", 6: "ui-nswtc7k" }, stretch: { 0: "ui-nswtc7l", 1: "ui-nswtc7m", 2: "ui-nswtc7n", 3: "ui-nswtc7o", 4: "ui-nswtc7p", 5: "ui-nswtc7q", 6: "ui-nswtc7r" } };
|
|
198
198
|
function width(props) {
|
|
199
199
|
return _responsiveClassName(options, props.width);
|
|
200
200
|
}
|
package/dist/css.d.cts
CHANGED
|
@@ -14871,7 +14871,7 @@ export declare const vars: {
|
|
|
14871
14871
|
}
|
|
14872
14872
|
|
|
14873
14873
|
/** @public */
|
|
14874
|
-
export declare type Width = ContainerWidth | 'auto' | 'fill' | 'stretch'
|
|
14874
|
+
export declare type Width = ContainerWidth | 'auto' | 'fill' | 'stretch' | 'min'
|
|
14875
14875
|
|
|
14876
14876
|
/** @public */
|
|
14877
14877
|
export declare function width(props: WidthStyleProps): string | undefined
|
package/dist/css.d.ts
CHANGED
|
@@ -14871,7 +14871,7 @@ export declare const vars: {
|
|
|
14871
14871
|
}
|
|
14872
14872
|
|
|
14873
14873
|
/** @public */
|
|
14874
|
-
export declare type Width = ContainerWidth | 'auto' | 'fill' | 'stretch'
|
|
14874
|
+
export declare type Width = ContainerWidth | 'auto' | 'fill' | 'stretch' | 'min'
|
|
14875
14875
|
|
|
14876
14876
|
/** @public */
|
|
14877
14877
|
export declare function width(props: WidthStyleProps): string | undefined
|
package/dist/css.js
CHANGED
|
@@ -192,7 +192,7 @@ var options$1 = { clip: { 0: "ui-e4u24p0", 1: "ui-e4u24p1", 2: "ui-e4u24p2", 3:
|
|
|
192
192
|
function textOverflow(props) {
|
|
193
193
|
return _responsiveClassName(options$1, props.textOverflow);
|
|
194
194
|
}
|
|
195
|
-
var options = { 0: { 0: "ui-
|
|
195
|
+
var options = { 0: { 0: "ui-nswtc7s", 1: "ui-nswtc7t", 2: "ui-nswtc7u", 3: "ui-nswtc7v", 4: "ui-nswtc7w", 5: "ui-nswtc7x", 6: "ui-nswtc7y" }, 1: { 0: "ui-nswtc7z", 1: "ui-nswtc710", 2: "ui-nswtc711", 3: "ui-nswtc712", 4: "ui-nswtc713", 5: "ui-nswtc714", 6: "ui-nswtc715" }, 2: { 0: "ui-nswtc716", 1: "ui-nswtc717", 2: "ui-nswtc718", 3: "ui-nswtc719", 4: "ui-nswtc71a", 5: "ui-nswtc71b", 6: "ui-nswtc71c" }, 3: { 0: "ui-nswtc71d", 1: "ui-nswtc71e", 2: "ui-nswtc71f", 3: "ui-nswtc71g", 4: "ui-nswtc71h", 5: "ui-nswtc71i", 6: "ui-nswtc71j" }, 4: { 0: "ui-nswtc71k", 1: "ui-nswtc71l", 2: "ui-nswtc71m", 3: "ui-nswtc71n", 4: "ui-nswtc71o", 5: "ui-nswtc71p", 6: "ui-nswtc71q" }, 5: { 0: "ui-nswtc71r", 1: "ui-nswtc71s", 2: "ui-nswtc71t", 3: "ui-nswtc71u", 4: "ui-nswtc71v", 5: "ui-nswtc71w", 6: "ui-nswtc71x" }, auto: { 0: "ui-nswtc70", 1: "ui-nswtc71", 2: "ui-nswtc72", 3: "ui-nswtc73", 4: "ui-nswtc74", 5: "ui-nswtc75", 6: "ui-nswtc76" }, fill: { 0: "ui-nswtc77", 1: "ui-nswtc78", 2: "ui-nswtc79", 3: "ui-nswtc7a", 4: "ui-nswtc7b", 5: "ui-nswtc7c", 6: "ui-nswtc7d" }, min: { 0: "ui-nswtc7e", 1: "ui-nswtc7f", 2: "ui-nswtc7g", 3: "ui-nswtc7h", 4: "ui-nswtc7i", 5: "ui-nswtc7j", 6: "ui-nswtc7k" }, stretch: { 0: "ui-nswtc7l", 1: "ui-nswtc7m", 2: "ui-nswtc7n", 3: "ui-nswtc7o", 4: "ui-nswtc7p", 5: "ui-nswtc7q", 6: "ui-nswtc7r" } };
|
|
196
196
|
function width(props) {
|
|
197
197
|
return _responsiveClassName(options, props.width);
|
|
198
198
|
}
|
package/dist/index.cjs
CHANGED
|
@@ -306,7 +306,7 @@ function Badge(props) {
|
|
|
306
306
|
let t7;
|
|
307
307
|
$[12] !== children || $[13] !== fontSize ? (t7 = /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Text, { size: fontSize, children }), $[12] = children, $[13] = fontSize, $[14] = t7) : t7 = $[14];
|
|
308
308
|
let t8;
|
|
309
|
-
return $[15] !== as || $[16] !== padding || $[17] !== radius || $[18] !== rest || $[19] !== t6 || $[20] !== t7 ? (t8 = /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Box, { "data-ui": "Badge", ...rest, as, className: t6, display: "
|
|
309
|
+
return $[15] !== as || $[16] !== padding || $[17] !== radius || $[18] !== rest || $[19] !== t6 || $[20] !== t7 ? (t8 = /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Box, { "data-ui": "Badge", ...rest, as, className: t6, display: "flex", maxWidth: "fill", padding, radius, width: "min", children: t7 }), $[15] = as, $[16] = padding, $[17] = radius, $[18] = rest, $[19] = t6, $[20] = t7, $[21] = t8) : t8 = $[21], t8;
|
|
310
310
|
}
|
|
311
311
|
const DEFAULT_CHECKBOX_ELEMENT = "input";
|
|
312
312
|
function Checkbox(props) {
|
|
@@ -463,145 +463,6 @@ class ErrorBoundary extends react.Component {
|
|
|
463
463
|
return this.props.children;
|
|
464
464
|
}
|
|
465
465
|
}
|
|
466
|
-
const DEFAULT_SR_ONLY_ELEMENT = "span";
|
|
467
|
-
function SrOnly(props) {
|
|
468
|
-
const $ = reactCompilerRuntime.c(12), t0 = props;
|
|
469
|
-
let children, className, rest, t1;
|
|
470
|
-
$[0] !== t0 ? ({
|
|
471
|
-
as: t1,
|
|
472
|
-
children,
|
|
473
|
-
className,
|
|
474
|
-
...rest
|
|
475
|
-
} = t0, $[0] = t0, $[1] = children, $[2] = className, $[3] = rest, $[4] = t1) : (children = $[1], className = $[2], rest = $[3], t1 = $[4]);
|
|
476
|
-
const Element2 = t1 === void 0 ? DEFAULT_SR_ONLY_ELEMENT : t1;
|
|
477
|
-
let t2;
|
|
478
|
-
$[5] !== className ? (t2 = css.srOnly({
|
|
479
|
-
className
|
|
480
|
-
}), $[5] = className, $[6] = t2) : t2 = $[6];
|
|
481
|
-
let t3;
|
|
482
|
-
return $[7] !== Element2 || $[8] !== children || $[9] !== rest || $[10] !== t2 ? (t3 = /* @__PURE__ */ jsxRuntime.jsx(Element2, { "data-ui": "SrOnly", ...rest, "aria-hidden": !0, className: t2, children }), $[7] = Element2, $[8] = children, $[9] = rest, $[10] = t2, $[11] = t3) : t3 = $[11], t3;
|
|
483
|
-
}
|
|
484
|
-
const DEFAULT_VIRTUAL_LIST_ELEMENT = "div";
|
|
485
|
-
function VirtualList(props) {
|
|
486
|
-
const $ = reactCompilerRuntime.c(58), t0 = props;
|
|
487
|
-
let forwardedRef, getItemKey, onChange, renderItem, rest, t1, t2, t3;
|
|
488
|
-
$[0] !== t0 ? ({
|
|
489
|
-
as: t1,
|
|
490
|
-
gap: t2,
|
|
491
|
-
getItemKey,
|
|
492
|
-
items: t3,
|
|
493
|
-
onChange,
|
|
494
|
-
renderItem,
|
|
495
|
-
ref: forwardedRef,
|
|
496
|
-
...rest
|
|
497
|
-
} = t0, $[0] = t0, $[1] = forwardedRef, $[2] = getItemKey, $[3] = onChange, $[4] = renderItem, $[5] = rest, $[6] = t1, $[7] = t2, $[8] = t3) : (forwardedRef = $[1], getItemKey = $[2], onChange = $[3], renderItem = $[4], rest = $[5], t1 = $[6], t2 = $[7], t3 = $[8]);
|
|
498
|
-
const as = t1 === void 0 ? DEFAULT_VIRTUAL_LIST_ELEMENT : t1, gap = t2 === void 0 ? 0 : t2;
|
|
499
|
-
let t4;
|
|
500
|
-
$[9] !== t3 ? (t4 = t3 === void 0 ? [] : t3, $[9] = t3, $[10] = t4) : t4 = $[10];
|
|
501
|
-
const items = t4, ref = react.useRef(null), wrapperRef = react.useRef(null), [scrollTop, setScrollTop] = react.useState(0), [scrollHeight, setScrollHeight] = react.useState(0), [itemHeight, setItemHeight] = react.useState(-1), [gapValue, setGapValue] = react.useState(0);
|
|
502
|
-
let t5;
|
|
503
|
-
$[11] === Symbol.for("react.memo_cache_sentinel") ? (t5 = () => ref.current, $[11] = t5) : t5 = $[11], react.useImperativeHandle(forwardedRef, t5);
|
|
504
|
-
let t6, t7;
|
|
505
|
-
$[12] === Symbol.for("react.memo_cache_sentinel") ? (t6 = () => {
|
|
506
|
-
if (!ref.current)
|
|
507
|
-
return;
|
|
508
|
-
const scrollEl = findScrollable(ref.current.parentNode);
|
|
509
|
-
if (scrollEl) {
|
|
510
|
-
if (!(scrollEl instanceof HTMLElement))
|
|
511
|
-
return;
|
|
512
|
-
const handleScroll = () => {
|
|
513
|
-
setScrollTop(scrollEl.scrollTop);
|
|
514
|
-
};
|
|
515
|
-
scrollEl.addEventListener("scroll", handleScroll, {
|
|
516
|
-
passive: !0
|
|
517
|
-
});
|
|
518
|
-
const ro = new _visualEditing._ResizeObserver((entries) => {
|
|
519
|
-
setScrollHeight(entries[0].contentRect.height);
|
|
520
|
-
});
|
|
521
|
-
return ro.observe(scrollEl), handleScroll(), () => {
|
|
522
|
-
scrollEl.removeEventListener("scroll", handleScroll), ro.unobserve(scrollEl), ro.disconnect();
|
|
523
|
-
};
|
|
524
|
-
}
|
|
525
|
-
const handleScroll_0 = () => {
|
|
526
|
-
setScrollTop(window.scrollY);
|
|
527
|
-
}, handleResize = () => {
|
|
528
|
-
setScrollHeight(window.innerHeight);
|
|
529
|
-
};
|
|
530
|
-
return window.addEventListener("scroll", handleScroll_0, {
|
|
531
|
-
passive: !0
|
|
532
|
-
}), window.addEventListener("resize", handleResize), setScrollHeight(window.innerHeight), handleScroll_0(), () => {
|
|
533
|
-
window.removeEventListener("scroll", handleScroll_0), window.removeEventListener("resize", handleResize);
|
|
534
|
-
};
|
|
535
|
-
}, t7 = [], $[12] = t6, $[13] = t7) : (t6 = $[12], t7 = $[13]), react.useEffect(t6, t7);
|
|
536
|
-
const len = items.length, height = itemHeight ? len * (itemHeight + gapValue) - gapValue : 0, fromIndex = height ? Math.max(Math.floor(scrollTop / height * len) - 2, 0) : 0, toIndex = height ? Math.ceil((scrollTop + scrollHeight) / height * len) + 1 : 0;
|
|
537
|
-
let t8, t9;
|
|
538
|
-
$[14] !== fromIndex || $[15] !== gapValue || $[16] !== itemHeight || $[17] !== onChange || $[18] !== scrollHeight || $[19] !== scrollTop || $[20] !== toIndex ? (t8 = () => {
|
|
539
|
-
onChange?.({
|
|
540
|
-
fromIndex,
|
|
541
|
-
gap: gapValue,
|
|
542
|
-
itemHeight,
|
|
543
|
-
scrollHeight,
|
|
544
|
-
scrollTop,
|
|
545
|
-
toIndex
|
|
546
|
-
});
|
|
547
|
-
}, t9 = [fromIndex, gapValue, itemHeight, onChange, scrollHeight, scrollTop, toIndex], $[14] = fromIndex, $[15] = gapValue, $[16] = itemHeight, $[17] = onChange, $[18] = scrollHeight, $[19] = scrollTop, $[20] = toIndex, $[21] = t8, $[22] = t9) : (t8 = $[21], t9 = $[22]), react.useEffect(t8, t9);
|
|
548
|
-
let t10;
|
|
549
|
-
bb0: {
|
|
550
|
-
if (!renderItem || items.length === 0) {
|
|
551
|
-
t10 = null;
|
|
552
|
-
break bb0;
|
|
553
|
-
}
|
|
554
|
-
if (itemHeight === -1) {
|
|
555
|
-
let t113;
|
|
556
|
-
$[23] === Symbol.for("react.memo_cache_sentinel") ? (t113 = (el) => el ? setItemHeight(el.offsetHeight) : void 0, $[23] = t113) : t113 = $[23];
|
|
557
|
-
let t122;
|
|
558
|
-
$[24] !== items[0] || $[25] !== renderItem ? (t122 = renderItem(items[0]), $[24] = items[0], $[25] = renderItem, $[26] = t122) : t122 = $[26];
|
|
559
|
-
let t132;
|
|
560
|
-
$[27] !== t122 ? (t132 = /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Box, { ref: t113, insetTop: 0, insetLeft: 0, insetRight: 0, position: "absolute", children: t122 }, 0), $[27] = t122, $[28] = t132) : t132 = $[28];
|
|
561
|
-
let t142;
|
|
562
|
-
$[29] === Symbol.for("react.memo_cache_sentinel") ? (t142 = (el_0) => el_0 ? setGapValue(el_0.offsetHeight) : void 0, $[29] = t142) : t142 = $[29];
|
|
563
|
-
const t15 = css.vars.space[gap];
|
|
564
|
-
let t16;
|
|
565
|
-
$[30] !== t15 ? (t16 = /* @__PURE__ */ jsxRuntime.jsx("div", { ref: t142, style: {
|
|
566
|
-
height: t15
|
|
567
|
-
} }), $[30] = t15, $[31] = t16) : t16 = $[31];
|
|
568
|
-
let t17;
|
|
569
|
-
$[32] !== t132 || $[33] !== t16 ? (t17 = [/* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
570
|
-
t132,
|
|
571
|
-
t16
|
|
572
|
-
] })], $[32] = t132, $[33] = t16, $[34] = t17) : t17 = $[34], t10 = t17;
|
|
573
|
-
break bb0;
|
|
574
|
-
}
|
|
575
|
-
let t112;
|
|
576
|
-
if ($[35] !== fromIndex || $[36] !== gapValue || $[37] !== getItemKey || $[38] !== itemHeight || $[39] !== items || $[40] !== renderItem || $[41] !== toIndex) {
|
|
577
|
-
let t122;
|
|
578
|
-
$[43] !== fromIndex || $[44] !== gapValue || $[45] !== getItemKey || $[46] !== itemHeight || $[47] !== renderItem ? (t122 = (item, _itemIndex) => {
|
|
579
|
-
const itemIndex = fromIndex + _itemIndex, node = renderItem(item), key = getItemKey ? getItemKey(item, itemIndex) : itemIndex;
|
|
580
|
-
return /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Box, { insetLeft: 0, insetRight: 0, position: "absolute", style: {
|
|
581
|
-
top: itemIndex * (itemHeight + gapValue) - gapValue
|
|
582
|
-
}, children: node }, key);
|
|
583
|
-
}, $[43] = fromIndex, $[44] = gapValue, $[45] = getItemKey, $[46] = itemHeight, $[47] = renderItem, $[48] = t122) : t122 = $[48], t112 = items.slice(fromIndex, toIndex).map(t122), $[35] = fromIndex, $[36] = gapValue, $[37] = getItemKey, $[38] = itemHeight, $[39] = items, $[40] = renderItem, $[41] = toIndex, $[42] = t112;
|
|
584
|
-
} else
|
|
585
|
-
t112 = $[42];
|
|
586
|
-
t10 = t112;
|
|
587
|
-
}
|
|
588
|
-
const children = t10;
|
|
589
|
-
let t11, t12;
|
|
590
|
-
$[49] !== height ? (t12 = {
|
|
591
|
-
height
|
|
592
|
-
}, $[49] = height, $[50] = t12) : t12 = $[50], t11 = t12;
|
|
593
|
-
const wrapperStyle = t11;
|
|
594
|
-
let t13;
|
|
595
|
-
$[51] !== children || $[52] !== wrapperStyle ? (t13 = /* @__PURE__ */ jsxRuntime.jsx("div", { ref: wrapperRef, style: wrapperStyle, children }), $[51] = children, $[52] = wrapperStyle, $[53] = t13) : t13 = $[53];
|
|
596
|
-
let t14;
|
|
597
|
-
return $[54] !== as || $[55] !== rest || $[56] !== t13 ? (t14 = /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Box, { "data-ui": "VirtualList", ...rest, as, position: "relative", ref, children: t13 }), $[54] = as, $[55] = rest, $[56] = t13, $[57] = t14) : t14 = $[57], t14;
|
|
598
|
-
}
|
|
599
|
-
function findScrollable(parentNode) {
|
|
600
|
-
let _scrollEl = parentNode;
|
|
601
|
-
for (; _scrollEl && !_isScrollable(_scrollEl); )
|
|
602
|
-
_scrollEl = _scrollEl.parentNode;
|
|
603
|
-
return _scrollEl;
|
|
604
|
-
}
|
|
605
466
|
const DEFAULT_RADIO_ELEMENT = "input";
|
|
606
467
|
function Radio(props) {
|
|
607
468
|
const $ = reactCompilerRuntime.c(25), t0 = props;
|
|
@@ -686,6 +547,24 @@ function Select(props) {
|
|
|
686
547
|
t16
|
|
687
548
|
] }), $[34] = t12, $[35] = t16, $[36] = t9, $[37] = t17) : t17 = $[37], t17;
|
|
688
549
|
}
|
|
550
|
+
const DEFAULT_SR_ONLY_ELEMENT = "span";
|
|
551
|
+
function SrOnly(props) {
|
|
552
|
+
const $ = reactCompilerRuntime.c(12), t0 = props;
|
|
553
|
+
let children, className, rest, t1;
|
|
554
|
+
$[0] !== t0 ? ({
|
|
555
|
+
as: t1,
|
|
556
|
+
children,
|
|
557
|
+
className,
|
|
558
|
+
...rest
|
|
559
|
+
} = t0, $[0] = t0, $[1] = children, $[2] = className, $[3] = rest, $[4] = t1) : (children = $[1], className = $[2], rest = $[3], t1 = $[4]);
|
|
560
|
+
const Element2 = t1 === void 0 ? DEFAULT_SR_ONLY_ELEMENT : t1;
|
|
561
|
+
let t2;
|
|
562
|
+
$[5] !== className ? (t2 = css.srOnly({
|
|
563
|
+
className
|
|
564
|
+
}), $[5] = className, $[6] = t2) : t2 = $[6];
|
|
565
|
+
let t3;
|
|
566
|
+
return $[7] !== Element2 || $[8] !== children || $[9] !== rest || $[10] !== t2 ? (t3 = /* @__PURE__ */ jsxRuntime.jsx(Element2, { "data-ui": "SrOnly", ...rest, "aria-hidden": !0, className: t2, children }), $[7] = Element2, $[8] = children, $[9] = rest, $[10] = t2, $[11] = t3) : t3 = $[11], t3;
|
|
567
|
+
}
|
|
689
568
|
const DEFAULT_SWITCH_ELEMENT = "input";
|
|
690
569
|
function Switch(props) {
|
|
691
570
|
const $ = reactCompilerRuntime.c(31), t0 = props;
|
|
@@ -724,7 +603,7 @@ function Switch(props) {
|
|
|
724
603
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: css._switchThumb() })
|
|
725
604
|
] }), $[24] = t14) : t14 = $[24];
|
|
726
605
|
let t15;
|
|
727
|
-
return $[25] !== style || $[26] !== t13 || $[27] !== t5 || $[28] !== t6 || $[29] !== t7 ? (t15 = /* @__PURE__ */ jsxRuntime.jsxs(_visualEditing.Box, { className: t5, "data-checked": t6, "data-indeterminate": t7, "data-ui": "Switch", display: "
|
|
606
|
+
return $[25] !== style || $[26] !== t13 || $[27] !== t5 || $[28] !== t6 || $[29] !== t7 ? (t15 = /* @__PURE__ */ jsxRuntime.jsxs(_visualEditing.Box, { className: t5, "data-checked": t6, "data-indeterminate": t7, "data-ui": "Switch", display: "block", position: "relative", style, children: [
|
|
728
607
|
t13,
|
|
729
608
|
t14
|
|
730
609
|
] }), $[25] = style, $[26] = t13, $[27] = t5, $[28] = t6, $[29] = t7, $[30] = t15) : t15 = $[30], t15;
|
|
@@ -2039,6 +1918,127 @@ function TreeItem(props) {
|
|
|
2039
1918
|
/* @__PURE__ */ jsxRuntime.jsx(TreeContext.Provider, { value: contextValue, children: children && /* @__PURE__ */ jsxRuntime.jsx(TreeGroup, { expanded, children }) })
|
|
2040
1919
|
] });
|
|
2041
1920
|
}
|
|
1921
|
+
const DEFAULT_VIRTUAL_LIST_ELEMENT = "div";
|
|
1922
|
+
function VirtualList(props) {
|
|
1923
|
+
const $ = reactCompilerRuntime.c(58), t0 = props;
|
|
1924
|
+
let forwardedRef, getItemKey, onChange, renderItem, rest, t1, t2, t3;
|
|
1925
|
+
$[0] !== t0 ? ({
|
|
1926
|
+
as: t1,
|
|
1927
|
+
gap: t2,
|
|
1928
|
+
getItemKey,
|
|
1929
|
+
items: t3,
|
|
1930
|
+
onChange,
|
|
1931
|
+
renderItem,
|
|
1932
|
+
ref: forwardedRef,
|
|
1933
|
+
...rest
|
|
1934
|
+
} = t0, $[0] = t0, $[1] = forwardedRef, $[2] = getItemKey, $[3] = onChange, $[4] = renderItem, $[5] = rest, $[6] = t1, $[7] = t2, $[8] = t3) : (forwardedRef = $[1], getItemKey = $[2], onChange = $[3], renderItem = $[4], rest = $[5], t1 = $[6], t2 = $[7], t3 = $[8]);
|
|
1935
|
+
const as = t1 === void 0 ? DEFAULT_VIRTUAL_LIST_ELEMENT : t1, gap = t2 === void 0 ? 0 : t2;
|
|
1936
|
+
let t4;
|
|
1937
|
+
$[9] !== t3 ? (t4 = t3 === void 0 ? [] : t3, $[9] = t3, $[10] = t4) : t4 = $[10];
|
|
1938
|
+
const items = t4, ref = react.useRef(null), wrapperRef = react.useRef(null), [scrollTop, setScrollTop] = react.useState(0), [scrollHeight, setScrollHeight] = react.useState(0), [itemHeight, setItemHeight] = react.useState(-1), [gapValue, setGapValue] = react.useState(0);
|
|
1939
|
+
let t5;
|
|
1940
|
+
$[11] === Symbol.for("react.memo_cache_sentinel") ? (t5 = () => ref.current, $[11] = t5) : t5 = $[11], react.useImperativeHandle(forwardedRef, t5);
|
|
1941
|
+
let t6, t7;
|
|
1942
|
+
$[12] === Symbol.for("react.memo_cache_sentinel") ? (t6 = () => {
|
|
1943
|
+
if (!ref.current)
|
|
1944
|
+
return;
|
|
1945
|
+
const scrollEl = findScrollable(ref.current.parentNode);
|
|
1946
|
+
if (scrollEl) {
|
|
1947
|
+
if (!(scrollEl instanceof HTMLElement))
|
|
1948
|
+
return;
|
|
1949
|
+
const handleScroll = () => {
|
|
1950
|
+
setScrollTop(scrollEl.scrollTop);
|
|
1951
|
+
};
|
|
1952
|
+
scrollEl.addEventListener("scroll", handleScroll, {
|
|
1953
|
+
passive: !0
|
|
1954
|
+
});
|
|
1955
|
+
const ro = new _visualEditing._ResizeObserver((entries) => {
|
|
1956
|
+
setScrollHeight(entries[0].contentRect.height);
|
|
1957
|
+
});
|
|
1958
|
+
return ro.observe(scrollEl), handleScroll(), () => {
|
|
1959
|
+
scrollEl.removeEventListener("scroll", handleScroll), ro.unobserve(scrollEl), ro.disconnect();
|
|
1960
|
+
};
|
|
1961
|
+
}
|
|
1962
|
+
const handleScroll_0 = () => {
|
|
1963
|
+
setScrollTop(window.scrollY);
|
|
1964
|
+
}, handleResize = () => {
|
|
1965
|
+
setScrollHeight(window.innerHeight);
|
|
1966
|
+
};
|
|
1967
|
+
return window.addEventListener("scroll", handleScroll_0, {
|
|
1968
|
+
passive: !0
|
|
1969
|
+
}), window.addEventListener("resize", handleResize), setScrollHeight(window.innerHeight), handleScroll_0(), () => {
|
|
1970
|
+
window.removeEventListener("scroll", handleScroll_0), window.removeEventListener("resize", handleResize);
|
|
1971
|
+
};
|
|
1972
|
+
}, t7 = [], $[12] = t6, $[13] = t7) : (t6 = $[12], t7 = $[13]), react.useEffect(t6, t7);
|
|
1973
|
+
const len = items.length, height = itemHeight ? len * (itemHeight + gapValue) - gapValue : 0, fromIndex = height ? Math.max(Math.floor(scrollTop / height * len) - 2, 0) : 0, toIndex = height ? Math.ceil((scrollTop + scrollHeight) / height * len) + 1 : 0;
|
|
1974
|
+
let t8, t9;
|
|
1975
|
+
$[14] !== fromIndex || $[15] !== gapValue || $[16] !== itemHeight || $[17] !== onChange || $[18] !== scrollHeight || $[19] !== scrollTop || $[20] !== toIndex ? (t8 = () => {
|
|
1976
|
+
onChange?.({
|
|
1977
|
+
fromIndex,
|
|
1978
|
+
gap: gapValue,
|
|
1979
|
+
itemHeight,
|
|
1980
|
+
scrollHeight,
|
|
1981
|
+
scrollTop,
|
|
1982
|
+
toIndex
|
|
1983
|
+
});
|
|
1984
|
+
}, t9 = [fromIndex, gapValue, itemHeight, onChange, scrollHeight, scrollTop, toIndex], $[14] = fromIndex, $[15] = gapValue, $[16] = itemHeight, $[17] = onChange, $[18] = scrollHeight, $[19] = scrollTop, $[20] = toIndex, $[21] = t8, $[22] = t9) : (t8 = $[21], t9 = $[22]), react.useEffect(t8, t9);
|
|
1985
|
+
let t10;
|
|
1986
|
+
bb0: {
|
|
1987
|
+
if (!renderItem || items.length === 0) {
|
|
1988
|
+
t10 = null;
|
|
1989
|
+
break bb0;
|
|
1990
|
+
}
|
|
1991
|
+
if (itemHeight === -1) {
|
|
1992
|
+
let t113;
|
|
1993
|
+
$[23] === Symbol.for("react.memo_cache_sentinel") ? (t113 = (el) => el ? setItemHeight(el.offsetHeight) : void 0, $[23] = t113) : t113 = $[23];
|
|
1994
|
+
let t122;
|
|
1995
|
+
$[24] !== items[0] || $[25] !== renderItem ? (t122 = renderItem(items[0]), $[24] = items[0], $[25] = renderItem, $[26] = t122) : t122 = $[26];
|
|
1996
|
+
let t132;
|
|
1997
|
+
$[27] !== t122 ? (t132 = /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Box, { ref: t113, insetTop: 0, insetLeft: 0, insetRight: 0, position: "absolute", children: t122 }, 0), $[27] = t122, $[28] = t132) : t132 = $[28];
|
|
1998
|
+
let t142;
|
|
1999
|
+
$[29] === Symbol.for("react.memo_cache_sentinel") ? (t142 = (el_0) => el_0 ? setGapValue(el_0.offsetHeight) : void 0, $[29] = t142) : t142 = $[29];
|
|
2000
|
+
const t15 = css.vars.space[gap];
|
|
2001
|
+
let t16;
|
|
2002
|
+
$[30] !== t15 ? (t16 = /* @__PURE__ */ jsxRuntime.jsx("div", { ref: t142, style: {
|
|
2003
|
+
height: t15
|
|
2004
|
+
} }), $[30] = t15, $[31] = t16) : t16 = $[31];
|
|
2005
|
+
let t17;
|
|
2006
|
+
$[32] !== t132 || $[33] !== t16 ? (t17 = [/* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
2007
|
+
t132,
|
|
2008
|
+
t16
|
|
2009
|
+
] })], $[32] = t132, $[33] = t16, $[34] = t17) : t17 = $[34], t10 = t17;
|
|
2010
|
+
break bb0;
|
|
2011
|
+
}
|
|
2012
|
+
let t112;
|
|
2013
|
+
if ($[35] !== fromIndex || $[36] !== gapValue || $[37] !== getItemKey || $[38] !== itemHeight || $[39] !== items || $[40] !== renderItem || $[41] !== toIndex) {
|
|
2014
|
+
let t122;
|
|
2015
|
+
$[43] !== fromIndex || $[44] !== gapValue || $[45] !== getItemKey || $[46] !== itemHeight || $[47] !== renderItem ? (t122 = (item, _itemIndex) => {
|
|
2016
|
+
const itemIndex = fromIndex + _itemIndex, node = renderItem(item), key = getItemKey ? getItemKey(item, itemIndex) : itemIndex;
|
|
2017
|
+
return /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Box, { insetLeft: 0, insetRight: 0, position: "absolute", style: {
|
|
2018
|
+
top: itemIndex * (itemHeight + gapValue) - gapValue
|
|
2019
|
+
}, children: node }, key);
|
|
2020
|
+
}, $[43] = fromIndex, $[44] = gapValue, $[45] = getItemKey, $[46] = itemHeight, $[47] = renderItem, $[48] = t122) : t122 = $[48], t112 = items.slice(fromIndex, toIndex).map(t122), $[35] = fromIndex, $[36] = gapValue, $[37] = getItemKey, $[38] = itemHeight, $[39] = items, $[40] = renderItem, $[41] = toIndex, $[42] = t112;
|
|
2021
|
+
} else
|
|
2022
|
+
t112 = $[42];
|
|
2023
|
+
t10 = t112;
|
|
2024
|
+
}
|
|
2025
|
+
const children = t10;
|
|
2026
|
+
let t11, t12;
|
|
2027
|
+
$[49] !== height ? (t12 = {
|
|
2028
|
+
height
|
|
2029
|
+
}, $[49] = height, $[50] = t12) : t12 = $[50], t11 = t12;
|
|
2030
|
+
const wrapperStyle = t11;
|
|
2031
|
+
let t13;
|
|
2032
|
+
$[51] !== children || $[52] !== wrapperStyle ? (t13 = /* @__PURE__ */ jsxRuntime.jsx("div", { ref: wrapperRef, style: wrapperStyle, children }), $[51] = children, $[52] = wrapperStyle, $[53] = t13) : t13 = $[53];
|
|
2033
|
+
let t14;
|
|
2034
|
+
return $[54] !== as || $[55] !== rest || $[56] !== t13 ? (t14 = /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Box, { "data-ui": "VirtualList", ...rest, as, position: "relative", ref, children: t13 }), $[54] = as, $[55] = rest, $[56] = t13, $[57] = t14) : t14 = $[57], t14;
|
|
2035
|
+
}
|
|
2036
|
+
function findScrollable(parentNode) {
|
|
2037
|
+
let _scrollEl = parentNode;
|
|
2038
|
+
for (; _scrollEl && !_isScrollable(_scrollEl); )
|
|
2039
|
+
_scrollEl = _scrollEl.parentNode;
|
|
2040
|
+
return _scrollEl;
|
|
2041
|
+
}
|
|
2042
2042
|
exports.Arrow = _visualEditing.Arrow;
|
|
2043
2043
|
exports.Box = _visualEditing.Box;
|
|
2044
2044
|
exports.Button = _visualEditing.Button;
|