@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.mjs
CHANGED
|
@@ -331,7 +331,13 @@ var ButtonElement = styled5.button(
|
|
|
331
331
|
color: theme.colors.text,
|
|
332
332
|
boxShadow: "0 1px 2px rgba(0, 0, 0, 0.1)",
|
|
333
333
|
fontSize: "12px",
|
|
334
|
-
padding: "0px 4px"
|
|
334
|
+
padding: "0px 4px",
|
|
335
|
+
"&:hover": {
|
|
336
|
+
opacity: 0.8
|
|
337
|
+
},
|
|
338
|
+
"&:active": {
|
|
339
|
+
opacity: 0.9
|
|
340
|
+
}
|
|
335
341
|
},
|
|
336
342
|
display: "flex",
|
|
337
343
|
alignItems: "center",
|
|
@@ -355,7 +361,7 @@ var ButtonContent = styled5.span(({ theme }) => ({
|
|
|
355
361
|
var Button = forwardRef3(function Button2({
|
|
356
362
|
id,
|
|
357
363
|
className,
|
|
358
|
-
style:
|
|
364
|
+
style: style2,
|
|
359
365
|
flex,
|
|
360
366
|
tabIndex,
|
|
361
367
|
tooltip,
|
|
@@ -376,7 +382,7 @@ var Button = forwardRef3(function Button2({
|
|
|
376
382
|
ref: forwardedRef,
|
|
377
383
|
id,
|
|
378
384
|
className,
|
|
379
|
-
style:
|
|
385
|
+
style: style2,
|
|
380
386
|
$flex: flex,
|
|
381
387
|
tabIndex,
|
|
382
388
|
$active: active,
|
|
@@ -441,14 +447,14 @@ var IconButton = memo4(
|
|
|
441
447
|
forwardRef4(function IconButton2({ selected, iconName, color, size: size2, contentStyle, ...props }, forwardedRef) {
|
|
442
448
|
const { icon: iconColor, iconSelected: iconSelectedColor } = useTheme().colors;
|
|
443
449
|
const Icon = Icons[iconName];
|
|
444
|
-
const
|
|
450
|
+
const style2 = useMemo(() => {
|
|
445
451
|
return {
|
|
446
452
|
padding: "0 2px",
|
|
447
453
|
...size2 && { minHeight: size2 },
|
|
448
454
|
...contentStyle
|
|
449
455
|
};
|
|
450
456
|
}, [contentStyle, size2]);
|
|
451
|
-
return /* @__PURE__ */ React7.createElement(Button, { ref: forwardedRef, ...props, variant: "none", contentStyle:
|
|
457
|
+
return /* @__PURE__ */ React7.createElement(Button, { ref: forwardedRef, ...props, variant: "none", contentStyle: style2 }, /* @__PURE__ */ React7.createElement(
|
|
452
458
|
Icon,
|
|
453
459
|
{
|
|
454
460
|
color: color ?? (selected ? iconSelectedColor : iconColor),
|
|
@@ -551,26 +557,29 @@ var mediaQuery = {
|
|
|
551
557
|
var name = "light";
|
|
552
558
|
var colors = {
|
|
553
559
|
logo: {
|
|
554
|
-
fill: "rgb(
|
|
555
|
-
highlight: "rgb(
|
|
560
|
+
fill: "rgb(150, 152, 172)",
|
|
561
|
+
highlight: "rgb(150, 152, 172)"
|
|
556
562
|
},
|
|
563
|
+
background: "rgb(255,255,255)",
|
|
557
564
|
text: "rgb(38, 48, 83)",
|
|
558
|
-
textMuted: "rgb(
|
|
559
|
-
textSubtle: "rgb(
|
|
560
|
-
textDisabled: "rgb(
|
|
565
|
+
textMuted: "rgb(107, 113, 136)",
|
|
566
|
+
textSubtle: "rgb(117, 121, 129)",
|
|
567
|
+
textDisabled: "rgb(150, 152, 172)",
|
|
561
568
|
textDecorativeLight: "rgb(168, 185, 212)",
|
|
562
|
-
dividerSubtle: "rgba(
|
|
563
|
-
divider: "rgba(
|
|
564
|
-
dividerStrong: "rgba(
|
|
565
|
-
primary: "rgb(
|
|
569
|
+
dividerSubtle: "rgba(30, 50, 100, 0.04)",
|
|
570
|
+
divider: "rgba(30, 50, 100, 0.07)",
|
|
571
|
+
dividerStrong: "rgba(30, 50, 100, 0.09)",
|
|
572
|
+
primary: "rgb(103, 70, 255)",
|
|
566
573
|
primaryLight: "rgb(147, 86, 255)",
|
|
574
|
+
primaryPastel: "rgba(234, 230, 255)",
|
|
567
575
|
secondary: "rgb(0, 151, 117)",
|
|
568
576
|
secondaryLight: "rgb(0, 160, 129)",
|
|
577
|
+
secondaryPastel: "rgb(205, 238, 231)",
|
|
569
578
|
secondaryBright: "#0ab557",
|
|
570
579
|
warning: "rgb(251, 211, 0)",
|
|
571
580
|
neutralBackground: "rgb(222,223,232)",
|
|
572
|
-
inputBackground: "rgb(240,
|
|
573
|
-
inputBackgroundLight: "rgb(243,
|
|
581
|
+
inputBackground: "rgb(240, 242, 246)",
|
|
582
|
+
inputBackgroundLight: "rgb(243, 245, 249)",
|
|
574
583
|
codeBackground: "rgb(250, 250, 250)",
|
|
575
584
|
codeBackgroundLight: "rgb(250, 250, 250)",
|
|
576
585
|
get codeBackgroundDark() {
|
|
@@ -598,6 +607,7 @@ var colors = {
|
|
|
598
607
|
editingBackground: "#fff"
|
|
599
608
|
},
|
|
600
609
|
canvas: {
|
|
610
|
+
// background: "white",
|
|
601
611
|
background: "rgb(249,249,249)",
|
|
602
612
|
get selectionStroke() {
|
|
603
613
|
return colors.primary;
|
|
@@ -608,8 +618,8 @@ var colors = {
|
|
|
608
618
|
grid: "rgba(0,0,0,0.05)"
|
|
609
619
|
},
|
|
610
620
|
sidebar: {
|
|
611
|
-
background: "rgb(
|
|
612
|
-
backgroundTransparent: "rgba(
|
|
621
|
+
background: "rgb(255,255,255)",
|
|
622
|
+
backgroundTransparent: "rgba(255,255,255,0.85)"
|
|
613
623
|
},
|
|
614
624
|
popover: {
|
|
615
625
|
background: "rgb(252,252,252)",
|
|
@@ -622,7 +632,7 @@ var colors = {
|
|
|
622
632
|
radioGroup: {
|
|
623
633
|
background: "white"
|
|
624
634
|
},
|
|
625
|
-
icon: "rgb(
|
|
635
|
+
icon: "rgb(129, 131, 165)",
|
|
626
636
|
iconSelected: "rgb(220, 220, 220)",
|
|
627
637
|
mask: "rgb(12,193,67)",
|
|
628
638
|
imageOverlay: "linear-gradient(0deg, rgba(132, 63, 255,0.55), rgba(132, 63, 255,0.55))",
|
|
@@ -662,41 +672,41 @@ var textStyles = {
|
|
|
662
672
|
heading1: {
|
|
663
673
|
fontFamily: fonts.normal,
|
|
664
674
|
fontSize: `${typeScale[2]}rem`,
|
|
665
|
-
fontWeight:
|
|
666
|
-
lineHeight: "1.
|
|
675
|
+
fontWeight: 600,
|
|
676
|
+
lineHeight: "1.6",
|
|
667
677
|
letterSpacing: "-0.025em"
|
|
668
678
|
},
|
|
669
679
|
heading2: {
|
|
670
680
|
fontFamily: fonts.normal,
|
|
671
681
|
fontSize: `${typeScale[3]}rem`,
|
|
672
682
|
fontWeight: 500,
|
|
673
|
-
lineHeight: "1.
|
|
683
|
+
lineHeight: "1.5",
|
|
674
684
|
letterSpacing: "-0.025em"
|
|
675
685
|
},
|
|
676
686
|
heading3: {
|
|
677
687
|
fontFamily: fonts.normal,
|
|
678
688
|
fontSize: `${typeScale[4]}rem`,
|
|
679
|
-
fontWeight:
|
|
680
|
-
lineHeight: "1.
|
|
689
|
+
fontWeight: 400,
|
|
690
|
+
lineHeight: "1.4",
|
|
681
691
|
letterSpacing: "-0.025em"
|
|
682
692
|
},
|
|
683
693
|
heading4: {
|
|
684
694
|
fontFamily: fonts.normal,
|
|
685
695
|
fontSize: `${typeScale[5]}rem`,
|
|
686
696
|
fontWeight: 500,
|
|
687
|
-
lineHeight: "1.
|
|
697
|
+
lineHeight: "1.4"
|
|
688
698
|
},
|
|
689
699
|
heading5: {
|
|
690
700
|
fontFamily: fonts.normal,
|
|
691
701
|
fontSize: `${typeScale[6]}rem`,
|
|
692
702
|
fontWeight: 500,
|
|
693
|
-
lineHeight: "1.
|
|
703
|
+
lineHeight: "1.4"
|
|
694
704
|
},
|
|
695
705
|
body: {
|
|
696
706
|
fontFamily: fonts.normal,
|
|
697
707
|
fontSize: `${typeScale[5]}rem`,
|
|
698
708
|
fontWeight: 400,
|
|
699
|
-
lineHeight: "1.
|
|
709
|
+
lineHeight: "1.4"
|
|
700
710
|
},
|
|
701
711
|
small: {
|
|
702
712
|
fontFamily: fonts.normal,
|
|
@@ -798,7 +808,7 @@ import React19, {
|
|
|
798
808
|
useCallback as useCallback12,
|
|
799
809
|
useContext as useContext3,
|
|
800
810
|
useMemo as useMemo7,
|
|
801
|
-
useRef as
|
|
811
|
+
useRef as useRef12,
|
|
802
812
|
useState as useState12
|
|
803
813
|
} from "react";
|
|
804
814
|
import styled13 from "styled-components";
|
|
@@ -890,7 +900,7 @@ var Dialog = forwardRef6(function Dialog2({
|
|
|
890
900
|
title,
|
|
891
901
|
description,
|
|
892
902
|
open,
|
|
893
|
-
style:
|
|
903
|
+
style: style2,
|
|
894
904
|
onOpenChange,
|
|
895
905
|
onOpenAutoFocus,
|
|
896
906
|
closeOnInteractOutside = true
|
|
@@ -908,7 +918,7 @@ var Dialog = forwardRef6(function Dialog2({
|
|
|
908
918
|
{
|
|
909
919
|
ref: contentRef,
|
|
910
920
|
onOpenAutoFocus,
|
|
911
|
-
style:
|
|
921
|
+
style: style2,
|
|
912
922
|
...closeOnInteractOutside === false && {
|
|
913
923
|
onPointerDownOutside: (event) => {
|
|
914
924
|
event.preventDefault();
|
|
@@ -924,7 +934,7 @@ var Dialog = forwardRef6(function Dialog2({
|
|
|
924
934
|
children
|
|
925
935
|
));
|
|
926
936
|
});
|
|
927
|
-
var FullscreenDialog = forwardRef6(function FullscreenDialog2({ style:
|
|
937
|
+
var FullscreenDialog = forwardRef6(function FullscreenDialog2({ style: style2, ...rest }, forwardedRef) {
|
|
928
938
|
return /* @__PURE__ */ React10.createElement(
|
|
929
939
|
Dialog,
|
|
930
940
|
{
|
|
@@ -940,7 +950,7 @@ var FullscreenDialog = forwardRef6(function FullscreenDialog2({ style: style3, .
|
|
|
940
950
|
display: "flex",
|
|
941
951
|
flexDirection: "column",
|
|
942
952
|
padding: 0,
|
|
943
|
-
...
|
|
953
|
+
...style2
|
|
944
954
|
},
|
|
945
955
|
...rest
|
|
946
956
|
}
|
|
@@ -1023,33 +1033,47 @@ var SingleDimensionAutoSizer = memo5(function SingleDimensionAutoSizer2({
|
|
|
1023
1033
|
});
|
|
1024
1034
|
|
|
1025
1035
|
// ../noya-react-utils/src/components/FileDropTarget.tsx
|
|
1026
|
-
import React13, {
|
|
1027
|
-
memo as memo6,
|
|
1028
|
-
useCallback as useCallback3
|
|
1029
|
-
} from "react";
|
|
1036
|
+
import React13, { memo as memo6, useCallback as useCallback3, useRef as useRef3 } from "react";
|
|
1030
1037
|
|
|
1031
1038
|
// ../noya-react-utils/src/hooks/useFileDropTarget.ts
|
|
1032
1039
|
import { useCallback as useCallback2, useState as useState2 } from "react";
|
|
1033
|
-
function useFileDropTarget(dropEvent) {
|
|
1040
|
+
function useFileDropTarget(ref, dropEvent) {
|
|
1034
1041
|
const [isDropTargetActive, setIsDropTargetActive] = useState2(false);
|
|
1035
|
-
const
|
|
1036
|
-
if (on !== void 0)
|
|
1037
|
-
setIsDropTargetActive(on);
|
|
1042
|
+
const handleDragOver = useCallback2((event) => {
|
|
1038
1043
|
event.preventDefault();
|
|
1039
1044
|
}, []);
|
|
1040
|
-
const
|
|
1045
|
+
const handleDragEnter = useCallback2(
|
|
1046
|
+
(event) => {
|
|
1047
|
+
event.preventDefault();
|
|
1048
|
+
if (!ref.current?.contains(event.relatedTarget)) {
|
|
1049
|
+
setIsDropTargetActive(true);
|
|
1050
|
+
}
|
|
1051
|
+
},
|
|
1052
|
+
[ref]
|
|
1053
|
+
);
|
|
1054
|
+
const handleDragLeave = useCallback2(
|
|
1041
1055
|
(event) => {
|
|
1056
|
+
event.preventDefault();
|
|
1057
|
+
if (!ref.current?.contains(event.relatedTarget)) {
|
|
1058
|
+
setIsDropTargetActive(false);
|
|
1059
|
+
}
|
|
1060
|
+
},
|
|
1061
|
+
[ref]
|
|
1062
|
+
);
|
|
1063
|
+
const handleDrop = useCallback2(
|
|
1064
|
+
(event) => {
|
|
1065
|
+
event.preventDefault();
|
|
1042
1066
|
dropEvent(event);
|
|
1043
1067
|
setIsDropTargetActive(false);
|
|
1044
1068
|
},
|
|
1045
|
-
[dropEvent
|
|
1069
|
+
[dropEvent]
|
|
1046
1070
|
);
|
|
1047
1071
|
return {
|
|
1048
1072
|
dropTargetProps: {
|
|
1049
|
-
onDragOver:
|
|
1050
|
-
onDragEnter:
|
|
1051
|
-
onDragLeave:
|
|
1052
|
-
onDrop:
|
|
1073
|
+
onDragOver: handleDragOver,
|
|
1074
|
+
onDragEnter: handleDragEnter,
|
|
1075
|
+
onDragLeave: handleDragLeave,
|
|
1076
|
+
onDrop: handleDrop
|
|
1053
1077
|
},
|
|
1054
1078
|
isDropTargetActive
|
|
1055
1079
|
};
|
|
@@ -1059,12 +1083,13 @@ function useFileDropTarget(dropEvent) {
|
|
|
1059
1083
|
function isSupportedFile(file, supportedFileTypes) {
|
|
1060
1084
|
return supportedFileTypes.includes(file.type) || file.type === "" && file.name.endsWith(".sketch");
|
|
1061
1085
|
}
|
|
1062
|
-
var style2 = { display: "flex", flex: 1 };
|
|
1063
1086
|
var FileDropTarget = memo6(function FileDropTarget2({
|
|
1064
1087
|
children,
|
|
1065
1088
|
onDropFiles,
|
|
1066
|
-
supportedFileTypes
|
|
1089
|
+
supportedFileTypes,
|
|
1090
|
+
...props
|
|
1067
1091
|
}) {
|
|
1092
|
+
const ref = useRef3(null);
|
|
1068
1093
|
const handleFile = useCallback3(
|
|
1069
1094
|
(event) => {
|
|
1070
1095
|
event.preventDefault();
|
|
@@ -1097,13 +1122,16 @@ var FileDropTarget = memo6(function FileDropTarget2({
|
|
|
1097
1122
|
},
|
|
1098
1123
|
[onDropFiles, supportedFileTypes]
|
|
1099
1124
|
);
|
|
1100
|
-
const { dropTargetProps, isDropTargetActive } = useFileDropTarget(
|
|
1101
|
-
|
|
1125
|
+
const { dropTargetProps, isDropTargetActive } = useFileDropTarget(
|
|
1126
|
+
ref,
|
|
1127
|
+
handleFile
|
|
1128
|
+
);
|
|
1129
|
+
return /* @__PURE__ */ React13.createElement("div", { ref, ...dropTargetProps, ...props }, typeof children === "function" ? children(isDropTargetActive) : children);
|
|
1102
1130
|
});
|
|
1103
1131
|
|
|
1104
1132
|
// ../noya-react-utils/src/hooks/useDeepArray.ts
|
|
1105
1133
|
import { isDeepEqual } from "@noya-app/noya-utils";
|
|
1106
|
-
import { useRef as
|
|
1134
|
+
import { useRef as useRef4 } from "react";
|
|
1107
1135
|
|
|
1108
1136
|
// ../noya-react-utils/src/hooks/useDeepState.ts
|
|
1109
1137
|
import { isDeepEqual as isDeepEqual2 } from "@noya-app/noya-utils";
|
|
@@ -1113,13 +1141,13 @@ import { useCallback as useCallback4, useMemo as useMemo2, useState as useState3
|
|
|
1113
1141
|
import { useEffect as useEffect2, useState as useState4 } from "react";
|
|
1114
1142
|
|
|
1115
1143
|
// ../noya-react-utils/src/hooks/useIsMounted.ts
|
|
1116
|
-
import { useEffect as useEffect3, useRef as
|
|
1144
|
+
import { useEffect as useEffect3, useRef as useRef5 } from "react";
|
|
1117
1145
|
|
|
1118
1146
|
// ../noya-react-utils/src/hooks/useLateReference.ts
|
|
1119
|
-
import { useCallback as useCallback5, useLayoutEffect, useRef as
|
|
1147
|
+
import { useCallback as useCallback5, useLayoutEffect, useRef as useRef6 } from "react";
|
|
1120
1148
|
|
|
1121
1149
|
// ../noya-react-utils/src/hooks/useLazyValue.ts
|
|
1122
|
-
import { useRef as
|
|
1150
|
+
import { useRef as useRef7 } from "react";
|
|
1123
1151
|
|
|
1124
1152
|
// ../noya-react-utils/src/hooks/useMutableState.ts
|
|
1125
1153
|
import { useCallback as useCallback6, useMemo as useMemo3, useState as useState5 } from "react";
|
|
@@ -1137,10 +1165,10 @@ import { useEffect as useEffect5, useState as useState7 } from "react";
|
|
|
1137
1165
|
|
|
1138
1166
|
// ../noya-react-utils/src/hooks/useShallowArray.ts
|
|
1139
1167
|
import { isShallowEqual } from "@noya-app/noya-utils";
|
|
1140
|
-
import { useRef as
|
|
1168
|
+
import { useRef as useRef8 } from "react";
|
|
1141
1169
|
|
|
1142
1170
|
// ../noya-react-utils/src/hooks/useStableCallback.ts
|
|
1143
|
-
import { useCallback as useCallback8, useLayoutEffect as useLayoutEffect2, useRef as
|
|
1171
|
+
import { useCallback as useCallback8, useLayoutEffect as useLayoutEffect2, useRef as useRef9 } from "react";
|
|
1144
1172
|
|
|
1145
1173
|
// ../noya-react-utils/src/hooks/useSystemColorScheme.ts
|
|
1146
1174
|
import { useEffect as useEffect6, useState as useState8 } from "react";
|
|
@@ -1249,7 +1277,7 @@ import React18, {
|
|
|
1249
1277
|
useEffect as useEffect10,
|
|
1250
1278
|
useLayoutEffect as useLayoutEffect4,
|
|
1251
1279
|
useMemo as useMemo6,
|
|
1252
|
-
useRef as
|
|
1280
|
+
useRef as useRef11,
|
|
1253
1281
|
useState as useState11
|
|
1254
1282
|
} from "react";
|
|
1255
1283
|
import styled12 from "styled-components";
|
|
@@ -1522,7 +1550,7 @@ import React16, {
|
|
|
1522
1550
|
useCallback as useCallback10,
|
|
1523
1551
|
useEffect as useEffect9,
|
|
1524
1552
|
useLayoutEffect as useLayoutEffect3,
|
|
1525
|
-
useRef as
|
|
1553
|
+
useRef as useRef10,
|
|
1526
1554
|
useState as useState10
|
|
1527
1555
|
} from "react";
|
|
1528
1556
|
|
|
@@ -1630,10 +1658,10 @@ var SubmittableTextInput = forwardRef8(function SubmittableTextInput2({
|
|
|
1630
1658
|
...rest
|
|
1631
1659
|
}, forwardedRef) {
|
|
1632
1660
|
const ref = React16.useRef(null);
|
|
1633
|
-
const latestValue =
|
|
1661
|
+
const latestValue = useRef10(value);
|
|
1634
1662
|
latestValue.current = value;
|
|
1635
|
-
const userDidEdit =
|
|
1636
|
-
const isSubmitTriggeredByEscapeKey =
|
|
1663
|
+
const userDidEdit = useRef10(false);
|
|
1664
|
+
const isSubmitTriggeredByEscapeKey = useRef10(false);
|
|
1637
1665
|
const [internalValue, setInternalValue] = useState10("");
|
|
1638
1666
|
useLayoutEffect3(() => {
|
|
1639
1667
|
setInternalValue(value);
|
|
@@ -1691,10 +1719,10 @@ var SubmittableTextInput = forwardRef8(function SubmittableTextInput2({
|
|
|
1691
1719
|
},
|
|
1692
1720
|
[onFocusCapture, onFocusChange]
|
|
1693
1721
|
);
|
|
1694
|
-
const autoSubmitTimeoutRef =
|
|
1722
|
+
const autoSubmitTimeoutRef = useRef10(
|
|
1695
1723
|
null
|
|
1696
1724
|
);
|
|
1697
|
-
const latestHandleSubmit =
|
|
1725
|
+
const latestHandleSubmit = useRef10(handleSubmit);
|
|
1698
1726
|
latestHandleSubmit.current = handleSubmit;
|
|
1699
1727
|
useEffect9(() => {
|
|
1700
1728
|
if (submitAutomaticallyAfterDelay) {
|
|
@@ -1853,9 +1881,9 @@ var LabelContainer = styled12.label(({ theme, $labelPosition, $hasDropdown, poin
|
|
|
1853
1881
|
}
|
|
1854
1882
|
}));
|
|
1855
1883
|
var InputFieldLabel = memo9(
|
|
1856
|
-
forwardRef9(function InputFieldLabel2({ children = false, pointerEvents = "none", style:
|
|
1884
|
+
forwardRef9(function InputFieldLabel2({ children = false, pointerEvents = "none", style: style2 }, forwardedRef) {
|
|
1857
1885
|
const { labelPosition, hasDropdown, setLabelWidth } = useContext2(InputFieldContext);
|
|
1858
|
-
const ref =
|
|
1886
|
+
const ref = useRef11(null);
|
|
1859
1887
|
useLayoutEffect4(() => {
|
|
1860
1888
|
if (!setLabelWidth)
|
|
1861
1889
|
return;
|
|
@@ -1874,7 +1902,7 @@ var InputFieldLabel = memo9(
|
|
|
1874
1902
|
pointerEvents,
|
|
1875
1903
|
$labelPosition: labelPosition,
|
|
1876
1904
|
$hasDropdown: hasDropdown,
|
|
1877
|
-
style:
|
|
1905
|
+
style: style2
|
|
1878
1906
|
},
|
|
1879
1907
|
children
|
|
1880
1908
|
);
|
|
@@ -2042,34 +2070,34 @@ var InputFieldTypeahead = (props) => {
|
|
|
2042
2070
|
labelSize,
|
|
2043
2071
|
hasDropdown,
|
|
2044
2072
|
hasLabel,
|
|
2045
|
-
size: size2
|
|
2046
|
-
onFocusChange
|
|
2073
|
+
size: size2
|
|
2074
|
+
// onFocusChange,
|
|
2047
2075
|
} = useContext2(InputFieldContext);
|
|
2048
2076
|
return /* @__PURE__ */ React18.createElement(
|
|
2049
2077
|
InputElement,
|
|
2050
2078
|
{
|
|
2079
|
+
as: "span",
|
|
2051
2080
|
$labelPosition: labelPosition,
|
|
2052
2081
|
$labelSize: labelSize,
|
|
2053
2082
|
$hasLabel: hasLabel,
|
|
2054
2083
|
$hasDropdown: hasDropdown,
|
|
2055
2084
|
$size: size2,
|
|
2056
|
-
onFocusChange,
|
|
2057
|
-
readOnly: true,
|
|
2058
|
-
placeholder: props.value,
|
|
2059
2085
|
value: "",
|
|
2060
2086
|
style: {
|
|
2061
2087
|
position: "absolute",
|
|
2062
|
-
top:
|
|
2088
|
+
top: 0,
|
|
2063
2089
|
left: 0,
|
|
2064
2090
|
right: 0,
|
|
2065
|
-
bottom:
|
|
2091
|
+
bottom: 0,
|
|
2066
2092
|
width: "100%",
|
|
2067
2093
|
height: "100%",
|
|
2068
2094
|
pointerEvents: "none",
|
|
2069
2095
|
background: "transparent",
|
|
2070
2096
|
boxShadow: "none"
|
|
2071
2097
|
}
|
|
2072
|
-
}
|
|
2098
|
+
},
|
|
2099
|
+
/* @__PURE__ */ React18.createElement("span", { style: { opacity: 0 } }, props.prefix),
|
|
2100
|
+
/* @__PURE__ */ React18.createElement("span", { style: { opacity: 0.5 } }, props.value.slice(props.prefix.length))
|
|
2073
2101
|
);
|
|
2074
2102
|
};
|
|
2075
2103
|
function parseNumber(value) {
|
|
@@ -2157,7 +2185,7 @@ function InputFieldRoot({
|
|
|
2157
2185
|
size: size2 = "medium",
|
|
2158
2186
|
renderPopoverContent,
|
|
2159
2187
|
onFocusChange,
|
|
2160
|
-
style:
|
|
2188
|
+
style: style2,
|
|
2161
2189
|
className
|
|
2162
2190
|
}) {
|
|
2163
2191
|
const childrenArray = Children3.toArray(children);
|
|
@@ -2216,7 +2244,7 @@ function InputFieldRoot({
|
|
|
2216
2244
|
id,
|
|
2217
2245
|
$width: width,
|
|
2218
2246
|
$flex: flex,
|
|
2219
|
-
style:
|
|
2247
|
+
style: style2,
|
|
2220
2248
|
className
|
|
2221
2249
|
},
|
|
2222
2250
|
children
|
|
@@ -2240,6 +2268,35 @@ function InputFieldRoot({
|
|
|
2240
2268
|
measuredWidth && /* @__PURE__ */ React18.createElement(Stack.V, { width: measuredWidth, overflow: "hidden" }, renderPopoverContent({ width: measuredWidth }))
|
|
2241
2269
|
) : rootElement);
|
|
2242
2270
|
}
|
|
2271
|
+
var PrimitiveInputField = styled12.input(({ theme, readOnly, disabled }) => {
|
|
2272
|
+
return {
|
|
2273
|
+
// placeholder
|
|
2274
|
+
"&::placeholder": {
|
|
2275
|
+
color: theme.colors.textDisabled
|
|
2276
|
+
},
|
|
2277
|
+
...theme.textStyles.small,
|
|
2278
|
+
color: readOnly ? theme.colors.textMuted : disabled ? theme.colors.textDisabled : theme.colors.text,
|
|
2279
|
+
width: "0px",
|
|
2280
|
+
// Reset intrinsic width
|
|
2281
|
+
flex: "1 1 0px",
|
|
2282
|
+
position: "relative",
|
|
2283
|
+
border: "0",
|
|
2284
|
+
outline: "none",
|
|
2285
|
+
minWidth: "0",
|
|
2286
|
+
alignSelf: "stretch",
|
|
2287
|
+
borderRadius: "4px",
|
|
2288
|
+
paddingTop: "4px",
|
|
2289
|
+
paddingBottom: "4px",
|
|
2290
|
+
paddingLeft: "6px",
|
|
2291
|
+
paddingRight: "6px",
|
|
2292
|
+
background: theme.colors.inputBackground,
|
|
2293
|
+
"&:focus": {
|
|
2294
|
+
boxShadow: `0 0 0 2px ${theme.colors.primary}`
|
|
2295
|
+
},
|
|
2296
|
+
userSelect: "all",
|
|
2297
|
+
pointerEvents: "all"
|
|
2298
|
+
};
|
|
2299
|
+
});
|
|
2243
2300
|
var InputField;
|
|
2244
2301
|
((InputField2) => {
|
|
2245
2302
|
InputField2.Root = memo9(InputFieldRoot);
|
|
@@ -2249,6 +2306,7 @@ var InputField;
|
|
|
2249
2306
|
InputField2.DropdownMenu = InputFieldDropdownMenu;
|
|
2250
2307
|
InputField2.Button = InputFieldButton;
|
|
2251
2308
|
InputField2.Label = InputFieldLabel;
|
|
2309
|
+
InputField2.PrimitiveElement = PrimitiveInputField;
|
|
2252
2310
|
})(InputField || (InputField = {}));
|
|
2253
2311
|
|
|
2254
2312
|
// src/contexts/DialogContext.tsx
|
|
@@ -2311,8 +2369,8 @@ var DialogProvider = function DialogProvider2({
|
|
|
2311
2369
|
},
|
|
2312
2370
|
[submit]
|
|
2313
2371
|
);
|
|
2314
|
-
const inputRef =
|
|
2315
|
-
const dialogRef =
|
|
2372
|
+
const inputRef = useRef12(null);
|
|
2373
|
+
const dialogRef = useRef12(null);
|
|
2316
2374
|
const containsElement = useCallback12((element) => {
|
|
2317
2375
|
if (!dialogRef.current)
|
|
2318
2376
|
return false;
|
|
@@ -2583,7 +2641,7 @@ function useHover(props = {}) {
|
|
|
2583
2641
|
// src/components/Chip.tsx
|
|
2584
2642
|
var ChipElement = styled14.span(({ theme, $colorScheme, $size, $variant, $monospace, $isInteractive }) => {
|
|
2585
2643
|
const color = $colorScheme === "primary" ? theme.colors.primary : $colorScheme === "secondary" ? theme.colors.secondary : theme.colors.text;
|
|
2586
|
-
const backgroundColor = $colorScheme === "primary" ?
|
|
2644
|
+
const backgroundColor = $colorScheme === "primary" ? theme.colors.primaryPastel : $colorScheme === "secondary" ? theme.colors.secondaryPastel : $colorScheme === "error" ? "rgb(255, 219, 219)" : theme.colors.inputBackground;
|
|
2587
2645
|
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)";
|
|
2588
2646
|
return {
|
|
2589
2647
|
textTransform: "initial",
|
|
@@ -2594,9 +2652,12 @@ var ChipElement = styled14.span(({ theme, $colorScheme, $size, $variant, $monosp
|
|
|
2594
2652
|
// lineHeight: "1.4",
|
|
2595
2653
|
lineHeight: "15px",
|
|
2596
2654
|
whiteSpace: "pre",
|
|
2597
|
-
...$size === "
|
|
2655
|
+
...$size === "large" ? {
|
|
2598
2656
|
fontSize: "11px",
|
|
2599
2657
|
padding: "4px 8px"
|
|
2658
|
+
} : $size === "medium" ? {
|
|
2659
|
+
fontSize: "10px",
|
|
2660
|
+
padding: "2px 6px"
|
|
2600
2661
|
} : {
|
|
2601
2662
|
fontSize: "9px",
|
|
2602
2663
|
padding: "0px 4px"
|
|
@@ -2631,7 +2692,7 @@ var DeleteElement = styled14(Cross1Icon)(({ size: size2 }) => ({
|
|
|
2631
2692
|
marginRight: "-2px",
|
|
2632
2693
|
cursor: "pointer",
|
|
2633
2694
|
opacity: 0.5,
|
|
2634
|
-
...size2 === "
|
|
2695
|
+
...size2 === "large" ? {
|
|
2635
2696
|
marginLeft: "2px",
|
|
2636
2697
|
// top: '-1px',
|
|
2637
2698
|
transform: "scale(0.75)"
|
|
@@ -2650,7 +2711,7 @@ var AddElement = styled14(PlusIcon).withConfig({
|
|
|
2650
2711
|
marginLeft: "-2px",
|
|
2651
2712
|
cursor: "pointer",
|
|
2652
2713
|
opacity: 0.5,
|
|
2653
|
-
...size2 === "
|
|
2714
|
+
...size2 === "large" ? {
|
|
2654
2715
|
marginRight: "2px",
|
|
2655
2716
|
top: "-1px",
|
|
2656
2717
|
transform: "scale(0.75)"
|
|
@@ -2669,8 +2730,8 @@ var Chip = memo11(
|
|
|
2669
2730
|
deletable,
|
|
2670
2731
|
addable,
|
|
2671
2732
|
clickable,
|
|
2672
|
-
style:
|
|
2673
|
-
size: size2 = "
|
|
2733
|
+
style: style2,
|
|
2734
|
+
size: size2 = "large",
|
|
2674
2735
|
variant = "solid",
|
|
2675
2736
|
monospace = false,
|
|
2676
2737
|
tabIndex,
|
|
@@ -2692,7 +2753,7 @@ var Chip = memo11(
|
|
|
2692
2753
|
ref: forwardedRef,
|
|
2693
2754
|
$variant: variant,
|
|
2694
2755
|
$colorScheme: colorScheme,
|
|
2695
|
-
style:
|
|
2756
|
+
style: style2,
|
|
2696
2757
|
onClick: handleClick,
|
|
2697
2758
|
$size: size2,
|
|
2698
2759
|
$monospace: monospace,
|
|
@@ -3514,7 +3575,7 @@ var FillInputField = memo17(
|
|
|
3514
3575
|
);
|
|
3515
3576
|
|
|
3516
3577
|
// src/components/FloatingWindow.tsx
|
|
3517
|
-
import React30, { useCallback as useCallback15, useRef as
|
|
3578
|
+
import React30, { useCallback as useCallback15, useRef as useRef14, useState as useState17 } from "react";
|
|
3518
3579
|
var styles2 = {
|
|
3519
3580
|
noSelect: {
|
|
3520
3581
|
userSelect: "none",
|
|
@@ -3641,7 +3702,7 @@ var FloatingWindow = ({
|
|
|
3641
3702
|
const [isResizing, setIsResizing] = useState17(false);
|
|
3642
3703
|
const [dragOffset, setDragOffset] = useState17({ x: 0, y: 0 });
|
|
3643
3704
|
const [resizeDirection, setResizeDirection] = useState17(null);
|
|
3644
|
-
const wrapperRef =
|
|
3705
|
+
const wrapperRef = useRef14(null);
|
|
3645
3706
|
const toggleGlobalTextSelection = (disable) => {
|
|
3646
3707
|
if (disable) {
|
|
3647
3708
|
document.body.style.userSelect = "none";
|
|
@@ -3771,11 +3832,11 @@ var FloatingWindow = ({
|
|
|
3771
3832
|
),
|
|
3772
3833
|
/* @__PURE__ */ React30.createElement(Divider, null),
|
|
3773
3834
|
/* @__PURE__ */ React30.createElement("div", { style: styles2.content }, children),
|
|
3774
|
-
Object.entries(resizeHandlePositions).map(([direction,
|
|
3835
|
+
Object.entries(resizeHandlePositions).map(([direction, style2]) => /* @__PURE__ */ React30.createElement(
|
|
3775
3836
|
"div",
|
|
3776
3837
|
{
|
|
3777
3838
|
key: direction,
|
|
3778
|
-
style: { ...styles2.resizeHandle, ...
|
|
3839
|
+
style: { ...styles2.resizeHandle, ...style2 },
|
|
3779
3840
|
onMouseDown: handleResizeStart(direction)
|
|
3780
3841
|
}
|
|
3781
3842
|
))
|
|
@@ -4128,7 +4189,7 @@ var GridViewItem = forwardRef12(function GridViewItem2({
|
|
|
4128
4189
|
menuItems,
|
|
4129
4190
|
onSelectMenuItem,
|
|
4130
4191
|
onContextMenu,
|
|
4131
|
-
style:
|
|
4192
|
+
style: style2
|
|
4132
4193
|
}, forwardedRef) {
|
|
4133
4194
|
const [hovered, setHovered] = React33.useState(false);
|
|
4134
4195
|
const { hoverProps } = useHover({
|
|
@@ -4178,7 +4239,7 @@ var GridViewItem = forwardRef12(function GridViewItem2({
|
|
|
4178
4239
|
onClick: handleClick,
|
|
4179
4240
|
onDoubleClick,
|
|
4180
4241
|
onContextMenu,
|
|
4181
|
-
style:
|
|
4242
|
+
style: style2
|
|
4182
4243
|
},
|
|
4183
4244
|
children
|
|
4184
4245
|
),
|
|
@@ -4266,7 +4327,7 @@ import React37, {
|
|
|
4266
4327
|
useImperativeHandle as useImperativeHandle3,
|
|
4267
4328
|
useLayoutEffect as useLayoutEffect7,
|
|
4268
4329
|
useMemo as useMemo19,
|
|
4269
|
-
useRef as
|
|
4330
|
+
useRef as useRef17,
|
|
4270
4331
|
useState as useState20
|
|
4271
4332
|
} from "react";
|
|
4272
4333
|
import styled25 from "styled-components";
|
|
@@ -4356,7 +4417,7 @@ import React35, {
|
|
|
4356
4417
|
useImperativeHandle as useImperativeHandle2,
|
|
4357
4418
|
useLayoutEffect as useLayoutEffect6,
|
|
4358
4419
|
useMemo as useMemo18,
|
|
4359
|
-
useRef as
|
|
4420
|
+
useRef as useRef16
|
|
4360
4421
|
} from "react";
|
|
4361
4422
|
import { WindowScroller } from "react-virtualized";
|
|
4362
4423
|
import { VariableSizeList } from "react-window";
|
|
@@ -4406,7 +4467,7 @@ import React34, {
|
|
|
4406
4467
|
useContext as useContext8,
|
|
4407
4468
|
useEffect as useEffect13,
|
|
4408
4469
|
useMemo as useMemo17,
|
|
4409
|
-
useRef as
|
|
4470
|
+
useRef as useRef15,
|
|
4410
4471
|
useState as useState19
|
|
4411
4472
|
} from "react";
|
|
4412
4473
|
import { createPortal as createPortal2 } from "react-dom";
|
|
@@ -4496,7 +4557,7 @@ function SortableRoot({
|
|
|
4496
4557
|
})
|
|
4497
4558
|
);
|
|
4498
4559
|
const [activeIndex, setActiveIndex] = useState19();
|
|
4499
|
-
const activatorEvent =
|
|
4560
|
+
const activatorEvent = useRef15(null);
|
|
4500
4561
|
const setActivatorEvent = useCallback19((event) => {
|
|
4501
4562
|
activatorEvent.current = event;
|
|
4502
4563
|
}, []);
|
|
@@ -4581,9 +4642,10 @@ var Sortable;
|
|
|
4581
4642
|
// src/components/ListView.tsx
|
|
4582
4643
|
var ROW_HEIGHT = 31;
|
|
4583
4644
|
var SECTION_HEADER_LABEL_HEIGHT = 27;
|
|
4584
|
-
var
|
|
4645
|
+
var ListViewDraggingContext = createContext9({
|
|
4585
4646
|
indentation: 12
|
|
4586
4647
|
});
|
|
4648
|
+
ListViewDraggingContext.displayName = "ListViewDraggingContext";
|
|
4587
4649
|
var ListRowContext = createContext9({
|
|
4588
4650
|
marginType: "none",
|
|
4589
4651
|
selectedPosition: "only",
|
|
@@ -4597,6 +4659,7 @@ var ListRowContext = createContext9({
|
|
|
4597
4659
|
isSectionHeader: false,
|
|
4598
4660
|
colorScheme: "primary"
|
|
4599
4661
|
});
|
|
4662
|
+
ListRowContext.displayName = "ListRowContext";
|
|
4600
4663
|
var ListViewRowTitle = styled23.span(({ theme }) => ({
|
|
4601
4664
|
flex: "1 1 0",
|
|
4602
4665
|
overflow: "hidden",
|
|
@@ -4614,7 +4677,7 @@ function ListViewEditableRowTitle({
|
|
|
4614
4677
|
autoFocus,
|
|
4615
4678
|
placeholder
|
|
4616
4679
|
}) {
|
|
4617
|
-
const inputRef =
|
|
4680
|
+
const inputRef = useRef16(null);
|
|
4618
4681
|
useLayoutEffect6(() => {
|
|
4619
4682
|
const element = inputRef.current;
|
|
4620
4683
|
if (!element || !autoFocus)
|
|
@@ -4766,8 +4829,9 @@ var ListViewRow = forwardRef13(function ListViewRow2({
|
|
|
4766
4829
|
onSelectMenuItem,
|
|
4767
4830
|
onMenuOpenChange,
|
|
4768
4831
|
onKeyDown,
|
|
4769
|
-
style:
|
|
4770
|
-
dragIndicatorStyle
|
|
4832
|
+
style: style2,
|
|
4833
|
+
dragIndicatorStyle,
|
|
4834
|
+
className
|
|
4771
4835
|
}, forwardedRef) {
|
|
4772
4836
|
depth = Math.max(0, depth);
|
|
4773
4837
|
const {
|
|
@@ -4784,7 +4848,7 @@ var ListViewRow = forwardRef13(function ListViewRow2({
|
|
|
4784
4848
|
const { hoverProps } = useHover({
|
|
4785
4849
|
onHoverChange
|
|
4786
4850
|
});
|
|
4787
|
-
const { indentation, isDragging } = useContext9(
|
|
4851
|
+
const { indentation, isDragging } = useContext9(ListViewDraggingContext);
|
|
4788
4852
|
const handlePress = useCallback20(
|
|
4789
4853
|
(event) => {
|
|
4790
4854
|
event.preventDefault();
|
|
@@ -4806,9 +4870,9 @@ var ListViewRow = forwardRef13(function ListViewRow2({
|
|
|
4806
4870
|
// TODO: Where do these offsets actually come from?
|
|
4807
4871
|
transform: `translate3d(-36px, -6px, 0)`,
|
|
4808
4872
|
width: `calc(100% + 48px)`,
|
|
4809
|
-
...
|
|
4810
|
-
} :
|
|
4811
|
-
}, [isDragging,
|
|
4873
|
+
...style2
|
|
4874
|
+
} : style2;
|
|
4875
|
+
}, [isDragging, style2]);
|
|
4812
4876
|
const renderContent = ({
|
|
4813
4877
|
relativeDropPosition,
|
|
4814
4878
|
...renderProps
|
|
@@ -4843,7 +4907,8 @@ var ListViewRow = forwardRef13(function ListViewRow2({
|
|
|
4843
4907
|
{ onPointerDown: renderProps.onPointerDown },
|
|
4844
4908
|
{ [pressEventName]: handlePress }
|
|
4845
4909
|
),
|
|
4846
|
-
tabIndex
|
|
4910
|
+
tabIndex,
|
|
4911
|
+
className
|
|
4847
4912
|
},
|
|
4848
4913
|
relativeDropPosition && /* @__PURE__ */ React35.createElement(
|
|
4849
4914
|
ListViewDragIndicatorElement,
|
|
@@ -4886,12 +4951,13 @@ var ListViewRow = forwardRef13(function ListViewRow2({
|
|
|
4886
4951
|
var RenderItemContext = createContext9(
|
|
4887
4952
|
() => null
|
|
4888
4953
|
);
|
|
4954
|
+
RenderItemContext.displayName = "RenderItemContext";
|
|
4889
4955
|
var VirtualizedListRow = memo22(function VirtualizedListRow2({
|
|
4890
4956
|
index,
|
|
4891
|
-
style:
|
|
4957
|
+
style: style2
|
|
4892
4958
|
}) {
|
|
4893
4959
|
const renderItem = useContext9(RenderItemContext);
|
|
4894
|
-
return /* @__PURE__ */ React35.createElement("div", { key: index, style:
|
|
4960
|
+
return /* @__PURE__ */ React35.createElement("div", { key: index, style: style2 }, renderItem(index));
|
|
4895
4961
|
});
|
|
4896
4962
|
var VirtualizedListInner = forwardRef13(function VirtualizedListInner2({
|
|
4897
4963
|
size: size2,
|
|
@@ -4901,7 +4967,7 @@ var VirtualizedListInner = forwardRef13(function VirtualizedListInner2({
|
|
|
4901
4967
|
keyExtractor,
|
|
4902
4968
|
renderItem
|
|
4903
4969
|
}, ref) {
|
|
4904
|
-
const listRef =
|
|
4970
|
+
const listRef = useRef16(null);
|
|
4905
4971
|
useImperativeHandle2(ref, () => ({
|
|
4906
4972
|
scrollToIndex(index) {
|
|
4907
4973
|
listRef.current?.scrollToItem(index);
|
|
@@ -4977,7 +5043,7 @@ var RootContainer2 = styled23.div(({ theme, $scrollable, $gap }) => ({
|
|
|
4977
5043
|
var ListViewRootInner = forwardRef13(function ListViewRootInner2({
|
|
4978
5044
|
id,
|
|
4979
5045
|
className,
|
|
4980
|
-
style:
|
|
5046
|
+
style: style2,
|
|
4981
5047
|
onPress,
|
|
4982
5048
|
scrollable = false,
|
|
4983
5049
|
expandable = true,
|
|
@@ -5010,8 +5076,26 @@ var ListViewRootInner = forwardRef13(function ListViewRootInner2({
|
|
|
5010
5076
|
(index) => renderItem(data[index], index, { isDragging: false }),
|
|
5011
5077
|
[data, renderItem]
|
|
5012
5078
|
);
|
|
5079
|
+
const defaultContextValue = useMemo18(
|
|
5080
|
+
() => ({
|
|
5081
|
+
colorScheme,
|
|
5082
|
+
marginType: "none",
|
|
5083
|
+
selectedPosition: "only",
|
|
5084
|
+
sortable,
|
|
5085
|
+
expandable,
|
|
5086
|
+
divider,
|
|
5087
|
+
pressEventName,
|
|
5088
|
+
variant,
|
|
5089
|
+
gap,
|
|
5090
|
+
sectionHeaderVariant: "normal",
|
|
5091
|
+
isSectionHeader: false
|
|
5092
|
+
}),
|
|
5093
|
+
[colorScheme, sortable, expandable, divider, pressEventName, variant, gap]
|
|
5094
|
+
);
|
|
5013
5095
|
const getItemContextValue = useCallback20(
|
|
5014
5096
|
(i) => {
|
|
5097
|
+
if (variant === "bare" || variant === "normal")
|
|
5098
|
+
return defaultContextValue;
|
|
5015
5099
|
const current = renderChild(i);
|
|
5016
5100
|
if (!isValidElement3(current))
|
|
5017
5101
|
return;
|
|
@@ -5058,6 +5142,8 @@ var ListViewRootInner = forwardRef13(function ListViewRootInner2({
|
|
|
5058
5142
|
};
|
|
5059
5143
|
},
|
|
5060
5144
|
[
|
|
5145
|
+
variant,
|
|
5146
|
+
defaultContextValue,
|
|
5061
5147
|
renderChild,
|
|
5062
5148
|
data.length,
|
|
5063
5149
|
colorScheme,
|
|
@@ -5065,7 +5151,6 @@ var ListViewRootInner = forwardRef13(function ListViewRootInner2({
|
|
|
5065
5151
|
expandable,
|
|
5066
5152
|
divider,
|
|
5067
5153
|
pressEventName,
|
|
5068
|
-
variant,
|
|
5069
5154
|
sectionHeaderVariant,
|
|
5070
5155
|
gap
|
|
5071
5156
|
]
|
|
@@ -5075,7 +5160,7 @@ var ListViewRootInner = forwardRef13(function ListViewRootInner2({
|
|
|
5075
5160
|
[indentation]
|
|
5076
5161
|
);
|
|
5077
5162
|
const renderOverlay = useCallback20(
|
|
5078
|
-
(index) => /* @__PURE__ */ React35.createElement("div", { style: { opacity: 0.25 } }, /* @__PURE__ */ React35.createElement(
|
|
5163
|
+
(index) => /* @__PURE__ */ React35.createElement("div", { style: { opacity: 0.25 } }, /* @__PURE__ */ React35.createElement(ListViewDraggingContext.Provider, { value: draggingContextOverlayValue }, renderItem(data[index], index, { isDragging: true }))),
|
|
5079
5164
|
[draggingContextOverlayValue, renderItem, data]
|
|
5080
5165
|
);
|
|
5081
5166
|
const renderWrappedChild = useCallback20(
|
|
@@ -5114,12 +5199,12 @@ var ListViewRootInner = forwardRef13(function ListViewRootInner2({
|
|
|
5114
5199
|
[data, keyExtractor]
|
|
5115
5200
|
);
|
|
5116
5201
|
const draggingContextValue = useMemo18(() => ({ indentation }), [indentation]);
|
|
5117
|
-
return /* @__PURE__ */ React35.createElement(
|
|
5202
|
+
return /* @__PURE__ */ React35.createElement(ListViewDraggingContext.Provider, { value: draggingContextValue }, /* @__PURE__ */ React35.createElement(
|
|
5118
5203
|
RootContainer2,
|
|
5119
5204
|
{
|
|
5120
5205
|
id,
|
|
5121
5206
|
className,
|
|
5122
|
-
style:
|
|
5207
|
+
style: style2,
|
|
5123
5208
|
...{
|
|
5124
5209
|
[pressEventName]: handleClick
|
|
5125
5210
|
},
|
|
@@ -5225,6 +5310,7 @@ var Text = forwardRef14(function Text2({
|
|
|
5225
5310
|
tabIndex,
|
|
5226
5311
|
onClick,
|
|
5227
5312
|
onKeyDown,
|
|
5313
|
+
style: style2,
|
|
5228
5314
|
...rest
|
|
5229
5315
|
}, forwardedRef) {
|
|
5230
5316
|
const element = as ?? elements[variant] ?? "span";
|
|
@@ -5234,6 +5320,7 @@ var Text = forwardRef14(function Text2({
|
|
|
5234
5320
|
ref: forwardedRef,
|
|
5235
5321
|
as: element,
|
|
5236
5322
|
className,
|
|
5323
|
+
style: style2,
|
|
5237
5324
|
tabIndex,
|
|
5238
5325
|
$variant: variant,
|
|
5239
5326
|
$breakpoints: breakpoints,
|
|
@@ -5368,13 +5455,13 @@ var InputFieldWithCompletions = memo23(
|
|
|
5368
5455
|
onFocus,
|
|
5369
5456
|
onBlur,
|
|
5370
5457
|
onDeleteWhenEmpty,
|
|
5371
|
-
style:
|
|
5458
|
+
style: style2,
|
|
5372
5459
|
className,
|
|
5373
5460
|
children,
|
|
5374
5461
|
hideChildrenWhenFocused = false,
|
|
5375
5462
|
hideMenuWhenEmptyValue = false
|
|
5376
5463
|
}, forwardedRef) {
|
|
5377
|
-
const ref =
|
|
5464
|
+
const ref = useRef17(null);
|
|
5378
5465
|
const [isFocused, setIsFocused] = useState20(false);
|
|
5379
5466
|
const [state, _setState] = useState20({
|
|
5380
5467
|
filter: initialValue,
|
|
@@ -5409,7 +5496,7 @@ var InputFieldWithCompletions = memo23(
|
|
|
5409
5496
|
},
|
|
5410
5497
|
[items, onChange, onHoverItem, state]
|
|
5411
5498
|
);
|
|
5412
|
-
const initialValueRef =
|
|
5499
|
+
const initialValueRef = useRef17(initialValue);
|
|
5413
5500
|
useLayoutEffect7(() => {
|
|
5414
5501
|
if (initialValueRef.current === initialValue)
|
|
5415
5502
|
return;
|
|
@@ -5439,7 +5526,7 @@ var InputFieldWithCompletions = memo23(
|
|
|
5439
5526
|
listRef.current.scrollToIndex(selectedIndex);
|
|
5440
5527
|
}
|
|
5441
5528
|
}, [selectedIndex]);
|
|
5442
|
-
const lastSubmittedValueRef =
|
|
5529
|
+
const lastSubmittedValueRef = useRef17(void 0);
|
|
5443
5530
|
const selectItem = useCallback21(
|
|
5444
5531
|
(item) => {
|
|
5445
5532
|
if (item.type === "sectionHeader")
|
|
@@ -5593,7 +5680,7 @@ var InputFieldWithCompletions = memo23(
|
|
|
5593
5680
|
onBlur: handleBlur,
|
|
5594
5681
|
onFocusCapture: handleFocus,
|
|
5595
5682
|
onKeyDown: handleKeyDown,
|
|
5596
|
-
style:
|
|
5683
|
+
style: style2,
|
|
5597
5684
|
className,
|
|
5598
5685
|
autoCapitalize: "off",
|
|
5599
5686
|
autoComplete: "off",
|
|
@@ -5606,7 +5693,7 @@ var InputFieldWithCompletions = memo23(
|
|
|
5606
5693
|
"aria-controls": "component-listbox"
|
|
5607
5694
|
}
|
|
5608
5695
|
),
|
|
5609
|
-
filter && typeaheadValue && typeaheadValue.startsWith(filter) && /* @__PURE__ */ React37.createElement(InputField.Typeahead, { value: typeaheadValue }),
|
|
5696
|
+
filter && typeaheadValue && typeaheadValue.toLowerCase().startsWith(filter.toLowerCase()) && /* @__PURE__ */ React37.createElement(InputField.Typeahead, { value: typeaheadValue, prefix: filter }),
|
|
5610
5697
|
(!isFocused || !hideChildrenWhenFocused) && children,
|
|
5611
5698
|
loading && isFocused && /* @__PURE__ */ React37.createElement(InputField.Label, null, /* @__PURE__ */ React37.createElement(ActivityIndicator, null))
|
|
5612
5699
|
);
|
|
@@ -5639,7 +5726,7 @@ var InspectorContainer = memo24(
|
|
|
5639
5726
|
showDividers,
|
|
5640
5727
|
id,
|
|
5641
5728
|
className,
|
|
5642
|
-
style:
|
|
5729
|
+
style: style2
|
|
5643
5730
|
}, forwardedRef) {
|
|
5644
5731
|
const theme = useDesignSystemTheme();
|
|
5645
5732
|
return /* @__PURE__ */ React38.createElement(
|
|
@@ -5653,7 +5740,7 @@ var InspectorContainer = memo24(
|
|
|
5653
5740
|
flexDirection: "column",
|
|
5654
5741
|
position: "relative",
|
|
5655
5742
|
background: theme.colors.sidebar.background,
|
|
5656
|
-
...
|
|
5743
|
+
...style2
|
|
5657
5744
|
}
|
|
5658
5745
|
},
|
|
5659
5746
|
header,
|
|
@@ -5710,7 +5797,7 @@ import React40, {
|
|
|
5710
5797
|
memo as memo26,
|
|
5711
5798
|
useLayoutEffect as useLayoutEffect8,
|
|
5712
5799
|
useMemo as useMemo20,
|
|
5713
|
-
useRef as
|
|
5800
|
+
useRef as useRef18
|
|
5714
5801
|
} from "react";
|
|
5715
5802
|
import styled27 from "styled-components";
|
|
5716
5803
|
var Container4 = styled27.div(({ theme }) => ({
|
|
@@ -5740,7 +5827,7 @@ var LabeledElementView = memo26(function LabeledElementView2({
|
|
|
5740
5827
|
(child) => isValidElement4(child) && "id" in child.props ? child.props.id : null
|
|
5741
5828
|
).filter((id) => !!id);
|
|
5742
5829
|
const serializedIds = elementIds.join(",");
|
|
5743
|
-
const containerRef =
|
|
5830
|
+
const containerRef = useRef18(null);
|
|
5744
5831
|
const refs = useMemo20(() => {
|
|
5745
5832
|
return Object.fromEntries(
|
|
5746
5833
|
serializedIds.split(",").map((id) => [id, createRef()])
|
|
@@ -5987,7 +6074,7 @@ import React43, {
|
|
|
5987
6074
|
useContext as useContext11,
|
|
5988
6075
|
useEffect as useEffect15,
|
|
5989
6076
|
useMemo as useMemo22,
|
|
5990
|
-
useRef as
|
|
6077
|
+
useRef as useRef19
|
|
5991
6078
|
} from "react";
|
|
5992
6079
|
import styled30 from "styled-components";
|
|
5993
6080
|
var SelectContext = createContext11(void 0);
|
|
@@ -6088,7 +6175,7 @@ var Select = memo28(function Select2({
|
|
|
6088
6175
|
)) : children,
|
|
6089
6176
|
[children, getTitle, onChange, options]
|
|
6090
6177
|
);
|
|
6091
|
-
const listeners =
|
|
6178
|
+
const listeners = useRef19(/* @__PURE__ */ new Map());
|
|
6092
6179
|
const contextValue = useMemo22(
|
|
6093
6180
|
() => ({
|
|
6094
6181
|
addListener: (value2, listener) => listeners.current.set(value2, listener),
|
|
@@ -6117,20 +6204,43 @@ import { DropdownChevronIcon } from "@noya-app/noya-icons";
|
|
|
6117
6204
|
import * as Select3 from "@radix-ui/react-select";
|
|
6118
6205
|
import React44, { memo as memo29 } from "react";
|
|
6119
6206
|
import { styled as styled31 } from "styled-components";
|
|
6207
|
+
var readOnlyStyle = {
|
|
6208
|
+
justifyContent: "flex-start",
|
|
6209
|
+
textAlign: "left"
|
|
6210
|
+
};
|
|
6211
|
+
var flexStyle = {
|
|
6212
|
+
flex: 1
|
|
6213
|
+
};
|
|
6120
6214
|
var SelectMenu = memo29(function SelectMenu2({
|
|
6121
6215
|
id,
|
|
6122
|
-
style:
|
|
6216
|
+
style: style2,
|
|
6123
6217
|
className,
|
|
6124
6218
|
menuItems,
|
|
6125
6219
|
value,
|
|
6126
6220
|
onSelect,
|
|
6127
|
-
placeholder
|
|
6221
|
+
placeholder,
|
|
6222
|
+
disabled,
|
|
6223
|
+
readOnly
|
|
6128
6224
|
}) {
|
|
6129
6225
|
const selectedItem = menuItems.find(
|
|
6130
6226
|
(item) => typeof item !== "string" && item.value === value
|
|
6131
6227
|
);
|
|
6132
6228
|
const icon = selectedItem?.icon;
|
|
6133
|
-
|
|
6229
|
+
if (readOnly) {
|
|
6230
|
+
return /* @__PURE__ */ React44.createElement(
|
|
6231
|
+
Button,
|
|
6232
|
+
{
|
|
6233
|
+
id,
|
|
6234
|
+
style: style2,
|
|
6235
|
+
contentStyle: readOnlyStyle,
|
|
6236
|
+
className,
|
|
6237
|
+
disabled
|
|
6238
|
+
},
|
|
6239
|
+
icon && /* @__PURE__ */ React44.createElement(React44.Fragment, null, renderIcon(icon), /* @__PURE__ */ React44.createElement(Spacer.Horizontal, { inline: true, size: 6 })),
|
|
6240
|
+
/* @__PURE__ */ React44.createElement("span", { style: flexStyle }, selectedItem?.title ?? value)
|
|
6241
|
+
);
|
|
6242
|
+
}
|
|
6243
|
+
return /* @__PURE__ */ React44.createElement(Select3.Root, { value, onValueChange: onSelect }, /* @__PURE__ */ React44.createElement(Select3.SelectTrigger, { asChild: true }, /* @__PURE__ */ React44.createElement(Button, { id, style: style2, className, disabled }, icon && /* @__PURE__ */ React44.createElement(React44.Fragment, null, renderIcon(icon), /* @__PURE__ */ React44.createElement(Spacer.Horizontal, { inline: true, size: 6 })), /* @__PURE__ */ React44.createElement("span", { style: flexStyle }, /* @__PURE__ */ React44.createElement(Select3.Value, { placeholder })), /* @__PURE__ */ React44.createElement(Spacer.Horizontal, { inline: true, size: 6 }), /* @__PURE__ */ React44.createElement(DropdownChevronIcon, null))), /* @__PURE__ */ React44.createElement(Select3.Portal, null, /* @__PURE__ */ React44.createElement(SelectContent, null, /* @__PURE__ */ React44.createElement(SelectViewport, null, menuItems.map((menuItem) => {
|
|
6134
6244
|
if (typeof menuItem === "string") {
|
|
6135
6245
|
return /* @__PURE__ */ React44.createElement(StyledSeparator, null);
|
|
6136
6246
|
}
|
|
@@ -6254,13 +6364,15 @@ var SwitchThumb = styled33(SwitchPrimitive.Thumb)({
|
|
|
6254
6364
|
var Switch = function Switch2({
|
|
6255
6365
|
value,
|
|
6256
6366
|
onChange,
|
|
6257
|
-
colorScheme = "normal"
|
|
6367
|
+
colorScheme = "normal",
|
|
6368
|
+
disabled
|
|
6258
6369
|
}) {
|
|
6259
6370
|
return /* @__PURE__ */ React46.createElement(
|
|
6260
6371
|
SwitchRoot,
|
|
6261
6372
|
{
|
|
6262
6373
|
$colorScheme: colorScheme,
|
|
6263
6374
|
checked: value,
|
|
6375
|
+
disabled,
|
|
6264
6376
|
onCheckedChange: (newValue) => {
|
|
6265
6377
|
onChange(newValue);
|
|
6266
6378
|
}
|
|
@@ -6269,14 +6381,80 @@ var Switch = function Switch2({
|
|
|
6269
6381
|
);
|
|
6270
6382
|
};
|
|
6271
6383
|
|
|
6384
|
+
// src/components/TextArea.tsx
|
|
6385
|
+
import React47, { forwardRef as forwardRef18, memo as memo30, useCallback as useCallback25, useEffect as useEffect16, useRef as useRef20 } from "react";
|
|
6386
|
+
import styled34 from "styled-components";
|
|
6387
|
+
var TextAreaElement = styled34.textarea(({ theme }) => ({
|
|
6388
|
+
...theme.textStyles.small,
|
|
6389
|
+
color: theme.colors.text,
|
|
6390
|
+
background: theme.colors.inputBackground,
|
|
6391
|
+
width: "0px",
|
|
6392
|
+
flex: "1 1 auto",
|
|
6393
|
+
padding: "4px 6px",
|
|
6394
|
+
border: "none",
|
|
6395
|
+
outline: "none",
|
|
6396
|
+
height: 100,
|
|
6397
|
+
borderRadius: "4px",
|
|
6398
|
+
"&::placeholder": {
|
|
6399
|
+
color: theme.colors.textDisabled
|
|
6400
|
+
},
|
|
6401
|
+
"&:focus": {
|
|
6402
|
+
boxShadow: `0 0 0 2px ${theme.colors.primary}`
|
|
6403
|
+
},
|
|
6404
|
+
// readonly
|
|
6405
|
+
"&:read-only": {
|
|
6406
|
+
color: theme.colors.textDisabled
|
|
6407
|
+
},
|
|
6408
|
+
resize: "none"
|
|
6409
|
+
}));
|
|
6410
|
+
var useAutoResize = (value) => {
|
|
6411
|
+
const textareaRef = useRef20(null);
|
|
6412
|
+
useEffect16(() => {
|
|
6413
|
+
if (!textareaRef.current)
|
|
6414
|
+
return;
|
|
6415
|
+
textareaRef.current.style.height = "auto";
|
|
6416
|
+
textareaRef.current.style.height = `${textareaRef.current.scrollHeight}px`;
|
|
6417
|
+
}, [value]);
|
|
6418
|
+
return textareaRef;
|
|
6419
|
+
};
|
|
6420
|
+
var AutoResizingTextArea = memo30(
|
|
6421
|
+
forwardRef18(function AutoResizingTextArea2({
|
|
6422
|
+
value,
|
|
6423
|
+
onChangeText,
|
|
6424
|
+
...rest
|
|
6425
|
+
}, forwardedRef) {
|
|
6426
|
+
const ref = useAutoResize(value || rest.placeholder || "");
|
|
6427
|
+
const handleChange = useCallback25(
|
|
6428
|
+
(event) => onChangeText(event.target.value),
|
|
6429
|
+
[onChangeText]
|
|
6430
|
+
);
|
|
6431
|
+
const handleRef = useCallback25(
|
|
6432
|
+
(value2) => {
|
|
6433
|
+
ref.current = value2;
|
|
6434
|
+
assignRef(forwardedRef, value2);
|
|
6435
|
+
},
|
|
6436
|
+
[ref, forwardedRef]
|
|
6437
|
+
);
|
|
6438
|
+
return /* @__PURE__ */ React47.createElement(
|
|
6439
|
+
TextAreaElement,
|
|
6440
|
+
{
|
|
6441
|
+
ref: handleRef,
|
|
6442
|
+
...rest,
|
|
6443
|
+
onChange: handleChange,
|
|
6444
|
+
value
|
|
6445
|
+
}
|
|
6446
|
+
);
|
|
6447
|
+
})
|
|
6448
|
+
);
|
|
6449
|
+
|
|
6272
6450
|
// src/components/TreeView.tsx
|
|
6273
|
-
import
|
|
6274
|
-
forwardRef as
|
|
6275
|
-
memo as
|
|
6276
|
-
useCallback as
|
|
6451
|
+
import React48, {
|
|
6452
|
+
forwardRef as forwardRef19,
|
|
6453
|
+
memo as memo31,
|
|
6454
|
+
useCallback as useCallback26,
|
|
6277
6455
|
useContext as useContext12
|
|
6278
6456
|
} from "react";
|
|
6279
|
-
var TreeRow =
|
|
6457
|
+
var TreeRow = forwardRef19(function TreeRow2({
|
|
6280
6458
|
icon,
|
|
6281
6459
|
expanded,
|
|
6282
6460
|
onClickChevron,
|
|
@@ -6284,33 +6462,33 @@ var TreeRow = forwardRef18(function TreeRow2({
|
|
|
6284
6462
|
...rest
|
|
6285
6463
|
}, forwardedRef) {
|
|
6286
6464
|
const { expandable } = useContext12(ListView.RowContext);
|
|
6287
|
-
const handleClickChevron =
|
|
6465
|
+
const handleClickChevron = useCallback26(
|
|
6288
6466
|
(event) => {
|
|
6289
6467
|
event.stopPropagation();
|
|
6290
6468
|
onClickChevron?.({ altKey: event.altKey });
|
|
6291
6469
|
},
|
|
6292
6470
|
[onClickChevron]
|
|
6293
6471
|
);
|
|
6294
|
-
return /* @__PURE__ */
|
|
6472
|
+
return /* @__PURE__ */ React48.createElement(ListView.Row, { ref: forwardedRef, ...rest }, expandable && /* @__PURE__ */ React48.createElement(React48.Fragment, null, expanded === void 0 ? /* @__PURE__ */ React48.createElement(Spacer.Horizontal, { size: 19 }) : /* @__PURE__ */ React48.createElement(
|
|
6295
6473
|
IconButton,
|
|
6296
6474
|
{
|
|
6297
6475
|
iconName: expanded ? "ChevronDownIcon2" : "ChevronRightIcon2",
|
|
6298
6476
|
onClick: handleClickChevron,
|
|
6299
6477
|
selected: rest.selected
|
|
6300
6478
|
}
|
|
6301
|
-
), /* @__PURE__ */
|
|
6479
|
+
), /* @__PURE__ */ React48.createElement(Spacer.Horizontal, { size: 6 })), icon && /* @__PURE__ */ React48.createElement(React48.Fragment, null, renderIcon(icon), /* @__PURE__ */ React48.createElement(Spacer.Horizontal, { size: 10 })), children);
|
|
6302
6480
|
});
|
|
6303
6481
|
var TreeView;
|
|
6304
6482
|
((TreeView2) => {
|
|
6305
6483
|
TreeView2.Root = ListView.Root;
|
|
6306
6484
|
TreeView2.RowTitle = ListView.RowTitle;
|
|
6307
6485
|
TreeView2.EditableRowTitle = ListView.EditableRowTitle;
|
|
6308
|
-
TreeView2.Row =
|
|
6486
|
+
TreeView2.Row = memo31(TreeRow);
|
|
6309
6487
|
})(TreeView || (TreeView = {}));
|
|
6310
6488
|
|
|
6311
6489
|
// src/components/WorkspaceLayout.tsx
|
|
6312
6490
|
import { useKeyboardShortcuts as useKeyboardShortcuts3 } from "@noya-app/noya-keymap";
|
|
6313
|
-
import
|
|
6491
|
+
import React50, { forwardRef as forwardRef20, useImperativeHandle as useImperativeHandle4, useRef as useRef22 } from "react";
|
|
6314
6492
|
import {
|
|
6315
6493
|
Panel,
|
|
6316
6494
|
PanelGroup,
|
|
@@ -6318,10 +6496,10 @@ import {
|
|
|
6318
6496
|
} from "react-resizable-panels";
|
|
6319
6497
|
|
|
6320
6498
|
// src/hooks/usePreservePanelSize.tsx
|
|
6321
|
-
import { useLayoutEffect as useLayoutEffect9, useRef as
|
|
6499
|
+
import { useLayoutEffect as useLayoutEffect9, useRef as useRef21 } from "react";
|
|
6322
6500
|
|
|
6323
6501
|
// src/hooks/useWindowSize.tsx
|
|
6324
|
-
import { useEffect as
|
|
6502
|
+
import { useEffect as useEffect17, useState as useState21 } from "react";
|
|
6325
6503
|
function useWindowSize() {
|
|
6326
6504
|
const [size2, setSize] = useState21(
|
|
6327
6505
|
typeof window === "undefined" ? { width: 0, height: 0 } : {
|
|
@@ -6329,7 +6507,7 @@ function useWindowSize() {
|
|
|
6329
6507
|
height: window.innerHeight
|
|
6330
6508
|
}
|
|
6331
6509
|
);
|
|
6332
|
-
|
|
6510
|
+
useEffect17(() => {
|
|
6333
6511
|
const handleResize = () => setSize({
|
|
6334
6512
|
width: window.innerWidth,
|
|
6335
6513
|
height: window.innerHeight
|
|
@@ -6347,7 +6525,7 @@ var RIGHT_SIDEBAR_ID = "editor-right-sidebar";
|
|
|
6347
6525
|
var CONTENT_AREA_ID = "editor-content-area";
|
|
6348
6526
|
function usePreservePanelSize(panelGroupRef, setPanelLayoutState) {
|
|
6349
6527
|
const windowSize = useWindowSize();
|
|
6350
|
-
const layoutRef =
|
|
6528
|
+
const layoutRef = useRef21();
|
|
6351
6529
|
useLayoutEffect9(() => {
|
|
6352
6530
|
const panelGroup = document.querySelector(
|
|
6353
6531
|
`[data-panel-group-id="${EDITOR_PANEL_GROUP_ID}"]`
|
|
@@ -6451,7 +6629,7 @@ function usePreservePanelSize(panelGroupRef, setPanelLayoutState) {
|
|
|
6451
6629
|
}
|
|
6452
6630
|
|
|
6453
6631
|
// src/components/WorkspaceLayout.tsx
|
|
6454
|
-
var WorkspaceLayout =
|
|
6632
|
+
var WorkspaceLayout = forwardRef20(function WorkspaceLayout2({
|
|
6455
6633
|
autoSavePrefix,
|
|
6456
6634
|
leftSidebarContent: leftPanelContent,
|
|
6457
6635
|
children: centerPanelContent,
|
|
@@ -6466,7 +6644,7 @@ var WorkspaceLayout = forwardRef19(function WorkspaceLayout2({
|
|
|
6466
6644
|
leftSidebarCanResize = false,
|
|
6467
6645
|
id,
|
|
6468
6646
|
className,
|
|
6469
|
-
style:
|
|
6647
|
+
style: style2
|
|
6470
6648
|
}, forwardedRef) {
|
|
6471
6649
|
const windowSize = useWindowSize();
|
|
6472
6650
|
function getPercentage(size2) {
|
|
@@ -6476,9 +6654,9 @@ var WorkspaceLayout = forwardRef19(function WorkspaceLayout2({
|
|
|
6476
6654
|
const rightSidebarPercentage = getPercentage(rightSidebarInitialSize);
|
|
6477
6655
|
const leftSidebarMinPercentage = leftSidebarMinSize !== void 0 ? getPercentage(leftSidebarMinSize) : void 0;
|
|
6478
6656
|
const rightSidebarMinPercentage = rightSidebarMinSize !== void 0 ? getPercentage(rightSidebarMinSize) : void 0;
|
|
6479
|
-
const panelGroupRef =
|
|
6480
|
-
const leftSidebarRef =
|
|
6481
|
-
const rightSidebarRef =
|
|
6657
|
+
const panelGroupRef = useRef22(null);
|
|
6658
|
+
const leftSidebarRef = useRef22(null);
|
|
6659
|
+
const rightSidebarRef = useRef22(null);
|
|
6482
6660
|
usePreservePanelSize(panelGroupRef, onChangeLayoutState);
|
|
6483
6661
|
const theme = useDesignSystemTheme();
|
|
6484
6662
|
useImperativeHandle4(forwardedRef, () => ({
|
|
@@ -6538,7 +6716,7 @@ var WorkspaceLayout = forwardRef19(function WorkspaceLayout2({
|
|
|
6538
6716
|
}
|
|
6539
6717
|
});
|
|
6540
6718
|
const centerPanelPercentage = 100 - (leftPanelContent ? leftSidebarPercentage : 0) - (rightPanelContent ? rightSidebarPercentage : 0);
|
|
6541
|
-
return /* @__PURE__ */
|
|
6719
|
+
return /* @__PURE__ */ React50.createElement(
|
|
6542
6720
|
"div",
|
|
6543
6721
|
{
|
|
6544
6722
|
id,
|
|
@@ -6547,10 +6725,10 @@ var WorkspaceLayout = forwardRef19(function WorkspaceLayout2({
|
|
|
6547
6725
|
backgroundColor: theme.colors.canvas.background,
|
|
6548
6726
|
display: "flex",
|
|
6549
6727
|
flexDirection: "row",
|
|
6550
|
-
...
|
|
6728
|
+
...style2
|
|
6551
6729
|
}
|
|
6552
6730
|
},
|
|
6553
|
-
/* @__PURE__ */
|
|
6731
|
+
/* @__PURE__ */ React50.createElement(
|
|
6554
6732
|
PanelGroup,
|
|
6555
6733
|
{
|
|
6556
6734
|
ref: panelGroupRef,
|
|
@@ -6559,7 +6737,7 @@ var WorkspaceLayout = forwardRef19(function WorkspaceLayout2({
|
|
|
6559
6737
|
autoSaveId: autoSavePrefix ? `${autoSavePrefix}--${EDITOR_PANEL_GROUP_ID}` : void 0,
|
|
6560
6738
|
style: { flex: "1" }
|
|
6561
6739
|
},
|
|
6562
|
-
hasLeftSidebar && /* @__PURE__ */
|
|
6740
|
+
hasLeftSidebar && /* @__PURE__ */ React50.createElement(React50.Fragment, null, /* @__PURE__ */ React50.createElement(
|
|
6563
6741
|
Panel,
|
|
6564
6742
|
{
|
|
6565
6743
|
id: LEFT_SIDEBAR_ID,
|
|
@@ -6576,7 +6754,7 @@ var WorkspaceLayout = forwardRef19(function WorkspaceLayout2({
|
|
|
6576
6754
|
}
|
|
6577
6755
|
},
|
|
6578
6756
|
leftPanelContent
|
|
6579
|
-
), /* @__PURE__ */
|
|
6757
|
+
), /* @__PURE__ */ React50.createElement(
|
|
6580
6758
|
PanelResizeHandle,
|
|
6581
6759
|
{
|
|
6582
6760
|
style: {
|
|
@@ -6587,7 +6765,7 @@ var WorkspaceLayout = forwardRef19(function WorkspaceLayout2({
|
|
|
6587
6765
|
}
|
|
6588
6766
|
}
|
|
6589
6767
|
)),
|
|
6590
|
-
/* @__PURE__ */
|
|
6768
|
+
/* @__PURE__ */ React50.createElement(
|
|
6591
6769
|
Panel,
|
|
6592
6770
|
{
|
|
6593
6771
|
id: CONTENT_AREA_ID,
|
|
@@ -6602,7 +6780,7 @@ var WorkspaceLayout = forwardRef19(function WorkspaceLayout2({
|
|
|
6602
6780
|
},
|
|
6603
6781
|
centerPanelContent
|
|
6604
6782
|
),
|
|
6605
|
-
hasRightSidebar && /* @__PURE__ */
|
|
6783
|
+
hasRightSidebar && /* @__PURE__ */ React50.createElement(React50.Fragment, null, /* @__PURE__ */ React50.createElement(
|
|
6606
6784
|
PanelResizeHandle,
|
|
6607
6785
|
{
|
|
6608
6786
|
style: {
|
|
@@ -6612,7 +6790,7 @@ var WorkspaceLayout = forwardRef19(function WorkspaceLayout2({
|
|
|
6612
6790
|
backgroundColor: theme.colors.divider
|
|
6613
6791
|
}
|
|
6614
6792
|
}
|
|
6615
|
-
), /* @__PURE__ */
|
|
6793
|
+
), /* @__PURE__ */ React50.createElement(
|
|
6616
6794
|
Panel,
|
|
6617
6795
|
{
|
|
6618
6796
|
id: RIGHT_SIDEBAR_ID,
|
|
@@ -6675,8 +6853,8 @@ var SUPPORTED_CANVAS_UPLOAD_TYPES = [
|
|
|
6675
6853
|
|
|
6676
6854
|
// src/components/ArrayController.tsx
|
|
6677
6855
|
import { range as range2 } from "@noya-app/noya-utils";
|
|
6678
|
-
import
|
|
6679
|
-
import
|
|
6856
|
+
import React52, { memo as memo33, useCallback as useCallback27, useMemo as useMemo24 } from "react";
|
|
6857
|
+
import styled36, { useTheme as useTheme5 } from "styled-components";
|
|
6680
6858
|
|
|
6681
6859
|
// src/components/InspectorPrimitives.tsx
|
|
6682
6860
|
var InspectorPrimitives_exports = {};
|
|
@@ -6694,20 +6872,20 @@ __export(InspectorPrimitives_exports, {
|
|
|
6694
6872
|
Title: () => Title3,
|
|
6695
6873
|
VerticalSeparator: () => VerticalSeparator
|
|
6696
6874
|
});
|
|
6697
|
-
import
|
|
6698
|
-
import
|
|
6699
|
-
var Section =
|
|
6875
|
+
import React51, { memo as memo32 } from "react";
|
|
6876
|
+
import styled35, { useTheme as useTheme4 } from "styled-components";
|
|
6877
|
+
var Section = styled35.div(({ theme, $padding = "10px", $gap }) => ({
|
|
6700
6878
|
flex: "0 0 auto",
|
|
6701
6879
|
display: "flex",
|
|
6702
6880
|
flexDirection: "column",
|
|
6703
6881
|
padding: $padding,
|
|
6704
6882
|
gap: $gap
|
|
6705
6883
|
}));
|
|
6706
|
-
var SectionHeader =
|
|
6884
|
+
var SectionHeader = styled35.div(({ theme }) => ({
|
|
6707
6885
|
display: "flex",
|
|
6708
6886
|
alignItems: "center"
|
|
6709
6887
|
}));
|
|
6710
|
-
var Title3 =
|
|
6888
|
+
var Title3 = styled35.div(({ theme, $textStyle }) => ({
|
|
6711
6889
|
display: "flex",
|
|
6712
6890
|
flexDirection: "row",
|
|
6713
6891
|
userSelect: "none",
|
|
@@ -6716,11 +6894,11 @@ var Title3 = styled34.div(({ theme, $textStyle }) => ({
|
|
|
6716
6894
|
color: theme.colors.text
|
|
6717
6895
|
} : {
|
|
6718
6896
|
...theme.textStyles.label,
|
|
6719
|
-
color: theme.colors.
|
|
6897
|
+
color: theme.colors.textMuted,
|
|
6720
6898
|
fontWeight: "bold"
|
|
6721
6899
|
}
|
|
6722
6900
|
}));
|
|
6723
|
-
var Row2 =
|
|
6901
|
+
var Row2 = styled35.div(
|
|
6724
6902
|
({ theme, $gap }) => ({
|
|
6725
6903
|
flex: "1",
|
|
6726
6904
|
display: "flex",
|
|
@@ -6729,26 +6907,26 @@ var Row2 = styled34.div(
|
|
|
6729
6907
|
gap: $gap
|
|
6730
6908
|
})
|
|
6731
6909
|
);
|
|
6732
|
-
var Column =
|
|
6910
|
+
var Column = styled35.div(({ theme }) => ({
|
|
6733
6911
|
flex: "1",
|
|
6734
6912
|
display: "flex",
|
|
6735
6913
|
flexDirection: "column",
|
|
6736
6914
|
gap: "4px"
|
|
6737
6915
|
}));
|
|
6738
|
-
var Checkbox =
|
|
6916
|
+
var Checkbox = styled35.input(({ theme }) => ({
|
|
6739
6917
|
margin: 0
|
|
6740
6918
|
}));
|
|
6741
|
-
var Text3 =
|
|
6919
|
+
var Text3 = styled35.span(({ theme }) => ({
|
|
6742
6920
|
...theme.textStyles.small
|
|
6743
6921
|
}));
|
|
6744
|
-
var VerticalSeparator = () => /* @__PURE__ */
|
|
6745
|
-
var HorizontalSeparator = () => /* @__PURE__ */
|
|
6746
|
-
var SliderRowLabel =
|
|
6922
|
+
var VerticalSeparator = () => /* @__PURE__ */ React51.createElement(Spacer.Vertical, { size: useTheme4().sizes.inspector.verticalSeparator });
|
|
6923
|
+
var HorizontalSeparator = () => /* @__PURE__ */ React51.createElement(Spacer.Horizontal, { size: useTheme4().sizes.inspector.horizontalSeparator });
|
|
6924
|
+
var SliderRowLabel = styled35.span(({ theme }) => ({
|
|
6747
6925
|
...theme.textStyles.small,
|
|
6748
6926
|
color: theme.colors.textMuted,
|
|
6749
6927
|
marginBottom: "-6px"
|
|
6750
6928
|
}));
|
|
6751
|
-
var RowLabel =
|
|
6929
|
+
var RowLabel = styled35.span(({ theme, $textStyle }) => ({
|
|
6752
6930
|
// marginBottom: '6px',
|
|
6753
6931
|
display: "flex",
|
|
6754
6932
|
...$textStyle ? {
|
|
@@ -6762,7 +6940,7 @@ var RowLabel = styled34.span(({ theme, $textStyle }) => ({
|
|
|
6762
6940
|
// Button height
|
|
6763
6941
|
alignItems: "center"
|
|
6764
6942
|
}));
|
|
6765
|
-
var LabeledRow =
|
|
6943
|
+
var LabeledRow = memo32(function LabeledRow2({
|
|
6766
6944
|
id,
|
|
6767
6945
|
children,
|
|
6768
6946
|
label,
|
|
@@ -6770,26 +6948,26 @@ var LabeledRow = memo31(function LabeledRow2({
|
|
|
6770
6948
|
gap,
|
|
6771
6949
|
right
|
|
6772
6950
|
}) {
|
|
6773
|
-
return /* @__PURE__ */
|
|
6951
|
+
return /* @__PURE__ */ React51.createElement(Row2, { id }, /* @__PURE__ */ React51.createElement(Column, null, /* @__PURE__ */ React51.createElement(RowLabel, { $textStyle: labelTextStyle }, label, right && /* @__PURE__ */ React51.createElement(Spacer.Horizontal, null), right), /* @__PURE__ */ React51.createElement(Row2, { $gap: gap }, children)));
|
|
6774
6952
|
});
|
|
6775
|
-
var LabeledSliderRow =
|
|
6953
|
+
var LabeledSliderRow = memo32(function LabeledRow3({
|
|
6776
6954
|
children,
|
|
6777
6955
|
label
|
|
6778
6956
|
}) {
|
|
6779
|
-
return /* @__PURE__ */
|
|
6957
|
+
return /* @__PURE__ */ React51.createElement(Row2, null, /* @__PURE__ */ React51.createElement(Column, null, /* @__PURE__ */ React51.createElement(SliderRowLabel, null, label), /* @__PURE__ */ React51.createElement(Row2, null, children)));
|
|
6780
6958
|
});
|
|
6781
6959
|
|
|
6782
6960
|
// src/components/ArrayController.tsx
|
|
6783
|
-
var ElementRow =
|
|
6961
|
+
var ElementRow = styled36.div({
|
|
6784
6962
|
flex: "0 0 auto",
|
|
6785
6963
|
display: "flex",
|
|
6786
6964
|
flexDirection: "row",
|
|
6787
6965
|
alignItems: "center"
|
|
6788
6966
|
});
|
|
6789
|
-
var ItemContainer2 =
|
|
6967
|
+
var ItemContainer2 = styled36.div({
|
|
6790
6968
|
position: "relative"
|
|
6791
6969
|
});
|
|
6792
|
-
var ArrayController =
|
|
6970
|
+
var ArrayController = memo33(function ArrayController2({
|
|
6793
6971
|
id,
|
|
6794
6972
|
items,
|
|
6795
6973
|
title,
|
|
@@ -6812,7 +6990,7 @@ var ArrayController = memo32(function ArrayController2({
|
|
|
6812
6990
|
[getKey, items]
|
|
6813
6991
|
);
|
|
6814
6992
|
const indexes = reversed ? range2(0, items.length).reverse() : range2(0, items.length);
|
|
6815
|
-
const handleMoveItem =
|
|
6993
|
+
const handleMoveItem = useCallback27(
|
|
6816
6994
|
(sourceIndex, destinationIndex, position) => {
|
|
6817
6995
|
if (reversed) {
|
|
6818
6996
|
if (position === "above") {
|
|
@@ -6829,11 +7007,11 @@ var ArrayController = memo32(function ArrayController2({
|
|
|
6829
7007
|
[onMoveItem, reversed]
|
|
6830
7008
|
);
|
|
6831
7009
|
const renderRow = (index) => {
|
|
6832
|
-
return /* @__PURE__ */
|
|
7010
|
+
return /* @__PURE__ */ React52.createElement(ElementRow, { key: keys[index] }, renderItem({ item: items[index], index }));
|
|
6833
7011
|
};
|
|
6834
|
-
return /* @__PURE__ */
|
|
7012
|
+
return /* @__PURE__ */ React52.createElement(Section, { id, $padding: padding, $gap: "2px" }, /* @__PURE__ */ React52.createElement(SectionHeader, null, /* @__PURE__ */ React52.createElement(Button, { variant: "none", onClick: onClickPlus }, /* @__PURE__ */ React52.createElement(Title3, null, title)), /* @__PURE__ */ React52.createElement(Spacer.Horizontal, null), withSeparatorElements(
|
|
6835
7013
|
[
|
|
6836
|
-
onClickTrash && /* @__PURE__ */
|
|
7014
|
+
onClickTrash && /* @__PURE__ */ React52.createElement(
|
|
6837
7015
|
IconButton,
|
|
6838
7016
|
{
|
|
6839
7017
|
id: `${id}-trash`,
|
|
@@ -6842,7 +7020,7 @@ var ArrayController = memo32(function ArrayController2({
|
|
|
6842
7020
|
onClick: onClickTrash
|
|
6843
7021
|
}
|
|
6844
7022
|
),
|
|
6845
|
-
onClickExpand && /* @__PURE__ */
|
|
7023
|
+
onClickExpand && /* @__PURE__ */ React52.createElement(
|
|
6846
7024
|
IconButton,
|
|
6847
7025
|
{
|
|
6848
7026
|
id: `${id}-gear`,
|
|
@@ -6851,7 +7029,7 @@ var ArrayController = memo32(function ArrayController2({
|
|
|
6851
7029
|
onClick: onClickExpand
|
|
6852
7030
|
}
|
|
6853
7031
|
),
|
|
6854
|
-
onClickPlus && /* @__PURE__ */
|
|
7032
|
+
onClickPlus && /* @__PURE__ */ React52.createElement(
|
|
6855
7033
|
IconButton,
|
|
6856
7034
|
{
|
|
6857
7035
|
id: `${id}-add`,
|
|
@@ -6861,15 +7039,15 @@ var ArrayController = memo32(function ArrayController2({
|
|
|
6861
7039
|
}
|
|
6862
7040
|
)
|
|
6863
7041
|
],
|
|
6864
|
-
/* @__PURE__ */
|
|
6865
|
-
)), /* @__PURE__ */
|
|
7042
|
+
/* @__PURE__ */ React52.createElement(Spacer.Horizontal, { size: 8 })
|
|
7043
|
+
)), /* @__PURE__ */ React52.createElement(Stack.V, { gap: "4px" }, sortable ? /* @__PURE__ */ React52.createElement(
|
|
6866
7044
|
Sortable.Root,
|
|
6867
7045
|
{
|
|
6868
7046
|
keys,
|
|
6869
7047
|
renderOverlay: renderRow,
|
|
6870
7048
|
onMoveItem: handleMoveItem
|
|
6871
7049
|
},
|
|
6872
|
-
indexes.map((index) => /* @__PURE__ */
|
|
7050
|
+
indexes.map((index) => /* @__PURE__ */ React52.createElement(Sortable.Item, { id: keys[index], key: keys[index] }, ({ relativeDropPosition, ...sortableProps }) => /* @__PURE__ */ React52.createElement(ItemContainer2, { ...sortableProps }, renderRow(index), relativeDropPosition && /* @__PURE__ */ React52.createElement(
|
|
6873
7051
|
ListView.DragIndicator,
|
|
6874
7052
|
{
|
|
6875
7053
|
$gap: 0,
|
|
@@ -6883,11 +7061,11 @@ var ArrayController = memo32(function ArrayController2({
|
|
|
6883
7061
|
|
|
6884
7062
|
// src/components/DimensionInput.tsx
|
|
6885
7063
|
import { round } from "@noya-app/noya-utils";
|
|
6886
|
-
import
|
|
7064
|
+
import React53, { memo as memo34, useCallback as useCallback28 } from "react";
|
|
6887
7065
|
function getNewValue(value, mode, delta) {
|
|
6888
7066
|
return delta === void 0 ? value : mode === "replace" ? delta : value + delta;
|
|
6889
7067
|
}
|
|
6890
|
-
var DimensionInput =
|
|
7068
|
+
var DimensionInput = memo34(function DimensionInput2({
|
|
6891
7069
|
id,
|
|
6892
7070
|
value,
|
|
6893
7071
|
onSetValue,
|
|
@@ -6897,15 +7075,15 @@ var DimensionInput = memo33(function DimensionInput2({
|
|
|
6897
7075
|
disabled,
|
|
6898
7076
|
trigger = "submit"
|
|
6899
7077
|
}) {
|
|
6900
|
-
const handleNudgeValue =
|
|
7078
|
+
const handleNudgeValue = useCallback28(
|
|
6901
7079
|
(value2) => onSetValue(value2, "adjust"),
|
|
6902
7080
|
[onSetValue]
|
|
6903
7081
|
);
|
|
6904
|
-
const handleSetValue =
|
|
7082
|
+
const handleSetValue = useCallback28(
|
|
6905
7083
|
(value2) => onSetValue(value2, "replace"),
|
|
6906
7084
|
[onSetValue]
|
|
6907
7085
|
);
|
|
6908
|
-
return /* @__PURE__ */
|
|
7086
|
+
return /* @__PURE__ */ React53.createElement(InputField.Root, { id, width: size2 }, /* @__PURE__ */ React53.createElement(
|
|
6909
7087
|
InputField.NumberInput,
|
|
6910
7088
|
{
|
|
6911
7089
|
value: value === void 0 ? value : round(value, 2),
|
|
@@ -6914,11 +7092,12 @@ var DimensionInput = memo33(function DimensionInput2({
|
|
|
6914
7092
|
disabled,
|
|
6915
7093
|
...trigger === "change" ? { onChange: handleSetValue } : { onSubmit: handleSetValue }
|
|
6916
7094
|
}
|
|
6917
|
-
), label && /* @__PURE__ */
|
|
7095
|
+
), label && /* @__PURE__ */ React53.createElement(InputField.Label, null, label));
|
|
6918
7096
|
});
|
|
6919
7097
|
export {
|
|
6920
7098
|
ActivityIndicator,
|
|
6921
7099
|
ArrayController,
|
|
7100
|
+
AutoResizingTextArea,
|
|
6922
7101
|
Avatar,
|
|
6923
7102
|
AvatarStack,
|
|
6924
7103
|
Body,
|
|
@@ -7002,6 +7181,7 @@ export {
|
|
|
7002
7181
|
sketchColorToHex,
|
|
7003
7182
|
sketchColorToRgba,
|
|
7004
7183
|
sketchColorToRgbaString,
|
|
7184
|
+
useAutoResize,
|
|
7005
7185
|
useCurrentFloatingWindowInternal,
|
|
7006
7186
|
useDesignSystemConfiguration,
|
|
7007
7187
|
useDesignSystemTheme,
|