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