@noya-app/noya-designsystem 0.1.29 → 0.1.31
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/.turbo/turbo-lint.log +13 -0
- package/CHANGELOG.md +16 -0
- package/dist/index.d.mts +172 -200
- package/dist/index.d.ts +172 -200
- package/dist/index.js +304 -467
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +301 -468
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -3
- package/src/components/Button.tsx +5 -3
- package/src/components/GridView.tsx +37 -35
- package/src/components/InputField.tsx +118 -88
- package/src/components/ListView.tsx +1 -0
- package/src/components/RadioGroup.tsx +2 -0
- package/src/components/SelectMenu.tsx +69 -12
- package/src/components/Stack.tsx +10 -1
- package/src/components/Switch.tsx +1 -0
- package/src/components/WorkspaceLayout.tsx +29 -6
- package/src/index.tsx +1 -2
- package/tailwind.config.ts +283 -0
- package/tailwind.d.ts +11 -0
- package/tsconfig.json +4 -1
- package/src/components/ArrayController.tsx +0 -168
- package/src/components/Select.tsx +0 -183
package/dist/index.js
CHANGED
|
@@ -1416,13 +1416,13 @@ var require_slicedToArray = __commonJS({
|
|
|
1416
1416
|
var src_exports = {};
|
|
1417
1417
|
__export(src_exports, {
|
|
1418
1418
|
ActivityIndicator: () => ActivityIndicator,
|
|
1419
|
-
ArrayController: () => ArrayController,
|
|
1420
1419
|
AutoResizingTextArea: () => AutoResizingTextArea,
|
|
1421
1420
|
Avatar: () => Avatar,
|
|
1422
1421
|
AvatarStack: () => AvatarStack,
|
|
1423
1422
|
Body: () => Body,
|
|
1424
1423
|
Button: () => Button,
|
|
1425
1424
|
ButtonElement: () => ButtonElement,
|
|
1425
|
+
CONTENT_AREA_ID: () => CONTENT_AREA_ID,
|
|
1426
1426
|
Chip: () => Chip,
|
|
1427
1427
|
CloseButtonContainer: () => CloseButtonContainer,
|
|
1428
1428
|
CompletionMenu: () => CompletionMenu,
|
|
@@ -1437,6 +1437,7 @@ __export(src_exports, {
|
|
|
1437
1437
|
DividerVertical: () => DividerVertical,
|
|
1438
1438
|
DraggableMenuButton: () => DraggableMenuButton,
|
|
1439
1439
|
DropdownMenu: () => DropdownMenu,
|
|
1440
|
+
EDITOR_PANEL_GROUP_ID: () => EDITOR_PANEL_GROUP_ID,
|
|
1440
1441
|
FillInputField: () => FillInputField,
|
|
1441
1442
|
FillPreviewBackground: () => FillPreviewBackground,
|
|
1442
1443
|
FloatingWindow: () => FloatingWindow,
|
|
@@ -1460,21 +1461,21 @@ __export(src_exports, {
|
|
|
1460
1461
|
InspectorPrimitives: () => InspectorPrimitives_exports,
|
|
1461
1462
|
Italic: () => Italic,
|
|
1462
1463
|
KeyboardShortcut: () => KeyboardShortcut,
|
|
1464
|
+
LEFT_SIDEBAR_ID: () => LEFT_SIDEBAR_ID,
|
|
1463
1465
|
Label: () => Label,
|
|
1464
1466
|
LabeledElementView: () => LabeledElementView,
|
|
1465
1467
|
ListView: () => ListView,
|
|
1466
1468
|
PatternPreviewBackground: () => PatternPreviewBackground,
|
|
1467
1469
|
Popover: () => Popover,
|
|
1468
1470
|
Progress: () => Progress,
|
|
1471
|
+
RIGHT_SIDEBAR_ID: () => RIGHT_SIDEBAR_ID,
|
|
1469
1472
|
RadioGroup: () => RadioGroup,
|
|
1470
1473
|
Row: () => Row,
|
|
1471
1474
|
SEPARATOR_ITEM: () => SEPARATOR_ITEM,
|
|
1472
1475
|
SUPPORTED_CANVAS_UPLOAD_TYPES: () => SUPPORTED_CANVAS_UPLOAD_TYPES,
|
|
1473
1476
|
SUPPORTED_IMAGE_UPLOAD_TYPES: () => SUPPORTED_IMAGE_UPLOAD_TYPES,
|
|
1474
1477
|
ScrollArea: () => ScrollArea,
|
|
1475
|
-
Select: () => Select,
|
|
1476
1478
|
SelectMenu: () => SelectMenu,
|
|
1477
|
-
SelectOption: () => SelectOption,
|
|
1478
1479
|
Slider: () => Slider,
|
|
1479
1480
|
Small: () => Small,
|
|
1480
1481
|
Sortable: () => Sortable,
|
|
@@ -1517,6 +1518,7 @@ __export(src_exports, {
|
|
|
1517
1518
|
useOpenInputDialog: () => useOpenInputDialog,
|
|
1518
1519
|
usePlatform: () => usePlatform,
|
|
1519
1520
|
usePlatformModKey: () => usePlatformModKey,
|
|
1521
|
+
usePreservePanelSize: () => usePreservePanelSize,
|
|
1520
1522
|
withSeparatorElements: () => withSeparatorElements
|
|
1521
1523
|
});
|
|
1522
1524
|
module.exports = __toCommonJS(src_exports);
|
|
@@ -1611,6 +1613,10 @@ var StackBase = (0, import_react3.forwardRef)(function StackBase2({
|
|
|
1611
1613
|
breakpoints,
|
|
1612
1614
|
tabIndex,
|
|
1613
1615
|
href,
|
|
1616
|
+
paddingHorizontal,
|
|
1617
|
+
paddingVertical,
|
|
1618
|
+
padding,
|
|
1619
|
+
style: style5,
|
|
1614
1620
|
...rest
|
|
1615
1621
|
}, forwardedRef) {
|
|
1616
1622
|
const elements2 = separator ? withSeparatorElements(import_react3.Children.toArray(children2), separator) : children2;
|
|
@@ -1618,7 +1624,9 @@ var StackBase = (0, import_react3.forwardRef)(function StackBase2({
|
|
|
1618
1624
|
display: "flex",
|
|
1619
1625
|
position: "relative",
|
|
1620
1626
|
alignItems: "stretch",
|
|
1621
|
-
|
|
1627
|
+
padding: padding || `${paddingVertical ?? 0} ${paddingHorizontal ?? 0} ${paddingVertical ?? 0} ${paddingHorizontal ?? 0}`,
|
|
1628
|
+
...rest,
|
|
1629
|
+
...style5
|
|
1622
1630
|
};
|
|
1623
1631
|
return /* @__PURE__ */ import_react3.default.createElement(
|
|
1624
1632
|
Element2,
|
|
@@ -1840,8 +1848,8 @@ var ButtonElement = import_styled_components5.default.button(
|
|
|
1840
1848
|
background: "white",
|
|
1841
1849
|
color: theme.colors.text,
|
|
1842
1850
|
boxShadow: "0 1px 2px rgba(0, 0, 0, 0.1)",
|
|
1843
|
-
fontSize: "12px",
|
|
1844
|
-
padding: "0px 4px",
|
|
1851
|
+
fontSize: $size === "small" ? "10px" : "12px",
|
|
1852
|
+
padding: $size === "small" ? "0px 2px" : "0px 4px",
|
|
1845
1853
|
"&:hover": {
|
|
1846
1854
|
opacity: 0.8
|
|
1847
1855
|
},
|
|
@@ -3321,35 +3329,38 @@ function Popover({
|
|
|
3321
3329
|
// src/components/InputField.tsx
|
|
3322
3330
|
var InputFieldContext = (0, import_react33.createContext)({
|
|
3323
3331
|
labelPosition: "end",
|
|
3324
|
-
labelSize:
|
|
3325
|
-
|
|
3332
|
+
labelSize: void 0,
|
|
3333
|
+
buttonSize: void 0,
|
|
3326
3334
|
hasDropdown: false,
|
|
3327
3335
|
size: "medium",
|
|
3328
3336
|
isFocused: false,
|
|
3329
3337
|
onFocusChange: () => {
|
|
3330
3338
|
}
|
|
3331
3339
|
});
|
|
3332
|
-
var LabelContainer = import_styled_components13.default.label(({ theme, $labelPosition, $hasDropdown, pointerEvents }) =>
|
|
3333
|
-
|
|
3334
|
-
|
|
3335
|
-
|
|
3336
|
-
|
|
3337
|
-
|
|
3338
|
-
|
|
3339
|
-
|
|
3340
|
-
|
|
3341
|
-
|
|
3342
|
-
|
|
3343
|
-
|
|
3344
|
-
|
|
3345
|
-
|
|
3346
|
-
|
|
3347
|
-
|
|
3348
|
-
|
|
3349
|
-
|
|
3340
|
+
var LabelContainer = import_styled_components13.default.label(({ theme, $labelPosition, $hasDropdown, pointerEvents, $size }) => {
|
|
3341
|
+
const offsetRelativeToSize = $size === "large" ? 6 : $size === "medium" ? 2 : 0;
|
|
3342
|
+
return {
|
|
3343
|
+
...theme.textStyles.label,
|
|
3344
|
+
fontWeight: "bold",
|
|
3345
|
+
color: theme.colors.textDisabled,
|
|
3346
|
+
position: "absolute",
|
|
3347
|
+
top: 0,
|
|
3348
|
+
bottom: 0,
|
|
3349
|
+
right: $labelPosition === "end" ? offsetRelativeToSize : void 0,
|
|
3350
|
+
left: $labelPosition === "start" ? offsetRelativeToSize : void 0,
|
|
3351
|
+
display: "flex",
|
|
3352
|
+
alignItems: "center",
|
|
3353
|
+
pointerEvents,
|
|
3354
|
+
userSelect: "none",
|
|
3355
|
+
...$labelPosition === "start" ? { justifyContent: "flex-start", paddingLeft: "6px" } : {
|
|
3356
|
+
justifyContent: "flex-end",
|
|
3357
|
+
paddingRight: $hasDropdown ? "16px" : "6px"
|
|
3358
|
+
}
|
|
3359
|
+
};
|
|
3360
|
+
});
|
|
3350
3361
|
var InputFieldLabel = (0, import_react33.memo)(
|
|
3351
3362
|
(0, import_react33.forwardRef)(function InputFieldLabel2({ children: children2 = false, pointerEvents = "none", style: style5 }, forwardedRef) {
|
|
3352
|
-
const { labelPosition, hasDropdown, setLabelWidth } = (0, import_react33.useContext)(InputFieldContext);
|
|
3363
|
+
const { labelPosition, hasDropdown, setLabelWidth, size: size3 } = (0, import_react33.useContext)(InputFieldContext);
|
|
3353
3364
|
const ref = (0, import_react33.useRef)(null);
|
|
3354
3365
|
(0, import_react33.useLayoutEffect)(() => {
|
|
3355
3366
|
if (!setLabelWidth)
|
|
@@ -3362,6 +3373,7 @@ var InputFieldLabel = (0, import_react33.memo)(
|
|
|
3362
3373
|
return /* @__PURE__ */ import_react33.default.createElement(
|
|
3363
3374
|
LabelContainer,
|
|
3364
3375
|
{
|
|
3376
|
+
$size: size3,
|
|
3365
3377
|
ref: (element) => {
|
|
3366
3378
|
ref.current = element;
|
|
3367
3379
|
assignRef(forwardedRef, element);
|
|
@@ -3398,40 +3410,56 @@ var ButtonContainer = import_styled_components13.default.span(
|
|
|
3398
3410
|
({ theme, $size }) => ({
|
|
3399
3411
|
position: "absolute",
|
|
3400
3412
|
right: $size === "large" ? "9px" : $size === "medium" ? "4px" : "2px",
|
|
3401
|
-
top: $size === "large" ? "
|
|
3413
|
+
top: $size === "large" ? "10px" : $size === "medium" ? "4px" : "2px"
|
|
3402
3414
|
})
|
|
3403
3415
|
);
|
|
3404
|
-
var InputFieldButton = (0, import_react33.memo)(
|
|
3405
|
-
|
|
3406
|
-
|
|
3407
|
-
|
|
3408
|
-
|
|
3409
|
-
|
|
3410
|
-
(
|
|
3411
|
-
|
|
3412
|
-
|
|
3413
|
-
|
|
3414
|
-
|
|
3416
|
+
var InputFieldButton = (0, import_react33.memo)(
|
|
3417
|
+
(0, import_react33.forwardRef)(function InputFieldButton2({
|
|
3418
|
+
children: children2,
|
|
3419
|
+
onClick
|
|
3420
|
+
}, forwardedRef) {
|
|
3421
|
+
const { size: size3, inputRef, setButtonWidth } = (0, import_react33.useContext)(InputFieldContext);
|
|
3422
|
+
const ref = (0, import_react33.useRef)(null);
|
|
3423
|
+
(0, import_react33.useLayoutEffect)(() => {
|
|
3424
|
+
if (!setButtonWidth)
|
|
3425
|
+
return;
|
|
3426
|
+
const width = ref.current?.getBoundingClientRect().width;
|
|
3427
|
+
if (!width)
|
|
3428
|
+
return;
|
|
3429
|
+
setButtonWidth(width);
|
|
3430
|
+
}, [setButtonWidth]);
|
|
3431
|
+
const defaultHandleClick = (0, import_react33.useCallback)(
|
|
3432
|
+
(event) => {
|
|
3433
|
+
if (inputRef && typeof inputRef !== "function") {
|
|
3434
|
+
inputRef.current?.focus();
|
|
3435
|
+
inputRef.current?.setSelectionRange(0, inputRef.current.value.length);
|
|
3436
|
+
}
|
|
3437
|
+
event.preventDefault();
|
|
3438
|
+
event.stopPropagation();
|
|
3439
|
+
},
|
|
3440
|
+
[inputRef]
|
|
3441
|
+
);
|
|
3442
|
+
const handlePointerDown = (0, import_react33.useCallback)((event) => {
|
|
3415
3443
|
event.preventDefault();
|
|
3416
3444
|
event.stopPropagation();
|
|
3417
|
-
},
|
|
3418
|
-
|
|
3419
|
-
|
|
3420
|
-
|
|
3421
|
-
|
|
3422
|
-
|
|
3423
|
-
|
|
3424
|
-
|
|
3425
|
-
|
|
3426
|
-
|
|
3427
|
-
|
|
3428
|
-
|
|
3429
|
-
|
|
3430
|
-
|
|
3431
|
-
|
|
3432
|
-
|
|
3433
|
-
)
|
|
3434
|
-
|
|
3445
|
+
}, []);
|
|
3446
|
+
return /* @__PURE__ */ import_react33.default.createElement(ButtonContainer, { $size: size3 }, /* @__PURE__ */ import_react33.default.createElement(
|
|
3447
|
+
Button,
|
|
3448
|
+
{
|
|
3449
|
+
ref: (element) => {
|
|
3450
|
+
ref.current = element;
|
|
3451
|
+
assignRef(forwardedRef, element);
|
|
3452
|
+
},
|
|
3453
|
+
variant: "floating",
|
|
3454
|
+
onClick: onClick ?? defaultHandleClick,
|
|
3455
|
+
onPointerDown: handlePointerDown,
|
|
3456
|
+
tabIndex: -1,
|
|
3457
|
+
size: size3 === "medium" ? "normal" : size3
|
|
3458
|
+
},
|
|
3459
|
+
children2
|
|
3460
|
+
));
|
|
3461
|
+
})
|
|
3462
|
+
);
|
|
3435
3463
|
var InputElement = (0, import_styled_components13.default)(TextInput_default)(({
|
|
3436
3464
|
theme,
|
|
3437
3465
|
$labelPosition,
|
|
@@ -3439,7 +3467,6 @@ var InputElement = (0, import_styled_components13.default)(TextInput_default)(({
|
|
|
3439
3467
|
$hasDropdown,
|
|
3440
3468
|
$textAlign,
|
|
3441
3469
|
disabled,
|
|
3442
|
-
$hasLabel,
|
|
3443
3470
|
readOnly,
|
|
3444
3471
|
$variant = "normal",
|
|
3445
3472
|
$size
|
|
@@ -3466,8 +3493,8 @@ var InputElement = (0, import_styled_components13.default)(TextInput_default)(({
|
|
|
3466
3493
|
borderRadius: "4px",
|
|
3467
3494
|
paddingTop: $size === "large" ? "10px" : $size === "medium" ? "4px" : "1px",
|
|
3468
3495
|
paddingBottom: $size === "large" ? "10px" : $size === "medium" ? "4px" : "1px",
|
|
3469
|
-
paddingLeft: ($size === "large" ? 10 : $size === "medium" ? 6 : 4) + ($
|
|
3470
|
-
paddingRight: ($size === "large" ? 10 : $size === "medium" ? 6 : 4) + ($
|
|
3496
|
+
paddingLeft: ($size === "large" ? 10 : $size === "medium" ? 6 : 4) + ($labelSize && $labelPosition === "start" ? 6 + $labelSize : 0) + "px",
|
|
3497
|
+
paddingRight: ($size === "large" ? 10 : $size === "medium" ? 6 : 4) + ($labelSize && $labelPosition === "end" ? 6 + $labelSize : 0) + ($hasDropdown ? 11 : 0) + "px",
|
|
3471
3498
|
background: theme.colors.inputBackground,
|
|
3472
3499
|
"&:focus": {
|
|
3473
3500
|
boxShadow: `0 0 0 2px ${theme.colors.primary}`
|
|
@@ -3501,7 +3528,7 @@ var InputFieldInput = (0, import_react33.forwardRef)(function InputFieldInput2({
|
|
|
3501
3528
|
labelPosition,
|
|
3502
3529
|
labelSize,
|
|
3503
3530
|
hasDropdown,
|
|
3504
|
-
|
|
3531
|
+
buttonSize,
|
|
3505
3532
|
size: size3,
|
|
3506
3533
|
onFocusChange,
|
|
3507
3534
|
setInputRef
|
|
@@ -3520,8 +3547,7 @@ var InputFieldInput = (0, import_react33.forwardRef)(function InputFieldInput2({
|
|
|
3520
3547
|
{
|
|
3521
3548
|
ref: forwardedRef,
|
|
3522
3549
|
$labelPosition: labelPosition,
|
|
3523
|
-
$labelSize: labelSize,
|
|
3524
|
-
$hasLabel: hasLabel,
|
|
3550
|
+
$labelSize: labelSize || buttonSize,
|
|
3525
3551
|
$hasDropdown: hasDropdown,
|
|
3526
3552
|
$size: size3,
|
|
3527
3553
|
$variant: variant,
|
|
@@ -3536,7 +3562,6 @@ var InputFieldTypeahead = (props) => {
|
|
|
3536
3562
|
labelPosition,
|
|
3537
3563
|
labelSize,
|
|
3538
3564
|
hasDropdown,
|
|
3539
|
-
hasLabel,
|
|
3540
3565
|
size: size3
|
|
3541
3566
|
// onFocusChange,
|
|
3542
3567
|
} = (0, import_react33.useContext)(InputFieldContext);
|
|
@@ -3546,7 +3571,6 @@ var InputFieldTypeahead = (props) => {
|
|
|
3546
3571
|
as: "span",
|
|
3547
3572
|
$labelPosition: labelPosition,
|
|
3548
3573
|
$labelSize: labelSize,
|
|
3549
|
-
$hasLabel: hasLabel,
|
|
3550
3574
|
$hasDropdown: hasDropdown,
|
|
3551
3575
|
$size: size3,
|
|
3552
3576
|
value: "",
|
|
@@ -3633,15 +3657,13 @@ function InputFieldNumberInput(props) {
|
|
|
3633
3657
|
}
|
|
3634
3658
|
);
|
|
3635
3659
|
}
|
|
3636
|
-
var RootContainer = import_styled_components13.default.div(
|
|
3637
|
-
|
|
3638
|
-
|
|
3639
|
-
|
|
3640
|
-
|
|
3641
|
-
|
|
3642
|
-
|
|
3643
|
-
})
|
|
3644
|
-
);
|
|
3660
|
+
var RootContainer = import_styled_components13.default.div(({ theme, $flex, $width }) => ({
|
|
3661
|
+
flex: $flex ?? "1",
|
|
3662
|
+
display: "flex",
|
|
3663
|
+
flexDirection: "row",
|
|
3664
|
+
position: "relative",
|
|
3665
|
+
maxWidth: typeof $width === "number" ? `${$width}px` : void 0
|
|
3666
|
+
}));
|
|
3645
3667
|
function InputFieldRoot({
|
|
3646
3668
|
id,
|
|
3647
3669
|
flex,
|
|
@@ -3659,11 +3681,9 @@ function InputFieldRoot({
|
|
|
3659
3681
|
const hasDropdown = childrenArray.some(
|
|
3660
3682
|
(child) => (0, import_react33.isValidElement)(child) && child.type === InputFieldDropdownMenu
|
|
3661
3683
|
);
|
|
3662
|
-
const hasLabel = childrenArray.some(
|
|
3663
|
-
(child) => (0, import_react33.isValidElement)(child) && child.type === InputFieldLabel
|
|
3664
|
-
);
|
|
3665
3684
|
const [isFocused, setIsFocused] = import_react33.default.useState(false);
|
|
3666
3685
|
const [measuredLabelSize, setMeasuredLabelSize] = import_react33.default.useState();
|
|
3686
|
+
const [measuredButtonSize, setMeasuredButtonSize] = import_react33.default.useState();
|
|
3667
3687
|
const [measuredWidth, setMeasuredWidth] = import_react33.default.useState();
|
|
3668
3688
|
const handleFocusChange = (0, import_react33.useCallback)(
|
|
3669
3689
|
(isFocused2) => {
|
|
@@ -3683,22 +3703,23 @@ function InputFieldRoot({
|
|
|
3683
3703
|
const contextValue = (0, import_react33.useMemo)(
|
|
3684
3704
|
() => ({
|
|
3685
3705
|
labelPosition,
|
|
3686
|
-
labelSize: measuredLabelSize ?? labelSize
|
|
3706
|
+
labelSize: measuredLabelSize ?? labelSize,
|
|
3707
|
+
buttonSize: measuredButtonSize,
|
|
3687
3708
|
hasDropdown,
|
|
3688
|
-
hasLabel,
|
|
3689
3709
|
size: size3,
|
|
3690
3710
|
isFocused,
|
|
3691
3711
|
onFocusChange: handleFocusChange,
|
|
3692
3712
|
inputRef,
|
|
3693
3713
|
setInputRef,
|
|
3694
|
-
setLabelWidth: setMeasuredLabelSize
|
|
3714
|
+
setLabelWidth: setMeasuredLabelSize,
|
|
3715
|
+
setButtonWidth: setMeasuredButtonSize
|
|
3695
3716
|
}),
|
|
3696
3717
|
[
|
|
3697
3718
|
labelPosition,
|
|
3698
3719
|
measuredLabelSize,
|
|
3699
3720
|
labelSize,
|
|
3721
|
+
measuredButtonSize,
|
|
3700
3722
|
hasDropdown,
|
|
3701
|
-
hasLabel,
|
|
3702
3723
|
size3,
|
|
3703
3724
|
isFocused,
|
|
3704
3725
|
handleFocusChange,
|
|
@@ -5473,44 +5494,44 @@ var sizes2 = {
|
|
|
5473
5494
|
gap: 32
|
|
5474
5495
|
}
|
|
5475
5496
|
};
|
|
5476
|
-
var Grid2 = import_styled_components24.default.div(({ theme, size
|
|
5497
|
+
var Grid2 = import_styled_components24.default.div(({ theme, $size, $padding }) => {
|
|
5477
5498
|
return {
|
|
5478
5499
|
color: theme.colors.text,
|
|
5479
5500
|
display: "grid",
|
|
5480
|
-
gridTemplateColumns: `repeat(auto-fill, minmax(${sizes2[
|
|
5501
|
+
gridTemplateColumns: `repeat(auto-fill, minmax(${sizes2[$size].itemWidth}px, 1fr))`,
|
|
5481
5502
|
// gridAutoRows: `${sizes[size].itemHeight}px`,
|
|
5482
|
-
gap: `${sizes2[
|
|
5503
|
+
gap: `${sizes2[$size].gap}px`,
|
|
5483
5504
|
// gridTemplateColumns: `repeat(auto-fill, minmax(
|
|
5484
5505
|
// ${size === 'large' ? '280px' : size === 'small' ? '160px' : '116px'}
|
|
5485
5506
|
// , 1fr))`,
|
|
5486
5507
|
// gridAutoRows:
|
|
5487
5508
|
// size === 'large' ? '280px' : size === 'small' ? '170px' : '116px',
|
|
5488
5509
|
// gap: size === 'large' || size === 'small' ? `20px` : `12px`,
|
|
5489
|
-
padding
|
|
5510
|
+
padding: $padding
|
|
5490
5511
|
};
|
|
5491
5512
|
});
|
|
5492
5513
|
var Container3 = import_styled_components24.default.div(
|
|
5493
|
-
({ theme, scrollable }) => ({
|
|
5494
|
-
flex: scrollable ? "1" : "0 0 auto",
|
|
5514
|
+
({ theme, $scrollable }) => ({
|
|
5515
|
+
flex: $scrollable ? "1" : "0 0 auto",
|
|
5495
5516
|
display: "flex",
|
|
5496
5517
|
flexDirection: "column"
|
|
5497
5518
|
})
|
|
5498
5519
|
);
|
|
5499
|
-
var ContentContainer = import_styled_components24.default.div(({ theme, selected, hovered, bordered, disabled }) => ({
|
|
5520
|
+
var ContentContainer = import_styled_components24.default.div(({ theme, $selected, $hovered, $bordered, $disabled }) => ({
|
|
5500
5521
|
display: "flex",
|
|
5501
5522
|
flex: "1",
|
|
5502
5523
|
backgroundColor: theme.colors.sidebar.background,
|
|
5503
5524
|
alignItems: "center",
|
|
5504
5525
|
justifyContent: "center",
|
|
5505
5526
|
borderRadius: "2px",
|
|
5506
|
-
border: `1px solid ${selected ? theme.colors.primary : (
|
|
5527
|
+
border: `1px solid ${$selected ? theme.colors.primary : (
|
|
5507
5528
|
// : hovered
|
|
5508
5529
|
// ? `rgb(132, 63, 255, 0.5)`
|
|
5509
|
-
bordered ? theme.colors.divider : "transparent"
|
|
5530
|
+
$bordered ? theme.colors.divider : "transparent"
|
|
5510
5531
|
)}`,
|
|
5511
5532
|
overflow: "hidden",
|
|
5512
5533
|
cursor: "pointer",
|
|
5513
|
-
|
|
5534
|
+
...$disabled ? { opacity: 0.5 } : {
|
|
5514
5535
|
"&:hover": { opacity: 0.85 },
|
|
5515
5536
|
"&:active": { opacity: 0.7 }
|
|
5516
5537
|
}
|
|
@@ -5525,7 +5546,7 @@ var ItemContainer = import_styled_components24.default.div(({ theme }) => ({
|
|
|
5525
5546
|
}
|
|
5526
5547
|
}));
|
|
5527
5548
|
var ItemTitle = import_styled_components24.default.span(
|
|
5528
|
-
({ theme, showBackground }) => ({
|
|
5549
|
+
({ theme, $showBackground }) => ({
|
|
5529
5550
|
...theme.textStyles.small,
|
|
5530
5551
|
lineHeight: "1",
|
|
5531
5552
|
color: theme.colors.text,
|
|
@@ -5534,7 +5555,7 @@ var ItemTitle = import_styled_components24.default.span(
|
|
|
5534
5555
|
whiteSpace: "pre",
|
|
5535
5556
|
overflow: "hidden",
|
|
5536
5557
|
textOverflow: "ellipsis",
|
|
5537
|
-
|
|
5558
|
+
...$showBackground && {
|
|
5538
5559
|
background: theme.colors.sidebar.background,
|
|
5539
5560
|
// border: `1px solid ${theme.colors.dividerSubtle}`,
|
|
5540
5561
|
padding: "2px 4px",
|
|
@@ -5544,7 +5565,7 @@ var ItemTitle = import_styled_components24.default.span(
|
|
|
5544
5565
|
})
|
|
5545
5566
|
);
|
|
5546
5567
|
var ItemDescription = import_styled_components24.default.span(
|
|
5547
|
-
({ theme, showBackground }) => ({
|
|
5568
|
+
({ theme, $showBackground }) => ({
|
|
5548
5569
|
...theme.textStyles.small,
|
|
5549
5570
|
fontSize: "0.7rem",
|
|
5550
5571
|
lineHeight: "1",
|
|
@@ -5553,7 +5574,7 @@ var ItemDescription = import_styled_components24.default.span(
|
|
|
5553
5574
|
whiteSpace: "pre",
|
|
5554
5575
|
overflow: "hidden",
|
|
5555
5576
|
textOverflow: "ellipsis",
|
|
5556
|
-
|
|
5577
|
+
...$showBackground && {
|
|
5557
5578
|
background: theme.colors.sidebar.background,
|
|
5558
5579
|
// border: `1px solid ${theme.colors.dividerSubtle}`,
|
|
5559
5580
|
padding: "2px 4px",
|
|
@@ -5674,10 +5695,10 @@ var GridViewItem = (0, import_react48.forwardRef)(function GridViewItem2({
|
|
|
5674
5695
|
/* @__PURE__ */ import_react48.default.createElement(
|
|
5675
5696
|
ContentContainer,
|
|
5676
5697
|
{
|
|
5677
|
-
disabled,
|
|
5678
|
-
bordered,
|
|
5679
|
-
selected,
|
|
5680
|
-
hovered: !disabled && hovered,
|
|
5698
|
+
$disabled: disabled,
|
|
5699
|
+
$bordered: bordered,
|
|
5700
|
+
$selected: selected,
|
|
5701
|
+
$hovered: !disabled && hovered,
|
|
5681
5702
|
onClick: handleClick,
|
|
5682
5703
|
onDoubleClick,
|
|
5683
5704
|
onContextMenu,
|
|
@@ -5685,8 +5706,8 @@ var GridViewItem = (0, import_react48.forwardRef)(function GridViewItem2({
|
|
|
5685
5706
|
},
|
|
5686
5707
|
children2
|
|
5687
5708
|
),
|
|
5688
|
-
textPosition === "below" && /* @__PURE__ */ import_react48.default.createElement(import_react48.default.Fragment, null, /* @__PURE__ */ import_react48.default.createElement(Spacer.Vertical, { size: 8 }), /* @__PURE__ */ import_react48.default.createElement(ItemTitle, { showBackground: false }, title || " "), /* @__PURE__ */ import_react48.default.createElement(ItemDescription, { showBackground: false }, subtitle || " ")),
|
|
5689
|
-
textPosition === "overlay" && hovered && (title || subtitle) && /* @__PURE__ */ import_react48.default.createElement(TextOverlay, null, title && /* @__PURE__ */ import_react48.default.createElement(ItemTitle, { showBackground: true }, title), subtitle && /* @__PURE__ */ import_react48.default.createElement(ItemDescription, { showBackground: true }, subtitle)),
|
|
5709
|
+
textPosition === "below" && /* @__PURE__ */ import_react48.default.createElement(import_react48.default.Fragment, null, /* @__PURE__ */ import_react48.default.createElement(Spacer.Vertical, { size: 8 }), /* @__PURE__ */ import_react48.default.createElement(ItemTitle, { $showBackground: false }, title || " "), /* @__PURE__ */ import_react48.default.createElement(ItemDescription, { $showBackground: false }, subtitle || " ")),
|
|
5710
|
+
textPosition === "overlay" && hovered && (title || subtitle) && /* @__PURE__ */ import_react48.default.createElement(TextOverlay, null, title && /* @__PURE__ */ import_react48.default.createElement(ItemTitle, { $showBackground: true }, title), subtitle && /* @__PURE__ */ import_react48.default.createElement(ItemDescription, { $showBackground: true }, subtitle)),
|
|
5690
5711
|
loading && /* @__PURE__ */ import_react48.default.createElement(Shimmer, null, /* @__PURE__ */ import_react48.default.createElement(ActivityIndicator, { opacity: 0.5, size: 13 }))
|
|
5691
5712
|
);
|
|
5692
5713
|
if (menuItems && onSelectMenuItem) {
|
|
@@ -5696,7 +5717,7 @@ var GridViewItem = (0, import_react48.forwardRef)(function GridViewItem2({
|
|
|
5696
5717
|
element = /* @__PURE__ */ import_react48.default.createElement(
|
|
5697
5718
|
Tooltip,
|
|
5698
5719
|
{
|
|
5699
|
-
content: /* @__PURE__ */ import_react48.default.createElement(Stack.V, { gap: 2 }, /* @__PURE__ */ import_react48.default.createElement(ItemTitle, { showBackground: false }, title), /* @__PURE__ */ import_react48.default.createElement(ItemDescription, { showBackground: false }, subtitle))
|
|
5720
|
+
content: /* @__PURE__ */ import_react48.default.createElement(Stack.V, { gap: 2 }, /* @__PURE__ */ import_react48.default.createElement(ItemTitle, { $showBackground: false }, title), /* @__PURE__ */ import_react48.default.createElement(ItemDescription, { $showBackground: false }, subtitle))
|
|
5700
5721
|
},
|
|
5701
5722
|
element
|
|
5702
5723
|
);
|
|
@@ -5735,14 +5756,14 @@ function GridViewRoot({
|
|
|
5735
5756
|
}),
|
|
5736
5757
|
[bordered, disabled, size3, textPosition]
|
|
5737
5758
|
);
|
|
5738
|
-
return /* @__PURE__ */ import_react48.default.createElement(GridViewContext.Provider, { value: contextValue }, /* @__PURE__ */ import_react48.default.createElement(Container3, { onClick: handleClick, scrollable }, scrollable ? /* @__PURE__ */ import_react48.default.createElement(ScrollArea, null, children2) : children2));
|
|
5759
|
+
return /* @__PURE__ */ import_react48.default.createElement(GridViewContext.Provider, { value: contextValue }, /* @__PURE__ */ import_react48.default.createElement(Container3, { onClick: handleClick, $scrollable: scrollable }, scrollable ? /* @__PURE__ */ import_react48.default.createElement(ScrollArea, null, children2) : children2));
|
|
5739
5760
|
}
|
|
5740
5761
|
function GridViewSection({
|
|
5741
5762
|
children: children2,
|
|
5742
5763
|
padding = "20px"
|
|
5743
5764
|
}) {
|
|
5744
5765
|
const { size: size3 } = (0, import_react48.useContext)(GridViewContext);
|
|
5745
|
-
return /* @__PURE__ */ import_react48.default.createElement(Grid2, { size: size3, padding }, children2);
|
|
5766
|
+
return /* @__PURE__ */ import_react48.default.createElement(Grid2, { $size: size3, $padding: padding }, children2);
|
|
5746
5767
|
}
|
|
5747
5768
|
function GridViewSectionHeader({ title }) {
|
|
5748
5769
|
const grouped = title.split("/");
|
|
@@ -5819,14 +5840,14 @@ function mergeRanges(ranges) {
|
|
|
5819
5840
|
const merged = [];
|
|
5820
5841
|
const sorted = [...ranges].sort((a, b) => a.start - b.start);
|
|
5821
5842
|
let current;
|
|
5822
|
-
for (const
|
|
5843
|
+
for (const range2 of sorted) {
|
|
5823
5844
|
if (!current) {
|
|
5824
|
-
current =
|
|
5825
|
-
} else if (
|
|
5826
|
-
current.end = Math.max(current.end,
|
|
5845
|
+
current = range2;
|
|
5846
|
+
} else if (range2.start <= current.end) {
|
|
5847
|
+
current.end = Math.max(current.end, range2.end);
|
|
5827
5848
|
} else {
|
|
5828
5849
|
merged.push(current);
|
|
5829
|
-
current =
|
|
5850
|
+
current = range2;
|
|
5830
5851
|
}
|
|
5831
5852
|
}
|
|
5832
5853
|
if (current) {
|
|
@@ -10467,7 +10488,7 @@ var PositionCache = /* @__PURE__ */ function() {
|
|
|
10467
10488
|
// Render all cells visible within the viewport range defined.
|
|
10468
10489
|
}, {
|
|
10469
10490
|
key: "range",
|
|
10470
|
-
value: function
|
|
10491
|
+
value: function range2(scrollTop, clientHeight, renderCallback) {
|
|
10471
10492
|
var _this = this;
|
|
10472
10493
|
this._intervalTree.queryInterval(scrollTop, scrollTop + clientHeight, function(_ref) {
|
|
10473
10494
|
var _ref2 = (0, import_slicedToArray.default)(_ref, 3), top = _ref2[0], _ = _ref2[1], index = _ref2[2];
|
|
@@ -14594,72 +14615,22 @@ var RadioGroup;
|
|
|
14594
14615
|
RadioGroup2.Item = (0, import_react57.memo)(ToggleGroupItem);
|
|
14595
14616
|
})(RadioGroup || (RadioGroup = {}));
|
|
14596
14617
|
|
|
14597
|
-
// src/components/
|
|
14598
|
-
var
|
|
14618
|
+
// src/components/SelectMenu.tsx
|
|
14619
|
+
var import_noya_icons6 = require("@noya-app/noya-icons");
|
|
14620
|
+
var Select = __toESM(require("@radix-ui/react-select"));
|
|
14599
14621
|
var import_react58 = __toESM(require("react"));
|
|
14600
|
-
var import_styled_components32 =
|
|
14601
|
-
var
|
|
14602
|
-
|
|
14603
|
-
|
|
14604
|
-
|
|
14605
|
-
|
|
14606
|
-
|
|
14607
|
-
|
|
14608
|
-
|
|
14609
|
-
|
|
14610
|
-
|
|
14611
|
-
|
|
14612
|
-
return () => removeListener(value);
|
|
14613
|
-
}, [addListener, onSelect, removeListener, value]);
|
|
14614
|
-
return /* @__PURE__ */ import_react58.default.createElement("option", { value }, title ?? value);
|
|
14615
|
-
});
|
|
14616
|
-
var createChevronSVGString = (0, import_noya_utils10.memoize)(
|
|
14617
|
-
(color) => `
|
|
14618
|
-
<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 15 15' fill='${color}'>
|
|
14619
|
-
<path d='M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z'></path>
|
|
14620
|
-
</svg>
|
|
14621
|
-
`.replace(/\n/g, "")
|
|
14622
|
-
);
|
|
14623
|
-
var SelectContainer = import_styled_components32.default.div(
|
|
14624
|
-
({ $flex }) => ({
|
|
14625
|
-
flex: $flex ?? "1 1 0px",
|
|
14626
|
-
display: "flex",
|
|
14627
|
-
flexDirection: "row",
|
|
14628
|
-
position: "relative"
|
|
14629
|
-
})
|
|
14630
|
-
);
|
|
14631
|
-
var SelectElement = import_styled_components32.default.select(
|
|
14632
|
-
({ theme, $flex }) => ({
|
|
14633
|
-
appearance: "none",
|
|
14634
|
-
...theme.textStyles.small,
|
|
14635
|
-
color: theme.colors.text,
|
|
14636
|
-
lineHeight: "19px",
|
|
14637
|
-
width: "0px",
|
|
14638
|
-
// Reset intrinsic width
|
|
14639
|
-
flex: $flex ?? "1 1 0px",
|
|
14640
|
-
position: "relative",
|
|
14641
|
-
border: "0",
|
|
14642
|
-
outline: "none",
|
|
14643
|
-
minWidth: "0",
|
|
14644
|
-
textAlign: "left",
|
|
14645
|
-
alignSelf: "stretch",
|
|
14646
|
-
borderRadius: "4px",
|
|
14647
|
-
paddingTop: "4px",
|
|
14648
|
-
paddingBottom: "4px",
|
|
14649
|
-
paddingLeft: "6px",
|
|
14650
|
-
paddingRight: "23px",
|
|
14651
|
-
background: [
|
|
14652
|
-
`calc(100% - 6px) / 15px url("data:image/svg+xml;utf8,${createChevronSVGString(
|
|
14653
|
-
theme.colors.icon
|
|
14654
|
-
)}") no-repeat`,
|
|
14655
|
-
theme.colors.inputBackground
|
|
14656
|
-
].join(","),
|
|
14657
|
-
"&:focus": {
|
|
14658
|
-
boxShadow: `0 0 0 2px ${theme.colors.primary}`
|
|
14659
|
-
}
|
|
14660
|
-
})
|
|
14661
|
-
);
|
|
14662
|
-
var SelectLabel = import_styled_components32.default.label(({ theme }) => ({
|
|
14622
|
+
var import_styled_components32 = require("styled-components");
|
|
14623
|
+
var readOnlyStyle = {
|
|
14624
|
+
justifyContent: "flex-start",
|
|
14625
|
+
textAlign: "left"
|
|
14626
|
+
};
|
|
14627
|
+
var flexStyle = {
|
|
14628
|
+
flex: 1
|
|
14629
|
+
};
|
|
14630
|
+
var textStyle = {
|
|
14631
|
+
fontSize: "0.85rem"
|
|
14632
|
+
};
|
|
14633
|
+
var SelectLabel = import_styled_components32.styled.label(({ theme }) => ({
|
|
14663
14634
|
...theme.textStyles.label,
|
|
14664
14635
|
color: theme.colors.textDisabled,
|
|
14665
14636
|
lineHeight: "19px",
|
|
@@ -14673,66 +14644,7 @@ var SelectLabel = import_styled_components32.default.label(({ theme }) => ({
|
|
|
14673
14644
|
justifyContent: "end",
|
|
14674
14645
|
paddingRight: "24px"
|
|
14675
14646
|
}));
|
|
14676
|
-
var
|
|
14677
|
-
id,
|
|
14678
|
-
flex,
|
|
14679
|
-
value,
|
|
14680
|
-
label,
|
|
14681
|
-
...rest
|
|
14682
|
-
}) {
|
|
14683
|
-
const options = "options" in rest ? rest.options : void 0;
|
|
14684
|
-
const getTitle = "options" in rest ? rest.getTitle : void 0;
|
|
14685
|
-
const onChange = "options" in rest ? rest.onChange : void 0;
|
|
14686
|
-
const children2 = "options" in rest ? void 0 : rest.children;
|
|
14687
|
-
const optionElements = (0, import_react58.useMemo)(
|
|
14688
|
-
() => options ? options.map((option, index) => /* @__PURE__ */ import_react58.default.createElement(
|
|
14689
|
-
SelectOption,
|
|
14690
|
-
{
|
|
14691
|
-
key: option,
|
|
14692
|
-
value: option,
|
|
14693
|
-
title: getTitle?.(option, index),
|
|
14694
|
-
onSelect: () => onChange?.(option)
|
|
14695
|
-
}
|
|
14696
|
-
)) : children2,
|
|
14697
|
-
[children2, getTitle, onChange, options]
|
|
14698
|
-
);
|
|
14699
|
-
const listeners = (0, import_react58.useRef)(/* @__PURE__ */ new Map());
|
|
14700
|
-
const contextValue = (0, import_react58.useMemo)(
|
|
14701
|
-
() => ({
|
|
14702
|
-
addListener: (value2, listener) => listeners.current.set(value2, listener),
|
|
14703
|
-
removeListener: (value2) => listeners.current.delete(value2)
|
|
14704
|
-
}),
|
|
14705
|
-
[]
|
|
14706
|
-
);
|
|
14707
|
-
return /* @__PURE__ */ import_react58.default.createElement(SelectContext.Provider, { value: contextValue }, /* @__PURE__ */ import_react58.default.createElement(SelectContainer, { $flex: flex }, /* @__PURE__ */ import_react58.default.createElement(
|
|
14708
|
-
SelectElement,
|
|
14709
|
-
{
|
|
14710
|
-
id,
|
|
14711
|
-
$flex: flex,
|
|
14712
|
-
value,
|
|
14713
|
-
onChange: (0, import_react58.useCallback)(
|
|
14714
|
-
(event) => listeners.current.get(event.target.value)?.(),
|
|
14715
|
-
[listeners]
|
|
14716
|
-
),
|
|
14717
|
-
onPointerDown: (event) => event.stopPropagation()
|
|
14718
|
-
},
|
|
14719
|
-
optionElements
|
|
14720
|
-
)), label && /* @__PURE__ */ import_react58.default.createElement(SelectLabel, { htmlFor: id }, label));
|
|
14721
|
-
});
|
|
14722
|
-
|
|
14723
|
-
// src/components/SelectMenu.tsx
|
|
14724
|
-
var import_noya_icons6 = require("@noya-app/noya-icons");
|
|
14725
|
-
var Select3 = __toESM(require("@radix-ui/react-select"));
|
|
14726
|
-
var import_react59 = __toESM(require("react"));
|
|
14727
|
-
var import_styled_components33 = require("styled-components");
|
|
14728
|
-
var readOnlyStyle = {
|
|
14729
|
-
justifyContent: "flex-start",
|
|
14730
|
-
textAlign: "left"
|
|
14731
|
-
};
|
|
14732
|
-
var flexStyle = {
|
|
14733
|
-
flex: 1
|
|
14734
|
-
};
|
|
14735
|
-
var SelectMenu = (0, import_react59.memo)(function SelectMenu2({
|
|
14647
|
+
var SelectMenu = (0, import_react58.memo)(function SelectMenu2({
|
|
14736
14648
|
id,
|
|
14737
14649
|
style: style5,
|
|
14738
14650
|
className,
|
|
@@ -14741,53 +14653,75 @@ var SelectMenu = (0, import_react59.memo)(function SelectMenu2({
|
|
|
14741
14653
|
onSelect,
|
|
14742
14654
|
placeholder,
|
|
14743
14655
|
disabled,
|
|
14744
|
-
readOnly
|
|
14656
|
+
readOnly,
|
|
14657
|
+
label,
|
|
14658
|
+
open
|
|
14745
14659
|
}) {
|
|
14746
14660
|
const selectedItem = menuItems.find(
|
|
14747
14661
|
(item) => typeof item !== "string" && item.value === value
|
|
14748
14662
|
);
|
|
14749
14663
|
const icon = selectedItem?.icon;
|
|
14750
|
-
|
|
14751
|
-
|
|
14664
|
+
const readOnlyButton = (0, import_react58.useMemo)(
|
|
14665
|
+
() => /* @__PURE__ */ import_react58.default.createElement(
|
|
14752
14666
|
Button,
|
|
14753
14667
|
{
|
|
14754
14668
|
id,
|
|
14755
|
-
style: style5,
|
|
14669
|
+
style: { ...style5, ...flexStyle },
|
|
14756
14670
|
contentStyle: readOnlyStyle,
|
|
14757
14671
|
className,
|
|
14758
14672
|
disabled
|
|
14759
14673
|
},
|
|
14760
|
-
icon && /* @__PURE__ */
|
|
14761
|
-
/* @__PURE__ */
|
|
14762
|
-
)
|
|
14674
|
+
icon && /* @__PURE__ */ import_react58.default.createElement(import_react58.default.Fragment, null, renderIcon(icon), /* @__PURE__ */ import_react58.default.createElement(Spacer.Horizontal, { inline: true, size: 6 })),
|
|
14675
|
+
/* @__PURE__ */ import_react58.default.createElement("span", { style: { ...flexStyle, ...textStyle } }, selectedItem?.title ?? value)
|
|
14676
|
+
),
|
|
14677
|
+
[icon, id, style5, className, disabled, value, selectedItem]
|
|
14678
|
+
);
|
|
14679
|
+
const trigger = (0, import_react58.useMemo)(
|
|
14680
|
+
() => /* @__PURE__ */ import_react58.default.createElement(Select.SelectTrigger, { asChild: true }, /* @__PURE__ */ import_react58.default.createElement(
|
|
14681
|
+
Button,
|
|
14682
|
+
{
|
|
14683
|
+
id,
|
|
14684
|
+
style: { ...textStyle, ...style5, ...flexStyle },
|
|
14685
|
+
className,
|
|
14686
|
+
disabled
|
|
14687
|
+
},
|
|
14688
|
+
icon && /* @__PURE__ */ import_react58.default.createElement(import_react58.default.Fragment, null, renderIcon(icon), /* @__PURE__ */ import_react58.default.createElement(Spacer.Horizontal, { inline: true, size: 6 })),
|
|
14689
|
+
/* @__PURE__ */ import_react58.default.createElement("span", { style: flexStyle }, /* @__PURE__ */ import_react58.default.createElement(Select.Value, { placeholder })),
|
|
14690
|
+
/* @__PURE__ */ import_react58.default.createElement(Spacer.Horizontal, { inline: true, size: 6 }),
|
|
14691
|
+
/* @__PURE__ */ import_react58.default.createElement(import_noya_icons6.DropdownChevronIcon, null)
|
|
14692
|
+
)),
|
|
14693
|
+
[icon, id, style5, className, disabled, placeholder]
|
|
14694
|
+
);
|
|
14695
|
+
if (readOnly) {
|
|
14696
|
+
return label ? /* @__PURE__ */ import_react58.default.createElement(Stack.V, { position: "relative" }, readOnlyButton, /* @__PURE__ */ import_react58.default.createElement(SelectLabel, { htmlFor: id }, label)) : readOnlyButton;
|
|
14763
14697
|
}
|
|
14764
|
-
return /* @__PURE__ */
|
|
14698
|
+
return /* @__PURE__ */ import_react58.default.createElement(Select.Root, { value, onValueChange: onSelect, open }, label ? /* @__PURE__ */ import_react58.default.createElement(Stack.V, { position: "relative", style: flexStyle }, trigger, /* @__PURE__ */ import_react58.default.createElement(SelectLabel, { htmlFor: id }, label)) : trigger, /* @__PURE__ */ import_react58.default.createElement(Select.Portal, null, /* @__PURE__ */ import_react58.default.createElement(SelectContent, null, /* @__PURE__ */ import_react58.default.createElement(SelectViewport, null, menuItems.map((menuItem) => {
|
|
14765
14699
|
if (typeof menuItem === "string") {
|
|
14766
|
-
return /* @__PURE__ */
|
|
14700
|
+
return /* @__PURE__ */ import_react58.default.createElement(StyledSeparator, null);
|
|
14767
14701
|
}
|
|
14768
14702
|
const value2 = menuItem.value ?? "";
|
|
14769
|
-
return /* @__PURE__ */
|
|
14703
|
+
return /* @__PURE__ */ import_react58.default.createElement(SelectItem, { key: value2, value: value2, icon: menuItem.icon }, menuItem.title ?? value2);
|
|
14770
14704
|
})))));
|
|
14771
14705
|
});
|
|
14772
|
-
var SelectContent = (0,
|
|
14773
|
-
var SelectViewport = (0,
|
|
14774
|
-
var SelectItem =
|
|
14706
|
+
var SelectContent = (0, import_styled_components32.styled)(Select.Content)(styles.contentStyle);
|
|
14707
|
+
var SelectViewport = (0, import_styled_components32.styled)(Select.Viewport)({});
|
|
14708
|
+
var SelectItem = import_react58.default.forwardRef(
|
|
14775
14709
|
({
|
|
14776
14710
|
children: children2,
|
|
14777
14711
|
icon,
|
|
14778
14712
|
...props
|
|
14779
14713
|
}, forwardedRef) => {
|
|
14780
|
-
return /* @__PURE__ */
|
|
14714
|
+
return /* @__PURE__ */ import_react58.default.createElement(StyledItem2, { ...props, ref: forwardedRef }, icon && /* @__PURE__ */ import_react58.default.createElement(import_react58.default.Fragment, null, renderIcon(icon), /* @__PURE__ */ import_react58.default.createElement(Spacer.Horizontal, { size: 8 })), /* @__PURE__ */ import_react58.default.createElement(Select.ItemText, { style: textStyle }, children2));
|
|
14781
14715
|
}
|
|
14782
14716
|
);
|
|
14783
|
-
var StyledItem2 = (0,
|
|
14784
|
-
var StyledSeparator = (0,
|
|
14717
|
+
var StyledItem2 = (0, import_styled_components32.styled)(Select.Item)(styles.itemStyle);
|
|
14718
|
+
var StyledSeparator = (0, import_styled_components32.styled)(Select.Separator)(styles.separatorStyle);
|
|
14785
14719
|
|
|
14786
14720
|
// src/components/Slider.tsx
|
|
14787
14721
|
var RadixSlider = __toESM(require("@radix-ui/react-slider"));
|
|
14788
|
-
var
|
|
14789
|
-
var
|
|
14790
|
-
var StyledSlider = (0,
|
|
14722
|
+
var import_react59 = __toESM(require("react"));
|
|
14723
|
+
var import_styled_components33 = __toESM(require("styled-components"));
|
|
14724
|
+
var StyledSlider = (0, import_styled_components33.default)(RadixSlider.Root)({
|
|
14791
14725
|
flex: "1",
|
|
14792
14726
|
position: "relative",
|
|
14793
14727
|
display: "flex",
|
|
@@ -14796,19 +14730,19 @@ var StyledSlider = (0, import_styled_components34.default)(RadixSlider.Root)({
|
|
|
14796
14730
|
touchAction: "none",
|
|
14797
14731
|
height: "16px"
|
|
14798
14732
|
});
|
|
14799
|
-
var StyledTrack = (0,
|
|
14733
|
+
var StyledTrack = (0, import_styled_components33.default)(RadixSlider.Track)(({ theme }) => ({
|
|
14800
14734
|
backgroundColor: theme.colors.divider,
|
|
14801
14735
|
position: "relative",
|
|
14802
14736
|
flexGrow: 1,
|
|
14803
14737
|
height: "2px"
|
|
14804
14738
|
}));
|
|
14805
|
-
var StyledRange = (0,
|
|
14739
|
+
var StyledRange = (0, import_styled_components33.default)(RadixSlider.Range)(({ theme }) => ({
|
|
14806
14740
|
position: "absolute",
|
|
14807
14741
|
backgroundColor: theme.colors.primary,
|
|
14808
14742
|
borderRadius: "9999px",
|
|
14809
14743
|
height: "100%"
|
|
14810
14744
|
}));
|
|
14811
|
-
var StyledThumb2 = (0,
|
|
14745
|
+
var StyledThumb2 = (0, import_styled_components33.default)(RadixSlider.Thumb)(({ theme }) => ({
|
|
14812
14746
|
display: "block",
|
|
14813
14747
|
width: "12px",
|
|
14814
14748
|
height: "12px",
|
|
@@ -14826,17 +14760,17 @@ var Slider = function Slider2({
|
|
|
14826
14760
|
min,
|
|
14827
14761
|
max
|
|
14828
14762
|
}) {
|
|
14829
|
-
const arrayValue = (0,
|
|
14763
|
+
const arrayValue = (0, import_react59.useMemo)(
|
|
14830
14764
|
() => [Math.min(Math.max(value, min), max)],
|
|
14831
14765
|
[value, min, max]
|
|
14832
14766
|
);
|
|
14833
|
-
const handleValueChange = (0,
|
|
14767
|
+
const handleValueChange = (0, import_react59.useCallback)(
|
|
14834
14768
|
(arrayValue2) => {
|
|
14835
14769
|
onValueChange(arrayValue2[0]);
|
|
14836
14770
|
},
|
|
14837
14771
|
[onValueChange]
|
|
14838
14772
|
);
|
|
14839
|
-
return /* @__PURE__ */
|
|
14773
|
+
return /* @__PURE__ */ import_react59.default.createElement(
|
|
14840
14774
|
StyledSlider,
|
|
14841
14775
|
{
|
|
14842
14776
|
min,
|
|
@@ -14845,16 +14779,16 @@ var Slider = function Slider2({
|
|
|
14845
14779
|
value: arrayValue,
|
|
14846
14780
|
onValueChange: handleValueChange
|
|
14847
14781
|
},
|
|
14848
|
-
/* @__PURE__ */
|
|
14849
|
-
/* @__PURE__ */
|
|
14782
|
+
/* @__PURE__ */ import_react59.default.createElement(StyledTrack, null, /* @__PURE__ */ import_react59.default.createElement(StyledRange, null)),
|
|
14783
|
+
/* @__PURE__ */ import_react59.default.createElement(StyledThumb2, null)
|
|
14850
14784
|
);
|
|
14851
14785
|
};
|
|
14852
14786
|
|
|
14853
14787
|
// src/components/Switch.tsx
|
|
14854
14788
|
var SwitchPrimitive = __toESM(require("@radix-ui/react-switch"));
|
|
14855
|
-
var
|
|
14856
|
-
var
|
|
14857
|
-
var SwitchRoot = (0,
|
|
14789
|
+
var import_react60 = __toESM(require("react"));
|
|
14790
|
+
var import_styled_components34 = __toESM(require("styled-components"));
|
|
14791
|
+
var SwitchRoot = (0, import_styled_components34.default)(SwitchPrimitive.Root)(({ theme, $colorScheme }) => ({
|
|
14858
14792
|
all: "unset",
|
|
14859
14793
|
width: 32,
|
|
14860
14794
|
height: 19,
|
|
@@ -14871,7 +14805,7 @@ var SwitchRoot = (0, import_styled_components35.default)(SwitchPrimitive.Root)((
|
|
|
14871
14805
|
backgroundColor: $colorScheme === "primary" ? theme.colors.primary : $colorScheme === "secondary" ? theme.colors.secondary : void 0
|
|
14872
14806
|
}
|
|
14873
14807
|
}));
|
|
14874
|
-
var SwitchThumb = (0,
|
|
14808
|
+
var SwitchThumb = (0, import_styled_components34.default)(SwitchPrimitive.Thumb)({
|
|
14875
14809
|
display: "block",
|
|
14876
14810
|
width: 15,
|
|
14877
14811
|
height: 15,
|
|
@@ -14888,7 +14822,7 @@ var Switch = function Switch2({
|
|
|
14888
14822
|
colorScheme = "normal",
|
|
14889
14823
|
disabled
|
|
14890
14824
|
}) {
|
|
14891
|
-
return /* @__PURE__ */
|
|
14825
|
+
return /* @__PURE__ */ import_react60.default.createElement(
|
|
14892
14826
|
SwitchRoot,
|
|
14893
14827
|
{
|
|
14894
14828
|
$colorScheme: colorScheme,
|
|
@@ -14898,14 +14832,14 @@ var Switch = function Switch2({
|
|
|
14898
14832
|
onChange(newValue);
|
|
14899
14833
|
}
|
|
14900
14834
|
},
|
|
14901
|
-
/* @__PURE__ */
|
|
14835
|
+
/* @__PURE__ */ import_react60.default.createElement(SwitchThumb, null)
|
|
14902
14836
|
);
|
|
14903
14837
|
};
|
|
14904
14838
|
|
|
14905
14839
|
// src/components/TextArea.tsx
|
|
14906
|
-
var
|
|
14907
|
-
var
|
|
14908
|
-
var TextAreaElement =
|
|
14840
|
+
var import_react61 = __toESM(require("react"));
|
|
14841
|
+
var import_styled_components35 = __toESM(require("styled-components"));
|
|
14842
|
+
var TextAreaElement = import_styled_components35.default.textarea(({ theme }) => ({
|
|
14909
14843
|
...theme.textStyles.small,
|
|
14910
14844
|
color: theme.colors.text,
|
|
14911
14845
|
background: theme.colors.inputBackground,
|
|
@@ -14929,8 +14863,8 @@ var TextAreaElement = import_styled_components36.default.textarea(({ theme }) =>
|
|
|
14929
14863
|
resize: "none"
|
|
14930
14864
|
}));
|
|
14931
14865
|
var useAutoResize = (value) => {
|
|
14932
|
-
const textareaRef = (0,
|
|
14933
|
-
(0,
|
|
14866
|
+
const textareaRef = (0, import_react61.useRef)(null);
|
|
14867
|
+
(0, import_react61.useEffect)(() => {
|
|
14934
14868
|
if (!textareaRef.current)
|
|
14935
14869
|
return;
|
|
14936
14870
|
textareaRef.current.style.height = "auto";
|
|
@@ -14938,25 +14872,25 @@ var useAutoResize = (value) => {
|
|
|
14938
14872
|
}, [value]);
|
|
14939
14873
|
return textareaRef;
|
|
14940
14874
|
};
|
|
14941
|
-
var AutoResizingTextArea = (0,
|
|
14942
|
-
(0,
|
|
14875
|
+
var AutoResizingTextArea = (0, import_react61.memo)(
|
|
14876
|
+
(0, import_react61.forwardRef)(function AutoResizingTextArea2({
|
|
14943
14877
|
value,
|
|
14944
14878
|
onChangeText,
|
|
14945
14879
|
...rest
|
|
14946
14880
|
}, forwardedRef) {
|
|
14947
14881
|
const ref = useAutoResize(value || rest.placeholder || "");
|
|
14948
|
-
const handleChange = (0,
|
|
14882
|
+
const handleChange = (0, import_react61.useCallback)(
|
|
14949
14883
|
(event) => onChangeText(event.target.value),
|
|
14950
14884
|
[onChangeText]
|
|
14951
14885
|
);
|
|
14952
|
-
const handleRef = (0,
|
|
14886
|
+
const handleRef = (0, import_react61.useCallback)(
|
|
14953
14887
|
(value2) => {
|
|
14954
14888
|
ref.current = value2;
|
|
14955
14889
|
assignRef(forwardedRef, value2);
|
|
14956
14890
|
},
|
|
14957
14891
|
[ref, forwardedRef]
|
|
14958
14892
|
);
|
|
14959
|
-
return /* @__PURE__ */
|
|
14893
|
+
return /* @__PURE__ */ import_react61.default.createElement(
|
|
14960
14894
|
TextAreaElement,
|
|
14961
14895
|
{
|
|
14962
14896
|
ref: handleRef,
|
|
@@ -14969,57 +14903,57 @@ var AutoResizingTextArea = (0, import_react62.memo)(
|
|
|
14969
14903
|
);
|
|
14970
14904
|
|
|
14971
14905
|
// src/components/TreeView.tsx
|
|
14972
|
-
var
|
|
14973
|
-
var TreeRow = (0,
|
|
14906
|
+
var import_react62 = __toESM(require("react"));
|
|
14907
|
+
var TreeRow = (0, import_react62.forwardRef)(function TreeRow2({
|
|
14974
14908
|
icon,
|
|
14975
14909
|
expanded,
|
|
14976
14910
|
onClickChevron,
|
|
14977
14911
|
children: children2,
|
|
14978
14912
|
...rest
|
|
14979
14913
|
}, forwardedRef) {
|
|
14980
|
-
const { expandable } = (0,
|
|
14981
|
-
const handleClickChevron = (0,
|
|
14914
|
+
const { expandable } = (0, import_react62.useContext)(ListView.RowContext);
|
|
14915
|
+
const handleClickChevron = (0, import_react62.useCallback)(
|
|
14982
14916
|
(event) => {
|
|
14983
14917
|
event.stopPropagation();
|
|
14984
14918
|
onClickChevron?.({ altKey: event.altKey });
|
|
14985
14919
|
},
|
|
14986
14920
|
[onClickChevron]
|
|
14987
14921
|
);
|
|
14988
|
-
return /* @__PURE__ */
|
|
14922
|
+
return /* @__PURE__ */ import_react62.default.createElement(ListView.Row, { ref: forwardedRef, ...rest }, expandable && /* @__PURE__ */ import_react62.default.createElement(import_react62.default.Fragment, null, expanded === void 0 ? /* @__PURE__ */ import_react62.default.createElement(Spacer.Horizontal, { size: 19 }) : /* @__PURE__ */ import_react62.default.createElement(
|
|
14989
14923
|
IconButton,
|
|
14990
14924
|
{
|
|
14991
14925
|
iconName: expanded ? "ChevronDownIcon2" : "ChevronRightIcon2",
|
|
14992
14926
|
onClick: handleClickChevron,
|
|
14993
14927
|
selected: rest.selected
|
|
14994
14928
|
}
|
|
14995
|
-
), /* @__PURE__ */
|
|
14929
|
+
), /* @__PURE__ */ import_react62.default.createElement(Spacer.Horizontal, { size: 6 })), icon && /* @__PURE__ */ import_react62.default.createElement(import_react62.default.Fragment, null, renderIcon(icon), /* @__PURE__ */ import_react62.default.createElement(Spacer.Horizontal, { size: 10 })), children2);
|
|
14996
14930
|
});
|
|
14997
14931
|
var TreeView;
|
|
14998
14932
|
((TreeView2) => {
|
|
14999
14933
|
TreeView2.Root = ListView.Root;
|
|
15000
14934
|
TreeView2.RowTitle = ListView.RowTitle;
|
|
15001
14935
|
TreeView2.EditableRowTitle = ListView.EditableRowTitle;
|
|
15002
|
-
TreeView2.Row = (0,
|
|
14936
|
+
TreeView2.Row = (0, import_react62.memo)(TreeRow);
|
|
15003
14937
|
})(TreeView || (TreeView = {}));
|
|
15004
14938
|
|
|
15005
14939
|
// src/components/WorkspaceLayout.tsx
|
|
15006
14940
|
var import_noya_keymap5 = require("@noya-app/noya-keymap");
|
|
15007
|
-
var
|
|
14941
|
+
var import_react65 = __toESM(require("react"));
|
|
15008
14942
|
var import_react_resizable_panels = require("react-resizable-panels");
|
|
15009
14943
|
|
|
15010
14944
|
// src/hooks/usePreservePanelSize.tsx
|
|
15011
|
-
var
|
|
14945
|
+
var import_react64 = require("react");
|
|
15012
14946
|
|
|
15013
14947
|
// src/hooks/useWindowSize.tsx
|
|
15014
|
-
var
|
|
14948
|
+
var import_react63 = require("react");
|
|
15015
14949
|
function useWindowSize() {
|
|
15016
|
-
const [size3, setSize] = (0,
|
|
14950
|
+
const [size3, setSize] = (0, import_react63.useState)(
|
|
15017
14951
|
typeof window === "undefined" ? { width: 0, height: 0 } : {
|
|
15018
14952
|
width: window.innerWidth,
|
|
15019
14953
|
height: window.innerHeight
|
|
15020
14954
|
}
|
|
15021
14955
|
);
|
|
15022
|
-
(0,
|
|
14956
|
+
(0, import_react63.useEffect)(() => {
|
|
15023
14957
|
const handleResize = () => setSize({
|
|
15024
14958
|
width: window.innerWidth,
|
|
15025
14959
|
height: window.innerHeight
|
|
@@ -15037,8 +14971,8 @@ var RIGHT_SIDEBAR_ID = "editor-right-sidebar";
|
|
|
15037
14971
|
var CONTENT_AREA_ID = "editor-content-area";
|
|
15038
14972
|
function usePreservePanelSize(panelGroupRef, setPanelLayoutState) {
|
|
15039
14973
|
const windowSize = useWindowSize();
|
|
15040
|
-
const layoutRef = (0,
|
|
15041
|
-
(0,
|
|
14974
|
+
const layoutRef = (0, import_react64.useRef)();
|
|
14975
|
+
(0, import_react64.useLayoutEffect)(() => {
|
|
15042
14976
|
const panelGroup = document.querySelector(
|
|
15043
14977
|
`[data-panel-group-id="${EDITOR_PANEL_GROUP_ID}"]`
|
|
15044
14978
|
);
|
|
@@ -15081,7 +15015,7 @@ function usePreservePanelSize(panelGroupRef, setPanelLayoutState) {
|
|
|
15081
15015
|
panelGroupObserver.disconnect();
|
|
15082
15016
|
};
|
|
15083
15017
|
}, [panelGroupRef, setPanelLayoutState]);
|
|
15084
|
-
(0,
|
|
15018
|
+
(0, import_react64.useLayoutEffect)(() => {
|
|
15085
15019
|
if (!layoutRef.current)
|
|
15086
15020
|
return;
|
|
15087
15021
|
const {
|
|
@@ -15141,7 +15075,7 @@ function usePreservePanelSize(panelGroupRef, setPanelLayoutState) {
|
|
|
15141
15075
|
}
|
|
15142
15076
|
|
|
15143
15077
|
// src/components/WorkspaceLayout.tsx
|
|
15144
|
-
var WorkspaceLayoutWithTheme = (0,
|
|
15078
|
+
var WorkspaceLayoutWithTheme = (0, import_react65.forwardRef)(function WorkspaceLayoutWithTheme2({
|
|
15145
15079
|
autoSavePrefix,
|
|
15146
15080
|
leftSidebarContent: leftPanelContent,
|
|
15147
15081
|
children: centerPanelContent,
|
|
@@ -15166,12 +15100,20 @@ var WorkspaceLayoutWithTheme = (0, import_react66.forwardRef)(function Workspace
|
|
|
15166
15100
|
const rightSidebarPercentage = getPercentage(rightSidebarInitialSize);
|
|
15167
15101
|
const leftSidebarMinPercentage = leftSidebarMinSize !== void 0 ? getPercentage(leftSidebarMinSize) : void 0;
|
|
15168
15102
|
const rightSidebarMinPercentage = rightSidebarMinSize !== void 0 ? getPercentage(rightSidebarMinSize) : void 0;
|
|
15169
|
-
const panelGroupRef = (0,
|
|
15170
|
-
const leftSidebarRef = (0,
|
|
15171
|
-
const rightSidebarRef = (0,
|
|
15172
|
-
|
|
15103
|
+
const panelGroupRef = (0, import_react65.useRef)(null);
|
|
15104
|
+
const leftSidebarRef = (0, import_react65.useRef)(null);
|
|
15105
|
+
const rightSidebarRef = (0, import_react65.useRef)(null);
|
|
15106
|
+
const [internalLayoutState, setInternalLayoutState] = (0, import_react65.useState)(null);
|
|
15107
|
+
const handleChangeLayoutState = (0, import_react65.useCallback)(
|
|
15108
|
+
(state) => {
|
|
15109
|
+
setInternalLayoutState(state);
|
|
15110
|
+
onChangeLayoutState?.(state);
|
|
15111
|
+
},
|
|
15112
|
+
[onChangeLayoutState]
|
|
15113
|
+
);
|
|
15114
|
+
usePreservePanelSize(panelGroupRef, handleChangeLayoutState);
|
|
15173
15115
|
const theme = useDesignSystemTheme();
|
|
15174
|
-
(0,
|
|
15116
|
+
(0, import_react65.useImperativeHandle)(forwardedRef, () => ({
|
|
15175
15117
|
setLeftSidebarExpanded: (expanded) => {
|
|
15176
15118
|
if (expanded) {
|
|
15177
15119
|
leftSidebarRef.current?.expand();
|
|
@@ -15228,7 +15170,7 @@ var WorkspaceLayoutWithTheme = (0, import_react66.forwardRef)(function Workspace
|
|
|
15228
15170
|
}
|
|
15229
15171
|
});
|
|
15230
15172
|
const centerPanelPercentage = 100 - (leftPanelContent ? leftSidebarPercentage : 0) - (rightPanelContent ? rightSidebarPercentage : 0);
|
|
15231
|
-
return /* @__PURE__ */
|
|
15173
|
+
return /* @__PURE__ */ import_react65.default.createElement(
|
|
15232
15174
|
"div",
|
|
15233
15175
|
{
|
|
15234
15176
|
id,
|
|
@@ -15240,7 +15182,7 @@ var WorkspaceLayoutWithTheme = (0, import_react66.forwardRef)(function Workspace
|
|
|
15240
15182
|
...style5
|
|
15241
15183
|
}
|
|
15242
15184
|
},
|
|
15243
|
-
/* @__PURE__ */
|
|
15185
|
+
/* @__PURE__ */ import_react65.default.createElement(
|
|
15244
15186
|
import_react_resizable_panels.PanelGroup,
|
|
15245
15187
|
{
|
|
15246
15188
|
ref: panelGroupRef,
|
|
@@ -15249,7 +15191,7 @@ var WorkspaceLayoutWithTheme = (0, import_react66.forwardRef)(function Workspace
|
|
|
15249
15191
|
autoSaveId: autoSavePrefix ? `${autoSavePrefix}--${EDITOR_PANEL_GROUP_ID}` : void 0,
|
|
15250
15192
|
style: { flex: "1" }
|
|
15251
15193
|
},
|
|
15252
|
-
hasLeftSidebar && /* @__PURE__ */
|
|
15194
|
+
hasLeftSidebar && /* @__PURE__ */ import_react65.default.createElement(import_react65.default.Fragment, null, /* @__PURE__ */ import_react65.default.createElement(
|
|
15253
15195
|
import_react_resizable_panels.Panel,
|
|
15254
15196
|
{
|
|
15255
15197
|
id: LEFT_SIDEBAR_ID,
|
|
@@ -15265,8 +15207,8 @@ var WorkspaceLayoutWithTheme = (0, import_react66.forwardRef)(function Workspace
|
|
|
15265
15207
|
position: "relative"
|
|
15266
15208
|
}
|
|
15267
15209
|
},
|
|
15268
|
-
leftPanelContent
|
|
15269
|
-
), /* @__PURE__ */
|
|
15210
|
+
internalLayoutState?.leftSidebarCollapsed ? null : leftPanelContent
|
|
15211
|
+
), /* @__PURE__ */ import_react65.default.createElement(
|
|
15270
15212
|
import_react_resizable_panels.PanelResizeHandle,
|
|
15271
15213
|
{
|
|
15272
15214
|
style: {
|
|
@@ -15277,7 +15219,7 @@ var WorkspaceLayoutWithTheme = (0, import_react66.forwardRef)(function Workspace
|
|
|
15277
15219
|
}
|
|
15278
15220
|
}
|
|
15279
15221
|
)),
|
|
15280
|
-
/* @__PURE__ */
|
|
15222
|
+
/* @__PURE__ */ import_react65.default.createElement(
|
|
15281
15223
|
import_react_resizable_panels.Panel,
|
|
15282
15224
|
{
|
|
15283
15225
|
id: CONTENT_AREA_ID,
|
|
@@ -15292,7 +15234,7 @@ var WorkspaceLayoutWithTheme = (0, import_react66.forwardRef)(function Workspace
|
|
|
15292
15234
|
},
|
|
15293
15235
|
centerPanelContent
|
|
15294
15236
|
),
|
|
15295
|
-
hasRightSidebar && /* @__PURE__ */
|
|
15237
|
+
hasRightSidebar && /* @__PURE__ */ import_react65.default.createElement(import_react65.default.Fragment, null, /* @__PURE__ */ import_react65.default.createElement(
|
|
15296
15238
|
import_react_resizable_panels.PanelResizeHandle,
|
|
15297
15239
|
{
|
|
15298
15240
|
style: {
|
|
@@ -15302,7 +15244,7 @@ var WorkspaceLayoutWithTheme = (0, import_react66.forwardRef)(function Workspace
|
|
|
15302
15244
|
backgroundColor: theme.colors.divider
|
|
15303
15245
|
}
|
|
15304
15246
|
}
|
|
15305
|
-
), /* @__PURE__ */
|
|
15247
|
+
), /* @__PURE__ */ import_react65.default.createElement(
|
|
15306
15248
|
import_react_resizable_panels.Panel,
|
|
15307
15249
|
{
|
|
15308
15250
|
id: RIGHT_SIDEBAR_ID,
|
|
@@ -15317,13 +15259,13 @@ var WorkspaceLayoutWithTheme = (0, import_react66.forwardRef)(function Workspace
|
|
|
15317
15259
|
position: "relative"
|
|
15318
15260
|
}
|
|
15319
15261
|
},
|
|
15320
|
-
rightPanelContent
|
|
15262
|
+
internalLayoutState?.rightSidebarCollapsed ? null : rightPanelContent
|
|
15321
15263
|
))
|
|
15322
15264
|
)
|
|
15323
15265
|
);
|
|
15324
15266
|
});
|
|
15325
|
-
var WorkspaceLayout = (0,
|
|
15326
|
-
return /* @__PURE__ */
|
|
15267
|
+
var WorkspaceLayout = (0, import_react65.forwardRef)(function WorkspaceLayout2(props, forwardedRef) {
|
|
15268
|
+
return /* @__PURE__ */ import_react65.default.createElement(DesignSystemThemeProvider, null, /* @__PURE__ */ import_react65.default.createElement(WorkspaceLayoutWithTheme, { ...props, ref: forwardedRef }));
|
|
15327
15269
|
});
|
|
15328
15270
|
|
|
15329
15271
|
// src/hooks/usePlatform.ts
|
|
@@ -15366,10 +15308,41 @@ var SUPPORTED_CANVAS_UPLOAD_TYPES = [
|
|
|
15366
15308
|
""
|
|
15367
15309
|
];
|
|
15368
15310
|
|
|
15369
|
-
// src/components/
|
|
15370
|
-
var
|
|
15371
|
-
var
|
|
15372
|
-
|
|
15311
|
+
// src/components/DimensionInput.tsx
|
|
15312
|
+
var import_noya_utils10 = require("@noya-app/noya-utils");
|
|
15313
|
+
var import_react66 = __toESM(require("react"));
|
|
15314
|
+
function getNewValue(value, mode, delta) {
|
|
15315
|
+
return delta === void 0 ? value : mode === "replace" ? delta : value + delta;
|
|
15316
|
+
}
|
|
15317
|
+
var DimensionInput = (0, import_react66.memo)(function DimensionInput2({
|
|
15318
|
+
id,
|
|
15319
|
+
value,
|
|
15320
|
+
onSetValue,
|
|
15321
|
+
label,
|
|
15322
|
+
size: size3,
|
|
15323
|
+
placeholder = "multi",
|
|
15324
|
+
disabled,
|
|
15325
|
+
trigger = "submit"
|
|
15326
|
+
}) {
|
|
15327
|
+
const handleNudgeValue = (0, import_react66.useCallback)(
|
|
15328
|
+
(value2) => onSetValue(value2, "adjust"),
|
|
15329
|
+
[onSetValue]
|
|
15330
|
+
);
|
|
15331
|
+
const handleSetValue = (0, import_react66.useCallback)(
|
|
15332
|
+
(value2) => onSetValue(value2, "replace"),
|
|
15333
|
+
[onSetValue]
|
|
15334
|
+
);
|
|
15335
|
+
return /* @__PURE__ */ import_react66.default.createElement(InputField.Root, { id, width: size3 }, /* @__PURE__ */ import_react66.default.createElement(
|
|
15336
|
+
InputField.NumberInput,
|
|
15337
|
+
{
|
|
15338
|
+
value: value === void 0 ? value : (0, import_noya_utils10.round)(value, 2),
|
|
15339
|
+
placeholder: value === void 0 ? placeholder : void 0,
|
|
15340
|
+
onNudge: handleNudgeValue,
|
|
15341
|
+
disabled,
|
|
15342
|
+
...trigger === "change" ? { onChange: handleSetValue } : { onSubmit: handleSetValue }
|
|
15343
|
+
}
|
|
15344
|
+
), label && /* @__PURE__ */ import_react66.default.createElement(InputField.Label, null, label));
|
|
15345
|
+
});
|
|
15373
15346
|
|
|
15374
15347
|
// src/components/InspectorPrimitives.tsx
|
|
15375
15348
|
var InspectorPrimitives_exports = {};
|
|
@@ -15388,19 +15361,19 @@ __export(InspectorPrimitives_exports, {
|
|
|
15388
15361
|
VerticalSeparator: () => VerticalSeparator
|
|
15389
15362
|
});
|
|
15390
15363
|
var import_react67 = __toESM(require("react"));
|
|
15391
|
-
var
|
|
15392
|
-
var Section2 =
|
|
15364
|
+
var import_styled_components36 = __toESM(require("styled-components"));
|
|
15365
|
+
var Section2 = import_styled_components36.default.div(({ theme, $padding = "10px", $gap }) => ({
|
|
15393
15366
|
flex: "0 0 auto",
|
|
15394
15367
|
display: "flex",
|
|
15395
15368
|
flexDirection: "column",
|
|
15396
15369
|
padding: $padding,
|
|
15397
15370
|
gap: $gap
|
|
15398
15371
|
}));
|
|
15399
|
-
var SectionHeader =
|
|
15372
|
+
var SectionHeader = import_styled_components36.default.div(({ theme }) => ({
|
|
15400
15373
|
display: "flex",
|
|
15401
15374
|
alignItems: "center"
|
|
15402
15375
|
}));
|
|
15403
|
-
var Title3 =
|
|
15376
|
+
var Title3 = import_styled_components36.default.div(({ theme, $textStyle }) => ({
|
|
15404
15377
|
display: "flex",
|
|
15405
15378
|
flexDirection: "row",
|
|
15406
15379
|
userSelect: "none",
|
|
@@ -15413,7 +15386,7 @@ var Title3 = import_styled_components37.default.div(({ theme, $textStyle }) => (
|
|
|
15413
15386
|
fontWeight: "bold"
|
|
15414
15387
|
}
|
|
15415
15388
|
}));
|
|
15416
|
-
var Row2 =
|
|
15389
|
+
var Row2 = import_styled_components36.default.div(
|
|
15417
15390
|
({ theme, $gap }) => ({
|
|
15418
15391
|
flex: "1",
|
|
15419
15392
|
display: "flex",
|
|
@@ -15422,26 +15395,26 @@ var Row2 = import_styled_components37.default.div(
|
|
|
15422
15395
|
gap: $gap
|
|
15423
15396
|
})
|
|
15424
15397
|
);
|
|
15425
|
-
var Column2 =
|
|
15398
|
+
var Column2 = import_styled_components36.default.div(({ theme }) => ({
|
|
15426
15399
|
flex: "1",
|
|
15427
15400
|
display: "flex",
|
|
15428
15401
|
flexDirection: "column",
|
|
15429
15402
|
gap: "4px"
|
|
15430
15403
|
}));
|
|
15431
|
-
var Checkbox =
|
|
15404
|
+
var Checkbox = import_styled_components36.default.input(({ theme }) => ({
|
|
15432
15405
|
margin: 0
|
|
15433
15406
|
}));
|
|
15434
|
-
var Text3 =
|
|
15407
|
+
var Text3 = import_styled_components36.default.span(({ theme }) => ({
|
|
15435
15408
|
...theme.textStyles.small
|
|
15436
15409
|
}));
|
|
15437
|
-
var VerticalSeparator = () => /* @__PURE__ */ import_react67.default.createElement(Spacer.Vertical, { size: (0,
|
|
15438
|
-
var HorizontalSeparator = () => /* @__PURE__ */ import_react67.default.createElement(Spacer.Horizontal, { size: (0,
|
|
15439
|
-
var SliderRowLabel =
|
|
15410
|
+
var VerticalSeparator = () => /* @__PURE__ */ import_react67.default.createElement(Spacer.Vertical, { size: (0, import_styled_components36.useTheme)().sizes.inspector.verticalSeparator });
|
|
15411
|
+
var HorizontalSeparator = () => /* @__PURE__ */ import_react67.default.createElement(Spacer.Horizontal, { size: (0, import_styled_components36.useTheme)().sizes.inspector.horizontalSeparator });
|
|
15412
|
+
var SliderRowLabel = import_styled_components36.default.span(({ theme }) => ({
|
|
15440
15413
|
...theme.textStyles.small,
|
|
15441
15414
|
color: theme.colors.textMuted,
|
|
15442
15415
|
marginBottom: "-6px"
|
|
15443
15416
|
}));
|
|
15444
|
-
var RowLabel =
|
|
15417
|
+
var RowLabel = import_styled_components36.default.span(({ theme, $textStyle }) => ({
|
|
15445
15418
|
// marginBottom: '6px',
|
|
15446
15419
|
display: "flex",
|
|
15447
15420
|
...$textStyle ? {
|
|
@@ -15471,154 +15444,16 @@ var LabeledSliderRow = (0, import_react67.memo)(function LabeledRow3({
|
|
|
15471
15444
|
}) {
|
|
15472
15445
|
return /* @__PURE__ */ import_react67.default.createElement(Row2, null, /* @__PURE__ */ import_react67.default.createElement(Column2, null, /* @__PURE__ */ import_react67.default.createElement(SliderRowLabel, null, label), /* @__PURE__ */ import_react67.default.createElement(Row2, null, children2)));
|
|
15473
15446
|
});
|
|
15474
|
-
|
|
15475
|
-
// src/components/ArrayController.tsx
|
|
15476
|
-
var ElementRow = import_styled_components38.default.div({
|
|
15477
|
-
flex: "0 0 auto",
|
|
15478
|
-
display: "flex",
|
|
15479
|
-
flexDirection: "row",
|
|
15480
|
-
alignItems: "center"
|
|
15481
|
-
});
|
|
15482
|
-
var ItemContainer2 = import_styled_components38.default.div({
|
|
15483
|
-
position: "relative"
|
|
15484
|
-
});
|
|
15485
|
-
var ArrayController = (0, import_react68.memo)(function ArrayController2({
|
|
15486
|
-
id,
|
|
15487
|
-
items,
|
|
15488
|
-
title,
|
|
15489
|
-
sortable = false,
|
|
15490
|
-
reversed = true,
|
|
15491
|
-
expanded = false,
|
|
15492
|
-
getKey,
|
|
15493
|
-
onMoveItem,
|
|
15494
|
-
onClickPlus,
|
|
15495
|
-
onClickTrash,
|
|
15496
|
-
onClickExpand,
|
|
15497
|
-
renderItem,
|
|
15498
|
-
renderExpandedContent,
|
|
15499
|
-
padding = 10
|
|
15500
|
-
}) {
|
|
15501
|
-
const iconColor = (0, import_styled_components38.useTheme)().colors.icon;
|
|
15502
|
-
const primaryLightColor = (0, import_styled_components38.useTheme)().colors.primaryLight;
|
|
15503
|
-
const keys = (0, import_react68.useMemo)(
|
|
15504
|
-
() => items.map((item, index) => getKey?.(item) ?? index.toString()),
|
|
15505
|
-
[getKey, items]
|
|
15506
|
-
);
|
|
15507
|
-
const indexes = reversed ? (0, import_noya_utils11.range)(0, items.length).reverse() : (0, import_noya_utils11.range)(0, items.length);
|
|
15508
|
-
const handleMoveItem = (0, import_react68.useCallback)(
|
|
15509
|
-
(sourceIndex, destinationIndex, position) => {
|
|
15510
|
-
if (reversed) {
|
|
15511
|
-
if (position === "above") {
|
|
15512
|
-
position = "below";
|
|
15513
|
-
} else if (position === "below") {
|
|
15514
|
-
position = "above";
|
|
15515
|
-
}
|
|
15516
|
-
}
|
|
15517
|
-
onMoveItem?.(
|
|
15518
|
-
sourceIndex,
|
|
15519
|
-
position === "below" ? destinationIndex + 1 : destinationIndex
|
|
15520
|
-
);
|
|
15521
|
-
},
|
|
15522
|
-
[onMoveItem, reversed]
|
|
15523
|
-
);
|
|
15524
|
-
const renderRow = (index) => {
|
|
15525
|
-
return /* @__PURE__ */ import_react68.default.createElement(ElementRow, { key: keys[index] }, renderItem({ item: items[index], index }));
|
|
15526
|
-
};
|
|
15527
|
-
return /* @__PURE__ */ import_react68.default.createElement(Section2, { id, $padding: padding, $gap: "2px" }, /* @__PURE__ */ import_react68.default.createElement(SectionHeader, null, /* @__PURE__ */ import_react68.default.createElement(Button, { variant: "none", onClick: onClickPlus }, /* @__PURE__ */ import_react68.default.createElement(Title3, null, title)), /* @__PURE__ */ import_react68.default.createElement(Spacer.Horizontal, null), withSeparatorElements(
|
|
15528
|
-
[
|
|
15529
|
-
onClickTrash && /* @__PURE__ */ import_react68.default.createElement(
|
|
15530
|
-
IconButton,
|
|
15531
|
-
{
|
|
15532
|
-
id: `${id}-trash`,
|
|
15533
|
-
iconName: "TrashIcon",
|
|
15534
|
-
color: iconColor,
|
|
15535
|
-
onClick: onClickTrash
|
|
15536
|
-
}
|
|
15537
|
-
),
|
|
15538
|
-
onClickExpand && /* @__PURE__ */ import_react68.default.createElement(
|
|
15539
|
-
IconButton,
|
|
15540
|
-
{
|
|
15541
|
-
id: `${id}-gear`,
|
|
15542
|
-
iconName: "GearIcon",
|
|
15543
|
-
color: expanded ? primaryLightColor : iconColor,
|
|
15544
|
-
onClick: onClickExpand
|
|
15545
|
-
}
|
|
15546
|
-
),
|
|
15547
|
-
onClickPlus && /* @__PURE__ */ import_react68.default.createElement(
|
|
15548
|
-
IconButton,
|
|
15549
|
-
{
|
|
15550
|
-
id: `${id}-add`,
|
|
15551
|
-
iconName: "PlusIcon",
|
|
15552
|
-
color: iconColor,
|
|
15553
|
-
onClick: onClickPlus
|
|
15554
|
-
}
|
|
15555
|
-
)
|
|
15556
|
-
],
|
|
15557
|
-
/* @__PURE__ */ import_react68.default.createElement(Spacer.Horizontal, { size: 8 })
|
|
15558
|
-
)), /* @__PURE__ */ import_react68.default.createElement(Stack.V, { gap: "4px" }, sortable ? /* @__PURE__ */ import_react68.default.createElement(
|
|
15559
|
-
Sortable.Root,
|
|
15560
|
-
{
|
|
15561
|
-
keys,
|
|
15562
|
-
renderOverlay: renderRow,
|
|
15563
|
-
onMoveItem: handleMoveItem
|
|
15564
|
-
},
|
|
15565
|
-
indexes.map((index) => /* @__PURE__ */ import_react68.default.createElement(Sortable.Item, { id: keys[index], key: keys[index] }, ({ relativeDropPosition, ...sortableProps }) => /* @__PURE__ */ import_react68.default.createElement(ItemContainer2, { ...sortableProps }, renderRow(index), relativeDropPosition && /* @__PURE__ */ import_react68.default.createElement(
|
|
15566
|
-
ListView.DragIndicator,
|
|
15567
|
-
{
|
|
15568
|
-
$gap: 0,
|
|
15569
|
-
$colorScheme: "primary",
|
|
15570
|
-
$relativeDropPosition: relativeDropPosition,
|
|
15571
|
-
$offsetLeft: 0
|
|
15572
|
-
}
|
|
15573
|
-
))))
|
|
15574
|
-
) : indexes.map(renderRow)), expanded && renderExpandedContent?.());
|
|
15575
|
-
});
|
|
15576
|
-
|
|
15577
|
-
// src/components/DimensionInput.tsx
|
|
15578
|
-
var import_noya_utils12 = require("@noya-app/noya-utils");
|
|
15579
|
-
var import_react69 = __toESM(require("react"));
|
|
15580
|
-
function getNewValue(value, mode, delta) {
|
|
15581
|
-
return delta === void 0 ? value : mode === "replace" ? delta : value + delta;
|
|
15582
|
-
}
|
|
15583
|
-
var DimensionInput = (0, import_react69.memo)(function DimensionInput2({
|
|
15584
|
-
id,
|
|
15585
|
-
value,
|
|
15586
|
-
onSetValue,
|
|
15587
|
-
label,
|
|
15588
|
-
size: size3,
|
|
15589
|
-
placeholder = "multi",
|
|
15590
|
-
disabled,
|
|
15591
|
-
trigger = "submit"
|
|
15592
|
-
}) {
|
|
15593
|
-
const handleNudgeValue = (0, import_react69.useCallback)(
|
|
15594
|
-
(value2) => onSetValue(value2, "adjust"),
|
|
15595
|
-
[onSetValue]
|
|
15596
|
-
);
|
|
15597
|
-
const handleSetValue = (0, import_react69.useCallback)(
|
|
15598
|
-
(value2) => onSetValue(value2, "replace"),
|
|
15599
|
-
[onSetValue]
|
|
15600
|
-
);
|
|
15601
|
-
return /* @__PURE__ */ import_react69.default.createElement(InputField.Root, { id, width: size3 }, /* @__PURE__ */ import_react69.default.createElement(
|
|
15602
|
-
InputField.NumberInput,
|
|
15603
|
-
{
|
|
15604
|
-
value: value === void 0 ? value : (0, import_noya_utils12.round)(value, 2),
|
|
15605
|
-
placeholder: value === void 0 ? placeholder : void 0,
|
|
15606
|
-
onNudge: handleNudgeValue,
|
|
15607
|
-
disabled,
|
|
15608
|
-
...trigger === "change" ? { onChange: handleSetValue } : { onSubmit: handleSetValue }
|
|
15609
|
-
}
|
|
15610
|
-
), label && /* @__PURE__ */ import_react69.default.createElement(InputField.Label, null, label));
|
|
15611
|
-
});
|
|
15612
15447
|
// Annotate the CommonJS export names for ESM import in node:
|
|
15613
15448
|
0 && (module.exports = {
|
|
15614
15449
|
ActivityIndicator,
|
|
15615
|
-
ArrayController,
|
|
15616
15450
|
AutoResizingTextArea,
|
|
15617
15451
|
Avatar,
|
|
15618
15452
|
AvatarStack,
|
|
15619
15453
|
Body,
|
|
15620
15454
|
Button,
|
|
15621
15455
|
ButtonElement,
|
|
15456
|
+
CONTENT_AREA_ID,
|
|
15622
15457
|
Chip,
|
|
15623
15458
|
CloseButtonContainer,
|
|
15624
15459
|
CompletionMenu,
|
|
@@ -15633,6 +15468,7 @@ var DimensionInput = (0, import_react69.memo)(function DimensionInput2({
|
|
|
15633
15468
|
DividerVertical,
|
|
15634
15469
|
DraggableMenuButton,
|
|
15635
15470
|
DropdownMenu,
|
|
15471
|
+
EDITOR_PANEL_GROUP_ID,
|
|
15636
15472
|
FillInputField,
|
|
15637
15473
|
FillPreviewBackground,
|
|
15638
15474
|
FloatingWindow,
|
|
@@ -15656,21 +15492,21 @@ var DimensionInput = (0, import_react69.memo)(function DimensionInput2({
|
|
|
15656
15492
|
InspectorPrimitives,
|
|
15657
15493
|
Italic,
|
|
15658
15494
|
KeyboardShortcut,
|
|
15495
|
+
LEFT_SIDEBAR_ID,
|
|
15659
15496
|
Label,
|
|
15660
15497
|
LabeledElementView,
|
|
15661
15498
|
ListView,
|
|
15662
15499
|
PatternPreviewBackground,
|
|
15663
15500
|
Popover,
|
|
15664
15501
|
Progress,
|
|
15502
|
+
RIGHT_SIDEBAR_ID,
|
|
15665
15503
|
RadioGroup,
|
|
15666
15504
|
Row,
|
|
15667
15505
|
SEPARATOR_ITEM,
|
|
15668
15506
|
SUPPORTED_CANVAS_UPLOAD_TYPES,
|
|
15669
15507
|
SUPPORTED_IMAGE_UPLOAD_TYPES,
|
|
15670
15508
|
ScrollArea,
|
|
15671
|
-
Select,
|
|
15672
15509
|
SelectMenu,
|
|
15673
|
-
SelectOption,
|
|
15674
15510
|
Slider,
|
|
15675
15511
|
Small,
|
|
15676
15512
|
Sortable,
|
|
@@ -15713,6 +15549,7 @@ var DimensionInput = (0, import_react69.memo)(function DimensionInput2({
|
|
|
15713
15549
|
useOpenInputDialog,
|
|
15714
15550
|
usePlatform,
|
|
15715
15551
|
usePlatformModKey,
|
|
15552
|
+
usePreservePanelSize,
|
|
15716
15553
|
withSeparatorElements
|
|
15717
15554
|
});
|
|
15718
15555
|
/*! Bundled license information:
|