@noya-app/noya-designsystem 0.1.53 → 0.1.55
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 +16 -0
- package/dist/index.css +1 -1
- package/dist/index.d.mts +35 -11
- package/dist/index.d.ts +35 -11
- package/dist/index.js +443 -315
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1061 -937
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
- package/src/components/Button.tsx +13 -0
- package/src/components/ColorSwatch.tsx +5 -2
- package/src/components/Dialog.tsx +3 -5
- package/src/components/Grid.tsx +3 -1
- package/src/components/GridView.tsx +1 -0
- package/src/components/InputField.tsx +10 -3
- package/src/components/Popover.tsx +68 -4
- package/src/components/SegmentedControl.tsx +47 -53
- package/src/components/SelectionToolbar.tsx +35 -22
- package/src/components/Slider.tsx +1 -1
- package/src/components/Toolbar.tsx +62 -48
- package/src/components/connected-users-menu/ConnectedUsersMenuLayout.tsx +3 -26
- package/src/components/internal/Menu.tsx +1 -1
- package/src/components/internal/SelectItem.tsx +24 -3
- package/src/contexts/DesignSystemConfiguration.tsx +8 -5
- package/src/contexts/OpenPortalsContext.tsx +67 -0
- package/src/index.css +2 -2
- package/src/index.tsx +1 -0
package/dist/index.js
CHANGED
|
@@ -113,6 +113,7 @@ __export(src_exports, {
|
|
|
113
113
|
MediaThumbnail: () => MediaThumbnail,
|
|
114
114
|
MenuViewport: () => MenuViewport,
|
|
115
115
|
Message: () => Message,
|
|
116
|
+
OpenPortalsProvider: () => OpenPortalsProvider,
|
|
116
117
|
PatternPreviewBackground: () => PatternPreviewBackground,
|
|
117
118
|
PipelineResultLayout: () => PipelineResultLayout,
|
|
118
119
|
PipelineResultLink: () => PipelineResultLink,
|
|
@@ -143,6 +144,7 @@ __export(src_exports, {
|
|
|
143
144
|
ToolbarMenu: () => ToolbarMenu,
|
|
144
145
|
ToolbarMenuButton: () => ToolbarMenuButton,
|
|
145
146
|
ToolbarMenuDropdown: () => ToolbarMenuDropdown,
|
|
147
|
+
ToolbarMenuItem: () => ToolbarMenuItem,
|
|
146
148
|
Tooltip: () => Tooltip,
|
|
147
149
|
TreeView: () => TreeView,
|
|
148
150
|
UserAvatar: () => UserAvatar,
|
|
@@ -204,6 +206,7 @@ __export(src_exports, {
|
|
|
204
206
|
useGlobalInputBlur: () => useGlobalInputBlur,
|
|
205
207
|
useGlobalInputBlurListener: () => useGlobalInputBlurListener,
|
|
206
208
|
useGlobalInputBlurTrigger: () => useGlobalInputBlurTrigger,
|
|
209
|
+
useHasOpenPortals: () => useHasOpenPortals,
|
|
207
210
|
useHover: () => useHover,
|
|
208
211
|
useImageData: () => useImageData,
|
|
209
212
|
useIndent: () => useIndent,
|
|
@@ -214,6 +217,7 @@ __export(src_exports, {
|
|
|
214
217
|
useOpenConfirmationDialog: () => useOpenConfirmationDialog,
|
|
215
218
|
useOpenDialog: () => useOpenDialog,
|
|
216
219
|
useOpenInputDialog: () => useOpenInputDialog,
|
|
220
|
+
useOpenPortalsControls: () => useOpenPortalsControls,
|
|
217
221
|
usePlatform: () => usePlatform,
|
|
218
222
|
usePlatformModKey: () => usePlatformModKey,
|
|
219
223
|
usePortalScopeId: () => usePortalScopeId,
|
|
@@ -675,14 +679,14 @@ var import_react32 = __toESM(require("react"));
|
|
|
675
679
|
|
|
676
680
|
// src/contexts/DesignSystemConfiguration.tsx
|
|
677
681
|
var import_noya_keymap = require("@noya-app/noya-keymap");
|
|
678
|
-
var
|
|
682
|
+
var React22 = __toESM(require("react"));
|
|
679
683
|
|
|
680
684
|
// src/components/Toast.tsx
|
|
681
685
|
var ToastPrimitive = __toESM(require("@radix-ui/react-toast"));
|
|
682
686
|
var import_react21 = __toESM(require("react"));
|
|
683
687
|
|
|
684
688
|
// src/components/IconButton.tsx
|
|
685
|
-
var
|
|
689
|
+
var React11 = __toESM(require("react"));
|
|
686
690
|
|
|
687
691
|
// src/components/Button.tsx
|
|
688
692
|
var import_react20 = __toESM(require("react"));
|
|
@@ -750,9 +754,58 @@ function mergeConflictingClassNames(classNames, options) {
|
|
|
750
754
|
return classNamesList.join(" ");
|
|
751
755
|
}
|
|
752
756
|
|
|
757
|
+
// src/components/Icons.tsx
|
|
758
|
+
var Icons = __toESM(require("@noya-app/noya-icons"));
|
|
759
|
+
var React6 = __toESM(require("react"));
|
|
760
|
+
function renderIcon(iconName) {
|
|
761
|
+
if (typeof iconName === "string") {
|
|
762
|
+
const Icon = Icons[iconName];
|
|
763
|
+
return /* @__PURE__ */ React6.createElement(Icon, null);
|
|
764
|
+
}
|
|
765
|
+
return iconName;
|
|
766
|
+
}
|
|
767
|
+
|
|
768
|
+
// src/components/Spacer.tsx
|
|
769
|
+
var React7 = __toESM(require("react"));
|
|
770
|
+
var SpacerVertical = React7.forwardRef(
|
|
771
|
+
({ size: size2, inline, ...props }, ref) => {
|
|
772
|
+
return /* @__PURE__ */ React7.createElement(
|
|
773
|
+
"span",
|
|
774
|
+
{
|
|
775
|
+
className: `${inline ? "inline-block" : "block"} ${size2 === void 0 ? "flex flex-1" : ""}`,
|
|
776
|
+
style: size2 ? {
|
|
777
|
+
minHeight: `${size2}px`
|
|
778
|
+
} : void 0,
|
|
779
|
+
...props,
|
|
780
|
+
ref
|
|
781
|
+
}
|
|
782
|
+
);
|
|
783
|
+
}
|
|
784
|
+
);
|
|
785
|
+
var SpacerHorizontal = React7.forwardRef(
|
|
786
|
+
({ size: size2, inline, ...props }, ref) => {
|
|
787
|
+
return /* @__PURE__ */ React7.createElement(
|
|
788
|
+
"span",
|
|
789
|
+
{
|
|
790
|
+
className: `${inline ? "inline-block" : "block"} ${size2 === void 0 ? "flex flex-1" : ""}`,
|
|
791
|
+
style: size2 ? {
|
|
792
|
+
minWidth: `${size2}px`
|
|
793
|
+
} : void 0,
|
|
794
|
+
...props,
|
|
795
|
+
ref
|
|
796
|
+
}
|
|
797
|
+
);
|
|
798
|
+
}
|
|
799
|
+
);
|
|
800
|
+
var Spacer;
|
|
801
|
+
((Spacer2) => {
|
|
802
|
+
Spacer2.Vertical = SpacerVertical;
|
|
803
|
+
Spacer2.Horizontal = SpacerHorizontal;
|
|
804
|
+
})(Spacer || (Spacer = {}));
|
|
805
|
+
|
|
753
806
|
// src/components/Tooltip.tsx
|
|
754
807
|
var TooltipPrimitive = __toESM(require("@radix-ui/react-tooltip"));
|
|
755
|
-
var
|
|
808
|
+
var React9 = __toESM(require("react"));
|
|
756
809
|
|
|
757
810
|
// src/components/Text.tsx
|
|
758
811
|
var import_react19 = __toESM(require("react"));
|
|
@@ -848,13 +901,13 @@ var Italic = ({ children }) => /* @__PURE__ */ import_react19.default.createElem
|
|
|
848
901
|
);
|
|
849
902
|
|
|
850
903
|
// src/components/Tooltip.tsx
|
|
851
|
-
var Tooltip =
|
|
904
|
+
var Tooltip = React9.memo(function Tooltip2({
|
|
852
905
|
children,
|
|
853
906
|
content,
|
|
854
907
|
sideOffset = 2
|
|
855
908
|
}) {
|
|
856
909
|
const portalScopeId = usePortalScopeId();
|
|
857
|
-
return /* @__PURE__ */
|
|
910
|
+
return /* @__PURE__ */ React9.createElement(TooltipPrimitive.Provider, null, /* @__PURE__ */ React9.createElement(TooltipPrimitive.Root, null, /* @__PURE__ */ React9.createElement(TooltipPrimitive.Trigger, { asChild: true }, children), /* @__PURE__ */ React9.createElement(TooltipPrimitive.Portal, null, /* @__PURE__ */ React9.createElement(
|
|
858
911
|
TooltipPrimitive.Content,
|
|
859
912
|
{
|
|
860
913
|
...portalScopeProps(portalScopeId),
|
|
@@ -891,6 +944,8 @@ var Button = (0, import_react20.forwardRef)(function Button2({
|
|
|
891
944
|
className,
|
|
892
945
|
style: style2,
|
|
893
946
|
tabIndex,
|
|
947
|
+
icon,
|
|
948
|
+
iconRight,
|
|
894
949
|
tooltip,
|
|
895
950
|
active = false,
|
|
896
951
|
disabled = false,
|
|
@@ -935,36 +990,29 @@ var Button = (0, import_react20.forwardRef)(function Button2({
|
|
|
935
990
|
className: "min-h-[19px] flex items-center flex-1 justify-center leading-[15px]",
|
|
936
991
|
style: contentStyle
|
|
937
992
|
},
|
|
938
|
-
|
|
993
|
+
icon && renderIcon(icon),
|
|
994
|
+
icon && children && /* @__PURE__ */ import_react20.default.createElement(Spacer.Horizontal, { inline: true, size: 6 }),
|
|
995
|
+
children,
|
|
996
|
+
iconRight && (icon || children) && /* @__PURE__ */ import_react20.default.createElement(Spacer.Horizontal, { inline: true, size: 6 }),
|
|
997
|
+
iconRight && renderIcon(iconRight)
|
|
939
998
|
)
|
|
940
999
|
);
|
|
941
1000
|
return tooltip ? /* @__PURE__ */ import_react20.default.createElement(Tooltip, { content: tooltip }, buttonElement) : buttonElement;
|
|
942
1001
|
});
|
|
943
1002
|
var Button_default = Button;
|
|
944
1003
|
|
|
945
|
-
// src/components/Icons.tsx
|
|
946
|
-
var Icons = __toESM(require("@noya-app/noya-icons"));
|
|
947
|
-
var React9 = __toESM(require("react"));
|
|
948
|
-
function renderIcon(iconName) {
|
|
949
|
-
if (typeof iconName === "string") {
|
|
950
|
-
const Icon = Icons[iconName];
|
|
951
|
-
return /* @__PURE__ */ React9.createElement(Icon, null);
|
|
952
|
-
}
|
|
953
|
-
return iconName;
|
|
954
|
-
}
|
|
955
|
-
|
|
956
1004
|
// src/components/IconButton.tsx
|
|
957
|
-
var IconButton =
|
|
958
|
-
|
|
1005
|
+
var IconButton = React11.memo(
|
|
1006
|
+
React11.forwardRef(function IconButton2({ selected, iconName, color, size: size2, contentStyle, ...props }, forwardedRef) {
|
|
959
1007
|
const Icon = Icons[iconName];
|
|
960
|
-
const style2 =
|
|
1008
|
+
const style2 = React11.useMemo(() => {
|
|
961
1009
|
return {
|
|
962
1010
|
padding: "0 2px",
|
|
963
1011
|
...size2 && { minHeight: size2 },
|
|
964
1012
|
...contentStyle
|
|
965
1013
|
};
|
|
966
1014
|
}, [contentStyle, size2]);
|
|
967
|
-
return /* @__PURE__ */
|
|
1015
|
+
return /* @__PURE__ */ React11.createElement(Button, { ref: forwardedRef, ...props, variant: "none", contentStyle: style2 }, /* @__PURE__ */ React11.createElement(
|
|
968
1016
|
Icon,
|
|
969
1017
|
{
|
|
970
1018
|
color: color ?? (selected ? cssVars.colors.iconSelected : cssVars.colors.icon),
|
|
@@ -1013,46 +1061,6 @@ var import_react29 = __toESM(require("react"));
|
|
|
1013
1061
|
// src/components/Dialog.tsx
|
|
1014
1062
|
var DialogPrimitive = __toESM(require("@radix-ui/react-dialog"));
|
|
1015
1063
|
var import_react22 = __toESM(require("react"));
|
|
1016
|
-
|
|
1017
|
-
// src/components/Spacer.tsx
|
|
1018
|
-
var React12 = __toESM(require("react"));
|
|
1019
|
-
var SpacerVertical = React12.forwardRef(
|
|
1020
|
-
({ size: size2, inline, ...props }, ref) => {
|
|
1021
|
-
return /* @__PURE__ */ React12.createElement(
|
|
1022
|
-
"span",
|
|
1023
|
-
{
|
|
1024
|
-
className: `${inline ? "inline-block" : "block"} ${size2 === void 0 ? "flex flex-1" : ""}`,
|
|
1025
|
-
style: size2 ? {
|
|
1026
|
-
minHeight: `${size2}px`
|
|
1027
|
-
} : void 0,
|
|
1028
|
-
...props,
|
|
1029
|
-
ref
|
|
1030
|
-
}
|
|
1031
|
-
);
|
|
1032
|
-
}
|
|
1033
|
-
);
|
|
1034
|
-
var SpacerHorizontal = React12.forwardRef(
|
|
1035
|
-
({ size: size2, inline, ...props }, ref) => {
|
|
1036
|
-
return /* @__PURE__ */ React12.createElement(
|
|
1037
|
-
"span",
|
|
1038
|
-
{
|
|
1039
|
-
className: `${inline ? "inline-block" : "block"} ${size2 === void 0 ? "flex flex-1" : ""}`,
|
|
1040
|
-
style: size2 ? {
|
|
1041
|
-
minWidth: `${size2}px`
|
|
1042
|
-
} : void 0,
|
|
1043
|
-
...props,
|
|
1044
|
-
ref
|
|
1045
|
-
}
|
|
1046
|
-
);
|
|
1047
|
-
}
|
|
1048
|
-
);
|
|
1049
|
-
var Spacer;
|
|
1050
|
-
((Spacer2) => {
|
|
1051
|
-
Spacer2.Vertical = SpacerVertical;
|
|
1052
|
-
Spacer2.Horizontal = SpacerHorizontal;
|
|
1053
|
-
})(Spacer || (Spacer = {}));
|
|
1054
|
-
|
|
1055
|
-
// src/components/Dialog.tsx
|
|
1056
1064
|
var StyledOverlay = (0, import_react22.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ import_react22.default.createElement(
|
|
1057
1065
|
DialogPrimitive.Overlay,
|
|
1058
1066
|
{
|
|
@@ -1067,9 +1075,8 @@ var StyledContent = (0, import_react22.forwardRef)(({ className, children, ...pr
|
|
|
1067
1075
|
{
|
|
1068
1076
|
ref,
|
|
1069
1077
|
className: cx(
|
|
1070
|
-
`
|
|
1071
|
-
|
|
1072
|
-
w-[90vw] max-w-[450px] max-h-[85vh] p-dialog-padding rounded-[2px]
|
|
1078
|
+
`fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2
|
|
1079
|
+
w-[90vw] max-w-[550px] max-h-[85vh] p-dialog-padding rounded-[2px]
|
|
1073
1080
|
font-sans text-heading5 font-normal leading-[19px] text-text-muted
|
|
1074
1081
|
bg-popover-background pointer-events-all z-[1000] focus:outline-none
|
|
1075
1082
|
shadow-dialog-shadow
|
|
@@ -1087,7 +1094,7 @@ var StyledTitle = (0, import_react22.forwardRef)(({ className, ...props }, ref)
|
|
|
1087
1094
|
{
|
|
1088
1095
|
ref,
|
|
1089
1096
|
className: cx(
|
|
1090
|
-
`m-0 font-sans text-
|
|
1097
|
+
`m-0 font-sans text-heading3 font-medium leading-[1.4] text-text `,
|
|
1091
1098
|
className
|
|
1092
1099
|
),
|
|
1093
1100
|
...props
|
|
@@ -1148,7 +1155,7 @@ var Dialog = (0, import_react22.forwardRef)(function Dialog2({
|
|
|
1148
1155
|
}
|
|
1149
1156
|
)),
|
|
1150
1157
|
title && /* @__PURE__ */ import_react22.default.createElement(import_react22.default.Fragment, null, /* @__PURE__ */ import_react22.default.createElement(StyledTitle, null, title), /* @__PURE__ */ import_react22.default.createElement(Spacer.Vertical, { size: description ? 10 : 20 })),
|
|
1151
|
-
description && /* @__PURE__ */ import_react22.default.createElement(import_react22.default.Fragment, null, /* @__PURE__ */ import_react22.default.createElement(
|
|
1158
|
+
description && /* @__PURE__ */ import_react22.default.createElement(import_react22.default.Fragment, null, /* @__PURE__ */ import_react22.default.createElement(StyledDescription, null, description), /* @__PURE__ */ import_react22.default.createElement(Spacer.Vertical, { size: 20 })),
|
|
1152
1159
|
children
|
|
1153
1160
|
));
|
|
1154
1161
|
});
|
|
@@ -1501,6 +1508,47 @@ var Label = (0, import_react26.memo)(
|
|
|
1501
1508
|
// src/components/Popover.tsx
|
|
1502
1509
|
var PopoverPrimitive = __toESM(require("@radix-ui/react-popover"));
|
|
1503
1510
|
var import_react27 = __toESM(require("react"));
|
|
1511
|
+
|
|
1512
|
+
// src/contexts/OpenPortalsContext.tsx
|
|
1513
|
+
var React17 = __toESM(require("react"));
|
|
1514
|
+
var OpenPortalsContext = React17.createContext({
|
|
1515
|
+
hasOpenPortals: false
|
|
1516
|
+
});
|
|
1517
|
+
var OpenPortalControlsContext = React17.createContext({
|
|
1518
|
+
addOpenPortal: () => {
|
|
1519
|
+
},
|
|
1520
|
+
removeOpenPortal: () => {
|
|
1521
|
+
}
|
|
1522
|
+
});
|
|
1523
|
+
var OpenPortalsProvider = React17.memo(function OpenPortalsProvider2({
|
|
1524
|
+
children
|
|
1525
|
+
}) {
|
|
1526
|
+
const [openPortals, setOpenPortals] = React17.useState([]);
|
|
1527
|
+
const value = React17.useMemo(
|
|
1528
|
+
() => ({ hasOpenPortals: openPortals.length > 0 }),
|
|
1529
|
+
[openPortals]
|
|
1530
|
+
);
|
|
1531
|
+
const controlsValue = React17.useMemo(
|
|
1532
|
+
() => ({
|
|
1533
|
+
addOpenPortal: (portal) => {
|
|
1534
|
+
setOpenPortals((prev) => [...prev, portal]);
|
|
1535
|
+
},
|
|
1536
|
+
removeOpenPortal: (portal) => {
|
|
1537
|
+
setOpenPortals((prev) => prev.filter((p) => p !== portal));
|
|
1538
|
+
}
|
|
1539
|
+
}),
|
|
1540
|
+
[]
|
|
1541
|
+
);
|
|
1542
|
+
return /* @__PURE__ */ React17.createElement(OpenPortalsContext.Provider, { value }, /* @__PURE__ */ React17.createElement(OpenPortalControlsContext.Provider, { value: controlsValue }, children));
|
|
1543
|
+
});
|
|
1544
|
+
function useHasOpenPortals() {
|
|
1545
|
+
return React17.useContext(OpenPortalsContext).hasOpenPortals;
|
|
1546
|
+
}
|
|
1547
|
+
function useOpenPortalsControls() {
|
|
1548
|
+
return React17.useContext(OpenPortalControlsContext);
|
|
1549
|
+
}
|
|
1550
|
+
|
|
1551
|
+
// src/components/Popover.tsx
|
|
1504
1552
|
var closeStyles = {
|
|
1505
1553
|
all: "unset",
|
|
1506
1554
|
fontFamily: "inherit"
|
|
@@ -1526,13 +1574,30 @@ function Popover({
|
|
|
1526
1574
|
onInteractOutside,
|
|
1527
1575
|
onFocusOutside,
|
|
1528
1576
|
onClickClose,
|
|
1529
|
-
className
|
|
1577
|
+
className,
|
|
1578
|
+
portalContainer
|
|
1530
1579
|
}) {
|
|
1580
|
+
const defaultId = (0, import_react27.useId)();
|
|
1531
1581
|
const portalScopeId = usePortalScopeId();
|
|
1532
|
-
|
|
1582
|
+
const contentRef = (0, import_react27.useRef)(null);
|
|
1583
|
+
const [isOpen, setIsOpen] = useControlledOrUncontrolled({
|
|
1584
|
+
value: open,
|
|
1585
|
+
onChange: onOpenChange,
|
|
1586
|
+
defaultValue: false
|
|
1587
|
+
});
|
|
1588
|
+
const { addOpenPortal, removeOpenPortal } = useOpenPortalsControls();
|
|
1589
|
+
(0, import_react27.useEffect)(() => {
|
|
1590
|
+
if (!isOpen) return;
|
|
1591
|
+
addOpenPortal(portalScopeId || defaultId);
|
|
1592
|
+
return () => {
|
|
1593
|
+
removeOpenPortal(portalScopeId || defaultId);
|
|
1594
|
+
};
|
|
1595
|
+
}, [addOpenPortal, isOpen, portalScopeId, removeOpenPortal, defaultId]);
|
|
1596
|
+
return /* @__PURE__ */ import_react27.default.createElement(PopoverPrimitive.Root, { open: isOpen, onOpenChange: setIsOpen }, /* @__PURE__ */ import_react27.default.createElement(PopoverPrimitive.Trigger, { asChild: true }, trigger), /* @__PURE__ */ import_react27.default.createElement(PopoverPrimitive.Portal, { container: portalContainer }, /* @__PURE__ */ import_react27.default.createElement(
|
|
1533
1597
|
PopoverPrimitive.Content,
|
|
1534
1598
|
{
|
|
1535
1599
|
...portalScopeProps(portalScopeId),
|
|
1600
|
+
ref: contentRef,
|
|
1536
1601
|
className: cx(
|
|
1537
1602
|
popoverStyle.base,
|
|
1538
1603
|
variant === "large" && popoverStyle.large,
|
|
@@ -1546,7 +1611,15 @@ function Popover({
|
|
|
1546
1611
|
onCloseAutoFocus,
|
|
1547
1612
|
onInteractOutside,
|
|
1548
1613
|
onFocusOutside,
|
|
1549
|
-
onPointerDownOutside
|
|
1614
|
+
onPointerDownOutside: (event) => {
|
|
1615
|
+
if (isEventInsideElement(
|
|
1616
|
+
event.detail.originalEvent,
|
|
1617
|
+
contentRef.current
|
|
1618
|
+
)) {
|
|
1619
|
+
event.preventDefault();
|
|
1620
|
+
}
|
|
1621
|
+
onPointerDownOutside?.(event);
|
|
1622
|
+
},
|
|
1550
1623
|
collisionPadding: 8,
|
|
1551
1624
|
arrowPadding: 2
|
|
1552
1625
|
},
|
|
@@ -1562,6 +1635,19 @@ function Popover({
|
|
|
1562
1635
|
)
|
|
1563
1636
|
)));
|
|
1564
1637
|
}
|
|
1638
|
+
function isEventInsideElement(event, element) {
|
|
1639
|
+
if (!element) return false;
|
|
1640
|
+
const body = document.body;
|
|
1641
|
+
const originalPointerEvents = body.style.pointerEvents;
|
|
1642
|
+
body.style.pointerEvents = "auto";
|
|
1643
|
+
const elementsAtPoint = document.elementsFromPoint(
|
|
1644
|
+
event.clientX,
|
|
1645
|
+
event.clientY
|
|
1646
|
+
);
|
|
1647
|
+
body.style.pointerEvents = originalPointerEvents;
|
|
1648
|
+
const target = elementsAtPoint.at(0);
|
|
1649
|
+
return target && element.contains(target);
|
|
1650
|
+
}
|
|
1565
1651
|
|
|
1566
1652
|
// src/components/InputField.tsx
|
|
1567
1653
|
var InputFieldContext = (0, import_react28.createContext)({
|
|
@@ -1684,7 +1770,7 @@ var InputElement = (0, import_react28.forwardRef)(
|
|
|
1684
1770
|
readOnly ? "text-text-muted" : disabled ? "text-text-disabled" : "text-text",
|
|
1685
1771
|
"font-sans font-normal",
|
|
1686
1772
|
$textAlign && `text-${$textAlign}`,
|
|
1687
|
-
size2 === "small" ? "text-[11px] leading-[19px] py-[1px]" : size2 === "large" ? "py-2.5 text-heading5" : size2 === "medium" ? "py-1
|
|
1773
|
+
size2 === "small" ? "text-[11px] leading-[19px] py-[1px]" : size2 === "large" ? "py-2.5 text-heading5" : size2 === "medium" ? "py-1 text-heading5" : $variant === "bare" && "py-1 -m-1",
|
|
1688
1774
|
className
|
|
1689
1775
|
);
|
|
1690
1776
|
const mergedClassName = (0, import_react28.useMemo)(
|
|
@@ -1855,6 +1941,8 @@ function InputFieldRoot({
|
|
|
1855
1941
|
className,
|
|
1856
1942
|
start,
|
|
1857
1943
|
end,
|
|
1944
|
+
startClassName,
|
|
1945
|
+
endClassName,
|
|
1858
1946
|
label: labelProp
|
|
1859
1947
|
}) {
|
|
1860
1948
|
const randomId = (0, import_react28.useId)();
|
|
@@ -1895,7 +1983,15 @@ function InputFieldRoot({
|
|
|
1895
1983
|
() => /* @__PURE__ */ import_react28.default.createElement(Label, { htmlFor: id, className: "!text-text-disabled" }, labelProp ?? label),
|
|
1896
1984
|
[id, labelProp, label]
|
|
1897
1985
|
);
|
|
1898
|
-
const rootElement = /* @__PURE__ */ import_react28.default.createElement(RootContainer, { $width: width, style: style2, className }, children, start && /* @__PURE__ */ import_react28.default.createElement("span", { ref: startRef, className: startBaseStyles }, start), (end || label) && /* @__PURE__ */ import_react28.default.createElement(
|
|
1986
|
+
const rootElement = /* @__PURE__ */ import_react28.default.createElement(RootContainer, { $width: width, style: style2, className }, children, start && /* @__PURE__ */ import_react28.default.createElement("span", { ref: startRef, className: cx(startBaseStyles, startClassName) }, start), (end || label) && /* @__PURE__ */ import_react28.default.createElement(
|
|
1987
|
+
"span",
|
|
1988
|
+
{
|
|
1989
|
+
ref: endRef,
|
|
1990
|
+
className: cx(endStyles, label && end && "gap-1.5", endClassName)
|
|
1991
|
+
},
|
|
1992
|
+
labelProp ? insetLabel : label && labelPosition === "inset" && insetLabel,
|
|
1993
|
+
end
|
|
1994
|
+
));
|
|
1899
1995
|
const measuredWidthObject = (0, import_react28.useMemo)(
|
|
1900
1996
|
() => measuredInputSize ? { width: measuredInputSize.width + 4 } : void 0,
|
|
1901
1997
|
[measuredInputSize]
|
|
@@ -2277,30 +2373,30 @@ var useCurrentFloatingWindowInternal = () => {
|
|
|
2277
2373
|
};
|
|
2278
2374
|
|
|
2279
2375
|
// src/contexts/DesignSystemConfiguration.tsx
|
|
2280
|
-
var DesignSystemConfigurationContext =
|
|
2376
|
+
var DesignSystemConfigurationContext = React22.createContext({
|
|
2281
2377
|
platform: "key"
|
|
2282
2378
|
});
|
|
2283
|
-
var DesignSystemConfigurationProvider =
|
|
2379
|
+
var DesignSystemConfigurationProvider = React22.memo(
|
|
2284
2380
|
function DesignSystemConfigurationProvider2({
|
|
2285
2381
|
children,
|
|
2286
2382
|
platform
|
|
2287
2383
|
}) {
|
|
2288
|
-
const [internalPlatform, setInternalPlatform] =
|
|
2289
|
-
|
|
2384
|
+
const [internalPlatform, setInternalPlatform] = React22.useState(platform ?? "key");
|
|
2385
|
+
React22.useEffect(() => {
|
|
2290
2386
|
if (platform !== void 0) return;
|
|
2291
2387
|
if (typeof navigator !== "undefined") {
|
|
2292
2388
|
setInternalPlatform((0, import_noya_keymap.getCurrentPlatform)(navigator));
|
|
2293
2389
|
}
|
|
2294
2390
|
}, [platform]);
|
|
2295
|
-
const contextValue =
|
|
2391
|
+
const contextValue = React22.useMemo(
|
|
2296
2392
|
() => ({ platform: platform ?? internalPlatform }),
|
|
2297
2393
|
[platform, internalPlatform]
|
|
2298
2394
|
);
|
|
2299
|
-
return /* @__PURE__ */
|
|
2395
|
+
return /* @__PURE__ */ React22.createElement(DesignSystemConfigurationContext.Provider, { value: contextValue }, /* @__PURE__ */ React22.createElement(OpenPortalsProvider, null, /* @__PURE__ */ React22.createElement(DialogProvider, null, /* @__PURE__ */ React22.createElement(ToastProvider, null, /* @__PURE__ */ React22.createElement(FloatingWindowProvider, null, children)))));
|
|
2300
2396
|
}
|
|
2301
2397
|
);
|
|
2302
2398
|
function useDesignSystemConfiguration() {
|
|
2303
|
-
return
|
|
2399
|
+
return React22.useContext(DesignSystemConfigurationContext);
|
|
2304
2400
|
}
|
|
2305
2401
|
|
|
2306
2402
|
// src/utils/withSeparatorElements.ts
|
|
@@ -2355,7 +2451,7 @@ var getMenuItemKey = (item, index) => {
|
|
|
2355
2451
|
}
|
|
2356
2452
|
};
|
|
2357
2453
|
var CHECKBOX_WIDTH = 15;
|
|
2358
|
-
var CHECKBOX_RIGHT_INSET =
|
|
2454
|
+
var CHECKBOX_RIGHT_INSET = 6;
|
|
2359
2455
|
var CHECKBOX_INDENT_WIDTH = 6;
|
|
2360
2456
|
var styles = {
|
|
2361
2457
|
separatorStyle: "h-px bg-divider mx-3 my-1",
|
|
@@ -2454,11 +2550,10 @@ var SectionHeader = (0, import_react32.memo)(function SectionHeader2({
|
|
|
2454
2550
|
});
|
|
2455
2551
|
|
|
2456
2552
|
// src/components/internal/MenuViewport.tsx
|
|
2457
|
-
var
|
|
2553
|
+
var import_noya_icons2 = require("@noya-app/noya-icons");
|
|
2458
2554
|
var import_react34 = __toESM(require("react"));
|
|
2459
2555
|
|
|
2460
2556
|
// src/components/internal/SelectItem.tsx
|
|
2461
|
-
var import_noya_icons2 = require("@noya-app/noya-icons");
|
|
2462
2557
|
var import_react33 = __toESM(require("react"));
|
|
2463
2558
|
var SelectItem = import_react33.default.forwardRef(
|
|
2464
2559
|
({
|
|
@@ -2498,7 +2593,7 @@ var SelectItem = import_react33.default.forwardRef(
|
|
|
2498
2593
|
)
|
|
2499
2594
|
},
|
|
2500
2595
|
/* @__PURE__ */ import_react33.default.createElement(Spacer.Horizontal, { size: CHECKBOX_INDENT_WIDTH }),
|
|
2501
|
-
Components4.ItemIndicator && /* @__PURE__ */ import_react33.default.createElement(Components4.ItemIndicator, { ...styles.itemIndicator }, /* @__PURE__ */ import_react33.default.createElement(
|
|
2596
|
+
Components4.ItemIndicator && /* @__PURE__ */ import_react33.default.createElement(Components4.ItemIndicator, { ...styles.itemIndicator }, /* @__PURE__ */ import_react33.default.createElement(Checkmark, null)),
|
|
2502
2597
|
icon && /* @__PURE__ */ import_react33.default.createElement(import_react33.default.Fragment, null, renderIcon(icon), /* @__PURE__ */ import_react33.default.createElement(Spacer.Horizontal, { size: 8 })),
|
|
2503
2598
|
children,
|
|
2504
2599
|
shortcut && /* @__PURE__ */ import_react33.default.createElement(import_react33.default.Fragment, null, /* @__PURE__ */ import_react33.default.createElement(Spacer.Horizontal, null), /* @__PURE__ */ import_react33.default.createElement(Spacer.Horizontal, { size: 24 }), /* @__PURE__ */ import_react33.default.createElement(KeyboardShortcut, { shortcut }))
|
|
@@ -2519,10 +2614,34 @@ var SelectItem = import_react33.default.forwardRef(
|
|
|
2519
2614
|
onSelect: handleSelectItem,
|
|
2520
2615
|
...props
|
|
2521
2616
|
},
|
|
2522
|
-
/* @__PURE__ */ import_react33.default.createElement("div", { className: "flex flex-1 items-center" }, indented && /* @__PURE__ */ import_react33.default.createElement(Spacer.Horizontal, { size: CHECKBOX_INDENT_WIDTH }), checked ? /* @__PURE__ */ import_react33.default.createElement("div", { ...styles.itemIndicator }, /* @__PURE__ */ import_react33.default.createElement(
|
|
2617
|
+
/* @__PURE__ */ import_react33.default.createElement("div", { className: "flex flex-1 items-center" }, indented && /* @__PURE__ */ import_react33.default.createElement(Spacer.Horizontal, { size: CHECKBOX_INDENT_WIDTH }), checked ? /* @__PURE__ */ import_react33.default.createElement("div", { ...styles.itemIndicator }, /* @__PURE__ */ import_react33.default.createElement(Checkmark, null)) : indented ? /* @__PURE__ */ import_react33.default.createElement(Spacer.Horizontal, { size: CHECKBOX_WIDTH - CHECKBOX_RIGHT_INSET }) : null, icon && /* @__PURE__ */ import_react33.default.createElement(import_react33.default.Fragment, null, renderIcon(icon), /* @__PURE__ */ import_react33.default.createElement(Spacer.Horizontal, { size: 8 })), /* @__PURE__ */ import_react33.default.createElement(Components4.ItemText, null, children), shortcut && /* @__PURE__ */ import_react33.default.createElement(import_react33.default.Fragment, null, /* @__PURE__ */ import_react33.default.createElement(Spacer.Horizontal, null), /* @__PURE__ */ import_react33.default.createElement(Spacer.Horizontal, { size: 24 }), /* @__PURE__ */ import_react33.default.createElement(KeyboardShortcut, { shortcut })))
|
|
2523
2618
|
));
|
|
2524
2619
|
}
|
|
2525
2620
|
);
|
|
2621
|
+
function Checkmark() {
|
|
2622
|
+
return /* @__PURE__ */ import_react33.default.createElement(
|
|
2623
|
+
"svg",
|
|
2624
|
+
{
|
|
2625
|
+
viewBox: "0 0 15 15",
|
|
2626
|
+
fill: "none",
|
|
2627
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2628
|
+
"aria-hidden": "true",
|
|
2629
|
+
width: 15,
|
|
2630
|
+
height: 15
|
|
2631
|
+
},
|
|
2632
|
+
/* @__PURE__ */ import_react33.default.createElement(
|
|
2633
|
+
"path",
|
|
2634
|
+
{
|
|
2635
|
+
className: "scale-90 origin-center",
|
|
2636
|
+
d: "M3 8L6 11L12 5",
|
|
2637
|
+
strokeWidth: "1.1",
|
|
2638
|
+
strokeLinecap: "round",
|
|
2639
|
+
strokeLinejoin: "round",
|
|
2640
|
+
stroke: "currentColor"
|
|
2641
|
+
}
|
|
2642
|
+
)
|
|
2643
|
+
);
|
|
2644
|
+
}
|
|
2526
2645
|
|
|
2527
2646
|
// src/components/internal/MenuViewport.tsx
|
|
2528
2647
|
var MenuViewport = ({
|
|
@@ -2582,7 +2701,7 @@ var MenuViewport = ({
|
|
|
2582
2701
|
disabled: item.disabled
|
|
2583
2702
|
},
|
|
2584
2703
|
/* @__PURE__ */ import_react34.default.createElement("div", { className: "flex items-center flex-1" }, item.title),
|
|
2585
|
-
/* @__PURE__ */ import_react34.default.createElement(
|
|
2704
|
+
/* @__PURE__ */ import_react34.default.createElement(import_noya_icons2.ChevronRightIcon, { className: "-mr-1" })
|
|
2586
2705
|
)
|
|
2587
2706
|
), /* @__PURE__ */ import_react34.default.createElement(Components4.Portal, null, /* @__PURE__ */ import_react34.default.createElement(
|
|
2588
2707
|
Components4.SubContent,
|
|
@@ -2738,16 +2857,16 @@ var ActionMenu = memoGeneric(function ActionMenu2({
|
|
|
2738
2857
|
});
|
|
2739
2858
|
|
|
2740
2859
|
// src/components/ActivityIndicator.tsx
|
|
2741
|
-
var
|
|
2742
|
-
var ActivityIndicator =
|
|
2860
|
+
var React28 = __toESM(require("react"));
|
|
2861
|
+
var ActivityIndicator = React28.memo(function ActivityIndicator2({
|
|
2743
2862
|
size: size2 = 16,
|
|
2744
2863
|
opacity = 1,
|
|
2745
2864
|
color = "black",
|
|
2746
2865
|
trackColor = "rgba(0, 0, 0, 0.1)",
|
|
2747
2866
|
className
|
|
2748
2867
|
}) {
|
|
2749
|
-
const opacityStyle =
|
|
2750
|
-
const dynamicStyles =
|
|
2868
|
+
const opacityStyle = React28.useMemo(() => ({ opacity }), [opacity]);
|
|
2869
|
+
const dynamicStyles = React28.useMemo(
|
|
2751
2870
|
() => ({
|
|
2752
2871
|
border: `2px solid ${trackColor}`,
|
|
2753
2872
|
borderTopColor: color,
|
|
@@ -2756,13 +2875,13 @@ var ActivityIndicator = React27.memo(function ActivityIndicator2({
|
|
|
2756
2875
|
}),
|
|
2757
2876
|
[size2, color, trackColor]
|
|
2758
2877
|
);
|
|
2759
|
-
return /* @__PURE__ */
|
|
2878
|
+
return /* @__PURE__ */ React28.createElement(
|
|
2760
2879
|
"div",
|
|
2761
2880
|
{
|
|
2762
2881
|
className: cx("flex justify-center items-center", className),
|
|
2763
2882
|
style: opacityStyle
|
|
2764
2883
|
},
|
|
2765
|
-
/* @__PURE__ */
|
|
2884
|
+
/* @__PURE__ */ React28.createElement("div", { style: dynamicStyles, className: "animate-spin rounded-[50%]" })
|
|
2766
2885
|
);
|
|
2767
2886
|
});
|
|
2768
2887
|
|
|
@@ -3408,16 +3527,16 @@ var BreadcrumbSlash = () => {
|
|
|
3408
3527
|
};
|
|
3409
3528
|
|
|
3410
3529
|
// src/components/Checkbox.tsx
|
|
3411
|
-
var
|
|
3530
|
+
var React36 = __toESM(require("react"));
|
|
3412
3531
|
var colorSchemeStyles = {
|
|
3413
3532
|
normal: "text-text-subtle",
|
|
3414
3533
|
primary: "text-primary",
|
|
3415
3534
|
secondary: "text-secondary"
|
|
3416
3535
|
};
|
|
3417
|
-
var Checkbox =
|
|
3418
|
-
|
|
3536
|
+
var Checkbox = React36.memo(
|
|
3537
|
+
React36.forwardRef(function Checkbox2({ className, style: style2, colorScheme = "secondary", ...props }, ref) {
|
|
3419
3538
|
const { fieldId: id } = useLabel({ fieldId: props.id });
|
|
3420
|
-
return /* @__PURE__ */
|
|
3539
|
+
return /* @__PURE__ */ React36.createElement(
|
|
3421
3540
|
"div",
|
|
3422
3541
|
{
|
|
3423
3542
|
className: cx(
|
|
@@ -3427,7 +3546,7 @@ var Checkbox = React35.memo(
|
|
|
3427
3546
|
),
|
|
3428
3547
|
style: style2
|
|
3429
3548
|
},
|
|
3430
|
-
/* @__PURE__ */
|
|
3549
|
+
/* @__PURE__ */ React36.createElement(
|
|
3431
3550
|
"input",
|
|
3432
3551
|
{
|
|
3433
3552
|
ref,
|
|
@@ -3456,7 +3575,7 @@ var Checkbox = React35.memo(
|
|
|
3456
3575
|
id
|
|
3457
3576
|
}
|
|
3458
3577
|
),
|
|
3459
|
-
/* @__PURE__ */
|
|
3578
|
+
/* @__PURE__ */ React36.createElement(
|
|
3460
3579
|
"svg",
|
|
3461
3580
|
{
|
|
3462
3581
|
className: `
|
|
@@ -3476,7 +3595,7 @@ var Checkbox = React35.memo(
|
|
|
3476
3595
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3477
3596
|
"aria-hidden": "true"
|
|
3478
3597
|
},
|
|
3479
|
-
/* @__PURE__ */
|
|
3598
|
+
/* @__PURE__ */ React36.createElement(
|
|
3480
3599
|
"path",
|
|
3481
3600
|
{
|
|
3482
3601
|
d: "M3 6L4.5 7.5L8 4",
|
|
@@ -3491,11 +3610,11 @@ var Checkbox = React35.memo(
|
|
|
3491
3610
|
);
|
|
3492
3611
|
|
|
3493
3612
|
// src/components/Chip.tsx
|
|
3494
|
-
var
|
|
3613
|
+
var import_noya_icons3 = require("@noya-app/noya-icons");
|
|
3495
3614
|
var import_react45 = __toESM(require("react"));
|
|
3496
3615
|
|
|
3497
3616
|
// src/hooks/useHover.ts
|
|
3498
|
-
var
|
|
3617
|
+
var React37 = __toESM(require("react"));
|
|
3499
3618
|
var globalIgnoreEmulatedMouseEvents = false;
|
|
3500
3619
|
var hoverCount = 0;
|
|
3501
3620
|
function setGlobalIgnoreEmulatedMouseEvents() {
|
|
@@ -3525,13 +3644,13 @@ function setupGlobalTouchEvents() {
|
|
|
3525
3644
|
}
|
|
3526
3645
|
function useHover(props = {}) {
|
|
3527
3646
|
const { onHoverStart, onHoverChange, onHoverEnd, isDisabled } = props;
|
|
3528
|
-
const [isHovered, setHovered] =
|
|
3529
|
-
const state =
|
|
3647
|
+
const [isHovered, setHovered] = React37.useState(false);
|
|
3648
|
+
const state = React37.useRef({
|
|
3530
3649
|
isHovered: false,
|
|
3531
3650
|
ignoreEmulatedMouseEvents: false
|
|
3532
3651
|
}).current;
|
|
3533
|
-
|
|
3534
|
-
const hoverProps =
|
|
3652
|
+
React37.useEffect(setupGlobalTouchEvents, []);
|
|
3653
|
+
const hoverProps = React37.useMemo(
|
|
3535
3654
|
function getHoverProps() {
|
|
3536
3655
|
function triggerHoverStart(event, pointerType) {
|
|
3537
3656
|
if (isDisabled || pointerType === "touch" || state.isHovered) {
|
|
@@ -3688,7 +3807,7 @@ var Chip = (0, import_react45.memo)(
|
|
|
3688
3807
|
...rest
|
|
3689
3808
|
},
|
|
3690
3809
|
addable && /* @__PURE__ */ import_react45.default.createElement(
|
|
3691
|
-
|
|
3810
|
+
import_noya_icons3.PlusIcon,
|
|
3692
3811
|
{
|
|
3693
3812
|
className: cx(ICON_BASE_STYLES, ICON_SIZE_STYLES[size2].add),
|
|
3694
3813
|
onClick: onAdd && ((event) => {
|
|
@@ -3700,7 +3819,7 @@ var Chip = (0, import_react45.memo)(
|
|
|
3700
3819
|
),
|
|
3701
3820
|
children,
|
|
3702
3821
|
deletable && /* @__PURE__ */ import_react45.default.createElement(
|
|
3703
|
-
|
|
3822
|
+
import_noya_icons3.Cross1Icon,
|
|
3704
3823
|
{
|
|
3705
3824
|
className: cx(ICON_BASE_STYLES, ICON_SIZE_STYLES[size2].delete),
|
|
3706
3825
|
...hoverDeleteProps,
|
|
@@ -3930,26 +4049,26 @@ var ContextMenu = memoGeneric(ContextMenuRoot);
|
|
|
3930
4049
|
|
|
3931
4050
|
// src/components/ScrollArea.tsx
|
|
3932
4051
|
var RadixScrollArea = __toESM(require("@radix-ui/react-scroll-area"));
|
|
3933
|
-
var
|
|
3934
|
-
var ScrollArea =
|
|
3935
|
-
const [scrollElementRef, setScrollElementRef] =
|
|
3936
|
-
return /* @__PURE__ */
|
|
4052
|
+
var React41 = __toESM(require("react"));
|
|
4053
|
+
var ScrollArea = React41.memo(function ScrollArea2({ children }) {
|
|
4054
|
+
const [scrollElementRef, setScrollElementRef] = React41.useState(null);
|
|
4055
|
+
return /* @__PURE__ */ React41.createElement("div", { className: "flex-1 min-h-0" }, /* @__PURE__ */ React41.createElement(RadixScrollArea.Root, { style: { width: "100%", height: "100%" } }, /* @__PURE__ */ React41.createElement(
|
|
3937
4056
|
RadixScrollArea.Viewport,
|
|
3938
4057
|
{
|
|
3939
4058
|
className: "w-full h-full [&>div]:block",
|
|
3940
|
-
ref:
|
|
4059
|
+
ref: React41.useCallback(
|
|
3941
4060
|
(ref) => setScrollElementRef(ref),
|
|
3942
4061
|
[]
|
|
3943
4062
|
)
|
|
3944
4063
|
},
|
|
3945
4064
|
typeof children === "function" ? scrollElementRef ? children(scrollElementRef) : null : children
|
|
3946
|
-
), /* @__PURE__ */
|
|
4065
|
+
), /* @__PURE__ */ React41.createElement(
|
|
3947
4066
|
RadixScrollArea.Scrollbar,
|
|
3948
4067
|
{
|
|
3949
4068
|
orientation: "vertical",
|
|
3950
4069
|
className: "scroll-component flex p-[3px] data-[orientation=vertical]:w-[10px]"
|
|
3951
4070
|
},
|
|
3952
|
-
/* @__PURE__ */
|
|
4071
|
+
/* @__PURE__ */ React41.createElement(RadixScrollArea.Thumb, { className: "scroll-component flex-1 rounded-[10px] bg-scrollbar" })
|
|
3953
4072
|
)));
|
|
3954
4073
|
});
|
|
3955
4074
|
|
|
@@ -4078,7 +4197,7 @@ var GridViewItem = forwardRefGeneric(function GridViewItem2({
|
|
|
4078
4197
|
},
|
|
4079
4198
|
children
|
|
4080
4199
|
),
|
|
4081
|
-
textPosition === "below" && /* @__PURE__ */ import_react48.default.createElement(import_react48.default.Fragment, null, /* @__PURE__ */ import_react48.default.createElement(Spacer.Vertical, { size: 8 }), /* @__PURE__ */ import_react48.default.createElement(ItemTitle, null, title || " "), /* @__PURE__ */ import_react48.default.createElement(ItemDescription, null, subtitle || " ")),
|
|
4200
|
+
textPosition === "below" && /* @__PURE__ */ import_react48.default.createElement(import_react48.default.Fragment, null, /* @__PURE__ */ import_react48.default.createElement(Spacer.Vertical, { size: 8 }), /* @__PURE__ */ import_react48.default.createElement(ItemTitle, null, title || " "), /* @__PURE__ */ import_react48.default.createElement(Spacer.Vertical, { size: 2 }), /* @__PURE__ */ import_react48.default.createElement(ItemDescription, null, subtitle || " ")),
|
|
4082
4201
|
textPosition === "overlay" && hovered && (title || subtitle) && /* @__PURE__ */ import_react48.default.createElement("div", { className: "absolute inset-0 flex flex-col justify-end items-start p-1 pointer-events-none truncate gap-0.5" }, title && /* @__PURE__ */ import_react48.default.createElement(ItemTitle, { showBackground: true }, title), subtitle && /* @__PURE__ */ import_react48.default.createElement(ItemDescription, { showBackground: true }, subtitle)),
|
|
4083
4202
|
action && /* @__PURE__ */ import_react48.default.createElement("div", { className: "absolute top-[7px] right-[7px] flex flex-col justify-end items-start p-1 truncate gap-0.5" }, action),
|
|
4084
4203
|
loading && /* @__PURE__ */ import_react48.default.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__ */ import_react48.default.createElement(ActivityIndicator, { opacity: 0.5, size: 13 }))
|
|
@@ -4385,7 +4504,7 @@ var Grid = memoGeneric(
|
|
|
4385
4504
|
{
|
|
4386
4505
|
...props2,
|
|
4387
4506
|
className: cx(
|
|
4388
|
-
isSelected
|
|
4507
|
+
isSelected ? "text-selected-list-item-text" : "text-text",
|
|
4389
4508
|
"truncate select-none"
|
|
4390
4509
|
)
|
|
4391
4510
|
}
|
|
@@ -4478,7 +4597,7 @@ function mergeEventHandlers(...handlerMaps) {
|
|
|
4478
4597
|
// src/components/Sortable.tsx
|
|
4479
4598
|
var import_core = require("@dnd-kit/core");
|
|
4480
4599
|
var import_sortable = require("@dnd-kit/sortable");
|
|
4481
|
-
var
|
|
4600
|
+
var React44 = __toESM(require("react"));
|
|
4482
4601
|
var import_react50 = require("react");
|
|
4483
4602
|
var import_react_dom2 = require("react-dom");
|
|
4484
4603
|
var normalizeListTargetIndex = (index, position) => {
|
|
@@ -4492,7 +4611,7 @@ var defaultAcceptsDrop = (sourceIndex, targetIndex, position) => {
|
|
|
4492
4611
|
}
|
|
4493
4612
|
return true;
|
|
4494
4613
|
};
|
|
4495
|
-
var SortableItemContext =
|
|
4614
|
+
var SortableItemContext = React44.createContext({
|
|
4496
4615
|
keys: [],
|
|
4497
4616
|
acceptsDrop: defaultAcceptsDrop,
|
|
4498
4617
|
axis: "y",
|
|
@@ -4547,7 +4666,7 @@ function SortableItem({
|
|
|
4547
4666
|
setActivatorEvent,
|
|
4548
4667
|
axis,
|
|
4549
4668
|
getDropTargetParentIndex
|
|
4550
|
-
} =
|
|
4669
|
+
} = React44.useContext(SortableItemContext);
|
|
4551
4670
|
const sortable = (0, import_sortable.useSortable)({ id, disabled });
|
|
4552
4671
|
const { activatorEvent } = (0, import_core.useDndContext)();
|
|
4553
4672
|
const {
|
|
@@ -4568,7 +4687,7 @@ function SortableItem({
|
|
|
4568
4687
|
const eventY = activatorEvent?.clientY ?? 0;
|
|
4569
4688
|
const offsetLeft = eventX + position.x;
|
|
4570
4689
|
const offsetTop = eventY + position.y;
|
|
4571
|
-
const ref =
|
|
4690
|
+
const ref = React44.useCallback((node) => setNodeRef(node), [setNodeRef]);
|
|
4572
4691
|
const parentIndex = overIndex === -1 ? void 0 : getDropTargetParentIndex?.(overIndex);
|
|
4573
4692
|
const isValidParent = parentIndex === void 0 || parentIndex === -1 ? false : acceptsDrop2(activeIndex, parentIndex, "inside");
|
|
4574
4693
|
const overIdAcceptsDrop = overIndex === -1 ? void 0 : acceptsDrop2(activeIndex, overIndex, "inside");
|
|
@@ -4605,26 +4724,26 @@ function SortableRoot({
|
|
|
4605
4724
|
}
|
|
4606
4725
|
})
|
|
4607
4726
|
);
|
|
4608
|
-
const [activeIndex, setActiveIndex] =
|
|
4609
|
-
const activatorEvent =
|
|
4610
|
-
const [position, setPosition] =
|
|
4727
|
+
const [activeIndex, setActiveIndex] = React44.useState();
|
|
4728
|
+
const activatorEvent = React44.useRef(null);
|
|
4729
|
+
const [position, setPosition] = React44.useState({
|
|
4611
4730
|
x: 0,
|
|
4612
4731
|
y: 0
|
|
4613
4732
|
});
|
|
4614
|
-
const setActivatorEvent =
|
|
4733
|
+
const setActivatorEvent = React44.useCallback((event) => {
|
|
4615
4734
|
activatorEvent.current = event;
|
|
4616
4735
|
}, []);
|
|
4617
|
-
const handleDragStart =
|
|
4736
|
+
const handleDragStart = React44.useCallback(
|
|
4618
4737
|
(event) => {
|
|
4619
4738
|
const index = keys.findIndex((id) => id === event.active.id);
|
|
4620
4739
|
setActiveIndex(index);
|
|
4621
4740
|
},
|
|
4622
4741
|
[keys]
|
|
4623
4742
|
);
|
|
4624
|
-
const handleDragMove =
|
|
4743
|
+
const handleDragMove = React44.useCallback((event) => {
|
|
4625
4744
|
setPosition({ ...event.delta });
|
|
4626
4745
|
}, []);
|
|
4627
|
-
const handleDragEnd =
|
|
4746
|
+
const handleDragEnd = React44.useCallback(
|
|
4628
4747
|
(event) => {
|
|
4629
4748
|
const { active, over } = event;
|
|
4630
4749
|
setActiveIndex(void 0);
|
|
@@ -4651,14 +4770,14 @@ function SortableRoot({
|
|
|
4651
4770
|
},
|
|
4652
4771
|
[acceptsDrop2, axis, keys, onMoveItem, position.x, position.y]
|
|
4653
4772
|
);
|
|
4654
|
-
const [mounted, setMounted] =
|
|
4655
|
-
|
|
4773
|
+
const [mounted, setMounted] = React44.useState(false);
|
|
4774
|
+
React44.useEffect(() => {
|
|
4656
4775
|
setMounted(true);
|
|
4657
4776
|
}, []);
|
|
4658
|
-
return /* @__PURE__ */
|
|
4777
|
+
return /* @__PURE__ */ React44.createElement(
|
|
4659
4778
|
SortableItemContext.Provider,
|
|
4660
4779
|
{
|
|
4661
|
-
value:
|
|
4780
|
+
value: React44.useMemo(
|
|
4662
4781
|
() => ({
|
|
4663
4782
|
keys,
|
|
4664
4783
|
acceptsDrop: acceptsDrop2,
|
|
@@ -4677,7 +4796,7 @@ function SortableRoot({
|
|
|
4677
4796
|
]
|
|
4678
4797
|
)
|
|
4679
4798
|
},
|
|
4680
|
-
/* @__PURE__ */
|
|
4799
|
+
/* @__PURE__ */ React44.createElement(
|
|
4681
4800
|
import_core.DndContext,
|
|
4682
4801
|
{
|
|
4683
4802
|
sensors,
|
|
@@ -4686,7 +4805,7 @@ function SortableRoot({
|
|
|
4686
4805
|
onDragMove: handleDragMove,
|
|
4687
4806
|
onDragEnd: handleDragEnd
|
|
4688
4807
|
},
|
|
4689
|
-
/* @__PURE__ */
|
|
4808
|
+
/* @__PURE__ */ React44.createElement(
|
|
4690
4809
|
import_sortable.SortableContext,
|
|
4691
4810
|
{
|
|
4692
4811
|
items: keys,
|
|
@@ -4695,7 +4814,7 @@ function SortableRoot({
|
|
|
4695
4814
|
children
|
|
4696
4815
|
),
|
|
4697
4816
|
mounted && renderOverlay && (0, import_react_dom2.createPortal)(
|
|
4698
|
-
/* @__PURE__ */
|
|
4817
|
+
/* @__PURE__ */ React44.createElement(import_core.DragOverlay, { dropAnimation: null }, activeIndex !== void 0 && activeIndex >= 0 && renderOverlay(activeIndex)),
|
|
4699
4818
|
document.body
|
|
4700
4819
|
)
|
|
4701
4820
|
)
|
|
@@ -4713,11 +4832,11 @@ var SortableComponent = memoGeneric(function Sortable(props) {
|
|
|
4713
4832
|
shouldRenderOverlay = true,
|
|
4714
4833
|
...rest
|
|
4715
4834
|
} = props;
|
|
4716
|
-
const keys =
|
|
4835
|
+
const keys = React44.useMemo(
|
|
4717
4836
|
() => items.map(keyExtractor),
|
|
4718
4837
|
[items, keyExtractor]
|
|
4719
4838
|
);
|
|
4720
|
-
const renderOverlay =
|
|
4839
|
+
const renderOverlay = React44.useCallback(
|
|
4721
4840
|
(index) => {
|
|
4722
4841
|
return renderItem(
|
|
4723
4842
|
items[index],
|
|
@@ -4737,14 +4856,14 @@ var SortableComponent = memoGeneric(function Sortable(props) {
|
|
|
4737
4856
|
},
|
|
4738
4857
|
[renderItem, items]
|
|
4739
4858
|
);
|
|
4740
|
-
return /* @__PURE__ */
|
|
4859
|
+
return /* @__PURE__ */ React44.createElement(
|
|
4741
4860
|
SortableSubcomponents.Root,
|
|
4742
4861
|
{
|
|
4743
4862
|
...rest,
|
|
4744
4863
|
keys,
|
|
4745
4864
|
renderOverlay: shouldRenderOverlay ? renderOverlay : void 0
|
|
4746
4865
|
},
|
|
4747
|
-
keys.map((key, index) => /* @__PURE__ */
|
|
4866
|
+
keys.map((key, index) => /* @__PURE__ */ React44.createElement(SortableSubcomponents.Item, { key, id: key }, (props2) => {
|
|
4748
4867
|
return renderItem(
|
|
4749
4868
|
items[index],
|
|
4750
4869
|
props2,
|
|
@@ -5804,9 +5923,9 @@ var ColorSwatch = (0, import_react55.forwardRef)(function ColorSwatch2({ color,
|
|
|
5804
5923
|
width: sizePx,
|
|
5805
5924
|
height: sizePx,
|
|
5806
5925
|
borderRadius: "4px",
|
|
5807
|
-
outline: checked ?
|
|
5926
|
+
outline: checked ? `2px solid ${cssVars.colors.primary}` : "1px solid rgba(0,0,0,0.1)",
|
|
5808
5927
|
outlineOffset: -1,
|
|
5809
|
-
boxShadow: checked ? `inset 0 0 0 2px
|
|
5928
|
+
boxShadow: checked ? `inset 0 0 0 2px ${cssVars.colors.background}` : void 0,
|
|
5810
5929
|
...style2
|
|
5811
5930
|
}
|
|
5812
5931
|
}
|
|
@@ -5877,7 +5996,7 @@ function ColorSwatchControl(props) {
|
|
|
5877
5996
|
}
|
|
5878
5997
|
|
|
5879
5998
|
// src/components/Combobox.tsx
|
|
5880
|
-
var
|
|
5999
|
+
var import_noya_icons5 = require("@noya-app/noya-icons");
|
|
5881
6000
|
var import_react59 = __toESM(require("react"));
|
|
5882
6001
|
|
|
5883
6002
|
// src/utils/combobox.ts
|
|
@@ -6212,7 +6331,7 @@ function useComboboxState(state) {
|
|
|
6212
6331
|
}
|
|
6213
6332
|
|
|
6214
6333
|
// src/components/ComboboxMenu.tsx
|
|
6215
|
-
var
|
|
6334
|
+
var import_noya_icons4 = require("@noya-app/noya-icons");
|
|
6216
6335
|
var import_react58 = __toESM(require("react"));
|
|
6217
6336
|
var ComboboxMenu = memoGeneric(
|
|
6218
6337
|
forwardRefGeneric(function ComboboxMenu2({
|
|
@@ -6265,7 +6384,7 @@ var ComboboxMenu = memoGeneric(
|
|
|
6265
6384
|
}
|
|
6266
6385
|
}
|
|
6267
6386
|
},
|
|
6268
|
-
/* @__PURE__ */ import_react58.default.createElement("div", { className: "flex flex-1 min-w-0 items-center" }, indented && /* @__PURE__ */ import_react58.default.createElement(Spacer.Horizontal, { size: CHECKBOX_INDENT_WIDTH }), item.checked ? /* @__PURE__ */ import_react58.default.createElement("div", { ...styles.itemIndicator }, /* @__PURE__ */ import_react58.default.createElement(
|
|
6387
|
+
/* @__PURE__ */ import_react58.default.createElement("div", { className: "flex flex-1 min-w-0 items-center" }, indented && /* @__PURE__ */ import_react58.default.createElement(Spacer.Horizontal, { size: CHECKBOX_INDENT_WIDTH }), item.checked ? /* @__PURE__ */ import_react58.default.createElement("div", { ...styles.itemIndicator }, /* @__PURE__ */ import_react58.default.createElement(import_noya_icons4.CheckIcon, null)) : indented ? /* @__PURE__ */ import_react58.default.createElement(
|
|
6269
6388
|
Spacer.Horizontal,
|
|
6270
6389
|
{
|
|
6271
6390
|
size: CHECKBOX_WIDTH - CHECKBOX_RIGHT_INSET
|
|
@@ -6616,7 +6735,7 @@ var Combobox = memoGeneric(
|
|
|
6616
6735
|
onClick: handleChevronClick
|
|
6617
6736
|
},
|
|
6618
6737
|
/* @__PURE__ */ import_react59.default.createElement(
|
|
6619
|
-
|
|
6738
|
+
import_noya_icons5.DropdownChevronIcon,
|
|
6620
6739
|
{
|
|
6621
6740
|
className: cx(
|
|
6622
6741
|
"transition-transform duration-100",
|
|
@@ -6952,7 +7071,6 @@ var CommandPalette = (0, import_react62.memo)(function CommandPalette2({
|
|
|
6952
7071
|
});
|
|
6953
7072
|
|
|
6954
7073
|
// src/components/connected-users-menu/ConnectedUsersMenuLayout.tsx
|
|
6955
|
-
var import_noya_icons7 = require("@noya-app/noya-icons");
|
|
6956
7074
|
var import_react63 = __toESM(require("react"));
|
|
6957
7075
|
var UserAvatar = ({ userId, name, image }) => /* @__PURE__ */ import_react63.default.createElement(
|
|
6958
7076
|
Tooltip,
|
|
@@ -6964,38 +7082,22 @@ var UserAvatar = ({ userId, name, image }) => /* @__PURE__ */ import_react63.def
|
|
|
6964
7082
|
);
|
|
6965
7083
|
var ConnectedUsersMenuLayout = ({
|
|
6966
7084
|
renderUsers,
|
|
6967
|
-
currentUserId,
|
|
6968
7085
|
launchAIAssistant,
|
|
6969
7086
|
isAssistantOpen
|
|
6970
7087
|
}) => {
|
|
6971
|
-
return /* @__PURE__ */ import_react63.default.createElement("div", { className: "flex gap-1.5" }, /* @__PURE__ */ import_react63.default.createElement(AvatarStack, { size: INPUT_HEIGHT, className: "mr-1" }, renderUsers()), launchAIAssistant && /* @__PURE__ */ import_react63.default.createElement(
|
|
6972
|
-
|
|
7088
|
+
return /* @__PURE__ */ import_react63.default.createElement("div", { className: "flex gap-1.5" }, /* @__PURE__ */ import_react63.default.createElement(AvatarStack, { size: INPUT_HEIGHT, className: "mr-1" }, renderUsers()), launchAIAssistant && /* @__PURE__ */ import_react63.default.createElement(Tooltip, { content: "AI Assistant" }, /* @__PURE__ */ import_react63.default.createElement(
|
|
7089
|
+
Button_default,
|
|
6973
7090
|
{
|
|
6974
|
-
|
|
7091
|
+
active: isAssistantOpen,
|
|
7092
|
+
onClick: launchAIAssistant,
|
|
7093
|
+
icon: "ChatBubbleWithDotsIcon"
|
|
6975
7094
|
},
|
|
6976
|
-
|
|
6977
|
-
|
|
6978
|
-
{
|
|
6979
|
-
variant: isAssistantOpen ? "secondary" : void 0,
|
|
6980
|
-
onClick: launchAIAssistant,
|
|
6981
|
-
style: {
|
|
6982
|
-
backgroundColor: isAssistantOpen ? colorFromString(currentUserId ?? "") : void 0
|
|
6983
|
-
}
|
|
6984
|
-
},
|
|
6985
|
-
"AI",
|
|
6986
|
-
/* @__PURE__ */ import_react63.default.createElement(Spacer.Horizontal, { size: 8 }),
|
|
6987
|
-
/* @__PURE__ */ import_react63.default.createElement(
|
|
6988
|
-
import_noya_icons7.ChatBubbleWithDotsIcon,
|
|
6989
|
-
{
|
|
6990
|
-
color: isAssistantOpen ? void 0 : cssVars.colors.icon
|
|
6991
|
-
}
|
|
6992
|
-
)
|
|
6993
|
-
)
|
|
6994
|
-
));
|
|
7095
|
+
"AI"
|
|
7096
|
+
)));
|
|
6995
7097
|
};
|
|
6996
7098
|
|
|
6997
7099
|
// src/components/DraggableMenuButton.tsx
|
|
6998
|
-
var
|
|
7100
|
+
var import_noya_icons6 = require("@noya-app/noya-icons");
|
|
6999
7101
|
var import_react64 = __toESM(require("react"));
|
|
7000
7102
|
var DraggableMenuButton = memoGeneric(function DraggableMenuButton2({
|
|
7001
7103
|
items,
|
|
@@ -7068,13 +7170,13 @@ var DraggableMenuButton = memoGeneric(function DraggableMenuButton2({
|
|
|
7068
7170
|
shouldBindKeyboardShortcuts: false
|
|
7069
7171
|
},
|
|
7070
7172
|
/* @__PURE__ */ import_react64.default.createElement("div", { className: "pointer-events-none h-[15px]" }, /* @__PURE__ */ import_react64.default.createElement(
|
|
7071
|
-
|
|
7173
|
+
import_noya_icons6.DragHandleDots2Icon,
|
|
7072
7174
|
{
|
|
7073
7175
|
color: isVisible || open ? cssVars.colors.icon : "transparent"
|
|
7074
7176
|
}
|
|
7075
7177
|
))
|
|
7076
7178
|
) : /* @__PURE__ */ import_react64.default.createElement(
|
|
7077
|
-
|
|
7179
|
+
import_noya_icons6.DragHandleDots2Icon,
|
|
7078
7180
|
{
|
|
7079
7181
|
color: isVisible || open ? cssVars.colors.icon : "transparent"
|
|
7080
7182
|
}
|
|
@@ -7084,10 +7186,10 @@ var DraggableMenuButton = memoGeneric(function DraggableMenuButton2({
|
|
|
7084
7186
|
|
|
7085
7187
|
// src/components/Drawer.tsx
|
|
7086
7188
|
var Dialog3 = __toESM(require("@radix-ui/react-dialog"));
|
|
7087
|
-
var
|
|
7189
|
+
var React58 = __toESM(require("react"));
|
|
7088
7190
|
var import_react65 = require("react");
|
|
7089
|
-
var Drawer =
|
|
7090
|
-
|
|
7191
|
+
var Drawer = React58.memo(
|
|
7192
|
+
React58.forwardRef(function Drawer2({
|
|
7091
7193
|
open,
|
|
7092
7194
|
onOpenChange,
|
|
7093
7195
|
trigger,
|
|
@@ -7117,7 +7219,7 @@ var Drawer = React57.memo(
|
|
|
7117
7219
|
return internalOpen;
|
|
7118
7220
|
}
|
|
7119
7221
|
}));
|
|
7120
|
-
const inner = /* @__PURE__ */
|
|
7222
|
+
const inner = /* @__PURE__ */ React58.createElement(React58.Fragment, null, /* @__PURE__ */ React58.createElement(
|
|
7121
7223
|
Dialog3.Overlay,
|
|
7122
7224
|
{
|
|
7123
7225
|
className: cx(
|
|
@@ -7125,7 +7227,7 @@ var Drawer = React57.memo(
|
|
|
7125
7227
|
positioning === "absolute" ? "absolute" : "fixed"
|
|
7126
7228
|
)
|
|
7127
7229
|
}
|
|
7128
|
-
), /* @__PURE__ */
|
|
7230
|
+
), /* @__PURE__ */ React58.createElement(
|
|
7129
7231
|
Dialog3.Content,
|
|
7130
7232
|
{
|
|
7131
7233
|
id,
|
|
@@ -7137,18 +7239,18 @@ var Drawer = React57.memo(
|
|
|
7137
7239
|
className
|
|
7138
7240
|
)
|
|
7139
7241
|
},
|
|
7140
|
-
title && /* @__PURE__ */
|
|
7242
|
+
title && /* @__PURE__ */ React58.createElement(Dialog3.Title, null, title),
|
|
7141
7243
|
children
|
|
7142
7244
|
));
|
|
7143
|
-
return /* @__PURE__ */
|
|
7245
|
+
return /* @__PURE__ */ React58.createElement(
|
|
7144
7246
|
Dialog3.Root,
|
|
7145
7247
|
{
|
|
7146
7248
|
key: "dialog",
|
|
7147
7249
|
open: internalOpen,
|
|
7148
7250
|
onOpenChange: setInternalOpen
|
|
7149
7251
|
},
|
|
7150
|
-
/* @__PURE__ */
|
|
7151
|
-
portalled ? /* @__PURE__ */
|
|
7252
|
+
/* @__PURE__ */ React58.createElement(Dialog3.Trigger, { key: "trigger" }, trigger),
|
|
7253
|
+
portalled ? /* @__PURE__ */ React58.createElement(Dialog3.Portal, { container: portalContainer }, inner) : inner
|
|
7152
7254
|
);
|
|
7153
7255
|
})
|
|
7154
7256
|
);
|
|
@@ -7564,25 +7666,25 @@ var ClassValue = /* @__PURE__ */ ((ClassValue2) => {
|
|
|
7564
7666
|
})(ClassValue || {});
|
|
7565
7667
|
|
|
7566
7668
|
// src/components/FillPreviewBackground.tsx
|
|
7567
|
-
var
|
|
7669
|
+
var React62 = __toESM(require("react"));
|
|
7568
7670
|
|
|
7569
7671
|
// src/contexts/ImageDataContext.tsx
|
|
7570
|
-
var
|
|
7571
|
-
var ImageDataContext =
|
|
7672
|
+
var React61 = __toESM(require("react"));
|
|
7673
|
+
var ImageDataContext = React61.createContext(
|
|
7572
7674
|
void 0
|
|
7573
7675
|
);
|
|
7574
|
-
var ImageDataProvider =
|
|
7676
|
+
var ImageDataProvider = React61.memo(function ImageDataProvider2({
|
|
7575
7677
|
children,
|
|
7576
7678
|
getImageData
|
|
7577
7679
|
}) {
|
|
7578
|
-
const contextValue =
|
|
7680
|
+
const contextValue = React61.useMemo(
|
|
7579
7681
|
() => ({ getImageData: getImageData ?? (() => void 0) }),
|
|
7580
7682
|
[getImageData]
|
|
7581
7683
|
);
|
|
7582
|
-
return /* @__PURE__ */
|
|
7684
|
+
return /* @__PURE__ */ React61.createElement(ImageDataContext.Provider, { value: contextValue }, children);
|
|
7583
7685
|
});
|
|
7584
7686
|
function useImageData(ref) {
|
|
7585
|
-
const value =
|
|
7687
|
+
const value = React61.useContext(ImageDataContext);
|
|
7586
7688
|
if (!value) {
|
|
7587
7689
|
throw new Error("Missing ImageDataProvider");
|
|
7588
7690
|
}
|
|
@@ -7648,10 +7750,10 @@ var dotsHorizontalSvg = (fillColor) => `
|
|
|
7648
7750
|
<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>
|
|
7649
7751
|
</svg>
|
|
7650
7752
|
`;
|
|
7651
|
-
var Background =
|
|
7753
|
+
var Background = React62.memo(function Background2({
|
|
7652
7754
|
background: background2
|
|
7653
7755
|
}) {
|
|
7654
|
-
return /* @__PURE__ */
|
|
7756
|
+
return /* @__PURE__ */ React62.createElement(
|
|
7655
7757
|
"span",
|
|
7656
7758
|
{
|
|
7657
7759
|
className: `${background2 ? `bg-[${background2}]` : "bg-input-background"} absolute inset-0`
|
|
@@ -7670,7 +7772,7 @@ function getPatternSizeAndPosition(fillType, tileScale) {
|
|
|
7670
7772
|
return "center / 100% 100%";
|
|
7671
7773
|
}
|
|
7672
7774
|
}
|
|
7673
|
-
var PatternPreviewBackground =
|
|
7775
|
+
var PatternPreviewBackground = React62.memo(
|
|
7674
7776
|
function PatternPreviewBackground2({
|
|
7675
7777
|
fillType,
|
|
7676
7778
|
tileScale,
|
|
@@ -7679,7 +7781,7 @@ var PatternPreviewBackground = React61.memo(
|
|
|
7679
7781
|
const image = useImageData(imageRef);
|
|
7680
7782
|
const url = useObjectURL(image);
|
|
7681
7783
|
const size2 = getPatternSizeAndPosition(fillType, tileScale);
|
|
7682
|
-
const background2 =
|
|
7784
|
+
const background2 = React62.useMemo(
|
|
7683
7785
|
() => [
|
|
7684
7786
|
size2,
|
|
7685
7787
|
`url(${url})`,
|
|
@@ -7687,44 +7789,44 @@ var PatternPreviewBackground = React61.memo(
|
|
|
7687
7789
|
].join(" "),
|
|
7688
7790
|
[fillType, size2, url]
|
|
7689
7791
|
);
|
|
7690
|
-
return /* @__PURE__ */
|
|
7792
|
+
return /* @__PURE__ */ React62.createElement(Background, { background: background2 });
|
|
7691
7793
|
}
|
|
7692
7794
|
);
|
|
7693
|
-
var ColorPreviewBackground =
|
|
7795
|
+
var ColorPreviewBackground = React62.memo(function ColorPreviewBackground2({
|
|
7694
7796
|
color
|
|
7695
7797
|
}) {
|
|
7696
|
-
const background2 =
|
|
7798
|
+
const background2 = React62.useMemo(
|
|
7697
7799
|
() => sketchColorToRgbaString(color),
|
|
7698
7800
|
[color]
|
|
7699
7801
|
);
|
|
7700
|
-
return /* @__PURE__ */
|
|
7802
|
+
return /* @__PURE__ */ React62.createElement(Background, { background: background2 });
|
|
7701
7803
|
});
|
|
7702
|
-
var GradientPreviewBackground =
|
|
7804
|
+
var GradientPreviewBackground = React62.memo(
|
|
7703
7805
|
function GradientPreviewBackground2({
|
|
7704
7806
|
gradient
|
|
7705
7807
|
}) {
|
|
7706
|
-
const background2 =
|
|
7808
|
+
const background2 = React62.useMemo(
|
|
7707
7809
|
() => getGradientBackground(gradient.stops, gradient.gradientType, 180),
|
|
7708
7810
|
[gradient.gradientType, gradient.stops]
|
|
7709
7811
|
);
|
|
7710
|
-
return /* @__PURE__ */
|
|
7812
|
+
return /* @__PURE__ */ React62.createElement(Background, { background: background2 });
|
|
7711
7813
|
}
|
|
7712
7814
|
);
|
|
7713
7815
|
var background = `center url("data:image/svg+xml;utf8,${dotsHorizontalSvg(
|
|
7714
7816
|
cssVars.colors.placeholderDots
|
|
7715
7817
|
)}") no-repeat`;
|
|
7716
|
-
var FillPreviewBackground =
|
|
7818
|
+
var FillPreviewBackground = React62.memo(function FillPreviewBackground2({
|
|
7717
7819
|
value
|
|
7718
7820
|
}) {
|
|
7719
|
-
if (!value) return /* @__PURE__ */
|
|
7821
|
+
if (!value) return /* @__PURE__ */ React62.createElement(Background, { background });
|
|
7720
7822
|
switch (value._class) {
|
|
7721
7823
|
case "color":
|
|
7722
|
-
return /* @__PURE__ */
|
|
7824
|
+
return /* @__PURE__ */ React62.createElement(ColorPreviewBackground, { color: value });
|
|
7723
7825
|
case "gradient":
|
|
7724
|
-
return /* @__PURE__ */
|
|
7826
|
+
return /* @__PURE__ */ React62.createElement(GradientPreviewBackground, { gradient: value });
|
|
7725
7827
|
case "pattern":
|
|
7726
7828
|
if (!value.image) return null;
|
|
7727
|
-
return /* @__PURE__ */
|
|
7829
|
+
return /* @__PURE__ */ React62.createElement(
|
|
7728
7830
|
PatternPreviewBackground,
|
|
7729
7831
|
{
|
|
7730
7832
|
fillType: value.patternFillType,
|
|
@@ -8024,8 +8126,8 @@ var FloatingWindow = ({
|
|
|
8024
8126
|
|
|
8025
8127
|
// src/components/GradientPicker.tsx
|
|
8026
8128
|
var import_noya_colorpicker2 = require("@noya-app/noya-colorpicker");
|
|
8027
|
-
var
|
|
8028
|
-
var GradientPicker =
|
|
8129
|
+
var React65 = __toESM(require("react"));
|
|
8130
|
+
var GradientPicker = React65.memo(function GradientPicker2({
|
|
8029
8131
|
value,
|
|
8030
8132
|
selectedStop,
|
|
8031
8133
|
onChangeColor,
|
|
@@ -8034,7 +8136,7 @@ var GradientPicker = React64.memo(function GradientPicker2({
|
|
|
8034
8136
|
onDelete,
|
|
8035
8137
|
onSelectStop
|
|
8036
8138
|
}) {
|
|
8037
|
-
const colorModel =
|
|
8139
|
+
const colorModel = React65.useMemo(
|
|
8038
8140
|
() => ({
|
|
8039
8141
|
defaultColor: { r: 0, g: 0, b: 0, a: 1 },
|
|
8040
8142
|
toHsva: import_noya_colorpicker2.rgbaToHsva,
|
|
@@ -8043,30 +8145,30 @@ var GradientPicker = React64.memo(function GradientPicker2({
|
|
|
8043
8145
|
}),
|
|
8044
8146
|
[]
|
|
8045
8147
|
);
|
|
8046
|
-
const rgbaColor =
|
|
8148
|
+
const rgbaColor = React65.useMemo(
|
|
8047
8149
|
() => sketchColorToRgba(value[selectedStop].color),
|
|
8048
8150
|
[value, selectedStop]
|
|
8049
8151
|
);
|
|
8050
|
-
const handleChangeColor =
|
|
8152
|
+
const handleChangeColor = React65.useCallback(
|
|
8051
8153
|
(value2) => {
|
|
8052
8154
|
onChangeColor(rgbaToSketchColor(value2));
|
|
8053
8155
|
},
|
|
8054
8156
|
[onChangeColor]
|
|
8055
8157
|
);
|
|
8056
|
-
const handleAddGradientStop =
|
|
8158
|
+
const handleAddGradientStop = React65.useCallback(
|
|
8057
8159
|
(value2, position) => {
|
|
8058
8160
|
onAdd(rgbaToSketchColor(value2), position);
|
|
8059
8161
|
},
|
|
8060
8162
|
[onAdd]
|
|
8061
8163
|
);
|
|
8062
|
-
return /* @__PURE__ */
|
|
8164
|
+
return /* @__PURE__ */ React65.createElement(
|
|
8063
8165
|
import_noya_colorpicker2.ColorPicker,
|
|
8064
8166
|
{
|
|
8065
8167
|
onChange: handleChangeColor,
|
|
8066
8168
|
colorModel,
|
|
8067
8169
|
color: rgbaColor
|
|
8068
8170
|
},
|
|
8069
|
-
/* @__PURE__ */
|
|
8171
|
+
/* @__PURE__ */ React65.createElement(
|
|
8070
8172
|
import_noya_colorpicker2.Gradient,
|
|
8071
8173
|
{
|
|
8072
8174
|
gradients: value,
|
|
@@ -8077,12 +8179,12 @@ var GradientPicker = React64.memo(function GradientPicker2({
|
|
|
8077
8179
|
onDelete
|
|
8078
8180
|
}
|
|
8079
8181
|
),
|
|
8080
|
-
/* @__PURE__ */
|
|
8081
|
-
/* @__PURE__ */
|
|
8082
|
-
/* @__PURE__ */
|
|
8083
|
-
/* @__PURE__ */
|
|
8084
|
-
/* @__PURE__ */
|
|
8085
|
-
/* @__PURE__ */
|
|
8182
|
+
/* @__PURE__ */ React65.createElement(Spacer.Vertical, { size: 10 }),
|
|
8183
|
+
/* @__PURE__ */ React65.createElement(import_noya_colorpicker2.Saturation, null),
|
|
8184
|
+
/* @__PURE__ */ React65.createElement(Spacer.Vertical, { size: 12 }),
|
|
8185
|
+
/* @__PURE__ */ React65.createElement(import_noya_colorpicker2.Hue, null),
|
|
8186
|
+
/* @__PURE__ */ React65.createElement(Spacer.Vertical, { size: 5 }),
|
|
8187
|
+
/* @__PURE__ */ React65.createElement(import_noya_colorpicker2.Alpha, null)
|
|
8086
8188
|
);
|
|
8087
8189
|
});
|
|
8088
8190
|
|
|
@@ -8120,25 +8222,25 @@ var InspectorContainer = (0, import_react71.memo)(
|
|
|
8120
8222
|
|
|
8121
8223
|
// src/components/LabeledElementView.tsx
|
|
8122
8224
|
var kiwi = __toESM(require("kiwi.js"));
|
|
8123
|
-
var
|
|
8124
|
-
var LabeledElementView =
|
|
8225
|
+
var React67 = __toESM(require("react"));
|
|
8226
|
+
var LabeledElementView = React67.memo(function LabeledElementView2({
|
|
8125
8227
|
children,
|
|
8126
8228
|
renderLabel
|
|
8127
8229
|
}) {
|
|
8128
|
-
const elementIds =
|
|
8129
|
-
(child) =>
|
|
8230
|
+
const elementIds = React67.Children.toArray(children).flatMap(
|
|
8231
|
+
(child) => React67.isValidElement(child) && child.type === React67.Fragment ? child.props.children : [child]
|
|
8130
8232
|
).map(
|
|
8131
|
-
(child) =>
|
|
8233
|
+
(child) => React67.isValidElement(child) && "id" in child.props ? child.props.id : null
|
|
8132
8234
|
).filter((id) => !!id);
|
|
8133
8235
|
const serializedIds = elementIds.join(",");
|
|
8134
|
-
const containerRef =
|
|
8135
|
-
const refs =
|
|
8236
|
+
const containerRef = React67.useRef(null);
|
|
8237
|
+
const refs = React67.useMemo(() => {
|
|
8136
8238
|
return Object.fromEntries(
|
|
8137
|
-
serializedIds.split(",").map((id) => [id,
|
|
8239
|
+
serializedIds.split(",").map((id) => [id, React67.createRef()])
|
|
8138
8240
|
);
|
|
8139
8241
|
}, [serializedIds]);
|
|
8140
|
-
const labelElements =
|
|
8141
|
-
return serializedIds.split(",").map((id, index) => /* @__PURE__ */
|
|
8242
|
+
const labelElements = React67.useMemo(() => {
|
|
8243
|
+
return serializedIds.split(",").map((id, index) => /* @__PURE__ */ React67.createElement(
|
|
8142
8244
|
"span",
|
|
8143
8245
|
{
|
|
8144
8246
|
key: id,
|
|
@@ -8151,7 +8253,7 @@ var LabeledElementView = React66.memo(function LabeledElementView2({
|
|
|
8151
8253
|
})
|
|
8152
8254
|
));
|
|
8153
8255
|
}, [refs, serializedIds, renderLabel]);
|
|
8154
|
-
|
|
8256
|
+
React67.useLayoutEffect(() => {
|
|
8155
8257
|
if (!containerRef.current) return;
|
|
8156
8258
|
const containerRect = containerRef.current.getBoundingClientRect();
|
|
8157
8259
|
const solver = new kiwi.Solver();
|
|
@@ -8213,7 +8315,7 @@ var LabeledElementView = React66.memo(function LabeledElementView2({
|
|
|
8213
8315
|
`${Math.max(...heights)}px`
|
|
8214
8316
|
);
|
|
8215
8317
|
}, [refs, labelElements]);
|
|
8216
|
-
return /* @__PURE__ */
|
|
8318
|
+
return /* @__PURE__ */ React67.createElement("div", { className: "flex flex-1 flex-col relative", ref: containerRef }, /* @__PURE__ */ React67.createElement("div", { className: "flex flex-1 items-center" }, children), /* @__PURE__ */ React67.createElement("div", { className: "relative overflow-hidden select-none" }, labelElements));
|
|
8217
8319
|
});
|
|
8218
8320
|
|
|
8219
8321
|
// src/components/LabeledField.tsx
|
|
@@ -8297,7 +8399,7 @@ var LabeledField = (0, import_react73.memo)(function LabeledField2({
|
|
|
8297
8399
|
});
|
|
8298
8400
|
|
|
8299
8401
|
// src/components/MediaThumbnail.tsx
|
|
8300
|
-
var
|
|
8402
|
+
var import_noya_icons7 = require("@noya-app/noya-icons");
|
|
8301
8403
|
var import_react74 = __toESM(require("react"));
|
|
8302
8404
|
|
|
8303
8405
|
// src/components/catppuccin/fileIcons.ts
|
|
@@ -10763,7 +10865,7 @@ var MediaThumbnail = (0, import_react74.memo)(function MediaThumbnail2({
|
|
|
10763
10865
|
const content = (0, import_react74.useMemo)(() => {
|
|
10764
10866
|
switch (contentType) {
|
|
10765
10867
|
case "image":
|
|
10766
|
-
if (!url) return /* @__PURE__ */ import_react74.default.createElement(
|
|
10868
|
+
if (!url) return /* @__PURE__ */ import_react74.default.createElement(import_noya_icons7.ImageIcon, { color: iconColor, style: iconStyles });
|
|
10767
10869
|
return /* @__PURE__ */ import_react74.default.createElement(
|
|
10768
10870
|
"img",
|
|
10769
10871
|
{
|
|
@@ -10774,9 +10876,9 @@ var MediaThumbnail = (0, import_react74.memo)(function MediaThumbnail2({
|
|
|
10774
10876
|
}
|
|
10775
10877
|
);
|
|
10776
10878
|
case "video":
|
|
10777
|
-
return /* @__PURE__ */ import_react74.default.createElement(
|
|
10879
|
+
return /* @__PURE__ */ import_react74.default.createElement(import_noya_icons7.VideoIcon, { color: iconColor, style: iconStyles });
|
|
10778
10880
|
case "audio":
|
|
10779
|
-
return /* @__PURE__ */ import_react74.default.createElement(
|
|
10881
|
+
return /* @__PURE__ */ import_react74.default.createElement(import_noya_icons7.SpeakerLoudIcon, { color: iconColor, style: iconStyles });
|
|
10780
10882
|
default:
|
|
10781
10883
|
if (iconName) {
|
|
10782
10884
|
const Icon = Icons[iconName];
|
|
@@ -10795,7 +10897,7 @@ var MediaThumbnail = (0, import_react74.memo)(function MediaThumbnail2({
|
|
|
10795
10897
|
);
|
|
10796
10898
|
}
|
|
10797
10899
|
}
|
|
10798
|
-
return /* @__PURE__ */ import_react74.default.createElement(
|
|
10900
|
+
return /* @__PURE__ */ import_react74.default.createElement(import_noya_icons7.FileIcon, { color: iconColor, style: iconStyles });
|
|
10799
10901
|
}
|
|
10800
10902
|
}, [contentType, url, iconColor, iconStyles, iconName, fileName]);
|
|
10801
10903
|
return /* @__PURE__ */ import_react74.default.createElement(
|
|
@@ -10889,7 +10991,7 @@ var Message = (0, import_react75.memo)(
|
|
|
10889
10991
|
);
|
|
10890
10992
|
|
|
10891
10993
|
// src/components/pipeline/PipelineResultLayout.tsx
|
|
10892
|
-
var
|
|
10994
|
+
var import_noya_icons8 = require("@noya-app/noya-icons");
|
|
10893
10995
|
var import_react76 = __toESM(require("react"));
|
|
10894
10996
|
var PipelineResultLink = ({ url }) => {
|
|
10895
10997
|
return /* @__PURE__ */ import_react76.default.createElement("div", { className: "flex flex-col gap-0.5" }, /* @__PURE__ */ import_react76.default.createElement(
|
|
@@ -10900,7 +11002,7 @@ var PipelineResultLink = ({ url }) => {
|
|
|
10900
11002
|
rel: "noopener noreferrer",
|
|
10901
11003
|
className: "flex text-primary hover:opacity-80 border border-divider rounded-md"
|
|
10902
11004
|
},
|
|
10903
|
-
/* @__PURE__ */ import_react76.default.createElement("div", { className: "flex gap-1 items-center p-2" }, /* @__PURE__ */ import_react76.default.createElement(
|
|
11005
|
+
/* @__PURE__ */ import_react76.default.createElement("div", { className: "flex gap-1 items-center p-2" }, /* @__PURE__ */ import_react76.default.createElement(import_noya_icons8.Link1Icon, { className: "w-[15px] h-[15px] flex-shrink-0" })),
|
|
10904
11006
|
/* @__PURE__ */ import_react76.default.createElement(DividerVertical, null),
|
|
10905
11007
|
/* @__PURE__ */ import_react76.default.createElement(Small, { className: "truncate p-2 flex-1" }, url)
|
|
10906
11008
|
));
|
|
@@ -10924,27 +11026,27 @@ function getPipelineResultLink(value) {
|
|
|
10924
11026
|
// src/components/Progress.tsx
|
|
10925
11027
|
var import_noya_utils10 = require("@noya-app/noya-utils");
|
|
10926
11028
|
var ProgressPrimitive = __toESM(require("@radix-ui/react-progress"));
|
|
10927
|
-
var
|
|
11029
|
+
var React73 = __toESM(require("react"));
|
|
10928
11030
|
function Progress({
|
|
10929
11031
|
value,
|
|
10930
11032
|
variant = "normal",
|
|
10931
11033
|
className
|
|
10932
11034
|
}) {
|
|
10933
11035
|
const clampedValue = (0, import_noya_utils10.clamp)(value, 0, 100);
|
|
10934
|
-
const transformStyles =
|
|
11036
|
+
const transformStyles = React73.useMemo(
|
|
10935
11037
|
() => ({
|
|
10936
11038
|
transform: `translateX(-${100 - clampedValue}%)`
|
|
10937
11039
|
}),
|
|
10938
11040
|
[clampedValue]
|
|
10939
11041
|
);
|
|
10940
|
-
return /* @__PURE__ */
|
|
11042
|
+
return /* @__PURE__ */ React73.createElement(
|
|
10941
11043
|
ProgressPrimitive.Root,
|
|
10942
11044
|
{
|
|
10943
11045
|
className: cx(`relative hidden bg-input-background h-[5px] `, className),
|
|
10944
11046
|
style: { transform: "translateZ(0)" },
|
|
10945
11047
|
value: clampedValue
|
|
10946
11048
|
},
|
|
10947
|
-
/* @__PURE__ */
|
|
11049
|
+
/* @__PURE__ */ React73.createElement(
|
|
10948
11050
|
ProgressPrimitive.Indicator,
|
|
10949
11051
|
{
|
|
10950
11052
|
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`,
|
|
@@ -11047,6 +11149,7 @@ var SegmentedControlItem = (0, import_react78.forwardRef)(function SegmentedCont
|
|
|
11047
11149
|
disabled = false,
|
|
11048
11150
|
icon,
|
|
11049
11151
|
className,
|
|
11152
|
+
variant = "default",
|
|
11050
11153
|
...props
|
|
11051
11154
|
}, forwardedRef) {
|
|
11052
11155
|
const { colorScheme } = (0, import_react78.useContext)(SegmentedControlContext);
|
|
@@ -11057,30 +11160,33 @@ var SegmentedControlItem = (0, import_react78.forwardRef)(function SegmentedCont
|
|
|
11057
11160
|
value: (value ?? "").toString(),
|
|
11058
11161
|
disabled,
|
|
11059
11162
|
className: cx(
|
|
11060
|
-
"
|
|
11061
|
-
|
|
11062
|
-
|
|
11163
|
+
"group",
|
|
11164
|
+
"flex items-center justify-center",
|
|
11165
|
+
"font-sans text-button relative flex-1 appearance-none text-segmented-control-item focus:outline-none transition-colors",
|
|
11166
|
+
variant === "tabs" ? "font-semibold" : "font-normal",
|
|
11167
|
+
variant === "tabs" ? "" : colorScheme === "secondary" ? "focus:ring-2 focus:ring-secondary focus:ring-offset-1" : "focus:ring-2 focus:ring-primary focus:ring-offset-1",
|
|
11168
|
+
variant === "tabs" ? "aria-checked:text-primary" : colorScheme === "secondary" ? "aria-checked:bg-secondary aria-checked:text-white" : colorScheme === "primary" ? "aria-checked:bg-primary aria-checked:text-white" : "aria-checked:bg-background aria-checked:text-text",
|
|
11063
11169
|
"focus:z-interactable",
|
|
11064
|
-
"aria-checked:shadow-segment",
|
|
11065
|
-
"
|
|
11170
|
+
variant === "default" ? "px-1 rounded aria-checked:shadow-segment" : "px-1.5 border-y-2 border-y-transparent aria-checked:border-b-primary",
|
|
11171
|
+
variant === "default" && "border-r border-divider last:border-r-0 aria-checked:border-r-transparent [&:has(+[aria-checked=true])]:border-r-transparent",
|
|
11066
11172
|
className
|
|
11067
11173
|
),
|
|
11068
11174
|
...props
|
|
11069
11175
|
},
|
|
11070
|
-
|
|
11071
|
-
|
|
11176
|
+
/* @__PURE__ */ import_react78.default.createElement(
|
|
11177
|
+
"span",
|
|
11178
|
+
{
|
|
11179
|
+
className: cx(
|
|
11180
|
+
"inline-flex whitespace-pre flex-nowrap gap-1.5 items-center justify-center align-middle text-center",
|
|
11181
|
+
variant === "tabs" && "group-focus:ring-2 group-focus:ring-primary-pastel group-focus:ring-offset-2"
|
|
11182
|
+
)
|
|
11183
|
+
},
|
|
11184
|
+
icon && renderIcon(icon),
|
|
11185
|
+
title
|
|
11186
|
+
)
|
|
11072
11187
|
);
|
|
11073
11188
|
return tooltip ? /* @__PURE__ */ import_react78.default.createElement(Tooltip, { content: tooltip }, itemElement) : itemElement;
|
|
11074
11189
|
});
|
|
11075
|
-
var Separator3 = ({ transparent }) => /* @__PURE__ */ import_react78.default.createElement(
|
|
11076
|
-
"div",
|
|
11077
|
-
{
|
|
11078
|
-
className: cx(
|
|
11079
|
-
"w-[1px] my-1 self-stretch bg-divider",
|
|
11080
|
-
transparent && "bg-transparent"
|
|
11081
|
-
)
|
|
11082
|
-
}
|
|
11083
|
-
);
|
|
11084
11190
|
var SegmentedControl = memoGeneric(function SegmentedControl2({
|
|
11085
11191
|
id: idProp,
|
|
11086
11192
|
value,
|
|
@@ -11088,7 +11194,7 @@ var SegmentedControl = memoGeneric(function SegmentedControl2({
|
|
|
11088
11194
|
colorScheme,
|
|
11089
11195
|
allowEmpty,
|
|
11090
11196
|
items,
|
|
11091
|
-
|
|
11197
|
+
variant = "default",
|
|
11092
11198
|
className,
|
|
11093
11199
|
style: style2
|
|
11094
11200
|
}) {
|
|
@@ -11101,7 +11207,6 @@ var SegmentedControl = memoGeneric(function SegmentedControl2({
|
|
|
11101
11207
|
},
|
|
11102
11208
|
[allowEmpty, onValueChange]
|
|
11103
11209
|
);
|
|
11104
|
-
const selectedIndex = items.findIndex((item) => item?.value === value);
|
|
11105
11210
|
return /* @__PURE__ */ import_react78.default.createElement(SegmentedControlContext.Provider, { value: contextValue }, /* @__PURE__ */ import_react78.default.createElement(
|
|
11106
11211
|
ToggleGroupPrimitive2.Root,
|
|
11107
11212
|
{
|
|
@@ -11110,23 +11215,24 @@ var SegmentedControl = memoGeneric(function SegmentedControl2({
|
|
|
11110
11215
|
value,
|
|
11111
11216
|
onValueChange: handleValueChange,
|
|
11112
11217
|
className: cx(
|
|
11113
|
-
`
|
|
11218
|
+
`appearance-none relative outline-none`,
|
|
11219
|
+
variant === "default" && "grid min-h-input-height bg-input-background rounded py-0.5 px-0.5",
|
|
11220
|
+
variant === "tabs" && "flex gap-1.5 min-h-[33px]",
|
|
11114
11221
|
className
|
|
11115
11222
|
),
|
|
11116
|
-
style:
|
|
11223
|
+
style: {
|
|
11224
|
+
...style2,
|
|
11225
|
+
gridTemplateColumns: `repeat(${items.length}, 1fr)`
|
|
11226
|
+
}
|
|
11117
11227
|
},
|
|
11118
|
-
|
|
11119
|
-
const isLastItem = index === items.length - 1;
|
|
11120
|
-
const currentValue = item?.value;
|
|
11121
|
-
const showSeparator = currentValue !== value && (selectedIndex === 0 && selectedIndex !== index ? true : index !== selectedIndex - 1);
|
|
11122
|
-
return /* @__PURE__ */ import_react78.default.createElement(import_react78.default.Fragment, { key: index }, /* @__PURE__ */ import_react78.default.createElement(SegmentedControlItem, { key: index, ...item }), !isLastItem && /* @__PURE__ */ import_react78.default.createElement(Separator3, { transparent: !showSeparator }));
|
|
11123
|
-
}) : items.map((item, index) => /* @__PURE__ */ import_react78.default.createElement(SegmentedControlItem, { key: index, ...item }))
|
|
11228
|
+
items.map((item, index) => /* @__PURE__ */ import_react78.default.createElement(SegmentedControlItem, { key: index, ...item, variant }))
|
|
11124
11229
|
));
|
|
11125
11230
|
});
|
|
11126
11231
|
|
|
11127
11232
|
// src/components/SelectionToolbar.tsx
|
|
11128
11233
|
var PopperPrimitive = __toESM(require("@radix-ui/react-popper"));
|
|
11129
11234
|
var import_react79 = __toESM(require("react"));
|
|
11235
|
+
var import_react_dom3 = require("react-dom");
|
|
11130
11236
|
var createVirtualElement = (rect) => ({
|
|
11131
11237
|
getBoundingClientRect: () => ({
|
|
11132
11238
|
width: rect.width,
|
|
@@ -11143,7 +11249,8 @@ var createVirtualElement = (rect) => ({
|
|
|
11143
11249
|
var SelectionToolbarContainer = (0, import_react79.memo)(
|
|
11144
11250
|
function SelectionToolbarContainer2({
|
|
11145
11251
|
rect,
|
|
11146
|
-
children
|
|
11252
|
+
children,
|
|
11253
|
+
portalContainer
|
|
11147
11254
|
}) {
|
|
11148
11255
|
const portalScopeId = usePortalScopeId();
|
|
11149
11256
|
const containerRef = import_react79.default.useRef(null);
|
|
@@ -11154,7 +11261,7 @@ var SelectionToolbarContainer = (0, import_react79.memo)(
|
|
|
11154
11261
|
}),
|
|
11155
11262
|
[rect]
|
|
11156
11263
|
);
|
|
11157
|
-
|
|
11264
|
+
const popperContent = /* @__PURE__ */ import_react79.default.createElement(
|
|
11158
11265
|
PopperPrimitive.Content,
|
|
11159
11266
|
{
|
|
11160
11267
|
...portalScopeProps(portalScopeId),
|
|
@@ -11175,16 +11282,21 @@ var SelectionToolbarContainer = (0, import_react79.memo)(
|
|
|
11175
11282
|
"div",
|
|
11176
11283
|
{
|
|
11177
11284
|
ref: containerRef,
|
|
11178
|
-
className: "flex gap-1 bg-popover-background rounded shadow-popover p-1"
|
|
11285
|
+
className: "flex gap-1 bg-popover-background rounded shadow-popover p-1",
|
|
11286
|
+
onClick: (e) => e.stopPropagation(),
|
|
11287
|
+
onMouseDown: (e) => e.stopPropagation(),
|
|
11288
|
+
onPointerDown: (e) => e.stopPropagation(),
|
|
11289
|
+
onWheel: (e) => e.stopPropagation()
|
|
11179
11290
|
},
|
|
11180
11291
|
children
|
|
11181
11292
|
)
|
|
11182
|
-
)
|
|
11293
|
+
);
|
|
11294
|
+
return /* @__PURE__ */ import_react79.default.createElement(PopperPrimitive.Root, null, /* @__PURE__ */ import_react79.default.createElement(PopperPrimitive.Anchor, { virtualRef }), portalContainer ? (0, import_react_dom3.createPortal)(popperContent, portalContainer) : popperContent);
|
|
11183
11295
|
}
|
|
11184
11296
|
);
|
|
11185
11297
|
|
|
11186
11298
|
// src/components/SelectMenu.tsx
|
|
11187
|
-
var
|
|
11299
|
+
var import_noya_icons9 = require("@noya-app/noya-icons");
|
|
11188
11300
|
var Select = __toESM(require("@radix-ui/react-select"));
|
|
11189
11301
|
var import_react80 = __toESM(require("react"));
|
|
11190
11302
|
var readOnlyStyle = {
|
|
@@ -11233,7 +11345,7 @@ var SelectMenuTrigger = memoGeneric(function SelectMenuTrigger2({
|
|
|
11233
11345
|
label && labelPosition === "inset" && /* @__PURE__ */ import_react80.default.createElement("div", { className: insetEndStyles }, /* @__PURE__ */ import_react80.default.createElement(Label, { className: "pr-4 text-text-disabled", htmlFor: id }, label)),
|
|
11234
11346
|
/* @__PURE__ */ import_react80.default.createElement("span", { className: "flex-1 flex" }, /* @__PURE__ */ import_react80.default.createElement(Select.Value, { placeholder })),
|
|
11235
11347
|
/* @__PURE__ */ import_react80.default.createElement(
|
|
11236
|
-
|
|
11348
|
+
import_noya_icons9.DropdownChevronIcon,
|
|
11237
11349
|
{
|
|
11238
11350
|
className: cx(
|
|
11239
11351
|
"transition-transform duration-100 ml-1.5",
|
|
@@ -11338,13 +11450,13 @@ var SelectMenu = memoGeneric(function SelectMenu2({
|
|
|
11338
11450
|
style: contentStyle
|
|
11339
11451
|
},
|
|
11340
11452
|
/* @__PURE__ */ import_react80.default.createElement(Select.ScrollUpButton, { className: scrollButtonStyles }, /* @__PURE__ */ import_react80.default.createElement(
|
|
11341
|
-
|
|
11453
|
+
import_noya_icons9.ChevronUpIcon,
|
|
11342
11454
|
{
|
|
11343
11455
|
className: cx("transition-transform duration-100")
|
|
11344
11456
|
}
|
|
11345
11457
|
)),
|
|
11346
11458
|
/* @__PURE__ */ import_react80.default.createElement(Select.Viewport, null, /* @__PURE__ */ import_react80.default.createElement(MenuViewport, { items, Components: Components3 })),
|
|
11347
|
-
/* @__PURE__ */ import_react80.default.createElement(Select.ScrollDownButton, { className: scrollButtonStyles }, /* @__PURE__ */ import_react80.default.createElement(
|
|
11459
|
+
/* @__PURE__ */ import_react80.default.createElement(Select.ScrollDownButton, { className: scrollButtonStyles }, /* @__PURE__ */ import_react80.default.createElement(import_noya_icons9.ChevronDownIcon, null))
|
|
11348
11460
|
))
|
|
11349
11461
|
);
|
|
11350
11462
|
return readOnly ? readOnlyButton : content;
|
|
@@ -11430,7 +11542,7 @@ var Slider = (0, import_react81.memo)(function Slider2({
|
|
|
11430
11542
|
{
|
|
11431
11543
|
style: trackFillStyle,
|
|
11432
11544
|
className: cx(
|
|
11433
|
-
"absolute inset-0 w-full h-full rounded overflow-hidden",
|
|
11545
|
+
"absolute inset-0 w-full h-full rounded overflow-hidden bg-primary-pastel",
|
|
11434
11546
|
colorScheme === "primary" && "bg-primary",
|
|
11435
11547
|
colorScheme === "secondary" && "bg-secondary"
|
|
11436
11548
|
)
|
|
@@ -11454,7 +11566,7 @@ var Slider = (0, import_react81.memo)(function Slider2({
|
|
|
11454
11566
|
|
|
11455
11567
|
// src/components/Switch.tsx
|
|
11456
11568
|
var SwitchPrimitive = __toESM(require("@radix-ui/react-switch"));
|
|
11457
|
-
var
|
|
11569
|
+
var React79 = __toESM(require("react"));
|
|
11458
11570
|
var Switch = function Switch2({
|
|
11459
11571
|
id,
|
|
11460
11572
|
value,
|
|
@@ -11466,7 +11578,7 @@ var Switch = function Switch2({
|
|
|
11466
11578
|
style: style2,
|
|
11467
11579
|
className
|
|
11468
11580
|
}) {
|
|
11469
|
-
return /* @__PURE__ */
|
|
11581
|
+
return /* @__PURE__ */ React79.createElement(
|
|
11470
11582
|
SwitchPrimitive.Root,
|
|
11471
11583
|
{
|
|
11472
11584
|
id,
|
|
@@ -11485,7 +11597,7 @@ var Switch = function Switch2({
|
|
|
11485
11597
|
onFocus,
|
|
11486
11598
|
onBlur
|
|
11487
11599
|
},
|
|
11488
|
-
/* @__PURE__ */
|
|
11600
|
+
/* @__PURE__ */ React79.createElement(SwitchPrimitive.Thumb, { className: "block w-[15px] h-[15px] bg-background rounded-full transition-transform translate-x-[2px] data-[state=checked]:translate-x-[15px]" })
|
|
11489
11601
|
);
|
|
11490
11602
|
};
|
|
11491
11603
|
|
|
@@ -12275,11 +12387,11 @@ var SUPPORTED_CANVAS_UPLOAD_TYPES = [
|
|
|
12275
12387
|
|
|
12276
12388
|
// src/components/DimensionInput.tsx
|
|
12277
12389
|
var import_noya_utils12 = require("@noya-app/noya-utils");
|
|
12278
|
-
var
|
|
12390
|
+
var React85 = __toESM(require("react"));
|
|
12279
12391
|
function getNewValue(value, mode, delta) {
|
|
12280
12392
|
return delta === void 0 ? value : mode === "replace" ? delta : value + delta;
|
|
12281
12393
|
}
|
|
12282
|
-
var DimensionInput =
|
|
12394
|
+
var DimensionInput = React85.memo(function DimensionInput2({
|
|
12283
12395
|
id,
|
|
12284
12396
|
value,
|
|
12285
12397
|
onSetValue,
|
|
@@ -12289,15 +12401,15 @@ var DimensionInput = React84.memo(function DimensionInput2({
|
|
|
12289
12401
|
disabled,
|
|
12290
12402
|
trigger = "submit"
|
|
12291
12403
|
}) {
|
|
12292
|
-
const handleNudgeValue =
|
|
12404
|
+
const handleNudgeValue = React85.useCallback(
|
|
12293
12405
|
(value2) => onSetValue(value2, "adjust"),
|
|
12294
12406
|
[onSetValue]
|
|
12295
12407
|
);
|
|
12296
|
-
const handleSetValue =
|
|
12408
|
+
const handleSetValue = React85.useCallback(
|
|
12297
12409
|
(value2) => onSetValue(value2, "replace"),
|
|
12298
12410
|
[onSetValue]
|
|
12299
12411
|
);
|
|
12300
|
-
return /* @__PURE__ */
|
|
12412
|
+
return /* @__PURE__ */ React85.createElement(LabeledField, { label, labelPosition: "inset" }, /* @__PURE__ */ React85.createElement(InputField2.Root, { id, width: size2 }, /* @__PURE__ */ React85.createElement(
|
|
12301
12413
|
InputField2.NumberInput,
|
|
12302
12414
|
{
|
|
12303
12415
|
value: value === void 0 ? value : (0, import_noya_utils12.round)(value, 2),
|
|
@@ -12450,9 +12562,13 @@ function BaseToolbar({
|
|
|
12450
12562
|
}
|
|
12451
12563
|
|
|
12452
12564
|
// src/components/Toolbar.tsx
|
|
12453
|
-
var import_noya_icons12 = require("@noya-app/noya-icons");
|
|
12454
12565
|
var import_noya_keymap7 = require("@noya-app/noya-keymap");
|
|
12455
12566
|
var import_react91 = __toESM(require("react"));
|
|
12567
|
+
var iconButtonStyle = {
|
|
12568
|
+
height: 27,
|
|
12569
|
+
width: 27,
|
|
12570
|
+
minWidth: 27
|
|
12571
|
+
};
|
|
12456
12572
|
var ToolbarMenuDropdown = memoGeneric(function ToolbarMenuDropdown2({
|
|
12457
12573
|
item,
|
|
12458
12574
|
onSelectMenuItem
|
|
@@ -12470,7 +12586,16 @@ var ToolbarMenuDropdown = memoGeneric(function ToolbarMenuDropdown2({
|
|
|
12470
12586
|
}
|
|
12471
12587
|
}
|
|
12472
12588
|
},
|
|
12473
|
-
/* @__PURE__ */ import_react91.default.createElement(
|
|
12589
|
+
/* @__PURE__ */ import_react91.default.createElement(
|
|
12590
|
+
Button,
|
|
12591
|
+
{
|
|
12592
|
+
disabled: item.disabled,
|
|
12593
|
+
active: item.checked || open,
|
|
12594
|
+
icon: item.icon,
|
|
12595
|
+
iconRight: "DropdownChevronIcon"
|
|
12596
|
+
},
|
|
12597
|
+
item.title
|
|
12598
|
+
)
|
|
12474
12599
|
);
|
|
12475
12600
|
});
|
|
12476
12601
|
var ToolbarMenuButton = memoGeneric(function ToolbarMenuButton2({
|
|
@@ -12482,18 +12607,46 @@ var ToolbarMenuButton = memoGeneric(function ToolbarMenuButton2({
|
|
|
12482
12607
|
{
|
|
12483
12608
|
disabled: item.disabled,
|
|
12484
12609
|
active: item.checked,
|
|
12610
|
+
icon: item.icon,
|
|
12611
|
+
style: item.icon && !item.title ? iconButtonStyle : void 0,
|
|
12485
12612
|
onClick: () => {
|
|
12486
12613
|
if (onSelectMenuItem && item.value) {
|
|
12487
12614
|
onSelectMenuItem(item.value);
|
|
12488
12615
|
}
|
|
12489
12616
|
}
|
|
12490
12617
|
},
|
|
12491
|
-
item.title
|
|
12492
|
-
item.title && item.icon && /* @__PURE__ */ import_react91.default.createElement(Spacer.Horizontal, { inline: true, size: 6 }),
|
|
12493
|
-
item.icon && renderIcon(item.icon)
|
|
12618
|
+
item.title
|
|
12494
12619
|
);
|
|
12495
12620
|
return item.tooltip ? /* @__PURE__ */ import_react91.default.createElement(Tooltip, { sideOffset: 10, content: item.tooltip }, content) : content;
|
|
12496
12621
|
});
|
|
12622
|
+
var ToolbarMenuItem = memoGeneric(function ToolbarMenuItem2({
|
|
12623
|
+
item,
|
|
12624
|
+
onSelectMenuItem
|
|
12625
|
+
}) {
|
|
12626
|
+
if (item.type === "sectionHeader") return null;
|
|
12627
|
+
if (item.type === "separator") {
|
|
12628
|
+
return /* @__PURE__ */ import_react91.default.createElement(DividerVertical, { overflow: 4 });
|
|
12629
|
+
}
|
|
12630
|
+
if (isSelectableMenuItem(item)) {
|
|
12631
|
+
return /* @__PURE__ */ import_react91.default.createElement(ToolbarMenuButton, { item, onSelectMenuItem });
|
|
12632
|
+
}
|
|
12633
|
+
return /* @__PURE__ */ import_react91.default.createElement(ToolbarMenuDropdown, { item, onSelectMenuItem });
|
|
12634
|
+
});
|
|
12635
|
+
var ToolbarMenu = memoGeneric(function ToolbarMenu2({
|
|
12636
|
+
items,
|
|
12637
|
+
onSelectMenuItem
|
|
12638
|
+
}) {
|
|
12639
|
+
return /* @__PURE__ */ import_react91.default.createElement(import_react91.default.Fragment, null, items.map((item, i) => {
|
|
12640
|
+
return /* @__PURE__ */ import_react91.default.createElement(
|
|
12641
|
+
ToolbarMenuItem,
|
|
12642
|
+
{
|
|
12643
|
+
key: i,
|
|
12644
|
+
item,
|
|
12645
|
+
onSelectMenuItem
|
|
12646
|
+
}
|
|
12647
|
+
);
|
|
12648
|
+
}));
|
|
12649
|
+
});
|
|
12497
12650
|
function Toolbar({
|
|
12498
12651
|
children,
|
|
12499
12652
|
logo,
|
|
@@ -12534,35 +12687,6 @@ function Toolbar({
|
|
|
12534
12687
|
children
|
|
12535
12688
|
);
|
|
12536
12689
|
}
|
|
12537
|
-
var ToolbarMenu = memoGeneric(function ToolbarMenu2({
|
|
12538
|
-
items,
|
|
12539
|
-
onSelectMenuItem
|
|
12540
|
-
}) {
|
|
12541
|
-
return /* @__PURE__ */ import_react91.default.createElement(import_react91.default.Fragment, null, items.map((item, i) => {
|
|
12542
|
-
if (item.type === "sectionHeader") return null;
|
|
12543
|
-
if (item.type === "separator") {
|
|
12544
|
-
return /* @__PURE__ */ import_react91.default.createElement(DividerVertical, { key: i, overflow: 4 });
|
|
12545
|
-
}
|
|
12546
|
-
if (isSelectableMenuItem(item)) {
|
|
12547
|
-
return /* @__PURE__ */ import_react91.default.createElement(
|
|
12548
|
-
ToolbarMenuButton,
|
|
12549
|
-
{
|
|
12550
|
-
key: i,
|
|
12551
|
-
item,
|
|
12552
|
-
onSelectMenuItem
|
|
12553
|
-
}
|
|
12554
|
-
);
|
|
12555
|
-
}
|
|
12556
|
-
return /* @__PURE__ */ import_react91.default.createElement(
|
|
12557
|
-
ToolbarMenuDropdown,
|
|
12558
|
-
{
|
|
12559
|
-
key: i,
|
|
12560
|
-
item,
|
|
12561
|
-
onSelectMenuItem
|
|
12562
|
-
}
|
|
12563
|
-
);
|
|
12564
|
-
}));
|
|
12565
|
-
});
|
|
12566
12690
|
// Annotate the CommonJS export names for ESM import in node:
|
|
12567
12691
|
0 && (module.exports = {
|
|
12568
12692
|
AIAssistantInput,
|
|
@@ -12648,6 +12772,7 @@ var ToolbarMenu = memoGeneric(function ToolbarMenu2({
|
|
|
12648
12772
|
MediaThumbnail,
|
|
12649
12773
|
MenuViewport,
|
|
12650
12774
|
Message,
|
|
12775
|
+
OpenPortalsProvider,
|
|
12651
12776
|
PatternPreviewBackground,
|
|
12652
12777
|
PipelineResultLayout,
|
|
12653
12778
|
PipelineResultLink,
|
|
@@ -12678,6 +12803,7 @@ var ToolbarMenu = memoGeneric(function ToolbarMenu2({
|
|
|
12678
12803
|
ToolbarMenu,
|
|
12679
12804
|
ToolbarMenuButton,
|
|
12680
12805
|
ToolbarMenuDropdown,
|
|
12806
|
+
ToolbarMenuItem,
|
|
12681
12807
|
Tooltip,
|
|
12682
12808
|
TreeView,
|
|
12683
12809
|
UserAvatar,
|
|
@@ -12739,6 +12865,7 @@ var ToolbarMenu = memoGeneric(function ToolbarMenu2({
|
|
|
12739
12865
|
useGlobalInputBlur,
|
|
12740
12866
|
useGlobalInputBlurListener,
|
|
12741
12867
|
useGlobalInputBlurTrigger,
|
|
12868
|
+
useHasOpenPortals,
|
|
12742
12869
|
useHover,
|
|
12743
12870
|
useImageData,
|
|
12744
12871
|
useIndent,
|
|
@@ -12749,6 +12876,7 @@ var ToolbarMenu = memoGeneric(function ToolbarMenu2({
|
|
|
12749
12876
|
useOpenConfirmationDialog,
|
|
12750
12877
|
useOpenDialog,
|
|
12751
12878
|
useOpenInputDialog,
|
|
12879
|
+
useOpenPortalsControls,
|
|
12752
12880
|
usePlatform,
|
|
12753
12881
|
usePlatformModKey,
|
|
12754
12882
|
usePortalScopeId,
|