@noya-app/noya-designsystem 0.1.24 → 0.1.26
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 +14 -0
- package/dist/index.d.mts +23 -3
- package/dist/index.d.ts +23 -3
- package/dist/index.js +347 -162
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +373 -193
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/components/Button.tsx +7 -0
- package/src/components/Chip.tsx +16 -11
- package/src/components/InputField.tsx +48 -8
- package/src/components/InputFieldWithCompletions.tsx +5 -3
- package/src/components/InspectorPrimitives.tsx +1 -1
- package/src/components/ListView.tsx +36 -8
- package/src/components/SelectMenu.tsx +40 -5
- package/src/components/Switch.tsx +3 -0
- package/src/components/Text.tsx +3 -0
- package/src/components/TextArea.tsx +82 -0
- package/src/index.tsx +1 -0
- package/src/theme/light.ts +26 -22
package/dist/index.js
CHANGED
|
@@ -32,6 +32,7 @@ var src_exports = {};
|
|
|
32
32
|
__export(src_exports, {
|
|
33
33
|
ActivityIndicator: () => ActivityIndicator,
|
|
34
34
|
ArrayController: () => ArrayController,
|
|
35
|
+
AutoResizingTextArea: () => AutoResizingTextArea,
|
|
35
36
|
Avatar: () => Avatar,
|
|
36
37
|
AvatarStack: () => AvatarStack,
|
|
37
38
|
Body: () => Body,
|
|
@@ -115,6 +116,7 @@ __export(src_exports, {
|
|
|
115
116
|
sketchColorToHex: () => sketchColorToHex,
|
|
116
117
|
sketchColorToRgba: () => sketchColorToRgba,
|
|
117
118
|
sketchColorToRgbaString: () => sketchColorToRgbaString,
|
|
119
|
+
useAutoResize: () => useAutoResize,
|
|
118
120
|
useCurrentFloatingWindowInternal: () => useCurrentFloatingWindowInternal,
|
|
119
121
|
useDesignSystemConfiguration: () => useDesignSystemConfiguration,
|
|
120
122
|
useDesignSystemTheme: () => useDesignSystemTheme,
|
|
@@ -452,7 +454,13 @@ var ButtonElement = import_styled_components5.default.button(
|
|
|
452
454
|
color: theme.colors.text,
|
|
453
455
|
boxShadow: "0 1px 2px rgba(0, 0, 0, 0.1)",
|
|
454
456
|
fontSize: "12px",
|
|
455
|
-
padding: "0px 4px"
|
|
457
|
+
padding: "0px 4px",
|
|
458
|
+
"&:hover": {
|
|
459
|
+
opacity: 0.8
|
|
460
|
+
},
|
|
461
|
+
"&:active": {
|
|
462
|
+
opacity: 0.9
|
|
463
|
+
}
|
|
456
464
|
},
|
|
457
465
|
display: "flex",
|
|
458
466
|
alignItems: "center",
|
|
@@ -476,7 +484,7 @@ var ButtonContent = import_styled_components5.default.span(({ theme }) => ({
|
|
|
476
484
|
var Button = (0, import_react6.forwardRef)(function Button2({
|
|
477
485
|
id,
|
|
478
486
|
className,
|
|
479
|
-
style:
|
|
487
|
+
style: style2,
|
|
480
488
|
flex,
|
|
481
489
|
tabIndex,
|
|
482
490
|
tooltip,
|
|
@@ -497,7 +505,7 @@ var Button = (0, import_react6.forwardRef)(function Button2({
|
|
|
497
505
|
ref: forwardedRef,
|
|
498
506
|
id,
|
|
499
507
|
className,
|
|
500
|
-
style:
|
|
508
|
+
style: style2,
|
|
501
509
|
$flex: flex,
|
|
502
510
|
tabIndex,
|
|
503
511
|
$active: active,
|
|
@@ -551,14 +559,14 @@ var IconButton = (0, import_react8.memo)(
|
|
|
551
559
|
(0, import_react8.forwardRef)(function IconButton2({ selected, iconName, color, size: size2, contentStyle, ...props }, forwardedRef) {
|
|
552
560
|
const { icon: iconColor, iconSelected: iconSelectedColor } = (0, import_styled_components6.useTheme)().colors;
|
|
553
561
|
const Icon = Icons[iconName];
|
|
554
|
-
const
|
|
562
|
+
const style2 = (0, import_react8.useMemo)(() => {
|
|
555
563
|
return {
|
|
556
564
|
padding: "0 2px",
|
|
557
565
|
...size2 && { minHeight: size2 },
|
|
558
566
|
...contentStyle
|
|
559
567
|
};
|
|
560
568
|
}, [contentStyle, size2]);
|
|
561
|
-
return /* @__PURE__ */ import_react8.default.createElement(Button, { ref: forwardedRef, ...props, variant: "none", contentStyle:
|
|
569
|
+
return /* @__PURE__ */ import_react8.default.createElement(Button, { ref: forwardedRef, ...props, variant: "none", contentStyle: style2 }, /* @__PURE__ */ import_react8.default.createElement(
|
|
562
570
|
Icon,
|
|
563
571
|
{
|
|
564
572
|
color: color ?? (selected ? iconSelectedColor : iconColor),
|
|
@@ -661,26 +669,29 @@ var mediaQuery = {
|
|
|
661
669
|
var name = "light";
|
|
662
670
|
var colors = {
|
|
663
671
|
logo: {
|
|
664
|
-
fill: "rgb(
|
|
665
|
-
highlight: "rgb(
|
|
672
|
+
fill: "rgb(150, 152, 172)",
|
|
673
|
+
highlight: "rgb(150, 152, 172)"
|
|
666
674
|
},
|
|
675
|
+
background: "rgb(255,255,255)",
|
|
667
676
|
text: "rgb(38, 48, 83)",
|
|
668
|
-
textMuted: "rgb(
|
|
669
|
-
textSubtle: "rgb(
|
|
670
|
-
textDisabled: "rgb(
|
|
677
|
+
textMuted: "rgb(107, 113, 136)",
|
|
678
|
+
textSubtle: "rgb(117, 121, 129)",
|
|
679
|
+
textDisabled: "rgb(150, 152, 172)",
|
|
671
680
|
textDecorativeLight: "rgb(168, 185, 212)",
|
|
672
|
-
dividerSubtle: "rgba(
|
|
673
|
-
divider: "rgba(
|
|
674
|
-
dividerStrong: "rgba(
|
|
675
|
-
primary: "rgb(
|
|
681
|
+
dividerSubtle: "rgba(30, 50, 100, 0.04)",
|
|
682
|
+
divider: "rgba(30, 50, 100, 0.07)",
|
|
683
|
+
dividerStrong: "rgba(30, 50, 100, 0.09)",
|
|
684
|
+
primary: "rgb(103, 70, 255)",
|
|
676
685
|
primaryLight: "rgb(147, 86, 255)",
|
|
686
|
+
primaryPastel: "rgba(234, 230, 255)",
|
|
677
687
|
secondary: "rgb(0, 151, 117)",
|
|
678
688
|
secondaryLight: "rgb(0, 160, 129)",
|
|
689
|
+
secondaryPastel: "rgb(205, 238, 231)",
|
|
679
690
|
secondaryBright: "#0ab557",
|
|
680
691
|
warning: "rgb(251, 211, 0)",
|
|
681
692
|
neutralBackground: "rgb(222,223,232)",
|
|
682
|
-
inputBackground: "rgb(240,
|
|
683
|
-
inputBackgroundLight: "rgb(243,
|
|
693
|
+
inputBackground: "rgb(240, 242, 246)",
|
|
694
|
+
inputBackgroundLight: "rgb(243, 245, 249)",
|
|
684
695
|
codeBackground: "rgb(250, 250, 250)",
|
|
685
696
|
codeBackgroundLight: "rgb(250, 250, 250)",
|
|
686
697
|
get codeBackgroundDark() {
|
|
@@ -708,6 +719,7 @@ var colors = {
|
|
|
708
719
|
editingBackground: "#fff"
|
|
709
720
|
},
|
|
710
721
|
canvas: {
|
|
722
|
+
// background: "white",
|
|
711
723
|
background: "rgb(249,249,249)",
|
|
712
724
|
get selectionStroke() {
|
|
713
725
|
return colors.primary;
|
|
@@ -718,8 +730,8 @@ var colors = {
|
|
|
718
730
|
grid: "rgba(0,0,0,0.05)"
|
|
719
731
|
},
|
|
720
732
|
sidebar: {
|
|
721
|
-
background: "rgb(
|
|
722
|
-
backgroundTransparent: "rgba(
|
|
733
|
+
background: "rgb(255,255,255)",
|
|
734
|
+
backgroundTransparent: "rgba(255,255,255,0.85)"
|
|
723
735
|
},
|
|
724
736
|
popover: {
|
|
725
737
|
background: "rgb(252,252,252)",
|
|
@@ -732,7 +744,7 @@ var colors = {
|
|
|
732
744
|
radioGroup: {
|
|
733
745
|
background: "white"
|
|
734
746
|
},
|
|
735
|
-
icon: "rgb(
|
|
747
|
+
icon: "rgb(129, 131, 165)",
|
|
736
748
|
iconSelected: "rgb(220, 220, 220)",
|
|
737
749
|
mask: "rgb(12,193,67)",
|
|
738
750
|
imageOverlay: "linear-gradient(0deg, rgba(132, 63, 255,0.55), rgba(132, 63, 255,0.55))",
|
|
@@ -772,41 +784,41 @@ var textStyles = {
|
|
|
772
784
|
heading1: {
|
|
773
785
|
fontFamily: fonts.normal,
|
|
774
786
|
fontSize: `${typeScale[2]}rem`,
|
|
775
|
-
fontWeight:
|
|
776
|
-
lineHeight: "1.
|
|
787
|
+
fontWeight: 600,
|
|
788
|
+
lineHeight: "1.6",
|
|
777
789
|
letterSpacing: "-0.025em"
|
|
778
790
|
},
|
|
779
791
|
heading2: {
|
|
780
792
|
fontFamily: fonts.normal,
|
|
781
793
|
fontSize: `${typeScale[3]}rem`,
|
|
782
794
|
fontWeight: 500,
|
|
783
|
-
lineHeight: "1.
|
|
795
|
+
lineHeight: "1.5",
|
|
784
796
|
letterSpacing: "-0.025em"
|
|
785
797
|
},
|
|
786
798
|
heading3: {
|
|
787
799
|
fontFamily: fonts.normal,
|
|
788
800
|
fontSize: `${typeScale[4]}rem`,
|
|
789
|
-
fontWeight:
|
|
790
|
-
lineHeight: "1.
|
|
801
|
+
fontWeight: 400,
|
|
802
|
+
lineHeight: "1.4",
|
|
791
803
|
letterSpacing: "-0.025em"
|
|
792
804
|
},
|
|
793
805
|
heading4: {
|
|
794
806
|
fontFamily: fonts.normal,
|
|
795
807
|
fontSize: `${typeScale[5]}rem`,
|
|
796
808
|
fontWeight: 500,
|
|
797
|
-
lineHeight: "1.
|
|
809
|
+
lineHeight: "1.4"
|
|
798
810
|
},
|
|
799
811
|
heading5: {
|
|
800
812
|
fontFamily: fonts.normal,
|
|
801
813
|
fontSize: `${typeScale[6]}rem`,
|
|
802
814
|
fontWeight: 500,
|
|
803
|
-
lineHeight: "1.
|
|
815
|
+
lineHeight: "1.4"
|
|
804
816
|
},
|
|
805
817
|
body: {
|
|
806
818
|
fontFamily: fonts.normal,
|
|
807
819
|
fontSize: `${typeScale[5]}rem`,
|
|
808
820
|
fontWeight: 400,
|
|
809
|
-
lineHeight: "1.
|
|
821
|
+
lineHeight: "1.4"
|
|
810
822
|
},
|
|
811
823
|
small: {
|
|
812
824
|
fontFamily: fonts.normal,
|
|
@@ -989,7 +1001,7 @@ var Dialog = (0, import_react11.forwardRef)(function Dialog2({
|
|
|
989
1001
|
title,
|
|
990
1002
|
description,
|
|
991
1003
|
open,
|
|
992
|
-
style:
|
|
1004
|
+
style: style2,
|
|
993
1005
|
onOpenChange,
|
|
994
1006
|
onOpenAutoFocus,
|
|
995
1007
|
closeOnInteractOutside = true
|
|
@@ -1007,7 +1019,7 @@ var Dialog = (0, import_react11.forwardRef)(function Dialog2({
|
|
|
1007
1019
|
{
|
|
1008
1020
|
ref: contentRef,
|
|
1009
1021
|
onOpenAutoFocus,
|
|
1010
|
-
style:
|
|
1022
|
+
style: style2,
|
|
1011
1023
|
...closeOnInteractOutside === false && {
|
|
1012
1024
|
onPointerDownOutside: (event) => {
|
|
1013
1025
|
event.preventDefault();
|
|
@@ -1023,7 +1035,7 @@ var Dialog = (0, import_react11.forwardRef)(function Dialog2({
|
|
|
1023
1035
|
children
|
|
1024
1036
|
));
|
|
1025
1037
|
});
|
|
1026
|
-
var FullscreenDialog = (0, import_react11.forwardRef)(function FullscreenDialog2({ style:
|
|
1038
|
+
var FullscreenDialog = (0, import_react11.forwardRef)(function FullscreenDialog2({ style: style2, ...rest }, forwardedRef) {
|
|
1027
1039
|
return /* @__PURE__ */ import_react11.default.createElement(
|
|
1028
1040
|
Dialog,
|
|
1029
1041
|
{
|
|
@@ -1039,7 +1051,7 @@ var FullscreenDialog = (0, import_react11.forwardRef)(function FullscreenDialog2
|
|
|
1039
1051
|
display: "flex",
|
|
1040
1052
|
flexDirection: "column",
|
|
1041
1053
|
padding: 0,
|
|
1042
|
-
...
|
|
1054
|
+
...style2
|
|
1043
1055
|
},
|
|
1044
1056
|
...rest
|
|
1045
1057
|
}
|
|
@@ -1126,26 +1138,43 @@ var import_react14 = __toESM(require("react"));
|
|
|
1126
1138
|
|
|
1127
1139
|
// ../noya-react-utils/src/hooks/useFileDropTarget.ts
|
|
1128
1140
|
var import_react13 = require("react");
|
|
1129
|
-
function useFileDropTarget(dropEvent) {
|
|
1141
|
+
function useFileDropTarget(ref, dropEvent) {
|
|
1130
1142
|
const [isDropTargetActive, setIsDropTargetActive] = (0, import_react13.useState)(false);
|
|
1131
|
-
const
|
|
1132
|
-
if (on !== void 0)
|
|
1133
|
-
setIsDropTargetActive(on);
|
|
1143
|
+
const handleDragOver = (0, import_react13.useCallback)((event) => {
|
|
1134
1144
|
event.preventDefault();
|
|
1135
1145
|
}, []);
|
|
1136
|
-
const
|
|
1146
|
+
const handleDragEnter = (0, import_react13.useCallback)(
|
|
1137
1147
|
(event) => {
|
|
1148
|
+
event.preventDefault();
|
|
1149
|
+
if (!ref.current?.contains(event.relatedTarget)) {
|
|
1150
|
+
setIsDropTargetActive(true);
|
|
1151
|
+
}
|
|
1152
|
+
},
|
|
1153
|
+
[ref]
|
|
1154
|
+
);
|
|
1155
|
+
const handleDragLeave = (0, import_react13.useCallback)(
|
|
1156
|
+
(event) => {
|
|
1157
|
+
event.preventDefault();
|
|
1158
|
+
if (!ref.current?.contains(event.relatedTarget)) {
|
|
1159
|
+
setIsDropTargetActive(false);
|
|
1160
|
+
}
|
|
1161
|
+
},
|
|
1162
|
+
[ref]
|
|
1163
|
+
);
|
|
1164
|
+
const handleDrop = (0, import_react13.useCallback)(
|
|
1165
|
+
(event) => {
|
|
1166
|
+
event.preventDefault();
|
|
1138
1167
|
dropEvent(event);
|
|
1139
1168
|
setIsDropTargetActive(false);
|
|
1140
1169
|
},
|
|
1141
|
-
[dropEvent
|
|
1170
|
+
[dropEvent]
|
|
1142
1171
|
);
|
|
1143
1172
|
return {
|
|
1144
1173
|
dropTargetProps: {
|
|
1145
|
-
onDragOver:
|
|
1146
|
-
onDragEnter:
|
|
1147
|
-
onDragLeave:
|
|
1148
|
-
onDrop:
|
|
1174
|
+
onDragOver: handleDragOver,
|
|
1175
|
+
onDragEnter: handleDragEnter,
|
|
1176
|
+
onDragLeave: handleDragLeave,
|
|
1177
|
+
onDrop: handleDrop
|
|
1149
1178
|
},
|
|
1150
1179
|
isDropTargetActive
|
|
1151
1180
|
};
|
|
@@ -1155,12 +1184,13 @@ function useFileDropTarget(dropEvent) {
|
|
|
1155
1184
|
function isSupportedFile(file, supportedFileTypes) {
|
|
1156
1185
|
return supportedFileTypes.includes(file.type) || file.type === "" && file.name.endsWith(".sketch");
|
|
1157
1186
|
}
|
|
1158
|
-
var style2 = { display: "flex", flex: 1 };
|
|
1159
1187
|
var FileDropTarget = (0, import_react14.memo)(function FileDropTarget2({
|
|
1160
1188
|
children,
|
|
1161
1189
|
onDropFiles,
|
|
1162
|
-
supportedFileTypes
|
|
1190
|
+
supportedFileTypes,
|
|
1191
|
+
...props
|
|
1163
1192
|
}) {
|
|
1193
|
+
const ref = (0, import_react14.useRef)(null);
|
|
1164
1194
|
const handleFile = (0, import_react14.useCallback)(
|
|
1165
1195
|
(event) => {
|
|
1166
1196
|
event.preventDefault();
|
|
@@ -1193,8 +1223,11 @@ var FileDropTarget = (0, import_react14.memo)(function FileDropTarget2({
|
|
|
1193
1223
|
},
|
|
1194
1224
|
[onDropFiles, supportedFileTypes]
|
|
1195
1225
|
);
|
|
1196
|
-
const { dropTargetProps, isDropTargetActive } = useFileDropTarget(
|
|
1197
|
-
|
|
1226
|
+
const { dropTargetProps, isDropTargetActive } = useFileDropTarget(
|
|
1227
|
+
ref,
|
|
1228
|
+
handleFile
|
|
1229
|
+
);
|
|
1230
|
+
return /* @__PURE__ */ import_react14.default.createElement("div", { ref, ...dropTargetProps, ...props }, typeof children === "function" ? children(isDropTargetActive) : children);
|
|
1198
1231
|
});
|
|
1199
1232
|
|
|
1200
1233
|
// ../noya-react-utils/src/hooks/useDeepArray.ts
|
|
@@ -1919,7 +1952,7 @@ var LabelContainer = import_styled_components13.default.label(({ theme, $labelPo
|
|
|
1919
1952
|
}
|
|
1920
1953
|
}));
|
|
1921
1954
|
var InputFieldLabel = (0, import_react33.memo)(
|
|
1922
|
-
(0, import_react33.forwardRef)(function InputFieldLabel2({ children = false, pointerEvents = "none", style:
|
|
1955
|
+
(0, import_react33.forwardRef)(function InputFieldLabel2({ children = false, pointerEvents = "none", style: style2 }, forwardedRef) {
|
|
1923
1956
|
const { labelPosition, hasDropdown, setLabelWidth } = (0, import_react33.useContext)(InputFieldContext);
|
|
1924
1957
|
const ref = (0, import_react33.useRef)(null);
|
|
1925
1958
|
(0, import_react33.useLayoutEffect)(() => {
|
|
@@ -1940,7 +1973,7 @@ var InputFieldLabel = (0, import_react33.memo)(
|
|
|
1940
1973
|
pointerEvents,
|
|
1941
1974
|
$labelPosition: labelPosition,
|
|
1942
1975
|
$hasDropdown: hasDropdown,
|
|
1943
|
-
style:
|
|
1976
|
+
style: style2
|
|
1944
1977
|
},
|
|
1945
1978
|
children
|
|
1946
1979
|
);
|
|
@@ -2108,34 +2141,34 @@ var InputFieldTypeahead = (props) => {
|
|
|
2108
2141
|
labelSize,
|
|
2109
2142
|
hasDropdown,
|
|
2110
2143
|
hasLabel,
|
|
2111
|
-
size: size2
|
|
2112
|
-
onFocusChange
|
|
2144
|
+
size: size2
|
|
2145
|
+
// onFocusChange,
|
|
2113
2146
|
} = (0, import_react33.useContext)(InputFieldContext);
|
|
2114
2147
|
return /* @__PURE__ */ import_react33.default.createElement(
|
|
2115
2148
|
InputElement,
|
|
2116
2149
|
{
|
|
2150
|
+
as: "span",
|
|
2117
2151
|
$labelPosition: labelPosition,
|
|
2118
2152
|
$labelSize: labelSize,
|
|
2119
2153
|
$hasLabel: hasLabel,
|
|
2120
2154
|
$hasDropdown: hasDropdown,
|
|
2121
2155
|
$size: size2,
|
|
2122
|
-
onFocusChange,
|
|
2123
|
-
readOnly: true,
|
|
2124
|
-
placeholder: props.value,
|
|
2125
2156
|
value: "",
|
|
2126
2157
|
style: {
|
|
2127
2158
|
position: "absolute",
|
|
2128
|
-
top:
|
|
2159
|
+
top: 0,
|
|
2129
2160
|
left: 0,
|
|
2130
2161
|
right: 0,
|
|
2131
|
-
bottom:
|
|
2162
|
+
bottom: 0,
|
|
2132
2163
|
width: "100%",
|
|
2133
2164
|
height: "100%",
|
|
2134
2165
|
pointerEvents: "none",
|
|
2135
2166
|
background: "transparent",
|
|
2136
2167
|
boxShadow: "none"
|
|
2137
2168
|
}
|
|
2138
|
-
}
|
|
2169
|
+
},
|
|
2170
|
+
/* @__PURE__ */ import_react33.default.createElement("span", { style: { opacity: 0 } }, props.prefix),
|
|
2171
|
+
/* @__PURE__ */ import_react33.default.createElement("span", { style: { opacity: 0.5 } }, props.value.slice(props.prefix.length))
|
|
2139
2172
|
);
|
|
2140
2173
|
};
|
|
2141
2174
|
function parseNumber(value) {
|
|
@@ -2223,7 +2256,7 @@ function InputFieldRoot({
|
|
|
2223
2256
|
size: size2 = "medium",
|
|
2224
2257
|
renderPopoverContent,
|
|
2225
2258
|
onFocusChange,
|
|
2226
|
-
style:
|
|
2259
|
+
style: style2,
|
|
2227
2260
|
className
|
|
2228
2261
|
}) {
|
|
2229
2262
|
const childrenArray = import_react33.Children.toArray(children);
|
|
@@ -2282,7 +2315,7 @@ function InputFieldRoot({
|
|
|
2282
2315
|
id,
|
|
2283
2316
|
$width: width,
|
|
2284
2317
|
$flex: flex,
|
|
2285
|
-
style:
|
|
2318
|
+
style: style2,
|
|
2286
2319
|
className
|
|
2287
2320
|
},
|
|
2288
2321
|
children
|
|
@@ -2306,6 +2339,35 @@ function InputFieldRoot({
|
|
|
2306
2339
|
measuredWidth && /* @__PURE__ */ import_react33.default.createElement(Stack.V, { width: measuredWidth, overflow: "hidden" }, renderPopoverContent({ width: measuredWidth }))
|
|
2307
2340
|
) : rootElement);
|
|
2308
2341
|
}
|
|
2342
|
+
var PrimitiveInputField = import_styled_components13.default.input(({ theme, readOnly, disabled }) => {
|
|
2343
|
+
return {
|
|
2344
|
+
// placeholder
|
|
2345
|
+
"&::placeholder": {
|
|
2346
|
+
color: theme.colors.textDisabled
|
|
2347
|
+
},
|
|
2348
|
+
...theme.textStyles.small,
|
|
2349
|
+
color: readOnly ? theme.colors.textMuted : disabled ? theme.colors.textDisabled : theme.colors.text,
|
|
2350
|
+
width: "0px",
|
|
2351
|
+
// Reset intrinsic width
|
|
2352
|
+
flex: "1 1 0px",
|
|
2353
|
+
position: "relative",
|
|
2354
|
+
border: "0",
|
|
2355
|
+
outline: "none",
|
|
2356
|
+
minWidth: "0",
|
|
2357
|
+
alignSelf: "stretch",
|
|
2358
|
+
borderRadius: "4px",
|
|
2359
|
+
paddingTop: "4px",
|
|
2360
|
+
paddingBottom: "4px",
|
|
2361
|
+
paddingLeft: "6px",
|
|
2362
|
+
paddingRight: "6px",
|
|
2363
|
+
background: theme.colors.inputBackground,
|
|
2364
|
+
"&:focus": {
|
|
2365
|
+
boxShadow: `0 0 0 2px ${theme.colors.primary}`
|
|
2366
|
+
},
|
|
2367
|
+
userSelect: "all",
|
|
2368
|
+
pointerEvents: "all"
|
|
2369
|
+
};
|
|
2370
|
+
});
|
|
2309
2371
|
var InputField;
|
|
2310
2372
|
((InputField2) => {
|
|
2311
2373
|
InputField2.Root = (0, import_react33.memo)(InputFieldRoot);
|
|
@@ -2315,6 +2377,7 @@ var InputField;
|
|
|
2315
2377
|
InputField2.DropdownMenu = InputFieldDropdownMenu;
|
|
2316
2378
|
InputField2.Button = InputFieldButton;
|
|
2317
2379
|
InputField2.Label = InputFieldLabel;
|
|
2380
|
+
InputField2.PrimitiveElement = PrimitiveInputField;
|
|
2318
2381
|
})(InputField || (InputField = {}));
|
|
2319
2382
|
|
|
2320
2383
|
// src/contexts/DialogContext.tsx
|
|
@@ -2649,7 +2712,7 @@ function useHover(props = {}) {
|
|
|
2649
2712
|
// src/components/Chip.tsx
|
|
2650
2713
|
var ChipElement = import_styled_components16.default.span(({ theme, $colorScheme, $size, $variant, $monospace, $isInteractive }) => {
|
|
2651
2714
|
const color = $colorScheme === "primary" ? theme.colors.primary : $colorScheme === "secondary" ? theme.colors.secondary : theme.colors.text;
|
|
2652
|
-
const backgroundColor = $colorScheme === "primary" ?
|
|
2715
|
+
const backgroundColor = $colorScheme === "primary" ? theme.colors.primaryPastel : $colorScheme === "secondary" ? theme.colors.secondaryPastel : $colorScheme === "error" ? "rgb(255, 219, 219)" : theme.colors.inputBackground;
|
|
2653
2716
|
const subtleColor = $colorScheme === "primary" ? "rgba(238, 229, 255, 0.2)" : $colorScheme === "secondary" ? "rgba(205, 238, 231, 0.2)" : $colorScheme === "error" ? "rgba(255, 219, 219, 0.2)" : "rgba(0, 0, 0, 0.1)";
|
|
2654
2717
|
return {
|
|
2655
2718
|
textTransform: "initial",
|
|
@@ -2660,9 +2723,12 @@ var ChipElement = import_styled_components16.default.span(({ theme, $colorScheme
|
|
|
2660
2723
|
// lineHeight: "1.4",
|
|
2661
2724
|
lineHeight: "15px",
|
|
2662
2725
|
whiteSpace: "pre",
|
|
2663
|
-
...$size === "
|
|
2726
|
+
...$size === "large" ? {
|
|
2664
2727
|
fontSize: "11px",
|
|
2665
2728
|
padding: "4px 8px"
|
|
2729
|
+
} : $size === "medium" ? {
|
|
2730
|
+
fontSize: "10px",
|
|
2731
|
+
padding: "2px 6px"
|
|
2666
2732
|
} : {
|
|
2667
2733
|
fontSize: "9px",
|
|
2668
2734
|
padding: "0px 4px"
|
|
@@ -2697,7 +2763,7 @@ var DeleteElement = (0, import_styled_components16.default)(import_noya_icons3.C
|
|
|
2697
2763
|
marginRight: "-2px",
|
|
2698
2764
|
cursor: "pointer",
|
|
2699
2765
|
opacity: 0.5,
|
|
2700
|
-
...size2 === "
|
|
2766
|
+
...size2 === "large" ? {
|
|
2701
2767
|
marginLeft: "2px",
|
|
2702
2768
|
// top: '-1px',
|
|
2703
2769
|
transform: "scale(0.75)"
|
|
@@ -2716,7 +2782,7 @@ var AddElement = (0, import_styled_components16.default)(import_noya_icons3.Plus
|
|
|
2716
2782
|
marginLeft: "-2px",
|
|
2717
2783
|
cursor: "pointer",
|
|
2718
2784
|
opacity: 0.5,
|
|
2719
|
-
...size2 === "
|
|
2785
|
+
...size2 === "large" ? {
|
|
2720
2786
|
marginRight: "2px",
|
|
2721
2787
|
top: "-1px",
|
|
2722
2788
|
transform: "scale(0.75)"
|
|
@@ -2735,8 +2801,8 @@ var Chip = (0, import_react37.memo)(
|
|
|
2735
2801
|
deletable,
|
|
2736
2802
|
addable,
|
|
2737
2803
|
clickable,
|
|
2738
|
-
style:
|
|
2739
|
-
size: size2 = "
|
|
2804
|
+
style: style2,
|
|
2805
|
+
size: size2 = "large",
|
|
2740
2806
|
variant = "solid",
|
|
2741
2807
|
monospace = false,
|
|
2742
2808
|
tabIndex,
|
|
@@ -2758,7 +2824,7 @@ var Chip = (0, import_react37.memo)(
|
|
|
2758
2824
|
ref: forwardedRef,
|
|
2759
2825
|
$variant: variant,
|
|
2760
2826
|
$colorScheme: colorScheme,
|
|
2761
|
-
style:
|
|
2827
|
+
style: style2,
|
|
2762
2828
|
onClick: handleClick,
|
|
2763
2829
|
$size: size2,
|
|
2764
2830
|
$monospace: monospace,
|
|
@@ -3828,11 +3894,11 @@ var FloatingWindow = ({
|
|
|
3828
3894
|
),
|
|
3829
3895
|
/* @__PURE__ */ import_react45.default.createElement(Divider, null),
|
|
3830
3896
|
/* @__PURE__ */ import_react45.default.createElement("div", { style: styles2.content }, children),
|
|
3831
|
-
Object.entries(resizeHandlePositions).map(([direction,
|
|
3897
|
+
Object.entries(resizeHandlePositions).map(([direction, style2]) => /* @__PURE__ */ import_react45.default.createElement(
|
|
3832
3898
|
"div",
|
|
3833
3899
|
{
|
|
3834
3900
|
key: direction,
|
|
3835
|
-
style: { ...styles2.resizeHandle, ...
|
|
3901
|
+
style: { ...styles2.resizeHandle, ...style2 },
|
|
3836
3902
|
onMouseDown: handleResizeStart(direction)
|
|
3837
3903
|
}
|
|
3838
3904
|
))
|
|
@@ -4169,7 +4235,7 @@ var GridViewItem = (0, import_react48.forwardRef)(function GridViewItem2({
|
|
|
4169
4235
|
menuItems,
|
|
4170
4236
|
onSelectMenuItem,
|
|
4171
4237
|
onContextMenu,
|
|
4172
|
-
style:
|
|
4238
|
+
style: style2
|
|
4173
4239
|
}, forwardedRef) {
|
|
4174
4240
|
const [hovered, setHovered] = import_react48.default.useState(false);
|
|
4175
4241
|
const { hoverProps } = useHover({
|
|
@@ -4219,7 +4285,7 @@ var GridViewItem = (0, import_react48.forwardRef)(function GridViewItem2({
|
|
|
4219
4285
|
onClick: handleClick,
|
|
4220
4286
|
onDoubleClick,
|
|
4221
4287
|
onContextMenu,
|
|
4222
|
-
style:
|
|
4288
|
+
style: style2
|
|
4223
4289
|
},
|
|
4224
4290
|
children
|
|
4225
4291
|
),
|
|
@@ -4580,9 +4646,10 @@ var Sortable;
|
|
|
4580
4646
|
// src/components/ListView.tsx
|
|
4581
4647
|
var ROW_HEIGHT = 31;
|
|
4582
4648
|
var SECTION_HEADER_LABEL_HEIGHT = 27;
|
|
4583
|
-
var
|
|
4649
|
+
var ListViewDraggingContext = (0, import_react50.createContext)({
|
|
4584
4650
|
indentation: 12
|
|
4585
4651
|
});
|
|
4652
|
+
ListViewDraggingContext.displayName = "ListViewDraggingContext";
|
|
4586
4653
|
var ListRowContext = (0, import_react50.createContext)({
|
|
4587
4654
|
marginType: "none",
|
|
4588
4655
|
selectedPosition: "only",
|
|
@@ -4596,6 +4663,7 @@ var ListRowContext = (0, import_react50.createContext)({
|
|
|
4596
4663
|
isSectionHeader: false,
|
|
4597
4664
|
colorScheme: "primary"
|
|
4598
4665
|
});
|
|
4666
|
+
ListRowContext.displayName = "ListRowContext";
|
|
4599
4667
|
var ListViewRowTitle = import_styled_components25.default.span(({ theme }) => ({
|
|
4600
4668
|
flex: "1 1 0",
|
|
4601
4669
|
overflow: "hidden",
|
|
@@ -4765,8 +4833,9 @@ var ListViewRow = (0, import_react50.forwardRef)(function ListViewRow2({
|
|
|
4765
4833
|
onSelectMenuItem,
|
|
4766
4834
|
onMenuOpenChange,
|
|
4767
4835
|
onKeyDown,
|
|
4768
|
-
style:
|
|
4769
|
-
dragIndicatorStyle
|
|
4836
|
+
style: style2,
|
|
4837
|
+
dragIndicatorStyle,
|
|
4838
|
+
className
|
|
4770
4839
|
}, forwardedRef) {
|
|
4771
4840
|
depth = Math.max(0, depth);
|
|
4772
4841
|
const {
|
|
@@ -4783,7 +4852,7 @@ var ListViewRow = (0, import_react50.forwardRef)(function ListViewRow2({
|
|
|
4783
4852
|
const { hoverProps } = useHover({
|
|
4784
4853
|
onHoverChange
|
|
4785
4854
|
});
|
|
4786
|
-
const { indentation, isDragging } = (0, import_react50.useContext)(
|
|
4855
|
+
const { indentation, isDragging } = (0, import_react50.useContext)(ListViewDraggingContext);
|
|
4787
4856
|
const handlePress = (0, import_react50.useCallback)(
|
|
4788
4857
|
(event) => {
|
|
4789
4858
|
event.preventDefault();
|
|
@@ -4805,9 +4874,9 @@ var ListViewRow = (0, import_react50.forwardRef)(function ListViewRow2({
|
|
|
4805
4874
|
// TODO: Where do these offsets actually come from?
|
|
4806
4875
|
transform: `translate3d(-36px, -6px, 0)`,
|
|
4807
4876
|
width: `calc(100% + 48px)`,
|
|
4808
|
-
...
|
|
4809
|
-
} :
|
|
4810
|
-
}, [isDragging,
|
|
4877
|
+
...style2
|
|
4878
|
+
} : style2;
|
|
4879
|
+
}, [isDragging, style2]);
|
|
4811
4880
|
const renderContent = ({
|
|
4812
4881
|
relativeDropPosition,
|
|
4813
4882
|
...renderProps
|
|
@@ -4842,7 +4911,8 @@ var ListViewRow = (0, import_react50.forwardRef)(function ListViewRow2({
|
|
|
4842
4911
|
{ onPointerDown: renderProps.onPointerDown },
|
|
4843
4912
|
{ [pressEventName]: handlePress }
|
|
4844
4913
|
),
|
|
4845
|
-
tabIndex
|
|
4914
|
+
tabIndex,
|
|
4915
|
+
className
|
|
4846
4916
|
},
|
|
4847
4917
|
relativeDropPosition && /* @__PURE__ */ import_react50.default.createElement(
|
|
4848
4918
|
ListViewDragIndicatorElement,
|
|
@@ -4885,12 +4955,13 @@ var ListViewRow = (0, import_react50.forwardRef)(function ListViewRow2({
|
|
|
4885
4955
|
var RenderItemContext = (0, import_react50.createContext)(
|
|
4886
4956
|
() => null
|
|
4887
4957
|
);
|
|
4958
|
+
RenderItemContext.displayName = "RenderItemContext";
|
|
4888
4959
|
var VirtualizedListRow = (0, import_react50.memo)(function VirtualizedListRow2({
|
|
4889
4960
|
index,
|
|
4890
|
-
style:
|
|
4961
|
+
style: style2
|
|
4891
4962
|
}) {
|
|
4892
4963
|
const renderItem = (0, import_react50.useContext)(RenderItemContext);
|
|
4893
|
-
return /* @__PURE__ */ import_react50.default.createElement("div", { key: index, style:
|
|
4964
|
+
return /* @__PURE__ */ import_react50.default.createElement("div", { key: index, style: style2 }, renderItem(index));
|
|
4894
4965
|
});
|
|
4895
4966
|
var VirtualizedListInner = (0, import_react50.forwardRef)(function VirtualizedListInner2({
|
|
4896
4967
|
size: size2,
|
|
@@ -4976,7 +5047,7 @@ var RootContainer2 = import_styled_components25.default.div(({ theme, $scrollabl
|
|
|
4976
5047
|
var ListViewRootInner = (0, import_react50.forwardRef)(function ListViewRootInner2({
|
|
4977
5048
|
id,
|
|
4978
5049
|
className,
|
|
4979
|
-
style:
|
|
5050
|
+
style: style2,
|
|
4980
5051
|
onPress,
|
|
4981
5052
|
scrollable = false,
|
|
4982
5053
|
expandable = true,
|
|
@@ -5009,8 +5080,26 @@ var ListViewRootInner = (0, import_react50.forwardRef)(function ListViewRootInne
|
|
|
5009
5080
|
(index) => renderItem(data[index], index, { isDragging: false }),
|
|
5010
5081
|
[data, renderItem]
|
|
5011
5082
|
);
|
|
5083
|
+
const defaultContextValue = (0, import_react50.useMemo)(
|
|
5084
|
+
() => ({
|
|
5085
|
+
colorScheme,
|
|
5086
|
+
marginType: "none",
|
|
5087
|
+
selectedPosition: "only",
|
|
5088
|
+
sortable,
|
|
5089
|
+
expandable,
|
|
5090
|
+
divider,
|
|
5091
|
+
pressEventName,
|
|
5092
|
+
variant,
|
|
5093
|
+
gap,
|
|
5094
|
+
sectionHeaderVariant: "normal",
|
|
5095
|
+
isSectionHeader: false
|
|
5096
|
+
}),
|
|
5097
|
+
[colorScheme, sortable, expandable, divider, pressEventName, variant, gap]
|
|
5098
|
+
);
|
|
5012
5099
|
const getItemContextValue = (0, import_react50.useCallback)(
|
|
5013
5100
|
(i) => {
|
|
5101
|
+
if (variant === "bare" || variant === "normal")
|
|
5102
|
+
return defaultContextValue;
|
|
5014
5103
|
const current = renderChild(i);
|
|
5015
5104
|
if (!(0, import_react50.isValidElement)(current))
|
|
5016
5105
|
return;
|
|
@@ -5057,6 +5146,8 @@ var ListViewRootInner = (0, import_react50.forwardRef)(function ListViewRootInne
|
|
|
5057
5146
|
};
|
|
5058
5147
|
},
|
|
5059
5148
|
[
|
|
5149
|
+
variant,
|
|
5150
|
+
defaultContextValue,
|
|
5060
5151
|
renderChild,
|
|
5061
5152
|
data.length,
|
|
5062
5153
|
colorScheme,
|
|
@@ -5064,7 +5155,6 @@ var ListViewRootInner = (0, import_react50.forwardRef)(function ListViewRootInne
|
|
|
5064
5155
|
expandable,
|
|
5065
5156
|
divider,
|
|
5066
5157
|
pressEventName,
|
|
5067
|
-
variant,
|
|
5068
5158
|
sectionHeaderVariant,
|
|
5069
5159
|
gap
|
|
5070
5160
|
]
|
|
@@ -5074,7 +5164,7 @@ var ListViewRootInner = (0, import_react50.forwardRef)(function ListViewRootInne
|
|
|
5074
5164
|
[indentation]
|
|
5075
5165
|
);
|
|
5076
5166
|
const renderOverlay = (0, import_react50.useCallback)(
|
|
5077
|
-
(index) => /* @__PURE__ */ import_react50.default.createElement("div", { style: { opacity: 0.25 } }, /* @__PURE__ */ import_react50.default.createElement(
|
|
5167
|
+
(index) => /* @__PURE__ */ import_react50.default.createElement("div", { style: { opacity: 0.25 } }, /* @__PURE__ */ import_react50.default.createElement(ListViewDraggingContext.Provider, { value: draggingContextOverlayValue }, renderItem(data[index], index, { isDragging: true }))),
|
|
5078
5168
|
[draggingContextOverlayValue, renderItem, data]
|
|
5079
5169
|
);
|
|
5080
5170
|
const renderWrappedChild = (0, import_react50.useCallback)(
|
|
@@ -5113,12 +5203,12 @@ var ListViewRootInner = (0, import_react50.forwardRef)(function ListViewRootInne
|
|
|
5113
5203
|
[data, keyExtractor]
|
|
5114
5204
|
);
|
|
5115
5205
|
const draggingContextValue = (0, import_react50.useMemo)(() => ({ indentation }), [indentation]);
|
|
5116
|
-
return /* @__PURE__ */ import_react50.default.createElement(
|
|
5206
|
+
return /* @__PURE__ */ import_react50.default.createElement(ListViewDraggingContext.Provider, { value: draggingContextValue }, /* @__PURE__ */ import_react50.default.createElement(
|
|
5117
5207
|
RootContainer2,
|
|
5118
5208
|
{
|
|
5119
5209
|
id,
|
|
5120
5210
|
className,
|
|
5121
|
-
style:
|
|
5211
|
+
style: style2,
|
|
5122
5212
|
...{
|
|
5123
5213
|
[pressEventName]: handleClick
|
|
5124
5214
|
},
|
|
@@ -5224,6 +5314,7 @@ var Text = (0, import_react51.forwardRef)(function Text2({
|
|
|
5224
5314
|
tabIndex,
|
|
5225
5315
|
onClick,
|
|
5226
5316
|
onKeyDown,
|
|
5317
|
+
style: style2,
|
|
5227
5318
|
...rest
|
|
5228
5319
|
}, forwardedRef) {
|
|
5229
5320
|
const element = as ?? elements[variant] ?? "span";
|
|
@@ -5233,6 +5324,7 @@ var Text = (0, import_react51.forwardRef)(function Text2({
|
|
|
5233
5324
|
ref: forwardedRef,
|
|
5234
5325
|
as: element,
|
|
5235
5326
|
className,
|
|
5327
|
+
style: style2,
|
|
5236
5328
|
tabIndex,
|
|
5237
5329
|
$variant: variant,
|
|
5238
5330
|
$breakpoints: breakpoints,
|
|
@@ -5367,7 +5459,7 @@ var InputFieldWithCompletions = (0, import_react52.memo)(
|
|
|
5367
5459
|
onFocus,
|
|
5368
5460
|
onBlur,
|
|
5369
5461
|
onDeleteWhenEmpty,
|
|
5370
|
-
style:
|
|
5462
|
+
style: style2,
|
|
5371
5463
|
className,
|
|
5372
5464
|
children,
|
|
5373
5465
|
hideChildrenWhenFocused = false,
|
|
@@ -5592,7 +5684,7 @@ var InputFieldWithCompletions = (0, import_react52.memo)(
|
|
|
5592
5684
|
onBlur: handleBlur,
|
|
5593
5685
|
onFocusCapture: handleFocus,
|
|
5594
5686
|
onKeyDown: handleKeyDown,
|
|
5595
|
-
style:
|
|
5687
|
+
style: style2,
|
|
5596
5688
|
className,
|
|
5597
5689
|
autoCapitalize: "off",
|
|
5598
5690
|
autoComplete: "off",
|
|
@@ -5605,7 +5697,7 @@ var InputFieldWithCompletions = (0, import_react52.memo)(
|
|
|
5605
5697
|
"aria-controls": "component-listbox"
|
|
5606
5698
|
}
|
|
5607
5699
|
),
|
|
5608
|
-
filter && typeaheadValue && typeaheadValue.startsWith(filter) && /* @__PURE__ */ import_react52.default.createElement(InputField.Typeahead, { value: typeaheadValue }),
|
|
5700
|
+
filter && typeaheadValue && typeaheadValue.toLowerCase().startsWith(filter.toLowerCase()) && /* @__PURE__ */ import_react52.default.createElement(InputField.Typeahead, { value: typeaheadValue, prefix: filter }),
|
|
5609
5701
|
(!isFocused || !hideChildrenWhenFocused) && children,
|
|
5610
5702
|
loading && isFocused && /* @__PURE__ */ import_react52.default.createElement(InputField.Label, null, /* @__PURE__ */ import_react52.default.createElement(ActivityIndicator, null))
|
|
5611
5703
|
);
|
|
@@ -5638,7 +5730,7 @@ var InspectorContainer = (0, import_react53.memo)(
|
|
|
5638
5730
|
showDividers,
|
|
5639
5731
|
id,
|
|
5640
5732
|
className,
|
|
5641
|
-
style:
|
|
5733
|
+
style: style2
|
|
5642
5734
|
}, forwardedRef) {
|
|
5643
5735
|
const theme = useDesignSystemTheme();
|
|
5644
5736
|
return /* @__PURE__ */ import_react53.default.createElement(
|
|
@@ -5652,7 +5744,7 @@ var InspectorContainer = (0, import_react53.memo)(
|
|
|
5652
5744
|
flexDirection: "column",
|
|
5653
5745
|
position: "relative",
|
|
5654
5746
|
background: theme.colors.sidebar.background,
|
|
5655
|
-
...
|
|
5747
|
+
...style2
|
|
5656
5748
|
}
|
|
5657
5749
|
},
|
|
5658
5750
|
header,
|
|
@@ -6092,20 +6184,43 @@ var import_noya_icons6 = require("@noya-app/noya-icons");
|
|
|
6092
6184
|
var Select3 = __toESM(require("@radix-ui/react-select"));
|
|
6093
6185
|
var import_react59 = __toESM(require("react"));
|
|
6094
6186
|
var import_styled_components33 = require("styled-components");
|
|
6187
|
+
var readOnlyStyle = {
|
|
6188
|
+
justifyContent: "flex-start",
|
|
6189
|
+
textAlign: "left"
|
|
6190
|
+
};
|
|
6191
|
+
var flexStyle = {
|
|
6192
|
+
flex: 1
|
|
6193
|
+
};
|
|
6095
6194
|
var SelectMenu = (0, import_react59.memo)(function SelectMenu2({
|
|
6096
6195
|
id,
|
|
6097
|
-
style:
|
|
6196
|
+
style: style2,
|
|
6098
6197
|
className,
|
|
6099
6198
|
menuItems,
|
|
6100
6199
|
value,
|
|
6101
6200
|
onSelect,
|
|
6102
|
-
placeholder
|
|
6201
|
+
placeholder,
|
|
6202
|
+
disabled,
|
|
6203
|
+
readOnly
|
|
6103
6204
|
}) {
|
|
6104
6205
|
const selectedItem = menuItems.find(
|
|
6105
6206
|
(item) => typeof item !== "string" && item.value === value
|
|
6106
6207
|
);
|
|
6107
6208
|
const icon = selectedItem?.icon;
|
|
6108
|
-
|
|
6209
|
+
if (readOnly) {
|
|
6210
|
+
return /* @__PURE__ */ import_react59.default.createElement(
|
|
6211
|
+
Button,
|
|
6212
|
+
{
|
|
6213
|
+
id,
|
|
6214
|
+
style: style2,
|
|
6215
|
+
contentStyle: readOnlyStyle,
|
|
6216
|
+
className,
|
|
6217
|
+
disabled
|
|
6218
|
+
},
|
|
6219
|
+
icon && /* @__PURE__ */ import_react59.default.createElement(import_react59.default.Fragment, null, renderIcon(icon), /* @__PURE__ */ import_react59.default.createElement(Spacer.Horizontal, { inline: true, size: 6 })),
|
|
6220
|
+
/* @__PURE__ */ import_react59.default.createElement("span", { style: flexStyle }, selectedItem?.title ?? value)
|
|
6221
|
+
);
|
|
6222
|
+
}
|
|
6223
|
+
return /* @__PURE__ */ import_react59.default.createElement(Select3.Root, { value, onValueChange: onSelect }, /* @__PURE__ */ import_react59.default.createElement(Select3.SelectTrigger, { asChild: true }, /* @__PURE__ */ import_react59.default.createElement(Button, { id, style: style2, className, disabled }, icon && /* @__PURE__ */ import_react59.default.createElement(import_react59.default.Fragment, null, renderIcon(icon), /* @__PURE__ */ import_react59.default.createElement(Spacer.Horizontal, { inline: true, size: 6 })), /* @__PURE__ */ import_react59.default.createElement("span", { style: flexStyle }, /* @__PURE__ */ import_react59.default.createElement(Select3.Value, { placeholder })), /* @__PURE__ */ import_react59.default.createElement(Spacer.Horizontal, { inline: true, size: 6 }), /* @__PURE__ */ import_react59.default.createElement(import_noya_icons6.DropdownChevronIcon, null))), /* @__PURE__ */ import_react59.default.createElement(Select3.Portal, null, /* @__PURE__ */ import_react59.default.createElement(SelectContent, null, /* @__PURE__ */ import_react59.default.createElement(SelectViewport, null, menuItems.map((menuItem) => {
|
|
6109
6224
|
if (typeof menuItem === "string") {
|
|
6110
6225
|
return /* @__PURE__ */ import_react59.default.createElement(StyledSeparator, null);
|
|
6111
6226
|
}
|
|
@@ -6229,13 +6344,15 @@ var SwitchThumb = (0, import_styled_components35.default)(SwitchPrimitive.Thumb)
|
|
|
6229
6344
|
var Switch = function Switch2({
|
|
6230
6345
|
value,
|
|
6231
6346
|
onChange,
|
|
6232
|
-
colorScheme = "normal"
|
|
6347
|
+
colorScheme = "normal",
|
|
6348
|
+
disabled
|
|
6233
6349
|
}) {
|
|
6234
6350
|
return /* @__PURE__ */ import_react61.default.createElement(
|
|
6235
6351
|
SwitchRoot,
|
|
6236
6352
|
{
|
|
6237
6353
|
$colorScheme: colorScheme,
|
|
6238
6354
|
checked: value,
|
|
6355
|
+
disabled,
|
|
6239
6356
|
onCheckedChange: (newValue) => {
|
|
6240
6357
|
onChange(newValue);
|
|
6241
6358
|
}
|
|
@@ -6244,58 +6361,124 @@ var Switch = function Switch2({
|
|
|
6244
6361
|
);
|
|
6245
6362
|
};
|
|
6246
6363
|
|
|
6247
|
-
// src/components/
|
|
6364
|
+
// src/components/TextArea.tsx
|
|
6248
6365
|
var import_react62 = __toESM(require("react"));
|
|
6249
|
-
var
|
|
6366
|
+
var import_styled_components36 = __toESM(require("styled-components"));
|
|
6367
|
+
var TextAreaElement = import_styled_components36.default.textarea(({ theme }) => ({
|
|
6368
|
+
...theme.textStyles.small,
|
|
6369
|
+
color: theme.colors.text,
|
|
6370
|
+
background: theme.colors.inputBackground,
|
|
6371
|
+
width: "0px",
|
|
6372
|
+
flex: "1 1 auto",
|
|
6373
|
+
padding: "4px 6px",
|
|
6374
|
+
border: "none",
|
|
6375
|
+
outline: "none",
|
|
6376
|
+
height: 100,
|
|
6377
|
+
borderRadius: "4px",
|
|
6378
|
+
"&::placeholder": {
|
|
6379
|
+
color: theme.colors.textDisabled
|
|
6380
|
+
},
|
|
6381
|
+
"&:focus": {
|
|
6382
|
+
boxShadow: `0 0 0 2px ${theme.colors.primary}`
|
|
6383
|
+
},
|
|
6384
|
+
// readonly
|
|
6385
|
+
"&:read-only": {
|
|
6386
|
+
color: theme.colors.textDisabled
|
|
6387
|
+
},
|
|
6388
|
+
resize: "none"
|
|
6389
|
+
}));
|
|
6390
|
+
var useAutoResize = (value) => {
|
|
6391
|
+
const textareaRef = (0, import_react62.useRef)(null);
|
|
6392
|
+
(0, import_react62.useEffect)(() => {
|
|
6393
|
+
if (!textareaRef.current)
|
|
6394
|
+
return;
|
|
6395
|
+
textareaRef.current.style.height = "auto";
|
|
6396
|
+
textareaRef.current.style.height = `${textareaRef.current.scrollHeight}px`;
|
|
6397
|
+
}, [value]);
|
|
6398
|
+
return textareaRef;
|
|
6399
|
+
};
|
|
6400
|
+
var AutoResizingTextArea = (0, import_react62.memo)(
|
|
6401
|
+
(0, import_react62.forwardRef)(function AutoResizingTextArea2({
|
|
6402
|
+
value,
|
|
6403
|
+
onChangeText,
|
|
6404
|
+
...rest
|
|
6405
|
+
}, forwardedRef) {
|
|
6406
|
+
const ref = useAutoResize(value || rest.placeholder || "");
|
|
6407
|
+
const handleChange = (0, import_react62.useCallback)(
|
|
6408
|
+
(event) => onChangeText(event.target.value),
|
|
6409
|
+
[onChangeText]
|
|
6410
|
+
);
|
|
6411
|
+
const handleRef = (0, import_react62.useCallback)(
|
|
6412
|
+
(value2) => {
|
|
6413
|
+
ref.current = value2;
|
|
6414
|
+
assignRef(forwardedRef, value2);
|
|
6415
|
+
},
|
|
6416
|
+
[ref, forwardedRef]
|
|
6417
|
+
);
|
|
6418
|
+
return /* @__PURE__ */ import_react62.default.createElement(
|
|
6419
|
+
TextAreaElement,
|
|
6420
|
+
{
|
|
6421
|
+
ref: handleRef,
|
|
6422
|
+
...rest,
|
|
6423
|
+
onChange: handleChange,
|
|
6424
|
+
value
|
|
6425
|
+
}
|
|
6426
|
+
);
|
|
6427
|
+
})
|
|
6428
|
+
);
|
|
6429
|
+
|
|
6430
|
+
// src/components/TreeView.tsx
|
|
6431
|
+
var import_react63 = __toESM(require("react"));
|
|
6432
|
+
var TreeRow = (0, import_react63.forwardRef)(function TreeRow2({
|
|
6250
6433
|
icon,
|
|
6251
6434
|
expanded,
|
|
6252
6435
|
onClickChevron,
|
|
6253
6436
|
children,
|
|
6254
6437
|
...rest
|
|
6255
6438
|
}, forwardedRef) {
|
|
6256
|
-
const { expandable } = (0,
|
|
6257
|
-
const handleClickChevron = (0,
|
|
6439
|
+
const { expandable } = (0, import_react63.useContext)(ListView.RowContext);
|
|
6440
|
+
const handleClickChevron = (0, import_react63.useCallback)(
|
|
6258
6441
|
(event) => {
|
|
6259
6442
|
event.stopPropagation();
|
|
6260
6443
|
onClickChevron?.({ altKey: event.altKey });
|
|
6261
6444
|
},
|
|
6262
6445
|
[onClickChevron]
|
|
6263
6446
|
);
|
|
6264
|
-
return /* @__PURE__ */
|
|
6447
|
+
return /* @__PURE__ */ import_react63.default.createElement(ListView.Row, { ref: forwardedRef, ...rest }, expandable && /* @__PURE__ */ import_react63.default.createElement(import_react63.default.Fragment, null, expanded === void 0 ? /* @__PURE__ */ import_react63.default.createElement(Spacer.Horizontal, { size: 19 }) : /* @__PURE__ */ import_react63.default.createElement(
|
|
6265
6448
|
IconButton,
|
|
6266
6449
|
{
|
|
6267
6450
|
iconName: expanded ? "ChevronDownIcon2" : "ChevronRightIcon2",
|
|
6268
6451
|
onClick: handleClickChevron,
|
|
6269
6452
|
selected: rest.selected
|
|
6270
6453
|
}
|
|
6271
|
-
), /* @__PURE__ */
|
|
6454
|
+
), /* @__PURE__ */ import_react63.default.createElement(Spacer.Horizontal, { size: 6 })), icon && /* @__PURE__ */ import_react63.default.createElement(import_react63.default.Fragment, null, renderIcon(icon), /* @__PURE__ */ import_react63.default.createElement(Spacer.Horizontal, { size: 10 })), children);
|
|
6272
6455
|
});
|
|
6273
6456
|
var TreeView;
|
|
6274
6457
|
((TreeView2) => {
|
|
6275
6458
|
TreeView2.Root = ListView.Root;
|
|
6276
6459
|
TreeView2.RowTitle = ListView.RowTitle;
|
|
6277
6460
|
TreeView2.EditableRowTitle = ListView.EditableRowTitle;
|
|
6278
|
-
TreeView2.Row = (0,
|
|
6461
|
+
TreeView2.Row = (0, import_react63.memo)(TreeRow);
|
|
6279
6462
|
})(TreeView || (TreeView = {}));
|
|
6280
6463
|
|
|
6281
6464
|
// src/components/WorkspaceLayout.tsx
|
|
6282
6465
|
var import_noya_keymap5 = require("@noya-app/noya-keymap");
|
|
6283
|
-
var
|
|
6466
|
+
var import_react66 = __toESM(require("react"));
|
|
6284
6467
|
var import_react_resizable_panels = require("react-resizable-panels");
|
|
6285
6468
|
|
|
6286
6469
|
// src/hooks/usePreservePanelSize.tsx
|
|
6287
|
-
var
|
|
6470
|
+
var import_react65 = require("react");
|
|
6288
6471
|
|
|
6289
6472
|
// src/hooks/useWindowSize.tsx
|
|
6290
|
-
var
|
|
6473
|
+
var import_react64 = require("react");
|
|
6291
6474
|
function useWindowSize() {
|
|
6292
|
-
const [size2, setSize] = (0,
|
|
6475
|
+
const [size2, setSize] = (0, import_react64.useState)(
|
|
6293
6476
|
typeof window === "undefined" ? { width: 0, height: 0 } : {
|
|
6294
6477
|
width: window.innerWidth,
|
|
6295
6478
|
height: window.innerHeight
|
|
6296
6479
|
}
|
|
6297
6480
|
);
|
|
6298
|
-
(0,
|
|
6481
|
+
(0, import_react64.useEffect)(() => {
|
|
6299
6482
|
const handleResize = () => setSize({
|
|
6300
6483
|
width: window.innerWidth,
|
|
6301
6484
|
height: window.innerHeight
|
|
@@ -6313,8 +6496,8 @@ var RIGHT_SIDEBAR_ID = "editor-right-sidebar";
|
|
|
6313
6496
|
var CONTENT_AREA_ID = "editor-content-area";
|
|
6314
6497
|
function usePreservePanelSize(panelGroupRef, setPanelLayoutState) {
|
|
6315
6498
|
const windowSize = useWindowSize();
|
|
6316
|
-
const layoutRef = (0,
|
|
6317
|
-
(0,
|
|
6499
|
+
const layoutRef = (0, import_react65.useRef)();
|
|
6500
|
+
(0, import_react65.useLayoutEffect)(() => {
|
|
6318
6501
|
const panelGroup = document.querySelector(
|
|
6319
6502
|
`[data-panel-group-id="${EDITOR_PANEL_GROUP_ID}"]`
|
|
6320
6503
|
);
|
|
@@ -6357,7 +6540,7 @@ function usePreservePanelSize(panelGroupRef, setPanelLayoutState) {
|
|
|
6357
6540
|
panelGroupObserver.disconnect();
|
|
6358
6541
|
};
|
|
6359
6542
|
}, [panelGroupRef, setPanelLayoutState]);
|
|
6360
|
-
(0,
|
|
6543
|
+
(0, import_react65.useLayoutEffect)(() => {
|
|
6361
6544
|
if (!layoutRef.current)
|
|
6362
6545
|
return;
|
|
6363
6546
|
const {
|
|
@@ -6417,7 +6600,7 @@ function usePreservePanelSize(panelGroupRef, setPanelLayoutState) {
|
|
|
6417
6600
|
}
|
|
6418
6601
|
|
|
6419
6602
|
// src/components/WorkspaceLayout.tsx
|
|
6420
|
-
var WorkspaceLayout = (0,
|
|
6603
|
+
var WorkspaceLayout = (0, import_react66.forwardRef)(function WorkspaceLayout2({
|
|
6421
6604
|
autoSavePrefix,
|
|
6422
6605
|
leftSidebarContent: leftPanelContent,
|
|
6423
6606
|
children: centerPanelContent,
|
|
@@ -6432,7 +6615,7 @@ var WorkspaceLayout = (0, import_react65.forwardRef)(function WorkspaceLayout2({
|
|
|
6432
6615
|
leftSidebarCanResize = false,
|
|
6433
6616
|
id,
|
|
6434
6617
|
className,
|
|
6435
|
-
style:
|
|
6618
|
+
style: style2
|
|
6436
6619
|
}, forwardedRef) {
|
|
6437
6620
|
const windowSize = useWindowSize();
|
|
6438
6621
|
function getPercentage(size2) {
|
|
@@ -6442,12 +6625,12 @@ var WorkspaceLayout = (0, import_react65.forwardRef)(function WorkspaceLayout2({
|
|
|
6442
6625
|
const rightSidebarPercentage = getPercentage(rightSidebarInitialSize);
|
|
6443
6626
|
const leftSidebarMinPercentage = leftSidebarMinSize !== void 0 ? getPercentage(leftSidebarMinSize) : void 0;
|
|
6444
6627
|
const rightSidebarMinPercentage = rightSidebarMinSize !== void 0 ? getPercentage(rightSidebarMinSize) : void 0;
|
|
6445
|
-
const panelGroupRef = (0,
|
|
6446
|
-
const leftSidebarRef = (0,
|
|
6447
|
-
const rightSidebarRef = (0,
|
|
6628
|
+
const panelGroupRef = (0, import_react66.useRef)(null);
|
|
6629
|
+
const leftSidebarRef = (0, import_react66.useRef)(null);
|
|
6630
|
+
const rightSidebarRef = (0, import_react66.useRef)(null);
|
|
6448
6631
|
usePreservePanelSize(panelGroupRef, onChangeLayoutState);
|
|
6449
6632
|
const theme = useDesignSystemTheme();
|
|
6450
|
-
(0,
|
|
6633
|
+
(0, import_react66.useImperativeHandle)(forwardedRef, () => ({
|
|
6451
6634
|
setLeftSidebarExpanded: (expanded) => {
|
|
6452
6635
|
if (expanded) {
|
|
6453
6636
|
leftSidebarRef.current?.expand();
|
|
@@ -6504,7 +6687,7 @@ var WorkspaceLayout = (0, import_react65.forwardRef)(function WorkspaceLayout2({
|
|
|
6504
6687
|
}
|
|
6505
6688
|
});
|
|
6506
6689
|
const centerPanelPercentage = 100 - (leftPanelContent ? leftSidebarPercentage : 0) - (rightPanelContent ? rightSidebarPercentage : 0);
|
|
6507
|
-
return /* @__PURE__ */
|
|
6690
|
+
return /* @__PURE__ */ import_react66.default.createElement(
|
|
6508
6691
|
"div",
|
|
6509
6692
|
{
|
|
6510
6693
|
id,
|
|
@@ -6513,10 +6696,10 @@ var WorkspaceLayout = (0, import_react65.forwardRef)(function WorkspaceLayout2({
|
|
|
6513
6696
|
backgroundColor: theme.colors.canvas.background,
|
|
6514
6697
|
display: "flex",
|
|
6515
6698
|
flexDirection: "row",
|
|
6516
|
-
...
|
|
6699
|
+
...style2
|
|
6517
6700
|
}
|
|
6518
6701
|
},
|
|
6519
|
-
/* @__PURE__ */
|
|
6702
|
+
/* @__PURE__ */ import_react66.default.createElement(
|
|
6520
6703
|
import_react_resizable_panels.PanelGroup,
|
|
6521
6704
|
{
|
|
6522
6705
|
ref: panelGroupRef,
|
|
@@ -6525,7 +6708,7 @@ var WorkspaceLayout = (0, import_react65.forwardRef)(function WorkspaceLayout2({
|
|
|
6525
6708
|
autoSaveId: autoSavePrefix ? `${autoSavePrefix}--${EDITOR_PANEL_GROUP_ID}` : void 0,
|
|
6526
6709
|
style: { flex: "1" }
|
|
6527
6710
|
},
|
|
6528
|
-
hasLeftSidebar && /* @__PURE__ */
|
|
6711
|
+
hasLeftSidebar && /* @__PURE__ */ import_react66.default.createElement(import_react66.default.Fragment, null, /* @__PURE__ */ import_react66.default.createElement(
|
|
6529
6712
|
import_react_resizable_panels.Panel,
|
|
6530
6713
|
{
|
|
6531
6714
|
id: LEFT_SIDEBAR_ID,
|
|
@@ -6542,7 +6725,7 @@ var WorkspaceLayout = (0, import_react65.forwardRef)(function WorkspaceLayout2({
|
|
|
6542
6725
|
}
|
|
6543
6726
|
},
|
|
6544
6727
|
leftPanelContent
|
|
6545
|
-
), /* @__PURE__ */
|
|
6728
|
+
), /* @__PURE__ */ import_react66.default.createElement(
|
|
6546
6729
|
import_react_resizable_panels.PanelResizeHandle,
|
|
6547
6730
|
{
|
|
6548
6731
|
style: {
|
|
@@ -6553,7 +6736,7 @@ var WorkspaceLayout = (0, import_react65.forwardRef)(function WorkspaceLayout2({
|
|
|
6553
6736
|
}
|
|
6554
6737
|
}
|
|
6555
6738
|
)),
|
|
6556
|
-
/* @__PURE__ */
|
|
6739
|
+
/* @__PURE__ */ import_react66.default.createElement(
|
|
6557
6740
|
import_react_resizable_panels.Panel,
|
|
6558
6741
|
{
|
|
6559
6742
|
id: CONTENT_AREA_ID,
|
|
@@ -6568,7 +6751,7 @@ var WorkspaceLayout = (0, import_react65.forwardRef)(function WorkspaceLayout2({
|
|
|
6568
6751
|
},
|
|
6569
6752
|
centerPanelContent
|
|
6570
6753
|
),
|
|
6571
|
-
hasRightSidebar && /* @__PURE__ */
|
|
6754
|
+
hasRightSidebar && /* @__PURE__ */ import_react66.default.createElement(import_react66.default.Fragment, null, /* @__PURE__ */ import_react66.default.createElement(
|
|
6572
6755
|
import_react_resizable_panels.PanelResizeHandle,
|
|
6573
6756
|
{
|
|
6574
6757
|
style: {
|
|
@@ -6578,7 +6761,7 @@ var WorkspaceLayout = (0, import_react65.forwardRef)(function WorkspaceLayout2({
|
|
|
6578
6761
|
backgroundColor: theme.colors.divider
|
|
6579
6762
|
}
|
|
6580
6763
|
}
|
|
6581
|
-
), /* @__PURE__ */
|
|
6764
|
+
), /* @__PURE__ */ import_react66.default.createElement(
|
|
6582
6765
|
import_react_resizable_panels.Panel,
|
|
6583
6766
|
{
|
|
6584
6767
|
id: RIGHT_SIDEBAR_ID,
|
|
@@ -6641,8 +6824,8 @@ var SUPPORTED_CANVAS_UPLOAD_TYPES = [
|
|
|
6641
6824
|
|
|
6642
6825
|
// src/components/ArrayController.tsx
|
|
6643
6826
|
var import_noya_utils11 = require("@noya-app/noya-utils");
|
|
6644
|
-
var
|
|
6645
|
-
var
|
|
6827
|
+
var import_react68 = __toESM(require("react"));
|
|
6828
|
+
var import_styled_components38 = __toESM(require("styled-components"));
|
|
6646
6829
|
|
|
6647
6830
|
// src/components/InspectorPrimitives.tsx
|
|
6648
6831
|
var InspectorPrimitives_exports = {};
|
|
@@ -6660,20 +6843,20 @@ __export(InspectorPrimitives_exports, {
|
|
|
6660
6843
|
Title: () => Title3,
|
|
6661
6844
|
VerticalSeparator: () => VerticalSeparator
|
|
6662
6845
|
});
|
|
6663
|
-
var
|
|
6664
|
-
var
|
|
6665
|
-
var Section =
|
|
6846
|
+
var import_react67 = __toESM(require("react"));
|
|
6847
|
+
var import_styled_components37 = __toESM(require("styled-components"));
|
|
6848
|
+
var Section = import_styled_components37.default.div(({ theme, $padding = "10px", $gap }) => ({
|
|
6666
6849
|
flex: "0 0 auto",
|
|
6667
6850
|
display: "flex",
|
|
6668
6851
|
flexDirection: "column",
|
|
6669
6852
|
padding: $padding,
|
|
6670
6853
|
gap: $gap
|
|
6671
6854
|
}));
|
|
6672
|
-
var SectionHeader =
|
|
6855
|
+
var SectionHeader = import_styled_components37.default.div(({ theme }) => ({
|
|
6673
6856
|
display: "flex",
|
|
6674
6857
|
alignItems: "center"
|
|
6675
6858
|
}));
|
|
6676
|
-
var Title3 =
|
|
6859
|
+
var Title3 = import_styled_components37.default.div(({ theme, $textStyle }) => ({
|
|
6677
6860
|
display: "flex",
|
|
6678
6861
|
flexDirection: "row",
|
|
6679
6862
|
userSelect: "none",
|
|
@@ -6682,11 +6865,11 @@ var Title3 = import_styled_components36.default.div(({ theme, $textStyle }) => (
|
|
|
6682
6865
|
color: theme.colors.text
|
|
6683
6866
|
} : {
|
|
6684
6867
|
...theme.textStyles.label,
|
|
6685
|
-
color: theme.colors.
|
|
6868
|
+
color: theme.colors.textMuted,
|
|
6686
6869
|
fontWeight: "bold"
|
|
6687
6870
|
}
|
|
6688
6871
|
}));
|
|
6689
|
-
var Row2 =
|
|
6872
|
+
var Row2 = import_styled_components37.default.div(
|
|
6690
6873
|
({ theme, $gap }) => ({
|
|
6691
6874
|
flex: "1",
|
|
6692
6875
|
display: "flex",
|
|
@@ -6695,26 +6878,26 @@ var Row2 = import_styled_components36.default.div(
|
|
|
6695
6878
|
gap: $gap
|
|
6696
6879
|
})
|
|
6697
6880
|
);
|
|
6698
|
-
var Column =
|
|
6881
|
+
var Column = import_styled_components37.default.div(({ theme }) => ({
|
|
6699
6882
|
flex: "1",
|
|
6700
6883
|
display: "flex",
|
|
6701
6884
|
flexDirection: "column",
|
|
6702
6885
|
gap: "4px"
|
|
6703
6886
|
}));
|
|
6704
|
-
var Checkbox =
|
|
6887
|
+
var Checkbox = import_styled_components37.default.input(({ theme }) => ({
|
|
6705
6888
|
margin: 0
|
|
6706
6889
|
}));
|
|
6707
|
-
var Text3 =
|
|
6890
|
+
var Text3 = import_styled_components37.default.span(({ theme }) => ({
|
|
6708
6891
|
...theme.textStyles.small
|
|
6709
6892
|
}));
|
|
6710
|
-
var VerticalSeparator = () => /* @__PURE__ */
|
|
6711
|
-
var HorizontalSeparator = () => /* @__PURE__ */
|
|
6712
|
-
var SliderRowLabel =
|
|
6893
|
+
var VerticalSeparator = () => /* @__PURE__ */ import_react67.default.createElement(Spacer.Vertical, { size: (0, import_styled_components37.useTheme)().sizes.inspector.verticalSeparator });
|
|
6894
|
+
var HorizontalSeparator = () => /* @__PURE__ */ import_react67.default.createElement(Spacer.Horizontal, { size: (0, import_styled_components37.useTheme)().sizes.inspector.horizontalSeparator });
|
|
6895
|
+
var SliderRowLabel = import_styled_components37.default.span(({ theme }) => ({
|
|
6713
6896
|
...theme.textStyles.small,
|
|
6714
6897
|
color: theme.colors.textMuted,
|
|
6715
6898
|
marginBottom: "-6px"
|
|
6716
6899
|
}));
|
|
6717
|
-
var RowLabel =
|
|
6900
|
+
var RowLabel = import_styled_components37.default.span(({ theme, $textStyle }) => ({
|
|
6718
6901
|
// marginBottom: '6px',
|
|
6719
6902
|
display: "flex",
|
|
6720
6903
|
...$textStyle ? {
|
|
@@ -6728,7 +6911,7 @@ var RowLabel = import_styled_components36.default.span(({ theme, $textStyle }) =
|
|
|
6728
6911
|
// Button height
|
|
6729
6912
|
alignItems: "center"
|
|
6730
6913
|
}));
|
|
6731
|
-
var LabeledRow = (0,
|
|
6914
|
+
var LabeledRow = (0, import_react67.memo)(function LabeledRow2({
|
|
6732
6915
|
id,
|
|
6733
6916
|
children,
|
|
6734
6917
|
label,
|
|
@@ -6736,26 +6919,26 @@ var LabeledRow = (0, import_react66.memo)(function LabeledRow2({
|
|
|
6736
6919
|
gap,
|
|
6737
6920
|
right
|
|
6738
6921
|
}) {
|
|
6739
|
-
return /* @__PURE__ */
|
|
6922
|
+
return /* @__PURE__ */ import_react67.default.createElement(Row2, { id }, /* @__PURE__ */ import_react67.default.createElement(Column, null, /* @__PURE__ */ import_react67.default.createElement(RowLabel, { $textStyle: labelTextStyle }, label, right && /* @__PURE__ */ import_react67.default.createElement(Spacer.Horizontal, null), right), /* @__PURE__ */ import_react67.default.createElement(Row2, { $gap: gap }, children)));
|
|
6740
6923
|
});
|
|
6741
|
-
var LabeledSliderRow = (0,
|
|
6924
|
+
var LabeledSliderRow = (0, import_react67.memo)(function LabeledRow3({
|
|
6742
6925
|
children,
|
|
6743
6926
|
label
|
|
6744
6927
|
}) {
|
|
6745
|
-
return /* @__PURE__ */
|
|
6928
|
+
return /* @__PURE__ */ import_react67.default.createElement(Row2, null, /* @__PURE__ */ import_react67.default.createElement(Column, null, /* @__PURE__ */ import_react67.default.createElement(SliderRowLabel, null, label), /* @__PURE__ */ import_react67.default.createElement(Row2, null, children)));
|
|
6746
6929
|
});
|
|
6747
6930
|
|
|
6748
6931
|
// src/components/ArrayController.tsx
|
|
6749
|
-
var ElementRow =
|
|
6932
|
+
var ElementRow = import_styled_components38.default.div({
|
|
6750
6933
|
flex: "0 0 auto",
|
|
6751
6934
|
display: "flex",
|
|
6752
6935
|
flexDirection: "row",
|
|
6753
6936
|
alignItems: "center"
|
|
6754
6937
|
});
|
|
6755
|
-
var ItemContainer2 =
|
|
6938
|
+
var ItemContainer2 = import_styled_components38.default.div({
|
|
6756
6939
|
position: "relative"
|
|
6757
6940
|
});
|
|
6758
|
-
var ArrayController = (0,
|
|
6941
|
+
var ArrayController = (0, import_react68.memo)(function ArrayController2({
|
|
6759
6942
|
id,
|
|
6760
6943
|
items,
|
|
6761
6944
|
title,
|
|
@@ -6771,14 +6954,14 @@ var ArrayController = (0, import_react67.memo)(function ArrayController2({
|
|
|
6771
6954
|
renderExpandedContent,
|
|
6772
6955
|
padding = 10
|
|
6773
6956
|
}) {
|
|
6774
|
-
const iconColor = (0,
|
|
6775
|
-
const primaryLightColor = (0,
|
|
6776
|
-
const keys = (0,
|
|
6957
|
+
const iconColor = (0, import_styled_components38.useTheme)().colors.icon;
|
|
6958
|
+
const primaryLightColor = (0, import_styled_components38.useTheme)().colors.primaryLight;
|
|
6959
|
+
const keys = (0, import_react68.useMemo)(
|
|
6777
6960
|
() => items.map((item, index) => getKey?.(item) ?? index.toString()),
|
|
6778
6961
|
[getKey, items]
|
|
6779
6962
|
);
|
|
6780
6963
|
const indexes = reversed ? (0, import_noya_utils11.range)(0, items.length).reverse() : (0, import_noya_utils11.range)(0, items.length);
|
|
6781
|
-
const handleMoveItem = (0,
|
|
6964
|
+
const handleMoveItem = (0, import_react68.useCallback)(
|
|
6782
6965
|
(sourceIndex, destinationIndex, position) => {
|
|
6783
6966
|
if (reversed) {
|
|
6784
6967
|
if (position === "above") {
|
|
@@ -6795,11 +6978,11 @@ var ArrayController = (0, import_react67.memo)(function ArrayController2({
|
|
|
6795
6978
|
[onMoveItem, reversed]
|
|
6796
6979
|
);
|
|
6797
6980
|
const renderRow = (index) => {
|
|
6798
|
-
return /* @__PURE__ */
|
|
6981
|
+
return /* @__PURE__ */ import_react68.default.createElement(ElementRow, { key: keys[index] }, renderItem({ item: items[index], index }));
|
|
6799
6982
|
};
|
|
6800
|
-
return /* @__PURE__ */
|
|
6983
|
+
return /* @__PURE__ */ import_react68.default.createElement(Section, { id, $padding: padding, $gap: "2px" }, /* @__PURE__ */ import_react68.default.createElement(SectionHeader, null, /* @__PURE__ */ import_react68.default.createElement(Button, { variant: "none", onClick: onClickPlus }, /* @__PURE__ */ import_react68.default.createElement(Title3, null, title)), /* @__PURE__ */ import_react68.default.createElement(Spacer.Horizontal, null), withSeparatorElements(
|
|
6801
6984
|
[
|
|
6802
|
-
onClickTrash && /* @__PURE__ */
|
|
6985
|
+
onClickTrash && /* @__PURE__ */ import_react68.default.createElement(
|
|
6803
6986
|
IconButton,
|
|
6804
6987
|
{
|
|
6805
6988
|
id: `${id}-trash`,
|
|
@@ -6808,7 +6991,7 @@ var ArrayController = (0, import_react67.memo)(function ArrayController2({
|
|
|
6808
6991
|
onClick: onClickTrash
|
|
6809
6992
|
}
|
|
6810
6993
|
),
|
|
6811
|
-
onClickExpand && /* @__PURE__ */
|
|
6994
|
+
onClickExpand && /* @__PURE__ */ import_react68.default.createElement(
|
|
6812
6995
|
IconButton,
|
|
6813
6996
|
{
|
|
6814
6997
|
id: `${id}-gear`,
|
|
@@ -6817,7 +7000,7 @@ var ArrayController = (0, import_react67.memo)(function ArrayController2({
|
|
|
6817
7000
|
onClick: onClickExpand
|
|
6818
7001
|
}
|
|
6819
7002
|
),
|
|
6820
|
-
onClickPlus && /* @__PURE__ */
|
|
7003
|
+
onClickPlus && /* @__PURE__ */ import_react68.default.createElement(
|
|
6821
7004
|
IconButton,
|
|
6822
7005
|
{
|
|
6823
7006
|
id: `${id}-add`,
|
|
@@ -6827,15 +7010,15 @@ var ArrayController = (0, import_react67.memo)(function ArrayController2({
|
|
|
6827
7010
|
}
|
|
6828
7011
|
)
|
|
6829
7012
|
],
|
|
6830
|
-
/* @__PURE__ */
|
|
6831
|
-
)), /* @__PURE__ */
|
|
7013
|
+
/* @__PURE__ */ import_react68.default.createElement(Spacer.Horizontal, { size: 8 })
|
|
7014
|
+
)), /* @__PURE__ */ import_react68.default.createElement(Stack.V, { gap: "4px" }, sortable ? /* @__PURE__ */ import_react68.default.createElement(
|
|
6832
7015
|
Sortable.Root,
|
|
6833
7016
|
{
|
|
6834
7017
|
keys,
|
|
6835
7018
|
renderOverlay: renderRow,
|
|
6836
7019
|
onMoveItem: handleMoveItem
|
|
6837
7020
|
},
|
|
6838
|
-
indexes.map((index) => /* @__PURE__ */
|
|
7021
|
+
indexes.map((index) => /* @__PURE__ */ import_react68.default.createElement(Sortable.Item, { id: keys[index], key: keys[index] }, ({ relativeDropPosition, ...sortableProps }) => /* @__PURE__ */ import_react68.default.createElement(ItemContainer2, { ...sortableProps }, renderRow(index), relativeDropPosition && /* @__PURE__ */ import_react68.default.createElement(
|
|
6839
7022
|
ListView.DragIndicator,
|
|
6840
7023
|
{
|
|
6841
7024
|
$gap: 0,
|
|
@@ -6849,11 +7032,11 @@ var ArrayController = (0, import_react67.memo)(function ArrayController2({
|
|
|
6849
7032
|
|
|
6850
7033
|
// src/components/DimensionInput.tsx
|
|
6851
7034
|
var import_noya_utils12 = require("@noya-app/noya-utils");
|
|
6852
|
-
var
|
|
7035
|
+
var import_react69 = __toESM(require("react"));
|
|
6853
7036
|
function getNewValue(value, mode, delta) {
|
|
6854
7037
|
return delta === void 0 ? value : mode === "replace" ? delta : value + delta;
|
|
6855
7038
|
}
|
|
6856
|
-
var DimensionInput = (0,
|
|
7039
|
+
var DimensionInput = (0, import_react69.memo)(function DimensionInput2({
|
|
6857
7040
|
id,
|
|
6858
7041
|
value,
|
|
6859
7042
|
onSetValue,
|
|
@@ -6863,15 +7046,15 @@ var DimensionInput = (0, import_react68.memo)(function DimensionInput2({
|
|
|
6863
7046
|
disabled,
|
|
6864
7047
|
trigger = "submit"
|
|
6865
7048
|
}) {
|
|
6866
|
-
const handleNudgeValue = (0,
|
|
7049
|
+
const handleNudgeValue = (0, import_react69.useCallback)(
|
|
6867
7050
|
(value2) => onSetValue(value2, "adjust"),
|
|
6868
7051
|
[onSetValue]
|
|
6869
7052
|
);
|
|
6870
|
-
const handleSetValue = (0,
|
|
7053
|
+
const handleSetValue = (0, import_react69.useCallback)(
|
|
6871
7054
|
(value2) => onSetValue(value2, "replace"),
|
|
6872
7055
|
[onSetValue]
|
|
6873
7056
|
);
|
|
6874
|
-
return /* @__PURE__ */
|
|
7057
|
+
return /* @__PURE__ */ import_react69.default.createElement(InputField.Root, { id, width: size2 }, /* @__PURE__ */ import_react69.default.createElement(
|
|
6875
7058
|
InputField.NumberInput,
|
|
6876
7059
|
{
|
|
6877
7060
|
value: value === void 0 ? value : (0, import_noya_utils12.round)(value, 2),
|
|
@@ -6880,12 +7063,13 @@ var DimensionInput = (0, import_react68.memo)(function DimensionInput2({
|
|
|
6880
7063
|
disabled,
|
|
6881
7064
|
...trigger === "change" ? { onChange: handleSetValue } : { onSubmit: handleSetValue }
|
|
6882
7065
|
}
|
|
6883
|
-
), label && /* @__PURE__ */
|
|
7066
|
+
), label && /* @__PURE__ */ import_react69.default.createElement(InputField.Label, null, label));
|
|
6884
7067
|
});
|
|
6885
7068
|
// Annotate the CommonJS export names for ESM import in node:
|
|
6886
7069
|
0 && (module.exports = {
|
|
6887
7070
|
ActivityIndicator,
|
|
6888
7071
|
ArrayController,
|
|
7072
|
+
AutoResizingTextArea,
|
|
6889
7073
|
Avatar,
|
|
6890
7074
|
AvatarStack,
|
|
6891
7075
|
Body,
|
|
@@ -6969,6 +7153,7 @@ var DimensionInput = (0, import_react68.memo)(function DimensionInput2({
|
|
|
6969
7153
|
sketchColorToHex,
|
|
6970
7154
|
sketchColorToRgba,
|
|
6971
7155
|
sketchColorToRgbaString,
|
|
7156
|
+
useAutoResize,
|
|
6972
7157
|
useCurrentFloatingWindowInternal,
|
|
6973
7158
|
useDesignSystemConfiguration,
|
|
6974
7159
|
useDesignSystemTheme,
|