@noya-app/noya-designsystem 0.1.52 → 0.1.54
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +10 -10
- package/CHANGELOG.md +14 -0
- package/dist/index.css +1 -1
- package/dist/index.d.mts +38 -12
- package/dist/index.d.ts +38 -12
- package/dist/index.js +421 -326
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +900 -814
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/components/Button.tsx +1 -1
- package/src/components/ColorSwatch.tsx +5 -2
- package/src/components/ColorSwatchControl.tsx +4 -6
- package/src/components/ContextMenu.tsx +10 -2
- package/src/components/DraggableMenuButton.tsx +17 -30
- package/src/components/DropdownMenu.tsx +7 -0
- package/src/components/Popover.tsx +7 -0
- package/src/components/SegmentedControl.tsx +13 -42
- package/src/components/SelectMenu.tsx +7 -0
- package/src/components/SelectionToolbar.tsx +51 -45
- package/src/components/Slider.tsx +1 -1
- package/src/components/Toolbar.tsx +124 -76
- package/src/components/Tooltip.tsx +7 -0
- package/src/components/connected-users-menu/ConnectedUsersMenuLayout.tsx +2 -2
- package/src/components/internal/Menu.tsx +2 -2
- package/src/components/internal/MenuViewport.tsx +9 -1
- package/src/components/internal/SelectItem.tsx +24 -3
- package/src/contexts/PortalScopeContext.tsx +48 -0
- package/src/index.tsx +1 -0
package/dist/index.js
CHANGED
|
@@ -117,6 +117,7 @@ __export(src_exports, {
|
|
|
117
117
|
PipelineResultLayout: () => PipelineResultLayout,
|
|
118
118
|
PipelineResultLink: () => PipelineResultLink,
|
|
119
119
|
Popover: () => Popover,
|
|
120
|
+
PortalScopeProvider: () => PortalScopeProvider,
|
|
120
121
|
Progress: () => Progress,
|
|
121
122
|
RIGHT_SIDEBAR_ID: () => RIGHT_SIDEBAR_ID,
|
|
122
123
|
SUPPORTED_CANVAS_UPLOAD_TYPES: () => SUPPORTED_CANVAS_UPLOAD_TYPES,
|
|
@@ -127,7 +128,7 @@ __export(src_exports, {
|
|
|
127
128
|
SectionHeader: () => SectionHeader,
|
|
128
129
|
SegmentedControl: () => SegmentedControl,
|
|
129
130
|
SelectMenu: () => SelectMenu,
|
|
130
|
-
|
|
131
|
+
SelectionToolbarContainer: () => SelectionToolbarContainer,
|
|
131
132
|
Slider: () => Slider,
|
|
132
133
|
Small: () => Small,
|
|
133
134
|
Sortable: () => Sortable2,
|
|
@@ -140,6 +141,9 @@ __export(src_exports, {
|
|
|
140
141
|
ToastProvider: () => ToastProvider,
|
|
141
142
|
Toolbar: () => Toolbar,
|
|
142
143
|
ToolbarMenu: () => ToolbarMenu,
|
|
144
|
+
ToolbarMenuButton: () => ToolbarMenuButton,
|
|
145
|
+
ToolbarMenuDropdown: () => ToolbarMenuDropdown,
|
|
146
|
+
ToolbarMenuItem: () => ToolbarMenuItem,
|
|
143
147
|
Tooltip: () => Tooltip,
|
|
144
148
|
TreeView: () => TreeView,
|
|
145
149
|
UserAvatar: () => UserAvatar,
|
|
@@ -158,6 +162,7 @@ __export(src_exports, {
|
|
|
158
162
|
fuzzyFilter: () => fuzzyFilter,
|
|
159
163
|
fuzzyScore: () => fuzzyScore,
|
|
160
164
|
fuzzyTokenize: () => fuzzyTokenize,
|
|
165
|
+
getClosestPortalScope: () => getClosestPortalScope,
|
|
161
166
|
getFieldSpacing: () => getFieldSpacing,
|
|
162
167
|
getGradientBackground: () => getGradientBackground,
|
|
163
168
|
getGridSize: () => getGridSize,
|
|
@@ -177,6 +182,9 @@ __export(src_exports, {
|
|
|
177
182
|
moveTreeItem: () => moveTreeItem,
|
|
178
183
|
normalizeListTargetIndex: () => normalizeListTargetIndex,
|
|
179
184
|
popoverStyle: () => popoverStyle,
|
|
185
|
+
portalScopeDataSetName: () => portalScopeDataSetName,
|
|
186
|
+
portalScopePropName: () => portalScopePropName,
|
|
187
|
+
portalScopeProps: () => portalScopeProps,
|
|
180
188
|
renderIcon: () => renderIcon,
|
|
181
189
|
rgbaToSketchColor: () => rgbaToSketchColor,
|
|
182
190
|
separator: () => separator,
|
|
@@ -209,6 +217,7 @@ __export(src_exports, {
|
|
|
209
217
|
useOpenInputDialog: () => useOpenInputDialog,
|
|
210
218
|
usePlatform: () => usePlatform,
|
|
211
219
|
usePlatformModKey: () => usePlatformModKey,
|
|
220
|
+
usePortalScopeId: () => usePortalScopeId,
|
|
212
221
|
usePreservePanelSize: () => usePreservePanelSize,
|
|
213
222
|
useTheme: () => useTheme,
|
|
214
223
|
validateDropIndicator: () => validateDropIndicator,
|
|
@@ -631,20 +640,50 @@ var import_noya_keymap3 = require("@noya-app/noya-keymap");
|
|
|
631
640
|
var RadixDropdownMenu = __toESM(require("@radix-ui/react-dropdown-menu"));
|
|
632
641
|
var import_react35 = __toESM(require("react"));
|
|
633
642
|
|
|
643
|
+
// src/contexts/PortalScopeContext.tsx
|
|
644
|
+
var React5 = __toESM(require("react"));
|
|
645
|
+
var PortalScopeContext = React5.createContext(void 0);
|
|
646
|
+
var PortalScopeProvider = React5.memo(function PortalScopeProvider2({
|
|
647
|
+
children,
|
|
648
|
+
portalScopeId
|
|
649
|
+
}) {
|
|
650
|
+
return /* @__PURE__ */ React5.createElement(PortalScopeContext.Provider, { value: portalScopeId }, children);
|
|
651
|
+
});
|
|
652
|
+
function usePortalScopeId() {
|
|
653
|
+
return React5.useContext(PortalScopeContext) ?? "";
|
|
654
|
+
}
|
|
655
|
+
var portalScopeDataSetName = "noyaPortalScope";
|
|
656
|
+
var portalScopePropName = `data-noya-portal-scope`;
|
|
657
|
+
function portalScopeProps(id) {
|
|
658
|
+
return {
|
|
659
|
+
[portalScopePropName]: id
|
|
660
|
+
};
|
|
661
|
+
}
|
|
662
|
+
function getClosestPortalScope(element) {
|
|
663
|
+
if (!(element instanceof HTMLElement)) {
|
|
664
|
+
return;
|
|
665
|
+
}
|
|
666
|
+
const closest = element.closest(`[${portalScopePropName}]`);
|
|
667
|
+
if (!closest || !(closest instanceof HTMLElement)) {
|
|
668
|
+
return;
|
|
669
|
+
}
|
|
670
|
+
return closest.dataset[portalScopeDataSetName];
|
|
671
|
+
}
|
|
672
|
+
|
|
634
673
|
// src/components/internal/Menu.tsx
|
|
635
674
|
var import_noya_keymap2 = require("@noya-app/noya-keymap");
|
|
636
675
|
var import_react32 = __toESM(require("react"));
|
|
637
676
|
|
|
638
677
|
// src/contexts/DesignSystemConfiguration.tsx
|
|
639
678
|
var import_noya_keymap = require("@noya-app/noya-keymap");
|
|
640
|
-
var
|
|
679
|
+
var React21 = __toESM(require("react"));
|
|
641
680
|
|
|
642
681
|
// src/components/Toast.tsx
|
|
643
682
|
var ToastPrimitive = __toESM(require("@radix-ui/react-toast"));
|
|
644
683
|
var import_react21 = __toESM(require("react"));
|
|
645
684
|
|
|
646
685
|
// src/components/IconButton.tsx
|
|
647
|
-
var
|
|
686
|
+
var React10 = __toESM(require("react"));
|
|
648
687
|
|
|
649
688
|
// src/components/Button.tsx
|
|
650
689
|
var import_react20 = __toESM(require("react"));
|
|
@@ -714,7 +753,7 @@ function mergeConflictingClassNames(classNames, options) {
|
|
|
714
753
|
|
|
715
754
|
// src/components/Tooltip.tsx
|
|
716
755
|
var TooltipPrimitive = __toESM(require("@radix-ui/react-tooltip"));
|
|
717
|
-
var
|
|
756
|
+
var React7 = __toESM(require("react"));
|
|
718
757
|
|
|
719
758
|
// src/components/Text.tsx
|
|
720
759
|
var import_react19 = __toESM(require("react"));
|
|
@@ -810,14 +849,16 @@ var Italic = ({ children }) => /* @__PURE__ */ import_react19.default.createElem
|
|
|
810
849
|
);
|
|
811
850
|
|
|
812
851
|
// src/components/Tooltip.tsx
|
|
813
|
-
var Tooltip =
|
|
852
|
+
var Tooltip = React7.memo(function Tooltip2({
|
|
814
853
|
children,
|
|
815
854
|
content,
|
|
816
855
|
sideOffset = 2
|
|
817
856
|
}) {
|
|
818
|
-
|
|
857
|
+
const portalScopeId = usePortalScopeId();
|
|
858
|
+
return /* @__PURE__ */ React7.createElement(TooltipPrimitive.Provider, null, /* @__PURE__ */ React7.createElement(TooltipPrimitive.Root, null, /* @__PURE__ */ React7.createElement(TooltipPrimitive.Trigger, { asChild: true }, children), /* @__PURE__ */ React7.createElement(TooltipPrimitive.Portal, null, /* @__PURE__ */ React7.createElement(
|
|
819
859
|
TooltipPrimitive.Content,
|
|
820
860
|
{
|
|
861
|
+
...portalScopeProps(portalScopeId),
|
|
821
862
|
side: "bottom",
|
|
822
863
|
align: "center",
|
|
823
864
|
sideOffset,
|
|
@@ -866,7 +907,7 @@ var Button = (0, import_react20.forwardRef)(function Button2({
|
|
|
866
907
|
"no-underline leading-[1] relative border-0 outline-none select-none text-left rounded flex items-center justify-center [&>*]:pointer-events-none [-webkit-app-region:no-drag] focus:ring-2 focus:ring-primary focus:shadow-[0_0_0_1px_var(--n-popover-background)_inset] transition-all",
|
|
867
908
|
disabled ? "opacity-25" : "",
|
|
868
909
|
!className?.includes("flex") ? "flex-none" : "",
|
|
869
|
-
active ? "bg-primary text-
|
|
910
|
+
active ? "bg-primary-pastel text-primary hover:bg-primary-pastel-light min-w-[31px]" : variantStyles[variant],
|
|
870
911
|
sizeStyles[variant === "thin" ? "thin" : variant === "floating" && size2 !== "small" ? "floating" : variant === "none" ? "none" : size2]
|
|
871
912
|
);
|
|
872
913
|
const buttonClassName = (0, import_react20.useMemo)(() => {
|
|
@@ -904,27 +945,27 @@ var Button_default = Button;
|
|
|
904
945
|
|
|
905
946
|
// src/components/Icons.tsx
|
|
906
947
|
var Icons = __toESM(require("@noya-app/noya-icons"));
|
|
907
|
-
var
|
|
948
|
+
var React9 = __toESM(require("react"));
|
|
908
949
|
function renderIcon(iconName) {
|
|
909
950
|
if (typeof iconName === "string") {
|
|
910
951
|
const Icon = Icons[iconName];
|
|
911
|
-
return /* @__PURE__ */
|
|
952
|
+
return /* @__PURE__ */ React9.createElement(Icon, null);
|
|
912
953
|
}
|
|
913
954
|
return iconName;
|
|
914
955
|
}
|
|
915
956
|
|
|
916
957
|
// src/components/IconButton.tsx
|
|
917
|
-
var IconButton =
|
|
918
|
-
|
|
958
|
+
var IconButton = React10.memo(
|
|
959
|
+
React10.forwardRef(function IconButton2({ selected, iconName, color, size: size2, contentStyle, ...props }, forwardedRef) {
|
|
919
960
|
const Icon = Icons[iconName];
|
|
920
|
-
const style2 =
|
|
961
|
+
const style2 = React10.useMemo(() => {
|
|
921
962
|
return {
|
|
922
963
|
padding: "0 2px",
|
|
923
964
|
...size2 && { minHeight: size2 },
|
|
924
965
|
...contentStyle
|
|
925
966
|
};
|
|
926
967
|
}, [contentStyle, size2]);
|
|
927
|
-
return /* @__PURE__ */
|
|
968
|
+
return /* @__PURE__ */ React10.createElement(Button, { ref: forwardedRef, ...props, variant: "none", contentStyle: style2 }, /* @__PURE__ */ React10.createElement(
|
|
928
969
|
Icon,
|
|
929
970
|
{
|
|
930
971
|
color: color ?? (selected ? cssVars.colors.iconSelected : cssVars.colors.icon),
|
|
@@ -975,10 +1016,10 @@ var DialogPrimitive = __toESM(require("@radix-ui/react-dialog"));
|
|
|
975
1016
|
var import_react22 = __toESM(require("react"));
|
|
976
1017
|
|
|
977
1018
|
// src/components/Spacer.tsx
|
|
978
|
-
var
|
|
979
|
-
var SpacerVertical =
|
|
1019
|
+
var React12 = __toESM(require("react"));
|
|
1020
|
+
var SpacerVertical = React12.forwardRef(
|
|
980
1021
|
({ size: size2, inline, ...props }, ref) => {
|
|
981
|
-
return /* @__PURE__ */
|
|
1022
|
+
return /* @__PURE__ */ React12.createElement(
|
|
982
1023
|
"span",
|
|
983
1024
|
{
|
|
984
1025
|
className: `${inline ? "inline-block" : "block"} ${size2 === void 0 ? "flex flex-1" : ""}`,
|
|
@@ -991,9 +1032,9 @@ var SpacerVertical = React11.forwardRef(
|
|
|
991
1032
|
);
|
|
992
1033
|
}
|
|
993
1034
|
);
|
|
994
|
-
var SpacerHorizontal =
|
|
1035
|
+
var SpacerHorizontal = React12.forwardRef(
|
|
995
1036
|
({ size: size2, inline, ...props }, ref) => {
|
|
996
|
-
return /* @__PURE__ */
|
|
1037
|
+
return /* @__PURE__ */ React12.createElement(
|
|
997
1038
|
"span",
|
|
998
1039
|
{
|
|
999
1040
|
className: `${inline ? "inline-block" : "block"} ${size2 === void 0 ? "flex flex-1" : ""}`,
|
|
@@ -1488,9 +1529,11 @@ function Popover({
|
|
|
1488
1529
|
onClickClose,
|
|
1489
1530
|
className
|
|
1490
1531
|
}) {
|
|
1532
|
+
const portalScopeId = usePortalScopeId();
|
|
1491
1533
|
return /* @__PURE__ */ import_react27.default.createElement(PopoverPrimitive.Root, { open, onOpenChange }, /* @__PURE__ */ import_react27.default.createElement(PopoverPrimitive.Trigger, { asChild: true }, trigger), /* @__PURE__ */ import_react27.default.createElement(PopoverPrimitive.Portal, null, /* @__PURE__ */ import_react27.default.createElement(
|
|
1492
1534
|
PopoverPrimitive.Content,
|
|
1493
1535
|
{
|
|
1536
|
+
...portalScopeProps(portalScopeId),
|
|
1494
1537
|
className: cx(
|
|
1495
1538
|
popoverStyle.base,
|
|
1496
1539
|
variant === "large" && popoverStyle.large,
|
|
@@ -2235,30 +2278,30 @@ var useCurrentFloatingWindowInternal = () => {
|
|
|
2235
2278
|
};
|
|
2236
2279
|
|
|
2237
2280
|
// src/contexts/DesignSystemConfiguration.tsx
|
|
2238
|
-
var DesignSystemConfigurationContext =
|
|
2281
|
+
var DesignSystemConfigurationContext = React21.createContext({
|
|
2239
2282
|
platform: "key"
|
|
2240
2283
|
});
|
|
2241
|
-
var DesignSystemConfigurationProvider =
|
|
2284
|
+
var DesignSystemConfigurationProvider = React21.memo(
|
|
2242
2285
|
function DesignSystemConfigurationProvider2({
|
|
2243
2286
|
children,
|
|
2244
2287
|
platform
|
|
2245
2288
|
}) {
|
|
2246
|
-
const [internalPlatform, setInternalPlatform] =
|
|
2247
|
-
|
|
2289
|
+
const [internalPlatform, setInternalPlatform] = React21.useState(platform ?? "key");
|
|
2290
|
+
React21.useEffect(() => {
|
|
2248
2291
|
if (platform !== void 0) return;
|
|
2249
2292
|
if (typeof navigator !== "undefined") {
|
|
2250
2293
|
setInternalPlatform((0, import_noya_keymap.getCurrentPlatform)(navigator));
|
|
2251
2294
|
}
|
|
2252
2295
|
}, [platform]);
|
|
2253
|
-
const contextValue =
|
|
2296
|
+
const contextValue = React21.useMemo(
|
|
2254
2297
|
() => ({ platform: platform ?? internalPlatform }),
|
|
2255
2298
|
[platform, internalPlatform]
|
|
2256
2299
|
);
|
|
2257
|
-
return /* @__PURE__ */
|
|
2300
|
+
return /* @__PURE__ */ React21.createElement(DesignSystemConfigurationContext.Provider, { value: contextValue }, /* @__PURE__ */ React21.createElement(DialogProvider, null, /* @__PURE__ */ React21.createElement(ToastProvider, null, /* @__PURE__ */ React21.createElement(FloatingWindowProvider, null, children))));
|
|
2258
2301
|
}
|
|
2259
2302
|
);
|
|
2260
2303
|
function useDesignSystemConfiguration() {
|
|
2261
|
-
return
|
|
2304
|
+
return React21.useContext(DesignSystemConfigurationContext);
|
|
2262
2305
|
}
|
|
2263
2306
|
|
|
2264
2307
|
// src/utils/withSeparatorElements.ts
|
|
@@ -2313,7 +2356,7 @@ var getMenuItemKey = (item, index) => {
|
|
|
2313
2356
|
}
|
|
2314
2357
|
};
|
|
2315
2358
|
var CHECKBOX_WIDTH = 15;
|
|
2316
|
-
var CHECKBOX_RIGHT_INSET =
|
|
2359
|
+
var CHECKBOX_RIGHT_INSET = 6;
|
|
2317
2360
|
var CHECKBOX_INDENT_WIDTH = 6;
|
|
2318
2361
|
var styles = {
|
|
2319
2362
|
separatorStyle: "h-px bg-divider mx-3 my-1",
|
|
@@ -2412,11 +2455,10 @@ var SectionHeader = (0, import_react32.memo)(function SectionHeader2({
|
|
|
2412
2455
|
});
|
|
2413
2456
|
|
|
2414
2457
|
// src/components/internal/MenuViewport.tsx
|
|
2415
|
-
var
|
|
2458
|
+
var import_noya_icons2 = require("@noya-app/noya-icons");
|
|
2416
2459
|
var import_react34 = __toESM(require("react"));
|
|
2417
2460
|
|
|
2418
2461
|
// src/components/internal/SelectItem.tsx
|
|
2419
|
-
var import_noya_icons2 = require("@noya-app/noya-icons");
|
|
2420
2462
|
var import_react33 = __toESM(require("react"));
|
|
2421
2463
|
var SelectItem = import_react33.default.forwardRef(
|
|
2422
2464
|
({
|
|
@@ -2456,7 +2498,7 @@ var SelectItem = import_react33.default.forwardRef(
|
|
|
2456
2498
|
)
|
|
2457
2499
|
},
|
|
2458
2500
|
/* @__PURE__ */ import_react33.default.createElement(Spacer.Horizontal, { size: CHECKBOX_INDENT_WIDTH }),
|
|
2459
|
-
Components4.ItemIndicator && /* @__PURE__ */ import_react33.default.createElement(Components4.ItemIndicator, { ...styles.itemIndicator }, /* @__PURE__ */ import_react33.default.createElement(
|
|
2501
|
+
Components4.ItemIndicator && /* @__PURE__ */ import_react33.default.createElement(Components4.ItemIndicator, { ...styles.itemIndicator }, /* @__PURE__ */ import_react33.default.createElement(Checkmark, null)),
|
|
2460
2502
|
icon && /* @__PURE__ */ import_react33.default.createElement(import_react33.default.Fragment, null, renderIcon(icon), /* @__PURE__ */ import_react33.default.createElement(Spacer.Horizontal, { size: 8 })),
|
|
2461
2503
|
children,
|
|
2462
2504
|
shortcut && /* @__PURE__ */ import_react33.default.createElement(import_react33.default.Fragment, null, /* @__PURE__ */ import_react33.default.createElement(Spacer.Horizontal, null), /* @__PURE__ */ import_react33.default.createElement(Spacer.Horizontal, { size: 24 }), /* @__PURE__ */ import_react33.default.createElement(KeyboardShortcut, { shortcut }))
|
|
@@ -2477,10 +2519,34 @@ var SelectItem = import_react33.default.forwardRef(
|
|
|
2477
2519
|
onSelect: handleSelectItem,
|
|
2478
2520
|
...props
|
|
2479
2521
|
},
|
|
2480
|
-
/* @__PURE__ */ import_react33.default.createElement("div", { className: "flex flex-1 items-center" }, indented && /* @__PURE__ */ import_react33.default.createElement(Spacer.Horizontal, { size: CHECKBOX_INDENT_WIDTH }), checked ? /* @__PURE__ */ import_react33.default.createElement("div", { ...styles.itemIndicator }, /* @__PURE__ */ import_react33.default.createElement(
|
|
2522
|
+
/* @__PURE__ */ import_react33.default.createElement("div", { className: "flex flex-1 items-center" }, indented && /* @__PURE__ */ import_react33.default.createElement(Spacer.Horizontal, { size: CHECKBOX_INDENT_WIDTH }), checked ? /* @__PURE__ */ import_react33.default.createElement("div", { ...styles.itemIndicator }, /* @__PURE__ */ import_react33.default.createElement(Checkmark, null)) : indented ? /* @__PURE__ */ import_react33.default.createElement(Spacer.Horizontal, { size: CHECKBOX_WIDTH - CHECKBOX_RIGHT_INSET }) : null, icon && /* @__PURE__ */ import_react33.default.createElement(import_react33.default.Fragment, null, renderIcon(icon), /* @__PURE__ */ import_react33.default.createElement(Spacer.Horizontal, { size: 8 })), /* @__PURE__ */ import_react33.default.createElement(Components4.ItemText, null, children), shortcut && /* @__PURE__ */ import_react33.default.createElement(import_react33.default.Fragment, null, /* @__PURE__ */ import_react33.default.createElement(Spacer.Horizontal, null), /* @__PURE__ */ import_react33.default.createElement(Spacer.Horizontal, { size: 24 }), /* @__PURE__ */ import_react33.default.createElement(KeyboardShortcut, { shortcut })))
|
|
2481
2523
|
));
|
|
2482
2524
|
}
|
|
2483
2525
|
);
|
|
2526
|
+
function Checkmark() {
|
|
2527
|
+
return /* @__PURE__ */ import_react33.default.createElement(
|
|
2528
|
+
"svg",
|
|
2529
|
+
{
|
|
2530
|
+
viewBox: "0 0 15 15",
|
|
2531
|
+
fill: "none",
|
|
2532
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2533
|
+
"aria-hidden": "true",
|
|
2534
|
+
width: 15,
|
|
2535
|
+
height: 15
|
|
2536
|
+
},
|
|
2537
|
+
/* @__PURE__ */ import_react33.default.createElement(
|
|
2538
|
+
"path",
|
|
2539
|
+
{
|
|
2540
|
+
className: "scale-90 origin-center",
|
|
2541
|
+
d: "M3 8L6 11L12 5",
|
|
2542
|
+
strokeWidth: "1.1",
|
|
2543
|
+
strokeLinecap: "round",
|
|
2544
|
+
strokeLinejoin: "round",
|
|
2545
|
+
stroke: "currentColor"
|
|
2546
|
+
}
|
|
2547
|
+
)
|
|
2548
|
+
);
|
|
2549
|
+
}
|
|
2484
2550
|
|
|
2485
2551
|
// src/components/internal/MenuViewport.tsx
|
|
2486
2552
|
var MenuViewport = ({
|
|
@@ -2488,6 +2554,7 @@ var MenuViewport = ({
|
|
|
2488
2554
|
Components: Components4,
|
|
2489
2555
|
onSelect
|
|
2490
2556
|
}) => {
|
|
2557
|
+
const portalScopeId = usePortalScopeId();
|
|
2491
2558
|
const hasCheckedItem = items.some(
|
|
2492
2559
|
(item) => item.type !== "separator" && item.type !== "sectionHeader" && item.checked
|
|
2493
2560
|
);
|
|
@@ -2524,7 +2591,8 @@ var MenuViewport = ({
|
|
|
2524
2591
|
onClick: (e) => {
|
|
2525
2592
|
e.stopPropagation();
|
|
2526
2593
|
e.preventDefault();
|
|
2527
|
-
}
|
|
2594
|
+
},
|
|
2595
|
+
disabled: item.disabled
|
|
2528
2596
|
},
|
|
2529
2597
|
/* @__PURE__ */ import_react34.default.createElement(
|
|
2530
2598
|
SelectItem,
|
|
@@ -2538,11 +2606,12 @@ var MenuViewport = ({
|
|
|
2538
2606
|
disabled: item.disabled
|
|
2539
2607
|
},
|
|
2540
2608
|
/* @__PURE__ */ import_react34.default.createElement("div", { className: "flex items-center flex-1" }, item.title),
|
|
2541
|
-
/* @__PURE__ */ import_react34.default.createElement(
|
|
2609
|
+
/* @__PURE__ */ import_react34.default.createElement(import_noya_icons2.ChevronRightIcon, { className: "-mr-1" })
|
|
2542
2610
|
)
|
|
2543
2611
|
), /* @__PURE__ */ import_react34.default.createElement(Components4.Portal, null, /* @__PURE__ */ import_react34.default.createElement(
|
|
2544
2612
|
Components4.SubContent,
|
|
2545
2613
|
{
|
|
2614
|
+
...portalScopeProps(portalScopeId),
|
|
2546
2615
|
alignOffset: -5,
|
|
2547
2616
|
className: styles.contentStyle
|
|
2548
2617
|
},
|
|
@@ -2606,6 +2675,7 @@ var DropdownMenuRoot = forwardRefGeneric(function DropdownMenuRoot2(props, forwa
|
|
|
2606
2675
|
emptyState,
|
|
2607
2676
|
contentStyle
|
|
2608
2677
|
} = props;
|
|
2678
|
+
const portalScopeId = usePortalScopeId();
|
|
2609
2679
|
const keymap = (0, import_react35.useMemo)(
|
|
2610
2680
|
() => shouldBindKeyboardShortcuts === false ? {} : getKeyboardShortcutsForMenuItems(items, onSelect),
|
|
2611
2681
|
[items, onSelect, shouldBindKeyboardShortcuts]
|
|
@@ -2629,6 +2699,7 @@ var DropdownMenuRoot = forwardRefGeneric(function DropdownMenuRoot2(props, forwa
|
|
|
2629
2699
|
), /* @__PURE__ */ import_react35.default.createElement(RadixDropdownMenu.Portal, null, /* @__PURE__ */ import_react35.default.createElement(
|
|
2630
2700
|
RadixDropdownMenu.Content,
|
|
2631
2701
|
{
|
|
2702
|
+
...portalScopeProps(portalScopeId),
|
|
2632
2703
|
className: styles.contentStyle,
|
|
2633
2704
|
side,
|
|
2634
2705
|
sideOffset,
|
|
@@ -2691,16 +2762,16 @@ var ActionMenu = memoGeneric(function ActionMenu2({
|
|
|
2691
2762
|
});
|
|
2692
2763
|
|
|
2693
2764
|
// src/components/ActivityIndicator.tsx
|
|
2694
|
-
var
|
|
2695
|
-
var ActivityIndicator =
|
|
2765
|
+
var React27 = __toESM(require("react"));
|
|
2766
|
+
var ActivityIndicator = React27.memo(function ActivityIndicator2({
|
|
2696
2767
|
size: size2 = 16,
|
|
2697
2768
|
opacity = 1,
|
|
2698
2769
|
color = "black",
|
|
2699
2770
|
trackColor = "rgba(0, 0, 0, 0.1)",
|
|
2700
2771
|
className
|
|
2701
2772
|
}) {
|
|
2702
|
-
const opacityStyle =
|
|
2703
|
-
const dynamicStyles =
|
|
2773
|
+
const opacityStyle = React27.useMemo(() => ({ opacity }), [opacity]);
|
|
2774
|
+
const dynamicStyles = React27.useMemo(
|
|
2704
2775
|
() => ({
|
|
2705
2776
|
border: `2px solid ${trackColor}`,
|
|
2706
2777
|
borderTopColor: color,
|
|
@@ -2709,13 +2780,13 @@ var ActivityIndicator = React26.memo(function ActivityIndicator2({
|
|
|
2709
2780
|
}),
|
|
2710
2781
|
[size2, color, trackColor]
|
|
2711
2782
|
);
|
|
2712
|
-
return /* @__PURE__ */
|
|
2783
|
+
return /* @__PURE__ */ React27.createElement(
|
|
2713
2784
|
"div",
|
|
2714
2785
|
{
|
|
2715
2786
|
className: cx("flex justify-center items-center", className),
|
|
2716
2787
|
style: opacityStyle
|
|
2717
2788
|
},
|
|
2718
|
-
/* @__PURE__ */
|
|
2789
|
+
/* @__PURE__ */ React27.createElement("div", { style: dynamicStyles, className: "animate-spin rounded-[50%]" })
|
|
2719
2790
|
);
|
|
2720
2791
|
});
|
|
2721
2792
|
|
|
@@ -3361,16 +3432,16 @@ var BreadcrumbSlash = () => {
|
|
|
3361
3432
|
};
|
|
3362
3433
|
|
|
3363
3434
|
// src/components/Checkbox.tsx
|
|
3364
|
-
var
|
|
3435
|
+
var React35 = __toESM(require("react"));
|
|
3365
3436
|
var colorSchemeStyles = {
|
|
3366
3437
|
normal: "text-text-subtle",
|
|
3367
3438
|
primary: "text-primary",
|
|
3368
3439
|
secondary: "text-secondary"
|
|
3369
3440
|
};
|
|
3370
|
-
var Checkbox =
|
|
3371
|
-
|
|
3441
|
+
var Checkbox = React35.memo(
|
|
3442
|
+
React35.forwardRef(function Checkbox2({ className, style: style2, colorScheme = "secondary", ...props }, ref) {
|
|
3372
3443
|
const { fieldId: id } = useLabel({ fieldId: props.id });
|
|
3373
|
-
return /* @__PURE__ */
|
|
3444
|
+
return /* @__PURE__ */ React35.createElement(
|
|
3374
3445
|
"div",
|
|
3375
3446
|
{
|
|
3376
3447
|
className: cx(
|
|
@@ -3380,7 +3451,7 @@ var Checkbox = React34.memo(
|
|
|
3380
3451
|
),
|
|
3381
3452
|
style: style2
|
|
3382
3453
|
},
|
|
3383
|
-
/* @__PURE__ */
|
|
3454
|
+
/* @__PURE__ */ React35.createElement(
|
|
3384
3455
|
"input",
|
|
3385
3456
|
{
|
|
3386
3457
|
ref,
|
|
@@ -3409,7 +3480,7 @@ var Checkbox = React34.memo(
|
|
|
3409
3480
|
id
|
|
3410
3481
|
}
|
|
3411
3482
|
),
|
|
3412
|
-
/* @__PURE__ */
|
|
3483
|
+
/* @__PURE__ */ React35.createElement(
|
|
3413
3484
|
"svg",
|
|
3414
3485
|
{
|
|
3415
3486
|
className: `
|
|
@@ -3429,7 +3500,7 @@ var Checkbox = React34.memo(
|
|
|
3429
3500
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3430
3501
|
"aria-hidden": "true"
|
|
3431
3502
|
},
|
|
3432
|
-
/* @__PURE__ */
|
|
3503
|
+
/* @__PURE__ */ React35.createElement(
|
|
3433
3504
|
"path",
|
|
3434
3505
|
{
|
|
3435
3506
|
d: "M3 6L4.5 7.5L8 4",
|
|
@@ -3444,11 +3515,11 @@ var Checkbox = React34.memo(
|
|
|
3444
3515
|
);
|
|
3445
3516
|
|
|
3446
3517
|
// src/components/Chip.tsx
|
|
3447
|
-
var
|
|
3518
|
+
var import_noya_icons3 = require("@noya-app/noya-icons");
|
|
3448
3519
|
var import_react45 = __toESM(require("react"));
|
|
3449
3520
|
|
|
3450
3521
|
// src/hooks/useHover.ts
|
|
3451
|
-
var
|
|
3522
|
+
var React36 = __toESM(require("react"));
|
|
3452
3523
|
var globalIgnoreEmulatedMouseEvents = false;
|
|
3453
3524
|
var hoverCount = 0;
|
|
3454
3525
|
function setGlobalIgnoreEmulatedMouseEvents() {
|
|
@@ -3478,13 +3549,13 @@ function setupGlobalTouchEvents() {
|
|
|
3478
3549
|
}
|
|
3479
3550
|
function useHover(props = {}) {
|
|
3480
3551
|
const { onHoverStart, onHoverChange, onHoverEnd, isDisabled } = props;
|
|
3481
|
-
const [isHovered, setHovered] =
|
|
3482
|
-
const state =
|
|
3552
|
+
const [isHovered, setHovered] = React36.useState(false);
|
|
3553
|
+
const state = React36.useRef({
|
|
3483
3554
|
isHovered: false,
|
|
3484
3555
|
ignoreEmulatedMouseEvents: false
|
|
3485
3556
|
}).current;
|
|
3486
|
-
|
|
3487
|
-
const hoverProps =
|
|
3557
|
+
React36.useEffect(setupGlobalTouchEvents, []);
|
|
3558
|
+
const hoverProps = React36.useMemo(
|
|
3488
3559
|
function getHoverProps() {
|
|
3489
3560
|
function triggerHoverStart(event, pointerType) {
|
|
3490
3561
|
if (isDisabled || pointerType === "touch" || state.isHovered) {
|
|
@@ -3641,7 +3712,7 @@ var Chip = (0, import_react45.memo)(
|
|
|
3641
3712
|
...rest
|
|
3642
3713
|
},
|
|
3643
3714
|
addable && /* @__PURE__ */ import_react45.default.createElement(
|
|
3644
|
-
|
|
3715
|
+
import_noya_icons3.PlusIcon,
|
|
3645
3716
|
{
|
|
3646
3717
|
className: cx(ICON_BASE_STYLES, ICON_SIZE_STYLES[size2].add),
|
|
3647
3718
|
onClick: onAdd && ((event) => {
|
|
@@ -3653,7 +3724,7 @@ var Chip = (0, import_react45.memo)(
|
|
|
3653
3724
|
),
|
|
3654
3725
|
children,
|
|
3655
3726
|
deletable && /* @__PURE__ */ import_react45.default.createElement(
|
|
3656
|
-
|
|
3727
|
+
import_noya_icons3.Cross1Icon,
|
|
3657
3728
|
{
|
|
3658
3729
|
className: cx(ICON_BASE_STYLES, ICON_SIZE_STYLES[size2].delete),
|
|
3659
3730
|
...hoverDeleteProps,
|
|
@@ -3851,6 +3922,7 @@ function ContextMenuRoot({
|
|
|
3851
3922
|
() => shouldBindKeyboardShortcuts === false ? {} : getKeyboardShortcutsForMenuItems(items, onSelect),
|
|
3852
3923
|
[items, onSelect, shouldBindKeyboardShortcuts]
|
|
3853
3924
|
);
|
|
3925
|
+
const portalScopeId = usePortalScopeId();
|
|
3854
3926
|
(0, import_noya_keymap4.useKeyboardShortcuts)(keymap);
|
|
3855
3927
|
const onPointerDown = (0, import_react47.useCallback)((event) => {
|
|
3856
3928
|
event.preventDefault();
|
|
@@ -3862,39 +3934,46 @@ function ContextMenuRoot({
|
|
|
3862
3934
|
},
|
|
3863
3935
|
[onSelect]
|
|
3864
3936
|
);
|
|
3865
|
-
return /* @__PURE__ */ import_react47.default.createElement(RadixContextMenu.Root, { onOpenChange }, /* @__PURE__ */ import_react47.default.createElement(RadixContextMenu.Trigger, { asChild: true, onPointerDown }, children), /* @__PURE__ */ import_react47.default.createElement(RadixContextMenu.Portal, null, /* @__PURE__ */ import_react47.default.createElement(
|
|
3866
|
-
|
|
3937
|
+
return /* @__PURE__ */ import_react47.default.createElement(RadixContextMenu.Root, { onOpenChange }, /* @__PURE__ */ import_react47.default.createElement(RadixContextMenu.Trigger, { asChild: true, onPointerDown }, children), /* @__PURE__ */ import_react47.default.createElement(RadixContextMenu.Portal, null, /* @__PURE__ */ import_react47.default.createElement(
|
|
3938
|
+
RadixContextMenu.Content,
|
|
3867
3939
|
{
|
|
3868
|
-
|
|
3869
|
-
|
|
3870
|
-
|
|
3871
|
-
|
|
3872
|
-
|
|
3940
|
+
...portalScopeProps(portalScopeId),
|
|
3941
|
+
className: styles.contentStyle
|
|
3942
|
+
},
|
|
3943
|
+
/* @__PURE__ */ import_react47.default.createElement(
|
|
3944
|
+
MenuViewport,
|
|
3945
|
+
{
|
|
3946
|
+
items,
|
|
3947
|
+
Components: Components2,
|
|
3948
|
+
onSelect: handleSelectItem
|
|
3949
|
+
}
|
|
3950
|
+
)
|
|
3951
|
+
)));
|
|
3873
3952
|
}
|
|
3874
3953
|
var ContextMenu = memoGeneric(ContextMenuRoot);
|
|
3875
3954
|
|
|
3876
3955
|
// src/components/ScrollArea.tsx
|
|
3877
3956
|
var RadixScrollArea = __toESM(require("@radix-ui/react-scroll-area"));
|
|
3878
|
-
var
|
|
3879
|
-
var ScrollArea =
|
|
3880
|
-
const [scrollElementRef, setScrollElementRef] =
|
|
3881
|
-
return /* @__PURE__ */
|
|
3957
|
+
var React40 = __toESM(require("react"));
|
|
3958
|
+
var ScrollArea = React40.memo(function ScrollArea2({ children }) {
|
|
3959
|
+
const [scrollElementRef, setScrollElementRef] = React40.useState(null);
|
|
3960
|
+
return /* @__PURE__ */ React40.createElement("div", { className: "flex-1 min-h-0" }, /* @__PURE__ */ React40.createElement(RadixScrollArea.Root, { style: { width: "100%", height: "100%" } }, /* @__PURE__ */ React40.createElement(
|
|
3882
3961
|
RadixScrollArea.Viewport,
|
|
3883
3962
|
{
|
|
3884
3963
|
className: "w-full h-full [&>div]:block",
|
|
3885
|
-
ref:
|
|
3964
|
+
ref: React40.useCallback(
|
|
3886
3965
|
(ref) => setScrollElementRef(ref),
|
|
3887
3966
|
[]
|
|
3888
3967
|
)
|
|
3889
3968
|
},
|
|
3890
3969
|
typeof children === "function" ? scrollElementRef ? children(scrollElementRef) : null : children
|
|
3891
|
-
), /* @__PURE__ */
|
|
3970
|
+
), /* @__PURE__ */ React40.createElement(
|
|
3892
3971
|
RadixScrollArea.Scrollbar,
|
|
3893
3972
|
{
|
|
3894
3973
|
orientation: "vertical",
|
|
3895
3974
|
className: "scroll-component flex p-[3px] data-[orientation=vertical]:w-[10px]"
|
|
3896
3975
|
},
|
|
3897
|
-
/* @__PURE__ */
|
|
3976
|
+
/* @__PURE__ */ React40.createElement(RadixScrollArea.Thumb, { className: "scroll-component flex-1 rounded-[10px] bg-scrollbar" })
|
|
3898
3977
|
)));
|
|
3899
3978
|
});
|
|
3900
3979
|
|
|
@@ -4423,7 +4502,7 @@ function mergeEventHandlers(...handlerMaps) {
|
|
|
4423
4502
|
// src/components/Sortable.tsx
|
|
4424
4503
|
var import_core = require("@dnd-kit/core");
|
|
4425
4504
|
var import_sortable = require("@dnd-kit/sortable");
|
|
4426
|
-
var
|
|
4505
|
+
var React43 = __toESM(require("react"));
|
|
4427
4506
|
var import_react50 = require("react");
|
|
4428
4507
|
var import_react_dom2 = require("react-dom");
|
|
4429
4508
|
var normalizeListTargetIndex = (index, position) => {
|
|
@@ -4437,7 +4516,7 @@ var defaultAcceptsDrop = (sourceIndex, targetIndex, position) => {
|
|
|
4437
4516
|
}
|
|
4438
4517
|
return true;
|
|
4439
4518
|
};
|
|
4440
|
-
var SortableItemContext =
|
|
4519
|
+
var SortableItemContext = React43.createContext({
|
|
4441
4520
|
keys: [],
|
|
4442
4521
|
acceptsDrop: defaultAcceptsDrop,
|
|
4443
4522
|
axis: "y",
|
|
@@ -4492,7 +4571,7 @@ function SortableItem({
|
|
|
4492
4571
|
setActivatorEvent,
|
|
4493
4572
|
axis,
|
|
4494
4573
|
getDropTargetParentIndex
|
|
4495
|
-
} =
|
|
4574
|
+
} = React43.useContext(SortableItemContext);
|
|
4496
4575
|
const sortable = (0, import_sortable.useSortable)({ id, disabled });
|
|
4497
4576
|
const { activatorEvent } = (0, import_core.useDndContext)();
|
|
4498
4577
|
const {
|
|
@@ -4513,7 +4592,7 @@ function SortableItem({
|
|
|
4513
4592
|
const eventY = activatorEvent?.clientY ?? 0;
|
|
4514
4593
|
const offsetLeft = eventX + position.x;
|
|
4515
4594
|
const offsetTop = eventY + position.y;
|
|
4516
|
-
const ref =
|
|
4595
|
+
const ref = React43.useCallback((node) => setNodeRef(node), [setNodeRef]);
|
|
4517
4596
|
const parentIndex = overIndex === -1 ? void 0 : getDropTargetParentIndex?.(overIndex);
|
|
4518
4597
|
const isValidParent = parentIndex === void 0 || parentIndex === -1 ? false : acceptsDrop2(activeIndex, parentIndex, "inside");
|
|
4519
4598
|
const overIdAcceptsDrop = overIndex === -1 ? void 0 : acceptsDrop2(activeIndex, overIndex, "inside");
|
|
@@ -4550,26 +4629,26 @@ function SortableRoot({
|
|
|
4550
4629
|
}
|
|
4551
4630
|
})
|
|
4552
4631
|
);
|
|
4553
|
-
const [activeIndex, setActiveIndex] =
|
|
4554
|
-
const activatorEvent =
|
|
4555
|
-
const [position, setPosition] =
|
|
4632
|
+
const [activeIndex, setActiveIndex] = React43.useState();
|
|
4633
|
+
const activatorEvent = React43.useRef(null);
|
|
4634
|
+
const [position, setPosition] = React43.useState({
|
|
4556
4635
|
x: 0,
|
|
4557
4636
|
y: 0
|
|
4558
4637
|
});
|
|
4559
|
-
const setActivatorEvent =
|
|
4638
|
+
const setActivatorEvent = React43.useCallback((event) => {
|
|
4560
4639
|
activatorEvent.current = event;
|
|
4561
4640
|
}, []);
|
|
4562
|
-
const handleDragStart =
|
|
4641
|
+
const handleDragStart = React43.useCallback(
|
|
4563
4642
|
(event) => {
|
|
4564
4643
|
const index = keys.findIndex((id) => id === event.active.id);
|
|
4565
4644
|
setActiveIndex(index);
|
|
4566
4645
|
},
|
|
4567
4646
|
[keys]
|
|
4568
4647
|
);
|
|
4569
|
-
const handleDragMove =
|
|
4648
|
+
const handleDragMove = React43.useCallback((event) => {
|
|
4570
4649
|
setPosition({ ...event.delta });
|
|
4571
4650
|
}, []);
|
|
4572
|
-
const handleDragEnd =
|
|
4651
|
+
const handleDragEnd = React43.useCallback(
|
|
4573
4652
|
(event) => {
|
|
4574
4653
|
const { active, over } = event;
|
|
4575
4654
|
setActiveIndex(void 0);
|
|
@@ -4596,14 +4675,14 @@ function SortableRoot({
|
|
|
4596
4675
|
},
|
|
4597
4676
|
[acceptsDrop2, axis, keys, onMoveItem, position.x, position.y]
|
|
4598
4677
|
);
|
|
4599
|
-
const [mounted, setMounted] =
|
|
4600
|
-
|
|
4678
|
+
const [mounted, setMounted] = React43.useState(false);
|
|
4679
|
+
React43.useEffect(() => {
|
|
4601
4680
|
setMounted(true);
|
|
4602
4681
|
}, []);
|
|
4603
|
-
return /* @__PURE__ */
|
|
4682
|
+
return /* @__PURE__ */ React43.createElement(
|
|
4604
4683
|
SortableItemContext.Provider,
|
|
4605
4684
|
{
|
|
4606
|
-
value:
|
|
4685
|
+
value: React43.useMemo(
|
|
4607
4686
|
() => ({
|
|
4608
4687
|
keys,
|
|
4609
4688
|
acceptsDrop: acceptsDrop2,
|
|
@@ -4622,7 +4701,7 @@ function SortableRoot({
|
|
|
4622
4701
|
]
|
|
4623
4702
|
)
|
|
4624
4703
|
},
|
|
4625
|
-
/* @__PURE__ */
|
|
4704
|
+
/* @__PURE__ */ React43.createElement(
|
|
4626
4705
|
import_core.DndContext,
|
|
4627
4706
|
{
|
|
4628
4707
|
sensors,
|
|
@@ -4631,7 +4710,7 @@ function SortableRoot({
|
|
|
4631
4710
|
onDragMove: handleDragMove,
|
|
4632
4711
|
onDragEnd: handleDragEnd
|
|
4633
4712
|
},
|
|
4634
|
-
/* @__PURE__ */
|
|
4713
|
+
/* @__PURE__ */ React43.createElement(
|
|
4635
4714
|
import_sortable.SortableContext,
|
|
4636
4715
|
{
|
|
4637
4716
|
items: keys,
|
|
@@ -4640,7 +4719,7 @@ function SortableRoot({
|
|
|
4640
4719
|
children
|
|
4641
4720
|
),
|
|
4642
4721
|
mounted && renderOverlay && (0, import_react_dom2.createPortal)(
|
|
4643
|
-
/* @__PURE__ */
|
|
4722
|
+
/* @__PURE__ */ React43.createElement(import_core.DragOverlay, { dropAnimation: null }, activeIndex !== void 0 && activeIndex >= 0 && renderOverlay(activeIndex)),
|
|
4644
4723
|
document.body
|
|
4645
4724
|
)
|
|
4646
4725
|
)
|
|
@@ -4658,11 +4737,11 @@ var SortableComponent = memoGeneric(function Sortable(props) {
|
|
|
4658
4737
|
shouldRenderOverlay = true,
|
|
4659
4738
|
...rest
|
|
4660
4739
|
} = props;
|
|
4661
|
-
const keys =
|
|
4740
|
+
const keys = React43.useMemo(
|
|
4662
4741
|
() => items.map(keyExtractor),
|
|
4663
4742
|
[items, keyExtractor]
|
|
4664
4743
|
);
|
|
4665
|
-
const renderOverlay =
|
|
4744
|
+
const renderOverlay = React43.useCallback(
|
|
4666
4745
|
(index) => {
|
|
4667
4746
|
return renderItem(
|
|
4668
4747
|
items[index],
|
|
@@ -4682,14 +4761,14 @@ var SortableComponent = memoGeneric(function Sortable(props) {
|
|
|
4682
4761
|
},
|
|
4683
4762
|
[renderItem, items]
|
|
4684
4763
|
);
|
|
4685
|
-
return /* @__PURE__ */
|
|
4764
|
+
return /* @__PURE__ */ React43.createElement(
|
|
4686
4765
|
SortableSubcomponents.Root,
|
|
4687
4766
|
{
|
|
4688
4767
|
...rest,
|
|
4689
4768
|
keys,
|
|
4690
4769
|
renderOverlay: shouldRenderOverlay ? renderOverlay : void 0
|
|
4691
4770
|
},
|
|
4692
|
-
keys.map((key, index) => /* @__PURE__ */
|
|
4771
|
+
keys.map((key, index) => /* @__PURE__ */ React43.createElement(SortableSubcomponents.Item, { key, id: key }, (props2) => {
|
|
4693
4772
|
return renderItem(
|
|
4694
4773
|
items[index],
|
|
4695
4774
|
props2,
|
|
@@ -5749,9 +5828,9 @@ var ColorSwatch = (0, import_react55.forwardRef)(function ColorSwatch2({ color,
|
|
|
5749
5828
|
width: sizePx,
|
|
5750
5829
|
height: sizePx,
|
|
5751
5830
|
borderRadius: "4px",
|
|
5752
|
-
outline: checked ?
|
|
5831
|
+
outline: checked ? `2px solid ${cssVars.colors.primary}` : "1px solid rgba(0,0,0,0.1)",
|
|
5753
5832
|
outlineOffset: -1,
|
|
5754
|
-
boxShadow: checked ? `inset 0 0 0 2px
|
|
5833
|
+
boxShadow: checked ? `inset 0 0 0 2px ${cssVars.colors.background}` : void 0,
|
|
5755
5834
|
...style2
|
|
5756
5835
|
}
|
|
5757
5836
|
}
|
|
@@ -5797,30 +5876,32 @@ function ColorSwatchControl(props) {
|
|
|
5797
5876
|
checked: value === option
|
|
5798
5877
|
}
|
|
5799
5878
|
);
|
|
5800
|
-
return
|
|
5879
|
+
return /* @__PURE__ */ import_react56.default.createElement(
|
|
5801
5880
|
ToggleGroupPrimitive.Item,
|
|
5802
5881
|
{
|
|
5803
5882
|
asChild: true,
|
|
5804
5883
|
value: option,
|
|
5805
|
-
key: option
|
|
5884
|
+
key: option,
|
|
5885
|
+
disabled: readOnly
|
|
5806
5886
|
},
|
|
5807
5887
|
item
|
|
5808
5888
|
);
|
|
5809
5889
|
}));
|
|
5810
|
-
return
|
|
5890
|
+
return /* @__PURE__ */ import_react56.default.createElement(
|
|
5811
5891
|
ToggleGroupPrimitive.Root,
|
|
5812
5892
|
{
|
|
5813
5893
|
type: "single",
|
|
5814
5894
|
value,
|
|
5815
5895
|
onValueChange,
|
|
5816
|
-
className: "w-full"
|
|
5896
|
+
className: "w-full",
|
|
5897
|
+
disabled: readOnly
|
|
5817
5898
|
},
|
|
5818
5899
|
content
|
|
5819
5900
|
);
|
|
5820
5901
|
}
|
|
5821
5902
|
|
|
5822
5903
|
// src/components/Combobox.tsx
|
|
5823
|
-
var
|
|
5904
|
+
var import_noya_icons5 = require("@noya-app/noya-icons");
|
|
5824
5905
|
var import_react59 = __toESM(require("react"));
|
|
5825
5906
|
|
|
5826
5907
|
// src/utils/combobox.ts
|
|
@@ -6155,7 +6236,7 @@ function useComboboxState(state) {
|
|
|
6155
6236
|
}
|
|
6156
6237
|
|
|
6157
6238
|
// src/components/ComboboxMenu.tsx
|
|
6158
|
-
var
|
|
6239
|
+
var import_noya_icons4 = require("@noya-app/noya-icons");
|
|
6159
6240
|
var import_react58 = __toESM(require("react"));
|
|
6160
6241
|
var ComboboxMenu = memoGeneric(
|
|
6161
6242
|
forwardRefGeneric(function ComboboxMenu2({
|
|
@@ -6208,7 +6289,7 @@ var ComboboxMenu = memoGeneric(
|
|
|
6208
6289
|
}
|
|
6209
6290
|
}
|
|
6210
6291
|
},
|
|
6211
|
-
/* @__PURE__ */ import_react58.default.createElement("div", { className: "flex flex-1 min-w-0 items-center" }, indented && /* @__PURE__ */ import_react58.default.createElement(Spacer.Horizontal, { size: CHECKBOX_INDENT_WIDTH }), item.checked ? /* @__PURE__ */ import_react58.default.createElement("div", { ...styles.itemIndicator }, /* @__PURE__ */ import_react58.default.createElement(
|
|
6292
|
+
/* @__PURE__ */ import_react58.default.createElement("div", { className: "flex flex-1 min-w-0 items-center" }, indented && /* @__PURE__ */ import_react58.default.createElement(Spacer.Horizontal, { size: CHECKBOX_INDENT_WIDTH }), item.checked ? /* @__PURE__ */ import_react58.default.createElement("div", { ...styles.itemIndicator }, /* @__PURE__ */ import_react58.default.createElement(import_noya_icons4.CheckIcon, null)) : indented ? /* @__PURE__ */ import_react58.default.createElement(
|
|
6212
6293
|
Spacer.Horizontal,
|
|
6213
6294
|
{
|
|
6214
6295
|
size: CHECKBOX_WIDTH - CHECKBOX_RIGHT_INSET
|
|
@@ -6559,7 +6640,7 @@ var Combobox = memoGeneric(
|
|
|
6559
6640
|
onClick: handleChevronClick
|
|
6560
6641
|
},
|
|
6561
6642
|
/* @__PURE__ */ import_react59.default.createElement(
|
|
6562
|
-
|
|
6643
|
+
import_noya_icons5.DropdownChevronIcon,
|
|
6563
6644
|
{
|
|
6564
6645
|
className: cx(
|
|
6565
6646
|
"transition-transform duration-100",
|
|
@@ -6895,7 +6976,7 @@ var CommandPalette = (0, import_react62.memo)(function CommandPalette2({
|
|
|
6895
6976
|
});
|
|
6896
6977
|
|
|
6897
6978
|
// src/components/connected-users-menu/ConnectedUsersMenuLayout.tsx
|
|
6898
|
-
var
|
|
6979
|
+
var import_noya_icons6 = require("@noya-app/noya-icons");
|
|
6899
6980
|
var import_react63 = __toESM(require("react"));
|
|
6900
6981
|
var UserAvatar = ({ userId, name, image }) => /* @__PURE__ */ import_react63.default.createElement(
|
|
6901
6982
|
Tooltip,
|
|
@@ -6925,44 +7006,28 @@ var ConnectedUsersMenuLayout = ({
|
|
|
6925
7006
|
backgroundColor: isAssistantOpen ? colorFromString(currentUserId ?? "") : void 0
|
|
6926
7007
|
}
|
|
6927
7008
|
},
|
|
6928
|
-
"AI",
|
|
6929
|
-
/* @__PURE__ */ import_react63.default.createElement(Spacer.Horizontal, { size: 8 }),
|
|
6930
7009
|
/* @__PURE__ */ import_react63.default.createElement(
|
|
6931
|
-
|
|
7010
|
+
import_noya_icons6.ChatBubbleWithDotsIcon,
|
|
6932
7011
|
{
|
|
6933
7012
|
color: isAssistantOpen ? void 0 : cssVars.colors.icon
|
|
6934
7013
|
}
|
|
6935
|
-
)
|
|
7014
|
+
),
|
|
7015
|
+
/* @__PURE__ */ import_react63.default.createElement(Spacer.Horizontal, { inline: true, size: 6 }),
|
|
7016
|
+
"AI"
|
|
6936
7017
|
)
|
|
6937
7018
|
));
|
|
6938
7019
|
};
|
|
6939
7020
|
|
|
6940
7021
|
// src/components/DraggableMenuButton.tsx
|
|
6941
|
-
var
|
|
7022
|
+
var import_noya_icons7 = require("@noya-app/noya-icons");
|
|
6942
7023
|
var import_react64 = __toESM(require("react"));
|
|
6943
|
-
var DotButton = (0, import_react64.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ import_react64.default.createElement(
|
|
6944
|
-
"div",
|
|
6945
|
-
{
|
|
6946
|
-
ref,
|
|
6947
|
-
className: cx(
|
|
6948
|
-
`cursor-pointer rounded flex items-center justify-center py-[2px] hover:bg-input-background-light active:bg-active-background `,
|
|
6949
|
-
className
|
|
6950
|
-
),
|
|
6951
|
-
...props
|
|
6952
|
-
}
|
|
6953
|
-
));
|
|
6954
|
-
var Trigger5 = (0, import_react64.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ import_react64.default.createElement(
|
|
6955
|
-
"div",
|
|
6956
|
-
{
|
|
6957
|
-
ref,
|
|
6958
|
-
className: cx(`pointer-events-none h-[15px] `, className),
|
|
6959
|
-
...props
|
|
6960
|
-
}
|
|
6961
|
-
));
|
|
6962
7024
|
var DraggableMenuButton = memoGeneric(function DraggableMenuButton2({
|
|
6963
7025
|
items,
|
|
6964
7026
|
onSelect,
|
|
6965
|
-
|
|
7027
|
+
onClick,
|
|
7028
|
+
isVisible = true,
|
|
7029
|
+
className,
|
|
7030
|
+
style: style2
|
|
6966
7031
|
}) {
|
|
6967
7032
|
const [open, setOpen] = (0, import_react64.useState)(false);
|
|
6968
7033
|
const [downPosition, setDownPosition] = (0, import_react64.useState)(null);
|
|
@@ -7002,13 +7067,19 @@ var DraggableMenuButton = memoGeneric(function DraggableMenuButton2({
|
|
|
7002
7067
|
[setOpen]
|
|
7003
7068
|
);
|
|
7004
7069
|
return /* @__PURE__ */ import_react64.default.createElement(
|
|
7005
|
-
|
|
7070
|
+
"div",
|
|
7006
7071
|
{
|
|
7072
|
+
className: cx(
|
|
7073
|
+
"cursor-pointer rounded flex items-center justify-center py-[2px] hover:bg-input-background-light active:bg-active-background ",
|
|
7074
|
+
className
|
|
7075
|
+
),
|
|
7076
|
+
style: style2,
|
|
7007
7077
|
onPointerDownCapture: handlePointerDownCapture,
|
|
7008
7078
|
onPointerUp: handlePointerUp,
|
|
7009
7079
|
onClick: (event) => {
|
|
7010
7080
|
event.stopPropagation();
|
|
7011
7081
|
event.preventDefault();
|
|
7082
|
+
onClick?.();
|
|
7012
7083
|
}
|
|
7013
7084
|
},
|
|
7014
7085
|
items && onSelect ? /* @__PURE__ */ import_react64.default.createElement(
|
|
@@ -7020,14 +7091,14 @@ var DraggableMenuButton = memoGeneric(function DraggableMenuButton2({
|
|
|
7020
7091
|
onSelect,
|
|
7021
7092
|
shouldBindKeyboardShortcuts: false
|
|
7022
7093
|
},
|
|
7023
|
-
/* @__PURE__ */ import_react64.default.createElement(
|
|
7024
|
-
|
|
7094
|
+
/* @__PURE__ */ import_react64.default.createElement("div", { className: "pointer-events-none h-[15px]" }, /* @__PURE__ */ import_react64.default.createElement(
|
|
7095
|
+
import_noya_icons7.DragHandleDots2Icon,
|
|
7025
7096
|
{
|
|
7026
7097
|
color: isVisible || open ? cssVars.colors.icon : "transparent"
|
|
7027
7098
|
}
|
|
7028
7099
|
))
|
|
7029
7100
|
) : /* @__PURE__ */ import_react64.default.createElement(
|
|
7030
|
-
|
|
7101
|
+
import_noya_icons7.DragHandleDots2Icon,
|
|
7031
7102
|
{
|
|
7032
7103
|
color: isVisible || open ? cssVars.colors.icon : "transparent"
|
|
7033
7104
|
}
|
|
@@ -7037,10 +7108,10 @@ var DraggableMenuButton = memoGeneric(function DraggableMenuButton2({
|
|
|
7037
7108
|
|
|
7038
7109
|
// src/components/Drawer.tsx
|
|
7039
7110
|
var Dialog3 = __toESM(require("@radix-ui/react-dialog"));
|
|
7040
|
-
var
|
|
7111
|
+
var React57 = __toESM(require("react"));
|
|
7041
7112
|
var import_react65 = require("react");
|
|
7042
|
-
var Drawer =
|
|
7043
|
-
|
|
7113
|
+
var Drawer = React57.memo(
|
|
7114
|
+
React57.forwardRef(function Drawer2({
|
|
7044
7115
|
open,
|
|
7045
7116
|
onOpenChange,
|
|
7046
7117
|
trigger,
|
|
@@ -7070,7 +7141,7 @@ var Drawer = React56.memo(
|
|
|
7070
7141
|
return internalOpen;
|
|
7071
7142
|
}
|
|
7072
7143
|
}));
|
|
7073
|
-
const inner = /* @__PURE__ */
|
|
7144
|
+
const inner = /* @__PURE__ */ React57.createElement(React57.Fragment, null, /* @__PURE__ */ React57.createElement(
|
|
7074
7145
|
Dialog3.Overlay,
|
|
7075
7146
|
{
|
|
7076
7147
|
className: cx(
|
|
@@ -7078,7 +7149,7 @@ var Drawer = React56.memo(
|
|
|
7078
7149
|
positioning === "absolute" ? "absolute" : "fixed"
|
|
7079
7150
|
)
|
|
7080
7151
|
}
|
|
7081
|
-
), /* @__PURE__ */
|
|
7152
|
+
), /* @__PURE__ */ React57.createElement(
|
|
7082
7153
|
Dialog3.Content,
|
|
7083
7154
|
{
|
|
7084
7155
|
id,
|
|
@@ -7090,18 +7161,18 @@ var Drawer = React56.memo(
|
|
|
7090
7161
|
className
|
|
7091
7162
|
)
|
|
7092
7163
|
},
|
|
7093
|
-
title && /* @__PURE__ */
|
|
7164
|
+
title && /* @__PURE__ */ React57.createElement(Dialog3.Title, null, title),
|
|
7094
7165
|
children
|
|
7095
7166
|
));
|
|
7096
|
-
return /* @__PURE__ */
|
|
7167
|
+
return /* @__PURE__ */ React57.createElement(
|
|
7097
7168
|
Dialog3.Root,
|
|
7098
7169
|
{
|
|
7099
7170
|
key: "dialog",
|
|
7100
7171
|
open: internalOpen,
|
|
7101
7172
|
onOpenChange: setInternalOpen
|
|
7102
7173
|
},
|
|
7103
|
-
/* @__PURE__ */
|
|
7104
|
-
portalled ? /* @__PURE__ */
|
|
7174
|
+
/* @__PURE__ */ React57.createElement(Dialog3.Trigger, { key: "trigger" }, trigger),
|
|
7175
|
+
portalled ? /* @__PURE__ */ React57.createElement(Dialog3.Portal, { container: portalContainer }, inner) : inner
|
|
7105
7176
|
);
|
|
7106
7177
|
})
|
|
7107
7178
|
);
|
|
@@ -7517,25 +7588,25 @@ var ClassValue = /* @__PURE__ */ ((ClassValue2) => {
|
|
|
7517
7588
|
})(ClassValue || {});
|
|
7518
7589
|
|
|
7519
7590
|
// src/components/FillPreviewBackground.tsx
|
|
7520
|
-
var
|
|
7591
|
+
var React61 = __toESM(require("react"));
|
|
7521
7592
|
|
|
7522
7593
|
// src/contexts/ImageDataContext.tsx
|
|
7523
|
-
var
|
|
7524
|
-
var ImageDataContext =
|
|
7594
|
+
var React60 = __toESM(require("react"));
|
|
7595
|
+
var ImageDataContext = React60.createContext(
|
|
7525
7596
|
void 0
|
|
7526
7597
|
);
|
|
7527
|
-
var ImageDataProvider =
|
|
7598
|
+
var ImageDataProvider = React60.memo(function ImageDataProvider2({
|
|
7528
7599
|
children,
|
|
7529
7600
|
getImageData
|
|
7530
7601
|
}) {
|
|
7531
|
-
const contextValue =
|
|
7602
|
+
const contextValue = React60.useMemo(
|
|
7532
7603
|
() => ({ getImageData: getImageData ?? (() => void 0) }),
|
|
7533
7604
|
[getImageData]
|
|
7534
7605
|
);
|
|
7535
|
-
return /* @__PURE__ */
|
|
7606
|
+
return /* @__PURE__ */ React60.createElement(ImageDataContext.Provider, { value: contextValue }, children);
|
|
7536
7607
|
});
|
|
7537
7608
|
function useImageData(ref) {
|
|
7538
|
-
const value =
|
|
7609
|
+
const value = React60.useContext(ImageDataContext);
|
|
7539
7610
|
if (!value) {
|
|
7540
7611
|
throw new Error("Missing ImageDataProvider");
|
|
7541
7612
|
}
|
|
@@ -7601,10 +7672,10 @@ var dotsHorizontalSvg = (fillColor) => `
|
|
|
7601
7672
|
<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>
|
|
7602
7673
|
</svg>
|
|
7603
7674
|
`;
|
|
7604
|
-
var Background =
|
|
7675
|
+
var Background = React61.memo(function Background2({
|
|
7605
7676
|
background: background2
|
|
7606
7677
|
}) {
|
|
7607
|
-
return /* @__PURE__ */
|
|
7678
|
+
return /* @__PURE__ */ React61.createElement(
|
|
7608
7679
|
"span",
|
|
7609
7680
|
{
|
|
7610
7681
|
className: `${background2 ? `bg-[${background2}]` : "bg-input-background"} absolute inset-0`
|
|
@@ -7623,7 +7694,7 @@ function getPatternSizeAndPosition(fillType, tileScale) {
|
|
|
7623
7694
|
return "center / 100% 100%";
|
|
7624
7695
|
}
|
|
7625
7696
|
}
|
|
7626
|
-
var PatternPreviewBackground =
|
|
7697
|
+
var PatternPreviewBackground = React61.memo(
|
|
7627
7698
|
function PatternPreviewBackground2({
|
|
7628
7699
|
fillType,
|
|
7629
7700
|
tileScale,
|
|
@@ -7632,7 +7703,7 @@ var PatternPreviewBackground = React60.memo(
|
|
|
7632
7703
|
const image = useImageData(imageRef);
|
|
7633
7704
|
const url = useObjectURL(image);
|
|
7634
7705
|
const size2 = getPatternSizeAndPosition(fillType, tileScale);
|
|
7635
|
-
const background2 =
|
|
7706
|
+
const background2 = React61.useMemo(
|
|
7636
7707
|
() => [
|
|
7637
7708
|
size2,
|
|
7638
7709
|
`url(${url})`,
|
|
@@ -7640,44 +7711,44 @@ var PatternPreviewBackground = React60.memo(
|
|
|
7640
7711
|
].join(" "),
|
|
7641
7712
|
[fillType, size2, url]
|
|
7642
7713
|
);
|
|
7643
|
-
return /* @__PURE__ */
|
|
7714
|
+
return /* @__PURE__ */ React61.createElement(Background, { background: background2 });
|
|
7644
7715
|
}
|
|
7645
7716
|
);
|
|
7646
|
-
var ColorPreviewBackground =
|
|
7717
|
+
var ColorPreviewBackground = React61.memo(function ColorPreviewBackground2({
|
|
7647
7718
|
color
|
|
7648
7719
|
}) {
|
|
7649
|
-
const background2 =
|
|
7720
|
+
const background2 = React61.useMemo(
|
|
7650
7721
|
() => sketchColorToRgbaString(color),
|
|
7651
7722
|
[color]
|
|
7652
7723
|
);
|
|
7653
|
-
return /* @__PURE__ */
|
|
7724
|
+
return /* @__PURE__ */ React61.createElement(Background, { background: background2 });
|
|
7654
7725
|
});
|
|
7655
|
-
var GradientPreviewBackground =
|
|
7726
|
+
var GradientPreviewBackground = React61.memo(
|
|
7656
7727
|
function GradientPreviewBackground2({
|
|
7657
7728
|
gradient
|
|
7658
7729
|
}) {
|
|
7659
|
-
const background2 =
|
|
7730
|
+
const background2 = React61.useMemo(
|
|
7660
7731
|
() => getGradientBackground(gradient.stops, gradient.gradientType, 180),
|
|
7661
7732
|
[gradient.gradientType, gradient.stops]
|
|
7662
7733
|
);
|
|
7663
|
-
return /* @__PURE__ */
|
|
7734
|
+
return /* @__PURE__ */ React61.createElement(Background, { background: background2 });
|
|
7664
7735
|
}
|
|
7665
7736
|
);
|
|
7666
7737
|
var background = `center url("data:image/svg+xml;utf8,${dotsHorizontalSvg(
|
|
7667
7738
|
cssVars.colors.placeholderDots
|
|
7668
7739
|
)}") no-repeat`;
|
|
7669
|
-
var FillPreviewBackground =
|
|
7740
|
+
var FillPreviewBackground = React61.memo(function FillPreviewBackground2({
|
|
7670
7741
|
value
|
|
7671
7742
|
}) {
|
|
7672
|
-
if (!value) return /* @__PURE__ */
|
|
7743
|
+
if (!value) return /* @__PURE__ */ React61.createElement(Background, { background });
|
|
7673
7744
|
switch (value._class) {
|
|
7674
7745
|
case "color":
|
|
7675
|
-
return /* @__PURE__ */
|
|
7746
|
+
return /* @__PURE__ */ React61.createElement(ColorPreviewBackground, { color: value });
|
|
7676
7747
|
case "gradient":
|
|
7677
|
-
return /* @__PURE__ */
|
|
7748
|
+
return /* @__PURE__ */ React61.createElement(GradientPreviewBackground, { gradient: value });
|
|
7678
7749
|
case "pattern":
|
|
7679
7750
|
if (!value.image) return null;
|
|
7680
|
-
return /* @__PURE__ */
|
|
7751
|
+
return /* @__PURE__ */ React61.createElement(
|
|
7681
7752
|
PatternPreviewBackground,
|
|
7682
7753
|
{
|
|
7683
7754
|
fillType: value.patternFillType,
|
|
@@ -7977,8 +8048,8 @@ var FloatingWindow = ({
|
|
|
7977
8048
|
|
|
7978
8049
|
// src/components/GradientPicker.tsx
|
|
7979
8050
|
var import_noya_colorpicker2 = require("@noya-app/noya-colorpicker");
|
|
7980
|
-
var
|
|
7981
|
-
var GradientPicker =
|
|
8051
|
+
var React64 = __toESM(require("react"));
|
|
8052
|
+
var GradientPicker = React64.memo(function GradientPicker2({
|
|
7982
8053
|
value,
|
|
7983
8054
|
selectedStop,
|
|
7984
8055
|
onChangeColor,
|
|
@@ -7987,7 +8058,7 @@ var GradientPicker = React63.memo(function GradientPicker2({
|
|
|
7987
8058
|
onDelete,
|
|
7988
8059
|
onSelectStop
|
|
7989
8060
|
}) {
|
|
7990
|
-
const colorModel =
|
|
8061
|
+
const colorModel = React64.useMemo(
|
|
7991
8062
|
() => ({
|
|
7992
8063
|
defaultColor: { r: 0, g: 0, b: 0, a: 1 },
|
|
7993
8064
|
toHsva: import_noya_colorpicker2.rgbaToHsva,
|
|
@@ -7996,30 +8067,30 @@ var GradientPicker = React63.memo(function GradientPicker2({
|
|
|
7996
8067
|
}),
|
|
7997
8068
|
[]
|
|
7998
8069
|
);
|
|
7999
|
-
const rgbaColor =
|
|
8070
|
+
const rgbaColor = React64.useMemo(
|
|
8000
8071
|
() => sketchColorToRgba(value[selectedStop].color),
|
|
8001
8072
|
[value, selectedStop]
|
|
8002
8073
|
);
|
|
8003
|
-
const handleChangeColor =
|
|
8074
|
+
const handleChangeColor = React64.useCallback(
|
|
8004
8075
|
(value2) => {
|
|
8005
8076
|
onChangeColor(rgbaToSketchColor(value2));
|
|
8006
8077
|
},
|
|
8007
8078
|
[onChangeColor]
|
|
8008
8079
|
);
|
|
8009
|
-
const handleAddGradientStop =
|
|
8080
|
+
const handleAddGradientStop = React64.useCallback(
|
|
8010
8081
|
(value2, position) => {
|
|
8011
8082
|
onAdd(rgbaToSketchColor(value2), position);
|
|
8012
8083
|
},
|
|
8013
8084
|
[onAdd]
|
|
8014
8085
|
);
|
|
8015
|
-
return /* @__PURE__ */
|
|
8086
|
+
return /* @__PURE__ */ React64.createElement(
|
|
8016
8087
|
import_noya_colorpicker2.ColorPicker,
|
|
8017
8088
|
{
|
|
8018
8089
|
onChange: handleChangeColor,
|
|
8019
8090
|
colorModel,
|
|
8020
8091
|
color: rgbaColor
|
|
8021
8092
|
},
|
|
8022
|
-
/* @__PURE__ */
|
|
8093
|
+
/* @__PURE__ */ React64.createElement(
|
|
8023
8094
|
import_noya_colorpicker2.Gradient,
|
|
8024
8095
|
{
|
|
8025
8096
|
gradients: value,
|
|
@@ -8030,12 +8101,12 @@ var GradientPicker = React63.memo(function GradientPicker2({
|
|
|
8030
8101
|
onDelete
|
|
8031
8102
|
}
|
|
8032
8103
|
),
|
|
8033
|
-
/* @__PURE__ */
|
|
8034
|
-
/* @__PURE__ */
|
|
8035
|
-
/* @__PURE__ */
|
|
8036
|
-
/* @__PURE__ */
|
|
8037
|
-
/* @__PURE__ */
|
|
8038
|
-
/* @__PURE__ */
|
|
8104
|
+
/* @__PURE__ */ React64.createElement(Spacer.Vertical, { size: 10 }),
|
|
8105
|
+
/* @__PURE__ */ React64.createElement(import_noya_colorpicker2.Saturation, null),
|
|
8106
|
+
/* @__PURE__ */ React64.createElement(Spacer.Vertical, { size: 12 }),
|
|
8107
|
+
/* @__PURE__ */ React64.createElement(import_noya_colorpicker2.Hue, null),
|
|
8108
|
+
/* @__PURE__ */ React64.createElement(Spacer.Vertical, { size: 5 }),
|
|
8109
|
+
/* @__PURE__ */ React64.createElement(import_noya_colorpicker2.Alpha, null)
|
|
8039
8110
|
);
|
|
8040
8111
|
});
|
|
8041
8112
|
|
|
@@ -8073,25 +8144,25 @@ var InspectorContainer = (0, import_react71.memo)(
|
|
|
8073
8144
|
|
|
8074
8145
|
// src/components/LabeledElementView.tsx
|
|
8075
8146
|
var kiwi = __toESM(require("kiwi.js"));
|
|
8076
|
-
var
|
|
8077
|
-
var LabeledElementView =
|
|
8147
|
+
var React66 = __toESM(require("react"));
|
|
8148
|
+
var LabeledElementView = React66.memo(function LabeledElementView2({
|
|
8078
8149
|
children,
|
|
8079
8150
|
renderLabel
|
|
8080
8151
|
}) {
|
|
8081
|
-
const elementIds =
|
|
8082
|
-
(child) =>
|
|
8152
|
+
const elementIds = React66.Children.toArray(children).flatMap(
|
|
8153
|
+
(child) => React66.isValidElement(child) && child.type === React66.Fragment ? child.props.children : [child]
|
|
8083
8154
|
).map(
|
|
8084
|
-
(child) =>
|
|
8155
|
+
(child) => React66.isValidElement(child) && "id" in child.props ? child.props.id : null
|
|
8085
8156
|
).filter((id) => !!id);
|
|
8086
8157
|
const serializedIds = elementIds.join(",");
|
|
8087
|
-
const containerRef =
|
|
8088
|
-
const refs =
|
|
8158
|
+
const containerRef = React66.useRef(null);
|
|
8159
|
+
const refs = React66.useMemo(() => {
|
|
8089
8160
|
return Object.fromEntries(
|
|
8090
|
-
serializedIds.split(",").map((id) => [id,
|
|
8161
|
+
serializedIds.split(",").map((id) => [id, React66.createRef()])
|
|
8091
8162
|
);
|
|
8092
8163
|
}, [serializedIds]);
|
|
8093
|
-
const labelElements =
|
|
8094
|
-
return serializedIds.split(",").map((id, index) => /* @__PURE__ */
|
|
8164
|
+
const labelElements = React66.useMemo(() => {
|
|
8165
|
+
return serializedIds.split(",").map((id, index) => /* @__PURE__ */ React66.createElement(
|
|
8095
8166
|
"span",
|
|
8096
8167
|
{
|
|
8097
8168
|
key: id,
|
|
@@ -8104,7 +8175,7 @@ var LabeledElementView = React65.memo(function LabeledElementView2({
|
|
|
8104
8175
|
})
|
|
8105
8176
|
));
|
|
8106
8177
|
}, [refs, serializedIds, renderLabel]);
|
|
8107
|
-
|
|
8178
|
+
React66.useLayoutEffect(() => {
|
|
8108
8179
|
if (!containerRef.current) return;
|
|
8109
8180
|
const containerRect = containerRef.current.getBoundingClientRect();
|
|
8110
8181
|
const solver = new kiwi.Solver();
|
|
@@ -8166,7 +8237,7 @@ var LabeledElementView = React65.memo(function LabeledElementView2({
|
|
|
8166
8237
|
`${Math.max(...heights)}px`
|
|
8167
8238
|
);
|
|
8168
8239
|
}, [refs, labelElements]);
|
|
8169
|
-
return /* @__PURE__ */
|
|
8240
|
+
return /* @__PURE__ */ React66.createElement("div", { className: "flex flex-1 flex-col relative", ref: containerRef }, /* @__PURE__ */ React66.createElement("div", { className: "flex flex-1 items-center" }, children), /* @__PURE__ */ React66.createElement("div", { className: "relative overflow-hidden select-none" }, labelElements));
|
|
8170
8241
|
});
|
|
8171
8242
|
|
|
8172
8243
|
// src/components/LabeledField.tsx
|
|
@@ -8250,7 +8321,7 @@ var LabeledField = (0, import_react73.memo)(function LabeledField2({
|
|
|
8250
8321
|
});
|
|
8251
8322
|
|
|
8252
8323
|
// src/components/MediaThumbnail.tsx
|
|
8253
|
-
var
|
|
8324
|
+
var import_noya_icons8 = require("@noya-app/noya-icons");
|
|
8254
8325
|
var import_react74 = __toESM(require("react"));
|
|
8255
8326
|
|
|
8256
8327
|
// src/components/catppuccin/fileIcons.ts
|
|
@@ -10716,7 +10787,7 @@ var MediaThumbnail = (0, import_react74.memo)(function MediaThumbnail2({
|
|
|
10716
10787
|
const content = (0, import_react74.useMemo)(() => {
|
|
10717
10788
|
switch (contentType) {
|
|
10718
10789
|
case "image":
|
|
10719
|
-
if (!url) return /* @__PURE__ */ import_react74.default.createElement(
|
|
10790
|
+
if (!url) return /* @__PURE__ */ import_react74.default.createElement(import_noya_icons8.ImageIcon, { color: iconColor, style: iconStyles });
|
|
10720
10791
|
return /* @__PURE__ */ import_react74.default.createElement(
|
|
10721
10792
|
"img",
|
|
10722
10793
|
{
|
|
@@ -10727,9 +10798,9 @@ var MediaThumbnail = (0, import_react74.memo)(function MediaThumbnail2({
|
|
|
10727
10798
|
}
|
|
10728
10799
|
);
|
|
10729
10800
|
case "video":
|
|
10730
|
-
return /* @__PURE__ */ import_react74.default.createElement(
|
|
10801
|
+
return /* @__PURE__ */ import_react74.default.createElement(import_noya_icons8.VideoIcon, { color: iconColor, style: iconStyles });
|
|
10731
10802
|
case "audio":
|
|
10732
|
-
return /* @__PURE__ */ import_react74.default.createElement(
|
|
10803
|
+
return /* @__PURE__ */ import_react74.default.createElement(import_noya_icons8.SpeakerLoudIcon, { color: iconColor, style: iconStyles });
|
|
10733
10804
|
default:
|
|
10734
10805
|
if (iconName) {
|
|
10735
10806
|
const Icon = Icons[iconName];
|
|
@@ -10748,7 +10819,7 @@ var MediaThumbnail = (0, import_react74.memo)(function MediaThumbnail2({
|
|
|
10748
10819
|
);
|
|
10749
10820
|
}
|
|
10750
10821
|
}
|
|
10751
|
-
return /* @__PURE__ */ import_react74.default.createElement(
|
|
10822
|
+
return /* @__PURE__ */ import_react74.default.createElement(import_noya_icons8.FileIcon, { color: iconColor, style: iconStyles });
|
|
10752
10823
|
}
|
|
10753
10824
|
}, [contentType, url, iconColor, iconStyles, iconName, fileName]);
|
|
10754
10825
|
return /* @__PURE__ */ import_react74.default.createElement(
|
|
@@ -10842,7 +10913,7 @@ var Message = (0, import_react75.memo)(
|
|
|
10842
10913
|
);
|
|
10843
10914
|
|
|
10844
10915
|
// src/components/pipeline/PipelineResultLayout.tsx
|
|
10845
|
-
var
|
|
10916
|
+
var import_noya_icons9 = require("@noya-app/noya-icons");
|
|
10846
10917
|
var import_react76 = __toESM(require("react"));
|
|
10847
10918
|
var PipelineResultLink = ({ url }) => {
|
|
10848
10919
|
return /* @__PURE__ */ import_react76.default.createElement("div", { className: "flex flex-col gap-0.5" }, /* @__PURE__ */ import_react76.default.createElement(
|
|
@@ -10853,7 +10924,7 @@ var PipelineResultLink = ({ url }) => {
|
|
|
10853
10924
|
rel: "noopener noreferrer",
|
|
10854
10925
|
className: "flex text-primary hover:opacity-80 border border-divider rounded-md"
|
|
10855
10926
|
},
|
|
10856
|
-
/* @__PURE__ */ import_react76.default.createElement("div", { className: "flex gap-1 items-center p-2" }, /* @__PURE__ */ import_react76.default.createElement(
|
|
10927
|
+
/* @__PURE__ */ import_react76.default.createElement("div", { className: "flex gap-1 items-center p-2" }, /* @__PURE__ */ import_react76.default.createElement(import_noya_icons9.Link1Icon, { className: "w-[15px] h-[15px] flex-shrink-0" })),
|
|
10857
10928
|
/* @__PURE__ */ import_react76.default.createElement(DividerVertical, null),
|
|
10858
10929
|
/* @__PURE__ */ import_react76.default.createElement(Small, { className: "truncate p-2 flex-1" }, url)
|
|
10859
10930
|
));
|
|
@@ -10877,27 +10948,27 @@ function getPipelineResultLink(value) {
|
|
|
10877
10948
|
// src/components/Progress.tsx
|
|
10878
10949
|
var import_noya_utils10 = require("@noya-app/noya-utils");
|
|
10879
10950
|
var ProgressPrimitive = __toESM(require("@radix-ui/react-progress"));
|
|
10880
|
-
var
|
|
10951
|
+
var React72 = __toESM(require("react"));
|
|
10881
10952
|
function Progress({
|
|
10882
10953
|
value,
|
|
10883
10954
|
variant = "normal",
|
|
10884
10955
|
className
|
|
10885
10956
|
}) {
|
|
10886
10957
|
const clampedValue = (0, import_noya_utils10.clamp)(value, 0, 100);
|
|
10887
|
-
const transformStyles =
|
|
10958
|
+
const transformStyles = React72.useMemo(
|
|
10888
10959
|
() => ({
|
|
10889
10960
|
transform: `translateX(-${100 - clampedValue}%)`
|
|
10890
10961
|
}),
|
|
10891
10962
|
[clampedValue]
|
|
10892
10963
|
);
|
|
10893
|
-
return /* @__PURE__ */
|
|
10964
|
+
return /* @__PURE__ */ React72.createElement(
|
|
10894
10965
|
ProgressPrimitive.Root,
|
|
10895
10966
|
{
|
|
10896
10967
|
className: cx(`relative hidden bg-input-background h-[5px] `, className),
|
|
10897
10968
|
style: { transform: "translateZ(0)" },
|
|
10898
10969
|
value: clampedValue
|
|
10899
10970
|
},
|
|
10900
|
-
/* @__PURE__ */
|
|
10971
|
+
/* @__PURE__ */ React72.createElement(
|
|
10901
10972
|
ProgressPrimitive.Indicator,
|
|
10902
10973
|
{
|
|
10903
10974
|
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`,
|
|
@@ -11010,12 +11081,15 @@ var SegmentedControlItem = (0, import_react78.forwardRef)(function SegmentedCont
|
|
|
11010
11081
|
value: (value ?? "").toString(),
|
|
11011
11082
|
disabled,
|
|
11012
11083
|
className: cx(
|
|
11013
|
-
"font-sans text-
|
|
11084
|
+
"font-sans text-button font-normal relative flex-1 appearance-none text-segmented-control-item rounded inline-flex gap-1.5 items-center justify-center align-middle text-center focus:outline-none transition-colors",
|
|
11014
11085
|
colorScheme === "secondary" ? "focus:ring-2 focus:ring-secondary focus:ring-offset-1" : "focus:ring-2 focus:ring-primary focus:ring-offset-1",
|
|
11015
11086
|
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",
|
|
11016
11087
|
"focus:z-interactable",
|
|
11017
11088
|
"aria-checked:shadow-segment",
|
|
11018
|
-
"whitespace-pre",
|
|
11089
|
+
"whitespace-pre px-1",
|
|
11090
|
+
"border-r border-divider last:border-r-0",
|
|
11091
|
+
"aria-checked:border-r-transparent",
|
|
11092
|
+
"[&:has(+[aria-checked=true])]:border-r-transparent",
|
|
11019
11093
|
className
|
|
11020
11094
|
),
|
|
11021
11095
|
...props
|
|
@@ -11025,15 +11099,6 @@ var SegmentedControlItem = (0, import_react78.forwardRef)(function SegmentedCont
|
|
|
11025
11099
|
);
|
|
11026
11100
|
return tooltip ? /* @__PURE__ */ import_react78.default.createElement(Tooltip, { content: tooltip }, itemElement) : itemElement;
|
|
11027
11101
|
});
|
|
11028
|
-
var Separator3 = ({ transparent }) => /* @__PURE__ */ import_react78.default.createElement(
|
|
11029
|
-
"div",
|
|
11030
|
-
{
|
|
11031
|
-
className: cx(
|
|
11032
|
-
"w-[1px] my-1 self-stretch bg-divider",
|
|
11033
|
-
transparent && "bg-transparent"
|
|
11034
|
-
)
|
|
11035
|
-
}
|
|
11036
|
-
);
|
|
11037
11102
|
var SegmentedControl = memoGeneric(function SegmentedControl2({
|
|
11038
11103
|
id: idProp,
|
|
11039
11104
|
value,
|
|
@@ -11041,7 +11106,6 @@ var SegmentedControl = memoGeneric(function SegmentedControl2({
|
|
|
11041
11106
|
colorScheme,
|
|
11042
11107
|
allowEmpty,
|
|
11043
11108
|
items,
|
|
11044
|
-
separator: separator2 = true,
|
|
11045
11109
|
className,
|
|
11046
11110
|
style: style2
|
|
11047
11111
|
}) {
|
|
@@ -11054,7 +11118,6 @@ var SegmentedControl = memoGeneric(function SegmentedControl2({
|
|
|
11054
11118
|
},
|
|
11055
11119
|
[allowEmpty, onValueChange]
|
|
11056
11120
|
);
|
|
11057
|
-
const selectedIndex = items.findIndex((item) => item?.value === value);
|
|
11058
11121
|
return /* @__PURE__ */ import_react78.default.createElement(SegmentedControlContext.Provider, { value: contextValue }, /* @__PURE__ */ import_react78.default.createElement(
|
|
11059
11122
|
ToggleGroupPrimitive2.Root,
|
|
11060
11123
|
{
|
|
@@ -11063,17 +11126,15 @@ var SegmentedControl = memoGeneric(function SegmentedControl2({
|
|
|
11063
11126
|
value,
|
|
11064
11127
|
onValueChange: handleValueChange,
|
|
11065
11128
|
className: cx(
|
|
11066
|
-
`
|
|
11129
|
+
`grid appearance-none relative outline-none min-h-input-height rounded bg-input-background py-0.5 px-0.5`,
|
|
11067
11130
|
className
|
|
11068
11131
|
),
|
|
11069
|
-
style:
|
|
11132
|
+
style: {
|
|
11133
|
+
...style2,
|
|
11134
|
+
gridTemplateColumns: `repeat(${items.length}, 1fr)`
|
|
11135
|
+
}
|
|
11070
11136
|
},
|
|
11071
|
-
|
|
11072
|
-
const isLastItem = index === items.length - 1;
|
|
11073
|
-
const currentValue = item?.value;
|
|
11074
|
-
const showSeparator = currentValue !== value && (selectedIndex === 0 && selectedIndex !== index ? true : index !== selectedIndex - 1);
|
|
11075
|
-
return /* @__PURE__ */ import_react78.default.createElement(import_react78.default.Fragment, { key: index }, /* @__PURE__ */ import_react78.default.createElement(SegmentedControlItem, { key: index, ...item }), !isLastItem && /* @__PURE__ */ import_react78.default.createElement(Separator3, { transparent: !showSeparator }));
|
|
11076
|
-
}) : items.map((item, index) => /* @__PURE__ */ import_react78.default.createElement(SegmentedControlItem, { key: index, ...item }))
|
|
11137
|
+
items.map((item, index) => /* @__PURE__ */ import_react78.default.createElement(SegmentedControlItem, { key: index, ...item }))
|
|
11077
11138
|
));
|
|
11078
11139
|
});
|
|
11079
11140
|
|
|
@@ -11093,45 +11154,51 @@ var createVirtualElement = (rect) => ({
|
|
|
11093
11154
|
toJSON: () => null
|
|
11094
11155
|
})
|
|
11095
11156
|
});
|
|
11096
|
-
var
|
|
11097
|
-
|
|
11098
|
-
|
|
11099
|
-
|
|
11100
|
-
|
|
11101
|
-
|
|
11102
|
-
|
|
11103
|
-
|
|
11104
|
-
|
|
11105
|
-
|
|
11106
|
-
|
|
11107
|
-
|
|
11108
|
-
|
|
11109
|
-
|
|
11110
|
-
|
|
11111
|
-
|
|
11112
|
-
collisionPadding: 10,
|
|
11113
|
-
"data-editor-overlay": true,
|
|
11114
|
-
contentEditable: false,
|
|
11115
|
-
style: {
|
|
11116
|
-
zIndex: 1e3,
|
|
11117
|
-
opacity: size2 ? 1 : 0,
|
|
11118
|
-
transition: "opacity 0.2s ease-in-out",
|
|
11119
|
-
["--n-input-background"]: "transparent"
|
|
11120
|
-
}
|
|
11121
|
-
},
|
|
11122
|
-
/* @__PURE__ */ import_react79.default.createElement(
|
|
11123
|
-
"div",
|
|
11157
|
+
var SelectionToolbarContainer = (0, import_react79.memo)(
|
|
11158
|
+
function SelectionToolbarContainer2({
|
|
11159
|
+
rect,
|
|
11160
|
+
children
|
|
11161
|
+
}) {
|
|
11162
|
+
const portalScopeId = usePortalScopeId();
|
|
11163
|
+
const containerRef = import_react79.default.useRef(null);
|
|
11164
|
+
const size2 = useSize(containerRef, "width");
|
|
11165
|
+
const virtualRef = (0, import_react79.useMemo)(
|
|
11166
|
+
() => ({
|
|
11167
|
+
current: createVirtualElement(rect)
|
|
11168
|
+
}),
|
|
11169
|
+
[rect]
|
|
11170
|
+
);
|
|
11171
|
+
return /* @__PURE__ */ import_react79.default.createElement(PopperPrimitive.Root, null, /* @__PURE__ */ import_react79.default.createElement(PopperPrimitive.Anchor, { virtualRef }), /* @__PURE__ */ import_react79.default.createElement(
|
|
11172
|
+
PopperPrimitive.Content,
|
|
11124
11173
|
{
|
|
11125
|
-
|
|
11126
|
-
|
|
11174
|
+
...portalScopeProps(portalScopeId),
|
|
11175
|
+
side: "top",
|
|
11176
|
+
sideOffset: 10,
|
|
11177
|
+
align: "center",
|
|
11178
|
+
avoidCollisions: true,
|
|
11179
|
+
collisionPadding: 10,
|
|
11180
|
+
contentEditable: false,
|
|
11181
|
+
style: {
|
|
11182
|
+
zIndex: 1e3,
|
|
11183
|
+
opacity: size2 ? 1 : 0,
|
|
11184
|
+
transition: "opacity 0.2s ease-in-out",
|
|
11185
|
+
["--n-input-background"]: "transparent"
|
|
11186
|
+
}
|
|
11127
11187
|
},
|
|
11128
|
-
/* @__PURE__ */ import_react79.default.createElement(
|
|
11129
|
-
|
|
11130
|
-
|
|
11131
|
-
|
|
11188
|
+
/* @__PURE__ */ import_react79.default.createElement(
|
|
11189
|
+
"div",
|
|
11190
|
+
{
|
|
11191
|
+
ref: containerRef,
|
|
11192
|
+
className: "flex gap-1 bg-popover-background rounded shadow-popover p-1"
|
|
11193
|
+
},
|
|
11194
|
+
children
|
|
11195
|
+
)
|
|
11196
|
+
));
|
|
11197
|
+
}
|
|
11198
|
+
);
|
|
11132
11199
|
|
|
11133
11200
|
// src/components/SelectMenu.tsx
|
|
11134
|
-
var
|
|
11201
|
+
var import_noya_icons10 = require("@noya-app/noya-icons");
|
|
11135
11202
|
var Select = __toESM(require("@radix-ui/react-select"));
|
|
11136
11203
|
var import_react80 = __toESM(require("react"));
|
|
11137
11204
|
var readOnlyStyle = {
|
|
@@ -11180,7 +11247,7 @@ var SelectMenuTrigger = memoGeneric(function SelectMenuTrigger2({
|
|
|
11180
11247
|
label && labelPosition === "inset" && /* @__PURE__ */ import_react80.default.createElement("div", { className: insetEndStyles }, /* @__PURE__ */ import_react80.default.createElement(Label, { className: "pr-4 text-text-disabled", htmlFor: id }, label)),
|
|
11181
11248
|
/* @__PURE__ */ import_react80.default.createElement("span", { className: "flex-1 flex" }, /* @__PURE__ */ import_react80.default.createElement(Select.Value, { placeholder })),
|
|
11182
11249
|
/* @__PURE__ */ import_react80.default.createElement(
|
|
11183
|
-
|
|
11250
|
+
import_noya_icons10.DropdownChevronIcon,
|
|
11184
11251
|
{
|
|
11185
11252
|
className: cx(
|
|
11186
11253
|
"transition-transform duration-100 ml-1.5",
|
|
@@ -11211,6 +11278,7 @@ var SelectMenu = memoGeneric(function SelectMenu2({
|
|
|
11211
11278
|
contentStyle: contentStyleProp,
|
|
11212
11279
|
...props
|
|
11213
11280
|
}) {
|
|
11281
|
+
const portalScopeId = usePortalScopeId();
|
|
11214
11282
|
const selectedItem = items.find(
|
|
11215
11283
|
(item) => isSelectableMenuItem(item) && item.value === value
|
|
11216
11284
|
);
|
|
@@ -11275,6 +11343,7 @@ var SelectMenu = memoGeneric(function SelectMenu2({
|
|
|
11275
11343
|
/* @__PURE__ */ import_react80.default.createElement(Select.Portal, null, /* @__PURE__ */ import_react80.default.createElement(
|
|
11276
11344
|
Select.Content,
|
|
11277
11345
|
{
|
|
11346
|
+
...portalScopeProps(portalScopeId),
|
|
11278
11347
|
className: styles.contentStyle,
|
|
11279
11348
|
position: "popper",
|
|
11280
11349
|
sideOffset: 6,
|
|
@@ -11283,13 +11352,13 @@ var SelectMenu = memoGeneric(function SelectMenu2({
|
|
|
11283
11352
|
style: contentStyle
|
|
11284
11353
|
},
|
|
11285
11354
|
/* @__PURE__ */ import_react80.default.createElement(Select.ScrollUpButton, { className: scrollButtonStyles }, /* @__PURE__ */ import_react80.default.createElement(
|
|
11286
|
-
|
|
11355
|
+
import_noya_icons10.ChevronUpIcon,
|
|
11287
11356
|
{
|
|
11288
11357
|
className: cx("transition-transform duration-100")
|
|
11289
11358
|
}
|
|
11290
11359
|
)),
|
|
11291
11360
|
/* @__PURE__ */ import_react80.default.createElement(Select.Viewport, null, /* @__PURE__ */ import_react80.default.createElement(MenuViewport, { items, Components: Components3 })),
|
|
11292
|
-
/* @__PURE__ */ import_react80.default.createElement(Select.ScrollDownButton, { className: scrollButtonStyles }, /* @__PURE__ */ import_react80.default.createElement(
|
|
11361
|
+
/* @__PURE__ */ import_react80.default.createElement(Select.ScrollDownButton, { className: scrollButtonStyles }, /* @__PURE__ */ import_react80.default.createElement(import_noya_icons10.ChevronDownIcon, null))
|
|
11293
11362
|
))
|
|
11294
11363
|
);
|
|
11295
11364
|
return readOnly ? readOnlyButton : content;
|
|
@@ -11375,7 +11444,7 @@ var Slider = (0, import_react81.memo)(function Slider2({
|
|
|
11375
11444
|
{
|
|
11376
11445
|
style: trackFillStyle,
|
|
11377
11446
|
className: cx(
|
|
11378
|
-
"absolute inset-0 w-full h-full rounded overflow-hidden",
|
|
11447
|
+
"absolute inset-0 w-full h-full rounded overflow-hidden bg-primary-pastel",
|
|
11379
11448
|
colorScheme === "primary" && "bg-primary",
|
|
11380
11449
|
colorScheme === "secondary" && "bg-secondary"
|
|
11381
11450
|
)
|
|
@@ -11399,7 +11468,7 @@ var Slider = (0, import_react81.memo)(function Slider2({
|
|
|
11399
11468
|
|
|
11400
11469
|
// src/components/Switch.tsx
|
|
11401
11470
|
var SwitchPrimitive = __toESM(require("@radix-ui/react-switch"));
|
|
11402
|
-
var
|
|
11471
|
+
var React78 = __toESM(require("react"));
|
|
11403
11472
|
var Switch = function Switch2({
|
|
11404
11473
|
id,
|
|
11405
11474
|
value,
|
|
@@ -11411,7 +11480,7 @@ var Switch = function Switch2({
|
|
|
11411
11480
|
style: style2,
|
|
11412
11481
|
className
|
|
11413
11482
|
}) {
|
|
11414
|
-
return /* @__PURE__ */
|
|
11483
|
+
return /* @__PURE__ */ React78.createElement(
|
|
11415
11484
|
SwitchPrimitive.Root,
|
|
11416
11485
|
{
|
|
11417
11486
|
id,
|
|
@@ -11430,7 +11499,7 @@ var Switch = function Switch2({
|
|
|
11430
11499
|
onFocus,
|
|
11431
11500
|
onBlur
|
|
11432
11501
|
},
|
|
11433
|
-
/* @__PURE__ */
|
|
11502
|
+
/* @__PURE__ */ React78.createElement(SwitchPrimitive.Thumb, { className: "block w-[15px] h-[15px] bg-background rounded-full transition-transform translate-x-[2px] data-[state=checked]:translate-x-[15px]" })
|
|
11434
11503
|
);
|
|
11435
11504
|
};
|
|
11436
11505
|
|
|
@@ -12220,11 +12289,11 @@ var SUPPORTED_CANVAS_UPLOAD_TYPES = [
|
|
|
12220
12289
|
|
|
12221
12290
|
// src/components/DimensionInput.tsx
|
|
12222
12291
|
var import_noya_utils12 = require("@noya-app/noya-utils");
|
|
12223
|
-
var
|
|
12292
|
+
var React84 = __toESM(require("react"));
|
|
12224
12293
|
function getNewValue(value, mode, delta) {
|
|
12225
12294
|
return delta === void 0 ? value : mode === "replace" ? delta : value + delta;
|
|
12226
12295
|
}
|
|
12227
|
-
var DimensionInput =
|
|
12296
|
+
var DimensionInput = React84.memo(function DimensionInput2({
|
|
12228
12297
|
id,
|
|
12229
12298
|
value,
|
|
12230
12299
|
onSetValue,
|
|
@@ -12234,15 +12303,15 @@ var DimensionInput = React83.memo(function DimensionInput2({
|
|
|
12234
12303
|
disabled,
|
|
12235
12304
|
trigger = "submit"
|
|
12236
12305
|
}) {
|
|
12237
|
-
const handleNudgeValue =
|
|
12306
|
+
const handleNudgeValue = React84.useCallback(
|
|
12238
12307
|
(value2) => onSetValue(value2, "adjust"),
|
|
12239
12308
|
[onSetValue]
|
|
12240
12309
|
);
|
|
12241
|
-
const handleSetValue =
|
|
12310
|
+
const handleSetValue = React84.useCallback(
|
|
12242
12311
|
(value2) => onSetValue(value2, "replace"),
|
|
12243
12312
|
[onSetValue]
|
|
12244
12313
|
);
|
|
12245
|
-
return /* @__PURE__ */
|
|
12314
|
+
return /* @__PURE__ */ React84.createElement(LabeledField, { label, labelPosition: "inset" }, /* @__PURE__ */ React84.createElement(InputField2.Root, { id, width: size2 }, /* @__PURE__ */ React84.createElement(
|
|
12246
12315
|
InputField2.NumberInput,
|
|
12247
12316
|
{
|
|
12248
12317
|
value: value === void 0 ? value : (0, import_noya_utils12.round)(value, 2),
|
|
@@ -12395,9 +12464,84 @@ function BaseToolbar({
|
|
|
12395
12464
|
}
|
|
12396
12465
|
|
|
12397
12466
|
// src/components/Toolbar.tsx
|
|
12398
|
-
var
|
|
12467
|
+
var import_noya_icons11 = require("@noya-app/noya-icons");
|
|
12399
12468
|
var import_noya_keymap7 = require("@noya-app/noya-keymap");
|
|
12400
12469
|
var import_react91 = __toESM(require("react"));
|
|
12470
|
+
var iconButtonStyle = {
|
|
12471
|
+
height: 27,
|
|
12472
|
+
width: 27,
|
|
12473
|
+
minWidth: 27
|
|
12474
|
+
};
|
|
12475
|
+
var ToolbarMenuDropdown = memoGeneric(function ToolbarMenuDropdown2({
|
|
12476
|
+
item,
|
|
12477
|
+
onSelectMenuItem
|
|
12478
|
+
}) {
|
|
12479
|
+
const [open, setOpen] = import_react91.default.useState(false);
|
|
12480
|
+
return /* @__PURE__ */ import_react91.default.createElement(
|
|
12481
|
+
DropdownMenu,
|
|
12482
|
+
{
|
|
12483
|
+
open,
|
|
12484
|
+
onOpenChange: setOpen,
|
|
12485
|
+
items: item.items,
|
|
12486
|
+
onSelect: (value) => {
|
|
12487
|
+
if (onSelectMenuItem && value) {
|
|
12488
|
+
onSelectMenuItem(value);
|
|
12489
|
+
}
|
|
12490
|
+
}
|
|
12491
|
+
},
|
|
12492
|
+
/* @__PURE__ */ import_react91.default.createElement(Button, { disabled: item.disabled, active: item.checked || open }, item.icon && renderIcon(item.icon), item.title && item.icon && /* @__PURE__ */ import_react91.default.createElement(Spacer.Horizontal, { inline: true, size: 6 }), item.title, /* @__PURE__ */ import_react91.default.createElement(Spacer.Horizontal, { inline: true, size: 6 }), /* @__PURE__ */ import_react91.default.createElement(import_noya_icons11.DropdownChevronIcon, null))
|
|
12493
|
+
);
|
|
12494
|
+
});
|
|
12495
|
+
var ToolbarMenuButton = memoGeneric(function ToolbarMenuButton2({
|
|
12496
|
+
item,
|
|
12497
|
+
onSelectMenuItem
|
|
12498
|
+
}) {
|
|
12499
|
+
const content = /* @__PURE__ */ import_react91.default.createElement(
|
|
12500
|
+
Button,
|
|
12501
|
+
{
|
|
12502
|
+
disabled: item.disabled,
|
|
12503
|
+
active: item.checked,
|
|
12504
|
+
style: item.icon && !item.title ? iconButtonStyle : void 0,
|
|
12505
|
+
onClick: () => {
|
|
12506
|
+
if (onSelectMenuItem && item.value) {
|
|
12507
|
+
onSelectMenuItem(item.value);
|
|
12508
|
+
}
|
|
12509
|
+
}
|
|
12510
|
+
},
|
|
12511
|
+
item.icon && renderIcon(item.icon),
|
|
12512
|
+
item.title && item.icon && /* @__PURE__ */ import_react91.default.createElement(Spacer.Horizontal, { inline: true, size: 6 }),
|
|
12513
|
+
item.title
|
|
12514
|
+
);
|
|
12515
|
+
return item.tooltip ? /* @__PURE__ */ import_react91.default.createElement(Tooltip, { sideOffset: 10, content: item.tooltip }, content) : content;
|
|
12516
|
+
});
|
|
12517
|
+
var ToolbarMenuItem = memoGeneric(function ToolbarMenuItem2({
|
|
12518
|
+
item,
|
|
12519
|
+
onSelectMenuItem
|
|
12520
|
+
}) {
|
|
12521
|
+
if (item.type === "sectionHeader") return null;
|
|
12522
|
+
if (item.type === "separator") {
|
|
12523
|
+
return /* @__PURE__ */ import_react91.default.createElement(DividerVertical, { overflow: 4 });
|
|
12524
|
+
}
|
|
12525
|
+
if (isSelectableMenuItem(item)) {
|
|
12526
|
+
return /* @__PURE__ */ import_react91.default.createElement(ToolbarMenuButton, { item, onSelectMenuItem });
|
|
12527
|
+
}
|
|
12528
|
+
return /* @__PURE__ */ import_react91.default.createElement(ToolbarMenuDropdown, { item, onSelectMenuItem });
|
|
12529
|
+
});
|
|
12530
|
+
var ToolbarMenu = memoGeneric(function ToolbarMenu2({
|
|
12531
|
+
items,
|
|
12532
|
+
onSelectMenuItem
|
|
12533
|
+
}) {
|
|
12534
|
+
return /* @__PURE__ */ import_react91.default.createElement(import_react91.default.Fragment, null, items.map((item, i) => {
|
|
12535
|
+
return /* @__PURE__ */ import_react91.default.createElement(
|
|
12536
|
+
ToolbarMenuItem,
|
|
12537
|
+
{
|
|
12538
|
+
key: i,
|
|
12539
|
+
item,
|
|
12540
|
+
onSelectMenuItem
|
|
12541
|
+
}
|
|
12542
|
+
);
|
|
12543
|
+
}));
|
|
12544
|
+
});
|
|
12401
12545
|
function Toolbar({
|
|
12402
12546
|
children,
|
|
12403
12547
|
logo,
|
|
@@ -12438,64 +12582,6 @@ function Toolbar({
|
|
|
12438
12582
|
children
|
|
12439
12583
|
);
|
|
12440
12584
|
}
|
|
12441
|
-
var activeButtonStyle = {
|
|
12442
|
-
backgroundColor: cssVars.colors.primaryPastel,
|
|
12443
|
-
color: cssVars.colors.primary
|
|
12444
|
-
};
|
|
12445
|
-
var ToolbarMenu = memoGeneric(function ToolbarMenu2({
|
|
12446
|
-
items,
|
|
12447
|
-
onSelectMenuItem
|
|
12448
|
-
}) {
|
|
12449
|
-
return /* @__PURE__ */ import_react91.default.createElement(import_react91.default.Fragment, null, items.map((item, i) => {
|
|
12450
|
-
if (item.type === "sectionHeader") return null;
|
|
12451
|
-
if (item.type === "separator") {
|
|
12452
|
-
return /* @__PURE__ */ import_react91.default.createElement(DividerVertical, { key: i, overflow: 4 });
|
|
12453
|
-
}
|
|
12454
|
-
if (isSelectableMenuItem(item)) {
|
|
12455
|
-
const content = /* @__PURE__ */ import_react91.default.createElement(
|
|
12456
|
-
Button,
|
|
12457
|
-
{
|
|
12458
|
-
key: i,
|
|
12459
|
-
disabled: item.disabled,
|
|
12460
|
-
style: item.checked ? activeButtonStyle : void 0,
|
|
12461
|
-
onClick: () => {
|
|
12462
|
-
if (onSelectMenuItem && item.value) {
|
|
12463
|
-
onSelectMenuItem(item.value);
|
|
12464
|
-
}
|
|
12465
|
-
}
|
|
12466
|
-
},
|
|
12467
|
-
item.title,
|
|
12468
|
-
item.title && item.icon && /* @__PURE__ */ import_react91.default.createElement(Spacer.Horizontal, { inline: true, size: 6 }),
|
|
12469
|
-
item.icon && renderIcon(item.icon)
|
|
12470
|
-
);
|
|
12471
|
-
return item.tooltip ? /* @__PURE__ */ import_react91.default.createElement(Tooltip, { sideOffset: 10, content: item.tooltip, key: i }, content) : content;
|
|
12472
|
-
}
|
|
12473
|
-
return /* @__PURE__ */ import_react91.default.createElement(
|
|
12474
|
-
DropdownMenu,
|
|
12475
|
-
{
|
|
12476
|
-
key: i,
|
|
12477
|
-
items: item.items,
|
|
12478
|
-
onSelect: (value) => {
|
|
12479
|
-
if (onSelectMenuItem && value) {
|
|
12480
|
-
onSelectMenuItem(value);
|
|
12481
|
-
}
|
|
12482
|
-
}
|
|
12483
|
-
},
|
|
12484
|
-
/* @__PURE__ */ import_react91.default.createElement(
|
|
12485
|
-
Button,
|
|
12486
|
-
{
|
|
12487
|
-
disabled: item.disabled,
|
|
12488
|
-
style: item.checked ? activeButtonStyle : void 0
|
|
12489
|
-
},
|
|
12490
|
-
item.title,
|
|
12491
|
-
item.title && item.icon && /* @__PURE__ */ import_react91.default.createElement(Spacer.Horizontal, { inline: true, size: 6 }),
|
|
12492
|
-
item.icon && renderIcon(item.icon),
|
|
12493
|
-
/* @__PURE__ */ import_react91.default.createElement(Spacer.Horizontal, { size: 6 }),
|
|
12494
|
-
/* @__PURE__ */ import_react91.default.createElement(import_noya_icons12.DropdownChevronIcon, null)
|
|
12495
|
-
)
|
|
12496
|
-
);
|
|
12497
|
-
}));
|
|
12498
|
-
});
|
|
12499
12585
|
// Annotate the CommonJS export names for ESM import in node:
|
|
12500
12586
|
0 && (module.exports = {
|
|
12501
12587
|
AIAssistantInput,
|
|
@@ -12585,6 +12671,7 @@ var ToolbarMenu = memoGeneric(function ToolbarMenu2({
|
|
|
12585
12671
|
PipelineResultLayout,
|
|
12586
12672
|
PipelineResultLink,
|
|
12587
12673
|
Popover,
|
|
12674
|
+
PortalScopeProvider,
|
|
12588
12675
|
Progress,
|
|
12589
12676
|
RIGHT_SIDEBAR_ID,
|
|
12590
12677
|
SUPPORTED_CANVAS_UPLOAD_TYPES,
|
|
@@ -12595,7 +12682,7 @@ var ToolbarMenu = memoGeneric(function ToolbarMenu2({
|
|
|
12595
12682
|
SectionHeader,
|
|
12596
12683
|
SegmentedControl,
|
|
12597
12684
|
SelectMenu,
|
|
12598
|
-
|
|
12685
|
+
SelectionToolbarContainer,
|
|
12599
12686
|
Slider,
|
|
12600
12687
|
Small,
|
|
12601
12688
|
Sortable,
|
|
@@ -12608,6 +12695,9 @@ var ToolbarMenu = memoGeneric(function ToolbarMenu2({
|
|
|
12608
12695
|
ToastProvider,
|
|
12609
12696
|
Toolbar,
|
|
12610
12697
|
ToolbarMenu,
|
|
12698
|
+
ToolbarMenuButton,
|
|
12699
|
+
ToolbarMenuDropdown,
|
|
12700
|
+
ToolbarMenuItem,
|
|
12611
12701
|
Tooltip,
|
|
12612
12702
|
TreeView,
|
|
12613
12703
|
UserAvatar,
|
|
@@ -12626,6 +12716,7 @@ var ToolbarMenu = memoGeneric(function ToolbarMenu2({
|
|
|
12626
12716
|
fuzzyFilter,
|
|
12627
12717
|
fuzzyScore,
|
|
12628
12718
|
fuzzyTokenize,
|
|
12719
|
+
getClosestPortalScope,
|
|
12629
12720
|
getFieldSpacing,
|
|
12630
12721
|
getGradientBackground,
|
|
12631
12722
|
getGridSize,
|
|
@@ -12645,6 +12736,9 @@ var ToolbarMenu = memoGeneric(function ToolbarMenu2({
|
|
|
12645
12736
|
moveTreeItem,
|
|
12646
12737
|
normalizeListTargetIndex,
|
|
12647
12738
|
popoverStyle,
|
|
12739
|
+
portalScopeDataSetName,
|
|
12740
|
+
portalScopePropName,
|
|
12741
|
+
portalScopeProps,
|
|
12648
12742
|
renderIcon,
|
|
12649
12743
|
rgbaToSketchColor,
|
|
12650
12744
|
separator,
|
|
@@ -12677,6 +12771,7 @@ var ToolbarMenu = memoGeneric(function ToolbarMenu2({
|
|
|
12677
12771
|
useOpenInputDialog,
|
|
12678
12772
|
usePlatform,
|
|
12679
12773
|
usePlatformModKey,
|
|
12774
|
+
usePortalScopeId,
|
|
12680
12775
|
usePreservePanelSize,
|
|
12681
12776
|
useTheme,
|
|
12682
12777
|
validateDropIndicator,
|