@noya-app/noya-designsystem 0.1.52 → 0.1.53
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 +6 -0
- package/dist/index.d.mts +29 -6
- package/dist/index.d.ts +29 -6
- package/dist/index.js +324 -249
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +838 -771
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/components/Button.tsx +1 -1
- package/src/components/ColorSwatchControl.tsx +4 -6
- package/src/components/ContextMenu.tsx +10 -2
- package/src/components/DraggableMenuButton.tsx +17 -30
- package/src/components/DropdownMenu.tsx +7 -0
- package/src/components/Popover.tsx +7 -0
- package/src/components/SelectMenu.tsx +7 -0
- package/src/components/SelectionToolbar.tsx +51 -45
- package/src/components/Toolbar.tsx +78 -47
- package/src/components/Tooltip.tsx +7 -0
- package/src/components/internal/Menu.tsx +1 -1
- package/src/components/internal/MenuViewport.tsx +9 -1
- package/src/contexts/PortalScopeContext.tsx +48 -0
- package/src/index.tsx +1 -0
package/dist/index.mjs
CHANGED
|
@@ -381,7 +381,7 @@ var ClientStorage = class {
|
|
|
381
381
|
var clientStorage = new ClientStorage();
|
|
382
382
|
|
|
383
383
|
// src/components/ActionMenu.tsx
|
|
384
|
-
import
|
|
384
|
+
import React26, { useMemo as useMemo11 } from "react";
|
|
385
385
|
|
|
386
386
|
// src/theme/index.ts
|
|
387
387
|
import tailwindConfig from "@noya-app/noya-tailwind-config";
|
|
@@ -422,27 +422,57 @@ var INPUT_HEIGHT = 27;
|
|
|
422
422
|
// src/components/DropdownMenu.tsx
|
|
423
423
|
import { useKeyboardShortcuts } from "@noya-app/noya-keymap";
|
|
424
424
|
import * as RadixDropdownMenu from "@radix-ui/react-dropdown-menu";
|
|
425
|
-
import
|
|
425
|
+
import React25, {
|
|
426
426
|
useMemo as useMemo10
|
|
427
427
|
} from "react";
|
|
428
428
|
|
|
429
|
+
// src/contexts/PortalScopeContext.tsx
|
|
430
|
+
import * as React5 from "react";
|
|
431
|
+
var PortalScopeContext = React5.createContext(void 0);
|
|
432
|
+
var PortalScopeProvider = React5.memo(function PortalScopeProvider2({
|
|
433
|
+
children,
|
|
434
|
+
portalScopeId
|
|
435
|
+
}) {
|
|
436
|
+
return /* @__PURE__ */ React5.createElement(PortalScopeContext.Provider, { value: portalScopeId }, children);
|
|
437
|
+
});
|
|
438
|
+
function usePortalScopeId() {
|
|
439
|
+
return React5.useContext(PortalScopeContext) ?? "";
|
|
440
|
+
}
|
|
441
|
+
var portalScopeDataSetName = "noyaPortalScope";
|
|
442
|
+
var portalScopePropName = `data-noya-portal-scope`;
|
|
443
|
+
function portalScopeProps(id) {
|
|
444
|
+
return {
|
|
445
|
+
[portalScopePropName]: id
|
|
446
|
+
};
|
|
447
|
+
}
|
|
448
|
+
function getClosestPortalScope(element) {
|
|
449
|
+
if (!(element instanceof HTMLElement)) {
|
|
450
|
+
return;
|
|
451
|
+
}
|
|
452
|
+
const closest = element.closest(`[${portalScopePropName}]`);
|
|
453
|
+
if (!closest || !(closest instanceof HTMLElement)) {
|
|
454
|
+
return;
|
|
455
|
+
}
|
|
456
|
+
return closest.dataset[portalScopeDataSetName];
|
|
457
|
+
}
|
|
458
|
+
|
|
429
459
|
// src/components/internal/Menu.tsx
|
|
430
460
|
import { getShortcutDisplayParts } from "@noya-app/noya-keymap";
|
|
431
|
-
import
|
|
461
|
+
import React22, { memo as memo9 } from "react";
|
|
432
462
|
|
|
433
463
|
// src/contexts/DesignSystemConfiguration.tsx
|
|
434
464
|
import { getCurrentPlatform } from "@noya-app/noya-keymap";
|
|
435
|
-
import * as
|
|
465
|
+
import * as React21 from "react";
|
|
436
466
|
|
|
437
467
|
// src/components/Toast.tsx
|
|
438
468
|
import * as ToastPrimitive from "@radix-ui/react-toast";
|
|
439
|
-
import
|
|
469
|
+
import React11 from "react";
|
|
440
470
|
|
|
441
471
|
// src/components/IconButton.tsx
|
|
442
|
-
import * as
|
|
472
|
+
import * as React10 from "react";
|
|
443
473
|
|
|
444
474
|
// src/components/Button.tsx
|
|
445
|
-
import
|
|
475
|
+
import React8, {
|
|
446
476
|
forwardRef as forwardRef3,
|
|
447
477
|
useCallback as useCallback10,
|
|
448
478
|
useMemo as useMemo4
|
|
@@ -513,10 +543,10 @@ function mergeConflictingClassNames(classNames, options) {
|
|
|
513
543
|
|
|
514
544
|
// src/components/Tooltip.tsx
|
|
515
545
|
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
516
|
-
import * as
|
|
546
|
+
import * as React7 from "react";
|
|
517
547
|
|
|
518
548
|
// src/components/Text.tsx
|
|
519
|
-
import
|
|
549
|
+
import React6, { forwardRef as forwardRef2 } from "react";
|
|
520
550
|
var elements = {
|
|
521
551
|
title: "h1",
|
|
522
552
|
subtitle: "h1",
|
|
@@ -559,7 +589,7 @@ var Text = forwardRef2(function Text2({
|
|
|
559
589
|
...rest
|
|
560
590
|
}, forwardedRef) {
|
|
561
591
|
const Component = as ?? elements[variant] ?? "span";
|
|
562
|
-
return /* @__PURE__ */
|
|
592
|
+
return /* @__PURE__ */ React6.createElement(
|
|
563
593
|
Component,
|
|
564
594
|
{
|
|
565
595
|
ref: forwardedRef,
|
|
@@ -578,27 +608,27 @@ var Text = forwardRef2(function Text2({
|
|
|
578
608
|
);
|
|
579
609
|
});
|
|
580
610
|
var Heading1 = forwardRef2(
|
|
581
|
-
(props, ref) => /* @__PURE__ */
|
|
611
|
+
(props, ref) => /* @__PURE__ */ React6.createElement(Text, { ref, ...props, variant: "heading1" })
|
|
582
612
|
);
|
|
583
613
|
var Heading2 = forwardRef2(
|
|
584
|
-
(props, ref) => /* @__PURE__ */
|
|
614
|
+
(props, ref) => /* @__PURE__ */ React6.createElement(Text, { ref, ...props, variant: "heading2" })
|
|
585
615
|
);
|
|
586
616
|
var Heading3 = forwardRef2(
|
|
587
|
-
(props, ref) => /* @__PURE__ */
|
|
617
|
+
(props, ref) => /* @__PURE__ */ React6.createElement(Text, { ref, ...props, variant: "heading3" })
|
|
588
618
|
);
|
|
589
619
|
var Heading4 = forwardRef2(
|
|
590
|
-
(props, ref) => /* @__PURE__ */
|
|
620
|
+
(props, ref) => /* @__PURE__ */ React6.createElement(Text, { ref, ...props, variant: "heading4" })
|
|
591
621
|
);
|
|
592
622
|
var Heading5 = forwardRef2(
|
|
593
|
-
(props, ref) => /* @__PURE__ */
|
|
623
|
+
(props, ref) => /* @__PURE__ */ React6.createElement(Text, { ref, ...props, variant: "heading5" })
|
|
594
624
|
);
|
|
595
625
|
var Body = forwardRef2(
|
|
596
|
-
(props, ref) => /* @__PURE__ */
|
|
626
|
+
(props, ref) => /* @__PURE__ */ React6.createElement(Text, { ref, ...props, variant: "body" })
|
|
597
627
|
);
|
|
598
628
|
var Small = forwardRef2(
|
|
599
|
-
(props, ref) => /* @__PURE__ */
|
|
629
|
+
(props, ref) => /* @__PURE__ */ React6.createElement(Text, { ref, ...props, variant: "small" })
|
|
600
630
|
);
|
|
601
|
-
var Italic = ({ children }) => /* @__PURE__ */
|
|
631
|
+
var Italic = ({ children }) => /* @__PURE__ */ React6.createElement(
|
|
602
632
|
"span",
|
|
603
633
|
{
|
|
604
634
|
style: {
|
|
@@ -609,14 +639,16 @@ var Italic = ({ children }) => /* @__PURE__ */ React5.createElement(
|
|
|
609
639
|
);
|
|
610
640
|
|
|
611
641
|
// src/components/Tooltip.tsx
|
|
612
|
-
var Tooltip =
|
|
642
|
+
var Tooltip = React7.memo(function Tooltip2({
|
|
613
643
|
children,
|
|
614
644
|
content,
|
|
615
645
|
sideOffset = 2
|
|
616
646
|
}) {
|
|
617
|
-
|
|
647
|
+
const portalScopeId = usePortalScopeId();
|
|
648
|
+
return /* @__PURE__ */ React7.createElement(TooltipPrimitive.Provider, null, /* @__PURE__ */ React7.createElement(TooltipPrimitive.Root, null, /* @__PURE__ */ React7.createElement(TooltipPrimitive.Trigger, { asChild: true }, children), /* @__PURE__ */ React7.createElement(TooltipPrimitive.Portal, null, /* @__PURE__ */ React7.createElement(
|
|
618
649
|
TooltipPrimitive.Content,
|
|
619
650
|
{
|
|
651
|
+
...portalScopeProps(portalScopeId),
|
|
620
652
|
side: "bottom",
|
|
621
653
|
align: "center",
|
|
622
654
|
sideOffset,
|
|
@@ -665,7 +697,7 @@ var Button = forwardRef3(function Button2({
|
|
|
665
697
|
"no-underline leading-[1] relative border-0 outline-none select-none text-left rounded flex items-center justify-center [&>*]:pointer-events-none [-webkit-app-region:no-drag] focus:ring-2 focus:ring-primary focus:shadow-[0_0_0_1px_var(--n-popover-background)_inset] transition-all",
|
|
666
698
|
disabled ? "opacity-25" : "",
|
|
667
699
|
!className?.includes("flex") ? "flex-none" : "",
|
|
668
|
-
active ? "bg-primary text-
|
|
700
|
+
active ? "bg-primary-pastel text-primary hover:bg-primary-pastel-light min-w-[31px]" : variantStyles[variant],
|
|
669
701
|
sizeStyles[variant === "thin" ? "thin" : variant === "floating" && size2 !== "small" ? "floating" : variant === "none" ? "none" : size2]
|
|
670
702
|
);
|
|
671
703
|
const buttonClassName = useMemo4(() => {
|
|
@@ -673,7 +705,7 @@ var Button = forwardRef3(function Button2({
|
|
|
673
705
|
categories: ["position"]
|
|
674
706
|
}) : baseClassName;
|
|
675
707
|
}, [className, baseClassName]);
|
|
676
|
-
const buttonElement = /* @__PURE__ */
|
|
708
|
+
const buttonElement = /* @__PURE__ */ React8.createElement(
|
|
677
709
|
Component,
|
|
678
710
|
{
|
|
679
711
|
ref: forwardedRef,
|
|
@@ -688,7 +720,7 @@ var Button = forwardRef3(function Button2({
|
|
|
688
720
|
}, []),
|
|
689
721
|
...rest
|
|
690
722
|
},
|
|
691
|
-
/* @__PURE__ */
|
|
723
|
+
/* @__PURE__ */ React8.createElement(
|
|
692
724
|
"span",
|
|
693
725
|
{
|
|
694
726
|
className: "min-h-[19px] flex items-center flex-1 justify-center leading-[15px]",
|
|
@@ -697,33 +729,33 @@ var Button = forwardRef3(function Button2({
|
|
|
697
729
|
children
|
|
698
730
|
)
|
|
699
731
|
);
|
|
700
|
-
return tooltip ? /* @__PURE__ */
|
|
732
|
+
return tooltip ? /* @__PURE__ */ React8.createElement(Tooltip, { content: tooltip }, buttonElement) : buttonElement;
|
|
701
733
|
});
|
|
702
734
|
var Button_default = Button;
|
|
703
735
|
|
|
704
736
|
// src/components/Icons.tsx
|
|
705
737
|
import * as Icons from "@noya-app/noya-icons";
|
|
706
|
-
import * as
|
|
738
|
+
import * as React9 from "react";
|
|
707
739
|
function renderIcon(iconName) {
|
|
708
740
|
if (typeof iconName === "string") {
|
|
709
741
|
const Icon = Icons[iconName];
|
|
710
|
-
return /* @__PURE__ */
|
|
742
|
+
return /* @__PURE__ */ React9.createElement(Icon, null);
|
|
711
743
|
}
|
|
712
744
|
return iconName;
|
|
713
745
|
}
|
|
714
746
|
|
|
715
747
|
// src/components/IconButton.tsx
|
|
716
|
-
var IconButton =
|
|
717
|
-
|
|
748
|
+
var IconButton = React10.memo(
|
|
749
|
+
React10.forwardRef(function IconButton2({ selected, iconName, color, size: size2, contentStyle, ...props }, forwardedRef) {
|
|
718
750
|
const Icon = Icons[iconName];
|
|
719
|
-
const style2 =
|
|
751
|
+
const style2 = React10.useMemo(() => {
|
|
720
752
|
return {
|
|
721
753
|
padding: "0 2px",
|
|
722
754
|
...size2 && { minHeight: size2 },
|
|
723
755
|
...contentStyle
|
|
724
756
|
};
|
|
725
757
|
}, [contentStyle, size2]);
|
|
726
|
-
return /* @__PURE__ */
|
|
758
|
+
return /* @__PURE__ */ React10.createElement(Button, { ref: forwardedRef, ...props, variant: "none", contentStyle: style2 }, /* @__PURE__ */ React10.createElement(
|
|
727
759
|
Icon,
|
|
728
760
|
{
|
|
729
761
|
color: color ?? (selected ? cssVars.colors.iconSelected : cssVars.colors.icon),
|
|
@@ -740,37 +772,37 @@ var Toast = ({
|
|
|
740
772
|
children,
|
|
741
773
|
...props
|
|
742
774
|
}) => {
|
|
743
|
-
return /* @__PURE__ */
|
|
775
|
+
return /* @__PURE__ */ React11.createElement(
|
|
744
776
|
ToastPrimitive.Root,
|
|
745
777
|
{
|
|
746
778
|
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",
|
|
747
779
|
...props
|
|
748
780
|
},
|
|
749
|
-
title && /* @__PURE__ */
|
|
781
|
+
title && /* @__PURE__ */ React11.createElement(
|
|
750
782
|
ToastPrimitive.Title,
|
|
751
783
|
{
|
|
752
784
|
className: `mb-[5px] ${textStyles.label} font-bold text-text`
|
|
753
785
|
},
|
|
754
786
|
title
|
|
755
787
|
),
|
|
756
|
-
/* @__PURE__ */
|
|
788
|
+
/* @__PURE__ */ React11.createElement(
|
|
757
789
|
ToastPrimitive.Description,
|
|
758
790
|
{
|
|
759
791
|
className: `${textStyles.small} text-text-muted`
|
|
760
792
|
},
|
|
761
793
|
content
|
|
762
794
|
),
|
|
763
|
-
children && /* @__PURE__ */
|
|
764
|
-
/* @__PURE__ */
|
|
795
|
+
children && /* @__PURE__ */ React11.createElement(ToastPrimitive.Action, { asChild: true, altText: "" }, children),
|
|
796
|
+
/* @__PURE__ */ React11.createElement(ToastPrimitive.Close, { "aria-label": "Close", asChild: true }, /* @__PURE__ */ React11.createElement(IconButton, { iconName: "Cross1Icon" }))
|
|
765
797
|
);
|
|
766
798
|
};
|
|
767
|
-
var ToastProvider = ({ children }) => /* @__PURE__ */
|
|
799
|
+
var ToastProvider = ({ children }) => /* @__PURE__ */ React11.createElement(ToastPrimitive.Provider, null, children, /* @__PURE__ */ React11.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" }));
|
|
768
800
|
|
|
769
801
|
// src/contexts/DialogContext.tsx
|
|
770
|
-
import
|
|
771
|
-
createContext as
|
|
802
|
+
import React19, {
|
|
803
|
+
createContext as createContext4,
|
|
772
804
|
useCallback as useCallback13,
|
|
773
|
-
useContext as
|
|
805
|
+
useContext as useContext4,
|
|
774
806
|
useMemo as useMemo7,
|
|
775
807
|
useRef as useRef11,
|
|
776
808
|
useState as useState13
|
|
@@ -778,17 +810,17 @@ import React18, {
|
|
|
778
810
|
|
|
779
811
|
// src/components/Dialog.tsx
|
|
780
812
|
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
781
|
-
import
|
|
813
|
+
import React13, {
|
|
782
814
|
forwardRef as forwardRef6,
|
|
783
815
|
useImperativeHandle,
|
|
784
816
|
useRef as useRef9
|
|
785
817
|
} from "react";
|
|
786
818
|
|
|
787
819
|
// src/components/Spacer.tsx
|
|
788
|
-
import * as
|
|
789
|
-
var SpacerVertical =
|
|
820
|
+
import * as React12 from "react";
|
|
821
|
+
var SpacerVertical = React12.forwardRef(
|
|
790
822
|
({ size: size2, inline, ...props }, ref) => {
|
|
791
|
-
return /* @__PURE__ */
|
|
823
|
+
return /* @__PURE__ */ React12.createElement(
|
|
792
824
|
"span",
|
|
793
825
|
{
|
|
794
826
|
className: `${inline ? "inline-block" : "block"} ${size2 === void 0 ? "flex flex-1" : ""}`,
|
|
@@ -801,9 +833,9 @@ var SpacerVertical = React11.forwardRef(
|
|
|
801
833
|
);
|
|
802
834
|
}
|
|
803
835
|
);
|
|
804
|
-
var SpacerHorizontal =
|
|
836
|
+
var SpacerHorizontal = React12.forwardRef(
|
|
805
837
|
({ size: size2, inline, ...props }, ref) => {
|
|
806
|
-
return /* @__PURE__ */
|
|
838
|
+
return /* @__PURE__ */ React12.createElement(
|
|
807
839
|
"span",
|
|
808
840
|
{
|
|
809
841
|
className: `${inline ? "inline-block" : "block"} ${size2 === void 0 ? "flex flex-1" : ""}`,
|
|
@@ -823,7 +855,7 @@ var Spacer;
|
|
|
823
855
|
})(Spacer || (Spacer = {}));
|
|
824
856
|
|
|
825
857
|
// src/components/Dialog.tsx
|
|
826
|
-
var StyledOverlay = forwardRef6(({ className, ...props }, ref) => /* @__PURE__ */
|
|
858
|
+
var StyledOverlay = forwardRef6(({ className, ...props }, ref) => /* @__PURE__ */ React13.createElement(
|
|
827
859
|
DialogPrimitive.Overlay,
|
|
828
860
|
{
|
|
829
861
|
ref,
|
|
@@ -832,7 +864,7 @@ var StyledOverlay = forwardRef6(({ className, ...props }, ref) => /* @__PURE__ *
|
|
|
832
864
|
}
|
|
833
865
|
));
|
|
834
866
|
var StyledContent = forwardRef6(({ className, children, ...props }, ref) => {
|
|
835
|
-
return /* @__PURE__ */
|
|
867
|
+
return /* @__PURE__ */ React13.createElement(
|
|
836
868
|
DialogPrimitive.Content,
|
|
837
869
|
{
|
|
838
870
|
ref,
|
|
@@ -852,7 +884,7 @@ var StyledContent = forwardRef6(({ className, children, ...props }, ref) => {
|
|
|
852
884
|
children
|
|
853
885
|
);
|
|
854
886
|
});
|
|
855
|
-
var StyledTitle = forwardRef6(({ className, ...props }, ref) => /* @__PURE__ */
|
|
887
|
+
var StyledTitle = forwardRef6(({ className, ...props }, ref) => /* @__PURE__ */ React13.createElement(
|
|
856
888
|
DialogPrimitive.Title,
|
|
857
889
|
{
|
|
858
890
|
ref,
|
|
@@ -863,7 +895,7 @@ var StyledTitle = forwardRef6(({ className, ...props }, ref) => /* @__PURE__ */
|
|
|
863
895
|
...props
|
|
864
896
|
}
|
|
865
897
|
));
|
|
866
|
-
var StyledDescription = forwardRef6(({ className, ...props }, ref) => /* @__PURE__ */
|
|
898
|
+
var StyledDescription = forwardRef6(({ className, ...props }, ref) => /* @__PURE__ */ React13.createElement(
|
|
867
899
|
DialogPrimitive.Description,
|
|
868
900
|
{
|
|
869
901
|
ref,
|
|
@@ -893,7 +925,7 @@ var Dialog = forwardRef6(function Dialog2({
|
|
|
893
925
|
return contentRef.current.contains(element);
|
|
894
926
|
}
|
|
895
927
|
}));
|
|
896
|
-
return /* @__PURE__ */
|
|
928
|
+
return /* @__PURE__ */ React13.createElement(DialogPrimitive.Root, { open, onOpenChange }, /* @__PURE__ */ React13.createElement(StyledOverlay, null), /* @__PURE__ */ React13.createElement(
|
|
897
929
|
StyledContent,
|
|
898
930
|
{
|
|
899
931
|
ref: contentRef,
|
|
@@ -905,7 +937,7 @@ var Dialog = forwardRef6(function Dialog2({
|
|
|
905
937
|
onInteractOutside: (event) => event.preventDefault()
|
|
906
938
|
}
|
|
907
939
|
},
|
|
908
|
-
showCloseButton && /* @__PURE__ */
|
|
940
|
+
showCloseButton && /* @__PURE__ */ React13.createElement(DialogPrimitive.Close, { asChild: true }, /* @__PURE__ */ React13.createElement(
|
|
909
941
|
IconButton,
|
|
910
942
|
{
|
|
911
943
|
iconName: "Cross1Icon",
|
|
@@ -917,13 +949,13 @@ var Dialog = forwardRef6(function Dialog2({
|
|
|
917
949
|
}
|
|
918
950
|
}
|
|
919
951
|
)),
|
|
920
|
-
title && /* @__PURE__ */
|
|
921
|
-
description && /* @__PURE__ */
|
|
952
|
+
title && /* @__PURE__ */ React13.createElement(React13.Fragment, null, /* @__PURE__ */ React13.createElement(StyledTitle, null, title), /* @__PURE__ */ React13.createElement(Spacer.Vertical, { size: description ? 10 : 20 })),
|
|
953
|
+
description && /* @__PURE__ */ React13.createElement(React13.Fragment, null, /* @__PURE__ */ React13.createElement(Spacer.Vertical, { size: 10 }), /* @__PURE__ */ React13.createElement(StyledDescription, null, description), /* @__PURE__ */ React13.createElement(Spacer.Vertical, { size: 20 })),
|
|
922
954
|
children
|
|
923
955
|
));
|
|
924
956
|
});
|
|
925
957
|
var FullscreenDialog = forwardRef6(function FullscreenDialog2({ style: style2, ...rest }, forwardedRef) {
|
|
926
|
-
return /* @__PURE__ */
|
|
958
|
+
return /* @__PURE__ */ React13.createElement(
|
|
927
959
|
Dialog,
|
|
928
960
|
{
|
|
929
961
|
ref: forwardedRef,
|
|
@@ -936,42 +968,42 @@ var FullscreenDialog = forwardRef6(function FullscreenDialog2({ style: style2, .
|
|
|
936
968
|
|
|
937
969
|
// src/components/InputField.tsx
|
|
938
970
|
import { DropdownChevronIcon } from "@noya-app/noya-icons";
|
|
939
|
-
import
|
|
940
|
-
createContext as
|
|
971
|
+
import React18, {
|
|
972
|
+
createContext as createContext3,
|
|
941
973
|
forwardRef as forwardRef9,
|
|
942
|
-
memo as
|
|
974
|
+
memo as memo7,
|
|
943
975
|
useCallback as useCallback12,
|
|
944
|
-
useContext as
|
|
976
|
+
useContext as useContext3,
|
|
945
977
|
useId,
|
|
946
978
|
useMemo as useMemo6,
|
|
947
979
|
useState as useState12
|
|
948
980
|
} from "react";
|
|
949
981
|
|
|
950
982
|
// src/hooks/useLabel.ts
|
|
951
|
-
import
|
|
952
|
-
var LabelContext =
|
|
983
|
+
import React14 from "react";
|
|
984
|
+
var LabelContext = React14.createContext({
|
|
953
985
|
fieldId: "",
|
|
954
986
|
label: void 0
|
|
955
987
|
});
|
|
956
988
|
var useLabel = ({ label, fieldId }) => {
|
|
957
|
-
const { label: labelFromContext, fieldId: fieldIdFromContext } =
|
|
989
|
+
const { label: labelFromContext, fieldId: fieldIdFromContext } = React14.useContext(LabelContext);
|
|
958
990
|
return {
|
|
959
991
|
label: label ?? labelFromContext,
|
|
960
992
|
fieldId: fieldId ?? fieldIdFromContext
|
|
961
993
|
};
|
|
962
994
|
};
|
|
963
|
-
var LabelPositionContext =
|
|
995
|
+
var LabelPositionContext = React14.createContext({
|
|
964
996
|
position: "start"
|
|
965
997
|
});
|
|
966
998
|
var useLabelPosition = () => {
|
|
967
|
-
const { position } =
|
|
999
|
+
const { position } = React14.useContext(LabelPositionContext);
|
|
968
1000
|
return position;
|
|
969
1001
|
};
|
|
970
|
-
var LabelWidthContext =
|
|
1002
|
+
var LabelWidthContext = React14.createContext({
|
|
971
1003
|
width: 100
|
|
972
1004
|
});
|
|
973
1005
|
var useLabelWidth = () => {
|
|
974
|
-
const { width } =
|
|
1006
|
+
const { width } = React14.useContext(LabelWidthContext);
|
|
975
1007
|
return width;
|
|
976
1008
|
};
|
|
977
1009
|
|
|
@@ -1011,7 +1043,7 @@ var startBaseStyles = "absolute left-1.5 inset-y-0 flex items-center";
|
|
|
1011
1043
|
|
|
1012
1044
|
// src/components/internal/TextInput.tsx
|
|
1013
1045
|
import { composeRefs } from "@radix-ui/react-compose-refs";
|
|
1014
|
-
import
|
|
1046
|
+
import React15, {
|
|
1015
1047
|
forwardRef as forwardRef7,
|
|
1016
1048
|
useCallback as useCallback11,
|
|
1017
1049
|
useEffect as useEffect9,
|
|
@@ -1021,7 +1053,7 @@ import React14, {
|
|
|
1021
1053
|
} from "react";
|
|
1022
1054
|
|
|
1023
1055
|
// src/contexts/GlobalInputBlurContext.tsx
|
|
1024
|
-
import { createContext, useContext, useEffect as useEffect8 } from "react";
|
|
1056
|
+
import { createContext as createContext2, useContext as useContext2, useEffect as useEffect8 } from "react";
|
|
1025
1057
|
var defaultValue = /* @__PURE__ */ (() => {
|
|
1026
1058
|
const listeners = [];
|
|
1027
1059
|
const value = {
|
|
@@ -1041,10 +1073,10 @@ var defaultValue = /* @__PURE__ */ (() => {
|
|
|
1041
1073
|
};
|
|
1042
1074
|
return value;
|
|
1043
1075
|
})();
|
|
1044
|
-
var GlobalInputBlurContext =
|
|
1076
|
+
var GlobalInputBlurContext = createContext2(defaultValue);
|
|
1045
1077
|
var GlobalInputBlurProvider = GlobalInputBlurContext.Provider;
|
|
1046
1078
|
var useGlobalInputBlur = () => {
|
|
1047
|
-
return
|
|
1079
|
+
return useContext2(GlobalInputBlurContext);
|
|
1048
1080
|
};
|
|
1049
1081
|
function useGlobalInputBlurListener(f) {
|
|
1050
1082
|
const context = useGlobalInputBlur();
|
|
@@ -1061,7 +1093,7 @@ function useGlobalInputBlurTrigger() {
|
|
|
1061
1093
|
|
|
1062
1094
|
// src/components/internal/TextInput.tsx
|
|
1063
1095
|
var ReadOnlyTextInput = forwardRef7(function ReadOnlyTextInput2({ onKeyDown, onFocusChange, value, ...rest }, forwardedRef) {
|
|
1064
|
-
return /* @__PURE__ */
|
|
1096
|
+
return /* @__PURE__ */ React15.createElement(
|
|
1065
1097
|
"input",
|
|
1066
1098
|
{
|
|
1067
1099
|
ref: forwardedRef,
|
|
@@ -1104,7 +1136,7 @@ var ControlledTextInput = forwardRef7(function ControlledTextInput2({
|
|
|
1104
1136
|
},
|
|
1105
1137
|
[onFocus, onFocusChange]
|
|
1106
1138
|
);
|
|
1107
|
-
return /* @__PURE__ */
|
|
1139
|
+
return /* @__PURE__ */ React15.createElement(
|
|
1108
1140
|
"input",
|
|
1109
1141
|
{
|
|
1110
1142
|
ref: forwardedRef,
|
|
@@ -1133,7 +1165,7 @@ var SubmittableTextInput = forwardRef7(function SubmittableTextInput2({
|
|
|
1133
1165
|
submitOnBlur = true,
|
|
1134
1166
|
...rest
|
|
1135
1167
|
}, forwardedRef) {
|
|
1136
|
-
const ref =
|
|
1168
|
+
const ref = React15.useRef(null);
|
|
1137
1169
|
const latestValue = useRef10(value);
|
|
1138
1170
|
latestValue.current = value;
|
|
1139
1171
|
const userDidEdit = useRef10(false);
|
|
@@ -1216,7 +1248,7 @@ var SubmittableTextInput = forwardRef7(function SubmittableTextInput2({
|
|
|
1216
1248
|
}
|
|
1217
1249
|
};
|
|
1218
1250
|
}, [internalValue, submitAutomaticallyAfterDelay]);
|
|
1219
|
-
return /* @__PURE__ */
|
|
1251
|
+
return /* @__PURE__ */ React15.createElement(
|
|
1220
1252
|
"input",
|
|
1221
1253
|
{
|
|
1222
1254
|
ref: composeRefs(ref, forwardedRef),
|
|
@@ -1248,21 +1280,21 @@ var TextInput_default = forwardRef7(function TextInput(props, forwardedRef) {
|
|
|
1248
1280
|
...props
|
|
1249
1281
|
};
|
|
1250
1282
|
if ("readOnly" in commonProps) {
|
|
1251
|
-
return /* @__PURE__ */
|
|
1283
|
+
return /* @__PURE__ */ React15.createElement(ReadOnlyTextInput, { ref: forwardedRef, ...commonProps, readOnly: true });
|
|
1252
1284
|
} else if ("onChange" in commonProps) {
|
|
1253
|
-
return /* @__PURE__ */
|
|
1285
|
+
return /* @__PURE__ */ React15.createElement(ControlledTextInput, { ref: forwardedRef, ...commonProps });
|
|
1254
1286
|
} else {
|
|
1255
|
-
return /* @__PURE__ */
|
|
1287
|
+
return /* @__PURE__ */ React15.createElement(SubmittableTextInput, { ref: forwardedRef, ...commonProps });
|
|
1256
1288
|
}
|
|
1257
1289
|
});
|
|
1258
1290
|
|
|
1259
1291
|
// src/components/Label.tsx
|
|
1260
|
-
import
|
|
1292
|
+
import React16, { forwardRef as forwardRef8, memo as memo6 } from "react";
|
|
1261
1293
|
var labelStyles = "flex items-center select-none z-label relative";
|
|
1262
1294
|
var labelTextStyles = "font-sans text-label uppercase leading-3 font-bold text-text-muted";
|
|
1263
|
-
var Label =
|
|
1295
|
+
var Label = memo6(
|
|
1264
1296
|
forwardRef8(function Label2({ className, children, ...props }, ref) {
|
|
1265
|
-
return /* @__PURE__ */
|
|
1297
|
+
return /* @__PURE__ */ React16.createElement(
|
|
1266
1298
|
"label",
|
|
1267
1299
|
{
|
|
1268
1300
|
ref,
|
|
@@ -1286,7 +1318,7 @@ var Label = memo5(
|
|
|
1286
1318
|
|
|
1287
1319
|
// src/components/Popover.tsx
|
|
1288
1320
|
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
1289
|
-
import
|
|
1321
|
+
import React17 from "react";
|
|
1290
1322
|
var closeStyles = {
|
|
1291
1323
|
all: "unset",
|
|
1292
1324
|
fontFamily: "inherit"
|
|
@@ -1314,9 +1346,11 @@ function Popover({
|
|
|
1314
1346
|
onClickClose,
|
|
1315
1347
|
className
|
|
1316
1348
|
}) {
|
|
1317
|
-
|
|
1349
|
+
const portalScopeId = usePortalScopeId();
|
|
1350
|
+
return /* @__PURE__ */ React17.createElement(PopoverPrimitive.Root, { open, onOpenChange }, /* @__PURE__ */ React17.createElement(PopoverPrimitive.Trigger, { asChild: true }, trigger), /* @__PURE__ */ React17.createElement(PopoverPrimitive.Portal, null, /* @__PURE__ */ React17.createElement(
|
|
1318
1351
|
PopoverPrimitive.Content,
|
|
1319
1352
|
{
|
|
1353
|
+
...portalScopeProps(portalScopeId),
|
|
1320
1354
|
className: cx(
|
|
1321
1355
|
popoverStyle.base,
|
|
1322
1356
|
variant === "large" && popoverStyle.large,
|
|
@@ -1335,20 +1369,20 @@ function Popover({
|
|
|
1335
1369
|
arrowPadding: 2
|
|
1336
1370
|
},
|
|
1337
1371
|
children,
|
|
1338
|
-
showArrow && /* @__PURE__ */
|
|
1339
|
-
closable && /* @__PURE__ */
|
|
1372
|
+
showArrow && /* @__PURE__ */ React17.createElement(PopoverPrimitive.Arrow, { className: "fill-popover-background" }),
|
|
1373
|
+
closable && /* @__PURE__ */ React17.createElement(
|
|
1340
1374
|
PopoverPrimitive.Close,
|
|
1341
1375
|
{
|
|
1342
1376
|
className: "rounded-full h-[25px] w-[25px] inline-flex items-center justify-center absolute top-[5px] right-[5px]",
|
|
1343
1377
|
style: closeStyles
|
|
1344
1378
|
},
|
|
1345
|
-
/* @__PURE__ */
|
|
1379
|
+
/* @__PURE__ */ React17.createElement(IconButton, { iconName: "Cross2Icon", onClick: onClickClose })
|
|
1346
1380
|
)
|
|
1347
1381
|
)));
|
|
1348
1382
|
}
|
|
1349
1383
|
|
|
1350
1384
|
// src/components/InputField.tsx
|
|
1351
|
-
var InputFieldContext =
|
|
1385
|
+
var InputFieldContext = createContext3({
|
|
1352
1386
|
startWidth: void 0,
|
|
1353
1387
|
size: "medium",
|
|
1354
1388
|
isFocused: false,
|
|
@@ -1358,7 +1392,7 @@ var InputFieldContext = createContext2({
|
|
|
1358
1392
|
startRef: null,
|
|
1359
1393
|
endRef: null
|
|
1360
1394
|
});
|
|
1361
|
-
var useInputFieldContext = () =>
|
|
1395
|
+
var useInputFieldContext = () => useContext3(InputFieldContext);
|
|
1362
1396
|
var noop2 = () => {
|
|
1363
1397
|
};
|
|
1364
1398
|
var getFieldSpacing = ({
|
|
@@ -1370,7 +1404,7 @@ var getFieldSpacing = ({
|
|
|
1370
1404
|
paddingRight: `${variant === "bare" ? endWidth : endWidth ? endWidth + 12 : 6}px`
|
|
1371
1405
|
});
|
|
1372
1406
|
var InputFieldDropdownMenu = memoGeneric(function InputFieldDropdownMenu2({ id, items, onSelect, children }) {
|
|
1373
|
-
return /* @__PURE__ */
|
|
1407
|
+
return /* @__PURE__ */ React18.createElement(
|
|
1374
1408
|
DropdownMenu,
|
|
1375
1409
|
{
|
|
1376
1410
|
items,
|
|
@@ -1378,10 +1412,10 @@ var InputFieldDropdownMenu = memoGeneric(function InputFieldDropdownMenu2({ id,
|
|
|
1378
1412
|
align: "end",
|
|
1379
1413
|
sideOffset: 8
|
|
1380
1414
|
},
|
|
1381
|
-
children || /* @__PURE__ */
|
|
1415
|
+
children || /* @__PURE__ */ React18.createElement(InputFieldButton, { variant: "floating", id }, /* @__PURE__ */ React18.createElement(DropdownChevronIcon, null))
|
|
1382
1416
|
);
|
|
1383
1417
|
});
|
|
1384
|
-
var InputFieldButton =
|
|
1418
|
+
var InputFieldButton = memo7(
|
|
1385
1419
|
forwardRef9(function InputFieldButton2(props, forwardedRef) {
|
|
1386
1420
|
const {
|
|
1387
1421
|
children,
|
|
@@ -1421,7 +1455,7 @@ var InputFieldButton = memo6(
|
|
|
1421
1455
|
}),
|
|
1422
1456
|
[style2, variant]
|
|
1423
1457
|
);
|
|
1424
|
-
return /* @__PURE__ */
|
|
1458
|
+
return /* @__PURE__ */ React18.createElement(
|
|
1425
1459
|
Button,
|
|
1426
1460
|
{
|
|
1427
1461
|
as,
|
|
@@ -1478,7 +1512,7 @@ var InputElement = forwardRef9(
|
|
|
1478
1512
|
[inputClassName]
|
|
1479
1513
|
);
|
|
1480
1514
|
if (as === "span") {
|
|
1481
|
-
return /* @__PURE__ */
|
|
1515
|
+
return /* @__PURE__ */ React18.createElement(
|
|
1482
1516
|
"span",
|
|
1483
1517
|
{
|
|
1484
1518
|
ref,
|
|
@@ -1489,7 +1523,7 @@ var InputElement = forwardRef9(
|
|
|
1489
1523
|
children
|
|
1490
1524
|
);
|
|
1491
1525
|
}
|
|
1492
|
-
return /* @__PURE__ */
|
|
1526
|
+
return /* @__PURE__ */ React18.createElement(
|
|
1493
1527
|
TextInput_default,
|
|
1494
1528
|
{
|
|
1495
1529
|
ref,
|
|
@@ -1513,7 +1547,7 @@ var InputFieldInput = forwardRef9(function InputFieldInput2({ textAlign, variant
|
|
|
1513
1547
|
},
|
|
1514
1548
|
[onFocusChange]
|
|
1515
1549
|
);
|
|
1516
|
-
return /* @__PURE__ */
|
|
1550
|
+
return /* @__PURE__ */ React18.createElement(
|
|
1517
1551
|
InputElement,
|
|
1518
1552
|
{
|
|
1519
1553
|
ref,
|
|
@@ -1525,7 +1559,7 @@ var InputFieldInput = forwardRef9(function InputFieldInput2({ textAlign, variant
|
|
|
1525
1559
|
);
|
|
1526
1560
|
});
|
|
1527
1561
|
var InputFieldTypeahead = (props) => {
|
|
1528
|
-
return /* @__PURE__ */
|
|
1562
|
+
return /* @__PURE__ */ React18.createElement(
|
|
1529
1563
|
InputElement,
|
|
1530
1564
|
{
|
|
1531
1565
|
as: "span",
|
|
@@ -1543,8 +1577,8 @@ var InputFieldTypeahead = (props) => {
|
|
|
1543
1577
|
[]
|
|
1544
1578
|
)
|
|
1545
1579
|
},
|
|
1546
|
-
/* @__PURE__ */
|
|
1547
|
-
props.isFocused && /* @__PURE__ */
|
|
1580
|
+
/* @__PURE__ */ React18.createElement("span", { style: { opacity: 0 } }, props.prefix),
|
|
1581
|
+
props.isFocused && /* @__PURE__ */ React18.createElement("span", { style: { opacity: 0.5 } }, props.value.slice(props.prefix.length))
|
|
1548
1582
|
);
|
|
1549
1583
|
};
|
|
1550
1584
|
function parseNumber(value) {
|
|
@@ -1600,7 +1634,7 @@ function InputFieldNumberInput(props) {
|
|
|
1600
1634
|
},
|
|
1601
1635
|
[onBlur]
|
|
1602
1636
|
);
|
|
1603
|
-
return /* @__PURE__ */
|
|
1637
|
+
return /* @__PURE__ */ React18.createElement(
|
|
1604
1638
|
InputFieldInput,
|
|
1605
1639
|
{
|
|
1606
1640
|
...rest,
|
|
@@ -1613,7 +1647,7 @@ function InputFieldNumberInput(props) {
|
|
|
1613
1647
|
}
|
|
1614
1648
|
);
|
|
1615
1649
|
}
|
|
1616
|
-
var RootContainer = forwardRef9(({ $width, className, ...props }, ref) => /* @__PURE__ */
|
|
1650
|
+
var RootContainer = forwardRef9(({ $width, className, ...props }, ref) => /* @__PURE__ */ React18.createElement(
|
|
1617
1651
|
"div",
|
|
1618
1652
|
{
|
|
1619
1653
|
ref,
|
|
@@ -1642,10 +1676,10 @@ function InputFieldRoot({
|
|
|
1642
1676
|
label: labelProp
|
|
1643
1677
|
}) {
|
|
1644
1678
|
const randomId = useId();
|
|
1645
|
-
const [isFocused, setIsFocused] =
|
|
1646
|
-
const startRef =
|
|
1647
|
-
const inputRef =
|
|
1648
|
-
const endRef =
|
|
1679
|
+
const [isFocused, setIsFocused] = React18.useState(false);
|
|
1680
|
+
const startRef = React18.useRef(null);
|
|
1681
|
+
const inputRef = React18.useRef(null);
|
|
1682
|
+
const endRef = React18.useRef(null);
|
|
1649
1683
|
const measuredInputSize = useSize(inputRef, "width");
|
|
1650
1684
|
const measuredStartSize = useSize(startRef, "width");
|
|
1651
1685
|
const measuredEndSize = useSize(endRef, "width");
|
|
@@ -1676,15 +1710,15 @@ function InputFieldRoot({
|
|
|
1676
1710
|
[startWidth, endWidth, size2, isFocused, handleFocusChange, id, randomId]
|
|
1677
1711
|
);
|
|
1678
1712
|
const insetLabel = useMemo6(
|
|
1679
|
-
() => /* @__PURE__ */
|
|
1713
|
+
() => /* @__PURE__ */ React18.createElement(Label, { htmlFor: id, className: "!text-text-disabled" }, labelProp ?? label),
|
|
1680
1714
|
[id, labelProp, label]
|
|
1681
1715
|
);
|
|
1682
|
-
const rootElement = /* @__PURE__ */
|
|
1716
|
+
const rootElement = /* @__PURE__ */ React18.createElement(RootContainer, { $width: width, style: style2, className }, children, start && /* @__PURE__ */ React18.createElement("span", { ref: startRef, className: startBaseStyles }, start), (end || label) && /* @__PURE__ */ React18.createElement("span", { ref: endRef, className: cx(endStyles, label && end && "gap-1.5") }, labelProp ? insetLabel : label && labelPosition === "inset" && insetLabel, end));
|
|
1683
1717
|
const measuredWidthObject = useMemo6(
|
|
1684
1718
|
() => measuredInputSize ? { width: measuredInputSize.width + 4 } : void 0,
|
|
1685
1719
|
[measuredInputSize]
|
|
1686
1720
|
);
|
|
1687
|
-
return /* @__PURE__ */
|
|
1721
|
+
return /* @__PURE__ */ React18.createElement(InputFieldContext.Provider, { value: contextValue }, renderPopoverContent ? /* @__PURE__ */ React18.createElement(
|
|
1688
1722
|
Popover,
|
|
1689
1723
|
{
|
|
1690
1724
|
open: true,
|
|
@@ -1700,7 +1734,7 @@ function InputFieldRoot({
|
|
|
1700
1734
|
event.stopPropagation();
|
|
1701
1735
|
}
|
|
1702
1736
|
},
|
|
1703
|
-
measuredWidthObject && /* @__PURE__ */
|
|
1737
|
+
measuredWidthObject && /* @__PURE__ */ React18.createElement(
|
|
1704
1738
|
"div",
|
|
1705
1739
|
{
|
|
1706
1740
|
className: "flex flex-col overflow-hidden",
|
|
@@ -1725,7 +1759,7 @@ var PrimitiveInputField = ({
|
|
|
1725
1759
|
() => ({ ...spacingStyles, ...style2 }),
|
|
1726
1760
|
[spacingStyles, style2]
|
|
1727
1761
|
);
|
|
1728
|
-
return /* @__PURE__ */
|
|
1762
|
+
return /* @__PURE__ */ React18.createElement(
|
|
1729
1763
|
"input",
|
|
1730
1764
|
{
|
|
1731
1765
|
style: memoizedStyles,
|
|
@@ -1740,10 +1774,10 @@ var PrimitiveInputField = ({
|
|
|
1740
1774
|
);
|
|
1741
1775
|
};
|
|
1742
1776
|
var InputFieldSubcomponents = {
|
|
1743
|
-
Root:
|
|
1744
|
-
Input:
|
|
1745
|
-
Typeahead:
|
|
1746
|
-
NumberInput:
|
|
1777
|
+
Root: memo7(InputFieldRoot),
|
|
1778
|
+
Input: memo7(InputFieldInput),
|
|
1779
|
+
Typeahead: memo7(InputFieldTypeahead),
|
|
1780
|
+
NumberInput: memo7(InputFieldNumberInput),
|
|
1747
1781
|
DropdownMenu: InputFieldDropdownMenu,
|
|
1748
1782
|
Button: InputFieldButton,
|
|
1749
1783
|
PrimitiveElement: PrimitiveInputField
|
|
@@ -1766,7 +1800,7 @@ var InputFieldComponent = forwardRef9(
|
|
|
1766
1800
|
className,
|
|
1767
1801
|
...inputProps
|
|
1768
1802
|
} = props;
|
|
1769
|
-
return /* @__PURE__ */
|
|
1803
|
+
return /* @__PURE__ */ React18.createElement(
|
|
1770
1804
|
InputFieldSubcomponents.Root,
|
|
1771
1805
|
{
|
|
1772
1806
|
width,
|
|
@@ -1782,7 +1816,7 @@ var InputFieldComponent = forwardRef9(
|
|
|
1782
1816
|
style: style2,
|
|
1783
1817
|
className
|
|
1784
1818
|
},
|
|
1785
|
-
/* @__PURE__ */
|
|
1819
|
+
/* @__PURE__ */ React18.createElement(InputFieldSubcomponents.Input, { ref, ...inputProps }),
|
|
1786
1820
|
children
|
|
1787
1821
|
);
|
|
1788
1822
|
}
|
|
@@ -1801,7 +1835,7 @@ function createDeferredPromise() {
|
|
|
1801
1835
|
});
|
|
1802
1836
|
return { promise, resolve, reject };
|
|
1803
1837
|
}
|
|
1804
|
-
var DialogContext =
|
|
1838
|
+
var DialogContext = createContext4(void 0);
|
|
1805
1839
|
var DialogProvider = function DialogProvider2({
|
|
1806
1840
|
children
|
|
1807
1841
|
}) {
|
|
@@ -1903,7 +1937,7 @@ var DialogProvider = function DialogProvider2({
|
|
|
1903
1937
|
if (!dialogRef.current) return false;
|
|
1904
1938
|
return dialogRef.current.containsElement(element);
|
|
1905
1939
|
}, []);
|
|
1906
|
-
return /* @__PURE__ */
|
|
1940
|
+
return /* @__PURE__ */ React19.createElement(React19.Fragment, null, /* @__PURE__ */ React19.createElement(
|
|
1907
1941
|
DialogContext.Provider,
|
|
1908
1942
|
{
|
|
1909
1943
|
value: useMemo7(
|
|
@@ -1917,7 +1951,7 @@ var DialogProvider = function DialogProvider2({
|
|
|
1917
1951
|
)
|
|
1918
1952
|
},
|
|
1919
1953
|
children
|
|
1920
|
-
), /* @__PURE__ */
|
|
1954
|
+
), /* @__PURE__ */ React19.createElement(
|
|
1921
1955
|
Dialog,
|
|
1922
1956
|
{
|
|
1923
1957
|
ref: dialogRef,
|
|
@@ -1948,7 +1982,7 @@ var DialogProvider = function DialogProvider2({
|
|
|
1948
1982
|
[contents]
|
|
1949
1983
|
)
|
|
1950
1984
|
},
|
|
1951
|
-
contents?.type === "confirmation" ? /* @__PURE__ */
|
|
1985
|
+
contents?.type === "confirmation" ? /* @__PURE__ */ React19.createElement("div", { className: "flex flex-1 flex-row items-center" }, /* @__PURE__ */ React19.createElement(Spacer.Horizontal, null), /* @__PURE__ */ React19.createElement(
|
|
1952
1986
|
Button,
|
|
1953
1987
|
{
|
|
1954
1988
|
onClick: () => {
|
|
@@ -1957,7 +1991,7 @@ var DialogProvider = function DialogProvider2({
|
|
|
1957
1991
|
}
|
|
1958
1992
|
},
|
|
1959
1993
|
contents.cancelButtonLabel ?? "Cancel"
|
|
1960
|
-
), /* @__PURE__ */
|
|
1994
|
+
), /* @__PURE__ */ React19.createElement(Spacer.Horizontal, { size: 16 }), /* @__PURE__ */ React19.createElement(
|
|
1961
1995
|
Button,
|
|
1962
1996
|
{
|
|
1963
1997
|
onClick: () => {
|
|
@@ -1966,7 +2000,7 @@ var DialogProvider = function DialogProvider2({
|
|
|
1966
2000
|
}
|
|
1967
2001
|
},
|
|
1968
2002
|
contents.confirmButtonLabel ?? "OK"
|
|
1969
|
-
)) : contents?.type === "custom" ? /* @__PURE__ */
|
|
2003
|
+
)) : contents?.type === "custom" ? /* @__PURE__ */ React19.createElement(React19.Fragment, null, contents.children) : /* @__PURE__ */ React19.createElement(React19.Fragment, null, /* @__PURE__ */ React19.createElement(InputField2.Root, null, /* @__PURE__ */ React19.createElement(
|
|
1970
2004
|
InputField2.Input,
|
|
1971
2005
|
{
|
|
1972
2006
|
ref: inputRef,
|
|
@@ -1982,7 +2016,7 @@ var DialogProvider = function DialogProvider2({
|
|
|
1982
2016
|
},
|
|
1983
2017
|
onKeyDown: handleKeyDown
|
|
1984
2018
|
}
|
|
1985
|
-
)), /* @__PURE__ */
|
|
2019
|
+
)), /* @__PURE__ */ React19.createElement(Spacer.Vertical, { size: 20 }), /* @__PURE__ */ React19.createElement("div", { className: "flex flex-1 flex-row items-center" }, /* @__PURE__ */ React19.createElement(Spacer.Horizontal, null), /* @__PURE__ */ React19.createElement(Button, { onClick: close }, "Cancel"), /* @__PURE__ */ React19.createElement(Spacer.Horizontal, { size: 16 }), /* @__PURE__ */ React19.createElement(
|
|
1986
2020
|
Button,
|
|
1987
2021
|
{
|
|
1988
2022
|
disabled: !contents || contents.type !== "input" || !contents.inputValue,
|
|
@@ -1993,7 +2027,7 @@ var DialogProvider = function DialogProvider2({
|
|
|
1993
2027
|
));
|
|
1994
2028
|
};
|
|
1995
2029
|
function useDialogContext() {
|
|
1996
|
-
const value =
|
|
2030
|
+
const value = useContext4(DialogContext);
|
|
1997
2031
|
if (!value) {
|
|
1998
2032
|
throw new Error("Missing DialogProvider");
|
|
1999
2033
|
}
|
|
@@ -2014,10 +2048,10 @@ function useOpenDialog() {
|
|
|
2014
2048
|
|
|
2015
2049
|
// src/contexts/FloatingWindowContext.tsx
|
|
2016
2050
|
import { uuid } from "@noya-app/noya-utils";
|
|
2017
|
-
import
|
|
2051
|
+
import React20, { createContext as createContext5, useContext as useContext5, useMemo as useMemo8, useState as useState14 } from "react";
|
|
2018
2052
|
import { createPortal } from "react-dom";
|
|
2019
|
-
var FloatingWindowContext =
|
|
2020
|
-
var CurrentWindowContext =
|
|
2053
|
+
var FloatingWindowContext = createContext5(void 0);
|
|
2054
|
+
var CurrentWindowContext = createContext5(void 0);
|
|
2021
2055
|
var FloatingWindowProvider = ({
|
|
2022
2056
|
children
|
|
2023
2057
|
}) => {
|
|
@@ -2027,7 +2061,7 @@ var FloatingWindowProvider = ({
|
|
|
2027
2061
|
const id = uuid();
|
|
2028
2062
|
setWindows((windows2) => ({
|
|
2029
2063
|
...windows2,
|
|
2030
|
-
[id]: /* @__PURE__ */
|
|
2064
|
+
[id]: /* @__PURE__ */ React20.createElement(CurrentWindowContext.Provider, { value: { id } }, element)
|
|
2031
2065
|
}));
|
|
2032
2066
|
return id;
|
|
2033
2067
|
};
|
|
@@ -2039,12 +2073,12 @@ var FloatingWindowProvider = ({
|
|
|
2039
2073
|
};
|
|
2040
2074
|
return { createWindow, closeWindow };
|
|
2041
2075
|
}, []);
|
|
2042
|
-
return /* @__PURE__ */
|
|
2076
|
+
return /* @__PURE__ */ React20.createElement(FloatingWindowContext.Provider, { value: contextValue }, children, Object.entries(windows).map(
|
|
2043
2077
|
([id, element]) => createPortal(element, document.body, id)
|
|
2044
2078
|
));
|
|
2045
2079
|
};
|
|
2046
2080
|
var useFloatingWindowManager = () => {
|
|
2047
|
-
const context =
|
|
2081
|
+
const context = useContext5(FloatingWindowContext);
|
|
2048
2082
|
if (!context) {
|
|
2049
2083
|
throw new Error(
|
|
2050
2084
|
"useFloatingWindow must be used within a FloatingWindowProvider"
|
|
@@ -2053,7 +2087,7 @@ var useFloatingWindowManager = () => {
|
|
|
2053
2087
|
return context;
|
|
2054
2088
|
};
|
|
2055
2089
|
var useCurrentFloatingWindowInternal = () => {
|
|
2056
|
-
const context =
|
|
2090
|
+
const context = useContext5(CurrentWindowContext);
|
|
2057
2091
|
if (!context) {
|
|
2058
2092
|
throw new Error("useCurrentWindow must be used within a FloatingWindow");
|
|
2059
2093
|
}
|
|
@@ -2061,30 +2095,30 @@ var useCurrentFloatingWindowInternal = () => {
|
|
|
2061
2095
|
};
|
|
2062
2096
|
|
|
2063
2097
|
// src/contexts/DesignSystemConfiguration.tsx
|
|
2064
|
-
var DesignSystemConfigurationContext =
|
|
2098
|
+
var DesignSystemConfigurationContext = React21.createContext({
|
|
2065
2099
|
platform: "key"
|
|
2066
2100
|
});
|
|
2067
|
-
var DesignSystemConfigurationProvider =
|
|
2101
|
+
var DesignSystemConfigurationProvider = React21.memo(
|
|
2068
2102
|
function DesignSystemConfigurationProvider2({
|
|
2069
2103
|
children,
|
|
2070
2104
|
platform
|
|
2071
2105
|
}) {
|
|
2072
|
-
const [internalPlatform, setInternalPlatform] =
|
|
2073
|
-
|
|
2106
|
+
const [internalPlatform, setInternalPlatform] = React21.useState(platform ?? "key");
|
|
2107
|
+
React21.useEffect(() => {
|
|
2074
2108
|
if (platform !== void 0) return;
|
|
2075
2109
|
if (typeof navigator !== "undefined") {
|
|
2076
2110
|
setInternalPlatform(getCurrentPlatform(navigator));
|
|
2077
2111
|
}
|
|
2078
2112
|
}, [platform]);
|
|
2079
|
-
const contextValue =
|
|
2113
|
+
const contextValue = React21.useMemo(
|
|
2080
2114
|
() => ({ platform: platform ?? internalPlatform }),
|
|
2081
2115
|
[platform, internalPlatform]
|
|
2082
2116
|
);
|
|
2083
|
-
return /* @__PURE__ */
|
|
2117
|
+
return /* @__PURE__ */ React21.createElement(DesignSystemConfigurationContext.Provider, { value: contextValue }, /* @__PURE__ */ React21.createElement(DialogProvider, null, /* @__PURE__ */ React21.createElement(ToastProvider, null, /* @__PURE__ */ React21.createElement(FloatingWindowProvider, null, children))));
|
|
2084
2118
|
}
|
|
2085
2119
|
);
|
|
2086
2120
|
function useDesignSystemConfiguration() {
|
|
2087
|
-
return
|
|
2121
|
+
return React21.useContext(DesignSystemConfigurationContext);
|
|
2088
2122
|
}
|
|
2089
2123
|
|
|
2090
2124
|
// src/utils/withSeparatorElements.ts
|
|
@@ -2181,7 +2215,7 @@ function getKeyboardShortcutsForMenuItems(menuItems, onSelect) {
|
|
|
2181
2215
|
var ShortcutElement = ({
|
|
2182
2216
|
children,
|
|
2183
2217
|
fixedWidth
|
|
2184
|
-
}) => /* @__PURE__ */
|
|
2218
|
+
}) => /* @__PURE__ */ React22.createElement(
|
|
2185
2219
|
"kbd",
|
|
2186
2220
|
{
|
|
2187
2221
|
className: cx(
|
|
@@ -2192,12 +2226,12 @@ var ShortcutElement = ({
|
|
|
2192
2226
|
},
|
|
2193
2227
|
children
|
|
2194
2228
|
);
|
|
2195
|
-
var KeyboardShortcut =
|
|
2229
|
+
var KeyboardShortcut = memo9(function KeyboardShortcut2({
|
|
2196
2230
|
shortcut
|
|
2197
2231
|
}) {
|
|
2198
2232
|
const platform = useDesignSystemConfiguration().platform;
|
|
2199
2233
|
const { keys, separator: separator2 } = getShortcutDisplayParts(shortcut, platform);
|
|
2200
|
-
const keyElements = keys.map((key) => /* @__PURE__ */
|
|
2234
|
+
const keyElements = keys.map((key) => /* @__PURE__ */ React22.createElement(
|
|
2201
2235
|
ShortcutElement,
|
|
2202
2236
|
{
|
|
2203
2237
|
key,
|
|
@@ -2205,19 +2239,19 @@ var KeyboardShortcut = memo8(function KeyboardShortcut2({
|
|
|
2205
2239
|
},
|
|
2206
2240
|
key
|
|
2207
2241
|
));
|
|
2208
|
-
return /* @__PURE__ */
|
|
2242
|
+
return /* @__PURE__ */ React22.createElement(React22.Fragment, null, separator2 ? withSeparatorElements(
|
|
2209
2243
|
keyElements,
|
|
2210
|
-
/* @__PURE__ */
|
|
2244
|
+
/* @__PURE__ */ React22.createElement(ShortcutElement, null, separator2)
|
|
2211
2245
|
) : keyElements);
|
|
2212
2246
|
});
|
|
2213
|
-
var SectionHeader =
|
|
2247
|
+
var SectionHeader = memo9(function SectionHeader2({
|
|
2214
2248
|
title,
|
|
2215
2249
|
variant = "normal",
|
|
2216
2250
|
id,
|
|
2217
2251
|
isFirst,
|
|
2218
2252
|
indented
|
|
2219
2253
|
}) {
|
|
2220
|
-
return /* @__PURE__ */
|
|
2254
|
+
return /* @__PURE__ */ React22.createElement(
|
|
2221
2255
|
"span",
|
|
2222
2256
|
{
|
|
2223
2257
|
id,
|
|
@@ -2232,7 +2266,7 @@ var SectionHeader = memo8(function SectionHeader2({
|
|
|
2232
2266
|
}
|
|
2233
2267
|
)
|
|
2234
2268
|
},
|
|
2235
|
-
indented && /* @__PURE__ */
|
|
2269
|
+
indented && /* @__PURE__ */ React22.createElement(
|
|
2236
2270
|
Spacer.Horizontal,
|
|
2237
2271
|
{
|
|
2238
2272
|
size: CHECKBOX_WIDTH - CHECKBOX_RIGHT_INSET + CHECKBOX_INDENT_WIDTH
|
|
@@ -2244,12 +2278,12 @@ var SectionHeader = memo8(function SectionHeader2({
|
|
|
2244
2278
|
|
|
2245
2279
|
// src/components/internal/MenuViewport.tsx
|
|
2246
2280
|
import { ChevronRightIcon } from "@noya-app/noya-icons";
|
|
2247
|
-
import
|
|
2281
|
+
import React24 from "react";
|
|
2248
2282
|
|
|
2249
2283
|
// src/components/internal/SelectItem.tsx
|
|
2250
2284
|
import { CheckIcon } from "@noya-app/noya-icons";
|
|
2251
|
-
import
|
|
2252
|
-
var SelectItem =
|
|
2285
|
+
import React23, { useCallback as useCallback14 } from "react";
|
|
2286
|
+
var SelectItem = React23.forwardRef(
|
|
2253
2287
|
({
|
|
2254
2288
|
children,
|
|
2255
2289
|
icon,
|
|
@@ -2274,7 +2308,7 @@ var SelectItem = React22.forwardRef(
|
|
|
2274
2308
|
[]
|
|
2275
2309
|
);
|
|
2276
2310
|
if (checked && Components4.CheckboxItem) {
|
|
2277
|
-
return /* @__PURE__ */
|
|
2311
|
+
return /* @__PURE__ */ React23.createElement("div", { className: "px-1" }, /* @__PURE__ */ React23.createElement(
|
|
2278
2312
|
Components4.CheckboxItem,
|
|
2279
2313
|
{
|
|
2280
2314
|
checked,
|
|
@@ -2286,14 +2320,14 @@ var SelectItem = React22.forwardRef(
|
|
|
2286
2320
|
testSelected && styles.testSelectedItemStyle
|
|
2287
2321
|
)
|
|
2288
2322
|
},
|
|
2289
|
-
/* @__PURE__ */
|
|
2290
|
-
Components4.ItemIndicator && /* @__PURE__ */
|
|
2291
|
-
icon && /* @__PURE__ */
|
|
2323
|
+
/* @__PURE__ */ React23.createElement(Spacer.Horizontal, { size: CHECKBOX_INDENT_WIDTH }),
|
|
2324
|
+
Components4.ItemIndicator && /* @__PURE__ */ React23.createElement(Components4.ItemIndicator, { ...styles.itemIndicator }, /* @__PURE__ */ React23.createElement(CheckIcon, null)),
|
|
2325
|
+
icon && /* @__PURE__ */ React23.createElement(React23.Fragment, null, renderIcon(icon), /* @__PURE__ */ React23.createElement(Spacer.Horizontal, { size: 8 })),
|
|
2292
2326
|
children,
|
|
2293
|
-
shortcut && /* @__PURE__ */
|
|
2327
|
+
shortcut && /* @__PURE__ */ React23.createElement(React23.Fragment, null, /* @__PURE__ */ React23.createElement(Spacer.Horizontal, null), /* @__PURE__ */ React23.createElement(Spacer.Horizontal, { size: 24 }), /* @__PURE__ */ React23.createElement(KeyboardShortcut, { shortcut }))
|
|
2294
2328
|
));
|
|
2295
2329
|
}
|
|
2296
|
-
return /* @__PURE__ */
|
|
2330
|
+
return /* @__PURE__ */ React23.createElement("div", { className: "px-1" }, /* @__PURE__ */ React23.createElement(
|
|
2297
2331
|
Components4.Item,
|
|
2298
2332
|
{
|
|
2299
2333
|
className: cx(
|
|
@@ -2308,7 +2342,7 @@ var SelectItem = React22.forwardRef(
|
|
|
2308
2342
|
onSelect: handleSelectItem,
|
|
2309
2343
|
...props
|
|
2310
2344
|
},
|
|
2311
|
-
/* @__PURE__ */
|
|
2345
|
+
/* @__PURE__ */ React23.createElement("div", { className: "flex flex-1 items-center" }, indented && /* @__PURE__ */ React23.createElement(Spacer.Horizontal, { size: CHECKBOX_INDENT_WIDTH }), checked ? /* @__PURE__ */ React23.createElement("div", { ...styles.itemIndicator }, /* @__PURE__ */ React23.createElement(CheckIcon, null)) : indented ? /* @__PURE__ */ React23.createElement(Spacer.Horizontal, { size: CHECKBOX_WIDTH - CHECKBOX_RIGHT_INSET }) : null, icon && /* @__PURE__ */ React23.createElement(React23.Fragment, null, renderIcon(icon), /* @__PURE__ */ React23.createElement(Spacer.Horizontal, { size: 8 })), /* @__PURE__ */ React23.createElement(Components4.ItemText, null, children), shortcut && /* @__PURE__ */ React23.createElement(React23.Fragment, null, /* @__PURE__ */ React23.createElement(Spacer.Horizontal, null), /* @__PURE__ */ React23.createElement(Spacer.Horizontal, { size: 24 }), /* @__PURE__ */ React23.createElement(KeyboardShortcut, { shortcut })))
|
|
2312
2346
|
));
|
|
2313
2347
|
}
|
|
2314
2348
|
);
|
|
@@ -2319,13 +2353,14 @@ var MenuViewport = ({
|
|
|
2319
2353
|
Components: Components4,
|
|
2320
2354
|
onSelect
|
|
2321
2355
|
}) => {
|
|
2356
|
+
const portalScopeId = usePortalScopeId();
|
|
2322
2357
|
const hasCheckedItem = items.some(
|
|
2323
2358
|
(item) => item.type !== "separator" && item.type !== "sectionHeader" && item.checked
|
|
2324
2359
|
);
|
|
2325
|
-
return /* @__PURE__ */
|
|
2360
|
+
return /* @__PURE__ */ React24.createElement(React24.Fragment, null, items.map((item, index) => {
|
|
2326
2361
|
switch (item.type) {
|
|
2327
2362
|
case "separator":
|
|
2328
|
-
return /* @__PURE__ */
|
|
2363
|
+
return /* @__PURE__ */ React24.createElement(
|
|
2329
2364
|
Components4.Separator,
|
|
2330
2365
|
{
|
|
2331
2366
|
key: index,
|
|
@@ -2333,7 +2368,7 @@ var MenuViewport = ({
|
|
|
2333
2368
|
}
|
|
2334
2369
|
);
|
|
2335
2370
|
case "sectionHeader":
|
|
2336
|
-
return /* @__PURE__ */
|
|
2371
|
+
return /* @__PURE__ */ React24.createElement(
|
|
2337
2372
|
SectionHeader,
|
|
2338
2373
|
{
|
|
2339
2374
|
isFirst: index === 0,
|
|
@@ -2344,7 +2379,7 @@ var MenuViewport = ({
|
|
|
2344
2379
|
);
|
|
2345
2380
|
case "submenu":
|
|
2346
2381
|
if (item.items && Components4.Sub && Components4.SubTrigger && Components4.SubContent && Components4.Portal) {
|
|
2347
|
-
return /* @__PURE__ */
|
|
2382
|
+
return /* @__PURE__ */ React24.createElement(Components4.Sub, { key: item.id }, /* @__PURE__ */ React24.createElement(
|
|
2348
2383
|
Components4.SubTrigger,
|
|
2349
2384
|
{
|
|
2350
2385
|
className: cx(
|
|
@@ -2355,9 +2390,10 @@ var MenuViewport = ({
|
|
|
2355
2390
|
onClick: (e) => {
|
|
2356
2391
|
e.stopPropagation();
|
|
2357
2392
|
e.preventDefault();
|
|
2358
|
-
}
|
|
2393
|
+
},
|
|
2394
|
+
disabled: item.disabled
|
|
2359
2395
|
},
|
|
2360
|
-
/* @__PURE__ */
|
|
2396
|
+
/* @__PURE__ */ React24.createElement(
|
|
2361
2397
|
SelectItem,
|
|
2362
2398
|
{
|
|
2363
2399
|
value: item.id,
|
|
@@ -2368,16 +2404,17 @@ var MenuViewport = ({
|
|
|
2368
2404
|
indented: hasCheckedItem,
|
|
2369
2405
|
disabled: item.disabled
|
|
2370
2406
|
},
|
|
2371
|
-
/* @__PURE__ */
|
|
2372
|
-
/* @__PURE__ */
|
|
2407
|
+
/* @__PURE__ */ React24.createElement("div", { className: "flex items-center flex-1" }, item.title),
|
|
2408
|
+
/* @__PURE__ */ React24.createElement(ChevronRightIcon, { className: "-mr-1" })
|
|
2373
2409
|
)
|
|
2374
|
-
), /* @__PURE__ */
|
|
2410
|
+
), /* @__PURE__ */ React24.createElement(Components4.Portal, null, /* @__PURE__ */ React24.createElement(
|
|
2375
2411
|
Components4.SubContent,
|
|
2376
2412
|
{
|
|
2413
|
+
...portalScopeProps(portalScopeId),
|
|
2377
2414
|
alignOffset: -5,
|
|
2378
2415
|
className: styles.contentStyle
|
|
2379
2416
|
},
|
|
2380
|
-
/* @__PURE__ */
|
|
2417
|
+
/* @__PURE__ */ React24.createElement(
|
|
2381
2418
|
MenuViewport,
|
|
2382
2419
|
{
|
|
2383
2420
|
items: item.items,
|
|
@@ -2388,7 +2425,7 @@ var MenuViewport = ({
|
|
|
2388
2425
|
)));
|
|
2389
2426
|
} else return null;
|
|
2390
2427
|
default:
|
|
2391
|
-
return /* @__PURE__ */
|
|
2428
|
+
return /* @__PURE__ */ React24.createElement(
|
|
2392
2429
|
SelectItem,
|
|
2393
2430
|
{
|
|
2394
2431
|
key: item.value,
|
|
@@ -2411,7 +2448,7 @@ var MenuViewport = ({
|
|
|
2411
2448
|
// src/components/DropdownMenu.tsx
|
|
2412
2449
|
var Components = {
|
|
2413
2450
|
Separator: RadixDropdownMenu.Separator,
|
|
2414
|
-
ItemText:
|
|
2451
|
+
ItemText: React25.Fragment,
|
|
2415
2452
|
Item: RadixDropdownMenu.Item,
|
|
2416
2453
|
CheckboxItem: RadixDropdownMenu.CheckboxItem,
|
|
2417
2454
|
ItemIndicator: RadixDropdownMenu.ItemIndicator,
|
|
@@ -2437,6 +2474,7 @@ var DropdownMenuRoot = forwardRefGeneric(function DropdownMenuRoot2(props, forwa
|
|
|
2437
2474
|
emptyState,
|
|
2438
2475
|
contentStyle
|
|
2439
2476
|
} = props;
|
|
2477
|
+
const portalScopeId = usePortalScopeId();
|
|
2440
2478
|
const keymap = useMemo10(
|
|
2441
2479
|
() => shouldBindKeyboardShortcuts === false ? {} : getKeyboardShortcutsForMenuItems(items, onSelect),
|
|
2442
2480
|
[items, onSelect, shouldBindKeyboardShortcuts]
|
|
@@ -2450,16 +2488,17 @@ var DropdownMenuRoot = forwardRefGeneric(function DropdownMenuRoot2(props, forwa
|
|
|
2450
2488
|
}),
|
|
2451
2489
|
[contentStyle]
|
|
2452
2490
|
);
|
|
2453
|
-
return /* @__PURE__ */
|
|
2491
|
+
return /* @__PURE__ */ React25.createElement(RadixDropdownMenu.Root, { onOpenChange, open }, /* @__PURE__ */ React25.createElement(
|
|
2454
2492
|
RadixDropdownMenu.Trigger,
|
|
2455
2493
|
{
|
|
2456
2494
|
ref: forwardedRef,
|
|
2457
2495
|
asChild: true
|
|
2458
2496
|
},
|
|
2459
2497
|
children
|
|
2460
|
-
), /* @__PURE__ */
|
|
2498
|
+
), /* @__PURE__ */ React25.createElement(RadixDropdownMenu.Portal, null, /* @__PURE__ */ React25.createElement(
|
|
2461
2499
|
RadixDropdownMenu.Content,
|
|
2462
2500
|
{
|
|
2501
|
+
...portalScopeProps(portalScopeId),
|
|
2463
2502
|
className: styles.contentStyle,
|
|
2464
2503
|
side,
|
|
2465
2504
|
sideOffset,
|
|
@@ -2470,7 +2509,7 @@ var DropdownMenuRoot = forwardRefGeneric(function DropdownMenuRoot2(props, forwa
|
|
|
2470
2509
|
...{ onCloseAutoFocus }
|
|
2471
2510
|
},
|
|
2472
2511
|
items.length === 0 ? emptyState : null,
|
|
2473
|
-
/* @__PURE__ */
|
|
2512
|
+
/* @__PURE__ */ React25.createElement(
|
|
2474
2513
|
MenuViewport,
|
|
2475
2514
|
{
|
|
2476
2515
|
items,
|
|
@@ -2501,14 +2540,14 @@ var ActionMenu = memoGeneric(function ActionMenu2({
|
|
|
2501
2540
|
...style2
|
|
2502
2541
|
};
|
|
2503
2542
|
}, [selected, style2, variant]);
|
|
2504
|
-
return /* @__PURE__ */
|
|
2543
|
+
return /* @__PURE__ */ React26.createElement(
|
|
2505
2544
|
DropdownMenu,
|
|
2506
2545
|
{
|
|
2507
2546
|
items: menuItems,
|
|
2508
2547
|
onSelect,
|
|
2509
2548
|
onOpenChange
|
|
2510
2549
|
},
|
|
2511
|
-
/* @__PURE__ */
|
|
2550
|
+
/* @__PURE__ */ React26.createElement(
|
|
2512
2551
|
IconButton,
|
|
2513
2552
|
{
|
|
2514
2553
|
style: internalStyle,
|
|
@@ -2522,16 +2561,16 @@ var ActionMenu = memoGeneric(function ActionMenu2({
|
|
|
2522
2561
|
});
|
|
2523
2562
|
|
|
2524
2563
|
// src/components/ActivityIndicator.tsx
|
|
2525
|
-
import * as
|
|
2526
|
-
var ActivityIndicator =
|
|
2564
|
+
import * as React27 from "react";
|
|
2565
|
+
var ActivityIndicator = React27.memo(function ActivityIndicator2({
|
|
2527
2566
|
size: size2 = 16,
|
|
2528
2567
|
opacity = 1,
|
|
2529
2568
|
color = "black",
|
|
2530
2569
|
trackColor = "rgba(0, 0, 0, 0.1)",
|
|
2531
2570
|
className
|
|
2532
2571
|
}) {
|
|
2533
|
-
const opacityStyle =
|
|
2534
|
-
const dynamicStyles =
|
|
2572
|
+
const opacityStyle = React27.useMemo(() => ({ opacity }), [opacity]);
|
|
2573
|
+
const dynamicStyles = React27.useMemo(
|
|
2535
2574
|
() => ({
|
|
2536
2575
|
border: `2px solid ${trackColor}`,
|
|
2537
2576
|
borderTopColor: color,
|
|
@@ -2540,19 +2579,19 @@ var ActivityIndicator = React26.memo(function ActivityIndicator2({
|
|
|
2540
2579
|
}),
|
|
2541
2580
|
[size2, color, trackColor]
|
|
2542
2581
|
);
|
|
2543
|
-
return /* @__PURE__ */
|
|
2582
|
+
return /* @__PURE__ */ React27.createElement(
|
|
2544
2583
|
"div",
|
|
2545
2584
|
{
|
|
2546
2585
|
className: cx("flex justify-center items-center", className),
|
|
2547
2586
|
style: opacityStyle
|
|
2548
2587
|
},
|
|
2549
|
-
/* @__PURE__ */
|
|
2588
|
+
/* @__PURE__ */ React27.createElement("div", { style: dynamicStyles, className: "animate-spin rounded-[50%]" })
|
|
2550
2589
|
);
|
|
2551
2590
|
});
|
|
2552
2591
|
|
|
2553
2592
|
// src/components/Avatar.tsx
|
|
2554
2593
|
import * as AvatarPrimitive from "@radix-ui/react-avatar";
|
|
2555
|
-
import
|
|
2594
|
+
import React28, { forwardRef as forwardRef10, useMemo as useMemo13 } from "react";
|
|
2556
2595
|
|
|
2557
2596
|
// src/utils/colorFromString.ts
|
|
2558
2597
|
var colorForStringValues = {
|
|
@@ -2621,7 +2660,7 @@ var getInnerAvatarStyles = (size2, variant) => {
|
|
|
2621
2660
|
minHeight: dimension
|
|
2622
2661
|
};
|
|
2623
2662
|
};
|
|
2624
|
-
var AvatarRoot =
|
|
2663
|
+
var AvatarRoot = React28.forwardRef(
|
|
2625
2664
|
({
|
|
2626
2665
|
className,
|
|
2627
2666
|
size: size2 = 21,
|
|
@@ -2640,7 +2679,7 @@ var AvatarRoot = React27.forwardRef(
|
|
|
2640
2679
|
}),
|
|
2641
2680
|
[backgroundColor, size2, style2]
|
|
2642
2681
|
);
|
|
2643
|
-
return /* @__PURE__ */
|
|
2682
|
+
return /* @__PURE__ */ React28.createElement(
|
|
2644
2683
|
AvatarPrimitive.Root,
|
|
2645
2684
|
{
|
|
2646
2685
|
ref,
|
|
@@ -2655,8 +2694,8 @@ var AvatarRoot = React27.forwardRef(
|
|
|
2655
2694
|
);
|
|
2656
2695
|
}
|
|
2657
2696
|
);
|
|
2658
|
-
var AvatarImage =
|
|
2659
|
-
return /* @__PURE__ */
|
|
2697
|
+
var AvatarImage = React28.forwardRef(({ className, size: size2 = 21, variant = "normal", ...props }, ref) => {
|
|
2698
|
+
return /* @__PURE__ */ React28.createElement(
|
|
2660
2699
|
AvatarPrimitive.Image,
|
|
2661
2700
|
{
|
|
2662
2701
|
ref,
|
|
@@ -2672,9 +2711,9 @@ var AvatarImage = React27.forwardRef(({ className, size: size2 = 21, variant = "
|
|
|
2672
2711
|
function getMonogram(text) {
|
|
2673
2712
|
return text?.at(0)?.toLocaleUpperCase();
|
|
2674
2713
|
}
|
|
2675
|
-
var AvatarFallback =
|
|
2714
|
+
var AvatarFallback = React28.forwardRef(
|
|
2676
2715
|
({ className, children, style: style2, size: size2 = 21, backgroundColor, ...props }, ref) => {
|
|
2677
|
-
return /* @__PURE__ */
|
|
2716
|
+
return /* @__PURE__ */ React28.createElement(
|
|
2678
2717
|
AvatarPrimitive.Fallback,
|
|
2679
2718
|
{
|
|
2680
2719
|
ref,
|
|
@@ -2695,7 +2734,7 @@ var AvatarFallback = React27.forwardRef(
|
|
|
2695
2734
|
);
|
|
2696
2735
|
}
|
|
2697
2736
|
);
|
|
2698
|
-
var Avatar =
|
|
2737
|
+
var Avatar = React28.memo(
|
|
2699
2738
|
forwardRef10(function Avatar2({
|
|
2700
2739
|
image,
|
|
2701
2740
|
name,
|
|
@@ -2708,7 +2747,7 @@ var Avatar = React27.memo(
|
|
|
2708
2747
|
...props
|
|
2709
2748
|
}, forwardedRef) {
|
|
2710
2749
|
const getBackgroundColor = backgroundColor ?? colorFromString(userId ?? name ?? "");
|
|
2711
|
-
return /* @__PURE__ */
|
|
2750
|
+
return /* @__PURE__ */ React28.createElement(
|
|
2712
2751
|
AvatarRoot,
|
|
2713
2752
|
{
|
|
2714
2753
|
ref: forwardedRef,
|
|
@@ -2718,7 +2757,7 @@ var Avatar = React27.memo(
|
|
|
2718
2757
|
className,
|
|
2719
2758
|
...props
|
|
2720
2759
|
},
|
|
2721
|
-
image ? /* @__PURE__ */
|
|
2760
|
+
image ? /* @__PURE__ */ React28.createElement(AvatarImage, { src: image, alt: name, size: size2, variant }) : /* @__PURE__ */ React28.createElement(
|
|
2722
2761
|
AvatarFallback,
|
|
2723
2762
|
{
|
|
2724
2763
|
backgroundColor: getBackgroundColor,
|
|
@@ -2730,31 +2769,31 @@ var Avatar = React27.memo(
|
|
|
2730
2769
|
);
|
|
2731
2770
|
})
|
|
2732
2771
|
);
|
|
2733
|
-
var OverflowAvatar =
|
|
2772
|
+
var OverflowAvatar = React28.memo(function OverflowAvatar2({
|
|
2734
2773
|
size: size2 = 21,
|
|
2735
2774
|
count
|
|
2736
2775
|
}) {
|
|
2737
|
-
return /* @__PURE__ */
|
|
2776
|
+
return /* @__PURE__ */ React28.createElement(AvatarRoot, { size: size2, backgroundColor: "var(--n-text-disabled)", disabled: true }, /* @__PURE__ */ React28.createElement(AvatarFallback, { backgroundColor: "var(--n-text-disabled)", size: size2 }, "+", count));
|
|
2738
2777
|
});
|
|
2739
|
-
var AvatarStack =
|
|
2778
|
+
var AvatarStack = React28.memo(function AvatarStack2({
|
|
2740
2779
|
size: size2 = 21,
|
|
2741
2780
|
children,
|
|
2742
2781
|
max = 3,
|
|
2743
2782
|
className
|
|
2744
2783
|
}) {
|
|
2745
|
-
const avatarCount =
|
|
2784
|
+
const avatarCount = React28.Children.count(children);
|
|
2746
2785
|
const overflowCount = avatarCount - max;
|
|
2747
2786
|
const childrenArray = useMemo13(() => {
|
|
2748
|
-
const processedChildren =
|
|
2787
|
+
const processedChildren = React28.Children.toArray(children).map((child) => React28.cloneElement(child, { size: size2 })).slice(0, max);
|
|
2749
2788
|
if (avatarCount > max) {
|
|
2750
2789
|
return [
|
|
2751
|
-
/* @__PURE__ */
|
|
2790
|
+
/* @__PURE__ */ React28.createElement(OverflowAvatar, { key: "overflow", size: size2, count: overflowCount }),
|
|
2752
2791
|
...processedChildren
|
|
2753
2792
|
];
|
|
2754
2793
|
}
|
|
2755
2794
|
return processedChildren;
|
|
2756
2795
|
}, [children, max, size2, avatarCount, overflowCount]);
|
|
2757
|
-
return /* @__PURE__ */
|
|
2796
|
+
return /* @__PURE__ */ React28.createElement(
|
|
2758
2797
|
"div",
|
|
2759
2798
|
{
|
|
2760
2799
|
className: cx(
|
|
@@ -2764,7 +2803,7 @@ var AvatarStack = React27.memo(function AvatarStack2({
|
|
|
2764
2803
|
)
|
|
2765
2804
|
},
|
|
2766
2805
|
childrenArray.map((child, index) => {
|
|
2767
|
-
return /* @__PURE__ */
|
|
2806
|
+
return /* @__PURE__ */ React28.createElement(
|
|
2768
2807
|
"div",
|
|
2769
2808
|
{
|
|
2770
2809
|
className: cx("relative", size2 > 36 ? "-ml-3" : "-ml-1.5"),
|
|
@@ -2777,10 +2816,10 @@ var AvatarStack = React27.memo(function AvatarStack2({
|
|
|
2777
2816
|
});
|
|
2778
2817
|
|
|
2779
2818
|
// src/components/NoyaLogo.tsx
|
|
2780
|
-
import
|
|
2819
|
+
import React29, { forwardRef as forwardRef11 } from "react";
|
|
2781
2820
|
var Logo = forwardRef11(function Logo2(props, ref) {
|
|
2782
2821
|
const fill = props.fill || cssVars.colors.logoFill;
|
|
2783
|
-
return /* @__PURE__ */
|
|
2822
|
+
return /* @__PURE__ */ React29.createElement(
|
|
2784
2823
|
"svg",
|
|
2785
2824
|
{
|
|
2786
2825
|
ref,
|
|
@@ -2790,14 +2829,14 @@ var Logo = forwardRef11(function Logo2(props, ref) {
|
|
|
2790
2829
|
...props,
|
|
2791
2830
|
className: "w-6 aspect-[24/26]"
|
|
2792
2831
|
},
|
|
2793
|
-
/* @__PURE__ */
|
|
2832
|
+
/* @__PURE__ */ React29.createElement(
|
|
2794
2833
|
"path",
|
|
2795
2834
|
{
|
|
2796
2835
|
d: "M6.5 3H2V12H5V6H6.5C7.32843 6 8 6.67157 8 7.5V12H11V7.5C11 5.01472 8.98528 3 6.5 3Z",
|
|
2797
2836
|
fill
|
|
2798
2837
|
}
|
|
2799
2838
|
),
|
|
2800
|
-
/* @__PURE__ */
|
|
2839
|
+
/* @__PURE__ */ React29.createElement(
|
|
2801
2840
|
"path",
|
|
2802
2841
|
{
|
|
2803
2842
|
fillRule: "evenodd",
|
|
@@ -2806,14 +2845,14 @@ var Logo = forwardRef11(function Logo2(props, ref) {
|
|
|
2806
2845
|
fill
|
|
2807
2846
|
}
|
|
2808
2847
|
),
|
|
2809
|
-
/* @__PURE__ */
|
|
2848
|
+
/* @__PURE__ */ React29.createElement(
|
|
2810
2849
|
"path",
|
|
2811
2850
|
{
|
|
2812
2851
|
d: "M5 14H2V18.5C2 20.9853 4.01472 23 6.5 23H8V26H11V17H8V20H6.5C5.67157 20 5 19.3284 5 18.5V14Z",
|
|
2813
2852
|
fill
|
|
2814
2853
|
}
|
|
2815
2854
|
),
|
|
2816
|
-
/* @__PURE__ */
|
|
2855
|
+
/* @__PURE__ */ React29.createElement(
|
|
2817
2856
|
"path",
|
|
2818
2857
|
{
|
|
2819
2858
|
fillRule: "evenodd",
|
|
@@ -2826,12 +2865,12 @@ var Logo = forwardRef11(function Logo2(props, ref) {
|
|
|
2826
2865
|
});
|
|
2827
2866
|
|
|
2828
2867
|
// src/components/ai-assistant/AIAssistantLayout.tsx
|
|
2829
|
-
import
|
|
2868
|
+
import React31, { forwardRef as forwardRef13 } from "react";
|
|
2830
2869
|
|
|
2831
2870
|
// src/components/TextArea.tsx
|
|
2832
|
-
import
|
|
2871
|
+
import React30, {
|
|
2833
2872
|
forwardRef as forwardRef12,
|
|
2834
|
-
memo as
|
|
2873
|
+
memo as memo11,
|
|
2835
2874
|
useCallback as useCallback15,
|
|
2836
2875
|
useEffect as useEffect11,
|
|
2837
2876
|
useRef as useRef12
|
|
@@ -2846,7 +2885,7 @@ var useAutoResize = (value) => {
|
|
|
2846
2885
|
}, [value]);
|
|
2847
2886
|
return textareaRef;
|
|
2848
2887
|
};
|
|
2849
|
-
var TextArea =
|
|
2888
|
+
var TextArea = memo11(
|
|
2850
2889
|
forwardRef12(function TextArea2({
|
|
2851
2890
|
value,
|
|
2852
2891
|
onChangeText,
|
|
@@ -2875,7 +2914,7 @@ var TextArea = memo10(
|
|
|
2875
2914
|
},
|
|
2876
2915
|
[autoResize, autoResizeRef, forwardedRef]
|
|
2877
2916
|
);
|
|
2878
|
-
return /* @__PURE__ */
|
|
2917
|
+
return /* @__PURE__ */ React30.createElement(
|
|
2879
2918
|
"textarea",
|
|
2880
2919
|
{
|
|
2881
2920
|
className: cx(
|
|
@@ -2891,7 +2930,7 @@ var TextArea = memo10(
|
|
|
2891
2930
|
);
|
|
2892
2931
|
})
|
|
2893
2932
|
);
|
|
2894
|
-
var TextAreaRow =
|
|
2933
|
+
var TextAreaRow = memo11(
|
|
2895
2934
|
forwardRef12(function TextAreaRow2({
|
|
2896
2935
|
className,
|
|
2897
2936
|
textAreaClassName,
|
|
@@ -2900,31 +2939,31 @@ var TextAreaRow = memo10(
|
|
|
2900
2939
|
endClassName,
|
|
2901
2940
|
...rest
|
|
2902
2941
|
}, forwardedRef) {
|
|
2903
|
-
return /* @__PURE__ */
|
|
2942
|
+
return /* @__PURE__ */ React30.createElement(
|
|
2904
2943
|
"div",
|
|
2905
2944
|
{
|
|
2906
2945
|
ref: forwardedRef,
|
|
2907
2946
|
className: cx("relative w-full h-full", className)
|
|
2908
2947
|
},
|
|
2909
|
-
/* @__PURE__ */
|
|
2910
|
-
/* @__PURE__ */
|
|
2948
|
+
/* @__PURE__ */ React30.createElement(TextArea, { className: textAreaClassName, ...rest, ref: textAreaRef }),
|
|
2949
|
+
/* @__PURE__ */ React30.createElement("div", { className: cx("absolute right-1 top-4", endClassName) }, end)
|
|
2911
2950
|
);
|
|
2912
2951
|
})
|
|
2913
2952
|
);
|
|
2914
2953
|
|
|
2915
2954
|
// src/components/ai-assistant/AIAssistantLayout.tsx
|
|
2916
2955
|
var AIAssistantLoadingIndicator = () => {
|
|
2917
|
-
return /* @__PURE__ */
|
|
2956
|
+
return /* @__PURE__ */ React31.createElement("div", { className: "flex gap-2" }, /* @__PURE__ */ React31.createElement(
|
|
2918
2957
|
Avatar,
|
|
2919
2958
|
{
|
|
2920
2959
|
name: "Assistant",
|
|
2921
2960
|
size: INPUT_HEIGHT,
|
|
2922
2961
|
backgroundColor: cssVars.colors.primaryPastel
|
|
2923
2962
|
},
|
|
2924
|
-
/* @__PURE__ */
|
|
2925
|
-
), /* @__PURE__ */
|
|
2963
|
+
/* @__PURE__ */ React31.createElement(Logo, { style: { width: 15 }, fill: cssVars.colors.primary })
|
|
2964
|
+
), /* @__PURE__ */ React31.createElement("div", { className: "animate-pulse" }, "\u258B"));
|
|
2926
2965
|
};
|
|
2927
|
-
var AIAssistantInput = forwardRef13(({ value, onChange, onSubmitClick, onKeyDown, disabled }, ref) => /* @__PURE__ */
|
|
2966
|
+
var AIAssistantInput = forwardRef13(({ value, onChange, onSubmitClick, onKeyDown, disabled }, ref) => /* @__PURE__ */ React31.createElement(
|
|
2928
2967
|
TextAreaRow,
|
|
2929
2968
|
{
|
|
2930
2969
|
autoResize: true,
|
|
@@ -2936,7 +2975,7 @@ var AIAssistantInput = forwardRef13(({ value, onChange, onSubmitClick, onKeyDown
|
|
|
2936
2975
|
placeholder: "Tell me what you'd like to do...",
|
|
2937
2976
|
onKeyDown,
|
|
2938
2977
|
disabled,
|
|
2939
|
-
end: /* @__PURE__ */
|
|
2978
|
+
end: /* @__PURE__ */ React31.createElement(
|
|
2940
2979
|
IconButton,
|
|
2941
2980
|
{
|
|
2942
2981
|
iconName: "ArrowUpIcon",
|
|
@@ -2961,13 +3000,13 @@ var AIAssistantLayout = forwardRef13(
|
|
|
2961
3000
|
className,
|
|
2962
3001
|
style: style2
|
|
2963
3002
|
}, ref) => {
|
|
2964
|
-
return /* @__PURE__ */
|
|
3003
|
+
return /* @__PURE__ */ React31.createElement("div", { className: cx("flex flex-col flex-1", className), style: style2 }, /* @__PURE__ */ React31.createElement("div", { className: "flex-1 min-h-0 overflow-auto", ref }, /* @__PURE__ */ React31.createElement("div", { className: "flex flex-col gap-2 pb-4 pt-1" }, renderMessages(), isLoading ? renderLoadingIndicator?.() : null)), /* @__PURE__ */ React31.createElement("div", { className: "border-t border-divider pt-1 px-1" }, renderInput()));
|
|
2965
3004
|
}
|
|
2966
3005
|
);
|
|
2967
3006
|
|
|
2968
3007
|
// src/components/AnimatePresence.tsx
|
|
2969
3008
|
import { isDeepEqual as isDeepEqual3 } from "@noya-app/noya-utils";
|
|
2970
|
-
import
|
|
3009
|
+
import React32, {
|
|
2971
3010
|
Children as Children2,
|
|
2972
3011
|
isValidElement as isValidElement2,
|
|
2973
3012
|
useCallback as useCallback16,
|
|
@@ -3047,7 +3086,7 @@ var PresenceChild = ({
|
|
|
3047
3086
|
if (animationState === "exited" && !isPresent) {
|
|
3048
3087
|
return null;
|
|
3049
3088
|
}
|
|
3050
|
-
return /* @__PURE__ */
|
|
3089
|
+
return /* @__PURE__ */ React32.createElement("div", { style: mergedAnimationStyles[animationState], className }, children);
|
|
3051
3090
|
};
|
|
3052
3091
|
var AnimatePresence = ({
|
|
3053
3092
|
children,
|
|
@@ -3122,7 +3161,7 @@ var AnimatePresence = ({
|
|
|
3122
3161
|
return filtered;
|
|
3123
3162
|
});
|
|
3124
3163
|
}, []);
|
|
3125
|
-
return /* @__PURE__ */
|
|
3164
|
+
return /* @__PURE__ */ React32.createElement(React32.Fragment, null, mountedChildren.map(({ child, isPresent, skipInitialAnimation: skipInitialAnimation2 }) => /* @__PURE__ */ React32.createElement(
|
|
3126
3165
|
PresenceChild,
|
|
3127
3166
|
{
|
|
3128
3167
|
key: child.key,
|
|
@@ -3138,13 +3177,13 @@ var AnimatePresence = ({
|
|
|
3138
3177
|
};
|
|
3139
3178
|
|
|
3140
3179
|
// src/components/Banner.tsx
|
|
3141
|
-
import
|
|
3180
|
+
import React33 from "react";
|
|
3142
3181
|
var bannerStyles = {
|
|
3143
3182
|
backgroundColor: cssVars.colors.inputBackground,
|
|
3144
3183
|
color: cssVars.colors.textDisabled
|
|
3145
3184
|
};
|
|
3146
3185
|
function Banner({ label = "No items", className, style: style2 }) {
|
|
3147
|
-
return /* @__PURE__ */
|
|
3186
|
+
return /* @__PURE__ */ React33.createElement(
|
|
3148
3187
|
"div",
|
|
3149
3188
|
{
|
|
3150
3189
|
className: cx(
|
|
@@ -3153,15 +3192,15 @@ function Banner({ label = "No items", className, style: style2 }) {
|
|
|
3153
3192
|
),
|
|
3154
3193
|
style: { ...bannerStyles, ...style2 }
|
|
3155
3194
|
},
|
|
3156
|
-
/* @__PURE__ */
|
|
3195
|
+
/* @__PURE__ */ React33.createElement(Small, { color: "textDisabled" }, label)
|
|
3157
3196
|
);
|
|
3158
3197
|
}
|
|
3159
3198
|
|
|
3160
3199
|
// src/components/Breadcrumbs.tsx
|
|
3161
3200
|
import { forwardRef as forwardRef14 } from "react";
|
|
3162
|
-
import
|
|
3201
|
+
import React34 from "react";
|
|
3163
3202
|
var BreadcrumbText = forwardRef14(function BreadcrumbText2({ children, className, onClick, ...props }, ref) {
|
|
3164
|
-
return /* @__PURE__ */
|
|
3203
|
+
return /* @__PURE__ */ React34.createElement(
|
|
3165
3204
|
Text,
|
|
3166
3205
|
{
|
|
3167
3206
|
...props,
|
|
@@ -3181,7 +3220,7 @@ var slashStyle = {
|
|
|
3181
3220
|
margin: "0 3px"
|
|
3182
3221
|
};
|
|
3183
3222
|
var BreadcrumbSlash = () => {
|
|
3184
|
-
return /* @__PURE__ */
|
|
3223
|
+
return /* @__PURE__ */ React34.createElement(
|
|
3185
3224
|
"svg",
|
|
3186
3225
|
{
|
|
3187
3226
|
width: "7",
|
|
@@ -3192,7 +3231,7 @@ var BreadcrumbSlash = () => {
|
|
|
3192
3231
|
opacity: 0.5,
|
|
3193
3232
|
style: slashStyle
|
|
3194
3233
|
},
|
|
3195
|
-
/* @__PURE__ */
|
|
3234
|
+
/* @__PURE__ */ React34.createElement(
|
|
3196
3235
|
"path",
|
|
3197
3236
|
{
|
|
3198
3237
|
d: "M1 16L6 1",
|
|
@@ -3206,16 +3245,16 @@ var BreadcrumbSlash = () => {
|
|
|
3206
3245
|
};
|
|
3207
3246
|
|
|
3208
3247
|
// src/components/Checkbox.tsx
|
|
3209
|
-
import * as
|
|
3248
|
+
import * as React35 from "react";
|
|
3210
3249
|
var colorSchemeStyles = {
|
|
3211
3250
|
normal: "text-text-subtle",
|
|
3212
3251
|
primary: "text-primary",
|
|
3213
3252
|
secondary: "text-secondary"
|
|
3214
3253
|
};
|
|
3215
|
-
var Checkbox =
|
|
3216
|
-
|
|
3254
|
+
var Checkbox = React35.memo(
|
|
3255
|
+
React35.forwardRef(function Checkbox2({ className, style: style2, colorScheme = "secondary", ...props }, ref) {
|
|
3217
3256
|
const { fieldId: id } = useLabel({ fieldId: props.id });
|
|
3218
|
-
return /* @__PURE__ */
|
|
3257
|
+
return /* @__PURE__ */ React35.createElement(
|
|
3219
3258
|
"div",
|
|
3220
3259
|
{
|
|
3221
3260
|
className: cx(
|
|
@@ -3225,7 +3264,7 @@ var Checkbox = React34.memo(
|
|
|
3225
3264
|
),
|
|
3226
3265
|
style: style2
|
|
3227
3266
|
},
|
|
3228
|
-
/* @__PURE__ */
|
|
3267
|
+
/* @__PURE__ */ React35.createElement(
|
|
3229
3268
|
"input",
|
|
3230
3269
|
{
|
|
3231
3270
|
ref,
|
|
@@ -3254,7 +3293,7 @@ var Checkbox = React34.memo(
|
|
|
3254
3293
|
id
|
|
3255
3294
|
}
|
|
3256
3295
|
),
|
|
3257
|
-
/* @__PURE__ */
|
|
3296
|
+
/* @__PURE__ */ React35.createElement(
|
|
3258
3297
|
"svg",
|
|
3259
3298
|
{
|
|
3260
3299
|
className: `
|
|
@@ -3274,7 +3313,7 @@ var Checkbox = React34.memo(
|
|
|
3274
3313
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3275
3314
|
"aria-hidden": "true"
|
|
3276
3315
|
},
|
|
3277
|
-
/* @__PURE__ */
|
|
3316
|
+
/* @__PURE__ */ React35.createElement(
|
|
3278
3317
|
"path",
|
|
3279
3318
|
{
|
|
3280
3319
|
d: "M3 6L4.5 7.5L8 4",
|
|
@@ -3290,10 +3329,10 @@ var Checkbox = React34.memo(
|
|
|
3290
3329
|
|
|
3291
3330
|
// src/components/Chip.tsx
|
|
3292
3331
|
import { Cross1Icon, PlusIcon } from "@noya-app/noya-icons";
|
|
3293
|
-
import
|
|
3332
|
+
import React37, { forwardRef as forwardRef16, memo as memo13 } from "react";
|
|
3294
3333
|
|
|
3295
3334
|
// src/hooks/useHover.ts
|
|
3296
|
-
import * as
|
|
3335
|
+
import * as React36 from "react";
|
|
3297
3336
|
var globalIgnoreEmulatedMouseEvents = false;
|
|
3298
3337
|
var hoverCount = 0;
|
|
3299
3338
|
function setGlobalIgnoreEmulatedMouseEvents() {
|
|
@@ -3323,13 +3362,13 @@ function setupGlobalTouchEvents() {
|
|
|
3323
3362
|
}
|
|
3324
3363
|
function useHover(props = {}) {
|
|
3325
3364
|
const { onHoverStart, onHoverChange, onHoverEnd, isDisabled } = props;
|
|
3326
|
-
const [isHovered, setHovered] =
|
|
3327
|
-
const state =
|
|
3365
|
+
const [isHovered, setHovered] = React36.useState(false);
|
|
3366
|
+
const state = React36.useRef({
|
|
3328
3367
|
isHovered: false,
|
|
3329
3368
|
ignoreEmulatedMouseEvents: false
|
|
3330
3369
|
}).current;
|
|
3331
|
-
|
|
3332
|
-
const hoverProps =
|
|
3370
|
+
React36.useEffect(setupGlobalTouchEvents, []);
|
|
3371
|
+
const hoverProps = React36.useMemo(
|
|
3333
3372
|
function getHoverProps() {
|
|
3334
3373
|
function triggerHoverStart(event, pointerType) {
|
|
3335
3374
|
if (isDisabled || pointerType === "touch" || state.isHovered) {
|
|
@@ -3438,7 +3477,7 @@ var ICON_SIZE_STYLES = {
|
|
|
3438
3477
|
delete: "mr-[-2px] scale-[0.60]"
|
|
3439
3478
|
}
|
|
3440
3479
|
};
|
|
3441
|
-
var Chip =
|
|
3480
|
+
var Chip = memo13(
|
|
3442
3481
|
forwardRef16(function Chip2({
|
|
3443
3482
|
colorScheme,
|
|
3444
3483
|
children,
|
|
@@ -3475,7 +3514,7 @@ var Chip = memo12(
|
|
|
3475
3514
|
className
|
|
3476
3515
|
);
|
|
3477
3516
|
const color = colorScheme === "primary" ? cssVars.colors.primary : colorScheme === "secondary" ? cssVars.colors.secondary : cssVars.colors.text;
|
|
3478
|
-
return /* @__PURE__ */
|
|
3517
|
+
return /* @__PURE__ */ React37.createElement(
|
|
3479
3518
|
"span",
|
|
3480
3519
|
{
|
|
3481
3520
|
ref: forwardedRef,
|
|
@@ -3485,7 +3524,7 @@ var Chip = memo12(
|
|
|
3485
3524
|
tabIndex,
|
|
3486
3525
|
...rest
|
|
3487
3526
|
},
|
|
3488
|
-
addable && /* @__PURE__ */
|
|
3527
|
+
addable && /* @__PURE__ */ React37.createElement(
|
|
3489
3528
|
PlusIcon,
|
|
3490
3529
|
{
|
|
3491
3530
|
className: cx(ICON_BASE_STYLES, ICON_SIZE_STYLES[size2].add),
|
|
@@ -3497,7 +3536,7 @@ var Chip = memo12(
|
|
|
3497
3536
|
}
|
|
3498
3537
|
),
|
|
3499
3538
|
children,
|
|
3500
|
-
deletable && /* @__PURE__ */
|
|
3539
|
+
deletable && /* @__PURE__ */ React37.createElement(
|
|
3501
3540
|
Cross1Icon,
|
|
3502
3541
|
{
|
|
3503
3542
|
className: cx(ICON_BASE_STYLES, ICON_SIZE_STYLES[size2].delete),
|
|
@@ -3514,10 +3553,10 @@ var Chip = memo12(
|
|
|
3514
3553
|
);
|
|
3515
3554
|
|
|
3516
3555
|
// src/components/Collection.tsx
|
|
3517
|
-
import
|
|
3556
|
+
import React47 from "react";
|
|
3518
3557
|
|
|
3519
3558
|
// src/components/Grid.tsx
|
|
3520
|
-
import
|
|
3559
|
+
import React42, { useImperativeHandle as useImperativeHandle3, useRef as useRef16, useState as useState20 } from "react";
|
|
3521
3560
|
|
|
3522
3561
|
// src/utils/selection.ts
|
|
3523
3562
|
function updateSelection(allIds, selectedIds, clickedId, event) {
|
|
@@ -3545,17 +3584,17 @@ function updateSelection(allIds, selectedIds, clickedId, event) {
|
|
|
3545
3584
|
}
|
|
3546
3585
|
|
|
3547
3586
|
// src/components/EditableText.tsx
|
|
3548
|
-
import
|
|
3587
|
+
import React38, {
|
|
3549
3588
|
forwardRef as forwardRef17,
|
|
3550
|
-
memo as
|
|
3589
|
+
memo as memo14,
|
|
3551
3590
|
useCallback as useCallback17,
|
|
3552
3591
|
useEffect as useEffect14,
|
|
3553
3592
|
useImperativeHandle as useImperativeHandle2,
|
|
3554
3593
|
useRef as useRef15,
|
|
3555
3594
|
useState as useState18
|
|
3556
3595
|
} from "react";
|
|
3557
|
-
var defaultRenderPreview = (props) => /* @__PURE__ */
|
|
3558
|
-
var EditableText =
|
|
3596
|
+
var defaultRenderPreview = (props) => /* @__PURE__ */ React38.createElement(BreadcrumbText, { ...props });
|
|
3597
|
+
var EditableText = memo14(
|
|
3559
3598
|
forwardRef17(function EditableText2({
|
|
3560
3599
|
value,
|
|
3561
3600
|
onChange,
|
|
@@ -3631,7 +3670,7 @@ var EditableText = memo13(
|
|
|
3631
3670
|
style: textStyle,
|
|
3632
3671
|
className: textClassName
|
|
3633
3672
|
});
|
|
3634
|
-
const input = /* @__PURE__ */
|
|
3673
|
+
const input = /* @__PURE__ */ React38.createElement("div", { className: "flex absolute inset-0 -mx-1.5 -my-1" }, /* @__PURE__ */ React38.createElement(InputField2.Root, { onFocusChange: setFocused }, /* @__PURE__ */ React38.createElement(
|
|
3635
3674
|
InputField2.Input,
|
|
3636
3675
|
{
|
|
3637
3676
|
ref: inputRef,
|
|
@@ -3671,27 +3710,27 @@ var EditableText = memo13(
|
|
|
3671
3710
|
}
|
|
3672
3711
|
}
|
|
3673
3712
|
)));
|
|
3674
|
-
return /* @__PURE__ */
|
|
3713
|
+
return /* @__PURE__ */ React38.createElement("div", { className: cx("flex relative", className), style: style2 }, preview, focused && !readOnly && input);
|
|
3675
3714
|
})
|
|
3676
3715
|
);
|
|
3677
3716
|
|
|
3678
3717
|
// src/components/GridView.tsx
|
|
3679
|
-
import
|
|
3680
|
-
createContext as
|
|
3718
|
+
import React41, {
|
|
3719
|
+
createContext as createContext7,
|
|
3681
3720
|
forwardRef as forwardRef18,
|
|
3682
|
-
memo as
|
|
3721
|
+
memo as memo16,
|
|
3683
3722
|
useCallback as useCallback20,
|
|
3684
|
-
useContext as
|
|
3723
|
+
useContext as useContext7,
|
|
3685
3724
|
useMemo as useMemo16
|
|
3686
3725
|
} from "react";
|
|
3687
3726
|
|
|
3688
3727
|
// src/components/ContextMenu.tsx
|
|
3689
3728
|
import { useKeyboardShortcuts as useKeyboardShortcuts2 } from "@noya-app/noya-keymap";
|
|
3690
3729
|
import * as RadixContextMenu from "@radix-ui/react-context-menu";
|
|
3691
|
-
import
|
|
3730
|
+
import React39, { useCallback as useCallback18, useMemo as useMemo15 } from "react";
|
|
3692
3731
|
var Components2 = {
|
|
3693
3732
|
Separator: RadixContextMenu.Separator,
|
|
3694
|
-
ItemText:
|
|
3733
|
+
ItemText: React39.Fragment,
|
|
3695
3734
|
Item: RadixContextMenu.Item,
|
|
3696
3735
|
CheckboxItem: RadixContextMenu.CheckboxItem,
|
|
3697
3736
|
ItemIndicator: RadixContextMenu.ItemIndicator,
|
|
@@ -3711,6 +3750,7 @@ function ContextMenuRoot({
|
|
|
3711
3750
|
() => shouldBindKeyboardShortcuts === false ? {} : getKeyboardShortcutsForMenuItems(items, onSelect),
|
|
3712
3751
|
[items, onSelect, shouldBindKeyboardShortcuts]
|
|
3713
3752
|
);
|
|
3753
|
+
const portalScopeId = usePortalScopeId();
|
|
3714
3754
|
useKeyboardShortcuts2(keymap);
|
|
3715
3755
|
const onPointerDown = useCallback18((event) => {
|
|
3716
3756
|
event.preventDefault();
|
|
@@ -3722,39 +3762,46 @@ function ContextMenuRoot({
|
|
|
3722
3762
|
},
|
|
3723
3763
|
[onSelect]
|
|
3724
3764
|
);
|
|
3725
|
-
return /* @__PURE__ */
|
|
3726
|
-
|
|
3765
|
+
return /* @__PURE__ */ React39.createElement(RadixContextMenu.Root, { onOpenChange }, /* @__PURE__ */ React39.createElement(RadixContextMenu.Trigger, { asChild: true, onPointerDown }, children), /* @__PURE__ */ React39.createElement(RadixContextMenu.Portal, null, /* @__PURE__ */ React39.createElement(
|
|
3766
|
+
RadixContextMenu.Content,
|
|
3727
3767
|
{
|
|
3728
|
-
|
|
3729
|
-
|
|
3730
|
-
|
|
3731
|
-
|
|
3732
|
-
|
|
3768
|
+
...portalScopeProps(portalScopeId),
|
|
3769
|
+
className: styles.contentStyle
|
|
3770
|
+
},
|
|
3771
|
+
/* @__PURE__ */ React39.createElement(
|
|
3772
|
+
MenuViewport,
|
|
3773
|
+
{
|
|
3774
|
+
items,
|
|
3775
|
+
Components: Components2,
|
|
3776
|
+
onSelect: handleSelectItem
|
|
3777
|
+
}
|
|
3778
|
+
)
|
|
3779
|
+
)));
|
|
3733
3780
|
}
|
|
3734
3781
|
var ContextMenu = memoGeneric(ContextMenuRoot);
|
|
3735
3782
|
|
|
3736
3783
|
// src/components/ScrollArea.tsx
|
|
3737
3784
|
import * as RadixScrollArea from "@radix-ui/react-scroll-area";
|
|
3738
|
-
import * as
|
|
3739
|
-
var ScrollArea =
|
|
3740
|
-
const [scrollElementRef, setScrollElementRef] =
|
|
3741
|
-
return /* @__PURE__ */
|
|
3785
|
+
import * as React40 from "react";
|
|
3786
|
+
var ScrollArea = React40.memo(function ScrollArea2({ children }) {
|
|
3787
|
+
const [scrollElementRef, setScrollElementRef] = React40.useState(null);
|
|
3788
|
+
return /* @__PURE__ */ React40.createElement("div", { className: "flex-1 min-h-0" }, /* @__PURE__ */ React40.createElement(RadixScrollArea.Root, { style: { width: "100%", height: "100%" } }, /* @__PURE__ */ React40.createElement(
|
|
3742
3789
|
RadixScrollArea.Viewport,
|
|
3743
3790
|
{
|
|
3744
3791
|
className: "w-full h-full [&>div]:block",
|
|
3745
|
-
ref:
|
|
3792
|
+
ref: React40.useCallback(
|
|
3746
3793
|
(ref) => setScrollElementRef(ref),
|
|
3747
3794
|
[]
|
|
3748
3795
|
)
|
|
3749
3796
|
},
|
|
3750
3797
|
typeof children === "function" ? scrollElementRef ? children(scrollElementRef) : null : children
|
|
3751
|
-
), /* @__PURE__ */
|
|
3798
|
+
), /* @__PURE__ */ React40.createElement(
|
|
3752
3799
|
RadixScrollArea.Scrollbar,
|
|
3753
3800
|
{
|
|
3754
3801
|
orientation: "vertical",
|
|
3755
3802
|
className: "scroll-component flex p-[3px] data-[orientation=vertical]:w-[10px]"
|
|
3756
3803
|
},
|
|
3757
|
-
/* @__PURE__ */
|
|
3804
|
+
/* @__PURE__ */ React40.createElement(RadixScrollArea.Thumb, { className: "scroll-component flex-1 rounded-[10px] bg-scrollbar" })
|
|
3758
3805
|
)));
|
|
3759
3806
|
});
|
|
3760
3807
|
|
|
@@ -3763,7 +3810,7 @@ var ItemTitle = ({
|
|
|
3763
3810
|
showBackground,
|
|
3764
3811
|
children
|
|
3765
3812
|
}) => {
|
|
3766
|
-
return /* @__PURE__ */
|
|
3813
|
+
return /* @__PURE__ */ React41.createElement(
|
|
3767
3814
|
"span",
|
|
3768
3815
|
{
|
|
3769
3816
|
className: cx(
|
|
@@ -3778,7 +3825,7 @@ var ItemDescription = ({
|
|
|
3778
3825
|
showBackground,
|
|
3779
3826
|
children
|
|
3780
3827
|
}) => {
|
|
3781
|
-
return /* @__PURE__ */
|
|
3828
|
+
return /* @__PURE__ */ React41.createElement(
|
|
3782
3829
|
"span",
|
|
3783
3830
|
{
|
|
3784
3831
|
className: cx(
|
|
@@ -3793,7 +3840,7 @@ var SectionTitle = ({
|
|
|
3793
3840
|
last = false,
|
|
3794
3841
|
children
|
|
3795
3842
|
}) => {
|
|
3796
|
-
return /* @__PURE__ */
|
|
3843
|
+
return /* @__PURE__ */ React41.createElement(
|
|
3797
3844
|
"span",
|
|
3798
3845
|
{
|
|
3799
3846
|
className: `font-sans text-heading3 font-medium user-select-none truncate ${last ? "text-text" : "text-text-muted"}`
|
|
@@ -3826,7 +3873,7 @@ var GridViewItem = forwardRefGeneric(function GridViewItem2({
|
|
|
3826
3873
|
const { hoverProps } = useHover({
|
|
3827
3874
|
onHoverChange
|
|
3828
3875
|
});
|
|
3829
|
-
const { textPosition, bordered, disabled } =
|
|
3876
|
+
const { textPosition, bordered, disabled } = useContext7(GridViewContext);
|
|
3830
3877
|
const handleClick = useCallback20(
|
|
3831
3878
|
(event) => {
|
|
3832
3879
|
event.stopPropagation();
|
|
@@ -3849,7 +3896,7 @@ var GridViewItem = forwardRefGeneric(function GridViewItem2({
|
|
|
3849
3896
|
},
|
|
3850
3897
|
[onSelect, onKeyDown]
|
|
3851
3898
|
);
|
|
3852
|
-
let element = /* @__PURE__ */
|
|
3899
|
+
let element = /* @__PURE__ */ React41.createElement(
|
|
3853
3900
|
"div",
|
|
3854
3901
|
{
|
|
3855
3902
|
...props,
|
|
@@ -3872,7 +3919,7 @@ var GridViewItem = forwardRefGeneric(function GridViewItem2({
|
|
|
3872
3919
|
onDoubleClick,
|
|
3873
3920
|
onContextMenu
|
|
3874
3921
|
},
|
|
3875
|
-
/* @__PURE__ */
|
|
3922
|
+
/* @__PURE__ */ React41.createElement(
|
|
3876
3923
|
"div",
|
|
3877
3924
|
{
|
|
3878
3925
|
className: cx(
|
|
@@ -3883,13 +3930,13 @@ var GridViewItem = forwardRefGeneric(function GridViewItem2({
|
|
|
3883
3930
|
},
|
|
3884
3931
|
children
|
|
3885
3932
|
),
|
|
3886
|
-
textPosition === "below" && /* @__PURE__ */
|
|
3887
|
-
textPosition === "overlay" && hovered && (title || subtitle) && /* @__PURE__ */
|
|
3888
|
-
action && /* @__PURE__ */
|
|
3889
|
-
loading && /* @__PURE__ */
|
|
3933
|
+
textPosition === "below" && /* @__PURE__ */ React41.createElement(React41.Fragment, null, /* @__PURE__ */ React41.createElement(Spacer.Vertical, { size: 8 }), /* @__PURE__ */ React41.createElement(ItemTitle, null, title || " "), /* @__PURE__ */ React41.createElement(ItemDescription, null, subtitle || " ")),
|
|
3934
|
+
textPosition === "overlay" && hovered && (title || subtitle) && /* @__PURE__ */ React41.createElement("div", { className: "absolute inset-0 flex flex-col justify-end items-start p-1 pointer-events-none truncate gap-0.5" }, title && /* @__PURE__ */ React41.createElement(ItemTitle, { showBackground: true }, title), subtitle && /* @__PURE__ */ React41.createElement(ItemDescription, { showBackground: true }, subtitle)),
|
|
3935
|
+
action && /* @__PURE__ */ React41.createElement("div", { className: "absolute top-[7px] right-[7px] flex flex-col justify-end items-start p-1 truncate gap-0.5" }, action),
|
|
3936
|
+
loading && /* @__PURE__ */ React41.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__ */ React41.createElement(ActivityIndicator, { opacity: 0.5, size: 13 }))
|
|
3890
3937
|
);
|
|
3891
3938
|
if (menuItems && onSelectMenuItem) {
|
|
3892
|
-
element = /* @__PURE__ */
|
|
3939
|
+
element = /* @__PURE__ */ React41.createElement(
|
|
3893
3940
|
ContextMenu,
|
|
3894
3941
|
{
|
|
3895
3942
|
items: menuItems,
|
|
@@ -3900,17 +3947,17 @@ var GridViewItem = forwardRefGeneric(function GridViewItem2({
|
|
|
3900
3947
|
);
|
|
3901
3948
|
}
|
|
3902
3949
|
if (textPosition === "toolip") {
|
|
3903
|
-
element = /* @__PURE__ */
|
|
3950
|
+
element = /* @__PURE__ */ React41.createElement(
|
|
3904
3951
|
Tooltip,
|
|
3905
3952
|
{
|
|
3906
|
-
content: /* @__PURE__ */
|
|
3953
|
+
content: /* @__PURE__ */ React41.createElement("div", { className: "flex flex-col gap-0.5" }, /* @__PURE__ */ React41.createElement(ItemTitle, null, title), /* @__PURE__ */ React41.createElement(ItemDescription, null, subtitle))
|
|
3907
3954
|
},
|
|
3908
3955
|
element
|
|
3909
3956
|
);
|
|
3910
3957
|
}
|
|
3911
3958
|
return element;
|
|
3912
3959
|
});
|
|
3913
|
-
var GridViewContext =
|
|
3960
|
+
var GridViewContext = createContext7({
|
|
3914
3961
|
minColumnWidth: "220px",
|
|
3915
3962
|
textPosition: "below",
|
|
3916
3963
|
bordered: false,
|
|
@@ -3958,8 +4005,8 @@ var GridViewRoot = forwardRef18(function GridViewRoot2({
|
|
|
3958
4005
|
categories: ["flex"]
|
|
3959
4006
|
});
|
|
3960
4007
|
}, [className, scrollable]);
|
|
3961
|
-
const content = /* @__PURE__ */
|
|
3962
|
-
return /* @__PURE__ */
|
|
4008
|
+
const content = /* @__PURE__ */ React41.createElement("div", { className: cx("p-3", contentClassName) }, children);
|
|
4009
|
+
return /* @__PURE__ */ React41.createElement(GridViewContext.Provider, { value: contextValue }, /* @__PURE__ */ React41.createElement(
|
|
3963
4010
|
"div",
|
|
3964
4011
|
{
|
|
3965
4012
|
onClick: handleClick,
|
|
@@ -3967,7 +4014,7 @@ var GridViewRoot = forwardRef18(function GridViewRoot2({
|
|
|
3967
4014
|
...props,
|
|
3968
4015
|
ref: forwardedRef
|
|
3969
4016
|
},
|
|
3970
|
-
scrollable ? /* @__PURE__ */
|
|
4017
|
+
scrollable ? /* @__PURE__ */ React41.createElement(ScrollArea, null, content) : content
|
|
3971
4018
|
));
|
|
3972
4019
|
});
|
|
3973
4020
|
function GridViewSection({
|
|
@@ -3975,13 +4022,13 @@ function GridViewSection({
|
|
|
3975
4022
|
className,
|
|
3976
4023
|
renderEmptyState
|
|
3977
4024
|
}) {
|
|
3978
|
-
const { minColumnWidth, gap } =
|
|
4025
|
+
const { minColumnWidth, gap } = useContext7(GridViewContext);
|
|
3979
4026
|
const styles3 = {
|
|
3980
4027
|
gridTemplateColumns: `repeat(auto-fill, minmax(${minColumnWidth}, 1fr))`,
|
|
3981
4028
|
gap: `${gap}px`
|
|
3982
4029
|
};
|
|
3983
|
-
const isEmpty =
|
|
3984
|
-
return isEmpty && renderEmptyState ? renderEmptyState() : /* @__PURE__ */
|
|
4030
|
+
const isEmpty = React41.Children.count(children) === 0;
|
|
4031
|
+
return isEmpty && renderEmptyState ? renderEmptyState() : /* @__PURE__ */ React41.createElement(
|
|
3985
4032
|
"div",
|
|
3986
4033
|
{
|
|
3987
4034
|
role: "presentation",
|
|
@@ -3993,17 +4040,17 @@ function GridViewSection({
|
|
|
3993
4040
|
}
|
|
3994
4041
|
function GridViewSectionHeader({ title }) {
|
|
3995
4042
|
const grouped = title.split("/");
|
|
3996
|
-
return /* @__PURE__ */
|
|
3997
|
-
grouped.map((title2, index) => /* @__PURE__ */
|
|
3998
|
-
/* @__PURE__ */
|
|
4043
|
+
return /* @__PURE__ */ React41.createElement("div", { className: "px-5" }, /* @__PURE__ */ React41.createElement(Spacer.Vertical, { size: 24 }), withSeparatorElements(
|
|
4044
|
+
grouped.map((title2, index) => /* @__PURE__ */ React41.createElement(SectionTitle, { last: index === grouped.length - 1 }, title2)),
|
|
4045
|
+
/* @__PURE__ */ React41.createElement(SectionTitle, null, " / ")
|
|
3999
4046
|
));
|
|
4000
4047
|
}
|
|
4001
4048
|
var GridView;
|
|
4002
4049
|
((GridView2) => {
|
|
4003
|
-
GridView2.Root =
|
|
4050
|
+
GridView2.Root = memo16(GridViewRoot);
|
|
4004
4051
|
GridView2.Item = memoGeneric(GridViewItem);
|
|
4005
|
-
GridView2.Section =
|
|
4006
|
-
GridView2.SectionHeader =
|
|
4052
|
+
GridView2.Section = memo16(GridViewSection);
|
|
4053
|
+
GridView2.SectionHeader = memo16(GridViewSectionHeader);
|
|
4007
4054
|
})(GridView || (GridView = {}));
|
|
4008
4055
|
|
|
4009
4056
|
// src/components/Grid.tsx
|
|
@@ -4110,7 +4157,7 @@ var Grid = memoGeneric(
|
|
|
4110
4157
|
onFilesDrop
|
|
4111
4158
|
);
|
|
4112
4159
|
const { minColumnWidth, gap } = getGridSize(size2);
|
|
4113
|
-
return /* @__PURE__ */
|
|
4160
|
+
return /* @__PURE__ */ React42.createElement(
|
|
4114
4161
|
GridView.Root,
|
|
4115
4162
|
{
|
|
4116
4163
|
role: "listbox",
|
|
@@ -4127,7 +4174,7 @@ var Grid = memoGeneric(
|
|
|
4127
4174
|
...dropTargetProps,
|
|
4128
4175
|
ref: fileDropTargetRef
|
|
4129
4176
|
},
|
|
4130
|
-
items.length > 0 ? /* @__PURE__ */
|
|
4177
|
+
items.length > 0 ? /* @__PURE__ */ React42.createElement(GridView.Section, null, items.map((item) => {
|
|
4131
4178
|
const id = getId(item);
|
|
4132
4179
|
const isDropdownOpen = dropdownOpenId === id;
|
|
4133
4180
|
const isHovered = testHoveredId === id || currentHoveredId === id || isDropdownOpen;
|
|
@@ -4146,7 +4193,7 @@ var Grid = memoGeneric(
|
|
|
4146
4193
|
handleSelect(id);
|
|
4147
4194
|
}
|
|
4148
4195
|
};
|
|
4149
|
-
const action = (isHovered || isSelected) && !isRenaming && (typeof renderAction === "function" ? renderAction({ item, selected: isSelected, onOpenChange }) : renderAction === "menu" && menuItems && /* @__PURE__ */
|
|
4196
|
+
const action = (isHovered || isSelected) && !isRenaming && (typeof renderAction === "function" ? renderAction({ item, selected: isSelected, onOpenChange }) : renderAction === "menu" && menuItems && /* @__PURE__ */ React42.createElement(
|
|
4150
4197
|
ActionMenu,
|
|
4151
4198
|
{
|
|
4152
4199
|
menuItems,
|
|
@@ -4155,7 +4202,7 @@ var Grid = memoGeneric(
|
|
|
4155
4202
|
onOpenChange
|
|
4156
4203
|
}
|
|
4157
4204
|
));
|
|
4158
|
-
return /* @__PURE__ */
|
|
4205
|
+
return /* @__PURE__ */ React42.createElement(
|
|
4159
4206
|
GridView.Item,
|
|
4160
4207
|
{
|
|
4161
4208
|
key: id,
|
|
@@ -4168,7 +4215,7 @@ var Grid = memoGeneric(
|
|
|
4168
4215
|
onHoverChange: (isHovering) => {
|
|
4169
4216
|
setHoveredId(isHovering ? id : void 0);
|
|
4170
4217
|
},
|
|
4171
|
-
title: /* @__PURE__ */
|
|
4218
|
+
title: /* @__PURE__ */ React42.createElement(
|
|
4172
4219
|
EditableText,
|
|
4173
4220
|
{
|
|
4174
4221
|
tabIndex: isRenaming ? void 0 : -1,
|
|
@@ -4185,7 +4232,7 @@ var Grid = memoGeneric(
|
|
|
4185
4232
|
},
|
|
4186
4233
|
textClassName: "bg-listview-editing-background max-h-input-height"
|
|
4187
4234
|
},
|
|
4188
|
-
(props2) => /* @__PURE__ */
|
|
4235
|
+
(props2) => /* @__PURE__ */ React42.createElement(
|
|
4189
4236
|
"span",
|
|
4190
4237
|
{
|
|
4191
4238
|
...props2,
|
|
@@ -4196,7 +4243,7 @@ var Grid = memoGeneric(
|
|
|
4196
4243
|
}
|
|
4197
4244
|
)
|
|
4198
4245
|
),
|
|
4199
|
-
subtitle: /* @__PURE__ */
|
|
4246
|
+
subtitle: /* @__PURE__ */ React42.createElement(
|
|
4200
4247
|
"span",
|
|
4201
4248
|
{
|
|
4202
4249
|
className: cx(
|
|
@@ -4230,7 +4277,7 @@ var Grid = memoGeneric(
|
|
|
4230
4277
|
}
|
|
4231
4278
|
}
|
|
4232
4279
|
},
|
|
4233
|
-
thumbnail && /* @__PURE__ */
|
|
4280
|
+
thumbnail && /* @__PURE__ */ React42.createElement(
|
|
4234
4281
|
"div",
|
|
4235
4282
|
{
|
|
4236
4283
|
className: cx(
|
|
@@ -4248,19 +4295,19 @@ var Grid = memoGeneric(
|
|
|
4248
4295
|
);
|
|
4249
4296
|
|
|
4250
4297
|
// src/components/List.tsx
|
|
4251
|
-
import
|
|
4298
|
+
import React46, { memo as memo19, useImperativeHandle as useImperativeHandle5, useRef as useRef19, useState as useState22 } from "react";
|
|
4252
4299
|
|
|
4253
4300
|
// src/components/ListView.tsx
|
|
4254
4301
|
import { range } from "@noya-app/noya-utils";
|
|
4255
4302
|
import { composeRefs as composeRefs2 } from "@radix-ui/react-compose-refs";
|
|
4256
|
-
import
|
|
4303
|
+
import React44, {
|
|
4257
4304
|
Children as Children3,
|
|
4258
|
-
createContext as
|
|
4305
|
+
createContext as createContext9,
|
|
4259
4306
|
forwardRef as forwardRef19,
|
|
4260
4307
|
isValidElement as isValidElement3,
|
|
4261
|
-
memo as
|
|
4308
|
+
memo as memo18,
|
|
4262
4309
|
useCallback as useCallback22,
|
|
4263
|
-
useContext as
|
|
4310
|
+
useContext as useContext9,
|
|
4264
4311
|
useImperativeHandle as useImperativeHandle4,
|
|
4265
4312
|
useLayoutEffect as useLayoutEffect5,
|
|
4266
4313
|
useMemo as useMemo18,
|
|
@@ -4308,8 +4355,8 @@ import {
|
|
|
4308
4355
|
useSortable,
|
|
4309
4356
|
verticalListSortingStrategy
|
|
4310
4357
|
} from "@dnd-kit/sortable";
|
|
4311
|
-
import * as
|
|
4312
|
-
import { memo as
|
|
4358
|
+
import * as React43 from "react";
|
|
4359
|
+
import { memo as memo17 } from "react";
|
|
4313
4360
|
import { createPortal as createPortal2 } from "react-dom";
|
|
4314
4361
|
var normalizeListTargetIndex = (index, position) => {
|
|
4315
4362
|
return position === "above" ? index : index + 1;
|
|
@@ -4322,7 +4369,7 @@ var defaultAcceptsDrop = (sourceIndex, targetIndex, position) => {
|
|
|
4322
4369
|
}
|
|
4323
4370
|
return true;
|
|
4324
4371
|
};
|
|
4325
|
-
var SortableItemContext =
|
|
4372
|
+
var SortableItemContext = React43.createContext({
|
|
4326
4373
|
keys: [],
|
|
4327
4374
|
acceptsDrop: defaultAcceptsDrop,
|
|
4328
4375
|
axis: "y",
|
|
@@ -4377,7 +4424,7 @@ function SortableItem({
|
|
|
4377
4424
|
setActivatorEvent,
|
|
4378
4425
|
axis,
|
|
4379
4426
|
getDropTargetParentIndex
|
|
4380
|
-
} =
|
|
4427
|
+
} = React43.useContext(SortableItemContext);
|
|
4381
4428
|
const sortable = useSortable({ id, disabled });
|
|
4382
4429
|
const { activatorEvent } = useDndContext();
|
|
4383
4430
|
const {
|
|
@@ -4398,7 +4445,7 @@ function SortableItem({
|
|
|
4398
4445
|
const eventY = activatorEvent?.clientY ?? 0;
|
|
4399
4446
|
const offsetLeft = eventX + position.x;
|
|
4400
4447
|
const offsetTop = eventY + position.y;
|
|
4401
|
-
const ref =
|
|
4448
|
+
const ref = React43.useCallback((node) => setNodeRef(node), [setNodeRef]);
|
|
4402
4449
|
const parentIndex = overIndex === -1 ? void 0 : getDropTargetParentIndex?.(overIndex);
|
|
4403
4450
|
const isValidParent = parentIndex === void 0 || parentIndex === -1 ? false : acceptsDrop2(activeIndex, parentIndex, "inside");
|
|
4404
4451
|
const overIdAcceptsDrop = overIndex === -1 ? void 0 : acceptsDrop2(activeIndex, overIndex, "inside");
|
|
@@ -4435,26 +4482,26 @@ function SortableRoot({
|
|
|
4435
4482
|
}
|
|
4436
4483
|
})
|
|
4437
4484
|
);
|
|
4438
|
-
const [activeIndex, setActiveIndex] =
|
|
4439
|
-
const activatorEvent =
|
|
4440
|
-
const [position, setPosition] =
|
|
4485
|
+
const [activeIndex, setActiveIndex] = React43.useState();
|
|
4486
|
+
const activatorEvent = React43.useRef(null);
|
|
4487
|
+
const [position, setPosition] = React43.useState({
|
|
4441
4488
|
x: 0,
|
|
4442
4489
|
y: 0
|
|
4443
4490
|
});
|
|
4444
|
-
const setActivatorEvent =
|
|
4491
|
+
const setActivatorEvent = React43.useCallback((event) => {
|
|
4445
4492
|
activatorEvent.current = event;
|
|
4446
4493
|
}, []);
|
|
4447
|
-
const handleDragStart =
|
|
4494
|
+
const handleDragStart = React43.useCallback(
|
|
4448
4495
|
(event) => {
|
|
4449
4496
|
const index = keys.findIndex((id) => id === event.active.id);
|
|
4450
4497
|
setActiveIndex(index);
|
|
4451
4498
|
},
|
|
4452
4499
|
[keys]
|
|
4453
4500
|
);
|
|
4454
|
-
const handleDragMove =
|
|
4501
|
+
const handleDragMove = React43.useCallback((event) => {
|
|
4455
4502
|
setPosition({ ...event.delta });
|
|
4456
4503
|
}, []);
|
|
4457
|
-
const handleDragEnd =
|
|
4504
|
+
const handleDragEnd = React43.useCallback(
|
|
4458
4505
|
(event) => {
|
|
4459
4506
|
const { active, over } = event;
|
|
4460
4507
|
setActiveIndex(void 0);
|
|
@@ -4481,14 +4528,14 @@ function SortableRoot({
|
|
|
4481
4528
|
},
|
|
4482
4529
|
[acceptsDrop2, axis, keys, onMoveItem, position.x, position.y]
|
|
4483
4530
|
);
|
|
4484
|
-
const [mounted, setMounted] =
|
|
4485
|
-
|
|
4531
|
+
const [mounted, setMounted] = React43.useState(false);
|
|
4532
|
+
React43.useEffect(() => {
|
|
4486
4533
|
setMounted(true);
|
|
4487
4534
|
}, []);
|
|
4488
|
-
return /* @__PURE__ */
|
|
4535
|
+
return /* @__PURE__ */ React43.createElement(
|
|
4489
4536
|
SortableItemContext.Provider,
|
|
4490
4537
|
{
|
|
4491
|
-
value:
|
|
4538
|
+
value: React43.useMemo(
|
|
4492
4539
|
() => ({
|
|
4493
4540
|
keys,
|
|
4494
4541
|
acceptsDrop: acceptsDrop2,
|
|
@@ -4507,7 +4554,7 @@ function SortableRoot({
|
|
|
4507
4554
|
]
|
|
4508
4555
|
)
|
|
4509
4556
|
},
|
|
4510
|
-
/* @__PURE__ */
|
|
4557
|
+
/* @__PURE__ */ React43.createElement(
|
|
4511
4558
|
DndContext,
|
|
4512
4559
|
{
|
|
4513
4560
|
sensors,
|
|
@@ -4516,7 +4563,7 @@ function SortableRoot({
|
|
|
4516
4563
|
onDragMove: handleDragMove,
|
|
4517
4564
|
onDragEnd: handleDragEnd
|
|
4518
4565
|
},
|
|
4519
|
-
/* @__PURE__ */
|
|
4566
|
+
/* @__PURE__ */ React43.createElement(
|
|
4520
4567
|
SortableContext,
|
|
4521
4568
|
{
|
|
4522
4569
|
items: keys,
|
|
@@ -4525,14 +4572,14 @@ function SortableRoot({
|
|
|
4525
4572
|
children
|
|
4526
4573
|
),
|
|
4527
4574
|
mounted && renderOverlay && createPortal2(
|
|
4528
|
-
/* @__PURE__ */
|
|
4575
|
+
/* @__PURE__ */ React43.createElement(DragOverlay, { dropAnimation: null }, activeIndex !== void 0 && activeIndex >= 0 && renderOverlay(activeIndex)),
|
|
4529
4576
|
document.body
|
|
4530
4577
|
)
|
|
4531
4578
|
)
|
|
4532
4579
|
);
|
|
4533
4580
|
}
|
|
4534
4581
|
var SortableSubcomponents = {
|
|
4535
|
-
Root:
|
|
4582
|
+
Root: memo17(SortableRoot),
|
|
4536
4583
|
Item: memoGeneric(SortableItem)
|
|
4537
4584
|
};
|
|
4538
4585
|
var SortableComponent = memoGeneric(function Sortable(props) {
|
|
@@ -4543,11 +4590,11 @@ var SortableComponent = memoGeneric(function Sortable(props) {
|
|
|
4543
4590
|
shouldRenderOverlay = true,
|
|
4544
4591
|
...rest
|
|
4545
4592
|
} = props;
|
|
4546
|
-
const keys =
|
|
4593
|
+
const keys = React43.useMemo(
|
|
4547
4594
|
() => items.map(keyExtractor),
|
|
4548
4595
|
[items, keyExtractor]
|
|
4549
4596
|
);
|
|
4550
|
-
const renderOverlay =
|
|
4597
|
+
const renderOverlay = React43.useCallback(
|
|
4551
4598
|
(index) => {
|
|
4552
4599
|
return renderItem(
|
|
4553
4600
|
items[index],
|
|
@@ -4567,14 +4614,14 @@ var SortableComponent = memoGeneric(function Sortable(props) {
|
|
|
4567
4614
|
},
|
|
4568
4615
|
[renderItem, items]
|
|
4569
4616
|
);
|
|
4570
|
-
return /* @__PURE__ */
|
|
4617
|
+
return /* @__PURE__ */ React43.createElement(
|
|
4571
4618
|
SortableSubcomponents.Root,
|
|
4572
4619
|
{
|
|
4573
4620
|
...rest,
|
|
4574
4621
|
keys,
|
|
4575
4622
|
renderOverlay: shouldRenderOverlay ? renderOverlay : void 0
|
|
4576
4623
|
},
|
|
4577
|
-
keys.map((key, index) => /* @__PURE__ */
|
|
4624
|
+
keys.map((key, index) => /* @__PURE__ */ React43.createElement(SortableSubcomponents.Item, { key, id: key }, (props2) => {
|
|
4578
4625
|
return renderItem(
|
|
4579
4626
|
items[index],
|
|
4580
4627
|
props2,
|
|
@@ -4588,11 +4635,11 @@ var Sortable2 = Object.assign(SortableComponent, SortableSubcomponents);
|
|
|
4588
4635
|
// src/components/ListView.tsx
|
|
4589
4636
|
var ROW_HEIGHT = 31;
|
|
4590
4637
|
var SECTION_HEADER_LABEL_HEIGHT = INPUT_HEIGHT;
|
|
4591
|
-
var ListViewDraggingContext =
|
|
4638
|
+
var ListViewDraggingContext = createContext9({
|
|
4592
4639
|
indentation: 12
|
|
4593
4640
|
});
|
|
4594
4641
|
ListViewDraggingContext.displayName = "ListViewDraggingContext";
|
|
4595
|
-
var ListRowContext =
|
|
4642
|
+
var ListRowContext = createContext9({
|
|
4596
4643
|
marginType: "none",
|
|
4597
4644
|
selectedPosition: "only",
|
|
4598
4645
|
sortable: false,
|
|
@@ -4610,7 +4657,7 @@ var ListViewRowTitle = ({
|
|
|
4610
4657
|
className,
|
|
4611
4658
|
children,
|
|
4612
4659
|
...props
|
|
4613
|
-
}) => /* @__PURE__ */
|
|
4660
|
+
}) => /* @__PURE__ */ React44.createElement(
|
|
4614
4661
|
"span",
|
|
4615
4662
|
{
|
|
4616
4663
|
className: cx(
|
|
@@ -4638,7 +4685,7 @@ function ListViewEditableRowTitle({
|
|
|
4638
4685
|
element.select();
|
|
4639
4686
|
}, 1);
|
|
4640
4687
|
}, [autoFocus]);
|
|
4641
|
-
return /* @__PURE__ */
|
|
4688
|
+
return /* @__PURE__ */ React44.createElement(
|
|
4642
4689
|
InputField2.Input,
|
|
4643
4690
|
{
|
|
4644
4691
|
ref: inputRef,
|
|
@@ -4677,7 +4724,7 @@ var RowContainer = forwardRef19(
|
|
|
4677
4724
|
"aria-selected": ariaSelected,
|
|
4678
4725
|
...props
|
|
4679
4726
|
}, ref) => {
|
|
4680
|
-
return /* @__PURE__ */
|
|
4727
|
+
return /* @__PURE__ */ React44.createElement(
|
|
4681
4728
|
"div",
|
|
4682
4729
|
{
|
|
4683
4730
|
ref,
|
|
@@ -4755,7 +4802,7 @@ var ListViewDragIndicatorElement = forwardRef19(
|
|
|
4755
4802
|
style: style2,
|
|
4756
4803
|
...props
|
|
4757
4804
|
}, ref) => {
|
|
4758
|
-
return /* @__PURE__ */
|
|
4805
|
+
return /* @__PURE__ */ React44.createElement(
|
|
4759
4806
|
"div",
|
|
4760
4807
|
{
|
|
4761
4808
|
ref,
|
|
@@ -4822,11 +4869,11 @@ var ListViewRow = forwardRefGeneric(function ListViewRow2({
|
|
|
4822
4869
|
divider,
|
|
4823
4870
|
gap: listGap,
|
|
4824
4871
|
colorScheme
|
|
4825
|
-
} =
|
|
4872
|
+
} = useContext9(ListRowContext);
|
|
4826
4873
|
const { hoverProps } = useHover({
|
|
4827
4874
|
onHoverChange
|
|
4828
4875
|
});
|
|
4829
|
-
const { indentation, isDragOverlay } =
|
|
4876
|
+
const { indentation, isDragOverlay } = useContext9(ListViewDraggingContext);
|
|
4830
4877
|
const handlePress = useCallback22(
|
|
4831
4878
|
(event) => {
|
|
4832
4879
|
event.preventDefault();
|
|
@@ -4856,7 +4903,7 @@ var ListViewRow = forwardRefGeneric(function ListViewRow2({
|
|
|
4856
4903
|
}, ref) => {
|
|
4857
4904
|
const Component = RowContainer;
|
|
4858
4905
|
const relativeDropPosition = testRelativeDropPosition ?? relativeDropPositionProp;
|
|
4859
|
-
const element = /* @__PURE__ */
|
|
4906
|
+
const element = /* @__PURE__ */ React44.createElement(
|
|
4860
4907
|
Component,
|
|
4861
4908
|
{
|
|
4862
4909
|
ref,
|
|
@@ -4890,7 +4937,7 @@ var ListViewRow = forwardRefGeneric(function ListViewRow2({
|
|
|
4890
4937
|
className,
|
|
4891
4938
|
$clickable: !!onPress
|
|
4892
4939
|
},
|
|
4893
|
-
relativeDropPosition && /* @__PURE__ */
|
|
4940
|
+
relativeDropPosition && /* @__PURE__ */ React44.createElement(
|
|
4894
4941
|
ListViewDragIndicatorElement,
|
|
4895
4942
|
{
|
|
4896
4943
|
key: relativeDropPosition,
|
|
@@ -4905,11 +4952,11 @@ var ListViewRow = forwardRefGeneric(function ListViewRow2({
|
|
|
4905
4952
|
}) : dragIndicatorStyle
|
|
4906
4953
|
}
|
|
4907
4954
|
),
|
|
4908
|
-
depth > 0 && /* @__PURE__ */
|
|
4955
|
+
depth > 0 && /* @__PURE__ */ React44.createElement(Spacer.Horizontal, { size: depth * indentation }),
|
|
4909
4956
|
children
|
|
4910
4957
|
);
|
|
4911
4958
|
if (menuItems && onSelectMenuItem) {
|
|
4912
|
-
return /* @__PURE__ */
|
|
4959
|
+
return /* @__PURE__ */ React44.createElement(
|
|
4913
4960
|
ContextMenu,
|
|
4914
4961
|
{
|
|
4915
4962
|
items: menuItems,
|
|
@@ -4922,23 +4969,23 @@ var ListViewRow = forwardRefGeneric(function ListViewRow2({
|
|
|
4922
4969
|
return element;
|
|
4923
4970
|
};
|
|
4924
4971
|
if (sortable && id) {
|
|
4925
|
-
return /* @__PURE__ */
|
|
4972
|
+
return /* @__PURE__ */ React44.createElement(Sortable2.Item, { id, disabled: overrideSortable === false }, ({ ref: sortableRef, ...sortableProps }) => renderContent(
|
|
4926
4973
|
sortableProps,
|
|
4927
4974
|
composeRefs2(sortableRef, forwardedRef)
|
|
4928
4975
|
));
|
|
4929
4976
|
}
|
|
4930
4977
|
return renderContent({}, forwardedRef);
|
|
4931
4978
|
});
|
|
4932
|
-
var RenderItemContext =
|
|
4979
|
+
var RenderItemContext = createContext9(
|
|
4933
4980
|
() => null
|
|
4934
4981
|
);
|
|
4935
4982
|
RenderItemContext.displayName = "RenderItemContext";
|
|
4936
|
-
var VirtualizedListRow =
|
|
4983
|
+
var VirtualizedListRow = memo18(function VirtualizedListRow2({
|
|
4937
4984
|
index,
|
|
4938
4985
|
style: style2
|
|
4939
4986
|
}) {
|
|
4940
|
-
const renderItem =
|
|
4941
|
-
return /* @__PURE__ */
|
|
4987
|
+
const renderItem = useContext9(RenderItemContext);
|
|
4988
|
+
return /* @__PURE__ */ React44.createElement("div", { key: index, style: style2 }, renderItem(index));
|
|
4942
4989
|
});
|
|
4943
4990
|
var VirtualizedListInner = forwardRefGeneric(function VirtualizedListInner2({
|
|
4944
4991
|
size: size2,
|
|
@@ -4969,7 +5016,7 @@ var VirtualizedListInner = forwardRefGeneric(function VirtualizedListInner2({
|
|
|
4969
5016
|
}),
|
|
4970
5017
|
[]
|
|
4971
5018
|
);
|
|
4972
|
-
return /* @__PURE__ */
|
|
5019
|
+
return /* @__PURE__ */ React44.createElement(RenderItemContext.Provider, { value: renderItem }, /* @__PURE__ */ React44.createElement(
|
|
4973
5020
|
WindowScroller,
|
|
4974
5021
|
{
|
|
4975
5022
|
scrollElement,
|
|
@@ -4980,7 +5027,7 @@ var VirtualizedListInner = forwardRefGeneric(function VirtualizedListInner2({
|
|
|
4980
5027
|
registerChild,
|
|
4981
5028
|
onChildScroll,
|
|
4982
5029
|
scrollTop
|
|
4983
|
-
}) => /* @__PURE__ */
|
|
5030
|
+
}) => /* @__PURE__ */ React44.createElement("div", { ref: registerChild }, /* @__PURE__ */ React44.createElement(
|
|
4984
5031
|
VariableSizeList,
|
|
4985
5032
|
{
|
|
4986
5033
|
ref: listRef,
|
|
@@ -5010,7 +5057,7 @@ var VirtualizedListInner = forwardRefGeneric(function VirtualizedListInner2({
|
|
|
5010
5057
|
)
|
|
5011
5058
|
));
|
|
5012
5059
|
});
|
|
5013
|
-
var VirtualizedList =
|
|
5060
|
+
var VirtualizedList = memo18(
|
|
5014
5061
|
VirtualizedListInner
|
|
5015
5062
|
);
|
|
5016
5063
|
var ListViewRootInner = forwardRefGeneric(function ListViewRootInner2({
|
|
@@ -5152,7 +5199,7 @@ var ListViewRootInner = forwardRefGeneric(function ListViewRootInner2({
|
|
|
5152
5199
|
[indentation]
|
|
5153
5200
|
);
|
|
5154
5201
|
const renderOverlay = useCallback22(
|
|
5155
|
-
(index) => /* @__PURE__ */
|
|
5202
|
+
(index) => /* @__PURE__ */ React44.createElement("div", { style: { opacity: 0.25 } }, /* @__PURE__ */ React44.createElement(ListViewDraggingContext.Provider, { value: draggingContextOverlayValue }, renderItem(data[index], index, { isDragOverlay: true }))),
|
|
5156
5203
|
[draggingContextOverlayValue, renderItem, data]
|
|
5157
5204
|
);
|
|
5158
5205
|
const renderWrappedChild = useCallback22(
|
|
@@ -5160,12 +5207,12 @@ var ListViewRootInner = forwardRefGeneric(function ListViewRootInner2({
|
|
|
5160
5207
|
const contextValue = getItemContextValue(index);
|
|
5161
5208
|
const current = renderChild(index);
|
|
5162
5209
|
if (!contextValue || !isValidElement3(current)) return null;
|
|
5163
|
-
return /* @__PURE__ */
|
|
5210
|
+
return /* @__PURE__ */ React44.createElement(ListRowContext.Provider, { key: current.key, value: contextValue }, current);
|
|
5164
5211
|
},
|
|
5165
5212
|
[getItemContextValue, renderChild]
|
|
5166
5213
|
);
|
|
5167
5214
|
const ids = useMemo18(() => data.map(keyExtractor), [keyExtractor, data]);
|
|
5168
|
-
const withSortable = (children) => sortable ? /* @__PURE__ */
|
|
5215
|
+
const withSortable = (children) => sortable ? /* @__PURE__ */ React44.createElement(
|
|
5169
5216
|
Sortable2.Root,
|
|
5170
5217
|
{
|
|
5171
5218
|
onMoveItem,
|
|
@@ -5176,7 +5223,7 @@ var ListViewRootInner = forwardRefGeneric(function ListViewRootInner2({
|
|
|
5176
5223
|
},
|
|
5177
5224
|
children
|
|
5178
5225
|
) : children;
|
|
5179
|
-
const withScrollable = (children) => scrollable ? /* @__PURE__ */
|
|
5226
|
+
const withScrollable = (children) => scrollable ? /* @__PURE__ */ React44.createElement(ScrollArea, null, children) : children(null);
|
|
5180
5227
|
const getItemHeight = useCallback22(
|
|
5181
5228
|
(index) => {
|
|
5182
5229
|
const child = getItemContextValue(index);
|
|
@@ -5191,7 +5238,7 @@ var ListViewRootInner = forwardRefGeneric(function ListViewRootInner2({
|
|
|
5191
5238
|
);
|
|
5192
5239
|
const draggingContextValue = useMemo18(() => ({ indentation }), [indentation]);
|
|
5193
5240
|
const gapStyle = useMemo18(() => ({ gap: `${gap}px` }), [gap]);
|
|
5194
|
-
return /* @__PURE__ */
|
|
5241
|
+
return /* @__PURE__ */ React44.createElement(ListViewDraggingContext.Provider, { value: draggingContextValue }, /* @__PURE__ */ React44.createElement(
|
|
5195
5242
|
"div",
|
|
5196
5243
|
{
|
|
5197
5244
|
id,
|
|
@@ -5220,7 +5267,7 @@ var ListViewRootInner = forwardRefGeneric(function ListViewRootInner2({
|
|
|
5220
5267
|
},
|
|
5221
5268
|
data.length === 0 && renderEmptyState ? renderEmptyState() : withScrollable(
|
|
5222
5269
|
(scrollElementRef) => withSortable(
|
|
5223
|
-
virtualized ? /* @__PURE__ */
|
|
5270
|
+
virtualized ? /* @__PURE__ */ React44.createElement(
|
|
5224
5271
|
VirtualizedList,
|
|
5225
5272
|
{
|
|
5226
5273
|
ref: forwardedRef,
|
|
@@ -5244,7 +5291,7 @@ var ChildrenListViewInner = forwardRef19(function ChildrenListViewInner2({ child
|
|
|
5244
5291
|
),
|
|
5245
5292
|
[children]
|
|
5246
5293
|
);
|
|
5247
|
-
return /* @__PURE__ */
|
|
5294
|
+
return /* @__PURE__ */ React44.createElement(
|
|
5248
5295
|
ListViewRoot,
|
|
5249
5296
|
{
|
|
5250
5297
|
ref: forwardedRef,
|
|
@@ -5258,19 +5305,19 @@ var ChildrenListViewInner = forwardRef19(function ChildrenListViewInner2({ child
|
|
|
5258
5305
|
}
|
|
5259
5306
|
);
|
|
5260
5307
|
});
|
|
5261
|
-
var ChildrenListView =
|
|
5308
|
+
var ChildrenListView = memo18(ChildrenListViewInner);
|
|
5262
5309
|
var SimpleListViewInner = forwardRefGeneric(function SimpleListViewInner2(props, forwardedRef) {
|
|
5263
5310
|
if ("children" in props) {
|
|
5264
|
-
return /* @__PURE__ */
|
|
5311
|
+
return /* @__PURE__ */ React44.createElement(ChildrenListView, { ref: forwardedRef, ...props });
|
|
5265
5312
|
} else {
|
|
5266
|
-
return /* @__PURE__ */
|
|
5313
|
+
return /* @__PURE__ */ React44.createElement(ListViewRoot, { ref: forwardedRef, ...props });
|
|
5267
5314
|
}
|
|
5268
5315
|
});
|
|
5269
5316
|
var SimpleListView = memoGeneric(SimpleListViewInner);
|
|
5270
5317
|
var ListView;
|
|
5271
5318
|
((ListView2) => {
|
|
5272
|
-
ListView2.RowTitle =
|
|
5273
|
-
ListView2.EditableRowTitle =
|
|
5319
|
+
ListView2.RowTitle = memo18(ListViewRowTitle);
|
|
5320
|
+
ListView2.EditableRowTitle = memo18(ListViewEditableRowTitle);
|
|
5274
5321
|
ListView2.Row = memoGeneric(ListViewRow);
|
|
5275
5322
|
ListView2.Root = SimpleListView;
|
|
5276
5323
|
ListView2.RowContext = ListRowContext;
|
|
@@ -5287,7 +5334,7 @@ var ListView;
|
|
|
5287
5334
|
})(ListView || (ListView = {}));
|
|
5288
5335
|
|
|
5289
5336
|
// src/components/TreeView.tsx
|
|
5290
|
-
import
|
|
5337
|
+
import React45, { useCallback as useCallback23, useContext as useContext10 } from "react";
|
|
5291
5338
|
var TreeRow = forwardRefGeneric(function TreeRow2({
|
|
5292
5339
|
icon,
|
|
5293
5340
|
expanded,
|
|
@@ -5296,7 +5343,7 @@ var TreeRow = forwardRefGeneric(function TreeRow2({
|
|
|
5296
5343
|
children,
|
|
5297
5344
|
...rest
|
|
5298
5345
|
}, forwardedRef) {
|
|
5299
|
-
const { expandable } =
|
|
5346
|
+
const { expandable } = useContext10(ListView.RowContext);
|
|
5300
5347
|
const handleClickChevron = useCallback23(
|
|
5301
5348
|
(event) => {
|
|
5302
5349
|
event.stopPropagation();
|
|
@@ -5304,7 +5351,7 @@ var TreeRow = forwardRefGeneric(function TreeRow2({
|
|
|
5304
5351
|
},
|
|
5305
5352
|
[onClickChevron]
|
|
5306
5353
|
);
|
|
5307
|
-
return /* @__PURE__ */
|
|
5354
|
+
return /* @__PURE__ */ React45.createElement(ListView.Row, { ref: forwardedRef, ...rest }, expandable && /* @__PURE__ */ React45.createElement(React45.Fragment, null, expanded === void 0 ? /* @__PURE__ */ React45.createElement(Spacer.Horizontal, { size: 19 }) : /* @__PURE__ */ React45.createElement(
|
|
5308
5355
|
IconButton,
|
|
5309
5356
|
{
|
|
5310
5357
|
className: chevronClassName,
|
|
@@ -5312,7 +5359,7 @@ var TreeRow = forwardRefGeneric(function TreeRow2({
|
|
|
5312
5359
|
onClick: handleClickChevron,
|
|
5313
5360
|
selected: rest.selected
|
|
5314
5361
|
}
|
|
5315
|
-
), /* @__PURE__ */
|
|
5362
|
+
), /* @__PURE__ */ React45.createElement(Spacer.Horizontal, { size: 6 })), icon && /* @__PURE__ */ React45.createElement(React45.Fragment, null, renderIcon(icon), /* @__PURE__ */ React45.createElement(Spacer.Horizontal, { size: 10 })), children);
|
|
5316
5363
|
});
|
|
5317
5364
|
var TreeView;
|
|
5318
5365
|
((TreeView2) => {
|
|
@@ -5404,7 +5451,7 @@ var List = memoGeneric(
|
|
|
5404
5451
|
setRenamingId(id);
|
|
5405
5452
|
}
|
|
5406
5453
|
}));
|
|
5407
|
-
return /* @__PURE__ */
|
|
5454
|
+
return /* @__PURE__ */ React46.createElement(
|
|
5408
5455
|
ViewComponent.Root,
|
|
5409
5456
|
{
|
|
5410
5457
|
variant: "bare",
|
|
@@ -5447,7 +5494,7 @@ var List = memoGeneric(
|
|
|
5447
5494
|
handleSelect(id);
|
|
5448
5495
|
}
|
|
5449
5496
|
};
|
|
5450
|
-
const action = (isHovered || isSelected) && !isRenaming && (typeof renderAction === "function" ? renderAction({ item, selected: isSelected, onOpenChange }) : renderAction === "menu" && menuItems && /* @__PURE__ */
|
|
5497
|
+
const action = (isHovered || isSelected) && !isRenaming && (typeof renderAction === "function" ? renderAction({ item, selected: isSelected, onOpenChange }) : renderAction === "menu" && menuItems && /* @__PURE__ */ React46.createElement(
|
|
5451
5498
|
ActionMenu,
|
|
5452
5499
|
{
|
|
5453
5500
|
menuItems,
|
|
@@ -5463,7 +5510,7 @@ var List = memoGeneric(
|
|
|
5463
5510
|
));
|
|
5464
5511
|
const end = action || detailPosition === "end" && renderDetail?.(item, isSelected);
|
|
5465
5512
|
const below = detailPosition === "below" && renderDetail?.(item, isSelected);
|
|
5466
|
-
return /* @__PURE__ */
|
|
5513
|
+
return /* @__PURE__ */ React46.createElement(
|
|
5467
5514
|
ViewComponent.Row,
|
|
5468
5515
|
{
|
|
5469
5516
|
id,
|
|
@@ -5511,12 +5558,12 @@ var List = memoGeneric(
|
|
|
5511
5558
|
},
|
|
5512
5559
|
dragIndicatorStyle
|
|
5513
5560
|
},
|
|
5514
|
-
/* @__PURE__ */
|
|
5561
|
+
/* @__PURE__ */ React46.createElement(
|
|
5515
5562
|
"div",
|
|
5516
5563
|
{
|
|
5517
5564
|
className: cx("flex flex-1 items-center px-2", rowGapMap[size2])
|
|
5518
5565
|
},
|
|
5519
|
-
thumbnail && /* @__PURE__ */
|
|
5566
|
+
thumbnail && /* @__PURE__ */ React46.createElement(
|
|
5520
5567
|
"div",
|
|
5521
5568
|
{
|
|
5522
5569
|
className: cx(
|
|
@@ -5529,7 +5576,7 @@ var List = memoGeneric(
|
|
|
5529
5576
|
},
|
|
5530
5577
|
thumbnail
|
|
5531
5578
|
),
|
|
5532
|
-
/* @__PURE__ */
|
|
5579
|
+
/* @__PURE__ */ React46.createElement("div", { className: "flex flex-col flex-1 w-0" }, /* @__PURE__ */ React46.createElement("div", { className: "flex items-center min-h-input-height flex-1 gap-2" }, /* @__PURE__ */ React46.createElement("div", { className: "flex-1 w-0 flex items-center", tabIndex: -1 }, isRenaming ? /* @__PURE__ */ React46.createElement(
|
|
5533
5580
|
ViewComponent.EditableRowTitle,
|
|
5534
5581
|
{
|
|
5535
5582
|
value: getName(item),
|
|
@@ -5544,7 +5591,7 @@ var List = memoGeneric(
|
|
|
5544
5591
|
e.stopPropagation();
|
|
5545
5592
|
}
|
|
5546
5593
|
}
|
|
5547
|
-
) : /* @__PURE__ */
|
|
5594
|
+
) : /* @__PURE__ */ React46.createElement(
|
|
5548
5595
|
ViewComponent.RowTitle,
|
|
5549
5596
|
{
|
|
5550
5597
|
className: cx(
|
|
@@ -5553,8 +5600,8 @@ var List = memoGeneric(
|
|
|
5553
5600
|
)
|
|
5554
5601
|
},
|
|
5555
5602
|
getName(item)
|
|
5556
|
-
)), end && detailPosition === "end" && /* @__PURE__ */
|
|
5557
|
-
end && detailPosition === "below" && /* @__PURE__ */
|
|
5603
|
+
)), end && detailPosition === "end" && /* @__PURE__ */ React46.createElement(DetailContainer, { selected: isSelected }, end)), below && /* @__PURE__ */ React46.createElement(DetailContainer, { selected: isSelected }, below)),
|
|
5604
|
+
end && detailPosition === "below" && /* @__PURE__ */ React46.createElement(DetailContainer, { selected: isSelected }, end)
|
|
5558
5605
|
)
|
|
5559
5606
|
);
|
|
5560
5607
|
}
|
|
@@ -5562,11 +5609,11 @@ var List = memoGeneric(
|
|
|
5562
5609
|
);
|
|
5563
5610
|
})
|
|
5564
5611
|
);
|
|
5565
|
-
var DetailContainer =
|
|
5612
|
+
var DetailContainer = memo19(function DetailContainer2({
|
|
5566
5613
|
children,
|
|
5567
5614
|
selected
|
|
5568
5615
|
}) {
|
|
5569
|
-
return /* @__PURE__ */
|
|
5616
|
+
return /* @__PURE__ */ React46.createElement(
|
|
5570
5617
|
"div",
|
|
5571
5618
|
{
|
|
5572
5619
|
className: cx("flex items-center gap-2", selected && "text-primary"),
|
|
@@ -5611,11 +5658,11 @@ var fontStyleMap = {
|
|
|
5611
5658
|
// src/components/Collection.tsx
|
|
5612
5659
|
var Collection = forwardRefGeneric(function Collection2(props, ref) {
|
|
5613
5660
|
const { viewType, ...rest } = props;
|
|
5614
|
-
return viewType === "grid" ? /* @__PURE__ */
|
|
5661
|
+
return viewType === "grid" ? /* @__PURE__ */ React47.createElement(Grid, { ref, ...rest }) : /* @__PURE__ */ React47.createElement(List, { ref, ...rest });
|
|
5615
5662
|
});
|
|
5616
5663
|
|
|
5617
5664
|
// src/components/ColorSwatch.tsx
|
|
5618
|
-
import
|
|
5665
|
+
import React48, { forwardRef as forwardRef20 } from "react";
|
|
5619
5666
|
var colorSwatchSizeMap = {
|
|
5620
5667
|
xsmall: 21,
|
|
5621
5668
|
small: 27,
|
|
@@ -5624,7 +5671,7 @@ var colorSwatchSizeMap = {
|
|
|
5624
5671
|
};
|
|
5625
5672
|
var ColorSwatch = forwardRef20(function ColorSwatch2({ color, size: size2 = "small", checked, style: style2, ...props }, ref) {
|
|
5626
5673
|
const sizePx = colorSwatchSizeMap[size2];
|
|
5627
|
-
return /* @__PURE__ */
|
|
5674
|
+
return /* @__PURE__ */ React48.createElement(
|
|
5628
5675
|
"button",
|
|
5629
5676
|
{
|
|
5630
5677
|
...props,
|
|
@@ -5645,7 +5692,7 @@ var ColorSwatch = forwardRef20(function ColorSwatch2({ color, size: size2 = "sma
|
|
|
5645
5692
|
|
|
5646
5693
|
// src/components/ColorSwatchControl.tsx
|
|
5647
5694
|
import * as ToggleGroupPrimitive from "@radix-ui/react-toggle-group";
|
|
5648
|
-
import
|
|
5695
|
+
import React49, { useMemo as useMemo19 } from "react";
|
|
5649
5696
|
function ColorSwatchControl(props) {
|
|
5650
5697
|
const {
|
|
5651
5698
|
options,
|
|
@@ -5668,8 +5715,8 @@ function ColorSwatchControl(props) {
|
|
|
5668
5715
|
...style2
|
|
5669
5716
|
};
|
|
5670
5717
|
}, [size2, style2]);
|
|
5671
|
-
const content = /* @__PURE__ */
|
|
5672
|
-
const item = /* @__PURE__ */
|
|
5718
|
+
const content = /* @__PURE__ */ React49.createElement("div", { className, id, style: styles3 }, options.map((option) => {
|
|
5719
|
+
const item = /* @__PURE__ */ React49.createElement(
|
|
5673
5720
|
ColorSwatch,
|
|
5674
5721
|
{
|
|
5675
5722
|
key: option,
|
|
@@ -5682,23 +5729,25 @@ function ColorSwatchControl(props) {
|
|
|
5682
5729
|
checked: value === option
|
|
5683
5730
|
}
|
|
5684
5731
|
);
|
|
5685
|
-
return
|
|
5732
|
+
return /* @__PURE__ */ React49.createElement(
|
|
5686
5733
|
ToggleGroupPrimitive.Item,
|
|
5687
5734
|
{
|
|
5688
5735
|
asChild: true,
|
|
5689
5736
|
value: option,
|
|
5690
|
-
key: option
|
|
5737
|
+
key: option,
|
|
5738
|
+
disabled: readOnly
|
|
5691
5739
|
},
|
|
5692
5740
|
item
|
|
5693
5741
|
);
|
|
5694
5742
|
}));
|
|
5695
|
-
return
|
|
5743
|
+
return /* @__PURE__ */ React49.createElement(
|
|
5696
5744
|
ToggleGroupPrimitive.Root,
|
|
5697
5745
|
{
|
|
5698
5746
|
type: "single",
|
|
5699
5747
|
value,
|
|
5700
5748
|
onValueChange,
|
|
5701
|
-
className: "w-full"
|
|
5749
|
+
className: "w-full",
|
|
5750
|
+
disabled: readOnly
|
|
5702
5751
|
},
|
|
5703
5752
|
content
|
|
5704
5753
|
);
|
|
@@ -5706,7 +5755,7 @@ function ColorSwatchControl(props) {
|
|
|
5706
5755
|
|
|
5707
5756
|
// src/components/Combobox.tsx
|
|
5708
5757
|
import { DropdownChevronIcon as DropdownChevronIcon2 } from "@noya-app/noya-icons";
|
|
5709
|
-
import
|
|
5758
|
+
import React51, {
|
|
5710
5759
|
useCallback as useCallback24,
|
|
5711
5760
|
useEffect as useEffect16,
|
|
5712
5761
|
useImperativeHandle as useImperativeHandle6,
|
|
@@ -6048,7 +6097,7 @@ function useComboboxState(state) {
|
|
|
6048
6097
|
|
|
6049
6098
|
// src/components/ComboboxMenu.tsx
|
|
6050
6099
|
import { CheckIcon as CheckIcon2 } from "@noya-app/noya-icons";
|
|
6051
|
-
import
|
|
6100
|
+
import React50 from "react";
|
|
6052
6101
|
var ComboboxMenu = memoGeneric(
|
|
6053
6102
|
forwardRefGeneric(function ComboboxMenu2({
|
|
6054
6103
|
items,
|
|
@@ -6060,7 +6109,7 @@ var ComboboxMenu = memoGeneric(
|
|
|
6060
6109
|
indented,
|
|
6061
6110
|
iconPosition = "right"
|
|
6062
6111
|
}, forwardedRef) {
|
|
6063
|
-
return /* @__PURE__ */
|
|
6112
|
+
return /* @__PURE__ */ React50.createElement(
|
|
6064
6113
|
ListView.Root,
|
|
6065
6114
|
{
|
|
6066
6115
|
ref: forwardedRef,
|
|
@@ -6076,7 +6125,7 @@ var ComboboxMenu = memoGeneric(
|
|
|
6076
6125
|
style: style2,
|
|
6077
6126
|
renderItem: (item, i) => {
|
|
6078
6127
|
if (item.type === "sectionHeader") {
|
|
6079
|
-
return /* @__PURE__ */
|
|
6128
|
+
return /* @__PURE__ */ React50.createElement(ListView.Row, { key: item.id, isSectionHeader: true }, indented && /* @__PURE__ */ React50.createElement(
|
|
6080
6129
|
Spacer.Horizontal,
|
|
6081
6130
|
{
|
|
6082
6131
|
size: CHECKBOX_WIDTH - CHECKBOX_RIGHT_INSET + CHECKBOX_INDENT_WIDTH
|
|
@@ -6087,7 +6136,7 @@ var ComboboxMenu = memoGeneric(
|
|
|
6087
6136
|
item: typeof item.title === "string" ? item.title : item.value,
|
|
6088
6137
|
itemScore: item
|
|
6089
6138
|
});
|
|
6090
|
-
return /* @__PURE__ */
|
|
6139
|
+
return /* @__PURE__ */ React50.createElement(
|
|
6091
6140
|
ListView.Row,
|
|
6092
6141
|
{
|
|
6093
6142
|
key: item.value,
|
|
@@ -6100,12 +6149,12 @@ var ComboboxMenu = memoGeneric(
|
|
|
6100
6149
|
}
|
|
6101
6150
|
}
|
|
6102
6151
|
},
|
|
6103
|
-
/* @__PURE__ */
|
|
6152
|
+
/* @__PURE__ */ React50.createElement("div", { className: "flex flex-1 min-w-0 items-center" }, indented && /* @__PURE__ */ React50.createElement(Spacer.Horizontal, { size: CHECKBOX_INDENT_WIDTH }), item.checked ? /* @__PURE__ */ React50.createElement("div", { ...styles.itemIndicator }, /* @__PURE__ */ React50.createElement(CheckIcon2, null)) : indented ? /* @__PURE__ */ React50.createElement(
|
|
6104
6153
|
Spacer.Horizontal,
|
|
6105
6154
|
{
|
|
6106
6155
|
size: CHECKBOX_WIDTH - CHECKBOX_RIGHT_INSET
|
|
6107
6156
|
}
|
|
6108
|
-
) : null, iconPosition === "left" && item.icon && /* @__PURE__ */
|
|
6157
|
+
) : null, iconPosition === "left" && item.icon && /* @__PURE__ */ React50.createElement(React50.Fragment, null, renderIcon(item.icon), /* @__PURE__ */ React50.createElement(Spacer.Horizontal, { size: 8 })), tokens.map((token, j) => /* @__PURE__ */ React50.createElement(
|
|
6109
6158
|
"span",
|
|
6110
6159
|
{
|
|
6111
6160
|
key: `${item.value}-token-${j}`,
|
|
@@ -6116,7 +6165,7 @@ var ComboboxMenu = memoGeneric(
|
|
|
6116
6165
|
},
|
|
6117
6166
|
token.text
|
|
6118
6167
|
))),
|
|
6119
|
-
(item.shortcut || item.icon && iconPosition === "right") && /* @__PURE__ */
|
|
6168
|
+
(item.shortcut || item.icon && iconPosition === "right") && /* @__PURE__ */ React50.createElement(React50.Fragment, null, item.shortcut ? /* @__PURE__ */ React50.createElement(KeyboardShortcut, { shortcut: item.shortcut }) : item.icon && renderIcon(item.icon))
|
|
6120
6169
|
);
|
|
6121
6170
|
}
|
|
6122
6171
|
}
|
|
@@ -6438,19 +6487,19 @@ var Combobox = memoGeneric(
|
|
|
6438
6487
|
const hasCheckedItems = items.some(
|
|
6439
6488
|
(item) => isSelectableMenuItem(item) && item.checked
|
|
6440
6489
|
);
|
|
6441
|
-
return /* @__PURE__ */
|
|
6490
|
+
return /* @__PURE__ */ React51.createElement(
|
|
6442
6491
|
InputField2.Root,
|
|
6443
6492
|
{
|
|
6444
6493
|
id,
|
|
6445
6494
|
size: size2,
|
|
6446
6495
|
sideOffset: 6,
|
|
6447
|
-
end: /* @__PURE__ */
|
|
6496
|
+
end: /* @__PURE__ */ React51.createElement(React51.Fragment, null, loading && /* @__PURE__ */ React51.createElement("div", { className: "pr-1.5" }, /* @__PURE__ */ React51.createElement(ActivityIndicator, null)), !readOnly && /* @__PURE__ */ React51.createElement(
|
|
6448
6497
|
InputField2.Button,
|
|
6449
6498
|
{
|
|
6450
6499
|
variant: "floating",
|
|
6451
6500
|
onClick: handleChevronClick
|
|
6452
6501
|
},
|
|
6453
|
-
/* @__PURE__ */
|
|
6502
|
+
/* @__PURE__ */ React51.createElement(
|
|
6454
6503
|
DropdownChevronIcon2,
|
|
6455
6504
|
{
|
|
6456
6505
|
className: cx(
|
|
@@ -6469,7 +6518,7 @@ var Combobox = memoGeneric(
|
|
|
6469
6518
|
ListView.rowHeight * 10.5
|
|
6470
6519
|
);
|
|
6471
6520
|
const listSize = { width, height };
|
|
6472
|
-
return /* @__PURE__ */
|
|
6521
|
+
return /* @__PURE__ */ React51.createElement(
|
|
6473
6522
|
"div",
|
|
6474
6523
|
{
|
|
6475
6524
|
className: cx(
|
|
@@ -6477,7 +6526,7 @@ var Combobox = memoGeneric(
|
|
|
6477
6526
|
shouldShowMenu && !readOnly ? "flex" : "hidden"
|
|
6478
6527
|
)
|
|
6479
6528
|
},
|
|
6480
|
-
filteredItems.length > 0 && !loading ? /* @__PURE__ */
|
|
6529
|
+
filteredItems.length > 0 && !loading ? /* @__PURE__ */ React51.createElement(
|
|
6481
6530
|
ComboboxMenu,
|
|
6482
6531
|
{
|
|
6483
6532
|
ref: listRef,
|
|
@@ -6491,11 +6540,11 @@ var Combobox = memoGeneric(
|
|
|
6491
6540
|
},
|
|
6492
6541
|
indented: hasCheckedItems
|
|
6493
6542
|
}
|
|
6494
|
-
) : /* @__PURE__ */
|
|
6543
|
+
) : /* @__PURE__ */ React51.createElement("div", { className: "flex flex-col h-[50px] p-5 items-center justify-center" }, /* @__PURE__ */ React51.createElement(Small, { className: "text-text-disabled" }, loading ? "Loading..." : "No results"))
|
|
6495
6544
|
);
|
|
6496
6545
|
}
|
|
6497
6546
|
},
|
|
6498
|
-
/* @__PURE__ */
|
|
6547
|
+
/* @__PURE__ */ React51.createElement(
|
|
6499
6548
|
InputField2.Input,
|
|
6500
6549
|
{
|
|
6501
6550
|
ref,
|
|
@@ -6520,7 +6569,7 @@ var Combobox = memoGeneric(
|
|
|
6520
6569
|
...readOnly ? { readOnly: true } : {}
|
|
6521
6570
|
}
|
|
6522
6571
|
),
|
|
6523
|
-
filter && typeaheadValue && typeaheadValue.toLowerCase().startsWith(filter.toLowerCase()) && /* @__PURE__ */
|
|
6572
|
+
filter && typeaheadValue && typeaheadValue.toLowerCase().startsWith(filter.toLowerCase()) && /* @__PURE__ */ React51.createElement(
|
|
6524
6573
|
InputField2.Typeahead,
|
|
6525
6574
|
{
|
|
6526
6575
|
value: typeaheadValue,
|
|
@@ -6534,11 +6583,11 @@ var Combobox = memoGeneric(
|
|
|
6534
6583
|
);
|
|
6535
6584
|
|
|
6536
6585
|
// src/components/CommandPalette.tsx
|
|
6537
|
-
import
|
|
6586
|
+
import React54, { memo as memo21 } from "react";
|
|
6538
6587
|
|
|
6539
6588
|
// src/components/SearchCompletionMenu.tsx
|
|
6540
6589
|
import { getCurrentPlatform as getCurrentPlatform2, handleKeyboardEvent } from "@noya-app/noya-keymap";
|
|
6541
|
-
import
|
|
6590
|
+
import React53, {
|
|
6542
6591
|
forwardRef as forwardRef21,
|
|
6543
6592
|
useCallback as useCallback25,
|
|
6544
6593
|
useEffect as useEffect17,
|
|
@@ -6549,15 +6598,15 @@ import React52, {
|
|
|
6549
6598
|
} from "react";
|
|
6550
6599
|
|
|
6551
6600
|
// src/components/Divider.tsx
|
|
6552
|
-
import
|
|
6553
|
-
var Divider =
|
|
6601
|
+
import React52, { memo as memo20 } from "react";
|
|
6602
|
+
var Divider = memo20(function Divider2({
|
|
6554
6603
|
variant = "normal",
|
|
6555
6604
|
overflow = 0,
|
|
6556
6605
|
className,
|
|
6557
6606
|
style: style2,
|
|
6558
6607
|
...props
|
|
6559
6608
|
}) {
|
|
6560
|
-
return /* @__PURE__ */
|
|
6609
|
+
return /* @__PURE__ */ React52.createElement(
|
|
6561
6610
|
"div",
|
|
6562
6611
|
{
|
|
6563
6612
|
className: cx(
|
|
@@ -6577,14 +6626,14 @@ var Divider = memo19(function Divider2({
|
|
|
6577
6626
|
}
|
|
6578
6627
|
);
|
|
6579
6628
|
});
|
|
6580
|
-
var DividerVertical =
|
|
6629
|
+
var DividerVertical = memo20(function DividerVertical2({
|
|
6581
6630
|
variant = "normal",
|
|
6582
6631
|
overflow = 0,
|
|
6583
6632
|
className,
|
|
6584
6633
|
style: style2,
|
|
6585
6634
|
...props
|
|
6586
6635
|
}) {
|
|
6587
|
-
return /* @__PURE__ */
|
|
6636
|
+
return /* @__PURE__ */ React52.createElement(
|
|
6588
6637
|
"div",
|
|
6589
6638
|
{
|
|
6590
6639
|
className: cx(`
|
|
@@ -6618,7 +6667,7 @@ var SearchCompletionMenu = forwardRef21(function SearchCompletionMenu2({
|
|
|
6618
6667
|
index: 0
|
|
6619
6668
|
});
|
|
6620
6669
|
const { index, search } = state;
|
|
6621
|
-
const listRef =
|
|
6670
|
+
const listRef = React53.useRef(null);
|
|
6622
6671
|
const hasCheckedItems = items.some((item) => item.checked);
|
|
6623
6672
|
useEffect17(() => {
|
|
6624
6673
|
listRef.current?.scrollToIndex(index);
|
|
@@ -6697,7 +6746,7 @@ var SearchCompletionMenu = forwardRef21(function SearchCompletionMenu2({
|
|
|
6697
6746
|
inputRef.current?.focus();
|
|
6698
6747
|
}
|
|
6699
6748
|
}));
|
|
6700
|
-
return /* @__PURE__ */
|
|
6749
|
+
return /* @__PURE__ */ React53.createElement("div", { ...elementSize, className: "flex flex-col overflow-hidden" }, /* @__PURE__ */ React53.createElement(InputField2.Root, { className: "flex flex-0" }, /* @__PURE__ */ React53.createElement(
|
|
6701
6750
|
InputField2.Input,
|
|
6702
6751
|
{
|
|
6703
6752
|
ref: inputRef,
|
|
@@ -6717,7 +6766,7 @@ var SearchCompletionMenu = forwardRef21(function SearchCompletionMenu2({
|
|
|
6717
6766
|
onChange: setSearch,
|
|
6718
6767
|
onKeyDown: handleKeyDown
|
|
6719
6768
|
}
|
|
6720
|
-
)), /* @__PURE__ */
|
|
6769
|
+
)), /* @__PURE__ */ React53.createElement(Divider, null), results.length > 0 ? /* @__PURE__ */ React53.createElement(
|
|
6721
6770
|
ComboboxMenu,
|
|
6722
6771
|
{
|
|
6723
6772
|
ref: listRef,
|
|
@@ -6732,29 +6781,29 @@ var SearchCompletionMenu = forwardRef21(function SearchCompletionMenu2({
|
|
|
6732
6781
|
onHoverIndex: setIndex,
|
|
6733
6782
|
indented: hasCheckedItems
|
|
6734
6783
|
}
|
|
6735
|
-
) : /* @__PURE__ */
|
|
6784
|
+
) : /* @__PURE__ */ React53.createElement(
|
|
6736
6785
|
"div",
|
|
6737
6786
|
{
|
|
6738
6787
|
...listSize,
|
|
6739
6788
|
className: "flex flex-col p-20 items-center justify-center"
|
|
6740
6789
|
},
|
|
6741
|
-
/* @__PURE__ */
|
|
6790
|
+
/* @__PURE__ */ React53.createElement(Small, { color: "textDisabled" }, "No results")
|
|
6742
6791
|
));
|
|
6743
6792
|
});
|
|
6744
6793
|
|
|
6745
6794
|
// src/components/CommandPalette.tsx
|
|
6746
|
-
var CommandPalette =
|
|
6795
|
+
var CommandPalette = memo21(function CommandPalette2({
|
|
6747
6796
|
showCommandPalette,
|
|
6748
6797
|
setShowCommandPalette,
|
|
6749
6798
|
items,
|
|
6750
6799
|
onSelect,
|
|
6751
6800
|
onHover
|
|
6752
6801
|
}) {
|
|
6753
|
-
const menuRef =
|
|
6754
|
-
const handleClose =
|
|
6802
|
+
const menuRef = React54.useRef(null);
|
|
6803
|
+
const handleClose = React54.useCallback(() => {
|
|
6755
6804
|
setShowCommandPalette(false);
|
|
6756
6805
|
}, [setShowCommandPalette]);
|
|
6757
|
-
return /* @__PURE__ */
|
|
6806
|
+
return /* @__PURE__ */ React54.createElement(
|
|
6758
6807
|
Dialog,
|
|
6759
6808
|
{
|
|
6760
6809
|
style: {
|
|
@@ -6780,7 +6829,7 @@ var CommandPalette = memo20(function CommandPalette2({
|
|
|
6780
6829
|
}, 0);
|
|
6781
6830
|
}
|
|
6782
6831
|
},
|
|
6783
|
-
/* @__PURE__ */
|
|
6832
|
+
/* @__PURE__ */ React54.createElement("div", { className: "flex flex-col flex-1" }, /* @__PURE__ */ React54.createElement(AutoSizer, null, (size2) => /* @__PURE__ */ React54.createElement(
|
|
6784
6833
|
SearchCompletionMenu,
|
|
6785
6834
|
{
|
|
6786
6835
|
ref: menuRef,
|
|
@@ -6796,14 +6845,14 @@ var CommandPalette = memo20(function CommandPalette2({
|
|
|
6796
6845
|
|
|
6797
6846
|
// src/components/connected-users-menu/ConnectedUsersMenuLayout.tsx
|
|
6798
6847
|
import { ChatBubbleWithDotsIcon } from "@noya-app/noya-icons";
|
|
6799
|
-
import
|
|
6800
|
-
var UserAvatar = ({ userId, name, image }) => /* @__PURE__ */
|
|
6848
|
+
import React55 from "react";
|
|
6849
|
+
var UserAvatar = ({ userId, name, image }) => /* @__PURE__ */ React55.createElement(
|
|
6801
6850
|
Tooltip,
|
|
6802
6851
|
{
|
|
6803
6852
|
key: userId,
|
|
6804
|
-
content: /* @__PURE__ */
|
|
6853
|
+
content: /* @__PURE__ */ React55.createElement("div", { className: "flex flex-col" }, /* @__PURE__ */ React55.createElement(Small, null, name))
|
|
6805
6854
|
},
|
|
6806
|
-
/* @__PURE__ */
|
|
6855
|
+
/* @__PURE__ */ React55.createElement(Avatar, { size: INPUT_HEIGHT, userId, name, image })
|
|
6807
6856
|
);
|
|
6808
6857
|
var ConnectedUsersMenuLayout = ({
|
|
6809
6858
|
renderUsers,
|
|
@@ -6811,12 +6860,12 @@ var ConnectedUsersMenuLayout = ({
|
|
|
6811
6860
|
launchAIAssistant,
|
|
6812
6861
|
isAssistantOpen
|
|
6813
6862
|
}) => {
|
|
6814
|
-
return /* @__PURE__ */
|
|
6863
|
+
return /* @__PURE__ */ React55.createElement("div", { className: "flex gap-1.5" }, /* @__PURE__ */ React55.createElement(AvatarStack, { size: INPUT_HEIGHT, className: "mr-1" }, renderUsers()), launchAIAssistant && /* @__PURE__ */ React55.createElement(
|
|
6815
6864
|
Tooltip,
|
|
6816
6865
|
{
|
|
6817
|
-
content: /* @__PURE__ */
|
|
6866
|
+
content: /* @__PURE__ */ React55.createElement("div", { className: "flex flex-col" }, /* @__PURE__ */ React55.createElement(Small, null, "AI Assistant"))
|
|
6818
6867
|
},
|
|
6819
|
-
/* @__PURE__ */
|
|
6868
|
+
/* @__PURE__ */ React55.createElement(
|
|
6820
6869
|
Button_default,
|
|
6821
6870
|
{
|
|
6822
6871
|
variant: isAssistantOpen ? "secondary" : void 0,
|
|
@@ -6826,8 +6875,8 @@ var ConnectedUsersMenuLayout = ({
|
|
|
6826
6875
|
}
|
|
6827
6876
|
},
|
|
6828
6877
|
"AI",
|
|
6829
|
-
/* @__PURE__ */
|
|
6830
|
-
/* @__PURE__ */
|
|
6878
|
+
/* @__PURE__ */ React55.createElement(Spacer.Horizontal, { size: 8 }),
|
|
6879
|
+
/* @__PURE__ */ React55.createElement(
|
|
6831
6880
|
ChatBubbleWithDotsIcon,
|
|
6832
6881
|
{
|
|
6833
6882
|
color: isAssistantOpen ? void 0 : cssVars.colors.icon
|
|
@@ -6839,30 +6888,14 @@ var ConnectedUsersMenuLayout = ({
|
|
|
6839
6888
|
|
|
6840
6889
|
// src/components/DraggableMenuButton.tsx
|
|
6841
6890
|
import { DragHandleDots2Icon } from "@noya-app/noya-icons";
|
|
6842
|
-
import
|
|
6843
|
-
var DotButton = forwardRef22(({ className, ...props }, ref) => /* @__PURE__ */ React55.createElement(
|
|
6844
|
-
"div",
|
|
6845
|
-
{
|
|
6846
|
-
ref,
|
|
6847
|
-
className: cx(
|
|
6848
|
-
`cursor-pointer rounded flex items-center justify-center py-[2px] hover:bg-input-background-light active:bg-active-background `,
|
|
6849
|
-
className
|
|
6850
|
-
),
|
|
6851
|
-
...props
|
|
6852
|
-
}
|
|
6853
|
-
));
|
|
6854
|
-
var Trigger5 = forwardRef22(({ className, ...props }, ref) => /* @__PURE__ */ React55.createElement(
|
|
6855
|
-
"div",
|
|
6856
|
-
{
|
|
6857
|
-
ref,
|
|
6858
|
-
className: cx(`pointer-events-none h-[15px] `, className),
|
|
6859
|
-
...props
|
|
6860
|
-
}
|
|
6861
|
-
));
|
|
6891
|
+
import React56, { useCallback as useCallback26, useState as useState25 } from "react";
|
|
6862
6892
|
var DraggableMenuButton = memoGeneric(function DraggableMenuButton2({
|
|
6863
6893
|
items,
|
|
6864
6894
|
onSelect,
|
|
6865
|
-
|
|
6895
|
+
onClick,
|
|
6896
|
+
isVisible = true,
|
|
6897
|
+
className,
|
|
6898
|
+
style: style2
|
|
6866
6899
|
}) {
|
|
6867
6900
|
const [open, setOpen] = useState25(false);
|
|
6868
6901
|
const [downPosition, setDownPosition] = useState25(null);
|
|
@@ -6901,17 +6934,23 @@ var DraggableMenuButton = memoGeneric(function DraggableMenuButton2({
|
|
|
6901
6934
|
},
|
|
6902
6935
|
[setOpen]
|
|
6903
6936
|
);
|
|
6904
|
-
return /* @__PURE__ */
|
|
6905
|
-
|
|
6937
|
+
return /* @__PURE__ */ React56.createElement(
|
|
6938
|
+
"div",
|
|
6906
6939
|
{
|
|
6940
|
+
className: cx(
|
|
6941
|
+
"cursor-pointer rounded flex items-center justify-center py-[2px] hover:bg-input-background-light active:bg-active-background ",
|
|
6942
|
+
className
|
|
6943
|
+
),
|
|
6944
|
+
style: style2,
|
|
6907
6945
|
onPointerDownCapture: handlePointerDownCapture,
|
|
6908
6946
|
onPointerUp: handlePointerUp,
|
|
6909
6947
|
onClick: (event) => {
|
|
6910
6948
|
event.stopPropagation();
|
|
6911
6949
|
event.preventDefault();
|
|
6950
|
+
onClick?.();
|
|
6912
6951
|
}
|
|
6913
6952
|
},
|
|
6914
|
-
items && onSelect ? /* @__PURE__ */
|
|
6953
|
+
items && onSelect ? /* @__PURE__ */ React56.createElement(
|
|
6915
6954
|
DropdownMenu,
|
|
6916
6955
|
{
|
|
6917
6956
|
open,
|
|
@@ -6920,13 +6959,13 @@ var DraggableMenuButton = memoGeneric(function DraggableMenuButton2({
|
|
|
6920
6959
|
onSelect,
|
|
6921
6960
|
shouldBindKeyboardShortcuts: false
|
|
6922
6961
|
},
|
|
6923
|
-
/* @__PURE__ */
|
|
6962
|
+
/* @__PURE__ */ React56.createElement("div", { className: "pointer-events-none h-[15px]" }, /* @__PURE__ */ React56.createElement(
|
|
6924
6963
|
DragHandleDots2Icon,
|
|
6925
6964
|
{
|
|
6926
6965
|
color: isVisible || open ? cssVars.colors.icon : "transparent"
|
|
6927
6966
|
}
|
|
6928
6967
|
))
|
|
6929
|
-
) : /* @__PURE__ */
|
|
6968
|
+
) : /* @__PURE__ */ React56.createElement(
|
|
6930
6969
|
DragHandleDots2Icon,
|
|
6931
6970
|
{
|
|
6932
6971
|
color: isVisible || open ? cssVars.colors.icon : "transparent"
|
|
@@ -6937,10 +6976,10 @@ var DraggableMenuButton = memoGeneric(function DraggableMenuButton2({
|
|
|
6937
6976
|
|
|
6938
6977
|
// src/components/Drawer.tsx
|
|
6939
6978
|
import * as Dialog3 from "@radix-ui/react-dialog";
|
|
6940
|
-
import * as
|
|
6979
|
+
import * as React57 from "react";
|
|
6941
6980
|
import { useImperativeHandle as useImperativeHandle8 } from "react";
|
|
6942
|
-
var Drawer =
|
|
6943
|
-
|
|
6981
|
+
var Drawer = React57.memo(
|
|
6982
|
+
React57.forwardRef(function Drawer2({
|
|
6944
6983
|
open,
|
|
6945
6984
|
onOpenChange,
|
|
6946
6985
|
trigger,
|
|
@@ -6970,7 +7009,7 @@ var Drawer = React56.memo(
|
|
|
6970
7009
|
return internalOpen;
|
|
6971
7010
|
}
|
|
6972
7011
|
}));
|
|
6973
|
-
const inner = /* @__PURE__ */
|
|
7012
|
+
const inner = /* @__PURE__ */ React57.createElement(React57.Fragment, null, /* @__PURE__ */ React57.createElement(
|
|
6974
7013
|
Dialog3.Overlay,
|
|
6975
7014
|
{
|
|
6976
7015
|
className: cx(
|
|
@@ -6978,7 +7017,7 @@ var Drawer = React56.memo(
|
|
|
6978
7017
|
positioning === "absolute" ? "absolute" : "fixed"
|
|
6979
7018
|
)
|
|
6980
7019
|
}
|
|
6981
|
-
), /* @__PURE__ */
|
|
7020
|
+
), /* @__PURE__ */ React57.createElement(
|
|
6982
7021
|
Dialog3.Content,
|
|
6983
7022
|
{
|
|
6984
7023
|
id,
|
|
@@ -6990,24 +7029,24 @@ var Drawer = React56.memo(
|
|
|
6990
7029
|
className
|
|
6991
7030
|
)
|
|
6992
7031
|
},
|
|
6993
|
-
title && /* @__PURE__ */
|
|
7032
|
+
title && /* @__PURE__ */ React57.createElement(Dialog3.Title, null, title),
|
|
6994
7033
|
children
|
|
6995
7034
|
));
|
|
6996
|
-
return /* @__PURE__ */
|
|
7035
|
+
return /* @__PURE__ */ React57.createElement(
|
|
6997
7036
|
Dialog3.Root,
|
|
6998
7037
|
{
|
|
6999
7038
|
key: "dialog",
|
|
7000
7039
|
open: internalOpen,
|
|
7001
7040
|
onOpenChange: setInternalOpen
|
|
7002
7041
|
},
|
|
7003
|
-
/* @__PURE__ */
|
|
7004
|
-
portalled ? /* @__PURE__ */
|
|
7042
|
+
/* @__PURE__ */ React57.createElement(Dialog3.Trigger, { key: "trigger" }, trigger),
|
|
7043
|
+
portalled ? /* @__PURE__ */ React57.createElement(Dialog3.Portal, { container: portalContainer }, inner) : inner
|
|
7005
7044
|
);
|
|
7006
7045
|
})
|
|
7007
7046
|
);
|
|
7008
7047
|
|
|
7009
7048
|
// src/components/Fade.tsx
|
|
7010
|
-
import
|
|
7049
|
+
import React58 from "react";
|
|
7011
7050
|
var Fade = ({
|
|
7012
7051
|
children,
|
|
7013
7052
|
direction = "right",
|
|
@@ -7029,7 +7068,7 @@ var Fade = ({
|
|
|
7029
7068
|
top: "left-0 right-0 top-0",
|
|
7030
7069
|
bottom: "left-0 right-0 bottom-0"
|
|
7031
7070
|
}[direction];
|
|
7032
|
-
return /* @__PURE__ */
|
|
7071
|
+
return /* @__PURE__ */ React58.createElement("div", { className: cx("relative", className), style: { height } }, position === "front" ? children : null, /* @__PURE__ */ React58.createElement(
|
|
7033
7072
|
"div",
|
|
7034
7073
|
{
|
|
7035
7074
|
className: cx(
|
|
@@ -7048,17 +7087,17 @@ var Fade = ({
|
|
|
7048
7087
|
};
|
|
7049
7088
|
|
|
7050
7089
|
// src/components/file-explorer/FileExplorerLayout.tsx
|
|
7051
|
-
import
|
|
7090
|
+
import React59 from "react";
|
|
7052
7091
|
var FileExplorerLayout = ({
|
|
7053
7092
|
children,
|
|
7054
7093
|
className,
|
|
7055
7094
|
...props
|
|
7056
|
-
}) => /* @__PURE__ */
|
|
7095
|
+
}) => /* @__PURE__ */ React59.createElement(Section, { className: cx(className, "px-3 flex-1"), ...props }, children);
|
|
7057
7096
|
var FileExplorerUploadButton = ({
|
|
7058
7097
|
showUploadButton,
|
|
7059
7098
|
onUpload,
|
|
7060
7099
|
children
|
|
7061
|
-
}) => /* @__PURE__ */
|
|
7100
|
+
}) => /* @__PURE__ */ React59.createElement("div", { className: "flex items-center gap-2" }, showUploadButton && /* @__PURE__ */ React59.createElement(
|
|
7062
7101
|
IconButton,
|
|
7063
7102
|
{
|
|
7064
7103
|
iconName: "UploadIcon",
|
|
@@ -7069,14 +7108,14 @@ var FileExplorerUploadButton = ({
|
|
|
7069
7108
|
), children);
|
|
7070
7109
|
var FileExplorerCollection = forwardRefGeneric(
|
|
7071
7110
|
function FileExplorerCollection2({ ...props }, ref) {
|
|
7072
|
-
return /* @__PURE__ */
|
|
7111
|
+
return /* @__PURE__ */ React59.createElement(Collection, { ref, className: "-mx-3 flex-1", ...props });
|
|
7073
7112
|
}
|
|
7074
7113
|
);
|
|
7075
7114
|
var FileExplorerDetail = ({
|
|
7076
7115
|
selected,
|
|
7077
7116
|
size: size2,
|
|
7078
7117
|
children
|
|
7079
|
-
}) => /* @__PURE__ */
|
|
7118
|
+
}) => /* @__PURE__ */ React59.createElement(
|
|
7080
7119
|
"span",
|
|
7081
7120
|
{
|
|
7082
7121
|
className: cx(
|
|
@@ -7089,10 +7128,10 @@ var FileExplorerDetail = ({
|
|
|
7089
7128
|
var FileExplorerEmptyState = ({
|
|
7090
7129
|
label = "No files",
|
|
7091
7130
|
...props
|
|
7092
|
-
}) => /* @__PURE__ */
|
|
7131
|
+
}) => /* @__PURE__ */ React59.createElement(Banner, { label, className: "mx-3", ...props });
|
|
7093
7132
|
|
|
7094
7133
|
// src/components/FillInputField.tsx
|
|
7095
|
-
import
|
|
7134
|
+
import React62, { forwardRef as forwardRef23, memo as memo25 } from "react";
|
|
7096
7135
|
|
|
7097
7136
|
// ../noya-file-format/src/types.ts
|
|
7098
7137
|
var types_exports = {};
|
|
@@ -7417,25 +7456,25 @@ var ClassValue = /* @__PURE__ */ ((ClassValue2) => {
|
|
|
7417
7456
|
})(ClassValue || {});
|
|
7418
7457
|
|
|
7419
7458
|
// src/components/FillPreviewBackground.tsx
|
|
7420
|
-
import * as
|
|
7459
|
+
import * as React61 from "react";
|
|
7421
7460
|
|
|
7422
7461
|
// src/contexts/ImageDataContext.tsx
|
|
7423
|
-
import * as
|
|
7424
|
-
var ImageDataContext =
|
|
7462
|
+
import * as React60 from "react";
|
|
7463
|
+
var ImageDataContext = React60.createContext(
|
|
7425
7464
|
void 0
|
|
7426
7465
|
);
|
|
7427
|
-
var ImageDataProvider =
|
|
7466
|
+
var ImageDataProvider = React60.memo(function ImageDataProvider2({
|
|
7428
7467
|
children,
|
|
7429
7468
|
getImageData
|
|
7430
7469
|
}) {
|
|
7431
|
-
const contextValue =
|
|
7470
|
+
const contextValue = React60.useMemo(
|
|
7432
7471
|
() => ({ getImageData: getImageData ?? (() => void 0) }),
|
|
7433
7472
|
[getImageData]
|
|
7434
7473
|
);
|
|
7435
|
-
return /* @__PURE__ */
|
|
7474
|
+
return /* @__PURE__ */ React60.createElement(ImageDataContext.Provider, { value: contextValue }, children);
|
|
7436
7475
|
});
|
|
7437
7476
|
function useImageData(ref) {
|
|
7438
|
-
const value =
|
|
7477
|
+
const value = React60.useContext(ImageDataContext);
|
|
7439
7478
|
if (!value) {
|
|
7440
7479
|
throw new Error("Missing ImageDataProvider");
|
|
7441
7480
|
}
|
|
@@ -7505,10 +7544,10 @@ var dotsHorizontalSvg = (fillColor) => `
|
|
|
7505
7544
|
<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>
|
|
7506
7545
|
</svg>
|
|
7507
7546
|
`;
|
|
7508
|
-
var Background =
|
|
7547
|
+
var Background = React61.memo(function Background2({
|
|
7509
7548
|
background: background2
|
|
7510
7549
|
}) {
|
|
7511
|
-
return /* @__PURE__ */
|
|
7550
|
+
return /* @__PURE__ */ React61.createElement(
|
|
7512
7551
|
"span",
|
|
7513
7552
|
{
|
|
7514
7553
|
className: `${background2 ? `bg-[${background2}]` : "bg-input-background"} absolute inset-0`
|
|
@@ -7527,7 +7566,7 @@ function getPatternSizeAndPosition(fillType, tileScale) {
|
|
|
7527
7566
|
return "center / 100% 100%";
|
|
7528
7567
|
}
|
|
7529
7568
|
}
|
|
7530
|
-
var PatternPreviewBackground =
|
|
7569
|
+
var PatternPreviewBackground = React61.memo(
|
|
7531
7570
|
function PatternPreviewBackground2({
|
|
7532
7571
|
fillType,
|
|
7533
7572
|
tileScale,
|
|
@@ -7536,7 +7575,7 @@ var PatternPreviewBackground = React60.memo(
|
|
|
7536
7575
|
const image = useImageData(imageRef);
|
|
7537
7576
|
const url = useObjectURL(image);
|
|
7538
7577
|
const size2 = getPatternSizeAndPosition(fillType, tileScale);
|
|
7539
|
-
const background2 =
|
|
7578
|
+
const background2 = React61.useMemo(
|
|
7540
7579
|
() => [
|
|
7541
7580
|
size2,
|
|
7542
7581
|
`url(${url})`,
|
|
@@ -7544,44 +7583,44 @@ var PatternPreviewBackground = React60.memo(
|
|
|
7544
7583
|
].join(" "),
|
|
7545
7584
|
[fillType, size2, url]
|
|
7546
7585
|
);
|
|
7547
|
-
return /* @__PURE__ */
|
|
7586
|
+
return /* @__PURE__ */ React61.createElement(Background, { background: background2 });
|
|
7548
7587
|
}
|
|
7549
7588
|
);
|
|
7550
|
-
var ColorPreviewBackground =
|
|
7589
|
+
var ColorPreviewBackground = React61.memo(function ColorPreviewBackground2({
|
|
7551
7590
|
color
|
|
7552
7591
|
}) {
|
|
7553
|
-
const background2 =
|
|
7592
|
+
const background2 = React61.useMemo(
|
|
7554
7593
|
() => sketchColorToRgbaString(color),
|
|
7555
7594
|
[color]
|
|
7556
7595
|
);
|
|
7557
|
-
return /* @__PURE__ */
|
|
7596
|
+
return /* @__PURE__ */ React61.createElement(Background, { background: background2 });
|
|
7558
7597
|
});
|
|
7559
|
-
var GradientPreviewBackground =
|
|
7598
|
+
var GradientPreviewBackground = React61.memo(
|
|
7560
7599
|
function GradientPreviewBackground2({
|
|
7561
7600
|
gradient
|
|
7562
7601
|
}) {
|
|
7563
|
-
const background2 =
|
|
7602
|
+
const background2 = React61.useMemo(
|
|
7564
7603
|
() => getGradientBackground(gradient.stops, gradient.gradientType, 180),
|
|
7565
7604
|
[gradient.gradientType, gradient.stops]
|
|
7566
7605
|
);
|
|
7567
|
-
return /* @__PURE__ */
|
|
7606
|
+
return /* @__PURE__ */ React61.createElement(Background, { background: background2 });
|
|
7568
7607
|
}
|
|
7569
7608
|
);
|
|
7570
7609
|
var background = `center url("data:image/svg+xml;utf8,${dotsHorizontalSvg(
|
|
7571
7610
|
cssVars.colors.placeholderDots
|
|
7572
7611
|
)}") no-repeat`;
|
|
7573
|
-
var FillPreviewBackground =
|
|
7612
|
+
var FillPreviewBackground = React61.memo(function FillPreviewBackground2({
|
|
7574
7613
|
value
|
|
7575
7614
|
}) {
|
|
7576
|
-
if (!value) return /* @__PURE__ */
|
|
7615
|
+
if (!value) return /* @__PURE__ */ React61.createElement(Background, { background });
|
|
7577
7616
|
switch (value._class) {
|
|
7578
7617
|
case "color":
|
|
7579
|
-
return /* @__PURE__ */
|
|
7618
|
+
return /* @__PURE__ */ React61.createElement(ColorPreviewBackground, { color: value });
|
|
7580
7619
|
case "gradient":
|
|
7581
|
-
return /* @__PURE__ */
|
|
7620
|
+
return /* @__PURE__ */ React61.createElement(GradientPreviewBackground, { gradient: value });
|
|
7582
7621
|
case "pattern":
|
|
7583
7622
|
if (!value.image) return null;
|
|
7584
|
-
return /* @__PURE__ */
|
|
7623
|
+
return /* @__PURE__ */ React61.createElement(
|
|
7585
7624
|
PatternPreviewBackground,
|
|
7586
7625
|
{
|
|
7587
7626
|
fillType: value.patternFillType,
|
|
@@ -7593,7 +7632,7 @@ var FillPreviewBackground = React60.memo(function FillPreviewBackground2({
|
|
|
7593
7632
|
});
|
|
7594
7633
|
|
|
7595
7634
|
// src/components/FillInputField.tsx
|
|
7596
|
-
var FillButton =
|
|
7635
|
+
var FillButton = forwardRef23(({ className, ...props }, ref) => /* @__PURE__ */ React62.createElement(
|
|
7597
7636
|
"button",
|
|
7598
7637
|
{
|
|
7599
7638
|
ref,
|
|
@@ -7604,14 +7643,14 @@ var FillButton = forwardRef24(({ className, ...props }, ref) => /* @__PURE__ */
|
|
|
7604
7643
|
...props
|
|
7605
7644
|
}
|
|
7606
7645
|
));
|
|
7607
|
-
var FillInputField =
|
|
7608
|
-
|
|
7609
|
-
return /* @__PURE__ */
|
|
7646
|
+
var FillInputField = memo25(
|
|
7647
|
+
forwardRef23(function FillInputField2({ id, value, ...rest }, ref) {
|
|
7648
|
+
return /* @__PURE__ */ React62.createElement(FillButton, { ref, id, ...rest }, /* @__PURE__ */ React62.createElement(FillPreviewBackground, { value }));
|
|
7610
7649
|
})
|
|
7611
7650
|
);
|
|
7612
7651
|
|
|
7613
7652
|
// src/components/FloatingWindow.tsx
|
|
7614
|
-
import
|
|
7653
|
+
import React63, { useCallback as useCallback27, useRef as useRef22, useState as useState26 } from "react";
|
|
7615
7654
|
var styles2 = {
|
|
7616
7655
|
noSelect: {
|
|
7617
7656
|
userSelect: "none",
|
|
@@ -7704,7 +7743,7 @@ function defaultRenderToolbar({
|
|
|
7704
7743
|
toolbarContent,
|
|
7705
7744
|
onClose
|
|
7706
7745
|
}) {
|
|
7707
|
-
return /* @__PURE__ */
|
|
7746
|
+
return /* @__PURE__ */ React63.createElement(React63.Fragment, null, /* @__PURE__ */ React63.createElement(Small, { className: "flex-1 font-medium text-text" }, title), toolbarContent, /* @__PURE__ */ React63.createElement(
|
|
7708
7747
|
IconButton,
|
|
7709
7748
|
{
|
|
7710
7749
|
iconName: "Cross3Icon",
|
|
@@ -7826,7 +7865,7 @@ var FloatingWindow = ({
|
|
|
7826
7865
|
setResizeDirection(null);
|
|
7827
7866
|
toggleGlobalTextSelection(false);
|
|
7828
7867
|
}, []);
|
|
7829
|
-
|
|
7868
|
+
React63.useEffect(() => {
|
|
7830
7869
|
document.addEventListener("mousemove", handleMouseMove);
|
|
7831
7870
|
document.addEventListener("mouseup", handleMouseUp);
|
|
7832
7871
|
return () => {
|
|
@@ -7840,7 +7879,7 @@ var FloatingWindow = ({
|
|
|
7840
7879
|
if (onClose) onClose();
|
|
7841
7880
|
floatingWindowManager.closeWindow(currentFloatingWindow.id);
|
|
7842
7881
|
}, [currentFloatingWindow.id, floatingWindowManager, onClose]);
|
|
7843
|
-
return /* @__PURE__ */
|
|
7882
|
+
return /* @__PURE__ */ React63.createElement(
|
|
7844
7883
|
"div",
|
|
7845
7884
|
{
|
|
7846
7885
|
ref: wrapperRef,
|
|
@@ -7855,7 +7894,7 @@ var FloatingWindow = ({
|
|
|
7855
7894
|
zIndex: cssVars.zIndex.menu
|
|
7856
7895
|
}
|
|
7857
7896
|
},
|
|
7858
|
-
/* @__PURE__ */
|
|
7897
|
+
/* @__PURE__ */ React63.createElement(
|
|
7859
7898
|
"div",
|
|
7860
7899
|
{
|
|
7861
7900
|
style: {
|
|
@@ -7866,9 +7905,9 @@ var FloatingWindow = ({
|
|
|
7866
7905
|
},
|
|
7867
7906
|
renderToolbar({ title, toolbarContent, onClose: handleClose })
|
|
7868
7907
|
),
|
|
7869
|
-
/* @__PURE__ */
|
|
7870
|
-
/* @__PURE__ */
|
|
7871
|
-
Object.entries(resizeHandlePositions).map(([direction, style2]) => /* @__PURE__ */
|
|
7908
|
+
/* @__PURE__ */ React63.createElement(Divider, null),
|
|
7909
|
+
/* @__PURE__ */ React63.createElement("div", { style: styles2.content }, children),
|
|
7910
|
+
Object.entries(resizeHandlePositions).map(([direction, style2]) => /* @__PURE__ */ React63.createElement(
|
|
7872
7911
|
"div",
|
|
7873
7912
|
{
|
|
7874
7913
|
key: direction,
|
|
@@ -7890,8 +7929,8 @@ import {
|
|
|
7890
7929
|
hsvaToRgba,
|
|
7891
7930
|
rgbaToHsva as rgbaToHsva2
|
|
7892
7931
|
} from "@noya-app/noya-colorpicker";
|
|
7893
|
-
import * as
|
|
7894
|
-
var GradientPicker =
|
|
7932
|
+
import * as React64 from "react";
|
|
7933
|
+
var GradientPicker = React64.memo(function GradientPicker2({
|
|
7895
7934
|
value,
|
|
7896
7935
|
selectedStop,
|
|
7897
7936
|
onChangeColor,
|
|
@@ -7900,7 +7939,7 @@ var GradientPicker = React63.memo(function GradientPicker2({
|
|
|
7900
7939
|
onDelete,
|
|
7901
7940
|
onSelectStop
|
|
7902
7941
|
}) {
|
|
7903
|
-
const colorModel =
|
|
7942
|
+
const colorModel = React64.useMemo(
|
|
7904
7943
|
() => ({
|
|
7905
7944
|
defaultColor: { r: 0, g: 0, b: 0, a: 1 },
|
|
7906
7945
|
toHsva: rgbaToHsva2,
|
|
@@ -7909,30 +7948,30 @@ var GradientPicker = React63.memo(function GradientPicker2({
|
|
|
7909
7948
|
}),
|
|
7910
7949
|
[]
|
|
7911
7950
|
);
|
|
7912
|
-
const rgbaColor =
|
|
7951
|
+
const rgbaColor = React64.useMemo(
|
|
7913
7952
|
() => sketchColorToRgba(value[selectedStop].color),
|
|
7914
7953
|
[value, selectedStop]
|
|
7915
7954
|
);
|
|
7916
|
-
const handleChangeColor =
|
|
7955
|
+
const handleChangeColor = React64.useCallback(
|
|
7917
7956
|
(value2) => {
|
|
7918
7957
|
onChangeColor(rgbaToSketchColor(value2));
|
|
7919
7958
|
},
|
|
7920
7959
|
[onChangeColor]
|
|
7921
7960
|
);
|
|
7922
|
-
const handleAddGradientStop =
|
|
7961
|
+
const handleAddGradientStop = React64.useCallback(
|
|
7923
7962
|
(value2, position) => {
|
|
7924
7963
|
onAdd(rgbaToSketchColor(value2), position);
|
|
7925
7964
|
},
|
|
7926
7965
|
[onAdd]
|
|
7927
7966
|
);
|
|
7928
|
-
return /* @__PURE__ */
|
|
7967
|
+
return /* @__PURE__ */ React64.createElement(
|
|
7929
7968
|
NoyaColorPicker,
|
|
7930
7969
|
{
|
|
7931
7970
|
onChange: handleChangeColor,
|
|
7932
7971
|
colorModel,
|
|
7933
7972
|
color: rgbaColor
|
|
7934
7973
|
},
|
|
7935
|
-
/* @__PURE__ */
|
|
7974
|
+
/* @__PURE__ */ React64.createElement(
|
|
7936
7975
|
Gradient,
|
|
7937
7976
|
{
|
|
7938
7977
|
gradients: value,
|
|
@@ -7943,19 +7982,19 @@ var GradientPicker = React63.memo(function GradientPicker2({
|
|
|
7943
7982
|
onDelete
|
|
7944
7983
|
}
|
|
7945
7984
|
),
|
|
7946
|
-
/* @__PURE__ */
|
|
7947
|
-
/* @__PURE__ */
|
|
7948
|
-
/* @__PURE__ */
|
|
7949
|
-
/* @__PURE__ */
|
|
7950
|
-
/* @__PURE__ */
|
|
7951
|
-
/* @__PURE__ */
|
|
7985
|
+
/* @__PURE__ */ React64.createElement(Spacer.Vertical, { size: 10 }),
|
|
7986
|
+
/* @__PURE__ */ React64.createElement(Saturation, null),
|
|
7987
|
+
/* @__PURE__ */ React64.createElement(Spacer.Vertical, { size: 12 }),
|
|
7988
|
+
/* @__PURE__ */ React64.createElement(Hue, null),
|
|
7989
|
+
/* @__PURE__ */ React64.createElement(Spacer.Vertical, { size: 5 }),
|
|
7990
|
+
/* @__PURE__ */ React64.createElement(Alpha, null)
|
|
7952
7991
|
);
|
|
7953
7992
|
});
|
|
7954
7993
|
|
|
7955
7994
|
// src/components/InspectorContainer.tsx
|
|
7956
|
-
import
|
|
7957
|
-
var InspectorContainer =
|
|
7958
|
-
|
|
7995
|
+
import React65, { forwardRef as forwardRef24, memo as memo27 } from "react";
|
|
7996
|
+
var InspectorContainer = memo27(
|
|
7997
|
+
forwardRef24(function InspectorContainer2({
|
|
7959
7998
|
header,
|
|
7960
7999
|
children,
|
|
7961
8000
|
fallback,
|
|
@@ -7964,7 +8003,7 @@ var InspectorContainer = memo26(
|
|
|
7964
8003
|
className,
|
|
7965
8004
|
style: style2
|
|
7966
8005
|
}, forwardedRef) {
|
|
7967
|
-
return /* @__PURE__ */
|
|
8006
|
+
return /* @__PURE__ */ React65.createElement(
|
|
7968
8007
|
"div",
|
|
7969
8008
|
{
|
|
7970
8009
|
ref: forwardedRef,
|
|
@@ -7979,32 +8018,32 @@ var InspectorContainer = memo26(
|
|
|
7979
8018
|
}
|
|
7980
8019
|
},
|
|
7981
8020
|
header,
|
|
7982
|
-
children ? /* @__PURE__ */
|
|
8021
|
+
children ? /* @__PURE__ */ React65.createElement(ScrollArea, null, /* @__PURE__ */ React65.createElement("div", { className: "flex flex-col relative" }, showDividers ? withSeparatorElements(children, /* @__PURE__ */ React65.createElement(Divider, null)) : children)) : fallback ? /* @__PURE__ */ React65.createElement("div", { className: "flex flex-col relative h-full" }, fallback) : null
|
|
7983
8022
|
);
|
|
7984
8023
|
})
|
|
7985
8024
|
);
|
|
7986
8025
|
|
|
7987
8026
|
// src/components/LabeledElementView.tsx
|
|
7988
8027
|
import * as kiwi from "kiwi.js";
|
|
7989
|
-
import * as
|
|
7990
|
-
var LabeledElementView =
|
|
8028
|
+
import * as React66 from "react";
|
|
8029
|
+
var LabeledElementView = React66.memo(function LabeledElementView2({
|
|
7991
8030
|
children,
|
|
7992
8031
|
renderLabel
|
|
7993
8032
|
}) {
|
|
7994
|
-
const elementIds =
|
|
7995
|
-
(child) =>
|
|
8033
|
+
const elementIds = React66.Children.toArray(children).flatMap(
|
|
8034
|
+
(child) => React66.isValidElement(child) && child.type === React66.Fragment ? child.props.children : [child]
|
|
7996
8035
|
).map(
|
|
7997
|
-
(child) =>
|
|
8036
|
+
(child) => React66.isValidElement(child) && "id" in child.props ? child.props.id : null
|
|
7998
8037
|
).filter((id) => !!id);
|
|
7999
8038
|
const serializedIds = elementIds.join(",");
|
|
8000
|
-
const containerRef =
|
|
8001
|
-
const refs =
|
|
8039
|
+
const containerRef = React66.useRef(null);
|
|
8040
|
+
const refs = React66.useMemo(() => {
|
|
8002
8041
|
return Object.fromEntries(
|
|
8003
|
-
serializedIds.split(",").map((id) => [id,
|
|
8042
|
+
serializedIds.split(",").map((id) => [id, React66.createRef()])
|
|
8004
8043
|
);
|
|
8005
8044
|
}, [serializedIds]);
|
|
8006
|
-
const labelElements =
|
|
8007
|
-
return serializedIds.split(",").map((id, index) => /* @__PURE__ */
|
|
8045
|
+
const labelElements = React66.useMemo(() => {
|
|
8046
|
+
return serializedIds.split(",").map((id, index) => /* @__PURE__ */ React66.createElement(
|
|
8008
8047
|
"span",
|
|
8009
8048
|
{
|
|
8010
8049
|
key: id,
|
|
@@ -8017,7 +8056,7 @@ var LabeledElementView = React65.memo(function LabeledElementView2({
|
|
|
8017
8056
|
})
|
|
8018
8057
|
));
|
|
8019
8058
|
}, [refs, serializedIds, renderLabel]);
|
|
8020
|
-
|
|
8059
|
+
React66.useLayoutEffect(() => {
|
|
8021
8060
|
if (!containerRef.current) return;
|
|
8022
8061
|
const containerRect = containerRef.current.getBoundingClientRect();
|
|
8023
8062
|
const solver = new kiwi.Solver();
|
|
@@ -8079,19 +8118,19 @@ var LabeledElementView = React65.memo(function LabeledElementView2({
|
|
|
8079
8118
|
`${Math.max(...heights)}px`
|
|
8080
8119
|
);
|
|
8081
8120
|
}, [refs, labelElements]);
|
|
8082
|
-
return /* @__PURE__ */
|
|
8121
|
+
return /* @__PURE__ */ React66.createElement("div", { className: "flex flex-1 flex-col relative", ref: containerRef }, /* @__PURE__ */ React66.createElement("div", { className: "flex flex-1 items-center" }, children), /* @__PURE__ */ React66.createElement("div", { className: "relative overflow-hidden select-none" }, labelElements));
|
|
8083
8122
|
});
|
|
8084
8123
|
|
|
8085
8124
|
// src/components/LabeledField.tsx
|
|
8086
|
-
import
|
|
8125
|
+
import React68, { memo as memo29, useMemo as useMemo27 } from "react";
|
|
8087
8126
|
|
|
8088
8127
|
// src/hooks/useIndent.ts
|
|
8089
|
-
import
|
|
8090
|
-
var IndentContext =
|
|
8128
|
+
import React67 from "react";
|
|
8129
|
+
var IndentContext = React67.createContext({
|
|
8091
8130
|
indentLevel: 0
|
|
8092
8131
|
});
|
|
8093
8132
|
var useIndent = () => {
|
|
8094
|
-
const { indentLevel } =
|
|
8133
|
+
const { indentLevel } = React67.useContext(IndentContext);
|
|
8095
8134
|
return indentLevel;
|
|
8096
8135
|
};
|
|
8097
8136
|
|
|
@@ -8104,7 +8143,7 @@ var labeledFieldStyles = (labelPosition) => cx(
|
|
|
8104
8143
|
var labelPositionInset = {
|
|
8105
8144
|
position: "inset"
|
|
8106
8145
|
};
|
|
8107
|
-
var LabeledField =
|
|
8146
|
+
var LabeledField = memo29(function LabeledField2({
|
|
8108
8147
|
children,
|
|
8109
8148
|
label,
|
|
8110
8149
|
labelPosition: labelPositionProp,
|
|
@@ -8150,7 +8189,7 @@ var LabeledField = memo28(function LabeledField2({
|
|
|
8150
8189
|
}),
|
|
8151
8190
|
[labelWidth, indentLevel, labelStyleProp]
|
|
8152
8191
|
);
|
|
8153
|
-
return /* @__PURE__ */
|
|
8192
|
+
return /* @__PURE__ */ React68.createElement(LabelContext.Provider, { value: labelContextValue }, labelPosition === "inset" ? /* @__PURE__ */ React68.createElement(LabelPositionContext.Provider, { value: labelPositionInset }, children) : /* @__PURE__ */ React68.createElement("div", { className: cx("flex relative flex-1", className), style: style2 }, Boolean(indentLevel) && /* @__PURE__ */ React68.createElement("div", { style: indentStyle }), /* @__PURE__ */ React68.createElement("div", { className: labeledFieldClasses }, /* @__PURE__ */ React68.createElement(
|
|
8154
8193
|
Label,
|
|
8155
8194
|
{
|
|
8156
8195
|
htmlFor: fieldId,
|
|
@@ -8159,7 +8198,7 @@ var LabeledField = memo28(function LabeledField2({
|
|
|
8159
8198
|
...props
|
|
8160
8199
|
},
|
|
8161
8200
|
label
|
|
8162
|
-
), labelPosition === "start" ? /* @__PURE__ */
|
|
8201
|
+
), labelPosition === "start" ? /* @__PURE__ */ React68.createElement("div", { className: "flex-auto flex", style: fieldStyle }, children) : children)));
|
|
8163
8202
|
});
|
|
8164
8203
|
|
|
8165
8204
|
// src/components/MediaThumbnail.tsx
|
|
@@ -8169,7 +8208,7 @@ import {
|
|
|
8169
8208
|
SpeakerLoudIcon,
|
|
8170
8209
|
VideoIcon
|
|
8171
8210
|
} from "@noya-app/noya-icons";
|
|
8172
|
-
import
|
|
8211
|
+
import React69, { memo as memo30, useMemo as useMemo28 } from "react";
|
|
8173
8212
|
|
|
8174
8213
|
// src/components/catppuccin/fileIcons.ts
|
|
8175
8214
|
var fileIcons = {
|
|
@@ -10609,7 +10648,7 @@ var getThumbnailColors = (colorScheme, selected) => {
|
|
|
10609
10648
|
};
|
|
10610
10649
|
}
|
|
10611
10650
|
};
|
|
10612
|
-
var MediaThumbnail =
|
|
10651
|
+
var MediaThumbnail = memo30(function MediaThumbnail2({
|
|
10613
10652
|
contentType: contentTypeProp,
|
|
10614
10653
|
selected = false,
|
|
10615
10654
|
className,
|
|
@@ -10634,8 +10673,8 @@ var MediaThumbnail = memo29(function MediaThumbnail2({
|
|
|
10634
10673
|
const content = useMemo28(() => {
|
|
10635
10674
|
switch (contentType) {
|
|
10636
10675
|
case "image":
|
|
10637
|
-
if (!url) return /* @__PURE__ */
|
|
10638
|
-
return /* @__PURE__ */
|
|
10676
|
+
if (!url) return /* @__PURE__ */ React69.createElement(ImageIcon, { color: iconColor, style: iconStyles });
|
|
10677
|
+
return /* @__PURE__ */ React69.createElement(
|
|
10639
10678
|
"img",
|
|
10640
10679
|
{
|
|
10641
10680
|
src: url,
|
|
@@ -10645,18 +10684,18 @@ var MediaThumbnail = memo29(function MediaThumbnail2({
|
|
|
10645
10684
|
}
|
|
10646
10685
|
);
|
|
10647
10686
|
case "video":
|
|
10648
|
-
return /* @__PURE__ */
|
|
10687
|
+
return /* @__PURE__ */ React69.createElement(VideoIcon, { color: iconColor, style: iconStyles });
|
|
10649
10688
|
case "audio":
|
|
10650
|
-
return /* @__PURE__ */
|
|
10689
|
+
return /* @__PURE__ */ React69.createElement(SpeakerLoudIcon, { color: iconColor, style: iconStyles });
|
|
10651
10690
|
default:
|
|
10652
10691
|
if (iconName) {
|
|
10653
10692
|
const Icon = Icons[iconName];
|
|
10654
|
-
return /* @__PURE__ */
|
|
10693
|
+
return /* @__PURE__ */ React69.createElement(Icon, { color: iconColor, style: iconStyles });
|
|
10655
10694
|
}
|
|
10656
10695
|
if (fileName) {
|
|
10657
10696
|
const fileIcon = findFileIcon(fileName);
|
|
10658
10697
|
if (fileIcon) {
|
|
10659
|
-
return /* @__PURE__ */
|
|
10698
|
+
return /* @__PURE__ */ React69.createElement(
|
|
10660
10699
|
"img",
|
|
10661
10700
|
{
|
|
10662
10701
|
src: `https://api.iconify.design/catppuccin/${fileIcon}.svg?height=none&box=1`,
|
|
@@ -10666,10 +10705,10 @@ var MediaThumbnail = memo29(function MediaThumbnail2({
|
|
|
10666
10705
|
);
|
|
10667
10706
|
}
|
|
10668
10707
|
}
|
|
10669
|
-
return /* @__PURE__ */
|
|
10708
|
+
return /* @__PURE__ */ React69.createElement(FileIcon, { color: iconColor, style: iconStyles });
|
|
10670
10709
|
}
|
|
10671
10710
|
}, [contentType, url, iconColor, iconStyles, iconName, fileName]);
|
|
10672
|
-
return /* @__PURE__ */
|
|
10711
|
+
return /* @__PURE__ */ React69.createElement(
|
|
10673
10712
|
"div",
|
|
10674
10713
|
{
|
|
10675
10714
|
className: cx(
|
|
@@ -10700,9 +10739,9 @@ function findFileIcon(fileName) {
|
|
|
10700
10739
|
}
|
|
10701
10740
|
|
|
10702
10741
|
// src/components/Message.tsx
|
|
10703
|
-
import
|
|
10704
|
-
var Message =
|
|
10705
|
-
|
|
10742
|
+
import React70, { forwardRef as forwardRef25, memo as memo31, useMemo as useMemo29 } from "react";
|
|
10743
|
+
var Message = memo31(
|
|
10744
|
+
forwardRef25(function Message2({ role, children, user, avatarSize = INPUT_HEIGHT }, ref) {
|
|
10706
10745
|
const randomId = crypto.randomUUID();
|
|
10707
10746
|
const userMessageBackgroundColor = colorFromString(user?.id ?? randomId);
|
|
10708
10747
|
const styles3 = useMemo29(
|
|
@@ -10711,7 +10750,7 @@ var Message = memo30(
|
|
|
10711
10750
|
} : void 0,
|
|
10712
10751
|
[userMessageBackgroundColor, role]
|
|
10713
10752
|
);
|
|
10714
|
-
return /* @__PURE__ */
|
|
10753
|
+
return /* @__PURE__ */ React70.createElement(
|
|
10715
10754
|
"div",
|
|
10716
10755
|
{
|
|
10717
10756
|
className: cx(
|
|
@@ -10719,15 +10758,15 @@ var Message = memo30(
|
|
|
10719
10758
|
role === "user" ? "flex-row-reverse" : "flex-row"
|
|
10720
10759
|
)
|
|
10721
10760
|
},
|
|
10722
|
-
role === "assistant" ? /* @__PURE__ */
|
|
10761
|
+
role === "assistant" ? /* @__PURE__ */ React70.createElement(
|
|
10723
10762
|
Avatar,
|
|
10724
10763
|
{
|
|
10725
10764
|
name: "Assistant",
|
|
10726
10765
|
size: avatarSize,
|
|
10727
10766
|
backgroundColor: cssVars.colors.primaryPastel
|
|
10728
10767
|
},
|
|
10729
|
-
/* @__PURE__ */
|
|
10730
|
-
) : /* @__PURE__ */
|
|
10768
|
+
/* @__PURE__ */ React70.createElement(Logo, { style: { width: 15 }, fill: cssVars.colors.primary })
|
|
10769
|
+
) : /* @__PURE__ */ React70.createElement(
|
|
10731
10770
|
Avatar,
|
|
10732
10771
|
{
|
|
10733
10772
|
userId: !user ? randomId : user?.id,
|
|
@@ -10736,7 +10775,7 @@ var Message = memo30(
|
|
|
10736
10775
|
size: avatarSize
|
|
10737
10776
|
}
|
|
10738
10777
|
),
|
|
10739
|
-
/* @__PURE__ */
|
|
10778
|
+
/* @__PURE__ */ React70.createElement(
|
|
10740
10779
|
"div",
|
|
10741
10780
|
{
|
|
10742
10781
|
className: cx(
|
|
@@ -10746,7 +10785,7 @@ var Message = memo30(
|
|
|
10746
10785
|
style: styles3,
|
|
10747
10786
|
ref
|
|
10748
10787
|
},
|
|
10749
|
-
/* @__PURE__ */
|
|
10788
|
+
/* @__PURE__ */ React70.createElement(
|
|
10750
10789
|
Text,
|
|
10751
10790
|
{
|
|
10752
10791
|
variant: "small",
|
|
@@ -10761,9 +10800,9 @@ var Message = memo30(
|
|
|
10761
10800
|
|
|
10762
10801
|
// src/components/pipeline/PipelineResultLayout.tsx
|
|
10763
10802
|
import { Link1Icon } from "@noya-app/noya-icons";
|
|
10764
|
-
import
|
|
10803
|
+
import React71 from "react";
|
|
10765
10804
|
var PipelineResultLink = ({ url }) => {
|
|
10766
|
-
return /* @__PURE__ */
|
|
10805
|
+
return /* @__PURE__ */ React71.createElement("div", { className: "flex flex-col gap-0.5" }, /* @__PURE__ */ React71.createElement(
|
|
10767
10806
|
"a",
|
|
10768
10807
|
{
|
|
10769
10808
|
href: url,
|
|
@@ -10771,15 +10810,15 @@ var PipelineResultLink = ({ url }) => {
|
|
|
10771
10810
|
rel: "noopener noreferrer",
|
|
10772
10811
|
className: "flex text-primary hover:opacity-80 border border-divider rounded-md"
|
|
10773
10812
|
},
|
|
10774
|
-
/* @__PURE__ */
|
|
10775
|
-
/* @__PURE__ */
|
|
10776
|
-
/* @__PURE__ */
|
|
10813
|
+
/* @__PURE__ */ React71.createElement("div", { className: "flex gap-1 items-center p-2" }, /* @__PURE__ */ React71.createElement(Link1Icon, { className: "w-[15px] h-[15px] flex-shrink-0" })),
|
|
10814
|
+
/* @__PURE__ */ React71.createElement(DividerVertical, null),
|
|
10815
|
+
/* @__PURE__ */ React71.createElement(Small, { className: "truncate p-2 flex-1" }, url)
|
|
10777
10816
|
));
|
|
10778
10817
|
};
|
|
10779
10818
|
var PipelineResultLayout = ({
|
|
10780
10819
|
children
|
|
10781
10820
|
}) => {
|
|
10782
|
-
return /* @__PURE__ */
|
|
10821
|
+
return /* @__PURE__ */ React71.createElement("div", { className: "flex flex-col gap-2" }, children);
|
|
10783
10822
|
};
|
|
10784
10823
|
function getPipelineResultLink(value) {
|
|
10785
10824
|
if (typeof value !== "object" || value === null) return void 0;
|
|
@@ -10795,27 +10834,27 @@ function getPipelineResultLink(value) {
|
|
|
10795
10834
|
// src/components/Progress.tsx
|
|
10796
10835
|
import { clamp } from "@noya-app/noya-utils";
|
|
10797
10836
|
import * as ProgressPrimitive from "@radix-ui/react-progress";
|
|
10798
|
-
import * as
|
|
10837
|
+
import * as React72 from "react";
|
|
10799
10838
|
function Progress({
|
|
10800
10839
|
value,
|
|
10801
10840
|
variant = "normal",
|
|
10802
10841
|
className
|
|
10803
10842
|
}) {
|
|
10804
10843
|
const clampedValue = clamp(value, 0, 100);
|
|
10805
|
-
const transformStyles =
|
|
10844
|
+
const transformStyles = React72.useMemo(
|
|
10806
10845
|
() => ({
|
|
10807
10846
|
transform: `translateX(-${100 - clampedValue}%)`
|
|
10808
10847
|
}),
|
|
10809
10848
|
[clampedValue]
|
|
10810
10849
|
);
|
|
10811
|
-
return /* @__PURE__ */
|
|
10850
|
+
return /* @__PURE__ */ React72.createElement(
|
|
10812
10851
|
ProgressPrimitive.Root,
|
|
10813
10852
|
{
|
|
10814
10853
|
className: cx(`relative hidden bg-input-background h-[5px] `, className),
|
|
10815
10854
|
style: { transform: "translateZ(0)" },
|
|
10816
10855
|
value: clampedValue
|
|
10817
10856
|
},
|
|
10818
|
-
/* @__PURE__ */
|
|
10857
|
+
/* @__PURE__ */ React72.createElement(
|
|
10819
10858
|
ProgressPrimitive.Indicator,
|
|
10820
10859
|
{
|
|
10821
10860
|
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`,
|
|
@@ -10826,7 +10865,7 @@ function Progress({
|
|
|
10826
10865
|
}
|
|
10827
10866
|
|
|
10828
10867
|
// src/components/Section.tsx
|
|
10829
|
-
import
|
|
10868
|
+
import React73, { memo as memo32, useMemo as useMemo31 } from "react";
|
|
10830
10869
|
var titleIconStyle = {
|
|
10831
10870
|
marginRight: "8px",
|
|
10832
10871
|
alignSelf: "flex-start",
|
|
@@ -10861,7 +10900,7 @@ var SectionInternal = ({
|
|
|
10861
10900
|
}),
|
|
10862
10901
|
[titleTextStyle, title, extraPadding, styleProp]
|
|
10863
10902
|
);
|
|
10864
|
-
const hasChildren =
|
|
10903
|
+
const hasChildren = React73.Children.toArray(children).some((child) => !!child);
|
|
10865
10904
|
const headerStyle = useMemo31(
|
|
10866
10905
|
() => ({
|
|
10867
10906
|
marginBottom: hasChildren ? "4px" : void 0,
|
|
@@ -10869,7 +10908,7 @@ var SectionInternal = ({
|
|
|
10869
10908
|
}),
|
|
10870
10909
|
[hasChildren]
|
|
10871
10910
|
);
|
|
10872
|
-
return /* @__PURE__ */
|
|
10911
|
+
return /* @__PURE__ */ React73.createElement("div", { style: style2, className }, (title || titleIcon || right) && /* @__PURE__ */ React73.createElement(InspectorPrimitives_exports.SectionHeader, { style: headerStyle }, titleIcon && /* @__PURE__ */ React73.createElement("div", { style: titleIconStyle, className: textStyles[titleTextStyle] }, titleIconOptions.inlineBlockWrapper ? /* @__PURE__ */ React73.createElement("div", { style: titleIconWrapperStyle }, titleIcon) : titleIcon), title && /* @__PURE__ */ React73.createElement(React73.Fragment, null, onClickTitle ? /* @__PURE__ */ React73.createElement(Button, { variant: "none", onClick: onClickTitle }, /* @__PURE__ */ React73.createElement(InspectorPrimitives_exports.Title, { $textStyle: titleTextStyle }, title)) : /* @__PURE__ */ React73.createElement(InspectorPrimitives_exports.Title, { $textStyle: titleTextStyle }, title)), /* @__PURE__ */ React73.createElement(Spacer.Horizontal, null), right), /* @__PURE__ */ React73.createElement(IndentContext.Provider, { value: { indentLevel: 1 } }, children));
|
|
10873
10912
|
};
|
|
10874
10913
|
var ExpandableSection = ({
|
|
10875
10914
|
storageKey,
|
|
@@ -10882,12 +10921,12 @@ var ExpandableSection = ({
|
|
|
10882
10921
|
initialVisibility
|
|
10883
10922
|
);
|
|
10884
10923
|
const expanded = visibility === "show";
|
|
10885
|
-
return /* @__PURE__ */
|
|
10924
|
+
return /* @__PURE__ */ React73.createElement(
|
|
10886
10925
|
SectionInternal,
|
|
10887
10926
|
{
|
|
10888
10927
|
...props,
|
|
10889
10928
|
right: !props.hideRightWhenCollapsed || expanded ? props.right : null,
|
|
10890
|
-
title: /* @__PURE__ */
|
|
10929
|
+
title: /* @__PURE__ */ React73.createElement("div", { className: "flex gap-1 items-center" }, props.title, /* @__PURE__ */ React73.createElement(
|
|
10891
10930
|
IconButton,
|
|
10892
10931
|
{
|
|
10893
10932
|
iconName: expanded ? "ChevronDownIcon2" : "ChevronRightIcon2",
|
|
@@ -10898,26 +10937,26 @@ var ExpandableSection = ({
|
|
|
10898
10937
|
expanded && props.children
|
|
10899
10938
|
);
|
|
10900
10939
|
};
|
|
10901
|
-
var Section =
|
|
10940
|
+
var Section = memo32(function InspectorSection({
|
|
10902
10941
|
storageKey,
|
|
10903
10942
|
...props
|
|
10904
10943
|
}) {
|
|
10905
|
-
return storageKey ? /* @__PURE__ */
|
|
10944
|
+
return storageKey ? /* @__PURE__ */ React73.createElement(ExpandableSection, { ...props, storageKey }) : /* @__PURE__ */ React73.createElement(SectionInternal, { ...props });
|
|
10906
10945
|
});
|
|
10907
10946
|
|
|
10908
10947
|
// src/components/SegmentedControl.tsx
|
|
10909
10948
|
import * as ToggleGroupPrimitive2 from "@radix-ui/react-toggle-group";
|
|
10910
|
-
import
|
|
10911
|
-
createContext as
|
|
10912
|
-
forwardRef as
|
|
10949
|
+
import React74, {
|
|
10950
|
+
createContext as createContext11,
|
|
10951
|
+
forwardRef as forwardRef26,
|
|
10913
10952
|
useCallback as useCallback29,
|
|
10914
|
-
useContext as
|
|
10953
|
+
useContext as useContext12,
|
|
10915
10954
|
useMemo as useMemo32
|
|
10916
10955
|
} from "react";
|
|
10917
|
-
var SegmentedControlContext =
|
|
10956
|
+
var SegmentedControlContext = createContext11({
|
|
10918
10957
|
colorScheme: "primary"
|
|
10919
10958
|
});
|
|
10920
|
-
var SegmentedControlItem =
|
|
10959
|
+
var SegmentedControlItem = forwardRef26(function SegmentedControlItem2({
|
|
10921
10960
|
value,
|
|
10922
10961
|
tooltip,
|
|
10923
10962
|
title,
|
|
@@ -10926,8 +10965,8 @@ var SegmentedControlItem = forwardRef27(function SegmentedControlItem2({
|
|
|
10926
10965
|
className,
|
|
10927
10966
|
...props
|
|
10928
10967
|
}, forwardedRef) {
|
|
10929
|
-
const { colorScheme } =
|
|
10930
|
-
const itemElement = /* @__PURE__ */
|
|
10968
|
+
const { colorScheme } = useContext12(SegmentedControlContext);
|
|
10969
|
+
const itemElement = /* @__PURE__ */ React74.createElement(
|
|
10931
10970
|
ToggleGroupPrimitive2.Item,
|
|
10932
10971
|
{
|
|
10933
10972
|
ref: forwardedRef,
|
|
@@ -10947,9 +10986,9 @@ var SegmentedControlItem = forwardRef27(function SegmentedControlItem2({
|
|
|
10947
10986
|
icon && renderIcon(icon),
|
|
10948
10987
|
title
|
|
10949
10988
|
);
|
|
10950
|
-
return tooltip ? /* @__PURE__ */
|
|
10989
|
+
return tooltip ? /* @__PURE__ */ React74.createElement(Tooltip, { content: tooltip }, itemElement) : itemElement;
|
|
10951
10990
|
});
|
|
10952
|
-
var Separator3 = ({ transparent }) => /* @__PURE__ */
|
|
10991
|
+
var Separator3 = ({ transparent }) => /* @__PURE__ */ React74.createElement(
|
|
10953
10992
|
"div",
|
|
10954
10993
|
{
|
|
10955
10994
|
className: cx(
|
|
@@ -10979,7 +11018,7 @@ var SegmentedControl = memoGeneric(function SegmentedControl2({
|
|
|
10979
11018
|
[allowEmpty, onValueChange]
|
|
10980
11019
|
);
|
|
10981
11020
|
const selectedIndex = items.findIndex((item) => item?.value === value);
|
|
10982
|
-
return /* @__PURE__ */
|
|
11021
|
+
return /* @__PURE__ */ React74.createElement(SegmentedControlContext.Provider, { value: contextValue }, /* @__PURE__ */ React74.createElement(
|
|
10983
11022
|
ToggleGroupPrimitive2.Root,
|
|
10984
11023
|
{
|
|
10985
11024
|
id,
|
|
@@ -10996,14 +11035,14 @@ var SegmentedControl = memoGeneric(function SegmentedControl2({
|
|
|
10996
11035
|
const isLastItem = index === items.length - 1;
|
|
10997
11036
|
const currentValue = item?.value;
|
|
10998
11037
|
const showSeparator = currentValue !== value && (selectedIndex === 0 && selectedIndex !== index ? true : index !== selectedIndex - 1);
|
|
10999
|
-
return /* @__PURE__ */
|
|
11000
|
-
}) : items.map((item, index) => /* @__PURE__ */
|
|
11038
|
+
return /* @__PURE__ */ React74.createElement(React74.Fragment, { key: index }, /* @__PURE__ */ React74.createElement(SegmentedControlItem, { key: index, ...item }), !isLastItem && /* @__PURE__ */ React74.createElement(Separator3, { transparent: !showSeparator }));
|
|
11039
|
+
}) : items.map((item, index) => /* @__PURE__ */ React74.createElement(SegmentedControlItem, { key: index, ...item }))
|
|
11001
11040
|
));
|
|
11002
11041
|
});
|
|
11003
11042
|
|
|
11004
11043
|
// src/components/SelectionToolbar.tsx
|
|
11005
11044
|
import * as PopperPrimitive from "@radix-ui/react-popper";
|
|
11006
|
-
import
|
|
11045
|
+
import React75, { memo as memo33, useMemo as useMemo33 } from "react";
|
|
11007
11046
|
var createVirtualElement = (rect) => ({
|
|
11008
11047
|
getBoundingClientRect: () => ({
|
|
11009
11048
|
width: rect.width,
|
|
@@ -11017,42 +11056,48 @@ var createVirtualElement = (rect) => ({
|
|
|
11017
11056
|
toJSON: () => null
|
|
11018
11057
|
})
|
|
11019
11058
|
});
|
|
11020
|
-
var
|
|
11021
|
-
|
|
11022
|
-
|
|
11023
|
-
|
|
11024
|
-
|
|
11025
|
-
|
|
11026
|
-
|
|
11027
|
-
|
|
11028
|
-
|
|
11029
|
-
|
|
11030
|
-
|
|
11031
|
-
|
|
11032
|
-
|
|
11033
|
-
|
|
11034
|
-
|
|
11035
|
-
|
|
11036
|
-
collisionPadding: 10,
|
|
11037
|
-
"data-editor-overlay": true,
|
|
11038
|
-
contentEditable: false,
|
|
11039
|
-
style: {
|
|
11040
|
-
zIndex: 1e3,
|
|
11041
|
-
opacity: size2 ? 1 : 0,
|
|
11042
|
-
transition: "opacity 0.2s ease-in-out",
|
|
11043
|
-
["--n-input-background"]: "transparent"
|
|
11044
|
-
}
|
|
11045
|
-
},
|
|
11046
|
-
/* @__PURE__ */ React74.createElement(
|
|
11047
|
-
"div",
|
|
11059
|
+
var SelectionToolbarContainer = memo33(
|
|
11060
|
+
function SelectionToolbarContainer2({
|
|
11061
|
+
rect,
|
|
11062
|
+
children
|
|
11063
|
+
}) {
|
|
11064
|
+
const portalScopeId = usePortalScopeId();
|
|
11065
|
+
const containerRef = React75.useRef(null);
|
|
11066
|
+
const size2 = useSize(containerRef, "width");
|
|
11067
|
+
const virtualRef = useMemo33(
|
|
11068
|
+
() => ({
|
|
11069
|
+
current: createVirtualElement(rect)
|
|
11070
|
+
}),
|
|
11071
|
+
[rect]
|
|
11072
|
+
);
|
|
11073
|
+
return /* @__PURE__ */ React75.createElement(PopperPrimitive.Root, null, /* @__PURE__ */ React75.createElement(PopperPrimitive.Anchor, { virtualRef }), /* @__PURE__ */ React75.createElement(
|
|
11074
|
+
PopperPrimitive.Content,
|
|
11048
11075
|
{
|
|
11049
|
-
|
|
11050
|
-
|
|
11076
|
+
...portalScopeProps(portalScopeId),
|
|
11077
|
+
side: "top",
|
|
11078
|
+
sideOffset: 10,
|
|
11079
|
+
align: "center",
|
|
11080
|
+
avoidCollisions: true,
|
|
11081
|
+
collisionPadding: 10,
|
|
11082
|
+
contentEditable: false,
|
|
11083
|
+
style: {
|
|
11084
|
+
zIndex: 1e3,
|
|
11085
|
+
opacity: size2 ? 1 : 0,
|
|
11086
|
+
transition: "opacity 0.2s ease-in-out",
|
|
11087
|
+
["--n-input-background"]: "transparent"
|
|
11088
|
+
}
|
|
11051
11089
|
},
|
|
11052
|
-
/* @__PURE__ */
|
|
11053
|
-
|
|
11054
|
-
|
|
11055
|
-
|
|
11090
|
+
/* @__PURE__ */ React75.createElement(
|
|
11091
|
+
"div",
|
|
11092
|
+
{
|
|
11093
|
+
ref: containerRef,
|
|
11094
|
+
className: "flex gap-1 bg-popover-background rounded shadow-popover p-1"
|
|
11095
|
+
},
|
|
11096
|
+
children
|
|
11097
|
+
)
|
|
11098
|
+
));
|
|
11099
|
+
}
|
|
11100
|
+
);
|
|
11056
11101
|
|
|
11057
11102
|
// src/components/SelectMenu.tsx
|
|
11058
11103
|
import {
|
|
@@ -11061,7 +11106,7 @@ import {
|
|
|
11061
11106
|
DropdownChevronIcon as DropdownChevronIcon3
|
|
11062
11107
|
} from "@noya-app/noya-icons";
|
|
11063
11108
|
import * as Select from "@radix-ui/react-select";
|
|
11064
|
-
import
|
|
11109
|
+
import React76, {
|
|
11065
11110
|
useMemo as useMemo34,
|
|
11066
11111
|
useState as useState27
|
|
11067
11112
|
} from "react";
|
|
@@ -11095,7 +11140,7 @@ var SelectMenuTrigger = memoGeneric(function SelectMenuTrigger2({
|
|
|
11095
11140
|
fieldId: props.id
|
|
11096
11141
|
});
|
|
11097
11142
|
const labelPosition = useLabelPosition();
|
|
11098
|
-
return /* @__PURE__ */
|
|
11143
|
+
return /* @__PURE__ */ React76.createElement(Select.SelectTrigger, { asChild: true, onFocus, onBlur }, /* @__PURE__ */ React76.createElement(
|
|
11099
11144
|
Button,
|
|
11100
11145
|
{
|
|
11101
11146
|
id,
|
|
@@ -11107,10 +11152,10 @@ var SelectMenuTrigger = memoGeneric(function SelectMenuTrigger2({
|
|
|
11107
11152
|
),
|
|
11108
11153
|
disabled
|
|
11109
11154
|
},
|
|
11110
|
-
icon && /* @__PURE__ */
|
|
11111
|
-
label && labelPosition === "inset" && /* @__PURE__ */
|
|
11112
|
-
/* @__PURE__ */
|
|
11113
|
-
/* @__PURE__ */
|
|
11155
|
+
icon && /* @__PURE__ */ React76.createElement("span", { className: "pr-1.5" }, renderIcon(icon)),
|
|
11156
|
+
label && labelPosition === "inset" && /* @__PURE__ */ React76.createElement("div", { className: insetEndStyles }, /* @__PURE__ */ React76.createElement(Label, { className: "pr-4 text-text-disabled", htmlFor: id }, label)),
|
|
11157
|
+
/* @__PURE__ */ React76.createElement("span", { className: "flex-1 flex" }, /* @__PURE__ */ React76.createElement(Select.Value, { placeholder })),
|
|
11158
|
+
/* @__PURE__ */ React76.createElement(
|
|
11114
11159
|
DropdownChevronIcon3,
|
|
11115
11160
|
{
|
|
11116
11161
|
className: cx(
|
|
@@ -11142,6 +11187,7 @@ var SelectMenu = memoGeneric(function SelectMenu2({
|
|
|
11142
11187
|
contentStyle: contentStyleProp,
|
|
11143
11188
|
...props
|
|
11144
11189
|
}) {
|
|
11190
|
+
const portalScopeId = usePortalScopeId();
|
|
11145
11191
|
const selectedItem = items.find(
|
|
11146
11192
|
(item) => isSelectableMenuItem(item) && item.value === value
|
|
11147
11193
|
);
|
|
@@ -11158,7 +11204,7 @@ var SelectMenu = memoGeneric(function SelectMenu2({
|
|
|
11158
11204
|
setInternalOpen(open2);
|
|
11159
11205
|
};
|
|
11160
11206
|
const readOnlyButton = useMemo34(
|
|
11161
|
-
() => /* @__PURE__ */
|
|
11207
|
+
() => /* @__PURE__ */ React76.createElement(
|
|
11162
11208
|
Button,
|
|
11163
11209
|
{
|
|
11164
11210
|
id,
|
|
@@ -11168,7 +11214,7 @@ var SelectMenu = memoGeneric(function SelectMenu2({
|
|
|
11168
11214
|
disabled
|
|
11169
11215
|
},
|
|
11170
11216
|
icon && renderIcon(icon),
|
|
11171
|
-
/* @__PURE__ */
|
|
11217
|
+
/* @__PURE__ */ React76.createElement("span", { className: "flex flex-1" }, selectedItem?.title ?? value)
|
|
11172
11218
|
),
|
|
11173
11219
|
[icon, id, style2, className, disabled, value, selectedItem]
|
|
11174
11220
|
);
|
|
@@ -11180,7 +11226,7 @@ var SelectMenu = memoGeneric(function SelectMenu2({
|
|
|
11180
11226
|
...contentStyleProp
|
|
11181
11227
|
};
|
|
11182
11228
|
}, [contentStyleProp]);
|
|
11183
|
-
const content = /* @__PURE__ */
|
|
11229
|
+
const content = /* @__PURE__ */ React76.createElement(
|
|
11184
11230
|
Select.Root,
|
|
11185
11231
|
{
|
|
11186
11232
|
value,
|
|
@@ -11188,7 +11234,7 @@ var SelectMenu = memoGeneric(function SelectMenu2({
|
|
|
11188
11234
|
open,
|
|
11189
11235
|
onOpenChange: handleOpenChange
|
|
11190
11236
|
},
|
|
11191
|
-
/* @__PURE__ */
|
|
11237
|
+
/* @__PURE__ */ React76.createElement(
|
|
11192
11238
|
SelectMenuTrigger,
|
|
11193
11239
|
{
|
|
11194
11240
|
id,
|
|
@@ -11203,9 +11249,10 @@ var SelectMenu = memoGeneric(function SelectMenu2({
|
|
|
11203
11249
|
label
|
|
11204
11250
|
}
|
|
11205
11251
|
),
|
|
11206
|
-
/* @__PURE__ */
|
|
11252
|
+
/* @__PURE__ */ React76.createElement(Select.Portal, null, /* @__PURE__ */ React76.createElement(
|
|
11207
11253
|
Select.Content,
|
|
11208
11254
|
{
|
|
11255
|
+
...portalScopeProps(portalScopeId),
|
|
11209
11256
|
className: styles.contentStyle,
|
|
11210
11257
|
position: "popper",
|
|
11211
11258
|
sideOffset: 6,
|
|
@@ -11213,14 +11260,14 @@ var SelectMenu = memoGeneric(function SelectMenu2({
|
|
|
11213
11260
|
align: "center",
|
|
11214
11261
|
style: contentStyle
|
|
11215
11262
|
},
|
|
11216
|
-
/* @__PURE__ */
|
|
11263
|
+
/* @__PURE__ */ React76.createElement(Select.ScrollUpButton, { className: scrollButtonStyles }, /* @__PURE__ */ React76.createElement(
|
|
11217
11264
|
ChevronUpIcon,
|
|
11218
11265
|
{
|
|
11219
11266
|
className: cx("transition-transform duration-100")
|
|
11220
11267
|
}
|
|
11221
11268
|
)),
|
|
11222
|
-
/* @__PURE__ */
|
|
11223
|
-
/* @__PURE__ */
|
|
11269
|
+
/* @__PURE__ */ React76.createElement(Select.Viewport, null, /* @__PURE__ */ React76.createElement(MenuViewport, { items, Components: Components3 })),
|
|
11270
|
+
/* @__PURE__ */ React76.createElement(Select.ScrollDownButton, { className: scrollButtonStyles }, /* @__PURE__ */ React76.createElement(ChevronDownIcon, null))
|
|
11224
11271
|
))
|
|
11225
11272
|
);
|
|
11226
11273
|
return readOnly ? readOnlyButton : content;
|
|
@@ -11228,13 +11275,13 @@ var SelectMenu = memoGeneric(function SelectMenu2({
|
|
|
11228
11275
|
|
|
11229
11276
|
// src/components/Slider.tsx
|
|
11230
11277
|
import * as RadixSlider from "@radix-ui/react-slider";
|
|
11231
|
-
import
|
|
11278
|
+
import React77, { memo as memo34, useCallback as useCallback30, useMemo as useMemo35 } from "react";
|
|
11232
11279
|
var THUMB_WIDTH = 8;
|
|
11233
11280
|
var thumbStyle = {
|
|
11234
11281
|
width: THUMB_WIDTH
|
|
11235
11282
|
};
|
|
11236
11283
|
var insetEndStyles2 = getInsetEndStyles();
|
|
11237
|
-
var Slider =
|
|
11284
|
+
var Slider = memo34(function Slider2({
|
|
11238
11285
|
style: style2,
|
|
11239
11286
|
className,
|
|
11240
11287
|
value,
|
|
@@ -11283,7 +11330,7 @@ var Slider = memo32(function Slider2({
|
|
|
11283
11330
|
}),
|
|
11284
11331
|
[percentage.raw]
|
|
11285
11332
|
);
|
|
11286
|
-
return /* @__PURE__ */
|
|
11333
|
+
return /* @__PURE__ */ React77.createElement(
|
|
11287
11334
|
RadixSlider.Root,
|
|
11288
11335
|
{
|
|
11289
11336
|
min,
|
|
@@ -11301,7 +11348,7 @@ var Slider = memo32(function Slider2({
|
|
|
11301
11348
|
onBlur,
|
|
11302
11349
|
disabled: readOnly
|
|
11303
11350
|
},
|
|
11304
|
-
/* @__PURE__ */
|
|
11351
|
+
/* @__PURE__ */ React77.createElement(RadixSlider.Track, { className: "flex-grow h-full rounded overflow-hidden bg-input-background" }, label && labelPosition === "inset" && /* @__PURE__ */ React77.createElement("div", { className: insetEndStyles2 }, /* @__PURE__ */ React77.createElement(Label, { htmlFor: id, className: "text-text-disabled" }, label)), /* @__PURE__ */ React77.createElement(
|
|
11305
11352
|
"div",
|
|
11306
11353
|
{
|
|
11307
11354
|
style: trackFillStyle,
|
|
@@ -11312,8 +11359,8 @@ var Slider = memo32(function Slider2({
|
|
|
11312
11359
|
)
|
|
11313
11360
|
}
|
|
11314
11361
|
)),
|
|
11315
|
-
label && labelPosition === "inset" && colorScheme !== void 0 && /* @__PURE__ */
|
|
11316
|
-
/* @__PURE__ */
|
|
11362
|
+
label && labelPosition === "inset" && colorScheme !== void 0 && /* @__PURE__ */ React77.createElement("div", { className: insetEndStyles2 }, /* @__PURE__ */ React77.createElement(Label, { className: "text-white overflow-hidden", style: labelStyle }, label)),
|
|
11363
|
+
/* @__PURE__ */ React77.createElement(
|
|
11317
11364
|
RadixSlider.Thumb,
|
|
11318
11365
|
{
|
|
11319
11366
|
style: thumbStyle,
|
|
@@ -11330,7 +11377,7 @@ var Slider = memo32(function Slider2({
|
|
|
11330
11377
|
|
|
11331
11378
|
// src/components/Switch.tsx
|
|
11332
11379
|
import * as SwitchPrimitive from "@radix-ui/react-switch";
|
|
11333
|
-
import * as
|
|
11380
|
+
import * as React78 from "react";
|
|
11334
11381
|
var Switch = function Switch2({
|
|
11335
11382
|
id,
|
|
11336
11383
|
value,
|
|
@@ -11342,7 +11389,7 @@ var Switch = function Switch2({
|
|
|
11342
11389
|
style: style2,
|
|
11343
11390
|
className
|
|
11344
11391
|
}) {
|
|
11345
|
-
return /* @__PURE__ */
|
|
11392
|
+
return /* @__PURE__ */ React78.createElement(
|
|
11346
11393
|
SwitchPrimitive.Root,
|
|
11347
11394
|
{
|
|
11348
11395
|
id,
|
|
@@ -11361,20 +11408,20 @@ var Switch = function Switch2({
|
|
|
11361
11408
|
onFocus,
|
|
11362
11409
|
onBlur
|
|
11363
11410
|
},
|
|
11364
|
-
/* @__PURE__ */
|
|
11411
|
+
/* @__PURE__ */ React78.createElement(SwitchPrimitive.Thumb, { className: "block w-[15px] h-[15px] bg-background rounded-full transition-transform translate-x-[2px] data-[state=checked]:translate-x-[15px]" })
|
|
11365
11412
|
);
|
|
11366
11413
|
};
|
|
11367
11414
|
|
|
11368
11415
|
// src/components/UserPointer.tsx
|
|
11369
|
-
import
|
|
11370
|
-
var UserPointerContainer =
|
|
11416
|
+
import React79, { memo as memo35, useMemo as useMemo36 } from "react";
|
|
11417
|
+
var UserPointerContainer = memo35(function UserPointerContainer2({
|
|
11371
11418
|
point,
|
|
11372
11419
|
visible,
|
|
11373
11420
|
children,
|
|
11374
11421
|
className,
|
|
11375
11422
|
style: style2
|
|
11376
11423
|
}) {
|
|
11377
|
-
return /* @__PURE__ */
|
|
11424
|
+
return /* @__PURE__ */ React79.createElement(
|
|
11378
11425
|
"div",
|
|
11379
11426
|
{
|
|
11380
11427
|
style: {
|
|
@@ -11391,13 +11438,13 @@ var UserPointerContainer = memo33(function UserPointerContainer2({
|
|
|
11391
11438
|
children
|
|
11392
11439
|
);
|
|
11393
11440
|
});
|
|
11394
|
-
var UserNameTag =
|
|
11441
|
+
var UserNameTag = memo35(function UserNameTag2({
|
|
11395
11442
|
backgroundColor,
|
|
11396
11443
|
className,
|
|
11397
11444
|
style: style2,
|
|
11398
11445
|
children
|
|
11399
11446
|
}) {
|
|
11400
|
-
return /* @__PURE__ */
|
|
11447
|
+
return /* @__PURE__ */ React79.createElement(
|
|
11401
11448
|
"span",
|
|
11402
11449
|
{
|
|
11403
11450
|
className: cx(
|
|
@@ -11413,14 +11460,14 @@ var UserNameTag = memo33(function UserNameTag2({
|
|
|
11413
11460
|
children
|
|
11414
11461
|
);
|
|
11415
11462
|
});
|
|
11416
|
-
var UserPointerIcon =
|
|
11463
|
+
var UserPointerIcon = memo35(function PointerIcon({
|
|
11417
11464
|
size: size2,
|
|
11418
11465
|
color = "black",
|
|
11419
11466
|
className,
|
|
11420
11467
|
style: style2
|
|
11421
11468
|
}) {
|
|
11422
11469
|
const points = "0,5 10,0 10,10";
|
|
11423
|
-
return /* @__PURE__ */
|
|
11470
|
+
return /* @__PURE__ */ React79.createElement(
|
|
11424
11471
|
"svg",
|
|
11425
11472
|
{
|
|
11426
11473
|
width: size2,
|
|
@@ -11435,7 +11482,7 @@ var UserPointerIcon = memo33(function PointerIcon({
|
|
|
11435
11482
|
...style2
|
|
11436
11483
|
}
|
|
11437
11484
|
},
|
|
11438
|
-
/* @__PURE__ */
|
|
11485
|
+
/* @__PURE__ */ React79.createElement(
|
|
11439
11486
|
"polygon",
|
|
11440
11487
|
{
|
|
11441
11488
|
points,
|
|
@@ -11448,7 +11495,7 @@ var UserPointerIcon = memo33(function PointerIcon({
|
|
|
11448
11495
|
});
|
|
11449
11496
|
var POINTER_SIZE = 12;
|
|
11450
11497
|
var POINTER_OVERLAP = 6;
|
|
11451
|
-
var UserPointer =
|
|
11498
|
+
var UserPointer = memo35(function UserPointer2({
|
|
11452
11499
|
userId,
|
|
11453
11500
|
name,
|
|
11454
11501
|
visible = true,
|
|
@@ -11472,7 +11519,7 @@ var UserPointer = memo33(function UserPointer2({
|
|
|
11472
11519
|
() => ({ marginLeft: `${POINTER_SIZE - POINTER_OVERLAP + 1}px` }),
|
|
11473
11520
|
[]
|
|
11474
11521
|
);
|
|
11475
|
-
return /* @__PURE__ */
|
|
11522
|
+
return /* @__PURE__ */ React79.createElement(
|
|
11476
11523
|
UserPointerContainer,
|
|
11477
11524
|
{
|
|
11478
11525
|
point,
|
|
@@ -11480,14 +11527,14 @@ var UserPointer = memo33(function UserPointer2({
|
|
|
11480
11527
|
className,
|
|
11481
11528
|
style: style2
|
|
11482
11529
|
},
|
|
11483
|
-
name && /* @__PURE__ */
|
|
11530
|
+
name && /* @__PURE__ */ React79.createElement("div", { className: "relative" }, /* @__PURE__ */ React79.createElement(
|
|
11484
11531
|
UserPointerIcon,
|
|
11485
11532
|
{
|
|
11486
11533
|
size: POINTER_SIZE,
|
|
11487
11534
|
color: userBackgroundColor,
|
|
11488
11535
|
style: pointerOverlapStyle
|
|
11489
11536
|
}
|
|
11490
|
-
), /* @__PURE__ */
|
|
11537
|
+
), /* @__PURE__ */ React79.createElement(
|
|
11491
11538
|
UserNameTag,
|
|
11492
11539
|
{
|
|
11493
11540
|
backgroundColor: userBackgroundColor,
|
|
@@ -11500,9 +11547,9 @@ var UserPointer = memo33(function UserPointer2({
|
|
|
11500
11547
|
|
|
11501
11548
|
// src/components/workspace/WorkspaceLayout.tsx
|
|
11502
11549
|
import { useKeyboardShortcuts as useKeyboardShortcuts3 } from "@noya-app/noya-keymap";
|
|
11503
|
-
import
|
|
11504
|
-
forwardRef as
|
|
11505
|
-
memo as
|
|
11550
|
+
import React83, {
|
|
11551
|
+
forwardRef as forwardRef27,
|
|
11552
|
+
memo as memo38,
|
|
11506
11553
|
useCallback as useCallback31,
|
|
11507
11554
|
useImperativeHandle as useImperativeHandle9,
|
|
11508
11555
|
useRef as useRef27,
|
|
@@ -11530,7 +11577,7 @@ function useWindowSize() {
|
|
|
11530
11577
|
}
|
|
11531
11578
|
|
|
11532
11579
|
// src/components/workspace/DrawerWorkspaceLayout.tsx
|
|
11533
|
-
import
|
|
11580
|
+
import React81, { memo as memo36, useLayoutEffect as useLayoutEffect9, useRef as useRef25, useState as useState29 } from "react";
|
|
11534
11581
|
|
|
11535
11582
|
// src/hooks/usePreservePanelSize.tsx
|
|
11536
11583
|
import { useLayoutEffect as useLayoutEffect8, useRef as useRef24 } from "react";
|
|
@@ -11670,7 +11717,7 @@ function usePreservePanelSize(panelGroupRef, setPanelLayoutState) {
|
|
|
11670
11717
|
}
|
|
11671
11718
|
|
|
11672
11719
|
// src/components/workspace/DrawerWorkspaceLayout.tsx
|
|
11673
|
-
var DrawerWorkspaceLayout =
|
|
11720
|
+
var DrawerWorkspaceLayout = memo36(function DrawerWorkspaceLayout2({
|
|
11674
11721
|
leftPanel,
|
|
11675
11722
|
leftSidebarRef,
|
|
11676
11723
|
rightPanel,
|
|
@@ -11691,14 +11738,14 @@ var DrawerWorkspaceLayout = memo34(function DrawerWorkspaceLayout2({
|
|
|
11691
11738
|
}, [handleChangeLayoutState, mounted]);
|
|
11692
11739
|
const leftSidebarCollapsed = internalLayoutState?.leftSidebarCollapsed ?? false;
|
|
11693
11740
|
const rightSidebarCollapsed = internalLayoutState?.rightSidebarCollapsed ?? false;
|
|
11694
|
-
return /* @__PURE__ */
|
|
11741
|
+
return /* @__PURE__ */ React81.createElement(
|
|
11695
11742
|
"div",
|
|
11696
11743
|
{
|
|
11697
11744
|
ref: portalContainer,
|
|
11698
11745
|
id: EDITOR_PANEL_GROUP_ID,
|
|
11699
11746
|
className: "flex flex-1 relative focus:outline-none"
|
|
11700
11747
|
},
|
|
11701
|
-
leftPanel && /* @__PURE__ */
|
|
11748
|
+
leftPanel && /* @__PURE__ */ React81.createElement(
|
|
11702
11749
|
Drawer,
|
|
11703
11750
|
{
|
|
11704
11751
|
id: LEFT_SIDEBAR_ID,
|
|
@@ -11719,7 +11766,7 @@ var DrawerWorkspaceLayout = memo34(function DrawerWorkspaceLayout2({
|
|
|
11719
11766
|
leftPanel
|
|
11720
11767
|
),
|
|
11721
11768
|
centerPanel,
|
|
11722
|
-
rightPanel && /* @__PURE__ */
|
|
11769
|
+
rightPanel && /* @__PURE__ */ React81.createElement(
|
|
11723
11770
|
Drawer,
|
|
11724
11771
|
{
|
|
11725
11772
|
id: RIGHT_SIDEBAR_ID,
|
|
@@ -11743,13 +11790,13 @@ var DrawerWorkspaceLayout = memo34(function DrawerWorkspaceLayout2({
|
|
|
11743
11790
|
});
|
|
11744
11791
|
|
|
11745
11792
|
// src/components/workspace/PanelWorkspaceLayout.tsx
|
|
11746
|
-
import
|
|
11793
|
+
import React82, { memo as memo37, useRef as useRef26 } from "react";
|
|
11747
11794
|
import {
|
|
11748
11795
|
Panel,
|
|
11749
11796
|
PanelGroup,
|
|
11750
11797
|
PanelResizeHandle
|
|
11751
11798
|
} from "react-resizable-panels";
|
|
11752
|
-
var PanelWorkspaceLayout =
|
|
11799
|
+
var PanelWorkspaceLayout = memo37(function PanelWorkspaceLayout2({
|
|
11753
11800
|
leftPanel,
|
|
11754
11801
|
rightPanel,
|
|
11755
11802
|
centerPanel,
|
|
@@ -11764,7 +11811,7 @@ var PanelWorkspaceLayout = memo35(function PanelWorkspaceLayout2({
|
|
|
11764
11811
|
}) {
|
|
11765
11812
|
const panelGroupRef = useRef26(null);
|
|
11766
11813
|
usePreservePanelSize(panelGroupRef, handleChangeLayoutState);
|
|
11767
|
-
return /* @__PURE__ */
|
|
11814
|
+
return /* @__PURE__ */ React82.createElement(
|
|
11768
11815
|
PanelGroup,
|
|
11769
11816
|
{
|
|
11770
11817
|
ref: panelGroupRef,
|
|
@@ -11773,7 +11820,7 @@ var PanelWorkspaceLayout = memo35(function PanelWorkspaceLayout2({
|
|
|
11773
11820
|
direction: "horizontal",
|
|
11774
11821
|
autoSaveId: autoSavePrefix ? `${autoSavePrefix}--${EDITOR_PANEL_GROUP_ID}` : void 0
|
|
11775
11822
|
},
|
|
11776
|
-
leftPanel && /* @__PURE__ */
|
|
11823
|
+
leftPanel && /* @__PURE__ */ React82.createElement(React82.Fragment, null, /* @__PURE__ */ React82.createElement(
|
|
11777
11824
|
Panel,
|
|
11778
11825
|
{
|
|
11779
11826
|
id: LEFT_SIDEBAR_ID,
|
|
@@ -11786,8 +11833,8 @@ var PanelWorkspaceLayout = memo35(function PanelWorkspaceLayout2({
|
|
|
11786
11833
|
collapsible: true
|
|
11787
11834
|
},
|
|
11788
11835
|
internalLayoutState?.leftSidebarCollapsed ? null : leftPanel
|
|
11789
|
-
), /* @__PURE__ */
|
|
11790
|
-
/* @__PURE__ */
|
|
11836
|
+
), /* @__PURE__ */ React82.createElement(PanelResizeHandle, { className: "cursor-col-resize w-px h-full bg-divider" })),
|
|
11837
|
+
/* @__PURE__ */ React82.createElement(
|
|
11791
11838
|
Panel,
|
|
11792
11839
|
{
|
|
11793
11840
|
id: CONTENT_AREA_ID,
|
|
@@ -11798,7 +11845,7 @@ var PanelWorkspaceLayout = memo35(function PanelWorkspaceLayout2({
|
|
|
11798
11845
|
},
|
|
11799
11846
|
centerPanel
|
|
11800
11847
|
),
|
|
11801
|
-
rightPanel && /* @__PURE__ */
|
|
11848
|
+
rightPanel && /* @__PURE__ */ React82.createElement(React82.Fragment, null, /* @__PURE__ */ React82.createElement(PanelResizeHandle, { className: "cursor-col-resize w-px h-full bg-divider" }), /* @__PURE__ */ React82.createElement(
|
|
11802
11849
|
Panel,
|
|
11803
11850
|
{
|
|
11804
11851
|
id: RIGHT_SIDEBAR_ID,
|
|
@@ -11816,7 +11863,7 @@ var PanelWorkspaceLayout = memo35(function PanelWorkspaceLayout2({
|
|
|
11816
11863
|
});
|
|
11817
11864
|
|
|
11818
11865
|
// src/components/workspace/WorkspaceLayout.tsx
|
|
11819
|
-
var WorkspaceLayout =
|
|
11866
|
+
var WorkspaceLayout = forwardRef27(function WorkspaceLayout2({
|
|
11820
11867
|
autoSavePrefix,
|
|
11821
11868
|
left,
|
|
11822
11869
|
right,
|
|
@@ -11847,7 +11894,7 @@ var WorkspaceLayout = forwardRef28(function WorkspaceLayout2({
|
|
|
11847
11894
|
} = {},
|
|
11848
11895
|
theme
|
|
11849
11896
|
}, forwardedRef) {
|
|
11850
|
-
const containerRef =
|
|
11897
|
+
const containerRef = React83.useRef(null);
|
|
11851
11898
|
const containerSize = useSize(containerRef);
|
|
11852
11899
|
const windowSize = useWindowSize();
|
|
11853
11900
|
const parentSize = detectSize === "window" ? windowSize : containerSize && containerSize.width > 0 ? containerSize : windowSize;
|
|
@@ -11945,7 +11992,7 @@ var WorkspaceLayout = forwardRef28(function WorkspaceLayout2({
|
|
|
11945
11992
|
}
|
|
11946
11993
|
});
|
|
11947
11994
|
const centerPanelPercentage = 100 - (left ? leftSidebarPercentage : 0) - (right ? rightSidebarPercentage : 0);
|
|
11948
|
-
const leftPanel = left ? /* @__PURE__ */
|
|
11995
|
+
const leftPanel = left ? /* @__PURE__ */ React83.createElement(
|
|
11949
11996
|
PanelInner,
|
|
11950
11997
|
{
|
|
11951
11998
|
style: leftStyle,
|
|
@@ -11953,7 +12000,7 @@ var WorkspaceLayout = forwardRef28(function WorkspaceLayout2({
|
|
|
11953
12000
|
},
|
|
11954
12001
|
left
|
|
11955
12002
|
) : null;
|
|
11956
|
-
const rightPanel = right ? /* @__PURE__ */
|
|
12003
|
+
const rightPanel = right ? /* @__PURE__ */ React83.createElement(
|
|
11957
12004
|
PanelInner,
|
|
11958
12005
|
{
|
|
11959
12006
|
style: rightStyle,
|
|
@@ -11961,7 +12008,7 @@ var WorkspaceLayout = forwardRef28(function WorkspaceLayout2({
|
|
|
11961
12008
|
},
|
|
11962
12009
|
right
|
|
11963
12010
|
) : null;
|
|
11964
|
-
const centerPanel = /* @__PURE__ */
|
|
12011
|
+
const centerPanel = /* @__PURE__ */ React83.createElement(PanelInner, { className: "bg-canvas-background" }, children);
|
|
11965
12012
|
const leftSidebarOptions = {
|
|
11966
12013
|
minSize: leftSidebarMinPercentage,
|
|
11967
12014
|
maxSize: leftSidebarMaxPercentage,
|
|
@@ -11976,7 +12023,7 @@ var WorkspaceLayout = forwardRef28(function WorkspaceLayout2({
|
|
|
11976
12023
|
};
|
|
11977
12024
|
const LayoutComponent = sideType === "panel" ? PanelWorkspaceLayout : sideType === "drawer" ? DrawerWorkspaceLayout : parentSize.width > sideTypeBreakpoint ? PanelWorkspaceLayout : DrawerWorkspaceLayout;
|
|
11978
12025
|
const readyToRender = detectSize === "window" || containerSize && containerSize.width > 0;
|
|
11979
|
-
return /* @__PURE__ */
|
|
12026
|
+
return /* @__PURE__ */ React83.createElement(
|
|
11980
12027
|
"div",
|
|
11981
12028
|
{
|
|
11982
12029
|
ref: containerRef,
|
|
@@ -11986,7 +12033,7 @@ var WorkspaceLayout = forwardRef28(function WorkspaceLayout2({
|
|
|
11986
12033
|
"data-theme": theme
|
|
11987
12034
|
},
|
|
11988
12035
|
toolbar,
|
|
11989
|
-
/* @__PURE__ */
|
|
12036
|
+
/* @__PURE__ */ React83.createElement("div", { className: "flex flex-row flex-1 relative" }, readyToRender && /* @__PURE__ */ React83.createElement(
|
|
11990
12037
|
LayoutComponent,
|
|
11991
12038
|
{
|
|
11992
12039
|
leftPanel,
|
|
@@ -12004,12 +12051,12 @@ var WorkspaceLayout = forwardRef28(function WorkspaceLayout2({
|
|
|
12004
12051
|
))
|
|
12005
12052
|
);
|
|
12006
12053
|
});
|
|
12007
|
-
var PanelInner =
|
|
12054
|
+
var PanelInner = memo38(function PanelInner2({
|
|
12008
12055
|
children,
|
|
12009
12056
|
style: style2,
|
|
12010
12057
|
className
|
|
12011
12058
|
}) {
|
|
12012
|
-
return /* @__PURE__ */
|
|
12059
|
+
return /* @__PURE__ */ React83.createElement("div", { style: style2, className: cx("absolute inset-0 flex", className) }, children);
|
|
12013
12060
|
});
|
|
12014
12061
|
|
|
12015
12062
|
// src/hooks/usePlatform.ts
|
|
@@ -12162,11 +12209,11 @@ var SUPPORTED_CANVAS_UPLOAD_TYPES = [
|
|
|
12162
12209
|
|
|
12163
12210
|
// src/components/DimensionInput.tsx
|
|
12164
12211
|
import { round } from "@noya-app/noya-utils";
|
|
12165
|
-
import * as
|
|
12212
|
+
import * as React84 from "react";
|
|
12166
12213
|
function getNewValue(value, mode, delta) {
|
|
12167
12214
|
return delta === void 0 ? value : mode === "replace" ? delta : value + delta;
|
|
12168
12215
|
}
|
|
12169
|
-
var DimensionInput =
|
|
12216
|
+
var DimensionInput = React84.memo(function DimensionInput2({
|
|
12170
12217
|
id,
|
|
12171
12218
|
value,
|
|
12172
12219
|
onSetValue,
|
|
@@ -12176,15 +12223,15 @@ var DimensionInput = React83.memo(function DimensionInput2({
|
|
|
12176
12223
|
disabled,
|
|
12177
12224
|
trigger = "submit"
|
|
12178
12225
|
}) {
|
|
12179
|
-
const handleNudgeValue =
|
|
12226
|
+
const handleNudgeValue = React84.useCallback(
|
|
12180
12227
|
(value2) => onSetValue(value2, "adjust"),
|
|
12181
12228
|
[onSetValue]
|
|
12182
12229
|
);
|
|
12183
|
-
const handleSetValue =
|
|
12230
|
+
const handleSetValue = React84.useCallback(
|
|
12184
12231
|
(value2) => onSetValue(value2, "replace"),
|
|
12185
12232
|
[onSetValue]
|
|
12186
12233
|
);
|
|
12187
|
-
return /* @__PURE__ */
|
|
12234
|
+
return /* @__PURE__ */ React84.createElement(LabeledField, { label, labelPosition: "inset" }, /* @__PURE__ */ React84.createElement(InputField2.Root, { id, width: size2 }, /* @__PURE__ */ React84.createElement(
|
|
12188
12235
|
InputField2.NumberInput,
|
|
12189
12236
|
{
|
|
12190
12237
|
value: value === void 0 ? value : round(value, 2),
|
|
@@ -12211,11 +12258,11 @@ __export(InspectorPrimitives_exports, {
|
|
|
12211
12258
|
Title: () => Title4,
|
|
12212
12259
|
VerticalSeparator: () => VerticalSeparator
|
|
12213
12260
|
});
|
|
12214
|
-
import
|
|
12215
|
-
forwardRef as
|
|
12216
|
-
memo as
|
|
12261
|
+
import React85, {
|
|
12262
|
+
forwardRef as forwardRef28,
|
|
12263
|
+
memo as memo40
|
|
12217
12264
|
} from "react";
|
|
12218
|
-
var Section2 =
|
|
12265
|
+
var Section2 = forwardRef28(({ className, ...props }, ref) => /* @__PURE__ */ React85.createElement(
|
|
12219
12266
|
"div",
|
|
12220
12267
|
{
|
|
12221
12268
|
ref,
|
|
@@ -12223,8 +12270,8 @@ var Section2 = forwardRef29(({ className, ...props }, ref) => /* @__PURE__ */ Re
|
|
|
12223
12270
|
...props
|
|
12224
12271
|
}
|
|
12225
12272
|
));
|
|
12226
|
-
var SectionHeader3 =
|
|
12227
|
-
var Title4 =
|
|
12273
|
+
var SectionHeader3 = forwardRef28(({ className, ...props }, ref) => /* @__PURE__ */ React85.createElement("div", { ref, className: cx(`flex items-center `, className), ...props }));
|
|
12274
|
+
var Title4 = forwardRef28(({ className, $textStyle, ...props }, ref) => /* @__PURE__ */ React85.createElement(
|
|
12228
12275
|
"div",
|
|
12229
12276
|
{
|
|
12230
12277
|
ref,
|
|
@@ -12235,7 +12282,7 @@ var Title4 = forwardRef29(({ className, $textStyle, ...props }, ref) => /* @__PU
|
|
|
12235
12282
|
...props
|
|
12236
12283
|
}
|
|
12237
12284
|
));
|
|
12238
|
-
var Row =
|
|
12285
|
+
var Row = forwardRef28(({ className, ...props }, ref) => /* @__PURE__ */ React85.createElement(
|
|
12239
12286
|
"div",
|
|
12240
12287
|
{
|
|
12241
12288
|
ref,
|
|
@@ -12243,7 +12290,7 @@ var Row = forwardRef29(({ className, ...props }, ref) => /* @__PURE__ */ React84
|
|
|
12243
12290
|
...props
|
|
12244
12291
|
}
|
|
12245
12292
|
));
|
|
12246
|
-
var Column =
|
|
12293
|
+
var Column = forwardRef28(({ className, ...props }, ref) => /* @__PURE__ */ React85.createElement(
|
|
12247
12294
|
"div",
|
|
12248
12295
|
{
|
|
12249
12296
|
ref,
|
|
@@ -12251,7 +12298,7 @@ var Column = forwardRef29(({ className, ...props }, ref) => /* @__PURE__ */ Reac
|
|
|
12251
12298
|
...props
|
|
12252
12299
|
}
|
|
12253
12300
|
));
|
|
12254
|
-
var Checkbox3 =
|
|
12301
|
+
var Checkbox3 = forwardRef28(({ className, ...props }, ref) => /* @__PURE__ */ React85.createElement(
|
|
12255
12302
|
"input",
|
|
12256
12303
|
{
|
|
12257
12304
|
ref,
|
|
@@ -12260,7 +12307,7 @@ var Checkbox3 = forwardRef29(({ className, ...props }, ref) => /* @__PURE__ */ R
|
|
|
12260
12307
|
...props
|
|
12261
12308
|
}
|
|
12262
12309
|
));
|
|
12263
|
-
var Text3 =
|
|
12310
|
+
var Text3 = forwardRef28(({ className, ...props }, ref) => /* @__PURE__ */ React85.createElement(
|
|
12264
12311
|
"span",
|
|
12265
12312
|
{
|
|
12266
12313
|
ref,
|
|
@@ -12268,14 +12315,14 @@ var Text3 = forwardRef29(({ className, ...props }, ref) => /* @__PURE__ */ React
|
|
|
12268
12315
|
...props
|
|
12269
12316
|
}
|
|
12270
12317
|
));
|
|
12271
|
-
var VerticalSeparator = () => /* @__PURE__ */
|
|
12272
|
-
var HorizontalSeparator = () => /* @__PURE__ */
|
|
12273
|
-
var RowLabel =
|
|
12318
|
+
var VerticalSeparator = () => /* @__PURE__ */ React85.createElement(Spacer.Vertical, { size: "inspector-v-separator" });
|
|
12319
|
+
var HorizontalSeparator = () => /* @__PURE__ */ React85.createElement(Spacer.Horizontal, { size: "inspector-h-separator" });
|
|
12320
|
+
var RowLabel = forwardRef28(function RowLabel2({
|
|
12274
12321
|
className,
|
|
12275
12322
|
$textStyle,
|
|
12276
12323
|
...props
|
|
12277
12324
|
}, ref) {
|
|
12278
|
-
return /* @__PURE__ */
|
|
12325
|
+
return /* @__PURE__ */ React85.createElement(
|
|
12279
12326
|
"label",
|
|
12280
12327
|
{
|
|
12281
12328
|
ref,
|
|
@@ -12287,7 +12334,7 @@ var RowLabel = forwardRef29(function RowLabel2({
|
|
|
12287
12334
|
}
|
|
12288
12335
|
);
|
|
12289
12336
|
});
|
|
12290
|
-
var LabeledRow =
|
|
12337
|
+
var LabeledRow = memo40(function LabeledRow2({
|
|
12291
12338
|
id,
|
|
12292
12339
|
children,
|
|
12293
12340
|
label,
|
|
@@ -12295,11 +12342,11 @@ var LabeledRow = memo38(function LabeledRow2({
|
|
|
12295
12342
|
right,
|
|
12296
12343
|
className
|
|
12297
12344
|
}) {
|
|
12298
|
-
return /* @__PURE__ */
|
|
12345
|
+
return /* @__PURE__ */ React85.createElement(Row, { id, className }, /* @__PURE__ */ React85.createElement(Column, null, /* @__PURE__ */ React85.createElement(RowLabel, { $textStyle: labelTextStyle }, label, right && /* @__PURE__ */ React85.createElement(Spacer.Horizontal, null), right), /* @__PURE__ */ React85.createElement(Row, null, children)));
|
|
12299
12346
|
});
|
|
12300
12347
|
|
|
12301
12348
|
// src/components/BaseToolbar.tsx
|
|
12302
|
-
import
|
|
12349
|
+
import React86 from "react";
|
|
12303
12350
|
var toolbarStyle = {
|
|
12304
12351
|
[cssVarNames.colors.inputBackground]: "transparent"
|
|
12305
12352
|
};
|
|
@@ -12310,7 +12357,7 @@ function BaseToolbar({
|
|
|
12310
12357
|
logo,
|
|
12311
12358
|
showDivider = true
|
|
12312
12359
|
}) {
|
|
12313
|
-
return /* @__PURE__ */
|
|
12360
|
+
return /* @__PURE__ */ React86.createElement("div", { className: "flex flex-col", style: toolbarStyle }, /* @__PURE__ */ React86.createElement(
|
|
12314
12361
|
"div",
|
|
12315
12362
|
{
|
|
12316
12363
|
className: "flex items-center pr-2.5 bg-sidebar-background flex-none relative @container/toolbar",
|
|
@@ -12318,10 +12365,10 @@ function BaseToolbar({
|
|
|
12318
12365
|
flex: `0 0 ${cssVars.spacing.toolbarHeight}`
|
|
12319
12366
|
}
|
|
12320
12367
|
},
|
|
12321
|
-
logo && /* @__PURE__ */
|
|
12322
|
-
/* @__PURE__ */
|
|
12323
|
-
left && /* @__PURE__ */
|
|
12324
|
-
/* @__PURE__ */
|
|
12368
|
+
logo && /* @__PURE__ */ React86.createElement(React86.Fragment, null, logo, /* @__PURE__ */ React86.createElement(DividerVertical, null)),
|
|
12369
|
+
/* @__PURE__ */ React86.createElement(Spacer.Horizontal, { size: 10 }),
|
|
12370
|
+
left && /* @__PURE__ */ React86.createElement(React86.Fragment, null, /* @__PURE__ */ React86.createElement("div", { className: "flex gap-toolbar-separator" }, left), /* @__PURE__ */ React86.createElement(Spacer.Horizontal, { size: 10 })),
|
|
12371
|
+
/* @__PURE__ */ React86.createElement("div", { className: "flex items-center justify-center text-text-muted pointer-events-none @2xl/toolbar:absolute inset-0" }, /* @__PURE__ */ React86.createElement(
|
|
12325
12372
|
"div",
|
|
12326
12373
|
{
|
|
12327
12374
|
style: {
|
|
@@ -12333,16 +12380,57 @@ function BaseToolbar({
|
|
|
12333
12380
|
},
|
|
12334
12381
|
children
|
|
12335
12382
|
)),
|
|
12336
|
-
/* @__PURE__ */
|
|
12337
|
-
/* @__PURE__ */
|
|
12338
|
-
/* @__PURE__ */
|
|
12339
|
-
), showDivider && /* @__PURE__ */
|
|
12383
|
+
/* @__PURE__ */ React86.createElement(Spacer.Horizontal, null),
|
|
12384
|
+
/* @__PURE__ */ React86.createElement(Spacer.Horizontal, { size: 10 }),
|
|
12385
|
+
/* @__PURE__ */ React86.createElement("div", { className: "flex gap-toolbar-separator" }, right)
|
|
12386
|
+
), showDivider && /* @__PURE__ */ React86.createElement(Divider, { variant: "strong" }));
|
|
12340
12387
|
}
|
|
12341
12388
|
|
|
12342
12389
|
// src/components/Toolbar.tsx
|
|
12343
12390
|
import { DropdownChevronIcon as DropdownChevronIcon4 } from "@noya-app/noya-icons";
|
|
12344
12391
|
import { useKeyboardShortcuts as useKeyboardShortcuts4 } from "@noya-app/noya-keymap";
|
|
12345
|
-
import
|
|
12392
|
+
import React87 from "react";
|
|
12393
|
+
var ToolbarMenuDropdown = memoGeneric(function ToolbarMenuDropdown2({
|
|
12394
|
+
item,
|
|
12395
|
+
onSelectMenuItem
|
|
12396
|
+
}) {
|
|
12397
|
+
const [open, setOpen] = React87.useState(false);
|
|
12398
|
+
return /* @__PURE__ */ React87.createElement(
|
|
12399
|
+
DropdownMenu,
|
|
12400
|
+
{
|
|
12401
|
+
open,
|
|
12402
|
+
onOpenChange: setOpen,
|
|
12403
|
+
items: item.items,
|
|
12404
|
+
onSelect: (value) => {
|
|
12405
|
+
if (onSelectMenuItem && value) {
|
|
12406
|
+
onSelectMenuItem(value);
|
|
12407
|
+
}
|
|
12408
|
+
}
|
|
12409
|
+
},
|
|
12410
|
+
/* @__PURE__ */ React87.createElement(Button, { disabled: item.disabled, active: item.checked || open }, item.title, item.title && item.icon && /* @__PURE__ */ React87.createElement(Spacer.Horizontal, { inline: true, size: 6 }), item.icon && renderIcon(item.icon), /* @__PURE__ */ React87.createElement(Spacer.Horizontal, { size: 6 }), /* @__PURE__ */ React87.createElement(DropdownChevronIcon4, null))
|
|
12411
|
+
);
|
|
12412
|
+
});
|
|
12413
|
+
var ToolbarMenuButton = memoGeneric(function ToolbarMenuButton2({
|
|
12414
|
+
item,
|
|
12415
|
+
onSelectMenuItem
|
|
12416
|
+
}) {
|
|
12417
|
+
const content = /* @__PURE__ */ React87.createElement(
|
|
12418
|
+
Button,
|
|
12419
|
+
{
|
|
12420
|
+
disabled: item.disabled,
|
|
12421
|
+
active: item.checked,
|
|
12422
|
+
onClick: () => {
|
|
12423
|
+
if (onSelectMenuItem && item.value) {
|
|
12424
|
+
onSelectMenuItem(item.value);
|
|
12425
|
+
}
|
|
12426
|
+
}
|
|
12427
|
+
},
|
|
12428
|
+
item.title,
|
|
12429
|
+
item.title && item.icon && /* @__PURE__ */ React87.createElement(Spacer.Horizontal, { inline: true, size: 6 }),
|
|
12430
|
+
item.icon && renderIcon(item.icon)
|
|
12431
|
+
);
|
|
12432
|
+
return item.tooltip ? /* @__PURE__ */ React87.createElement(Tooltip, { sideOffset: 10, content: item.tooltip }, content) : content;
|
|
12433
|
+
});
|
|
12346
12434
|
function Toolbar({
|
|
12347
12435
|
children,
|
|
12348
12436
|
logo,
|
|
@@ -12351,28 +12439,28 @@ function Toolbar({
|
|
|
12351
12439
|
onSelectMenuItem,
|
|
12352
12440
|
shouldBindKeyboardShortcuts = true
|
|
12353
12441
|
}) {
|
|
12354
|
-
const allMenuItems =
|
|
12442
|
+
const allMenuItems = React87.useMemo(
|
|
12355
12443
|
() => [...leftMenuItems, ...rightMenuItems],
|
|
12356
12444
|
[leftMenuItems, rightMenuItems]
|
|
12357
12445
|
);
|
|
12358
12446
|
useKeyboardShortcuts4(
|
|
12359
|
-
|
|
12447
|
+
React87.useMemo(
|
|
12360
12448
|
() => onSelectMenuItem && shouldBindKeyboardShortcuts ? getKeyboardShortcutsForMenuItems(allMenuItems, onSelectMenuItem) : {},
|
|
12361
12449
|
[allMenuItems, onSelectMenuItem, shouldBindKeyboardShortcuts]
|
|
12362
12450
|
)
|
|
12363
12451
|
);
|
|
12364
|
-
return /* @__PURE__ */
|
|
12452
|
+
return /* @__PURE__ */ React87.createElement(
|
|
12365
12453
|
BaseToolbar,
|
|
12366
12454
|
{
|
|
12367
12455
|
logo,
|
|
12368
|
-
left: leftMenuItems.length > 0 && /* @__PURE__ */
|
|
12456
|
+
left: leftMenuItems.length > 0 && /* @__PURE__ */ React87.createElement("div", { className: "flex gap-2" }, /* @__PURE__ */ React87.createElement(
|
|
12369
12457
|
ToolbarMenu,
|
|
12370
12458
|
{
|
|
12371
12459
|
items: leftMenuItems,
|
|
12372
12460
|
onSelectMenuItem
|
|
12373
12461
|
}
|
|
12374
12462
|
)),
|
|
12375
|
-
right: rightMenuItems.length > 0 && /* @__PURE__ */
|
|
12463
|
+
right: rightMenuItems.length > 0 && /* @__PURE__ */ React87.createElement("div", { className: "flex gap-2" }, /* @__PURE__ */ React87.createElement(
|
|
12376
12464
|
ToolbarMenu,
|
|
12377
12465
|
{
|
|
12378
12466
|
items: rightMenuItems,
|
|
@@ -12383,61 +12471,32 @@ function Toolbar({
|
|
|
12383
12471
|
children
|
|
12384
12472
|
);
|
|
12385
12473
|
}
|
|
12386
|
-
var activeButtonStyle = {
|
|
12387
|
-
backgroundColor: cssVars.colors.primaryPastel,
|
|
12388
|
-
color: cssVars.colors.primary
|
|
12389
|
-
};
|
|
12390
12474
|
var ToolbarMenu = memoGeneric(function ToolbarMenu2({
|
|
12391
12475
|
items,
|
|
12392
12476
|
onSelectMenuItem
|
|
12393
12477
|
}) {
|
|
12394
|
-
return /* @__PURE__ */
|
|
12478
|
+
return /* @__PURE__ */ React87.createElement(React87.Fragment, null, items.map((item, i) => {
|
|
12395
12479
|
if (item.type === "sectionHeader") return null;
|
|
12396
12480
|
if (item.type === "separator") {
|
|
12397
|
-
return /* @__PURE__ */
|
|
12481
|
+
return /* @__PURE__ */ React87.createElement(DividerVertical, { key: i, overflow: 4 });
|
|
12398
12482
|
}
|
|
12399
12483
|
if (isSelectableMenuItem(item)) {
|
|
12400
|
-
|
|
12401
|
-
|
|
12484
|
+
return /* @__PURE__ */ React87.createElement(
|
|
12485
|
+
ToolbarMenuButton,
|
|
12402
12486
|
{
|
|
12403
12487
|
key: i,
|
|
12404
|
-
|
|
12405
|
-
|
|
12406
|
-
|
|
12407
|
-
if (onSelectMenuItem && item.value) {
|
|
12408
|
-
onSelectMenuItem(item.value);
|
|
12409
|
-
}
|
|
12410
|
-
}
|
|
12411
|
-
},
|
|
12412
|
-
item.title,
|
|
12413
|
-
item.title && item.icon && /* @__PURE__ */ React86.createElement(Spacer.Horizontal, { inline: true, size: 6 }),
|
|
12414
|
-
item.icon && renderIcon(item.icon)
|
|
12488
|
+
item,
|
|
12489
|
+
onSelectMenuItem
|
|
12490
|
+
}
|
|
12415
12491
|
);
|
|
12416
|
-
return item.tooltip ? /* @__PURE__ */ React86.createElement(Tooltip, { sideOffset: 10, content: item.tooltip, key: i }, content) : content;
|
|
12417
12492
|
}
|
|
12418
|
-
return /* @__PURE__ */
|
|
12419
|
-
|
|
12493
|
+
return /* @__PURE__ */ React87.createElement(
|
|
12494
|
+
ToolbarMenuDropdown,
|
|
12420
12495
|
{
|
|
12421
12496
|
key: i,
|
|
12422
|
-
|
|
12423
|
-
|
|
12424
|
-
|
|
12425
|
-
onSelectMenuItem(value);
|
|
12426
|
-
}
|
|
12427
|
-
}
|
|
12428
|
-
},
|
|
12429
|
-
/* @__PURE__ */ React86.createElement(
|
|
12430
|
-
Button,
|
|
12431
|
-
{
|
|
12432
|
-
disabled: item.disabled,
|
|
12433
|
-
style: item.checked ? activeButtonStyle : void 0
|
|
12434
|
-
},
|
|
12435
|
-
item.title,
|
|
12436
|
-
item.title && item.icon && /* @__PURE__ */ React86.createElement(Spacer.Horizontal, { inline: true, size: 6 }),
|
|
12437
|
-
item.icon && renderIcon(item.icon),
|
|
12438
|
-
/* @__PURE__ */ React86.createElement(Spacer.Horizontal, { size: 6 }),
|
|
12439
|
-
/* @__PURE__ */ React86.createElement(DropdownChevronIcon4, null)
|
|
12440
|
-
)
|
|
12497
|
+
item,
|
|
12498
|
+
onSelectMenuItem
|
|
12499
|
+
}
|
|
12441
12500
|
);
|
|
12442
12501
|
}));
|
|
12443
12502
|
});
|
|
@@ -12529,6 +12588,7 @@ export {
|
|
|
12529
12588
|
PipelineResultLayout,
|
|
12530
12589
|
PipelineResultLink,
|
|
12531
12590
|
Popover,
|
|
12591
|
+
PortalScopeProvider,
|
|
12532
12592
|
Progress,
|
|
12533
12593
|
RIGHT_SIDEBAR_ID,
|
|
12534
12594
|
SUPPORTED_CANVAS_UPLOAD_TYPES,
|
|
@@ -12539,7 +12599,7 @@ export {
|
|
|
12539
12599
|
SectionHeader,
|
|
12540
12600
|
SegmentedControl,
|
|
12541
12601
|
SelectMenu,
|
|
12542
|
-
|
|
12602
|
+
SelectionToolbarContainer,
|
|
12543
12603
|
Slider,
|
|
12544
12604
|
Small,
|
|
12545
12605
|
Sortable2 as Sortable,
|
|
@@ -12552,6 +12612,8 @@ export {
|
|
|
12552
12612
|
ToastProvider,
|
|
12553
12613
|
Toolbar,
|
|
12554
12614
|
ToolbarMenu,
|
|
12615
|
+
ToolbarMenuButton,
|
|
12616
|
+
ToolbarMenuDropdown,
|
|
12555
12617
|
Tooltip,
|
|
12556
12618
|
TreeView,
|
|
12557
12619
|
UserAvatar,
|
|
@@ -12570,6 +12632,7 @@ export {
|
|
|
12570
12632
|
fuzzyFilter,
|
|
12571
12633
|
fuzzyScore,
|
|
12572
12634
|
fuzzyTokenize,
|
|
12635
|
+
getClosestPortalScope,
|
|
12573
12636
|
getFieldSpacing,
|
|
12574
12637
|
getGradientBackground,
|
|
12575
12638
|
getGridSize,
|
|
@@ -12589,6 +12652,9 @@ export {
|
|
|
12589
12652
|
moveTreeItem,
|
|
12590
12653
|
normalizeListTargetIndex,
|
|
12591
12654
|
popoverStyle,
|
|
12655
|
+
portalScopeDataSetName,
|
|
12656
|
+
portalScopePropName,
|
|
12657
|
+
portalScopeProps,
|
|
12592
12658
|
renderIcon,
|
|
12593
12659
|
rgbaToSketchColor,
|
|
12594
12660
|
separator,
|
|
@@ -12621,6 +12687,7 @@ export {
|
|
|
12621
12687
|
useOpenInputDialog,
|
|
12622
12688
|
usePlatform,
|
|
12623
12689
|
usePlatformModKey,
|
|
12690
|
+
usePortalScopeId,
|
|
12624
12691
|
usePreservePanelSize,
|
|
12625
12692
|
useTheme,
|
|
12626
12693
|
validateDropIndicator,
|