@noya-app/noya-designsystem 0.1.57 → 0.1.59
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/.turbo/turbo-build.log +10 -10
- package/CHANGELOG.md +14 -0
- package/dist/index.d.mts +15 -6
- package/dist/index.d.ts +15 -6
- package/dist/index.js +300 -253
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +789 -743
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/__tests__/validateDropIndicator.test.ts +64 -31
- package/src/components/sorting/SharedDragProvider.tsx +79 -25
- package/src/components/sorting/Sortable.tsx +19 -26
- package/src/components/sorting/sorting.ts +32 -63
- package/src/utils/moveTreeItem.ts +6 -6
package/dist/index.mjs
CHANGED
|
@@ -218,8 +218,11 @@ import { useEffect as useEffect2, useState as useState5 } from "react";
|
|
|
218
218
|
// ../noya-react-utils/src/hooks/useIsMounted.ts
|
|
219
219
|
import { useEffect as useEffect3, useRef as useRef4 } from "react";
|
|
220
220
|
|
|
221
|
+
// ../noya-react-utils/src/hooks/useIsomorphicLayoutEffect.ts
|
|
222
|
+
import * as React5 from "react";
|
|
223
|
+
|
|
221
224
|
// ../noya-react-utils/src/hooks/useLateReference.ts
|
|
222
|
-
import { useCallback as useCallback5, useLayoutEffect, useRef as useRef5 } from "react";
|
|
225
|
+
import { useCallback as useCallback5, useLayoutEffect as useLayoutEffect2, useRef as useRef5 } from "react";
|
|
223
226
|
|
|
224
227
|
// ../noya-react-utils/src/hooks/useLazyValue.ts
|
|
225
228
|
import { useRef as useRef6 } from "react";
|
|
@@ -253,7 +256,7 @@ import { useCallback as useCallback7, useMemo as useMemo2, useState as useState6
|
|
|
253
256
|
// ../noya-react-utils/src/hooks/usePersistentState.ts
|
|
254
257
|
import {
|
|
255
258
|
useCallback as useCallback8,
|
|
256
|
-
useEffect as
|
|
259
|
+
useEffect as useEffect5,
|
|
257
260
|
useMemo as useMemo3,
|
|
258
261
|
useState as useState7
|
|
259
262
|
} from "react";
|
|
@@ -264,7 +267,7 @@ function usePersistentStateString(storage, storageKey, defaultValue2) {
|
|
|
264
267
|
const [state, setState] = useState7(
|
|
265
268
|
() => getCurrentValue(storage, storageKey, defaultValue2)
|
|
266
269
|
);
|
|
267
|
-
|
|
270
|
+
useEffect5(() => {
|
|
268
271
|
const newValue = getCurrentValue(storage, storageKey, defaultValue2);
|
|
269
272
|
setState(newValue);
|
|
270
273
|
}, [defaultValue2, storage, storageKey]);
|
|
@@ -276,7 +279,7 @@ function usePersistentStateString(storage, storageKey, defaultValue2) {
|
|
|
276
279
|
},
|
|
277
280
|
[defaultValue2, storage, storageKey]
|
|
278
281
|
);
|
|
279
|
-
|
|
282
|
+
useEffect5(() => {
|
|
280
283
|
const dispose = storage.addListener(storageKey, (newValue) => {
|
|
281
284
|
setState(newValue);
|
|
282
285
|
});
|
|
@@ -286,21 +289,33 @@ function usePersistentStateString(storage, storageKey, defaultValue2) {
|
|
|
286
289
|
}
|
|
287
290
|
|
|
288
291
|
// ../noya-react-utils/src/hooks/usePixelRatio.ts
|
|
289
|
-
import { useEffect as
|
|
292
|
+
import { useEffect as useEffect6, useState as useState8 } from "react";
|
|
290
293
|
|
|
291
294
|
// ../noya-react-utils/src/hooks/useShallowArray.ts
|
|
292
295
|
import { isShallowEqual } from "@noya-app/noya-utils";
|
|
293
296
|
import { useRef as useRef7 } from "react";
|
|
294
297
|
|
|
295
298
|
// ../noya-react-utils/src/hooks/useStableCallback.ts
|
|
296
|
-
import { useCallback as useCallback9, useLayoutEffect as
|
|
299
|
+
import { useCallback as useCallback9, useLayoutEffect as useLayoutEffect3, useRef as useRef8 } from "react";
|
|
300
|
+
var noop2 = () => {
|
|
301
|
+
};
|
|
302
|
+
function useStableCallback(callback) {
|
|
303
|
+
const callbackRef = useRef8(callback || noop2);
|
|
304
|
+
useLayoutEffect3(() => {
|
|
305
|
+
callbackRef.current = callback || noop2;
|
|
306
|
+
}, [callback]);
|
|
307
|
+
return useCallback9(
|
|
308
|
+
(...args) => callbackRef.current(...args),
|
|
309
|
+
[callbackRef]
|
|
310
|
+
);
|
|
311
|
+
}
|
|
297
312
|
|
|
298
313
|
// ../noya-react-utils/src/hooks/useSystemColorScheme.ts
|
|
299
|
-
import { useEffect as
|
|
314
|
+
import { useEffect as useEffect7, useState as useState9 } from "react";
|
|
300
315
|
|
|
301
316
|
// ../noya-react-utils/src/hooks/useUrlHashParameters.ts
|
|
302
317
|
import { decodeQueryParameters } from "@noya-app/noya-utils";
|
|
303
|
-
import { useEffect as
|
|
318
|
+
import { useEffect as useEffect8, useState as useState10 } from "react";
|
|
304
319
|
|
|
305
320
|
// ../emitter/src/index.ts
|
|
306
321
|
var Emitter = class {
|
|
@@ -381,7 +396,7 @@ var ClientStorage = class {
|
|
|
381
396
|
var clientStorage = new ClientStorage();
|
|
382
397
|
|
|
383
398
|
// src/components/ActionMenu.tsx
|
|
384
|
-
import
|
|
399
|
+
import React28, { useMemo as useMemo12 } from "react";
|
|
385
400
|
|
|
386
401
|
// src/theme/index.ts
|
|
387
402
|
import tailwindConfig from "@noya-app/noya-tailwind-config";
|
|
@@ -422,21 +437,21 @@ var INPUT_HEIGHT = 27;
|
|
|
422
437
|
// src/components/DropdownMenu.tsx
|
|
423
438
|
import { useKeyboardShortcuts } from "@noya-app/noya-keymap";
|
|
424
439
|
import * as RadixDropdownMenu from "@radix-ui/react-dropdown-menu";
|
|
425
|
-
import
|
|
440
|
+
import React27, {
|
|
426
441
|
useMemo as useMemo11
|
|
427
442
|
} from "react";
|
|
428
443
|
|
|
429
444
|
// src/contexts/PortalScopeContext.tsx
|
|
430
|
-
import * as
|
|
431
|
-
var PortalScopeContext =
|
|
432
|
-
var PortalScopeProvider =
|
|
445
|
+
import * as React6 from "react";
|
|
446
|
+
var PortalScopeContext = React6.createContext(void 0);
|
|
447
|
+
var PortalScopeProvider = React6.memo(function PortalScopeProvider2({
|
|
433
448
|
children,
|
|
434
449
|
portalScopeId
|
|
435
450
|
}) {
|
|
436
|
-
return /* @__PURE__ */
|
|
451
|
+
return /* @__PURE__ */ React6.createElement(PortalScopeContext.Provider, { value: portalScopeId }, children);
|
|
437
452
|
});
|
|
438
453
|
function usePortalScopeId() {
|
|
439
|
-
return
|
|
454
|
+
return React6.useContext(PortalScopeContext) ?? "";
|
|
440
455
|
}
|
|
441
456
|
var portalScopeDataSetName = "noyaPortalScope";
|
|
442
457
|
var portalScopePropName = `data-noya-portal-scope`;
|
|
@@ -458,21 +473,21 @@ function getClosestPortalScope(element) {
|
|
|
458
473
|
|
|
459
474
|
// src/components/internal/Menu.tsx
|
|
460
475
|
import { getShortcutDisplayParts } from "@noya-app/noya-keymap";
|
|
461
|
-
import
|
|
476
|
+
import React24, { memo as memo10 } from "react";
|
|
462
477
|
|
|
463
478
|
// src/contexts/DesignSystemConfiguration.tsx
|
|
464
479
|
import { getCurrentPlatform } from "@noya-app/noya-keymap";
|
|
465
|
-
import * as
|
|
480
|
+
import * as React23 from "react";
|
|
466
481
|
|
|
467
482
|
// src/components/Toast.tsx
|
|
468
483
|
import * as ToastPrimitive from "@radix-ui/react-toast";
|
|
469
|
-
import
|
|
484
|
+
import React13 from "react";
|
|
470
485
|
|
|
471
486
|
// src/components/IconButton.tsx
|
|
472
|
-
import * as
|
|
487
|
+
import * as React12 from "react";
|
|
473
488
|
|
|
474
489
|
// src/components/Button.tsx
|
|
475
|
-
import
|
|
490
|
+
import React11, {
|
|
476
491
|
forwardRef as forwardRef4,
|
|
477
492
|
useCallback as useCallback10,
|
|
478
493
|
useMemo as useMemo4
|
|
@@ -543,20 +558,20 @@ function mergeConflictingClassNames(classNames, options) {
|
|
|
543
558
|
|
|
544
559
|
// src/components/Icons.tsx
|
|
545
560
|
import * as Icons from "@noya-app/noya-icons";
|
|
546
|
-
import * as
|
|
561
|
+
import * as React7 from "react";
|
|
547
562
|
function renderIcon(iconName) {
|
|
548
563
|
if (typeof iconName === "string") {
|
|
549
564
|
const Icon = Icons[iconName];
|
|
550
|
-
return /* @__PURE__ */
|
|
565
|
+
return /* @__PURE__ */ React7.createElement(Icon, null);
|
|
551
566
|
}
|
|
552
567
|
return iconName;
|
|
553
568
|
}
|
|
554
569
|
|
|
555
570
|
// src/components/Spacer.tsx
|
|
556
|
-
import * as
|
|
557
|
-
var SpacerVertical =
|
|
571
|
+
import * as React8 from "react";
|
|
572
|
+
var SpacerVertical = React8.forwardRef(
|
|
558
573
|
({ size: size2, inline, ...props }, ref) => {
|
|
559
|
-
return /* @__PURE__ */
|
|
574
|
+
return /* @__PURE__ */ React8.createElement(
|
|
560
575
|
"span",
|
|
561
576
|
{
|
|
562
577
|
className: `${inline ? "inline-block" : "block"} ${size2 === void 0 ? "flex flex-1" : ""}`,
|
|
@@ -569,9 +584,9 @@ var SpacerVertical = React7.forwardRef(
|
|
|
569
584
|
);
|
|
570
585
|
}
|
|
571
586
|
);
|
|
572
|
-
var SpacerHorizontal =
|
|
587
|
+
var SpacerHorizontal = React8.forwardRef(
|
|
573
588
|
({ size: size2, inline, ...props }, ref) => {
|
|
574
|
-
return /* @__PURE__ */
|
|
589
|
+
return /* @__PURE__ */ React8.createElement(
|
|
575
590
|
"span",
|
|
576
591
|
{
|
|
577
592
|
className: `${inline ? "inline-block" : "block"} ${size2 === void 0 ? "flex flex-1" : ""}`,
|
|
@@ -592,10 +607,10 @@ var Spacer;
|
|
|
592
607
|
|
|
593
608
|
// src/components/Tooltip.tsx
|
|
594
609
|
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
595
|
-
import * as
|
|
610
|
+
import * as React10 from "react";
|
|
596
611
|
|
|
597
612
|
// src/components/Text.tsx
|
|
598
|
-
import
|
|
613
|
+
import React9, { forwardRef as forwardRef3 } from "react";
|
|
599
614
|
var elements = {
|
|
600
615
|
title: "h1",
|
|
601
616
|
subtitle: "h1",
|
|
@@ -638,7 +653,7 @@ var Text = forwardRef3(function Text2({
|
|
|
638
653
|
...rest
|
|
639
654
|
}, forwardedRef) {
|
|
640
655
|
const Component = as ?? elements[variant] ?? "span";
|
|
641
|
-
return /* @__PURE__ */
|
|
656
|
+
return /* @__PURE__ */ React9.createElement(
|
|
642
657
|
Component,
|
|
643
658
|
{
|
|
644
659
|
ref: forwardedRef,
|
|
@@ -657,27 +672,27 @@ var Text = forwardRef3(function Text2({
|
|
|
657
672
|
);
|
|
658
673
|
});
|
|
659
674
|
var Heading1 = forwardRef3(
|
|
660
|
-
(props, ref) => /* @__PURE__ */
|
|
675
|
+
(props, ref) => /* @__PURE__ */ React9.createElement(Text, { ref, ...props, variant: "heading1" })
|
|
661
676
|
);
|
|
662
677
|
var Heading2 = forwardRef3(
|
|
663
|
-
(props, ref) => /* @__PURE__ */
|
|
678
|
+
(props, ref) => /* @__PURE__ */ React9.createElement(Text, { ref, ...props, variant: "heading2" })
|
|
664
679
|
);
|
|
665
680
|
var Heading3 = forwardRef3(
|
|
666
|
-
(props, ref) => /* @__PURE__ */
|
|
681
|
+
(props, ref) => /* @__PURE__ */ React9.createElement(Text, { ref, ...props, variant: "heading3" })
|
|
667
682
|
);
|
|
668
683
|
var Heading4 = forwardRef3(
|
|
669
|
-
(props, ref) => /* @__PURE__ */
|
|
684
|
+
(props, ref) => /* @__PURE__ */ React9.createElement(Text, { ref, ...props, variant: "heading4" })
|
|
670
685
|
);
|
|
671
686
|
var Heading5 = forwardRef3(
|
|
672
|
-
(props, ref) => /* @__PURE__ */
|
|
687
|
+
(props, ref) => /* @__PURE__ */ React9.createElement(Text, { ref, ...props, variant: "heading5" })
|
|
673
688
|
);
|
|
674
689
|
var Body = forwardRef3(
|
|
675
|
-
(props, ref) => /* @__PURE__ */
|
|
690
|
+
(props, ref) => /* @__PURE__ */ React9.createElement(Text, { ref, ...props, variant: "body" })
|
|
676
691
|
);
|
|
677
692
|
var Small = forwardRef3(
|
|
678
|
-
(props, ref) => /* @__PURE__ */
|
|
693
|
+
(props, ref) => /* @__PURE__ */ React9.createElement(Text, { ref, ...props, variant: "small" })
|
|
679
694
|
);
|
|
680
|
-
var Italic = ({ children }) => /* @__PURE__ */
|
|
695
|
+
var Italic = ({ children }) => /* @__PURE__ */ React9.createElement(
|
|
681
696
|
"span",
|
|
682
697
|
{
|
|
683
698
|
style: {
|
|
@@ -688,13 +703,13 @@ var Italic = ({ children }) => /* @__PURE__ */ React8.createElement(
|
|
|
688
703
|
);
|
|
689
704
|
|
|
690
705
|
// src/components/Tooltip.tsx
|
|
691
|
-
var Tooltip =
|
|
706
|
+
var Tooltip = React10.memo(function Tooltip2({
|
|
692
707
|
children,
|
|
693
708
|
content,
|
|
694
709
|
sideOffset = 2
|
|
695
710
|
}) {
|
|
696
711
|
const portalScopeId = usePortalScopeId();
|
|
697
|
-
return /* @__PURE__ */
|
|
712
|
+
return /* @__PURE__ */ React10.createElement(TooltipPrimitive.Provider, null, /* @__PURE__ */ React10.createElement(TooltipPrimitive.Root, null, /* @__PURE__ */ React10.createElement(TooltipPrimitive.Trigger, { asChild: true }, children), /* @__PURE__ */ React10.createElement(TooltipPrimitive.Portal, null, /* @__PURE__ */ React10.createElement(
|
|
698
713
|
TooltipPrimitive.Content,
|
|
699
714
|
{
|
|
700
715
|
...portalScopeProps(portalScopeId),
|
|
@@ -756,7 +771,7 @@ var Button = forwardRef4(function Button2({
|
|
|
756
771
|
categories: ["position"]
|
|
757
772
|
}) : baseClassName;
|
|
758
773
|
}, [className, baseClassName]);
|
|
759
|
-
const buttonElement = /* @__PURE__ */
|
|
774
|
+
const buttonElement = /* @__PURE__ */ React11.createElement(
|
|
760
775
|
Component,
|
|
761
776
|
{
|
|
762
777
|
ref: forwardedRef,
|
|
@@ -771,35 +786,35 @@ var Button = forwardRef4(function Button2({
|
|
|
771
786
|
}, []),
|
|
772
787
|
...rest
|
|
773
788
|
},
|
|
774
|
-
/* @__PURE__ */
|
|
789
|
+
/* @__PURE__ */ React11.createElement(
|
|
775
790
|
"span",
|
|
776
791
|
{
|
|
777
792
|
className: "min-h-[19px] flex items-center flex-1 justify-center leading-[15px]",
|
|
778
793
|
style: contentStyle
|
|
779
794
|
},
|
|
780
795
|
icon && renderIcon(icon),
|
|
781
|
-
icon && children && /* @__PURE__ */
|
|
796
|
+
icon && children && /* @__PURE__ */ React11.createElement(Spacer.Horizontal, { inline: true, size: 6 }),
|
|
782
797
|
children,
|
|
783
|
-
iconRight && (icon || children) && /* @__PURE__ */
|
|
798
|
+
iconRight && (icon || children) && /* @__PURE__ */ React11.createElement(Spacer.Horizontal, { inline: true, size: 6 }),
|
|
784
799
|
iconRight && renderIcon(iconRight)
|
|
785
800
|
)
|
|
786
801
|
);
|
|
787
|
-
return tooltip ? /* @__PURE__ */
|
|
802
|
+
return tooltip ? /* @__PURE__ */ React11.createElement(Tooltip, { content: tooltip }, buttonElement) : buttonElement;
|
|
788
803
|
});
|
|
789
804
|
var Button_default = Button;
|
|
790
805
|
|
|
791
806
|
// src/components/IconButton.tsx
|
|
792
|
-
var IconButton =
|
|
793
|
-
|
|
807
|
+
var IconButton = React12.memo(
|
|
808
|
+
React12.forwardRef(function IconButton2({ selected, iconName, color, size: size2, contentStyle, ...props }, forwardedRef) {
|
|
794
809
|
const Icon = Icons[iconName];
|
|
795
|
-
const style2 =
|
|
810
|
+
const style2 = React12.useMemo(() => {
|
|
796
811
|
return {
|
|
797
812
|
padding: "0 2px",
|
|
798
813
|
...size2 && { minHeight: size2 },
|
|
799
814
|
...contentStyle
|
|
800
815
|
};
|
|
801
816
|
}, [contentStyle, size2]);
|
|
802
|
-
return /* @__PURE__ */
|
|
817
|
+
return /* @__PURE__ */ React12.createElement(Button, { ref: forwardedRef, ...props, variant: "none", contentStyle: style2 }, /* @__PURE__ */ React12.createElement(
|
|
803
818
|
Icon,
|
|
804
819
|
{
|
|
805
820
|
color: color ?? (selected ? cssVars.colors.iconSelected : cssVars.colors.icon),
|
|
@@ -816,34 +831,34 @@ var Toast = ({
|
|
|
816
831
|
children,
|
|
817
832
|
...props
|
|
818
833
|
}) => {
|
|
819
|
-
return /* @__PURE__ */
|
|
834
|
+
return /* @__PURE__ */ React13.createElement(
|
|
820
835
|
ToastPrimitive.Root,
|
|
821
836
|
{
|
|
822
837
|
className: "px-2 py-2.5 grid grid-cols-[auto_max-content] gap-x-2.5 items-center rounded text-sm bg-popover-background shadow-popover text-text-muted",
|
|
823
838
|
...props
|
|
824
839
|
},
|
|
825
|
-
title && /* @__PURE__ */
|
|
840
|
+
title && /* @__PURE__ */ React13.createElement(
|
|
826
841
|
ToastPrimitive.Title,
|
|
827
842
|
{
|
|
828
843
|
className: `mb-[5px] ${textStyles.label} font-bold text-text`
|
|
829
844
|
},
|
|
830
845
|
title
|
|
831
846
|
),
|
|
832
|
-
/* @__PURE__ */
|
|
847
|
+
/* @__PURE__ */ React13.createElement(
|
|
833
848
|
ToastPrimitive.Description,
|
|
834
849
|
{
|
|
835
850
|
className: `${textStyles.small} text-text-muted`
|
|
836
851
|
},
|
|
837
852
|
content
|
|
838
853
|
),
|
|
839
|
-
children && /* @__PURE__ */
|
|
840
|
-
/* @__PURE__ */
|
|
854
|
+
children && /* @__PURE__ */ React13.createElement(ToastPrimitive.Action, { asChild: true, altText: "" }, children),
|
|
855
|
+
/* @__PURE__ */ React13.createElement(ToastPrimitive.Close, { "aria-label": "Close", asChild: true }, /* @__PURE__ */ React13.createElement(IconButton, { iconName: "Cross1Icon" }))
|
|
841
856
|
);
|
|
842
857
|
};
|
|
843
|
-
var ToastProvider = ({ children }) => /* @__PURE__ */
|
|
858
|
+
var ToastProvider = ({ children }) => /* @__PURE__ */ React13.createElement(ToastPrimitive.Provider, null, children, /* @__PURE__ */ React13.createElement(ToastPrimitive.Viewport, { className: "fixed bottom-0 right-0 flex flex-col p-5 g-2.5 min-w-[200px] max-w-[100vw] m-0 list-none z-[2147483647] outline-none" }));
|
|
844
859
|
|
|
845
860
|
// src/contexts/DialogContext.tsx
|
|
846
|
-
import
|
|
861
|
+
import React21, {
|
|
847
862
|
createContext as createContext5,
|
|
848
863
|
useCallback as useCallback13,
|
|
849
864
|
useContext as useContext5,
|
|
@@ -854,12 +869,12 @@ import React20, {
|
|
|
854
869
|
|
|
855
870
|
// src/components/Dialog.tsx
|
|
856
871
|
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
857
|
-
import
|
|
872
|
+
import React14, {
|
|
858
873
|
forwardRef as forwardRef6,
|
|
859
874
|
useImperativeHandle,
|
|
860
875
|
useRef as useRef9
|
|
861
876
|
} from "react";
|
|
862
|
-
var StyledOverlay = forwardRef6(({ className, ...props }, ref) => /* @__PURE__ */
|
|
877
|
+
var StyledOverlay = forwardRef6(({ className, ...props }, ref) => /* @__PURE__ */ React14.createElement(
|
|
863
878
|
DialogPrimitive.Overlay,
|
|
864
879
|
{
|
|
865
880
|
ref,
|
|
@@ -868,7 +883,7 @@ var StyledOverlay = forwardRef6(({ className, ...props }, ref) => /* @__PURE__ *
|
|
|
868
883
|
}
|
|
869
884
|
));
|
|
870
885
|
var StyledContent = forwardRef6(({ className, children, ...props }, ref) => {
|
|
871
|
-
return /* @__PURE__ */
|
|
886
|
+
return /* @__PURE__ */ React14.createElement(
|
|
872
887
|
DialogPrimitive.Content,
|
|
873
888
|
{
|
|
874
889
|
ref,
|
|
@@ -887,7 +902,7 @@ var StyledContent = forwardRef6(({ className, children, ...props }, ref) => {
|
|
|
887
902
|
children
|
|
888
903
|
);
|
|
889
904
|
});
|
|
890
|
-
var StyledTitle = forwardRef6(({ className, ...props }, ref) => /* @__PURE__ */
|
|
905
|
+
var StyledTitle = forwardRef6(({ className, ...props }, ref) => /* @__PURE__ */ React14.createElement(
|
|
891
906
|
DialogPrimitive.Title,
|
|
892
907
|
{
|
|
893
908
|
ref,
|
|
@@ -898,7 +913,7 @@ var StyledTitle = forwardRef6(({ className, ...props }, ref) => /* @__PURE__ */
|
|
|
898
913
|
...props
|
|
899
914
|
}
|
|
900
915
|
));
|
|
901
|
-
var StyledDescription = forwardRef6(({ className, ...props }, ref) => /* @__PURE__ */
|
|
916
|
+
var StyledDescription = forwardRef6(({ className, ...props }, ref) => /* @__PURE__ */ React14.createElement(
|
|
902
917
|
DialogPrimitive.Description,
|
|
903
918
|
{
|
|
904
919
|
ref,
|
|
@@ -928,7 +943,7 @@ var Dialog = forwardRef6(function Dialog2({
|
|
|
928
943
|
return contentRef.current.contains(element);
|
|
929
944
|
}
|
|
930
945
|
}));
|
|
931
|
-
return /* @__PURE__ */
|
|
946
|
+
return /* @__PURE__ */ React14.createElement(DialogPrimitive.Root, { open, onOpenChange }, /* @__PURE__ */ React14.createElement(StyledOverlay, null), /* @__PURE__ */ React14.createElement(
|
|
932
947
|
StyledContent,
|
|
933
948
|
{
|
|
934
949
|
ref: contentRef,
|
|
@@ -940,7 +955,7 @@ var Dialog = forwardRef6(function Dialog2({
|
|
|
940
955
|
onInteractOutside: (event) => event.preventDefault()
|
|
941
956
|
}
|
|
942
957
|
},
|
|
943
|
-
showCloseButton && /* @__PURE__ */
|
|
958
|
+
showCloseButton && /* @__PURE__ */ React14.createElement(DialogPrimitive.Close, { asChild: true }, /* @__PURE__ */ React14.createElement(
|
|
944
959
|
IconButton,
|
|
945
960
|
{
|
|
946
961
|
iconName: "Cross1Icon",
|
|
@@ -952,13 +967,13 @@ var Dialog = forwardRef6(function Dialog2({
|
|
|
952
967
|
}
|
|
953
968
|
}
|
|
954
969
|
)),
|
|
955
|
-
title && /* @__PURE__ */
|
|
956
|
-
description && /* @__PURE__ */
|
|
970
|
+
title && /* @__PURE__ */ React14.createElement(React14.Fragment, null, /* @__PURE__ */ React14.createElement(StyledTitle, null, title), /* @__PURE__ */ React14.createElement(Spacer.Vertical, { size: description ? 10 : 20 })),
|
|
971
|
+
description && /* @__PURE__ */ React14.createElement(React14.Fragment, null, /* @__PURE__ */ React14.createElement(StyledDescription, null, description), /* @__PURE__ */ React14.createElement(Spacer.Vertical, { size: 20 })),
|
|
957
972
|
children
|
|
958
973
|
));
|
|
959
974
|
});
|
|
960
975
|
var FullscreenDialog = forwardRef6(function FullscreenDialog2({ style: style2, ...rest }, forwardedRef) {
|
|
961
|
-
return /* @__PURE__ */
|
|
976
|
+
return /* @__PURE__ */ React14.createElement(
|
|
962
977
|
Dialog,
|
|
963
978
|
{
|
|
964
979
|
ref: forwardedRef,
|
|
@@ -971,7 +986,7 @@ var FullscreenDialog = forwardRef6(function FullscreenDialog2({ style: style2, .
|
|
|
971
986
|
|
|
972
987
|
// src/components/InputField.tsx
|
|
973
988
|
import { DropdownChevronIcon } from "@noya-app/noya-icons";
|
|
974
|
-
import
|
|
989
|
+
import React20, {
|
|
975
990
|
createContext as createContext4,
|
|
976
991
|
forwardRef as forwardRef9,
|
|
977
992
|
memo as memo8,
|
|
@@ -983,30 +998,30 @@ import React19, {
|
|
|
983
998
|
} from "react";
|
|
984
999
|
|
|
985
1000
|
// src/hooks/useLabel.ts
|
|
986
|
-
import
|
|
987
|
-
var LabelContext =
|
|
1001
|
+
import React15 from "react";
|
|
1002
|
+
var LabelContext = React15.createContext({
|
|
988
1003
|
fieldId: "",
|
|
989
1004
|
label: void 0
|
|
990
1005
|
});
|
|
991
1006
|
var useLabel = ({ label, fieldId }) => {
|
|
992
|
-
const { label: labelFromContext, fieldId: fieldIdFromContext } =
|
|
1007
|
+
const { label: labelFromContext, fieldId: fieldIdFromContext } = React15.useContext(LabelContext);
|
|
993
1008
|
return {
|
|
994
1009
|
label: label ?? labelFromContext,
|
|
995
1010
|
fieldId: fieldId ?? fieldIdFromContext
|
|
996
1011
|
};
|
|
997
1012
|
};
|
|
998
|
-
var LabelPositionContext =
|
|
1013
|
+
var LabelPositionContext = React15.createContext({
|
|
999
1014
|
position: "start"
|
|
1000
1015
|
});
|
|
1001
1016
|
var useLabelPosition = () => {
|
|
1002
|
-
const { position } =
|
|
1017
|
+
const { position } = React15.useContext(LabelPositionContext);
|
|
1003
1018
|
return position;
|
|
1004
1019
|
};
|
|
1005
|
-
var LabelWidthContext =
|
|
1020
|
+
var LabelWidthContext = React15.createContext({
|
|
1006
1021
|
width: 100
|
|
1007
1022
|
});
|
|
1008
1023
|
var useLabelWidth = () => {
|
|
1009
|
-
const { width } =
|
|
1024
|
+
const { width } = React15.useContext(LabelWidthContext);
|
|
1010
1025
|
return width;
|
|
1011
1026
|
};
|
|
1012
1027
|
|
|
@@ -1046,17 +1061,17 @@ var startBaseStyles = "absolute left-1.5 inset-y-0 flex items-center";
|
|
|
1046
1061
|
|
|
1047
1062
|
// src/components/internal/TextInput.tsx
|
|
1048
1063
|
import { composeRefs } from "@radix-ui/react-compose-refs";
|
|
1049
|
-
import
|
|
1064
|
+
import React16, {
|
|
1050
1065
|
forwardRef as forwardRef7,
|
|
1051
1066
|
useCallback as useCallback11,
|
|
1052
|
-
useEffect as
|
|
1053
|
-
useLayoutEffect as
|
|
1067
|
+
useEffect as useEffect10,
|
|
1068
|
+
useLayoutEffect as useLayoutEffect4,
|
|
1054
1069
|
useRef as useRef10,
|
|
1055
1070
|
useState as useState11
|
|
1056
1071
|
} from "react";
|
|
1057
1072
|
|
|
1058
1073
|
// src/contexts/GlobalInputBlurContext.tsx
|
|
1059
|
-
import { createContext as createContext2, useContext as useContext2, useEffect as
|
|
1074
|
+
import { createContext as createContext2, useContext as useContext2, useEffect as useEffect9 } from "react";
|
|
1060
1075
|
var defaultValue = /* @__PURE__ */ (() => {
|
|
1061
1076
|
const listeners = [];
|
|
1062
1077
|
const value = {
|
|
@@ -1083,7 +1098,7 @@ var useGlobalInputBlur = () => {
|
|
|
1083
1098
|
};
|
|
1084
1099
|
function useGlobalInputBlurListener(f) {
|
|
1085
1100
|
const context = useGlobalInputBlur();
|
|
1086
|
-
|
|
1101
|
+
useEffect9(() => {
|
|
1087
1102
|
context.addListener(f);
|
|
1088
1103
|
return () => {
|
|
1089
1104
|
context.removeListener(f);
|
|
@@ -1096,7 +1111,7 @@ function useGlobalInputBlurTrigger() {
|
|
|
1096
1111
|
|
|
1097
1112
|
// src/components/internal/TextInput.tsx
|
|
1098
1113
|
var ReadOnlyTextInput = forwardRef7(function ReadOnlyTextInput2({ onKeyDown, onFocusChange, value, ...rest }, forwardedRef) {
|
|
1099
|
-
return /* @__PURE__ */
|
|
1114
|
+
return /* @__PURE__ */ React16.createElement(
|
|
1100
1115
|
"input",
|
|
1101
1116
|
{
|
|
1102
1117
|
ref: forwardedRef,
|
|
@@ -1139,7 +1154,7 @@ var ControlledTextInput = forwardRef7(function ControlledTextInput2({
|
|
|
1139
1154
|
},
|
|
1140
1155
|
[onFocus, onFocusChange]
|
|
1141
1156
|
);
|
|
1142
|
-
return /* @__PURE__ */
|
|
1157
|
+
return /* @__PURE__ */ React16.createElement(
|
|
1143
1158
|
"input",
|
|
1144
1159
|
{
|
|
1145
1160
|
ref: forwardedRef,
|
|
@@ -1168,13 +1183,13 @@ var SubmittableTextInput = forwardRef7(function SubmittableTextInput2({
|
|
|
1168
1183
|
submitOnBlur = true,
|
|
1169
1184
|
...rest
|
|
1170
1185
|
}, forwardedRef) {
|
|
1171
|
-
const ref =
|
|
1186
|
+
const ref = React16.useRef(null);
|
|
1172
1187
|
const latestValue = useRef10(value);
|
|
1173
1188
|
latestValue.current = value;
|
|
1174
1189
|
const userDidEdit = useRef10(false);
|
|
1175
1190
|
const isSubmitTriggeredByEscapeKey = useRef10(false);
|
|
1176
1191
|
const [internalValue, setInternalValue] = useState11("");
|
|
1177
|
-
|
|
1192
|
+
useLayoutEffect4(() => {
|
|
1178
1193
|
setInternalValue(value);
|
|
1179
1194
|
}, [value]);
|
|
1180
1195
|
const handleSubmit = useCallback11(() => {
|
|
@@ -1235,7 +1250,7 @@ var SubmittableTextInput = forwardRef7(function SubmittableTextInput2({
|
|
|
1235
1250
|
);
|
|
1236
1251
|
const latestHandleSubmit = useRef10(handleSubmit);
|
|
1237
1252
|
latestHandleSubmit.current = handleSubmit;
|
|
1238
|
-
|
|
1253
|
+
useEffect10(() => {
|
|
1239
1254
|
if (submitAutomaticallyAfterDelay) {
|
|
1240
1255
|
if (autoSubmitTimeoutRef.current) {
|
|
1241
1256
|
clearTimeout(autoSubmitTimeoutRef.current);
|
|
@@ -1251,7 +1266,7 @@ var SubmittableTextInput = forwardRef7(function SubmittableTextInput2({
|
|
|
1251
1266
|
}
|
|
1252
1267
|
};
|
|
1253
1268
|
}, [internalValue, submitAutomaticallyAfterDelay]);
|
|
1254
|
-
return /* @__PURE__ */
|
|
1269
|
+
return /* @__PURE__ */ React16.createElement(
|
|
1255
1270
|
"input",
|
|
1256
1271
|
{
|
|
1257
1272
|
ref: composeRefs(ref, forwardedRef),
|
|
@@ -1283,21 +1298,21 @@ var TextInput_default = forwardRef7(function TextInput(props, forwardedRef) {
|
|
|
1283
1298
|
...props
|
|
1284
1299
|
};
|
|
1285
1300
|
if ("readOnly" in commonProps) {
|
|
1286
|
-
return /* @__PURE__ */
|
|
1301
|
+
return /* @__PURE__ */ React16.createElement(ReadOnlyTextInput, { ref: forwardedRef, ...commonProps, readOnly: true });
|
|
1287
1302
|
} else if ("onChange" in commonProps) {
|
|
1288
|
-
return /* @__PURE__ */
|
|
1303
|
+
return /* @__PURE__ */ React16.createElement(ControlledTextInput, { ref: forwardedRef, ...commonProps });
|
|
1289
1304
|
} else {
|
|
1290
|
-
return /* @__PURE__ */
|
|
1305
|
+
return /* @__PURE__ */ React16.createElement(SubmittableTextInput, { ref: forwardedRef, ...commonProps });
|
|
1291
1306
|
}
|
|
1292
1307
|
});
|
|
1293
1308
|
|
|
1294
1309
|
// src/components/Label.tsx
|
|
1295
|
-
import
|
|
1310
|
+
import React17, { forwardRef as forwardRef8, memo as memo6 } from "react";
|
|
1296
1311
|
var labelStyles = "flex items-center select-none z-label relative";
|
|
1297
1312
|
var labelTextStyles = "font-sans text-label uppercase leading-3 font-bold text-text-muted";
|
|
1298
1313
|
var Label = memo6(
|
|
1299
1314
|
forwardRef8(function Label2({ className, children, ...props }, ref) {
|
|
1300
|
-
return /* @__PURE__ */
|
|
1315
|
+
return /* @__PURE__ */ React17.createElement(
|
|
1301
1316
|
"label",
|
|
1302
1317
|
{
|
|
1303
1318
|
ref,
|
|
@@ -1321,28 +1336,28 @@ var Label = memo6(
|
|
|
1321
1336
|
|
|
1322
1337
|
// src/components/Popover.tsx
|
|
1323
1338
|
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
1324
|
-
import
|
|
1339
|
+
import React19, { useEffect as useEffect11, useId, useRef as useRef11 } from "react";
|
|
1325
1340
|
|
|
1326
1341
|
// src/contexts/OpenPortalsContext.tsx
|
|
1327
|
-
import * as
|
|
1328
|
-
var OpenPortalsContext =
|
|
1342
|
+
import * as React18 from "react";
|
|
1343
|
+
var OpenPortalsContext = React18.createContext({
|
|
1329
1344
|
hasOpenPortals: false
|
|
1330
1345
|
});
|
|
1331
|
-
var OpenPortalControlsContext =
|
|
1346
|
+
var OpenPortalControlsContext = React18.createContext({
|
|
1332
1347
|
addOpenPortal: () => {
|
|
1333
1348
|
},
|
|
1334
1349
|
removeOpenPortal: () => {
|
|
1335
1350
|
}
|
|
1336
1351
|
});
|
|
1337
|
-
var OpenPortalsProvider =
|
|
1352
|
+
var OpenPortalsProvider = React18.memo(function OpenPortalsProvider2({
|
|
1338
1353
|
children
|
|
1339
1354
|
}) {
|
|
1340
|
-
const [openPortals, setOpenPortals] =
|
|
1341
|
-
const value =
|
|
1355
|
+
const [openPortals, setOpenPortals] = React18.useState([]);
|
|
1356
|
+
const value = React18.useMemo(
|
|
1342
1357
|
() => ({ hasOpenPortals: openPortals.length > 0 }),
|
|
1343
1358
|
[openPortals]
|
|
1344
1359
|
);
|
|
1345
|
-
const controlsValue =
|
|
1360
|
+
const controlsValue = React18.useMemo(
|
|
1346
1361
|
() => ({
|
|
1347
1362
|
addOpenPortal: (portal) => {
|
|
1348
1363
|
setOpenPortals((prev) => [...prev, portal]);
|
|
@@ -1353,13 +1368,13 @@ var OpenPortalsProvider = React17.memo(function OpenPortalsProvider2({
|
|
|
1353
1368
|
}),
|
|
1354
1369
|
[]
|
|
1355
1370
|
);
|
|
1356
|
-
return /* @__PURE__ */
|
|
1371
|
+
return /* @__PURE__ */ React18.createElement(OpenPortalsContext.Provider, { value }, /* @__PURE__ */ React18.createElement(OpenPortalControlsContext.Provider, { value: controlsValue }, children));
|
|
1357
1372
|
});
|
|
1358
1373
|
function useHasOpenPortals() {
|
|
1359
|
-
return
|
|
1374
|
+
return React18.useContext(OpenPortalsContext).hasOpenPortals;
|
|
1360
1375
|
}
|
|
1361
1376
|
function useOpenPortalsControls() {
|
|
1362
|
-
return
|
|
1377
|
+
return React18.useContext(OpenPortalControlsContext);
|
|
1363
1378
|
}
|
|
1364
1379
|
|
|
1365
1380
|
// src/components/Popover.tsx
|
|
@@ -1400,14 +1415,14 @@ function Popover({
|
|
|
1400
1415
|
defaultValue: false
|
|
1401
1416
|
});
|
|
1402
1417
|
const { addOpenPortal, removeOpenPortal } = useOpenPortalsControls();
|
|
1403
|
-
|
|
1418
|
+
useEffect11(() => {
|
|
1404
1419
|
if (!isOpen) return;
|
|
1405
1420
|
addOpenPortal(portalScopeId || defaultId);
|
|
1406
1421
|
return () => {
|
|
1407
1422
|
removeOpenPortal(portalScopeId || defaultId);
|
|
1408
1423
|
};
|
|
1409
1424
|
}, [addOpenPortal, isOpen, portalScopeId, removeOpenPortal, defaultId]);
|
|
1410
|
-
return /* @__PURE__ */
|
|
1425
|
+
return /* @__PURE__ */ React19.createElement(PopoverPrimitive.Root, { open: isOpen, onOpenChange: setIsOpen }, /* @__PURE__ */ React19.createElement(PopoverPrimitive.Trigger, { asChild: true }, trigger), /* @__PURE__ */ React19.createElement(PopoverPrimitive.Portal, { container: portalContainer }, /* @__PURE__ */ React19.createElement(
|
|
1411
1426
|
PopoverPrimitive.Content,
|
|
1412
1427
|
{
|
|
1413
1428
|
...portalScopeProps(portalScopeId),
|
|
@@ -1438,14 +1453,14 @@ function Popover({
|
|
|
1438
1453
|
arrowPadding: 2
|
|
1439
1454
|
},
|
|
1440
1455
|
children,
|
|
1441
|
-
showArrow && /* @__PURE__ */
|
|
1442
|
-
closable && /* @__PURE__ */
|
|
1456
|
+
showArrow && /* @__PURE__ */ React19.createElement(PopoverPrimitive.Arrow, { className: "fill-popover-background" }),
|
|
1457
|
+
closable && /* @__PURE__ */ React19.createElement(
|
|
1443
1458
|
PopoverPrimitive.Close,
|
|
1444
1459
|
{
|
|
1445
1460
|
className: "rounded-full h-[25px] w-[25px] inline-flex items-center justify-center absolute top-[5px] right-[5px]",
|
|
1446
1461
|
style: closeStyles
|
|
1447
1462
|
},
|
|
1448
|
-
/* @__PURE__ */
|
|
1463
|
+
/* @__PURE__ */ React19.createElement(IconButton, { iconName: "Cross2Icon", onClick: onClickClose })
|
|
1449
1464
|
)
|
|
1450
1465
|
)));
|
|
1451
1466
|
}
|
|
@@ -1475,7 +1490,7 @@ var InputFieldContext = createContext4({
|
|
|
1475
1490
|
endRef: null
|
|
1476
1491
|
});
|
|
1477
1492
|
var useInputFieldContext = () => useContext4(InputFieldContext);
|
|
1478
|
-
var
|
|
1493
|
+
var noop3 = () => {
|
|
1479
1494
|
};
|
|
1480
1495
|
var getFieldSpacing = ({
|
|
1481
1496
|
endWidth = 0,
|
|
@@ -1486,7 +1501,7 @@ var getFieldSpacing = ({
|
|
|
1486
1501
|
paddingRight: `${variant === "bare" ? endWidth : endWidth ? endWidth + 12 : 6}px`
|
|
1487
1502
|
});
|
|
1488
1503
|
var InputFieldDropdownMenu = memoGeneric(function InputFieldDropdownMenu2({ id, items, onSelect, children }) {
|
|
1489
|
-
return /* @__PURE__ */
|
|
1504
|
+
return /* @__PURE__ */ React20.createElement(
|
|
1490
1505
|
DropdownMenu,
|
|
1491
1506
|
{
|
|
1492
1507
|
items,
|
|
@@ -1494,7 +1509,7 @@ var InputFieldDropdownMenu = memoGeneric(function InputFieldDropdownMenu2({ id,
|
|
|
1494
1509
|
align: "end",
|
|
1495
1510
|
sideOffset: 8
|
|
1496
1511
|
},
|
|
1497
|
-
children || /* @__PURE__ */
|
|
1512
|
+
children || /* @__PURE__ */ React20.createElement(InputFieldButton, { variant: "floating", id }, /* @__PURE__ */ React20.createElement(DropdownChevronIcon, null))
|
|
1498
1513
|
);
|
|
1499
1514
|
});
|
|
1500
1515
|
var InputFieldButton = memo8(
|
|
@@ -1537,7 +1552,7 @@ var InputFieldButton = memo8(
|
|
|
1537
1552
|
}),
|
|
1538
1553
|
[style2, variant]
|
|
1539
1554
|
);
|
|
1540
|
-
return /* @__PURE__ */
|
|
1555
|
+
return /* @__PURE__ */ React20.createElement(
|
|
1541
1556
|
Button,
|
|
1542
1557
|
{
|
|
1543
1558
|
as,
|
|
@@ -1594,7 +1609,7 @@ var InputElement = forwardRef9(
|
|
|
1594
1609
|
[inputClassName]
|
|
1595
1610
|
);
|
|
1596
1611
|
if (as === "span") {
|
|
1597
|
-
return /* @__PURE__ */
|
|
1612
|
+
return /* @__PURE__ */ React20.createElement(
|
|
1598
1613
|
"span",
|
|
1599
1614
|
{
|
|
1600
1615
|
ref,
|
|
@@ -1605,7 +1620,7 @@ var InputElement = forwardRef9(
|
|
|
1605
1620
|
children
|
|
1606
1621
|
);
|
|
1607
1622
|
}
|
|
1608
|
-
return /* @__PURE__ */
|
|
1623
|
+
return /* @__PURE__ */ React20.createElement(
|
|
1609
1624
|
TextInput_default,
|
|
1610
1625
|
{
|
|
1611
1626
|
ref,
|
|
@@ -1629,7 +1644,7 @@ var InputFieldInput = forwardRef9(function InputFieldInput2({ textAlign, variant
|
|
|
1629
1644
|
},
|
|
1630
1645
|
[onFocusChange]
|
|
1631
1646
|
);
|
|
1632
|
-
return /* @__PURE__ */
|
|
1647
|
+
return /* @__PURE__ */ React20.createElement(
|
|
1633
1648
|
InputElement,
|
|
1634
1649
|
{
|
|
1635
1650
|
ref,
|
|
@@ -1641,7 +1656,7 @@ var InputFieldInput = forwardRef9(function InputFieldInput2({ textAlign, variant
|
|
|
1641
1656
|
);
|
|
1642
1657
|
});
|
|
1643
1658
|
var InputFieldTypeahead = (props) => {
|
|
1644
|
-
return /* @__PURE__ */
|
|
1659
|
+
return /* @__PURE__ */ React20.createElement(
|
|
1645
1660
|
InputElement,
|
|
1646
1661
|
{
|
|
1647
1662
|
as: "span",
|
|
@@ -1659,8 +1674,8 @@ var InputFieldTypeahead = (props) => {
|
|
|
1659
1674
|
[]
|
|
1660
1675
|
)
|
|
1661
1676
|
},
|
|
1662
|
-
/* @__PURE__ */
|
|
1663
|
-
props.isFocused && /* @__PURE__ */
|
|
1677
|
+
/* @__PURE__ */ React20.createElement("span", { style: { opacity: 0 } }, props.prefix),
|
|
1678
|
+
props.isFocused && /* @__PURE__ */ React20.createElement("span", { style: { opacity: 0.5 } }, props.value.slice(props.prefix.length))
|
|
1664
1679
|
);
|
|
1665
1680
|
};
|
|
1666
1681
|
function parseNumber(value) {
|
|
@@ -1716,7 +1731,7 @@ function InputFieldNumberInput(props) {
|
|
|
1716
1731
|
},
|
|
1717
1732
|
[onBlur]
|
|
1718
1733
|
);
|
|
1719
|
-
return /* @__PURE__ */
|
|
1734
|
+
return /* @__PURE__ */ React20.createElement(
|
|
1720
1735
|
InputFieldInput,
|
|
1721
1736
|
{
|
|
1722
1737
|
...rest,
|
|
@@ -1725,11 +1740,11 @@ function InputFieldNumberInput(props) {
|
|
|
1725
1740
|
onKeyDown: !readOnly ? handleKeyDown : void 0,
|
|
1726
1741
|
onBlur: handleBlur,
|
|
1727
1742
|
...readOnly ? { readOnly: true } : {},
|
|
1728
|
-
..."onChange" in props ? { onChange: readOnly ?
|
|
1743
|
+
..."onChange" in props ? { onChange: readOnly ? noop3 : handleChange } : { onSubmit: readOnly ? noop3 : handleSubmit }
|
|
1729
1744
|
}
|
|
1730
1745
|
);
|
|
1731
1746
|
}
|
|
1732
|
-
var RootContainer = forwardRef9(({ $width, className, ...props }, ref) => /* @__PURE__ */
|
|
1747
|
+
var RootContainer = forwardRef9(({ $width, className, ...props }, ref) => /* @__PURE__ */ React20.createElement(
|
|
1733
1748
|
"div",
|
|
1734
1749
|
{
|
|
1735
1750
|
ref,
|
|
@@ -1760,10 +1775,10 @@ function InputFieldRoot({
|
|
|
1760
1775
|
label: labelProp
|
|
1761
1776
|
}) {
|
|
1762
1777
|
const randomId = useId2();
|
|
1763
|
-
const [isFocused, setIsFocused] =
|
|
1764
|
-
const startRef =
|
|
1765
|
-
const inputRef =
|
|
1766
|
-
const endRef =
|
|
1778
|
+
const [isFocused, setIsFocused] = React20.useState(false);
|
|
1779
|
+
const startRef = React20.useRef(null);
|
|
1780
|
+
const inputRef = React20.useRef(null);
|
|
1781
|
+
const endRef = React20.useRef(null);
|
|
1767
1782
|
const measuredInputSize = useSize(inputRef, "width");
|
|
1768
1783
|
const measuredStartSize = useSize(startRef, "width");
|
|
1769
1784
|
const measuredEndSize = useSize(endRef, "width");
|
|
@@ -1794,10 +1809,10 @@ function InputFieldRoot({
|
|
|
1794
1809
|
[startWidth, endWidth, size2, isFocused, handleFocusChange, id, randomId]
|
|
1795
1810
|
);
|
|
1796
1811
|
const insetLabel = useMemo7(
|
|
1797
|
-
() => /* @__PURE__ */
|
|
1812
|
+
() => /* @__PURE__ */ React20.createElement(Label, { htmlFor: id, className: "!text-text-disabled" }, labelProp ?? label),
|
|
1798
1813
|
[id, labelProp, label]
|
|
1799
1814
|
);
|
|
1800
|
-
const rootElement = /* @__PURE__ */
|
|
1815
|
+
const rootElement = /* @__PURE__ */ React20.createElement(RootContainer, { $width: width, style: style2, className }, children, start && /* @__PURE__ */ React20.createElement("span", { ref: startRef, className: cx(startBaseStyles, startClassName) }, start), (end || label) && /* @__PURE__ */ React20.createElement(
|
|
1801
1816
|
"span",
|
|
1802
1817
|
{
|
|
1803
1818
|
ref: endRef,
|
|
@@ -1810,7 +1825,7 @@ function InputFieldRoot({
|
|
|
1810
1825
|
() => measuredInputSize ? { width: measuredInputSize.width + 4 } : void 0,
|
|
1811
1826
|
[measuredInputSize]
|
|
1812
1827
|
);
|
|
1813
|
-
return /* @__PURE__ */
|
|
1828
|
+
return /* @__PURE__ */ React20.createElement(InputFieldContext.Provider, { value: contextValue }, renderPopoverContent ? /* @__PURE__ */ React20.createElement(
|
|
1814
1829
|
Popover,
|
|
1815
1830
|
{
|
|
1816
1831
|
open: true,
|
|
@@ -1826,7 +1841,7 @@ function InputFieldRoot({
|
|
|
1826
1841
|
event.stopPropagation();
|
|
1827
1842
|
}
|
|
1828
1843
|
},
|
|
1829
|
-
measuredWidthObject && /* @__PURE__ */
|
|
1844
|
+
measuredWidthObject && /* @__PURE__ */ React20.createElement(
|
|
1830
1845
|
"div",
|
|
1831
1846
|
{
|
|
1832
1847
|
className: "flex flex-col overflow-hidden",
|
|
@@ -1851,7 +1866,7 @@ var PrimitiveInputField = ({
|
|
|
1851
1866
|
() => ({ ...spacingStyles, ...style2 }),
|
|
1852
1867
|
[spacingStyles, style2]
|
|
1853
1868
|
);
|
|
1854
|
-
return /* @__PURE__ */
|
|
1869
|
+
return /* @__PURE__ */ React20.createElement(
|
|
1855
1870
|
"input",
|
|
1856
1871
|
{
|
|
1857
1872
|
style: memoizedStyles,
|
|
@@ -1892,7 +1907,7 @@ var InputFieldComponent = forwardRef9(
|
|
|
1892
1907
|
className,
|
|
1893
1908
|
...inputProps
|
|
1894
1909
|
} = props;
|
|
1895
|
-
return /* @__PURE__ */
|
|
1910
|
+
return /* @__PURE__ */ React20.createElement(
|
|
1896
1911
|
InputFieldSubcomponents.Root,
|
|
1897
1912
|
{
|
|
1898
1913
|
width,
|
|
@@ -1908,7 +1923,7 @@ var InputFieldComponent = forwardRef9(
|
|
|
1908
1923
|
style: style2,
|
|
1909
1924
|
className
|
|
1910
1925
|
},
|
|
1911
|
-
/* @__PURE__ */
|
|
1926
|
+
/* @__PURE__ */ React20.createElement(InputFieldSubcomponents.Input, { ref, ...inputProps }),
|
|
1912
1927
|
children
|
|
1913
1928
|
);
|
|
1914
1929
|
}
|
|
@@ -2029,7 +2044,7 @@ var DialogProvider = function DialogProvider2({
|
|
|
2029
2044
|
if (!dialogRef.current) return false;
|
|
2030
2045
|
return dialogRef.current.containsElement(element);
|
|
2031
2046
|
}, []);
|
|
2032
|
-
return /* @__PURE__ */
|
|
2047
|
+
return /* @__PURE__ */ React21.createElement(React21.Fragment, null, /* @__PURE__ */ React21.createElement(
|
|
2033
2048
|
DialogContext.Provider,
|
|
2034
2049
|
{
|
|
2035
2050
|
value: useMemo8(
|
|
@@ -2043,7 +2058,7 @@ var DialogProvider = function DialogProvider2({
|
|
|
2043
2058
|
)
|
|
2044
2059
|
},
|
|
2045
2060
|
children
|
|
2046
|
-
), /* @__PURE__ */
|
|
2061
|
+
), /* @__PURE__ */ React21.createElement(
|
|
2047
2062
|
Dialog,
|
|
2048
2063
|
{
|
|
2049
2064
|
ref: dialogRef,
|
|
@@ -2074,7 +2089,7 @@ var DialogProvider = function DialogProvider2({
|
|
|
2074
2089
|
[contents]
|
|
2075
2090
|
)
|
|
2076
2091
|
},
|
|
2077
|
-
contents?.type === "confirmation" ? /* @__PURE__ */
|
|
2092
|
+
contents?.type === "confirmation" ? /* @__PURE__ */ React21.createElement("div", { className: "flex flex-1 flex-row items-center" }, /* @__PURE__ */ React21.createElement(Spacer.Horizontal, null), /* @__PURE__ */ React21.createElement(
|
|
2078
2093
|
Button,
|
|
2079
2094
|
{
|
|
2080
2095
|
onClick: () => {
|
|
@@ -2083,7 +2098,7 @@ var DialogProvider = function DialogProvider2({
|
|
|
2083
2098
|
}
|
|
2084
2099
|
},
|
|
2085
2100
|
contents.cancelButtonLabel ?? "Cancel"
|
|
2086
|
-
), /* @__PURE__ */
|
|
2101
|
+
), /* @__PURE__ */ React21.createElement(Spacer.Horizontal, { size: 16 }), /* @__PURE__ */ React21.createElement(
|
|
2087
2102
|
Button,
|
|
2088
2103
|
{
|
|
2089
2104
|
onClick: () => {
|
|
@@ -2092,7 +2107,7 @@ var DialogProvider = function DialogProvider2({
|
|
|
2092
2107
|
}
|
|
2093
2108
|
},
|
|
2094
2109
|
contents.confirmButtonLabel ?? "OK"
|
|
2095
|
-
)) : contents?.type === "custom" ? /* @__PURE__ */
|
|
2110
|
+
)) : contents?.type === "custom" ? /* @__PURE__ */ React21.createElement(React21.Fragment, null, contents.children) : /* @__PURE__ */ React21.createElement(React21.Fragment, null, /* @__PURE__ */ React21.createElement(InputField2.Root, null, /* @__PURE__ */ React21.createElement(
|
|
2096
2111
|
InputField2.Input,
|
|
2097
2112
|
{
|
|
2098
2113
|
ref: inputRef,
|
|
@@ -2108,7 +2123,7 @@ var DialogProvider = function DialogProvider2({
|
|
|
2108
2123
|
},
|
|
2109
2124
|
onKeyDown: handleKeyDown
|
|
2110
2125
|
}
|
|
2111
|
-
)), /* @__PURE__ */
|
|
2126
|
+
)), /* @__PURE__ */ React21.createElement(Spacer.Vertical, { size: 20 }), /* @__PURE__ */ React21.createElement("div", { className: "flex flex-1 flex-row items-center" }, /* @__PURE__ */ React21.createElement(Spacer.Horizontal, null), /* @__PURE__ */ React21.createElement(Button, { onClick: close }, "Cancel"), /* @__PURE__ */ React21.createElement(Spacer.Horizontal, { size: 16 }), /* @__PURE__ */ React21.createElement(
|
|
2112
2127
|
Button,
|
|
2113
2128
|
{
|
|
2114
2129
|
disabled: !contents || contents.type !== "input" || !contents.inputValue,
|
|
@@ -2140,7 +2155,7 @@ function useOpenDialog() {
|
|
|
2140
2155
|
|
|
2141
2156
|
// src/contexts/FloatingWindowContext.tsx
|
|
2142
2157
|
import { uuid } from "@noya-app/noya-utils";
|
|
2143
|
-
import
|
|
2158
|
+
import React22, { createContext as createContext6, useContext as useContext6, useMemo as useMemo9, useState as useState15 } from "react";
|
|
2144
2159
|
import { createPortal } from "react-dom";
|
|
2145
2160
|
var FloatingWindowContext = createContext6(void 0);
|
|
2146
2161
|
var CurrentWindowContext = createContext6(void 0);
|
|
@@ -2153,7 +2168,7 @@ var FloatingWindowProvider = ({
|
|
|
2153
2168
|
const id = uuid();
|
|
2154
2169
|
setWindows((windows2) => ({
|
|
2155
2170
|
...windows2,
|
|
2156
|
-
[id]: /* @__PURE__ */
|
|
2171
|
+
[id]: /* @__PURE__ */ React22.createElement(CurrentWindowContext.Provider, { value: { id } }, element)
|
|
2157
2172
|
}));
|
|
2158
2173
|
return id;
|
|
2159
2174
|
};
|
|
@@ -2165,7 +2180,7 @@ var FloatingWindowProvider = ({
|
|
|
2165
2180
|
};
|
|
2166
2181
|
return { createWindow, closeWindow };
|
|
2167
2182
|
}, []);
|
|
2168
|
-
return /* @__PURE__ */
|
|
2183
|
+
return /* @__PURE__ */ React22.createElement(FloatingWindowContext.Provider, { value: contextValue }, children, Object.entries(windows).map(
|
|
2169
2184
|
([id, element]) => createPortal(element, document.body, id)
|
|
2170
2185
|
));
|
|
2171
2186
|
};
|
|
@@ -2187,30 +2202,30 @@ var useCurrentFloatingWindowInternal = () => {
|
|
|
2187
2202
|
};
|
|
2188
2203
|
|
|
2189
2204
|
// src/contexts/DesignSystemConfiguration.tsx
|
|
2190
|
-
var DesignSystemConfigurationContext =
|
|
2205
|
+
var DesignSystemConfigurationContext = React23.createContext({
|
|
2191
2206
|
platform: "key"
|
|
2192
2207
|
});
|
|
2193
|
-
var DesignSystemConfigurationProvider =
|
|
2208
|
+
var DesignSystemConfigurationProvider = React23.memo(
|
|
2194
2209
|
function DesignSystemConfigurationProvider2({
|
|
2195
2210
|
children,
|
|
2196
2211
|
platform
|
|
2197
2212
|
}) {
|
|
2198
|
-
const [internalPlatform, setInternalPlatform] =
|
|
2199
|
-
|
|
2213
|
+
const [internalPlatform, setInternalPlatform] = React23.useState(platform ?? "key");
|
|
2214
|
+
React23.useEffect(() => {
|
|
2200
2215
|
if (platform !== void 0) return;
|
|
2201
2216
|
if (typeof navigator !== "undefined") {
|
|
2202
2217
|
setInternalPlatform(getCurrentPlatform(navigator));
|
|
2203
2218
|
}
|
|
2204
2219
|
}, [platform]);
|
|
2205
|
-
const contextValue =
|
|
2220
|
+
const contextValue = React23.useMemo(
|
|
2206
2221
|
() => ({ platform: platform ?? internalPlatform }),
|
|
2207
2222
|
[platform, internalPlatform]
|
|
2208
2223
|
);
|
|
2209
|
-
return /* @__PURE__ */
|
|
2224
|
+
return /* @__PURE__ */ React23.createElement(DesignSystemConfigurationContext.Provider, { value: contextValue }, /* @__PURE__ */ React23.createElement(OpenPortalsProvider, null, /* @__PURE__ */ React23.createElement(DialogProvider, null, /* @__PURE__ */ React23.createElement(ToastProvider, null, /* @__PURE__ */ React23.createElement(FloatingWindowProvider, null, children)))));
|
|
2210
2225
|
}
|
|
2211
2226
|
);
|
|
2212
2227
|
function useDesignSystemConfiguration() {
|
|
2213
|
-
return
|
|
2228
|
+
return React23.useContext(DesignSystemConfigurationContext);
|
|
2214
2229
|
}
|
|
2215
2230
|
|
|
2216
2231
|
// src/utils/withSeparatorElements.ts
|
|
@@ -2307,7 +2322,7 @@ function getKeyboardShortcutsForMenuItems(menuItems, onSelect) {
|
|
|
2307
2322
|
var ShortcutElement = ({
|
|
2308
2323
|
children,
|
|
2309
2324
|
fixedWidth
|
|
2310
|
-
}) => /* @__PURE__ */
|
|
2325
|
+
}) => /* @__PURE__ */ React24.createElement(
|
|
2311
2326
|
"kbd",
|
|
2312
2327
|
{
|
|
2313
2328
|
className: cx(
|
|
@@ -2323,7 +2338,7 @@ var KeyboardShortcut = memo10(function KeyboardShortcut2({
|
|
|
2323
2338
|
}) {
|
|
2324
2339
|
const platform = useDesignSystemConfiguration().platform;
|
|
2325
2340
|
const { keys, separator: separator2 } = getShortcutDisplayParts(shortcut, platform);
|
|
2326
|
-
const keyElements = keys.map((key) => /* @__PURE__ */
|
|
2341
|
+
const keyElements = keys.map((key) => /* @__PURE__ */ React24.createElement(
|
|
2327
2342
|
ShortcutElement,
|
|
2328
2343
|
{
|
|
2329
2344
|
key,
|
|
@@ -2331,9 +2346,9 @@ var KeyboardShortcut = memo10(function KeyboardShortcut2({
|
|
|
2331
2346
|
},
|
|
2332
2347
|
key
|
|
2333
2348
|
));
|
|
2334
|
-
return /* @__PURE__ */
|
|
2349
|
+
return /* @__PURE__ */ React24.createElement(React24.Fragment, null, separator2 ? withSeparatorElements(
|
|
2335
2350
|
keyElements,
|
|
2336
|
-
/* @__PURE__ */
|
|
2351
|
+
/* @__PURE__ */ React24.createElement(ShortcutElement, null, separator2)
|
|
2337
2352
|
) : keyElements);
|
|
2338
2353
|
});
|
|
2339
2354
|
var SectionHeader = memo10(function SectionHeader2({
|
|
@@ -2343,7 +2358,7 @@ var SectionHeader = memo10(function SectionHeader2({
|
|
|
2343
2358
|
isFirst,
|
|
2344
2359
|
indented
|
|
2345
2360
|
}) {
|
|
2346
|
-
return /* @__PURE__ */
|
|
2361
|
+
return /* @__PURE__ */ React24.createElement(
|
|
2347
2362
|
"span",
|
|
2348
2363
|
{
|
|
2349
2364
|
id,
|
|
@@ -2358,7 +2373,7 @@ var SectionHeader = memo10(function SectionHeader2({
|
|
|
2358
2373
|
}
|
|
2359
2374
|
)
|
|
2360
2375
|
},
|
|
2361
|
-
indented && /* @__PURE__ */
|
|
2376
|
+
indented && /* @__PURE__ */ React24.createElement(
|
|
2362
2377
|
Spacer.Horizontal,
|
|
2363
2378
|
{
|
|
2364
2379
|
size: CHECKBOX_WIDTH - CHECKBOX_RIGHT_INSET + CHECKBOX_INDENT_WIDTH
|
|
@@ -2370,11 +2385,11 @@ var SectionHeader = memo10(function SectionHeader2({
|
|
|
2370
2385
|
|
|
2371
2386
|
// src/components/internal/MenuViewport.tsx
|
|
2372
2387
|
import { ChevronRightIcon } from "@noya-app/noya-icons";
|
|
2373
|
-
import
|
|
2388
|
+
import React26 from "react";
|
|
2374
2389
|
|
|
2375
2390
|
// src/components/internal/SelectItem.tsx
|
|
2376
|
-
import
|
|
2377
|
-
var SelectItem =
|
|
2391
|
+
import React25, { useCallback as useCallback14 } from "react";
|
|
2392
|
+
var SelectItem = React25.forwardRef(
|
|
2378
2393
|
({
|
|
2379
2394
|
children,
|
|
2380
2395
|
icon,
|
|
@@ -2399,7 +2414,7 @@ var SelectItem = React24.forwardRef(
|
|
|
2399
2414
|
[]
|
|
2400
2415
|
);
|
|
2401
2416
|
if (checked && Components4.CheckboxItem) {
|
|
2402
|
-
return /* @__PURE__ */
|
|
2417
|
+
return /* @__PURE__ */ React25.createElement("div", { className: "px-1" }, /* @__PURE__ */ React25.createElement(
|
|
2403
2418
|
Components4.CheckboxItem,
|
|
2404
2419
|
{
|
|
2405
2420
|
checked,
|
|
@@ -2411,14 +2426,14 @@ var SelectItem = React24.forwardRef(
|
|
|
2411
2426
|
testSelected && styles.testSelectedItemStyle
|
|
2412
2427
|
)
|
|
2413
2428
|
},
|
|
2414
|
-
/* @__PURE__ */
|
|
2415
|
-
Components4.ItemIndicator && /* @__PURE__ */
|
|
2416
|
-
icon && /* @__PURE__ */
|
|
2429
|
+
/* @__PURE__ */ React25.createElement(Spacer.Horizontal, { size: CHECKBOX_INDENT_WIDTH }),
|
|
2430
|
+
Components4.ItemIndicator && /* @__PURE__ */ React25.createElement(Components4.ItemIndicator, { ...styles.itemIndicator }, /* @__PURE__ */ React25.createElement(Checkmark, null)),
|
|
2431
|
+
icon && /* @__PURE__ */ React25.createElement(React25.Fragment, null, renderIcon(icon), /* @__PURE__ */ React25.createElement(Spacer.Horizontal, { size: 8 })),
|
|
2417
2432
|
children,
|
|
2418
|
-
shortcut && /* @__PURE__ */
|
|
2433
|
+
shortcut && /* @__PURE__ */ React25.createElement(React25.Fragment, null, /* @__PURE__ */ React25.createElement(Spacer.Horizontal, null), /* @__PURE__ */ React25.createElement(Spacer.Horizontal, { size: 24 }), /* @__PURE__ */ React25.createElement(KeyboardShortcut, { shortcut }))
|
|
2419
2434
|
));
|
|
2420
2435
|
}
|
|
2421
|
-
return /* @__PURE__ */
|
|
2436
|
+
return /* @__PURE__ */ React25.createElement("div", { className: "px-1" }, /* @__PURE__ */ React25.createElement(
|
|
2422
2437
|
Components4.Item,
|
|
2423
2438
|
{
|
|
2424
2439
|
className: cx(
|
|
@@ -2433,12 +2448,12 @@ var SelectItem = React24.forwardRef(
|
|
|
2433
2448
|
onSelect: handleSelectItem,
|
|
2434
2449
|
...props
|
|
2435
2450
|
},
|
|
2436
|
-
/* @__PURE__ */
|
|
2451
|
+
/* @__PURE__ */ React25.createElement("div", { className: "flex flex-1 items-center" }, indented && /* @__PURE__ */ React25.createElement(Spacer.Horizontal, { size: CHECKBOX_INDENT_WIDTH }), checked ? /* @__PURE__ */ React25.createElement("div", { ...styles.itemIndicator }, /* @__PURE__ */ React25.createElement(Checkmark, null)) : indented ? /* @__PURE__ */ React25.createElement(Spacer.Horizontal, { size: CHECKBOX_WIDTH - CHECKBOX_RIGHT_INSET }) : null, icon && /* @__PURE__ */ React25.createElement(React25.Fragment, null, renderIcon(icon), /* @__PURE__ */ React25.createElement(Spacer.Horizontal, { size: 8 })), /* @__PURE__ */ React25.createElement(Components4.ItemText, null, children), shortcut && /* @__PURE__ */ React25.createElement(React25.Fragment, null, /* @__PURE__ */ React25.createElement(Spacer.Horizontal, null), /* @__PURE__ */ React25.createElement(Spacer.Horizontal, { size: 24 }), /* @__PURE__ */ React25.createElement(KeyboardShortcut, { shortcut })))
|
|
2437
2452
|
));
|
|
2438
2453
|
}
|
|
2439
2454
|
);
|
|
2440
2455
|
function Checkmark() {
|
|
2441
|
-
return /* @__PURE__ */
|
|
2456
|
+
return /* @__PURE__ */ React25.createElement(
|
|
2442
2457
|
"svg",
|
|
2443
2458
|
{
|
|
2444
2459
|
viewBox: "0 0 15 15",
|
|
@@ -2448,7 +2463,7 @@ function Checkmark() {
|
|
|
2448
2463
|
width: 15,
|
|
2449
2464
|
height: 15
|
|
2450
2465
|
},
|
|
2451
|
-
/* @__PURE__ */
|
|
2466
|
+
/* @__PURE__ */ React25.createElement(
|
|
2452
2467
|
"path",
|
|
2453
2468
|
{
|
|
2454
2469
|
className: "scale-90 origin-center",
|
|
@@ -2472,10 +2487,10 @@ var MenuViewport = ({
|
|
|
2472
2487
|
const hasCheckedItem = items.some(
|
|
2473
2488
|
(item) => item.type !== "separator" && item.type !== "sectionHeader" && item.checked
|
|
2474
2489
|
);
|
|
2475
|
-
return /* @__PURE__ */
|
|
2490
|
+
return /* @__PURE__ */ React26.createElement(React26.Fragment, null, items.map((item, index) => {
|
|
2476
2491
|
switch (item.type) {
|
|
2477
2492
|
case "separator":
|
|
2478
|
-
return /* @__PURE__ */
|
|
2493
|
+
return /* @__PURE__ */ React26.createElement(
|
|
2479
2494
|
Components4.Separator,
|
|
2480
2495
|
{
|
|
2481
2496
|
key: index,
|
|
@@ -2483,7 +2498,7 @@ var MenuViewport = ({
|
|
|
2483
2498
|
}
|
|
2484
2499
|
);
|
|
2485
2500
|
case "sectionHeader":
|
|
2486
|
-
return /* @__PURE__ */
|
|
2501
|
+
return /* @__PURE__ */ React26.createElement(
|
|
2487
2502
|
SectionHeader,
|
|
2488
2503
|
{
|
|
2489
2504
|
isFirst: index === 0,
|
|
@@ -2494,7 +2509,7 @@ var MenuViewport = ({
|
|
|
2494
2509
|
);
|
|
2495
2510
|
case "submenu":
|
|
2496
2511
|
if (item.items && Components4.Sub && Components4.SubTrigger && Components4.SubContent && Components4.Portal) {
|
|
2497
|
-
return /* @__PURE__ */
|
|
2512
|
+
return /* @__PURE__ */ React26.createElement(Components4.Sub, { key: item.id }, /* @__PURE__ */ React26.createElement(
|
|
2498
2513
|
Components4.SubTrigger,
|
|
2499
2514
|
{
|
|
2500
2515
|
className: cx(
|
|
@@ -2508,7 +2523,7 @@ var MenuViewport = ({
|
|
|
2508
2523
|
},
|
|
2509
2524
|
disabled: item.disabled
|
|
2510
2525
|
},
|
|
2511
|
-
/* @__PURE__ */
|
|
2526
|
+
/* @__PURE__ */ React26.createElement(
|
|
2512
2527
|
SelectItem,
|
|
2513
2528
|
{
|
|
2514
2529
|
value: item.id,
|
|
@@ -2519,17 +2534,17 @@ var MenuViewport = ({
|
|
|
2519
2534
|
indented: hasCheckedItem,
|
|
2520
2535
|
disabled: item.disabled
|
|
2521
2536
|
},
|
|
2522
|
-
/* @__PURE__ */
|
|
2523
|
-
/* @__PURE__ */
|
|
2537
|
+
/* @__PURE__ */ React26.createElement("div", { className: "flex items-center flex-1" }, item.title),
|
|
2538
|
+
/* @__PURE__ */ React26.createElement(ChevronRightIcon, { className: "-mr-1" })
|
|
2524
2539
|
)
|
|
2525
|
-
), /* @__PURE__ */
|
|
2540
|
+
), /* @__PURE__ */ React26.createElement(Components4.Portal, null, /* @__PURE__ */ React26.createElement(
|
|
2526
2541
|
Components4.SubContent,
|
|
2527
2542
|
{
|
|
2528
2543
|
...portalScopeProps(portalScopeId),
|
|
2529
2544
|
alignOffset: -5,
|
|
2530
2545
|
className: styles.contentStyle
|
|
2531
2546
|
},
|
|
2532
|
-
/* @__PURE__ */
|
|
2547
|
+
/* @__PURE__ */ React26.createElement(
|
|
2533
2548
|
MenuViewport,
|
|
2534
2549
|
{
|
|
2535
2550
|
items: item.items,
|
|
@@ -2540,7 +2555,7 @@ var MenuViewport = ({
|
|
|
2540
2555
|
)));
|
|
2541
2556
|
} else return null;
|
|
2542
2557
|
default:
|
|
2543
|
-
return /* @__PURE__ */
|
|
2558
|
+
return /* @__PURE__ */ React26.createElement(
|
|
2544
2559
|
SelectItem,
|
|
2545
2560
|
{
|
|
2546
2561
|
key: item.value,
|
|
@@ -2563,7 +2578,7 @@ var MenuViewport = ({
|
|
|
2563
2578
|
// src/components/DropdownMenu.tsx
|
|
2564
2579
|
var Components = {
|
|
2565
2580
|
Separator: RadixDropdownMenu.Separator,
|
|
2566
|
-
ItemText:
|
|
2581
|
+
ItemText: React27.Fragment,
|
|
2567
2582
|
Item: RadixDropdownMenu.Item,
|
|
2568
2583
|
CheckboxItem: RadixDropdownMenu.CheckboxItem,
|
|
2569
2584
|
ItemIndicator: RadixDropdownMenu.ItemIndicator,
|
|
@@ -2603,14 +2618,14 @@ var DropdownMenuRoot = forwardRefGeneric(function DropdownMenuRoot2(props, forwa
|
|
|
2603
2618
|
}),
|
|
2604
2619
|
[contentStyle]
|
|
2605
2620
|
);
|
|
2606
|
-
return /* @__PURE__ */
|
|
2621
|
+
return /* @__PURE__ */ React27.createElement(RadixDropdownMenu.Root, { onOpenChange, open }, /* @__PURE__ */ React27.createElement(
|
|
2607
2622
|
RadixDropdownMenu.Trigger,
|
|
2608
2623
|
{
|
|
2609
2624
|
ref: forwardedRef,
|
|
2610
2625
|
asChild: true
|
|
2611
2626
|
},
|
|
2612
2627
|
children
|
|
2613
|
-
), /* @__PURE__ */
|
|
2628
|
+
), /* @__PURE__ */ React27.createElement(RadixDropdownMenu.Portal, null, /* @__PURE__ */ React27.createElement(
|
|
2614
2629
|
RadixDropdownMenu.Content,
|
|
2615
2630
|
{
|
|
2616
2631
|
...portalScopeProps(portalScopeId),
|
|
@@ -2624,7 +2639,7 @@ var DropdownMenuRoot = forwardRefGeneric(function DropdownMenuRoot2(props, forwa
|
|
|
2624
2639
|
...{ onCloseAutoFocus }
|
|
2625
2640
|
},
|
|
2626
2641
|
items.length === 0 ? emptyState : null,
|
|
2627
|
-
/* @__PURE__ */
|
|
2642
|
+
/* @__PURE__ */ React27.createElement(
|
|
2628
2643
|
MenuViewport,
|
|
2629
2644
|
{
|
|
2630
2645
|
items,
|
|
@@ -2655,14 +2670,14 @@ var ActionMenu = memoGeneric(function ActionMenu2({
|
|
|
2655
2670
|
...style2
|
|
2656
2671
|
};
|
|
2657
2672
|
}, [selected, style2, variant]);
|
|
2658
|
-
return /* @__PURE__ */
|
|
2673
|
+
return /* @__PURE__ */ React28.createElement(
|
|
2659
2674
|
DropdownMenu,
|
|
2660
2675
|
{
|
|
2661
2676
|
items: menuItems,
|
|
2662
2677
|
onSelect,
|
|
2663
2678
|
onOpenChange
|
|
2664
2679
|
},
|
|
2665
|
-
/* @__PURE__ */
|
|
2680
|
+
/* @__PURE__ */ React28.createElement(
|
|
2666
2681
|
IconButton,
|
|
2667
2682
|
{
|
|
2668
2683
|
style: internalStyle,
|
|
@@ -2676,16 +2691,16 @@ var ActionMenu = memoGeneric(function ActionMenu2({
|
|
|
2676
2691
|
});
|
|
2677
2692
|
|
|
2678
2693
|
// src/components/ActivityIndicator.tsx
|
|
2679
|
-
import * as
|
|
2680
|
-
var ActivityIndicator =
|
|
2694
|
+
import * as React29 from "react";
|
|
2695
|
+
var ActivityIndicator = React29.memo(function ActivityIndicator2({
|
|
2681
2696
|
size: size2 = 16,
|
|
2682
2697
|
opacity = 1,
|
|
2683
2698
|
color = "black",
|
|
2684
2699
|
trackColor = "rgba(0, 0, 0, 0.1)",
|
|
2685
2700
|
className
|
|
2686
2701
|
}) {
|
|
2687
|
-
const opacityStyle =
|
|
2688
|
-
const dynamicStyles =
|
|
2702
|
+
const opacityStyle = React29.useMemo(() => ({ opacity }), [opacity]);
|
|
2703
|
+
const dynamicStyles = React29.useMemo(
|
|
2689
2704
|
() => ({
|
|
2690
2705
|
border: `2px solid ${trackColor}`,
|
|
2691
2706
|
borderTopColor: color,
|
|
@@ -2694,19 +2709,19 @@ var ActivityIndicator = React28.memo(function ActivityIndicator2({
|
|
|
2694
2709
|
}),
|
|
2695
2710
|
[size2, color, trackColor]
|
|
2696
2711
|
);
|
|
2697
|
-
return /* @__PURE__ */
|
|
2712
|
+
return /* @__PURE__ */ React29.createElement(
|
|
2698
2713
|
"div",
|
|
2699
2714
|
{
|
|
2700
2715
|
className: cx("flex justify-center items-center", className),
|
|
2701
2716
|
style: opacityStyle
|
|
2702
2717
|
},
|
|
2703
|
-
/* @__PURE__ */
|
|
2718
|
+
/* @__PURE__ */ React29.createElement("div", { style: dynamicStyles, className: "animate-spin rounded-[50%]" })
|
|
2704
2719
|
);
|
|
2705
2720
|
});
|
|
2706
2721
|
|
|
2707
2722
|
// src/components/Avatar.tsx
|
|
2708
2723
|
import * as AvatarPrimitive from "@radix-ui/react-avatar";
|
|
2709
|
-
import
|
|
2724
|
+
import React30, { forwardRef as forwardRef10, useMemo as useMemo14 } from "react";
|
|
2710
2725
|
|
|
2711
2726
|
// src/utils/colorFromString.ts
|
|
2712
2727
|
var colorForStringValues = {
|
|
@@ -2775,7 +2790,7 @@ var getInnerAvatarStyles = (size2, variant) => {
|
|
|
2775
2790
|
minHeight: dimension
|
|
2776
2791
|
};
|
|
2777
2792
|
};
|
|
2778
|
-
var AvatarRoot =
|
|
2793
|
+
var AvatarRoot = React30.forwardRef(
|
|
2779
2794
|
({
|
|
2780
2795
|
className,
|
|
2781
2796
|
size: size2 = 21,
|
|
@@ -2794,7 +2809,7 @@ var AvatarRoot = React29.forwardRef(
|
|
|
2794
2809
|
}),
|
|
2795
2810
|
[backgroundColor, size2, style2]
|
|
2796
2811
|
);
|
|
2797
|
-
return /* @__PURE__ */
|
|
2812
|
+
return /* @__PURE__ */ React30.createElement(
|
|
2798
2813
|
AvatarPrimitive.Root,
|
|
2799
2814
|
{
|
|
2800
2815
|
ref,
|
|
@@ -2809,8 +2824,8 @@ var AvatarRoot = React29.forwardRef(
|
|
|
2809
2824
|
);
|
|
2810
2825
|
}
|
|
2811
2826
|
);
|
|
2812
|
-
var AvatarImage =
|
|
2813
|
-
return /* @__PURE__ */
|
|
2827
|
+
var AvatarImage = React30.forwardRef(({ className, size: size2 = 21, variant = "normal", ...props }, ref) => {
|
|
2828
|
+
return /* @__PURE__ */ React30.createElement(
|
|
2814
2829
|
AvatarPrimitive.Image,
|
|
2815
2830
|
{
|
|
2816
2831
|
ref,
|
|
@@ -2826,9 +2841,9 @@ var AvatarImage = React29.forwardRef(({ className, size: size2 = 21, variant = "
|
|
|
2826
2841
|
function getMonogram(text) {
|
|
2827
2842
|
return text?.at(0)?.toLocaleUpperCase();
|
|
2828
2843
|
}
|
|
2829
|
-
var AvatarFallback =
|
|
2844
|
+
var AvatarFallback = React30.forwardRef(
|
|
2830
2845
|
({ className, children, style: style2, size: size2 = 21, backgroundColor, ...props }, ref) => {
|
|
2831
|
-
return /* @__PURE__ */
|
|
2846
|
+
return /* @__PURE__ */ React30.createElement(
|
|
2832
2847
|
AvatarPrimitive.Fallback,
|
|
2833
2848
|
{
|
|
2834
2849
|
ref,
|
|
@@ -2849,7 +2864,7 @@ var AvatarFallback = React29.forwardRef(
|
|
|
2849
2864
|
);
|
|
2850
2865
|
}
|
|
2851
2866
|
);
|
|
2852
|
-
var Avatar =
|
|
2867
|
+
var Avatar = React30.memo(
|
|
2853
2868
|
forwardRef10(function Avatar2({
|
|
2854
2869
|
image,
|
|
2855
2870
|
name,
|
|
@@ -2862,7 +2877,7 @@ var Avatar = React29.memo(
|
|
|
2862
2877
|
...props
|
|
2863
2878
|
}, forwardedRef) {
|
|
2864
2879
|
const getBackgroundColor = backgroundColor ?? colorFromString(userId ?? name ?? "");
|
|
2865
|
-
return /* @__PURE__ */
|
|
2880
|
+
return /* @__PURE__ */ React30.createElement(
|
|
2866
2881
|
AvatarRoot,
|
|
2867
2882
|
{
|
|
2868
2883
|
ref: forwardedRef,
|
|
@@ -2872,7 +2887,7 @@ var Avatar = React29.memo(
|
|
|
2872
2887
|
className,
|
|
2873
2888
|
...props
|
|
2874
2889
|
},
|
|
2875
|
-
image ? /* @__PURE__ */
|
|
2890
|
+
image ? /* @__PURE__ */ React30.createElement(AvatarImage, { src: image, alt: name, size: size2, variant }) : /* @__PURE__ */ React30.createElement(
|
|
2876
2891
|
AvatarFallback,
|
|
2877
2892
|
{
|
|
2878
2893
|
backgroundColor: getBackgroundColor,
|
|
@@ -2884,31 +2899,31 @@ var Avatar = React29.memo(
|
|
|
2884
2899
|
);
|
|
2885
2900
|
})
|
|
2886
2901
|
);
|
|
2887
|
-
var OverflowAvatar =
|
|
2902
|
+
var OverflowAvatar = React30.memo(function OverflowAvatar2({
|
|
2888
2903
|
size: size2 = 21,
|
|
2889
2904
|
count
|
|
2890
2905
|
}) {
|
|
2891
|
-
return /* @__PURE__ */
|
|
2906
|
+
return /* @__PURE__ */ React30.createElement(AvatarRoot, { size: size2, backgroundColor: "var(--n-text-disabled)", disabled: true }, /* @__PURE__ */ React30.createElement(AvatarFallback, { backgroundColor: "var(--n-text-disabled)", size: size2 }, "+", count));
|
|
2892
2907
|
});
|
|
2893
|
-
var AvatarStack =
|
|
2908
|
+
var AvatarStack = React30.memo(function AvatarStack2({
|
|
2894
2909
|
size: size2 = 21,
|
|
2895
2910
|
children,
|
|
2896
2911
|
max = 3,
|
|
2897
2912
|
className
|
|
2898
2913
|
}) {
|
|
2899
|
-
const avatarCount =
|
|
2914
|
+
const avatarCount = React30.Children.count(children);
|
|
2900
2915
|
const overflowCount = avatarCount - max;
|
|
2901
2916
|
const childrenArray = useMemo14(() => {
|
|
2902
|
-
const processedChildren =
|
|
2917
|
+
const processedChildren = React30.Children.toArray(children).map((child) => React30.cloneElement(child, { size: size2 })).slice(0, max);
|
|
2903
2918
|
if (avatarCount > max) {
|
|
2904
2919
|
return [
|
|
2905
|
-
/* @__PURE__ */
|
|
2920
|
+
/* @__PURE__ */ React30.createElement(OverflowAvatar, { key: "overflow", size: size2, count: overflowCount }),
|
|
2906
2921
|
...processedChildren
|
|
2907
2922
|
];
|
|
2908
2923
|
}
|
|
2909
2924
|
return processedChildren;
|
|
2910
2925
|
}, [children, max, size2, avatarCount, overflowCount]);
|
|
2911
|
-
return /* @__PURE__ */
|
|
2926
|
+
return /* @__PURE__ */ React30.createElement(
|
|
2912
2927
|
"div",
|
|
2913
2928
|
{
|
|
2914
2929
|
className: cx(
|
|
@@ -2918,7 +2933,7 @@ var AvatarStack = React29.memo(function AvatarStack2({
|
|
|
2918
2933
|
)
|
|
2919
2934
|
},
|
|
2920
2935
|
childrenArray.map((child, index) => {
|
|
2921
|
-
return /* @__PURE__ */
|
|
2936
|
+
return /* @__PURE__ */ React30.createElement(
|
|
2922
2937
|
"div",
|
|
2923
2938
|
{
|
|
2924
2939
|
className: cx("relative", size2 > 36 ? "-ml-3" : "-ml-1.5"),
|
|
@@ -2931,10 +2946,10 @@ var AvatarStack = React29.memo(function AvatarStack2({
|
|
|
2931
2946
|
});
|
|
2932
2947
|
|
|
2933
2948
|
// src/components/NoyaLogo.tsx
|
|
2934
|
-
import
|
|
2949
|
+
import React31, { forwardRef as forwardRef11 } from "react";
|
|
2935
2950
|
var Logo = forwardRef11(function Logo2(props, ref) {
|
|
2936
2951
|
const fill = props.fill || cssVars.colors.logoFill;
|
|
2937
|
-
return /* @__PURE__ */
|
|
2952
|
+
return /* @__PURE__ */ React31.createElement(
|
|
2938
2953
|
"svg",
|
|
2939
2954
|
{
|
|
2940
2955
|
ref,
|
|
@@ -2944,14 +2959,14 @@ var Logo = forwardRef11(function Logo2(props, ref) {
|
|
|
2944
2959
|
...props,
|
|
2945
2960
|
className: "w-6 aspect-[24/26]"
|
|
2946
2961
|
},
|
|
2947
|
-
/* @__PURE__ */
|
|
2962
|
+
/* @__PURE__ */ React31.createElement(
|
|
2948
2963
|
"path",
|
|
2949
2964
|
{
|
|
2950
2965
|
d: "M6.5 3H2V12H5V6H6.5C7.32843 6 8 6.67157 8 7.5V12H11V7.5C11 5.01472 8.98528 3 6.5 3Z",
|
|
2951
2966
|
fill
|
|
2952
2967
|
}
|
|
2953
2968
|
),
|
|
2954
|
-
/* @__PURE__ */
|
|
2969
|
+
/* @__PURE__ */ React31.createElement(
|
|
2955
2970
|
"path",
|
|
2956
2971
|
{
|
|
2957
2972
|
fillRule: "evenodd",
|
|
@@ -2960,14 +2975,14 @@ var Logo = forwardRef11(function Logo2(props, ref) {
|
|
|
2960
2975
|
fill
|
|
2961
2976
|
}
|
|
2962
2977
|
),
|
|
2963
|
-
/* @__PURE__ */
|
|
2978
|
+
/* @__PURE__ */ React31.createElement(
|
|
2964
2979
|
"path",
|
|
2965
2980
|
{
|
|
2966
2981
|
d: "M5 14H2V18.5C2 20.9853 4.01472 23 6.5 23H8V26H11V17H8V20H6.5C5.67157 20 5 19.3284 5 18.5V14Z",
|
|
2967
2982
|
fill
|
|
2968
2983
|
}
|
|
2969
2984
|
),
|
|
2970
|
-
/* @__PURE__ */
|
|
2985
|
+
/* @__PURE__ */ React31.createElement(
|
|
2971
2986
|
"path",
|
|
2972
2987
|
{
|
|
2973
2988
|
fillRule: "evenodd",
|
|
@@ -2980,19 +2995,19 @@ var Logo = forwardRef11(function Logo2(props, ref) {
|
|
|
2980
2995
|
});
|
|
2981
2996
|
|
|
2982
2997
|
// src/components/ai-assistant/AIAssistantLayout.tsx
|
|
2983
|
-
import
|
|
2998
|
+
import React33, { forwardRef as forwardRef13 } from "react";
|
|
2984
2999
|
|
|
2985
3000
|
// src/components/TextArea.tsx
|
|
2986
|
-
import
|
|
3001
|
+
import React32, {
|
|
2987
3002
|
forwardRef as forwardRef12,
|
|
2988
3003
|
memo as memo12,
|
|
2989
3004
|
useCallback as useCallback15,
|
|
2990
|
-
useEffect as
|
|
3005
|
+
useEffect as useEffect13,
|
|
2991
3006
|
useRef as useRef13
|
|
2992
3007
|
} from "react";
|
|
2993
3008
|
var useAutoResize = (value) => {
|
|
2994
3009
|
const textareaRef = useRef13(null);
|
|
2995
|
-
|
|
3010
|
+
useEffect13(() => {
|
|
2996
3011
|
if (value === void 0) return;
|
|
2997
3012
|
if (!textareaRef.current) return;
|
|
2998
3013
|
textareaRef.current.style.height = "auto";
|
|
@@ -3029,7 +3044,7 @@ var TextArea = memo12(
|
|
|
3029
3044
|
},
|
|
3030
3045
|
[autoResize, autoResizeRef, forwardedRef]
|
|
3031
3046
|
);
|
|
3032
|
-
return /* @__PURE__ */
|
|
3047
|
+
return /* @__PURE__ */ React32.createElement(
|
|
3033
3048
|
"textarea",
|
|
3034
3049
|
{
|
|
3035
3050
|
className: cx(
|
|
@@ -3054,31 +3069,31 @@ var TextAreaRow = memo12(
|
|
|
3054
3069
|
endClassName,
|
|
3055
3070
|
...rest
|
|
3056
3071
|
}, forwardedRef) {
|
|
3057
|
-
return /* @__PURE__ */
|
|
3072
|
+
return /* @__PURE__ */ React32.createElement(
|
|
3058
3073
|
"div",
|
|
3059
3074
|
{
|
|
3060
3075
|
ref: forwardedRef,
|
|
3061
3076
|
className: cx("relative w-full h-full", className)
|
|
3062
3077
|
},
|
|
3063
|
-
/* @__PURE__ */
|
|
3064
|
-
/* @__PURE__ */
|
|
3078
|
+
/* @__PURE__ */ React32.createElement(TextArea, { className: textAreaClassName, ...rest, ref: textAreaRef }),
|
|
3079
|
+
/* @__PURE__ */ React32.createElement("div", { className: cx("absolute right-1 top-4", endClassName) }, end)
|
|
3065
3080
|
);
|
|
3066
3081
|
})
|
|
3067
3082
|
);
|
|
3068
3083
|
|
|
3069
3084
|
// src/components/ai-assistant/AIAssistantLayout.tsx
|
|
3070
3085
|
var AIAssistantLoadingIndicator = () => {
|
|
3071
|
-
return /* @__PURE__ */
|
|
3086
|
+
return /* @__PURE__ */ React33.createElement("div", { className: "flex gap-2" }, /* @__PURE__ */ React33.createElement(
|
|
3072
3087
|
Avatar,
|
|
3073
3088
|
{
|
|
3074
3089
|
name: "Assistant",
|
|
3075
3090
|
size: INPUT_HEIGHT,
|
|
3076
3091
|
backgroundColor: cssVars.colors.primaryPastel
|
|
3077
3092
|
},
|
|
3078
|
-
/* @__PURE__ */
|
|
3079
|
-
), /* @__PURE__ */
|
|
3093
|
+
/* @__PURE__ */ React33.createElement(Logo, { style: { width: 15 }, fill: cssVars.colors.primary })
|
|
3094
|
+
), /* @__PURE__ */ React33.createElement("div", { className: "animate-pulse" }, "\u258B"));
|
|
3080
3095
|
};
|
|
3081
|
-
var AIAssistantInput = forwardRef13(({ value, onChange, onSubmitClick, onKeyDown, disabled }, ref) => /* @__PURE__ */
|
|
3096
|
+
var AIAssistantInput = forwardRef13(({ value, onChange, onSubmitClick, onKeyDown, disabled }, ref) => /* @__PURE__ */ React33.createElement(
|
|
3082
3097
|
TextAreaRow,
|
|
3083
3098
|
{
|
|
3084
3099
|
autoResize: true,
|
|
@@ -3090,7 +3105,7 @@ var AIAssistantInput = forwardRef13(({ value, onChange, onSubmitClick, onKeyDown
|
|
|
3090
3105
|
placeholder: "Tell me what you'd like to do...",
|
|
3091
3106
|
onKeyDown,
|
|
3092
3107
|
disabled,
|
|
3093
|
-
end: /* @__PURE__ */
|
|
3108
|
+
end: /* @__PURE__ */ React33.createElement(
|
|
3094
3109
|
IconButton,
|
|
3095
3110
|
{
|
|
3096
3111
|
iconName: "ArrowUpIcon",
|
|
@@ -3115,18 +3130,18 @@ var AIAssistantLayout = forwardRef13(
|
|
|
3115
3130
|
className,
|
|
3116
3131
|
style: style2
|
|
3117
3132
|
}, ref) => {
|
|
3118
|
-
return /* @__PURE__ */
|
|
3133
|
+
return /* @__PURE__ */ React33.createElement("div", { className: cx("flex flex-col flex-1", className), style: style2 }, /* @__PURE__ */ React33.createElement("div", { className: "flex-1 min-h-0 overflow-auto", ref }, /* @__PURE__ */ React33.createElement("div", { className: "flex flex-col gap-2 pb-4 pt-1" }, renderMessages(), isLoading ? renderLoadingIndicator?.() : null)), /* @__PURE__ */ React33.createElement("div", { className: "border-t border-divider pt-1 px-1" }, renderInput()));
|
|
3119
3134
|
}
|
|
3120
3135
|
);
|
|
3121
3136
|
|
|
3122
3137
|
// src/components/AnimatePresence.tsx
|
|
3123
3138
|
import { isDeepEqual as isDeepEqual3 } from "@noya-app/noya-utils";
|
|
3124
|
-
import
|
|
3139
|
+
import React34, {
|
|
3125
3140
|
Children as Children2,
|
|
3126
3141
|
isValidElement as isValidElement2,
|
|
3127
3142
|
useCallback as useCallback16,
|
|
3128
|
-
useEffect as
|
|
3129
|
-
useLayoutEffect as
|
|
3143
|
+
useEffect as useEffect14,
|
|
3144
|
+
useLayoutEffect as useLayoutEffect5,
|
|
3130
3145
|
useRef as useRef14,
|
|
3131
3146
|
useState as useState17
|
|
3132
3147
|
} from "react";
|
|
@@ -3166,7 +3181,7 @@ var PresenceChild = ({
|
|
|
3166
3181
|
willChange: "opacity",
|
|
3167
3182
|
backfaceVisibility: "hidden"
|
|
3168
3183
|
};
|
|
3169
|
-
|
|
3184
|
+
useLayoutEffect5(() => {
|
|
3170
3185
|
let rafId;
|
|
3171
3186
|
if (isPresent && animationState !== "entered") {
|
|
3172
3187
|
if (isInitialMount.current && skipInitialAnimation) {
|
|
@@ -3201,7 +3216,7 @@ var PresenceChild = ({
|
|
|
3201
3216
|
if (animationState === "exited" && !isPresent) {
|
|
3202
3217
|
return null;
|
|
3203
3218
|
}
|
|
3204
|
-
return /* @__PURE__ */
|
|
3219
|
+
return /* @__PURE__ */ React34.createElement("div", { style: mergedAnimationStyles[animationState], className }, children);
|
|
3205
3220
|
};
|
|
3206
3221
|
var AnimatePresence = ({
|
|
3207
3222
|
children,
|
|
@@ -3215,7 +3230,7 @@ var AnimatePresence = ({
|
|
|
3215
3230
|
const previousChildrenRef = useRef14([]);
|
|
3216
3231
|
const removingChildrenRef = useRef14(/* @__PURE__ */ new Set());
|
|
3217
3232
|
const waitingToEnterRef = useRef14([]);
|
|
3218
|
-
|
|
3233
|
+
useEffect14(() => {
|
|
3219
3234
|
const newChildren = Children2.toArray(children).filter(
|
|
3220
3235
|
isValidElement2
|
|
3221
3236
|
);
|
|
@@ -3276,7 +3291,7 @@ var AnimatePresence = ({
|
|
|
3276
3291
|
return filtered;
|
|
3277
3292
|
});
|
|
3278
3293
|
}, []);
|
|
3279
|
-
return /* @__PURE__ */
|
|
3294
|
+
return /* @__PURE__ */ React34.createElement(React34.Fragment, null, mountedChildren.map(({ child, isPresent, skipInitialAnimation: skipInitialAnimation2 }) => /* @__PURE__ */ React34.createElement(
|
|
3280
3295
|
PresenceChild,
|
|
3281
3296
|
{
|
|
3282
3297
|
key: child.key,
|
|
@@ -3292,13 +3307,13 @@ var AnimatePresence = ({
|
|
|
3292
3307
|
};
|
|
3293
3308
|
|
|
3294
3309
|
// src/components/Banner.tsx
|
|
3295
|
-
import
|
|
3310
|
+
import React35 from "react";
|
|
3296
3311
|
var bannerStyles = {
|
|
3297
3312
|
backgroundColor: cssVars.colors.inputBackground,
|
|
3298
3313
|
color: cssVars.colors.textDisabled
|
|
3299
3314
|
};
|
|
3300
3315
|
function Banner({ label = "No items", className, style: style2 }) {
|
|
3301
|
-
return /* @__PURE__ */
|
|
3316
|
+
return /* @__PURE__ */ React35.createElement(
|
|
3302
3317
|
"div",
|
|
3303
3318
|
{
|
|
3304
3319
|
className: cx(
|
|
@@ -3307,15 +3322,15 @@ function Banner({ label = "No items", className, style: style2 }) {
|
|
|
3307
3322
|
),
|
|
3308
3323
|
style: { ...bannerStyles, ...style2 }
|
|
3309
3324
|
},
|
|
3310
|
-
/* @__PURE__ */
|
|
3325
|
+
/* @__PURE__ */ React35.createElement(Small, { color: "textDisabled" }, label)
|
|
3311
3326
|
);
|
|
3312
3327
|
}
|
|
3313
3328
|
|
|
3314
3329
|
// src/components/Breadcrumbs.tsx
|
|
3315
3330
|
import { forwardRef as forwardRef14 } from "react";
|
|
3316
|
-
import
|
|
3331
|
+
import React36 from "react";
|
|
3317
3332
|
var BreadcrumbText = forwardRef14(function BreadcrumbText2({ children, className, onClick, ...props }, ref) {
|
|
3318
|
-
return /* @__PURE__ */
|
|
3333
|
+
return /* @__PURE__ */ React36.createElement(
|
|
3319
3334
|
Text,
|
|
3320
3335
|
{
|
|
3321
3336
|
...props,
|
|
@@ -3335,7 +3350,7 @@ var slashStyle = {
|
|
|
3335
3350
|
margin: "0 3px"
|
|
3336
3351
|
};
|
|
3337
3352
|
var BreadcrumbSlash = () => {
|
|
3338
|
-
return /* @__PURE__ */
|
|
3353
|
+
return /* @__PURE__ */ React36.createElement(
|
|
3339
3354
|
"svg",
|
|
3340
3355
|
{
|
|
3341
3356
|
width: "7",
|
|
@@ -3346,7 +3361,7 @@ var BreadcrumbSlash = () => {
|
|
|
3346
3361
|
opacity: 0.5,
|
|
3347
3362
|
style: slashStyle
|
|
3348
3363
|
},
|
|
3349
|
-
/* @__PURE__ */
|
|
3364
|
+
/* @__PURE__ */ React36.createElement(
|
|
3350
3365
|
"path",
|
|
3351
3366
|
{
|
|
3352
3367
|
d: "M1 16L6 1",
|
|
@@ -3360,16 +3375,16 @@ var BreadcrumbSlash = () => {
|
|
|
3360
3375
|
};
|
|
3361
3376
|
|
|
3362
3377
|
// src/components/Checkbox.tsx
|
|
3363
|
-
import * as
|
|
3378
|
+
import * as React37 from "react";
|
|
3364
3379
|
var colorSchemeStyles = {
|
|
3365
3380
|
normal: "text-text-subtle",
|
|
3366
3381
|
primary: "text-primary",
|
|
3367
3382
|
secondary: "text-secondary"
|
|
3368
3383
|
};
|
|
3369
|
-
var Checkbox =
|
|
3370
|
-
|
|
3384
|
+
var Checkbox = React37.memo(
|
|
3385
|
+
React37.forwardRef(function Checkbox2({ className, style: style2, colorScheme = "secondary", ...props }, ref) {
|
|
3371
3386
|
const { fieldId: id } = useLabel({ fieldId: props.id });
|
|
3372
|
-
return /* @__PURE__ */
|
|
3387
|
+
return /* @__PURE__ */ React37.createElement(
|
|
3373
3388
|
"div",
|
|
3374
3389
|
{
|
|
3375
3390
|
className: cx(
|
|
@@ -3379,7 +3394,7 @@ var Checkbox = React36.memo(
|
|
|
3379
3394
|
),
|
|
3380
3395
|
style: style2
|
|
3381
3396
|
},
|
|
3382
|
-
/* @__PURE__ */
|
|
3397
|
+
/* @__PURE__ */ React37.createElement(
|
|
3383
3398
|
"input",
|
|
3384
3399
|
{
|
|
3385
3400
|
ref,
|
|
@@ -3408,7 +3423,7 @@ var Checkbox = React36.memo(
|
|
|
3408
3423
|
id
|
|
3409
3424
|
}
|
|
3410
3425
|
),
|
|
3411
|
-
/* @__PURE__ */
|
|
3426
|
+
/* @__PURE__ */ React37.createElement(
|
|
3412
3427
|
"svg",
|
|
3413
3428
|
{
|
|
3414
3429
|
className: `
|
|
@@ -3428,7 +3443,7 @@ var Checkbox = React36.memo(
|
|
|
3428
3443
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3429
3444
|
"aria-hidden": "true"
|
|
3430
3445
|
},
|
|
3431
|
-
/* @__PURE__ */
|
|
3446
|
+
/* @__PURE__ */ React37.createElement(
|
|
3432
3447
|
"path",
|
|
3433
3448
|
{
|
|
3434
3449
|
d: "M3 6L4.5 7.5L8 4",
|
|
@@ -3444,10 +3459,10 @@ var Checkbox = React36.memo(
|
|
|
3444
3459
|
|
|
3445
3460
|
// src/components/Chip.tsx
|
|
3446
3461
|
import { Cross1Icon, PlusIcon } from "@noya-app/noya-icons";
|
|
3447
|
-
import
|
|
3462
|
+
import React39, { forwardRef as forwardRef16, memo as memo14 } from "react";
|
|
3448
3463
|
|
|
3449
3464
|
// src/hooks/useHover.ts
|
|
3450
|
-
import * as
|
|
3465
|
+
import * as React38 from "react";
|
|
3451
3466
|
var globalIgnoreEmulatedMouseEvents = false;
|
|
3452
3467
|
var hoverCount = 0;
|
|
3453
3468
|
function setGlobalIgnoreEmulatedMouseEvents() {
|
|
@@ -3477,13 +3492,13 @@ function setupGlobalTouchEvents() {
|
|
|
3477
3492
|
}
|
|
3478
3493
|
function useHover(props = {}) {
|
|
3479
3494
|
const { onHoverStart, onHoverChange, onHoverEnd, isDisabled } = props;
|
|
3480
|
-
const [isHovered, setHovered] =
|
|
3481
|
-
const state =
|
|
3495
|
+
const [isHovered, setHovered] = React38.useState(false);
|
|
3496
|
+
const state = React38.useRef({
|
|
3482
3497
|
isHovered: false,
|
|
3483
3498
|
ignoreEmulatedMouseEvents: false
|
|
3484
3499
|
}).current;
|
|
3485
|
-
|
|
3486
|
-
const hoverProps =
|
|
3500
|
+
React38.useEffect(setupGlobalTouchEvents, []);
|
|
3501
|
+
const hoverProps = React38.useMemo(
|
|
3487
3502
|
function getHoverProps() {
|
|
3488
3503
|
function triggerHoverStart(event, pointerType) {
|
|
3489
3504
|
if (isDisabled || pointerType === "touch" || state.isHovered) {
|
|
@@ -3629,7 +3644,7 @@ var Chip = memo14(
|
|
|
3629
3644
|
className
|
|
3630
3645
|
);
|
|
3631
3646
|
const color = colorScheme === "primary" ? cssVars.colors.primary : colorScheme === "secondary" ? cssVars.colors.secondary : cssVars.colors.text;
|
|
3632
|
-
return /* @__PURE__ */
|
|
3647
|
+
return /* @__PURE__ */ React39.createElement(
|
|
3633
3648
|
"span",
|
|
3634
3649
|
{
|
|
3635
3650
|
ref: forwardedRef,
|
|
@@ -3639,7 +3654,7 @@ var Chip = memo14(
|
|
|
3639
3654
|
tabIndex,
|
|
3640
3655
|
...rest
|
|
3641
3656
|
},
|
|
3642
|
-
addable && /* @__PURE__ */
|
|
3657
|
+
addable && /* @__PURE__ */ React39.createElement(
|
|
3643
3658
|
PlusIcon,
|
|
3644
3659
|
{
|
|
3645
3660
|
className: cx(ICON_BASE_STYLES, ICON_SIZE_STYLES[size2].add),
|
|
@@ -3651,7 +3666,7 @@ var Chip = memo14(
|
|
|
3651
3666
|
}
|
|
3652
3667
|
),
|
|
3653
3668
|
children,
|
|
3654
|
-
deletable && /* @__PURE__ */
|
|
3669
|
+
deletable && /* @__PURE__ */ React39.createElement(
|
|
3655
3670
|
Cross1Icon,
|
|
3656
3671
|
{
|
|
3657
3672
|
className: cx(ICON_BASE_STYLES, ICON_SIZE_STYLES[size2].delete),
|
|
@@ -3668,10 +3683,10 @@ var Chip = memo14(
|
|
|
3668
3683
|
);
|
|
3669
3684
|
|
|
3670
3685
|
// src/components/Collection.tsx
|
|
3671
|
-
import
|
|
3686
|
+
import React52 from "react";
|
|
3672
3687
|
|
|
3673
3688
|
// src/components/Grid.tsx
|
|
3674
|
-
import
|
|
3689
|
+
import React44, { useImperativeHandle as useImperativeHandle3, useRef as useRef17, useState as useState21 } from "react";
|
|
3675
3690
|
|
|
3676
3691
|
// src/utils/selection.ts
|
|
3677
3692
|
function updateSelection(allIds, selectedIds, clickedId, event) {
|
|
@@ -3699,16 +3714,16 @@ function updateSelection(allIds, selectedIds, clickedId, event) {
|
|
|
3699
3714
|
}
|
|
3700
3715
|
|
|
3701
3716
|
// src/components/EditableText.tsx
|
|
3702
|
-
import
|
|
3717
|
+
import React40, {
|
|
3703
3718
|
forwardRef as forwardRef17,
|
|
3704
3719
|
memo as memo15,
|
|
3705
3720
|
useCallback as useCallback17,
|
|
3706
|
-
useEffect as
|
|
3721
|
+
useEffect as useEffect16,
|
|
3707
3722
|
useImperativeHandle as useImperativeHandle2,
|
|
3708
3723
|
useRef as useRef16,
|
|
3709
3724
|
useState as useState19
|
|
3710
3725
|
} from "react";
|
|
3711
|
-
var defaultRenderPreview = (props) => /* @__PURE__ */
|
|
3726
|
+
var defaultRenderPreview = (props) => /* @__PURE__ */ React40.createElement(BreadcrumbText, { ...props });
|
|
3712
3727
|
var EditableText = memo15(
|
|
3713
3728
|
forwardRef17(function EditableText2({
|
|
3714
3729
|
value,
|
|
@@ -3729,7 +3744,7 @@ var EditableText = memo15(
|
|
|
3729
3744
|
...props
|
|
3730
3745
|
}, ref) {
|
|
3731
3746
|
const [inputValue, setInputValue] = useState19(value);
|
|
3732
|
-
|
|
3747
|
+
useEffect16(() => {
|
|
3733
3748
|
setInputValue(value);
|
|
3734
3749
|
}, [value]);
|
|
3735
3750
|
const [focusedInternal, setFocused] = useState19(false);
|
|
@@ -3765,7 +3780,7 @@ var EditableText = memo15(
|
|
|
3765
3780
|
inputRef.current?.focus();
|
|
3766
3781
|
inputRef.current?.setSelectionRange(0, inputRef.current.value.length);
|
|
3767
3782
|
}
|
|
3768
|
-
|
|
3783
|
+
useEffect16(() => {
|
|
3769
3784
|
if (testFocused) return;
|
|
3770
3785
|
if (focused) {
|
|
3771
3786
|
setTimeout(focusInput, 1);
|
|
@@ -3785,7 +3800,7 @@ var EditableText = memo15(
|
|
|
3785
3800
|
style: textStyle,
|
|
3786
3801
|
className: textClassName
|
|
3787
3802
|
});
|
|
3788
|
-
const input = /* @__PURE__ */
|
|
3803
|
+
const input = /* @__PURE__ */ React40.createElement("div", { className: "flex absolute inset-0 -mx-1.5 -my-1" }, /* @__PURE__ */ React40.createElement(InputField2.Root, { onFocusChange: setFocused }, /* @__PURE__ */ React40.createElement(
|
|
3789
3804
|
InputField2.Input,
|
|
3790
3805
|
{
|
|
3791
3806
|
ref: inputRef,
|
|
@@ -3825,12 +3840,12 @@ var EditableText = memo15(
|
|
|
3825
3840
|
}
|
|
3826
3841
|
}
|
|
3827
3842
|
)));
|
|
3828
|
-
return /* @__PURE__ */
|
|
3843
|
+
return /* @__PURE__ */ React40.createElement("div", { className: cx("flex relative", className), style: style2 }, preview, focused && !readOnly && input);
|
|
3829
3844
|
})
|
|
3830
3845
|
);
|
|
3831
3846
|
|
|
3832
3847
|
// src/components/GridView.tsx
|
|
3833
|
-
import
|
|
3848
|
+
import React43, {
|
|
3834
3849
|
createContext as createContext8,
|
|
3835
3850
|
forwardRef as forwardRef18,
|
|
3836
3851
|
memo as memo17,
|
|
@@ -3842,10 +3857,10 @@ import React42, {
|
|
|
3842
3857
|
// src/components/ContextMenu.tsx
|
|
3843
3858
|
import { useKeyboardShortcuts as useKeyboardShortcuts2 } from "@noya-app/noya-keymap";
|
|
3844
3859
|
import * as RadixContextMenu from "@radix-ui/react-context-menu";
|
|
3845
|
-
import
|
|
3860
|
+
import React41, { useCallback as useCallback18, useMemo as useMemo16 } from "react";
|
|
3846
3861
|
var Components2 = {
|
|
3847
3862
|
Separator: RadixContextMenu.Separator,
|
|
3848
|
-
ItemText:
|
|
3863
|
+
ItemText: React41.Fragment,
|
|
3849
3864
|
Item: RadixContextMenu.Item,
|
|
3850
3865
|
CheckboxItem: RadixContextMenu.CheckboxItem,
|
|
3851
3866
|
ItemIndicator: RadixContextMenu.ItemIndicator,
|
|
@@ -3877,13 +3892,13 @@ function ContextMenuRoot({
|
|
|
3877
3892
|
},
|
|
3878
3893
|
[onSelect]
|
|
3879
3894
|
);
|
|
3880
|
-
return /* @__PURE__ */
|
|
3895
|
+
return /* @__PURE__ */ React41.createElement(RadixContextMenu.Root, { onOpenChange }, /* @__PURE__ */ React41.createElement(RadixContextMenu.Trigger, { asChild: true, onPointerDown }, children), /* @__PURE__ */ React41.createElement(RadixContextMenu.Portal, null, /* @__PURE__ */ React41.createElement(
|
|
3881
3896
|
RadixContextMenu.Content,
|
|
3882
3897
|
{
|
|
3883
3898
|
...portalScopeProps(portalScopeId),
|
|
3884
3899
|
className: styles.contentStyle
|
|
3885
3900
|
},
|
|
3886
|
-
/* @__PURE__ */
|
|
3901
|
+
/* @__PURE__ */ React41.createElement(
|
|
3887
3902
|
MenuViewport,
|
|
3888
3903
|
{
|
|
3889
3904
|
items,
|
|
@@ -3897,26 +3912,26 @@ var ContextMenu = memoGeneric(ContextMenuRoot);
|
|
|
3897
3912
|
|
|
3898
3913
|
// src/components/ScrollArea.tsx
|
|
3899
3914
|
import * as RadixScrollArea from "@radix-ui/react-scroll-area";
|
|
3900
|
-
import * as
|
|
3901
|
-
var ScrollArea =
|
|
3902
|
-
const [scrollElementRef, setScrollElementRef] =
|
|
3903
|
-
return /* @__PURE__ */
|
|
3915
|
+
import * as React42 from "react";
|
|
3916
|
+
var ScrollArea = React42.memo(function ScrollArea2({ children }) {
|
|
3917
|
+
const [scrollElementRef, setScrollElementRef] = React42.useState(null);
|
|
3918
|
+
return /* @__PURE__ */ React42.createElement("div", { className: "flex-1 min-h-0" }, /* @__PURE__ */ React42.createElement(RadixScrollArea.Root, { style: { width: "100%", height: "100%" } }, /* @__PURE__ */ React42.createElement(
|
|
3904
3919
|
RadixScrollArea.Viewport,
|
|
3905
3920
|
{
|
|
3906
3921
|
className: "w-full h-full [&>div]:block",
|
|
3907
|
-
ref:
|
|
3922
|
+
ref: React42.useCallback(
|
|
3908
3923
|
(ref) => setScrollElementRef(ref),
|
|
3909
3924
|
[]
|
|
3910
3925
|
)
|
|
3911
3926
|
},
|
|
3912
3927
|
typeof children === "function" ? scrollElementRef ? children(scrollElementRef) : null : children
|
|
3913
|
-
), /* @__PURE__ */
|
|
3928
|
+
), /* @__PURE__ */ React42.createElement(
|
|
3914
3929
|
RadixScrollArea.Scrollbar,
|
|
3915
3930
|
{
|
|
3916
3931
|
orientation: "vertical",
|
|
3917
3932
|
className: "scroll-component flex p-[3px] data-[orientation=vertical]:w-[10px]"
|
|
3918
3933
|
},
|
|
3919
|
-
/* @__PURE__ */
|
|
3934
|
+
/* @__PURE__ */ React42.createElement(RadixScrollArea.Thumb, { className: "scroll-component flex-1 rounded-[10px] bg-scrollbar" })
|
|
3920
3935
|
)));
|
|
3921
3936
|
});
|
|
3922
3937
|
|
|
@@ -3925,7 +3940,7 @@ var ItemTitle = ({
|
|
|
3925
3940
|
showBackground,
|
|
3926
3941
|
children
|
|
3927
3942
|
}) => {
|
|
3928
|
-
return /* @__PURE__ */
|
|
3943
|
+
return /* @__PURE__ */ React43.createElement(
|
|
3929
3944
|
"span",
|
|
3930
3945
|
{
|
|
3931
3946
|
className: cx(
|
|
@@ -3940,7 +3955,7 @@ var ItemDescription = ({
|
|
|
3940
3955
|
showBackground,
|
|
3941
3956
|
children
|
|
3942
3957
|
}) => {
|
|
3943
|
-
return /* @__PURE__ */
|
|
3958
|
+
return /* @__PURE__ */ React43.createElement(
|
|
3944
3959
|
"span",
|
|
3945
3960
|
{
|
|
3946
3961
|
className: cx(
|
|
@@ -3955,7 +3970,7 @@ var SectionTitle = ({
|
|
|
3955
3970
|
last = false,
|
|
3956
3971
|
children
|
|
3957
3972
|
}) => {
|
|
3958
|
-
return /* @__PURE__ */
|
|
3973
|
+
return /* @__PURE__ */ React43.createElement(
|
|
3959
3974
|
"span",
|
|
3960
3975
|
{
|
|
3961
3976
|
className: `font-sans text-heading3 font-medium user-select-none truncate ${last ? "text-text" : "text-text-muted"}`
|
|
@@ -4011,7 +4026,7 @@ var GridViewItem = forwardRefGeneric(function GridViewItem2({
|
|
|
4011
4026
|
},
|
|
4012
4027
|
[onSelect, onKeyDown]
|
|
4013
4028
|
);
|
|
4014
|
-
let element = /* @__PURE__ */
|
|
4029
|
+
let element = /* @__PURE__ */ React43.createElement(
|
|
4015
4030
|
"div",
|
|
4016
4031
|
{
|
|
4017
4032
|
...props,
|
|
@@ -4034,7 +4049,7 @@ var GridViewItem = forwardRefGeneric(function GridViewItem2({
|
|
|
4034
4049
|
onDoubleClick,
|
|
4035
4050
|
onContextMenu
|
|
4036
4051
|
},
|
|
4037
|
-
/* @__PURE__ */
|
|
4052
|
+
/* @__PURE__ */ React43.createElement(
|
|
4038
4053
|
"div",
|
|
4039
4054
|
{
|
|
4040
4055
|
className: cx(
|
|
@@ -4045,13 +4060,13 @@ var GridViewItem = forwardRefGeneric(function GridViewItem2({
|
|
|
4045
4060
|
},
|
|
4046
4061
|
children
|
|
4047
4062
|
),
|
|
4048
|
-
textPosition === "below" && /* @__PURE__ */
|
|
4049
|
-
textPosition === "overlay" && hovered && (title || subtitle) && /* @__PURE__ */
|
|
4050
|
-
action && /* @__PURE__ */
|
|
4051
|
-
loading && /* @__PURE__ */
|
|
4063
|
+
textPosition === "below" && /* @__PURE__ */ React43.createElement(React43.Fragment, null, /* @__PURE__ */ React43.createElement(Spacer.Vertical, { size: 8 }), /* @__PURE__ */ React43.createElement(ItemTitle, null, title || " "), /* @__PURE__ */ React43.createElement(Spacer.Vertical, { size: 2 }), /* @__PURE__ */ React43.createElement(ItemDescription, null, subtitle || " ")),
|
|
4064
|
+
textPosition === "overlay" && hovered && (title || subtitle) && /* @__PURE__ */ React43.createElement("div", { className: "absolute inset-0 flex flex-col justify-end items-start p-1 pointer-events-none truncate gap-0.5" }, title && /* @__PURE__ */ React43.createElement(ItemTitle, { showBackground: true }, title), subtitle && /* @__PURE__ */ React43.createElement(ItemDescription, { showBackground: true }, subtitle)),
|
|
4065
|
+
action && /* @__PURE__ */ React43.createElement("div", { className: "absolute top-[7px] right-[7px] flex flex-col justify-end items-start p-1 truncate gap-0.5" }, action),
|
|
4066
|
+
loading && /* @__PURE__ */ React43.createElement("div", { className: "flex flex-col justify-start items-end p-1 pointer-events-none animate-shimmer absolute inset-0 bg-gradient-to-r from-white/0 via-[rgb(226,232,240)]/50 to-white/0 bg-length:200%_100%]" }, /* @__PURE__ */ React43.createElement(ActivityIndicator, { opacity: 0.5, size: 13 }))
|
|
4052
4067
|
);
|
|
4053
4068
|
if (menuItems && onSelectMenuItem) {
|
|
4054
|
-
element = /* @__PURE__ */
|
|
4069
|
+
element = /* @__PURE__ */ React43.createElement(
|
|
4055
4070
|
ContextMenu,
|
|
4056
4071
|
{
|
|
4057
4072
|
items: menuItems,
|
|
@@ -4062,10 +4077,10 @@ var GridViewItem = forwardRefGeneric(function GridViewItem2({
|
|
|
4062
4077
|
);
|
|
4063
4078
|
}
|
|
4064
4079
|
if (textPosition === "toolip") {
|
|
4065
|
-
element = /* @__PURE__ */
|
|
4080
|
+
element = /* @__PURE__ */ React43.createElement(
|
|
4066
4081
|
Tooltip,
|
|
4067
4082
|
{
|
|
4068
|
-
content: /* @__PURE__ */
|
|
4083
|
+
content: /* @__PURE__ */ React43.createElement("div", { className: "flex flex-col gap-0.5" }, /* @__PURE__ */ React43.createElement(ItemTitle, null, title), /* @__PURE__ */ React43.createElement(ItemDescription, null, subtitle))
|
|
4069
4084
|
},
|
|
4070
4085
|
element
|
|
4071
4086
|
);
|
|
@@ -4120,8 +4135,8 @@ var GridViewRoot = forwardRef18(function GridViewRoot2({
|
|
|
4120
4135
|
categories: ["flex"]
|
|
4121
4136
|
});
|
|
4122
4137
|
}, [className, scrollable]);
|
|
4123
|
-
const content = /* @__PURE__ */
|
|
4124
|
-
return /* @__PURE__ */
|
|
4138
|
+
const content = /* @__PURE__ */ React43.createElement("div", { className: cx("p-3", contentClassName) }, children);
|
|
4139
|
+
return /* @__PURE__ */ React43.createElement(GridViewContext.Provider, { value: contextValue }, /* @__PURE__ */ React43.createElement(
|
|
4125
4140
|
"div",
|
|
4126
4141
|
{
|
|
4127
4142
|
onClick: handleClick,
|
|
@@ -4129,7 +4144,7 @@ var GridViewRoot = forwardRef18(function GridViewRoot2({
|
|
|
4129
4144
|
...props,
|
|
4130
4145
|
ref: forwardedRef
|
|
4131
4146
|
},
|
|
4132
|
-
scrollable ? /* @__PURE__ */
|
|
4147
|
+
scrollable ? /* @__PURE__ */ React43.createElement(ScrollArea, null, content) : content
|
|
4133
4148
|
));
|
|
4134
4149
|
});
|
|
4135
4150
|
function GridViewSection({
|
|
@@ -4142,8 +4157,8 @@ function GridViewSection({
|
|
|
4142
4157
|
gridTemplateColumns: `repeat(auto-fill, minmax(${minColumnWidth}, 1fr))`,
|
|
4143
4158
|
gap: `${gap}px`
|
|
4144
4159
|
};
|
|
4145
|
-
const isEmpty =
|
|
4146
|
-
return isEmpty && renderEmptyState ? renderEmptyState() : /* @__PURE__ */
|
|
4160
|
+
const isEmpty = React43.Children.count(children) === 0;
|
|
4161
|
+
return isEmpty && renderEmptyState ? renderEmptyState() : /* @__PURE__ */ React43.createElement(
|
|
4147
4162
|
"div",
|
|
4148
4163
|
{
|
|
4149
4164
|
role: "presentation",
|
|
@@ -4155,9 +4170,9 @@ function GridViewSection({
|
|
|
4155
4170
|
}
|
|
4156
4171
|
function GridViewSectionHeader({ title }) {
|
|
4157
4172
|
const grouped = title.split("/");
|
|
4158
|
-
return /* @__PURE__ */
|
|
4159
|
-
grouped.map((title2, index) => /* @__PURE__ */
|
|
4160
|
-
/* @__PURE__ */
|
|
4173
|
+
return /* @__PURE__ */ React43.createElement("div", { className: "px-5" }, /* @__PURE__ */ React43.createElement(Spacer.Vertical, { size: 24 }), withSeparatorElements(
|
|
4174
|
+
grouped.map((title2, index) => /* @__PURE__ */ React43.createElement(SectionTitle, { last: index === grouped.length - 1 }, title2)),
|
|
4175
|
+
/* @__PURE__ */ React43.createElement(SectionTitle, null, " / ")
|
|
4161
4176
|
));
|
|
4162
4177
|
}
|
|
4163
4178
|
var GridView;
|
|
@@ -4272,7 +4287,7 @@ var Grid = memoGeneric(
|
|
|
4272
4287
|
onFilesDrop
|
|
4273
4288
|
);
|
|
4274
4289
|
const { minColumnWidth, gap } = getGridSize(size2);
|
|
4275
|
-
return /* @__PURE__ */
|
|
4290
|
+
return /* @__PURE__ */ React44.createElement(
|
|
4276
4291
|
GridView.Root,
|
|
4277
4292
|
{
|
|
4278
4293
|
role: "listbox",
|
|
@@ -4289,7 +4304,7 @@ var Grid = memoGeneric(
|
|
|
4289
4304
|
...dropTargetProps,
|
|
4290
4305
|
ref: fileDropTargetRef
|
|
4291
4306
|
},
|
|
4292
|
-
items.length > 0 ? /* @__PURE__ */
|
|
4307
|
+
items.length > 0 ? /* @__PURE__ */ React44.createElement(GridView.Section, null, items.map((item) => {
|
|
4293
4308
|
const id = getId(item);
|
|
4294
4309
|
const isDropdownOpen = dropdownOpenId === id;
|
|
4295
4310
|
const isHovered = testHoveredId === id || currentHoveredId === id || isDropdownOpen;
|
|
@@ -4308,7 +4323,7 @@ var Grid = memoGeneric(
|
|
|
4308
4323
|
handleSelect(id);
|
|
4309
4324
|
}
|
|
4310
4325
|
};
|
|
4311
|
-
const action = (isHovered || isSelected) && !isRenaming && (typeof renderAction === "function" ? renderAction({ item, selected: isSelected, onOpenChange }) : renderAction === "menu" && menuItems && /* @__PURE__ */
|
|
4326
|
+
const action = (isHovered || isSelected) && !isRenaming && (typeof renderAction === "function" ? renderAction({ item, selected: isSelected, onOpenChange }) : renderAction === "menu" && menuItems && /* @__PURE__ */ React44.createElement(
|
|
4312
4327
|
ActionMenu,
|
|
4313
4328
|
{
|
|
4314
4329
|
menuItems,
|
|
@@ -4317,7 +4332,7 @@ var Grid = memoGeneric(
|
|
|
4317
4332
|
onOpenChange
|
|
4318
4333
|
}
|
|
4319
4334
|
));
|
|
4320
|
-
return /* @__PURE__ */
|
|
4335
|
+
return /* @__PURE__ */ React44.createElement(
|
|
4321
4336
|
GridView.Item,
|
|
4322
4337
|
{
|
|
4323
4338
|
key: id,
|
|
@@ -4330,7 +4345,7 @@ var Grid = memoGeneric(
|
|
|
4330
4345
|
onHoverChange: (isHovering) => {
|
|
4331
4346
|
setHoveredId(isHovering ? id : void 0);
|
|
4332
4347
|
},
|
|
4333
|
-
title: /* @__PURE__ */
|
|
4348
|
+
title: /* @__PURE__ */ React44.createElement(
|
|
4334
4349
|
EditableText,
|
|
4335
4350
|
{
|
|
4336
4351
|
tabIndex: isRenaming ? void 0 : -1,
|
|
@@ -4347,7 +4362,7 @@ var Grid = memoGeneric(
|
|
|
4347
4362
|
},
|
|
4348
4363
|
textClassName: "bg-listview-editing-background max-h-input-height"
|
|
4349
4364
|
},
|
|
4350
|
-
(props2) => /* @__PURE__ */
|
|
4365
|
+
(props2) => /* @__PURE__ */ React44.createElement(
|
|
4351
4366
|
"span",
|
|
4352
4367
|
{
|
|
4353
4368
|
...props2,
|
|
@@ -4358,7 +4373,7 @@ var Grid = memoGeneric(
|
|
|
4358
4373
|
}
|
|
4359
4374
|
)
|
|
4360
4375
|
),
|
|
4361
|
-
subtitle: /* @__PURE__ */
|
|
4376
|
+
subtitle: /* @__PURE__ */ React44.createElement(
|
|
4362
4377
|
"span",
|
|
4363
4378
|
{
|
|
4364
4379
|
className: cx(
|
|
@@ -4392,7 +4407,7 @@ var Grid = memoGeneric(
|
|
|
4392
4407
|
}
|
|
4393
4408
|
}
|
|
4394
4409
|
},
|
|
4395
|
-
thumbnail && /* @__PURE__ */
|
|
4410
|
+
thumbnail && /* @__PURE__ */ React44.createElement(
|
|
4396
4411
|
"div",
|
|
4397
4412
|
{
|
|
4398
4413
|
className: cx(
|
|
@@ -4410,12 +4425,12 @@ var Grid = memoGeneric(
|
|
|
4410
4425
|
);
|
|
4411
4426
|
|
|
4412
4427
|
// src/components/List.tsx
|
|
4413
|
-
import
|
|
4428
|
+
import React51, { memo as memo19, useImperativeHandle as useImperativeHandle5, useRef as useRef20, useState as useState23 } from "react";
|
|
4414
4429
|
|
|
4415
4430
|
// src/components/ListView.tsx
|
|
4416
4431
|
import { range } from "@noya-app/noya-utils";
|
|
4417
4432
|
import { composeRefs as composeRefs2 } from "@radix-ui/react-compose-refs";
|
|
4418
|
-
import
|
|
4433
|
+
import React49, {
|
|
4419
4434
|
Children as Children3,
|
|
4420
4435
|
createContext as createContext11,
|
|
4421
4436
|
forwardRef as forwardRef19,
|
|
@@ -4424,7 +4439,7 @@ import React48, {
|
|
|
4424
4439
|
useCallback as useCallback23,
|
|
4425
4440
|
useContext as useContext11,
|
|
4426
4441
|
useImperativeHandle as useImperativeHandle4,
|
|
4427
|
-
useLayoutEffect as
|
|
4442
|
+
useLayoutEffect as useLayoutEffect6,
|
|
4428
4443
|
useMemo as useMemo21,
|
|
4429
4444
|
useRef as useRef19
|
|
4430
4445
|
} from "react";
|
|
@@ -4462,13 +4477,13 @@ import {
|
|
|
4462
4477
|
useSortable,
|
|
4463
4478
|
verticalListSortingStrategy
|
|
4464
4479
|
} from "@dnd-kit/sortable";
|
|
4465
|
-
import * as
|
|
4480
|
+
import * as React48 from "react";
|
|
4466
4481
|
|
|
4467
4482
|
// src/components/sorting/DragRegistration.tsx
|
|
4468
|
-
import
|
|
4469
|
-
var DragRegistrationContext =
|
|
4483
|
+
import React45 from "react";
|
|
4484
|
+
var DragRegistrationContext = React45.createContext(null);
|
|
4470
4485
|
function useDragRegistration(context) {
|
|
4471
|
-
const value =
|
|
4486
|
+
const value = React45.useContext(context);
|
|
4472
4487
|
if (!value) {
|
|
4473
4488
|
throw new Error(
|
|
4474
4489
|
"useDragRegistration must be used within a DragRegistrationProvider"
|
|
@@ -4477,11 +4492,11 @@ function useDragRegistration(context) {
|
|
|
4477
4492
|
return value;
|
|
4478
4493
|
}
|
|
4479
4494
|
function useDragRegistrationManager() {
|
|
4480
|
-
const [registeredLists, setRegisteredLists] =
|
|
4481
|
-
const registerList =
|
|
4495
|
+
const [registeredLists, setRegisteredLists] = React45.useState(/* @__PURE__ */ new Map());
|
|
4496
|
+
const registerList = React45.useCallback((list) => {
|
|
4482
4497
|
setRegisteredLists((prev) => new Map(prev).set(list.id, list));
|
|
4483
4498
|
}, []);
|
|
4484
|
-
const unregisterList =
|
|
4499
|
+
const unregisterList = React45.useCallback((listId) => {
|
|
4485
4500
|
setRegisteredLists((prev) => {
|
|
4486
4501
|
const newMap = new Map(prev);
|
|
4487
4502
|
newMap.delete(listId);
|
|
@@ -4490,15 +4505,15 @@ function useDragRegistrationManager() {
|
|
|
4490
4505
|
}, []);
|
|
4491
4506
|
return { registerList, unregisterList, registeredLists };
|
|
4492
4507
|
}
|
|
4493
|
-
var ActiveDragContext =
|
|
4508
|
+
var ActiveDragContext = React45.createContext(null);
|
|
4494
4509
|
function useActiveDrag(context) {
|
|
4495
|
-
const value =
|
|
4510
|
+
const value = React45.useContext(context);
|
|
4496
4511
|
if (!value) {
|
|
4497
4512
|
throw new Error("useActiveDrag must be used within a ActiveDragProvider");
|
|
4498
4513
|
}
|
|
4499
4514
|
return value;
|
|
4500
4515
|
}
|
|
4501
|
-
var AnyDragContext =
|
|
4516
|
+
var AnyDragContext = React45.createContext(false);
|
|
4502
4517
|
|
|
4503
4518
|
// src/components/sorting/SharedDragProvider.tsx
|
|
4504
4519
|
import {
|
|
@@ -4510,11 +4525,14 @@ import {
|
|
|
4510
4525
|
useSensor,
|
|
4511
4526
|
useSensors
|
|
4512
4527
|
} from "@dnd-kit/core";
|
|
4513
|
-
import
|
|
4528
|
+
import { rectContainsPoint, unionRects } from "@noya-app/noya-geometry";
|
|
4529
|
+
import { windowsOf } from "@noya-app/noya-utils";
|
|
4530
|
+
import * as React46 from "react";
|
|
4514
4531
|
import { useMemo as useMemo19 } from "react";
|
|
4515
4532
|
import { createPortal as createPortal2 } from "react-dom";
|
|
4516
4533
|
function SharedDragProvider({
|
|
4517
4534
|
children,
|
|
4535
|
+
onMoveItem,
|
|
4518
4536
|
sharedDragProps = {
|
|
4519
4537
|
dragRegistrationContext: DragRegistrationContext,
|
|
4520
4538
|
activeDragContext: ActiveDragContext
|
|
@@ -4528,14 +4546,14 @@ function SharedDragProvider({
|
|
|
4528
4546
|
})
|
|
4529
4547
|
);
|
|
4530
4548
|
const mounted = useMounted();
|
|
4531
|
-
const [dragState, setDragState] =
|
|
4549
|
+
const [dragState, setDragState] = React46.useState({
|
|
4532
4550
|
source: null,
|
|
4533
4551
|
target: null,
|
|
4534
4552
|
indicator: null
|
|
4535
4553
|
});
|
|
4536
4554
|
const { registerList, unregisterList, registeredLists } = useDragRegistrationManager();
|
|
4537
|
-
const activatorEventRef =
|
|
4538
|
-
const handleDragStart =
|
|
4555
|
+
const activatorEventRef = React46.useRef(null);
|
|
4556
|
+
const handleDragStart = React46.useCallback(
|
|
4539
4557
|
(event) => {
|
|
4540
4558
|
activatorEventRef.current = event.activatorEvent;
|
|
4541
4559
|
for (const [listId, list] of registeredLists) {
|
|
@@ -4557,7 +4575,7 @@ function SharedDragProvider({
|
|
|
4557
4575
|
},
|
|
4558
4576
|
[registeredLists]
|
|
4559
4577
|
);
|
|
4560
|
-
const handleDragMove =
|
|
4578
|
+
const handleDragMove = React46.useCallback(
|
|
4561
4579
|
(event) => {
|
|
4562
4580
|
const { active, over } = event;
|
|
4563
4581
|
if (!activatorEventRef.current || !dragState.source) return;
|
|
@@ -4580,7 +4598,8 @@ function SharedDragProvider({
|
|
|
4580
4598
|
},
|
|
4581
4599
|
[registeredLists, dragState.source]
|
|
4582
4600
|
);
|
|
4583
|
-
const
|
|
4601
|
+
const stableOnMoveItem = useStableCallback(onMoveItem);
|
|
4602
|
+
const handleDragEnd = React46.useCallback(
|
|
4584
4603
|
(event) => {
|
|
4585
4604
|
const { active, over } = event;
|
|
4586
4605
|
if (!activatorEventRef.current || !dragState.source) return;
|
|
@@ -4605,17 +4624,22 @@ function SharedDragProvider({
|
|
|
4605
4624
|
const sourceList = registeredLists.get(dropTarget.source.listId);
|
|
4606
4625
|
const targetList = registeredLists.get(dropTarget.target.listId);
|
|
4607
4626
|
if (!sourceList || !targetList) return;
|
|
4608
|
-
|
|
4609
|
-
dropTarget.source.index,
|
|
4610
|
-
dropTarget.target.index,
|
|
4611
|
-
dropTarget.indicator,
|
|
4612
|
-
dropTarget.source.listId,
|
|
4613
|
-
dropTarget.target.listId
|
|
4614
|
-
|
|
4627
|
+
const parameters = {
|
|
4628
|
+
sourceIndex: dropTarget.source.index,
|
|
4629
|
+
targetIndex: dropTarget.target.index,
|
|
4630
|
+
position: dropTarget.indicator,
|
|
4631
|
+
sourceListId: dropTarget.source.listId,
|
|
4632
|
+
targetListId: dropTarget.target.listId
|
|
4633
|
+
};
|
|
4634
|
+
sourceList.onMoveItem(parameters);
|
|
4635
|
+
if (dropTarget.target.listId !== dropTarget.source.listId) {
|
|
4636
|
+
targetList.onMoveItem(parameters);
|
|
4637
|
+
}
|
|
4638
|
+
stableOnMoveItem?.(parameters);
|
|
4615
4639
|
},
|
|
4616
|
-
[registeredLists, dragState.source]
|
|
4640
|
+
[registeredLists, dragState.source, stableOnMoveItem]
|
|
4617
4641
|
);
|
|
4618
|
-
const contextValue =
|
|
4642
|
+
const contextValue = React46.useMemo(
|
|
4619
4643
|
() => ({
|
|
4620
4644
|
registerList,
|
|
4621
4645
|
unregisterList
|
|
@@ -4623,19 +4647,19 @@ function SharedDragProvider({
|
|
|
4623
4647
|
[registerList, unregisterList]
|
|
4624
4648
|
);
|
|
4625
4649
|
const activeList = dragState.source ? registeredLists.get(dragState.source.listId) : null;
|
|
4626
|
-
const activeDragContextValue =
|
|
4650
|
+
const activeDragContextValue = React46.useMemo(
|
|
4627
4651
|
() => dragState,
|
|
4628
4652
|
[dragState]
|
|
4629
4653
|
);
|
|
4630
4654
|
const collisionDetection = useMemo19(() => {
|
|
4631
|
-
return getItemFirstCollisionDetection(
|
|
4655
|
+
return getItemFirstCollisionDetection(registeredLists);
|
|
4632
4656
|
}, [registeredLists]);
|
|
4633
|
-
return /* @__PURE__ */
|
|
4657
|
+
return /* @__PURE__ */ React46.createElement(AnyDragContext.Provider, { value: true }, /* @__PURE__ */ React46.createElement(sharedDragProps.dragRegistrationContext.Provider, { value: contextValue }, /* @__PURE__ */ React46.createElement(
|
|
4634
4658
|
sharedDragProps.activeDragContext.Provider,
|
|
4635
4659
|
{
|
|
4636
4660
|
value: activeDragContextValue
|
|
4637
4661
|
},
|
|
4638
|
-
/* @__PURE__ */
|
|
4662
|
+
/* @__PURE__ */ React46.createElement(
|
|
4639
4663
|
DndContext,
|
|
4640
4664
|
{
|
|
4641
4665
|
sensors,
|
|
@@ -4646,33 +4670,33 @@ function SharedDragProvider({
|
|
|
4646
4670
|
},
|
|
4647
4671
|
children,
|
|
4648
4672
|
mounted && activeList?.renderOverlay && dragState.source && createPortal2(
|
|
4649
|
-
/* @__PURE__ */
|
|
4673
|
+
/* @__PURE__ */ React46.createElement(DragOverlay, { dropAnimation: null }, activeList.renderOverlay(dragState.source.itemId)),
|
|
4650
4674
|
document.body
|
|
4651
4675
|
)
|
|
4652
4676
|
)
|
|
4653
4677
|
)));
|
|
4654
4678
|
}
|
|
4655
4679
|
function useMounted() {
|
|
4656
|
-
const [mounted, setMounted] =
|
|
4657
|
-
|
|
4680
|
+
const [mounted, setMounted] = React46.useState(false);
|
|
4681
|
+
React46.useEffect(() => {
|
|
4658
4682
|
setMounted(true);
|
|
4659
4683
|
}, []);
|
|
4660
4684
|
return mounted;
|
|
4661
4685
|
}
|
|
4662
4686
|
function withDragProvider(Component) {
|
|
4663
4687
|
return function WithDragProvider(props) {
|
|
4664
|
-
const anyDragContext =
|
|
4688
|
+
const anyDragContext = React46.useContext(AnyDragContext);
|
|
4665
4689
|
if (!anyDragContext) {
|
|
4666
|
-
return /* @__PURE__ */
|
|
4690
|
+
return /* @__PURE__ */ React46.createElement(SharedDragProvider, null, /* @__PURE__ */ React46.createElement(Component, { ...props }));
|
|
4667
4691
|
}
|
|
4668
|
-
return /* @__PURE__ */
|
|
4692
|
+
return /* @__PURE__ */ React46.createElement(Component, { ...props });
|
|
4669
4693
|
};
|
|
4670
4694
|
}
|
|
4671
|
-
var getItemFirstCollisionDetection = (
|
|
4695
|
+
var getItemFirstCollisionDetection = (registeredLists) => (parameters) => {
|
|
4672
4696
|
const pointerCollisions = pointerWithin(parameters);
|
|
4673
4697
|
if (pointerCollisions.length > 0) {
|
|
4674
4698
|
const itemCollisions = pointerCollisions.filter((collision) => {
|
|
4675
|
-
for (const listId of
|
|
4699
|
+
for (const listId of registeredLists.keys()) {
|
|
4676
4700
|
if (collision.id === listId) {
|
|
4677
4701
|
return false;
|
|
4678
4702
|
}
|
|
@@ -4683,7 +4707,33 @@ var getItemFirstCollisionDetection = (registeredListIds) => (parameters) => {
|
|
|
4683
4707
|
return itemCollisions;
|
|
4684
4708
|
}
|
|
4685
4709
|
}
|
|
4686
|
-
|
|
4710
|
+
const listCollision = pointerCollisions.at(0);
|
|
4711
|
+
const nearestCenters = closestCenter(parameters);
|
|
4712
|
+
if (parameters.pointerCoordinates && listCollision) {
|
|
4713
|
+
const list = registeredLists.get(listCollision.id);
|
|
4714
|
+
if (list) {
|
|
4715
|
+
const pairs = windowsOf(list.keys, 2);
|
|
4716
|
+
for (const pair of pairs) {
|
|
4717
|
+
const clientRects = pair.map(
|
|
4718
|
+
(key) => parameters.droppableRects.get(key)
|
|
4719
|
+
);
|
|
4720
|
+
const merged = unionRects(
|
|
4721
|
+
...clientRects.map((rect) => ({
|
|
4722
|
+
x: rect.left,
|
|
4723
|
+
y: rect.top,
|
|
4724
|
+
width: rect.width,
|
|
4725
|
+
height: rect.height
|
|
4726
|
+
}))
|
|
4727
|
+
);
|
|
4728
|
+
if (rectContainsPoint(merged, parameters.pointerCoordinates)) {
|
|
4729
|
+
return nearestCenters.filter(
|
|
4730
|
+
(center) => pair.some((id) => id === center.id)
|
|
4731
|
+
);
|
|
4732
|
+
}
|
|
4733
|
+
}
|
|
4734
|
+
}
|
|
4735
|
+
}
|
|
4736
|
+
return pointerCollisions;
|
|
4687
4737
|
};
|
|
4688
4738
|
function findDropTarget({
|
|
4689
4739
|
activationPoint,
|
|
@@ -4718,14 +4768,14 @@ function findDropTarget({
|
|
|
4718
4768
|
return;
|
|
4719
4769
|
}
|
|
4720
4770
|
if (over.id === targetList.id) {
|
|
4721
|
-
const canDrop = targetList.acceptsDrop(
|
|
4722
|
-
source.index,
|
|
4723
|
-
Math.max(0, targetList.keys.length - 1),
|
|
4771
|
+
const canDrop = targetList.acceptsDrop({
|
|
4772
|
+
sourceIndex: source.index,
|
|
4773
|
+
targetIndex: Math.max(0, targetList.keys.length - 1),
|
|
4724
4774
|
// Use last valid index or 0 for empty lists
|
|
4725
|
-
"below",
|
|
4726
|
-
sourceList.id,
|
|
4727
|
-
targetList.id
|
|
4728
|
-
);
|
|
4775
|
+
position: "below",
|
|
4776
|
+
sourceListId: sourceList.id,
|
|
4777
|
+
targetListId: targetList.id
|
|
4778
|
+
});
|
|
4729
4779
|
if (canDrop) {
|
|
4730
4780
|
return {
|
|
4731
4781
|
source,
|
|
@@ -4764,11 +4814,15 @@ function findDropTarget({
|
|
|
4764
4814
|
}
|
|
4765
4815
|
|
|
4766
4816
|
// src/components/sorting/sorting.ts
|
|
4767
|
-
import * as
|
|
4817
|
+
import * as React47 from "react";
|
|
4768
4818
|
var normalizeListTargetIndex = (index, position) => {
|
|
4769
4819
|
return position === "above" ? index : index + 1;
|
|
4770
4820
|
};
|
|
4771
|
-
var defaultAcceptsDrop = (
|
|
4821
|
+
var defaultAcceptsDrop = ({
|
|
4822
|
+
sourceIndex,
|
|
4823
|
+
targetIndex,
|
|
4824
|
+
position
|
|
4825
|
+
}) => {
|
|
4772
4826
|
if (position === "inside") return false;
|
|
4773
4827
|
const normalized = normalizeListTargetIndex(targetIndex, position);
|
|
4774
4828
|
if (sourceIndex === normalized || sourceIndex + 1 === normalized) {
|
|
@@ -4776,7 +4830,7 @@ var defaultAcceptsDrop = (sourceIndex, targetIndex, position) => {
|
|
|
4776
4830
|
}
|
|
4777
4831
|
return true;
|
|
4778
4832
|
};
|
|
4779
|
-
var SortableItemContext =
|
|
4833
|
+
var SortableItemContext = React47.createContext({
|
|
4780
4834
|
keys: [],
|
|
4781
4835
|
acceptsDrop: defaultAcceptsDrop,
|
|
4782
4836
|
axis: "y",
|
|
@@ -4801,13 +4855,13 @@ function validateDropIndicator({
|
|
|
4801
4855
|
const overIndex = keys.findIndex((id) => id === overId);
|
|
4802
4856
|
if (overIndex === -1) return void 0;
|
|
4803
4857
|
if (activeIndex === -1 && sourceListId === targetListId) return void 0;
|
|
4804
|
-
const acceptsDropInside = acceptsDrop2(
|
|
4805
|
-
activeIndex,
|
|
4806
|
-
overIndex,
|
|
4807
|
-
"inside",
|
|
4858
|
+
const acceptsDropInside = acceptsDrop2({
|
|
4859
|
+
sourceIndex: activeIndex,
|
|
4860
|
+
targetIndex: overIndex,
|
|
4861
|
+
position: "inside",
|
|
4808
4862
|
sourceListId,
|
|
4809
4863
|
targetListId
|
|
4810
|
-
);
|
|
4864
|
+
});
|
|
4811
4865
|
if (isContainedInMiddleThird(elementStart, elementSize, offsetStart) && acceptsDropInside) {
|
|
4812
4866
|
return "inside";
|
|
4813
4867
|
}
|
|
@@ -4816,16 +4870,13 @@ function validateDropIndicator({
|
|
|
4816
4870
|
elementSize,
|
|
4817
4871
|
offsetStart
|
|
4818
4872
|
);
|
|
4819
|
-
|
|
4820
|
-
|
|
4821
|
-
|
|
4822
|
-
|
|
4823
|
-
activeIndex,
|
|
4824
|
-
overIndex,
|
|
4825
|
-
containingHalf,
|
|
4873
|
+
const acceptedHalf = acceptsDrop2({
|
|
4874
|
+
sourceIndex: activeIndex,
|
|
4875
|
+
targetIndex: overIndex,
|
|
4876
|
+
position: containingHalf,
|
|
4826
4877
|
sourceListId,
|
|
4827
4878
|
targetListId
|
|
4828
|
-
);
|
|
4879
|
+
});
|
|
4829
4880
|
return acceptedHalf ? containingHalf : (
|
|
4830
4881
|
// Lastly, check if inside but not middle third
|
|
4831
4882
|
acceptsDropInside ? "inside" : void 0
|
|
@@ -4834,23 +4885,21 @@ function validateDropIndicator({
|
|
|
4834
4885
|
function isContainedInMiddleThird(elementStart, elementSize, offsetStart) {
|
|
4835
4886
|
return offsetStart >= elementStart + elementSize / 3 && offsetStart <= elementStart + elementSize * 2 / 3;
|
|
4836
4887
|
}
|
|
4837
|
-
function isContained(elementStart, elementSize, offsetStart) {
|
|
4838
|
-
return offsetStart >= elementStart && offsetStart <= elementStart + elementSize;
|
|
4839
|
-
}
|
|
4840
4888
|
function getContainingHalf(elementStart, elementSize, offsetStart) {
|
|
4841
4889
|
if (offsetStart < elementStart + elementSize / 2) return "above";
|
|
4842
4890
|
return "below";
|
|
4843
4891
|
}
|
|
4892
|
+
var dragItemKeySeparator = "-~-";
|
|
4844
4893
|
function createDragItemKey(listId, itemId) {
|
|
4845
|
-
return `${listId}
|
|
4894
|
+
return `${listId}${dragItemKeySeparator}${itemId}`;
|
|
4846
4895
|
}
|
|
4847
4896
|
function parseDragItemKey(key) {
|
|
4848
|
-
const [listId, itemId] = key.split(
|
|
4897
|
+
const [listId, itemId] = key.split(dragItemKeySeparator);
|
|
4849
4898
|
return { listId, itemId };
|
|
4850
4899
|
}
|
|
4851
4900
|
|
|
4852
4901
|
// src/components/sorting/Sortable.tsx
|
|
4853
|
-
var SortableItemContext2 =
|
|
4902
|
+
var SortableItemContext2 = React48.createContext({
|
|
4854
4903
|
acceptsDrop: defaultAcceptsDrop,
|
|
4855
4904
|
listId: "",
|
|
4856
4905
|
getDropTargetParentIndex: void 0,
|
|
@@ -4863,42 +4912,44 @@ function useSortableDropIndicator({
|
|
|
4863
4912
|
acceptsDrop: acceptsDrop2,
|
|
4864
4913
|
getDropTargetParentIndex
|
|
4865
4914
|
}) {
|
|
4866
|
-
const { activeDragContext } =
|
|
4915
|
+
const { activeDragContext } = React48.useContext(SortableItemContext2);
|
|
4867
4916
|
const activeDrag = useActiveDrag(activeDragContext);
|
|
4868
4917
|
const { source, target } = activeDrag;
|
|
4869
4918
|
if (!source || !target) return;
|
|
4870
|
-
|
|
4919
|
+
if (target.listId === listId && target.itemId === itemId) {
|
|
4920
|
+
return activeDrag.indicator ?? void 0;
|
|
4921
|
+
}
|
|
4871
4922
|
const targetParentIndex = target.index === -1 ? void 0 : getDropTargetParentIndex?.(target.index);
|
|
4872
|
-
const isValidParent = targetParentIndex === void 0 || targetParentIndex === -1 ? false : acceptsDrop2(
|
|
4873
|
-
source.index,
|
|
4874
|
-
targetParentIndex,
|
|
4875
|
-
"inside",
|
|
4876
|
-
source.listId,
|
|
4877
|
-
target.listId
|
|
4878
|
-
);
|
|
4879
|
-
const overIdAcceptsDrop = target.index === -1 ? void 0 : acceptsDrop2(
|
|
4880
|
-
source.index,
|
|
4881
|
-
target.index,
|
|
4882
|
-
"inside",
|
|
4883
|
-
source.listId,
|
|
4884
|
-
target.listId
|
|
4885
|
-
);
|
|
4923
|
+
const isValidParent = targetParentIndex === void 0 || targetParentIndex === -1 ? false : acceptsDrop2({
|
|
4924
|
+
sourceIndex: source.index,
|
|
4925
|
+
targetIndex: targetParentIndex,
|
|
4926
|
+
position: "inside",
|
|
4927
|
+
sourceListId: source.listId,
|
|
4928
|
+
targetListId: target.listId
|
|
4929
|
+
});
|
|
4930
|
+
const overIdAcceptsDrop = target.index === -1 ? void 0 : acceptsDrop2({
|
|
4931
|
+
sourceIndex: source.index,
|
|
4932
|
+
targetIndex: target.index,
|
|
4933
|
+
position: "inside",
|
|
4934
|
+
sourceListId: source.listId,
|
|
4935
|
+
targetListId: target.listId
|
|
4936
|
+
});
|
|
4886
4937
|
const thisItemIsTargetParent = targetParentIndex === index;
|
|
4887
|
-
const
|
|
4888
|
-
return
|
|
4938
|
+
const showIndicatorOnParent = !overIdAcceptsDrop && isValidParent && thisItemIsTargetParent;
|
|
4939
|
+
return showIndicatorOnParent ? "inside" : void 0;
|
|
4889
4940
|
}
|
|
4890
4941
|
function SortableItem({
|
|
4891
4942
|
id,
|
|
4892
4943
|
disabled,
|
|
4893
4944
|
children
|
|
4894
4945
|
}) {
|
|
4895
|
-
const { acceptsDrop: acceptsDrop2, listId, getDropTargetParentIndex } =
|
|
4946
|
+
const { acceptsDrop: acceptsDrop2, listId, getDropTargetParentIndex } = React48.useContext(SortableItemContext2);
|
|
4896
4947
|
const dragItemKey = createDragItemKey(listId, id);
|
|
4897
4948
|
const { attributes, listeners, setNodeRef, isDragging, index } = useSortable({
|
|
4898
4949
|
id: dragItemKey,
|
|
4899
4950
|
disabled
|
|
4900
4951
|
});
|
|
4901
|
-
const ref =
|
|
4952
|
+
const ref = React48.useCallback(
|
|
4902
4953
|
(node) => setNodeRef(node),
|
|
4903
4954
|
[setNodeRef]
|
|
4904
4955
|
);
|
|
@@ -4932,24 +4983,18 @@ function SortableRoot_({
|
|
|
4932
4983
|
sharedDragProps,
|
|
4933
4984
|
containerRef
|
|
4934
4985
|
}) {
|
|
4935
|
-
const defaultId =
|
|
4986
|
+
const defaultId = React48.useId();
|
|
4936
4987
|
const id = idProp ?? defaultId;
|
|
4937
|
-
const keys =
|
|
4988
|
+
const keys = React48.useMemo(() => {
|
|
4938
4989
|
return keysProp.map((key) => createDragItemKey(id, key));
|
|
4939
4990
|
}, [keysProp, id]);
|
|
4940
4991
|
const { registerList, unregisterList } = useDragRegistration(
|
|
4941
4992
|
sharedDragProps?.dragRegistrationContext ?? DragRegistrationContext
|
|
4942
4993
|
);
|
|
4943
4994
|
const { setNodeRef: setDroppableRef } = useDroppable({
|
|
4944
|
-
id
|
|
4945
|
-
// Make the container droppable only when the list is empty
|
|
4946
|
-
// This avoids conflicts with individual sortable items.
|
|
4947
|
-
// This isn't strictly necessary since we also use a custom collision detection
|
|
4948
|
-
// that prioritizes items over containers, but it helps with dropping into
|
|
4949
|
-
// the best position (either above or below, rather than always below).
|
|
4950
|
-
disabled: keys.length > 0
|
|
4995
|
+
id
|
|
4951
4996
|
});
|
|
4952
|
-
|
|
4997
|
+
React48.useEffect(() => {
|
|
4953
4998
|
const listConfig = {
|
|
4954
4999
|
id,
|
|
4955
5000
|
keys,
|
|
@@ -4995,7 +5040,7 @@ function SortableRoot_({
|
|
|
4995
5040
|
unregisterList,
|
|
4996
5041
|
keys
|
|
4997
5042
|
]);
|
|
4998
|
-
const contextValue =
|
|
5043
|
+
const contextValue = React48.useMemo(
|
|
4999
5044
|
() => ({
|
|
5000
5045
|
keys,
|
|
5001
5046
|
acceptsDrop: acceptsDrop2,
|
|
@@ -5005,12 +5050,12 @@ function SortableRoot_({
|
|
|
5005
5050
|
}),
|
|
5006
5051
|
[keys, acceptsDrop2, id, getDropTargetParentIndex, sharedDragProps]
|
|
5007
5052
|
);
|
|
5008
|
-
|
|
5053
|
+
React48.useEffect(() => {
|
|
5009
5054
|
if (containerRef) {
|
|
5010
5055
|
setDroppableRef(containerRef.current);
|
|
5011
5056
|
}
|
|
5012
5057
|
});
|
|
5013
|
-
return /* @__PURE__ */
|
|
5058
|
+
return /* @__PURE__ */ React48.createElement(SortableItemContext2.Provider, { value: contextValue }, /* @__PURE__ */ React48.createElement(
|
|
5014
5059
|
SortableContext,
|
|
5015
5060
|
{
|
|
5016
5061
|
items: keys,
|
|
@@ -5027,11 +5072,11 @@ var Sortable_ = function Sortable_2({
|
|
|
5027
5072
|
renderItem,
|
|
5028
5073
|
...rest
|
|
5029
5074
|
}) {
|
|
5030
|
-
const keys =
|
|
5075
|
+
const keys = React48.useMemo(
|
|
5031
5076
|
() => items.map(keyExtractor),
|
|
5032
5077
|
[items, keyExtractor]
|
|
5033
5078
|
);
|
|
5034
|
-
const renderOverlay =
|
|
5079
|
+
const renderOverlay = React48.useCallback(
|
|
5035
5080
|
(index) => {
|
|
5036
5081
|
return renderItem(
|
|
5037
5082
|
items[index],
|
|
@@ -5051,14 +5096,14 @@ var Sortable_ = function Sortable_2({
|
|
|
5051
5096
|
},
|
|
5052
5097
|
[renderItem, items]
|
|
5053
5098
|
);
|
|
5054
|
-
return /* @__PURE__ */
|
|
5099
|
+
return /* @__PURE__ */ React48.createElement(
|
|
5055
5100
|
SortableRoot,
|
|
5056
5101
|
{
|
|
5057
5102
|
...rest,
|
|
5058
5103
|
keys,
|
|
5059
5104
|
renderOverlay: shouldRenderOverlay ? renderOverlay : void 0
|
|
5060
5105
|
},
|
|
5061
|
-
keys.map((key, index) => /* @__PURE__ */
|
|
5106
|
+
keys.map((key, index) => /* @__PURE__ */ React48.createElement(SortableItem, { key, id: key }, (props) => {
|
|
5062
5107
|
return renderItem(items[index], props, { isOverlay: false });
|
|
5063
5108
|
}))
|
|
5064
5109
|
);
|
|
@@ -5093,7 +5138,7 @@ var ListViewRowTitle = ({
|
|
|
5093
5138
|
className,
|
|
5094
5139
|
children,
|
|
5095
5140
|
...props
|
|
5096
|
-
}) => /* @__PURE__ */
|
|
5141
|
+
}) => /* @__PURE__ */ React49.createElement(
|
|
5097
5142
|
"span",
|
|
5098
5143
|
{
|
|
5099
5144
|
className: cx(
|
|
@@ -5113,7 +5158,7 @@ function ListViewEditableRowTitle({
|
|
|
5113
5158
|
onKeyDown
|
|
5114
5159
|
}) {
|
|
5115
5160
|
const inputRef = useRef19(null);
|
|
5116
|
-
|
|
5161
|
+
useLayoutEffect6(() => {
|
|
5117
5162
|
const element = inputRef.current;
|
|
5118
5163
|
if (!element || !autoFocus) return;
|
|
5119
5164
|
element.focus();
|
|
@@ -5121,7 +5166,7 @@ function ListViewEditableRowTitle({
|
|
|
5121
5166
|
element.select();
|
|
5122
5167
|
}, 1);
|
|
5123
5168
|
}, [autoFocus]);
|
|
5124
|
-
return /* @__PURE__ */
|
|
5169
|
+
return /* @__PURE__ */ React49.createElement(
|
|
5125
5170
|
InputField2.Input,
|
|
5126
5171
|
{
|
|
5127
5172
|
ref: inputRef,
|
|
@@ -5160,7 +5205,7 @@ var RowContainer = forwardRef19(
|
|
|
5160
5205
|
"aria-selected": ariaSelected,
|
|
5161
5206
|
...props
|
|
5162
5207
|
}, ref) => {
|
|
5163
|
-
return /* @__PURE__ */
|
|
5208
|
+
return /* @__PURE__ */ React49.createElement(
|
|
5164
5209
|
"div",
|
|
5165
5210
|
{
|
|
5166
5211
|
ref,
|
|
@@ -5238,7 +5283,7 @@ var ListViewDragIndicatorElement = forwardRef19(
|
|
|
5238
5283
|
style: style2,
|
|
5239
5284
|
...props
|
|
5240
5285
|
}, ref) => {
|
|
5241
|
-
return /* @__PURE__ */
|
|
5286
|
+
return /* @__PURE__ */ React49.createElement(
|
|
5242
5287
|
"div",
|
|
5243
5288
|
{
|
|
5244
5289
|
ref,
|
|
@@ -5339,7 +5384,7 @@ var ListViewRow = forwardRefGeneric(function ListViewRow2({
|
|
|
5339
5384
|
}, ref) => {
|
|
5340
5385
|
const Component = RowContainer;
|
|
5341
5386
|
const relativeDropPosition = testRelativeDropPosition ?? relativeDropPositionProp;
|
|
5342
|
-
const element = /* @__PURE__ */
|
|
5387
|
+
const element = /* @__PURE__ */ React49.createElement(
|
|
5343
5388
|
Component,
|
|
5344
5389
|
{
|
|
5345
5390
|
ref,
|
|
@@ -5373,7 +5418,7 @@ var ListViewRow = forwardRefGeneric(function ListViewRow2({
|
|
|
5373
5418
|
className,
|
|
5374
5419
|
$clickable: !!onPress
|
|
5375
5420
|
},
|
|
5376
|
-
relativeDropPosition && /* @__PURE__ */
|
|
5421
|
+
relativeDropPosition && /* @__PURE__ */ React49.createElement(
|
|
5377
5422
|
ListViewDragIndicatorElement,
|
|
5378
5423
|
{
|
|
5379
5424
|
key: relativeDropPosition,
|
|
@@ -5388,11 +5433,11 @@ var ListViewRow = forwardRefGeneric(function ListViewRow2({
|
|
|
5388
5433
|
}) : dragIndicatorStyle
|
|
5389
5434
|
}
|
|
5390
5435
|
),
|
|
5391
|
-
depth > 0 && /* @__PURE__ */
|
|
5436
|
+
depth > 0 && /* @__PURE__ */ React49.createElement(Spacer.Horizontal, { size: depth * indentation }),
|
|
5392
5437
|
children
|
|
5393
5438
|
);
|
|
5394
5439
|
if (menuItems && onSelectMenuItem) {
|
|
5395
|
-
return /* @__PURE__ */
|
|
5440
|
+
return /* @__PURE__ */ React49.createElement(
|
|
5396
5441
|
ContextMenu,
|
|
5397
5442
|
{
|
|
5398
5443
|
items: menuItems,
|
|
@@ -5405,7 +5450,7 @@ var ListViewRow = forwardRefGeneric(function ListViewRow2({
|
|
|
5405
5450
|
return element;
|
|
5406
5451
|
};
|
|
5407
5452
|
if (sortable && id) {
|
|
5408
|
-
return /* @__PURE__ */
|
|
5453
|
+
return /* @__PURE__ */ React49.createElement(Sortable.Item, { id, disabled: overrideSortable === false }, ({ ref: sortableRef, ...sortableProps }) => renderContent(
|
|
5409
5454
|
sortableProps,
|
|
5410
5455
|
composeRefs2(sortableRef, forwardedRef)
|
|
5411
5456
|
));
|
|
@@ -5421,7 +5466,7 @@ var VirtualizedListRow = memo18(function VirtualizedListRow2({
|
|
|
5421
5466
|
style: style2
|
|
5422
5467
|
}) {
|
|
5423
5468
|
const renderItem = useContext11(RenderItemContext);
|
|
5424
|
-
return /* @__PURE__ */
|
|
5469
|
+
return /* @__PURE__ */ React49.createElement("div", { key: index, style: style2 }, renderItem(index));
|
|
5425
5470
|
});
|
|
5426
5471
|
var VirtualizedListInner = forwardRefGeneric(function VirtualizedListInner2({
|
|
5427
5472
|
size: size2,
|
|
@@ -5437,7 +5482,7 @@ var VirtualizedListInner = forwardRefGeneric(function VirtualizedListInner2({
|
|
|
5437
5482
|
listRef.current?.scrollToItem(index);
|
|
5438
5483
|
}
|
|
5439
5484
|
}));
|
|
5440
|
-
|
|
5485
|
+
useLayoutEffect6(() => {
|
|
5441
5486
|
listRef.current?.resetAfterIndex(0);
|
|
5442
5487
|
}, [
|
|
5443
5488
|
// When items change, we need to re-render the virtualized list,
|
|
@@ -5452,7 +5497,7 @@ var VirtualizedListInner = forwardRefGeneric(function VirtualizedListInner2({
|
|
|
5452
5497
|
}),
|
|
5453
5498
|
[]
|
|
5454
5499
|
);
|
|
5455
|
-
return /* @__PURE__ */
|
|
5500
|
+
return /* @__PURE__ */ React49.createElement(RenderItemContext.Provider, { value: renderItem }, /* @__PURE__ */ React49.createElement(
|
|
5456
5501
|
WindowScroller,
|
|
5457
5502
|
{
|
|
5458
5503
|
scrollElement,
|
|
@@ -5463,7 +5508,7 @@ var VirtualizedListInner = forwardRefGeneric(function VirtualizedListInner2({
|
|
|
5463
5508
|
registerChild,
|
|
5464
5509
|
onChildScroll,
|
|
5465
5510
|
scrollTop
|
|
5466
|
-
}) => /* @__PURE__ */
|
|
5511
|
+
}) => /* @__PURE__ */ React49.createElement("div", { ref: registerChild }, /* @__PURE__ */ React49.createElement(
|
|
5467
5512
|
VariableSizeList,
|
|
5468
5513
|
{
|
|
5469
5514
|
ref: listRef,
|
|
@@ -5637,7 +5682,7 @@ var ListViewRootInner = forwardRefGeneric(function ListViewRootInner2({
|
|
|
5637
5682
|
[indentation]
|
|
5638
5683
|
);
|
|
5639
5684
|
const renderOverlay = useCallback23(
|
|
5640
|
-
(index) => /* @__PURE__ */
|
|
5685
|
+
(index) => /* @__PURE__ */ React49.createElement("div", { style: { opacity: 0.25 } }, /* @__PURE__ */ React49.createElement(ListViewDraggingContext.Provider, { value: draggingContextOverlayValue }, renderItem(data[index], index, { isDragOverlay: true }))),
|
|
5641
5686
|
[draggingContextOverlayValue, renderItem, data]
|
|
5642
5687
|
);
|
|
5643
5688
|
const renderWrappedChild = useCallback23(
|
|
@@ -5645,12 +5690,12 @@ var ListViewRootInner = forwardRefGeneric(function ListViewRootInner2({
|
|
|
5645
5690
|
const contextValue = getItemContextValue(index);
|
|
5646
5691
|
const current = renderChild(index);
|
|
5647
5692
|
if (!contextValue || !isValidElement3(current)) return null;
|
|
5648
|
-
return /* @__PURE__ */
|
|
5693
|
+
return /* @__PURE__ */ React49.createElement(ListRowContext.Provider, { key: current.key, value: contextValue }, current);
|
|
5649
5694
|
},
|
|
5650
5695
|
[getItemContextValue, renderChild]
|
|
5651
5696
|
);
|
|
5652
5697
|
const ids = useMemo21(() => data.map(keyExtractor), [keyExtractor, data]);
|
|
5653
|
-
const withSortable = (children) => sortable ? /* @__PURE__ */
|
|
5698
|
+
const withSortable = (children) => sortable ? /* @__PURE__ */ React49.createElement(
|
|
5654
5699
|
Sortable.Root,
|
|
5655
5700
|
{
|
|
5656
5701
|
id: sortableId,
|
|
@@ -5663,7 +5708,7 @@ var ListViewRootInner = forwardRefGeneric(function ListViewRootInner2({
|
|
|
5663
5708
|
},
|
|
5664
5709
|
children
|
|
5665
5710
|
) : children;
|
|
5666
|
-
const withScrollable = (children) => scrollable ? /* @__PURE__ */
|
|
5711
|
+
const withScrollable = (children) => scrollable ? /* @__PURE__ */ React49.createElement(ScrollArea, null, children) : children(null);
|
|
5667
5712
|
const getItemHeight = useCallback23(
|
|
5668
5713
|
(index) => {
|
|
5669
5714
|
const child = getItemContextValue(index);
|
|
@@ -5678,7 +5723,7 @@ var ListViewRootInner = forwardRefGeneric(function ListViewRootInner2({
|
|
|
5678
5723
|
);
|
|
5679
5724
|
const draggingContextValue = useMemo21(() => ({ indentation }), [indentation]);
|
|
5680
5725
|
const gapStyle = useMemo21(() => ({ gap: `${gap}px` }), [gap]);
|
|
5681
|
-
return /* @__PURE__ */
|
|
5726
|
+
return /* @__PURE__ */ React49.createElement(ListViewDraggingContext.Provider, { value: draggingContextValue }, /* @__PURE__ */ React49.createElement(
|
|
5682
5727
|
"div",
|
|
5683
5728
|
{
|
|
5684
5729
|
id,
|
|
@@ -5707,7 +5752,7 @@ var ListViewRootInner = forwardRefGeneric(function ListViewRootInner2({
|
|
|
5707
5752
|
},
|
|
5708
5753
|
data.length === 0 && renderEmptyState ? renderEmptyState() : withScrollable(
|
|
5709
5754
|
(scrollElementRef) => withSortable(
|
|
5710
|
-
virtualized ? /* @__PURE__ */
|
|
5755
|
+
virtualized ? /* @__PURE__ */ React49.createElement(
|
|
5711
5756
|
VirtualizedList,
|
|
5712
5757
|
{
|
|
5713
5758
|
ref: forwardedRef,
|
|
@@ -5731,7 +5776,7 @@ var ChildrenListViewInner = forwardRef19(function ChildrenListViewInner2({ child
|
|
|
5731
5776
|
),
|
|
5732
5777
|
[children]
|
|
5733
5778
|
);
|
|
5734
|
-
return /* @__PURE__ */
|
|
5779
|
+
return /* @__PURE__ */ React49.createElement(
|
|
5735
5780
|
ListViewRoot,
|
|
5736
5781
|
{
|
|
5737
5782
|
ref: forwardedRef,
|
|
@@ -5748,9 +5793,9 @@ var ChildrenListViewInner = forwardRef19(function ChildrenListViewInner2({ child
|
|
|
5748
5793
|
var ChildrenListView = memo18(ChildrenListViewInner);
|
|
5749
5794
|
var SimpleListViewInner = forwardRefGeneric(function SimpleListViewInner2(props, forwardedRef) {
|
|
5750
5795
|
if ("children" in props) {
|
|
5751
|
-
return /* @__PURE__ */
|
|
5796
|
+
return /* @__PURE__ */ React49.createElement(ChildrenListView, { ref: forwardedRef, ...props });
|
|
5752
5797
|
} else {
|
|
5753
|
-
return /* @__PURE__ */
|
|
5798
|
+
return /* @__PURE__ */ React49.createElement(ListViewRoot, { ref: forwardedRef, ...props });
|
|
5754
5799
|
}
|
|
5755
5800
|
});
|
|
5756
5801
|
var SimpleListView = memoGeneric(SimpleListViewInner);
|
|
@@ -5774,7 +5819,7 @@ var ListView;
|
|
|
5774
5819
|
})(ListView || (ListView = {}));
|
|
5775
5820
|
|
|
5776
5821
|
// src/components/TreeView.tsx
|
|
5777
|
-
import
|
|
5822
|
+
import React50, { useCallback as useCallback24, useContext as useContext12 } from "react";
|
|
5778
5823
|
var TreeRow = forwardRefGeneric(function TreeRow2({
|
|
5779
5824
|
icon,
|
|
5780
5825
|
expanded,
|
|
@@ -5791,7 +5836,7 @@ var TreeRow = forwardRefGeneric(function TreeRow2({
|
|
|
5791
5836
|
},
|
|
5792
5837
|
[onClickChevron]
|
|
5793
5838
|
);
|
|
5794
|
-
return /* @__PURE__ */
|
|
5839
|
+
return /* @__PURE__ */ React50.createElement(ListView.Row, { ref: forwardedRef, ...rest }, expandable && /* @__PURE__ */ React50.createElement(React50.Fragment, null, expanded === void 0 ? /* @__PURE__ */ React50.createElement(Spacer.Horizontal, { size: 19 }) : /* @__PURE__ */ React50.createElement(
|
|
5795
5840
|
IconButton,
|
|
5796
5841
|
{
|
|
5797
5842
|
className: chevronClassName,
|
|
@@ -5799,7 +5844,7 @@ var TreeRow = forwardRefGeneric(function TreeRow2({
|
|
|
5799
5844
|
onClick: handleClickChevron,
|
|
5800
5845
|
selected: rest.selected
|
|
5801
5846
|
}
|
|
5802
|
-
), /* @__PURE__ */
|
|
5847
|
+
), /* @__PURE__ */ React50.createElement(Spacer.Horizontal, { size: 6 })), icon && /* @__PURE__ */ React50.createElement(React50.Fragment, null, renderIcon(icon), /* @__PURE__ */ React50.createElement(Spacer.Horizontal, { size: 10 })), children);
|
|
5803
5848
|
});
|
|
5804
5849
|
var TreeView;
|
|
5805
5850
|
((TreeView2) => {
|
|
@@ -5893,7 +5938,7 @@ var List = memoGeneric(
|
|
|
5893
5938
|
setRenamingId(id);
|
|
5894
5939
|
}
|
|
5895
5940
|
}));
|
|
5896
|
-
return /* @__PURE__ */
|
|
5941
|
+
return /* @__PURE__ */ React51.createElement(
|
|
5897
5942
|
ViewComponent.Root,
|
|
5898
5943
|
{
|
|
5899
5944
|
variant: "bare",
|
|
@@ -5938,7 +5983,7 @@ var List = memoGeneric(
|
|
|
5938
5983
|
handleSelect(id);
|
|
5939
5984
|
}
|
|
5940
5985
|
};
|
|
5941
|
-
const action = (isHovered || isSelected) && !isRenaming && (typeof renderAction === "function" ? renderAction({ item, selected: isSelected, onOpenChange }) : renderAction === "menu" && menuItems && /* @__PURE__ */
|
|
5986
|
+
const action = (isHovered || isSelected) && !isRenaming && (typeof renderAction === "function" ? renderAction({ item, selected: isSelected, onOpenChange }) : renderAction === "menu" && menuItems && /* @__PURE__ */ React51.createElement(
|
|
5942
5987
|
ActionMenu,
|
|
5943
5988
|
{
|
|
5944
5989
|
menuItems,
|
|
@@ -5954,7 +5999,7 @@ var List = memoGeneric(
|
|
|
5954
5999
|
));
|
|
5955
6000
|
const end = action || detailPosition === "end" && renderDetail?.(item, isSelected);
|
|
5956
6001
|
const below = detailPosition === "below" && renderDetail?.(item, isSelected);
|
|
5957
|
-
return /* @__PURE__ */
|
|
6002
|
+
return /* @__PURE__ */ React51.createElement(
|
|
5958
6003
|
ViewComponent.Row,
|
|
5959
6004
|
{
|
|
5960
6005
|
id,
|
|
@@ -6002,12 +6047,12 @@ var List = memoGeneric(
|
|
|
6002
6047
|
},
|
|
6003
6048
|
dragIndicatorStyle
|
|
6004
6049
|
},
|
|
6005
|
-
/* @__PURE__ */
|
|
6050
|
+
/* @__PURE__ */ React51.createElement(
|
|
6006
6051
|
"div",
|
|
6007
6052
|
{
|
|
6008
6053
|
className: cx("flex flex-1 items-center px-2", rowGapMap[size2])
|
|
6009
6054
|
},
|
|
6010
|
-
thumbnail && /* @__PURE__ */
|
|
6055
|
+
thumbnail && /* @__PURE__ */ React51.createElement(
|
|
6011
6056
|
"div",
|
|
6012
6057
|
{
|
|
6013
6058
|
className: cx(
|
|
@@ -6020,7 +6065,7 @@ var List = memoGeneric(
|
|
|
6020
6065
|
},
|
|
6021
6066
|
thumbnail
|
|
6022
6067
|
),
|
|
6023
|
-
/* @__PURE__ */
|
|
6068
|
+
/* @__PURE__ */ React51.createElement("div", { className: "flex flex-col flex-1 w-0" }, /* @__PURE__ */ React51.createElement("div", { className: "flex items-center min-h-input-height flex-1 gap-2" }, /* @__PURE__ */ React51.createElement("div", { className: "flex-1 w-0 flex items-center", tabIndex: -1 }, isRenaming ? /* @__PURE__ */ React51.createElement(
|
|
6024
6069
|
ViewComponent.EditableRowTitle,
|
|
6025
6070
|
{
|
|
6026
6071
|
value: getName(item),
|
|
@@ -6035,7 +6080,7 @@ var List = memoGeneric(
|
|
|
6035
6080
|
e.stopPropagation();
|
|
6036
6081
|
}
|
|
6037
6082
|
}
|
|
6038
|
-
) : /* @__PURE__ */
|
|
6083
|
+
) : /* @__PURE__ */ React51.createElement(
|
|
6039
6084
|
ViewComponent.RowTitle,
|
|
6040
6085
|
{
|
|
6041
6086
|
className: cx(
|
|
@@ -6044,8 +6089,8 @@ var List = memoGeneric(
|
|
|
6044
6089
|
)
|
|
6045
6090
|
},
|
|
6046
6091
|
getName(item)
|
|
6047
|
-
)), end && detailPosition === "end" && /* @__PURE__ */
|
|
6048
|
-
end && detailPosition === "below" && /* @__PURE__ */
|
|
6092
|
+
)), end && detailPosition === "end" && /* @__PURE__ */ React51.createElement(DetailContainer, { selected: isSelected }, end)), below && /* @__PURE__ */ React51.createElement(DetailContainer, { selected: isSelected }, below)),
|
|
6093
|
+
end && detailPosition === "below" && /* @__PURE__ */ React51.createElement(DetailContainer, { selected: isSelected }, end)
|
|
6049
6094
|
)
|
|
6050
6095
|
);
|
|
6051
6096
|
}
|
|
@@ -6057,7 +6102,7 @@ var DetailContainer = memo19(function DetailContainer2({
|
|
|
6057
6102
|
children,
|
|
6058
6103
|
selected
|
|
6059
6104
|
}) {
|
|
6060
|
-
return /* @__PURE__ */
|
|
6105
|
+
return /* @__PURE__ */ React51.createElement(
|
|
6061
6106
|
"div",
|
|
6062
6107
|
{
|
|
6063
6108
|
className: cx("flex items-center gap-2", selected && "text-primary"),
|
|
@@ -6102,11 +6147,11 @@ var fontStyleMap = {
|
|
|
6102
6147
|
// src/components/Collection.tsx
|
|
6103
6148
|
var Collection = forwardRefGeneric(function Collection2(props, ref) {
|
|
6104
6149
|
const { viewType, ...rest } = props;
|
|
6105
|
-
return viewType === "grid" ? /* @__PURE__ */
|
|
6150
|
+
return viewType === "grid" ? /* @__PURE__ */ React52.createElement(Grid, { ref, ...rest }) : /* @__PURE__ */ React52.createElement(List, { ref, ...rest });
|
|
6106
6151
|
});
|
|
6107
6152
|
|
|
6108
6153
|
// src/components/ColorSwatch.tsx
|
|
6109
|
-
import
|
|
6154
|
+
import React53, { forwardRef as forwardRef20 } from "react";
|
|
6110
6155
|
var colorSwatchSizeMap = {
|
|
6111
6156
|
xsmall: 21,
|
|
6112
6157
|
small: 27,
|
|
@@ -6115,7 +6160,7 @@ var colorSwatchSizeMap = {
|
|
|
6115
6160
|
};
|
|
6116
6161
|
var ColorSwatch = forwardRef20(function ColorSwatch2({ color, size: size2 = "small", checked, style: style2, ...props }, ref) {
|
|
6117
6162
|
const sizePx = colorSwatchSizeMap[size2];
|
|
6118
|
-
return /* @__PURE__ */
|
|
6163
|
+
return /* @__PURE__ */ React53.createElement(
|
|
6119
6164
|
"button",
|
|
6120
6165
|
{
|
|
6121
6166
|
...props,
|
|
@@ -6136,7 +6181,7 @@ var ColorSwatch = forwardRef20(function ColorSwatch2({ color, size: size2 = "sma
|
|
|
6136
6181
|
|
|
6137
6182
|
// src/components/ColorSwatchControl.tsx
|
|
6138
6183
|
import * as ToggleGroupPrimitive from "@radix-ui/react-toggle-group";
|
|
6139
|
-
import
|
|
6184
|
+
import React54, { useMemo as useMemo22 } from "react";
|
|
6140
6185
|
function ColorSwatchControl(props) {
|
|
6141
6186
|
const {
|
|
6142
6187
|
options,
|
|
@@ -6159,8 +6204,8 @@ function ColorSwatchControl(props) {
|
|
|
6159
6204
|
...style2
|
|
6160
6205
|
};
|
|
6161
6206
|
}, [size2, style2]);
|
|
6162
|
-
const content = /* @__PURE__ */
|
|
6163
|
-
const item = /* @__PURE__ */
|
|
6207
|
+
const content = /* @__PURE__ */ React54.createElement("div", { className, id, style: styles3 }, options.map((option) => {
|
|
6208
|
+
const item = /* @__PURE__ */ React54.createElement(
|
|
6164
6209
|
ColorSwatch,
|
|
6165
6210
|
{
|
|
6166
6211
|
key: option,
|
|
@@ -6173,7 +6218,7 @@ function ColorSwatchControl(props) {
|
|
|
6173
6218
|
checked: value === option
|
|
6174
6219
|
}
|
|
6175
6220
|
);
|
|
6176
|
-
return /* @__PURE__ */
|
|
6221
|
+
return /* @__PURE__ */ React54.createElement(
|
|
6177
6222
|
ToggleGroupPrimitive.Item,
|
|
6178
6223
|
{
|
|
6179
6224
|
asChild: true,
|
|
@@ -6184,7 +6229,7 @@ function ColorSwatchControl(props) {
|
|
|
6184
6229
|
item
|
|
6185
6230
|
);
|
|
6186
6231
|
}));
|
|
6187
|
-
return /* @__PURE__ */
|
|
6232
|
+
return /* @__PURE__ */ React54.createElement(
|
|
6188
6233
|
ToggleGroupPrimitive.Root,
|
|
6189
6234
|
{
|
|
6190
6235
|
type: "single",
|
|
@@ -6199,9 +6244,9 @@ function ColorSwatchControl(props) {
|
|
|
6199
6244
|
|
|
6200
6245
|
// src/components/Combobox.tsx
|
|
6201
6246
|
import { DropdownChevronIcon as DropdownChevronIcon2 } from "@noya-app/noya-icons";
|
|
6202
|
-
import
|
|
6247
|
+
import React56, {
|
|
6203
6248
|
useCallback as useCallback25,
|
|
6204
|
-
useEffect as
|
|
6249
|
+
useEffect as useEffect19,
|
|
6205
6250
|
useImperativeHandle as useImperativeHandle6,
|
|
6206
6251
|
useMemo as useMemo23,
|
|
6207
6252
|
useRef as useRef21,
|
|
@@ -6541,7 +6586,7 @@ function useComboboxState(state) {
|
|
|
6541
6586
|
|
|
6542
6587
|
// src/components/ComboboxMenu.tsx
|
|
6543
6588
|
import { CheckIcon } from "@noya-app/noya-icons";
|
|
6544
|
-
import
|
|
6589
|
+
import React55 from "react";
|
|
6545
6590
|
var ComboboxMenu = memoGeneric(
|
|
6546
6591
|
forwardRefGeneric(function ComboboxMenu2({
|
|
6547
6592
|
items,
|
|
@@ -6553,7 +6598,7 @@ var ComboboxMenu = memoGeneric(
|
|
|
6553
6598
|
indented,
|
|
6554
6599
|
iconPosition = "right"
|
|
6555
6600
|
}, forwardedRef) {
|
|
6556
|
-
return /* @__PURE__ */
|
|
6601
|
+
return /* @__PURE__ */ React55.createElement(
|
|
6557
6602
|
ListView.Root,
|
|
6558
6603
|
{
|
|
6559
6604
|
ref: forwardedRef,
|
|
@@ -6569,7 +6614,7 @@ var ComboboxMenu = memoGeneric(
|
|
|
6569
6614
|
style: style2,
|
|
6570
6615
|
renderItem: (item, i) => {
|
|
6571
6616
|
if (item.type === "sectionHeader") {
|
|
6572
|
-
return /* @__PURE__ */
|
|
6617
|
+
return /* @__PURE__ */ React55.createElement(ListView.Row, { key: item.id, isSectionHeader: true }, indented && /* @__PURE__ */ React55.createElement(
|
|
6573
6618
|
Spacer.Horizontal,
|
|
6574
6619
|
{
|
|
6575
6620
|
size: CHECKBOX_WIDTH - CHECKBOX_RIGHT_INSET + CHECKBOX_INDENT_WIDTH
|
|
@@ -6580,7 +6625,7 @@ var ComboboxMenu = memoGeneric(
|
|
|
6580
6625
|
item: typeof item.title === "string" ? item.title : item.value,
|
|
6581
6626
|
itemScore: item
|
|
6582
6627
|
});
|
|
6583
|
-
return /* @__PURE__ */
|
|
6628
|
+
return /* @__PURE__ */ React55.createElement(
|
|
6584
6629
|
ListView.Row,
|
|
6585
6630
|
{
|
|
6586
6631
|
key: item.value,
|
|
@@ -6593,12 +6638,12 @@ var ComboboxMenu = memoGeneric(
|
|
|
6593
6638
|
}
|
|
6594
6639
|
}
|
|
6595
6640
|
},
|
|
6596
|
-
/* @__PURE__ */
|
|
6641
|
+
/* @__PURE__ */ React55.createElement("div", { className: "flex flex-1 min-w-0 items-center" }, indented && /* @__PURE__ */ React55.createElement(Spacer.Horizontal, { size: CHECKBOX_INDENT_WIDTH }), item.checked ? /* @__PURE__ */ React55.createElement("div", { ...styles.itemIndicator }, /* @__PURE__ */ React55.createElement(CheckIcon, null)) : indented ? /* @__PURE__ */ React55.createElement(
|
|
6597
6642
|
Spacer.Horizontal,
|
|
6598
6643
|
{
|
|
6599
6644
|
size: CHECKBOX_WIDTH - CHECKBOX_RIGHT_INSET
|
|
6600
6645
|
}
|
|
6601
|
-
) : null, iconPosition === "left" && item.icon && /* @__PURE__ */
|
|
6646
|
+
) : null, iconPosition === "left" && item.icon && /* @__PURE__ */ React55.createElement(React55.Fragment, null, renderIcon(item.icon), /* @__PURE__ */ React55.createElement(Spacer.Horizontal, { size: 8 })), tokens.map((token, j) => /* @__PURE__ */ React55.createElement(
|
|
6602
6647
|
"span",
|
|
6603
6648
|
{
|
|
6604
6649
|
key: `${item.value}-token-${j}`,
|
|
@@ -6609,7 +6654,7 @@ var ComboboxMenu = memoGeneric(
|
|
|
6609
6654
|
},
|
|
6610
6655
|
token.text
|
|
6611
6656
|
))),
|
|
6612
|
-
(item.shortcut || item.icon && iconPosition === "right") && /* @__PURE__ */
|
|
6657
|
+
(item.shortcut || item.icon && iconPosition === "right") && /* @__PURE__ */ React55.createElement(React55.Fragment, null, item.shortcut ? /* @__PURE__ */ React55.createElement(KeyboardShortcut, { shortcut: item.shortcut }) : item.icon && renderIcon(item.icon))
|
|
6613
6658
|
);
|
|
6614
6659
|
}
|
|
6615
6660
|
}
|
|
@@ -6689,15 +6734,15 @@ var Combobox = memoGeneric(
|
|
|
6689
6734
|
const { fieldId: id } = useLabel({
|
|
6690
6735
|
fieldId: rest.id
|
|
6691
6736
|
});
|
|
6692
|
-
|
|
6737
|
+
useEffect19(() => {
|
|
6693
6738
|
comboboxState.setItems(items);
|
|
6694
6739
|
}, [items, comboboxState]);
|
|
6695
|
-
|
|
6740
|
+
useEffect19(() => {
|
|
6696
6741
|
comboboxState.setFilter(initialValueString);
|
|
6697
6742
|
}, [comboboxState, initialValueString]);
|
|
6698
6743
|
const { filter, selectedIndex, filteredItems } = state;
|
|
6699
6744
|
const shouldShowMenu = isFocused && !(hideMenuWhenEmptyValue && filter === "");
|
|
6700
|
-
|
|
6745
|
+
useEffect19(() => {
|
|
6701
6746
|
if (listRef.current) {
|
|
6702
6747
|
listRef.current.scrollToIndex(selectedIndex);
|
|
6703
6748
|
}
|
|
@@ -6910,7 +6955,7 @@ var Combobox = memoGeneric(
|
|
|
6910
6955
|
comboboxState
|
|
6911
6956
|
]
|
|
6912
6957
|
);
|
|
6913
|
-
|
|
6958
|
+
useEffect19(() => {
|
|
6914
6959
|
if (!shouldBlur) return;
|
|
6915
6960
|
if (document.activeElement !== ref.current) return;
|
|
6916
6961
|
setShouldBlur(false);
|
|
@@ -6931,19 +6976,19 @@ var Combobox = memoGeneric(
|
|
|
6931
6976
|
const hasCheckedItems = items.some(
|
|
6932
6977
|
(item) => isSelectableMenuItem(item) && item.checked
|
|
6933
6978
|
);
|
|
6934
|
-
return /* @__PURE__ */
|
|
6979
|
+
return /* @__PURE__ */ React56.createElement(
|
|
6935
6980
|
InputField2.Root,
|
|
6936
6981
|
{
|
|
6937
6982
|
id,
|
|
6938
6983
|
size: size2,
|
|
6939
6984
|
sideOffset: 6,
|
|
6940
|
-
end: /* @__PURE__ */
|
|
6985
|
+
end: /* @__PURE__ */ React56.createElement(React56.Fragment, null, loading && /* @__PURE__ */ React56.createElement("div", { className: "pr-1.5" }, /* @__PURE__ */ React56.createElement(ActivityIndicator, null)), !readOnly && /* @__PURE__ */ React56.createElement(
|
|
6941
6986
|
InputField2.Button,
|
|
6942
6987
|
{
|
|
6943
6988
|
variant: "floating",
|
|
6944
6989
|
onClick: handleChevronClick
|
|
6945
6990
|
},
|
|
6946
|
-
/* @__PURE__ */
|
|
6991
|
+
/* @__PURE__ */ React56.createElement(
|
|
6947
6992
|
DropdownChevronIcon2,
|
|
6948
6993
|
{
|
|
6949
6994
|
className: cx(
|
|
@@ -6962,7 +7007,7 @@ var Combobox = memoGeneric(
|
|
|
6962
7007
|
ListView.rowHeight * 10.5
|
|
6963
7008
|
);
|
|
6964
7009
|
const listSize = { width, height };
|
|
6965
|
-
return /* @__PURE__ */
|
|
7010
|
+
return /* @__PURE__ */ React56.createElement(
|
|
6966
7011
|
"div",
|
|
6967
7012
|
{
|
|
6968
7013
|
className: cx(
|
|
@@ -6970,7 +7015,7 @@ var Combobox = memoGeneric(
|
|
|
6970
7015
|
shouldShowMenu && !readOnly ? "flex" : "hidden"
|
|
6971
7016
|
)
|
|
6972
7017
|
},
|
|
6973
|
-
filteredItems.length > 0 && !loading ? /* @__PURE__ */
|
|
7018
|
+
filteredItems.length > 0 && !loading ? /* @__PURE__ */ React56.createElement(
|
|
6974
7019
|
ComboboxMenu,
|
|
6975
7020
|
{
|
|
6976
7021
|
ref: listRef,
|
|
@@ -6984,11 +7029,11 @@ var Combobox = memoGeneric(
|
|
|
6984
7029
|
},
|
|
6985
7030
|
indented: hasCheckedItems
|
|
6986
7031
|
}
|
|
6987
|
-
) : /* @__PURE__ */
|
|
7032
|
+
) : /* @__PURE__ */ React56.createElement("div", { className: "flex flex-col h-[50px] p-5 items-center justify-center" }, /* @__PURE__ */ React56.createElement(Small, { className: "text-text-disabled" }, loading ? "Loading..." : "No results"))
|
|
6988
7033
|
);
|
|
6989
7034
|
}
|
|
6990
7035
|
},
|
|
6991
|
-
/* @__PURE__ */
|
|
7036
|
+
/* @__PURE__ */ React56.createElement(
|
|
6992
7037
|
InputField2.Input,
|
|
6993
7038
|
{
|
|
6994
7039
|
ref,
|
|
@@ -7013,7 +7058,7 @@ var Combobox = memoGeneric(
|
|
|
7013
7058
|
...readOnly ? { readOnly: true } : {}
|
|
7014
7059
|
}
|
|
7015
7060
|
),
|
|
7016
|
-
filter && typeaheadValue && typeaheadValue.toLowerCase().startsWith(filter.toLowerCase()) && /* @__PURE__ */
|
|
7061
|
+
filter && typeaheadValue && typeaheadValue.toLowerCase().startsWith(filter.toLowerCase()) && /* @__PURE__ */ React56.createElement(
|
|
7017
7062
|
InputField2.Typeahead,
|
|
7018
7063
|
{
|
|
7019
7064
|
value: typeaheadValue,
|
|
@@ -7027,14 +7072,14 @@ var Combobox = memoGeneric(
|
|
|
7027
7072
|
);
|
|
7028
7073
|
|
|
7029
7074
|
// src/components/CommandPalette.tsx
|
|
7030
|
-
import
|
|
7075
|
+
import React59, { memo as memo21 } from "react";
|
|
7031
7076
|
|
|
7032
7077
|
// src/components/SearchCompletionMenu.tsx
|
|
7033
7078
|
import { getCurrentPlatform as getCurrentPlatform2, handleKeyboardEvent } from "@noya-app/noya-keymap";
|
|
7034
|
-
import
|
|
7079
|
+
import React58, {
|
|
7035
7080
|
forwardRef as forwardRef21,
|
|
7036
7081
|
useCallback as useCallback26,
|
|
7037
|
-
useEffect as
|
|
7082
|
+
useEffect as useEffect20,
|
|
7038
7083
|
useImperativeHandle as useImperativeHandle7,
|
|
7039
7084
|
useMemo as useMemo24,
|
|
7040
7085
|
useRef as useRef22,
|
|
@@ -7042,7 +7087,7 @@ import React57, {
|
|
|
7042
7087
|
} from "react";
|
|
7043
7088
|
|
|
7044
7089
|
// src/components/Divider.tsx
|
|
7045
|
-
import
|
|
7090
|
+
import React57, { memo as memo20 } from "react";
|
|
7046
7091
|
var Divider = memo20(function Divider2({
|
|
7047
7092
|
variant = "normal",
|
|
7048
7093
|
overflow = 0,
|
|
@@ -7050,7 +7095,7 @@ var Divider = memo20(function Divider2({
|
|
|
7050
7095
|
style: style2,
|
|
7051
7096
|
...props
|
|
7052
7097
|
}) {
|
|
7053
|
-
return /* @__PURE__ */
|
|
7098
|
+
return /* @__PURE__ */ React57.createElement(
|
|
7054
7099
|
"div",
|
|
7055
7100
|
{
|
|
7056
7101
|
className: cx(
|
|
@@ -7077,7 +7122,7 @@ var DividerVertical = memo20(function DividerVertical2({
|
|
|
7077
7122
|
style: style2,
|
|
7078
7123
|
...props
|
|
7079
7124
|
}) {
|
|
7080
|
-
return /* @__PURE__ */
|
|
7125
|
+
return /* @__PURE__ */ React57.createElement(
|
|
7081
7126
|
"div",
|
|
7082
7127
|
{
|
|
7083
7128
|
className: cx(`
|
|
@@ -7111,9 +7156,9 @@ var SearchCompletionMenu = forwardRef21(function SearchCompletionMenu2({
|
|
|
7111
7156
|
index: 0
|
|
7112
7157
|
});
|
|
7113
7158
|
const { index, search } = state;
|
|
7114
|
-
const listRef =
|
|
7159
|
+
const listRef = React58.useRef(null);
|
|
7115
7160
|
const hasCheckedItems = items.some((item) => item.checked);
|
|
7116
|
-
|
|
7161
|
+
useEffect20(() => {
|
|
7117
7162
|
listRef.current?.scrollToIndex(index);
|
|
7118
7163
|
}, [index]);
|
|
7119
7164
|
const results = useMemo24(
|
|
@@ -7134,7 +7179,7 @@ var SearchCompletionMenu = forwardRef21(function SearchCompletionMenu2({
|
|
|
7134
7179
|
const setIndex = useCallback26((index2) => {
|
|
7135
7180
|
setState((state2) => ({ ...state2, index: index2 }));
|
|
7136
7181
|
}, []);
|
|
7137
|
-
|
|
7182
|
+
useEffect20(() => {
|
|
7138
7183
|
onHover?.(results[index]);
|
|
7139
7184
|
}, [index, onHover, results]);
|
|
7140
7185
|
const searchHeight = 31;
|
|
@@ -7190,7 +7235,7 @@ var SearchCompletionMenu = forwardRef21(function SearchCompletionMenu2({
|
|
|
7190
7235
|
inputRef.current?.focus();
|
|
7191
7236
|
}
|
|
7192
7237
|
}));
|
|
7193
|
-
return /* @__PURE__ */
|
|
7238
|
+
return /* @__PURE__ */ React58.createElement("div", { ...elementSize, className: "flex flex-col overflow-hidden" }, /* @__PURE__ */ React58.createElement(InputField2.Root, { className: "flex flex-0" }, /* @__PURE__ */ React58.createElement(
|
|
7194
7239
|
InputField2.Input,
|
|
7195
7240
|
{
|
|
7196
7241
|
ref: inputRef,
|
|
@@ -7210,7 +7255,7 @@ var SearchCompletionMenu = forwardRef21(function SearchCompletionMenu2({
|
|
|
7210
7255
|
onChange: setSearch,
|
|
7211
7256
|
onKeyDown: handleKeyDown
|
|
7212
7257
|
}
|
|
7213
|
-
)), /* @__PURE__ */
|
|
7258
|
+
)), /* @__PURE__ */ React58.createElement(Divider, null), results.length > 0 ? /* @__PURE__ */ React58.createElement(
|
|
7214
7259
|
ComboboxMenu,
|
|
7215
7260
|
{
|
|
7216
7261
|
ref: listRef,
|
|
@@ -7225,13 +7270,13 @@ var SearchCompletionMenu = forwardRef21(function SearchCompletionMenu2({
|
|
|
7225
7270
|
onHoverIndex: setIndex,
|
|
7226
7271
|
indented: hasCheckedItems
|
|
7227
7272
|
}
|
|
7228
|
-
) : /* @__PURE__ */
|
|
7273
|
+
) : /* @__PURE__ */ React58.createElement(
|
|
7229
7274
|
"div",
|
|
7230
7275
|
{
|
|
7231
7276
|
...listSize,
|
|
7232
7277
|
className: "flex flex-col p-20 items-center justify-center"
|
|
7233
7278
|
},
|
|
7234
|
-
/* @__PURE__ */
|
|
7279
|
+
/* @__PURE__ */ React58.createElement(Small, { color: "textDisabled" }, "No results")
|
|
7235
7280
|
));
|
|
7236
7281
|
});
|
|
7237
7282
|
|
|
@@ -7243,11 +7288,11 @@ var CommandPalette = memo21(function CommandPalette2({
|
|
|
7243
7288
|
onSelect,
|
|
7244
7289
|
onHover
|
|
7245
7290
|
}) {
|
|
7246
|
-
const menuRef =
|
|
7247
|
-
const handleClose =
|
|
7291
|
+
const menuRef = React59.useRef(null);
|
|
7292
|
+
const handleClose = React59.useCallback(() => {
|
|
7248
7293
|
setShowCommandPalette(false);
|
|
7249
7294
|
}, [setShowCommandPalette]);
|
|
7250
|
-
return /* @__PURE__ */
|
|
7295
|
+
return /* @__PURE__ */ React59.createElement(
|
|
7251
7296
|
Dialog,
|
|
7252
7297
|
{
|
|
7253
7298
|
style: {
|
|
@@ -7273,7 +7318,7 @@ var CommandPalette = memo21(function CommandPalette2({
|
|
|
7273
7318
|
}, 0);
|
|
7274
7319
|
}
|
|
7275
7320
|
},
|
|
7276
|
-
/* @__PURE__ */
|
|
7321
|
+
/* @__PURE__ */ React59.createElement("div", { className: "flex flex-col flex-1" }, /* @__PURE__ */ React59.createElement(AutoSizer, null, (size2) => /* @__PURE__ */ React59.createElement(
|
|
7277
7322
|
SearchCompletionMenu,
|
|
7278
7323
|
{
|
|
7279
7324
|
ref: menuRef,
|
|
@@ -7288,21 +7333,21 @@ var CommandPalette = memo21(function CommandPalette2({
|
|
|
7288
7333
|
});
|
|
7289
7334
|
|
|
7290
7335
|
// src/components/connected-users-menu/ConnectedUsersMenuLayout.tsx
|
|
7291
|
-
import
|
|
7292
|
-
var UserAvatar = ({ userId, name, image }) => /* @__PURE__ */
|
|
7336
|
+
import React60 from "react";
|
|
7337
|
+
var UserAvatar = ({ userId, name, image }) => /* @__PURE__ */ React60.createElement(
|
|
7293
7338
|
Tooltip,
|
|
7294
7339
|
{
|
|
7295
7340
|
key: userId,
|
|
7296
|
-
content: /* @__PURE__ */
|
|
7341
|
+
content: /* @__PURE__ */ React60.createElement("div", { className: "flex flex-col" }, /* @__PURE__ */ React60.createElement(Small, null, name))
|
|
7297
7342
|
},
|
|
7298
|
-
/* @__PURE__ */
|
|
7343
|
+
/* @__PURE__ */ React60.createElement(Avatar, { size: INPUT_HEIGHT, userId, name, image })
|
|
7299
7344
|
);
|
|
7300
7345
|
var ConnectedUsersMenuLayout = ({
|
|
7301
7346
|
renderUsers,
|
|
7302
7347
|
launchAIAssistant,
|
|
7303
7348
|
isAssistantOpen
|
|
7304
7349
|
}) => {
|
|
7305
|
-
return /* @__PURE__ */
|
|
7350
|
+
return /* @__PURE__ */ React60.createElement("div", { className: "flex gap-1.5" }, /* @__PURE__ */ React60.createElement(AvatarStack, { size: INPUT_HEIGHT, className: "mr-1" }, renderUsers()), launchAIAssistant && /* @__PURE__ */ React60.createElement(Tooltip, { content: "AI Assistant" }, /* @__PURE__ */ React60.createElement(
|
|
7306
7351
|
Button_default,
|
|
7307
7352
|
{
|
|
7308
7353
|
active: isAssistantOpen,
|
|
@@ -7315,7 +7360,7 @@ var ConnectedUsersMenuLayout = ({
|
|
|
7315
7360
|
|
|
7316
7361
|
// src/components/DraggableMenuButton.tsx
|
|
7317
7362
|
import { DragHandleDots2Icon } from "@noya-app/noya-icons";
|
|
7318
|
-
import
|
|
7363
|
+
import React61, { useCallback as useCallback27, useState as useState26 } from "react";
|
|
7319
7364
|
var DraggableMenuButton = memoGeneric(function DraggableMenuButton2({
|
|
7320
7365
|
items,
|
|
7321
7366
|
onSelect,
|
|
@@ -7361,7 +7406,7 @@ var DraggableMenuButton = memoGeneric(function DraggableMenuButton2({
|
|
|
7361
7406
|
},
|
|
7362
7407
|
[setOpen]
|
|
7363
7408
|
);
|
|
7364
|
-
return /* @__PURE__ */
|
|
7409
|
+
return /* @__PURE__ */ React61.createElement(
|
|
7365
7410
|
"div",
|
|
7366
7411
|
{
|
|
7367
7412
|
className: cx(
|
|
@@ -7377,7 +7422,7 @@ var DraggableMenuButton = memoGeneric(function DraggableMenuButton2({
|
|
|
7377
7422
|
onClick?.();
|
|
7378
7423
|
}
|
|
7379
7424
|
},
|
|
7380
|
-
items && onSelect ? /* @__PURE__ */
|
|
7425
|
+
items && onSelect ? /* @__PURE__ */ React61.createElement(
|
|
7381
7426
|
DropdownMenu,
|
|
7382
7427
|
{
|
|
7383
7428
|
open,
|
|
@@ -7386,13 +7431,13 @@ var DraggableMenuButton = memoGeneric(function DraggableMenuButton2({
|
|
|
7386
7431
|
onSelect,
|
|
7387
7432
|
shouldBindKeyboardShortcuts: false
|
|
7388
7433
|
},
|
|
7389
|
-
/* @__PURE__ */
|
|
7434
|
+
/* @__PURE__ */ React61.createElement("div", { className: "pointer-events-none h-[15px]" }, /* @__PURE__ */ React61.createElement(
|
|
7390
7435
|
DragHandleDots2Icon,
|
|
7391
7436
|
{
|
|
7392
7437
|
color: isVisible || open ? cssVars.colors.icon : "transparent"
|
|
7393
7438
|
}
|
|
7394
7439
|
))
|
|
7395
|
-
) : /* @__PURE__ */
|
|
7440
|
+
) : /* @__PURE__ */ React61.createElement(
|
|
7396
7441
|
DragHandleDots2Icon,
|
|
7397
7442
|
{
|
|
7398
7443
|
color: isVisible || open ? cssVars.colors.icon : "transparent"
|
|
@@ -7403,10 +7448,10 @@ var DraggableMenuButton = memoGeneric(function DraggableMenuButton2({
|
|
|
7403
7448
|
|
|
7404
7449
|
// src/components/Drawer.tsx
|
|
7405
7450
|
import * as Dialog3 from "@radix-ui/react-dialog";
|
|
7406
|
-
import * as
|
|
7451
|
+
import * as React62 from "react";
|
|
7407
7452
|
import { useImperativeHandle as useImperativeHandle8 } from "react";
|
|
7408
|
-
var Drawer =
|
|
7409
|
-
|
|
7453
|
+
var Drawer = React62.memo(
|
|
7454
|
+
React62.forwardRef(function Drawer2({
|
|
7410
7455
|
open,
|
|
7411
7456
|
onOpenChange,
|
|
7412
7457
|
trigger,
|
|
@@ -7436,7 +7481,7 @@ var Drawer = React61.memo(
|
|
|
7436
7481
|
return internalOpen;
|
|
7437
7482
|
}
|
|
7438
7483
|
}));
|
|
7439
|
-
const inner = /* @__PURE__ */
|
|
7484
|
+
const inner = /* @__PURE__ */ React62.createElement(React62.Fragment, null, /* @__PURE__ */ React62.createElement(
|
|
7440
7485
|
Dialog3.Overlay,
|
|
7441
7486
|
{
|
|
7442
7487
|
className: cx(
|
|
@@ -7444,7 +7489,7 @@ var Drawer = React61.memo(
|
|
|
7444
7489
|
positioning === "absolute" ? "absolute" : "fixed"
|
|
7445
7490
|
)
|
|
7446
7491
|
}
|
|
7447
|
-
), /* @__PURE__ */
|
|
7492
|
+
), /* @__PURE__ */ React62.createElement(
|
|
7448
7493
|
Dialog3.Content,
|
|
7449
7494
|
{
|
|
7450
7495
|
id,
|
|
@@ -7456,24 +7501,24 @@ var Drawer = React61.memo(
|
|
|
7456
7501
|
className
|
|
7457
7502
|
)
|
|
7458
7503
|
},
|
|
7459
|
-
title && /* @__PURE__ */
|
|
7504
|
+
title && /* @__PURE__ */ React62.createElement(Dialog3.Title, null, title),
|
|
7460
7505
|
children
|
|
7461
7506
|
));
|
|
7462
|
-
return /* @__PURE__ */
|
|
7507
|
+
return /* @__PURE__ */ React62.createElement(
|
|
7463
7508
|
Dialog3.Root,
|
|
7464
7509
|
{
|
|
7465
7510
|
key: "dialog",
|
|
7466
7511
|
open: internalOpen,
|
|
7467
7512
|
onOpenChange: setInternalOpen
|
|
7468
7513
|
},
|
|
7469
|
-
/* @__PURE__ */
|
|
7470
|
-
portalled ? /* @__PURE__ */
|
|
7514
|
+
/* @__PURE__ */ React62.createElement(Dialog3.Trigger, { key: "trigger" }, trigger),
|
|
7515
|
+
portalled ? /* @__PURE__ */ React62.createElement(Dialog3.Portal, { container: portalContainer }, inner) : inner
|
|
7471
7516
|
);
|
|
7472
7517
|
})
|
|
7473
7518
|
);
|
|
7474
7519
|
|
|
7475
7520
|
// src/components/Fade.tsx
|
|
7476
|
-
import
|
|
7521
|
+
import React63 from "react";
|
|
7477
7522
|
var Fade = ({
|
|
7478
7523
|
children,
|
|
7479
7524
|
direction = "right",
|
|
@@ -7495,7 +7540,7 @@ var Fade = ({
|
|
|
7495
7540
|
top: "left-0 right-0 top-0",
|
|
7496
7541
|
bottom: "left-0 right-0 bottom-0"
|
|
7497
7542
|
}[direction];
|
|
7498
|
-
return /* @__PURE__ */
|
|
7543
|
+
return /* @__PURE__ */ React63.createElement("div", { className: cx("relative", className), style: { height } }, position === "front" ? children : null, /* @__PURE__ */ React63.createElement(
|
|
7499
7544
|
"div",
|
|
7500
7545
|
{
|
|
7501
7546
|
className: cx(
|
|
@@ -7514,17 +7559,17 @@ var Fade = ({
|
|
|
7514
7559
|
};
|
|
7515
7560
|
|
|
7516
7561
|
// src/components/file-explorer/FileExplorerLayout.tsx
|
|
7517
|
-
import
|
|
7562
|
+
import React64 from "react";
|
|
7518
7563
|
var FileExplorerLayout = ({
|
|
7519
7564
|
children,
|
|
7520
7565
|
className,
|
|
7521
7566
|
...props
|
|
7522
|
-
}) => /* @__PURE__ */
|
|
7567
|
+
}) => /* @__PURE__ */ React64.createElement(Section, { className: cx(className, "px-3 flex-1"), ...props }, children);
|
|
7523
7568
|
var FileExplorerUploadButton = ({
|
|
7524
7569
|
showUploadButton,
|
|
7525
7570
|
onUpload,
|
|
7526
7571
|
children
|
|
7527
|
-
}) => /* @__PURE__ */
|
|
7572
|
+
}) => /* @__PURE__ */ React64.createElement("div", { className: "flex items-center gap-2" }, showUploadButton && /* @__PURE__ */ React64.createElement(
|
|
7528
7573
|
IconButton,
|
|
7529
7574
|
{
|
|
7530
7575
|
iconName: "UploadIcon",
|
|
@@ -7535,14 +7580,14 @@ var FileExplorerUploadButton = ({
|
|
|
7535
7580
|
), children);
|
|
7536
7581
|
var FileExplorerCollection = forwardRefGeneric(
|
|
7537
7582
|
function FileExplorerCollection2({ ...props }, ref) {
|
|
7538
|
-
return /* @__PURE__ */
|
|
7583
|
+
return /* @__PURE__ */ React64.createElement(Collection, { ref, className: "-mx-3 flex-1", ...props });
|
|
7539
7584
|
}
|
|
7540
7585
|
);
|
|
7541
7586
|
var FileExplorerDetail = ({
|
|
7542
7587
|
selected,
|
|
7543
7588
|
size: size2,
|
|
7544
7589
|
children
|
|
7545
|
-
}) => /* @__PURE__ */
|
|
7590
|
+
}) => /* @__PURE__ */ React64.createElement(
|
|
7546
7591
|
"span",
|
|
7547
7592
|
{
|
|
7548
7593
|
className: cx(
|
|
@@ -7555,10 +7600,10 @@ var FileExplorerDetail = ({
|
|
|
7555
7600
|
var FileExplorerEmptyState = ({
|
|
7556
7601
|
label = "No files",
|
|
7557
7602
|
...props
|
|
7558
|
-
}) => /* @__PURE__ */
|
|
7603
|
+
}) => /* @__PURE__ */ React64.createElement(Banner, { label, className: "mx-3", ...props });
|
|
7559
7604
|
|
|
7560
7605
|
// src/components/FillInputField.tsx
|
|
7561
|
-
import
|
|
7606
|
+
import React67, { forwardRef as forwardRef23, memo as memo25 } from "react";
|
|
7562
7607
|
|
|
7563
7608
|
// ../noya-file-format/src/types.ts
|
|
7564
7609
|
var types_exports = {};
|
|
@@ -7883,25 +7928,25 @@ var ClassValue = /* @__PURE__ */ ((ClassValue2) => {
|
|
|
7883
7928
|
})(ClassValue || {});
|
|
7884
7929
|
|
|
7885
7930
|
// src/components/FillPreviewBackground.tsx
|
|
7886
|
-
import * as
|
|
7931
|
+
import * as React66 from "react";
|
|
7887
7932
|
|
|
7888
7933
|
// src/contexts/ImageDataContext.tsx
|
|
7889
|
-
import * as
|
|
7890
|
-
var ImageDataContext =
|
|
7934
|
+
import * as React65 from "react";
|
|
7935
|
+
var ImageDataContext = React65.createContext(
|
|
7891
7936
|
void 0
|
|
7892
7937
|
);
|
|
7893
|
-
var ImageDataProvider =
|
|
7938
|
+
var ImageDataProvider = React65.memo(function ImageDataProvider2({
|
|
7894
7939
|
children,
|
|
7895
7940
|
getImageData
|
|
7896
7941
|
}) {
|
|
7897
|
-
const contextValue =
|
|
7942
|
+
const contextValue = React65.useMemo(
|
|
7898
7943
|
() => ({ getImageData: getImageData ?? (() => void 0) }),
|
|
7899
7944
|
[getImageData]
|
|
7900
7945
|
);
|
|
7901
|
-
return /* @__PURE__ */
|
|
7946
|
+
return /* @__PURE__ */ React65.createElement(ImageDataContext.Provider, { value: contextValue }, children);
|
|
7902
7947
|
});
|
|
7903
7948
|
function useImageData(ref) {
|
|
7904
|
-
const value =
|
|
7949
|
+
const value = React65.useContext(ImageDataContext);
|
|
7905
7950
|
if (!value) {
|
|
7906
7951
|
throw new Error("Missing ImageDataProvider");
|
|
7907
7952
|
}
|
|
@@ -7909,14 +7954,14 @@ function useImageData(ref) {
|
|
|
7909
7954
|
}
|
|
7910
7955
|
|
|
7911
7956
|
// src/hooks/useObjectURL.ts
|
|
7912
|
-
import { useLayoutEffect as
|
|
7957
|
+
import { useLayoutEffect as useLayoutEffect7, useMemo as useMemo26 } from "react";
|
|
7913
7958
|
function useObjectURL(object) {
|
|
7914
7959
|
const objectURL = useMemo26(() => {
|
|
7915
7960
|
if (object instanceof Blob) return URL.createObjectURL(object);
|
|
7916
7961
|
const bytes = object instanceof Uint8Array ? object : object !== void 0 ? new Uint8Array(object) : new Uint8Array();
|
|
7917
7962
|
return URL.createObjectURL(new Blob([bytes]));
|
|
7918
7963
|
}, [object]);
|
|
7919
|
-
|
|
7964
|
+
useLayoutEffect7(() => {
|
|
7920
7965
|
return () => URL.revokeObjectURL(objectURL);
|
|
7921
7966
|
}, [objectURL]);
|
|
7922
7967
|
return objectURL;
|
|
@@ -7971,10 +8016,10 @@ var dotsHorizontalSvg = (fillColor) => `
|
|
|
7971
8016
|
<path d='M3.625 7.5C3.625 8.12132 3.12132 8.625 2.5 8.625C1.87868 8.625 1.375 8.12132 1.375 7.5C1.375 6.87868 1.87868 6.375 2.5 6.375C3.12132 6.375 3.625 6.87868 3.625 7.5ZM8.625 7.5C8.625 8.12132 8.12132 8.625 7.5 8.625C6.87868 8.625 6.375 8.12132 6.375 7.5C6.375 6.87868 6.87868 6.375 7.5 6.375C8.12132 6.375 8.625 6.87868 8.625 7.5ZM12.5 8.625C13.1213 8.625 13.625 8.12132 13.625 7.5C13.625 6.87868 13.1213 6.375 12.5 6.375C11.8787 6.375 11.375 6.87868 11.375 7.5C11.375 8.12132 11.8787 8.625 12.5 8.625Z'></path>
|
|
7972
8017
|
</svg>
|
|
7973
8018
|
`;
|
|
7974
|
-
var Background =
|
|
8019
|
+
var Background = React66.memo(function Background2({
|
|
7975
8020
|
background: background2
|
|
7976
8021
|
}) {
|
|
7977
|
-
return /* @__PURE__ */
|
|
8022
|
+
return /* @__PURE__ */ React66.createElement(
|
|
7978
8023
|
"span",
|
|
7979
8024
|
{
|
|
7980
8025
|
className: `${background2 ? `bg-[${background2}]` : "bg-input-background"} absolute inset-0`
|
|
@@ -7993,7 +8038,7 @@ function getPatternSizeAndPosition(fillType, tileScale) {
|
|
|
7993
8038
|
return "center / 100% 100%";
|
|
7994
8039
|
}
|
|
7995
8040
|
}
|
|
7996
|
-
var PatternPreviewBackground =
|
|
8041
|
+
var PatternPreviewBackground = React66.memo(
|
|
7997
8042
|
function PatternPreviewBackground2({
|
|
7998
8043
|
fillType,
|
|
7999
8044
|
tileScale,
|
|
@@ -8002,7 +8047,7 @@ var PatternPreviewBackground = React65.memo(
|
|
|
8002
8047
|
const image = useImageData(imageRef);
|
|
8003
8048
|
const url = useObjectURL(image);
|
|
8004
8049
|
const size2 = getPatternSizeAndPosition(fillType, tileScale);
|
|
8005
|
-
const background2 =
|
|
8050
|
+
const background2 = React66.useMemo(
|
|
8006
8051
|
() => [
|
|
8007
8052
|
size2,
|
|
8008
8053
|
`url(${url})`,
|
|
@@ -8010,44 +8055,44 @@ var PatternPreviewBackground = React65.memo(
|
|
|
8010
8055
|
].join(" "),
|
|
8011
8056
|
[fillType, size2, url]
|
|
8012
8057
|
);
|
|
8013
|
-
return /* @__PURE__ */
|
|
8058
|
+
return /* @__PURE__ */ React66.createElement(Background, { background: background2 });
|
|
8014
8059
|
}
|
|
8015
8060
|
);
|
|
8016
|
-
var ColorPreviewBackground =
|
|
8061
|
+
var ColorPreviewBackground = React66.memo(function ColorPreviewBackground2({
|
|
8017
8062
|
color
|
|
8018
8063
|
}) {
|
|
8019
|
-
const background2 =
|
|
8064
|
+
const background2 = React66.useMemo(
|
|
8020
8065
|
() => sketchColorToRgbaString(color),
|
|
8021
8066
|
[color]
|
|
8022
8067
|
);
|
|
8023
|
-
return /* @__PURE__ */
|
|
8068
|
+
return /* @__PURE__ */ React66.createElement(Background, { background: background2 });
|
|
8024
8069
|
});
|
|
8025
|
-
var GradientPreviewBackground =
|
|
8070
|
+
var GradientPreviewBackground = React66.memo(
|
|
8026
8071
|
function GradientPreviewBackground2({
|
|
8027
8072
|
gradient
|
|
8028
8073
|
}) {
|
|
8029
|
-
const background2 =
|
|
8074
|
+
const background2 = React66.useMemo(
|
|
8030
8075
|
() => getGradientBackground(gradient.stops, gradient.gradientType, 180),
|
|
8031
8076
|
[gradient.gradientType, gradient.stops]
|
|
8032
8077
|
);
|
|
8033
|
-
return /* @__PURE__ */
|
|
8078
|
+
return /* @__PURE__ */ React66.createElement(Background, { background: background2 });
|
|
8034
8079
|
}
|
|
8035
8080
|
);
|
|
8036
8081
|
var background = `center url("data:image/svg+xml;utf8,${dotsHorizontalSvg(
|
|
8037
8082
|
cssVars.colors.placeholderDots
|
|
8038
8083
|
)}") no-repeat`;
|
|
8039
|
-
var FillPreviewBackground =
|
|
8084
|
+
var FillPreviewBackground = React66.memo(function FillPreviewBackground2({
|
|
8040
8085
|
value
|
|
8041
8086
|
}) {
|
|
8042
|
-
if (!value) return /* @__PURE__ */
|
|
8087
|
+
if (!value) return /* @__PURE__ */ React66.createElement(Background, { background });
|
|
8043
8088
|
switch (value._class) {
|
|
8044
8089
|
case "color":
|
|
8045
|
-
return /* @__PURE__ */
|
|
8090
|
+
return /* @__PURE__ */ React66.createElement(ColorPreviewBackground, { color: value });
|
|
8046
8091
|
case "gradient":
|
|
8047
|
-
return /* @__PURE__ */
|
|
8092
|
+
return /* @__PURE__ */ React66.createElement(GradientPreviewBackground, { gradient: value });
|
|
8048
8093
|
case "pattern":
|
|
8049
8094
|
if (!value.image) return null;
|
|
8050
|
-
return /* @__PURE__ */
|
|
8095
|
+
return /* @__PURE__ */ React66.createElement(
|
|
8051
8096
|
PatternPreviewBackground,
|
|
8052
8097
|
{
|
|
8053
8098
|
fillType: value.patternFillType,
|
|
@@ -8059,7 +8104,7 @@ var FillPreviewBackground = React65.memo(function FillPreviewBackground2({
|
|
|
8059
8104
|
});
|
|
8060
8105
|
|
|
8061
8106
|
// src/components/FillInputField.tsx
|
|
8062
|
-
var FillButton = forwardRef23(({ className, ...props }, ref) => /* @__PURE__ */
|
|
8107
|
+
var FillButton = forwardRef23(({ className, ...props }, ref) => /* @__PURE__ */ React67.createElement(
|
|
8063
8108
|
"button",
|
|
8064
8109
|
{
|
|
8065
8110
|
ref,
|
|
@@ -8072,12 +8117,12 @@ var FillButton = forwardRef23(({ className, ...props }, ref) => /* @__PURE__ */
|
|
|
8072
8117
|
));
|
|
8073
8118
|
var FillInputField = memo25(
|
|
8074
8119
|
forwardRef23(function FillInputField2({ id, value, ...rest }, ref) {
|
|
8075
|
-
return /* @__PURE__ */
|
|
8120
|
+
return /* @__PURE__ */ React67.createElement(FillButton, { ref, id, ...rest }, /* @__PURE__ */ React67.createElement(FillPreviewBackground, { value }));
|
|
8076
8121
|
})
|
|
8077
8122
|
);
|
|
8078
8123
|
|
|
8079
8124
|
// src/components/FloatingWindow.tsx
|
|
8080
|
-
import
|
|
8125
|
+
import React68, { useCallback as useCallback28, useRef as useRef23, useState as useState27 } from "react";
|
|
8081
8126
|
var styles2 = {
|
|
8082
8127
|
noSelect: {
|
|
8083
8128
|
userSelect: "none",
|
|
@@ -8170,7 +8215,7 @@ function defaultRenderToolbar({
|
|
|
8170
8215
|
toolbarContent,
|
|
8171
8216
|
onClose
|
|
8172
8217
|
}) {
|
|
8173
|
-
return /* @__PURE__ */
|
|
8218
|
+
return /* @__PURE__ */ React68.createElement(React68.Fragment, null, /* @__PURE__ */ React68.createElement(Small, { className: "flex-1 font-medium text-text" }, title), toolbarContent, /* @__PURE__ */ React68.createElement(
|
|
8174
8219
|
IconButton,
|
|
8175
8220
|
{
|
|
8176
8221
|
iconName: "Cross3Icon",
|
|
@@ -8292,7 +8337,7 @@ var FloatingWindow = ({
|
|
|
8292
8337
|
setResizeDirection(null);
|
|
8293
8338
|
toggleGlobalTextSelection(false);
|
|
8294
8339
|
}, []);
|
|
8295
|
-
|
|
8340
|
+
React68.useEffect(() => {
|
|
8296
8341
|
document.addEventListener("mousemove", handleMouseMove);
|
|
8297
8342
|
document.addEventListener("mouseup", handleMouseUp);
|
|
8298
8343
|
return () => {
|
|
@@ -8306,7 +8351,7 @@ var FloatingWindow = ({
|
|
|
8306
8351
|
if (onClose) onClose();
|
|
8307
8352
|
floatingWindowManager.closeWindow(currentFloatingWindow.id);
|
|
8308
8353
|
}, [currentFloatingWindow.id, floatingWindowManager, onClose]);
|
|
8309
|
-
return /* @__PURE__ */
|
|
8354
|
+
return /* @__PURE__ */ React68.createElement(
|
|
8310
8355
|
"div",
|
|
8311
8356
|
{
|
|
8312
8357
|
ref: wrapperRef,
|
|
@@ -8321,7 +8366,7 @@ var FloatingWindow = ({
|
|
|
8321
8366
|
zIndex: cssVars.zIndex.menu
|
|
8322
8367
|
}
|
|
8323
8368
|
},
|
|
8324
|
-
/* @__PURE__ */
|
|
8369
|
+
/* @__PURE__ */ React68.createElement(
|
|
8325
8370
|
"div",
|
|
8326
8371
|
{
|
|
8327
8372
|
style: {
|
|
@@ -8332,9 +8377,9 @@ var FloatingWindow = ({
|
|
|
8332
8377
|
},
|
|
8333
8378
|
renderToolbar({ title, toolbarContent, onClose: handleClose })
|
|
8334
8379
|
),
|
|
8335
|
-
/* @__PURE__ */
|
|
8336
|
-
/* @__PURE__ */
|
|
8337
|
-
Object.entries(resizeHandlePositions).map(([direction, style2]) => /* @__PURE__ */
|
|
8380
|
+
/* @__PURE__ */ React68.createElement(Divider, null),
|
|
8381
|
+
/* @__PURE__ */ React68.createElement("div", { style: styles2.content }, children),
|
|
8382
|
+
Object.entries(resizeHandlePositions).map(([direction, style2]) => /* @__PURE__ */ React68.createElement(
|
|
8338
8383
|
"div",
|
|
8339
8384
|
{
|
|
8340
8385
|
key: direction,
|
|
@@ -8356,8 +8401,8 @@ import {
|
|
|
8356
8401
|
hsvaToRgba,
|
|
8357
8402
|
rgbaToHsva as rgbaToHsva2
|
|
8358
8403
|
} from "@noya-app/noya-colorpicker";
|
|
8359
|
-
import * as
|
|
8360
|
-
var GradientPicker =
|
|
8404
|
+
import * as React69 from "react";
|
|
8405
|
+
var GradientPicker = React69.memo(function GradientPicker2({
|
|
8361
8406
|
value,
|
|
8362
8407
|
selectedStop,
|
|
8363
8408
|
onChangeColor,
|
|
@@ -8366,7 +8411,7 @@ var GradientPicker = React68.memo(function GradientPicker2({
|
|
|
8366
8411
|
onDelete,
|
|
8367
8412
|
onSelectStop
|
|
8368
8413
|
}) {
|
|
8369
|
-
const colorModel =
|
|
8414
|
+
const colorModel = React69.useMemo(
|
|
8370
8415
|
() => ({
|
|
8371
8416
|
defaultColor: { r: 0, g: 0, b: 0, a: 1 },
|
|
8372
8417
|
toHsva: rgbaToHsva2,
|
|
@@ -8375,30 +8420,30 @@ var GradientPicker = React68.memo(function GradientPicker2({
|
|
|
8375
8420
|
}),
|
|
8376
8421
|
[]
|
|
8377
8422
|
);
|
|
8378
|
-
const rgbaColor =
|
|
8423
|
+
const rgbaColor = React69.useMemo(
|
|
8379
8424
|
() => sketchColorToRgba(value[selectedStop].color),
|
|
8380
8425
|
[value, selectedStop]
|
|
8381
8426
|
);
|
|
8382
|
-
const handleChangeColor =
|
|
8427
|
+
const handleChangeColor = React69.useCallback(
|
|
8383
8428
|
(value2) => {
|
|
8384
8429
|
onChangeColor(rgbaToSketchColor(value2));
|
|
8385
8430
|
},
|
|
8386
8431
|
[onChangeColor]
|
|
8387
8432
|
);
|
|
8388
|
-
const handleAddGradientStop =
|
|
8433
|
+
const handleAddGradientStop = React69.useCallback(
|
|
8389
8434
|
(value2, position) => {
|
|
8390
8435
|
onAdd(rgbaToSketchColor(value2), position);
|
|
8391
8436
|
},
|
|
8392
8437
|
[onAdd]
|
|
8393
8438
|
);
|
|
8394
|
-
return /* @__PURE__ */
|
|
8439
|
+
return /* @__PURE__ */ React69.createElement(
|
|
8395
8440
|
NoyaColorPicker,
|
|
8396
8441
|
{
|
|
8397
8442
|
onChange: handleChangeColor,
|
|
8398
8443
|
colorModel,
|
|
8399
8444
|
color: rgbaColor
|
|
8400
8445
|
},
|
|
8401
|
-
/* @__PURE__ */
|
|
8446
|
+
/* @__PURE__ */ React69.createElement(
|
|
8402
8447
|
Gradient,
|
|
8403
8448
|
{
|
|
8404
8449
|
gradients: value,
|
|
@@ -8409,17 +8454,17 @@ var GradientPicker = React68.memo(function GradientPicker2({
|
|
|
8409
8454
|
onDelete
|
|
8410
8455
|
}
|
|
8411
8456
|
),
|
|
8412
|
-
/* @__PURE__ */
|
|
8413
|
-
/* @__PURE__ */
|
|
8414
|
-
/* @__PURE__ */
|
|
8415
|
-
/* @__PURE__ */
|
|
8416
|
-
/* @__PURE__ */
|
|
8417
|
-
/* @__PURE__ */
|
|
8457
|
+
/* @__PURE__ */ React69.createElement(Spacer.Vertical, { size: 10 }),
|
|
8458
|
+
/* @__PURE__ */ React69.createElement(Saturation, null),
|
|
8459
|
+
/* @__PURE__ */ React69.createElement(Spacer.Vertical, { size: 12 }),
|
|
8460
|
+
/* @__PURE__ */ React69.createElement(Hue, null),
|
|
8461
|
+
/* @__PURE__ */ React69.createElement(Spacer.Vertical, { size: 5 }),
|
|
8462
|
+
/* @__PURE__ */ React69.createElement(Alpha, null)
|
|
8418
8463
|
);
|
|
8419
8464
|
});
|
|
8420
8465
|
|
|
8421
8466
|
// src/components/InspectorContainer.tsx
|
|
8422
|
-
import
|
|
8467
|
+
import React70, { forwardRef as forwardRef24, memo as memo27 } from "react";
|
|
8423
8468
|
var InspectorContainer = memo27(
|
|
8424
8469
|
forwardRef24(function InspectorContainer2({
|
|
8425
8470
|
header,
|
|
@@ -8430,7 +8475,7 @@ var InspectorContainer = memo27(
|
|
|
8430
8475
|
className,
|
|
8431
8476
|
style: style2
|
|
8432
8477
|
}, forwardedRef) {
|
|
8433
|
-
return /* @__PURE__ */
|
|
8478
|
+
return /* @__PURE__ */ React70.createElement(
|
|
8434
8479
|
"div",
|
|
8435
8480
|
{
|
|
8436
8481
|
ref: forwardedRef,
|
|
@@ -8445,32 +8490,32 @@ var InspectorContainer = memo27(
|
|
|
8445
8490
|
}
|
|
8446
8491
|
},
|
|
8447
8492
|
header,
|
|
8448
|
-
children ? /* @__PURE__ */
|
|
8493
|
+
children ? /* @__PURE__ */ React70.createElement(ScrollArea, null, /* @__PURE__ */ React70.createElement("div", { className: "flex flex-col relative" }, showDividers ? withSeparatorElements(children, /* @__PURE__ */ React70.createElement(Divider, null)) : children)) : fallback ? /* @__PURE__ */ React70.createElement("div", { className: "flex flex-col relative h-full" }, fallback) : null
|
|
8449
8494
|
);
|
|
8450
8495
|
})
|
|
8451
8496
|
);
|
|
8452
8497
|
|
|
8453
8498
|
// src/components/LabeledElementView.tsx
|
|
8454
8499
|
import * as kiwi from "kiwi.js";
|
|
8455
|
-
import * as
|
|
8456
|
-
var LabeledElementView =
|
|
8500
|
+
import * as React71 from "react";
|
|
8501
|
+
var LabeledElementView = React71.memo(function LabeledElementView2({
|
|
8457
8502
|
children,
|
|
8458
8503
|
renderLabel
|
|
8459
8504
|
}) {
|
|
8460
|
-
const elementIds =
|
|
8461
|
-
(child) =>
|
|
8505
|
+
const elementIds = React71.Children.toArray(children).flatMap(
|
|
8506
|
+
(child) => React71.isValidElement(child) && child.type === React71.Fragment ? child.props.children : [child]
|
|
8462
8507
|
).map(
|
|
8463
|
-
(child) =>
|
|
8508
|
+
(child) => React71.isValidElement(child) && "id" in child.props ? child.props.id : null
|
|
8464
8509
|
).filter((id) => !!id);
|
|
8465
8510
|
const serializedIds = elementIds.join(",");
|
|
8466
|
-
const containerRef =
|
|
8467
|
-
const refs =
|
|
8511
|
+
const containerRef = React71.useRef(null);
|
|
8512
|
+
const refs = React71.useMemo(() => {
|
|
8468
8513
|
return Object.fromEntries(
|
|
8469
|
-
serializedIds.split(",").map((id) => [id,
|
|
8514
|
+
serializedIds.split(",").map((id) => [id, React71.createRef()])
|
|
8470
8515
|
);
|
|
8471
8516
|
}, [serializedIds]);
|
|
8472
|
-
const labelElements =
|
|
8473
|
-
return serializedIds.split(",").map((id, index) => /* @__PURE__ */
|
|
8517
|
+
const labelElements = React71.useMemo(() => {
|
|
8518
|
+
return serializedIds.split(",").map((id, index) => /* @__PURE__ */ React71.createElement(
|
|
8474
8519
|
"span",
|
|
8475
8520
|
{
|
|
8476
8521
|
key: id,
|
|
@@ -8483,7 +8528,7 @@ var LabeledElementView = React70.memo(function LabeledElementView2({
|
|
|
8483
8528
|
})
|
|
8484
8529
|
));
|
|
8485
8530
|
}, [refs, serializedIds, renderLabel]);
|
|
8486
|
-
|
|
8531
|
+
React71.useLayoutEffect(() => {
|
|
8487
8532
|
if (!containerRef.current) return;
|
|
8488
8533
|
const containerRect = containerRef.current.getBoundingClientRect();
|
|
8489
8534
|
const solver = new kiwi.Solver();
|
|
@@ -8545,19 +8590,19 @@ var LabeledElementView = React70.memo(function LabeledElementView2({
|
|
|
8545
8590
|
`${Math.max(...heights)}px`
|
|
8546
8591
|
);
|
|
8547
8592
|
}, [refs, labelElements]);
|
|
8548
|
-
return /* @__PURE__ */
|
|
8593
|
+
return /* @__PURE__ */ React71.createElement("div", { className: "flex flex-1 flex-col relative", ref: containerRef }, /* @__PURE__ */ React71.createElement("div", { className: "flex flex-1 items-center" }, children), /* @__PURE__ */ React71.createElement("div", { className: "relative overflow-hidden select-none" }, labelElements));
|
|
8549
8594
|
});
|
|
8550
8595
|
|
|
8551
8596
|
// src/components/LabeledField.tsx
|
|
8552
|
-
import
|
|
8597
|
+
import React73, { memo as memo29, useMemo as useMemo30 } from "react";
|
|
8553
8598
|
|
|
8554
8599
|
// src/hooks/useIndent.ts
|
|
8555
|
-
import
|
|
8556
|
-
var IndentContext =
|
|
8600
|
+
import React72 from "react";
|
|
8601
|
+
var IndentContext = React72.createContext({
|
|
8557
8602
|
indentLevel: 0
|
|
8558
8603
|
});
|
|
8559
8604
|
var useIndent = () => {
|
|
8560
|
-
const { indentLevel } =
|
|
8605
|
+
const { indentLevel } = React72.useContext(IndentContext);
|
|
8561
8606
|
return indentLevel;
|
|
8562
8607
|
};
|
|
8563
8608
|
|
|
@@ -8616,7 +8661,7 @@ var LabeledField = memo29(function LabeledField2({
|
|
|
8616
8661
|
}),
|
|
8617
8662
|
[labelWidth, indentLevel, labelStyleProp]
|
|
8618
8663
|
);
|
|
8619
|
-
return /* @__PURE__ */
|
|
8664
|
+
return /* @__PURE__ */ React73.createElement(LabelContext.Provider, { value: labelContextValue }, labelPosition === "inset" ? /* @__PURE__ */ React73.createElement(LabelPositionContext.Provider, { value: labelPositionInset }, children) : /* @__PURE__ */ React73.createElement("div", { className: cx("flex relative flex-1", className), style: style2 }, Boolean(indentLevel) && /* @__PURE__ */ React73.createElement("div", { style: indentStyle }), /* @__PURE__ */ React73.createElement("div", { className: labeledFieldClasses }, /* @__PURE__ */ React73.createElement(
|
|
8620
8665
|
Label,
|
|
8621
8666
|
{
|
|
8622
8667
|
htmlFor: fieldId,
|
|
@@ -8625,7 +8670,7 @@ var LabeledField = memo29(function LabeledField2({
|
|
|
8625
8670
|
...props
|
|
8626
8671
|
},
|
|
8627
8672
|
label
|
|
8628
|
-
), labelPosition === "start" ? /* @__PURE__ */
|
|
8673
|
+
), labelPosition === "start" ? /* @__PURE__ */ React73.createElement("div", { className: "flex-auto flex", style: fieldStyle }, children) : children)));
|
|
8629
8674
|
});
|
|
8630
8675
|
|
|
8631
8676
|
// src/components/MediaThumbnail.tsx
|
|
@@ -8635,7 +8680,7 @@ import {
|
|
|
8635
8680
|
SpeakerLoudIcon,
|
|
8636
8681
|
VideoIcon
|
|
8637
8682
|
} from "@noya-app/noya-icons";
|
|
8638
|
-
import
|
|
8683
|
+
import React74, { memo as memo30, useMemo as useMemo31 } from "react";
|
|
8639
8684
|
|
|
8640
8685
|
// src/components/catppuccin/fileIcons.ts
|
|
8641
8686
|
var fileIcons = {
|
|
@@ -11100,8 +11145,8 @@ var MediaThumbnail = memo30(function MediaThumbnail2({
|
|
|
11100
11145
|
const content = useMemo31(() => {
|
|
11101
11146
|
switch (contentType) {
|
|
11102
11147
|
case "image":
|
|
11103
|
-
if (!url) return /* @__PURE__ */
|
|
11104
|
-
return /* @__PURE__ */
|
|
11148
|
+
if (!url) return /* @__PURE__ */ React74.createElement(ImageIcon, { color: iconColor, style: iconStyles });
|
|
11149
|
+
return /* @__PURE__ */ React74.createElement(
|
|
11105
11150
|
"img",
|
|
11106
11151
|
{
|
|
11107
11152
|
src: url,
|
|
@@ -11111,18 +11156,18 @@ var MediaThumbnail = memo30(function MediaThumbnail2({
|
|
|
11111
11156
|
}
|
|
11112
11157
|
);
|
|
11113
11158
|
case "video":
|
|
11114
|
-
return /* @__PURE__ */
|
|
11159
|
+
return /* @__PURE__ */ React74.createElement(VideoIcon, { color: iconColor, style: iconStyles });
|
|
11115
11160
|
case "audio":
|
|
11116
|
-
return /* @__PURE__ */
|
|
11161
|
+
return /* @__PURE__ */ React74.createElement(SpeakerLoudIcon, { color: iconColor, style: iconStyles });
|
|
11117
11162
|
default:
|
|
11118
11163
|
if (iconName) {
|
|
11119
11164
|
const Icon = Icons[iconName];
|
|
11120
|
-
return /* @__PURE__ */
|
|
11165
|
+
return /* @__PURE__ */ React74.createElement(Icon, { color: iconColor, style: iconStyles });
|
|
11121
11166
|
}
|
|
11122
11167
|
if (fileName) {
|
|
11123
11168
|
const fileIcon = findFileIcon(fileName);
|
|
11124
11169
|
if (fileIcon) {
|
|
11125
|
-
return /* @__PURE__ */
|
|
11170
|
+
return /* @__PURE__ */ React74.createElement(
|
|
11126
11171
|
"img",
|
|
11127
11172
|
{
|
|
11128
11173
|
src: `https://api.iconify.design/catppuccin/${fileIcon}.svg?height=none&box=1`,
|
|
@@ -11132,10 +11177,10 @@ var MediaThumbnail = memo30(function MediaThumbnail2({
|
|
|
11132
11177
|
);
|
|
11133
11178
|
}
|
|
11134
11179
|
}
|
|
11135
|
-
return /* @__PURE__ */
|
|
11180
|
+
return /* @__PURE__ */ React74.createElement(FileIcon, { color: iconColor, style: iconStyles });
|
|
11136
11181
|
}
|
|
11137
11182
|
}, [contentType, url, iconColor, iconStyles, iconName, fileName]);
|
|
11138
|
-
return /* @__PURE__ */
|
|
11183
|
+
return /* @__PURE__ */ React74.createElement(
|
|
11139
11184
|
"div",
|
|
11140
11185
|
{
|
|
11141
11186
|
className: cx(
|
|
@@ -11166,7 +11211,7 @@ function findFileIcon(fileName) {
|
|
|
11166
11211
|
}
|
|
11167
11212
|
|
|
11168
11213
|
// src/components/Message.tsx
|
|
11169
|
-
import
|
|
11214
|
+
import React75, { forwardRef as forwardRef25, memo as memo31, useMemo as useMemo32 } from "react";
|
|
11170
11215
|
var Message = memo31(
|
|
11171
11216
|
forwardRef25(function Message2({ role, children, user, avatarSize = INPUT_HEIGHT }, ref) {
|
|
11172
11217
|
const randomId = crypto.randomUUID();
|
|
@@ -11177,7 +11222,7 @@ var Message = memo31(
|
|
|
11177
11222
|
} : void 0,
|
|
11178
11223
|
[userMessageBackgroundColor, role]
|
|
11179
11224
|
);
|
|
11180
|
-
return /* @__PURE__ */
|
|
11225
|
+
return /* @__PURE__ */ React75.createElement(
|
|
11181
11226
|
"div",
|
|
11182
11227
|
{
|
|
11183
11228
|
className: cx(
|
|
@@ -11185,15 +11230,15 @@ var Message = memo31(
|
|
|
11185
11230
|
role === "user" ? "flex-row-reverse" : "flex-row"
|
|
11186
11231
|
)
|
|
11187
11232
|
},
|
|
11188
|
-
role === "assistant" ? /* @__PURE__ */
|
|
11233
|
+
role === "assistant" ? /* @__PURE__ */ React75.createElement(
|
|
11189
11234
|
Avatar,
|
|
11190
11235
|
{
|
|
11191
11236
|
name: "Assistant",
|
|
11192
11237
|
size: avatarSize,
|
|
11193
11238
|
backgroundColor: cssVars.colors.primaryPastel
|
|
11194
11239
|
},
|
|
11195
|
-
/* @__PURE__ */
|
|
11196
|
-
) : /* @__PURE__ */
|
|
11240
|
+
/* @__PURE__ */ React75.createElement(Logo, { style: { width: 15 }, fill: cssVars.colors.primary })
|
|
11241
|
+
) : /* @__PURE__ */ React75.createElement(
|
|
11197
11242
|
Avatar,
|
|
11198
11243
|
{
|
|
11199
11244
|
userId: !user ? randomId : user?.id,
|
|
@@ -11202,7 +11247,7 @@ var Message = memo31(
|
|
|
11202
11247
|
size: avatarSize
|
|
11203
11248
|
}
|
|
11204
11249
|
),
|
|
11205
|
-
/* @__PURE__ */
|
|
11250
|
+
/* @__PURE__ */ React75.createElement(
|
|
11206
11251
|
"div",
|
|
11207
11252
|
{
|
|
11208
11253
|
className: cx(
|
|
@@ -11212,7 +11257,7 @@ var Message = memo31(
|
|
|
11212
11257
|
style: styles3,
|
|
11213
11258
|
ref
|
|
11214
11259
|
},
|
|
11215
|
-
/* @__PURE__ */
|
|
11260
|
+
/* @__PURE__ */ React75.createElement(
|
|
11216
11261
|
Text,
|
|
11217
11262
|
{
|
|
11218
11263
|
variant: "small",
|
|
@@ -11227,9 +11272,9 @@ var Message = memo31(
|
|
|
11227
11272
|
|
|
11228
11273
|
// src/components/pipeline/PipelineResultLayout.tsx
|
|
11229
11274
|
import { Link1Icon } from "@noya-app/noya-icons";
|
|
11230
|
-
import
|
|
11275
|
+
import React76 from "react";
|
|
11231
11276
|
var PipelineResultLink = ({ url }) => {
|
|
11232
|
-
return /* @__PURE__ */
|
|
11277
|
+
return /* @__PURE__ */ React76.createElement("div", { className: "flex flex-col gap-0.5" }, /* @__PURE__ */ React76.createElement(
|
|
11233
11278
|
"a",
|
|
11234
11279
|
{
|
|
11235
11280
|
href: url,
|
|
@@ -11237,15 +11282,15 @@ var PipelineResultLink = ({ url }) => {
|
|
|
11237
11282
|
rel: "noopener noreferrer",
|
|
11238
11283
|
className: "flex text-primary hover:opacity-80 border border-divider rounded-md"
|
|
11239
11284
|
},
|
|
11240
|
-
/* @__PURE__ */
|
|
11241
|
-
/* @__PURE__ */
|
|
11242
|
-
/* @__PURE__ */
|
|
11285
|
+
/* @__PURE__ */ React76.createElement("div", { className: "flex gap-1 items-center p-2" }, /* @__PURE__ */ React76.createElement(Link1Icon, { className: "w-[15px] h-[15px] flex-shrink-0" })),
|
|
11286
|
+
/* @__PURE__ */ React76.createElement(DividerVertical, null),
|
|
11287
|
+
/* @__PURE__ */ React76.createElement(Small, { className: "truncate p-2 flex-1" }, url)
|
|
11243
11288
|
));
|
|
11244
11289
|
};
|
|
11245
11290
|
var PipelineResultLayout = ({
|
|
11246
11291
|
children
|
|
11247
11292
|
}) => {
|
|
11248
|
-
return /* @__PURE__ */
|
|
11293
|
+
return /* @__PURE__ */ React76.createElement("div", { className: "flex flex-col gap-2" }, children);
|
|
11249
11294
|
};
|
|
11250
11295
|
function getPipelineResultLink(value) {
|
|
11251
11296
|
if (typeof value !== "object" || value === null) return void 0;
|
|
@@ -11261,27 +11306,27 @@ function getPipelineResultLink(value) {
|
|
|
11261
11306
|
// src/components/Progress.tsx
|
|
11262
11307
|
import { clamp } from "@noya-app/noya-utils";
|
|
11263
11308
|
import * as ProgressPrimitive from "@radix-ui/react-progress";
|
|
11264
|
-
import * as
|
|
11309
|
+
import * as React77 from "react";
|
|
11265
11310
|
function Progress({
|
|
11266
11311
|
value,
|
|
11267
11312
|
variant = "normal",
|
|
11268
11313
|
className
|
|
11269
11314
|
}) {
|
|
11270
11315
|
const clampedValue = clamp(value, 0, 100);
|
|
11271
|
-
const transformStyles =
|
|
11316
|
+
const transformStyles = React77.useMemo(
|
|
11272
11317
|
() => ({
|
|
11273
11318
|
transform: `translateX(-${100 - clampedValue}%)`
|
|
11274
11319
|
}),
|
|
11275
11320
|
[clampedValue]
|
|
11276
11321
|
);
|
|
11277
|
-
return /* @__PURE__ */
|
|
11322
|
+
return /* @__PURE__ */ React77.createElement(
|
|
11278
11323
|
ProgressPrimitive.Root,
|
|
11279
11324
|
{
|
|
11280
11325
|
className: cx(`relative hidden bg-input-background h-[5px] `, className),
|
|
11281
11326
|
style: { transform: "translateZ(0)" },
|
|
11282
11327
|
value: clampedValue
|
|
11283
11328
|
},
|
|
11284
|
-
/* @__PURE__ */
|
|
11329
|
+
/* @__PURE__ */ React77.createElement(
|
|
11285
11330
|
ProgressPrimitive.Indicator,
|
|
11286
11331
|
{
|
|
11287
11332
|
className: `${variant === "primary" ? "bg-primary" : variant === "secondary" ? "bg-secondary" : variant === "warning" ? "bg-warning" : "bg-text"} transition-[transform_660ms_cubic-bezier(0.65,0,0.35,1) w-full h-full`,
|
|
@@ -11292,7 +11337,7 @@ function Progress({
|
|
|
11292
11337
|
}
|
|
11293
11338
|
|
|
11294
11339
|
// src/components/Section.tsx
|
|
11295
|
-
import
|
|
11340
|
+
import React78, { memo as memo32, useMemo as useMemo34 } from "react";
|
|
11296
11341
|
var titleIconStyle = {
|
|
11297
11342
|
marginRight: "8px",
|
|
11298
11343
|
alignSelf: "flex-start",
|
|
@@ -11327,7 +11372,7 @@ var SectionInternal = ({
|
|
|
11327
11372
|
}),
|
|
11328
11373
|
[titleTextStyle, title, extraPadding, styleProp]
|
|
11329
11374
|
);
|
|
11330
|
-
const hasChildren =
|
|
11375
|
+
const hasChildren = React78.Children.toArray(children).some((child) => !!child);
|
|
11331
11376
|
const headerStyle = useMemo34(
|
|
11332
11377
|
() => ({
|
|
11333
11378
|
marginBottom: hasChildren ? "4px" : void 0,
|
|
@@ -11335,7 +11380,7 @@ var SectionInternal = ({
|
|
|
11335
11380
|
}),
|
|
11336
11381
|
[hasChildren]
|
|
11337
11382
|
);
|
|
11338
|
-
return /* @__PURE__ */
|
|
11383
|
+
return /* @__PURE__ */ React78.createElement("div", { style: style2, className }, (title || titleIcon || right) && /* @__PURE__ */ React78.createElement(InspectorPrimitives_exports.SectionHeader, { style: headerStyle }, titleIcon && /* @__PURE__ */ React78.createElement("div", { style: titleIconStyle, className: textStyles[titleTextStyle] }, titleIconOptions.inlineBlockWrapper ? /* @__PURE__ */ React78.createElement("div", { style: titleIconWrapperStyle }, titleIcon) : titleIcon), title && /* @__PURE__ */ React78.createElement(React78.Fragment, null, onClickTitle ? /* @__PURE__ */ React78.createElement(Button, { variant: "none", onClick: onClickTitle }, /* @__PURE__ */ React78.createElement(InspectorPrimitives_exports.Title, { $textStyle: titleTextStyle }, title)) : /* @__PURE__ */ React78.createElement(InspectorPrimitives_exports.Title, { $textStyle: titleTextStyle }, title)), /* @__PURE__ */ React78.createElement(Spacer.Horizontal, null), right), /* @__PURE__ */ React78.createElement(IndentContext.Provider, { value: { indentLevel: 1 } }, children));
|
|
11339
11384
|
};
|
|
11340
11385
|
var ExpandableSection = ({
|
|
11341
11386
|
storageKey,
|
|
@@ -11348,12 +11393,12 @@ var ExpandableSection = ({
|
|
|
11348
11393
|
initialVisibility
|
|
11349
11394
|
);
|
|
11350
11395
|
const expanded = visibility === "show";
|
|
11351
|
-
return /* @__PURE__ */
|
|
11396
|
+
return /* @__PURE__ */ React78.createElement(
|
|
11352
11397
|
SectionInternal,
|
|
11353
11398
|
{
|
|
11354
11399
|
...props,
|
|
11355
11400
|
right: !props.hideRightWhenCollapsed || expanded ? props.right : null,
|
|
11356
|
-
title: /* @__PURE__ */
|
|
11401
|
+
title: /* @__PURE__ */ React78.createElement("div", { className: "flex gap-1 items-center" }, props.title, /* @__PURE__ */ React78.createElement(
|
|
11357
11402
|
IconButton,
|
|
11358
11403
|
{
|
|
11359
11404
|
iconName: expanded ? "ChevronDownIcon2" : "ChevronRightIcon2",
|
|
@@ -11368,12 +11413,12 @@ var Section = memo32(function InspectorSection({
|
|
|
11368
11413
|
storageKey,
|
|
11369
11414
|
...props
|
|
11370
11415
|
}) {
|
|
11371
|
-
return storageKey ? /* @__PURE__ */
|
|
11416
|
+
return storageKey ? /* @__PURE__ */ React78.createElement(ExpandableSection, { ...props, storageKey }) : /* @__PURE__ */ React78.createElement(SectionInternal, { ...props });
|
|
11372
11417
|
});
|
|
11373
11418
|
|
|
11374
11419
|
// src/components/SegmentedControl.tsx
|
|
11375
11420
|
import * as ToggleGroupPrimitive2 from "@radix-ui/react-toggle-group";
|
|
11376
|
-
import
|
|
11421
|
+
import React79, {
|
|
11377
11422
|
createContext as createContext13,
|
|
11378
11423
|
forwardRef as forwardRef26,
|
|
11379
11424
|
useCallback as useCallback30,
|
|
@@ -11394,7 +11439,7 @@ var SegmentedControlItem = forwardRef26(function SegmentedControlItem2({
|
|
|
11394
11439
|
...props
|
|
11395
11440
|
}, forwardedRef) {
|
|
11396
11441
|
const { colorScheme } = useContext14(SegmentedControlContext);
|
|
11397
|
-
const itemElement = /* @__PURE__ */
|
|
11442
|
+
const itemElement = /* @__PURE__ */ React79.createElement(
|
|
11398
11443
|
ToggleGroupPrimitive2.Item,
|
|
11399
11444
|
{
|
|
11400
11445
|
ref: forwardedRef,
|
|
@@ -11414,7 +11459,7 @@ var SegmentedControlItem = forwardRef26(function SegmentedControlItem2({
|
|
|
11414
11459
|
),
|
|
11415
11460
|
...props
|
|
11416
11461
|
},
|
|
11417
|
-
/* @__PURE__ */
|
|
11462
|
+
/* @__PURE__ */ React79.createElement(
|
|
11418
11463
|
"span",
|
|
11419
11464
|
{
|
|
11420
11465
|
className: cx(
|
|
@@ -11426,7 +11471,7 @@ var SegmentedControlItem = forwardRef26(function SegmentedControlItem2({
|
|
|
11426
11471
|
title
|
|
11427
11472
|
)
|
|
11428
11473
|
);
|
|
11429
|
-
return tooltip ? /* @__PURE__ */
|
|
11474
|
+
return tooltip ? /* @__PURE__ */ React79.createElement(Tooltip, { content: tooltip }, itemElement) : itemElement;
|
|
11430
11475
|
});
|
|
11431
11476
|
var SegmentedControl = memoGeneric(function SegmentedControl2({
|
|
11432
11477
|
id: idProp,
|
|
@@ -11448,7 +11493,7 @@ var SegmentedControl = memoGeneric(function SegmentedControl2({
|
|
|
11448
11493
|
},
|
|
11449
11494
|
[allowEmpty, onValueChange]
|
|
11450
11495
|
);
|
|
11451
|
-
return /* @__PURE__ */
|
|
11496
|
+
return /* @__PURE__ */ React79.createElement(SegmentedControlContext.Provider, { value: contextValue }, /* @__PURE__ */ React79.createElement(
|
|
11452
11497
|
ToggleGroupPrimitive2.Root,
|
|
11453
11498
|
{
|
|
11454
11499
|
id,
|
|
@@ -11466,13 +11511,13 @@ var SegmentedControl = memoGeneric(function SegmentedControl2({
|
|
|
11466
11511
|
gridTemplateColumns: `repeat(${items.length}, 1fr)`
|
|
11467
11512
|
}
|
|
11468
11513
|
},
|
|
11469
|
-
items.map((item, index) => /* @__PURE__ */
|
|
11514
|
+
items.map((item, index) => /* @__PURE__ */ React79.createElement(SegmentedControlItem, { key: index, ...item, variant }))
|
|
11470
11515
|
));
|
|
11471
11516
|
});
|
|
11472
11517
|
|
|
11473
11518
|
// src/components/SelectionToolbar.tsx
|
|
11474
11519
|
import * as PopperPrimitive from "@radix-ui/react-popper";
|
|
11475
|
-
import
|
|
11520
|
+
import React80, { memo as memo33, useMemo as useMemo36 } from "react";
|
|
11476
11521
|
import { createPortal as createPortal3 } from "react-dom";
|
|
11477
11522
|
var createVirtualElement = (rect) => ({
|
|
11478
11523
|
getBoundingClientRect: () => ({
|
|
@@ -11494,7 +11539,7 @@ var SelectionToolbarContainer = memo33(
|
|
|
11494
11539
|
portalContainer
|
|
11495
11540
|
}) {
|
|
11496
11541
|
const portalScopeId = usePortalScopeId();
|
|
11497
|
-
const containerRef =
|
|
11542
|
+
const containerRef = React80.useRef(null);
|
|
11498
11543
|
const size2 = useSize(containerRef, "width");
|
|
11499
11544
|
const virtualRef = useMemo36(
|
|
11500
11545
|
() => ({
|
|
@@ -11502,7 +11547,7 @@ var SelectionToolbarContainer = memo33(
|
|
|
11502
11547
|
}),
|
|
11503
11548
|
[rect]
|
|
11504
11549
|
);
|
|
11505
|
-
const popperContent = /* @__PURE__ */
|
|
11550
|
+
const popperContent = /* @__PURE__ */ React80.createElement(
|
|
11506
11551
|
PopperPrimitive.Content,
|
|
11507
11552
|
{
|
|
11508
11553
|
...portalScopeProps(portalScopeId),
|
|
@@ -11519,7 +11564,7 @@ var SelectionToolbarContainer = memo33(
|
|
|
11519
11564
|
["--n-input-background"]: "transparent"
|
|
11520
11565
|
}
|
|
11521
11566
|
},
|
|
11522
|
-
/* @__PURE__ */
|
|
11567
|
+
/* @__PURE__ */ React80.createElement(
|
|
11523
11568
|
"div",
|
|
11524
11569
|
{
|
|
11525
11570
|
ref: containerRef,
|
|
@@ -11532,7 +11577,7 @@ var SelectionToolbarContainer = memo33(
|
|
|
11532
11577
|
children
|
|
11533
11578
|
)
|
|
11534
11579
|
);
|
|
11535
|
-
return /* @__PURE__ */
|
|
11580
|
+
return /* @__PURE__ */ React80.createElement(PopperPrimitive.Root, null, /* @__PURE__ */ React80.createElement(PopperPrimitive.Anchor, { virtualRef }), portalContainer ? createPortal3(popperContent, portalContainer) : popperContent);
|
|
11536
11581
|
}
|
|
11537
11582
|
);
|
|
11538
11583
|
|
|
@@ -11543,7 +11588,7 @@ import {
|
|
|
11543
11588
|
DropdownChevronIcon as DropdownChevronIcon3
|
|
11544
11589
|
} from "@noya-app/noya-icons";
|
|
11545
11590
|
import * as Select from "@radix-ui/react-select";
|
|
11546
|
-
import
|
|
11591
|
+
import React81, {
|
|
11547
11592
|
useMemo as useMemo37,
|
|
11548
11593
|
useState as useState28
|
|
11549
11594
|
} from "react";
|
|
@@ -11577,7 +11622,7 @@ var SelectMenuTrigger = memoGeneric(function SelectMenuTrigger2({
|
|
|
11577
11622
|
fieldId: props.id
|
|
11578
11623
|
});
|
|
11579
11624
|
const labelPosition = useLabelPosition();
|
|
11580
|
-
return /* @__PURE__ */
|
|
11625
|
+
return /* @__PURE__ */ React81.createElement(Select.SelectTrigger, { asChild: true, onFocus, onBlur }, /* @__PURE__ */ React81.createElement(
|
|
11581
11626
|
Button,
|
|
11582
11627
|
{
|
|
11583
11628
|
id,
|
|
@@ -11589,10 +11634,10 @@ var SelectMenuTrigger = memoGeneric(function SelectMenuTrigger2({
|
|
|
11589
11634
|
),
|
|
11590
11635
|
disabled
|
|
11591
11636
|
},
|
|
11592
|
-
icon && /* @__PURE__ */
|
|
11593
|
-
label && labelPosition === "inset" && /* @__PURE__ */
|
|
11594
|
-
/* @__PURE__ */
|
|
11595
|
-
/* @__PURE__ */
|
|
11637
|
+
icon && /* @__PURE__ */ React81.createElement("span", { className: "pr-1.5" }, renderIcon(icon)),
|
|
11638
|
+
label && labelPosition === "inset" && /* @__PURE__ */ React81.createElement("div", { className: insetEndStyles }, /* @__PURE__ */ React81.createElement(Label, { className: "pr-4 text-text-disabled", htmlFor: id }, label)),
|
|
11639
|
+
/* @__PURE__ */ React81.createElement("span", { className: "flex-1 flex" }, /* @__PURE__ */ React81.createElement(Select.Value, { placeholder })),
|
|
11640
|
+
/* @__PURE__ */ React81.createElement(
|
|
11596
11641
|
DropdownChevronIcon3,
|
|
11597
11642
|
{
|
|
11598
11643
|
className: cx(
|
|
@@ -11641,7 +11686,7 @@ var SelectMenu = memoGeneric(function SelectMenu2({
|
|
|
11641
11686
|
setInternalOpen(open2);
|
|
11642
11687
|
};
|
|
11643
11688
|
const readOnlyButton = useMemo37(
|
|
11644
|
-
() => /* @__PURE__ */
|
|
11689
|
+
() => /* @__PURE__ */ React81.createElement(
|
|
11645
11690
|
Button,
|
|
11646
11691
|
{
|
|
11647
11692
|
id,
|
|
@@ -11651,7 +11696,7 @@ var SelectMenu = memoGeneric(function SelectMenu2({
|
|
|
11651
11696
|
disabled
|
|
11652
11697
|
},
|
|
11653
11698
|
icon && renderIcon(icon),
|
|
11654
|
-
/* @__PURE__ */
|
|
11699
|
+
/* @__PURE__ */ React81.createElement("span", { className: "flex flex-1" }, selectedItem?.title ?? value)
|
|
11655
11700
|
),
|
|
11656
11701
|
[icon, id, style2, className, disabled, value, selectedItem]
|
|
11657
11702
|
);
|
|
@@ -11663,7 +11708,7 @@ var SelectMenu = memoGeneric(function SelectMenu2({
|
|
|
11663
11708
|
...contentStyleProp
|
|
11664
11709
|
};
|
|
11665
11710
|
}, [contentStyleProp]);
|
|
11666
|
-
const content = /* @__PURE__ */
|
|
11711
|
+
const content = /* @__PURE__ */ React81.createElement(
|
|
11667
11712
|
Select.Root,
|
|
11668
11713
|
{
|
|
11669
11714
|
value,
|
|
@@ -11671,7 +11716,7 @@ var SelectMenu = memoGeneric(function SelectMenu2({
|
|
|
11671
11716
|
open,
|
|
11672
11717
|
onOpenChange: handleOpenChange
|
|
11673
11718
|
},
|
|
11674
|
-
/* @__PURE__ */
|
|
11719
|
+
/* @__PURE__ */ React81.createElement(
|
|
11675
11720
|
SelectMenuTrigger,
|
|
11676
11721
|
{
|
|
11677
11722
|
id,
|
|
@@ -11686,7 +11731,7 @@ var SelectMenu = memoGeneric(function SelectMenu2({
|
|
|
11686
11731
|
label
|
|
11687
11732
|
}
|
|
11688
11733
|
),
|
|
11689
|
-
/* @__PURE__ */
|
|
11734
|
+
/* @__PURE__ */ React81.createElement(Select.Portal, null, /* @__PURE__ */ React81.createElement(
|
|
11690
11735
|
Select.Content,
|
|
11691
11736
|
{
|
|
11692
11737
|
...portalScopeProps(portalScopeId),
|
|
@@ -11697,14 +11742,14 @@ var SelectMenu = memoGeneric(function SelectMenu2({
|
|
|
11697
11742
|
align: "center",
|
|
11698
11743
|
style: contentStyle
|
|
11699
11744
|
},
|
|
11700
|
-
/* @__PURE__ */
|
|
11745
|
+
/* @__PURE__ */ React81.createElement(Select.ScrollUpButton, { className: scrollButtonStyles }, /* @__PURE__ */ React81.createElement(
|
|
11701
11746
|
ChevronUpIcon,
|
|
11702
11747
|
{
|
|
11703
11748
|
className: cx("transition-transform duration-100")
|
|
11704
11749
|
}
|
|
11705
11750
|
)),
|
|
11706
|
-
/* @__PURE__ */
|
|
11707
|
-
/* @__PURE__ */
|
|
11751
|
+
/* @__PURE__ */ React81.createElement(Select.Viewport, null, /* @__PURE__ */ React81.createElement(MenuViewport, { items, Components: Components3 })),
|
|
11752
|
+
/* @__PURE__ */ React81.createElement(Select.ScrollDownButton, { className: scrollButtonStyles }, /* @__PURE__ */ React81.createElement(ChevronDownIcon, null))
|
|
11708
11753
|
))
|
|
11709
11754
|
);
|
|
11710
11755
|
return readOnly ? readOnlyButton : content;
|
|
@@ -11712,7 +11757,7 @@ var SelectMenu = memoGeneric(function SelectMenu2({
|
|
|
11712
11757
|
|
|
11713
11758
|
// src/components/Slider.tsx
|
|
11714
11759
|
import * as RadixSlider from "@radix-ui/react-slider";
|
|
11715
|
-
import
|
|
11760
|
+
import React82, { memo as memo34, useCallback as useCallback31, useMemo as useMemo38 } from "react";
|
|
11716
11761
|
var THUMB_WIDTH = 8;
|
|
11717
11762
|
var thumbStyle = {
|
|
11718
11763
|
width: THUMB_WIDTH
|
|
@@ -11767,7 +11812,7 @@ var Slider = memo34(function Slider2({
|
|
|
11767
11812
|
}),
|
|
11768
11813
|
[percentage.raw]
|
|
11769
11814
|
);
|
|
11770
|
-
return /* @__PURE__ */
|
|
11815
|
+
return /* @__PURE__ */ React82.createElement(
|
|
11771
11816
|
RadixSlider.Root,
|
|
11772
11817
|
{
|
|
11773
11818
|
min,
|
|
@@ -11785,7 +11830,7 @@ var Slider = memo34(function Slider2({
|
|
|
11785
11830
|
onBlur,
|
|
11786
11831
|
disabled: readOnly
|
|
11787
11832
|
},
|
|
11788
|
-
/* @__PURE__ */
|
|
11833
|
+
/* @__PURE__ */ React82.createElement(RadixSlider.Track, { className: "flex-grow h-full rounded overflow-hidden bg-input-background" }, label && labelPosition === "inset" && /* @__PURE__ */ React82.createElement("div", { className: insetEndStyles2 }, /* @__PURE__ */ React82.createElement(Label, { htmlFor: id, className: "text-text-disabled" }, label)), /* @__PURE__ */ React82.createElement(
|
|
11789
11834
|
"div",
|
|
11790
11835
|
{
|
|
11791
11836
|
style: trackFillStyle,
|
|
@@ -11796,8 +11841,8 @@ var Slider = memo34(function Slider2({
|
|
|
11796
11841
|
)
|
|
11797
11842
|
}
|
|
11798
11843
|
)),
|
|
11799
|
-
label && labelPosition === "inset" && colorScheme !== void 0 && /* @__PURE__ */
|
|
11800
|
-
/* @__PURE__ */
|
|
11844
|
+
label && labelPosition === "inset" && colorScheme !== void 0 && /* @__PURE__ */ React82.createElement("div", { className: insetEndStyles2 }, /* @__PURE__ */ React82.createElement(Label, { className: "text-white overflow-hidden", style: labelStyle }, label)),
|
|
11845
|
+
/* @__PURE__ */ React82.createElement(
|
|
11801
11846
|
RadixSlider.Thumb,
|
|
11802
11847
|
{
|
|
11803
11848
|
style: thumbStyle,
|
|
@@ -11813,27 +11858,27 @@ var Slider = memo34(function Slider2({
|
|
|
11813
11858
|
});
|
|
11814
11859
|
|
|
11815
11860
|
// src/components/sorting/createSharedDrag.tsx
|
|
11816
|
-
import * as
|
|
11861
|
+
import * as React83 from "react";
|
|
11817
11862
|
function createSharedDrag() {
|
|
11818
|
-
const dragRegistrationContext =
|
|
11819
|
-
const activeDragContext =
|
|
11863
|
+
const dragRegistrationContext = React83.createContext(null);
|
|
11864
|
+
const activeDragContext = React83.createContext(
|
|
11820
11865
|
null
|
|
11821
11866
|
);
|
|
11822
11867
|
const sharedDragProps = {
|
|
11823
11868
|
dragRegistrationContext,
|
|
11824
11869
|
activeDragContext
|
|
11825
11870
|
};
|
|
11826
|
-
const Provider3 = ({ children }) => /* @__PURE__ */
|
|
11871
|
+
const Provider3 = ({ children }) => /* @__PURE__ */ React83.createElement(SharedDragProvider, { sharedDragProps }, children);
|
|
11827
11872
|
return {
|
|
11828
11873
|
Provider: Provider3,
|
|
11829
|
-
Sortable: (props) => /* @__PURE__ */
|
|
11874
|
+
Sortable: (props) => /* @__PURE__ */ React83.createElement(Sortable, { sharedDragProps, ...props }),
|
|
11830
11875
|
props: sharedDragProps
|
|
11831
11876
|
};
|
|
11832
11877
|
}
|
|
11833
11878
|
|
|
11834
11879
|
// src/components/Switch.tsx
|
|
11835
11880
|
import * as SwitchPrimitive from "@radix-ui/react-switch";
|
|
11836
|
-
import * as
|
|
11881
|
+
import * as React84 from "react";
|
|
11837
11882
|
var Switch = function Switch2({
|
|
11838
11883
|
id,
|
|
11839
11884
|
value,
|
|
@@ -11845,7 +11890,7 @@ var Switch = function Switch2({
|
|
|
11845
11890
|
style: style2,
|
|
11846
11891
|
className
|
|
11847
11892
|
}) {
|
|
11848
|
-
return /* @__PURE__ */
|
|
11893
|
+
return /* @__PURE__ */ React84.createElement(
|
|
11849
11894
|
SwitchPrimitive.Root,
|
|
11850
11895
|
{
|
|
11851
11896
|
id,
|
|
@@ -11864,12 +11909,12 @@ var Switch = function Switch2({
|
|
|
11864
11909
|
onFocus,
|
|
11865
11910
|
onBlur
|
|
11866
11911
|
},
|
|
11867
|
-
/* @__PURE__ */
|
|
11912
|
+
/* @__PURE__ */ React84.createElement(SwitchPrimitive.Thumb, { className: "block w-[15px] h-[15px] bg-background rounded-full transition-transform translate-x-[2px] data-[state=checked]:translate-x-[15px]" })
|
|
11868
11913
|
);
|
|
11869
11914
|
};
|
|
11870
11915
|
|
|
11871
11916
|
// src/components/UserPointer.tsx
|
|
11872
|
-
import
|
|
11917
|
+
import React85, { memo as memo35, useMemo as useMemo39 } from "react";
|
|
11873
11918
|
var UserPointerContainer = memo35(function UserPointerContainer2({
|
|
11874
11919
|
point,
|
|
11875
11920
|
visible,
|
|
@@ -11877,7 +11922,7 @@ var UserPointerContainer = memo35(function UserPointerContainer2({
|
|
|
11877
11922
|
className,
|
|
11878
11923
|
style: style2
|
|
11879
11924
|
}) {
|
|
11880
|
-
return /* @__PURE__ */
|
|
11925
|
+
return /* @__PURE__ */ React85.createElement(
|
|
11881
11926
|
"div",
|
|
11882
11927
|
{
|
|
11883
11928
|
style: {
|
|
@@ -11900,7 +11945,7 @@ var UserNameTag = memo35(function UserNameTag2({
|
|
|
11900
11945
|
style: style2,
|
|
11901
11946
|
children
|
|
11902
11947
|
}) {
|
|
11903
|
-
return /* @__PURE__ */
|
|
11948
|
+
return /* @__PURE__ */ React85.createElement(
|
|
11904
11949
|
"span",
|
|
11905
11950
|
{
|
|
11906
11951
|
className: cx(
|
|
@@ -11923,7 +11968,7 @@ var UserPointerIcon = memo35(function PointerIcon({
|
|
|
11923
11968
|
style: style2
|
|
11924
11969
|
}) {
|
|
11925
11970
|
const points = "0,5 10,0 10,10";
|
|
11926
|
-
return /* @__PURE__ */
|
|
11971
|
+
return /* @__PURE__ */ React85.createElement(
|
|
11927
11972
|
"svg",
|
|
11928
11973
|
{
|
|
11929
11974
|
width: size2,
|
|
@@ -11938,7 +11983,7 @@ var UserPointerIcon = memo35(function PointerIcon({
|
|
|
11938
11983
|
...style2
|
|
11939
11984
|
}
|
|
11940
11985
|
},
|
|
11941
|
-
/* @__PURE__ */
|
|
11986
|
+
/* @__PURE__ */ React85.createElement(
|
|
11942
11987
|
"polygon",
|
|
11943
11988
|
{
|
|
11944
11989
|
points,
|
|
@@ -11975,7 +12020,7 @@ var UserPointer = memo35(function UserPointer2({
|
|
|
11975
12020
|
() => ({ marginLeft: `${POINTER_SIZE - POINTER_OVERLAP + 1}px` }),
|
|
11976
12021
|
[]
|
|
11977
12022
|
);
|
|
11978
|
-
return /* @__PURE__ */
|
|
12023
|
+
return /* @__PURE__ */ React85.createElement(
|
|
11979
12024
|
UserPointerContainer,
|
|
11980
12025
|
{
|
|
11981
12026
|
point,
|
|
@@ -11983,14 +12028,14 @@ var UserPointer = memo35(function UserPointer2({
|
|
|
11983
12028
|
className,
|
|
11984
12029
|
style: style2
|
|
11985
12030
|
},
|
|
11986
|
-
name && /* @__PURE__ */
|
|
12031
|
+
name && /* @__PURE__ */ React85.createElement("div", { className: "relative" }, /* @__PURE__ */ React85.createElement(
|
|
11987
12032
|
UserPointerIcon,
|
|
11988
12033
|
{
|
|
11989
12034
|
size: POINTER_SIZE,
|
|
11990
12035
|
color: userBackgroundColor,
|
|
11991
12036
|
style: pointerOverlapStyle
|
|
11992
12037
|
}
|
|
11993
|
-
), /* @__PURE__ */
|
|
12038
|
+
), /* @__PURE__ */ React85.createElement(
|
|
11994
12039
|
UserNameTag,
|
|
11995
12040
|
{
|
|
11996
12041
|
backgroundColor: userBackgroundColor,
|
|
@@ -12003,7 +12048,7 @@ var UserPointer = memo35(function UserPointer2({
|
|
|
12003
12048
|
|
|
12004
12049
|
// src/components/workspace/WorkspaceLayout.tsx
|
|
12005
12050
|
import { useKeyboardShortcuts as useKeyboardShortcuts3 } from "@noya-app/noya-keymap";
|
|
12006
|
-
import
|
|
12051
|
+
import React89, {
|
|
12007
12052
|
forwardRef as forwardRef27,
|
|
12008
12053
|
memo as memo38,
|
|
12009
12054
|
useCallback as useCallback32,
|
|
@@ -12013,7 +12058,7 @@ import React88, {
|
|
|
12013
12058
|
} from "react";
|
|
12014
12059
|
|
|
12015
12060
|
// src/hooks/useWindowSize.tsx
|
|
12016
|
-
import { useEffect as
|
|
12061
|
+
import { useEffect as useEffect21, useState as useState29 } from "react";
|
|
12017
12062
|
function useWindowSize() {
|
|
12018
12063
|
const [size2, setSize] = useState29(
|
|
12019
12064
|
typeof window === "undefined" ? { width: 0, height: 0 } : {
|
|
@@ -12021,7 +12066,7 @@ function useWindowSize() {
|
|
|
12021
12066
|
height: window.innerHeight
|
|
12022
12067
|
}
|
|
12023
12068
|
);
|
|
12024
|
-
|
|
12069
|
+
useEffect21(() => {
|
|
12025
12070
|
const handleResize = () => setSize({
|
|
12026
12071
|
width: window.innerWidth,
|
|
12027
12072
|
height: window.innerHeight
|
|
@@ -12033,10 +12078,10 @@ function useWindowSize() {
|
|
|
12033
12078
|
}
|
|
12034
12079
|
|
|
12035
12080
|
// src/components/workspace/DrawerWorkspaceLayout.tsx
|
|
12036
|
-
import
|
|
12081
|
+
import React87, { memo as memo36, useLayoutEffect as useLayoutEffect10, useRef as useRef26, useState as useState30 } from "react";
|
|
12037
12082
|
|
|
12038
12083
|
// src/hooks/usePreservePanelSize.tsx
|
|
12039
|
-
import { useLayoutEffect as
|
|
12084
|
+
import { useLayoutEffect as useLayoutEffect9, useRef as useRef25 } from "react";
|
|
12040
12085
|
var EDITOR_PANEL_GROUP_ID = "editor-panel-group";
|
|
12041
12086
|
var LEFT_SIDEBAR_ID = "editor-left-sidebar";
|
|
12042
12087
|
var RIGHT_SIDEBAR_ID = "editor-right-sidebar";
|
|
@@ -12044,7 +12089,7 @@ var CONTENT_AREA_ID = "editor-content-area";
|
|
|
12044
12089
|
function usePreservePanelSize(panelGroupRef, setPanelLayoutState) {
|
|
12045
12090
|
const windowSize = useWindowSize();
|
|
12046
12091
|
const layoutRef = useRef25();
|
|
12047
|
-
|
|
12092
|
+
useLayoutEffect9(() => {
|
|
12048
12093
|
const panelGroup = document.querySelector(
|
|
12049
12094
|
`[data-panel-group-id="${EDITOR_PANEL_GROUP_ID}"]`
|
|
12050
12095
|
);
|
|
@@ -12087,7 +12132,7 @@ function usePreservePanelSize(panelGroupRef, setPanelLayoutState) {
|
|
|
12087
12132
|
panelGroupObserver.disconnect();
|
|
12088
12133
|
};
|
|
12089
12134
|
}, [panelGroupRef, setPanelLayoutState]);
|
|
12090
|
-
|
|
12135
|
+
useLayoutEffect9(() => {
|
|
12091
12136
|
if (!layoutRef.current) return;
|
|
12092
12137
|
const {
|
|
12093
12138
|
windowWidth: oldWindowWidth,
|
|
@@ -12184,7 +12229,7 @@ var DrawerWorkspaceLayout = memo36(function DrawerWorkspaceLayout2({
|
|
|
12184
12229
|
}) {
|
|
12185
12230
|
const portalContainer = useRef26(null);
|
|
12186
12231
|
const [mounted, setMounted] = useState30(false);
|
|
12187
|
-
|
|
12232
|
+
useLayoutEffect10(() => {
|
|
12188
12233
|
if (mounted) return;
|
|
12189
12234
|
setMounted(true);
|
|
12190
12235
|
handleChangeLayoutState({
|
|
@@ -12194,14 +12239,14 @@ var DrawerWorkspaceLayout = memo36(function DrawerWorkspaceLayout2({
|
|
|
12194
12239
|
}, [handleChangeLayoutState, mounted]);
|
|
12195
12240
|
const leftSidebarCollapsed = internalLayoutState?.leftSidebarCollapsed ?? false;
|
|
12196
12241
|
const rightSidebarCollapsed = internalLayoutState?.rightSidebarCollapsed ?? false;
|
|
12197
|
-
return /* @__PURE__ */
|
|
12242
|
+
return /* @__PURE__ */ React87.createElement(
|
|
12198
12243
|
"div",
|
|
12199
12244
|
{
|
|
12200
12245
|
ref: portalContainer,
|
|
12201
12246
|
id: EDITOR_PANEL_GROUP_ID,
|
|
12202
12247
|
className: "flex flex-1 relative focus:outline-none"
|
|
12203
12248
|
},
|
|
12204
|
-
leftPanel && /* @__PURE__ */
|
|
12249
|
+
leftPanel && /* @__PURE__ */ React87.createElement(
|
|
12205
12250
|
Drawer,
|
|
12206
12251
|
{
|
|
12207
12252
|
id: LEFT_SIDEBAR_ID,
|
|
@@ -12222,7 +12267,7 @@ var DrawerWorkspaceLayout = memo36(function DrawerWorkspaceLayout2({
|
|
|
12222
12267
|
leftPanel
|
|
12223
12268
|
),
|
|
12224
12269
|
centerPanel,
|
|
12225
|
-
rightPanel && /* @__PURE__ */
|
|
12270
|
+
rightPanel && /* @__PURE__ */ React87.createElement(
|
|
12226
12271
|
Drawer,
|
|
12227
12272
|
{
|
|
12228
12273
|
id: RIGHT_SIDEBAR_ID,
|
|
@@ -12246,7 +12291,7 @@ var DrawerWorkspaceLayout = memo36(function DrawerWorkspaceLayout2({
|
|
|
12246
12291
|
});
|
|
12247
12292
|
|
|
12248
12293
|
// src/components/workspace/PanelWorkspaceLayout.tsx
|
|
12249
|
-
import
|
|
12294
|
+
import React88, { memo as memo37, useRef as useRef27 } from "react";
|
|
12250
12295
|
import {
|
|
12251
12296
|
Panel,
|
|
12252
12297
|
PanelGroup,
|
|
@@ -12267,7 +12312,7 @@ var PanelWorkspaceLayout = memo37(function PanelWorkspaceLayout2({
|
|
|
12267
12312
|
}) {
|
|
12268
12313
|
const panelGroupRef = useRef27(null);
|
|
12269
12314
|
usePreservePanelSize(panelGroupRef, handleChangeLayoutState);
|
|
12270
|
-
return /* @__PURE__ */
|
|
12315
|
+
return /* @__PURE__ */ React88.createElement(
|
|
12271
12316
|
PanelGroup,
|
|
12272
12317
|
{
|
|
12273
12318
|
ref: panelGroupRef,
|
|
@@ -12276,7 +12321,7 @@ var PanelWorkspaceLayout = memo37(function PanelWorkspaceLayout2({
|
|
|
12276
12321
|
direction: "horizontal",
|
|
12277
12322
|
autoSaveId: autoSavePrefix ? `${autoSavePrefix}--${EDITOR_PANEL_GROUP_ID}` : void 0
|
|
12278
12323
|
},
|
|
12279
|
-
leftPanel && /* @__PURE__ */
|
|
12324
|
+
leftPanel && /* @__PURE__ */ React88.createElement(React88.Fragment, null, /* @__PURE__ */ React88.createElement(
|
|
12280
12325
|
Panel,
|
|
12281
12326
|
{
|
|
12282
12327
|
id: LEFT_SIDEBAR_ID,
|
|
@@ -12289,8 +12334,8 @@ var PanelWorkspaceLayout = memo37(function PanelWorkspaceLayout2({
|
|
|
12289
12334
|
collapsible: true
|
|
12290
12335
|
},
|
|
12291
12336
|
internalLayoutState?.leftSidebarCollapsed ? null : leftPanel
|
|
12292
|
-
), /* @__PURE__ */
|
|
12293
|
-
/* @__PURE__ */
|
|
12337
|
+
), /* @__PURE__ */ React88.createElement(PanelResizeHandle, { className: "cursor-col-resize w-px h-full bg-divider" })),
|
|
12338
|
+
/* @__PURE__ */ React88.createElement(
|
|
12294
12339
|
Panel,
|
|
12295
12340
|
{
|
|
12296
12341
|
id: CONTENT_AREA_ID,
|
|
@@ -12301,7 +12346,7 @@ var PanelWorkspaceLayout = memo37(function PanelWorkspaceLayout2({
|
|
|
12301
12346
|
},
|
|
12302
12347
|
centerPanel
|
|
12303
12348
|
),
|
|
12304
|
-
rightPanel && /* @__PURE__ */
|
|
12349
|
+
rightPanel && /* @__PURE__ */ React88.createElement(React88.Fragment, null, /* @__PURE__ */ React88.createElement(PanelResizeHandle, { className: "cursor-col-resize w-px h-full bg-divider" }), /* @__PURE__ */ React88.createElement(
|
|
12305
12350
|
Panel,
|
|
12306
12351
|
{
|
|
12307
12352
|
id: RIGHT_SIDEBAR_ID,
|
|
@@ -12350,7 +12395,7 @@ var WorkspaceLayout = forwardRef27(function WorkspaceLayout2({
|
|
|
12350
12395
|
} = {},
|
|
12351
12396
|
theme
|
|
12352
12397
|
}, forwardedRef) {
|
|
12353
|
-
const containerRef =
|
|
12398
|
+
const containerRef = React89.useRef(null);
|
|
12354
12399
|
const containerSize = useSize(containerRef);
|
|
12355
12400
|
const windowSize = useWindowSize();
|
|
12356
12401
|
const parentSize = detectSize === "window" ? windowSize : containerSize && containerSize.width > 0 ? containerSize : windowSize;
|
|
@@ -12448,7 +12493,7 @@ var WorkspaceLayout = forwardRef27(function WorkspaceLayout2({
|
|
|
12448
12493
|
}
|
|
12449
12494
|
});
|
|
12450
12495
|
const centerPanelPercentage = 100 - (left ? leftSidebarPercentage : 0) - (right ? rightSidebarPercentage : 0);
|
|
12451
|
-
const leftPanel = left ? /* @__PURE__ */
|
|
12496
|
+
const leftPanel = left ? /* @__PURE__ */ React89.createElement(
|
|
12452
12497
|
PanelInner,
|
|
12453
12498
|
{
|
|
12454
12499
|
style: leftStyle,
|
|
@@ -12456,7 +12501,7 @@ var WorkspaceLayout = forwardRef27(function WorkspaceLayout2({
|
|
|
12456
12501
|
},
|
|
12457
12502
|
left
|
|
12458
12503
|
) : null;
|
|
12459
|
-
const rightPanel = right ? /* @__PURE__ */
|
|
12504
|
+
const rightPanel = right ? /* @__PURE__ */ React89.createElement(
|
|
12460
12505
|
PanelInner,
|
|
12461
12506
|
{
|
|
12462
12507
|
style: rightStyle,
|
|
@@ -12464,7 +12509,7 @@ var WorkspaceLayout = forwardRef27(function WorkspaceLayout2({
|
|
|
12464
12509
|
},
|
|
12465
12510
|
right
|
|
12466
12511
|
) : null;
|
|
12467
|
-
const centerPanel = /* @__PURE__ */
|
|
12512
|
+
const centerPanel = /* @__PURE__ */ React89.createElement(PanelInner, { className: "bg-canvas-background" }, children);
|
|
12468
12513
|
const leftSidebarOptions = {
|
|
12469
12514
|
minSize: leftSidebarMinPercentage,
|
|
12470
12515
|
maxSize: leftSidebarMaxPercentage,
|
|
@@ -12479,7 +12524,7 @@ var WorkspaceLayout = forwardRef27(function WorkspaceLayout2({
|
|
|
12479
12524
|
};
|
|
12480
12525
|
const LayoutComponent = sideType === "panel" ? PanelWorkspaceLayout : sideType === "drawer" ? DrawerWorkspaceLayout : parentSize.width > sideTypeBreakpoint ? PanelWorkspaceLayout : DrawerWorkspaceLayout;
|
|
12481
12526
|
const readyToRender = detectSize === "window" || containerSize && containerSize.width > 0;
|
|
12482
|
-
return /* @__PURE__ */
|
|
12527
|
+
return /* @__PURE__ */ React89.createElement(
|
|
12483
12528
|
"div",
|
|
12484
12529
|
{
|
|
12485
12530
|
ref: containerRef,
|
|
@@ -12489,7 +12534,7 @@ var WorkspaceLayout = forwardRef27(function WorkspaceLayout2({
|
|
|
12489
12534
|
"data-theme": theme
|
|
12490
12535
|
},
|
|
12491
12536
|
toolbar,
|
|
12492
|
-
/* @__PURE__ */
|
|
12537
|
+
/* @__PURE__ */ React89.createElement("div", { className: "flex flex-row flex-1 relative" }, readyToRender && /* @__PURE__ */ React89.createElement(
|
|
12493
12538
|
LayoutComponent,
|
|
12494
12539
|
{
|
|
12495
12540
|
leftPanel,
|
|
@@ -12512,7 +12557,7 @@ var PanelInner = memo38(function PanelInner2({
|
|
|
12512
12557
|
style: style2,
|
|
12513
12558
|
className
|
|
12514
12559
|
}) {
|
|
12515
|
-
return /* @__PURE__ */
|
|
12560
|
+
return /* @__PURE__ */ React89.createElement("div", { style: style2, className: cx("absolute inset-0 flex", className) }, children);
|
|
12516
12561
|
});
|
|
12517
12562
|
|
|
12518
12563
|
// src/hooks/usePlatform.ts
|
|
@@ -12525,7 +12570,7 @@ function usePlatformModKey() {
|
|
|
12525
12570
|
}
|
|
12526
12571
|
|
|
12527
12572
|
// src/hooks/useTheme.ts
|
|
12528
|
-
import { useState as useState32, useEffect as
|
|
12573
|
+
import { useState as useState32, useEffect as useEffect22 } from "react";
|
|
12529
12574
|
function useTheme() {
|
|
12530
12575
|
const [theme, setTheme] = useState32("light");
|
|
12531
12576
|
const checkTheme = () => {
|
|
@@ -12539,7 +12584,7 @@ function useTheme() {
|
|
|
12539
12584
|
break;
|
|
12540
12585
|
}
|
|
12541
12586
|
};
|
|
12542
|
-
|
|
12587
|
+
useEffect22(() => {
|
|
12543
12588
|
checkTheme();
|
|
12544
12589
|
const observer = new MutationObserver((mutations) => {
|
|
12545
12590
|
mutations.forEach((mutation) => {
|
|
@@ -12641,13 +12686,13 @@ function acceptsDrop({
|
|
|
12641
12686
|
if (!allowSiblings) {
|
|
12642
12687
|
return false;
|
|
12643
12688
|
}
|
|
12644
|
-
return defaultAcceptsDrop(
|
|
12645
|
-
sourceIndexPath.at(-1),
|
|
12646
|
-
targetIndexPath.at(-1),
|
|
12689
|
+
return defaultAcceptsDrop({
|
|
12690
|
+
sourceIndex: sourceIndexPath.at(-1),
|
|
12691
|
+
targetIndex: targetIndexPath.at(-1),
|
|
12647
12692
|
position,
|
|
12648
|
-
"",
|
|
12649
|
-
""
|
|
12650
|
-
);
|
|
12693
|
+
sourceListId: "",
|
|
12694
|
+
targetListId: ""
|
|
12695
|
+
});
|
|
12651
12696
|
}
|
|
12652
12697
|
return true;
|
|
12653
12698
|
}
|
|
@@ -12667,11 +12712,11 @@ var SUPPORTED_CANVAS_UPLOAD_TYPES = [
|
|
|
12667
12712
|
|
|
12668
12713
|
// src/components/DimensionInput.tsx
|
|
12669
12714
|
import { round } from "@noya-app/noya-utils";
|
|
12670
|
-
import * as
|
|
12715
|
+
import * as React90 from "react";
|
|
12671
12716
|
function getNewValue(value, mode, delta) {
|
|
12672
12717
|
return delta === void 0 ? value : mode === "replace" ? delta : value + delta;
|
|
12673
12718
|
}
|
|
12674
|
-
var DimensionInput =
|
|
12719
|
+
var DimensionInput = React90.memo(function DimensionInput2({
|
|
12675
12720
|
id,
|
|
12676
12721
|
value,
|
|
12677
12722
|
onSetValue,
|
|
@@ -12681,15 +12726,15 @@ var DimensionInput = React89.memo(function DimensionInput2({
|
|
|
12681
12726
|
disabled,
|
|
12682
12727
|
trigger = "submit"
|
|
12683
12728
|
}) {
|
|
12684
|
-
const handleNudgeValue =
|
|
12729
|
+
const handleNudgeValue = React90.useCallback(
|
|
12685
12730
|
(value2) => onSetValue(value2, "adjust"),
|
|
12686
12731
|
[onSetValue]
|
|
12687
12732
|
);
|
|
12688
|
-
const handleSetValue =
|
|
12733
|
+
const handleSetValue = React90.useCallback(
|
|
12689
12734
|
(value2) => onSetValue(value2, "replace"),
|
|
12690
12735
|
[onSetValue]
|
|
12691
12736
|
);
|
|
12692
|
-
return /* @__PURE__ */
|
|
12737
|
+
return /* @__PURE__ */ React90.createElement(LabeledField, { label, labelPosition: "inset" }, /* @__PURE__ */ React90.createElement(InputField2.Root, { id, width: size2 }, /* @__PURE__ */ React90.createElement(
|
|
12693
12738
|
InputField2.NumberInput,
|
|
12694
12739
|
{
|
|
12695
12740
|
value: value === void 0 ? value : round(value, 2),
|
|
@@ -12716,11 +12761,11 @@ __export(InspectorPrimitives_exports, {
|
|
|
12716
12761
|
Title: () => Title4,
|
|
12717
12762
|
VerticalSeparator: () => VerticalSeparator
|
|
12718
12763
|
});
|
|
12719
|
-
import
|
|
12764
|
+
import React91, {
|
|
12720
12765
|
forwardRef as forwardRef28,
|
|
12721
12766
|
memo as memo40
|
|
12722
12767
|
} from "react";
|
|
12723
|
-
var Section2 = forwardRef28(({ className, ...props }, ref) => /* @__PURE__ */
|
|
12768
|
+
var Section2 = forwardRef28(({ className, ...props }, ref) => /* @__PURE__ */ React91.createElement(
|
|
12724
12769
|
"div",
|
|
12725
12770
|
{
|
|
12726
12771
|
ref,
|
|
@@ -12728,8 +12773,8 @@ var Section2 = forwardRef28(({ className, ...props }, ref) => /* @__PURE__ */ Re
|
|
|
12728
12773
|
...props
|
|
12729
12774
|
}
|
|
12730
12775
|
));
|
|
12731
|
-
var SectionHeader3 = forwardRef28(({ className, ...props }, ref) => /* @__PURE__ */
|
|
12732
|
-
var Title4 = forwardRef28(({ className, $textStyle, ...props }, ref) => /* @__PURE__ */
|
|
12776
|
+
var SectionHeader3 = forwardRef28(({ className, ...props }, ref) => /* @__PURE__ */ React91.createElement("div", { ref, className: cx(`flex items-center `, className), ...props }));
|
|
12777
|
+
var Title4 = forwardRef28(({ className, $textStyle, ...props }, ref) => /* @__PURE__ */ React91.createElement(
|
|
12733
12778
|
"div",
|
|
12734
12779
|
{
|
|
12735
12780
|
ref,
|
|
@@ -12740,7 +12785,7 @@ var Title4 = forwardRef28(({ className, $textStyle, ...props }, ref) => /* @__PU
|
|
|
12740
12785
|
...props
|
|
12741
12786
|
}
|
|
12742
12787
|
));
|
|
12743
|
-
var Row = forwardRef28(({ className, ...props }, ref) => /* @__PURE__ */
|
|
12788
|
+
var Row = forwardRef28(({ className, ...props }, ref) => /* @__PURE__ */ React91.createElement(
|
|
12744
12789
|
"div",
|
|
12745
12790
|
{
|
|
12746
12791
|
ref,
|
|
@@ -12748,7 +12793,7 @@ var Row = forwardRef28(({ className, ...props }, ref) => /* @__PURE__ */ React90
|
|
|
12748
12793
|
...props
|
|
12749
12794
|
}
|
|
12750
12795
|
));
|
|
12751
|
-
var Column = forwardRef28(({ className, ...props }, ref) => /* @__PURE__ */
|
|
12796
|
+
var Column = forwardRef28(({ className, ...props }, ref) => /* @__PURE__ */ React91.createElement(
|
|
12752
12797
|
"div",
|
|
12753
12798
|
{
|
|
12754
12799
|
ref,
|
|
@@ -12756,7 +12801,7 @@ var Column = forwardRef28(({ className, ...props }, ref) => /* @__PURE__ */ Reac
|
|
|
12756
12801
|
...props
|
|
12757
12802
|
}
|
|
12758
12803
|
));
|
|
12759
|
-
var Checkbox3 = forwardRef28(({ className, ...props }, ref) => /* @__PURE__ */
|
|
12804
|
+
var Checkbox3 = forwardRef28(({ className, ...props }, ref) => /* @__PURE__ */ React91.createElement(
|
|
12760
12805
|
"input",
|
|
12761
12806
|
{
|
|
12762
12807
|
ref,
|
|
@@ -12765,7 +12810,7 @@ var Checkbox3 = forwardRef28(({ className, ...props }, ref) => /* @__PURE__ */ R
|
|
|
12765
12810
|
...props
|
|
12766
12811
|
}
|
|
12767
12812
|
));
|
|
12768
|
-
var Text3 = forwardRef28(({ className, ...props }, ref) => /* @__PURE__ */
|
|
12813
|
+
var Text3 = forwardRef28(({ className, ...props }, ref) => /* @__PURE__ */ React91.createElement(
|
|
12769
12814
|
"span",
|
|
12770
12815
|
{
|
|
12771
12816
|
ref,
|
|
@@ -12773,14 +12818,14 @@ var Text3 = forwardRef28(({ className, ...props }, ref) => /* @__PURE__ */ React
|
|
|
12773
12818
|
...props
|
|
12774
12819
|
}
|
|
12775
12820
|
));
|
|
12776
|
-
var VerticalSeparator = () => /* @__PURE__ */
|
|
12777
|
-
var HorizontalSeparator = () => /* @__PURE__ */
|
|
12821
|
+
var VerticalSeparator = () => /* @__PURE__ */ React91.createElement(Spacer.Vertical, { size: "inspector-v-separator" });
|
|
12822
|
+
var HorizontalSeparator = () => /* @__PURE__ */ React91.createElement(Spacer.Horizontal, { size: "inspector-h-separator" });
|
|
12778
12823
|
var RowLabel = forwardRef28(function RowLabel2({
|
|
12779
12824
|
className,
|
|
12780
12825
|
$textStyle,
|
|
12781
12826
|
...props
|
|
12782
12827
|
}, ref) {
|
|
12783
|
-
return /* @__PURE__ */
|
|
12828
|
+
return /* @__PURE__ */ React91.createElement(
|
|
12784
12829
|
"label",
|
|
12785
12830
|
{
|
|
12786
12831
|
ref,
|
|
@@ -12800,11 +12845,11 @@ var LabeledRow = memo40(function LabeledRow2({
|
|
|
12800
12845
|
right,
|
|
12801
12846
|
className
|
|
12802
12847
|
}) {
|
|
12803
|
-
return /* @__PURE__ */
|
|
12848
|
+
return /* @__PURE__ */ React91.createElement(Row, { id, className }, /* @__PURE__ */ React91.createElement(Column, null, /* @__PURE__ */ React91.createElement(RowLabel, { $textStyle: labelTextStyle }, label, right && /* @__PURE__ */ React91.createElement(Spacer.Horizontal, null), right), /* @__PURE__ */ React91.createElement(Row, null, children)));
|
|
12804
12849
|
});
|
|
12805
12850
|
|
|
12806
12851
|
// src/components/BaseToolbar.tsx
|
|
12807
|
-
import
|
|
12852
|
+
import React92 from "react";
|
|
12808
12853
|
var toolbarStyle = {
|
|
12809
12854
|
[cssVarNames.colors.inputBackground]: "transparent"
|
|
12810
12855
|
};
|
|
@@ -12815,7 +12860,7 @@ function BaseToolbar({
|
|
|
12815
12860
|
logo,
|
|
12816
12861
|
showDivider = true
|
|
12817
12862
|
}) {
|
|
12818
|
-
return /* @__PURE__ */
|
|
12863
|
+
return /* @__PURE__ */ React92.createElement("div", { className: "flex flex-col", style: toolbarStyle }, /* @__PURE__ */ React92.createElement(
|
|
12819
12864
|
"div",
|
|
12820
12865
|
{
|
|
12821
12866
|
className: "flex items-center pr-2.5 bg-sidebar-background flex-none relative @container/toolbar",
|
|
@@ -12823,10 +12868,10 @@ function BaseToolbar({
|
|
|
12823
12868
|
flex: `0 0 ${cssVars.spacing.toolbarHeight}`
|
|
12824
12869
|
}
|
|
12825
12870
|
},
|
|
12826
|
-
logo && /* @__PURE__ */
|
|
12827
|
-
/* @__PURE__ */
|
|
12828
|
-
left && /* @__PURE__ */
|
|
12829
|
-
/* @__PURE__ */
|
|
12871
|
+
logo && /* @__PURE__ */ React92.createElement(React92.Fragment, null, logo, /* @__PURE__ */ React92.createElement(DividerVertical, null)),
|
|
12872
|
+
/* @__PURE__ */ React92.createElement(Spacer.Horizontal, { size: 10 }),
|
|
12873
|
+
left && /* @__PURE__ */ React92.createElement(React92.Fragment, null, /* @__PURE__ */ React92.createElement("div", { className: "flex gap-toolbar-separator" }, left), /* @__PURE__ */ React92.createElement(Spacer.Horizontal, { size: 10 })),
|
|
12874
|
+
/* @__PURE__ */ React92.createElement("div", { className: "flex items-center justify-center text-text-muted pointer-events-none @2xl/toolbar:absolute inset-0" }, /* @__PURE__ */ React92.createElement(
|
|
12830
12875
|
"div",
|
|
12831
12876
|
{
|
|
12832
12877
|
style: {
|
|
@@ -12838,15 +12883,15 @@ function BaseToolbar({
|
|
|
12838
12883
|
},
|
|
12839
12884
|
children
|
|
12840
12885
|
)),
|
|
12841
|
-
/* @__PURE__ */
|
|
12842
|
-
/* @__PURE__ */
|
|
12843
|
-
/* @__PURE__ */
|
|
12844
|
-
), showDivider && /* @__PURE__ */
|
|
12886
|
+
/* @__PURE__ */ React92.createElement(Spacer.Horizontal, null),
|
|
12887
|
+
/* @__PURE__ */ React92.createElement(Spacer.Horizontal, { size: 10 }),
|
|
12888
|
+
/* @__PURE__ */ React92.createElement("div", { className: "flex gap-toolbar-separator" }, right)
|
|
12889
|
+
), showDivider && /* @__PURE__ */ React92.createElement(Divider, { variant: "strong" }));
|
|
12845
12890
|
}
|
|
12846
12891
|
|
|
12847
12892
|
// src/components/Toolbar.tsx
|
|
12848
12893
|
import { useKeyboardShortcuts as useKeyboardShortcuts4 } from "@noya-app/noya-keymap";
|
|
12849
|
-
import
|
|
12894
|
+
import React93 from "react";
|
|
12850
12895
|
var iconButtonStyle = {
|
|
12851
12896
|
height: 27,
|
|
12852
12897
|
width: 27,
|
|
@@ -12856,8 +12901,8 @@ var ToolbarMenuDropdown = memoGeneric(function ToolbarMenuDropdown2({
|
|
|
12856
12901
|
item,
|
|
12857
12902
|
onSelectMenuItem
|
|
12858
12903
|
}) {
|
|
12859
|
-
const [open, setOpen] =
|
|
12860
|
-
return /* @__PURE__ */
|
|
12904
|
+
const [open, setOpen] = React93.useState(false);
|
|
12905
|
+
return /* @__PURE__ */ React93.createElement(
|
|
12861
12906
|
DropdownMenu,
|
|
12862
12907
|
{
|
|
12863
12908
|
open,
|
|
@@ -12869,7 +12914,7 @@ var ToolbarMenuDropdown = memoGeneric(function ToolbarMenuDropdown2({
|
|
|
12869
12914
|
}
|
|
12870
12915
|
}
|
|
12871
12916
|
},
|
|
12872
|
-
/* @__PURE__ */
|
|
12917
|
+
/* @__PURE__ */ React93.createElement(
|
|
12873
12918
|
Button,
|
|
12874
12919
|
{
|
|
12875
12920
|
disabled: item.disabled,
|
|
@@ -12886,7 +12931,7 @@ var ToolbarMenuButton = memoGeneric(function ToolbarMenuButton2({
|
|
|
12886
12931
|
onSelectMenuItem,
|
|
12887
12932
|
as
|
|
12888
12933
|
}) {
|
|
12889
|
-
const content = /* @__PURE__ */
|
|
12934
|
+
const content = /* @__PURE__ */ React93.createElement(
|
|
12890
12935
|
Button,
|
|
12891
12936
|
{
|
|
12892
12937
|
as,
|
|
@@ -12903,7 +12948,7 @@ var ToolbarMenuButton = memoGeneric(function ToolbarMenuButton2({
|
|
|
12903
12948
|
},
|
|
12904
12949
|
item.title
|
|
12905
12950
|
);
|
|
12906
|
-
return item.tooltip ? /* @__PURE__ */
|
|
12951
|
+
return item.tooltip ? /* @__PURE__ */ React93.createElement(Tooltip, { sideOffset: 10, content: item.tooltip }, content) : content;
|
|
12907
12952
|
});
|
|
12908
12953
|
var ToolbarMenuItem = memoGeneric(function ToolbarMenuItem2({
|
|
12909
12954
|
item,
|
|
@@ -12912,10 +12957,10 @@ var ToolbarMenuItem = memoGeneric(function ToolbarMenuItem2({
|
|
|
12912
12957
|
}) {
|
|
12913
12958
|
if (item.type === "sectionHeader") return null;
|
|
12914
12959
|
if (item.type === "separator") {
|
|
12915
|
-
return /* @__PURE__ */
|
|
12960
|
+
return /* @__PURE__ */ React93.createElement(DividerVertical, { overflow: 4 });
|
|
12916
12961
|
}
|
|
12917
12962
|
if (isSelectableMenuItem(item)) {
|
|
12918
|
-
return /* @__PURE__ */
|
|
12963
|
+
return /* @__PURE__ */ React93.createElement(
|
|
12919
12964
|
ToolbarMenuButton,
|
|
12920
12965
|
{
|
|
12921
12966
|
item,
|
|
@@ -12924,15 +12969,15 @@ var ToolbarMenuItem = memoGeneric(function ToolbarMenuItem2({
|
|
|
12924
12969
|
}
|
|
12925
12970
|
);
|
|
12926
12971
|
}
|
|
12927
|
-
return /* @__PURE__ */
|
|
12972
|
+
return /* @__PURE__ */ React93.createElement(ToolbarMenuDropdown, { item, onSelectMenuItem });
|
|
12928
12973
|
});
|
|
12929
12974
|
var ToolbarMenu = memoGeneric(function ToolbarMenu2({
|
|
12930
12975
|
items,
|
|
12931
12976
|
onSelectMenuItem,
|
|
12932
12977
|
buttonAs
|
|
12933
12978
|
}) {
|
|
12934
|
-
return /* @__PURE__ */
|
|
12935
|
-
return /* @__PURE__ */
|
|
12979
|
+
return /* @__PURE__ */ React93.createElement(React93.Fragment, null, items.map((item, i) => {
|
|
12980
|
+
return /* @__PURE__ */ React93.createElement(
|
|
12936
12981
|
ToolbarMenuItem,
|
|
12937
12982
|
{
|
|
12938
12983
|
key: i,
|
|
@@ -12951,28 +12996,28 @@ function Toolbar({
|
|
|
12951
12996
|
onSelectMenuItem,
|
|
12952
12997
|
shouldBindKeyboardShortcuts = true
|
|
12953
12998
|
}) {
|
|
12954
|
-
const allMenuItems =
|
|
12999
|
+
const allMenuItems = React93.useMemo(
|
|
12955
13000
|
() => [...leftMenuItems, ...rightMenuItems],
|
|
12956
13001
|
[leftMenuItems, rightMenuItems]
|
|
12957
13002
|
);
|
|
12958
13003
|
useKeyboardShortcuts4(
|
|
12959
|
-
|
|
13004
|
+
React93.useMemo(
|
|
12960
13005
|
() => onSelectMenuItem && shouldBindKeyboardShortcuts ? getKeyboardShortcutsForMenuItems(allMenuItems, onSelectMenuItem) : {},
|
|
12961
13006
|
[allMenuItems, onSelectMenuItem, shouldBindKeyboardShortcuts]
|
|
12962
13007
|
)
|
|
12963
13008
|
);
|
|
12964
|
-
return /* @__PURE__ */
|
|
13009
|
+
return /* @__PURE__ */ React93.createElement(
|
|
12965
13010
|
BaseToolbar,
|
|
12966
13011
|
{
|
|
12967
13012
|
logo,
|
|
12968
|
-
left: leftMenuItems.length > 0 && /* @__PURE__ */
|
|
13013
|
+
left: leftMenuItems.length > 0 && /* @__PURE__ */ React93.createElement("div", { className: "flex gap-2" }, /* @__PURE__ */ React93.createElement(
|
|
12969
13014
|
ToolbarMenu,
|
|
12970
13015
|
{
|
|
12971
13016
|
items: leftMenuItems,
|
|
12972
13017
|
onSelectMenuItem
|
|
12973
13018
|
}
|
|
12974
13019
|
)),
|
|
12975
|
-
right: rightMenuItems.length > 0 && /* @__PURE__ */
|
|
13020
|
+
right: rightMenuItems.length > 0 && /* @__PURE__ */ React93.createElement("div", { className: "flex gap-2" }, /* @__PURE__ */ React93.createElement(
|
|
12976
13021
|
ToolbarMenu,
|
|
12977
13022
|
{
|
|
12978
13023
|
items: rightMenuItems,
|
|
@@ -13117,6 +13162,7 @@ export {
|
|
|
13117
13162
|
cssVars,
|
|
13118
13163
|
cx,
|
|
13119
13164
|
defaultAcceptsDrop,
|
|
13165
|
+
dragItemKeySeparator,
|
|
13120
13166
|
filterWithGroupedSections,
|
|
13121
13167
|
fuzzyFilter,
|
|
13122
13168
|
fuzzyScore,
|