@noya-app/noya-designsystem 0.1.54 → 0.1.56
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 +136 -44
- package/dist/index.d.ts +136 -44
- package/dist/index.js +1240 -802
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1484 -1054
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/__tests__/validateDropIndicator.test.ts +35 -9
- package/src/components/Button.tsx +13 -0
- 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/ListView.tsx +5 -8
- package/src/components/Popover.tsx +68 -4
- package/src/components/SegmentedControl.tsx +41 -18
- package/src/components/SelectionToolbar.tsx +35 -22
- package/src/components/Toolbar.tsx +22 -12
- package/src/components/connected-users-menu/ConnectedUsersMenuLayout.tsx +3 -26
- package/src/components/sorting/DragRegistration.tsx +110 -0
- package/src/components/sorting/SharedDragProvider.tsx +307 -0
- package/src/components/sorting/Sortable.tsx +404 -0
- package/src/components/sorting/createSharedDrag.tsx +46 -0
- package/src/components/sorting/sorting.ts +180 -0
- package/src/contexts/DesignSystemConfiguration.tsx +8 -5
- package/src/contexts/OpenPortalsContext.tsx +67 -0
- package/src/index.css +2 -2
- package/src/index.tsx +5 -2
- package/src/utils/moveTreeItem.ts +4 -2
- package/src/components/Sortable.tsx +0 -468
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,
|
|
@@ -129,9 +130,11 @@ __export(src_exports, {
|
|
|
129
130
|
SegmentedControl: () => SegmentedControl,
|
|
130
131
|
SelectMenu: () => SelectMenu,
|
|
131
132
|
SelectionToolbarContainer: () => SelectionToolbarContainer,
|
|
133
|
+
SharedDragProvider: () => SharedDragProvider,
|
|
132
134
|
Slider: () => Slider,
|
|
133
135
|
Small: () => Small,
|
|
134
|
-
Sortable: () =>
|
|
136
|
+
Sortable: () => Sortable,
|
|
137
|
+
SortableItemContext: () => SortableItemContext,
|
|
135
138
|
Spacer: () => Spacer,
|
|
136
139
|
Switch: () => Switch,
|
|
137
140
|
Text: () => Text,
|
|
@@ -154,6 +157,7 @@ __export(src_exports, {
|
|
|
154
157
|
colorFromString: () => colorFromString,
|
|
155
158
|
colorSwatchSizeMap: () => colorSwatchSizeMap,
|
|
156
159
|
createSectionedMenu: () => createSectionedMenu,
|
|
160
|
+
createSharedDrag: () => createSharedDrag,
|
|
157
161
|
cssVarNames: () => cssVarNames,
|
|
158
162
|
cssVars: () => cssVars,
|
|
159
163
|
cx: () => cx,
|
|
@@ -166,6 +170,7 @@ __export(src_exports, {
|
|
|
166
170
|
getFieldSpacing: () => getFieldSpacing,
|
|
167
171
|
getGradientBackground: () => getGradientBackground,
|
|
168
172
|
getGridSize: () => getGridSize,
|
|
173
|
+
getItemFirstCollisionDetection: () => getItemFirstCollisionDetection,
|
|
169
174
|
getKeyboardShortcutsForMenuItems: () => getKeyboardShortcutsForMenuItems,
|
|
170
175
|
getMenuItemKey: () => getMenuItemKey,
|
|
171
176
|
getNewValue: () => getNewValue,
|
|
@@ -205,6 +210,7 @@ __export(src_exports, {
|
|
|
205
210
|
useGlobalInputBlur: () => useGlobalInputBlur,
|
|
206
211
|
useGlobalInputBlurListener: () => useGlobalInputBlurListener,
|
|
207
212
|
useGlobalInputBlurTrigger: () => useGlobalInputBlurTrigger,
|
|
213
|
+
useHasOpenPortals: () => useHasOpenPortals,
|
|
208
214
|
useHover: () => useHover,
|
|
209
215
|
useImageData: () => useImageData,
|
|
210
216
|
useIndent: () => useIndent,
|
|
@@ -215,12 +221,14 @@ __export(src_exports, {
|
|
|
215
221
|
useOpenConfirmationDialog: () => useOpenConfirmationDialog,
|
|
216
222
|
useOpenDialog: () => useOpenDialog,
|
|
217
223
|
useOpenInputDialog: () => useOpenInputDialog,
|
|
224
|
+
useOpenPortalsControls: () => useOpenPortalsControls,
|
|
218
225
|
usePlatform: () => usePlatform,
|
|
219
226
|
usePlatformModKey: () => usePlatformModKey,
|
|
220
227
|
usePortalScopeId: () => usePortalScopeId,
|
|
221
228
|
usePreservePanelSize: () => usePreservePanelSize,
|
|
222
229
|
useTheme: () => useTheme,
|
|
223
230
|
validateDropIndicator: () => validateDropIndicator,
|
|
231
|
+
withDragProvider: () => withDragProvider,
|
|
224
232
|
withSeparatorElements: () => withSeparatorElements
|
|
225
233
|
});
|
|
226
234
|
module.exports = __toCommonJS(src_exports);
|
|
@@ -676,14 +684,14 @@ var import_react32 = __toESM(require("react"));
|
|
|
676
684
|
|
|
677
685
|
// src/contexts/DesignSystemConfiguration.tsx
|
|
678
686
|
var import_noya_keymap = require("@noya-app/noya-keymap");
|
|
679
|
-
var
|
|
687
|
+
var React22 = __toESM(require("react"));
|
|
680
688
|
|
|
681
689
|
// src/components/Toast.tsx
|
|
682
690
|
var ToastPrimitive = __toESM(require("@radix-ui/react-toast"));
|
|
683
691
|
var import_react21 = __toESM(require("react"));
|
|
684
692
|
|
|
685
693
|
// src/components/IconButton.tsx
|
|
686
|
-
var
|
|
694
|
+
var React11 = __toESM(require("react"));
|
|
687
695
|
|
|
688
696
|
// src/components/Button.tsx
|
|
689
697
|
var import_react20 = __toESM(require("react"));
|
|
@@ -751,9 +759,58 @@ function mergeConflictingClassNames(classNames, options) {
|
|
|
751
759
|
return classNamesList.join(" ");
|
|
752
760
|
}
|
|
753
761
|
|
|
762
|
+
// src/components/Icons.tsx
|
|
763
|
+
var Icons = __toESM(require("@noya-app/noya-icons"));
|
|
764
|
+
var React6 = __toESM(require("react"));
|
|
765
|
+
function renderIcon(iconName) {
|
|
766
|
+
if (typeof iconName === "string") {
|
|
767
|
+
const Icon = Icons[iconName];
|
|
768
|
+
return /* @__PURE__ */ React6.createElement(Icon, null);
|
|
769
|
+
}
|
|
770
|
+
return iconName;
|
|
771
|
+
}
|
|
772
|
+
|
|
773
|
+
// src/components/Spacer.tsx
|
|
774
|
+
var React7 = __toESM(require("react"));
|
|
775
|
+
var SpacerVertical = React7.forwardRef(
|
|
776
|
+
({ size: size2, inline, ...props }, ref) => {
|
|
777
|
+
return /* @__PURE__ */ React7.createElement(
|
|
778
|
+
"span",
|
|
779
|
+
{
|
|
780
|
+
className: `${inline ? "inline-block" : "block"} ${size2 === void 0 ? "flex flex-1" : ""}`,
|
|
781
|
+
style: size2 ? {
|
|
782
|
+
minHeight: `${size2}px`
|
|
783
|
+
} : void 0,
|
|
784
|
+
...props,
|
|
785
|
+
ref
|
|
786
|
+
}
|
|
787
|
+
);
|
|
788
|
+
}
|
|
789
|
+
);
|
|
790
|
+
var SpacerHorizontal = React7.forwardRef(
|
|
791
|
+
({ size: size2, inline, ...props }, ref) => {
|
|
792
|
+
return /* @__PURE__ */ React7.createElement(
|
|
793
|
+
"span",
|
|
794
|
+
{
|
|
795
|
+
className: `${inline ? "inline-block" : "block"} ${size2 === void 0 ? "flex flex-1" : ""}`,
|
|
796
|
+
style: size2 ? {
|
|
797
|
+
minWidth: `${size2}px`
|
|
798
|
+
} : void 0,
|
|
799
|
+
...props,
|
|
800
|
+
ref
|
|
801
|
+
}
|
|
802
|
+
);
|
|
803
|
+
}
|
|
804
|
+
);
|
|
805
|
+
var Spacer;
|
|
806
|
+
((Spacer2) => {
|
|
807
|
+
Spacer2.Vertical = SpacerVertical;
|
|
808
|
+
Spacer2.Horizontal = SpacerHorizontal;
|
|
809
|
+
})(Spacer || (Spacer = {}));
|
|
810
|
+
|
|
754
811
|
// src/components/Tooltip.tsx
|
|
755
812
|
var TooltipPrimitive = __toESM(require("@radix-ui/react-tooltip"));
|
|
756
|
-
var
|
|
813
|
+
var React9 = __toESM(require("react"));
|
|
757
814
|
|
|
758
815
|
// src/components/Text.tsx
|
|
759
816
|
var import_react19 = __toESM(require("react"));
|
|
@@ -849,13 +906,13 @@ var Italic = ({ children }) => /* @__PURE__ */ import_react19.default.createElem
|
|
|
849
906
|
);
|
|
850
907
|
|
|
851
908
|
// src/components/Tooltip.tsx
|
|
852
|
-
var Tooltip =
|
|
909
|
+
var Tooltip = React9.memo(function Tooltip2({
|
|
853
910
|
children,
|
|
854
911
|
content,
|
|
855
912
|
sideOffset = 2
|
|
856
913
|
}) {
|
|
857
914
|
const portalScopeId = usePortalScopeId();
|
|
858
|
-
return /* @__PURE__ */
|
|
915
|
+
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(
|
|
859
916
|
TooltipPrimitive.Content,
|
|
860
917
|
{
|
|
861
918
|
...portalScopeProps(portalScopeId),
|
|
@@ -892,6 +949,8 @@ var Button = (0, import_react20.forwardRef)(function Button2({
|
|
|
892
949
|
className,
|
|
893
950
|
style: style2,
|
|
894
951
|
tabIndex,
|
|
952
|
+
icon,
|
|
953
|
+
iconRight,
|
|
895
954
|
tooltip,
|
|
896
955
|
active = false,
|
|
897
956
|
disabled = false,
|
|
@@ -936,36 +995,29 @@ var Button = (0, import_react20.forwardRef)(function Button2({
|
|
|
936
995
|
className: "min-h-[19px] flex items-center flex-1 justify-center leading-[15px]",
|
|
937
996
|
style: contentStyle
|
|
938
997
|
},
|
|
939
|
-
|
|
998
|
+
icon && renderIcon(icon),
|
|
999
|
+
icon && children && /* @__PURE__ */ import_react20.default.createElement(Spacer.Horizontal, { inline: true, size: 6 }),
|
|
1000
|
+
children,
|
|
1001
|
+
iconRight && (icon || children) && /* @__PURE__ */ import_react20.default.createElement(Spacer.Horizontal, { inline: true, size: 6 }),
|
|
1002
|
+
iconRight && renderIcon(iconRight)
|
|
940
1003
|
)
|
|
941
1004
|
);
|
|
942
1005
|
return tooltip ? /* @__PURE__ */ import_react20.default.createElement(Tooltip, { content: tooltip }, buttonElement) : buttonElement;
|
|
943
1006
|
});
|
|
944
1007
|
var Button_default = Button;
|
|
945
1008
|
|
|
946
|
-
// src/components/Icons.tsx
|
|
947
|
-
var Icons = __toESM(require("@noya-app/noya-icons"));
|
|
948
|
-
var React9 = __toESM(require("react"));
|
|
949
|
-
function renderIcon(iconName) {
|
|
950
|
-
if (typeof iconName === "string") {
|
|
951
|
-
const Icon = Icons[iconName];
|
|
952
|
-
return /* @__PURE__ */ React9.createElement(Icon, null);
|
|
953
|
-
}
|
|
954
|
-
return iconName;
|
|
955
|
-
}
|
|
956
|
-
|
|
957
1009
|
// src/components/IconButton.tsx
|
|
958
|
-
var IconButton =
|
|
959
|
-
|
|
1010
|
+
var IconButton = React11.memo(
|
|
1011
|
+
React11.forwardRef(function IconButton2({ selected, iconName, color, size: size2, contentStyle, ...props }, forwardedRef) {
|
|
960
1012
|
const Icon = Icons[iconName];
|
|
961
|
-
const style2 =
|
|
1013
|
+
const style2 = React11.useMemo(() => {
|
|
962
1014
|
return {
|
|
963
1015
|
padding: "0 2px",
|
|
964
1016
|
...size2 && { minHeight: size2 },
|
|
965
1017
|
...contentStyle
|
|
966
1018
|
};
|
|
967
1019
|
}, [contentStyle, size2]);
|
|
968
|
-
return /* @__PURE__ */
|
|
1020
|
+
return /* @__PURE__ */ React11.createElement(Button, { ref: forwardedRef, ...props, variant: "none", contentStyle: style2 }, /* @__PURE__ */ React11.createElement(
|
|
969
1021
|
Icon,
|
|
970
1022
|
{
|
|
971
1023
|
color: color ?? (selected ? cssVars.colors.iconSelected : cssVars.colors.icon),
|
|
@@ -1014,46 +1066,6 @@ var import_react29 = __toESM(require("react"));
|
|
|
1014
1066
|
// src/components/Dialog.tsx
|
|
1015
1067
|
var DialogPrimitive = __toESM(require("@radix-ui/react-dialog"));
|
|
1016
1068
|
var import_react22 = __toESM(require("react"));
|
|
1017
|
-
|
|
1018
|
-
// src/components/Spacer.tsx
|
|
1019
|
-
var React12 = __toESM(require("react"));
|
|
1020
|
-
var SpacerVertical = React12.forwardRef(
|
|
1021
|
-
({ size: size2, inline, ...props }, ref) => {
|
|
1022
|
-
return /* @__PURE__ */ React12.createElement(
|
|
1023
|
-
"span",
|
|
1024
|
-
{
|
|
1025
|
-
className: `${inline ? "inline-block" : "block"} ${size2 === void 0 ? "flex flex-1" : ""}`,
|
|
1026
|
-
style: size2 ? {
|
|
1027
|
-
minHeight: `${size2}px`
|
|
1028
|
-
} : void 0,
|
|
1029
|
-
...props,
|
|
1030
|
-
ref
|
|
1031
|
-
}
|
|
1032
|
-
);
|
|
1033
|
-
}
|
|
1034
|
-
);
|
|
1035
|
-
var SpacerHorizontal = React12.forwardRef(
|
|
1036
|
-
({ size: size2, inline, ...props }, ref) => {
|
|
1037
|
-
return /* @__PURE__ */ React12.createElement(
|
|
1038
|
-
"span",
|
|
1039
|
-
{
|
|
1040
|
-
className: `${inline ? "inline-block" : "block"} ${size2 === void 0 ? "flex flex-1" : ""}`,
|
|
1041
|
-
style: size2 ? {
|
|
1042
|
-
minWidth: `${size2}px`
|
|
1043
|
-
} : void 0,
|
|
1044
|
-
...props,
|
|
1045
|
-
ref
|
|
1046
|
-
}
|
|
1047
|
-
);
|
|
1048
|
-
}
|
|
1049
|
-
);
|
|
1050
|
-
var Spacer;
|
|
1051
|
-
((Spacer2) => {
|
|
1052
|
-
Spacer2.Vertical = SpacerVertical;
|
|
1053
|
-
Spacer2.Horizontal = SpacerHorizontal;
|
|
1054
|
-
})(Spacer || (Spacer = {}));
|
|
1055
|
-
|
|
1056
|
-
// src/components/Dialog.tsx
|
|
1057
1069
|
var StyledOverlay = (0, import_react22.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ import_react22.default.createElement(
|
|
1058
1070
|
DialogPrimitive.Overlay,
|
|
1059
1071
|
{
|
|
@@ -1068,9 +1080,8 @@ var StyledContent = (0, import_react22.forwardRef)(({ className, children, ...pr
|
|
|
1068
1080
|
{
|
|
1069
1081
|
ref,
|
|
1070
1082
|
className: cx(
|
|
1071
|
-
`
|
|
1072
|
-
|
|
1073
|
-
w-[90vw] max-w-[450px] max-h-[85vh] p-dialog-padding rounded-[2px]
|
|
1083
|
+
`fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2
|
|
1084
|
+
w-[90vw] max-w-[550px] max-h-[85vh] p-dialog-padding rounded-[2px]
|
|
1074
1085
|
font-sans text-heading5 font-normal leading-[19px] text-text-muted
|
|
1075
1086
|
bg-popover-background pointer-events-all z-[1000] focus:outline-none
|
|
1076
1087
|
shadow-dialog-shadow
|
|
@@ -1088,7 +1099,7 @@ var StyledTitle = (0, import_react22.forwardRef)(({ className, ...props }, ref)
|
|
|
1088
1099
|
{
|
|
1089
1100
|
ref,
|
|
1090
1101
|
className: cx(
|
|
1091
|
-
`m-0 font-sans text-
|
|
1102
|
+
`m-0 font-sans text-heading3 font-medium leading-[1.4] text-text `,
|
|
1092
1103
|
className
|
|
1093
1104
|
),
|
|
1094
1105
|
...props
|
|
@@ -1149,7 +1160,7 @@ var Dialog = (0, import_react22.forwardRef)(function Dialog2({
|
|
|
1149
1160
|
}
|
|
1150
1161
|
)),
|
|
1151
1162
|
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 })),
|
|
1152
|
-
description && /* @__PURE__ */ import_react22.default.createElement(import_react22.default.Fragment, null, /* @__PURE__ */ import_react22.default.createElement(
|
|
1163
|
+
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 })),
|
|
1153
1164
|
children
|
|
1154
1165
|
));
|
|
1155
1166
|
});
|
|
@@ -1502,6 +1513,47 @@ var Label = (0, import_react26.memo)(
|
|
|
1502
1513
|
// src/components/Popover.tsx
|
|
1503
1514
|
var PopoverPrimitive = __toESM(require("@radix-ui/react-popover"));
|
|
1504
1515
|
var import_react27 = __toESM(require("react"));
|
|
1516
|
+
|
|
1517
|
+
// src/contexts/OpenPortalsContext.tsx
|
|
1518
|
+
var React17 = __toESM(require("react"));
|
|
1519
|
+
var OpenPortalsContext = React17.createContext({
|
|
1520
|
+
hasOpenPortals: false
|
|
1521
|
+
});
|
|
1522
|
+
var OpenPortalControlsContext = React17.createContext({
|
|
1523
|
+
addOpenPortal: () => {
|
|
1524
|
+
},
|
|
1525
|
+
removeOpenPortal: () => {
|
|
1526
|
+
}
|
|
1527
|
+
});
|
|
1528
|
+
var OpenPortalsProvider = React17.memo(function OpenPortalsProvider2({
|
|
1529
|
+
children
|
|
1530
|
+
}) {
|
|
1531
|
+
const [openPortals, setOpenPortals] = React17.useState([]);
|
|
1532
|
+
const value = React17.useMemo(
|
|
1533
|
+
() => ({ hasOpenPortals: openPortals.length > 0 }),
|
|
1534
|
+
[openPortals]
|
|
1535
|
+
);
|
|
1536
|
+
const controlsValue = React17.useMemo(
|
|
1537
|
+
() => ({
|
|
1538
|
+
addOpenPortal: (portal) => {
|
|
1539
|
+
setOpenPortals((prev) => [...prev, portal]);
|
|
1540
|
+
},
|
|
1541
|
+
removeOpenPortal: (portal) => {
|
|
1542
|
+
setOpenPortals((prev) => prev.filter((p) => p !== portal));
|
|
1543
|
+
}
|
|
1544
|
+
}),
|
|
1545
|
+
[]
|
|
1546
|
+
);
|
|
1547
|
+
return /* @__PURE__ */ React17.createElement(OpenPortalsContext.Provider, { value }, /* @__PURE__ */ React17.createElement(OpenPortalControlsContext.Provider, { value: controlsValue }, children));
|
|
1548
|
+
});
|
|
1549
|
+
function useHasOpenPortals() {
|
|
1550
|
+
return React17.useContext(OpenPortalsContext).hasOpenPortals;
|
|
1551
|
+
}
|
|
1552
|
+
function useOpenPortalsControls() {
|
|
1553
|
+
return React17.useContext(OpenPortalControlsContext);
|
|
1554
|
+
}
|
|
1555
|
+
|
|
1556
|
+
// src/components/Popover.tsx
|
|
1505
1557
|
var closeStyles = {
|
|
1506
1558
|
all: "unset",
|
|
1507
1559
|
fontFamily: "inherit"
|
|
@@ -1527,13 +1579,30 @@ function Popover({
|
|
|
1527
1579
|
onInteractOutside,
|
|
1528
1580
|
onFocusOutside,
|
|
1529
1581
|
onClickClose,
|
|
1530
|
-
className
|
|
1582
|
+
className,
|
|
1583
|
+
portalContainer
|
|
1531
1584
|
}) {
|
|
1585
|
+
const defaultId = (0, import_react27.useId)();
|
|
1532
1586
|
const portalScopeId = usePortalScopeId();
|
|
1533
|
-
|
|
1587
|
+
const contentRef = (0, import_react27.useRef)(null);
|
|
1588
|
+
const [isOpen, setIsOpen] = useControlledOrUncontrolled({
|
|
1589
|
+
value: open,
|
|
1590
|
+
onChange: onOpenChange,
|
|
1591
|
+
defaultValue: false
|
|
1592
|
+
});
|
|
1593
|
+
const { addOpenPortal, removeOpenPortal } = useOpenPortalsControls();
|
|
1594
|
+
(0, import_react27.useEffect)(() => {
|
|
1595
|
+
if (!isOpen) return;
|
|
1596
|
+
addOpenPortal(portalScopeId || defaultId);
|
|
1597
|
+
return () => {
|
|
1598
|
+
removeOpenPortal(portalScopeId || defaultId);
|
|
1599
|
+
};
|
|
1600
|
+
}, [addOpenPortal, isOpen, portalScopeId, removeOpenPortal, defaultId]);
|
|
1601
|
+
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(
|
|
1534
1602
|
PopoverPrimitive.Content,
|
|
1535
1603
|
{
|
|
1536
1604
|
...portalScopeProps(portalScopeId),
|
|
1605
|
+
ref: contentRef,
|
|
1537
1606
|
className: cx(
|
|
1538
1607
|
popoverStyle.base,
|
|
1539
1608
|
variant === "large" && popoverStyle.large,
|
|
@@ -1547,7 +1616,15 @@ function Popover({
|
|
|
1547
1616
|
onCloseAutoFocus,
|
|
1548
1617
|
onInteractOutside,
|
|
1549
1618
|
onFocusOutside,
|
|
1550
|
-
onPointerDownOutside
|
|
1619
|
+
onPointerDownOutside: (event) => {
|
|
1620
|
+
if (isEventInsideElement(
|
|
1621
|
+
event.detail.originalEvent,
|
|
1622
|
+
contentRef.current
|
|
1623
|
+
)) {
|
|
1624
|
+
event.preventDefault();
|
|
1625
|
+
}
|
|
1626
|
+
onPointerDownOutside?.(event);
|
|
1627
|
+
},
|
|
1551
1628
|
collisionPadding: 8,
|
|
1552
1629
|
arrowPadding: 2
|
|
1553
1630
|
},
|
|
@@ -1563,6 +1640,19 @@ function Popover({
|
|
|
1563
1640
|
)
|
|
1564
1641
|
)));
|
|
1565
1642
|
}
|
|
1643
|
+
function isEventInsideElement(event, element) {
|
|
1644
|
+
if (!element) return false;
|
|
1645
|
+
const body = document.body;
|
|
1646
|
+
const originalPointerEvents = body.style.pointerEvents;
|
|
1647
|
+
body.style.pointerEvents = "auto";
|
|
1648
|
+
const elementsAtPoint = document.elementsFromPoint(
|
|
1649
|
+
event.clientX,
|
|
1650
|
+
event.clientY
|
|
1651
|
+
);
|
|
1652
|
+
body.style.pointerEvents = originalPointerEvents;
|
|
1653
|
+
const target = elementsAtPoint.at(0);
|
|
1654
|
+
return target && element.contains(target);
|
|
1655
|
+
}
|
|
1566
1656
|
|
|
1567
1657
|
// src/components/InputField.tsx
|
|
1568
1658
|
var InputFieldContext = (0, import_react28.createContext)({
|
|
@@ -1685,7 +1775,7 @@ var InputElement = (0, import_react28.forwardRef)(
|
|
|
1685
1775
|
readOnly ? "text-text-muted" : disabled ? "text-text-disabled" : "text-text",
|
|
1686
1776
|
"font-sans font-normal",
|
|
1687
1777
|
$textAlign && `text-${$textAlign}`,
|
|
1688
|
-
size2 === "small" ? "text-[11px] leading-[19px] py-[1px]" : size2 === "large" ? "py-2.5 text-heading5" : size2 === "medium" ? "py-1
|
|
1778
|
+
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",
|
|
1689
1779
|
className
|
|
1690
1780
|
);
|
|
1691
1781
|
const mergedClassName = (0, import_react28.useMemo)(
|
|
@@ -1856,6 +1946,8 @@ function InputFieldRoot({
|
|
|
1856
1946
|
className,
|
|
1857
1947
|
start,
|
|
1858
1948
|
end,
|
|
1949
|
+
startClassName,
|
|
1950
|
+
endClassName,
|
|
1859
1951
|
label: labelProp
|
|
1860
1952
|
}) {
|
|
1861
1953
|
const randomId = (0, import_react28.useId)();
|
|
@@ -1896,7 +1988,15 @@ function InputFieldRoot({
|
|
|
1896
1988
|
() => /* @__PURE__ */ import_react28.default.createElement(Label, { htmlFor: id, className: "!text-text-disabled" }, labelProp ?? label),
|
|
1897
1989
|
[id, labelProp, label]
|
|
1898
1990
|
);
|
|
1899
|
-
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(
|
|
1991
|
+
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(
|
|
1992
|
+
"span",
|
|
1993
|
+
{
|
|
1994
|
+
ref: endRef,
|
|
1995
|
+
className: cx(endStyles, label && end && "gap-1.5", endClassName)
|
|
1996
|
+
},
|
|
1997
|
+
labelProp ? insetLabel : label && labelPosition === "inset" && insetLabel,
|
|
1998
|
+
end
|
|
1999
|
+
));
|
|
1900
2000
|
const measuredWidthObject = (0, import_react28.useMemo)(
|
|
1901
2001
|
() => measuredInputSize ? { width: measuredInputSize.width + 4 } : void 0,
|
|
1902
2002
|
[measuredInputSize]
|
|
@@ -2278,30 +2378,30 @@ var useCurrentFloatingWindowInternal = () => {
|
|
|
2278
2378
|
};
|
|
2279
2379
|
|
|
2280
2380
|
// src/contexts/DesignSystemConfiguration.tsx
|
|
2281
|
-
var DesignSystemConfigurationContext =
|
|
2381
|
+
var DesignSystemConfigurationContext = React22.createContext({
|
|
2282
2382
|
platform: "key"
|
|
2283
2383
|
});
|
|
2284
|
-
var DesignSystemConfigurationProvider =
|
|
2384
|
+
var DesignSystemConfigurationProvider = React22.memo(
|
|
2285
2385
|
function DesignSystemConfigurationProvider2({
|
|
2286
2386
|
children,
|
|
2287
2387
|
platform
|
|
2288
2388
|
}) {
|
|
2289
|
-
const [internalPlatform, setInternalPlatform] =
|
|
2290
|
-
|
|
2389
|
+
const [internalPlatform, setInternalPlatform] = React22.useState(platform ?? "key");
|
|
2390
|
+
React22.useEffect(() => {
|
|
2291
2391
|
if (platform !== void 0) return;
|
|
2292
2392
|
if (typeof navigator !== "undefined") {
|
|
2293
2393
|
setInternalPlatform((0, import_noya_keymap.getCurrentPlatform)(navigator));
|
|
2294
2394
|
}
|
|
2295
2395
|
}, [platform]);
|
|
2296
|
-
const contextValue =
|
|
2396
|
+
const contextValue = React22.useMemo(
|
|
2297
2397
|
() => ({ platform: platform ?? internalPlatform }),
|
|
2298
2398
|
[platform, internalPlatform]
|
|
2299
2399
|
);
|
|
2300
|
-
return /* @__PURE__ */
|
|
2400
|
+
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)))));
|
|
2301
2401
|
}
|
|
2302
2402
|
);
|
|
2303
2403
|
function useDesignSystemConfiguration() {
|
|
2304
|
-
return
|
|
2404
|
+
return React22.useContext(DesignSystemConfigurationContext);
|
|
2305
2405
|
}
|
|
2306
2406
|
|
|
2307
2407
|
// src/utils/withSeparatorElements.ts
|
|
@@ -2762,16 +2862,16 @@ var ActionMenu = memoGeneric(function ActionMenu2({
|
|
|
2762
2862
|
});
|
|
2763
2863
|
|
|
2764
2864
|
// src/components/ActivityIndicator.tsx
|
|
2765
|
-
var
|
|
2766
|
-
var ActivityIndicator =
|
|
2865
|
+
var React28 = __toESM(require("react"));
|
|
2866
|
+
var ActivityIndicator = React28.memo(function ActivityIndicator2({
|
|
2767
2867
|
size: size2 = 16,
|
|
2768
2868
|
opacity = 1,
|
|
2769
2869
|
color = "black",
|
|
2770
2870
|
trackColor = "rgba(0, 0, 0, 0.1)",
|
|
2771
2871
|
className
|
|
2772
2872
|
}) {
|
|
2773
|
-
const opacityStyle =
|
|
2774
|
-
const dynamicStyles =
|
|
2873
|
+
const opacityStyle = React28.useMemo(() => ({ opacity }), [opacity]);
|
|
2874
|
+
const dynamicStyles = React28.useMemo(
|
|
2775
2875
|
() => ({
|
|
2776
2876
|
border: `2px solid ${trackColor}`,
|
|
2777
2877
|
borderTopColor: color,
|
|
@@ -2780,13 +2880,13 @@ var ActivityIndicator = React27.memo(function ActivityIndicator2({
|
|
|
2780
2880
|
}),
|
|
2781
2881
|
[size2, color, trackColor]
|
|
2782
2882
|
);
|
|
2783
|
-
return /* @__PURE__ */
|
|
2883
|
+
return /* @__PURE__ */ React28.createElement(
|
|
2784
2884
|
"div",
|
|
2785
2885
|
{
|
|
2786
2886
|
className: cx("flex justify-center items-center", className),
|
|
2787
2887
|
style: opacityStyle
|
|
2788
2888
|
},
|
|
2789
|
-
/* @__PURE__ */
|
|
2889
|
+
/* @__PURE__ */ React28.createElement("div", { style: dynamicStyles, className: "animate-spin rounded-[50%]" })
|
|
2790
2890
|
);
|
|
2791
2891
|
});
|
|
2792
2892
|
|
|
@@ -3432,16 +3532,16 @@ var BreadcrumbSlash = () => {
|
|
|
3432
3532
|
};
|
|
3433
3533
|
|
|
3434
3534
|
// src/components/Checkbox.tsx
|
|
3435
|
-
var
|
|
3535
|
+
var React36 = __toESM(require("react"));
|
|
3436
3536
|
var colorSchemeStyles = {
|
|
3437
3537
|
normal: "text-text-subtle",
|
|
3438
3538
|
primary: "text-primary",
|
|
3439
3539
|
secondary: "text-secondary"
|
|
3440
3540
|
};
|
|
3441
|
-
var Checkbox =
|
|
3442
|
-
|
|
3541
|
+
var Checkbox = React36.memo(
|
|
3542
|
+
React36.forwardRef(function Checkbox2({ className, style: style2, colorScheme = "secondary", ...props }, ref) {
|
|
3443
3543
|
const { fieldId: id } = useLabel({ fieldId: props.id });
|
|
3444
|
-
return /* @__PURE__ */
|
|
3544
|
+
return /* @__PURE__ */ React36.createElement(
|
|
3445
3545
|
"div",
|
|
3446
3546
|
{
|
|
3447
3547
|
className: cx(
|
|
@@ -3451,7 +3551,7 @@ var Checkbox = React35.memo(
|
|
|
3451
3551
|
),
|
|
3452
3552
|
style: style2
|
|
3453
3553
|
},
|
|
3454
|
-
/* @__PURE__ */
|
|
3554
|
+
/* @__PURE__ */ React36.createElement(
|
|
3455
3555
|
"input",
|
|
3456
3556
|
{
|
|
3457
3557
|
ref,
|
|
@@ -3480,7 +3580,7 @@ var Checkbox = React35.memo(
|
|
|
3480
3580
|
id
|
|
3481
3581
|
}
|
|
3482
3582
|
),
|
|
3483
|
-
/* @__PURE__ */
|
|
3583
|
+
/* @__PURE__ */ React36.createElement(
|
|
3484
3584
|
"svg",
|
|
3485
3585
|
{
|
|
3486
3586
|
className: `
|
|
@@ -3500,7 +3600,7 @@ var Checkbox = React35.memo(
|
|
|
3500
3600
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3501
3601
|
"aria-hidden": "true"
|
|
3502
3602
|
},
|
|
3503
|
-
/* @__PURE__ */
|
|
3603
|
+
/* @__PURE__ */ React36.createElement(
|
|
3504
3604
|
"path",
|
|
3505
3605
|
{
|
|
3506
3606
|
d: "M3 6L4.5 7.5L8 4",
|
|
@@ -3519,7 +3619,7 @@ var import_noya_icons3 = require("@noya-app/noya-icons");
|
|
|
3519
3619
|
var import_react45 = __toESM(require("react"));
|
|
3520
3620
|
|
|
3521
3621
|
// src/hooks/useHover.ts
|
|
3522
|
-
var
|
|
3622
|
+
var React37 = __toESM(require("react"));
|
|
3523
3623
|
var globalIgnoreEmulatedMouseEvents = false;
|
|
3524
3624
|
var hoverCount = 0;
|
|
3525
3625
|
function setGlobalIgnoreEmulatedMouseEvents() {
|
|
@@ -3549,13 +3649,13 @@ function setupGlobalTouchEvents() {
|
|
|
3549
3649
|
}
|
|
3550
3650
|
function useHover(props = {}) {
|
|
3551
3651
|
const { onHoverStart, onHoverChange, onHoverEnd, isDisabled } = props;
|
|
3552
|
-
const [isHovered, setHovered] =
|
|
3553
|
-
const state =
|
|
3652
|
+
const [isHovered, setHovered] = React37.useState(false);
|
|
3653
|
+
const state = React37.useRef({
|
|
3554
3654
|
isHovered: false,
|
|
3555
3655
|
ignoreEmulatedMouseEvents: false
|
|
3556
3656
|
}).current;
|
|
3557
|
-
|
|
3558
|
-
const hoverProps =
|
|
3657
|
+
React37.useEffect(setupGlobalTouchEvents, []);
|
|
3658
|
+
const hoverProps = React37.useMemo(
|
|
3559
3659
|
function getHoverProps() {
|
|
3560
3660
|
function triggerHoverStart(event, pointerType) {
|
|
3561
3661
|
if (isDisabled || pointerType === "touch" || state.isHovered) {
|
|
@@ -3740,7 +3840,7 @@ var Chip = (0, import_react45.memo)(
|
|
|
3740
3840
|
);
|
|
3741
3841
|
|
|
3742
3842
|
// src/components/Collection.tsx
|
|
3743
|
-
var
|
|
3843
|
+
var import_react55 = __toESM(require("react"));
|
|
3744
3844
|
|
|
3745
3845
|
// src/components/Grid.tsx
|
|
3746
3846
|
var import_react49 = __toESM(require("react"));
|
|
@@ -3954,26 +4054,26 @@ var ContextMenu = memoGeneric(ContextMenuRoot);
|
|
|
3954
4054
|
|
|
3955
4055
|
// src/components/ScrollArea.tsx
|
|
3956
4056
|
var RadixScrollArea = __toESM(require("@radix-ui/react-scroll-area"));
|
|
3957
|
-
var
|
|
3958
|
-
var ScrollArea =
|
|
3959
|
-
const [scrollElementRef, setScrollElementRef] =
|
|
3960
|
-
return /* @__PURE__ */
|
|
4057
|
+
var React41 = __toESM(require("react"));
|
|
4058
|
+
var ScrollArea = React41.memo(function ScrollArea2({ children }) {
|
|
4059
|
+
const [scrollElementRef, setScrollElementRef] = React41.useState(null);
|
|
4060
|
+
return /* @__PURE__ */ React41.createElement("div", { className: "flex-1 min-h-0" }, /* @__PURE__ */ React41.createElement(RadixScrollArea.Root, { style: { width: "100%", height: "100%" } }, /* @__PURE__ */ React41.createElement(
|
|
3961
4061
|
RadixScrollArea.Viewport,
|
|
3962
4062
|
{
|
|
3963
4063
|
className: "w-full h-full [&>div]:block",
|
|
3964
|
-
ref:
|
|
4064
|
+
ref: React41.useCallback(
|
|
3965
4065
|
(ref) => setScrollElementRef(ref),
|
|
3966
4066
|
[]
|
|
3967
4067
|
)
|
|
3968
4068
|
},
|
|
3969
4069
|
typeof children === "function" ? scrollElementRef ? children(scrollElementRef) : null : children
|
|
3970
|
-
), /* @__PURE__ */
|
|
4070
|
+
), /* @__PURE__ */ React41.createElement(
|
|
3971
4071
|
RadixScrollArea.Scrollbar,
|
|
3972
4072
|
{
|
|
3973
4073
|
orientation: "vertical",
|
|
3974
4074
|
className: "scroll-component flex p-[3px] data-[orientation=vertical]:w-[10px]"
|
|
3975
4075
|
},
|
|
3976
|
-
/* @__PURE__ */
|
|
4076
|
+
/* @__PURE__ */ React41.createElement(RadixScrollArea.Thumb, { className: "scroll-component flex-1 rounded-[10px] bg-scrollbar" })
|
|
3977
4077
|
)));
|
|
3978
4078
|
});
|
|
3979
4079
|
|
|
@@ -4102,7 +4202,7 @@ var GridViewItem = forwardRefGeneric(function GridViewItem2({
|
|
|
4102
4202
|
},
|
|
4103
4203
|
children
|
|
4104
4204
|
),
|
|
4105
|
-
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 || " ")),
|
|
4205
|
+
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 || " ")),
|
|
4106
4206
|
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)),
|
|
4107
4207
|
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),
|
|
4108
4208
|
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 }))
|
|
@@ -4409,7 +4509,7 @@ var Grid = memoGeneric(
|
|
|
4409
4509
|
{
|
|
4410
4510
|
...props2,
|
|
4411
4511
|
className: cx(
|
|
4412
|
-
isSelected
|
|
4512
|
+
isSelected ? "text-selected-list-item-text" : "text-text",
|
|
4413
4513
|
"truncate select-none"
|
|
4414
4514
|
)
|
|
4415
4515
|
}
|
|
@@ -4467,12 +4567,12 @@ var Grid = memoGeneric(
|
|
|
4467
4567
|
);
|
|
4468
4568
|
|
|
4469
4569
|
// src/components/List.tsx
|
|
4470
|
-
var
|
|
4570
|
+
var import_react54 = __toESM(require("react"));
|
|
4471
4571
|
|
|
4472
4572
|
// src/components/ListView.tsx
|
|
4473
4573
|
var import_noya_utils8 = require("@noya-app/noya-utils");
|
|
4474
4574
|
var import_react_compose_refs2 = require("@radix-ui/react-compose-refs");
|
|
4475
|
-
var
|
|
4575
|
+
var import_react52 = __toESM(require("react"));
|
|
4476
4576
|
var import_react_virtualized = require("react-virtualized");
|
|
4477
4577
|
var import_react_window = require("react-window");
|
|
4478
4578
|
|
|
@@ -4499,12 +4599,253 @@ function mergeEventHandlers(...handlerMaps) {
|
|
|
4499
4599
|
);
|
|
4500
4600
|
}
|
|
4501
4601
|
|
|
4502
|
-
// src/components/Sortable.tsx
|
|
4503
|
-
var
|
|
4602
|
+
// src/components/sorting/Sortable.tsx
|
|
4603
|
+
var import_core2 = require("@dnd-kit/core");
|
|
4504
4604
|
var import_sortable = require("@dnd-kit/sortable");
|
|
4505
|
-
var
|
|
4506
|
-
|
|
4605
|
+
var React47 = __toESM(require("react"));
|
|
4606
|
+
|
|
4607
|
+
// src/components/sorting/DragRegistration.tsx
|
|
4608
|
+
var import_react50 = __toESM(require("react"));
|
|
4609
|
+
var DragRegistrationContext = import_react50.default.createContext(null);
|
|
4610
|
+
function useDragRegistration(context) {
|
|
4611
|
+
const value = import_react50.default.useContext(context);
|
|
4612
|
+
if (!value) {
|
|
4613
|
+
throw new Error(
|
|
4614
|
+
"useDragRegistration must be used within a DragRegistrationProvider"
|
|
4615
|
+
);
|
|
4616
|
+
}
|
|
4617
|
+
return value;
|
|
4618
|
+
}
|
|
4619
|
+
function useDragRegistrationManager() {
|
|
4620
|
+
const [registeredLists, setRegisteredLists] = import_react50.default.useState(/* @__PURE__ */ new Map());
|
|
4621
|
+
const registerList = import_react50.default.useCallback((list) => {
|
|
4622
|
+
setRegisteredLists((prev) => new Map(prev).set(list.id, list));
|
|
4623
|
+
}, []);
|
|
4624
|
+
const unregisterList = import_react50.default.useCallback((listId) => {
|
|
4625
|
+
setRegisteredLists((prev) => {
|
|
4626
|
+
const newMap = new Map(prev);
|
|
4627
|
+
newMap.delete(listId);
|
|
4628
|
+
return newMap;
|
|
4629
|
+
});
|
|
4630
|
+
}, []);
|
|
4631
|
+
return { registerList, unregisterList, registeredLists };
|
|
4632
|
+
}
|
|
4633
|
+
var ActiveDragContext = import_react50.default.createContext(null);
|
|
4634
|
+
function useActiveDrag(context) {
|
|
4635
|
+
const value = import_react50.default.useContext(context);
|
|
4636
|
+
if (!value) {
|
|
4637
|
+
throw new Error("useActiveDrag must be used within a ActiveDragProvider");
|
|
4638
|
+
}
|
|
4639
|
+
return value;
|
|
4640
|
+
}
|
|
4641
|
+
var AnyDragContext = import_react50.default.createContext(false);
|
|
4642
|
+
|
|
4643
|
+
// src/components/sorting/SharedDragProvider.tsx
|
|
4644
|
+
var import_core = require("@dnd-kit/core");
|
|
4645
|
+
var React45 = __toESM(require("react"));
|
|
4646
|
+
var import_react51 = require("react");
|
|
4507
4647
|
var import_react_dom2 = require("react-dom");
|
|
4648
|
+
function SharedDragProvider({
|
|
4649
|
+
children,
|
|
4650
|
+
contexts = {
|
|
4651
|
+
dragRegistrationContext: DragRegistrationContext,
|
|
4652
|
+
activeDragContext: ActiveDragContext
|
|
4653
|
+
}
|
|
4654
|
+
}) {
|
|
4655
|
+
const sensors = (0, import_core.useSensors)(
|
|
4656
|
+
(0, import_core.useSensor)(import_core.PointerSensor, {
|
|
4657
|
+
activationConstraint: {
|
|
4658
|
+
distance: 4
|
|
4659
|
+
}
|
|
4660
|
+
})
|
|
4661
|
+
);
|
|
4662
|
+
const mounted = useMounted();
|
|
4663
|
+
const [activeItem, setActiveItem] = React45.useState(null);
|
|
4664
|
+
const [delta, setDelta] = React45.useState({ x: 0, y: 0 });
|
|
4665
|
+
const { registerList, unregisterList, registeredLists } = useDragRegistrationManager();
|
|
4666
|
+
const activatorEventRef = React45.useRef(null);
|
|
4667
|
+
const acceptsListDrop = React45.useCallback(
|
|
4668
|
+
(sourceListId, targetListId) => {
|
|
4669
|
+
const sourceList = registeredLists.get(sourceListId);
|
|
4670
|
+
const targetList = registeredLists.get(targetListId);
|
|
4671
|
+
if (!sourceList || !targetList) return false;
|
|
4672
|
+
return targetList.acceptsFromList({
|
|
4673
|
+
sourceListId,
|
|
4674
|
+
targetListId
|
|
4675
|
+
});
|
|
4676
|
+
},
|
|
4677
|
+
[registeredLists]
|
|
4678
|
+
);
|
|
4679
|
+
const handleDragStart = React45.useCallback(
|
|
4680
|
+
(event) => {
|
|
4681
|
+
activatorEventRef.current = event.activatorEvent;
|
|
4682
|
+
for (const [listId, list] of registeredLists) {
|
|
4683
|
+
const itemIndex = list.keys.findIndex((key) => key === event.active.id);
|
|
4684
|
+
if (itemIndex >= 0) {
|
|
4685
|
+
const dragItem = {
|
|
4686
|
+
id: event.active.id,
|
|
4687
|
+
listId,
|
|
4688
|
+
index: itemIndex
|
|
4689
|
+
};
|
|
4690
|
+
setActiveItem(dragItem);
|
|
4691
|
+
break;
|
|
4692
|
+
}
|
|
4693
|
+
}
|
|
4694
|
+
},
|
|
4695
|
+
[registeredLists]
|
|
4696
|
+
);
|
|
4697
|
+
const handleDragMove = React45.useCallback((event) => {
|
|
4698
|
+
setDelta({ x: event.delta.x, y: event.delta.y });
|
|
4699
|
+
}, []);
|
|
4700
|
+
const handleDragEnd = React45.useCallback(
|
|
4701
|
+
(event) => {
|
|
4702
|
+
const { active, over } = event;
|
|
4703
|
+
const activatorEventPoint = activatorEventRef.current ? {
|
|
4704
|
+
x: activatorEventRef.current.clientX,
|
|
4705
|
+
y: activatorEventRef.current.clientY
|
|
4706
|
+
} : null;
|
|
4707
|
+
setActiveItem(null);
|
|
4708
|
+
activatorEventRef.current = null;
|
|
4709
|
+
if (!activeItem || !over || active.id === over.id) {
|
|
4710
|
+
return;
|
|
4711
|
+
}
|
|
4712
|
+
let targetListId = null;
|
|
4713
|
+
let targetIndex = -1;
|
|
4714
|
+
for (const [listId, list] of registeredLists) {
|
|
4715
|
+
const itemIndex = list.keys.findIndex((key) => key === over.id);
|
|
4716
|
+
if (itemIndex >= 0) {
|
|
4717
|
+
targetListId = listId;
|
|
4718
|
+
targetIndex = itemIndex;
|
|
4719
|
+
break;
|
|
4720
|
+
}
|
|
4721
|
+
if (over.id === listId) {
|
|
4722
|
+
targetListId = listId;
|
|
4723
|
+
targetIndex = list.keys.length;
|
|
4724
|
+
break;
|
|
4725
|
+
}
|
|
4726
|
+
}
|
|
4727
|
+
if (!targetListId || !acceptsListDrop(activeItem.listId, targetListId)) {
|
|
4728
|
+
setActiveItem(null);
|
|
4729
|
+
activatorEventRef.current = null;
|
|
4730
|
+
return;
|
|
4731
|
+
}
|
|
4732
|
+
const targetList = registeredLists.get(targetListId);
|
|
4733
|
+
const sourceList = registeredLists.get(activeItem.listId);
|
|
4734
|
+
if (!targetList || !sourceList) {
|
|
4735
|
+
return;
|
|
4736
|
+
}
|
|
4737
|
+
if (targetIndex < targetList.keys.length && activatorEventPoint) {
|
|
4738
|
+
const eventX = activatorEventPoint.x;
|
|
4739
|
+
const eventY = activatorEventPoint.y;
|
|
4740
|
+
const currentX = eventX + delta.x;
|
|
4741
|
+
const currentY = eventY + delta.y;
|
|
4742
|
+
const absolutePosition = { x: currentX, y: currentY };
|
|
4743
|
+
const indicator = targetList.getDropIndicator({
|
|
4744
|
+
absolutePosition,
|
|
4745
|
+
active,
|
|
4746
|
+
over,
|
|
4747
|
+
sourceListId: activeItem.listId,
|
|
4748
|
+
targetListId
|
|
4749
|
+
});
|
|
4750
|
+
if (!indicator) return;
|
|
4751
|
+
sourceList.onMoveItem(
|
|
4752
|
+
activeItem.index,
|
|
4753
|
+
targetIndex,
|
|
4754
|
+
indicator,
|
|
4755
|
+
activeItem.listId,
|
|
4756
|
+
targetListId
|
|
4757
|
+
);
|
|
4758
|
+
} else if (targetIndex >= targetList.keys.length) {
|
|
4759
|
+
const canDrop = targetList.acceptsDrop(
|
|
4760
|
+
activeItem.index,
|
|
4761
|
+
Math.max(0, targetList.keys.length - 1),
|
|
4762
|
+
// Use last valid index or 0 for empty lists
|
|
4763
|
+
"below",
|
|
4764
|
+
activeItem.listId,
|
|
4765
|
+
targetListId
|
|
4766
|
+
);
|
|
4767
|
+
if (canDrop) {
|
|
4768
|
+
sourceList.onMoveItem(
|
|
4769
|
+
activeItem.index,
|
|
4770
|
+
targetIndex,
|
|
4771
|
+
"below",
|
|
4772
|
+
activeItem.listId,
|
|
4773
|
+
targetListId
|
|
4774
|
+
);
|
|
4775
|
+
}
|
|
4776
|
+
}
|
|
4777
|
+
},
|
|
4778
|
+
[activeItem, registeredLists, acceptsListDrop, delta]
|
|
4779
|
+
);
|
|
4780
|
+
const contextValue = React45.useMemo(
|
|
4781
|
+
() => ({
|
|
4782
|
+
activeItem,
|
|
4783
|
+
delta,
|
|
4784
|
+
registerList,
|
|
4785
|
+
unregisterList
|
|
4786
|
+
}),
|
|
4787
|
+
[activeItem, delta, registerList, unregisterList]
|
|
4788
|
+
);
|
|
4789
|
+
const activeList = activeItem ? registeredLists.get(activeItem.listId) : null;
|
|
4790
|
+
const activeDragContextValue = React45.useMemo(
|
|
4791
|
+
() => ({ activeItem, delta }),
|
|
4792
|
+
[activeItem, delta]
|
|
4793
|
+
);
|
|
4794
|
+
const collisionDetection = (0, import_react51.useMemo)(() => {
|
|
4795
|
+
return getItemFirstCollisionDetection(Array.from(registeredLists.keys()));
|
|
4796
|
+
}, [registeredLists]);
|
|
4797
|
+
return /* @__PURE__ */ React45.createElement(AnyDragContext.Provider, { value: true }, /* @__PURE__ */ React45.createElement(contexts.dragRegistrationContext.Provider, { value: contextValue }, /* @__PURE__ */ React45.createElement(contexts.activeDragContext.Provider, { value: activeDragContextValue }, /* @__PURE__ */ React45.createElement(
|
|
4798
|
+
import_core.DndContext,
|
|
4799
|
+
{
|
|
4800
|
+
sensors,
|
|
4801
|
+
collisionDetection,
|
|
4802
|
+
onDragStart: handleDragStart,
|
|
4803
|
+
onDragMove: handleDragMove,
|
|
4804
|
+
onDragEnd: handleDragEnd
|
|
4805
|
+
},
|
|
4806
|
+
children,
|
|
4807
|
+
mounted && activeList?.renderOverlay && activeItem && (0, import_react_dom2.createPortal)(
|
|
4808
|
+
/* @__PURE__ */ React45.createElement(import_core.DragOverlay, { dropAnimation: null }, activeList.renderOverlay(activeItem.id)),
|
|
4809
|
+
document.body
|
|
4810
|
+
)
|
|
4811
|
+
))));
|
|
4812
|
+
}
|
|
4813
|
+
function useMounted() {
|
|
4814
|
+
const [mounted, setMounted] = React45.useState(false);
|
|
4815
|
+
React45.useEffect(() => {
|
|
4816
|
+
setMounted(true);
|
|
4817
|
+
}, []);
|
|
4818
|
+
return mounted;
|
|
4819
|
+
}
|
|
4820
|
+
function withDragProvider(Component) {
|
|
4821
|
+
return function WithDragProvider(props) {
|
|
4822
|
+
const anyDragContext = React45.useContext(AnyDragContext);
|
|
4823
|
+
if (!anyDragContext) {
|
|
4824
|
+
return /* @__PURE__ */ React45.createElement(SharedDragProvider, null, /* @__PURE__ */ React45.createElement(Component, { ...props }));
|
|
4825
|
+
}
|
|
4826
|
+
return /* @__PURE__ */ React45.createElement(Component, { ...props });
|
|
4827
|
+
};
|
|
4828
|
+
}
|
|
4829
|
+
var getItemFirstCollisionDetection = (registeredListIds) => (parameters) => {
|
|
4830
|
+
const pointerCollisions = (0, import_core.pointerWithin)(parameters);
|
|
4831
|
+
if (pointerCollisions.length > 0) {
|
|
4832
|
+
const itemCollisions = pointerCollisions.filter((collision) => {
|
|
4833
|
+
for (const listId of registeredListIds) {
|
|
4834
|
+
if (collision.id === listId) {
|
|
4835
|
+
return false;
|
|
4836
|
+
}
|
|
4837
|
+
}
|
|
4838
|
+
return true;
|
|
4839
|
+
});
|
|
4840
|
+
if (itemCollisions.length > 0) {
|
|
4841
|
+
return itemCollisions;
|
|
4842
|
+
}
|
|
4843
|
+
}
|
|
4844
|
+
return pointerCollisions.length > 0 ? pointerCollisions : (0, import_core.closestCenter)(parameters);
|
|
4845
|
+
};
|
|
4846
|
+
|
|
4847
|
+
// src/components/sorting/sorting.ts
|
|
4848
|
+
var React46 = __toESM(require("react"));
|
|
4508
4849
|
var normalizeListTargetIndex = (index, position) => {
|
|
4509
4850
|
return position === "above" ? index : index + 1;
|
|
4510
4851
|
};
|
|
@@ -4516,14 +4857,15 @@ var defaultAcceptsDrop = (sourceIndex, targetIndex, position) => {
|
|
|
4516
4857
|
}
|
|
4517
4858
|
return true;
|
|
4518
4859
|
};
|
|
4519
|
-
var SortableItemContext =
|
|
4860
|
+
var SortableItemContext = React46.createContext({
|
|
4520
4861
|
keys: [],
|
|
4521
4862
|
acceptsDrop: defaultAcceptsDrop,
|
|
4522
4863
|
axis: "y",
|
|
4523
4864
|
position: { x: 0, y: 0 },
|
|
4524
4865
|
setActivatorEvent: () => {
|
|
4525
4866
|
},
|
|
4526
|
-
getDropTargetParentIndex: void 0
|
|
4867
|
+
getDropTargetParentIndex: void 0,
|
|
4868
|
+
listId: ""
|
|
4527
4869
|
});
|
|
4528
4870
|
function validateDropIndicator({
|
|
4529
4871
|
acceptsDrop: acceptsDrop2,
|
|
@@ -4532,12 +4874,21 @@ function validateDropIndicator({
|
|
|
4532
4874
|
overId,
|
|
4533
4875
|
offsetStart,
|
|
4534
4876
|
elementStart,
|
|
4535
|
-
elementSize
|
|
4877
|
+
elementSize,
|
|
4878
|
+
sourceListId,
|
|
4879
|
+
targetListId
|
|
4536
4880
|
}) {
|
|
4537
4881
|
const activeIndex = keys.findIndex((id) => id === activeId);
|
|
4538
4882
|
const overIndex = keys.findIndex((id) => id === overId);
|
|
4539
|
-
if (
|
|
4540
|
-
|
|
4883
|
+
if (overIndex === -1) return void 0;
|
|
4884
|
+
if (activeIndex === -1 && sourceListId === targetListId) return void 0;
|
|
4885
|
+
const acceptsDropInside = acceptsDrop2(
|
|
4886
|
+
activeIndex,
|
|
4887
|
+
overIndex,
|
|
4888
|
+
"inside",
|
|
4889
|
+
sourceListId,
|
|
4890
|
+
targetListId
|
|
4891
|
+
);
|
|
4541
4892
|
if (isContainedInMiddleThird(elementStart, elementSize, offsetStart) && acceptsDropInside) {
|
|
4542
4893
|
return "inside";
|
|
4543
4894
|
}
|
|
@@ -4546,7 +4897,13 @@ function validateDropIndicator({
|
|
|
4546
4897
|
elementSize,
|
|
4547
4898
|
offsetStart
|
|
4548
4899
|
);
|
|
4549
|
-
const acceptedHalf = acceptsDrop2(
|
|
4900
|
+
const acceptedHalf = acceptsDrop2(
|
|
4901
|
+
activeIndex,
|
|
4902
|
+
overIndex,
|
|
4903
|
+
containingHalf,
|
|
4904
|
+
sourceListId,
|
|
4905
|
+
targetListId
|
|
4906
|
+
);
|
|
4550
4907
|
return acceptedHalf ? containingHalf : (
|
|
4551
4908
|
// Lastly, check if inside but not middle third
|
|
4552
4909
|
acceptsDropInside ? "inside" : void 0
|
|
@@ -4559,189 +4916,210 @@ function getContainingHalf(elementStart, elementSize, offsetStart) {
|
|
|
4559
4916
|
if (offsetStart < elementStart + elementSize / 2) return "above";
|
|
4560
4917
|
return "below";
|
|
4561
4918
|
}
|
|
4562
|
-
|
|
4919
|
+
|
|
4920
|
+
// src/components/sorting/Sortable.tsx
|
|
4921
|
+
var SortableItemContext2 = React47.createContext({
|
|
4922
|
+
keys: [],
|
|
4923
|
+
acceptsDrop: defaultAcceptsDrop,
|
|
4924
|
+
axis: "y",
|
|
4925
|
+
listId: "",
|
|
4926
|
+
getDropTargetParentIndex: void 0,
|
|
4927
|
+
activeDragContext: ActiveDragContext
|
|
4928
|
+
});
|
|
4929
|
+
function useSortableDropIndicator({
|
|
4563
4930
|
id,
|
|
4564
|
-
|
|
4565
|
-
|
|
4931
|
+
index,
|
|
4932
|
+
isDragging,
|
|
4933
|
+
overIndex,
|
|
4934
|
+
activeIndex,
|
|
4935
|
+
keys,
|
|
4936
|
+
acceptsDrop: acceptsDrop2,
|
|
4937
|
+
axis,
|
|
4938
|
+
listId,
|
|
4939
|
+
getDropTargetParentIndex
|
|
4566
4940
|
}) {
|
|
4567
|
-
const {
|
|
4568
|
-
|
|
4569
|
-
|
|
4570
|
-
|
|
4571
|
-
|
|
4572
|
-
|
|
4573
|
-
|
|
4574
|
-
} = React43.useContext(SortableItemContext);
|
|
4575
|
-
const sortable = (0, import_sortable.useSortable)({ id, disabled });
|
|
4576
|
-
const { activatorEvent } = (0, import_core.useDndContext)();
|
|
4577
|
-
const {
|
|
4578
|
-
active,
|
|
4579
|
-
attributes,
|
|
4580
|
-
listeners,
|
|
4581
|
-
setNodeRef,
|
|
4582
|
-
isDragging,
|
|
4583
|
-
index,
|
|
4584
|
-
activeIndex,
|
|
4585
|
-
overIndex,
|
|
4586
|
-
over
|
|
4587
|
-
} = sortable;
|
|
4588
|
-
if (activatorEvent) {
|
|
4589
|
-
setActivatorEvent(activatorEvent);
|
|
4941
|
+
const { active, over, activatorEvent } = (0, import_core2.useDndContext)();
|
|
4942
|
+
const { activeDragContext } = React47.useContext(SortableItemContext2);
|
|
4943
|
+
const { activeItem, delta: position } = useActiveDrag(activeDragContext);
|
|
4944
|
+
if (index < 0 || isDragging || !active || !over || !activeItem || !// Same-list drop: check normal overIndex matching
|
|
4945
|
+
(activeItem.listId === listId && index === overIndex || // Cross-list drop: check if we're hovering over this specific item
|
|
4946
|
+
activeItem.listId !== listId && over.id === id)) {
|
|
4947
|
+
return void 0;
|
|
4590
4948
|
}
|
|
4949
|
+
const isCrossContainer = activeItem.listId !== listId;
|
|
4950
|
+
const validationKeys = isCrossContainer ? [active.id, ...keys] : keys;
|
|
4591
4951
|
const eventX = activatorEvent?.clientX ?? 0;
|
|
4592
4952
|
const eventY = activatorEvent?.clientY ?? 0;
|
|
4593
4953
|
const offsetLeft = eventX + position.x;
|
|
4594
4954
|
const offsetTop = eventY + position.y;
|
|
4595
|
-
const ref = React43.useCallback((node) => setNodeRef(node), [setNodeRef]);
|
|
4596
4955
|
const parentIndex = overIndex === -1 ? void 0 : getDropTargetParentIndex?.(overIndex);
|
|
4597
|
-
const isValidParent = parentIndex === void 0 || parentIndex === -1 ? false : acceptsDrop2(activeIndex, parentIndex, "inside");
|
|
4598
|
-
const overIdAcceptsDrop = overIndex === -1 ? void 0 : acceptsDrop2(activeIndex, overIndex, "inside");
|
|
4956
|
+
const isValidParent = parentIndex === void 0 || parentIndex === -1 ? false : acceptsDrop2(activeIndex, parentIndex, "inside", listId, listId);
|
|
4957
|
+
const overIdAcceptsDrop = overIndex === -1 ? void 0 : acceptsDrop2(activeIndex, overIndex, "inside", listId, listId);
|
|
4599
4958
|
const relativeDropPosition = index >= 0 && index === overIndex && !isDragging && active && over ? validateDropIndicator({
|
|
4600
4959
|
acceptsDrop: acceptsDrop2,
|
|
4601
|
-
keys,
|
|
4960
|
+
keys: validationKeys,
|
|
4602
4961
|
activeId: active.id,
|
|
4603
4962
|
overId: over.id,
|
|
4604
4963
|
offsetStart: axis === "x" ? offsetLeft : offsetTop,
|
|
4605
4964
|
elementStart: axis === "x" ? over.rect.left : over.rect.top,
|
|
4606
|
-
elementSize: axis === "x" ? over.rect.width : over.rect.height
|
|
4965
|
+
elementSize: axis === "x" ? over.rect.width : over.rect.height,
|
|
4966
|
+
sourceListId: listId,
|
|
4967
|
+
targetListId: listId
|
|
4607
4968
|
}) : void 0;
|
|
4608
4969
|
const showDragInsideIndicatorOnParent = !overIdAcceptsDrop && isValidParent && parentIndex === index;
|
|
4970
|
+
return relativeDropPosition ?? (showDragInsideIndicatorOnParent ? "inside" : void 0);
|
|
4971
|
+
}
|
|
4972
|
+
function SortableItem({
|
|
4973
|
+
id,
|
|
4974
|
+
disabled,
|
|
4975
|
+
children
|
|
4976
|
+
}) {
|
|
4977
|
+
const { keys, acceptsDrop: acceptsDrop2, axis, listId, getDropTargetParentIndex } = React47.useContext(SortableItemContext2);
|
|
4978
|
+
const { attributes, listeners, setNodeRef, isDragging, index, overIndex } = (0, import_sortable.useSortable)({ id, disabled });
|
|
4979
|
+
const ref = React47.useCallback(
|
|
4980
|
+
(node) => setNodeRef(node),
|
|
4981
|
+
[setNodeRef]
|
|
4982
|
+
);
|
|
4983
|
+
const relativeDropPosition = useSortableDropIndicator({
|
|
4984
|
+
id,
|
|
4985
|
+
index,
|
|
4986
|
+
isDragging,
|
|
4987
|
+
overIndex,
|
|
4988
|
+
keys,
|
|
4989
|
+
acceptsDrop: acceptsDrop2,
|
|
4990
|
+
axis,
|
|
4991
|
+
listId,
|
|
4992
|
+
activeIndex: index,
|
|
4993
|
+
getDropTargetParentIndex
|
|
4994
|
+
});
|
|
4609
4995
|
return children({
|
|
4610
4996
|
ref,
|
|
4611
4997
|
...attributes,
|
|
4612
4998
|
...listeners,
|
|
4613
|
-
relativeDropPosition
|
|
4999
|
+
relativeDropPosition,
|
|
5000
|
+
style: {
|
|
5001
|
+
opacity: isDragging ? 0.5 : 1
|
|
5002
|
+
}
|
|
4614
5003
|
});
|
|
4615
5004
|
}
|
|
4616
|
-
function
|
|
5005
|
+
function SortableRoot_({
|
|
5006
|
+
id: idProp,
|
|
4617
5007
|
keys,
|
|
4618
|
-
children,
|
|
4619
5008
|
onMoveItem,
|
|
4620
5009
|
renderOverlay,
|
|
5010
|
+
acceptsFromList,
|
|
4621
5011
|
acceptsDrop: acceptsDrop2 = defaultAcceptsDrop,
|
|
4622
5012
|
axis = "y",
|
|
4623
|
-
|
|
5013
|
+
children,
|
|
5014
|
+
getDropTargetParentIndex,
|
|
5015
|
+
sharedDragProviderContexts,
|
|
5016
|
+
containerRef
|
|
4624
5017
|
}) {
|
|
4625
|
-
const
|
|
4626
|
-
|
|
4627
|
-
|
|
4628
|
-
|
|
4629
|
-
}
|
|
4630
|
-
})
|
|
5018
|
+
const defaultId = React47.useId();
|
|
5019
|
+
const id = idProp ?? defaultId;
|
|
5020
|
+
const { registerList, unregisterList } = useDragRegistration(
|
|
5021
|
+
sharedDragProviderContexts?.dragRegistrationContext ?? DragRegistrationContext
|
|
4631
5022
|
);
|
|
4632
|
-
const
|
|
4633
|
-
|
|
4634
|
-
|
|
4635
|
-
|
|
4636
|
-
|
|
5023
|
+
const { setNodeRef: setDroppableRef } = (0, import_core2.useDroppable)({
|
|
5024
|
+
id,
|
|
5025
|
+
// Make the container droppable only when the list is empty
|
|
5026
|
+
// This avoids conflicts with individual sortable items.
|
|
5027
|
+
// This isn't strictly necessary since we also use a custom collision detection
|
|
5028
|
+
// that prioritizes items over containers, but it helps with dropping into
|
|
5029
|
+
// the best position (either above or below, rather than always below).
|
|
5030
|
+
disabled: keys.length > 0
|
|
4637
5031
|
});
|
|
4638
|
-
|
|
4639
|
-
|
|
4640
|
-
|
|
4641
|
-
|
|
4642
|
-
|
|
4643
|
-
|
|
4644
|
-
|
|
4645
|
-
|
|
4646
|
-
|
|
4647
|
-
|
|
4648
|
-
|
|
4649
|
-
|
|
4650
|
-
|
|
4651
|
-
|
|
4652
|
-
|
|
4653
|
-
|
|
4654
|
-
|
|
4655
|
-
|
|
4656
|
-
const oldIndex = keys.findIndex((id) => id === active.id);
|
|
4657
|
-
const newIndex = keys.findIndex((id) => id === over.id);
|
|
4658
|
-
if (oldIndex === -1 || newIndex === -1) return;
|
|
4659
|
-
const eventX = activatorEvent.current?.clientX ?? 0;
|
|
4660
|
-
const eventY = activatorEvent.current?.clientY ?? 0;
|
|
4661
|
-
const offsetLeft = eventX + position.x;
|
|
4662
|
-
const offsetTop = eventY + position.y;
|
|
4663
|
-
const indicator = validateDropIndicator({
|
|
5032
|
+
React47.useEffect(() => {
|
|
5033
|
+
const listConfig = {
|
|
5034
|
+
id,
|
|
5035
|
+
keys,
|
|
5036
|
+
onMoveItem: onMoveItem ?? (() => {
|
|
5037
|
+
}),
|
|
5038
|
+
renderOverlay: (id2) => {
|
|
5039
|
+
const index = keys.findIndex((key) => key === id2);
|
|
5040
|
+
return renderOverlay?.(index) ?? null;
|
|
5041
|
+
},
|
|
5042
|
+
acceptsFromList: acceptsFromList ?? (({ sourceListId, targetListId }) => sourceListId === targetListId),
|
|
5043
|
+
acceptsDrop: acceptsDrop2,
|
|
5044
|
+
getDropIndicator: (parameters) => {
|
|
5045
|
+
const { absolutePosition, active, over, sourceListId, targetListId } = parameters;
|
|
5046
|
+
const offsetStart = axis === "x" ? absolutePosition.x : absolutePosition.y;
|
|
5047
|
+
const elementStart = axis === "x" ? over.rect.left : over.rect.top;
|
|
5048
|
+
const elementSize = axis === "x" ? over.rect.width : over.rect.height;
|
|
5049
|
+
const relativeDropPosition = validateDropIndicator({
|
|
4664
5050
|
acceptsDrop: acceptsDrop2,
|
|
4665
5051
|
keys,
|
|
4666
5052
|
activeId: active.id,
|
|
4667
5053
|
overId: over.id,
|
|
4668
|
-
offsetStart
|
|
4669
|
-
elementStart
|
|
4670
|
-
elementSize
|
|
5054
|
+
offsetStart,
|
|
5055
|
+
elementStart,
|
|
5056
|
+
elementSize,
|
|
5057
|
+
sourceListId,
|
|
5058
|
+
targetListId
|
|
4671
5059
|
});
|
|
4672
|
-
|
|
4673
|
-
onMoveItem?.(oldIndex, newIndex, indicator);
|
|
5060
|
+
return relativeDropPosition;
|
|
4674
5061
|
}
|
|
4675
|
-
}
|
|
4676
|
-
|
|
5062
|
+
};
|
|
5063
|
+
registerList(listConfig);
|
|
5064
|
+
return () => {
|
|
5065
|
+
unregisterList(id);
|
|
5066
|
+
};
|
|
5067
|
+
}, [
|
|
5068
|
+
id,
|
|
5069
|
+
onMoveItem,
|
|
5070
|
+
renderOverlay,
|
|
5071
|
+
acceptsFromList,
|
|
5072
|
+
acceptsDrop2,
|
|
5073
|
+
axis,
|
|
5074
|
+
registerList,
|
|
5075
|
+
unregisterList,
|
|
5076
|
+
keys
|
|
5077
|
+
]);
|
|
5078
|
+
const contextValue = React47.useMemo(
|
|
5079
|
+
() => ({
|
|
5080
|
+
keys,
|
|
5081
|
+
acceptsDrop: acceptsDrop2,
|
|
5082
|
+
axis,
|
|
5083
|
+
listId: id,
|
|
5084
|
+
getDropTargetParentIndex,
|
|
5085
|
+
activeDragContext: sharedDragProviderContexts?.activeDragContext ?? ActiveDragContext
|
|
5086
|
+
}),
|
|
5087
|
+
[
|
|
5088
|
+
keys,
|
|
5089
|
+
acceptsDrop2,
|
|
5090
|
+
axis,
|
|
5091
|
+
id,
|
|
5092
|
+
getDropTargetParentIndex,
|
|
5093
|
+
sharedDragProviderContexts
|
|
5094
|
+
]
|
|
4677
5095
|
);
|
|
4678
|
-
|
|
4679
|
-
|
|
4680
|
-
|
|
4681
|
-
|
|
4682
|
-
|
|
4683
|
-
|
|
5096
|
+
React47.useEffect(() => {
|
|
5097
|
+
if (containerRef) {
|
|
5098
|
+
setDroppableRef(containerRef.current);
|
|
5099
|
+
}
|
|
5100
|
+
});
|
|
5101
|
+
return /* @__PURE__ */ React47.createElement(SortableItemContext2.Provider, { value: contextValue }, /* @__PURE__ */ React47.createElement(
|
|
5102
|
+
import_sortable.SortableContext,
|
|
4684
5103
|
{
|
|
4685
|
-
|
|
4686
|
-
|
|
4687
|
-
keys,
|
|
4688
|
-
acceptsDrop: acceptsDrop2,
|
|
4689
|
-
position,
|
|
4690
|
-
setActivatorEvent,
|
|
4691
|
-
axis,
|
|
4692
|
-
getDropTargetParentIndex
|
|
4693
|
-
}),
|
|
4694
|
-
[
|
|
4695
|
-
acceptsDrop2,
|
|
4696
|
-
axis,
|
|
4697
|
-
getDropTargetParentIndex,
|
|
4698
|
-
keys,
|
|
4699
|
-
position,
|
|
4700
|
-
setActivatorEvent
|
|
4701
|
-
]
|
|
4702
|
-
)
|
|
5104
|
+
items: keys,
|
|
5105
|
+
strategy: axis === "x" ? import_sortable.horizontalListSortingStrategy : import_sortable.verticalListSortingStrategy
|
|
4703
5106
|
},
|
|
4704
|
-
|
|
4705
|
-
|
|
4706
|
-
{
|
|
4707
|
-
sensors,
|
|
4708
|
-
collisionDetection: import_core.closestCenter,
|
|
4709
|
-
onDragStart: handleDragStart,
|
|
4710
|
-
onDragMove: handleDragMove,
|
|
4711
|
-
onDragEnd: handleDragEnd
|
|
4712
|
-
},
|
|
4713
|
-
/* @__PURE__ */ React43.createElement(
|
|
4714
|
-
import_sortable.SortableContext,
|
|
4715
|
-
{
|
|
4716
|
-
items: keys,
|
|
4717
|
-
strategy: axis === "x" ? import_sortable.horizontalListSortingStrategy : import_sortable.verticalListSortingStrategy
|
|
4718
|
-
},
|
|
4719
|
-
children
|
|
4720
|
-
),
|
|
4721
|
-
mounted && renderOverlay && (0, import_react_dom2.createPortal)(
|
|
4722
|
-
/* @__PURE__ */ React43.createElement(import_core.DragOverlay, { dropAnimation: null }, activeIndex !== void 0 && activeIndex >= 0 && renderOverlay(activeIndex)),
|
|
4723
|
-
document.body
|
|
4724
|
-
)
|
|
4725
|
-
)
|
|
4726
|
-
);
|
|
5107
|
+
children
|
|
5108
|
+
));
|
|
4727
5109
|
}
|
|
4728
|
-
var
|
|
4729
|
-
|
|
4730
|
-
|
|
4731
|
-
|
|
4732
|
-
|
|
4733
|
-
|
|
4734
|
-
|
|
4735
|
-
|
|
4736
|
-
|
|
4737
|
-
shouldRenderOverlay = true,
|
|
4738
|
-
...rest
|
|
4739
|
-
} = props;
|
|
4740
|
-
const keys = React43.useMemo(
|
|
5110
|
+
var SortableRoot = withDragProvider(SortableRoot_);
|
|
5111
|
+
var Sortable_ = function Sortable_2({
|
|
5112
|
+
items,
|
|
5113
|
+
keyExtractor,
|
|
5114
|
+
shouldRenderOverlay = true,
|
|
5115
|
+
renderItem,
|
|
5116
|
+
...rest
|
|
5117
|
+
}) {
|
|
5118
|
+
const keys = React47.useMemo(
|
|
4741
5119
|
() => items.map(keyExtractor),
|
|
4742
5120
|
[items, keyExtractor]
|
|
4743
5121
|
);
|
|
4744
|
-
const renderOverlay =
|
|
5122
|
+
const renderOverlay = React47.useCallback(
|
|
4745
5123
|
(index) => {
|
|
4746
5124
|
return renderItem(
|
|
4747
5125
|
items[index],
|
|
@@ -4761,32 +5139,31 @@ var SortableComponent = memoGeneric(function Sortable(props) {
|
|
|
4761
5139
|
},
|
|
4762
5140
|
[renderItem, items]
|
|
4763
5141
|
);
|
|
4764
|
-
return /* @__PURE__ */
|
|
4765
|
-
|
|
5142
|
+
return /* @__PURE__ */ React47.createElement(
|
|
5143
|
+
SortableRoot,
|
|
4766
5144
|
{
|
|
4767
5145
|
...rest,
|
|
4768
5146
|
keys,
|
|
4769
5147
|
renderOverlay: shouldRenderOverlay ? renderOverlay : void 0
|
|
4770
5148
|
},
|
|
4771
|
-
keys.map((key, index) => /* @__PURE__ */
|
|
4772
|
-
return renderItem(
|
|
4773
|
-
items[index],
|
|
4774
|
-
props2,
|
|
4775
|
-
{ isOverlay: false }
|
|
4776
|
-
);
|
|
5149
|
+
keys.map((key, index) => /* @__PURE__ */ React47.createElement(SortableItem, { key, id: key }, (props) => {
|
|
5150
|
+
return renderItem(items[index], props, { isOverlay: false });
|
|
4777
5151
|
}))
|
|
4778
5152
|
);
|
|
5153
|
+
};
|
|
5154
|
+
var Sortable = Object.assign(Sortable_, {
|
|
5155
|
+
Root: SortableRoot,
|
|
5156
|
+
Item: SortableItem
|
|
4779
5157
|
});
|
|
4780
|
-
var Sortable2 = Object.assign(SortableComponent, SortableSubcomponents);
|
|
4781
5158
|
|
|
4782
5159
|
// src/components/ListView.tsx
|
|
4783
5160
|
var ROW_HEIGHT = 31;
|
|
4784
5161
|
var SECTION_HEADER_LABEL_HEIGHT = INPUT_HEIGHT;
|
|
4785
|
-
var ListViewDraggingContext = (0,
|
|
5162
|
+
var ListViewDraggingContext = (0, import_react52.createContext)({
|
|
4786
5163
|
indentation: 12
|
|
4787
5164
|
});
|
|
4788
5165
|
ListViewDraggingContext.displayName = "ListViewDraggingContext";
|
|
4789
|
-
var ListRowContext = (0,
|
|
5166
|
+
var ListRowContext = (0, import_react52.createContext)({
|
|
4790
5167
|
marginType: "none",
|
|
4791
5168
|
selectedPosition: "only",
|
|
4792
5169
|
sortable: false,
|
|
@@ -4804,7 +5181,7 @@ var ListViewRowTitle = ({
|
|
|
4804
5181
|
className,
|
|
4805
5182
|
children,
|
|
4806
5183
|
...props
|
|
4807
|
-
}) => /* @__PURE__ */
|
|
5184
|
+
}) => /* @__PURE__ */ import_react52.default.createElement(
|
|
4808
5185
|
"span",
|
|
4809
5186
|
{
|
|
4810
5187
|
className: cx(
|
|
@@ -4823,8 +5200,8 @@ function ListViewEditableRowTitle({
|
|
|
4823
5200
|
className,
|
|
4824
5201
|
onKeyDown
|
|
4825
5202
|
}) {
|
|
4826
|
-
const inputRef = (0,
|
|
4827
|
-
(0,
|
|
5203
|
+
const inputRef = (0, import_react52.useRef)(null);
|
|
5204
|
+
(0, import_react52.useLayoutEffect)(() => {
|
|
4828
5205
|
const element = inputRef.current;
|
|
4829
5206
|
if (!element || !autoFocus) return;
|
|
4830
5207
|
element.focus();
|
|
@@ -4832,7 +5209,7 @@ function ListViewEditableRowTitle({
|
|
|
4832
5209
|
element.select();
|
|
4833
5210
|
}, 1);
|
|
4834
5211
|
}, [autoFocus]);
|
|
4835
|
-
return /* @__PURE__ */
|
|
5212
|
+
return /* @__PURE__ */ import_react52.default.createElement(
|
|
4836
5213
|
InputField2.Input,
|
|
4837
5214
|
{
|
|
4838
5215
|
ref: inputRef,
|
|
@@ -4845,7 +5222,7 @@ function ListViewEditableRowTitle({
|
|
|
4845
5222
|
}
|
|
4846
5223
|
);
|
|
4847
5224
|
}
|
|
4848
|
-
var RowContainer = (0,
|
|
5225
|
+
var RowContainer = (0, import_react52.forwardRef)(
|
|
4849
5226
|
({
|
|
4850
5227
|
className,
|
|
4851
5228
|
$marginType,
|
|
@@ -4871,7 +5248,7 @@ var RowContainer = (0, import_react51.forwardRef)(
|
|
|
4871
5248
|
"aria-selected": ariaSelected,
|
|
4872
5249
|
...props
|
|
4873
5250
|
}, ref) => {
|
|
4874
|
-
return /* @__PURE__ */
|
|
5251
|
+
return /* @__PURE__ */ import_react52.default.createElement(
|
|
4875
5252
|
"div",
|
|
4876
5253
|
{
|
|
4877
5254
|
ref,
|
|
@@ -4939,7 +5316,7 @@ var RowContainer = (0, import_react51.forwardRef)(
|
|
|
4939
5316
|
);
|
|
4940
5317
|
}
|
|
4941
5318
|
);
|
|
4942
|
-
var ListViewDragIndicatorElement = (0,
|
|
5319
|
+
var ListViewDragIndicatorElement = (0, import_react52.forwardRef)(
|
|
4943
5320
|
({
|
|
4944
5321
|
className,
|
|
4945
5322
|
$relativeDropPosition,
|
|
@@ -4949,7 +5326,7 @@ var ListViewDragIndicatorElement = (0, import_react51.forwardRef)(
|
|
|
4949
5326
|
style: style2,
|
|
4950
5327
|
...props
|
|
4951
5328
|
}, ref) => {
|
|
4952
|
-
return /* @__PURE__ */
|
|
5329
|
+
return /* @__PURE__ */ import_react52.default.createElement(
|
|
4953
5330
|
"div",
|
|
4954
5331
|
{
|
|
4955
5332
|
ref,
|
|
@@ -5016,12 +5393,12 @@ var ListViewRow = forwardRefGeneric(function ListViewRow2({
|
|
|
5016
5393
|
divider,
|
|
5017
5394
|
gap: listGap,
|
|
5018
5395
|
colorScheme
|
|
5019
|
-
} = (0,
|
|
5396
|
+
} = (0, import_react52.useContext)(ListRowContext);
|
|
5020
5397
|
const { hoverProps } = useHover({
|
|
5021
5398
|
onHoverChange
|
|
5022
5399
|
});
|
|
5023
|
-
const { indentation, isDragOverlay } = (0,
|
|
5024
|
-
const handlePress = (0,
|
|
5400
|
+
const { indentation, isDragOverlay } = (0, import_react52.useContext)(ListViewDraggingContext);
|
|
5401
|
+
const handlePress = (0, import_react52.useCallback)(
|
|
5025
5402
|
(event) => {
|
|
5026
5403
|
event.preventDefault();
|
|
5027
5404
|
if (event.button !== 0) return;
|
|
@@ -5029,14 +5406,14 @@ var ListViewRow = forwardRefGeneric(function ListViewRow2({
|
|
|
5029
5406
|
},
|
|
5030
5407
|
[onPress]
|
|
5031
5408
|
);
|
|
5032
|
-
const handleDoubleClick = (0,
|
|
5409
|
+
const handleDoubleClick = (0, import_react52.useCallback)(
|
|
5033
5410
|
(event) => {
|
|
5034
5411
|
event.stopPropagation();
|
|
5035
5412
|
onDoubleClick?.();
|
|
5036
5413
|
},
|
|
5037
5414
|
[onDoubleClick]
|
|
5038
5415
|
);
|
|
5039
|
-
const mergedStyle = (0,
|
|
5416
|
+
const mergedStyle = (0, import_react52.useMemo)(() => {
|
|
5040
5417
|
return isDragOverlay ? {
|
|
5041
5418
|
// TODO: Where do these offsets actually come from?
|
|
5042
5419
|
transform: `translate3d(-36px, -6px, 0)`,
|
|
@@ -5050,7 +5427,7 @@ var ListViewRow = forwardRefGeneric(function ListViewRow2({
|
|
|
5050
5427
|
}, ref) => {
|
|
5051
5428
|
const Component = RowContainer;
|
|
5052
5429
|
const relativeDropPosition = testRelativeDropPosition ?? relativeDropPositionProp;
|
|
5053
|
-
const element = /* @__PURE__ */
|
|
5430
|
+
const element = /* @__PURE__ */ import_react52.default.createElement(
|
|
5054
5431
|
Component,
|
|
5055
5432
|
{
|
|
5056
5433
|
ref,
|
|
@@ -5084,7 +5461,7 @@ var ListViewRow = forwardRefGeneric(function ListViewRow2({
|
|
|
5084
5461
|
className,
|
|
5085
5462
|
$clickable: !!onPress
|
|
5086
5463
|
},
|
|
5087
|
-
relativeDropPosition && /* @__PURE__ */
|
|
5464
|
+
relativeDropPosition && /* @__PURE__ */ import_react52.default.createElement(
|
|
5088
5465
|
ListViewDragIndicatorElement,
|
|
5089
5466
|
{
|
|
5090
5467
|
key: relativeDropPosition,
|
|
@@ -5099,11 +5476,11 @@ var ListViewRow = forwardRefGeneric(function ListViewRow2({
|
|
|
5099
5476
|
}) : dragIndicatorStyle
|
|
5100
5477
|
}
|
|
5101
5478
|
),
|
|
5102
|
-
depth > 0 && /* @__PURE__ */
|
|
5479
|
+
depth > 0 && /* @__PURE__ */ import_react52.default.createElement(Spacer.Horizontal, { size: depth * indentation }),
|
|
5103
5480
|
children
|
|
5104
5481
|
);
|
|
5105
5482
|
if (menuItems && onSelectMenuItem) {
|
|
5106
|
-
return /* @__PURE__ */
|
|
5483
|
+
return /* @__PURE__ */ import_react52.default.createElement(
|
|
5107
5484
|
ContextMenu,
|
|
5108
5485
|
{
|
|
5109
5486
|
items: menuItems,
|
|
@@ -5116,23 +5493,23 @@ var ListViewRow = forwardRefGeneric(function ListViewRow2({
|
|
|
5116
5493
|
return element;
|
|
5117
5494
|
};
|
|
5118
5495
|
if (sortable && id) {
|
|
5119
|
-
return /* @__PURE__ */
|
|
5496
|
+
return /* @__PURE__ */ import_react52.default.createElement(Sortable.Item, { id, disabled: overrideSortable === false }, ({ ref: sortableRef, ...sortableProps }) => renderContent(
|
|
5120
5497
|
sortableProps,
|
|
5121
5498
|
(0, import_react_compose_refs2.composeRefs)(sortableRef, forwardedRef)
|
|
5122
5499
|
));
|
|
5123
5500
|
}
|
|
5124
5501
|
return renderContent({}, forwardedRef);
|
|
5125
5502
|
});
|
|
5126
|
-
var RenderItemContext = (0,
|
|
5503
|
+
var RenderItemContext = (0, import_react52.createContext)(
|
|
5127
5504
|
() => null
|
|
5128
5505
|
);
|
|
5129
5506
|
RenderItemContext.displayName = "RenderItemContext";
|
|
5130
|
-
var VirtualizedListRow = (0,
|
|
5507
|
+
var VirtualizedListRow = (0, import_react52.memo)(function VirtualizedListRow2({
|
|
5131
5508
|
index,
|
|
5132
5509
|
style: style2
|
|
5133
5510
|
}) {
|
|
5134
|
-
const renderItem = (0,
|
|
5135
|
-
return /* @__PURE__ */
|
|
5511
|
+
const renderItem = (0, import_react52.useContext)(RenderItemContext);
|
|
5512
|
+
return /* @__PURE__ */ import_react52.default.createElement("div", { key: index, style: style2 }, renderItem(index));
|
|
5136
5513
|
});
|
|
5137
5514
|
var VirtualizedListInner = forwardRefGeneric(function VirtualizedListInner2({
|
|
5138
5515
|
size: size2,
|
|
@@ -5142,20 +5519,20 @@ var VirtualizedListInner = forwardRefGeneric(function VirtualizedListInner2({
|
|
|
5142
5519
|
keyExtractor,
|
|
5143
5520
|
renderItem
|
|
5144
5521
|
}, ref) {
|
|
5145
|
-
const listRef = (0,
|
|
5146
|
-
(0,
|
|
5522
|
+
const listRef = (0, import_react52.useRef)(null);
|
|
5523
|
+
(0, import_react52.useImperativeHandle)(ref, () => ({
|
|
5147
5524
|
scrollToIndex(index) {
|
|
5148
5525
|
listRef.current?.scrollToItem(index);
|
|
5149
5526
|
}
|
|
5150
5527
|
}));
|
|
5151
|
-
(0,
|
|
5528
|
+
(0, import_react52.useLayoutEffect)(() => {
|
|
5152
5529
|
listRef.current?.resetAfterIndex(0);
|
|
5153
5530
|
}, [
|
|
5154
5531
|
// When items change, we need to re-render the virtualized list,
|
|
5155
5532
|
// since it doesn't currently support row height changes
|
|
5156
5533
|
items
|
|
5157
5534
|
]);
|
|
5158
|
-
const listStyle = (0,
|
|
5535
|
+
const listStyle = (0, import_react52.useMemo)(
|
|
5159
5536
|
() => ({
|
|
5160
5537
|
overflowX: "initial",
|
|
5161
5538
|
overflowY: "initial",
|
|
@@ -5163,18 +5540,18 @@ var VirtualizedListInner = forwardRefGeneric(function VirtualizedListInner2({
|
|
|
5163
5540
|
}),
|
|
5164
5541
|
[]
|
|
5165
5542
|
);
|
|
5166
|
-
return /* @__PURE__ */
|
|
5543
|
+
return /* @__PURE__ */ import_react52.default.createElement(RenderItemContext.Provider, { value: renderItem }, /* @__PURE__ */ import_react52.default.createElement(
|
|
5167
5544
|
import_react_virtualized.WindowScroller,
|
|
5168
5545
|
{
|
|
5169
5546
|
scrollElement,
|
|
5170
|
-
style: (0,
|
|
5547
|
+
style: (0, import_react52.useMemo)(() => ({ flex: "1 1 auto" }), [])
|
|
5171
5548
|
},
|
|
5172
|
-
(0,
|
|
5549
|
+
(0, import_react52.useCallback)(
|
|
5173
5550
|
({
|
|
5174
5551
|
registerChild,
|
|
5175
5552
|
onChildScroll,
|
|
5176
5553
|
scrollTop
|
|
5177
|
-
}) => /* @__PURE__ */
|
|
5554
|
+
}) => /* @__PURE__ */ import_react52.default.createElement("div", { ref: registerChild }, /* @__PURE__ */ import_react52.default.createElement(
|
|
5178
5555
|
import_react_window.VariableSizeList,
|
|
5179
5556
|
{
|
|
5180
5557
|
ref: listRef,
|
|
@@ -5204,7 +5581,7 @@ var VirtualizedListInner = forwardRefGeneric(function VirtualizedListInner2({
|
|
|
5204
5581
|
)
|
|
5205
5582
|
));
|
|
5206
5583
|
});
|
|
5207
|
-
var VirtualizedList = (0,
|
|
5584
|
+
var VirtualizedList = (0, import_react52.memo)(
|
|
5208
5585
|
VirtualizedListInner
|
|
5209
5586
|
);
|
|
5210
5587
|
var ListViewRootInner = forwardRefGeneric(function ListViewRootInner2({
|
|
@@ -5240,7 +5617,7 @@ var ListViewRootInner = forwardRefGeneric(function ListViewRootInner2({
|
|
|
5240
5617
|
renderEmptyState,
|
|
5241
5618
|
getDropTargetParentIndex
|
|
5242
5619
|
}, forwardedRef) {
|
|
5243
|
-
const handleClick = (0,
|
|
5620
|
+
const handleClick = (0, import_react52.useCallback)(
|
|
5244
5621
|
(event) => {
|
|
5245
5622
|
if (event.target instanceof HTMLElement && event.target.classList.contains("scroll-component"))
|
|
5246
5623
|
return;
|
|
@@ -5250,11 +5627,11 @@ var ListViewRootInner = forwardRefGeneric(function ListViewRootInner2({
|
|
|
5250
5627
|
},
|
|
5251
5628
|
[onPress]
|
|
5252
5629
|
);
|
|
5253
|
-
const renderChild = (0,
|
|
5630
|
+
const renderChild = (0, import_react52.useCallback)(
|
|
5254
5631
|
(index) => renderItem(data[index], index, { isDragOverlay: false }),
|
|
5255
5632
|
[data, renderItem]
|
|
5256
5633
|
);
|
|
5257
|
-
const defaultContextValue = (0,
|
|
5634
|
+
const defaultContextValue = (0, import_react52.useMemo)(
|
|
5258
5635
|
() => ({
|
|
5259
5636
|
colorScheme,
|
|
5260
5637
|
marginType: "none",
|
|
@@ -5279,16 +5656,16 @@ var ListViewRootInner = forwardRefGeneric(function ListViewRootInner2({
|
|
|
5279
5656
|
sectionHeaderVariant
|
|
5280
5657
|
]
|
|
5281
5658
|
);
|
|
5282
|
-
const getItemContextValue = (0,
|
|
5659
|
+
const getItemContextValue = (0, import_react52.useCallback)(
|
|
5283
5660
|
(i) => {
|
|
5284
5661
|
if (variant === "bare" || variant === "normal")
|
|
5285
5662
|
return defaultContextValue;
|
|
5286
5663
|
const current = renderChild(i);
|
|
5287
|
-
if (!(0,
|
|
5664
|
+
if (!(0, import_react52.isValidElement)(current)) return;
|
|
5288
5665
|
const prevChild = i - 1 >= 0 && renderChild(i - 1);
|
|
5289
5666
|
const nextChild = i + 1 < data.length && renderChild(i + 1);
|
|
5290
|
-
const next = (0,
|
|
5291
|
-
const prev = (0,
|
|
5667
|
+
const next = (0, import_react52.isValidElement)(nextChild) ? nextChild : void 0;
|
|
5668
|
+
const prev = (0, import_react52.isValidElement)(prevChild) ? prevChild : void 0;
|
|
5292
5669
|
const hasMarginTop = !prev;
|
|
5293
5670
|
const hasMarginBottom = !next || current.props.isSectionHeader || next && next.props.isSectionHeader;
|
|
5294
5671
|
let marginType;
|
|
@@ -5341,26 +5718,26 @@ var ListViewRootInner = forwardRefGeneric(function ListViewRootInner2({
|
|
|
5341
5718
|
gap
|
|
5342
5719
|
]
|
|
5343
5720
|
);
|
|
5344
|
-
const draggingContextOverlayValue = (0,
|
|
5721
|
+
const draggingContextOverlayValue = (0, import_react52.useMemo)(
|
|
5345
5722
|
() => ({ indentation, isDragOverlay: true }),
|
|
5346
5723
|
[indentation]
|
|
5347
5724
|
);
|
|
5348
|
-
const renderOverlay = (0,
|
|
5349
|
-
(index) => /* @__PURE__ */
|
|
5725
|
+
const renderOverlay = (0, import_react52.useCallback)(
|
|
5726
|
+
(index) => /* @__PURE__ */ import_react52.default.createElement("div", { style: { opacity: 0.25 } }, /* @__PURE__ */ import_react52.default.createElement(ListViewDraggingContext.Provider, { value: draggingContextOverlayValue }, renderItem(data[index], index, { isDragOverlay: true }))),
|
|
5350
5727
|
[draggingContextOverlayValue, renderItem, data]
|
|
5351
5728
|
);
|
|
5352
|
-
const renderWrappedChild = (0,
|
|
5729
|
+
const renderWrappedChild = (0, import_react52.useCallback)(
|
|
5353
5730
|
(index) => {
|
|
5354
5731
|
const contextValue = getItemContextValue(index);
|
|
5355
5732
|
const current = renderChild(index);
|
|
5356
|
-
if (!contextValue || !(0,
|
|
5357
|
-
return /* @__PURE__ */
|
|
5733
|
+
if (!contextValue || !(0, import_react52.isValidElement)(current)) return null;
|
|
5734
|
+
return /* @__PURE__ */ import_react52.default.createElement(ListRowContext.Provider, { key: current.key, value: contextValue }, current);
|
|
5358
5735
|
},
|
|
5359
5736
|
[getItemContextValue, renderChild]
|
|
5360
5737
|
);
|
|
5361
|
-
const ids = (0,
|
|
5362
|
-
const withSortable = (children) => sortable ? /* @__PURE__ */
|
|
5363
|
-
|
|
5738
|
+
const ids = (0, import_react52.useMemo)(() => data.map(keyExtractor), [keyExtractor, data]);
|
|
5739
|
+
const withSortable = (children) => sortable ? /* @__PURE__ */ import_react52.default.createElement(
|
|
5740
|
+
Sortable.Root,
|
|
5364
5741
|
{
|
|
5365
5742
|
onMoveItem,
|
|
5366
5743
|
keys: ids,
|
|
@@ -5370,8 +5747,8 @@ var ListViewRootInner = forwardRefGeneric(function ListViewRootInner2({
|
|
|
5370
5747
|
},
|
|
5371
5748
|
children
|
|
5372
5749
|
) : children;
|
|
5373
|
-
const withScrollable = (children) => scrollable ? /* @__PURE__ */
|
|
5374
|
-
const getItemHeight = (0,
|
|
5750
|
+
const withScrollable = (children) => scrollable ? /* @__PURE__ */ import_react52.default.createElement(ScrollArea, null, children) : children(null);
|
|
5751
|
+
const getItemHeight = (0, import_react52.useCallback)(
|
|
5375
5752
|
(index) => {
|
|
5376
5753
|
const child = getItemContextValue(index);
|
|
5377
5754
|
const height = child?.isSectionHeader && child.sectionHeaderVariant === "label" ? SECTION_HEADER_LABEL_HEIGHT : ROW_HEIGHT;
|
|
@@ -5379,13 +5756,13 @@ var ListViewRootInner = forwardRefGeneric(function ListViewRootInner2({
|
|
|
5379
5756
|
},
|
|
5380
5757
|
[getItemContextValue]
|
|
5381
5758
|
);
|
|
5382
|
-
const getKey = (0,
|
|
5759
|
+
const getKey = (0, import_react52.useCallback)(
|
|
5383
5760
|
(index) => keyExtractor(data[index], index),
|
|
5384
5761
|
[data, keyExtractor]
|
|
5385
5762
|
);
|
|
5386
|
-
const draggingContextValue = (0,
|
|
5387
|
-
const gapStyle = (0,
|
|
5388
|
-
return /* @__PURE__ */
|
|
5763
|
+
const draggingContextValue = (0, import_react52.useMemo)(() => ({ indentation }), [indentation]);
|
|
5764
|
+
const gapStyle = (0, import_react52.useMemo)(() => ({ gap: `${gap}px` }), [gap]);
|
|
5765
|
+
return /* @__PURE__ */ import_react52.default.createElement(ListViewDraggingContext.Provider, { value: draggingContextValue }, /* @__PURE__ */ import_react52.default.createElement(
|
|
5389
5766
|
"div",
|
|
5390
5767
|
{
|
|
5391
5768
|
id,
|
|
@@ -5414,7 +5791,7 @@ var ListViewRootInner = forwardRefGeneric(function ListViewRootInner2({
|
|
|
5414
5791
|
},
|
|
5415
5792
|
data.length === 0 && renderEmptyState ? renderEmptyState() : withScrollable(
|
|
5416
5793
|
(scrollElementRef) => withSortable(
|
|
5417
|
-
virtualized ? /* @__PURE__ */
|
|
5794
|
+
virtualized ? /* @__PURE__ */ import_react52.default.createElement(
|
|
5418
5795
|
VirtualizedList,
|
|
5419
5796
|
{
|
|
5420
5797
|
ref: forwardedRef,
|
|
@@ -5431,40 +5808,40 @@ var ListViewRootInner = forwardRefGeneric(function ListViewRootInner2({
|
|
|
5431
5808
|
));
|
|
5432
5809
|
});
|
|
5433
5810
|
var ListViewRoot = memoGeneric(ListViewRootInner);
|
|
5434
|
-
var ChildrenListViewInner = (0,
|
|
5435
|
-
const items = (0,
|
|
5436
|
-
() =>
|
|
5437
|
-
(child) => (0,
|
|
5811
|
+
var ChildrenListViewInner = (0, import_react52.forwardRef)(function ChildrenListViewInner2({ children, ...rest }, forwardedRef) {
|
|
5812
|
+
const items = (0, import_react52.useMemo)(
|
|
5813
|
+
() => import_react52.Children.toArray(children).flatMap(
|
|
5814
|
+
(child) => (0, import_react52.isValidElement)(child) ? [child] : []
|
|
5438
5815
|
),
|
|
5439
5816
|
[children]
|
|
5440
5817
|
);
|
|
5441
|
-
return /* @__PURE__ */
|
|
5818
|
+
return /* @__PURE__ */ import_react52.default.createElement(
|
|
5442
5819
|
ListViewRoot,
|
|
5443
5820
|
{
|
|
5444
5821
|
ref: forwardedRef,
|
|
5445
5822
|
...rest,
|
|
5446
5823
|
data: items,
|
|
5447
|
-
keyExtractor: (0,
|
|
5824
|
+
keyExtractor: (0, import_react52.useCallback)(
|
|
5448
5825
|
({ key }, index) => typeof key === "string" ? key : (key ?? index).toString(),
|
|
5449
5826
|
[]
|
|
5450
5827
|
),
|
|
5451
|
-
renderItem: (0,
|
|
5828
|
+
renderItem: (0, import_react52.useCallback)((item) => item, [])
|
|
5452
5829
|
}
|
|
5453
5830
|
);
|
|
5454
5831
|
});
|
|
5455
|
-
var ChildrenListView = (0,
|
|
5832
|
+
var ChildrenListView = (0, import_react52.memo)(ChildrenListViewInner);
|
|
5456
5833
|
var SimpleListViewInner = forwardRefGeneric(function SimpleListViewInner2(props, forwardedRef) {
|
|
5457
5834
|
if ("children" in props) {
|
|
5458
|
-
return /* @__PURE__ */
|
|
5835
|
+
return /* @__PURE__ */ import_react52.default.createElement(ChildrenListView, { ref: forwardedRef, ...props });
|
|
5459
5836
|
} else {
|
|
5460
|
-
return /* @__PURE__ */
|
|
5837
|
+
return /* @__PURE__ */ import_react52.default.createElement(ListViewRoot, { ref: forwardedRef, ...props });
|
|
5461
5838
|
}
|
|
5462
5839
|
});
|
|
5463
5840
|
var SimpleListView = memoGeneric(SimpleListViewInner);
|
|
5464
5841
|
var ListView;
|
|
5465
5842
|
((ListView2) => {
|
|
5466
|
-
ListView2.RowTitle = (0,
|
|
5467
|
-
ListView2.EditableRowTitle = (0,
|
|
5843
|
+
ListView2.RowTitle = (0, import_react52.memo)(ListViewRowTitle);
|
|
5844
|
+
ListView2.EditableRowTitle = (0, import_react52.memo)(ListViewEditableRowTitle);
|
|
5468
5845
|
ListView2.Row = memoGeneric(ListViewRow);
|
|
5469
5846
|
ListView2.Root = SimpleListView;
|
|
5470
5847
|
ListView2.RowContext = ListRowContext;
|
|
@@ -5481,7 +5858,7 @@ var ListView;
|
|
|
5481
5858
|
})(ListView || (ListView = {}));
|
|
5482
5859
|
|
|
5483
5860
|
// src/components/TreeView.tsx
|
|
5484
|
-
var
|
|
5861
|
+
var import_react53 = __toESM(require("react"));
|
|
5485
5862
|
var TreeRow = forwardRefGeneric(function TreeRow2({
|
|
5486
5863
|
icon,
|
|
5487
5864
|
expanded,
|
|
@@ -5490,15 +5867,15 @@ var TreeRow = forwardRefGeneric(function TreeRow2({
|
|
|
5490
5867
|
children,
|
|
5491
5868
|
...rest
|
|
5492
5869
|
}, forwardedRef) {
|
|
5493
|
-
const { expandable } = (0,
|
|
5494
|
-
const handleClickChevron = (0,
|
|
5870
|
+
const { expandable } = (0, import_react53.useContext)(ListView.RowContext);
|
|
5871
|
+
const handleClickChevron = (0, import_react53.useCallback)(
|
|
5495
5872
|
(event) => {
|
|
5496
5873
|
event.stopPropagation();
|
|
5497
5874
|
onClickChevron?.({ altKey: event.altKey });
|
|
5498
5875
|
},
|
|
5499
5876
|
[onClickChevron]
|
|
5500
5877
|
);
|
|
5501
|
-
return /* @__PURE__ */
|
|
5878
|
+
return /* @__PURE__ */ import_react53.default.createElement(ListView.Row, { ref: forwardedRef, ...rest }, expandable && /* @__PURE__ */ import_react53.default.createElement(import_react53.default.Fragment, null, expanded === void 0 ? /* @__PURE__ */ import_react53.default.createElement(Spacer.Horizontal, { size: 19 }) : /* @__PURE__ */ import_react53.default.createElement(
|
|
5502
5879
|
IconButton,
|
|
5503
5880
|
{
|
|
5504
5881
|
className: chevronClassName,
|
|
@@ -5506,7 +5883,7 @@ var TreeRow = forwardRefGeneric(function TreeRow2({
|
|
|
5506
5883
|
onClick: handleClickChevron,
|
|
5507
5884
|
selected: rest.selected
|
|
5508
5885
|
}
|
|
5509
|
-
), /* @__PURE__ */
|
|
5886
|
+
), /* @__PURE__ */ import_react53.default.createElement(Spacer.Horizontal, { size: 6 })), icon && /* @__PURE__ */ import_react53.default.createElement(import_react53.default.Fragment, null, renderIcon(icon), /* @__PURE__ */ import_react53.default.createElement(Spacer.Horizontal, { size: 10 })), children);
|
|
5510
5887
|
});
|
|
5511
5888
|
var TreeView;
|
|
5512
5889
|
((TreeView2) => {
|
|
@@ -5561,9 +5938,9 @@ var List = memoGeneric(
|
|
|
5561
5938
|
onClickItem,
|
|
5562
5939
|
dragIndicatorStyle
|
|
5563
5940
|
} = props;
|
|
5564
|
-
const [internalHoveredId, setHoveredId] = (0,
|
|
5565
|
-
const [internalRenamingId, setRenamingId] = (0,
|
|
5566
|
-
const [dropdownOpenId, setDropdownOpenId] = (0,
|
|
5941
|
+
const [internalHoveredId, setHoveredId] = (0, import_react54.useState)();
|
|
5942
|
+
const [internalRenamingId, setRenamingId] = (0, import_react54.useState)();
|
|
5943
|
+
const [dropdownOpenId, setDropdownOpenId] = (0, import_react54.useState)();
|
|
5567
5944
|
const hoveredId = internalHoveredId ?? testHoveredId;
|
|
5568
5945
|
const renamingId = testRenamingId ?? internalRenamingId;
|
|
5569
5946
|
const handleSelect = (itemId, event) => {
|
|
@@ -5588,17 +5965,17 @@ var List = memoGeneric(
|
|
|
5588
5965
|
);
|
|
5589
5966
|
};
|
|
5590
5967
|
const ViewComponent = expandable ? TreeView : ListView;
|
|
5591
|
-
const fileDropTargetRef = (0,
|
|
5968
|
+
const fileDropTargetRef = (0, import_react54.useRef)(null);
|
|
5592
5969
|
const { isDropTargetActive, dropTargetProps } = useFileDropTarget(
|
|
5593
5970
|
fileDropTargetRef,
|
|
5594
5971
|
onFilesDrop
|
|
5595
5972
|
);
|
|
5596
|
-
(0,
|
|
5973
|
+
(0, import_react54.useImperativeHandle)(ref, () => ({
|
|
5597
5974
|
editName: (id) => {
|
|
5598
5975
|
setRenamingId(id);
|
|
5599
5976
|
}
|
|
5600
5977
|
}));
|
|
5601
|
-
return /* @__PURE__ */
|
|
5978
|
+
return /* @__PURE__ */ import_react54.default.createElement(
|
|
5602
5979
|
ViewComponent.Root,
|
|
5603
5980
|
{
|
|
5604
5981
|
variant: "bare",
|
|
@@ -5641,7 +6018,7 @@ var List = memoGeneric(
|
|
|
5641
6018
|
handleSelect(id);
|
|
5642
6019
|
}
|
|
5643
6020
|
};
|
|
5644
|
-
const action = (isHovered || isSelected) && !isRenaming && (typeof renderAction === "function" ? renderAction({ item, selected: isSelected, onOpenChange }) : renderAction === "menu" && menuItems && /* @__PURE__ */
|
|
6021
|
+
const action = (isHovered || isSelected) && !isRenaming && (typeof renderAction === "function" ? renderAction({ item, selected: isSelected, onOpenChange }) : renderAction === "menu" && menuItems && /* @__PURE__ */ import_react54.default.createElement(
|
|
5645
6022
|
ActionMenu,
|
|
5646
6023
|
{
|
|
5647
6024
|
menuItems,
|
|
@@ -5657,7 +6034,7 @@ var List = memoGeneric(
|
|
|
5657
6034
|
));
|
|
5658
6035
|
const end = action || detailPosition === "end" && renderDetail?.(item, isSelected);
|
|
5659
6036
|
const below = detailPosition === "below" && renderDetail?.(item, isSelected);
|
|
5660
|
-
return /* @__PURE__ */
|
|
6037
|
+
return /* @__PURE__ */ import_react54.default.createElement(
|
|
5661
6038
|
ViewComponent.Row,
|
|
5662
6039
|
{
|
|
5663
6040
|
id,
|
|
@@ -5705,12 +6082,12 @@ var List = memoGeneric(
|
|
|
5705
6082
|
},
|
|
5706
6083
|
dragIndicatorStyle
|
|
5707
6084
|
},
|
|
5708
|
-
/* @__PURE__ */
|
|
6085
|
+
/* @__PURE__ */ import_react54.default.createElement(
|
|
5709
6086
|
"div",
|
|
5710
6087
|
{
|
|
5711
6088
|
className: cx("flex flex-1 items-center px-2", rowGapMap[size2])
|
|
5712
6089
|
},
|
|
5713
|
-
thumbnail && /* @__PURE__ */
|
|
6090
|
+
thumbnail && /* @__PURE__ */ import_react54.default.createElement(
|
|
5714
6091
|
"div",
|
|
5715
6092
|
{
|
|
5716
6093
|
className: cx(
|
|
@@ -5723,7 +6100,7 @@ var List = memoGeneric(
|
|
|
5723
6100
|
},
|
|
5724
6101
|
thumbnail
|
|
5725
6102
|
),
|
|
5726
|
-
/* @__PURE__ */
|
|
6103
|
+
/* @__PURE__ */ import_react54.default.createElement("div", { className: "flex flex-col flex-1 w-0" }, /* @__PURE__ */ import_react54.default.createElement("div", { className: "flex items-center min-h-input-height flex-1 gap-2" }, /* @__PURE__ */ import_react54.default.createElement("div", { className: "flex-1 w-0 flex items-center", tabIndex: -1 }, isRenaming ? /* @__PURE__ */ import_react54.default.createElement(
|
|
5727
6104
|
ViewComponent.EditableRowTitle,
|
|
5728
6105
|
{
|
|
5729
6106
|
value: getName(item),
|
|
@@ -5738,7 +6115,7 @@ var List = memoGeneric(
|
|
|
5738
6115
|
e.stopPropagation();
|
|
5739
6116
|
}
|
|
5740
6117
|
}
|
|
5741
|
-
) : /* @__PURE__ */
|
|
6118
|
+
) : /* @__PURE__ */ import_react54.default.createElement(
|
|
5742
6119
|
ViewComponent.RowTitle,
|
|
5743
6120
|
{
|
|
5744
6121
|
className: cx(
|
|
@@ -5747,8 +6124,8 @@ var List = memoGeneric(
|
|
|
5747
6124
|
)
|
|
5748
6125
|
},
|
|
5749
6126
|
getName(item)
|
|
5750
|
-
)), end && detailPosition === "end" && /* @__PURE__ */
|
|
5751
|
-
end && detailPosition === "below" && /* @__PURE__ */
|
|
6127
|
+
)), end && detailPosition === "end" && /* @__PURE__ */ import_react54.default.createElement(DetailContainer, { selected: isSelected }, end)), below && /* @__PURE__ */ import_react54.default.createElement(DetailContainer, { selected: isSelected }, below)),
|
|
6128
|
+
end && detailPosition === "below" && /* @__PURE__ */ import_react54.default.createElement(DetailContainer, { selected: isSelected }, end)
|
|
5752
6129
|
)
|
|
5753
6130
|
);
|
|
5754
6131
|
}
|
|
@@ -5756,11 +6133,11 @@ var List = memoGeneric(
|
|
|
5756
6133
|
);
|
|
5757
6134
|
})
|
|
5758
6135
|
);
|
|
5759
|
-
var DetailContainer = (0,
|
|
6136
|
+
var DetailContainer = (0, import_react54.memo)(function DetailContainer2({
|
|
5760
6137
|
children,
|
|
5761
6138
|
selected
|
|
5762
6139
|
}) {
|
|
5763
|
-
return /* @__PURE__ */
|
|
6140
|
+
return /* @__PURE__ */ import_react54.default.createElement(
|
|
5764
6141
|
"div",
|
|
5765
6142
|
{
|
|
5766
6143
|
className: cx("flex items-center gap-2", selected && "text-primary"),
|
|
@@ -5805,20 +6182,20 @@ var fontStyleMap = {
|
|
|
5805
6182
|
// src/components/Collection.tsx
|
|
5806
6183
|
var Collection = forwardRefGeneric(function Collection2(props, ref) {
|
|
5807
6184
|
const { viewType, ...rest } = props;
|
|
5808
|
-
return viewType === "grid" ? /* @__PURE__ */
|
|
6185
|
+
return viewType === "grid" ? /* @__PURE__ */ import_react55.default.createElement(Grid, { ref, ...rest }) : /* @__PURE__ */ import_react55.default.createElement(List, { ref, ...rest });
|
|
5809
6186
|
});
|
|
5810
6187
|
|
|
5811
6188
|
// src/components/ColorSwatch.tsx
|
|
5812
|
-
var
|
|
6189
|
+
var import_react56 = __toESM(require("react"));
|
|
5813
6190
|
var colorSwatchSizeMap = {
|
|
5814
6191
|
xsmall: 21,
|
|
5815
6192
|
small: 27,
|
|
5816
6193
|
medium: 36,
|
|
5817
6194
|
large: 48
|
|
5818
6195
|
};
|
|
5819
|
-
var ColorSwatch = (0,
|
|
6196
|
+
var ColorSwatch = (0, import_react56.forwardRef)(function ColorSwatch2({ color, size: size2 = "small", checked, style: style2, ...props }, ref) {
|
|
5820
6197
|
const sizePx = colorSwatchSizeMap[size2];
|
|
5821
|
-
return /* @__PURE__ */
|
|
6198
|
+
return /* @__PURE__ */ import_react56.default.createElement(
|
|
5822
6199
|
"button",
|
|
5823
6200
|
{
|
|
5824
6201
|
...props,
|
|
@@ -5839,7 +6216,7 @@ var ColorSwatch = (0, import_react55.forwardRef)(function ColorSwatch2({ color,
|
|
|
5839
6216
|
|
|
5840
6217
|
// src/components/ColorSwatchControl.tsx
|
|
5841
6218
|
var ToggleGroupPrimitive = __toESM(require("@radix-ui/react-toggle-group"));
|
|
5842
|
-
var
|
|
6219
|
+
var import_react57 = __toESM(require("react"));
|
|
5843
6220
|
function ColorSwatchControl(props) {
|
|
5844
6221
|
const {
|
|
5845
6222
|
options,
|
|
@@ -5854,7 +6231,7 @@ function ColorSwatchControl(props) {
|
|
|
5854
6231
|
id,
|
|
5855
6232
|
style: style2
|
|
5856
6233
|
} = props;
|
|
5857
|
-
const styles3 = (0,
|
|
6234
|
+
const styles3 = (0, import_react57.useMemo)(() => {
|
|
5858
6235
|
return {
|
|
5859
6236
|
display: "grid",
|
|
5860
6237
|
gridTemplateColumns: `repeat(auto-fill, minmax(${colorSwatchSizeMap[size2]}px, 1fr))`,
|
|
@@ -5862,8 +6239,8 @@ function ColorSwatchControl(props) {
|
|
|
5862
6239
|
...style2
|
|
5863
6240
|
};
|
|
5864
6241
|
}, [size2, style2]);
|
|
5865
|
-
const content = /* @__PURE__ */
|
|
5866
|
-
const item = /* @__PURE__ */
|
|
6242
|
+
const content = /* @__PURE__ */ import_react57.default.createElement("div", { className, id, style: styles3 }, options.map((option) => {
|
|
6243
|
+
const item = /* @__PURE__ */ import_react57.default.createElement(
|
|
5867
6244
|
ColorSwatch,
|
|
5868
6245
|
{
|
|
5869
6246
|
key: option,
|
|
@@ -5876,7 +6253,7 @@ function ColorSwatchControl(props) {
|
|
|
5876
6253
|
checked: value === option
|
|
5877
6254
|
}
|
|
5878
6255
|
);
|
|
5879
|
-
return /* @__PURE__ */
|
|
6256
|
+
return /* @__PURE__ */ import_react57.default.createElement(
|
|
5880
6257
|
ToggleGroupPrimitive.Item,
|
|
5881
6258
|
{
|
|
5882
6259
|
asChild: true,
|
|
@@ -5887,7 +6264,7 @@ function ColorSwatchControl(props) {
|
|
|
5887
6264
|
item
|
|
5888
6265
|
);
|
|
5889
6266
|
}));
|
|
5890
|
-
return /* @__PURE__ */
|
|
6267
|
+
return /* @__PURE__ */ import_react57.default.createElement(
|
|
5891
6268
|
ToggleGroupPrimitive.Root,
|
|
5892
6269
|
{
|
|
5893
6270
|
type: "single",
|
|
@@ -5902,11 +6279,11 @@ function ColorSwatchControl(props) {
|
|
|
5902
6279
|
|
|
5903
6280
|
// src/components/Combobox.tsx
|
|
5904
6281
|
var import_noya_icons5 = require("@noya-app/noya-icons");
|
|
5905
|
-
var
|
|
6282
|
+
var import_react60 = __toESM(require("react"));
|
|
5906
6283
|
|
|
5907
6284
|
// src/utils/combobox.ts
|
|
5908
6285
|
var import_noya_utils9 = require("@noya-app/noya-utils");
|
|
5909
|
-
var
|
|
6286
|
+
var import_react58 = require("react");
|
|
5910
6287
|
|
|
5911
6288
|
// src/utils/fuzzyScorer.ts
|
|
5912
6289
|
var import_vscode_fuzzy_scorer = require("vscode-fuzzy-scorer");
|
|
@@ -6228,7 +6605,7 @@ function getNextIndex({
|
|
|
6228
6605
|
return nextIndex;
|
|
6229
6606
|
}
|
|
6230
6607
|
function useComboboxState(state) {
|
|
6231
|
-
return (0,
|
|
6608
|
+
return (0, import_react58.useSyncExternalStore)(
|
|
6232
6609
|
state.subscribe,
|
|
6233
6610
|
state.getSnapshot,
|
|
6234
6611
|
state.getSnapshot
|
|
@@ -6237,7 +6614,7 @@ function useComboboxState(state) {
|
|
|
6237
6614
|
|
|
6238
6615
|
// src/components/ComboboxMenu.tsx
|
|
6239
6616
|
var import_noya_icons4 = require("@noya-app/noya-icons");
|
|
6240
|
-
var
|
|
6617
|
+
var import_react59 = __toESM(require("react"));
|
|
6241
6618
|
var ComboboxMenu = memoGeneric(
|
|
6242
6619
|
forwardRefGeneric(function ComboboxMenu2({
|
|
6243
6620
|
items,
|
|
@@ -6249,7 +6626,7 @@ var ComboboxMenu = memoGeneric(
|
|
|
6249
6626
|
indented,
|
|
6250
6627
|
iconPosition = "right"
|
|
6251
6628
|
}, forwardedRef) {
|
|
6252
|
-
return /* @__PURE__ */
|
|
6629
|
+
return /* @__PURE__ */ import_react59.default.createElement(
|
|
6253
6630
|
ListView.Root,
|
|
6254
6631
|
{
|
|
6255
6632
|
ref: forwardedRef,
|
|
@@ -6265,7 +6642,7 @@ var ComboboxMenu = memoGeneric(
|
|
|
6265
6642
|
style: style2,
|
|
6266
6643
|
renderItem: (item, i) => {
|
|
6267
6644
|
if (item.type === "sectionHeader") {
|
|
6268
|
-
return /* @__PURE__ */
|
|
6645
|
+
return /* @__PURE__ */ import_react59.default.createElement(ListView.Row, { key: item.id, isSectionHeader: true }, indented && /* @__PURE__ */ import_react59.default.createElement(
|
|
6269
6646
|
Spacer.Horizontal,
|
|
6270
6647
|
{
|
|
6271
6648
|
size: CHECKBOX_WIDTH - CHECKBOX_RIGHT_INSET + CHECKBOX_INDENT_WIDTH
|
|
@@ -6276,7 +6653,7 @@ var ComboboxMenu = memoGeneric(
|
|
|
6276
6653
|
item: typeof item.title === "string" ? item.title : item.value,
|
|
6277
6654
|
itemScore: item
|
|
6278
6655
|
});
|
|
6279
|
-
return /* @__PURE__ */
|
|
6656
|
+
return /* @__PURE__ */ import_react59.default.createElement(
|
|
6280
6657
|
ListView.Row,
|
|
6281
6658
|
{
|
|
6282
6659
|
key: item.value,
|
|
@@ -6289,12 +6666,12 @@ var ComboboxMenu = memoGeneric(
|
|
|
6289
6666
|
}
|
|
6290
6667
|
}
|
|
6291
6668
|
},
|
|
6292
|
-
/* @__PURE__ */
|
|
6669
|
+
/* @__PURE__ */ import_react59.default.createElement("div", { className: "flex flex-1 min-w-0 items-center" }, indented && /* @__PURE__ */ import_react59.default.createElement(Spacer.Horizontal, { size: CHECKBOX_INDENT_WIDTH }), item.checked ? /* @__PURE__ */ import_react59.default.createElement("div", { ...styles.itemIndicator }, /* @__PURE__ */ import_react59.default.createElement(import_noya_icons4.CheckIcon, null)) : indented ? /* @__PURE__ */ import_react59.default.createElement(
|
|
6293
6670
|
Spacer.Horizontal,
|
|
6294
6671
|
{
|
|
6295
6672
|
size: CHECKBOX_WIDTH - CHECKBOX_RIGHT_INSET
|
|
6296
6673
|
}
|
|
6297
|
-
) : null, iconPosition === "left" && item.icon && /* @__PURE__ */
|
|
6674
|
+
) : null, iconPosition === "left" && item.icon && /* @__PURE__ */ import_react59.default.createElement(import_react59.default.Fragment, null, renderIcon(item.icon), /* @__PURE__ */ import_react59.default.createElement(Spacer.Horizontal, { size: 8 })), tokens.map((token, j) => /* @__PURE__ */ import_react59.default.createElement(
|
|
6298
6675
|
"span",
|
|
6299
6676
|
{
|
|
6300
6677
|
key: `${item.value}-token-${j}`,
|
|
@@ -6305,7 +6682,7 @@ var ComboboxMenu = memoGeneric(
|
|
|
6305
6682
|
},
|
|
6306
6683
|
token.text
|
|
6307
6684
|
))),
|
|
6308
|
-
(item.shortcut || item.icon && iconPosition === "right") && /* @__PURE__ */
|
|
6685
|
+
(item.shortcut || item.icon && iconPosition === "right") && /* @__PURE__ */ import_react59.default.createElement(import_react59.default.Fragment, null, item.shortcut ? /* @__PURE__ */ import_react59.default.createElement(KeyboardShortcut, { shortcut: item.shortcut }) : item.icon && renderIcon(item.icon))
|
|
6309
6686
|
);
|
|
6310
6687
|
}
|
|
6311
6688
|
}
|
|
@@ -6332,7 +6709,7 @@ var Combobox = memoGeneric(
|
|
|
6332
6709
|
onDeleteWhenEmpty,
|
|
6333
6710
|
...rest
|
|
6334
6711
|
}, forwardedRef) {
|
|
6335
|
-
const props = (0,
|
|
6712
|
+
const props = (0, import_react60.useMemo)(() => {
|
|
6336
6713
|
if (rest.mode === "string") {
|
|
6337
6714
|
return {
|
|
6338
6715
|
mode: rest.mode,
|
|
@@ -6362,7 +6739,7 @@ var Combobox = memoGeneric(
|
|
|
6362
6739
|
rest.onBlur,
|
|
6363
6740
|
rest.allowArbitraryValues
|
|
6364
6741
|
]);
|
|
6365
|
-
const ref = (0,
|
|
6742
|
+
const ref = (0, import_react60.useRef)(null);
|
|
6366
6743
|
function getInitialValueString() {
|
|
6367
6744
|
if (props.mode === "string") {
|
|
6368
6745
|
return props.value ?? "";
|
|
@@ -6371,7 +6748,7 @@ var Combobox = memoGeneric(
|
|
|
6371
6748
|
}
|
|
6372
6749
|
}
|
|
6373
6750
|
const initialValueString = getInitialValueString();
|
|
6374
|
-
const [comboboxState] = (0,
|
|
6751
|
+
const [comboboxState] = (0, import_react60.useState)(
|
|
6375
6752
|
() => new ComboboxState(
|
|
6376
6753
|
items,
|
|
6377
6754
|
initialValueString,
|
|
@@ -6379,26 +6756,26 @@ var Combobox = memoGeneric(
|
|
|
6379
6756
|
)
|
|
6380
6757
|
);
|
|
6381
6758
|
const state = useComboboxState(comboboxState);
|
|
6382
|
-
const [isFocused, setIsFocused] = (0,
|
|
6383
|
-
const listRef = (0,
|
|
6384
|
-
const [shouldBlur, setShouldBlur] = (0,
|
|
6759
|
+
const [isFocused, setIsFocused] = (0, import_react60.useState)(false);
|
|
6760
|
+
const listRef = (0, import_react60.useRef)(null);
|
|
6761
|
+
const [shouldBlur, setShouldBlur] = (0, import_react60.useState)(false);
|
|
6385
6762
|
const { fieldId: id } = useLabel({
|
|
6386
6763
|
fieldId: rest.id
|
|
6387
6764
|
});
|
|
6388
|
-
(0,
|
|
6765
|
+
(0, import_react60.useEffect)(() => {
|
|
6389
6766
|
comboboxState.setItems(items);
|
|
6390
6767
|
}, [items, comboboxState]);
|
|
6391
|
-
(0,
|
|
6768
|
+
(0, import_react60.useEffect)(() => {
|
|
6392
6769
|
comboboxState.setFilter(initialValueString);
|
|
6393
6770
|
}, [comboboxState, initialValueString]);
|
|
6394
6771
|
const { filter, selectedIndex, filteredItems } = state;
|
|
6395
6772
|
const shouldShowMenu = isFocused && !(hideMenuWhenEmptyValue && filter === "");
|
|
6396
|
-
(0,
|
|
6773
|
+
(0, import_react60.useEffect)(() => {
|
|
6397
6774
|
if (listRef.current) {
|
|
6398
6775
|
listRef.current.scrollToIndex(selectedIndex);
|
|
6399
6776
|
}
|
|
6400
6777
|
}, [selectedIndex]);
|
|
6401
|
-
const handleBlur = (0,
|
|
6778
|
+
const handleBlur = (0, import_react60.useCallback)(() => {
|
|
6402
6779
|
ref.current?.blur();
|
|
6403
6780
|
comboboxState.reset(initialValueString);
|
|
6404
6781
|
if (props.mode === "string") {
|
|
@@ -6417,7 +6794,7 @@ var Combobox = memoGeneric(
|
|
|
6417
6794
|
}
|
|
6418
6795
|
setIsFocused(false);
|
|
6419
6796
|
}, [filter, initialValueString, props, state, comboboxState]);
|
|
6420
|
-
const handleFocus = (0,
|
|
6797
|
+
const handleFocus = (0, import_react60.useCallback)(
|
|
6421
6798
|
(event) => {
|
|
6422
6799
|
setIsFocused(true);
|
|
6423
6800
|
comboboxState.reset(
|
|
@@ -6431,7 +6808,7 @@ var Combobox = memoGeneric(
|
|
|
6431
6808
|
},
|
|
6432
6809
|
[initialValueString, onFocus, openMenuBehavior, comboboxState]
|
|
6433
6810
|
);
|
|
6434
|
-
const handleUpdateSelection = (0,
|
|
6811
|
+
const handleUpdateSelection = (0, import_react60.useCallback)(
|
|
6435
6812
|
(item) => {
|
|
6436
6813
|
if (item.type !== void 0) return;
|
|
6437
6814
|
const selectedItem = comboboxState.selectCurrentItem(item);
|
|
@@ -6447,7 +6824,7 @@ var Combobox = memoGeneric(
|
|
|
6447
6824
|
},
|
|
6448
6825
|
[props, comboboxState]
|
|
6449
6826
|
);
|
|
6450
|
-
const handleIndexChange = (0,
|
|
6827
|
+
const handleIndexChange = (0, import_react60.useCallback)(
|
|
6451
6828
|
(index) => {
|
|
6452
6829
|
comboboxState.setSelectedIndex(index);
|
|
6453
6830
|
const item = comboboxState.getSelectedItem();
|
|
@@ -6463,7 +6840,7 @@ var Combobox = memoGeneric(
|
|
|
6463
6840
|
},
|
|
6464
6841
|
[props, comboboxState]
|
|
6465
6842
|
);
|
|
6466
|
-
const handleChange = (0,
|
|
6843
|
+
const handleChange = (0, import_react60.useCallback)(
|
|
6467
6844
|
(value) => {
|
|
6468
6845
|
if (readOnly) return;
|
|
6469
6846
|
comboboxState.setFilter(value);
|
|
@@ -6478,7 +6855,7 @@ var Combobox = memoGeneric(
|
|
|
6478
6855
|
},
|
|
6479
6856
|
[readOnly, props, comboboxState]
|
|
6480
6857
|
);
|
|
6481
|
-
const handleKeyDown = (0,
|
|
6858
|
+
const handleKeyDown = (0, import_react60.useCallback)(
|
|
6482
6859
|
(event) => {
|
|
6483
6860
|
let handled = false;
|
|
6484
6861
|
const item = comboboxState.getSelectedItem();
|
|
@@ -6567,7 +6944,7 @@ var Combobox = memoGeneric(
|
|
|
6567
6944
|
]
|
|
6568
6945
|
);
|
|
6569
6946
|
const typeaheadValue = comboboxState.getTypeaheadValue();
|
|
6570
|
-
(0,
|
|
6947
|
+
(0, import_react60.useImperativeHandle)(forwardedRef, () => ({
|
|
6571
6948
|
focus: () => {
|
|
6572
6949
|
ref.current?.focus();
|
|
6573
6950
|
if (ref.current) {
|
|
@@ -6586,7 +6963,7 @@ var Combobox = memoGeneric(
|
|
|
6586
6963
|
ref.current?.setSelectionRange(0, ref.current.value.length);
|
|
6587
6964
|
}
|
|
6588
6965
|
}));
|
|
6589
|
-
const handleChevronClick = (0,
|
|
6966
|
+
const handleChevronClick = (0, import_react60.useCallback)(
|
|
6590
6967
|
(event) => {
|
|
6591
6968
|
event.stopPropagation();
|
|
6592
6969
|
if (shouldShowMenu) {
|
|
@@ -6606,14 +6983,14 @@ var Combobox = memoGeneric(
|
|
|
6606
6983
|
comboboxState
|
|
6607
6984
|
]
|
|
6608
6985
|
);
|
|
6609
|
-
(0,
|
|
6986
|
+
(0, import_react60.useEffect)(() => {
|
|
6610
6987
|
if (!shouldBlur) return;
|
|
6611
6988
|
if (document.activeElement !== ref.current) return;
|
|
6612
6989
|
setShouldBlur(false);
|
|
6613
6990
|
ref.current?.focus();
|
|
6614
6991
|
handleBlur();
|
|
6615
6992
|
}, [shouldBlur, handleBlur]);
|
|
6616
|
-
const { sectionHeaderCount, menuItemsCount } = (0,
|
|
6993
|
+
const { sectionHeaderCount, menuItemsCount } = (0, import_react60.useMemo)(
|
|
6617
6994
|
() => ({
|
|
6618
6995
|
sectionHeaderCount: filteredItems.filter(
|
|
6619
6996
|
(item) => isMenuItemSectionHeader(item)
|
|
@@ -6627,19 +7004,19 @@ var Combobox = memoGeneric(
|
|
|
6627
7004
|
const hasCheckedItems = items.some(
|
|
6628
7005
|
(item) => isSelectableMenuItem(item) && item.checked
|
|
6629
7006
|
);
|
|
6630
|
-
return /* @__PURE__ */
|
|
7007
|
+
return /* @__PURE__ */ import_react60.default.createElement(
|
|
6631
7008
|
InputField2.Root,
|
|
6632
7009
|
{
|
|
6633
7010
|
id,
|
|
6634
7011
|
size: size2,
|
|
6635
7012
|
sideOffset: 6,
|
|
6636
|
-
end: /* @__PURE__ */
|
|
7013
|
+
end: /* @__PURE__ */ import_react60.default.createElement(import_react60.default.Fragment, null, loading && /* @__PURE__ */ import_react60.default.createElement("div", { className: "pr-1.5" }, /* @__PURE__ */ import_react60.default.createElement(ActivityIndicator, null)), !readOnly && /* @__PURE__ */ import_react60.default.createElement(
|
|
6637
7014
|
InputField2.Button,
|
|
6638
7015
|
{
|
|
6639
7016
|
variant: "floating",
|
|
6640
7017
|
onClick: handleChevronClick
|
|
6641
7018
|
},
|
|
6642
|
-
/* @__PURE__ */
|
|
7019
|
+
/* @__PURE__ */ import_react60.default.createElement(
|
|
6643
7020
|
import_noya_icons5.DropdownChevronIcon,
|
|
6644
7021
|
{
|
|
6645
7022
|
className: cx(
|
|
@@ -6658,7 +7035,7 @@ var Combobox = memoGeneric(
|
|
|
6658
7035
|
ListView.rowHeight * 10.5
|
|
6659
7036
|
);
|
|
6660
7037
|
const listSize = { width, height };
|
|
6661
|
-
return /* @__PURE__ */
|
|
7038
|
+
return /* @__PURE__ */ import_react60.default.createElement(
|
|
6662
7039
|
"div",
|
|
6663
7040
|
{
|
|
6664
7041
|
className: cx(
|
|
@@ -6666,7 +7043,7 @@ var Combobox = memoGeneric(
|
|
|
6666
7043
|
shouldShowMenu && !readOnly ? "flex" : "hidden"
|
|
6667
7044
|
)
|
|
6668
7045
|
},
|
|
6669
|
-
filteredItems.length > 0 && !loading ? /* @__PURE__ */
|
|
7046
|
+
filteredItems.length > 0 && !loading ? /* @__PURE__ */ import_react60.default.createElement(
|
|
6670
7047
|
ComboboxMenu,
|
|
6671
7048
|
{
|
|
6672
7049
|
ref: listRef,
|
|
@@ -6680,11 +7057,11 @@ var Combobox = memoGeneric(
|
|
|
6680
7057
|
},
|
|
6681
7058
|
indented: hasCheckedItems
|
|
6682
7059
|
}
|
|
6683
|
-
) : /* @__PURE__ */
|
|
7060
|
+
) : /* @__PURE__ */ import_react60.default.createElement("div", { className: "flex flex-col h-[50px] p-5 items-center justify-center" }, /* @__PURE__ */ import_react60.default.createElement(Small, { className: "text-text-disabled" }, loading ? "Loading..." : "No results"))
|
|
6684
7061
|
);
|
|
6685
7062
|
}
|
|
6686
7063
|
},
|
|
6687
|
-
/* @__PURE__ */
|
|
7064
|
+
/* @__PURE__ */ import_react60.default.createElement(
|
|
6688
7065
|
InputField2.Input,
|
|
6689
7066
|
{
|
|
6690
7067
|
ref,
|
|
@@ -6709,7 +7086,7 @@ var Combobox = memoGeneric(
|
|
|
6709
7086
|
...readOnly ? { readOnly: true } : {}
|
|
6710
7087
|
}
|
|
6711
7088
|
),
|
|
6712
|
-
filter && typeaheadValue && typeaheadValue.toLowerCase().startsWith(filter.toLowerCase()) && /* @__PURE__ */
|
|
7089
|
+
filter && typeaheadValue && typeaheadValue.toLowerCase().startsWith(filter.toLowerCase()) && /* @__PURE__ */ import_react60.default.createElement(
|
|
6713
7090
|
InputField2.Typeahead,
|
|
6714
7091
|
{
|
|
6715
7092
|
value: typeaheadValue,
|
|
@@ -6723,22 +7100,22 @@ var Combobox = memoGeneric(
|
|
|
6723
7100
|
);
|
|
6724
7101
|
|
|
6725
7102
|
// src/components/CommandPalette.tsx
|
|
6726
|
-
var
|
|
7103
|
+
var import_react63 = __toESM(require("react"));
|
|
6727
7104
|
|
|
6728
7105
|
// src/components/SearchCompletionMenu.tsx
|
|
6729
7106
|
var import_noya_keymap5 = require("@noya-app/noya-keymap");
|
|
6730
|
-
var
|
|
7107
|
+
var import_react62 = __toESM(require("react"));
|
|
6731
7108
|
|
|
6732
7109
|
// src/components/Divider.tsx
|
|
6733
|
-
var
|
|
6734
|
-
var Divider = (0,
|
|
7110
|
+
var import_react61 = __toESM(require("react"));
|
|
7111
|
+
var Divider = (0, import_react61.memo)(function Divider2({
|
|
6735
7112
|
variant = "normal",
|
|
6736
7113
|
overflow = 0,
|
|
6737
7114
|
className,
|
|
6738
7115
|
style: style2,
|
|
6739
7116
|
...props
|
|
6740
7117
|
}) {
|
|
6741
|
-
return /* @__PURE__ */
|
|
7118
|
+
return /* @__PURE__ */ import_react61.default.createElement(
|
|
6742
7119
|
"div",
|
|
6743
7120
|
{
|
|
6744
7121
|
className: cx(
|
|
@@ -6758,14 +7135,14 @@ var Divider = (0, import_react60.memo)(function Divider2({
|
|
|
6758
7135
|
}
|
|
6759
7136
|
);
|
|
6760
7137
|
});
|
|
6761
|
-
var DividerVertical = (0,
|
|
7138
|
+
var DividerVertical = (0, import_react61.memo)(function DividerVertical2({
|
|
6762
7139
|
variant = "normal",
|
|
6763
7140
|
overflow = 0,
|
|
6764
7141
|
className,
|
|
6765
7142
|
style: style2,
|
|
6766
7143
|
...props
|
|
6767
7144
|
}) {
|
|
6768
|
-
return /* @__PURE__ */
|
|
7145
|
+
return /* @__PURE__ */ import_react61.default.createElement(
|
|
6769
7146
|
"div",
|
|
6770
7147
|
{
|
|
6771
7148
|
className: cx(`
|
|
@@ -6785,7 +7162,7 @@ var DividerVertical = (0, import_react60.memo)(function DividerVertical2({
|
|
|
6785
7162
|
});
|
|
6786
7163
|
|
|
6787
7164
|
// src/components/SearchCompletionMenu.tsx
|
|
6788
|
-
var SearchCompletionMenu = (0,
|
|
7165
|
+
var SearchCompletionMenu = (0, import_react62.forwardRef)(function SearchCompletionMenu2({
|
|
6789
7166
|
onSelect,
|
|
6790
7167
|
onHover,
|
|
6791
7168
|
onClose,
|
|
@@ -6794,17 +7171,17 @@ var SearchCompletionMenu = (0, import_react61.forwardRef)(function SearchComplet
|
|
|
6794
7171
|
testSelectedIndex,
|
|
6795
7172
|
testSearch
|
|
6796
7173
|
}, forwardedRef) {
|
|
6797
|
-
const [state, setState] = (0,
|
|
7174
|
+
const [state, setState] = (0, import_react62.useState)({
|
|
6798
7175
|
search: testSearch ?? "",
|
|
6799
7176
|
index: 0
|
|
6800
7177
|
});
|
|
6801
7178
|
const { index, search } = state;
|
|
6802
|
-
const listRef =
|
|
7179
|
+
const listRef = import_react62.default.useRef(null);
|
|
6803
7180
|
const hasCheckedItems = items.some((item) => item.checked);
|
|
6804
|
-
(0,
|
|
7181
|
+
(0, import_react62.useEffect)(() => {
|
|
6805
7182
|
listRef.current?.scrollToIndex(index);
|
|
6806
7183
|
}, [index]);
|
|
6807
|
-
const results = (0,
|
|
7184
|
+
const results = (0, import_react62.useMemo)(
|
|
6808
7185
|
() => fuzzyFilter({
|
|
6809
7186
|
items: items.map(
|
|
6810
7187
|
(item) => typeof item.title === "string" ? item.title : item.value
|
|
@@ -6816,13 +7193,13 @@ var SearchCompletionMenu = (0, import_react61.forwardRef)(function SearchComplet
|
|
|
6816
7193
|
})),
|
|
6817
7194
|
[items, search]
|
|
6818
7195
|
);
|
|
6819
|
-
const setSearch = (0,
|
|
7196
|
+
const setSearch = (0, import_react62.useCallback)((search2) => {
|
|
6820
7197
|
setState((state2) => ({ ...state2, search: search2, index: 0 }));
|
|
6821
7198
|
}, []);
|
|
6822
|
-
const setIndex = (0,
|
|
7199
|
+
const setIndex = (0, import_react62.useCallback)((index2) => {
|
|
6823
7200
|
setState((state2) => ({ ...state2, index: index2 }));
|
|
6824
7201
|
}, []);
|
|
6825
|
-
(0,
|
|
7202
|
+
(0, import_react62.useEffect)(() => {
|
|
6826
7203
|
onHover?.(results[index]);
|
|
6827
7204
|
}, [index, onHover, results]);
|
|
6828
7205
|
const searchHeight = 31;
|
|
@@ -6837,14 +7214,14 @@ var SearchCompletionMenu = (0, import_react61.forwardRef)(function SearchComplet
|
|
|
6837
7214
|
width: listSize.width,
|
|
6838
7215
|
height: searchHeight + listSize.height
|
|
6839
7216
|
};
|
|
6840
|
-
const selectAndClose = (0,
|
|
7217
|
+
const selectAndClose = (0, import_react62.useCallback)(
|
|
6841
7218
|
(item) => {
|
|
6842
7219
|
onSelect(item);
|
|
6843
7220
|
onClose();
|
|
6844
7221
|
},
|
|
6845
7222
|
[onSelect, onClose]
|
|
6846
7223
|
);
|
|
6847
|
-
const handleKeyDown = (0,
|
|
7224
|
+
const handleKeyDown = (0, import_react62.useCallback)(
|
|
6848
7225
|
(event) => {
|
|
6849
7226
|
(0, import_noya_keymap5.handleKeyboardEvent)(event.nativeEvent, (0, import_noya_keymap5.getCurrentPlatform)(navigator), {
|
|
6850
7227
|
ArrowUp: () => {
|
|
@@ -6872,13 +7249,13 @@ var SearchCompletionMenu = (0, import_react61.forwardRef)(function SearchComplet
|
|
|
6872
7249
|
},
|
|
6873
7250
|
[index, onClose, selectAndClose, results, setIndex]
|
|
6874
7251
|
);
|
|
6875
|
-
const inputRef = (0,
|
|
6876
|
-
(0,
|
|
7252
|
+
const inputRef = (0, import_react62.useRef)(null);
|
|
7253
|
+
(0, import_react62.useImperativeHandle)(forwardedRef, () => ({
|
|
6877
7254
|
focus: () => {
|
|
6878
7255
|
inputRef.current?.focus();
|
|
6879
7256
|
}
|
|
6880
7257
|
}));
|
|
6881
|
-
return /* @__PURE__ */
|
|
7258
|
+
return /* @__PURE__ */ import_react62.default.createElement("div", { ...elementSize, className: "flex flex-col overflow-hidden" }, /* @__PURE__ */ import_react62.default.createElement(InputField2.Root, { className: "flex flex-0" }, /* @__PURE__ */ import_react62.default.createElement(
|
|
6882
7259
|
InputField2.Input,
|
|
6883
7260
|
{
|
|
6884
7261
|
ref: inputRef,
|
|
@@ -6898,7 +7275,7 @@ var SearchCompletionMenu = (0, import_react61.forwardRef)(function SearchComplet
|
|
|
6898
7275
|
onChange: setSearch,
|
|
6899
7276
|
onKeyDown: handleKeyDown
|
|
6900
7277
|
}
|
|
6901
|
-
)), /* @__PURE__ */
|
|
7278
|
+
)), /* @__PURE__ */ import_react62.default.createElement(Divider, null), results.length > 0 ? /* @__PURE__ */ import_react62.default.createElement(
|
|
6902
7279
|
ComboboxMenu,
|
|
6903
7280
|
{
|
|
6904
7281
|
ref: listRef,
|
|
@@ -6913,29 +7290,29 @@ var SearchCompletionMenu = (0, import_react61.forwardRef)(function SearchComplet
|
|
|
6913
7290
|
onHoverIndex: setIndex,
|
|
6914
7291
|
indented: hasCheckedItems
|
|
6915
7292
|
}
|
|
6916
|
-
) : /* @__PURE__ */
|
|
7293
|
+
) : /* @__PURE__ */ import_react62.default.createElement(
|
|
6917
7294
|
"div",
|
|
6918
7295
|
{
|
|
6919
7296
|
...listSize,
|
|
6920
7297
|
className: "flex flex-col p-20 items-center justify-center"
|
|
6921
7298
|
},
|
|
6922
|
-
/* @__PURE__ */
|
|
7299
|
+
/* @__PURE__ */ import_react62.default.createElement(Small, { color: "textDisabled" }, "No results")
|
|
6923
7300
|
));
|
|
6924
7301
|
});
|
|
6925
7302
|
|
|
6926
7303
|
// src/components/CommandPalette.tsx
|
|
6927
|
-
var CommandPalette = (0,
|
|
7304
|
+
var CommandPalette = (0, import_react63.memo)(function CommandPalette2({
|
|
6928
7305
|
showCommandPalette,
|
|
6929
7306
|
setShowCommandPalette,
|
|
6930
7307
|
items,
|
|
6931
7308
|
onSelect,
|
|
6932
7309
|
onHover
|
|
6933
7310
|
}) {
|
|
6934
|
-
const menuRef =
|
|
6935
|
-
const handleClose =
|
|
7311
|
+
const menuRef = import_react63.default.useRef(null);
|
|
7312
|
+
const handleClose = import_react63.default.useCallback(() => {
|
|
6936
7313
|
setShowCommandPalette(false);
|
|
6937
7314
|
}, [setShowCommandPalette]);
|
|
6938
|
-
return /* @__PURE__ */
|
|
7315
|
+
return /* @__PURE__ */ import_react63.default.createElement(
|
|
6939
7316
|
Dialog,
|
|
6940
7317
|
{
|
|
6941
7318
|
style: {
|
|
@@ -6961,7 +7338,7 @@ var CommandPalette = (0, import_react62.memo)(function CommandPalette2({
|
|
|
6961
7338
|
}, 0);
|
|
6962
7339
|
}
|
|
6963
7340
|
},
|
|
6964
|
-
/* @__PURE__ */
|
|
7341
|
+
/* @__PURE__ */ import_react63.default.createElement("div", { className: "flex flex-col flex-1" }, /* @__PURE__ */ import_react63.default.createElement(AutoSizer, null, (size2) => /* @__PURE__ */ import_react63.default.createElement(
|
|
6965
7342
|
SearchCompletionMenu,
|
|
6966
7343
|
{
|
|
6967
7344
|
ref: menuRef,
|
|
@@ -6976,51 +7353,34 @@ var CommandPalette = (0, import_react62.memo)(function CommandPalette2({
|
|
|
6976
7353
|
});
|
|
6977
7354
|
|
|
6978
7355
|
// src/components/connected-users-menu/ConnectedUsersMenuLayout.tsx
|
|
6979
|
-
var
|
|
6980
|
-
var
|
|
6981
|
-
var UserAvatar = ({ userId, name, image }) => /* @__PURE__ */ import_react63.default.createElement(
|
|
7356
|
+
var import_react64 = __toESM(require("react"));
|
|
7357
|
+
var UserAvatar = ({ userId, name, image }) => /* @__PURE__ */ import_react64.default.createElement(
|
|
6982
7358
|
Tooltip,
|
|
6983
7359
|
{
|
|
6984
7360
|
key: userId,
|
|
6985
|
-
content: /* @__PURE__ */
|
|
7361
|
+
content: /* @__PURE__ */ import_react64.default.createElement("div", { className: "flex flex-col" }, /* @__PURE__ */ import_react64.default.createElement(Small, null, name))
|
|
6986
7362
|
},
|
|
6987
|
-
/* @__PURE__ */
|
|
7363
|
+
/* @__PURE__ */ import_react64.default.createElement(Avatar, { size: INPUT_HEIGHT, userId, name, image })
|
|
6988
7364
|
);
|
|
6989
7365
|
var ConnectedUsersMenuLayout = ({
|
|
6990
7366
|
renderUsers,
|
|
6991
|
-
currentUserId,
|
|
6992
7367
|
launchAIAssistant,
|
|
6993
7368
|
isAssistantOpen
|
|
6994
7369
|
}) => {
|
|
6995
|
-
return /* @__PURE__ */
|
|
6996
|
-
|
|
7370
|
+
return /* @__PURE__ */ import_react64.default.createElement("div", { className: "flex gap-1.5" }, /* @__PURE__ */ import_react64.default.createElement(AvatarStack, { size: INPUT_HEIGHT, className: "mr-1" }, renderUsers()), launchAIAssistant && /* @__PURE__ */ import_react64.default.createElement(Tooltip, { content: "AI Assistant" }, /* @__PURE__ */ import_react64.default.createElement(
|
|
7371
|
+
Button_default,
|
|
6997
7372
|
{
|
|
6998
|
-
|
|
7373
|
+
active: isAssistantOpen,
|
|
7374
|
+
onClick: launchAIAssistant,
|
|
7375
|
+
icon: "ChatBubbleWithDotsIcon"
|
|
6999
7376
|
},
|
|
7000
|
-
|
|
7001
|
-
|
|
7002
|
-
{
|
|
7003
|
-
variant: isAssistantOpen ? "secondary" : void 0,
|
|
7004
|
-
onClick: launchAIAssistant,
|
|
7005
|
-
style: {
|
|
7006
|
-
backgroundColor: isAssistantOpen ? colorFromString(currentUserId ?? "") : void 0
|
|
7007
|
-
}
|
|
7008
|
-
},
|
|
7009
|
-
/* @__PURE__ */ import_react63.default.createElement(
|
|
7010
|
-
import_noya_icons6.ChatBubbleWithDotsIcon,
|
|
7011
|
-
{
|
|
7012
|
-
color: isAssistantOpen ? void 0 : cssVars.colors.icon
|
|
7013
|
-
}
|
|
7014
|
-
),
|
|
7015
|
-
/* @__PURE__ */ import_react63.default.createElement(Spacer.Horizontal, { inline: true, size: 6 }),
|
|
7016
|
-
"AI"
|
|
7017
|
-
)
|
|
7018
|
-
));
|
|
7377
|
+
"AI"
|
|
7378
|
+
)));
|
|
7019
7379
|
};
|
|
7020
7380
|
|
|
7021
7381
|
// src/components/DraggableMenuButton.tsx
|
|
7022
|
-
var
|
|
7023
|
-
var
|
|
7382
|
+
var import_noya_icons6 = require("@noya-app/noya-icons");
|
|
7383
|
+
var import_react65 = __toESM(require("react"));
|
|
7024
7384
|
var DraggableMenuButton = memoGeneric(function DraggableMenuButton2({
|
|
7025
7385
|
items,
|
|
7026
7386
|
onSelect,
|
|
@@ -7029,9 +7389,9 @@ var DraggableMenuButton = memoGeneric(function DraggableMenuButton2({
|
|
|
7029
7389
|
className,
|
|
7030
7390
|
style: style2
|
|
7031
7391
|
}) {
|
|
7032
|
-
const [open, setOpen] = (0,
|
|
7033
|
-
const [downPosition, setDownPosition] = (0,
|
|
7034
|
-
const handlePointerDownCapture = (0,
|
|
7392
|
+
const [open, setOpen] = (0, import_react65.useState)(false);
|
|
7393
|
+
const [downPosition, setDownPosition] = (0, import_react65.useState)(null);
|
|
7394
|
+
const handlePointerDownCapture = (0, import_react65.useCallback)(
|
|
7035
7395
|
(event) => {
|
|
7036
7396
|
if (open) {
|
|
7037
7397
|
setDownPosition(null);
|
|
@@ -7044,7 +7404,7 @@ var DraggableMenuButton = memoGeneric(function DraggableMenuButton2({
|
|
|
7044
7404
|
},
|
|
7045
7405
|
[open]
|
|
7046
7406
|
);
|
|
7047
|
-
const handlePointerUp = (0,
|
|
7407
|
+
const handlePointerUp = (0, import_react65.useCallback)(
|
|
7048
7408
|
(event) => {
|
|
7049
7409
|
if (open || !downPosition) {
|
|
7050
7410
|
setDownPosition(null);
|
|
@@ -7060,13 +7420,13 @@ var DraggableMenuButton = memoGeneric(function DraggableMenuButton2({
|
|
|
7060
7420
|
},
|
|
7061
7421
|
[downPosition, open]
|
|
7062
7422
|
);
|
|
7063
|
-
const handleOpenChange = (0,
|
|
7423
|
+
const handleOpenChange = (0, import_react65.useCallback)(
|
|
7064
7424
|
(isOpen) => {
|
|
7065
7425
|
if (!isOpen) setOpen(false);
|
|
7066
7426
|
},
|
|
7067
7427
|
[setOpen]
|
|
7068
7428
|
);
|
|
7069
|
-
return /* @__PURE__ */
|
|
7429
|
+
return /* @__PURE__ */ import_react65.default.createElement(
|
|
7070
7430
|
"div",
|
|
7071
7431
|
{
|
|
7072
7432
|
className: cx(
|
|
@@ -7082,7 +7442,7 @@ var DraggableMenuButton = memoGeneric(function DraggableMenuButton2({
|
|
|
7082
7442
|
onClick?.();
|
|
7083
7443
|
}
|
|
7084
7444
|
},
|
|
7085
|
-
items && onSelect ? /* @__PURE__ */
|
|
7445
|
+
items && onSelect ? /* @__PURE__ */ import_react65.default.createElement(
|
|
7086
7446
|
DropdownMenu,
|
|
7087
7447
|
{
|
|
7088
7448
|
open,
|
|
@@ -7091,14 +7451,14 @@ var DraggableMenuButton = memoGeneric(function DraggableMenuButton2({
|
|
|
7091
7451
|
onSelect,
|
|
7092
7452
|
shouldBindKeyboardShortcuts: false
|
|
7093
7453
|
},
|
|
7094
|
-
/* @__PURE__ */
|
|
7095
|
-
|
|
7454
|
+
/* @__PURE__ */ import_react65.default.createElement("div", { className: "pointer-events-none h-[15px]" }, /* @__PURE__ */ import_react65.default.createElement(
|
|
7455
|
+
import_noya_icons6.DragHandleDots2Icon,
|
|
7096
7456
|
{
|
|
7097
7457
|
color: isVisible || open ? cssVars.colors.icon : "transparent"
|
|
7098
7458
|
}
|
|
7099
7459
|
))
|
|
7100
|
-
) : /* @__PURE__ */
|
|
7101
|
-
|
|
7460
|
+
) : /* @__PURE__ */ import_react65.default.createElement(
|
|
7461
|
+
import_noya_icons6.DragHandleDots2Icon,
|
|
7102
7462
|
{
|
|
7103
7463
|
color: isVisible || open ? cssVars.colors.icon : "transparent"
|
|
7104
7464
|
}
|
|
@@ -7108,10 +7468,10 @@ var DraggableMenuButton = memoGeneric(function DraggableMenuButton2({
|
|
|
7108
7468
|
|
|
7109
7469
|
// src/components/Drawer.tsx
|
|
7110
7470
|
var Dialog3 = __toESM(require("@radix-ui/react-dialog"));
|
|
7111
|
-
var
|
|
7112
|
-
var
|
|
7113
|
-
var Drawer =
|
|
7114
|
-
|
|
7471
|
+
var React61 = __toESM(require("react"));
|
|
7472
|
+
var import_react66 = require("react");
|
|
7473
|
+
var Drawer = React61.memo(
|
|
7474
|
+
React61.forwardRef(function Drawer2({
|
|
7115
7475
|
open,
|
|
7116
7476
|
onOpenChange,
|
|
7117
7477
|
trigger,
|
|
@@ -7130,7 +7490,7 @@ var Drawer = React57.memo(
|
|
|
7130
7490
|
value: open,
|
|
7131
7491
|
onChange: onOpenChange
|
|
7132
7492
|
});
|
|
7133
|
-
(0,
|
|
7493
|
+
(0, import_react66.useImperativeHandle)(forwardedRef, () => ({
|
|
7134
7494
|
expand: () => {
|
|
7135
7495
|
setInternalOpen(true);
|
|
7136
7496
|
},
|
|
@@ -7141,7 +7501,7 @@ var Drawer = React57.memo(
|
|
|
7141
7501
|
return internalOpen;
|
|
7142
7502
|
}
|
|
7143
7503
|
}));
|
|
7144
|
-
const inner = /* @__PURE__ */
|
|
7504
|
+
const inner = /* @__PURE__ */ React61.createElement(React61.Fragment, null, /* @__PURE__ */ React61.createElement(
|
|
7145
7505
|
Dialog3.Overlay,
|
|
7146
7506
|
{
|
|
7147
7507
|
className: cx(
|
|
@@ -7149,7 +7509,7 @@ var Drawer = React57.memo(
|
|
|
7149
7509
|
positioning === "absolute" ? "absolute" : "fixed"
|
|
7150
7510
|
)
|
|
7151
7511
|
}
|
|
7152
|
-
), /* @__PURE__ */
|
|
7512
|
+
), /* @__PURE__ */ React61.createElement(
|
|
7153
7513
|
Dialog3.Content,
|
|
7154
7514
|
{
|
|
7155
7515
|
id,
|
|
@@ -7161,24 +7521,24 @@ var Drawer = React57.memo(
|
|
|
7161
7521
|
className
|
|
7162
7522
|
)
|
|
7163
7523
|
},
|
|
7164
|
-
title && /* @__PURE__ */
|
|
7524
|
+
title && /* @__PURE__ */ React61.createElement(Dialog3.Title, null, title),
|
|
7165
7525
|
children
|
|
7166
7526
|
));
|
|
7167
|
-
return /* @__PURE__ */
|
|
7527
|
+
return /* @__PURE__ */ React61.createElement(
|
|
7168
7528
|
Dialog3.Root,
|
|
7169
7529
|
{
|
|
7170
7530
|
key: "dialog",
|
|
7171
7531
|
open: internalOpen,
|
|
7172
7532
|
onOpenChange: setInternalOpen
|
|
7173
7533
|
},
|
|
7174
|
-
/* @__PURE__ */
|
|
7175
|
-
portalled ? /* @__PURE__ */
|
|
7534
|
+
/* @__PURE__ */ React61.createElement(Dialog3.Trigger, { key: "trigger" }, trigger),
|
|
7535
|
+
portalled ? /* @__PURE__ */ React61.createElement(Dialog3.Portal, { container: portalContainer }, inner) : inner
|
|
7176
7536
|
);
|
|
7177
7537
|
})
|
|
7178
7538
|
);
|
|
7179
7539
|
|
|
7180
7540
|
// src/components/Fade.tsx
|
|
7181
|
-
var
|
|
7541
|
+
var import_react67 = __toESM(require("react"));
|
|
7182
7542
|
var Fade = ({
|
|
7183
7543
|
children,
|
|
7184
7544
|
direction = "right",
|
|
@@ -7200,7 +7560,7 @@ var Fade = ({
|
|
|
7200
7560
|
top: "left-0 right-0 top-0",
|
|
7201
7561
|
bottom: "left-0 right-0 bottom-0"
|
|
7202
7562
|
}[direction];
|
|
7203
|
-
return /* @__PURE__ */
|
|
7563
|
+
return /* @__PURE__ */ import_react67.default.createElement("div", { className: cx("relative", className), style: { height } }, position === "front" ? children : null, /* @__PURE__ */ import_react67.default.createElement(
|
|
7204
7564
|
"div",
|
|
7205
7565
|
{
|
|
7206
7566
|
className: cx(
|
|
@@ -7219,17 +7579,17 @@ var Fade = ({
|
|
|
7219
7579
|
};
|
|
7220
7580
|
|
|
7221
7581
|
// src/components/file-explorer/FileExplorerLayout.tsx
|
|
7222
|
-
var
|
|
7582
|
+
var import_react68 = __toESM(require("react"));
|
|
7223
7583
|
var FileExplorerLayout = ({
|
|
7224
7584
|
children,
|
|
7225
7585
|
className,
|
|
7226
7586
|
...props
|
|
7227
|
-
}) => /* @__PURE__ */
|
|
7587
|
+
}) => /* @__PURE__ */ import_react68.default.createElement(Section, { className: cx(className, "px-3 flex-1"), ...props }, children);
|
|
7228
7588
|
var FileExplorerUploadButton = ({
|
|
7229
7589
|
showUploadButton,
|
|
7230
7590
|
onUpload,
|
|
7231
7591
|
children
|
|
7232
|
-
}) => /* @__PURE__ */
|
|
7592
|
+
}) => /* @__PURE__ */ import_react68.default.createElement("div", { className: "flex items-center gap-2" }, showUploadButton && /* @__PURE__ */ import_react68.default.createElement(
|
|
7233
7593
|
IconButton,
|
|
7234
7594
|
{
|
|
7235
7595
|
iconName: "UploadIcon",
|
|
@@ -7240,14 +7600,14 @@ var FileExplorerUploadButton = ({
|
|
|
7240
7600
|
), children);
|
|
7241
7601
|
var FileExplorerCollection = forwardRefGeneric(
|
|
7242
7602
|
function FileExplorerCollection2({ ...props }, ref) {
|
|
7243
|
-
return /* @__PURE__ */
|
|
7603
|
+
return /* @__PURE__ */ import_react68.default.createElement(Collection, { ref, className: "-mx-3 flex-1", ...props });
|
|
7244
7604
|
}
|
|
7245
7605
|
);
|
|
7246
7606
|
var FileExplorerDetail = ({
|
|
7247
7607
|
selected,
|
|
7248
7608
|
size: size2,
|
|
7249
7609
|
children
|
|
7250
|
-
}) => /* @__PURE__ */
|
|
7610
|
+
}) => /* @__PURE__ */ import_react68.default.createElement(
|
|
7251
7611
|
"span",
|
|
7252
7612
|
{
|
|
7253
7613
|
className: cx(
|
|
@@ -7260,10 +7620,10 @@ var FileExplorerDetail = ({
|
|
|
7260
7620
|
var FileExplorerEmptyState = ({
|
|
7261
7621
|
label = "No files",
|
|
7262
7622
|
...props
|
|
7263
|
-
}) => /* @__PURE__ */
|
|
7623
|
+
}) => /* @__PURE__ */ import_react68.default.createElement(Banner, { label, className: "mx-3", ...props });
|
|
7264
7624
|
|
|
7265
7625
|
// src/components/FillInputField.tsx
|
|
7266
|
-
var
|
|
7626
|
+
var import_react70 = __toESM(require("react"));
|
|
7267
7627
|
|
|
7268
7628
|
// ../noya-file-format/src/types.ts
|
|
7269
7629
|
var types_exports = {};
|
|
@@ -7588,25 +7948,25 @@ var ClassValue = /* @__PURE__ */ ((ClassValue2) => {
|
|
|
7588
7948
|
})(ClassValue || {});
|
|
7589
7949
|
|
|
7590
7950
|
// src/components/FillPreviewBackground.tsx
|
|
7591
|
-
var
|
|
7951
|
+
var React65 = __toESM(require("react"));
|
|
7592
7952
|
|
|
7593
7953
|
// src/contexts/ImageDataContext.tsx
|
|
7594
|
-
var
|
|
7595
|
-
var ImageDataContext =
|
|
7954
|
+
var React64 = __toESM(require("react"));
|
|
7955
|
+
var ImageDataContext = React64.createContext(
|
|
7596
7956
|
void 0
|
|
7597
7957
|
);
|
|
7598
|
-
var ImageDataProvider =
|
|
7958
|
+
var ImageDataProvider = React64.memo(function ImageDataProvider2({
|
|
7599
7959
|
children,
|
|
7600
7960
|
getImageData
|
|
7601
7961
|
}) {
|
|
7602
|
-
const contextValue =
|
|
7962
|
+
const contextValue = React64.useMemo(
|
|
7603
7963
|
() => ({ getImageData: getImageData ?? (() => void 0) }),
|
|
7604
7964
|
[getImageData]
|
|
7605
7965
|
);
|
|
7606
|
-
return /* @__PURE__ */
|
|
7966
|
+
return /* @__PURE__ */ React64.createElement(ImageDataContext.Provider, { value: contextValue }, children);
|
|
7607
7967
|
});
|
|
7608
7968
|
function useImageData(ref) {
|
|
7609
|
-
const value =
|
|
7969
|
+
const value = React64.useContext(ImageDataContext);
|
|
7610
7970
|
if (!value) {
|
|
7611
7971
|
throw new Error("Missing ImageDataProvider");
|
|
7612
7972
|
}
|
|
@@ -7614,14 +7974,14 @@ function useImageData(ref) {
|
|
|
7614
7974
|
}
|
|
7615
7975
|
|
|
7616
7976
|
// src/hooks/useObjectURL.ts
|
|
7617
|
-
var
|
|
7977
|
+
var import_react69 = require("react");
|
|
7618
7978
|
function useObjectURL(object) {
|
|
7619
|
-
const objectURL = (0,
|
|
7979
|
+
const objectURL = (0, import_react69.useMemo)(() => {
|
|
7620
7980
|
if (object instanceof Blob) return URL.createObjectURL(object);
|
|
7621
7981
|
const bytes = object instanceof Uint8Array ? object : object !== void 0 ? new Uint8Array(object) : new Uint8Array();
|
|
7622
7982
|
return URL.createObjectURL(new Blob([bytes]));
|
|
7623
7983
|
}, [object]);
|
|
7624
|
-
(0,
|
|
7984
|
+
(0, import_react69.useLayoutEffect)(() => {
|
|
7625
7985
|
return () => URL.revokeObjectURL(objectURL);
|
|
7626
7986
|
}, [objectURL]);
|
|
7627
7987
|
return objectURL;
|
|
@@ -7672,10 +8032,10 @@ var dotsHorizontalSvg = (fillColor) => `
|
|
|
7672
8032
|
<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>
|
|
7673
8033
|
</svg>
|
|
7674
8034
|
`;
|
|
7675
|
-
var Background =
|
|
8035
|
+
var Background = React65.memo(function Background2({
|
|
7676
8036
|
background: background2
|
|
7677
8037
|
}) {
|
|
7678
|
-
return /* @__PURE__ */
|
|
8038
|
+
return /* @__PURE__ */ React65.createElement(
|
|
7679
8039
|
"span",
|
|
7680
8040
|
{
|
|
7681
8041
|
className: `${background2 ? `bg-[${background2}]` : "bg-input-background"} absolute inset-0`
|
|
@@ -7694,7 +8054,7 @@ function getPatternSizeAndPosition(fillType, tileScale) {
|
|
|
7694
8054
|
return "center / 100% 100%";
|
|
7695
8055
|
}
|
|
7696
8056
|
}
|
|
7697
|
-
var PatternPreviewBackground =
|
|
8057
|
+
var PatternPreviewBackground = React65.memo(
|
|
7698
8058
|
function PatternPreviewBackground2({
|
|
7699
8059
|
fillType,
|
|
7700
8060
|
tileScale,
|
|
@@ -7703,7 +8063,7 @@ var PatternPreviewBackground = React61.memo(
|
|
|
7703
8063
|
const image = useImageData(imageRef);
|
|
7704
8064
|
const url = useObjectURL(image);
|
|
7705
8065
|
const size2 = getPatternSizeAndPosition(fillType, tileScale);
|
|
7706
|
-
const background2 =
|
|
8066
|
+
const background2 = React65.useMemo(
|
|
7707
8067
|
() => [
|
|
7708
8068
|
size2,
|
|
7709
8069
|
`url(${url})`,
|
|
@@ -7711,44 +8071,44 @@ var PatternPreviewBackground = React61.memo(
|
|
|
7711
8071
|
].join(" "),
|
|
7712
8072
|
[fillType, size2, url]
|
|
7713
8073
|
);
|
|
7714
|
-
return /* @__PURE__ */
|
|
8074
|
+
return /* @__PURE__ */ React65.createElement(Background, { background: background2 });
|
|
7715
8075
|
}
|
|
7716
8076
|
);
|
|
7717
|
-
var ColorPreviewBackground =
|
|
8077
|
+
var ColorPreviewBackground = React65.memo(function ColorPreviewBackground2({
|
|
7718
8078
|
color
|
|
7719
8079
|
}) {
|
|
7720
|
-
const background2 =
|
|
8080
|
+
const background2 = React65.useMemo(
|
|
7721
8081
|
() => sketchColorToRgbaString(color),
|
|
7722
8082
|
[color]
|
|
7723
8083
|
);
|
|
7724
|
-
return /* @__PURE__ */
|
|
8084
|
+
return /* @__PURE__ */ React65.createElement(Background, { background: background2 });
|
|
7725
8085
|
});
|
|
7726
|
-
var GradientPreviewBackground =
|
|
8086
|
+
var GradientPreviewBackground = React65.memo(
|
|
7727
8087
|
function GradientPreviewBackground2({
|
|
7728
8088
|
gradient
|
|
7729
8089
|
}) {
|
|
7730
|
-
const background2 =
|
|
8090
|
+
const background2 = React65.useMemo(
|
|
7731
8091
|
() => getGradientBackground(gradient.stops, gradient.gradientType, 180),
|
|
7732
8092
|
[gradient.gradientType, gradient.stops]
|
|
7733
8093
|
);
|
|
7734
|
-
return /* @__PURE__ */
|
|
8094
|
+
return /* @__PURE__ */ React65.createElement(Background, { background: background2 });
|
|
7735
8095
|
}
|
|
7736
8096
|
);
|
|
7737
8097
|
var background = `center url("data:image/svg+xml;utf8,${dotsHorizontalSvg(
|
|
7738
8098
|
cssVars.colors.placeholderDots
|
|
7739
8099
|
)}") no-repeat`;
|
|
7740
|
-
var FillPreviewBackground =
|
|
8100
|
+
var FillPreviewBackground = React65.memo(function FillPreviewBackground2({
|
|
7741
8101
|
value
|
|
7742
8102
|
}) {
|
|
7743
|
-
if (!value) return /* @__PURE__ */
|
|
8103
|
+
if (!value) return /* @__PURE__ */ React65.createElement(Background, { background });
|
|
7744
8104
|
switch (value._class) {
|
|
7745
8105
|
case "color":
|
|
7746
|
-
return /* @__PURE__ */
|
|
8106
|
+
return /* @__PURE__ */ React65.createElement(ColorPreviewBackground, { color: value });
|
|
7747
8107
|
case "gradient":
|
|
7748
|
-
return /* @__PURE__ */
|
|
8108
|
+
return /* @__PURE__ */ React65.createElement(GradientPreviewBackground, { gradient: value });
|
|
7749
8109
|
case "pattern":
|
|
7750
8110
|
if (!value.image) return null;
|
|
7751
|
-
return /* @__PURE__ */
|
|
8111
|
+
return /* @__PURE__ */ React65.createElement(
|
|
7752
8112
|
PatternPreviewBackground,
|
|
7753
8113
|
{
|
|
7754
8114
|
fillType: value.patternFillType,
|
|
@@ -7760,7 +8120,7 @@ var FillPreviewBackground = React61.memo(function FillPreviewBackground2({
|
|
|
7760
8120
|
});
|
|
7761
8121
|
|
|
7762
8122
|
// src/components/FillInputField.tsx
|
|
7763
|
-
var FillButton = (0,
|
|
8123
|
+
var FillButton = (0, import_react70.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ import_react70.default.createElement(
|
|
7764
8124
|
"button",
|
|
7765
8125
|
{
|
|
7766
8126
|
ref,
|
|
@@ -7771,14 +8131,14 @@ var FillButton = (0, import_react69.forwardRef)(({ className, ...props }, ref) =
|
|
|
7771
8131
|
...props
|
|
7772
8132
|
}
|
|
7773
8133
|
));
|
|
7774
|
-
var FillInputField = (0,
|
|
7775
|
-
(0,
|
|
7776
|
-
return /* @__PURE__ */
|
|
8134
|
+
var FillInputField = (0, import_react70.memo)(
|
|
8135
|
+
(0, import_react70.forwardRef)(function FillInputField2({ id, value, ...rest }, ref) {
|
|
8136
|
+
return /* @__PURE__ */ import_react70.default.createElement(FillButton, { ref, id, ...rest }, /* @__PURE__ */ import_react70.default.createElement(FillPreviewBackground, { value }));
|
|
7777
8137
|
})
|
|
7778
8138
|
);
|
|
7779
8139
|
|
|
7780
8140
|
// src/components/FloatingWindow.tsx
|
|
7781
|
-
var
|
|
8141
|
+
var import_react71 = __toESM(require("react"));
|
|
7782
8142
|
var styles2 = {
|
|
7783
8143
|
noSelect: {
|
|
7784
8144
|
userSelect: "none",
|
|
@@ -7871,7 +8231,7 @@ function defaultRenderToolbar({
|
|
|
7871
8231
|
toolbarContent,
|
|
7872
8232
|
onClose
|
|
7873
8233
|
}) {
|
|
7874
|
-
return /* @__PURE__ */
|
|
8234
|
+
return /* @__PURE__ */ import_react71.default.createElement(import_react71.default.Fragment, null, /* @__PURE__ */ import_react71.default.createElement(Small, { className: "flex-1 font-medium text-text" }, title), toolbarContent, /* @__PURE__ */ import_react71.default.createElement(
|
|
7875
8235
|
IconButton,
|
|
7876
8236
|
{
|
|
7877
8237
|
iconName: "Cross3Icon",
|
|
@@ -7898,16 +8258,16 @@ var FloatingWindow = ({
|
|
|
7898
8258
|
toolbarContent,
|
|
7899
8259
|
renderToolbar = defaultRenderToolbar
|
|
7900
8260
|
}) => {
|
|
7901
|
-
const [position, setPosition] = (0,
|
|
7902
|
-
const [size2, setSize] = (0,
|
|
8261
|
+
const [position, setPosition] = (0, import_react71.useState)({ x: initialX, y: initialY });
|
|
8262
|
+
const [size2, setSize] = (0, import_react71.useState)({
|
|
7903
8263
|
width: initialWidth,
|
|
7904
8264
|
height: initialHeight
|
|
7905
8265
|
});
|
|
7906
|
-
const [isDragging, setIsDragging] = (0,
|
|
7907
|
-
const [isResizing, setIsResizing] = (0,
|
|
7908
|
-
const [dragOffset, setDragOffset] = (0,
|
|
7909
|
-
const [resizeDirection, setResizeDirection] = (0,
|
|
7910
|
-
const wrapperRef = (0,
|
|
8266
|
+
const [isDragging, setIsDragging] = (0, import_react71.useState)(false);
|
|
8267
|
+
const [isResizing, setIsResizing] = (0, import_react71.useState)(false);
|
|
8268
|
+
const [dragOffset, setDragOffset] = (0, import_react71.useState)({ x: 0, y: 0 });
|
|
8269
|
+
const [resizeDirection, setResizeDirection] = (0, import_react71.useState)(null);
|
|
8270
|
+
const wrapperRef = (0, import_react71.useRef)(null);
|
|
7911
8271
|
const toggleGlobalTextSelection = (disable) => {
|
|
7912
8272
|
if (disable) {
|
|
7913
8273
|
document.body.style.userSelect = "none";
|
|
@@ -7915,7 +8275,7 @@ var FloatingWindow = ({
|
|
|
7915
8275
|
document.body.style.userSelect = "";
|
|
7916
8276
|
}
|
|
7917
8277
|
};
|
|
7918
|
-
const handleMouseDown = (0,
|
|
8278
|
+
const handleMouseDown = (0, import_react71.useCallback)((e) => {
|
|
7919
8279
|
if (!wrapperRef.current) return;
|
|
7920
8280
|
const rect = wrapperRef.current.getBoundingClientRect();
|
|
7921
8281
|
setDragOffset({
|
|
@@ -7924,7 +8284,7 @@ var FloatingWindow = ({
|
|
|
7924
8284
|
});
|
|
7925
8285
|
setIsDragging(true);
|
|
7926
8286
|
}, []);
|
|
7927
|
-
const handleResizeStart = (0,
|
|
8287
|
+
const handleResizeStart = (0, import_react71.useCallback)(
|
|
7928
8288
|
(direction) => (e) => {
|
|
7929
8289
|
e.stopPropagation();
|
|
7930
8290
|
setIsResizing(true);
|
|
@@ -7933,7 +8293,7 @@ var FloatingWindow = ({
|
|
|
7933
8293
|
},
|
|
7934
8294
|
[]
|
|
7935
8295
|
);
|
|
7936
|
-
const handleMouseMove = (0,
|
|
8296
|
+
const handleMouseMove = (0, import_react71.useCallback)(
|
|
7937
8297
|
(e) => {
|
|
7938
8298
|
if (isDragging) {
|
|
7939
8299
|
setPosition({
|
|
@@ -7987,13 +8347,13 @@ var FloatingWindow = ({
|
|
|
7987
8347
|
minHeight
|
|
7988
8348
|
]
|
|
7989
8349
|
);
|
|
7990
|
-
const handleMouseUp = (0,
|
|
8350
|
+
const handleMouseUp = (0, import_react71.useCallback)((_e) => {
|
|
7991
8351
|
setIsDragging(false);
|
|
7992
8352
|
setIsResizing(false);
|
|
7993
8353
|
setResizeDirection(null);
|
|
7994
8354
|
toggleGlobalTextSelection(false);
|
|
7995
8355
|
}, []);
|
|
7996
|
-
|
|
8356
|
+
import_react71.default.useEffect(() => {
|
|
7997
8357
|
document.addEventListener("mousemove", handleMouseMove);
|
|
7998
8358
|
document.addEventListener("mouseup", handleMouseUp);
|
|
7999
8359
|
return () => {
|
|
@@ -8003,11 +8363,11 @@ var FloatingWindow = ({
|
|
|
8003
8363
|
}, [handleMouseMove, handleMouseUp]);
|
|
8004
8364
|
const floatingWindowManager = useFloatingWindowManager();
|
|
8005
8365
|
const currentFloatingWindow = useCurrentFloatingWindowInternal();
|
|
8006
|
-
const handleClose = (0,
|
|
8366
|
+
const handleClose = (0, import_react71.useCallback)(() => {
|
|
8007
8367
|
if (onClose) onClose();
|
|
8008
8368
|
floatingWindowManager.closeWindow(currentFloatingWindow.id);
|
|
8009
8369
|
}, [currentFloatingWindow.id, floatingWindowManager, onClose]);
|
|
8010
|
-
return /* @__PURE__ */
|
|
8370
|
+
return /* @__PURE__ */ import_react71.default.createElement(
|
|
8011
8371
|
"div",
|
|
8012
8372
|
{
|
|
8013
8373
|
ref: wrapperRef,
|
|
@@ -8022,7 +8382,7 @@ var FloatingWindow = ({
|
|
|
8022
8382
|
zIndex: cssVars.zIndex.menu
|
|
8023
8383
|
}
|
|
8024
8384
|
},
|
|
8025
|
-
/* @__PURE__ */
|
|
8385
|
+
/* @__PURE__ */ import_react71.default.createElement(
|
|
8026
8386
|
"div",
|
|
8027
8387
|
{
|
|
8028
8388
|
style: {
|
|
@@ -8033,9 +8393,9 @@ var FloatingWindow = ({
|
|
|
8033
8393
|
},
|
|
8034
8394
|
renderToolbar({ title, toolbarContent, onClose: handleClose })
|
|
8035
8395
|
),
|
|
8036
|
-
/* @__PURE__ */
|
|
8037
|
-
/* @__PURE__ */
|
|
8038
|
-
Object.entries(resizeHandlePositions).map(([direction, style2]) => /* @__PURE__ */
|
|
8396
|
+
/* @__PURE__ */ import_react71.default.createElement(Divider, null),
|
|
8397
|
+
/* @__PURE__ */ import_react71.default.createElement("div", { style: styles2.content }, children),
|
|
8398
|
+
Object.entries(resizeHandlePositions).map(([direction, style2]) => /* @__PURE__ */ import_react71.default.createElement(
|
|
8039
8399
|
"div",
|
|
8040
8400
|
{
|
|
8041
8401
|
key: direction,
|
|
@@ -8048,8 +8408,8 @@ var FloatingWindow = ({
|
|
|
8048
8408
|
|
|
8049
8409
|
// src/components/GradientPicker.tsx
|
|
8050
8410
|
var import_noya_colorpicker2 = require("@noya-app/noya-colorpicker");
|
|
8051
|
-
var
|
|
8052
|
-
var GradientPicker =
|
|
8411
|
+
var React68 = __toESM(require("react"));
|
|
8412
|
+
var GradientPicker = React68.memo(function GradientPicker2({
|
|
8053
8413
|
value,
|
|
8054
8414
|
selectedStop,
|
|
8055
8415
|
onChangeColor,
|
|
@@ -8058,7 +8418,7 @@ var GradientPicker = React64.memo(function GradientPicker2({
|
|
|
8058
8418
|
onDelete,
|
|
8059
8419
|
onSelectStop
|
|
8060
8420
|
}) {
|
|
8061
|
-
const colorModel =
|
|
8421
|
+
const colorModel = React68.useMemo(
|
|
8062
8422
|
() => ({
|
|
8063
8423
|
defaultColor: { r: 0, g: 0, b: 0, a: 1 },
|
|
8064
8424
|
toHsva: import_noya_colorpicker2.rgbaToHsva,
|
|
@@ -8067,30 +8427,30 @@ var GradientPicker = React64.memo(function GradientPicker2({
|
|
|
8067
8427
|
}),
|
|
8068
8428
|
[]
|
|
8069
8429
|
);
|
|
8070
|
-
const rgbaColor =
|
|
8430
|
+
const rgbaColor = React68.useMemo(
|
|
8071
8431
|
() => sketchColorToRgba(value[selectedStop].color),
|
|
8072
8432
|
[value, selectedStop]
|
|
8073
8433
|
);
|
|
8074
|
-
const handleChangeColor =
|
|
8434
|
+
const handleChangeColor = React68.useCallback(
|
|
8075
8435
|
(value2) => {
|
|
8076
8436
|
onChangeColor(rgbaToSketchColor(value2));
|
|
8077
8437
|
},
|
|
8078
8438
|
[onChangeColor]
|
|
8079
8439
|
);
|
|
8080
|
-
const handleAddGradientStop =
|
|
8440
|
+
const handleAddGradientStop = React68.useCallback(
|
|
8081
8441
|
(value2, position) => {
|
|
8082
8442
|
onAdd(rgbaToSketchColor(value2), position);
|
|
8083
8443
|
},
|
|
8084
8444
|
[onAdd]
|
|
8085
8445
|
);
|
|
8086
|
-
return /* @__PURE__ */
|
|
8446
|
+
return /* @__PURE__ */ React68.createElement(
|
|
8087
8447
|
import_noya_colorpicker2.ColorPicker,
|
|
8088
8448
|
{
|
|
8089
8449
|
onChange: handleChangeColor,
|
|
8090
8450
|
colorModel,
|
|
8091
8451
|
color: rgbaColor
|
|
8092
8452
|
},
|
|
8093
|
-
/* @__PURE__ */
|
|
8453
|
+
/* @__PURE__ */ React68.createElement(
|
|
8094
8454
|
import_noya_colorpicker2.Gradient,
|
|
8095
8455
|
{
|
|
8096
8456
|
gradients: value,
|
|
@@ -8101,19 +8461,19 @@ var GradientPicker = React64.memo(function GradientPicker2({
|
|
|
8101
8461
|
onDelete
|
|
8102
8462
|
}
|
|
8103
8463
|
),
|
|
8104
|
-
/* @__PURE__ */
|
|
8105
|
-
/* @__PURE__ */
|
|
8106
|
-
/* @__PURE__ */
|
|
8107
|
-
/* @__PURE__ */
|
|
8108
|
-
/* @__PURE__ */
|
|
8109
|
-
/* @__PURE__ */
|
|
8464
|
+
/* @__PURE__ */ React68.createElement(Spacer.Vertical, { size: 10 }),
|
|
8465
|
+
/* @__PURE__ */ React68.createElement(import_noya_colorpicker2.Saturation, null),
|
|
8466
|
+
/* @__PURE__ */ React68.createElement(Spacer.Vertical, { size: 12 }),
|
|
8467
|
+
/* @__PURE__ */ React68.createElement(import_noya_colorpicker2.Hue, null),
|
|
8468
|
+
/* @__PURE__ */ React68.createElement(Spacer.Vertical, { size: 5 }),
|
|
8469
|
+
/* @__PURE__ */ React68.createElement(import_noya_colorpicker2.Alpha, null)
|
|
8110
8470
|
);
|
|
8111
8471
|
});
|
|
8112
8472
|
|
|
8113
8473
|
// src/components/InspectorContainer.tsx
|
|
8114
|
-
var
|
|
8115
|
-
var InspectorContainer = (0,
|
|
8116
|
-
(0,
|
|
8474
|
+
var import_react72 = __toESM(require("react"));
|
|
8475
|
+
var InspectorContainer = (0, import_react72.memo)(
|
|
8476
|
+
(0, import_react72.forwardRef)(function InspectorContainer2({
|
|
8117
8477
|
header,
|
|
8118
8478
|
children,
|
|
8119
8479
|
fallback,
|
|
@@ -8122,7 +8482,7 @@ var InspectorContainer = (0, import_react71.memo)(
|
|
|
8122
8482
|
className,
|
|
8123
8483
|
style: style2
|
|
8124
8484
|
}, forwardedRef) {
|
|
8125
|
-
return /* @__PURE__ */
|
|
8485
|
+
return /* @__PURE__ */ import_react72.default.createElement(
|
|
8126
8486
|
"div",
|
|
8127
8487
|
{
|
|
8128
8488
|
ref: forwardedRef,
|
|
@@ -8137,32 +8497,32 @@ var InspectorContainer = (0, import_react71.memo)(
|
|
|
8137
8497
|
}
|
|
8138
8498
|
},
|
|
8139
8499
|
header,
|
|
8140
|
-
children ? /* @__PURE__ */
|
|
8500
|
+
children ? /* @__PURE__ */ import_react72.default.createElement(ScrollArea, null, /* @__PURE__ */ import_react72.default.createElement("div", { className: "flex flex-col relative" }, showDividers ? withSeparatorElements(children, /* @__PURE__ */ import_react72.default.createElement(Divider, null)) : children)) : fallback ? /* @__PURE__ */ import_react72.default.createElement("div", { className: "flex flex-col relative h-full" }, fallback) : null
|
|
8141
8501
|
);
|
|
8142
8502
|
})
|
|
8143
8503
|
);
|
|
8144
8504
|
|
|
8145
8505
|
// src/components/LabeledElementView.tsx
|
|
8146
8506
|
var kiwi = __toESM(require("kiwi.js"));
|
|
8147
|
-
var
|
|
8148
|
-
var LabeledElementView =
|
|
8507
|
+
var React70 = __toESM(require("react"));
|
|
8508
|
+
var LabeledElementView = React70.memo(function LabeledElementView2({
|
|
8149
8509
|
children,
|
|
8150
8510
|
renderLabel
|
|
8151
8511
|
}) {
|
|
8152
|
-
const elementIds =
|
|
8153
|
-
(child) =>
|
|
8512
|
+
const elementIds = React70.Children.toArray(children).flatMap(
|
|
8513
|
+
(child) => React70.isValidElement(child) && child.type === React70.Fragment ? child.props.children : [child]
|
|
8154
8514
|
).map(
|
|
8155
|
-
(child) =>
|
|
8515
|
+
(child) => React70.isValidElement(child) && "id" in child.props ? child.props.id : null
|
|
8156
8516
|
).filter((id) => !!id);
|
|
8157
8517
|
const serializedIds = elementIds.join(",");
|
|
8158
|
-
const containerRef =
|
|
8159
|
-
const refs =
|
|
8518
|
+
const containerRef = React70.useRef(null);
|
|
8519
|
+
const refs = React70.useMemo(() => {
|
|
8160
8520
|
return Object.fromEntries(
|
|
8161
|
-
serializedIds.split(",").map((id) => [id,
|
|
8521
|
+
serializedIds.split(",").map((id) => [id, React70.createRef()])
|
|
8162
8522
|
);
|
|
8163
8523
|
}, [serializedIds]);
|
|
8164
|
-
const labelElements =
|
|
8165
|
-
return serializedIds.split(",").map((id, index) => /* @__PURE__ */
|
|
8524
|
+
const labelElements = React70.useMemo(() => {
|
|
8525
|
+
return serializedIds.split(",").map((id, index) => /* @__PURE__ */ React70.createElement(
|
|
8166
8526
|
"span",
|
|
8167
8527
|
{
|
|
8168
8528
|
key: id,
|
|
@@ -8175,7 +8535,7 @@ var LabeledElementView = React66.memo(function LabeledElementView2({
|
|
|
8175
8535
|
})
|
|
8176
8536
|
));
|
|
8177
8537
|
}, [refs, serializedIds, renderLabel]);
|
|
8178
|
-
|
|
8538
|
+
React70.useLayoutEffect(() => {
|
|
8179
8539
|
if (!containerRef.current) return;
|
|
8180
8540
|
const containerRect = containerRef.current.getBoundingClientRect();
|
|
8181
8541
|
const solver = new kiwi.Solver();
|
|
@@ -8237,19 +8597,19 @@ var LabeledElementView = React66.memo(function LabeledElementView2({
|
|
|
8237
8597
|
`${Math.max(...heights)}px`
|
|
8238
8598
|
);
|
|
8239
8599
|
}, [refs, labelElements]);
|
|
8240
|
-
return /* @__PURE__ */
|
|
8600
|
+
return /* @__PURE__ */ React70.createElement("div", { className: "flex flex-1 flex-col relative", ref: containerRef }, /* @__PURE__ */ React70.createElement("div", { className: "flex flex-1 items-center" }, children), /* @__PURE__ */ React70.createElement("div", { className: "relative overflow-hidden select-none" }, labelElements));
|
|
8241
8601
|
});
|
|
8242
8602
|
|
|
8243
8603
|
// src/components/LabeledField.tsx
|
|
8244
|
-
var
|
|
8604
|
+
var import_react74 = __toESM(require("react"));
|
|
8245
8605
|
|
|
8246
8606
|
// src/hooks/useIndent.ts
|
|
8247
|
-
var
|
|
8248
|
-
var IndentContext =
|
|
8607
|
+
var import_react73 = __toESM(require("react"));
|
|
8608
|
+
var IndentContext = import_react73.default.createContext({
|
|
8249
8609
|
indentLevel: 0
|
|
8250
8610
|
});
|
|
8251
8611
|
var useIndent = () => {
|
|
8252
|
-
const { indentLevel } =
|
|
8612
|
+
const { indentLevel } = import_react73.default.useContext(IndentContext);
|
|
8253
8613
|
return indentLevel;
|
|
8254
8614
|
};
|
|
8255
8615
|
|
|
@@ -8262,7 +8622,7 @@ var labeledFieldStyles = (labelPosition) => cx(
|
|
|
8262
8622
|
var labelPositionInset = {
|
|
8263
8623
|
position: "inset"
|
|
8264
8624
|
};
|
|
8265
|
-
var LabeledField = (0,
|
|
8625
|
+
var LabeledField = (0, import_react74.memo)(function LabeledField2({
|
|
8266
8626
|
children,
|
|
8267
8627
|
label,
|
|
8268
8628
|
labelPosition: labelPositionProp,
|
|
@@ -8278,15 +8638,15 @@ var LabeledField = (0, import_react73.memo)(function LabeledField2({
|
|
|
8278
8638
|
const labelWidth = labelWidthFromContext ?? minWidth;
|
|
8279
8639
|
const labelPositionFromContext = useLabelPosition();
|
|
8280
8640
|
const labelPosition = labelPositionProp ?? labelPositionFromContext ?? "start";
|
|
8281
|
-
const labeledFieldClasses = (0,
|
|
8641
|
+
const labeledFieldClasses = (0, import_react74.useMemo)(
|
|
8282
8642
|
() => labeledFieldStyles(labelPosition),
|
|
8283
8643
|
[labelPosition]
|
|
8284
8644
|
);
|
|
8285
|
-
const labelContextValue = (0,
|
|
8645
|
+
const labelContextValue = (0, import_react74.useMemo)(
|
|
8286
8646
|
() => ({ fieldId, label }),
|
|
8287
8647
|
[fieldId, label]
|
|
8288
8648
|
);
|
|
8289
|
-
const indentStyle = (0,
|
|
8649
|
+
const indentStyle = (0, import_react74.useMemo)(
|
|
8290
8650
|
() => ({
|
|
8291
8651
|
width: indentLevel * 8,
|
|
8292
8652
|
flexBasis: indentLevel * 8,
|
|
@@ -8295,20 +8655,20 @@ var LabeledField = (0, import_react73.memo)(function LabeledField2({
|
|
|
8295
8655
|
}),
|
|
8296
8656
|
[indentLevel]
|
|
8297
8657
|
);
|
|
8298
|
-
const fieldStyle = (0,
|
|
8658
|
+
const fieldStyle = (0, import_react74.useMemo)(
|
|
8299
8659
|
() => ({
|
|
8300
8660
|
minWidth: `calc(100% - ${labelWidth + indentLevel * 8 + 6}px)`
|
|
8301
8661
|
}),
|
|
8302
8662
|
[labelWidth, indentLevel]
|
|
8303
8663
|
);
|
|
8304
|
-
const labelStyle = (0,
|
|
8664
|
+
const labelStyle = (0, import_react74.useMemo)(
|
|
8305
8665
|
() => ({
|
|
8306
8666
|
minWidth: `calc(${labelWidth}px - ${indentLevel * 8}px)`,
|
|
8307
8667
|
...labelStyleProp
|
|
8308
8668
|
}),
|
|
8309
8669
|
[labelWidth, indentLevel, labelStyleProp]
|
|
8310
8670
|
);
|
|
8311
|
-
return /* @__PURE__ */
|
|
8671
|
+
return /* @__PURE__ */ import_react74.default.createElement(LabelContext.Provider, { value: labelContextValue }, labelPosition === "inset" ? /* @__PURE__ */ import_react74.default.createElement(LabelPositionContext.Provider, { value: labelPositionInset }, children) : /* @__PURE__ */ import_react74.default.createElement("div", { className: cx("flex relative flex-1", className), style: style2 }, Boolean(indentLevel) && /* @__PURE__ */ import_react74.default.createElement("div", { style: indentStyle }), /* @__PURE__ */ import_react74.default.createElement("div", { className: labeledFieldClasses }, /* @__PURE__ */ import_react74.default.createElement(
|
|
8312
8672
|
Label,
|
|
8313
8673
|
{
|
|
8314
8674
|
htmlFor: fieldId,
|
|
@@ -8317,12 +8677,12 @@ var LabeledField = (0, import_react73.memo)(function LabeledField2({
|
|
|
8317
8677
|
...props
|
|
8318
8678
|
},
|
|
8319
8679
|
label
|
|
8320
|
-
), labelPosition === "start" ? /* @__PURE__ */
|
|
8680
|
+
), labelPosition === "start" ? /* @__PURE__ */ import_react74.default.createElement("div", { className: "flex-auto flex", style: fieldStyle }, children) : children)));
|
|
8321
8681
|
});
|
|
8322
8682
|
|
|
8323
8683
|
// src/components/MediaThumbnail.tsx
|
|
8324
|
-
var
|
|
8325
|
-
var
|
|
8684
|
+
var import_noya_icons7 = require("@noya-app/noya-icons");
|
|
8685
|
+
var import_react75 = __toESM(require("react"));
|
|
8326
8686
|
|
|
8327
8687
|
// src/components/catppuccin/fileIcons.ts
|
|
8328
8688
|
var fileIcons = {
|
|
@@ -10762,7 +11122,7 @@ var getThumbnailColors = (colorScheme, selected) => {
|
|
|
10762
11122
|
};
|
|
10763
11123
|
}
|
|
10764
11124
|
};
|
|
10765
|
-
var MediaThumbnail = (0,
|
|
11125
|
+
var MediaThumbnail = (0, import_react75.memo)(function MediaThumbnail2({
|
|
10766
11126
|
contentType: contentTypeProp,
|
|
10767
11127
|
selected = false,
|
|
10768
11128
|
className,
|
|
@@ -10777,18 +11137,18 @@ var MediaThumbnail = (0, import_react74.memo)(function MediaThumbnail2({
|
|
|
10777
11137
|
selected
|
|
10778
11138
|
);
|
|
10779
11139
|
const contentType = getAssetType(contentTypeProp);
|
|
10780
|
-
const iconStyles = (0,
|
|
11140
|
+
const iconStyles = (0, import_react75.useMemo)(
|
|
10781
11141
|
() => ({
|
|
10782
11142
|
width: iconSizeMap[size2],
|
|
10783
11143
|
height: iconSizeMap[size2]
|
|
10784
11144
|
}),
|
|
10785
11145
|
[size2]
|
|
10786
11146
|
);
|
|
10787
|
-
const content = (0,
|
|
11147
|
+
const content = (0, import_react75.useMemo)(() => {
|
|
10788
11148
|
switch (contentType) {
|
|
10789
11149
|
case "image":
|
|
10790
|
-
if (!url) return /* @__PURE__ */
|
|
10791
|
-
return /* @__PURE__ */
|
|
11150
|
+
if (!url) return /* @__PURE__ */ import_react75.default.createElement(import_noya_icons7.ImageIcon, { color: iconColor, style: iconStyles });
|
|
11151
|
+
return /* @__PURE__ */ import_react75.default.createElement(
|
|
10792
11152
|
"img",
|
|
10793
11153
|
{
|
|
10794
11154
|
src: url,
|
|
@@ -10798,18 +11158,18 @@ var MediaThumbnail = (0, import_react74.memo)(function MediaThumbnail2({
|
|
|
10798
11158
|
}
|
|
10799
11159
|
);
|
|
10800
11160
|
case "video":
|
|
10801
|
-
return /* @__PURE__ */
|
|
11161
|
+
return /* @__PURE__ */ import_react75.default.createElement(import_noya_icons7.VideoIcon, { color: iconColor, style: iconStyles });
|
|
10802
11162
|
case "audio":
|
|
10803
|
-
return /* @__PURE__ */
|
|
11163
|
+
return /* @__PURE__ */ import_react75.default.createElement(import_noya_icons7.SpeakerLoudIcon, { color: iconColor, style: iconStyles });
|
|
10804
11164
|
default:
|
|
10805
11165
|
if (iconName) {
|
|
10806
11166
|
const Icon = Icons[iconName];
|
|
10807
|
-
return /* @__PURE__ */
|
|
11167
|
+
return /* @__PURE__ */ import_react75.default.createElement(Icon, { color: iconColor, style: iconStyles });
|
|
10808
11168
|
}
|
|
10809
11169
|
if (fileName) {
|
|
10810
11170
|
const fileIcon = findFileIcon(fileName);
|
|
10811
11171
|
if (fileIcon) {
|
|
10812
|
-
return /* @__PURE__ */
|
|
11172
|
+
return /* @__PURE__ */ import_react75.default.createElement(
|
|
10813
11173
|
"img",
|
|
10814
11174
|
{
|
|
10815
11175
|
src: `https://api.iconify.design/catppuccin/${fileIcon}.svg?height=none&box=1`,
|
|
@@ -10819,10 +11179,10 @@ var MediaThumbnail = (0, import_react74.memo)(function MediaThumbnail2({
|
|
|
10819
11179
|
);
|
|
10820
11180
|
}
|
|
10821
11181
|
}
|
|
10822
|
-
return /* @__PURE__ */
|
|
11182
|
+
return /* @__PURE__ */ import_react75.default.createElement(import_noya_icons7.FileIcon, { color: iconColor, style: iconStyles });
|
|
10823
11183
|
}
|
|
10824
11184
|
}, [contentType, url, iconColor, iconStyles, iconName, fileName]);
|
|
10825
|
-
return /* @__PURE__ */
|
|
11185
|
+
return /* @__PURE__ */ import_react75.default.createElement(
|
|
10826
11186
|
"div",
|
|
10827
11187
|
{
|
|
10828
11188
|
className: cx(
|
|
@@ -10853,18 +11213,18 @@ function findFileIcon(fileName) {
|
|
|
10853
11213
|
}
|
|
10854
11214
|
|
|
10855
11215
|
// src/components/Message.tsx
|
|
10856
|
-
var
|
|
10857
|
-
var Message = (0,
|
|
10858
|
-
(0,
|
|
11216
|
+
var import_react76 = __toESM(require("react"));
|
|
11217
|
+
var Message = (0, import_react76.memo)(
|
|
11218
|
+
(0, import_react76.forwardRef)(function Message2({ role, children, user, avatarSize = INPUT_HEIGHT }, ref) {
|
|
10859
11219
|
const randomId = crypto.randomUUID();
|
|
10860
11220
|
const userMessageBackgroundColor = colorFromString(user?.id ?? randomId);
|
|
10861
|
-
const styles3 = (0,
|
|
11221
|
+
const styles3 = (0, import_react76.useMemo)(
|
|
10862
11222
|
() => role === "user" ? {
|
|
10863
11223
|
backgroundColor: userMessageBackgroundColor
|
|
10864
11224
|
} : void 0,
|
|
10865
11225
|
[userMessageBackgroundColor, role]
|
|
10866
11226
|
);
|
|
10867
|
-
return /* @__PURE__ */
|
|
11227
|
+
return /* @__PURE__ */ import_react76.default.createElement(
|
|
10868
11228
|
"div",
|
|
10869
11229
|
{
|
|
10870
11230
|
className: cx(
|
|
@@ -10872,15 +11232,15 @@ var Message = (0, import_react75.memo)(
|
|
|
10872
11232
|
role === "user" ? "flex-row-reverse" : "flex-row"
|
|
10873
11233
|
)
|
|
10874
11234
|
},
|
|
10875
|
-
role === "assistant" ? /* @__PURE__ */
|
|
11235
|
+
role === "assistant" ? /* @__PURE__ */ import_react76.default.createElement(
|
|
10876
11236
|
Avatar,
|
|
10877
11237
|
{
|
|
10878
11238
|
name: "Assistant",
|
|
10879
11239
|
size: avatarSize,
|
|
10880
11240
|
backgroundColor: cssVars.colors.primaryPastel
|
|
10881
11241
|
},
|
|
10882
|
-
/* @__PURE__ */
|
|
10883
|
-
) : /* @__PURE__ */
|
|
11242
|
+
/* @__PURE__ */ import_react76.default.createElement(Logo, { style: { width: 15 }, fill: cssVars.colors.primary })
|
|
11243
|
+
) : /* @__PURE__ */ import_react76.default.createElement(
|
|
10884
11244
|
Avatar,
|
|
10885
11245
|
{
|
|
10886
11246
|
userId: !user ? randomId : user?.id,
|
|
@@ -10889,7 +11249,7 @@ var Message = (0, import_react75.memo)(
|
|
|
10889
11249
|
size: avatarSize
|
|
10890
11250
|
}
|
|
10891
11251
|
),
|
|
10892
|
-
/* @__PURE__ */
|
|
11252
|
+
/* @__PURE__ */ import_react76.default.createElement(
|
|
10893
11253
|
"div",
|
|
10894
11254
|
{
|
|
10895
11255
|
className: cx(
|
|
@@ -10899,7 +11259,7 @@ var Message = (0, import_react75.memo)(
|
|
|
10899
11259
|
style: styles3,
|
|
10900
11260
|
ref
|
|
10901
11261
|
},
|
|
10902
|
-
/* @__PURE__ */
|
|
11262
|
+
/* @__PURE__ */ import_react76.default.createElement(
|
|
10903
11263
|
Text,
|
|
10904
11264
|
{
|
|
10905
11265
|
variant: "small",
|
|
@@ -10913,10 +11273,10 @@ var Message = (0, import_react75.memo)(
|
|
|
10913
11273
|
);
|
|
10914
11274
|
|
|
10915
11275
|
// src/components/pipeline/PipelineResultLayout.tsx
|
|
10916
|
-
var
|
|
10917
|
-
var
|
|
11276
|
+
var import_noya_icons8 = require("@noya-app/noya-icons");
|
|
11277
|
+
var import_react77 = __toESM(require("react"));
|
|
10918
11278
|
var PipelineResultLink = ({ url }) => {
|
|
10919
|
-
return /* @__PURE__ */
|
|
11279
|
+
return /* @__PURE__ */ import_react77.default.createElement("div", { className: "flex flex-col gap-0.5" }, /* @__PURE__ */ import_react77.default.createElement(
|
|
10920
11280
|
"a",
|
|
10921
11281
|
{
|
|
10922
11282
|
href: url,
|
|
@@ -10924,15 +11284,15 @@ var PipelineResultLink = ({ url }) => {
|
|
|
10924
11284
|
rel: "noopener noreferrer",
|
|
10925
11285
|
className: "flex text-primary hover:opacity-80 border border-divider rounded-md"
|
|
10926
11286
|
},
|
|
10927
|
-
/* @__PURE__ */
|
|
10928
|
-
/* @__PURE__ */
|
|
10929
|
-
/* @__PURE__ */
|
|
11287
|
+
/* @__PURE__ */ import_react77.default.createElement("div", { className: "flex gap-1 items-center p-2" }, /* @__PURE__ */ import_react77.default.createElement(import_noya_icons8.Link1Icon, { className: "w-[15px] h-[15px] flex-shrink-0" })),
|
|
11288
|
+
/* @__PURE__ */ import_react77.default.createElement(DividerVertical, null),
|
|
11289
|
+
/* @__PURE__ */ import_react77.default.createElement(Small, { className: "truncate p-2 flex-1" }, url)
|
|
10930
11290
|
));
|
|
10931
11291
|
};
|
|
10932
11292
|
var PipelineResultLayout = ({
|
|
10933
11293
|
children
|
|
10934
11294
|
}) => {
|
|
10935
|
-
return /* @__PURE__ */
|
|
11295
|
+
return /* @__PURE__ */ import_react77.default.createElement("div", { className: "flex flex-col gap-2" }, children);
|
|
10936
11296
|
};
|
|
10937
11297
|
function getPipelineResultLink(value) {
|
|
10938
11298
|
if (typeof value !== "object" || value === null) return void 0;
|
|
@@ -10948,27 +11308,27 @@ function getPipelineResultLink(value) {
|
|
|
10948
11308
|
// src/components/Progress.tsx
|
|
10949
11309
|
var import_noya_utils10 = require("@noya-app/noya-utils");
|
|
10950
11310
|
var ProgressPrimitive = __toESM(require("@radix-ui/react-progress"));
|
|
10951
|
-
var
|
|
11311
|
+
var React76 = __toESM(require("react"));
|
|
10952
11312
|
function Progress({
|
|
10953
11313
|
value,
|
|
10954
11314
|
variant = "normal",
|
|
10955
11315
|
className
|
|
10956
11316
|
}) {
|
|
10957
11317
|
const clampedValue = (0, import_noya_utils10.clamp)(value, 0, 100);
|
|
10958
|
-
const transformStyles =
|
|
11318
|
+
const transformStyles = React76.useMemo(
|
|
10959
11319
|
() => ({
|
|
10960
11320
|
transform: `translateX(-${100 - clampedValue}%)`
|
|
10961
11321
|
}),
|
|
10962
11322
|
[clampedValue]
|
|
10963
11323
|
);
|
|
10964
|
-
return /* @__PURE__ */
|
|
11324
|
+
return /* @__PURE__ */ React76.createElement(
|
|
10965
11325
|
ProgressPrimitive.Root,
|
|
10966
11326
|
{
|
|
10967
11327
|
className: cx(`relative hidden bg-input-background h-[5px] `, className),
|
|
10968
11328
|
style: { transform: "translateZ(0)" },
|
|
10969
11329
|
value: clampedValue
|
|
10970
11330
|
},
|
|
10971
|
-
/* @__PURE__ */
|
|
11331
|
+
/* @__PURE__ */ React76.createElement(
|
|
10972
11332
|
ProgressPrimitive.Indicator,
|
|
10973
11333
|
{
|
|
10974
11334
|
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`,
|
|
@@ -10979,7 +11339,7 @@ function Progress({
|
|
|
10979
11339
|
}
|
|
10980
11340
|
|
|
10981
11341
|
// src/components/Section.tsx
|
|
10982
|
-
var
|
|
11342
|
+
var import_react78 = __toESM(require("react"));
|
|
10983
11343
|
var titleIconStyle = {
|
|
10984
11344
|
marginRight: "8px",
|
|
10985
11345
|
alignSelf: "flex-start",
|
|
@@ -11003,7 +11363,7 @@ var SectionInternal = ({
|
|
|
11003
11363
|
inlineBlockWrapper: true
|
|
11004
11364
|
}
|
|
11005
11365
|
}) => {
|
|
11006
|
-
const style2 = (0,
|
|
11366
|
+
const style2 = (0, import_react78.useMemo)(
|
|
11007
11367
|
() => ({
|
|
11008
11368
|
display: "flex",
|
|
11009
11369
|
flexDirection: "column",
|
|
@@ -11014,15 +11374,15 @@ var SectionInternal = ({
|
|
|
11014
11374
|
}),
|
|
11015
11375
|
[titleTextStyle, title, extraPadding, styleProp]
|
|
11016
11376
|
);
|
|
11017
|
-
const hasChildren =
|
|
11018
|
-
const headerStyle = (0,
|
|
11377
|
+
const hasChildren = import_react78.default.Children.toArray(children).some((child) => !!child);
|
|
11378
|
+
const headerStyle = (0, import_react78.useMemo)(
|
|
11019
11379
|
() => ({
|
|
11020
11380
|
marginBottom: hasChildren ? "4px" : void 0,
|
|
11021
11381
|
minHeight: INPUT_HEIGHT
|
|
11022
11382
|
}),
|
|
11023
11383
|
[hasChildren]
|
|
11024
11384
|
);
|
|
11025
|
-
return /* @__PURE__ */
|
|
11385
|
+
return /* @__PURE__ */ import_react78.default.createElement("div", { style: style2, className }, (title || titleIcon || right) && /* @__PURE__ */ import_react78.default.createElement(InspectorPrimitives_exports.SectionHeader, { style: headerStyle }, titleIcon && /* @__PURE__ */ import_react78.default.createElement("div", { style: titleIconStyle, className: textStyles[titleTextStyle] }, titleIconOptions.inlineBlockWrapper ? /* @__PURE__ */ import_react78.default.createElement("div", { style: titleIconWrapperStyle }, titleIcon) : titleIcon), title && /* @__PURE__ */ import_react78.default.createElement(import_react78.default.Fragment, null, onClickTitle ? /* @__PURE__ */ import_react78.default.createElement(Button, { variant: "none", onClick: onClickTitle }, /* @__PURE__ */ import_react78.default.createElement(InspectorPrimitives_exports.Title, { $textStyle: titleTextStyle }, title)) : /* @__PURE__ */ import_react78.default.createElement(InspectorPrimitives_exports.Title, { $textStyle: titleTextStyle }, title)), /* @__PURE__ */ import_react78.default.createElement(Spacer.Horizontal, null), right), /* @__PURE__ */ import_react78.default.createElement(IndentContext.Provider, { value: { indentLevel: 1 } }, children));
|
|
11026
11386
|
};
|
|
11027
11387
|
var ExpandableSection = ({
|
|
11028
11388
|
storageKey,
|
|
@@ -11035,12 +11395,12 @@ var ExpandableSection = ({
|
|
|
11035
11395
|
initialVisibility
|
|
11036
11396
|
);
|
|
11037
11397
|
const expanded = visibility === "show";
|
|
11038
|
-
return /* @__PURE__ */
|
|
11398
|
+
return /* @__PURE__ */ import_react78.default.createElement(
|
|
11039
11399
|
SectionInternal,
|
|
11040
11400
|
{
|
|
11041
11401
|
...props,
|
|
11042
11402
|
right: !props.hideRightWhenCollapsed || expanded ? props.right : null,
|
|
11043
|
-
title: /* @__PURE__ */
|
|
11403
|
+
title: /* @__PURE__ */ import_react78.default.createElement("div", { className: "flex gap-1 items-center" }, props.title, /* @__PURE__ */ import_react78.default.createElement(
|
|
11044
11404
|
IconButton,
|
|
11045
11405
|
{
|
|
11046
11406
|
iconName: expanded ? "ChevronDownIcon2" : "ChevronRightIcon2",
|
|
@@ -11051,53 +11411,63 @@ var ExpandableSection = ({
|
|
|
11051
11411
|
expanded && props.children
|
|
11052
11412
|
);
|
|
11053
11413
|
};
|
|
11054
|
-
var Section = (0,
|
|
11414
|
+
var Section = (0, import_react78.memo)(function InspectorSection({
|
|
11055
11415
|
storageKey,
|
|
11056
11416
|
...props
|
|
11057
11417
|
}) {
|
|
11058
|
-
return storageKey ? /* @__PURE__ */
|
|
11418
|
+
return storageKey ? /* @__PURE__ */ import_react78.default.createElement(ExpandableSection, { ...props, storageKey }) : /* @__PURE__ */ import_react78.default.createElement(SectionInternal, { ...props });
|
|
11059
11419
|
});
|
|
11060
11420
|
|
|
11061
11421
|
// src/components/SegmentedControl.tsx
|
|
11062
11422
|
var ToggleGroupPrimitive2 = __toESM(require("@radix-ui/react-toggle-group"));
|
|
11063
|
-
var
|
|
11064
|
-
var SegmentedControlContext = (0,
|
|
11423
|
+
var import_react79 = __toESM(require("react"));
|
|
11424
|
+
var SegmentedControlContext = (0, import_react79.createContext)({
|
|
11065
11425
|
colorScheme: "primary"
|
|
11066
11426
|
});
|
|
11067
|
-
var SegmentedControlItem = (0,
|
|
11427
|
+
var SegmentedControlItem = (0, import_react79.forwardRef)(function SegmentedControlItem2({
|
|
11068
11428
|
value,
|
|
11069
11429
|
tooltip,
|
|
11070
11430
|
title,
|
|
11071
11431
|
disabled = false,
|
|
11072
11432
|
icon,
|
|
11073
11433
|
className,
|
|
11434
|
+
variant = "default",
|
|
11074
11435
|
...props
|
|
11075
11436
|
}, forwardedRef) {
|
|
11076
|
-
const { colorScheme } = (0,
|
|
11077
|
-
const itemElement = /* @__PURE__ */
|
|
11437
|
+
const { colorScheme } = (0, import_react79.useContext)(SegmentedControlContext);
|
|
11438
|
+
const itemElement = /* @__PURE__ */ import_react79.default.createElement(
|
|
11078
11439
|
ToggleGroupPrimitive2.Item,
|
|
11079
11440
|
{
|
|
11080
11441
|
ref: forwardedRef,
|
|
11081
11442
|
value: (value ?? "").toString(),
|
|
11082
11443
|
disabled,
|
|
11083
11444
|
className: cx(
|
|
11084
|
-
"
|
|
11085
|
-
|
|
11086
|
-
|
|
11445
|
+
"group",
|
|
11446
|
+
"flex items-center justify-center",
|
|
11447
|
+
"font-sans text-button relative flex-1 appearance-none text-segmented-control-item focus:outline-none transition-colors",
|
|
11448
|
+
variant === "tabs" ? "font-semibold" : "font-normal",
|
|
11449
|
+
variant === "tabs" ? "" : colorScheme === "secondary" ? "focus:ring-2 focus:ring-secondary focus:ring-offset-1" : "focus:ring-2 focus:ring-primary focus:ring-offset-1",
|
|
11450
|
+
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",
|
|
11087
11451
|
"focus:z-interactable",
|
|
11088
|
-
"aria-checked:shadow-segment",
|
|
11089
|
-
"
|
|
11090
|
-
"border-r border-divider last:border-r-0",
|
|
11091
|
-
"aria-checked:border-r-transparent",
|
|
11092
|
-
"[&:has(+[aria-checked=true])]:border-r-transparent",
|
|
11452
|
+
variant === "default" ? "px-1 rounded aria-checked:shadow-segment" : "px-1.5 border-y-2 border-y-transparent aria-checked:border-b-primary",
|
|
11453
|
+
variant === "default" && "border-r border-divider last:border-r-0 aria-checked:border-r-transparent [&:has(+[aria-checked=true])]:border-r-transparent",
|
|
11093
11454
|
className
|
|
11094
11455
|
),
|
|
11095
11456
|
...props
|
|
11096
11457
|
},
|
|
11097
|
-
|
|
11098
|
-
|
|
11458
|
+
/* @__PURE__ */ import_react79.default.createElement(
|
|
11459
|
+
"span",
|
|
11460
|
+
{
|
|
11461
|
+
className: cx(
|
|
11462
|
+
"inline-flex whitespace-pre flex-nowrap gap-1.5 items-center justify-center align-middle text-center",
|
|
11463
|
+
variant === "tabs" && "group-focus:ring-2 group-focus:ring-primary-pastel group-focus:ring-offset-2"
|
|
11464
|
+
)
|
|
11465
|
+
},
|
|
11466
|
+
icon && renderIcon(icon),
|
|
11467
|
+
title
|
|
11468
|
+
)
|
|
11099
11469
|
);
|
|
11100
|
-
return tooltip ? /* @__PURE__ */
|
|
11470
|
+
return tooltip ? /* @__PURE__ */ import_react79.default.createElement(Tooltip, { content: tooltip }, itemElement) : itemElement;
|
|
11101
11471
|
});
|
|
11102
11472
|
var SegmentedControl = memoGeneric(function SegmentedControl2({
|
|
11103
11473
|
id: idProp,
|
|
@@ -11106,19 +11476,20 @@ var SegmentedControl = memoGeneric(function SegmentedControl2({
|
|
|
11106
11476
|
colorScheme,
|
|
11107
11477
|
allowEmpty,
|
|
11108
11478
|
items,
|
|
11479
|
+
variant = "default",
|
|
11109
11480
|
className,
|
|
11110
11481
|
style: style2
|
|
11111
11482
|
}) {
|
|
11112
|
-
const contextValue = (0,
|
|
11483
|
+
const contextValue = (0, import_react79.useMemo)(() => ({ colorScheme }), [colorScheme]);
|
|
11113
11484
|
const { fieldId: id } = useLabel({ fieldId: idProp });
|
|
11114
|
-
const handleValueChange = (0,
|
|
11485
|
+
const handleValueChange = (0, import_react79.useCallback)(
|
|
11115
11486
|
(value2) => {
|
|
11116
11487
|
if (!allowEmpty && !value2) return;
|
|
11117
11488
|
onValueChange?.(value2);
|
|
11118
11489
|
},
|
|
11119
11490
|
[allowEmpty, onValueChange]
|
|
11120
11491
|
);
|
|
11121
|
-
return /* @__PURE__ */
|
|
11492
|
+
return /* @__PURE__ */ import_react79.default.createElement(SegmentedControlContext.Provider, { value: contextValue }, /* @__PURE__ */ import_react79.default.createElement(
|
|
11122
11493
|
ToggleGroupPrimitive2.Root,
|
|
11123
11494
|
{
|
|
11124
11495
|
id,
|
|
@@ -11126,7 +11497,9 @@ var SegmentedControl = memoGeneric(function SegmentedControl2({
|
|
|
11126
11497
|
value,
|
|
11127
11498
|
onValueChange: handleValueChange,
|
|
11128
11499
|
className: cx(
|
|
11129
|
-
`
|
|
11500
|
+
`appearance-none relative outline-none`,
|
|
11501
|
+
variant === "default" && "grid min-h-input-height bg-input-background rounded py-0.5 px-0.5",
|
|
11502
|
+
variant === "tabs" && "flex gap-1.5 min-h-[33px]",
|
|
11130
11503
|
className
|
|
11131
11504
|
),
|
|
11132
11505
|
style: {
|
|
@@ -11134,13 +11507,14 @@ var SegmentedControl = memoGeneric(function SegmentedControl2({
|
|
|
11134
11507
|
gridTemplateColumns: `repeat(${items.length}, 1fr)`
|
|
11135
11508
|
}
|
|
11136
11509
|
},
|
|
11137
|
-
items.map((item, index) => /* @__PURE__ */
|
|
11510
|
+
items.map((item, index) => /* @__PURE__ */ import_react79.default.createElement(SegmentedControlItem, { key: index, ...item, variant }))
|
|
11138
11511
|
));
|
|
11139
11512
|
});
|
|
11140
11513
|
|
|
11141
11514
|
// src/components/SelectionToolbar.tsx
|
|
11142
11515
|
var PopperPrimitive = __toESM(require("@radix-ui/react-popper"));
|
|
11143
|
-
var
|
|
11516
|
+
var import_react80 = __toESM(require("react"));
|
|
11517
|
+
var import_react_dom3 = require("react-dom");
|
|
11144
11518
|
var createVirtualElement = (rect) => ({
|
|
11145
11519
|
getBoundingClientRect: () => ({
|
|
11146
11520
|
width: rect.width,
|
|
@@ -11154,21 +11528,22 @@ var createVirtualElement = (rect) => ({
|
|
|
11154
11528
|
toJSON: () => null
|
|
11155
11529
|
})
|
|
11156
11530
|
});
|
|
11157
|
-
var SelectionToolbarContainer = (0,
|
|
11531
|
+
var SelectionToolbarContainer = (0, import_react80.memo)(
|
|
11158
11532
|
function SelectionToolbarContainer2({
|
|
11159
11533
|
rect,
|
|
11160
|
-
children
|
|
11534
|
+
children,
|
|
11535
|
+
portalContainer
|
|
11161
11536
|
}) {
|
|
11162
11537
|
const portalScopeId = usePortalScopeId();
|
|
11163
|
-
const containerRef =
|
|
11538
|
+
const containerRef = import_react80.default.useRef(null);
|
|
11164
11539
|
const size2 = useSize(containerRef, "width");
|
|
11165
|
-
const virtualRef = (0,
|
|
11540
|
+
const virtualRef = (0, import_react80.useMemo)(
|
|
11166
11541
|
() => ({
|
|
11167
11542
|
current: createVirtualElement(rect)
|
|
11168
11543
|
}),
|
|
11169
11544
|
[rect]
|
|
11170
11545
|
);
|
|
11171
|
-
|
|
11546
|
+
const popperContent = /* @__PURE__ */ import_react80.default.createElement(
|
|
11172
11547
|
PopperPrimitive.Content,
|
|
11173
11548
|
{
|
|
11174
11549
|
...portalScopeProps(portalScopeId),
|
|
@@ -11185,22 +11560,27 @@ var SelectionToolbarContainer = (0, import_react79.memo)(
|
|
|
11185
11560
|
["--n-input-background"]: "transparent"
|
|
11186
11561
|
}
|
|
11187
11562
|
},
|
|
11188
|
-
/* @__PURE__ */
|
|
11563
|
+
/* @__PURE__ */ import_react80.default.createElement(
|
|
11189
11564
|
"div",
|
|
11190
11565
|
{
|
|
11191
11566
|
ref: containerRef,
|
|
11192
|
-
className: "flex gap-1 bg-popover-background rounded shadow-popover p-1"
|
|
11567
|
+
className: "flex gap-1 bg-popover-background rounded shadow-popover p-1",
|
|
11568
|
+
onClick: (e) => e.stopPropagation(),
|
|
11569
|
+
onMouseDown: (e) => e.stopPropagation(),
|
|
11570
|
+
onPointerDown: (e) => e.stopPropagation(),
|
|
11571
|
+
onWheel: (e) => e.stopPropagation()
|
|
11193
11572
|
},
|
|
11194
11573
|
children
|
|
11195
11574
|
)
|
|
11196
|
-
)
|
|
11575
|
+
);
|
|
11576
|
+
return /* @__PURE__ */ import_react80.default.createElement(PopperPrimitive.Root, null, /* @__PURE__ */ import_react80.default.createElement(PopperPrimitive.Anchor, { virtualRef }), portalContainer ? (0, import_react_dom3.createPortal)(popperContent, portalContainer) : popperContent);
|
|
11197
11577
|
}
|
|
11198
11578
|
);
|
|
11199
11579
|
|
|
11200
11580
|
// src/components/SelectMenu.tsx
|
|
11201
|
-
var
|
|
11581
|
+
var import_noya_icons9 = require("@noya-app/noya-icons");
|
|
11202
11582
|
var Select = __toESM(require("@radix-ui/react-select"));
|
|
11203
|
-
var
|
|
11583
|
+
var import_react81 = __toESM(require("react"));
|
|
11204
11584
|
var readOnlyStyle = {
|
|
11205
11585
|
justifyContent: "flex-start",
|
|
11206
11586
|
textAlign: "left"
|
|
@@ -11231,7 +11611,7 @@ var SelectMenuTrigger = memoGeneric(function SelectMenuTrigger2({
|
|
|
11231
11611
|
fieldId: props.id
|
|
11232
11612
|
});
|
|
11233
11613
|
const labelPosition = useLabelPosition();
|
|
11234
|
-
return /* @__PURE__ */
|
|
11614
|
+
return /* @__PURE__ */ import_react81.default.createElement(Select.SelectTrigger, { asChild: true, onFocus, onBlur }, /* @__PURE__ */ import_react81.default.createElement(
|
|
11235
11615
|
Button,
|
|
11236
11616
|
{
|
|
11237
11617
|
id,
|
|
@@ -11243,11 +11623,11 @@ var SelectMenuTrigger = memoGeneric(function SelectMenuTrigger2({
|
|
|
11243
11623
|
),
|
|
11244
11624
|
disabled
|
|
11245
11625
|
},
|
|
11246
|
-
icon && /* @__PURE__ */
|
|
11247
|
-
label && labelPosition === "inset" && /* @__PURE__ */
|
|
11248
|
-
/* @__PURE__ */
|
|
11249
|
-
/* @__PURE__ */
|
|
11250
|
-
|
|
11626
|
+
icon && /* @__PURE__ */ import_react81.default.createElement("span", { className: "pr-1.5" }, renderIcon(icon)),
|
|
11627
|
+
label && labelPosition === "inset" && /* @__PURE__ */ import_react81.default.createElement("div", { className: insetEndStyles }, /* @__PURE__ */ import_react81.default.createElement(Label, { className: "pr-4 text-text-disabled", htmlFor: id }, label)),
|
|
11628
|
+
/* @__PURE__ */ import_react81.default.createElement("span", { className: "flex-1 flex" }, /* @__PURE__ */ import_react81.default.createElement(Select.Value, { placeholder })),
|
|
11629
|
+
/* @__PURE__ */ import_react81.default.createElement(
|
|
11630
|
+
import_noya_icons9.DropdownChevronIcon,
|
|
11251
11631
|
{
|
|
11252
11632
|
className: cx(
|
|
11253
11633
|
"transition-transform duration-100 ml-1.5",
|
|
@@ -11283,7 +11663,7 @@ var SelectMenu = memoGeneric(function SelectMenu2({
|
|
|
11283
11663
|
(item) => isSelectableMenuItem(item) && item.value === value
|
|
11284
11664
|
);
|
|
11285
11665
|
const icon = selectedItem?.icon;
|
|
11286
|
-
const [internalOpen, setInternalOpen] = (0,
|
|
11666
|
+
const [internalOpen, setInternalOpen] = (0, import_react81.useState)(open);
|
|
11287
11667
|
const { label, fieldId: id } = useLabel({
|
|
11288
11668
|
label: props.label,
|
|
11289
11669
|
fieldId: props.id
|
|
@@ -11294,8 +11674,8 @@ var SelectMenu = memoGeneric(function SelectMenu2({
|
|
|
11294
11674
|
}
|
|
11295
11675
|
setInternalOpen(open2);
|
|
11296
11676
|
};
|
|
11297
|
-
const readOnlyButton = (0,
|
|
11298
|
-
() => /* @__PURE__ */
|
|
11677
|
+
const readOnlyButton = (0, import_react81.useMemo)(
|
|
11678
|
+
() => /* @__PURE__ */ import_react81.default.createElement(
|
|
11299
11679
|
Button,
|
|
11300
11680
|
{
|
|
11301
11681
|
id,
|
|
@@ -11305,11 +11685,11 @@ var SelectMenu = memoGeneric(function SelectMenu2({
|
|
|
11305
11685
|
disabled
|
|
11306
11686
|
},
|
|
11307
11687
|
icon && renderIcon(icon),
|
|
11308
|
-
/* @__PURE__ */
|
|
11688
|
+
/* @__PURE__ */ import_react81.default.createElement("span", { className: "flex flex-1" }, selectedItem?.title ?? value)
|
|
11309
11689
|
),
|
|
11310
11690
|
[icon, id, style2, className, disabled, value, selectedItem]
|
|
11311
11691
|
);
|
|
11312
|
-
const contentStyle = (0,
|
|
11692
|
+
const contentStyle = (0, import_react81.useMemo)(() => {
|
|
11313
11693
|
return {
|
|
11314
11694
|
width: "var(--radix-select-trigger-width)",
|
|
11315
11695
|
minWidth: "max-content",
|
|
@@ -11317,7 +11697,7 @@ var SelectMenu = memoGeneric(function SelectMenu2({
|
|
|
11317
11697
|
...contentStyleProp
|
|
11318
11698
|
};
|
|
11319
11699
|
}, [contentStyleProp]);
|
|
11320
|
-
const content = /* @__PURE__ */
|
|
11700
|
+
const content = /* @__PURE__ */ import_react81.default.createElement(
|
|
11321
11701
|
Select.Root,
|
|
11322
11702
|
{
|
|
11323
11703
|
value,
|
|
@@ -11325,7 +11705,7 @@ var SelectMenu = memoGeneric(function SelectMenu2({
|
|
|
11325
11705
|
open,
|
|
11326
11706
|
onOpenChange: handleOpenChange
|
|
11327
11707
|
},
|
|
11328
|
-
/* @__PURE__ */
|
|
11708
|
+
/* @__PURE__ */ import_react81.default.createElement(
|
|
11329
11709
|
SelectMenuTrigger,
|
|
11330
11710
|
{
|
|
11331
11711
|
id,
|
|
@@ -11340,7 +11720,7 @@ var SelectMenu = memoGeneric(function SelectMenu2({
|
|
|
11340
11720
|
label
|
|
11341
11721
|
}
|
|
11342
11722
|
),
|
|
11343
|
-
/* @__PURE__ */
|
|
11723
|
+
/* @__PURE__ */ import_react81.default.createElement(Select.Portal, null, /* @__PURE__ */ import_react81.default.createElement(
|
|
11344
11724
|
Select.Content,
|
|
11345
11725
|
{
|
|
11346
11726
|
...portalScopeProps(portalScopeId),
|
|
@@ -11351,14 +11731,14 @@ var SelectMenu = memoGeneric(function SelectMenu2({
|
|
|
11351
11731
|
align: "center",
|
|
11352
11732
|
style: contentStyle
|
|
11353
11733
|
},
|
|
11354
|
-
/* @__PURE__ */
|
|
11355
|
-
|
|
11734
|
+
/* @__PURE__ */ import_react81.default.createElement(Select.ScrollUpButton, { className: scrollButtonStyles }, /* @__PURE__ */ import_react81.default.createElement(
|
|
11735
|
+
import_noya_icons9.ChevronUpIcon,
|
|
11356
11736
|
{
|
|
11357
11737
|
className: cx("transition-transform duration-100")
|
|
11358
11738
|
}
|
|
11359
11739
|
)),
|
|
11360
|
-
/* @__PURE__ */
|
|
11361
|
-
/* @__PURE__ */
|
|
11740
|
+
/* @__PURE__ */ import_react81.default.createElement(Select.Viewport, null, /* @__PURE__ */ import_react81.default.createElement(MenuViewport, { items, Components: Components3 })),
|
|
11741
|
+
/* @__PURE__ */ import_react81.default.createElement(Select.ScrollDownButton, { className: scrollButtonStyles }, /* @__PURE__ */ import_react81.default.createElement(import_noya_icons9.ChevronDownIcon, null))
|
|
11362
11742
|
))
|
|
11363
11743
|
);
|
|
11364
11744
|
return readOnly ? readOnlyButton : content;
|
|
@@ -11366,13 +11746,13 @@ var SelectMenu = memoGeneric(function SelectMenu2({
|
|
|
11366
11746
|
|
|
11367
11747
|
// src/components/Slider.tsx
|
|
11368
11748
|
var RadixSlider = __toESM(require("@radix-ui/react-slider"));
|
|
11369
|
-
var
|
|
11749
|
+
var import_react82 = __toESM(require("react"));
|
|
11370
11750
|
var THUMB_WIDTH = 8;
|
|
11371
11751
|
var thumbStyle = {
|
|
11372
11752
|
width: THUMB_WIDTH
|
|
11373
11753
|
};
|
|
11374
11754
|
var insetEndStyles2 = getInsetEndStyles();
|
|
11375
|
-
var Slider = (0,
|
|
11755
|
+
var Slider = (0, import_react82.memo)(function Slider2({
|
|
11376
11756
|
style: style2,
|
|
11377
11757
|
className,
|
|
11378
11758
|
value,
|
|
@@ -11386,7 +11766,7 @@ var Slider = (0, import_react81.memo)(function Slider2({
|
|
|
11386
11766
|
readOnly = false,
|
|
11387
11767
|
...props
|
|
11388
11768
|
}) {
|
|
11389
|
-
const arrayValue = (0,
|
|
11769
|
+
const arrayValue = (0, import_react82.useMemo)(
|
|
11390
11770
|
() => [Math.min(Math.max(value, min), max)],
|
|
11391
11771
|
[value, min, max]
|
|
11392
11772
|
);
|
|
@@ -11395,13 +11775,13 @@ var Slider = (0, import_react81.memo)(function Slider2({
|
|
|
11395
11775
|
fieldId: props.id
|
|
11396
11776
|
});
|
|
11397
11777
|
const labelPosition = useLabelPosition();
|
|
11398
|
-
const handleValueChange = (0,
|
|
11778
|
+
const handleValueChange = (0, import_react82.useCallback)(
|
|
11399
11779
|
(arrayValue2) => {
|
|
11400
11780
|
onValueChange(arrayValue2[0]);
|
|
11401
11781
|
},
|
|
11402
11782
|
[onValueChange]
|
|
11403
11783
|
);
|
|
11404
|
-
const percentage = (0,
|
|
11784
|
+
const percentage = (0, import_react82.useMemo)(() => {
|
|
11405
11785
|
const rawPercent = (arrayValue[0] - min) / (max - min);
|
|
11406
11786
|
const adjustedPercent = rawPercent * (100 - THUMB_WIDTH * 100 / 300) + THUMB_WIDTH * 50 / 300;
|
|
11407
11787
|
return {
|
|
@@ -11409,19 +11789,19 @@ var Slider = (0, import_react81.memo)(function Slider2({
|
|
|
11409
11789
|
adjusted: adjustedPercent
|
|
11410
11790
|
};
|
|
11411
11791
|
}, [arrayValue, min, max]);
|
|
11412
|
-
const trackFillStyle = (0,
|
|
11792
|
+
const trackFillStyle = (0, import_react82.useMemo)(
|
|
11413
11793
|
() => ({
|
|
11414
11794
|
clipPath: `inset(0 ${100 - percentage.adjusted}% 0 0)`
|
|
11415
11795
|
}),
|
|
11416
11796
|
[percentage.adjusted]
|
|
11417
11797
|
);
|
|
11418
|
-
const labelStyle = (0,
|
|
11798
|
+
const labelStyle = (0, import_react82.useMemo)(
|
|
11419
11799
|
() => ({
|
|
11420
11800
|
clipPath: `inset(0 ${100 - percentage.raw}% 0 0)`
|
|
11421
11801
|
}),
|
|
11422
11802
|
[percentage.raw]
|
|
11423
11803
|
);
|
|
11424
|
-
return /* @__PURE__ */
|
|
11804
|
+
return /* @__PURE__ */ import_react82.default.createElement(
|
|
11425
11805
|
RadixSlider.Root,
|
|
11426
11806
|
{
|
|
11427
11807
|
min,
|
|
@@ -11439,7 +11819,7 @@ var Slider = (0, import_react81.memo)(function Slider2({
|
|
|
11439
11819
|
onBlur,
|
|
11440
11820
|
disabled: readOnly
|
|
11441
11821
|
},
|
|
11442
|
-
/* @__PURE__ */
|
|
11822
|
+
/* @__PURE__ */ import_react82.default.createElement(RadixSlider.Track, { className: "flex-grow h-full rounded overflow-hidden bg-input-background" }, label && labelPosition === "inset" && /* @__PURE__ */ import_react82.default.createElement("div", { className: insetEndStyles2 }, /* @__PURE__ */ import_react82.default.createElement(Label, { htmlFor: id, className: "text-text-disabled" }, label)), /* @__PURE__ */ import_react82.default.createElement(
|
|
11443
11823
|
"div",
|
|
11444
11824
|
{
|
|
11445
11825
|
style: trackFillStyle,
|
|
@@ -11450,8 +11830,8 @@ var Slider = (0, import_react81.memo)(function Slider2({
|
|
|
11450
11830
|
)
|
|
11451
11831
|
}
|
|
11452
11832
|
)),
|
|
11453
|
-
label && labelPosition === "inset" && colorScheme !== void 0 && /* @__PURE__ */
|
|
11454
|
-
/* @__PURE__ */
|
|
11833
|
+
label && labelPosition === "inset" && colorScheme !== void 0 && /* @__PURE__ */ import_react82.default.createElement("div", { className: insetEndStyles2 }, /* @__PURE__ */ import_react82.default.createElement(Label, { className: "text-white overflow-hidden", style: labelStyle }, label)),
|
|
11834
|
+
/* @__PURE__ */ import_react82.default.createElement(
|
|
11455
11835
|
RadixSlider.Thumb,
|
|
11456
11836
|
{
|
|
11457
11837
|
style: thumbStyle,
|
|
@@ -11466,9 +11846,37 @@ var Slider = (0, import_react81.memo)(function Slider2({
|
|
|
11466
11846
|
);
|
|
11467
11847
|
});
|
|
11468
11848
|
|
|
11849
|
+
// src/components/sorting/createSharedDrag.tsx
|
|
11850
|
+
var React82 = __toESM(require("react"));
|
|
11851
|
+
function createSharedDrag() {
|
|
11852
|
+
const dragRegistrationContext = React82.createContext(null);
|
|
11853
|
+
const activeDragContext = React82.createContext(
|
|
11854
|
+
null
|
|
11855
|
+
);
|
|
11856
|
+
const Provider3 = ({ children }) => /* @__PURE__ */ React82.createElement(
|
|
11857
|
+
SharedDragProvider,
|
|
11858
|
+
{
|
|
11859
|
+
contexts: {
|
|
11860
|
+
dragRegistrationContext,
|
|
11861
|
+
activeDragContext
|
|
11862
|
+
}
|
|
11863
|
+
},
|
|
11864
|
+
children
|
|
11865
|
+
);
|
|
11866
|
+
const dragProps = {
|
|
11867
|
+
dragRegistrationContext,
|
|
11868
|
+
activeDragContext
|
|
11869
|
+
};
|
|
11870
|
+
return {
|
|
11871
|
+
Provider: Provider3,
|
|
11872
|
+
Sortable: (props) => /* @__PURE__ */ React82.createElement(Sortable, { sharedDragProviderContexts: dragProps, ...props }),
|
|
11873
|
+
props: dragProps
|
|
11874
|
+
};
|
|
11875
|
+
}
|
|
11876
|
+
|
|
11469
11877
|
// src/components/Switch.tsx
|
|
11470
11878
|
var SwitchPrimitive = __toESM(require("@radix-ui/react-switch"));
|
|
11471
|
-
var
|
|
11879
|
+
var React83 = __toESM(require("react"));
|
|
11472
11880
|
var Switch = function Switch2({
|
|
11473
11881
|
id,
|
|
11474
11882
|
value,
|
|
@@ -11480,7 +11888,7 @@ var Switch = function Switch2({
|
|
|
11480
11888
|
style: style2,
|
|
11481
11889
|
className
|
|
11482
11890
|
}) {
|
|
11483
|
-
return /* @__PURE__ */
|
|
11891
|
+
return /* @__PURE__ */ React83.createElement(
|
|
11484
11892
|
SwitchPrimitive.Root,
|
|
11485
11893
|
{
|
|
11486
11894
|
id,
|
|
@@ -11499,20 +11907,20 @@ var Switch = function Switch2({
|
|
|
11499
11907
|
onFocus,
|
|
11500
11908
|
onBlur
|
|
11501
11909
|
},
|
|
11502
|
-
/* @__PURE__ */
|
|
11910
|
+
/* @__PURE__ */ React83.createElement(SwitchPrimitive.Thumb, { className: "block w-[15px] h-[15px] bg-background rounded-full transition-transform translate-x-[2px] data-[state=checked]:translate-x-[15px]" })
|
|
11503
11911
|
);
|
|
11504
11912
|
};
|
|
11505
11913
|
|
|
11506
11914
|
// src/components/UserPointer.tsx
|
|
11507
|
-
var
|
|
11508
|
-
var UserPointerContainer = (0,
|
|
11915
|
+
var import_react83 = __toESM(require("react"));
|
|
11916
|
+
var UserPointerContainer = (0, import_react83.memo)(function UserPointerContainer2({
|
|
11509
11917
|
point,
|
|
11510
11918
|
visible,
|
|
11511
11919
|
children,
|
|
11512
11920
|
className,
|
|
11513
11921
|
style: style2
|
|
11514
11922
|
}) {
|
|
11515
|
-
return /* @__PURE__ */
|
|
11923
|
+
return /* @__PURE__ */ import_react83.default.createElement(
|
|
11516
11924
|
"div",
|
|
11517
11925
|
{
|
|
11518
11926
|
style: {
|
|
@@ -11529,13 +11937,13 @@ var UserPointerContainer = (0, import_react82.memo)(function UserPointerContaine
|
|
|
11529
11937
|
children
|
|
11530
11938
|
);
|
|
11531
11939
|
});
|
|
11532
|
-
var UserNameTag = (0,
|
|
11940
|
+
var UserNameTag = (0, import_react83.memo)(function UserNameTag2({
|
|
11533
11941
|
backgroundColor,
|
|
11534
11942
|
className,
|
|
11535
11943
|
style: style2,
|
|
11536
11944
|
children
|
|
11537
11945
|
}) {
|
|
11538
|
-
return /* @__PURE__ */
|
|
11946
|
+
return /* @__PURE__ */ import_react83.default.createElement(
|
|
11539
11947
|
"span",
|
|
11540
11948
|
{
|
|
11541
11949
|
className: cx(
|
|
@@ -11551,14 +11959,14 @@ var UserNameTag = (0, import_react82.memo)(function UserNameTag2({
|
|
|
11551
11959
|
children
|
|
11552
11960
|
);
|
|
11553
11961
|
});
|
|
11554
|
-
var UserPointerIcon = (0,
|
|
11962
|
+
var UserPointerIcon = (0, import_react83.memo)(function PointerIcon({
|
|
11555
11963
|
size: size2,
|
|
11556
11964
|
color = "black",
|
|
11557
11965
|
className,
|
|
11558
11966
|
style: style2
|
|
11559
11967
|
}) {
|
|
11560
11968
|
const points = "0,5 10,0 10,10";
|
|
11561
|
-
return /* @__PURE__ */
|
|
11969
|
+
return /* @__PURE__ */ import_react83.default.createElement(
|
|
11562
11970
|
"svg",
|
|
11563
11971
|
{
|
|
11564
11972
|
width: size2,
|
|
@@ -11573,7 +11981,7 @@ var UserPointerIcon = (0, import_react82.memo)(function PointerIcon({
|
|
|
11573
11981
|
...style2
|
|
11574
11982
|
}
|
|
11575
11983
|
},
|
|
11576
|
-
/* @__PURE__ */
|
|
11984
|
+
/* @__PURE__ */ import_react83.default.createElement(
|
|
11577
11985
|
"polygon",
|
|
11578
11986
|
{
|
|
11579
11987
|
points,
|
|
@@ -11586,7 +11994,7 @@ var UserPointerIcon = (0, import_react82.memo)(function PointerIcon({
|
|
|
11586
11994
|
});
|
|
11587
11995
|
var POINTER_SIZE = 12;
|
|
11588
11996
|
var POINTER_OVERLAP = 6;
|
|
11589
|
-
var UserPointer = (0,
|
|
11997
|
+
var UserPointer = (0, import_react83.memo)(function UserPointer2({
|
|
11590
11998
|
userId,
|
|
11591
11999
|
name,
|
|
11592
12000
|
visible = true,
|
|
@@ -11595,22 +12003,22 @@ var UserPointer = (0, import_react82.memo)(function UserPointer2({
|
|
|
11595
12003
|
style: style2,
|
|
11596
12004
|
className
|
|
11597
12005
|
}) {
|
|
11598
|
-
const userBackgroundColor = (0,
|
|
12006
|
+
const userBackgroundColor = (0, import_react83.useMemo)(
|
|
11599
12007
|
() => backgroundColor ?? colorFromString(userId ?? name ?? ""),
|
|
11600
12008
|
[backgroundColor, userId, name]
|
|
11601
12009
|
);
|
|
11602
|
-
const pointerOverlapStyle = (0,
|
|
12010
|
+
const pointerOverlapStyle = (0, import_react83.useMemo)(
|
|
11603
12011
|
() => ({
|
|
11604
12012
|
marginRight: `-${POINTER_OVERLAP}px`,
|
|
11605
12013
|
marginBottom: `-${POINTER_OVERLAP}px`
|
|
11606
12014
|
}),
|
|
11607
12015
|
[]
|
|
11608
12016
|
);
|
|
11609
|
-
const nameTagOverlapStyle = (0,
|
|
12017
|
+
const nameTagOverlapStyle = (0, import_react83.useMemo)(
|
|
11610
12018
|
() => ({ marginLeft: `${POINTER_SIZE - POINTER_OVERLAP + 1}px` }),
|
|
11611
12019
|
[]
|
|
11612
12020
|
);
|
|
11613
|
-
return /* @__PURE__ */
|
|
12021
|
+
return /* @__PURE__ */ import_react83.default.createElement(
|
|
11614
12022
|
UserPointerContainer,
|
|
11615
12023
|
{
|
|
11616
12024
|
point,
|
|
@@ -11618,14 +12026,14 @@ var UserPointer = (0, import_react82.memo)(function UserPointer2({
|
|
|
11618
12026
|
className,
|
|
11619
12027
|
style: style2
|
|
11620
12028
|
},
|
|
11621
|
-
name && /* @__PURE__ */
|
|
12029
|
+
name && /* @__PURE__ */ import_react83.default.createElement("div", { className: "relative" }, /* @__PURE__ */ import_react83.default.createElement(
|
|
11622
12030
|
UserPointerIcon,
|
|
11623
12031
|
{
|
|
11624
12032
|
size: POINTER_SIZE,
|
|
11625
12033
|
color: userBackgroundColor,
|
|
11626
12034
|
style: pointerOverlapStyle
|
|
11627
12035
|
}
|
|
11628
|
-
), /* @__PURE__ */
|
|
12036
|
+
), /* @__PURE__ */ import_react83.default.createElement(
|
|
11629
12037
|
UserNameTag,
|
|
11630
12038
|
{
|
|
11631
12039
|
backgroundColor: userBackgroundColor,
|
|
@@ -11638,18 +12046,18 @@ var UserPointer = (0, import_react82.memo)(function UserPointer2({
|
|
|
11638
12046
|
|
|
11639
12047
|
// src/components/workspace/WorkspaceLayout.tsx
|
|
11640
12048
|
var import_noya_keymap6 = require("@noya-app/noya-keymap");
|
|
11641
|
-
var
|
|
12049
|
+
var import_react88 = __toESM(require("react"));
|
|
11642
12050
|
|
|
11643
12051
|
// src/hooks/useWindowSize.tsx
|
|
11644
|
-
var
|
|
12052
|
+
var import_react84 = require("react");
|
|
11645
12053
|
function useWindowSize() {
|
|
11646
|
-
const [size2, setSize] = (0,
|
|
12054
|
+
const [size2, setSize] = (0, import_react84.useState)(
|
|
11647
12055
|
typeof window === "undefined" ? { width: 0, height: 0 } : {
|
|
11648
12056
|
width: window.innerWidth,
|
|
11649
12057
|
height: window.innerHeight
|
|
11650
12058
|
}
|
|
11651
12059
|
);
|
|
11652
|
-
(0,
|
|
12060
|
+
(0, import_react84.useEffect)(() => {
|
|
11653
12061
|
const handleResize = () => setSize({
|
|
11654
12062
|
width: window.innerWidth,
|
|
11655
12063
|
height: window.innerHeight
|
|
@@ -11661,18 +12069,18 @@ function useWindowSize() {
|
|
|
11661
12069
|
}
|
|
11662
12070
|
|
|
11663
12071
|
// src/components/workspace/DrawerWorkspaceLayout.tsx
|
|
11664
|
-
var
|
|
12072
|
+
var import_react86 = __toESM(require("react"));
|
|
11665
12073
|
|
|
11666
12074
|
// src/hooks/usePreservePanelSize.tsx
|
|
11667
|
-
var
|
|
12075
|
+
var import_react85 = require("react");
|
|
11668
12076
|
var EDITOR_PANEL_GROUP_ID = "editor-panel-group";
|
|
11669
12077
|
var LEFT_SIDEBAR_ID = "editor-left-sidebar";
|
|
11670
12078
|
var RIGHT_SIDEBAR_ID = "editor-right-sidebar";
|
|
11671
12079
|
var CONTENT_AREA_ID = "editor-content-area";
|
|
11672
12080
|
function usePreservePanelSize(panelGroupRef, setPanelLayoutState) {
|
|
11673
12081
|
const windowSize = useWindowSize();
|
|
11674
|
-
const layoutRef = (0,
|
|
11675
|
-
(0,
|
|
12082
|
+
const layoutRef = (0, import_react85.useRef)();
|
|
12083
|
+
(0, import_react85.useLayoutEffect)(() => {
|
|
11676
12084
|
const panelGroup = document.querySelector(
|
|
11677
12085
|
`[data-panel-group-id="${EDITOR_PANEL_GROUP_ID}"]`
|
|
11678
12086
|
);
|
|
@@ -11715,7 +12123,7 @@ function usePreservePanelSize(panelGroupRef, setPanelLayoutState) {
|
|
|
11715
12123
|
panelGroupObserver.disconnect();
|
|
11716
12124
|
};
|
|
11717
12125
|
}, [panelGroupRef, setPanelLayoutState]);
|
|
11718
|
-
(0,
|
|
12126
|
+
(0, import_react85.useLayoutEffect)(() => {
|
|
11719
12127
|
if (!layoutRef.current) return;
|
|
11720
12128
|
const {
|
|
11721
12129
|
windowWidth: oldWindowWidth,
|
|
@@ -11801,7 +12209,7 @@ function usePreservePanelSize(panelGroupRef, setPanelLayoutState) {
|
|
|
11801
12209
|
}
|
|
11802
12210
|
|
|
11803
12211
|
// src/components/workspace/DrawerWorkspaceLayout.tsx
|
|
11804
|
-
var DrawerWorkspaceLayout = (0,
|
|
12212
|
+
var DrawerWorkspaceLayout = (0, import_react86.memo)(function DrawerWorkspaceLayout2({
|
|
11805
12213
|
leftPanel,
|
|
11806
12214
|
leftSidebarRef,
|
|
11807
12215
|
rightPanel,
|
|
@@ -11810,9 +12218,9 @@ var DrawerWorkspaceLayout = (0, import_react85.memo)(function DrawerWorkspaceLay
|
|
|
11810
12218
|
internalLayoutState,
|
|
11811
12219
|
handleChangeLayoutState
|
|
11812
12220
|
}) {
|
|
11813
|
-
const portalContainer = (0,
|
|
11814
|
-
const [mounted, setMounted] = (0,
|
|
11815
|
-
(0,
|
|
12221
|
+
const portalContainer = (0, import_react86.useRef)(null);
|
|
12222
|
+
const [mounted, setMounted] = (0, import_react86.useState)(false);
|
|
12223
|
+
(0, import_react86.useLayoutEffect)(() => {
|
|
11816
12224
|
if (mounted) return;
|
|
11817
12225
|
setMounted(true);
|
|
11818
12226
|
handleChangeLayoutState({
|
|
@@ -11822,14 +12230,14 @@ var DrawerWorkspaceLayout = (0, import_react85.memo)(function DrawerWorkspaceLay
|
|
|
11822
12230
|
}, [handleChangeLayoutState, mounted]);
|
|
11823
12231
|
const leftSidebarCollapsed = internalLayoutState?.leftSidebarCollapsed ?? false;
|
|
11824
12232
|
const rightSidebarCollapsed = internalLayoutState?.rightSidebarCollapsed ?? false;
|
|
11825
|
-
return /* @__PURE__ */
|
|
12233
|
+
return /* @__PURE__ */ import_react86.default.createElement(
|
|
11826
12234
|
"div",
|
|
11827
12235
|
{
|
|
11828
12236
|
ref: portalContainer,
|
|
11829
12237
|
id: EDITOR_PANEL_GROUP_ID,
|
|
11830
12238
|
className: "flex flex-1 relative focus:outline-none"
|
|
11831
12239
|
},
|
|
11832
|
-
leftPanel && /* @__PURE__ */
|
|
12240
|
+
leftPanel && /* @__PURE__ */ import_react86.default.createElement(
|
|
11833
12241
|
Drawer,
|
|
11834
12242
|
{
|
|
11835
12243
|
id: LEFT_SIDEBAR_ID,
|
|
@@ -11850,7 +12258,7 @@ var DrawerWorkspaceLayout = (0, import_react85.memo)(function DrawerWorkspaceLay
|
|
|
11850
12258
|
leftPanel
|
|
11851
12259
|
),
|
|
11852
12260
|
centerPanel,
|
|
11853
|
-
rightPanel && /* @__PURE__ */
|
|
12261
|
+
rightPanel && /* @__PURE__ */ import_react86.default.createElement(
|
|
11854
12262
|
Drawer,
|
|
11855
12263
|
{
|
|
11856
12264
|
id: RIGHT_SIDEBAR_ID,
|
|
@@ -11874,9 +12282,9 @@ var DrawerWorkspaceLayout = (0, import_react85.memo)(function DrawerWorkspaceLay
|
|
|
11874
12282
|
});
|
|
11875
12283
|
|
|
11876
12284
|
// src/components/workspace/PanelWorkspaceLayout.tsx
|
|
11877
|
-
var
|
|
12285
|
+
var import_react87 = __toESM(require("react"));
|
|
11878
12286
|
var import_react_resizable_panels = require("react-resizable-panels");
|
|
11879
|
-
var PanelWorkspaceLayout = (0,
|
|
12287
|
+
var PanelWorkspaceLayout = (0, import_react87.memo)(function PanelWorkspaceLayout2({
|
|
11880
12288
|
leftPanel,
|
|
11881
12289
|
rightPanel,
|
|
11882
12290
|
centerPanel,
|
|
@@ -11889,9 +12297,9 @@ var PanelWorkspaceLayout = (0, import_react86.memo)(function PanelWorkspaceLayou
|
|
|
11889
12297
|
rightSidebarRef,
|
|
11890
12298
|
handleChangeLayoutState
|
|
11891
12299
|
}) {
|
|
11892
|
-
const panelGroupRef = (0,
|
|
12300
|
+
const panelGroupRef = (0, import_react87.useRef)(null);
|
|
11893
12301
|
usePreservePanelSize(panelGroupRef, handleChangeLayoutState);
|
|
11894
|
-
return /* @__PURE__ */
|
|
12302
|
+
return /* @__PURE__ */ import_react87.default.createElement(
|
|
11895
12303
|
import_react_resizable_panels.PanelGroup,
|
|
11896
12304
|
{
|
|
11897
12305
|
ref: panelGroupRef,
|
|
@@ -11900,7 +12308,7 @@ var PanelWorkspaceLayout = (0, import_react86.memo)(function PanelWorkspaceLayou
|
|
|
11900
12308
|
direction: "horizontal",
|
|
11901
12309
|
autoSaveId: autoSavePrefix ? `${autoSavePrefix}--${EDITOR_PANEL_GROUP_ID}` : void 0
|
|
11902
12310
|
},
|
|
11903
|
-
leftPanel && /* @__PURE__ */
|
|
12311
|
+
leftPanel && /* @__PURE__ */ import_react87.default.createElement(import_react87.default.Fragment, null, /* @__PURE__ */ import_react87.default.createElement(
|
|
11904
12312
|
import_react_resizable_panels.Panel,
|
|
11905
12313
|
{
|
|
11906
12314
|
id: LEFT_SIDEBAR_ID,
|
|
@@ -11913,8 +12321,8 @@ var PanelWorkspaceLayout = (0, import_react86.memo)(function PanelWorkspaceLayou
|
|
|
11913
12321
|
collapsible: true
|
|
11914
12322
|
},
|
|
11915
12323
|
internalLayoutState?.leftSidebarCollapsed ? null : leftPanel
|
|
11916
|
-
), /* @__PURE__ */
|
|
11917
|
-
/* @__PURE__ */
|
|
12324
|
+
), /* @__PURE__ */ import_react87.default.createElement(import_react_resizable_panels.PanelResizeHandle, { className: "cursor-col-resize w-px h-full bg-divider" })),
|
|
12325
|
+
/* @__PURE__ */ import_react87.default.createElement(
|
|
11918
12326
|
import_react_resizable_panels.Panel,
|
|
11919
12327
|
{
|
|
11920
12328
|
id: CONTENT_AREA_ID,
|
|
@@ -11925,7 +12333,7 @@ var PanelWorkspaceLayout = (0, import_react86.memo)(function PanelWorkspaceLayou
|
|
|
11925
12333
|
},
|
|
11926
12334
|
centerPanel
|
|
11927
12335
|
),
|
|
11928
|
-
rightPanel && /* @__PURE__ */
|
|
12336
|
+
rightPanel && /* @__PURE__ */ import_react87.default.createElement(import_react87.default.Fragment, null, /* @__PURE__ */ import_react87.default.createElement(import_react_resizable_panels.PanelResizeHandle, { className: "cursor-col-resize w-px h-full bg-divider" }), /* @__PURE__ */ import_react87.default.createElement(
|
|
11929
12337
|
import_react_resizable_panels.Panel,
|
|
11930
12338
|
{
|
|
11931
12339
|
id: RIGHT_SIDEBAR_ID,
|
|
@@ -11943,7 +12351,7 @@ var PanelWorkspaceLayout = (0, import_react86.memo)(function PanelWorkspaceLayou
|
|
|
11943
12351
|
});
|
|
11944
12352
|
|
|
11945
12353
|
// src/components/workspace/WorkspaceLayout.tsx
|
|
11946
|
-
var WorkspaceLayout = (0,
|
|
12354
|
+
var WorkspaceLayout = (0, import_react88.forwardRef)(function WorkspaceLayout2({
|
|
11947
12355
|
autoSavePrefix,
|
|
11948
12356
|
left,
|
|
11949
12357
|
right,
|
|
@@ -11974,7 +12382,7 @@ var WorkspaceLayout = (0, import_react87.forwardRef)(function WorkspaceLayout2({
|
|
|
11974
12382
|
} = {},
|
|
11975
12383
|
theme
|
|
11976
12384
|
}, forwardedRef) {
|
|
11977
|
-
const containerRef =
|
|
12385
|
+
const containerRef = import_react88.default.useRef(null);
|
|
11978
12386
|
const containerSize = useSize(containerRef);
|
|
11979
12387
|
const windowSize = useWindowSize();
|
|
11980
12388
|
const parentSize = detectSize === "window" ? windowSize : containerSize && containerSize.width > 0 ? containerSize : windowSize;
|
|
@@ -12005,17 +12413,17 @@ var WorkspaceLayout = (0, import_react87.forwardRef)(function WorkspaceLayout2({
|
|
|
12005
12413
|
rightSidebarMinPercentage,
|
|
12006
12414
|
rightSidebarMaxPercentage
|
|
12007
12415
|
);
|
|
12008
|
-
const leftSidebarRef = (0,
|
|
12009
|
-
const rightSidebarRef = (0,
|
|
12010
|
-
const [internalLayoutState, setInternalLayoutState] = (0,
|
|
12011
|
-
const handleChangeLayoutState = (0,
|
|
12416
|
+
const leftSidebarRef = (0, import_react88.useRef)(null);
|
|
12417
|
+
const rightSidebarRef = (0, import_react88.useRef)(null);
|
|
12418
|
+
const [internalLayoutState, setInternalLayoutState] = (0, import_react88.useState)(null);
|
|
12419
|
+
const handleChangeLayoutState = (0, import_react88.useCallback)(
|
|
12012
12420
|
(state) => {
|
|
12013
12421
|
setInternalLayoutState(state);
|
|
12014
12422
|
onChangeLayoutState?.(state);
|
|
12015
12423
|
},
|
|
12016
12424
|
[onChangeLayoutState]
|
|
12017
12425
|
);
|
|
12018
|
-
(0,
|
|
12426
|
+
(0, import_react88.useImperativeHandle)(forwardedRef, () => ({
|
|
12019
12427
|
setLeftExpanded: (expanded) => {
|
|
12020
12428
|
if (expanded) {
|
|
12021
12429
|
leftSidebarRef.current?.expand();
|
|
@@ -12072,7 +12480,7 @@ var WorkspaceLayout = (0, import_react87.forwardRef)(function WorkspaceLayout2({
|
|
|
12072
12480
|
}
|
|
12073
12481
|
});
|
|
12074
12482
|
const centerPanelPercentage = 100 - (left ? leftSidebarPercentage : 0) - (right ? rightSidebarPercentage : 0);
|
|
12075
|
-
const leftPanel = left ? /* @__PURE__ */
|
|
12483
|
+
const leftPanel = left ? /* @__PURE__ */ import_react88.default.createElement(
|
|
12076
12484
|
PanelInner,
|
|
12077
12485
|
{
|
|
12078
12486
|
style: leftStyle,
|
|
@@ -12080,7 +12488,7 @@ var WorkspaceLayout = (0, import_react87.forwardRef)(function WorkspaceLayout2({
|
|
|
12080
12488
|
},
|
|
12081
12489
|
left
|
|
12082
12490
|
) : null;
|
|
12083
|
-
const rightPanel = right ? /* @__PURE__ */
|
|
12491
|
+
const rightPanel = right ? /* @__PURE__ */ import_react88.default.createElement(
|
|
12084
12492
|
PanelInner,
|
|
12085
12493
|
{
|
|
12086
12494
|
style: rightStyle,
|
|
@@ -12088,7 +12496,7 @@ var WorkspaceLayout = (0, import_react87.forwardRef)(function WorkspaceLayout2({
|
|
|
12088
12496
|
},
|
|
12089
12497
|
right
|
|
12090
12498
|
) : null;
|
|
12091
|
-
const centerPanel = /* @__PURE__ */
|
|
12499
|
+
const centerPanel = /* @__PURE__ */ import_react88.default.createElement(PanelInner, { className: "bg-canvas-background" }, children);
|
|
12092
12500
|
const leftSidebarOptions = {
|
|
12093
12501
|
minSize: leftSidebarMinPercentage,
|
|
12094
12502
|
maxSize: leftSidebarMaxPercentage,
|
|
@@ -12103,7 +12511,7 @@ var WorkspaceLayout = (0, import_react87.forwardRef)(function WorkspaceLayout2({
|
|
|
12103
12511
|
};
|
|
12104
12512
|
const LayoutComponent = sideType === "panel" ? PanelWorkspaceLayout : sideType === "drawer" ? DrawerWorkspaceLayout : parentSize.width > sideTypeBreakpoint ? PanelWorkspaceLayout : DrawerWorkspaceLayout;
|
|
12105
12513
|
const readyToRender = detectSize === "window" || containerSize && containerSize.width > 0;
|
|
12106
|
-
return /* @__PURE__ */
|
|
12514
|
+
return /* @__PURE__ */ import_react88.default.createElement(
|
|
12107
12515
|
"div",
|
|
12108
12516
|
{
|
|
12109
12517
|
ref: containerRef,
|
|
@@ -12113,7 +12521,7 @@ var WorkspaceLayout = (0, import_react87.forwardRef)(function WorkspaceLayout2({
|
|
|
12113
12521
|
"data-theme": theme
|
|
12114
12522
|
},
|
|
12115
12523
|
toolbar,
|
|
12116
|
-
/* @__PURE__ */
|
|
12524
|
+
/* @__PURE__ */ import_react88.default.createElement("div", { className: "flex flex-row flex-1 relative" }, readyToRender && /* @__PURE__ */ import_react88.default.createElement(
|
|
12117
12525
|
LayoutComponent,
|
|
12118
12526
|
{
|
|
12119
12527
|
leftPanel,
|
|
@@ -12131,12 +12539,12 @@ var WorkspaceLayout = (0, import_react87.forwardRef)(function WorkspaceLayout2({
|
|
|
12131
12539
|
))
|
|
12132
12540
|
);
|
|
12133
12541
|
});
|
|
12134
|
-
var PanelInner = (0,
|
|
12542
|
+
var PanelInner = (0, import_react88.memo)(function PanelInner2({
|
|
12135
12543
|
children,
|
|
12136
12544
|
style: style2,
|
|
12137
12545
|
className
|
|
12138
12546
|
}) {
|
|
12139
|
-
return /* @__PURE__ */
|
|
12547
|
+
return /* @__PURE__ */ import_react88.default.createElement("div", { style: style2, className: cx("absolute inset-0 flex", className) }, children);
|
|
12140
12548
|
});
|
|
12141
12549
|
|
|
12142
12550
|
// src/hooks/usePlatform.ts
|
|
@@ -12149,9 +12557,9 @@ function usePlatformModKey() {
|
|
|
12149
12557
|
}
|
|
12150
12558
|
|
|
12151
12559
|
// src/hooks/useTheme.ts
|
|
12152
|
-
var
|
|
12560
|
+
var import_react89 = require("react");
|
|
12153
12561
|
function useTheme() {
|
|
12154
|
-
const [theme, setTheme] = (0,
|
|
12562
|
+
const [theme, setTheme] = (0, import_react89.useState)("light");
|
|
12155
12563
|
const checkTheme = () => {
|
|
12156
12564
|
const currentTheme = document.body.getAttribute("data-theme");
|
|
12157
12565
|
switch (currentTheme) {
|
|
@@ -12163,7 +12571,7 @@ function useTheme() {
|
|
|
12163
12571
|
break;
|
|
12164
12572
|
}
|
|
12165
12573
|
};
|
|
12166
|
-
(0,
|
|
12574
|
+
(0, import_react89.useEffect)(() => {
|
|
12167
12575
|
checkTheme();
|
|
12168
12576
|
const observer = new MutationObserver((mutations) => {
|
|
12169
12577
|
mutations.forEach((mutation) => {
|
|
@@ -12268,7 +12676,9 @@ function acceptsDrop({
|
|
|
12268
12676
|
return defaultAcceptsDrop(
|
|
12269
12677
|
sourceIndexPath.at(-1),
|
|
12270
12678
|
targetIndexPath.at(-1),
|
|
12271
|
-
position
|
|
12679
|
+
position,
|
|
12680
|
+
"",
|
|
12681
|
+
""
|
|
12272
12682
|
);
|
|
12273
12683
|
}
|
|
12274
12684
|
return true;
|
|
@@ -12289,11 +12699,11 @@ var SUPPORTED_CANVAS_UPLOAD_TYPES = [
|
|
|
12289
12699
|
|
|
12290
12700
|
// src/components/DimensionInput.tsx
|
|
12291
12701
|
var import_noya_utils12 = require("@noya-app/noya-utils");
|
|
12292
|
-
var
|
|
12702
|
+
var React89 = __toESM(require("react"));
|
|
12293
12703
|
function getNewValue(value, mode, delta) {
|
|
12294
12704
|
return delta === void 0 ? value : mode === "replace" ? delta : value + delta;
|
|
12295
12705
|
}
|
|
12296
|
-
var DimensionInput =
|
|
12706
|
+
var DimensionInput = React89.memo(function DimensionInput2({
|
|
12297
12707
|
id,
|
|
12298
12708
|
value,
|
|
12299
12709
|
onSetValue,
|
|
@@ -12303,15 +12713,15 @@ var DimensionInput = React84.memo(function DimensionInput2({
|
|
|
12303
12713
|
disabled,
|
|
12304
12714
|
trigger = "submit"
|
|
12305
12715
|
}) {
|
|
12306
|
-
const handleNudgeValue =
|
|
12716
|
+
const handleNudgeValue = React89.useCallback(
|
|
12307
12717
|
(value2) => onSetValue(value2, "adjust"),
|
|
12308
12718
|
[onSetValue]
|
|
12309
12719
|
);
|
|
12310
|
-
const handleSetValue =
|
|
12720
|
+
const handleSetValue = React89.useCallback(
|
|
12311
12721
|
(value2) => onSetValue(value2, "replace"),
|
|
12312
12722
|
[onSetValue]
|
|
12313
12723
|
);
|
|
12314
|
-
return /* @__PURE__ */
|
|
12724
|
+
return /* @__PURE__ */ React89.createElement(LabeledField, { label, labelPosition: "inset" }, /* @__PURE__ */ React89.createElement(InputField2.Root, { id, width: size2 }, /* @__PURE__ */ React89.createElement(
|
|
12315
12725
|
InputField2.NumberInput,
|
|
12316
12726
|
{
|
|
12317
12727
|
value: value === void 0 ? value : (0, import_noya_utils12.round)(value, 2),
|
|
@@ -12338,8 +12748,8 @@ __export(InspectorPrimitives_exports, {
|
|
|
12338
12748
|
Title: () => Title4,
|
|
12339
12749
|
VerticalSeparator: () => VerticalSeparator
|
|
12340
12750
|
});
|
|
12341
|
-
var
|
|
12342
|
-
var Section2 = (0,
|
|
12751
|
+
var import_react90 = __toESM(require("react"));
|
|
12752
|
+
var Section2 = (0, import_react90.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ import_react90.default.createElement(
|
|
12343
12753
|
"div",
|
|
12344
12754
|
{
|
|
12345
12755
|
ref,
|
|
@@ -12347,8 +12757,8 @@ var Section2 = (0, import_react89.forwardRef)(({ className, ...props }, ref) =>
|
|
|
12347
12757
|
...props
|
|
12348
12758
|
}
|
|
12349
12759
|
));
|
|
12350
|
-
var SectionHeader3 = (0,
|
|
12351
|
-
var Title4 = (0,
|
|
12760
|
+
var SectionHeader3 = (0, import_react90.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ import_react90.default.createElement("div", { ref, className: cx(`flex items-center `, className), ...props }));
|
|
12761
|
+
var Title4 = (0, import_react90.forwardRef)(({ className, $textStyle, ...props }, ref) => /* @__PURE__ */ import_react90.default.createElement(
|
|
12352
12762
|
"div",
|
|
12353
12763
|
{
|
|
12354
12764
|
ref,
|
|
@@ -12359,7 +12769,7 @@ var Title4 = (0, import_react89.forwardRef)(({ className, $textStyle, ...props }
|
|
|
12359
12769
|
...props
|
|
12360
12770
|
}
|
|
12361
12771
|
));
|
|
12362
|
-
var Row = (0,
|
|
12772
|
+
var Row = (0, import_react90.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ import_react90.default.createElement(
|
|
12363
12773
|
"div",
|
|
12364
12774
|
{
|
|
12365
12775
|
ref,
|
|
@@ -12367,7 +12777,7 @@ var Row = (0, import_react89.forwardRef)(({ className, ...props }, ref) => /* @_
|
|
|
12367
12777
|
...props
|
|
12368
12778
|
}
|
|
12369
12779
|
));
|
|
12370
|
-
var Column = (0,
|
|
12780
|
+
var Column = (0, import_react90.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ import_react90.default.createElement(
|
|
12371
12781
|
"div",
|
|
12372
12782
|
{
|
|
12373
12783
|
ref,
|
|
@@ -12375,7 +12785,7 @@ var Column = (0, import_react89.forwardRef)(({ className, ...props }, ref) => /*
|
|
|
12375
12785
|
...props
|
|
12376
12786
|
}
|
|
12377
12787
|
));
|
|
12378
|
-
var Checkbox3 = (0,
|
|
12788
|
+
var Checkbox3 = (0, import_react90.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ import_react90.default.createElement(
|
|
12379
12789
|
"input",
|
|
12380
12790
|
{
|
|
12381
12791
|
ref,
|
|
@@ -12384,7 +12794,7 @@ var Checkbox3 = (0, import_react89.forwardRef)(({ className, ...props }, ref) =>
|
|
|
12384
12794
|
...props
|
|
12385
12795
|
}
|
|
12386
12796
|
));
|
|
12387
|
-
var Text3 = (0,
|
|
12797
|
+
var Text3 = (0, import_react90.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ import_react90.default.createElement(
|
|
12388
12798
|
"span",
|
|
12389
12799
|
{
|
|
12390
12800
|
ref,
|
|
@@ -12392,14 +12802,14 @@ var Text3 = (0, import_react89.forwardRef)(({ className, ...props }, ref) => /*
|
|
|
12392
12802
|
...props
|
|
12393
12803
|
}
|
|
12394
12804
|
));
|
|
12395
|
-
var VerticalSeparator = () => /* @__PURE__ */
|
|
12396
|
-
var HorizontalSeparator = () => /* @__PURE__ */
|
|
12397
|
-
var RowLabel = (0,
|
|
12805
|
+
var VerticalSeparator = () => /* @__PURE__ */ import_react90.default.createElement(Spacer.Vertical, { size: "inspector-v-separator" });
|
|
12806
|
+
var HorizontalSeparator = () => /* @__PURE__ */ import_react90.default.createElement(Spacer.Horizontal, { size: "inspector-h-separator" });
|
|
12807
|
+
var RowLabel = (0, import_react90.forwardRef)(function RowLabel2({
|
|
12398
12808
|
className,
|
|
12399
12809
|
$textStyle,
|
|
12400
12810
|
...props
|
|
12401
12811
|
}, ref) {
|
|
12402
|
-
return /* @__PURE__ */
|
|
12812
|
+
return /* @__PURE__ */ import_react90.default.createElement(
|
|
12403
12813
|
"label",
|
|
12404
12814
|
{
|
|
12405
12815
|
ref,
|
|
@@ -12411,7 +12821,7 @@ var RowLabel = (0, import_react89.forwardRef)(function RowLabel2({
|
|
|
12411
12821
|
}
|
|
12412
12822
|
);
|
|
12413
12823
|
});
|
|
12414
|
-
var LabeledRow = (0,
|
|
12824
|
+
var LabeledRow = (0, import_react90.memo)(function LabeledRow2({
|
|
12415
12825
|
id,
|
|
12416
12826
|
children,
|
|
12417
12827
|
label,
|
|
@@ -12419,11 +12829,11 @@ var LabeledRow = (0, import_react89.memo)(function LabeledRow2({
|
|
|
12419
12829
|
right,
|
|
12420
12830
|
className
|
|
12421
12831
|
}) {
|
|
12422
|
-
return /* @__PURE__ */
|
|
12832
|
+
return /* @__PURE__ */ import_react90.default.createElement(Row, { id, className }, /* @__PURE__ */ import_react90.default.createElement(Column, null, /* @__PURE__ */ import_react90.default.createElement(RowLabel, { $textStyle: labelTextStyle }, label, right && /* @__PURE__ */ import_react90.default.createElement(Spacer.Horizontal, null), right), /* @__PURE__ */ import_react90.default.createElement(Row, null, children)));
|
|
12423
12833
|
});
|
|
12424
12834
|
|
|
12425
12835
|
// src/components/BaseToolbar.tsx
|
|
12426
|
-
var
|
|
12836
|
+
var import_react91 = __toESM(require("react"));
|
|
12427
12837
|
var toolbarStyle = {
|
|
12428
12838
|
[cssVarNames.colors.inputBackground]: "transparent"
|
|
12429
12839
|
};
|
|
@@ -12434,7 +12844,7 @@ function BaseToolbar({
|
|
|
12434
12844
|
logo,
|
|
12435
12845
|
showDivider = true
|
|
12436
12846
|
}) {
|
|
12437
|
-
return /* @__PURE__ */
|
|
12847
|
+
return /* @__PURE__ */ import_react91.default.createElement("div", { className: "flex flex-col", style: toolbarStyle }, /* @__PURE__ */ import_react91.default.createElement(
|
|
12438
12848
|
"div",
|
|
12439
12849
|
{
|
|
12440
12850
|
className: "flex items-center pr-2.5 bg-sidebar-background flex-none relative @container/toolbar",
|
|
@@ -12442,10 +12852,10 @@ function BaseToolbar({
|
|
|
12442
12852
|
flex: `0 0 ${cssVars.spacing.toolbarHeight}`
|
|
12443
12853
|
}
|
|
12444
12854
|
},
|
|
12445
|
-
logo && /* @__PURE__ */
|
|
12446
|
-
/* @__PURE__ */
|
|
12447
|
-
left && /* @__PURE__ */
|
|
12448
|
-
/* @__PURE__ */
|
|
12855
|
+
logo && /* @__PURE__ */ import_react91.default.createElement(import_react91.default.Fragment, null, logo, /* @__PURE__ */ import_react91.default.createElement(DividerVertical, null)),
|
|
12856
|
+
/* @__PURE__ */ import_react91.default.createElement(Spacer.Horizontal, { size: 10 }),
|
|
12857
|
+
left && /* @__PURE__ */ import_react91.default.createElement(import_react91.default.Fragment, null, /* @__PURE__ */ import_react91.default.createElement("div", { className: "flex gap-toolbar-separator" }, left), /* @__PURE__ */ import_react91.default.createElement(Spacer.Horizontal, { size: 10 })),
|
|
12858
|
+
/* @__PURE__ */ import_react91.default.createElement("div", { className: "flex items-center justify-center text-text-muted pointer-events-none @2xl/toolbar:absolute inset-0" }, /* @__PURE__ */ import_react91.default.createElement(
|
|
12449
12859
|
"div",
|
|
12450
12860
|
{
|
|
12451
12861
|
style: {
|
|
@@ -12457,16 +12867,15 @@ function BaseToolbar({
|
|
|
12457
12867
|
},
|
|
12458
12868
|
children
|
|
12459
12869
|
)),
|
|
12460
|
-
/* @__PURE__ */
|
|
12461
|
-
/* @__PURE__ */
|
|
12462
|
-
/* @__PURE__ */
|
|
12463
|
-
), showDivider && /* @__PURE__ */
|
|
12870
|
+
/* @__PURE__ */ import_react91.default.createElement(Spacer.Horizontal, null),
|
|
12871
|
+
/* @__PURE__ */ import_react91.default.createElement(Spacer.Horizontal, { size: 10 }),
|
|
12872
|
+
/* @__PURE__ */ import_react91.default.createElement("div", { className: "flex gap-toolbar-separator" }, right)
|
|
12873
|
+
), showDivider && /* @__PURE__ */ import_react91.default.createElement(Divider, { variant: "strong" }));
|
|
12464
12874
|
}
|
|
12465
12875
|
|
|
12466
12876
|
// src/components/Toolbar.tsx
|
|
12467
|
-
var import_noya_icons11 = require("@noya-app/noya-icons");
|
|
12468
12877
|
var import_noya_keymap7 = require("@noya-app/noya-keymap");
|
|
12469
|
-
var
|
|
12878
|
+
var import_react92 = __toESM(require("react"));
|
|
12470
12879
|
var iconButtonStyle = {
|
|
12471
12880
|
height: 27,
|
|
12472
12881
|
width: 27,
|
|
@@ -12476,8 +12885,8 @@ var ToolbarMenuDropdown = memoGeneric(function ToolbarMenuDropdown2({
|
|
|
12476
12885
|
item,
|
|
12477
12886
|
onSelectMenuItem
|
|
12478
12887
|
}) {
|
|
12479
|
-
const [open, setOpen] =
|
|
12480
|
-
return /* @__PURE__ */
|
|
12888
|
+
const [open, setOpen] = import_react92.default.useState(false);
|
|
12889
|
+
return /* @__PURE__ */ import_react92.default.createElement(
|
|
12481
12890
|
DropdownMenu,
|
|
12482
12891
|
{
|
|
12483
12892
|
open,
|
|
@@ -12489,55 +12898,76 @@ var ToolbarMenuDropdown = memoGeneric(function ToolbarMenuDropdown2({
|
|
|
12489
12898
|
}
|
|
12490
12899
|
}
|
|
12491
12900
|
},
|
|
12492
|
-
/* @__PURE__ */
|
|
12901
|
+
/* @__PURE__ */ import_react92.default.createElement(
|
|
12902
|
+
Button,
|
|
12903
|
+
{
|
|
12904
|
+
disabled: item.disabled,
|
|
12905
|
+
active: item.checked || open,
|
|
12906
|
+
icon: item.icon,
|
|
12907
|
+
iconRight: "DropdownChevronIcon"
|
|
12908
|
+
},
|
|
12909
|
+
item.title
|
|
12910
|
+
)
|
|
12493
12911
|
);
|
|
12494
12912
|
});
|
|
12495
12913
|
var ToolbarMenuButton = memoGeneric(function ToolbarMenuButton2({
|
|
12496
12914
|
item,
|
|
12497
|
-
onSelectMenuItem
|
|
12915
|
+
onSelectMenuItem,
|
|
12916
|
+
as
|
|
12498
12917
|
}) {
|
|
12499
|
-
const content = /* @__PURE__ */
|
|
12918
|
+
const content = /* @__PURE__ */ import_react92.default.createElement(
|
|
12500
12919
|
Button,
|
|
12501
12920
|
{
|
|
12921
|
+
as,
|
|
12502
12922
|
disabled: item.disabled,
|
|
12503
12923
|
active: item.checked,
|
|
12924
|
+
icon: item.icon,
|
|
12504
12925
|
style: item.icon && !item.title ? iconButtonStyle : void 0,
|
|
12926
|
+
...as === "a" && { href: item.value },
|
|
12505
12927
|
onClick: () => {
|
|
12506
12928
|
if (onSelectMenuItem && item.value) {
|
|
12507
12929
|
onSelectMenuItem(item.value);
|
|
12508
12930
|
}
|
|
12509
12931
|
}
|
|
12510
12932
|
},
|
|
12511
|
-
item.icon && renderIcon(item.icon),
|
|
12512
|
-
item.title && item.icon && /* @__PURE__ */ import_react91.default.createElement(Spacer.Horizontal, { inline: true, size: 6 }),
|
|
12513
12933
|
item.title
|
|
12514
12934
|
);
|
|
12515
|
-
return item.tooltip ? /* @__PURE__ */
|
|
12935
|
+
return item.tooltip ? /* @__PURE__ */ import_react92.default.createElement(Tooltip, { sideOffset: 10, content: item.tooltip }, content) : content;
|
|
12516
12936
|
});
|
|
12517
12937
|
var ToolbarMenuItem = memoGeneric(function ToolbarMenuItem2({
|
|
12518
12938
|
item,
|
|
12519
|
-
onSelectMenuItem
|
|
12939
|
+
onSelectMenuItem,
|
|
12940
|
+
buttonAs
|
|
12520
12941
|
}) {
|
|
12521
12942
|
if (item.type === "sectionHeader") return null;
|
|
12522
12943
|
if (item.type === "separator") {
|
|
12523
|
-
return /* @__PURE__ */
|
|
12944
|
+
return /* @__PURE__ */ import_react92.default.createElement(DividerVertical, { overflow: 4 });
|
|
12524
12945
|
}
|
|
12525
12946
|
if (isSelectableMenuItem(item)) {
|
|
12526
|
-
return /* @__PURE__ */
|
|
12947
|
+
return /* @__PURE__ */ import_react92.default.createElement(
|
|
12948
|
+
ToolbarMenuButton,
|
|
12949
|
+
{
|
|
12950
|
+
item,
|
|
12951
|
+
onSelectMenuItem,
|
|
12952
|
+
as: buttonAs
|
|
12953
|
+
}
|
|
12954
|
+
);
|
|
12527
12955
|
}
|
|
12528
|
-
return /* @__PURE__ */
|
|
12956
|
+
return /* @__PURE__ */ import_react92.default.createElement(ToolbarMenuDropdown, { item, onSelectMenuItem });
|
|
12529
12957
|
});
|
|
12530
12958
|
var ToolbarMenu = memoGeneric(function ToolbarMenu2({
|
|
12531
12959
|
items,
|
|
12532
|
-
onSelectMenuItem
|
|
12960
|
+
onSelectMenuItem,
|
|
12961
|
+
buttonAs
|
|
12533
12962
|
}) {
|
|
12534
|
-
return /* @__PURE__ */
|
|
12535
|
-
return /* @__PURE__ */
|
|
12963
|
+
return /* @__PURE__ */ import_react92.default.createElement(import_react92.default.Fragment, null, items.map((item, i) => {
|
|
12964
|
+
return /* @__PURE__ */ import_react92.default.createElement(
|
|
12536
12965
|
ToolbarMenuItem,
|
|
12537
12966
|
{
|
|
12538
12967
|
key: i,
|
|
12539
12968
|
item,
|
|
12540
|
-
onSelectMenuItem
|
|
12969
|
+
onSelectMenuItem,
|
|
12970
|
+
buttonAs
|
|
12541
12971
|
}
|
|
12542
12972
|
);
|
|
12543
12973
|
}));
|
|
@@ -12550,28 +12980,28 @@ function Toolbar({
|
|
|
12550
12980
|
onSelectMenuItem,
|
|
12551
12981
|
shouldBindKeyboardShortcuts = true
|
|
12552
12982
|
}) {
|
|
12553
|
-
const allMenuItems =
|
|
12983
|
+
const allMenuItems = import_react92.default.useMemo(
|
|
12554
12984
|
() => [...leftMenuItems, ...rightMenuItems],
|
|
12555
12985
|
[leftMenuItems, rightMenuItems]
|
|
12556
12986
|
);
|
|
12557
12987
|
(0, import_noya_keymap7.useKeyboardShortcuts)(
|
|
12558
|
-
|
|
12988
|
+
import_react92.default.useMemo(
|
|
12559
12989
|
() => onSelectMenuItem && shouldBindKeyboardShortcuts ? getKeyboardShortcutsForMenuItems(allMenuItems, onSelectMenuItem) : {},
|
|
12560
12990
|
[allMenuItems, onSelectMenuItem, shouldBindKeyboardShortcuts]
|
|
12561
12991
|
)
|
|
12562
12992
|
);
|
|
12563
|
-
return /* @__PURE__ */
|
|
12993
|
+
return /* @__PURE__ */ import_react92.default.createElement(
|
|
12564
12994
|
BaseToolbar,
|
|
12565
12995
|
{
|
|
12566
12996
|
logo,
|
|
12567
|
-
left: leftMenuItems.length > 0 && /* @__PURE__ */
|
|
12997
|
+
left: leftMenuItems.length > 0 && /* @__PURE__ */ import_react92.default.createElement("div", { className: "flex gap-2" }, /* @__PURE__ */ import_react92.default.createElement(
|
|
12568
12998
|
ToolbarMenu,
|
|
12569
12999
|
{
|
|
12570
13000
|
items: leftMenuItems,
|
|
12571
13001
|
onSelectMenuItem
|
|
12572
13002
|
}
|
|
12573
13003
|
)),
|
|
12574
|
-
right: rightMenuItems.length > 0 && /* @__PURE__ */
|
|
13004
|
+
right: rightMenuItems.length > 0 && /* @__PURE__ */ import_react92.default.createElement("div", { className: "flex gap-2" }, /* @__PURE__ */ import_react92.default.createElement(
|
|
12575
13005
|
ToolbarMenu,
|
|
12576
13006
|
{
|
|
12577
13007
|
items: rightMenuItems,
|
|
@@ -12667,6 +13097,7 @@ function Toolbar({
|
|
|
12667
13097
|
MediaThumbnail,
|
|
12668
13098
|
MenuViewport,
|
|
12669
13099
|
Message,
|
|
13100
|
+
OpenPortalsProvider,
|
|
12670
13101
|
PatternPreviewBackground,
|
|
12671
13102
|
PipelineResultLayout,
|
|
12672
13103
|
PipelineResultLink,
|
|
@@ -12683,9 +13114,11 @@ function Toolbar({
|
|
|
12683
13114
|
SegmentedControl,
|
|
12684
13115
|
SelectMenu,
|
|
12685
13116
|
SelectionToolbarContainer,
|
|
13117
|
+
SharedDragProvider,
|
|
12686
13118
|
Slider,
|
|
12687
13119
|
Small,
|
|
12688
13120
|
Sortable,
|
|
13121
|
+
SortableItemContext,
|
|
12689
13122
|
Spacer,
|
|
12690
13123
|
Switch,
|
|
12691
13124
|
Text,
|
|
@@ -12708,6 +13141,7 @@ function Toolbar({
|
|
|
12708
13141
|
colorFromString,
|
|
12709
13142
|
colorSwatchSizeMap,
|
|
12710
13143
|
createSectionedMenu,
|
|
13144
|
+
createSharedDrag,
|
|
12711
13145
|
cssVarNames,
|
|
12712
13146
|
cssVars,
|
|
12713
13147
|
cx,
|
|
@@ -12720,6 +13154,7 @@ function Toolbar({
|
|
|
12720
13154
|
getFieldSpacing,
|
|
12721
13155
|
getGradientBackground,
|
|
12722
13156
|
getGridSize,
|
|
13157
|
+
getItemFirstCollisionDetection,
|
|
12723
13158
|
getKeyboardShortcutsForMenuItems,
|
|
12724
13159
|
getMenuItemKey,
|
|
12725
13160
|
getNewValue,
|
|
@@ -12759,6 +13194,7 @@ function Toolbar({
|
|
|
12759
13194
|
useGlobalInputBlur,
|
|
12760
13195
|
useGlobalInputBlurListener,
|
|
12761
13196
|
useGlobalInputBlurTrigger,
|
|
13197
|
+
useHasOpenPortals,
|
|
12762
13198
|
useHover,
|
|
12763
13199
|
useImageData,
|
|
12764
13200
|
useIndent,
|
|
@@ -12769,12 +13205,14 @@ function Toolbar({
|
|
|
12769
13205
|
useOpenConfirmationDialog,
|
|
12770
13206
|
useOpenDialog,
|
|
12771
13207
|
useOpenInputDialog,
|
|
13208
|
+
useOpenPortalsControls,
|
|
12772
13209
|
usePlatform,
|
|
12773
13210
|
usePlatformModKey,
|
|
12774
13211
|
usePortalScopeId,
|
|
12775
13212
|
usePreservePanelSize,
|
|
12776
13213
|
useTheme,
|
|
12777
13214
|
validateDropIndicator,
|
|
13215
|
+
withDragProvider,
|
|
12778
13216
|
withSeparatorElements
|
|
12779
13217
|
});
|
|
12780
13218
|
//# sourceMappingURL=index.js.map
|