@noya-app/noya-designsystem 0.1.20 → 0.1.22
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 +18 -0
- package/dist/index.d.mts +53 -31
- package/dist/index.d.ts +53 -31
- package/dist/index.js +261 -165
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +297 -205
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -4
- package/src/components/Chip.tsx +90 -78
- package/src/components/ContextMenu.tsx +15 -21
- package/src/components/InputField.tsx +49 -5
- package/src/components/ListView.tsx +9 -0
- package/src/components/Popover.tsx +6 -6
- package/src/components/Select.tsx +1 -1
- 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 +4 -2
- 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,
|
|
@@ -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
|
|
|
@@ -679,7 +690,8 @@ var textStyles = {
|
|
|
679
690
|
fontFamily: fonts.normal,
|
|
680
691
|
fontSize: `${typeScale[6]}rem`,
|
|
681
692
|
fontWeight: 400,
|
|
682
|
-
lineHeight: "
|
|
693
|
+
lineHeight: "19px"
|
|
694
|
+
// lineHeight: "1.4",
|
|
683
695
|
},
|
|
684
696
|
button: {
|
|
685
697
|
fontFamily: fonts.normal,
|
|
@@ -697,7 +709,8 @@ var textStyles = {
|
|
|
697
709
|
fontFamily: fonts.normal,
|
|
698
710
|
fontSize: "0.62rem",
|
|
699
711
|
fontWeight: 400,
|
|
700
|
-
lineHeight: "
|
|
712
|
+
lineHeight: "19px",
|
|
713
|
+
// lineHeight: "1.4",
|
|
701
714
|
textTransform: "uppercase",
|
|
702
715
|
letterSpacing: "-0.3px"
|
|
703
716
|
}
|
|
@@ -774,7 +787,7 @@ import React18, {
|
|
|
774
787
|
useContext as useContext3,
|
|
775
788
|
useMemo as useMemo7,
|
|
776
789
|
useRef as useRef11,
|
|
777
|
-
useState as
|
|
790
|
+
useState as useState12
|
|
778
791
|
} from "react";
|
|
779
792
|
import styled13 from "styled-components";
|
|
780
793
|
|
|
@@ -1224,7 +1237,8 @@ import React17, {
|
|
|
1224
1237
|
useEffect as useEffect10,
|
|
1225
1238
|
useLayoutEffect as useLayoutEffect4,
|
|
1226
1239
|
useMemo as useMemo6,
|
|
1227
|
-
useRef as useRef10
|
|
1240
|
+
useRef as useRef10,
|
|
1241
|
+
useState as useState11
|
|
1228
1242
|
} from "react";
|
|
1229
1243
|
import styled12 from "styled-components";
|
|
1230
1244
|
|
|
@@ -1789,13 +1803,7 @@ function Popover({
|
|
|
1789
1803
|
onFocusOutside,
|
|
1790
1804
|
onPointerDownOutside,
|
|
1791
1805
|
collisionPadding: 8,
|
|
1792
|
-
arrowPadding: 2
|
|
1793
|
-
onPointerDown: (event) => {
|
|
1794
|
-
event.stopPropagation();
|
|
1795
|
-
},
|
|
1796
|
-
onWheel: (event) => {
|
|
1797
|
-
event.stopPropagation();
|
|
1798
|
-
}
|
|
1806
|
+
arrowPadding: 2
|
|
1799
1807
|
},
|
|
1800
1808
|
children,
|
|
1801
1809
|
showArrow && /* @__PURE__ */ React16.createElement(ArrowElement, null),
|
|
@@ -1977,7 +1985,11 @@ var InputElement = styled12(TextInput_default)(({
|
|
|
1977
1985
|
// },
|
|
1978
1986
|
};
|
|
1979
1987
|
});
|
|
1980
|
-
var InputFieldInput = forwardRef9(function InputFieldInput2(
|
|
1988
|
+
var InputFieldInput = forwardRef9(function InputFieldInput2({
|
|
1989
|
+
textAlign,
|
|
1990
|
+
variant,
|
|
1991
|
+
...rest
|
|
1992
|
+
}, forwardedRef) {
|
|
1981
1993
|
const {
|
|
1982
1994
|
labelPosition,
|
|
1983
1995
|
labelSize,
|
|
@@ -2005,8 +2017,10 @@ var InputFieldInput = forwardRef9(function InputFieldInput2(props, forwardedRef)
|
|
|
2005
2017
|
$hasLabel: hasLabel,
|
|
2006
2018
|
$hasDropdown: hasDropdown,
|
|
2007
2019
|
$size: size2,
|
|
2020
|
+
$variant: variant,
|
|
2021
|
+
$textAlign: textAlign,
|
|
2008
2022
|
onFocusChange: handleFocusChange,
|
|
2009
|
-
...
|
|
2023
|
+
...rest
|
|
2010
2024
|
}
|
|
2011
2025
|
);
|
|
2012
2026
|
});
|
|
@@ -2050,9 +2064,10 @@ function parseNumber(value) {
|
|
|
2050
2064
|
return value ? Number(value) : NaN;
|
|
2051
2065
|
}
|
|
2052
2066
|
function InputFieldNumberInput(props) {
|
|
2053
|
-
const { value, placeholder, onNudge, ...rest } = props;
|
|
2067
|
+
const { value, placeholder, onNudge, onBlur, ...rest } = props;
|
|
2054
2068
|
const onSubmit = "onSubmit" in props ? props.onSubmit : void 0;
|
|
2055
2069
|
const onChange = "onChange" in props ? props.onChange : void 0;
|
|
2070
|
+
const [internalValue, setInternalValue] = useState11();
|
|
2056
2071
|
const handleSubmit = useCallback11(
|
|
2057
2072
|
(value2) => {
|
|
2058
2073
|
const newValue = parseNumber(value2);
|
|
@@ -2068,6 +2083,7 @@ function InputFieldNumberInput(props) {
|
|
|
2068
2083
|
if (!amount)
|
|
2069
2084
|
return;
|
|
2070
2085
|
onNudge?.(amount);
|
|
2086
|
+
setInternalValue(void 0);
|
|
2071
2087
|
event.preventDefault();
|
|
2072
2088
|
event.stopPropagation();
|
|
2073
2089
|
},
|
|
@@ -2075,17 +2091,37 @@ function InputFieldNumberInput(props) {
|
|
|
2075
2091
|
);
|
|
2076
2092
|
const handleChange = useCallback11(
|
|
2077
2093
|
(value2) => {
|
|
2078
|
-
|
|
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
|
+
}
|
|
2079
2107
|
},
|
|
2080
2108
|
[onChange]
|
|
2081
2109
|
);
|
|
2110
|
+
const handleBlur = useCallback11(
|
|
2111
|
+
(event) => {
|
|
2112
|
+
setInternalValue(void 0);
|
|
2113
|
+
onBlur?.(event);
|
|
2114
|
+
},
|
|
2115
|
+
[onBlur]
|
|
2116
|
+
);
|
|
2082
2117
|
return /* @__PURE__ */ React17.createElement(
|
|
2083
2118
|
InputFieldInput,
|
|
2084
2119
|
{
|
|
2085
2120
|
...rest,
|
|
2086
|
-
value: value === void 0 ? "" : String(value),
|
|
2121
|
+
value: internalValue !== void 0 ? String(internalValue) : value === void 0 ? "" : String(value),
|
|
2087
2122
|
placeholder,
|
|
2088
2123
|
onKeyDown: handleKeyDown,
|
|
2124
|
+
onBlur: handleBlur,
|
|
2089
2125
|
..."onChange" in props ? { onChange: handleChange } : { onSubmit: handleSubmit }
|
|
2090
2126
|
}
|
|
2091
2127
|
);
|
|
@@ -2213,7 +2249,7 @@ var DialogContext = createContext3(void 0);
|
|
|
2213
2249
|
var DialogProvider = function DialogProvider2({
|
|
2214
2250
|
children
|
|
2215
2251
|
}) {
|
|
2216
|
-
const [contents, setContents] =
|
|
2252
|
+
const [contents, setContents] = useState12();
|
|
2217
2253
|
const isOpen = !!contents;
|
|
2218
2254
|
const close = useCallback12(() => {
|
|
2219
2255
|
if (!contents)
|
|
@@ -2324,14 +2360,14 @@ function useDialogContainsElement() {
|
|
|
2324
2360
|
|
|
2325
2361
|
// src/contexts/FloatingWindowContext.tsx
|
|
2326
2362
|
import { uuid } from "@noya-app/noya-utils";
|
|
2327
|
-
import React19, { createContext as createContext4, useContext as useContext4, useMemo as useMemo8, useState as
|
|
2363
|
+
import React19, { createContext as createContext4, useContext as useContext4, useMemo as useMemo8, useState as useState13 } from "react";
|
|
2328
2364
|
import { createPortal } from "react-dom";
|
|
2329
2365
|
var FloatingWindowContext = createContext4(void 0);
|
|
2330
2366
|
var CurrentWindowContext = createContext4(void 0);
|
|
2331
2367
|
var FloatingWindowProvider = ({
|
|
2332
2368
|
children
|
|
2333
2369
|
}) => {
|
|
2334
|
-
const [windows, setWindows] =
|
|
2370
|
+
const [windows, setWindows] = useState13({});
|
|
2335
2371
|
const contextValue = useMemo8(() => {
|
|
2336
2372
|
const createWindow = (element) => {
|
|
2337
2373
|
const id = uuid();
|
|
@@ -2399,7 +2435,7 @@ var DesignSystemConfigurationProvider = memo10(
|
|
|
2399
2435
|
theme,
|
|
2400
2436
|
platform
|
|
2401
2437
|
}) {
|
|
2402
|
-
const [internalPlatform, setInternalPlatform] =
|
|
2438
|
+
const [internalPlatform, setInternalPlatform] = useState14(
|
|
2403
2439
|
platform ?? "key"
|
|
2404
2440
|
);
|
|
2405
2441
|
useEffect11(() => {
|
|
@@ -2531,15 +2567,15 @@ var ChipElement = styled14.span(({ theme, $colorScheme, $size, $variant, $monosp
|
|
|
2531
2567
|
userSelect: "none",
|
|
2532
2568
|
display: "inline-flex",
|
|
2533
2569
|
alignItems: "center",
|
|
2534
|
-
lineHeight: "1.4",
|
|
2570
|
+
// lineHeight: "1.4",
|
|
2571
|
+
lineHeight: "15px",
|
|
2535
2572
|
whiteSpace: "pre",
|
|
2536
2573
|
...$size === "medium" ? {
|
|
2537
2574
|
fontSize: "11px",
|
|
2538
2575
|
padding: "4px 8px"
|
|
2539
2576
|
} : {
|
|
2540
2577
|
fontSize: "9px",
|
|
2541
|
-
padding: "0px 4px"
|
|
2542
|
-
lineHeight: "15px"
|
|
2578
|
+
padding: "0px 4px"
|
|
2543
2579
|
},
|
|
2544
2580
|
...$monospace && {
|
|
2545
2581
|
fontFamily: theme.fonts.monospace
|
|
@@ -2602,76 +2638,78 @@ var AddElement = styled14(PlusIcon).withConfig({
|
|
|
2602
2638
|
opacity: 0.85
|
|
2603
2639
|
}
|
|
2604
2640
|
}));
|
|
2605
|
-
var Chip = memo11(
|
|
2606
|
-
|
|
2607
|
-
|
|
2608
|
-
deletable,
|
|
2609
|
-
addable,
|
|
2610
|
-
style: style3,
|
|
2611
|
-
size: size2 = "medium",
|
|
2612
|
-
variant = "solid",
|
|
2613
|
-
monospace = false,
|
|
2614
|
-
tabIndex,
|
|
2615
|
-
onDelete,
|
|
2616
|
-
onClick,
|
|
2617
|
-
onAdd,
|
|
2618
|
-
onHoverDeleteChange
|
|
2619
|
-
}) {
|
|
2620
|
-
const theme = useDesignSystemTheme();
|
|
2621
|
-
const { hoverProps: hoverDeleteProps } = useHover({
|
|
2622
|
-
onHoverChange: onHoverDeleteChange
|
|
2623
|
-
});
|
|
2624
|
-
const handleClick = !children && !deletable && addable ? onAdd : onClick;
|
|
2625
|
-
const color = colorScheme === "primary" ? theme.colors.primary : colorScheme === "secondary" ? theme.colors.secondary : theme.colors.text;
|
|
2626
|
-
return /* @__PURE__ */ React22.createElement(
|
|
2627
|
-
ChipElement,
|
|
2628
|
-
{
|
|
2629
|
-
$variant: variant,
|
|
2630
|
-
$colorScheme: colorScheme,
|
|
2631
|
-
style: style3,
|
|
2632
|
-
onClick: handleClick,
|
|
2633
|
-
$size: size2,
|
|
2634
|
-
$monospace: monospace,
|
|
2635
|
-
$isInteractive: !!handleClick,
|
|
2636
|
-
tabIndex
|
|
2637
|
-
},
|
|
2638
|
-
addable && /* @__PURE__ */ React22.createElement(
|
|
2639
|
-
AddElement,
|
|
2640
|
-
{
|
|
2641
|
-
size: size2,
|
|
2642
|
-
isOnlyChild: !children && !deletable,
|
|
2643
|
-
onClick: onAdd ? (event) => {
|
|
2644
|
-
event.stopPropagation();
|
|
2645
|
-
onAdd?.();
|
|
2646
|
-
} : void 0,
|
|
2647
|
-
color
|
|
2648
|
-
}
|
|
2649
|
-
),
|
|
2641
|
+
var Chip = memo11(
|
|
2642
|
+
forwardRef10(function Chip2({
|
|
2643
|
+
colorScheme,
|
|
2650
2644
|
children,
|
|
2651
|
-
deletable
|
|
2652
|
-
|
|
2645
|
+
deletable,
|
|
2646
|
+
addable,
|
|
2647
|
+
clickable,
|
|
2648
|
+
style: style3,
|
|
2649
|
+
size: size2 = "medium",
|
|
2650
|
+
variant = "solid",
|
|
2651
|
+
monospace = false,
|
|
2652
|
+
tabIndex,
|
|
2653
|
+
onDelete,
|
|
2654
|
+
onClick,
|
|
2655
|
+
onAdd,
|
|
2656
|
+
onHoverDeleteChange,
|
|
2657
|
+
...rest
|
|
2658
|
+
}, forwardedRef) {
|
|
2659
|
+
const theme = useDesignSystemTheme();
|
|
2660
|
+
const { hoverProps: hoverDeleteProps } = useHover({
|
|
2661
|
+
onHoverChange: onHoverDeleteChange
|
|
2662
|
+
});
|
|
2663
|
+
const handleClick = !children && !deletable && addable ? onAdd : onClick;
|
|
2664
|
+
const color = colorScheme === "primary" ? theme.colors.primary : colorScheme === "secondary" ? theme.colors.secondary : theme.colors.text;
|
|
2665
|
+
return /* @__PURE__ */ React22.createElement(
|
|
2666
|
+
ChipElement,
|
|
2653
2667
|
{
|
|
2654
|
-
|
|
2655
|
-
|
|
2656
|
-
|
|
2657
|
-
|
|
2658
|
-
|
|
2659
|
-
|
|
2660
|
-
|
|
2661
|
-
|
|
2662
|
-
|
|
2663
|
-
|
|
2664
|
-
}
|
|
2668
|
+
ref: forwardedRef,
|
|
2669
|
+
$variant: variant,
|
|
2670
|
+
$colorScheme: colorScheme,
|
|
2671
|
+
style: style3,
|
|
2672
|
+
onClick: handleClick,
|
|
2673
|
+
$size: size2,
|
|
2674
|
+
$monospace: monospace,
|
|
2675
|
+
$isInteractive: !!handleClick || clickable === true,
|
|
2676
|
+
tabIndex,
|
|
2677
|
+
...rest
|
|
2678
|
+
},
|
|
2679
|
+
addable && /* @__PURE__ */ React22.createElement(
|
|
2680
|
+
AddElement,
|
|
2681
|
+
{
|
|
2682
|
+
size: size2,
|
|
2683
|
+
isOnlyChild: !children && !deletable,
|
|
2684
|
+
onClick: onAdd ? (event) => {
|
|
2685
|
+
event.stopPropagation();
|
|
2686
|
+
onAdd?.();
|
|
2687
|
+
} : void 0,
|
|
2688
|
+
color
|
|
2689
|
+
}
|
|
2690
|
+
),
|
|
2691
|
+
children,
|
|
2692
|
+
deletable && /* @__PURE__ */ React22.createElement(
|
|
2693
|
+
DeleteElement,
|
|
2694
|
+
{
|
|
2695
|
+
size: size2,
|
|
2696
|
+
...hoverDeleteProps,
|
|
2697
|
+
onClick: onDelete ? (event) => {
|
|
2698
|
+
event.stopPropagation();
|
|
2699
|
+
onDelete?.();
|
|
2700
|
+
} : void 0,
|
|
2701
|
+
color
|
|
2702
|
+
}
|
|
2703
|
+
)
|
|
2704
|
+
);
|
|
2705
|
+
})
|
|
2706
|
+
);
|
|
2665
2707
|
|
|
2666
2708
|
// src/components/ContextMenu.tsx
|
|
2667
2709
|
import { CheckIcon as CheckIcon2, ChevronRightIcon as ChevronRightIcon2 } from "@noya-app/noya-icons";
|
|
2668
2710
|
import { useKeyboardShortcuts as useKeyboardShortcuts2 } from "@noya-app/noya-keymap";
|
|
2669
2711
|
import * as RadixContextMenu from "@radix-ui/react-context-menu";
|
|
2670
|
-
import React23, {
|
|
2671
|
-
memo as memo12,
|
|
2672
|
-
useCallback as useCallback13,
|
|
2673
|
-
useMemo as useMemo11
|
|
2674
|
-
} from "react";
|
|
2712
|
+
import React23, { memo as memo12, useCallback as useCallback13, useMemo as useMemo11 } from "react";
|
|
2675
2713
|
import styled15 from "styled-components";
|
|
2676
2714
|
var SeparatorElement2 = styled15(RadixContextMenu.Separator)(
|
|
2677
2715
|
styles.separatorStyle
|
|
@@ -2819,7 +2857,7 @@ var DividerVertical = memo13(function DividerVertical2({
|
|
|
2819
2857
|
|
|
2820
2858
|
// src/components/DraggableMenuButton.tsx
|
|
2821
2859
|
import { DragHandleDots2Icon } from "@noya-app/noya-icons";
|
|
2822
|
-
import React25, { memo as memo14, useCallback as useCallback14, useState as
|
|
2860
|
+
import React25, { memo as memo14, useCallback as useCallback14, useState as useState16 } from "react";
|
|
2823
2861
|
import styled17 from "styled-components";
|
|
2824
2862
|
var DotButtonElement = styled17.div(({ theme }) => ({
|
|
2825
2863
|
cursor: "pointer",
|
|
@@ -2845,7 +2883,7 @@ var DraggableMenuButton = memo14(function DraggableMenuButton2({
|
|
|
2845
2883
|
isVisible = true
|
|
2846
2884
|
}) {
|
|
2847
2885
|
const color = useDesignSystemTheme().colors.icon;
|
|
2848
|
-
const [open, setOpen] =
|
|
2886
|
+
const [open, setOpen] = useState16(false);
|
|
2849
2887
|
const [downPosition, setDownPosition] = React25.useState(null);
|
|
2850
2888
|
const handlePointerDownCapture = useCallback14(
|
|
2851
2889
|
(event) => {
|
|
@@ -2918,7 +2956,7 @@ var DraggableMenuButton = memo14(function DraggableMenuButton2({
|
|
|
2918
2956
|
});
|
|
2919
2957
|
|
|
2920
2958
|
// src/components/FillInputField.tsx
|
|
2921
|
-
import React28, { forwardRef as
|
|
2959
|
+
import React28, { forwardRef as forwardRef11, memo as memo17 } from "react";
|
|
2922
2960
|
import styled19 from "styled-components";
|
|
2923
2961
|
|
|
2924
2962
|
// ../noya-file-format/src/types.ts
|
|
@@ -3446,13 +3484,13 @@ var Container = styled19.button(
|
|
|
3446
3484
|
})
|
|
3447
3485
|
);
|
|
3448
3486
|
var FillInputField = memo17(
|
|
3449
|
-
|
|
3487
|
+
forwardRef11(function FillInputField2({ id, value, flex, ...rest }, ref) {
|
|
3450
3488
|
return /* @__PURE__ */ React28.createElement(Container, { ref, id, $flex: flex, ...rest }, /* @__PURE__ */ React28.createElement(FillPreviewBackground, { value }));
|
|
3451
3489
|
})
|
|
3452
3490
|
);
|
|
3453
3491
|
|
|
3454
3492
|
// src/components/FloatingWindow.tsx
|
|
3455
|
-
import React29, { useCallback as useCallback15, useRef as useRef13, useState as
|
|
3493
|
+
import React29, { useCallback as useCallback15, useRef as useRef13, useState as useState17 } from "react";
|
|
3456
3494
|
var styles2 = {
|
|
3457
3495
|
noSelect: {
|
|
3458
3496
|
userSelect: "none",
|
|
@@ -3570,15 +3608,15 @@ var FloatingWindow = ({
|
|
|
3570
3608
|
toolbarContent,
|
|
3571
3609
|
renderToolbar = defaultRenderToolbar
|
|
3572
3610
|
}) => {
|
|
3573
|
-
const [position, setPosition] =
|
|
3574
|
-
const [size2, setSize] =
|
|
3611
|
+
const [position, setPosition] = useState17({ x: initialX, y: initialY });
|
|
3612
|
+
const [size2, setSize] = useState17({
|
|
3575
3613
|
width: initialWidth,
|
|
3576
3614
|
height: initialHeight
|
|
3577
3615
|
});
|
|
3578
|
-
const [isDragging, setIsDragging] =
|
|
3579
|
-
const [isResizing, setIsResizing] =
|
|
3580
|
-
const [dragOffset, setDragOffset] =
|
|
3581
|
-
const [resizeDirection, setResizeDirection] =
|
|
3616
|
+
const [isDragging, setIsDragging] = useState17(false);
|
|
3617
|
+
const [isResizing, setIsResizing] = useState17(false);
|
|
3618
|
+
const [dragOffset, setDragOffset] = useState17({ x: 0, y: 0 });
|
|
3619
|
+
const [resizeDirection, setResizeDirection] = useState17(null);
|
|
3582
3620
|
const wrapperRef = useRef13(null);
|
|
3583
3621
|
const toggleGlobalTextSelection = (disable) => {
|
|
3584
3622
|
if (disable) {
|
|
@@ -3823,7 +3861,7 @@ var Grid = styled20.div((props) => ({
|
|
|
3823
3861
|
// src/components/GridView.tsx
|
|
3824
3862
|
import React32, {
|
|
3825
3863
|
createContext as createContext7,
|
|
3826
|
-
forwardRef as
|
|
3864
|
+
forwardRef as forwardRef12,
|
|
3827
3865
|
memo as memo20,
|
|
3828
3866
|
useCallback as useCallback18,
|
|
3829
3867
|
useContext as useContext7,
|
|
@@ -3833,7 +3871,7 @@ import styled22, { keyframes as keyframes2 } from "styled-components";
|
|
|
3833
3871
|
|
|
3834
3872
|
// src/components/ScrollArea.tsx
|
|
3835
3873
|
import * as RadixScrollArea from "@radix-ui/react-scroll-area";
|
|
3836
|
-
import React31, { memo as memo19, useCallback as useCallback17, useState as
|
|
3874
|
+
import React31, { memo as memo19, useCallback as useCallback17, useState as useState18 } from "react";
|
|
3837
3875
|
import styled21 from "styled-components";
|
|
3838
3876
|
var SCROLLBAR_SIZE = 10;
|
|
3839
3877
|
var StyledViewport = styled21(RadixScrollArea.Viewport)({
|
|
@@ -3862,7 +3900,7 @@ var Container2 = styled21.div({
|
|
|
3862
3900
|
minHeight: 0
|
|
3863
3901
|
});
|
|
3864
3902
|
var ScrollArea = memo19(function ScrollArea2({ children }) {
|
|
3865
|
-
const [scrollElementRef, setScrollElementRef] =
|
|
3903
|
+
const [scrollElementRef, setScrollElementRef] = useState18(null);
|
|
3866
3904
|
return /* @__PURE__ */ React31.createElement(Container2, null, /* @__PURE__ */ React31.createElement(RadixScrollArea.Root, { style: { width: "100%", height: "100%" } }, /* @__PURE__ */ React31.createElement(
|
|
3867
3905
|
StyledViewport,
|
|
3868
3906
|
{
|
|
@@ -4052,7 +4090,7 @@ var Shimmer = styled22.div`
|
|
|
4052
4090
|
align-items: end;
|
|
4053
4091
|
padding: 4px;
|
|
4054
4092
|
`;
|
|
4055
|
-
var GridViewItem =
|
|
4093
|
+
var GridViewItem = forwardRef12(function GridViewItem2({
|
|
4056
4094
|
id,
|
|
4057
4095
|
title,
|
|
4058
4096
|
subtitle,
|
|
@@ -4197,7 +4235,7 @@ var GridView;
|
|
|
4197
4235
|
// src/components/InputFieldWithCompletions.tsx
|
|
4198
4236
|
import { chunkBy, partition } from "@noya-app/noya-utils";
|
|
4199
4237
|
import React36, {
|
|
4200
|
-
forwardRef as
|
|
4238
|
+
forwardRef as forwardRef15,
|
|
4201
4239
|
memo as memo23,
|
|
4202
4240
|
useCallback as useCallback21,
|
|
4203
4241
|
useEffect as useEffect14,
|
|
@@ -4205,7 +4243,7 @@ import React36, {
|
|
|
4205
4243
|
useLayoutEffect as useLayoutEffect7,
|
|
4206
4244
|
useMemo as useMemo19,
|
|
4207
4245
|
useRef as useRef16,
|
|
4208
|
-
useState as
|
|
4246
|
+
useState as useState20
|
|
4209
4247
|
} from "react";
|
|
4210
4248
|
import styled25 from "styled-components";
|
|
4211
4249
|
|
|
@@ -4286,7 +4324,7 @@ import { composeRefs as composeRefs2 } from "@radix-ui/react-compose-refs";
|
|
|
4286
4324
|
import React34, {
|
|
4287
4325
|
Children as Children4,
|
|
4288
4326
|
createContext as createContext9,
|
|
4289
|
-
forwardRef as
|
|
4327
|
+
forwardRef as forwardRef13,
|
|
4290
4328
|
isValidElement as isValidElement3,
|
|
4291
4329
|
memo as memo22,
|
|
4292
4330
|
useCallback as useCallback20,
|
|
@@ -4345,7 +4383,7 @@ import React33, {
|
|
|
4345
4383
|
useEffect as useEffect13,
|
|
4346
4384
|
useMemo as useMemo17,
|
|
4347
4385
|
useRef as useRef14,
|
|
4348
|
-
useState as
|
|
4386
|
+
useState as useState19
|
|
4349
4387
|
} from "react";
|
|
4350
4388
|
import { createPortal as createPortal2 } from "react-dom";
|
|
4351
4389
|
var normalizeListDestinationIndex = (index, position) => {
|
|
@@ -4433,12 +4471,12 @@ function SortableRoot({
|
|
|
4433
4471
|
}
|
|
4434
4472
|
})
|
|
4435
4473
|
);
|
|
4436
|
-
const [activeIndex, setActiveIndex] =
|
|
4474
|
+
const [activeIndex, setActiveIndex] = useState19();
|
|
4437
4475
|
const activatorEvent = useRef14(null);
|
|
4438
4476
|
const setActivatorEvent = useCallback19((event) => {
|
|
4439
4477
|
activatorEvent.current = event;
|
|
4440
4478
|
}, []);
|
|
4441
|
-
const [position, setPosition] =
|
|
4479
|
+
const [position, setPosition] = useState19({ x: 0, y: 0 });
|
|
4442
4480
|
const handleDragStart = useCallback19(
|
|
4443
4481
|
(event) => {
|
|
4444
4482
|
setActiveIndex(keys.indexOf(event.active.id));
|
|
@@ -4475,7 +4513,7 @@ function SortableRoot({
|
|
|
4475
4513
|
},
|
|
4476
4514
|
[acceptsDrop, axis, keys, onMoveItem, position.x, position.y]
|
|
4477
4515
|
);
|
|
4478
|
-
const [mounted, setMounted] =
|
|
4516
|
+
const [mounted, setMounted] = useState19(false);
|
|
4479
4517
|
useEffect13(() => {
|
|
4480
4518
|
setMounted(true);
|
|
4481
4519
|
}, []);
|
|
@@ -4684,7 +4722,7 @@ var ListViewDragIndicatorElement = styled23.div(({ theme, $relativeDropPosition,
|
|
|
4684
4722
|
boxShadow: "0 0 2px rgba(0,0,0,0.5)"
|
|
4685
4723
|
}
|
|
4686
4724
|
}));
|
|
4687
|
-
var ListViewRow =
|
|
4725
|
+
var ListViewRow = forwardRef13(function ListViewRow2({
|
|
4688
4726
|
id,
|
|
4689
4727
|
tabIndex = 0,
|
|
4690
4728
|
gap,
|
|
@@ -4825,7 +4863,7 @@ var VirtualizedListRow = memo22(function VirtualizedListRow2({
|
|
|
4825
4863
|
const renderItem = useContext9(RenderItemContext);
|
|
4826
4864
|
return /* @__PURE__ */ React34.createElement("div", { key: index, style: style3 }, renderItem(index));
|
|
4827
4865
|
});
|
|
4828
|
-
var VirtualizedListInner =
|
|
4866
|
+
var VirtualizedListInner = forwardRef13(function VirtualizedListInner2({
|
|
4829
4867
|
size: size2,
|
|
4830
4868
|
scrollElement,
|
|
4831
4869
|
items,
|
|
@@ -4906,7 +4944,10 @@ var RootContainer2 = styled23.div(({ theme, $scrollable, $gap }) => ({
|
|
|
4906
4944
|
color: theme.colors.textMuted,
|
|
4907
4945
|
gap: $gap
|
|
4908
4946
|
}));
|
|
4909
|
-
var ListViewRootInner =
|
|
4947
|
+
var ListViewRootInner = forwardRef13(function ListViewRootInner2({
|
|
4948
|
+
id,
|
|
4949
|
+
className,
|
|
4950
|
+
style: style3,
|
|
4910
4951
|
onPress,
|
|
4911
4952
|
scrollable = false,
|
|
4912
4953
|
expandable = true,
|
|
@@ -5046,6 +5087,9 @@ var ListViewRootInner = forwardRef12(function ListViewRootInner2({
|
|
|
5046
5087
|
return /* @__PURE__ */ React34.createElement(DraggingContext.Provider, { value: draggingContextValue }, /* @__PURE__ */ React34.createElement(
|
|
5047
5088
|
RootContainer2,
|
|
5048
5089
|
{
|
|
5090
|
+
id,
|
|
5091
|
+
className,
|
|
5092
|
+
style: style3,
|
|
5049
5093
|
...{
|
|
5050
5094
|
[pressEventName]: handleClick
|
|
5051
5095
|
},
|
|
@@ -5071,7 +5115,7 @@ var ListViewRootInner = forwardRef12(function ListViewRootInner2({
|
|
|
5071
5115
|
));
|
|
5072
5116
|
});
|
|
5073
5117
|
var ListViewRoot = memo22(ListViewRootInner);
|
|
5074
|
-
var ChildrenListViewInner =
|
|
5118
|
+
var ChildrenListViewInner = forwardRef13(function ChildrenListViewInner2({ children, ...rest }, forwardedRef) {
|
|
5075
5119
|
const items = useMemo18(
|
|
5076
5120
|
() => Children4.toArray(children).flatMap(
|
|
5077
5121
|
(child) => isValidElement3(child) ? [child] : []
|
|
@@ -5093,7 +5137,7 @@ var ChildrenListViewInner = forwardRef12(function ChildrenListViewInner2({ child
|
|
|
5093
5137
|
);
|
|
5094
5138
|
});
|
|
5095
5139
|
var ChildrenListView = memo22(ChildrenListViewInner);
|
|
5096
|
-
var SimpleListViewInner =
|
|
5140
|
+
var SimpleListViewInner = forwardRef13(function SimpleListViewInner2(props, forwardedRef) {
|
|
5097
5141
|
if ("children" in props) {
|
|
5098
5142
|
return /* @__PURE__ */ React34.createElement(ChildrenListView, { ref: forwardedRef, ...props });
|
|
5099
5143
|
} else {
|
|
@@ -5118,7 +5162,7 @@ var ListView;
|
|
|
5118
5162
|
})(ListView || (ListView = {}));
|
|
5119
5163
|
|
|
5120
5164
|
// src/components/Text.tsx
|
|
5121
|
-
import React35, { forwardRef as
|
|
5165
|
+
import React35, { forwardRef as forwardRef14 } from "react";
|
|
5122
5166
|
import styled24 from "styled-components";
|
|
5123
5167
|
var elements = {
|
|
5124
5168
|
title: "h1",
|
|
@@ -5140,7 +5184,7 @@ var StyledElement = styled24.span(({ theme, $variant, $styleProps, $breakpoints,
|
|
|
5140
5184
|
...$styleProps,
|
|
5141
5185
|
...mergeBreakpoints($breakpoints || [])
|
|
5142
5186
|
}));
|
|
5143
|
-
var Text =
|
|
5187
|
+
var Text = forwardRef14(function Text2({
|
|
5144
5188
|
as,
|
|
5145
5189
|
variant,
|
|
5146
5190
|
breakpoints,
|
|
@@ -5148,7 +5192,9 @@ var Text = forwardRef13(function Text2({
|
|
|
5148
5192
|
className,
|
|
5149
5193
|
color,
|
|
5150
5194
|
href,
|
|
5195
|
+
tabIndex,
|
|
5151
5196
|
onClick,
|
|
5197
|
+
onKeyDown,
|
|
5152
5198
|
...rest
|
|
5153
5199
|
}, forwardedRef) {
|
|
5154
5200
|
const element = as ?? elements[variant] ?? "span";
|
|
@@ -5158,35 +5204,37 @@ var Text = forwardRef13(function Text2({
|
|
|
5158
5204
|
ref: forwardedRef,
|
|
5159
5205
|
as: element,
|
|
5160
5206
|
className,
|
|
5207
|
+
tabIndex,
|
|
5161
5208
|
$variant: variant,
|
|
5162
5209
|
$breakpoints: breakpoints,
|
|
5163
5210
|
$styleProps: rest,
|
|
5164
5211
|
$color: color,
|
|
5165
5212
|
onClick,
|
|
5213
|
+
onKeyDown,
|
|
5166
5214
|
...href && { href }
|
|
5167
5215
|
},
|
|
5168
5216
|
children
|
|
5169
5217
|
);
|
|
5170
5218
|
});
|
|
5171
|
-
var Heading1 =
|
|
5219
|
+
var Heading1 = forwardRef14(
|
|
5172
5220
|
(props, ref) => /* @__PURE__ */ React35.createElement(Text, { ref, ...props, variant: "heading1" })
|
|
5173
5221
|
);
|
|
5174
|
-
var Heading2 =
|
|
5222
|
+
var Heading2 = forwardRef14(
|
|
5175
5223
|
(props, ref) => /* @__PURE__ */ React35.createElement(Text, { ref, ...props, variant: "heading2" })
|
|
5176
5224
|
);
|
|
5177
|
-
var Heading3 =
|
|
5225
|
+
var Heading3 = forwardRef14(
|
|
5178
5226
|
(props, ref) => /* @__PURE__ */ React35.createElement(Text, { ref, ...props, variant: "heading3" })
|
|
5179
5227
|
);
|
|
5180
|
-
var Heading4 =
|
|
5228
|
+
var Heading4 = forwardRef14(
|
|
5181
5229
|
(props, ref) => /* @__PURE__ */ React35.createElement(Text, { ref, ...props, variant: "heading4" })
|
|
5182
5230
|
);
|
|
5183
|
-
var Heading5 =
|
|
5231
|
+
var Heading5 = forwardRef14(
|
|
5184
5232
|
(props, ref) => /* @__PURE__ */ React35.createElement(Text, { ref, ...props, variant: "heading5" })
|
|
5185
5233
|
);
|
|
5186
|
-
var Body =
|
|
5234
|
+
var Body = forwardRef14(
|
|
5187
5235
|
(props, ref) => /* @__PURE__ */ React35.createElement(Text, { ref, ...props, variant: "body" })
|
|
5188
5236
|
);
|
|
5189
|
-
var Small =
|
|
5237
|
+
var Small = forwardRef14(
|
|
5190
5238
|
(props, ref) => /* @__PURE__ */ React35.createElement(Text, { ref, ...props, variant: "small" })
|
|
5191
5239
|
);
|
|
5192
5240
|
var Italic = ({ children }) => /* @__PURE__ */ React35.createElement(
|
|
@@ -5232,7 +5280,7 @@ var CompletionToken = styled25.span(
|
|
|
5232
5280
|
})
|
|
5233
5281
|
);
|
|
5234
5282
|
var CompletionMenu = memo23(
|
|
5235
|
-
|
|
5283
|
+
forwardRef15(function CompletionMenu2({
|
|
5236
5284
|
items,
|
|
5237
5285
|
selectedIndex,
|
|
5238
5286
|
onSelectItem,
|
|
@@ -5278,7 +5326,7 @@ var CompletionMenu = memo23(
|
|
|
5278
5326
|
})
|
|
5279
5327
|
);
|
|
5280
5328
|
var InputFieldWithCompletions = memo23(
|
|
5281
|
-
|
|
5329
|
+
forwardRef15(function InputFieldWithCompletions2({
|
|
5282
5330
|
loading,
|
|
5283
5331
|
initialValue = "",
|
|
5284
5332
|
placeholder,
|
|
@@ -5297,8 +5345,8 @@ var InputFieldWithCompletions = memo23(
|
|
|
5297
5345
|
hideMenuWhenEmptyValue = false
|
|
5298
5346
|
}, forwardedRef) {
|
|
5299
5347
|
const ref = useRef16(null);
|
|
5300
|
-
const [isFocused, setIsFocused] =
|
|
5301
|
-
const [state, _setState] =
|
|
5348
|
+
const [isFocused, setIsFocused] = useState20(false);
|
|
5349
|
+
const [state, _setState] = useState20({
|
|
5302
5350
|
filter: initialValue,
|
|
5303
5351
|
selectedIndex: 0
|
|
5304
5352
|
});
|
|
@@ -5552,9 +5600,9 @@ function getNextIndex(items, currentIndex, direction, isDisabled) {
|
|
|
5552
5600
|
}
|
|
5553
5601
|
|
|
5554
5602
|
// src/components/InspectorContainer.tsx
|
|
5555
|
-
import React37, { forwardRef as
|
|
5603
|
+
import React37, { forwardRef as forwardRef16, memo as memo24 } from "react";
|
|
5556
5604
|
var InspectorContainer = memo24(
|
|
5557
|
-
|
|
5605
|
+
forwardRef16(function InspectorContainer2({
|
|
5558
5606
|
header,
|
|
5559
5607
|
children,
|
|
5560
5608
|
fallback,
|
|
@@ -5790,7 +5838,7 @@ var ProgressIndicator = styled28(ProgressPrimitive.Indicator)(({ theme, variant
|
|
|
5790
5838
|
import * as ToggleGroupPrimitive from "@radix-ui/react-toggle-group";
|
|
5791
5839
|
import React41, {
|
|
5792
5840
|
createContext as createContext10,
|
|
5793
|
-
forwardRef as
|
|
5841
|
+
forwardRef as forwardRef17,
|
|
5794
5842
|
memo as memo27,
|
|
5795
5843
|
useCallback as useCallback22,
|
|
5796
5844
|
useContext as useContext10,
|
|
@@ -5848,7 +5896,7 @@ var StyledItem = styled29(ToggleGroupPrimitive.Item).withConfig({
|
|
|
5848
5896
|
boxShadow: `0 0 0 1px ${theme.colors.sidebar.background}, 0 0 0 3px ${theme.colors[colorScheme ?? "primary"]}`
|
|
5849
5897
|
}
|
|
5850
5898
|
}));
|
|
5851
|
-
var ToggleGroupItem =
|
|
5899
|
+
var ToggleGroupItem = forwardRef17(function ToggleGroupItem2({ value, tooltip, children, disabled = false }, forwardedRef) {
|
|
5852
5900
|
const { colorScheme } = useContext10(RadioGroupContext);
|
|
5853
5901
|
const itemElement = /* @__PURE__ */ React41.createElement(
|
|
5854
5902
|
StyledItem,
|
|
@@ -6034,11 +6082,51 @@ var Select = memo28(function Select2({
|
|
|
6034
6082
|
)), label && /* @__PURE__ */ React42.createElement(SelectLabel, { htmlFor: id }, label));
|
|
6035
6083
|
});
|
|
6036
6084
|
|
|
6085
|
+
// src/components/SelectMenu.tsx
|
|
6086
|
+
import { DropdownChevronIcon } from "@noya-app/noya-icons";
|
|
6087
|
+
import * as Select3 from "@radix-ui/react-select";
|
|
6088
|
+
import React43, { memo as memo29 } from "react";
|
|
6089
|
+
import { styled as styled31 } from "styled-components";
|
|
6090
|
+
var SelectMenu = memo29(function SelectMenu2({
|
|
6091
|
+
id,
|
|
6092
|
+
style: style3,
|
|
6093
|
+
className,
|
|
6094
|
+
menuItems,
|
|
6095
|
+
value,
|
|
6096
|
+
onSelect,
|
|
6097
|
+
placeholder
|
|
6098
|
+
}) {
|
|
6099
|
+
const selectedItem = menuItems.find(
|
|
6100
|
+
(item) => typeof item !== "string" && item.value === value
|
|
6101
|
+
);
|
|
6102
|
+
const icon = selectedItem?.icon;
|
|
6103
|
+
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) => {
|
|
6104
|
+
if (typeof menuItem === "string") {
|
|
6105
|
+
return /* @__PURE__ */ React43.createElement(StyledSeparator, null);
|
|
6106
|
+
}
|
|
6107
|
+
const value2 = menuItem.value ?? "";
|
|
6108
|
+
return /* @__PURE__ */ React43.createElement(SelectItem, { key: value2, value: value2, icon: menuItem.icon }, menuItem.title ?? value2);
|
|
6109
|
+
})))));
|
|
6110
|
+
});
|
|
6111
|
+
var SelectContent = styled31(Select3.Content)(styles.contentStyle);
|
|
6112
|
+
var SelectViewport = styled31(Select3.Viewport)({});
|
|
6113
|
+
var SelectItem = React43.forwardRef(
|
|
6114
|
+
({
|
|
6115
|
+
children,
|
|
6116
|
+
icon,
|
|
6117
|
+
...props
|
|
6118
|
+
}, forwardedRef) => {
|
|
6119
|
+
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));
|
|
6120
|
+
}
|
|
6121
|
+
);
|
|
6122
|
+
var StyledItem2 = styled31(Select3.Item)(styles.itemStyle);
|
|
6123
|
+
var StyledSeparator = styled31(Select3.Separator)(styles.separatorStyle);
|
|
6124
|
+
|
|
6037
6125
|
// src/components/Slider.tsx
|
|
6038
6126
|
import * as RadixSlider from "@radix-ui/react-slider";
|
|
6039
|
-
import
|
|
6040
|
-
import
|
|
6041
|
-
var StyledSlider =
|
|
6127
|
+
import React44, { useCallback as useCallback24, useMemo as useMemo23 } from "react";
|
|
6128
|
+
import styled32 from "styled-components";
|
|
6129
|
+
var StyledSlider = styled32(RadixSlider.Root)({
|
|
6042
6130
|
flex: "1",
|
|
6043
6131
|
position: "relative",
|
|
6044
6132
|
display: "flex",
|
|
@@ -6047,19 +6135,19 @@ var StyledSlider = styled31(RadixSlider.Root)({
|
|
|
6047
6135
|
touchAction: "none",
|
|
6048
6136
|
height: "16px"
|
|
6049
6137
|
});
|
|
6050
|
-
var StyledTrack =
|
|
6138
|
+
var StyledTrack = styled32(RadixSlider.Track)(({ theme }) => ({
|
|
6051
6139
|
backgroundColor: theme.colors.divider,
|
|
6052
6140
|
position: "relative",
|
|
6053
6141
|
flexGrow: 1,
|
|
6054
6142
|
height: "2px"
|
|
6055
6143
|
}));
|
|
6056
|
-
var StyledRange =
|
|
6144
|
+
var StyledRange = styled32(RadixSlider.Range)(({ theme }) => ({
|
|
6057
6145
|
position: "absolute",
|
|
6058
6146
|
backgroundColor: theme.colors.primary,
|
|
6059
6147
|
borderRadius: "9999px",
|
|
6060
6148
|
height: "100%"
|
|
6061
6149
|
}));
|
|
6062
|
-
var StyledThumb2 =
|
|
6150
|
+
var StyledThumb2 = styled32(RadixSlider.Thumb)(({ theme }) => ({
|
|
6063
6151
|
display: "block",
|
|
6064
6152
|
width: "12px",
|
|
6065
6153
|
height: "12px",
|
|
@@ -6087,7 +6175,7 @@ var Slider = function Slider2({
|
|
|
6087
6175
|
},
|
|
6088
6176
|
[onValueChange]
|
|
6089
6177
|
);
|
|
6090
|
-
return /* @__PURE__ */
|
|
6178
|
+
return /* @__PURE__ */ React44.createElement(
|
|
6091
6179
|
StyledSlider,
|
|
6092
6180
|
{
|
|
6093
6181
|
min,
|
|
@@ -6096,16 +6184,16 @@ var Slider = function Slider2({
|
|
|
6096
6184
|
value: arrayValue,
|
|
6097
6185
|
onValueChange: handleValueChange
|
|
6098
6186
|
},
|
|
6099
|
-
/* @__PURE__ */
|
|
6100
|
-
/* @__PURE__ */
|
|
6187
|
+
/* @__PURE__ */ React44.createElement(StyledTrack, null, /* @__PURE__ */ React44.createElement(StyledRange, null)),
|
|
6188
|
+
/* @__PURE__ */ React44.createElement(StyledThumb2, null)
|
|
6101
6189
|
);
|
|
6102
6190
|
};
|
|
6103
6191
|
|
|
6104
6192
|
// src/components/Switch.tsx
|
|
6105
6193
|
import * as SwitchPrimitive from "@radix-ui/react-switch";
|
|
6106
|
-
import
|
|
6107
|
-
import
|
|
6108
|
-
var SwitchRoot =
|
|
6194
|
+
import React45 from "react";
|
|
6195
|
+
import styled33 from "styled-components";
|
|
6196
|
+
var SwitchRoot = styled33(SwitchPrimitive.Root)(({ theme, $colorScheme }) => ({
|
|
6109
6197
|
all: "unset",
|
|
6110
6198
|
width: 32,
|
|
6111
6199
|
height: 19,
|
|
@@ -6122,7 +6210,7 @@ var SwitchRoot = styled32(SwitchPrimitive.Root)(({ theme, $colorScheme }) => ({
|
|
|
6122
6210
|
backgroundColor: $colorScheme === "primary" ? theme.colors.primary : $colorScheme === "secondary" ? theme.colors.secondary : void 0
|
|
6123
6211
|
}
|
|
6124
6212
|
}));
|
|
6125
|
-
var SwitchThumb =
|
|
6213
|
+
var SwitchThumb = styled33(SwitchPrimitive.Thumb)({
|
|
6126
6214
|
display: "block",
|
|
6127
6215
|
width: 15,
|
|
6128
6216
|
height: 15,
|
|
@@ -6138,7 +6226,7 @@ var Switch = function Switch2({
|
|
|
6138
6226
|
onChange,
|
|
6139
6227
|
colorScheme = "normal"
|
|
6140
6228
|
}) {
|
|
6141
|
-
return /* @__PURE__ */
|
|
6229
|
+
return /* @__PURE__ */ React45.createElement(
|
|
6142
6230
|
SwitchRoot,
|
|
6143
6231
|
{
|
|
6144
6232
|
$colorScheme: colorScheme,
|
|
@@ -6147,18 +6235,18 @@ var Switch = function Switch2({
|
|
|
6147
6235
|
onChange(newValue);
|
|
6148
6236
|
}
|
|
6149
6237
|
},
|
|
6150
|
-
/* @__PURE__ */
|
|
6238
|
+
/* @__PURE__ */ React45.createElement(SwitchThumb, null)
|
|
6151
6239
|
);
|
|
6152
6240
|
};
|
|
6153
6241
|
|
|
6154
6242
|
// src/components/TreeView.tsx
|
|
6155
|
-
import
|
|
6156
|
-
forwardRef as
|
|
6157
|
-
memo as
|
|
6243
|
+
import React46, {
|
|
6244
|
+
forwardRef as forwardRef18,
|
|
6245
|
+
memo as memo30,
|
|
6158
6246
|
useCallback as useCallback25,
|
|
6159
6247
|
useContext as useContext12
|
|
6160
6248
|
} from "react";
|
|
6161
|
-
var TreeRow =
|
|
6249
|
+
var TreeRow = forwardRef18(function TreeRow2({
|
|
6162
6250
|
icon,
|
|
6163
6251
|
expanded,
|
|
6164
6252
|
onClickChevron,
|
|
@@ -6173,26 +6261,26 @@ var TreeRow = forwardRef17(function TreeRow2({
|
|
|
6173
6261
|
},
|
|
6174
6262
|
[onClickChevron]
|
|
6175
6263
|
);
|
|
6176
|
-
return /* @__PURE__ */
|
|
6264
|
+
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(
|
|
6177
6265
|
IconButton,
|
|
6178
6266
|
{
|
|
6179
|
-
iconName: expanded ? "
|
|
6267
|
+
iconName: expanded ? "ChevronDownIcon2" : "ChevronRightIcon2",
|
|
6180
6268
|
onClick: handleClickChevron,
|
|
6181
6269
|
selected: rest.selected
|
|
6182
6270
|
}
|
|
6183
|
-
), /* @__PURE__ */
|
|
6271
|
+
), /* @__PURE__ */ React46.createElement(Spacer.Horizontal, { size: 6 })), icon && /* @__PURE__ */ React46.createElement(React46.Fragment, null, icon, /* @__PURE__ */ React46.createElement(Spacer.Horizontal, { size: 10 })), children);
|
|
6184
6272
|
});
|
|
6185
6273
|
var TreeView;
|
|
6186
6274
|
((TreeView2) => {
|
|
6187
6275
|
TreeView2.Root = ListView.Root;
|
|
6188
6276
|
TreeView2.RowTitle = ListView.RowTitle;
|
|
6189
6277
|
TreeView2.EditableRowTitle = ListView.EditableRowTitle;
|
|
6190
|
-
TreeView2.Row =
|
|
6278
|
+
TreeView2.Row = memo30(TreeRow);
|
|
6191
6279
|
})(TreeView || (TreeView = {}));
|
|
6192
6280
|
|
|
6193
6281
|
// src/components/WorkspaceLayout.tsx
|
|
6194
6282
|
import { useKeyboardShortcuts as useKeyboardShortcuts3 } from "@noya-app/noya-keymap";
|
|
6195
|
-
import
|
|
6283
|
+
import React48, { forwardRef as forwardRef19, useImperativeHandle as useImperativeHandle4, useRef as useRef20 } from "react";
|
|
6196
6284
|
import {
|
|
6197
6285
|
Panel,
|
|
6198
6286
|
PanelGroup,
|
|
@@ -6203,9 +6291,9 @@ import {
|
|
|
6203
6291
|
import { useLayoutEffect as useLayoutEffect9, useRef as useRef19 } from "react";
|
|
6204
6292
|
|
|
6205
6293
|
// src/hooks/useWindowSize.tsx
|
|
6206
|
-
import { useEffect as useEffect16, useState as
|
|
6294
|
+
import { useEffect as useEffect16, useState as useState21 } from "react";
|
|
6207
6295
|
function useWindowSize() {
|
|
6208
|
-
const [size2, setSize] =
|
|
6296
|
+
const [size2, setSize] = useState21(
|
|
6209
6297
|
typeof window === "undefined" ? { width: 0, height: 0 } : {
|
|
6210
6298
|
width: window.innerWidth,
|
|
6211
6299
|
height: window.innerHeight
|
|
@@ -6333,7 +6421,7 @@ function usePreservePanelSize(panelGroupRef, setPanelLayoutState) {
|
|
|
6333
6421
|
}
|
|
6334
6422
|
|
|
6335
6423
|
// src/components/WorkspaceLayout.tsx
|
|
6336
|
-
var WorkspaceLayout =
|
|
6424
|
+
var WorkspaceLayout = forwardRef19(function WorkspaceLayout2({
|
|
6337
6425
|
autoSavePrefix,
|
|
6338
6426
|
leftSidebarContent: leftPanelContent,
|
|
6339
6427
|
children: centerPanelContent,
|
|
@@ -6420,7 +6508,7 @@ var WorkspaceLayout = forwardRef18(function WorkspaceLayout2({
|
|
|
6420
6508
|
}
|
|
6421
6509
|
});
|
|
6422
6510
|
const centerPanelPercentage = 100 - (leftPanelContent ? leftSidebarPercentage : 0) - (rightPanelContent ? rightSidebarPercentage : 0);
|
|
6423
|
-
return /* @__PURE__ */
|
|
6511
|
+
return /* @__PURE__ */ React48.createElement(
|
|
6424
6512
|
"div",
|
|
6425
6513
|
{
|
|
6426
6514
|
id,
|
|
@@ -6432,7 +6520,7 @@ var WorkspaceLayout = forwardRef18(function WorkspaceLayout2({
|
|
|
6432
6520
|
...style3
|
|
6433
6521
|
}
|
|
6434
6522
|
},
|
|
6435
|
-
/* @__PURE__ */
|
|
6523
|
+
/* @__PURE__ */ React48.createElement(
|
|
6436
6524
|
PanelGroup,
|
|
6437
6525
|
{
|
|
6438
6526
|
ref: panelGroupRef,
|
|
@@ -6441,7 +6529,7 @@ var WorkspaceLayout = forwardRef18(function WorkspaceLayout2({
|
|
|
6441
6529
|
autoSaveId: autoSavePrefix ? `${autoSavePrefix}--${EDITOR_PANEL_GROUP_ID}` : void 0,
|
|
6442
6530
|
style: { flex: "1" }
|
|
6443
6531
|
},
|
|
6444
|
-
hasLeftSidebar && /* @__PURE__ */
|
|
6532
|
+
hasLeftSidebar && /* @__PURE__ */ React48.createElement(React48.Fragment, null, /* @__PURE__ */ React48.createElement(
|
|
6445
6533
|
Panel,
|
|
6446
6534
|
{
|
|
6447
6535
|
id: LEFT_SIDEBAR_ID,
|
|
@@ -6453,11 +6541,12 @@ var WorkspaceLayout = forwardRef18(function WorkspaceLayout2({
|
|
|
6453
6541
|
collapsible: true,
|
|
6454
6542
|
style: {
|
|
6455
6543
|
display: "flex",
|
|
6456
|
-
flexDirection: "row"
|
|
6544
|
+
flexDirection: "row",
|
|
6545
|
+
position: "relative"
|
|
6457
6546
|
}
|
|
6458
6547
|
},
|
|
6459
6548
|
leftPanelContent
|
|
6460
|
-
), /* @__PURE__ */
|
|
6549
|
+
), /* @__PURE__ */ React48.createElement(
|
|
6461
6550
|
PanelResizeHandle,
|
|
6462
6551
|
{
|
|
6463
6552
|
style: {
|
|
@@ -6468,7 +6557,7 @@ var WorkspaceLayout = forwardRef18(function WorkspaceLayout2({
|
|
|
6468
6557
|
}
|
|
6469
6558
|
}
|
|
6470
6559
|
)),
|
|
6471
|
-
/* @__PURE__ */
|
|
6560
|
+
/* @__PURE__ */ React48.createElement(
|
|
6472
6561
|
Panel,
|
|
6473
6562
|
{
|
|
6474
6563
|
id: CONTENT_AREA_ID,
|
|
@@ -6477,12 +6566,13 @@ var WorkspaceLayout = forwardRef18(function WorkspaceLayout2({
|
|
|
6477
6566
|
minSize: 10,
|
|
6478
6567
|
style: {
|
|
6479
6568
|
display: "flex",
|
|
6480
|
-
flexDirection: "row"
|
|
6569
|
+
flexDirection: "row",
|
|
6570
|
+
position: "relative"
|
|
6481
6571
|
}
|
|
6482
6572
|
},
|
|
6483
6573
|
centerPanelContent
|
|
6484
6574
|
),
|
|
6485
|
-
hasRightSidebar && /* @__PURE__ */
|
|
6575
|
+
hasRightSidebar && /* @__PURE__ */ React48.createElement(React48.Fragment, null, /* @__PURE__ */ React48.createElement(
|
|
6486
6576
|
PanelResizeHandle,
|
|
6487
6577
|
{
|
|
6488
6578
|
style: {
|
|
@@ -6492,7 +6582,7 @@ var WorkspaceLayout = forwardRef18(function WorkspaceLayout2({
|
|
|
6492
6582
|
backgroundColor: theme.colors.divider
|
|
6493
6583
|
}
|
|
6494
6584
|
}
|
|
6495
|
-
), /* @__PURE__ */
|
|
6585
|
+
), /* @__PURE__ */ React48.createElement(
|
|
6496
6586
|
Panel,
|
|
6497
6587
|
{
|
|
6498
6588
|
id: RIGHT_SIDEBAR_ID,
|
|
@@ -6503,7 +6593,8 @@ var WorkspaceLayout = forwardRef18(function WorkspaceLayout2({
|
|
|
6503
6593
|
collapsible: true,
|
|
6504
6594
|
style: {
|
|
6505
6595
|
display: "flex",
|
|
6506
|
-
flexDirection: "row"
|
|
6596
|
+
flexDirection: "row",
|
|
6597
|
+
position: "relative"
|
|
6507
6598
|
}
|
|
6508
6599
|
},
|
|
6509
6600
|
rightPanelContent
|
|
@@ -6554,8 +6645,8 @@ var SUPPORTED_CANVAS_UPLOAD_TYPES = [
|
|
|
6554
6645
|
|
|
6555
6646
|
// src/components/ArrayController.tsx
|
|
6556
6647
|
import { range as range2 } from "@noya-app/noya-utils";
|
|
6557
|
-
import
|
|
6558
|
-
import
|
|
6648
|
+
import React50, { memo as memo32, useCallback as useCallback26, useMemo as useMemo24 } from "react";
|
|
6649
|
+
import styled35, { useTheme as useTheme5 } from "styled-components";
|
|
6559
6650
|
|
|
6560
6651
|
// src/components/InspectorPrimitives.tsx
|
|
6561
6652
|
var InspectorPrimitives_exports = {};
|
|
@@ -6573,20 +6664,20 @@ __export(InspectorPrimitives_exports, {
|
|
|
6573
6664
|
Title: () => Title3,
|
|
6574
6665
|
VerticalSeparator: () => VerticalSeparator
|
|
6575
6666
|
});
|
|
6576
|
-
import
|
|
6577
|
-
import
|
|
6578
|
-
var Section =
|
|
6667
|
+
import React49, { memo as memo31 } from "react";
|
|
6668
|
+
import styled34, { useTheme as useTheme4 } from "styled-components";
|
|
6669
|
+
var Section = styled34.div(({ theme, $padding = "10px", $gap }) => ({
|
|
6579
6670
|
flex: "0 0 auto",
|
|
6580
6671
|
display: "flex",
|
|
6581
6672
|
flexDirection: "column",
|
|
6582
6673
|
padding: $padding,
|
|
6583
6674
|
gap: $gap
|
|
6584
6675
|
}));
|
|
6585
|
-
var SectionHeader =
|
|
6676
|
+
var SectionHeader = styled34.div(({ theme }) => ({
|
|
6586
6677
|
display: "flex",
|
|
6587
6678
|
alignItems: "center"
|
|
6588
6679
|
}));
|
|
6589
|
-
var Title3 =
|
|
6680
|
+
var Title3 = styled34.div(({ theme, $textStyle }) => ({
|
|
6590
6681
|
display: "flex",
|
|
6591
6682
|
flexDirection: "row",
|
|
6592
6683
|
userSelect: "none",
|
|
@@ -6599,7 +6690,7 @@ var Title3 = styled33.div(({ theme, $textStyle }) => ({
|
|
|
6599
6690
|
fontWeight: "bold"
|
|
6600
6691
|
}
|
|
6601
6692
|
}));
|
|
6602
|
-
var Row2 =
|
|
6693
|
+
var Row2 = styled34.div(
|
|
6603
6694
|
({ theme, $gap }) => ({
|
|
6604
6695
|
flex: "1",
|
|
6605
6696
|
display: "flex",
|
|
@@ -6608,26 +6699,26 @@ var Row2 = styled33.div(
|
|
|
6608
6699
|
gap: $gap
|
|
6609
6700
|
})
|
|
6610
6701
|
);
|
|
6611
|
-
var Column =
|
|
6702
|
+
var Column = styled34.div(({ theme }) => ({
|
|
6612
6703
|
flex: "1",
|
|
6613
6704
|
display: "flex",
|
|
6614
6705
|
flexDirection: "column",
|
|
6615
6706
|
gap: "4px"
|
|
6616
6707
|
}));
|
|
6617
|
-
var Checkbox =
|
|
6708
|
+
var Checkbox = styled34.input(({ theme }) => ({
|
|
6618
6709
|
margin: 0
|
|
6619
6710
|
}));
|
|
6620
|
-
var Text3 =
|
|
6711
|
+
var Text3 = styled34.span(({ theme }) => ({
|
|
6621
6712
|
...theme.textStyles.small
|
|
6622
6713
|
}));
|
|
6623
|
-
var VerticalSeparator = () => /* @__PURE__ */
|
|
6624
|
-
var HorizontalSeparator = () => /* @__PURE__ */
|
|
6625
|
-
var SliderRowLabel =
|
|
6714
|
+
var VerticalSeparator = () => /* @__PURE__ */ React49.createElement(Spacer.Vertical, { size: useTheme4().sizes.inspector.verticalSeparator });
|
|
6715
|
+
var HorizontalSeparator = () => /* @__PURE__ */ React49.createElement(Spacer.Horizontal, { size: useTheme4().sizes.inspector.horizontalSeparator });
|
|
6716
|
+
var SliderRowLabel = styled34.span(({ theme }) => ({
|
|
6626
6717
|
...theme.textStyles.small,
|
|
6627
6718
|
color: theme.colors.textMuted,
|
|
6628
6719
|
marginBottom: "-6px"
|
|
6629
6720
|
}));
|
|
6630
|
-
var RowLabel =
|
|
6721
|
+
var RowLabel = styled34.span(({ theme, $textStyle }) => ({
|
|
6631
6722
|
// marginBottom: '6px',
|
|
6632
6723
|
display: "flex",
|
|
6633
6724
|
...$textStyle ? {
|
|
@@ -6641,7 +6732,7 @@ var RowLabel = styled33.span(({ theme, $textStyle }) => ({
|
|
|
6641
6732
|
// Button height
|
|
6642
6733
|
alignItems: "center"
|
|
6643
6734
|
}));
|
|
6644
|
-
var LabeledRow =
|
|
6735
|
+
var LabeledRow = memo31(function LabeledRow2({
|
|
6645
6736
|
id,
|
|
6646
6737
|
children,
|
|
6647
6738
|
label,
|
|
@@ -6649,26 +6740,26 @@ var LabeledRow = memo30(function LabeledRow2({
|
|
|
6649
6740
|
gap,
|
|
6650
6741
|
right
|
|
6651
6742
|
}) {
|
|
6652
|
-
return /* @__PURE__ */
|
|
6743
|
+
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)));
|
|
6653
6744
|
});
|
|
6654
|
-
var LabeledSliderRow =
|
|
6745
|
+
var LabeledSliderRow = memo31(function LabeledRow3({
|
|
6655
6746
|
children,
|
|
6656
6747
|
label
|
|
6657
6748
|
}) {
|
|
6658
|
-
return /* @__PURE__ */
|
|
6749
|
+
return /* @__PURE__ */ React49.createElement(Row2, null, /* @__PURE__ */ React49.createElement(Column, null, /* @__PURE__ */ React49.createElement(SliderRowLabel, null, label), /* @__PURE__ */ React49.createElement(Row2, null, children)));
|
|
6659
6750
|
});
|
|
6660
6751
|
|
|
6661
6752
|
// src/components/ArrayController.tsx
|
|
6662
|
-
var ElementRow =
|
|
6753
|
+
var ElementRow = styled35.div({
|
|
6663
6754
|
flex: "0 0 auto",
|
|
6664
6755
|
display: "flex",
|
|
6665
6756
|
flexDirection: "row",
|
|
6666
6757
|
alignItems: "center"
|
|
6667
6758
|
});
|
|
6668
|
-
var ItemContainer2 =
|
|
6759
|
+
var ItemContainer2 = styled35.div({
|
|
6669
6760
|
position: "relative"
|
|
6670
6761
|
});
|
|
6671
|
-
var ArrayController =
|
|
6762
|
+
var ArrayController = memo32(function ArrayController2({
|
|
6672
6763
|
id,
|
|
6673
6764
|
items,
|
|
6674
6765
|
title,
|
|
@@ -6708,11 +6799,11 @@ var ArrayController = memo31(function ArrayController2({
|
|
|
6708
6799
|
[onMoveItem, reversed]
|
|
6709
6800
|
);
|
|
6710
6801
|
const renderRow = (index) => {
|
|
6711
|
-
return /* @__PURE__ */
|
|
6802
|
+
return /* @__PURE__ */ React50.createElement(ElementRow, { key: keys[index] }, renderItem({ item: items[index], index }));
|
|
6712
6803
|
};
|
|
6713
|
-
return /* @__PURE__ */
|
|
6804
|
+
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(
|
|
6714
6805
|
[
|
|
6715
|
-
onClickTrash && /* @__PURE__ */
|
|
6806
|
+
onClickTrash && /* @__PURE__ */ React50.createElement(
|
|
6716
6807
|
IconButton,
|
|
6717
6808
|
{
|
|
6718
6809
|
id: `${id}-trash`,
|
|
@@ -6721,7 +6812,7 @@ var ArrayController = memo31(function ArrayController2({
|
|
|
6721
6812
|
onClick: onClickTrash
|
|
6722
6813
|
}
|
|
6723
6814
|
),
|
|
6724
|
-
onClickExpand && /* @__PURE__ */
|
|
6815
|
+
onClickExpand && /* @__PURE__ */ React50.createElement(
|
|
6725
6816
|
IconButton,
|
|
6726
6817
|
{
|
|
6727
6818
|
id: `${id}-gear`,
|
|
@@ -6730,7 +6821,7 @@ var ArrayController = memo31(function ArrayController2({
|
|
|
6730
6821
|
onClick: onClickExpand
|
|
6731
6822
|
}
|
|
6732
6823
|
),
|
|
6733
|
-
onClickPlus && /* @__PURE__ */
|
|
6824
|
+
onClickPlus && /* @__PURE__ */ React50.createElement(
|
|
6734
6825
|
IconButton,
|
|
6735
6826
|
{
|
|
6736
6827
|
id: `${id}-add`,
|
|
@@ -6740,15 +6831,15 @@ var ArrayController = memo31(function ArrayController2({
|
|
|
6740
6831
|
}
|
|
6741
6832
|
)
|
|
6742
6833
|
],
|
|
6743
|
-
/* @__PURE__ */
|
|
6744
|
-
)), /* @__PURE__ */
|
|
6834
|
+
/* @__PURE__ */ React50.createElement(Spacer.Horizontal, { size: 8 })
|
|
6835
|
+
)), /* @__PURE__ */ React50.createElement(Stack.V, { gap: "4px" }, sortable ? /* @__PURE__ */ React50.createElement(
|
|
6745
6836
|
Sortable.Root,
|
|
6746
6837
|
{
|
|
6747
6838
|
keys,
|
|
6748
6839
|
renderOverlay: renderRow,
|
|
6749
6840
|
onMoveItem: handleMoveItem
|
|
6750
6841
|
},
|
|
6751
|
-
indexes.map((index) => /* @__PURE__ */
|
|
6842
|
+
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(
|
|
6752
6843
|
ListView.DragIndicator,
|
|
6753
6844
|
{
|
|
6754
6845
|
$gap: 0,
|
|
@@ -6762,11 +6853,11 @@ var ArrayController = memo31(function ArrayController2({
|
|
|
6762
6853
|
|
|
6763
6854
|
// src/components/DimensionInput.tsx
|
|
6764
6855
|
import { round } from "@noya-app/noya-utils";
|
|
6765
|
-
import
|
|
6856
|
+
import React51, { memo as memo33, useCallback as useCallback27 } from "react";
|
|
6766
6857
|
function getNewValue(value, mode, delta) {
|
|
6767
6858
|
return delta === void 0 ? value : mode === "replace" ? delta : value + delta;
|
|
6768
6859
|
}
|
|
6769
|
-
var DimensionInput =
|
|
6860
|
+
var DimensionInput = memo33(function DimensionInput2({
|
|
6770
6861
|
id,
|
|
6771
6862
|
value,
|
|
6772
6863
|
onSetValue,
|
|
@@ -6784,7 +6875,7 @@ var DimensionInput = memo32(function DimensionInput2({
|
|
|
6784
6875
|
(value2) => onSetValue(value2, "replace"),
|
|
6785
6876
|
[onSetValue]
|
|
6786
6877
|
);
|
|
6787
|
-
return /* @__PURE__ */
|
|
6878
|
+
return /* @__PURE__ */ React51.createElement(InputField.Root, { id, width: size2 }, /* @__PURE__ */ React51.createElement(
|
|
6788
6879
|
InputField.NumberInput,
|
|
6789
6880
|
{
|
|
6790
6881
|
value: value === void 0 ? value : round(value, 2),
|
|
@@ -6793,7 +6884,7 @@ var DimensionInput = memo32(function DimensionInput2({
|
|
|
6793
6884
|
disabled,
|
|
6794
6885
|
...trigger === "change" ? { onChange: handleSetValue } : { onSubmit: handleSetValue }
|
|
6795
6886
|
}
|
|
6796
|
-
), label && /* @__PURE__ */
|
|
6887
|
+
), label && /* @__PURE__ */ React51.createElement(InputField.Label, null, label));
|
|
6797
6888
|
});
|
|
6798
6889
|
export {
|
|
6799
6890
|
ActivityIndicator,
|
|
@@ -6852,6 +6943,7 @@ export {
|
|
|
6852
6943
|
SUPPORTED_IMAGE_UPLOAD_TYPES,
|
|
6853
6944
|
ScrollArea,
|
|
6854
6945
|
Select,
|
|
6946
|
+
SelectMenu,
|
|
6855
6947
|
SelectOption,
|
|
6856
6948
|
Slider,
|
|
6857
6949
|
Small,
|