@noya-app/noya-designsystem 0.1.52 → 0.1.53
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +10 -10
- package/CHANGELOG.md +6 -0
- package/dist/index.d.mts +29 -6
- package/dist/index.d.ts +29 -6
- package/dist/index.js +324 -249
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +838 -771
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/components/Button.tsx +1 -1
- package/src/components/ColorSwatchControl.tsx +4 -6
- package/src/components/ContextMenu.tsx +10 -2
- package/src/components/DraggableMenuButton.tsx +17 -30
- package/src/components/DropdownMenu.tsx +7 -0
- package/src/components/Popover.tsx +7 -0
- package/src/components/SelectMenu.tsx +7 -0
- package/src/components/SelectionToolbar.tsx +51 -45
- package/src/components/Toolbar.tsx +78 -47
- package/src/components/Tooltip.tsx +7 -0
- package/src/components/internal/Menu.tsx +1 -1
- package/src/components/internal/MenuViewport.tsx +9 -1
- package/src/contexts/PortalScopeContext.tsx +48 -0
- package/src/index.tsx +1 -0
package/dist/index.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,8 @@ __export(src_exports, {
|
|
|
140
141
|
ToastProvider: () => ToastProvider,
|
|
141
142
|
Toolbar: () => Toolbar,
|
|
142
143
|
ToolbarMenu: () => ToolbarMenu,
|
|
144
|
+
ToolbarMenuButton: () => ToolbarMenuButton,
|
|
145
|
+
ToolbarMenuDropdown: () => ToolbarMenuDropdown,
|
|
143
146
|
Tooltip: () => Tooltip,
|
|
144
147
|
TreeView: () => TreeView,
|
|
145
148
|
UserAvatar: () => UserAvatar,
|
|
@@ -158,6 +161,7 @@ __export(src_exports, {
|
|
|
158
161
|
fuzzyFilter: () => fuzzyFilter,
|
|
159
162
|
fuzzyScore: () => fuzzyScore,
|
|
160
163
|
fuzzyTokenize: () => fuzzyTokenize,
|
|
164
|
+
getClosestPortalScope: () => getClosestPortalScope,
|
|
161
165
|
getFieldSpacing: () => getFieldSpacing,
|
|
162
166
|
getGradientBackground: () => getGradientBackground,
|
|
163
167
|
getGridSize: () => getGridSize,
|
|
@@ -177,6 +181,9 @@ __export(src_exports, {
|
|
|
177
181
|
moveTreeItem: () => moveTreeItem,
|
|
178
182
|
normalizeListTargetIndex: () => normalizeListTargetIndex,
|
|
179
183
|
popoverStyle: () => popoverStyle,
|
|
184
|
+
portalScopeDataSetName: () => portalScopeDataSetName,
|
|
185
|
+
portalScopePropName: () => portalScopePropName,
|
|
186
|
+
portalScopeProps: () => portalScopeProps,
|
|
180
187
|
renderIcon: () => renderIcon,
|
|
181
188
|
rgbaToSketchColor: () => rgbaToSketchColor,
|
|
182
189
|
separator: () => separator,
|
|
@@ -209,6 +216,7 @@ __export(src_exports, {
|
|
|
209
216
|
useOpenInputDialog: () => useOpenInputDialog,
|
|
210
217
|
usePlatform: () => usePlatform,
|
|
211
218
|
usePlatformModKey: () => usePlatformModKey,
|
|
219
|
+
usePortalScopeId: () => usePortalScopeId,
|
|
212
220
|
usePreservePanelSize: () => usePreservePanelSize,
|
|
213
221
|
useTheme: () => useTheme,
|
|
214
222
|
validateDropIndicator: () => validateDropIndicator,
|
|
@@ -631,20 +639,50 @@ var import_noya_keymap3 = require("@noya-app/noya-keymap");
|
|
|
631
639
|
var RadixDropdownMenu = __toESM(require("@radix-ui/react-dropdown-menu"));
|
|
632
640
|
var import_react35 = __toESM(require("react"));
|
|
633
641
|
|
|
642
|
+
// src/contexts/PortalScopeContext.tsx
|
|
643
|
+
var React5 = __toESM(require("react"));
|
|
644
|
+
var PortalScopeContext = React5.createContext(void 0);
|
|
645
|
+
var PortalScopeProvider = React5.memo(function PortalScopeProvider2({
|
|
646
|
+
children,
|
|
647
|
+
portalScopeId
|
|
648
|
+
}) {
|
|
649
|
+
return /* @__PURE__ */ React5.createElement(PortalScopeContext.Provider, { value: portalScopeId }, children);
|
|
650
|
+
});
|
|
651
|
+
function usePortalScopeId() {
|
|
652
|
+
return React5.useContext(PortalScopeContext) ?? "";
|
|
653
|
+
}
|
|
654
|
+
var portalScopeDataSetName = "noyaPortalScope";
|
|
655
|
+
var portalScopePropName = `data-noya-portal-scope`;
|
|
656
|
+
function portalScopeProps(id) {
|
|
657
|
+
return {
|
|
658
|
+
[portalScopePropName]: id
|
|
659
|
+
};
|
|
660
|
+
}
|
|
661
|
+
function getClosestPortalScope(element) {
|
|
662
|
+
if (!(element instanceof HTMLElement)) {
|
|
663
|
+
return;
|
|
664
|
+
}
|
|
665
|
+
const closest = element.closest(`[${portalScopePropName}]`);
|
|
666
|
+
if (!closest || !(closest instanceof HTMLElement)) {
|
|
667
|
+
return;
|
|
668
|
+
}
|
|
669
|
+
return closest.dataset[portalScopeDataSetName];
|
|
670
|
+
}
|
|
671
|
+
|
|
634
672
|
// src/components/internal/Menu.tsx
|
|
635
673
|
var import_noya_keymap2 = require("@noya-app/noya-keymap");
|
|
636
674
|
var import_react32 = __toESM(require("react"));
|
|
637
675
|
|
|
638
676
|
// src/contexts/DesignSystemConfiguration.tsx
|
|
639
677
|
var import_noya_keymap = require("@noya-app/noya-keymap");
|
|
640
|
-
var
|
|
678
|
+
var React21 = __toESM(require("react"));
|
|
641
679
|
|
|
642
680
|
// src/components/Toast.tsx
|
|
643
681
|
var ToastPrimitive = __toESM(require("@radix-ui/react-toast"));
|
|
644
682
|
var import_react21 = __toESM(require("react"));
|
|
645
683
|
|
|
646
684
|
// src/components/IconButton.tsx
|
|
647
|
-
var
|
|
685
|
+
var React10 = __toESM(require("react"));
|
|
648
686
|
|
|
649
687
|
// src/components/Button.tsx
|
|
650
688
|
var import_react20 = __toESM(require("react"));
|
|
@@ -714,7 +752,7 @@ function mergeConflictingClassNames(classNames, options) {
|
|
|
714
752
|
|
|
715
753
|
// src/components/Tooltip.tsx
|
|
716
754
|
var TooltipPrimitive = __toESM(require("@radix-ui/react-tooltip"));
|
|
717
|
-
var
|
|
755
|
+
var React7 = __toESM(require("react"));
|
|
718
756
|
|
|
719
757
|
// src/components/Text.tsx
|
|
720
758
|
var import_react19 = __toESM(require("react"));
|
|
@@ -810,14 +848,16 @@ var Italic = ({ children }) => /* @__PURE__ */ import_react19.default.createElem
|
|
|
810
848
|
);
|
|
811
849
|
|
|
812
850
|
// src/components/Tooltip.tsx
|
|
813
|
-
var Tooltip =
|
|
851
|
+
var Tooltip = React7.memo(function Tooltip2({
|
|
814
852
|
children,
|
|
815
853
|
content,
|
|
816
854
|
sideOffset = 2
|
|
817
855
|
}) {
|
|
818
|
-
|
|
856
|
+
const portalScopeId = usePortalScopeId();
|
|
857
|
+
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
858
|
TooltipPrimitive.Content,
|
|
820
859
|
{
|
|
860
|
+
...portalScopeProps(portalScopeId),
|
|
821
861
|
side: "bottom",
|
|
822
862
|
align: "center",
|
|
823
863
|
sideOffset,
|
|
@@ -866,7 +906,7 @@ var Button = (0, import_react20.forwardRef)(function Button2({
|
|
|
866
906
|
"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
907
|
disabled ? "opacity-25" : "",
|
|
868
908
|
!className?.includes("flex") ? "flex-none" : "",
|
|
869
|
-
active ? "bg-primary text-
|
|
909
|
+
active ? "bg-primary-pastel text-primary hover:bg-primary-pastel-light min-w-[31px]" : variantStyles[variant],
|
|
870
910
|
sizeStyles[variant === "thin" ? "thin" : variant === "floating" && size2 !== "small" ? "floating" : variant === "none" ? "none" : size2]
|
|
871
911
|
);
|
|
872
912
|
const buttonClassName = (0, import_react20.useMemo)(() => {
|
|
@@ -904,27 +944,27 @@ var Button_default = Button;
|
|
|
904
944
|
|
|
905
945
|
// src/components/Icons.tsx
|
|
906
946
|
var Icons = __toESM(require("@noya-app/noya-icons"));
|
|
907
|
-
var
|
|
947
|
+
var React9 = __toESM(require("react"));
|
|
908
948
|
function renderIcon(iconName) {
|
|
909
949
|
if (typeof iconName === "string") {
|
|
910
950
|
const Icon = Icons[iconName];
|
|
911
|
-
return /* @__PURE__ */
|
|
951
|
+
return /* @__PURE__ */ React9.createElement(Icon, null);
|
|
912
952
|
}
|
|
913
953
|
return iconName;
|
|
914
954
|
}
|
|
915
955
|
|
|
916
956
|
// src/components/IconButton.tsx
|
|
917
|
-
var IconButton =
|
|
918
|
-
|
|
957
|
+
var IconButton = React10.memo(
|
|
958
|
+
React10.forwardRef(function IconButton2({ selected, iconName, color, size: size2, contentStyle, ...props }, forwardedRef) {
|
|
919
959
|
const Icon = Icons[iconName];
|
|
920
|
-
const style2 =
|
|
960
|
+
const style2 = React10.useMemo(() => {
|
|
921
961
|
return {
|
|
922
962
|
padding: "0 2px",
|
|
923
963
|
...size2 && { minHeight: size2 },
|
|
924
964
|
...contentStyle
|
|
925
965
|
};
|
|
926
966
|
}, [contentStyle, size2]);
|
|
927
|
-
return /* @__PURE__ */
|
|
967
|
+
return /* @__PURE__ */ React10.createElement(Button, { ref: forwardedRef, ...props, variant: "none", contentStyle: style2 }, /* @__PURE__ */ React10.createElement(
|
|
928
968
|
Icon,
|
|
929
969
|
{
|
|
930
970
|
color: color ?? (selected ? cssVars.colors.iconSelected : cssVars.colors.icon),
|
|
@@ -975,10 +1015,10 @@ var DialogPrimitive = __toESM(require("@radix-ui/react-dialog"));
|
|
|
975
1015
|
var import_react22 = __toESM(require("react"));
|
|
976
1016
|
|
|
977
1017
|
// src/components/Spacer.tsx
|
|
978
|
-
var
|
|
979
|
-
var SpacerVertical =
|
|
1018
|
+
var React12 = __toESM(require("react"));
|
|
1019
|
+
var SpacerVertical = React12.forwardRef(
|
|
980
1020
|
({ size: size2, inline, ...props }, ref) => {
|
|
981
|
-
return /* @__PURE__ */
|
|
1021
|
+
return /* @__PURE__ */ React12.createElement(
|
|
982
1022
|
"span",
|
|
983
1023
|
{
|
|
984
1024
|
className: `${inline ? "inline-block" : "block"} ${size2 === void 0 ? "flex flex-1" : ""}`,
|
|
@@ -991,9 +1031,9 @@ var SpacerVertical = React11.forwardRef(
|
|
|
991
1031
|
);
|
|
992
1032
|
}
|
|
993
1033
|
);
|
|
994
|
-
var SpacerHorizontal =
|
|
1034
|
+
var SpacerHorizontal = React12.forwardRef(
|
|
995
1035
|
({ size: size2, inline, ...props }, ref) => {
|
|
996
|
-
return /* @__PURE__ */
|
|
1036
|
+
return /* @__PURE__ */ React12.createElement(
|
|
997
1037
|
"span",
|
|
998
1038
|
{
|
|
999
1039
|
className: `${inline ? "inline-block" : "block"} ${size2 === void 0 ? "flex flex-1" : ""}`,
|
|
@@ -1488,9 +1528,11 @@ function Popover({
|
|
|
1488
1528
|
onClickClose,
|
|
1489
1529
|
className
|
|
1490
1530
|
}) {
|
|
1531
|
+
const portalScopeId = usePortalScopeId();
|
|
1491
1532
|
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
1533
|
PopoverPrimitive.Content,
|
|
1493
1534
|
{
|
|
1535
|
+
...portalScopeProps(portalScopeId),
|
|
1494
1536
|
className: cx(
|
|
1495
1537
|
popoverStyle.base,
|
|
1496
1538
|
variant === "large" && popoverStyle.large,
|
|
@@ -2235,30 +2277,30 @@ var useCurrentFloatingWindowInternal = () => {
|
|
|
2235
2277
|
};
|
|
2236
2278
|
|
|
2237
2279
|
// src/contexts/DesignSystemConfiguration.tsx
|
|
2238
|
-
var DesignSystemConfigurationContext =
|
|
2280
|
+
var DesignSystemConfigurationContext = React21.createContext({
|
|
2239
2281
|
platform: "key"
|
|
2240
2282
|
});
|
|
2241
|
-
var DesignSystemConfigurationProvider =
|
|
2283
|
+
var DesignSystemConfigurationProvider = React21.memo(
|
|
2242
2284
|
function DesignSystemConfigurationProvider2({
|
|
2243
2285
|
children,
|
|
2244
2286
|
platform
|
|
2245
2287
|
}) {
|
|
2246
|
-
const [internalPlatform, setInternalPlatform] =
|
|
2247
|
-
|
|
2288
|
+
const [internalPlatform, setInternalPlatform] = React21.useState(platform ?? "key");
|
|
2289
|
+
React21.useEffect(() => {
|
|
2248
2290
|
if (platform !== void 0) return;
|
|
2249
2291
|
if (typeof navigator !== "undefined") {
|
|
2250
2292
|
setInternalPlatform((0, import_noya_keymap.getCurrentPlatform)(navigator));
|
|
2251
2293
|
}
|
|
2252
2294
|
}, [platform]);
|
|
2253
|
-
const contextValue =
|
|
2295
|
+
const contextValue = React21.useMemo(
|
|
2254
2296
|
() => ({ platform: platform ?? internalPlatform }),
|
|
2255
2297
|
[platform, internalPlatform]
|
|
2256
2298
|
);
|
|
2257
|
-
return /* @__PURE__ */
|
|
2299
|
+
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
2300
|
}
|
|
2259
2301
|
);
|
|
2260
2302
|
function useDesignSystemConfiguration() {
|
|
2261
|
-
return
|
|
2303
|
+
return React21.useContext(DesignSystemConfigurationContext);
|
|
2262
2304
|
}
|
|
2263
2305
|
|
|
2264
2306
|
// src/utils/withSeparatorElements.ts
|
|
@@ -2488,6 +2530,7 @@ var MenuViewport = ({
|
|
|
2488
2530
|
Components: Components4,
|
|
2489
2531
|
onSelect
|
|
2490
2532
|
}) => {
|
|
2533
|
+
const portalScopeId = usePortalScopeId();
|
|
2491
2534
|
const hasCheckedItem = items.some(
|
|
2492
2535
|
(item) => item.type !== "separator" && item.type !== "sectionHeader" && item.checked
|
|
2493
2536
|
);
|
|
@@ -2524,7 +2567,8 @@ var MenuViewport = ({
|
|
|
2524
2567
|
onClick: (e) => {
|
|
2525
2568
|
e.stopPropagation();
|
|
2526
2569
|
e.preventDefault();
|
|
2527
|
-
}
|
|
2570
|
+
},
|
|
2571
|
+
disabled: item.disabled
|
|
2528
2572
|
},
|
|
2529
2573
|
/* @__PURE__ */ import_react34.default.createElement(
|
|
2530
2574
|
SelectItem,
|
|
@@ -2543,6 +2587,7 @@ var MenuViewport = ({
|
|
|
2543
2587
|
), /* @__PURE__ */ import_react34.default.createElement(Components4.Portal, null, /* @__PURE__ */ import_react34.default.createElement(
|
|
2544
2588
|
Components4.SubContent,
|
|
2545
2589
|
{
|
|
2590
|
+
...portalScopeProps(portalScopeId),
|
|
2546
2591
|
alignOffset: -5,
|
|
2547
2592
|
className: styles.contentStyle
|
|
2548
2593
|
},
|
|
@@ -2606,6 +2651,7 @@ var DropdownMenuRoot = forwardRefGeneric(function DropdownMenuRoot2(props, forwa
|
|
|
2606
2651
|
emptyState,
|
|
2607
2652
|
contentStyle
|
|
2608
2653
|
} = props;
|
|
2654
|
+
const portalScopeId = usePortalScopeId();
|
|
2609
2655
|
const keymap = (0, import_react35.useMemo)(
|
|
2610
2656
|
() => shouldBindKeyboardShortcuts === false ? {} : getKeyboardShortcutsForMenuItems(items, onSelect),
|
|
2611
2657
|
[items, onSelect, shouldBindKeyboardShortcuts]
|
|
@@ -2629,6 +2675,7 @@ var DropdownMenuRoot = forwardRefGeneric(function DropdownMenuRoot2(props, forwa
|
|
|
2629
2675
|
), /* @__PURE__ */ import_react35.default.createElement(RadixDropdownMenu.Portal, null, /* @__PURE__ */ import_react35.default.createElement(
|
|
2630
2676
|
RadixDropdownMenu.Content,
|
|
2631
2677
|
{
|
|
2678
|
+
...portalScopeProps(portalScopeId),
|
|
2632
2679
|
className: styles.contentStyle,
|
|
2633
2680
|
side,
|
|
2634
2681
|
sideOffset,
|
|
@@ -2691,16 +2738,16 @@ var ActionMenu = memoGeneric(function ActionMenu2({
|
|
|
2691
2738
|
});
|
|
2692
2739
|
|
|
2693
2740
|
// src/components/ActivityIndicator.tsx
|
|
2694
|
-
var
|
|
2695
|
-
var ActivityIndicator =
|
|
2741
|
+
var React27 = __toESM(require("react"));
|
|
2742
|
+
var ActivityIndicator = React27.memo(function ActivityIndicator2({
|
|
2696
2743
|
size: size2 = 16,
|
|
2697
2744
|
opacity = 1,
|
|
2698
2745
|
color = "black",
|
|
2699
2746
|
trackColor = "rgba(0, 0, 0, 0.1)",
|
|
2700
2747
|
className
|
|
2701
2748
|
}) {
|
|
2702
|
-
const opacityStyle =
|
|
2703
|
-
const dynamicStyles =
|
|
2749
|
+
const opacityStyle = React27.useMemo(() => ({ opacity }), [opacity]);
|
|
2750
|
+
const dynamicStyles = React27.useMemo(
|
|
2704
2751
|
() => ({
|
|
2705
2752
|
border: `2px solid ${trackColor}`,
|
|
2706
2753
|
borderTopColor: color,
|
|
@@ -2709,13 +2756,13 @@ var ActivityIndicator = React26.memo(function ActivityIndicator2({
|
|
|
2709
2756
|
}),
|
|
2710
2757
|
[size2, color, trackColor]
|
|
2711
2758
|
);
|
|
2712
|
-
return /* @__PURE__ */
|
|
2759
|
+
return /* @__PURE__ */ React27.createElement(
|
|
2713
2760
|
"div",
|
|
2714
2761
|
{
|
|
2715
2762
|
className: cx("flex justify-center items-center", className),
|
|
2716
2763
|
style: opacityStyle
|
|
2717
2764
|
},
|
|
2718
|
-
/* @__PURE__ */
|
|
2765
|
+
/* @__PURE__ */ React27.createElement("div", { style: dynamicStyles, className: "animate-spin rounded-[50%]" })
|
|
2719
2766
|
);
|
|
2720
2767
|
});
|
|
2721
2768
|
|
|
@@ -3361,16 +3408,16 @@ var BreadcrumbSlash = () => {
|
|
|
3361
3408
|
};
|
|
3362
3409
|
|
|
3363
3410
|
// src/components/Checkbox.tsx
|
|
3364
|
-
var
|
|
3411
|
+
var React35 = __toESM(require("react"));
|
|
3365
3412
|
var colorSchemeStyles = {
|
|
3366
3413
|
normal: "text-text-subtle",
|
|
3367
3414
|
primary: "text-primary",
|
|
3368
3415
|
secondary: "text-secondary"
|
|
3369
3416
|
};
|
|
3370
|
-
var Checkbox =
|
|
3371
|
-
|
|
3417
|
+
var Checkbox = React35.memo(
|
|
3418
|
+
React35.forwardRef(function Checkbox2({ className, style: style2, colorScheme = "secondary", ...props }, ref) {
|
|
3372
3419
|
const { fieldId: id } = useLabel({ fieldId: props.id });
|
|
3373
|
-
return /* @__PURE__ */
|
|
3420
|
+
return /* @__PURE__ */ React35.createElement(
|
|
3374
3421
|
"div",
|
|
3375
3422
|
{
|
|
3376
3423
|
className: cx(
|
|
@@ -3380,7 +3427,7 @@ var Checkbox = React34.memo(
|
|
|
3380
3427
|
),
|
|
3381
3428
|
style: style2
|
|
3382
3429
|
},
|
|
3383
|
-
/* @__PURE__ */
|
|
3430
|
+
/* @__PURE__ */ React35.createElement(
|
|
3384
3431
|
"input",
|
|
3385
3432
|
{
|
|
3386
3433
|
ref,
|
|
@@ -3409,7 +3456,7 @@ var Checkbox = React34.memo(
|
|
|
3409
3456
|
id
|
|
3410
3457
|
}
|
|
3411
3458
|
),
|
|
3412
|
-
/* @__PURE__ */
|
|
3459
|
+
/* @__PURE__ */ React35.createElement(
|
|
3413
3460
|
"svg",
|
|
3414
3461
|
{
|
|
3415
3462
|
className: `
|
|
@@ -3429,7 +3476,7 @@ var Checkbox = React34.memo(
|
|
|
3429
3476
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3430
3477
|
"aria-hidden": "true"
|
|
3431
3478
|
},
|
|
3432
|
-
/* @__PURE__ */
|
|
3479
|
+
/* @__PURE__ */ React35.createElement(
|
|
3433
3480
|
"path",
|
|
3434
3481
|
{
|
|
3435
3482
|
d: "M3 6L4.5 7.5L8 4",
|
|
@@ -3448,7 +3495,7 @@ var import_noya_icons4 = require("@noya-app/noya-icons");
|
|
|
3448
3495
|
var import_react45 = __toESM(require("react"));
|
|
3449
3496
|
|
|
3450
3497
|
// src/hooks/useHover.ts
|
|
3451
|
-
var
|
|
3498
|
+
var React36 = __toESM(require("react"));
|
|
3452
3499
|
var globalIgnoreEmulatedMouseEvents = false;
|
|
3453
3500
|
var hoverCount = 0;
|
|
3454
3501
|
function setGlobalIgnoreEmulatedMouseEvents() {
|
|
@@ -3478,13 +3525,13 @@ function setupGlobalTouchEvents() {
|
|
|
3478
3525
|
}
|
|
3479
3526
|
function useHover(props = {}) {
|
|
3480
3527
|
const { onHoverStart, onHoverChange, onHoverEnd, isDisabled } = props;
|
|
3481
|
-
const [isHovered, setHovered] =
|
|
3482
|
-
const state =
|
|
3528
|
+
const [isHovered, setHovered] = React36.useState(false);
|
|
3529
|
+
const state = React36.useRef({
|
|
3483
3530
|
isHovered: false,
|
|
3484
3531
|
ignoreEmulatedMouseEvents: false
|
|
3485
3532
|
}).current;
|
|
3486
|
-
|
|
3487
|
-
const hoverProps =
|
|
3533
|
+
React36.useEffect(setupGlobalTouchEvents, []);
|
|
3534
|
+
const hoverProps = React36.useMemo(
|
|
3488
3535
|
function getHoverProps() {
|
|
3489
3536
|
function triggerHoverStart(event, pointerType) {
|
|
3490
3537
|
if (isDisabled || pointerType === "touch" || state.isHovered) {
|
|
@@ -3851,6 +3898,7 @@ function ContextMenuRoot({
|
|
|
3851
3898
|
() => shouldBindKeyboardShortcuts === false ? {} : getKeyboardShortcutsForMenuItems(items, onSelect),
|
|
3852
3899
|
[items, onSelect, shouldBindKeyboardShortcuts]
|
|
3853
3900
|
);
|
|
3901
|
+
const portalScopeId = usePortalScopeId();
|
|
3854
3902
|
(0, import_noya_keymap4.useKeyboardShortcuts)(keymap);
|
|
3855
3903
|
const onPointerDown = (0, import_react47.useCallback)((event) => {
|
|
3856
3904
|
event.preventDefault();
|
|
@@ -3862,39 +3910,46 @@ function ContextMenuRoot({
|
|
|
3862
3910
|
},
|
|
3863
3911
|
[onSelect]
|
|
3864
3912
|
);
|
|
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
|
-
|
|
3913
|
+
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(
|
|
3914
|
+
RadixContextMenu.Content,
|
|
3867
3915
|
{
|
|
3868
|
-
|
|
3869
|
-
|
|
3870
|
-
|
|
3871
|
-
|
|
3872
|
-
|
|
3916
|
+
...portalScopeProps(portalScopeId),
|
|
3917
|
+
className: styles.contentStyle
|
|
3918
|
+
},
|
|
3919
|
+
/* @__PURE__ */ import_react47.default.createElement(
|
|
3920
|
+
MenuViewport,
|
|
3921
|
+
{
|
|
3922
|
+
items,
|
|
3923
|
+
Components: Components2,
|
|
3924
|
+
onSelect: handleSelectItem
|
|
3925
|
+
}
|
|
3926
|
+
)
|
|
3927
|
+
)));
|
|
3873
3928
|
}
|
|
3874
3929
|
var ContextMenu = memoGeneric(ContextMenuRoot);
|
|
3875
3930
|
|
|
3876
3931
|
// src/components/ScrollArea.tsx
|
|
3877
3932
|
var RadixScrollArea = __toESM(require("@radix-ui/react-scroll-area"));
|
|
3878
|
-
var
|
|
3879
|
-
var ScrollArea =
|
|
3880
|
-
const [scrollElementRef, setScrollElementRef] =
|
|
3881
|
-
return /* @__PURE__ */
|
|
3933
|
+
var React40 = __toESM(require("react"));
|
|
3934
|
+
var ScrollArea = React40.memo(function ScrollArea2({ children }) {
|
|
3935
|
+
const [scrollElementRef, setScrollElementRef] = React40.useState(null);
|
|
3936
|
+
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
3937
|
RadixScrollArea.Viewport,
|
|
3883
3938
|
{
|
|
3884
3939
|
className: "w-full h-full [&>div]:block",
|
|
3885
|
-
ref:
|
|
3940
|
+
ref: React40.useCallback(
|
|
3886
3941
|
(ref) => setScrollElementRef(ref),
|
|
3887
3942
|
[]
|
|
3888
3943
|
)
|
|
3889
3944
|
},
|
|
3890
3945
|
typeof children === "function" ? scrollElementRef ? children(scrollElementRef) : null : children
|
|
3891
|
-
), /* @__PURE__ */
|
|
3946
|
+
), /* @__PURE__ */ React40.createElement(
|
|
3892
3947
|
RadixScrollArea.Scrollbar,
|
|
3893
3948
|
{
|
|
3894
3949
|
orientation: "vertical",
|
|
3895
3950
|
className: "scroll-component flex p-[3px] data-[orientation=vertical]:w-[10px]"
|
|
3896
3951
|
},
|
|
3897
|
-
/* @__PURE__ */
|
|
3952
|
+
/* @__PURE__ */ React40.createElement(RadixScrollArea.Thumb, { className: "scroll-component flex-1 rounded-[10px] bg-scrollbar" })
|
|
3898
3953
|
)));
|
|
3899
3954
|
});
|
|
3900
3955
|
|
|
@@ -4423,7 +4478,7 @@ function mergeEventHandlers(...handlerMaps) {
|
|
|
4423
4478
|
// src/components/Sortable.tsx
|
|
4424
4479
|
var import_core = require("@dnd-kit/core");
|
|
4425
4480
|
var import_sortable = require("@dnd-kit/sortable");
|
|
4426
|
-
var
|
|
4481
|
+
var React43 = __toESM(require("react"));
|
|
4427
4482
|
var import_react50 = require("react");
|
|
4428
4483
|
var import_react_dom2 = require("react-dom");
|
|
4429
4484
|
var normalizeListTargetIndex = (index, position) => {
|
|
@@ -4437,7 +4492,7 @@ var defaultAcceptsDrop = (sourceIndex, targetIndex, position) => {
|
|
|
4437
4492
|
}
|
|
4438
4493
|
return true;
|
|
4439
4494
|
};
|
|
4440
|
-
var SortableItemContext =
|
|
4495
|
+
var SortableItemContext = React43.createContext({
|
|
4441
4496
|
keys: [],
|
|
4442
4497
|
acceptsDrop: defaultAcceptsDrop,
|
|
4443
4498
|
axis: "y",
|
|
@@ -4492,7 +4547,7 @@ function SortableItem({
|
|
|
4492
4547
|
setActivatorEvent,
|
|
4493
4548
|
axis,
|
|
4494
4549
|
getDropTargetParentIndex
|
|
4495
|
-
} =
|
|
4550
|
+
} = React43.useContext(SortableItemContext);
|
|
4496
4551
|
const sortable = (0, import_sortable.useSortable)({ id, disabled });
|
|
4497
4552
|
const { activatorEvent } = (0, import_core.useDndContext)();
|
|
4498
4553
|
const {
|
|
@@ -4513,7 +4568,7 @@ function SortableItem({
|
|
|
4513
4568
|
const eventY = activatorEvent?.clientY ?? 0;
|
|
4514
4569
|
const offsetLeft = eventX + position.x;
|
|
4515
4570
|
const offsetTop = eventY + position.y;
|
|
4516
|
-
const ref =
|
|
4571
|
+
const ref = React43.useCallback((node) => setNodeRef(node), [setNodeRef]);
|
|
4517
4572
|
const parentIndex = overIndex === -1 ? void 0 : getDropTargetParentIndex?.(overIndex);
|
|
4518
4573
|
const isValidParent = parentIndex === void 0 || parentIndex === -1 ? false : acceptsDrop2(activeIndex, parentIndex, "inside");
|
|
4519
4574
|
const overIdAcceptsDrop = overIndex === -1 ? void 0 : acceptsDrop2(activeIndex, overIndex, "inside");
|
|
@@ -4550,26 +4605,26 @@ function SortableRoot({
|
|
|
4550
4605
|
}
|
|
4551
4606
|
})
|
|
4552
4607
|
);
|
|
4553
|
-
const [activeIndex, setActiveIndex] =
|
|
4554
|
-
const activatorEvent =
|
|
4555
|
-
const [position, setPosition] =
|
|
4608
|
+
const [activeIndex, setActiveIndex] = React43.useState();
|
|
4609
|
+
const activatorEvent = React43.useRef(null);
|
|
4610
|
+
const [position, setPosition] = React43.useState({
|
|
4556
4611
|
x: 0,
|
|
4557
4612
|
y: 0
|
|
4558
4613
|
});
|
|
4559
|
-
const setActivatorEvent =
|
|
4614
|
+
const setActivatorEvent = React43.useCallback((event) => {
|
|
4560
4615
|
activatorEvent.current = event;
|
|
4561
4616
|
}, []);
|
|
4562
|
-
const handleDragStart =
|
|
4617
|
+
const handleDragStart = React43.useCallback(
|
|
4563
4618
|
(event) => {
|
|
4564
4619
|
const index = keys.findIndex((id) => id === event.active.id);
|
|
4565
4620
|
setActiveIndex(index);
|
|
4566
4621
|
},
|
|
4567
4622
|
[keys]
|
|
4568
4623
|
);
|
|
4569
|
-
const handleDragMove =
|
|
4624
|
+
const handleDragMove = React43.useCallback((event) => {
|
|
4570
4625
|
setPosition({ ...event.delta });
|
|
4571
4626
|
}, []);
|
|
4572
|
-
const handleDragEnd =
|
|
4627
|
+
const handleDragEnd = React43.useCallback(
|
|
4573
4628
|
(event) => {
|
|
4574
4629
|
const { active, over } = event;
|
|
4575
4630
|
setActiveIndex(void 0);
|
|
@@ -4596,14 +4651,14 @@ function SortableRoot({
|
|
|
4596
4651
|
},
|
|
4597
4652
|
[acceptsDrop2, axis, keys, onMoveItem, position.x, position.y]
|
|
4598
4653
|
);
|
|
4599
|
-
const [mounted, setMounted] =
|
|
4600
|
-
|
|
4654
|
+
const [mounted, setMounted] = React43.useState(false);
|
|
4655
|
+
React43.useEffect(() => {
|
|
4601
4656
|
setMounted(true);
|
|
4602
4657
|
}, []);
|
|
4603
|
-
return /* @__PURE__ */
|
|
4658
|
+
return /* @__PURE__ */ React43.createElement(
|
|
4604
4659
|
SortableItemContext.Provider,
|
|
4605
4660
|
{
|
|
4606
|
-
value:
|
|
4661
|
+
value: React43.useMemo(
|
|
4607
4662
|
() => ({
|
|
4608
4663
|
keys,
|
|
4609
4664
|
acceptsDrop: acceptsDrop2,
|
|
@@ -4622,7 +4677,7 @@ function SortableRoot({
|
|
|
4622
4677
|
]
|
|
4623
4678
|
)
|
|
4624
4679
|
},
|
|
4625
|
-
/* @__PURE__ */
|
|
4680
|
+
/* @__PURE__ */ React43.createElement(
|
|
4626
4681
|
import_core.DndContext,
|
|
4627
4682
|
{
|
|
4628
4683
|
sensors,
|
|
@@ -4631,7 +4686,7 @@ function SortableRoot({
|
|
|
4631
4686
|
onDragMove: handleDragMove,
|
|
4632
4687
|
onDragEnd: handleDragEnd
|
|
4633
4688
|
},
|
|
4634
|
-
/* @__PURE__ */
|
|
4689
|
+
/* @__PURE__ */ React43.createElement(
|
|
4635
4690
|
import_sortable.SortableContext,
|
|
4636
4691
|
{
|
|
4637
4692
|
items: keys,
|
|
@@ -4640,7 +4695,7 @@ function SortableRoot({
|
|
|
4640
4695
|
children
|
|
4641
4696
|
),
|
|
4642
4697
|
mounted && renderOverlay && (0, import_react_dom2.createPortal)(
|
|
4643
|
-
/* @__PURE__ */
|
|
4698
|
+
/* @__PURE__ */ React43.createElement(import_core.DragOverlay, { dropAnimation: null }, activeIndex !== void 0 && activeIndex >= 0 && renderOverlay(activeIndex)),
|
|
4644
4699
|
document.body
|
|
4645
4700
|
)
|
|
4646
4701
|
)
|
|
@@ -4658,11 +4713,11 @@ var SortableComponent = memoGeneric(function Sortable(props) {
|
|
|
4658
4713
|
shouldRenderOverlay = true,
|
|
4659
4714
|
...rest
|
|
4660
4715
|
} = props;
|
|
4661
|
-
const keys =
|
|
4716
|
+
const keys = React43.useMemo(
|
|
4662
4717
|
() => items.map(keyExtractor),
|
|
4663
4718
|
[items, keyExtractor]
|
|
4664
4719
|
);
|
|
4665
|
-
const renderOverlay =
|
|
4720
|
+
const renderOverlay = React43.useCallback(
|
|
4666
4721
|
(index) => {
|
|
4667
4722
|
return renderItem(
|
|
4668
4723
|
items[index],
|
|
@@ -4682,14 +4737,14 @@ var SortableComponent = memoGeneric(function Sortable(props) {
|
|
|
4682
4737
|
},
|
|
4683
4738
|
[renderItem, items]
|
|
4684
4739
|
);
|
|
4685
|
-
return /* @__PURE__ */
|
|
4740
|
+
return /* @__PURE__ */ React43.createElement(
|
|
4686
4741
|
SortableSubcomponents.Root,
|
|
4687
4742
|
{
|
|
4688
4743
|
...rest,
|
|
4689
4744
|
keys,
|
|
4690
4745
|
renderOverlay: shouldRenderOverlay ? renderOverlay : void 0
|
|
4691
4746
|
},
|
|
4692
|
-
keys.map((key, index) => /* @__PURE__ */
|
|
4747
|
+
keys.map((key, index) => /* @__PURE__ */ React43.createElement(SortableSubcomponents.Item, { key, id: key }, (props2) => {
|
|
4693
4748
|
return renderItem(
|
|
4694
4749
|
items[index],
|
|
4695
4750
|
props2,
|
|
@@ -5797,23 +5852,25 @@ function ColorSwatchControl(props) {
|
|
|
5797
5852
|
checked: value === option
|
|
5798
5853
|
}
|
|
5799
5854
|
);
|
|
5800
|
-
return
|
|
5855
|
+
return /* @__PURE__ */ import_react56.default.createElement(
|
|
5801
5856
|
ToggleGroupPrimitive.Item,
|
|
5802
5857
|
{
|
|
5803
5858
|
asChild: true,
|
|
5804
5859
|
value: option,
|
|
5805
|
-
key: option
|
|
5860
|
+
key: option,
|
|
5861
|
+
disabled: readOnly
|
|
5806
5862
|
},
|
|
5807
5863
|
item
|
|
5808
5864
|
);
|
|
5809
5865
|
}));
|
|
5810
|
-
return
|
|
5866
|
+
return /* @__PURE__ */ import_react56.default.createElement(
|
|
5811
5867
|
ToggleGroupPrimitive.Root,
|
|
5812
5868
|
{
|
|
5813
5869
|
type: "single",
|
|
5814
5870
|
value,
|
|
5815
5871
|
onValueChange,
|
|
5816
|
-
className: "w-full"
|
|
5872
|
+
className: "w-full",
|
|
5873
|
+
disabled: readOnly
|
|
5817
5874
|
},
|
|
5818
5875
|
content
|
|
5819
5876
|
);
|
|
@@ -6940,29 +6997,13 @@ var ConnectedUsersMenuLayout = ({
|
|
|
6940
6997
|
// src/components/DraggableMenuButton.tsx
|
|
6941
6998
|
var import_noya_icons8 = require("@noya-app/noya-icons");
|
|
6942
6999
|
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
7000
|
var DraggableMenuButton = memoGeneric(function DraggableMenuButton2({
|
|
6963
7001
|
items,
|
|
6964
7002
|
onSelect,
|
|
6965
|
-
|
|
7003
|
+
onClick,
|
|
7004
|
+
isVisible = true,
|
|
7005
|
+
className,
|
|
7006
|
+
style: style2
|
|
6966
7007
|
}) {
|
|
6967
7008
|
const [open, setOpen] = (0, import_react64.useState)(false);
|
|
6968
7009
|
const [downPosition, setDownPosition] = (0, import_react64.useState)(null);
|
|
@@ -7002,13 +7043,19 @@ var DraggableMenuButton = memoGeneric(function DraggableMenuButton2({
|
|
|
7002
7043
|
[setOpen]
|
|
7003
7044
|
);
|
|
7004
7045
|
return /* @__PURE__ */ import_react64.default.createElement(
|
|
7005
|
-
|
|
7046
|
+
"div",
|
|
7006
7047
|
{
|
|
7048
|
+
className: cx(
|
|
7049
|
+
"cursor-pointer rounded flex items-center justify-center py-[2px] hover:bg-input-background-light active:bg-active-background ",
|
|
7050
|
+
className
|
|
7051
|
+
),
|
|
7052
|
+
style: style2,
|
|
7007
7053
|
onPointerDownCapture: handlePointerDownCapture,
|
|
7008
7054
|
onPointerUp: handlePointerUp,
|
|
7009
7055
|
onClick: (event) => {
|
|
7010
7056
|
event.stopPropagation();
|
|
7011
7057
|
event.preventDefault();
|
|
7058
|
+
onClick?.();
|
|
7012
7059
|
}
|
|
7013
7060
|
},
|
|
7014
7061
|
items && onSelect ? /* @__PURE__ */ import_react64.default.createElement(
|
|
@@ -7020,7 +7067,7 @@ var DraggableMenuButton = memoGeneric(function DraggableMenuButton2({
|
|
|
7020
7067
|
onSelect,
|
|
7021
7068
|
shouldBindKeyboardShortcuts: false
|
|
7022
7069
|
},
|
|
7023
|
-
/* @__PURE__ */ import_react64.default.createElement(
|
|
7070
|
+
/* @__PURE__ */ import_react64.default.createElement("div", { className: "pointer-events-none h-[15px]" }, /* @__PURE__ */ import_react64.default.createElement(
|
|
7024
7071
|
import_noya_icons8.DragHandleDots2Icon,
|
|
7025
7072
|
{
|
|
7026
7073
|
color: isVisible || open ? cssVars.colors.icon : "transparent"
|
|
@@ -7037,10 +7084,10 @@ var DraggableMenuButton = memoGeneric(function DraggableMenuButton2({
|
|
|
7037
7084
|
|
|
7038
7085
|
// src/components/Drawer.tsx
|
|
7039
7086
|
var Dialog3 = __toESM(require("@radix-ui/react-dialog"));
|
|
7040
|
-
var
|
|
7087
|
+
var React57 = __toESM(require("react"));
|
|
7041
7088
|
var import_react65 = require("react");
|
|
7042
|
-
var Drawer =
|
|
7043
|
-
|
|
7089
|
+
var Drawer = React57.memo(
|
|
7090
|
+
React57.forwardRef(function Drawer2({
|
|
7044
7091
|
open,
|
|
7045
7092
|
onOpenChange,
|
|
7046
7093
|
trigger,
|
|
@@ -7070,7 +7117,7 @@ var Drawer = React56.memo(
|
|
|
7070
7117
|
return internalOpen;
|
|
7071
7118
|
}
|
|
7072
7119
|
}));
|
|
7073
|
-
const inner = /* @__PURE__ */
|
|
7120
|
+
const inner = /* @__PURE__ */ React57.createElement(React57.Fragment, null, /* @__PURE__ */ React57.createElement(
|
|
7074
7121
|
Dialog3.Overlay,
|
|
7075
7122
|
{
|
|
7076
7123
|
className: cx(
|
|
@@ -7078,7 +7125,7 @@ var Drawer = React56.memo(
|
|
|
7078
7125
|
positioning === "absolute" ? "absolute" : "fixed"
|
|
7079
7126
|
)
|
|
7080
7127
|
}
|
|
7081
|
-
), /* @__PURE__ */
|
|
7128
|
+
), /* @__PURE__ */ React57.createElement(
|
|
7082
7129
|
Dialog3.Content,
|
|
7083
7130
|
{
|
|
7084
7131
|
id,
|
|
@@ -7090,18 +7137,18 @@ var Drawer = React56.memo(
|
|
|
7090
7137
|
className
|
|
7091
7138
|
)
|
|
7092
7139
|
},
|
|
7093
|
-
title && /* @__PURE__ */
|
|
7140
|
+
title && /* @__PURE__ */ React57.createElement(Dialog3.Title, null, title),
|
|
7094
7141
|
children
|
|
7095
7142
|
));
|
|
7096
|
-
return /* @__PURE__ */
|
|
7143
|
+
return /* @__PURE__ */ React57.createElement(
|
|
7097
7144
|
Dialog3.Root,
|
|
7098
7145
|
{
|
|
7099
7146
|
key: "dialog",
|
|
7100
7147
|
open: internalOpen,
|
|
7101
7148
|
onOpenChange: setInternalOpen
|
|
7102
7149
|
},
|
|
7103
|
-
/* @__PURE__ */
|
|
7104
|
-
portalled ? /* @__PURE__ */
|
|
7150
|
+
/* @__PURE__ */ React57.createElement(Dialog3.Trigger, { key: "trigger" }, trigger),
|
|
7151
|
+
portalled ? /* @__PURE__ */ React57.createElement(Dialog3.Portal, { container: portalContainer }, inner) : inner
|
|
7105
7152
|
);
|
|
7106
7153
|
})
|
|
7107
7154
|
);
|
|
@@ -7517,25 +7564,25 @@ var ClassValue = /* @__PURE__ */ ((ClassValue2) => {
|
|
|
7517
7564
|
})(ClassValue || {});
|
|
7518
7565
|
|
|
7519
7566
|
// src/components/FillPreviewBackground.tsx
|
|
7520
|
-
var
|
|
7567
|
+
var React61 = __toESM(require("react"));
|
|
7521
7568
|
|
|
7522
7569
|
// src/contexts/ImageDataContext.tsx
|
|
7523
|
-
var
|
|
7524
|
-
var ImageDataContext =
|
|
7570
|
+
var React60 = __toESM(require("react"));
|
|
7571
|
+
var ImageDataContext = React60.createContext(
|
|
7525
7572
|
void 0
|
|
7526
7573
|
);
|
|
7527
|
-
var ImageDataProvider =
|
|
7574
|
+
var ImageDataProvider = React60.memo(function ImageDataProvider2({
|
|
7528
7575
|
children,
|
|
7529
7576
|
getImageData
|
|
7530
7577
|
}) {
|
|
7531
|
-
const contextValue =
|
|
7578
|
+
const contextValue = React60.useMemo(
|
|
7532
7579
|
() => ({ getImageData: getImageData ?? (() => void 0) }),
|
|
7533
7580
|
[getImageData]
|
|
7534
7581
|
);
|
|
7535
|
-
return /* @__PURE__ */
|
|
7582
|
+
return /* @__PURE__ */ React60.createElement(ImageDataContext.Provider, { value: contextValue }, children);
|
|
7536
7583
|
});
|
|
7537
7584
|
function useImageData(ref) {
|
|
7538
|
-
const value =
|
|
7585
|
+
const value = React60.useContext(ImageDataContext);
|
|
7539
7586
|
if (!value) {
|
|
7540
7587
|
throw new Error("Missing ImageDataProvider");
|
|
7541
7588
|
}
|
|
@@ -7601,10 +7648,10 @@ var dotsHorizontalSvg = (fillColor) => `
|
|
|
7601
7648
|
<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
7649
|
</svg>
|
|
7603
7650
|
`;
|
|
7604
|
-
var Background =
|
|
7651
|
+
var Background = React61.memo(function Background2({
|
|
7605
7652
|
background: background2
|
|
7606
7653
|
}) {
|
|
7607
|
-
return /* @__PURE__ */
|
|
7654
|
+
return /* @__PURE__ */ React61.createElement(
|
|
7608
7655
|
"span",
|
|
7609
7656
|
{
|
|
7610
7657
|
className: `${background2 ? `bg-[${background2}]` : "bg-input-background"} absolute inset-0`
|
|
@@ -7623,7 +7670,7 @@ function getPatternSizeAndPosition(fillType, tileScale) {
|
|
|
7623
7670
|
return "center / 100% 100%";
|
|
7624
7671
|
}
|
|
7625
7672
|
}
|
|
7626
|
-
var PatternPreviewBackground =
|
|
7673
|
+
var PatternPreviewBackground = React61.memo(
|
|
7627
7674
|
function PatternPreviewBackground2({
|
|
7628
7675
|
fillType,
|
|
7629
7676
|
tileScale,
|
|
@@ -7632,7 +7679,7 @@ var PatternPreviewBackground = React60.memo(
|
|
|
7632
7679
|
const image = useImageData(imageRef);
|
|
7633
7680
|
const url = useObjectURL(image);
|
|
7634
7681
|
const size2 = getPatternSizeAndPosition(fillType, tileScale);
|
|
7635
|
-
const background2 =
|
|
7682
|
+
const background2 = React61.useMemo(
|
|
7636
7683
|
() => [
|
|
7637
7684
|
size2,
|
|
7638
7685
|
`url(${url})`,
|
|
@@ -7640,44 +7687,44 @@ var PatternPreviewBackground = React60.memo(
|
|
|
7640
7687
|
].join(" "),
|
|
7641
7688
|
[fillType, size2, url]
|
|
7642
7689
|
);
|
|
7643
|
-
return /* @__PURE__ */
|
|
7690
|
+
return /* @__PURE__ */ React61.createElement(Background, { background: background2 });
|
|
7644
7691
|
}
|
|
7645
7692
|
);
|
|
7646
|
-
var ColorPreviewBackground =
|
|
7693
|
+
var ColorPreviewBackground = React61.memo(function ColorPreviewBackground2({
|
|
7647
7694
|
color
|
|
7648
7695
|
}) {
|
|
7649
|
-
const background2 =
|
|
7696
|
+
const background2 = React61.useMemo(
|
|
7650
7697
|
() => sketchColorToRgbaString(color),
|
|
7651
7698
|
[color]
|
|
7652
7699
|
);
|
|
7653
|
-
return /* @__PURE__ */
|
|
7700
|
+
return /* @__PURE__ */ React61.createElement(Background, { background: background2 });
|
|
7654
7701
|
});
|
|
7655
|
-
var GradientPreviewBackground =
|
|
7702
|
+
var GradientPreviewBackground = React61.memo(
|
|
7656
7703
|
function GradientPreviewBackground2({
|
|
7657
7704
|
gradient
|
|
7658
7705
|
}) {
|
|
7659
|
-
const background2 =
|
|
7706
|
+
const background2 = React61.useMemo(
|
|
7660
7707
|
() => getGradientBackground(gradient.stops, gradient.gradientType, 180),
|
|
7661
7708
|
[gradient.gradientType, gradient.stops]
|
|
7662
7709
|
);
|
|
7663
|
-
return /* @__PURE__ */
|
|
7710
|
+
return /* @__PURE__ */ React61.createElement(Background, { background: background2 });
|
|
7664
7711
|
}
|
|
7665
7712
|
);
|
|
7666
7713
|
var background = `center url("data:image/svg+xml;utf8,${dotsHorizontalSvg(
|
|
7667
7714
|
cssVars.colors.placeholderDots
|
|
7668
7715
|
)}") no-repeat`;
|
|
7669
|
-
var FillPreviewBackground =
|
|
7716
|
+
var FillPreviewBackground = React61.memo(function FillPreviewBackground2({
|
|
7670
7717
|
value
|
|
7671
7718
|
}) {
|
|
7672
|
-
if (!value) return /* @__PURE__ */
|
|
7719
|
+
if (!value) return /* @__PURE__ */ React61.createElement(Background, { background });
|
|
7673
7720
|
switch (value._class) {
|
|
7674
7721
|
case "color":
|
|
7675
|
-
return /* @__PURE__ */
|
|
7722
|
+
return /* @__PURE__ */ React61.createElement(ColorPreviewBackground, { color: value });
|
|
7676
7723
|
case "gradient":
|
|
7677
|
-
return /* @__PURE__ */
|
|
7724
|
+
return /* @__PURE__ */ React61.createElement(GradientPreviewBackground, { gradient: value });
|
|
7678
7725
|
case "pattern":
|
|
7679
7726
|
if (!value.image) return null;
|
|
7680
|
-
return /* @__PURE__ */
|
|
7727
|
+
return /* @__PURE__ */ React61.createElement(
|
|
7681
7728
|
PatternPreviewBackground,
|
|
7682
7729
|
{
|
|
7683
7730
|
fillType: value.patternFillType,
|
|
@@ -7977,8 +8024,8 @@ var FloatingWindow = ({
|
|
|
7977
8024
|
|
|
7978
8025
|
// src/components/GradientPicker.tsx
|
|
7979
8026
|
var import_noya_colorpicker2 = require("@noya-app/noya-colorpicker");
|
|
7980
|
-
var
|
|
7981
|
-
var GradientPicker =
|
|
8027
|
+
var React64 = __toESM(require("react"));
|
|
8028
|
+
var GradientPicker = React64.memo(function GradientPicker2({
|
|
7982
8029
|
value,
|
|
7983
8030
|
selectedStop,
|
|
7984
8031
|
onChangeColor,
|
|
@@ -7987,7 +8034,7 @@ var GradientPicker = React63.memo(function GradientPicker2({
|
|
|
7987
8034
|
onDelete,
|
|
7988
8035
|
onSelectStop
|
|
7989
8036
|
}) {
|
|
7990
|
-
const colorModel =
|
|
8037
|
+
const colorModel = React64.useMemo(
|
|
7991
8038
|
() => ({
|
|
7992
8039
|
defaultColor: { r: 0, g: 0, b: 0, a: 1 },
|
|
7993
8040
|
toHsva: import_noya_colorpicker2.rgbaToHsva,
|
|
@@ -7996,30 +8043,30 @@ var GradientPicker = React63.memo(function GradientPicker2({
|
|
|
7996
8043
|
}),
|
|
7997
8044
|
[]
|
|
7998
8045
|
);
|
|
7999
|
-
const rgbaColor =
|
|
8046
|
+
const rgbaColor = React64.useMemo(
|
|
8000
8047
|
() => sketchColorToRgba(value[selectedStop].color),
|
|
8001
8048
|
[value, selectedStop]
|
|
8002
8049
|
);
|
|
8003
|
-
const handleChangeColor =
|
|
8050
|
+
const handleChangeColor = React64.useCallback(
|
|
8004
8051
|
(value2) => {
|
|
8005
8052
|
onChangeColor(rgbaToSketchColor(value2));
|
|
8006
8053
|
},
|
|
8007
8054
|
[onChangeColor]
|
|
8008
8055
|
);
|
|
8009
|
-
const handleAddGradientStop =
|
|
8056
|
+
const handleAddGradientStop = React64.useCallback(
|
|
8010
8057
|
(value2, position) => {
|
|
8011
8058
|
onAdd(rgbaToSketchColor(value2), position);
|
|
8012
8059
|
},
|
|
8013
8060
|
[onAdd]
|
|
8014
8061
|
);
|
|
8015
|
-
return /* @__PURE__ */
|
|
8062
|
+
return /* @__PURE__ */ React64.createElement(
|
|
8016
8063
|
import_noya_colorpicker2.ColorPicker,
|
|
8017
8064
|
{
|
|
8018
8065
|
onChange: handleChangeColor,
|
|
8019
8066
|
colorModel,
|
|
8020
8067
|
color: rgbaColor
|
|
8021
8068
|
},
|
|
8022
|
-
/* @__PURE__ */
|
|
8069
|
+
/* @__PURE__ */ React64.createElement(
|
|
8023
8070
|
import_noya_colorpicker2.Gradient,
|
|
8024
8071
|
{
|
|
8025
8072
|
gradients: value,
|
|
@@ -8030,12 +8077,12 @@ var GradientPicker = React63.memo(function GradientPicker2({
|
|
|
8030
8077
|
onDelete
|
|
8031
8078
|
}
|
|
8032
8079
|
),
|
|
8033
|
-
/* @__PURE__ */
|
|
8034
|
-
/* @__PURE__ */
|
|
8035
|
-
/* @__PURE__ */
|
|
8036
|
-
/* @__PURE__ */
|
|
8037
|
-
/* @__PURE__ */
|
|
8038
|
-
/* @__PURE__ */
|
|
8080
|
+
/* @__PURE__ */ React64.createElement(Spacer.Vertical, { size: 10 }),
|
|
8081
|
+
/* @__PURE__ */ React64.createElement(import_noya_colorpicker2.Saturation, null),
|
|
8082
|
+
/* @__PURE__ */ React64.createElement(Spacer.Vertical, { size: 12 }),
|
|
8083
|
+
/* @__PURE__ */ React64.createElement(import_noya_colorpicker2.Hue, null),
|
|
8084
|
+
/* @__PURE__ */ React64.createElement(Spacer.Vertical, { size: 5 }),
|
|
8085
|
+
/* @__PURE__ */ React64.createElement(import_noya_colorpicker2.Alpha, null)
|
|
8039
8086
|
);
|
|
8040
8087
|
});
|
|
8041
8088
|
|
|
@@ -8073,25 +8120,25 @@ var InspectorContainer = (0, import_react71.memo)(
|
|
|
8073
8120
|
|
|
8074
8121
|
// src/components/LabeledElementView.tsx
|
|
8075
8122
|
var kiwi = __toESM(require("kiwi.js"));
|
|
8076
|
-
var
|
|
8077
|
-
var LabeledElementView =
|
|
8123
|
+
var React66 = __toESM(require("react"));
|
|
8124
|
+
var LabeledElementView = React66.memo(function LabeledElementView2({
|
|
8078
8125
|
children,
|
|
8079
8126
|
renderLabel
|
|
8080
8127
|
}) {
|
|
8081
|
-
const elementIds =
|
|
8082
|
-
(child) =>
|
|
8128
|
+
const elementIds = React66.Children.toArray(children).flatMap(
|
|
8129
|
+
(child) => React66.isValidElement(child) && child.type === React66.Fragment ? child.props.children : [child]
|
|
8083
8130
|
).map(
|
|
8084
|
-
(child) =>
|
|
8131
|
+
(child) => React66.isValidElement(child) && "id" in child.props ? child.props.id : null
|
|
8085
8132
|
).filter((id) => !!id);
|
|
8086
8133
|
const serializedIds = elementIds.join(",");
|
|
8087
|
-
const containerRef =
|
|
8088
|
-
const refs =
|
|
8134
|
+
const containerRef = React66.useRef(null);
|
|
8135
|
+
const refs = React66.useMemo(() => {
|
|
8089
8136
|
return Object.fromEntries(
|
|
8090
|
-
serializedIds.split(",").map((id) => [id,
|
|
8137
|
+
serializedIds.split(",").map((id) => [id, React66.createRef()])
|
|
8091
8138
|
);
|
|
8092
8139
|
}, [serializedIds]);
|
|
8093
|
-
const labelElements =
|
|
8094
|
-
return serializedIds.split(",").map((id, index) => /* @__PURE__ */
|
|
8140
|
+
const labelElements = React66.useMemo(() => {
|
|
8141
|
+
return serializedIds.split(",").map((id, index) => /* @__PURE__ */ React66.createElement(
|
|
8095
8142
|
"span",
|
|
8096
8143
|
{
|
|
8097
8144
|
key: id,
|
|
@@ -8104,7 +8151,7 @@ var LabeledElementView = React65.memo(function LabeledElementView2({
|
|
|
8104
8151
|
})
|
|
8105
8152
|
));
|
|
8106
8153
|
}, [refs, serializedIds, renderLabel]);
|
|
8107
|
-
|
|
8154
|
+
React66.useLayoutEffect(() => {
|
|
8108
8155
|
if (!containerRef.current) return;
|
|
8109
8156
|
const containerRect = containerRef.current.getBoundingClientRect();
|
|
8110
8157
|
const solver = new kiwi.Solver();
|
|
@@ -8166,7 +8213,7 @@ var LabeledElementView = React65.memo(function LabeledElementView2({
|
|
|
8166
8213
|
`${Math.max(...heights)}px`
|
|
8167
8214
|
);
|
|
8168
8215
|
}, [refs, labelElements]);
|
|
8169
|
-
return /* @__PURE__ */
|
|
8216
|
+
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
8217
|
});
|
|
8171
8218
|
|
|
8172
8219
|
// src/components/LabeledField.tsx
|
|
@@ -10877,27 +10924,27 @@ function getPipelineResultLink(value) {
|
|
|
10877
10924
|
// src/components/Progress.tsx
|
|
10878
10925
|
var import_noya_utils10 = require("@noya-app/noya-utils");
|
|
10879
10926
|
var ProgressPrimitive = __toESM(require("@radix-ui/react-progress"));
|
|
10880
|
-
var
|
|
10927
|
+
var React72 = __toESM(require("react"));
|
|
10881
10928
|
function Progress({
|
|
10882
10929
|
value,
|
|
10883
10930
|
variant = "normal",
|
|
10884
10931
|
className
|
|
10885
10932
|
}) {
|
|
10886
10933
|
const clampedValue = (0, import_noya_utils10.clamp)(value, 0, 100);
|
|
10887
|
-
const transformStyles =
|
|
10934
|
+
const transformStyles = React72.useMemo(
|
|
10888
10935
|
() => ({
|
|
10889
10936
|
transform: `translateX(-${100 - clampedValue}%)`
|
|
10890
10937
|
}),
|
|
10891
10938
|
[clampedValue]
|
|
10892
10939
|
);
|
|
10893
|
-
return /* @__PURE__ */
|
|
10940
|
+
return /* @__PURE__ */ React72.createElement(
|
|
10894
10941
|
ProgressPrimitive.Root,
|
|
10895
10942
|
{
|
|
10896
10943
|
className: cx(`relative hidden bg-input-background h-[5px] `, className),
|
|
10897
10944
|
style: { transform: "translateZ(0)" },
|
|
10898
10945
|
value: clampedValue
|
|
10899
10946
|
},
|
|
10900
|
-
/* @__PURE__ */
|
|
10947
|
+
/* @__PURE__ */ React72.createElement(
|
|
10901
10948
|
ProgressPrimitive.Indicator,
|
|
10902
10949
|
{
|
|
10903
10950
|
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`,
|
|
@@ -11093,42 +11140,48 @@ var createVirtualElement = (rect) => ({
|
|
|
11093
11140
|
toJSON: () => null
|
|
11094
11141
|
})
|
|
11095
11142
|
});
|
|
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",
|
|
11143
|
+
var SelectionToolbarContainer = (0, import_react79.memo)(
|
|
11144
|
+
function SelectionToolbarContainer2({
|
|
11145
|
+
rect,
|
|
11146
|
+
children
|
|
11147
|
+
}) {
|
|
11148
|
+
const portalScopeId = usePortalScopeId();
|
|
11149
|
+
const containerRef = import_react79.default.useRef(null);
|
|
11150
|
+
const size2 = useSize(containerRef, "width");
|
|
11151
|
+
const virtualRef = (0, import_react79.useMemo)(
|
|
11152
|
+
() => ({
|
|
11153
|
+
current: createVirtualElement(rect)
|
|
11154
|
+
}),
|
|
11155
|
+
[rect]
|
|
11156
|
+
);
|
|
11157
|
+
return /* @__PURE__ */ import_react79.default.createElement(PopperPrimitive.Root, null, /* @__PURE__ */ import_react79.default.createElement(PopperPrimitive.Anchor, { virtualRef }), /* @__PURE__ */ import_react79.default.createElement(
|
|
11158
|
+
PopperPrimitive.Content,
|
|
11124
11159
|
{
|
|
11125
|
-
|
|
11126
|
-
|
|
11160
|
+
...portalScopeProps(portalScopeId),
|
|
11161
|
+
side: "top",
|
|
11162
|
+
sideOffset: 10,
|
|
11163
|
+
align: "center",
|
|
11164
|
+
avoidCollisions: true,
|
|
11165
|
+
collisionPadding: 10,
|
|
11166
|
+
contentEditable: false,
|
|
11167
|
+
style: {
|
|
11168
|
+
zIndex: 1e3,
|
|
11169
|
+
opacity: size2 ? 1 : 0,
|
|
11170
|
+
transition: "opacity 0.2s ease-in-out",
|
|
11171
|
+
["--n-input-background"]: "transparent"
|
|
11172
|
+
}
|
|
11127
11173
|
},
|
|
11128
|
-
/* @__PURE__ */ import_react79.default.createElement(
|
|
11129
|
-
|
|
11130
|
-
|
|
11131
|
-
|
|
11174
|
+
/* @__PURE__ */ import_react79.default.createElement(
|
|
11175
|
+
"div",
|
|
11176
|
+
{
|
|
11177
|
+
ref: containerRef,
|
|
11178
|
+
className: "flex gap-1 bg-popover-background rounded shadow-popover p-1"
|
|
11179
|
+
},
|
|
11180
|
+
children
|
|
11181
|
+
)
|
|
11182
|
+
));
|
|
11183
|
+
}
|
|
11184
|
+
);
|
|
11132
11185
|
|
|
11133
11186
|
// src/components/SelectMenu.tsx
|
|
11134
11187
|
var import_noya_icons11 = require("@noya-app/noya-icons");
|
|
@@ -11211,6 +11264,7 @@ var SelectMenu = memoGeneric(function SelectMenu2({
|
|
|
11211
11264
|
contentStyle: contentStyleProp,
|
|
11212
11265
|
...props
|
|
11213
11266
|
}) {
|
|
11267
|
+
const portalScopeId = usePortalScopeId();
|
|
11214
11268
|
const selectedItem = items.find(
|
|
11215
11269
|
(item) => isSelectableMenuItem(item) && item.value === value
|
|
11216
11270
|
);
|
|
@@ -11275,6 +11329,7 @@ var SelectMenu = memoGeneric(function SelectMenu2({
|
|
|
11275
11329
|
/* @__PURE__ */ import_react80.default.createElement(Select.Portal, null, /* @__PURE__ */ import_react80.default.createElement(
|
|
11276
11330
|
Select.Content,
|
|
11277
11331
|
{
|
|
11332
|
+
...portalScopeProps(portalScopeId),
|
|
11278
11333
|
className: styles.contentStyle,
|
|
11279
11334
|
position: "popper",
|
|
11280
11335
|
sideOffset: 6,
|
|
@@ -11399,7 +11454,7 @@ var Slider = (0, import_react81.memo)(function Slider2({
|
|
|
11399
11454
|
|
|
11400
11455
|
// src/components/Switch.tsx
|
|
11401
11456
|
var SwitchPrimitive = __toESM(require("@radix-ui/react-switch"));
|
|
11402
|
-
var
|
|
11457
|
+
var React78 = __toESM(require("react"));
|
|
11403
11458
|
var Switch = function Switch2({
|
|
11404
11459
|
id,
|
|
11405
11460
|
value,
|
|
@@ -11411,7 +11466,7 @@ var Switch = function Switch2({
|
|
|
11411
11466
|
style: style2,
|
|
11412
11467
|
className
|
|
11413
11468
|
}) {
|
|
11414
|
-
return /* @__PURE__ */
|
|
11469
|
+
return /* @__PURE__ */ React78.createElement(
|
|
11415
11470
|
SwitchPrimitive.Root,
|
|
11416
11471
|
{
|
|
11417
11472
|
id,
|
|
@@ -11430,7 +11485,7 @@ var Switch = function Switch2({
|
|
|
11430
11485
|
onFocus,
|
|
11431
11486
|
onBlur
|
|
11432
11487
|
},
|
|
11433
|
-
/* @__PURE__ */
|
|
11488
|
+
/* @__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
11489
|
);
|
|
11435
11490
|
};
|
|
11436
11491
|
|
|
@@ -12220,11 +12275,11 @@ var SUPPORTED_CANVAS_UPLOAD_TYPES = [
|
|
|
12220
12275
|
|
|
12221
12276
|
// src/components/DimensionInput.tsx
|
|
12222
12277
|
var import_noya_utils12 = require("@noya-app/noya-utils");
|
|
12223
|
-
var
|
|
12278
|
+
var React84 = __toESM(require("react"));
|
|
12224
12279
|
function getNewValue(value, mode, delta) {
|
|
12225
12280
|
return delta === void 0 ? value : mode === "replace" ? delta : value + delta;
|
|
12226
12281
|
}
|
|
12227
|
-
var DimensionInput =
|
|
12282
|
+
var DimensionInput = React84.memo(function DimensionInput2({
|
|
12228
12283
|
id,
|
|
12229
12284
|
value,
|
|
12230
12285
|
onSetValue,
|
|
@@ -12234,15 +12289,15 @@ var DimensionInput = React83.memo(function DimensionInput2({
|
|
|
12234
12289
|
disabled,
|
|
12235
12290
|
trigger = "submit"
|
|
12236
12291
|
}) {
|
|
12237
|
-
const handleNudgeValue =
|
|
12292
|
+
const handleNudgeValue = React84.useCallback(
|
|
12238
12293
|
(value2) => onSetValue(value2, "adjust"),
|
|
12239
12294
|
[onSetValue]
|
|
12240
12295
|
);
|
|
12241
|
-
const handleSetValue =
|
|
12296
|
+
const handleSetValue = React84.useCallback(
|
|
12242
12297
|
(value2) => onSetValue(value2, "replace"),
|
|
12243
12298
|
[onSetValue]
|
|
12244
12299
|
);
|
|
12245
|
-
return /* @__PURE__ */
|
|
12300
|
+
return /* @__PURE__ */ React84.createElement(LabeledField, { label, labelPosition: "inset" }, /* @__PURE__ */ React84.createElement(InputField2.Root, { id, width: size2 }, /* @__PURE__ */ React84.createElement(
|
|
12246
12301
|
InputField2.NumberInput,
|
|
12247
12302
|
{
|
|
12248
12303
|
value: value === void 0 ? value : (0, import_noya_utils12.round)(value, 2),
|
|
@@ -12398,6 +12453,47 @@ function BaseToolbar({
|
|
|
12398
12453
|
var import_noya_icons12 = require("@noya-app/noya-icons");
|
|
12399
12454
|
var import_noya_keymap7 = require("@noya-app/noya-keymap");
|
|
12400
12455
|
var import_react91 = __toESM(require("react"));
|
|
12456
|
+
var ToolbarMenuDropdown = memoGeneric(function ToolbarMenuDropdown2({
|
|
12457
|
+
item,
|
|
12458
|
+
onSelectMenuItem
|
|
12459
|
+
}) {
|
|
12460
|
+
const [open, setOpen] = import_react91.default.useState(false);
|
|
12461
|
+
return /* @__PURE__ */ import_react91.default.createElement(
|
|
12462
|
+
DropdownMenu,
|
|
12463
|
+
{
|
|
12464
|
+
open,
|
|
12465
|
+
onOpenChange: setOpen,
|
|
12466
|
+
items: item.items,
|
|
12467
|
+
onSelect: (value) => {
|
|
12468
|
+
if (onSelectMenuItem && value) {
|
|
12469
|
+
onSelectMenuItem(value);
|
|
12470
|
+
}
|
|
12471
|
+
}
|
|
12472
|
+
},
|
|
12473
|
+
/* @__PURE__ */ import_react91.default.createElement(Button, { disabled: item.disabled, active: item.checked || open }, item.title, item.title && item.icon && /* @__PURE__ */ import_react91.default.createElement(Spacer.Horizontal, { inline: true, size: 6 }), item.icon && renderIcon(item.icon), /* @__PURE__ */ import_react91.default.createElement(Spacer.Horizontal, { size: 6 }), /* @__PURE__ */ import_react91.default.createElement(import_noya_icons12.DropdownChevronIcon, null))
|
|
12474
|
+
);
|
|
12475
|
+
});
|
|
12476
|
+
var ToolbarMenuButton = memoGeneric(function ToolbarMenuButton2({
|
|
12477
|
+
item,
|
|
12478
|
+
onSelectMenuItem
|
|
12479
|
+
}) {
|
|
12480
|
+
const content = /* @__PURE__ */ import_react91.default.createElement(
|
|
12481
|
+
Button,
|
|
12482
|
+
{
|
|
12483
|
+
disabled: item.disabled,
|
|
12484
|
+
active: item.checked,
|
|
12485
|
+
onClick: () => {
|
|
12486
|
+
if (onSelectMenuItem && item.value) {
|
|
12487
|
+
onSelectMenuItem(item.value);
|
|
12488
|
+
}
|
|
12489
|
+
}
|
|
12490
|
+
},
|
|
12491
|
+
item.title,
|
|
12492
|
+
item.title && item.icon && /* @__PURE__ */ import_react91.default.createElement(Spacer.Horizontal, { inline: true, size: 6 }),
|
|
12493
|
+
item.icon && renderIcon(item.icon)
|
|
12494
|
+
);
|
|
12495
|
+
return item.tooltip ? /* @__PURE__ */ import_react91.default.createElement(Tooltip, { sideOffset: 10, content: item.tooltip }, content) : content;
|
|
12496
|
+
});
|
|
12401
12497
|
function Toolbar({
|
|
12402
12498
|
children,
|
|
12403
12499
|
logo,
|
|
@@ -12438,10 +12534,6 @@ function Toolbar({
|
|
|
12438
12534
|
children
|
|
12439
12535
|
);
|
|
12440
12536
|
}
|
|
12441
|
-
var activeButtonStyle = {
|
|
12442
|
-
backgroundColor: cssVars.colors.primaryPastel,
|
|
12443
|
-
color: cssVars.colors.primary
|
|
12444
|
-
};
|
|
12445
12537
|
var ToolbarMenu = memoGeneric(function ToolbarMenu2({
|
|
12446
12538
|
items,
|
|
12447
12539
|
onSelectMenuItem
|
|
@@ -12452,47 +12544,22 @@ var ToolbarMenu = memoGeneric(function ToolbarMenu2({
|
|
|
12452
12544
|
return /* @__PURE__ */ import_react91.default.createElement(DividerVertical, { key: i, overflow: 4 });
|
|
12453
12545
|
}
|
|
12454
12546
|
if (isSelectableMenuItem(item)) {
|
|
12455
|
-
|
|
12456
|
-
|
|
12547
|
+
return /* @__PURE__ */ import_react91.default.createElement(
|
|
12548
|
+
ToolbarMenuButton,
|
|
12457
12549
|
{
|
|
12458
12550
|
key: i,
|
|
12459
|
-
|
|
12460
|
-
|
|
12461
|
-
|
|
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)
|
|
12551
|
+
item,
|
|
12552
|
+
onSelectMenuItem
|
|
12553
|
+
}
|
|
12470
12554
|
);
|
|
12471
|
-
return item.tooltip ? /* @__PURE__ */ import_react91.default.createElement(Tooltip, { sideOffset: 10, content: item.tooltip, key: i }, content) : content;
|
|
12472
12555
|
}
|
|
12473
12556
|
return /* @__PURE__ */ import_react91.default.createElement(
|
|
12474
|
-
|
|
12557
|
+
ToolbarMenuDropdown,
|
|
12475
12558
|
{
|
|
12476
12559
|
key: i,
|
|
12477
|
-
|
|
12478
|
-
|
|
12479
|
-
|
|
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
|
-
)
|
|
12560
|
+
item,
|
|
12561
|
+
onSelectMenuItem
|
|
12562
|
+
}
|
|
12496
12563
|
);
|
|
12497
12564
|
}));
|
|
12498
12565
|
});
|
|
@@ -12585,6 +12652,7 @@ var ToolbarMenu = memoGeneric(function ToolbarMenu2({
|
|
|
12585
12652
|
PipelineResultLayout,
|
|
12586
12653
|
PipelineResultLink,
|
|
12587
12654
|
Popover,
|
|
12655
|
+
PortalScopeProvider,
|
|
12588
12656
|
Progress,
|
|
12589
12657
|
RIGHT_SIDEBAR_ID,
|
|
12590
12658
|
SUPPORTED_CANVAS_UPLOAD_TYPES,
|
|
@@ -12595,7 +12663,7 @@ var ToolbarMenu = memoGeneric(function ToolbarMenu2({
|
|
|
12595
12663
|
SectionHeader,
|
|
12596
12664
|
SegmentedControl,
|
|
12597
12665
|
SelectMenu,
|
|
12598
|
-
|
|
12666
|
+
SelectionToolbarContainer,
|
|
12599
12667
|
Slider,
|
|
12600
12668
|
Small,
|
|
12601
12669
|
Sortable,
|
|
@@ -12608,6 +12676,8 @@ var ToolbarMenu = memoGeneric(function ToolbarMenu2({
|
|
|
12608
12676
|
ToastProvider,
|
|
12609
12677
|
Toolbar,
|
|
12610
12678
|
ToolbarMenu,
|
|
12679
|
+
ToolbarMenuButton,
|
|
12680
|
+
ToolbarMenuDropdown,
|
|
12611
12681
|
Tooltip,
|
|
12612
12682
|
TreeView,
|
|
12613
12683
|
UserAvatar,
|
|
@@ -12626,6 +12696,7 @@ var ToolbarMenu = memoGeneric(function ToolbarMenu2({
|
|
|
12626
12696
|
fuzzyFilter,
|
|
12627
12697
|
fuzzyScore,
|
|
12628
12698
|
fuzzyTokenize,
|
|
12699
|
+
getClosestPortalScope,
|
|
12629
12700
|
getFieldSpacing,
|
|
12630
12701
|
getGradientBackground,
|
|
12631
12702
|
getGridSize,
|
|
@@ -12645,6 +12716,9 @@ var ToolbarMenu = memoGeneric(function ToolbarMenu2({
|
|
|
12645
12716
|
moveTreeItem,
|
|
12646
12717
|
normalizeListTargetIndex,
|
|
12647
12718
|
popoverStyle,
|
|
12719
|
+
portalScopeDataSetName,
|
|
12720
|
+
portalScopePropName,
|
|
12721
|
+
portalScopeProps,
|
|
12648
12722
|
renderIcon,
|
|
12649
12723
|
rgbaToSketchColor,
|
|
12650
12724
|
separator,
|
|
@@ -12677,6 +12751,7 @@ var ToolbarMenu = memoGeneric(function ToolbarMenu2({
|
|
|
12677
12751
|
useOpenInputDialog,
|
|
12678
12752
|
usePlatform,
|
|
12679
12753
|
usePlatformModKey,
|
|
12754
|
+
usePortalScopeId,
|
|
12680
12755
|
usePreservePanelSize,
|
|
12681
12756
|
useTheme,
|
|
12682
12757
|
validateDropIndicator,
|