@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.mjs
CHANGED
|
@@ -59,7 +59,7 @@ function mergeBreakpoints(breakpoints, transform) {
|
|
|
59
59
|
) : breakpoints;
|
|
60
60
|
const breakpointList = Object.entries(breakpointMap);
|
|
61
61
|
const transformedList = breakpointList.sort((a, b) => Number(b[0]) - Number(a[0])).map(([width, value]) => [
|
|
62
|
-
`@media
|
|
62
|
+
`@media (min-width: ${width}px)`,
|
|
63
63
|
transform?.(value) ?? value
|
|
64
64
|
]);
|
|
65
65
|
return Object.fromEntries(transformedList);
|
|
@@ -89,7 +89,17 @@ var Element = styled2.div(({ $styleProps, $breakpoints }) => ({
|
|
|
89
89
|
...$styleProps,
|
|
90
90
|
...mergeBreakpoints($breakpoints || [])
|
|
91
91
|
}));
|
|
92
|
-
var StackBase = forwardRef(function StackBase2({
|
|
92
|
+
var StackBase = forwardRef(function StackBase2({
|
|
93
|
+
id,
|
|
94
|
+
className,
|
|
95
|
+
as,
|
|
96
|
+
children,
|
|
97
|
+
separator,
|
|
98
|
+
breakpoints,
|
|
99
|
+
tabIndex,
|
|
100
|
+
href,
|
|
101
|
+
...rest
|
|
102
|
+
}, forwardedRef) {
|
|
93
103
|
const elements2 = separator ? withSeparatorElements(Children2.toArray(children), separator) : children;
|
|
94
104
|
const styleProps = {
|
|
95
105
|
display: "flex",
|
|
@@ -102,6 +112,7 @@ var StackBase = forwardRef(function StackBase2({ id, as, children, separator, br
|
|
|
102
112
|
{
|
|
103
113
|
ref: forwardedRef,
|
|
104
114
|
id,
|
|
115
|
+
className,
|
|
105
116
|
as,
|
|
106
117
|
$styleProps: styleProps,
|
|
107
118
|
$breakpoints: breakpoints,
|
|
@@ -254,9 +265,9 @@ var ButtonElement = styled5.button(
|
|
|
254
265
|
textAlign: "left",
|
|
255
266
|
borderRadius: "4px",
|
|
256
267
|
paddingTop: $variant === "none" ? "0px" : "4px",
|
|
257
|
-
paddingRight: $variant === "none" ? "0px" : $variant === "thin" ? "1px" : "
|
|
268
|
+
paddingRight: $variant === "none" ? "0px" : $variant === "thin" ? "1px" : "6px",
|
|
258
269
|
paddingBottom: $variant === "none" ? "0px" : "4px",
|
|
259
|
-
paddingLeft: $variant === "none" ? "0px" : $variant === "thin" ? "1px" : "
|
|
270
|
+
paddingLeft: $variant === "none" ? "0px" : $variant === "thin" ? "1px" : "6px",
|
|
260
271
|
...$size === "large" && {
|
|
261
272
|
paddingTop: "12px",
|
|
262
273
|
paddingRight: "16px",
|
|
@@ -386,7 +397,7 @@ var Button = forwardRef3(function Button2({
|
|
|
386
397
|
|
|
387
398
|
// src/components/Chip.tsx
|
|
388
399
|
import { Cross1Icon, PlusIcon } from "@noya-app/noya-icons";
|
|
389
|
-
import React22, { memo as memo11 } from "react";
|
|
400
|
+
import React22, { forwardRef as forwardRef10, memo as memo11 } from "react";
|
|
390
401
|
import styled14 from "styled-components";
|
|
391
402
|
|
|
392
403
|
// src/contexts/DesignSystemConfiguration.tsx
|
|
@@ -397,7 +408,7 @@ import React20, {
|
|
|
397
408
|
useContext as useContext5,
|
|
398
409
|
useEffect as useEffect11,
|
|
399
410
|
useMemo as useMemo9,
|
|
400
|
-
useState as
|
|
411
|
+
useState as useState14
|
|
401
412
|
} from "react";
|
|
402
413
|
import { ThemeProvider, useTheme as useTheme2 } from "styled-components";
|
|
403
414
|
|
|
@@ -698,7 +709,8 @@ var textStyles = {
|
|
|
698
709
|
fontFamily: fonts.normal,
|
|
699
710
|
fontSize: "0.62rem",
|
|
700
711
|
fontWeight: 400,
|
|
701
|
-
lineHeight: "
|
|
712
|
+
lineHeight: "19px",
|
|
713
|
+
// lineHeight: "1.4",
|
|
702
714
|
textTransform: "uppercase",
|
|
703
715
|
letterSpacing: "-0.3px"
|
|
704
716
|
}
|
|
@@ -775,7 +787,7 @@ import React18, {
|
|
|
775
787
|
useContext as useContext3,
|
|
776
788
|
useMemo as useMemo7,
|
|
777
789
|
useRef as useRef11,
|
|
778
|
-
useState as
|
|
790
|
+
useState as useState12
|
|
779
791
|
} from "react";
|
|
780
792
|
import styled13 from "styled-components";
|
|
781
793
|
|
|
@@ -1225,7 +1237,8 @@ import React17, {
|
|
|
1225
1237
|
useEffect as useEffect10,
|
|
1226
1238
|
useLayoutEffect as useLayoutEffect4,
|
|
1227
1239
|
useMemo as useMemo6,
|
|
1228
|
-
useRef as useRef10
|
|
1240
|
+
useRef as useRef10,
|
|
1241
|
+
useState as useState11
|
|
1229
1242
|
} from "react";
|
|
1230
1243
|
import styled12 from "styled-components";
|
|
1231
1244
|
|
|
@@ -1790,13 +1803,7 @@ function Popover({
|
|
|
1790
1803
|
onFocusOutside,
|
|
1791
1804
|
onPointerDownOutside,
|
|
1792
1805
|
collisionPadding: 8,
|
|
1793
|
-
arrowPadding: 2
|
|
1794
|
-
onPointerDown: (event) => {
|
|
1795
|
-
event.stopPropagation();
|
|
1796
|
-
},
|
|
1797
|
-
onWheel: (event) => {
|
|
1798
|
-
event.stopPropagation();
|
|
1799
|
-
}
|
|
1806
|
+
arrowPadding: 2
|
|
1800
1807
|
},
|
|
1801
1808
|
children,
|
|
1802
1809
|
showArrow && /* @__PURE__ */ React16.createElement(ArrowElement, null),
|
|
@@ -2057,9 +2064,10 @@ function parseNumber(value) {
|
|
|
2057
2064
|
return value ? Number(value) : NaN;
|
|
2058
2065
|
}
|
|
2059
2066
|
function InputFieldNumberInput(props) {
|
|
2060
|
-
const { value, placeholder, onNudge, ...rest } = props;
|
|
2067
|
+
const { value, placeholder, onNudge, onBlur, ...rest } = props;
|
|
2061
2068
|
const onSubmit = "onSubmit" in props ? props.onSubmit : void 0;
|
|
2062
2069
|
const onChange = "onChange" in props ? props.onChange : void 0;
|
|
2070
|
+
const [internalValue, setInternalValue] = useState11();
|
|
2063
2071
|
const handleSubmit = useCallback11(
|
|
2064
2072
|
(value2) => {
|
|
2065
2073
|
const newValue = parseNumber(value2);
|
|
@@ -2075,6 +2083,7 @@ function InputFieldNumberInput(props) {
|
|
|
2075
2083
|
if (!amount)
|
|
2076
2084
|
return;
|
|
2077
2085
|
onNudge?.(amount);
|
|
2086
|
+
setInternalValue(void 0);
|
|
2078
2087
|
event.preventDefault();
|
|
2079
2088
|
event.stopPropagation();
|
|
2080
2089
|
},
|
|
@@ -2082,17 +2091,37 @@ function InputFieldNumberInput(props) {
|
|
|
2082
2091
|
);
|
|
2083
2092
|
const handleChange = useCallback11(
|
|
2084
2093
|
(value2) => {
|
|
2085
|
-
|
|
2094
|
+
if (value2 === "" || value2 === "-" || value2 === ".") {
|
|
2095
|
+
setInternalValue(value2);
|
|
2096
|
+
return;
|
|
2097
|
+
}
|
|
2098
|
+
if (value2.endsWith(".")) {
|
|
2099
|
+
setInternalValue(value2);
|
|
2100
|
+
return;
|
|
2101
|
+
}
|
|
2102
|
+
setInternalValue(void 0);
|
|
2103
|
+
const newValue = parseNumber(value2);
|
|
2104
|
+
if (!isNaN(newValue)) {
|
|
2105
|
+
onChange?.(newValue);
|
|
2106
|
+
}
|
|
2086
2107
|
},
|
|
2087
2108
|
[onChange]
|
|
2088
2109
|
);
|
|
2110
|
+
const handleBlur = useCallback11(
|
|
2111
|
+
(event) => {
|
|
2112
|
+
setInternalValue(void 0);
|
|
2113
|
+
onBlur?.(event);
|
|
2114
|
+
},
|
|
2115
|
+
[onBlur]
|
|
2116
|
+
);
|
|
2089
2117
|
return /* @__PURE__ */ React17.createElement(
|
|
2090
2118
|
InputFieldInput,
|
|
2091
2119
|
{
|
|
2092
2120
|
...rest,
|
|
2093
|
-
value: value === void 0 ? "" : String(value),
|
|
2121
|
+
value: internalValue !== void 0 ? String(internalValue) : value === void 0 ? "" : String(value),
|
|
2094
2122
|
placeholder,
|
|
2095
2123
|
onKeyDown: handleKeyDown,
|
|
2124
|
+
onBlur: handleBlur,
|
|
2096
2125
|
..."onChange" in props ? { onChange: handleChange } : { onSubmit: handleSubmit }
|
|
2097
2126
|
}
|
|
2098
2127
|
);
|
|
@@ -2115,7 +2144,9 @@ function InputFieldRoot({
|
|
|
2115
2144
|
labelSize,
|
|
2116
2145
|
size: size2 = "medium",
|
|
2117
2146
|
renderPopoverContent,
|
|
2118
|
-
onFocusChange
|
|
2147
|
+
onFocusChange,
|
|
2148
|
+
style: style3,
|
|
2149
|
+
className
|
|
2119
2150
|
}) {
|
|
2120
2151
|
const childrenArray = Children3.toArray(children);
|
|
2121
2152
|
const hasDropdown = childrenArray.some(
|
|
@@ -2167,7 +2198,17 @@ function InputFieldRoot({
|
|
|
2167
2198
|
inputRef
|
|
2168
2199
|
]
|
|
2169
2200
|
);
|
|
2170
|
-
const rootElement = /* @__PURE__ */ React17.createElement(
|
|
2201
|
+
const rootElement = /* @__PURE__ */ React17.createElement(
|
|
2202
|
+
RootContainer,
|
|
2203
|
+
{
|
|
2204
|
+
id,
|
|
2205
|
+
$width: width,
|
|
2206
|
+
$flex: flex,
|
|
2207
|
+
style: style3,
|
|
2208
|
+
className
|
|
2209
|
+
},
|
|
2210
|
+
children
|
|
2211
|
+
);
|
|
2171
2212
|
return /* @__PURE__ */ React17.createElement(InputFieldContext.Provider, { value: contextValue }, renderPopoverContent ? /* @__PURE__ */ React17.createElement(
|
|
2172
2213
|
Popover,
|
|
2173
2214
|
{
|
|
@@ -2220,7 +2261,7 @@ var DialogContext = createContext3(void 0);
|
|
|
2220
2261
|
var DialogProvider = function DialogProvider2({
|
|
2221
2262
|
children
|
|
2222
2263
|
}) {
|
|
2223
|
-
const [contents, setContents] =
|
|
2264
|
+
const [contents, setContents] = useState12();
|
|
2224
2265
|
const isOpen = !!contents;
|
|
2225
2266
|
const close = useCallback12(() => {
|
|
2226
2267
|
if (!contents)
|
|
@@ -2331,14 +2372,14 @@ function useDialogContainsElement() {
|
|
|
2331
2372
|
|
|
2332
2373
|
// src/contexts/FloatingWindowContext.tsx
|
|
2333
2374
|
import { uuid } from "@noya-app/noya-utils";
|
|
2334
|
-
import React19, { createContext as createContext4, useContext as useContext4, useMemo as useMemo8, useState as
|
|
2375
|
+
import React19, { createContext as createContext4, useContext as useContext4, useMemo as useMemo8, useState as useState13 } from "react";
|
|
2335
2376
|
import { createPortal } from "react-dom";
|
|
2336
2377
|
var FloatingWindowContext = createContext4(void 0);
|
|
2337
2378
|
var CurrentWindowContext = createContext4(void 0);
|
|
2338
2379
|
var FloatingWindowProvider = ({
|
|
2339
2380
|
children
|
|
2340
2381
|
}) => {
|
|
2341
|
-
const [windows, setWindows] =
|
|
2382
|
+
const [windows, setWindows] = useState13({});
|
|
2342
2383
|
const contextValue = useMemo8(() => {
|
|
2343
2384
|
const createWindow = (element) => {
|
|
2344
2385
|
const id = uuid();
|
|
@@ -2406,7 +2447,7 @@ var DesignSystemConfigurationProvider = memo10(
|
|
|
2406
2447
|
theme,
|
|
2407
2448
|
platform
|
|
2408
2449
|
}) {
|
|
2409
|
-
const [internalPlatform, setInternalPlatform] =
|
|
2450
|
+
const [internalPlatform, setInternalPlatform] = useState14(
|
|
2410
2451
|
platform ?? "key"
|
|
2411
2452
|
);
|
|
2412
2453
|
useEffect11(() => {
|
|
@@ -2609,76 +2650,78 @@ var AddElement = styled14(PlusIcon).withConfig({
|
|
|
2609
2650
|
opacity: 0.85
|
|
2610
2651
|
}
|
|
2611
2652
|
}));
|
|
2612
|
-
var Chip = memo11(
|
|
2613
|
-
|
|
2614
|
-
|
|
2615
|
-
deletable,
|
|
2616
|
-
addable,
|
|
2617
|
-
style: style3,
|
|
2618
|
-
size: size2 = "medium",
|
|
2619
|
-
variant = "solid",
|
|
2620
|
-
monospace = false,
|
|
2621
|
-
tabIndex,
|
|
2622
|
-
onDelete,
|
|
2623
|
-
onClick,
|
|
2624
|
-
onAdd,
|
|
2625
|
-
onHoverDeleteChange
|
|
2626
|
-
}) {
|
|
2627
|
-
const theme = useDesignSystemTheme();
|
|
2628
|
-
const { hoverProps: hoverDeleteProps } = useHover({
|
|
2629
|
-
onHoverChange: onHoverDeleteChange
|
|
2630
|
-
});
|
|
2631
|
-
const handleClick = !children && !deletable && addable ? onAdd : onClick;
|
|
2632
|
-
const color = colorScheme === "primary" ? theme.colors.primary : colorScheme === "secondary" ? theme.colors.secondary : theme.colors.text;
|
|
2633
|
-
return /* @__PURE__ */ React22.createElement(
|
|
2634
|
-
ChipElement,
|
|
2635
|
-
{
|
|
2636
|
-
$variant: variant,
|
|
2637
|
-
$colorScheme: colorScheme,
|
|
2638
|
-
style: style3,
|
|
2639
|
-
onClick: handleClick,
|
|
2640
|
-
$size: size2,
|
|
2641
|
-
$monospace: monospace,
|
|
2642
|
-
$isInteractive: !!handleClick,
|
|
2643
|
-
tabIndex
|
|
2644
|
-
},
|
|
2645
|
-
addable && /* @__PURE__ */ React22.createElement(
|
|
2646
|
-
AddElement,
|
|
2647
|
-
{
|
|
2648
|
-
size: size2,
|
|
2649
|
-
isOnlyChild: !children && !deletable,
|
|
2650
|
-
onClick: onAdd ? (event) => {
|
|
2651
|
-
event.stopPropagation();
|
|
2652
|
-
onAdd?.();
|
|
2653
|
-
} : void 0,
|
|
2654
|
-
color
|
|
2655
|
-
}
|
|
2656
|
-
),
|
|
2653
|
+
var Chip = memo11(
|
|
2654
|
+
forwardRef10(function Chip2({
|
|
2655
|
+
colorScheme,
|
|
2657
2656
|
children,
|
|
2658
|
-
deletable
|
|
2659
|
-
|
|
2657
|
+
deletable,
|
|
2658
|
+
addable,
|
|
2659
|
+
clickable,
|
|
2660
|
+
style: style3,
|
|
2661
|
+
size: size2 = "medium",
|
|
2662
|
+
variant = "solid",
|
|
2663
|
+
monospace = false,
|
|
2664
|
+
tabIndex,
|
|
2665
|
+
onDelete,
|
|
2666
|
+
onClick,
|
|
2667
|
+
onAdd,
|
|
2668
|
+
onHoverDeleteChange,
|
|
2669
|
+
...rest
|
|
2670
|
+
}, forwardedRef) {
|
|
2671
|
+
const theme = useDesignSystemTheme();
|
|
2672
|
+
const { hoverProps: hoverDeleteProps } = useHover({
|
|
2673
|
+
onHoverChange: onHoverDeleteChange
|
|
2674
|
+
});
|
|
2675
|
+
const handleClick = !children && !deletable && addable ? onAdd : onClick;
|
|
2676
|
+
const color = colorScheme === "primary" ? theme.colors.primary : colorScheme === "secondary" ? theme.colors.secondary : theme.colors.text;
|
|
2677
|
+
return /* @__PURE__ */ React22.createElement(
|
|
2678
|
+
ChipElement,
|
|
2660
2679
|
{
|
|
2661
|
-
|
|
2662
|
-
|
|
2663
|
-
|
|
2664
|
-
|
|
2665
|
-
|
|
2666
|
-
|
|
2667
|
-
|
|
2668
|
-
|
|
2669
|
-
|
|
2670
|
-
|
|
2671
|
-
}
|
|
2680
|
+
ref: forwardedRef,
|
|
2681
|
+
$variant: variant,
|
|
2682
|
+
$colorScheme: colorScheme,
|
|
2683
|
+
style: style3,
|
|
2684
|
+
onClick: handleClick,
|
|
2685
|
+
$size: size2,
|
|
2686
|
+
$monospace: monospace,
|
|
2687
|
+
$isInteractive: !!handleClick || clickable === true,
|
|
2688
|
+
tabIndex,
|
|
2689
|
+
...rest
|
|
2690
|
+
},
|
|
2691
|
+
addable && /* @__PURE__ */ React22.createElement(
|
|
2692
|
+
AddElement,
|
|
2693
|
+
{
|
|
2694
|
+
size: size2,
|
|
2695
|
+
isOnlyChild: !children && !deletable,
|
|
2696
|
+
onClick: onAdd ? (event) => {
|
|
2697
|
+
event.stopPropagation();
|
|
2698
|
+
onAdd?.();
|
|
2699
|
+
} : void 0,
|
|
2700
|
+
color
|
|
2701
|
+
}
|
|
2702
|
+
),
|
|
2703
|
+
children,
|
|
2704
|
+
deletable && /* @__PURE__ */ React22.createElement(
|
|
2705
|
+
DeleteElement,
|
|
2706
|
+
{
|
|
2707
|
+
size: size2,
|
|
2708
|
+
...hoverDeleteProps,
|
|
2709
|
+
onClick: onDelete ? (event) => {
|
|
2710
|
+
event.stopPropagation();
|
|
2711
|
+
onDelete?.();
|
|
2712
|
+
} : void 0,
|
|
2713
|
+
color
|
|
2714
|
+
}
|
|
2715
|
+
)
|
|
2716
|
+
);
|
|
2717
|
+
})
|
|
2718
|
+
);
|
|
2672
2719
|
|
|
2673
2720
|
// src/components/ContextMenu.tsx
|
|
2674
2721
|
import { CheckIcon as CheckIcon2, ChevronRightIcon as ChevronRightIcon2 } from "@noya-app/noya-icons";
|
|
2675
2722
|
import { useKeyboardShortcuts as useKeyboardShortcuts2 } from "@noya-app/noya-keymap";
|
|
2676
2723
|
import * as RadixContextMenu from "@radix-ui/react-context-menu";
|
|
2677
|
-
import React23, {
|
|
2678
|
-
memo as memo12,
|
|
2679
|
-
useCallback as useCallback13,
|
|
2680
|
-
useMemo as useMemo11
|
|
2681
|
-
} from "react";
|
|
2724
|
+
import React23, { memo as memo12, useCallback as useCallback13, useMemo as useMemo11 } from "react";
|
|
2682
2725
|
import styled15 from "styled-components";
|
|
2683
2726
|
var SeparatorElement2 = styled15(RadixContextMenu.Separator)(
|
|
2684
2727
|
styles.separatorStyle
|
|
@@ -2826,7 +2869,7 @@ var DividerVertical = memo13(function DividerVertical2({
|
|
|
2826
2869
|
|
|
2827
2870
|
// src/components/DraggableMenuButton.tsx
|
|
2828
2871
|
import { DragHandleDots2Icon } from "@noya-app/noya-icons";
|
|
2829
|
-
import React25, { memo as memo14, useCallback as useCallback14, useState as
|
|
2872
|
+
import React25, { memo as memo14, useCallback as useCallback14, useState as useState16 } from "react";
|
|
2830
2873
|
import styled17 from "styled-components";
|
|
2831
2874
|
var DotButtonElement = styled17.div(({ theme }) => ({
|
|
2832
2875
|
cursor: "pointer",
|
|
@@ -2852,7 +2895,7 @@ var DraggableMenuButton = memo14(function DraggableMenuButton2({
|
|
|
2852
2895
|
isVisible = true
|
|
2853
2896
|
}) {
|
|
2854
2897
|
const color = useDesignSystemTheme().colors.icon;
|
|
2855
|
-
const [open, setOpen] =
|
|
2898
|
+
const [open, setOpen] = useState16(false);
|
|
2856
2899
|
const [downPosition, setDownPosition] = React25.useState(null);
|
|
2857
2900
|
const handlePointerDownCapture = useCallback14(
|
|
2858
2901
|
(event) => {
|
|
@@ -2925,7 +2968,7 @@ var DraggableMenuButton = memo14(function DraggableMenuButton2({
|
|
|
2925
2968
|
});
|
|
2926
2969
|
|
|
2927
2970
|
// src/components/FillInputField.tsx
|
|
2928
|
-
import React28, { forwardRef as
|
|
2971
|
+
import React28, { forwardRef as forwardRef11, memo as memo17 } from "react";
|
|
2929
2972
|
import styled19 from "styled-components";
|
|
2930
2973
|
|
|
2931
2974
|
// ../noya-file-format/src/types.ts
|
|
@@ -3453,13 +3496,13 @@ var Container = styled19.button(
|
|
|
3453
3496
|
})
|
|
3454
3497
|
);
|
|
3455
3498
|
var FillInputField = memo17(
|
|
3456
|
-
|
|
3499
|
+
forwardRef11(function FillInputField2({ id, value, flex, ...rest }, ref) {
|
|
3457
3500
|
return /* @__PURE__ */ React28.createElement(Container, { ref, id, $flex: flex, ...rest }, /* @__PURE__ */ React28.createElement(FillPreviewBackground, { value }));
|
|
3458
3501
|
})
|
|
3459
3502
|
);
|
|
3460
3503
|
|
|
3461
3504
|
// src/components/FloatingWindow.tsx
|
|
3462
|
-
import React29, { useCallback as useCallback15, useRef as useRef13, useState as
|
|
3505
|
+
import React29, { useCallback as useCallback15, useRef as useRef13, useState as useState17 } from "react";
|
|
3463
3506
|
var styles2 = {
|
|
3464
3507
|
noSelect: {
|
|
3465
3508
|
userSelect: "none",
|
|
@@ -3577,15 +3620,15 @@ var FloatingWindow = ({
|
|
|
3577
3620
|
toolbarContent,
|
|
3578
3621
|
renderToolbar = defaultRenderToolbar
|
|
3579
3622
|
}) => {
|
|
3580
|
-
const [position, setPosition] =
|
|
3581
|
-
const [size2, setSize] =
|
|
3623
|
+
const [position, setPosition] = useState17({ x: initialX, y: initialY });
|
|
3624
|
+
const [size2, setSize] = useState17({
|
|
3582
3625
|
width: initialWidth,
|
|
3583
3626
|
height: initialHeight
|
|
3584
3627
|
});
|
|
3585
|
-
const [isDragging, setIsDragging] =
|
|
3586
|
-
const [isResizing, setIsResizing] =
|
|
3587
|
-
const [dragOffset, setDragOffset] =
|
|
3588
|
-
const [resizeDirection, setResizeDirection] =
|
|
3628
|
+
const [isDragging, setIsDragging] = useState17(false);
|
|
3629
|
+
const [isResizing, setIsResizing] = useState17(false);
|
|
3630
|
+
const [dragOffset, setDragOffset] = useState17({ x: 0, y: 0 });
|
|
3631
|
+
const [resizeDirection, setResizeDirection] = useState17(null);
|
|
3589
3632
|
const wrapperRef = useRef13(null);
|
|
3590
3633
|
const toggleGlobalTextSelection = (disable) => {
|
|
3591
3634
|
if (disable) {
|
|
@@ -3830,7 +3873,7 @@ var Grid = styled20.div((props) => ({
|
|
|
3830
3873
|
// src/components/GridView.tsx
|
|
3831
3874
|
import React32, {
|
|
3832
3875
|
createContext as createContext7,
|
|
3833
|
-
forwardRef as
|
|
3876
|
+
forwardRef as forwardRef12,
|
|
3834
3877
|
memo as memo20,
|
|
3835
3878
|
useCallback as useCallback18,
|
|
3836
3879
|
useContext as useContext7,
|
|
@@ -3840,7 +3883,7 @@ import styled22, { keyframes as keyframes2 } from "styled-components";
|
|
|
3840
3883
|
|
|
3841
3884
|
// src/components/ScrollArea.tsx
|
|
3842
3885
|
import * as RadixScrollArea from "@radix-ui/react-scroll-area";
|
|
3843
|
-
import React31, { memo as memo19, useCallback as useCallback17, useState as
|
|
3886
|
+
import React31, { memo as memo19, useCallback as useCallback17, useState as useState18 } from "react";
|
|
3844
3887
|
import styled21 from "styled-components";
|
|
3845
3888
|
var SCROLLBAR_SIZE = 10;
|
|
3846
3889
|
var StyledViewport = styled21(RadixScrollArea.Viewport)({
|
|
@@ -3869,7 +3912,7 @@ var Container2 = styled21.div({
|
|
|
3869
3912
|
minHeight: 0
|
|
3870
3913
|
});
|
|
3871
3914
|
var ScrollArea = memo19(function ScrollArea2({ children }) {
|
|
3872
|
-
const [scrollElementRef, setScrollElementRef] =
|
|
3915
|
+
const [scrollElementRef, setScrollElementRef] = useState18(null);
|
|
3873
3916
|
return /* @__PURE__ */ React31.createElement(Container2, null, /* @__PURE__ */ React31.createElement(RadixScrollArea.Root, { style: { width: "100%", height: "100%" } }, /* @__PURE__ */ React31.createElement(
|
|
3874
3917
|
StyledViewport,
|
|
3875
3918
|
{
|
|
@@ -4059,7 +4102,7 @@ var Shimmer = styled22.div`
|
|
|
4059
4102
|
align-items: end;
|
|
4060
4103
|
padding: 4px;
|
|
4061
4104
|
`;
|
|
4062
|
-
var GridViewItem =
|
|
4105
|
+
var GridViewItem = forwardRef12(function GridViewItem2({
|
|
4063
4106
|
id,
|
|
4064
4107
|
title,
|
|
4065
4108
|
subtitle,
|
|
@@ -4204,7 +4247,7 @@ var GridView;
|
|
|
4204
4247
|
// src/components/InputFieldWithCompletions.tsx
|
|
4205
4248
|
import { chunkBy, partition } from "@noya-app/noya-utils";
|
|
4206
4249
|
import React36, {
|
|
4207
|
-
forwardRef as
|
|
4250
|
+
forwardRef as forwardRef15,
|
|
4208
4251
|
memo as memo23,
|
|
4209
4252
|
useCallback as useCallback21,
|
|
4210
4253
|
useEffect as useEffect14,
|
|
@@ -4212,7 +4255,7 @@ import React36, {
|
|
|
4212
4255
|
useLayoutEffect as useLayoutEffect7,
|
|
4213
4256
|
useMemo as useMemo19,
|
|
4214
4257
|
useRef as useRef16,
|
|
4215
|
-
useState as
|
|
4258
|
+
useState as useState20
|
|
4216
4259
|
} from "react";
|
|
4217
4260
|
import styled25 from "styled-components";
|
|
4218
4261
|
|
|
@@ -4293,7 +4336,7 @@ import { composeRefs as composeRefs2 } from "@radix-ui/react-compose-refs";
|
|
|
4293
4336
|
import React34, {
|
|
4294
4337
|
Children as Children4,
|
|
4295
4338
|
createContext as createContext9,
|
|
4296
|
-
forwardRef as
|
|
4339
|
+
forwardRef as forwardRef13,
|
|
4297
4340
|
isValidElement as isValidElement3,
|
|
4298
4341
|
memo as memo22,
|
|
4299
4342
|
useCallback as useCallback20,
|
|
@@ -4352,7 +4395,7 @@ import React33, {
|
|
|
4352
4395
|
useEffect as useEffect13,
|
|
4353
4396
|
useMemo as useMemo17,
|
|
4354
4397
|
useRef as useRef14,
|
|
4355
|
-
useState as
|
|
4398
|
+
useState as useState19
|
|
4356
4399
|
} from "react";
|
|
4357
4400
|
import { createPortal as createPortal2 } from "react-dom";
|
|
4358
4401
|
var normalizeListDestinationIndex = (index, position) => {
|
|
@@ -4440,12 +4483,12 @@ function SortableRoot({
|
|
|
4440
4483
|
}
|
|
4441
4484
|
})
|
|
4442
4485
|
);
|
|
4443
|
-
const [activeIndex, setActiveIndex] =
|
|
4486
|
+
const [activeIndex, setActiveIndex] = useState19();
|
|
4444
4487
|
const activatorEvent = useRef14(null);
|
|
4445
4488
|
const setActivatorEvent = useCallback19((event) => {
|
|
4446
4489
|
activatorEvent.current = event;
|
|
4447
4490
|
}, []);
|
|
4448
|
-
const [position, setPosition] =
|
|
4491
|
+
const [position, setPosition] = useState19({ x: 0, y: 0 });
|
|
4449
4492
|
const handleDragStart = useCallback19(
|
|
4450
4493
|
(event) => {
|
|
4451
4494
|
setActiveIndex(keys.indexOf(event.active.id));
|
|
@@ -4482,7 +4525,7 @@ function SortableRoot({
|
|
|
4482
4525
|
},
|
|
4483
4526
|
[acceptsDrop, axis, keys, onMoveItem, position.x, position.y]
|
|
4484
4527
|
);
|
|
4485
|
-
const [mounted, setMounted] =
|
|
4528
|
+
const [mounted, setMounted] = useState19(false);
|
|
4486
4529
|
useEffect13(() => {
|
|
4487
4530
|
setMounted(true);
|
|
4488
4531
|
}, []);
|
|
@@ -4691,7 +4734,7 @@ var ListViewDragIndicatorElement = styled23.div(({ theme, $relativeDropPosition,
|
|
|
4691
4734
|
boxShadow: "0 0 2px rgba(0,0,0,0.5)"
|
|
4692
4735
|
}
|
|
4693
4736
|
}));
|
|
4694
|
-
var ListViewRow =
|
|
4737
|
+
var ListViewRow = forwardRef13(function ListViewRow2({
|
|
4695
4738
|
id,
|
|
4696
4739
|
tabIndex = 0,
|
|
4697
4740
|
gap,
|
|
@@ -4711,7 +4754,8 @@ var ListViewRow = forwardRef12(function ListViewRow2({
|
|
|
4711
4754
|
onSelectMenuItem,
|
|
4712
4755
|
onMenuOpenChange,
|
|
4713
4756
|
onKeyDown,
|
|
4714
|
-
style: style3
|
|
4757
|
+
style: style3,
|
|
4758
|
+
dragIndicatorStyle
|
|
4715
4759
|
}, forwardedRef) {
|
|
4716
4760
|
depth = Math.max(0, depth);
|
|
4717
4761
|
const {
|
|
@@ -4795,7 +4839,12 @@ var ListViewRow = forwardRef12(function ListViewRow2({
|
|
|
4795
4839
|
$colorScheme: colorScheme,
|
|
4796
4840
|
$relativeDropPosition: relativeDropPosition,
|
|
4797
4841
|
$offsetLeft: 33 + depth * indentation,
|
|
4798
|
-
$gap: listGap
|
|
4842
|
+
$gap: listGap + (divider ? 1 : 0),
|
|
4843
|
+
style: typeof dragIndicatorStyle === "function" ? dragIndicatorStyle({
|
|
4844
|
+
depth,
|
|
4845
|
+
indentation,
|
|
4846
|
+
position: relativeDropPosition
|
|
4847
|
+
}) : dragIndicatorStyle
|
|
4799
4848
|
}
|
|
4800
4849
|
),
|
|
4801
4850
|
depth > 0 && /* @__PURE__ */ React34.createElement(Spacer.Horizontal, { size: depth * indentation }),
|
|
@@ -4832,7 +4881,7 @@ var VirtualizedListRow = memo22(function VirtualizedListRow2({
|
|
|
4832
4881
|
const renderItem = useContext9(RenderItemContext);
|
|
4833
4882
|
return /* @__PURE__ */ React34.createElement("div", { key: index, style: style3 }, renderItem(index));
|
|
4834
4883
|
});
|
|
4835
|
-
var VirtualizedListInner =
|
|
4884
|
+
var VirtualizedListInner = forwardRef13(function VirtualizedListInner2({
|
|
4836
4885
|
size: size2,
|
|
4837
4886
|
scrollElement,
|
|
4838
4887
|
items,
|
|
@@ -4913,7 +4962,10 @@ var RootContainer2 = styled23.div(({ theme, $scrollable, $gap }) => ({
|
|
|
4913
4962
|
color: theme.colors.textMuted,
|
|
4914
4963
|
gap: $gap
|
|
4915
4964
|
}));
|
|
4916
|
-
var ListViewRootInner =
|
|
4965
|
+
var ListViewRootInner = forwardRef13(function ListViewRootInner2({
|
|
4966
|
+
id,
|
|
4967
|
+
className,
|
|
4968
|
+
style: style3,
|
|
4917
4969
|
onPress,
|
|
4918
4970
|
scrollable = false,
|
|
4919
4971
|
expandable = true,
|
|
@@ -5053,6 +5105,9 @@ var ListViewRootInner = forwardRef12(function ListViewRootInner2({
|
|
|
5053
5105
|
return /* @__PURE__ */ React34.createElement(DraggingContext.Provider, { value: draggingContextValue }, /* @__PURE__ */ React34.createElement(
|
|
5054
5106
|
RootContainer2,
|
|
5055
5107
|
{
|
|
5108
|
+
id,
|
|
5109
|
+
className,
|
|
5110
|
+
style: style3,
|
|
5056
5111
|
...{
|
|
5057
5112
|
[pressEventName]: handleClick
|
|
5058
5113
|
},
|
|
@@ -5078,7 +5133,7 @@ var ListViewRootInner = forwardRef12(function ListViewRootInner2({
|
|
|
5078
5133
|
));
|
|
5079
5134
|
});
|
|
5080
5135
|
var ListViewRoot = memo22(ListViewRootInner);
|
|
5081
|
-
var ChildrenListViewInner =
|
|
5136
|
+
var ChildrenListViewInner = forwardRef13(function ChildrenListViewInner2({ children, ...rest }, forwardedRef) {
|
|
5082
5137
|
const items = useMemo18(
|
|
5083
5138
|
() => Children4.toArray(children).flatMap(
|
|
5084
5139
|
(child) => isValidElement3(child) ? [child] : []
|
|
@@ -5100,7 +5155,7 @@ var ChildrenListViewInner = forwardRef12(function ChildrenListViewInner2({ child
|
|
|
5100
5155
|
);
|
|
5101
5156
|
});
|
|
5102
5157
|
var ChildrenListView = memo22(ChildrenListViewInner);
|
|
5103
|
-
var SimpleListViewInner =
|
|
5158
|
+
var SimpleListViewInner = forwardRef13(function SimpleListViewInner2(props, forwardedRef) {
|
|
5104
5159
|
if ("children" in props) {
|
|
5105
5160
|
return /* @__PURE__ */ React34.createElement(ChildrenListView, { ref: forwardedRef, ...props });
|
|
5106
5161
|
} else {
|
|
@@ -5125,7 +5180,7 @@ var ListView;
|
|
|
5125
5180
|
})(ListView || (ListView = {}));
|
|
5126
5181
|
|
|
5127
5182
|
// src/components/Text.tsx
|
|
5128
|
-
import React35, { forwardRef as
|
|
5183
|
+
import React35, { forwardRef as forwardRef14 } from "react";
|
|
5129
5184
|
import styled24 from "styled-components";
|
|
5130
5185
|
var elements = {
|
|
5131
5186
|
title: "h1",
|
|
@@ -5147,7 +5202,7 @@ var StyledElement = styled24.span(({ theme, $variant, $styleProps, $breakpoints,
|
|
|
5147
5202
|
...$styleProps,
|
|
5148
5203
|
...mergeBreakpoints($breakpoints || [])
|
|
5149
5204
|
}));
|
|
5150
|
-
var Text =
|
|
5205
|
+
var Text = forwardRef14(function Text2({
|
|
5151
5206
|
as,
|
|
5152
5207
|
variant,
|
|
5153
5208
|
breakpoints,
|
|
@@ -5155,7 +5210,9 @@ var Text = forwardRef13(function Text2({
|
|
|
5155
5210
|
className,
|
|
5156
5211
|
color,
|
|
5157
5212
|
href,
|
|
5213
|
+
tabIndex,
|
|
5158
5214
|
onClick,
|
|
5215
|
+
onKeyDown,
|
|
5159
5216
|
...rest
|
|
5160
5217
|
}, forwardedRef) {
|
|
5161
5218
|
const element = as ?? elements[variant] ?? "span";
|
|
@@ -5165,35 +5222,37 @@ var Text = forwardRef13(function Text2({
|
|
|
5165
5222
|
ref: forwardedRef,
|
|
5166
5223
|
as: element,
|
|
5167
5224
|
className,
|
|
5225
|
+
tabIndex,
|
|
5168
5226
|
$variant: variant,
|
|
5169
5227
|
$breakpoints: breakpoints,
|
|
5170
5228
|
$styleProps: rest,
|
|
5171
5229
|
$color: color,
|
|
5172
5230
|
onClick,
|
|
5231
|
+
onKeyDown,
|
|
5173
5232
|
...href && { href }
|
|
5174
5233
|
},
|
|
5175
5234
|
children
|
|
5176
5235
|
);
|
|
5177
5236
|
});
|
|
5178
|
-
var Heading1 =
|
|
5237
|
+
var Heading1 = forwardRef14(
|
|
5179
5238
|
(props, ref) => /* @__PURE__ */ React35.createElement(Text, { ref, ...props, variant: "heading1" })
|
|
5180
5239
|
);
|
|
5181
|
-
var Heading2 =
|
|
5240
|
+
var Heading2 = forwardRef14(
|
|
5182
5241
|
(props, ref) => /* @__PURE__ */ React35.createElement(Text, { ref, ...props, variant: "heading2" })
|
|
5183
5242
|
);
|
|
5184
|
-
var Heading3 =
|
|
5243
|
+
var Heading3 = forwardRef14(
|
|
5185
5244
|
(props, ref) => /* @__PURE__ */ React35.createElement(Text, { ref, ...props, variant: "heading3" })
|
|
5186
5245
|
);
|
|
5187
|
-
var Heading4 =
|
|
5246
|
+
var Heading4 = forwardRef14(
|
|
5188
5247
|
(props, ref) => /* @__PURE__ */ React35.createElement(Text, { ref, ...props, variant: "heading4" })
|
|
5189
5248
|
);
|
|
5190
|
-
var Heading5 =
|
|
5249
|
+
var Heading5 = forwardRef14(
|
|
5191
5250
|
(props, ref) => /* @__PURE__ */ React35.createElement(Text, { ref, ...props, variant: "heading5" })
|
|
5192
5251
|
);
|
|
5193
|
-
var Body =
|
|
5252
|
+
var Body = forwardRef14(
|
|
5194
5253
|
(props, ref) => /* @__PURE__ */ React35.createElement(Text, { ref, ...props, variant: "body" })
|
|
5195
5254
|
);
|
|
5196
|
-
var Small =
|
|
5255
|
+
var Small = forwardRef14(
|
|
5197
5256
|
(props, ref) => /* @__PURE__ */ React35.createElement(Text, { ref, ...props, variant: "small" })
|
|
5198
5257
|
);
|
|
5199
5258
|
var Italic = ({ children }) => /* @__PURE__ */ React35.createElement(
|
|
@@ -5239,7 +5298,7 @@ var CompletionToken = styled25.span(
|
|
|
5239
5298
|
})
|
|
5240
5299
|
);
|
|
5241
5300
|
var CompletionMenu = memo23(
|
|
5242
|
-
|
|
5301
|
+
forwardRef15(function CompletionMenu2({
|
|
5243
5302
|
items,
|
|
5244
5303
|
selectedIndex,
|
|
5245
5304
|
onSelectItem,
|
|
@@ -5285,7 +5344,7 @@ var CompletionMenu = memo23(
|
|
|
5285
5344
|
})
|
|
5286
5345
|
);
|
|
5287
5346
|
var InputFieldWithCompletions = memo23(
|
|
5288
|
-
|
|
5347
|
+
forwardRef15(function InputFieldWithCompletions2({
|
|
5289
5348
|
loading,
|
|
5290
5349
|
initialValue = "",
|
|
5291
5350
|
placeholder,
|
|
@@ -5304,8 +5363,8 @@ var InputFieldWithCompletions = memo23(
|
|
|
5304
5363
|
hideMenuWhenEmptyValue = false
|
|
5305
5364
|
}, forwardedRef) {
|
|
5306
5365
|
const ref = useRef16(null);
|
|
5307
|
-
const [isFocused, setIsFocused] =
|
|
5308
|
-
const [state, _setState] =
|
|
5366
|
+
const [isFocused, setIsFocused] = useState20(false);
|
|
5367
|
+
const [state, _setState] = useState20({
|
|
5309
5368
|
filter: initialValue,
|
|
5310
5369
|
selectedIndex: 0
|
|
5311
5370
|
});
|
|
@@ -5559,9 +5618,9 @@ function getNextIndex(items, currentIndex, direction, isDisabled) {
|
|
|
5559
5618
|
}
|
|
5560
5619
|
|
|
5561
5620
|
// src/components/InspectorContainer.tsx
|
|
5562
|
-
import React37, { forwardRef as
|
|
5621
|
+
import React37, { forwardRef as forwardRef16, memo as memo24 } from "react";
|
|
5563
5622
|
var InspectorContainer = memo24(
|
|
5564
|
-
|
|
5623
|
+
forwardRef16(function InspectorContainer2({
|
|
5565
5624
|
header,
|
|
5566
5625
|
children,
|
|
5567
5626
|
fallback,
|
|
@@ -5797,7 +5856,7 @@ var ProgressIndicator = styled28(ProgressPrimitive.Indicator)(({ theme, variant
|
|
|
5797
5856
|
import * as ToggleGroupPrimitive from "@radix-ui/react-toggle-group";
|
|
5798
5857
|
import React41, {
|
|
5799
5858
|
createContext as createContext10,
|
|
5800
|
-
forwardRef as
|
|
5859
|
+
forwardRef as forwardRef17,
|
|
5801
5860
|
memo as memo27,
|
|
5802
5861
|
useCallback as useCallback22,
|
|
5803
5862
|
useContext as useContext10,
|
|
@@ -5855,7 +5914,7 @@ var StyledItem = styled29(ToggleGroupPrimitive.Item).withConfig({
|
|
|
5855
5914
|
boxShadow: `0 0 0 1px ${theme.colors.sidebar.background}, 0 0 0 3px ${theme.colors[colorScheme ?? "primary"]}`
|
|
5856
5915
|
}
|
|
5857
5916
|
}));
|
|
5858
|
-
var ToggleGroupItem =
|
|
5917
|
+
var ToggleGroupItem = forwardRef17(function ToggleGroupItem2({ value, tooltip, children, disabled = false }, forwardedRef) {
|
|
5859
5918
|
const { colorScheme } = useContext10(RadioGroupContext);
|
|
5860
5919
|
const itemElement = /* @__PURE__ */ React41.createElement(
|
|
5861
5920
|
StyledItem,
|
|
@@ -5967,7 +6026,7 @@ var SelectElement = styled30.select(
|
|
|
5967
6026
|
borderRadius: "4px",
|
|
5968
6027
|
paddingTop: "4px",
|
|
5969
6028
|
paddingBottom: "4px",
|
|
5970
|
-
paddingLeft: "
|
|
6029
|
+
paddingLeft: "6px",
|
|
5971
6030
|
paddingRight: "23px",
|
|
5972
6031
|
background: [
|
|
5973
6032
|
`calc(100% - 6px) / 15px url("data:image/svg+xml;utf8,${createChevronSVGString(
|
|
@@ -6041,11 +6100,51 @@ var Select = memo28(function Select2({
|
|
|
6041
6100
|
)), label && /* @__PURE__ */ React42.createElement(SelectLabel, { htmlFor: id }, label));
|
|
6042
6101
|
});
|
|
6043
6102
|
|
|
6103
|
+
// src/components/SelectMenu.tsx
|
|
6104
|
+
import { DropdownChevronIcon } from "@noya-app/noya-icons";
|
|
6105
|
+
import * as Select3 from "@radix-ui/react-select";
|
|
6106
|
+
import React43, { memo as memo29 } from "react";
|
|
6107
|
+
import { styled as styled31 } from "styled-components";
|
|
6108
|
+
var SelectMenu = memo29(function SelectMenu2({
|
|
6109
|
+
id,
|
|
6110
|
+
style: style3,
|
|
6111
|
+
className,
|
|
6112
|
+
menuItems,
|
|
6113
|
+
value,
|
|
6114
|
+
onSelect,
|
|
6115
|
+
placeholder
|
|
6116
|
+
}) {
|
|
6117
|
+
const selectedItem = menuItems.find(
|
|
6118
|
+
(item) => typeof item !== "string" && item.value === value
|
|
6119
|
+
);
|
|
6120
|
+
const icon = selectedItem?.icon;
|
|
6121
|
+
return /* @__PURE__ */ React43.createElement(Select3.Root, { value, onValueChange: onSelect }, /* @__PURE__ */ React43.createElement(Select3.SelectTrigger, { asChild: true }, /* @__PURE__ */ React43.createElement(Button, { id, style: style3, className }, icon && /* @__PURE__ */ React43.createElement(React43.Fragment, null, icon, /* @__PURE__ */ React43.createElement(Spacer.Horizontal, { size: 8 })), /* @__PURE__ */ React43.createElement(Select3.Value, { placeholder }), /* @__PURE__ */ React43.createElement(Spacer.Horizontal, null), /* @__PURE__ */ React43.createElement(DropdownChevronIcon, null))), /* @__PURE__ */ React43.createElement(Select3.Portal, null, /* @__PURE__ */ React43.createElement(SelectContent, null, /* @__PURE__ */ React43.createElement(SelectViewport, null, menuItems.map((menuItem) => {
|
|
6122
|
+
if (typeof menuItem === "string") {
|
|
6123
|
+
return /* @__PURE__ */ React43.createElement(StyledSeparator, null);
|
|
6124
|
+
}
|
|
6125
|
+
const value2 = menuItem.value ?? "";
|
|
6126
|
+
return /* @__PURE__ */ React43.createElement(SelectItem, { key: value2, value: value2, icon: menuItem.icon }, menuItem.title ?? value2);
|
|
6127
|
+
})))));
|
|
6128
|
+
});
|
|
6129
|
+
var SelectContent = styled31(Select3.Content)(styles.contentStyle);
|
|
6130
|
+
var SelectViewport = styled31(Select3.Viewport)({});
|
|
6131
|
+
var SelectItem = React43.forwardRef(
|
|
6132
|
+
({
|
|
6133
|
+
children,
|
|
6134
|
+
icon,
|
|
6135
|
+
...props
|
|
6136
|
+
}, forwardedRef) => {
|
|
6137
|
+
return /* @__PURE__ */ React43.createElement(StyledItem2, { ...props, ref: forwardedRef }, icon && /* @__PURE__ */ React43.createElement(React43.Fragment, null, icon, /* @__PURE__ */ React43.createElement(Spacer.Horizontal, { size: 8 })), /* @__PURE__ */ React43.createElement(Select3.ItemText, null, children));
|
|
6138
|
+
}
|
|
6139
|
+
);
|
|
6140
|
+
var StyledItem2 = styled31(Select3.Item)(styles.itemStyle);
|
|
6141
|
+
var StyledSeparator = styled31(Select3.Separator)(styles.separatorStyle);
|
|
6142
|
+
|
|
6044
6143
|
// src/components/Slider.tsx
|
|
6045
6144
|
import * as RadixSlider from "@radix-ui/react-slider";
|
|
6046
|
-
import
|
|
6047
|
-
import
|
|
6048
|
-
var StyledSlider =
|
|
6145
|
+
import React44, { useCallback as useCallback24, useMemo as useMemo23 } from "react";
|
|
6146
|
+
import styled32 from "styled-components";
|
|
6147
|
+
var StyledSlider = styled32(RadixSlider.Root)({
|
|
6049
6148
|
flex: "1",
|
|
6050
6149
|
position: "relative",
|
|
6051
6150
|
display: "flex",
|
|
@@ -6054,19 +6153,19 @@ var StyledSlider = styled31(RadixSlider.Root)({
|
|
|
6054
6153
|
touchAction: "none",
|
|
6055
6154
|
height: "16px"
|
|
6056
6155
|
});
|
|
6057
|
-
var StyledTrack =
|
|
6156
|
+
var StyledTrack = styled32(RadixSlider.Track)(({ theme }) => ({
|
|
6058
6157
|
backgroundColor: theme.colors.divider,
|
|
6059
6158
|
position: "relative",
|
|
6060
6159
|
flexGrow: 1,
|
|
6061
6160
|
height: "2px"
|
|
6062
6161
|
}));
|
|
6063
|
-
var StyledRange =
|
|
6162
|
+
var StyledRange = styled32(RadixSlider.Range)(({ theme }) => ({
|
|
6064
6163
|
position: "absolute",
|
|
6065
6164
|
backgroundColor: theme.colors.primary,
|
|
6066
6165
|
borderRadius: "9999px",
|
|
6067
6166
|
height: "100%"
|
|
6068
6167
|
}));
|
|
6069
|
-
var StyledThumb2 =
|
|
6168
|
+
var StyledThumb2 = styled32(RadixSlider.Thumb)(({ theme }) => ({
|
|
6070
6169
|
display: "block",
|
|
6071
6170
|
width: "12px",
|
|
6072
6171
|
height: "12px",
|
|
@@ -6094,7 +6193,7 @@ var Slider = function Slider2({
|
|
|
6094
6193
|
},
|
|
6095
6194
|
[onValueChange]
|
|
6096
6195
|
);
|
|
6097
|
-
return /* @__PURE__ */
|
|
6196
|
+
return /* @__PURE__ */ React44.createElement(
|
|
6098
6197
|
StyledSlider,
|
|
6099
6198
|
{
|
|
6100
6199
|
min,
|
|
@@ -6103,16 +6202,16 @@ var Slider = function Slider2({
|
|
|
6103
6202
|
value: arrayValue,
|
|
6104
6203
|
onValueChange: handleValueChange
|
|
6105
6204
|
},
|
|
6106
|
-
/* @__PURE__ */
|
|
6107
|
-
/* @__PURE__ */
|
|
6205
|
+
/* @__PURE__ */ React44.createElement(StyledTrack, null, /* @__PURE__ */ React44.createElement(StyledRange, null)),
|
|
6206
|
+
/* @__PURE__ */ React44.createElement(StyledThumb2, null)
|
|
6108
6207
|
);
|
|
6109
6208
|
};
|
|
6110
6209
|
|
|
6111
6210
|
// src/components/Switch.tsx
|
|
6112
6211
|
import * as SwitchPrimitive from "@radix-ui/react-switch";
|
|
6113
|
-
import
|
|
6114
|
-
import
|
|
6115
|
-
var SwitchRoot =
|
|
6212
|
+
import React45 from "react";
|
|
6213
|
+
import styled33 from "styled-components";
|
|
6214
|
+
var SwitchRoot = styled33(SwitchPrimitive.Root)(({ theme, $colorScheme }) => ({
|
|
6116
6215
|
all: "unset",
|
|
6117
6216
|
width: 32,
|
|
6118
6217
|
height: 19,
|
|
@@ -6129,7 +6228,7 @@ var SwitchRoot = styled32(SwitchPrimitive.Root)(({ theme, $colorScheme }) => ({
|
|
|
6129
6228
|
backgroundColor: $colorScheme === "primary" ? theme.colors.primary : $colorScheme === "secondary" ? theme.colors.secondary : void 0
|
|
6130
6229
|
}
|
|
6131
6230
|
}));
|
|
6132
|
-
var SwitchThumb =
|
|
6231
|
+
var SwitchThumb = styled33(SwitchPrimitive.Thumb)({
|
|
6133
6232
|
display: "block",
|
|
6134
6233
|
width: 15,
|
|
6135
6234
|
height: 15,
|
|
@@ -6145,7 +6244,7 @@ var Switch = function Switch2({
|
|
|
6145
6244
|
onChange,
|
|
6146
6245
|
colorScheme = "normal"
|
|
6147
6246
|
}) {
|
|
6148
|
-
return /* @__PURE__ */
|
|
6247
|
+
return /* @__PURE__ */ React45.createElement(
|
|
6149
6248
|
SwitchRoot,
|
|
6150
6249
|
{
|
|
6151
6250
|
$colorScheme: colorScheme,
|
|
@@ -6154,18 +6253,18 @@ var Switch = function Switch2({
|
|
|
6154
6253
|
onChange(newValue);
|
|
6155
6254
|
}
|
|
6156
6255
|
},
|
|
6157
|
-
/* @__PURE__ */
|
|
6256
|
+
/* @__PURE__ */ React45.createElement(SwitchThumb, null)
|
|
6158
6257
|
);
|
|
6159
6258
|
};
|
|
6160
6259
|
|
|
6161
6260
|
// src/components/TreeView.tsx
|
|
6162
|
-
import
|
|
6163
|
-
forwardRef as
|
|
6164
|
-
memo as
|
|
6261
|
+
import React46, {
|
|
6262
|
+
forwardRef as forwardRef18,
|
|
6263
|
+
memo as memo30,
|
|
6165
6264
|
useCallback as useCallback25,
|
|
6166
6265
|
useContext as useContext12
|
|
6167
6266
|
} from "react";
|
|
6168
|
-
var TreeRow =
|
|
6267
|
+
var TreeRow = forwardRef18(function TreeRow2({
|
|
6169
6268
|
icon,
|
|
6170
6269
|
expanded,
|
|
6171
6270
|
onClickChevron,
|
|
@@ -6180,26 +6279,26 @@ var TreeRow = forwardRef17(function TreeRow2({
|
|
|
6180
6279
|
},
|
|
6181
6280
|
[onClickChevron]
|
|
6182
6281
|
);
|
|
6183
|
-
return /* @__PURE__ */
|
|
6282
|
+
return /* @__PURE__ */ React46.createElement(ListView.Row, { ref: forwardedRef, ...rest }, expandable && /* @__PURE__ */ React46.createElement(React46.Fragment, null, expanded === void 0 ? /* @__PURE__ */ React46.createElement(Spacer.Horizontal, { size: 19 }) : /* @__PURE__ */ React46.createElement(
|
|
6184
6283
|
IconButton,
|
|
6185
6284
|
{
|
|
6186
|
-
iconName: expanded ? "
|
|
6285
|
+
iconName: expanded ? "ChevronDownIcon2" : "ChevronRightIcon2",
|
|
6187
6286
|
onClick: handleClickChevron,
|
|
6188
6287
|
selected: rest.selected
|
|
6189
6288
|
}
|
|
6190
|
-
), /* @__PURE__ */
|
|
6289
|
+
), /* @__PURE__ */ React46.createElement(Spacer.Horizontal, { size: 6 })), icon && /* @__PURE__ */ React46.createElement(React46.Fragment, null, icon, /* @__PURE__ */ React46.createElement(Spacer.Horizontal, { size: 10 })), children);
|
|
6191
6290
|
});
|
|
6192
6291
|
var TreeView;
|
|
6193
6292
|
((TreeView2) => {
|
|
6194
6293
|
TreeView2.Root = ListView.Root;
|
|
6195
6294
|
TreeView2.RowTitle = ListView.RowTitle;
|
|
6196
6295
|
TreeView2.EditableRowTitle = ListView.EditableRowTitle;
|
|
6197
|
-
TreeView2.Row =
|
|
6296
|
+
TreeView2.Row = memo30(TreeRow);
|
|
6198
6297
|
})(TreeView || (TreeView = {}));
|
|
6199
6298
|
|
|
6200
6299
|
// src/components/WorkspaceLayout.tsx
|
|
6201
6300
|
import { useKeyboardShortcuts as useKeyboardShortcuts3 } from "@noya-app/noya-keymap";
|
|
6202
|
-
import
|
|
6301
|
+
import React48, { forwardRef as forwardRef19, useImperativeHandle as useImperativeHandle4, useRef as useRef20 } from "react";
|
|
6203
6302
|
import {
|
|
6204
6303
|
Panel,
|
|
6205
6304
|
PanelGroup,
|
|
@@ -6210,9 +6309,9 @@ import {
|
|
|
6210
6309
|
import { useLayoutEffect as useLayoutEffect9, useRef as useRef19 } from "react";
|
|
6211
6310
|
|
|
6212
6311
|
// src/hooks/useWindowSize.tsx
|
|
6213
|
-
import { useEffect as useEffect16, useState as
|
|
6312
|
+
import { useEffect as useEffect16, useState as useState21 } from "react";
|
|
6214
6313
|
function useWindowSize() {
|
|
6215
|
-
const [size2, setSize] =
|
|
6314
|
+
const [size2, setSize] = useState21(
|
|
6216
6315
|
typeof window === "undefined" ? { width: 0, height: 0 } : {
|
|
6217
6316
|
width: window.innerWidth,
|
|
6218
6317
|
height: window.innerHeight
|
|
@@ -6340,7 +6439,7 @@ function usePreservePanelSize(panelGroupRef, setPanelLayoutState) {
|
|
|
6340
6439
|
}
|
|
6341
6440
|
|
|
6342
6441
|
// src/components/WorkspaceLayout.tsx
|
|
6343
|
-
var WorkspaceLayout =
|
|
6442
|
+
var WorkspaceLayout = forwardRef19(function WorkspaceLayout2({
|
|
6344
6443
|
autoSavePrefix,
|
|
6345
6444
|
leftSidebarContent: leftPanelContent,
|
|
6346
6445
|
children: centerPanelContent,
|
|
@@ -6427,7 +6526,7 @@ var WorkspaceLayout = forwardRef18(function WorkspaceLayout2({
|
|
|
6427
6526
|
}
|
|
6428
6527
|
});
|
|
6429
6528
|
const centerPanelPercentage = 100 - (leftPanelContent ? leftSidebarPercentage : 0) - (rightPanelContent ? rightSidebarPercentage : 0);
|
|
6430
|
-
return /* @__PURE__ */
|
|
6529
|
+
return /* @__PURE__ */ React48.createElement(
|
|
6431
6530
|
"div",
|
|
6432
6531
|
{
|
|
6433
6532
|
id,
|
|
@@ -6439,7 +6538,7 @@ var WorkspaceLayout = forwardRef18(function WorkspaceLayout2({
|
|
|
6439
6538
|
...style3
|
|
6440
6539
|
}
|
|
6441
6540
|
},
|
|
6442
|
-
/* @__PURE__ */
|
|
6541
|
+
/* @__PURE__ */ React48.createElement(
|
|
6443
6542
|
PanelGroup,
|
|
6444
6543
|
{
|
|
6445
6544
|
ref: panelGroupRef,
|
|
@@ -6448,7 +6547,7 @@ var WorkspaceLayout = forwardRef18(function WorkspaceLayout2({
|
|
|
6448
6547
|
autoSaveId: autoSavePrefix ? `${autoSavePrefix}--${EDITOR_PANEL_GROUP_ID}` : void 0,
|
|
6449
6548
|
style: { flex: "1" }
|
|
6450
6549
|
},
|
|
6451
|
-
hasLeftSidebar && /* @__PURE__ */
|
|
6550
|
+
hasLeftSidebar && /* @__PURE__ */ React48.createElement(React48.Fragment, null, /* @__PURE__ */ React48.createElement(
|
|
6452
6551
|
Panel,
|
|
6453
6552
|
{
|
|
6454
6553
|
id: LEFT_SIDEBAR_ID,
|
|
@@ -6460,11 +6559,12 @@ var WorkspaceLayout = forwardRef18(function WorkspaceLayout2({
|
|
|
6460
6559
|
collapsible: true,
|
|
6461
6560
|
style: {
|
|
6462
6561
|
display: "flex",
|
|
6463
|
-
flexDirection: "row"
|
|
6562
|
+
flexDirection: "row",
|
|
6563
|
+
position: "relative"
|
|
6464
6564
|
}
|
|
6465
6565
|
},
|
|
6466
6566
|
leftPanelContent
|
|
6467
|
-
), /* @__PURE__ */
|
|
6567
|
+
), /* @__PURE__ */ React48.createElement(
|
|
6468
6568
|
PanelResizeHandle,
|
|
6469
6569
|
{
|
|
6470
6570
|
style: {
|
|
@@ -6475,7 +6575,7 @@ var WorkspaceLayout = forwardRef18(function WorkspaceLayout2({
|
|
|
6475
6575
|
}
|
|
6476
6576
|
}
|
|
6477
6577
|
)),
|
|
6478
|
-
/* @__PURE__ */
|
|
6578
|
+
/* @__PURE__ */ React48.createElement(
|
|
6479
6579
|
Panel,
|
|
6480
6580
|
{
|
|
6481
6581
|
id: CONTENT_AREA_ID,
|
|
@@ -6484,12 +6584,13 @@ var WorkspaceLayout = forwardRef18(function WorkspaceLayout2({
|
|
|
6484
6584
|
minSize: 10,
|
|
6485
6585
|
style: {
|
|
6486
6586
|
display: "flex",
|
|
6487
|
-
flexDirection: "row"
|
|
6587
|
+
flexDirection: "row",
|
|
6588
|
+
position: "relative"
|
|
6488
6589
|
}
|
|
6489
6590
|
},
|
|
6490
6591
|
centerPanelContent
|
|
6491
6592
|
),
|
|
6492
|
-
hasRightSidebar && /* @__PURE__ */
|
|
6593
|
+
hasRightSidebar && /* @__PURE__ */ React48.createElement(React48.Fragment, null, /* @__PURE__ */ React48.createElement(
|
|
6493
6594
|
PanelResizeHandle,
|
|
6494
6595
|
{
|
|
6495
6596
|
style: {
|
|
@@ -6499,7 +6600,7 @@ var WorkspaceLayout = forwardRef18(function WorkspaceLayout2({
|
|
|
6499
6600
|
backgroundColor: theme.colors.divider
|
|
6500
6601
|
}
|
|
6501
6602
|
}
|
|
6502
|
-
), /* @__PURE__ */
|
|
6603
|
+
), /* @__PURE__ */ React48.createElement(
|
|
6503
6604
|
Panel,
|
|
6504
6605
|
{
|
|
6505
6606
|
id: RIGHT_SIDEBAR_ID,
|
|
@@ -6510,7 +6611,8 @@ var WorkspaceLayout = forwardRef18(function WorkspaceLayout2({
|
|
|
6510
6611
|
collapsible: true,
|
|
6511
6612
|
style: {
|
|
6512
6613
|
display: "flex",
|
|
6513
|
-
flexDirection: "row"
|
|
6614
|
+
flexDirection: "row",
|
|
6615
|
+
position: "relative"
|
|
6514
6616
|
}
|
|
6515
6617
|
},
|
|
6516
6618
|
rightPanelContent
|
|
@@ -6561,8 +6663,8 @@ var SUPPORTED_CANVAS_UPLOAD_TYPES = [
|
|
|
6561
6663
|
|
|
6562
6664
|
// src/components/ArrayController.tsx
|
|
6563
6665
|
import { range as range2 } from "@noya-app/noya-utils";
|
|
6564
|
-
import
|
|
6565
|
-
import
|
|
6666
|
+
import React50, { memo as memo32, useCallback as useCallback26, useMemo as useMemo24 } from "react";
|
|
6667
|
+
import styled35, { useTheme as useTheme5 } from "styled-components";
|
|
6566
6668
|
|
|
6567
6669
|
// src/components/InspectorPrimitives.tsx
|
|
6568
6670
|
var InspectorPrimitives_exports = {};
|
|
@@ -6580,20 +6682,20 @@ __export(InspectorPrimitives_exports, {
|
|
|
6580
6682
|
Title: () => Title3,
|
|
6581
6683
|
VerticalSeparator: () => VerticalSeparator
|
|
6582
6684
|
});
|
|
6583
|
-
import
|
|
6584
|
-
import
|
|
6585
|
-
var Section =
|
|
6685
|
+
import React49, { memo as memo31 } from "react";
|
|
6686
|
+
import styled34, { useTheme as useTheme4 } from "styled-components";
|
|
6687
|
+
var Section = styled34.div(({ theme, $padding = "10px", $gap }) => ({
|
|
6586
6688
|
flex: "0 0 auto",
|
|
6587
6689
|
display: "flex",
|
|
6588
6690
|
flexDirection: "column",
|
|
6589
6691
|
padding: $padding,
|
|
6590
6692
|
gap: $gap
|
|
6591
6693
|
}));
|
|
6592
|
-
var SectionHeader =
|
|
6694
|
+
var SectionHeader = styled34.div(({ theme }) => ({
|
|
6593
6695
|
display: "flex",
|
|
6594
6696
|
alignItems: "center"
|
|
6595
6697
|
}));
|
|
6596
|
-
var Title3 =
|
|
6698
|
+
var Title3 = styled34.div(({ theme, $textStyle }) => ({
|
|
6597
6699
|
display: "flex",
|
|
6598
6700
|
flexDirection: "row",
|
|
6599
6701
|
userSelect: "none",
|
|
@@ -6606,7 +6708,7 @@ var Title3 = styled33.div(({ theme, $textStyle }) => ({
|
|
|
6606
6708
|
fontWeight: "bold"
|
|
6607
6709
|
}
|
|
6608
6710
|
}));
|
|
6609
|
-
var Row2 =
|
|
6711
|
+
var Row2 = styled34.div(
|
|
6610
6712
|
({ theme, $gap }) => ({
|
|
6611
6713
|
flex: "1",
|
|
6612
6714
|
display: "flex",
|
|
@@ -6615,26 +6717,26 @@ var Row2 = styled33.div(
|
|
|
6615
6717
|
gap: $gap
|
|
6616
6718
|
})
|
|
6617
6719
|
);
|
|
6618
|
-
var Column =
|
|
6720
|
+
var Column = styled34.div(({ theme }) => ({
|
|
6619
6721
|
flex: "1",
|
|
6620
6722
|
display: "flex",
|
|
6621
6723
|
flexDirection: "column",
|
|
6622
6724
|
gap: "4px"
|
|
6623
6725
|
}));
|
|
6624
|
-
var Checkbox =
|
|
6726
|
+
var Checkbox = styled34.input(({ theme }) => ({
|
|
6625
6727
|
margin: 0
|
|
6626
6728
|
}));
|
|
6627
|
-
var Text3 =
|
|
6729
|
+
var Text3 = styled34.span(({ theme }) => ({
|
|
6628
6730
|
...theme.textStyles.small
|
|
6629
6731
|
}));
|
|
6630
|
-
var VerticalSeparator = () => /* @__PURE__ */
|
|
6631
|
-
var HorizontalSeparator = () => /* @__PURE__ */
|
|
6632
|
-
var SliderRowLabel =
|
|
6732
|
+
var VerticalSeparator = () => /* @__PURE__ */ React49.createElement(Spacer.Vertical, { size: useTheme4().sizes.inspector.verticalSeparator });
|
|
6733
|
+
var HorizontalSeparator = () => /* @__PURE__ */ React49.createElement(Spacer.Horizontal, { size: useTheme4().sizes.inspector.horizontalSeparator });
|
|
6734
|
+
var SliderRowLabel = styled34.span(({ theme }) => ({
|
|
6633
6735
|
...theme.textStyles.small,
|
|
6634
6736
|
color: theme.colors.textMuted,
|
|
6635
6737
|
marginBottom: "-6px"
|
|
6636
6738
|
}));
|
|
6637
|
-
var RowLabel =
|
|
6739
|
+
var RowLabel = styled34.span(({ theme, $textStyle }) => ({
|
|
6638
6740
|
// marginBottom: '6px',
|
|
6639
6741
|
display: "flex",
|
|
6640
6742
|
...$textStyle ? {
|
|
@@ -6648,7 +6750,7 @@ var RowLabel = styled33.span(({ theme, $textStyle }) => ({
|
|
|
6648
6750
|
// Button height
|
|
6649
6751
|
alignItems: "center"
|
|
6650
6752
|
}));
|
|
6651
|
-
var LabeledRow =
|
|
6753
|
+
var LabeledRow = memo31(function LabeledRow2({
|
|
6652
6754
|
id,
|
|
6653
6755
|
children,
|
|
6654
6756
|
label,
|
|
@@ -6656,26 +6758,26 @@ var LabeledRow = memo30(function LabeledRow2({
|
|
|
6656
6758
|
gap,
|
|
6657
6759
|
right
|
|
6658
6760
|
}) {
|
|
6659
|
-
return /* @__PURE__ */
|
|
6761
|
+
return /* @__PURE__ */ React49.createElement(Row2, { id }, /* @__PURE__ */ React49.createElement(Column, null, /* @__PURE__ */ React49.createElement(RowLabel, { $textStyle: labelTextStyle }, label, right && /* @__PURE__ */ React49.createElement(Spacer.Horizontal, null), right), /* @__PURE__ */ React49.createElement(Row2, { $gap: gap }, children)));
|
|
6660
6762
|
});
|
|
6661
|
-
var LabeledSliderRow =
|
|
6763
|
+
var LabeledSliderRow = memo31(function LabeledRow3({
|
|
6662
6764
|
children,
|
|
6663
6765
|
label
|
|
6664
6766
|
}) {
|
|
6665
|
-
return /* @__PURE__ */
|
|
6767
|
+
return /* @__PURE__ */ React49.createElement(Row2, null, /* @__PURE__ */ React49.createElement(Column, null, /* @__PURE__ */ React49.createElement(SliderRowLabel, null, label), /* @__PURE__ */ React49.createElement(Row2, null, children)));
|
|
6666
6768
|
});
|
|
6667
6769
|
|
|
6668
6770
|
// src/components/ArrayController.tsx
|
|
6669
|
-
var ElementRow =
|
|
6771
|
+
var ElementRow = styled35.div({
|
|
6670
6772
|
flex: "0 0 auto",
|
|
6671
6773
|
display: "flex",
|
|
6672
6774
|
flexDirection: "row",
|
|
6673
6775
|
alignItems: "center"
|
|
6674
6776
|
});
|
|
6675
|
-
var ItemContainer2 =
|
|
6777
|
+
var ItemContainer2 = styled35.div({
|
|
6676
6778
|
position: "relative"
|
|
6677
6779
|
});
|
|
6678
|
-
var ArrayController =
|
|
6780
|
+
var ArrayController = memo32(function ArrayController2({
|
|
6679
6781
|
id,
|
|
6680
6782
|
items,
|
|
6681
6783
|
title,
|
|
@@ -6715,11 +6817,11 @@ var ArrayController = memo31(function ArrayController2({
|
|
|
6715
6817
|
[onMoveItem, reversed]
|
|
6716
6818
|
);
|
|
6717
6819
|
const renderRow = (index) => {
|
|
6718
|
-
return /* @__PURE__ */
|
|
6820
|
+
return /* @__PURE__ */ React50.createElement(ElementRow, { key: keys[index] }, renderItem({ item: items[index], index }));
|
|
6719
6821
|
};
|
|
6720
|
-
return /* @__PURE__ */
|
|
6822
|
+
return /* @__PURE__ */ React50.createElement(Section, { id, $padding: padding, $gap: "2px" }, /* @__PURE__ */ React50.createElement(SectionHeader, null, /* @__PURE__ */ React50.createElement(Button, { variant: "none", onClick: onClickPlus }, /* @__PURE__ */ React50.createElement(Title3, null, title)), /* @__PURE__ */ React50.createElement(Spacer.Horizontal, null), withSeparatorElements(
|
|
6721
6823
|
[
|
|
6722
|
-
onClickTrash && /* @__PURE__ */
|
|
6824
|
+
onClickTrash && /* @__PURE__ */ React50.createElement(
|
|
6723
6825
|
IconButton,
|
|
6724
6826
|
{
|
|
6725
6827
|
id: `${id}-trash`,
|
|
@@ -6728,7 +6830,7 @@ var ArrayController = memo31(function ArrayController2({
|
|
|
6728
6830
|
onClick: onClickTrash
|
|
6729
6831
|
}
|
|
6730
6832
|
),
|
|
6731
|
-
onClickExpand && /* @__PURE__ */
|
|
6833
|
+
onClickExpand && /* @__PURE__ */ React50.createElement(
|
|
6732
6834
|
IconButton,
|
|
6733
6835
|
{
|
|
6734
6836
|
id: `${id}-gear`,
|
|
@@ -6737,7 +6839,7 @@ var ArrayController = memo31(function ArrayController2({
|
|
|
6737
6839
|
onClick: onClickExpand
|
|
6738
6840
|
}
|
|
6739
6841
|
),
|
|
6740
|
-
onClickPlus && /* @__PURE__ */
|
|
6842
|
+
onClickPlus && /* @__PURE__ */ React50.createElement(
|
|
6741
6843
|
IconButton,
|
|
6742
6844
|
{
|
|
6743
6845
|
id: `${id}-add`,
|
|
@@ -6747,15 +6849,15 @@ var ArrayController = memo31(function ArrayController2({
|
|
|
6747
6849
|
}
|
|
6748
6850
|
)
|
|
6749
6851
|
],
|
|
6750
|
-
/* @__PURE__ */
|
|
6751
|
-
)), /* @__PURE__ */
|
|
6852
|
+
/* @__PURE__ */ React50.createElement(Spacer.Horizontal, { size: 8 })
|
|
6853
|
+
)), /* @__PURE__ */ React50.createElement(Stack.V, { gap: "4px" }, sortable ? /* @__PURE__ */ React50.createElement(
|
|
6752
6854
|
Sortable.Root,
|
|
6753
6855
|
{
|
|
6754
6856
|
keys,
|
|
6755
6857
|
renderOverlay: renderRow,
|
|
6756
6858
|
onMoveItem: handleMoveItem
|
|
6757
6859
|
},
|
|
6758
|
-
indexes.map((index) => /* @__PURE__ */
|
|
6860
|
+
indexes.map((index) => /* @__PURE__ */ React50.createElement(Sortable.Item, { id: keys[index], key: keys[index] }, ({ relativeDropPosition, ...sortableProps }) => /* @__PURE__ */ React50.createElement(ItemContainer2, { ...sortableProps }, renderRow(index), relativeDropPosition && /* @__PURE__ */ React50.createElement(
|
|
6759
6861
|
ListView.DragIndicator,
|
|
6760
6862
|
{
|
|
6761
6863
|
$gap: 0,
|
|
@@ -6769,11 +6871,11 @@ var ArrayController = memo31(function ArrayController2({
|
|
|
6769
6871
|
|
|
6770
6872
|
// src/components/DimensionInput.tsx
|
|
6771
6873
|
import { round } from "@noya-app/noya-utils";
|
|
6772
|
-
import
|
|
6874
|
+
import React51, { memo as memo33, useCallback as useCallback27 } from "react";
|
|
6773
6875
|
function getNewValue(value, mode, delta) {
|
|
6774
6876
|
return delta === void 0 ? value : mode === "replace" ? delta : value + delta;
|
|
6775
6877
|
}
|
|
6776
|
-
var DimensionInput =
|
|
6878
|
+
var DimensionInput = memo33(function DimensionInput2({
|
|
6777
6879
|
id,
|
|
6778
6880
|
value,
|
|
6779
6881
|
onSetValue,
|
|
@@ -6791,7 +6893,7 @@ var DimensionInput = memo32(function DimensionInput2({
|
|
|
6791
6893
|
(value2) => onSetValue(value2, "replace"),
|
|
6792
6894
|
[onSetValue]
|
|
6793
6895
|
);
|
|
6794
|
-
return /* @__PURE__ */
|
|
6896
|
+
return /* @__PURE__ */ React51.createElement(InputField.Root, { id, width: size2 }, /* @__PURE__ */ React51.createElement(
|
|
6795
6897
|
InputField.NumberInput,
|
|
6796
6898
|
{
|
|
6797
6899
|
value: value === void 0 ? value : round(value, 2),
|
|
@@ -6800,7 +6902,7 @@ var DimensionInput = memo32(function DimensionInput2({
|
|
|
6800
6902
|
disabled,
|
|
6801
6903
|
...trigger === "change" ? { onChange: handleSetValue } : { onSubmit: handleSetValue }
|
|
6802
6904
|
}
|
|
6803
|
-
), label && /* @__PURE__ */
|
|
6905
|
+
), label && /* @__PURE__ */ React51.createElement(InputField.Label, null, label));
|
|
6804
6906
|
});
|
|
6805
6907
|
export {
|
|
6806
6908
|
ActivityIndicator,
|
|
@@ -6859,6 +6961,7 @@ export {
|
|
|
6859
6961
|
SUPPORTED_IMAGE_UPLOAD_TYPES,
|
|
6860
6962
|
ScrollArea,
|
|
6861
6963
|
Select,
|
|
6964
|
+
SelectMenu,
|
|
6862
6965
|
SelectOption,
|
|
6863
6966
|
Slider,
|
|
6864
6967
|
Small,
|