@noya-app/noya-designsystem 0.1.21 → 0.1.23
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 +9 -9
- package/CHANGELOG.md +17 -0
- package/dist/index.d.mts +60 -31
- package/dist/index.d.ts +60 -31
- package/dist/index.js +273 -166
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +309 -206
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -4
- package/src/components/Button.tsx +2 -2
- package/src/components/Chip.tsx +88 -76
- package/src/components/ContextMenu.tsx +15 -21
- package/src/components/InputField.tsx +52 -4
- package/src/components/ListView.tsx +27 -1
- package/src/components/Popover.tsx +6 -6
- package/src/components/Select.tsx +2 -2
- package/src/components/SelectMenu.tsx +100 -0
- package/src/components/Stack.tsx +12 -1
- package/src/components/Text.tsx +6 -0
- package/src/components/TreeView.tsx +7 -7
- package/src/components/WorkspaceLayout.tsx +3 -0
- package/src/components/internal/Menu.tsx +2 -2
- package/src/index.tsx +1 -0
- package/src/theme/light.ts +2 -1
- package/src/utils/breakpoints.ts +6 -6
package/dist/index.js
CHANGED
|
@@ -86,6 +86,7 @@ __export(src_exports, {
|
|
|
86
86
|
SUPPORTED_IMAGE_UPLOAD_TYPES: () => SUPPORTED_IMAGE_UPLOAD_TYPES,
|
|
87
87
|
ScrollArea: () => ScrollArea,
|
|
88
88
|
Select: () => Select,
|
|
89
|
+
SelectMenu: () => SelectMenu,
|
|
89
90
|
SelectOption: () => SelectOption,
|
|
90
91
|
Slider: () => Slider,
|
|
91
92
|
Small: () => Small,
|
|
@@ -182,7 +183,7 @@ function mergeBreakpoints(breakpoints, transform) {
|
|
|
182
183
|
) : breakpoints;
|
|
183
184
|
const breakpointList = Object.entries(breakpointMap);
|
|
184
185
|
const transformedList = breakpointList.sort((a, b) => Number(b[0]) - Number(a[0])).map(([width, value]) => [
|
|
185
|
-
`@media
|
|
186
|
+
`@media (min-width: ${width}px)`,
|
|
186
187
|
transform?.(value) ?? value
|
|
187
188
|
]);
|
|
188
189
|
return Object.fromEntries(transformedList);
|
|
@@ -212,7 +213,17 @@ var Element = import_styled_components2.default.div(({ $styleProps, $breakpoints
|
|
|
212
213
|
...$styleProps,
|
|
213
214
|
...mergeBreakpoints($breakpoints || [])
|
|
214
215
|
}));
|
|
215
|
-
var StackBase = (0, import_react3.forwardRef)(function StackBase2({
|
|
216
|
+
var StackBase = (0, import_react3.forwardRef)(function StackBase2({
|
|
217
|
+
id,
|
|
218
|
+
className,
|
|
219
|
+
as,
|
|
220
|
+
children,
|
|
221
|
+
separator,
|
|
222
|
+
breakpoints,
|
|
223
|
+
tabIndex,
|
|
224
|
+
href,
|
|
225
|
+
...rest
|
|
226
|
+
}, forwardedRef) {
|
|
216
227
|
const elements2 = separator ? withSeparatorElements(import_react3.Children.toArray(children), separator) : children;
|
|
217
228
|
const styleProps = {
|
|
218
229
|
display: "flex",
|
|
@@ -225,6 +236,7 @@ var StackBase = (0, import_react3.forwardRef)(function StackBase2({ id, as, chil
|
|
|
225
236
|
{
|
|
226
237
|
ref: forwardedRef,
|
|
227
238
|
id,
|
|
239
|
+
className,
|
|
228
240
|
as,
|
|
229
241
|
$styleProps: styleProps,
|
|
230
242
|
$breakpoints: breakpoints,
|
|
@@ -374,9 +386,9 @@ var ButtonElement = import_styled_components5.default.button(
|
|
|
374
386
|
textAlign: "left",
|
|
375
387
|
borderRadius: "4px",
|
|
376
388
|
paddingTop: $variant === "none" ? "0px" : "4px",
|
|
377
|
-
paddingRight: $variant === "none" ? "0px" : $variant === "thin" ? "1px" : "
|
|
389
|
+
paddingRight: $variant === "none" ? "0px" : $variant === "thin" ? "1px" : "6px",
|
|
378
390
|
paddingBottom: $variant === "none" ? "0px" : "4px",
|
|
379
|
-
paddingLeft: $variant === "none" ? "0px" : $variant === "thin" ? "1px" : "
|
|
391
|
+
paddingLeft: $variant === "none" ? "0px" : $variant === "thin" ? "1px" : "6px",
|
|
380
392
|
...$size === "large" && {
|
|
381
393
|
paddingTop: "12px",
|
|
382
394
|
paddingRight: "16px",
|
|
@@ -807,7 +819,8 @@ var textStyles = {
|
|
|
807
819
|
fontFamily: fonts.normal,
|
|
808
820
|
fontSize: "0.62rem",
|
|
809
821
|
fontWeight: 400,
|
|
810
|
-
lineHeight: "
|
|
822
|
+
lineHeight: "19px",
|
|
823
|
+
// lineHeight: "1.4",
|
|
811
824
|
textTransform: "uppercase",
|
|
812
825
|
letterSpacing: "-0.3px"
|
|
813
826
|
}
|
|
@@ -1856,13 +1869,7 @@ function Popover({
|
|
|
1856
1869
|
onFocusOutside,
|
|
1857
1870
|
onPointerDownOutside,
|
|
1858
1871
|
collisionPadding: 8,
|
|
1859
|
-
arrowPadding: 2
|
|
1860
|
-
onPointerDown: (event) => {
|
|
1861
|
-
event.stopPropagation();
|
|
1862
|
-
},
|
|
1863
|
-
onWheel: (event) => {
|
|
1864
|
-
event.stopPropagation();
|
|
1865
|
-
}
|
|
1872
|
+
arrowPadding: 2
|
|
1866
1873
|
},
|
|
1867
1874
|
children,
|
|
1868
1875
|
showArrow && /* @__PURE__ */ import_react31.default.createElement(ArrowElement, null),
|
|
@@ -2123,9 +2130,10 @@ function parseNumber(value) {
|
|
|
2123
2130
|
return value ? Number(value) : NaN;
|
|
2124
2131
|
}
|
|
2125
2132
|
function InputFieldNumberInput(props) {
|
|
2126
|
-
const { value, placeholder, onNudge, ...rest } = props;
|
|
2133
|
+
const { value, placeholder, onNudge, onBlur, ...rest } = props;
|
|
2127
2134
|
const onSubmit = "onSubmit" in props ? props.onSubmit : void 0;
|
|
2128
2135
|
const onChange = "onChange" in props ? props.onChange : void 0;
|
|
2136
|
+
const [internalValue, setInternalValue] = (0, import_react32.useState)();
|
|
2129
2137
|
const handleSubmit = (0, import_react32.useCallback)(
|
|
2130
2138
|
(value2) => {
|
|
2131
2139
|
const newValue = parseNumber(value2);
|
|
@@ -2141,6 +2149,7 @@ function InputFieldNumberInput(props) {
|
|
|
2141
2149
|
if (!amount)
|
|
2142
2150
|
return;
|
|
2143
2151
|
onNudge?.(amount);
|
|
2152
|
+
setInternalValue(void 0);
|
|
2144
2153
|
event.preventDefault();
|
|
2145
2154
|
event.stopPropagation();
|
|
2146
2155
|
},
|
|
@@ -2148,17 +2157,37 @@ function InputFieldNumberInput(props) {
|
|
|
2148
2157
|
);
|
|
2149
2158
|
const handleChange = (0, import_react32.useCallback)(
|
|
2150
2159
|
(value2) => {
|
|
2151
|
-
|
|
2160
|
+
if (value2 === "" || value2 === "-" || value2 === ".") {
|
|
2161
|
+
setInternalValue(value2);
|
|
2162
|
+
return;
|
|
2163
|
+
}
|
|
2164
|
+
if (value2.endsWith(".")) {
|
|
2165
|
+
setInternalValue(value2);
|
|
2166
|
+
return;
|
|
2167
|
+
}
|
|
2168
|
+
setInternalValue(void 0);
|
|
2169
|
+
const newValue = parseNumber(value2);
|
|
2170
|
+
if (!isNaN(newValue)) {
|
|
2171
|
+
onChange?.(newValue);
|
|
2172
|
+
}
|
|
2152
2173
|
},
|
|
2153
2174
|
[onChange]
|
|
2154
2175
|
);
|
|
2176
|
+
const handleBlur = (0, import_react32.useCallback)(
|
|
2177
|
+
(event) => {
|
|
2178
|
+
setInternalValue(void 0);
|
|
2179
|
+
onBlur?.(event);
|
|
2180
|
+
},
|
|
2181
|
+
[onBlur]
|
|
2182
|
+
);
|
|
2155
2183
|
return /* @__PURE__ */ import_react32.default.createElement(
|
|
2156
2184
|
InputFieldInput,
|
|
2157
2185
|
{
|
|
2158
2186
|
...rest,
|
|
2159
|
-
value: value === void 0 ? "" : String(value),
|
|
2187
|
+
value: internalValue !== void 0 ? String(internalValue) : value === void 0 ? "" : String(value),
|
|
2160
2188
|
placeholder,
|
|
2161
2189
|
onKeyDown: handleKeyDown,
|
|
2190
|
+
onBlur: handleBlur,
|
|
2162
2191
|
..."onChange" in props ? { onChange: handleChange } : { onSubmit: handleSubmit }
|
|
2163
2192
|
}
|
|
2164
2193
|
);
|
|
@@ -2181,7 +2210,9 @@ function InputFieldRoot({
|
|
|
2181
2210
|
labelSize,
|
|
2182
2211
|
size: size2 = "medium",
|
|
2183
2212
|
renderPopoverContent,
|
|
2184
|
-
onFocusChange
|
|
2213
|
+
onFocusChange,
|
|
2214
|
+
style: style3,
|
|
2215
|
+
className
|
|
2185
2216
|
}) {
|
|
2186
2217
|
const childrenArray = import_react32.Children.toArray(children);
|
|
2187
2218
|
const hasDropdown = childrenArray.some(
|
|
@@ -2233,7 +2264,17 @@ function InputFieldRoot({
|
|
|
2233
2264
|
inputRef
|
|
2234
2265
|
]
|
|
2235
2266
|
);
|
|
2236
|
-
const rootElement = /* @__PURE__ */ import_react32.default.createElement(
|
|
2267
|
+
const rootElement = /* @__PURE__ */ import_react32.default.createElement(
|
|
2268
|
+
RootContainer,
|
|
2269
|
+
{
|
|
2270
|
+
id,
|
|
2271
|
+
$width: width,
|
|
2272
|
+
$flex: flex,
|
|
2273
|
+
style: style3,
|
|
2274
|
+
className
|
|
2275
|
+
},
|
|
2276
|
+
children
|
|
2277
|
+
);
|
|
2237
2278
|
return /* @__PURE__ */ import_react32.default.createElement(InputFieldContext.Provider, { value: contextValue }, renderPopoverContent ? /* @__PURE__ */ import_react32.default.createElement(
|
|
2238
2279
|
Popover,
|
|
2239
2280
|
{
|
|
@@ -2675,66 +2716,72 @@ var AddElement = (0, import_styled_components16.default)(import_noya_icons3.Plus
|
|
|
2675
2716
|
opacity: 0.85
|
|
2676
2717
|
}
|
|
2677
2718
|
}));
|
|
2678
|
-
var Chip = (0, import_react36.memo)(
|
|
2679
|
-
|
|
2680
|
-
|
|
2681
|
-
deletable,
|
|
2682
|
-
addable,
|
|
2683
|
-
style: style3,
|
|
2684
|
-
size: size2 = "medium",
|
|
2685
|
-
variant = "solid",
|
|
2686
|
-
monospace = false,
|
|
2687
|
-
tabIndex,
|
|
2688
|
-
onDelete,
|
|
2689
|
-
onClick,
|
|
2690
|
-
onAdd,
|
|
2691
|
-
onHoverDeleteChange
|
|
2692
|
-
}) {
|
|
2693
|
-
const theme = useDesignSystemTheme();
|
|
2694
|
-
const { hoverProps: hoverDeleteProps } = useHover({
|
|
2695
|
-
onHoverChange: onHoverDeleteChange
|
|
2696
|
-
});
|
|
2697
|
-
const handleClick = !children && !deletable && addable ? onAdd : onClick;
|
|
2698
|
-
const color = colorScheme === "primary" ? theme.colors.primary : colorScheme === "secondary" ? theme.colors.secondary : theme.colors.text;
|
|
2699
|
-
return /* @__PURE__ */ import_react36.default.createElement(
|
|
2700
|
-
ChipElement,
|
|
2701
|
-
{
|
|
2702
|
-
$variant: variant,
|
|
2703
|
-
$colorScheme: colorScheme,
|
|
2704
|
-
style: style3,
|
|
2705
|
-
onClick: handleClick,
|
|
2706
|
-
$size: size2,
|
|
2707
|
-
$monospace: monospace,
|
|
2708
|
-
$isInteractive: !!handleClick,
|
|
2709
|
-
tabIndex
|
|
2710
|
-
},
|
|
2711
|
-
addable && /* @__PURE__ */ import_react36.default.createElement(
|
|
2712
|
-
AddElement,
|
|
2713
|
-
{
|
|
2714
|
-
size: size2,
|
|
2715
|
-
isOnlyChild: !children && !deletable,
|
|
2716
|
-
onClick: onAdd ? (event) => {
|
|
2717
|
-
event.stopPropagation();
|
|
2718
|
-
onAdd?.();
|
|
2719
|
-
} : void 0,
|
|
2720
|
-
color
|
|
2721
|
-
}
|
|
2722
|
-
),
|
|
2719
|
+
var Chip = (0, import_react36.memo)(
|
|
2720
|
+
(0, import_react36.forwardRef)(function Chip2({
|
|
2721
|
+
colorScheme,
|
|
2723
2722
|
children,
|
|
2724
|
-
deletable
|
|
2725
|
-
|
|
2723
|
+
deletable,
|
|
2724
|
+
addable,
|
|
2725
|
+
clickable,
|
|
2726
|
+
style: style3,
|
|
2727
|
+
size: size2 = "medium",
|
|
2728
|
+
variant = "solid",
|
|
2729
|
+
monospace = false,
|
|
2730
|
+
tabIndex,
|
|
2731
|
+
onDelete,
|
|
2732
|
+
onClick,
|
|
2733
|
+
onAdd,
|
|
2734
|
+
onHoverDeleteChange,
|
|
2735
|
+
...rest
|
|
2736
|
+
}, forwardedRef) {
|
|
2737
|
+
const theme = useDesignSystemTheme();
|
|
2738
|
+
const { hoverProps: hoverDeleteProps } = useHover({
|
|
2739
|
+
onHoverChange: onHoverDeleteChange
|
|
2740
|
+
});
|
|
2741
|
+
const handleClick = !children && !deletable && addable ? onAdd : onClick;
|
|
2742
|
+
const color = colorScheme === "primary" ? theme.colors.primary : colorScheme === "secondary" ? theme.colors.secondary : theme.colors.text;
|
|
2743
|
+
return /* @__PURE__ */ import_react36.default.createElement(
|
|
2744
|
+
ChipElement,
|
|
2726
2745
|
{
|
|
2727
|
-
|
|
2728
|
-
|
|
2729
|
-
|
|
2730
|
-
|
|
2731
|
-
|
|
2732
|
-
|
|
2733
|
-
|
|
2734
|
-
|
|
2735
|
-
|
|
2736
|
-
|
|
2737
|
-
}
|
|
2746
|
+
ref: forwardedRef,
|
|
2747
|
+
$variant: variant,
|
|
2748
|
+
$colorScheme: colorScheme,
|
|
2749
|
+
style: style3,
|
|
2750
|
+
onClick: handleClick,
|
|
2751
|
+
$size: size2,
|
|
2752
|
+
$monospace: monospace,
|
|
2753
|
+
$isInteractive: !!handleClick || clickable === true,
|
|
2754
|
+
tabIndex,
|
|
2755
|
+
...rest
|
|
2756
|
+
},
|
|
2757
|
+
addable && /* @__PURE__ */ import_react36.default.createElement(
|
|
2758
|
+
AddElement,
|
|
2759
|
+
{
|
|
2760
|
+
size: size2,
|
|
2761
|
+
isOnlyChild: !children && !deletable,
|
|
2762
|
+
onClick: onAdd ? (event) => {
|
|
2763
|
+
event.stopPropagation();
|
|
2764
|
+
onAdd?.();
|
|
2765
|
+
} : void 0,
|
|
2766
|
+
color
|
|
2767
|
+
}
|
|
2768
|
+
),
|
|
2769
|
+
children,
|
|
2770
|
+
deletable && /* @__PURE__ */ import_react36.default.createElement(
|
|
2771
|
+
DeleteElement,
|
|
2772
|
+
{
|
|
2773
|
+
size: size2,
|
|
2774
|
+
...hoverDeleteProps,
|
|
2775
|
+
onClick: onDelete ? (event) => {
|
|
2776
|
+
event.stopPropagation();
|
|
2777
|
+
onDelete?.();
|
|
2778
|
+
} : void 0,
|
|
2779
|
+
color
|
|
2780
|
+
}
|
|
2781
|
+
)
|
|
2782
|
+
);
|
|
2783
|
+
})
|
|
2784
|
+
);
|
|
2738
2785
|
|
|
2739
2786
|
// src/components/ContextMenu.tsx
|
|
2740
2787
|
var import_noya_icons4 = require("@noya-app/noya-icons");
|
|
@@ -4706,7 +4753,8 @@ var ListViewRow = (0, import_react49.forwardRef)(function ListViewRow2({
|
|
|
4706
4753
|
onSelectMenuItem,
|
|
4707
4754
|
onMenuOpenChange,
|
|
4708
4755
|
onKeyDown,
|
|
4709
|
-
style: style3
|
|
4756
|
+
style: style3,
|
|
4757
|
+
dragIndicatorStyle
|
|
4710
4758
|
}, forwardedRef) {
|
|
4711
4759
|
depth = Math.max(0, depth);
|
|
4712
4760
|
const {
|
|
@@ -4790,7 +4838,12 @@ var ListViewRow = (0, import_react49.forwardRef)(function ListViewRow2({
|
|
|
4790
4838
|
$colorScheme: colorScheme,
|
|
4791
4839
|
$relativeDropPosition: relativeDropPosition,
|
|
4792
4840
|
$offsetLeft: 33 + depth * indentation,
|
|
4793
|
-
$gap: listGap
|
|
4841
|
+
$gap: listGap + (divider ? 1 : 0),
|
|
4842
|
+
style: typeof dragIndicatorStyle === "function" ? dragIndicatorStyle({
|
|
4843
|
+
depth,
|
|
4844
|
+
indentation,
|
|
4845
|
+
position: relativeDropPosition
|
|
4846
|
+
}) : dragIndicatorStyle
|
|
4794
4847
|
}
|
|
4795
4848
|
),
|
|
4796
4849
|
depth > 0 && /* @__PURE__ */ import_react49.default.createElement(Spacer.Horizontal, { size: depth * indentation }),
|
|
@@ -4909,6 +4962,9 @@ var RootContainer2 = import_styled_components25.default.div(({ theme, $scrollabl
|
|
|
4909
4962
|
gap: $gap
|
|
4910
4963
|
}));
|
|
4911
4964
|
var ListViewRootInner = (0, import_react49.forwardRef)(function ListViewRootInner2({
|
|
4965
|
+
id,
|
|
4966
|
+
className,
|
|
4967
|
+
style: style3,
|
|
4912
4968
|
onPress,
|
|
4913
4969
|
scrollable = false,
|
|
4914
4970
|
expandable = true,
|
|
@@ -5048,6 +5104,9 @@ var ListViewRootInner = (0, import_react49.forwardRef)(function ListViewRootInne
|
|
|
5048
5104
|
return /* @__PURE__ */ import_react49.default.createElement(DraggingContext.Provider, { value: draggingContextValue }, /* @__PURE__ */ import_react49.default.createElement(
|
|
5049
5105
|
RootContainer2,
|
|
5050
5106
|
{
|
|
5107
|
+
id,
|
|
5108
|
+
className,
|
|
5109
|
+
style: style3,
|
|
5051
5110
|
...{
|
|
5052
5111
|
[pressEventName]: handleClick
|
|
5053
5112
|
},
|
|
@@ -5150,7 +5209,9 @@ var Text = (0, import_react50.forwardRef)(function Text2({
|
|
|
5150
5209
|
className,
|
|
5151
5210
|
color,
|
|
5152
5211
|
href,
|
|
5212
|
+
tabIndex,
|
|
5153
5213
|
onClick,
|
|
5214
|
+
onKeyDown,
|
|
5154
5215
|
...rest
|
|
5155
5216
|
}, forwardedRef) {
|
|
5156
5217
|
const element = as ?? elements[variant] ?? "span";
|
|
@@ -5160,11 +5221,13 @@ var Text = (0, import_react50.forwardRef)(function Text2({
|
|
|
5160
5221
|
ref: forwardedRef,
|
|
5161
5222
|
as: element,
|
|
5162
5223
|
className,
|
|
5224
|
+
tabIndex,
|
|
5163
5225
|
$variant: variant,
|
|
5164
5226
|
$breakpoints: breakpoints,
|
|
5165
5227
|
$styleProps: rest,
|
|
5166
5228
|
$color: color,
|
|
5167
5229
|
onClick,
|
|
5230
|
+
onKeyDown,
|
|
5168
5231
|
...href && { href }
|
|
5169
5232
|
},
|
|
5170
5233
|
children
|
|
@@ -5938,7 +6001,7 @@ var SelectElement = import_styled_components32.default.select(
|
|
|
5938
6001
|
borderRadius: "4px",
|
|
5939
6002
|
paddingTop: "4px",
|
|
5940
6003
|
paddingBottom: "4px",
|
|
5941
|
-
paddingLeft: "
|
|
6004
|
+
paddingLeft: "6px",
|
|
5942
6005
|
paddingRight: "23px",
|
|
5943
6006
|
background: [
|
|
5944
6007
|
`calc(100% - 6px) / 15px url("data:image/svg+xml;utf8,${createChevronSVGString(
|
|
@@ -6012,11 +6075,51 @@ var Select = (0, import_react57.memo)(function Select2({
|
|
|
6012
6075
|
)), label && /* @__PURE__ */ import_react57.default.createElement(SelectLabel, { htmlFor: id }, label));
|
|
6013
6076
|
});
|
|
6014
6077
|
|
|
6078
|
+
// src/components/SelectMenu.tsx
|
|
6079
|
+
var import_noya_icons6 = require("@noya-app/noya-icons");
|
|
6080
|
+
var Select3 = __toESM(require("@radix-ui/react-select"));
|
|
6081
|
+
var import_react58 = __toESM(require("react"));
|
|
6082
|
+
var import_styled_components33 = require("styled-components");
|
|
6083
|
+
var SelectMenu = (0, import_react58.memo)(function SelectMenu2({
|
|
6084
|
+
id,
|
|
6085
|
+
style: style3,
|
|
6086
|
+
className,
|
|
6087
|
+
menuItems,
|
|
6088
|
+
value,
|
|
6089
|
+
onSelect,
|
|
6090
|
+
placeholder
|
|
6091
|
+
}) {
|
|
6092
|
+
const selectedItem = menuItems.find(
|
|
6093
|
+
(item) => typeof item !== "string" && item.value === value
|
|
6094
|
+
);
|
|
6095
|
+
const icon = selectedItem?.icon;
|
|
6096
|
+
return /* @__PURE__ */ import_react58.default.createElement(Select3.Root, { value, onValueChange: onSelect }, /* @__PURE__ */ import_react58.default.createElement(Select3.SelectTrigger, { asChild: true }, /* @__PURE__ */ import_react58.default.createElement(Button, { id, style: style3, className }, icon && /* @__PURE__ */ import_react58.default.createElement(import_react58.default.Fragment, null, icon, /* @__PURE__ */ import_react58.default.createElement(Spacer.Horizontal, { size: 8 })), /* @__PURE__ */ import_react58.default.createElement(Select3.Value, { placeholder }), /* @__PURE__ */ import_react58.default.createElement(Spacer.Horizontal, null), /* @__PURE__ */ import_react58.default.createElement(import_noya_icons6.DropdownChevronIcon, null))), /* @__PURE__ */ import_react58.default.createElement(Select3.Portal, null, /* @__PURE__ */ import_react58.default.createElement(SelectContent, null, /* @__PURE__ */ import_react58.default.createElement(SelectViewport, null, menuItems.map((menuItem) => {
|
|
6097
|
+
if (typeof menuItem === "string") {
|
|
6098
|
+
return /* @__PURE__ */ import_react58.default.createElement(StyledSeparator, null);
|
|
6099
|
+
}
|
|
6100
|
+
const value2 = menuItem.value ?? "";
|
|
6101
|
+
return /* @__PURE__ */ import_react58.default.createElement(SelectItem, { key: value2, value: value2, icon: menuItem.icon }, menuItem.title ?? value2);
|
|
6102
|
+
})))));
|
|
6103
|
+
});
|
|
6104
|
+
var SelectContent = (0, import_styled_components33.styled)(Select3.Content)(styles.contentStyle);
|
|
6105
|
+
var SelectViewport = (0, import_styled_components33.styled)(Select3.Viewport)({});
|
|
6106
|
+
var SelectItem = import_react58.default.forwardRef(
|
|
6107
|
+
({
|
|
6108
|
+
children,
|
|
6109
|
+
icon,
|
|
6110
|
+
...props
|
|
6111
|
+
}, forwardedRef) => {
|
|
6112
|
+
return /* @__PURE__ */ import_react58.default.createElement(StyledItem2, { ...props, ref: forwardedRef }, icon && /* @__PURE__ */ import_react58.default.createElement(import_react58.default.Fragment, null, icon, /* @__PURE__ */ import_react58.default.createElement(Spacer.Horizontal, { size: 8 })), /* @__PURE__ */ import_react58.default.createElement(Select3.ItemText, null, children));
|
|
6113
|
+
}
|
|
6114
|
+
);
|
|
6115
|
+
var StyledItem2 = (0, import_styled_components33.styled)(Select3.Item)(styles.itemStyle);
|
|
6116
|
+
var StyledSeparator = (0, import_styled_components33.styled)(Select3.Separator)(styles.separatorStyle);
|
|
6117
|
+
|
|
6015
6118
|
// src/components/Slider.tsx
|
|
6016
6119
|
var RadixSlider = __toESM(require("@radix-ui/react-slider"));
|
|
6017
|
-
var
|
|
6018
|
-
var
|
|
6019
|
-
var StyledSlider = (0,
|
|
6120
|
+
var import_react59 = __toESM(require("react"));
|
|
6121
|
+
var import_styled_components34 = __toESM(require("styled-components"));
|
|
6122
|
+
var StyledSlider = (0, import_styled_components34.default)(RadixSlider.Root)({
|
|
6020
6123
|
flex: "1",
|
|
6021
6124
|
position: "relative",
|
|
6022
6125
|
display: "flex",
|
|
@@ -6025,19 +6128,19 @@ var StyledSlider = (0, import_styled_components33.default)(RadixSlider.Root)({
|
|
|
6025
6128
|
touchAction: "none",
|
|
6026
6129
|
height: "16px"
|
|
6027
6130
|
});
|
|
6028
|
-
var StyledTrack = (0,
|
|
6131
|
+
var StyledTrack = (0, import_styled_components34.default)(RadixSlider.Track)(({ theme }) => ({
|
|
6029
6132
|
backgroundColor: theme.colors.divider,
|
|
6030
6133
|
position: "relative",
|
|
6031
6134
|
flexGrow: 1,
|
|
6032
6135
|
height: "2px"
|
|
6033
6136
|
}));
|
|
6034
|
-
var StyledRange = (0,
|
|
6137
|
+
var StyledRange = (0, import_styled_components34.default)(RadixSlider.Range)(({ theme }) => ({
|
|
6035
6138
|
position: "absolute",
|
|
6036
6139
|
backgroundColor: theme.colors.primary,
|
|
6037
6140
|
borderRadius: "9999px",
|
|
6038
6141
|
height: "100%"
|
|
6039
6142
|
}));
|
|
6040
|
-
var StyledThumb2 = (0,
|
|
6143
|
+
var StyledThumb2 = (0, import_styled_components34.default)(RadixSlider.Thumb)(({ theme }) => ({
|
|
6041
6144
|
display: "block",
|
|
6042
6145
|
width: "12px",
|
|
6043
6146
|
height: "12px",
|
|
@@ -6055,17 +6158,17 @@ var Slider = function Slider2({
|
|
|
6055
6158
|
min,
|
|
6056
6159
|
max
|
|
6057
6160
|
}) {
|
|
6058
|
-
const arrayValue = (0,
|
|
6161
|
+
const arrayValue = (0, import_react59.useMemo)(
|
|
6059
6162
|
() => [Math.min(Math.max(value, min), max)],
|
|
6060
6163
|
[value, min, max]
|
|
6061
6164
|
);
|
|
6062
|
-
const handleValueChange = (0,
|
|
6165
|
+
const handleValueChange = (0, import_react59.useCallback)(
|
|
6063
6166
|
(arrayValue2) => {
|
|
6064
6167
|
onValueChange(arrayValue2[0]);
|
|
6065
6168
|
},
|
|
6066
6169
|
[onValueChange]
|
|
6067
6170
|
);
|
|
6068
|
-
return /* @__PURE__ */
|
|
6171
|
+
return /* @__PURE__ */ import_react59.default.createElement(
|
|
6069
6172
|
StyledSlider,
|
|
6070
6173
|
{
|
|
6071
6174
|
min,
|
|
@@ -6074,16 +6177,16 @@ var Slider = function Slider2({
|
|
|
6074
6177
|
value: arrayValue,
|
|
6075
6178
|
onValueChange: handleValueChange
|
|
6076
6179
|
},
|
|
6077
|
-
/* @__PURE__ */
|
|
6078
|
-
/* @__PURE__ */
|
|
6180
|
+
/* @__PURE__ */ import_react59.default.createElement(StyledTrack, null, /* @__PURE__ */ import_react59.default.createElement(StyledRange, null)),
|
|
6181
|
+
/* @__PURE__ */ import_react59.default.createElement(StyledThumb2, null)
|
|
6079
6182
|
);
|
|
6080
6183
|
};
|
|
6081
6184
|
|
|
6082
6185
|
// src/components/Switch.tsx
|
|
6083
6186
|
var SwitchPrimitive = __toESM(require("@radix-ui/react-switch"));
|
|
6084
|
-
var
|
|
6085
|
-
var
|
|
6086
|
-
var SwitchRoot = (0,
|
|
6187
|
+
var import_react60 = __toESM(require("react"));
|
|
6188
|
+
var import_styled_components35 = __toESM(require("styled-components"));
|
|
6189
|
+
var SwitchRoot = (0, import_styled_components35.default)(SwitchPrimitive.Root)(({ theme, $colorScheme }) => ({
|
|
6087
6190
|
all: "unset",
|
|
6088
6191
|
width: 32,
|
|
6089
6192
|
height: 19,
|
|
@@ -6100,7 +6203,7 @@ var SwitchRoot = (0, import_styled_components34.default)(SwitchPrimitive.Root)((
|
|
|
6100
6203
|
backgroundColor: $colorScheme === "primary" ? theme.colors.primary : $colorScheme === "secondary" ? theme.colors.secondary : void 0
|
|
6101
6204
|
}
|
|
6102
6205
|
}));
|
|
6103
|
-
var SwitchThumb = (0,
|
|
6206
|
+
var SwitchThumb = (0, import_styled_components35.default)(SwitchPrimitive.Thumb)({
|
|
6104
6207
|
display: "block",
|
|
6105
6208
|
width: 15,
|
|
6106
6209
|
height: 15,
|
|
@@ -6116,7 +6219,7 @@ var Switch = function Switch2({
|
|
|
6116
6219
|
onChange,
|
|
6117
6220
|
colorScheme = "normal"
|
|
6118
6221
|
}) {
|
|
6119
|
-
return /* @__PURE__ */
|
|
6222
|
+
return /* @__PURE__ */ import_react60.default.createElement(
|
|
6120
6223
|
SwitchRoot,
|
|
6121
6224
|
{
|
|
6122
6225
|
$colorScheme: colorScheme,
|
|
@@ -6125,62 +6228,62 @@ var Switch = function Switch2({
|
|
|
6125
6228
|
onChange(newValue);
|
|
6126
6229
|
}
|
|
6127
6230
|
},
|
|
6128
|
-
/* @__PURE__ */
|
|
6231
|
+
/* @__PURE__ */ import_react60.default.createElement(SwitchThumb, null)
|
|
6129
6232
|
);
|
|
6130
6233
|
};
|
|
6131
6234
|
|
|
6132
6235
|
// src/components/TreeView.tsx
|
|
6133
|
-
var
|
|
6134
|
-
var TreeRow = (0,
|
|
6236
|
+
var import_react61 = __toESM(require("react"));
|
|
6237
|
+
var TreeRow = (0, import_react61.forwardRef)(function TreeRow2({
|
|
6135
6238
|
icon,
|
|
6136
6239
|
expanded,
|
|
6137
6240
|
onClickChevron,
|
|
6138
6241
|
children,
|
|
6139
6242
|
...rest
|
|
6140
6243
|
}, forwardedRef) {
|
|
6141
|
-
const { expandable } = (0,
|
|
6142
|
-
const handleClickChevron = (0,
|
|
6244
|
+
const { expandable } = (0, import_react61.useContext)(ListView.RowContext);
|
|
6245
|
+
const handleClickChevron = (0, import_react61.useCallback)(
|
|
6143
6246
|
(event) => {
|
|
6144
6247
|
event.stopPropagation();
|
|
6145
6248
|
onClickChevron?.({ altKey: event.altKey });
|
|
6146
6249
|
},
|
|
6147
6250
|
[onClickChevron]
|
|
6148
6251
|
);
|
|
6149
|
-
return /* @__PURE__ */
|
|
6252
|
+
return /* @__PURE__ */ import_react61.default.createElement(ListView.Row, { ref: forwardedRef, ...rest }, expandable && /* @__PURE__ */ import_react61.default.createElement(import_react61.default.Fragment, null, expanded === void 0 ? /* @__PURE__ */ import_react61.default.createElement(Spacer.Horizontal, { size: 19 }) : /* @__PURE__ */ import_react61.default.createElement(
|
|
6150
6253
|
IconButton,
|
|
6151
6254
|
{
|
|
6152
|
-
iconName: expanded ? "
|
|
6255
|
+
iconName: expanded ? "ChevronDownIcon2" : "ChevronRightIcon2",
|
|
6153
6256
|
onClick: handleClickChevron,
|
|
6154
6257
|
selected: rest.selected
|
|
6155
6258
|
}
|
|
6156
|
-
), /* @__PURE__ */
|
|
6259
|
+
), /* @__PURE__ */ import_react61.default.createElement(Spacer.Horizontal, { size: 6 })), icon && /* @__PURE__ */ import_react61.default.createElement(import_react61.default.Fragment, null, icon, /* @__PURE__ */ import_react61.default.createElement(Spacer.Horizontal, { size: 10 })), children);
|
|
6157
6260
|
});
|
|
6158
6261
|
var TreeView;
|
|
6159
6262
|
((TreeView2) => {
|
|
6160
6263
|
TreeView2.Root = ListView.Root;
|
|
6161
6264
|
TreeView2.RowTitle = ListView.RowTitle;
|
|
6162
6265
|
TreeView2.EditableRowTitle = ListView.EditableRowTitle;
|
|
6163
|
-
TreeView2.Row = (0,
|
|
6266
|
+
TreeView2.Row = (0, import_react61.memo)(TreeRow);
|
|
6164
6267
|
})(TreeView || (TreeView = {}));
|
|
6165
6268
|
|
|
6166
6269
|
// src/components/WorkspaceLayout.tsx
|
|
6167
6270
|
var import_noya_keymap5 = require("@noya-app/noya-keymap");
|
|
6168
|
-
var
|
|
6271
|
+
var import_react64 = __toESM(require("react"));
|
|
6169
6272
|
var import_react_resizable_panels = require("react-resizable-panels");
|
|
6170
6273
|
|
|
6171
6274
|
// src/hooks/usePreservePanelSize.tsx
|
|
6172
|
-
var
|
|
6275
|
+
var import_react63 = require("react");
|
|
6173
6276
|
|
|
6174
6277
|
// src/hooks/useWindowSize.tsx
|
|
6175
|
-
var
|
|
6278
|
+
var import_react62 = require("react");
|
|
6176
6279
|
function useWindowSize() {
|
|
6177
|
-
const [size2, setSize] = (0,
|
|
6280
|
+
const [size2, setSize] = (0, import_react62.useState)(
|
|
6178
6281
|
typeof window === "undefined" ? { width: 0, height: 0 } : {
|
|
6179
6282
|
width: window.innerWidth,
|
|
6180
6283
|
height: window.innerHeight
|
|
6181
6284
|
}
|
|
6182
6285
|
);
|
|
6183
|
-
(0,
|
|
6286
|
+
(0, import_react62.useEffect)(() => {
|
|
6184
6287
|
const handleResize = () => setSize({
|
|
6185
6288
|
width: window.innerWidth,
|
|
6186
6289
|
height: window.innerHeight
|
|
@@ -6198,8 +6301,8 @@ var RIGHT_SIDEBAR_ID = "editor-right-sidebar";
|
|
|
6198
6301
|
var CONTENT_AREA_ID = "editor-content-area";
|
|
6199
6302
|
function usePreservePanelSize(panelGroupRef, setPanelLayoutState) {
|
|
6200
6303
|
const windowSize = useWindowSize();
|
|
6201
|
-
const layoutRef = (0,
|
|
6202
|
-
(0,
|
|
6304
|
+
const layoutRef = (0, import_react63.useRef)();
|
|
6305
|
+
(0, import_react63.useLayoutEffect)(() => {
|
|
6203
6306
|
const panelGroup = document.querySelector(
|
|
6204
6307
|
`[data-panel-group-id="${EDITOR_PANEL_GROUP_ID}"]`
|
|
6205
6308
|
);
|
|
@@ -6242,7 +6345,7 @@ function usePreservePanelSize(panelGroupRef, setPanelLayoutState) {
|
|
|
6242
6345
|
panelGroupObserver.disconnect();
|
|
6243
6346
|
};
|
|
6244
6347
|
}, [panelGroupRef, setPanelLayoutState]);
|
|
6245
|
-
(0,
|
|
6348
|
+
(0, import_react63.useLayoutEffect)(() => {
|
|
6246
6349
|
if (!layoutRef.current)
|
|
6247
6350
|
return;
|
|
6248
6351
|
const {
|
|
@@ -6302,7 +6405,7 @@ function usePreservePanelSize(panelGroupRef, setPanelLayoutState) {
|
|
|
6302
6405
|
}
|
|
6303
6406
|
|
|
6304
6407
|
// src/components/WorkspaceLayout.tsx
|
|
6305
|
-
var WorkspaceLayout = (0,
|
|
6408
|
+
var WorkspaceLayout = (0, import_react64.forwardRef)(function WorkspaceLayout2({
|
|
6306
6409
|
autoSavePrefix,
|
|
6307
6410
|
leftSidebarContent: leftPanelContent,
|
|
6308
6411
|
children: centerPanelContent,
|
|
@@ -6327,12 +6430,12 @@ var WorkspaceLayout = (0, import_react63.forwardRef)(function WorkspaceLayout2({
|
|
|
6327
6430
|
const rightSidebarPercentage = getPercentage(rightSidebarInitialSize);
|
|
6328
6431
|
const leftSidebarMinPercentage = leftSidebarMinSize !== void 0 ? getPercentage(leftSidebarMinSize) : void 0;
|
|
6329
6432
|
const rightSidebarMinPercentage = rightSidebarMinSize !== void 0 ? getPercentage(rightSidebarMinSize) : void 0;
|
|
6330
|
-
const panelGroupRef = (0,
|
|
6331
|
-
const leftSidebarRef = (0,
|
|
6332
|
-
const rightSidebarRef = (0,
|
|
6433
|
+
const panelGroupRef = (0, import_react64.useRef)(null);
|
|
6434
|
+
const leftSidebarRef = (0, import_react64.useRef)(null);
|
|
6435
|
+
const rightSidebarRef = (0, import_react64.useRef)(null);
|
|
6333
6436
|
usePreservePanelSize(panelGroupRef, onChangeLayoutState);
|
|
6334
6437
|
const theme = useDesignSystemTheme();
|
|
6335
|
-
(0,
|
|
6438
|
+
(0, import_react64.useImperativeHandle)(forwardedRef, () => ({
|
|
6336
6439
|
setLeftSidebarExpanded: (expanded) => {
|
|
6337
6440
|
if (expanded) {
|
|
6338
6441
|
leftSidebarRef.current?.expand();
|
|
@@ -6389,7 +6492,7 @@ var WorkspaceLayout = (0, import_react63.forwardRef)(function WorkspaceLayout2({
|
|
|
6389
6492
|
}
|
|
6390
6493
|
});
|
|
6391
6494
|
const centerPanelPercentage = 100 - (leftPanelContent ? leftSidebarPercentage : 0) - (rightPanelContent ? rightSidebarPercentage : 0);
|
|
6392
|
-
return /* @__PURE__ */
|
|
6495
|
+
return /* @__PURE__ */ import_react64.default.createElement(
|
|
6393
6496
|
"div",
|
|
6394
6497
|
{
|
|
6395
6498
|
id,
|
|
@@ -6401,7 +6504,7 @@ var WorkspaceLayout = (0, import_react63.forwardRef)(function WorkspaceLayout2({
|
|
|
6401
6504
|
...style3
|
|
6402
6505
|
}
|
|
6403
6506
|
},
|
|
6404
|
-
/* @__PURE__ */
|
|
6507
|
+
/* @__PURE__ */ import_react64.default.createElement(
|
|
6405
6508
|
import_react_resizable_panels.PanelGroup,
|
|
6406
6509
|
{
|
|
6407
6510
|
ref: panelGroupRef,
|
|
@@ -6410,7 +6513,7 @@ var WorkspaceLayout = (0, import_react63.forwardRef)(function WorkspaceLayout2({
|
|
|
6410
6513
|
autoSaveId: autoSavePrefix ? `${autoSavePrefix}--${EDITOR_PANEL_GROUP_ID}` : void 0,
|
|
6411
6514
|
style: { flex: "1" }
|
|
6412
6515
|
},
|
|
6413
|
-
hasLeftSidebar && /* @__PURE__ */
|
|
6516
|
+
hasLeftSidebar && /* @__PURE__ */ import_react64.default.createElement(import_react64.default.Fragment, null, /* @__PURE__ */ import_react64.default.createElement(
|
|
6414
6517
|
import_react_resizable_panels.Panel,
|
|
6415
6518
|
{
|
|
6416
6519
|
id: LEFT_SIDEBAR_ID,
|
|
@@ -6422,11 +6525,12 @@ var WorkspaceLayout = (0, import_react63.forwardRef)(function WorkspaceLayout2({
|
|
|
6422
6525
|
collapsible: true,
|
|
6423
6526
|
style: {
|
|
6424
6527
|
display: "flex",
|
|
6425
|
-
flexDirection: "row"
|
|
6528
|
+
flexDirection: "row",
|
|
6529
|
+
position: "relative"
|
|
6426
6530
|
}
|
|
6427
6531
|
},
|
|
6428
6532
|
leftPanelContent
|
|
6429
|
-
), /* @__PURE__ */
|
|
6533
|
+
), /* @__PURE__ */ import_react64.default.createElement(
|
|
6430
6534
|
import_react_resizable_panels.PanelResizeHandle,
|
|
6431
6535
|
{
|
|
6432
6536
|
style: {
|
|
@@ -6437,7 +6541,7 @@ var WorkspaceLayout = (0, import_react63.forwardRef)(function WorkspaceLayout2({
|
|
|
6437
6541
|
}
|
|
6438
6542
|
}
|
|
6439
6543
|
)),
|
|
6440
|
-
/* @__PURE__ */
|
|
6544
|
+
/* @__PURE__ */ import_react64.default.createElement(
|
|
6441
6545
|
import_react_resizable_panels.Panel,
|
|
6442
6546
|
{
|
|
6443
6547
|
id: CONTENT_AREA_ID,
|
|
@@ -6446,12 +6550,13 @@ var WorkspaceLayout = (0, import_react63.forwardRef)(function WorkspaceLayout2({
|
|
|
6446
6550
|
minSize: 10,
|
|
6447
6551
|
style: {
|
|
6448
6552
|
display: "flex",
|
|
6449
|
-
flexDirection: "row"
|
|
6553
|
+
flexDirection: "row",
|
|
6554
|
+
position: "relative"
|
|
6450
6555
|
}
|
|
6451
6556
|
},
|
|
6452
6557
|
centerPanelContent
|
|
6453
6558
|
),
|
|
6454
|
-
hasRightSidebar && /* @__PURE__ */
|
|
6559
|
+
hasRightSidebar && /* @__PURE__ */ import_react64.default.createElement(import_react64.default.Fragment, null, /* @__PURE__ */ import_react64.default.createElement(
|
|
6455
6560
|
import_react_resizable_panels.PanelResizeHandle,
|
|
6456
6561
|
{
|
|
6457
6562
|
style: {
|
|
@@ -6461,7 +6566,7 @@ var WorkspaceLayout = (0, import_react63.forwardRef)(function WorkspaceLayout2({
|
|
|
6461
6566
|
backgroundColor: theme.colors.divider
|
|
6462
6567
|
}
|
|
6463
6568
|
}
|
|
6464
|
-
), /* @__PURE__ */
|
|
6569
|
+
), /* @__PURE__ */ import_react64.default.createElement(
|
|
6465
6570
|
import_react_resizable_panels.Panel,
|
|
6466
6571
|
{
|
|
6467
6572
|
id: RIGHT_SIDEBAR_ID,
|
|
@@ -6472,7 +6577,8 @@ var WorkspaceLayout = (0, import_react63.forwardRef)(function WorkspaceLayout2({
|
|
|
6472
6577
|
collapsible: true,
|
|
6473
6578
|
style: {
|
|
6474
6579
|
display: "flex",
|
|
6475
|
-
flexDirection: "row"
|
|
6580
|
+
flexDirection: "row",
|
|
6581
|
+
position: "relative"
|
|
6476
6582
|
}
|
|
6477
6583
|
},
|
|
6478
6584
|
rightPanelContent
|
|
@@ -6523,8 +6629,8 @@ var SUPPORTED_CANVAS_UPLOAD_TYPES = [
|
|
|
6523
6629
|
|
|
6524
6630
|
// src/components/ArrayController.tsx
|
|
6525
6631
|
var import_noya_utils11 = require("@noya-app/noya-utils");
|
|
6526
|
-
var
|
|
6527
|
-
var
|
|
6632
|
+
var import_react66 = __toESM(require("react"));
|
|
6633
|
+
var import_styled_components37 = __toESM(require("styled-components"));
|
|
6528
6634
|
|
|
6529
6635
|
// src/components/InspectorPrimitives.tsx
|
|
6530
6636
|
var InspectorPrimitives_exports = {};
|
|
@@ -6542,20 +6648,20 @@ __export(InspectorPrimitives_exports, {
|
|
|
6542
6648
|
Title: () => Title3,
|
|
6543
6649
|
VerticalSeparator: () => VerticalSeparator
|
|
6544
6650
|
});
|
|
6545
|
-
var
|
|
6546
|
-
var
|
|
6547
|
-
var Section =
|
|
6651
|
+
var import_react65 = __toESM(require("react"));
|
|
6652
|
+
var import_styled_components36 = __toESM(require("styled-components"));
|
|
6653
|
+
var Section = import_styled_components36.default.div(({ theme, $padding = "10px", $gap }) => ({
|
|
6548
6654
|
flex: "0 0 auto",
|
|
6549
6655
|
display: "flex",
|
|
6550
6656
|
flexDirection: "column",
|
|
6551
6657
|
padding: $padding,
|
|
6552
6658
|
gap: $gap
|
|
6553
6659
|
}));
|
|
6554
|
-
var SectionHeader =
|
|
6660
|
+
var SectionHeader = import_styled_components36.default.div(({ theme }) => ({
|
|
6555
6661
|
display: "flex",
|
|
6556
6662
|
alignItems: "center"
|
|
6557
6663
|
}));
|
|
6558
|
-
var Title3 =
|
|
6664
|
+
var Title3 = import_styled_components36.default.div(({ theme, $textStyle }) => ({
|
|
6559
6665
|
display: "flex",
|
|
6560
6666
|
flexDirection: "row",
|
|
6561
6667
|
userSelect: "none",
|
|
@@ -6568,7 +6674,7 @@ var Title3 = import_styled_components35.default.div(({ theme, $textStyle }) => (
|
|
|
6568
6674
|
fontWeight: "bold"
|
|
6569
6675
|
}
|
|
6570
6676
|
}));
|
|
6571
|
-
var Row2 =
|
|
6677
|
+
var Row2 = import_styled_components36.default.div(
|
|
6572
6678
|
({ theme, $gap }) => ({
|
|
6573
6679
|
flex: "1",
|
|
6574
6680
|
display: "flex",
|
|
@@ -6577,26 +6683,26 @@ var Row2 = import_styled_components35.default.div(
|
|
|
6577
6683
|
gap: $gap
|
|
6578
6684
|
})
|
|
6579
6685
|
);
|
|
6580
|
-
var Column =
|
|
6686
|
+
var Column = import_styled_components36.default.div(({ theme }) => ({
|
|
6581
6687
|
flex: "1",
|
|
6582
6688
|
display: "flex",
|
|
6583
6689
|
flexDirection: "column",
|
|
6584
6690
|
gap: "4px"
|
|
6585
6691
|
}));
|
|
6586
|
-
var Checkbox =
|
|
6692
|
+
var Checkbox = import_styled_components36.default.input(({ theme }) => ({
|
|
6587
6693
|
margin: 0
|
|
6588
6694
|
}));
|
|
6589
|
-
var Text3 =
|
|
6695
|
+
var Text3 = import_styled_components36.default.span(({ theme }) => ({
|
|
6590
6696
|
...theme.textStyles.small
|
|
6591
6697
|
}));
|
|
6592
|
-
var VerticalSeparator = () => /* @__PURE__ */
|
|
6593
|
-
var HorizontalSeparator = () => /* @__PURE__ */
|
|
6594
|
-
var SliderRowLabel =
|
|
6698
|
+
var VerticalSeparator = () => /* @__PURE__ */ import_react65.default.createElement(Spacer.Vertical, { size: (0, import_styled_components36.useTheme)().sizes.inspector.verticalSeparator });
|
|
6699
|
+
var HorizontalSeparator = () => /* @__PURE__ */ import_react65.default.createElement(Spacer.Horizontal, { size: (0, import_styled_components36.useTheme)().sizes.inspector.horizontalSeparator });
|
|
6700
|
+
var SliderRowLabel = import_styled_components36.default.span(({ theme }) => ({
|
|
6595
6701
|
...theme.textStyles.small,
|
|
6596
6702
|
color: theme.colors.textMuted,
|
|
6597
6703
|
marginBottom: "-6px"
|
|
6598
6704
|
}));
|
|
6599
|
-
var RowLabel =
|
|
6705
|
+
var RowLabel = import_styled_components36.default.span(({ theme, $textStyle }) => ({
|
|
6600
6706
|
// marginBottom: '6px',
|
|
6601
6707
|
display: "flex",
|
|
6602
6708
|
...$textStyle ? {
|
|
@@ -6610,7 +6716,7 @@ var RowLabel = import_styled_components35.default.span(({ theme, $textStyle }) =
|
|
|
6610
6716
|
// Button height
|
|
6611
6717
|
alignItems: "center"
|
|
6612
6718
|
}));
|
|
6613
|
-
var LabeledRow = (0,
|
|
6719
|
+
var LabeledRow = (0, import_react65.memo)(function LabeledRow2({
|
|
6614
6720
|
id,
|
|
6615
6721
|
children,
|
|
6616
6722
|
label,
|
|
@@ -6618,26 +6724,26 @@ var LabeledRow = (0, import_react64.memo)(function LabeledRow2({
|
|
|
6618
6724
|
gap,
|
|
6619
6725
|
right
|
|
6620
6726
|
}) {
|
|
6621
|
-
return /* @__PURE__ */
|
|
6727
|
+
return /* @__PURE__ */ import_react65.default.createElement(Row2, { id }, /* @__PURE__ */ import_react65.default.createElement(Column, null, /* @__PURE__ */ import_react65.default.createElement(RowLabel, { $textStyle: labelTextStyle }, label, right && /* @__PURE__ */ import_react65.default.createElement(Spacer.Horizontal, null), right), /* @__PURE__ */ import_react65.default.createElement(Row2, { $gap: gap }, children)));
|
|
6622
6728
|
});
|
|
6623
|
-
var LabeledSliderRow = (0,
|
|
6729
|
+
var LabeledSliderRow = (0, import_react65.memo)(function LabeledRow3({
|
|
6624
6730
|
children,
|
|
6625
6731
|
label
|
|
6626
6732
|
}) {
|
|
6627
|
-
return /* @__PURE__ */
|
|
6733
|
+
return /* @__PURE__ */ import_react65.default.createElement(Row2, null, /* @__PURE__ */ import_react65.default.createElement(Column, null, /* @__PURE__ */ import_react65.default.createElement(SliderRowLabel, null, label), /* @__PURE__ */ import_react65.default.createElement(Row2, null, children)));
|
|
6628
6734
|
});
|
|
6629
6735
|
|
|
6630
6736
|
// src/components/ArrayController.tsx
|
|
6631
|
-
var ElementRow =
|
|
6737
|
+
var ElementRow = import_styled_components37.default.div({
|
|
6632
6738
|
flex: "0 0 auto",
|
|
6633
6739
|
display: "flex",
|
|
6634
6740
|
flexDirection: "row",
|
|
6635
6741
|
alignItems: "center"
|
|
6636
6742
|
});
|
|
6637
|
-
var ItemContainer2 =
|
|
6743
|
+
var ItemContainer2 = import_styled_components37.default.div({
|
|
6638
6744
|
position: "relative"
|
|
6639
6745
|
});
|
|
6640
|
-
var ArrayController = (0,
|
|
6746
|
+
var ArrayController = (0, import_react66.memo)(function ArrayController2({
|
|
6641
6747
|
id,
|
|
6642
6748
|
items,
|
|
6643
6749
|
title,
|
|
@@ -6653,14 +6759,14 @@ var ArrayController = (0, import_react65.memo)(function ArrayController2({
|
|
|
6653
6759
|
renderExpandedContent,
|
|
6654
6760
|
padding = 10
|
|
6655
6761
|
}) {
|
|
6656
|
-
const iconColor = (0,
|
|
6657
|
-
const primaryLightColor = (0,
|
|
6658
|
-
const keys = (0,
|
|
6762
|
+
const iconColor = (0, import_styled_components37.useTheme)().colors.icon;
|
|
6763
|
+
const primaryLightColor = (0, import_styled_components37.useTheme)().colors.primaryLight;
|
|
6764
|
+
const keys = (0, import_react66.useMemo)(
|
|
6659
6765
|
() => items.map((item, index) => getKey?.(item) ?? index.toString()),
|
|
6660
6766
|
[getKey, items]
|
|
6661
6767
|
);
|
|
6662
6768
|
const indexes = reversed ? (0, import_noya_utils11.range)(0, items.length).reverse() : (0, import_noya_utils11.range)(0, items.length);
|
|
6663
|
-
const handleMoveItem = (0,
|
|
6769
|
+
const handleMoveItem = (0, import_react66.useCallback)(
|
|
6664
6770
|
(sourceIndex, destinationIndex, position) => {
|
|
6665
6771
|
if (reversed) {
|
|
6666
6772
|
if (position === "above") {
|
|
@@ -6677,11 +6783,11 @@ var ArrayController = (0, import_react65.memo)(function ArrayController2({
|
|
|
6677
6783
|
[onMoveItem, reversed]
|
|
6678
6784
|
);
|
|
6679
6785
|
const renderRow = (index) => {
|
|
6680
|
-
return /* @__PURE__ */
|
|
6786
|
+
return /* @__PURE__ */ import_react66.default.createElement(ElementRow, { key: keys[index] }, renderItem({ item: items[index], index }));
|
|
6681
6787
|
};
|
|
6682
|
-
return /* @__PURE__ */
|
|
6788
|
+
return /* @__PURE__ */ import_react66.default.createElement(Section, { id, $padding: padding, $gap: "2px" }, /* @__PURE__ */ import_react66.default.createElement(SectionHeader, null, /* @__PURE__ */ import_react66.default.createElement(Button, { variant: "none", onClick: onClickPlus }, /* @__PURE__ */ import_react66.default.createElement(Title3, null, title)), /* @__PURE__ */ import_react66.default.createElement(Spacer.Horizontal, null), withSeparatorElements(
|
|
6683
6789
|
[
|
|
6684
|
-
onClickTrash && /* @__PURE__ */
|
|
6790
|
+
onClickTrash && /* @__PURE__ */ import_react66.default.createElement(
|
|
6685
6791
|
IconButton,
|
|
6686
6792
|
{
|
|
6687
6793
|
id: `${id}-trash`,
|
|
@@ -6690,7 +6796,7 @@ var ArrayController = (0, import_react65.memo)(function ArrayController2({
|
|
|
6690
6796
|
onClick: onClickTrash
|
|
6691
6797
|
}
|
|
6692
6798
|
),
|
|
6693
|
-
onClickExpand && /* @__PURE__ */
|
|
6799
|
+
onClickExpand && /* @__PURE__ */ import_react66.default.createElement(
|
|
6694
6800
|
IconButton,
|
|
6695
6801
|
{
|
|
6696
6802
|
id: `${id}-gear`,
|
|
@@ -6699,7 +6805,7 @@ var ArrayController = (0, import_react65.memo)(function ArrayController2({
|
|
|
6699
6805
|
onClick: onClickExpand
|
|
6700
6806
|
}
|
|
6701
6807
|
),
|
|
6702
|
-
onClickPlus && /* @__PURE__ */
|
|
6808
|
+
onClickPlus && /* @__PURE__ */ import_react66.default.createElement(
|
|
6703
6809
|
IconButton,
|
|
6704
6810
|
{
|
|
6705
6811
|
id: `${id}-add`,
|
|
@@ -6709,15 +6815,15 @@ var ArrayController = (0, import_react65.memo)(function ArrayController2({
|
|
|
6709
6815
|
}
|
|
6710
6816
|
)
|
|
6711
6817
|
],
|
|
6712
|
-
/* @__PURE__ */
|
|
6713
|
-
)), /* @__PURE__ */
|
|
6818
|
+
/* @__PURE__ */ import_react66.default.createElement(Spacer.Horizontal, { size: 8 })
|
|
6819
|
+
)), /* @__PURE__ */ import_react66.default.createElement(Stack.V, { gap: "4px" }, sortable ? /* @__PURE__ */ import_react66.default.createElement(
|
|
6714
6820
|
Sortable.Root,
|
|
6715
6821
|
{
|
|
6716
6822
|
keys,
|
|
6717
6823
|
renderOverlay: renderRow,
|
|
6718
6824
|
onMoveItem: handleMoveItem
|
|
6719
6825
|
},
|
|
6720
|
-
indexes.map((index) => /* @__PURE__ */
|
|
6826
|
+
indexes.map((index) => /* @__PURE__ */ import_react66.default.createElement(Sortable.Item, { id: keys[index], key: keys[index] }, ({ relativeDropPosition, ...sortableProps }) => /* @__PURE__ */ import_react66.default.createElement(ItemContainer2, { ...sortableProps }, renderRow(index), relativeDropPosition && /* @__PURE__ */ import_react66.default.createElement(
|
|
6721
6827
|
ListView.DragIndicator,
|
|
6722
6828
|
{
|
|
6723
6829
|
$gap: 0,
|
|
@@ -6731,11 +6837,11 @@ var ArrayController = (0, import_react65.memo)(function ArrayController2({
|
|
|
6731
6837
|
|
|
6732
6838
|
// src/components/DimensionInput.tsx
|
|
6733
6839
|
var import_noya_utils12 = require("@noya-app/noya-utils");
|
|
6734
|
-
var
|
|
6840
|
+
var import_react67 = __toESM(require("react"));
|
|
6735
6841
|
function getNewValue(value, mode, delta) {
|
|
6736
6842
|
return delta === void 0 ? value : mode === "replace" ? delta : value + delta;
|
|
6737
6843
|
}
|
|
6738
|
-
var DimensionInput = (0,
|
|
6844
|
+
var DimensionInput = (0, import_react67.memo)(function DimensionInput2({
|
|
6739
6845
|
id,
|
|
6740
6846
|
value,
|
|
6741
6847
|
onSetValue,
|
|
@@ -6745,15 +6851,15 @@ var DimensionInput = (0, import_react66.memo)(function DimensionInput2({
|
|
|
6745
6851
|
disabled,
|
|
6746
6852
|
trigger = "submit"
|
|
6747
6853
|
}) {
|
|
6748
|
-
const handleNudgeValue = (0,
|
|
6854
|
+
const handleNudgeValue = (0, import_react67.useCallback)(
|
|
6749
6855
|
(value2) => onSetValue(value2, "adjust"),
|
|
6750
6856
|
[onSetValue]
|
|
6751
6857
|
);
|
|
6752
|
-
const handleSetValue = (0,
|
|
6858
|
+
const handleSetValue = (0, import_react67.useCallback)(
|
|
6753
6859
|
(value2) => onSetValue(value2, "replace"),
|
|
6754
6860
|
[onSetValue]
|
|
6755
6861
|
);
|
|
6756
|
-
return /* @__PURE__ */
|
|
6862
|
+
return /* @__PURE__ */ import_react67.default.createElement(InputField.Root, { id, width: size2 }, /* @__PURE__ */ import_react67.default.createElement(
|
|
6757
6863
|
InputField.NumberInput,
|
|
6758
6864
|
{
|
|
6759
6865
|
value: value === void 0 ? value : (0, import_noya_utils12.round)(value, 2),
|
|
@@ -6762,7 +6868,7 @@ var DimensionInput = (0, import_react66.memo)(function DimensionInput2({
|
|
|
6762
6868
|
disabled,
|
|
6763
6869
|
...trigger === "change" ? { onChange: handleSetValue } : { onSubmit: handleSetValue }
|
|
6764
6870
|
}
|
|
6765
|
-
), label && /* @__PURE__ */
|
|
6871
|
+
), label && /* @__PURE__ */ import_react67.default.createElement(InputField.Label, null, label));
|
|
6766
6872
|
});
|
|
6767
6873
|
// Annotate the CommonJS export names for ESM import in node:
|
|
6768
6874
|
0 && (module.exports = {
|
|
@@ -6822,6 +6928,7 @@ var DimensionInput = (0, import_react66.memo)(function DimensionInput2({
|
|
|
6822
6928
|
SUPPORTED_IMAGE_UPLOAD_TYPES,
|
|
6823
6929
|
ScrollArea,
|
|
6824
6930
|
Select,
|
|
6931
|
+
SelectMenu,
|
|
6825
6932
|
SelectOption,
|
|
6826
6933
|
Slider,
|
|
6827
6934
|
Small,
|