hazo_ui 3.0.1 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGE_LOG.md +27 -0
- package/dist/index.cjs +480 -511
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +104 -2
- package/dist/index.d.ts +104 -2
- package/dist/index.js +399 -435
- package/dist/index.js.map +1 -1
- package/dist/test-harness/index.cjs +7 -17034
- package/dist/test-harness/index.cjs.map +1 -1
- package/dist/test-harness/index.js +7 -17032
- package/dist/test-harness/index.js.map +1 -1
- package/package.json +6 -4
package/dist/index.cjs
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var React25 = require('react');
|
|
5
|
-
var reactSlot = require('@radix-ui/react-slot');
|
|
6
|
-
var classVarianceAuthority = require('class-variance-authority');
|
|
7
4
|
var clsx = require('clsx');
|
|
8
5
|
var tailwindMerge = require('tailwind-merge');
|
|
6
|
+
var React26 = require('react');
|
|
7
|
+
var hazo_core = require('hazo_core');
|
|
8
|
+
var client = require('hazo_core/client');
|
|
9
9
|
var jsxRuntime = require('react/jsx-runtime');
|
|
10
|
+
var reactSlot = require('@radix-ui/react-slot');
|
|
11
|
+
var classVarianceAuthority = require('class-variance-authority');
|
|
10
12
|
var DialogPrimitive = require('@radix-ui/react-dialog');
|
|
11
13
|
var lucideReact = require('lucide-react');
|
|
12
14
|
var PopoverPrimitive = require('@radix-ui/react-popover');
|
|
@@ -90,7 +92,7 @@ function _interopNamespace(e) {
|
|
|
90
92
|
return Object.freeze(n);
|
|
91
93
|
}
|
|
92
94
|
|
|
93
|
-
var
|
|
95
|
+
var React26__namespace = /*#__PURE__*/_interopNamespace(React26);
|
|
94
96
|
var DialogPrimitive__namespace = /*#__PURE__*/_interopNamespace(DialogPrimitive);
|
|
95
97
|
var PopoverPrimitive__namespace = /*#__PURE__*/_interopNamespace(PopoverPrimitive);
|
|
96
98
|
var SelectPrimitive__namespace = /*#__PURE__*/_interopNamespace(SelectPrimitive);
|
|
@@ -195,6 +197,54 @@ var require_objectWithoutPropertiesLoose = __commonJS({
|
|
|
195
197
|
module.exports = _objectWithoutPropertiesLoose10, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
196
198
|
}
|
|
197
199
|
});
|
|
200
|
+
function cn(...inputs) {
|
|
201
|
+
return tailwindMerge.twMerge(clsx.clsx(inputs));
|
|
202
|
+
}
|
|
203
|
+
function HazoContextProvider({
|
|
204
|
+
correlationId,
|
|
205
|
+
userId,
|
|
206
|
+
children
|
|
207
|
+
}) {
|
|
208
|
+
const id = React26__namespace.useMemo(
|
|
209
|
+
() => correlationId ?? hazo_core.generateRequestId(),
|
|
210
|
+
[correlationId]
|
|
211
|
+
);
|
|
212
|
+
React26__namespace.useEffect(() => {
|
|
213
|
+
client.withContext({ correlationId: id, userId }, () => {
|
|
214
|
+
client.setBrowserCorrelationId(id);
|
|
215
|
+
});
|
|
216
|
+
return () => {
|
|
217
|
+
client.setBrowserCorrelationId(void 0);
|
|
218
|
+
};
|
|
219
|
+
}, [id, userId]);
|
|
220
|
+
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children });
|
|
221
|
+
}
|
|
222
|
+
var console_logger = {
|
|
223
|
+
info: (m, d) => d ? console.log(`[hazo_ui] ${m}`, d) : console.log(`[hazo_ui] ${m}`),
|
|
224
|
+
debug: (m, d) => d ? console.debug(`[hazo_ui] ${m}`, d) : console.debug(`[hazo_ui] ${m}`),
|
|
225
|
+
warn: (m, d) => d ? console.warn(`[hazo_ui] ${m}`, d) : console.warn(`[hazo_ui] ${m}`),
|
|
226
|
+
error: (m, d) => d ? console.error(`[hazo_ui] ${m}`, d) : console.error(`[hazo_ui] ${m}`)
|
|
227
|
+
};
|
|
228
|
+
function build_default_logger() {
|
|
229
|
+
try {
|
|
230
|
+
return hazo_core.createLogger("hazo_ui");
|
|
231
|
+
} catch {
|
|
232
|
+
return console_logger;
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
var current_logger = null;
|
|
236
|
+
function set_logger(logger) {
|
|
237
|
+
current_logger = logger ?? null;
|
|
238
|
+
}
|
|
239
|
+
function get_logger() {
|
|
240
|
+
if (!current_logger) {
|
|
241
|
+
current_logger = build_default_logger();
|
|
242
|
+
}
|
|
243
|
+
return current_logger;
|
|
244
|
+
}
|
|
245
|
+
function generateUUID() {
|
|
246
|
+
return hazo_core.generateRequestId().slice(4);
|
|
247
|
+
}
|
|
198
248
|
|
|
199
249
|
// src/lib/hazo_ui_config.ts
|
|
200
250
|
var default_config = {
|
|
@@ -226,9 +276,6 @@ function set_hazo_ui_config(config) {
|
|
|
226
276
|
function reset_hazo_ui_config() {
|
|
227
277
|
global_config = { ...default_config };
|
|
228
278
|
}
|
|
229
|
-
function cn(...inputs) {
|
|
230
|
-
return tailwindMerge.twMerge(clsx.clsx(inputs));
|
|
231
|
-
}
|
|
232
279
|
var buttonVariants = classVarianceAuthority.cva(
|
|
233
280
|
"inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",
|
|
234
281
|
{
|
|
@@ -275,7 +322,7 @@ var variant_styles = {
|
|
|
275
322
|
color: "hsl(var(--secondary-foreground))"
|
|
276
323
|
}
|
|
277
324
|
};
|
|
278
|
-
var Button =
|
|
325
|
+
var Button = React26__namespace.forwardRef(
|
|
279
326
|
({ className, variant, size, asChild = false, style, ...props }, ref) => {
|
|
280
327
|
const Comp = asChild ? reactSlot.Slot : "button";
|
|
281
328
|
const fallback_styles = variant_styles[variant ?? "default"] ?? {};
|
|
@@ -295,7 +342,7 @@ var Dialog = DialogPrimitive__namespace.Root;
|
|
|
295
342
|
var DialogTrigger = DialogPrimitive__namespace.Trigger;
|
|
296
343
|
var DialogPortal = DialogPrimitive__namespace.Portal;
|
|
297
344
|
var DialogClose = DialogPrimitive__namespace.Close;
|
|
298
|
-
var DialogOverlay =
|
|
345
|
+
var DialogOverlay = React26__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
299
346
|
DialogPrimitive__namespace.Overlay,
|
|
300
347
|
{
|
|
301
348
|
ref,
|
|
@@ -307,7 +354,7 @@ var DialogOverlay = React25__namespace.forwardRef(({ className, ...props }, ref)
|
|
|
307
354
|
}
|
|
308
355
|
));
|
|
309
356
|
DialogOverlay.displayName = DialogPrimitive__namespace.Overlay.displayName;
|
|
310
|
-
var DialogContent =
|
|
357
|
+
var DialogContent = React26__namespace.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(DialogPortal, { children: [
|
|
311
358
|
/* @__PURE__ */ jsxRuntime.jsx(DialogOverlay, {}),
|
|
312
359
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
313
360
|
DialogPrimitive__namespace.Content,
|
|
@@ -357,7 +404,7 @@ var DialogFooter = ({
|
|
|
357
404
|
}
|
|
358
405
|
);
|
|
359
406
|
DialogFooter.displayName = "DialogFooter";
|
|
360
|
-
var DialogTitle =
|
|
407
|
+
var DialogTitle = React26__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
361
408
|
DialogPrimitive__namespace.Title,
|
|
362
409
|
{
|
|
363
410
|
ref,
|
|
@@ -370,7 +417,7 @@ var DialogTitle = React25__namespace.forwardRef(({ className, ...props }, ref) =
|
|
|
370
417
|
}
|
|
371
418
|
));
|
|
372
419
|
DialogTitle.displayName = DialogPrimitive__namespace.Title.displayName;
|
|
373
|
-
var DialogDescription =
|
|
420
|
+
var DialogDescription = React26__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
374
421
|
DialogPrimitive__namespace.Description,
|
|
375
422
|
{
|
|
376
423
|
ref,
|
|
@@ -379,7 +426,7 @@ var DialogDescription = React25__namespace.forwardRef(({ className, ...props },
|
|
|
379
426
|
}
|
|
380
427
|
));
|
|
381
428
|
DialogDescription.displayName = DialogPrimitive__namespace.Description.displayName;
|
|
382
|
-
var Command =
|
|
429
|
+
var Command = React26__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
383
430
|
"div",
|
|
384
431
|
{
|
|
385
432
|
ref,
|
|
@@ -391,7 +438,7 @@ var Command = React25__namespace.forwardRef(({ className, ...props }, ref) => /*
|
|
|
391
438
|
}
|
|
392
439
|
));
|
|
393
440
|
Command.displayName = "Command";
|
|
394
|
-
var CommandInput =
|
|
441
|
+
var CommandInput = React26__namespace.forwardRef(({ className, onValueChange, onChange, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
395
442
|
"input",
|
|
396
443
|
{
|
|
397
444
|
ref,
|
|
@@ -407,7 +454,7 @@ var CommandInput = React25__namespace.forwardRef(({ className, onValueChange, on
|
|
|
407
454
|
}
|
|
408
455
|
));
|
|
409
456
|
CommandInput.displayName = "CommandInput";
|
|
410
|
-
var CommandList =
|
|
457
|
+
var CommandList = React26__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
411
458
|
"div",
|
|
412
459
|
{
|
|
413
460
|
ref,
|
|
@@ -416,7 +463,7 @@ var CommandList = React25__namespace.forwardRef(({ className, ...props }, ref) =
|
|
|
416
463
|
}
|
|
417
464
|
));
|
|
418
465
|
CommandList.displayName = "CommandList";
|
|
419
|
-
var CommandEmpty =
|
|
466
|
+
var CommandEmpty = React26__namespace.forwardRef((props, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
420
467
|
"div",
|
|
421
468
|
{
|
|
422
469
|
ref,
|
|
@@ -425,7 +472,7 @@ var CommandEmpty = React25__namespace.forwardRef((props, ref) => /* @__PURE__ */
|
|
|
425
472
|
}
|
|
426
473
|
));
|
|
427
474
|
CommandEmpty.displayName = "CommandEmpty";
|
|
428
|
-
var CommandGroup =
|
|
475
|
+
var CommandGroup = React26__namespace.forwardRef(({ className, heading, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
429
476
|
"div",
|
|
430
477
|
{
|
|
431
478
|
ref,
|
|
@@ -441,7 +488,7 @@ var CommandGroup = React25__namespace.forwardRef(({ className, heading, children
|
|
|
441
488
|
}
|
|
442
489
|
));
|
|
443
490
|
CommandGroup.displayName = "CommandGroup";
|
|
444
|
-
var CommandItem =
|
|
491
|
+
var CommandItem = React26__namespace.forwardRef(({ className, onSelect, value, selected, style, ...props }, ref) => {
|
|
445
492
|
const handleClick = () => {
|
|
446
493
|
if (onSelect && value) {
|
|
447
494
|
onSelect(value);
|
|
@@ -472,7 +519,7 @@ var CommandItem = React25__namespace.forwardRef(({ className, onSelect, value, s
|
|
|
472
519
|
CommandItem.displayName = "CommandItem";
|
|
473
520
|
var Popover = PopoverPrimitive__namespace.Root;
|
|
474
521
|
var PopoverTrigger = PopoverPrimitive__namespace.Trigger;
|
|
475
|
-
var PopoverContent =
|
|
522
|
+
var PopoverContent = React26__namespace.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(PopoverPrimitive__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
476
523
|
PopoverPrimitive__namespace.Content,
|
|
477
524
|
{
|
|
478
525
|
ref,
|
|
@@ -486,7 +533,7 @@ var PopoverContent = React25__namespace.forwardRef(({ className, align = "center
|
|
|
486
533
|
}
|
|
487
534
|
) }));
|
|
488
535
|
PopoverContent.displayName = PopoverPrimitive__namespace.Content.displayName;
|
|
489
|
-
var Input =
|
|
536
|
+
var Input = React26__namespace.forwardRef(
|
|
490
537
|
({ className, type, ...props }, ref) => {
|
|
491
538
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
492
539
|
"input",
|
|
@@ -506,7 +553,7 @@ Input.displayName = "Input";
|
|
|
506
553
|
var Select = SelectPrimitive__namespace.Root;
|
|
507
554
|
var SelectGroup = SelectPrimitive__namespace.Group;
|
|
508
555
|
var SelectValue = SelectPrimitive__namespace.Value;
|
|
509
|
-
var SelectTrigger =
|
|
556
|
+
var SelectTrigger = React26__namespace.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
510
557
|
SelectPrimitive__namespace.Trigger,
|
|
511
558
|
{
|
|
512
559
|
ref,
|
|
@@ -522,7 +569,7 @@ var SelectTrigger = React25__namespace.forwardRef(({ className, children, ...pro
|
|
|
522
569
|
}
|
|
523
570
|
));
|
|
524
571
|
SelectTrigger.displayName = SelectPrimitive__namespace.Trigger.displayName;
|
|
525
|
-
var SelectScrollUpButton =
|
|
572
|
+
var SelectScrollUpButton = React26__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
526
573
|
SelectPrimitive__namespace.ScrollUpButton,
|
|
527
574
|
{
|
|
528
575
|
ref,
|
|
@@ -535,7 +582,7 @@ var SelectScrollUpButton = React25__namespace.forwardRef(({ className, ...props
|
|
|
535
582
|
}
|
|
536
583
|
));
|
|
537
584
|
SelectScrollUpButton.displayName = SelectPrimitive__namespace.ScrollUpButton.displayName;
|
|
538
|
-
var SelectScrollDownButton =
|
|
585
|
+
var SelectScrollDownButton = React26__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
539
586
|
SelectPrimitive__namespace.ScrollDownButton,
|
|
540
587
|
{
|
|
541
588
|
ref,
|
|
@@ -548,7 +595,7 @@ var SelectScrollDownButton = React25__namespace.forwardRef(({ className, ...prop
|
|
|
548
595
|
}
|
|
549
596
|
));
|
|
550
597
|
SelectScrollDownButton.displayName = SelectPrimitive__namespace.ScrollDownButton.displayName;
|
|
551
|
-
var SelectContent =
|
|
598
|
+
var SelectContent = React26__namespace.forwardRef(({ className, children, position = "popper", ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
552
599
|
SelectPrimitive__namespace.Content,
|
|
553
600
|
{
|
|
554
601
|
ref,
|
|
@@ -576,7 +623,7 @@ var SelectContent = React25__namespace.forwardRef(({ className, children, positi
|
|
|
576
623
|
}
|
|
577
624
|
) }));
|
|
578
625
|
SelectContent.displayName = SelectPrimitive__namespace.Content.displayName;
|
|
579
|
-
var SelectLabel =
|
|
626
|
+
var SelectLabel = React26__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
580
627
|
SelectPrimitive__namespace.Label,
|
|
581
628
|
{
|
|
582
629
|
ref,
|
|
@@ -585,7 +632,7 @@ var SelectLabel = React25__namespace.forwardRef(({ className, ...props }, ref) =
|
|
|
585
632
|
}
|
|
586
633
|
));
|
|
587
634
|
SelectLabel.displayName = SelectPrimitive__namespace.Label.displayName;
|
|
588
|
-
var SelectItem =
|
|
635
|
+
var SelectItem = React26__namespace.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
589
636
|
SelectPrimitive__namespace.Item,
|
|
590
637
|
{
|
|
591
638
|
ref,
|
|
@@ -601,7 +648,7 @@ var SelectItem = React25__namespace.forwardRef(({ className, children, ...props
|
|
|
601
648
|
}
|
|
602
649
|
));
|
|
603
650
|
SelectItem.displayName = SelectPrimitive__namespace.Item.displayName;
|
|
604
|
-
var SelectSeparator =
|
|
651
|
+
var SelectSeparator = React26__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
605
652
|
SelectPrimitive__namespace.Separator,
|
|
606
653
|
{
|
|
607
654
|
ref,
|
|
@@ -613,7 +660,7 @@ SelectSeparator.displayName = SelectPrimitive__namespace.Separator.displayName;
|
|
|
613
660
|
var TooltipProvider = TooltipPrimitive__namespace.Provider;
|
|
614
661
|
var Tooltip = TooltipPrimitive__namespace.Root;
|
|
615
662
|
var TooltipTrigger = TooltipPrimitive__namespace.Trigger;
|
|
616
|
-
var TooltipContent =
|
|
663
|
+
var TooltipContent = React26__namespace.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
617
664
|
TooltipPrimitive__namespace.Content,
|
|
618
665
|
{
|
|
619
666
|
ref,
|
|
@@ -681,7 +728,7 @@ function FilterFieldItem({
|
|
|
681
728
|
onOperatorChange,
|
|
682
729
|
onDelete
|
|
683
730
|
}) {
|
|
684
|
-
const [isCalendarOpen, setIsCalendarOpen] =
|
|
731
|
+
const [isCalendarOpen, setIsCalendarOpen] = React26.useState(false);
|
|
685
732
|
const renderInput = () => {
|
|
686
733
|
switch (fieldConfig.type) {
|
|
687
734
|
case "text":
|
|
@@ -908,10 +955,10 @@ function HazoUiMultiFilterDialog({
|
|
|
908
955
|
...finalHeaderBgColor && { backgroundColor: finalHeaderBgColor },
|
|
909
956
|
...finalHeaderTextColor && { color: finalHeaderTextColor }
|
|
910
957
|
};
|
|
911
|
-
const [isOpen, setIsOpen] =
|
|
912
|
-
const [filterFields, setFilterFields] =
|
|
913
|
-
const [isComboboxOpen, setIsComboboxOpen] =
|
|
914
|
-
|
|
958
|
+
const [isOpen, setIsOpen] = React26.useState(false);
|
|
959
|
+
const [filterFields, setFilterFields] = React26.useState(initialFilters);
|
|
960
|
+
const [isComboboxOpen, setIsComboboxOpen] = React26.useState(false);
|
|
961
|
+
React26.useEffect(() => {
|
|
915
962
|
if (isOpen) {
|
|
916
963
|
setFilterFields(initialFilters);
|
|
917
964
|
}
|
|
@@ -1272,16 +1319,16 @@ function HazoUiMultiSortDialog({
|
|
|
1272
1319
|
...finalHeaderBgColor && { backgroundColor: finalHeaderBgColor },
|
|
1273
1320
|
...finalHeaderTextColor && { color: finalHeaderTextColor }
|
|
1274
1321
|
};
|
|
1275
|
-
const [isOpen, setIsOpen] =
|
|
1276
|
-
const [sortFields, setSortFields] =
|
|
1277
|
-
const [isComboboxOpen, setIsComboboxOpen] =
|
|
1322
|
+
const [isOpen, setIsOpen] = React26.useState(false);
|
|
1323
|
+
const [sortFields, setSortFields] = React26.useState(initialSortFields);
|
|
1324
|
+
const [isComboboxOpen, setIsComboboxOpen] = React26.useState(false);
|
|
1278
1325
|
const sensors = core$1.useSensors(
|
|
1279
1326
|
core$1.useSensor(core$1.PointerSensor, { activationConstraint: { distance: 4 } }),
|
|
1280
1327
|
core$1.useSensor(core$1.KeyboardSensor, {
|
|
1281
1328
|
coordinateGetter: sortable.sortableKeyboardCoordinates
|
|
1282
1329
|
})
|
|
1283
1330
|
);
|
|
1284
|
-
|
|
1331
|
+
React26.useEffect(() => {
|
|
1285
1332
|
if (isOpen) {
|
|
1286
1333
|
setSortFields(initialSortFields);
|
|
1287
1334
|
}
|
|
@@ -1475,7 +1522,7 @@ function HazoUiMultiSortDialog({
|
|
|
1475
1522
|
] })
|
|
1476
1523
|
] });
|
|
1477
1524
|
}
|
|
1478
|
-
var RadioGroup =
|
|
1525
|
+
var RadioGroup = React26__namespace.forwardRef(({ className, ...props }, ref) => {
|
|
1479
1526
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1480
1527
|
RadioGroupPrimitive__namespace.Root,
|
|
1481
1528
|
{
|
|
@@ -1486,7 +1533,7 @@ var RadioGroup = React25__namespace.forwardRef(({ className, ...props }, ref) =>
|
|
|
1486
1533
|
);
|
|
1487
1534
|
});
|
|
1488
1535
|
RadioGroup.displayName = RadioGroupPrimitive__namespace.Root.displayName;
|
|
1489
|
-
var RadioGroupItem =
|
|
1536
|
+
var RadioGroupItem = React26__namespace.forwardRef(({ className, ...props }, ref) => {
|
|
1490
1537
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1491
1538
|
RadioGroupPrimitive__namespace.Item,
|
|
1492
1539
|
{
|
|
@@ -1943,7 +1990,7 @@ function filterInputValue(value, input_type, num_decimals) {
|
|
|
1943
1990
|
}
|
|
1944
1991
|
}
|
|
1945
1992
|
}
|
|
1946
|
-
var HazoUiFlexInput =
|
|
1993
|
+
var HazoUiFlexInput = React26__namespace.forwardRef(
|
|
1947
1994
|
({
|
|
1948
1995
|
className,
|
|
1949
1996
|
input_type = "mixed",
|
|
@@ -1960,13 +2007,13 @@ var HazoUiFlexInput = React25__namespace.forwardRef(
|
|
|
1960
2007
|
onBlur,
|
|
1961
2008
|
...props
|
|
1962
2009
|
}, ref) => {
|
|
1963
|
-
const [internalValue, setInternalValue] =
|
|
2010
|
+
const [internalValue, setInternalValue] = React26__namespace.useState(
|
|
1964
2011
|
typeof controlledValue === "string" ? controlledValue : typeof controlledValue === "number" ? String(controlledValue) : ""
|
|
1965
2012
|
);
|
|
1966
|
-
const [errorMessage, setErrorMessage] =
|
|
2013
|
+
const [errorMessage, setErrorMessage] = React26__namespace.useState();
|
|
1967
2014
|
const isControlled = controlledValue !== void 0;
|
|
1968
2015
|
const currentValue = isControlled ? typeof controlledValue === "string" ? controlledValue : String(controlledValue || "") : internalValue;
|
|
1969
|
-
|
|
2016
|
+
React26__namespace.useEffect(() => {
|
|
1970
2017
|
if (isControlled) {
|
|
1971
2018
|
const newValue = typeof controlledValue === "string" ? controlledValue : String(controlledValue || "");
|
|
1972
2019
|
if (newValue !== internalValue) {
|
|
@@ -2046,7 +2093,7 @@ var HazoUiFlexInput = React25__namespace.forwardRef(
|
|
|
2046
2093
|
}
|
|
2047
2094
|
);
|
|
2048
2095
|
HazoUiFlexInput.displayName = "HazoUiFlexInput";
|
|
2049
|
-
var ToolbarButton =
|
|
2096
|
+
var ToolbarButton = React26__namespace.forwardRef(
|
|
2050
2097
|
({ onClick, is_active = false, disabled = false, tooltip, className, children }, ref) => {
|
|
2051
2098
|
const button = /* @__PURE__ */ jsxRuntime.jsx(
|
|
2052
2099
|
"button",
|
|
@@ -2084,25 +2131,20 @@ var ToolbarButton = React25__namespace.forwardRef(
|
|
|
2084
2131
|
);
|
|
2085
2132
|
ToolbarButton.displayName = "ToolbarButton";
|
|
2086
2133
|
|
|
2087
|
-
// node_modules/@uiw/react-color-sketch/esm/index.js
|
|
2134
|
+
// ../node_modules/@uiw/react-color-sketch/esm/index.js
|
|
2088
2135
|
var import_extends10 = __toESM(require_extends());
|
|
2089
2136
|
var import_objectWithoutPropertiesLoose9 = __toESM(require_objectWithoutPropertiesLoose());
|
|
2090
2137
|
|
|
2091
|
-
// node_modules/@uiw/react-color-saturation/esm/index.js
|
|
2138
|
+
// ../node_modules/@uiw/react-color-saturation/esm/index.js
|
|
2092
2139
|
var import_extends3 = __toESM(require_extends());
|
|
2093
2140
|
var import_objectWithoutPropertiesLoose2 = __toESM(require_objectWithoutPropertiesLoose());
|
|
2094
2141
|
|
|
2095
|
-
// node_modules/@uiw/color-convert/esm/index.js
|
|
2142
|
+
// ../node_modules/@uiw/color-convert/esm/index.js
|
|
2096
2143
|
var import_extends = __toESM(require_extends());
|
|
2097
2144
|
var RGB_MAX = 255;
|
|
2098
2145
|
var SV_MAX = 100;
|
|
2099
2146
|
var rgbaToHsva = (_ref) => {
|
|
2100
|
-
var
|
|
2101
|
-
r,
|
|
2102
|
-
g,
|
|
2103
|
-
b,
|
|
2104
|
-
a
|
|
2105
|
-
} = _ref;
|
|
2147
|
+
var r = _ref.r, g = _ref.g, b = _ref.b, a = _ref.a;
|
|
2106
2148
|
var max = Math.max(r, g, b);
|
|
2107
2149
|
var delta = max - Math.min(r, g, b);
|
|
2108
2150
|
var hh = delta ? max === r ? (g - b) / delta : max === g ? 2 + (b - r) / delta : 4 + (r - g) / delta : 0;
|
|
@@ -2114,21 +2156,11 @@ var rgbaToHsva = (_ref) => {
|
|
|
2114
2156
|
};
|
|
2115
2157
|
};
|
|
2116
2158
|
var hsvaToHslaString = (hsva) => {
|
|
2117
|
-
var
|
|
2118
|
-
h,
|
|
2119
|
-
s,
|
|
2120
|
-
l,
|
|
2121
|
-
a
|
|
2122
|
-
} = hsvaToHsla(hsva);
|
|
2159
|
+
var _hsvaToHsla2 = hsvaToHsla(hsva), h = _hsvaToHsla2.h, s = _hsvaToHsla2.s, l = _hsvaToHsla2.l, a = _hsvaToHsla2.a;
|
|
2123
2160
|
return "hsla(" + h + ", " + s + "%, " + l + "%, " + a + ")";
|
|
2124
2161
|
};
|
|
2125
2162
|
var hsvaToHsla = (_ref5) => {
|
|
2126
|
-
var
|
|
2127
|
-
h,
|
|
2128
|
-
s,
|
|
2129
|
-
v,
|
|
2130
|
-
a
|
|
2131
|
-
} = _ref5;
|
|
2163
|
+
var h = _ref5.h, s = _ref5.s, v = _ref5.v, a = _ref5.a;
|
|
2132
2164
|
var hh = (200 - s) * v / SV_MAX;
|
|
2133
2165
|
return {
|
|
2134
2166
|
h,
|
|
@@ -2138,21 +2170,12 @@ var hsvaToHsla = (_ref5) => {
|
|
|
2138
2170
|
};
|
|
2139
2171
|
};
|
|
2140
2172
|
var rgbToHex = (_ref7) => {
|
|
2141
|
-
var
|
|
2142
|
-
r,
|
|
2143
|
-
g,
|
|
2144
|
-
b
|
|
2145
|
-
} = _ref7;
|
|
2173
|
+
var r = _ref7.r, g = _ref7.g, b = _ref7.b;
|
|
2146
2174
|
var bin = r << 16 | g << 8 | b;
|
|
2147
2175
|
return "#" + ((h) => new Array(7 - h.length).join("0") + h)(bin.toString(16));
|
|
2148
2176
|
};
|
|
2149
2177
|
var rgbaToHexa = (_ref8) => {
|
|
2150
|
-
var
|
|
2151
|
-
r,
|
|
2152
|
-
g,
|
|
2153
|
-
b,
|
|
2154
|
-
a
|
|
2155
|
-
} = _ref8;
|
|
2178
|
+
var r = _ref8.r, g = _ref8.g, b = _ref8.b, a = _ref8.a;
|
|
2156
2179
|
var alpha = typeof a === "number" && (a * 255 | 1 << 8).toString(16).slice(1);
|
|
2157
2180
|
return "" + rgbToHex({
|
|
2158
2181
|
r,
|
|
@@ -2167,7 +2190,7 @@ var hexToRgba = (hex) => {
|
|
|
2167
2190
|
hex = "#" + htemp.charAt(0) + htemp.charAt(0) + htemp.charAt(1) + htemp.charAt(1) + htemp.charAt(2) + htemp.charAt(2);
|
|
2168
2191
|
}
|
|
2169
2192
|
var reg = new RegExp("[A-Za-z0-9]{2}", "g");
|
|
2170
|
-
var
|
|
2193
|
+
var _map2 = hex.match(reg).map((v) => parseInt(v, 16)), r = _map2[0], g = _map2[1], _map2$ = _map2[2], b = _map2$ === void 0 ? 0 : _map2$, a = _map2[3];
|
|
2171
2194
|
return {
|
|
2172
2195
|
r,
|
|
2173
2196
|
g,
|
|
@@ -2176,12 +2199,7 @@ var hexToRgba = (hex) => {
|
|
|
2176
2199
|
};
|
|
2177
2200
|
};
|
|
2178
2201
|
var hsvaToRgba = (_ref9) => {
|
|
2179
|
-
var
|
|
2180
|
-
h,
|
|
2181
|
-
s,
|
|
2182
|
-
v,
|
|
2183
|
-
a
|
|
2184
|
-
} = _ref9;
|
|
2202
|
+
var h = _ref9.h, s = _ref9.s, v = _ref9.v, a = _ref9.a;
|
|
2185
2203
|
var _h = h / 60, _s = s / SV_MAX, _v = v / SV_MAX, hi = Math.floor(_h) % 6;
|
|
2186
2204
|
var f = _h - Math.floor(_h), _p = RGB_MAX * _v * (1 - _s), _q = RGB_MAX * _v * (1 - _s * f), _t = RGB_MAX * _v * (1 - _s * (1 - f));
|
|
2187
2205
|
_v *= RGB_MAX;
|
|
@@ -2226,20 +2244,11 @@ var hsvaToRgba = (_ref9) => {
|
|
|
2226
2244
|
});
|
|
2227
2245
|
};
|
|
2228
2246
|
var hsvaToRgbaString = (hsva) => {
|
|
2229
|
-
var
|
|
2230
|
-
r,
|
|
2231
|
-
g,
|
|
2232
|
-
b,
|
|
2233
|
-
a
|
|
2234
|
-
} = hsvaToRgba(hsva);
|
|
2247
|
+
var _hsvaToRgba2 = hsvaToRgba(hsva), r = _hsvaToRgba2.r, g = _hsvaToRgba2.g, b = _hsvaToRgba2.b, a = _hsvaToRgba2.a;
|
|
2235
2248
|
return "rgba(" + r + ", " + g + ", " + b + ", " + a + ")";
|
|
2236
2249
|
};
|
|
2237
2250
|
var rgbaToRgb = (_ref0) => {
|
|
2238
|
-
var
|
|
2239
|
-
r,
|
|
2240
|
-
g,
|
|
2241
|
-
b
|
|
2242
|
-
} = _ref0;
|
|
2251
|
+
var r = _ref0.r, g = _ref0.g, b = _ref0.b;
|
|
2243
2252
|
return {
|
|
2244
2253
|
r,
|
|
2245
2254
|
g,
|
|
@@ -2247,11 +2256,7 @@ var rgbaToRgb = (_ref0) => {
|
|
|
2247
2256
|
};
|
|
2248
2257
|
};
|
|
2249
2258
|
var hslaToHsl = (_ref1) => {
|
|
2250
|
-
var
|
|
2251
|
-
h,
|
|
2252
|
-
s,
|
|
2253
|
-
l
|
|
2254
|
-
} = _ref1;
|
|
2259
|
+
var h = _ref1.h, s = _ref1.s, l = _ref1.l;
|
|
2255
2260
|
return {
|
|
2256
2261
|
h,
|
|
2257
2262
|
s,
|
|
@@ -2260,11 +2265,7 @@ var hslaToHsl = (_ref1) => {
|
|
|
2260
2265
|
};
|
|
2261
2266
|
var hsvaToHex = (hsva) => rgbToHex(hsvaToRgba(hsva));
|
|
2262
2267
|
var hsvaToHsv = (_ref10) => {
|
|
2263
|
-
var
|
|
2264
|
-
h,
|
|
2265
|
-
s,
|
|
2266
|
-
v
|
|
2267
|
-
} = _ref10;
|
|
2268
|
+
var h = _ref10.h, s = _ref10.s, v = _ref10.v;
|
|
2268
2269
|
return {
|
|
2269
2270
|
h,
|
|
2270
2271
|
s,
|
|
@@ -2272,11 +2273,7 @@ var hsvaToHsv = (_ref10) => {
|
|
|
2272
2273
|
};
|
|
2273
2274
|
};
|
|
2274
2275
|
var rgbToXY = (_ref12) => {
|
|
2275
|
-
var
|
|
2276
|
-
r,
|
|
2277
|
-
g,
|
|
2278
|
-
b
|
|
2279
|
-
} = _ref12;
|
|
2276
|
+
var r = _ref12.r, g = _ref12.g, b = _ref12.b;
|
|
2280
2277
|
var translateColor = function translateColor2(color2) {
|
|
2281
2278
|
return color2 <= 0.04045 ? color2 / 12.92 : Math.pow((color2 + 0.055) / 1.055, 2.4);
|
|
2282
2279
|
};
|
|
@@ -2329,15 +2326,15 @@ var color = (str) => {
|
|
|
2329
2326
|
};
|
|
2330
2327
|
var validHex = (hex) => /^#?([A-Fa-f0-9]{3,4}){1,2}$/.test(hex);
|
|
2331
2328
|
|
|
2332
|
-
// node_modules/@uiw/react-drag-event-interactive/esm/index.js
|
|
2329
|
+
// ../node_modules/@uiw/react-drag-event-interactive/esm/index.js
|
|
2333
2330
|
var import_extends2 = __toESM(require_extends());
|
|
2334
2331
|
var import_objectWithoutPropertiesLoose = __toESM(require_objectWithoutPropertiesLoose());
|
|
2335
2332
|
function useEventCallback(handler) {
|
|
2336
|
-
var callbackRef =
|
|
2337
|
-
|
|
2333
|
+
var callbackRef = React26.useRef(handler);
|
|
2334
|
+
React26.useEffect(() => {
|
|
2338
2335
|
callbackRef.current = handler;
|
|
2339
2336
|
});
|
|
2340
|
-
return
|
|
2337
|
+
return React26.useCallback((value, event) => callbackRef.current && callbackRef.current(value, event), []);
|
|
2341
2338
|
}
|
|
2342
2339
|
var isTouch = (event) => "touches" in event;
|
|
2343
2340
|
var preventDefaultMove = (event) => {
|
|
@@ -2365,16 +2362,11 @@ var getRelativePosition = (node, event) => {
|
|
|
2365
2362
|
};
|
|
2366
2363
|
};
|
|
2367
2364
|
var _excluded = ["prefixCls", "className", "onMove", "onDown"];
|
|
2368
|
-
var Interactive = /* @__PURE__ */
|
|
2369
|
-
var
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
onDown
|
|
2374
|
-
} = props, reset = (0, import_objectWithoutPropertiesLoose.default)(props, _excluded);
|
|
2375
|
-
var container = React25.useRef(null);
|
|
2376
|
-
var hasTouched = React25.useRef(false);
|
|
2377
|
-
var [isDragging, setDragging] = React25.useState(false);
|
|
2365
|
+
var Interactive = /* @__PURE__ */ React26__namespace.default.forwardRef((props, ref) => {
|
|
2366
|
+
var _props$prefixCls = props.prefixCls, prefixCls = _props$prefixCls === void 0 ? "w-color-interactive" : _props$prefixCls, className = props.className, onMove = props.onMove, onDown = props.onDown, reset = (0, import_objectWithoutPropertiesLoose.default)(props, _excluded);
|
|
2367
|
+
var container = React26.useRef(null);
|
|
2368
|
+
var hasTouched = React26.useRef(false);
|
|
2369
|
+
var _useState = React26.useState(false), isDragging = _useState[0], setDragging = _useState[1];
|
|
2378
2370
|
var onMoveCallback = useEventCallback(onMove);
|
|
2379
2371
|
var onKeyCallback = useEventCallback(onDown);
|
|
2380
2372
|
var isValid = (event) => {
|
|
@@ -2382,7 +2374,7 @@ var Interactive = /* @__PURE__ */ React25__namespace.default.forwardRef((props,
|
|
|
2382
2374
|
hasTouched.current = isTouch(event);
|
|
2383
2375
|
return true;
|
|
2384
2376
|
};
|
|
2385
|
-
var handleMove =
|
|
2377
|
+
var handleMove = React26.useCallback((event) => {
|
|
2386
2378
|
preventDefaultMove(event);
|
|
2387
2379
|
if (!container.current) return;
|
|
2388
2380
|
var isDown = isTouch(event) ? event.touches.length > 0 : event.buttons > 0;
|
|
@@ -2392,8 +2384,8 @@ var Interactive = /* @__PURE__ */ React25__namespace.default.forwardRef((props,
|
|
|
2392
2384
|
}
|
|
2393
2385
|
onMoveCallback == null || onMoveCallback(getRelativePosition(container.current, event), event);
|
|
2394
2386
|
}, [onMoveCallback]);
|
|
2395
|
-
var handleMoveEnd =
|
|
2396
|
-
var toggleDocumentEvents =
|
|
2387
|
+
var handleMoveEnd = React26.useCallback(() => setDragging(false), []);
|
|
2388
|
+
var toggleDocumentEvents = React26.useCallback((state) => {
|
|
2397
2389
|
if (state) {
|
|
2398
2390
|
window.addEventListener(hasTouched.current ? "touchmove" : "mousemove", handleMove);
|
|
2399
2391
|
window.addEventListener(hasTouched.current ? "touchend" : "mouseup", handleMoveEnd);
|
|
@@ -2404,13 +2396,13 @@ var Interactive = /* @__PURE__ */ React25__namespace.default.forwardRef((props,
|
|
|
2404
2396
|
window.removeEventListener("touchend", handleMoveEnd);
|
|
2405
2397
|
}
|
|
2406
2398
|
}, [handleMove, handleMoveEnd]);
|
|
2407
|
-
|
|
2399
|
+
React26.useEffect(() => {
|
|
2408
2400
|
toggleDocumentEvents(isDragging);
|
|
2409
2401
|
return () => {
|
|
2410
2402
|
toggleDocumentEvents(false);
|
|
2411
2403
|
};
|
|
2412
2404
|
}, [isDragging, handleMove, handleMoveEnd, toggleDocumentEvents]);
|
|
2413
|
-
var handleMoveStart =
|
|
2405
|
+
var handleMoveStart = React26.useCallback((event) => {
|
|
2414
2406
|
var activeEl = document.activeElement;
|
|
2415
2407
|
activeEl == null || activeEl.blur();
|
|
2416
2408
|
preventDefaultMove(event.nativeEvent);
|
|
@@ -2433,13 +2425,7 @@ var Interactive = /* @__PURE__ */ React25__namespace.default.forwardRef((props,
|
|
|
2433
2425
|
Interactive.displayName = "Interactive";
|
|
2434
2426
|
var esm_default = Interactive;
|
|
2435
2427
|
var Pointer = (_ref) => {
|
|
2436
|
-
var
|
|
2437
|
-
className,
|
|
2438
|
-
color: color2,
|
|
2439
|
-
left,
|
|
2440
|
-
top,
|
|
2441
|
-
prefixCls
|
|
2442
|
-
} = _ref;
|
|
2428
|
+
var className = _ref.className, color2 = _ref.color, left = _ref.left, top = _ref.top, prefixCls = _ref.prefixCls;
|
|
2443
2429
|
var style = {
|
|
2444
2430
|
position: "absolute",
|
|
2445
2431
|
top,
|
|
@@ -2454,7 +2440,7 @@ var Pointer = (_ref) => {
|
|
|
2454
2440
|
borderRadius: "50%",
|
|
2455
2441
|
backgroundColor: color2
|
|
2456
2442
|
};
|
|
2457
|
-
return
|
|
2443
|
+
return React26.useMemo(() => /* @__PURE__ */ jsxRuntime.jsx("div", {
|
|
2458
2444
|
className: prefixCls + "-pointer " + (className || ""),
|
|
2459
2445
|
style,
|
|
2460
2446
|
children: /* @__PURE__ */ jsxRuntime.jsx("div", {
|
|
@@ -2464,18 +2450,9 @@ var Pointer = (_ref) => {
|
|
|
2464
2450
|
}), [top, left, color2, className, prefixCls]);
|
|
2465
2451
|
};
|
|
2466
2452
|
var _excluded2 = ["prefixCls", "radius", "pointer", "className", "hue", "style", "hsva", "onChange"];
|
|
2467
|
-
var Saturation = /* @__PURE__ */
|
|
2453
|
+
var Saturation = /* @__PURE__ */ React26__namespace.default.forwardRef((props, ref) => {
|
|
2468
2454
|
var _hsva$h;
|
|
2469
|
-
var
|
|
2470
|
-
prefixCls = "w-color-saturation",
|
|
2471
|
-
radius = 0,
|
|
2472
|
-
pointer,
|
|
2473
|
-
className,
|
|
2474
|
-
hue = 0,
|
|
2475
|
-
style,
|
|
2476
|
-
hsva,
|
|
2477
|
-
onChange
|
|
2478
|
-
} = props, other = (0, import_objectWithoutPropertiesLoose2.default)(props, _excluded2);
|
|
2455
|
+
var _props$prefixCls = props.prefixCls, prefixCls = _props$prefixCls === void 0 ? "w-color-saturation" : _props$prefixCls, _props$radius = props.radius, radius = _props$radius === void 0 ? 0 : _props$radius, pointer = props.pointer, className = props.className, _props$hue = props.hue, hue = _props$hue === void 0 ? 0 : _props$hue, style = props.style, hsva = props.hsva, onChange = props.onChange, other = (0, import_objectWithoutPropertiesLoose2.default)(props, _excluded2);
|
|
2479
2456
|
var containerStyle = (0, import_extends3.default)({
|
|
2480
2457
|
width: 200,
|
|
2481
2458
|
height: 200,
|
|
@@ -2483,7 +2460,16 @@ var Saturation = /* @__PURE__ */ React25__namespace.default.forwardRef((props, r
|
|
|
2483
2460
|
}, style, {
|
|
2484
2461
|
position: "relative"
|
|
2485
2462
|
});
|
|
2486
|
-
var
|
|
2463
|
+
var containerRef = React26.useRef(null);
|
|
2464
|
+
var combinedRef = React26.useCallback((node) => {
|
|
2465
|
+
containerRef.current = node;
|
|
2466
|
+
if (typeof ref === "function") {
|
|
2467
|
+
ref(node);
|
|
2468
|
+
} else if (ref && "current" in ref) {
|
|
2469
|
+
ref.current = node;
|
|
2470
|
+
}
|
|
2471
|
+
}, [ref]);
|
|
2472
|
+
var handleChange = React26.useCallback((interaction, event) => {
|
|
2487
2473
|
onChange && hsva && onChange({
|
|
2488
2474
|
h: hsva.h,
|
|
2489
2475
|
s: interaction.left * 100,
|
|
@@ -2491,8 +2477,12 @@ var Saturation = /* @__PURE__ */ React25__namespace.default.forwardRef((props, r
|
|
|
2491
2477
|
a: hsva.a
|
|
2492
2478
|
// source: 'hsv',
|
|
2493
2479
|
});
|
|
2494
|
-
|
|
2495
|
-
|
|
2480
|
+
var element = containerRef.current;
|
|
2481
|
+
if (element) {
|
|
2482
|
+
element.focus();
|
|
2483
|
+
}
|
|
2484
|
+
}, [hsva, onChange]);
|
|
2485
|
+
var handleKeyDown = React26.useCallback((event) => {
|
|
2496
2486
|
if (!hsva || !onChange) return;
|
|
2497
2487
|
var step = 1;
|
|
2498
2488
|
var newS = hsva.s;
|
|
@@ -2531,7 +2521,7 @@ var Saturation = /* @__PURE__ */ React25__namespace.default.forwardRef((props, r
|
|
|
2531
2521
|
});
|
|
2532
2522
|
}
|
|
2533
2523
|
}, [hsva, onChange]);
|
|
2534
|
-
var pointerElement =
|
|
2524
|
+
var pointerElement = React26.useMemo(() => {
|
|
2535
2525
|
if (!hsva) return null;
|
|
2536
2526
|
var comProps = {
|
|
2537
2527
|
top: 100 - hsva.v + "%",
|
|
@@ -2547,7 +2537,7 @@ var Saturation = /* @__PURE__ */ React25__namespace.default.forwardRef((props, r
|
|
|
2547
2537
|
prefixCls
|
|
2548
2538
|
}, comProps));
|
|
2549
2539
|
}, [hsva, pointer, prefixCls]);
|
|
2550
|
-
var handleClick =
|
|
2540
|
+
var handleClick = React26.useCallback((event) => {
|
|
2551
2541
|
event.target.focus();
|
|
2552
2542
|
}, []);
|
|
2553
2543
|
return /* @__PURE__ */ jsxRuntime.jsx(esm_default, (0, import_extends3.default)({
|
|
@@ -2561,7 +2551,7 @@ var Saturation = /* @__PURE__ */ React25__namespace.default.forwardRef((props, r
|
|
|
2561
2551
|
}, containerStyle, {
|
|
2562
2552
|
outline: "none"
|
|
2563
2553
|
}),
|
|
2564
|
-
ref,
|
|
2554
|
+
ref: combinedRef,
|
|
2565
2555
|
onMove: handleChange,
|
|
2566
2556
|
onDown: handleChange,
|
|
2567
2557
|
onKeyDown: handleKeyDown,
|
|
@@ -2572,23 +2562,16 @@ var Saturation = /* @__PURE__ */ React25__namespace.default.forwardRef((props, r
|
|
|
2572
2562
|
Saturation.displayName = "Saturation";
|
|
2573
2563
|
var esm_default2 = Saturation;
|
|
2574
2564
|
|
|
2575
|
-
// node_modules/@uiw/react-color-alpha/esm/index.js
|
|
2565
|
+
// ../node_modules/@uiw/react-color-alpha/esm/index.js
|
|
2576
2566
|
var import_extends5 = __toESM(require_extends());
|
|
2577
2567
|
var import_objectWithoutPropertiesLoose4 = __toESM(require_objectWithoutPropertiesLoose());
|
|
2578
2568
|
|
|
2579
|
-
// node_modules/@uiw/react-color-alpha/esm/Pointer.js
|
|
2569
|
+
// ../node_modules/@uiw/react-color-alpha/esm/Pointer.js
|
|
2580
2570
|
var import_extends4 = __toESM(require_extends());
|
|
2581
2571
|
var import_objectWithoutPropertiesLoose3 = __toESM(require_objectWithoutPropertiesLoose());
|
|
2582
2572
|
var _excluded3 = ["className", "prefixCls", "left", "top", "style", "fillProps"];
|
|
2583
2573
|
var Pointer2 = (_ref) => {
|
|
2584
|
-
var
|
|
2585
|
-
className,
|
|
2586
|
-
prefixCls,
|
|
2587
|
-
left,
|
|
2588
|
-
top,
|
|
2589
|
-
style,
|
|
2590
|
-
fillProps
|
|
2591
|
-
} = _ref, reset = (0, import_objectWithoutPropertiesLoose3.default)(_ref, _excluded3);
|
|
2574
|
+
var className = _ref.className, prefixCls = _ref.prefixCls, left = _ref.left, top = _ref.top, style = _ref.style, fillProps = _ref.fillProps, reset = (0, import_objectWithoutPropertiesLoose3.default)(_ref, _excluded3);
|
|
2592
2575
|
var styleWrapper = (0, import_extends4.default)({}, style, {
|
|
2593
2576
|
position: "absolute",
|
|
2594
2577
|
left,
|
|
@@ -2614,39 +2597,40 @@ var Pointer2 = (_ref) => {
|
|
|
2614
2597
|
}))
|
|
2615
2598
|
}));
|
|
2616
2599
|
};
|
|
2617
|
-
var _excluded4 = ["prefixCls", "className", "hsva", "background", "bgProps", "innerProps", "pointerProps", "radius", "width", "height", "direction", "style", "onChange", "pointer"];
|
|
2600
|
+
var _excluded4 = ["prefixCls", "className", "hsva", "background", "bgProps", "innerProps", "pointerProps", "radius", "width", "height", "direction", "reverse", "style", "onChange", "pointer"];
|
|
2618
2601
|
var BACKGROUND_IMG = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAMUlEQVQ4T2NkYGAQYcAP3uCTZhw1gGGYhAGBZIA/nYDCgBDAm9BGDWAAJyRCgLaBCAAgXwixzAS0pgAAAABJRU5ErkJggg==";
|
|
2619
|
-
var Alpha = /* @__PURE__ */
|
|
2620
|
-
var {
|
|
2621
|
-
|
|
2622
|
-
|
|
2623
|
-
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
|
|
2627
|
-
|
|
2628
|
-
|
|
2629
|
-
|
|
2630
|
-
|
|
2631
|
-
|
|
2632
|
-
|
|
2633
|
-
|
|
2634
|
-
pointer
|
|
2635
|
-
} = props, other = (0, import_objectWithoutPropertiesLoose4.default)(props, _excluded4);
|
|
2602
|
+
var Alpha = /* @__PURE__ */ React26__namespace.default.forwardRef((props, ref) => {
|
|
2603
|
+
var _props$prefixCls = props.prefixCls, prefixCls = _props$prefixCls === void 0 ? "w-color-alpha" : _props$prefixCls, className = props.className, hsva = props.hsva, background = props.background, _props$bgProps = props.bgProps, bgProps = _props$bgProps === void 0 ? {} : _props$bgProps, _props$innerProps = props.innerProps, innerProps = _props$innerProps === void 0 ? {} : _props$innerProps, _props$pointerProps = props.pointerProps, pointerProps = _props$pointerProps === void 0 ? {} : _props$pointerProps, _props$radius = props.radius, radius = _props$radius === void 0 ? 0 : _props$radius, width = props.width, _props$height = props.height, height = _props$height === void 0 ? 16 : _props$height, _props$direction = props.direction, direction = _props$direction === void 0 ? "horizontal" : _props$direction, _props$reverse = props.reverse, reverse = _props$reverse === void 0 ? false : _props$reverse, style = props.style, onChange = props.onChange, pointer = props.pointer, other = (0, import_objectWithoutPropertiesLoose4.default)(props, _excluded4);
|
|
2604
|
+
var offsetToAlpha = React26.useCallback((offset) => {
|
|
2605
|
+
var value = direction === "horizontal" ? offset.left : offset.top;
|
|
2606
|
+
if (direction === "horizontal") {
|
|
2607
|
+
return reverse ? 1 - value : value;
|
|
2608
|
+
}
|
|
2609
|
+
return reverse ? value : 1 - value;
|
|
2610
|
+
}, [direction, reverse]);
|
|
2611
|
+
var alphaToOffset = React26.useCallback((alpha) => {
|
|
2612
|
+
if (direction === "horizontal") {
|
|
2613
|
+
return reverse ? 1 - alpha : alpha;
|
|
2614
|
+
}
|
|
2615
|
+
return reverse ? alpha : 1 - alpha;
|
|
2616
|
+
}, [direction, reverse]);
|
|
2636
2617
|
var handleChange = (offset) => {
|
|
2618
|
+
var alpha = offsetToAlpha(offset);
|
|
2637
2619
|
onChange && onChange((0, import_extends5.default)({}, hsva, {
|
|
2638
|
-
a:
|
|
2620
|
+
a: alpha
|
|
2639
2621
|
}), offset);
|
|
2640
2622
|
};
|
|
2641
2623
|
var colorTo = hsvaToHslaString(Object.assign({}, hsva, {
|
|
2642
2624
|
a: 1
|
|
2643
2625
|
}));
|
|
2644
|
-
var
|
|
2626
|
+
var horizontalGradient = reverse ? "linear-gradient(to right, " + colorTo + " 0%, rgba(244, 67, 54, 0) 100%)" : "linear-gradient(to right, rgba(244, 67, 54, 0) 0%, " + colorTo + " 100%)";
|
|
2627
|
+
var verticalGradient = reverse ? "linear-gradient(to bottom, rgba(244, 67, 54, 0) 0%, " + colorTo + " 100%)" : "linear-gradient(to bottom, " + colorTo + " 0%, rgba(244, 67, 54, 0) 100%)";
|
|
2628
|
+
var innerBackground = direction === "horizontal" ? horizontalGradient : verticalGradient;
|
|
2645
2629
|
var comProps = {};
|
|
2646
2630
|
if (direction === "horizontal") {
|
|
2647
|
-
comProps.left = hsva.a * 100 + "%";
|
|
2631
|
+
comProps.left = alphaToOffset(hsva.a) * 100 + "%";
|
|
2648
2632
|
} else {
|
|
2649
|
-
comProps.top = hsva.a * 100 + "%";
|
|
2633
|
+
comProps.top = alphaToOffset(hsva.a) * 100 + "%";
|
|
2650
2634
|
}
|
|
2651
2635
|
var styleWrapper = (0, import_extends5.default)({
|
|
2652
2636
|
"--alpha-background-color": "#fff",
|
|
@@ -2661,32 +2645,32 @@ var Alpha = /* @__PURE__ */ React25__namespace.default.forwardRef((props, ref) =
|
|
|
2661
2645
|
}, style, {
|
|
2662
2646
|
position: "relative"
|
|
2663
2647
|
});
|
|
2664
|
-
var handleKeyDown =
|
|
2648
|
+
var handleKeyDown = React26.useCallback((event) => {
|
|
2665
2649
|
var step = 0.01;
|
|
2666
2650
|
var currentAlpha = hsva.a;
|
|
2667
2651
|
var newAlpha = currentAlpha;
|
|
2668
2652
|
switch (event.key) {
|
|
2669
2653
|
case "ArrowLeft":
|
|
2670
2654
|
if (direction === "horizontal") {
|
|
2671
|
-
newAlpha = Math.max(0, currentAlpha - step);
|
|
2655
|
+
newAlpha = reverse ? Math.min(1, currentAlpha + step) : Math.max(0, currentAlpha - step);
|
|
2672
2656
|
event.preventDefault();
|
|
2673
2657
|
}
|
|
2674
2658
|
break;
|
|
2675
2659
|
case "ArrowRight":
|
|
2676
2660
|
if (direction === "horizontal") {
|
|
2677
|
-
newAlpha = Math.min(1, currentAlpha + step);
|
|
2661
|
+
newAlpha = reverse ? Math.max(0, currentAlpha - step) : Math.min(1, currentAlpha + step);
|
|
2678
2662
|
event.preventDefault();
|
|
2679
2663
|
}
|
|
2680
2664
|
break;
|
|
2681
2665
|
case "ArrowUp":
|
|
2682
2666
|
if (direction === "vertical") {
|
|
2683
|
-
newAlpha = Math.max(0, currentAlpha - step);
|
|
2667
|
+
newAlpha = reverse ? Math.max(0, currentAlpha - step) : Math.min(1, currentAlpha + step);
|
|
2684
2668
|
event.preventDefault();
|
|
2685
2669
|
}
|
|
2686
2670
|
break;
|
|
2687
2671
|
case "ArrowDown":
|
|
2688
2672
|
if (direction === "vertical") {
|
|
2689
|
-
newAlpha = Math.min(1, currentAlpha + step);
|
|
2673
|
+
newAlpha = reverse ? Math.min(1, currentAlpha + step) : Math.max(0, currentAlpha - step);
|
|
2690
2674
|
event.preventDefault();
|
|
2691
2675
|
}
|
|
2692
2676
|
break;
|
|
@@ -2694,9 +2678,10 @@ var Alpha = /* @__PURE__ */ React25__namespace.default.forwardRef((props, ref) =
|
|
|
2694
2678
|
return;
|
|
2695
2679
|
}
|
|
2696
2680
|
if (newAlpha !== currentAlpha) {
|
|
2681
|
+
var syntheticAxisOffset = alphaToOffset(newAlpha);
|
|
2697
2682
|
var syntheticOffset = {
|
|
2698
|
-
left: direction === "horizontal" ?
|
|
2699
|
-
top: direction === "vertical" ?
|
|
2683
|
+
left: direction === "horizontal" ? syntheticAxisOffset : hsva.a,
|
|
2684
|
+
top: direction === "vertical" ? syntheticAxisOffset : hsva.a,
|
|
2700
2685
|
width: 0,
|
|
2701
2686
|
height: 0,
|
|
2702
2687
|
x: 0,
|
|
@@ -2706,8 +2691,8 @@ var Alpha = /* @__PURE__ */ React25__namespace.default.forwardRef((props, ref) =
|
|
|
2706
2691
|
a: newAlpha
|
|
2707
2692
|
}), syntheticOffset);
|
|
2708
2693
|
}
|
|
2709
|
-
}, [hsva, direction, onChange]);
|
|
2710
|
-
var handleClick =
|
|
2694
|
+
}, [alphaToOffset, hsva, direction, onChange, reverse]);
|
|
2695
|
+
var handleClick = React26.useCallback((event) => {
|
|
2711
2696
|
event.target.focus();
|
|
2712
2697
|
}, []);
|
|
2713
2698
|
var pointerElement = pointer && typeof pointer === "function" ? pointer((0, import_extends5.default)({
|
|
@@ -2744,29 +2729,19 @@ var Alpha = /* @__PURE__ */ React25__namespace.default.forwardRef((props, ref) =
|
|
|
2744
2729
|
Alpha.displayName = "Alpha";
|
|
2745
2730
|
var esm_default3 = Alpha;
|
|
2746
2731
|
|
|
2747
|
-
// node_modules/@uiw/react-color-editable-input/esm/index.js
|
|
2732
|
+
// ../node_modules/@uiw/react-color-editable-input/esm/index.js
|
|
2748
2733
|
var import_extends6 = __toESM(require_extends());
|
|
2749
2734
|
var import_objectWithoutPropertiesLoose5 = __toESM(require_objectWithoutPropertiesLoose());
|
|
2750
2735
|
var _excluded5 = ["prefixCls", "placement", "label", "value", "className", "style", "labelStyle", "inputStyle", "onChange", "onBlur", "renderInput"];
|
|
2751
2736
|
var validHex2 = (hex) => /^#?([A-Fa-f0-9]{3,4}){1,2}$/.test(hex);
|
|
2752
2737
|
var getNumberValue = (value) => Number(String(value).replace(/%/g, ""));
|
|
2753
|
-
var EditableInput = /* @__PURE__ */
|
|
2754
|
-
var
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
|
|
2760
|
-
style,
|
|
2761
|
-
labelStyle,
|
|
2762
|
-
inputStyle,
|
|
2763
|
-
onChange,
|
|
2764
|
-
onBlur,
|
|
2765
|
-
renderInput
|
|
2766
|
-
} = props, other = (0, import_objectWithoutPropertiesLoose5.default)(props, _excluded5);
|
|
2767
|
-
var [value, setValue] = React25.useState(initValue);
|
|
2768
|
-
var isFocus = React25.useRef(false);
|
|
2769
|
-
React25.useEffect(() => {
|
|
2738
|
+
var EditableInput = /* @__PURE__ */ React26__namespace.default.forwardRef((props, ref) => {
|
|
2739
|
+
var _props$prefixCls = props.prefixCls, prefixCls = _props$prefixCls === void 0 ? "w-color-editable-input" : _props$prefixCls, _props$placement = props.placement, placement = _props$placement === void 0 ? "bottom" : _props$placement, label = props.label, initValue = props.value, className = props.className, style = props.style, labelStyle = props.labelStyle, inputStyle = props.inputStyle, onChange = props.onChange, onBlur = props.onBlur, renderInput = props.renderInput, other = (0, import_objectWithoutPropertiesLoose5.default)(props, _excluded5);
|
|
2740
|
+
var _useState = React26.useState(initValue), value = _useState[0], setValue = _useState[1];
|
|
2741
|
+
var isFocus = React26.useRef(false);
|
|
2742
|
+
var inputIdRef = React26.useRef(other.id || prefixCls + "-" + Math.random().toString(36).slice(2, 11));
|
|
2743
|
+
var inputId = other.id || inputIdRef.current;
|
|
2744
|
+
React26.useEffect(() => {
|
|
2770
2745
|
if (props.value !== value) {
|
|
2771
2746
|
if (!isFocus.current) {
|
|
2772
2747
|
setValue(props.value);
|
|
@@ -2828,6 +2803,7 @@ var EditableInput = /* @__PURE__ */ React25__namespace.default.forwardRef((props
|
|
|
2828
2803
|
autoComplete: "off",
|
|
2829
2804
|
onFocus: () => isFocus.current = true
|
|
2830
2805
|
}, other, {
|
|
2806
|
+
id: inputId,
|
|
2831
2807
|
style: editableStyle,
|
|
2832
2808
|
onFocusCapture: (e) => {
|
|
2833
2809
|
var elm = e.target;
|
|
@@ -2839,7 +2815,8 @@ var EditableInput = /* @__PURE__ */ React25__namespace.default.forwardRef((props
|
|
|
2839
2815
|
style: wrapperStyle,
|
|
2840
2816
|
children: [renderInput ? renderInput(inputProps, ref) : /* @__PURE__ */ jsxRuntime.jsx("input", (0, import_extends6.default)({
|
|
2841
2817
|
ref
|
|
2842
|
-
}, inputProps)), label && /* @__PURE__ */ jsxRuntime.jsx("
|
|
2818
|
+
}, inputProps)), label && /* @__PURE__ */ jsxRuntime.jsx("label", {
|
|
2819
|
+
htmlFor: inputId,
|
|
2843
2820
|
style: (0, import_extends6.default)({
|
|
2844
2821
|
color: "var(--editable-input-label-color)",
|
|
2845
2822
|
textTransform: "capitalize"
|
|
@@ -2851,23 +2828,12 @@ var EditableInput = /* @__PURE__ */ React25__namespace.default.forwardRef((props
|
|
|
2851
2828
|
EditableInput.displayName = "EditableInput";
|
|
2852
2829
|
var esm_default4 = EditableInput;
|
|
2853
2830
|
|
|
2854
|
-
// node_modules/@uiw/react-color-editable-input-rgba/esm/index.js
|
|
2831
|
+
// ../node_modules/@uiw/react-color-editable-input-rgba/esm/index.js
|
|
2855
2832
|
var import_extends7 = __toESM(require_extends());
|
|
2856
2833
|
var import_objectWithoutPropertiesLoose6 = __toESM(require_objectWithoutPropertiesLoose());
|
|
2857
2834
|
var _excluded6 = ["prefixCls", "hsva", "placement", "rProps", "gProps", "bProps", "aProps", "className", "style", "onChange"];
|
|
2858
|
-
var EditableInputRGBA = /* @__PURE__ */
|
|
2859
|
-
var {
|
|
2860
|
-
prefixCls = "w-color-editable-input-rgba",
|
|
2861
|
-
hsva,
|
|
2862
|
-
placement = "bottom",
|
|
2863
|
-
rProps = {},
|
|
2864
|
-
gProps = {},
|
|
2865
|
-
bProps = {},
|
|
2866
|
-
aProps = {},
|
|
2867
|
-
className,
|
|
2868
|
-
style,
|
|
2869
|
-
onChange
|
|
2870
|
-
} = props, other = (0, import_objectWithoutPropertiesLoose6.default)(props, _excluded6);
|
|
2835
|
+
var EditableInputRGBA = /* @__PURE__ */ React26__namespace.default.forwardRef((props, ref) => {
|
|
2836
|
+
var _props$prefixCls = props.prefixCls, prefixCls = _props$prefixCls === void 0 ? "w-color-editable-input-rgba" : _props$prefixCls, hsva = props.hsva, _props$placement = props.placement, placement = _props$placement === void 0 ? "bottom" : _props$placement, _props$rProps = props.rProps, rProps = _props$rProps === void 0 ? {} : _props$rProps, _props$gProps = props.gProps, gProps = _props$gProps === void 0 ? {} : _props$gProps, _props$bProps = props.bProps, bProps = _props$bProps === void 0 ? {} : _props$bProps, _props$aProps = props.aProps, aProps = _props$aProps === void 0 ? {} : _props$aProps, className = props.className, style = props.style, onChange = props.onChange, other = (0, import_objectWithoutPropertiesLoose6.default)(props, _excluded6);
|
|
2871
2837
|
var rgba = hsva ? hsvaToRgba(hsva) : {};
|
|
2872
2838
|
function handleBlur(evn) {
|
|
2873
2839
|
var value = Number(evn.target.value);
|
|
@@ -2947,7 +2913,7 @@ var EditableInputRGBA = /* @__PURE__ */ React25__namespace.default.forwardRef((p
|
|
|
2947
2913
|
}, gProps, {
|
|
2948
2914
|
style: (0, import_extends7.default)({
|
|
2949
2915
|
marginLeft: 5
|
|
2950
|
-
},
|
|
2916
|
+
}, gProps.style)
|
|
2951
2917
|
})), /* @__PURE__ */ jsxRuntime.jsx(esm_default4, (0, import_extends7.default)({
|
|
2952
2918
|
label: "B",
|
|
2953
2919
|
value: rgba.b || 0,
|
|
@@ -2974,24 +2940,43 @@ var EditableInputRGBA = /* @__PURE__ */ React25__namespace.default.forwardRef((p
|
|
|
2974
2940
|
EditableInputRGBA.displayName = "EditableInputRGBA";
|
|
2975
2941
|
var esm_default5 = EditableInputRGBA;
|
|
2976
2942
|
|
|
2977
|
-
// node_modules/@uiw/react-color-hue/esm/index.js
|
|
2943
|
+
// ../node_modules/@uiw/react-color-hue/esm/index.js
|
|
2978
2944
|
var import_extends8 = __toESM(require_extends());
|
|
2979
2945
|
var import_objectWithoutPropertiesLoose7 = __toESM(require_objectWithoutPropertiesLoose());
|
|
2980
|
-
var _excluded7 = ["prefixCls", "className", "hue", "onChange", "direction"];
|
|
2981
|
-
var
|
|
2982
|
-
|
|
2983
|
-
|
|
2984
|
-
|
|
2985
|
-
|
|
2986
|
-
|
|
2987
|
-
|
|
2988
|
-
|
|
2946
|
+
var _excluded7 = ["prefixCls", "className", "hue", "onChange", "direction", "reverse"];
|
|
2947
|
+
var NORMAL_COLORS = "rgb(255, 0, 0) 0%, rgb(255, 255, 0) 17%, rgb(0, 255, 0) 33%, rgb(0, 255, 255) 50%, rgb(0, 0, 255) 67%, rgb(255, 0, 255) 83%, rgb(255, 0, 0) 100%";
|
|
2948
|
+
var REVERSED_COLORS = "rgb(255, 0, 0) 0%, rgb(255, 0, 255) 17%, rgb(0, 0, 255) 33%, rgb(0, 255, 255) 50%, rgb(0, 255, 0) 67%, rgb(255, 255, 0) 83%, rgb(255, 0, 0) 100%";
|
|
2949
|
+
var Hue = /* @__PURE__ */ React26__namespace.default.forwardRef((props, ref) => {
|
|
2950
|
+
var _props$prefixCls = props.prefixCls, prefixCls = _props$prefixCls === void 0 ? "w-color-hue" : _props$prefixCls, className = props.className, _props$hue = props.hue, hue = _props$hue === void 0 ? 0 : _props$hue, _onChange = props.onChange, _props$direction = props.direction, direction = _props$direction === void 0 ? "horizontal" : _props$direction, _props$reverse = props.reverse, reverse = _props$reverse === void 0 ? false : _props$reverse, other = (0, import_objectWithoutPropertiesLoose7.default)(props, _excluded7);
|
|
2951
|
+
var getGradientBackground = React26.useCallback(() => {
|
|
2952
|
+
if (direction === "horizontal") {
|
|
2953
|
+
var colors = reverse ? REVERSED_COLORS : NORMAL_COLORS;
|
|
2954
|
+
var gradientDirection = "right";
|
|
2955
|
+
return "linear-gradient(to " + gradientDirection + ", " + colors + ")";
|
|
2956
|
+
} else {
|
|
2957
|
+
var _colors = reverse ? NORMAL_COLORS : REVERSED_COLORS;
|
|
2958
|
+
var _gradientDirection = "bottom";
|
|
2959
|
+
return "linear-gradient(to " + _gradientDirection + ", " + _colors + ")";
|
|
2960
|
+
}
|
|
2961
|
+
}, [direction, reverse]);
|
|
2962
|
+
var getHueFromInteraction = React26.useCallback((interaction) => {
|
|
2963
|
+
var value = direction === "horizontal" ? interaction.left : interaction.top;
|
|
2964
|
+
var normalizedValue;
|
|
2965
|
+
if (direction === "horizontal") {
|
|
2966
|
+
normalizedValue = reverse ? 1 - value : value;
|
|
2967
|
+
} else {
|
|
2968
|
+
normalizedValue = reverse ? value : 1 - value;
|
|
2969
|
+
}
|
|
2970
|
+
return 360 * normalizedValue;
|
|
2971
|
+
}, [direction, reverse]);
|
|
2972
|
+
var gradientBackground = React26.useMemo(() => getGradientBackground(), [getGradientBackground]);
|
|
2989
2973
|
return /* @__PURE__ */ jsxRuntime.jsx(esm_default3, (0, import_extends8.default)({
|
|
2990
2974
|
ref,
|
|
2991
2975
|
className: prefixCls + " " + (className || "")
|
|
2992
2976
|
}, other, {
|
|
2993
2977
|
direction,
|
|
2994
|
-
|
|
2978
|
+
reverse,
|
|
2979
|
+
background: gradientBackground,
|
|
2995
2980
|
hsva: {
|
|
2996
2981
|
h: hue,
|
|
2997
2982
|
s: 100,
|
|
@@ -3000,7 +2985,7 @@ var Hue = /* @__PURE__ */ React25__namespace.default.forwardRef((props, ref) =>
|
|
|
3000
2985
|
},
|
|
3001
2986
|
onChange: (_, interaction) => {
|
|
3002
2987
|
_onChange && _onChange({
|
|
3003
|
-
h:
|
|
2988
|
+
h: getHueFromInteraction(interaction)
|
|
3004
2989
|
});
|
|
3005
2990
|
}
|
|
3006
2991
|
}));
|
|
@@ -3008,23 +2993,12 @@ var Hue = /* @__PURE__ */ React25__namespace.default.forwardRef((props, ref) =>
|
|
|
3008
2993
|
Hue.displayName = "Hue";
|
|
3009
2994
|
var esm_default6 = Hue;
|
|
3010
2995
|
|
|
3011
|
-
// node_modules/@uiw/react-color-swatch/esm/index.js
|
|
2996
|
+
// ../node_modules/@uiw/react-color-swatch/esm/index.js
|
|
3012
2997
|
var import_extends9 = __toESM(require_extends());
|
|
3013
2998
|
var import_objectWithoutPropertiesLoose8 = __toESM(require_objectWithoutPropertiesLoose());
|
|
3014
2999
|
var _excluded8 = ["prefixCls", "className", "color", "colors", "style", "rectProps", "onChange", "addonAfter", "addonBefore", "rectRender"];
|
|
3015
|
-
var Swatch = /* @__PURE__ */
|
|
3016
|
-
var {
|
|
3017
|
-
prefixCls = "w-color-swatch",
|
|
3018
|
-
className,
|
|
3019
|
-
color: color2,
|
|
3020
|
-
colors = [],
|
|
3021
|
-
style,
|
|
3022
|
-
rectProps = {},
|
|
3023
|
-
onChange,
|
|
3024
|
-
addonAfter,
|
|
3025
|
-
addonBefore,
|
|
3026
|
-
rectRender
|
|
3027
|
-
} = props, other = (0, import_objectWithoutPropertiesLoose8.default)(props, _excluded8);
|
|
3000
|
+
var Swatch = /* @__PURE__ */ React26__namespace.default.forwardRef((props, ref) => {
|
|
3001
|
+
var _props$prefixCls = props.prefixCls, prefixCls = _props$prefixCls === void 0 ? "w-color-swatch" : _props$prefixCls, className = props.className, color2 = props.color, _props$colors = props.colors, colors = _props$colors === void 0 ? [] : _props$colors, style = props.style, _props$rectProps = props.rectProps, rectProps = _props$rectProps === void 0 ? {} : _props$rectProps, onChange = props.onChange, addonAfter = props.addonAfter, addonBefore = props.addonBefore, rectRender = props.rectRender, other = (0, import_objectWithoutPropertiesLoose8.default)(props, _excluded8);
|
|
3028
3002
|
var rectStyle = (0, import_extends9.default)({
|
|
3029
3003
|
"--swatch-background-color": "rgb(144, 19, 254)",
|
|
3030
3004
|
background: "var(--swatch-background-color)",
|
|
@@ -3049,7 +3023,7 @@ var Swatch = /* @__PURE__ */ React25__namespace.default.forwardRef((props, ref)
|
|
|
3049
3023
|
flexWrap: "wrap",
|
|
3050
3024
|
position: "relative"
|
|
3051
3025
|
}, style),
|
|
3052
|
-
children: [addonBefore && /* @__PURE__ */
|
|
3026
|
+
children: [addonBefore && /* @__PURE__ */ React26__namespace.default.isValidElement(addonBefore) && addonBefore, colors && Array.isArray(colors) && colors.map((item, idx) => {
|
|
3053
3027
|
var title = "";
|
|
3054
3028
|
var background = "";
|
|
3055
3029
|
if (typeof item === "string") {
|
|
@@ -3071,11 +3045,11 @@ var Swatch = /* @__PURE__ */ React25__namespace.default.forwardRef((props, ref)
|
|
|
3071
3045
|
onClick: (evn) => handleClick(background, evn)
|
|
3072
3046
|
});
|
|
3073
3047
|
if (render) {
|
|
3074
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3048
|
+
return /* @__PURE__ */ jsxRuntime.jsx(React26.Fragment, {
|
|
3075
3049
|
children: render
|
|
3076
3050
|
}, idx);
|
|
3077
3051
|
}
|
|
3078
|
-
var child = rectProps.children && /* @__PURE__ */
|
|
3052
|
+
var child = rectProps.children && /* @__PURE__ */ React26__namespace.default.isValidElement(rectProps.children) ? /* @__PURE__ */ React26__namespace.default.cloneElement(rectProps.children, {
|
|
3079
3053
|
color: background,
|
|
3080
3054
|
checked
|
|
3081
3055
|
}) : null;
|
|
@@ -3089,7 +3063,7 @@ var Swatch = /* @__PURE__ */ React25__namespace.default.forwardRef((props, ref)
|
|
|
3089
3063
|
background
|
|
3090
3064
|
})
|
|
3091
3065
|
}), idx);
|
|
3092
|
-
}), addonAfter && /* @__PURE__ */
|
|
3066
|
+
}), addonAfter && /* @__PURE__ */ React26__namespace.default.isValidElement(addonAfter) && addonAfter]
|
|
3093
3067
|
}));
|
|
3094
3068
|
});
|
|
3095
3069
|
Swatch.displayName = "Swatch";
|
|
@@ -3108,25 +3082,15 @@ var Bar = (props) => /* @__PURE__ */ jsxRuntime.jsx("div", {
|
|
|
3108
3082
|
backgroundColor: "#fff"
|
|
3109
3083
|
}
|
|
3110
3084
|
});
|
|
3111
|
-
var Sketch = /* @__PURE__ */
|
|
3112
|
-
var
|
|
3113
|
-
|
|
3114
|
-
className,
|
|
3115
|
-
onChange,
|
|
3116
|
-
width = 218,
|
|
3117
|
-
presetColors = PRESET_COLORS,
|
|
3118
|
-
color: color2,
|
|
3119
|
-
editableDisable = true,
|
|
3120
|
-
disableAlpha = false,
|
|
3121
|
-
style
|
|
3122
|
-
} = props, other = (0, import_objectWithoutPropertiesLoose9.default)(props, _excluded9);
|
|
3123
|
-
var [hsva, setHsva] = React25.useState({
|
|
3085
|
+
var Sketch = /* @__PURE__ */ React26__namespace.default.forwardRef((props, ref) => {
|
|
3086
|
+
var _props$prefixCls = props.prefixCls, prefixCls = _props$prefixCls === void 0 ? "w-color-sketch" : _props$prefixCls, className = props.className, onChange = props.onChange, _props$width = props.width, width = _props$width === void 0 ? 218 : _props$width, _props$presetColors = props.presetColors, presetColors = _props$presetColors === void 0 ? PRESET_COLORS : _props$presetColors, color2 = props.color, _props$editableDisabl = props.editableDisable, editableDisable = _props$editableDisabl === void 0 ? true : _props$editableDisabl, _props$disableAlpha = props.disableAlpha, disableAlpha = _props$disableAlpha === void 0 ? false : _props$disableAlpha, style = props.style, other = (0, import_objectWithoutPropertiesLoose9.default)(props, _excluded9);
|
|
3087
|
+
var _useState = React26.useState({
|
|
3124
3088
|
h: 209,
|
|
3125
3089
|
s: 36,
|
|
3126
3090
|
v: 90,
|
|
3127
3091
|
a: 1
|
|
3128
|
-
});
|
|
3129
|
-
|
|
3092
|
+
}), hsva = _useState[0], setHsva = _useState[1];
|
|
3093
|
+
React26.useEffect(() => {
|
|
3130
3094
|
if (typeof color2 === "string" && validHex(color2)) {
|
|
3131
3095
|
setHsva(hexToHsva(color2));
|
|
3132
3096
|
}
|
|
@@ -3244,7 +3208,7 @@ var Sketch = /* @__PURE__ */ React25__namespace.default.forwardRef((props, ref)
|
|
|
3244
3208
|
innerProps: {
|
|
3245
3209
|
style: styleAlpha
|
|
3246
3210
|
},
|
|
3247
|
-
pointer: () => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3211
|
+
pointer: () => /* @__PURE__ */ jsxRuntime.jsx(React26.Fragment, {})
|
|
3248
3212
|
})]
|
|
3249
3213
|
})]
|
|
3250
3214
|
}), editableDisable && /* @__PURE__ */ jsxRuntime.jsxs("div", {
|
|
@@ -3359,19 +3323,19 @@ var Toolbar = ({
|
|
|
3359
3323
|
on_attachments_change,
|
|
3360
3324
|
disabled = false
|
|
3361
3325
|
}) => {
|
|
3362
|
-
const [link_url, set_link_url] =
|
|
3363
|
-
const [link_popover_open, set_link_popover_open] =
|
|
3364
|
-
const [text_color_open, set_text_color_open] =
|
|
3365
|
-
const [highlight_color_open, set_highlight_color_open] =
|
|
3366
|
-
const [variables_menu_open, set_variables_menu_open] =
|
|
3367
|
-
const [table_menu_open, set_table_menu_open] =
|
|
3368
|
-
const [text_color, set_text_color] =
|
|
3369
|
-
const [highlight_color, set_highlight_color] =
|
|
3370
|
-
const [table_rows, set_table_rows] =
|
|
3371
|
-
const [table_cols, set_table_cols] =
|
|
3372
|
-
const [hovered_cell, set_hovered_cell] =
|
|
3373
|
-
const file_input_ref =
|
|
3374
|
-
const image_input_ref =
|
|
3326
|
+
const [link_url, set_link_url] = React26__namespace.useState("https://");
|
|
3327
|
+
const [link_popover_open, set_link_popover_open] = React26__namespace.useState(false);
|
|
3328
|
+
const [text_color_open, set_text_color_open] = React26__namespace.useState(false);
|
|
3329
|
+
const [highlight_color_open, set_highlight_color_open] = React26__namespace.useState(false);
|
|
3330
|
+
const [variables_menu_open, set_variables_menu_open] = React26__namespace.useState(false);
|
|
3331
|
+
const [table_menu_open, set_table_menu_open] = React26__namespace.useState(false);
|
|
3332
|
+
const [text_color, set_text_color] = React26__namespace.useState("#000000");
|
|
3333
|
+
const [highlight_color, set_highlight_color] = React26__namespace.useState("#ffff00");
|
|
3334
|
+
const [table_rows, set_table_rows] = React26__namespace.useState(3);
|
|
3335
|
+
const [table_cols, set_table_cols] = React26__namespace.useState(3);
|
|
3336
|
+
const [hovered_cell, set_hovered_cell] = React26__namespace.useState(null);
|
|
3337
|
+
const file_input_ref = React26__namespace.useRef(null);
|
|
3338
|
+
const image_input_ref = React26__namespace.useRef(null);
|
|
3375
3339
|
if (!editor) {
|
|
3376
3340
|
return null;
|
|
3377
3341
|
}
|
|
@@ -4304,7 +4268,7 @@ var VariableExtension = core.Node.create({
|
|
|
4304
4268
|
}
|
|
4305
4269
|
});
|
|
4306
4270
|
var Tabs = TabsPrimitive__namespace.Root;
|
|
4307
|
-
var TabsList =
|
|
4271
|
+
var TabsList = React26__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
4308
4272
|
TabsPrimitive__namespace.List,
|
|
4309
4273
|
{
|
|
4310
4274
|
ref,
|
|
@@ -4316,7 +4280,7 @@ var TabsList = React25__namespace.forwardRef(({ className, ...props }, ref) => /
|
|
|
4316
4280
|
}
|
|
4317
4281
|
));
|
|
4318
4282
|
TabsList.displayName = TabsPrimitive__namespace.List.displayName;
|
|
4319
|
-
var TabsTrigger =
|
|
4283
|
+
var TabsTrigger = React26__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
4320
4284
|
TabsPrimitive__namespace.Trigger,
|
|
4321
4285
|
{
|
|
4322
4286
|
ref,
|
|
@@ -4328,7 +4292,7 @@ var TabsTrigger = React25__namespace.forwardRef(({ className, ...props }, ref) =
|
|
|
4328
4292
|
}
|
|
4329
4293
|
));
|
|
4330
4294
|
TabsTrigger.displayName = TabsPrimitive__namespace.Trigger.displayName;
|
|
4331
|
-
var TabsContent =
|
|
4295
|
+
var TabsContent = React26__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
4332
4296
|
TabsPrimitive__namespace.Content,
|
|
4333
4297
|
{
|
|
4334
4298
|
ref,
|
|
@@ -4363,14 +4327,14 @@ var HazoUiRte = ({
|
|
|
4363
4327
|
className,
|
|
4364
4328
|
show_output_viewer = false
|
|
4365
4329
|
}) => {
|
|
4366
|
-
const [attachments, set_attachments] =
|
|
4330
|
+
const [attachments, set_attachments] = React26__namespace.useState(
|
|
4367
4331
|
initial_attachments
|
|
4368
4332
|
);
|
|
4369
|
-
const [active_tab, set_active_tab] =
|
|
4333
|
+
const [active_tab, set_active_tab] = React26__namespace.useState("html");
|
|
4370
4334
|
const is_view_only = active_tab !== "html";
|
|
4371
|
-
const attachments_ref =
|
|
4335
|
+
const attachments_ref = React26__namespace.useRef(attachments);
|
|
4372
4336
|
attachments_ref.current = attachments;
|
|
4373
|
-
const debounced_on_change =
|
|
4337
|
+
const debounced_on_change = React26__namespace.useMemo(
|
|
4374
4338
|
() => debounce_fn((output) => {
|
|
4375
4339
|
if (on_change) {
|
|
4376
4340
|
on_change(output);
|
|
@@ -4469,7 +4433,7 @@ var HazoUiRte = ({
|
|
|
4469
4433
|
debounced_on_change(output);
|
|
4470
4434
|
}
|
|
4471
4435
|
});
|
|
4472
|
-
|
|
4436
|
+
React26__namespace.useEffect(() => {
|
|
4473
4437
|
if (editor && html !== void 0) {
|
|
4474
4438
|
const current_html = editor.getHTML();
|
|
4475
4439
|
if (html !== current_html && !editor.isFocused) {
|
|
@@ -4477,21 +4441,21 @@ var HazoUiRte = ({
|
|
|
4477
4441
|
}
|
|
4478
4442
|
}
|
|
4479
4443
|
}, [html, editor]);
|
|
4480
|
-
|
|
4444
|
+
React26__namespace.useEffect(() => {
|
|
4481
4445
|
if (editor) {
|
|
4482
4446
|
editor.setEditable(!disabled);
|
|
4483
4447
|
}
|
|
4484
4448
|
}, [disabled, editor]);
|
|
4485
|
-
const attachments_from_props_ref =
|
|
4486
|
-
const prev_initial_attachments_ref =
|
|
4487
|
-
|
|
4449
|
+
const attachments_from_props_ref = React26__namespace.useRef(false);
|
|
4450
|
+
const prev_initial_attachments_ref = React26__namespace.useRef(initial_attachments);
|
|
4451
|
+
React26__namespace.useEffect(() => {
|
|
4488
4452
|
if (JSON.stringify(initial_attachments) !== JSON.stringify(prev_initial_attachments_ref.current)) {
|
|
4489
4453
|
prev_initial_attachments_ref.current = initial_attachments;
|
|
4490
4454
|
attachments_from_props_ref.current = true;
|
|
4491
4455
|
set_attachments(initial_attachments);
|
|
4492
4456
|
}
|
|
4493
4457
|
}, [initial_attachments]);
|
|
4494
|
-
|
|
4458
|
+
React26__namespace.useEffect(() => {
|
|
4495
4459
|
if (attachments_from_props_ref.current) {
|
|
4496
4460
|
attachments_from_props_ref.current = false;
|
|
4497
4461
|
return;
|
|
@@ -4993,12 +4957,12 @@ var CommandPopover = ({
|
|
|
4993
4957
|
on_selection_change: _on_selection_change,
|
|
4994
4958
|
prefix_color
|
|
4995
4959
|
}) => {
|
|
4996
|
-
const container_ref =
|
|
4997
|
-
const grouped_commands =
|
|
4960
|
+
const container_ref = React26__namespace.useRef(null);
|
|
4961
|
+
const grouped_commands = React26__namespace.useMemo(
|
|
4998
4962
|
() => group_commands(commands),
|
|
4999
4963
|
[commands]
|
|
5000
4964
|
);
|
|
5001
|
-
|
|
4965
|
+
React26__namespace.useEffect(() => {
|
|
5002
4966
|
const handle_click_outside = (e) => {
|
|
5003
4967
|
if (container_ref.current && !container_ref.current.contains(e.target)) {
|
|
5004
4968
|
on_close();
|
|
@@ -5011,8 +4975,8 @@ var CommandPopover = ({
|
|
|
5011
4975
|
};
|
|
5012
4976
|
}
|
|
5013
4977
|
}, [is_open, on_close]);
|
|
5014
|
-
const [mounted, set_mounted] =
|
|
5015
|
-
|
|
4978
|
+
const [mounted, set_mounted] = React26__namespace.useState(false);
|
|
4979
|
+
React26__namespace.useEffect(() => {
|
|
5016
4980
|
set_mounted(true);
|
|
5017
4981
|
}, []);
|
|
5018
4982
|
if (!is_open || !mounted) return null;
|
|
@@ -5322,21 +5286,21 @@ var HazoUiTextbox = ({
|
|
|
5322
5286
|
on_command_change,
|
|
5323
5287
|
on_command_remove
|
|
5324
5288
|
}) => {
|
|
5325
|
-
const generated_instance_id =
|
|
5289
|
+
const generated_instance_id = React26__namespace.useId();
|
|
5326
5290
|
const instance_id = provided_instance_id || generated_instance_id;
|
|
5327
|
-
const [suggestion_state, set_suggestion_state] =
|
|
5328
|
-
const [selected_index, set_selected_index] =
|
|
5329
|
-
const [popover_position, set_popover_position] =
|
|
5330
|
-
const [edit_context, set_edit_context] =
|
|
5331
|
-
const [edit_selected_index, set_edit_selected_index] =
|
|
5291
|
+
const [suggestion_state, set_suggestion_state] = React26__namespace.useState(null);
|
|
5292
|
+
const [selected_index, set_selected_index] = React26__namespace.useState(0);
|
|
5293
|
+
const [popover_position, set_popover_position] = React26__namespace.useState({ top: 0, left: 0 });
|
|
5294
|
+
const [edit_context, set_edit_context] = React26__namespace.useState(null);
|
|
5295
|
+
const [edit_selected_index, set_edit_selected_index] = React26__namespace.useState(0);
|
|
5332
5296
|
const is_controlled = value !== void 0;
|
|
5333
|
-
const editor_container_ref =
|
|
5334
|
-
const edit_popover_ref =
|
|
5335
|
-
const [mounted, set_mounted] =
|
|
5336
|
-
|
|
5297
|
+
const editor_container_ref = React26__namespace.useRef(null);
|
|
5298
|
+
const edit_popover_ref = React26__namespace.useRef(null);
|
|
5299
|
+
const [mounted, set_mounted] = React26__namespace.useState(false);
|
|
5300
|
+
React26__namespace.useEffect(() => {
|
|
5337
5301
|
set_mounted(true);
|
|
5338
5302
|
}, []);
|
|
5339
|
-
const suggestion_extensions =
|
|
5303
|
+
const suggestion_extensions = React26__namespace.useMemo(() => {
|
|
5340
5304
|
return create_command_suggestion_extension({
|
|
5341
5305
|
prefixes,
|
|
5342
5306
|
instance_id,
|
|
@@ -5387,7 +5351,7 @@ var HazoUiTextbox = ({
|
|
|
5387
5351
|
}
|
|
5388
5352
|
}
|
|
5389
5353
|
});
|
|
5390
|
-
|
|
5354
|
+
React26__namespace.useEffect(() => {
|
|
5391
5355
|
if (suggestion_state?.is_active && editor) {
|
|
5392
5356
|
requestAnimationFrame(() => {
|
|
5393
5357
|
const { from } = suggestion_state.range;
|
|
@@ -5411,7 +5375,7 @@ var HazoUiTextbox = ({
|
|
|
5411
5375
|
});
|
|
5412
5376
|
}
|
|
5413
5377
|
}, [suggestion_state, editor]);
|
|
5414
|
-
|
|
5378
|
+
React26__namespace.useEffect(() => {
|
|
5415
5379
|
if (is_controlled && editor && !editor.isFocused) {
|
|
5416
5380
|
const current_text = editor.getText();
|
|
5417
5381
|
if (value !== current_text) {
|
|
@@ -5420,12 +5384,12 @@ var HazoUiTextbox = ({
|
|
|
5420
5384
|
}
|
|
5421
5385
|
}
|
|
5422
5386
|
}, [value, editor, is_controlled, prefixes, pill_variant]);
|
|
5423
|
-
|
|
5387
|
+
React26__namespace.useEffect(() => {
|
|
5424
5388
|
if (editor) {
|
|
5425
5389
|
editor.setEditable(!disabled);
|
|
5426
5390
|
}
|
|
5427
5391
|
}, [disabled, editor]);
|
|
5428
|
-
const handle_command_select =
|
|
5392
|
+
const handle_command_select = React26__namespace.useCallback(
|
|
5429
5393
|
(command) => {
|
|
5430
5394
|
if (!editor || !suggestion_state) return;
|
|
5431
5395
|
const prefix_config = prefixes.find((p) => p.char === suggestion_state.prefix);
|
|
@@ -5445,15 +5409,15 @@ var HazoUiTextbox = ({
|
|
|
5445
5409
|
},
|
|
5446
5410
|
[editor, suggestion_state, pill_variant, on_command_insert, prefixes]
|
|
5447
5411
|
);
|
|
5448
|
-
const handle_popover_close =
|
|
5412
|
+
const handle_popover_close = React26__namespace.useCallback(() => {
|
|
5449
5413
|
set_suggestion_state(null);
|
|
5450
5414
|
editor?.commands.focus();
|
|
5451
5415
|
}, [editor]);
|
|
5452
|
-
const handle_edit_close =
|
|
5416
|
+
const handle_edit_close = React26__namespace.useCallback(() => {
|
|
5453
5417
|
set_edit_context(null);
|
|
5454
5418
|
editor?.commands.focus();
|
|
5455
5419
|
}, [editor]);
|
|
5456
|
-
const handle_command_update =
|
|
5420
|
+
const handle_command_update = React26__namespace.useCallback(
|
|
5457
5421
|
(new_command) => {
|
|
5458
5422
|
if (!editor || !edit_context) return;
|
|
5459
5423
|
const old_command = edit_context.command;
|
|
@@ -5469,7 +5433,7 @@ var HazoUiTextbox = ({
|
|
|
5469
5433
|
},
|
|
5470
5434
|
[editor, edit_context, on_command_change]
|
|
5471
5435
|
);
|
|
5472
|
-
const handle_command_remove =
|
|
5436
|
+
const handle_command_remove = React26__namespace.useCallback(() => {
|
|
5473
5437
|
if (!editor || !edit_context) return;
|
|
5474
5438
|
const command = edit_context.command;
|
|
5475
5439
|
editor.state.doc.descendants((node, pos) => {
|
|
@@ -5483,7 +5447,7 @@ var HazoUiTextbox = ({
|
|
|
5483
5447
|
}
|
|
5484
5448
|
set_edit_context(null);
|
|
5485
5449
|
}, [editor, edit_context, on_command_remove]);
|
|
5486
|
-
const filtered_commands =
|
|
5450
|
+
const filtered_commands = React26__namespace.useMemo(() => {
|
|
5487
5451
|
if (!suggestion_state) return [];
|
|
5488
5452
|
const query = suggestion_state.query.toLowerCase();
|
|
5489
5453
|
if (!query) return suggestion_state.commands;
|
|
@@ -5491,7 +5455,7 @@ var HazoUiTextbox = ({
|
|
|
5491
5455
|
(cmd) => cmd.action_label.toLowerCase().includes(query) || cmd.action.toLowerCase().includes(query) || cmd.action_description?.toLowerCase().includes(query)
|
|
5492
5456
|
);
|
|
5493
5457
|
}, [suggestion_state]);
|
|
5494
|
-
|
|
5458
|
+
React26__namespace.useEffect(() => {
|
|
5495
5459
|
if (!suggestion_state?.is_active) return;
|
|
5496
5460
|
const handle_keydown = (e) => {
|
|
5497
5461
|
switch (e.key) {
|
|
@@ -5526,7 +5490,7 @@ var HazoUiTextbox = ({
|
|
|
5526
5490
|
handle_command_select,
|
|
5527
5491
|
handle_popover_close
|
|
5528
5492
|
]);
|
|
5529
|
-
|
|
5493
|
+
React26__namespace.useEffect(() => {
|
|
5530
5494
|
if (!edit_context) return;
|
|
5531
5495
|
const handle_click_outside = (e) => {
|
|
5532
5496
|
if (edit_popover_ref.current && !edit_popover_ref.current.contains(e.target)) {
|
|
@@ -5541,12 +5505,12 @@ var HazoUiTextbox = ({
|
|
|
5541
5505
|
document.removeEventListener("mousedown", handle_click_outside);
|
|
5542
5506
|
};
|
|
5543
5507
|
}, [edit_context]);
|
|
5544
|
-
const edit_commands =
|
|
5508
|
+
const edit_commands = React26__namespace.useMemo(() => {
|
|
5545
5509
|
if (!edit_context) return [];
|
|
5546
5510
|
const prefix_config = prefixes.find((p) => p.char === edit_context.command.prefix);
|
|
5547
5511
|
return prefix_config?.commands || [];
|
|
5548
5512
|
}, [edit_context, prefixes]);
|
|
5549
|
-
|
|
5513
|
+
React26__namespace.useEffect(() => {
|
|
5550
5514
|
if (!edit_context) return;
|
|
5551
5515
|
const handle_keydown = (e) => {
|
|
5552
5516
|
switch (e.key) {
|
|
@@ -5584,7 +5548,7 @@ var HazoUiTextbox = ({
|
|
|
5584
5548
|
handle_command_remove,
|
|
5585
5549
|
handle_edit_close
|
|
5586
5550
|
]);
|
|
5587
|
-
|
|
5551
|
+
React26__namespace.useEffect(() => {
|
|
5588
5552
|
const handle_pill_click = (e) => {
|
|
5589
5553
|
const detail = e.detail;
|
|
5590
5554
|
const { id, prefix, action, action_label, node_pos } = detail;
|
|
@@ -5867,22 +5831,22 @@ var HazoUiTextarea = ({
|
|
|
5867
5831
|
on_command_change,
|
|
5868
5832
|
on_command_remove
|
|
5869
5833
|
}) => {
|
|
5870
|
-
const generated_instance_id =
|
|
5834
|
+
const generated_instance_id = React26__namespace.useId();
|
|
5871
5835
|
const instance_id = provided_instance_id || generated_instance_id;
|
|
5872
|
-
const [suggestion_state, set_suggestion_state] =
|
|
5873
|
-
const [selected_index, set_selected_index] =
|
|
5874
|
-
const [popover_position, set_popover_position] =
|
|
5875
|
-
const [edit_context, set_edit_context] =
|
|
5876
|
-
const [edit_selected_index, set_edit_selected_index] =
|
|
5836
|
+
const [suggestion_state, set_suggestion_state] = React26__namespace.useState(null);
|
|
5837
|
+
const [selected_index, set_selected_index] = React26__namespace.useState(0);
|
|
5838
|
+
const [popover_position, set_popover_position] = React26__namespace.useState({ top: 0, left: 0 });
|
|
5839
|
+
const [edit_context, set_edit_context] = React26__namespace.useState(null);
|
|
5840
|
+
const [edit_selected_index, set_edit_selected_index] = React26__namespace.useState(0);
|
|
5877
5841
|
const is_controlled = value !== void 0;
|
|
5878
|
-
const editor_container_ref =
|
|
5879
|
-
const edit_popover_ref =
|
|
5880
|
-
const [mounted, set_mounted] =
|
|
5881
|
-
|
|
5842
|
+
const editor_container_ref = React26__namespace.useRef(null);
|
|
5843
|
+
const edit_popover_ref = React26__namespace.useRef(null);
|
|
5844
|
+
const [mounted, set_mounted] = React26__namespace.useState(false);
|
|
5845
|
+
React26__namespace.useEffect(() => {
|
|
5882
5846
|
set_mounted(true);
|
|
5883
5847
|
}, []);
|
|
5884
5848
|
const calculated_min_height = rows ? `${rows * 1.5}em` : min_height;
|
|
5885
|
-
const suggestion_extensions =
|
|
5849
|
+
const suggestion_extensions = React26__namespace.useMemo(() => {
|
|
5886
5850
|
return create_command_suggestion_extension({
|
|
5887
5851
|
prefixes,
|
|
5888
5852
|
instance_id,
|
|
@@ -5931,7 +5895,7 @@ var HazoUiTextarea = ({
|
|
|
5931
5895
|
}
|
|
5932
5896
|
}
|
|
5933
5897
|
});
|
|
5934
|
-
|
|
5898
|
+
React26__namespace.useEffect(() => {
|
|
5935
5899
|
if (suggestion_state?.is_active && editor) {
|
|
5936
5900
|
requestAnimationFrame(() => {
|
|
5937
5901
|
const { from } = suggestion_state.range;
|
|
@@ -5955,7 +5919,7 @@ var HazoUiTextarea = ({
|
|
|
5955
5919
|
});
|
|
5956
5920
|
}
|
|
5957
5921
|
}, [suggestion_state, editor]);
|
|
5958
|
-
|
|
5922
|
+
React26__namespace.useEffect(() => {
|
|
5959
5923
|
if (is_controlled && editor && !editor.isFocused) {
|
|
5960
5924
|
const current_text = editor.getText();
|
|
5961
5925
|
if (value !== current_text) {
|
|
@@ -5968,12 +5932,12 @@ var HazoUiTextarea = ({
|
|
|
5968
5932
|
}
|
|
5969
5933
|
}
|
|
5970
5934
|
}, [value, editor, is_controlled, prefixes, pill_variant]);
|
|
5971
|
-
|
|
5935
|
+
React26__namespace.useEffect(() => {
|
|
5972
5936
|
if (editor) {
|
|
5973
5937
|
editor.setEditable(!disabled);
|
|
5974
5938
|
}
|
|
5975
5939
|
}, [disabled, editor]);
|
|
5976
|
-
const handle_command_select =
|
|
5940
|
+
const handle_command_select = React26__namespace.useCallback(
|
|
5977
5941
|
(command) => {
|
|
5978
5942
|
if (!editor || !suggestion_state) return;
|
|
5979
5943
|
const prefix_config = prefixes.find((p) => p.char === suggestion_state.prefix);
|
|
@@ -5993,15 +5957,15 @@ var HazoUiTextarea = ({
|
|
|
5993
5957
|
},
|
|
5994
5958
|
[editor, suggestion_state, pill_variant, on_command_insert, prefixes]
|
|
5995
5959
|
);
|
|
5996
|
-
const handle_popover_close =
|
|
5960
|
+
const handle_popover_close = React26__namespace.useCallback(() => {
|
|
5997
5961
|
set_suggestion_state(null);
|
|
5998
5962
|
editor?.commands.focus();
|
|
5999
5963
|
}, [editor]);
|
|
6000
|
-
const handle_edit_close =
|
|
5964
|
+
const handle_edit_close = React26__namespace.useCallback(() => {
|
|
6001
5965
|
set_edit_context(null);
|
|
6002
5966
|
editor?.commands.focus();
|
|
6003
5967
|
}, [editor]);
|
|
6004
|
-
const handle_command_update =
|
|
5968
|
+
const handle_command_update = React26__namespace.useCallback(
|
|
6005
5969
|
(new_command) => {
|
|
6006
5970
|
if (!editor || !edit_context) return;
|
|
6007
5971
|
const old_command = edit_context.command;
|
|
@@ -6017,7 +5981,7 @@ var HazoUiTextarea = ({
|
|
|
6017
5981
|
},
|
|
6018
5982
|
[editor, edit_context, on_command_change]
|
|
6019
5983
|
);
|
|
6020
|
-
const handle_command_remove =
|
|
5984
|
+
const handle_command_remove = React26__namespace.useCallback(() => {
|
|
6021
5985
|
if (!editor || !edit_context) return;
|
|
6022
5986
|
const command = edit_context.command;
|
|
6023
5987
|
editor.state.doc.descendants((node, pos) => {
|
|
@@ -6031,7 +5995,7 @@ var HazoUiTextarea = ({
|
|
|
6031
5995
|
}
|
|
6032
5996
|
set_edit_context(null);
|
|
6033
5997
|
}, [editor, edit_context, on_command_remove]);
|
|
6034
|
-
const filtered_commands =
|
|
5998
|
+
const filtered_commands = React26__namespace.useMemo(() => {
|
|
6035
5999
|
if (!suggestion_state) return [];
|
|
6036
6000
|
const query = suggestion_state.query.toLowerCase();
|
|
6037
6001
|
if (!query) return suggestion_state.commands;
|
|
@@ -6039,7 +6003,7 @@ var HazoUiTextarea = ({
|
|
|
6039
6003
|
(cmd) => cmd.action_label.toLowerCase().includes(query) || cmd.action.toLowerCase().includes(query) || cmd.action_description?.toLowerCase().includes(query)
|
|
6040
6004
|
);
|
|
6041
6005
|
}, [suggestion_state]);
|
|
6042
|
-
|
|
6006
|
+
React26__namespace.useEffect(() => {
|
|
6043
6007
|
if (!suggestion_state?.is_active) return;
|
|
6044
6008
|
const handle_keydown = (e) => {
|
|
6045
6009
|
switch (e.key) {
|
|
@@ -6074,7 +6038,7 @@ var HazoUiTextarea = ({
|
|
|
6074
6038
|
handle_command_select,
|
|
6075
6039
|
handle_popover_close
|
|
6076
6040
|
]);
|
|
6077
|
-
|
|
6041
|
+
React26__namespace.useEffect(() => {
|
|
6078
6042
|
if (!edit_context) return;
|
|
6079
6043
|
const handle_click_outside = (e) => {
|
|
6080
6044
|
if (edit_popover_ref.current && !edit_popover_ref.current.contains(e.target)) {
|
|
@@ -6089,12 +6053,12 @@ var HazoUiTextarea = ({
|
|
|
6089
6053
|
document.removeEventListener("mousedown", handle_click_outside);
|
|
6090
6054
|
};
|
|
6091
6055
|
}, [edit_context]);
|
|
6092
|
-
const edit_commands =
|
|
6056
|
+
const edit_commands = React26__namespace.useMemo(() => {
|
|
6093
6057
|
if (!edit_context) return [];
|
|
6094
6058
|
const prefix_config = prefixes.find((p) => p.char === edit_context.command.prefix);
|
|
6095
6059
|
return prefix_config?.commands || [];
|
|
6096
6060
|
}, [edit_context, prefixes]);
|
|
6097
|
-
|
|
6061
|
+
React26__namespace.useEffect(() => {
|
|
6098
6062
|
if (!edit_context) return;
|
|
6099
6063
|
const handle_keydown = (e) => {
|
|
6100
6064
|
switch (e.key) {
|
|
@@ -6132,7 +6096,7 @@ var HazoUiTextarea = ({
|
|
|
6132
6096
|
handle_command_remove,
|
|
6133
6097
|
handle_edit_close
|
|
6134
6098
|
]);
|
|
6135
|
-
|
|
6099
|
+
React26__namespace.useEffect(() => {
|
|
6136
6100
|
const handle_pill_click = (e) => {
|
|
6137
6101
|
const detail = e.detail;
|
|
6138
6102
|
const { id, prefix, action, action_label, node_pos } = detail;
|
|
@@ -6679,7 +6643,7 @@ function HazoUiConfirmDialog({
|
|
|
6679
6643
|
openAnimation = "zoom",
|
|
6680
6644
|
closeAnimation = "zoom"
|
|
6681
6645
|
}) {
|
|
6682
|
-
const [internal_loading, set_internal_loading] =
|
|
6646
|
+
const [internal_loading, set_internal_loading] = React26__namespace.useState(false);
|
|
6683
6647
|
const config = get_hazo_ui_config();
|
|
6684
6648
|
const variant_preset = variant !== "default" ? CONFIRM_VARIANT_PRESETS[variant] : void 0;
|
|
6685
6649
|
const is_loading = external_loading ?? internal_loading;
|
|
@@ -6716,7 +6680,7 @@ function HazoUiConfirmDialog({
|
|
|
6716
6680
|
onCancel?.();
|
|
6717
6681
|
onOpenChange(false);
|
|
6718
6682
|
};
|
|
6719
|
-
const cancel_ref =
|
|
6683
|
+
const cancel_ref = React26__namespace.useRef(null);
|
|
6720
6684
|
return /* @__PURE__ */ jsxRuntime.jsx(Dialog, { open, onOpenChange, children: /* @__PURE__ */ jsxRuntime.jsxs(DialogPortal, { children: [
|
|
6721
6685
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6722
6686
|
DialogOverlay,
|
|
@@ -6801,7 +6765,7 @@ Drawer.displayName = "Drawer";
|
|
|
6801
6765
|
var DrawerTrigger = vaul.Drawer.Trigger;
|
|
6802
6766
|
var DrawerPortal = vaul.Drawer.Portal;
|
|
6803
6767
|
var DrawerClose = vaul.Drawer.Close;
|
|
6804
|
-
var DrawerOverlay =
|
|
6768
|
+
var DrawerOverlay = React26__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
6805
6769
|
vaul.Drawer.Overlay,
|
|
6806
6770
|
{
|
|
6807
6771
|
ref,
|
|
@@ -6813,7 +6777,7 @@ var DrawerOverlay = React25__namespace.forwardRef(({ className, ...props }, ref)
|
|
|
6813
6777
|
}
|
|
6814
6778
|
));
|
|
6815
6779
|
DrawerOverlay.displayName = "DrawerOverlay";
|
|
6816
|
-
var DrawerContent =
|
|
6780
|
+
var DrawerContent = React26__namespace.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(DrawerPortal, { children: [
|
|
6817
6781
|
/* @__PURE__ */ jsxRuntime.jsx(DrawerOverlay, {}),
|
|
6818
6782
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
6819
6783
|
vaul.Drawer.Content,
|
|
@@ -6854,7 +6818,7 @@ var DrawerFooter = ({
|
|
|
6854
6818
|
}
|
|
6855
6819
|
);
|
|
6856
6820
|
DrawerFooter.displayName = "DrawerFooter";
|
|
6857
|
-
var DrawerTitle =
|
|
6821
|
+
var DrawerTitle = React26__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
6858
6822
|
vaul.Drawer.Title,
|
|
6859
6823
|
{
|
|
6860
6824
|
ref,
|
|
@@ -6866,7 +6830,7 @@ var DrawerTitle = React25__namespace.forwardRef(({ className, ...props }, ref) =
|
|
|
6866
6830
|
}
|
|
6867
6831
|
));
|
|
6868
6832
|
DrawerTitle.displayName = "DrawerTitle";
|
|
6869
|
-
var DrawerDescription =
|
|
6833
|
+
var DrawerDescription = React26__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
6870
6834
|
vaul.Drawer.Description,
|
|
6871
6835
|
{
|
|
6872
6836
|
ref,
|
|
@@ -6876,14 +6840,14 @@ var DrawerDescription = React25__namespace.forwardRef(({ className, ...props },
|
|
|
6876
6840
|
));
|
|
6877
6841
|
DrawerDescription.displayName = "DrawerDescription";
|
|
6878
6842
|
function useMediaQuery(query) {
|
|
6879
|
-
const get_match =
|
|
6843
|
+
const get_match = React26__namespace.useCallback(() => {
|
|
6880
6844
|
if (typeof window === "undefined" || typeof window.matchMedia !== "function") {
|
|
6881
6845
|
return false;
|
|
6882
6846
|
}
|
|
6883
6847
|
return window.matchMedia(query).matches;
|
|
6884
6848
|
}, [query]);
|
|
6885
|
-
const [matches, set_matches] =
|
|
6886
|
-
|
|
6849
|
+
const [matches, set_matches] = React26__namespace.useState(false);
|
|
6850
|
+
React26__namespace.useEffect(() => {
|
|
6887
6851
|
if (typeof window === "undefined" || typeof window.matchMedia !== "function") {
|
|
6888
6852
|
return;
|
|
6889
6853
|
}
|
|
@@ -6900,7 +6864,7 @@ function useMediaQuery(query) {
|
|
|
6900
6864
|
return matches;
|
|
6901
6865
|
}
|
|
6902
6866
|
var Accordion = AccordionPrimitive__namespace.Root;
|
|
6903
|
-
var AccordionItem =
|
|
6867
|
+
var AccordionItem = React26__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
6904
6868
|
AccordionPrimitive__namespace.Item,
|
|
6905
6869
|
{
|
|
6906
6870
|
ref,
|
|
@@ -6909,7 +6873,7 @@ var AccordionItem = React25__namespace.forwardRef(({ className, ...props }, ref)
|
|
|
6909
6873
|
}
|
|
6910
6874
|
));
|
|
6911
6875
|
AccordionItem.displayName = "AccordionItem";
|
|
6912
|
-
var AccordionTrigger =
|
|
6876
|
+
var AccordionTrigger = React26__namespace.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(AccordionPrimitive__namespace.Header, { className: "flex", children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6913
6877
|
AccordionPrimitive__namespace.Trigger,
|
|
6914
6878
|
{
|
|
6915
6879
|
ref,
|
|
@@ -6925,7 +6889,7 @@ var AccordionTrigger = React25__namespace.forwardRef(({ className, children, ...
|
|
|
6925
6889
|
}
|
|
6926
6890
|
) }));
|
|
6927
6891
|
AccordionTrigger.displayName = AccordionPrimitive__namespace.Trigger.displayName;
|
|
6928
|
-
var AccordionContent =
|
|
6892
|
+
var AccordionContent = React26__namespace.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
6929
6893
|
AccordionPrimitive__namespace.Content,
|
|
6930
6894
|
{
|
|
6931
6895
|
ref,
|
|
@@ -6935,7 +6899,7 @@ var AccordionContent = React25__namespace.forwardRef(({ className, children, ...
|
|
|
6935
6899
|
}
|
|
6936
6900
|
));
|
|
6937
6901
|
AccordionContent.displayName = AccordionPrimitive__namespace.Content.displayName;
|
|
6938
|
-
var Checkbox =
|
|
6902
|
+
var Checkbox = React26__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
6939
6903
|
CheckboxPrimitive__namespace.Root,
|
|
6940
6904
|
{
|
|
6941
6905
|
ref,
|
|
@@ -6960,7 +6924,7 @@ var DropdownMenuGroup = DropdownMenuPrimitive__namespace.Group;
|
|
|
6960
6924
|
var DropdownMenuPortal = DropdownMenuPrimitive__namespace.Portal;
|
|
6961
6925
|
var DropdownMenuSub = DropdownMenuPrimitive__namespace.Sub;
|
|
6962
6926
|
var DropdownMenuRadioGroup = DropdownMenuPrimitive__namespace.RadioGroup;
|
|
6963
|
-
var DropdownMenuSubTrigger =
|
|
6927
|
+
var DropdownMenuSubTrigger = React26__namespace.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6964
6928
|
DropdownMenuPrimitive__namespace.SubTrigger,
|
|
6965
6929
|
{
|
|
6966
6930
|
ref,
|
|
@@ -6977,7 +6941,7 @@ var DropdownMenuSubTrigger = React25__namespace.forwardRef(({ className, inset,
|
|
|
6977
6941
|
}
|
|
6978
6942
|
));
|
|
6979
6943
|
DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive__namespace.SubTrigger.displayName;
|
|
6980
|
-
var DropdownMenuSubContent =
|
|
6944
|
+
var DropdownMenuSubContent = React26__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
6981
6945
|
DropdownMenuPrimitive__namespace.SubContent,
|
|
6982
6946
|
{
|
|
6983
6947
|
ref,
|
|
@@ -6989,7 +6953,7 @@ var DropdownMenuSubContent = React25__namespace.forwardRef(({ className, ...prop
|
|
|
6989
6953
|
}
|
|
6990
6954
|
));
|
|
6991
6955
|
DropdownMenuSubContent.displayName = DropdownMenuPrimitive__namespace.SubContent.displayName;
|
|
6992
|
-
var DropdownMenuContent =
|
|
6956
|
+
var DropdownMenuContent = React26__namespace.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuPrimitive__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6993
6957
|
DropdownMenuPrimitive__namespace.Content,
|
|
6994
6958
|
{
|
|
6995
6959
|
ref,
|
|
@@ -7002,7 +6966,7 @@ var DropdownMenuContent = React25__namespace.forwardRef(({ className, sideOffset
|
|
|
7002
6966
|
}
|
|
7003
6967
|
) }));
|
|
7004
6968
|
DropdownMenuContent.displayName = DropdownMenuPrimitive__namespace.Content.displayName;
|
|
7005
|
-
var DropdownMenuItem =
|
|
6969
|
+
var DropdownMenuItem = React26__namespace.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
7006
6970
|
DropdownMenuPrimitive__namespace.Item,
|
|
7007
6971
|
{
|
|
7008
6972
|
ref,
|
|
@@ -7015,7 +6979,7 @@ var DropdownMenuItem = React25__namespace.forwardRef(({ className, inset, ...pro
|
|
|
7015
6979
|
}
|
|
7016
6980
|
));
|
|
7017
6981
|
DropdownMenuItem.displayName = DropdownMenuPrimitive__namespace.Item.displayName;
|
|
7018
|
-
var DropdownMenuCheckboxItem =
|
|
6982
|
+
var DropdownMenuCheckboxItem = React26__namespace.forwardRef(({ className, children, checked, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
7019
6983
|
DropdownMenuPrimitive__namespace.CheckboxItem,
|
|
7020
6984
|
{
|
|
7021
6985
|
ref,
|
|
@@ -7032,7 +6996,7 @@ var DropdownMenuCheckboxItem = React25__namespace.forwardRef(({ className, child
|
|
|
7032
6996
|
}
|
|
7033
6997
|
));
|
|
7034
6998
|
DropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive__namespace.CheckboxItem.displayName;
|
|
7035
|
-
var DropdownMenuRadioItem =
|
|
6999
|
+
var DropdownMenuRadioItem = React26__namespace.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
7036
7000
|
DropdownMenuPrimitive__namespace.RadioItem,
|
|
7037
7001
|
{
|
|
7038
7002
|
ref,
|
|
@@ -7048,7 +7012,7 @@ var DropdownMenuRadioItem = React25__namespace.forwardRef(({ className, children
|
|
|
7048
7012
|
}
|
|
7049
7013
|
));
|
|
7050
7014
|
DropdownMenuRadioItem.displayName = DropdownMenuPrimitive__namespace.RadioItem.displayName;
|
|
7051
|
-
var DropdownMenuLabel =
|
|
7015
|
+
var DropdownMenuLabel = React26__namespace.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
7052
7016
|
DropdownMenuPrimitive__namespace.Label,
|
|
7053
7017
|
{
|
|
7054
7018
|
ref,
|
|
@@ -7061,7 +7025,7 @@ var DropdownMenuLabel = React25__namespace.forwardRef(({ className, inset, ...pr
|
|
|
7061
7025
|
}
|
|
7062
7026
|
));
|
|
7063
7027
|
DropdownMenuLabel.displayName = DropdownMenuPrimitive__namespace.Label.displayName;
|
|
7064
|
-
var DropdownMenuSeparator =
|
|
7028
|
+
var DropdownMenuSeparator = React26__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
7065
7029
|
DropdownMenuPrimitive__namespace.Separator,
|
|
7066
7030
|
{
|
|
7067
7031
|
ref,
|
|
@@ -7085,7 +7049,7 @@ var DropdownMenuShortcut = ({
|
|
|
7085
7049
|
DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
|
|
7086
7050
|
var HoverCard = HoverCardPrimitive__namespace.Root;
|
|
7087
7051
|
var HoverCardTrigger = HoverCardPrimitive__namespace.Trigger;
|
|
7088
|
-
var HoverCardContent =
|
|
7052
|
+
var HoverCardContent = React26__namespace.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
7089
7053
|
HoverCardPrimitive__namespace.Content,
|
|
7090
7054
|
{
|
|
7091
7055
|
ref,
|
|
@@ -7099,7 +7063,7 @@ var HoverCardContent = React25__namespace.forwardRef(({ className, align = "cent
|
|
|
7099
7063
|
}
|
|
7100
7064
|
));
|
|
7101
7065
|
HoverCardContent.displayName = HoverCardPrimitive__namespace.Content.displayName;
|
|
7102
|
-
var Label3 =
|
|
7066
|
+
var Label3 = React26__namespace.forwardRef(
|
|
7103
7067
|
({ className, ...props }, ref) => {
|
|
7104
7068
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
7105
7069
|
"label",
|
|
@@ -7115,7 +7079,7 @@ var Label3 = React25__namespace.forwardRef(
|
|
|
7115
7079
|
}
|
|
7116
7080
|
);
|
|
7117
7081
|
Label3.displayName = "Label";
|
|
7118
|
-
var Switch =
|
|
7082
|
+
var Switch = React26__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
7119
7083
|
SwitchPrimitives__namespace.Root,
|
|
7120
7084
|
{
|
|
7121
7085
|
className: cn(
|
|
@@ -7135,7 +7099,7 @@ var Switch = React25__namespace.forwardRef(({ className, ...props }, ref) => /*
|
|
|
7135
7099
|
}
|
|
7136
7100
|
));
|
|
7137
7101
|
Switch.displayName = SwitchPrimitives__namespace.Root.displayName;
|
|
7138
|
-
var Textarea =
|
|
7102
|
+
var Textarea = React26__namespace.forwardRef(
|
|
7139
7103
|
({ className, ...props }, ref) => {
|
|
7140
7104
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
7141
7105
|
"textarea",
|
|
@@ -7155,7 +7119,7 @@ var Textarea = React25__namespace.forwardRef(
|
|
|
7155
7119
|
}
|
|
7156
7120
|
);
|
|
7157
7121
|
Textarea.displayName = "Textarea";
|
|
7158
|
-
var Separator3 =
|
|
7122
|
+
var Separator3 = React26__namespace.forwardRef(({ className, orientation = "horizontal", decorative = true, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
7159
7123
|
SeparatorPrimitive__namespace.Root,
|
|
7160
7124
|
{
|
|
7161
7125
|
ref,
|
|
@@ -7173,7 +7137,7 @@ Separator3.displayName = SeparatorPrimitive__namespace.Root.displayName;
|
|
|
7173
7137
|
var Collapsible = CollapsiblePrimitive__namespace.Root;
|
|
7174
7138
|
var CollapsibleTrigger2 = CollapsiblePrimitive__namespace.CollapsibleTrigger;
|
|
7175
7139
|
var CollapsibleContent2 = CollapsiblePrimitive__namespace.CollapsibleContent;
|
|
7176
|
-
var ScrollArea =
|
|
7140
|
+
var ScrollArea = React26__namespace.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
7177
7141
|
ScrollAreaPrimitive__namespace.Root,
|
|
7178
7142
|
{
|
|
7179
7143
|
ref,
|
|
@@ -7187,7 +7151,7 @@ var ScrollArea = React25__namespace.forwardRef(({ className, children, ...props
|
|
|
7187
7151
|
}
|
|
7188
7152
|
));
|
|
7189
7153
|
ScrollArea.displayName = ScrollAreaPrimitive__namespace.Root.displayName;
|
|
7190
|
-
var ScrollBar =
|
|
7154
|
+
var ScrollBar = React26__namespace.forwardRef(({ className, orientation = "vertical", ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
7191
7155
|
ScrollAreaPrimitive__namespace.ScrollAreaScrollbar,
|
|
7192
7156
|
{
|
|
7193
7157
|
ref,
|
|
@@ -7203,27 +7167,27 @@ var ScrollBar = React25__namespace.forwardRef(({ className, orientation = "verti
|
|
|
7203
7167
|
}
|
|
7204
7168
|
));
|
|
7205
7169
|
ScrollBar.displayName = ScrollAreaPrimitive__namespace.ScrollAreaScrollbar.displayName;
|
|
7206
|
-
var Card =
|
|
7170
|
+
var Card = React26__namespace.forwardRef(
|
|
7207
7171
|
({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn("rounded-lg border bg-card text-card-foreground shadow-sm", className), ...props })
|
|
7208
7172
|
);
|
|
7209
7173
|
Card.displayName = "Card";
|
|
7210
|
-
var CardHeader =
|
|
7174
|
+
var CardHeader = React26__namespace.forwardRef(
|
|
7211
7175
|
({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn("flex flex-col space-y-1.5 p-6", className), ...props })
|
|
7212
7176
|
);
|
|
7213
7177
|
CardHeader.displayName = "CardHeader";
|
|
7214
|
-
var CardTitle =
|
|
7178
|
+
var CardTitle = React26__namespace.forwardRef(
|
|
7215
7179
|
({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("h3", { ref, className: cn("text-2xl font-semibold leading-none tracking-tight", className), ...props })
|
|
7216
7180
|
);
|
|
7217
7181
|
CardTitle.displayName = "CardTitle";
|
|
7218
|
-
var CardDescription =
|
|
7182
|
+
var CardDescription = React26__namespace.forwardRef(
|
|
7219
7183
|
({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("p", { ref, className: cn("text-sm text-muted-foreground", className), ...props })
|
|
7220
7184
|
);
|
|
7221
7185
|
CardDescription.displayName = "CardDescription";
|
|
7222
|
-
var CardContent =
|
|
7186
|
+
var CardContent = React26__namespace.forwardRef(
|
|
7223
7187
|
({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn("p-6 pt-0", className), ...props })
|
|
7224
7188
|
);
|
|
7225
7189
|
CardContent.displayName = "CardContent";
|
|
7226
|
-
var CardFooter =
|
|
7190
|
+
var CardFooter = React26__namespace.forwardRef(
|
|
7227
7191
|
({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn("flex items-center p-6 pt-0", className), ...props })
|
|
7228
7192
|
);
|
|
7229
7193
|
CardFooter.displayName = "CardFooter";
|
|
@@ -7256,16 +7220,16 @@ var toggleVariants = classVarianceAuthority.cva(
|
|
|
7256
7220
|
defaultVariants: { variant: "default", size: "default" }
|
|
7257
7221
|
}
|
|
7258
7222
|
);
|
|
7259
|
-
var Toggle =
|
|
7223
|
+
var Toggle = React26__namespace.forwardRef(({ className, variant, size, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(TogglePrimitive__namespace.Root, { ref, className: cn(toggleVariants({ variant, size, className })), ...props }));
|
|
7260
7224
|
Toggle.displayName = TogglePrimitive__namespace.Root.displayName;
|
|
7261
|
-
var ToggleGroupContext =
|
|
7225
|
+
var ToggleGroupContext = React26__namespace.createContext({
|
|
7262
7226
|
size: "default",
|
|
7263
7227
|
variant: "default"
|
|
7264
7228
|
});
|
|
7265
|
-
var ToggleGroup =
|
|
7229
|
+
var ToggleGroup = React26__namespace.forwardRef(({ className, variant, size, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(ToggleGroupPrimitive__namespace.Root, { ref, className: cn("flex items-center justify-center gap-1", className), ...props, children: /* @__PURE__ */ jsxRuntime.jsx(ToggleGroupContext.Provider, { value: { variant, size }, children }) }));
|
|
7266
7230
|
ToggleGroup.displayName = ToggleGroupPrimitive__namespace.Root.displayName;
|
|
7267
|
-
var ToggleGroupItem =
|
|
7268
|
-
const context =
|
|
7231
|
+
var ToggleGroupItem = React26__namespace.forwardRef(({ className, children, variant, size, ...props }, ref) => {
|
|
7232
|
+
const context = React26__namespace.useContext(ToggleGroupContext);
|
|
7269
7233
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
7270
7234
|
ToggleGroupPrimitive__namespace.Item,
|
|
7271
7235
|
{
|
|
@@ -7280,7 +7244,7 @@ ToggleGroupItem.displayName = ToggleGroupPrimitive__namespace.Item.displayName;
|
|
|
7280
7244
|
var AlertDialog = AlertDialogPrimitive__namespace.Root;
|
|
7281
7245
|
var AlertDialogTrigger = AlertDialogPrimitive__namespace.Trigger;
|
|
7282
7246
|
var AlertDialogPortal = AlertDialogPrimitive__namespace.Portal;
|
|
7283
|
-
var AlertDialogOverlay =
|
|
7247
|
+
var AlertDialogOverlay = React26__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
7284
7248
|
AlertDialogPrimitive__namespace.Overlay,
|
|
7285
7249
|
{
|
|
7286
7250
|
ref,
|
|
@@ -7289,7 +7253,7 @@ var AlertDialogOverlay = React25__namespace.forwardRef(({ className, ...props },
|
|
|
7289
7253
|
}
|
|
7290
7254
|
));
|
|
7291
7255
|
AlertDialogOverlay.displayName = AlertDialogPrimitive__namespace.Overlay.displayName;
|
|
7292
|
-
var AlertDialogContent =
|
|
7256
|
+
var AlertDialogContent = React26__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(AlertDialogPortal, { children: [
|
|
7293
7257
|
/* @__PURE__ */ jsxRuntime.jsx(AlertDialogOverlay, {}),
|
|
7294
7258
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7295
7259
|
AlertDialogPrimitive__namespace.Content,
|
|
@@ -7305,13 +7269,13 @@ var AlertDialogHeader = ({ className, ...props }) => /* @__PURE__ */ jsxRuntime.
|
|
|
7305
7269
|
AlertDialogHeader.displayName = "AlertDialogHeader";
|
|
7306
7270
|
var AlertDialogFooter = ({ className, ...props }) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", className), ...props });
|
|
7307
7271
|
AlertDialogFooter.displayName = "AlertDialogFooter";
|
|
7308
|
-
var AlertDialogTitle =
|
|
7272
|
+
var AlertDialogTitle = React26__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(AlertDialogPrimitive__namespace.Title, { ref, className: cn("text-lg font-semibold", className), ...props }));
|
|
7309
7273
|
AlertDialogTitle.displayName = AlertDialogPrimitive__namespace.Title.displayName;
|
|
7310
|
-
var AlertDialogDescription =
|
|
7274
|
+
var AlertDialogDescription = React26__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(AlertDialogPrimitive__namespace.Description, { ref, className: cn("text-sm text-muted-foreground", className), ...props }));
|
|
7311
7275
|
AlertDialogDescription.displayName = AlertDialogPrimitive__namespace.Description.displayName;
|
|
7312
|
-
var AlertDialogAction =
|
|
7276
|
+
var AlertDialogAction = React26__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(AlertDialogPrimitive__namespace.Action, { ref, className: cn(buttonVariants(), className), ...props }));
|
|
7313
7277
|
AlertDialogAction.displayName = AlertDialogPrimitive__namespace.Action.displayName;
|
|
7314
|
-
var AlertDialogCancel =
|
|
7278
|
+
var AlertDialogCancel = React26__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(AlertDialogPrimitive__namespace.Cancel, { ref, className: cn(buttonVariants({ variant: "outline" }), "mt-2 sm:mt-0", className), ...props }));
|
|
7315
7279
|
AlertDialogCancel.displayName = AlertDialogPrimitive__namespace.Cancel.displayName;
|
|
7316
7280
|
var buttonGroupVariants = classVarianceAuthority.cva(
|
|
7317
7281
|
"flex w-fit items-stretch [&>*]:focus-visible:relative [&>*]:focus-visible:z-10",
|
|
@@ -7339,7 +7303,7 @@ function ButtonGroupText({ className, asChild = false, ...props }) {
|
|
|
7339
7303
|
function ButtonGroupSeparator({ className, orientation = "vertical", ...props }) {
|
|
7340
7304
|
return /* @__PURE__ */ jsxRuntime.jsx(Separator3, { orientation, className: cn("bg-input relative !m-0 self-stretch data-[orientation=vertical]:h-auto", className), ...props });
|
|
7341
7305
|
}
|
|
7342
|
-
var SkeletonBase =
|
|
7306
|
+
var SkeletonBase = React26__namespace.forwardRef(
|
|
7343
7307
|
({ className, ...rest }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
7344
7308
|
"div",
|
|
7345
7309
|
{
|
|
@@ -7515,8 +7479,8 @@ function LoadingTimeout({
|
|
|
7515
7479
|
firm: thresholds?.firm ?? 15e3,
|
|
7516
7480
|
expired: thresholds?.expired ?? 3e4
|
|
7517
7481
|
};
|
|
7518
|
-
const [phase, setPhase] =
|
|
7519
|
-
|
|
7482
|
+
const [phase, setPhase] = React26__namespace.useState(active ? "silent" : "idle");
|
|
7483
|
+
React26__namespace.useEffect(() => {
|
|
7520
7484
|
if (!active) {
|
|
7521
7485
|
setPhase("idle");
|
|
7522
7486
|
return;
|
|
@@ -7575,7 +7539,7 @@ function ProgressiveImage({
|
|
|
7575
7539
|
onLoad,
|
|
7576
7540
|
onError
|
|
7577
7541
|
}) {
|
|
7578
|
-
const [loaded, setLoaded] =
|
|
7542
|
+
const [loaded, setLoaded] = React26__namespace.useState(false);
|
|
7579
7543
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
7580
7544
|
"div",
|
|
7581
7545
|
{
|
|
@@ -7656,8 +7620,8 @@ function errorToast({ title, description, duration = 5e3, action }) {
|
|
|
7656
7620
|
});
|
|
7657
7621
|
}
|
|
7658
7622
|
function useLoadingState(initial = false) {
|
|
7659
|
-
const [isLoading, setLoading] =
|
|
7660
|
-
const withLoading =
|
|
7623
|
+
const [isLoading, setLoading] = React26.useState(initial);
|
|
7624
|
+
const withLoading = React26.useCallback(async (fn) => {
|
|
7661
7625
|
setLoading(true);
|
|
7662
7626
|
try {
|
|
7663
7627
|
return await fn();
|
|
@@ -7668,8 +7632,8 @@ function useLoadingState(initial = false) {
|
|
|
7668
7632
|
return { isLoading, setLoading, withLoading };
|
|
7669
7633
|
}
|
|
7670
7634
|
function useErrorDisplay() {
|
|
7671
|
-
const [error, setRaw] =
|
|
7672
|
-
const setError =
|
|
7635
|
+
const [error, setRaw] = React26.useState(null);
|
|
7636
|
+
const setError = React26.useCallback((value) => {
|
|
7673
7637
|
if (value == null) {
|
|
7674
7638
|
setRaw(null);
|
|
7675
7639
|
return;
|
|
@@ -7684,12 +7648,12 @@ function useErrorDisplay() {
|
|
|
7684
7648
|
}
|
|
7685
7649
|
setRaw(String(value));
|
|
7686
7650
|
}, []);
|
|
7687
|
-
const clearError =
|
|
7651
|
+
const clearError = React26.useCallback(() => setRaw(null), []);
|
|
7688
7652
|
return { error, setError, clearError };
|
|
7689
7653
|
}
|
|
7690
7654
|
function useDebounce(value, delayMs) {
|
|
7691
|
-
const [debounced_value, set_debounced_value] =
|
|
7692
|
-
|
|
7655
|
+
const [debounced_value, set_debounced_value] = React26.useState(value);
|
|
7656
|
+
React26.useEffect(() => {
|
|
7693
7657
|
const timer = setTimeout(() => {
|
|
7694
7658
|
set_debounced_value(value);
|
|
7695
7659
|
}, delayMs);
|
|
@@ -7698,8 +7662,8 @@ function useDebounce(value, delayMs) {
|
|
|
7698
7662
|
return debounced_value;
|
|
7699
7663
|
}
|
|
7700
7664
|
function useCopyToClipboard() {
|
|
7701
|
-
const [copied, set_copied] =
|
|
7702
|
-
const copy =
|
|
7665
|
+
const [copied, set_copied] = React26.useState(false);
|
|
7666
|
+
const copy = React26.useCallback(async (text) => {
|
|
7703
7667
|
if (typeof navigator === "undefined" || !navigator.clipboard) {
|
|
7704
7668
|
return;
|
|
7705
7669
|
}
|
|
@@ -7731,8 +7695,8 @@ function useLocalStorage(key, initialValue) {
|
|
|
7731
7695
|
return initialValue;
|
|
7732
7696
|
}
|
|
7733
7697
|
};
|
|
7734
|
-
const [stored_value, set_stored_value] =
|
|
7735
|
-
const set_value =
|
|
7698
|
+
const [stored_value, set_stored_value] = React26.useState(read_stored);
|
|
7699
|
+
const set_value = React26.useCallback(
|
|
7736
7700
|
(value) => {
|
|
7737
7701
|
set_stored_value((prev) => {
|
|
7738
7702
|
const next = typeof value === "function" ? value(prev) : value;
|
|
@@ -7759,8 +7723,8 @@ function useSessionStorage(key, initialValue) {
|
|
|
7759
7723
|
return initialValue;
|
|
7760
7724
|
}
|
|
7761
7725
|
};
|
|
7762
|
-
const [stored_value, set_stored_value] =
|
|
7763
|
-
const set_value =
|
|
7726
|
+
const [stored_value, set_stored_value] = React26.useState(read_stored);
|
|
7727
|
+
const set_value = React26.useCallback(
|
|
7764
7728
|
(value) => {
|
|
7765
7729
|
set_stored_value((prev) => {
|
|
7766
7730
|
const next = typeof value === "function" ? value(prev) : value;
|
|
@@ -7778,7 +7742,7 @@ function useSessionStorage(key, initialValue) {
|
|
|
7778
7742
|
return [stored_value, set_value];
|
|
7779
7743
|
}
|
|
7780
7744
|
function useClickOutside(ref, handler) {
|
|
7781
|
-
|
|
7745
|
+
React26.useEffect(() => {
|
|
7782
7746
|
if (typeof document === "undefined") return;
|
|
7783
7747
|
const handle_event = (event) => {
|
|
7784
7748
|
const target = event.target;
|
|
@@ -7797,9 +7761,9 @@ function useClickOutside(ref, handler) {
|
|
|
7797
7761
|
}
|
|
7798
7762
|
function useWakeLock() {
|
|
7799
7763
|
const supported = typeof navigator !== "undefined" && "wakeLock" in navigator;
|
|
7800
|
-
const sentinel_ref =
|
|
7801
|
-
const [acquired, set_acquired] =
|
|
7802
|
-
const request =
|
|
7764
|
+
const sentinel_ref = React26.useRef(null);
|
|
7765
|
+
const [acquired, set_acquired] = React26.useState(false);
|
|
7766
|
+
const request = React26.useCallback(async () => {
|
|
7803
7767
|
if (!supported || sentinel_ref.current) return;
|
|
7804
7768
|
try {
|
|
7805
7769
|
const sentinel = await navigator.wakeLock.request("screen");
|
|
@@ -7812,7 +7776,7 @@ function useWakeLock() {
|
|
|
7812
7776
|
} catch {
|
|
7813
7777
|
}
|
|
7814
7778
|
}, [supported]);
|
|
7815
|
-
const release =
|
|
7779
|
+
const release = React26.useCallback(async () => {
|
|
7816
7780
|
if (!sentinel_ref.current) return;
|
|
7817
7781
|
try {
|
|
7818
7782
|
await sentinel_ref.current.release();
|
|
@@ -7822,7 +7786,7 @@ function useWakeLock() {
|
|
|
7822
7786
|
set_acquired(false);
|
|
7823
7787
|
}
|
|
7824
7788
|
}, []);
|
|
7825
|
-
|
|
7789
|
+
React26.useEffect(() => {
|
|
7826
7790
|
if (typeof document === "undefined") return;
|
|
7827
7791
|
const handle_visibility = () => {
|
|
7828
7792
|
if (document.visibilityState === "visible" && acquired && !sentinel_ref.current) {
|
|
@@ -7832,7 +7796,7 @@ function useWakeLock() {
|
|
|
7832
7796
|
document.addEventListener("visibilitychange", handle_visibility);
|
|
7833
7797
|
return () => document.removeEventListener("visibilitychange", handle_visibility);
|
|
7834
7798
|
}, [acquired, request]);
|
|
7835
|
-
|
|
7799
|
+
React26.useEffect(() => {
|
|
7836
7800
|
return () => {
|
|
7837
7801
|
if (sentinel_ref.current) {
|
|
7838
7802
|
void sentinel_ref.current.release().catch(() => void 0);
|
|
@@ -7843,8 +7807,8 @@ function useWakeLock() {
|
|
|
7843
7807
|
return { supported, acquired, request, release };
|
|
7844
7808
|
}
|
|
7845
7809
|
function useFullscreen(elementRef) {
|
|
7846
|
-
const [is_fullscreen, set_is_fullscreen] =
|
|
7847
|
-
|
|
7810
|
+
const [is_fullscreen, set_is_fullscreen] = React26.useState(false);
|
|
7811
|
+
React26.useEffect(() => {
|
|
7848
7812
|
if (typeof document === "undefined") return;
|
|
7849
7813
|
const handle_change = () => {
|
|
7850
7814
|
set_is_fullscreen(!!document.fullscreenElement);
|
|
@@ -7853,10 +7817,10 @@ function useFullscreen(elementRef) {
|
|
|
7853
7817
|
set_is_fullscreen(!!document.fullscreenElement);
|
|
7854
7818
|
return () => document.removeEventListener("fullscreenchange", handle_change);
|
|
7855
7819
|
}, []);
|
|
7856
|
-
const get_target =
|
|
7820
|
+
const get_target = React26.useCallback(() => {
|
|
7857
7821
|
return elementRef?.current ?? document.documentElement;
|
|
7858
7822
|
}, [elementRef]);
|
|
7859
|
-
const enter =
|
|
7823
|
+
const enter = React26.useCallback(async () => {
|
|
7860
7824
|
if (typeof document === "undefined" || !document.documentElement.requestFullscreen) return;
|
|
7861
7825
|
if (document.fullscreenElement) return;
|
|
7862
7826
|
try {
|
|
@@ -7864,7 +7828,7 @@ function useFullscreen(elementRef) {
|
|
|
7864
7828
|
} catch {
|
|
7865
7829
|
}
|
|
7866
7830
|
}, [get_target]);
|
|
7867
|
-
const exit =
|
|
7831
|
+
const exit = React26.useCallback(async () => {
|
|
7868
7832
|
if (typeof document === "undefined") return;
|
|
7869
7833
|
if (!document.fullscreenElement) return;
|
|
7870
7834
|
try {
|
|
@@ -7872,7 +7836,7 @@ function useFullscreen(elementRef) {
|
|
|
7872
7836
|
} catch {
|
|
7873
7837
|
}
|
|
7874
7838
|
}, []);
|
|
7875
|
-
const toggle =
|
|
7839
|
+
const toggle = React26.useCallback(async () => {
|
|
7876
7840
|
if (document.fullscreenElement) {
|
|
7877
7841
|
await exit();
|
|
7878
7842
|
} else {
|
|
@@ -8030,29 +7994,29 @@ function KanbanEditor({
|
|
|
8030
7994
|
onSave,
|
|
8031
7995
|
onClose
|
|
8032
7996
|
}) {
|
|
8033
|
-
const [draft, set_draft] =
|
|
8034
|
-
const [saving, set_saving] =
|
|
8035
|
-
const [error, set_error] =
|
|
7997
|
+
const [draft, set_draft] = React26__namespace.useState(item);
|
|
7998
|
+
const [saving, set_saving] = React26__namespace.useState(false);
|
|
7999
|
+
const [error, set_error] = React26__namespace.useState(null);
|
|
8036
8000
|
const item_id = item?.id ?? null;
|
|
8037
|
-
|
|
8001
|
+
React26__namespace.useEffect(() => {
|
|
8038
8002
|
set_draft(item);
|
|
8039
8003
|
set_error(null);
|
|
8040
8004
|
set_saving(false);
|
|
8041
8005
|
}, [item_id]);
|
|
8042
8006
|
const resolved_columns = columns ?? [];
|
|
8043
8007
|
const resolved_priorities = priorities ?? DEFAULT_PRIORITIES;
|
|
8044
|
-
const resolved_fields =
|
|
8008
|
+
const resolved_fields = React26__namespace.useMemo(() => {
|
|
8045
8009
|
if (fields) return fields;
|
|
8046
8010
|
if (!item) return [];
|
|
8047
8011
|
return auto_detect_fields(item, resolved_columns);
|
|
8048
8012
|
}, [fields, item, resolved_columns]);
|
|
8049
|
-
const required_keys =
|
|
8013
|
+
const required_keys = React26__namespace.useMemo(
|
|
8050
8014
|
() => resolved_fields.filter(
|
|
8051
8015
|
(f) => f.required && (f.type === "text" || f.type === "textarea" || f.type === "number")
|
|
8052
8016
|
).map((f) => f.key),
|
|
8053
8017
|
[resolved_fields]
|
|
8054
8018
|
);
|
|
8055
|
-
const all_required_filled =
|
|
8019
|
+
const all_required_filled = React26__namespace.useMemo(() => {
|
|
8056
8020
|
if (!draft) return false;
|
|
8057
8021
|
for (const key of required_keys) {
|
|
8058
8022
|
const v = draft[key];
|
|
@@ -8061,7 +8025,7 @@ function KanbanEditor({
|
|
|
8061
8025
|
}
|
|
8062
8026
|
return true;
|
|
8063
8027
|
}, [draft, required_keys]);
|
|
8064
|
-
const is_dirty =
|
|
8028
|
+
const is_dirty = React26__namespace.useMemo(() => {
|
|
8065
8029
|
if (!draft || !item) return false;
|
|
8066
8030
|
try {
|
|
8067
8031
|
return JSON.stringify(draft) !== JSON.stringify(item);
|
|
@@ -8069,7 +8033,7 @@ function KanbanEditor({
|
|
|
8069
8033
|
return draft !== item;
|
|
8070
8034
|
}
|
|
8071
8035
|
}, [draft, item]);
|
|
8072
|
-
const handle_save =
|
|
8036
|
+
const handle_save = React26__namespace.useCallback(async () => {
|
|
8073
8037
|
if (!draft || !item) return;
|
|
8074
8038
|
if (saving) return;
|
|
8075
8039
|
set_error(null);
|
|
@@ -8288,11 +8252,11 @@ function HazoUiKanbanFilter({
|
|
|
8288
8252
|
className
|
|
8289
8253
|
}) {
|
|
8290
8254
|
const is_controlled = value !== void 0;
|
|
8291
|
-
const [internal, set_internal] =
|
|
8255
|
+
const [internal, set_internal] = React26__namespace.useState(
|
|
8292
8256
|
defaultValue ?? EMPTY_FILTER
|
|
8293
8257
|
);
|
|
8294
8258
|
const current = is_controlled ? value : internal;
|
|
8295
|
-
const update =
|
|
8259
|
+
const update = React26__namespace.useCallback(
|
|
8296
8260
|
(next) => {
|
|
8297
8261
|
if (!is_controlled) set_internal(next);
|
|
8298
8262
|
onChange?.(next);
|
|
@@ -8455,29 +8419,29 @@ function HazoUiKanban({
|
|
|
8455
8419
|
onCardSave,
|
|
8456
8420
|
disableEdit = false
|
|
8457
8421
|
}) {
|
|
8458
|
-
const label_fn =
|
|
8422
|
+
const label_fn = React26__namespace.useCallback(
|
|
8459
8423
|
(item) => itemLabel ? itemLabel(item) : item.id,
|
|
8460
8424
|
[itemLabel]
|
|
8461
8425
|
);
|
|
8462
|
-
const dnd_context_id =
|
|
8463
|
-
const [overlay, set_overlay] =
|
|
8426
|
+
const dnd_context_id = React26__namespace.useId();
|
|
8427
|
+
const [overlay, set_overlay] = React26__namespace.useState(
|
|
8464
8428
|
/* @__PURE__ */ new Map()
|
|
8465
8429
|
);
|
|
8466
|
-
const [active_id, set_active_id] =
|
|
8467
|
-
const [active_tab, set_active_tab] =
|
|
8468
|
-
const [editing_item, set_editing_item] =
|
|
8430
|
+
const [active_id, set_active_id] = React26__namespace.useState(null);
|
|
8431
|
+
const [active_tab, set_active_tab] = React26__namespace.useState(columns[0]?.key ?? "");
|
|
8432
|
+
const [editing_item, set_editing_item] = React26__namespace.useState(null);
|
|
8469
8433
|
const show_edit = !disableEdit && typeof onCardSave === "function";
|
|
8470
|
-
const handle_edit_request =
|
|
8434
|
+
const handle_edit_request = React26__namespace.useCallback(
|
|
8471
8435
|
(it) => {
|
|
8472
8436
|
const typed = items.find((x) => x.id === it.id);
|
|
8473
8437
|
if (typed) set_editing_item(typed);
|
|
8474
8438
|
},
|
|
8475
8439
|
[items]
|
|
8476
8440
|
);
|
|
8477
|
-
const handle_editor_close =
|
|
8441
|
+
const handle_editor_close = React26__namespace.useCallback(() => {
|
|
8478
8442
|
set_editing_item(null);
|
|
8479
8443
|
}, []);
|
|
8480
|
-
|
|
8444
|
+
React26__namespace.useEffect(() => {
|
|
8481
8445
|
if (overlay.size === 0) return;
|
|
8482
8446
|
set_overlay((prev) => {
|
|
8483
8447
|
let changed = false;
|
|
@@ -8492,11 +8456,11 @@ function HazoUiKanban({
|
|
|
8492
8456
|
return changed ? next : prev;
|
|
8493
8457
|
});
|
|
8494
8458
|
}, [items, overlay]);
|
|
8495
|
-
const grouped =
|
|
8459
|
+
const grouped = React26__namespace.useMemo(
|
|
8496
8460
|
() => group_items_by_column(items, overlay, columns),
|
|
8497
8461
|
[items, overlay, columns]
|
|
8498
8462
|
);
|
|
8499
|
-
const find_item =
|
|
8463
|
+
const find_item = React26__namespace.useCallback(
|
|
8500
8464
|
(id) => items.find((i) => i.id === id),
|
|
8501
8465
|
[items]
|
|
8502
8466
|
);
|
|
@@ -8504,7 +8468,7 @@ function HazoUiKanban({
|
|
|
8504
8468
|
core$1.useSensor(core$1.PointerSensor, { activationConstraint: { distance: 5 } }),
|
|
8505
8469
|
core$1.useSensor(core$1.KeyboardSensor, { coordinateGetter: sortable.sortableKeyboardCoordinates })
|
|
8506
8470
|
);
|
|
8507
|
-
const merged_announcements =
|
|
8471
|
+
const merged_announcements = React26__namespace.useMemo(() => {
|
|
8508
8472
|
const defaults = default_announcements(label_fn);
|
|
8509
8473
|
return {
|
|
8510
8474
|
onDragStart: announcements?.onDragStart ?? defaults.onDragStart,
|
|
@@ -8513,7 +8477,7 @@ function HazoUiKanban({
|
|
|
8513
8477
|
onDragCancel: announcements?.onDragCancel ?? defaults.onDragCancel
|
|
8514
8478
|
};
|
|
8515
8479
|
}, [announcements, label_fn]);
|
|
8516
|
-
const dnd_announcements =
|
|
8480
|
+
const dnd_announcements = React26__namespace.useMemo(
|
|
8517
8481
|
() => ({
|
|
8518
8482
|
onDragStart({ active }) {
|
|
8519
8483
|
const id = String(active.id);
|
|
@@ -8571,10 +8535,10 @@ function HazoUiKanban({
|
|
|
8571
8535
|
}),
|
|
8572
8536
|
[find_item, columns, grouped, merged_announcements]
|
|
8573
8537
|
);
|
|
8574
|
-
const handle_drag_start =
|
|
8538
|
+
const handle_drag_start = React26__namespace.useCallback((event) => {
|
|
8575
8539
|
set_active_id(String(event.active.id));
|
|
8576
8540
|
}, []);
|
|
8577
|
-
const make_revert_handle =
|
|
8541
|
+
const make_revert_handle = React26__namespace.useCallback(
|
|
8578
8542
|
(item_id) => ({
|
|
8579
8543
|
revert: () => {
|
|
8580
8544
|
set_overlay((prev) => {
|
|
@@ -8587,7 +8551,7 @@ function HazoUiKanban({
|
|
|
8587
8551
|
}),
|
|
8588
8552
|
[]
|
|
8589
8553
|
);
|
|
8590
|
-
const handle_drag_end =
|
|
8554
|
+
const handle_drag_end = React26__namespace.useCallback(
|
|
8591
8555
|
(event) => {
|
|
8592
8556
|
const active_id_str = String(event.active.id);
|
|
8593
8557
|
set_active_id(null);
|
|
@@ -8649,7 +8613,7 @@ function HazoUiKanban({
|
|
|
8649
8613
|
},
|
|
8650
8614
|
[find_item, columns, grouped, onMove, onReorder, make_revert_handle]
|
|
8651
8615
|
);
|
|
8652
|
-
const handle_drag_cancel =
|
|
8616
|
+
const handle_drag_cancel = React26__namespace.useCallback(() => {
|
|
8653
8617
|
set_active_id(null);
|
|
8654
8618
|
}, []);
|
|
8655
8619
|
const active_item = active_id ? find_item(active_id) : null;
|
|
@@ -8740,7 +8704,7 @@ function HazoUiKanban({
|
|
|
8740
8704
|
}
|
|
8741
8705
|
);
|
|
8742
8706
|
}
|
|
8743
|
-
var Table2 =
|
|
8707
|
+
var Table2 = React26__namespace.forwardRef(
|
|
8744
8708
|
({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: "cls_table_wrap relative w-full overflow-auto", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
8745
8709
|
"table",
|
|
8746
8710
|
{
|
|
@@ -8751,11 +8715,11 @@ var Table2 = React25__namespace.forwardRef(
|
|
|
8751
8715
|
) })
|
|
8752
8716
|
);
|
|
8753
8717
|
Table2.displayName = "Table";
|
|
8754
|
-
var TableHeader2 =
|
|
8718
|
+
var TableHeader2 = React26__namespace.forwardRef(
|
|
8755
8719
|
({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("thead", { ref, className: cn("[&_tr]:border-b", className), ...props })
|
|
8756
8720
|
);
|
|
8757
8721
|
TableHeader2.displayName = "TableHeader";
|
|
8758
|
-
var TableBody =
|
|
8722
|
+
var TableBody = React26__namespace.forwardRef(
|
|
8759
8723
|
({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
8760
8724
|
"tbody",
|
|
8761
8725
|
{
|
|
@@ -8766,7 +8730,7 @@ var TableBody = React25__namespace.forwardRef(
|
|
|
8766
8730
|
)
|
|
8767
8731
|
);
|
|
8768
8732
|
TableBody.displayName = "TableBody";
|
|
8769
|
-
var TableFooter =
|
|
8733
|
+
var TableFooter = React26__namespace.forwardRef(
|
|
8770
8734
|
({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
8771
8735
|
"tfoot",
|
|
8772
8736
|
{
|
|
@@ -8777,7 +8741,7 @@ var TableFooter = React25__namespace.forwardRef(
|
|
|
8777
8741
|
)
|
|
8778
8742
|
);
|
|
8779
8743
|
TableFooter.displayName = "TableFooter";
|
|
8780
|
-
var TableRow2 =
|
|
8744
|
+
var TableRow2 = React26__namespace.forwardRef(
|
|
8781
8745
|
({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
8782
8746
|
"tr",
|
|
8783
8747
|
{
|
|
@@ -8791,7 +8755,7 @@ var TableRow2 = React25__namespace.forwardRef(
|
|
|
8791
8755
|
)
|
|
8792
8756
|
);
|
|
8793
8757
|
TableRow2.displayName = "TableRow";
|
|
8794
|
-
var TableHead =
|
|
8758
|
+
var TableHead = React26__namespace.forwardRef(
|
|
8795
8759
|
({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
8796
8760
|
"th",
|
|
8797
8761
|
{
|
|
@@ -8805,7 +8769,7 @@ var TableHead = React25__namespace.forwardRef(
|
|
|
8805
8769
|
)
|
|
8806
8770
|
);
|
|
8807
8771
|
TableHead.displayName = "TableHead";
|
|
8808
|
-
var TableCell2 =
|
|
8772
|
+
var TableCell2 = React26__namespace.forwardRef(
|
|
8809
8773
|
({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
8810
8774
|
"td",
|
|
8811
8775
|
{
|
|
@@ -8816,7 +8780,7 @@ var TableCell2 = React25__namespace.forwardRef(
|
|
|
8816
8780
|
)
|
|
8817
8781
|
);
|
|
8818
8782
|
TableCell2.displayName = "TableCell";
|
|
8819
|
-
var TableCaption =
|
|
8783
|
+
var TableCaption = React26__namespace.forwardRef(
|
|
8820
8784
|
({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
8821
8785
|
"caption",
|
|
8822
8786
|
{
|
|
@@ -8871,64 +8835,64 @@ function TableMobileCards(props) {
|
|
|
8871
8835
|
}
|
|
8872
8836
|
var DEFAULT_DEBOUNCE_MS = 200;
|
|
8873
8837
|
function useTableState(props) {
|
|
8874
|
-
const [sortInternal, setSortInternal] =
|
|
8838
|
+
const [sortInternal, setSortInternal] = React26.useState(
|
|
8875
8839
|
() => normalizeSortProp(props.defaultSort)
|
|
8876
8840
|
);
|
|
8877
8841
|
const isSortControlled = props.sort !== void 0;
|
|
8878
8842
|
const sort = isSortControlled ? normalizeSortProp(props.sort) : sortInternal;
|
|
8879
|
-
const setSort =
|
|
8843
|
+
const setSort = React26.useCallback(
|
|
8880
8844
|
(next) => {
|
|
8881
8845
|
if (!isSortControlled) setSortInternal(next);
|
|
8882
8846
|
props.onSortChange?.(next);
|
|
8883
8847
|
},
|
|
8884
8848
|
[isSortControlled, props.onSortChange]
|
|
8885
8849
|
);
|
|
8886
|
-
const cycleHeaderSort =
|
|
8850
|
+
const cycleHeaderSort = React26.useCallback(
|
|
8887
8851
|
(key, append) => {
|
|
8888
8852
|
const next = append ? cycleAppendColumn(sort, key) : cycleSingleColumn(sort, key);
|
|
8889
8853
|
setSort(next);
|
|
8890
8854
|
},
|
|
8891
8855
|
[sort, setSort]
|
|
8892
8856
|
);
|
|
8893
|
-
const [filterInternal, setFilterInternal] =
|
|
8857
|
+
const [filterInternal, setFilterInternal] = React26.useState(
|
|
8894
8858
|
() => props.defaultFilter ?? {}
|
|
8895
8859
|
);
|
|
8896
8860
|
const isFilterControlled = props.filter !== void 0;
|
|
8897
8861
|
const filter = isFilterControlled ? props.filter : filterInternal;
|
|
8898
|
-
const setFilter =
|
|
8862
|
+
const setFilter = React26.useCallback(
|
|
8899
8863
|
(next) => {
|
|
8900
8864
|
if (!isFilterControlled) setFilterInternal(next);
|
|
8901
8865
|
props.onFilterChange?.(next);
|
|
8902
8866
|
},
|
|
8903
8867
|
[isFilterControlled, props.onFilterChange]
|
|
8904
8868
|
);
|
|
8905
|
-
const [searchDraft, setSearchDraft] =
|
|
8869
|
+
const [searchDraft, setSearchDraft] = React26.useState(
|
|
8906
8870
|
filter.search ?? ""
|
|
8907
8871
|
);
|
|
8908
8872
|
const debounceMs = props.searchDebounceMs ?? DEFAULT_DEBOUNCE_MS;
|
|
8909
|
-
|
|
8873
|
+
React26.useEffect(() => {
|
|
8910
8874
|
const handle = setTimeout(() => {
|
|
8911
8875
|
if (searchDraft === (filter.search ?? "")) return;
|
|
8912
8876
|
setFilter({ ...filter, search: searchDraft || void 0 });
|
|
8913
8877
|
}, debounceMs);
|
|
8914
8878
|
return () => clearTimeout(handle);
|
|
8915
8879
|
}, [searchDraft, debounceMs]);
|
|
8916
|
-
const setSearch =
|
|
8917
|
-
const [pageInternal, setPageInternal] =
|
|
8880
|
+
const setSearch = React26.useCallback((s) => setSearchDraft(s), []);
|
|
8881
|
+
const [pageInternal, setPageInternal] = React26.useState(
|
|
8918
8882
|
() => props.defaultPage ?? 0
|
|
8919
8883
|
);
|
|
8920
8884
|
const isPageControlled = props.page !== void 0;
|
|
8921
8885
|
const page = isPageControlled ? props.page : pageInternal;
|
|
8922
|
-
const setPage =
|
|
8886
|
+
const setPage = React26.useCallback(
|
|
8923
8887
|
(next) => {
|
|
8924
8888
|
if (!isPageControlled) setPageInternal(next);
|
|
8925
8889
|
props.onPageChange?.(next);
|
|
8926
8890
|
},
|
|
8927
8891
|
[isPageControlled, props.onPageChange]
|
|
8928
8892
|
);
|
|
8929
|
-
const prevSortKey =
|
|
8930
|
-
const prevFilterKey =
|
|
8931
|
-
|
|
8893
|
+
const prevSortKey = React26.useRef(serializeSort(sort));
|
|
8894
|
+
const prevFilterKey = React26.useRef(serializeFilter(filter));
|
|
8895
|
+
React26.useEffect(() => {
|
|
8932
8896
|
const sk = serializeSort(sort);
|
|
8933
8897
|
const fk = serializeFilter(filter);
|
|
8934
8898
|
if (sk !== prevSortKey.current || fk !== prevFilterKey.current) {
|
|
@@ -8939,24 +8903,24 @@ function useTableState(props) {
|
|
|
8939
8903
|
}, [sort, filter, isPageControlled]);
|
|
8940
8904
|
const pageSize = props.pagination && typeof props.pagination === "object" ? props.pagination.pageSize : 0;
|
|
8941
8905
|
const isServerMode = typeof props.onLoad === "function";
|
|
8942
|
-
const filtered =
|
|
8906
|
+
const filtered = React26.useMemo(
|
|
8943
8907
|
() => isServerMode ? props.rows : applyFilter(props.rows, filter, props.columns),
|
|
8944
8908
|
[props.rows, filter, props.columns, isServerMode]
|
|
8945
8909
|
);
|
|
8946
|
-
const sorted =
|
|
8910
|
+
const sorted = React26.useMemo(
|
|
8947
8911
|
() => isServerMode ? filtered : applySort(filtered, sort),
|
|
8948
8912
|
[filtered, sort, isServerMode]
|
|
8949
8913
|
);
|
|
8950
|
-
const pagedInMemory =
|
|
8914
|
+
const pagedInMemory = React26.useMemo(() => {
|
|
8951
8915
|
if (isServerMode || pageSize <= 0) return sorted;
|
|
8952
8916
|
const start = page * pageSize;
|
|
8953
8917
|
return sorted.slice(start, start + pageSize);
|
|
8954
8918
|
}, [sorted, page, pageSize, isServerMode]);
|
|
8955
|
-
const [serverRows, setServerRows] =
|
|
8956
|
-
const [serverTotal, setServerTotal] =
|
|
8957
|
-
const [serverError, setServerError] =
|
|
8958
|
-
const reqIdRef =
|
|
8959
|
-
|
|
8919
|
+
const [serverRows, setServerRows] = React26.useState([]);
|
|
8920
|
+
const [serverTotal, setServerTotal] = React26.useState(0);
|
|
8921
|
+
const [serverError, setServerError] = React26.useState(null);
|
|
8922
|
+
const reqIdRef = React26.useRef(0);
|
|
8923
|
+
React26.useEffect(() => {
|
|
8960
8924
|
if (!isServerMode) return;
|
|
8961
8925
|
const myId = ++reqIdRef.current;
|
|
8962
8926
|
let cancelled = false;
|
|
@@ -9388,18 +9352,18 @@ function Toolbar2(props) {
|
|
|
9388
9352
|
enableFilterDialog,
|
|
9389
9353
|
searchPlaceholder
|
|
9390
9354
|
} = props;
|
|
9391
|
-
const sortFields =
|
|
9355
|
+
const sortFields = React26__namespace.useMemo(
|
|
9392
9356
|
() => deriveSortFields(columns),
|
|
9393
9357
|
[columns]
|
|
9394
9358
|
);
|
|
9395
|
-
const filterFields =
|
|
9359
|
+
const filterFields = React26__namespace.useMemo(
|
|
9396
9360
|
() => deriveFilterFields(columns),
|
|
9397
9361
|
[columns]
|
|
9398
9362
|
);
|
|
9399
|
-
const [searchValue, setSearchValue] =
|
|
9363
|
+
const [searchValue, setSearchValue] = React26__namespace.useState(
|
|
9400
9364
|
filter.search ?? ""
|
|
9401
9365
|
);
|
|
9402
|
-
|
|
9366
|
+
React26__namespace.useEffect(() => {
|
|
9403
9367
|
setSearchValue(filter.search ?? "");
|
|
9404
9368
|
}, [filter.search]);
|
|
9405
9369
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "cls_hazo_ui_table_toolbar flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between", children: [
|
|
@@ -9655,9 +9619,9 @@ function LineChart({
|
|
|
9655
9619
|
className
|
|
9656
9620
|
}) {
|
|
9657
9621
|
const geo = compute_geometry(data, width, height);
|
|
9658
|
-
const svg_ref =
|
|
9659
|
-
const [hover_idx, set_hover_idx] =
|
|
9660
|
-
const handle_mouse_move =
|
|
9622
|
+
const svg_ref = React26__namespace.useRef(null);
|
|
9623
|
+
const [hover_idx, set_hover_idx] = React26__namespace.useState(null);
|
|
9624
|
+
const handle_mouse_move = React26__namespace.useCallback(
|
|
9661
9625
|
(e) => {
|
|
9662
9626
|
if (!geo) return;
|
|
9663
9627
|
const rect = e.currentTarget.getBoundingClientRect();
|
|
@@ -9690,7 +9654,7 @@ function LineChart({
|
|
|
9690
9654
|
},
|
|
9691
9655
|
[geo, data]
|
|
9692
9656
|
);
|
|
9693
|
-
const handle_mouse_leave =
|
|
9657
|
+
const handle_mouse_leave = React26__namespace.useCallback(() => set_hover_idx(null), []);
|
|
9694
9658
|
if (!geo) {
|
|
9695
9659
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
9696
9660
|
"svg",
|
|
@@ -9917,8 +9881,8 @@ function MultiLineChart({
|
|
|
9917
9881
|
className
|
|
9918
9882
|
}) {
|
|
9919
9883
|
const geo = compute_geometry2(series, width, height);
|
|
9920
|
-
const [hover_idx, set_hover_idx] =
|
|
9921
|
-
const handle_mouse_move =
|
|
9884
|
+
const [hover_idx, set_hover_idx] = React26__namespace.useState(null);
|
|
9885
|
+
const handle_mouse_move = React26__namespace.useCallback(
|
|
9922
9886
|
(e) => {
|
|
9923
9887
|
if (!geo) return;
|
|
9924
9888
|
const rect = e.currentTarget.getBoundingClientRect();
|
|
@@ -9935,7 +9899,7 @@ function MultiLineChart({
|
|
|
9935
9899
|
},
|
|
9936
9900
|
[geo]
|
|
9937
9901
|
);
|
|
9938
|
-
const handle_mouse_leave =
|
|
9902
|
+
const handle_mouse_leave = React26__namespace.useCallback(() => set_hover_idx(null), []);
|
|
9939
9903
|
if (!geo) {
|
|
9940
9904
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
9941
9905
|
"svg",
|
|
@@ -10317,21 +10281,21 @@ function celebrate(payload) {
|
|
|
10317
10281
|
_enqueue(payload);
|
|
10318
10282
|
}
|
|
10319
10283
|
function CelebrationProvider({ children }) {
|
|
10320
|
-
const [queue, set_queue] =
|
|
10321
|
-
const enqueue =
|
|
10284
|
+
const [queue, set_queue] = React26__namespace.useState([]);
|
|
10285
|
+
const enqueue = React26__namespace.useCallback((payload) => {
|
|
10322
10286
|
const storage_key = `hazo_ui_celebration_${payload.id}`;
|
|
10323
10287
|
if (typeof window !== "undefined" && sessionStorage.getItem(storage_key)) {
|
|
10324
10288
|
return;
|
|
10325
10289
|
}
|
|
10326
10290
|
set_queue((q) => [...q, payload]);
|
|
10327
10291
|
}, []);
|
|
10328
|
-
|
|
10292
|
+
React26__namespace.useEffect(() => {
|
|
10329
10293
|
_enqueue = enqueue;
|
|
10330
10294
|
return () => {
|
|
10331
10295
|
_enqueue = null;
|
|
10332
10296
|
};
|
|
10333
10297
|
}, [enqueue]);
|
|
10334
|
-
const handle_close =
|
|
10298
|
+
const handle_close = React26__namespace.useCallback(() => {
|
|
10335
10299
|
set_queue((q) => q.slice(1));
|
|
10336
10300
|
}, []);
|
|
10337
10301
|
const current = queue[0] ?? null;
|
|
@@ -10360,14 +10324,14 @@ function CelebrationModalInner({
|
|
|
10360
10324
|
autoDismissDelay = 8e3,
|
|
10361
10325
|
audioChime = false
|
|
10362
10326
|
} = payload;
|
|
10363
|
-
const [visible, set_visible] =
|
|
10364
|
-
const [is_downloading, set_is_downloading] =
|
|
10365
|
-
const canvas_ref =
|
|
10366
|
-
const card_ref =
|
|
10367
|
-
|
|
10327
|
+
const [visible, set_visible] = React26__namespace.useState(true);
|
|
10328
|
+
const [is_downloading, set_is_downloading] = React26__namespace.useState(false);
|
|
10329
|
+
const canvas_ref = React26__namespace.useRef(null);
|
|
10330
|
+
const card_ref = React26__namespace.useRef(null);
|
|
10331
|
+
React26__namespace.useEffect(() => {
|
|
10368
10332
|
sessionStorage.setItem(`hazo_ui_celebration_${id}`, "1");
|
|
10369
10333
|
}, [id]);
|
|
10370
|
-
|
|
10334
|
+
React26__namespace.useEffect(() => {
|
|
10371
10335
|
if (!canvas_ref.current) return;
|
|
10372
10336
|
let confetti_instance = null;
|
|
10373
10337
|
import('canvas-confetti').then(({ default: confetti }) => {
|
|
@@ -10384,18 +10348,18 @@ function CelebrationModalInner({
|
|
|
10384
10348
|
confetti_instance?.reset();
|
|
10385
10349
|
};
|
|
10386
10350
|
}, []);
|
|
10387
|
-
|
|
10351
|
+
React26__namespace.useEffect(() => {
|
|
10388
10352
|
if (!audioChime) return;
|
|
10389
10353
|
const audio = new Audio(celebration_chime_default);
|
|
10390
10354
|
audio.play().catch(() => {
|
|
10391
10355
|
});
|
|
10392
10356
|
}, [audioChime]);
|
|
10393
|
-
|
|
10357
|
+
React26__namespace.useEffect(() => {
|
|
10394
10358
|
if (!autoDismiss) return;
|
|
10395
10359
|
const timer = window.setTimeout(close_modal, autoDismissDelay);
|
|
10396
10360
|
return () => window.clearTimeout(timer);
|
|
10397
10361
|
}, [autoDismiss, autoDismissDelay]);
|
|
10398
|
-
|
|
10362
|
+
React26__namespace.useEffect(() => {
|
|
10399
10363
|
const on_key = (e) => {
|
|
10400
10364
|
if (e.key === "Escape") close_modal();
|
|
10401
10365
|
};
|
|
@@ -10652,6 +10616,7 @@ exports.DropdownMenuTrigger = DropdownMenuTrigger;
|
|
|
10652
10616
|
exports.EmptyState = EmptyState;
|
|
10653
10617
|
exports.ErrorBanner = ErrorBanner;
|
|
10654
10618
|
exports.ErrorPage = ErrorPage;
|
|
10619
|
+
exports.HazoContextProvider = HazoContextProvider;
|
|
10655
10620
|
exports.HazoUiConfirmDialog = HazoUiConfirmDialog;
|
|
10656
10621
|
exports.HazoUiDialog = HazoUiDialog;
|
|
10657
10622
|
exports.HazoUiDialogClose = DialogClose;
|
|
@@ -10742,15 +10707,19 @@ exports.TooltipTrigger = TooltipTrigger;
|
|
|
10742
10707
|
exports.applyKanbanFilter = applyKanbanFilter;
|
|
10743
10708
|
exports.buttonGroupVariants = buttonGroupVariants;
|
|
10744
10709
|
exports.celebrate = celebrate;
|
|
10710
|
+
exports.cn = cn;
|
|
10745
10711
|
exports.create_command_suggestion_extension = create_command_suggestion_extension;
|
|
10746
10712
|
exports.errorToast = errorToast;
|
|
10747
10713
|
exports.format_num = format_num;
|
|
10714
|
+
exports.generateUUID = generateUUID;
|
|
10748
10715
|
exports.get_hazo_ui_config = get_hazo_ui_config;
|
|
10716
|
+
exports.get_logger = get_logger;
|
|
10749
10717
|
exports.parse_commands_from_text = parse_commands_from_text;
|
|
10750
10718
|
exports.pick_x_label_indices = pick_x_label_indices;
|
|
10751
10719
|
exports.reset_hazo_ui_config = reset_hazo_ui_config;
|
|
10752
10720
|
exports.resolve_animation_classes = resolve_animation_classes;
|
|
10753
10721
|
exports.set_hazo_ui_config = set_hazo_ui_config;
|
|
10722
|
+
exports.set_logger = set_logger;
|
|
10754
10723
|
exports.successToast = successToast;
|
|
10755
10724
|
exports.text_to_tiptap_content = text_to_tiptap_content;
|
|
10756
10725
|
exports.toggleVariants = toggleVariants;
|