@noya-app/noya-designsystem 0.1.36 → 0.1.37
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 +8 -8
- package/CHANGELOG.md +6 -0
- package/dist/index.css +1 -1
- package/dist/index.d.mts +15 -10
- package/dist/index.d.ts +15 -10
- package/dist/index.js +843 -738
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +620 -507
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/components/Checkbox.tsx +76 -0
- package/src/components/Label.tsx +16 -29
- package/src/components/SelectMenu.tsx +39 -33
- package/src/components/Switch.tsx +5 -2
- package/src/index.tsx +1 -0
- package/src/utils/withSeparatorElements.ts +29 -3
- package/tailwind.config.ts +3 -2
- package/tsconfig.json +1 -1
package/dist/index.js
CHANGED
|
@@ -475,7 +475,7 @@ var require_react_is_development = __commonJS({
|
|
|
475
475
|
var ContextProvider = REACT_PROVIDER_TYPE;
|
|
476
476
|
var Element2 = REACT_ELEMENT_TYPE;
|
|
477
477
|
var ForwardRef = REACT_FORWARD_REF_TYPE;
|
|
478
|
-
var
|
|
478
|
+
var Fragment3 = REACT_FRAGMENT_TYPE;
|
|
479
479
|
var Lazy = REACT_LAZY_TYPE;
|
|
480
480
|
var Memo = REACT_MEMO_TYPE;
|
|
481
481
|
var Portal6 = REACT_PORTAL_TYPE;
|
|
@@ -534,7 +534,7 @@ var require_react_is_development = __commonJS({
|
|
|
534
534
|
exports2.ContextProvider = ContextProvider;
|
|
535
535
|
exports2.Element = Element2;
|
|
536
536
|
exports2.ForwardRef = ForwardRef;
|
|
537
|
-
exports2.Fragment =
|
|
537
|
+
exports2.Fragment = Fragment3;
|
|
538
538
|
exports2.Lazy = Lazy;
|
|
539
539
|
exports2.Memo = Memo;
|
|
540
540
|
exports2.Portal = Portal6;
|
|
@@ -1396,6 +1396,7 @@ __export(src_exports, {
|
|
|
1396
1396
|
Body: () => Body,
|
|
1397
1397
|
Button: () => Button,
|
|
1398
1398
|
CONTENT_AREA_ID: () => CONTENT_AREA_ID,
|
|
1399
|
+
Checkbox: () => Checkbox,
|
|
1399
1400
|
Chip: () => Chip,
|
|
1400
1401
|
CompletionMenu: () => CompletionMenu,
|
|
1401
1402
|
ContextMenu: () => ContextMenu,
|
|
@@ -4219,12 +4220,88 @@ var Button = (0, import_react5.forwardRef)(function Button2({
|
|
|
4219
4220
|
return tooltip ? /* @__PURE__ */ import_react5.default.createElement(Tooltip, { content: tooltip }, buttonElement) : buttonElement;
|
|
4220
4221
|
});
|
|
4221
4222
|
|
|
4223
|
+
// src/components/Checkbox.tsx
|
|
4224
|
+
var import_react6 = __toESM(require("react"));
|
|
4225
|
+
var colorSchemeStyles = {
|
|
4226
|
+
normal: "text-text-subtle",
|
|
4227
|
+
primary: "text-primary",
|
|
4228
|
+
secondary: "text-secondary"
|
|
4229
|
+
};
|
|
4230
|
+
var Checkbox = (0, import_react6.memo)(
|
|
4231
|
+
(0, import_react6.forwardRef)(function Checkbox2({ className, colorScheme = "secondary", ...props }, ref) {
|
|
4232
|
+
return /* @__PURE__ */ import_react6.default.createElement(
|
|
4233
|
+
"div",
|
|
4234
|
+
{
|
|
4235
|
+
className: `relative inline-flex w-[19px] h-[19px] ${colorSchemeStyles[colorScheme]} ${className ?? ""}`
|
|
4236
|
+
},
|
|
4237
|
+
/* @__PURE__ */ import_react6.default.createElement(
|
|
4238
|
+
"input",
|
|
4239
|
+
{
|
|
4240
|
+
ref,
|
|
4241
|
+
type: "checkbox",
|
|
4242
|
+
className: `
|
|
4243
|
+
w-full
|
|
4244
|
+
h-full
|
|
4245
|
+
peer
|
|
4246
|
+
appearance-none
|
|
4247
|
+
rounded
|
|
4248
|
+
bg-input-background
|
|
4249
|
+
transition-colors
|
|
4250
|
+
border
|
|
4251
|
+
border-input-border
|
|
4252
|
+
disabled:opacity-50
|
|
4253
|
+
disabled:cursor-not-allowed
|
|
4254
|
+
focus:ring-2
|
|
4255
|
+
focus:ring-primary
|
|
4256
|
+
focus:ring-offset-1
|
|
4257
|
+
`,
|
|
4258
|
+
style: {
|
|
4259
|
+
width: "27px",
|
|
4260
|
+
...props.style
|
|
4261
|
+
},
|
|
4262
|
+
...props
|
|
4263
|
+
}
|
|
4264
|
+
),
|
|
4265
|
+
/* @__PURE__ */ import_react6.default.createElement(
|
|
4266
|
+
"svg",
|
|
4267
|
+
{
|
|
4268
|
+
className: `
|
|
4269
|
+
absolute
|
|
4270
|
+
inset-0
|
|
4271
|
+
h-[27px]
|
|
4272
|
+
w-[27px]
|
|
4273
|
+
pointer-events-none
|
|
4274
|
+
stroke-white
|
|
4275
|
+
opacity-0
|
|
4276
|
+
peer-checked:opacity-100
|
|
4277
|
+
`,
|
|
4278
|
+
style: {
|
|
4279
|
+
strokeWidth: "1.3"
|
|
4280
|
+
},
|
|
4281
|
+
viewBox: "0 0 16 16",
|
|
4282
|
+
fill: "none",
|
|
4283
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
4284
|
+
},
|
|
4285
|
+
/* @__PURE__ */ import_react6.default.createElement(
|
|
4286
|
+
"path",
|
|
4287
|
+
{
|
|
4288
|
+
d: "M3 6L4.5 7.5L8 4",
|
|
4289
|
+
strokeLinecap: "round",
|
|
4290
|
+
strokeLinejoin: "round",
|
|
4291
|
+
stroke: "currentColor"
|
|
4292
|
+
}
|
|
4293
|
+
)
|
|
4294
|
+
)
|
|
4295
|
+
);
|
|
4296
|
+
})
|
|
4297
|
+
);
|
|
4298
|
+
|
|
4222
4299
|
// src/components/Chip.tsx
|
|
4223
4300
|
var import_noya_icons = require("@noya-app/noya-icons");
|
|
4224
|
-
var
|
|
4301
|
+
var import_react7 = __toESM(require("react"));
|
|
4225
4302
|
|
|
4226
4303
|
// src/hooks/useHover.ts
|
|
4227
|
-
var
|
|
4304
|
+
var React7 = __toESM(require("react"));
|
|
4228
4305
|
var globalIgnoreEmulatedMouseEvents = false;
|
|
4229
4306
|
var hoverCount = 0;
|
|
4230
4307
|
function setGlobalIgnoreEmulatedMouseEvents() {
|
|
@@ -4254,13 +4331,13 @@ function setupGlobalTouchEvents() {
|
|
|
4254
4331
|
}
|
|
4255
4332
|
function useHover(props = {}) {
|
|
4256
4333
|
const { onHoverStart, onHoverChange, onHoverEnd, isDisabled } = props;
|
|
4257
|
-
const [isHovered, setHovered] =
|
|
4258
|
-
const state =
|
|
4334
|
+
const [isHovered, setHovered] = React7.useState(false);
|
|
4335
|
+
const state = React7.useRef({
|
|
4259
4336
|
isHovered: false,
|
|
4260
4337
|
ignoreEmulatedMouseEvents: false
|
|
4261
4338
|
}).current;
|
|
4262
|
-
|
|
4263
|
-
const hoverProps =
|
|
4339
|
+
React7.useEffect(setupGlobalTouchEvents, []);
|
|
4340
|
+
const hoverProps = React7.useMemo(
|
|
4264
4341
|
function getHoverProps() {
|
|
4265
4342
|
function triggerHoverStart(event, pointerType) {
|
|
4266
4343
|
if (isDisabled || pointerType === "touch" || state.isHovered) {
|
|
@@ -4398,8 +4475,8 @@ function getIconStyles(size3, isAdd) {
|
|
|
4398
4475
|
scale-60
|
|
4399
4476
|
`;
|
|
4400
4477
|
}
|
|
4401
|
-
var Chip = (0,
|
|
4402
|
-
(0,
|
|
4478
|
+
var Chip = (0, import_react7.memo)(
|
|
4479
|
+
(0, import_react7.forwardRef)(function Chip2({
|
|
4403
4480
|
colorScheme,
|
|
4404
4481
|
children: children2,
|
|
4405
4482
|
deletable,
|
|
@@ -4422,7 +4499,7 @@ var Chip = (0, import_react6.memo)(
|
|
|
4422
4499
|
});
|
|
4423
4500
|
const handleClick = !children2 && !deletable && addable ? onAdd : onClick;
|
|
4424
4501
|
const color = colorScheme === "primary" ? "var(--primary)" : colorScheme === "secondary" ? "var(--secondary)" : "var(--text)";
|
|
4425
|
-
return /* @__PURE__ */
|
|
4502
|
+
return /* @__PURE__ */ import_react7.default.createElement(
|
|
4426
4503
|
"span",
|
|
4427
4504
|
{
|
|
4428
4505
|
ref: forwardedRef,
|
|
@@ -4441,7 +4518,7 @@ var Chip = (0, import_react6.memo)(
|
|
|
4441
4518
|
tabIndex,
|
|
4442
4519
|
...rest
|
|
4443
4520
|
},
|
|
4444
|
-
addable && /* @__PURE__ */
|
|
4521
|
+
addable && /* @__PURE__ */ import_react7.default.createElement(
|
|
4445
4522
|
import_noya_icons.PlusIcon,
|
|
4446
4523
|
{
|
|
4447
4524
|
className: getIconStyles(size3, true),
|
|
@@ -4453,7 +4530,7 @@ var Chip = (0, import_react6.memo)(
|
|
|
4453
4530
|
}
|
|
4454
4531
|
),
|
|
4455
4532
|
children2,
|
|
4456
|
-
deletable && /* @__PURE__ */
|
|
4533
|
+
deletable && /* @__PURE__ */ import_react7.default.createElement(
|
|
4457
4534
|
import_noya_icons.Cross1Icon,
|
|
4458
4535
|
{
|
|
4459
4536
|
className: getIconStyles(size3, false),
|
|
@@ -4473,31 +4550,31 @@ var Chip = (0, import_react6.memo)(
|
|
|
4473
4550
|
var import_noya_icons4 = require("@noya-app/noya-icons");
|
|
4474
4551
|
var import_noya_keymap4 = require("@noya-app/noya-keymap");
|
|
4475
4552
|
var RadixContextMenu = __toESM(require("@radix-ui/react-context-menu"));
|
|
4476
|
-
var
|
|
4553
|
+
var import_react39 = __toESM(require("react"));
|
|
4477
4554
|
|
|
4478
4555
|
// src/components/Icons.tsx
|
|
4479
4556
|
var Icons = __toESM(require("@noya-app/noya-icons"));
|
|
4480
|
-
var
|
|
4557
|
+
var import_react8 = __toESM(require("react"));
|
|
4481
4558
|
function renderIcon(iconName) {
|
|
4482
4559
|
if (typeof iconName === "string") {
|
|
4483
4560
|
const Icon = Icons[iconName];
|
|
4484
|
-
return /* @__PURE__ */
|
|
4561
|
+
return /* @__PURE__ */ import_react8.default.createElement(Icon, null);
|
|
4485
4562
|
}
|
|
4486
4563
|
return iconName;
|
|
4487
4564
|
}
|
|
4488
4565
|
|
|
4489
4566
|
// src/components/Spacer.tsx
|
|
4490
|
-
var
|
|
4491
|
-
var SpacerVertical = (0,
|
|
4567
|
+
var import_react9 = __toESM(require("react"));
|
|
4568
|
+
var SpacerVertical = (0, import_react9.forwardRef)(
|
|
4492
4569
|
({ size: size3, inline, ...props }, ref) => {
|
|
4493
|
-
return /* @__PURE__ */
|
|
4570
|
+
return /* @__PURE__ */ import_react9.default.createElement("span", { className: `${inline ? "inline-block" : "block"} ${size3 === void 0 ? "flex flex-1" : ""}`, style: size3 ? {
|
|
4494
4571
|
minHeight: `${size3}px`
|
|
4495
4572
|
} : void 0, ...props, ref });
|
|
4496
4573
|
}
|
|
4497
4574
|
);
|
|
4498
|
-
var SpacerHorizontal = (0,
|
|
4575
|
+
var SpacerHorizontal = (0, import_react9.forwardRef)(
|
|
4499
4576
|
({ size: size3, inline, ...props }, ref) => {
|
|
4500
|
-
return /* @__PURE__ */
|
|
4577
|
+
return /* @__PURE__ */ import_react9.default.createElement("span", { className: `${inline ? "inline-block" : "block"} ${size3 === void 0 ? "flex flex-1" : ""}`, style: size3 ? {
|
|
4501
4578
|
minWidth: `${size3}px`
|
|
4502
4579
|
} : void 0, ...props, ref });
|
|
4503
4580
|
}
|
|
@@ -4510,29 +4587,29 @@ var Spacer;
|
|
|
4510
4587
|
|
|
4511
4588
|
// src/components/internal/Menu.tsx
|
|
4512
4589
|
var import_noya_keymap3 = require("@noya-app/noya-keymap");
|
|
4513
|
-
var
|
|
4590
|
+
var import_react38 = __toESM(require("react"));
|
|
4514
4591
|
|
|
4515
4592
|
// src/contexts/DesignSystemConfiguration.tsx
|
|
4516
4593
|
var import_noya_keymap2 = require("@noya-app/noya-keymap");
|
|
4517
|
-
var
|
|
4594
|
+
var import_react36 = __toESM(require("react"));
|
|
4518
4595
|
|
|
4519
4596
|
// src/components/Toast.tsx
|
|
4520
4597
|
var ToastPrimitive = __toESM(require("@radix-ui/react-toast"));
|
|
4521
|
-
var
|
|
4598
|
+
var import_react11 = __toESM(require("react"));
|
|
4522
4599
|
|
|
4523
4600
|
// src/components/IconButton.tsx
|
|
4524
|
-
var
|
|
4525
|
-
var IconButton = (0,
|
|
4526
|
-
(0,
|
|
4601
|
+
var import_react10 = __toESM(require("react"));
|
|
4602
|
+
var IconButton = (0, import_react10.memo)(
|
|
4603
|
+
(0, import_react10.forwardRef)(function IconButton2({ selected, iconName, color, size: size3, contentStyle, ...props }, forwardedRef) {
|
|
4527
4604
|
const Icon = Icons[iconName];
|
|
4528
|
-
const style5 = (0,
|
|
4605
|
+
const style5 = (0, import_react10.useMemo)(() => {
|
|
4529
4606
|
return {
|
|
4530
4607
|
padding: "0 2px",
|
|
4531
4608
|
...size3 && { minHeight: size3 },
|
|
4532
4609
|
...contentStyle
|
|
4533
4610
|
};
|
|
4534
4611
|
}, [contentStyle, size3]);
|
|
4535
|
-
return /* @__PURE__ */
|
|
4612
|
+
return /* @__PURE__ */ import_react10.default.createElement(Button, { ref: forwardedRef, ...props, variant: "none", contentStyle: style5 }, /* @__PURE__ */ import_react10.default.createElement(
|
|
4536
4613
|
Icon,
|
|
4537
4614
|
{
|
|
4538
4615
|
color: color ?? (selected ? "var(--icon-selected)" : "var(--icon)"),
|
|
@@ -4549,27 +4626,27 @@ var Toast = ({
|
|
|
4549
4626
|
children: children2,
|
|
4550
4627
|
...props
|
|
4551
4628
|
}) => {
|
|
4552
|
-
return /* @__PURE__ */
|
|
4629
|
+
return /* @__PURE__ */ import_react11.default.createElement(
|
|
4553
4630
|
ToastPrimitive.Root,
|
|
4554
4631
|
{
|
|
4555
4632
|
className: "px-2 py-2.5 grid grid-cols-[auto_max-content] gap-x-2.5 items-center rounded text-sm bg-popover-background shadow-[0_2px_4px_rgba(0,0,0,0.2),0_0_12px_rgba(0,0,0,0.1)] text-text-muted",
|
|
4556
4633
|
...props
|
|
4557
4634
|
},
|
|
4558
|
-
title && /* @__PURE__ */
|
|
4559
|
-
/* @__PURE__ */
|
|
4560
|
-
children2 && /* @__PURE__ */
|
|
4561
|
-
/* @__PURE__ */
|
|
4635
|
+
title && /* @__PURE__ */ import_react11.default.createElement(ToastPrimitive.Title, { className: `mb-[5px] ${textStyles.label} font-bold text-text` }, title),
|
|
4636
|
+
/* @__PURE__ */ import_react11.default.createElement(ToastPrimitive.Description, { className: `${textStyles.small} text-text-muted` }, content),
|
|
4637
|
+
children2 && /* @__PURE__ */ import_react11.default.createElement(ToastPrimitive.Action, { asChild: true, altText: "" }, children2),
|
|
4638
|
+
/* @__PURE__ */ import_react11.default.createElement(ToastPrimitive.Close, { "aria-label": "Close", asChild: true }, /* @__PURE__ */ import_react11.default.createElement(IconButton, { iconName: "Cross1Icon" }))
|
|
4562
4639
|
);
|
|
4563
4640
|
};
|
|
4564
|
-
var ToastProvider = ({ children: children2 }) => /* @__PURE__ */
|
|
4641
|
+
var ToastProvider = ({ children: children2 }) => /* @__PURE__ */ import_react11.default.createElement(ToastPrimitive.Provider, null, children2, /* @__PURE__ */ import_react11.default.createElement(ToastPrimitive.Viewport, { className: "fixed bottom-0 right-0 flex flex-col p-5 g-2.5 min-w-[200px] max-w-[100vw] m-0 list-none z-[2147483647] outline-none" }));
|
|
4565
4642
|
|
|
4566
4643
|
// src/contexts/DialogContext.tsx
|
|
4567
|
-
var
|
|
4644
|
+
var import_react34 = __toESM(require("react"));
|
|
4568
4645
|
|
|
4569
4646
|
// src/components/Dialog.tsx
|
|
4570
4647
|
var DialogPrimitive = __toESM(require("@radix-ui/react-dialog"));
|
|
4571
|
-
var
|
|
4572
|
-
var StyledOverlay = (0,
|
|
4648
|
+
var import_react12 = __toESM(require("react"));
|
|
4649
|
+
var StyledOverlay = (0, import_react12.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ import_react12.default.createElement(
|
|
4573
4650
|
DialogPrimitive.Overlay,
|
|
4574
4651
|
{
|
|
4575
4652
|
ref,
|
|
@@ -4577,7 +4654,7 @@ var StyledOverlay = (0, import_react11.forwardRef)(({ className, ...props }, ref
|
|
|
4577
4654
|
...props
|
|
4578
4655
|
}
|
|
4579
4656
|
));
|
|
4580
|
-
var StyledContent = (0,
|
|
4657
|
+
var StyledContent = (0, import_react12.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ import_react12.default.createElement(
|
|
4581
4658
|
DialogPrimitive.Content,
|
|
4582
4659
|
{
|
|
4583
4660
|
ref,
|
|
@@ -4592,7 +4669,7 @@ var StyledContent = (0, import_react11.forwardRef)(({ className, ...props }, ref
|
|
|
4592
4669
|
...props
|
|
4593
4670
|
}
|
|
4594
4671
|
));
|
|
4595
|
-
var StyledTitle = (0,
|
|
4672
|
+
var StyledTitle = (0, import_react12.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ import_react12.default.createElement(
|
|
4596
4673
|
DialogPrimitive.Title,
|
|
4597
4674
|
{
|
|
4598
4675
|
ref,
|
|
@@ -4603,7 +4680,7 @@ var StyledTitle = (0, import_react11.forwardRef)(({ className, ...props }, ref)
|
|
|
4603
4680
|
...props
|
|
4604
4681
|
}
|
|
4605
4682
|
));
|
|
4606
|
-
var StyledDescription = (0,
|
|
4683
|
+
var StyledDescription = (0, import_react12.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ import_react12.default.createElement(
|
|
4607
4684
|
DialogPrimitive.Description,
|
|
4608
4685
|
{
|
|
4609
4686
|
ref,
|
|
@@ -4614,7 +4691,7 @@ var StyledDescription = (0, import_react11.forwardRef)(({ className, ...props },
|
|
|
4614
4691
|
...props
|
|
4615
4692
|
}
|
|
4616
4693
|
));
|
|
4617
|
-
var CloseButtonContainer = (0,
|
|
4694
|
+
var CloseButtonContainer = (0, import_react12.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ import_react12.default.createElement(
|
|
4618
4695
|
"div",
|
|
4619
4696
|
{
|
|
4620
4697
|
ref,
|
|
@@ -4622,7 +4699,7 @@ var CloseButtonContainer = (0, import_react11.forwardRef)(({ className, ...props
|
|
|
4622
4699
|
...props
|
|
4623
4700
|
}
|
|
4624
4701
|
));
|
|
4625
|
-
var Dialog = (0,
|
|
4702
|
+
var Dialog = (0, import_react12.forwardRef)(function Dialog2({
|
|
4626
4703
|
children: children2,
|
|
4627
4704
|
title,
|
|
4628
4705
|
description,
|
|
@@ -4632,14 +4709,14 @@ var Dialog = (0, import_react11.forwardRef)(function Dialog2({
|
|
|
4632
4709
|
onOpenAutoFocus,
|
|
4633
4710
|
closeOnInteractOutside = true
|
|
4634
4711
|
}, forwardedRef) {
|
|
4635
|
-
const contentRef = (0,
|
|
4636
|
-
(0,
|
|
4712
|
+
const contentRef = (0, import_react12.useRef)(null);
|
|
4713
|
+
(0, import_react12.useImperativeHandle)(forwardedRef, () => ({
|
|
4637
4714
|
containsElement(element) {
|
|
4638
4715
|
if (!contentRef.current) return false;
|
|
4639
4716
|
return contentRef.current.contains(element);
|
|
4640
4717
|
}
|
|
4641
4718
|
}));
|
|
4642
|
-
return /* @__PURE__ */
|
|
4719
|
+
return /* @__PURE__ */ import_react12.default.createElement(DialogPrimitive.Root, { open, onOpenChange }, /* @__PURE__ */ import_react12.default.createElement(StyledOverlay, null), /* @__PURE__ */ import_react12.default.createElement(
|
|
4643
4720
|
StyledContent,
|
|
4644
4721
|
{
|
|
4645
4722
|
ref: contentRef,
|
|
@@ -4650,14 +4727,14 @@ var Dialog = (0, import_react11.forwardRef)(function Dialog2({
|
|
|
4650
4727
|
onInteractOutside: (event) => event.preventDefault()
|
|
4651
4728
|
}
|
|
4652
4729
|
},
|
|
4653
|
-
/* @__PURE__ */
|
|
4654
|
-
title && /* @__PURE__ */
|
|
4655
|
-
description && /* @__PURE__ */
|
|
4730
|
+
/* @__PURE__ */ import_react12.default.createElement(CloseButtonContainer, null, /* @__PURE__ */ import_react12.default.createElement(DialogPrimitive.Close, { asChild: true }, /* @__PURE__ */ import_react12.default.createElement(IconButton, { iconName: "Cross1Icon" }))),
|
|
4731
|
+
title && /* @__PURE__ */ import_react12.default.createElement(import_react12.default.Fragment, null, /* @__PURE__ */ import_react12.default.createElement(StyledTitle, null, title), /* @__PURE__ */ import_react12.default.createElement(Spacer.Vertical, { size: description ? 10 : 20 })),
|
|
4732
|
+
description && /* @__PURE__ */ import_react12.default.createElement(import_react12.default.Fragment, null, /* @__PURE__ */ import_react12.default.createElement(Spacer.Vertical, { size: 10 }), /* @__PURE__ */ import_react12.default.createElement(StyledDescription, null, description), /* @__PURE__ */ import_react12.default.createElement(Spacer.Vertical, { size: 20 })),
|
|
4656
4733
|
children2
|
|
4657
4734
|
));
|
|
4658
4735
|
});
|
|
4659
|
-
var FullscreenDialog = (0,
|
|
4660
|
-
return /* @__PURE__ */
|
|
4736
|
+
var FullscreenDialog = (0, import_react12.forwardRef)(function FullscreenDialog2({ style: style5, ...rest }, forwardedRef) {
|
|
4737
|
+
return /* @__PURE__ */ import_react12.default.createElement(
|
|
4661
4738
|
Dialog,
|
|
4662
4739
|
{
|
|
4663
4740
|
ref: forwardedRef,
|
|
@@ -4683,13 +4760,13 @@ var FullscreenDialog = (0, import_react11.forwardRef)(function FullscreenDialog2
|
|
|
4683
4760
|
var import_noya_icons3 = require("@noya-app/noya-icons");
|
|
4684
4761
|
|
|
4685
4762
|
// ../noya-react-utils/src/components/AutoSizer.tsx
|
|
4686
|
-
var
|
|
4763
|
+
var import_react13 = __toESM(require("react"));
|
|
4687
4764
|
|
|
4688
4765
|
// ../noya-react-utils/src/hooks/useSize.ts
|
|
4689
|
-
var
|
|
4766
|
+
var React14 = __toESM(require("react"));
|
|
4690
4767
|
function useSize(refToObserve, dimensions = "both") {
|
|
4691
|
-
const [size3, setSize] =
|
|
4692
|
-
|
|
4768
|
+
const [size3, setSize] = React14.useState(void 0);
|
|
4769
|
+
React14.useEffect(() => {
|
|
4693
4770
|
if (refToObserve.current) {
|
|
4694
4771
|
const elementToObserve = refToObserve.current;
|
|
4695
4772
|
const resizeObserver = new ResizeObserver((entries) => {
|
|
@@ -4736,35 +4813,35 @@ var style = {
|
|
|
4736
4813
|
flex: "1 0 0",
|
|
4737
4814
|
flexDirection: "column"
|
|
4738
4815
|
};
|
|
4739
|
-
var AutoSizer = (0,
|
|
4816
|
+
var AutoSizer = (0, import_react13.memo)(function AutoSizer2({
|
|
4740
4817
|
children: children2,
|
|
4741
4818
|
className
|
|
4742
4819
|
}) {
|
|
4743
|
-
const containerRef = (0,
|
|
4820
|
+
const containerRef = (0, import_react13.useRef)(null);
|
|
4744
4821
|
const containerSize = useSize(containerRef);
|
|
4745
|
-
return /* @__PURE__ */
|
|
4822
|
+
return /* @__PURE__ */ import_react13.default.createElement("div", { ref: containerRef, style, className }, containerSize && containerSize.width > 0 && containerSize.height > 0 && children2(containerSize));
|
|
4746
4823
|
});
|
|
4747
|
-
var SingleDimensionAutoSizer = (0,
|
|
4824
|
+
var SingleDimensionAutoSizer = (0, import_react13.memo)(function SingleDimensionAutoSizer2({
|
|
4748
4825
|
children: children2,
|
|
4749
4826
|
dimension,
|
|
4750
4827
|
className
|
|
4751
4828
|
}) {
|
|
4752
|
-
const containerRef = (0,
|
|
4829
|
+
const containerRef = (0, import_react13.useRef)(null);
|
|
4753
4830
|
const containerSize = useSize(containerRef, dimension);
|
|
4754
|
-
return /* @__PURE__ */
|
|
4831
|
+
return /* @__PURE__ */ import_react13.default.createElement("div", { ref: containerRef, style, className }, containerSize && containerSize[dimension] > 0 && children2(containerSize[dimension]));
|
|
4755
4832
|
});
|
|
4756
4833
|
|
|
4757
4834
|
// ../noya-react-utils/src/components/FileDropTarget.tsx
|
|
4758
|
-
var
|
|
4835
|
+
var import_react15 = __toESM(require("react"));
|
|
4759
4836
|
|
|
4760
4837
|
// ../noya-react-utils/src/hooks/useFileDropTarget.ts
|
|
4761
|
-
var
|
|
4838
|
+
var import_react14 = require("react");
|
|
4762
4839
|
function useFileDropTarget(ref, dropEvent) {
|
|
4763
|
-
const [isDropTargetActive, setIsDropTargetActive] = (0,
|
|
4764
|
-
const handleDragOver = (0,
|
|
4840
|
+
const [isDropTargetActive, setIsDropTargetActive] = (0, import_react14.useState)(false);
|
|
4841
|
+
const handleDragOver = (0, import_react14.useCallback)((event) => {
|
|
4765
4842
|
event.preventDefault();
|
|
4766
4843
|
}, []);
|
|
4767
|
-
const handleDragEnter = (0,
|
|
4844
|
+
const handleDragEnter = (0, import_react14.useCallback)(
|
|
4768
4845
|
(event) => {
|
|
4769
4846
|
event.preventDefault();
|
|
4770
4847
|
if (!ref.current?.contains(event.relatedTarget)) {
|
|
@@ -4773,7 +4850,7 @@ function useFileDropTarget(ref, dropEvent) {
|
|
|
4773
4850
|
},
|
|
4774
4851
|
[ref]
|
|
4775
4852
|
);
|
|
4776
|
-
const handleDragLeave = (0,
|
|
4853
|
+
const handleDragLeave = (0, import_react14.useCallback)(
|
|
4777
4854
|
(event) => {
|
|
4778
4855
|
event.preventDefault();
|
|
4779
4856
|
if (!ref.current?.contains(event.relatedTarget)) {
|
|
@@ -4782,7 +4859,7 @@ function useFileDropTarget(ref, dropEvent) {
|
|
|
4782
4859
|
},
|
|
4783
4860
|
[ref]
|
|
4784
4861
|
);
|
|
4785
|
-
const handleDrop = (0,
|
|
4862
|
+
const handleDrop = (0, import_react14.useCallback)(
|
|
4786
4863
|
(event) => {
|
|
4787
4864
|
event.preventDefault();
|
|
4788
4865
|
dropEvent(event);
|
|
@@ -4805,14 +4882,14 @@ function useFileDropTarget(ref, dropEvent) {
|
|
|
4805
4882
|
function isSupportedFile(file, supportedFileTypes) {
|
|
4806
4883
|
return supportedFileTypes.includes(file.type) || file.type === "" && file.name.endsWith(".sketch");
|
|
4807
4884
|
}
|
|
4808
|
-
var FileDropTarget = (0,
|
|
4885
|
+
var FileDropTarget = (0, import_react15.memo)(function FileDropTarget2({
|
|
4809
4886
|
children: children2,
|
|
4810
4887
|
onDropFiles,
|
|
4811
4888
|
supportedFileTypes,
|
|
4812
4889
|
...props
|
|
4813
4890
|
}) {
|
|
4814
|
-
const ref = (0,
|
|
4815
|
-
const handleFile = (0,
|
|
4891
|
+
const ref = (0, import_react15.useRef)(null);
|
|
4892
|
+
const handleFile = (0, import_react15.useCallback)(
|
|
4816
4893
|
(event) => {
|
|
4817
4894
|
event.preventDefault();
|
|
4818
4895
|
const offsetPoint = {
|
|
@@ -4848,51 +4925,51 @@ var FileDropTarget = (0, import_react14.memo)(function FileDropTarget2({
|
|
|
4848
4925
|
ref,
|
|
4849
4926
|
handleFile
|
|
4850
4927
|
);
|
|
4851
|
-
return /* @__PURE__ */
|
|
4928
|
+
return /* @__PURE__ */ import_react15.default.createElement("div", { ref, ...dropTargetProps, ...props }, typeof children2 === "function" ? children2(isDropTargetActive) : children2);
|
|
4852
4929
|
});
|
|
4853
4930
|
|
|
4854
4931
|
// ../noya-react-utils/src/hooks/useDeepArray.ts
|
|
4855
4932
|
var import_noya_utils = require("@noya-app/noya-utils");
|
|
4856
|
-
var
|
|
4933
|
+
var import_react16 = require("react");
|
|
4857
4934
|
|
|
4858
4935
|
// ../noya-react-utils/src/hooks/useDeepState.ts
|
|
4859
4936
|
var import_noya_utils2 = require("@noya-app/noya-utils");
|
|
4860
|
-
var
|
|
4937
|
+
var import_react17 = require("react");
|
|
4861
4938
|
|
|
4862
4939
|
// ../noya-react-utils/src/hooks/useFetch.ts
|
|
4863
|
-
var
|
|
4940
|
+
var import_react18 = require("react");
|
|
4864
4941
|
|
|
4865
4942
|
// ../noya-react-utils/src/hooks/useIsMounted.ts
|
|
4866
|
-
var
|
|
4943
|
+
var import_react19 = require("react");
|
|
4867
4944
|
|
|
4868
4945
|
// ../noya-react-utils/src/hooks/useLateReference.ts
|
|
4869
|
-
var
|
|
4946
|
+
var import_react20 = require("react");
|
|
4870
4947
|
|
|
4871
4948
|
// ../noya-react-utils/src/hooks/useLazyValue.ts
|
|
4872
|
-
var
|
|
4949
|
+
var import_react21 = require("react");
|
|
4873
4950
|
|
|
4874
4951
|
// ../noya-react-utils/src/hooks/useMutableState.ts
|
|
4875
|
-
var
|
|
4952
|
+
var import_react22 = require("react");
|
|
4876
4953
|
|
|
4877
4954
|
// ../noya-react-utils/src/hooks/usePersistentState.ts
|
|
4878
|
-
var
|
|
4955
|
+
var import_react23 = require("react");
|
|
4879
4956
|
|
|
4880
4957
|
// ../noya-react-utils/src/hooks/usePixelRatio.ts
|
|
4881
|
-
var
|
|
4958
|
+
var import_react24 = require("react");
|
|
4882
4959
|
|
|
4883
4960
|
// ../noya-react-utils/src/hooks/useShallowArray.ts
|
|
4884
4961
|
var import_noya_utils3 = require("@noya-app/noya-utils");
|
|
4885
|
-
var
|
|
4962
|
+
var import_react25 = require("react");
|
|
4886
4963
|
|
|
4887
4964
|
// ../noya-react-utils/src/hooks/useStableCallback.ts
|
|
4888
|
-
var
|
|
4965
|
+
var import_react26 = require("react");
|
|
4889
4966
|
|
|
4890
4967
|
// ../noya-react-utils/src/hooks/useSystemColorScheme.ts
|
|
4891
|
-
var
|
|
4968
|
+
var import_react27 = require("react");
|
|
4892
4969
|
|
|
4893
4970
|
// ../noya-react-utils/src/hooks/useUrlHashParameters.ts
|
|
4894
4971
|
var import_noya_utils4 = require("@noya-app/noya-utils");
|
|
4895
|
-
var
|
|
4972
|
+
var import_react28 = require("react");
|
|
4896
4973
|
|
|
4897
4974
|
// ../emitter/src/index.ts
|
|
4898
4975
|
var Emitter = class {
|
|
@@ -4982,7 +5059,7 @@ function assignRef(ref, value) {
|
|
|
4982
5059
|
}
|
|
4983
5060
|
|
|
4984
5061
|
// src/components/InputField.tsx
|
|
4985
|
-
var
|
|
5062
|
+
var import_react33 = __toESM(require("react"));
|
|
4986
5063
|
|
|
4987
5064
|
// src/utils/handleNudge.ts
|
|
4988
5065
|
function handleNudge(e) {
|
|
@@ -5011,8 +5088,8 @@ function handleNudge(e) {
|
|
|
5011
5088
|
var import_noya_icons2 = require("@noya-app/noya-icons");
|
|
5012
5089
|
var import_noya_keymap = require("@noya-app/noya-keymap");
|
|
5013
5090
|
var RadixDropdownMenu = __toESM(require("@radix-ui/react-dropdown-menu"));
|
|
5014
|
-
var
|
|
5015
|
-
var DropdownMenuItem = (0,
|
|
5091
|
+
var import_react29 = __toESM(require("react"));
|
|
5092
|
+
var DropdownMenuItem = (0, import_react29.memo)(function ContextMenuItem({
|
|
5016
5093
|
value,
|
|
5017
5094
|
children: children2,
|
|
5018
5095
|
onSelect,
|
|
@@ -5023,12 +5100,12 @@ var DropdownMenuItem = (0, import_react28.memo)(function ContextMenuItem({
|
|
|
5023
5100
|
items,
|
|
5024
5101
|
shortcut
|
|
5025
5102
|
}) {
|
|
5026
|
-
const handleSelectItem = (0,
|
|
5103
|
+
const handleSelectItem = (0, import_react29.useCallback)(() => {
|
|
5027
5104
|
if (!value) return;
|
|
5028
5105
|
onSelect(value);
|
|
5029
5106
|
}, [onSelect, value]);
|
|
5030
5107
|
if (checked) {
|
|
5031
|
-
return /* @__PURE__ */
|
|
5108
|
+
return /* @__PURE__ */ import_react29.default.createElement(
|
|
5032
5109
|
RadixDropdownMenu.CheckboxItem,
|
|
5033
5110
|
{
|
|
5034
5111
|
checked,
|
|
@@ -5036,26 +5113,26 @@ var DropdownMenuItem = (0, import_react28.memo)(function ContextMenuItem({
|
|
|
5036
5113
|
onSelect: handleSelectItem,
|
|
5037
5114
|
className: styles.itemStyle({ disabled })
|
|
5038
5115
|
},
|
|
5039
|
-
/* @__PURE__ */
|
|
5040
|
-
icon && /* @__PURE__ */
|
|
5116
|
+
/* @__PURE__ */ import_react29.default.createElement(RadixDropdownMenu.ItemIndicator, { className: styles.itemIndicatorStyle }, /* @__PURE__ */ import_react29.default.createElement(import_noya_icons2.CheckIcon, null)),
|
|
5117
|
+
icon && /* @__PURE__ */ import_react29.default.createElement(import_react29.default.Fragment, null, renderIcon(icon), /* @__PURE__ */ import_react29.default.createElement(Spacer.Horizontal, { size: 8 })),
|
|
5041
5118
|
children2
|
|
5042
5119
|
);
|
|
5043
5120
|
}
|
|
5044
|
-
const element = /* @__PURE__ */
|
|
5121
|
+
const element = /* @__PURE__ */ import_react29.default.createElement(
|
|
5045
5122
|
RadixDropdownMenu.Item,
|
|
5046
5123
|
{
|
|
5047
5124
|
disabled,
|
|
5048
5125
|
onSelect: handleSelectItem,
|
|
5049
5126
|
className: styles.itemStyle({ disabled })
|
|
5050
5127
|
},
|
|
5051
|
-
indented && /* @__PURE__ */
|
|
5052
|
-
icon && /* @__PURE__ */
|
|
5128
|
+
indented && /* @__PURE__ */ import_react29.default.createElement(Spacer.Horizontal, { size: CHECKBOX_WIDTH - CHECKBOX_RIGHT_INSET }),
|
|
5129
|
+
icon && /* @__PURE__ */ import_react29.default.createElement(import_react29.default.Fragment, null, renderIcon(icon), /* @__PURE__ */ import_react29.default.createElement(Spacer.Horizontal, { size: 8 })),
|
|
5053
5130
|
children2,
|
|
5054
|
-
shortcut && /* @__PURE__ */
|
|
5055
|
-
items && items.length > 0 && /* @__PURE__ */
|
|
5131
|
+
shortcut && /* @__PURE__ */ import_react29.default.createElement(import_react29.default.Fragment, null, /* @__PURE__ */ import_react29.default.createElement(Spacer.Horizontal, null), /* @__PURE__ */ import_react29.default.createElement(Spacer.Horizontal, { size: 24 }), /* @__PURE__ */ import_react29.default.createElement(KeyboardShortcut, { shortcut })),
|
|
5132
|
+
items && items.length > 0 && /* @__PURE__ */ import_react29.default.createElement(import_react29.default.Fragment, null, /* @__PURE__ */ import_react29.default.createElement(Spacer.Horizontal, null), /* @__PURE__ */ import_react29.default.createElement(Spacer.Horizontal, { size: 16 }), /* @__PURE__ */ import_react29.default.createElement(import_noya_icons2.ChevronRightIcon, null))
|
|
5056
5133
|
);
|
|
5057
5134
|
if (items && items.length > 0) {
|
|
5058
|
-
return /* @__PURE__ */
|
|
5135
|
+
return /* @__PURE__ */ import_react29.default.createElement(
|
|
5059
5136
|
DropdownMenuRoot,
|
|
5060
5137
|
{
|
|
5061
5138
|
isNested: true,
|
|
@@ -5069,7 +5146,7 @@ var DropdownMenuItem = (0, import_react28.memo)(function ContextMenuItem({
|
|
|
5069
5146
|
return element;
|
|
5070
5147
|
}
|
|
5071
5148
|
});
|
|
5072
|
-
var DropdownMenuRoot = (0,
|
|
5149
|
+
var DropdownMenuRoot = (0, import_react29.forwardRef)(function DropdownMenuRoot2({
|
|
5073
5150
|
items,
|
|
5074
5151
|
children: children2,
|
|
5075
5152
|
onSelect,
|
|
@@ -5088,7 +5165,7 @@ var DropdownMenuRoot = (0, import_react28.forwardRef)(function DropdownMenuRoot2
|
|
|
5088
5165
|
const hasCheckedItem = items.some(
|
|
5089
5166
|
(item) => item !== SEPARATOR_ITEM && item.checked
|
|
5090
5167
|
);
|
|
5091
|
-
const keymap = (0,
|
|
5168
|
+
const keymap = (0, import_react29.useMemo)(
|
|
5092
5169
|
() => isNested || shouldBindKeyboardShortcuts === false ? {} : getKeyboardShortcutsForMenuItems(items, onSelect),
|
|
5093
5170
|
[isNested, items, onSelect, shouldBindKeyboardShortcuts]
|
|
5094
5171
|
);
|
|
@@ -5096,8 +5173,8 @@ var DropdownMenuRoot = (0, import_react28.forwardRef)(function DropdownMenuRoot2
|
|
|
5096
5173
|
const RootComponent = isNested ? RadixDropdownMenu.Sub : RadixDropdownMenu.Root;
|
|
5097
5174
|
const TriggerComponent = isNested ? RadixDropdownMenu.SubTrigger : RadixDropdownMenu.Trigger;
|
|
5098
5175
|
const ContentComponent = isNested ? RadixDropdownMenu.SubContent : RadixDropdownMenu.Content;
|
|
5099
|
-
const contentStyle = (0,
|
|
5100
|
-
return /* @__PURE__ */
|
|
5176
|
+
const contentStyle = (0, import_react29.useMemo)(() => ({ zIndex: 1e3 }), []);
|
|
5177
|
+
return /* @__PURE__ */ import_react29.default.createElement(RootComponent, { onOpenChange, open }, /* @__PURE__ */ import_react29.default.createElement(TriggerComponent, { ref: forwardedRef, asChild: true }, children2), /* @__PURE__ */ import_react29.default.createElement(RadixDropdownMenu.Portal, null, /* @__PURE__ */ import_react29.default.createElement(
|
|
5101
5178
|
ContentComponent,
|
|
5102
5179
|
{
|
|
5103
5180
|
className: styles.contentStyle,
|
|
@@ -5111,13 +5188,13 @@ var DropdownMenuRoot = (0, import_react28.forwardRef)(function DropdownMenuRoot2
|
|
|
5111
5188
|
},
|
|
5112
5189
|
items.length === 0 ? emptyState : null,
|
|
5113
5190
|
items.map(
|
|
5114
|
-
(item, index) => item === SEPARATOR_ITEM ? /* @__PURE__ */
|
|
5191
|
+
(item, index) => item === SEPARATOR_ITEM ? /* @__PURE__ */ import_react29.default.createElement(
|
|
5115
5192
|
RadixDropdownMenu.Separator,
|
|
5116
5193
|
{
|
|
5117
5194
|
key: index,
|
|
5118
5195
|
className: styles.separatorStyle
|
|
5119
5196
|
}
|
|
5120
|
-
) : /* @__PURE__ */
|
|
5197
|
+
) : /* @__PURE__ */ import_react29.default.createElement(
|
|
5121
5198
|
DropdownMenuItem,
|
|
5122
5199
|
{
|
|
5123
5200
|
key: item.value ?? index,
|
|
@@ -5135,14 +5212,14 @@ var DropdownMenuRoot = (0, import_react28.forwardRef)(function DropdownMenuRoot2
|
|
|
5135
5212
|
)
|
|
5136
5213
|
)));
|
|
5137
5214
|
});
|
|
5138
|
-
var DropdownMenu = (0,
|
|
5215
|
+
var DropdownMenu = (0, import_react29.memo)(DropdownMenuRoot);
|
|
5139
5216
|
|
|
5140
5217
|
// src/components/internal/TextInput.tsx
|
|
5141
5218
|
var import_react_compose_refs = require("@radix-ui/react-compose-refs");
|
|
5142
|
-
var
|
|
5219
|
+
var import_react31 = __toESM(require("react"));
|
|
5143
5220
|
|
|
5144
5221
|
// src/contexts/GlobalInputBlurContext.tsx
|
|
5145
|
-
var
|
|
5222
|
+
var import_react30 = require("react");
|
|
5146
5223
|
var defaultValue = /* @__PURE__ */ (() => {
|
|
5147
5224
|
const listeners = [];
|
|
5148
5225
|
const value = {
|
|
@@ -5162,14 +5239,14 @@ var defaultValue = /* @__PURE__ */ (() => {
|
|
|
5162
5239
|
};
|
|
5163
5240
|
return value;
|
|
5164
5241
|
})();
|
|
5165
|
-
var GlobalInputBlurContext = (0,
|
|
5242
|
+
var GlobalInputBlurContext = (0, import_react30.createContext)(defaultValue);
|
|
5166
5243
|
var GlobalInputBlurProvider = GlobalInputBlurContext.Provider;
|
|
5167
5244
|
var useGlobalInputBlur = () => {
|
|
5168
|
-
return (0,
|
|
5245
|
+
return (0, import_react30.useContext)(GlobalInputBlurContext);
|
|
5169
5246
|
};
|
|
5170
5247
|
function useGlobalInputBlurListener(f) {
|
|
5171
5248
|
const context = useGlobalInputBlur();
|
|
5172
|
-
(0,
|
|
5249
|
+
(0, import_react30.useEffect)(() => {
|
|
5173
5250
|
context.addListener(f);
|
|
5174
5251
|
return () => {
|
|
5175
5252
|
context.removeListener(f);
|
|
@@ -5181,8 +5258,8 @@ function useGlobalInputBlurTrigger() {
|
|
|
5181
5258
|
}
|
|
5182
5259
|
|
|
5183
5260
|
// src/components/internal/TextInput.tsx
|
|
5184
|
-
var ReadOnlyTextInput = (0,
|
|
5185
|
-
return /* @__PURE__ */
|
|
5261
|
+
var ReadOnlyTextInput = (0, import_react31.forwardRef)(function ReadOnlyTextInput2({ onKeyDown, onFocusChange, value, ...rest }, forwardedRef) {
|
|
5262
|
+
return /* @__PURE__ */ import_react31.default.createElement(
|
|
5186
5263
|
"input",
|
|
5187
5264
|
{
|
|
5188
5265
|
ref: forwardedRef,
|
|
@@ -5193,7 +5270,7 @@ var ReadOnlyTextInput = (0, import_react30.forwardRef)(function ReadOnlyTextInpu
|
|
|
5193
5270
|
}
|
|
5194
5271
|
);
|
|
5195
5272
|
});
|
|
5196
|
-
var ControlledTextInput = (0,
|
|
5273
|
+
var ControlledTextInput = (0, import_react31.forwardRef)(function ControlledTextInput2({
|
|
5197
5274
|
onKeyDown,
|
|
5198
5275
|
value,
|
|
5199
5276
|
onChange,
|
|
@@ -5202,28 +5279,28 @@ var ControlledTextInput = (0, import_react30.forwardRef)(function ControlledText
|
|
|
5202
5279
|
onFocusCapture,
|
|
5203
5280
|
...rest
|
|
5204
5281
|
}, forwardedRef) {
|
|
5205
|
-
const handleBlur = (0,
|
|
5282
|
+
const handleBlur = (0, import_react31.useCallback)(
|
|
5206
5283
|
(event) => {
|
|
5207
5284
|
onBlur?.(event);
|
|
5208
5285
|
onFocusChange?.(false);
|
|
5209
5286
|
},
|
|
5210
5287
|
[onBlur, onFocusChange]
|
|
5211
5288
|
);
|
|
5212
|
-
const handleFocusCapture = (0,
|
|
5289
|
+
const handleFocusCapture = (0, import_react31.useCallback)(
|
|
5213
5290
|
(event) => {
|
|
5214
5291
|
onFocusCapture?.(event);
|
|
5215
5292
|
onFocusChange?.(true);
|
|
5216
5293
|
},
|
|
5217
5294
|
[onFocusCapture, onFocusChange]
|
|
5218
5295
|
);
|
|
5219
|
-
return /* @__PURE__ */
|
|
5296
|
+
return /* @__PURE__ */ import_react31.default.createElement(
|
|
5220
5297
|
"input",
|
|
5221
5298
|
{
|
|
5222
5299
|
ref: forwardedRef,
|
|
5223
5300
|
...rest,
|
|
5224
5301
|
value,
|
|
5225
5302
|
onKeyDown,
|
|
5226
|
-
onChange: (0,
|
|
5303
|
+
onChange: (0, import_react31.useCallback)(
|
|
5227
5304
|
(event) => onChange(event.target.value),
|
|
5228
5305
|
[onChange]
|
|
5229
5306
|
),
|
|
@@ -5232,7 +5309,7 @@ var ControlledTextInput = (0, import_react30.forwardRef)(function ControlledText
|
|
|
5232
5309
|
}
|
|
5233
5310
|
);
|
|
5234
5311
|
});
|
|
5235
|
-
var SubmittableTextInput = (0,
|
|
5312
|
+
var SubmittableTextInput = (0, import_react31.forwardRef)(function SubmittableTextInput2({
|
|
5236
5313
|
onKeyDown,
|
|
5237
5314
|
value,
|
|
5238
5315
|
onSubmit,
|
|
@@ -5243,16 +5320,16 @@ var SubmittableTextInput = (0, import_react30.forwardRef)(function SubmittableTe
|
|
|
5243
5320
|
submitAutomaticallyAfterDelay,
|
|
5244
5321
|
...rest
|
|
5245
5322
|
}, forwardedRef) {
|
|
5246
|
-
const ref =
|
|
5247
|
-
const latestValue = (0,
|
|
5323
|
+
const ref = import_react31.default.useRef(null);
|
|
5324
|
+
const latestValue = (0, import_react31.useRef)(value);
|
|
5248
5325
|
latestValue.current = value;
|
|
5249
|
-
const userDidEdit = (0,
|
|
5250
|
-
const isSubmitTriggeredByEscapeKey = (0,
|
|
5251
|
-
const [internalValue, setInternalValue] = (0,
|
|
5252
|
-
(0,
|
|
5326
|
+
const userDidEdit = (0, import_react31.useRef)(false);
|
|
5327
|
+
const isSubmitTriggeredByEscapeKey = (0, import_react31.useRef)(false);
|
|
5328
|
+
const [internalValue, setInternalValue] = (0, import_react31.useState)("");
|
|
5329
|
+
(0, import_react31.useLayoutEffect)(() => {
|
|
5253
5330
|
setInternalValue(value);
|
|
5254
5331
|
}, [value]);
|
|
5255
|
-
const handleSubmit = (0,
|
|
5332
|
+
const handleSubmit = (0, import_react31.useCallback)(() => {
|
|
5256
5333
|
const submissionValue = isSubmitTriggeredByEscapeKey.current ? value : internalValue;
|
|
5257
5334
|
isSubmitTriggeredByEscapeKey.current = false;
|
|
5258
5335
|
if (submissionValue === value && !allowSubmittingWithSameValue) return;
|
|
@@ -5261,12 +5338,12 @@ var SubmittableTextInput = (0, import_react30.forwardRef)(function SubmittableTe
|
|
|
5261
5338
|
setInternalValue(latestValue.current);
|
|
5262
5339
|
}, [allowSubmittingWithSameValue, value, internalValue, onSubmit]);
|
|
5263
5340
|
useGlobalInputBlurListener(
|
|
5264
|
-
(0,
|
|
5341
|
+
(0, import_react31.useCallback)(() => {
|
|
5265
5342
|
if (ref.current !== document.activeElement) return;
|
|
5266
5343
|
handleSubmit();
|
|
5267
5344
|
}, [handleSubmit])
|
|
5268
5345
|
);
|
|
5269
|
-
const handleKeyDown = (0,
|
|
5346
|
+
const handleKeyDown = (0, import_react31.useCallback)(
|
|
5270
5347
|
(event) => {
|
|
5271
5348
|
if (event.key === "Enter") {
|
|
5272
5349
|
handleSubmit();
|
|
@@ -5281,14 +5358,14 @@ var SubmittableTextInput = (0, import_react30.forwardRef)(function SubmittableTe
|
|
|
5281
5358
|
},
|
|
5282
5359
|
[onKeyDown, handleSubmit]
|
|
5283
5360
|
);
|
|
5284
|
-
const handleChange = (0,
|
|
5361
|
+
const handleChange = (0, import_react31.useCallback)(
|
|
5285
5362
|
(event) => {
|
|
5286
5363
|
userDidEdit.current = true;
|
|
5287
5364
|
setInternalValue(event.target.value);
|
|
5288
5365
|
},
|
|
5289
5366
|
[]
|
|
5290
5367
|
);
|
|
5291
|
-
const handleBlur = (0,
|
|
5368
|
+
const handleBlur = (0, import_react31.useCallback)(
|
|
5292
5369
|
(event) => {
|
|
5293
5370
|
onBlur?.(event);
|
|
5294
5371
|
onFocusChange?.(false);
|
|
@@ -5296,19 +5373,19 @@ var SubmittableTextInput = (0, import_react30.forwardRef)(function SubmittableTe
|
|
|
5296
5373
|
},
|
|
5297
5374
|
[onBlur, onFocusChange, handleSubmit]
|
|
5298
5375
|
);
|
|
5299
|
-
const handleFocusCapture = (0,
|
|
5376
|
+
const handleFocusCapture = (0, import_react31.useCallback)(
|
|
5300
5377
|
(event) => {
|
|
5301
5378
|
onFocusCapture?.(event);
|
|
5302
5379
|
onFocusChange?.(true);
|
|
5303
5380
|
},
|
|
5304
5381
|
[onFocusCapture, onFocusChange]
|
|
5305
5382
|
);
|
|
5306
|
-
const autoSubmitTimeoutRef = (0,
|
|
5383
|
+
const autoSubmitTimeoutRef = (0, import_react31.useRef)(
|
|
5307
5384
|
null
|
|
5308
5385
|
);
|
|
5309
|
-
const latestHandleSubmit = (0,
|
|
5386
|
+
const latestHandleSubmit = (0, import_react31.useRef)(handleSubmit);
|
|
5310
5387
|
latestHandleSubmit.current = handleSubmit;
|
|
5311
|
-
(0,
|
|
5388
|
+
(0, import_react31.useEffect)(() => {
|
|
5312
5389
|
if (submitAutomaticallyAfterDelay) {
|
|
5313
5390
|
if (autoSubmitTimeoutRef.current) {
|
|
5314
5391
|
clearTimeout(autoSubmitTimeoutRef.current);
|
|
@@ -5324,7 +5401,7 @@ var SubmittableTextInput = (0, import_react30.forwardRef)(function SubmittableTe
|
|
|
5324
5401
|
}
|
|
5325
5402
|
};
|
|
5326
5403
|
}, [internalValue, submitAutomaticallyAfterDelay]);
|
|
5327
|
-
return /* @__PURE__ */
|
|
5404
|
+
return /* @__PURE__ */ import_react31.default.createElement(
|
|
5328
5405
|
"input",
|
|
5329
5406
|
{
|
|
5330
5407
|
ref: (0, import_react_compose_refs.composeRefs)(ref, forwardedRef),
|
|
@@ -5337,13 +5414,13 @@ var SubmittableTextInput = (0, import_react30.forwardRef)(function SubmittableTe
|
|
|
5337
5414
|
}
|
|
5338
5415
|
);
|
|
5339
5416
|
});
|
|
5340
|
-
var TextInput_default = (0,
|
|
5417
|
+
var TextInput_default = (0, import_react31.forwardRef)(function TextInput(props, forwardedRef) {
|
|
5341
5418
|
const commonProps = {
|
|
5342
|
-
onPointerDown: (0,
|
|
5419
|
+
onPointerDown: (0, import_react31.useCallback)(
|
|
5343
5420
|
(event) => event.stopPropagation(),
|
|
5344
5421
|
[]
|
|
5345
5422
|
),
|
|
5346
|
-
onClick: (0,
|
|
5423
|
+
onClick: (0, import_react31.useCallback)(
|
|
5347
5424
|
(event) => event.stopPropagation(),
|
|
5348
5425
|
[]
|
|
5349
5426
|
),
|
|
@@ -5356,17 +5433,17 @@ var TextInput_default = (0, import_react30.forwardRef)(function TextInput(props,
|
|
|
5356
5433
|
...props
|
|
5357
5434
|
};
|
|
5358
5435
|
if ("readOnly" in commonProps) {
|
|
5359
|
-
return /* @__PURE__ */
|
|
5436
|
+
return /* @__PURE__ */ import_react31.default.createElement(ReadOnlyTextInput, { ref: forwardedRef, ...commonProps, readOnly: true });
|
|
5360
5437
|
} else if ("onChange" in commonProps) {
|
|
5361
|
-
return /* @__PURE__ */
|
|
5438
|
+
return /* @__PURE__ */ import_react31.default.createElement(ControlledTextInput, { ref: forwardedRef, ...commonProps });
|
|
5362
5439
|
} else {
|
|
5363
|
-
return /* @__PURE__ */
|
|
5440
|
+
return /* @__PURE__ */ import_react31.default.createElement(SubmittableTextInput, { ref: forwardedRef, ...commonProps });
|
|
5364
5441
|
}
|
|
5365
5442
|
});
|
|
5366
5443
|
|
|
5367
5444
|
// src/components/Popover.tsx
|
|
5368
5445
|
var PopoverPrimitive = __toESM(require("@radix-ui/react-popover"));
|
|
5369
|
-
var
|
|
5446
|
+
var import_react32 = __toESM(require("react"));
|
|
5370
5447
|
var closeStyles = {
|
|
5371
5448
|
all: "unset",
|
|
5372
5449
|
fontFamily: "inherit"
|
|
@@ -5388,7 +5465,7 @@ function Popover({
|
|
|
5388
5465
|
onFocusOutside,
|
|
5389
5466
|
onClickClose
|
|
5390
5467
|
}) {
|
|
5391
|
-
return /* @__PURE__ */
|
|
5468
|
+
return /* @__PURE__ */ import_react32.default.createElement(PopoverPrimitive.Root, { open, onOpenChange }, /* @__PURE__ */ import_react32.default.createElement(PopoverPrimitive.Trigger, { asChild: true }, trigger), /* @__PURE__ */ import_react32.default.createElement(PopoverPrimitive.Portal, null, /* @__PURE__ */ import_react32.default.createElement(
|
|
5392
5469
|
PopoverPrimitive.Content,
|
|
5393
5470
|
{
|
|
5394
5471
|
className: `rounded font-[14px] bg-popover-background shadow-[0_2px_4px_rgba(0,0,0,0.2),0_0_12px_rgba(0,0,0,0.1)] max-h-[600px] overflow-y-auto text-text-muted z-[1000] ${variant === "large" ? "w-[680px]" : variant === "normal" ? "w-[240px]" : ""}`,
|
|
@@ -5404,20 +5481,20 @@ function Popover({
|
|
|
5404
5481
|
arrowPadding: 2
|
|
5405
5482
|
},
|
|
5406
5483
|
children2,
|
|
5407
|
-
showArrow && /* @__PURE__ */
|
|
5408
|
-
closable && /* @__PURE__ */
|
|
5484
|
+
showArrow && /* @__PURE__ */ import_react32.default.createElement(PopoverPrimitive.Arrow, { className: "fill-popover-background" }),
|
|
5485
|
+
closable && /* @__PURE__ */ import_react32.default.createElement(
|
|
5409
5486
|
PopoverPrimitive.Close,
|
|
5410
5487
|
{
|
|
5411
5488
|
className: "rounded-full h-[25px] w-[25px] inline-flex items-center justify-center absolute top-[5px] right-[5px]",
|
|
5412
5489
|
style: closeStyles
|
|
5413
5490
|
},
|
|
5414
|
-
/* @__PURE__ */
|
|
5491
|
+
/* @__PURE__ */ import_react32.default.createElement(IconButton, { iconName: "Cross2Icon", onClick: onClickClose })
|
|
5415
5492
|
)
|
|
5416
5493
|
)));
|
|
5417
5494
|
}
|
|
5418
5495
|
|
|
5419
5496
|
// src/components/InputField.tsx
|
|
5420
|
-
var InputFieldContext = (0,
|
|
5497
|
+
var InputFieldContext = (0, import_react33.createContext)({
|
|
5421
5498
|
labelPosition: "end",
|
|
5422
5499
|
labelSize: void 0,
|
|
5423
5500
|
buttonSize: void 0,
|
|
@@ -5427,13 +5504,13 @@ var InputFieldContext = (0, import_react32.createContext)({
|
|
|
5427
5504
|
onFocusChange: () => {
|
|
5428
5505
|
}
|
|
5429
5506
|
});
|
|
5430
|
-
var LabelContainer = (0,
|
|
5507
|
+
var LabelContainer = (0, import_react33.forwardRef)(
|
|
5431
5508
|
({ pointerEvents, $labelPosition, $hasDropdown, $size, className, style: style5, ...props }, ref) => {
|
|
5432
|
-
const memoizedStyles = (0,
|
|
5509
|
+
const memoizedStyles = (0, import_react33.useMemo)(() => ({
|
|
5433
5510
|
left: $labelPosition === "start" ? $size === "large" ? "6px" : $size === "medium" ? "2px" : "0px" : "",
|
|
5434
5511
|
right: $labelPosition === "end" ? $size === "large" ? "6px" : $size === "medium" ? "2px" : "0px" : ""
|
|
5435
5512
|
}), [$labelPosition, $size]);
|
|
5436
|
-
return /* @__PURE__ */
|
|
5513
|
+
return /* @__PURE__ */ import_react33.default.createElement(
|
|
5437
5514
|
"label",
|
|
5438
5515
|
{
|
|
5439
5516
|
ref,
|
|
@@ -5444,22 +5521,22 @@ var LabelContainer = (0, import_react32.forwardRef)(
|
|
|
5444
5521
|
);
|
|
5445
5522
|
}
|
|
5446
5523
|
);
|
|
5447
|
-
var InputFieldLabel = (0,
|
|
5448
|
-
(0,
|
|
5524
|
+
var InputFieldLabel = (0, import_react33.memo)(
|
|
5525
|
+
(0, import_react33.forwardRef)(function InputFieldLabel2({
|
|
5449
5526
|
children: children2 = false,
|
|
5450
5527
|
pointerEvents = "none",
|
|
5451
5528
|
style: style5,
|
|
5452
5529
|
className
|
|
5453
5530
|
}, forwardedRef) {
|
|
5454
|
-
const { labelPosition, hasDropdown, setLabelWidth, size: size3 } = (0,
|
|
5455
|
-
const ref = (0,
|
|
5456
|
-
(0,
|
|
5531
|
+
const { labelPosition, hasDropdown, setLabelWidth, size: size3 } = (0, import_react33.useContext)(InputFieldContext);
|
|
5532
|
+
const ref = (0, import_react33.useRef)(null);
|
|
5533
|
+
(0, import_react33.useLayoutEffect)(() => {
|
|
5457
5534
|
if (!setLabelWidth) return;
|
|
5458
5535
|
const width = ref.current?.getBoundingClientRect().width;
|
|
5459
5536
|
if (!width) return;
|
|
5460
5537
|
setLabelWidth(width);
|
|
5461
5538
|
}, [setLabelWidth]);
|
|
5462
|
-
return /* @__PURE__ */
|
|
5539
|
+
return /* @__PURE__ */ import_react33.default.createElement(
|
|
5463
5540
|
LabelContainer,
|
|
5464
5541
|
{
|
|
5465
5542
|
$size: size3,
|
|
@@ -5477,7 +5554,7 @@ var InputFieldLabel = (0, import_react32.memo)(
|
|
|
5477
5554
|
);
|
|
5478
5555
|
})
|
|
5479
5556
|
);
|
|
5480
|
-
var DropdownContainer = (0,
|
|
5557
|
+
var DropdownContainer = (0, import_react33.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ import_react33.default.createElement(
|
|
5481
5558
|
"span",
|
|
5482
5559
|
{
|
|
5483
5560
|
ref,
|
|
@@ -5485,16 +5562,16 @@ var DropdownContainer = (0, import_react32.forwardRef)(({ className, ...props },
|
|
|
5485
5562
|
...props
|
|
5486
5563
|
}
|
|
5487
5564
|
));
|
|
5488
|
-
var InputFieldDropdownMenu = (0,
|
|
5489
|
-
const { size: size3 } = (0,
|
|
5490
|
-
const contentStyle = (0,
|
|
5565
|
+
var InputFieldDropdownMenu = (0, import_react33.memo)(function InputFieldDropdownMenu2({ id, items, onSelect, children: children2 }) {
|
|
5566
|
+
const { size: size3 } = (0, import_react33.useContext)(InputFieldContext);
|
|
5567
|
+
const contentStyle = (0, import_react33.useMemo)(
|
|
5491
5568
|
() => ({
|
|
5492
5569
|
margin: "-4px 0",
|
|
5493
5570
|
minHeight: size3 === "small" ? "15px" : void 0
|
|
5494
5571
|
}),
|
|
5495
5572
|
[size3]
|
|
5496
5573
|
);
|
|
5497
|
-
return /* @__PURE__ */
|
|
5574
|
+
return /* @__PURE__ */ import_react33.default.createElement(DropdownContainer, null, /* @__PURE__ */ import_react33.default.createElement(DropdownMenu, { items, onSelect }, children2 || /* @__PURE__ */ import_react33.default.createElement(
|
|
5498
5575
|
Button,
|
|
5499
5576
|
{
|
|
5500
5577
|
id,
|
|
@@ -5502,10 +5579,10 @@ var InputFieldDropdownMenu = (0, import_react32.memo)(function InputFieldDropdow
|
|
|
5502
5579
|
className: "flex flex-1",
|
|
5503
5580
|
contentStyle
|
|
5504
5581
|
},
|
|
5505
|
-
/* @__PURE__ */
|
|
5582
|
+
/* @__PURE__ */ import_react33.default.createElement(import_noya_icons3.CaretDownIcon, null)
|
|
5506
5583
|
)));
|
|
5507
5584
|
});
|
|
5508
|
-
var ButtonContainer = (0,
|
|
5585
|
+
var ButtonContainer = (0, import_react33.forwardRef)(({ $size, className, ...props }, ref) => /* @__PURE__ */ import_react33.default.createElement(
|
|
5509
5586
|
"span",
|
|
5510
5587
|
{
|
|
5511
5588
|
ref,
|
|
@@ -5513,18 +5590,18 @@ var ButtonContainer = (0, import_react32.forwardRef)(({ $size, className, ...pro
|
|
|
5513
5590
|
...props
|
|
5514
5591
|
}
|
|
5515
5592
|
));
|
|
5516
|
-
var InputFieldButton = (0,
|
|
5517
|
-
(0,
|
|
5593
|
+
var InputFieldButton = (0, import_react33.memo)(
|
|
5594
|
+
(0, import_react33.forwardRef)(function InputFieldButton2(props, forwardedRef) {
|
|
5518
5595
|
const { children: children2, onClick, ...rest } = props;
|
|
5519
|
-
const { size: size3, inputRef, setButtonWidth } = (0,
|
|
5520
|
-
const ref = (0,
|
|
5521
|
-
(0,
|
|
5596
|
+
const { size: size3, inputRef, setButtonWidth } = (0, import_react33.useContext)(InputFieldContext);
|
|
5597
|
+
const ref = (0, import_react33.useRef)(null);
|
|
5598
|
+
(0, import_react33.useLayoutEffect)(() => {
|
|
5522
5599
|
if (!setButtonWidth) return;
|
|
5523
5600
|
const width = ref.current?.getBoundingClientRect().width;
|
|
5524
5601
|
if (!width) return;
|
|
5525
5602
|
setButtonWidth(width);
|
|
5526
5603
|
}, [setButtonWidth]);
|
|
5527
|
-
const defaultHandleClick = (0,
|
|
5604
|
+
const defaultHandleClick = (0, import_react33.useCallback)(
|
|
5528
5605
|
(event) => {
|
|
5529
5606
|
if (inputRef && typeof inputRef !== "function") {
|
|
5530
5607
|
inputRef.current?.focus();
|
|
@@ -5535,14 +5612,14 @@ var InputFieldButton = (0, import_react32.memo)(
|
|
|
5535
5612
|
},
|
|
5536
5613
|
[inputRef]
|
|
5537
5614
|
);
|
|
5538
|
-
const handlePointerDown = (0,
|
|
5615
|
+
const handlePointerDown = (0, import_react33.useCallback)(
|
|
5539
5616
|
(event) => {
|
|
5540
5617
|
event.preventDefault();
|
|
5541
5618
|
event.stopPropagation();
|
|
5542
5619
|
},
|
|
5543
5620
|
[]
|
|
5544
5621
|
);
|
|
5545
|
-
return /* @__PURE__ */
|
|
5622
|
+
return /* @__PURE__ */ import_react33.default.createElement(ButtonContainer, { $size: size3 }, /* @__PURE__ */ import_react33.default.createElement(
|
|
5546
5623
|
Button,
|
|
5547
5624
|
{
|
|
5548
5625
|
ref: (element) => {
|
|
@@ -5560,7 +5637,7 @@ var InputFieldButton = (0, import_react32.memo)(
|
|
|
5560
5637
|
));
|
|
5561
5638
|
})
|
|
5562
5639
|
);
|
|
5563
|
-
var InputElement = (0,
|
|
5640
|
+
var InputElement = (0, import_react33.forwardRef)(
|
|
5564
5641
|
({
|
|
5565
5642
|
disabled,
|
|
5566
5643
|
readOnly,
|
|
@@ -5578,11 +5655,11 @@ var InputElement = (0, import_react32.forwardRef)(
|
|
|
5578
5655
|
}, ref) => {
|
|
5579
5656
|
const paddingLeft = ($size === "large" ? 10 : $size === "medium" ? 6 : 4) + ($labelSize && $labelPosition === "start" ? 6 + $labelSize : 0);
|
|
5580
5657
|
const paddingRight = ($size === "large" ? 10 : $size === "medium" ? 6 : 1) + ($labelSize && $labelPosition === "end" ? 6 + $labelSize : 0) + ($hasDropdown ? 11 : 0);
|
|
5581
|
-
const memoizedStyles = (0,
|
|
5658
|
+
const memoizedStyles = (0, import_react33.useMemo)(() => ({
|
|
5582
5659
|
paddingLeft: `${paddingLeft}px`,
|
|
5583
5660
|
paddingRight: `${paddingRight}px`
|
|
5584
5661
|
}), [paddingLeft, paddingRight]);
|
|
5585
|
-
return /* @__PURE__ */
|
|
5662
|
+
return /* @__PURE__ */ import_react33.default.createElement(
|
|
5586
5663
|
TextInput_default,
|
|
5587
5664
|
{
|
|
5588
5665
|
value: value ?? "",
|
|
@@ -5596,7 +5673,7 @@ var InputElement = (0, import_react32.forwardRef)(
|
|
|
5596
5673
|
);
|
|
5597
5674
|
}
|
|
5598
5675
|
);
|
|
5599
|
-
var InputFieldInput = (0,
|
|
5676
|
+
var InputFieldInput = (0, import_react33.forwardRef)(function InputFieldInput2({ textAlign, variant, ...rest }, forwardedRef) {
|
|
5600
5677
|
const {
|
|
5601
5678
|
labelPosition,
|
|
5602
5679
|
labelSize,
|
|
@@ -5605,17 +5682,17 @@ var InputFieldInput = (0, import_react32.forwardRef)(function InputFieldInput2({
|
|
|
5605
5682
|
size: size3,
|
|
5606
5683
|
onFocusChange,
|
|
5607
5684
|
setInputRef
|
|
5608
|
-
} = (0,
|
|
5609
|
-
const handleFocusChange = (0,
|
|
5685
|
+
} = (0, import_react33.useContext)(InputFieldContext);
|
|
5686
|
+
const handleFocusChange = (0, import_react33.useCallback)(
|
|
5610
5687
|
(isFocused) => {
|
|
5611
5688
|
onFocusChange(isFocused);
|
|
5612
5689
|
},
|
|
5613
5690
|
[onFocusChange]
|
|
5614
5691
|
);
|
|
5615
|
-
(0,
|
|
5692
|
+
(0, import_react33.useLayoutEffect)(() => {
|
|
5616
5693
|
setInputRef?.(forwardedRef);
|
|
5617
5694
|
}, [forwardedRef, setInputRef]);
|
|
5618
|
-
return /* @__PURE__ */
|
|
5695
|
+
return /* @__PURE__ */ import_react33.default.createElement(
|
|
5619
5696
|
InputElement,
|
|
5620
5697
|
{
|
|
5621
5698
|
ref: forwardedRef,
|
|
@@ -5637,8 +5714,8 @@ var InputFieldTypeahead = (props) => {
|
|
|
5637
5714
|
hasDropdown,
|
|
5638
5715
|
size: size3
|
|
5639
5716
|
// onFocusChange,
|
|
5640
|
-
} = (0,
|
|
5641
|
-
return /* @__PURE__ */
|
|
5717
|
+
} = (0, import_react33.useContext)(InputFieldContext);
|
|
5718
|
+
return /* @__PURE__ */ import_react33.default.createElement(
|
|
5642
5719
|
InputElement,
|
|
5643
5720
|
{
|
|
5644
5721
|
$labelPosition: labelPosition,
|
|
@@ -5649,8 +5726,8 @@ var InputFieldTypeahead = (props) => {
|
|
|
5649
5726
|
value: "",
|
|
5650
5727
|
className: "absolute inset-0 w-full h-full pointer-events-none bg-transparent shadow-none"
|
|
5651
5728
|
},
|
|
5652
|
-
/* @__PURE__ */
|
|
5653
|
-
/* @__PURE__ */
|
|
5729
|
+
/* @__PURE__ */ import_react33.default.createElement("span", { style: { opacity: 0 } }, props.prefix),
|
|
5730
|
+
/* @__PURE__ */ import_react33.default.createElement("span", { style: { opacity: 0.5 } }, props.value.slice(props.prefix.length))
|
|
5654
5731
|
);
|
|
5655
5732
|
};
|
|
5656
5733
|
function parseNumber(value) {
|
|
@@ -5660,8 +5737,8 @@ function InputFieldNumberInput(props) {
|
|
|
5660
5737
|
const { value, placeholder, onNudge, onBlur, ...rest } = props;
|
|
5661
5738
|
const onSubmit = "onSubmit" in props ? props.onSubmit : void 0;
|
|
5662
5739
|
const onChange = "onChange" in props ? props.onChange : void 0;
|
|
5663
|
-
const [internalValue, setInternalValue] = (0,
|
|
5664
|
-
const handleSubmit = (0,
|
|
5740
|
+
const [internalValue, setInternalValue] = (0, import_react33.useState)();
|
|
5741
|
+
const handleSubmit = (0, import_react33.useCallback)(
|
|
5665
5742
|
(value2) => {
|
|
5666
5743
|
const newValue = parseNumber(value2);
|
|
5667
5744
|
if (!isNaN(newValue)) {
|
|
@@ -5670,7 +5747,7 @@ function InputFieldNumberInput(props) {
|
|
|
5670
5747
|
},
|
|
5671
5748
|
[onSubmit]
|
|
5672
5749
|
);
|
|
5673
|
-
const handleKeyDown = (0,
|
|
5750
|
+
const handleKeyDown = (0, import_react33.useCallback)(
|
|
5674
5751
|
(event) => {
|
|
5675
5752
|
const amount = handleNudge(event);
|
|
5676
5753
|
if (!amount) return;
|
|
@@ -5681,7 +5758,7 @@ function InputFieldNumberInput(props) {
|
|
|
5681
5758
|
},
|
|
5682
5759
|
[onNudge]
|
|
5683
5760
|
);
|
|
5684
|
-
const handleChange = (0,
|
|
5761
|
+
const handleChange = (0, import_react33.useCallback)(
|
|
5685
5762
|
(value2) => {
|
|
5686
5763
|
if (value2 === "" || value2 === "-" || value2 === ".") {
|
|
5687
5764
|
setInternalValue(value2);
|
|
@@ -5699,14 +5776,14 @@ function InputFieldNumberInput(props) {
|
|
|
5699
5776
|
},
|
|
5700
5777
|
[onChange]
|
|
5701
5778
|
);
|
|
5702
|
-
const handleBlur = (0,
|
|
5779
|
+
const handleBlur = (0, import_react33.useCallback)(
|
|
5703
5780
|
(event) => {
|
|
5704
5781
|
setInternalValue(void 0);
|
|
5705
5782
|
onBlur?.(event);
|
|
5706
5783
|
},
|
|
5707
5784
|
[onBlur]
|
|
5708
5785
|
);
|
|
5709
|
-
return /* @__PURE__ */
|
|
5786
|
+
return /* @__PURE__ */ import_react33.default.createElement(
|
|
5710
5787
|
InputFieldInput,
|
|
5711
5788
|
{
|
|
5712
5789
|
...rest,
|
|
@@ -5718,7 +5795,7 @@ function InputFieldNumberInput(props) {
|
|
|
5718
5795
|
}
|
|
5719
5796
|
);
|
|
5720
5797
|
}
|
|
5721
|
-
var RootContainer = (0,
|
|
5798
|
+
var RootContainer = (0, import_react33.forwardRef)(({ $width, $flex, className, ...props }, ref) => /* @__PURE__ */ import_react33.default.createElement(
|
|
5722
5799
|
"div",
|
|
5723
5800
|
{
|
|
5724
5801
|
ref,
|
|
@@ -5739,30 +5816,30 @@ function InputFieldRoot({
|
|
|
5739
5816
|
style: style5,
|
|
5740
5817
|
className
|
|
5741
5818
|
}) {
|
|
5742
|
-
const childrenArray =
|
|
5819
|
+
const childrenArray = import_react33.Children.toArray(children2);
|
|
5743
5820
|
const hasDropdown = childrenArray.some(
|
|
5744
|
-
(child) => (0,
|
|
5821
|
+
(child) => (0, import_react33.isValidElement)(child) && child.type === InputFieldDropdownMenu
|
|
5745
5822
|
);
|
|
5746
|
-
const [isFocused, setIsFocused] =
|
|
5747
|
-
const [measuredLabelSize, setMeasuredLabelSize] =
|
|
5748
|
-
const [measuredButtonSize, setMeasuredButtonSize] =
|
|
5749
|
-
const [measuredWidth, setMeasuredWidth] =
|
|
5750
|
-
const handleFocusChange = (0,
|
|
5823
|
+
const [isFocused, setIsFocused] = import_react33.default.useState(false);
|
|
5824
|
+
const [measuredLabelSize, setMeasuredLabelSize] = import_react33.default.useState();
|
|
5825
|
+
const [measuredButtonSize, setMeasuredButtonSize] = import_react33.default.useState();
|
|
5826
|
+
const [measuredWidth, setMeasuredWidth] = import_react33.default.useState();
|
|
5827
|
+
const handleFocusChange = (0, import_react33.useCallback)(
|
|
5751
5828
|
(isFocused2) => {
|
|
5752
5829
|
setIsFocused(isFocused2);
|
|
5753
5830
|
onFocusChange?.(isFocused2);
|
|
5754
5831
|
},
|
|
5755
5832
|
[onFocusChange]
|
|
5756
5833
|
);
|
|
5757
|
-
const [inputRef, setInputRef] =
|
|
5758
|
-
(0,
|
|
5834
|
+
const [inputRef, setInputRef] = import_react33.default.useState();
|
|
5835
|
+
(0, import_react33.useEffect)(() => {
|
|
5759
5836
|
if (inputRef && typeof inputRef !== "function") {
|
|
5760
5837
|
setMeasuredWidth?.(
|
|
5761
5838
|
isFocused ? inputRef?.current?.getBoundingClientRect().width : void 0
|
|
5762
5839
|
);
|
|
5763
5840
|
}
|
|
5764
5841
|
}, [inputRef, isFocused]);
|
|
5765
|
-
const contextValue = (0,
|
|
5842
|
+
const contextValue = (0, import_react33.useMemo)(
|
|
5766
5843
|
() => ({
|
|
5767
5844
|
labelPosition,
|
|
5768
5845
|
labelSize: measuredLabelSize ?? labelSize,
|
|
@@ -5788,7 +5865,7 @@ function InputFieldRoot({
|
|
|
5788
5865
|
inputRef
|
|
5789
5866
|
]
|
|
5790
5867
|
);
|
|
5791
|
-
const rootElement = /* @__PURE__ */
|
|
5868
|
+
const rootElement = /* @__PURE__ */ import_react33.default.createElement(
|
|
5792
5869
|
RootContainer,
|
|
5793
5870
|
{
|
|
5794
5871
|
id,
|
|
@@ -5799,7 +5876,7 @@ function InputFieldRoot({
|
|
|
5799
5876
|
},
|
|
5800
5877
|
children2
|
|
5801
5878
|
);
|
|
5802
|
-
return /* @__PURE__ */
|
|
5879
|
+
return /* @__PURE__ */ import_react33.default.createElement(InputFieldContext.Provider, { value: contextValue }, renderPopoverContent ? /* @__PURE__ */ import_react33.default.createElement(
|
|
5803
5880
|
Popover,
|
|
5804
5881
|
{
|
|
5805
5882
|
open: true,
|
|
@@ -5815,7 +5892,7 @@ function InputFieldRoot({
|
|
|
5815
5892
|
event.stopPropagation();
|
|
5816
5893
|
}
|
|
5817
5894
|
},
|
|
5818
|
-
measuredWidth && /* @__PURE__ */
|
|
5895
|
+
measuredWidth && /* @__PURE__ */ import_react33.default.createElement("div", { className: `flex flex-col w-[${measuredWidth}] hidden` }, renderPopoverContent({ width: measuredWidth }))
|
|
5819
5896
|
) : rootElement);
|
|
5820
5897
|
}
|
|
5821
5898
|
var PrimitiveInputField = ({
|
|
@@ -5823,7 +5900,7 @@ var PrimitiveInputField = ({
|
|
|
5823
5900
|
disabled,
|
|
5824
5901
|
className,
|
|
5825
5902
|
...props
|
|
5826
|
-
}) => /* @__PURE__ */
|
|
5903
|
+
}) => /* @__PURE__ */ import_react33.default.createElement(
|
|
5827
5904
|
"input",
|
|
5828
5905
|
{
|
|
5829
5906
|
className: `flex w-0 flex-1 relative border-none outline-none min-w-0 self-stretch rounded py-1 px-1.5 bg-input-background select-all pointer-events-[all] focus:ring-2 focus:ring-primary focus:z-10 font-sans font-normal text-heading5 placeholder:text-text-disabled ${readOnly ? "text-text-muted" : disabled ? "text-text-disabled" : "text-text"} ${className ?? ""}`,
|
|
@@ -5832,10 +5909,10 @@ var PrimitiveInputField = ({
|
|
|
5832
5909
|
);
|
|
5833
5910
|
var InputField;
|
|
5834
5911
|
((InputField2) => {
|
|
5835
|
-
InputField2.Root = (0,
|
|
5836
|
-
InputField2.Input = (0,
|
|
5837
|
-
InputField2.Typeahead = (0,
|
|
5838
|
-
InputField2.NumberInput = (0,
|
|
5912
|
+
InputField2.Root = (0, import_react33.memo)(InputFieldRoot);
|
|
5913
|
+
InputField2.Input = (0, import_react33.memo)(InputFieldInput);
|
|
5914
|
+
InputField2.Typeahead = (0, import_react33.memo)(InputFieldTypeahead);
|
|
5915
|
+
InputField2.NumberInput = (0, import_react33.memo)(InputFieldNumberInput);
|
|
5839
5916
|
InputField2.DropdownMenu = InputFieldDropdownMenu;
|
|
5840
5917
|
InputField2.Button = InputFieldButton;
|
|
5841
5918
|
InputField2.Label = InputFieldLabel;
|
|
@@ -5854,22 +5931,22 @@ function createDeferredPromise() {
|
|
|
5854
5931
|
});
|
|
5855
5932
|
return { promise, resolve, reject };
|
|
5856
5933
|
}
|
|
5857
|
-
var DialogContext = (0,
|
|
5934
|
+
var DialogContext = (0, import_react34.createContext)(void 0);
|
|
5858
5935
|
var DialogProvider = function DialogProvider2({
|
|
5859
5936
|
children: children2
|
|
5860
5937
|
}) {
|
|
5861
|
-
const [contents, setContents] = (0,
|
|
5938
|
+
const [contents, setContents] = (0, import_react34.useState)();
|
|
5862
5939
|
const isOpen = !!contents;
|
|
5863
|
-
const close = (0,
|
|
5940
|
+
const close = (0, import_react34.useCallback)(() => {
|
|
5864
5941
|
if (!contents) return;
|
|
5865
5942
|
contents.resolve(void 0);
|
|
5866
5943
|
}, [contents]);
|
|
5867
|
-
const submit = (0,
|
|
5944
|
+
const submit = (0, import_react34.useCallback)(() => {
|
|
5868
5945
|
if (!contents || !contents.inputValue) return;
|
|
5869
5946
|
contents.resolve(contents.inputValue);
|
|
5870
5947
|
setContents(void 0);
|
|
5871
5948
|
}, [contents]);
|
|
5872
|
-
const open = (0,
|
|
5949
|
+
const open = (0, import_react34.useCallback)(
|
|
5873
5950
|
(title, inputValue = "") => {
|
|
5874
5951
|
const { promise, resolve } = createDeferredPromise();
|
|
5875
5952
|
setContents({
|
|
@@ -5884,7 +5961,7 @@ var DialogProvider = function DialogProvider2({
|
|
|
5884
5961
|
},
|
|
5885
5962
|
[]
|
|
5886
5963
|
);
|
|
5887
|
-
const handleKeyDown = (0,
|
|
5964
|
+
const handleKeyDown = (0, import_react34.useCallback)(
|
|
5888
5965
|
(event) => {
|
|
5889
5966
|
if (event.key !== "Enter") return;
|
|
5890
5967
|
event.stopPropagation();
|
|
@@ -5893,28 +5970,28 @@ var DialogProvider = function DialogProvider2({
|
|
|
5893
5970
|
},
|
|
5894
5971
|
[submit]
|
|
5895
5972
|
);
|
|
5896
|
-
const inputRef = (0,
|
|
5897
|
-
const dialogRef = (0,
|
|
5898
|
-
const containsElement = (0,
|
|
5973
|
+
const inputRef = (0, import_react34.useRef)(null);
|
|
5974
|
+
const dialogRef = (0, import_react34.useRef)(null);
|
|
5975
|
+
const containsElement = (0, import_react34.useCallback)((element) => {
|
|
5899
5976
|
if (!dialogRef.current) return false;
|
|
5900
5977
|
return dialogRef.current.containsElement(element);
|
|
5901
5978
|
}, []);
|
|
5902
|
-
return /* @__PURE__ */
|
|
5979
|
+
return /* @__PURE__ */ import_react34.default.createElement(import_react34.default.Fragment, null, /* @__PURE__ */ import_react34.default.createElement(
|
|
5903
5980
|
DialogContext.Provider,
|
|
5904
5981
|
{
|
|
5905
|
-
value: (0,
|
|
5982
|
+
value: (0, import_react34.useMemo)(
|
|
5906
5983
|
() => ({ openInputDialog: open, containsElement }),
|
|
5907
5984
|
[containsElement, open]
|
|
5908
5985
|
)
|
|
5909
5986
|
},
|
|
5910
5987
|
children2
|
|
5911
|
-
), /* @__PURE__ */
|
|
5988
|
+
), /* @__PURE__ */ import_react34.default.createElement(
|
|
5912
5989
|
Dialog,
|
|
5913
5990
|
{
|
|
5914
5991
|
ref: dialogRef,
|
|
5915
5992
|
title: contents?.title,
|
|
5916
5993
|
open: isOpen,
|
|
5917
|
-
onOpenChange: (0,
|
|
5994
|
+
onOpenChange: (0, import_react34.useCallback)(
|
|
5918
5995
|
(isOpen2) => {
|
|
5919
5996
|
if (!isOpen2) {
|
|
5920
5997
|
close();
|
|
@@ -5922,14 +5999,14 @@ var DialogProvider = function DialogProvider2({
|
|
|
5922
5999
|
},
|
|
5923
6000
|
[close]
|
|
5924
6001
|
),
|
|
5925
|
-
onOpenAutoFocus: (0,
|
|
6002
|
+
onOpenAutoFocus: (0, import_react34.useCallback)((event) => {
|
|
5926
6003
|
event.stopPropagation();
|
|
5927
6004
|
event.preventDefault();
|
|
5928
6005
|
inputRef.current?.focus();
|
|
5929
6006
|
inputRef.current?.setSelectionRange(0, inputRef.current.value.length);
|
|
5930
6007
|
}, [])
|
|
5931
6008
|
},
|
|
5932
|
-
/* @__PURE__ */
|
|
6009
|
+
/* @__PURE__ */ import_react34.default.createElement(InputField.Root, null, /* @__PURE__ */ import_react34.default.createElement(
|
|
5933
6010
|
InputField.Input,
|
|
5934
6011
|
{
|
|
5935
6012
|
ref: inputRef,
|
|
@@ -5945,12 +6022,12 @@ var DialogProvider = function DialogProvider2({
|
|
|
5945
6022
|
onKeyDown: handleKeyDown
|
|
5946
6023
|
}
|
|
5947
6024
|
)),
|
|
5948
|
-
/* @__PURE__ */
|
|
5949
|
-
/* @__PURE__ */
|
|
6025
|
+
/* @__PURE__ */ import_react34.default.createElement(Spacer.Vertical, { size: 20 }),
|
|
6026
|
+
/* @__PURE__ */ import_react34.default.createElement("div", { className: "flex-1 flex-row items-center" }, /* @__PURE__ */ import_react34.default.createElement(Spacer.Horizontal, null), /* @__PURE__ */ import_react34.default.createElement(Button, { onClick: close }, "Cancel"), /* @__PURE__ */ import_react34.default.createElement(Spacer.Horizontal, { size: 16 }), /* @__PURE__ */ import_react34.default.createElement(Button, { disabled: !contents?.inputValue, onClick: submit }, "Submit"))
|
|
5950
6027
|
));
|
|
5951
6028
|
};
|
|
5952
6029
|
function useDialog() {
|
|
5953
|
-
const value = (0,
|
|
6030
|
+
const value = (0, import_react34.useContext)(DialogContext);
|
|
5954
6031
|
if (!value) {
|
|
5955
6032
|
throw new Error("Missing DialogProvider");
|
|
5956
6033
|
}
|
|
@@ -5965,20 +6042,20 @@ function useDialogContainsElement() {
|
|
|
5965
6042
|
|
|
5966
6043
|
// src/contexts/FloatingWindowContext.tsx
|
|
5967
6044
|
var import_noya_utils5 = require("@noya-app/noya-utils");
|
|
5968
|
-
var
|
|
6045
|
+
var import_react35 = __toESM(require("react"));
|
|
5969
6046
|
var import_react_dom = require("react-dom");
|
|
5970
|
-
var FloatingWindowContext = (0,
|
|
5971
|
-
var CurrentWindowContext = (0,
|
|
6047
|
+
var FloatingWindowContext = (0, import_react35.createContext)(void 0);
|
|
6048
|
+
var CurrentWindowContext = (0, import_react35.createContext)(void 0);
|
|
5972
6049
|
var FloatingWindowProvider = ({
|
|
5973
6050
|
children: children2
|
|
5974
6051
|
}) => {
|
|
5975
|
-
const [windows, setWindows] = (0,
|
|
5976
|
-
const contextValue = (0,
|
|
6052
|
+
const [windows, setWindows] = (0, import_react35.useState)({});
|
|
6053
|
+
const contextValue = (0, import_react35.useMemo)(() => {
|
|
5977
6054
|
const createWindow = (element) => {
|
|
5978
6055
|
const id = (0, import_noya_utils5.uuid)();
|
|
5979
6056
|
setWindows((windows2) => ({
|
|
5980
6057
|
...windows2,
|
|
5981
|
-
[id]: /* @__PURE__ */
|
|
6058
|
+
[id]: /* @__PURE__ */ import_react35.default.createElement(CurrentWindowContext.Provider, { value: { id } }, element)
|
|
5982
6059
|
}));
|
|
5983
6060
|
return id;
|
|
5984
6061
|
};
|
|
@@ -5990,12 +6067,12 @@ var FloatingWindowProvider = ({
|
|
|
5990
6067
|
};
|
|
5991
6068
|
return { createWindow, closeWindow };
|
|
5992
6069
|
}, []);
|
|
5993
|
-
return /* @__PURE__ */
|
|
6070
|
+
return /* @__PURE__ */ import_react35.default.createElement(FloatingWindowContext.Provider, { value: contextValue }, children2, Object.entries(windows).map(
|
|
5994
6071
|
([id, element]) => (0, import_react_dom.createPortal)(element, document.body, id)
|
|
5995
6072
|
));
|
|
5996
6073
|
};
|
|
5997
6074
|
var useFloatingWindowManager = () => {
|
|
5998
|
-
const context = (0,
|
|
6075
|
+
const context = (0, import_react35.useContext)(FloatingWindowContext);
|
|
5999
6076
|
if (!context) {
|
|
6000
6077
|
throw new Error(
|
|
6001
6078
|
"useFloatingWindow must be used within a FloatingWindowProvider"
|
|
@@ -6004,7 +6081,7 @@ var useFloatingWindowManager = () => {
|
|
|
6004
6081
|
return context;
|
|
6005
6082
|
};
|
|
6006
6083
|
var useCurrentFloatingWindowInternal = () => {
|
|
6007
|
-
const context = (0,
|
|
6084
|
+
const context = (0, import_react35.useContext)(CurrentWindowContext);
|
|
6008
6085
|
if (!context) {
|
|
6009
6086
|
throw new Error("useCurrentWindow must be used within a FloatingWindow");
|
|
6010
6087
|
}
|
|
@@ -6012,45 +6089,56 @@ var useCurrentFloatingWindowInternal = () => {
|
|
|
6012
6089
|
};
|
|
6013
6090
|
|
|
6014
6091
|
// src/contexts/DesignSystemConfiguration.tsx
|
|
6015
|
-
var DesignSystemConfigurationContext = (0,
|
|
6092
|
+
var DesignSystemConfigurationContext = (0, import_react36.createContext)({
|
|
6016
6093
|
platform: "key"
|
|
6017
6094
|
});
|
|
6018
|
-
var DesignSystemConfigurationProvider = (0,
|
|
6095
|
+
var DesignSystemConfigurationProvider = (0, import_react36.memo)(
|
|
6019
6096
|
function DesignSystemConfigurationProvider2({
|
|
6020
6097
|
children: children2,
|
|
6021
6098
|
platform
|
|
6022
6099
|
}) {
|
|
6023
|
-
const [internalPlatform, setInternalPlatform] = (0,
|
|
6100
|
+
const [internalPlatform, setInternalPlatform] = (0, import_react36.useState)(
|
|
6024
6101
|
platform ?? "key"
|
|
6025
6102
|
);
|
|
6026
|
-
(0,
|
|
6103
|
+
(0, import_react36.useEffect)(() => {
|
|
6027
6104
|
if (platform !== void 0) return;
|
|
6028
6105
|
if (typeof navigator !== "undefined") {
|
|
6029
6106
|
setInternalPlatform((0, import_noya_keymap2.getCurrentPlatform)(navigator));
|
|
6030
6107
|
}
|
|
6031
6108
|
}, [platform]);
|
|
6032
|
-
const contextValue = (0,
|
|
6109
|
+
const contextValue = (0, import_react36.useMemo)(
|
|
6033
6110
|
() => ({ platform: platform ?? internalPlatform }),
|
|
6034
6111
|
[platform, internalPlatform]
|
|
6035
6112
|
);
|
|
6036
|
-
return /* @__PURE__ */
|
|
6113
|
+
return /* @__PURE__ */ import_react36.default.createElement(DesignSystemConfigurationContext.Provider, { value: contextValue }, /* @__PURE__ */ import_react36.default.createElement(DialogProvider, null, /* @__PURE__ */ import_react36.default.createElement(ToastProvider, null, /* @__PURE__ */ import_react36.default.createElement(FloatingWindowProvider, null, children2))));
|
|
6037
6114
|
}
|
|
6038
6115
|
);
|
|
6039
6116
|
function useDesignSystemConfiguration() {
|
|
6040
|
-
return (0,
|
|
6117
|
+
return (0, import_react36.useContext)(DesignSystemConfigurationContext);
|
|
6041
6118
|
}
|
|
6042
6119
|
|
|
6043
6120
|
// src/utils/withSeparatorElements.ts
|
|
6044
|
-
var
|
|
6121
|
+
var import_react37 = require("react");
|
|
6122
|
+
function flattenChildren(children2, traverseFragments) {
|
|
6123
|
+
return import_react37.Children.toArray(children2).flatMap((child) => {
|
|
6124
|
+
if (traverseFragments && (0, import_react37.isValidElement)(child) && child.type === import_react37.Fragment) {
|
|
6125
|
+
return flattenChildren(child.props.children, traverseFragments);
|
|
6126
|
+
}
|
|
6127
|
+
return child;
|
|
6128
|
+
});
|
|
6129
|
+
}
|
|
6045
6130
|
function createKey(key) {
|
|
6046
6131
|
return `s-${key}`;
|
|
6047
6132
|
}
|
|
6048
|
-
function withSeparatorElements(elements2, separator) {
|
|
6049
|
-
const childrenArray =
|
|
6133
|
+
function withSeparatorElements(elements2, separator, options) {
|
|
6134
|
+
const childrenArray = flattenChildren(
|
|
6135
|
+
elements2,
|
|
6136
|
+
options?.traverseFragments ?? true
|
|
6137
|
+
);
|
|
6050
6138
|
for (let i = childrenArray.length - 1; i > 0; i--) {
|
|
6051
|
-
let sep = typeof separator === "function" ? separator() : (0,
|
|
6052
|
-
if ((0,
|
|
6053
|
-
sep = (0,
|
|
6139
|
+
let sep = typeof separator === "function" ? separator() : (0, import_react37.isValidElement)(separator) ? (0, import_react37.cloneElement)(separator, { key: createKey(i) }) : separator;
|
|
6140
|
+
if ((0, import_react37.isValidElement)(sep) && sep.key == null) {
|
|
6141
|
+
sep = (0, import_react37.cloneElement)(sep, { key: createKey(i) });
|
|
6054
6142
|
}
|
|
6055
6143
|
if (!sep || typeof sep === "boolean") continue;
|
|
6056
6144
|
childrenArray.splice(i, 0, sep);
|
|
@@ -6101,13 +6189,13 @@ function getKeyboardShortcutsForMenuItems(menuItems, onSelect) {
|
|
|
6101
6189
|
menuItems.flatMap(getKeyboardShortcuts).map(([key, value]) => [key, () => onSelect(value)])
|
|
6102
6190
|
);
|
|
6103
6191
|
}
|
|
6104
|
-
var ShortcutElement = ({ children: children2, fixedWidth }) => /* @__PURE__ */
|
|
6105
|
-
var KeyboardShortcut = (0,
|
|
6192
|
+
var ShortcutElement = ({ children: children2, fixedWidth }) => /* @__PURE__ */ import_react38.default.createElement("kbd", { className: cn(textStyles.small, "text-text-disabled", fixedWidth && "w-[0.9rem] text-center") }, children2);
|
|
6193
|
+
var KeyboardShortcut = (0, import_react38.memo)(function KeyboardShortcut2({
|
|
6106
6194
|
shortcut
|
|
6107
6195
|
}) {
|
|
6108
6196
|
const platform = useDesignSystemConfiguration().platform;
|
|
6109
6197
|
const { keys, separator } = (0, import_noya_keymap3.getShortcutDisplayParts)(shortcut, platform);
|
|
6110
|
-
const keyElements = keys.map((key) => /* @__PURE__ */
|
|
6198
|
+
const keyElements = keys.map((key) => /* @__PURE__ */ import_react38.default.createElement(
|
|
6111
6199
|
ShortcutElement,
|
|
6112
6200
|
{
|
|
6113
6201
|
key,
|
|
@@ -6115,14 +6203,14 @@ var KeyboardShortcut = (0, import_react37.memo)(function KeyboardShortcut2({
|
|
|
6115
6203
|
},
|
|
6116
6204
|
key
|
|
6117
6205
|
));
|
|
6118
|
-
return /* @__PURE__ */
|
|
6206
|
+
return /* @__PURE__ */ import_react38.default.createElement(import_react38.default.Fragment, null, separator ? withSeparatorElements(
|
|
6119
6207
|
keyElements,
|
|
6120
|
-
/* @__PURE__ */
|
|
6208
|
+
/* @__PURE__ */ import_react38.default.createElement(ShortcutElement, null, separator)
|
|
6121
6209
|
) : keyElements);
|
|
6122
6210
|
});
|
|
6123
6211
|
|
|
6124
6212
|
// src/components/ContextMenu.tsx
|
|
6125
|
-
var ContextMenuItem2 = (0,
|
|
6213
|
+
var ContextMenuItem2 = (0, import_react39.memo)(function ContextMenuItem3({
|
|
6126
6214
|
value,
|
|
6127
6215
|
children: children2,
|
|
6128
6216
|
onSelect,
|
|
@@ -6133,16 +6221,16 @@ var ContextMenuItem2 = (0, import_react38.memo)(function ContextMenuItem3({
|
|
|
6133
6221
|
items,
|
|
6134
6222
|
shortcut
|
|
6135
6223
|
}) {
|
|
6136
|
-
const handlePointerDown = (0,
|
|
6224
|
+
const handlePointerDown = (0, import_react39.useCallback)(
|
|
6137
6225
|
(event) => event.stopPropagation(),
|
|
6138
6226
|
[]
|
|
6139
6227
|
);
|
|
6140
|
-
const handleSelectItem = (0,
|
|
6228
|
+
const handleSelectItem = (0, import_react39.useCallback)(() => {
|
|
6141
6229
|
if (!value) return;
|
|
6142
6230
|
onSelect(value);
|
|
6143
6231
|
}, [onSelect, value]);
|
|
6144
6232
|
if (checked) {
|
|
6145
|
-
return /* @__PURE__ */
|
|
6233
|
+
return /* @__PURE__ */ import_react39.default.createElement(
|
|
6146
6234
|
RadixContextMenu.CheckboxItem,
|
|
6147
6235
|
{
|
|
6148
6236
|
checked,
|
|
@@ -6150,11 +6238,11 @@ var ContextMenuItem2 = (0, import_react38.memo)(function ContextMenuItem3({
|
|
|
6150
6238
|
onSelect: handleSelectItem,
|
|
6151
6239
|
className: styles.itemStyle({ disabled })
|
|
6152
6240
|
},
|
|
6153
|
-
/* @__PURE__ */
|
|
6241
|
+
/* @__PURE__ */ import_react39.default.createElement(RadixContextMenu.ItemIndicator, { className: styles.itemIndicatorStyle }, /* @__PURE__ */ import_react39.default.createElement(import_noya_icons4.CheckIcon, null)),
|
|
6154
6242
|
children2
|
|
6155
6243
|
);
|
|
6156
6244
|
}
|
|
6157
|
-
const element = /* @__PURE__ */
|
|
6245
|
+
const element = /* @__PURE__ */ import_react39.default.createElement(
|
|
6158
6246
|
RadixContextMenu.Item,
|
|
6159
6247
|
{
|
|
6160
6248
|
className: styles.itemStyle({ disabled }),
|
|
@@ -6162,14 +6250,14 @@ var ContextMenuItem2 = (0, import_react38.memo)(function ContextMenuItem3({
|
|
|
6162
6250
|
onSelect: handleSelectItem,
|
|
6163
6251
|
onPointerDown: handlePointerDown
|
|
6164
6252
|
},
|
|
6165
|
-
indented && /* @__PURE__ */
|
|
6166
|
-
icon && /* @__PURE__ */
|
|
6253
|
+
indented && /* @__PURE__ */ import_react39.default.createElement(Spacer.Horizontal, { size: CHECKBOX_WIDTH - CHECKBOX_RIGHT_INSET }),
|
|
6254
|
+
icon && /* @__PURE__ */ import_react39.default.createElement(import_react39.default.Fragment, null, renderIcon(icon), /* @__PURE__ */ import_react39.default.createElement(Spacer.Horizontal, { size: 8 })),
|
|
6167
6255
|
children2,
|
|
6168
|
-
shortcut && /* @__PURE__ */
|
|
6169
|
-
items && items.length > 0 && /* @__PURE__ */
|
|
6256
|
+
shortcut && /* @__PURE__ */ import_react39.default.createElement(import_react39.default.Fragment, null, /* @__PURE__ */ import_react39.default.createElement(Spacer.Horizontal, null), /* @__PURE__ */ import_react39.default.createElement(Spacer.Horizontal, { size: 24 }), /* @__PURE__ */ import_react39.default.createElement(KeyboardShortcut, { shortcut })),
|
|
6257
|
+
items && items.length > 0 && /* @__PURE__ */ import_react39.default.createElement(import_react39.default.Fragment, null, /* @__PURE__ */ import_react39.default.createElement(Spacer.Horizontal, null), /* @__PURE__ */ import_react39.default.createElement(Spacer.Horizontal, { size: 16 }), /* @__PURE__ */ import_react39.default.createElement(import_noya_icons4.ChevronRightIcon, null))
|
|
6170
6258
|
);
|
|
6171
6259
|
if (items && items.length > 0) {
|
|
6172
|
-
return /* @__PURE__ */
|
|
6260
|
+
return /* @__PURE__ */ import_react39.default.createElement(ContextMenuRoot, { isNested: true, items, onSelect }, element);
|
|
6173
6261
|
} else {
|
|
6174
6262
|
return element;
|
|
6175
6263
|
}
|
|
@@ -6185,19 +6273,19 @@ function ContextMenuRoot({
|
|
|
6185
6273
|
const hasCheckedItem = items.some(
|
|
6186
6274
|
(item) => item !== SEPARATOR_ITEM && item.checked
|
|
6187
6275
|
);
|
|
6188
|
-
const keymap = (0,
|
|
6276
|
+
const keymap = (0, import_react39.useMemo)(
|
|
6189
6277
|
() => isNested || shouldBindKeyboardShortcuts === false ? {} : getKeyboardShortcutsForMenuItems(items, onSelect),
|
|
6190
6278
|
[isNested, items, onSelect, shouldBindKeyboardShortcuts]
|
|
6191
6279
|
);
|
|
6192
6280
|
(0, import_noya_keymap4.useKeyboardShortcuts)(keymap);
|
|
6193
|
-
const onPointerDown = (0,
|
|
6281
|
+
const onPointerDown = (0, import_react39.useCallback)((event) => {
|
|
6194
6282
|
event.preventDefault();
|
|
6195
6283
|
}, []);
|
|
6196
6284
|
const RootComponent = isNested ? RadixContextMenu.Sub : RadixContextMenu.Root;
|
|
6197
6285
|
const TriggerComponent = isNested ? RadixContextMenu.SubTrigger : RadixContextMenu.Trigger;
|
|
6198
6286
|
const ContentComponent = isNested ? RadixContextMenu.SubContent : RadixContextMenu.Content;
|
|
6199
|
-
return /* @__PURE__ */
|
|
6200
|
-
(item, index) => item === SEPARATOR_ITEM ? /* @__PURE__ */
|
|
6287
|
+
return /* @__PURE__ */ import_react39.default.createElement(RootComponent, { onOpenChange }, /* @__PURE__ */ import_react39.default.createElement(TriggerComponent, { asChild: true, onPointerDown }, children2), /* @__PURE__ */ import_react39.default.createElement(RadixContextMenu.Portal, null, /* @__PURE__ */ import_react39.default.createElement(ContentComponent, { className: styles.contentStyle }, items.map(
|
|
6288
|
+
(item, index) => item === SEPARATOR_ITEM ? /* @__PURE__ */ import_react39.default.createElement(RadixContextMenu.Separator, { key: index, className: styles.separatorStyle }) : /* @__PURE__ */ import_react39.default.createElement(
|
|
6201
6289
|
ContextMenuItem2,
|
|
6202
6290
|
{
|
|
6203
6291
|
key: item.value ?? index,
|
|
@@ -6214,18 +6302,18 @@ function ContextMenuRoot({
|
|
|
6214
6302
|
)
|
|
6215
6303
|
))));
|
|
6216
6304
|
}
|
|
6217
|
-
var ContextMenu = (0,
|
|
6305
|
+
var ContextMenu = (0, import_react39.memo)(ContextMenuRoot);
|
|
6218
6306
|
|
|
6219
6307
|
// src/components/Divider.tsx
|
|
6220
|
-
var
|
|
6221
|
-
var Divider = (0,
|
|
6308
|
+
var import_react40 = __toESM(require("react"));
|
|
6309
|
+
var Divider = (0, import_react40.memo)(function Divider2({
|
|
6222
6310
|
variant = "normal",
|
|
6223
6311
|
overflow = 0,
|
|
6224
6312
|
className,
|
|
6225
6313
|
style: style5,
|
|
6226
6314
|
...props
|
|
6227
6315
|
}) {
|
|
6228
|
-
return /* @__PURE__ */
|
|
6316
|
+
return /* @__PURE__ */ import_react40.default.createElement(
|
|
6229
6317
|
"div",
|
|
6230
6318
|
{
|
|
6231
6319
|
className: `
|
|
@@ -6243,13 +6331,13 @@ var Divider = (0, import_react39.memo)(function Divider2({
|
|
|
6243
6331
|
}
|
|
6244
6332
|
);
|
|
6245
6333
|
});
|
|
6246
|
-
var DividerVertical = (0,
|
|
6334
|
+
var DividerVertical = (0, import_react40.memo)(function DividerVertical2({
|
|
6247
6335
|
variant = "normal",
|
|
6248
6336
|
overflow = 0,
|
|
6249
6337
|
className,
|
|
6250
6338
|
...props
|
|
6251
6339
|
}) {
|
|
6252
|
-
return /* @__PURE__ */
|
|
6340
|
+
return /* @__PURE__ */ import_react40.default.createElement(
|
|
6253
6341
|
"div",
|
|
6254
6342
|
{
|
|
6255
6343
|
className: `
|
|
@@ -6266,8 +6354,8 @@ var DividerVertical = (0, import_react39.memo)(function DividerVertical2({
|
|
|
6266
6354
|
|
|
6267
6355
|
// src/components/DraggableMenuButton.tsx
|
|
6268
6356
|
var import_noya_icons5 = require("@noya-app/noya-icons");
|
|
6269
|
-
var
|
|
6270
|
-
var DotButton = (0,
|
|
6357
|
+
var import_react41 = __toESM(require("react"));
|
|
6358
|
+
var DotButton = (0, import_react41.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ import_react41.default.createElement(
|
|
6271
6359
|
"div",
|
|
6272
6360
|
{
|
|
6273
6361
|
ref,
|
|
@@ -6275,7 +6363,7 @@ var DotButton = (0, import_react40.forwardRef)(({ className, ...props }, ref) =>
|
|
|
6275
6363
|
...props
|
|
6276
6364
|
}
|
|
6277
6365
|
));
|
|
6278
|
-
var Trigger5 = (0,
|
|
6366
|
+
var Trigger5 = (0, import_react41.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ import_react41.default.createElement(
|
|
6279
6367
|
"div",
|
|
6280
6368
|
{
|
|
6281
6369
|
ref,
|
|
@@ -6283,14 +6371,14 @@ var Trigger5 = (0, import_react40.forwardRef)(({ className, ...props }, ref) =>
|
|
|
6283
6371
|
...props
|
|
6284
6372
|
}
|
|
6285
6373
|
));
|
|
6286
|
-
var DraggableMenuButton = (0,
|
|
6374
|
+
var DraggableMenuButton = (0, import_react41.memo)(function DraggableMenuButton2({
|
|
6287
6375
|
items,
|
|
6288
6376
|
onSelect,
|
|
6289
6377
|
isVisible = true
|
|
6290
6378
|
}) {
|
|
6291
|
-
const [open, setOpen] = (0,
|
|
6292
|
-
const [downPosition, setDownPosition] = (0,
|
|
6293
|
-
const handlePointerDownCapture = (0,
|
|
6379
|
+
const [open, setOpen] = (0, import_react41.useState)(false);
|
|
6380
|
+
const [downPosition, setDownPosition] = (0, import_react41.useState)(null);
|
|
6381
|
+
const handlePointerDownCapture = (0, import_react41.useCallback)(
|
|
6294
6382
|
(event) => {
|
|
6295
6383
|
if (open) {
|
|
6296
6384
|
setDownPosition(null);
|
|
@@ -6303,7 +6391,7 @@ var DraggableMenuButton = (0, import_react40.memo)(function DraggableMenuButton2
|
|
|
6303
6391
|
},
|
|
6304
6392
|
[open]
|
|
6305
6393
|
);
|
|
6306
|
-
const handlePointerUp = (0,
|
|
6394
|
+
const handlePointerUp = (0, import_react41.useCallback)(
|
|
6307
6395
|
(event) => {
|
|
6308
6396
|
if (open || !downPosition) {
|
|
6309
6397
|
setDownPosition(null);
|
|
@@ -6319,13 +6407,13 @@ var DraggableMenuButton = (0, import_react40.memo)(function DraggableMenuButton2
|
|
|
6319
6407
|
},
|
|
6320
6408
|
[downPosition, open]
|
|
6321
6409
|
);
|
|
6322
|
-
const handleOpenChange = (0,
|
|
6410
|
+
const handleOpenChange = (0, import_react41.useCallback)(
|
|
6323
6411
|
(isOpen) => {
|
|
6324
6412
|
if (!isOpen) setOpen(false);
|
|
6325
6413
|
},
|
|
6326
6414
|
[setOpen]
|
|
6327
6415
|
);
|
|
6328
|
-
return /* @__PURE__ */
|
|
6416
|
+
return /* @__PURE__ */ import_react41.default.createElement(
|
|
6329
6417
|
DotButton,
|
|
6330
6418
|
{
|
|
6331
6419
|
onPointerDownCapture: handlePointerDownCapture,
|
|
@@ -6335,7 +6423,7 @@ var DraggableMenuButton = (0, import_react40.memo)(function DraggableMenuButton2
|
|
|
6335
6423
|
event.preventDefault();
|
|
6336
6424
|
}
|
|
6337
6425
|
},
|
|
6338
|
-
items && onSelect ? /* @__PURE__ */
|
|
6426
|
+
items && onSelect ? /* @__PURE__ */ import_react41.default.createElement(
|
|
6339
6427
|
DropdownMenu,
|
|
6340
6428
|
{
|
|
6341
6429
|
open,
|
|
@@ -6344,13 +6432,13 @@ var DraggableMenuButton = (0, import_react40.memo)(function DraggableMenuButton2
|
|
|
6344
6432
|
onSelect,
|
|
6345
6433
|
shouldBindKeyboardShortcuts: false
|
|
6346
6434
|
},
|
|
6347
|
-
/* @__PURE__ */
|
|
6435
|
+
/* @__PURE__ */ import_react41.default.createElement(Trigger5, null, /* @__PURE__ */ import_react41.default.createElement(
|
|
6348
6436
|
import_noya_icons5.DragHandleDots2Icon,
|
|
6349
6437
|
{
|
|
6350
6438
|
color: isVisible || open ? "var(--icon)" : "transparent"
|
|
6351
6439
|
}
|
|
6352
6440
|
))
|
|
6353
|
-
) : /* @__PURE__ */
|
|
6441
|
+
) : /* @__PURE__ */ import_react41.default.createElement(
|
|
6354
6442
|
import_noya_icons5.DragHandleDots2Icon,
|
|
6355
6443
|
{
|
|
6356
6444
|
color: isVisible || open ? "var(--icon)" : "transparent"
|
|
@@ -6360,7 +6448,7 @@ var DraggableMenuButton = (0, import_react40.memo)(function DraggableMenuButton2
|
|
|
6360
6448
|
});
|
|
6361
6449
|
|
|
6362
6450
|
// src/components/FillInputField.tsx
|
|
6363
|
-
var
|
|
6451
|
+
var import_react45 = __toESM(require("react"));
|
|
6364
6452
|
|
|
6365
6453
|
// ../noya-file-format/src/types.ts
|
|
6366
6454
|
var types_exports = {};
|
|
@@ -6685,25 +6773,25 @@ var ClassValue = /* @__PURE__ */ ((ClassValue2) => {
|
|
|
6685
6773
|
})(ClassValue || {});
|
|
6686
6774
|
|
|
6687
6775
|
// src/components/FillPreviewBackground.tsx
|
|
6688
|
-
var
|
|
6776
|
+
var import_react44 = __toESM(require("react"));
|
|
6689
6777
|
|
|
6690
6778
|
// src/contexts/ImageDataContext.tsx
|
|
6691
|
-
var
|
|
6692
|
-
var ImageDataContext = (0,
|
|
6779
|
+
var import_react42 = __toESM(require("react"));
|
|
6780
|
+
var ImageDataContext = (0, import_react42.createContext)(
|
|
6693
6781
|
void 0
|
|
6694
6782
|
);
|
|
6695
|
-
var ImageDataProvider = (0,
|
|
6783
|
+
var ImageDataProvider = (0, import_react42.memo)(function ImageDataProvider2({
|
|
6696
6784
|
children: children2,
|
|
6697
6785
|
getImageData
|
|
6698
6786
|
}) {
|
|
6699
|
-
const contextValue = (0,
|
|
6787
|
+
const contextValue = (0, import_react42.useMemo)(
|
|
6700
6788
|
() => ({ getImageData: getImageData ?? (() => void 0) }),
|
|
6701
6789
|
[getImageData]
|
|
6702
6790
|
);
|
|
6703
|
-
return /* @__PURE__ */
|
|
6791
|
+
return /* @__PURE__ */ import_react42.default.createElement(ImageDataContext.Provider, { value: contextValue }, children2);
|
|
6704
6792
|
});
|
|
6705
6793
|
function useImageData(ref) {
|
|
6706
|
-
const value = (0,
|
|
6794
|
+
const value = (0, import_react42.useContext)(ImageDataContext);
|
|
6707
6795
|
if (!value) {
|
|
6708
6796
|
throw new Error("Missing ImageDataProvider");
|
|
6709
6797
|
}
|
|
@@ -6711,14 +6799,14 @@ function useImageData(ref) {
|
|
|
6711
6799
|
}
|
|
6712
6800
|
|
|
6713
6801
|
// src/hooks/useObjectURL.ts
|
|
6714
|
-
var
|
|
6802
|
+
var import_react43 = require("react");
|
|
6715
6803
|
function useObjectURL(object) {
|
|
6716
|
-
const objectURL = (0,
|
|
6804
|
+
const objectURL = (0, import_react43.useMemo)(() => {
|
|
6717
6805
|
if (object instanceof Blob) return URL.createObjectURL(object);
|
|
6718
6806
|
const bytes = object instanceof Uint8Array ? object : object !== void 0 ? new Uint8Array(object) : new Uint8Array();
|
|
6719
6807
|
return URL.createObjectURL(new Blob([bytes]));
|
|
6720
6808
|
}, [object]);
|
|
6721
|
-
(0,
|
|
6809
|
+
(0, import_react43.useLayoutEffect)(() => {
|
|
6722
6810
|
return () => URL.revokeObjectURL(objectURL);
|
|
6723
6811
|
}, [objectURL]);
|
|
6724
6812
|
return objectURL;
|
|
@@ -6769,8 +6857,8 @@ var dotsHorizontalSvg = (fillColor) => `
|
|
|
6769
6857
|
<path d='M3.625 7.5C3.625 8.12132 3.12132 8.625 2.5 8.625C1.87868 8.625 1.375 8.12132 1.375 7.5C1.375 6.87868 1.87868 6.375 2.5 6.375C3.12132 6.375 3.625 6.87868 3.625 7.5ZM8.625 7.5C8.625 8.12132 8.12132 8.625 7.5 8.625C6.87868 8.625 6.375 8.12132 6.375 7.5C6.375 6.87868 6.87868 6.375 7.5 6.375C8.12132 6.375 8.625 6.87868 8.625 7.5ZM12.5 8.625C13.1213 8.625 13.625 8.12132 13.625 7.5C13.625 6.87868 13.1213 6.375 12.5 6.375C11.8787 6.375 11.375 6.87868 11.375 7.5C11.375 8.12132 11.8787 8.625 12.5 8.625Z'></path>
|
|
6770
6858
|
</svg>
|
|
6771
6859
|
`;
|
|
6772
|
-
var Background = (0,
|
|
6773
|
-
return /* @__PURE__ */
|
|
6860
|
+
var Background = (0, import_react44.memo)(function Background2({ background: background2 }) {
|
|
6861
|
+
return /* @__PURE__ */ import_react44.default.createElement(
|
|
6774
6862
|
"span",
|
|
6775
6863
|
{
|
|
6776
6864
|
className: cn(
|
|
@@ -6792,7 +6880,7 @@ function getPatternSizeAndPosition(fillType, tileScale) {
|
|
|
6792
6880
|
return "center / 100% 100%";
|
|
6793
6881
|
}
|
|
6794
6882
|
}
|
|
6795
|
-
var PatternPreviewBackground = (0,
|
|
6883
|
+
var PatternPreviewBackground = (0, import_react44.memo)(function PatternPreviewBackground2({
|
|
6796
6884
|
fillType,
|
|
6797
6885
|
tileScale,
|
|
6798
6886
|
imageRef
|
|
@@ -6800,7 +6888,7 @@ var PatternPreviewBackground = (0, import_react43.memo)(function PatternPreviewB
|
|
|
6800
6888
|
const image = useImageData(imageRef);
|
|
6801
6889
|
const url = useObjectURL(image);
|
|
6802
6890
|
const size3 = getPatternSizeAndPosition(fillType, tileScale);
|
|
6803
|
-
const background2 = (0,
|
|
6891
|
+
const background2 = (0, import_react44.useMemo)(
|
|
6804
6892
|
() => [
|
|
6805
6893
|
size3,
|
|
6806
6894
|
`url(${url})`,
|
|
@@ -6808,30 +6896,30 @@ var PatternPreviewBackground = (0, import_react43.memo)(function PatternPreviewB
|
|
|
6808
6896
|
].join(" "),
|
|
6809
6897
|
[fillType, size3, url]
|
|
6810
6898
|
);
|
|
6811
|
-
return /* @__PURE__ */
|
|
6899
|
+
return /* @__PURE__ */ import_react44.default.createElement(Background, { background: background2 });
|
|
6812
6900
|
});
|
|
6813
|
-
var ColorPreviewBackground = (0,
|
|
6901
|
+
var ColorPreviewBackground = (0, import_react44.memo)(function ColorPreviewBackground2({
|
|
6814
6902
|
color
|
|
6815
6903
|
}) {
|
|
6816
|
-
const background2 = (0,
|
|
6817
|
-
return /* @__PURE__ */
|
|
6904
|
+
const background2 = (0, import_react44.useMemo)(() => sketchColorToRgbaString(color), [color]);
|
|
6905
|
+
return /* @__PURE__ */ import_react44.default.createElement(Background, { background: background2 });
|
|
6818
6906
|
});
|
|
6819
|
-
var GradientPreviewBackground = (0,
|
|
6907
|
+
var GradientPreviewBackground = (0, import_react44.memo)(function GradientPreviewBackground2({
|
|
6820
6908
|
gradient
|
|
6821
6909
|
}) {
|
|
6822
|
-
const background2 = (0,
|
|
6910
|
+
const background2 = (0, import_react44.useMemo)(
|
|
6823
6911
|
() => getGradientBackground(gradient.stops, gradient.gradientType, 180),
|
|
6824
6912
|
[gradient.gradientType, gradient.stops]
|
|
6825
6913
|
);
|
|
6826
|
-
return /* @__PURE__ */
|
|
6914
|
+
return /* @__PURE__ */ import_react44.default.createElement(Background, { background: background2 });
|
|
6827
6915
|
});
|
|
6828
6916
|
var background = `center url("data:image/svg+xml;utf8,${dotsHorizontalSvg(
|
|
6829
6917
|
"var(--placeholder-dots)"
|
|
6830
6918
|
)}") no-repeat`;
|
|
6831
|
-
var FillPreviewBackground = (0,
|
|
6919
|
+
var FillPreviewBackground = (0, import_react44.memo)(function FillPreviewBackground2({
|
|
6832
6920
|
value
|
|
6833
6921
|
}) {
|
|
6834
|
-
if (!value) return /* @__PURE__ */
|
|
6922
|
+
if (!value) return /* @__PURE__ */ import_react44.default.createElement(
|
|
6835
6923
|
Background,
|
|
6836
6924
|
{
|
|
6837
6925
|
background
|
|
@@ -6839,12 +6927,12 @@ var FillPreviewBackground = (0, import_react43.memo)(function FillPreviewBackgro
|
|
|
6839
6927
|
);
|
|
6840
6928
|
switch (value._class) {
|
|
6841
6929
|
case "color":
|
|
6842
|
-
return /* @__PURE__ */
|
|
6930
|
+
return /* @__PURE__ */ import_react44.default.createElement(ColorPreviewBackground, { color: value });
|
|
6843
6931
|
case "gradient":
|
|
6844
|
-
return /* @__PURE__ */
|
|
6932
|
+
return /* @__PURE__ */ import_react44.default.createElement(GradientPreviewBackground, { gradient: value });
|
|
6845
6933
|
case "pattern":
|
|
6846
6934
|
if (!value.image) return null;
|
|
6847
|
-
return /* @__PURE__ */
|
|
6935
|
+
return /* @__PURE__ */ import_react44.default.createElement(
|
|
6848
6936
|
PatternPreviewBackground,
|
|
6849
6937
|
{
|
|
6850
6938
|
fillType: value.patternFillType,
|
|
@@ -6856,7 +6944,7 @@ var FillPreviewBackground = (0, import_react43.memo)(function FillPreviewBackgro
|
|
|
6856
6944
|
});
|
|
6857
6945
|
|
|
6858
6946
|
// src/components/FillInputField.tsx
|
|
6859
|
-
var FillButton = (0,
|
|
6947
|
+
var FillButton = (0, import_react45.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ import_react45.default.createElement(
|
|
6860
6948
|
"button",
|
|
6861
6949
|
{
|
|
6862
6950
|
ref,
|
|
@@ -6864,14 +6952,14 @@ var FillButton = (0, import_react44.forwardRef)(({ className, ...props }, ref) =
|
|
|
6864
6952
|
...props
|
|
6865
6953
|
}
|
|
6866
6954
|
));
|
|
6867
|
-
var FillInputField = (0,
|
|
6868
|
-
(0,
|
|
6869
|
-
return /* @__PURE__ */
|
|
6955
|
+
var FillInputField = (0, import_react45.memo)(
|
|
6956
|
+
(0, import_react45.forwardRef)(function FillInputField2({ id, value, ...rest }, ref) {
|
|
6957
|
+
return /* @__PURE__ */ import_react45.default.createElement(FillButton, { ref, id, ...rest }, /* @__PURE__ */ import_react45.default.createElement(FillPreviewBackground, { value }));
|
|
6870
6958
|
})
|
|
6871
6959
|
);
|
|
6872
6960
|
|
|
6873
6961
|
// src/components/FloatingWindow.tsx
|
|
6874
|
-
var
|
|
6962
|
+
var import_react46 = __toESM(require("react"));
|
|
6875
6963
|
var styles2 = {
|
|
6876
6964
|
noSelect: {
|
|
6877
6965
|
userSelect: "none",
|
|
@@ -6964,7 +7052,7 @@ function defaultRenderToolbar({
|
|
|
6964
7052
|
toolbarContent,
|
|
6965
7053
|
onClose
|
|
6966
7054
|
}) {
|
|
6967
|
-
return /* @__PURE__ */
|
|
7055
|
+
return /* @__PURE__ */ import_react46.default.createElement(import_react46.default.Fragment, null, /* @__PURE__ */ import_react46.default.createElement(Small, { className: "flex-1 font-medium text-text" }, title), toolbarContent, /* @__PURE__ */ import_react46.default.createElement(
|
|
6968
7056
|
IconButton,
|
|
6969
7057
|
{
|
|
6970
7058
|
iconName: "Cross3Icon",
|
|
@@ -6989,16 +7077,16 @@ var FloatingWindow = ({
|
|
|
6989
7077
|
toolbarContent,
|
|
6990
7078
|
renderToolbar = defaultRenderToolbar
|
|
6991
7079
|
}) => {
|
|
6992
|
-
const [position, setPosition] = (0,
|
|
6993
|
-
const [size3, setSize] = (0,
|
|
7080
|
+
const [position, setPosition] = (0, import_react46.useState)({ x: initialX, y: initialY });
|
|
7081
|
+
const [size3, setSize] = (0, import_react46.useState)({
|
|
6994
7082
|
width: initialWidth,
|
|
6995
7083
|
height: initialHeight
|
|
6996
7084
|
});
|
|
6997
|
-
const [isDragging, setIsDragging] = (0,
|
|
6998
|
-
const [isResizing, setIsResizing] = (0,
|
|
6999
|
-
const [dragOffset, setDragOffset] = (0,
|
|
7000
|
-
const [resizeDirection, setResizeDirection] = (0,
|
|
7001
|
-
const wrapperRef = (0,
|
|
7085
|
+
const [isDragging, setIsDragging] = (0, import_react46.useState)(false);
|
|
7086
|
+
const [isResizing, setIsResizing] = (0, import_react46.useState)(false);
|
|
7087
|
+
const [dragOffset, setDragOffset] = (0, import_react46.useState)({ x: 0, y: 0 });
|
|
7088
|
+
const [resizeDirection, setResizeDirection] = (0, import_react46.useState)(null);
|
|
7089
|
+
const wrapperRef = (0, import_react46.useRef)(null);
|
|
7002
7090
|
const toggleGlobalTextSelection = (disable) => {
|
|
7003
7091
|
if (disable) {
|
|
7004
7092
|
document.body.style.userSelect = "none";
|
|
@@ -7006,7 +7094,7 @@ var FloatingWindow = ({
|
|
|
7006
7094
|
document.body.style.userSelect = "";
|
|
7007
7095
|
}
|
|
7008
7096
|
};
|
|
7009
|
-
const handleMouseDown = (0,
|
|
7097
|
+
const handleMouseDown = (0, import_react46.useCallback)((e) => {
|
|
7010
7098
|
if (!wrapperRef.current) return;
|
|
7011
7099
|
const rect = wrapperRef.current.getBoundingClientRect();
|
|
7012
7100
|
setDragOffset({
|
|
@@ -7015,7 +7103,7 @@ var FloatingWindow = ({
|
|
|
7015
7103
|
});
|
|
7016
7104
|
setIsDragging(true);
|
|
7017
7105
|
}, []);
|
|
7018
|
-
const handleResizeStart = (0,
|
|
7106
|
+
const handleResizeStart = (0, import_react46.useCallback)(
|
|
7019
7107
|
(direction) => (e) => {
|
|
7020
7108
|
e.stopPropagation();
|
|
7021
7109
|
setIsResizing(true);
|
|
@@ -7024,7 +7112,7 @@ var FloatingWindow = ({
|
|
|
7024
7112
|
},
|
|
7025
7113
|
[]
|
|
7026
7114
|
);
|
|
7027
|
-
const handleMouseMove = (0,
|
|
7115
|
+
const handleMouseMove = (0, import_react46.useCallback)(
|
|
7028
7116
|
(e) => {
|
|
7029
7117
|
if (isDragging) {
|
|
7030
7118
|
setPosition({
|
|
@@ -7078,13 +7166,13 @@ var FloatingWindow = ({
|
|
|
7078
7166
|
minHeight
|
|
7079
7167
|
]
|
|
7080
7168
|
);
|
|
7081
|
-
const handleMouseUp = (0,
|
|
7169
|
+
const handleMouseUp = (0, import_react46.useCallback)((e) => {
|
|
7082
7170
|
setIsDragging(false);
|
|
7083
7171
|
setIsResizing(false);
|
|
7084
7172
|
setResizeDirection(null);
|
|
7085
7173
|
toggleGlobalTextSelection(false);
|
|
7086
7174
|
}, []);
|
|
7087
|
-
|
|
7175
|
+
import_react46.default.useEffect(() => {
|
|
7088
7176
|
document.addEventListener("mousemove", handleMouseMove);
|
|
7089
7177
|
document.addEventListener("mouseup", handleMouseUp);
|
|
7090
7178
|
return () => {
|
|
@@ -7094,11 +7182,11 @@ var FloatingWindow = ({
|
|
|
7094
7182
|
}, [handleMouseMove, handleMouseUp]);
|
|
7095
7183
|
const floatingWindowManager = useFloatingWindowManager();
|
|
7096
7184
|
const currentFloatingWindow = useCurrentFloatingWindowInternal();
|
|
7097
|
-
const handleClose = (0,
|
|
7185
|
+
const handleClose = (0, import_react46.useCallback)(() => {
|
|
7098
7186
|
if (onClose) onClose();
|
|
7099
7187
|
floatingWindowManager.closeWindow(currentFloatingWindow.id);
|
|
7100
7188
|
}, [currentFloatingWindow.id, floatingWindowManager, onClose]);
|
|
7101
|
-
return /* @__PURE__ */
|
|
7189
|
+
return /* @__PURE__ */ import_react46.default.createElement(
|
|
7102
7190
|
"div",
|
|
7103
7191
|
{
|
|
7104
7192
|
ref: wrapperRef,
|
|
@@ -7112,7 +7200,7 @@ var FloatingWindow = ({
|
|
|
7112
7200
|
backgroundColor: "var(--canvas-background)"
|
|
7113
7201
|
}
|
|
7114
7202
|
},
|
|
7115
|
-
/* @__PURE__ */
|
|
7203
|
+
/* @__PURE__ */ import_react46.default.createElement(
|
|
7116
7204
|
"div",
|
|
7117
7205
|
{
|
|
7118
7206
|
style: {
|
|
@@ -7123,9 +7211,9 @@ var FloatingWindow = ({
|
|
|
7123
7211
|
},
|
|
7124
7212
|
renderToolbar({ title, toolbarContent, onClose: handleClose })
|
|
7125
7213
|
),
|
|
7126
|
-
/* @__PURE__ */
|
|
7127
|
-
/* @__PURE__ */
|
|
7128
|
-
Object.entries(resizeHandlePositions).map(([direction, style5]) => /* @__PURE__ */
|
|
7214
|
+
/* @__PURE__ */ import_react46.default.createElement(Divider, null),
|
|
7215
|
+
/* @__PURE__ */ import_react46.default.createElement("div", { style: styles2.content }, children2),
|
|
7216
|
+
Object.entries(resizeHandlePositions).map(([direction, style5]) => /* @__PURE__ */ import_react46.default.createElement(
|
|
7129
7217
|
"div",
|
|
7130
7218
|
{
|
|
7131
7219
|
key: direction,
|
|
@@ -7138,8 +7226,8 @@ var FloatingWindow = ({
|
|
|
7138
7226
|
|
|
7139
7227
|
// src/components/GradientPicker.tsx
|
|
7140
7228
|
var import_noya_colorpicker2 = require("@noya-app/noya-colorpicker");
|
|
7141
|
-
var
|
|
7142
|
-
var GradientPicker = (0,
|
|
7229
|
+
var import_react47 = __toESM(require("react"));
|
|
7230
|
+
var GradientPicker = (0, import_react47.memo)(function GradientPicker2({
|
|
7143
7231
|
value,
|
|
7144
7232
|
selectedStop,
|
|
7145
7233
|
onChangeColor,
|
|
@@ -7148,7 +7236,7 @@ var GradientPicker = (0, import_react46.memo)(function GradientPicker2({
|
|
|
7148
7236
|
onDelete,
|
|
7149
7237
|
onSelectStop
|
|
7150
7238
|
}) {
|
|
7151
|
-
const colorModel = (0,
|
|
7239
|
+
const colorModel = (0, import_react47.useMemo)(
|
|
7152
7240
|
() => ({
|
|
7153
7241
|
defaultColor: { r: 0, g: 0, b: 0, a: 1 },
|
|
7154
7242
|
toHsva: import_noya_colorpicker2.rgbaToHsva,
|
|
@@ -7157,30 +7245,30 @@ var GradientPicker = (0, import_react46.memo)(function GradientPicker2({
|
|
|
7157
7245
|
}),
|
|
7158
7246
|
[]
|
|
7159
7247
|
);
|
|
7160
|
-
const rgbaColor = (0,
|
|
7248
|
+
const rgbaColor = (0, import_react47.useMemo)(
|
|
7161
7249
|
() => sketchColorToRgba(value[selectedStop].color),
|
|
7162
7250
|
[value, selectedStop]
|
|
7163
7251
|
);
|
|
7164
|
-
const handleChangeColor = (0,
|
|
7252
|
+
const handleChangeColor = (0, import_react47.useCallback)(
|
|
7165
7253
|
(value2) => {
|
|
7166
7254
|
onChangeColor(rgbaToSketchColor(value2));
|
|
7167
7255
|
},
|
|
7168
7256
|
[onChangeColor]
|
|
7169
7257
|
);
|
|
7170
|
-
const handleAddGradientStop = (0,
|
|
7258
|
+
const handleAddGradientStop = (0, import_react47.useCallback)(
|
|
7171
7259
|
(value2, position) => {
|
|
7172
7260
|
onAdd(rgbaToSketchColor(value2), position);
|
|
7173
7261
|
},
|
|
7174
7262
|
[onAdd]
|
|
7175
7263
|
);
|
|
7176
|
-
return /* @__PURE__ */
|
|
7264
|
+
return /* @__PURE__ */ import_react47.default.createElement(
|
|
7177
7265
|
import_noya_colorpicker2.ColorPicker,
|
|
7178
7266
|
{
|
|
7179
7267
|
onChange: handleChangeColor,
|
|
7180
7268
|
colorModel,
|
|
7181
7269
|
color: rgbaColor
|
|
7182
7270
|
},
|
|
7183
|
-
/* @__PURE__ */
|
|
7271
|
+
/* @__PURE__ */ import_react47.default.createElement(
|
|
7184
7272
|
import_noya_colorpicker2.Gradient,
|
|
7185
7273
|
{
|
|
7186
7274
|
gradients: value,
|
|
@@ -7191,40 +7279,40 @@ var GradientPicker = (0, import_react46.memo)(function GradientPicker2({
|
|
|
7191
7279
|
onDelete
|
|
7192
7280
|
}
|
|
7193
7281
|
),
|
|
7194
|
-
/* @__PURE__ */
|
|
7195
|
-
/* @__PURE__ */
|
|
7196
|
-
/* @__PURE__ */
|
|
7197
|
-
/* @__PURE__ */
|
|
7198
|
-
/* @__PURE__ */
|
|
7199
|
-
/* @__PURE__ */
|
|
7282
|
+
/* @__PURE__ */ import_react47.default.createElement(Spacer.Vertical, { size: 10 }),
|
|
7283
|
+
/* @__PURE__ */ import_react47.default.createElement(import_noya_colorpicker2.Saturation, null),
|
|
7284
|
+
/* @__PURE__ */ import_react47.default.createElement(Spacer.Vertical, { size: 12 }),
|
|
7285
|
+
/* @__PURE__ */ import_react47.default.createElement(import_noya_colorpicker2.Hue, null),
|
|
7286
|
+
/* @__PURE__ */ import_react47.default.createElement(Spacer.Vertical, { size: 5 }),
|
|
7287
|
+
/* @__PURE__ */ import_react47.default.createElement(import_noya_colorpicker2.Alpha, null)
|
|
7200
7288
|
);
|
|
7201
7289
|
});
|
|
7202
7290
|
|
|
7203
7291
|
// src/components/GridView.tsx
|
|
7204
|
-
var
|
|
7292
|
+
var import_react49 = __toESM(require("react"));
|
|
7205
7293
|
|
|
7206
7294
|
// src/components/ScrollArea.tsx
|
|
7207
7295
|
var RadixScrollArea = __toESM(require("@radix-ui/react-scroll-area"));
|
|
7208
|
-
var
|
|
7209
|
-
var ScrollArea = (0,
|
|
7210
|
-
const [scrollElementRef, setScrollElementRef] = (0,
|
|
7211
|
-
return /* @__PURE__ */
|
|
7296
|
+
var import_react48 = __toESM(require("react"));
|
|
7297
|
+
var ScrollArea = (0, import_react48.memo)(function ScrollArea2({ children: children2 }) {
|
|
7298
|
+
const [scrollElementRef, setScrollElementRef] = (0, import_react48.useState)(null);
|
|
7299
|
+
return /* @__PURE__ */ import_react48.default.createElement("div", { className: "flex-1 min-h-0" }, /* @__PURE__ */ import_react48.default.createElement(RadixScrollArea.Root, { style: { width: "100%", height: "100%" } }, /* @__PURE__ */ import_react48.default.createElement(
|
|
7212
7300
|
RadixScrollArea.Viewport,
|
|
7213
7301
|
{
|
|
7214
7302
|
className: "w-full h-full [&>div]:block",
|
|
7215
|
-
ref: (0,
|
|
7303
|
+
ref: (0, import_react48.useCallback)(
|
|
7216
7304
|
(ref) => setScrollElementRef(ref),
|
|
7217
7305
|
[]
|
|
7218
7306
|
)
|
|
7219
7307
|
},
|
|
7220
7308
|
typeof children2 === "function" ? scrollElementRef ? children2(scrollElementRef) : null : children2
|
|
7221
|
-
), /* @__PURE__ */
|
|
7309
|
+
), /* @__PURE__ */ import_react48.default.createElement(
|
|
7222
7310
|
RadixScrollArea.Scrollbar,
|
|
7223
7311
|
{
|
|
7224
7312
|
orientation: "vertical",
|
|
7225
7313
|
className: "scroll-component flex p-[3px] data-[orientation=vertical]:w-[10px]"
|
|
7226
7314
|
},
|
|
7227
|
-
/* @__PURE__ */
|
|
7315
|
+
/* @__PURE__ */ import_react48.default.createElement(RadixScrollArea.Thumb, { className: "scroll-component flex-1 rounded-[10px] bg-scrollbar" })
|
|
7228
7316
|
)));
|
|
7229
7317
|
});
|
|
7230
7318
|
|
|
@@ -7262,7 +7350,7 @@ var sizes = {
|
|
|
7262
7350
|
}
|
|
7263
7351
|
};
|
|
7264
7352
|
var ItemTitle = ({ showBackground, children: children2 }) => {
|
|
7265
|
-
return /* @__PURE__ */
|
|
7353
|
+
return /* @__PURE__ */ import_react49.default.createElement(
|
|
7266
7354
|
"span",
|
|
7267
7355
|
{
|
|
7268
7356
|
className: `font-sans text-heading5 leading-[1] text-text font-medium select-none whitespace-pre overflow-hidden text-ellipsis ${showBackground && "bg-sidebar-background border border-dividerSubtle rounded-[2px] backdrop-blur-[4px] p-[2px_4px]"}`
|
|
@@ -7271,7 +7359,7 @@ var ItemTitle = ({ showBackground, children: children2 }) => {
|
|
|
7271
7359
|
);
|
|
7272
7360
|
};
|
|
7273
7361
|
var ItemDescription = ({ showBackground, children: children2 }) => {
|
|
7274
|
-
return /* @__PURE__ */
|
|
7362
|
+
return /* @__PURE__ */ import_react49.default.createElement(
|
|
7275
7363
|
"span",
|
|
7276
7364
|
{
|
|
7277
7365
|
className: `font-sans text-heading5 font-normal leading-[1] text-[0.7rem] text-text-muted select-none whitespace-pre overflow-hidden text-ellipsis ${showBackground && "bg-sidebar-background border border-dividerSubtle rounded-[2px] backdrop-blur-[4px] p-[2px_4px]"}`
|
|
@@ -7280,7 +7368,7 @@ var ItemDescription = ({ showBackground, children: children2 }) => {
|
|
|
7280
7368
|
);
|
|
7281
7369
|
};
|
|
7282
7370
|
var SectionTitle = ({ last = false, children: children2 }) => {
|
|
7283
|
-
return /* @__PURE__ */
|
|
7371
|
+
return /* @__PURE__ */ import_react49.default.createElement(
|
|
7284
7372
|
"span",
|
|
7285
7373
|
{
|
|
7286
7374
|
className: `font-sans text-heading3 font-medium user-select-none whitespace-pre overflow-hidden text-ellipsis ${last ? "text-text" : "text-text-muted"}`
|
|
@@ -7288,7 +7376,7 @@ var SectionTitle = ({ last = false, children: children2 }) => {
|
|
|
7288
7376
|
children2
|
|
7289
7377
|
);
|
|
7290
7378
|
};
|
|
7291
|
-
var GridViewItem = (0,
|
|
7379
|
+
var GridViewItem = (0, import_react49.forwardRef)(function GridViewItem2({
|
|
7292
7380
|
id,
|
|
7293
7381
|
title,
|
|
7294
7382
|
subtitle,
|
|
@@ -7304,15 +7392,15 @@ var GridViewItem = (0, import_react48.forwardRef)(function GridViewItem2({
|
|
|
7304
7392
|
onContextMenu,
|
|
7305
7393
|
style: style5
|
|
7306
7394
|
}, forwardedRef) {
|
|
7307
|
-
const [hovered, setHovered] =
|
|
7395
|
+
const [hovered, setHovered] = import_react49.default.useState(false);
|
|
7308
7396
|
const { hoverProps } = useHover({
|
|
7309
7397
|
onHoverChange: (isHovering) => {
|
|
7310
7398
|
onHoverChange?.(isHovering);
|
|
7311
7399
|
setHovered(isHovering);
|
|
7312
7400
|
}
|
|
7313
7401
|
});
|
|
7314
|
-
const { textPosition, bordered, disabled } = (0,
|
|
7315
|
-
const handleClick = (0,
|
|
7402
|
+
const { textPosition, bordered, disabled } = (0, import_react49.useContext)(GridViewContext);
|
|
7403
|
+
const handleClick = (0, import_react49.useCallback)(
|
|
7316
7404
|
(event) => {
|
|
7317
7405
|
event.stopPropagation();
|
|
7318
7406
|
event.preventDefault();
|
|
@@ -7321,7 +7409,7 @@ var GridViewItem = (0, import_react48.forwardRef)(function GridViewItem2({
|
|
|
7321
7409
|
},
|
|
7322
7410
|
[onClick, onPress]
|
|
7323
7411
|
);
|
|
7324
|
-
const handleKeyDown = (0,
|
|
7412
|
+
const handleKeyDown = (0, import_react49.useCallback)(
|
|
7325
7413
|
(event) => {
|
|
7326
7414
|
if (event.key === "Enter" || event.key === " ") {
|
|
7327
7415
|
event.stopPropagation();
|
|
@@ -7333,7 +7421,7 @@ var GridViewItem = (0, import_react48.forwardRef)(function GridViewItem2({
|
|
|
7333
7421
|
},
|
|
7334
7422
|
[onPress]
|
|
7335
7423
|
);
|
|
7336
|
-
let element = /* @__PURE__ */
|
|
7424
|
+
let element = /* @__PURE__ */ import_react49.default.createElement(
|
|
7337
7425
|
"div",
|
|
7338
7426
|
{
|
|
7339
7427
|
className: "flex flex-col relative focus:shadow-[0px_0px_0px_1px_var(--sidebar-background),_0px_0px_0px_3px_var(--primary)] focus:outline-none",
|
|
@@ -7343,7 +7431,7 @@ var GridViewItem = (0, import_react48.forwardRef)(function GridViewItem2({
|
|
|
7343
7431
|
tabIndex: disabled ? void 0 : 0,
|
|
7344
7432
|
onKeyDown: handleKeyDown
|
|
7345
7433
|
},
|
|
7346
|
-
/* @__PURE__ */
|
|
7434
|
+
/* @__PURE__ */ import_react49.default.createElement(
|
|
7347
7435
|
"div",
|
|
7348
7436
|
{
|
|
7349
7437
|
className: cn(
|
|
@@ -7360,25 +7448,25 @@ var GridViewItem = (0, import_react48.forwardRef)(function GridViewItem2({
|
|
|
7360
7448
|
},
|
|
7361
7449
|
children2
|
|
7362
7450
|
),
|
|
7363
|
-
textPosition === "below" && /* @__PURE__ */
|
|
7364
|
-
textPosition === "overlay" && hovered && (title || subtitle) && /* @__PURE__ */
|
|
7365
|
-
loading && /* @__PURE__ */
|
|
7451
|
+
textPosition === "below" && /* @__PURE__ */ import_react49.default.createElement(import_react49.default.Fragment, null, /* @__PURE__ */ import_react49.default.createElement(Spacer.Vertical, { size: 8 }), /* @__PURE__ */ import_react49.default.createElement(ItemTitle, null, title || " "), /* @__PURE__ */ import_react49.default.createElement(ItemDescription, null, subtitle || " ")),
|
|
7452
|
+
textPosition === "overlay" && hovered && (title || subtitle) && /* @__PURE__ */ import_react49.default.createElement("div", { className: "absolute inset-0 flex flex-col justify-end items-start p-1 pointer-events-none truncate g-0.5" }, title && /* @__PURE__ */ import_react49.default.createElement(ItemTitle, { showBackground: true }, title), subtitle && /* @__PURE__ */ import_react49.default.createElement(ItemDescription, { showBackground: true }, subtitle)),
|
|
7453
|
+
loading && /* @__PURE__ */ import_react49.default.createElement("div", { className: "flex flex-col justify-start items-end p-1 pointer-events-none animate-shimmer absolute inset-0 bg-gradient-to-r from-white/0 via-[rgb(226,232,240)]/50 to-white/0 bg-length:200%_100%]" }, /* @__PURE__ */ import_react49.default.createElement(ActivityIndicator, { opacity: 0.5, size: 13 }))
|
|
7366
7454
|
);
|
|
7367
7455
|
if (menuItems && onSelectMenuItem) {
|
|
7368
|
-
element = /* @__PURE__ */
|
|
7456
|
+
element = /* @__PURE__ */ import_react49.default.createElement(ContextMenu, { items: menuItems, onSelect: onSelectMenuItem }, element);
|
|
7369
7457
|
}
|
|
7370
7458
|
if (textPosition === "toolip") {
|
|
7371
|
-
element = /* @__PURE__ */
|
|
7459
|
+
element = /* @__PURE__ */ import_react49.default.createElement(
|
|
7372
7460
|
Tooltip,
|
|
7373
7461
|
{
|
|
7374
|
-
content: /* @__PURE__ */
|
|
7462
|
+
content: /* @__PURE__ */ import_react49.default.createElement("div", { className: "flex flex-col gap-0.5" }, /* @__PURE__ */ import_react49.default.createElement(ItemTitle, null, title), /* @__PURE__ */ import_react49.default.createElement(ItemDescription, null, subtitle))
|
|
7375
7463
|
},
|
|
7376
7464
|
element
|
|
7377
7465
|
);
|
|
7378
7466
|
}
|
|
7379
7467
|
return element;
|
|
7380
7468
|
});
|
|
7381
|
-
var GridViewContext = (0,
|
|
7469
|
+
var GridViewContext = (0, import_react49.createContext)({
|
|
7382
7470
|
size: "small",
|
|
7383
7471
|
textPosition: "below",
|
|
7384
7472
|
bordered: false,
|
|
@@ -7393,7 +7481,7 @@ function GridViewRoot({
|
|
|
7393
7481
|
bordered = false,
|
|
7394
7482
|
disabled = false
|
|
7395
7483
|
}) {
|
|
7396
|
-
const handleClick = (0,
|
|
7484
|
+
const handleClick = (0, import_react49.useCallback)(
|
|
7397
7485
|
(event) => {
|
|
7398
7486
|
event.stopPropagation();
|
|
7399
7487
|
event.preventDefault();
|
|
@@ -7401,7 +7489,7 @@ function GridViewRoot({
|
|
|
7401
7489
|
},
|
|
7402
7490
|
[onClick]
|
|
7403
7491
|
);
|
|
7404
|
-
const contextValue = (0,
|
|
7492
|
+
const contextValue = (0, import_react49.useMemo)(
|
|
7405
7493
|
() => ({
|
|
7406
7494
|
size: size3,
|
|
7407
7495
|
textPosition,
|
|
@@ -7410,34 +7498,34 @@ function GridViewRoot({
|
|
|
7410
7498
|
}),
|
|
7411
7499
|
[bordered, disabled, size3, textPosition]
|
|
7412
7500
|
);
|
|
7413
|
-
return /* @__PURE__ */
|
|
7501
|
+
return /* @__PURE__ */ import_react49.default.createElement(GridViewContext.Provider, { value: contextValue }, /* @__PURE__ */ import_react49.default.createElement("div", { onClick: handleClick, className: `flex flex-col ${scrollable ? "flex-1" : "flex-[0_0_auto]"}` }, scrollable ? /* @__PURE__ */ import_react49.default.createElement(ScrollArea, null, children2) : children2));
|
|
7414
7502
|
}
|
|
7415
7503
|
function GridViewSection({
|
|
7416
7504
|
children: children2,
|
|
7417
7505
|
className
|
|
7418
7506
|
}) {
|
|
7419
|
-
const { size: size3 } = (0,
|
|
7507
|
+
const { size: size3 } = (0, import_react49.useContext)(GridViewContext);
|
|
7420
7508
|
const gapStyle = { gap: `${sizes[size3].gap}px` };
|
|
7421
|
-
return /* @__PURE__ */
|
|
7509
|
+
return /* @__PURE__ */ import_react49.default.createElement("div", { className: cn(className, "text-text grid", `grid-cols-[auto-fill,_minmax(${sizes[size3].itemWidth}px,_1fr)]`), style: gapStyle }, children2);
|
|
7422
7510
|
}
|
|
7423
7511
|
function GridViewSectionHeader({ title }) {
|
|
7424
7512
|
const grouped = title.split("/");
|
|
7425
|
-
return /* @__PURE__ */
|
|
7426
|
-
grouped.map((title2, index) => /* @__PURE__ */
|
|
7427
|
-
/* @__PURE__ */
|
|
7513
|
+
return /* @__PURE__ */ import_react49.default.createElement("div", { className: "px-5" }, /* @__PURE__ */ import_react49.default.createElement(Spacer.Vertical, { size: 24 }), withSeparatorElements(
|
|
7514
|
+
grouped.map((title2, index) => /* @__PURE__ */ import_react49.default.createElement(SectionTitle, { last: index === grouped.length - 1 }, title2)),
|
|
7515
|
+
/* @__PURE__ */ import_react49.default.createElement(SectionTitle, null, " / ")
|
|
7428
7516
|
));
|
|
7429
7517
|
}
|
|
7430
7518
|
var GridView;
|
|
7431
7519
|
((GridView2) => {
|
|
7432
|
-
GridView2.Root = (0,
|
|
7433
|
-
GridView2.Item = (0,
|
|
7434
|
-
GridView2.Section = (0,
|
|
7435
|
-
GridView2.SectionHeader = (0,
|
|
7520
|
+
GridView2.Root = (0, import_react49.memo)(GridViewRoot);
|
|
7521
|
+
GridView2.Item = (0, import_react49.memo)(GridViewItem);
|
|
7522
|
+
GridView2.Section = (0, import_react49.memo)(GridViewSection);
|
|
7523
|
+
GridView2.SectionHeader = (0, import_react49.memo)(GridViewSectionHeader);
|
|
7436
7524
|
})(GridView || (GridView = {}));
|
|
7437
7525
|
|
|
7438
7526
|
// src/components/InputFieldWithCompletions.tsx
|
|
7439
7527
|
var import_noya_utils8 = require("@noya-app/noya-utils");
|
|
7440
|
-
var
|
|
7528
|
+
var import_react52 = __toESM(require("react"));
|
|
7441
7529
|
|
|
7442
7530
|
// src/utils/fuzzyScorer.ts
|
|
7443
7531
|
var import_vscode_fuzzy_scorer = require("vscode-fuzzy-scorer");
|
|
@@ -7512,7 +7600,7 @@ function mergeRanges(ranges) {
|
|
|
7512
7600
|
// src/components/ListView.tsx
|
|
7513
7601
|
var import_noya_utils7 = require("@noya-app/noya-utils");
|
|
7514
7602
|
var import_react_compose_refs2 = require("@radix-ui/react-compose-refs");
|
|
7515
|
-
var
|
|
7603
|
+
var import_react51 = __toESM(require("react"));
|
|
7516
7604
|
|
|
7517
7605
|
// ../../node_modules/react-virtualized/dist/es/ArrowKeyStepper/ArrowKeyStepper.js
|
|
7518
7606
|
var import_classCallCheck4 = __toESM(require_classCallCheck());
|
|
@@ -7522,7 +7610,7 @@ var import_getPrototypeOf2 = __toESM(require_getPrototypeOf());
|
|
|
7522
7610
|
var import_assertThisInitialized2 = __toESM(require_assertThisInitialized());
|
|
7523
7611
|
var import_inherits2 = __toESM(require_inherits());
|
|
7524
7612
|
var import_defineProperty4 = __toESM(require_defineProperty());
|
|
7525
|
-
var
|
|
7613
|
+
var React37 = __toESM(require("react"));
|
|
7526
7614
|
|
|
7527
7615
|
// ../../node_modules/react-lifecycles-compat/react-lifecycles-compat.es.js
|
|
7528
7616
|
function componentWillMount() {
|
|
@@ -7619,7 +7707,7 @@ var import_getPrototypeOf = __toESM(require_getPrototypeOf());
|
|
|
7619
7707
|
var import_assertThisInitialized = __toESM(require_assertThisInitialized());
|
|
7620
7708
|
var import_inherits = __toESM(require_inherits());
|
|
7621
7709
|
var import_defineProperty3 = __toESM(require_defineProperty());
|
|
7622
|
-
var
|
|
7710
|
+
var React36 = __toESM(require("react"));
|
|
7623
7711
|
|
|
7624
7712
|
// ../../node_modules/clsx/dist/clsx.m.js
|
|
7625
7713
|
function r(e) {
|
|
@@ -7658,7 +7746,7 @@ var import_createClass = __toESM(require_createClass());
|
|
|
7658
7746
|
var import_defineProperty = __toESM(require_defineProperty());
|
|
7659
7747
|
|
|
7660
7748
|
// ../../node_modules/react-virtualized/dist/es/Grid/types.js
|
|
7661
|
-
var
|
|
7749
|
+
var React35 = __toESM(require("react"));
|
|
7662
7750
|
var import_prop_types = __toESM(require_prop_types());
|
|
7663
7751
|
var bpfrpt_proptype_CellPosition = process.env.NODE_ENV === "production" ? null : {
|
|
7664
7752
|
"columnIndex": import_prop_types.default.number.isRequired,
|
|
@@ -8818,7 +8906,7 @@ var Grid = (_temp = _class = /* @__PURE__ */ function(_React$PureComponent) {
|
|
|
8818
8906
|
gridStyle.overflowY = totalRowsHeight + horizontalScrollBarSize <= height ? "hidden" : "auto";
|
|
8819
8907
|
var childrenToDisplay = this._childrenToDisplay;
|
|
8820
8908
|
var showNoContentRenderer = childrenToDisplay.length === 0 && height > 0 && width > 0;
|
|
8821
|
-
return
|
|
8909
|
+
return React36.createElement("div", (0, import_extends.default)({
|
|
8822
8910
|
ref: this._setScrollingContainerRef
|
|
8823
8911
|
}, containerProps, {
|
|
8824
8912
|
"aria-label": this.props["aria-label"],
|
|
@@ -8829,7 +8917,7 @@ var Grid = (_temp = _class = /* @__PURE__ */ function(_React$PureComponent) {
|
|
|
8829
8917
|
role,
|
|
8830
8918
|
style: _objectSpread({}, gridStyle, {}, style5),
|
|
8831
8919
|
tabIndex
|
|
8832
|
-
}), childrenToDisplay.length > 0 &&
|
|
8920
|
+
}), childrenToDisplay.length > 0 && React36.createElement("div", {
|
|
8833
8921
|
className: "ReactVirtualized__Grid__innerScrollContainer",
|
|
8834
8922
|
role: containerRole,
|
|
8835
8923
|
style: _objectSpread({
|
|
@@ -9287,7 +9375,7 @@ var Grid = (_temp = _class = /* @__PURE__ */ function(_React$PureComponent) {
|
|
|
9287
9375
|
}
|
|
9288
9376
|
}]);
|
|
9289
9377
|
return Grid2;
|
|
9290
|
-
}(
|
|
9378
|
+
}(React36.PureComponent), (0, import_defineProperty3.default)(_class, "propTypes", process.env.NODE_ENV === "production" ? null : {
|
|
9291
9379
|
"aria-label": import_prop_types3.default.string.isRequired,
|
|
9292
9380
|
"aria-readonly": import_prop_types3.default.bool,
|
|
9293
9381
|
/**
|
|
@@ -9593,7 +9681,7 @@ var ArrowKeyStepper = (_temp2 = _class2 = /* @__PURE__ */ function(_React$PureCo
|
|
|
9593
9681
|
value: function render() {
|
|
9594
9682
|
var _this$props2 = this.props, className = _this$props2.className, children2 = _this$props2.children;
|
|
9595
9683
|
var _this$_getScrollState3 = this._getScrollState(), scrollToColumn = _this$_getScrollState3.scrollToColumn, scrollToRow = _this$_getScrollState3.scrollToRow;
|
|
9596
|
-
return
|
|
9684
|
+
return React37.createElement("div", {
|
|
9597
9685
|
className,
|
|
9598
9686
|
onKeyDown: this._onKeyDown
|
|
9599
9687
|
}, children2({
|
|
@@ -9645,7 +9733,7 @@ var ArrowKeyStepper = (_temp2 = _class2 = /* @__PURE__ */ function(_React$PureCo
|
|
|
9645
9733
|
}
|
|
9646
9734
|
}]);
|
|
9647
9735
|
return ArrowKeyStepper2;
|
|
9648
|
-
}(
|
|
9736
|
+
}(React37.PureComponent), (0, import_defineProperty4.default)(_class2, "propTypes", process.env.NODE_ENV === "production" ? null : {
|
|
9649
9737
|
"children": import_prop_types5.default.func.isRequired,
|
|
9650
9738
|
"className": import_prop_types5.default.string,
|
|
9651
9739
|
"columnCount": import_prop_types5.default.number.isRequired,
|
|
@@ -9674,7 +9762,7 @@ var import_getPrototypeOf3 = __toESM(require_getPrototypeOf());
|
|
|
9674
9762
|
var import_assertThisInitialized3 = __toESM(require_assertThisInitialized());
|
|
9675
9763
|
var import_inherits3 = __toESM(require_inherits());
|
|
9676
9764
|
var import_defineProperty5 = __toESM(require_defineProperty());
|
|
9677
|
-
var
|
|
9765
|
+
var React38 = __toESM(require("react"));
|
|
9678
9766
|
|
|
9679
9767
|
// ../../node_modules/react-virtualized/dist/es/vendor/detectElementResize.js
|
|
9680
9768
|
function createDetectElementResize(nonce, hostWindow) {
|
|
@@ -9953,7 +10041,7 @@ var AutoSizer3 = (_temp3 = _class3 = /* @__PURE__ */ function(_React$Component)
|
|
|
9953
10041
|
outerStyle.width = 0;
|
|
9954
10042
|
childParams.width = width;
|
|
9955
10043
|
}
|
|
9956
|
-
return
|
|
10044
|
+
return React38.createElement("div", {
|
|
9957
10045
|
className,
|
|
9958
10046
|
ref: this._setRef,
|
|
9959
10047
|
style: _objectSpread3({}, outerStyle, {}, style5)
|
|
@@ -9961,7 +10049,7 @@ var AutoSizer3 = (_temp3 = _class3 = /* @__PURE__ */ function(_React$Component)
|
|
|
9961
10049
|
}
|
|
9962
10050
|
}]);
|
|
9963
10051
|
return AutoSizer4;
|
|
9964
|
-
}(
|
|
10052
|
+
}(React38.Component), (0, import_defineProperty5.default)(_class3, "propTypes", process.env.NODE_ENV === "production" ? null : {
|
|
9965
10053
|
/** Function responsible for rendering children.*/
|
|
9966
10054
|
"children": import_prop_types6.default.func.isRequired,
|
|
9967
10055
|
/** Optional custom CSS class name to attach to root AutoSizer element. */
|
|
@@ -9997,7 +10085,7 @@ var import_getPrototypeOf4 = __toESM(require_getPrototypeOf());
|
|
|
9997
10085
|
var import_assertThisInitialized4 = __toESM(require_assertThisInitialized());
|
|
9998
10086
|
var import_inherits4 = __toESM(require_inherits());
|
|
9999
10087
|
var import_defineProperty6 = __toESM(require_defineProperty());
|
|
10000
|
-
var
|
|
10088
|
+
var React39 = __toESM(require("react"));
|
|
10001
10089
|
var import_react_dom2 = require("react-dom");
|
|
10002
10090
|
|
|
10003
10091
|
// ../../node_modules/react-virtualized/dist/es/CellMeasurer/types.js
|
|
@@ -10119,7 +10207,7 @@ var CellMeasurer = (_temp4 = _class4 = /* @__PURE__ */ function(_React$PureCompo
|
|
|
10119
10207
|
}
|
|
10120
10208
|
}]);
|
|
10121
10209
|
return CellMeasurer2;
|
|
10122
|
-
}(
|
|
10210
|
+
}(React39.PureComponent), (0, import_defineProperty6.default)(_class4, "propTypes", process.env.NODE_ENV === "production" ? null : {
|
|
10123
10211
|
"cache": function cache() {
|
|
10124
10212
|
return (typeof bpfrpt_proptype_CellMeasureCache === "function" ? bpfrpt_proptype_CellMeasureCache.isRequired ? bpfrpt_proptype_CellMeasureCache.isRequired : bpfrpt_proptype_CellMeasureCache : import_prop_types8.default.shape(bpfrpt_proptype_CellMeasureCache).isRequired).apply(this, arguments);
|
|
10125
10213
|
},
|
|
@@ -10152,7 +10240,7 @@ var import_assertThisInitialized6 = __toESM(require_assertThisInitialized());
|
|
|
10152
10240
|
var import_inherits6 = __toESM(require_inherits());
|
|
10153
10241
|
var import_defineProperty9 = __toESM(require_defineProperty());
|
|
10154
10242
|
var import_prop_types11 = __toESM(require_prop_types());
|
|
10155
|
-
var
|
|
10243
|
+
var React41 = __toESM(require("react"));
|
|
10156
10244
|
|
|
10157
10245
|
// ../../node_modules/react-virtualized/dist/es/Collection/CollectionView.js
|
|
10158
10246
|
var import_classCallCheck8 = __toESM(require_classCallCheck());
|
|
@@ -10163,7 +10251,7 @@ var import_assertThisInitialized5 = __toESM(require_assertThisInitialized());
|
|
|
10163
10251
|
var import_inherits5 = __toESM(require_inherits());
|
|
10164
10252
|
var import_defineProperty8 = __toESM(require_defineProperty());
|
|
10165
10253
|
var import_prop_types9 = __toESM(require_prop_types());
|
|
10166
|
-
var
|
|
10254
|
+
var React40 = __toESM(require("react"));
|
|
10167
10255
|
function ownKeys4(object, enumerableOnly) {
|
|
10168
10256
|
var keys = Object.keys(object);
|
|
10169
10257
|
if (Object.getOwnPropertySymbols) {
|
|
@@ -10383,7 +10471,7 @@ var CollectionView = /* @__PURE__ */ function(_React$PureComponent) {
|
|
|
10383
10471
|
var horizontalScrollBarSize = totalWidth > width ? this._scrollbarSize : 0;
|
|
10384
10472
|
collectionStyle.overflowX = totalWidth + verticalScrollBarSize <= width ? "hidden" : "auto";
|
|
10385
10473
|
collectionStyle.overflowY = totalHeight + horizontalScrollBarSize <= height ? "hidden" : "auto";
|
|
10386
|
-
return
|
|
10474
|
+
return React40.createElement("div", {
|
|
10387
10475
|
ref: this._setScrollingContainerRef,
|
|
10388
10476
|
"aria-label": this.props["aria-label"],
|
|
10389
10477
|
className: clsx_m_default("ReactVirtualized__Collection", className),
|
|
@@ -10392,7 +10480,7 @@ var CollectionView = /* @__PURE__ */ function(_React$PureComponent) {
|
|
|
10392
10480
|
role: "grid",
|
|
10393
10481
|
style: _objectSpread4({}, collectionStyle, {}, style5),
|
|
10394
10482
|
tabIndex: 0
|
|
10395
|
-
}, cellCount > 0 &&
|
|
10483
|
+
}, cellCount > 0 && React40.createElement("div", {
|
|
10396
10484
|
className: "ReactVirtualized__Collection__innerScrollContainer",
|
|
10397
10485
|
style: {
|
|
10398
10486
|
height: totalHeight,
|
|
@@ -10487,7 +10575,7 @@ var CollectionView = /* @__PURE__ */ function(_React$PureComponent) {
|
|
|
10487
10575
|
}
|
|
10488
10576
|
}]);
|
|
10489
10577
|
return CollectionView2;
|
|
10490
|
-
}(
|
|
10578
|
+
}(React40.PureComponent);
|
|
10491
10579
|
(0, import_defineProperty8.default)(CollectionView, "defaultProps", {
|
|
10492
10580
|
"aria-label": "grid",
|
|
10493
10581
|
horizontalOverscanSize: 0,
|
|
@@ -10830,7 +10918,7 @@ var Collection = /* @__PURE__ */ function(_React$PureComponent) {
|
|
|
10830
10918
|
key: "render",
|
|
10831
10919
|
value: function render() {
|
|
10832
10920
|
var props = (0, import_extends2.default)({}, this.props);
|
|
10833
|
-
return
|
|
10921
|
+
return React41.createElement(CollectionView_default, (0, import_extends2.default)({
|
|
10834
10922
|
cellLayoutManager: this,
|
|
10835
10923
|
isScrollingChange: this._isScrollingChange,
|
|
10836
10924
|
ref: this._setCollectionViewRef
|
|
@@ -10938,7 +11026,7 @@ var Collection = /* @__PURE__ */ function(_React$PureComponent) {
|
|
|
10938
11026
|
}
|
|
10939
11027
|
}]);
|
|
10940
11028
|
return Collection2;
|
|
10941
|
-
}(
|
|
11029
|
+
}(React41.PureComponent);
|
|
10942
11030
|
(0, import_defineProperty9.default)(Collection, "defaultProps", {
|
|
10943
11031
|
"aria-label": "grid",
|
|
10944
11032
|
cellGroupRenderer: defaultCellGroupRenderer
|
|
@@ -11012,7 +11100,7 @@ var import_getPrototypeOf7 = __toESM(require_getPrototypeOf());
|
|
|
11012
11100
|
var import_assertThisInitialized7 = __toESM(require_assertThisInitialized());
|
|
11013
11101
|
var import_inherits7 = __toESM(require_inherits());
|
|
11014
11102
|
var import_prop_types12 = __toESM(require_prop_types());
|
|
11015
|
-
var
|
|
11103
|
+
var React42 = __toESM(require("react"));
|
|
11016
11104
|
var ColumnSizer = /* @__PURE__ */ function(_React$PureComponent) {
|
|
11017
11105
|
(0, import_inherits7.default)(ColumnSizer2, _React$PureComponent);
|
|
11018
11106
|
function ColumnSizer2(props, context) {
|
|
@@ -11065,7 +11153,7 @@ var ColumnSizer = /* @__PURE__ */ function(_React$PureComponent) {
|
|
|
11065
11153
|
}
|
|
11066
11154
|
}]);
|
|
11067
11155
|
return ColumnSizer2;
|
|
11068
|
-
}(
|
|
11156
|
+
}(React42.PureComponent);
|
|
11069
11157
|
ColumnSizer.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
11070
11158
|
/**
|
|
11071
11159
|
* Function responsible for rendering a virtualized Grid.
|
|
@@ -11096,7 +11184,7 @@ var import_getPrototypeOf8 = __toESM(require_getPrototypeOf());
|
|
|
11096
11184
|
var import_assertThisInitialized8 = __toESM(require_assertThisInitialized());
|
|
11097
11185
|
var import_inherits8 = __toESM(require_inherits());
|
|
11098
11186
|
var import_defineProperty10 = __toESM(require_defineProperty());
|
|
11099
|
-
var
|
|
11187
|
+
var React43 = __toESM(require("react"));
|
|
11100
11188
|
var import_prop_types13 = __toESM(require_prop_types());
|
|
11101
11189
|
var InfiniteLoader = /* @__PURE__ */ function(_React$PureComponent) {
|
|
11102
11190
|
(0, import_inherits8.default)(InfiniteLoader2, _React$PureComponent);
|
|
@@ -11189,7 +11277,7 @@ var InfiniteLoader = /* @__PURE__ */ function(_React$PureComponent) {
|
|
|
11189
11277
|
}
|
|
11190
11278
|
}]);
|
|
11191
11279
|
return InfiniteLoader2;
|
|
11192
|
-
}(
|
|
11280
|
+
}(React43.PureComponent);
|
|
11193
11281
|
(0, import_defineProperty10.default)(InfiniteLoader, "defaultProps", {
|
|
11194
11282
|
minimumBatchSize: 10,
|
|
11195
11283
|
rowCount: 0,
|
|
@@ -11310,10 +11398,10 @@ var import_getPrototypeOf9 = __toESM(require_getPrototypeOf());
|
|
|
11310
11398
|
var import_assertThisInitialized9 = __toESM(require_assertThisInitialized());
|
|
11311
11399
|
var import_inherits9 = __toESM(require_inherits());
|
|
11312
11400
|
var import_defineProperty11 = __toESM(require_defineProperty());
|
|
11313
|
-
var
|
|
11401
|
+
var React45 = __toESM(require("react"));
|
|
11314
11402
|
|
|
11315
11403
|
// ../../node_modules/react-virtualized/dist/es/List/types.js
|
|
11316
|
-
var
|
|
11404
|
+
var React44 = __toESM(require("react"));
|
|
11317
11405
|
var import_prop_types14 = __toESM(require_prop_types());
|
|
11318
11406
|
var bpfrpt_proptype_RowRendererParams = process.env.NODE_ENV === "production" ? null : {
|
|
11319
11407
|
"index": import_prop_types14.default.number.isRequired,
|
|
@@ -11485,7 +11573,7 @@ var List = (_temp5 = _class5 = /* @__PURE__ */ function(_React$PureComponent) {
|
|
|
11485
11573
|
value: function render() {
|
|
11486
11574
|
var _this$props = this.props, className = _this$props.className, noRowsRenderer4 = _this$props.noRowsRenderer, scrollToIndex = _this$props.scrollToIndex, width = _this$props.width;
|
|
11487
11575
|
var classNames = clsx_m_default("ReactVirtualized__List", className);
|
|
11488
|
-
return
|
|
11576
|
+
return React45.createElement(Grid_default, (0, import_extends3.default)({}, this.props, {
|
|
11489
11577
|
autoContainerWidth: true,
|
|
11490
11578
|
cellRenderer: this._cellRenderer,
|
|
11491
11579
|
className: classNames,
|
|
@@ -11500,7 +11588,7 @@ var List = (_temp5 = _class5 = /* @__PURE__ */ function(_React$PureComponent) {
|
|
|
11500
11588
|
}
|
|
11501
11589
|
}]);
|
|
11502
11590
|
return List2;
|
|
11503
|
-
}(
|
|
11591
|
+
}(React45.PureComponent), (0, import_defineProperty11.default)(_class5, "propTypes", process.env.NODE_ENV === "production" ? null : {
|
|
11504
11592
|
"aria-label": import_prop_types15.default.string,
|
|
11505
11593
|
/**
|
|
11506
11594
|
* Removes fixed height from the scrollingContainer so that the total height
|
|
@@ -11586,7 +11674,7 @@ var import_getPrototypeOf10 = __toESM(require_getPrototypeOf());
|
|
|
11586
11674
|
var import_assertThisInitialized10 = __toESM(require_assertThisInitialized());
|
|
11587
11675
|
var import_inherits10 = __toESM(require_inherits());
|
|
11588
11676
|
var import_defineProperty13 = __toESM(require_defineProperty());
|
|
11589
|
-
var
|
|
11677
|
+
var React46 = __toESM(require("react"));
|
|
11590
11678
|
|
|
11591
11679
|
// ../../node_modules/react-virtualized/dist/es/Masonry/PositionCache.js
|
|
11592
11680
|
var import_slicedToArray = __toESM(require_slicedToArray());
|
|
@@ -12361,7 +12449,7 @@ var Masonry = (_temp6 = _class6 = /* @__PURE__ */ function(_React$PureComponent)
|
|
|
12361
12449
|
}
|
|
12362
12450
|
this._startIndex = startIndex;
|
|
12363
12451
|
this._stopIndex = stopIndex;
|
|
12364
|
-
return
|
|
12452
|
+
return React46.createElement("div", {
|
|
12365
12453
|
ref: this._setScrollingContainerRef,
|
|
12366
12454
|
"aria-label": this.props["aria-label"],
|
|
12367
12455
|
className: clsx_m_default("ReactVirtualized__Masonry", className),
|
|
@@ -12380,7 +12468,7 @@ var Masonry = (_temp6 = _class6 = /* @__PURE__ */ function(_React$PureComponent)
|
|
|
12380
12468
|
willChange: "transform"
|
|
12381
12469
|
}, style5),
|
|
12382
12470
|
tabIndex
|
|
12383
|
-
},
|
|
12471
|
+
}, React46.createElement("div", {
|
|
12384
12472
|
className: "ReactVirtualized__Masonry__innerScrollContainer",
|
|
12385
12473
|
style: {
|
|
12386
12474
|
width: "100%",
|
|
@@ -12470,7 +12558,7 @@ var Masonry = (_temp6 = _class6 = /* @__PURE__ */ function(_React$PureComponent)
|
|
|
12470
12558
|
}
|
|
12471
12559
|
}]);
|
|
12472
12560
|
return Masonry2;
|
|
12473
|
-
}(
|
|
12561
|
+
}(React46.PureComponent), (0, import_defineProperty13.default)(_class6, "propTypes", process.env.NODE_ENV === "production" ? null : {
|
|
12474
12562
|
"autoHeight": import_prop_types16.default.bool.isRequired,
|
|
12475
12563
|
"cellCount": import_prop_types16.default.number.isRequired,
|
|
12476
12564
|
"cellMeasurerCache": function cellMeasurerCache() {
|
|
@@ -12544,7 +12632,7 @@ var import_assertThisInitialized11 = __toESM(require_assertThisInitialized());
|
|
|
12544
12632
|
var import_inherits11 = __toESM(require_inherits());
|
|
12545
12633
|
var import_defineProperty15 = __toESM(require_defineProperty());
|
|
12546
12634
|
var import_prop_types17 = __toESM(require_prop_types());
|
|
12547
|
-
var
|
|
12635
|
+
var React47 = __toESM(require("react"));
|
|
12548
12636
|
|
|
12549
12637
|
// ../../node_modules/react-virtualized/dist/es/MultiGrid/CellMeasurerCacheDecorator.js
|
|
12550
12638
|
var import_classCallCheck17 = __toESM(require_classCallCheck());
|
|
@@ -12687,7 +12775,7 @@ var MultiGrid = /* @__PURE__ */ function(_React$PureComponent) {
|
|
|
12687
12775
|
var rowIndex = _ref.rowIndex, rest = (0, import_objectWithoutProperties2.default)(_ref, ["rowIndex"]);
|
|
12688
12776
|
var _this$props = _this.props, cellRenderer3 = _this$props.cellRenderer, fixedRowCount = _this$props.fixedRowCount, rowCount = _this$props.rowCount;
|
|
12689
12777
|
if (rowIndex === rowCount - fixedRowCount) {
|
|
12690
|
-
return
|
|
12778
|
+
return React47.createElement("div", {
|
|
12691
12779
|
key: rest.key,
|
|
12692
12780
|
style: _objectSpread6({}, rest.style, {
|
|
12693
12781
|
height: SCROLLBAR_SIZE_BUFFER
|
|
@@ -12713,7 +12801,7 @@ var MultiGrid = /* @__PURE__ */ function(_React$PureComponent) {
|
|
|
12713
12801
|
var columnIndex = _ref3.columnIndex, rest = (0, import_objectWithoutProperties2.default)(_ref3, ["columnIndex"]);
|
|
12714
12802
|
var _this$props3 = _this.props, cellRenderer3 = _this$props3.cellRenderer, columnCount = _this$props3.columnCount, fixedColumnCount = _this$props3.fixedColumnCount;
|
|
12715
12803
|
if (columnIndex === columnCount - fixedColumnCount) {
|
|
12716
|
-
return
|
|
12804
|
+
return React47.createElement("div", {
|
|
12717
12805
|
key: rest.key,
|
|
12718
12806
|
style: _objectSpread6({}, rest.style, {
|
|
12719
12807
|
width: SCROLLBAR_SIZE_BUFFER
|
|
@@ -12902,14 +12990,14 @@ var MultiGrid = /* @__PURE__ */ function(_React$PureComponent) {
|
|
|
12902
12990
|
return null;
|
|
12903
12991
|
}
|
|
12904
12992
|
var _this$state4 = this.state, scrollLeft = _this$state4.scrollLeft, scrollTop = _this$state4.scrollTop;
|
|
12905
|
-
return
|
|
12993
|
+
return React47.createElement("div", {
|
|
12906
12994
|
style: this._containerOuterStyle
|
|
12907
|
-
},
|
|
12995
|
+
}, React47.createElement("div", {
|
|
12908
12996
|
style: this._containerTopStyle
|
|
12909
12997
|
}, this._renderTopLeftGrid(rest), this._renderTopRightGrid(_objectSpread6({}, rest, {
|
|
12910
12998
|
onScroll: onScroll7,
|
|
12911
12999
|
scrollLeft
|
|
12912
|
-
}))),
|
|
13000
|
+
}))), React47.createElement("div", {
|
|
12913
13001
|
style: this._containerBottomStyle
|
|
12914
13002
|
}, this._renderBottomLeftGrid(_objectSpread6({}, rest, {
|
|
12915
13003
|
onScroll: onScroll7,
|
|
@@ -13091,7 +13179,7 @@ var MultiGrid = /* @__PURE__ */ function(_React$PureComponent) {
|
|
|
13091
13179
|
return null;
|
|
13092
13180
|
}
|
|
13093
13181
|
var additionalRowCount = showVerticalScrollbar ? 1 : 0, height = this._getBottomGridHeight(props), width = this._getLeftGridWidth(props), scrollbarSize2 = this.state.showVerticalScrollbar ? this.state.scrollbarSize : 0, gridWidth = hideBottomLeftGridScrollbar ? width + scrollbarSize2 : width;
|
|
13094
|
-
var bottomLeftGrid =
|
|
13182
|
+
var bottomLeftGrid = React47.createElement(Grid_default, (0, import_extends4.default)({}, props, {
|
|
13095
13183
|
cellRenderer: this._cellRendererBottomLeftGrid,
|
|
13096
13184
|
className: this.props.classNameBottomLeftGrid,
|
|
13097
13185
|
columnCount: fixedColumnCount,
|
|
@@ -13106,7 +13194,7 @@ var MultiGrid = /* @__PURE__ */ function(_React$PureComponent) {
|
|
|
13106
13194
|
width: gridWidth
|
|
13107
13195
|
}));
|
|
13108
13196
|
if (hideBottomLeftGridScrollbar) {
|
|
13109
|
-
return
|
|
13197
|
+
return React47.createElement("div", {
|
|
13110
13198
|
className: "BottomLeftGrid_ScrollWrapper",
|
|
13111
13199
|
style: _objectSpread6({}, this._bottomLeftGridStyle, {
|
|
13112
13200
|
height,
|
|
@@ -13121,7 +13209,7 @@ var MultiGrid = /* @__PURE__ */ function(_React$PureComponent) {
|
|
|
13121
13209
|
key: "_renderBottomRightGrid",
|
|
13122
13210
|
value: function _renderBottomRightGrid(props) {
|
|
13123
13211
|
var columnCount = props.columnCount, fixedColumnCount = props.fixedColumnCount, fixedRowCount = props.fixedRowCount, rowCount = props.rowCount, scrollToColumn = props.scrollToColumn, scrollToRow = props.scrollToRow;
|
|
13124
|
-
return
|
|
13212
|
+
return React47.createElement(Grid_default, (0, import_extends4.default)({}, props, {
|
|
13125
13213
|
cellRenderer: this._cellRendererBottomRightGrid,
|
|
13126
13214
|
className: this.props.classNameBottomRightGrid,
|
|
13127
13215
|
columnCount: Math.max(0, columnCount - fixedColumnCount),
|
|
@@ -13146,7 +13234,7 @@ var MultiGrid = /* @__PURE__ */ function(_React$PureComponent) {
|
|
|
13146
13234
|
if (!fixedColumnCount || !fixedRowCount) {
|
|
13147
13235
|
return null;
|
|
13148
13236
|
}
|
|
13149
|
-
return
|
|
13237
|
+
return React47.createElement(Grid_default, (0, import_extends4.default)({}, props, {
|
|
13150
13238
|
className: this.props.classNameTopLeftGrid,
|
|
13151
13239
|
columnCount: fixedColumnCount,
|
|
13152
13240
|
height: this._getTopGridHeight(props),
|
|
@@ -13173,7 +13261,7 @@ var MultiGrid = /* @__PURE__ */ function(_React$PureComponent) {
|
|
|
13173
13261
|
left: 0
|
|
13174
13262
|
});
|
|
13175
13263
|
}
|
|
13176
|
-
var topRightGrid =
|
|
13264
|
+
var topRightGrid = React47.createElement(Grid_default, (0, import_extends4.default)({}, props, {
|
|
13177
13265
|
cellRenderer: this._cellRendererTopRightGrid,
|
|
13178
13266
|
className: this.props.classNameTopRightGrid,
|
|
13179
13267
|
columnCount: Math.max(0, columnCount - fixedColumnCount) + additionalColumnCount,
|
|
@@ -13189,7 +13277,7 @@ var MultiGrid = /* @__PURE__ */ function(_React$PureComponent) {
|
|
|
13189
13277
|
width
|
|
13190
13278
|
}));
|
|
13191
13279
|
if (hideTopRightGridScrollbar) {
|
|
13192
|
-
return
|
|
13280
|
+
return React47.createElement("div", {
|
|
13193
13281
|
className: "TopRightGrid_ScrollWrapper",
|
|
13194
13282
|
style: _objectSpread6({}, this._topRightGridStyle, {
|
|
13195
13283
|
height,
|
|
@@ -13213,7 +13301,7 @@ var MultiGrid = /* @__PURE__ */ function(_React$PureComponent) {
|
|
|
13213
13301
|
}
|
|
13214
13302
|
}]);
|
|
13215
13303
|
return MultiGrid2;
|
|
13216
|
-
}(
|
|
13304
|
+
}(React47.PureComponent);
|
|
13217
13305
|
(0, import_defineProperty15.default)(MultiGrid, "defaultProps", {
|
|
13218
13306
|
classNameBottomLeftGrid: "",
|
|
13219
13307
|
classNameBottomRightGrid: "",
|
|
@@ -13261,7 +13349,7 @@ var import_getPrototypeOf12 = __toESM(require_getPrototypeOf());
|
|
|
13261
13349
|
var import_assertThisInitialized12 = __toESM(require_assertThisInitialized());
|
|
13262
13350
|
var import_inherits12 = __toESM(require_inherits());
|
|
13263
13351
|
var import_prop_types18 = __toESM(require_prop_types());
|
|
13264
|
-
var
|
|
13352
|
+
var React48 = __toESM(require("react"));
|
|
13265
13353
|
var ScrollSync = /* @__PURE__ */ function(_React$PureComponent) {
|
|
13266
13354
|
(0, import_inherits12.default)(ScrollSync2, _React$PureComponent);
|
|
13267
13355
|
function ScrollSync2(props, context) {
|
|
@@ -13309,7 +13397,7 @@ var ScrollSync = /* @__PURE__ */ function(_React$PureComponent) {
|
|
|
13309
13397
|
}
|
|
13310
13398
|
}]);
|
|
13311
13399
|
return ScrollSync2;
|
|
13312
|
-
}(
|
|
13400
|
+
}(React48.PureComponent);
|
|
13313
13401
|
ScrollSync.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
13314
13402
|
/**
|
|
13315
13403
|
* Function responsible for rendering 2 or more virtualized components.
|
|
@@ -13409,11 +13497,11 @@ function defaultCellRenderer(_ref) {
|
|
|
13409
13497
|
}
|
|
13410
13498
|
|
|
13411
13499
|
// ../../node_modules/react-virtualized/dist/es/Table/defaultHeaderRowRenderer.js
|
|
13412
|
-
var
|
|
13500
|
+
var React49 = __toESM(require("react"));
|
|
13413
13501
|
var import_prop_types20 = __toESM(require_prop_types());
|
|
13414
13502
|
function defaultHeaderRowRenderer(_ref) {
|
|
13415
13503
|
var className = _ref.className, columns = _ref.columns, style5 = _ref.style;
|
|
13416
|
-
return
|
|
13504
|
+
return React49.createElement("div", {
|
|
13417
13505
|
className,
|
|
13418
13506
|
role: "row",
|
|
13419
13507
|
style: style5
|
|
@@ -13422,11 +13510,11 @@ function defaultHeaderRowRenderer(_ref) {
|
|
|
13422
13510
|
defaultHeaderRowRenderer.propTypes = process.env.NODE_ENV === "production" ? null : bpfrpt_proptype_HeaderRowRendererParams === import_prop_types20.default.any ? {} : bpfrpt_proptype_HeaderRowRendererParams;
|
|
13423
13511
|
|
|
13424
13512
|
// ../../node_modules/react-virtualized/dist/es/Table/defaultHeaderRenderer.js
|
|
13425
|
-
var
|
|
13513
|
+
var React51 = __toESM(require("react"));
|
|
13426
13514
|
|
|
13427
13515
|
// ../../node_modules/react-virtualized/dist/es/Table/SortIndicator.js
|
|
13428
13516
|
var import_prop_types21 = __toESM(require_prop_types());
|
|
13429
|
-
var
|
|
13517
|
+
var React50 = __toESM(require("react"));
|
|
13430
13518
|
|
|
13431
13519
|
// ../../node_modules/react-virtualized/dist/es/Table/SortDirection.js
|
|
13432
13520
|
var SortDirection = {
|
|
@@ -13450,16 +13538,16 @@ function SortIndicator(_ref) {
|
|
|
13450
13538
|
"ReactVirtualized__Table__sortableHeaderIcon--ASC": sortDirection === SortDirection_default.ASC,
|
|
13451
13539
|
"ReactVirtualized__Table__sortableHeaderIcon--DESC": sortDirection === SortDirection_default.DESC
|
|
13452
13540
|
});
|
|
13453
|
-
return
|
|
13541
|
+
return React50.createElement("svg", {
|
|
13454
13542
|
className: classNames,
|
|
13455
13543
|
width: 18,
|
|
13456
13544
|
height: 18,
|
|
13457
13545
|
viewBox: "0 0 24 24"
|
|
13458
|
-
}, sortDirection === SortDirection_default.ASC ?
|
|
13546
|
+
}, sortDirection === SortDirection_default.ASC ? React50.createElement("path", {
|
|
13459
13547
|
d: "M7 14l5-5 5 5z"
|
|
13460
|
-
}) :
|
|
13548
|
+
}) : React50.createElement("path", {
|
|
13461
13549
|
d: "M7 10l5 5 5-5z"
|
|
13462
|
-
}),
|
|
13550
|
+
}), React50.createElement("path", {
|
|
13463
13551
|
d: "M0 0h24v24H0z",
|
|
13464
13552
|
fill: "none"
|
|
13465
13553
|
}));
|
|
@@ -13473,13 +13561,13 @@ var import_prop_types22 = __toESM(require_prop_types());
|
|
|
13473
13561
|
function defaultHeaderRenderer(_ref) {
|
|
13474
13562
|
var dataKey = _ref.dataKey, label = _ref.label, sortBy = _ref.sortBy, sortDirection = _ref.sortDirection;
|
|
13475
13563
|
var showSortIndicator = sortBy === dataKey;
|
|
13476
|
-
var children2 = [
|
|
13564
|
+
var children2 = [React51.createElement("span", {
|
|
13477
13565
|
className: "ReactVirtualized__Table__headerTruncatedText",
|
|
13478
13566
|
key: "label",
|
|
13479
13567
|
title: typeof label === "string" ? label : null
|
|
13480
13568
|
}, label)];
|
|
13481
13569
|
if (showSortIndicator) {
|
|
13482
|
-
children2.push(
|
|
13570
|
+
children2.push(React51.createElement(SortIndicator, {
|
|
13483
13571
|
key: "SortIndicator",
|
|
13484
13572
|
sortDirection
|
|
13485
13573
|
}));
|
|
@@ -13490,7 +13578,7 @@ defaultHeaderRenderer.propTypes = process.env.NODE_ENV === "production" ? null :
|
|
|
13490
13578
|
|
|
13491
13579
|
// ../../node_modules/react-virtualized/dist/es/Table/defaultRowRenderer.js
|
|
13492
13580
|
var import_extends5 = __toESM(require_extends());
|
|
13493
|
-
var
|
|
13581
|
+
var React52 = __toESM(require("react"));
|
|
13494
13582
|
var import_prop_types23 = __toESM(require_prop_types());
|
|
13495
13583
|
function defaultRowRenderer(_ref) {
|
|
13496
13584
|
var className = _ref.className, columns = _ref.columns, index = _ref.index, key = _ref.key, onRowClick = _ref.onRowClick, onRowDoubleClick = _ref.onRowDoubleClick, onRowMouseOut = _ref.onRowMouseOut, onRowMouseOver = _ref.onRowMouseOver, onRowRightClick = _ref.onRowRightClick, rowData4 = _ref.rowData, style5 = _ref.style;
|
|
@@ -13546,7 +13634,7 @@ function defaultRowRenderer(_ref) {
|
|
|
13546
13634
|
};
|
|
13547
13635
|
}
|
|
13548
13636
|
}
|
|
13549
|
-
return
|
|
13637
|
+
return React52.createElement("div", (0, import_extends5.default)({}, a11yProps, {
|
|
13550
13638
|
className,
|
|
13551
13639
|
key,
|
|
13552
13640
|
role: "row",
|
|
@@ -13562,7 +13650,7 @@ var import_getPrototypeOf13 = __toESM(require_getPrototypeOf());
|
|
|
13562
13650
|
var import_inherits13 = __toESM(require_inherits());
|
|
13563
13651
|
var import_defineProperty16 = __toESM(require_defineProperty());
|
|
13564
13652
|
var import_prop_types24 = __toESM(require_prop_types());
|
|
13565
|
-
var
|
|
13653
|
+
var React53 = __toESM(require("react"));
|
|
13566
13654
|
var Column = /* @__PURE__ */ function(_React$Component) {
|
|
13567
13655
|
(0, import_inherits13.default)(Column3, _React$Component);
|
|
13568
13656
|
function Column3() {
|
|
@@ -13570,7 +13658,7 @@ var Column = /* @__PURE__ */ function(_React$Component) {
|
|
|
13570
13658
|
return (0, import_possibleConstructorReturn13.default)(this, (0, import_getPrototypeOf13.default)(Column3).apply(this, arguments));
|
|
13571
13659
|
}
|
|
13572
13660
|
return Column3;
|
|
13573
|
-
}(
|
|
13661
|
+
}(React53.Component);
|
|
13574
13662
|
(0, import_defineProperty16.default)(Column, "defaultProps", {
|
|
13575
13663
|
cellDataGetter: defaultCellDataGetter,
|
|
13576
13664
|
cellRenderer: defaultCellRenderer,
|
|
@@ -13640,7 +13728,7 @@ var import_assertThisInitialized13 = __toESM(require_assertThisInitialized());
|
|
|
13640
13728
|
var import_inherits14 = __toESM(require_inherits());
|
|
13641
13729
|
var import_defineProperty17 = __toESM(require_defineProperty());
|
|
13642
13730
|
var import_prop_types25 = __toESM(require_prop_types());
|
|
13643
|
-
var
|
|
13731
|
+
var React54 = __toESM(require("react"));
|
|
13644
13732
|
var import_react_dom3 = require("react-dom");
|
|
13645
13733
|
function ownKeys7(object, enumerableOnly) {
|
|
13646
13734
|
var keys = Object.keys(object);
|
|
@@ -13808,16 +13896,16 @@ var Table = /* @__PURE__ */ function(_React$PureComponent) {
|
|
|
13808
13896
|
index: -1
|
|
13809
13897
|
}) : rowStyle;
|
|
13810
13898
|
this._cachedColumnStyles = [];
|
|
13811
|
-
|
|
13899
|
+
React54.Children.toArray(children2).forEach(function(column, index) {
|
|
13812
13900
|
var flexStyles = _this2._getFlexStyleForColumn(column, column.props.style);
|
|
13813
13901
|
_this2._cachedColumnStyles[index] = _objectSpread7({
|
|
13814
13902
|
overflow: "hidden"
|
|
13815
13903
|
}, flexStyles);
|
|
13816
13904
|
});
|
|
13817
|
-
return
|
|
13905
|
+
return React54.createElement("div", {
|
|
13818
13906
|
"aria-label": this.props["aria-label"],
|
|
13819
13907
|
"aria-labelledby": this.props["aria-labelledby"],
|
|
13820
|
-
"aria-colcount":
|
|
13908
|
+
"aria-colcount": React54.Children.toArray(children2).length,
|
|
13821
13909
|
"aria-rowcount": this.props.rowCount,
|
|
13822
13910
|
className: clsx_m_default("ReactVirtualized__Table", className),
|
|
13823
13911
|
id,
|
|
@@ -13832,7 +13920,7 @@ var Table = /* @__PURE__ */ function(_React$PureComponent) {
|
|
|
13832
13920
|
paddingRight: scrollbarWidth,
|
|
13833
13921
|
width
|
|
13834
13922
|
}, rowStyleObject)
|
|
13835
|
-
}),
|
|
13923
|
+
}), React54.createElement(Grid_default, (0, import_extends6.default)({}, this.props, {
|
|
13836
13924
|
"aria-readonly": null,
|
|
13837
13925
|
autoContainerWidth: true,
|
|
13838
13926
|
className: clsx_m_default("ReactVirtualized__Table__Grid", gridClassName),
|
|
@@ -13883,7 +13971,7 @@ var Table = /* @__PURE__ */ function(_React$PureComponent) {
|
|
|
13883
13971
|
};
|
|
13884
13972
|
var style5 = this._cachedColumnStyles[columnIndex];
|
|
13885
13973
|
var title = typeof renderedCell === "string" ? renderedCell : null;
|
|
13886
|
-
return
|
|
13974
|
+
return React54.createElement("div", {
|
|
13887
13975
|
"aria-colindex": columnIndex + 1,
|
|
13888
13976
|
"aria-describedby": id,
|
|
13889
13977
|
className: clsx_m_default("ReactVirtualized__Table__rowColumn", className),
|
|
@@ -13944,7 +14032,7 @@ var Table = /* @__PURE__ */ function(_React$PureComponent) {
|
|
|
13944
14032
|
if (sortBy === dataKey) {
|
|
13945
14033
|
headerAriaSort = sortDirection === SortDirection_default.ASC ? "ascending" : "descending";
|
|
13946
14034
|
}
|
|
13947
|
-
return
|
|
14035
|
+
return React54.createElement("div", {
|
|
13948
14036
|
"aria-label": headerAriaLabel,
|
|
13949
14037
|
"aria-sort": headerAriaSort,
|
|
13950
14038
|
className: classNames,
|
|
@@ -13973,7 +14061,7 @@ var Table = /* @__PURE__ */ function(_React$PureComponent) {
|
|
|
13973
14061
|
var rowData4 = rowGetter({
|
|
13974
14062
|
index
|
|
13975
14063
|
});
|
|
13976
|
-
var columns =
|
|
14064
|
+
var columns = React54.Children.toArray(children2).map(function(column, columnIndex) {
|
|
13977
14065
|
return _this3._createColumn({
|
|
13978
14066
|
column,
|
|
13979
14067
|
columnIndex,
|
|
@@ -14031,7 +14119,7 @@ var Table = /* @__PURE__ */ function(_React$PureComponent) {
|
|
|
14031
14119
|
value: function _getHeaderColumns() {
|
|
14032
14120
|
var _this4 = this;
|
|
14033
14121
|
var _this$props4 = this.props, children2 = _this$props4.children, disableHeader = _this$props4.disableHeader;
|
|
14034
|
-
var items = disableHeader ? [] :
|
|
14122
|
+
var items = disableHeader ? [] : React54.Children.toArray(children2);
|
|
14035
14123
|
return items.map(function(column, index) {
|
|
14036
14124
|
return _this4._createHeader({
|
|
14037
14125
|
column,
|
|
@@ -14085,7 +14173,7 @@ var Table = /* @__PURE__ */ function(_React$PureComponent) {
|
|
|
14085
14173
|
}
|
|
14086
14174
|
}]);
|
|
14087
14175
|
return Table2;
|
|
14088
|
-
}(
|
|
14176
|
+
}(React54.PureComponent);
|
|
14089
14177
|
(0, import_defineProperty17.default)(Table, "defaultProps", {
|
|
14090
14178
|
disableHeader: false,
|
|
14091
14179
|
estimatedRowSize: 30,
|
|
@@ -14121,7 +14209,7 @@ Table.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
14121
14209
|
autoHeight: import_prop_types25.default.bool,
|
|
14122
14210
|
/** One or more Columns describing the data displayed in this row */
|
|
14123
14211
|
children: function children(props) {
|
|
14124
|
-
var children2 =
|
|
14212
|
+
var children2 = React54.Children.toArray(props.children);
|
|
14125
14213
|
for (var i = 0; i < children2.length; i++) {
|
|
14126
14214
|
var childType = children2[i].type;
|
|
14127
14215
|
if (childType !== Column && !(childType.prototype instanceof Column)) {
|
|
@@ -14288,7 +14376,7 @@ var import_getPrototypeOf15 = __toESM(require_getPrototypeOf());
|
|
|
14288
14376
|
var import_assertThisInitialized14 = __toESM(require_assertThisInitialized());
|
|
14289
14377
|
var import_inherits15 = __toESM(require_inherits());
|
|
14290
14378
|
var import_defineProperty18 = __toESM(require_defineProperty());
|
|
14291
|
-
var
|
|
14379
|
+
var React55 = __toESM(require("react"));
|
|
14292
14380
|
var ReactDOM = __toESM(require("react-dom"));
|
|
14293
14381
|
|
|
14294
14382
|
// ../../node_modules/react-virtualized/dist/es/WindowScroller/utils/onScroll.js
|
|
@@ -14608,7 +14696,7 @@ var WindowScroller = (_temp7 = _class7 = /* @__PURE__ */ function(_React$PureCom
|
|
|
14608
14696
|
}
|
|
14609
14697
|
}]);
|
|
14610
14698
|
return WindowScroller2;
|
|
14611
|
-
}(
|
|
14699
|
+
}(React55.PureComponent), (0, import_defineProperty18.default)(_class7, "propTypes", process.env.NODE_ENV === "production" ? null : {
|
|
14612
14700
|
/**
|
|
14613
14701
|
* Function responsible for rendering children.
|
|
14614
14702
|
* This function should implement the following signature:
|
|
@@ -14672,7 +14760,7 @@ function mergeEventHandlers(...handlerMaps) {
|
|
|
14672
14760
|
// src/components/Sortable.tsx
|
|
14673
14761
|
var import_core = require("@dnd-kit/core");
|
|
14674
14762
|
var import_sortable = require("@dnd-kit/sortable");
|
|
14675
|
-
var
|
|
14763
|
+
var import_react50 = __toESM(require("react"));
|
|
14676
14764
|
var import_react_dom4 = require("react-dom");
|
|
14677
14765
|
var normalizeListDestinationIndex = (index, position) => {
|
|
14678
14766
|
return position === "above" ? index : index + 1;
|
|
@@ -14685,7 +14773,7 @@ var defaultAcceptsDrop = (sourceIndex, destinationIndex, position) => {
|
|
|
14685
14773
|
}
|
|
14686
14774
|
return true;
|
|
14687
14775
|
};
|
|
14688
|
-
var SortableItemContext = (0,
|
|
14776
|
+
var SortableItemContext = (0, import_react50.createContext)({
|
|
14689
14777
|
keys: [],
|
|
14690
14778
|
position: { x: 0, y: 0 },
|
|
14691
14779
|
acceptsDrop: defaultAcceptsDrop,
|
|
@@ -14707,7 +14795,7 @@ function SortableItem({
|
|
|
14707
14795
|
disabled,
|
|
14708
14796
|
children: children2
|
|
14709
14797
|
}) {
|
|
14710
|
-
const { keys, position, acceptsDrop, setActivatorEvent, axis } = (0,
|
|
14798
|
+
const { keys, position, acceptsDrop, setActivatorEvent, axis } = (0, import_react50.useContext)(SortableItemContext);
|
|
14711
14799
|
const sortable = (0, import_sortable.useSortable)({ id, disabled });
|
|
14712
14800
|
const {
|
|
14713
14801
|
active,
|
|
@@ -14727,7 +14815,7 @@ function SortableItem({
|
|
|
14727
14815
|
const eventY = activatorEvent?.clientY ?? 0;
|
|
14728
14816
|
const offsetLeft = eventX + position.x;
|
|
14729
14817
|
const offsetTop = eventY + position.y;
|
|
14730
|
-
const ref = (0,
|
|
14818
|
+
const ref = (0, import_react50.useCallback)((node) => setNodeRef(node), [setNodeRef]);
|
|
14731
14819
|
return children2({
|
|
14732
14820
|
ref,
|
|
14733
14821
|
...attributes,
|
|
@@ -14758,22 +14846,22 @@ function SortableRoot({
|
|
|
14758
14846
|
}
|
|
14759
14847
|
})
|
|
14760
14848
|
);
|
|
14761
|
-
const [activeIndex, setActiveIndex] = (0,
|
|
14762
|
-
const activatorEvent = (0,
|
|
14763
|
-
const setActivatorEvent = (0,
|
|
14849
|
+
const [activeIndex, setActiveIndex] = (0, import_react50.useState)();
|
|
14850
|
+
const activatorEvent = (0, import_react50.useRef)(null);
|
|
14851
|
+
const setActivatorEvent = (0, import_react50.useCallback)((event) => {
|
|
14764
14852
|
activatorEvent.current = event;
|
|
14765
14853
|
}, []);
|
|
14766
|
-
const [position, setPosition] = (0,
|
|
14767
|
-
const handleDragStart = (0,
|
|
14854
|
+
const [position, setPosition] = (0, import_react50.useState)({ x: 0, y: 0 });
|
|
14855
|
+
const handleDragStart = (0, import_react50.useCallback)(
|
|
14768
14856
|
(event) => {
|
|
14769
14857
|
setActiveIndex(keys.indexOf(event.active.id));
|
|
14770
14858
|
},
|
|
14771
14859
|
[keys]
|
|
14772
14860
|
);
|
|
14773
|
-
const handleDragMove = (0,
|
|
14861
|
+
const handleDragMove = (0, import_react50.useCallback)((event) => {
|
|
14774
14862
|
setPosition({ ...event.delta });
|
|
14775
14863
|
}, []);
|
|
14776
|
-
const handleDragEnd = (0,
|
|
14864
|
+
const handleDragEnd = (0, import_react50.useCallback)(
|
|
14777
14865
|
(event) => {
|
|
14778
14866
|
const { active, over } = event;
|
|
14779
14867
|
setActiveIndex(void 0);
|
|
@@ -14799,14 +14887,14 @@ function SortableRoot({
|
|
|
14799
14887
|
},
|
|
14800
14888
|
[acceptsDrop, axis, keys, onMoveItem, position.x, position.y]
|
|
14801
14889
|
);
|
|
14802
|
-
const [mounted, setMounted] = (0,
|
|
14803
|
-
(0,
|
|
14890
|
+
const [mounted, setMounted] = (0, import_react50.useState)(false);
|
|
14891
|
+
(0, import_react50.useEffect)(() => {
|
|
14804
14892
|
setMounted(true);
|
|
14805
14893
|
}, []);
|
|
14806
|
-
return /* @__PURE__ */
|
|
14894
|
+
return /* @__PURE__ */ import_react50.default.createElement(
|
|
14807
14895
|
SortableItemContext.Provider,
|
|
14808
14896
|
{
|
|
14809
|
-
value: (0,
|
|
14897
|
+
value: (0, import_react50.useMemo)(
|
|
14810
14898
|
() => ({
|
|
14811
14899
|
keys,
|
|
14812
14900
|
acceptsDrop,
|
|
@@ -14817,7 +14905,7 @@ function SortableRoot({
|
|
|
14817
14905
|
[acceptsDrop, axis, keys, position, setActivatorEvent]
|
|
14818
14906
|
)
|
|
14819
14907
|
},
|
|
14820
|
-
/* @__PURE__ */
|
|
14908
|
+
/* @__PURE__ */ import_react50.default.createElement(
|
|
14821
14909
|
import_core.DndContext,
|
|
14822
14910
|
{
|
|
14823
14911
|
sensors,
|
|
@@ -14826,9 +14914,9 @@ function SortableRoot({
|
|
|
14826
14914
|
onDragMove: handleDragMove,
|
|
14827
14915
|
onDragEnd: handleDragEnd
|
|
14828
14916
|
},
|
|
14829
|
-
/* @__PURE__ */
|
|
14917
|
+
/* @__PURE__ */ import_react50.default.createElement(import_sortable.SortableContext, { items: keys, strategy: import_sortable.verticalListSortingStrategy }, children2),
|
|
14830
14918
|
mounted && renderOverlay && (0, import_react_dom4.createPortal)(
|
|
14831
|
-
/* @__PURE__ */
|
|
14919
|
+
/* @__PURE__ */ import_react50.default.createElement(import_core.DragOverlay, { dropAnimation: null }, activeIndex !== void 0 && activeIndex >= 0 && renderOverlay(activeIndex)),
|
|
14832
14920
|
document.body
|
|
14833
14921
|
)
|
|
14834
14922
|
)
|
|
@@ -14836,18 +14924,18 @@ function SortableRoot({
|
|
|
14836
14924
|
}
|
|
14837
14925
|
var Sortable;
|
|
14838
14926
|
((Sortable2) => {
|
|
14839
|
-
Sortable2.Item = (0,
|
|
14840
|
-
Sortable2.Root = (0,
|
|
14927
|
+
Sortable2.Item = (0, import_react50.memo)(SortableItem);
|
|
14928
|
+
Sortable2.Root = (0, import_react50.memo)(SortableRoot);
|
|
14841
14929
|
})(Sortable || (Sortable = {}));
|
|
14842
14930
|
|
|
14843
14931
|
// src/components/ListView.tsx
|
|
14844
14932
|
var ROW_HEIGHT = 31;
|
|
14845
14933
|
var SECTION_HEADER_LABEL_HEIGHT = 27;
|
|
14846
|
-
var ListViewDraggingContext = (0,
|
|
14934
|
+
var ListViewDraggingContext = (0, import_react51.createContext)({
|
|
14847
14935
|
indentation: 12
|
|
14848
14936
|
});
|
|
14849
14937
|
ListViewDraggingContext.displayName = "ListViewDraggingContext";
|
|
14850
|
-
var ListRowContext = (0,
|
|
14938
|
+
var ListRowContext = (0, import_react51.createContext)({
|
|
14851
14939
|
marginType: "none",
|
|
14852
14940
|
selectedPosition: "only",
|
|
14853
14941
|
sortable: false,
|
|
@@ -14865,7 +14953,7 @@ var ListViewRowTitle = ({
|
|
|
14865
14953
|
className,
|
|
14866
14954
|
children: children2,
|
|
14867
14955
|
...props
|
|
14868
|
-
}) => /* @__PURE__ */
|
|
14956
|
+
}) => /* @__PURE__ */ import_react51.default.createElement(
|
|
14869
14957
|
"span",
|
|
14870
14958
|
{
|
|
14871
14959
|
className: `flex-1 overflow-hidden text-ellipsis whitespace-pre ${className ?? ""}`,
|
|
@@ -14873,8 +14961,8 @@ var ListViewRowTitle = ({
|
|
|
14873
14961
|
},
|
|
14874
14962
|
children2
|
|
14875
14963
|
);
|
|
14876
|
-
var ListViewEditableRowTitleElement = (0,
|
|
14877
|
-
({ className, ...props }, forwardedRef) => /* @__PURE__ */
|
|
14964
|
+
var ListViewEditableRowTitleElement = (0, import_react51.forwardRef)(
|
|
14965
|
+
({ className, ...props }, forwardedRef) => /* @__PURE__ */ import_react51.default.createElement(
|
|
14878
14966
|
InputField.Input,
|
|
14879
14967
|
{
|
|
14880
14968
|
ref: forwardedRef,
|
|
@@ -14889,8 +14977,8 @@ function ListViewEditableRowTitle({
|
|
|
14889
14977
|
autoFocus,
|
|
14890
14978
|
placeholder
|
|
14891
14979
|
}) {
|
|
14892
|
-
const inputRef = (0,
|
|
14893
|
-
(0,
|
|
14980
|
+
const inputRef = (0, import_react51.useRef)(null);
|
|
14981
|
+
(0, import_react51.useLayoutEffect)(() => {
|
|
14894
14982
|
const element = inputRef.current;
|
|
14895
14983
|
if (!element || !autoFocus) return;
|
|
14896
14984
|
element.focus();
|
|
@@ -14898,7 +14986,7 @@ function ListViewEditableRowTitle({
|
|
|
14898
14986
|
element.select();
|
|
14899
14987
|
}, 0);
|
|
14900
14988
|
}, [autoFocus]);
|
|
14901
|
-
return /* @__PURE__ */
|
|
14989
|
+
return /* @__PURE__ */ import_react51.default.createElement(
|
|
14902
14990
|
ListViewEditableRowTitleElement,
|
|
14903
14991
|
{
|
|
14904
14992
|
ref: inputRef,
|
|
@@ -14931,7 +15019,7 @@ var theme = {
|
|
|
14931
15019
|
dividerSubtle: "var(--divider-subtle)"
|
|
14932
15020
|
}
|
|
14933
15021
|
};
|
|
14934
|
-
var RowContainer = (0,
|
|
15022
|
+
var RowContainer = (0, import_react51.forwardRef)(
|
|
14935
15023
|
({
|
|
14936
15024
|
className,
|
|
14937
15025
|
$marginType,
|
|
@@ -14951,7 +15039,7 @@ var RowContainer = (0, import_react50.forwardRef)(
|
|
|
14951
15039
|
...props
|
|
14952
15040
|
}, ref) => {
|
|
14953
15041
|
const margin = getPositionMargin($marginType);
|
|
14954
|
-
return /* @__PURE__ */
|
|
15042
|
+
return /* @__PURE__ */ import_react51.default.createElement(
|
|
14955
15043
|
"div",
|
|
14956
15044
|
{
|
|
14957
15045
|
ref,
|
|
@@ -15027,7 +15115,7 @@ var RowContainer = (0, import_react50.forwardRef)(
|
|
|
15027
15115
|
);
|
|
15028
15116
|
}
|
|
15029
15117
|
);
|
|
15030
|
-
var ListViewDragIndicatorElement = (0,
|
|
15118
|
+
var ListViewDragIndicatorElement = (0, import_react51.forwardRef)(
|
|
15031
15119
|
({
|
|
15032
15120
|
className,
|
|
15033
15121
|
$relativeDropPosition,
|
|
@@ -15037,7 +15125,7 @@ var ListViewDragIndicatorElement = (0, import_react50.forwardRef)(
|
|
|
15037
15125
|
style: style5,
|
|
15038
15126
|
...props
|
|
15039
15127
|
}, ref) => {
|
|
15040
|
-
return /* @__PURE__ */
|
|
15128
|
+
return /* @__PURE__ */ import_react51.default.createElement(
|
|
15041
15129
|
"div",
|
|
15042
15130
|
{
|
|
15043
15131
|
ref,
|
|
@@ -15066,7 +15154,7 @@ var ListViewDragIndicatorElement = (0, import_react50.forwardRef)(
|
|
|
15066
15154
|
);
|
|
15067
15155
|
}
|
|
15068
15156
|
);
|
|
15069
|
-
var ListViewRow = (0,
|
|
15157
|
+
var ListViewRow = (0, import_react51.forwardRef)(function ListViewRow2({
|
|
15070
15158
|
id,
|
|
15071
15159
|
tabIndex = 0,
|
|
15072
15160
|
gap,
|
|
@@ -15101,12 +15189,12 @@ var ListViewRow = (0, import_react50.forwardRef)(function ListViewRow2({
|
|
|
15101
15189
|
divider,
|
|
15102
15190
|
gap: listGap,
|
|
15103
15191
|
colorScheme
|
|
15104
|
-
} = (0,
|
|
15192
|
+
} = (0, import_react51.useContext)(ListRowContext);
|
|
15105
15193
|
const { hoverProps } = useHover({
|
|
15106
15194
|
onHoverChange
|
|
15107
15195
|
});
|
|
15108
|
-
const { indentation, isDragging } = (0,
|
|
15109
|
-
const handlePress = (0,
|
|
15196
|
+
const { indentation, isDragging } = (0, import_react51.useContext)(ListViewDraggingContext);
|
|
15197
|
+
const handlePress = (0, import_react51.useCallback)(
|
|
15110
15198
|
(event) => {
|
|
15111
15199
|
event.preventDefault();
|
|
15112
15200
|
if (event.button !== 0) return;
|
|
@@ -15114,14 +15202,14 @@ var ListViewRow = (0, import_react50.forwardRef)(function ListViewRow2({
|
|
|
15114
15202
|
},
|
|
15115
15203
|
[onPress]
|
|
15116
15204
|
);
|
|
15117
|
-
const handleDoubleClick = (0,
|
|
15205
|
+
const handleDoubleClick = (0, import_react51.useCallback)(
|
|
15118
15206
|
(event) => {
|
|
15119
15207
|
event.stopPropagation();
|
|
15120
15208
|
onDoubleClick?.();
|
|
15121
15209
|
},
|
|
15122
15210
|
[onDoubleClick]
|
|
15123
15211
|
);
|
|
15124
|
-
const mergedStyle = (0,
|
|
15212
|
+
const mergedStyle = (0, import_react51.useMemo)(() => {
|
|
15125
15213
|
return isDragging ? {
|
|
15126
15214
|
// TODO: Where do these offsets actually come from?
|
|
15127
15215
|
transform: `translate3d(-36px, -6px, 0)`,
|
|
@@ -15134,7 +15222,7 @@ var ListViewRow = (0, import_react50.forwardRef)(function ListViewRow2({
|
|
|
15134
15222
|
...renderProps
|
|
15135
15223
|
}, ref) => {
|
|
15136
15224
|
const Component3 = RowContainer;
|
|
15137
|
-
const element = /* @__PURE__ */
|
|
15225
|
+
const element = /* @__PURE__ */ import_react51.default.createElement(
|
|
15138
15226
|
Component3,
|
|
15139
15227
|
{
|
|
15140
15228
|
ref,
|
|
@@ -15166,7 +15254,7 @@ var ListViewRow = (0, import_react50.forwardRef)(function ListViewRow2({
|
|
|
15166
15254
|
tabIndex,
|
|
15167
15255
|
className
|
|
15168
15256
|
},
|
|
15169
|
-
relativeDropPosition && /* @__PURE__ */
|
|
15257
|
+
relativeDropPosition && /* @__PURE__ */ import_react51.default.createElement(
|
|
15170
15258
|
ListViewDragIndicatorElement,
|
|
15171
15259
|
{
|
|
15172
15260
|
$colorScheme: colorScheme,
|
|
@@ -15180,11 +15268,11 @@ var ListViewRow = (0, import_react50.forwardRef)(function ListViewRow2({
|
|
|
15180
15268
|
}) : dragIndicatorStyle
|
|
15181
15269
|
}
|
|
15182
15270
|
),
|
|
15183
|
-
depth > 0 && /* @__PURE__ */
|
|
15271
|
+
depth > 0 && /* @__PURE__ */ import_react51.default.createElement(Spacer.Horizontal, { size: depth * indentation }),
|
|
15184
15272
|
children2
|
|
15185
15273
|
);
|
|
15186
15274
|
if (menuItems && onSelectMenuItem) {
|
|
15187
|
-
return /* @__PURE__ */
|
|
15275
|
+
return /* @__PURE__ */ import_react51.default.createElement(
|
|
15188
15276
|
ContextMenu,
|
|
15189
15277
|
{
|
|
15190
15278
|
items: menuItems,
|
|
@@ -15197,25 +15285,25 @@ var ListViewRow = (0, import_react50.forwardRef)(function ListViewRow2({
|
|
|
15197
15285
|
return element;
|
|
15198
15286
|
};
|
|
15199
15287
|
if (sortable && id) {
|
|
15200
|
-
return /* @__PURE__ */
|
|
15288
|
+
return /* @__PURE__ */ import_react51.default.createElement(Sortable.Item, { id, disabled: overrideSortable === false }, ({ ref: sortableRef, ...sortableProps }) => renderContent(
|
|
15201
15289
|
sortableProps,
|
|
15202
15290
|
(0, import_react_compose_refs2.composeRefs)(sortableRef, forwardedRef)
|
|
15203
15291
|
));
|
|
15204
15292
|
}
|
|
15205
15293
|
return renderContent({}, forwardedRef);
|
|
15206
15294
|
});
|
|
15207
|
-
var RenderItemContext = (0,
|
|
15295
|
+
var RenderItemContext = (0, import_react51.createContext)(
|
|
15208
15296
|
() => null
|
|
15209
15297
|
);
|
|
15210
15298
|
RenderItemContext.displayName = "RenderItemContext";
|
|
15211
|
-
var VirtualizedListRow = (0,
|
|
15299
|
+
var VirtualizedListRow = (0, import_react51.memo)(function VirtualizedListRow2({
|
|
15212
15300
|
index,
|
|
15213
15301
|
style: style5
|
|
15214
15302
|
}) {
|
|
15215
|
-
const renderItem = (0,
|
|
15216
|
-
return /* @__PURE__ */
|
|
15303
|
+
const renderItem = (0, import_react51.useContext)(RenderItemContext);
|
|
15304
|
+
return /* @__PURE__ */ import_react51.default.createElement("div", { key: index, style: style5 }, renderItem(index));
|
|
15217
15305
|
});
|
|
15218
|
-
var VirtualizedListInner = (0,
|
|
15306
|
+
var VirtualizedListInner = (0, import_react51.forwardRef)(function VirtualizedListInner2({
|
|
15219
15307
|
size: size3,
|
|
15220
15308
|
scrollElement,
|
|
15221
15309
|
items,
|
|
@@ -15223,20 +15311,20 @@ var VirtualizedListInner = (0, import_react50.forwardRef)(function VirtualizedLi
|
|
|
15223
15311
|
keyExtractor,
|
|
15224
15312
|
renderItem
|
|
15225
15313
|
}, ref) {
|
|
15226
|
-
const listRef = (0,
|
|
15227
|
-
(0,
|
|
15314
|
+
const listRef = (0, import_react51.useRef)(null);
|
|
15315
|
+
(0, import_react51.useImperativeHandle)(ref, () => ({
|
|
15228
15316
|
scrollToIndex(index) {
|
|
15229
15317
|
listRef.current?.scrollToItem(index);
|
|
15230
15318
|
}
|
|
15231
15319
|
}));
|
|
15232
|
-
(0,
|
|
15320
|
+
(0, import_react51.useLayoutEffect)(() => {
|
|
15233
15321
|
listRef.current?.resetAfterIndex(0);
|
|
15234
15322
|
}, [
|
|
15235
15323
|
// When items change, we need to re-render the virtualized list,
|
|
15236
15324
|
// since it doesn't currently support row height changes
|
|
15237
15325
|
items
|
|
15238
15326
|
]);
|
|
15239
|
-
const listStyle = (0,
|
|
15327
|
+
const listStyle = (0, import_react51.useMemo)(
|
|
15240
15328
|
() => ({
|
|
15241
15329
|
overflowX: "initial",
|
|
15242
15330
|
overflowY: "initial",
|
|
@@ -15244,18 +15332,18 @@ var VirtualizedListInner = (0, import_react50.forwardRef)(function VirtualizedLi
|
|
|
15244
15332
|
}),
|
|
15245
15333
|
[]
|
|
15246
15334
|
);
|
|
15247
|
-
return /* @__PURE__ */
|
|
15335
|
+
return /* @__PURE__ */ import_react51.default.createElement(RenderItemContext.Provider, { value: renderItem }, /* @__PURE__ */ import_react51.default.createElement(
|
|
15248
15336
|
WindowScroller,
|
|
15249
15337
|
{
|
|
15250
15338
|
scrollElement,
|
|
15251
|
-
style: (0,
|
|
15339
|
+
style: (0, import_react51.useMemo)(() => ({ flex: "1 1 auto" }), [])
|
|
15252
15340
|
},
|
|
15253
|
-
(0,
|
|
15341
|
+
(0, import_react51.useCallback)(
|
|
15254
15342
|
({
|
|
15255
15343
|
registerChild,
|
|
15256
15344
|
onChildScroll,
|
|
15257
15345
|
scrollTop
|
|
15258
|
-
}) => /* @__PURE__ */
|
|
15346
|
+
}) => /* @__PURE__ */ import_react51.default.createElement("div", { ref: registerChild }, /* @__PURE__ */ import_react51.default.createElement(
|
|
15259
15347
|
import_react_window.VariableSizeList,
|
|
15260
15348
|
{
|
|
15261
15349
|
ref: listRef,
|
|
@@ -15285,10 +15373,10 @@ var VirtualizedListInner = (0, import_react50.forwardRef)(function VirtualizedLi
|
|
|
15285
15373
|
)
|
|
15286
15374
|
));
|
|
15287
15375
|
});
|
|
15288
|
-
var VirtualizedList = (0,
|
|
15376
|
+
var VirtualizedList = (0, import_react51.memo)(
|
|
15289
15377
|
VirtualizedListInner
|
|
15290
15378
|
);
|
|
15291
|
-
var ListViewRootInner = (0,
|
|
15379
|
+
var ListViewRootInner = (0, import_react51.forwardRef)(function ListViewRootInner2({
|
|
15292
15380
|
id,
|
|
15293
15381
|
className,
|
|
15294
15382
|
style: style5,
|
|
@@ -15310,7 +15398,7 @@ var ListViewRootInner = (0, import_react50.forwardRef)(function ListViewRootInne
|
|
|
15310
15398
|
colorScheme = "primary",
|
|
15311
15399
|
gap = 0
|
|
15312
15400
|
}, forwardedRef) {
|
|
15313
|
-
const handleClick = (0,
|
|
15401
|
+
const handleClick = (0, import_react51.useCallback)(
|
|
15314
15402
|
(event) => {
|
|
15315
15403
|
if (event.target instanceof HTMLElement && event.target.classList.contains("scroll-component"))
|
|
15316
15404
|
return;
|
|
@@ -15320,11 +15408,11 @@ var ListViewRootInner = (0, import_react50.forwardRef)(function ListViewRootInne
|
|
|
15320
15408
|
},
|
|
15321
15409
|
[onPress]
|
|
15322
15410
|
);
|
|
15323
|
-
const renderChild = (0,
|
|
15411
|
+
const renderChild = (0, import_react51.useCallback)(
|
|
15324
15412
|
(index) => renderItem(data[index], index, { isDragging: false }),
|
|
15325
15413
|
[data, renderItem]
|
|
15326
15414
|
);
|
|
15327
|
-
const defaultContextValue = (0,
|
|
15415
|
+
const defaultContextValue = (0, import_react51.useMemo)(
|
|
15328
15416
|
() => ({
|
|
15329
15417
|
colorScheme,
|
|
15330
15418
|
marginType: "none",
|
|
@@ -15340,16 +15428,16 @@ var ListViewRootInner = (0, import_react50.forwardRef)(function ListViewRootInne
|
|
|
15340
15428
|
}),
|
|
15341
15429
|
[colorScheme, sortable, expandable, divider, pressEventName, variant, gap]
|
|
15342
15430
|
);
|
|
15343
|
-
const getItemContextValue = (0,
|
|
15431
|
+
const getItemContextValue = (0, import_react51.useCallback)(
|
|
15344
15432
|
(i) => {
|
|
15345
15433
|
if (variant === "bare" || variant === "normal")
|
|
15346
15434
|
return defaultContextValue;
|
|
15347
15435
|
const current = renderChild(i);
|
|
15348
|
-
if (!(0,
|
|
15436
|
+
if (!(0, import_react51.isValidElement)(current)) return;
|
|
15349
15437
|
const prevChild = i - 1 >= 0 && renderChild(i - 1);
|
|
15350
15438
|
const nextChild = i + 1 < data.length && renderChild(i + 1);
|
|
15351
|
-
const next = (0,
|
|
15352
|
-
const prev = (0,
|
|
15439
|
+
const next = (0, import_react51.isValidElement)(nextChild) ? nextChild : void 0;
|
|
15440
|
+
const prev = (0, import_react51.isValidElement)(prevChild) ? prevChild : void 0;
|
|
15353
15441
|
const hasMarginTop = !prev;
|
|
15354
15442
|
const hasMarginBottom = !next || current.props.isSectionHeader || next && next.props.isSectionHeader;
|
|
15355
15443
|
let marginType;
|
|
@@ -15402,25 +15490,25 @@ var ListViewRootInner = (0, import_react50.forwardRef)(function ListViewRootInne
|
|
|
15402
15490
|
gap
|
|
15403
15491
|
]
|
|
15404
15492
|
);
|
|
15405
|
-
const draggingContextOverlayValue = (0,
|
|
15493
|
+
const draggingContextOverlayValue = (0, import_react51.useMemo)(
|
|
15406
15494
|
() => ({ indentation, isDragging: true }),
|
|
15407
15495
|
[indentation]
|
|
15408
15496
|
);
|
|
15409
|
-
const renderOverlay = (0,
|
|
15410
|
-
(index) => /* @__PURE__ */
|
|
15497
|
+
const renderOverlay = (0, import_react51.useCallback)(
|
|
15498
|
+
(index) => /* @__PURE__ */ import_react51.default.createElement("div", { style: { opacity: 0.25 } }, /* @__PURE__ */ import_react51.default.createElement(ListViewDraggingContext.Provider, { value: draggingContextOverlayValue }, renderItem(data[index], index, { isDragging: true }))),
|
|
15411
15499
|
[draggingContextOverlayValue, renderItem, data]
|
|
15412
15500
|
);
|
|
15413
|
-
const renderWrappedChild = (0,
|
|
15501
|
+
const renderWrappedChild = (0, import_react51.useCallback)(
|
|
15414
15502
|
(index) => {
|
|
15415
15503
|
const contextValue = getItemContextValue(index);
|
|
15416
15504
|
const current = renderChild(index);
|
|
15417
|
-
if (!contextValue || !(0,
|
|
15418
|
-
return /* @__PURE__ */
|
|
15505
|
+
if (!contextValue || !(0, import_react51.isValidElement)(current)) return null;
|
|
15506
|
+
return /* @__PURE__ */ import_react51.default.createElement(ListRowContext.Provider, { key: current.key, value: contextValue }, current);
|
|
15419
15507
|
},
|
|
15420
15508
|
[getItemContextValue, renderChild]
|
|
15421
15509
|
);
|
|
15422
|
-
const ids = (0,
|
|
15423
|
-
const withSortable = (children2) => sortable ? /* @__PURE__ */
|
|
15510
|
+
const ids = (0, import_react51.useMemo)(() => data.map(keyExtractor), [keyExtractor, data]);
|
|
15511
|
+
const withSortable = (children2) => sortable ? /* @__PURE__ */ import_react51.default.createElement(
|
|
15424
15512
|
Sortable.Root,
|
|
15425
15513
|
{
|
|
15426
15514
|
onMoveItem,
|
|
@@ -15430,8 +15518,8 @@ var ListViewRootInner = (0, import_react50.forwardRef)(function ListViewRootInne
|
|
|
15430
15518
|
},
|
|
15431
15519
|
children2
|
|
15432
15520
|
) : children2;
|
|
15433
|
-
const withScrollable = (children2) => scrollable ? /* @__PURE__ */
|
|
15434
|
-
const getItemHeight = (0,
|
|
15521
|
+
const withScrollable = (children2) => scrollable ? /* @__PURE__ */ import_react51.default.createElement(ScrollArea, null, children2) : children2(null);
|
|
15522
|
+
const getItemHeight = (0, import_react51.useCallback)(
|
|
15435
15523
|
(index) => {
|
|
15436
15524
|
const child = getItemContextValue(index);
|
|
15437
15525
|
const margin = child?.marginType ? getPositionMargin(child.marginType) : { top: 0, bottom: 0 };
|
|
@@ -15440,13 +15528,13 @@ var ListViewRootInner = (0, import_react50.forwardRef)(function ListViewRootInne
|
|
|
15440
15528
|
},
|
|
15441
15529
|
[getItemContextValue, variant]
|
|
15442
15530
|
);
|
|
15443
|
-
const getKey = (0,
|
|
15531
|
+
const getKey = (0, import_react51.useCallback)(
|
|
15444
15532
|
(index) => keyExtractor(data[index], index),
|
|
15445
15533
|
[data, keyExtractor]
|
|
15446
15534
|
);
|
|
15447
|
-
const draggingContextValue = (0,
|
|
15448
|
-
const gapStyle = (0,
|
|
15449
|
-
return /* @__PURE__ */
|
|
15535
|
+
const draggingContextValue = (0, import_react51.useMemo)(() => ({ indentation }), [indentation]);
|
|
15536
|
+
const gapStyle = (0, import_react51.useMemo)(() => ({ gap: `${gap}px` }), [gap]);
|
|
15537
|
+
return /* @__PURE__ */ import_react51.default.createElement(ListViewDraggingContext.Provider, { value: draggingContextValue }, /* @__PURE__ */ import_react51.default.createElement(
|
|
15450
15538
|
"div",
|
|
15451
15539
|
{
|
|
15452
15540
|
id,
|
|
@@ -15458,7 +15546,7 @@ var ListViewRootInner = (0, import_react50.forwardRef)(function ListViewRootInne
|
|
|
15458
15546
|
},
|
|
15459
15547
|
withScrollable(
|
|
15460
15548
|
(scrollElementRef) => withSortable(
|
|
15461
|
-
virtualized ? /* @__PURE__ */
|
|
15549
|
+
virtualized ? /* @__PURE__ */ import_react51.default.createElement(
|
|
15462
15550
|
VirtualizedList,
|
|
15463
15551
|
{
|
|
15464
15552
|
ref: forwardedRef,
|
|
@@ -15474,42 +15562,42 @@ var ListViewRootInner = (0, import_react50.forwardRef)(function ListViewRootInne
|
|
|
15474
15562
|
)
|
|
15475
15563
|
));
|
|
15476
15564
|
});
|
|
15477
|
-
var ListViewRoot = (0,
|
|
15478
|
-
var ChildrenListViewInner = (0,
|
|
15479
|
-
const items = (0,
|
|
15480
|
-
() =>
|
|
15481
|
-
(child) => (0,
|
|
15565
|
+
var ListViewRoot = (0, import_react51.memo)(ListViewRootInner);
|
|
15566
|
+
var ChildrenListViewInner = (0, import_react51.forwardRef)(function ChildrenListViewInner2({ children: children2, ...rest }, forwardedRef) {
|
|
15567
|
+
const items = (0, import_react51.useMemo)(
|
|
15568
|
+
() => import_react51.Children.toArray(children2).flatMap(
|
|
15569
|
+
(child) => (0, import_react51.isValidElement)(child) ? [child] : []
|
|
15482
15570
|
),
|
|
15483
15571
|
[children2]
|
|
15484
15572
|
);
|
|
15485
|
-
return /* @__PURE__ */
|
|
15573
|
+
return /* @__PURE__ */ import_react51.default.createElement(
|
|
15486
15574
|
ListViewRoot,
|
|
15487
15575
|
{
|
|
15488
15576
|
ref: forwardedRef,
|
|
15489
15577
|
...rest,
|
|
15490
15578
|
data: items,
|
|
15491
|
-
keyExtractor: (0,
|
|
15579
|
+
keyExtractor: (0, import_react51.useCallback)(
|
|
15492
15580
|
({ key }, index) => typeof key === "string" ? key : (key ?? index).toString(),
|
|
15493
15581
|
[]
|
|
15494
15582
|
),
|
|
15495
|
-
renderItem: (0,
|
|
15583
|
+
renderItem: (0, import_react51.useCallback)((item) => item, [])
|
|
15496
15584
|
}
|
|
15497
15585
|
);
|
|
15498
15586
|
});
|
|
15499
|
-
var ChildrenListView = (0,
|
|
15500
|
-
var SimpleListViewInner = (0,
|
|
15587
|
+
var ChildrenListView = (0, import_react51.memo)(ChildrenListViewInner);
|
|
15588
|
+
var SimpleListViewInner = (0, import_react51.forwardRef)(function SimpleListViewInner2(props, forwardedRef) {
|
|
15501
15589
|
if ("children" in props) {
|
|
15502
|
-
return /* @__PURE__ */
|
|
15590
|
+
return /* @__PURE__ */ import_react51.default.createElement(ChildrenListView, { ref: forwardedRef, ...props });
|
|
15503
15591
|
} else {
|
|
15504
|
-
return /* @__PURE__ */
|
|
15592
|
+
return /* @__PURE__ */ import_react51.default.createElement(ListViewRoot, { ref: forwardedRef, ...props });
|
|
15505
15593
|
}
|
|
15506
15594
|
});
|
|
15507
|
-
var SimpleListView = (0,
|
|
15595
|
+
var SimpleListView = (0, import_react51.memo)(SimpleListViewInner);
|
|
15508
15596
|
var ListView;
|
|
15509
15597
|
((ListView2) => {
|
|
15510
|
-
ListView2.RowTitle = (0,
|
|
15511
|
-
ListView2.EditableRowTitle = (0,
|
|
15512
|
-
ListView2.Row = (0,
|
|
15598
|
+
ListView2.RowTitle = (0, import_react51.memo)(ListViewRowTitle);
|
|
15599
|
+
ListView2.EditableRowTitle = (0, import_react51.memo)(ListViewEditableRowTitle);
|
|
15600
|
+
ListView2.Row = (0, import_react51.memo)(ListViewRow);
|
|
15513
15601
|
ListView2.Root = SimpleListView;
|
|
15514
15602
|
ListView2.RowContext = ListRowContext;
|
|
15515
15603
|
ListView2.DragIndicator = ListViewDragIndicatorElement;
|
|
@@ -15546,15 +15634,15 @@ function filterWithGroupedSections(items, query) {
|
|
|
15546
15634
|
return [...headers, ...newItems];
|
|
15547
15635
|
});
|
|
15548
15636
|
}
|
|
15549
|
-
var CompletionMenu = (0,
|
|
15550
|
-
(0,
|
|
15637
|
+
var CompletionMenu = (0, import_react52.memo)(
|
|
15638
|
+
(0, import_react52.forwardRef)(function CompletionMenu2({
|
|
15551
15639
|
items,
|
|
15552
15640
|
selectedIndex,
|
|
15553
15641
|
onSelectItem,
|
|
15554
15642
|
onHoverIndex,
|
|
15555
15643
|
listSize
|
|
15556
15644
|
}, forwardedRef) {
|
|
15557
|
-
return /* @__PURE__ */
|
|
15645
|
+
return /* @__PURE__ */ import_react52.default.createElement(
|
|
15558
15646
|
ListView.Root,
|
|
15559
15647
|
{
|
|
15560
15648
|
ref: forwardedRef,
|
|
@@ -15566,13 +15654,13 @@ var CompletionMenu = (0, import_react51.memo)(
|
|
|
15566
15654
|
sectionHeaderVariant: "label",
|
|
15567
15655
|
renderItem: (item, i) => {
|
|
15568
15656
|
if (item.type === "sectionHeader") {
|
|
15569
|
-
return /* @__PURE__ */
|
|
15657
|
+
return /* @__PURE__ */ import_react52.default.createElement(ListView.Row, { key: item.id, isSectionHeader: true }, item.name);
|
|
15570
15658
|
}
|
|
15571
15659
|
const tokens = fuzzyTokenize({
|
|
15572
15660
|
item: item.name,
|
|
15573
15661
|
itemScore: item
|
|
15574
15662
|
});
|
|
15575
|
-
return /* @__PURE__ */
|
|
15663
|
+
return /* @__PURE__ */ import_react52.default.createElement(
|
|
15576
15664
|
ListView.Row,
|
|
15577
15665
|
{
|
|
15578
15666
|
key: item.id,
|
|
@@ -15584,7 +15672,7 @@ var CompletionMenu = (0, import_react51.memo)(
|
|
|
15584
15672
|
}
|
|
15585
15673
|
}
|
|
15586
15674
|
},
|
|
15587
|
-
tokens.map((token, j) => /* @__PURE__ */
|
|
15675
|
+
tokens.map((token, j) => /* @__PURE__ */ import_react52.default.createElement(
|
|
15588
15676
|
"span",
|
|
15589
15677
|
{
|
|
15590
15678
|
key: j,
|
|
@@ -15592,15 +15680,15 @@ var CompletionMenu = (0, import_react51.memo)(
|
|
|
15592
15680
|
},
|
|
15593
15681
|
token.text
|
|
15594
15682
|
)),
|
|
15595
|
-
item.icon && /* @__PURE__ */
|
|
15683
|
+
item.icon && /* @__PURE__ */ import_react52.default.createElement(import_react52.default.Fragment, null, /* @__PURE__ */ import_react52.default.createElement(Spacer.Horizontal, null), item.icon)
|
|
15596
15684
|
);
|
|
15597
15685
|
}
|
|
15598
15686
|
}
|
|
15599
15687
|
);
|
|
15600
15688
|
})
|
|
15601
15689
|
);
|
|
15602
|
-
var InputFieldWithCompletions = (0,
|
|
15603
|
-
(0,
|
|
15690
|
+
var InputFieldWithCompletions = (0, import_react52.memo)(
|
|
15691
|
+
(0, import_react52.forwardRef)(function InputFieldWithCompletions2({
|
|
15604
15692
|
loading,
|
|
15605
15693
|
initialValue = "",
|
|
15606
15694
|
placeholder,
|
|
@@ -15618,13 +15706,13 @@ var InputFieldWithCompletions = (0, import_react51.memo)(
|
|
|
15618
15706
|
hideChildrenWhenFocused = false,
|
|
15619
15707
|
hideMenuWhenEmptyValue = false
|
|
15620
15708
|
}, forwardedRef) {
|
|
15621
|
-
const ref = (0,
|
|
15622
|
-
const [isFocused, setIsFocused] = (0,
|
|
15623
|
-
const [state, _setState] = (0,
|
|
15709
|
+
const ref = (0, import_react52.useRef)(null);
|
|
15710
|
+
const [isFocused, setIsFocused] = (0, import_react52.useState)(false);
|
|
15711
|
+
const [state, _setState] = (0, import_react52.useState)({
|
|
15624
15712
|
filter: initialValue,
|
|
15625
15713
|
selectedIndex: 0
|
|
15626
15714
|
});
|
|
15627
|
-
const updateState = (0,
|
|
15715
|
+
const updateState = (0, import_react52.useCallback)(
|
|
15628
15716
|
(newState, hoverItem) => {
|
|
15629
15717
|
const nextState = { ...state, ...newState };
|
|
15630
15718
|
const nextItems = filterWithGroupedSections(items, nextState.filter);
|
|
@@ -15653,15 +15741,15 @@ var InputFieldWithCompletions = (0, import_react51.memo)(
|
|
|
15653
15741
|
},
|
|
15654
15742
|
[items, onChange, onHoverItem, state]
|
|
15655
15743
|
);
|
|
15656
|
-
const initialValueRef = (0,
|
|
15657
|
-
(0,
|
|
15744
|
+
const initialValueRef = (0, import_react52.useRef)(initialValue);
|
|
15745
|
+
(0, import_react52.useLayoutEffect)(() => {
|
|
15658
15746
|
if (initialValueRef.current === initialValue) return;
|
|
15659
15747
|
initialValueRef.current = initialValue;
|
|
15660
15748
|
updateState({ filter: initialValue });
|
|
15661
15749
|
}, [initialValue, updateState]);
|
|
15662
15750
|
const { filter, selectedIndex } = state;
|
|
15663
|
-
const listRef =
|
|
15664
|
-
const filteredItems = (0,
|
|
15751
|
+
const listRef = import_react52.default.useRef(null);
|
|
15752
|
+
const filteredItems = (0, import_react52.useMemo)(
|
|
15665
15753
|
() => filterWithGroupedSections(items, filter),
|
|
15666
15754
|
[items, filter]
|
|
15667
15755
|
);
|
|
@@ -15677,13 +15765,13 @@ var InputFieldWithCompletions = (0, import_react51.memo)(
|
|
|
15677
15765
|
),
|
|
15678
15766
|
ListView.rowHeight * 10.5
|
|
15679
15767
|
);
|
|
15680
|
-
(0,
|
|
15768
|
+
(0, import_react52.useEffect)(() => {
|
|
15681
15769
|
if (listRef.current) {
|
|
15682
15770
|
listRef.current.scrollToIndex(selectedIndex);
|
|
15683
15771
|
}
|
|
15684
15772
|
}, [selectedIndex]);
|
|
15685
|
-
const lastSubmittedValueRef = (0,
|
|
15686
|
-
const selectItem = (0,
|
|
15773
|
+
const lastSubmittedValueRef = (0, import_react52.useRef)(void 0);
|
|
15774
|
+
const selectItem = (0, import_react52.useCallback)(
|
|
15687
15775
|
(item) => {
|
|
15688
15776
|
if (item.type === "sectionHeader") return;
|
|
15689
15777
|
lastSubmittedValueRef.current = {
|
|
@@ -15698,17 +15786,17 @@ var InputFieldWithCompletions = (0, import_react51.memo)(
|
|
|
15698
15786
|
},
|
|
15699
15787
|
[filter, onSelectItem, onHoverItem, ref]
|
|
15700
15788
|
);
|
|
15701
|
-
const handleChange = (0,
|
|
15789
|
+
const handleChange = (0, import_react52.useCallback)(
|
|
15702
15790
|
(value) => updateState({ selectedIndex: 0, filter: value }),
|
|
15703
15791
|
[updateState]
|
|
15704
15792
|
);
|
|
15705
|
-
const handleBlur = (0,
|
|
15793
|
+
const handleBlur = (0, import_react52.useCallback)(() => {
|
|
15706
15794
|
setIsFocused(false);
|
|
15707
15795
|
const didSubmit = lastSubmittedValueRef.current?.filter === filter;
|
|
15708
15796
|
updateState({ selectedIndex: 0, filter: initialValue }, "resetHover");
|
|
15709
15797
|
onBlur?.(didSubmit, filter);
|
|
15710
15798
|
}, [filter, initialValue, onBlur, updateState]);
|
|
15711
|
-
const handleFocus = (0,
|
|
15799
|
+
const handleFocus = (0, import_react52.useCallback)(
|
|
15712
15800
|
(event) => {
|
|
15713
15801
|
setIsFocused(true);
|
|
15714
15802
|
updateState({ selectedIndex: 0, filter: initialValue });
|
|
@@ -15716,11 +15804,11 @@ var InputFieldWithCompletions = (0, import_react51.memo)(
|
|
|
15716
15804
|
},
|
|
15717
15805
|
[initialValue, onFocus, updateState]
|
|
15718
15806
|
);
|
|
15719
|
-
const handleIndexChange = (0,
|
|
15807
|
+
const handleIndexChange = (0, import_react52.useCallback)(
|
|
15720
15808
|
(index) => updateState({ selectedIndex: index }),
|
|
15721
15809
|
[updateState]
|
|
15722
15810
|
);
|
|
15723
|
-
const handleKeyDown = (0,
|
|
15811
|
+
const handleKeyDown = (0, import_react52.useCallback)(
|
|
15724
15812
|
(event) => {
|
|
15725
15813
|
let handled = false;
|
|
15726
15814
|
switch (event.key) {
|
|
@@ -15784,7 +15872,7 @@ var InputFieldWithCompletions = (0, import_react51.memo)(
|
|
|
15784
15872
|
);
|
|
15785
15873
|
const display = !filter && hideMenuWhenEmptyValue ? "none" : "flex";
|
|
15786
15874
|
const typeaheadValue = filteredItems[selectedIndex]?.name;
|
|
15787
|
-
(0,
|
|
15875
|
+
(0, import_react52.useImperativeHandle)(forwardedRef, () => ({
|
|
15788
15876
|
focus: () => {
|
|
15789
15877
|
ref.current?.focus();
|
|
15790
15878
|
},
|
|
@@ -15795,13 +15883,13 @@ var InputFieldWithCompletions = (0, import_react51.memo)(
|
|
|
15795
15883
|
ref.current?.setSelectionRange(0, ref.current.value.length);
|
|
15796
15884
|
}
|
|
15797
15885
|
}));
|
|
15798
|
-
return /* @__PURE__ */
|
|
15886
|
+
return /* @__PURE__ */ import_react52.default.createElement(
|
|
15799
15887
|
InputField.Root,
|
|
15800
15888
|
{
|
|
15801
15889
|
size: size3,
|
|
15802
15890
|
renderPopoverContent: ({ width }) => {
|
|
15803
15891
|
const listSize = { width, height };
|
|
15804
|
-
return /* @__PURE__ */
|
|
15892
|
+
return /* @__PURE__ */ import_react52.default.createElement(
|
|
15805
15893
|
"div",
|
|
15806
15894
|
{
|
|
15807
15895
|
className: `flex flex-col ${!filter && hideMenuWhenEmptyValue ? "none" : "flex"}`,
|
|
@@ -15809,7 +15897,7 @@ var InputFieldWithCompletions = (0, import_react51.memo)(
|
|
|
15809
15897
|
flex: `0 0 ${height}px`
|
|
15810
15898
|
}
|
|
15811
15899
|
},
|
|
15812
|
-
filteredItems.length > 0 ? /* @__PURE__ */
|
|
15900
|
+
filteredItems.length > 0 ? /* @__PURE__ */ import_react52.default.createElement(
|
|
15813
15901
|
CompletionMenu,
|
|
15814
15902
|
{
|
|
15815
15903
|
ref: listRef,
|
|
@@ -15819,11 +15907,11 @@ var InputFieldWithCompletions = (0, import_react51.memo)(
|
|
|
15819
15907
|
onHoverIndex: handleIndexChange,
|
|
15820
15908
|
listSize
|
|
15821
15909
|
}
|
|
15822
|
-
) : /* @__PURE__ */
|
|
15910
|
+
) : /* @__PURE__ */ import_react52.default.createElement("div", { className: "flex flex-col h-[100px] p-5 items-center justify-center" }, /* @__PURE__ */ import_react52.default.createElement(Small, { className: "text-text-disabled" }, loading ? "Loading" : "No results"))
|
|
15823
15911
|
);
|
|
15824
15912
|
}
|
|
15825
15913
|
},
|
|
15826
|
-
/* @__PURE__ */
|
|
15914
|
+
/* @__PURE__ */ import_react52.default.createElement(
|
|
15827
15915
|
InputField.Input,
|
|
15828
15916
|
{
|
|
15829
15917
|
ref,
|
|
@@ -15847,9 +15935,9 @@ var InputFieldWithCompletions = (0, import_react51.memo)(
|
|
|
15847
15935
|
"aria-controls": "component-listbox"
|
|
15848
15936
|
}
|
|
15849
15937
|
),
|
|
15850
|
-
filter && typeaheadValue && typeaheadValue.toLowerCase().startsWith(filter.toLowerCase()) && /* @__PURE__ */
|
|
15938
|
+
filter && typeaheadValue && typeaheadValue.toLowerCase().startsWith(filter.toLowerCase()) && /* @__PURE__ */ import_react52.default.createElement(InputField.Typeahead, { value: typeaheadValue, prefix: filter }),
|
|
15851
15939
|
(!isFocused || !hideChildrenWhenFocused) && children2,
|
|
15852
|
-
loading && isFocused && /* @__PURE__ */
|
|
15940
|
+
loading && isFocused && /* @__PURE__ */ import_react52.default.createElement(InputField.Label, null, /* @__PURE__ */ import_react52.default.createElement(ActivityIndicator, null))
|
|
15853
15941
|
);
|
|
15854
15942
|
})
|
|
15855
15943
|
);
|
|
@@ -15869,9 +15957,9 @@ function getNextIndex(items, currentIndex, direction, isDisabled) {
|
|
|
15869
15957
|
}
|
|
15870
15958
|
|
|
15871
15959
|
// src/components/InspectorContainer.tsx
|
|
15872
|
-
var
|
|
15873
|
-
var InspectorContainer = (0,
|
|
15874
|
-
(0,
|
|
15960
|
+
var import_react53 = __toESM(require("react"));
|
|
15961
|
+
var InspectorContainer = (0, import_react53.memo)(
|
|
15962
|
+
(0, import_react53.forwardRef)(function InspectorContainer2({
|
|
15875
15963
|
header,
|
|
15876
15964
|
children: children2,
|
|
15877
15965
|
fallback,
|
|
@@ -15880,7 +15968,7 @@ var InspectorContainer = (0, import_react52.memo)(
|
|
|
15880
15968
|
className,
|
|
15881
15969
|
style: style5
|
|
15882
15970
|
}, forwardedRef) {
|
|
15883
|
-
return /* @__PURE__ */
|
|
15971
|
+
return /* @__PURE__ */ import_react53.default.createElement(
|
|
15884
15972
|
"div",
|
|
15885
15973
|
{
|
|
15886
15974
|
ref: forwardedRef,
|
|
@@ -15895,42 +15983,47 @@ var InspectorContainer = (0, import_react52.memo)(
|
|
|
15895
15983
|
}
|
|
15896
15984
|
},
|
|
15897
15985
|
header,
|
|
15898
|
-
children2 ? /* @__PURE__ */
|
|
15986
|
+
children2 ? /* @__PURE__ */ import_react53.default.createElement(ScrollArea, null, /* @__PURE__ */ import_react53.default.createElement("div", { className: "flex flex-col relative" }, showDividers ? withSeparatorElements(children2, /* @__PURE__ */ import_react53.default.createElement(Divider, null)) : children2)) : fallback ? /* @__PURE__ */ import_react53.default.createElement("div", { className: "flex flex-col relative h-full" }, fallback) : null
|
|
15899
15987
|
);
|
|
15900
15988
|
})
|
|
15901
15989
|
);
|
|
15902
15990
|
|
|
15903
15991
|
// src/components/Label.tsx
|
|
15904
|
-
var
|
|
15905
|
-
|
|
15906
|
-
|
|
15907
|
-
|
|
15908
|
-
|
|
15909
|
-
|
|
15910
|
-
|
|
15911
|
-
|
|
15992
|
+
var import_react54 = __toESM(require("react"));
|
|
15993
|
+
var Label = (0, import_react54.memo)(
|
|
15994
|
+
(0, import_react54.forwardRef)(function Label2({ className, ...props }, ref) {
|
|
15995
|
+
return /* @__PURE__ */ import_react54.default.createElement(
|
|
15996
|
+
"label",
|
|
15997
|
+
{
|
|
15998
|
+
ref,
|
|
15999
|
+
className: `font-sans text-label uppercase flex items-center leading-[19px] select-none font-bold text-text-muted ${className ?? ""}`,
|
|
16000
|
+
...props
|
|
16001
|
+
}
|
|
16002
|
+
);
|
|
16003
|
+
})
|
|
16004
|
+
);
|
|
15912
16005
|
|
|
15913
16006
|
// src/components/LabeledElementView.tsx
|
|
15914
16007
|
var kiwi = __toESM(require("kiwi.js"));
|
|
15915
|
-
var
|
|
15916
|
-
var LabeledElementView = (0,
|
|
16008
|
+
var import_react55 = __toESM(require("react"));
|
|
16009
|
+
var LabeledElementView = (0, import_react55.memo)(function LabeledElementView2({
|
|
15917
16010
|
children: children2,
|
|
15918
16011
|
renderLabel
|
|
15919
16012
|
}) {
|
|
15920
|
-
const elementIds =
|
|
15921
|
-
(child) => (0,
|
|
16013
|
+
const elementIds = import_react55.Children.toArray(children2).flatMap(
|
|
16014
|
+
(child) => (0, import_react55.isValidElement)(child) && child.type === import_react55.Fragment ? child.props.children : [child]
|
|
15922
16015
|
).map(
|
|
15923
|
-
(child) => (0,
|
|
16016
|
+
(child) => (0, import_react55.isValidElement)(child) && "id" in child.props ? child.props.id : null
|
|
15924
16017
|
).filter((id) => !!id);
|
|
15925
16018
|
const serializedIds = elementIds.join(",");
|
|
15926
|
-
const containerRef = (0,
|
|
15927
|
-
const refs = (0,
|
|
16019
|
+
const containerRef = (0, import_react55.useRef)(null);
|
|
16020
|
+
const refs = (0, import_react55.useMemo)(() => {
|
|
15928
16021
|
return Object.fromEntries(
|
|
15929
|
-
serializedIds.split(",").map((id) => [id, (0,
|
|
16022
|
+
serializedIds.split(",").map((id) => [id, (0, import_react55.createRef)()])
|
|
15930
16023
|
);
|
|
15931
16024
|
}, [serializedIds]);
|
|
15932
|
-
const labelElements = (0,
|
|
15933
|
-
return serializedIds.split(",").map((id, index) => /* @__PURE__ */
|
|
16025
|
+
const labelElements = (0, import_react55.useMemo)(() => {
|
|
16026
|
+
return serializedIds.split(",").map((id, index) => /* @__PURE__ */ import_react55.default.createElement(
|
|
15934
16027
|
"span",
|
|
15935
16028
|
{
|
|
15936
16029
|
key: id,
|
|
@@ -15943,7 +16036,7 @@ var LabeledElementView = (0, import_react54.memo)(function LabeledElementView2({
|
|
|
15943
16036
|
})
|
|
15944
16037
|
));
|
|
15945
16038
|
}, [refs, serializedIds, renderLabel]);
|
|
15946
|
-
(0,
|
|
16039
|
+
(0, import_react55.useLayoutEffect)(() => {
|
|
15947
16040
|
if (!containerRef.current) return;
|
|
15948
16041
|
const containerRect = containerRef.current.getBoundingClientRect();
|
|
15949
16042
|
const solver = new kiwi.Solver();
|
|
@@ -16005,30 +16098,30 @@ var LabeledElementView = (0, import_react54.memo)(function LabeledElementView2({
|
|
|
16005
16098
|
`${Math.max(...heights)}px`
|
|
16006
16099
|
);
|
|
16007
16100
|
}, [refs, labelElements]);
|
|
16008
|
-
return /* @__PURE__ */
|
|
16101
|
+
return /* @__PURE__ */ import_react55.default.createElement("div", { className: "flex flex-1 flex-col relative", ref: containerRef }, /* @__PURE__ */ import_react55.default.createElement("div", { className: "flex flex-1 items-center" }, children2), /* @__PURE__ */ import_react55.default.createElement("div", { className: "relative overflow-hidden select-none" }, labelElements));
|
|
16009
16102
|
});
|
|
16010
16103
|
|
|
16011
16104
|
// src/components/Progress.tsx
|
|
16012
16105
|
var import_noya_utils9 = require("@noya-app/noya-utils");
|
|
16013
16106
|
var ProgressPrimitive = __toESM(require("@radix-ui/react-progress"));
|
|
16014
|
-
var
|
|
16107
|
+
var import_react56 = __toESM(require("react"));
|
|
16015
16108
|
function Progress({
|
|
16016
16109
|
value,
|
|
16017
16110
|
variant = "normal",
|
|
16018
16111
|
className
|
|
16019
16112
|
}) {
|
|
16020
16113
|
const clampedValue = (0, import_noya_utils9.clamp)(value, 0, 100);
|
|
16021
|
-
const transformStyles = (0,
|
|
16114
|
+
const transformStyles = (0, import_react56.useMemo)(() => ({
|
|
16022
16115
|
transform: `translateX(-${100 - clampedValue}%)`
|
|
16023
16116
|
}), [clampedValue]);
|
|
16024
|
-
return /* @__PURE__ */
|
|
16117
|
+
return /* @__PURE__ */ import_react56.default.createElement(
|
|
16025
16118
|
ProgressPrimitive.Root,
|
|
16026
16119
|
{
|
|
16027
16120
|
className: `relative hidden bg-input-background h-[5px] ${className ?? ""}`,
|
|
16028
16121
|
style: { transform: "translateZ(0)" },
|
|
16029
16122
|
value: clampedValue
|
|
16030
16123
|
},
|
|
16031
|
-
/* @__PURE__ */
|
|
16124
|
+
/* @__PURE__ */ import_react56.default.createElement(
|
|
16032
16125
|
ProgressPrimitive.Indicator,
|
|
16033
16126
|
{
|
|
16034
16127
|
className: cn(variant === "primary" ? "bg-primary" : variant === "secondary" ? "bg-secondary" : variant === "warning" ? "bg-warning" : "bg-text", "transition-[transform_660ms_cubic-bezier(0.65,0,0.35,1)", "w-full h-full"),
|
|
@@ -16040,10 +16133,10 @@ function Progress({
|
|
|
16040
16133
|
|
|
16041
16134
|
// src/components/RadioGroup.tsx
|
|
16042
16135
|
var ToggleGroupPrimitive = __toESM(require("@radix-ui/react-toggle-group"));
|
|
16043
|
-
var
|
|
16044
|
-
var ToggleGroupItem = (0,
|
|
16045
|
-
const { colorScheme } = (0,
|
|
16046
|
-
const itemElement = /* @__PURE__ */
|
|
16136
|
+
var import_react57 = __toESM(require("react"));
|
|
16137
|
+
var ToggleGroupItem = (0, import_react57.forwardRef)(function ToggleGroupItem2({ value, tooltip, children: children2, disabled = false }, forwardedRef) {
|
|
16138
|
+
const { colorScheme } = (0, import_react57.useContext)(RadioGroupContext);
|
|
16139
|
+
const itemElement = /* @__PURE__ */ import_react57.default.createElement(
|
|
16047
16140
|
ToggleGroupPrimitive.Item,
|
|
16048
16141
|
{
|
|
16049
16142
|
ref: forwardedRef,
|
|
@@ -16053,9 +16146,9 @@ var ToggleGroupItem = (0, import_react56.forwardRef)(function ToggleGroupItem2({
|
|
|
16053
16146
|
},
|
|
16054
16147
|
children2
|
|
16055
16148
|
);
|
|
16056
|
-
return tooltip ? /* @__PURE__ */
|
|
16149
|
+
return tooltip ? /* @__PURE__ */ import_react57.default.createElement(Tooltip, { content: tooltip }, itemElement) : itemElement;
|
|
16057
16150
|
});
|
|
16058
|
-
var RadioGroupContext = (0,
|
|
16151
|
+
var RadioGroupContext = (0, import_react57.createContext)({
|
|
16059
16152
|
colorScheme: "primary"
|
|
16060
16153
|
});
|
|
16061
16154
|
function ToggleGroupRoot({
|
|
@@ -16066,15 +16159,15 @@ function ToggleGroupRoot({
|
|
|
16066
16159
|
allowEmpty,
|
|
16067
16160
|
children: children2
|
|
16068
16161
|
}) {
|
|
16069
|
-
const contextValue = (0,
|
|
16070
|
-
const handleValueChange = (0,
|
|
16162
|
+
const contextValue = (0, import_react57.useMemo)(() => ({ colorScheme }), [colorScheme]);
|
|
16163
|
+
const handleValueChange = (0, import_react57.useCallback)(
|
|
16071
16164
|
(value2) => {
|
|
16072
16165
|
if (!allowEmpty && !value2) return;
|
|
16073
16166
|
onValueChange?.(value2);
|
|
16074
16167
|
},
|
|
16075
16168
|
[allowEmpty, onValueChange]
|
|
16076
16169
|
);
|
|
16077
|
-
return /* @__PURE__ */
|
|
16170
|
+
return /* @__PURE__ */ import_react57.default.createElement(RadioGroupContext.Provider, { value: contextValue }, /* @__PURE__ */ import_react57.default.createElement(
|
|
16078
16171
|
ToggleGroupPrimitive.Root,
|
|
16079
16172
|
{
|
|
16080
16173
|
id,
|
|
@@ -16088,23 +16181,29 @@ function ToggleGroupRoot({
|
|
|
16088
16181
|
}
|
|
16089
16182
|
var RadioGroup;
|
|
16090
16183
|
((RadioGroup2) => {
|
|
16091
|
-
RadioGroup2.Root = (0,
|
|
16092
|
-
RadioGroup2.Item = (0,
|
|
16184
|
+
RadioGroup2.Root = (0, import_react57.memo)(ToggleGroupRoot);
|
|
16185
|
+
RadioGroup2.Item = (0, import_react57.memo)(ToggleGroupItem);
|
|
16093
16186
|
})(RadioGroup || (RadioGroup = {}));
|
|
16094
16187
|
|
|
16095
16188
|
// src/components/SelectMenu.tsx
|
|
16096
16189
|
var import_noya_icons6 = require("@noya-app/noya-icons");
|
|
16097
16190
|
var Select = __toESM(require("@radix-ui/react-select"));
|
|
16098
|
-
var
|
|
16191
|
+
var import_react58 = __toESM(require("react"));
|
|
16099
16192
|
var readOnlyStyle = {
|
|
16100
16193
|
justifyContent: "flex-start",
|
|
16101
16194
|
textAlign: "left"
|
|
16102
16195
|
};
|
|
16103
|
-
var
|
|
16104
|
-
|
|
16105
|
-
|
|
16106
|
-
|
|
16107
|
-
|
|
16196
|
+
var labelStyles = `font-sans text-label uppercase text-text-disabled leading-[19px] font-bold text-[60%] pointer-events-none flex items-center mr-1.5`;
|
|
16197
|
+
var scrollButtonStyles = `
|
|
16198
|
+
flex
|
|
16199
|
+
items-center
|
|
16200
|
+
justify-center
|
|
16201
|
+
h-[25px]
|
|
16202
|
+
cursor-default
|
|
16203
|
+
text-text-muted
|
|
16204
|
+
hover:text-text
|
|
16205
|
+
`;
|
|
16206
|
+
var SelectMenu = (0, import_react58.memo)(function SelectMenu2({
|
|
16108
16207
|
id,
|
|
16109
16208
|
style: style5,
|
|
16110
16209
|
className,
|
|
@@ -16121,8 +16220,8 @@ var SelectMenu = (0, import_react57.memo)(function SelectMenu2({
|
|
|
16121
16220
|
(item) => typeof item !== "string" && item.value === value
|
|
16122
16221
|
);
|
|
16123
16222
|
const icon = selectedItem?.icon;
|
|
16124
|
-
const readOnlyButton = (0,
|
|
16125
|
-
() => /* @__PURE__ */
|
|
16223
|
+
const readOnlyButton = (0, import_react58.useMemo)(
|
|
16224
|
+
() => /* @__PURE__ */ import_react58.default.createElement(
|
|
16126
16225
|
Button,
|
|
16127
16226
|
{
|
|
16128
16227
|
id,
|
|
@@ -16131,59 +16230,62 @@ var SelectMenu = (0, import_react57.memo)(function SelectMenu2({
|
|
|
16131
16230
|
className: `${className ?? ""} flex-1`,
|
|
16132
16231
|
disabled
|
|
16133
16232
|
},
|
|
16134
|
-
icon && /* @__PURE__ */
|
|
16135
|
-
/* @__PURE__ */
|
|
16233
|
+
icon && /* @__PURE__ */ import_react58.default.createElement(import_react58.default.Fragment, null, renderIcon(icon), /* @__PURE__ */ import_react58.default.createElement(Spacer.Horizontal, { inline: true, size: 6 })),
|
|
16234
|
+
/* @__PURE__ */ import_react58.default.createElement("span", { className: "flex flex-1" }, selectedItem?.title ?? value)
|
|
16136
16235
|
),
|
|
16137
16236
|
[icon, id, style5, className, disabled, value, selectedItem]
|
|
16138
16237
|
);
|
|
16139
|
-
const trigger = (0,
|
|
16140
|
-
() => /* @__PURE__ */
|
|
16238
|
+
const trigger = (0, import_react58.useMemo)(
|
|
16239
|
+
() => /* @__PURE__ */ import_react58.default.createElement(Select.SelectTrigger, { asChild: true }, /* @__PURE__ */ import_react58.default.createElement(
|
|
16141
16240
|
Button,
|
|
16142
16241
|
{
|
|
16143
16242
|
id,
|
|
16144
|
-
style:
|
|
16243
|
+
style: style5,
|
|
16145
16244
|
className: `${className ?? "w-full"} flex-1`,
|
|
16146
16245
|
disabled
|
|
16147
16246
|
},
|
|
16148
|
-
icon && /* @__PURE__ */
|
|
16149
|
-
/* @__PURE__ */
|
|
16150
|
-
/* @__PURE__ */
|
|
16151
|
-
/* @__PURE__ */
|
|
16247
|
+
icon && /* @__PURE__ */ import_react58.default.createElement(import_react58.default.Fragment, null, renderIcon(icon), /* @__PURE__ */ import_react58.default.createElement(Spacer.Horizontal, { inline: true, size: 6 })),
|
|
16248
|
+
/* @__PURE__ */ import_react58.default.createElement("span", { className: "flex flex-1 mr-1.5" }, /* @__PURE__ */ import_react58.default.createElement(Select.Value, { placeholder })),
|
|
16249
|
+
label && /* @__PURE__ */ import_react58.default.createElement("span", { className: labelStyles }, label),
|
|
16250
|
+
/* @__PURE__ */ import_react58.default.createElement(import_noya_icons6.DropdownChevronIcon, null)
|
|
16152
16251
|
)),
|
|
16153
|
-
[
|
|
16252
|
+
[id, style5, className, disabled, icon, placeholder, label]
|
|
16154
16253
|
);
|
|
16155
16254
|
if (readOnly) {
|
|
16156
|
-
return label ? /* @__PURE__ */
|
|
16157
|
-
"label",
|
|
16158
|
-
{
|
|
16159
|
-
className: labelStyles,
|
|
16160
|
-
htmlFor: id
|
|
16161
|
-
},
|
|
16162
|
-
label
|
|
16163
|
-
)) : readOnlyButton;
|
|
16255
|
+
return label ? /* @__PURE__ */ import_react58.default.createElement("div", { className: "flex flex-col relative" }, readOnlyButton, /* @__PURE__ */ import_react58.default.createElement("label", { className: labelStyles, htmlFor: id }, label)) : readOnlyButton;
|
|
16164
16256
|
}
|
|
16165
|
-
return /* @__PURE__ */
|
|
16257
|
+
return /* @__PURE__ */ import_react58.default.createElement(Select.Root, { value, onValueChange: onSelect, open }, trigger, /* @__PURE__ */ import_react58.default.createElement(Select.Portal, null, /* @__PURE__ */ import_react58.default.createElement(Select.Content, { className: styles.contentStyle }, /* @__PURE__ */ import_react58.default.createElement(Select.ScrollUpButton, { className: scrollButtonStyles }, /* @__PURE__ */ import_react58.default.createElement(import_noya_icons6.ChevronUpIcon, null)), /* @__PURE__ */ import_react58.default.createElement(Select.Viewport, null, menuItems.map((menuItem) => {
|
|
16166
16258
|
if (typeof menuItem === "string") {
|
|
16167
|
-
return /* @__PURE__ */
|
|
16259
|
+
return /* @__PURE__ */ import_react58.default.createElement(Select.Separator, { className: styles.separatorStyle });
|
|
16168
16260
|
}
|
|
16169
16261
|
const value2 = menuItem.value ?? "";
|
|
16170
|
-
return /* @__PURE__ */
|
|
16171
|
-
})))));
|
|
16262
|
+
return /* @__PURE__ */ import_react58.default.createElement(SelectItem, { key: value2, value: value2, icon: menuItem.icon }, menuItem.title ?? value2);
|
|
16263
|
+
})), /* @__PURE__ */ import_react58.default.createElement(Select.ScrollDownButton, { className: scrollButtonStyles }, /* @__PURE__ */ import_react58.default.createElement(import_noya_icons6.ChevronDownIcon, null)))));
|
|
16172
16264
|
});
|
|
16173
|
-
var SelectItem =
|
|
16265
|
+
var SelectItem = import_react58.default.forwardRef(
|
|
16174
16266
|
({
|
|
16175
16267
|
children: children2,
|
|
16176
16268
|
icon,
|
|
16177
16269
|
disabled,
|
|
16178
16270
|
...props
|
|
16179
16271
|
}, forwardedRef) => {
|
|
16180
|
-
return /* @__PURE__ */
|
|
16272
|
+
return /* @__PURE__ */ import_react58.default.createElement(
|
|
16273
|
+
Select.Item,
|
|
16274
|
+
{
|
|
16275
|
+
className: styles.itemStyle({ disabled }),
|
|
16276
|
+
disabled,
|
|
16277
|
+
...props,
|
|
16278
|
+
ref: forwardedRef
|
|
16279
|
+
},
|
|
16280
|
+
icon && /* @__PURE__ */ import_react58.default.createElement(import_react58.default.Fragment, null, renderIcon(icon), /* @__PURE__ */ import_react58.default.createElement(Spacer.Horizontal, { size: 8 })),
|
|
16281
|
+
/* @__PURE__ */ import_react58.default.createElement(Select.ItemText, null, children2)
|
|
16282
|
+
);
|
|
16181
16283
|
}
|
|
16182
16284
|
);
|
|
16183
16285
|
|
|
16184
16286
|
// src/components/Slider.tsx
|
|
16185
16287
|
var RadixSlider = __toESM(require("@radix-ui/react-slider"));
|
|
16186
|
-
var
|
|
16288
|
+
var import_react59 = __toESM(require("react"));
|
|
16187
16289
|
var Slider = function Slider2({
|
|
16188
16290
|
id,
|
|
16189
16291
|
value,
|
|
@@ -16191,17 +16293,17 @@ var Slider = function Slider2({
|
|
|
16191
16293
|
min,
|
|
16192
16294
|
max
|
|
16193
16295
|
}) {
|
|
16194
|
-
const arrayValue = (0,
|
|
16296
|
+
const arrayValue = (0, import_react59.useMemo)(
|
|
16195
16297
|
() => [Math.min(Math.max(value, min), max)],
|
|
16196
16298
|
[value, min, max]
|
|
16197
16299
|
);
|
|
16198
|
-
const handleValueChange = (0,
|
|
16300
|
+
const handleValueChange = (0, import_react59.useCallback)(
|
|
16199
16301
|
(arrayValue2) => {
|
|
16200
16302
|
onValueChange(arrayValue2[0]);
|
|
16201
16303
|
},
|
|
16202
16304
|
[onValueChange]
|
|
16203
16305
|
);
|
|
16204
|
-
return /* @__PURE__ */
|
|
16306
|
+
return /* @__PURE__ */ import_react59.default.createElement(
|
|
16205
16307
|
RadixSlider.Root,
|
|
16206
16308
|
{
|
|
16207
16309
|
min,
|
|
@@ -16211,65 +16313,67 @@ var Slider = function Slider2({
|
|
|
16211
16313
|
onValueChange: handleValueChange,
|
|
16212
16314
|
className: "flex-1 flex relative items-center select-none touch-none h-4"
|
|
16213
16315
|
},
|
|
16214
|
-
/* @__PURE__ */
|
|
16215
|
-
/* @__PURE__ */
|
|
16316
|
+
/* @__PURE__ */ import_react59.default.createElement(RadixSlider.Track, { className: "bg-divider relative flex-grow h-[2px]" }, /* @__PURE__ */ import_react59.default.createElement(RadixSlider.Range, { className: "absolute bg-primary rounded-full h-full" })),
|
|
16317
|
+
/* @__PURE__ */ import_react59.default.createElement(RadixSlider.Thumb, { className: "block w-3 h-3 bg-slider-background border border-solid border-slider-border rounded-[20px] focus:outline-none" })
|
|
16216
16318
|
);
|
|
16217
16319
|
};
|
|
16218
16320
|
|
|
16219
16321
|
// src/components/Switch.tsx
|
|
16220
16322
|
var SwitchPrimitive = __toESM(require("@radix-ui/react-switch"));
|
|
16221
|
-
var
|
|
16323
|
+
var import_react60 = __toESM(require("react"));
|
|
16222
16324
|
var Switch = function Switch2({
|
|
16325
|
+
id,
|
|
16223
16326
|
value,
|
|
16224
16327
|
onChange,
|
|
16225
16328
|
colorScheme = "normal",
|
|
16226
16329
|
disabled
|
|
16227
16330
|
}) {
|
|
16228
|
-
return /* @__PURE__ */
|
|
16331
|
+
return /* @__PURE__ */ import_react60.default.createElement(
|
|
16229
16332
|
SwitchPrimitive.Root,
|
|
16230
16333
|
{
|
|
16334
|
+
id,
|
|
16231
16335
|
checked: value,
|
|
16232
16336
|
disabled,
|
|
16233
16337
|
onCheckedChange: (newValue) => {
|
|
16234
16338
|
onChange(newValue);
|
|
16235
16339
|
},
|
|
16236
|
-
className: `all-unset w-8 h-[19px] bg-active-background rounded-full relative cursor-pointer [webkit-tap-highlight-color:rgba(0,0,0,0)] focus:ring-2 focus:
|
|
16340
|
+
className: `all-unset w-8 h-[19px] bg-active-background rounded-full relative cursor-pointer [webkit-tap-highlight-color:rgba(0,0,0,0)] focus:ring-2 focus:ring-primary focus:ring-offset-[1px] outline-none data-[state=checked]:bg-primary ${colorScheme === "secondary" && "data-[state=checked]:bg-secondary"}`
|
|
16237
16341
|
},
|
|
16238
|
-
/* @__PURE__ */
|
|
16342
|
+
/* @__PURE__ */ import_react60.default.createElement(SwitchPrimitive.Thumb, { className: "block w-[15px] h-[15px] bg-white rounded-full transition-transform translate-x-[2px] data-[state=checked]:translate-x-[15px]" })
|
|
16239
16343
|
);
|
|
16240
16344
|
};
|
|
16241
16345
|
|
|
16242
16346
|
// src/components/TextArea.tsx
|
|
16243
|
-
var
|
|
16347
|
+
var import_react61 = __toESM(require("react"));
|
|
16244
16348
|
var useAutoResize = (value) => {
|
|
16245
|
-
const textareaRef = (0,
|
|
16246
|
-
(0,
|
|
16349
|
+
const textareaRef = (0, import_react61.useRef)(null);
|
|
16350
|
+
(0, import_react61.useEffect)(() => {
|
|
16247
16351
|
if (!textareaRef.current) return;
|
|
16248
16352
|
textareaRef.current.style.height = "auto";
|
|
16249
16353
|
textareaRef.current.style.height = `${textareaRef.current.scrollHeight}px`;
|
|
16250
16354
|
}, [value]);
|
|
16251
16355
|
return textareaRef;
|
|
16252
16356
|
};
|
|
16253
|
-
var AutoResizingTextArea = (0,
|
|
16254
|
-
(0,
|
|
16357
|
+
var AutoResizingTextArea = (0, import_react61.memo)(
|
|
16358
|
+
(0, import_react61.forwardRef)(function AutoResizingTextArea2({
|
|
16255
16359
|
value,
|
|
16256
16360
|
onChangeText,
|
|
16257
16361
|
className,
|
|
16258
16362
|
...rest
|
|
16259
16363
|
}, forwardedRef) {
|
|
16260
16364
|
const ref = useAutoResize(value || rest.placeholder || "");
|
|
16261
|
-
const handleChange = (0,
|
|
16365
|
+
const handleChange = (0, import_react61.useCallback)(
|
|
16262
16366
|
(event) => onChangeText(event.target.value),
|
|
16263
16367
|
[onChangeText]
|
|
16264
16368
|
);
|
|
16265
|
-
const handleRef = (0,
|
|
16369
|
+
const handleRef = (0, import_react61.useCallback)(
|
|
16266
16370
|
(value2) => {
|
|
16267
16371
|
ref.current = value2;
|
|
16268
16372
|
assignRef(forwardedRef, value2);
|
|
16269
16373
|
},
|
|
16270
16374
|
[ref, forwardedRef]
|
|
16271
16375
|
);
|
|
16272
|
-
return /* @__PURE__ */
|
|
16376
|
+
return /* @__PURE__ */ import_react61.default.createElement(
|
|
16273
16377
|
"textarea",
|
|
16274
16378
|
{
|
|
16275
16379
|
className: `font-sans text-heading5 font-normal text-text bg-input-background w-0 flex-1 py-1 px-1.5 border-none outline-none h-[100px] rounded-4 resize-none placeholder:text-text-disabled focus:ring-2 focus:ring-primary focus:z-10 read-only:text-text-disabled ${className ?? ""}`,
|
|
@@ -16283,57 +16387,57 @@ var AutoResizingTextArea = (0, import_react60.memo)(
|
|
|
16283
16387
|
);
|
|
16284
16388
|
|
|
16285
16389
|
// src/components/TreeView.tsx
|
|
16286
|
-
var
|
|
16287
|
-
var TreeRow = (0,
|
|
16390
|
+
var import_react62 = __toESM(require("react"));
|
|
16391
|
+
var TreeRow = (0, import_react62.forwardRef)(function TreeRow2({
|
|
16288
16392
|
icon,
|
|
16289
16393
|
expanded,
|
|
16290
16394
|
onClickChevron,
|
|
16291
16395
|
children: children2,
|
|
16292
16396
|
...rest
|
|
16293
16397
|
}, forwardedRef) {
|
|
16294
|
-
const { expandable } = (0,
|
|
16295
|
-
const handleClickChevron = (0,
|
|
16398
|
+
const { expandable } = (0, import_react62.useContext)(ListView.RowContext);
|
|
16399
|
+
const handleClickChevron = (0, import_react62.useCallback)(
|
|
16296
16400
|
(event) => {
|
|
16297
16401
|
event.stopPropagation();
|
|
16298
16402
|
onClickChevron?.({ altKey: event.altKey });
|
|
16299
16403
|
},
|
|
16300
16404
|
[onClickChevron]
|
|
16301
16405
|
);
|
|
16302
|
-
return /* @__PURE__ */
|
|
16406
|
+
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(
|
|
16303
16407
|
IconButton,
|
|
16304
16408
|
{
|
|
16305
16409
|
iconName: expanded ? "ChevronDownIcon2" : "ChevronRightIcon2",
|
|
16306
16410
|
onClick: handleClickChevron,
|
|
16307
16411
|
selected: rest.selected
|
|
16308
16412
|
}
|
|
16309
|
-
), /* @__PURE__ */
|
|
16413
|
+
), /* @__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);
|
|
16310
16414
|
});
|
|
16311
16415
|
var TreeView;
|
|
16312
16416
|
((TreeView2) => {
|
|
16313
16417
|
TreeView2.Root = ListView.Root;
|
|
16314
16418
|
TreeView2.RowTitle = ListView.RowTitle;
|
|
16315
16419
|
TreeView2.EditableRowTitle = ListView.EditableRowTitle;
|
|
16316
|
-
TreeView2.Row = (0,
|
|
16420
|
+
TreeView2.Row = (0, import_react62.memo)(TreeRow);
|
|
16317
16421
|
})(TreeView || (TreeView = {}));
|
|
16318
16422
|
|
|
16319
16423
|
// src/components/WorkspaceLayout.tsx
|
|
16320
16424
|
var import_noya_keymap5 = require("@noya-app/noya-keymap");
|
|
16321
|
-
var
|
|
16425
|
+
var import_react65 = __toESM(require("react"));
|
|
16322
16426
|
var import_react_resizable_panels = require("react-resizable-panels");
|
|
16323
16427
|
|
|
16324
16428
|
// src/hooks/usePreservePanelSize.tsx
|
|
16325
|
-
var
|
|
16429
|
+
var import_react64 = require("react");
|
|
16326
16430
|
|
|
16327
16431
|
// src/hooks/useWindowSize.tsx
|
|
16328
|
-
var
|
|
16432
|
+
var import_react63 = require("react");
|
|
16329
16433
|
function useWindowSize() {
|
|
16330
|
-
const [size3, setSize] = (0,
|
|
16434
|
+
const [size3, setSize] = (0, import_react63.useState)(
|
|
16331
16435
|
typeof window === "undefined" ? { width: 0, height: 0 } : {
|
|
16332
16436
|
width: window.innerWidth,
|
|
16333
16437
|
height: window.innerHeight
|
|
16334
16438
|
}
|
|
16335
16439
|
);
|
|
16336
|
-
(0,
|
|
16440
|
+
(0, import_react63.useEffect)(() => {
|
|
16337
16441
|
const handleResize = () => setSize({
|
|
16338
16442
|
width: window.innerWidth,
|
|
16339
16443
|
height: window.innerHeight
|
|
@@ -16351,8 +16455,8 @@ var RIGHT_SIDEBAR_ID = "editor-right-sidebar";
|
|
|
16351
16455
|
var CONTENT_AREA_ID = "editor-content-area";
|
|
16352
16456
|
function usePreservePanelSize(panelGroupRef, setPanelLayoutState) {
|
|
16353
16457
|
const windowSize = useWindowSize();
|
|
16354
|
-
const layoutRef = (0,
|
|
16355
|
-
(0,
|
|
16458
|
+
const layoutRef = (0, import_react64.useRef)();
|
|
16459
|
+
(0, import_react64.useLayoutEffect)(() => {
|
|
16356
16460
|
const panelGroup = document.querySelector(
|
|
16357
16461
|
`[data-panel-group-id="${EDITOR_PANEL_GROUP_ID}"]`
|
|
16358
16462
|
);
|
|
@@ -16395,7 +16499,7 @@ function usePreservePanelSize(panelGroupRef, setPanelLayoutState) {
|
|
|
16395
16499
|
panelGroupObserver.disconnect();
|
|
16396
16500
|
};
|
|
16397
16501
|
}, [panelGroupRef, setPanelLayoutState]);
|
|
16398
|
-
(0,
|
|
16502
|
+
(0, import_react64.useLayoutEffect)(() => {
|
|
16399
16503
|
if (!layoutRef.current) return;
|
|
16400
16504
|
const {
|
|
16401
16505
|
windowWidth: oldWindowWidth,
|
|
@@ -16454,7 +16558,7 @@ function usePreservePanelSize(panelGroupRef, setPanelLayoutState) {
|
|
|
16454
16558
|
}
|
|
16455
16559
|
|
|
16456
16560
|
// src/components/WorkspaceLayout.tsx
|
|
16457
|
-
var WorkspaceLayoutWithTheme = (0,
|
|
16561
|
+
var WorkspaceLayoutWithTheme = (0, import_react65.forwardRef)(function WorkspaceLayoutWithTheme2({
|
|
16458
16562
|
autoSavePrefix,
|
|
16459
16563
|
leftSidebarContent: leftPanelContent,
|
|
16460
16564
|
children: centerPanelContent,
|
|
@@ -16479,11 +16583,11 @@ var WorkspaceLayoutWithTheme = (0, import_react64.forwardRef)(function Workspace
|
|
|
16479
16583
|
const rightSidebarPercentage = getPercentage(rightSidebarInitialSize);
|
|
16480
16584
|
const leftSidebarMinPercentage = leftSidebarMinSize !== void 0 ? getPercentage(leftSidebarMinSize) : void 0;
|
|
16481
16585
|
const rightSidebarMinPercentage = rightSidebarMinSize !== void 0 ? getPercentage(rightSidebarMinSize) : void 0;
|
|
16482
|
-
const panelGroupRef = (0,
|
|
16483
|
-
const leftSidebarRef = (0,
|
|
16484
|
-
const rightSidebarRef = (0,
|
|
16485
|
-
const [internalLayoutState, setInternalLayoutState] = (0,
|
|
16486
|
-
const handleChangeLayoutState = (0,
|
|
16586
|
+
const panelGroupRef = (0, import_react65.useRef)(null);
|
|
16587
|
+
const leftSidebarRef = (0, import_react65.useRef)(null);
|
|
16588
|
+
const rightSidebarRef = (0, import_react65.useRef)(null);
|
|
16589
|
+
const [internalLayoutState, setInternalLayoutState] = (0, import_react65.useState)(null);
|
|
16590
|
+
const handleChangeLayoutState = (0, import_react65.useCallback)(
|
|
16487
16591
|
(state) => {
|
|
16488
16592
|
setInternalLayoutState(state);
|
|
16489
16593
|
onChangeLayoutState?.(state);
|
|
@@ -16491,7 +16595,7 @@ var WorkspaceLayoutWithTheme = (0, import_react64.forwardRef)(function Workspace
|
|
|
16491
16595
|
[onChangeLayoutState]
|
|
16492
16596
|
);
|
|
16493
16597
|
usePreservePanelSize(panelGroupRef, handleChangeLayoutState);
|
|
16494
|
-
(0,
|
|
16598
|
+
(0, import_react65.useImperativeHandle)(forwardedRef, () => ({
|
|
16495
16599
|
setLeftSidebarExpanded: (expanded) => {
|
|
16496
16600
|
if (expanded) {
|
|
16497
16601
|
leftSidebarRef.current?.expand();
|
|
@@ -16548,7 +16652,7 @@ var WorkspaceLayoutWithTheme = (0, import_react64.forwardRef)(function Workspace
|
|
|
16548
16652
|
}
|
|
16549
16653
|
});
|
|
16550
16654
|
const centerPanelPercentage = 100 - (leftPanelContent ? leftSidebarPercentage : 0) - (rightPanelContent ? rightSidebarPercentage : 0);
|
|
16551
|
-
return /* @__PURE__ */
|
|
16655
|
+
return /* @__PURE__ */ import_react65.default.createElement(
|
|
16552
16656
|
"div",
|
|
16553
16657
|
{
|
|
16554
16658
|
id,
|
|
@@ -16560,7 +16664,7 @@ var WorkspaceLayoutWithTheme = (0, import_react64.forwardRef)(function Workspace
|
|
|
16560
16664
|
...style5
|
|
16561
16665
|
}
|
|
16562
16666
|
},
|
|
16563
|
-
/* @__PURE__ */
|
|
16667
|
+
/* @__PURE__ */ import_react65.default.createElement(
|
|
16564
16668
|
import_react_resizable_panels.PanelGroup,
|
|
16565
16669
|
{
|
|
16566
16670
|
ref: panelGroupRef,
|
|
@@ -16569,7 +16673,7 @@ var WorkspaceLayoutWithTheme = (0, import_react64.forwardRef)(function Workspace
|
|
|
16569
16673
|
autoSaveId: autoSavePrefix ? `${autoSavePrefix}--${EDITOR_PANEL_GROUP_ID}` : void 0,
|
|
16570
16674
|
style: { flex: "1" }
|
|
16571
16675
|
},
|
|
16572
|
-
hasLeftSidebar && /* @__PURE__ */
|
|
16676
|
+
hasLeftSidebar && /* @__PURE__ */ import_react65.default.createElement(import_react65.default.Fragment, null, /* @__PURE__ */ import_react65.default.createElement(
|
|
16573
16677
|
import_react_resizable_panels.Panel,
|
|
16574
16678
|
{
|
|
16575
16679
|
id: LEFT_SIDEBAR_ID,
|
|
@@ -16586,7 +16690,7 @@ var WorkspaceLayoutWithTheme = (0, import_react64.forwardRef)(function Workspace
|
|
|
16586
16690
|
}
|
|
16587
16691
|
},
|
|
16588
16692
|
internalLayoutState?.leftSidebarCollapsed ? null : leftPanelContent
|
|
16589
|
-
), /* @__PURE__ */
|
|
16693
|
+
), /* @__PURE__ */ import_react65.default.createElement(
|
|
16590
16694
|
import_react_resizable_panels.PanelResizeHandle,
|
|
16591
16695
|
{
|
|
16592
16696
|
style: {
|
|
@@ -16597,7 +16701,7 @@ var WorkspaceLayoutWithTheme = (0, import_react64.forwardRef)(function Workspace
|
|
|
16597
16701
|
}
|
|
16598
16702
|
}
|
|
16599
16703
|
)),
|
|
16600
|
-
/* @__PURE__ */
|
|
16704
|
+
/* @__PURE__ */ import_react65.default.createElement(
|
|
16601
16705
|
import_react_resizable_panels.Panel,
|
|
16602
16706
|
{
|
|
16603
16707
|
id: CONTENT_AREA_ID,
|
|
@@ -16612,7 +16716,7 @@ var WorkspaceLayoutWithTheme = (0, import_react64.forwardRef)(function Workspace
|
|
|
16612
16716
|
},
|
|
16613
16717
|
centerPanelContent
|
|
16614
16718
|
),
|
|
16615
|
-
hasRightSidebar && /* @__PURE__ */
|
|
16719
|
+
hasRightSidebar && /* @__PURE__ */ import_react65.default.createElement(import_react65.default.Fragment, null, /* @__PURE__ */ import_react65.default.createElement(
|
|
16616
16720
|
import_react_resizable_panels.PanelResizeHandle,
|
|
16617
16721
|
{
|
|
16618
16722
|
style: {
|
|
@@ -16622,7 +16726,7 @@ var WorkspaceLayoutWithTheme = (0, import_react64.forwardRef)(function Workspace
|
|
|
16622
16726
|
backgroundColor: "var(--divider)"
|
|
16623
16727
|
}
|
|
16624
16728
|
}
|
|
16625
|
-
), /* @__PURE__ */
|
|
16729
|
+
), /* @__PURE__ */ import_react65.default.createElement(
|
|
16626
16730
|
import_react_resizable_panels.Panel,
|
|
16627
16731
|
{
|
|
16628
16732
|
id: RIGHT_SIDEBAR_ID,
|
|
@@ -16642,8 +16746,8 @@ var WorkspaceLayoutWithTheme = (0, import_react64.forwardRef)(function Workspace
|
|
|
16642
16746
|
)
|
|
16643
16747
|
);
|
|
16644
16748
|
});
|
|
16645
|
-
var WorkspaceLayout = (0,
|
|
16646
|
-
return /* @__PURE__ */
|
|
16749
|
+
var WorkspaceLayout = (0, import_react65.forwardRef)(function WorkspaceLayout2(props, forwardedRef) {
|
|
16750
|
+
return /* @__PURE__ */ import_react65.default.createElement(WorkspaceLayoutWithTheme, { ...props, ref: forwardedRef });
|
|
16647
16751
|
});
|
|
16648
16752
|
|
|
16649
16753
|
// src/hooks/usePlatform.ts
|
|
@@ -16688,10 +16792,10 @@ function createSectionedMenu(...sections) {
|
|
|
16688
16792
|
}
|
|
16689
16793
|
|
|
16690
16794
|
// src/hooks/useDarkMode.ts
|
|
16691
|
-
var
|
|
16795
|
+
var import_react66 = require("react");
|
|
16692
16796
|
function useDarkMode(elementRef) {
|
|
16693
|
-
const [isDark, setIsDark] = (0,
|
|
16694
|
-
(0,
|
|
16797
|
+
const [isDark, setIsDark] = (0, import_react66.useState)(false);
|
|
16798
|
+
(0, import_react66.useEffect)(() => {
|
|
16695
16799
|
if (!elementRef.current) return;
|
|
16696
16800
|
const hasDarkTheme = elementRef.current.closest('[data-theme="dark"]') !== null;
|
|
16697
16801
|
setIsDark(hasDarkTheme);
|
|
@@ -16714,11 +16818,11 @@ var SUPPORTED_CANVAS_UPLOAD_TYPES = [
|
|
|
16714
16818
|
|
|
16715
16819
|
// src/components/DimensionInput.tsx
|
|
16716
16820
|
var import_noya_utils10 = require("@noya-app/noya-utils");
|
|
16717
|
-
var
|
|
16821
|
+
var import_react67 = __toESM(require("react"));
|
|
16718
16822
|
function getNewValue(value, mode, delta) {
|
|
16719
16823
|
return delta === void 0 ? value : mode === "replace" ? delta : value + delta;
|
|
16720
16824
|
}
|
|
16721
|
-
var DimensionInput = (0,
|
|
16825
|
+
var DimensionInput = (0, import_react67.memo)(function DimensionInput2({
|
|
16722
16826
|
id,
|
|
16723
16827
|
value,
|
|
16724
16828
|
onSetValue,
|
|
@@ -16728,15 +16832,15 @@ var DimensionInput = (0, import_react66.memo)(function DimensionInput2({
|
|
|
16728
16832
|
disabled,
|
|
16729
16833
|
trigger = "submit"
|
|
16730
16834
|
}) {
|
|
16731
|
-
const handleNudgeValue = (0,
|
|
16835
|
+
const handleNudgeValue = (0, import_react67.useCallback)(
|
|
16732
16836
|
(value2) => onSetValue(value2, "adjust"),
|
|
16733
16837
|
[onSetValue]
|
|
16734
16838
|
);
|
|
16735
|
-
const handleSetValue = (0,
|
|
16839
|
+
const handleSetValue = (0, import_react67.useCallback)(
|
|
16736
16840
|
(value2) => onSetValue(value2, "replace"),
|
|
16737
16841
|
[onSetValue]
|
|
16738
16842
|
);
|
|
16739
|
-
return /* @__PURE__ */
|
|
16843
|
+
return /* @__PURE__ */ import_react67.default.createElement(InputField.Root, { id, width: size3 }, /* @__PURE__ */ import_react67.default.createElement(
|
|
16740
16844
|
InputField.NumberInput,
|
|
16741
16845
|
{
|
|
16742
16846
|
value: value === void 0 ? value : (0, import_noya_utils10.round)(value, 2),
|
|
@@ -16745,13 +16849,13 @@ var DimensionInput = (0, import_react66.memo)(function DimensionInput2({
|
|
|
16745
16849
|
disabled,
|
|
16746
16850
|
...trigger === "change" ? { onChange: handleSetValue } : { onSubmit: handleSetValue }
|
|
16747
16851
|
}
|
|
16748
|
-
), label && /* @__PURE__ */
|
|
16852
|
+
), label && /* @__PURE__ */ import_react67.default.createElement(InputField.Label, null, label));
|
|
16749
16853
|
});
|
|
16750
16854
|
|
|
16751
16855
|
// src/components/InspectorPrimitives.tsx
|
|
16752
16856
|
var InspectorPrimitives_exports = {};
|
|
16753
16857
|
__export(InspectorPrimitives_exports, {
|
|
16754
|
-
Checkbox: () =>
|
|
16858
|
+
Checkbox: () => Checkbox3,
|
|
16755
16859
|
Column: () => Column2,
|
|
16756
16860
|
HorizontalSeparator: () => HorizontalSeparator,
|
|
16757
16861
|
LabeledRow: () => LabeledRow,
|
|
@@ -16763,8 +16867,8 @@ __export(InspectorPrimitives_exports, {
|
|
|
16763
16867
|
Title: () => Title3,
|
|
16764
16868
|
VerticalSeparator: () => VerticalSeparator
|
|
16765
16869
|
});
|
|
16766
|
-
var
|
|
16767
|
-
var Section2 = (0,
|
|
16870
|
+
var import_react68 = __toESM(require("react"));
|
|
16871
|
+
var Section2 = (0, import_react68.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ import_react68.default.createElement(
|
|
16768
16872
|
"div",
|
|
16769
16873
|
{
|
|
16770
16874
|
ref,
|
|
@@ -16772,8 +16876,8 @@ var Section2 = (0, import_react67.forwardRef)(({ className, ...props }, ref) =>
|
|
|
16772
16876
|
...props
|
|
16773
16877
|
}
|
|
16774
16878
|
));
|
|
16775
|
-
var SectionHeader = (0,
|
|
16776
|
-
var Title3 = (0,
|
|
16879
|
+
var SectionHeader = (0, import_react68.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ import_react68.default.createElement("div", { ref, className: cn("flex items-center", className), ...props }));
|
|
16880
|
+
var Title3 = (0, import_react68.forwardRef)(({ className, $textStyle, ...props }, ref) => /* @__PURE__ */ import_react68.default.createElement(
|
|
16777
16881
|
"div",
|
|
16778
16882
|
{
|
|
16779
16883
|
ref,
|
|
@@ -16781,7 +16885,7 @@ var Title3 = (0, import_react67.forwardRef)(({ className, $textStyle, ...props }
|
|
|
16781
16885
|
...props
|
|
16782
16886
|
}
|
|
16783
16887
|
));
|
|
16784
|
-
var Row = (0,
|
|
16888
|
+
var Row = (0, import_react68.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ import_react68.default.createElement(
|
|
16785
16889
|
"div",
|
|
16786
16890
|
{
|
|
16787
16891
|
ref,
|
|
@@ -16789,7 +16893,7 @@ var Row = (0, import_react67.forwardRef)(({ className, ...props }, ref) => /* @_
|
|
|
16789
16893
|
...props
|
|
16790
16894
|
}
|
|
16791
16895
|
));
|
|
16792
|
-
var Column2 = (0,
|
|
16896
|
+
var Column2 = (0, import_react68.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ import_react68.default.createElement(
|
|
16793
16897
|
"div",
|
|
16794
16898
|
{
|
|
16795
16899
|
ref,
|
|
@@ -16797,7 +16901,7 @@ var Column2 = (0, import_react67.forwardRef)(({ className, ...props }, ref) => /
|
|
|
16797
16901
|
...props
|
|
16798
16902
|
}
|
|
16799
16903
|
));
|
|
16800
|
-
var
|
|
16904
|
+
var Checkbox3 = (0, import_react68.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ import_react68.default.createElement(
|
|
16801
16905
|
"input",
|
|
16802
16906
|
{
|
|
16803
16907
|
ref,
|
|
@@ -16806,7 +16910,7 @@ var Checkbox = (0, import_react67.forwardRef)(({ className, ...props }, ref) =>
|
|
|
16806
16910
|
...props
|
|
16807
16911
|
}
|
|
16808
16912
|
));
|
|
16809
|
-
var Text3 = (0,
|
|
16913
|
+
var Text3 = (0, import_react68.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ import_react68.default.createElement(
|
|
16810
16914
|
"span",
|
|
16811
16915
|
{
|
|
16812
16916
|
ref,
|
|
@@ -16814,10 +16918,10 @@ var Text3 = (0, import_react67.forwardRef)(({ className, ...props }, ref) => /*
|
|
|
16814
16918
|
...props
|
|
16815
16919
|
}
|
|
16816
16920
|
));
|
|
16817
|
-
var VerticalSeparator = () => /* @__PURE__ */
|
|
16818
|
-
var HorizontalSeparator = () => /* @__PURE__ */
|
|
16819
|
-
var RowLabel = (0,
|
|
16820
|
-
return /* @__PURE__ */
|
|
16921
|
+
var VerticalSeparator = () => /* @__PURE__ */ import_react68.default.createElement(Spacer.Vertical, { size: "inspector-v-separator" });
|
|
16922
|
+
var HorizontalSeparator = () => /* @__PURE__ */ import_react68.default.createElement(Spacer.Horizontal, { size: "inspector-h-separator" });
|
|
16923
|
+
var RowLabel = (0, import_react68.forwardRef)(function RowLabel2({ className, $textStyle, ...props }, ref) {
|
|
16924
|
+
return /* @__PURE__ */ import_react68.default.createElement(
|
|
16821
16925
|
"span",
|
|
16822
16926
|
{
|
|
16823
16927
|
ref,
|
|
@@ -16826,7 +16930,7 @@ var RowLabel = (0, import_react67.forwardRef)(function RowLabel2({ className, $t
|
|
|
16826
16930
|
}
|
|
16827
16931
|
);
|
|
16828
16932
|
});
|
|
16829
|
-
var LabeledRow = (0,
|
|
16933
|
+
var LabeledRow = (0, import_react68.memo)(function LabeledRow2({
|
|
16830
16934
|
id,
|
|
16831
16935
|
children: children2,
|
|
16832
16936
|
label,
|
|
@@ -16834,7 +16938,7 @@ var LabeledRow = (0, import_react67.memo)(function LabeledRow2({
|
|
|
16834
16938
|
right,
|
|
16835
16939
|
className
|
|
16836
16940
|
}) {
|
|
16837
|
-
return /* @__PURE__ */
|
|
16941
|
+
return /* @__PURE__ */ import_react68.default.createElement(Row, { id, className: className ?? "" }, /* @__PURE__ */ import_react68.default.createElement(Column2, null, /* @__PURE__ */ import_react68.default.createElement(RowLabel, { $textStyle: labelTextStyle }, label, right && /* @__PURE__ */ import_react68.default.createElement(Spacer.Horizontal, null), right), /* @__PURE__ */ import_react68.default.createElement(Row, null, children2)));
|
|
16838
16942
|
});
|
|
16839
16943
|
// Annotate the CommonJS export names for ESM import in node:
|
|
16840
16944
|
0 && (module.exports = {
|
|
@@ -16845,6 +16949,7 @@ var LabeledRow = (0, import_react67.memo)(function LabeledRow2({
|
|
|
16845
16949
|
Body,
|
|
16846
16950
|
Button,
|
|
16847
16951
|
CONTENT_AREA_ID,
|
|
16952
|
+
Checkbox,
|
|
16848
16953
|
Chip,
|
|
16849
16954
|
CompletionMenu,
|
|
16850
16955
|
ContextMenu,
|