@noya-app/noya-designsystem 0.1.10 → 0.1.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +9 -9
- package/CHANGELOG.md +17 -0
- package/dist/index.d.mts +51 -9
- package/dist/index.d.ts +51 -9
- package/dist/index.js +981 -616
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +898 -538
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
- package/src/components/Avatar.tsx +85 -34
- package/src/components/Button.tsx +1 -1
- package/src/components/FloatingWindow.tsx +315 -0
- package/src/components/Text.tsx +2 -1
- package/src/components/internal/Menu.tsx +1 -3
- package/src/contexts/DesignSystemConfiguration.tsx +12 -9
- package/src/contexts/FloatingWindowContext.tsx +85 -0
- package/src/index.tsx +3 -1
- package/src/theme/dark.ts +2 -0
- package/src/theme/light.ts +9 -0
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var __defProp = Object.defineProperty;
|
|
2
2
|
var __export = (target, all) => {
|
|
3
|
-
for (var
|
|
4
|
-
__defProp(target,
|
|
3
|
+
for (var name3 in all)
|
|
4
|
+
__defProp(target, name3, { get: all[name3], enumerable: true });
|
|
5
5
|
};
|
|
6
6
|
|
|
7
7
|
// src/components/ActivityIndicator.tsx
|
|
@@ -36,9 +36,98 @@ var ActivityIndicator = memo(function ActivityIndicator2({
|
|
|
36
36
|
|
|
37
37
|
// src/components/Avatar.tsx
|
|
38
38
|
import * as AvatarPrimitive from "@radix-ui/react-avatar";
|
|
39
|
-
import
|
|
39
|
+
import React3, { forwardRef as forwardRef2 } from "react";
|
|
40
|
+
import styled3 from "styled-components";
|
|
41
|
+
|
|
42
|
+
// src/components/Stack.tsx
|
|
43
|
+
import React2, {
|
|
44
|
+
Children as Children2,
|
|
45
|
+
forwardRef,
|
|
46
|
+
memo as memo2
|
|
47
|
+
} from "react";
|
|
40
48
|
import styled2 from "styled-components";
|
|
41
|
-
|
|
49
|
+
|
|
50
|
+
// src/utils/breakpoints.ts
|
|
51
|
+
function mergeBreakpoints(breakpoints, transform) {
|
|
52
|
+
const breakpointMap = Array.isArray(breakpoints) ? breakpoints.reduce(
|
|
53
|
+
(result, item) => {
|
|
54
|
+
const [key, value] = item;
|
|
55
|
+
result[key] = result[key] ? { ...result[key], ...value } : value;
|
|
56
|
+
return result;
|
|
57
|
+
},
|
|
58
|
+
{}
|
|
59
|
+
) : breakpoints;
|
|
60
|
+
const breakpointList = Object.entries(breakpointMap);
|
|
61
|
+
const transformedList = breakpointList.sort((a, b) => Number(b[0]) - Number(a[0])).map(([width, value]) => [
|
|
62
|
+
`@media screen and (max-width: ${width}px)`,
|
|
63
|
+
transform?.(value) ?? value
|
|
64
|
+
]);
|
|
65
|
+
return Object.fromEntries(transformedList);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// src/utils/withSeparatorElements.ts
|
|
69
|
+
import { Children, cloneElement, isValidElement } from "react";
|
|
70
|
+
function createKey(key) {
|
|
71
|
+
return `s-${key}`;
|
|
72
|
+
}
|
|
73
|
+
function withSeparatorElements(elements2, separator) {
|
|
74
|
+
const childrenArray = Children.toArray(elements2);
|
|
75
|
+
for (let i = childrenArray.length - 1; i > 0; i--) {
|
|
76
|
+
let sep = typeof separator === "function" ? separator() : isValidElement(separator) ? cloneElement(separator, { key: createKey(i) }) : separator;
|
|
77
|
+
if (isValidElement(sep) && sep.key == null) {
|
|
78
|
+
sep = cloneElement(sep, { key: createKey(i) });
|
|
79
|
+
}
|
|
80
|
+
if (!sep || typeof sep === "boolean")
|
|
81
|
+
continue;
|
|
82
|
+
childrenArray.splice(i, 0, sep);
|
|
83
|
+
}
|
|
84
|
+
return childrenArray;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
// src/components/Stack.tsx
|
|
88
|
+
var Element = styled2.div(({ styleProps, breakpoints }) => ({
|
|
89
|
+
...styleProps,
|
|
90
|
+
...mergeBreakpoints(breakpoints || [])
|
|
91
|
+
}));
|
|
92
|
+
var StackBase = forwardRef(function StackBase2({ id, as, children, separator, breakpoints, tabIndex, href, ...rest }, forwardedRef) {
|
|
93
|
+
const elements2 = separator ? withSeparatorElements(Children2.toArray(children), separator) : children;
|
|
94
|
+
const styleProps = {
|
|
95
|
+
display: "flex",
|
|
96
|
+
position: "relative",
|
|
97
|
+
alignItems: "stretch",
|
|
98
|
+
...rest
|
|
99
|
+
};
|
|
100
|
+
return /* @__PURE__ */ React2.createElement(
|
|
101
|
+
Element,
|
|
102
|
+
{
|
|
103
|
+
ref: forwardedRef,
|
|
104
|
+
id,
|
|
105
|
+
as,
|
|
106
|
+
styleProps,
|
|
107
|
+
breakpoints,
|
|
108
|
+
tabIndex,
|
|
109
|
+
...href && { href }
|
|
110
|
+
},
|
|
111
|
+
elements2
|
|
112
|
+
);
|
|
113
|
+
});
|
|
114
|
+
var VerticalStack = memo2(
|
|
115
|
+
forwardRef(function VStack(props, forwardedRef) {
|
|
116
|
+
return /* @__PURE__ */ React2.createElement(StackBase, { ...props, flexDirection: "column", ref: forwardedRef });
|
|
117
|
+
})
|
|
118
|
+
);
|
|
119
|
+
var HorizontalStack = memo2(
|
|
120
|
+
forwardRef(function HStack(props, forwardedRef) {
|
|
121
|
+
return /* @__PURE__ */ React2.createElement(StackBase, { ...props, flexDirection: "row", ref: forwardedRef });
|
|
122
|
+
})
|
|
123
|
+
);
|
|
124
|
+
var Stack = {
|
|
125
|
+
V: VerticalStack,
|
|
126
|
+
H: HorizontalStack
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
// src/components/Avatar.tsx
|
|
130
|
+
var AvatarRoot = styled3(AvatarPrimitive.Root)(({ theme, size: size2, overflow }) => ({
|
|
42
131
|
display: "inline-flex",
|
|
43
132
|
alignItems: "center",
|
|
44
133
|
justifyContent: "center",
|
|
@@ -49,17 +138,23 @@ var AvatarRoot = styled2(AvatarPrimitive.Root)(({ theme, size: size2, overflow }
|
|
|
49
138
|
height: size2,
|
|
50
139
|
borderRadius: "100%",
|
|
51
140
|
backgroundColor: theme.colors.secondaryLight,
|
|
141
|
+
outline: `1px solid ${theme.colors.secondary}`,
|
|
142
|
+
outlineOffset: "-1px",
|
|
52
143
|
...overflow && {
|
|
53
144
|
margin: `-${overflow}px`
|
|
145
|
+
},
|
|
146
|
+
"&:hover": {
|
|
147
|
+
boxShadow: `0 0 0 2px ${theme.colors.sidebar.background}`,
|
|
148
|
+
opacity: 0.9
|
|
54
149
|
}
|
|
55
150
|
}));
|
|
56
|
-
var AvatarImage =
|
|
151
|
+
var AvatarImage = styled3(AvatarPrimitive.Image)({
|
|
57
152
|
width: "100%",
|
|
58
153
|
height: "100%",
|
|
59
154
|
objectFit: "cover",
|
|
60
155
|
borderRadius: "inherit"
|
|
61
156
|
});
|
|
62
|
-
var AvatarFallback =
|
|
157
|
+
var AvatarFallback = styled3(AvatarPrimitive.Fallback)(({ theme, size: size2 }) => ({
|
|
63
158
|
fontSize: "0.8rem",
|
|
64
159
|
fontWeight: 500,
|
|
65
160
|
width: "100%",
|
|
@@ -70,28 +165,50 @@ var AvatarFallback = styled2(AvatarPrimitive.Fallback)(({ theme, size: size2 })
|
|
|
70
165
|
color: "white",
|
|
71
166
|
lineHeight: `${size2}px`
|
|
72
167
|
}));
|
|
73
|
-
|
|
168
|
+
var Avatar = forwardRef2(function Avatar2({
|
|
74
169
|
image,
|
|
75
|
-
name,
|
|
170
|
+
name: name3,
|
|
76
171
|
fallback,
|
|
77
172
|
size: size2 = 19,
|
|
78
|
-
overflow = 0
|
|
173
|
+
overflow = 0,
|
|
174
|
+
...props
|
|
175
|
+
}, forwardedRef) {
|
|
176
|
+
return /* @__PURE__ */ React3.createElement(AvatarRoot, { ref: forwardedRef, size: size2, overflow, ...props }, /* @__PURE__ */ React3.createElement(AvatarImage, { src: image, alt: name3 }), /* @__PURE__ */ React3.createElement(AvatarFallback, { size: size2 }, fallback));
|
|
177
|
+
});
|
|
178
|
+
var AvatarStackItemWrapper = styled3.div(({ size: size2, theme }) => ({
|
|
179
|
+
position: "relative",
|
|
180
|
+
width: size2,
|
|
181
|
+
height: size2,
|
|
182
|
+
marginLeft: "-8px",
|
|
183
|
+
outline: `2px solid ${theme.colors.sidebar.background}`,
|
|
184
|
+
borderRadius: "50%"
|
|
185
|
+
}));
|
|
186
|
+
function AvatarStack({
|
|
187
|
+
size: size2 = 19,
|
|
188
|
+
children
|
|
79
189
|
}) {
|
|
80
|
-
|
|
190
|
+
const childrenArray = React3.Children.toArray(children).map((child) => {
|
|
191
|
+
return React3.cloneElement(child, { size: size2 });
|
|
192
|
+
});
|
|
193
|
+
return /* @__PURE__ */ React3.createElement(Stack.H, null, childrenArray.map((child, index) => {
|
|
194
|
+
if (index === 0)
|
|
195
|
+
return child;
|
|
196
|
+
return /* @__PURE__ */ React3.createElement(AvatarStackItemWrapper, { size: size2, key: index }, child);
|
|
197
|
+
}));
|
|
81
198
|
}
|
|
82
199
|
|
|
83
200
|
// src/components/Button.tsx
|
|
84
|
-
import
|
|
85
|
-
forwardRef,
|
|
201
|
+
import React5, {
|
|
202
|
+
forwardRef as forwardRef3,
|
|
86
203
|
useCallback
|
|
87
204
|
} from "react";
|
|
88
|
-
import
|
|
205
|
+
import styled5 from "styled-components";
|
|
89
206
|
|
|
90
207
|
// src/components/Tooltip.tsx
|
|
91
208
|
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
92
|
-
import
|
|
93
|
-
import
|
|
94
|
-
var Content2 =
|
|
209
|
+
import React4, { memo as memo3 } from "react";
|
|
210
|
+
import styled4 from "styled-components";
|
|
211
|
+
var Content2 = styled4(TooltipPrimitive.Content)(({ theme }) => ({
|
|
95
212
|
...theme.textStyles.small,
|
|
96
213
|
color: theme.colors.text,
|
|
97
214
|
borderRadius: 3,
|
|
@@ -100,8 +217,8 @@ var Content2 = styled3(TooltipPrimitive.Content)(({ theme }) => ({
|
|
|
100
217
|
boxShadow: "0 2px 4px rgba(0,0,0,0.2), 0 0 12px rgba(0,0,0,0.1)",
|
|
101
218
|
border: `1px solid ${theme.colors.dividerStrong}`
|
|
102
219
|
}));
|
|
103
|
-
var Tooltip =
|
|
104
|
-
return /* @__PURE__ */
|
|
220
|
+
var Tooltip = memo3(function Tooltip2({ children, content }) {
|
|
221
|
+
return /* @__PURE__ */ React4.createElement(TooltipPrimitive.Provider, null, /* @__PURE__ */ React4.createElement(TooltipPrimitive.Root, null, /* @__PURE__ */ React4.createElement(TooltipPrimitive.Trigger, { asChild: true }, children), /* @__PURE__ */ React4.createElement(TooltipPrimitive.Portal, null, /* @__PURE__ */ React4.createElement(
|
|
105
222
|
Content2,
|
|
106
223
|
{
|
|
107
224
|
side: "bottom",
|
|
@@ -114,7 +231,7 @@ var Tooltip = memo2(function Tooltip2({ children, content }) {
|
|
|
114
231
|
});
|
|
115
232
|
|
|
116
233
|
// src/components/Button.tsx
|
|
117
|
-
var ButtonElement =
|
|
234
|
+
var ButtonElement = styled5.button(
|
|
118
235
|
({
|
|
119
236
|
theme,
|
|
120
237
|
active,
|
|
@@ -124,7 +241,7 @@ var ButtonElement = styled4.button(
|
|
|
124
241
|
flex,
|
|
125
242
|
defaultBackground = theme.colors.inputBackground
|
|
126
243
|
}) => ({
|
|
127
|
-
...size2 === "large" ? theme.textStyles.heading4 : theme.textStyles.
|
|
244
|
+
...size2 === "large" ? theme.textStyles.heading4 : theme.textStyles.button,
|
|
128
245
|
textDecoration: "none",
|
|
129
246
|
lineHeight: "1",
|
|
130
247
|
flex: flex ?? "0 0 auto",
|
|
@@ -212,7 +329,7 @@ var ButtonElement = styled4.button(
|
|
|
212
329
|
}
|
|
213
330
|
})
|
|
214
331
|
);
|
|
215
|
-
var ButtonContent =
|
|
332
|
+
var ButtonContent = styled5.span(({ theme }) => ({
|
|
216
333
|
// Line height of small text - maybe figure out better way to ensure
|
|
217
334
|
// icons don't have a smaller height
|
|
218
335
|
minHeight: "19px",
|
|
@@ -223,7 +340,7 @@ var ButtonContent = styled4.span(({ theme }) => ({
|
|
|
223
340
|
// Helps with alignment with the default small text
|
|
224
341
|
lineHeight: "15px"
|
|
225
342
|
}));
|
|
226
|
-
var Button =
|
|
343
|
+
var Button = forwardRef3(function Button2({
|
|
227
344
|
id,
|
|
228
345
|
className,
|
|
229
346
|
style: style3,
|
|
@@ -241,7 +358,7 @@ var Button = forwardRef(function Button2({
|
|
|
241
358
|
...rest
|
|
242
359
|
// Propagate any other props so this component works as a Slot
|
|
243
360
|
}, forwardedRef) {
|
|
244
|
-
const buttonElement = /* @__PURE__ */
|
|
361
|
+
const buttonElement = /* @__PURE__ */ React5.createElement(
|
|
245
362
|
ButtonElement,
|
|
246
363
|
{
|
|
247
364
|
ref: forwardedRef,
|
|
@@ -261,40 +378,40 @@ var Button = forwardRef(function Button2({
|
|
|
261
378
|
}, []),
|
|
262
379
|
...rest
|
|
263
380
|
},
|
|
264
|
-
/* @__PURE__ */
|
|
381
|
+
/* @__PURE__ */ React5.createElement(ButtonContent, { style: contentStyle }, children)
|
|
265
382
|
);
|
|
266
|
-
return tooltip ? /* @__PURE__ */
|
|
383
|
+
return tooltip ? /* @__PURE__ */ React5.createElement(Tooltip, { content: tooltip }, buttonElement) : buttonElement;
|
|
267
384
|
});
|
|
268
385
|
|
|
269
386
|
// src/components/Chip.tsx
|
|
270
387
|
import { Cross1Icon, PlusIcon } from "@noya-app/noya-icons";
|
|
271
|
-
import
|
|
388
|
+
import React21, { memo as memo11 } from "react";
|
|
272
389
|
import styled14 from "styled-components";
|
|
273
390
|
|
|
274
391
|
// src/contexts/DesignSystemConfiguration.tsx
|
|
275
|
-
import
|
|
276
|
-
createContext as
|
|
392
|
+
import React19, {
|
|
393
|
+
createContext as createContext5,
|
|
277
394
|
memo as memo10,
|
|
278
|
-
useContext as
|
|
279
|
-
useMemo as
|
|
395
|
+
useContext as useContext5,
|
|
396
|
+
useMemo as useMemo9
|
|
280
397
|
} from "react";
|
|
281
398
|
import { ThemeProvider, useTheme as useTheme2 } from "styled-components";
|
|
282
399
|
|
|
283
400
|
// src/components/Toast.tsx
|
|
284
401
|
import * as ToastPrimitive from "@radix-ui/react-toast";
|
|
285
|
-
import
|
|
286
|
-
import
|
|
402
|
+
import React7 from "react";
|
|
403
|
+
import styled6 from "styled-components";
|
|
287
404
|
|
|
288
405
|
// src/components/IconButton.tsx
|
|
289
406
|
import * as Icons from "@noya-app/noya-icons";
|
|
290
|
-
import
|
|
291
|
-
forwardRef as
|
|
292
|
-
memo as
|
|
407
|
+
import React6, {
|
|
408
|
+
forwardRef as forwardRef4,
|
|
409
|
+
memo as memo4,
|
|
293
410
|
useMemo
|
|
294
411
|
} from "react";
|
|
295
412
|
import { useTheme } from "styled-components";
|
|
296
|
-
var IconButton =
|
|
297
|
-
|
|
413
|
+
var IconButton = memo4(
|
|
414
|
+
forwardRef4(function IconButton2({ selected, iconName, color, size: size2, contentStyle, ...props }, forwardedRef) {
|
|
298
415
|
const { icon: iconColor, iconSelected: iconSelectedColor } = useTheme().colors;
|
|
299
416
|
const Icon = Icons[iconName];
|
|
300
417
|
const style3 = useMemo(() => {
|
|
@@ -304,7 +421,7 @@ var IconButton = memo3(
|
|
|
304
421
|
...contentStyle
|
|
305
422
|
};
|
|
306
423
|
}, [contentStyle, size2]);
|
|
307
|
-
return /* @__PURE__ */
|
|
424
|
+
return /* @__PURE__ */ React6.createElement(Button, { ref: forwardedRef, ...props, variant: "none", contentStyle: style3 }, /* @__PURE__ */ React6.createElement(
|
|
308
425
|
Icon,
|
|
309
426
|
{
|
|
310
427
|
color: color ?? (selected ? iconSelectedColor : iconColor),
|
|
@@ -315,7 +432,7 @@ var IconButton = memo3(
|
|
|
315
432
|
);
|
|
316
433
|
|
|
317
434
|
// src/components/Toast.tsx
|
|
318
|
-
var ToastViewport =
|
|
435
|
+
var ToastViewport = styled6(ToastPrimitive.Viewport)({
|
|
319
436
|
position: "fixed",
|
|
320
437
|
bottom: 0,
|
|
321
438
|
right: 0,
|
|
@@ -330,7 +447,7 @@ var ToastViewport = styled5(ToastPrimitive.Viewport)({
|
|
|
330
447
|
zIndex: 2147483647,
|
|
331
448
|
outline: "none"
|
|
332
449
|
});
|
|
333
|
-
var ToastRoot =
|
|
450
|
+
var ToastRoot = styled6(ToastPrimitive.Root)(({ theme }) => ({
|
|
334
451
|
borderRadius: 4,
|
|
335
452
|
fontSize: 14,
|
|
336
453
|
backgroundColor: theme.colors.popover.background,
|
|
@@ -343,19 +460,19 @@ var ToastRoot = styled5(ToastPrimitive.Root)(({ theme }) => ({
|
|
|
343
460
|
columnGap: 10,
|
|
344
461
|
alignItems: "center"
|
|
345
462
|
}));
|
|
346
|
-
var ToastTitle =
|
|
463
|
+
var ToastTitle = styled6(ToastPrimitive.Title)(({ theme }) => ({
|
|
347
464
|
gridArea: "title",
|
|
348
465
|
marginBottom: 5,
|
|
349
466
|
...theme.textStyles.label,
|
|
350
467
|
fontWeight: "bold",
|
|
351
468
|
color: theme.colors.text
|
|
352
469
|
}));
|
|
353
|
-
var ToastDescription =
|
|
470
|
+
var ToastDescription = styled6(ToastPrimitive.Description)(({ theme }) => ({
|
|
354
471
|
gridArea: "description",
|
|
355
472
|
...theme.textStyles.small,
|
|
356
473
|
color: theme.colors.textMuted
|
|
357
474
|
}));
|
|
358
|
-
var ToastAction =
|
|
475
|
+
var ToastAction = styled6(ToastPrimitive.Action)({
|
|
359
476
|
gridArea: "action"
|
|
360
477
|
});
|
|
361
478
|
var Toast = ({
|
|
@@ -364,9 +481,9 @@ var Toast = ({
|
|
|
364
481
|
children,
|
|
365
482
|
...props
|
|
366
483
|
}) => {
|
|
367
|
-
return /* @__PURE__ */
|
|
484
|
+
return /* @__PURE__ */ React7.createElement(ToastRoot, { ...props }, title && /* @__PURE__ */ React7.createElement(ToastTitle, null, title), /* @__PURE__ */ React7.createElement(ToastDescription, null, content), children && /* @__PURE__ */ React7.createElement(ToastAction, { asChild: true, altText: "" }, children), /* @__PURE__ */ React7.createElement(ToastPrimitive.Close, { "aria-label": "Close", asChild: true }, /* @__PURE__ */ React7.createElement(IconButton, { iconName: "Cross1Icon" })));
|
|
368
485
|
};
|
|
369
|
-
var ToastProvider = ({ children }) => /* @__PURE__ */
|
|
486
|
+
var ToastProvider = ({ children }) => /* @__PURE__ */ React7.createElement(ToastPrimitive.Provider, null, children, /* @__PURE__ */ React7.createElement(ToastViewport, null));
|
|
370
487
|
|
|
371
488
|
// src/contexts/DialogContext.tsx
|
|
372
489
|
import React17, {
|
|
@@ -381,20 +498,20 @@ import styled13 from "styled-components";
|
|
|
381
498
|
|
|
382
499
|
// src/components/Dialog.tsx
|
|
383
500
|
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
384
|
-
import
|
|
385
|
-
forwardRef as
|
|
501
|
+
import React8, {
|
|
502
|
+
forwardRef as forwardRef5,
|
|
386
503
|
useImperativeHandle,
|
|
387
504
|
useRef
|
|
388
505
|
} from "react";
|
|
389
|
-
import
|
|
506
|
+
import styled8 from "styled-components";
|
|
390
507
|
|
|
391
508
|
// src/components/Spacer.tsx
|
|
392
|
-
import
|
|
393
|
-
var SpacerVertical =
|
|
509
|
+
import styled7 from "styled-components";
|
|
510
|
+
var SpacerVertical = styled7.span(({ size: size2, inline }) => ({
|
|
394
511
|
display: inline ? "inline-block" : "block",
|
|
395
512
|
...size2 === void 0 ? { flex: 1 } : { minHeight: size2 }
|
|
396
513
|
}));
|
|
397
|
-
var SpacerHorizontal =
|
|
514
|
+
var SpacerHorizontal = styled7.span(({ size: size2, inline }) => ({
|
|
398
515
|
display: inline ? "inline-block" : "block",
|
|
399
516
|
...size2 === void 0 ? { flex: 1 } : { minWidth: size2 }
|
|
400
517
|
}));
|
|
@@ -405,12 +522,12 @@ var Spacer;
|
|
|
405
522
|
})(Spacer || (Spacer = {}));
|
|
406
523
|
|
|
407
524
|
// src/components/Dialog.tsx
|
|
408
|
-
var StyledOverlay =
|
|
525
|
+
var StyledOverlay = styled8(DialogPrimitive.Overlay)({
|
|
409
526
|
backgroundColor: "rgba(0,0,0,0.5)",
|
|
410
527
|
position: "fixed",
|
|
411
528
|
inset: 0
|
|
412
529
|
});
|
|
413
|
-
var StyledContent =
|
|
530
|
+
var StyledContent = styled8(DialogPrimitive.Content)(({ theme }) => ({
|
|
414
531
|
boxShadow: "hsl(206 22% 7% / 35%) 0px 10px 38px -10px, hsl(206 22% 7% / 20%) 0px 10px 20px -15px",
|
|
415
532
|
position: "fixed",
|
|
416
533
|
top: "50%",
|
|
@@ -429,17 +546,17 @@ var StyledContent = styled7(DialogPrimitive.Content)(({ theme }) => ({
|
|
|
429
546
|
pointerEvents: "all",
|
|
430
547
|
zIndex: 1e3
|
|
431
548
|
}));
|
|
432
|
-
var StyledTitle =
|
|
549
|
+
var StyledTitle = styled8(DialogPrimitive.Title)(({ theme }) => ({
|
|
433
550
|
margin: 0,
|
|
434
551
|
...theme.textStyles.body,
|
|
435
552
|
color: theme.colors.text
|
|
436
553
|
}));
|
|
437
|
-
var StyledDescription =
|
|
554
|
+
var StyledDescription = styled8(DialogPrimitive.Description)(({ theme }) => ({
|
|
438
555
|
margin: 0,
|
|
439
556
|
...theme.textStyles.small,
|
|
440
557
|
color: theme.colors.textMuted
|
|
441
558
|
}));
|
|
442
|
-
var CloseButtonContainer =
|
|
559
|
+
var CloseButtonContainer = styled8.div(({ theme }) => ({
|
|
443
560
|
position: "absolute",
|
|
444
561
|
top: theme.sizes.dialog.padding,
|
|
445
562
|
right: theme.sizes.dialog.padding,
|
|
@@ -450,7 +567,7 @@ var CloseButtonContainer = styled7.div(({ theme }) => ({
|
|
|
450
567
|
// boxShadow: `0 0 2px rgba(0, 0, 0, 0.2)`,
|
|
451
568
|
border: `1px solid rgba(128,128,128,0.2)`
|
|
452
569
|
}));
|
|
453
|
-
var Dialog =
|
|
570
|
+
var Dialog = forwardRef5(function Dialog2({
|
|
454
571
|
children,
|
|
455
572
|
title,
|
|
456
573
|
description,
|
|
@@ -468,7 +585,7 @@ var Dialog = forwardRef3(function Dialog2({
|
|
|
468
585
|
return contentRef.current.contains(element);
|
|
469
586
|
}
|
|
470
587
|
}));
|
|
471
|
-
return /* @__PURE__ */
|
|
588
|
+
return /* @__PURE__ */ React8.createElement(DialogPrimitive.Root, { open, onOpenChange }, /* @__PURE__ */ React8.createElement(StyledOverlay, null), /* @__PURE__ */ React8.createElement(
|
|
472
589
|
StyledContent,
|
|
473
590
|
{
|
|
474
591
|
ref: contentRef,
|
|
@@ -483,14 +600,14 @@ var Dialog = forwardRef3(function Dialog2({
|
|
|
483
600
|
}
|
|
484
601
|
}
|
|
485
602
|
},
|
|
486
|
-
/* @__PURE__ */
|
|
487
|
-
title && /* @__PURE__ */
|
|
488
|
-
description && /* @__PURE__ */
|
|
603
|
+
/* @__PURE__ */ React8.createElement(CloseButtonContainer, null, /* @__PURE__ */ React8.createElement(DialogPrimitive.Close, { asChild: true }, /* @__PURE__ */ React8.createElement(IconButton, { iconName: "Cross1Icon" }))),
|
|
604
|
+
title && /* @__PURE__ */ React8.createElement(React8.Fragment, null, /* @__PURE__ */ React8.createElement(StyledTitle, null, title), /* @__PURE__ */ React8.createElement(Spacer.Vertical, { size: description ? 10 : 20 })),
|
|
605
|
+
description && /* @__PURE__ */ React8.createElement(React8.Fragment, null, /* @__PURE__ */ React8.createElement(Spacer.Vertical, { size: 10 }), /* @__PURE__ */ React8.createElement(StyledDescription, null, description), /* @__PURE__ */ React8.createElement(Spacer.Vertical, { size: 20 })),
|
|
489
606
|
children
|
|
490
607
|
));
|
|
491
608
|
});
|
|
492
|
-
var FullscreenDialog =
|
|
493
|
-
return /* @__PURE__ */
|
|
609
|
+
var FullscreenDialog = forwardRef5(function FullscreenDialog2({ style: style3, ...rest }, forwardedRef) {
|
|
610
|
+
return /* @__PURE__ */ React8.createElement(
|
|
494
611
|
Dialog,
|
|
495
612
|
{
|
|
496
613
|
ref: forwardedRef,
|
|
@@ -517,13 +634,13 @@ import { CaretDownIcon } from "@noya-app/noya-icons";
|
|
|
517
634
|
import { memoize } from "@noya-app/noya-utils";
|
|
518
635
|
|
|
519
636
|
// ../noya-react-utils/src/components/AutoSizer.tsx
|
|
520
|
-
import
|
|
637
|
+
import React10, { memo as memo5, useRef as useRef2 } from "react";
|
|
521
638
|
|
|
522
639
|
// ../noya-react-utils/src/hooks/useSize.ts
|
|
523
|
-
import * as
|
|
640
|
+
import * as React9 from "react";
|
|
524
641
|
function useSize(refToObserve, dimensions = "both") {
|
|
525
|
-
const [size2, setSize] =
|
|
526
|
-
|
|
642
|
+
const [size2, setSize] = React9.useState(void 0);
|
|
643
|
+
React9.useEffect(() => {
|
|
527
644
|
if (refToObserve.current) {
|
|
528
645
|
const elementToObserve = refToObserve.current;
|
|
529
646
|
const resizeObserver = new ResizeObserver((entries) => {
|
|
@@ -570,27 +687,27 @@ var style = {
|
|
|
570
687
|
flex: "1 0 0",
|
|
571
688
|
flexDirection: "column"
|
|
572
689
|
};
|
|
573
|
-
var AutoSizer =
|
|
690
|
+
var AutoSizer = memo5(function AutoSizer2({
|
|
574
691
|
children,
|
|
575
692
|
className
|
|
576
693
|
}) {
|
|
577
694
|
const containerRef = useRef2(null);
|
|
578
695
|
const containerSize = useSize(containerRef);
|
|
579
|
-
return /* @__PURE__ */
|
|
696
|
+
return /* @__PURE__ */ React10.createElement("div", { ref: containerRef, style, className }, containerSize && containerSize.width > 0 && containerSize.height > 0 && children(containerSize));
|
|
580
697
|
});
|
|
581
|
-
var SingleDimensionAutoSizer =
|
|
698
|
+
var SingleDimensionAutoSizer = memo5(function SingleDimensionAutoSizer2({
|
|
582
699
|
children,
|
|
583
700
|
dimension,
|
|
584
701
|
className
|
|
585
702
|
}) {
|
|
586
703
|
const containerRef = useRef2(null);
|
|
587
704
|
const containerSize = useSize(containerRef, dimension);
|
|
588
|
-
return /* @__PURE__ */
|
|
705
|
+
return /* @__PURE__ */ React10.createElement("div", { ref: containerRef, style, className }, containerSize && containerSize[dimension] > 0 && children(containerSize[dimension]));
|
|
589
706
|
});
|
|
590
707
|
|
|
591
708
|
// ../noya-react-utils/src/components/FileDropTarget.tsx
|
|
592
|
-
import
|
|
593
|
-
memo as
|
|
709
|
+
import React11, {
|
|
710
|
+
memo as memo6,
|
|
594
711
|
useCallback as useCallback3
|
|
595
712
|
} from "react";
|
|
596
713
|
|
|
@@ -626,7 +743,7 @@ function isSupportedFile(file, supportedFileTypes) {
|
|
|
626
743
|
return supportedFileTypes.includes(file.type) || file.type === "" && file.name.endsWith(".sketch");
|
|
627
744
|
}
|
|
628
745
|
var style2 = { display: "flex", flex: 1 };
|
|
629
|
-
var FileDropTarget =
|
|
746
|
+
var FileDropTarget = memo6(function FileDropTarget2({
|
|
630
747
|
children,
|
|
631
748
|
onDropFiles,
|
|
632
749
|
supportedFileTypes
|
|
@@ -664,7 +781,7 @@ var FileDropTarget = memo5(function FileDropTarget2({
|
|
|
664
781
|
[onDropFiles, supportedFileTypes]
|
|
665
782
|
);
|
|
666
783
|
const { dropTargetProps, isDropTargetActive } = useFileDropTarget(handleFile);
|
|
667
|
-
return /* @__PURE__ */
|
|
784
|
+
return /* @__PURE__ */ React11.createElement("div", { style: style2, ...dropTargetProps }, typeof children === "function" ? children(isDropTargetActive) : children);
|
|
668
785
|
});
|
|
669
786
|
|
|
670
787
|
// ../noya-react-utils/src/hooks/useDeepArray.ts
|
|
@@ -807,7 +924,7 @@ function assignRef(ref, value) {
|
|
|
807
924
|
import React16, {
|
|
808
925
|
Children as Children3,
|
|
809
926
|
createContext as createContext2,
|
|
810
|
-
forwardRef as
|
|
927
|
+
forwardRef as forwardRef8,
|
|
811
928
|
isValidElement as isValidElement2,
|
|
812
929
|
memo as memo9,
|
|
813
930
|
useCallback as useCallback11,
|
|
@@ -847,39 +964,18 @@ function handleNudge(e) {
|
|
|
847
964
|
import { CheckIcon, ChevronRightIcon } from "@noya-app/noya-icons";
|
|
848
965
|
import { useKeyboardShortcuts } from "@noya-app/noya-keymap";
|
|
849
966
|
import * as RadixDropdownMenu from "@radix-ui/react-dropdown-menu";
|
|
850
|
-
import
|
|
851
|
-
forwardRef as
|
|
852
|
-
memo as
|
|
967
|
+
import React13, {
|
|
968
|
+
forwardRef as forwardRef6,
|
|
969
|
+
memo as memo8,
|
|
853
970
|
useCallback as useCallback9,
|
|
854
971
|
useMemo as useMemo5
|
|
855
972
|
} from "react";
|
|
856
|
-
import
|
|
973
|
+
import styled10 from "styled-components";
|
|
857
974
|
|
|
858
975
|
// src/components/internal/Menu.tsx
|
|
859
976
|
import { getShortcutDisplayParts } from "@noya-app/noya-keymap";
|
|
860
|
-
import
|
|
861
|
-
import
|
|
862
|
-
|
|
863
|
-
// src/utils/withSeparatorElements.ts
|
|
864
|
-
import { Children, cloneElement, isValidElement } from "react";
|
|
865
|
-
function createKey(key) {
|
|
866
|
-
return `s-${key}`;
|
|
867
|
-
}
|
|
868
|
-
function withSeparatorElements(elements2, separator) {
|
|
869
|
-
const childrenArray = Children.toArray(elements2);
|
|
870
|
-
for (let i = childrenArray.length - 1; i > 0; i--) {
|
|
871
|
-
let sep = typeof separator === "function" ? separator() : isValidElement(separator) ? cloneElement(separator, { key: createKey(i) }) : separator;
|
|
872
|
-
if (isValidElement(sep) && sep.key == null) {
|
|
873
|
-
sep = cloneElement(sep, { key: createKey(i) });
|
|
874
|
-
}
|
|
875
|
-
if (!sep || typeof sep === "boolean")
|
|
876
|
-
continue;
|
|
877
|
-
childrenArray.splice(i, 0, sep);
|
|
878
|
-
}
|
|
879
|
-
return childrenArray;
|
|
880
|
-
}
|
|
881
|
-
|
|
882
|
-
// src/components/internal/Menu.tsx
|
|
977
|
+
import React12, { memo as memo7 } from "react";
|
|
978
|
+
import styled9 from "styled-components";
|
|
883
979
|
var SEPARATOR_ITEM = "separator";
|
|
884
980
|
var CHECKBOX_WIDTH = 15;
|
|
885
981
|
var CHECKBOX_RIGHT_INSET = 3;
|
|
@@ -893,9 +989,7 @@ var styles = {
|
|
|
893
989
|
theme,
|
|
894
990
|
disabled
|
|
895
991
|
}) => ({
|
|
896
|
-
...theme.textStyles.
|
|
897
|
-
fontWeight: 500,
|
|
898
|
-
fontSize: "0.8rem",
|
|
992
|
+
...theme.textStyles.button,
|
|
899
993
|
flex: "0 0 auto",
|
|
900
994
|
userSelect: "none",
|
|
901
995
|
cursor: "pointer",
|
|
@@ -957,7 +1051,7 @@ function getKeyboardShortcutsForMenuItems(menuItems, onSelect) {
|
|
|
957
1051
|
menuItems.flatMap(getKeyboardShortcuts).map(([key, value]) => [key, () => onSelect(value)])
|
|
958
1052
|
);
|
|
959
1053
|
}
|
|
960
|
-
var ShortcutElement =
|
|
1054
|
+
var ShortcutElement = styled9.kbd(
|
|
961
1055
|
({
|
|
962
1056
|
theme,
|
|
963
1057
|
fixedWidth
|
|
@@ -970,12 +1064,12 @@ var ShortcutElement = styled8.kbd(
|
|
|
970
1064
|
}
|
|
971
1065
|
})
|
|
972
1066
|
);
|
|
973
|
-
var KeyboardShortcut =
|
|
1067
|
+
var KeyboardShortcut = memo7(function KeyboardShortcut2({
|
|
974
1068
|
shortcut
|
|
975
1069
|
}) {
|
|
976
1070
|
const platform = useDesignSystemConfiguration().platform;
|
|
977
1071
|
const { keys, separator } = getShortcutDisplayParts(shortcut, platform);
|
|
978
|
-
const keyElements = keys.map((key) => /* @__PURE__ */
|
|
1072
|
+
const keyElements = keys.map((key) => /* @__PURE__ */ React12.createElement(
|
|
979
1073
|
ShortcutElement,
|
|
980
1074
|
{
|
|
981
1075
|
key,
|
|
@@ -983,24 +1077,24 @@ var KeyboardShortcut = memo6(function KeyboardShortcut2({
|
|
|
983
1077
|
},
|
|
984
1078
|
key
|
|
985
1079
|
));
|
|
986
|
-
return /* @__PURE__ */
|
|
1080
|
+
return /* @__PURE__ */ React12.createElement(React12.Fragment, null, separator ? withSeparatorElements(
|
|
987
1081
|
keyElements,
|
|
988
|
-
/* @__PURE__ */
|
|
1082
|
+
/* @__PURE__ */ React12.createElement(ShortcutElement, null, separator)
|
|
989
1083
|
) : keyElements);
|
|
990
1084
|
});
|
|
991
1085
|
|
|
992
1086
|
// src/components/DropdownMenu.tsx
|
|
993
|
-
var SeparatorElement =
|
|
1087
|
+
var SeparatorElement = styled10(RadixDropdownMenu.Separator)(
|
|
994
1088
|
styles.separatorStyle
|
|
995
1089
|
);
|
|
996
|
-
var ItemElement =
|
|
997
|
-
var CheckboxItemElement =
|
|
1090
|
+
var ItemElement = styled10(RadixDropdownMenu.Item)(styles.itemStyle);
|
|
1091
|
+
var CheckboxItemElement = styled10(RadixDropdownMenu.CheckboxItem)(
|
|
998
1092
|
styles.itemStyle
|
|
999
1093
|
);
|
|
1000
|
-
var StyledItemIndicator =
|
|
1094
|
+
var StyledItemIndicator = styled10(RadixDropdownMenu.ItemIndicator)(
|
|
1001
1095
|
styles.itemIndicatorStyle
|
|
1002
1096
|
);
|
|
1003
|
-
var DropdownMenuItem =
|
|
1097
|
+
var DropdownMenuItem = memo8(function ContextMenuItem({
|
|
1004
1098
|
value,
|
|
1005
1099
|
children,
|
|
1006
1100
|
onSelect,
|
|
@@ -1017,21 +1111,21 @@ var DropdownMenuItem = memo7(function ContextMenuItem({
|
|
|
1017
1111
|
onSelect(value);
|
|
1018
1112
|
}, [onSelect, value]);
|
|
1019
1113
|
if (checked) {
|
|
1020
|
-
return /* @__PURE__ */
|
|
1114
|
+
return /* @__PURE__ */ React13.createElement(
|
|
1021
1115
|
CheckboxItemElement,
|
|
1022
1116
|
{
|
|
1023
1117
|
checked,
|
|
1024
1118
|
disabled,
|
|
1025
1119
|
onSelect: handleSelectItem
|
|
1026
1120
|
},
|
|
1027
|
-
/* @__PURE__ */
|
|
1028
|
-
icon && /* @__PURE__ */
|
|
1121
|
+
/* @__PURE__ */ React13.createElement(StyledItemIndicator, null, /* @__PURE__ */ React13.createElement(CheckIcon, null)),
|
|
1122
|
+
icon && /* @__PURE__ */ React13.createElement(React13.Fragment, null, icon, /* @__PURE__ */ React13.createElement(Spacer.Horizontal, { size: 8 })),
|
|
1029
1123
|
children
|
|
1030
1124
|
);
|
|
1031
1125
|
}
|
|
1032
|
-
const element = /* @__PURE__ */
|
|
1126
|
+
const element = /* @__PURE__ */ React13.createElement(ItemElement, { disabled, onSelect: handleSelectItem }, indented && /* @__PURE__ */ React13.createElement(Spacer.Horizontal, { size: CHECKBOX_WIDTH - CHECKBOX_RIGHT_INSET }), icon && /* @__PURE__ */ React13.createElement(React13.Fragment, null, icon, /* @__PURE__ */ React13.createElement(Spacer.Horizontal, { size: 8 })), children, shortcut && /* @__PURE__ */ React13.createElement(React13.Fragment, null, /* @__PURE__ */ React13.createElement(Spacer.Horizontal, null), /* @__PURE__ */ React13.createElement(Spacer.Horizontal, { size: 24 }), /* @__PURE__ */ React13.createElement(KeyboardShortcut, { shortcut })), items && items.length > 0 && /* @__PURE__ */ React13.createElement(React13.Fragment, null, /* @__PURE__ */ React13.createElement(Spacer.Horizontal, null), /* @__PURE__ */ React13.createElement(Spacer.Horizontal, { size: 16 }), /* @__PURE__ */ React13.createElement(ChevronRightIcon, null)));
|
|
1033
1127
|
if (items && items.length > 0) {
|
|
1034
|
-
return /* @__PURE__ */
|
|
1128
|
+
return /* @__PURE__ */ React13.createElement(
|
|
1035
1129
|
DropdownMenuRoot,
|
|
1036
1130
|
{
|
|
1037
1131
|
isNested: true,
|
|
@@ -1045,9 +1139,9 @@ var DropdownMenuItem = memo7(function ContextMenuItem({
|
|
|
1045
1139
|
return element;
|
|
1046
1140
|
}
|
|
1047
1141
|
});
|
|
1048
|
-
var Content5 =
|
|
1049
|
-
var SubContent2 =
|
|
1050
|
-
var DropdownMenuRoot =
|
|
1142
|
+
var Content5 = styled10(RadixDropdownMenu.Content)(styles.contentStyle);
|
|
1143
|
+
var SubContent2 = styled10(RadixDropdownMenu.SubContent)(styles.contentStyle);
|
|
1144
|
+
var DropdownMenuRoot = forwardRef6(function DropdownMenuRoot2({
|
|
1051
1145
|
items,
|
|
1052
1146
|
children,
|
|
1053
1147
|
onSelect,
|
|
@@ -1074,7 +1168,7 @@ var DropdownMenuRoot = forwardRef4(function DropdownMenuRoot2({
|
|
|
1074
1168
|
const TriggerComponent = isNested ? RadixDropdownMenu.SubTrigger : RadixDropdownMenu.Trigger;
|
|
1075
1169
|
const ContentComponent = isNested ? SubContent2 : Content5;
|
|
1076
1170
|
const contentStyle = useMemo5(() => ({ zIndex: 1e3 }), []);
|
|
1077
|
-
return /* @__PURE__ */
|
|
1171
|
+
return /* @__PURE__ */ React13.createElement(RootComponent, { onOpenChange, open }, /* @__PURE__ */ React13.createElement(TriggerComponent, { ref: forwardedRef, asChild: true }, children), /* @__PURE__ */ React13.createElement(RadixDropdownMenu.Portal, null, /* @__PURE__ */ React13.createElement(
|
|
1078
1172
|
ContentComponent,
|
|
1079
1173
|
{
|
|
1080
1174
|
side,
|
|
@@ -1086,7 +1180,7 @@ var DropdownMenuRoot = forwardRef4(function DropdownMenuRoot2({
|
|
|
1086
1180
|
...{ onCloseAutoFocus }
|
|
1087
1181
|
},
|
|
1088
1182
|
items.map(
|
|
1089
|
-
(item, index) => item === SEPARATOR_ITEM ? /* @__PURE__ */
|
|
1183
|
+
(item, index) => item === SEPARATOR_ITEM ? /* @__PURE__ */ React13.createElement(SeparatorElement, { key: index }) : /* @__PURE__ */ React13.createElement(
|
|
1090
1184
|
DropdownMenuItem,
|
|
1091
1185
|
{
|
|
1092
1186
|
key: item.value ?? index,
|
|
@@ -1104,12 +1198,12 @@ var DropdownMenuRoot = forwardRef4(function DropdownMenuRoot2({
|
|
|
1104
1198
|
)
|
|
1105
1199
|
)));
|
|
1106
1200
|
});
|
|
1107
|
-
var DropdownMenu =
|
|
1201
|
+
var DropdownMenu = memo8(DropdownMenuRoot);
|
|
1108
1202
|
|
|
1109
1203
|
// src/components/internal/TextInput.tsx
|
|
1110
1204
|
import { composeRefs } from "@radix-ui/react-compose-refs";
|
|
1111
|
-
import
|
|
1112
|
-
forwardRef as
|
|
1205
|
+
import React14, {
|
|
1206
|
+
forwardRef as forwardRef7,
|
|
1113
1207
|
useCallback as useCallback10,
|
|
1114
1208
|
useEffect as useEffect9,
|
|
1115
1209
|
useLayoutEffect as useLayoutEffect3,
|
|
@@ -1158,8 +1252,8 @@ function useGlobalInputBlurTrigger() {
|
|
|
1158
1252
|
}
|
|
1159
1253
|
|
|
1160
1254
|
// src/components/internal/TextInput.tsx
|
|
1161
|
-
var ReadOnlyTextInput =
|
|
1162
|
-
return /* @__PURE__ */
|
|
1255
|
+
var ReadOnlyTextInput = forwardRef7(function ReadOnlyTextInput2({ onKeyDown, onFocusChange, value, ...rest }, forwardedRef) {
|
|
1256
|
+
return /* @__PURE__ */ React14.createElement(
|
|
1163
1257
|
"input",
|
|
1164
1258
|
{
|
|
1165
1259
|
ref: forwardedRef,
|
|
@@ -1170,7 +1264,7 @@ var ReadOnlyTextInput = forwardRef5(function ReadOnlyTextInput2({ onKeyDown, onF
|
|
|
1170
1264
|
}
|
|
1171
1265
|
);
|
|
1172
1266
|
});
|
|
1173
|
-
var ControlledTextInput =
|
|
1267
|
+
var ControlledTextInput = forwardRef7(function ControlledTextInput2({
|
|
1174
1268
|
onKeyDown,
|
|
1175
1269
|
value,
|
|
1176
1270
|
onChange,
|
|
@@ -1193,7 +1287,7 @@ var ControlledTextInput = forwardRef5(function ControlledTextInput2({
|
|
|
1193
1287
|
},
|
|
1194
1288
|
[onFocusCapture, onFocusChange]
|
|
1195
1289
|
);
|
|
1196
|
-
return /* @__PURE__ */
|
|
1290
|
+
return /* @__PURE__ */ React14.createElement(
|
|
1197
1291
|
"input",
|
|
1198
1292
|
{
|
|
1199
1293
|
ref: forwardedRef,
|
|
@@ -1209,7 +1303,7 @@ var ControlledTextInput = forwardRef5(function ControlledTextInput2({
|
|
|
1209
1303
|
}
|
|
1210
1304
|
);
|
|
1211
1305
|
});
|
|
1212
|
-
var SubmittableTextInput =
|
|
1306
|
+
var SubmittableTextInput = forwardRef7(function SubmittableTextInput2({
|
|
1213
1307
|
onKeyDown,
|
|
1214
1308
|
value,
|
|
1215
1309
|
onSubmit,
|
|
@@ -1220,7 +1314,7 @@ var SubmittableTextInput = forwardRef5(function SubmittableTextInput2({
|
|
|
1220
1314
|
submitAutomaticallyAfterDelay,
|
|
1221
1315
|
...rest
|
|
1222
1316
|
}, forwardedRef) {
|
|
1223
|
-
const ref =
|
|
1317
|
+
const ref = React14.useRef(null);
|
|
1224
1318
|
const latestValue = useRef9(value);
|
|
1225
1319
|
latestValue.current = value;
|
|
1226
1320
|
const userDidEdit = useRef9(false);
|
|
@@ -1304,7 +1398,7 @@ var SubmittableTextInput = forwardRef5(function SubmittableTextInput2({
|
|
|
1304
1398
|
}
|
|
1305
1399
|
};
|
|
1306
1400
|
}, [internalValue, submitAutomaticallyAfterDelay]);
|
|
1307
|
-
return /* @__PURE__ */
|
|
1401
|
+
return /* @__PURE__ */ React14.createElement(
|
|
1308
1402
|
"input",
|
|
1309
1403
|
{
|
|
1310
1404
|
ref: composeRefs(ref, forwardedRef),
|
|
@@ -1317,7 +1411,7 @@ var SubmittableTextInput = forwardRef5(function SubmittableTextInput2({
|
|
|
1317
1411
|
}
|
|
1318
1412
|
);
|
|
1319
1413
|
});
|
|
1320
|
-
var TextInput_default =
|
|
1414
|
+
var TextInput_default = forwardRef7(function TextInput(props, forwardedRef) {
|
|
1321
1415
|
const commonProps = {
|
|
1322
1416
|
onPointerDown: useCallback10(
|
|
1323
1417
|
(event) => event.stopPropagation(),
|
|
@@ -1336,19 +1430,19 @@ var TextInput_default = forwardRef5(function TextInput(props, forwardedRef) {
|
|
|
1336
1430
|
...props
|
|
1337
1431
|
};
|
|
1338
1432
|
if ("readOnly" in commonProps) {
|
|
1339
|
-
return /* @__PURE__ */
|
|
1433
|
+
return /* @__PURE__ */ React14.createElement(ReadOnlyTextInput, { ref: forwardedRef, ...commonProps, readOnly: true });
|
|
1340
1434
|
} else if ("onChange" in commonProps) {
|
|
1341
|
-
return /* @__PURE__ */
|
|
1435
|
+
return /* @__PURE__ */ React14.createElement(ControlledTextInput, { ref: forwardedRef, ...commonProps });
|
|
1342
1436
|
} else {
|
|
1343
|
-
return /* @__PURE__ */
|
|
1437
|
+
return /* @__PURE__ */ React14.createElement(SubmittableTextInput, { ref: forwardedRef, ...commonProps });
|
|
1344
1438
|
}
|
|
1345
1439
|
});
|
|
1346
1440
|
|
|
1347
1441
|
// src/components/Popover.tsx
|
|
1348
1442
|
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
1349
|
-
import
|
|
1350
|
-
import
|
|
1351
|
-
var ContentElement =
|
|
1443
|
+
import React15 from "react";
|
|
1444
|
+
import styled11 from "styled-components";
|
|
1445
|
+
var ContentElement = styled11(PopoverPrimitive.Content)(({ theme, variant }) => ({
|
|
1352
1446
|
borderRadius: 4,
|
|
1353
1447
|
fontSize: 14,
|
|
1354
1448
|
backgroundColor: theme.colors.popover.background,
|
|
@@ -1360,10 +1454,10 @@ var ContentElement = styled10(PopoverPrimitive.Content)(({ theme, variant }) =>
|
|
|
1360
1454
|
...variant === "normal" && { width: "240px" },
|
|
1361
1455
|
zIndex: 1e3
|
|
1362
1456
|
}));
|
|
1363
|
-
var ArrowElement =
|
|
1457
|
+
var ArrowElement = styled11(PopoverPrimitive.Arrow)(({ theme }) => ({
|
|
1364
1458
|
fill: theme.colors.popover.background
|
|
1365
1459
|
}));
|
|
1366
|
-
var PopoverClose =
|
|
1460
|
+
var PopoverClose = styled11(PopoverPrimitive.Close)(({ theme }) => ({
|
|
1367
1461
|
all: "unset",
|
|
1368
1462
|
fontFamily: "inherit",
|
|
1369
1463
|
borderRadius: "100%",
|
|
@@ -1393,7 +1487,7 @@ function Popover({
|
|
|
1393
1487
|
onFocusOutside,
|
|
1394
1488
|
onClickClose
|
|
1395
1489
|
}) {
|
|
1396
|
-
return /* @__PURE__ */
|
|
1490
|
+
return /* @__PURE__ */ React15.createElement(PopoverPrimitive.Root, { open, onOpenChange }, /* @__PURE__ */ React15.createElement(PopoverPrimitive.Trigger, { asChild: true }, trigger), /* @__PURE__ */ React15.createElement(PopoverPrimitive.Portal, null, /* @__PURE__ */ React15.createElement(
|
|
1397
1491
|
ContentElement,
|
|
1398
1492
|
{
|
|
1399
1493
|
variant,
|
|
@@ -1414,79 +1508,11 @@ function Popover({
|
|
|
1414
1508
|
}
|
|
1415
1509
|
},
|
|
1416
1510
|
children,
|
|
1417
|
-
showArrow && /* @__PURE__ */
|
|
1418
|
-
closable && /* @__PURE__ */
|
|
1511
|
+
showArrow && /* @__PURE__ */ React15.createElement(ArrowElement, null),
|
|
1512
|
+
closable && /* @__PURE__ */ React15.createElement(PopoverClose, null, /* @__PURE__ */ React15.createElement(IconButton, { iconName: "Cross2Icon", onClick: onClickClose }))
|
|
1419
1513
|
)));
|
|
1420
1514
|
}
|
|
1421
1515
|
|
|
1422
|
-
// src/components/Stack.tsx
|
|
1423
|
-
import React15, {
|
|
1424
|
-
Children as Children2,
|
|
1425
|
-
forwardRef as forwardRef6,
|
|
1426
|
-
memo as memo8
|
|
1427
|
-
} from "react";
|
|
1428
|
-
import styled11 from "styled-components";
|
|
1429
|
-
|
|
1430
|
-
// src/utils/breakpoints.ts
|
|
1431
|
-
function mergeBreakpoints(breakpoints, transform) {
|
|
1432
|
-
const breakpointMap = Array.isArray(breakpoints) ? breakpoints.reduce(
|
|
1433
|
-
(result, item) => {
|
|
1434
|
-
const [key, value] = item;
|
|
1435
|
-
result[key] = result[key] ? { ...result[key], ...value } : value;
|
|
1436
|
-
return result;
|
|
1437
|
-
},
|
|
1438
|
-
{}
|
|
1439
|
-
) : breakpoints;
|
|
1440
|
-
const breakpointList = Object.entries(breakpointMap);
|
|
1441
|
-
const transformedList = breakpointList.sort((a, b) => Number(b[0]) - Number(a[0])).map(([width, value]) => [
|
|
1442
|
-
`@media screen and (max-width: ${width}px)`,
|
|
1443
|
-
transform?.(value) ?? value
|
|
1444
|
-
]);
|
|
1445
|
-
return Object.fromEntries(transformedList);
|
|
1446
|
-
}
|
|
1447
|
-
|
|
1448
|
-
// src/components/Stack.tsx
|
|
1449
|
-
var Element = styled11.div(({ styleProps, breakpoints }) => ({
|
|
1450
|
-
...styleProps,
|
|
1451
|
-
...mergeBreakpoints(breakpoints || [])
|
|
1452
|
-
}));
|
|
1453
|
-
var StackBase = forwardRef6(function StackBase2({ id, as, children, separator, breakpoints, tabIndex, href, ...rest }, forwardedRef) {
|
|
1454
|
-
const elements2 = separator ? withSeparatorElements(Children2.toArray(children), separator) : children;
|
|
1455
|
-
const styleProps = {
|
|
1456
|
-
display: "flex",
|
|
1457
|
-
position: "relative",
|
|
1458
|
-
alignItems: "stretch",
|
|
1459
|
-
...rest
|
|
1460
|
-
};
|
|
1461
|
-
return /* @__PURE__ */ React15.createElement(
|
|
1462
|
-
Element,
|
|
1463
|
-
{
|
|
1464
|
-
ref: forwardedRef,
|
|
1465
|
-
id,
|
|
1466
|
-
as,
|
|
1467
|
-
styleProps,
|
|
1468
|
-
breakpoints,
|
|
1469
|
-
tabIndex,
|
|
1470
|
-
...href && { href }
|
|
1471
|
-
},
|
|
1472
|
-
elements2
|
|
1473
|
-
);
|
|
1474
|
-
});
|
|
1475
|
-
var VerticalStack = memo8(
|
|
1476
|
-
forwardRef6(function VStack(props, forwardedRef) {
|
|
1477
|
-
return /* @__PURE__ */ React15.createElement(StackBase, { ...props, flexDirection: "column", ref: forwardedRef });
|
|
1478
|
-
})
|
|
1479
|
-
);
|
|
1480
|
-
var HorizontalStack = memo8(
|
|
1481
|
-
forwardRef6(function HStack(props, forwardedRef) {
|
|
1482
|
-
return /* @__PURE__ */ React15.createElement(StackBase, { ...props, flexDirection: "row", ref: forwardedRef });
|
|
1483
|
-
})
|
|
1484
|
-
);
|
|
1485
|
-
var Stack = {
|
|
1486
|
-
V: VerticalStack,
|
|
1487
|
-
H: HorizontalStack
|
|
1488
|
-
};
|
|
1489
|
-
|
|
1490
1516
|
// src/components/InputField.tsx
|
|
1491
1517
|
var InputFieldContext = createContext2({
|
|
1492
1518
|
labelPosition: "end",
|
|
@@ -1517,7 +1543,7 @@ var LabelContainer = styled12.label(({ theme, labelPosition, hasDropdown, pointe
|
|
|
1517
1543
|
}
|
|
1518
1544
|
}));
|
|
1519
1545
|
var InputFieldLabel = memo9(
|
|
1520
|
-
|
|
1546
|
+
forwardRef8(function InputFieldLabel2({ children = false, pointerEvents = "none", style: style3 }, forwardedRef) {
|
|
1521
1547
|
const { labelPosition, hasDropdown, setLabelWidth } = useContext2(InputFieldContext);
|
|
1522
1548
|
const ref = useRef10(null);
|
|
1523
1549
|
useLayoutEffect4(() => {
|
|
@@ -1677,7 +1703,7 @@ var InputElement = styled12(TextInput_default).withConfig({
|
|
|
1677
1703
|
}
|
|
1678
1704
|
})
|
|
1679
1705
|
);
|
|
1680
|
-
var InputFieldInput =
|
|
1706
|
+
var InputFieldInput = forwardRef8(function InputFieldInput2(props, forwardedRef) {
|
|
1681
1707
|
const {
|
|
1682
1708
|
labelPosition,
|
|
1683
1709
|
labelSize,
|
|
@@ -2022,20 +2048,68 @@ function useDialogContainsElement() {
|
|
|
2022
2048
|
return useDialog().containsElement;
|
|
2023
2049
|
}
|
|
2024
2050
|
|
|
2051
|
+
// src/contexts/FloatingWindowContext.tsx
|
|
2052
|
+
import { uuid } from "@noya-app/noya-utils";
|
|
2053
|
+
import React18, { createContext as createContext4, useContext as useContext4, useMemo as useMemo8, useState as useState12 } from "react";
|
|
2054
|
+
import { createPortal } from "react-dom";
|
|
2055
|
+
var FloatingWindowContext = createContext4(void 0);
|
|
2056
|
+
var CurrentWindowContext = createContext4(void 0);
|
|
2057
|
+
var FloatingWindowProvider = ({
|
|
2058
|
+
children
|
|
2059
|
+
}) => {
|
|
2060
|
+
const [windows, setWindows] = useState12({});
|
|
2061
|
+
const contextValue = useMemo8(() => {
|
|
2062
|
+
const createWindow = (element) => {
|
|
2063
|
+
const id = uuid();
|
|
2064
|
+
setWindows((windows2) => ({
|
|
2065
|
+
...windows2,
|
|
2066
|
+
[id]: /* @__PURE__ */ React18.createElement(CurrentWindowContext.Provider, { value: { id } }, element)
|
|
2067
|
+
}));
|
|
2068
|
+
return id;
|
|
2069
|
+
};
|
|
2070
|
+
const closeWindow = (id) => {
|
|
2071
|
+
setWindows((windows2) => {
|
|
2072
|
+
const { [id]: _, ...rest } = windows2;
|
|
2073
|
+
return rest;
|
|
2074
|
+
});
|
|
2075
|
+
};
|
|
2076
|
+
return { createWindow, closeWindow };
|
|
2077
|
+
}, []);
|
|
2078
|
+
return /* @__PURE__ */ React18.createElement(FloatingWindowContext.Provider, { value: contextValue }, children, Object.entries(windows).map(
|
|
2079
|
+
([id, element]) => createPortal(element, document.body, id)
|
|
2080
|
+
));
|
|
2081
|
+
};
|
|
2082
|
+
var useFloatingWindowManager = () => {
|
|
2083
|
+
const context = useContext4(FloatingWindowContext);
|
|
2084
|
+
if (!context) {
|
|
2085
|
+
throw new Error(
|
|
2086
|
+
"useFloatingWindow must be used within a FloatingWindowProvider"
|
|
2087
|
+
);
|
|
2088
|
+
}
|
|
2089
|
+
return context;
|
|
2090
|
+
};
|
|
2091
|
+
var useCurrentFloatingWindowInternal = () => {
|
|
2092
|
+
const context = useContext4(CurrentWindowContext);
|
|
2093
|
+
if (!context) {
|
|
2094
|
+
throw new Error("useCurrentWindow must be used within a FloatingWindow");
|
|
2095
|
+
}
|
|
2096
|
+
return context;
|
|
2097
|
+
};
|
|
2098
|
+
|
|
2025
2099
|
// src/contexts/DesignSystemConfiguration.tsx
|
|
2026
|
-
var DesignSystemConfigurationContext =
|
|
2100
|
+
var DesignSystemConfigurationContext = createContext5(void 0);
|
|
2027
2101
|
var DesignSystemConfigurationProvider = memo10(
|
|
2028
2102
|
function DesignSystemConfigurationProvider2({
|
|
2029
2103
|
children,
|
|
2030
2104
|
theme,
|
|
2031
2105
|
platform
|
|
2032
2106
|
}) {
|
|
2033
|
-
const contextValue =
|
|
2034
|
-
return /* @__PURE__ */
|
|
2107
|
+
const contextValue = useMemo9(() => ({ platform }), [platform]);
|
|
2108
|
+
return /* @__PURE__ */ React19.createElement(DesignSystemConfigurationContext.Provider, { value: contextValue }, /* @__PURE__ */ React19.createElement(ThemeProvider, { theme }, /* @__PURE__ */ React19.createElement(DialogProvider, null, /* @__PURE__ */ React19.createElement(ToastProvider, null, /* @__PURE__ */ React19.createElement(FloatingWindowProvider, null, children)))));
|
|
2035
2109
|
}
|
|
2036
2110
|
);
|
|
2037
2111
|
function useDesignSystemConfiguration() {
|
|
2038
|
-
const value =
|
|
2112
|
+
const value = useContext5(DesignSystemConfigurationContext);
|
|
2039
2113
|
if (!value) {
|
|
2040
2114
|
throw new Error("Missing DesignSystemConfigurationProvider");
|
|
2041
2115
|
}
|
|
@@ -2046,7 +2120,7 @@ function useDesignSystemTheme() {
|
|
|
2046
2120
|
}
|
|
2047
2121
|
|
|
2048
2122
|
// src/hooks/useHover.ts
|
|
2049
|
-
import * as
|
|
2123
|
+
import * as React20 from "react";
|
|
2050
2124
|
var globalIgnoreEmulatedMouseEvents = false;
|
|
2051
2125
|
var hoverCount = 0;
|
|
2052
2126
|
function setGlobalIgnoreEmulatedMouseEvents() {
|
|
@@ -2076,13 +2150,13 @@ function setupGlobalTouchEvents() {
|
|
|
2076
2150
|
}
|
|
2077
2151
|
function useHover(props = {}) {
|
|
2078
2152
|
const { onHoverStart, onHoverChange, onHoverEnd, isDisabled } = props;
|
|
2079
|
-
const [isHovered, setHovered] =
|
|
2080
|
-
const state =
|
|
2153
|
+
const [isHovered, setHovered] = React20.useState(false);
|
|
2154
|
+
const state = React20.useRef({
|
|
2081
2155
|
isHovered: false,
|
|
2082
2156
|
ignoreEmulatedMouseEvents: false
|
|
2083
2157
|
}).current;
|
|
2084
|
-
|
|
2085
|
-
const hoverProps =
|
|
2158
|
+
React20.useEffect(setupGlobalTouchEvents, []);
|
|
2159
|
+
const hoverProps = React20.useMemo(
|
|
2086
2160
|
function getHoverProps() {
|
|
2087
2161
|
function triggerHoverStart(event, pointerType) {
|
|
2088
2162
|
if (isDisabled || pointerType === "touch" || state.isHovered) {
|
|
@@ -2244,7 +2318,7 @@ var Chip = memo11(function Chip2({
|
|
|
2244
2318
|
});
|
|
2245
2319
|
const handleClick = !children && !deletable && addable ? onAdd : onClick;
|
|
2246
2320
|
const color = colorScheme === "primary" ? theme.colors.primary : colorScheme === "secondary" ? theme.colors.secondary : theme.colors.text;
|
|
2247
|
-
return /* @__PURE__ */
|
|
2321
|
+
return /* @__PURE__ */ React21.createElement(
|
|
2248
2322
|
ChipElement,
|
|
2249
2323
|
{
|
|
2250
2324
|
variant,
|
|
@@ -2256,7 +2330,7 @@ var Chip = memo11(function Chip2({
|
|
|
2256
2330
|
isInteractive: !!handleClick,
|
|
2257
2331
|
tabIndex
|
|
2258
2332
|
},
|
|
2259
|
-
addable && /* @__PURE__ */
|
|
2333
|
+
addable && /* @__PURE__ */ React21.createElement(
|
|
2260
2334
|
AddElement,
|
|
2261
2335
|
{
|
|
2262
2336
|
size: size2,
|
|
@@ -2269,7 +2343,7 @@ var Chip = memo11(function Chip2({
|
|
|
2269
2343
|
}
|
|
2270
2344
|
),
|
|
2271
2345
|
children,
|
|
2272
|
-
deletable && /* @__PURE__ */
|
|
2346
|
+
deletable && /* @__PURE__ */ React21.createElement(
|
|
2273
2347
|
DeleteElement,
|
|
2274
2348
|
{
|
|
2275
2349
|
size: size2,
|
|
@@ -2288,10 +2362,10 @@ var Chip = memo11(function Chip2({
|
|
|
2288
2362
|
import { CheckIcon as CheckIcon2, ChevronRightIcon as ChevronRightIcon2 } from "@noya-app/noya-icons";
|
|
2289
2363
|
import { useKeyboardShortcuts as useKeyboardShortcuts2 } from "@noya-app/noya-keymap";
|
|
2290
2364
|
import * as RadixContextMenu from "@radix-ui/react-context-menu";
|
|
2291
|
-
import
|
|
2365
|
+
import React22, {
|
|
2292
2366
|
memo as memo12,
|
|
2293
2367
|
useCallback as useCallback13,
|
|
2294
|
-
useMemo as
|
|
2368
|
+
useMemo as useMemo11
|
|
2295
2369
|
} from "react";
|
|
2296
2370
|
import styled15 from "styled-components";
|
|
2297
2371
|
var SeparatorElement2 = styled15(RadixContextMenu.Separator)(
|
|
@@ -2325,32 +2399,32 @@ var ContextMenuItem2 = memo12(function ContextMenuItem3({
|
|
|
2325
2399
|
onSelect(value);
|
|
2326
2400
|
}, [onSelect, value]);
|
|
2327
2401
|
if (checked) {
|
|
2328
|
-
return /* @__PURE__ */
|
|
2402
|
+
return /* @__PURE__ */ React22.createElement(
|
|
2329
2403
|
CheckboxItemElement2,
|
|
2330
2404
|
{
|
|
2331
2405
|
checked,
|
|
2332
2406
|
disabled,
|
|
2333
2407
|
onSelect: handleSelectItem
|
|
2334
2408
|
},
|
|
2335
|
-
/* @__PURE__ */
|
|
2409
|
+
/* @__PURE__ */ React22.createElement(StyledItemIndicator2, null, /* @__PURE__ */ React22.createElement(CheckIcon2, null)),
|
|
2336
2410
|
children
|
|
2337
2411
|
);
|
|
2338
2412
|
}
|
|
2339
|
-
const element = /* @__PURE__ */
|
|
2413
|
+
const element = /* @__PURE__ */ React22.createElement(
|
|
2340
2414
|
ItemElement2,
|
|
2341
2415
|
{
|
|
2342
2416
|
disabled,
|
|
2343
2417
|
onSelect: handleSelectItem,
|
|
2344
2418
|
onPointerDown: handlePointerDown
|
|
2345
2419
|
},
|
|
2346
|
-
indented && /* @__PURE__ */
|
|
2347
|
-
icon && /* @__PURE__ */
|
|
2420
|
+
indented && /* @__PURE__ */ React22.createElement(Spacer.Horizontal, { size: CHECKBOX_WIDTH - CHECKBOX_RIGHT_INSET }),
|
|
2421
|
+
icon && /* @__PURE__ */ React22.createElement(React22.Fragment, null, icon, /* @__PURE__ */ React22.createElement(Spacer.Horizontal, { size: 8 })),
|
|
2348
2422
|
children,
|
|
2349
|
-
shortcut && /* @__PURE__ */
|
|
2350
|
-
items && items.length > 0 && /* @__PURE__ */
|
|
2423
|
+
shortcut && /* @__PURE__ */ React22.createElement(React22.Fragment, null, /* @__PURE__ */ React22.createElement(Spacer.Horizontal, null), /* @__PURE__ */ React22.createElement(Spacer.Horizontal, { size: 24 }), /* @__PURE__ */ React22.createElement(KeyboardShortcut, { shortcut })),
|
|
2424
|
+
items && items.length > 0 && /* @__PURE__ */ React22.createElement(React22.Fragment, null, /* @__PURE__ */ React22.createElement(Spacer.Horizontal, null), /* @__PURE__ */ React22.createElement(Spacer.Horizontal, { size: 16 }), /* @__PURE__ */ React22.createElement(ChevronRightIcon2, null))
|
|
2351
2425
|
);
|
|
2352
2426
|
if (items && items.length > 0) {
|
|
2353
|
-
return /* @__PURE__ */
|
|
2427
|
+
return /* @__PURE__ */ React22.createElement(ContextMenuRoot, { isNested: true, items, onSelect }, element);
|
|
2354
2428
|
} else {
|
|
2355
2429
|
return element;
|
|
2356
2430
|
}
|
|
@@ -2368,7 +2442,7 @@ function ContextMenuRoot({
|
|
|
2368
2442
|
const hasCheckedItem = items.some(
|
|
2369
2443
|
(item) => item !== SEPARATOR_ITEM && item.checked
|
|
2370
2444
|
);
|
|
2371
|
-
const keymap =
|
|
2445
|
+
const keymap = useMemo11(
|
|
2372
2446
|
() => isNested || shouldBindKeyboardShortcuts === false ? {} : getKeyboardShortcutsForMenuItems(items, onSelect),
|
|
2373
2447
|
[isNested, items, onSelect, shouldBindKeyboardShortcuts]
|
|
2374
2448
|
);
|
|
@@ -2379,8 +2453,8 @@ function ContextMenuRoot({
|
|
|
2379
2453
|
const RootComponent = isNested ? RadixContextMenu.Sub : RadixContextMenu.Root;
|
|
2380
2454
|
const TriggerComponent = isNested ? RadixContextMenu.SubTrigger : RadixContextMenu.Trigger;
|
|
2381
2455
|
const ContentComponent = isNested ? SubContent4 : Content8;
|
|
2382
|
-
return /* @__PURE__ */
|
|
2383
|
-
(item, index) => item === SEPARATOR_ITEM ? /* @__PURE__ */
|
|
2456
|
+
return /* @__PURE__ */ React22.createElement(RootComponent, { onOpenChange }, /* @__PURE__ */ React22.createElement(TriggerComponent, { asChild: true, onPointerDown }, children), /* @__PURE__ */ React22.createElement(RadixContextMenu.Portal, null, /* @__PURE__ */ React22.createElement(ContentComponent, null, items.map(
|
|
2457
|
+
(item, index) => item === SEPARATOR_ITEM ? /* @__PURE__ */ React22.createElement(SeparatorElement2, { key: index }) : /* @__PURE__ */ React22.createElement(
|
|
2384
2458
|
ContextMenuItem2,
|
|
2385
2459
|
{
|
|
2386
2460
|
key: item.value ?? index,
|
|
@@ -2400,7 +2474,7 @@ function ContextMenuRoot({
|
|
|
2400
2474
|
var ContextMenu = memo12(ContextMenuRoot);
|
|
2401
2475
|
|
|
2402
2476
|
// src/components/Divider.tsx
|
|
2403
|
-
import
|
|
2477
|
+
import React23, { memo as memo13 } from "react";
|
|
2404
2478
|
import styled16 from "styled-components";
|
|
2405
2479
|
var DividerContainer = styled16.div(({ theme, variant = "normal", orientation, overflow = 0 }) => ({
|
|
2406
2480
|
...orientation === "horizontal" ? { height: "1px", minHeight: "1px", margin: `0px -${overflow}px` } : { width: "1px", minWidth: "1px", margin: `-${overflow}px 0px` },
|
|
@@ -2408,15 +2482,15 @@ var DividerContainer = styled16.div(({ theme, variant = "normal", orientation, o
|
|
|
2408
2482
|
alignSelf: "stretch"
|
|
2409
2483
|
}));
|
|
2410
2484
|
var Divider = memo13(function Divider2(props) {
|
|
2411
|
-
return /* @__PURE__ */
|
|
2485
|
+
return /* @__PURE__ */ React23.createElement(DividerContainer, { orientation: "horizontal", ...props });
|
|
2412
2486
|
});
|
|
2413
2487
|
var DividerVertical = memo13(function DividerVertical2(props) {
|
|
2414
|
-
return /* @__PURE__ */
|
|
2488
|
+
return /* @__PURE__ */ React23.createElement(DividerContainer, { orientation: "vertical", ...props });
|
|
2415
2489
|
});
|
|
2416
2490
|
|
|
2417
2491
|
// src/components/DraggableMenuButton.tsx
|
|
2418
2492
|
import { DragHandleDots2Icon } from "@noya-app/noya-icons";
|
|
2419
|
-
import
|
|
2493
|
+
import React24, { memo as memo14, useCallback as useCallback14, useState as useState14 } from "react";
|
|
2420
2494
|
import styled17 from "styled-components";
|
|
2421
2495
|
var DotButtonElement = styled17.div(({ theme }) => ({
|
|
2422
2496
|
cursor: "pointer",
|
|
@@ -2442,8 +2516,8 @@ var DraggableMenuButton = memo14(function DraggableMenuButton2({
|
|
|
2442
2516
|
isVisible = true
|
|
2443
2517
|
}) {
|
|
2444
2518
|
const color = useDesignSystemTheme().colors.icon;
|
|
2445
|
-
const [open, setOpen] =
|
|
2446
|
-
const [downPosition, setDownPosition] =
|
|
2519
|
+
const [open, setOpen] = useState14(false);
|
|
2520
|
+
const [downPosition, setDownPosition] = React24.useState(null);
|
|
2447
2521
|
const handlePointerDownCapture = useCallback14(
|
|
2448
2522
|
(event) => {
|
|
2449
2523
|
if (open) {
|
|
@@ -2480,7 +2554,7 @@ var DraggableMenuButton = memo14(function DraggableMenuButton2({
|
|
|
2480
2554
|
},
|
|
2481
2555
|
[setOpen]
|
|
2482
2556
|
);
|
|
2483
|
-
return /* @__PURE__ */
|
|
2557
|
+
return /* @__PURE__ */ React24.createElement(
|
|
2484
2558
|
DotButtonElement,
|
|
2485
2559
|
{
|
|
2486
2560
|
onPointerDownCapture: handlePointerDownCapture,
|
|
@@ -2490,7 +2564,7 @@ var DraggableMenuButton = memo14(function DraggableMenuButton2({
|
|
|
2490
2564
|
event.preventDefault();
|
|
2491
2565
|
}
|
|
2492
2566
|
},
|
|
2493
|
-
items && onSelect ? /* @__PURE__ */
|
|
2567
|
+
items && onSelect ? /* @__PURE__ */ React24.createElement(
|
|
2494
2568
|
DropdownMenu,
|
|
2495
2569
|
{
|
|
2496
2570
|
open,
|
|
@@ -2499,13 +2573,13 @@ var DraggableMenuButton = memo14(function DraggableMenuButton2({
|
|
|
2499
2573
|
onSelect,
|
|
2500
2574
|
shouldBindKeyboardShortcuts: false
|
|
2501
2575
|
},
|
|
2502
|
-
/* @__PURE__ */
|
|
2576
|
+
/* @__PURE__ */ React24.createElement(TriggerElement, null, /* @__PURE__ */ React24.createElement(
|
|
2503
2577
|
DragHandleDots2Icon,
|
|
2504
2578
|
{
|
|
2505
2579
|
color: isVisible || open ? color : "transparent"
|
|
2506
2580
|
}
|
|
2507
2581
|
))
|
|
2508
|
-
) : /* @__PURE__ */
|
|
2582
|
+
) : /* @__PURE__ */ React24.createElement(
|
|
2509
2583
|
DragHandleDots2Icon,
|
|
2510
2584
|
{
|
|
2511
2585
|
color: isVisible || open ? color : "transparent"
|
|
@@ -2515,7 +2589,7 @@ var DraggableMenuButton = memo14(function DraggableMenuButton2({
|
|
|
2515
2589
|
});
|
|
2516
2590
|
|
|
2517
2591
|
// src/components/FillInputField.tsx
|
|
2518
|
-
import
|
|
2592
|
+
import React27, { forwardRef as forwardRef9, memo as memo17 } from "react";
|
|
2519
2593
|
import styled19 from "styled-components";
|
|
2520
2594
|
|
|
2521
2595
|
// ../noya-file-format/src/types.ts
|
|
@@ -2841,31 +2915,31 @@ var ClassValue = /* @__PURE__ */ ((ClassValue2) => {
|
|
|
2841
2915
|
})(ClassValue || {});
|
|
2842
2916
|
|
|
2843
2917
|
// src/components/FillPreviewBackground.tsx
|
|
2844
|
-
import
|
|
2918
|
+
import React26, { memo as memo16, useMemo as useMemo14 } from "react";
|
|
2845
2919
|
import styled18, { useTheme as useTheme3 } from "styled-components";
|
|
2846
2920
|
|
|
2847
2921
|
// src/contexts/ImageDataContext.tsx
|
|
2848
|
-
import
|
|
2849
|
-
createContext as
|
|
2922
|
+
import React25, {
|
|
2923
|
+
createContext as createContext6,
|
|
2850
2924
|
memo as memo15,
|
|
2851
|
-
useContext as
|
|
2852
|
-
useMemo as
|
|
2925
|
+
useContext as useContext6,
|
|
2926
|
+
useMemo as useMemo12
|
|
2853
2927
|
} from "react";
|
|
2854
|
-
var ImageDataContext =
|
|
2928
|
+
var ImageDataContext = createContext6(
|
|
2855
2929
|
void 0
|
|
2856
2930
|
);
|
|
2857
2931
|
var ImageDataProvider = memo15(function ImageDataProvider2({
|
|
2858
2932
|
children,
|
|
2859
2933
|
getImageData
|
|
2860
2934
|
}) {
|
|
2861
|
-
const contextValue =
|
|
2935
|
+
const contextValue = useMemo12(
|
|
2862
2936
|
() => ({ getImageData: getImageData ?? (() => void 0) }),
|
|
2863
2937
|
[getImageData]
|
|
2864
2938
|
);
|
|
2865
|
-
return /* @__PURE__ */
|
|
2939
|
+
return /* @__PURE__ */ React25.createElement(ImageDataContext.Provider, { value: contextValue }, children);
|
|
2866
2940
|
});
|
|
2867
2941
|
function useImageData(ref) {
|
|
2868
|
-
const value =
|
|
2942
|
+
const value = useContext6(ImageDataContext);
|
|
2869
2943
|
if (!value) {
|
|
2870
2944
|
throw new Error("Missing ImageDataProvider");
|
|
2871
2945
|
}
|
|
@@ -2873,9 +2947,9 @@ function useImageData(ref) {
|
|
|
2873
2947
|
}
|
|
2874
2948
|
|
|
2875
2949
|
// src/hooks/useObjectURL.ts
|
|
2876
|
-
import { useLayoutEffect as useLayoutEffect5, useMemo as
|
|
2950
|
+
import { useLayoutEffect as useLayoutEffect5, useMemo as useMemo13 } from "react";
|
|
2877
2951
|
function useObjectURL(object) {
|
|
2878
|
-
const objectURL =
|
|
2952
|
+
const objectURL = useMemo13(() => {
|
|
2879
2953
|
if (object instanceof Blob)
|
|
2880
2954
|
return URL.createObjectURL(object);
|
|
2881
2955
|
const bytes = object instanceof Uint8Array ? object : object !== void 0 ? new Uint8Array(object) : new Uint8Array();
|
|
@@ -2943,7 +3017,7 @@ var Background = styled18.span(({ background }) => ({
|
|
|
2943
3017
|
}));
|
|
2944
3018
|
var HorizontalDotsBackground = memo16(function HorizontalDotsBackground2() {
|
|
2945
3019
|
const { inputBackground, placeholderDots } = useTheme3().colors;
|
|
2946
|
-
const background =
|
|
3020
|
+
const background = useMemo14(
|
|
2947
3021
|
() => [
|
|
2948
3022
|
`center url("data:image/svg+xml;utf8,${dotsHorizontalSvg(
|
|
2949
3023
|
placeholderDots
|
|
@@ -2952,7 +3026,7 @@ var HorizontalDotsBackground = memo16(function HorizontalDotsBackground2() {
|
|
|
2952
3026
|
].join(","),
|
|
2953
3027
|
[inputBackground, placeholderDots]
|
|
2954
3028
|
);
|
|
2955
|
-
return /* @__PURE__ */
|
|
3029
|
+
return /* @__PURE__ */ React26.createElement(Background, { background });
|
|
2956
3030
|
});
|
|
2957
3031
|
function getPatternSizeAndPosition(fillType, tileScale) {
|
|
2958
3032
|
switch (fillType) {
|
|
@@ -2974,7 +3048,7 @@ var PatternPreviewBackground = memo16(function PatternPreviewBackground2({
|
|
|
2974
3048
|
const image = useImageData(imageRef);
|
|
2975
3049
|
const url = useObjectURL(image);
|
|
2976
3050
|
const size2 = getPatternSizeAndPosition(fillType, tileScale);
|
|
2977
|
-
const background =
|
|
3051
|
+
const background = useMemo14(
|
|
2978
3052
|
() => [
|
|
2979
3053
|
size2,
|
|
2980
3054
|
`url(${url})`,
|
|
@@ -2982,37 +3056,37 @@ var PatternPreviewBackground = memo16(function PatternPreviewBackground2({
|
|
|
2982
3056
|
].join(" "),
|
|
2983
3057
|
[fillType, size2, url]
|
|
2984
3058
|
);
|
|
2985
|
-
return /* @__PURE__ */
|
|
3059
|
+
return /* @__PURE__ */ React26.createElement(Background, { background });
|
|
2986
3060
|
});
|
|
2987
3061
|
var ColorPreviewBackground = memo16(function ColorPreviewBackground2({
|
|
2988
3062
|
color
|
|
2989
3063
|
}) {
|
|
2990
|
-
const background =
|
|
2991
|
-
return /* @__PURE__ */
|
|
3064
|
+
const background = useMemo14(() => sketchColorToRgbaString(color), [color]);
|
|
3065
|
+
return /* @__PURE__ */ React26.createElement(Background, { background });
|
|
2992
3066
|
});
|
|
2993
3067
|
var GradientPreviewBackground = memo16(function GradientPreviewBackground2({
|
|
2994
3068
|
gradient
|
|
2995
3069
|
}) {
|
|
2996
|
-
const background =
|
|
3070
|
+
const background = useMemo14(
|
|
2997
3071
|
() => getGradientBackground(gradient.stops, gradient.gradientType, 180),
|
|
2998
3072
|
[gradient.gradientType, gradient.stops]
|
|
2999
3073
|
);
|
|
3000
|
-
return /* @__PURE__ */
|
|
3074
|
+
return /* @__PURE__ */ React26.createElement(Background, { background });
|
|
3001
3075
|
});
|
|
3002
3076
|
var FillPreviewBackground = memo16(function FillPreviewBackground2({
|
|
3003
3077
|
value
|
|
3004
3078
|
}) {
|
|
3005
3079
|
if (!value)
|
|
3006
|
-
return /* @__PURE__ */
|
|
3080
|
+
return /* @__PURE__ */ React26.createElement(HorizontalDotsBackground, null);
|
|
3007
3081
|
switch (value._class) {
|
|
3008
3082
|
case "color":
|
|
3009
|
-
return /* @__PURE__ */
|
|
3083
|
+
return /* @__PURE__ */ React26.createElement(ColorPreviewBackground, { color: value });
|
|
3010
3084
|
case "gradient":
|
|
3011
|
-
return /* @__PURE__ */
|
|
3085
|
+
return /* @__PURE__ */ React26.createElement(GradientPreviewBackground, { gradient: value });
|
|
3012
3086
|
case "pattern":
|
|
3013
3087
|
if (!value.image)
|
|
3014
3088
|
return null;
|
|
3015
|
-
return /* @__PURE__ */
|
|
3089
|
+
return /* @__PURE__ */ React26.createElement(
|
|
3016
3090
|
PatternPreviewBackground,
|
|
3017
3091
|
{
|
|
3018
3092
|
fillType: value.patternFillType,
|
|
@@ -3043,11 +3117,280 @@ var Container = styled19.button(
|
|
|
3043
3117
|
})
|
|
3044
3118
|
);
|
|
3045
3119
|
var FillInputField = memo17(
|
|
3046
|
-
|
|
3047
|
-
return /* @__PURE__ */
|
|
3120
|
+
forwardRef9(function FillInputField2({ id, value, ...rest }, ref) {
|
|
3121
|
+
return /* @__PURE__ */ React27.createElement(Container, { ref, id, ...rest }, /* @__PURE__ */ React27.createElement(FillPreviewBackground, { value }));
|
|
3048
3122
|
})
|
|
3049
3123
|
);
|
|
3050
3124
|
|
|
3125
|
+
// src/components/FloatingWindow.tsx
|
|
3126
|
+
import React28, { useCallback as useCallback15, useRef as useRef13, useState as useState15 } from "react";
|
|
3127
|
+
var styles2 = {
|
|
3128
|
+
noSelect: {
|
|
3129
|
+
userSelect: "none",
|
|
3130
|
+
WebkitUserSelect: "none",
|
|
3131
|
+
MozUserSelect: "none",
|
|
3132
|
+
msUserSelect: "none"
|
|
3133
|
+
},
|
|
3134
|
+
windowWrapper: {
|
|
3135
|
+
position: "absolute",
|
|
3136
|
+
backgroundColor: "white",
|
|
3137
|
+
borderRadius: "4px",
|
|
3138
|
+
boxShadow: "0 2px 10px rgba(0, 0, 0, 0.1)",
|
|
3139
|
+
overflow: "hidden"
|
|
3140
|
+
// backdropFilter: "blur(10px)",
|
|
3141
|
+
},
|
|
3142
|
+
toolbar: {
|
|
3143
|
+
display: "flex",
|
|
3144
|
+
alignItems: "center",
|
|
3145
|
+
padding: "8px 12px",
|
|
3146
|
+
cursor: "move",
|
|
3147
|
+
userSelect: "none",
|
|
3148
|
+
minHeight: "43px"
|
|
3149
|
+
},
|
|
3150
|
+
closeButton: {
|
|
3151
|
+
background: "none",
|
|
3152
|
+
border: "none",
|
|
3153
|
+
fontSize: "16px",
|
|
3154
|
+
cursor: "pointer"
|
|
3155
|
+
},
|
|
3156
|
+
content: {
|
|
3157
|
+
padding: "12px",
|
|
3158
|
+
height: "calc(100% - 44px)",
|
|
3159
|
+
// Adjust based on toolbar height
|
|
3160
|
+
overflow: "auto",
|
|
3161
|
+
display: "flex",
|
|
3162
|
+
flexDirection: "column"
|
|
3163
|
+
},
|
|
3164
|
+
resizeHandle: {
|
|
3165
|
+
position: "absolute"
|
|
3166
|
+
}
|
|
3167
|
+
};
|
|
3168
|
+
var resizeHandlePositions = {
|
|
3169
|
+
top: { top: "0", left: "0", right: "0", height: "5px", cursor: "ns-resize" },
|
|
3170
|
+
right: {
|
|
3171
|
+
top: "0",
|
|
3172
|
+
right: "0",
|
|
3173
|
+
bottom: "0",
|
|
3174
|
+
width: "5px",
|
|
3175
|
+
cursor: "ew-resize"
|
|
3176
|
+
},
|
|
3177
|
+
bottom: {
|
|
3178
|
+
bottom: "0",
|
|
3179
|
+
left: "0",
|
|
3180
|
+
right: "0",
|
|
3181
|
+
height: "5px",
|
|
3182
|
+
cursor: "ns-resize"
|
|
3183
|
+
},
|
|
3184
|
+
left: { top: "0", left: "0", bottom: "0", width: "5px", cursor: "ew-resize" },
|
|
3185
|
+
topLeft: {
|
|
3186
|
+
top: "0",
|
|
3187
|
+
left: "0",
|
|
3188
|
+
width: "10px",
|
|
3189
|
+
height: "10px",
|
|
3190
|
+
cursor: "nwse-resize"
|
|
3191
|
+
},
|
|
3192
|
+
topRight: {
|
|
3193
|
+
top: "0",
|
|
3194
|
+
right: "0",
|
|
3195
|
+
width: "10px",
|
|
3196
|
+
height: "10px",
|
|
3197
|
+
cursor: "nesw-resize"
|
|
3198
|
+
},
|
|
3199
|
+
bottomLeft: {
|
|
3200
|
+
bottom: "0",
|
|
3201
|
+
left: "0",
|
|
3202
|
+
width: "10px",
|
|
3203
|
+
height: "10px",
|
|
3204
|
+
cursor: "nesw-resize"
|
|
3205
|
+
},
|
|
3206
|
+
bottomRight: {
|
|
3207
|
+
bottom: "0",
|
|
3208
|
+
right: "0",
|
|
3209
|
+
width: "10px",
|
|
3210
|
+
height: "10px",
|
|
3211
|
+
cursor: "nwse-resize"
|
|
3212
|
+
}
|
|
3213
|
+
};
|
|
3214
|
+
function defaultRenderToolbar({
|
|
3215
|
+
title,
|
|
3216
|
+
toolbarContent,
|
|
3217
|
+
onClose
|
|
3218
|
+
}) {
|
|
3219
|
+
return /* @__PURE__ */ React28.createElement(React28.Fragment, null, /* @__PURE__ */ React28.createElement(Small, { flex: "1", fontWeight: "500", color: "text" }, title), toolbarContent, /* @__PURE__ */ React28.createElement(
|
|
3220
|
+
IconButton,
|
|
3221
|
+
{
|
|
3222
|
+
iconName: "Cross3Icon",
|
|
3223
|
+
onClick: onClose,
|
|
3224
|
+
style: {
|
|
3225
|
+
marginLeft: "6px",
|
|
3226
|
+
marginRight: "-6px"
|
|
3227
|
+
}
|
|
3228
|
+
}
|
|
3229
|
+
));
|
|
3230
|
+
}
|
|
3231
|
+
var FloatingWindow = ({
|
|
3232
|
+
title,
|
|
3233
|
+
onClose,
|
|
3234
|
+
children,
|
|
3235
|
+
initialWidth = 300,
|
|
3236
|
+
initialHeight = 200,
|
|
3237
|
+
initialX = 100,
|
|
3238
|
+
initialY = 100,
|
|
3239
|
+
minWidth = 200,
|
|
3240
|
+
minHeight = 100,
|
|
3241
|
+
toolbarContent,
|
|
3242
|
+
renderToolbar = defaultRenderToolbar
|
|
3243
|
+
}) => {
|
|
3244
|
+
const [position, setPosition] = useState15({ x: initialX, y: initialY });
|
|
3245
|
+
const [size2, setSize] = useState15({
|
|
3246
|
+
width: initialWidth,
|
|
3247
|
+
height: initialHeight
|
|
3248
|
+
});
|
|
3249
|
+
const [isDragging, setIsDragging] = useState15(false);
|
|
3250
|
+
const [isResizing, setIsResizing] = useState15(false);
|
|
3251
|
+
const [dragOffset, setDragOffset] = useState15({ x: 0, y: 0 });
|
|
3252
|
+
const [resizeDirection, setResizeDirection] = useState15(null);
|
|
3253
|
+
const wrapperRef = useRef13(null);
|
|
3254
|
+
const toggleGlobalTextSelection = (disable) => {
|
|
3255
|
+
if (disable) {
|
|
3256
|
+
document.body.style.userSelect = "none";
|
|
3257
|
+
} else {
|
|
3258
|
+
document.body.style.userSelect = "";
|
|
3259
|
+
}
|
|
3260
|
+
};
|
|
3261
|
+
const handleMouseDown = useCallback15((e) => {
|
|
3262
|
+
if (!wrapperRef.current)
|
|
3263
|
+
return;
|
|
3264
|
+
const rect = wrapperRef.current.getBoundingClientRect();
|
|
3265
|
+
setDragOffset({
|
|
3266
|
+
x: e.clientX - rect.left,
|
|
3267
|
+
y: e.clientY - rect.top
|
|
3268
|
+
});
|
|
3269
|
+
setIsDragging(true);
|
|
3270
|
+
}, []);
|
|
3271
|
+
const handleResizeStart = useCallback15(
|
|
3272
|
+
(direction) => (e) => {
|
|
3273
|
+
e.stopPropagation();
|
|
3274
|
+
setIsResizing(true);
|
|
3275
|
+
setResizeDirection(direction);
|
|
3276
|
+
toggleGlobalTextSelection(true);
|
|
3277
|
+
},
|
|
3278
|
+
[]
|
|
3279
|
+
);
|
|
3280
|
+
const handleMouseMove = useCallback15(
|
|
3281
|
+
(e) => {
|
|
3282
|
+
if (isDragging) {
|
|
3283
|
+
setPosition({
|
|
3284
|
+
x: e.clientX - dragOffset.x,
|
|
3285
|
+
y: e.clientY - dragOffset.y
|
|
3286
|
+
});
|
|
3287
|
+
} else if (isResizing && resizeDirection) {
|
|
3288
|
+
const rect = wrapperRef.current.getBoundingClientRect();
|
|
3289
|
+
let newWidth = size2.width;
|
|
3290
|
+
let newHeight = size2.height;
|
|
3291
|
+
let newX = position.x;
|
|
3292
|
+
let newY = position.y;
|
|
3293
|
+
if (/right/i.test(resizeDirection)) {
|
|
3294
|
+
newWidth = Math.max(e.clientX - rect.left, minWidth);
|
|
3295
|
+
}
|
|
3296
|
+
if (/bottom/i.test(resizeDirection)) {
|
|
3297
|
+
newHeight = Math.max(e.clientY - rect.top, minHeight);
|
|
3298
|
+
}
|
|
3299
|
+
if (/left/i.test(resizeDirection)) {
|
|
3300
|
+
const potentialWidth = rect.right - e.clientX;
|
|
3301
|
+
if (potentialWidth <= minWidth) {
|
|
3302
|
+
newWidth = minWidth;
|
|
3303
|
+
newX = rect.right - minWidth;
|
|
3304
|
+
} else {
|
|
3305
|
+
newWidth = potentialWidth;
|
|
3306
|
+
newX = e.clientX;
|
|
3307
|
+
}
|
|
3308
|
+
}
|
|
3309
|
+
if (/top/i.test(resizeDirection)) {
|
|
3310
|
+
const potentialHeight = rect.bottom - e.clientY;
|
|
3311
|
+
if (potentialHeight <= minHeight) {
|
|
3312
|
+
newHeight = minHeight;
|
|
3313
|
+
newY = rect.bottom - minHeight;
|
|
3314
|
+
} else {
|
|
3315
|
+
newHeight = potentialHeight;
|
|
3316
|
+
newY = e.clientY;
|
|
3317
|
+
}
|
|
3318
|
+
}
|
|
3319
|
+
setSize({ width: newWidth, height: newHeight });
|
|
3320
|
+
setPosition({ x: newX, y: newY });
|
|
3321
|
+
}
|
|
3322
|
+
},
|
|
3323
|
+
[
|
|
3324
|
+
isDragging,
|
|
3325
|
+
isResizing,
|
|
3326
|
+
dragOffset,
|
|
3327
|
+
resizeDirection,
|
|
3328
|
+
size2,
|
|
3329
|
+
position,
|
|
3330
|
+
minWidth,
|
|
3331
|
+
minHeight
|
|
3332
|
+
]
|
|
3333
|
+
);
|
|
3334
|
+
const handleMouseUp = useCallback15((e) => {
|
|
3335
|
+
setIsDragging(false);
|
|
3336
|
+
setIsResizing(false);
|
|
3337
|
+
setResizeDirection(null);
|
|
3338
|
+
toggleGlobalTextSelection(false);
|
|
3339
|
+
}, []);
|
|
3340
|
+
React28.useEffect(() => {
|
|
3341
|
+
document.addEventListener("mousemove", handleMouseMove);
|
|
3342
|
+
document.addEventListener("mouseup", handleMouseUp);
|
|
3343
|
+
return () => {
|
|
3344
|
+
document.removeEventListener("mousemove", handleMouseMove);
|
|
3345
|
+
document.removeEventListener("mouseup", handleMouseUp);
|
|
3346
|
+
};
|
|
3347
|
+
}, [handleMouseMove, handleMouseUp]);
|
|
3348
|
+
const theme = useDesignSystemTheme();
|
|
3349
|
+
const floatingWindowManager = useFloatingWindowManager();
|
|
3350
|
+
const currentFloatingWindow = useCurrentFloatingWindowInternal();
|
|
3351
|
+
const handleClose = useCallback15(() => {
|
|
3352
|
+
if (onClose)
|
|
3353
|
+
onClose();
|
|
3354
|
+
floatingWindowManager.closeWindow(currentFloatingWindow.id);
|
|
3355
|
+
}, [currentFloatingWindow.id, floatingWindowManager, onClose]);
|
|
3356
|
+
return /* @__PURE__ */ React28.createElement(
|
|
3357
|
+
"div",
|
|
3358
|
+
{
|
|
3359
|
+
ref: wrapperRef,
|
|
3360
|
+
style: {
|
|
3361
|
+
...styles2.windowWrapper,
|
|
3362
|
+
top: position.y,
|
|
3363
|
+
left: position.x,
|
|
3364
|
+
width: size2.width,
|
|
3365
|
+
height: size2.height,
|
|
3366
|
+
outline: `1px solid ${theme.colors.divider}`,
|
|
3367
|
+
backgroundColor: theme.colors.canvas.background
|
|
3368
|
+
}
|
|
3369
|
+
},
|
|
3370
|
+
/* @__PURE__ */ React28.createElement(
|
|
3371
|
+
"div",
|
|
3372
|
+
{
|
|
3373
|
+
style: {
|
|
3374
|
+
...styles2.toolbar,
|
|
3375
|
+
backgroundColor: theme.colors.sidebar.background
|
|
3376
|
+
},
|
|
3377
|
+
onMouseDown: handleMouseDown
|
|
3378
|
+
},
|
|
3379
|
+
renderToolbar({ title, toolbarContent, onClose: handleClose })
|
|
3380
|
+
),
|
|
3381
|
+
/* @__PURE__ */ React28.createElement(Divider, null),
|
|
3382
|
+
/* @__PURE__ */ React28.createElement("div", { style: styles2.content }, children),
|
|
3383
|
+
Object.entries(resizeHandlePositions).map(([direction, style3]) => /* @__PURE__ */ React28.createElement(
|
|
3384
|
+
"div",
|
|
3385
|
+
{
|
|
3386
|
+
key: direction,
|
|
3387
|
+
style: { ...styles2.resizeHandle, ...style3 },
|
|
3388
|
+
onMouseDown: handleResizeStart(direction)
|
|
3389
|
+
}
|
|
3390
|
+
))
|
|
3391
|
+
);
|
|
3392
|
+
};
|
|
3393
|
+
|
|
3051
3394
|
// src/components/GradientPicker.tsx
|
|
3052
3395
|
import {
|
|
3053
3396
|
Alpha,
|
|
@@ -3059,7 +3402,7 @@ import {
|
|
|
3059
3402
|
hsvaToRgba,
|
|
3060
3403
|
rgbaToHsva as rgbaToHsva2
|
|
3061
3404
|
} from "@noya-app/noya-colorpicker";
|
|
3062
|
-
import
|
|
3405
|
+
import React29, { memo as memo18, useCallback as useCallback16, useMemo as useMemo15 } from "react";
|
|
3063
3406
|
var GradientPicker = memo18(function GradientPicker2({
|
|
3064
3407
|
value,
|
|
3065
3408
|
selectedStop,
|
|
@@ -3069,7 +3412,7 @@ var GradientPicker = memo18(function GradientPicker2({
|
|
|
3069
3412
|
onDelete,
|
|
3070
3413
|
onSelectStop
|
|
3071
3414
|
}) {
|
|
3072
|
-
const colorModel =
|
|
3415
|
+
const colorModel = useMemo15(
|
|
3073
3416
|
() => ({
|
|
3074
3417
|
defaultColor: { r: 0, g: 0, b: 0, a: 1 },
|
|
3075
3418
|
toHsva: rgbaToHsva2,
|
|
@@ -3078,30 +3421,30 @@ var GradientPicker = memo18(function GradientPicker2({
|
|
|
3078
3421
|
}),
|
|
3079
3422
|
[]
|
|
3080
3423
|
);
|
|
3081
|
-
const rgbaColor =
|
|
3424
|
+
const rgbaColor = useMemo15(
|
|
3082
3425
|
() => sketchColorToRgba(value[selectedStop].color),
|
|
3083
3426
|
[value, selectedStop]
|
|
3084
3427
|
);
|
|
3085
|
-
const handleChangeColor =
|
|
3428
|
+
const handleChangeColor = useCallback16(
|
|
3086
3429
|
(value2) => {
|
|
3087
3430
|
onChangeColor(rgbaToSketchColor(value2));
|
|
3088
3431
|
},
|
|
3089
3432
|
[onChangeColor]
|
|
3090
3433
|
);
|
|
3091
|
-
const handleAddGradientStop =
|
|
3434
|
+
const handleAddGradientStop = useCallback16(
|
|
3092
3435
|
(value2, position) => {
|
|
3093
3436
|
onAdd(rgbaToSketchColor(value2), position);
|
|
3094
3437
|
},
|
|
3095
3438
|
[onAdd]
|
|
3096
3439
|
);
|
|
3097
|
-
return /* @__PURE__ */
|
|
3440
|
+
return /* @__PURE__ */ React29.createElement(
|
|
3098
3441
|
NoyaColorPicker,
|
|
3099
3442
|
{
|
|
3100
3443
|
onChange: handleChangeColor,
|
|
3101
3444
|
colorModel,
|
|
3102
3445
|
color: rgbaColor
|
|
3103
3446
|
},
|
|
3104
|
-
/* @__PURE__ */
|
|
3447
|
+
/* @__PURE__ */ React29.createElement(
|
|
3105
3448
|
Gradient,
|
|
3106
3449
|
{
|
|
3107
3450
|
gradients: value,
|
|
@@ -3112,12 +3455,12 @@ var GradientPicker = memo18(function GradientPicker2({
|
|
|
3112
3455
|
onDelete
|
|
3113
3456
|
}
|
|
3114
3457
|
),
|
|
3115
|
-
/* @__PURE__ */
|
|
3116
|
-
/* @__PURE__ */
|
|
3117
|
-
/* @__PURE__ */
|
|
3118
|
-
/* @__PURE__ */
|
|
3119
|
-
/* @__PURE__ */
|
|
3120
|
-
/* @__PURE__ */
|
|
3458
|
+
/* @__PURE__ */ React29.createElement(Spacer.Vertical, { size: 10 }),
|
|
3459
|
+
/* @__PURE__ */ React29.createElement(Saturation, null),
|
|
3460
|
+
/* @__PURE__ */ React29.createElement(Spacer.Vertical, { size: 12 }),
|
|
3461
|
+
/* @__PURE__ */ React29.createElement(Hue, null),
|
|
3462
|
+
/* @__PURE__ */ React29.createElement(Spacer.Vertical, { size: 5 }),
|
|
3463
|
+
/* @__PURE__ */ React29.createElement(Alpha, null)
|
|
3121
3464
|
);
|
|
3122
3465
|
});
|
|
3123
3466
|
|
|
@@ -3149,19 +3492,19 @@ var Grid = styled20.div((props) => ({
|
|
|
3149
3492
|
}));
|
|
3150
3493
|
|
|
3151
3494
|
// src/components/GridView.tsx
|
|
3152
|
-
import
|
|
3153
|
-
createContext as
|
|
3154
|
-
forwardRef as
|
|
3495
|
+
import React31, {
|
|
3496
|
+
createContext as createContext7,
|
|
3497
|
+
forwardRef as forwardRef10,
|
|
3155
3498
|
memo as memo20,
|
|
3156
|
-
useCallback as
|
|
3157
|
-
useContext as
|
|
3158
|
-
useMemo as
|
|
3499
|
+
useCallback as useCallback18,
|
|
3500
|
+
useContext as useContext7,
|
|
3501
|
+
useMemo as useMemo16
|
|
3159
3502
|
} from "react";
|
|
3160
3503
|
import styled22, { keyframes as keyframes2 } from "styled-components";
|
|
3161
3504
|
|
|
3162
3505
|
// src/components/ScrollArea.tsx
|
|
3163
3506
|
import * as RadixScrollArea from "@radix-ui/react-scroll-area";
|
|
3164
|
-
import
|
|
3507
|
+
import React30, { memo as memo19, useCallback as useCallback17, useState as useState16 } from "react";
|
|
3165
3508
|
import styled21 from "styled-components";
|
|
3166
3509
|
var SCROLLBAR_SIZE = 10;
|
|
3167
3510
|
var StyledViewport = styled21(RadixScrollArea.Viewport)({
|
|
@@ -3190,17 +3533,17 @@ var Container2 = styled21.div({
|
|
|
3190
3533
|
minHeight: 0
|
|
3191
3534
|
});
|
|
3192
3535
|
var ScrollArea = memo19(function ScrollArea2({ children }) {
|
|
3193
|
-
const [scrollElementRef, setScrollElementRef] =
|
|
3194
|
-
return /* @__PURE__ */
|
|
3536
|
+
const [scrollElementRef, setScrollElementRef] = useState16(null);
|
|
3537
|
+
return /* @__PURE__ */ React30.createElement(Container2, null, /* @__PURE__ */ React30.createElement(RadixScrollArea.Root, { style: { width: "100%", height: "100%" } }, /* @__PURE__ */ React30.createElement(
|
|
3195
3538
|
StyledViewport,
|
|
3196
3539
|
{
|
|
3197
|
-
ref:
|
|
3540
|
+
ref: useCallback17(
|
|
3198
3541
|
(ref) => setScrollElementRef(ref),
|
|
3199
3542
|
[]
|
|
3200
3543
|
)
|
|
3201
3544
|
},
|
|
3202
3545
|
typeof children === "function" ? scrollElementRef ? children(scrollElementRef) : null : children
|
|
3203
|
-
), /* @__PURE__ */
|
|
3546
|
+
), /* @__PURE__ */ React30.createElement(StyledScrollbar, { orientation: "vertical", className: "scroll-component" }, /* @__PURE__ */ React30.createElement(StyledThumb, { className: "scroll-component" }))));
|
|
3204
3547
|
});
|
|
3205
3548
|
|
|
3206
3549
|
// src/components/GridView.tsx
|
|
@@ -3380,7 +3723,7 @@ var Shimmer = styled22.div`
|
|
|
3380
3723
|
align-items: end;
|
|
3381
3724
|
padding: 4px;
|
|
3382
3725
|
`;
|
|
3383
|
-
var GridViewItem =
|
|
3726
|
+
var GridViewItem = forwardRef10(function GridViewItem2({
|
|
3384
3727
|
id,
|
|
3385
3728
|
title,
|
|
3386
3729
|
subtitle,
|
|
@@ -3396,15 +3739,15 @@ var GridViewItem = forwardRef9(function GridViewItem2({
|
|
|
3396
3739
|
onContextMenu,
|
|
3397
3740
|
style: style3
|
|
3398
3741
|
}, forwardedRef) {
|
|
3399
|
-
const [hovered, setHovered] =
|
|
3742
|
+
const [hovered, setHovered] = React31.useState(false);
|
|
3400
3743
|
const { hoverProps } = useHover({
|
|
3401
3744
|
onHoverChange: (isHovering) => {
|
|
3402
3745
|
onHoverChange?.(isHovering);
|
|
3403
3746
|
setHovered(isHovering);
|
|
3404
3747
|
}
|
|
3405
3748
|
});
|
|
3406
|
-
const { textPosition, bordered, disabled } =
|
|
3407
|
-
const handleClick =
|
|
3749
|
+
const { textPosition, bordered, disabled } = useContext7(GridViewContext);
|
|
3750
|
+
const handleClick = useCallback18(
|
|
3408
3751
|
(event) => {
|
|
3409
3752
|
event.stopPropagation();
|
|
3410
3753
|
event.preventDefault();
|
|
@@ -3413,7 +3756,7 @@ var GridViewItem = forwardRef9(function GridViewItem2({
|
|
|
3413
3756
|
},
|
|
3414
3757
|
[onClick, onPress]
|
|
3415
3758
|
);
|
|
3416
|
-
const handleKeyDown =
|
|
3759
|
+
const handleKeyDown = useCallback18(
|
|
3417
3760
|
(event) => {
|
|
3418
3761
|
if (event.key === "Enter" || event.key === " ") {
|
|
3419
3762
|
event.stopPropagation();
|
|
@@ -3425,7 +3768,7 @@ var GridViewItem = forwardRef9(function GridViewItem2({
|
|
|
3425
3768
|
},
|
|
3426
3769
|
[onPress]
|
|
3427
3770
|
);
|
|
3428
|
-
let element = /* @__PURE__ */
|
|
3771
|
+
let element = /* @__PURE__ */ React31.createElement(
|
|
3429
3772
|
ItemContainer,
|
|
3430
3773
|
{
|
|
3431
3774
|
id,
|
|
@@ -3434,7 +3777,7 @@ var GridViewItem = forwardRef9(function GridViewItem2({
|
|
|
3434
3777
|
tabIndex: disabled ? void 0 : 0,
|
|
3435
3778
|
onKeyDown: handleKeyDown
|
|
3436
3779
|
},
|
|
3437
|
-
/* @__PURE__ */
|
|
3780
|
+
/* @__PURE__ */ React31.createElement(
|
|
3438
3781
|
ContentContainer,
|
|
3439
3782
|
{
|
|
3440
3783
|
disabled,
|
|
@@ -3448,25 +3791,25 @@ var GridViewItem = forwardRef9(function GridViewItem2({
|
|
|
3448
3791
|
},
|
|
3449
3792
|
children
|
|
3450
3793
|
),
|
|
3451
|
-
textPosition === "below" && /* @__PURE__ */
|
|
3452
|
-
textPosition === "overlay" && hovered && (title || subtitle) && /* @__PURE__ */
|
|
3453
|
-
loading && /* @__PURE__ */
|
|
3794
|
+
textPosition === "below" && /* @__PURE__ */ React31.createElement(React31.Fragment, null, /* @__PURE__ */ React31.createElement(Spacer.Vertical, { size: 8 }), /* @__PURE__ */ React31.createElement(ItemTitle, { showBackground: false }, title || " "), /* @__PURE__ */ React31.createElement(ItemDescription, { showBackground: false }, subtitle || " ")),
|
|
3795
|
+
textPosition === "overlay" && hovered && (title || subtitle) && /* @__PURE__ */ React31.createElement(TextOverlay, null, title && /* @__PURE__ */ React31.createElement(ItemTitle, { showBackground: true }, title), subtitle && /* @__PURE__ */ React31.createElement(ItemDescription, { showBackground: true }, subtitle)),
|
|
3796
|
+
loading && /* @__PURE__ */ React31.createElement(Shimmer, null, /* @__PURE__ */ React31.createElement(ActivityIndicator, { opacity: 0.5, size: 13 }))
|
|
3454
3797
|
);
|
|
3455
3798
|
if (menuItems && onSelectMenuItem) {
|
|
3456
|
-
element = /* @__PURE__ */
|
|
3799
|
+
element = /* @__PURE__ */ React31.createElement(ContextMenu, { items: menuItems, onSelect: onSelectMenuItem }, element);
|
|
3457
3800
|
}
|
|
3458
3801
|
if (textPosition === "toolip") {
|
|
3459
|
-
element = /* @__PURE__ */
|
|
3802
|
+
element = /* @__PURE__ */ React31.createElement(
|
|
3460
3803
|
Tooltip,
|
|
3461
3804
|
{
|
|
3462
|
-
content: /* @__PURE__ */
|
|
3805
|
+
content: /* @__PURE__ */ React31.createElement(Stack.V, { gap: 2 }, /* @__PURE__ */ React31.createElement(ItemTitle, { showBackground: false }, title), /* @__PURE__ */ React31.createElement(ItemDescription, { showBackground: false }, subtitle))
|
|
3463
3806
|
},
|
|
3464
3807
|
element
|
|
3465
3808
|
);
|
|
3466
3809
|
}
|
|
3467
3810
|
return element;
|
|
3468
3811
|
});
|
|
3469
|
-
var GridViewContext =
|
|
3812
|
+
var GridViewContext = createContext7({
|
|
3470
3813
|
size: "small",
|
|
3471
3814
|
textPosition: "below",
|
|
3472
3815
|
bordered: false,
|
|
@@ -3481,7 +3824,7 @@ function GridViewRoot({
|
|
|
3481
3824
|
bordered = false,
|
|
3482
3825
|
disabled = false
|
|
3483
3826
|
}) {
|
|
3484
|
-
const handleClick =
|
|
3827
|
+
const handleClick = useCallback18(
|
|
3485
3828
|
(event) => {
|
|
3486
3829
|
event.stopPropagation();
|
|
3487
3830
|
event.preventDefault();
|
|
@@ -3489,7 +3832,7 @@ function GridViewRoot({
|
|
|
3489
3832
|
},
|
|
3490
3833
|
[onClick]
|
|
3491
3834
|
);
|
|
3492
|
-
const contextValue =
|
|
3835
|
+
const contextValue = useMemo16(
|
|
3493
3836
|
() => ({
|
|
3494
3837
|
size: size2,
|
|
3495
3838
|
textPosition,
|
|
@@ -3498,20 +3841,20 @@ function GridViewRoot({
|
|
|
3498
3841
|
}),
|
|
3499
3842
|
[bordered, disabled, size2, textPosition]
|
|
3500
3843
|
);
|
|
3501
|
-
return /* @__PURE__ */
|
|
3844
|
+
return /* @__PURE__ */ React31.createElement(GridViewContext.Provider, { value: contextValue }, /* @__PURE__ */ React31.createElement(Container3, { onClick: handleClick, scrollable }, scrollable ? /* @__PURE__ */ React31.createElement(ScrollArea, null, children) : children));
|
|
3502
3845
|
}
|
|
3503
3846
|
function GridViewSection({
|
|
3504
3847
|
children,
|
|
3505
3848
|
padding = "20px"
|
|
3506
3849
|
}) {
|
|
3507
|
-
const { size: size2 } =
|
|
3508
|
-
return /* @__PURE__ */
|
|
3850
|
+
const { size: size2 } = useContext7(GridViewContext);
|
|
3851
|
+
return /* @__PURE__ */ React31.createElement(Grid2, { size: size2, padding }, children);
|
|
3509
3852
|
}
|
|
3510
3853
|
function GridViewSectionHeader({ title }) {
|
|
3511
3854
|
const grouped = title.split("/");
|
|
3512
|
-
return /* @__PURE__ */
|
|
3513
|
-
grouped.map((title2, index) => /* @__PURE__ */
|
|
3514
|
-
/* @__PURE__ */
|
|
3855
|
+
return /* @__PURE__ */ React31.createElement(SectionHeaderContainer, null, /* @__PURE__ */ React31.createElement(Spacer.Vertical, { size: 24 }), withSeparatorElements(
|
|
3856
|
+
grouped.map((title2, index) => /* @__PURE__ */ React31.createElement(SectionTitle, { last: index === grouped.length - 1 }, title2)),
|
|
3857
|
+
/* @__PURE__ */ React31.createElement(SectionTitle, null, " / ")
|
|
3515
3858
|
));
|
|
3516
3859
|
}
|
|
3517
3860
|
var GridView;
|
|
@@ -3524,16 +3867,16 @@ var GridView;
|
|
|
3524
3867
|
|
|
3525
3868
|
// src/components/InputFieldWithCompletions.tsx
|
|
3526
3869
|
import { chunkBy, partition } from "@noya-app/noya-utils";
|
|
3527
|
-
import
|
|
3528
|
-
forwardRef as
|
|
3870
|
+
import React35, {
|
|
3871
|
+
forwardRef as forwardRef13,
|
|
3529
3872
|
memo as memo23,
|
|
3530
|
-
useCallback as
|
|
3873
|
+
useCallback as useCallback21,
|
|
3531
3874
|
useEffect as useEffect12,
|
|
3532
3875
|
useImperativeHandle as useImperativeHandle3,
|
|
3533
3876
|
useLayoutEffect as useLayoutEffect7,
|
|
3534
|
-
useMemo as
|
|
3535
|
-
useRef as
|
|
3536
|
-
useState as
|
|
3877
|
+
useMemo as useMemo19,
|
|
3878
|
+
useRef as useRef16,
|
|
3879
|
+
useState as useState18
|
|
3537
3880
|
} from "react";
|
|
3538
3881
|
import styled25 from "styled-components";
|
|
3539
3882
|
|
|
@@ -3611,18 +3954,18 @@ function mergeRanges(ranges) {
|
|
|
3611
3954
|
// src/components/ListView.tsx
|
|
3612
3955
|
import { range } from "@noya-app/noya-utils";
|
|
3613
3956
|
import { composeRefs as composeRefs2 } from "@radix-ui/react-compose-refs";
|
|
3614
|
-
import
|
|
3957
|
+
import React33, {
|
|
3615
3958
|
Children as Children4,
|
|
3616
|
-
createContext as
|
|
3617
|
-
forwardRef as
|
|
3959
|
+
createContext as createContext9,
|
|
3960
|
+
forwardRef as forwardRef11,
|
|
3618
3961
|
isValidElement as isValidElement3,
|
|
3619
3962
|
memo as memo22,
|
|
3620
|
-
useCallback as
|
|
3621
|
-
useContext as
|
|
3963
|
+
useCallback as useCallback20,
|
|
3964
|
+
useContext as useContext9,
|
|
3622
3965
|
useImperativeHandle as useImperativeHandle2,
|
|
3623
3966
|
useLayoutEffect as useLayoutEffect6,
|
|
3624
|
-
useMemo as
|
|
3625
|
-
useRef as
|
|
3967
|
+
useMemo as useMemo18,
|
|
3968
|
+
useRef as useRef15
|
|
3626
3969
|
} from "react";
|
|
3627
3970
|
import { WindowScroller } from "react-virtualized";
|
|
3628
3971
|
import { VariableSizeList } from "react-window";
|
|
@@ -3665,16 +4008,16 @@ import {
|
|
|
3665
4008
|
useSortable,
|
|
3666
4009
|
verticalListSortingStrategy
|
|
3667
4010
|
} from "@dnd-kit/sortable";
|
|
3668
|
-
import
|
|
3669
|
-
createContext as
|
|
4011
|
+
import React32, {
|
|
4012
|
+
createContext as createContext8,
|
|
3670
4013
|
memo as memo21,
|
|
3671
|
-
useCallback as
|
|
3672
|
-
useContext as
|
|
3673
|
-
useMemo as
|
|
3674
|
-
useRef as
|
|
3675
|
-
useState as
|
|
4014
|
+
useCallback as useCallback19,
|
|
4015
|
+
useContext as useContext8,
|
|
4016
|
+
useMemo as useMemo17,
|
|
4017
|
+
useRef as useRef14,
|
|
4018
|
+
useState as useState17
|
|
3676
4019
|
} from "react";
|
|
3677
|
-
import { createPortal } from "react-dom";
|
|
4020
|
+
import { createPortal as createPortal2 } from "react-dom";
|
|
3678
4021
|
var normalizeListDestinationIndex = (index, position) => {
|
|
3679
4022
|
return position === "above" ? index : index + 1;
|
|
3680
4023
|
};
|
|
@@ -3687,7 +4030,7 @@ var defaultAcceptsDrop = (sourceIndex, destinationIndex, position) => {
|
|
|
3687
4030
|
}
|
|
3688
4031
|
return true;
|
|
3689
4032
|
};
|
|
3690
|
-
var SortableItemContext =
|
|
4033
|
+
var SortableItemContext = createContext8({
|
|
3691
4034
|
keys: [],
|
|
3692
4035
|
position: { x: 0, y: 0 },
|
|
3693
4036
|
acceptsDrop: defaultAcceptsDrop,
|
|
@@ -3709,7 +4052,7 @@ function SortableItem({
|
|
|
3709
4052
|
disabled,
|
|
3710
4053
|
children
|
|
3711
4054
|
}) {
|
|
3712
|
-
const { keys, position, acceptsDrop, setActivatorEvent, axis } =
|
|
4055
|
+
const { keys, position, acceptsDrop, setActivatorEvent, axis } = useContext8(SortableItemContext);
|
|
3713
4056
|
const sortable = useSortable({ id, disabled });
|
|
3714
4057
|
const {
|
|
3715
4058
|
active,
|
|
@@ -3729,7 +4072,7 @@ function SortableItem({
|
|
|
3729
4072
|
const eventY = activatorEvent?.clientY ?? 0;
|
|
3730
4073
|
const offsetLeft = eventX + position.x;
|
|
3731
4074
|
const offsetTop = eventY + position.y;
|
|
3732
|
-
const ref =
|
|
4075
|
+
const ref = useCallback19((node) => setNodeRef(node), [setNodeRef]);
|
|
3733
4076
|
return children({
|
|
3734
4077
|
ref,
|
|
3735
4078
|
...attributes,
|
|
@@ -3760,22 +4103,22 @@ function SortableRoot({
|
|
|
3760
4103
|
}
|
|
3761
4104
|
})
|
|
3762
4105
|
);
|
|
3763
|
-
const [activeIndex, setActiveIndex] =
|
|
3764
|
-
const activatorEvent =
|
|
3765
|
-
const setActivatorEvent =
|
|
4106
|
+
const [activeIndex, setActiveIndex] = useState17();
|
|
4107
|
+
const activatorEvent = useRef14(null);
|
|
4108
|
+
const setActivatorEvent = useCallback19((event) => {
|
|
3766
4109
|
activatorEvent.current = event;
|
|
3767
4110
|
}, []);
|
|
3768
|
-
const [position, setPosition] =
|
|
3769
|
-
const handleDragStart =
|
|
4111
|
+
const [position, setPosition] = useState17({ x: 0, y: 0 });
|
|
4112
|
+
const handleDragStart = useCallback19(
|
|
3770
4113
|
(event) => {
|
|
3771
4114
|
setActiveIndex(keys.indexOf(event.active.id));
|
|
3772
4115
|
},
|
|
3773
4116
|
[keys]
|
|
3774
4117
|
);
|
|
3775
|
-
const handleDragMove =
|
|
4118
|
+
const handleDragMove = useCallback19((event) => {
|
|
3776
4119
|
setPosition({ ...event.delta });
|
|
3777
4120
|
}, []);
|
|
3778
|
-
const handleDragEnd =
|
|
4121
|
+
const handleDragEnd = useCallback19(
|
|
3779
4122
|
(event) => {
|
|
3780
4123
|
const { active, over } = event;
|
|
3781
4124
|
setActiveIndex(void 0);
|
|
@@ -3802,10 +4145,10 @@ function SortableRoot({
|
|
|
3802
4145
|
},
|
|
3803
4146
|
[acceptsDrop, axis, keys, onMoveItem, position.x, position.y]
|
|
3804
4147
|
);
|
|
3805
|
-
return /* @__PURE__ */
|
|
4148
|
+
return /* @__PURE__ */ React32.createElement(
|
|
3806
4149
|
SortableItemContext.Provider,
|
|
3807
4150
|
{
|
|
3808
|
-
value:
|
|
4151
|
+
value: useMemo17(
|
|
3809
4152
|
() => ({
|
|
3810
4153
|
keys,
|
|
3811
4154
|
acceptsDrop,
|
|
@@ -3816,7 +4159,7 @@ function SortableRoot({
|
|
|
3816
4159
|
[acceptsDrop, axis, keys, position, setActivatorEvent]
|
|
3817
4160
|
)
|
|
3818
4161
|
},
|
|
3819
|
-
/* @__PURE__ */
|
|
4162
|
+
/* @__PURE__ */ React32.createElement(
|
|
3820
4163
|
DndContext,
|
|
3821
4164
|
{
|
|
3822
4165
|
sensors,
|
|
@@ -3825,9 +4168,9 @@ function SortableRoot({
|
|
|
3825
4168
|
onDragMove: handleDragMove,
|
|
3826
4169
|
onDragEnd: handleDragEnd
|
|
3827
4170
|
},
|
|
3828
|
-
/* @__PURE__ */
|
|
3829
|
-
renderOverlay &&
|
|
3830
|
-
/* @__PURE__ */
|
|
4171
|
+
/* @__PURE__ */ React32.createElement(SortableContext, { items: keys, strategy: verticalListSortingStrategy }, children),
|
|
4172
|
+
renderOverlay && createPortal2(
|
|
4173
|
+
/* @__PURE__ */ React32.createElement(DragOverlay, { dropAnimation: null }, activeIndex !== void 0 && activeIndex >= 0 && renderOverlay(activeIndex)),
|
|
3831
4174
|
document.body
|
|
3832
4175
|
)
|
|
3833
4176
|
)
|
|
@@ -3842,10 +4185,10 @@ var Sortable;
|
|
|
3842
4185
|
// src/components/ListView.tsx
|
|
3843
4186
|
var ROW_HEIGHT = 31;
|
|
3844
4187
|
var SECTION_HEADER_LABEL_HEIGHT = 27;
|
|
3845
|
-
var DraggingContext =
|
|
4188
|
+
var DraggingContext = createContext9({
|
|
3846
4189
|
indentation: 12
|
|
3847
4190
|
});
|
|
3848
|
-
var ListRowContext =
|
|
4191
|
+
var ListRowContext = createContext9({
|
|
3849
4192
|
marginType: "none",
|
|
3850
4193
|
selectedPosition: "only",
|
|
3851
4194
|
sortable: false,
|
|
@@ -3875,7 +4218,7 @@ function ListViewEditableRowTitle({
|
|
|
3875
4218
|
autoFocus,
|
|
3876
4219
|
placeholder
|
|
3877
4220
|
}) {
|
|
3878
|
-
const inputRef =
|
|
4221
|
+
const inputRef = useRef15(null);
|
|
3879
4222
|
useLayoutEffect6(() => {
|
|
3880
4223
|
const element = inputRef.current;
|
|
3881
4224
|
if (!element || !autoFocus)
|
|
@@ -3885,7 +4228,7 @@ function ListViewEditableRowTitle({
|
|
|
3885
4228
|
element.select();
|
|
3886
4229
|
}, 0);
|
|
3887
4230
|
}, [autoFocus]);
|
|
3888
|
-
return /* @__PURE__ */
|
|
4231
|
+
return /* @__PURE__ */ React33.createElement(
|
|
3889
4232
|
ListViewEditableRowTitleElement,
|
|
3890
4233
|
{
|
|
3891
4234
|
ref: inputRef,
|
|
@@ -4007,7 +4350,7 @@ var ListViewDragIndicatorElement = styled23.div(({ theme, relativeDropPosition,
|
|
|
4007
4350
|
boxShadow: "0 0 2px rgba(0,0,0,0.5)"
|
|
4008
4351
|
}
|
|
4009
4352
|
}));
|
|
4010
|
-
var ListViewRow =
|
|
4353
|
+
var ListViewRow = forwardRef11(function ListViewRow2({
|
|
4011
4354
|
id,
|
|
4012
4355
|
tabIndex = 0,
|
|
4013
4356
|
gap,
|
|
@@ -4040,12 +4383,12 @@ var ListViewRow = forwardRef10(function ListViewRow2({
|
|
|
4040
4383
|
divider,
|
|
4041
4384
|
gap: listGap,
|
|
4042
4385
|
colorScheme
|
|
4043
|
-
} =
|
|
4386
|
+
} = useContext9(ListRowContext);
|
|
4044
4387
|
const { hoverProps } = useHover({
|
|
4045
4388
|
onHoverChange
|
|
4046
4389
|
});
|
|
4047
|
-
const { indentation, isDragging } =
|
|
4048
|
-
const handlePress =
|
|
4390
|
+
const { indentation, isDragging } = useContext9(DraggingContext);
|
|
4391
|
+
const handlePress = useCallback20(
|
|
4049
4392
|
(event) => {
|
|
4050
4393
|
event.preventDefault();
|
|
4051
4394
|
if (event.button !== 0)
|
|
@@ -4054,14 +4397,14 @@ var ListViewRow = forwardRef10(function ListViewRow2({
|
|
|
4054
4397
|
},
|
|
4055
4398
|
[onPress]
|
|
4056
4399
|
);
|
|
4057
|
-
const handleDoubleClick =
|
|
4400
|
+
const handleDoubleClick = useCallback20(
|
|
4058
4401
|
(event) => {
|
|
4059
4402
|
event.stopPropagation();
|
|
4060
4403
|
onDoubleClick?.();
|
|
4061
4404
|
},
|
|
4062
4405
|
[onDoubleClick]
|
|
4063
4406
|
);
|
|
4064
|
-
const mergedStyle =
|
|
4407
|
+
const mergedStyle = useMemo18(() => {
|
|
4065
4408
|
return isDragging ? {
|
|
4066
4409
|
// TODO: Where do these offsets actually come from?
|
|
4067
4410
|
transform: `translate3d(-36px, -6px, 0)`,
|
|
@@ -4073,7 +4416,7 @@ var ListViewRow = forwardRef10(function ListViewRow2({
|
|
|
4073
4416
|
relativeDropPosition,
|
|
4074
4417
|
...renderProps
|
|
4075
4418
|
}, ref) => {
|
|
4076
|
-
const element = /* @__PURE__ */
|
|
4419
|
+
const element = /* @__PURE__ */ React33.createElement(
|
|
4077
4420
|
RowContainer,
|
|
4078
4421
|
{
|
|
4079
4422
|
ref,
|
|
@@ -4104,7 +4447,7 @@ var ListViewRow = forwardRef10(function ListViewRow2({
|
|
|
4104
4447
|
),
|
|
4105
4448
|
tabIndex
|
|
4106
4449
|
},
|
|
4107
|
-
relativeDropPosition && /* @__PURE__ */
|
|
4450
|
+
relativeDropPosition && /* @__PURE__ */ React33.createElement(
|
|
4108
4451
|
ListViewDragIndicatorElement,
|
|
4109
4452
|
{
|
|
4110
4453
|
colorScheme,
|
|
@@ -4113,11 +4456,11 @@ var ListViewRow = forwardRef10(function ListViewRow2({
|
|
|
4113
4456
|
gap: listGap
|
|
4114
4457
|
}
|
|
4115
4458
|
),
|
|
4116
|
-
depth > 0 && /* @__PURE__ */
|
|
4459
|
+
depth > 0 && /* @__PURE__ */ React33.createElement(Spacer.Horizontal, { size: depth * indentation }),
|
|
4117
4460
|
children
|
|
4118
4461
|
);
|
|
4119
4462
|
if (menuItems && onSelectMenuItem) {
|
|
4120
|
-
return /* @__PURE__ */
|
|
4463
|
+
return /* @__PURE__ */ React33.createElement(
|
|
4121
4464
|
ContextMenu,
|
|
4122
4465
|
{
|
|
4123
4466
|
items: menuItems,
|
|
@@ -4130,21 +4473,21 @@ var ListViewRow = forwardRef10(function ListViewRow2({
|
|
|
4130
4473
|
return element;
|
|
4131
4474
|
};
|
|
4132
4475
|
if (sortable && id) {
|
|
4133
|
-
return /* @__PURE__ */
|
|
4476
|
+
return /* @__PURE__ */ React33.createElement(Sortable.Item, { id, disabled: overrideSortable === false }, ({ ref: sortableRef, ...sortableProps }) => renderContent(sortableProps, composeRefs2(sortableRef, forwardedRef)));
|
|
4134
4477
|
}
|
|
4135
4478
|
return renderContent({}, forwardedRef);
|
|
4136
4479
|
});
|
|
4137
|
-
var RenderItemContext =
|
|
4480
|
+
var RenderItemContext = createContext9(
|
|
4138
4481
|
() => null
|
|
4139
4482
|
);
|
|
4140
4483
|
var VirtualizedListRow = memo22(function VirtualizedListRow2({
|
|
4141
4484
|
index,
|
|
4142
4485
|
style: style3
|
|
4143
4486
|
}) {
|
|
4144
|
-
const renderItem =
|
|
4145
|
-
return /* @__PURE__ */
|
|
4487
|
+
const renderItem = useContext9(RenderItemContext);
|
|
4488
|
+
return /* @__PURE__ */ React33.createElement("div", { key: index, style: style3 }, renderItem(index));
|
|
4146
4489
|
});
|
|
4147
|
-
var VirtualizedListInner =
|
|
4490
|
+
var VirtualizedListInner = forwardRef11(function VirtualizedListInner2({
|
|
4148
4491
|
size: size2,
|
|
4149
4492
|
scrollElement,
|
|
4150
4493
|
items,
|
|
@@ -4152,7 +4495,7 @@ var VirtualizedListInner = forwardRef10(function VirtualizedListInner2({
|
|
|
4152
4495
|
keyExtractor,
|
|
4153
4496
|
renderItem
|
|
4154
4497
|
}, ref) {
|
|
4155
|
-
const listRef =
|
|
4498
|
+
const listRef = useRef15(null);
|
|
4156
4499
|
useImperativeHandle2(ref, () => ({
|
|
4157
4500
|
scrollToIndex(index) {
|
|
4158
4501
|
listRef.current?.scrollToItem(index);
|
|
@@ -4165,7 +4508,7 @@ var VirtualizedListInner = forwardRef10(function VirtualizedListInner2({
|
|
|
4165
4508
|
// since it doesn't currently support row height changes
|
|
4166
4509
|
items
|
|
4167
4510
|
]);
|
|
4168
|
-
const listStyle =
|
|
4511
|
+
const listStyle = useMemo18(
|
|
4169
4512
|
() => ({
|
|
4170
4513
|
overflowX: "initial",
|
|
4171
4514
|
overflowY: "initial",
|
|
@@ -4173,18 +4516,18 @@ var VirtualizedListInner = forwardRef10(function VirtualizedListInner2({
|
|
|
4173
4516
|
}),
|
|
4174
4517
|
[]
|
|
4175
4518
|
);
|
|
4176
|
-
return /* @__PURE__ */
|
|
4519
|
+
return /* @__PURE__ */ React33.createElement(RenderItemContext.Provider, { value: renderItem }, /* @__PURE__ */ React33.createElement(
|
|
4177
4520
|
WindowScroller,
|
|
4178
4521
|
{
|
|
4179
4522
|
scrollElement,
|
|
4180
|
-
style:
|
|
4523
|
+
style: useMemo18(() => ({ flex: "1 1 auto" }), [])
|
|
4181
4524
|
},
|
|
4182
|
-
|
|
4525
|
+
useCallback20(
|
|
4183
4526
|
({
|
|
4184
4527
|
registerChild,
|
|
4185
4528
|
onChildScroll,
|
|
4186
4529
|
scrollTop
|
|
4187
|
-
}) => /* @__PURE__ */
|
|
4530
|
+
}) => /* @__PURE__ */ React33.createElement("div", { ref: registerChild }, /* @__PURE__ */ React33.createElement(
|
|
4188
4531
|
VariableSizeList,
|
|
4189
4532
|
{
|
|
4190
4533
|
ref: listRef,
|
|
@@ -4225,7 +4568,7 @@ var RootContainer2 = styled23.div(({ theme, scrollable, gap }) => ({
|
|
|
4225
4568
|
color: theme.colors.textMuted,
|
|
4226
4569
|
gap
|
|
4227
4570
|
}));
|
|
4228
|
-
var ListViewRootInner =
|
|
4571
|
+
var ListViewRootInner = forwardRef11(function ListViewRootInner2({
|
|
4229
4572
|
onPress,
|
|
4230
4573
|
scrollable = false,
|
|
4231
4574
|
expandable = true,
|
|
@@ -4244,7 +4587,7 @@ var ListViewRootInner = forwardRef10(function ListViewRootInner2({
|
|
|
4244
4587
|
colorScheme = "primary",
|
|
4245
4588
|
gap = 0
|
|
4246
4589
|
}, forwardedRef) {
|
|
4247
|
-
const handleClick =
|
|
4590
|
+
const handleClick = useCallback20(
|
|
4248
4591
|
(event) => {
|
|
4249
4592
|
if (event.target instanceof HTMLElement && event.target.classList.contains("scroll-component"))
|
|
4250
4593
|
return;
|
|
@@ -4254,11 +4597,11 @@ var ListViewRootInner = forwardRef10(function ListViewRootInner2({
|
|
|
4254
4597
|
},
|
|
4255
4598
|
[onPress]
|
|
4256
4599
|
);
|
|
4257
|
-
const renderChild =
|
|
4600
|
+
const renderChild = useCallback20(
|
|
4258
4601
|
(index) => renderItem(data[index], index, { isDragging: false }),
|
|
4259
4602
|
[data, renderItem]
|
|
4260
4603
|
);
|
|
4261
|
-
const getItemContextValue =
|
|
4604
|
+
const getItemContextValue = useCallback20(
|
|
4262
4605
|
(i) => {
|
|
4263
4606
|
const current = renderChild(i);
|
|
4264
4607
|
if (!isValidElement3(current))
|
|
@@ -4318,26 +4661,26 @@ var ListViewRootInner = forwardRef10(function ListViewRootInner2({
|
|
|
4318
4661
|
gap
|
|
4319
4662
|
]
|
|
4320
4663
|
);
|
|
4321
|
-
const draggingContextOverlayValue =
|
|
4664
|
+
const draggingContextOverlayValue = useMemo18(
|
|
4322
4665
|
() => ({ indentation, isDragging: true }),
|
|
4323
4666
|
[indentation]
|
|
4324
4667
|
);
|
|
4325
|
-
const renderOverlay =
|
|
4326
|
-
(index) => /* @__PURE__ */
|
|
4668
|
+
const renderOverlay = useCallback20(
|
|
4669
|
+
(index) => /* @__PURE__ */ React33.createElement("div", { style: { opacity: 0.25 } }, /* @__PURE__ */ React33.createElement(DraggingContext.Provider, { value: draggingContextOverlayValue }, renderItem(data[index], index, { isDragging: true }))),
|
|
4327
4670
|
[draggingContextOverlayValue, renderItem, data]
|
|
4328
4671
|
);
|
|
4329
|
-
const renderWrappedChild =
|
|
4672
|
+
const renderWrappedChild = useCallback20(
|
|
4330
4673
|
(index) => {
|
|
4331
4674
|
const contextValue = getItemContextValue(index);
|
|
4332
4675
|
const current = renderChild(index);
|
|
4333
4676
|
if (!contextValue || !isValidElement3(current))
|
|
4334
4677
|
return null;
|
|
4335
|
-
return /* @__PURE__ */
|
|
4678
|
+
return /* @__PURE__ */ React33.createElement(ListRowContext.Provider, { key: current.key, value: contextValue }, current);
|
|
4336
4679
|
},
|
|
4337
4680
|
[getItemContextValue, renderChild]
|
|
4338
4681
|
);
|
|
4339
|
-
const ids =
|
|
4340
|
-
const withSortable = (children) => sortable ? /* @__PURE__ */
|
|
4682
|
+
const ids = useMemo18(() => data.map(keyExtractor), [keyExtractor, data]);
|
|
4683
|
+
const withSortable = (children) => sortable ? /* @__PURE__ */ React33.createElement(
|
|
4341
4684
|
Sortable.Root,
|
|
4342
4685
|
{
|
|
4343
4686
|
onMoveItem,
|
|
@@ -4347,8 +4690,8 @@ var ListViewRootInner = forwardRef10(function ListViewRootInner2({
|
|
|
4347
4690
|
},
|
|
4348
4691
|
children
|
|
4349
4692
|
) : children;
|
|
4350
|
-
const withScrollable = (children) => scrollable ? /* @__PURE__ */
|
|
4351
|
-
const getItemHeight =
|
|
4693
|
+
const withScrollable = (children) => scrollable ? /* @__PURE__ */ React33.createElement(ScrollArea, null, children) : children(null);
|
|
4694
|
+
const getItemHeight = useCallback20(
|
|
4352
4695
|
(index) => {
|
|
4353
4696
|
const child = getItemContextValue(index);
|
|
4354
4697
|
const margin = child?.marginType ? getPositionMargin(child.marginType) : { top: 0, bottom: 0 };
|
|
@@ -4357,12 +4700,12 @@ var ListViewRootInner = forwardRef10(function ListViewRootInner2({
|
|
|
4357
4700
|
},
|
|
4358
4701
|
[getItemContextValue, variant]
|
|
4359
4702
|
);
|
|
4360
|
-
const getKey =
|
|
4703
|
+
const getKey = useCallback20(
|
|
4361
4704
|
(index) => keyExtractor(data[index], index),
|
|
4362
4705
|
[data, keyExtractor]
|
|
4363
4706
|
);
|
|
4364
|
-
const draggingContextValue =
|
|
4365
|
-
return /* @__PURE__ */
|
|
4707
|
+
const draggingContextValue = useMemo18(() => ({ indentation }), [indentation]);
|
|
4708
|
+
return /* @__PURE__ */ React33.createElement(DraggingContext.Provider, { value: draggingContextValue }, /* @__PURE__ */ React33.createElement(
|
|
4366
4709
|
RootContainer2,
|
|
4367
4710
|
{
|
|
4368
4711
|
...{
|
|
@@ -4373,7 +4716,7 @@ var ListViewRootInner = forwardRef10(function ListViewRootInner2({
|
|
|
4373
4716
|
},
|
|
4374
4717
|
withScrollable(
|
|
4375
4718
|
(scrollElementRef) => withSortable(
|
|
4376
|
-
virtualized ? /* @__PURE__ */
|
|
4719
|
+
virtualized ? /* @__PURE__ */ React33.createElement(
|
|
4377
4720
|
VirtualizedList,
|
|
4378
4721
|
{
|
|
4379
4722
|
ref: forwardedRef,
|
|
@@ -4390,33 +4733,33 @@ var ListViewRootInner = forwardRef10(function ListViewRootInner2({
|
|
|
4390
4733
|
));
|
|
4391
4734
|
});
|
|
4392
4735
|
var ListViewRoot = memo22(ListViewRootInner);
|
|
4393
|
-
var ChildrenListViewInner =
|
|
4394
|
-
const items =
|
|
4736
|
+
var ChildrenListViewInner = forwardRef11(function ChildrenListViewInner2({ children, ...rest }, forwardedRef) {
|
|
4737
|
+
const items = useMemo18(
|
|
4395
4738
|
() => Children4.toArray(children).flatMap(
|
|
4396
4739
|
(child) => isValidElement3(child) ? [child] : []
|
|
4397
4740
|
),
|
|
4398
4741
|
[children]
|
|
4399
4742
|
);
|
|
4400
|
-
return /* @__PURE__ */
|
|
4743
|
+
return /* @__PURE__ */ React33.createElement(
|
|
4401
4744
|
ListViewRoot,
|
|
4402
4745
|
{
|
|
4403
4746
|
ref: forwardedRef,
|
|
4404
4747
|
...rest,
|
|
4405
4748
|
data: items,
|
|
4406
|
-
keyExtractor:
|
|
4749
|
+
keyExtractor: useCallback20(
|
|
4407
4750
|
({ key }, index) => typeof key === "string" ? key : (key ?? index).toString(),
|
|
4408
4751
|
[]
|
|
4409
4752
|
),
|
|
4410
|
-
renderItem:
|
|
4753
|
+
renderItem: useCallback20((item) => item, [])
|
|
4411
4754
|
}
|
|
4412
4755
|
);
|
|
4413
4756
|
});
|
|
4414
4757
|
var ChildrenListView = memo22(ChildrenListViewInner);
|
|
4415
|
-
var SimpleListViewInner =
|
|
4758
|
+
var SimpleListViewInner = forwardRef11(function SimpleListViewInner2(props, forwardedRef) {
|
|
4416
4759
|
if ("children" in props) {
|
|
4417
|
-
return /* @__PURE__ */
|
|
4760
|
+
return /* @__PURE__ */ React33.createElement(ChildrenListView, { ref: forwardedRef, ...props });
|
|
4418
4761
|
} else {
|
|
4419
|
-
return /* @__PURE__ */
|
|
4762
|
+
return /* @__PURE__ */ React33.createElement(ListViewRoot, { ref: forwardedRef, ...props });
|
|
4420
4763
|
}
|
|
4421
4764
|
});
|
|
4422
4765
|
var SimpleListView = memo22(SimpleListViewInner);
|
|
@@ -4437,7 +4780,7 @@ var ListView;
|
|
|
4437
4780
|
})(ListView || (ListView = {}));
|
|
4438
4781
|
|
|
4439
4782
|
// src/components/Text.tsx
|
|
4440
|
-
import
|
|
4783
|
+
import React34, { forwardRef as forwardRef12 } from "react";
|
|
4441
4784
|
import styled24 from "styled-components";
|
|
4442
4785
|
var elements = {
|
|
4443
4786
|
title: "h1",
|
|
@@ -4449,6 +4792,7 @@ var elements = {
|
|
|
4449
4792
|
heading5: "h5",
|
|
4450
4793
|
body: "p",
|
|
4451
4794
|
small: "span",
|
|
4795
|
+
button: "span",
|
|
4452
4796
|
code: "code",
|
|
4453
4797
|
label: "span"
|
|
4454
4798
|
};
|
|
@@ -4458,7 +4802,7 @@ var StyledElement = styled24.span(({ theme, variant, styleProps, breakpoints, co
|
|
|
4458
4802
|
...styleProps,
|
|
4459
4803
|
...mergeBreakpoints(breakpoints || [])
|
|
4460
4804
|
}));
|
|
4461
|
-
var Text =
|
|
4805
|
+
var Text = forwardRef12(function Text2({
|
|
4462
4806
|
as,
|
|
4463
4807
|
variant,
|
|
4464
4808
|
breakpoints,
|
|
@@ -4470,7 +4814,7 @@ var Text = forwardRef11(function Text2({
|
|
|
4470
4814
|
...rest
|
|
4471
4815
|
}, forwardedRef) {
|
|
4472
4816
|
const element = as ?? elements[variant] ?? "span";
|
|
4473
|
-
return /* @__PURE__ */
|
|
4817
|
+
return /* @__PURE__ */ React34.createElement(
|
|
4474
4818
|
StyledElement,
|
|
4475
4819
|
{
|
|
4476
4820
|
ref: forwardedRef,
|
|
@@ -4486,28 +4830,28 @@ var Text = forwardRef11(function Text2({
|
|
|
4486
4830
|
children
|
|
4487
4831
|
);
|
|
4488
4832
|
});
|
|
4489
|
-
var Heading1 =
|
|
4490
|
-
(props, ref) => /* @__PURE__ */
|
|
4833
|
+
var Heading1 = forwardRef12(
|
|
4834
|
+
(props, ref) => /* @__PURE__ */ React34.createElement(Text, { ref, ...props, variant: "heading1" })
|
|
4491
4835
|
);
|
|
4492
|
-
var Heading2 =
|
|
4493
|
-
(props, ref) => /* @__PURE__ */
|
|
4836
|
+
var Heading2 = forwardRef12(
|
|
4837
|
+
(props, ref) => /* @__PURE__ */ React34.createElement(Text, { ref, ...props, variant: "heading2" })
|
|
4494
4838
|
);
|
|
4495
|
-
var Heading3 =
|
|
4496
|
-
(props, ref) => /* @__PURE__ */
|
|
4839
|
+
var Heading3 = forwardRef12(
|
|
4840
|
+
(props, ref) => /* @__PURE__ */ React34.createElement(Text, { ref, ...props, variant: "heading3" })
|
|
4497
4841
|
);
|
|
4498
|
-
var Heading4 =
|
|
4499
|
-
(props, ref) => /* @__PURE__ */
|
|
4842
|
+
var Heading4 = forwardRef12(
|
|
4843
|
+
(props, ref) => /* @__PURE__ */ React34.createElement(Text, { ref, ...props, variant: "heading4" })
|
|
4500
4844
|
);
|
|
4501
|
-
var Heading5 =
|
|
4502
|
-
(props, ref) => /* @__PURE__ */
|
|
4845
|
+
var Heading5 = forwardRef12(
|
|
4846
|
+
(props, ref) => /* @__PURE__ */ React34.createElement(Text, { ref, ...props, variant: "heading5" })
|
|
4503
4847
|
);
|
|
4504
|
-
var Body =
|
|
4505
|
-
(props, ref) => /* @__PURE__ */
|
|
4848
|
+
var Body = forwardRef12(
|
|
4849
|
+
(props, ref) => /* @__PURE__ */ React34.createElement(Text, { ref, ...props, variant: "body" })
|
|
4506
4850
|
);
|
|
4507
|
-
var Small =
|
|
4508
|
-
(props, ref) => /* @__PURE__ */
|
|
4851
|
+
var Small = forwardRef12(
|
|
4852
|
+
(props, ref) => /* @__PURE__ */ React34.createElement(Text, { ref, ...props, variant: "small" })
|
|
4509
4853
|
);
|
|
4510
|
-
var Italic = ({ children }) => /* @__PURE__ */
|
|
4854
|
+
var Italic = ({ children }) => /* @__PURE__ */ React34.createElement(
|
|
4511
4855
|
"span",
|
|
4512
4856
|
{
|
|
4513
4857
|
style: {
|
|
@@ -4550,14 +4894,14 @@ var CompletionToken = styled25.span(
|
|
|
4550
4894
|
})
|
|
4551
4895
|
);
|
|
4552
4896
|
var CompletionMenu = memo23(
|
|
4553
|
-
|
|
4897
|
+
forwardRef13(function CompletionMenu2({
|
|
4554
4898
|
items,
|
|
4555
4899
|
selectedIndex,
|
|
4556
4900
|
onSelectItem,
|
|
4557
4901
|
onHoverIndex,
|
|
4558
4902
|
listSize
|
|
4559
4903
|
}, forwardedRef) {
|
|
4560
|
-
return /* @__PURE__ */
|
|
4904
|
+
return /* @__PURE__ */ React35.createElement(
|
|
4561
4905
|
ListView.Root,
|
|
4562
4906
|
{
|
|
4563
4907
|
ref: forwardedRef,
|
|
@@ -4569,13 +4913,13 @@ var CompletionMenu = memo23(
|
|
|
4569
4913
|
sectionHeaderVariant: "label",
|
|
4570
4914
|
renderItem: (item, i) => {
|
|
4571
4915
|
if (item.type === "sectionHeader") {
|
|
4572
|
-
return /* @__PURE__ */
|
|
4916
|
+
return /* @__PURE__ */ React35.createElement(ListView.Row, { key: item.id, isSectionHeader: true }, item.name);
|
|
4573
4917
|
}
|
|
4574
4918
|
const tokens = fuzzyTokenize({
|
|
4575
4919
|
item: item.name,
|
|
4576
4920
|
itemScore: item
|
|
4577
4921
|
});
|
|
4578
|
-
return /* @__PURE__ */
|
|
4922
|
+
return /* @__PURE__ */ React35.createElement(
|
|
4579
4923
|
ListView.Row,
|
|
4580
4924
|
{
|
|
4581
4925
|
key: item.id,
|
|
@@ -4587,8 +4931,8 @@ var CompletionMenu = memo23(
|
|
|
4587
4931
|
}
|
|
4588
4932
|
}
|
|
4589
4933
|
},
|
|
4590
|
-
tokens.map((token, j) => /* @__PURE__ */
|
|
4591
|
-
item.icon && /* @__PURE__ */
|
|
4934
|
+
tokens.map((token, j) => /* @__PURE__ */ React35.createElement(CompletionToken, { key: j, type: token.type }, token.text)),
|
|
4935
|
+
item.icon && /* @__PURE__ */ React35.createElement(React35.Fragment, null, /* @__PURE__ */ React35.createElement(Spacer.Horizontal, null), item.icon)
|
|
4592
4936
|
);
|
|
4593
4937
|
}
|
|
4594
4938
|
}
|
|
@@ -4596,7 +4940,7 @@ var CompletionMenu = memo23(
|
|
|
4596
4940
|
})
|
|
4597
4941
|
);
|
|
4598
4942
|
var InputFieldWithCompletions = memo23(
|
|
4599
|
-
|
|
4943
|
+
forwardRef13(function InputFieldWithCompletions2({
|
|
4600
4944
|
loading,
|
|
4601
4945
|
initialValue = "",
|
|
4602
4946
|
placeholder,
|
|
@@ -4614,13 +4958,13 @@ var InputFieldWithCompletions = memo23(
|
|
|
4614
4958
|
hideChildrenWhenFocused = false,
|
|
4615
4959
|
hideMenuWhenEmptyValue = false
|
|
4616
4960
|
}, forwardedRef) {
|
|
4617
|
-
const ref =
|
|
4618
|
-
const [isFocused, setIsFocused] =
|
|
4619
|
-
const [state, _setState] =
|
|
4961
|
+
const ref = useRef16(null);
|
|
4962
|
+
const [isFocused, setIsFocused] = useState18(false);
|
|
4963
|
+
const [state, _setState] = useState18({
|
|
4620
4964
|
filter: initialValue,
|
|
4621
4965
|
selectedIndex: 0
|
|
4622
4966
|
});
|
|
4623
|
-
const updateState =
|
|
4967
|
+
const updateState = useCallback21(
|
|
4624
4968
|
(newState, hoverItem) => {
|
|
4625
4969
|
const nextState = { ...state, ...newState };
|
|
4626
4970
|
const nextItems = filterWithGroupedSections(items, nextState.filter);
|
|
@@ -4649,7 +4993,7 @@ var InputFieldWithCompletions = memo23(
|
|
|
4649
4993
|
},
|
|
4650
4994
|
[items, onChange, onHoverItem, state]
|
|
4651
4995
|
);
|
|
4652
|
-
const initialValueRef =
|
|
4996
|
+
const initialValueRef = useRef16(initialValue);
|
|
4653
4997
|
useLayoutEffect7(() => {
|
|
4654
4998
|
if (initialValueRef.current === initialValue)
|
|
4655
4999
|
return;
|
|
@@ -4657,8 +5001,8 @@ var InputFieldWithCompletions = memo23(
|
|
|
4657
5001
|
updateState({ filter: initialValue });
|
|
4658
5002
|
}, [initialValue, updateState]);
|
|
4659
5003
|
const { filter, selectedIndex } = state;
|
|
4660
|
-
const listRef =
|
|
4661
|
-
const filteredItems =
|
|
5004
|
+
const listRef = React35.useRef(null);
|
|
5005
|
+
const filteredItems = useMemo19(
|
|
4662
5006
|
() => filterWithGroupedSections(items, filter),
|
|
4663
5007
|
[items, filter]
|
|
4664
5008
|
);
|
|
@@ -4679,8 +5023,8 @@ var InputFieldWithCompletions = memo23(
|
|
|
4679
5023
|
listRef.current.scrollToIndex(selectedIndex);
|
|
4680
5024
|
}
|
|
4681
5025
|
}, [selectedIndex]);
|
|
4682
|
-
const lastSubmittedValueRef =
|
|
4683
|
-
const selectItem =
|
|
5026
|
+
const lastSubmittedValueRef = useRef16(void 0);
|
|
5027
|
+
const selectItem = useCallback21(
|
|
4684
5028
|
(item) => {
|
|
4685
5029
|
if (item.type === "sectionHeader")
|
|
4686
5030
|
return;
|
|
@@ -4696,17 +5040,17 @@ var InputFieldWithCompletions = memo23(
|
|
|
4696
5040
|
},
|
|
4697
5041
|
[filter, onSelectItem, onHoverItem, ref]
|
|
4698
5042
|
);
|
|
4699
|
-
const handleChange =
|
|
5043
|
+
const handleChange = useCallback21(
|
|
4700
5044
|
(value) => updateState({ selectedIndex: 0, filter: value }),
|
|
4701
5045
|
[updateState]
|
|
4702
5046
|
);
|
|
4703
|
-
const handleBlur =
|
|
5047
|
+
const handleBlur = useCallback21(() => {
|
|
4704
5048
|
setIsFocused(false);
|
|
4705
5049
|
const didSubmit = lastSubmittedValueRef.current?.filter === filter;
|
|
4706
5050
|
updateState({ selectedIndex: 0, filter: initialValue }, "resetHover");
|
|
4707
5051
|
onBlur?.(didSubmit, filter);
|
|
4708
5052
|
}, [filter, initialValue, onBlur, updateState]);
|
|
4709
|
-
const handleFocus =
|
|
5053
|
+
const handleFocus = useCallback21(
|
|
4710
5054
|
(event) => {
|
|
4711
5055
|
setIsFocused(true);
|
|
4712
5056
|
updateState({ selectedIndex: 0, filter: initialValue });
|
|
@@ -4714,11 +5058,11 @@ var InputFieldWithCompletions = memo23(
|
|
|
4714
5058
|
},
|
|
4715
5059
|
[initialValue, onFocus, updateState]
|
|
4716
5060
|
);
|
|
4717
|
-
const handleIndexChange =
|
|
5061
|
+
const handleIndexChange = useCallback21(
|
|
4718
5062
|
(index) => updateState({ selectedIndex: index }),
|
|
4719
5063
|
[updateState]
|
|
4720
5064
|
);
|
|
4721
|
-
const handleKeyDown =
|
|
5065
|
+
const handleKeyDown = useCallback21(
|
|
4722
5066
|
(event) => {
|
|
4723
5067
|
let handled = false;
|
|
4724
5068
|
switch (event.key) {
|
|
@@ -4793,14 +5137,14 @@ var InputFieldWithCompletions = memo23(
|
|
|
4793
5137
|
ref.current?.setSelectionRange(0, ref.current.value.length);
|
|
4794
5138
|
}
|
|
4795
5139
|
}));
|
|
4796
|
-
return /* @__PURE__ */
|
|
5140
|
+
return /* @__PURE__ */ React35.createElement(
|
|
4797
5141
|
InputField.Root,
|
|
4798
5142
|
{
|
|
4799
5143
|
size: size2,
|
|
4800
5144
|
labelSize: 16,
|
|
4801
5145
|
renderPopoverContent: ({ width }) => {
|
|
4802
5146
|
const listSize = { width, height };
|
|
4803
|
-
return /* @__PURE__ */
|
|
5147
|
+
return /* @__PURE__ */ React35.createElement(Stack.V, { flex: `0 0 ${height}px`, display }, filteredItems.length > 0 ? /* @__PURE__ */ React35.createElement(
|
|
4804
5148
|
CompletionMenu,
|
|
4805
5149
|
{
|
|
4806
5150
|
ref: listRef,
|
|
@@ -4810,7 +5154,7 @@ var InputFieldWithCompletions = memo23(
|
|
|
4810
5154
|
onHoverIndex: handleIndexChange,
|
|
4811
5155
|
listSize
|
|
4812
5156
|
}
|
|
4813
|
-
) : /* @__PURE__ */
|
|
5157
|
+
) : /* @__PURE__ */ React35.createElement(
|
|
4814
5158
|
Stack.V,
|
|
4815
5159
|
{
|
|
4816
5160
|
height: "100px",
|
|
@@ -4818,11 +5162,11 @@ var InputFieldWithCompletions = memo23(
|
|
|
4818
5162
|
alignItems: "center",
|
|
4819
5163
|
justifyContent: "center"
|
|
4820
5164
|
},
|
|
4821
|
-
/* @__PURE__ */
|
|
5165
|
+
/* @__PURE__ */ React35.createElement(Small, { color: "textDisabled" }, loading ? "Loading" : "No results")
|
|
4822
5166
|
));
|
|
4823
5167
|
}
|
|
4824
5168
|
},
|
|
4825
|
-
/* @__PURE__ */
|
|
5169
|
+
/* @__PURE__ */ React35.createElement(
|
|
4826
5170
|
InputField.Input,
|
|
4827
5171
|
{
|
|
4828
5172
|
ref,
|
|
@@ -4846,9 +5190,9 @@ var InputFieldWithCompletions = memo23(
|
|
|
4846
5190
|
"aria-controls": "component-listbox"
|
|
4847
5191
|
}
|
|
4848
5192
|
),
|
|
4849
|
-
filter && typeaheadValue && typeaheadValue.startsWith(filter) && /* @__PURE__ */
|
|
5193
|
+
filter && typeaheadValue && typeaheadValue.startsWith(filter) && /* @__PURE__ */ React35.createElement(InputField.Typeahead, { value: typeaheadValue }),
|
|
4850
5194
|
(!isFocused || !hideChildrenWhenFocused) && children,
|
|
4851
|
-
loading && isFocused && /* @__PURE__ */
|
|
5195
|
+
loading && isFocused && /* @__PURE__ */ React35.createElement(InputField.Label, null, /* @__PURE__ */ React35.createElement(ActivityIndicator, null))
|
|
4852
5196
|
);
|
|
4853
5197
|
})
|
|
4854
5198
|
);
|
|
@@ -4870,7 +5214,7 @@ function getNextIndex(items, currentIndex, direction, isDisabled) {
|
|
|
4870
5214
|
}
|
|
4871
5215
|
|
|
4872
5216
|
// src/components/Label.tsx
|
|
4873
|
-
import
|
|
5217
|
+
import React36, { memo as memo24 } from "react";
|
|
4874
5218
|
import styled26 from "styled-components";
|
|
4875
5219
|
var LabelLabel = styled26.label(
|
|
4876
5220
|
({ theme, selected }) => ({
|
|
@@ -4899,7 +5243,7 @@ var LabelContainer2 = styled26.span(({ theme }) => ({
|
|
|
4899
5243
|
alignItems: "center"
|
|
4900
5244
|
}));
|
|
4901
5245
|
function LabelRoot({ label, children }) {
|
|
4902
|
-
return /* @__PURE__ */
|
|
5246
|
+
return /* @__PURE__ */ React36.createElement(LabelContainer2, null, children, label && /* @__PURE__ */ React36.createElement(React36.Fragment, null, /* @__PURE__ */ React36.createElement(Spacer.Vertical, { size: 2 }), /* @__PURE__ */ React36.createElement(LabelLabel, null, label)));
|
|
4903
5247
|
}
|
|
4904
5248
|
var Label;
|
|
4905
5249
|
((_Label) => {
|
|
@@ -4909,15 +5253,15 @@ var Label;
|
|
|
4909
5253
|
|
|
4910
5254
|
// src/components/LabeledElementView.tsx
|
|
4911
5255
|
import * as kiwi from "kiwi.js";
|
|
4912
|
-
import
|
|
5256
|
+
import React37, {
|
|
4913
5257
|
Children as Children5,
|
|
4914
5258
|
createRef,
|
|
4915
5259
|
Fragment,
|
|
4916
5260
|
isValidElement as isValidElement4,
|
|
4917
5261
|
memo as memo25,
|
|
4918
5262
|
useLayoutEffect as useLayoutEffect8,
|
|
4919
|
-
useMemo as
|
|
4920
|
-
useRef as
|
|
5263
|
+
useMemo as useMemo20,
|
|
5264
|
+
useRef as useRef17
|
|
4921
5265
|
} from "react";
|
|
4922
5266
|
import styled27 from "styled-components";
|
|
4923
5267
|
var Container4 = styled27.div(({ theme }) => ({
|
|
@@ -4947,14 +5291,14 @@ var LabeledElementView = memo25(function LabeledElementView2({
|
|
|
4947
5291
|
(child) => isValidElement4(child) && "id" in child.props ? child.props.id : null
|
|
4948
5292
|
).filter((id) => !!id);
|
|
4949
5293
|
const serializedIds = elementIds.join(",");
|
|
4950
|
-
const containerRef =
|
|
4951
|
-
const refs =
|
|
5294
|
+
const containerRef = useRef17(null);
|
|
5295
|
+
const refs = useMemo20(() => {
|
|
4952
5296
|
return Object.fromEntries(
|
|
4953
5297
|
serializedIds.split(",").map((id) => [id, createRef()])
|
|
4954
5298
|
);
|
|
4955
5299
|
}, [serializedIds]);
|
|
4956
|
-
const labelElements =
|
|
4957
|
-
return serializedIds.split(",").map((id, index) => /* @__PURE__ */
|
|
5300
|
+
const labelElements = useMemo20(() => {
|
|
5301
|
+
return serializedIds.split(",").map((id, index) => /* @__PURE__ */ React37.createElement(
|
|
4958
5302
|
"span",
|
|
4959
5303
|
{
|
|
4960
5304
|
key: id,
|
|
@@ -5032,13 +5376,13 @@ var LabeledElementView = memo25(function LabeledElementView2({
|
|
|
5032
5376
|
`${Math.max(...heights)}px`
|
|
5033
5377
|
);
|
|
5034
5378
|
}, [refs, labelElements]);
|
|
5035
|
-
return /* @__PURE__ */
|
|
5379
|
+
return /* @__PURE__ */ React37.createElement(Container4, { ref: containerRef }, /* @__PURE__ */ React37.createElement(Tools, null, children), /* @__PURE__ */ React37.createElement(Labels, null, labelElements));
|
|
5036
5380
|
});
|
|
5037
5381
|
|
|
5038
5382
|
// src/components/Progress.tsx
|
|
5039
5383
|
import { clamp } from "@noya-app/noya-utils";
|
|
5040
5384
|
import * as ProgressPrimitive from "@radix-ui/react-progress";
|
|
5041
|
-
import
|
|
5385
|
+
import React38 from "react";
|
|
5042
5386
|
import styled28 from "styled-components";
|
|
5043
5387
|
function Progress({
|
|
5044
5388
|
value,
|
|
@@ -5048,7 +5392,7 @@ function Progress({
|
|
|
5048
5392
|
variant = "normal"
|
|
5049
5393
|
}) {
|
|
5050
5394
|
const clampedValue = clamp(value, 0, 100);
|
|
5051
|
-
return /* @__PURE__ */
|
|
5395
|
+
return /* @__PURE__ */ React38.createElement(ProgressRoot, { value: clampedValue, style: { width, flex, height } }, /* @__PURE__ */ React38.createElement(
|
|
5052
5396
|
ProgressIndicator,
|
|
5053
5397
|
{
|
|
5054
5398
|
variant,
|
|
@@ -5073,13 +5417,13 @@ var ProgressIndicator = styled28(ProgressPrimitive.Indicator)(({ theme, variant
|
|
|
5073
5417
|
|
|
5074
5418
|
// src/components/RadioGroup.tsx
|
|
5075
5419
|
import * as ToggleGroupPrimitive from "@radix-ui/react-toggle-group";
|
|
5076
|
-
import
|
|
5077
|
-
createContext as
|
|
5078
|
-
forwardRef as
|
|
5420
|
+
import React39, {
|
|
5421
|
+
createContext as createContext10,
|
|
5422
|
+
forwardRef as forwardRef14,
|
|
5079
5423
|
memo as memo26,
|
|
5080
|
-
useCallback as
|
|
5081
|
-
useContext as
|
|
5082
|
-
useMemo as
|
|
5424
|
+
useCallback as useCallback22,
|
|
5425
|
+
useContext as useContext10,
|
|
5426
|
+
useMemo as useMemo21
|
|
5083
5427
|
} from "react";
|
|
5084
5428
|
import styled29 from "styled-components";
|
|
5085
5429
|
var ignoredProps3 = /* @__PURE__ */ new Set(["colorScheme"]);
|
|
@@ -5133,9 +5477,9 @@ var StyledItem = styled29(ToggleGroupPrimitive.Item).withConfig({
|
|
|
5133
5477
|
boxShadow: `0 0 0 1px ${theme.colors.sidebar.background}, 0 0 0 3px ${theme.colors[colorScheme ?? "primary"]}`
|
|
5134
5478
|
}
|
|
5135
5479
|
}));
|
|
5136
|
-
var ToggleGroupItem =
|
|
5137
|
-
const { colorScheme } =
|
|
5138
|
-
const itemElement = /* @__PURE__ */
|
|
5480
|
+
var ToggleGroupItem = forwardRef14(function ToggleGroupItem2({ value, tooltip, children, disabled = false }, forwardedRef) {
|
|
5481
|
+
const { colorScheme } = useContext10(RadioGroupContext);
|
|
5482
|
+
const itemElement = /* @__PURE__ */ React39.createElement(
|
|
5139
5483
|
StyledItem,
|
|
5140
5484
|
{
|
|
5141
5485
|
ref: forwardedRef,
|
|
@@ -5145,9 +5489,9 @@ var ToggleGroupItem = forwardRef13(function ToggleGroupItem2({ value, tooltip, c
|
|
|
5145
5489
|
},
|
|
5146
5490
|
children
|
|
5147
5491
|
);
|
|
5148
|
-
return tooltip ? /* @__PURE__ */
|
|
5492
|
+
return tooltip ? /* @__PURE__ */ React39.createElement(Tooltip, { content: tooltip }, itemElement) : itemElement;
|
|
5149
5493
|
});
|
|
5150
|
-
var RadioGroupContext =
|
|
5494
|
+
var RadioGroupContext = createContext10({
|
|
5151
5495
|
colorScheme: "primary"
|
|
5152
5496
|
});
|
|
5153
5497
|
function ToggleGroupRoot({
|
|
@@ -5158,8 +5502,8 @@ function ToggleGroupRoot({
|
|
|
5158
5502
|
allowEmpty,
|
|
5159
5503
|
children
|
|
5160
5504
|
}) {
|
|
5161
|
-
const contextValue =
|
|
5162
|
-
const handleValueChange =
|
|
5505
|
+
const contextValue = useMemo21(() => ({ colorScheme }), [colorScheme]);
|
|
5506
|
+
const handleValueChange = useCallback22(
|
|
5163
5507
|
(value2) => {
|
|
5164
5508
|
if (!allowEmpty && !value2)
|
|
5165
5509
|
return;
|
|
@@ -5167,7 +5511,7 @@ function ToggleGroupRoot({
|
|
|
5167
5511
|
},
|
|
5168
5512
|
[allowEmpty, onValueChange]
|
|
5169
5513
|
);
|
|
5170
|
-
return /* @__PURE__ */
|
|
5514
|
+
return /* @__PURE__ */ React39.createElement(RadioGroupContext.Provider, { value: contextValue }, /* @__PURE__ */ React39.createElement(
|
|
5171
5515
|
StyledRoot,
|
|
5172
5516
|
{
|
|
5173
5517
|
id,
|
|
@@ -5187,30 +5531,30 @@ var RadioGroup;
|
|
|
5187
5531
|
|
|
5188
5532
|
// src/components/Select.tsx
|
|
5189
5533
|
import { memoize as memoize2 } from "@noya-app/noya-utils";
|
|
5190
|
-
import
|
|
5191
|
-
createContext as
|
|
5534
|
+
import React40, {
|
|
5535
|
+
createContext as createContext11,
|
|
5192
5536
|
memo as memo27,
|
|
5193
|
-
useCallback as
|
|
5194
|
-
useContext as
|
|
5537
|
+
useCallback as useCallback23,
|
|
5538
|
+
useContext as useContext11,
|
|
5195
5539
|
useEffect as useEffect13,
|
|
5196
|
-
useMemo as
|
|
5197
|
-
useRef as
|
|
5540
|
+
useMemo as useMemo22,
|
|
5541
|
+
useRef as useRef18
|
|
5198
5542
|
} from "react";
|
|
5199
5543
|
import styled30 from "styled-components";
|
|
5200
|
-
var SelectContext =
|
|
5544
|
+
var SelectContext = createContext11(void 0);
|
|
5201
5545
|
var SelectOption = memo27(function SelectOption2({
|
|
5202
5546
|
value,
|
|
5203
5547
|
title,
|
|
5204
5548
|
onSelect
|
|
5205
5549
|
}) {
|
|
5206
|
-
const { addListener, removeListener } =
|
|
5550
|
+
const { addListener, removeListener } = useContext11(SelectContext);
|
|
5207
5551
|
useEffect13(() => {
|
|
5208
5552
|
if (!onSelect)
|
|
5209
5553
|
return;
|
|
5210
5554
|
addListener(value, onSelect);
|
|
5211
5555
|
return () => removeListener(value);
|
|
5212
5556
|
}, [addListener, onSelect, removeListener, value]);
|
|
5213
|
-
return /* @__PURE__ */
|
|
5557
|
+
return /* @__PURE__ */ React40.createElement("option", { value }, title ?? value);
|
|
5214
5558
|
});
|
|
5215
5559
|
var createChevronSVGString = memoize2(
|
|
5216
5560
|
(color) => `
|
|
@@ -5260,8 +5604,8 @@ var Select = memo27(function Select2({
|
|
|
5260
5604
|
const getTitle = "options" in rest ? rest.getTitle : void 0;
|
|
5261
5605
|
const onChange = "options" in rest ? rest.onChange : void 0;
|
|
5262
5606
|
const children = "options" in rest ? void 0 : rest.children;
|
|
5263
|
-
const optionElements =
|
|
5264
|
-
() => options ? options.map((option, index) => /* @__PURE__ */
|
|
5607
|
+
const optionElements = useMemo22(
|
|
5608
|
+
() => options ? options.map((option, index) => /* @__PURE__ */ React40.createElement(
|
|
5265
5609
|
SelectOption,
|
|
5266
5610
|
{
|
|
5267
5611
|
key: option,
|
|
@@ -5272,21 +5616,21 @@ var Select = memo27(function Select2({
|
|
|
5272
5616
|
)) : children,
|
|
5273
5617
|
[children, getTitle, onChange, options]
|
|
5274
5618
|
);
|
|
5275
|
-
const listeners =
|
|
5276
|
-
const contextValue =
|
|
5619
|
+
const listeners = useRef18(/* @__PURE__ */ new Map());
|
|
5620
|
+
const contextValue = useMemo22(
|
|
5277
5621
|
() => ({
|
|
5278
5622
|
addListener: (value2, listener) => listeners.current.set(value2, listener),
|
|
5279
5623
|
removeListener: (value2) => listeners.current.delete(value2)
|
|
5280
5624
|
}),
|
|
5281
5625
|
[]
|
|
5282
5626
|
);
|
|
5283
|
-
return /* @__PURE__ */
|
|
5627
|
+
return /* @__PURE__ */ React40.createElement(SelectContext.Provider, { value: contextValue }, /* @__PURE__ */ React40.createElement(
|
|
5284
5628
|
SelectElement,
|
|
5285
5629
|
{
|
|
5286
5630
|
id,
|
|
5287
5631
|
flex,
|
|
5288
5632
|
value,
|
|
5289
|
-
onChange:
|
|
5633
|
+
onChange: useCallback23(
|
|
5290
5634
|
(event) => listeners.current.get(event.target.value)?.(),
|
|
5291
5635
|
[listeners]
|
|
5292
5636
|
),
|
|
@@ -5298,7 +5642,7 @@ var Select = memo27(function Select2({
|
|
|
5298
5642
|
|
|
5299
5643
|
// src/components/Slider.tsx
|
|
5300
5644
|
import * as RadixSlider from "@radix-ui/react-slider";
|
|
5301
|
-
import
|
|
5645
|
+
import React41, { useCallback as useCallback24, useMemo as useMemo23 } from "react";
|
|
5302
5646
|
import styled31 from "styled-components";
|
|
5303
5647
|
var StyledSlider = styled31(RadixSlider.Root)({
|
|
5304
5648
|
flex: "1",
|
|
@@ -5339,17 +5683,17 @@ var Slider = function Slider2({
|
|
|
5339
5683
|
min,
|
|
5340
5684
|
max
|
|
5341
5685
|
}) {
|
|
5342
|
-
const arrayValue =
|
|
5686
|
+
const arrayValue = useMemo23(
|
|
5343
5687
|
() => [Math.min(Math.max(value, min), max)],
|
|
5344
5688
|
[value, min, max]
|
|
5345
5689
|
);
|
|
5346
|
-
const handleValueChange =
|
|
5690
|
+
const handleValueChange = useCallback24(
|
|
5347
5691
|
(arrayValue2) => {
|
|
5348
5692
|
onValueChange(arrayValue2[0]);
|
|
5349
5693
|
},
|
|
5350
5694
|
[onValueChange]
|
|
5351
5695
|
);
|
|
5352
|
-
return /* @__PURE__ */
|
|
5696
|
+
return /* @__PURE__ */ React41.createElement(
|
|
5353
5697
|
StyledSlider,
|
|
5354
5698
|
{
|
|
5355
5699
|
min,
|
|
@@ -5358,14 +5702,14 @@ var Slider = function Slider2({
|
|
|
5358
5702
|
value: arrayValue,
|
|
5359
5703
|
onValueChange: handleValueChange
|
|
5360
5704
|
},
|
|
5361
|
-
/* @__PURE__ */
|
|
5362
|
-
/* @__PURE__ */
|
|
5705
|
+
/* @__PURE__ */ React41.createElement(StyledTrack, null, /* @__PURE__ */ React41.createElement(StyledRange, null)),
|
|
5706
|
+
/* @__PURE__ */ React41.createElement(StyledThumb2, null)
|
|
5363
5707
|
);
|
|
5364
5708
|
};
|
|
5365
5709
|
|
|
5366
5710
|
// src/components/Switch.tsx
|
|
5367
5711
|
import * as SwitchPrimitive from "@radix-ui/react-switch";
|
|
5368
|
-
import
|
|
5712
|
+
import React42 from "react";
|
|
5369
5713
|
import styled32 from "styled-components";
|
|
5370
5714
|
var SwitchRoot = styled32(SwitchPrimitive.Root)(({ theme, colorScheme: variant }) => ({
|
|
5371
5715
|
all: "unset",
|
|
@@ -5401,7 +5745,7 @@ var Switch = function Switch2({
|
|
|
5401
5745
|
onChange,
|
|
5402
5746
|
colorScheme = "normal"
|
|
5403
5747
|
}) {
|
|
5404
|
-
return /* @__PURE__ */
|
|
5748
|
+
return /* @__PURE__ */ React42.createElement(
|
|
5405
5749
|
SwitchRoot,
|
|
5406
5750
|
{
|
|
5407
5751
|
colorScheme,
|
|
@@ -5410,40 +5754,40 @@ var Switch = function Switch2({
|
|
|
5410
5754
|
onChange(newValue);
|
|
5411
5755
|
}
|
|
5412
5756
|
},
|
|
5413
|
-
/* @__PURE__ */
|
|
5757
|
+
/* @__PURE__ */ React42.createElement(SwitchThumb, null)
|
|
5414
5758
|
);
|
|
5415
5759
|
};
|
|
5416
5760
|
|
|
5417
5761
|
// src/components/TreeView.tsx
|
|
5418
|
-
import
|
|
5419
|
-
forwardRef as
|
|
5762
|
+
import React43, {
|
|
5763
|
+
forwardRef as forwardRef15,
|
|
5420
5764
|
memo as memo28,
|
|
5421
|
-
useCallback as
|
|
5422
|
-
useContext as
|
|
5765
|
+
useCallback as useCallback25,
|
|
5766
|
+
useContext as useContext12
|
|
5423
5767
|
} from "react";
|
|
5424
|
-
var TreeRow =
|
|
5768
|
+
var TreeRow = forwardRef15(function TreeRow2({
|
|
5425
5769
|
icon,
|
|
5426
5770
|
expanded,
|
|
5427
5771
|
onClickChevron,
|
|
5428
5772
|
children,
|
|
5429
5773
|
...rest
|
|
5430
5774
|
}, forwardedRef) {
|
|
5431
|
-
const { expandable } =
|
|
5432
|
-
const handleClickChevron =
|
|
5775
|
+
const { expandable } = useContext12(ListView.RowContext);
|
|
5776
|
+
const handleClickChevron = useCallback25(
|
|
5433
5777
|
(event) => {
|
|
5434
5778
|
event.stopPropagation();
|
|
5435
5779
|
onClickChevron?.({ altKey: event.altKey });
|
|
5436
5780
|
},
|
|
5437
5781
|
[onClickChevron]
|
|
5438
5782
|
);
|
|
5439
|
-
return /* @__PURE__ */
|
|
5783
|
+
return /* @__PURE__ */ React43.createElement(ListView.Row, { ref: forwardedRef, ...rest }, expandable && /* @__PURE__ */ React43.createElement(React43.Fragment, null, expanded === void 0 ? /* @__PURE__ */ React43.createElement(Spacer.Horizontal, { size: 19 }) : /* @__PURE__ */ React43.createElement(
|
|
5440
5784
|
IconButton,
|
|
5441
5785
|
{
|
|
5442
5786
|
iconName: expanded ? "ChevronDownIcon" : "ChevronRightIcon",
|
|
5443
5787
|
onClick: handleClickChevron,
|
|
5444
5788
|
selected: rest.selected
|
|
5445
5789
|
}
|
|
5446
|
-
), /* @__PURE__ */
|
|
5790
|
+
), /* @__PURE__ */ React43.createElement(Spacer.Horizontal, { size: 6 })), icon && /* @__PURE__ */ React43.createElement(React43.Fragment, null, icon, /* @__PURE__ */ React43.createElement(Spacer.Horizontal, { size: 10 })), children);
|
|
5447
5791
|
});
|
|
5448
5792
|
var TreeView;
|
|
5449
5793
|
((TreeView2) => {
|
|
@@ -5481,6 +5825,7 @@ var dark_exports = {};
|
|
|
5481
5825
|
__export(dark_exports, {
|
|
5482
5826
|
colors: () => colors2,
|
|
5483
5827
|
fonts: () => fonts,
|
|
5828
|
+
name: () => name2,
|
|
5484
5829
|
sizes: () => sizes2,
|
|
5485
5830
|
textStyles: () => textStyles
|
|
5486
5831
|
});
|
|
@@ -5491,9 +5836,11 @@ var light_exports = {};
|
|
|
5491
5836
|
__export(light_exports, {
|
|
5492
5837
|
colors: () => colors,
|
|
5493
5838
|
fonts: () => fonts,
|
|
5839
|
+
name: () => name,
|
|
5494
5840
|
sizes: () => sizes2,
|
|
5495
5841
|
textStyles: () => textStyles
|
|
5496
5842
|
});
|
|
5843
|
+
var name = "light";
|
|
5497
5844
|
var colors = {
|
|
5498
5845
|
logo: {
|
|
5499
5846
|
fill: "rgb(175,175,175)",
|
|
@@ -5648,6 +5995,13 @@ var textStyles = {
|
|
|
5648
5995
|
fontWeight: 400,
|
|
5649
5996
|
lineHeight: "1.4"
|
|
5650
5997
|
},
|
|
5998
|
+
button: {
|
|
5999
|
+
fontFamily: fonts.normal,
|
|
6000
|
+
fontSize: "0.8rem",
|
|
6001
|
+
fontWeight: 500,
|
|
6002
|
+
lineHeight: "1.4",
|
|
6003
|
+
letterSpacing: "-0.2px"
|
|
6004
|
+
},
|
|
5651
6005
|
code: {
|
|
5652
6006
|
fontFamily: fonts.monospace,
|
|
5653
6007
|
fontSize: "90%",
|
|
@@ -5687,6 +6041,7 @@ var sizes2 = {
|
|
|
5687
6041
|
};
|
|
5688
6042
|
|
|
5689
6043
|
// src/theme/dark.ts
|
|
6044
|
+
var name2 = "dark";
|
|
5690
6045
|
var colors2 = produce(colors, (colors3) => {
|
|
5691
6046
|
colors3.logo.fill = "rgb(248,248,250)";
|
|
5692
6047
|
colors3.logo.highlight = "rgb(248,248,250)";
|
|
@@ -5758,7 +6113,7 @@ var SUPPORTED_CANVAS_UPLOAD_TYPES = [
|
|
|
5758
6113
|
|
|
5759
6114
|
// src/components/ArrayController.tsx
|
|
5760
6115
|
import { range as range2 } from "@noya-app/noya-utils";
|
|
5761
|
-
import
|
|
6116
|
+
import React45, { memo as memo30, useCallback as useCallback26, useMemo as useMemo24 } from "react";
|
|
5762
6117
|
import styled34, { useTheme as useTheme5 } from "styled-components";
|
|
5763
6118
|
|
|
5764
6119
|
// src/components/InspectorPrimitives.tsx
|
|
@@ -5777,7 +6132,7 @@ __export(InspectorPrimitives_exports, {
|
|
|
5777
6132
|
Title: () => Title3,
|
|
5778
6133
|
VerticalSeparator: () => VerticalSeparator
|
|
5779
6134
|
});
|
|
5780
|
-
import
|
|
6135
|
+
import React44, { memo as memo29 } from "react";
|
|
5781
6136
|
import styled33, { useTheme as useTheme4 } from "styled-components";
|
|
5782
6137
|
var Section = styled33.div(({ theme, padding = "10px", gap }) => ({
|
|
5783
6138
|
flex: "0 0 auto",
|
|
@@ -5824,8 +6179,8 @@ var Checkbox = styled33.input(({ theme }) => ({
|
|
|
5824
6179
|
var Text3 = styled33.span(({ theme }) => ({
|
|
5825
6180
|
...theme.textStyles.small
|
|
5826
6181
|
}));
|
|
5827
|
-
var VerticalSeparator = () => /* @__PURE__ */
|
|
5828
|
-
var HorizontalSeparator = () => /* @__PURE__ */
|
|
6182
|
+
var VerticalSeparator = () => /* @__PURE__ */ React44.createElement(Spacer.Vertical, { size: useTheme4().sizes.inspector.verticalSeparator });
|
|
6183
|
+
var HorizontalSeparator = () => /* @__PURE__ */ React44.createElement(Spacer.Horizontal, { size: useTheme4().sizes.inspector.horizontalSeparator });
|
|
5829
6184
|
var SliderRowLabel = styled33.span(({ theme }) => ({
|
|
5830
6185
|
...theme.textStyles.small,
|
|
5831
6186
|
color: theme.colors.textMuted,
|
|
@@ -5853,13 +6208,13 @@ var LabeledRow = memo29(function LabeledRow2({
|
|
|
5853
6208
|
gap,
|
|
5854
6209
|
right
|
|
5855
6210
|
}) {
|
|
5856
|
-
return /* @__PURE__ */
|
|
6211
|
+
return /* @__PURE__ */ React44.createElement(Row2, { id }, /* @__PURE__ */ React44.createElement(Column, null, /* @__PURE__ */ React44.createElement(RowLabel, { textStyle: labelTextStyle }, label, right && /* @__PURE__ */ React44.createElement(Spacer.Horizontal, null), right), /* @__PURE__ */ React44.createElement(Row2, { gap }, children)));
|
|
5857
6212
|
});
|
|
5858
6213
|
var LabeledSliderRow = memo29(function LabeledRow3({
|
|
5859
6214
|
children,
|
|
5860
6215
|
label
|
|
5861
6216
|
}) {
|
|
5862
|
-
return /* @__PURE__ */
|
|
6217
|
+
return /* @__PURE__ */ React44.createElement(Row2, null, /* @__PURE__ */ React44.createElement(Column, null, /* @__PURE__ */ React44.createElement(SliderRowLabel, null, label), /* @__PURE__ */ React44.createElement(Row2, null, children)));
|
|
5863
6218
|
});
|
|
5864
6219
|
|
|
5865
6220
|
// src/components/ArrayController.tsx
|
|
@@ -5890,12 +6245,12 @@ var ArrayController = memo30(function ArrayController2({
|
|
|
5890
6245
|
}) {
|
|
5891
6246
|
const iconColor = useTheme5().colors.icon;
|
|
5892
6247
|
const primaryLightColor = useTheme5().colors.primaryLight;
|
|
5893
|
-
const keys =
|
|
6248
|
+
const keys = useMemo24(
|
|
5894
6249
|
() => items.map((item, index) => getKey?.(item) ?? index.toString()),
|
|
5895
6250
|
[getKey, items]
|
|
5896
6251
|
);
|
|
5897
6252
|
const indexes = reversed ? range2(0, items.length).reverse() : range2(0, items.length);
|
|
5898
|
-
const handleMoveItem =
|
|
6253
|
+
const handleMoveItem = useCallback26(
|
|
5899
6254
|
(sourceIndex, destinationIndex, position) => {
|
|
5900
6255
|
if (reversed) {
|
|
5901
6256
|
if (position === "above") {
|
|
@@ -5912,11 +6267,11 @@ var ArrayController = memo30(function ArrayController2({
|
|
|
5912
6267
|
[onMoveItem, reversed]
|
|
5913
6268
|
);
|
|
5914
6269
|
const renderRow = (index) => {
|
|
5915
|
-
return /* @__PURE__ */
|
|
6270
|
+
return /* @__PURE__ */ React45.createElement(ElementRow, { key: keys[index] }, renderItem({ item: items[index], index }));
|
|
5916
6271
|
};
|
|
5917
|
-
return /* @__PURE__ */
|
|
6272
|
+
return /* @__PURE__ */ React45.createElement(Section, { id, padding, gap: "2px" }, /* @__PURE__ */ React45.createElement(SectionHeader, null, /* @__PURE__ */ React45.createElement(Button, { variant: "none", onClick: onClickPlus }, /* @__PURE__ */ React45.createElement(Title3, null, title)), /* @__PURE__ */ React45.createElement(Spacer.Horizontal, null), withSeparatorElements(
|
|
5918
6273
|
[
|
|
5919
|
-
onClickTrash && /* @__PURE__ */
|
|
6274
|
+
onClickTrash && /* @__PURE__ */ React45.createElement(
|
|
5920
6275
|
IconButton,
|
|
5921
6276
|
{
|
|
5922
6277
|
id: `${id}-trash`,
|
|
@@ -5925,7 +6280,7 @@ var ArrayController = memo30(function ArrayController2({
|
|
|
5925
6280
|
onClick: onClickTrash
|
|
5926
6281
|
}
|
|
5927
6282
|
),
|
|
5928
|
-
onClickExpand && /* @__PURE__ */
|
|
6283
|
+
onClickExpand && /* @__PURE__ */ React45.createElement(
|
|
5929
6284
|
IconButton,
|
|
5930
6285
|
{
|
|
5931
6286
|
id: `${id}-gear`,
|
|
@@ -5934,7 +6289,7 @@ var ArrayController = memo30(function ArrayController2({
|
|
|
5934
6289
|
onClick: onClickExpand
|
|
5935
6290
|
}
|
|
5936
6291
|
),
|
|
5937
|
-
onClickPlus && /* @__PURE__ */
|
|
6292
|
+
onClickPlus && /* @__PURE__ */ React45.createElement(
|
|
5938
6293
|
IconButton,
|
|
5939
6294
|
{
|
|
5940
6295
|
id: `${id}-add`,
|
|
@@ -5944,15 +6299,15 @@ var ArrayController = memo30(function ArrayController2({
|
|
|
5944
6299
|
}
|
|
5945
6300
|
)
|
|
5946
6301
|
],
|
|
5947
|
-
/* @__PURE__ */
|
|
5948
|
-
)), /* @__PURE__ */
|
|
6302
|
+
/* @__PURE__ */ React45.createElement(Spacer.Horizontal, { size: 8 })
|
|
6303
|
+
)), /* @__PURE__ */ React45.createElement(Stack.V, { gap: "4px" }, sortable ? /* @__PURE__ */ React45.createElement(
|
|
5949
6304
|
Sortable.Root,
|
|
5950
6305
|
{
|
|
5951
6306
|
keys,
|
|
5952
6307
|
renderOverlay: renderRow,
|
|
5953
6308
|
onMoveItem: handleMoveItem
|
|
5954
6309
|
},
|
|
5955
|
-
indexes.map((index) => /* @__PURE__ */
|
|
6310
|
+
indexes.map((index) => /* @__PURE__ */ React45.createElement(Sortable.Item, { id: keys[index], key: keys[index] }, ({ relativeDropPosition, ...sortableProps }) => /* @__PURE__ */ React45.createElement(ItemContainer2, { ...sortableProps }, renderRow(index), relativeDropPosition && /* @__PURE__ */ React45.createElement(
|
|
5956
6311
|
ListView.DragIndicator,
|
|
5957
6312
|
{
|
|
5958
6313
|
gap: 0,
|
|
@@ -5966,7 +6321,7 @@ var ArrayController = memo30(function ArrayController2({
|
|
|
5966
6321
|
|
|
5967
6322
|
// src/components/DimensionInput.tsx
|
|
5968
6323
|
import { round } from "@noya-app/noya-utils";
|
|
5969
|
-
import
|
|
6324
|
+
import React46, { memo as memo31, useCallback as useCallback27 } from "react";
|
|
5970
6325
|
function getNewValue(value, mode, delta) {
|
|
5971
6326
|
return delta === void 0 ? value : mode === "replace" ? delta : value + delta;
|
|
5972
6327
|
}
|
|
@@ -5980,15 +6335,15 @@ var DimensionInput = memo31(function DimensionInput2({
|
|
|
5980
6335
|
disabled,
|
|
5981
6336
|
trigger = "submit"
|
|
5982
6337
|
}) {
|
|
5983
|
-
const handleNudgeValue =
|
|
6338
|
+
const handleNudgeValue = useCallback27(
|
|
5984
6339
|
(value2) => onSetValue(value2, "adjust"),
|
|
5985
6340
|
[onSetValue]
|
|
5986
6341
|
);
|
|
5987
|
-
const handleSetValue =
|
|
6342
|
+
const handleSetValue = useCallback27(
|
|
5988
6343
|
(value2) => onSetValue(value2, "replace"),
|
|
5989
6344
|
[onSetValue]
|
|
5990
6345
|
);
|
|
5991
|
-
return /* @__PURE__ */
|
|
6346
|
+
return /* @__PURE__ */ React46.createElement(InputField.Root, { id, width: size2 }, /* @__PURE__ */ React46.createElement(
|
|
5992
6347
|
InputField.NumberInput,
|
|
5993
6348
|
{
|
|
5994
6349
|
value: value === void 0 ? value : round(value, 2),
|
|
@@ -5997,12 +6352,13 @@ var DimensionInput = memo31(function DimensionInput2({
|
|
|
5997
6352
|
disabled,
|
|
5998
6353
|
...trigger === "change" ? { onChange: handleSetValue } : { onSubmit: handleSetValue }
|
|
5999
6354
|
}
|
|
6000
|
-
), label && /* @__PURE__ */
|
|
6355
|
+
), label && /* @__PURE__ */ React46.createElement(InputField.Label, null, label));
|
|
6001
6356
|
});
|
|
6002
6357
|
export {
|
|
6003
6358
|
ActivityIndicator,
|
|
6004
6359
|
ArrayController,
|
|
6005
6360
|
Avatar,
|
|
6361
|
+
AvatarStack,
|
|
6006
6362
|
Body,
|
|
6007
6363
|
Button,
|
|
6008
6364
|
ButtonElement,
|
|
@@ -6021,6 +6377,8 @@ export {
|
|
|
6021
6377
|
DropdownMenu,
|
|
6022
6378
|
FillInputField,
|
|
6023
6379
|
FillPreviewBackground,
|
|
6380
|
+
FloatingWindow,
|
|
6381
|
+
FloatingWindowProvider,
|
|
6024
6382
|
FullscreenDialog,
|
|
6025
6383
|
GlobalInputBlurProvider,
|
|
6026
6384
|
GradientPicker,
|
|
@@ -6078,9 +6436,11 @@ export {
|
|
|
6078
6436
|
sketchColorToHex,
|
|
6079
6437
|
sketchColorToRgba,
|
|
6080
6438
|
sketchColorToRgbaString,
|
|
6439
|
+
useCurrentFloatingWindowInternal,
|
|
6081
6440
|
useDesignSystemConfiguration,
|
|
6082
6441
|
useDesignSystemTheme,
|
|
6083
6442
|
useDialogContainsElement,
|
|
6443
|
+
useFloatingWindowManager,
|
|
6084
6444
|
useGlobalInputBlur,
|
|
6085
6445
|
useGlobalInputBlurListener,
|
|
6086
6446
|
useGlobalInputBlurTrigger,
|