design-zystem 1.0.432 → 1.0.433
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/ui/index.js +237 -178
- package/dist/ui/index.mjs +85 -26
- package/package.json +1 -1
package/dist/ui/index.js
CHANGED
|
@@ -2264,7 +2264,7 @@ var Tabs = ({
|
|
|
2264
2264
|
};
|
|
2265
2265
|
|
|
2266
2266
|
// src/ui/components/ui/Modal.tsx
|
|
2267
|
-
var
|
|
2267
|
+
var import_react23 = require("react");
|
|
2268
2268
|
var RadixDialog = __toESM(require("@radix-ui/react-dialog"));
|
|
2269
2269
|
|
|
2270
2270
|
// src/ui/lib/layers.ts
|
|
@@ -2293,9 +2293,62 @@ var useAllowPortalScroll = (active, contentRef, overlayRef) => {
|
|
|
2293
2293
|
}, [active, contentRef, overlayRef]);
|
|
2294
2294
|
};
|
|
2295
2295
|
|
|
2296
|
+
// src/ui/lib/layerAbove/bodyChildContaining.ts
|
|
2297
|
+
var bodyChildContaining = (node) => {
|
|
2298
|
+
let current = node;
|
|
2299
|
+
while (current && current.parentNode !== document.body)
|
|
2300
|
+
current = current.parentNode;
|
|
2301
|
+
return current;
|
|
2302
|
+
};
|
|
2303
|
+
|
|
2304
|
+
// src/ui/lib/layerAbove/isMountedAbove.ts
|
|
2305
|
+
var isMountedAbove = (target, panel) => {
|
|
2306
|
+
const targetLayer = target instanceof Node && bodyChildContaining(target);
|
|
2307
|
+
const panelLayer = panel && bodyChildContaining(panel);
|
|
2308
|
+
if (!targetLayer || !panelLayer || targetLayer === panelLayer) return false;
|
|
2309
|
+
return Boolean(
|
|
2310
|
+
panelLayer.compareDocumentPosition(targetLayer) & Node.DOCUMENT_POSITION_FOLLOWING
|
|
2311
|
+
);
|
|
2312
|
+
};
|
|
2313
|
+
|
|
2314
|
+
// src/ui/lib/layerAbove/useKeepLayersAboveUsable.ts
|
|
2315
|
+
var import_react22 = require("react");
|
|
2316
|
+
var useKeepLayersAboveUsable = (active, contentRef) => {
|
|
2317
|
+
(0, import_react22.useEffect)(() => {
|
|
2318
|
+
if (!active) return;
|
|
2319
|
+
const isThirdPartyLayerAbove = (node) => node instanceof Element && !node.closest(SELF_FOCUS_MANAGING_LAYER) && isMountedAbove(node, contentRef.current);
|
|
2320
|
+
const keepFocusAbove = (event) => {
|
|
2321
|
+
const focusDestination = event.type === "focusin" ? event.target : event.relatedTarget;
|
|
2322
|
+
if (isThirdPartyLayerAbove(focusDestination)) event.stopPropagation();
|
|
2323
|
+
};
|
|
2324
|
+
const releasedLayers = /* @__PURE__ */ new Set();
|
|
2325
|
+
const releasePointerOnLayersAbove = () => Array.from(document.body.children).forEach((layer) => {
|
|
2326
|
+
const isUntouchedLayerAbove = layer instanceof HTMLElement && !layer.style.pointerEvents && isMountedAbove(layer, contentRef.current);
|
|
2327
|
+
if (!isUntouchedLayerAbove) return;
|
|
2328
|
+
layer.style.pointerEvents = "auto";
|
|
2329
|
+
releasedLayers.add(layer);
|
|
2330
|
+
});
|
|
2331
|
+
releasePointerOnLayersAbove();
|
|
2332
|
+
const observer = new MutationObserver(releasePointerOnLayersAbove);
|
|
2333
|
+
observer.observe(document.body, { childList: true });
|
|
2334
|
+
FOCUS_EVENTS.forEach(
|
|
2335
|
+
(type) => document.body.addEventListener(type, keepFocusAbove)
|
|
2336
|
+
);
|
|
2337
|
+
return () => {
|
|
2338
|
+
observer.disconnect();
|
|
2339
|
+
releasedLayers.forEach((layer) => layer.style.pointerEvents = "");
|
|
2340
|
+
FOCUS_EVENTS.forEach(
|
|
2341
|
+
(type) => document.body.removeEventListener(type, keepFocusAbove)
|
|
2342
|
+
);
|
|
2343
|
+
};
|
|
2344
|
+
}, [active, contentRef]);
|
|
2345
|
+
};
|
|
2346
|
+
var FOCUS_EVENTS = ["focusin", "focusout"];
|
|
2347
|
+
var SELF_FOCUS_MANAGING_LAYER = '[role="dialog"], [role="alertdialog"], [role="menu"], [role="listbox"]';
|
|
2348
|
+
|
|
2296
2349
|
// src/ui/components/ui/Modal.tsx
|
|
2297
2350
|
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
2298
|
-
var ModalDragContext = (0,
|
|
2351
|
+
var ModalDragContext = (0, import_react23.createContext)({
|
|
2299
2352
|
draggable: false,
|
|
2300
2353
|
isDragging: false,
|
|
2301
2354
|
startDrag: () => {
|
|
@@ -2311,16 +2364,17 @@ var Modal = ({
|
|
|
2311
2364
|
className,
|
|
2312
2365
|
overlayClassName
|
|
2313
2366
|
}) => {
|
|
2314
|
-
const [isDragging, setIsDragging] = (0,
|
|
2315
|
-
const [offset, setOffset] = (0,
|
|
2316
|
-
const lastPointRef = (0,
|
|
2317
|
-
const contentRef = (0,
|
|
2318
|
-
const overlayRef = (0,
|
|
2367
|
+
const [isDragging, setIsDragging] = (0, import_react23.useState)(false);
|
|
2368
|
+
const [offset, setOffset] = (0, import_react23.useState)({ x: 0, y: 0 });
|
|
2369
|
+
const lastPointRef = (0, import_react23.useRef)({ x: 0, y: 0 });
|
|
2370
|
+
const contentRef = (0, import_react23.useRef)(null);
|
|
2371
|
+
const overlayRef = (0, import_react23.useRef)(null);
|
|
2319
2372
|
useAllowPortalScroll(open, contentRef, overlayRef);
|
|
2320
|
-
(
|
|
2373
|
+
useKeepLayersAboveUsable(open, contentRef);
|
|
2374
|
+
(0, import_react23.useEffect)(() => {
|
|
2321
2375
|
if (open) setOffset({ x: 0, y: 0 });
|
|
2322
2376
|
}, [open]);
|
|
2323
|
-
(0,
|
|
2377
|
+
(0, import_react23.useEffect)(() => {
|
|
2324
2378
|
if (!draggable || !isDragging) return;
|
|
2325
2379
|
const onPointerMove = (e) => {
|
|
2326
2380
|
const dx = e.clientX - lastPointRef.current.x;
|
|
@@ -2368,6 +2422,10 @@ var Modal = ({
|
|
|
2368
2422
|
{
|
|
2369
2423
|
ref: contentRef,
|
|
2370
2424
|
onOpenAutoFocus,
|
|
2425
|
+
onInteractOutside: (event) => {
|
|
2426
|
+
if (isMountedAbove(event.target, contentRef.current))
|
|
2427
|
+
event.preventDefault();
|
|
2428
|
+
},
|
|
2371
2429
|
onClick: (event) => event.stopPropagation(),
|
|
2372
2430
|
className: cn(
|
|
2373
2431
|
MODAL_LAYER,
|
|
@@ -2400,7 +2458,7 @@ var ModalHeader = (_a) => {
|
|
|
2400
2458
|
} = _b, props = __objRest(_b, [
|
|
2401
2459
|
"className"
|
|
2402
2460
|
]);
|
|
2403
|
-
const { draggable, isDragging, startDrag } = (0,
|
|
2461
|
+
const { draggable, isDragging, startDrag } = (0, import_react23.useContext)(ModalDragContext);
|
|
2404
2462
|
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
2405
2463
|
"div",
|
|
2406
2464
|
__spreadValues({
|
|
@@ -2460,7 +2518,7 @@ var ModalFooter = (_a) => {
|
|
|
2460
2518
|
var ModalClose = RadixDialog.Close;
|
|
2461
2519
|
|
|
2462
2520
|
// src/ui/components/ui/Select.tsx
|
|
2463
|
-
var
|
|
2521
|
+
var import_react24 = require("react");
|
|
2464
2522
|
var RadixSelect2 = __toESM(require("@radix-ui/react-select"));
|
|
2465
2523
|
var RadixPopover = __toESM(require("@radix-ui/react-popover"));
|
|
2466
2524
|
|
|
@@ -2622,12 +2680,12 @@ var SelectField = (props) => {
|
|
|
2622
2680
|
hideSearchBar = false,
|
|
2623
2681
|
className
|
|
2624
2682
|
} = props;
|
|
2625
|
-
const [open, setOpen] = (0,
|
|
2626
|
-
const [searchTerm, setSearchTerm] = (0,
|
|
2627
|
-
const searchInputRef = (0,
|
|
2683
|
+
const [open, setOpen] = (0, import_react24.useState)(false);
|
|
2684
|
+
const [searchTerm, setSearchTerm] = (0, import_react24.useState)("");
|
|
2685
|
+
const searchInputRef = (0, import_react24.useRef)(null);
|
|
2628
2686
|
const sections = filterSelectItems(options, searchTerm);
|
|
2629
2687
|
const isEmpty = sections.length === 0;
|
|
2630
|
-
(0,
|
|
2688
|
+
(0, import_react24.useEffect)(() => {
|
|
2631
2689
|
if (open && !hideSearchBar) {
|
|
2632
2690
|
const id = requestAnimationFrame(() => {
|
|
2633
2691
|
var _a;
|
|
@@ -2851,7 +2909,7 @@ var Select = (props) => {
|
|
|
2851
2909
|
};
|
|
2852
2910
|
|
|
2853
2911
|
// src/ui/components/ui/TagSelect.tsx
|
|
2854
|
-
var
|
|
2912
|
+
var import_react25 = require("react");
|
|
2855
2913
|
var RadixPopover2 = __toESM(require("@radix-ui/react-popover"));
|
|
2856
2914
|
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
2857
2915
|
var TagSelect = ({
|
|
@@ -2864,9 +2922,9 @@ var TagSelect = ({
|
|
|
2864
2922
|
width,
|
|
2865
2923
|
className
|
|
2866
2924
|
}) => {
|
|
2867
|
-
const [open, setOpen] = (0,
|
|
2868
|
-
const [searchTerm, setSearchTerm] = (0,
|
|
2869
|
-
const inputRef = (0,
|
|
2925
|
+
const [open, setOpen] = (0, import_react25.useState)(false);
|
|
2926
|
+
const [searchTerm, setSearchTerm] = (0, import_react25.useState)("");
|
|
2927
|
+
const inputRef = (0, import_react25.useRef)(null);
|
|
2870
2928
|
const selectedValues = new Set(value.map((v) => v.value));
|
|
2871
2929
|
const filteredOptions = options.filter(
|
|
2872
2930
|
(o) => !selectedValues.has(o.value) && o.label.toLowerCase().includes(searchTerm.toLowerCase())
|
|
@@ -2977,7 +3035,7 @@ var TagSelect = ({
|
|
|
2977
3035
|
};
|
|
2978
3036
|
|
|
2979
3037
|
// src/ui/components/ui/TagLevelPicker.tsx
|
|
2980
|
-
var
|
|
3038
|
+
var import_react26 = require("react");
|
|
2981
3039
|
var RadixPopover3 = __toESM(require("@radix-ui/react-popover"));
|
|
2982
3040
|
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
2983
3041
|
var TEXT_COLOR = "#15303B";
|
|
@@ -3087,7 +3145,7 @@ var TagChip = ({
|
|
|
3087
3145
|
const sizeStyle = SIZE_STYLES[size];
|
|
3088
3146
|
const hasLevel = tag.level != null;
|
|
3089
3147
|
const current = hasLevel ? getLevelStyle(tag.level, levelCount) : NO_LEVEL_STYLE;
|
|
3090
|
-
const levels = (0,
|
|
3148
|
+
const levels = (0, import_react26.useMemo)(
|
|
3091
3149
|
() => Array.from({ length: levelCount }, (_, i) => i + 1),
|
|
3092
3150
|
[levelCount]
|
|
3093
3151
|
);
|
|
@@ -3217,11 +3275,11 @@ var TagLevelPicker = ({
|
|
|
3217
3275
|
className
|
|
3218
3276
|
}) => {
|
|
3219
3277
|
const sizeStyle = SIZE_STYLES[size];
|
|
3220
|
-
const [query, setQuery] = (0,
|
|
3221
|
-
const [isFocused, setIsFocused] = (0,
|
|
3222
|
-
const [isDismissed, setIsDismissed] = (0,
|
|
3223
|
-
const boxRef = (0,
|
|
3224
|
-
const [openTagValue, setOpenTagValue] = (0,
|
|
3278
|
+
const [query, setQuery] = (0, import_react26.useState)("");
|
|
3279
|
+
const [isFocused, setIsFocused] = (0, import_react26.useState)(false);
|
|
3280
|
+
const [isDismissed, setIsDismissed] = (0, import_react26.useState)(false);
|
|
3281
|
+
const boxRef = (0, import_react26.useRef)(null);
|
|
3282
|
+
const [openTagValue, setOpenTagValue] = (0, import_react26.useState)(null);
|
|
3225
3283
|
const trimmed = query.trim().toLowerCase();
|
|
3226
3284
|
const matching = trimmed ? options.filter((option) => option.label.toLowerCase().includes(trimmed)) : options;
|
|
3227
3285
|
const suggestions = maxSuggestions != null ? matching.slice(0, maxSuggestions) : matching;
|
|
@@ -3379,7 +3437,7 @@ var warnDeprecatedTableProp = (component, prop, replacement) => {
|
|
|
3379
3437
|
};
|
|
3380
3438
|
|
|
3381
3439
|
// src/ui/components/ui/Pagination.tsx
|
|
3382
|
-
var
|
|
3440
|
+
var import_react27 = require("react");
|
|
3383
3441
|
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
3384
3442
|
var getPageNumbers = (current, total) => {
|
|
3385
3443
|
if (total <= 5) return Array.from({ length: total }, (_, i) => i + 1);
|
|
@@ -3397,7 +3455,7 @@ var Pagination = ({
|
|
|
3397
3455
|
summaryLabel
|
|
3398
3456
|
}) => {
|
|
3399
3457
|
const totalPages = Math.max(1, Math.ceil(totalItems / itemsPerPage));
|
|
3400
|
-
const pages = (0,
|
|
3458
|
+
const pages = (0, import_react27.useMemo)(
|
|
3401
3459
|
() => getPageNumbers(currentPage, totalPages),
|
|
3402
3460
|
[currentPage, totalPages]
|
|
3403
3461
|
);
|
|
@@ -4031,7 +4089,7 @@ var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
|
4031
4089
|
var TableHeaderRow = ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("tr", { children });
|
|
4032
4090
|
|
|
4033
4091
|
// src/ui/components/ui/table/TableHeaderCell.tsx
|
|
4034
|
-
var
|
|
4092
|
+
var import_react28 = require("react");
|
|
4035
4093
|
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
4036
4094
|
var SURFACE_CLASS = {
|
|
4037
4095
|
white: "bg-white",
|
|
@@ -4051,7 +4109,7 @@ var TableHeaderCell = ({
|
|
|
4051
4109
|
sortOrder = null,
|
|
4052
4110
|
onClick
|
|
4053
4111
|
}) => {
|
|
4054
|
-
const [hovered, setHovered] = (0,
|
|
4112
|
+
const [hovered, setHovered] = (0, import_react28.useState)(false);
|
|
4055
4113
|
const showArrow = useSort && (isSort || hovered);
|
|
4056
4114
|
const arrowChar = isSort && sortOrder === "asc" ? "\u2191" : "\u2193";
|
|
4057
4115
|
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
@@ -4107,9 +4165,9 @@ var TableHeaderCell = ({
|
|
|
4107
4165
|
};
|
|
4108
4166
|
|
|
4109
4167
|
// src/ui/components/ui/table/TableRow.tsx
|
|
4110
|
-
var
|
|
4168
|
+
var import_react29 = require("react");
|
|
4111
4169
|
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
4112
|
-
var TableRow = (0,
|
|
4170
|
+
var TableRow = (0, import_react29.forwardRef)(
|
|
4113
4171
|
({
|
|
4114
4172
|
children,
|
|
4115
4173
|
onClick,
|
|
@@ -4488,11 +4546,11 @@ var formatNameWithInitial = (firstname, lastname) => {
|
|
|
4488
4546
|
};
|
|
4489
4547
|
|
|
4490
4548
|
// src/ui/components/ui/Avatar.tsx
|
|
4491
|
-
var
|
|
4549
|
+
var import_react30 = require("react");
|
|
4492
4550
|
var RadixAvatar = __toESM(require("@radix-ui/react-avatar"));
|
|
4493
4551
|
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
4494
|
-
var AvatarSizeContext = (0,
|
|
4495
|
-
var useAvatarSize = () => (0,
|
|
4552
|
+
var AvatarSizeContext = (0, import_react30.createContext)(40);
|
|
4553
|
+
var useAvatarSize = () => (0, import_react30.useContext)(AvatarSizeContext);
|
|
4496
4554
|
var BADGE_BG_CLASS = {
|
|
4497
4555
|
"blue-700": "bg-blue-700",
|
|
4498
4556
|
"blue-900": "bg-blue-900",
|
|
@@ -4523,7 +4581,7 @@ var BADGE_ICON_COLOR_CLASS = {
|
|
|
4523
4581
|
"orange-600": "text-orange-600",
|
|
4524
4582
|
"purple-700": "text-purple-700"
|
|
4525
4583
|
};
|
|
4526
|
-
var Avatar = (0,
|
|
4584
|
+
var Avatar = (0, import_react30.forwardRef)(
|
|
4527
4585
|
(_a, ref) => {
|
|
4528
4586
|
var _b = _a, {
|
|
4529
4587
|
size = 40,
|
|
@@ -4588,7 +4646,7 @@ var Avatar = (0, import_react29.forwardRef)(
|
|
|
4588
4646
|
}
|
|
4589
4647
|
);
|
|
4590
4648
|
Avatar.displayName = "Avatar";
|
|
4591
|
-
var AvatarImage = (0,
|
|
4649
|
+
var AvatarImage = (0, import_react30.forwardRef)((_a, ref) => {
|
|
4592
4650
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
4593
4651
|
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
4594
4652
|
RadixAvatar.Image,
|
|
@@ -4614,7 +4672,7 @@ var FALLBACK_COLOR_CLASS = {
|
|
|
4614
4672
|
"orange-600": "bg-orange-600 text-white",
|
|
4615
4673
|
"purple-700": "bg-purple-700 text-white"
|
|
4616
4674
|
};
|
|
4617
|
-
var AvatarFallback = (0,
|
|
4675
|
+
var AvatarFallback = (0, import_react30.forwardRef)(
|
|
4618
4676
|
(_a, ref) => {
|
|
4619
4677
|
var _b = _a, {
|
|
4620
4678
|
color = "grey-600",
|
|
@@ -4649,7 +4707,7 @@ var AvatarFallback = (0, import_react29.forwardRef)(
|
|
|
4649
4707
|
}
|
|
4650
4708
|
);
|
|
4651
4709
|
AvatarFallback.displayName = "AvatarFallback";
|
|
4652
|
-
var AvatarBadge = (0,
|
|
4710
|
+
var AvatarBadge = (0, import_react30.forwardRef)(
|
|
4653
4711
|
(_a, ref) => {
|
|
4654
4712
|
var _b = _a, { size, className, style } = _b, props = __objRest(_b, ["size", "className", "style"]);
|
|
4655
4713
|
const avatarSize = useAvatarSize();
|
|
@@ -4680,14 +4738,14 @@ var AvatarGroup = (_a) => {
|
|
|
4680
4738
|
"className",
|
|
4681
4739
|
"children"
|
|
4682
4740
|
]);
|
|
4683
|
-
const items =
|
|
4684
|
-
|
|
4741
|
+
const items = import_react30.Children.toArray(children).filter(
|
|
4742
|
+
import_react30.isValidElement
|
|
4685
4743
|
);
|
|
4686
4744
|
const visible = max ? items.slice(0, max) : items;
|
|
4687
4745
|
const overflow = max ? items.length - max : 0;
|
|
4688
4746
|
return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(Layout, __spreadProps(__spreadValues({ className: cn("-space-x-2", className) }, props), { children: [
|
|
4689
4747
|
visible.map(
|
|
4690
|
-
(child, index) => (0,
|
|
4748
|
+
(child, index) => (0, import_react30.cloneElement)(child, {
|
|
4691
4749
|
key: index,
|
|
4692
4750
|
size,
|
|
4693
4751
|
className: cn("ring-2 ring-white", child.props.className)
|
|
@@ -4856,7 +4914,7 @@ var TableActionsCell = ({ actions, width }) => {
|
|
|
4856
4914
|
};
|
|
4857
4915
|
|
|
4858
4916
|
// src/ui/components/ui/table/TableSelectCell.tsx
|
|
4859
|
-
var
|
|
4917
|
+
var import_react31 = require("react");
|
|
4860
4918
|
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
4861
4919
|
var TableSelectCell = ({
|
|
4862
4920
|
isSelected,
|
|
@@ -4864,7 +4922,7 @@ var TableSelectCell = ({
|
|
|
4864
4922
|
label,
|
|
4865
4923
|
width = "40px"
|
|
4866
4924
|
}) => {
|
|
4867
|
-
const isRange = (0,
|
|
4925
|
+
const isRange = (0, import_react31.useRef)(false);
|
|
4868
4926
|
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(TableCell, { width, centerContent: true, className: "table-select-cell", children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("span", { onClick: (event) => event.stopPropagation(), children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
4869
4927
|
Checkbox,
|
|
4870
4928
|
{
|
|
@@ -4894,20 +4952,20 @@ var TableSelectHeaderCell = ({
|
|
|
4894
4952
|
) }) }) });
|
|
4895
4953
|
|
|
4896
4954
|
// src/ui/hooks/useRowSelection.ts
|
|
4897
|
-
var
|
|
4955
|
+
var import_react32 = require("react");
|
|
4898
4956
|
var useRowSelection = ({
|
|
4899
4957
|
rowIds,
|
|
4900
4958
|
totalCount
|
|
4901
4959
|
}) => {
|
|
4902
|
-
const [selectedIds, setSelectedIds] = (0,
|
|
4903
|
-
const [isAllResultsSelected, setIsAllResultsSelected] = (0,
|
|
4904
|
-
const anchorId = (0,
|
|
4960
|
+
const [selectedIds, setSelectedIds] = (0, import_react32.useState)(/* @__PURE__ */ new Set());
|
|
4961
|
+
const [isAllResultsSelected, setIsAllResultsSelected] = (0, import_react32.useState)(false);
|
|
4962
|
+
const anchorId = (0, import_react32.useRef)(null);
|
|
4905
4963
|
const resolvedTotal = totalCount != null ? totalCount : rowIds.length;
|
|
4906
4964
|
const selectedOnPage = rowIds.filter((id) => selectedIds.has(id)).length;
|
|
4907
4965
|
const isPageFullySelected = rowIds.length > 0 && selectedOnPage === rowIds.length;
|
|
4908
4966
|
const canSelectAllResults = isPageFullySelected && !isAllResultsSelected && resolvedTotal > rowIds.length;
|
|
4909
4967
|
const headerState = isAllResultsSelected || isPageFullySelected ? true : selectedOnPage > 0 ? "indeterminate" : false;
|
|
4910
|
-
const clear = (0,
|
|
4968
|
+
const clear = (0, import_react32.useCallback)(() => {
|
|
4911
4969
|
setSelectedIds(/* @__PURE__ */ new Set());
|
|
4912
4970
|
setIsAllResultsSelected(false);
|
|
4913
4971
|
anchorId.current = null;
|
|
@@ -5262,7 +5320,7 @@ var CollapsibleContent = (_a) => {
|
|
|
5262
5320
|
};
|
|
5263
5321
|
|
|
5264
5322
|
// src/ui/components/ui/Drawer.tsx
|
|
5265
|
-
var
|
|
5323
|
+
var import_react33 = require("react");
|
|
5266
5324
|
var import_vaul = require("vaul");
|
|
5267
5325
|
var DialogPrimitive = __toESM(require("@radix-ui/react-dialog"));
|
|
5268
5326
|
|
|
@@ -5352,11 +5410,12 @@ var Drawer = ({
|
|
|
5352
5410
|
overlayClassName
|
|
5353
5411
|
}) => {
|
|
5354
5412
|
const isVertical = direction === "left" || direction === "right";
|
|
5355
|
-
const contentRef = (0,
|
|
5356
|
-
const [panel, setPanel] = (0,
|
|
5357
|
-
const overlayRef = (0,
|
|
5413
|
+
const contentRef = (0, import_react33.useRef)(null);
|
|
5414
|
+
const [panel, setPanel] = (0, import_react33.useState)(null);
|
|
5415
|
+
const overlayRef = (0, import_react33.useRef)(null);
|
|
5358
5416
|
useAllowPortalScroll(modal && open, contentRef, overlayRef);
|
|
5359
|
-
(
|
|
5417
|
+
useKeepLayersAboveUsable(modal && open, contentRef);
|
|
5418
|
+
(0, import_react33.useEffect)(() => {
|
|
5360
5419
|
if (!open || !panel) return;
|
|
5361
5420
|
return registerOpenDrawer(panel, overlayRef.current);
|
|
5362
5421
|
}, [open, panel]);
|
|
@@ -5369,9 +5428,9 @@ var Drawer = ({
|
|
|
5369
5428
|
};
|
|
5370
5429
|
const belongsToLayerAbove = (target) => {
|
|
5371
5430
|
const overlay = target.closest("[data-vaul-overlay]");
|
|
5372
|
-
return Boolean(target.closest(KEEP_OPEN_SELECTOR)) || overlay !== null && isOverlayOfDrawerAbove(overlay, contentRef.current);
|
|
5431
|
+
return Boolean(target.closest(KEEP_OPEN_SELECTOR)) || isMountedAbove(target, contentRef.current) || overlay !== null && isOverlayOfDrawerAbove(overlay, contentRef.current);
|
|
5373
5432
|
};
|
|
5374
|
-
(0,
|
|
5433
|
+
(0, import_react33.useEffect)(() => {
|
|
5375
5434
|
if (modal || !open || typeof document === "undefined") return;
|
|
5376
5435
|
const handlePointerDown = (event) => {
|
|
5377
5436
|
var _a;
|
|
@@ -5390,7 +5449,7 @@ var Drawer = ({
|
|
|
5390
5449
|
document.addEventListener("pointerdown", handlePointerDown, true);
|
|
5391
5450
|
return () => document.removeEventListener("pointerdown", handlePointerDown, true);
|
|
5392
5451
|
}, [modal, open, onClose]);
|
|
5393
|
-
(0,
|
|
5452
|
+
(0, import_react33.useEffect)(() => {
|
|
5394
5453
|
if (modal || !open) return;
|
|
5395
5454
|
const frame = requestAnimationFrame(() => {
|
|
5396
5455
|
document.body.style.pointerEvents = "auto";
|
|
@@ -5520,17 +5579,17 @@ var DrawerFooter = (_a) => {
|
|
|
5520
5579
|
var DrawerClose = import_vaul.Drawer.Close;
|
|
5521
5580
|
|
|
5522
5581
|
// src/ui/components/ui/sidebar/Sidebar.tsx
|
|
5523
|
-
var
|
|
5582
|
+
var import_react35 = require("react");
|
|
5524
5583
|
|
|
5525
5584
|
// src/ui/components/ui/sidebar/SidebarContext.ts
|
|
5526
|
-
var
|
|
5527
|
-
var SidebarCollapsedContext = (0,
|
|
5585
|
+
var import_react34 = require("react");
|
|
5586
|
+
var SidebarCollapsedContext = (0, import_react34.createContext)(false);
|
|
5528
5587
|
var SidebarCollapsedProvider = SidebarCollapsedContext.Provider;
|
|
5529
|
-
var useSidebarCollapsed = () => (0,
|
|
5588
|
+
var useSidebarCollapsed = () => (0, import_react34.useContext)(SidebarCollapsedContext);
|
|
5530
5589
|
|
|
5531
5590
|
// src/ui/components/ui/sidebar/Sidebar.tsx
|
|
5532
5591
|
var import_jsx_runtime68 = require("react/jsx-runtime");
|
|
5533
|
-
var Sidebar = (0,
|
|
5592
|
+
var Sidebar = (0, import_react35.forwardRef)(
|
|
5534
5593
|
(_a, ref) => {
|
|
5535
5594
|
var _b = _a, { collapsed = false, className, children } = _b, props = __objRest(_b, ["collapsed", "className", "children"]);
|
|
5536
5595
|
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(SidebarCollapsedProvider, { value: collapsed, children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
@@ -5551,9 +5610,9 @@ var Sidebar = (0, import_react34.forwardRef)(
|
|
|
5551
5610
|
Sidebar.displayName = "Sidebar";
|
|
5552
5611
|
|
|
5553
5612
|
// src/ui/components/ui/sidebar/SidebarTrigger.tsx
|
|
5554
|
-
var
|
|
5613
|
+
var import_react36 = require("react");
|
|
5555
5614
|
var import_jsx_runtime69 = require("react/jsx-runtime");
|
|
5556
|
-
var SidebarTrigger = (0,
|
|
5615
|
+
var SidebarTrigger = (0, import_react36.forwardRef)((_a, ref) => {
|
|
5557
5616
|
var _b = _a, { collapsed, className } = _b, props = __objRest(_b, ["collapsed", "className"]);
|
|
5558
5617
|
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
5559
5618
|
"button",
|
|
@@ -5580,9 +5639,9 @@ var SidebarTrigger = (0, import_react35.forwardRef)((_a, ref) => {
|
|
|
5580
5639
|
SidebarTrigger.displayName = "SidebarTrigger";
|
|
5581
5640
|
|
|
5582
5641
|
// src/ui/components/ui/sidebar/SidebarHeader.tsx
|
|
5583
|
-
var
|
|
5642
|
+
var import_react37 = require("react");
|
|
5584
5643
|
var import_jsx_runtime70 = require("react/jsx-runtime");
|
|
5585
|
-
var SidebarHeader = (0,
|
|
5644
|
+
var SidebarHeader = (0, import_react37.forwardRef)(
|
|
5586
5645
|
(_a, ref) => {
|
|
5587
5646
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
5588
5647
|
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
@@ -5597,9 +5656,9 @@ var SidebarHeader = (0, import_react36.forwardRef)(
|
|
|
5597
5656
|
SidebarHeader.displayName = "SidebarHeader";
|
|
5598
5657
|
|
|
5599
5658
|
// src/ui/components/ui/sidebar/SidebarContent.tsx
|
|
5600
|
-
var
|
|
5659
|
+
var import_react38 = require("react");
|
|
5601
5660
|
var import_jsx_runtime71 = require("react/jsx-runtime");
|
|
5602
|
-
var SidebarContent = (0,
|
|
5661
|
+
var SidebarContent = (0, import_react38.forwardRef)(
|
|
5603
5662
|
(_a, ref) => {
|
|
5604
5663
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
5605
5664
|
return /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
|
|
@@ -5618,9 +5677,9 @@ var SidebarContent = (0, import_react37.forwardRef)(
|
|
|
5618
5677
|
SidebarContent.displayName = "SidebarContent";
|
|
5619
5678
|
|
|
5620
5679
|
// src/ui/components/ui/sidebar/SidebarGroup.tsx
|
|
5621
|
-
var
|
|
5680
|
+
var import_react39 = require("react");
|
|
5622
5681
|
var import_jsx_runtime72 = require("react/jsx-runtime");
|
|
5623
|
-
var SidebarGroup = (0,
|
|
5682
|
+
var SidebarGroup = (0, import_react39.forwardRef)(
|
|
5624
5683
|
(_a, ref) => {
|
|
5625
5684
|
var _b = _a, { label, className, children } = _b, props = __objRest(_b, ["label", "className", "children"]);
|
|
5626
5685
|
const collapsed = useSidebarCollapsed();
|
|
@@ -5641,9 +5700,9 @@ var SidebarGroup = (0, import_react38.forwardRef)(
|
|
|
5641
5700
|
SidebarGroup.displayName = "SidebarGroup";
|
|
5642
5701
|
|
|
5643
5702
|
// src/ui/components/ui/sidebar/SidebarMenuButton.tsx
|
|
5644
|
-
var
|
|
5703
|
+
var import_react40 = require("react");
|
|
5645
5704
|
var import_jsx_runtime73 = require("react/jsx-runtime");
|
|
5646
|
-
var SidebarMenuButton = (0,
|
|
5705
|
+
var SidebarMenuButton = (0, import_react40.forwardRef)(
|
|
5647
5706
|
(_a, ref) => {
|
|
5648
5707
|
var _b = _a, {
|
|
5649
5708
|
icon,
|
|
@@ -5723,9 +5782,9 @@ var SidebarMenuButton = (0, import_react39.forwardRef)(
|
|
|
5723
5782
|
SidebarMenuButton.displayName = "SidebarMenuButton";
|
|
5724
5783
|
|
|
5725
5784
|
// src/ui/components/ui/sidebar/SidebarActionCard.tsx
|
|
5726
|
-
var
|
|
5785
|
+
var import_react41 = require("react");
|
|
5727
5786
|
var import_jsx_runtime74 = require("react/jsx-runtime");
|
|
5728
|
-
var SidebarActionCard = (0,
|
|
5787
|
+
var SidebarActionCard = (0, import_react41.forwardRef)(
|
|
5729
5788
|
(_a, ref) => {
|
|
5730
5789
|
var _b = _a, {
|
|
5731
5790
|
icon,
|
|
@@ -5789,9 +5848,9 @@ var SidebarActionCard = (0, import_react40.forwardRef)(
|
|
|
5789
5848
|
SidebarActionCard.displayName = "SidebarActionCard";
|
|
5790
5849
|
|
|
5791
5850
|
// src/ui/components/ui/sidebar/SidebarMenuSub.tsx
|
|
5792
|
-
var
|
|
5851
|
+
var import_react42 = require("react");
|
|
5793
5852
|
var import_jsx_runtime75 = require("react/jsx-runtime");
|
|
5794
|
-
var SidebarMenuSub = (0,
|
|
5853
|
+
var SidebarMenuSub = (0, import_react42.forwardRef)(
|
|
5795
5854
|
(_a, ref) => {
|
|
5796
5855
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
5797
5856
|
return /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
@@ -5809,22 +5868,22 @@ var SidebarMenuSub = (0, import_react41.forwardRef)(
|
|
|
5809
5868
|
SidebarMenuSub.displayName = "SidebarMenuSub";
|
|
5810
5869
|
|
|
5811
5870
|
// src/ui/components/ui/sidebar/SidebarMenuSubItem.tsx
|
|
5812
|
-
var
|
|
5871
|
+
var import_react43 = require("react");
|
|
5813
5872
|
var import_jsx_runtime76 = require("react/jsx-runtime");
|
|
5814
|
-
var SidebarMenuSubItem = (0,
|
|
5873
|
+
var SidebarMenuSubItem = (0, import_react43.forwardRef)((_a, ref) => {
|
|
5815
5874
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
5816
5875
|
return /* @__PURE__ */ (0, import_jsx_runtime76.jsx)("li", __spreadValues({ ref, className: cn("relative", className) }, props));
|
|
5817
5876
|
});
|
|
5818
5877
|
SidebarMenuSubItem.displayName = "SidebarMenuSubItem";
|
|
5819
5878
|
|
|
5820
5879
|
// src/ui/components/ui/sidebar/SidebarMenuSubButton.tsx
|
|
5821
|
-
var
|
|
5880
|
+
var import_react44 = require("react");
|
|
5822
5881
|
var import_jsx_runtime77 = require("react/jsx-runtime");
|
|
5823
5882
|
var SIZE_CLASS = {
|
|
5824
5883
|
default: "h-10",
|
|
5825
5884
|
lg: "h-14"
|
|
5826
5885
|
};
|
|
5827
|
-
var SidebarMenuSubButton = (0,
|
|
5886
|
+
var SidebarMenuSubButton = (0, import_react44.forwardRef)((_a, ref) => {
|
|
5828
5887
|
var _b = _a, { active, size = "default", className } = _b, props = __objRest(_b, ["active", "size", "className"]);
|
|
5829
5888
|
return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
5830
5889
|
"button",
|
|
@@ -5845,9 +5904,9 @@ var SidebarMenuSubButton = (0, import_react43.forwardRef)((_a, ref) => {
|
|
|
5845
5904
|
SidebarMenuSubButton.displayName = "SidebarMenuSubButton";
|
|
5846
5905
|
|
|
5847
5906
|
// src/ui/components/ui/sidebar/SidebarFooter.tsx
|
|
5848
|
-
var
|
|
5907
|
+
var import_react45 = require("react");
|
|
5849
5908
|
var import_jsx_runtime78 = require("react/jsx-runtime");
|
|
5850
|
-
var SidebarFooter = (0,
|
|
5909
|
+
var SidebarFooter = (0, import_react45.forwardRef)(
|
|
5851
5910
|
(_a, ref) => {
|
|
5852
5911
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
5853
5912
|
return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
@@ -5885,9 +5944,9 @@ var SidebarSupportInfo = ({
|
|
|
5885
5944
|
};
|
|
5886
5945
|
|
|
5887
5946
|
// src/ui/components/ui/sidebar/SidebarMenuSearchInput.tsx
|
|
5888
|
-
var
|
|
5947
|
+
var import_react46 = require("react");
|
|
5889
5948
|
var import_jsx_runtime80 = require("react/jsx-runtime");
|
|
5890
|
-
var SidebarMenuSearchInput = (0,
|
|
5949
|
+
var SidebarMenuSearchInput = (0, import_react46.forwardRef)((_a, ref) => {
|
|
5891
5950
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
5892
5951
|
return /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)(InputGroup, { children: [
|
|
5893
5952
|
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)(InputGroupAddon, { align: "inline-start", children: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(FaIcon, { name: "magnifying-glass", size: 14, className: "text-white/50" }) }),
|
|
@@ -5906,7 +5965,7 @@ var SidebarMenuSearchInput = (0, import_react45.forwardRef)((_a, ref) => {
|
|
|
5906
5965
|
SidebarMenuSearchInput.displayName = "SidebarMenuSearchInput";
|
|
5907
5966
|
|
|
5908
5967
|
// src/ui/components/ui/sidebar/SidebarUserMenu.tsx
|
|
5909
|
-
var
|
|
5968
|
+
var import_react47 = require("react");
|
|
5910
5969
|
var RadixPopover5 = __toESM(require("@radix-ui/react-popover"));
|
|
5911
5970
|
var import_jsx_runtime81 = require("react/jsx-runtime");
|
|
5912
5971
|
var panelClassName = cn(
|
|
@@ -5925,7 +5984,7 @@ var SidebarUserMenu = ({
|
|
|
5925
5984
|
className
|
|
5926
5985
|
}) => {
|
|
5927
5986
|
const collapsed = useSidebarCollapsed();
|
|
5928
|
-
const [open, setOpen] = (0,
|
|
5987
|
+
const [open, setOpen] = (0, import_react47.useState)(false);
|
|
5929
5988
|
const runAndClose = (action) => {
|
|
5930
5989
|
action();
|
|
5931
5990
|
setOpen(false);
|
|
@@ -6244,7 +6303,7 @@ var toast = {
|
|
|
6244
6303
|
};
|
|
6245
6304
|
|
|
6246
6305
|
// src/ui/components/ui/PageContainer.tsx
|
|
6247
|
-
var
|
|
6306
|
+
var import_react48 = require("react");
|
|
6248
6307
|
var import_class_variance_authority14 = require("class-variance-authority");
|
|
6249
6308
|
var import_jsx_runtime85 = require("react/jsx-runtime");
|
|
6250
6309
|
var pageContainerVariants = (0, import_class_variance_authority14.cva)(
|
|
@@ -6261,7 +6320,7 @@ var pageContainerVariants = (0, import_class_variance_authority14.cva)(
|
|
|
6261
6320
|
defaultVariants: { padding: "md" }
|
|
6262
6321
|
}
|
|
6263
6322
|
);
|
|
6264
|
-
var PageContainer = (0,
|
|
6323
|
+
var PageContainer = (0, import_react48.forwardRef)(
|
|
6265
6324
|
(_a, ref) => {
|
|
6266
6325
|
var _b = _a, { padding, className } = _b, props = __objRest(_b, ["padding", "className"]);
|
|
6267
6326
|
return /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
@@ -6276,7 +6335,7 @@ var PageContainer = (0, import_react47.forwardRef)(
|
|
|
6276
6335
|
PageContainer.displayName = "PageContainer";
|
|
6277
6336
|
|
|
6278
6337
|
// src/ui/components/ui/IconTabs.tsx
|
|
6279
|
-
var
|
|
6338
|
+
var import_react49 = require("react");
|
|
6280
6339
|
var import_jsx_runtime86 = require("react/jsx-runtime");
|
|
6281
6340
|
var IconTabs = ({
|
|
6282
6341
|
items,
|
|
@@ -6286,10 +6345,10 @@ var IconTabs = ({
|
|
|
6286
6345
|
className
|
|
6287
6346
|
}) => {
|
|
6288
6347
|
var _a;
|
|
6289
|
-
const listRef = (0,
|
|
6290
|
-
const tabRefs = (0,
|
|
6291
|
-
const [bar, setBar] = (0,
|
|
6292
|
-
const updateBar = (0,
|
|
6348
|
+
const listRef = (0, import_react49.useRef)(null);
|
|
6349
|
+
const tabRefs = (0, import_react49.useRef)([]);
|
|
6350
|
+
const [bar, setBar] = (0, import_react49.useState)({ left: 0, top: 0, width: 0, height: 0 });
|
|
6351
|
+
const updateBar = (0, import_react49.useCallback)(() => {
|
|
6293
6352
|
const root = listRef.current;
|
|
6294
6353
|
const activeEl = tabRefs.current[value];
|
|
6295
6354
|
if (!root || !activeEl) return;
|
|
@@ -6302,7 +6361,7 @@ var IconTabs = ({
|
|
|
6302
6361
|
height: box.height
|
|
6303
6362
|
});
|
|
6304
6363
|
}, [value]);
|
|
6305
|
-
(0,
|
|
6364
|
+
(0, import_react49.useEffect)(() => {
|
|
6306
6365
|
updateBar();
|
|
6307
6366
|
const ro = new ResizeObserver(updateBar);
|
|
6308
6367
|
if (listRef.current) ro.observe(listRef.current);
|
|
@@ -6484,7 +6543,7 @@ var Banner = ({
|
|
|
6484
6543
|
};
|
|
6485
6544
|
|
|
6486
6545
|
// src/ui/components/ui/FloatingButton.tsx
|
|
6487
|
-
var
|
|
6546
|
+
var import_react50 = require("react");
|
|
6488
6547
|
|
|
6489
6548
|
// src/ui/lib/floatingArc.ts
|
|
6490
6549
|
var MAX_STEP = 65;
|
|
@@ -6638,20 +6697,20 @@ var FloatingButton = ({
|
|
|
6638
6697
|
safeArea,
|
|
6639
6698
|
onOffsetChange
|
|
6640
6699
|
}) => {
|
|
6641
|
-
const containerRef = (0,
|
|
6642
|
-
const [placement, setPlacement] = (0,
|
|
6700
|
+
const containerRef = (0, import_react50.useRef)(null);
|
|
6701
|
+
const [placement, setPlacement] = (0, import_react50.useState)(() => ({
|
|
6643
6702
|
geometry: __spreadValues({ base: 90 }, arcLayout(actions.length, ARC_RADIUS, SUB_SIZE)),
|
|
6644
6703
|
shift: { x: 0, y: 0 }
|
|
6645
6704
|
}));
|
|
6646
|
-
const [isDragging, setIsDragging] = (0,
|
|
6647
|
-
const [offset, setOffset] = (0,
|
|
6648
|
-
const offsetRef = (0,
|
|
6649
|
-
const lastPointRef = (0,
|
|
6650
|
-
const dragDistanceRef = (0,
|
|
6651
|
-
(0,
|
|
6705
|
+
const [isDragging, setIsDragging] = (0, import_react50.useState)(false);
|
|
6706
|
+
const [offset, setOffset] = (0, import_react50.useState)(() => readStoredOffset(persistKey));
|
|
6707
|
+
const offsetRef = (0, import_react50.useRef)(offset);
|
|
6708
|
+
const lastPointRef = (0, import_react50.useRef)({ x: 0, y: 0 });
|
|
6709
|
+
const dragDistanceRef = (0, import_react50.useRef)(0);
|
|
6710
|
+
(0, import_react50.useEffect)(() => {
|
|
6652
6711
|
onOffsetChange == null ? void 0 : onOffsetChange(offset);
|
|
6653
6712
|
}, [offset, onOffsetChange]);
|
|
6654
|
-
const clampOffset = (0,
|
|
6713
|
+
const clampOffset = (0, import_react50.useCallback)(
|
|
6655
6714
|
(next) => {
|
|
6656
6715
|
var _a, _b, _c, _d;
|
|
6657
6716
|
const el = containerRef.current;
|
|
@@ -6671,14 +6730,14 @@ var FloatingButton = ({
|
|
|
6671
6730
|
},
|
|
6672
6731
|
[safeArea == null ? void 0 : safeArea.left, safeArea == null ? void 0 : safeArea.top, safeArea == null ? void 0 : safeArea.right, safeArea == null ? void 0 : safeArea.bottom]
|
|
6673
6732
|
);
|
|
6674
|
-
(0,
|
|
6733
|
+
(0, import_react50.useLayoutEffect)(() => {
|
|
6675
6734
|
const corrected = clampOffset(offsetRef.current);
|
|
6676
6735
|
if (corrected.x === offsetRef.current.x && corrected.y === offsetRef.current.y)
|
|
6677
6736
|
return;
|
|
6678
6737
|
offsetRef.current = corrected;
|
|
6679
6738
|
setOffset(corrected);
|
|
6680
6739
|
}, [clampOffset]);
|
|
6681
|
-
(0,
|
|
6740
|
+
(0, import_react50.useEffect)(() => {
|
|
6682
6741
|
if (!draggable || !isDragging) return;
|
|
6683
6742
|
const onPointerMove = (e) => {
|
|
6684
6743
|
const dx = e.clientX - lastPointRef.current.x;
|
|
@@ -6714,7 +6773,7 @@ var FloatingButton = ({
|
|
|
6714
6773
|
window.removeEventListener("pointercancel", endDrag);
|
|
6715
6774
|
};
|
|
6716
6775
|
}, [draggable, isDragging, persistKey, clampOffset]);
|
|
6717
|
-
const resolvePlacement = (0,
|
|
6776
|
+
const resolvePlacement = (0, import_react50.useCallback)(() => {
|
|
6718
6777
|
var _a, _b, _c, _d;
|
|
6719
6778
|
const el = containerRef.current;
|
|
6720
6779
|
if (!el || typeof window === "undefined") return;
|
|
@@ -6743,13 +6802,13 @@ var FloatingButton = ({
|
|
|
6743
6802
|
safeArea == null ? void 0 : safeArea.right,
|
|
6744
6803
|
safeArea == null ? void 0 : safeArea.bottom
|
|
6745
6804
|
]);
|
|
6746
|
-
(0,
|
|
6805
|
+
(0, import_react50.useLayoutEffect)(() => {
|
|
6747
6806
|
if (isOpen) resolvePlacement();
|
|
6748
6807
|
}, [isOpen, offset, resolvePlacement]);
|
|
6749
|
-
(0,
|
|
6808
|
+
(0, import_react50.useLayoutEffect)(() => {
|
|
6750
6809
|
resolvePlacement();
|
|
6751
6810
|
}, [resolvePlacement]);
|
|
6752
|
-
(0,
|
|
6811
|
+
(0, import_react50.useEffect)(() => {
|
|
6753
6812
|
if (typeof window === "undefined") return;
|
|
6754
6813
|
const onResize = () => {
|
|
6755
6814
|
resolvePlacement();
|
|
@@ -6845,7 +6904,7 @@ var FloatingButton = ({
|
|
|
6845
6904
|
};
|
|
6846
6905
|
|
|
6847
6906
|
// src/ui/components/ui/ActivityFeedPanel.tsx
|
|
6848
|
-
var
|
|
6907
|
+
var import_react51 = require("react");
|
|
6849
6908
|
var import_jsx_runtime89 = require("react/jsx-runtime");
|
|
6850
6909
|
var PANEL_WIDTH = 500;
|
|
6851
6910
|
var PANEL_MAX_HEIGHT = 750;
|
|
@@ -6880,15 +6939,15 @@ var ActivityFeedPanel = ({
|
|
|
6880
6939
|
emptyMessage = "Rien de neuf pour l\u2019instant.",
|
|
6881
6940
|
items
|
|
6882
6941
|
}) => {
|
|
6883
|
-
const panelRef = (0,
|
|
6884
|
-
const [placement, setPlacement] = (0,
|
|
6942
|
+
const panelRef = (0, import_react51.useRef)(null);
|
|
6943
|
+
const [placement, setPlacement] = (0, import_react51.useState)(
|
|
6885
6944
|
() => typeof window === "undefined" ? {} : resolveFloatingPanelPlacement(
|
|
6886
6945
|
offset,
|
|
6887
6946
|
window.innerWidth,
|
|
6888
6947
|
window.innerHeight
|
|
6889
6948
|
)
|
|
6890
6949
|
);
|
|
6891
|
-
(0,
|
|
6950
|
+
(0, import_react51.useEffect)(() => {
|
|
6892
6951
|
if (!open || typeof document === "undefined") return;
|
|
6893
6952
|
const handlePointerDown = (event) => {
|
|
6894
6953
|
var _a;
|
|
@@ -6899,7 +6958,7 @@ var ActivityFeedPanel = ({
|
|
|
6899
6958
|
document.addEventListener("pointerdown", handlePointerDown);
|
|
6900
6959
|
return () => document.removeEventListener("pointerdown", handlePointerDown);
|
|
6901
6960
|
}, [open, onClose]);
|
|
6902
|
-
(0,
|
|
6961
|
+
(0, import_react51.useEffect)(() => {
|
|
6903
6962
|
if (!open || typeof window === "undefined") return;
|
|
6904
6963
|
const recompute = () => setPlacement(
|
|
6905
6964
|
resolveFloatingPanelPlacement(
|
|
@@ -7403,7 +7462,7 @@ var HistoryDrawer = (_a) => {
|
|
|
7403
7462
|
};
|
|
7404
7463
|
|
|
7405
7464
|
// src/ui/components/ui/history/HistoryButton.tsx
|
|
7406
|
-
var
|
|
7465
|
+
var import_react52 = require("react");
|
|
7407
7466
|
var import_jsx_runtime96 = require("react/jsx-runtime");
|
|
7408
7467
|
var LABEL = "Historique";
|
|
7409
7468
|
var SHORT_TOOLTIP = "Voir l\u2019historique des actions";
|
|
@@ -7419,7 +7478,7 @@ var HistoryButton = (_a) => {
|
|
|
7419
7478
|
"tooltip",
|
|
7420
7479
|
"onOpenChange"
|
|
7421
7480
|
]);
|
|
7422
|
-
const [isOpen, setIsOpen] = (0,
|
|
7481
|
+
const [isOpen, setIsOpen] = (0, import_react52.useState)(false);
|
|
7423
7482
|
const changeOpen = (nextIsOpen) => {
|
|
7424
7483
|
setIsOpen(nextIsOpen);
|
|
7425
7484
|
onOpenChange == null ? void 0 : onOpenChange(nextIsOpen);
|
|
@@ -7643,7 +7702,7 @@ var Timeline = ({
|
|
|
7643
7702
|
};
|
|
7644
7703
|
|
|
7645
7704
|
// src/ui/components/ui/ColorPicker.tsx
|
|
7646
|
-
var
|
|
7705
|
+
var import_react53 = require("react");
|
|
7647
7706
|
var import_class_variance_authority16 = require("class-variance-authority");
|
|
7648
7707
|
var import_jsx_runtime99 = require("react/jsx-runtime");
|
|
7649
7708
|
var swatchVariants = (0, import_class_variance_authority16.cva)(
|
|
@@ -7672,7 +7731,7 @@ var inputVariants = (0, import_class_variance_authority16.cva)(
|
|
|
7672
7731
|
defaultVariants: { size: "m" }
|
|
7673
7732
|
}
|
|
7674
7733
|
);
|
|
7675
|
-
var ColorPicker = (0,
|
|
7734
|
+
var ColorPicker = (0, import_react53.forwardRef)(
|
|
7676
7735
|
({
|
|
7677
7736
|
label,
|
|
7678
7737
|
value,
|
|
@@ -7682,7 +7741,7 @@ var ColorPicker = (0, import_react52.forwardRef)(
|
|
|
7682
7741
|
size,
|
|
7683
7742
|
className
|
|
7684
7743
|
}, ref) => {
|
|
7685
|
-
const [internalColor, setInternalColor] = (0,
|
|
7744
|
+
const [internalColor, setInternalColor] = (0, import_react53.useState)(defaultValue);
|
|
7686
7745
|
const currentColor = value !== void 0 ? value : internalColor;
|
|
7687
7746
|
const handleChange = (e) => {
|
|
7688
7747
|
const next = e.target.value;
|
|
@@ -7746,7 +7805,7 @@ var ColorPicker = (0, import_react52.forwardRef)(
|
|
|
7746
7805
|
ColorPicker.displayName = "ColorPicker";
|
|
7747
7806
|
|
|
7748
7807
|
// src/ui/components/ui/ColorTokenPicker.tsx
|
|
7749
|
-
var
|
|
7808
|
+
var import_react54 = require("react");
|
|
7750
7809
|
|
|
7751
7810
|
// src/ui/lib/tokens.ts
|
|
7752
7811
|
var COLOR_TOKENS = [
|
|
@@ -7787,7 +7846,7 @@ var ColorTokenPicker = ({
|
|
|
7787
7846
|
onChange,
|
|
7788
7847
|
disabled = false
|
|
7789
7848
|
}) => {
|
|
7790
|
-
const [open, setOpen] = (0,
|
|
7849
|
+
const [open, setOpen] = (0, import_react54.useState)(false);
|
|
7791
7850
|
return /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
|
|
7792
7851
|
Popover,
|
|
7793
7852
|
{
|
|
@@ -7839,7 +7898,7 @@ var ColorTokenPicker = ({
|
|
|
7839
7898
|
};
|
|
7840
7899
|
|
|
7841
7900
|
// src/ui/components/ui/FileUploadZone.tsx
|
|
7842
|
-
var
|
|
7901
|
+
var import_react55 = require("react");
|
|
7843
7902
|
var import_jsx_runtime101 = require("react/jsx-runtime");
|
|
7844
7903
|
var ACCEPT_MAP = {
|
|
7845
7904
|
png: "image/png",
|
|
@@ -7872,23 +7931,23 @@ var FileUploadZone = ({
|
|
|
7872
7931
|
showFileName = false,
|
|
7873
7932
|
className
|
|
7874
7933
|
}) => {
|
|
7875
|
-
const [isDragging, setIsDragging] = (0,
|
|
7876
|
-
const [internalPreviewUrl, setInternalPreviewUrl] = (0,
|
|
7934
|
+
const [isDragging, setIsDragging] = (0, import_react55.useState)(false);
|
|
7935
|
+
const [internalPreviewUrl, setInternalPreviewUrl] = (0, import_react55.useState)(
|
|
7877
7936
|
null
|
|
7878
7937
|
);
|
|
7879
|
-
const [fileType, setFileType] = (0,
|
|
7880
|
-
const [fileName, setFileName] = (0,
|
|
7881
|
-
const [inlineError, setInlineError] = (0,
|
|
7882
|
-
const inputRef = (0,
|
|
7938
|
+
const [fileType, setFileType] = (0, import_react55.useState)(null);
|
|
7939
|
+
const [fileName, setFileName] = (0, import_react55.useState)(null);
|
|
7940
|
+
const [inlineError, setInlineError] = (0, import_react55.useState)(null);
|
|
7941
|
+
const inputRef = (0, import_react55.useRef)(null);
|
|
7883
7942
|
const resolvedAccept = acceptOnlyPdf ? PDF_ONLY : accept;
|
|
7884
7943
|
const mimeTypes = getMimeTypes(resolvedAccept);
|
|
7885
7944
|
const acceptString = mimeTypes.join(",");
|
|
7886
7945
|
const previewUrl = multiple ? null : controlledPreviewUrl || (showPreview ? internalPreviewUrl : null);
|
|
7887
|
-
const emitError = (0,
|
|
7946
|
+
const emitError = (0, import_react55.useCallback)(
|
|
7888
7947
|
(message) => onError ? onError(message) : setInlineError(message),
|
|
7889
7948
|
[onError]
|
|
7890
7949
|
);
|
|
7891
|
-
const validateFile = (0,
|
|
7950
|
+
const validateFile = (0, import_react55.useCallback)(
|
|
7892
7951
|
(file) => {
|
|
7893
7952
|
if (!mimeTypes.includes(file.type))
|
|
7894
7953
|
return { ok: false, error: "Format de fichier non accept\xE9." };
|
|
@@ -7902,7 +7961,7 @@ var FileUploadZone = ({
|
|
|
7902
7961
|
},
|
|
7903
7962
|
[mimeTypes, maxSizeMB]
|
|
7904
7963
|
);
|
|
7905
|
-
const processFile = (0,
|
|
7964
|
+
const processFile = (0, import_react55.useCallback)(
|
|
7906
7965
|
(file) => {
|
|
7907
7966
|
setInlineError(null);
|
|
7908
7967
|
const result = validateFile(file);
|
|
@@ -7917,7 +7976,7 @@ var FileUploadZone = ({
|
|
|
7917
7976
|
},
|
|
7918
7977
|
[validateFile, onSave, showPreview, emitError]
|
|
7919
7978
|
);
|
|
7920
|
-
const processFiles = (0,
|
|
7979
|
+
const processFiles = (0, import_react55.useCallback)(
|
|
7921
7980
|
(files) => {
|
|
7922
7981
|
setInlineError(null);
|
|
7923
7982
|
for (const file of files) {
|
|
@@ -8076,7 +8135,7 @@ var FileUploadZone = ({
|
|
|
8076
8135
|
};
|
|
8077
8136
|
|
|
8078
8137
|
// src/ui/components/ui/FilePicker.tsx
|
|
8079
|
-
var
|
|
8138
|
+
var import_react56 = require("react");
|
|
8080
8139
|
var import_jsx_runtime102 = require("react/jsx-runtime");
|
|
8081
8140
|
var FilePicker = ({
|
|
8082
8141
|
label,
|
|
@@ -8091,7 +8150,7 @@ var FilePicker = ({
|
|
|
8091
8150
|
variant = "icon",
|
|
8092
8151
|
className
|
|
8093
8152
|
}) => {
|
|
8094
|
-
const inputRef = (0,
|
|
8153
|
+
const inputRef = (0, import_react56.useRef)(null);
|
|
8095
8154
|
return /* @__PURE__ */ (0, import_jsx_runtime102.jsxs)(import_jsx_runtime102.Fragment, { children: [
|
|
8096
8155
|
/* @__PURE__ */ (0, import_jsx_runtime102.jsx)(
|
|
8097
8156
|
"input",
|
|
@@ -8142,7 +8201,7 @@ var FilePicker = ({
|
|
|
8142
8201
|
};
|
|
8143
8202
|
|
|
8144
8203
|
// src/ui/components/ui/Item.tsx
|
|
8145
|
-
var
|
|
8204
|
+
var import_react57 = require("react");
|
|
8146
8205
|
var import_class_variance_authority17 = require("class-variance-authority");
|
|
8147
8206
|
var import_jsx_runtime103 = require("react/jsx-runtime");
|
|
8148
8207
|
var itemVariants = (0, import_class_variance_authority17.cva)(
|
|
@@ -8162,7 +8221,7 @@ var itemVariants = (0, import_class_variance_authority17.cva)(
|
|
|
8162
8221
|
defaultVariants: { variant: "default", size: "default" }
|
|
8163
8222
|
}
|
|
8164
8223
|
);
|
|
8165
|
-
var Item4 = (0,
|
|
8224
|
+
var Item4 = (0, import_react57.forwardRef)(
|
|
8166
8225
|
(_a, ref) => {
|
|
8167
8226
|
var _b = _a, { variant, size, className } = _b, props = __objRest(_b, ["variant", "size", "className"]);
|
|
8168
8227
|
return /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(
|
|
@@ -8321,7 +8380,7 @@ var Attachment = ({
|
|
|
8321
8380
|
};
|
|
8322
8381
|
|
|
8323
8382
|
// src/ui/components/ui/PdfPreview.tsx
|
|
8324
|
-
var
|
|
8383
|
+
var import_react58 = require("react");
|
|
8325
8384
|
var import_react_pdf = require("react-pdf");
|
|
8326
8385
|
var import_jsx_runtime105 = require("react/jsx-runtime");
|
|
8327
8386
|
import_react_pdf.pdfjs.GlobalWorkerOptions.workerSrc = `https://unpkg.com/pdfjs-dist@${import_react_pdf.pdfjs.version}/build/pdf.worker.min.mjs`;
|
|
@@ -8331,8 +8390,8 @@ var PdfPreview = ({
|
|
|
8331
8390
|
maxHeight = "600px",
|
|
8332
8391
|
className
|
|
8333
8392
|
}) => {
|
|
8334
|
-
const [hasError, setHasError] = (0,
|
|
8335
|
-
const [numPages, setNumPages] = (0,
|
|
8393
|
+
const [hasError, setHasError] = (0, import_react58.useState)(false);
|
|
8394
|
+
const [numPages, setNumPages] = (0, import_react58.useState)(0);
|
|
8336
8395
|
const height = Math.round(width * 1.3);
|
|
8337
8396
|
const thumbnailSkeleton = /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(Skeleton, { width, height });
|
|
8338
8397
|
if (hasError) {
|
|
@@ -8388,10 +8447,10 @@ var PdfPreview = ({
|
|
|
8388
8447
|
};
|
|
8389
8448
|
|
|
8390
8449
|
// src/ui/components/ui/AudioPlayer.tsx
|
|
8391
|
-
var
|
|
8450
|
+
var import_react60 = require("react");
|
|
8392
8451
|
|
|
8393
8452
|
// src/ui/components/ui/VideoPlayer.tsx
|
|
8394
|
-
var
|
|
8453
|
+
var import_react59 = require("react");
|
|
8395
8454
|
var import_jsx_runtime106 = require("react/jsx-runtime");
|
|
8396
8455
|
var formatVideoDuration = (seconds) => {
|
|
8397
8456
|
if (seconds === void 0 || !Number.isFinite(seconds) || seconds < 0)
|
|
@@ -8431,20 +8490,20 @@ var VideoPlayer = ({
|
|
|
8431
8490
|
defaultVolume = DEFAULT_VOLUME,
|
|
8432
8491
|
className
|
|
8433
8492
|
}) => {
|
|
8434
|
-
const [isInlinePlaying, setIsInlinePlaying] = (0,
|
|
8435
|
-
const [isExpanded, setIsExpanded] = (0,
|
|
8436
|
-
const [hasPosterError, setHasPosterError] = (0,
|
|
8437
|
-
const [hasFramePreviewError, setHasFramePreviewError] = (0,
|
|
8438
|
-
const inlineVideoRef = (0,
|
|
8439
|
-
const expandedVideoRef = (0,
|
|
8440
|
-
(0,
|
|
8493
|
+
const [isInlinePlaying, setIsInlinePlaying] = (0, import_react59.useState)(false);
|
|
8494
|
+
const [isExpanded, setIsExpanded] = (0, import_react59.useState)(false);
|
|
8495
|
+
const [hasPosterError, setHasPosterError] = (0, import_react59.useState)(false);
|
|
8496
|
+
const [hasFramePreviewError, setHasFramePreviewError] = (0, import_react59.useState)(false);
|
|
8497
|
+
const inlineVideoRef = (0, import_react59.useRef)(null);
|
|
8498
|
+
const expandedVideoRef = (0, import_react59.useRef)(null);
|
|
8499
|
+
(0, import_react59.useEffect)(() => {
|
|
8441
8500
|
setHasPosterError(false);
|
|
8442
8501
|
}, [poster]);
|
|
8443
|
-
(0,
|
|
8502
|
+
(0, import_react59.useEffect)(() => {
|
|
8444
8503
|
setHasFramePreviewError(false);
|
|
8445
8504
|
}, [src]);
|
|
8446
8505
|
const visiblePoster = hasPosterError ? void 0 : poster;
|
|
8447
|
-
const attachExpandedVideo = (0,
|
|
8506
|
+
const attachExpandedVideo = (0, import_react59.useCallback)(
|
|
8448
8507
|
(video) => {
|
|
8449
8508
|
expandedVideoRef.current = video;
|
|
8450
8509
|
if (video) video.volume = clampVolume(defaultVolume);
|
|
@@ -8456,7 +8515,7 @@ var VideoPlayer = ({
|
|
|
8456
8515
|
e.preventDefault();
|
|
8457
8516
|
(_a = expandedVideoRef.current) == null ? void 0 : _a.focus({ preventScroll: true });
|
|
8458
8517
|
};
|
|
8459
|
-
const attachInlineVideo = (0,
|
|
8518
|
+
const attachInlineVideo = (0, import_react59.useCallback)(
|
|
8460
8519
|
(video) => {
|
|
8461
8520
|
inlineVideoRef.current = video;
|
|
8462
8521
|
if (video) video.volume = clampVolume(defaultVolume);
|
|
@@ -8675,11 +8734,11 @@ var AudioPlayer = ({
|
|
|
8675
8734
|
title = "Audio",
|
|
8676
8735
|
className
|
|
8677
8736
|
}) => {
|
|
8678
|
-
const audioRef = (0,
|
|
8679
|
-
const [isPlaying, setIsPlaying] = (0,
|
|
8680
|
-
const [currentTime, setCurrentTime] = (0,
|
|
8681
|
-
const [duration, setDuration] = (0,
|
|
8682
|
-
const attachAudio = (0,
|
|
8737
|
+
const audioRef = (0, import_react60.useRef)(null);
|
|
8738
|
+
const [isPlaying, setIsPlaying] = (0, import_react60.useState)(false);
|
|
8739
|
+
const [currentTime, setCurrentTime] = (0, import_react60.useState)(0);
|
|
8740
|
+
const [duration, setDuration] = (0, import_react60.useState)(0);
|
|
8741
|
+
const attachAudio = (0, import_react60.useCallback)(
|
|
8683
8742
|
(audio) => {
|
|
8684
8743
|
audioRef.current = audio;
|
|
8685
8744
|
if (audio) audio.volume = clampVolume2(defaultVolume);
|
|
@@ -8827,7 +8886,7 @@ var ScrollArea = (_a) => {
|
|
|
8827
8886
|
};
|
|
8828
8887
|
|
|
8829
8888
|
// src/ui/components/ui/Message.tsx
|
|
8830
|
-
var
|
|
8889
|
+
var import_react61 = require("react");
|
|
8831
8890
|
var import_jsx_runtime109 = require("react/jsx-runtime");
|
|
8832
8891
|
var BUBBLE_BACKGROUND = {
|
|
8833
8892
|
own: { solid: "bg-blue-700", pale: "bg-blue-50" },
|
|
@@ -8839,7 +8898,7 @@ var BUBBLE_TAIL = {
|
|
|
8839
8898
|
teammate: "rounded-br-none",
|
|
8840
8899
|
other: "rounded-bl-none"
|
|
8841
8900
|
};
|
|
8842
|
-
var Message = (0,
|
|
8901
|
+
var Message = (0, import_react61.forwardRef)(
|
|
8843
8902
|
(_a, ref) => {
|
|
8844
8903
|
var _b = _a, {
|
|
8845
8904
|
isOwn = false,
|
|
@@ -8981,7 +9040,7 @@ var Message = (0, import_react60.forwardRef)(
|
|
|
8981
9040
|
Message.displayName = "Message";
|
|
8982
9041
|
|
|
8983
9042
|
// src/ui/components/ui/MessageScroller.tsx
|
|
8984
|
-
var
|
|
9043
|
+
var import_react62 = require("react");
|
|
8985
9044
|
var import_jsx_runtime110 = require("react/jsx-runtime");
|
|
8986
9045
|
var SEPARATOR_LINE = {
|
|
8987
9046
|
neutral: "",
|
|
@@ -9033,9 +9092,9 @@ var MessageScroller = ({
|
|
|
9033
9092
|
viewportRef,
|
|
9034
9093
|
className
|
|
9035
9094
|
}) => {
|
|
9036
|
-
const fallbackRef = (0,
|
|
9095
|
+
const fallbackRef = (0, import_react62.useRef)(null);
|
|
9037
9096
|
const scrollerRef = viewportRef != null ? viewportRef : fallbackRef;
|
|
9038
|
-
(0,
|
|
9097
|
+
(0, import_react62.useLayoutEffect)(() => {
|
|
9039
9098
|
if (!autoScroll) return;
|
|
9040
9099
|
const viewport = scrollerRef.current;
|
|
9041
9100
|
if (!viewport) return;
|
|
@@ -9089,7 +9148,7 @@ var MessageScroller = ({
|
|
|
9089
9148
|
};
|
|
9090
9149
|
|
|
9091
9150
|
// src/ui/components/ui/Stepper.tsx
|
|
9092
|
-
var
|
|
9151
|
+
var import_react63 = require("react");
|
|
9093
9152
|
var import_jsx_runtime111 = require("react/jsx-runtime");
|
|
9094
9153
|
var Stepper = ({
|
|
9095
9154
|
numberOfSteps,
|
|
@@ -9107,7 +9166,7 @@ var Stepper = ({
|
|
|
9107
9166
|
children: Array.from({ length: numberOfSteps }, (_, i) => {
|
|
9108
9167
|
const isActive = i === current;
|
|
9109
9168
|
const isCompleted = i < current;
|
|
9110
|
-
return /* @__PURE__ */ (0, import_jsx_runtime111.jsxs)(
|
|
9169
|
+
return /* @__PURE__ */ (0, import_jsx_runtime111.jsxs)(import_react63.Fragment, { children: [
|
|
9111
9170
|
/* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
|
|
9112
9171
|
"div",
|
|
9113
9172
|
{
|
|
@@ -9127,7 +9186,7 @@ var Stepper = ({
|
|
|
9127
9186
|
);
|
|
9128
9187
|
|
|
9129
9188
|
// src/ui/components/ui/DatePicker.tsx
|
|
9130
|
-
var
|
|
9189
|
+
var import_react64 = require("react");
|
|
9131
9190
|
var import_react_day_picker = require("react-day-picker");
|
|
9132
9191
|
var import_locale = require("react-day-picker/locale");
|
|
9133
9192
|
var import_style2 = require("react-day-picker/style.css");
|
|
@@ -9221,12 +9280,12 @@ var DatePicker = ({
|
|
|
9221
9280
|
className
|
|
9222
9281
|
}) => {
|
|
9223
9282
|
const isRange = mode === "range";
|
|
9224
|
-
const [open, setOpen] = (0,
|
|
9225
|
-
const [isEditing, setIsEditing] = (0,
|
|
9226
|
-
const [draftValue, setDraftValue] = (0,
|
|
9227
|
-
const [isDirty, setIsDirty] = (0,
|
|
9283
|
+
const [open, setOpen] = (0, import_react64.useState)(false);
|
|
9284
|
+
const [isEditing, setIsEditing] = (0, import_react64.useState)(false);
|
|
9285
|
+
const [draftValue, setDraftValue] = (0, import_react64.useState)("");
|
|
9286
|
+
const [isDirty, setIsDirty] = (0, import_react64.useState)(false);
|
|
9228
9287
|
const resolvedPresets = presets != null ? presets : isRange ? RANGE_PRESETS : SINGLE_PRESETS;
|
|
9229
|
-
const activePreset = (0,
|
|
9288
|
+
const activePreset = (0, import_react64.useMemo)(() => {
|
|
9230
9289
|
var _a;
|
|
9231
9290
|
const match = resolvedPresets.find((preset) => {
|
|
9232
9291
|
const result = preset.getValue();
|
|
@@ -9894,7 +9953,7 @@ var optimizeImage = async (file, desiredBaseName, opts = {}) => {
|
|
|
9894
9953
|
};
|
|
9895
9954
|
|
|
9896
9955
|
// src/ui/components/ui/Tour.tsx
|
|
9897
|
-
var
|
|
9956
|
+
var import_react65 = require("react");
|
|
9898
9957
|
var import_driver = require("driver.js");
|
|
9899
9958
|
var import_jsx_runtime113 = require("react/jsx-runtime");
|
|
9900
9959
|
var TOUR_TARGET_ATTRIBUTE = "data-tour-target";
|
|
@@ -9949,9 +10008,9 @@ var Tour = ({
|
|
|
9949
10008
|
const current = steps[step];
|
|
9950
10009
|
const total = steps.length;
|
|
9951
10010
|
const isLast = step === total - 1;
|
|
9952
|
-
const driverRef = (0,
|
|
9953
|
-
const ghostRef = (0,
|
|
9954
|
-
const actions = (0,
|
|
10011
|
+
const driverRef = (0, import_react65.useRef)(null);
|
|
10012
|
+
const ghostRef = (0, import_react65.useRef)(null);
|
|
10013
|
+
const actions = (0, import_react65.useRef)({
|
|
9955
10014
|
next: () => {
|
|
9956
10015
|
},
|
|
9957
10016
|
previous: () => {
|
|
@@ -9966,7 +10025,7 @@ var Tour = ({
|
|
|
9966
10025
|
},
|
|
9967
10026
|
close: () => onClose("close")
|
|
9968
10027
|
};
|
|
9969
|
-
(0,
|
|
10028
|
+
(0, import_react65.useEffect)(() => {
|
|
9970
10029
|
if (!open) return;
|
|
9971
10030
|
const ghost = document.createElement("div");
|
|
9972
10031
|
ghost.className = "dz-tour-target";
|
|
@@ -9992,7 +10051,7 @@ var Tour = ({
|
|
|
9992
10051
|
ghostRef.current = null;
|
|
9993
10052
|
};
|
|
9994
10053
|
}, [open]);
|
|
9995
|
-
(0,
|
|
10054
|
+
(0, import_react65.useEffect)(() => {
|
|
9996
10055
|
if (!open) return;
|
|
9997
10056
|
const onKeyDown = (event) => {
|
|
9998
10057
|
if (event.key === "Escape") {
|
|
@@ -10004,7 +10063,7 @@ var Tour = ({
|
|
|
10004
10063
|
window.addEventListener("keydown", onKeyDown, true);
|
|
10005
10064
|
return () => window.removeEventListener("keydown", onKeyDown, true);
|
|
10006
10065
|
}, [open]);
|
|
10007
|
-
const view = (0,
|
|
10066
|
+
const view = (0, import_react65.useRef)({ current, text, step, total, isLast });
|
|
10008
10067
|
view.current = { current, text, step, total, isLast };
|
|
10009
10068
|
const targetKey = [(_a = current == null ? void 0 : current.target) != null ? _a : []].flat().join("|");
|
|
10010
10069
|
const popoverKey = [
|
|
@@ -10017,7 +10076,7 @@ var Tour = ({
|
|
|
10017
10076
|
isLast ? text.finish : text.next,
|
|
10018
10077
|
text.close
|
|
10019
10078
|
].join("|");
|
|
10020
|
-
(0,
|
|
10079
|
+
(0, import_react65.useEffect)(() => {
|
|
10021
10080
|
const instance = driverRef.current;
|
|
10022
10081
|
const ghost = ghostRef.current;
|
|
10023
10082
|
const { current: current2, text: text2, step: step2, total: total2, isLast: isLast2 } = view.current;
|