@noya-app/noya-designsystem 0.1.66 → 0.1.68
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 +11 -11
- package/CHANGELOG.md +14 -0
- package/dist/index.css +1 -1
- package/dist/index.d.mts +81 -5
- package/dist/index.d.ts +81 -5
- package/dist/index.js +1205 -857
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1047 -698
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -2
- package/src/components/Anchor.tsx +30 -0
- package/src/components/BaseToolbar.tsx +11 -8
- package/src/components/Chip.tsx +16 -2
- package/src/components/Collection.tsx +10 -0
- package/src/components/Combobox.tsx +30 -21
- package/src/components/ComboboxMenu.tsx +49 -18
- package/src/components/Dialog.tsx +7 -1
- package/src/components/EditableText.tsx +7 -3
- package/src/components/Grid.tsx +2 -0
- package/src/components/GridView.tsx +52 -9
- package/src/components/List.tsx +54 -9
- package/src/components/ListView.tsx +44 -0
- package/src/components/ScrollArea2.tsx +56 -0
- package/src/components/SearchCompletionMenu.tsx +6 -2
- package/src/components/TreeView.tsx +4 -0
- package/src/components/UserPointer.tsx +34 -7
- package/src/components/connected-users-menu/ConnectedUsersMenuLayout.tsx +1 -3
- package/src/components/listView/ListViewEditableRowTitle.tsx +23 -1
- package/src/components/listView/ListViewRoot.tsx +45 -13
- package/src/components/sorting/Sortable.tsx +22 -10
- package/src/components/workspace/WorkspaceLayout.tsx +62 -4
- package/src/components/workspace/WorkspaceSideContext.tsx +18 -0
- package/src/components/workspace/renderPanelChildren.tsx +2 -2
- package/src/components/workspace/types.ts +8 -1
- package/src/contexts/DialogContext.tsx +22 -10
- package/src/index.css +143 -1
- package/src/index.tsx +4 -0
- package/src/theme/proseTheme.ts +2 -0
- package/src/utils/combobox.ts +17 -2
- package/src/utils/detailLineClamp.ts +33 -0
- package/tailwind.config.ts +3 -1
package/dist/index.mjs
CHANGED
|
@@ -395,14 +395,14 @@ var require_grammarDiagnostics = __commonJS({
|
|
|
395
395
|
rootNonTerminating.add(name);
|
|
396
396
|
}
|
|
397
397
|
}
|
|
398
|
-
const
|
|
398
|
+
const memo41 = /* @__PURE__ */ new Map();
|
|
399
399
|
const collectCauses = (name, path) => {
|
|
400
|
-
if (
|
|
401
|
-
return
|
|
400
|
+
if (memo41.has(name)) {
|
|
401
|
+
return memo41.get(name);
|
|
402
402
|
}
|
|
403
403
|
if (rootNonTerminating.has(name)) {
|
|
404
404
|
const direct = /* @__PURE__ */ new Set([name]);
|
|
405
|
-
|
|
405
|
+
memo41.set(name, direct);
|
|
406
406
|
return direct;
|
|
407
407
|
}
|
|
408
408
|
if (path.has(name)) {
|
|
@@ -421,7 +421,7 @@ var require_grammarDiagnostics = __commonJS({
|
|
|
421
421
|
}
|
|
422
422
|
}
|
|
423
423
|
path.delete(name);
|
|
424
|
-
|
|
424
|
+
memo41.set(name, result);
|
|
425
425
|
return result;
|
|
426
426
|
};
|
|
427
427
|
const dependencyIssues = [];
|
|
@@ -4128,7 +4128,7 @@ import React21, {
|
|
|
4128
4128
|
} from "react";
|
|
4129
4129
|
|
|
4130
4130
|
// src/components/Dialog.tsx
|
|
4131
|
-
import { Dialog as DialogPrimitive } from "radix-ui";
|
|
4131
|
+
import { Dialog as DialogPrimitive, VisuallyHidden } from "radix-ui";
|
|
4132
4132
|
import React14, {
|
|
4133
4133
|
forwardRef as forwardRef6,
|
|
4134
4134
|
useImperativeHandle,
|
|
@@ -4204,6 +4204,7 @@ var Dialog = forwardRef6(function Dialog2({
|
|
|
4204
4204
|
onOpenAutoFocus,
|
|
4205
4205
|
style: style2,
|
|
4206
4206
|
className,
|
|
4207
|
+
"aria-describedby": typeof description === "string" ? description : "",
|
|
4207
4208
|
...closeOnInteractOutside === false && {
|
|
4208
4209
|
onPointerDownOutside: (event) => event.preventDefault(),
|
|
4209
4210
|
onInteractOutside: (event) => event.preventDefault()
|
|
@@ -4222,6 +4223,7 @@ var Dialog = forwardRef6(function Dialog2({
|
|
|
4222
4223
|
}
|
|
4223
4224
|
)),
|
|
4224
4225
|
title && /* @__PURE__ */ React14.createElement(React14.Fragment, null, /* @__PURE__ */ React14.createElement(StyledTitle, null, title), /* @__PURE__ */ React14.createElement(Spacer.Vertical, { size: description ? 10 : 20 })),
|
|
4226
|
+
!title && /* @__PURE__ */ React14.createElement(VisuallyHidden.Root, null, /* @__PURE__ */ React14.createElement(StyledTitle, null, "Dialog")),
|
|
4225
4227
|
description && /* @__PURE__ */ React14.createElement(React14.Fragment, null, /* @__PURE__ */ React14.createElement(StyledDescription, null, description), /* @__PURE__ */ React14.createElement(Spacer.Vertical, { size: 20 })),
|
|
4226
4228
|
children
|
|
4227
4229
|
));
|
|
@@ -5311,6 +5313,7 @@ var DialogProvider = function DialogProvider2({
|
|
|
5311
5313
|
[submit]
|
|
5312
5314
|
);
|
|
5313
5315
|
const inputRef = useRef11(null);
|
|
5316
|
+
const confirmButtonRef = useRef11(null);
|
|
5314
5317
|
const dialogRef = useRef11(null);
|
|
5315
5318
|
const containsElement = useCallback14((element) => {
|
|
5316
5319
|
if (!dialogRef.current) return false;
|
|
@@ -5349,14 +5352,23 @@ var DialogProvider = function DialogProvider2({
|
|
|
5349
5352
|
),
|
|
5350
5353
|
onOpenAutoFocus: useCallback14(
|
|
5351
5354
|
(event) => {
|
|
5352
|
-
|
|
5353
|
-
|
|
5354
|
-
|
|
5355
|
-
|
|
5356
|
-
|
|
5357
|
-
|
|
5358
|
-
|
|
5359
|
-
|
|
5355
|
+
if (!contents) return;
|
|
5356
|
+
if (contents.type === "input") {
|
|
5357
|
+
event.stopPropagation();
|
|
5358
|
+
event.preventDefault();
|
|
5359
|
+
inputRef.current?.focus();
|
|
5360
|
+
inputRef.current?.setSelectionRange(
|
|
5361
|
+
0,
|
|
5362
|
+
inputRef.current.value.length
|
|
5363
|
+
);
|
|
5364
|
+
return;
|
|
5365
|
+
}
|
|
5366
|
+
if (contents.type === "confirmation") {
|
|
5367
|
+
event.stopPropagation();
|
|
5368
|
+
event.preventDefault();
|
|
5369
|
+
confirmButtonRef.current?.focus();
|
|
5370
|
+
return;
|
|
5371
|
+
}
|
|
5360
5372
|
},
|
|
5361
5373
|
[contents]
|
|
5362
5374
|
)
|
|
@@ -5373,6 +5385,8 @@ var DialogProvider = function DialogProvider2({
|
|
|
5373
5385
|
), /* @__PURE__ */ React21.createElement(Spacer.Horizontal, { size: 16 }), /* @__PURE__ */ React21.createElement(
|
|
5374
5386
|
Button,
|
|
5375
5387
|
{
|
|
5388
|
+
colorScheme: "primary",
|
|
5389
|
+
ref: confirmButtonRef,
|
|
5376
5390
|
onClick: () => {
|
|
5377
5391
|
contents.resolve(true);
|
|
5378
5392
|
setContents(void 0);
|
|
@@ -6615,9 +6629,28 @@ var AIAssistantLayout = forwardRef13(
|
|
|
6615
6629
|
}
|
|
6616
6630
|
);
|
|
6617
6631
|
|
|
6632
|
+
// src/components/Anchor.tsx
|
|
6633
|
+
import React38, { forwardRef as forwardRef14 } from "react";
|
|
6634
|
+
var Anchor = forwardRef14(function Anchor2({ className, active, children, as, ...props }, ref) {
|
|
6635
|
+
const Component = as ?? "a";
|
|
6636
|
+
return /* @__PURE__ */ React38.createElement(
|
|
6637
|
+
Component,
|
|
6638
|
+
{
|
|
6639
|
+
ref,
|
|
6640
|
+
className: cx(
|
|
6641
|
+
"n-font-sans n-text-heading5 n-text-breadcrumb-text n-font-normal hover:n-text-breadcrumb-text-hover n-leading-[19px] n-rounded n-no-underline n-inline-flex n-items-center n-justify-center n-gap-2 hover:n-opacity-80 active:n-opacity-90 n-select-none",
|
|
6642
|
+
active ? "n-text-text !n-underline n-decoration-text-decorative-light" : "n-text-text-muted",
|
|
6643
|
+
className
|
|
6644
|
+
),
|
|
6645
|
+
...props
|
|
6646
|
+
},
|
|
6647
|
+
children
|
|
6648
|
+
);
|
|
6649
|
+
});
|
|
6650
|
+
|
|
6618
6651
|
// src/components/AnimatePresence.tsx
|
|
6619
6652
|
import { isDeepEqual as isDeepEqual3 } from "@noya-app/noya-utils";
|
|
6620
|
-
import
|
|
6653
|
+
import React39, {
|
|
6621
6654
|
Children as Children2,
|
|
6622
6655
|
isValidElement as isValidElement2,
|
|
6623
6656
|
useCallback as useCallback17,
|
|
@@ -6700,7 +6733,7 @@ var PresenceChild = ({
|
|
|
6700
6733
|
if (animationState === "exited" && !isPresent) {
|
|
6701
6734
|
return null;
|
|
6702
6735
|
}
|
|
6703
|
-
return /* @__PURE__ */
|
|
6736
|
+
return /* @__PURE__ */ React39.createElement("div", { style: mergedAnimationStyles[animationState], className }, children);
|
|
6704
6737
|
};
|
|
6705
6738
|
var AnimatePresence = ({
|
|
6706
6739
|
children,
|
|
@@ -6776,7 +6809,7 @@ var AnimatePresence = ({
|
|
|
6776
6809
|
return filtered;
|
|
6777
6810
|
});
|
|
6778
6811
|
}, []);
|
|
6779
|
-
return /* @__PURE__ */
|
|
6812
|
+
return /* @__PURE__ */ React39.createElement(React39.Fragment, null, mountedChildren.map(({ child, isPresent, skipInitialAnimation: skipInitialAnimation2 }) => /* @__PURE__ */ React39.createElement(
|
|
6780
6813
|
PresenceChild,
|
|
6781
6814
|
{
|
|
6782
6815
|
key: child.key,
|
|
@@ -6795,7 +6828,7 @@ var AnimatePresence = ({
|
|
|
6795
6828
|
|
|
6796
6829
|
// src/components/Banner.tsx
|
|
6797
6830
|
import { ExclamationTriangleIcon, InfoCircledIcon } from "@noya-app/noya-icons";
|
|
6798
|
-
import
|
|
6831
|
+
import React40 from "react";
|
|
6799
6832
|
function Banner({
|
|
6800
6833
|
children: label = "No items",
|
|
6801
6834
|
className,
|
|
@@ -6814,7 +6847,7 @@ function Banner({
|
|
|
6814
6847
|
categories: ["textAlign"]
|
|
6815
6848
|
}
|
|
6816
6849
|
);
|
|
6817
|
-
return /* @__PURE__ */
|
|
6850
|
+
return /* @__PURE__ */ React40.createElement(
|
|
6818
6851
|
"div",
|
|
6819
6852
|
{
|
|
6820
6853
|
className: cx(
|
|
@@ -6826,7 +6859,7 @@ function Banner({
|
|
|
6826
6859
|
),
|
|
6827
6860
|
style: style2
|
|
6828
6861
|
},
|
|
6829
|
-
(variant === "info" || variant === "error") && /* @__PURE__ */
|
|
6862
|
+
(variant === "info" || variant === "error") && /* @__PURE__ */ React40.createElement(
|
|
6830
6863
|
Small,
|
|
6831
6864
|
{
|
|
6832
6865
|
className: cx(
|
|
@@ -6835,15 +6868,15 @@ function Banner({
|
|
|
6835
6868
|
)
|
|
6836
6869
|
},
|
|
6837
6870
|
`\u200B`,
|
|
6838
|
-
variant === "error" ? /* @__PURE__ */
|
|
6871
|
+
variant === "error" ? /* @__PURE__ */ React40.createElement(ExclamationTriangleIcon, { className: "n-text-heading5" }) : /* @__PURE__ */ React40.createElement(InfoCircledIcon, { className: "n-text-heading5" })
|
|
6839
6872
|
),
|
|
6840
|
-
/* @__PURE__ */
|
|
6873
|
+
/* @__PURE__ */ React40.createElement(Small, { className: labelClassName, style: labelStyle }, label)
|
|
6841
6874
|
);
|
|
6842
6875
|
}
|
|
6843
6876
|
|
|
6844
6877
|
// src/components/blocks/ImageBlockComponent.tsx
|
|
6845
6878
|
import { ImageIcon } from "@noya-app/noya-icons";
|
|
6846
|
-
import
|
|
6879
|
+
import React41, { forwardRef as forwardRef15 } from "react";
|
|
6847
6880
|
var placeholderClassName = "n-cursor-pointer n-flex n-items-center n-justify-center n-p-4 n-border n-border-dashed n-border-indigo-100 n-rounded-md n-bg-indigo-50";
|
|
6848
6881
|
function decodeImageSrc(src) {
|
|
6849
6882
|
if (!src) return void 0;
|
|
@@ -6853,8 +6886,8 @@ function decodeImageSrc(src) {
|
|
|
6853
6886
|
return void 0;
|
|
6854
6887
|
}
|
|
6855
6888
|
}
|
|
6856
|
-
var ImageLoadingComponent =
|
|
6857
|
-
return /* @__PURE__ */
|
|
6889
|
+
var ImageLoadingComponent = forwardRef15(function ImageLoadingComponent2(props, forwardedRef) {
|
|
6890
|
+
return /* @__PURE__ */ React41.createElement(
|
|
6858
6891
|
"span",
|
|
6859
6892
|
{
|
|
6860
6893
|
...props,
|
|
@@ -6862,11 +6895,11 @@ var ImageLoadingComponent = forwardRef14(function ImageLoadingComponent2(props,
|
|
|
6862
6895
|
contentEditable: false,
|
|
6863
6896
|
className: cx(placeholderClassName, props.className)
|
|
6864
6897
|
},
|
|
6865
|
-
/* @__PURE__ */
|
|
6898
|
+
/* @__PURE__ */ React41.createElement(ActivityIndicator, null)
|
|
6866
6899
|
);
|
|
6867
6900
|
});
|
|
6868
|
-
var ImagePlaceholderComponent =
|
|
6869
|
-
return /* @__PURE__ */
|
|
6901
|
+
var ImagePlaceholderComponent = forwardRef15(function ImagePlaceholderComponent2(props, forwardedRef) {
|
|
6902
|
+
return /* @__PURE__ */ React41.createElement(
|
|
6870
6903
|
"span",
|
|
6871
6904
|
{
|
|
6872
6905
|
...props,
|
|
@@ -6874,11 +6907,11 @@ var ImagePlaceholderComponent = forwardRef14(function ImagePlaceholderComponent2
|
|
|
6874
6907
|
contentEditable: false,
|
|
6875
6908
|
className: cx(placeholderClassName, props.className)
|
|
6876
6909
|
},
|
|
6877
|
-
/* @__PURE__ */
|
|
6910
|
+
/* @__PURE__ */ React41.createElement(ImageIcon, { className: "n-w-[30px] n-h-[30px] n-text-indigo-900 n-pointer-events-none" })
|
|
6878
6911
|
);
|
|
6879
6912
|
});
|
|
6880
|
-
var ImageErrorComponent =
|
|
6881
|
-
return /* @__PURE__ */
|
|
6913
|
+
var ImageErrorComponent = forwardRef15(function ImageErrorComponent2({ src, ...props }, forwardedRef) {
|
|
6914
|
+
return /* @__PURE__ */ React41.createElement(
|
|
6882
6915
|
"span",
|
|
6883
6916
|
{
|
|
6884
6917
|
...props,
|
|
@@ -6886,16 +6919,16 @@ var ImageErrorComponent = forwardRef14(function ImageErrorComponent2({ src, ...p
|
|
|
6886
6919
|
contentEditable: false,
|
|
6887
6920
|
className: cx(placeholderClassName, props.className)
|
|
6888
6921
|
},
|
|
6889
|
-
/* @__PURE__ */
|
|
6922
|
+
/* @__PURE__ */ React41.createElement("span", { className: "n-text-cm-error n-font-mono n-text-sm" }, "Invalid image URL: ", src ?? "No URL provided")
|
|
6890
6923
|
);
|
|
6891
6924
|
});
|
|
6892
|
-
var ImageDisplayComponent =
|
|
6925
|
+
var ImageDisplayComponent = forwardRef15(function ImageDisplayComponent2({
|
|
6893
6926
|
src,
|
|
6894
6927
|
alt,
|
|
6895
6928
|
title,
|
|
6896
6929
|
...props
|
|
6897
6930
|
}, forwardedRef) {
|
|
6898
|
-
return /* @__PURE__ */
|
|
6931
|
+
return /* @__PURE__ */ React41.createElement(
|
|
6899
6932
|
"img",
|
|
6900
6933
|
{
|
|
6901
6934
|
...props,
|
|
@@ -6915,7 +6948,7 @@ var ImageDisplayComponent = forwardRef14(function ImageDisplayComponent2({
|
|
|
6915
6948
|
}
|
|
6916
6949
|
);
|
|
6917
6950
|
});
|
|
6918
|
-
var ImageBlockComponent_ =
|
|
6951
|
+
var ImageBlockComponent_ = forwardRef15(function ImageBlockComponent({
|
|
6919
6952
|
src,
|
|
6920
6953
|
alt,
|
|
6921
6954
|
title,
|
|
@@ -6923,7 +6956,7 @@ var ImageBlockComponent_ = forwardRef14(function ImageBlockComponent({
|
|
|
6923
6956
|
...props
|
|
6924
6957
|
}, forwardedRef) {
|
|
6925
6958
|
if (imageState === "loading") {
|
|
6926
|
-
return /* @__PURE__ */
|
|
6959
|
+
return /* @__PURE__ */ React41.createElement(
|
|
6927
6960
|
ImageLoadingComponent,
|
|
6928
6961
|
{
|
|
6929
6962
|
...props,
|
|
@@ -6932,7 +6965,7 @@ var ImageBlockComponent_ = forwardRef14(function ImageBlockComponent({
|
|
|
6932
6965
|
);
|
|
6933
6966
|
}
|
|
6934
6967
|
if (!src) {
|
|
6935
|
-
return /* @__PURE__ */
|
|
6968
|
+
return /* @__PURE__ */ React41.createElement(
|
|
6936
6969
|
ImagePlaceholderComponent,
|
|
6937
6970
|
{
|
|
6938
6971
|
...props,
|
|
@@ -6942,7 +6975,7 @@ var ImageBlockComponent_ = forwardRef14(function ImageBlockComponent({
|
|
|
6942
6975
|
}
|
|
6943
6976
|
const decodedSrc = decodeImageSrc(src.toString());
|
|
6944
6977
|
if (!decodedSrc || imageState === "error") {
|
|
6945
|
-
return /* @__PURE__ */
|
|
6978
|
+
return /* @__PURE__ */ React41.createElement(
|
|
6946
6979
|
ImageErrorComponent,
|
|
6947
6980
|
{
|
|
6948
6981
|
...props,
|
|
@@ -6951,7 +6984,7 @@ var ImageBlockComponent_ = forwardRef14(function ImageBlockComponent({
|
|
|
6951
6984
|
}
|
|
6952
6985
|
);
|
|
6953
6986
|
}
|
|
6954
|
-
return /* @__PURE__ */
|
|
6987
|
+
return /* @__PURE__ */ React41.createElement(
|
|
6955
6988
|
ImageDisplayComponent,
|
|
6956
6989
|
{
|
|
6957
6990
|
...props,
|
|
@@ -6970,10 +7003,10 @@ var ImageBlockComponent2 = Object.assign(ImageBlockComponent_, {
|
|
|
6970
7003
|
});
|
|
6971
7004
|
|
|
6972
7005
|
// src/components/Breadcrumbs.tsx
|
|
6973
|
-
import { forwardRef as
|
|
6974
|
-
import
|
|
6975
|
-
var BreadcrumbText =
|
|
6976
|
-
return /* @__PURE__ */
|
|
7006
|
+
import { forwardRef as forwardRef16 } from "react";
|
|
7007
|
+
import React42 from "react";
|
|
7008
|
+
var BreadcrumbText = forwardRef16(function BreadcrumbText2({ children, className, onClick, ...props }, ref) {
|
|
7009
|
+
return /* @__PURE__ */ React42.createElement(
|
|
6977
7010
|
Text,
|
|
6978
7011
|
{
|
|
6979
7012
|
...props,
|
|
@@ -6993,7 +7026,7 @@ var slashStyle = {
|
|
|
6993
7026
|
margin: "0 3px"
|
|
6994
7027
|
};
|
|
6995
7028
|
var BreadcrumbSlash = () => {
|
|
6996
|
-
return /* @__PURE__ */
|
|
7029
|
+
return /* @__PURE__ */ React42.createElement(
|
|
6997
7030
|
"svg",
|
|
6998
7031
|
{
|
|
6999
7032
|
width: "7",
|
|
@@ -7004,7 +7037,7 @@ var BreadcrumbSlash = () => {
|
|
|
7004
7037
|
opacity: 0.5,
|
|
7005
7038
|
style: slashStyle
|
|
7006
7039
|
},
|
|
7007
|
-
/* @__PURE__ */
|
|
7040
|
+
/* @__PURE__ */ React42.createElement(
|
|
7008
7041
|
"path",
|
|
7009
7042
|
{
|
|
7010
7043
|
d: "M1 16L6 1",
|
|
@@ -7018,16 +7051,16 @@ var BreadcrumbSlash = () => {
|
|
|
7018
7051
|
};
|
|
7019
7052
|
|
|
7020
7053
|
// src/components/Checkbox.tsx
|
|
7021
|
-
import * as
|
|
7054
|
+
import * as React43 from "react";
|
|
7022
7055
|
var colorSchemeStyles2 = {
|
|
7023
7056
|
normal: "n-text-text-subtle",
|
|
7024
7057
|
primary: "n-text-primary",
|
|
7025
7058
|
secondary: "n-text-secondary"
|
|
7026
7059
|
};
|
|
7027
|
-
var Checkbox =
|
|
7028
|
-
|
|
7060
|
+
var Checkbox = React43.memo(
|
|
7061
|
+
React43.forwardRef(function Checkbox2({ className, style: style2, colorScheme = "primary", ...props }, ref) {
|
|
7029
7062
|
const { fieldId: id } = useLabel({ fieldId: props.id });
|
|
7030
|
-
return /* @__PURE__ */
|
|
7063
|
+
return /* @__PURE__ */ React43.createElement(
|
|
7031
7064
|
"div",
|
|
7032
7065
|
{
|
|
7033
7066
|
className: cx(
|
|
@@ -7037,7 +7070,7 @@ var Checkbox = React42.memo(
|
|
|
7037
7070
|
),
|
|
7038
7071
|
style: style2
|
|
7039
7072
|
},
|
|
7040
|
-
/* @__PURE__ */
|
|
7073
|
+
/* @__PURE__ */ React43.createElement(
|
|
7041
7074
|
"input",
|
|
7042
7075
|
{
|
|
7043
7076
|
ref,
|
|
@@ -7048,7 +7081,7 @@ var Checkbox = React42.memo(
|
|
|
7048
7081
|
id
|
|
7049
7082
|
}
|
|
7050
7083
|
),
|
|
7051
|
-
/* @__PURE__ */
|
|
7084
|
+
/* @__PURE__ */ React43.createElement(
|
|
7052
7085
|
"svg",
|
|
7053
7086
|
{
|
|
7054
7087
|
className: `n-absolute n-inset-0 n-h-input-height n-w-input-height n-pointer-events-none n-stroke-white n-opacity-0 peer-checked:n-opacity-100 n-z-label stroke-[1.3px]`,
|
|
@@ -7057,7 +7090,7 @@ var Checkbox = React42.memo(
|
|
|
7057
7090
|
xmlns: "http://www.w3.org/2000/svg",
|
|
7058
7091
|
"aria-hidden": "true"
|
|
7059
7092
|
},
|
|
7060
|
-
/* @__PURE__ */
|
|
7093
|
+
/* @__PURE__ */ React43.createElement(
|
|
7061
7094
|
"path",
|
|
7062
7095
|
{
|
|
7063
7096
|
d: "M3 6L4.5 7.5L8 4",
|
|
@@ -7073,10 +7106,10 @@ var Checkbox = React42.memo(
|
|
|
7073
7106
|
|
|
7074
7107
|
// src/components/Chip.tsx
|
|
7075
7108
|
import { Cross1Icon, PlusIcon } from "@noya-app/noya-icons";
|
|
7076
|
-
import
|
|
7109
|
+
import React45, { forwardRef as forwardRef18, memo as memo15 } from "react";
|
|
7077
7110
|
|
|
7078
7111
|
// src/hooks/useHover.ts
|
|
7079
|
-
import * as
|
|
7112
|
+
import * as React44 from "react";
|
|
7080
7113
|
var globalIgnoreEmulatedMouseEvents = false;
|
|
7081
7114
|
var hoverCount = 0;
|
|
7082
7115
|
function setGlobalIgnoreEmulatedMouseEvents() {
|
|
@@ -7106,13 +7139,13 @@ function setupGlobalTouchEvents() {
|
|
|
7106
7139
|
}
|
|
7107
7140
|
function useHover(props = {}) {
|
|
7108
7141
|
const { onHoverStart, onHoverChange, onHoverEnd, isDisabled } = props;
|
|
7109
|
-
const [isHovered, setHovered] =
|
|
7110
|
-
const state =
|
|
7142
|
+
const [isHovered, setHovered] = React44.useState(false);
|
|
7143
|
+
const state = React44.useRef({
|
|
7111
7144
|
isHovered: false,
|
|
7112
7145
|
ignoreEmulatedMouseEvents: false
|
|
7113
7146
|
}).current;
|
|
7114
|
-
|
|
7115
|
-
const hoverProps =
|
|
7147
|
+
React44.useEffect(setupGlobalTouchEvents, []);
|
|
7148
|
+
const hoverProps = React44.useMemo(
|
|
7116
7149
|
function getHoverProps() {
|
|
7117
7150
|
function triggerHoverStart(event, pointerType) {
|
|
7118
7151
|
if (isDisabled || pointerType === "touch" || state.isHovered) {
|
|
@@ -7186,6 +7219,13 @@ var SHADOW_STYLES = {
|
|
|
7186
7219
|
error: "n-shadow-[0_0_0_1px_var(--n-chip-error-shadow)_inset]",
|
|
7187
7220
|
default: "n-shadow-[0_0_0_1px_var(--n-chip-default-shadow)_inset]"
|
|
7188
7221
|
};
|
|
7222
|
+
var HOVER_SHADOW_STYLES = {
|
|
7223
|
+
primary: "hover:n-shadow-[0_0_0_1px_var(--n-chip-primary-shadow-hover)_inset]",
|
|
7224
|
+
secondary: "hover:n-shadow-[0_0_0_1px_var(--n-chip-secondary-shadow-hover)_inset]",
|
|
7225
|
+
info: "hover:n-shadow-[0_0_0_1px_var(--n-chip-default-shadow-hover)_inset]",
|
|
7226
|
+
error: "hover:n-shadow-[0_0_0_1px_var(--n-chip-error-shadow-hover)_inset]",
|
|
7227
|
+
default: "hover:n-shadow-[0_0_0_1px_var(--n-chip-default-shadow-hover)_inset]"
|
|
7228
|
+
};
|
|
7189
7229
|
var COLOR_STYLES = {
|
|
7190
7230
|
primary: {
|
|
7191
7231
|
text: "n-text-primary",
|
|
@@ -7233,7 +7273,7 @@ var ICON_SIZE_STYLES = {
|
|
|
7233
7273
|
}
|
|
7234
7274
|
};
|
|
7235
7275
|
var Chip = memo15(
|
|
7236
|
-
|
|
7276
|
+
forwardRef18(function Chip2({
|
|
7237
7277
|
colorScheme,
|
|
7238
7278
|
children,
|
|
7239
7279
|
deletable,
|
|
@@ -7258,7 +7298,12 @@ var Chip = memo15(
|
|
|
7258
7298
|
const handleClick = !children && !deletable && addable ? onAdd : onClick;
|
|
7259
7299
|
const isInteractive = !!handleClick || clickable === true;
|
|
7260
7300
|
const colors = COLOR_STYLES[colorScheme ?? "default"];
|
|
7261
|
-
const variantClasses = variant === "solid" ?
|
|
7301
|
+
const variantClasses = variant === "solid" ? cx(colors.text, colors.bg) : variant === "outlined" ? cx(
|
|
7302
|
+
colors.text,
|
|
7303
|
+
"n-bg-transparent",
|
|
7304
|
+
SHADOW_STYLES[colorScheme ?? "default"],
|
|
7305
|
+
HOVER_SHADOW_STYLES[colorScheme ?? "default"]
|
|
7306
|
+
) : "";
|
|
7262
7307
|
const chipClasses = cx(
|
|
7263
7308
|
BASE_STYLES,
|
|
7264
7309
|
SIZE_STYLES[size],
|
|
@@ -7269,7 +7314,7 @@ var Chip = memo15(
|
|
|
7269
7314
|
className
|
|
7270
7315
|
);
|
|
7271
7316
|
const color = colorScheme === "primary" ? cssVars.colors.primary : colorScheme === "secondary" ? cssVars.colors.secondary : cssVars.colors.text;
|
|
7272
|
-
return /* @__PURE__ */
|
|
7317
|
+
return /* @__PURE__ */ React45.createElement(
|
|
7273
7318
|
"span",
|
|
7274
7319
|
{
|
|
7275
7320
|
ref: forwardedRef,
|
|
@@ -7279,7 +7324,7 @@ var Chip = memo15(
|
|
|
7279
7324
|
tabIndex,
|
|
7280
7325
|
...rest
|
|
7281
7326
|
},
|
|
7282
|
-
addable && /* @__PURE__ */
|
|
7327
|
+
addable && /* @__PURE__ */ React45.createElement(
|
|
7283
7328
|
PlusIcon,
|
|
7284
7329
|
{
|
|
7285
7330
|
className: cx(ICON_BASE_STYLES, ICON_SIZE_STYLES[size].add),
|
|
@@ -7291,7 +7336,7 @@ var Chip = memo15(
|
|
|
7291
7336
|
}
|
|
7292
7337
|
),
|
|
7293
7338
|
children,
|
|
7294
|
-
deletable && /* @__PURE__ */
|
|
7339
|
+
deletable && /* @__PURE__ */ React45.createElement(
|
|
7295
7340
|
Cross1Icon,
|
|
7296
7341
|
{
|
|
7297
7342
|
className: cx(ICON_BASE_STYLES, ICON_SIZE_STYLES[size].delete),
|
|
@@ -7308,10 +7353,10 @@ var Chip = memo15(
|
|
|
7308
7353
|
);
|
|
7309
7354
|
|
|
7310
7355
|
// src/components/Collection.tsx
|
|
7311
|
-
import
|
|
7356
|
+
import React61 from "react";
|
|
7312
7357
|
|
|
7313
7358
|
// src/components/Grid.tsx
|
|
7314
|
-
import
|
|
7359
|
+
import React50, { useImperativeHandle as useImperativeHandle3, useRef as useRef16, useState as useState23 } from "react";
|
|
7315
7360
|
|
|
7316
7361
|
// src/utils/selection.ts
|
|
7317
7362
|
function updateSelection(allIds, selectedIds, clickedId, event) {
|
|
@@ -7339,8 +7384,8 @@ function updateSelection(allIds, selectedIds, clickedId, event) {
|
|
|
7339
7384
|
}
|
|
7340
7385
|
|
|
7341
7386
|
// src/components/EditableText.tsx
|
|
7342
|
-
import
|
|
7343
|
-
forwardRef as
|
|
7387
|
+
import React46, {
|
|
7388
|
+
forwardRef as forwardRef19,
|
|
7344
7389
|
memo as memo16,
|
|
7345
7390
|
useCallback as useCallback18,
|
|
7346
7391
|
useEffect as useEffect17,
|
|
@@ -7348,9 +7393,9 @@ import React45, {
|
|
|
7348
7393
|
useRef as useRef15,
|
|
7349
7394
|
useState as useState21
|
|
7350
7395
|
} from "react";
|
|
7351
|
-
var defaultRenderPreview = (props) => /* @__PURE__ */
|
|
7396
|
+
var defaultRenderPreview = (props) => /* @__PURE__ */ React46.createElement(BreadcrumbText, { ...props });
|
|
7352
7397
|
var EditableText = memo16(
|
|
7353
|
-
|
|
7398
|
+
forwardRef19(function EditableText2({
|
|
7354
7399
|
value,
|
|
7355
7400
|
onChange,
|
|
7356
7401
|
onSubmit,
|
|
@@ -7414,18 +7459,22 @@ var EditableText = memo16(
|
|
|
7414
7459
|
const displayValue = inputValue || placeholder || "";
|
|
7415
7460
|
const preview = children({
|
|
7416
7461
|
children: displayValue,
|
|
7417
|
-
onClick: () =>
|
|
7462
|
+
onClick: () => {
|
|
7463
|
+
if (readOnly) return;
|
|
7464
|
+
setFocused(true);
|
|
7465
|
+
},
|
|
7418
7466
|
ref: previewRef,
|
|
7419
7467
|
tabIndex,
|
|
7420
7468
|
onKeyDown: (e) => {
|
|
7469
|
+
if (readOnly) return;
|
|
7421
7470
|
if (e.key === "Enter" || e.key === " ") {
|
|
7422
7471
|
setFocused(true);
|
|
7423
7472
|
}
|
|
7424
7473
|
},
|
|
7425
7474
|
style: textStyle,
|
|
7426
|
-
className: textClassName
|
|
7475
|
+
className: cx(focused && "n-invisible", textClassName)
|
|
7427
7476
|
});
|
|
7428
|
-
const input = /* @__PURE__ */
|
|
7477
|
+
const input = /* @__PURE__ */ React46.createElement("div", { className: "n-flex n-absolute n-inset-0 -n-mx-1.5 -n-my-1" }, /* @__PURE__ */ React46.createElement(InputField2.Root, { onFocusChange: setFocused }, /* @__PURE__ */ React46.createElement(
|
|
7429
7478
|
InputField2.Input,
|
|
7430
7479
|
{
|
|
7431
7480
|
ref: inputRef,
|
|
@@ -7465,27 +7514,46 @@ var EditableText = memo16(
|
|
|
7465
7514
|
}
|
|
7466
7515
|
}
|
|
7467
7516
|
)));
|
|
7468
|
-
return /* @__PURE__ */
|
|
7517
|
+
return /* @__PURE__ */ React46.createElement("div", { className: cx("n-flex n-relative", className), style: style2 }, preview, focused && !readOnly && input);
|
|
7469
7518
|
})
|
|
7470
7519
|
);
|
|
7471
7520
|
|
|
7472
7521
|
// src/components/GridView.tsx
|
|
7473
|
-
import
|
|
7522
|
+
import React49, {
|
|
7474
7523
|
createContext as createContext9,
|
|
7475
|
-
forwardRef as
|
|
7524
|
+
forwardRef as forwardRef20,
|
|
7476
7525
|
memo as memo18,
|
|
7477
7526
|
useCallback as useCallback21,
|
|
7478
7527
|
useContext as useContext9,
|
|
7479
7528
|
useMemo as useMemo18
|
|
7480
7529
|
} from "react";
|
|
7481
7530
|
|
|
7531
|
+
// src/utils/detailLineClamp.ts
|
|
7532
|
+
var DETAIL_LINE_CLAMP_CLASS_MAP = {
|
|
7533
|
+
1: "n-truncate",
|
|
7534
|
+
2: "n-text-wrap n-line-clamp-2",
|
|
7535
|
+
3: "n-text-wrap n-line-clamp-3",
|
|
7536
|
+
4: "n-text-wrap n-line-clamp-4"
|
|
7537
|
+
};
|
|
7538
|
+
function normalizeDetailLineClamp(lineClamp) {
|
|
7539
|
+
if (lineClamp == null) return void 0;
|
|
7540
|
+
const normalized = Math.floor(lineClamp);
|
|
7541
|
+
if (!Number.isFinite(normalized)) {
|
|
7542
|
+
return void 0;
|
|
7543
|
+
}
|
|
7544
|
+
if (normalized < 1) return 1;
|
|
7545
|
+
if (normalized > 4) return 4;
|
|
7546
|
+
return normalized;
|
|
7547
|
+
}
|
|
7548
|
+
var DETAIL_LINE_CLAMP_CLASSES = DETAIL_LINE_CLAMP_CLASS_MAP;
|
|
7549
|
+
|
|
7482
7550
|
// src/components/ContextMenu.tsx
|
|
7483
7551
|
import { useKeyboardShortcuts as useKeyboardShortcuts2 } from "@noya-app/noya-keymap";
|
|
7484
7552
|
import { ContextMenu as RadixContextMenu } from "radix-ui";
|
|
7485
|
-
import
|
|
7553
|
+
import React47, { useCallback as useCallback19, useMemo as useMemo17 } from "react";
|
|
7486
7554
|
var Components2 = {
|
|
7487
7555
|
Separator: RadixContextMenu.Separator,
|
|
7488
|
-
ItemText:
|
|
7556
|
+
ItemText: React47.Fragment,
|
|
7489
7557
|
Item: RadixContextMenu.Item,
|
|
7490
7558
|
CheckboxItem: RadixContextMenu.CheckboxItem,
|
|
7491
7559
|
ItemIndicator: RadixContextMenu.ItemIndicator,
|
|
@@ -7517,13 +7585,13 @@ function ContextMenuRoot({
|
|
|
7517
7585
|
},
|
|
7518
7586
|
[onSelect]
|
|
7519
7587
|
);
|
|
7520
|
-
return /* @__PURE__ */
|
|
7588
|
+
return /* @__PURE__ */ React47.createElement(RadixContextMenu.Root, { onOpenChange }, /* @__PURE__ */ React47.createElement(RadixContextMenu.Trigger, { asChild: true, onPointerDown }, children), /* @__PURE__ */ React47.createElement(RadixContextMenu.Portal, null, /* @__PURE__ */ React47.createElement(
|
|
7521
7589
|
RadixContextMenu.Content,
|
|
7522
7590
|
{
|
|
7523
7591
|
...portalScopeProps(portalScopeId),
|
|
7524
7592
|
className: styles.contentStyle
|
|
7525
7593
|
},
|
|
7526
|
-
/* @__PURE__ */
|
|
7594
|
+
/* @__PURE__ */ React47.createElement(
|
|
7527
7595
|
MenuViewport,
|
|
7528
7596
|
{
|
|
7529
7597
|
items,
|
|
@@ -7537,26 +7605,26 @@ var ContextMenu = memoGeneric(ContextMenuRoot);
|
|
|
7537
7605
|
|
|
7538
7606
|
// src/components/ScrollArea.tsx
|
|
7539
7607
|
import { ScrollArea as RadixScrollArea } from "radix-ui";
|
|
7540
|
-
import * as
|
|
7541
|
-
var ScrollArea =
|
|
7542
|
-
const [scrollElementRef, setScrollElementRef] =
|
|
7543
|
-
return /* @__PURE__ */
|
|
7608
|
+
import * as React48 from "react";
|
|
7609
|
+
var ScrollArea = React48.memo(function ScrollArea2({ children }) {
|
|
7610
|
+
const [scrollElementRef, setScrollElementRef] = React48.useState(null);
|
|
7611
|
+
return /* @__PURE__ */ React48.createElement("div", { className: "n-flex-1 n-min-h-0" }, /* @__PURE__ */ React48.createElement(RadixScrollArea.Root, { style: { width: "100%", height: "100%" } }, /* @__PURE__ */ React48.createElement(
|
|
7544
7612
|
RadixScrollArea.Viewport,
|
|
7545
7613
|
{
|
|
7546
7614
|
className: "n-w-full n-h-full [&>div]:n-block",
|
|
7547
|
-
ref:
|
|
7615
|
+
ref: React48.useCallback(
|
|
7548
7616
|
(ref) => setScrollElementRef(ref),
|
|
7549
7617
|
[]
|
|
7550
7618
|
)
|
|
7551
7619
|
},
|
|
7552
7620
|
typeof children === "function" ? scrollElementRef ? children(scrollElementRef) : null : children
|
|
7553
|
-
), /* @__PURE__ */
|
|
7621
|
+
), /* @__PURE__ */ React48.createElement(
|
|
7554
7622
|
RadixScrollArea.Scrollbar,
|
|
7555
7623
|
{
|
|
7556
7624
|
orientation: "vertical",
|
|
7557
7625
|
className: "n-scroll-component n-flex n-p-[3px] data-[orientation=vertical]:n-w-[10px]"
|
|
7558
7626
|
},
|
|
7559
|
-
/* @__PURE__ */
|
|
7627
|
+
/* @__PURE__ */ React48.createElement(RadixScrollArea.Thumb, { className: "n-scroll-component n-flex-1 n-rounded-[10px] n-bg-scrollbar" })
|
|
7560
7628
|
)));
|
|
7561
7629
|
});
|
|
7562
7630
|
|
|
@@ -7565,7 +7633,7 @@ var ItemTitle = ({
|
|
|
7565
7633
|
showBackground,
|
|
7566
7634
|
children
|
|
7567
7635
|
}) => {
|
|
7568
|
-
return /* @__PURE__ */
|
|
7636
|
+
return /* @__PURE__ */ React49.createElement(
|
|
7569
7637
|
"span",
|
|
7570
7638
|
{
|
|
7571
7639
|
className: cx(
|
|
@@ -7578,13 +7646,17 @@ var ItemTitle = ({
|
|
|
7578
7646
|
};
|
|
7579
7647
|
var ItemDescription = ({
|
|
7580
7648
|
showBackground,
|
|
7581
|
-
children
|
|
7649
|
+
children,
|
|
7650
|
+
lineClamp
|
|
7582
7651
|
}) => {
|
|
7583
|
-
|
|
7652
|
+
const normalizedLineClamp = normalizeDetailLineClamp(lineClamp) ?? 1;
|
|
7653
|
+
const clampClassName = DETAIL_LINE_CLAMP_CLASSES[normalizedLineClamp];
|
|
7654
|
+
return /* @__PURE__ */ React49.createElement(
|
|
7584
7655
|
"span",
|
|
7585
7656
|
{
|
|
7586
7657
|
className: cx(
|
|
7587
|
-
"n-font-sans n-text-sm n-text-text-muted n-select-none
|
|
7658
|
+
"n-font-sans n-text-sm n-text-text-muted n-select-none",
|
|
7659
|
+
clampClassName,
|
|
7588
7660
|
showBackground && "n-bg-sidebar-background n-n-border n-border-divider-subtle n-rounded-[2px] n-backdrop-blur-[4px] n-p-[2px_4px]"
|
|
7589
7661
|
)
|
|
7590
7662
|
},
|
|
@@ -7595,7 +7667,7 @@ var SectionTitle = ({
|
|
|
7595
7667
|
last = false,
|
|
7596
7668
|
children
|
|
7597
7669
|
}) => {
|
|
7598
|
-
return /* @__PURE__ */
|
|
7670
|
+
return /* @__PURE__ */ React49.createElement(
|
|
7599
7671
|
"span",
|
|
7600
7672
|
{
|
|
7601
7673
|
className: cx(
|
|
@@ -7632,7 +7704,13 @@ var GridViewItem = forwardRefGeneric(function GridViewItem2({
|
|
|
7632
7704
|
const { hoverProps } = useHover({
|
|
7633
7705
|
onHoverChange
|
|
7634
7706
|
});
|
|
7635
|
-
const {
|
|
7707
|
+
const {
|
|
7708
|
+
textPosition,
|
|
7709
|
+
bordered,
|
|
7710
|
+
disabled,
|
|
7711
|
+
alwaysShowSubtitles,
|
|
7712
|
+
descriptionLineClamp
|
|
7713
|
+
} = useContext9(GridViewContext);
|
|
7636
7714
|
const handleClick = useCallback21(
|
|
7637
7715
|
(event) => {
|
|
7638
7716
|
event.stopPropagation();
|
|
@@ -7659,7 +7737,7 @@ var GridViewItem = forwardRefGeneric(function GridViewItem2({
|
|
|
7659
7737
|
);
|
|
7660
7738
|
const LinkComponent2 = useLinkComponent();
|
|
7661
7739
|
const Component = typeof href === "string" ? LinkComponent2 : "div";
|
|
7662
|
-
let element = /* @__PURE__ */
|
|
7740
|
+
let element = /* @__PURE__ */ React49.createElement(
|
|
7663
7741
|
Component,
|
|
7664
7742
|
{
|
|
7665
7743
|
...props,
|
|
@@ -7683,7 +7761,7 @@ var GridViewItem = forwardRefGeneric(function GridViewItem2({
|
|
|
7683
7761
|
onDoubleClick,
|
|
7684
7762
|
onContextMenu
|
|
7685
7763
|
},
|
|
7686
|
-
/* @__PURE__ */
|
|
7764
|
+
/* @__PURE__ */ React49.createElement(
|
|
7687
7765
|
"div",
|
|
7688
7766
|
{
|
|
7689
7767
|
className: cx(
|
|
@@ -7694,13 +7772,23 @@ var GridViewItem = forwardRefGeneric(function GridViewItem2({
|
|
|
7694
7772
|
},
|
|
7695
7773
|
children
|
|
7696
7774
|
),
|
|
7697
|
-
textPosition === "below" && /* @__PURE__ */
|
|
7698
|
-
textPosition === "overlay" && hovered && (title || subtitle) && /* @__PURE__ */
|
|
7699
|
-
|
|
7700
|
-
|
|
7775
|
+
textPosition === "below" && /* @__PURE__ */ React49.createElement(React49.Fragment, null, /* @__PURE__ */ React49.createElement(Spacer.Vertical, { size: 8 }), /* @__PURE__ */ React49.createElement(ItemTitle, null, title || " "), (alwaysShowSubtitles || subtitle) && /* @__PURE__ */ React49.createElement(React49.Fragment, null, /* @__PURE__ */ React49.createElement(Spacer.Vertical, { size: 2 }), /* @__PURE__ */ React49.createElement(ItemDescription, { lineClamp: descriptionLineClamp }, subtitle || " "))),
|
|
7776
|
+
textPosition === "overlay" && hovered && (title || subtitle) && /* @__PURE__ */ React49.createElement(
|
|
7777
|
+
"div",
|
|
7778
|
+
{
|
|
7779
|
+
className: cx(
|
|
7780
|
+
"n-absolute n-inset-0 n-flex n-flex-col n-justify-end n-items-start n-p-1 n-pointer-events-none n-gap-0.5",
|
|
7781
|
+
descriptionLineClamp === 1 && "n-truncate"
|
|
7782
|
+
)
|
|
7783
|
+
},
|
|
7784
|
+
title && /* @__PURE__ */ React49.createElement(ItemTitle, { showBackground: true }, title),
|
|
7785
|
+
subtitle && /* @__PURE__ */ React49.createElement(ItemDescription, { showBackground: true, lineClamp: descriptionLineClamp }, subtitle)
|
|
7786
|
+
),
|
|
7787
|
+
action && /* @__PURE__ */ React49.createElement("div", { className: "n-absolute n-top-[7px] n-right-[7px] n-flex n-flex-col n-justify-end n-items-start n-p-1 n-truncate n-gap-0.5" }, action),
|
|
7788
|
+
loading && /* @__PURE__ */ React49.createElement("div", { className: "n-flex n-flex-col n-justify-start n-items-end n-p-1 n-pointer-events-none n-animate-shimmer n-absolute n-inset-0 n-bg-gradient-to-r n-from-white/0 n-via-[rgb(226,232,240)]/50 n-to-white/0 n-bg-[length:200%_100%]" }, /* @__PURE__ */ React49.createElement(ActivityIndicator, { opacity: 0.5, size: 13 }))
|
|
7701
7789
|
);
|
|
7702
7790
|
if (menuItems && onSelectMenuItem) {
|
|
7703
|
-
element = /* @__PURE__ */
|
|
7791
|
+
element = /* @__PURE__ */ React49.createElement(
|
|
7704
7792
|
ContextMenu,
|
|
7705
7793
|
{
|
|
7706
7794
|
items: menuItems,
|
|
@@ -7711,10 +7799,10 @@ var GridViewItem = forwardRefGeneric(function GridViewItem2({
|
|
|
7711
7799
|
);
|
|
7712
7800
|
}
|
|
7713
7801
|
if (textPosition === "toolip") {
|
|
7714
|
-
element = /* @__PURE__ */
|
|
7802
|
+
element = /* @__PURE__ */ React49.createElement(
|
|
7715
7803
|
Tooltip,
|
|
7716
7804
|
{
|
|
7717
|
-
content: /* @__PURE__ */
|
|
7805
|
+
content: /* @__PURE__ */ React49.createElement("div", { className: "n-flex n-flex-col gap-0.5" }, /* @__PURE__ */ React49.createElement(ItemTitle, null, title), /* @__PURE__ */ React49.createElement(ItemDescription, { lineClamp: descriptionLineClamp }, subtitle))
|
|
7718
7806
|
},
|
|
7719
7807
|
element
|
|
7720
7808
|
);
|
|
@@ -7727,9 +7815,10 @@ var GridViewContext = createContext9({
|
|
|
7727
7815
|
bordered: false,
|
|
7728
7816
|
disabled: false,
|
|
7729
7817
|
gap: 0,
|
|
7730
|
-
alwaysShowSubtitles: false
|
|
7818
|
+
alwaysShowSubtitles: false,
|
|
7819
|
+
descriptionLineClamp: 1
|
|
7731
7820
|
});
|
|
7732
|
-
var GridViewRoot =
|
|
7821
|
+
var GridViewRoot = forwardRef20(function GridViewRoot2({
|
|
7733
7822
|
minColumnWidth = "220px",
|
|
7734
7823
|
gap = 20,
|
|
7735
7824
|
children,
|
|
@@ -7741,6 +7830,7 @@ var GridViewRoot = forwardRef19(function GridViewRoot2({
|
|
|
7741
7830
|
className,
|
|
7742
7831
|
contentClassName,
|
|
7743
7832
|
alwaysShowSubtitles = false,
|
|
7833
|
+
descriptionLineClamp = 1,
|
|
7744
7834
|
...props
|
|
7745
7835
|
}, forwardedRef) {
|
|
7746
7836
|
const handleClick = useCallback21(
|
|
@@ -7751,6 +7841,7 @@ var GridViewRoot = forwardRef19(function GridViewRoot2({
|
|
|
7751
7841
|
},
|
|
7752
7842
|
[onClick]
|
|
7753
7843
|
);
|
|
7844
|
+
const normalizedDescriptionLineClamp = normalizeDetailLineClamp(descriptionLineClamp) ?? 1;
|
|
7754
7845
|
const contextValue = useMemo18(
|
|
7755
7846
|
() => ({
|
|
7756
7847
|
minColumnWidth,
|
|
@@ -7758,13 +7849,22 @@ var GridViewRoot = forwardRef19(function GridViewRoot2({
|
|
|
7758
7849
|
bordered,
|
|
7759
7850
|
disabled,
|
|
7760
7851
|
gap,
|
|
7761
|
-
alwaysShowSubtitles
|
|
7852
|
+
alwaysShowSubtitles,
|
|
7853
|
+
descriptionLineClamp: normalizedDescriptionLineClamp
|
|
7762
7854
|
}),
|
|
7763
|
-
[
|
|
7855
|
+
[
|
|
7856
|
+
bordered,
|
|
7857
|
+
disabled,
|
|
7858
|
+
gap,
|
|
7859
|
+
minColumnWidth,
|
|
7860
|
+
textPosition,
|
|
7861
|
+
alwaysShowSubtitles,
|
|
7862
|
+
normalizedDescriptionLineClamp
|
|
7863
|
+
]
|
|
7764
7864
|
);
|
|
7765
7865
|
const mergedClassName = useMemo18(() => {
|
|
7766
7866
|
const baseClassName = cx(
|
|
7767
|
-
"n-flex n-flex-col n
|
|
7867
|
+
"n-flex n-flex-col -n-mx-3",
|
|
7768
7868
|
scrollable ? "n-basis-0 n-min-h-0" : "n-flex-none",
|
|
7769
7869
|
className
|
|
7770
7870
|
);
|
|
@@ -7772,8 +7872,8 @@ var GridViewRoot = forwardRef19(function GridViewRoot2({
|
|
|
7772
7872
|
categories: ["flex"]
|
|
7773
7873
|
});
|
|
7774
7874
|
}, [className, scrollable]);
|
|
7775
|
-
const content = /* @__PURE__ */
|
|
7776
|
-
return /* @__PURE__ */
|
|
7875
|
+
const content = /* @__PURE__ */ React49.createElement("div", { className: cx("n-p-3", contentClassName) }, children);
|
|
7876
|
+
return /* @__PURE__ */ React49.createElement(GridViewContext.Provider, { value: contextValue }, /* @__PURE__ */ React49.createElement(
|
|
7777
7877
|
"div",
|
|
7778
7878
|
{
|
|
7779
7879
|
onClick: handleClick,
|
|
@@ -7781,7 +7881,7 @@ var GridViewRoot = forwardRef19(function GridViewRoot2({
|
|
|
7781
7881
|
...props,
|
|
7782
7882
|
ref: forwardedRef
|
|
7783
7883
|
},
|
|
7784
|
-
scrollable ? /* @__PURE__ */
|
|
7884
|
+
scrollable ? /* @__PURE__ */ React49.createElement(ScrollArea, null, content) : content
|
|
7785
7885
|
));
|
|
7786
7886
|
});
|
|
7787
7887
|
function GridViewSection({
|
|
@@ -7794,8 +7894,8 @@ function GridViewSection({
|
|
|
7794
7894
|
gridTemplateColumns: `repeat(auto-fill, minmax(${minColumnWidth}, 1fr))`,
|
|
7795
7895
|
gap: `${gap}px`
|
|
7796
7896
|
};
|
|
7797
|
-
const isEmpty =
|
|
7798
|
-
return isEmpty && renderEmptyState ? renderEmptyState() : /* @__PURE__ */
|
|
7897
|
+
const isEmpty = React49.Children.count(children) === 0;
|
|
7898
|
+
return isEmpty && renderEmptyState ? renderEmptyState() : /* @__PURE__ */ React49.createElement(
|
|
7799
7899
|
"div",
|
|
7800
7900
|
{
|
|
7801
7901
|
role: "presentation",
|
|
@@ -7807,9 +7907,9 @@ function GridViewSection({
|
|
|
7807
7907
|
}
|
|
7808
7908
|
function GridViewSectionHeader({ title }) {
|
|
7809
7909
|
const grouped = title.split("/");
|
|
7810
|
-
return /* @__PURE__ */
|
|
7811
|
-
grouped.map((title2, index) => /* @__PURE__ */
|
|
7812
|
-
/* @__PURE__ */
|
|
7910
|
+
return /* @__PURE__ */ React49.createElement("div", { className: "n-px-5" }, /* @__PURE__ */ React49.createElement(Spacer.Vertical, { size: 24 }), withSeparatorElements(
|
|
7911
|
+
grouped.map((title2, index) => /* @__PURE__ */ React49.createElement(SectionTitle, { last: index === grouped.length - 1 }, title2)),
|
|
7912
|
+
/* @__PURE__ */ React49.createElement(SectionTitle, null, " / ")
|
|
7813
7913
|
));
|
|
7814
7914
|
}
|
|
7815
7915
|
var GridView;
|
|
@@ -7875,6 +7975,7 @@ var Grid = memoGeneric(
|
|
|
7875
7975
|
renderAction,
|
|
7876
7976
|
renderDetail,
|
|
7877
7977
|
renderRight,
|
|
7978
|
+
detailLineClamp,
|
|
7878
7979
|
onSelectionChange,
|
|
7879
7980
|
selectedIds = emptyArray,
|
|
7880
7981
|
// itemRoleDescription = "clickable item",
|
|
@@ -7930,7 +8031,7 @@ var Grid = memoGeneric(
|
|
|
7930
8031
|
onFilesDrop
|
|
7931
8032
|
);
|
|
7932
8033
|
const { minColumnWidth, gap } = getGridSize(size);
|
|
7933
|
-
return /* @__PURE__ */
|
|
8034
|
+
return /* @__PURE__ */ React50.createElement(
|
|
7934
8035
|
GridView.Root,
|
|
7935
8036
|
{
|
|
7936
8037
|
role: "listbox",
|
|
@@ -7940,6 +8041,7 @@ var Grid = memoGeneric(
|
|
|
7940
8041
|
scrollable: items.length > 0 && scrollable,
|
|
7941
8042
|
contentClassName: cx(items.length === 0 && "n-flex n-flex-1"),
|
|
7942
8043
|
gap,
|
|
8044
|
+
descriptionLineClamp: detailLineClamp,
|
|
7943
8045
|
className: cx(
|
|
7944
8046
|
isDropTargetActive && "n-bg-selected-list-item-background",
|
|
7945
8047
|
className
|
|
@@ -7947,7 +8049,7 @@ var Grid = memoGeneric(
|
|
|
7947
8049
|
...dropTargetProps,
|
|
7948
8050
|
ref: fileDropTargetRef
|
|
7949
8051
|
},
|
|
7950
|
-
items.length > 0 ? /* @__PURE__ */
|
|
8052
|
+
items.length > 0 ? /* @__PURE__ */ React50.createElement(GridView.Section, null, items.map((item) => {
|
|
7951
8053
|
const id = getId(item);
|
|
7952
8054
|
const href = getHref?.(item);
|
|
7953
8055
|
const isDropdownOpen = dropdownOpenId === id;
|
|
@@ -7967,7 +8069,7 @@ var Grid = memoGeneric(
|
|
|
7967
8069
|
handleSelect(id);
|
|
7968
8070
|
}
|
|
7969
8071
|
};
|
|
7970
|
-
const action = (isHovered || isSelected) && !isRenaming && (typeof renderAction === "function" ? renderAction({ item, selected: isSelected, onOpenChange }) : renderAction === "menu" && menuItems && /* @__PURE__ */
|
|
8072
|
+
const action = (isHovered || isSelected) && !isRenaming && (typeof renderAction === "function" ? renderAction({ item, selected: isSelected, onOpenChange }) : renderAction === "menu" && menuItems && /* @__PURE__ */ React50.createElement(
|
|
7971
8073
|
ActionMenu,
|
|
7972
8074
|
{
|
|
7973
8075
|
menuItems,
|
|
@@ -7976,7 +8078,7 @@ var Grid = memoGeneric(
|
|
|
7976
8078
|
onOpenChange
|
|
7977
8079
|
}
|
|
7978
8080
|
));
|
|
7979
|
-
const subtitle = /* @__PURE__ */
|
|
8081
|
+
const subtitle = /* @__PURE__ */ React50.createElement(
|
|
7980
8082
|
"span",
|
|
7981
8083
|
{
|
|
7982
8084
|
className: cx(isSelected && "n-text-selected-list-item-text")
|
|
@@ -7984,7 +8086,7 @@ var Grid = memoGeneric(
|
|
|
7984
8086
|
renderDetail?.(item, isSelected)
|
|
7985
8087
|
);
|
|
7986
8088
|
const right = renderRight?.(item, isSelected);
|
|
7987
|
-
return /* @__PURE__ */
|
|
8089
|
+
return /* @__PURE__ */ React50.createElement(
|
|
7988
8090
|
GridView.Item,
|
|
7989
8091
|
{
|
|
7990
8092
|
key: id,
|
|
@@ -7998,7 +8100,7 @@ var Grid = memoGeneric(
|
|
|
7998
8100
|
onHoverChange: (isHovering) => {
|
|
7999
8101
|
setHoveredId(isHovering ? id : void 0);
|
|
8000
8102
|
},
|
|
8001
|
-
title: /* @__PURE__ */
|
|
8103
|
+
title: /* @__PURE__ */ React50.createElement("div", { className: "n-flex n-items-center n-gap-2 n-flex-row" }, /* @__PURE__ */ React50.createElement(
|
|
8002
8104
|
EditableText,
|
|
8003
8105
|
{
|
|
8004
8106
|
className: cx(
|
|
@@ -8019,7 +8121,7 @@ var Grid = memoGeneric(
|
|
|
8019
8121
|
},
|
|
8020
8122
|
textClassName: "n-bg-listview-editing-background n-max-h-input-height"
|
|
8021
8123
|
},
|
|
8022
|
-
(props2) => /* @__PURE__ */
|
|
8124
|
+
(props2) => /* @__PURE__ */ React50.createElement(
|
|
8023
8125
|
"span",
|
|
8024
8126
|
{
|
|
8025
8127
|
...props2,
|
|
@@ -8029,7 +8131,7 @@ var Grid = memoGeneric(
|
|
|
8029
8131
|
)
|
|
8030
8132
|
}
|
|
8031
8133
|
)
|
|
8032
|
-
), right && /* @__PURE__ */
|
|
8134
|
+
), right && /* @__PURE__ */ React50.createElement("div", { className: "n-flex-none" }, right), detailPosition === "end" && subtitle),
|
|
8033
8135
|
subtitle: detailPosition === "below" && subtitle,
|
|
8034
8136
|
loading: false,
|
|
8035
8137
|
selected: isSelected,
|
|
@@ -8056,7 +8158,7 @@ var Grid = memoGeneric(
|
|
|
8056
8158
|
}
|
|
8057
8159
|
}
|
|
8058
8160
|
},
|
|
8059
|
-
thumbnail && /* @__PURE__ */
|
|
8161
|
+
thumbnail && /* @__PURE__ */ React50.createElement(
|
|
8060
8162
|
"div",
|
|
8061
8163
|
{
|
|
8062
8164
|
className: cx(
|
|
@@ -8074,10 +8176,10 @@ var Grid = memoGeneric(
|
|
|
8074
8176
|
);
|
|
8075
8177
|
|
|
8076
8178
|
// src/components/List.tsx
|
|
8077
|
-
import
|
|
8179
|
+
import React60, {
|
|
8078
8180
|
memo as memo22,
|
|
8079
8181
|
useImperativeHandle as useImperativeHandle5,
|
|
8080
|
-
useMemo as
|
|
8182
|
+
useMemo as useMemo25,
|
|
8081
8183
|
useRef as useRef20,
|
|
8082
8184
|
useState as useState25
|
|
8083
8185
|
} from "react";
|
|
@@ -8110,14 +8212,15 @@ var RenderItemContext = createContext10(
|
|
|
8110
8212
|
RenderItemContext.displayName = "RenderItemContext";
|
|
8111
8213
|
|
|
8112
8214
|
// src/components/listView/ListViewEditableRowTitle.tsx
|
|
8113
|
-
import
|
|
8215
|
+
import React51, { memo as memo19, useLayoutEffect as useLayoutEffect5, useRef as useRef17 } from "react";
|
|
8114
8216
|
var ListViewEditableRowTitle = memo19(function ListViewEditableRowTitle2({
|
|
8115
8217
|
value,
|
|
8116
8218
|
onSubmitEditing,
|
|
8117
8219
|
autoFocus,
|
|
8118
8220
|
placeholder,
|
|
8119
8221
|
className,
|
|
8120
|
-
onKeyDown
|
|
8222
|
+
onKeyDown,
|
|
8223
|
+
selectBeforeDot = false
|
|
8121
8224
|
}) {
|
|
8122
8225
|
const inputRef = useRef17(null);
|
|
8123
8226
|
useLayoutEffect5(() => {
|
|
@@ -8125,10 +8228,22 @@ var ListViewEditableRowTitle = memo19(function ListViewEditableRowTitle2({
|
|
|
8125
8228
|
if (!element || !autoFocus) return;
|
|
8126
8229
|
element.focus();
|
|
8127
8230
|
setTimeout(() => {
|
|
8231
|
+
if (selectBeforeDot) {
|
|
8232
|
+
const index = value.lastIndexOf(".");
|
|
8233
|
+
if (index > 0) {
|
|
8234
|
+
element.select();
|
|
8235
|
+
try {
|
|
8236
|
+
element.setSelectionRange(0, index, "forward");
|
|
8237
|
+
} catch {
|
|
8238
|
+
element.select();
|
|
8239
|
+
}
|
|
8240
|
+
return;
|
|
8241
|
+
}
|
|
8242
|
+
}
|
|
8128
8243
|
element.select();
|
|
8129
8244
|
}, 1);
|
|
8130
|
-
}, [autoFocus]);
|
|
8131
|
-
return /* @__PURE__ */
|
|
8245
|
+
}, [autoFocus, selectBeforeDot, value]);
|
|
8246
|
+
return /* @__PURE__ */ React51.createElement(
|
|
8132
8247
|
InputField2.Input,
|
|
8133
8248
|
{
|
|
8134
8249
|
ref: inputRef,
|
|
@@ -8147,14 +8262,14 @@ var ListViewEditableRowTitle = memo19(function ListViewEditableRowTitle2({
|
|
|
8147
8262
|
|
|
8148
8263
|
// src/components/listView/ListViewRoot.tsx
|
|
8149
8264
|
import { range } from "@noya-app/noya-utils";
|
|
8150
|
-
import
|
|
8265
|
+
import React56, {
|
|
8151
8266
|
isValidElement as isValidElement3,
|
|
8152
8267
|
memo as memo20,
|
|
8153
8268
|
useCallback as useCallback24,
|
|
8154
8269
|
useContext as useContext12,
|
|
8155
8270
|
useImperativeHandle as useImperativeHandle4,
|
|
8156
8271
|
useLayoutEffect as useLayoutEffect6,
|
|
8157
|
-
useMemo as
|
|
8272
|
+
useMemo as useMemo23,
|
|
8158
8273
|
useRef as useRef19
|
|
8159
8274
|
} from "react";
|
|
8160
8275
|
import { WindowScroller } from "react-virtualized";
|
|
@@ -8168,13 +8283,14 @@ import {
|
|
|
8168
8283
|
useSortable,
|
|
8169
8284
|
verticalListSortingStrategy
|
|
8170
8285
|
} from "@dnd-kit/sortable";
|
|
8171
|
-
import * as
|
|
8286
|
+
import * as React55 from "react";
|
|
8287
|
+
import { useMemo as useMemo22 } from "react";
|
|
8172
8288
|
|
|
8173
8289
|
// src/components/sorting/DragRegistration.tsx
|
|
8174
|
-
import
|
|
8175
|
-
var DragRegistrationContext =
|
|
8290
|
+
import React52 from "react";
|
|
8291
|
+
var DragRegistrationContext = React52.createContext(null);
|
|
8176
8292
|
function useDragRegistration(context) {
|
|
8177
|
-
const value =
|
|
8293
|
+
const value = React52.useContext(context);
|
|
8178
8294
|
if (!value) {
|
|
8179
8295
|
throw new Error(
|
|
8180
8296
|
"useDragRegistration must be used within a DragRegistrationProvider"
|
|
@@ -8183,11 +8299,11 @@ function useDragRegistration(context) {
|
|
|
8183
8299
|
return value;
|
|
8184
8300
|
}
|
|
8185
8301
|
function useDragRegistrationManager() {
|
|
8186
|
-
const [registeredLists, setRegisteredLists] =
|
|
8187
|
-
const registerList =
|
|
8302
|
+
const [registeredLists, setRegisteredLists] = React52.useState(/* @__PURE__ */ new Map());
|
|
8303
|
+
const registerList = React52.useCallback((list) => {
|
|
8188
8304
|
setRegisteredLists((prev) => new Map(prev).set(list.id, list));
|
|
8189
8305
|
}, []);
|
|
8190
|
-
const unregisterList =
|
|
8306
|
+
const unregisterList = React52.useCallback((listId) => {
|
|
8191
8307
|
setRegisteredLists((prev) => {
|
|
8192
8308
|
const newMap = new Map(prev);
|
|
8193
8309
|
newMap.delete(listId);
|
|
@@ -8196,15 +8312,15 @@ function useDragRegistrationManager() {
|
|
|
8196
8312
|
}, []);
|
|
8197
8313
|
return { registerList, unregisterList, registeredLists };
|
|
8198
8314
|
}
|
|
8199
|
-
var ActiveDragContext =
|
|
8315
|
+
var ActiveDragContext = React52.createContext(null);
|
|
8200
8316
|
function useActiveDrag(context) {
|
|
8201
|
-
const value =
|
|
8317
|
+
const value = React52.useContext(context);
|
|
8202
8318
|
if (!value) {
|
|
8203
8319
|
throw new Error("useActiveDrag must be used within a ActiveDragProvider");
|
|
8204
8320
|
}
|
|
8205
8321
|
return value;
|
|
8206
8322
|
}
|
|
8207
|
-
var AnyDragContext =
|
|
8323
|
+
var AnyDragContext = React52.createContext(false);
|
|
8208
8324
|
|
|
8209
8325
|
// src/components/sorting/SharedDragProvider.tsx
|
|
8210
8326
|
import {
|
|
@@ -8221,7 +8337,7 @@ import {
|
|
|
8221
8337
|
unionRects
|
|
8222
8338
|
} from "@noya-app/noya-geometry";
|
|
8223
8339
|
import { windowsOf } from "@noya-app/noya-utils";
|
|
8224
|
-
import * as
|
|
8340
|
+
import * as React53 from "react";
|
|
8225
8341
|
import { useMemo as useMemo20 } from "react";
|
|
8226
8342
|
import { createPortal as createPortal2 } from "react-dom";
|
|
8227
8343
|
function SharedDragProvider({
|
|
@@ -8242,22 +8358,22 @@ function SharedDragProvider({
|
|
|
8242
8358
|
})
|
|
8243
8359
|
);
|
|
8244
8360
|
const mounted = useMounted();
|
|
8245
|
-
const [dragState, setDragState] =
|
|
8361
|
+
const [dragState, setDragState] = React53.useState({
|
|
8246
8362
|
source: null,
|
|
8247
8363
|
target: null,
|
|
8248
8364
|
indicator: null
|
|
8249
8365
|
});
|
|
8250
|
-
const stableOnMoveItem =
|
|
8366
|
+
const stableOnMoveItem = React53.useRef(onMoveItem);
|
|
8251
8367
|
useIsomorphicLayoutEffect(() => {
|
|
8252
8368
|
stableOnMoveItem.current = onMoveItem;
|
|
8253
8369
|
}, [onMoveItem]);
|
|
8254
|
-
const stableAcceptsDrop =
|
|
8370
|
+
const stableAcceptsDrop = React53.useRef(acceptsDrop2);
|
|
8255
8371
|
useIsomorphicLayoutEffect(() => {
|
|
8256
8372
|
stableAcceptsDrop.current = acceptsDrop2;
|
|
8257
8373
|
}, [acceptsDrop2]);
|
|
8258
8374
|
const { registerList, unregisterList, registeredLists } = useDragRegistrationManager();
|
|
8259
|
-
const activatorEventRef =
|
|
8260
|
-
const handleDragStart =
|
|
8375
|
+
const activatorEventRef = React53.useRef(null);
|
|
8376
|
+
const handleDragStart = React53.useCallback(
|
|
8261
8377
|
(event) => {
|
|
8262
8378
|
activatorEventRef.current = event.activatorEvent;
|
|
8263
8379
|
for (const [listId, list] of registeredLists) {
|
|
@@ -8279,7 +8395,7 @@ function SharedDragProvider({
|
|
|
8279
8395
|
},
|
|
8280
8396
|
[registeredLists]
|
|
8281
8397
|
);
|
|
8282
|
-
const handleDragMove =
|
|
8398
|
+
const handleDragMove = React53.useCallback(
|
|
8283
8399
|
(event) => {
|
|
8284
8400
|
const { active, over } = event;
|
|
8285
8401
|
if (!activatorEventRef.current || !dragState.source) return;
|
|
@@ -8303,7 +8419,7 @@ function SharedDragProvider({
|
|
|
8303
8419
|
},
|
|
8304
8420
|
[registeredLists, dragState.source]
|
|
8305
8421
|
);
|
|
8306
|
-
const handleDragEnd =
|
|
8422
|
+
const handleDragEnd = React53.useCallback(
|
|
8307
8423
|
(event) => {
|
|
8308
8424
|
const { active, over } = event;
|
|
8309
8425
|
if (!activatorEventRef.current || !dragState.source) return;
|
|
@@ -8347,7 +8463,7 @@ function SharedDragProvider({
|
|
|
8347
8463
|
},
|
|
8348
8464
|
[registeredLists, dragState.source, stableOnMoveItem]
|
|
8349
8465
|
);
|
|
8350
|
-
const contextValue =
|
|
8466
|
+
const contextValue = React53.useMemo(
|
|
8351
8467
|
() => ({
|
|
8352
8468
|
registerList,
|
|
8353
8469
|
unregisterList
|
|
@@ -8355,19 +8471,19 @@ function SharedDragProvider({
|
|
|
8355
8471
|
[registerList, unregisterList]
|
|
8356
8472
|
);
|
|
8357
8473
|
const activeList = dragState.source ? registeredLists.get(dragState.source.listId) : null;
|
|
8358
|
-
const activeDragContextValue =
|
|
8474
|
+
const activeDragContextValue = React53.useMemo(
|
|
8359
8475
|
() => dragState,
|
|
8360
8476
|
[dragState]
|
|
8361
8477
|
);
|
|
8362
8478
|
const collisionDetection = useMemo20(() => {
|
|
8363
8479
|
return getItemFirstCollisionDetection(registeredLists, itemHitSlop);
|
|
8364
8480
|
}, [registeredLists, itemHitSlop]);
|
|
8365
|
-
return /* @__PURE__ */
|
|
8481
|
+
return /* @__PURE__ */ React53.createElement(AnyDragContext.Provider, { value: true }, /* @__PURE__ */ React53.createElement(sharedDragProps.dragRegistrationContext.Provider, { value: contextValue }, /* @__PURE__ */ React53.createElement(
|
|
8366
8482
|
sharedDragProps.activeDragContext.Provider,
|
|
8367
8483
|
{
|
|
8368
8484
|
value: activeDragContextValue
|
|
8369
8485
|
},
|
|
8370
|
-
/* @__PURE__ */
|
|
8486
|
+
/* @__PURE__ */ React53.createElement(
|
|
8371
8487
|
DndContext,
|
|
8372
8488
|
{
|
|
8373
8489
|
sensors,
|
|
@@ -8378,26 +8494,26 @@ function SharedDragProvider({
|
|
|
8378
8494
|
},
|
|
8379
8495
|
children,
|
|
8380
8496
|
mounted && activeList?.renderOverlay && dragState.source && createPortal2(
|
|
8381
|
-
/* @__PURE__ */
|
|
8497
|
+
/* @__PURE__ */ React53.createElement(DragOverlay, { dropAnimation: null }, activeList.renderOverlay(dragState.source.itemId)),
|
|
8382
8498
|
document.body
|
|
8383
8499
|
)
|
|
8384
8500
|
)
|
|
8385
8501
|
)));
|
|
8386
8502
|
}
|
|
8387
8503
|
function useMounted() {
|
|
8388
|
-
const [mounted, setMounted] =
|
|
8389
|
-
|
|
8504
|
+
const [mounted, setMounted] = React53.useState(false);
|
|
8505
|
+
React53.useEffect(() => {
|
|
8390
8506
|
setMounted(true);
|
|
8391
8507
|
}, []);
|
|
8392
8508
|
return mounted;
|
|
8393
8509
|
}
|
|
8394
8510
|
function withDragProvider(Component) {
|
|
8395
8511
|
return function WithDragProvider(props) {
|
|
8396
|
-
const anyDragContext =
|
|
8512
|
+
const anyDragContext = React53.useContext(AnyDragContext);
|
|
8397
8513
|
if (!anyDragContext) {
|
|
8398
|
-
return /* @__PURE__ */
|
|
8514
|
+
return /* @__PURE__ */ React53.createElement(SharedDragProvider, null, /* @__PURE__ */ React53.createElement(Component, { ...props }));
|
|
8399
8515
|
}
|
|
8400
|
-
return /* @__PURE__ */
|
|
8516
|
+
return /* @__PURE__ */ React53.createElement(Component, { ...props });
|
|
8401
8517
|
};
|
|
8402
8518
|
}
|
|
8403
8519
|
var getItemFirstCollisionDetection = (registeredLists, itemHitSlop) => (parameters) => {
|
|
@@ -8574,7 +8690,7 @@ function findDropTarget({
|
|
|
8574
8690
|
}
|
|
8575
8691
|
|
|
8576
8692
|
// src/components/sorting/sorting.ts
|
|
8577
|
-
import * as
|
|
8693
|
+
import * as React54 from "react";
|
|
8578
8694
|
var normalizeListTargetIndex = (index, position) => {
|
|
8579
8695
|
return position === "above" ? index : index + 1;
|
|
8580
8696
|
};
|
|
@@ -8590,7 +8706,7 @@ var defaultAcceptsDrop = ({
|
|
|
8590
8706
|
}
|
|
8591
8707
|
return true;
|
|
8592
8708
|
};
|
|
8593
|
-
var SortableItemContext =
|
|
8709
|
+
var SortableItemContext = React54.createContext({
|
|
8594
8710
|
keys: [],
|
|
8595
8711
|
acceptsDrop: defaultAcceptsDrop,
|
|
8596
8712
|
axis: "y",
|
|
@@ -8656,7 +8772,7 @@ function parseDragItemKey(key) {
|
|
|
8656
8772
|
}
|
|
8657
8773
|
|
|
8658
8774
|
// src/components/sorting/Sortable.tsx
|
|
8659
|
-
var SortableItemContext2 =
|
|
8775
|
+
var SortableItemContext2 = React55.createContext({
|
|
8660
8776
|
acceptsDrop: defaultAcceptsDrop,
|
|
8661
8777
|
listId: "",
|
|
8662
8778
|
getDropTargetParentIndex: void 0,
|
|
@@ -8669,7 +8785,7 @@ function useSortableDropIndicator({
|
|
|
8669
8785
|
acceptsDrop: acceptsDrop2,
|
|
8670
8786
|
getDropTargetParentIndex
|
|
8671
8787
|
}) {
|
|
8672
|
-
const { activeDragContext } =
|
|
8788
|
+
const { activeDragContext } = React55.useContext(SortableItemContext2);
|
|
8673
8789
|
const activeDrag = useActiveDrag(activeDragContext);
|
|
8674
8790
|
const { source, target } = activeDrag;
|
|
8675
8791
|
if (!source || !target) return;
|
|
@@ -8700,7 +8816,7 @@ function SortableItem({
|
|
|
8700
8816
|
disabled,
|
|
8701
8817
|
children
|
|
8702
8818
|
}) {
|
|
8703
|
-
const { acceptsDrop: acceptsDrop2, listId, getDropTargetParentIndex } =
|
|
8819
|
+
const { acceptsDrop: acceptsDrop2, listId, getDropTargetParentIndex } = React55.useContext(SortableItemContext2);
|
|
8704
8820
|
const dragItemKey = createDragItemKey(listId, id);
|
|
8705
8821
|
const {
|
|
8706
8822
|
attributes,
|
|
@@ -8715,7 +8831,7 @@ function SortableItem({
|
|
|
8715
8831
|
id: dragItemKey,
|
|
8716
8832
|
disabled
|
|
8717
8833
|
});
|
|
8718
|
-
const ref =
|
|
8834
|
+
const ref = React55.useCallback(
|
|
8719
8835
|
(node) => setNodeRef(node),
|
|
8720
8836
|
[setNodeRef]
|
|
8721
8837
|
);
|
|
@@ -8726,21 +8842,33 @@ function SortableItem({
|
|
|
8726
8842
|
acceptsDrop: acceptsDrop2,
|
|
8727
8843
|
getDropTargetParentIndex
|
|
8728
8844
|
});
|
|
8729
|
-
|
|
8730
|
-
{
|
|
8845
|
+
const props = useMemo22(
|
|
8846
|
+
() => ({
|
|
8731
8847
|
ref,
|
|
8732
8848
|
...attributes,
|
|
8733
8849
|
...listeners,
|
|
8734
8850
|
style: { opacity: isDragging ? 0.5 : 1 }
|
|
8735
|
-
},
|
|
8736
|
-
|
|
8851
|
+
}),
|
|
8852
|
+
[ref, attributes, listeners, isDragging]
|
|
8853
|
+
);
|
|
8854
|
+
const extraProps = useMemo22(
|
|
8855
|
+
() => ({
|
|
8737
8856
|
isDragging,
|
|
8857
|
+
isOverlay: false,
|
|
8738
8858
|
setActivatorNodeRef,
|
|
8739
8859
|
setDraggableNodeRef,
|
|
8740
8860
|
setDroppableNodeRef,
|
|
8741
8861
|
relativeDropPosition
|
|
8742
|
-
}
|
|
8862
|
+
}),
|
|
8863
|
+
[
|
|
8864
|
+
isDragging,
|
|
8865
|
+
setActivatorNodeRef,
|
|
8866
|
+
setDraggableNodeRef,
|
|
8867
|
+
setDroppableNodeRef,
|
|
8868
|
+
relativeDropPosition
|
|
8869
|
+
]
|
|
8743
8870
|
);
|
|
8871
|
+
return children(props, extraProps);
|
|
8744
8872
|
}
|
|
8745
8873
|
function SortableRoot_({
|
|
8746
8874
|
id: idProp,
|
|
@@ -8757,9 +8885,9 @@ function SortableRoot_({
|
|
|
8757
8885
|
containerRef,
|
|
8758
8886
|
itemHitSlop
|
|
8759
8887
|
}) {
|
|
8760
|
-
const defaultId =
|
|
8888
|
+
const defaultId = React55.useId();
|
|
8761
8889
|
const id = idProp ?? defaultId;
|
|
8762
|
-
const keys =
|
|
8890
|
+
const keys = React55.useMemo(() => {
|
|
8763
8891
|
return keysProp.map((key) => createDragItemKey(id, key));
|
|
8764
8892
|
}, [keysProp, id]);
|
|
8765
8893
|
const { registerList, unregisterList } = useDragRegistration(
|
|
@@ -8768,7 +8896,7 @@ function SortableRoot_({
|
|
|
8768
8896
|
const { setNodeRef: setDroppableRef } = useDroppable({
|
|
8769
8897
|
id
|
|
8770
8898
|
});
|
|
8771
|
-
|
|
8899
|
+
React55.useEffect(() => {
|
|
8772
8900
|
const listConfig = {
|
|
8773
8901
|
id,
|
|
8774
8902
|
keys,
|
|
@@ -8822,7 +8950,7 @@ function SortableRoot_({
|
|
|
8822
8950
|
keys,
|
|
8823
8951
|
itemHitSlop
|
|
8824
8952
|
]);
|
|
8825
|
-
const contextValue =
|
|
8953
|
+
const contextValue = React55.useMemo(
|
|
8826
8954
|
() => ({
|
|
8827
8955
|
keys,
|
|
8828
8956
|
acceptsDrop: acceptsDrop2,
|
|
@@ -8833,17 +8961,17 @@ function SortableRoot_({
|
|
|
8833
8961
|
[keys, acceptsDrop2, id, getDropTargetParentIndex, sharedDragProps]
|
|
8834
8962
|
);
|
|
8835
8963
|
const activeDragContext = sharedDragProps?.activeDragContext ?? ActiveDragContext;
|
|
8836
|
-
const dragState =
|
|
8964
|
+
const dragState = React55.useContext(activeDragContext);
|
|
8837
8965
|
const isDragging = !!dragState?.source;
|
|
8838
|
-
|
|
8966
|
+
React55.useEffect(() => {
|
|
8839
8967
|
onIsDraggingChange?.(isDragging);
|
|
8840
8968
|
}, [isDragging, onIsDraggingChange]);
|
|
8841
|
-
|
|
8969
|
+
React55.useEffect(() => {
|
|
8842
8970
|
if (containerRef) {
|
|
8843
8971
|
setDroppableRef(containerRef.current);
|
|
8844
8972
|
}
|
|
8845
8973
|
});
|
|
8846
|
-
return /* @__PURE__ */
|
|
8974
|
+
return /* @__PURE__ */ React55.createElement(SortableItemContext2.Provider, { value: contextValue }, /* @__PURE__ */ React55.createElement(
|
|
8847
8975
|
SortableContext,
|
|
8848
8976
|
{
|
|
8849
8977
|
items: keys,
|
|
@@ -8860,11 +8988,11 @@ var Sortable_ = function Sortable_2({
|
|
|
8860
8988
|
renderItem,
|
|
8861
8989
|
...rest
|
|
8862
8990
|
}) {
|
|
8863
|
-
const keys =
|
|
8991
|
+
const keys = React55.useMemo(
|
|
8864
8992
|
() => items.map(keyExtractor),
|
|
8865
8993
|
[items, keyExtractor]
|
|
8866
8994
|
);
|
|
8867
|
-
const renderOverlay =
|
|
8995
|
+
const renderOverlay = React55.useCallback(
|
|
8868
8996
|
(index) => {
|
|
8869
8997
|
return renderItem(
|
|
8870
8998
|
items[index],
|
|
@@ -8894,18 +9022,15 @@ var Sortable_ = function Sortable_2({
|
|
|
8894
9022
|
},
|
|
8895
9023
|
[renderItem, items]
|
|
8896
9024
|
);
|
|
8897
|
-
return /* @__PURE__ */
|
|
9025
|
+
return /* @__PURE__ */ React55.createElement(
|
|
8898
9026
|
SortableRoot,
|
|
8899
9027
|
{
|
|
8900
9028
|
...rest,
|
|
8901
9029
|
keys,
|
|
8902
9030
|
renderOverlay: shouldRenderOverlay ? renderOverlay : void 0
|
|
8903
9031
|
},
|
|
8904
|
-
keys.map((key, index) => /* @__PURE__ */
|
|
8905
|
-
return renderItem(items[index], props,
|
|
8906
|
-
isOverlay: false,
|
|
8907
|
-
...extraProps
|
|
8908
|
-
});
|
|
9032
|
+
keys.map((key, index) => /* @__PURE__ */ React55.createElement(SortableItem, { key, id: key }, (props, extraProps) => {
|
|
9033
|
+
return renderItem(items[index], props, extraProps);
|
|
8909
9034
|
}))
|
|
8910
9035
|
);
|
|
8911
9036
|
};
|
|
@@ -8916,13 +9041,14 @@ var Sortable = Object.assign(Sortable_, {
|
|
|
8916
9041
|
|
|
8917
9042
|
// src/components/listView/ListViewRoot.tsx
|
|
8918
9043
|
var ROW_HEIGHT = 31;
|
|
8919
|
-
var SECTION_HEADER_LABEL_HEIGHT =
|
|
9044
|
+
var SECTION_HEADER_LABEL_HEIGHT = 24;
|
|
9045
|
+
var TALL_ROW_HEIGHT = 50;
|
|
8920
9046
|
var VirtualizedListRow = memo20(function VirtualizedListRow2({
|
|
8921
9047
|
index,
|
|
8922
9048
|
style: style2
|
|
8923
9049
|
}) {
|
|
8924
9050
|
const renderItem = useContext12(RenderItemContext);
|
|
8925
|
-
return /* @__PURE__ */
|
|
9051
|
+
return /* @__PURE__ */ React56.createElement("div", { key: index, style: style2 }, renderItem(index));
|
|
8926
9052
|
});
|
|
8927
9053
|
var VirtualizedListInner = forwardRefGeneric(function VirtualizedListInner2({
|
|
8928
9054
|
size,
|
|
@@ -8941,11 +9067,12 @@ var VirtualizedListInner = forwardRefGeneric(function VirtualizedListInner2({
|
|
|
8941
9067
|
useLayoutEffect6(() => {
|
|
8942
9068
|
listRef.current?.resetAfterIndex(0);
|
|
8943
9069
|
}, [
|
|
8944
|
-
// When items
|
|
8945
|
-
// since
|
|
8946
|
-
items
|
|
9070
|
+
// When items or the height resolver change, re-render the virtualized list
|
|
9071
|
+
// since VariableSizeList caches sizes per index.
|
|
9072
|
+
items,
|
|
9073
|
+
getItemHeight
|
|
8947
9074
|
]);
|
|
8948
|
-
const listStyle =
|
|
9075
|
+
const listStyle = useMemo23(
|
|
8949
9076
|
() => ({
|
|
8950
9077
|
overflowX: "initial",
|
|
8951
9078
|
overflowY: "initial",
|
|
@@ -8953,18 +9080,18 @@ var VirtualizedListInner = forwardRefGeneric(function VirtualizedListInner2({
|
|
|
8953
9080
|
}),
|
|
8954
9081
|
[]
|
|
8955
9082
|
);
|
|
8956
|
-
return /* @__PURE__ */
|
|
9083
|
+
return /* @__PURE__ */ React56.createElement(RenderItemContext.Provider, { value: renderItem }, /* @__PURE__ */ React56.createElement(
|
|
8957
9084
|
WindowScroller,
|
|
8958
9085
|
{
|
|
8959
9086
|
scrollElement,
|
|
8960
|
-
style:
|
|
9087
|
+
style: useMemo23(() => ({ flex: "1 1 auto" }), [])
|
|
8961
9088
|
},
|
|
8962
9089
|
useCallback24(
|
|
8963
9090
|
({
|
|
8964
9091
|
registerChild,
|
|
8965
9092
|
onChildScroll,
|
|
8966
9093
|
scrollTop
|
|
8967
|
-
}) => /* @__PURE__ */
|
|
9094
|
+
}) => /* @__PURE__ */ React56.createElement("div", { ref: registerChild }, /* @__PURE__ */ React56.createElement(
|
|
8968
9095
|
VariableSizeList,
|
|
8969
9096
|
{
|
|
8970
9097
|
ref: listRef,
|
|
@@ -9032,7 +9159,8 @@ var ListViewRoot = memoGeneric(
|
|
|
9032
9159
|
getDropTargetParentIndex,
|
|
9033
9160
|
sharedDragProps,
|
|
9034
9161
|
sortableId,
|
|
9035
|
-
itemHeight
|
|
9162
|
+
itemHeight,
|
|
9163
|
+
getItemHeightForItem
|
|
9036
9164
|
}, forwardedRef) {
|
|
9037
9165
|
const handleClick = useCallback24(
|
|
9038
9166
|
(event) => {
|
|
@@ -9048,7 +9176,7 @@ var ListViewRoot = memoGeneric(
|
|
|
9048
9176
|
(index) => renderItem(data[index], index, { isDragOverlay: false }),
|
|
9049
9177
|
[data, renderItem]
|
|
9050
9178
|
);
|
|
9051
|
-
const defaultContextValue =
|
|
9179
|
+
const defaultContextValue = useMemo23(
|
|
9052
9180
|
() => ({
|
|
9053
9181
|
marginType: "none",
|
|
9054
9182
|
selectedPosition: "only",
|
|
@@ -9058,8 +9186,14 @@ var ListViewRoot = memoGeneric(
|
|
|
9058
9186
|
);
|
|
9059
9187
|
const getItemContextValue = useCallback24(
|
|
9060
9188
|
(i) => {
|
|
9061
|
-
if (variant === "bare" || variant === "normal")
|
|
9062
|
-
|
|
9189
|
+
if (variant === "bare" || variant === "normal") {
|
|
9190
|
+
const current2 = renderChild(i);
|
|
9191
|
+
if (!isValidElement3(current2)) return defaultContextValue;
|
|
9192
|
+
return {
|
|
9193
|
+
...defaultContextValue,
|
|
9194
|
+
isSectionHeader: !!current2.props.isSectionHeader
|
|
9195
|
+
};
|
|
9196
|
+
}
|
|
9063
9197
|
const current = renderChild(i);
|
|
9064
9198
|
if (!isValidElement3(current)) return;
|
|
9065
9199
|
const prevChild = i - 1 >= 0 && renderChild(i - 1);
|
|
@@ -9098,14 +9232,14 @@ var ListViewRoot = memoGeneric(
|
|
|
9098
9232
|
},
|
|
9099
9233
|
[variant, defaultContextValue, renderChild, data.length]
|
|
9100
9234
|
);
|
|
9101
|
-
const draggingContextOverlayValue =
|
|
9235
|
+
const draggingContextOverlayValue = useMemo23(
|
|
9102
9236
|
() => ({
|
|
9103
9237
|
isDragOverlay: true
|
|
9104
9238
|
}),
|
|
9105
9239
|
[]
|
|
9106
9240
|
);
|
|
9107
9241
|
const renderOverlay = useCallback24(
|
|
9108
|
-
(index) => /* @__PURE__ */
|
|
9242
|
+
(index) => /* @__PURE__ */ React56.createElement("div", { style: { opacity: 0.25 } }, /* @__PURE__ */ React56.createElement(ListViewDraggingContext.Provider, { value: draggingContextOverlayValue }, renderItem(data[index], index, { isDragOverlay: true }))),
|
|
9109
9243
|
[draggingContextOverlayValue, renderItem, data]
|
|
9110
9244
|
);
|
|
9111
9245
|
const renderWrappedChild = useCallback24(
|
|
@@ -9113,12 +9247,12 @@ var ListViewRoot = memoGeneric(
|
|
|
9113
9247
|
const contextValue2 = getItemContextValue(index);
|
|
9114
9248
|
const current = renderChild(index);
|
|
9115
9249
|
if (!contextValue2 || !isValidElement3(current)) return null;
|
|
9116
|
-
return /* @__PURE__ */
|
|
9250
|
+
return /* @__PURE__ */ React56.createElement(ListRowContext.Provider, { key: current.key, value: contextValue2 }, current);
|
|
9117
9251
|
},
|
|
9118
9252
|
[getItemContextValue, renderChild]
|
|
9119
9253
|
);
|
|
9120
|
-
const ids =
|
|
9121
|
-
const withSortable = (children) => sortable ? /* @__PURE__ */
|
|
9254
|
+
const ids = useMemo23(() => data.map(keyExtractor), [keyExtractor, data]);
|
|
9255
|
+
const withSortable = (children) => sortable ? /* @__PURE__ */ React56.createElement(
|
|
9122
9256
|
Sortable.Root,
|
|
9123
9257
|
{
|
|
9124
9258
|
id: sortableId,
|
|
@@ -9131,23 +9265,34 @@ var ListViewRoot = memoGeneric(
|
|
|
9131
9265
|
},
|
|
9132
9266
|
children
|
|
9133
9267
|
) : children;
|
|
9134
|
-
const withScrollable = (children) => scrollable ? /* @__PURE__ */
|
|
9268
|
+
const withScrollable = (children) => scrollable ? /* @__PURE__ */ React56.createElement(ScrollArea, null, children) : children(null);
|
|
9135
9269
|
const getItemHeight = useCallback24(
|
|
9136
9270
|
(index) => {
|
|
9137
|
-
if (itemHeight) return itemHeight;
|
|
9138
9271
|
const child = getItemContextValue(index);
|
|
9139
|
-
|
|
9140
|
-
|
|
9272
|
+
if (child?.isSectionHeader && sectionHeaderVariant === "label") {
|
|
9273
|
+
return SECTION_HEADER_LABEL_HEIGHT;
|
|
9274
|
+
}
|
|
9275
|
+
if (itemHeight) return itemHeight;
|
|
9276
|
+
if (getItemHeightForItem) {
|
|
9277
|
+
return getItemHeightForItem(data[index], index);
|
|
9278
|
+
}
|
|
9279
|
+
return ROW_HEIGHT;
|
|
9141
9280
|
},
|
|
9142
|
-
[
|
|
9281
|
+
[
|
|
9282
|
+
getItemContextValue,
|
|
9283
|
+
itemHeight,
|
|
9284
|
+
sectionHeaderVariant,
|
|
9285
|
+
getItemHeightForItem,
|
|
9286
|
+
data
|
|
9287
|
+
]
|
|
9143
9288
|
);
|
|
9144
9289
|
const getKey = useCallback24(
|
|
9145
9290
|
(index) => keyExtractor(data[index], index),
|
|
9146
9291
|
[data, keyExtractor]
|
|
9147
9292
|
);
|
|
9148
|
-
const draggingContextValue =
|
|
9149
|
-
const gapStyle =
|
|
9150
|
-
const contextValue =
|
|
9293
|
+
const draggingContextValue = useMemo23(() => ({}), []);
|
|
9294
|
+
const gapStyle = useMemo23(() => ({ gap: `${gap}px` }), [gap]);
|
|
9295
|
+
const contextValue = useMemo23(
|
|
9151
9296
|
() => ({
|
|
9152
9297
|
pressEventName,
|
|
9153
9298
|
colorScheme,
|
|
@@ -9171,7 +9316,7 @@ var ListViewRoot = memoGeneric(
|
|
|
9171
9316
|
indentation
|
|
9172
9317
|
]
|
|
9173
9318
|
);
|
|
9174
|
-
return /* @__PURE__ */
|
|
9319
|
+
return /* @__PURE__ */ React56.createElement(ListViewContext.Provider, { value: contextValue }, /* @__PURE__ */ React56.createElement(ListViewDraggingContext.Provider, { value: draggingContextValue }, /* @__PURE__ */ React56.createElement(
|
|
9175
9320
|
"div",
|
|
9176
9321
|
{
|
|
9177
9322
|
id,
|
|
@@ -9200,7 +9345,7 @@ var ListViewRoot = memoGeneric(
|
|
|
9200
9345
|
},
|
|
9201
9346
|
data.length === 0 && renderEmptyState ? renderEmptyState() : withScrollable(
|
|
9202
9347
|
(scrollElementRef) => withSortable(
|
|
9203
|
-
virtualized ? /* @__PURE__ */
|
|
9348
|
+
virtualized ? /* @__PURE__ */ React56.createElement(
|
|
9204
9349
|
VirtualizedList,
|
|
9205
9350
|
{
|
|
9206
9351
|
ref: forwardedRef,
|
|
@@ -9220,11 +9365,11 @@ var ListViewRoot = memoGeneric(
|
|
|
9220
9365
|
|
|
9221
9366
|
// src/components/listView/ListViewRow.tsx
|
|
9222
9367
|
import { composeRefs as composeRefs2 } from "@radix-ui/react-compose-refs";
|
|
9223
|
-
import
|
|
9224
|
-
forwardRef as
|
|
9368
|
+
import React57, {
|
|
9369
|
+
forwardRef as forwardRef21,
|
|
9225
9370
|
useCallback as useCallback25,
|
|
9226
9371
|
useContext as useContext13,
|
|
9227
|
-
useMemo as
|
|
9372
|
+
useMemo as useMemo24
|
|
9228
9373
|
} from "react";
|
|
9229
9374
|
|
|
9230
9375
|
// src/hooks/mergeEventHandlers.ts
|
|
@@ -9251,7 +9396,7 @@ function mergeEventHandlers(...handlerMaps) {
|
|
|
9251
9396
|
}
|
|
9252
9397
|
|
|
9253
9398
|
// src/components/listView/ListViewRow.tsx
|
|
9254
|
-
var RowContainer =
|
|
9399
|
+
var RowContainer = forwardRef21(
|
|
9255
9400
|
({
|
|
9256
9401
|
as: Component = "div",
|
|
9257
9402
|
href,
|
|
@@ -9278,7 +9423,7 @@ var RowContainer = forwardRef20(
|
|
|
9278
9423
|
"aria-selected": ariaSelected,
|
|
9279
9424
|
...props
|
|
9280
9425
|
}, ref) => {
|
|
9281
|
-
return /* @__PURE__ */
|
|
9426
|
+
return /* @__PURE__ */ React57.createElement(
|
|
9282
9427
|
Component,
|
|
9283
9428
|
{
|
|
9284
9429
|
ref,
|
|
@@ -9350,7 +9495,7 @@ var RowContainer = forwardRef20(
|
|
|
9350
9495
|
);
|
|
9351
9496
|
}
|
|
9352
9497
|
);
|
|
9353
|
-
var ListViewDragIndicatorElement =
|
|
9498
|
+
var ListViewDragIndicatorElement = forwardRef21(
|
|
9354
9499
|
({
|
|
9355
9500
|
className,
|
|
9356
9501
|
$relativeDropPosition,
|
|
@@ -9360,7 +9505,7 @@ var ListViewDragIndicatorElement = forwardRef20(
|
|
|
9360
9505
|
style: style2,
|
|
9361
9506
|
...props
|
|
9362
9507
|
}, ref) => {
|
|
9363
|
-
return /* @__PURE__ */
|
|
9508
|
+
return /* @__PURE__ */ React57.createElement(
|
|
9364
9509
|
"div",
|
|
9365
9510
|
{
|
|
9366
9511
|
ref,
|
|
@@ -9448,7 +9593,7 @@ var ListViewRow = memoGeneric(
|
|
|
9448
9593
|
},
|
|
9449
9594
|
[onDoubleClick]
|
|
9450
9595
|
);
|
|
9451
|
-
const mergedStyle =
|
|
9596
|
+
const mergedStyle = useMemo24(() => {
|
|
9452
9597
|
return isDragOverlay ? {
|
|
9453
9598
|
// TODO: Where do these offsets actually come from?
|
|
9454
9599
|
transform: `translate3d(-36px, -6px, 0)`,
|
|
@@ -9459,7 +9604,7 @@ var ListViewRow = memoGeneric(
|
|
|
9459
9604
|
const renderContent = (renderProps, ref, relativeDropPositionProp) => {
|
|
9460
9605
|
const Component = RowContainer;
|
|
9461
9606
|
const relativeDropPosition = testRelativeDropPosition ?? relativeDropPositionProp;
|
|
9462
|
-
const element = /* @__PURE__ */
|
|
9607
|
+
const element = /* @__PURE__ */ React57.createElement(
|
|
9463
9608
|
Component,
|
|
9464
9609
|
{
|
|
9465
9610
|
as,
|
|
@@ -9494,7 +9639,7 @@ var ListViewRow = memoGeneric(
|
|
|
9494
9639
|
className,
|
|
9495
9640
|
$clickable: !!onPress
|
|
9496
9641
|
},
|
|
9497
|
-
relativeDropPosition && /* @__PURE__ */
|
|
9642
|
+
relativeDropPosition && /* @__PURE__ */ React57.createElement(
|
|
9498
9643
|
ListViewDragIndicatorElement,
|
|
9499
9644
|
{
|
|
9500
9645
|
key: relativeDropPosition,
|
|
@@ -9509,11 +9654,11 @@ var ListViewRow = memoGeneric(
|
|
|
9509
9654
|
}) : dragIndicatorStyle
|
|
9510
9655
|
}
|
|
9511
9656
|
),
|
|
9512
|
-
depth > 0 && /* @__PURE__ */
|
|
9657
|
+
depth > 0 && /* @__PURE__ */ React57.createElement(Spacer.Horizontal, { size: depth * indentation }),
|
|
9513
9658
|
children
|
|
9514
9659
|
);
|
|
9515
9660
|
if (menuItems && onSelectMenuItem) {
|
|
9516
|
-
return /* @__PURE__ */
|
|
9661
|
+
return /* @__PURE__ */ React57.createElement(
|
|
9517
9662
|
ContextMenu,
|
|
9518
9663
|
{
|
|
9519
9664
|
items: menuItems,
|
|
@@ -9526,7 +9671,7 @@ var ListViewRow = memoGeneric(
|
|
|
9526
9671
|
return element;
|
|
9527
9672
|
};
|
|
9528
9673
|
if (sortable && id) {
|
|
9529
|
-
return /* @__PURE__ */
|
|
9674
|
+
return /* @__PURE__ */ React57.createElement(
|
|
9530
9675
|
Sortable.Item,
|
|
9531
9676
|
{
|
|
9532
9677
|
id,
|
|
@@ -9544,12 +9689,12 @@ var ListViewRow = memoGeneric(
|
|
|
9544
9689
|
);
|
|
9545
9690
|
|
|
9546
9691
|
// src/components/listView/ListViewRowTitle.tsx
|
|
9547
|
-
import
|
|
9692
|
+
import React58, { memo as memo21 } from "react";
|
|
9548
9693
|
var ListViewRowTitle = memo21(function ListViewRowTitle2({
|
|
9549
9694
|
className,
|
|
9550
9695
|
...props
|
|
9551
9696
|
}) {
|
|
9552
|
-
return /* @__PURE__ */
|
|
9697
|
+
return /* @__PURE__ */ React58.createElement(
|
|
9553
9698
|
"span",
|
|
9554
9699
|
{
|
|
9555
9700
|
className: cx(
|
|
@@ -9572,22 +9717,47 @@ var ListView;
|
|
|
9572
9717
|
ListView2.DragIndicator = ListViewDragIndicatorElement;
|
|
9573
9718
|
ListView2.rowHeight = ROW_HEIGHT;
|
|
9574
9719
|
ListView2.sectionHeaderLabelHeight = SECTION_HEADER_LABEL_HEIGHT;
|
|
9720
|
+
ListView2.tallRowHeight = TALL_ROW_HEIGHT;
|
|
9575
9721
|
ListView2.calculateHeight = ({
|
|
9576
9722
|
menuItemsCount,
|
|
9577
9723
|
sectionHeaderCount
|
|
9578
9724
|
}) => {
|
|
9579
9725
|
return menuItemsCount * ListView2.rowHeight + sectionHeaderCount * ListView2.sectionHeaderLabelHeight;
|
|
9580
9726
|
};
|
|
9727
|
+
ListView2.calculateHeightWithTallRows = ({
|
|
9728
|
+
menuItemsCount,
|
|
9729
|
+
sectionHeaderCount,
|
|
9730
|
+
tallMenuItemsCount,
|
|
9731
|
+
maxBaseRows
|
|
9732
|
+
}) => {
|
|
9733
|
+
const normalRows = menuItemsCount - tallMenuItemsCount;
|
|
9734
|
+
const totalHeight = normalRows * ListView2.rowHeight + tallMenuItemsCount * ListView2.tallRowHeight + sectionHeaderCount * ListView2.sectionHeaderLabelHeight;
|
|
9735
|
+
const maxHeight = ListView2.rowHeight * maxBaseRows;
|
|
9736
|
+
return Math.min(totalHeight, maxHeight);
|
|
9737
|
+
};
|
|
9738
|
+
ListView2.getMenuMetrics = (items) => {
|
|
9739
|
+
const sectionHeaderCount = items.filter(
|
|
9740
|
+
(item) => isMenuItemSectionHeader(item)
|
|
9741
|
+
).length;
|
|
9742
|
+
const menuItemsCount = items.filter(
|
|
9743
|
+
(item) => isSelectableMenuItem(item)
|
|
9744
|
+
).length;
|
|
9745
|
+
const tallMenuItemsCount = items.filter((item) => {
|
|
9746
|
+
return isSelectableMenuItem(item) && item.tooltip !== void 0;
|
|
9747
|
+
}).length;
|
|
9748
|
+
return { sectionHeaderCount, menuItemsCount, tallMenuItemsCount };
|
|
9749
|
+
};
|
|
9581
9750
|
ListView2.normalizeTargetIndex = normalizeListTargetIndex;
|
|
9582
9751
|
})(ListView || (ListView = {}));
|
|
9583
9752
|
|
|
9584
9753
|
// src/components/TreeView.tsx
|
|
9585
|
-
import
|
|
9754
|
+
import React59, { useCallback as useCallback26, useContext as useContext14 } from "react";
|
|
9586
9755
|
var TreeRow = forwardRefGeneric(function TreeRow2({
|
|
9587
9756
|
icon,
|
|
9588
9757
|
expanded,
|
|
9589
9758
|
onClickChevron,
|
|
9590
9759
|
chevronClassName,
|
|
9760
|
+
chevronAs,
|
|
9591
9761
|
children,
|
|
9592
9762
|
...rest
|
|
9593
9763
|
}, forwardedRef) {
|
|
@@ -9596,19 +9766,21 @@ var TreeRow = forwardRefGeneric(function TreeRow2({
|
|
|
9596
9766
|
const handleClickChevron = useCallback26(
|
|
9597
9767
|
(event) => {
|
|
9598
9768
|
event.stopPropagation();
|
|
9769
|
+
event.preventDefault();
|
|
9599
9770
|
stableOnClickChevron?.({ altKey: event.altKey });
|
|
9600
9771
|
},
|
|
9601
9772
|
[stableOnClickChevron]
|
|
9602
9773
|
);
|
|
9603
|
-
return /* @__PURE__ */
|
|
9774
|
+
return /* @__PURE__ */ React59.createElement(ListView.Row, { ref: forwardedRef, ...rest }, expandable && /* @__PURE__ */ React59.createElement(React59.Fragment, null, expanded === void 0 ? /* @__PURE__ */ React59.createElement(Spacer.Horizontal, { size: 19 }) : /* @__PURE__ */ React59.createElement(
|
|
9604
9775
|
IconButton,
|
|
9605
9776
|
{
|
|
9777
|
+
as: chevronAs,
|
|
9606
9778
|
className: chevronClassName,
|
|
9607
9779
|
iconName: expanded ? "ChevronDownIcon2" : "ChevronRightIcon2",
|
|
9608
9780
|
onClick: handleClickChevron,
|
|
9609
9781
|
selected: rest.selected
|
|
9610
9782
|
}
|
|
9611
|
-
), /* @__PURE__ */
|
|
9783
|
+
), /* @__PURE__ */ React59.createElement(Spacer.Horizontal, { size: 6 })), icon && /* @__PURE__ */ React59.createElement(React59.Fragment, null, renderIcon(icon), /* @__PURE__ */ React59.createElement(Spacer.Horizontal, { size: 10 })), children);
|
|
9612
9784
|
});
|
|
9613
9785
|
var TreeView;
|
|
9614
9786
|
((TreeView2) => {
|
|
@@ -9643,6 +9815,7 @@ var List = memoGeneric(
|
|
|
9643
9815
|
renderAction,
|
|
9644
9816
|
renderDetail,
|
|
9645
9817
|
renderRight,
|
|
9818
|
+
detailLineClamp,
|
|
9646
9819
|
onSelectionChange,
|
|
9647
9820
|
itemStyle: itemStyleProp,
|
|
9648
9821
|
itemClassName: itemClassNameProp,
|
|
@@ -9669,7 +9842,8 @@ var List = memoGeneric(
|
|
|
9669
9842
|
dragIndicatorStyle,
|
|
9670
9843
|
sortableId,
|
|
9671
9844
|
sharedDragProps,
|
|
9672
|
-
virtualized
|
|
9845
|
+
virtualized,
|
|
9846
|
+
renameSelectsBeforeDot
|
|
9673
9847
|
} = props;
|
|
9674
9848
|
const [internalHoveredId, setHoveredId] = useState25();
|
|
9675
9849
|
const [internalRenamingId, setRenamingId] = useState25();
|
|
@@ -9681,10 +9855,11 @@ var List = memoGeneric(
|
|
|
9681
9855
|
pyMap[size],
|
|
9682
9856
|
itemClassNameProp
|
|
9683
9857
|
);
|
|
9684
|
-
const itemStyle =
|
|
9858
|
+
const itemStyle = useMemo25(
|
|
9685
9859
|
() => ({ ...cssVarOverrides, ...itemStyleProp }),
|
|
9686
9860
|
[itemStyleProp]
|
|
9687
9861
|
);
|
|
9862
|
+
const normalizedDetailLineClamp = normalizeDetailLineClamp(detailLineClamp);
|
|
9688
9863
|
const handleSelect = (itemId, event) => {
|
|
9689
9864
|
if (!onSelectionChange) return;
|
|
9690
9865
|
setRenamingId(void 0);
|
|
@@ -9718,7 +9893,7 @@ var List = memoGeneric(
|
|
|
9718
9893
|
setRenamingId(id);
|
|
9719
9894
|
}
|
|
9720
9895
|
}));
|
|
9721
|
-
return /* @__PURE__ */
|
|
9896
|
+
return /* @__PURE__ */ React60.createElement(
|
|
9722
9897
|
ViewComponent.Root,
|
|
9723
9898
|
{
|
|
9724
9899
|
variant: "bare",
|
|
@@ -9767,7 +9942,7 @@ var List = memoGeneric(
|
|
|
9767
9942
|
handleSelect(id);
|
|
9768
9943
|
}
|
|
9769
9944
|
};
|
|
9770
|
-
const action = (isHovered || isSelected) && !isRenaming && (typeof renderAction === "function" ? renderAction({ item, selected: isSelected, onOpenChange }) : renderAction === "menu" && menuItems && /* @__PURE__ */
|
|
9945
|
+
const action = (isHovered || isSelected) && !isRenaming && (typeof renderAction === "function" ? renderAction({ item, selected: isSelected, onOpenChange }) : renderAction === "menu" && menuItems && /* @__PURE__ */ React60.createElement(
|
|
9771
9946
|
ActionMenu,
|
|
9772
9947
|
{
|
|
9773
9948
|
menuItems,
|
|
@@ -9781,10 +9956,24 @@ var List = memoGeneric(
|
|
|
9781
9956
|
}
|
|
9782
9957
|
}
|
|
9783
9958
|
));
|
|
9784
|
-
const
|
|
9959
|
+
const detailContent = renderDetail?.(item, isSelected);
|
|
9960
|
+
const end = action || detailPosition === "end" && detailContent;
|
|
9785
9961
|
const right = renderRight?.(item, isSelected);
|
|
9786
|
-
|
|
9787
|
-
|
|
9962
|
+
let below = detailPosition === "below" ? detailContent : void 0;
|
|
9963
|
+
if (below && normalizedDetailLineClamp) {
|
|
9964
|
+
const clampClassName = DETAIL_LINE_CLAMP_CLASSES[normalizedDetailLineClamp];
|
|
9965
|
+
below = /* @__PURE__ */ React60.createElement(
|
|
9966
|
+
"div",
|
|
9967
|
+
{
|
|
9968
|
+
className: cx(
|
|
9969
|
+
"n-overflow-hidden n-w-full n-max-w-full",
|
|
9970
|
+
clampClassName
|
|
9971
|
+
)
|
|
9972
|
+
},
|
|
9973
|
+
below
|
|
9974
|
+
);
|
|
9975
|
+
}
|
|
9976
|
+
return /* @__PURE__ */ React60.createElement(
|
|
9788
9977
|
ViewComponent.Row,
|
|
9789
9978
|
{
|
|
9790
9979
|
as: typeof href === "string" ? LinkComponent2 : void 0,
|
|
@@ -9799,6 +9988,7 @@ var List = memoGeneric(
|
|
|
9799
9988
|
className: itemClassName,
|
|
9800
9989
|
testRelativeDropPosition: testShowDropIndicatorId === id ? "inside" : void 0,
|
|
9801
9990
|
chevronClassName: cx(expandable && "n-relative n-left-2"),
|
|
9991
|
+
chevronAs: href ? "div" : void 0,
|
|
9802
9992
|
style: itemStyle,
|
|
9803
9993
|
hovered: isHovered,
|
|
9804
9994
|
selected: isSelected,
|
|
@@ -9835,12 +10025,15 @@ var List = memoGeneric(
|
|
|
9835
10025
|
},
|
|
9836
10026
|
dragIndicatorStyle
|
|
9837
10027
|
},
|
|
9838
|
-
/* @__PURE__ */
|
|
10028
|
+
/* @__PURE__ */ React60.createElement(
|
|
9839
10029
|
"div",
|
|
9840
10030
|
{
|
|
9841
|
-
className: cx(
|
|
10031
|
+
className: cx(
|
|
10032
|
+
"n-flex n-flex-1 n-items-center n-px-2",
|
|
10033
|
+
rowGapMap[size]
|
|
10034
|
+
)
|
|
9842
10035
|
},
|
|
9843
|
-
thumbnail && /* @__PURE__ */
|
|
10036
|
+
thumbnail && /* @__PURE__ */ React60.createElement(
|
|
9844
10037
|
"div",
|
|
9845
10038
|
{
|
|
9846
10039
|
className: cx(
|
|
@@ -9853,33 +10046,48 @@ var List = memoGeneric(
|
|
|
9853
10046
|
},
|
|
9854
10047
|
thumbnail
|
|
9855
10048
|
),
|
|
9856
|
-
/* @__PURE__ */
|
|
9857
|
-
|
|
10049
|
+
/* @__PURE__ */ React60.createElement("div", { className: "n-flex n-flex-col n-flex-1 n-w-0" }, /* @__PURE__ */ React60.createElement("div", { className: "n-flex n-items-center n-min-h-input-height n-flex-1 n-gap-2" }, /* @__PURE__ */ React60.createElement(
|
|
10050
|
+
"div",
|
|
9858
10051
|
{
|
|
9859
|
-
|
|
9860
|
-
|
|
9861
|
-
|
|
9862
|
-
|
|
9863
|
-
|
|
9864
|
-
|
|
9865
|
-
|
|
9866
|
-
|
|
9867
|
-
|
|
9868
|
-
|
|
10052
|
+
className: "n-flex-1 n-w-0 n-flex n-items-center",
|
|
10053
|
+
tabIndex: -1
|
|
10054
|
+
},
|
|
10055
|
+
isRenaming ? /* @__PURE__ */ React60.createElement(
|
|
10056
|
+
ViewComponent.EditableRowTitle,
|
|
10057
|
+
{
|
|
10058
|
+
value: getName(item),
|
|
10059
|
+
placeholder: getPlaceholder?.(item) ?? "Enter name",
|
|
10060
|
+
className: fontStyleMap[size],
|
|
10061
|
+
autoFocus: !isTestingRenaming,
|
|
10062
|
+
selectBeforeDot: renameSelectsBeforeDot,
|
|
10063
|
+
onSubmitEditing: (value) => {
|
|
10064
|
+
onRename?.(item, value);
|
|
10065
|
+
setRenamingId(void 0);
|
|
10066
|
+
},
|
|
10067
|
+
onKeyDown: (e) => {
|
|
10068
|
+
e.stopPropagation();
|
|
10069
|
+
}
|
|
9869
10070
|
}
|
|
9870
|
-
|
|
9871
|
-
|
|
9872
|
-
|
|
10071
|
+
) : /* @__PURE__ */ React60.createElement(
|
|
10072
|
+
ViewComponent.RowTitle,
|
|
10073
|
+
{
|
|
10074
|
+
className: cx(
|
|
10075
|
+
fontStyleMap[size],
|
|
10076
|
+
isSelected && "n-text-selected-list-item-text"
|
|
10077
|
+
)
|
|
10078
|
+
},
|
|
10079
|
+
getName(item)
|
|
10080
|
+
)
|
|
10081
|
+
), right && detailPosition === "end" && /* @__PURE__ */ React60.createElement(DetailContainer, { selected: isSelected }, right), end && detailPosition === "end" && /* @__PURE__ */ React60.createElement(DetailContainer, { selected: isSelected }, end)), below && /* @__PURE__ */ React60.createElement(
|
|
10082
|
+
DetailContainer,
|
|
9873
10083
|
{
|
|
9874
|
-
|
|
9875
|
-
|
|
9876
|
-
isSelected && "n-text-selected-list-item-text"
|
|
9877
|
-
)
|
|
10084
|
+
selected: isSelected,
|
|
10085
|
+
align: normalizedDetailLineClamp && normalizedDetailLineClamp > 1 ? "start" : "center"
|
|
9878
10086
|
},
|
|
9879
|
-
|
|
9880
|
-
)),
|
|
9881
|
-
right && detailPosition === "below" && /* @__PURE__ */
|
|
9882
|
-
end && detailPosition === "below" && /* @__PURE__ */
|
|
10087
|
+
below
|
|
10088
|
+
)),
|
|
10089
|
+
right && detailPosition === "below" && /* @__PURE__ */ React60.createElement(DetailContainer, { selected: isSelected }, right),
|
|
10090
|
+
end && detailPosition === "below" && /* @__PURE__ */ React60.createElement(DetailContainer, { selected: isSelected }, end)
|
|
9883
10091
|
)
|
|
9884
10092
|
);
|
|
9885
10093
|
}
|
|
@@ -9889,12 +10097,17 @@ var List = memoGeneric(
|
|
|
9889
10097
|
);
|
|
9890
10098
|
var DetailContainer = memo22(function DetailContainer2({
|
|
9891
10099
|
children,
|
|
9892
|
-
selected
|
|
10100
|
+
selected,
|
|
10101
|
+
align = "center"
|
|
9893
10102
|
}) {
|
|
9894
|
-
return /* @__PURE__ */
|
|
10103
|
+
return /* @__PURE__ */ React60.createElement(
|
|
9895
10104
|
"div",
|
|
9896
10105
|
{
|
|
9897
|
-
className: cx(
|
|
10106
|
+
className: cx(
|
|
10107
|
+
"n-flex n-gap-2",
|
|
10108
|
+
align === "center" ? "n-items-center" : "n-items-start",
|
|
10109
|
+
selected && "n-text-primary"
|
|
10110
|
+
),
|
|
9898
10111
|
tabIndex: -1
|
|
9899
10112
|
},
|
|
9900
10113
|
children
|
|
@@ -9958,7 +10171,7 @@ var itemHeightMap = {
|
|
|
9958
10171
|
// src/components/Collection.tsx
|
|
9959
10172
|
var Collection = forwardRefGeneric(function Collection2(props, ref) {
|
|
9960
10173
|
const { viewType, ...rest } = props;
|
|
9961
|
-
return viewType === "grid" ? /* @__PURE__ */
|
|
10174
|
+
return viewType === "grid" ? /* @__PURE__ */ React61.createElement(Grid, { ref, ...rest }) : /* @__PURE__ */ React61.createElement(List, { ref, ...rest });
|
|
9962
10175
|
});
|
|
9963
10176
|
|
|
9964
10177
|
// ../noya-color/src/convert.ts
|
|
@@ -10119,7 +10332,7 @@ import { clamp as clamp3 } from "@noya-app/noya-utils";
|
|
|
10119
10332
|
|
|
10120
10333
|
// src/components/ColorSwatch.tsx
|
|
10121
10334
|
import { CheckIcon } from "@noya-app/noya-icons";
|
|
10122
|
-
import
|
|
10335
|
+
import React62, { forwardRef as forwardRef22 } from "react";
|
|
10123
10336
|
var colorSwatchSizeMap = {
|
|
10124
10337
|
xxsmall: 15,
|
|
10125
10338
|
xsmall: 21,
|
|
@@ -10127,7 +10340,7 @@ var colorSwatchSizeMap = {
|
|
|
10127
10340
|
medium: 36,
|
|
10128
10341
|
large: 48
|
|
10129
10342
|
};
|
|
10130
|
-
var ColorSwatch =
|
|
10343
|
+
var ColorSwatch = forwardRef22(function ColorSwatch2({
|
|
10131
10344
|
color,
|
|
10132
10345
|
size = "small",
|
|
10133
10346
|
checked,
|
|
@@ -10137,7 +10350,7 @@ var ColorSwatch = forwardRef21(function ColorSwatch2({
|
|
|
10137
10350
|
}, ref) {
|
|
10138
10351
|
const sizePx = colorSwatchSizeMap[size];
|
|
10139
10352
|
const checkedColor = getContrastColorForBackground(color);
|
|
10140
|
-
return /* @__PURE__ */
|
|
10353
|
+
return /* @__PURE__ */ React62.createElement("div", { className: "n-relative", style: { width: sizePx, height: sizePx } }, /* @__PURE__ */ React62.createElement(
|
|
10141
10354
|
Component,
|
|
10142
10355
|
{
|
|
10143
10356
|
...props,
|
|
@@ -10153,7 +10366,7 @@ var ColorSwatch = forwardRef21(function ColorSwatch2({
|
|
|
10153
10366
|
...style2
|
|
10154
10367
|
}
|
|
10155
10368
|
}
|
|
10156
|
-
), checked && /* @__PURE__ */
|
|
10369
|
+
), checked && /* @__PURE__ */ React62.createElement(
|
|
10157
10370
|
CheckIcon,
|
|
10158
10371
|
{
|
|
10159
10372
|
color: checkedColor,
|
|
@@ -10164,7 +10377,7 @@ var ColorSwatch = forwardRef21(function ColorSwatch2({
|
|
|
10164
10377
|
|
|
10165
10378
|
// src/components/ColorSwatchControl.tsx
|
|
10166
10379
|
import { ToggleGroup as ToggleGroupPrimitive } from "radix-ui";
|
|
10167
|
-
import
|
|
10380
|
+
import React63, { useMemo as useMemo26 } from "react";
|
|
10168
10381
|
function ColorSwatchControl(props) {
|
|
10169
10382
|
const {
|
|
10170
10383
|
options,
|
|
@@ -10179,7 +10392,7 @@ function ColorSwatchControl(props) {
|
|
|
10179
10392
|
id,
|
|
10180
10393
|
style: style2
|
|
10181
10394
|
} = props;
|
|
10182
|
-
const styles3 =
|
|
10395
|
+
const styles3 = useMemo26(() => {
|
|
10183
10396
|
return {
|
|
10184
10397
|
display: "grid",
|
|
10185
10398
|
gridTemplateColumns: `repeat(auto-fill, minmax(${colorSwatchSizeMap[size]}px, 1fr))`,
|
|
@@ -10187,8 +10400,8 @@ function ColorSwatchControl(props) {
|
|
|
10187
10400
|
...style2
|
|
10188
10401
|
};
|
|
10189
10402
|
}, [size, style2]);
|
|
10190
|
-
const content = /* @__PURE__ */
|
|
10191
|
-
const item = /* @__PURE__ */
|
|
10403
|
+
const content = /* @__PURE__ */ React63.createElement("div", { className, id, style: styles3 }, options.map((option) => {
|
|
10404
|
+
const item = /* @__PURE__ */ React63.createElement(
|
|
10192
10405
|
ColorSwatch,
|
|
10193
10406
|
{
|
|
10194
10407
|
key: `${option}-color-swatch`,
|
|
@@ -10201,7 +10414,7 @@ function ColorSwatchControl(props) {
|
|
|
10201
10414
|
checked: value === option
|
|
10202
10415
|
}
|
|
10203
10416
|
);
|
|
10204
|
-
return /* @__PURE__ */
|
|
10417
|
+
return /* @__PURE__ */ React63.createElement(
|
|
10205
10418
|
ToggleGroupPrimitive.Item,
|
|
10206
10419
|
{
|
|
10207
10420
|
asChild: true,
|
|
@@ -10212,7 +10425,7 @@ function ColorSwatchControl(props) {
|
|
|
10212
10425
|
item
|
|
10213
10426
|
);
|
|
10214
10427
|
}));
|
|
10215
|
-
return /* @__PURE__ */
|
|
10428
|
+
return /* @__PURE__ */ React63.createElement(
|
|
10216
10429
|
ToggleGroupPrimitive.Root,
|
|
10217
10430
|
{
|
|
10218
10431
|
type: "single",
|
|
@@ -10227,18 +10440,18 @@ function ColorSwatchControl(props) {
|
|
|
10227
10440
|
|
|
10228
10441
|
// src/components/Combobox.tsx
|
|
10229
10442
|
import { DropdownChevronIcon as DropdownChevronIcon2 } from "@noya-app/noya-icons";
|
|
10230
|
-
import
|
|
10443
|
+
import React66, {
|
|
10231
10444
|
useCallback as useCallback27,
|
|
10232
10445
|
useEffect as useEffect20,
|
|
10233
10446
|
useImperativeHandle as useImperativeHandle6,
|
|
10234
|
-
useMemo as
|
|
10447
|
+
useMemo as useMemo27,
|
|
10235
10448
|
useRef as useRef21,
|
|
10236
10449
|
useState as useState26
|
|
10237
10450
|
} from "react";
|
|
10238
10451
|
|
|
10239
10452
|
// src/utils/combobox.ts
|
|
10240
10453
|
import { chunkBy, partition } from "@noya-app/noya-utils";
|
|
10241
|
-
import { useSyncExternalStore } from "react";
|
|
10454
|
+
import React64, { useSyncExternalStore } from "react";
|
|
10242
10455
|
|
|
10243
10456
|
// src/utils/fuzzyScorer.ts
|
|
10244
10457
|
import { scoreFilePathFuzzy } from "vscode-fuzzy-scorer";
|
|
@@ -10520,7 +10733,11 @@ function filterWithGroupedSections(items, query) {
|
|
|
10520
10733
|
);
|
|
10521
10734
|
} else {
|
|
10522
10735
|
const scoredItems = fuzzyFilter({
|
|
10523
|
-
items: selectableItems.map((item) =>
|
|
10736
|
+
items: selectableItems.map((item) => {
|
|
10737
|
+
const title = item.title?.toString?.() ?? "";
|
|
10738
|
+
const tooltipText = getNodeText(item.tooltip);
|
|
10739
|
+
return tooltipText ? `${title} ${tooltipText}` : title;
|
|
10740
|
+
}),
|
|
10524
10741
|
query
|
|
10525
10742
|
});
|
|
10526
10743
|
const usedIndexes = new Set(scoredItems.map((item) => item.index));
|
|
@@ -10566,10 +10783,20 @@ function useComboboxState(state) {
|
|
|
10566
10783
|
state.getSnapshot
|
|
10567
10784
|
);
|
|
10568
10785
|
}
|
|
10786
|
+
function getNodeText(node) {
|
|
10787
|
+
if (node === null || node === void 0 || typeof node === "boolean")
|
|
10788
|
+
return "";
|
|
10789
|
+
if (typeof node === "string" || typeof node === "number") return String(node);
|
|
10790
|
+
if (Array.isArray(node)) return node.map(getNodeText).join("");
|
|
10791
|
+
if (React64.isValidElement(node)) {
|
|
10792
|
+
return getNodeText(node.props?.children);
|
|
10793
|
+
}
|
|
10794
|
+
return "";
|
|
10795
|
+
}
|
|
10569
10796
|
|
|
10570
10797
|
// src/components/ComboboxMenu.tsx
|
|
10571
10798
|
import { CheckIcon as CheckIcon2 } from "@noya-app/noya-icons";
|
|
10572
|
-
import
|
|
10799
|
+
import React65, { memo as memo23 } from "react";
|
|
10573
10800
|
var ComboboxMenu = memoGeneric(
|
|
10574
10801
|
forwardRefGeneric(function ComboboxMenu2({
|
|
10575
10802
|
items,
|
|
@@ -10579,9 +10806,11 @@ var ComboboxMenu = memoGeneric(
|
|
|
10579
10806
|
listSize,
|
|
10580
10807
|
style: style2,
|
|
10581
10808
|
indented,
|
|
10582
|
-
iconPosition = "right"
|
|
10809
|
+
iconPosition = "right",
|
|
10810
|
+
itemHeight,
|
|
10811
|
+
getRowHeightForItem
|
|
10583
10812
|
}, forwardedRef) {
|
|
10584
|
-
return /* @__PURE__ */
|
|
10813
|
+
return /* @__PURE__ */ React65.createElement(
|
|
10585
10814
|
ListView.Root,
|
|
10586
10815
|
{
|
|
10587
10816
|
ref: forwardedRef,
|
|
@@ -10592,12 +10821,14 @@ var ComboboxMenu = memoGeneric(
|
|
|
10592
10821
|
},
|
|
10593
10822
|
data: items,
|
|
10594
10823
|
virtualized: listSize,
|
|
10824
|
+
...itemHeight ? { itemHeight } : {},
|
|
10825
|
+
...getRowHeightForItem ? { getItemHeightForItem: getRowHeightForItem } : {},
|
|
10595
10826
|
pressEventName: "onPointerDown",
|
|
10596
10827
|
sectionHeaderVariant: "label",
|
|
10597
10828
|
style: style2,
|
|
10598
10829
|
renderItem: (item, i) => {
|
|
10599
10830
|
if (item.type === "sectionHeader") {
|
|
10600
|
-
return /* @__PURE__ */
|
|
10831
|
+
return /* @__PURE__ */ React65.createElement(ListView.Row, { key: item.id, isSectionHeader: true }, indented && /* @__PURE__ */ React65.createElement(
|
|
10601
10832
|
Spacer.Horizontal,
|
|
10602
10833
|
{
|
|
10603
10834
|
size: CHECKBOX_WIDTH - CHECKBOX_RIGHT_INSET + CHECKBOX_INDENT_WIDTH
|
|
@@ -10608,7 +10839,11 @@ var ComboboxMenu = memoGeneric(
|
|
|
10608
10839
|
item: typeof item.title === "string" ? item.title : item.value,
|
|
10609
10840
|
itemScore: item
|
|
10610
10841
|
});
|
|
10611
|
-
|
|
10842
|
+
const tooltip = (
|
|
10843
|
+
// Only selectable items can have tooltips in this menu
|
|
10844
|
+
isSelectableMenuItem(item) ? item.tooltip : void 0
|
|
10845
|
+
);
|
|
10846
|
+
return /* @__PURE__ */ React65.createElement(
|
|
10612
10847
|
ListView.Row,
|
|
10613
10848
|
{
|
|
10614
10849
|
key: item.value,
|
|
@@ -10621,12 +10856,12 @@ var ComboboxMenu = memoGeneric(
|
|
|
10621
10856
|
}
|
|
10622
10857
|
}
|
|
10623
10858
|
},
|
|
10624
|
-
/* @__PURE__ */
|
|
10859
|
+
/* @__PURE__ */ React65.createElement("div", { className: "n-flex n-flex-1 n-min-w-0 n-items-start" }, indented && /* @__PURE__ */ React65.createElement(Spacer.Horizontal, { size: CHECKBOX_INDENT_WIDTH }), item.checked ? /* @__PURE__ */ React65.createElement("div", { ...styles.itemIndicator }, /* @__PURE__ */ React65.createElement(CheckIcon2, null)) : indented ? /* @__PURE__ */ React65.createElement(
|
|
10625
10860
|
Spacer.Horizontal,
|
|
10626
10861
|
{
|
|
10627
10862
|
size: CHECKBOX_WIDTH - CHECKBOX_RIGHT_INSET
|
|
10628
10863
|
}
|
|
10629
|
-
) : null, iconPosition === "left" && item.icon && /* @__PURE__ */
|
|
10864
|
+
) : null, iconPosition === "left" && item.icon && /* @__PURE__ */ React65.createElement(React65.Fragment, null, /* @__PURE__ */ React65.createElement(MenuIcon, { icon: item.icon }), /* @__PURE__ */ React65.createElement(Spacer.Horizontal, { size: 8 })), /* @__PURE__ */ React65.createElement("div", { className: "n-flex n-flex-col n-min-w-0 n-flex-1" }, /* @__PURE__ */ React65.createElement("div", { className: "n-min-w-0 n-truncate" }, tokens.map((token, j) => /* @__PURE__ */ React65.createElement(
|
|
10630
10865
|
"span",
|
|
10631
10866
|
{
|
|
10632
10867
|
key: `${item.value}-token-${j}`,
|
|
@@ -10636,14 +10871,17 @@ var ComboboxMenu = memoGeneric(
|
|
|
10636
10871
|
)
|
|
10637
10872
|
},
|
|
10638
10873
|
token.text
|
|
10639
|
-
))),
|
|
10640
|
-
(item.shortcut || item.icon && iconPosition === "right") && /* @__PURE__ */
|
|
10874
|
+
))), tooltip && /* @__PURE__ */ React65.createElement(Small, { color: "textSubtle", className: "n-truncate" }, tooltip))),
|
|
10875
|
+
(item.shortcut || item.icon && iconPosition === "right") && /* @__PURE__ */ React65.createElement("div", { className: "n-flex n-items-center n-min-w-0 n-ml-2" }, item.shortcut ? /* @__PURE__ */ React65.createElement(KeyboardShortcut, { shortcut: item.shortcut }) : item.icon && /* @__PURE__ */ React65.createElement(MenuIcon, { icon: item.icon }))
|
|
10641
10876
|
);
|
|
10642
10877
|
}
|
|
10643
10878
|
}
|
|
10644
10879
|
);
|
|
10645
10880
|
})
|
|
10646
10881
|
);
|
|
10882
|
+
var MenuIcon = memo23(function MenuIcon2({ icon }) {
|
|
10883
|
+
return /* @__PURE__ */ React65.createElement("div", { className: "n-relative n-top-[2px]" }, renderIcon(icon));
|
|
10884
|
+
});
|
|
10647
10885
|
|
|
10648
10886
|
// src/components/Combobox.tsx
|
|
10649
10887
|
var Combobox = memoGeneric(
|
|
@@ -10652,6 +10890,7 @@ var Combobox = memoGeneric(
|
|
|
10652
10890
|
placeholder,
|
|
10653
10891
|
items,
|
|
10654
10892
|
size,
|
|
10893
|
+
icon,
|
|
10655
10894
|
style: style2,
|
|
10656
10895
|
className,
|
|
10657
10896
|
label: labelProp,
|
|
@@ -10664,7 +10903,7 @@ var Combobox = memoGeneric(
|
|
|
10664
10903
|
onDeleteWhenEmpty,
|
|
10665
10904
|
...rest
|
|
10666
10905
|
}, forwardedRef) {
|
|
10667
|
-
const props =
|
|
10906
|
+
const props = useMemo27(() => {
|
|
10668
10907
|
if (rest.mode === "string") {
|
|
10669
10908
|
return {
|
|
10670
10909
|
mode: rest.mode,
|
|
@@ -10945,33 +11184,27 @@ var Combobox = memoGeneric(
|
|
|
10945
11184
|
ref.current?.focus();
|
|
10946
11185
|
handleBlur();
|
|
10947
11186
|
}, [shouldBlur, handleBlur]);
|
|
10948
|
-
const { sectionHeaderCount, menuItemsCount } =
|
|
10949
|
-
() => (
|
|
10950
|
-
sectionHeaderCount: filteredItems.filter(
|
|
10951
|
-
(item) => isMenuItemSectionHeader(item)
|
|
10952
|
-
).length,
|
|
10953
|
-
menuItemsCount: filteredItems.filter(
|
|
10954
|
-
(item) => isSelectableMenuItem(item)
|
|
10955
|
-
).length
|
|
10956
|
-
}),
|
|
11187
|
+
const { sectionHeaderCount, menuItemsCount, tallMenuItemsCount } = useMemo27(
|
|
11188
|
+
() => ListView.getMenuMetrics(filteredItems),
|
|
10957
11189
|
[filteredItems]
|
|
10958
11190
|
);
|
|
10959
11191
|
const hasCheckedItems = items.some(
|
|
10960
11192
|
(item) => isSelectableMenuItem(item) && item.checked
|
|
10961
11193
|
);
|
|
10962
|
-
return /* @__PURE__ */
|
|
11194
|
+
return /* @__PURE__ */ React66.createElement(
|
|
10963
11195
|
InputField2.Root,
|
|
10964
11196
|
{
|
|
10965
11197
|
id,
|
|
10966
11198
|
size,
|
|
10967
11199
|
sideOffset: 6,
|
|
10968
|
-
|
|
11200
|
+
start: icon ? renderIcon(icon) : void 0,
|
|
11201
|
+
end: /* @__PURE__ */ React66.createElement(React66.Fragment, null, loading && /* @__PURE__ */ React66.createElement("div", { className: "pr-1.5" }, /* @__PURE__ */ React66.createElement(ActivityIndicator, null)), !readOnly && /* @__PURE__ */ React66.createElement(
|
|
10969
11202
|
InputField2.Button,
|
|
10970
11203
|
{
|
|
10971
11204
|
variant: "floating",
|
|
10972
11205
|
onClick: handleChevronClick
|
|
10973
11206
|
},
|
|
10974
|
-
/* @__PURE__ */
|
|
11207
|
+
/* @__PURE__ */ React66.createElement(
|
|
10975
11208
|
DropdownChevronIcon2,
|
|
10976
11209
|
{
|
|
10977
11210
|
className: cx(
|
|
@@ -10982,15 +11215,16 @@ var Combobox = memoGeneric(
|
|
|
10982
11215
|
)
|
|
10983
11216
|
)),
|
|
10984
11217
|
renderPopoverContent: ({ width }) => {
|
|
10985
|
-
const
|
|
10986
|
-
|
|
10987
|
-
|
|
10988
|
-
|
|
10989
|
-
|
|
10990
|
-
|
|
10991
|
-
|
|
10992
|
-
|
|
10993
|
-
|
|
11218
|
+
const hasTooltips = tallMenuItemsCount > 0;
|
|
11219
|
+
const baseRowHeight = ListView.rowHeight;
|
|
11220
|
+
const computedHeight = ListView.calculateHeightWithTallRows({
|
|
11221
|
+
menuItemsCount,
|
|
11222
|
+
sectionHeaderCount,
|
|
11223
|
+
tallMenuItemsCount,
|
|
11224
|
+
maxBaseRows: 10.5
|
|
11225
|
+
});
|
|
11226
|
+
const adjustedListSize = { width, height: computedHeight };
|
|
11227
|
+
return /* @__PURE__ */ React66.createElement(
|
|
10994
11228
|
"div",
|
|
10995
11229
|
{
|
|
10996
11230
|
className: cx(
|
|
@@ -10998,7 +11232,7 @@ var Combobox = memoGeneric(
|
|
|
10998
11232
|
shouldShowMenu && !readOnly ? "n-flex" : "n-hidden"
|
|
10999
11233
|
)
|
|
11000
11234
|
},
|
|
11001
|
-
filteredItems.length > 0 && !loading ? /* @__PURE__ */
|
|
11235
|
+
filteredItems.length > 0 && !loading ? /* @__PURE__ */ React66.createElement(
|
|
11002
11236
|
ComboboxMenu,
|
|
11003
11237
|
{
|
|
11004
11238
|
ref: listRef,
|
|
@@ -11006,17 +11240,20 @@ var Combobox = memoGeneric(
|
|
|
11006
11240
|
selectedIndex,
|
|
11007
11241
|
onSelectItem: handleUpdateSelection,
|
|
11008
11242
|
onHoverIndex: handleIndexChange,
|
|
11009
|
-
listSize,
|
|
11243
|
+
listSize: adjustedListSize,
|
|
11010
11244
|
style: {
|
|
11011
|
-
flex: `0 0 ${
|
|
11245
|
+
flex: `0 0 ${computedHeight}px`
|
|
11012
11246
|
},
|
|
11013
|
-
indented: hasCheckedItems
|
|
11247
|
+
indented: hasCheckedItems,
|
|
11248
|
+
...hasTooltips ? {
|
|
11249
|
+
getRowHeightForItem: (item) => isSelectableMenuItem(item) && item.tooltip ? ListView.tallRowHeight : baseRowHeight
|
|
11250
|
+
} : { itemHeight: baseRowHeight }
|
|
11014
11251
|
}
|
|
11015
|
-
) : /* @__PURE__ */
|
|
11252
|
+
) : /* @__PURE__ */ React66.createElement("div", { className: "n-flex n-flex-col n-h-[50px] n-p-5 n-items-center n-justify-center" }, /* @__PURE__ */ React66.createElement(Small, { className: "n-text-text-disabled" }, loading ? "Loading..." : "No results"))
|
|
11016
11253
|
);
|
|
11017
11254
|
}
|
|
11018
11255
|
},
|
|
11019
|
-
/* @__PURE__ */
|
|
11256
|
+
/* @__PURE__ */ React66.createElement(
|
|
11020
11257
|
InputField2.Input,
|
|
11021
11258
|
{
|
|
11022
11259
|
ref,
|
|
@@ -11041,7 +11278,7 @@ var Combobox = memoGeneric(
|
|
|
11041
11278
|
...readOnly ? { readOnly: true } : {}
|
|
11042
11279
|
}
|
|
11043
11280
|
),
|
|
11044
|
-
filter && typeaheadValue && typeaheadValue.toLowerCase().startsWith(filter.toLowerCase()) && /* @__PURE__ */
|
|
11281
|
+
filter && typeaheadValue && typeaheadValue.toLowerCase().startsWith(filter.toLowerCase()) && /* @__PURE__ */ React66.createElement(
|
|
11045
11282
|
InputField2.Typeahead,
|
|
11046
11283
|
{
|
|
11047
11284
|
value: typeaheadValue,
|
|
@@ -11055,20 +11292,20 @@ var Combobox = memoGeneric(
|
|
|
11055
11292
|
);
|
|
11056
11293
|
|
|
11057
11294
|
// src/components/CommandPalette.tsx
|
|
11058
|
-
import
|
|
11295
|
+
import React68, { memo as memo24 } from "react";
|
|
11059
11296
|
|
|
11060
11297
|
// src/components/SearchCompletionMenu.tsx
|
|
11061
11298
|
import { getCurrentPlatform as getCurrentPlatform2, handleKeyboardEvent } from "@noya-app/noya-keymap";
|
|
11062
|
-
import
|
|
11063
|
-
forwardRef as
|
|
11299
|
+
import React67, {
|
|
11300
|
+
forwardRef as forwardRef23,
|
|
11064
11301
|
useCallback as useCallback28,
|
|
11065
11302
|
useEffect as useEffect21,
|
|
11066
11303
|
useImperativeHandle as useImperativeHandle7,
|
|
11067
|
-
useMemo as
|
|
11304
|
+
useMemo as useMemo28,
|
|
11068
11305
|
useRef as useRef22,
|
|
11069
11306
|
useState as useState27
|
|
11070
11307
|
} from "react";
|
|
11071
|
-
var SearchCompletionMenu =
|
|
11308
|
+
var SearchCompletionMenu = forwardRef23(function SearchCompletionMenu2({
|
|
11072
11309
|
onSelect,
|
|
11073
11310
|
onHover,
|
|
11074
11311
|
onClose,
|
|
@@ -11082,12 +11319,12 @@ var SearchCompletionMenu = forwardRef22(function SearchCompletionMenu2({
|
|
|
11082
11319
|
index: 0
|
|
11083
11320
|
});
|
|
11084
11321
|
const { index, search } = state;
|
|
11085
|
-
const listRef =
|
|
11322
|
+
const listRef = React67.useRef(null);
|
|
11086
11323
|
const hasCheckedItems = items.some((item) => item.checked);
|
|
11087
11324
|
useEffect21(() => {
|
|
11088
11325
|
listRef.current?.scrollToIndex(index);
|
|
11089
11326
|
}, [index]);
|
|
11090
|
-
const results =
|
|
11327
|
+
const results = useMemo28(
|
|
11091
11328
|
() => fuzzyFilter({
|
|
11092
11329
|
items: items.map(
|
|
11093
11330
|
(item) => typeof item.title === "string" ? item.title : item.value
|
|
@@ -11108,10 +11345,14 @@ var SearchCompletionMenu = forwardRef22(function SearchCompletionMenu2({
|
|
|
11108
11345
|
useEffect21(() => {
|
|
11109
11346
|
onHover?.(results[index]);
|
|
11110
11347
|
}, [index, onHover, results]);
|
|
11111
|
-
const
|
|
11348
|
+
const baseRowHeight = ListView.rowHeight;
|
|
11349
|
+
const searchHeight = baseRowHeight;
|
|
11112
11350
|
const listSize = results.length > 0 ? {
|
|
11113
11351
|
width,
|
|
11114
|
-
height: Math.min(
|
|
11352
|
+
height: Math.min(
|
|
11353
|
+
results.length * baseRowHeight,
|
|
11354
|
+
baseRowHeight * 6.5
|
|
11355
|
+
)
|
|
11115
11356
|
} : {
|
|
11116
11357
|
width,
|
|
11117
11358
|
height: 60
|
|
@@ -11161,7 +11402,7 @@ var SearchCompletionMenu = forwardRef22(function SearchCompletionMenu2({
|
|
|
11161
11402
|
inputRef.current?.focus();
|
|
11162
11403
|
}
|
|
11163
11404
|
}));
|
|
11164
|
-
return /* @__PURE__ */
|
|
11405
|
+
return /* @__PURE__ */ React67.createElement("div", { ...elementSize, className: "n-flex n-flex-col n-overflow-hidden" }, /* @__PURE__ */ React67.createElement(InputField2.Root, { className: "n-flex n-flex-0" }, /* @__PURE__ */ React67.createElement(
|
|
11165
11406
|
InputField2.Input,
|
|
11166
11407
|
{
|
|
11167
11408
|
ref: inputRef,
|
|
@@ -11181,7 +11422,7 @@ var SearchCompletionMenu = forwardRef22(function SearchCompletionMenu2({
|
|
|
11181
11422
|
onChange: setSearch,
|
|
11182
11423
|
onKeyDown: handleKeyDown
|
|
11183
11424
|
}
|
|
11184
|
-
)), /* @__PURE__ */
|
|
11425
|
+
)), /* @__PURE__ */ React67.createElement(Divider, null), results.length > 0 ? /* @__PURE__ */ React67.createElement(
|
|
11185
11426
|
ComboboxMenu,
|
|
11186
11427
|
{
|
|
11187
11428
|
ref: listRef,
|
|
@@ -11196,29 +11437,29 @@ var SearchCompletionMenu = forwardRef22(function SearchCompletionMenu2({
|
|
|
11196
11437
|
onHoverIndex: setIndex,
|
|
11197
11438
|
indented: hasCheckedItems
|
|
11198
11439
|
}
|
|
11199
|
-
) : /* @__PURE__ */
|
|
11440
|
+
) : /* @__PURE__ */ React67.createElement(
|
|
11200
11441
|
"div",
|
|
11201
11442
|
{
|
|
11202
11443
|
...listSize,
|
|
11203
11444
|
className: "n-flex n-flex-col n-p-20 n-items-center n-justify-center"
|
|
11204
11445
|
},
|
|
11205
|
-
/* @__PURE__ */
|
|
11446
|
+
/* @__PURE__ */ React67.createElement(Small, { color: "textDisabled" }, "No results")
|
|
11206
11447
|
));
|
|
11207
11448
|
});
|
|
11208
11449
|
|
|
11209
11450
|
// src/components/CommandPalette.tsx
|
|
11210
|
-
var CommandPalette =
|
|
11451
|
+
var CommandPalette = memo24(function CommandPalette2({
|
|
11211
11452
|
showCommandPalette,
|
|
11212
11453
|
setShowCommandPalette,
|
|
11213
11454
|
items,
|
|
11214
11455
|
onSelect,
|
|
11215
11456
|
onHover
|
|
11216
11457
|
}) {
|
|
11217
|
-
const menuRef =
|
|
11218
|
-
const handleClose =
|
|
11458
|
+
const menuRef = React68.useRef(null);
|
|
11459
|
+
const handleClose = React68.useCallback(() => {
|
|
11219
11460
|
setShowCommandPalette(false);
|
|
11220
11461
|
}, [setShowCommandPalette]);
|
|
11221
|
-
return /* @__PURE__ */
|
|
11462
|
+
return /* @__PURE__ */ React68.createElement(
|
|
11222
11463
|
Dialog,
|
|
11223
11464
|
{
|
|
11224
11465
|
style: {
|
|
@@ -11244,7 +11485,7 @@ var CommandPalette = memo23(function CommandPalette2({
|
|
|
11244
11485
|
}, 0);
|
|
11245
11486
|
}
|
|
11246
11487
|
},
|
|
11247
|
-
/* @__PURE__ */
|
|
11488
|
+
/* @__PURE__ */ React68.createElement("div", { className: "n-flex n-flex-col n-flex-1" }, /* @__PURE__ */ React68.createElement(AutoSizer, null, (size) => /* @__PURE__ */ React68.createElement(
|
|
11248
11489
|
SearchCompletionMenu,
|
|
11249
11490
|
{
|
|
11250
11491
|
ref: menuRef,
|
|
@@ -11259,21 +11500,21 @@ var CommandPalette = memo23(function CommandPalette2({
|
|
|
11259
11500
|
});
|
|
11260
11501
|
|
|
11261
11502
|
// src/components/connected-users-menu/ConnectedUsersMenuLayout.tsx
|
|
11262
|
-
import
|
|
11263
|
-
var UserAvatar = ({ userId, name, image }) => /* @__PURE__ */
|
|
11503
|
+
import React69 from "react";
|
|
11504
|
+
var UserAvatar = ({ userId, name, image }) => /* @__PURE__ */ React69.createElement(
|
|
11264
11505
|
Tooltip,
|
|
11265
11506
|
{
|
|
11266
11507
|
key: userId,
|
|
11267
|
-
content: /* @__PURE__ */
|
|
11508
|
+
content: /* @__PURE__ */ React69.createElement("div", { className: "n-flex n-flex-col" }, /* @__PURE__ */ React69.createElement(Small, null, name))
|
|
11268
11509
|
},
|
|
11269
|
-
/* @__PURE__ */
|
|
11510
|
+
/* @__PURE__ */ React69.createElement(Avatar, { size: INPUT_HEIGHT, userId, name, image })
|
|
11270
11511
|
);
|
|
11271
11512
|
var ConnectedUsersMenuLayout = ({
|
|
11272
11513
|
renderUsers,
|
|
11273
11514
|
launchAIAssistant,
|
|
11274
11515
|
isAssistantOpen
|
|
11275
11516
|
}) => {
|
|
11276
|
-
return /* @__PURE__ */
|
|
11517
|
+
return /* @__PURE__ */ React69.createElement("div", { className: "n-flex n-gap-1.5" }, /* @__PURE__ */ React69.createElement(AvatarStack, { size: INPUT_HEIGHT }, renderUsers()), launchAIAssistant && /* @__PURE__ */ React69.createElement(Tooltip, { content: "AI Assistant" }, /* @__PURE__ */ React69.createElement(
|
|
11277
11518
|
Button,
|
|
11278
11519
|
{
|
|
11279
11520
|
active: isAssistantOpen,
|
|
@@ -11285,7 +11526,7 @@ var ConnectedUsersMenuLayout = ({
|
|
|
11285
11526
|
};
|
|
11286
11527
|
|
|
11287
11528
|
// src/components/DraggableMenuButton.tsx
|
|
11288
|
-
import
|
|
11529
|
+
import React70, { useCallback as useCallback29, useState as useState28 } from "react";
|
|
11289
11530
|
var DraggableMenuButton = memoGeneric(function DraggableMenuButton2({
|
|
11290
11531
|
open: openProp,
|
|
11291
11532
|
onOpenChange: onOpenChangeProp,
|
|
@@ -11339,7 +11580,7 @@ var DraggableMenuButton = memoGeneric(function DraggableMenuButton2({
|
|
|
11339
11580
|
},
|
|
11340
11581
|
[setOpen]
|
|
11341
11582
|
);
|
|
11342
|
-
return /* @__PURE__ */
|
|
11583
|
+
return /* @__PURE__ */ React70.createElement(
|
|
11343
11584
|
"div",
|
|
11344
11585
|
{
|
|
11345
11586
|
...rest,
|
|
@@ -11356,7 +11597,7 @@ var DraggableMenuButton = memoGeneric(function DraggableMenuButton2({
|
|
|
11356
11597
|
onClick?.();
|
|
11357
11598
|
}
|
|
11358
11599
|
},
|
|
11359
|
-
items && onSelect ? /* @__PURE__ */
|
|
11600
|
+
items && onSelect ? /* @__PURE__ */ React70.createElement(
|
|
11360
11601
|
DropdownMenu,
|
|
11361
11602
|
{
|
|
11362
11603
|
open,
|
|
@@ -11365,14 +11606,14 @@ var DraggableMenuButton = memoGeneric(function DraggableMenuButton2({
|
|
|
11365
11606
|
onSelect,
|
|
11366
11607
|
shouldBindKeyboardShortcuts: false
|
|
11367
11608
|
},
|
|
11368
|
-
/* @__PURE__ */
|
|
11609
|
+
/* @__PURE__ */ React70.createElement("div", { className: "n-pointer-events-none n-h-[15px]" }, /* @__PURE__ */ React70.createElement(
|
|
11369
11610
|
Icon,
|
|
11370
11611
|
{
|
|
11371
11612
|
name: iconName,
|
|
11372
11613
|
color: isVisible || open ? cssVars.colors.icon : "transparent"
|
|
11373
11614
|
}
|
|
11374
11615
|
))
|
|
11375
|
-
) : /* @__PURE__ */
|
|
11616
|
+
) : /* @__PURE__ */ React70.createElement(
|
|
11376
11617
|
Icon,
|
|
11377
11618
|
{
|
|
11378
11619
|
name: iconName,
|
|
@@ -11384,10 +11625,10 @@ var DraggableMenuButton = memoGeneric(function DraggableMenuButton2({
|
|
|
11384
11625
|
|
|
11385
11626
|
// src/components/Drawer.tsx
|
|
11386
11627
|
import { Dialog as Dialog3 } from "radix-ui";
|
|
11387
|
-
import * as
|
|
11628
|
+
import * as React71 from "react";
|
|
11388
11629
|
import { useImperativeHandle as useImperativeHandle8 } from "react";
|
|
11389
|
-
var Drawer =
|
|
11390
|
-
|
|
11630
|
+
var Drawer = React71.memo(
|
|
11631
|
+
React71.forwardRef(function Drawer2({
|
|
11391
11632
|
open,
|
|
11392
11633
|
onOpenChange,
|
|
11393
11634
|
trigger,
|
|
@@ -11419,7 +11660,7 @@ var Drawer = React69.memo(
|
|
|
11419
11660
|
return internalOpen;
|
|
11420
11661
|
}
|
|
11421
11662
|
}));
|
|
11422
|
-
const inner = /* @__PURE__ */
|
|
11663
|
+
const inner = /* @__PURE__ */ React71.createElement(React71.Fragment, null, /* @__PURE__ */ React71.createElement(
|
|
11423
11664
|
Dialog3.Overlay,
|
|
11424
11665
|
{
|
|
11425
11666
|
className: cx(
|
|
@@ -11429,7 +11670,7 @@ var Drawer = React69.memo(
|
|
|
11429
11670
|
),
|
|
11430
11671
|
style: overlayStyle
|
|
11431
11672
|
}
|
|
11432
|
-
), /* @__PURE__ */
|
|
11673
|
+
), /* @__PURE__ */ React71.createElement(
|
|
11433
11674
|
Dialog3.Content,
|
|
11434
11675
|
{
|
|
11435
11676
|
id,
|
|
@@ -11441,24 +11682,24 @@ var Drawer = React69.memo(
|
|
|
11441
11682
|
className
|
|
11442
11683
|
)
|
|
11443
11684
|
},
|
|
11444
|
-
title && /* @__PURE__ */
|
|
11685
|
+
title && /* @__PURE__ */ React71.createElement(Dialog3.Title, null, title),
|
|
11445
11686
|
children
|
|
11446
11687
|
));
|
|
11447
|
-
return /* @__PURE__ */
|
|
11688
|
+
return /* @__PURE__ */ React71.createElement(
|
|
11448
11689
|
Dialog3.Root,
|
|
11449
11690
|
{
|
|
11450
11691
|
key: "dialog",
|
|
11451
11692
|
open: internalOpen,
|
|
11452
11693
|
onOpenChange: setInternalOpen
|
|
11453
11694
|
},
|
|
11454
|
-
/* @__PURE__ */
|
|
11455
|
-
portalled ? /* @__PURE__ */
|
|
11695
|
+
/* @__PURE__ */ React71.createElement(Dialog3.Trigger, { key: "trigger" }, trigger),
|
|
11696
|
+
portalled ? /* @__PURE__ */ React71.createElement(Dialog3.Portal, { container: portalContainer }, inner) : inner
|
|
11456
11697
|
);
|
|
11457
11698
|
})
|
|
11458
11699
|
);
|
|
11459
11700
|
|
|
11460
11701
|
// src/components/Fade.tsx
|
|
11461
|
-
import
|
|
11702
|
+
import React72 from "react";
|
|
11462
11703
|
var Fade = ({
|
|
11463
11704
|
children,
|
|
11464
11705
|
direction = "right",
|
|
@@ -11480,7 +11721,7 @@ var Fade = ({
|
|
|
11480
11721
|
top: "n-left-0 n-right-0 n-top-0",
|
|
11481
11722
|
bottom: "n-left-0 n-right-0 n-bottom-0"
|
|
11482
11723
|
}[direction];
|
|
11483
|
-
return /* @__PURE__ */
|
|
11724
|
+
return /* @__PURE__ */ React72.createElement("div", { className: cx("n-relative", className), style: { height } }, position === "front" ? children : null, /* @__PURE__ */ React72.createElement(
|
|
11484
11725
|
"div",
|
|
11485
11726
|
{
|
|
11486
11727
|
className: cx(
|
|
@@ -11499,21 +11740,21 @@ var Fade = ({
|
|
|
11499
11740
|
};
|
|
11500
11741
|
|
|
11501
11742
|
// src/components/file-explorer/FileExplorerLayout.tsx
|
|
11502
|
-
import
|
|
11743
|
+
import React73 from "react";
|
|
11503
11744
|
var FileExplorerLayout = ({
|
|
11504
11745
|
children,
|
|
11505
11746
|
className,
|
|
11506
11747
|
...props
|
|
11507
|
-
}) => /* @__PURE__ */
|
|
11748
|
+
}) => /* @__PURE__ */ React73.createElement(Section, { className: cx(className, "n-px-3 n-flex-1"), ...props }, children);
|
|
11508
11749
|
var FileExplorerUploadButton = ({
|
|
11509
11750
|
showUploadButton,
|
|
11510
11751
|
onUpload,
|
|
11511
11752
|
isUploading,
|
|
11512
11753
|
children
|
|
11513
|
-
}) => /* @__PURE__ */
|
|
11754
|
+
}) => /* @__PURE__ */ React73.createElement("div", { className: "n-flex n-items-center n-gap-2" }, showUploadButton && /* @__PURE__ */ React73.createElement(
|
|
11514
11755
|
Button,
|
|
11515
11756
|
{
|
|
11516
|
-
icon: isUploading ? /* @__PURE__ */
|
|
11757
|
+
icon: isUploading ? /* @__PURE__ */ React73.createElement(ActivityIndicator, { size: 15 }) : "UploadIcon",
|
|
11517
11758
|
onClick: onUpload,
|
|
11518
11759
|
"aria-label": "Upload file",
|
|
11519
11760
|
tooltip: "Upload file",
|
|
@@ -11523,7 +11764,7 @@ var FileExplorerUploadButton = ({
|
|
|
11523
11764
|
), children);
|
|
11524
11765
|
var FileExplorerCollection = forwardRefGeneric(
|
|
11525
11766
|
function FileExplorerCollection2({ ...props }, ref) {
|
|
11526
|
-
return /* @__PURE__ */
|
|
11767
|
+
return /* @__PURE__ */ React73.createElement(Collection, { ref, className: "-n-mx-3 n-flex-1", ...props });
|
|
11527
11768
|
}
|
|
11528
11769
|
);
|
|
11529
11770
|
var FileExplorerDetail = ({
|
|
@@ -11532,7 +11773,7 @@ var FileExplorerDetail = ({
|
|
|
11532
11773
|
children,
|
|
11533
11774
|
className,
|
|
11534
11775
|
style: style2
|
|
11535
|
-
}) => /* @__PURE__ */
|
|
11776
|
+
}) => /* @__PURE__ */ React73.createElement(
|
|
11536
11777
|
"span",
|
|
11537
11778
|
{
|
|
11538
11779
|
className: cx(
|
|
@@ -11547,10 +11788,10 @@ var FileExplorerDetail = ({
|
|
|
11547
11788
|
var FileExplorerEmptyState = ({
|
|
11548
11789
|
children: label = "No files",
|
|
11549
11790
|
...props
|
|
11550
|
-
}) => /* @__PURE__ */
|
|
11791
|
+
}) => /* @__PURE__ */ React73.createElement(Banner, { className: "n-mx-3", ...props }, label);
|
|
11551
11792
|
|
|
11552
11793
|
// src/components/FileUploadIndicator.tsx
|
|
11553
|
-
import
|
|
11794
|
+
import React76 from "react";
|
|
11554
11795
|
|
|
11555
11796
|
// src/utils/formatByteSize.ts
|
|
11556
11797
|
var byteSizeUnits = ["B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"];
|
|
@@ -11570,7 +11811,7 @@ import {
|
|
|
11570
11811
|
SpeakerLoudIcon,
|
|
11571
11812
|
VideoIcon
|
|
11572
11813
|
} from "@noya-app/noya-icons";
|
|
11573
|
-
import
|
|
11814
|
+
import React74, { memo as memo26, useMemo as useMemo29 } from "react";
|
|
11574
11815
|
|
|
11575
11816
|
// src/components/catppuccin/fileIcons.ts
|
|
11576
11817
|
var fileIcons = {
|
|
@@ -14010,7 +14251,7 @@ var getThumbnailColors = (colorScheme, selected) => {
|
|
|
14010
14251
|
};
|
|
14011
14252
|
}
|
|
14012
14253
|
};
|
|
14013
|
-
var MediaThumbnail =
|
|
14254
|
+
var MediaThumbnail = memo26(function MediaThumbnail2({
|
|
14014
14255
|
contentType: contentTypeProp,
|
|
14015
14256
|
selected = false,
|
|
14016
14257
|
className,
|
|
@@ -14028,14 +14269,14 @@ var MediaThumbnail = memo25(function MediaThumbnail2({
|
|
|
14028
14269
|
selected
|
|
14029
14270
|
);
|
|
14030
14271
|
const contentType = getAssetType(contentTypeProp);
|
|
14031
|
-
const iconStyles =
|
|
14272
|
+
const iconStyles = useMemo29(
|
|
14032
14273
|
() => ({
|
|
14033
14274
|
width: iconSizeMap[size],
|
|
14034
14275
|
height: iconSizeMap[size]
|
|
14035
14276
|
}),
|
|
14036
14277
|
[size]
|
|
14037
14278
|
);
|
|
14038
|
-
const content =
|
|
14279
|
+
const content = useMemo29(() => {
|
|
14039
14280
|
if (renderThumbnailIcon) {
|
|
14040
14281
|
const rendered = renderThumbnailIcon({ fileName, contentType });
|
|
14041
14282
|
if (rendered) return rendered;
|
|
@@ -14055,7 +14296,7 @@ var MediaThumbnail = memo25(function MediaThumbnail2({
|
|
|
14055
14296
|
renderUrl.searchParams.set("url", url);
|
|
14056
14297
|
renderUrl.searchParams.set("fit", aspect);
|
|
14057
14298
|
renderUrl.searchParams.set("theme", "light");
|
|
14058
|
-
return /* @__PURE__ */
|
|
14299
|
+
return /* @__PURE__ */ React74.createElement(
|
|
14059
14300
|
"img",
|
|
14060
14301
|
{
|
|
14061
14302
|
src: renderUrl.toString(),
|
|
@@ -14069,23 +14310,23 @@ var MediaThumbnail = memo25(function MediaThumbnail2({
|
|
|
14069
14310
|
}
|
|
14070
14311
|
switch (contentType) {
|
|
14071
14312
|
case "image":
|
|
14072
|
-
return /* @__PURE__ */
|
|
14313
|
+
return /* @__PURE__ */ React74.createElement(ImageIcon2, { color: iconColor, style: iconStyles });
|
|
14073
14314
|
case "video":
|
|
14074
|
-
return /* @__PURE__ */
|
|
14315
|
+
return /* @__PURE__ */ React74.createElement(VideoIcon, { color: iconColor, style: iconStyles });
|
|
14075
14316
|
case "audio":
|
|
14076
|
-
return /* @__PURE__ */
|
|
14317
|
+
return /* @__PURE__ */ React74.createElement(SpeakerLoudIcon, { color: iconColor, style: iconStyles });
|
|
14077
14318
|
default:
|
|
14078
14319
|
if (iconName) {
|
|
14079
14320
|
const Icon2 = Icons[iconName];
|
|
14080
|
-
return /* @__PURE__ */
|
|
14321
|
+
return /* @__PURE__ */ React74.createElement(Icon2, { color: iconColor, style: iconStyles });
|
|
14081
14322
|
}
|
|
14082
14323
|
if (fileName) {
|
|
14083
14324
|
if (fileName.endsWith(".noya")) {
|
|
14084
|
-
return /* @__PURE__ */
|
|
14325
|
+
return /* @__PURE__ */ React74.createElement(NoyaIcon, { color: iconColor, style: iconStyles });
|
|
14085
14326
|
}
|
|
14086
14327
|
const fileIcon = findFileIcon(fileName);
|
|
14087
14328
|
if (fileIcon) {
|
|
14088
|
-
return /* @__PURE__ */
|
|
14329
|
+
return /* @__PURE__ */ React74.createElement(
|
|
14089
14330
|
"img",
|
|
14090
14331
|
{
|
|
14091
14332
|
src: `https://api.iconify.design/catppuccin/${fileIcon}.svg?height=none&box=1`,
|
|
@@ -14095,7 +14336,7 @@ var MediaThumbnail = memo25(function MediaThumbnail2({
|
|
|
14095
14336
|
);
|
|
14096
14337
|
}
|
|
14097
14338
|
}
|
|
14098
|
-
return /* @__PURE__ */
|
|
14339
|
+
return /* @__PURE__ */ React74.createElement(FileIcon, { color: iconColor, style: iconStyles });
|
|
14099
14340
|
}
|
|
14100
14341
|
}, [
|
|
14101
14342
|
renderThumbnailIcon,
|
|
@@ -14109,7 +14350,7 @@ var MediaThumbnail = memo25(function MediaThumbnail2({
|
|
|
14109
14350
|
iconStyles,
|
|
14110
14351
|
iconName
|
|
14111
14352
|
]);
|
|
14112
|
-
return /* @__PURE__ */
|
|
14353
|
+
return /* @__PURE__ */ React74.createElement(
|
|
14113
14354
|
"div",
|
|
14114
14355
|
{
|
|
14115
14356
|
className: cx(
|
|
@@ -14152,7 +14393,7 @@ function findFileIcon(fileName) {
|
|
|
14152
14393
|
// src/components/Progress.tsx
|
|
14153
14394
|
import { clamp as clamp4 } from "@noya-app/noya-utils";
|
|
14154
14395
|
import { Progress as ProgressPrimitive } from "radix-ui";
|
|
14155
|
-
import * as
|
|
14396
|
+
import * as React75 from "react";
|
|
14156
14397
|
function Progress({
|
|
14157
14398
|
value,
|
|
14158
14399
|
colorScheme = "normal",
|
|
@@ -14161,18 +14402,18 @@ function Progress({
|
|
|
14161
14402
|
style: styleProp
|
|
14162
14403
|
}) {
|
|
14163
14404
|
const clampedValue = clamp4(value, 0, 100);
|
|
14164
|
-
const transformStyles =
|
|
14405
|
+
const transformStyles = React75.useMemo(
|
|
14165
14406
|
() => ({
|
|
14166
14407
|
transform: `translateX(-${100 - clampedValue}%)`,
|
|
14167
14408
|
backgroundColor: color
|
|
14168
14409
|
}),
|
|
14169
14410
|
[color, clampedValue]
|
|
14170
14411
|
);
|
|
14171
|
-
const style2 =
|
|
14412
|
+
const style2 = React75.useMemo(
|
|
14172
14413
|
() => ({ transform: "translateZ(0)", ...styleProp }),
|
|
14173
14414
|
[styleProp]
|
|
14174
14415
|
);
|
|
14175
|
-
return /* @__PURE__ */
|
|
14416
|
+
return /* @__PURE__ */ React75.createElement(
|
|
14176
14417
|
ProgressPrimitive.Root,
|
|
14177
14418
|
{
|
|
14178
14419
|
className: cx(
|
|
@@ -14182,7 +14423,7 @@ function Progress({
|
|
|
14182
14423
|
style: style2,
|
|
14183
14424
|
value: clampedValue
|
|
14184
14425
|
},
|
|
14185
|
-
/* @__PURE__ */
|
|
14426
|
+
/* @__PURE__ */ React75.createElement(
|
|
14186
14427
|
ProgressPrimitive.Indicator,
|
|
14187
14428
|
{
|
|
14188
14429
|
className: cx(
|
|
@@ -14207,14 +14448,14 @@ function FileUploadIndicator({
|
|
|
14207
14448
|
}) {
|
|
14208
14449
|
const done = percent === 1;
|
|
14209
14450
|
const value = typeof percent === "number" ? Math.round(percent) : 0;
|
|
14210
|
-
return /* @__PURE__ */
|
|
14451
|
+
return /* @__PURE__ */ React76.createElement("div", { className: "n-flex n-items-center n-gap-2" }, /* @__PURE__ */ React76.createElement("div", { className: "n-w-12 n-h-12 n-bg-background n-rounded-md n-overflow-hidden" }, /* @__PURE__ */ React76.createElement(
|
|
14211
14452
|
MediaThumbnail,
|
|
14212
14453
|
{
|
|
14213
14454
|
size: "medium",
|
|
14214
14455
|
fileName: name,
|
|
14215
14456
|
contentType
|
|
14216
14457
|
}
|
|
14217
|
-
)), /* @__PURE__ */
|
|
14458
|
+
)), /* @__PURE__ */ React76.createElement("div", { className: "n-flex n-flex-col n-flex-1 n-justify-center n-gap-1 n-min-w-0" }, name && /* @__PURE__ */ React76.createElement(Small, { color: "text", className: "n-truncate n-leading-none" }, name), typeof total === "number" && typeof percent === "number" && /* @__PURE__ */ React76.createElement(
|
|
14218
14459
|
Small,
|
|
14219
14460
|
{
|
|
14220
14461
|
color: "textSubtle",
|
|
@@ -14225,7 +14466,7 @@ function FileUploadIndicator({
|
|
|
14225
14466
|
" /",
|
|
14226
14467
|
" ",
|
|
14227
14468
|
formatByteSize(total)
|
|
14228
|
-
), typeof value === "number" && /* @__PURE__ */
|
|
14469
|
+
), typeof value === "number" && /* @__PURE__ */ React76.createElement(
|
|
14229
14470
|
Progress,
|
|
14230
14471
|
{
|
|
14231
14472
|
value,
|
|
@@ -14233,7 +14474,7 @@ function FileUploadIndicator({
|
|
|
14233
14474
|
className: "n-rounded-sm",
|
|
14234
14475
|
colorScheme: "secondary"
|
|
14235
14476
|
}
|
|
14236
|
-
)), /* @__PURE__ */
|
|
14477
|
+
)), /* @__PURE__ */ React76.createElement("div", { className: "n-flex n-items-center n-justify-center n-gap-2" }, typeof value === "number" && /* @__PURE__ */ React76.createElement(
|
|
14237
14478
|
Small,
|
|
14238
14479
|
{
|
|
14239
14480
|
color: "textSubtle",
|
|
@@ -14242,12 +14483,12 @@ function FileUploadIndicator({
|
|
|
14242
14483
|
},
|
|
14243
14484
|
value,
|
|
14244
14485
|
"%"
|
|
14245
|
-
), done ? /* @__PURE__ */
|
|
14486
|
+
), done ? /* @__PURE__ */ React76.createElement("div", { className: "n-w-[15px] n-h-[15px] n-bg-secondary n-rounded-full n-flex n-items-center n-justify-center n-text-white" }, /* @__PURE__ */ React76.createElement(Checkmark, null)) : /* @__PURE__ */ React76.createElement(ActivityIndicator, { size: 15 })));
|
|
14246
14487
|
}
|
|
14247
14488
|
function FileUploadList({
|
|
14248
14489
|
uploads
|
|
14249
14490
|
}) {
|
|
14250
|
-
return /* @__PURE__ */
|
|
14491
|
+
return /* @__PURE__ */ React76.createElement(React76.Fragment, null, /* @__PURE__ */ React76.createElement("div", { className: "n-flex n-items-center n-gap-2 n-py-2 n-px-4" }, /* @__PURE__ */ React76.createElement(Heading5, null, "Uploading ", uploads.length, " ", uploads.length === 1 ? "asset" : "assets")), /* @__PURE__ */ React76.createElement(Divider, null), /* @__PURE__ */ React76.createElement("div", { className: "n-flex n-flex-col n-gap-3 n-max-h-[500px] n-overflow-y-auto n-overflow-x-hidden n-py-4 n-px-4" }, uploads.map((upload) => /* @__PURE__ */ React76.createElement(
|
|
14251
14492
|
FileUploadIndicator,
|
|
14252
14493
|
{
|
|
14253
14494
|
key: upload.id,
|
|
@@ -14260,7 +14501,7 @@ function FileUploadList({
|
|
|
14260
14501
|
}
|
|
14261
14502
|
|
|
14262
14503
|
// src/components/FloatingWindow.tsx
|
|
14263
|
-
import
|
|
14504
|
+
import React77, { useCallback as useCallback30, useRef as useRef23, useState as useState29 } from "react";
|
|
14264
14505
|
var styles2 = {
|
|
14265
14506
|
noSelect: {
|
|
14266
14507
|
userSelect: "none",
|
|
@@ -14353,7 +14594,7 @@ function defaultRenderToolbar({
|
|
|
14353
14594
|
toolbarContent,
|
|
14354
14595
|
onClose
|
|
14355
14596
|
}) {
|
|
14356
|
-
return /* @__PURE__ */
|
|
14597
|
+
return /* @__PURE__ */ React77.createElement(React77.Fragment, null, /* @__PURE__ */ React77.createElement(Small, { className: "n-flex-1 n-font-medium n-text-text" }, title), toolbarContent, /* @__PURE__ */ React77.createElement(
|
|
14357
14598
|
IconButton,
|
|
14358
14599
|
{
|
|
14359
14600
|
iconName: "Cross3Icon",
|
|
@@ -14475,7 +14716,7 @@ var FloatingWindow = ({
|
|
|
14475
14716
|
setResizeDirection(null);
|
|
14476
14717
|
toggleGlobalTextSelection(false);
|
|
14477
14718
|
}, []);
|
|
14478
|
-
|
|
14719
|
+
React77.useEffect(() => {
|
|
14479
14720
|
document.addEventListener("mousemove", handleMouseMove);
|
|
14480
14721
|
document.addEventListener("mouseup", handleMouseUp);
|
|
14481
14722
|
return () => {
|
|
@@ -14489,7 +14730,7 @@ var FloatingWindow = ({
|
|
|
14489
14730
|
if (onClose) onClose();
|
|
14490
14731
|
floatingWindowManager.closeWindow(currentFloatingWindow.id);
|
|
14491
14732
|
}, [currentFloatingWindow.id, floatingWindowManager, onClose]);
|
|
14492
|
-
return /* @__PURE__ */
|
|
14733
|
+
return /* @__PURE__ */ React77.createElement(
|
|
14493
14734
|
"div",
|
|
14494
14735
|
{
|
|
14495
14736
|
ref: wrapperRef,
|
|
@@ -14504,7 +14745,7 @@ var FloatingWindow = ({
|
|
|
14504
14745
|
zIndex: cssVars.zIndex.menu
|
|
14505
14746
|
}
|
|
14506
14747
|
},
|
|
14507
|
-
/* @__PURE__ */
|
|
14748
|
+
/* @__PURE__ */ React77.createElement(
|
|
14508
14749
|
"div",
|
|
14509
14750
|
{
|
|
14510
14751
|
style: {
|
|
@@ -14515,9 +14756,9 @@ var FloatingWindow = ({
|
|
|
14515
14756
|
},
|
|
14516
14757
|
renderToolbar({ title, toolbarContent, onClose: handleClose })
|
|
14517
14758
|
),
|
|
14518
|
-
/* @__PURE__ */
|
|
14519
|
-
/* @__PURE__ */
|
|
14520
|
-
Object.entries(resizeHandlePositions).map(([direction, style2]) => /* @__PURE__ */
|
|
14759
|
+
/* @__PURE__ */ React77.createElement(Divider, null),
|
|
14760
|
+
/* @__PURE__ */ React77.createElement("div", { style: styles2.content }, children),
|
|
14761
|
+
Object.entries(resizeHandlePositions).map(([direction, style2]) => /* @__PURE__ */ React77.createElement(
|
|
14521
14762
|
"div",
|
|
14522
14763
|
{
|
|
14523
14764
|
key: direction,
|
|
@@ -14529,9 +14770,9 @@ var FloatingWindow = ({
|
|
|
14529
14770
|
};
|
|
14530
14771
|
|
|
14531
14772
|
// src/components/InspectorContainer.tsx
|
|
14532
|
-
import
|
|
14533
|
-
var InspectorContainer =
|
|
14534
|
-
|
|
14773
|
+
import React78, { forwardRef as forwardRef25, memo as memo27 } from "react";
|
|
14774
|
+
var InspectorContainer = memo27(
|
|
14775
|
+
forwardRef25(function InspectorContainer2({
|
|
14535
14776
|
header,
|
|
14536
14777
|
children,
|
|
14537
14778
|
fallback,
|
|
@@ -14540,7 +14781,7 @@ var InspectorContainer = memo26(
|
|
|
14540
14781
|
className,
|
|
14541
14782
|
style: style2
|
|
14542
14783
|
}, forwardedRef) {
|
|
14543
|
-
return /* @__PURE__ */
|
|
14784
|
+
return /* @__PURE__ */ React78.createElement(
|
|
14544
14785
|
"div",
|
|
14545
14786
|
{
|
|
14546
14787
|
ref: forwardedRef,
|
|
@@ -14555,32 +14796,32 @@ var InspectorContainer = memo26(
|
|
|
14555
14796
|
}
|
|
14556
14797
|
},
|
|
14557
14798
|
header,
|
|
14558
|
-
children ? /* @__PURE__ */
|
|
14799
|
+
children ? /* @__PURE__ */ React78.createElement(ScrollArea, null, /* @__PURE__ */ React78.createElement("div", { className: "n-flex n-flex-col n-relative" }, showDividers ? withSeparatorElements(children, /* @__PURE__ */ React78.createElement(Divider, null)) : children)) : fallback ? /* @__PURE__ */ React78.createElement("div", { className: "n-flex n-flex-col n-relative n-h-full" }, fallback) : null
|
|
14559
14800
|
);
|
|
14560
14801
|
})
|
|
14561
14802
|
);
|
|
14562
14803
|
|
|
14563
14804
|
// src/components/LabeledElementView.tsx
|
|
14564
14805
|
import * as kiwi from "kiwi.js";
|
|
14565
|
-
import * as
|
|
14566
|
-
var LabeledElementView =
|
|
14806
|
+
import * as React79 from "react";
|
|
14807
|
+
var LabeledElementView = React79.memo(function LabeledElementView2({
|
|
14567
14808
|
children,
|
|
14568
14809
|
renderLabel
|
|
14569
14810
|
}) {
|
|
14570
|
-
const elementIds =
|
|
14571
|
-
(child) =>
|
|
14811
|
+
const elementIds = React79.Children.toArray(children).flatMap(
|
|
14812
|
+
(child) => React79.isValidElement(child) && child.type === React79.Fragment ? child.props.children : [child]
|
|
14572
14813
|
).map(
|
|
14573
|
-
(child) =>
|
|
14814
|
+
(child) => React79.isValidElement(child) && "id" in child.props ? child.props.id : null
|
|
14574
14815
|
).filter((id) => !!id);
|
|
14575
14816
|
const serializedIds = elementIds.join(",");
|
|
14576
|
-
const containerRef =
|
|
14577
|
-
const refs =
|
|
14817
|
+
const containerRef = React79.useRef(null);
|
|
14818
|
+
const refs = React79.useMemo(() => {
|
|
14578
14819
|
return Object.fromEntries(
|
|
14579
|
-
serializedIds.split(",").map((id) => [id,
|
|
14820
|
+
serializedIds.split(",").map((id) => [id, React79.createRef()])
|
|
14580
14821
|
);
|
|
14581
14822
|
}, [serializedIds]);
|
|
14582
|
-
const labelElements =
|
|
14583
|
-
return serializedIds.split(",").map((id, index) => /* @__PURE__ */
|
|
14823
|
+
const labelElements = React79.useMemo(() => {
|
|
14824
|
+
return serializedIds.split(",").map((id, index) => /* @__PURE__ */ React79.createElement(
|
|
14584
14825
|
"span",
|
|
14585
14826
|
{
|
|
14586
14827
|
key: id,
|
|
@@ -14593,7 +14834,7 @@ var LabeledElementView = React77.memo(function LabeledElementView2({
|
|
|
14593
14834
|
})
|
|
14594
14835
|
));
|
|
14595
14836
|
}, [refs, serializedIds, renderLabel]);
|
|
14596
|
-
|
|
14837
|
+
React79.useLayoutEffect(() => {
|
|
14597
14838
|
if (!containerRef.current) return;
|
|
14598
14839
|
const containerRect = containerRef.current.getBoundingClientRect();
|
|
14599
14840
|
const solver = new kiwi.Solver();
|
|
@@ -14655,17 +14896,17 @@ var LabeledElementView = React77.memo(function LabeledElementView2({
|
|
|
14655
14896
|
`${Math.max(...heights)}px`
|
|
14656
14897
|
);
|
|
14657
14898
|
}, [refs, labelElements]);
|
|
14658
|
-
return /* @__PURE__ */
|
|
14899
|
+
return /* @__PURE__ */ React79.createElement("div", { className: "n-flex n-flex-1 n-flex-col n-relative", ref: containerRef }, /* @__PURE__ */ React79.createElement("div", { className: "n-flex n-flex-1 n-items-center" }, children), /* @__PURE__ */ React79.createElement("div", { className: "n-relative n-overflow-hidden n-select-none" }, labelElements));
|
|
14659
14900
|
});
|
|
14660
14901
|
|
|
14661
14902
|
// src/components/LabeledField.tsx
|
|
14662
|
-
import
|
|
14903
|
+
import React81, { memo as memo29, useMemo as useMemo32 } from "react";
|
|
14663
14904
|
|
|
14664
14905
|
// src/hooks/useIndent.ts
|
|
14665
|
-
import
|
|
14666
|
-
var IndentContext =
|
|
14906
|
+
import React80 from "react";
|
|
14907
|
+
var IndentContext = React80.createContext(0);
|
|
14667
14908
|
var useIndent = () => {
|
|
14668
|
-
return
|
|
14909
|
+
return React80.useContext(IndentContext);
|
|
14669
14910
|
};
|
|
14670
14911
|
|
|
14671
14912
|
// src/components/LabeledField.tsx
|
|
@@ -14677,7 +14918,7 @@ var labeledFieldStyles = (labelType) => cx(
|
|
|
14677
14918
|
var labelTypeInset = {
|
|
14678
14919
|
type: "inset"
|
|
14679
14920
|
};
|
|
14680
|
-
var LabeledField =
|
|
14921
|
+
var LabeledField = memo29(function LabeledField2({
|
|
14681
14922
|
children,
|
|
14682
14923
|
label,
|
|
14683
14924
|
labelType: labelTypeProp,
|
|
@@ -14693,15 +14934,15 @@ var LabeledField = memo28(function LabeledField2({
|
|
|
14693
14934
|
const labelWidth = labelWidthFromContext ?? minWidth;
|
|
14694
14935
|
const labelTypeFromContext = useLabelType();
|
|
14695
14936
|
const labelType = labelTypeProp ?? labelTypeFromContext;
|
|
14696
|
-
const labeledFieldClasses =
|
|
14937
|
+
const labeledFieldClasses = useMemo32(
|
|
14697
14938
|
() => labeledFieldStyles(labelType),
|
|
14698
14939
|
[labelType]
|
|
14699
14940
|
);
|
|
14700
|
-
const labelContextValue =
|
|
14941
|
+
const labelContextValue = useMemo32(
|
|
14701
14942
|
() => ({ fieldId, label }),
|
|
14702
14943
|
[fieldId, label]
|
|
14703
14944
|
);
|
|
14704
|
-
const indentStyle =
|
|
14945
|
+
const indentStyle = useMemo32(
|
|
14705
14946
|
() => ({
|
|
14706
14947
|
width: indentLevel * 8,
|
|
14707
14948
|
flexBasis: indentLevel * 8,
|
|
@@ -14710,20 +14951,20 @@ var LabeledField = memo28(function LabeledField2({
|
|
|
14710
14951
|
}),
|
|
14711
14952
|
[indentLevel]
|
|
14712
14953
|
);
|
|
14713
|
-
const fieldStyle =
|
|
14954
|
+
const fieldStyle = useMemo32(
|
|
14714
14955
|
() => ({
|
|
14715
14956
|
minWidth: `calc(100% - ${labelWidth + indentLevel * 8 + 6}px)`
|
|
14716
14957
|
}),
|
|
14717
14958
|
[labelWidth, indentLevel]
|
|
14718
14959
|
);
|
|
14719
|
-
const labelStyle =
|
|
14960
|
+
const labelStyle = useMemo32(
|
|
14720
14961
|
() => ({
|
|
14721
14962
|
minWidth: `calc(${labelWidth}px - ${indentLevel * 8}px)`,
|
|
14722
14963
|
...labelStyleProp
|
|
14723
14964
|
}),
|
|
14724
14965
|
[labelWidth, indentLevel, labelStyleProp]
|
|
14725
14966
|
);
|
|
14726
|
-
return /* @__PURE__ */
|
|
14967
|
+
return /* @__PURE__ */ React81.createElement(LabelContext.Provider, { value: labelContextValue }, labelType === "inset" ? /* @__PURE__ */ React81.createElement(LabelTypeContext.Provider, { value: labelTypeInset }, children) : /* @__PURE__ */ React81.createElement("div", { className: cx("n-flex n-relative n-flex-1", className), style: style2 }, Boolean(indentLevel) && /* @__PURE__ */ React81.createElement("div", { style: indentStyle }), /* @__PURE__ */ React81.createElement("div", { className: labeledFieldClasses }, labelType !== "none" && /* @__PURE__ */ React81.createElement(
|
|
14727
14968
|
Label,
|
|
14728
14969
|
{
|
|
14729
14970
|
htmlFor: fieldId,
|
|
@@ -14732,13 +14973,13 @@ var LabeledField = memo28(function LabeledField2({
|
|
|
14732
14973
|
...props
|
|
14733
14974
|
},
|
|
14734
14975
|
label
|
|
14735
|
-
), labelType === "start" ? /* @__PURE__ */
|
|
14976
|
+
), labelType === "start" ? /* @__PURE__ */ React81.createElement("div", { className: "n-flex-auto n-flex", style: fieldStyle }, children) : children)));
|
|
14736
14977
|
});
|
|
14737
14978
|
|
|
14738
14979
|
// src/components/ListMenu.tsx
|
|
14739
14980
|
import { ArrowRightIcon } from "@noya-app/noya-icons";
|
|
14740
14981
|
import { chunkBy as chunkBy2 } from "@noya-app/noya-utils";
|
|
14741
|
-
import
|
|
14982
|
+
import React82 from "react";
|
|
14742
14983
|
function getItemId(item) {
|
|
14743
14984
|
if (item.type === "submenu") {
|
|
14744
14985
|
return item.id;
|
|
@@ -14767,7 +15008,7 @@ function ListMenu({
|
|
|
14767
15008
|
const regularItems = chunk.filter(
|
|
14768
15009
|
(item) => isSubMenuItem(item) || isSelectableMenuItem(item)
|
|
14769
15010
|
);
|
|
14770
|
-
return /* @__PURE__ */
|
|
15011
|
+
return /* @__PURE__ */ React82.createElement(
|
|
14771
15012
|
List,
|
|
14772
15013
|
{
|
|
14773
15014
|
key: regularItems.map(getItemId).join("-"),
|
|
@@ -14779,43 +15020,43 @@ function ListMenu({
|
|
|
14779
15020
|
getName: (item) => item.title.toString(),
|
|
14780
15021
|
selectedIds,
|
|
14781
15022
|
renderRight,
|
|
14782
|
-
renderThumbnail: ({ item }) => /* @__PURE__ */
|
|
14783
|
-
renderDetail: (item) => isSubMenuItem(item) && /* @__PURE__ */
|
|
15023
|
+
renderThumbnail: ({ item }) => /* @__PURE__ */ React82.createElement("div", { className: "n-flex n-flex-1 n-items-center n-justify-center n-bg-divider-subtle n-w-full n-h-full n-rounded-sm" }, renderIcon(item.icon)),
|
|
15024
|
+
renderDetail: (item) => isSubMenuItem(item) && /* @__PURE__ */ React82.createElement(ArrowRightIcon, null),
|
|
14784
15025
|
onClickItem: (itemId) => onSelect(itemId)
|
|
14785
15026
|
}
|
|
14786
15027
|
);
|
|
14787
15028
|
});
|
|
14788
15029
|
return withSeparatorElements(
|
|
14789
15030
|
lists,
|
|
14790
|
-
/* @__PURE__ */
|
|
15031
|
+
/* @__PURE__ */ React82.createElement(Divider, { overflow: 12, className: "n-my-1" })
|
|
14791
15032
|
);
|
|
14792
15033
|
}
|
|
14793
15034
|
|
|
14794
15035
|
// src/components/ListNavigator.tsx
|
|
14795
|
-
import
|
|
15036
|
+
import React86 from "react";
|
|
14796
15037
|
|
|
14797
15038
|
// src/components/Navigator.tsx
|
|
14798
|
-
import
|
|
15039
|
+
import React85, {
|
|
14799
15040
|
Children as Children4,
|
|
14800
15041
|
isValidElement as isValidElement5,
|
|
14801
15042
|
useCallback as useCallback32,
|
|
14802
|
-
useMemo as
|
|
15043
|
+
useMemo as useMemo34,
|
|
14803
15044
|
useRef as useRef26,
|
|
14804
15045
|
useState as useState31
|
|
14805
15046
|
} from "react";
|
|
14806
15047
|
|
|
14807
15048
|
// src/components/StackNavigator.tsx
|
|
14808
15049
|
import { isDeepEqual as isDeepEqual4 } from "@noya-app/noya-utils";
|
|
14809
|
-
import
|
|
15050
|
+
import React84, {
|
|
14810
15051
|
useCallback as useCallback31,
|
|
14811
15052
|
useEffect as useEffect22,
|
|
14812
|
-
useMemo as
|
|
15053
|
+
useMemo as useMemo33,
|
|
14813
15054
|
useRef as useRef25,
|
|
14814
15055
|
useState as useState30
|
|
14815
15056
|
} from "react";
|
|
14816
15057
|
|
|
14817
15058
|
// src/components/BaseToolbar.tsx
|
|
14818
|
-
import
|
|
15059
|
+
import React83 from "react";
|
|
14819
15060
|
var toolbarStyle = {
|
|
14820
15061
|
[cssVarNames.colors.buttonBackground]: "transparent",
|
|
14821
15062
|
[cssVarNames.colors.inputBackground]: "transparent"
|
|
@@ -14827,7 +15068,7 @@ function BaseToolbarContainer({
|
|
|
14827
15068
|
innerClassName,
|
|
14828
15069
|
enableAbsoluteBreakpoint = true
|
|
14829
15070
|
}) {
|
|
14830
|
-
return /* @__PURE__ */
|
|
15071
|
+
return /* @__PURE__ */ React83.createElement("div", { className: cx("n-flex n-flex-col", className), style: toolbarStyle }, /* @__PURE__ */ React83.createElement(
|
|
14831
15072
|
"div",
|
|
14832
15073
|
{
|
|
14833
15074
|
className: cx(
|
|
@@ -14840,7 +15081,7 @@ function BaseToolbarContainer({
|
|
|
14840
15081
|
}
|
|
14841
15082
|
},
|
|
14842
15083
|
children
|
|
14843
|
-
), showDivider && /* @__PURE__ */
|
|
15084
|
+
), showDivider && /* @__PURE__ */ React83.createElement(Divider, { variant: "strong" }));
|
|
14844
15085
|
}
|
|
14845
15086
|
function BaseToolbar({
|
|
14846
15087
|
children,
|
|
@@ -14852,7 +15093,7 @@ function BaseToolbar({
|
|
|
14852
15093
|
innerClassName,
|
|
14853
15094
|
enableAbsoluteBreakpoint = true
|
|
14854
15095
|
}) {
|
|
14855
|
-
return /* @__PURE__ */
|
|
15096
|
+
return /* @__PURE__ */ React83.createElement(
|
|
14856
15097
|
BaseToolbarContainer,
|
|
14857
15098
|
{
|
|
14858
15099
|
showDivider,
|
|
@@ -14860,24 +15101,25 @@ function BaseToolbar({
|
|
|
14860
15101
|
innerClassName,
|
|
14861
15102
|
enableAbsoluteBreakpoint
|
|
14862
15103
|
},
|
|
14863
|
-
logo && /* @__PURE__ */
|
|
14864
|
-
/* @__PURE__ */
|
|
14865
|
-
left && /* @__PURE__ */
|
|
14866
|
-
/* @__PURE__ */
|
|
15104
|
+
logo && /* @__PURE__ */ React83.createElement(React83.Fragment, null, logo, /* @__PURE__ */ React83.createElement(DividerVertical, null)),
|
|
15105
|
+
/* @__PURE__ */ React83.createElement(Spacer.Horizontal, { size: 10 }),
|
|
15106
|
+
left && /* @__PURE__ */ React83.createElement(React83.Fragment, null, /* @__PURE__ */ React83.createElement("div", { className: "n-flex n-gap-toolbar-separator" }, left), /* @__PURE__ */ React83.createElement(Spacer.Horizontal, { size: 10 })),
|
|
15107
|
+
children && /* @__PURE__ */ React83.createElement(
|
|
14867
15108
|
"div",
|
|
14868
15109
|
{
|
|
14869
15110
|
className: "n-flex n-items-center n-justify-center n-text-text-muted n-pointer-events-none @2xl/toolbar:n-absolute n-inset-0"
|
|
14870
15111
|
},
|
|
14871
|
-
/* @__PURE__ */
|
|
15112
|
+
/* @__PURE__ */ React83.createElement("div", { className: "n-flex n-items-center n-justify-center n-pointer-events-auto" }, children)
|
|
14872
15113
|
),
|
|
14873
|
-
/* @__PURE__ */
|
|
14874
|
-
/* @__PURE__ */
|
|
14875
|
-
/* @__PURE__ */
|
|
15114
|
+
/* @__PURE__ */ React83.createElement(Spacer.Horizontal, null),
|
|
15115
|
+
/* @__PURE__ */ React83.createElement(Spacer.Horizontal, { size: 10 }),
|
|
15116
|
+
/* @__PURE__ */ React83.createElement("div", { className: "n-flex n-gap-toolbar-separator" }, right),
|
|
15117
|
+
/* @__PURE__ */ React83.createElement(Spacer.Horizontal, { size: 10 })
|
|
14876
15118
|
);
|
|
14877
15119
|
}
|
|
14878
15120
|
|
|
14879
15121
|
// src/components/StackNavigator.tsx
|
|
14880
|
-
var StackRenderContext =
|
|
15122
|
+
var StackRenderContext = React84.createContext({});
|
|
14881
15123
|
function StackNavigator({
|
|
14882
15124
|
items,
|
|
14883
15125
|
onBack,
|
|
@@ -14892,7 +15134,7 @@ function StackNavigator({
|
|
|
14892
15134
|
}) {
|
|
14893
15135
|
const top = items.at(-1);
|
|
14894
15136
|
const previousLengthRef = useRef25(items.length);
|
|
14895
|
-
const direction =
|
|
15137
|
+
const direction = useMemo33(() => {
|
|
14896
15138
|
const previous = previousLengthRef.current;
|
|
14897
15139
|
previousLengthRef.current = items.length;
|
|
14898
15140
|
return items.length >= previous ? "forward" : "back";
|
|
@@ -14939,7 +15181,7 @@ function StackNavigator({
|
|
|
14939
15181
|
return changed ? next : prev;
|
|
14940
15182
|
});
|
|
14941
15183
|
}, [items]);
|
|
14942
|
-
const animationStyles =
|
|
15184
|
+
const animationStyles = useMemo33(() => {
|
|
14943
15185
|
return {
|
|
14944
15186
|
entering: {
|
|
14945
15187
|
opacity: 0,
|
|
@@ -14959,7 +15201,7 @@ function StackNavigator({
|
|
|
14959
15201
|
};
|
|
14960
15202
|
}, [direction]);
|
|
14961
15203
|
const shouldAnimateSize = containerSize !== void 0;
|
|
14962
|
-
const contentStyle =
|
|
15204
|
+
const contentStyle = useMemo33(() => {
|
|
14963
15205
|
if (!containerSize) return void 0;
|
|
14964
15206
|
const style3 = {
|
|
14965
15207
|
// width: containerSize.width,
|
|
@@ -15037,7 +15279,7 @@ function StackNavigator({
|
|
|
15037
15279
|
}
|
|
15038
15280
|
return defaultRenderHeader(headerProps);
|
|
15039
15281
|
};
|
|
15040
|
-
return /* @__PURE__ */
|
|
15282
|
+
return /* @__PURE__ */ React84.createElement(
|
|
15041
15283
|
"div",
|
|
15042
15284
|
{
|
|
15043
15285
|
className: cx("n-flex n-flex-col", className),
|
|
@@ -15053,13 +15295,13 @@ function StackNavigator({
|
|
|
15053
15295
|
}
|
|
15054
15296
|
},
|
|
15055
15297
|
showHeader && renderHeaderContent(),
|
|
15056
|
-
/* @__PURE__ */
|
|
15298
|
+
/* @__PURE__ */ React84.createElement(
|
|
15057
15299
|
"div",
|
|
15058
15300
|
{
|
|
15059
15301
|
className: cx("n-relative n-overflow-hidden", contentClassName),
|
|
15060
15302
|
style: contentStyle
|
|
15061
15303
|
},
|
|
15062
|
-
/* @__PURE__ */
|
|
15304
|
+
/* @__PURE__ */ React84.createElement(StackRenderContext.Provider, { value: renderContentCache }, /* @__PURE__ */ React84.createElement(
|
|
15063
15305
|
AnimatePresence,
|
|
15064
15306
|
{
|
|
15065
15307
|
duration: 200,
|
|
@@ -15068,7 +15310,7 @@ function StackNavigator({
|
|
|
15068
15310
|
mode: "wait",
|
|
15069
15311
|
onChildStateChange: handleChildStateChange
|
|
15070
15312
|
},
|
|
15071
|
-
/* @__PURE__ */
|
|
15313
|
+
/* @__PURE__ */ React84.createElement(
|
|
15072
15314
|
StackNavigatorCard,
|
|
15073
15315
|
{
|
|
15074
15316
|
key: top.key,
|
|
@@ -15088,15 +15330,15 @@ var StackNavigatorCard = ({
|
|
|
15088
15330
|
style: style2,
|
|
15089
15331
|
className
|
|
15090
15332
|
}) => {
|
|
15091
|
-
const ref =
|
|
15333
|
+
const ref = React84.useRef(null);
|
|
15092
15334
|
const size = useSize(ref);
|
|
15093
|
-
const renderContext =
|
|
15335
|
+
const renderContext = React84.useContext(StackRenderContext);
|
|
15094
15336
|
const renderContent = renderContext?.[item.key] ?? item.renderContent;
|
|
15095
|
-
|
|
15337
|
+
React84.useEffect(() => {
|
|
15096
15338
|
if (!size || size.width === 0 || size.height === 0) return;
|
|
15097
15339
|
onSizeChange(item.key, size);
|
|
15098
15340
|
}, [item.key, onSizeChange, size]);
|
|
15099
|
-
return /* @__PURE__ */
|
|
15341
|
+
return /* @__PURE__ */ React84.createElement("div", { ref, className: cx("n-flex n-flex-col", className), style: style2 }, renderContent?.());
|
|
15100
15342
|
};
|
|
15101
15343
|
function defaultRenderHeader({
|
|
15102
15344
|
showDivider,
|
|
@@ -15105,13 +15347,13 @@ function defaultRenderHeader({
|
|
|
15105
15347
|
right,
|
|
15106
15348
|
title
|
|
15107
15349
|
}) {
|
|
15108
|
-
return /* @__PURE__ */
|
|
15350
|
+
return /* @__PURE__ */ React84.createElement(
|
|
15109
15351
|
BaseToolbar,
|
|
15110
15352
|
{
|
|
15111
15353
|
innerClassName: "n-px-1",
|
|
15112
15354
|
showDivider,
|
|
15113
15355
|
enableAbsoluteBreakpoint: false,
|
|
15114
|
-
left: showBackButton && /* @__PURE__ */
|
|
15356
|
+
left: showBackButton && /* @__PURE__ */ React84.createElement(
|
|
15115
15357
|
Button,
|
|
15116
15358
|
{
|
|
15117
15359
|
className: "-n-mx-2",
|
|
@@ -15122,7 +15364,7 @@ function defaultRenderHeader({
|
|
|
15122
15364
|
),
|
|
15123
15365
|
right
|
|
15124
15366
|
},
|
|
15125
|
-
typeof title === "string" || typeof title === "number" ? /* @__PURE__ */
|
|
15367
|
+
typeof title === "string" || typeof title === "number" ? /* @__PURE__ */ React84.createElement(Body, null, title) : title
|
|
15126
15368
|
);
|
|
15127
15369
|
}
|
|
15128
15370
|
|
|
@@ -15134,16 +15376,16 @@ var NavigatorScreen = Object.assign(
|
|
|
15134
15376
|
[navigatorScreenIdentifier]: true
|
|
15135
15377
|
}
|
|
15136
15378
|
);
|
|
15137
|
-
var NavigatorScreenContext =
|
|
15379
|
+
var NavigatorScreenContext = React85.createContext(null);
|
|
15138
15380
|
function useNavigator() {
|
|
15139
|
-
const context =
|
|
15381
|
+
const context = React85.useContext(NavigatorScreenContext);
|
|
15140
15382
|
if (!context) {
|
|
15141
15383
|
throw new Error("useNavigator must be used within a Navigator screen");
|
|
15142
15384
|
}
|
|
15143
15385
|
return context.navigation;
|
|
15144
15386
|
}
|
|
15145
15387
|
function useNavigatorRoute() {
|
|
15146
|
-
const context =
|
|
15388
|
+
const context = React85.useContext(NavigatorScreenContext);
|
|
15147
15389
|
if (!context) {
|
|
15148
15390
|
throw new Error("useNavigatorRoute must be used within a Navigator screen");
|
|
15149
15391
|
}
|
|
@@ -15171,7 +15413,7 @@ function NavigatorImpl({
|
|
|
15171
15413
|
showHeader,
|
|
15172
15414
|
renderHeader
|
|
15173
15415
|
}) {
|
|
15174
|
-
const screens =
|
|
15416
|
+
const screens = useMemo34(() => {
|
|
15175
15417
|
const configs = [];
|
|
15176
15418
|
Children4.forEach(children, (child) => {
|
|
15177
15419
|
if (!isNavigatorScreenElement(child)) return;
|
|
@@ -15179,7 +15421,7 @@ function NavigatorImpl({
|
|
|
15179
15421
|
});
|
|
15180
15422
|
return configs;
|
|
15181
15423
|
}, [children]);
|
|
15182
|
-
const screenMap =
|
|
15424
|
+
const screenMap = useMemo34(() => {
|
|
15183
15425
|
const map = /* @__PURE__ */ new Map();
|
|
15184
15426
|
for (const screen of screens) {
|
|
15185
15427
|
if (map.has(screen.name)) {
|
|
@@ -15268,7 +15510,7 @@ function NavigatorImpl({
|
|
|
15268
15510
|
},
|
|
15269
15511
|
[createEntry, screenMap]
|
|
15270
15512
|
);
|
|
15271
|
-
const items =
|
|
15513
|
+
const items = useMemo34(() => {
|
|
15272
15514
|
return stack.flatMap((entry) => {
|
|
15273
15515
|
const screen = screenMap.get(entry.name);
|
|
15274
15516
|
if (!screen) return [];
|
|
@@ -15306,7 +15548,7 @@ function NavigatorImpl({
|
|
|
15306
15548
|
onBack: headerProps.onBack
|
|
15307
15549
|
}),
|
|
15308
15550
|
renderContent: () => {
|
|
15309
|
-
return /* @__PURE__ */
|
|
15551
|
+
return /* @__PURE__ */ React85.createElement(NavigatorScreenContext.Provider, { value: context }, evaluateOption(screen.children, context));
|
|
15310
15552
|
}
|
|
15311
15553
|
};
|
|
15312
15554
|
});
|
|
@@ -15314,7 +15556,7 @@ function NavigatorImpl({
|
|
|
15314
15556
|
const shouldShowHeader = evaluateOption(showHeader, {
|
|
15315
15557
|
stack
|
|
15316
15558
|
});
|
|
15317
|
-
return /* @__PURE__ */
|
|
15559
|
+
return /* @__PURE__ */ React85.createElement(
|
|
15318
15560
|
StackNavigator,
|
|
15319
15561
|
{
|
|
15320
15562
|
items,
|
|
@@ -15354,7 +15596,7 @@ function ListNavigator({
|
|
|
15354
15596
|
renderHeader,
|
|
15355
15597
|
selectedIds
|
|
15356
15598
|
}) {
|
|
15357
|
-
return /* @__PURE__ */
|
|
15599
|
+
return /* @__PURE__ */ React86.createElement(
|
|
15358
15600
|
ListNavigatorInternal,
|
|
15359
15601
|
{
|
|
15360
15602
|
initialRoute: { name: "screen", params: { id: void 0 } },
|
|
@@ -15372,7 +15614,7 @@ function ListNavigator({
|
|
|
15372
15614
|
className,
|
|
15373
15615
|
style: style2
|
|
15374
15616
|
},
|
|
15375
|
-
/* @__PURE__ */
|
|
15617
|
+
/* @__PURE__ */ React86.createElement(
|
|
15376
15618
|
ListNavigatorInternal.Screen,
|
|
15377
15619
|
{
|
|
15378
15620
|
name: "screen",
|
|
@@ -15387,7 +15629,7 @@ function ListNavigator({
|
|
|
15387
15629
|
const nestedItem = items.find(
|
|
15388
15630
|
(item) => isSubMenuItem(item) && item.id === route.params.id
|
|
15389
15631
|
);
|
|
15390
|
-
return /* @__PURE__ */
|
|
15632
|
+
return /* @__PURE__ */ React86.createElement(
|
|
15391
15633
|
ListMenu,
|
|
15392
15634
|
{
|
|
15393
15635
|
items: nestedItem?.items ?? items,
|
|
@@ -15412,18 +15654,18 @@ function ListNavigator({
|
|
|
15412
15654
|
|
|
15413
15655
|
// src/components/Message.tsx
|
|
15414
15656
|
import { uuid as uuid2 } from "@noya-app/noya-utils";
|
|
15415
|
-
import
|
|
15416
|
-
var Message =
|
|
15417
|
-
|
|
15657
|
+
import React87, { forwardRef as forwardRef26, memo as memo30, useMemo as useMemo35 } from "react";
|
|
15658
|
+
var Message = memo30(
|
|
15659
|
+
forwardRef26(function Message2({ role, children, user, avatarSize = INPUT_HEIGHT }, ref) {
|
|
15418
15660
|
const randomId = uuid2();
|
|
15419
15661
|
const userMessageBackgroundColor = colorFromString(user?.id ?? randomId);
|
|
15420
|
-
const styles3 =
|
|
15662
|
+
const styles3 = useMemo35(
|
|
15421
15663
|
() => role === "user" ? {
|
|
15422
15664
|
backgroundColor: userMessageBackgroundColor
|
|
15423
15665
|
} : void 0,
|
|
15424
15666
|
[userMessageBackgroundColor, role]
|
|
15425
15667
|
);
|
|
15426
|
-
return /* @__PURE__ */
|
|
15668
|
+
return /* @__PURE__ */ React87.createElement(
|
|
15427
15669
|
"div",
|
|
15428
15670
|
{
|
|
15429
15671
|
className: cx(
|
|
@@ -15431,15 +15673,15 @@ var Message = memo29(
|
|
|
15431
15673
|
role === "user" ? "n-flex-row-reverse" : "n-flex-row"
|
|
15432
15674
|
)
|
|
15433
15675
|
},
|
|
15434
|
-
role === "assistant" ? /* @__PURE__ */
|
|
15676
|
+
role === "assistant" ? /* @__PURE__ */ React87.createElement(
|
|
15435
15677
|
Avatar,
|
|
15436
15678
|
{
|
|
15437
15679
|
name: "Assistant",
|
|
15438
15680
|
size: avatarSize,
|
|
15439
15681
|
backgroundColor: cssVars.colors.primaryPastel
|
|
15440
15682
|
},
|
|
15441
|
-
/* @__PURE__ */
|
|
15442
|
-
) : /* @__PURE__ */
|
|
15683
|
+
/* @__PURE__ */ React87.createElement(Logo, { style: { width: 15 }, fill: cssVars.colors.primary })
|
|
15684
|
+
) : /* @__PURE__ */ React87.createElement(
|
|
15443
15685
|
Avatar,
|
|
15444
15686
|
{
|
|
15445
15687
|
userId: !user ? randomId : user?.id,
|
|
@@ -15448,7 +15690,7 @@ var Message = memo29(
|
|
|
15448
15690
|
size: avatarSize
|
|
15449
15691
|
}
|
|
15450
15692
|
),
|
|
15451
|
-
/* @__PURE__ */
|
|
15693
|
+
/* @__PURE__ */ React87.createElement(
|
|
15452
15694
|
"div",
|
|
15453
15695
|
{
|
|
15454
15696
|
className: cx(
|
|
@@ -15468,9 +15710,9 @@ var Message = memo29(
|
|
|
15468
15710
|
|
|
15469
15711
|
// src/components/pipeline/PipelineResultLayout.tsx
|
|
15470
15712
|
import { Link1Icon } from "@noya-app/noya-icons";
|
|
15471
|
-
import
|
|
15713
|
+
import React88 from "react";
|
|
15472
15714
|
var PipelineResultLink = ({ url }) => {
|
|
15473
|
-
return /* @__PURE__ */
|
|
15715
|
+
return /* @__PURE__ */ React88.createElement("div", { className: "n-flex n-flex-col gap-0.5" }, /* @__PURE__ */ React88.createElement(
|
|
15474
15716
|
"a",
|
|
15475
15717
|
{
|
|
15476
15718
|
href: url,
|
|
@@ -15478,15 +15720,15 @@ var PipelineResultLink = ({ url }) => {
|
|
|
15478
15720
|
rel: "noopener noreferrer",
|
|
15479
15721
|
className: "n-flex n-text-primary hover:n-opacity-80 n-border n-border-divider n-rounded-md"
|
|
15480
15722
|
},
|
|
15481
|
-
/* @__PURE__ */
|
|
15482
|
-
/* @__PURE__ */
|
|
15483
|
-
/* @__PURE__ */
|
|
15723
|
+
/* @__PURE__ */ React88.createElement("div", { className: "n-flex n-gap-1 n-items-center n-p-2" }, /* @__PURE__ */ React88.createElement(Link1Icon, { className: "n-w-[15px] n-h-[15px] n-flex-shrink-0" })),
|
|
15724
|
+
/* @__PURE__ */ React88.createElement(DividerVertical, null),
|
|
15725
|
+
/* @__PURE__ */ React88.createElement(Small, { className: "n-truncate n-p-2 n-flex-1" }, url)
|
|
15484
15726
|
));
|
|
15485
15727
|
};
|
|
15486
15728
|
var PipelineResultLayout = ({
|
|
15487
15729
|
children
|
|
15488
15730
|
}) => {
|
|
15489
|
-
return /* @__PURE__ */
|
|
15731
|
+
return /* @__PURE__ */ React88.createElement("div", { className: "n-flex n-flex-col n-gap-2" }, children);
|
|
15490
15732
|
};
|
|
15491
15733
|
function getPipelineResultLink(value) {
|
|
15492
15734
|
if (typeof value !== "object" || value === null) return void 0;
|
|
@@ -15500,7 +15742,7 @@ function getPipelineResultLink(value) {
|
|
|
15500
15742
|
}
|
|
15501
15743
|
|
|
15502
15744
|
// src/components/ResizableContainer.tsx
|
|
15503
|
-
import
|
|
15745
|
+
import React89, { useCallback as useCallback33, useRef as useRef27, useState as useState32 } from "react";
|
|
15504
15746
|
var ResizableContainer = ({
|
|
15505
15747
|
children,
|
|
15506
15748
|
minWidth,
|
|
@@ -15569,7 +15811,7 @@ var ResizableContainer = ({
|
|
|
15569
15811
|
},
|
|
15570
15812
|
[shouldResetWidth]
|
|
15571
15813
|
);
|
|
15572
|
-
return /* @__PURE__ */
|
|
15814
|
+
return /* @__PURE__ */ React89.createElement(
|
|
15573
15815
|
"div",
|
|
15574
15816
|
{
|
|
15575
15817
|
ref: containerRef,
|
|
@@ -15577,7 +15819,7 @@ var ResizableContainer = ({
|
|
|
15577
15819
|
style: { position: "relative", ...style2 },
|
|
15578
15820
|
className
|
|
15579
15821
|
},
|
|
15580
|
-
/* @__PURE__ */
|
|
15822
|
+
/* @__PURE__ */ React89.createElement(
|
|
15581
15823
|
"div",
|
|
15582
15824
|
{
|
|
15583
15825
|
ref: resizeableRef,
|
|
@@ -15588,7 +15830,7 @@ var ResizableContainer = ({
|
|
|
15588
15830
|
}
|
|
15589
15831
|
},
|
|
15590
15832
|
typeof children === "function" ? children({ width }) : children,
|
|
15591
|
-
/* @__PURE__ */
|
|
15833
|
+
/* @__PURE__ */ React89.createElement(
|
|
15592
15834
|
"div",
|
|
15593
15835
|
{
|
|
15594
15836
|
ref: handleRef,
|
|
@@ -15613,7 +15855,7 @@ var ResizableContainer = ({
|
|
|
15613
15855
|
onPointerUp: handlePointerUp,
|
|
15614
15856
|
onPointerCancel: handlePointerUp
|
|
15615
15857
|
},
|
|
15616
|
-
/* @__PURE__ */
|
|
15858
|
+
/* @__PURE__ */ React89.createElement(
|
|
15617
15859
|
"div",
|
|
15618
15860
|
{
|
|
15619
15861
|
style: {
|
|
@@ -15631,7 +15873,7 @@ var ResizableContainer = ({
|
|
|
15631
15873
|
}
|
|
15632
15874
|
)
|
|
15633
15875
|
),
|
|
15634
|
-
drag && /* @__PURE__ */
|
|
15876
|
+
drag && /* @__PURE__ */ React89.createElement(
|
|
15635
15877
|
"div",
|
|
15636
15878
|
{
|
|
15637
15879
|
style: {
|
|
@@ -15654,7 +15896,7 @@ function clamp5(value, min, max) {
|
|
|
15654
15896
|
|
|
15655
15897
|
// src/components/RingProgress.tsx
|
|
15656
15898
|
import { clamp as clamp6 } from "@noya-app/noya-utils";
|
|
15657
|
-
import * as
|
|
15899
|
+
import * as React90 from "react";
|
|
15658
15900
|
function RingProgress({
|
|
15659
15901
|
value,
|
|
15660
15902
|
dividedBy = 100,
|
|
@@ -15670,14 +15912,14 @@ function RingProgress({
|
|
|
15670
15912
|
const safeDivisor = dividedBy > 0 ? dividedBy : 1;
|
|
15671
15913
|
const clampedRaw = clamp6(value, 0, safeDivisor);
|
|
15672
15914
|
const clampedPercent = clampedRaw / safeDivisor * 100;
|
|
15673
|
-
const radius =
|
|
15674
|
-
const circumference =
|
|
15675
|
-
const dashOffset =
|
|
15915
|
+
const radius = React90.useMemo(() => (size - thickness) / 2, [size, thickness]);
|
|
15916
|
+
const circumference = React90.useMemo(() => 2 * Math.PI * radius, [radius]);
|
|
15917
|
+
const dashOffset = React90.useMemo(
|
|
15676
15918
|
() => (100 - clampedPercent) / 100 * circumference,
|
|
15677
15919
|
[circumference, clampedPercent]
|
|
15678
15920
|
);
|
|
15679
15921
|
const trackStroke = trackColor ?? "var(--n-input-background, rgba(0,0,0,0.08))";
|
|
15680
|
-
const colorClass =
|
|
15922
|
+
const colorClass = React90.useMemo(() => {
|
|
15681
15923
|
switch (colorScheme) {
|
|
15682
15924
|
case "primary":
|
|
15683
15925
|
return "n-stroke-primary";
|
|
@@ -15690,7 +15932,7 @@ function RingProgress({
|
|
|
15690
15932
|
return "n-stroke-text";
|
|
15691
15933
|
}
|
|
15692
15934
|
}, [colorScheme]);
|
|
15693
|
-
const computedStroke =
|
|
15935
|
+
const computedStroke = React90.useMemo(() => {
|
|
15694
15936
|
if (color) return color;
|
|
15695
15937
|
switch (colorScheme) {
|
|
15696
15938
|
case "primary":
|
|
@@ -15704,7 +15946,7 @@ function RingProgress({
|
|
|
15704
15946
|
return "var(--n-text, currentColor)";
|
|
15705
15947
|
}
|
|
15706
15948
|
}, [color, colorScheme]);
|
|
15707
|
-
return /* @__PURE__ */
|
|
15949
|
+
return /* @__PURE__ */ React90.createElement(
|
|
15708
15950
|
"span",
|
|
15709
15951
|
{
|
|
15710
15952
|
className: cx("n-inline-flex n-items-center n-justify-center", className),
|
|
@@ -15715,7 +15957,7 @@ function RingProgress({
|
|
|
15715
15957
|
"aria-valuemax": safeDivisor,
|
|
15716
15958
|
"aria-label": ariaLabel
|
|
15717
15959
|
},
|
|
15718
|
-
/* @__PURE__ */
|
|
15960
|
+
/* @__PURE__ */ React90.createElement(
|
|
15719
15961
|
"svg",
|
|
15720
15962
|
{
|
|
15721
15963
|
width: size,
|
|
@@ -15723,7 +15965,7 @@ function RingProgress({
|
|
|
15723
15965
|
viewBox: `0 0 ${size} ${size}`,
|
|
15724
15966
|
style: { display: "block" }
|
|
15725
15967
|
},
|
|
15726
|
-
/* @__PURE__ */
|
|
15968
|
+
/* @__PURE__ */ React90.createElement(
|
|
15727
15969
|
"circle",
|
|
15728
15970
|
{
|
|
15729
15971
|
cx: size / 2,
|
|
@@ -15734,7 +15976,7 @@ function RingProgress({
|
|
|
15734
15976
|
strokeWidth: thickness
|
|
15735
15977
|
}
|
|
15736
15978
|
),
|
|
15737
|
-
/* @__PURE__ */
|
|
15979
|
+
/* @__PURE__ */ React90.createElement(
|
|
15738
15980
|
"circle",
|
|
15739
15981
|
{
|
|
15740
15982
|
cx: size / 2,
|
|
@@ -15758,13 +16000,49 @@ function RingProgress({
|
|
|
15758
16000
|
}
|
|
15759
16001
|
|
|
15760
16002
|
// src/components/ScrollableSidebar.tsx
|
|
15761
|
-
import
|
|
16003
|
+
import React91 from "react";
|
|
15762
16004
|
function ScrollableSidebar({ children }) {
|
|
15763
|
-
return /* @__PURE__ */
|
|
16005
|
+
return /* @__PURE__ */ React91.createElement("div", { className: "n-relative n-flex n-flex-col n-flex-1 n-max-h-full" }, /* @__PURE__ */ React91.createElement(ScrollArea, null, children));
|
|
16006
|
+
}
|
|
16007
|
+
|
|
16008
|
+
// src/components/ScrollArea2.tsx
|
|
16009
|
+
import { ScrollArea as ScrollArea3 } from "@base-ui-components/react/scroll-area";
|
|
16010
|
+
import * as React92 from "react";
|
|
16011
|
+
var SCROLLBAR_STATE_CLASSES = "scroll-component n-opacity-0 n-transition-opacity n-delay-300 n-pointer-events-none data-[hovering]:n-opacity-100 data-[hovering]:n-delay-0 data-[hovering]:n-duration-75 data-[hovering]:n-pointer-events-auto data-[scrolling]:n-opacity-100 data-[scrolling]:n-delay-0 data-[scrolling]:n-duration-75 data-[scrolling]:n-pointer-events-auto";
|
|
16012
|
+
var SCROLLBAR_TRACK_VERTICAL = "n-m-1 n-w-1 flex n-justify-center n-rounded-md n-bg-divider-subtle";
|
|
16013
|
+
var SCROLLBAR_TRACK_HORIZONTAL = "n-m-1 n-h-1 flex n-justify-center n-rounded-md n-bg-divider-subtle";
|
|
16014
|
+
var SCROLLBAR_THUMB_VERTICAL = "scroll-component n-w-full n-rounded n-bg-scrollbar";
|
|
16015
|
+
var SCROLLBAR_THUMB_HORIZONTAL = "scroll-component n-h-full n-rounded n-bg-scrollbar";
|
|
16016
|
+
function ScrollArea22({
|
|
16017
|
+
children,
|
|
16018
|
+
className,
|
|
16019
|
+
viewportClassName,
|
|
16020
|
+
orientation = "vertical"
|
|
16021
|
+
}) {
|
|
16022
|
+
return /* @__PURE__ */ React92.createElement(ScrollArea3.Root, { className: cx("n-relative", className) }, /* @__PURE__ */ React92.createElement(
|
|
16023
|
+
ScrollArea3.Viewport,
|
|
16024
|
+
{
|
|
16025
|
+
className: cx("n-h-full n-overscroll-contain", viewportClassName)
|
|
16026
|
+
},
|
|
16027
|
+
children
|
|
16028
|
+
), (orientation === "vertical" || orientation === "both") && /* @__PURE__ */ React92.createElement(
|
|
16029
|
+
ScrollArea3.Scrollbar,
|
|
16030
|
+
{
|
|
16031
|
+
className: cx(SCROLLBAR_STATE_CLASSES, SCROLLBAR_TRACK_VERTICAL)
|
|
16032
|
+
},
|
|
16033
|
+
/* @__PURE__ */ React92.createElement(ScrollArea3.Thumb, { className: SCROLLBAR_THUMB_VERTICAL })
|
|
16034
|
+
), (orientation === "horizontal" || orientation === "both") && /* @__PURE__ */ React92.createElement(
|
|
16035
|
+
ScrollArea3.Scrollbar,
|
|
16036
|
+
{
|
|
16037
|
+
orientation: "horizontal",
|
|
16038
|
+
className: cx(SCROLLBAR_STATE_CLASSES, SCROLLBAR_TRACK_HORIZONTAL)
|
|
16039
|
+
},
|
|
16040
|
+
/* @__PURE__ */ React92.createElement(ScrollArea3.Thumb, { className: SCROLLBAR_THUMB_HORIZONTAL })
|
|
16041
|
+
), orientation === "both" && /* @__PURE__ */ React92.createElement(ScrollArea3.Corner, null));
|
|
15764
16042
|
}
|
|
15765
16043
|
|
|
15766
16044
|
// src/components/Section.tsx
|
|
15767
|
-
import
|
|
16045
|
+
import React93, { memo as memo31, useMemo as useMemo37 } from "react";
|
|
15768
16046
|
var titleIconStyle = {
|
|
15769
16047
|
marginRight: "6px",
|
|
15770
16048
|
alignSelf: "flex-start",
|
|
@@ -15785,14 +16063,14 @@ function SectionHeader({
|
|
|
15785
16063
|
titleClassName,
|
|
15786
16064
|
onClickTitle
|
|
15787
16065
|
}) {
|
|
15788
|
-
const headerStyle =
|
|
16066
|
+
const headerStyle = useMemo37(
|
|
15789
16067
|
() => ({
|
|
15790
16068
|
minHeight: INPUT_HEIGHT,
|
|
15791
16069
|
...style2
|
|
15792
16070
|
}),
|
|
15793
16071
|
[style2]
|
|
15794
16072
|
);
|
|
15795
|
-
const titleElement = title ? /* @__PURE__ */
|
|
16073
|
+
const titleElement = title ? /* @__PURE__ */ React93.createElement(
|
|
15796
16074
|
InspectorPrimitives_exports.Title,
|
|
15797
16075
|
{
|
|
15798
16076
|
$textStyle: titleTextStyle,
|
|
@@ -15800,16 +16078,16 @@ function SectionHeader({
|
|
|
15800
16078
|
},
|
|
15801
16079
|
title
|
|
15802
16080
|
) : null;
|
|
15803
|
-
return /* @__PURE__ */
|
|
16081
|
+
return /* @__PURE__ */ React93.createElement(
|
|
15804
16082
|
InspectorPrimitives_exports.SectionHeader,
|
|
15805
16083
|
{
|
|
15806
16084
|
style: headerStyle,
|
|
15807
16085
|
className
|
|
15808
16086
|
},
|
|
15809
|
-
titleIcon && /* @__PURE__ */
|
|
15810
|
-
titleElement && /* @__PURE__ */
|
|
15811
|
-
headerSeparator === "space" && /* @__PURE__ */
|
|
15812
|
-
headerSeparator === "dot" && /* @__PURE__ */
|
|
16087
|
+
titleIcon && /* @__PURE__ */ React93.createElement("div", { style: titleIconStyle, className: textStyles[titleTextStyle] }, "\u200B", renderIcon(titleIcon)),
|
|
16088
|
+
titleElement && /* @__PURE__ */ React93.createElement(React93.Fragment, null, onClickTitle ? /* @__PURE__ */ React93.createElement(Button, { variant: "none", onClick: onClickTitle }, titleElement) : titleElement),
|
|
16089
|
+
headerSeparator === "space" && /* @__PURE__ */ React93.createElement(Spacer.Horizontal, null),
|
|
16090
|
+
headerSeparator === "dot" && /* @__PURE__ */ React93.createElement(
|
|
15813
16091
|
Text,
|
|
15814
16092
|
{
|
|
15815
16093
|
variant: titleTextStyle,
|
|
@@ -15835,7 +16113,7 @@ var SectionInternal = ({
|
|
|
15835
16113
|
titleClassName,
|
|
15836
16114
|
headerStyle: headerStyleProp
|
|
15837
16115
|
}) => {
|
|
15838
|
-
const style2 =
|
|
16116
|
+
const style2 = useMemo37(
|
|
15839
16117
|
() => ({
|
|
15840
16118
|
display: "flex",
|
|
15841
16119
|
flexDirection: "column",
|
|
@@ -15846,15 +16124,15 @@ var SectionInternal = ({
|
|
|
15846
16124
|
}),
|
|
15847
16125
|
[titleTextStyle, title, extraPadding, styleProp]
|
|
15848
16126
|
);
|
|
15849
|
-
const hasChildren =
|
|
15850
|
-
const headerStyle =
|
|
16127
|
+
const hasChildren = React93.Children.toArray(children).some((child) => !!child);
|
|
16128
|
+
const headerStyle = useMemo37(
|
|
15851
16129
|
() => ({
|
|
15852
16130
|
marginBottom: hasChildren ? "4px" : void 0,
|
|
15853
16131
|
...headerStyleProp
|
|
15854
16132
|
}),
|
|
15855
16133
|
[hasChildren, headerStyleProp]
|
|
15856
16134
|
);
|
|
15857
|
-
return /* @__PURE__ */
|
|
16135
|
+
return /* @__PURE__ */ React93.createElement("div", { style: style2, className }, (title || titleIcon || right) && /* @__PURE__ */ React93.createElement(
|
|
15858
16136
|
SectionHeader,
|
|
15859
16137
|
{
|
|
15860
16138
|
style: headerStyle,
|
|
@@ -15866,7 +16144,7 @@ var SectionInternal = ({
|
|
|
15866
16144
|
right,
|
|
15867
16145
|
headerSeparator
|
|
15868
16146
|
}
|
|
15869
|
-
), /* @__PURE__ */
|
|
16147
|
+
), /* @__PURE__ */ React93.createElement(IndentContext.Provider, { value: 0 }, children));
|
|
15870
16148
|
};
|
|
15871
16149
|
var ExpandableSection = ({
|
|
15872
16150
|
storageKey,
|
|
@@ -15879,12 +16157,12 @@ var ExpandableSection = ({
|
|
|
15879
16157
|
initialVisibility
|
|
15880
16158
|
);
|
|
15881
16159
|
const expanded = visibility === "show";
|
|
15882
|
-
return /* @__PURE__ */
|
|
16160
|
+
return /* @__PURE__ */ React93.createElement(
|
|
15883
16161
|
SectionInternal,
|
|
15884
16162
|
{
|
|
15885
16163
|
...props,
|
|
15886
16164
|
right: !props.hideRightWhenCollapsed || expanded ? props.right : null,
|
|
15887
|
-
title: /* @__PURE__ */
|
|
16165
|
+
title: /* @__PURE__ */ React93.createElement("div", { className: "n-flex n-gap-1 n-items-center" }, props.title, /* @__PURE__ */ React93.createElement(
|
|
15888
16166
|
IconButton,
|
|
15889
16167
|
{
|
|
15890
16168
|
iconName: expanded ? "ChevronDownIcon2" : "ChevronRightIcon2",
|
|
@@ -15895,26 +16173,26 @@ var ExpandableSection = ({
|
|
|
15895
16173
|
expanded && props.children
|
|
15896
16174
|
);
|
|
15897
16175
|
};
|
|
15898
|
-
var Section =
|
|
16176
|
+
var Section = memo31(function InspectorSection({
|
|
15899
16177
|
storageKey,
|
|
15900
16178
|
...props
|
|
15901
16179
|
}) {
|
|
15902
|
-
return storageKey ? /* @__PURE__ */
|
|
16180
|
+
return storageKey ? /* @__PURE__ */ React93.createElement(ExpandableSection, { ...props, storageKey }) : /* @__PURE__ */ React93.createElement(SectionInternal, { ...props });
|
|
15903
16181
|
});
|
|
15904
16182
|
|
|
15905
16183
|
// src/components/SegmentedControl.tsx
|
|
15906
16184
|
import { ToggleGroup as ToggleGroupPrimitive2 } from "radix-ui";
|
|
15907
|
-
import
|
|
16185
|
+
import React94, {
|
|
15908
16186
|
createContext as createContext13,
|
|
15909
|
-
forwardRef as
|
|
16187
|
+
forwardRef as forwardRef27,
|
|
15910
16188
|
useCallback as useCallback34,
|
|
15911
16189
|
useContext as useContext15,
|
|
15912
|
-
useMemo as
|
|
16190
|
+
useMemo as useMemo38
|
|
15913
16191
|
} from "react";
|
|
15914
16192
|
var SegmentedControlContext = createContext13({
|
|
15915
16193
|
colorScheme: "primary"
|
|
15916
16194
|
});
|
|
15917
|
-
var SegmentedControlItem =
|
|
16195
|
+
var SegmentedControlItem = forwardRef27(function SegmentedControlItem2({
|
|
15918
16196
|
value,
|
|
15919
16197
|
tooltip,
|
|
15920
16198
|
title,
|
|
@@ -15925,7 +16203,7 @@ var SegmentedControlItem = forwardRef26(function SegmentedControlItem2({
|
|
|
15925
16203
|
...props
|
|
15926
16204
|
}, forwardedRef) {
|
|
15927
16205
|
const { colorScheme } = useContext15(SegmentedControlContext);
|
|
15928
|
-
const itemElement = /* @__PURE__ */
|
|
16206
|
+
const itemElement = /* @__PURE__ */ React94.createElement(
|
|
15929
16207
|
ToggleGroupPrimitive2.Item,
|
|
15930
16208
|
{
|
|
15931
16209
|
ref: forwardedRef,
|
|
@@ -15956,7 +16234,7 @@ var SegmentedControlItem = forwardRef26(function SegmentedControlItem2({
|
|
|
15956
16234
|
),
|
|
15957
16235
|
...props
|
|
15958
16236
|
},
|
|
15959
|
-
/* @__PURE__ */
|
|
16237
|
+
/* @__PURE__ */ React94.createElement(
|
|
15960
16238
|
"span",
|
|
15961
16239
|
{
|
|
15962
16240
|
className: cx(
|
|
@@ -15968,7 +16246,7 @@ var SegmentedControlItem = forwardRef26(function SegmentedControlItem2({
|
|
|
15968
16246
|
title
|
|
15969
16247
|
)
|
|
15970
16248
|
);
|
|
15971
|
-
return tooltip ? /* @__PURE__ */
|
|
16249
|
+
return tooltip ? /* @__PURE__ */ React94.createElement(Tooltip, { content: tooltip }, itemElement) : itemElement;
|
|
15972
16250
|
});
|
|
15973
16251
|
var SegmentedControl = memoGeneric(function SegmentedControl2({
|
|
15974
16252
|
id: idProp,
|
|
@@ -15981,7 +16259,7 @@ var SegmentedControl = memoGeneric(function SegmentedControl2({
|
|
|
15981
16259
|
className,
|
|
15982
16260
|
style: style2
|
|
15983
16261
|
}) {
|
|
15984
|
-
const contextValue =
|
|
16262
|
+
const contextValue = useMemo38(() => ({ colorScheme }), [colorScheme]);
|
|
15985
16263
|
const { fieldId: id } = useLabel({ fieldId: idProp });
|
|
15986
16264
|
const handleValueChange = useCallback34(
|
|
15987
16265
|
(value2) => {
|
|
@@ -15990,7 +16268,7 @@ var SegmentedControl = memoGeneric(function SegmentedControl2({
|
|
|
15990
16268
|
},
|
|
15991
16269
|
[allowEmpty, onValueChange]
|
|
15992
16270
|
);
|
|
15993
|
-
return /* @__PURE__ */
|
|
16271
|
+
return /* @__PURE__ */ React94.createElement(SegmentedControlContext.Provider, { value: contextValue }, /* @__PURE__ */ React94.createElement(
|
|
15994
16272
|
ToggleGroupPrimitive2.Root,
|
|
15995
16273
|
{
|
|
15996
16274
|
id,
|
|
@@ -16009,13 +16287,13 @@ var SegmentedControl = memoGeneric(function SegmentedControl2({
|
|
|
16009
16287
|
gridTemplateColumns: `repeat(${items.length}, 1fr)`
|
|
16010
16288
|
}
|
|
16011
16289
|
},
|
|
16012
|
-
items.map((item, index) => /* @__PURE__ */
|
|
16290
|
+
items.map((item, index) => /* @__PURE__ */ React94.createElement(SegmentedControlItem, { key: index, ...item, variant }))
|
|
16013
16291
|
));
|
|
16014
16292
|
});
|
|
16015
16293
|
|
|
16016
16294
|
// src/components/SelectionToolbar.tsx
|
|
16017
16295
|
import * as PopperPrimitive from "@radix-ui/react-popper";
|
|
16018
|
-
import
|
|
16296
|
+
import React95, { memo as memo32, useMemo as useMemo39 } from "react";
|
|
16019
16297
|
import { createPortal as createPortal3 } from "react-dom";
|
|
16020
16298
|
var createVirtualElement = (rect) => ({
|
|
16021
16299
|
getBoundingClientRect: () => ({
|
|
@@ -16030,7 +16308,7 @@ var createVirtualElement = (rect) => ({
|
|
|
16030
16308
|
toJSON: () => null
|
|
16031
16309
|
})
|
|
16032
16310
|
});
|
|
16033
|
-
var SelectionToolbarContainer =
|
|
16311
|
+
var SelectionToolbarContainer = memo32(
|
|
16034
16312
|
function SelectionToolbarContainer2({
|
|
16035
16313
|
rect,
|
|
16036
16314
|
children,
|
|
@@ -16044,15 +16322,15 @@ var SelectionToolbarContainer = memo31(
|
|
|
16044
16322
|
transitionDuration = 0.2
|
|
16045
16323
|
}) {
|
|
16046
16324
|
const portalScopeId = usePortalScopeId();
|
|
16047
|
-
const containerRef =
|
|
16325
|
+
const containerRef = React95.useRef(null);
|
|
16048
16326
|
const size = useSize(containerRef, "width");
|
|
16049
|
-
const virtualRef =
|
|
16327
|
+
const virtualRef = useMemo39(
|
|
16050
16328
|
() => ({
|
|
16051
16329
|
current: createVirtualElement(rect)
|
|
16052
16330
|
}),
|
|
16053
16331
|
[rect]
|
|
16054
16332
|
);
|
|
16055
|
-
const popperContent = /* @__PURE__ */
|
|
16333
|
+
const popperContent = /* @__PURE__ */ React95.createElement(
|
|
16056
16334
|
PopperPrimitive.Content,
|
|
16057
16335
|
{
|
|
16058
16336
|
...portalScopeProps(portalScopeId),
|
|
@@ -16070,7 +16348,7 @@ var SelectionToolbarContainer = memo31(
|
|
|
16070
16348
|
[cssVarNames.colors.buttonBackground]: "transparent"
|
|
16071
16349
|
}
|
|
16072
16350
|
},
|
|
16073
|
-
/* @__PURE__ */
|
|
16351
|
+
/* @__PURE__ */ React95.createElement(
|
|
16074
16352
|
"div",
|
|
16075
16353
|
{
|
|
16076
16354
|
ref: containerRef,
|
|
@@ -16087,7 +16365,7 @@ var SelectionToolbarContainer = memo31(
|
|
|
16087
16365
|
children
|
|
16088
16366
|
)
|
|
16089
16367
|
);
|
|
16090
|
-
return /* @__PURE__ */
|
|
16368
|
+
return /* @__PURE__ */ React95.createElement(PopperPrimitive.Root, null, /* @__PURE__ */ React95.createElement(PopperPrimitive.Anchor, { virtualRef }), portalContainer ? createPortal3(popperContent, portalContainer) : popperContent);
|
|
16091
16369
|
}
|
|
16092
16370
|
);
|
|
16093
16371
|
|
|
@@ -16098,8 +16376,8 @@ import {
|
|
|
16098
16376
|
DropdownChevronIcon as DropdownChevronIcon3
|
|
16099
16377
|
} from "@noya-app/noya-icons";
|
|
16100
16378
|
import { Select } from "radix-ui";
|
|
16101
|
-
import
|
|
16102
|
-
useMemo as
|
|
16379
|
+
import React96, {
|
|
16380
|
+
useMemo as useMemo40,
|
|
16103
16381
|
useState as useState33
|
|
16104
16382
|
} from "react";
|
|
16105
16383
|
var readOnlyStyle = {
|
|
@@ -16124,7 +16402,7 @@ var SelectMenuTrigger = memoGeneric(function SelectMenuTrigger2({
|
|
|
16124
16402
|
fieldId: props.id
|
|
16125
16403
|
});
|
|
16126
16404
|
const labelType = useLabelType();
|
|
16127
|
-
return /* @__PURE__ */
|
|
16405
|
+
return /* @__PURE__ */ React96.createElement(Select.SelectTrigger, { asChild: true, onFocus, onBlur }, /* @__PURE__ */ React96.createElement(
|
|
16128
16406
|
Button,
|
|
16129
16407
|
{
|
|
16130
16408
|
id,
|
|
@@ -16136,10 +16414,10 @@ var SelectMenuTrigger = memoGeneric(function SelectMenuTrigger2({
|
|
|
16136
16414
|
),
|
|
16137
16415
|
disabled
|
|
16138
16416
|
},
|
|
16139
|
-
icon && /* @__PURE__ */
|
|
16140
|
-
label && labelType === "inset" && /* @__PURE__ */
|
|
16141
|
-
/* @__PURE__ */
|
|
16142
|
-
/* @__PURE__ */
|
|
16417
|
+
icon && /* @__PURE__ */ React96.createElement("span", { className: "n-pr-1.5" }, renderIcon(icon)),
|
|
16418
|
+
label && labelType === "inset" && /* @__PURE__ */ React96.createElement("div", { className: insetEndStyles }, /* @__PURE__ */ React96.createElement(Label, { className: "n-pr-4 n-text-text-disabled", htmlFor: id }, label)),
|
|
16419
|
+
/* @__PURE__ */ React96.createElement("span", { className: "n-flex-1 n-flex" }, /* @__PURE__ */ React96.createElement(Select.Value, { placeholder })),
|
|
16420
|
+
/* @__PURE__ */ React96.createElement(
|
|
16143
16421
|
DropdownChevronIcon3,
|
|
16144
16422
|
{
|
|
16145
16423
|
className: cx(
|
|
@@ -16187,8 +16465,8 @@ var SelectMenu = memoGeneric(function SelectMenu2({
|
|
|
16187
16465
|
}
|
|
16188
16466
|
setInternalOpen(open2);
|
|
16189
16467
|
};
|
|
16190
|
-
const readOnlyButton =
|
|
16191
|
-
() => /* @__PURE__ */
|
|
16468
|
+
const readOnlyButton = useMemo40(
|
|
16469
|
+
() => /* @__PURE__ */ React96.createElement(
|
|
16192
16470
|
Button,
|
|
16193
16471
|
{
|
|
16194
16472
|
id,
|
|
@@ -16198,11 +16476,11 @@ var SelectMenu = memoGeneric(function SelectMenu2({
|
|
|
16198
16476
|
disabled
|
|
16199
16477
|
},
|
|
16200
16478
|
icon && renderIcon(icon),
|
|
16201
|
-
/* @__PURE__ */
|
|
16479
|
+
/* @__PURE__ */ React96.createElement("span", { className: "n-flex n-flex-1" }, selectedItem?.title ?? value)
|
|
16202
16480
|
),
|
|
16203
16481
|
[icon, id, style2, className, disabled, value, selectedItem]
|
|
16204
16482
|
);
|
|
16205
|
-
const contentStyle =
|
|
16483
|
+
const contentStyle = useMemo40(() => {
|
|
16206
16484
|
return {
|
|
16207
16485
|
width: "var(--radix-select-trigger-width)",
|
|
16208
16486
|
minWidth: "max-content",
|
|
@@ -16210,7 +16488,7 @@ var SelectMenu = memoGeneric(function SelectMenu2({
|
|
|
16210
16488
|
...contentStyleProp
|
|
16211
16489
|
};
|
|
16212
16490
|
}, [contentStyleProp]);
|
|
16213
|
-
const content = /* @__PURE__ */
|
|
16491
|
+
const content = /* @__PURE__ */ React96.createElement(
|
|
16214
16492
|
Select.Root,
|
|
16215
16493
|
{
|
|
16216
16494
|
value,
|
|
@@ -16218,7 +16496,7 @@ var SelectMenu = memoGeneric(function SelectMenu2({
|
|
|
16218
16496
|
open,
|
|
16219
16497
|
onOpenChange: handleOpenChange
|
|
16220
16498
|
},
|
|
16221
|
-
/* @__PURE__ */
|
|
16499
|
+
/* @__PURE__ */ React96.createElement(
|
|
16222
16500
|
SelectMenuTrigger,
|
|
16223
16501
|
{
|
|
16224
16502
|
id,
|
|
@@ -16233,7 +16511,7 @@ var SelectMenu = memoGeneric(function SelectMenu2({
|
|
|
16233
16511
|
label
|
|
16234
16512
|
}
|
|
16235
16513
|
),
|
|
16236
|
-
/* @__PURE__ */
|
|
16514
|
+
/* @__PURE__ */ React96.createElement(Select.Portal, null, /* @__PURE__ */ React96.createElement(
|
|
16237
16515
|
Select.Content,
|
|
16238
16516
|
{
|
|
16239
16517
|
...portalScopeProps(portalScopeId),
|
|
@@ -16244,14 +16522,14 @@ var SelectMenu = memoGeneric(function SelectMenu2({
|
|
|
16244
16522
|
align: "center",
|
|
16245
16523
|
style: contentStyle
|
|
16246
16524
|
},
|
|
16247
|
-
/* @__PURE__ */
|
|
16525
|
+
/* @__PURE__ */ React96.createElement(Select.ScrollUpButton, { className: scrollButtonStyles }, /* @__PURE__ */ React96.createElement(
|
|
16248
16526
|
ChevronUpIcon,
|
|
16249
16527
|
{
|
|
16250
16528
|
className: cx("n-transition-transform n-duration-100")
|
|
16251
16529
|
}
|
|
16252
16530
|
)),
|
|
16253
|
-
/* @__PURE__ */
|
|
16254
|
-
/* @__PURE__ */
|
|
16531
|
+
/* @__PURE__ */ React96.createElement(Select.Viewport, null, /* @__PURE__ */ React96.createElement(MenuViewport, { items, Components: Components3 })),
|
|
16532
|
+
/* @__PURE__ */ React96.createElement(Select.ScrollDownButton, { className: scrollButtonStyles }, /* @__PURE__ */ React96.createElement(ChevronDownIcon, null))
|
|
16255
16533
|
))
|
|
16256
16534
|
);
|
|
16257
16535
|
return readOnly ? readOnlyButton : content;
|
|
@@ -16259,12 +16537,12 @@ var SelectMenu = memoGeneric(function SelectMenu2({
|
|
|
16259
16537
|
|
|
16260
16538
|
// src/components/Slider.tsx
|
|
16261
16539
|
import { Slider as RadixSlider } from "radix-ui";
|
|
16262
|
-
import
|
|
16540
|
+
import React97, { memo as memo33, useCallback as useCallback35, useMemo as useMemo41 } from "react";
|
|
16263
16541
|
var THUMB_WIDTH = 8;
|
|
16264
16542
|
var thumbStyle = {
|
|
16265
16543
|
width: THUMB_WIDTH
|
|
16266
16544
|
};
|
|
16267
|
-
var Slider =
|
|
16545
|
+
var Slider = memo33(function Slider2({
|
|
16268
16546
|
style: style2,
|
|
16269
16547
|
className,
|
|
16270
16548
|
value,
|
|
@@ -16278,7 +16556,7 @@ var Slider = memo32(function Slider2({
|
|
|
16278
16556
|
readOnly = false,
|
|
16279
16557
|
...props
|
|
16280
16558
|
}) {
|
|
16281
|
-
const arrayValue =
|
|
16559
|
+
const arrayValue = useMemo41(
|
|
16282
16560
|
() => [Math.min(Math.max(value, min), max)],
|
|
16283
16561
|
[value, min, max]
|
|
16284
16562
|
);
|
|
@@ -16292,7 +16570,7 @@ var Slider = memo32(function Slider2({
|
|
|
16292
16570
|
[onValueChange]
|
|
16293
16571
|
);
|
|
16294
16572
|
const ratio = (arrayValue[0] - min) / (max - min);
|
|
16295
|
-
return /* @__PURE__ */
|
|
16573
|
+
return /* @__PURE__ */ React97.createElement(
|
|
16296
16574
|
RadixSlider.Root,
|
|
16297
16575
|
{
|
|
16298
16576
|
min,
|
|
@@ -16310,7 +16588,7 @@ var Slider = memo32(function Slider2({
|
|
|
16310
16588
|
onBlur,
|
|
16311
16589
|
disabled: readOnly
|
|
16312
16590
|
},
|
|
16313
|
-
/* @__PURE__ */
|
|
16591
|
+
/* @__PURE__ */ React97.createElement("div", { className: "n-relative n-flex-grow n-h-[3px] n-overflow-hidden" }, /* @__PURE__ */ React97.createElement(
|
|
16314
16592
|
"div",
|
|
16315
16593
|
{
|
|
16316
16594
|
className: "n-absolute n-h-full n-rounded-l n-bg-slider-active-background",
|
|
@@ -16319,7 +16597,7 @@ var Slider = memo32(function Slider2({
|
|
|
16319
16597
|
width: `calc(${ratio * 100}% - ${ratio * 8}px - 2px)`
|
|
16320
16598
|
}
|
|
16321
16599
|
}
|
|
16322
|
-
), /* @__PURE__ */
|
|
16600
|
+
), /* @__PURE__ */ React97.createElement(
|
|
16323
16601
|
"div",
|
|
16324
16602
|
{
|
|
16325
16603
|
className: "n-absolute n-h-full n-rounded-r n-bg-input-background",
|
|
@@ -16329,7 +16607,7 @@ var Slider = memo32(function Slider2({
|
|
|
16329
16607
|
}
|
|
16330
16608
|
}
|
|
16331
16609
|
)),
|
|
16332
|
-
/* @__PURE__ */
|
|
16610
|
+
/* @__PURE__ */ React97.createElement(
|
|
16333
16611
|
RadixSlider.Thumb,
|
|
16334
16612
|
{
|
|
16335
16613
|
style: thumbStyle,
|
|
@@ -16347,28 +16625,28 @@ var Slider = memo32(function Slider2({
|
|
|
16347
16625
|
});
|
|
16348
16626
|
|
|
16349
16627
|
// src/components/sorting/createSharedDrag.tsx
|
|
16350
|
-
import * as
|
|
16628
|
+
import * as React98 from "react";
|
|
16351
16629
|
function createSharedDrag() {
|
|
16352
|
-
const dragRegistrationContext =
|
|
16353
|
-
const activeDragContext =
|
|
16630
|
+
const dragRegistrationContext = React98.createContext(null);
|
|
16631
|
+
const activeDragContext = React98.createContext(
|
|
16354
16632
|
null
|
|
16355
16633
|
);
|
|
16356
16634
|
const sharedDragProps = {
|
|
16357
16635
|
dragRegistrationContext,
|
|
16358
16636
|
activeDragContext
|
|
16359
16637
|
};
|
|
16360
|
-
const Provider = (props) => /* @__PURE__ */
|
|
16638
|
+
const Provider = (props) => /* @__PURE__ */ React98.createElement(SharedDragProvider, { sharedDragProps, ...props });
|
|
16361
16639
|
return {
|
|
16362
16640
|
Provider,
|
|
16363
|
-
Sortable: (props) => /* @__PURE__ */
|
|
16641
|
+
Sortable: (props) => /* @__PURE__ */ React98.createElement(Sortable, { sharedDragProps, ...props }),
|
|
16364
16642
|
props: sharedDragProps
|
|
16365
16643
|
};
|
|
16366
16644
|
}
|
|
16367
16645
|
|
|
16368
16646
|
// src/components/Stepper.tsx
|
|
16369
16647
|
import { clamp as clamp7 } from "@noya-app/noya-utils";
|
|
16370
|
-
import
|
|
16371
|
-
var Stepper =
|
|
16648
|
+
import React99, { memo as memo34, useCallback as useCallback36, useMemo as useMemo42 } from "react";
|
|
16649
|
+
var Stepper = memo34(function Stepper2({
|
|
16372
16650
|
style: style2,
|
|
16373
16651
|
className,
|
|
16374
16652
|
value: valueProp,
|
|
@@ -16385,7 +16663,7 @@ var Stepper = memo33(function Stepper2({
|
|
|
16385
16663
|
const { fieldId: id } = useLabel({
|
|
16386
16664
|
fieldId: props.id
|
|
16387
16665
|
});
|
|
16388
|
-
const value =
|
|
16666
|
+
const value = useMemo42(() => {
|
|
16389
16667
|
return clamp7(valueProp, min, max);
|
|
16390
16668
|
}, [valueProp, min, max]);
|
|
16391
16669
|
const handleValueChange = useCallback36(
|
|
@@ -16395,7 +16673,7 @@ var Stepper = memo33(function Stepper2({
|
|
|
16395
16673
|
},
|
|
16396
16674
|
[onValueChange, min, max]
|
|
16397
16675
|
);
|
|
16398
|
-
return /* @__PURE__ */
|
|
16676
|
+
return /* @__PURE__ */ React99.createElement(
|
|
16399
16677
|
"div",
|
|
16400
16678
|
{
|
|
16401
16679
|
id,
|
|
@@ -16407,7 +16685,7 @@ var Stepper = memo33(function Stepper2({
|
|
|
16407
16685
|
onFocus,
|
|
16408
16686
|
onBlur
|
|
16409
16687
|
},
|
|
16410
|
-
/* @__PURE__ */
|
|
16688
|
+
/* @__PURE__ */ React99.createElement(
|
|
16411
16689
|
Button,
|
|
16412
16690
|
{
|
|
16413
16691
|
icon: "MinusIcon",
|
|
@@ -16415,7 +16693,7 @@ var Stepper = memo33(function Stepper2({
|
|
|
16415
16693
|
onClick: () => handleValueChange(value - step)
|
|
16416
16694
|
}
|
|
16417
16695
|
),
|
|
16418
|
-
/* @__PURE__ */
|
|
16696
|
+
/* @__PURE__ */ React99.createElement(InputField2.Root, { className: "n-flex-1" }, /* @__PURE__ */ React99.createElement(
|
|
16419
16697
|
InputField2.NumberInput,
|
|
16420
16698
|
{
|
|
16421
16699
|
value,
|
|
@@ -16424,7 +16702,7 @@ var Stepper = memo33(function Stepper2({
|
|
|
16424
16702
|
readOnly
|
|
16425
16703
|
}
|
|
16426
16704
|
)),
|
|
16427
|
-
/* @__PURE__ */
|
|
16705
|
+
/* @__PURE__ */ React99.createElement(
|
|
16428
16706
|
Button,
|
|
16429
16707
|
{
|
|
16430
16708
|
icon: "PlusIcon",
|
|
@@ -16437,7 +16715,7 @@ var Stepper = memo33(function Stepper2({
|
|
|
16437
16715
|
|
|
16438
16716
|
// src/components/Switch.tsx
|
|
16439
16717
|
import { Switch as SwitchPrimitive } from "radix-ui";
|
|
16440
|
-
import * as
|
|
16718
|
+
import * as React100 from "react";
|
|
16441
16719
|
var Switch = function Switch2({
|
|
16442
16720
|
id,
|
|
16443
16721
|
value,
|
|
@@ -16449,7 +16727,7 @@ var Switch = function Switch2({
|
|
|
16449
16727
|
style: style2,
|
|
16450
16728
|
className
|
|
16451
16729
|
}) {
|
|
16452
|
-
return /* @__PURE__ */
|
|
16730
|
+
return /* @__PURE__ */ React100.createElement(
|
|
16453
16731
|
SwitchPrimitive.Root,
|
|
16454
16732
|
{
|
|
16455
16733
|
id,
|
|
@@ -16468,12 +16746,12 @@ var Switch = function Switch2({
|
|
|
16468
16746
|
onFocus,
|
|
16469
16747
|
onBlur
|
|
16470
16748
|
},
|
|
16471
|
-
/* @__PURE__ */
|
|
16749
|
+
/* @__PURE__ */ React100.createElement(SwitchPrimitive.Thumb, { className: "n-block n-w-[15px] n-h-[15px] n-bg-background n-rounded-full n-transition-transform n-translate-x-[2px] data-[state=checked]:n-translate-x-[15px]" })
|
|
16472
16750
|
);
|
|
16473
16751
|
};
|
|
16474
16752
|
|
|
16475
16753
|
// src/components/Tabs.tsx
|
|
16476
|
-
import * as
|
|
16754
|
+
import * as React101 from "react";
|
|
16477
16755
|
function Tabs({
|
|
16478
16756
|
value,
|
|
16479
16757
|
onValueChange,
|
|
@@ -16488,7 +16766,7 @@ function Tabs({
|
|
|
16488
16766
|
value,
|
|
16489
16767
|
onChange: onValueChange
|
|
16490
16768
|
});
|
|
16491
|
-
return /* @__PURE__ */
|
|
16769
|
+
return /* @__PURE__ */ React101.createElement("div", { ...props, className: cx("n-flex n-flex-col", props.className) }, /* @__PURE__ */ React101.createElement("div", { className: "n-flex n-flex-row n-px-3" }, /* @__PURE__ */ React101.createElement(
|
|
16492
16770
|
SegmentedControl,
|
|
16493
16771
|
{
|
|
16494
16772
|
className: "n-flex-1",
|
|
@@ -16497,19 +16775,19 @@ function Tabs({
|
|
|
16497
16775
|
variant,
|
|
16498
16776
|
items: selectableItems
|
|
16499
16777
|
}
|
|
16500
|
-
)), /* @__PURE__ */
|
|
16778
|
+
)), /* @__PURE__ */ React101.createElement(Divider, null), renderContent({ value: activeTab }));
|
|
16501
16779
|
}
|
|
16502
16780
|
|
|
16503
16781
|
// src/components/UserPointer.tsx
|
|
16504
|
-
import
|
|
16505
|
-
var UserPointerContainer =
|
|
16782
|
+
import React102, { memo as memo35, useMemo as useMemo43 } from "react";
|
|
16783
|
+
var UserPointerContainer = memo35(function UserPointerContainer2({
|
|
16506
16784
|
point,
|
|
16507
16785
|
visible,
|
|
16508
16786
|
children,
|
|
16509
16787
|
className,
|
|
16510
16788
|
style: style2
|
|
16511
16789
|
}) {
|
|
16512
|
-
return /* @__PURE__ */
|
|
16790
|
+
return /* @__PURE__ */ React102.createElement(
|
|
16513
16791
|
"div",
|
|
16514
16792
|
{
|
|
16515
16793
|
style: {
|
|
@@ -16526,17 +16804,23 @@ var UserPointerContainer = memo34(function UserPointerContainer2({
|
|
|
16526
16804
|
children
|
|
16527
16805
|
);
|
|
16528
16806
|
});
|
|
16529
|
-
var UserNameTag =
|
|
16807
|
+
var UserNameTag = memo35(function UserNameTag2({
|
|
16530
16808
|
backgroundColor,
|
|
16531
16809
|
className,
|
|
16532
16810
|
style: style2,
|
|
16533
|
-
children
|
|
16811
|
+
children,
|
|
16812
|
+
variant = "rounded",
|
|
16813
|
+
size = "medium",
|
|
16814
|
+
bordered = true
|
|
16534
16815
|
}) {
|
|
16535
|
-
return /* @__PURE__ */
|
|
16816
|
+
return /* @__PURE__ */ React102.createElement(
|
|
16536
16817
|
"span",
|
|
16537
16818
|
{
|
|
16538
16819
|
className: cx(
|
|
16539
|
-
"n-relative n-inline-block n-
|
|
16820
|
+
"n-relative n-inline-block n-text-xs n-font-medium n-leading-none n-text-white n-shadow-sm",
|
|
16821
|
+
bordered && "n-border n-border-background",
|
|
16822
|
+
size === "small" ? "n-p-1" : "n-px-2 n-py-1.5",
|
|
16823
|
+
variant === "rounded" ? "n-rounded-full" : "n-rounded-none",
|
|
16540
16824
|
className
|
|
16541
16825
|
),
|
|
16542
16826
|
style: {
|
|
@@ -16548,14 +16832,14 @@ var UserNameTag = memo34(function UserNameTag2({
|
|
|
16548
16832
|
children
|
|
16549
16833
|
);
|
|
16550
16834
|
});
|
|
16551
|
-
var UserPointerIcon =
|
|
16835
|
+
var UserPointerIcon = memo35(function PointerIcon({
|
|
16552
16836
|
size,
|
|
16553
16837
|
color = "black",
|
|
16554
16838
|
className,
|
|
16555
16839
|
style: style2
|
|
16556
16840
|
}) {
|
|
16557
16841
|
const points = "0,5 10,0 10,10";
|
|
16558
|
-
return /* @__PURE__ */
|
|
16842
|
+
return /* @__PURE__ */ React102.createElement(
|
|
16559
16843
|
"svg",
|
|
16560
16844
|
{
|
|
16561
16845
|
width: size,
|
|
@@ -16570,7 +16854,7 @@ var UserPointerIcon = memo34(function PointerIcon({
|
|
|
16570
16854
|
...style2
|
|
16571
16855
|
}
|
|
16572
16856
|
},
|
|
16573
|
-
/* @__PURE__ */
|
|
16857
|
+
/* @__PURE__ */ React102.createElement(
|
|
16574
16858
|
"polygon",
|
|
16575
16859
|
{
|
|
16576
16860
|
points,
|
|
@@ -16583,31 +16867,35 @@ var UserPointerIcon = memo34(function PointerIcon({
|
|
|
16583
16867
|
});
|
|
16584
16868
|
var POINTER_SIZE = 12;
|
|
16585
16869
|
var POINTER_OVERLAP = 6;
|
|
16586
|
-
var UserPointer =
|
|
16870
|
+
var UserPointer = memo35(function UserPointer2({
|
|
16587
16871
|
userId,
|
|
16588
16872
|
name,
|
|
16589
16873
|
visible = true,
|
|
16590
16874
|
point,
|
|
16591
16875
|
backgroundColor,
|
|
16592
16876
|
style: style2,
|
|
16593
|
-
className
|
|
16877
|
+
className,
|
|
16878
|
+
showPointerIcon = true,
|
|
16879
|
+
labelVariant = "rounded",
|
|
16880
|
+
labelSize = "medium",
|
|
16881
|
+
bordered = true
|
|
16594
16882
|
}) {
|
|
16595
|
-
const userBackgroundColor =
|
|
16883
|
+
const userBackgroundColor = useMemo43(
|
|
16596
16884
|
() => backgroundColor ?? colorFromString(userId ?? name ?? ""),
|
|
16597
16885
|
[backgroundColor, userId, name]
|
|
16598
16886
|
);
|
|
16599
|
-
const pointerOverlapStyle =
|
|
16887
|
+
const pointerOverlapStyle = useMemo43(
|
|
16600
16888
|
() => ({
|
|
16601
16889
|
marginRight: `-${POINTER_OVERLAP}px`,
|
|
16602
16890
|
marginBottom: `-${POINTER_OVERLAP}px`
|
|
16603
16891
|
}),
|
|
16604
16892
|
[]
|
|
16605
16893
|
);
|
|
16606
|
-
const nameTagOverlapStyle =
|
|
16894
|
+
const nameTagOverlapStyle = useMemo43(
|
|
16607
16895
|
() => ({ marginLeft: `${POINTER_SIZE - POINTER_OVERLAP + 1}px` }),
|
|
16608
16896
|
[]
|
|
16609
16897
|
);
|
|
16610
|
-
return /* @__PURE__ */
|
|
16898
|
+
return /* @__PURE__ */ React102.createElement(
|
|
16611
16899
|
UserPointerContainer,
|
|
16612
16900
|
{
|
|
16613
16901
|
point,
|
|
@@ -16615,18 +16903,21 @@ var UserPointer = memo34(function UserPointer2({
|
|
|
16615
16903
|
className,
|
|
16616
16904
|
style: style2
|
|
16617
16905
|
},
|
|
16618
|
-
name && /* @__PURE__ */
|
|
16906
|
+
name && /* @__PURE__ */ React102.createElement("div", { className: "n-relative" }, showPointerIcon && /* @__PURE__ */ React102.createElement(
|
|
16619
16907
|
UserPointerIcon,
|
|
16620
16908
|
{
|
|
16621
16909
|
size: POINTER_SIZE,
|
|
16622
16910
|
color: userBackgroundColor,
|
|
16623
16911
|
style: pointerOverlapStyle
|
|
16624
16912
|
}
|
|
16625
|
-
), /* @__PURE__ */
|
|
16913
|
+
), /* @__PURE__ */ React102.createElement(
|
|
16626
16914
|
UserNameTag,
|
|
16627
16915
|
{
|
|
16628
16916
|
backgroundColor: userBackgroundColor,
|
|
16629
|
-
style: nameTagOverlapStyle
|
|
16917
|
+
style: showPointerIcon ? nameTagOverlapStyle : void 0,
|
|
16918
|
+
variant: labelVariant,
|
|
16919
|
+
size: labelSize,
|
|
16920
|
+
bordered
|
|
16630
16921
|
},
|
|
16631
16922
|
name
|
|
16632
16923
|
))
|
|
@@ -16635,10 +16926,16 @@ var UserPointer = memo34(function UserPointer2({
|
|
|
16635
16926
|
|
|
16636
16927
|
// src/components/workspace/WorkspaceLayout.tsx
|
|
16637
16928
|
import { useKeyboardShortcuts as useKeyboardShortcuts4 } from "@noya-app/noya-keymap";
|
|
16638
|
-
import
|
|
16929
|
+
import React108, {
|
|
16930
|
+
memo as memo37,
|
|
16931
|
+
useCallback as useCallback38,
|
|
16932
|
+
useImperativeHandle as useImperativeHandle9,
|
|
16933
|
+
useMemo as useMemo47,
|
|
16934
|
+
useRef as useRef30
|
|
16935
|
+
} from "react";
|
|
16639
16936
|
|
|
16640
16937
|
// src/components/workspace/DrawerWorkspaceLayout.tsx
|
|
16641
|
-
import
|
|
16938
|
+
import React106, { useMemo as useMemo45, useRef as useRef28, useState as useState34 } from "react";
|
|
16642
16939
|
|
|
16643
16940
|
// src/components/workspace/constants.ts
|
|
16644
16941
|
var EDITOR_PANEL_GROUP_ID = "editor-panel-group";
|
|
@@ -16647,20 +16944,20 @@ var RIGHT_SIDEBAR_ID = "editor-3-right-sidebar";
|
|
|
16647
16944
|
var CONTENT_AREA_ID = "editor-2-content-area";
|
|
16648
16945
|
|
|
16649
16946
|
// src/components/workspace/VerticalTabMenu.tsx
|
|
16650
|
-
import
|
|
16947
|
+
import React105, { useMemo as useMemo44 } from "react";
|
|
16651
16948
|
|
|
16652
16949
|
// src/components/Toolbar.tsx
|
|
16653
16950
|
import { useKeyboardShortcuts as useKeyboardShortcuts3 } from "@noya-app/noya-keymap";
|
|
16654
|
-
import
|
|
16951
|
+
import React104, {
|
|
16655
16952
|
createContext as createContext15,
|
|
16656
16953
|
useContext as useContext16
|
|
16657
16954
|
} from "react";
|
|
16658
16955
|
|
|
16659
16956
|
// src/components/ToolbarDrawer.tsx
|
|
16660
|
-
import
|
|
16661
|
-
var ToolbarDrawer =
|
|
16662
|
-
|
|
16663
|
-
return /* @__PURE__ */
|
|
16957
|
+
import React103, { forwardRef as forwardRef28, memo as memo36 } from "react";
|
|
16958
|
+
var ToolbarDrawer = memo36(
|
|
16959
|
+
forwardRef28(function ToolbarDrawer2({ children, trigger, sideOffset = 8 }, ref) {
|
|
16960
|
+
return /* @__PURE__ */ React103.createElement("div", { className: "n-relative", ref }, /* @__PURE__ */ React103.createElement(
|
|
16664
16961
|
"div",
|
|
16665
16962
|
{
|
|
16666
16963
|
className: "n-absolute n-bottom-full n-left-1/2 -n-translate-x-1/2 n-rounded-t-lg n-border n-border-toolbar-drawer-border n-border-b-transparent n-bg-toolbar-drawer-background -n-z-10",
|
|
@@ -16681,8 +16978,8 @@ var ToolbarMenuDropdown = memoGeneric(function ToolbarMenuDropdown2({
|
|
|
16681
16978
|
item,
|
|
16682
16979
|
onSelectMenuItem
|
|
16683
16980
|
}) {
|
|
16684
|
-
const [open, setOpen] =
|
|
16685
|
-
return /* @__PURE__ */
|
|
16981
|
+
const [open, setOpen] = React104.useState(false);
|
|
16982
|
+
return /* @__PURE__ */ React104.createElement(
|
|
16686
16983
|
DropdownMenu,
|
|
16687
16984
|
{
|
|
16688
16985
|
open,
|
|
@@ -16694,7 +16991,7 @@ var ToolbarMenuDropdown = memoGeneric(function ToolbarMenuDropdown2({
|
|
|
16694
16991
|
}
|
|
16695
16992
|
}
|
|
16696
16993
|
},
|
|
16697
|
-
/* @__PURE__ */
|
|
16994
|
+
/* @__PURE__ */ React104.createElement(
|
|
16698
16995
|
Button,
|
|
16699
16996
|
{
|
|
16700
16997
|
disabled: item.disabled,
|
|
@@ -16710,7 +17007,7 @@ var ToolbarShortcut = ({
|
|
|
16710
17007
|
shortcut,
|
|
16711
17008
|
label
|
|
16712
17009
|
}) => {
|
|
16713
|
-
return /* @__PURE__ */
|
|
17010
|
+
return /* @__PURE__ */ React104.createElement("div", { className: "n-flex n-items-center" }, label, /* @__PURE__ */ React104.createElement(Spacer.Horizontal, { size: 6 }), /* @__PURE__ */ React104.createElement(KeyboardShortcut, { shortcut }));
|
|
16714
17011
|
};
|
|
16715
17012
|
var ToolbarMenuPopover = memoGeneric(function ToolbarMenuPopover2({
|
|
16716
17013
|
item,
|
|
@@ -16724,8 +17021,8 @@ var ToolbarMenuPopover = memoGeneric(function ToolbarMenuPopover2({
|
|
|
16724
17021
|
content: itemContent,
|
|
16725
17022
|
checked
|
|
16726
17023
|
} = item;
|
|
16727
|
-
const [open, setOpen] =
|
|
16728
|
-
const content = /* @__PURE__ */
|
|
17024
|
+
const [open, setOpen] = React104.useState(false);
|
|
17025
|
+
const content = /* @__PURE__ */ React104.createElement("span", null, /* @__PURE__ */ React104.createElement(
|
|
16729
17026
|
Popover,
|
|
16730
17027
|
{
|
|
16731
17028
|
open,
|
|
@@ -16734,7 +17031,7 @@ var ToolbarMenuPopover = memoGeneric(function ToolbarMenuPopover2({
|
|
|
16734
17031
|
showArrow: false,
|
|
16735
17032
|
sideOffset: SIDE_OFFSET,
|
|
16736
17033
|
portalContainer,
|
|
16737
|
-
trigger: /* @__PURE__ */
|
|
17034
|
+
trigger: /* @__PURE__ */ React104.createElement(
|
|
16738
17035
|
Button,
|
|
16739
17036
|
{
|
|
16740
17037
|
disabled,
|
|
@@ -16747,7 +17044,7 @@ var ToolbarMenuPopover = memoGeneric(function ToolbarMenuPopover2({
|
|
|
16747
17044
|
},
|
|
16748
17045
|
typeof itemContent === "function" ? itemContent({ close: () => setOpen(false) }) : itemContent
|
|
16749
17046
|
));
|
|
16750
|
-
return tooltip && !open ? /* @__PURE__ */
|
|
17047
|
+
return tooltip && !open ? /* @__PURE__ */ React104.createElement(
|
|
16751
17048
|
Tooltip,
|
|
16752
17049
|
{
|
|
16753
17050
|
sideOffset: SIDE_OFFSET,
|
|
@@ -16767,7 +17064,7 @@ var ToolbarMenuButton = memoGeneric(function ToolbarMenuButton2({
|
|
|
16767
17064
|
displayFilter
|
|
16768
17065
|
}) {
|
|
16769
17066
|
const isActive = item.checked || activeValue === item.value;
|
|
16770
|
-
const content = /* @__PURE__ */
|
|
17067
|
+
const content = /* @__PURE__ */ React104.createElement(
|
|
16771
17068
|
Button,
|
|
16772
17069
|
{
|
|
16773
17070
|
as,
|
|
@@ -16784,7 +17081,7 @@ var ToolbarMenuButton = memoGeneric(function ToolbarMenuButton2({
|
|
|
16784
17081
|
displayFilter === "iconOnly" ? void 0 : item.title
|
|
16785
17082
|
);
|
|
16786
17083
|
const tooltip = item.tooltip ?? (displayFilter === "iconOnly" && item.title ? item.title : void 0);
|
|
16787
|
-
return item.drawer && isActive ? /* @__PURE__ */
|
|
17084
|
+
return item.drawer && isActive ? /* @__PURE__ */ React104.createElement(ToolbarDrawer, { trigger: content }, item.drawer) : tooltip ? /* @__PURE__ */ React104.createElement(Tooltip, { sideOffset: SIDE_OFFSET, content: tooltip, side: tooltipSide }, content) : content;
|
|
16788
17085
|
});
|
|
16789
17086
|
var ToolbarMenuItem = memoGeneric(function ToolbarMenuItem2({
|
|
16790
17087
|
item,
|
|
@@ -16800,13 +17097,13 @@ var ToolbarMenuItem = memoGeneric(function ToolbarMenuItem2({
|
|
|
16800
17097
|
const dividerOverflow = dividerOverflowProp ?? contextDividerOverflow ?? 4;
|
|
16801
17098
|
if (item.type === "sectionHeader") return null;
|
|
16802
17099
|
if (item.type === "separator") {
|
|
16803
|
-
return /* @__PURE__ */
|
|
17100
|
+
return /* @__PURE__ */ React104.createElement(DividerVertical, { overflow: dividerOverflow });
|
|
16804
17101
|
}
|
|
16805
17102
|
if (item.type === "popover") {
|
|
16806
|
-
return /* @__PURE__ */
|
|
17103
|
+
return /* @__PURE__ */ React104.createElement(ToolbarMenuPopover, { item, portalContainer });
|
|
16807
17104
|
}
|
|
16808
17105
|
if (isSelectableMenuItem(item)) {
|
|
16809
|
-
return /* @__PURE__ */
|
|
17106
|
+
return /* @__PURE__ */ React104.createElement(
|
|
16810
17107
|
ToolbarMenuButton,
|
|
16811
17108
|
{
|
|
16812
17109
|
item,
|
|
@@ -16818,7 +17115,7 @@ var ToolbarMenuItem = memoGeneric(function ToolbarMenuItem2({
|
|
|
16818
17115
|
}
|
|
16819
17116
|
);
|
|
16820
17117
|
}
|
|
16821
|
-
return /* @__PURE__ */
|
|
17118
|
+
return /* @__PURE__ */ React104.createElement(ToolbarMenuDropdown, { item, onSelectMenuItem });
|
|
16822
17119
|
});
|
|
16823
17120
|
var ToolbarMenu = memoGeneric(function ToolbarMenu2({
|
|
16824
17121
|
items,
|
|
@@ -16830,8 +17127,8 @@ var ToolbarMenu = memoGeneric(function ToolbarMenu2({
|
|
|
16830
17127
|
displayFilter = "iconAndText",
|
|
16831
17128
|
dividerOverflow
|
|
16832
17129
|
}) {
|
|
16833
|
-
return /* @__PURE__ */
|
|
16834
|
-
return /* @__PURE__ */
|
|
17130
|
+
return /* @__PURE__ */ React104.createElement(React104.Fragment, null, items.map((item, i) => {
|
|
17131
|
+
return /* @__PURE__ */ React104.createElement(
|
|
16835
17132
|
ToolbarMenuItem,
|
|
16836
17133
|
{
|
|
16837
17134
|
key: i,
|
|
@@ -16856,21 +17153,21 @@ function Toolbar({
|
|
|
16856
17153
|
shouldBindKeyboardShortcuts = true,
|
|
16857
17154
|
dividerOverflow
|
|
16858
17155
|
}) {
|
|
16859
|
-
const allMenuItems =
|
|
17156
|
+
const allMenuItems = React104.useMemo(
|
|
16860
17157
|
() => [...leftMenuItems, ...rightMenuItems],
|
|
16861
17158
|
[leftMenuItems, rightMenuItems]
|
|
16862
17159
|
);
|
|
16863
17160
|
useKeyboardShortcuts3(
|
|
16864
|
-
|
|
17161
|
+
React104.useMemo(
|
|
16865
17162
|
() => onSelectMenuItem && shouldBindKeyboardShortcuts ? getKeyboardShortcutsForMenuItems(allMenuItems, onSelectMenuItem) : {},
|
|
16866
17163
|
[allMenuItems, onSelectMenuItem, shouldBindKeyboardShortcuts]
|
|
16867
17164
|
)
|
|
16868
17165
|
);
|
|
16869
|
-
return /* @__PURE__ */
|
|
17166
|
+
return /* @__PURE__ */ React104.createElement(
|
|
16870
17167
|
BaseToolbar,
|
|
16871
17168
|
{
|
|
16872
17169
|
logo,
|
|
16873
|
-
left: leftMenuItems.length > 0 && /* @__PURE__ */
|
|
17170
|
+
left: leftMenuItems.length > 0 && /* @__PURE__ */ React104.createElement("div", { className: "n-flex n-gap-2" }, /* @__PURE__ */ React104.createElement(
|
|
16874
17171
|
ToolbarMenu,
|
|
16875
17172
|
{
|
|
16876
17173
|
items: leftMenuItems,
|
|
@@ -16878,7 +17175,7 @@ function Toolbar({
|
|
|
16878
17175
|
dividerOverflow
|
|
16879
17176
|
}
|
|
16880
17177
|
)),
|
|
16881
|
-
right: rightMenuItems.length > 0 && /* @__PURE__ */
|
|
17178
|
+
right: rightMenuItems.length > 0 && /* @__PURE__ */ React104.createElement("div", { className: "n-flex n-gap-2" }, /* @__PURE__ */ React104.createElement(
|
|
16882
17179
|
ToolbarMenu,
|
|
16883
17180
|
{
|
|
16884
17181
|
items: rightMenuItems,
|
|
@@ -16899,19 +17196,19 @@ var VerticalTabMenu = memoGeneric(function VerticalTabMenu2({
|
|
|
16899
17196
|
onChange,
|
|
16900
17197
|
tooltipSide
|
|
16901
17198
|
}) {
|
|
16902
|
-
const style2 =
|
|
17199
|
+
const style2 = useMemo44(() => {
|
|
16903
17200
|
return {
|
|
16904
17201
|
[cssVarNames.colors.inputBackground]: "transparent",
|
|
16905
17202
|
[cssVarNames.colors.buttonBackground]: "transparent"
|
|
16906
17203
|
};
|
|
16907
17204
|
}, []);
|
|
16908
|
-
return /* @__PURE__ */
|
|
17205
|
+
return /* @__PURE__ */ React105.createElement(
|
|
16909
17206
|
"div",
|
|
16910
17207
|
{
|
|
16911
17208
|
className: "n-w-[47px] n-h-full n-bg-sidebar-background n-flex n-flex-col n-items-center n-py-3 n-gap-3",
|
|
16912
17209
|
style: style2
|
|
16913
17210
|
},
|
|
16914
|
-
/* @__PURE__ */
|
|
17211
|
+
/* @__PURE__ */ React105.createElement(
|
|
16915
17212
|
ToolbarMenu,
|
|
16916
17213
|
{
|
|
16917
17214
|
items,
|
|
@@ -16943,7 +17240,7 @@ var DrawerWorkspaceLayout = memoGeneric(function DrawerWorkspaceLayout2({
|
|
|
16943
17240
|
leftSidebarCollapsed: true,
|
|
16944
17241
|
rightSidebarCollapsed: true
|
|
16945
17242
|
});
|
|
16946
|
-
const allTabItems =
|
|
17243
|
+
const allTabItems = useMemo45(
|
|
16947
17244
|
() => [
|
|
16948
17245
|
...leftPanel ? leftTabItems ?? [] : [],
|
|
16949
17246
|
...rightPanel ? rightTabItems ?? [] : []
|
|
@@ -16951,11 +17248,11 @@ var DrawerWorkspaceLayout = memoGeneric(function DrawerWorkspaceLayout2({
|
|
|
16951
17248
|
[leftTabItems, rightTabItems, leftPanel, rightPanel]
|
|
16952
17249
|
);
|
|
16953
17250
|
const hasTabs = allTabItems.length > 0;
|
|
16954
|
-
const leftSelectableTabItems =
|
|
17251
|
+
const leftSelectableTabItems = useMemo45(
|
|
16955
17252
|
() => (leftTabItems ?? []).filter(isSelectableMenuItem),
|
|
16956
17253
|
[leftTabItems]
|
|
16957
17254
|
);
|
|
16958
|
-
const rightSelectableTabItems =
|
|
17255
|
+
const rightSelectableTabItems = useMemo45(
|
|
16959
17256
|
() => (rightTabItems ?? []).filter(isSelectableMenuItem),
|
|
16960
17257
|
[rightTabItems]
|
|
16961
17258
|
);
|
|
@@ -16963,14 +17260,14 @@ var DrawerWorkspaceLayout = memoGeneric(function DrawerWorkspaceLayout2({
|
|
|
16963
17260
|
activeValue: rightTabValue,
|
|
16964
17261
|
isSidebarCollapsed: rightSidebarCollapsed
|
|
16965
17262
|
} : { activeValue: void 0, isSidebarCollapsed: true };
|
|
16966
|
-
return /* @__PURE__ */
|
|
17263
|
+
return /* @__PURE__ */ React106.createElement(
|
|
16967
17264
|
"div",
|
|
16968
17265
|
{
|
|
16969
17266
|
ref: portalContainer,
|
|
16970
17267
|
id: EDITOR_PANEL_GROUP_ID,
|
|
16971
17268
|
className: "n-flex n-flex-1 n-relative focus:n-outline-none"
|
|
16972
17269
|
},
|
|
16973
|
-
hasTabs && /* @__PURE__ */
|
|
17270
|
+
hasTabs && /* @__PURE__ */ React106.createElement(
|
|
16974
17271
|
VerticalTabMenu,
|
|
16975
17272
|
{
|
|
16976
17273
|
tooltipSide: "right",
|
|
@@ -17008,9 +17305,9 @@ var DrawerWorkspaceLayout = memoGeneric(function DrawerWorkspaceLayout2({
|
|
|
17008
17305
|
}
|
|
17009
17306
|
}
|
|
17010
17307
|
),
|
|
17011
|
-
hasTabs && /* @__PURE__ */
|
|
17012
|
-
/* @__PURE__ */
|
|
17013
|
-
leftPanel && /* @__PURE__ */
|
|
17308
|
+
hasTabs && /* @__PURE__ */ React106.createElement(DividerVertical, { className: "n-h-full" }),
|
|
17309
|
+
/* @__PURE__ */ React106.createElement("div", { className: "n-flex-1 n-flex n-relative" }, centerPanel),
|
|
17310
|
+
leftPanel && /* @__PURE__ */ React106.createElement(
|
|
17014
17311
|
Drawer,
|
|
17015
17312
|
{
|
|
17016
17313
|
ref: leftSidebarRef,
|
|
@@ -17036,7 +17333,7 @@ var DrawerWorkspaceLayout = memoGeneric(function DrawerWorkspaceLayout2({
|
|
|
17036
17333
|
},
|
|
17037
17334
|
leftPanel
|
|
17038
17335
|
),
|
|
17039
|
-
rightPanel && /* @__PURE__ */
|
|
17336
|
+
rightPanel && /* @__PURE__ */ React106.createElement(
|
|
17040
17337
|
Drawer,
|
|
17041
17338
|
{
|
|
17042
17339
|
id: RIGHT_SIDEBAR_ID,
|
|
@@ -17067,7 +17364,7 @@ var DrawerWorkspaceLayout = memoGeneric(function DrawerWorkspaceLayout2({
|
|
|
17067
17364
|
});
|
|
17068
17365
|
|
|
17069
17366
|
// src/components/workspace/PanelWorkspaceLayout.tsx
|
|
17070
|
-
import
|
|
17367
|
+
import React107, { useCallback as useCallback37, useMemo as useMemo46, useRef as useRef29 } from "react";
|
|
17071
17368
|
import {
|
|
17072
17369
|
Panel,
|
|
17073
17370
|
PanelGroup,
|
|
@@ -17240,7 +17537,7 @@ var PanelWorkspaceLayout = memoGeneric(function PanelWorkspaceLayout2({
|
|
|
17240
17537
|
const hasLeftPanel = !!leftPanel;
|
|
17241
17538
|
const hasRightPanel = !!rightPanel;
|
|
17242
17539
|
const hasCenterPanel = !!centerPanel;
|
|
17243
|
-
const autoSaveId =
|
|
17540
|
+
const autoSaveId = useMemo46(() => {
|
|
17244
17541
|
return autoSavePrefix ? `${autoSavePrefix}--v2--${EDITOR_PANEL_GROUP_ID}` : Math.random().toString(36).substring(2, 15);
|
|
17245
17542
|
}, [autoSavePrefix]);
|
|
17246
17543
|
const layoutIds = getLayoutIds({
|
|
@@ -17267,7 +17564,7 @@ var PanelWorkspaceLayout = memoGeneric(function PanelWorkspaceLayout2({
|
|
|
17267
17564
|
});
|
|
17268
17565
|
const [data, setData] = usePersistentStateObject(clientStorage, storageKey, {});
|
|
17269
17566
|
const layoutGroup = data?.[propertyKey];
|
|
17270
|
-
const { leftSidebarCollapsed, rightSidebarCollapsed } =
|
|
17567
|
+
const { leftSidebarCollapsed, rightSidebarCollapsed } = useMemo46(() => {
|
|
17271
17568
|
return getLayoutCollapsedState({
|
|
17272
17569
|
layoutGroup,
|
|
17273
17570
|
propertyKey,
|
|
@@ -17325,7 +17622,7 @@ var PanelWorkspaceLayout = memoGeneric(function PanelWorkspaceLayout2({
|
|
|
17325
17622
|
},
|
|
17326
17623
|
[setData, propertyKey]
|
|
17327
17624
|
);
|
|
17328
|
-
return /* @__PURE__ */
|
|
17625
|
+
return /* @__PURE__ */ React107.createElement(
|
|
17329
17626
|
PanelGroup,
|
|
17330
17627
|
{
|
|
17331
17628
|
ref: panelGroupRef,
|
|
@@ -17336,7 +17633,7 @@ var PanelWorkspaceLayout = memoGeneric(function PanelWorkspaceLayout2({
|
|
|
17336
17633
|
autoSaveId,
|
|
17337
17634
|
onLayout: handleLayoutChange
|
|
17338
17635
|
},
|
|
17339
|
-
leftPanel && /* @__PURE__ */
|
|
17636
|
+
leftPanel && /* @__PURE__ */ React107.createElement(React107.Fragment, null, leftSidebarOptions.showTabs && leftTabItems && /* @__PURE__ */ React107.createElement(
|
|
17340
17637
|
VerticalTabMenu,
|
|
17341
17638
|
{
|
|
17342
17639
|
tooltipSide: "right",
|
|
@@ -17345,7 +17642,7 @@ var PanelWorkspaceLayout = memoGeneric(function PanelWorkspaceLayout2({
|
|
|
17345
17642
|
isSidebarCollapsed: leftSidebarCollapsed,
|
|
17346
17643
|
onChange: handleLeftTabChange
|
|
17347
17644
|
}
|
|
17348
|
-
), leftSidebarOptions.showTabs && leftTabItems && !leftSidebarCollapsed && /* @__PURE__ */
|
|
17645
|
+
), leftSidebarOptions.showTabs && leftTabItems && !leftSidebarCollapsed && /* @__PURE__ */ React107.createElement(DividerVertical, { className: "n-h-full" }), /* @__PURE__ */ React107.createElement(
|
|
17349
17646
|
Panel,
|
|
17350
17647
|
{
|
|
17351
17648
|
id: LEFT_SIDEBAR_ID,
|
|
@@ -17358,8 +17655,8 @@ var PanelWorkspaceLayout = memoGeneric(function PanelWorkspaceLayout2({
|
|
|
17358
17655
|
collapsible: true
|
|
17359
17656
|
},
|
|
17360
17657
|
leftSidebarCollapsed ? null : leftPanel
|
|
17361
|
-
), /* @__PURE__ */
|
|
17362
|
-
/* @__PURE__ */
|
|
17658
|
+
), /* @__PURE__ */ React107.createElement(PanelResizeHandle, { className: "n-cursor-col-resize n-w-px n-h-full n-bg-divider" })),
|
|
17659
|
+
/* @__PURE__ */ React107.createElement(
|
|
17363
17660
|
Panel,
|
|
17364
17661
|
{
|
|
17365
17662
|
id: CONTENT_AREA_ID,
|
|
@@ -17370,7 +17667,7 @@ var PanelWorkspaceLayout = memoGeneric(function PanelWorkspaceLayout2({
|
|
|
17370
17667
|
},
|
|
17371
17668
|
centerPanel
|
|
17372
17669
|
),
|
|
17373
|
-
rightPanel && /* @__PURE__ */
|
|
17670
|
+
rightPanel && /* @__PURE__ */ React107.createElement(React107.Fragment, null, /* @__PURE__ */ React107.createElement(PanelResizeHandle, { className: "n-cursor-col-resize n-w-px n-h-full n-bg-divider" }), /* @__PURE__ */ React107.createElement(
|
|
17374
17671
|
Panel,
|
|
17375
17672
|
{
|
|
17376
17673
|
id: RIGHT_SIDEBAR_ID,
|
|
@@ -17383,7 +17680,7 @@ var PanelWorkspaceLayout = memoGeneric(function PanelWorkspaceLayout2({
|
|
|
17383
17680
|
collapsible: true
|
|
17384
17681
|
},
|
|
17385
17682
|
rightSidebarCollapsed ? null : rightPanel
|
|
17386
|
-
), rightSidebarOptions.showTabs && rightTabItems && !rightSidebarCollapsed && /* @__PURE__ */
|
|
17683
|
+
), rightSidebarOptions.showTabs && rightTabItems && !rightSidebarCollapsed && /* @__PURE__ */ React107.createElement(DividerVertical, { className: "n-h-full" }), rightSidebarOptions.showTabs && rightTabItems && /* @__PURE__ */ React107.createElement(
|
|
17387
17684
|
VerticalTabMenu,
|
|
17388
17685
|
{
|
|
17389
17686
|
tooltipSide: "left",
|
|
@@ -17397,13 +17694,21 @@ var PanelWorkspaceLayout = memoGeneric(function PanelWorkspaceLayout2({
|
|
|
17397
17694
|
});
|
|
17398
17695
|
|
|
17399
17696
|
// src/components/workspace/renderPanelChildren.tsx
|
|
17400
|
-
function renderPanelChildren(fn,
|
|
17697
|
+
function renderPanelChildren(fn, props) {
|
|
17401
17698
|
if (typeof fn === "function") {
|
|
17402
|
-
return fn(
|
|
17699
|
+
return fn(props);
|
|
17403
17700
|
}
|
|
17404
17701
|
return fn;
|
|
17405
17702
|
}
|
|
17406
17703
|
|
|
17704
|
+
// src/components/workspace/WorkspaceSideContext.tsx
|
|
17705
|
+
import { createContext as createContext16, useContext as useContext17 } from "react";
|
|
17706
|
+
var WorkspaceSideContext = createContext16({});
|
|
17707
|
+
var WorkspaceSideProvider = WorkspaceSideContext.Provider;
|
|
17708
|
+
function useWorkspaceSide() {
|
|
17709
|
+
return useContext17(WorkspaceSideContext);
|
|
17710
|
+
}
|
|
17711
|
+
|
|
17407
17712
|
// src/components/workspace/WorkspaceLayout.tsx
|
|
17408
17713
|
var defaultLeftTabItems = [
|
|
17409
17714
|
{
|
|
@@ -17463,7 +17768,7 @@ var WorkspaceLayout = forwardRefGeneric(function WorkspaceLayout2({
|
|
|
17463
17768
|
} = {},
|
|
17464
17769
|
theme
|
|
17465
17770
|
}, forwardedRef) {
|
|
17466
|
-
const containerRef =
|
|
17771
|
+
const containerRef = React108.useRef(null);
|
|
17467
17772
|
const containerSize = useSize(containerRef);
|
|
17468
17773
|
const windowSize = useWindowSize();
|
|
17469
17774
|
const parentSize = detectSize === "window" ? windowSize : containerSize && containerSize.width > 0 ? containerSize : windowSize;
|
|
@@ -17563,24 +17868,57 @@ var WorkspaceLayout = forwardRefGeneric(function WorkspaceLayout2({
|
|
|
17563
17868
|
}
|
|
17564
17869
|
});
|
|
17565
17870
|
const centerPanelPercentage = 100 - (left ? leftSidebarPercentage : 0) - (right ? rightSidebarPercentage : 0);
|
|
17566
|
-
const
|
|
17871
|
+
const isDrawerActive = sideType === "drawer" || sideType === "auto" && parentSize.width <= sideTypeBreakpoint;
|
|
17872
|
+
const closeLeftSidebar = useCallback38(() => {
|
|
17873
|
+
if (isDrawerActive) {
|
|
17874
|
+
leftSidebarRef.current?.collapse();
|
|
17875
|
+
}
|
|
17876
|
+
}, [isDrawerActive]);
|
|
17877
|
+
const closeRightSidebar = useCallback38(() => {
|
|
17878
|
+
if (isDrawerActive) {
|
|
17879
|
+
rightSidebarRef.current?.collapse();
|
|
17880
|
+
}
|
|
17881
|
+
}, [isDrawerActive]);
|
|
17882
|
+
const leftChildrenProps = useMemo47(() => {
|
|
17883
|
+
return {
|
|
17884
|
+
activeTabValue: leftTabValue,
|
|
17885
|
+
closeSidebar: closeLeftSidebar
|
|
17886
|
+
};
|
|
17887
|
+
}, [leftTabValue, closeLeftSidebar]);
|
|
17888
|
+
const rightChildrenProps = useMemo47(() => {
|
|
17889
|
+
return {
|
|
17890
|
+
activeTabValue: rightTabValue,
|
|
17891
|
+
closeSidebar: closeRightSidebar
|
|
17892
|
+
};
|
|
17893
|
+
}, [rightTabValue, closeRightSidebar]);
|
|
17894
|
+
const leftSidebarProviderValue = useMemo47(() => {
|
|
17895
|
+
return {
|
|
17896
|
+
closeSidebar: closeLeftSidebar
|
|
17897
|
+
};
|
|
17898
|
+
}, [closeLeftSidebar]);
|
|
17899
|
+
const rightSidebarProviderValue = useMemo47(() => {
|
|
17900
|
+
return {
|
|
17901
|
+
closeSidebar: closeRightSidebar
|
|
17902
|
+
};
|
|
17903
|
+
}, [closeRightSidebar]);
|
|
17904
|
+
const leftPanel = left && leftVisible !== false ? /* @__PURE__ */ React108.createElement(
|
|
17567
17905
|
PanelInner,
|
|
17568
17906
|
{
|
|
17569
17907
|
style: leftStyle,
|
|
17570
17908
|
className: cx("n-bg-sidebar-background n-flex-col", leftClassName)
|
|
17571
17909
|
},
|
|
17572
|
-
leftTabValue ? renderPanelChildren(left,
|
|
17910
|
+
/* @__PURE__ */ React108.createElement(WorkspaceSideProvider, { value: leftSidebarProviderValue }, leftTabValue ? renderPanelChildren(left, leftChildrenProps) : null)
|
|
17573
17911
|
) : null;
|
|
17574
|
-
const rightPanel = right && rightVisible !== false ? /* @__PURE__ */
|
|
17912
|
+
const rightPanel = right && rightVisible !== false ? /* @__PURE__ */ React108.createElement(
|
|
17575
17913
|
PanelInner,
|
|
17576
17914
|
{
|
|
17577
17915
|
style: rightStyle,
|
|
17578
17916
|
className: cx("n-bg-sidebar-background n-flex-col", rightClassName)
|
|
17579
17917
|
},
|
|
17580
|
-
rightTabValue ? renderPanelChildren(right,
|
|
17918
|
+
/* @__PURE__ */ React108.createElement(WorkspaceSideProvider, { value: rightSidebarProviderValue }, rightTabValue ? renderPanelChildren(right, rightChildrenProps) : null)
|
|
17581
17919
|
) : null;
|
|
17582
|
-
const centerPanel = /* @__PURE__ */
|
|
17583
|
-
const leftSidebarOptions =
|
|
17920
|
+
const centerPanel = /* @__PURE__ */ React108.createElement(PanelInner, { className: "n-bg-canvas-background" }, children);
|
|
17921
|
+
const leftSidebarOptions = useMemo47(
|
|
17584
17922
|
() => ({
|
|
17585
17923
|
minSize: leftSidebarMinPercentage,
|
|
17586
17924
|
maxSize: leftSidebarMaxPercentage,
|
|
@@ -17598,7 +17936,7 @@ var WorkspaceLayout = forwardRefGeneric(function WorkspaceLayout2({
|
|
|
17598
17936
|
leftShowTabs
|
|
17599
17937
|
]
|
|
17600
17938
|
);
|
|
17601
|
-
const rightSidebarOptions =
|
|
17939
|
+
const rightSidebarOptions = useMemo47(
|
|
17602
17940
|
() => ({
|
|
17603
17941
|
minSize: rightSidebarMinPercentage,
|
|
17604
17942
|
maxSize: rightSidebarMaxPercentage,
|
|
@@ -17618,17 +17956,20 @@ var WorkspaceLayout = forwardRefGeneric(function WorkspaceLayout2({
|
|
|
17618
17956
|
);
|
|
17619
17957
|
const LayoutComponent = sideType === "panel" ? PanelWorkspaceLayout : sideType === "drawer" ? DrawerWorkspaceLayout : parentSize.width > sideTypeBreakpoint ? PanelWorkspaceLayout : DrawerWorkspaceLayout;
|
|
17620
17958
|
const readyToRender = detectSize === "window" || containerSize && containerSize.width > 0;
|
|
17621
|
-
return /* @__PURE__ */
|
|
17959
|
+
return /* @__PURE__ */ React108.createElement(
|
|
17622
17960
|
"div",
|
|
17623
17961
|
{
|
|
17624
17962
|
ref: containerRef,
|
|
17625
17963
|
id,
|
|
17626
|
-
className: cx(
|
|
17964
|
+
className: cx(
|
|
17965
|
+
"n-flex n-flex-col n-bg-canvas-background n-relative",
|
|
17966
|
+
className
|
|
17967
|
+
),
|
|
17627
17968
|
style: style2,
|
|
17628
17969
|
"data-theme": theme
|
|
17629
17970
|
},
|
|
17630
17971
|
toolbar,
|
|
17631
|
-
/* @__PURE__ */
|
|
17972
|
+
/* @__PURE__ */ React108.createElement("div", { className: "n-flex n-flex-row n-flex-1 n-relative" }, readyToRender && /* @__PURE__ */ React108.createElement(
|
|
17632
17973
|
LayoutComponent,
|
|
17633
17974
|
{
|
|
17634
17975
|
leftPanel,
|
|
@@ -17650,12 +17991,12 @@ var WorkspaceLayout = forwardRefGeneric(function WorkspaceLayout2({
|
|
|
17650
17991
|
))
|
|
17651
17992
|
);
|
|
17652
17993
|
});
|
|
17653
|
-
var PanelInner =
|
|
17994
|
+
var PanelInner = memo37(function PanelInner2({
|
|
17654
17995
|
children,
|
|
17655
17996
|
style: style2,
|
|
17656
17997
|
className
|
|
17657
17998
|
}) {
|
|
17658
|
-
return /* @__PURE__ */
|
|
17999
|
+
return /* @__PURE__ */ React108.createElement(
|
|
17659
18000
|
"div",
|
|
17660
18001
|
{
|
|
17661
18002
|
style: style2,
|
|
@@ -17670,22 +18011,22 @@ function getFirstTabValue(items, defaultValue2) {
|
|
|
17670
18011
|
}
|
|
17671
18012
|
|
|
17672
18013
|
// src/contexts/ImageDataContext.tsx
|
|
17673
|
-
import * as
|
|
17674
|
-
var ImageDataContext =
|
|
18014
|
+
import * as React109 from "react";
|
|
18015
|
+
var ImageDataContext = React109.createContext(
|
|
17675
18016
|
void 0
|
|
17676
18017
|
);
|
|
17677
|
-
var ImageDataProvider =
|
|
18018
|
+
var ImageDataProvider = React109.memo(function ImageDataProvider2({
|
|
17678
18019
|
children,
|
|
17679
18020
|
getImageData
|
|
17680
18021
|
}) {
|
|
17681
|
-
const contextValue =
|
|
18022
|
+
const contextValue = React109.useMemo(
|
|
17682
18023
|
() => ({ getImageData: getImageData ?? (() => void 0) }),
|
|
17683
18024
|
[getImageData]
|
|
17684
18025
|
);
|
|
17685
|
-
return /* @__PURE__ */
|
|
18026
|
+
return /* @__PURE__ */ React109.createElement(ImageDataContext.Provider, { value: contextValue }, children);
|
|
17686
18027
|
});
|
|
17687
18028
|
function useImageData(ref) {
|
|
17688
|
-
const value =
|
|
18029
|
+
const value = React109.useContext(ImageDataContext);
|
|
17689
18030
|
if (!value) {
|
|
17690
18031
|
throw new Error("Missing ImageDataProvider");
|
|
17691
18032
|
}
|
|
@@ -17734,6 +18075,9 @@ function useTheme() {
|
|
|
17734
18075
|
return theme;
|
|
17735
18076
|
}
|
|
17736
18077
|
|
|
18078
|
+
// src/theme/proseTheme.ts
|
|
18079
|
+
var proseTheme = "n-prose n-prose-sm n-max-w-none [[data-theme='dark']_&]:n-prose-invert prose-a:n-text-blue-600";
|
|
18080
|
+
|
|
17737
18081
|
// src/utils/createSectionedMenu.ts
|
|
17738
18082
|
function withSeparators(elements2, separator2) {
|
|
17739
18083
|
const result = [];
|
|
@@ -17836,11 +18180,11 @@ var SUPPORTED_CANVAS_UPLOAD_TYPES = [
|
|
|
17836
18180
|
|
|
17837
18181
|
// src/components/DimensionInput.tsx
|
|
17838
18182
|
import { round as round2 } from "@noya-app/noya-utils";
|
|
17839
|
-
import * as
|
|
18183
|
+
import * as React110 from "react";
|
|
17840
18184
|
function getNewValue(value, mode, delta) {
|
|
17841
18185
|
return delta === void 0 ? value : mode === "replace" ? delta : value + delta;
|
|
17842
18186
|
}
|
|
17843
|
-
var DimensionInput =
|
|
18187
|
+
var DimensionInput = React110.memo(function DimensionInput2({
|
|
17844
18188
|
id,
|
|
17845
18189
|
value,
|
|
17846
18190
|
onSetValue,
|
|
@@ -17850,15 +18194,15 @@ var DimensionInput = React107.memo(function DimensionInput2({
|
|
|
17850
18194
|
disabled,
|
|
17851
18195
|
trigger = "submit"
|
|
17852
18196
|
}) {
|
|
17853
|
-
const handleNudgeValue =
|
|
18197
|
+
const handleNudgeValue = React110.useCallback(
|
|
17854
18198
|
(value2) => onSetValue(value2, "adjust"),
|
|
17855
18199
|
[onSetValue]
|
|
17856
18200
|
);
|
|
17857
|
-
const handleSetValue =
|
|
18201
|
+
const handleSetValue = React110.useCallback(
|
|
17858
18202
|
(value2) => onSetValue(value2, "replace"),
|
|
17859
18203
|
[onSetValue]
|
|
17860
18204
|
);
|
|
17861
|
-
return /* @__PURE__ */
|
|
18205
|
+
return /* @__PURE__ */ React110.createElement(LabeledField, { label, labelType: "inset" }, /* @__PURE__ */ React110.createElement(InputField2.Root, { id, width: size }, /* @__PURE__ */ React110.createElement(
|
|
17862
18206
|
InputField2.NumberInput,
|
|
17863
18207
|
{
|
|
17864
18208
|
value: value === void 0 ? value : round2(value, 2),
|
|
@@ -17885,11 +18229,11 @@ __export(InspectorPrimitives_exports, {
|
|
|
17885
18229
|
Title: () => Title,
|
|
17886
18230
|
VerticalSeparator: () => VerticalSeparator
|
|
17887
18231
|
});
|
|
17888
|
-
import
|
|
17889
|
-
forwardRef as
|
|
17890
|
-
memo as
|
|
18232
|
+
import React111, {
|
|
18233
|
+
forwardRef as forwardRef29,
|
|
18234
|
+
memo as memo40
|
|
17891
18235
|
} from "react";
|
|
17892
|
-
var Section2 =
|
|
18236
|
+
var Section2 = forwardRef29(({ className, ...props }, ref) => /* @__PURE__ */ React111.createElement(
|
|
17893
18237
|
"div",
|
|
17894
18238
|
{
|
|
17895
18239
|
ref,
|
|
@@ -17897,8 +18241,8 @@ var Section2 = forwardRef28(({ className, ...props }, ref) => /* @__PURE__ */ Re
|
|
|
17897
18241
|
...props
|
|
17898
18242
|
}
|
|
17899
18243
|
));
|
|
17900
|
-
var SectionHeader2 =
|
|
17901
|
-
var Title =
|
|
18244
|
+
var SectionHeader2 = forwardRef29(({ className, ...props }, ref) => /* @__PURE__ */ React111.createElement("div", { ref, className: cx(`n-flex n-items-center`, className), ...props }));
|
|
18245
|
+
var Title = forwardRef29(({ className, $textStyle, ...props }, ref) => /* @__PURE__ */ React111.createElement(
|
|
17902
18246
|
"div",
|
|
17903
18247
|
{
|
|
17904
18248
|
ref,
|
|
@@ -17909,7 +18253,7 @@ var Title = forwardRef28(({ className, $textStyle, ...props }, ref) => /* @__PUR
|
|
|
17909
18253
|
...props
|
|
17910
18254
|
}
|
|
17911
18255
|
));
|
|
17912
|
-
var Row =
|
|
18256
|
+
var Row = forwardRef29(({ className, ...props }, ref) => /* @__PURE__ */ React111.createElement(
|
|
17913
18257
|
"div",
|
|
17914
18258
|
{
|
|
17915
18259
|
ref,
|
|
@@ -17917,7 +18261,7 @@ var Row = forwardRef28(({ className, ...props }, ref) => /* @__PURE__ */ React10
|
|
|
17917
18261
|
...props
|
|
17918
18262
|
}
|
|
17919
18263
|
));
|
|
17920
|
-
var Column =
|
|
18264
|
+
var Column = forwardRef29(({ className, ...props }, ref) => /* @__PURE__ */ React111.createElement(
|
|
17921
18265
|
"div",
|
|
17922
18266
|
{
|
|
17923
18267
|
ref,
|
|
@@ -17925,7 +18269,7 @@ var Column = forwardRef28(({ className, ...props }, ref) => /* @__PURE__ */ Reac
|
|
|
17925
18269
|
...props
|
|
17926
18270
|
}
|
|
17927
18271
|
));
|
|
17928
|
-
var Checkbox3 =
|
|
18272
|
+
var Checkbox3 = forwardRef29(({ className, ...props }, ref) => /* @__PURE__ */ React111.createElement(
|
|
17929
18273
|
"input",
|
|
17930
18274
|
{
|
|
17931
18275
|
ref,
|
|
@@ -17934,7 +18278,7 @@ var Checkbox3 = forwardRef28(({ className, ...props }, ref) => /* @__PURE__ */ R
|
|
|
17934
18278
|
...props
|
|
17935
18279
|
}
|
|
17936
18280
|
));
|
|
17937
|
-
var Text3 =
|
|
18281
|
+
var Text3 = forwardRef29(({ className, ...props }, ref) => /* @__PURE__ */ React111.createElement(
|
|
17938
18282
|
"span",
|
|
17939
18283
|
{
|
|
17940
18284
|
ref,
|
|
@@ -17942,14 +18286,14 @@ var Text3 = forwardRef28(({ className, ...props }, ref) => /* @__PURE__ */ React
|
|
|
17942
18286
|
...props
|
|
17943
18287
|
}
|
|
17944
18288
|
));
|
|
17945
|
-
var VerticalSeparator = () => /* @__PURE__ */
|
|
17946
|
-
var HorizontalSeparator = () => /* @__PURE__ */
|
|
17947
|
-
var RowLabel =
|
|
18289
|
+
var VerticalSeparator = () => /* @__PURE__ */ React111.createElement(Spacer.Vertical, { size: "inspector-v-separator" });
|
|
18290
|
+
var HorizontalSeparator = () => /* @__PURE__ */ React111.createElement(Spacer.Horizontal, { size: "inspector-h-separator" });
|
|
18291
|
+
var RowLabel = forwardRef29(function RowLabel2({
|
|
17948
18292
|
className,
|
|
17949
18293
|
$textStyle,
|
|
17950
18294
|
...props
|
|
17951
18295
|
}, ref) {
|
|
17952
|
-
return /* @__PURE__ */
|
|
18296
|
+
return /* @__PURE__ */ React111.createElement(
|
|
17953
18297
|
"label",
|
|
17954
18298
|
{
|
|
17955
18299
|
ref,
|
|
@@ -17961,7 +18305,7 @@ var RowLabel = forwardRef28(function RowLabel2({
|
|
|
17961
18305
|
}
|
|
17962
18306
|
);
|
|
17963
18307
|
});
|
|
17964
|
-
var LabeledRow =
|
|
18308
|
+
var LabeledRow = memo40(function LabeledRow2({
|
|
17965
18309
|
id,
|
|
17966
18310
|
children,
|
|
17967
18311
|
label,
|
|
@@ -17969,7 +18313,7 @@ var LabeledRow = memo39(function LabeledRow2({
|
|
|
17969
18313
|
right,
|
|
17970
18314
|
className
|
|
17971
18315
|
}) {
|
|
17972
|
-
return /* @__PURE__ */
|
|
18316
|
+
return /* @__PURE__ */ React111.createElement(Row, { id, className }, /* @__PURE__ */ React111.createElement(Column, null, /* @__PURE__ */ React111.createElement(RowLabel, { $textStyle: labelTextStyle }, label, right && /* @__PURE__ */ React111.createElement(Spacer.Horizontal, null), right), /* @__PURE__ */ React111.createElement(Row, null, children)));
|
|
17973
18317
|
});
|
|
17974
18318
|
export {
|
|
17975
18319
|
AIAssistantInput,
|
|
@@ -17978,6 +18322,7 @@ export {
|
|
|
17978
18322
|
ActionMenu,
|
|
17979
18323
|
ActivityIndicator,
|
|
17980
18324
|
ActivityLog,
|
|
18325
|
+
Anchor,
|
|
17981
18326
|
AnimatePresence,
|
|
17982
18327
|
Avatar,
|
|
17983
18328
|
AvatarStack,
|
|
@@ -18071,6 +18416,7 @@ export {
|
|
|
18071
18416
|
SUPPORTED_CANVAS_UPLOAD_TYPES,
|
|
18072
18417
|
SUPPORTED_IMAGE_UPLOAD_TYPES,
|
|
18073
18418
|
ScrollArea,
|
|
18419
|
+
ScrollArea22 as ScrollArea2,
|
|
18074
18420
|
ScrollableSidebar,
|
|
18075
18421
|
SearchCompletionMenu,
|
|
18076
18422
|
Section,
|
|
@@ -18108,6 +18454,7 @@ export {
|
|
|
18108
18454
|
UserAvatar,
|
|
18109
18455
|
UserPointer,
|
|
18110
18456
|
WorkspaceLayout,
|
|
18457
|
+
WorkspaceSideProvider,
|
|
18111
18458
|
acceptsDrop,
|
|
18112
18459
|
colorForStringValues,
|
|
18113
18460
|
colorFromString,
|
|
@@ -18153,6 +18500,7 @@ export {
|
|
|
18153
18500
|
portalScopeDataSetName,
|
|
18154
18501
|
portalScopePropName,
|
|
18155
18502
|
portalScopeProps,
|
|
18503
|
+
proseTheme,
|
|
18156
18504
|
renderIcon,
|
|
18157
18505
|
separator,
|
|
18158
18506
|
styles,
|
|
@@ -18187,6 +18535,7 @@ export {
|
|
|
18187
18535
|
usePlatformModKey,
|
|
18188
18536
|
usePortalScopeId,
|
|
18189
18537
|
useTheme,
|
|
18538
|
+
useWorkspaceSide,
|
|
18190
18539
|
validateDropIndicator,
|
|
18191
18540
|
withDragProvider,
|
|
18192
18541
|
withSeparatorElements
|