@noya-app/noya-designsystem 0.1.76 → 0.1.77
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 +10 -10
- package/CHANGELOG.md +10 -0
- package/dist/index.css +1 -1
- package/dist/index.d.mts +51 -4
- package/dist/index.d.ts +51 -4
- package/dist/index.js +546 -380
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +440 -279
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
- package/src/components/BaseToolbar.tsx +19 -5
- package/src/components/DropdownMenu.tsx +3 -1
- package/src/components/GridBackground.tsx +40 -0
- package/src/components/OverlayToolbar.tsx +97 -0
- package/src/components/SegmentedControl.tsx +2 -2
- package/src/components/StackNavigator.tsx +1 -0
- package/src/components/Toolbar.tsx +19 -8
- package/src/components/UserPointer.tsx +5 -3
- package/src/components/workspace/WorkspaceLayout.tsx +55 -19
- package/src/index.tsx +2 -0
- package/src/theme/proseTheme.ts +20 -0
- package/tailwind.config.ts +6 -1
package/dist/index.mjs
CHANGED
|
@@ -5956,7 +5956,8 @@ var DropdownMenuRoot = forwardRefGeneric(function DropdownMenuRoot2(props, forwa
|
|
|
5956
5956
|
emptyState,
|
|
5957
5957
|
contentStyle,
|
|
5958
5958
|
title,
|
|
5959
|
-
icon
|
|
5959
|
+
icon,
|
|
5960
|
+
modal = true
|
|
5960
5961
|
} = props;
|
|
5961
5962
|
const [open, setOpen] = useControlledOrUncontrolled({
|
|
5962
5963
|
value: openProp,
|
|
@@ -5977,7 +5978,7 @@ var DropdownMenuRoot = forwardRefGeneric(function DropdownMenuRoot2(props, forwa
|
|
|
5977
5978
|
}),
|
|
5978
5979
|
[contentStyle]
|
|
5979
5980
|
);
|
|
5980
|
-
return /* @__PURE__ */ React29.createElement(RadixDropdownMenu.Root, { onOpenChange: setOpen, open }, /* @__PURE__ */ React29.createElement(
|
|
5981
|
+
return /* @__PURE__ */ React29.createElement(RadixDropdownMenu.Root, { onOpenChange: setOpen, open, modal }, /* @__PURE__ */ React29.createElement(
|
|
5981
5982
|
RadixDropdownMenu.Trigger,
|
|
5982
5983
|
{
|
|
5983
5984
|
ref: forwardedRef,
|
|
@@ -10609,17 +10610,22 @@ var getContrastRatio = (luminance1, luminance2) => {
|
|
|
10609
10610
|
};
|
|
10610
10611
|
var WHITE_LUMINANCE = 1;
|
|
10611
10612
|
var BLACK_LUMINANCE = 0;
|
|
10612
|
-
var
|
|
10613
|
+
var getContrastRatiosForBackground = (backgroundColor) => {
|
|
10613
10614
|
try {
|
|
10614
10615
|
const bgRgba = parseColorToRgba(backgroundColor);
|
|
10615
10616
|
const bgLuminance = getRelativeLuminance(bgRgba.r, bgRgba.g, bgRgba.b);
|
|
10616
10617
|
const contrastWithWhite = getContrastRatio(bgLuminance, WHITE_LUMINANCE);
|
|
10617
10618
|
const contrastWithBlack = getContrastRatio(bgLuminance, BLACK_LUMINANCE);
|
|
10618
|
-
return contrastWithWhite
|
|
10619
|
+
return { contrastWithWhite, contrastWithBlack };
|
|
10619
10620
|
} catch (error) {
|
|
10620
|
-
return
|
|
10621
|
+
return null;
|
|
10621
10622
|
}
|
|
10622
10623
|
};
|
|
10624
|
+
var getContrastColorForBackground = (backgroundColor) => {
|
|
10625
|
+
const ratios = getContrastRatiosForBackground(backgroundColor);
|
|
10626
|
+
if (!ratios) return "#000000";
|
|
10627
|
+
return ratios.contrastWithWhite >= ratios.contrastWithBlack ? "#ffffff" : "#000000";
|
|
10628
|
+
};
|
|
10623
10629
|
|
|
10624
10630
|
// ../noya-color/src/cssColor.ts
|
|
10625
10631
|
import { angleUnitToDegrees, normalizeAngle } from "@noya-app/noya-geometry";
|
|
@@ -15132,8 +15138,40 @@ var FloatingWindow = ({
|
|
|
15132
15138
|
);
|
|
15133
15139
|
};
|
|
15134
15140
|
|
|
15141
|
+
// src/components/GridBackground.tsx
|
|
15142
|
+
import { AffineTransform } from "@noya-app/noya-geometry";
|
|
15143
|
+
import React80 from "react";
|
|
15144
|
+
var GridBackground = ({
|
|
15145
|
+
transform = AffineTransform.identity,
|
|
15146
|
+
gridSize: gridSizeProp = 10,
|
|
15147
|
+
dotSize = 1
|
|
15148
|
+
}) => {
|
|
15149
|
+
const scale = transform.scaleComponents.x;
|
|
15150
|
+
const isScaling = scale !== 1 && transform.scaleComponents.y !== 1;
|
|
15151
|
+
const gridSize = isScaling && scale > 1 ? gridSizeProp * scale : gridSizeProp;
|
|
15152
|
+
return /* @__PURE__ */ React80.createElement("div", { className: "n-absolute n-inset-0 n-pointer-events-none n-overflow-hidden" }, /* @__PURE__ */ React80.createElement(
|
|
15153
|
+
"svg",
|
|
15154
|
+
{
|
|
15155
|
+
className: "n-absolute n-inset-0 n-w-full n-h-full",
|
|
15156
|
+
style: { opacity: 0.5 }
|
|
15157
|
+
},
|
|
15158
|
+
/* @__PURE__ */ React80.createElement("defs", null, /* @__PURE__ */ React80.createElement(
|
|
15159
|
+
"pattern",
|
|
15160
|
+
{
|
|
15161
|
+
id: "dot-pattern",
|
|
15162
|
+
width: gridSize,
|
|
15163
|
+
height: gridSize,
|
|
15164
|
+
patternUnits: "userSpaceOnUse",
|
|
15165
|
+
patternTransform: `translate(${transform.tx % gridSize} ${transform.ty % gridSize})`
|
|
15166
|
+
},
|
|
15167
|
+
/* @__PURE__ */ React80.createElement("rect", { x: 0, y: 0, width: dotSize, height: dotSize, fill: "#9ca3af" })
|
|
15168
|
+
)),
|
|
15169
|
+
/* @__PURE__ */ React80.createElement("rect", { width: "100%", height: "100%", fill: "url(#dot-pattern)" })
|
|
15170
|
+
));
|
|
15171
|
+
};
|
|
15172
|
+
|
|
15135
15173
|
// src/components/InspectorContainer.tsx
|
|
15136
|
-
import
|
|
15174
|
+
import React81, { forwardRef as forwardRef25, memo as memo26 } from "react";
|
|
15137
15175
|
var InspectorContainer = memo26(
|
|
15138
15176
|
forwardRef25(function InspectorContainer2({
|
|
15139
15177
|
header,
|
|
@@ -15144,7 +15182,7 @@ var InspectorContainer = memo26(
|
|
|
15144
15182
|
className,
|
|
15145
15183
|
style: style2
|
|
15146
15184
|
}, forwardedRef) {
|
|
15147
|
-
return /* @__PURE__ */
|
|
15185
|
+
return /* @__PURE__ */ React81.createElement(
|
|
15148
15186
|
"div",
|
|
15149
15187
|
{
|
|
15150
15188
|
ref: forwardedRef,
|
|
@@ -15159,32 +15197,32 @@ var InspectorContainer = memo26(
|
|
|
15159
15197
|
}
|
|
15160
15198
|
},
|
|
15161
15199
|
header,
|
|
15162
|
-
children ? /* @__PURE__ */
|
|
15200
|
+
children ? /* @__PURE__ */ React81.createElement(ScrollArea, null, /* @__PURE__ */ React81.createElement("div", { className: "n-flex n-flex-col n-relative" }, showDividers ? withSeparatorElements(children, /* @__PURE__ */ React81.createElement(Divider, null)) : children)) : fallback ? /* @__PURE__ */ React81.createElement("div", { className: "n-flex n-flex-col n-relative n-h-full" }, fallback) : null
|
|
15163
15201
|
);
|
|
15164
15202
|
})
|
|
15165
15203
|
);
|
|
15166
15204
|
|
|
15167
15205
|
// src/components/LabeledElementView.tsx
|
|
15168
15206
|
import * as kiwi from "kiwi.js";
|
|
15169
|
-
import * as
|
|
15170
|
-
var LabeledElementView =
|
|
15207
|
+
import * as React82 from "react";
|
|
15208
|
+
var LabeledElementView = React82.memo(function LabeledElementView2({
|
|
15171
15209
|
children,
|
|
15172
15210
|
renderLabel
|
|
15173
15211
|
}) {
|
|
15174
|
-
const elementIds =
|
|
15175
|
-
(child) =>
|
|
15212
|
+
const elementIds = React82.Children.toArray(children).flatMap(
|
|
15213
|
+
(child) => React82.isValidElement(child) && child.type === React82.Fragment ? child.props.children : [child]
|
|
15176
15214
|
).map(
|
|
15177
|
-
(child) =>
|
|
15215
|
+
(child) => React82.isValidElement(child) && "id" in child.props ? child.props.id : null
|
|
15178
15216
|
).filter((id) => !!id);
|
|
15179
15217
|
const serializedIds = elementIds.join(",");
|
|
15180
|
-
const containerRef =
|
|
15181
|
-
const refs =
|
|
15218
|
+
const containerRef = React82.useRef(null);
|
|
15219
|
+
const refs = React82.useMemo(() => {
|
|
15182
15220
|
return Object.fromEntries(
|
|
15183
|
-
serializedIds.split(",").map((id) => [id,
|
|
15221
|
+
serializedIds.split(",").map((id) => [id, React82.createRef()])
|
|
15184
15222
|
);
|
|
15185
15223
|
}, [serializedIds]);
|
|
15186
|
-
const labelElements =
|
|
15187
|
-
return serializedIds.split(",").map((id, index) => /* @__PURE__ */
|
|
15224
|
+
const labelElements = React82.useMemo(() => {
|
|
15225
|
+
return serializedIds.split(",").map((id, index) => /* @__PURE__ */ React82.createElement(
|
|
15188
15226
|
"span",
|
|
15189
15227
|
{
|
|
15190
15228
|
key: id,
|
|
@@ -15197,7 +15235,7 @@ var LabeledElementView = React81.memo(function LabeledElementView2({
|
|
|
15197
15235
|
})
|
|
15198
15236
|
));
|
|
15199
15237
|
}, [refs, serializedIds, renderLabel]);
|
|
15200
|
-
|
|
15238
|
+
React82.useLayoutEffect(() => {
|
|
15201
15239
|
if (!containerRef.current) return;
|
|
15202
15240
|
const containerRect = containerRef.current.getBoundingClientRect();
|
|
15203
15241
|
const solver = new kiwi.Solver();
|
|
@@ -15259,17 +15297,17 @@ var LabeledElementView = React81.memo(function LabeledElementView2({
|
|
|
15259
15297
|
`${Math.max(...heights)}px`
|
|
15260
15298
|
);
|
|
15261
15299
|
}, [refs, labelElements]);
|
|
15262
|
-
return /* @__PURE__ */
|
|
15300
|
+
return /* @__PURE__ */ React82.createElement("div", { className: "n-flex n-flex-1 n-flex-col n-relative", ref: containerRef }, /* @__PURE__ */ React82.createElement("div", { className: "n-flex n-flex-1 n-items-center" }, children), /* @__PURE__ */ React82.createElement("div", { className: "n-relative n-overflow-hidden n-select-none" }, labelElements));
|
|
15263
15301
|
});
|
|
15264
15302
|
|
|
15265
15303
|
// src/components/LabeledField.tsx
|
|
15266
|
-
import
|
|
15304
|
+
import React84, { memo as memo28, useMemo as useMemo33 } from "react";
|
|
15267
15305
|
|
|
15268
15306
|
// src/hooks/useIndent.ts
|
|
15269
|
-
import
|
|
15270
|
-
var IndentContext =
|
|
15307
|
+
import React83 from "react";
|
|
15308
|
+
var IndentContext = React83.createContext(0);
|
|
15271
15309
|
var useIndent = () => {
|
|
15272
|
-
return
|
|
15310
|
+
return React83.useContext(IndentContext);
|
|
15273
15311
|
};
|
|
15274
15312
|
|
|
15275
15313
|
// src/components/LabeledField.tsx
|
|
@@ -15327,7 +15365,7 @@ var LabeledField = memo28(function LabeledField2({
|
|
|
15327
15365
|
}),
|
|
15328
15366
|
[labelWidth, indentLevel, labelStyleProp]
|
|
15329
15367
|
);
|
|
15330
|
-
return /* @__PURE__ */
|
|
15368
|
+
return /* @__PURE__ */ React84.createElement(LabelContext.Provider, { value: labelContextValue }, labelType === "inset" ? /* @__PURE__ */ React84.createElement(LabelTypeContext.Provider, { value: labelTypeInset }, children) : /* @__PURE__ */ React84.createElement("div", { className: cx("n-flex n-relative n-flex-1", className), style: style2 }, Boolean(indentLevel) && /* @__PURE__ */ React84.createElement("div", { style: indentStyle }), /* @__PURE__ */ React84.createElement("div", { className: labeledFieldClasses }, labelType !== "none" && /* @__PURE__ */ React84.createElement(
|
|
15331
15369
|
Label,
|
|
15332
15370
|
{
|
|
15333
15371
|
htmlFor: fieldId,
|
|
@@ -15336,13 +15374,13 @@ var LabeledField = memo28(function LabeledField2({
|
|
|
15336
15374
|
...props
|
|
15337
15375
|
},
|
|
15338
15376
|
label
|
|
15339
|
-
), labelType === "start" ? /* @__PURE__ */
|
|
15377
|
+
), labelType === "start" ? /* @__PURE__ */ React84.createElement("div", { className: "n-flex-auto n-flex", style: fieldStyle }, children) : children)));
|
|
15340
15378
|
});
|
|
15341
15379
|
|
|
15342
15380
|
// src/components/ListMenu.tsx
|
|
15343
15381
|
import { ArrowRightIcon } from "@noya-app/noya-icons";
|
|
15344
15382
|
import { chunkBy as chunkBy2 } from "@noya-app/noya-utils";
|
|
15345
|
-
import
|
|
15383
|
+
import React85 from "react";
|
|
15346
15384
|
function getItemId(item) {
|
|
15347
15385
|
if (item.type === "submenu") {
|
|
15348
15386
|
return item.id;
|
|
@@ -15371,7 +15409,7 @@ function ListMenu({
|
|
|
15371
15409
|
const regularItems = chunk.filter(
|
|
15372
15410
|
(item) => isSubMenuItem(item) || isSelectableMenuItem(item)
|
|
15373
15411
|
);
|
|
15374
|
-
return /* @__PURE__ */
|
|
15412
|
+
return /* @__PURE__ */ React85.createElement(
|
|
15375
15413
|
List,
|
|
15376
15414
|
{
|
|
15377
15415
|
key: regularItems.map(getItemId).join("-"),
|
|
@@ -15383,23 +15421,23 @@ function ListMenu({
|
|
|
15383
15421
|
getName: (item) => item.title.toString(),
|
|
15384
15422
|
selectedIds,
|
|
15385
15423
|
renderRight,
|
|
15386
|
-
renderThumbnail: ({ item }) => /* @__PURE__ */
|
|
15387
|
-
renderDetail: (item) => isSubMenuItem(item) && /* @__PURE__ */
|
|
15424
|
+
renderThumbnail: ({ item }) => /* @__PURE__ */ React85.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)),
|
|
15425
|
+
renderDetail: (item) => isSubMenuItem(item) && /* @__PURE__ */ React85.createElement(ArrowRightIcon, null),
|
|
15388
15426
|
onClickItem: (itemId) => onSelect(itemId)
|
|
15389
15427
|
}
|
|
15390
15428
|
);
|
|
15391
15429
|
});
|
|
15392
15430
|
return withSeparatorElements(
|
|
15393
15431
|
lists,
|
|
15394
|
-
/* @__PURE__ */
|
|
15432
|
+
/* @__PURE__ */ React85.createElement(Divider, { overflow: 12, className: "n-my-1" })
|
|
15395
15433
|
);
|
|
15396
15434
|
}
|
|
15397
15435
|
|
|
15398
15436
|
// src/components/ListNavigator.tsx
|
|
15399
|
-
import
|
|
15437
|
+
import React89 from "react";
|
|
15400
15438
|
|
|
15401
15439
|
// src/components/Navigator.tsx
|
|
15402
|
-
import
|
|
15440
|
+
import React88, {
|
|
15403
15441
|
Children as Children4,
|
|
15404
15442
|
isValidElement as isValidElement5,
|
|
15405
15443
|
useCallback as useCallback33,
|
|
@@ -15410,7 +15448,7 @@ import React87, {
|
|
|
15410
15448
|
|
|
15411
15449
|
// src/components/StackNavigator.tsx
|
|
15412
15450
|
import { isDeepEqual as isDeepEqual4 } from "@noya-app/noya-utils";
|
|
15413
|
-
import
|
|
15451
|
+
import React87, {
|
|
15414
15452
|
useCallback as useCallback32,
|
|
15415
15453
|
useEffect as useEffect22,
|
|
15416
15454
|
useMemo as useMemo34,
|
|
@@ -15419,8 +15457,8 @@ import React86, {
|
|
|
15419
15457
|
} from "react";
|
|
15420
15458
|
|
|
15421
15459
|
// src/components/BaseToolbar.tsx
|
|
15422
|
-
import
|
|
15423
|
-
var
|
|
15460
|
+
import React86 from "react";
|
|
15461
|
+
var toolbarTransparentStyle = {
|
|
15424
15462
|
[cssVarNames.colors.buttonBackground]: "transparent",
|
|
15425
15463
|
[cssVarNames.colors.inputBackground]: "transparent"
|
|
15426
15464
|
};
|
|
@@ -15431,20 +15469,28 @@ function BaseToolbarContainer({
|
|
|
15431
15469
|
innerClassName,
|
|
15432
15470
|
enableAbsoluteBreakpoint = true
|
|
15433
15471
|
}) {
|
|
15434
|
-
return /* @__PURE__ */
|
|
15472
|
+
return /* @__PURE__ */ React86.createElement(
|
|
15435
15473
|
"div",
|
|
15436
15474
|
{
|
|
15437
|
-
className: cx(
|
|
15438
|
-
|
|
15439
|
-
enableAbsoluteBreakpoint && "n-@container/toolbar",
|
|
15440
|
-
innerClassName
|
|
15441
|
-
),
|
|
15442
|
-
style: {
|
|
15443
|
-
flex: `0 0 ${cssVars.spacing.toolbarHeight}`
|
|
15444
|
-
}
|
|
15475
|
+
className: cx("n-flex n-flex-col", className),
|
|
15476
|
+
style: toolbarTransparentStyle
|
|
15445
15477
|
},
|
|
15446
|
-
|
|
15447
|
-
|
|
15478
|
+
/* @__PURE__ */ React86.createElement(
|
|
15479
|
+
"div",
|
|
15480
|
+
{
|
|
15481
|
+
className: cx(
|
|
15482
|
+
"n-flex n-items-center n-bg-sidebar-background n-flex-none n-relative",
|
|
15483
|
+
enableAbsoluteBreakpoint && "n-@container/toolbar",
|
|
15484
|
+
innerClassName
|
|
15485
|
+
),
|
|
15486
|
+
style: {
|
|
15487
|
+
flex: `0 0 ${cssVars.spacing.toolbarHeight}`
|
|
15488
|
+
}
|
|
15489
|
+
},
|
|
15490
|
+
children
|
|
15491
|
+
),
|
|
15492
|
+
showDivider && /* @__PURE__ */ React86.createElement(Divider, { variant: "strong" })
|
|
15493
|
+
);
|
|
15448
15494
|
}
|
|
15449
15495
|
function BaseToolbar({
|
|
15450
15496
|
children,
|
|
@@ -15454,15 +15500,16 @@ function BaseToolbar({
|
|
|
15454
15500
|
showDivider = true,
|
|
15455
15501
|
className,
|
|
15456
15502
|
innerClassName,
|
|
15457
|
-
enableAbsoluteBreakpoint = true
|
|
15503
|
+
enableAbsoluteBreakpoint = true,
|
|
15504
|
+
enableContainerQuery = true
|
|
15458
15505
|
}) {
|
|
15459
15506
|
const childrenContainerClassName = cx(
|
|
15460
15507
|
"n-flex n-items-center n-justify-center n-text-text-muted n-pointer-events-none n-inset-0 n-pl-1 n-pr-1 n-min-w-0",
|
|
15461
|
-
"@xl/toolbar:!n-absolute @xl/toolbar:!n-pl-0 @xl/toolbar:!n-pr-0"
|
|
15508
|
+
enableContainerQuery && "@xl/toolbar:!n-absolute @xl/toolbar:!n-pl-0 @xl/toolbar:!n-pr-0"
|
|
15462
15509
|
);
|
|
15463
|
-
const childrenElement = children && /* @__PURE__ */
|
|
15464
|
-
const leftElement = left && /* @__PURE__ */
|
|
15465
|
-
return /* @__PURE__ */
|
|
15510
|
+
const childrenElement = children && /* @__PURE__ */ React86.createElement("div", { className: childrenContainerClassName }, /* @__PURE__ */ React86.createElement("div", { className: "n-flex n-items-center n-justify-center n-pointer-events-auto" }, children));
|
|
15511
|
+
const leftElement = left && /* @__PURE__ */ React86.createElement("div", { className: "n-flex n-gap-toolbar-separator" }, left);
|
|
15512
|
+
return /* @__PURE__ */ React86.createElement(
|
|
15466
15513
|
BaseToolbarContainer,
|
|
15467
15514
|
{
|
|
15468
15515
|
showDivider,
|
|
@@ -15470,19 +15517,20 @@ function BaseToolbar({
|
|
|
15470
15517
|
innerClassName,
|
|
15471
15518
|
enableAbsoluteBreakpoint
|
|
15472
15519
|
},
|
|
15473
|
-
logo && /* @__PURE__ */
|
|
15474
|
-
/* @__PURE__ */
|
|
15520
|
+
logo && /* @__PURE__ */ React86.createElement(React86.Fragment, null, logo, /* @__PURE__ */ React86.createElement(DividerVertical, null)),
|
|
15521
|
+
/* @__PURE__ */ React86.createElement(Spacer.Horizontal, { size: 10 }),
|
|
15522
|
+
leftElement && !enableContainerQuery && /* @__PURE__ */ React86.createElement(React86.Fragment, null, leftElement, childrenElement && /* @__PURE__ */ React86.createElement(Spacer.Horizontal, { size: 10 })),
|
|
15475
15523
|
childrenElement,
|
|
15476
|
-
leftElement && /* @__PURE__ */
|
|
15477
|
-
/* @__PURE__ */
|
|
15478
|
-
/* @__PURE__ */
|
|
15479
|
-
/* @__PURE__ */
|
|
15480
|
-
/* @__PURE__ */
|
|
15524
|
+
leftElement && enableContainerQuery && /* @__PURE__ */ React86.createElement(React86.Fragment, null, childrenElement && /* @__PURE__ */ React86.createElement(React86.Fragment, null, /* @__PURE__ */ React86.createElement(Spacer.Horizontal, { size: 10, className: "@xl/toolbar:!n-hidden" }), /* @__PURE__ */ React86.createElement(DividerVertical, { className: "@xl/toolbar:!n-hidden" })), /* @__PURE__ */ React86.createElement(Spacer.Horizontal, { size: 10, className: "@xl/toolbar:!n-hidden" }), leftElement, /* @__PURE__ */ React86.createElement(Spacer.Horizontal, { size: 10 })),
|
|
15525
|
+
/* @__PURE__ */ React86.createElement(Spacer.Horizontal, null),
|
|
15526
|
+
/* @__PURE__ */ React86.createElement(Spacer.Horizontal, { size: 10 }),
|
|
15527
|
+
/* @__PURE__ */ React86.createElement("div", { className: "n-flex n-gap-toolbar-separator" }, right),
|
|
15528
|
+
/* @__PURE__ */ React86.createElement(Spacer.Horizontal, { size: 10 })
|
|
15481
15529
|
);
|
|
15482
15530
|
}
|
|
15483
15531
|
|
|
15484
15532
|
// src/components/StackNavigator.tsx
|
|
15485
|
-
var StackRenderContext =
|
|
15533
|
+
var StackRenderContext = React87.createContext({});
|
|
15486
15534
|
function StackNavigator({
|
|
15487
15535
|
items,
|
|
15488
15536
|
onBack,
|
|
@@ -15642,7 +15690,7 @@ function StackNavigator({
|
|
|
15642
15690
|
}
|
|
15643
15691
|
return defaultRenderHeader(headerProps);
|
|
15644
15692
|
};
|
|
15645
|
-
return /* @__PURE__ */
|
|
15693
|
+
return /* @__PURE__ */ React87.createElement(
|
|
15646
15694
|
"div",
|
|
15647
15695
|
{
|
|
15648
15696
|
className: cx("n-flex n-flex-col", className),
|
|
@@ -15658,13 +15706,13 @@ function StackNavigator({
|
|
|
15658
15706
|
}
|
|
15659
15707
|
},
|
|
15660
15708
|
showHeader && renderHeaderContent(),
|
|
15661
|
-
/* @__PURE__ */
|
|
15709
|
+
/* @__PURE__ */ React87.createElement(
|
|
15662
15710
|
"div",
|
|
15663
15711
|
{
|
|
15664
15712
|
className: cx("n-relative n-overflow-hidden", contentClassName),
|
|
15665
15713
|
style: contentStyle
|
|
15666
15714
|
},
|
|
15667
|
-
/* @__PURE__ */
|
|
15715
|
+
/* @__PURE__ */ React87.createElement(StackRenderContext.Provider, { value: renderContentCache }, /* @__PURE__ */ React87.createElement(
|
|
15668
15716
|
AnimatePresence,
|
|
15669
15717
|
{
|
|
15670
15718
|
duration: 200,
|
|
@@ -15673,7 +15721,7 @@ function StackNavigator({
|
|
|
15673
15721
|
mode: "wait",
|
|
15674
15722
|
onChildStateChange: handleChildStateChange
|
|
15675
15723
|
},
|
|
15676
|
-
/* @__PURE__ */
|
|
15724
|
+
/* @__PURE__ */ React87.createElement(
|
|
15677
15725
|
StackNavigatorCard,
|
|
15678
15726
|
{
|
|
15679
15727
|
key: top.key,
|
|
@@ -15693,15 +15741,15 @@ var StackNavigatorCard = ({
|
|
|
15693
15741
|
style: style2,
|
|
15694
15742
|
className
|
|
15695
15743
|
}) => {
|
|
15696
|
-
const ref =
|
|
15744
|
+
const ref = React87.useRef(null);
|
|
15697
15745
|
const size = useSize(ref);
|
|
15698
|
-
const renderContext =
|
|
15746
|
+
const renderContext = React87.useContext(StackRenderContext);
|
|
15699
15747
|
const renderContent = renderContext?.[item.key] ?? item.renderContent;
|
|
15700
|
-
|
|
15748
|
+
React87.useEffect(() => {
|
|
15701
15749
|
if (!size || size.width === 0 || size.height === 0) return;
|
|
15702
15750
|
onSizeChange(item.key, size);
|
|
15703
15751
|
}, [item.key, onSizeChange, size]);
|
|
15704
|
-
return /* @__PURE__ */
|
|
15752
|
+
return /* @__PURE__ */ React87.createElement("div", { ref, className: cx("n-flex n-flex-col", className), style: style2 }, renderContent?.());
|
|
15705
15753
|
};
|
|
15706
15754
|
function defaultRenderHeader({
|
|
15707
15755
|
showDivider,
|
|
@@ -15710,13 +15758,14 @@ function defaultRenderHeader({
|
|
|
15710
15758
|
right,
|
|
15711
15759
|
title
|
|
15712
15760
|
}) {
|
|
15713
|
-
return /* @__PURE__ */
|
|
15761
|
+
return /* @__PURE__ */ React87.createElement(
|
|
15714
15762
|
BaseToolbar,
|
|
15715
15763
|
{
|
|
15716
15764
|
innerClassName: "n-px-1",
|
|
15717
15765
|
showDivider,
|
|
15718
15766
|
enableAbsoluteBreakpoint: false,
|
|
15719
|
-
|
|
15767
|
+
enableContainerQuery: false,
|
|
15768
|
+
left: showBackButton && /* @__PURE__ */ React87.createElement(
|
|
15720
15769
|
Button,
|
|
15721
15770
|
{
|
|
15722
15771
|
className: "-n-mx-2",
|
|
@@ -15727,7 +15776,7 @@ function defaultRenderHeader({
|
|
|
15727
15776
|
),
|
|
15728
15777
|
right
|
|
15729
15778
|
},
|
|
15730
|
-
typeof title === "string" || typeof title === "number" ? /* @__PURE__ */
|
|
15779
|
+
typeof title === "string" || typeof title === "number" ? /* @__PURE__ */ React87.createElement(Body, null, title) : title
|
|
15731
15780
|
);
|
|
15732
15781
|
}
|
|
15733
15782
|
|
|
@@ -15739,16 +15788,16 @@ var NavigatorScreen = Object.assign(
|
|
|
15739
15788
|
[navigatorScreenIdentifier]: true
|
|
15740
15789
|
}
|
|
15741
15790
|
);
|
|
15742
|
-
var NavigatorScreenContext =
|
|
15791
|
+
var NavigatorScreenContext = React88.createContext(null);
|
|
15743
15792
|
function useNavigator() {
|
|
15744
|
-
const context =
|
|
15793
|
+
const context = React88.useContext(NavigatorScreenContext);
|
|
15745
15794
|
if (!context) {
|
|
15746
15795
|
throw new Error("useNavigator must be used within a Navigator screen");
|
|
15747
15796
|
}
|
|
15748
15797
|
return context.navigation;
|
|
15749
15798
|
}
|
|
15750
15799
|
function useNavigatorRoute() {
|
|
15751
|
-
const context =
|
|
15800
|
+
const context = React88.useContext(NavigatorScreenContext);
|
|
15752
15801
|
if (!context) {
|
|
15753
15802
|
throw new Error("useNavigatorRoute must be used within a Navigator screen");
|
|
15754
15803
|
}
|
|
@@ -15911,7 +15960,7 @@ function NavigatorImpl({
|
|
|
15911
15960
|
onBack: headerProps.onBack
|
|
15912
15961
|
}),
|
|
15913
15962
|
renderContent: () => {
|
|
15914
|
-
return /* @__PURE__ */
|
|
15963
|
+
return /* @__PURE__ */ React88.createElement(NavigatorScreenContext.Provider, { value: context }, evaluateOption(screen.children, context));
|
|
15915
15964
|
}
|
|
15916
15965
|
};
|
|
15917
15966
|
});
|
|
@@ -15919,7 +15968,7 @@ function NavigatorImpl({
|
|
|
15919
15968
|
const shouldShowHeader = evaluateOption(showHeader, {
|
|
15920
15969
|
stack
|
|
15921
15970
|
});
|
|
15922
|
-
return /* @__PURE__ */
|
|
15971
|
+
return /* @__PURE__ */ React88.createElement(
|
|
15923
15972
|
StackNavigator,
|
|
15924
15973
|
{
|
|
15925
15974
|
items,
|
|
@@ -15959,7 +16008,7 @@ function ListNavigator({
|
|
|
15959
16008
|
renderHeader,
|
|
15960
16009
|
selectedIds
|
|
15961
16010
|
}) {
|
|
15962
|
-
return /* @__PURE__ */
|
|
16011
|
+
return /* @__PURE__ */ React89.createElement(
|
|
15963
16012
|
ListNavigatorInternal,
|
|
15964
16013
|
{
|
|
15965
16014
|
initialRoute: { name: "screen", params: { id: void 0 } },
|
|
@@ -15977,7 +16026,7 @@ function ListNavigator({
|
|
|
15977
16026
|
className,
|
|
15978
16027
|
style: style2
|
|
15979
16028
|
},
|
|
15980
|
-
/* @__PURE__ */
|
|
16029
|
+
/* @__PURE__ */ React89.createElement(
|
|
15981
16030
|
ListNavigatorInternal.Screen,
|
|
15982
16031
|
{
|
|
15983
16032
|
name: "screen",
|
|
@@ -15992,7 +16041,7 @@ function ListNavigator({
|
|
|
15992
16041
|
const nestedItem = items.find(
|
|
15993
16042
|
(item) => isSubMenuItem(item) && item.id === route.params.id
|
|
15994
16043
|
);
|
|
15995
|
-
return /* @__PURE__ */
|
|
16044
|
+
return /* @__PURE__ */ React89.createElement(
|
|
15996
16045
|
ListMenu,
|
|
15997
16046
|
{
|
|
15998
16047
|
items: nestedItem?.items ?? items,
|
|
@@ -16017,7 +16066,7 @@ function ListNavigator({
|
|
|
16017
16066
|
|
|
16018
16067
|
// src/components/Message.tsx
|
|
16019
16068
|
import { uuid as uuid2 } from "@noya-app/noya-utils";
|
|
16020
|
-
import
|
|
16069
|
+
import React90, { forwardRef as forwardRef26, memo as memo29, useMemo as useMemo36 } from "react";
|
|
16021
16070
|
var Message = memo29(
|
|
16022
16071
|
forwardRef26(function Message2({ role, children, user, avatarSize = INPUT_HEIGHT }, ref) {
|
|
16023
16072
|
const randomId = uuid2();
|
|
@@ -16029,7 +16078,7 @@ var Message = memo29(
|
|
|
16029
16078
|
} : void 0,
|
|
16030
16079
|
[userMessageBackgroundColor, role]
|
|
16031
16080
|
);
|
|
16032
|
-
return /* @__PURE__ */
|
|
16081
|
+
return /* @__PURE__ */ React90.createElement(
|
|
16033
16082
|
"div",
|
|
16034
16083
|
{
|
|
16035
16084
|
className: cx(
|
|
@@ -16037,15 +16086,15 @@ var Message = memo29(
|
|
|
16037
16086
|
role === "user" ? "n-flex-row-reverse" : "n-flex-row"
|
|
16038
16087
|
)
|
|
16039
16088
|
},
|
|
16040
|
-
role === "assistant" ? /* @__PURE__ */
|
|
16089
|
+
role === "assistant" ? /* @__PURE__ */ React90.createElement(
|
|
16041
16090
|
Avatar,
|
|
16042
16091
|
{
|
|
16043
16092
|
name: "Assistant",
|
|
16044
16093
|
size: avatarSize,
|
|
16045
16094
|
backgroundColor: cssVars.colors.primaryPastel
|
|
16046
16095
|
},
|
|
16047
|
-
/* @__PURE__ */
|
|
16048
|
-
) : /* @__PURE__ */
|
|
16096
|
+
/* @__PURE__ */ React90.createElement(Logo, { style: { width: 15 }, fill: cssVars.colors.primary })
|
|
16097
|
+
) : /* @__PURE__ */ React90.createElement(
|
|
16049
16098
|
Avatar,
|
|
16050
16099
|
{
|
|
16051
16100
|
userId: resolvedUserId,
|
|
@@ -16054,7 +16103,7 @@ var Message = memo29(
|
|
|
16054
16103
|
size: avatarSize
|
|
16055
16104
|
}
|
|
16056
16105
|
),
|
|
16057
|
-
/* @__PURE__ */
|
|
16106
|
+
/* @__PURE__ */ React90.createElement(
|
|
16058
16107
|
"div",
|
|
16059
16108
|
{
|
|
16060
16109
|
className: cx(
|
|
@@ -16074,9 +16123,9 @@ var Message = memo29(
|
|
|
16074
16123
|
|
|
16075
16124
|
// src/components/pipeline/PipelineResultLayout.tsx
|
|
16076
16125
|
import { Link1Icon } from "@noya-app/noya-icons";
|
|
16077
|
-
import
|
|
16126
|
+
import React91 from "react";
|
|
16078
16127
|
var PipelineResultLink = ({ url }) => {
|
|
16079
|
-
return /* @__PURE__ */
|
|
16128
|
+
return /* @__PURE__ */ React91.createElement("div", { className: "n-flex n-flex-col gap-0.5" }, /* @__PURE__ */ React91.createElement(
|
|
16080
16129
|
"a",
|
|
16081
16130
|
{
|
|
16082
16131
|
href: url,
|
|
@@ -16084,15 +16133,15 @@ var PipelineResultLink = ({ url }) => {
|
|
|
16084
16133
|
rel: "noopener noreferrer",
|
|
16085
16134
|
className: "n-flex n-text-primary hover:n-opacity-80 n-border n-border-divider n-rounded-md"
|
|
16086
16135
|
},
|
|
16087
|
-
/* @__PURE__ */
|
|
16088
|
-
/* @__PURE__ */
|
|
16089
|
-
/* @__PURE__ */
|
|
16136
|
+
/* @__PURE__ */ React91.createElement("div", { className: "n-flex n-gap-1 n-items-center n-p-2" }, /* @__PURE__ */ React91.createElement(Link1Icon, { className: "n-w-[15px] n-h-[15px] n-flex-shrink-0" })),
|
|
16137
|
+
/* @__PURE__ */ React91.createElement(DividerVertical, null),
|
|
16138
|
+
/* @__PURE__ */ React91.createElement(Small, { className: "n-truncate n-p-2 n-flex-1" }, url)
|
|
16090
16139
|
));
|
|
16091
16140
|
};
|
|
16092
16141
|
var PipelineResultLayout = ({
|
|
16093
16142
|
children
|
|
16094
16143
|
}) => {
|
|
16095
|
-
return /* @__PURE__ */
|
|
16144
|
+
return /* @__PURE__ */ React91.createElement("div", { className: "n-flex n-flex-col n-gap-2" }, children);
|
|
16096
16145
|
};
|
|
16097
16146
|
function getPipelineResultLink(value) {
|
|
16098
16147
|
if (typeof value !== "object" || value === null) return void 0;
|
|
@@ -16106,7 +16155,7 @@ function getPipelineResultLink(value) {
|
|
|
16106
16155
|
}
|
|
16107
16156
|
|
|
16108
16157
|
// src/components/ResizableContainer.tsx
|
|
16109
|
-
import
|
|
16158
|
+
import React92, { useCallback as useCallback34, useRef as useRef27, useState as useState33 } from "react";
|
|
16110
16159
|
var ResizableContainer = ({
|
|
16111
16160
|
children,
|
|
16112
16161
|
minWidth,
|
|
@@ -16175,7 +16224,7 @@ var ResizableContainer = ({
|
|
|
16175
16224
|
},
|
|
16176
16225
|
[shouldResetWidth]
|
|
16177
16226
|
);
|
|
16178
|
-
return /* @__PURE__ */
|
|
16227
|
+
return /* @__PURE__ */ React92.createElement(
|
|
16179
16228
|
"div",
|
|
16180
16229
|
{
|
|
16181
16230
|
ref: containerRef,
|
|
@@ -16183,7 +16232,7 @@ var ResizableContainer = ({
|
|
|
16183
16232
|
style: { position: "relative", ...style2 },
|
|
16184
16233
|
className
|
|
16185
16234
|
},
|
|
16186
|
-
/* @__PURE__ */
|
|
16235
|
+
/* @__PURE__ */ React92.createElement(
|
|
16187
16236
|
"div",
|
|
16188
16237
|
{
|
|
16189
16238
|
ref: resizeableRef,
|
|
@@ -16194,7 +16243,7 @@ var ResizableContainer = ({
|
|
|
16194
16243
|
}
|
|
16195
16244
|
},
|
|
16196
16245
|
typeof children === "function" ? children({ width }) : children,
|
|
16197
|
-
/* @__PURE__ */
|
|
16246
|
+
/* @__PURE__ */ React92.createElement(
|
|
16198
16247
|
"div",
|
|
16199
16248
|
{
|
|
16200
16249
|
ref: handleRef,
|
|
@@ -16219,7 +16268,7 @@ var ResizableContainer = ({
|
|
|
16219
16268
|
onPointerUp: handlePointerUp,
|
|
16220
16269
|
onPointerCancel: handlePointerUp
|
|
16221
16270
|
},
|
|
16222
|
-
/* @__PURE__ */
|
|
16271
|
+
/* @__PURE__ */ React92.createElement(
|
|
16223
16272
|
"div",
|
|
16224
16273
|
{
|
|
16225
16274
|
style: {
|
|
@@ -16237,7 +16286,7 @@ var ResizableContainer = ({
|
|
|
16237
16286
|
}
|
|
16238
16287
|
)
|
|
16239
16288
|
),
|
|
16240
|
-
drag && /* @__PURE__ */
|
|
16289
|
+
drag && /* @__PURE__ */ React92.createElement(
|
|
16241
16290
|
"div",
|
|
16242
16291
|
{
|
|
16243
16292
|
style: {
|
|
@@ -16260,7 +16309,7 @@ function clamp5(value, min, max) {
|
|
|
16260
16309
|
|
|
16261
16310
|
// src/components/RingProgress.tsx
|
|
16262
16311
|
import { clamp as clamp6 } from "@noya-app/noya-utils";
|
|
16263
|
-
import * as
|
|
16312
|
+
import * as React93 from "react";
|
|
16264
16313
|
function RingProgress({
|
|
16265
16314
|
value,
|
|
16266
16315
|
dividedBy = 100,
|
|
@@ -16276,14 +16325,14 @@ function RingProgress({
|
|
|
16276
16325
|
const safeDivisor = dividedBy > 0 ? dividedBy : 1;
|
|
16277
16326
|
const clampedRaw = clamp6(value, 0, safeDivisor);
|
|
16278
16327
|
const clampedPercent = clampedRaw / safeDivisor * 100;
|
|
16279
|
-
const radius =
|
|
16280
|
-
const circumference =
|
|
16281
|
-
const dashOffset =
|
|
16328
|
+
const radius = React93.useMemo(() => (size - thickness) / 2, [size, thickness]);
|
|
16329
|
+
const circumference = React93.useMemo(() => 2 * Math.PI * radius, [radius]);
|
|
16330
|
+
const dashOffset = React93.useMemo(
|
|
16282
16331
|
() => (100 - clampedPercent) / 100 * circumference,
|
|
16283
16332
|
[circumference, clampedPercent]
|
|
16284
16333
|
);
|
|
16285
16334
|
const trackStroke = trackColor ?? "var(--n-input-background, rgba(0,0,0,0.08))";
|
|
16286
|
-
const colorClass =
|
|
16335
|
+
const colorClass = React93.useMemo(() => {
|
|
16287
16336
|
switch (colorScheme) {
|
|
16288
16337
|
case "primary":
|
|
16289
16338
|
return "n-stroke-primary";
|
|
@@ -16296,7 +16345,7 @@ function RingProgress({
|
|
|
16296
16345
|
return "n-stroke-text";
|
|
16297
16346
|
}
|
|
16298
16347
|
}, [colorScheme]);
|
|
16299
|
-
const computedStroke =
|
|
16348
|
+
const computedStroke = React93.useMemo(() => {
|
|
16300
16349
|
if (color) return color;
|
|
16301
16350
|
switch (colorScheme) {
|
|
16302
16351
|
case "primary":
|
|
@@ -16310,7 +16359,7 @@ function RingProgress({
|
|
|
16310
16359
|
return "var(--n-text, currentColor)";
|
|
16311
16360
|
}
|
|
16312
16361
|
}, [color, colorScheme]);
|
|
16313
|
-
return /* @__PURE__ */
|
|
16362
|
+
return /* @__PURE__ */ React93.createElement(
|
|
16314
16363
|
"span",
|
|
16315
16364
|
{
|
|
16316
16365
|
className: cx("n-inline-flex n-items-center n-justify-center", className),
|
|
@@ -16321,7 +16370,7 @@ function RingProgress({
|
|
|
16321
16370
|
"aria-valuemax": safeDivisor,
|
|
16322
16371
|
"aria-label": ariaLabel
|
|
16323
16372
|
},
|
|
16324
|
-
/* @__PURE__ */
|
|
16373
|
+
/* @__PURE__ */ React93.createElement(
|
|
16325
16374
|
"svg",
|
|
16326
16375
|
{
|
|
16327
16376
|
width: size,
|
|
@@ -16329,7 +16378,7 @@ function RingProgress({
|
|
|
16329
16378
|
viewBox: `0 0 ${size} ${size}`,
|
|
16330
16379
|
style: { display: "block" }
|
|
16331
16380
|
},
|
|
16332
|
-
/* @__PURE__ */
|
|
16381
|
+
/* @__PURE__ */ React93.createElement(
|
|
16333
16382
|
"circle",
|
|
16334
16383
|
{
|
|
16335
16384
|
cx: size / 2,
|
|
@@ -16340,7 +16389,7 @@ function RingProgress({
|
|
|
16340
16389
|
strokeWidth: thickness
|
|
16341
16390
|
}
|
|
16342
16391
|
),
|
|
16343
|
-
/* @__PURE__ */
|
|
16392
|
+
/* @__PURE__ */ React93.createElement(
|
|
16344
16393
|
"circle",
|
|
16345
16394
|
{
|
|
16346
16395
|
cx: size / 2,
|
|
@@ -16364,13 +16413,13 @@ function RingProgress({
|
|
|
16364
16413
|
}
|
|
16365
16414
|
|
|
16366
16415
|
// src/components/ScrollableSidebar.tsx
|
|
16367
|
-
import
|
|
16416
|
+
import React94 from "react";
|
|
16368
16417
|
function ScrollableSidebar({ children }) {
|
|
16369
|
-
return /* @__PURE__ */
|
|
16418
|
+
return /* @__PURE__ */ React94.createElement("div", { className: "n-relative n-flex n-flex-col n-flex-1 n-max-h-full" }, /* @__PURE__ */ React94.createElement(ScrollArea, null, children));
|
|
16370
16419
|
}
|
|
16371
16420
|
|
|
16372
16421
|
// src/components/Section.tsx
|
|
16373
|
-
import
|
|
16422
|
+
import React95, { memo as memo30, useMemo as useMemo38 } from "react";
|
|
16374
16423
|
var titleIconStyle = {
|
|
16375
16424
|
marginRight: "6px",
|
|
16376
16425
|
alignSelf: "flex-start",
|
|
@@ -16398,7 +16447,7 @@ function SectionHeader({
|
|
|
16398
16447
|
}),
|
|
16399
16448
|
[style2]
|
|
16400
16449
|
);
|
|
16401
|
-
const titleElement = title ? /* @__PURE__ */
|
|
16450
|
+
const titleElement = title ? /* @__PURE__ */ React95.createElement(
|
|
16402
16451
|
InspectorPrimitives_exports.Title,
|
|
16403
16452
|
{
|
|
16404
16453
|
$textStyle: titleTextStyle,
|
|
@@ -16406,16 +16455,16 @@ function SectionHeader({
|
|
|
16406
16455
|
},
|
|
16407
16456
|
title
|
|
16408
16457
|
) : null;
|
|
16409
|
-
return /* @__PURE__ */
|
|
16458
|
+
return /* @__PURE__ */ React95.createElement(
|
|
16410
16459
|
InspectorPrimitives_exports.SectionHeader,
|
|
16411
16460
|
{
|
|
16412
16461
|
style: headerStyle,
|
|
16413
16462
|
className
|
|
16414
16463
|
},
|
|
16415
|
-
titleIcon && /* @__PURE__ */
|
|
16416
|
-
titleElement && /* @__PURE__ */
|
|
16417
|
-
headerSeparator === "space" && /* @__PURE__ */
|
|
16418
|
-
headerSeparator === "dot" && /* @__PURE__ */
|
|
16464
|
+
titleIcon && /* @__PURE__ */ React95.createElement("div", { style: titleIconStyle, className: textStyles[titleTextStyle] }, "\u200B", renderIcon(titleIcon)),
|
|
16465
|
+
titleElement && /* @__PURE__ */ React95.createElement(React95.Fragment, null, onClickTitle ? /* @__PURE__ */ React95.createElement(Button, { variant: "none", onClick: onClickTitle }, titleElement) : titleElement),
|
|
16466
|
+
headerSeparator === "space" && /* @__PURE__ */ React95.createElement(Spacer.Horizontal, null),
|
|
16467
|
+
headerSeparator === "dot" && /* @__PURE__ */ React95.createElement(
|
|
16419
16468
|
Text,
|
|
16420
16469
|
{
|
|
16421
16470
|
variant: titleTextStyle,
|
|
@@ -16452,7 +16501,7 @@ var SectionInternal = ({
|
|
|
16452
16501
|
}),
|
|
16453
16502
|
[titleTextStyle, title, extraPadding, styleProp]
|
|
16454
16503
|
);
|
|
16455
|
-
const hasChildren =
|
|
16504
|
+
const hasChildren = React95.Children.toArray(children).some((child) => !!child);
|
|
16456
16505
|
const headerStyle = useMemo38(
|
|
16457
16506
|
() => ({
|
|
16458
16507
|
marginBottom: hasChildren ? "4px" : void 0,
|
|
@@ -16460,7 +16509,7 @@ var SectionInternal = ({
|
|
|
16460
16509
|
}),
|
|
16461
16510
|
[hasChildren, headerStyleProp]
|
|
16462
16511
|
);
|
|
16463
|
-
return /* @__PURE__ */
|
|
16512
|
+
return /* @__PURE__ */ React95.createElement("div", { style: style2, className }, (title || titleIcon || right) && /* @__PURE__ */ React95.createElement(
|
|
16464
16513
|
SectionHeader,
|
|
16465
16514
|
{
|
|
16466
16515
|
style: headerStyle,
|
|
@@ -16472,7 +16521,7 @@ var SectionInternal = ({
|
|
|
16472
16521
|
right,
|
|
16473
16522
|
headerSeparator
|
|
16474
16523
|
}
|
|
16475
|
-
), /* @__PURE__ */
|
|
16524
|
+
), /* @__PURE__ */ React95.createElement(IndentContext.Provider, { value: 0 }, children));
|
|
16476
16525
|
};
|
|
16477
16526
|
var ExpandableSection = ({
|
|
16478
16527
|
storageKey,
|
|
@@ -16485,12 +16534,12 @@ var ExpandableSection = ({
|
|
|
16485
16534
|
initialVisibility
|
|
16486
16535
|
);
|
|
16487
16536
|
const expanded = visibility === "show";
|
|
16488
|
-
return /* @__PURE__ */
|
|
16537
|
+
return /* @__PURE__ */ React95.createElement(
|
|
16489
16538
|
SectionInternal,
|
|
16490
16539
|
{
|
|
16491
16540
|
...props,
|
|
16492
16541
|
right: !props.hideRightWhenCollapsed || expanded ? props.right : null,
|
|
16493
|
-
title: /* @__PURE__ */
|
|
16542
|
+
title: /* @__PURE__ */ React95.createElement("div", { className: "n-flex n-gap-1 n-items-center" }, props.title, /* @__PURE__ */ React95.createElement(
|
|
16494
16543
|
IconButton,
|
|
16495
16544
|
{
|
|
16496
16545
|
iconName: expanded ? "ChevronDownIcon2" : "ChevronRightIcon2",
|
|
@@ -16505,12 +16554,12 @@ var Section = memo30(function InspectorSection({
|
|
|
16505
16554
|
storageKey,
|
|
16506
16555
|
...props
|
|
16507
16556
|
}) {
|
|
16508
|
-
return storageKey ? /* @__PURE__ */
|
|
16557
|
+
return storageKey ? /* @__PURE__ */ React95.createElement(ExpandableSection, { ...props, storageKey }) : /* @__PURE__ */ React95.createElement(SectionInternal, { ...props });
|
|
16509
16558
|
});
|
|
16510
16559
|
|
|
16511
16560
|
// src/components/SegmentedControl.tsx
|
|
16512
16561
|
import { ToggleGroup as ToggleGroupPrimitive2 } from "radix-ui";
|
|
16513
|
-
import
|
|
16562
|
+
import React96, {
|
|
16514
16563
|
createContext as createContext13,
|
|
16515
16564
|
forwardRef as forwardRef27,
|
|
16516
16565
|
useCallback as useCallback35,
|
|
@@ -16531,7 +16580,7 @@ var SegmentedControlItem = forwardRef27(function SegmentedControlItem2({
|
|
|
16531
16580
|
...props
|
|
16532
16581
|
}, forwardedRef) {
|
|
16533
16582
|
const { colorScheme } = useContext14(SegmentedControlContext);
|
|
16534
|
-
const itemElement = /* @__PURE__ */
|
|
16583
|
+
const itemElement = /* @__PURE__ */ React96.createElement(
|
|
16535
16584
|
ToggleGroupPrimitive2.Item,
|
|
16536
16585
|
{
|
|
16537
16586
|
ref: forwardedRef,
|
|
@@ -16546,7 +16595,7 @@ var SegmentedControlItem = forwardRef27(function SegmentedControlItem2({
|
|
|
16546
16595
|
// font weight
|
|
16547
16596
|
variant === "tabs" ? "n-font-semibold" : variant === "buttons" ? "n-font-medium" : "n-font-normal",
|
|
16548
16597
|
// focus ring
|
|
16549
|
-
variant === "tabs" ? "" : variant === "buttons" ? "focus
|
|
16598
|
+
variant === "tabs" ? "" : variant === "buttons" ? "focus:n-ring-2 focus:n-ring-primary focus:n-shadow-[0_0_0_1px_var(--n-popover-background)_inset] n-transition-all" : colorScheme === "secondary" ? "focus:n-ring-2 focus:n-ring-secondary focus:n-ring-offset-1" : "focus:n-ring-2 focus:n-ring-primary focus:n-ring-offset-1",
|
|
16550
16599
|
// checked
|
|
16551
16600
|
variant === "tabs" ? "aria-checked:n-text-primary" : variant === "buttons" ? "active:n-text-button-text-active active:n-bg-button-background-active aria-checked:n-text-button-text-active aria-checked:n-bg-button-background-active" : colorScheme === "secondary" ? "aria-checked:n-bg-secondary aria-checked:n-text-white" : colorScheme === "primary" ? "aria-checked:n-bg-primary aria-checked:n-text-white" : "aria-checked:n-bg-segmented-control-item-active-background aria-checked:n-text-segmented-control-item-active-text",
|
|
16552
16601
|
"focus:n-z-interactable",
|
|
@@ -16555,14 +16604,14 @@ var SegmentedControlItem = forwardRef27(function SegmentedControlItem2({
|
|
|
16555
16604
|
// hover
|
|
16556
16605
|
variant === "buttons" && "hover:n-bg-button-background-hover",
|
|
16557
16606
|
// spacing and borders
|
|
16558
|
-
variant === "default" ? "n-px-1 n-rounded n-border-r n-border-divider last:n-border-r-0" : variant === "buttons" ? "n-px-1 n-rounded-sm n-max-w-fit" : "n-px-1.5 n-border-y-2 n-border-y-transparent aria-checked:n-border-b-primary",
|
|
16607
|
+
variant === "default" ? "n-px-1 n-rounded n-border-r n-border-divider last:n-border-r-0" : variant === "buttons" ? "n-px-1.5 n-rounded-sm n-max-w-fit" : "n-px-1.5 n-border-y-2 n-border-y-transparent aria-checked:n-border-b-primary",
|
|
16559
16608
|
// icon only buttons
|
|
16560
16609
|
variant === "buttons" && title === "" && icon && "n-min-w-input-height",
|
|
16561
16610
|
className
|
|
16562
16611
|
),
|
|
16563
16612
|
...props
|
|
16564
16613
|
},
|
|
16565
|
-
/* @__PURE__ */
|
|
16614
|
+
/* @__PURE__ */ React96.createElement(
|
|
16566
16615
|
"span",
|
|
16567
16616
|
{
|
|
16568
16617
|
className: cx(
|
|
@@ -16574,7 +16623,7 @@ var SegmentedControlItem = forwardRef27(function SegmentedControlItem2({
|
|
|
16574
16623
|
title
|
|
16575
16624
|
)
|
|
16576
16625
|
);
|
|
16577
|
-
return tooltip ? /* @__PURE__ */
|
|
16626
|
+
return tooltip ? /* @__PURE__ */ React96.createElement(Tooltip, { content: tooltip }, itemElement) : itemElement;
|
|
16578
16627
|
});
|
|
16579
16628
|
var SegmentedControl = memoGeneric(function SegmentedControl2({
|
|
16580
16629
|
id: idProp,
|
|
@@ -16596,7 +16645,7 @@ var SegmentedControl = memoGeneric(function SegmentedControl2({
|
|
|
16596
16645
|
},
|
|
16597
16646
|
[allowEmpty, onValueChange]
|
|
16598
16647
|
);
|
|
16599
|
-
return /* @__PURE__ */
|
|
16648
|
+
return /* @__PURE__ */ React96.createElement(SegmentedControlContext.Provider, { value: contextValue }, /* @__PURE__ */ React96.createElement(
|
|
16600
16649
|
ToggleGroupPrimitive2.Root,
|
|
16601
16650
|
{
|
|
16602
16651
|
id,
|
|
@@ -16615,13 +16664,13 @@ var SegmentedControl = memoGeneric(function SegmentedControl2({
|
|
|
16615
16664
|
gridTemplateColumns: `repeat(${items.length}, 1fr)`
|
|
16616
16665
|
}
|
|
16617
16666
|
},
|
|
16618
|
-
items.map((item, index) => /* @__PURE__ */
|
|
16667
|
+
items.map((item, index) => /* @__PURE__ */ React96.createElement(SegmentedControlItem, { key: index, ...item, variant }))
|
|
16619
16668
|
));
|
|
16620
16669
|
});
|
|
16621
16670
|
|
|
16622
16671
|
// src/components/SelectionToolbar.tsx
|
|
16623
16672
|
import * as PopperPrimitive from "@radix-ui/react-popper";
|
|
16624
|
-
import
|
|
16673
|
+
import React97, { memo as memo31, useMemo as useMemo40 } from "react";
|
|
16625
16674
|
import { createPortal as createPortal3 } from "react-dom";
|
|
16626
16675
|
var createVirtualElement = (rect) => ({
|
|
16627
16676
|
getBoundingClientRect: () => ({
|
|
@@ -16650,7 +16699,7 @@ var SelectionToolbarContainer = memo31(
|
|
|
16650
16699
|
transitionDuration = 0.2
|
|
16651
16700
|
}) {
|
|
16652
16701
|
const portalScopeId = usePortalScopeId();
|
|
16653
|
-
const containerRef =
|
|
16702
|
+
const containerRef = React97.useRef(null);
|
|
16654
16703
|
const size = useSize(containerRef, "width");
|
|
16655
16704
|
const virtualRef = useMemo40(
|
|
16656
16705
|
() => ({
|
|
@@ -16658,7 +16707,7 @@ var SelectionToolbarContainer = memo31(
|
|
|
16658
16707
|
}),
|
|
16659
16708
|
[rect]
|
|
16660
16709
|
);
|
|
16661
|
-
const popperContent = /* @__PURE__ */
|
|
16710
|
+
const popperContent = /* @__PURE__ */ React97.createElement(
|
|
16662
16711
|
PopperPrimitive.Content,
|
|
16663
16712
|
{
|
|
16664
16713
|
...portalScopeProps(portalScopeId),
|
|
@@ -16676,7 +16725,7 @@ var SelectionToolbarContainer = memo31(
|
|
|
16676
16725
|
[cssVarNames.colors.buttonBackground]: "transparent"
|
|
16677
16726
|
}
|
|
16678
16727
|
},
|
|
16679
|
-
/* @__PURE__ */
|
|
16728
|
+
/* @__PURE__ */ React97.createElement(
|
|
16680
16729
|
"div",
|
|
16681
16730
|
{
|
|
16682
16731
|
ref: containerRef,
|
|
@@ -16693,7 +16742,7 @@ var SelectionToolbarContainer = memo31(
|
|
|
16693
16742
|
children
|
|
16694
16743
|
)
|
|
16695
16744
|
);
|
|
16696
|
-
return /* @__PURE__ */
|
|
16745
|
+
return /* @__PURE__ */ React97.createElement(PopperPrimitive.Root, null, /* @__PURE__ */ React97.createElement(PopperPrimitive.Anchor, { virtualRef }), portalContainer ? createPortal3(popperContent, portalContainer) : popperContent);
|
|
16697
16746
|
}
|
|
16698
16747
|
);
|
|
16699
16748
|
|
|
@@ -16704,7 +16753,7 @@ import {
|
|
|
16704
16753
|
DropdownChevronIcon as DropdownChevronIcon3
|
|
16705
16754
|
} from "@noya-app/noya-icons";
|
|
16706
16755
|
import { Select } from "radix-ui";
|
|
16707
|
-
import
|
|
16756
|
+
import React98, {
|
|
16708
16757
|
useMemo as useMemo41,
|
|
16709
16758
|
useState as useState34
|
|
16710
16759
|
} from "react";
|
|
@@ -16730,7 +16779,7 @@ var SelectMenuTrigger = memoGeneric(function SelectMenuTrigger2({
|
|
|
16730
16779
|
fieldId: props.id
|
|
16731
16780
|
});
|
|
16732
16781
|
const labelType = useLabelType();
|
|
16733
|
-
return /* @__PURE__ */
|
|
16782
|
+
return /* @__PURE__ */ React98.createElement(Select.SelectTrigger, { asChild: true, onFocus, onBlur }, /* @__PURE__ */ React98.createElement(
|
|
16734
16783
|
Button,
|
|
16735
16784
|
{
|
|
16736
16785
|
id,
|
|
@@ -16742,10 +16791,10 @@ var SelectMenuTrigger = memoGeneric(function SelectMenuTrigger2({
|
|
|
16742
16791
|
),
|
|
16743
16792
|
disabled
|
|
16744
16793
|
},
|
|
16745
|
-
icon && /* @__PURE__ */
|
|
16746
|
-
label && labelType === "inset" && /* @__PURE__ */
|
|
16747
|
-
/* @__PURE__ */
|
|
16748
|
-
/* @__PURE__ */
|
|
16794
|
+
icon && /* @__PURE__ */ React98.createElement("span", { className: "n-pr-1.5" }, renderIcon(icon)),
|
|
16795
|
+
label && labelType === "inset" && /* @__PURE__ */ React98.createElement("div", { className: insetEndStyles }, /* @__PURE__ */ React98.createElement(Label, { className: "n-pr-4 n-text-text-disabled", htmlFor: id }, label)),
|
|
16796
|
+
/* @__PURE__ */ React98.createElement("span", { className: "n-flex-1 n-flex" }, /* @__PURE__ */ React98.createElement(Select.Value, { placeholder })),
|
|
16797
|
+
/* @__PURE__ */ React98.createElement(
|
|
16749
16798
|
DropdownChevronIcon3,
|
|
16750
16799
|
{
|
|
16751
16800
|
className: cx(
|
|
@@ -16794,7 +16843,7 @@ var SelectMenu = memoGeneric(function SelectMenu2({
|
|
|
16794
16843
|
setInternalOpen(open2);
|
|
16795
16844
|
};
|
|
16796
16845
|
const readOnlyButton = useMemo41(
|
|
16797
|
-
() => /* @__PURE__ */
|
|
16846
|
+
() => /* @__PURE__ */ React98.createElement(
|
|
16798
16847
|
Button,
|
|
16799
16848
|
{
|
|
16800
16849
|
id,
|
|
@@ -16804,7 +16853,7 @@ var SelectMenu = memoGeneric(function SelectMenu2({
|
|
|
16804
16853
|
disabled
|
|
16805
16854
|
},
|
|
16806
16855
|
icon && renderIcon(icon),
|
|
16807
|
-
/* @__PURE__ */
|
|
16856
|
+
/* @__PURE__ */ React98.createElement("span", { className: "n-flex n-flex-1" }, selectedItem?.title ?? value)
|
|
16808
16857
|
),
|
|
16809
16858
|
[icon, id, style2, className, disabled, value, selectedItem]
|
|
16810
16859
|
);
|
|
@@ -16816,7 +16865,7 @@ var SelectMenu = memoGeneric(function SelectMenu2({
|
|
|
16816
16865
|
...contentStyleProp
|
|
16817
16866
|
};
|
|
16818
16867
|
}, [contentStyleProp]);
|
|
16819
|
-
const content = /* @__PURE__ */
|
|
16868
|
+
const content = /* @__PURE__ */ React98.createElement(
|
|
16820
16869
|
Select.Root,
|
|
16821
16870
|
{
|
|
16822
16871
|
value,
|
|
@@ -16824,7 +16873,7 @@ var SelectMenu = memoGeneric(function SelectMenu2({
|
|
|
16824
16873
|
open,
|
|
16825
16874
|
onOpenChange: handleOpenChange
|
|
16826
16875
|
},
|
|
16827
|
-
/* @__PURE__ */
|
|
16876
|
+
/* @__PURE__ */ React98.createElement(
|
|
16828
16877
|
SelectMenuTrigger,
|
|
16829
16878
|
{
|
|
16830
16879
|
id,
|
|
@@ -16839,7 +16888,7 @@ var SelectMenu = memoGeneric(function SelectMenu2({
|
|
|
16839
16888
|
label
|
|
16840
16889
|
}
|
|
16841
16890
|
),
|
|
16842
|
-
/* @__PURE__ */
|
|
16891
|
+
/* @__PURE__ */ React98.createElement(Select.Portal, null, /* @__PURE__ */ React98.createElement(
|
|
16843
16892
|
Select.Content,
|
|
16844
16893
|
{
|
|
16845
16894
|
...portalScopeProps(portalScopeId),
|
|
@@ -16850,14 +16899,14 @@ var SelectMenu = memoGeneric(function SelectMenu2({
|
|
|
16850
16899
|
align: "center",
|
|
16851
16900
|
style: contentStyle
|
|
16852
16901
|
},
|
|
16853
|
-
/* @__PURE__ */
|
|
16902
|
+
/* @__PURE__ */ React98.createElement(Select.ScrollUpButton, { className: scrollButtonStyles }, /* @__PURE__ */ React98.createElement(
|
|
16854
16903
|
ChevronUpIcon,
|
|
16855
16904
|
{
|
|
16856
16905
|
className: cx("n-transition-transform n-duration-100")
|
|
16857
16906
|
}
|
|
16858
16907
|
)),
|
|
16859
|
-
/* @__PURE__ */
|
|
16860
|
-
/* @__PURE__ */
|
|
16908
|
+
/* @__PURE__ */ React98.createElement(Select.Viewport, null, /* @__PURE__ */ React98.createElement(MenuViewport, { items, Components: Components3 })),
|
|
16909
|
+
/* @__PURE__ */ React98.createElement(Select.ScrollDownButton, { className: scrollButtonStyles }, /* @__PURE__ */ React98.createElement(ChevronDownIcon, null))
|
|
16861
16910
|
))
|
|
16862
16911
|
);
|
|
16863
16912
|
return readOnly ? readOnlyButton : content;
|
|
@@ -16865,7 +16914,7 @@ var SelectMenu = memoGeneric(function SelectMenu2({
|
|
|
16865
16914
|
|
|
16866
16915
|
// src/components/Slider.tsx
|
|
16867
16916
|
import { Slider as RadixSlider } from "radix-ui";
|
|
16868
|
-
import
|
|
16917
|
+
import React99, { memo as memo32, useCallback as useCallback36, useMemo as useMemo42 } from "react";
|
|
16869
16918
|
var THUMB_WIDTH = 8;
|
|
16870
16919
|
var thumbStyle = {
|
|
16871
16920
|
width: THUMB_WIDTH
|
|
@@ -16898,7 +16947,7 @@ var Slider = memo32(function Slider2({
|
|
|
16898
16947
|
[onValueChange]
|
|
16899
16948
|
);
|
|
16900
16949
|
const ratio = (arrayValue[0] - min) / (max - min);
|
|
16901
|
-
return /* @__PURE__ */
|
|
16950
|
+
return /* @__PURE__ */ React99.createElement(
|
|
16902
16951
|
RadixSlider.Root,
|
|
16903
16952
|
{
|
|
16904
16953
|
min,
|
|
@@ -16916,7 +16965,7 @@ var Slider = memo32(function Slider2({
|
|
|
16916
16965
|
onBlur,
|
|
16917
16966
|
disabled: readOnly
|
|
16918
16967
|
},
|
|
16919
|
-
/* @__PURE__ */
|
|
16968
|
+
/* @__PURE__ */ React99.createElement("div", { className: "n-relative n-flex-grow n-h-[3px] n-overflow-hidden" }, /* @__PURE__ */ React99.createElement(
|
|
16920
16969
|
"div",
|
|
16921
16970
|
{
|
|
16922
16971
|
className: "n-absolute n-h-full n-rounded-l n-bg-slider-active-background",
|
|
@@ -16925,7 +16974,7 @@ var Slider = memo32(function Slider2({
|
|
|
16925
16974
|
width: `calc(${ratio * 100}% - ${ratio * 8}px - 2px)`
|
|
16926
16975
|
}
|
|
16927
16976
|
}
|
|
16928
|
-
), /* @__PURE__ */
|
|
16977
|
+
), /* @__PURE__ */ React99.createElement(
|
|
16929
16978
|
"div",
|
|
16930
16979
|
{
|
|
16931
16980
|
className: "n-absolute n-h-full n-rounded-r n-bg-input-background",
|
|
@@ -16935,7 +16984,7 @@ var Slider = memo32(function Slider2({
|
|
|
16935
16984
|
}
|
|
16936
16985
|
}
|
|
16937
16986
|
)),
|
|
16938
|
-
/* @__PURE__ */
|
|
16987
|
+
/* @__PURE__ */ React99.createElement(
|
|
16939
16988
|
RadixSlider.Thumb,
|
|
16940
16989
|
{
|
|
16941
16990
|
style: thumbStyle,
|
|
@@ -16953,27 +17002,27 @@ var Slider = memo32(function Slider2({
|
|
|
16953
17002
|
});
|
|
16954
17003
|
|
|
16955
17004
|
// src/components/sorting/createSharedDrag.tsx
|
|
16956
|
-
import * as
|
|
17005
|
+
import * as React100 from "react";
|
|
16957
17006
|
function createSharedDrag() {
|
|
16958
|
-
const dragRegistrationContext =
|
|
16959
|
-
const activeDragContext =
|
|
17007
|
+
const dragRegistrationContext = React100.createContext(null);
|
|
17008
|
+
const activeDragContext = React100.createContext(
|
|
16960
17009
|
null
|
|
16961
17010
|
);
|
|
16962
17011
|
const sharedDragProps = {
|
|
16963
17012
|
dragRegistrationContext,
|
|
16964
17013
|
activeDragContext
|
|
16965
17014
|
};
|
|
16966
|
-
const Provider = (props) => /* @__PURE__ */
|
|
17015
|
+
const Provider = (props) => /* @__PURE__ */ React100.createElement(SharedDragProvider, { sharedDragProps, ...props });
|
|
16967
17016
|
return {
|
|
16968
17017
|
Provider,
|
|
16969
|
-
Sortable: (props) => /* @__PURE__ */
|
|
17018
|
+
Sortable: (props) => /* @__PURE__ */ React100.createElement(Sortable, { sharedDragProps, ...props }),
|
|
16970
17019
|
props: sharedDragProps
|
|
16971
17020
|
};
|
|
16972
17021
|
}
|
|
16973
17022
|
|
|
16974
17023
|
// src/components/Stepper.tsx
|
|
16975
17024
|
import { clamp as clamp7 } from "@noya-app/noya-utils";
|
|
16976
|
-
import
|
|
17025
|
+
import React101, { memo as memo33, useCallback as useCallback37, useMemo as useMemo43 } from "react";
|
|
16977
17026
|
var Stepper = memo33(function Stepper2({
|
|
16978
17027
|
style: style2,
|
|
16979
17028
|
className,
|
|
@@ -17001,7 +17050,7 @@ var Stepper = memo33(function Stepper2({
|
|
|
17001
17050
|
},
|
|
17002
17051
|
[onValueChange, min, max]
|
|
17003
17052
|
);
|
|
17004
|
-
return /* @__PURE__ */
|
|
17053
|
+
return /* @__PURE__ */ React101.createElement(
|
|
17005
17054
|
"div",
|
|
17006
17055
|
{
|
|
17007
17056
|
id,
|
|
@@ -17013,7 +17062,7 @@ var Stepper = memo33(function Stepper2({
|
|
|
17013
17062
|
onFocus,
|
|
17014
17063
|
onBlur
|
|
17015
17064
|
},
|
|
17016
|
-
/* @__PURE__ */
|
|
17065
|
+
/* @__PURE__ */ React101.createElement(
|
|
17017
17066
|
InputField2.Root,
|
|
17018
17067
|
{
|
|
17019
17068
|
className: "n-flex-1",
|
|
@@ -17021,7 +17070,7 @@ var Stepper = memo33(function Stepper2({
|
|
|
17021
17070
|
startClassName: "-n-ml-[3px]",
|
|
17022
17071
|
endWidth: 17,
|
|
17023
17072
|
endClassName: "-n-mr-[3px]",
|
|
17024
|
-
start: /* @__PURE__ */
|
|
17073
|
+
start: /* @__PURE__ */ React101.createElement(
|
|
17025
17074
|
IconButton,
|
|
17026
17075
|
{
|
|
17027
17076
|
iconName: "MinusIcon",
|
|
@@ -17035,7 +17084,7 @@ var Stepper = memo33(function Stepper2({
|
|
|
17035
17084
|
}
|
|
17036
17085
|
}
|
|
17037
17086
|
),
|
|
17038
|
-
end: /* @__PURE__ */
|
|
17087
|
+
end: /* @__PURE__ */ React101.createElement(
|
|
17039
17088
|
IconButton,
|
|
17040
17089
|
{
|
|
17041
17090
|
iconName: "PlusIcon",
|
|
@@ -17050,7 +17099,7 @@ var Stepper = memo33(function Stepper2({
|
|
|
17050
17099
|
}
|
|
17051
17100
|
)
|
|
17052
17101
|
},
|
|
17053
|
-
/* @__PURE__ */
|
|
17102
|
+
/* @__PURE__ */ React101.createElement(
|
|
17054
17103
|
InputField2.NumberInput,
|
|
17055
17104
|
{
|
|
17056
17105
|
value,
|
|
@@ -17065,7 +17114,7 @@ var Stepper = memo33(function Stepper2({
|
|
|
17065
17114
|
|
|
17066
17115
|
// src/components/Switch.tsx
|
|
17067
17116
|
import { Switch as SwitchPrimitive } from "radix-ui";
|
|
17068
|
-
import * as
|
|
17117
|
+
import * as React102 from "react";
|
|
17069
17118
|
var Switch = function Switch2({
|
|
17070
17119
|
id,
|
|
17071
17120
|
value,
|
|
@@ -17077,7 +17126,7 @@ var Switch = function Switch2({
|
|
|
17077
17126
|
style: style2,
|
|
17078
17127
|
className
|
|
17079
17128
|
}) {
|
|
17080
|
-
return /* @__PURE__ */
|
|
17129
|
+
return /* @__PURE__ */ React102.createElement(
|
|
17081
17130
|
SwitchPrimitive.Root,
|
|
17082
17131
|
{
|
|
17083
17132
|
id,
|
|
@@ -17096,12 +17145,12 @@ var Switch = function Switch2({
|
|
|
17096
17145
|
onFocus,
|
|
17097
17146
|
onBlur
|
|
17098
17147
|
},
|
|
17099
|
-
/* @__PURE__ */
|
|
17148
|
+
/* @__PURE__ */ React102.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]" })
|
|
17100
17149
|
);
|
|
17101
17150
|
};
|
|
17102
17151
|
|
|
17103
17152
|
// src/components/Tabs.tsx
|
|
17104
|
-
import * as
|
|
17153
|
+
import * as React103 from "react";
|
|
17105
17154
|
function Tabs({
|
|
17106
17155
|
value,
|
|
17107
17156
|
onValueChange,
|
|
@@ -17116,7 +17165,7 @@ function Tabs({
|
|
|
17116
17165
|
value,
|
|
17117
17166
|
onChange: onValueChange
|
|
17118
17167
|
});
|
|
17119
|
-
return /* @__PURE__ */
|
|
17168
|
+
return /* @__PURE__ */ React103.createElement("div", { ...props, className: cx("n-flex n-flex-col", props.className) }, /* @__PURE__ */ React103.createElement("div", { className: "n-flex n-flex-row n-px-3" }, /* @__PURE__ */ React103.createElement(
|
|
17120
17169
|
SegmentedControl,
|
|
17121
17170
|
{
|
|
17122
17171
|
className: "n-flex-1",
|
|
@@ -17125,11 +17174,11 @@ function Tabs({
|
|
|
17125
17174
|
variant,
|
|
17126
17175
|
items: selectableItems
|
|
17127
17176
|
}
|
|
17128
|
-
)), /* @__PURE__ */
|
|
17177
|
+
)), /* @__PURE__ */ React103.createElement(Divider, null), renderContent({ value: activeTab }));
|
|
17129
17178
|
}
|
|
17130
17179
|
|
|
17131
17180
|
// src/components/UserPicker.tsx
|
|
17132
|
-
import
|
|
17181
|
+
import React104, { useCallback as useCallback38, useMemo as useMemo44, useState as useState35 } from "react";
|
|
17133
17182
|
function UserPicker({
|
|
17134
17183
|
users,
|
|
17135
17184
|
value,
|
|
@@ -17175,7 +17224,7 @@ function UserPicker({
|
|
|
17175
17224
|
},
|
|
17176
17225
|
[updateSelectedUserId, onSelectUser, usersById]
|
|
17177
17226
|
);
|
|
17178
|
-
return /* @__PURE__ */
|
|
17227
|
+
return /* @__PURE__ */ React104.createElement(
|
|
17179
17228
|
Combobox,
|
|
17180
17229
|
{
|
|
17181
17230
|
...rest,
|
|
@@ -17199,7 +17248,7 @@ function createUserMenuItem(user) {
|
|
|
17199
17248
|
return {
|
|
17200
17249
|
value: user.id,
|
|
17201
17250
|
title,
|
|
17202
|
-
icon: /* @__PURE__ */
|
|
17251
|
+
icon: /* @__PURE__ */ React104.createElement("div", { className: "n-relative n-w-[15px] n-h-[15px]" }, /* @__PURE__ */ React104.createElement(
|
|
17203
17252
|
Avatar,
|
|
17204
17253
|
{
|
|
17205
17254
|
size: 15 + overflow * 2,
|
|
@@ -17218,7 +17267,7 @@ function createUserMenuItem(user) {
|
|
|
17218
17267
|
}
|
|
17219
17268
|
|
|
17220
17269
|
// src/components/UserPointer.tsx
|
|
17221
|
-
import
|
|
17270
|
+
import React105, { memo as memo34, useMemo as useMemo45 } from "react";
|
|
17222
17271
|
var UserPointerContainer = memo34(function UserPointerContainer2({
|
|
17223
17272
|
point,
|
|
17224
17273
|
visible,
|
|
@@ -17226,11 +17275,13 @@ var UserPointerContainer = memo34(function UserPointerContainer2({
|
|
|
17226
17275
|
className,
|
|
17227
17276
|
style: style2
|
|
17228
17277
|
}) {
|
|
17229
|
-
return /* @__PURE__ */
|
|
17278
|
+
return /* @__PURE__ */ React105.createElement(
|
|
17230
17279
|
"div",
|
|
17231
17280
|
{
|
|
17232
17281
|
style: {
|
|
17233
|
-
|
|
17282
|
+
...point && {
|
|
17283
|
+
transform: `translate(${Math.round(point.x)}px, ${Math.round(point.y)}px)`
|
|
17284
|
+
},
|
|
17234
17285
|
transition: "transform 0.075s, opacity 0.2s",
|
|
17235
17286
|
...style2
|
|
17236
17287
|
},
|
|
@@ -17252,7 +17303,7 @@ var UserNameTag = memo34(function UserNameTag2({
|
|
|
17252
17303
|
size = "medium",
|
|
17253
17304
|
bordered = true
|
|
17254
17305
|
}) {
|
|
17255
|
-
return /* @__PURE__ */
|
|
17306
|
+
return /* @__PURE__ */ React105.createElement(
|
|
17256
17307
|
"span",
|
|
17257
17308
|
{
|
|
17258
17309
|
className: cx(
|
|
@@ -17278,7 +17329,7 @@ var UserPointerIcon = memo34(function PointerIcon({
|
|
|
17278
17329
|
style: style2
|
|
17279
17330
|
}) {
|
|
17280
17331
|
const points = "0,5 10,0 10,10";
|
|
17281
|
-
return /* @__PURE__ */
|
|
17332
|
+
return /* @__PURE__ */ React105.createElement(
|
|
17282
17333
|
"svg",
|
|
17283
17334
|
{
|
|
17284
17335
|
width: size,
|
|
@@ -17293,7 +17344,7 @@ var UserPointerIcon = memo34(function PointerIcon({
|
|
|
17293
17344
|
...style2
|
|
17294
17345
|
}
|
|
17295
17346
|
},
|
|
17296
|
-
/* @__PURE__ */
|
|
17347
|
+
/* @__PURE__ */ React105.createElement(
|
|
17297
17348
|
"polygon",
|
|
17298
17349
|
{
|
|
17299
17350
|
points,
|
|
@@ -17334,7 +17385,7 @@ var UserPointer = memo34(function UserPointer2({
|
|
|
17334
17385
|
() => ({ marginLeft: `${POINTER_SIZE - POINTER_OVERLAP + 1}px` }),
|
|
17335
17386
|
[]
|
|
17336
17387
|
);
|
|
17337
|
-
return /* @__PURE__ */
|
|
17388
|
+
return /* @__PURE__ */ React105.createElement(
|
|
17338
17389
|
UserPointerContainer,
|
|
17339
17390
|
{
|
|
17340
17391
|
point,
|
|
@@ -17342,14 +17393,14 @@ var UserPointer = memo34(function UserPointer2({
|
|
|
17342
17393
|
className,
|
|
17343
17394
|
style: style2
|
|
17344
17395
|
},
|
|
17345
|
-
name && /* @__PURE__ */
|
|
17396
|
+
name && /* @__PURE__ */ React105.createElement("div", { className: "n-relative" }, showPointerIcon && /* @__PURE__ */ React105.createElement(
|
|
17346
17397
|
UserPointerIcon,
|
|
17347
17398
|
{
|
|
17348
17399
|
size: POINTER_SIZE,
|
|
17349
17400
|
color: userBackgroundColor,
|
|
17350
17401
|
style: pointerOverlapStyle
|
|
17351
17402
|
}
|
|
17352
|
-
), /* @__PURE__ */
|
|
17403
|
+
), /* @__PURE__ */ React105.createElement(
|
|
17353
17404
|
UserNameTag,
|
|
17354
17405
|
{
|
|
17355
17406
|
backgroundColor: userBackgroundColor,
|
|
@@ -17365,16 +17416,84 @@ var UserPointer = memo34(function UserPointer2({
|
|
|
17365
17416
|
|
|
17366
17417
|
// src/components/workspace/WorkspaceLayout.tsx
|
|
17367
17418
|
import { useKeyboardShortcuts as useKeyboardShortcuts4 } from "@noya-app/noya-keymap";
|
|
17368
|
-
import
|
|
17419
|
+
import React112, {
|
|
17369
17420
|
memo as memo36,
|
|
17370
17421
|
useCallback as useCallback40,
|
|
17371
17422
|
useImperativeHandle as useImperativeHandle9,
|
|
17372
|
-
useMemo as
|
|
17423
|
+
useMemo as useMemo50,
|
|
17373
17424
|
useRef as useRef30
|
|
17374
17425
|
} from "react";
|
|
17375
17426
|
|
|
17427
|
+
// src/components/OverlayToolbar.tsx
|
|
17428
|
+
import React106, { useMemo as useMemo46 } from "react";
|
|
17429
|
+
var panelClassName = "n-pointer-events-auto n-inline-flex n-items-center n-gap-toolbar-separator n-rounded-3xl n-border n-border-divider n-bg-sidebar-background n-px-3 n-py-2.5 n-shadow-2xl";
|
|
17430
|
+
function OverlayToolbar({
|
|
17431
|
+
left,
|
|
17432
|
+
right,
|
|
17433
|
+
overlayLayout = "bottomCenterTopRight",
|
|
17434
|
+
className,
|
|
17435
|
+
style: style2
|
|
17436
|
+
}) {
|
|
17437
|
+
const resolvedLayout = overlayLayout === "topLeftTopRight" ? "topLeftTopRight" : "bottomCenterTopRight";
|
|
17438
|
+
const panelStyle = useMemo46(
|
|
17439
|
+
() => ({
|
|
17440
|
+
...toolbarTransparentStyle,
|
|
17441
|
+
...style2
|
|
17442
|
+
}),
|
|
17443
|
+
[style2]
|
|
17444
|
+
);
|
|
17445
|
+
const renderLeftPanel = (overlayId) => {
|
|
17446
|
+
if (!left) return null;
|
|
17447
|
+
return /* @__PURE__ */ React106.createElement(
|
|
17448
|
+
"div",
|
|
17449
|
+
{
|
|
17450
|
+
className: panelClassName,
|
|
17451
|
+
"data-embedded-overlay-id": overlayId,
|
|
17452
|
+
style: panelStyle
|
|
17453
|
+
},
|
|
17454
|
+
left
|
|
17455
|
+
);
|
|
17456
|
+
};
|
|
17457
|
+
return /* @__PURE__ */ React106.createElement(React106.Fragment, null, resolvedLayout === "bottomCenterTopRight" ? /* @__PURE__ */ React106.createElement(
|
|
17458
|
+
"div",
|
|
17459
|
+
{
|
|
17460
|
+
className: cx(
|
|
17461
|
+
"n-pointer-events-none n-absolute n-bottom-0 n-left-0 n-right-0 n-flex n-justify-center n-px-6 n-pb-6",
|
|
17462
|
+
className
|
|
17463
|
+
)
|
|
17464
|
+
},
|
|
17465
|
+
renderLeftPanel("noya-toolbar-bottom-center")
|
|
17466
|
+
) : /* @__PURE__ */ React106.createElement(
|
|
17467
|
+
"div",
|
|
17468
|
+
{
|
|
17469
|
+
className: cx(
|
|
17470
|
+
"n-pointer-events-none n-absolute n-top-0 n-left-0 n-px-4 sm:!n-px-6 n-pt-4 sm:!n-pt-6",
|
|
17471
|
+
className
|
|
17472
|
+
)
|
|
17473
|
+
},
|
|
17474
|
+
renderLeftPanel("noya-toolbar-top-left")
|
|
17475
|
+
), right && /* @__PURE__ */ React106.createElement(
|
|
17476
|
+
"div",
|
|
17477
|
+
{
|
|
17478
|
+
className: cx(
|
|
17479
|
+
"n-pointer-events-none n-absolute n-top-0 n-right-0 n-px-4 sm:!n-px-6 n-pt-4 sm:!n-pt-6",
|
|
17480
|
+
className
|
|
17481
|
+
)
|
|
17482
|
+
},
|
|
17483
|
+
/* @__PURE__ */ React106.createElement(
|
|
17484
|
+
"div",
|
|
17485
|
+
{
|
|
17486
|
+
className: panelClassName,
|
|
17487
|
+
"data-embedded-overlay-id": "noya-toolbar-top-right",
|
|
17488
|
+
style: panelStyle
|
|
17489
|
+
},
|
|
17490
|
+
right
|
|
17491
|
+
)
|
|
17492
|
+
));
|
|
17493
|
+
}
|
|
17494
|
+
|
|
17376
17495
|
// src/components/workspace/DrawerWorkspaceLayout.tsx
|
|
17377
|
-
import
|
|
17496
|
+
import React110, { useMemo as useMemo48, useRef as useRef28, useState as useState36 } from "react";
|
|
17378
17497
|
|
|
17379
17498
|
// src/components/workspace/constants.ts
|
|
17380
17499
|
var EDITOR_PANEL_GROUP_ID = "editor-panel-group";
|
|
@@ -17383,20 +17502,20 @@ var RIGHT_SIDEBAR_ID = "editor-3-right-sidebar";
|
|
|
17383
17502
|
var CONTENT_AREA_ID = "editor-2-content-area";
|
|
17384
17503
|
|
|
17385
17504
|
// src/components/workspace/VerticalTabMenu.tsx
|
|
17386
|
-
import
|
|
17505
|
+
import React109, { useMemo as useMemo47 } from "react";
|
|
17387
17506
|
|
|
17388
17507
|
// src/components/Toolbar.tsx
|
|
17389
17508
|
import { useKeyboardShortcuts as useKeyboardShortcuts3 } from "@noya-app/noya-keymap";
|
|
17390
|
-
import
|
|
17509
|
+
import React108, {
|
|
17391
17510
|
createContext as createContext15,
|
|
17392
17511
|
useContext as useContext15
|
|
17393
17512
|
} from "react";
|
|
17394
17513
|
|
|
17395
17514
|
// src/components/ToolbarDrawer.tsx
|
|
17396
|
-
import
|
|
17515
|
+
import React107, { forwardRef as forwardRef28, memo as memo35 } from "react";
|
|
17397
17516
|
var ToolbarDrawer = memo35(
|
|
17398
17517
|
forwardRef28(function ToolbarDrawer2({ children, trigger, sideOffset = 8 }, ref) {
|
|
17399
|
-
return /* @__PURE__ */
|
|
17518
|
+
return /* @__PURE__ */ React107.createElement("div", { className: "n-relative", ref }, /* @__PURE__ */ React107.createElement(
|
|
17400
17519
|
"div",
|
|
17401
17520
|
{
|
|
17402
17521
|
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",
|
|
@@ -17417,20 +17536,21 @@ var ToolbarMenuDropdown = memoGeneric(function ToolbarMenuDropdown2({
|
|
|
17417
17536
|
item,
|
|
17418
17537
|
onSelectMenuItem
|
|
17419
17538
|
}) {
|
|
17420
|
-
const [open, setOpen] =
|
|
17421
|
-
return /* @__PURE__ */
|
|
17539
|
+
const [open, setOpen] = React108.useState(false);
|
|
17540
|
+
return /* @__PURE__ */ React108.createElement(
|
|
17422
17541
|
DropdownMenu,
|
|
17423
17542
|
{
|
|
17424
17543
|
open,
|
|
17425
17544
|
onOpenChange: setOpen,
|
|
17426
17545
|
items: item.items,
|
|
17546
|
+
modal: false,
|
|
17427
17547
|
onSelect: (value) => {
|
|
17428
17548
|
if (onSelectMenuItem && value) {
|
|
17429
17549
|
onSelectMenuItem(value);
|
|
17430
17550
|
}
|
|
17431
17551
|
}
|
|
17432
17552
|
},
|
|
17433
|
-
/* @__PURE__ */
|
|
17553
|
+
/* @__PURE__ */ React108.createElement(
|
|
17434
17554
|
Button,
|
|
17435
17555
|
{
|
|
17436
17556
|
disabled: item.disabled,
|
|
@@ -17446,7 +17566,7 @@ var ToolbarShortcut = ({
|
|
|
17446
17566
|
shortcut,
|
|
17447
17567
|
label
|
|
17448
17568
|
}) => {
|
|
17449
|
-
return /* @__PURE__ */
|
|
17569
|
+
return /* @__PURE__ */ React108.createElement("div", { className: "n-flex n-items-center" }, label, /* @__PURE__ */ React108.createElement(Spacer.Horizontal, { size: 6 }), /* @__PURE__ */ React108.createElement(KeyboardShortcut, { shortcut }));
|
|
17450
17570
|
};
|
|
17451
17571
|
var ToolbarMenuPopover = memoGeneric(function ToolbarMenuPopover2({
|
|
17452
17572
|
item,
|
|
@@ -17460,8 +17580,8 @@ var ToolbarMenuPopover = memoGeneric(function ToolbarMenuPopover2({
|
|
|
17460
17580
|
content: itemContent,
|
|
17461
17581
|
checked
|
|
17462
17582
|
} = item;
|
|
17463
|
-
const [open, setOpen] =
|
|
17464
|
-
const content = /* @__PURE__ */
|
|
17583
|
+
const [open, setOpen] = React108.useState(false);
|
|
17584
|
+
const content = /* @__PURE__ */ React108.createElement("span", null, /* @__PURE__ */ React108.createElement(
|
|
17465
17585
|
Popover,
|
|
17466
17586
|
{
|
|
17467
17587
|
open,
|
|
@@ -17470,7 +17590,7 @@ var ToolbarMenuPopover = memoGeneric(function ToolbarMenuPopover2({
|
|
|
17470
17590
|
showArrow: false,
|
|
17471
17591
|
sideOffset: SIDE_OFFSET,
|
|
17472
17592
|
portalContainer,
|
|
17473
|
-
trigger: /* @__PURE__ */
|
|
17593
|
+
trigger: /* @__PURE__ */ React108.createElement(
|
|
17474
17594
|
Button,
|
|
17475
17595
|
{
|
|
17476
17596
|
disabled,
|
|
@@ -17483,7 +17603,7 @@ var ToolbarMenuPopover = memoGeneric(function ToolbarMenuPopover2({
|
|
|
17483
17603
|
},
|
|
17484
17604
|
typeof itemContent === "function" ? itemContent({ close: () => setOpen(false) }) : itemContent
|
|
17485
17605
|
));
|
|
17486
|
-
return tooltip && !open ? /* @__PURE__ */
|
|
17606
|
+
return tooltip && !open ? /* @__PURE__ */ React108.createElement(
|
|
17487
17607
|
Tooltip,
|
|
17488
17608
|
{
|
|
17489
17609
|
sideOffset: SIDE_OFFSET,
|
|
@@ -17503,7 +17623,7 @@ var ToolbarMenuButton = memoGeneric(function ToolbarMenuButton2({
|
|
|
17503
17623
|
displayFilter
|
|
17504
17624
|
}) {
|
|
17505
17625
|
const isActive = item.checked || activeValue === item.value;
|
|
17506
|
-
const content = /* @__PURE__ */
|
|
17626
|
+
const content = /* @__PURE__ */ React108.createElement(
|
|
17507
17627
|
Button,
|
|
17508
17628
|
{
|
|
17509
17629
|
as,
|
|
@@ -17520,7 +17640,7 @@ var ToolbarMenuButton = memoGeneric(function ToolbarMenuButton2({
|
|
|
17520
17640
|
displayFilter === "iconOnly" ? void 0 : item.title
|
|
17521
17641
|
);
|
|
17522
17642
|
const tooltip = item.tooltip ?? (displayFilter === "iconOnly" && item.title ? item.title : void 0);
|
|
17523
|
-
return item.drawer && isActive ? /* @__PURE__ */
|
|
17643
|
+
return item.drawer && isActive ? /* @__PURE__ */ React108.createElement(ToolbarDrawer, { trigger: content }, item.drawer) : tooltip ? /* @__PURE__ */ React108.createElement(Tooltip, { sideOffset: SIDE_OFFSET, content: tooltip, side: tooltipSide }, content) : content;
|
|
17524
17644
|
});
|
|
17525
17645
|
var ToolbarMenuItem = memoGeneric(function ToolbarMenuItem2({
|
|
17526
17646
|
item,
|
|
@@ -17536,13 +17656,13 @@ var ToolbarMenuItem = memoGeneric(function ToolbarMenuItem2({
|
|
|
17536
17656
|
const dividerOverflow = dividerOverflowProp ?? contextDividerOverflow ?? 4;
|
|
17537
17657
|
if (item.type === "sectionHeader") return null;
|
|
17538
17658
|
if (item.type === "separator") {
|
|
17539
|
-
return /* @__PURE__ */
|
|
17659
|
+
return /* @__PURE__ */ React108.createElement(DividerVertical, { overflow: dividerOverflow });
|
|
17540
17660
|
}
|
|
17541
17661
|
if (item.type === "popover") {
|
|
17542
|
-
return /* @__PURE__ */
|
|
17662
|
+
return /* @__PURE__ */ React108.createElement(ToolbarMenuPopover, { item, portalContainer });
|
|
17543
17663
|
}
|
|
17544
17664
|
if (isSelectableMenuItem(item)) {
|
|
17545
|
-
return /* @__PURE__ */
|
|
17665
|
+
return /* @__PURE__ */ React108.createElement(
|
|
17546
17666
|
ToolbarMenuButton,
|
|
17547
17667
|
{
|
|
17548
17668
|
item,
|
|
@@ -17554,7 +17674,7 @@ var ToolbarMenuItem = memoGeneric(function ToolbarMenuItem2({
|
|
|
17554
17674
|
}
|
|
17555
17675
|
);
|
|
17556
17676
|
}
|
|
17557
|
-
return /* @__PURE__ */
|
|
17677
|
+
return /* @__PURE__ */ React108.createElement(ToolbarMenuDropdown, { item, onSelectMenuItem });
|
|
17558
17678
|
});
|
|
17559
17679
|
var ToolbarMenu = memoGeneric(function ToolbarMenu2({
|
|
17560
17680
|
items,
|
|
@@ -17566,8 +17686,8 @@ var ToolbarMenu = memoGeneric(function ToolbarMenu2({
|
|
|
17566
17686
|
displayFilter = "iconAndText",
|
|
17567
17687
|
dividerOverflow
|
|
17568
17688
|
}) {
|
|
17569
|
-
return /* @__PURE__ */
|
|
17570
|
-
return /* @__PURE__ */
|
|
17689
|
+
return /* @__PURE__ */ React108.createElement(React108.Fragment, null, items.map((item, i) => {
|
|
17690
|
+
return /* @__PURE__ */ React108.createElement(
|
|
17571
17691
|
ToolbarMenuItem,
|
|
17572
17692
|
{
|
|
17573
17693
|
key: i,
|
|
@@ -17583,6 +17703,14 @@ var ToolbarMenu = memoGeneric(function ToolbarMenu2({
|
|
|
17583
17703
|
);
|
|
17584
17704
|
}));
|
|
17585
17705
|
});
|
|
17706
|
+
function useBindKeyboardShortcutsForMenuItems(items, onSelectMenuItem) {
|
|
17707
|
+
return useKeyboardShortcuts3(
|
|
17708
|
+
React108.useMemo(
|
|
17709
|
+
() => onSelectMenuItem ? getKeyboardShortcutsForMenuItems(items, onSelectMenuItem) : {},
|
|
17710
|
+
[items, onSelectMenuItem]
|
|
17711
|
+
)
|
|
17712
|
+
);
|
|
17713
|
+
}
|
|
17586
17714
|
function Toolbar({
|
|
17587
17715
|
children,
|
|
17588
17716
|
logo,
|
|
@@ -17592,21 +17720,19 @@ function Toolbar({
|
|
|
17592
17720
|
shouldBindKeyboardShortcuts = true,
|
|
17593
17721
|
dividerOverflow
|
|
17594
17722
|
}) {
|
|
17595
|
-
const allMenuItems =
|
|
17723
|
+
const allMenuItems = React108.useMemo(
|
|
17596
17724
|
() => [...leftMenuItems, ...rightMenuItems],
|
|
17597
17725
|
[leftMenuItems, rightMenuItems]
|
|
17598
17726
|
);
|
|
17599
|
-
|
|
17600
|
-
|
|
17601
|
-
|
|
17602
|
-
[allMenuItems, onSelectMenuItem, shouldBindKeyboardShortcuts]
|
|
17603
|
-
)
|
|
17727
|
+
useBindKeyboardShortcutsForMenuItems(
|
|
17728
|
+
allMenuItems,
|
|
17729
|
+
shouldBindKeyboardShortcuts ? onSelectMenuItem : void 0
|
|
17604
17730
|
);
|
|
17605
|
-
return /* @__PURE__ */
|
|
17731
|
+
return /* @__PURE__ */ React108.createElement(
|
|
17606
17732
|
BaseToolbar,
|
|
17607
17733
|
{
|
|
17608
17734
|
logo,
|
|
17609
|
-
left: leftMenuItems.length > 0 && /* @__PURE__ */
|
|
17735
|
+
left: leftMenuItems.length > 0 && /* @__PURE__ */ React108.createElement("div", { className: "n-flex n-gap-2" }, /* @__PURE__ */ React108.createElement(
|
|
17610
17736
|
ToolbarMenu,
|
|
17611
17737
|
{
|
|
17612
17738
|
items: leftMenuItems,
|
|
@@ -17614,7 +17740,7 @@ function Toolbar({
|
|
|
17614
17740
|
dividerOverflow
|
|
17615
17741
|
}
|
|
17616
17742
|
)),
|
|
17617
|
-
right: rightMenuItems.length > 0 && /* @__PURE__ */
|
|
17743
|
+
right: rightMenuItems.length > 0 && /* @__PURE__ */ React108.createElement("div", { className: "n-flex n-gap-2" }, /* @__PURE__ */ React108.createElement(
|
|
17618
17744
|
ToolbarMenu,
|
|
17619
17745
|
{
|
|
17620
17746
|
items: rightMenuItems,
|
|
@@ -17635,19 +17761,19 @@ var VerticalTabMenu = memoGeneric(function VerticalTabMenu2({
|
|
|
17635
17761
|
onChange,
|
|
17636
17762
|
tooltipSide
|
|
17637
17763
|
}) {
|
|
17638
|
-
const style2 =
|
|
17764
|
+
const style2 = useMemo47(() => {
|
|
17639
17765
|
return {
|
|
17640
17766
|
[cssVarNames.colors.inputBackground]: "transparent",
|
|
17641
17767
|
[cssVarNames.colors.buttonBackground]: "transparent"
|
|
17642
17768
|
};
|
|
17643
17769
|
}, []);
|
|
17644
|
-
return /* @__PURE__ */
|
|
17770
|
+
return /* @__PURE__ */ React109.createElement(
|
|
17645
17771
|
"div",
|
|
17646
17772
|
{
|
|
17647
17773
|
className: "n-w-[calc(var(--n-toolbar-height)+1px)] n-h-full n-bg-sidebar-background n-flex n-flex-col n-items-center n-py-3 n-gap-3",
|
|
17648
17774
|
style: style2
|
|
17649
17775
|
},
|
|
17650
|
-
/* @__PURE__ */
|
|
17776
|
+
/* @__PURE__ */ React109.createElement(
|
|
17651
17777
|
ToolbarMenu,
|
|
17652
17778
|
{
|
|
17653
17779
|
items,
|
|
@@ -17680,7 +17806,7 @@ var DrawerWorkspaceLayout = memoGeneric(function DrawerWorkspaceLayout2({
|
|
|
17680
17806
|
leftSidebarCollapsed: true,
|
|
17681
17807
|
rightSidebarCollapsed: true
|
|
17682
17808
|
});
|
|
17683
|
-
const allTabItems =
|
|
17809
|
+
const allTabItems = useMemo48(
|
|
17684
17810
|
() => [
|
|
17685
17811
|
...leftPanel ? leftTabItems ?? [] : [],
|
|
17686
17812
|
...rightPanel ? rightTabItems ?? [] : []
|
|
@@ -17688,16 +17814,16 @@ var DrawerWorkspaceLayout = memoGeneric(function DrawerWorkspaceLayout2({
|
|
|
17688
17814
|
[leftTabItems, rightTabItems, leftPanel, rightPanel]
|
|
17689
17815
|
);
|
|
17690
17816
|
const hasTabs = allTabItems.length > 0;
|
|
17691
|
-
const allSelectableTabItems =
|
|
17817
|
+
const allSelectableTabItems = useMemo48(
|
|
17692
17818
|
() => allTabItems.filter(isSelectableMenuItem),
|
|
17693
17819
|
[allTabItems]
|
|
17694
17820
|
);
|
|
17695
17821
|
const useCompactInToolbar = !!compactDrawerMenu && allSelectableTabItems.length <= 1;
|
|
17696
|
-
const leftSelectableTabItems =
|
|
17822
|
+
const leftSelectableTabItems = useMemo48(
|
|
17697
17823
|
() => (leftTabItems ?? []).filter(isSelectableMenuItem),
|
|
17698
17824
|
[leftTabItems]
|
|
17699
17825
|
);
|
|
17700
|
-
const rightSelectableTabItems =
|
|
17826
|
+
const rightSelectableTabItems = useMemo48(
|
|
17701
17827
|
() => (rightTabItems ?? []).filter(isSelectableMenuItem),
|
|
17702
17828
|
[rightTabItems]
|
|
17703
17829
|
);
|
|
@@ -17734,14 +17860,14 @@ var DrawerWorkspaceLayout = memoGeneric(function DrawerWorkspaceLayout2({
|
|
|
17734
17860
|
activeValue: rightTabValue,
|
|
17735
17861
|
isSidebarCollapsed: rightSidebarCollapsed
|
|
17736
17862
|
} : { activeValue: void 0, isSidebarCollapsed: true };
|
|
17737
|
-
return /* @__PURE__ */
|
|
17863
|
+
return /* @__PURE__ */ React110.createElement(
|
|
17738
17864
|
"div",
|
|
17739
17865
|
{
|
|
17740
17866
|
ref: portalContainer,
|
|
17741
17867
|
id: EDITOR_PANEL_GROUP_ID,
|
|
17742
17868
|
className: "n-flex n-flex-1 n-relative focus:n-outline-none"
|
|
17743
17869
|
},
|
|
17744
|
-
hasTabs && !useCompactInToolbar && /* @__PURE__ */
|
|
17870
|
+
hasTabs && !useCompactInToolbar && /* @__PURE__ */ React110.createElement(React110.Fragment, null, /* @__PURE__ */ React110.createElement(
|
|
17745
17871
|
VerticalTabMenu,
|
|
17746
17872
|
{
|
|
17747
17873
|
tooltipSide: "right",
|
|
@@ -17750,8 +17876,8 @@ var DrawerWorkspaceLayout = memoGeneric(function DrawerWorkspaceLayout2({
|
|
|
17750
17876
|
isSidebarCollapsed,
|
|
17751
17877
|
onChange: (value) => handleSelectTab(value)
|
|
17752
17878
|
}
|
|
17753
|
-
), /* @__PURE__ */
|
|
17754
|
-
useCompactInToolbar && /* @__PURE__ */
|
|
17879
|
+
), /* @__PURE__ */ React110.createElement(DividerVertical, { className: "n-h-full" })),
|
|
17880
|
+
useCompactInToolbar && /* @__PURE__ */ React110.createElement("div", { className: "n-absolute n-top-0 n-left-0 n-h-[calc(var(--n-toolbar-height)+1px)] n-w-[calc(var(--n-toolbar-height)+1px)] n-bg-sidebar-background n-border-r n-border-b n-border-divider-strong n-z-10 n-flex n-items-center n-justify-center" }, allSelectableTabItems[0] && /* @__PURE__ */ React110.createElement(
|
|
17755
17881
|
Button,
|
|
17756
17882
|
{
|
|
17757
17883
|
variant: "none",
|
|
@@ -17774,8 +17900,8 @@ var DrawerWorkspaceLayout = memoGeneric(function DrawerWorkspaceLayout2({
|
|
|
17774
17900
|
}
|
|
17775
17901
|
}
|
|
17776
17902
|
)),
|
|
17777
|
-
/* @__PURE__ */
|
|
17778
|
-
leftPanel && /* @__PURE__ */
|
|
17903
|
+
/* @__PURE__ */ React110.createElement("div", { className: "n-flex-1 n-flex n-relative" }, centerPanel),
|
|
17904
|
+
leftPanel && /* @__PURE__ */ React110.createElement(
|
|
17779
17905
|
Drawer,
|
|
17780
17906
|
{
|
|
17781
17907
|
ref: leftSidebarRef,
|
|
@@ -17796,7 +17922,7 @@ var DrawerWorkspaceLayout = memoGeneric(function DrawerWorkspaceLayout2({
|
|
|
17796
17922
|
},
|
|
17797
17923
|
leftPanel
|
|
17798
17924
|
),
|
|
17799
|
-
rightPanel && /* @__PURE__ */
|
|
17925
|
+
rightPanel && /* @__PURE__ */ React110.createElement(
|
|
17800
17926
|
Drawer,
|
|
17801
17927
|
{
|
|
17802
17928
|
id: RIGHT_SIDEBAR_ID,
|
|
@@ -17822,7 +17948,7 @@ var DrawerWorkspaceLayout = memoGeneric(function DrawerWorkspaceLayout2({
|
|
|
17822
17948
|
});
|
|
17823
17949
|
|
|
17824
17950
|
// src/components/workspace/PanelWorkspaceLayout.tsx
|
|
17825
|
-
import
|
|
17951
|
+
import React111, { useCallback as useCallback39, useMemo as useMemo49, useRef as useRef29 } from "react";
|
|
17826
17952
|
import {
|
|
17827
17953
|
Panel,
|
|
17828
17954
|
PanelGroup,
|
|
@@ -17996,7 +18122,7 @@ var PanelWorkspaceLayout = memoGeneric(function PanelWorkspaceLayout2({
|
|
|
17996
18122
|
const hasLeftPanel = !!leftPanel;
|
|
17997
18123
|
const hasRightPanel = !!rightPanel;
|
|
17998
18124
|
const hasCenterPanel = !!centerPanel;
|
|
17999
|
-
const autoSaveId =
|
|
18125
|
+
const autoSaveId = useMemo49(() => {
|
|
18000
18126
|
return autoSavePrefix ? `${autoSavePrefix}--v2--${EDITOR_PANEL_GROUP_ID}` : Math.random().toString(36).substring(2, 15);
|
|
18001
18127
|
}, [autoSavePrefix]);
|
|
18002
18128
|
const layoutIds = getLayoutIds({
|
|
@@ -18023,7 +18149,7 @@ var PanelWorkspaceLayout = memoGeneric(function PanelWorkspaceLayout2({
|
|
|
18023
18149
|
});
|
|
18024
18150
|
const [data, setData] = usePersistentStateObject(clientStorage, storageKey, {});
|
|
18025
18151
|
const layoutGroup = data?.[propertyKey];
|
|
18026
|
-
const { leftSidebarCollapsed, rightSidebarCollapsed } =
|
|
18152
|
+
const { leftSidebarCollapsed, rightSidebarCollapsed } = useMemo49(() => {
|
|
18027
18153
|
return getLayoutCollapsedState({
|
|
18028
18154
|
layoutGroup,
|
|
18029
18155
|
propertyKey,
|
|
@@ -18084,7 +18210,7 @@ var PanelWorkspaceLayout = memoGeneric(function PanelWorkspaceLayout2({
|
|
|
18084
18210
|
const showLeftTabs = !!leftSidebarOptions.showTabs && !!leftTabItems && // When compact drawer UI is enabled, only show the rail when the
|
|
18085
18211
|
// sidebar is collapsed (for large screens/panel layout).
|
|
18086
18212
|
(!compactDrawerMenu || leftSidebarCollapsed);
|
|
18087
|
-
return /* @__PURE__ */
|
|
18213
|
+
return /* @__PURE__ */ React111.createElement(
|
|
18088
18214
|
PanelGroup,
|
|
18089
18215
|
{
|
|
18090
18216
|
ref: panelGroupRef,
|
|
@@ -18095,7 +18221,7 @@ var PanelWorkspaceLayout = memoGeneric(function PanelWorkspaceLayout2({
|
|
|
18095
18221
|
autoSaveId,
|
|
18096
18222
|
onLayout: handleLayoutChange
|
|
18097
18223
|
},
|
|
18098
|
-
leftPanel && /* @__PURE__ */
|
|
18224
|
+
leftPanel && /* @__PURE__ */ React111.createElement(React111.Fragment, null, showLeftTabs && /* @__PURE__ */ React111.createElement(
|
|
18099
18225
|
VerticalTabMenu,
|
|
18100
18226
|
{
|
|
18101
18227
|
tooltipSide: "right",
|
|
@@ -18104,7 +18230,7 @@ var PanelWorkspaceLayout = memoGeneric(function PanelWorkspaceLayout2({
|
|
|
18104
18230
|
isSidebarCollapsed: leftSidebarCollapsed,
|
|
18105
18231
|
onChange: handleLeftTabChange
|
|
18106
18232
|
}
|
|
18107
|
-
), showLeftTabs && !leftSidebarCollapsed && /* @__PURE__ */
|
|
18233
|
+
), showLeftTabs && !leftSidebarCollapsed && /* @__PURE__ */ React111.createElement(DividerVertical, { className: "n-h-full" }), /* @__PURE__ */ React111.createElement(
|
|
18108
18234
|
Panel,
|
|
18109
18235
|
{
|
|
18110
18236
|
id: LEFT_SIDEBAR_ID,
|
|
@@ -18117,8 +18243,8 @@ var PanelWorkspaceLayout = memoGeneric(function PanelWorkspaceLayout2({
|
|
|
18117
18243
|
collapsible: true
|
|
18118
18244
|
},
|
|
18119
18245
|
leftSidebarCollapsed ? null : leftPanel
|
|
18120
|
-
), /* @__PURE__ */
|
|
18121
|
-
/* @__PURE__ */
|
|
18246
|
+
), /* @__PURE__ */ React111.createElement(PanelResizeHandle, { className: "n-cursor-col-resize n-w-px n-h-full n-bg-divider" })),
|
|
18247
|
+
/* @__PURE__ */ React111.createElement(
|
|
18122
18248
|
Panel,
|
|
18123
18249
|
{
|
|
18124
18250
|
id: CONTENT_AREA_ID,
|
|
@@ -18129,7 +18255,7 @@ var PanelWorkspaceLayout = memoGeneric(function PanelWorkspaceLayout2({
|
|
|
18129
18255
|
},
|
|
18130
18256
|
centerPanel
|
|
18131
18257
|
),
|
|
18132
|
-
rightPanel && /* @__PURE__ */
|
|
18258
|
+
rightPanel && /* @__PURE__ */ React111.createElement(React111.Fragment, null, /* @__PURE__ */ React111.createElement(PanelResizeHandle, { className: "n-cursor-col-resize n-w-px n-h-full n-bg-divider" }), /* @__PURE__ */ React111.createElement(
|
|
18133
18259
|
Panel,
|
|
18134
18260
|
{
|
|
18135
18261
|
id: RIGHT_SIDEBAR_ID,
|
|
@@ -18142,7 +18268,7 @@ var PanelWorkspaceLayout = memoGeneric(function PanelWorkspaceLayout2({
|
|
|
18142
18268
|
collapsible: true
|
|
18143
18269
|
},
|
|
18144
18270
|
rightSidebarCollapsed ? null : rightPanel
|
|
18145
|
-
), rightSidebarOptions.showTabs && rightTabItems && !rightSidebarCollapsed && /* @__PURE__ */
|
|
18271
|
+
), rightSidebarOptions.showTabs && rightTabItems && !rightSidebarCollapsed && /* @__PURE__ */ React111.createElement(DividerVertical, { className: "n-h-full" }), rightSidebarOptions.showTabs && rightTabItems && /* @__PURE__ */ React111.createElement(
|
|
18146
18272
|
VerticalTabMenu,
|
|
18147
18273
|
{
|
|
18148
18274
|
tooltipSide: "left",
|
|
@@ -18202,6 +18328,10 @@ var WorkspaceLayout = forwardRefGeneric(function WorkspaceLayout2({
|
|
|
18202
18328
|
className,
|
|
18203
18329
|
style: style2,
|
|
18204
18330
|
toolbar,
|
|
18331
|
+
toolbarVariant = "default",
|
|
18332
|
+
overlayToolbarLeft,
|
|
18333
|
+
overlayToolbarRight,
|
|
18334
|
+
overlayLayout,
|
|
18205
18335
|
children,
|
|
18206
18336
|
sideType = "auto",
|
|
18207
18337
|
sideTypeBreakpoint = 800,
|
|
@@ -18231,7 +18361,7 @@ var WorkspaceLayout = forwardRefGeneric(function WorkspaceLayout2({
|
|
|
18231
18361
|
theme,
|
|
18232
18362
|
compactDrawerMenu
|
|
18233
18363
|
}, forwardedRef) {
|
|
18234
|
-
const containerRef =
|
|
18364
|
+
const containerRef = React112.useRef(null);
|
|
18235
18365
|
const containerSize = useSize(containerRef);
|
|
18236
18366
|
const windowSize = useWindowSize();
|
|
18237
18367
|
const parentSize = detectSize === "window" ? windowSize : containerSize && containerSize.width > 0 ? containerSize : windowSize;
|
|
@@ -18342,46 +18472,46 @@ var WorkspaceLayout = forwardRefGeneric(function WorkspaceLayout2({
|
|
|
18342
18472
|
rightSidebarRef.current?.collapse();
|
|
18343
18473
|
}
|
|
18344
18474
|
}, [isDrawerActive]);
|
|
18345
|
-
const leftChildrenProps =
|
|
18475
|
+
const leftChildrenProps = useMemo50(() => {
|
|
18346
18476
|
return {
|
|
18347
18477
|
activeTabValue: leftTabValue,
|
|
18348
18478
|
closeSidebar: closeLeftSidebar
|
|
18349
18479
|
};
|
|
18350
18480
|
}, [leftTabValue, closeLeftSidebar]);
|
|
18351
|
-
const rightChildrenProps =
|
|
18481
|
+
const rightChildrenProps = useMemo50(() => {
|
|
18352
18482
|
return {
|
|
18353
18483
|
activeTabValue: rightTabValue,
|
|
18354
18484
|
closeSidebar: closeRightSidebar
|
|
18355
18485
|
};
|
|
18356
18486
|
}, [rightTabValue, closeRightSidebar]);
|
|
18357
|
-
const leftSidebarProviderValue =
|
|
18487
|
+
const leftSidebarProviderValue = useMemo50(() => {
|
|
18358
18488
|
return {
|
|
18359
18489
|
closeSidebar: closeLeftSidebar
|
|
18360
18490
|
};
|
|
18361
18491
|
}, [closeLeftSidebar]);
|
|
18362
|
-
const rightSidebarProviderValue =
|
|
18492
|
+
const rightSidebarProviderValue = useMemo50(() => {
|
|
18363
18493
|
return {
|
|
18364
18494
|
closeSidebar: closeRightSidebar
|
|
18365
18495
|
};
|
|
18366
18496
|
}, [closeRightSidebar]);
|
|
18367
|
-
const leftPanel = left && leftVisible !== false ? /* @__PURE__ */
|
|
18497
|
+
const leftPanel = left && leftVisible !== false ? /* @__PURE__ */ React112.createElement(
|
|
18368
18498
|
PanelInner,
|
|
18369
18499
|
{
|
|
18370
18500
|
style: leftStyle,
|
|
18371
18501
|
className: cx("n-bg-sidebar-background n-flex-col", leftClassName)
|
|
18372
18502
|
},
|
|
18373
|
-
/* @__PURE__ */
|
|
18503
|
+
/* @__PURE__ */ React112.createElement(WorkspaceSideProvider, { value: leftSidebarProviderValue }, leftTabValue ? renderPanelChildren(left, leftChildrenProps) : null)
|
|
18374
18504
|
) : null;
|
|
18375
|
-
const rightPanel = right && rightVisible !== false ? /* @__PURE__ */
|
|
18505
|
+
const rightPanel = right && rightVisible !== false ? /* @__PURE__ */ React112.createElement(
|
|
18376
18506
|
PanelInner,
|
|
18377
18507
|
{
|
|
18378
18508
|
style: rightStyle,
|
|
18379
18509
|
className: cx("n-bg-sidebar-background n-flex-col", rightClassName)
|
|
18380
18510
|
},
|
|
18381
|
-
/* @__PURE__ */
|
|
18511
|
+
/* @__PURE__ */ React112.createElement(WorkspaceSideProvider, { value: rightSidebarProviderValue }, rightTabValue ? renderPanelChildren(right, rightChildrenProps) : null)
|
|
18382
18512
|
) : null;
|
|
18383
|
-
const centerPanel = /* @__PURE__ */
|
|
18384
|
-
const leftSidebarOptions =
|
|
18513
|
+
const centerPanel = /* @__PURE__ */ React112.createElement(PanelInner, { className: "n-bg-canvas-background" }, children);
|
|
18514
|
+
const leftSidebarOptions = useMemo50(
|
|
18385
18515
|
() => ({
|
|
18386
18516
|
minSize: leftSidebarMinPercentage,
|
|
18387
18517
|
maxSize: leftSidebarMaxPercentage,
|
|
@@ -18399,7 +18529,7 @@ var WorkspaceLayout = forwardRefGeneric(function WorkspaceLayout2({
|
|
|
18399
18529
|
leftShowTabs
|
|
18400
18530
|
]
|
|
18401
18531
|
);
|
|
18402
|
-
const rightSidebarOptions =
|
|
18532
|
+
const rightSidebarOptions = useMemo50(
|
|
18403
18533
|
() => ({
|
|
18404
18534
|
minSize: rightSidebarMinPercentage,
|
|
18405
18535
|
maxSize: rightSidebarMaxPercentage,
|
|
@@ -18419,7 +18549,8 @@ var WorkspaceLayout = forwardRefGeneric(function WorkspaceLayout2({
|
|
|
18419
18549
|
);
|
|
18420
18550
|
const LayoutComponent = sideType === "panel" ? PanelWorkspaceLayout : sideType === "drawer" ? DrawerWorkspaceLayout : parentSize.width > sideTypeBreakpoint ? PanelWorkspaceLayout : DrawerWorkspaceLayout;
|
|
18421
18551
|
const readyToRender = detectSize === "window" || containerSize && containerSize.width > 0;
|
|
18422
|
-
|
|
18552
|
+
const isOverlay = toolbarVariant === "overlay";
|
|
18553
|
+
return /* @__PURE__ */ React112.createElement(
|
|
18423
18554
|
"div",
|
|
18424
18555
|
{
|
|
18425
18556
|
ref: containerRef,
|
|
@@ -18431,8 +18562,8 @@ var WorkspaceLayout = forwardRefGeneric(function WorkspaceLayout2({
|
|
|
18431
18562
|
style: style2,
|
|
18432
18563
|
"data-theme": theme
|
|
18433
18564
|
},
|
|
18434
|
-
toolbar,
|
|
18435
|
-
/* @__PURE__ */
|
|
18565
|
+
!isOverlay && toolbar,
|
|
18566
|
+
/* @__PURE__ */ React112.createElement("div", { className: "n-flex n-flex-row n-flex-1 n-relative" }, readyToRender && /* @__PURE__ */ React112.createElement(React112.Fragment, null, /* @__PURE__ */ React112.createElement(
|
|
18436
18567
|
LayoutComponent,
|
|
18437
18568
|
{
|
|
18438
18569
|
leftPanel,
|
|
@@ -18452,7 +18583,14 @@ var WorkspaceLayout = forwardRefGeneric(function WorkspaceLayout2({
|
|
|
18452
18583
|
rightSidebarRef,
|
|
18453
18584
|
compactDrawerMenu
|
|
18454
18585
|
}
|
|
18455
|
-
)
|
|
18586
|
+
), isOverlay && /* @__PURE__ */ React112.createElement(
|
|
18587
|
+
OverlayToolbar,
|
|
18588
|
+
{
|
|
18589
|
+
left: overlayToolbarLeft,
|
|
18590
|
+
right: overlayToolbarRight,
|
|
18591
|
+
overlayLayout
|
|
18592
|
+
}
|
|
18593
|
+
)))
|
|
18456
18594
|
);
|
|
18457
18595
|
});
|
|
18458
18596
|
var PanelInner = memo36(function PanelInner2({
|
|
@@ -18460,7 +18598,7 @@ var PanelInner = memo36(function PanelInner2({
|
|
|
18460
18598
|
style: style2,
|
|
18461
18599
|
className
|
|
18462
18600
|
}) {
|
|
18463
|
-
return /* @__PURE__ */
|
|
18601
|
+
return /* @__PURE__ */ React112.createElement(
|
|
18464
18602
|
"div",
|
|
18465
18603
|
{
|
|
18466
18604
|
style: style2,
|
|
@@ -18475,22 +18613,22 @@ function getFirstTabValue(items, defaultValue2) {
|
|
|
18475
18613
|
}
|
|
18476
18614
|
|
|
18477
18615
|
// src/contexts/ImageDataContext.tsx
|
|
18478
|
-
import * as
|
|
18479
|
-
var ImageDataContext =
|
|
18616
|
+
import * as React113 from "react";
|
|
18617
|
+
var ImageDataContext = React113.createContext(
|
|
18480
18618
|
void 0
|
|
18481
18619
|
);
|
|
18482
|
-
var ImageDataProvider =
|
|
18620
|
+
var ImageDataProvider = React113.memo(function ImageDataProvider2({
|
|
18483
18621
|
children,
|
|
18484
18622
|
getImageData
|
|
18485
18623
|
}) {
|
|
18486
|
-
const contextValue =
|
|
18624
|
+
const contextValue = React113.useMemo(
|
|
18487
18625
|
() => ({ getImageData: getImageData ?? (() => void 0) }),
|
|
18488
18626
|
[getImageData]
|
|
18489
18627
|
);
|
|
18490
|
-
return /* @__PURE__ */
|
|
18628
|
+
return /* @__PURE__ */ React113.createElement(ImageDataContext.Provider, { value: contextValue }, children);
|
|
18491
18629
|
});
|
|
18492
18630
|
function useImageData(ref) {
|
|
18493
|
-
const value =
|
|
18631
|
+
const value = React113.useContext(ImageDataContext);
|
|
18494
18632
|
if (!value) {
|
|
18495
18633
|
throw new Error("Missing ImageDataProvider");
|
|
18496
18634
|
}
|
|
@@ -18541,6 +18679,24 @@ function useTheme() {
|
|
|
18541
18679
|
|
|
18542
18680
|
// src/theme/proseTheme.ts
|
|
18543
18681
|
var proseTheme = "n-prose n-prose-sm n-max-w-none [[data-theme='dark']_&]:n-prose-invert prose-a:n-text-blue-600";
|
|
18682
|
+
var whiteboardProseTheme = (isDark) => [
|
|
18683
|
+
"n-prose",
|
|
18684
|
+
"n-prose-sm",
|
|
18685
|
+
"n-max-w-none",
|
|
18686
|
+
isDark ? "n-prose-invert n-text-white" : "",
|
|
18687
|
+
"prose-p:n-m-0",
|
|
18688
|
+
"prose-ul:n-m-0",
|
|
18689
|
+
"prose-ol:n-m-0",
|
|
18690
|
+
"prose-li:n-m-0",
|
|
18691
|
+
"prose-li:n-p-0",
|
|
18692
|
+
"prose-a:n-text-inherit",
|
|
18693
|
+
"prose-strong:n-text-inherit",
|
|
18694
|
+
"prose-em:n-italic",
|
|
18695
|
+
"prose-ol:n-list-inside",
|
|
18696
|
+
"prose-ul:n-list-inside",
|
|
18697
|
+
"prose-ol:n-pl-0",
|
|
18698
|
+
"prose-ul:n-pl-0"
|
|
18699
|
+
].join(" ");
|
|
18544
18700
|
|
|
18545
18701
|
// src/utils/createSectionedMenu.ts
|
|
18546
18702
|
function withSeparators(elements2, separator2) {
|
|
@@ -18644,11 +18800,11 @@ var SUPPORTED_CANVAS_UPLOAD_TYPES = [
|
|
|
18644
18800
|
|
|
18645
18801
|
// src/components/DimensionInput.tsx
|
|
18646
18802
|
import { round as round2 } from "@noya-app/noya-utils";
|
|
18647
|
-
import * as
|
|
18803
|
+
import * as React114 from "react";
|
|
18648
18804
|
function getNewValue(value, mode, delta) {
|
|
18649
18805
|
return delta === void 0 ? value : mode === "replace" ? delta : value + delta;
|
|
18650
18806
|
}
|
|
18651
|
-
var DimensionInput =
|
|
18807
|
+
var DimensionInput = React114.memo(function DimensionInput2({
|
|
18652
18808
|
id,
|
|
18653
18809
|
value,
|
|
18654
18810
|
onSetValue,
|
|
@@ -18658,15 +18814,15 @@ var DimensionInput = React112.memo(function DimensionInput2({
|
|
|
18658
18814
|
disabled,
|
|
18659
18815
|
trigger = "submit"
|
|
18660
18816
|
}) {
|
|
18661
|
-
const handleNudgeValue =
|
|
18817
|
+
const handleNudgeValue = React114.useCallback(
|
|
18662
18818
|
(value2) => onSetValue(value2, "adjust"),
|
|
18663
18819
|
[onSetValue]
|
|
18664
18820
|
);
|
|
18665
|
-
const handleSetValue =
|
|
18821
|
+
const handleSetValue = React114.useCallback(
|
|
18666
18822
|
(value2) => onSetValue(value2, "replace"),
|
|
18667
18823
|
[onSetValue]
|
|
18668
18824
|
);
|
|
18669
|
-
return /* @__PURE__ */
|
|
18825
|
+
return /* @__PURE__ */ React114.createElement(LabeledField, { label, labelType: "inset" }, /* @__PURE__ */ React114.createElement(InputField2.Root, { id, width: size }, /* @__PURE__ */ React114.createElement(
|
|
18670
18826
|
InputField2.NumberInput,
|
|
18671
18827
|
{
|
|
18672
18828
|
value: value === void 0 ? value : round2(value, 2),
|
|
@@ -18693,11 +18849,11 @@ __export(InspectorPrimitives_exports, {
|
|
|
18693
18849
|
Title: () => Title,
|
|
18694
18850
|
VerticalSeparator: () => VerticalSeparator
|
|
18695
18851
|
});
|
|
18696
|
-
import
|
|
18852
|
+
import React115, {
|
|
18697
18853
|
forwardRef as forwardRef29,
|
|
18698
18854
|
memo as memo39
|
|
18699
18855
|
} from "react";
|
|
18700
|
-
var Section2 = forwardRef29(({ className, ...props }, ref) => /* @__PURE__ */
|
|
18856
|
+
var Section2 = forwardRef29(({ className, ...props }, ref) => /* @__PURE__ */ React115.createElement(
|
|
18701
18857
|
"div",
|
|
18702
18858
|
{
|
|
18703
18859
|
ref,
|
|
@@ -18705,8 +18861,8 @@ var Section2 = forwardRef29(({ className, ...props }, ref) => /* @__PURE__ */ Re
|
|
|
18705
18861
|
...props
|
|
18706
18862
|
}
|
|
18707
18863
|
));
|
|
18708
|
-
var SectionHeader2 = forwardRef29(({ className, ...props }, ref) => /* @__PURE__ */
|
|
18709
|
-
var Title = forwardRef29(({ className, $textStyle, ...props }, ref) => /* @__PURE__ */
|
|
18864
|
+
var SectionHeader2 = forwardRef29(({ className, ...props }, ref) => /* @__PURE__ */ React115.createElement("div", { ref, className: cx(`n-flex n-items-center`, className), ...props }));
|
|
18865
|
+
var Title = forwardRef29(({ className, $textStyle, ...props }, ref) => /* @__PURE__ */ React115.createElement(
|
|
18710
18866
|
"div",
|
|
18711
18867
|
{
|
|
18712
18868
|
ref,
|
|
@@ -18717,7 +18873,7 @@ var Title = forwardRef29(({ className, $textStyle, ...props }, ref) => /* @__PUR
|
|
|
18717
18873
|
...props
|
|
18718
18874
|
}
|
|
18719
18875
|
));
|
|
18720
|
-
var Row = forwardRef29(({ className, ...props }, ref) => /* @__PURE__ */
|
|
18876
|
+
var Row = forwardRef29(({ className, ...props }, ref) => /* @__PURE__ */ React115.createElement(
|
|
18721
18877
|
"div",
|
|
18722
18878
|
{
|
|
18723
18879
|
ref,
|
|
@@ -18725,7 +18881,7 @@ var Row = forwardRef29(({ className, ...props }, ref) => /* @__PURE__ */ React11
|
|
|
18725
18881
|
...props
|
|
18726
18882
|
}
|
|
18727
18883
|
));
|
|
18728
|
-
var Column = forwardRef29(({ className, ...props }, ref) => /* @__PURE__ */
|
|
18884
|
+
var Column = forwardRef29(({ className, ...props }, ref) => /* @__PURE__ */ React115.createElement(
|
|
18729
18885
|
"div",
|
|
18730
18886
|
{
|
|
18731
18887
|
ref,
|
|
@@ -18733,7 +18889,7 @@ var Column = forwardRef29(({ className, ...props }, ref) => /* @__PURE__ */ Reac
|
|
|
18733
18889
|
...props
|
|
18734
18890
|
}
|
|
18735
18891
|
));
|
|
18736
|
-
var Checkbox3 = forwardRef29(({ className, ...props }, ref) => /* @__PURE__ */
|
|
18892
|
+
var Checkbox3 = forwardRef29(({ className, ...props }, ref) => /* @__PURE__ */ React115.createElement(
|
|
18737
18893
|
"input",
|
|
18738
18894
|
{
|
|
18739
18895
|
ref,
|
|
@@ -18742,7 +18898,7 @@ var Checkbox3 = forwardRef29(({ className, ...props }, ref) => /* @__PURE__ */ R
|
|
|
18742
18898
|
...props
|
|
18743
18899
|
}
|
|
18744
18900
|
));
|
|
18745
|
-
var Text3 = forwardRef29(({ className, ...props }, ref) => /* @__PURE__ */
|
|
18901
|
+
var Text3 = forwardRef29(({ className, ...props }, ref) => /* @__PURE__ */ React115.createElement(
|
|
18746
18902
|
"span",
|
|
18747
18903
|
{
|
|
18748
18904
|
ref,
|
|
@@ -18750,14 +18906,14 @@ var Text3 = forwardRef29(({ className, ...props }, ref) => /* @__PURE__ */ React
|
|
|
18750
18906
|
...props
|
|
18751
18907
|
}
|
|
18752
18908
|
));
|
|
18753
|
-
var VerticalSeparator = () => /* @__PURE__ */
|
|
18754
|
-
var HorizontalSeparator = () => /* @__PURE__ */
|
|
18909
|
+
var VerticalSeparator = () => /* @__PURE__ */ React115.createElement(Spacer.Vertical, { size: "inspector-v-separator" });
|
|
18910
|
+
var HorizontalSeparator = () => /* @__PURE__ */ React115.createElement(Spacer.Horizontal, { size: "inspector-h-separator" });
|
|
18755
18911
|
var RowLabel = forwardRef29(function RowLabel2({
|
|
18756
18912
|
className,
|
|
18757
18913
|
$textStyle,
|
|
18758
18914
|
...props
|
|
18759
18915
|
}, ref) {
|
|
18760
|
-
return /* @__PURE__ */
|
|
18916
|
+
return /* @__PURE__ */ React115.createElement(
|
|
18761
18917
|
"label",
|
|
18762
18918
|
{
|
|
18763
18919
|
ref,
|
|
@@ -18777,7 +18933,7 @@ var LabeledRow = memo39(function LabeledRow2({
|
|
|
18777
18933
|
right,
|
|
18778
18934
|
className
|
|
18779
18935
|
}) {
|
|
18780
|
-
return /* @__PURE__ */
|
|
18936
|
+
return /* @__PURE__ */ React115.createElement(Row, { id, className }, /* @__PURE__ */ React115.createElement(Column, null, /* @__PURE__ */ React115.createElement(RowLabel, { $textStyle: labelTextStyle }, label, right && /* @__PURE__ */ React115.createElement(Spacer.Horizontal, null), right), /* @__PURE__ */ React115.createElement(Row, null, children)));
|
|
18781
18937
|
});
|
|
18782
18938
|
export {
|
|
18783
18939
|
AIAssistantInput,
|
|
@@ -18835,6 +18991,7 @@ export {
|
|
|
18835
18991
|
FullscreenDialog,
|
|
18836
18992
|
GlobalInputBlurProvider,
|
|
18837
18993
|
Grid,
|
|
18994
|
+
GridBackground,
|
|
18838
18995
|
GridView,
|
|
18839
18996
|
Heading1,
|
|
18840
18997
|
Heading2,
|
|
@@ -18870,6 +19027,7 @@ export {
|
|
|
18870
19027
|
Message,
|
|
18871
19028
|
Navigator,
|
|
18872
19029
|
OpenPortalsProvider,
|
|
19030
|
+
OverlayToolbar,
|
|
18873
19031
|
PipelineResultLayout,
|
|
18874
19032
|
PipelineResultLink,
|
|
18875
19033
|
Popover,
|
|
@@ -18972,8 +19130,10 @@ export {
|
|
|
18972
19130
|
separator,
|
|
18973
19131
|
styles,
|
|
18974
19132
|
textStyles,
|
|
19133
|
+
toolbarTransparentStyle,
|
|
18975
19134
|
updateSelection,
|
|
18976
19135
|
useAutoResize,
|
|
19136
|
+
useBindKeyboardShortcutsForMenuItems,
|
|
18977
19137
|
useComboboxState,
|
|
18978
19138
|
useCurrentFloatingWindowInternal,
|
|
18979
19139
|
useDesignSystemConfiguration,
|
|
@@ -19004,6 +19164,7 @@ export {
|
|
|
19004
19164
|
useTheme,
|
|
19005
19165
|
useWorkspaceSide,
|
|
19006
19166
|
validateDropIndicator,
|
|
19167
|
+
whiteboardProseTheme,
|
|
19007
19168
|
withDragProvider,
|
|
19008
19169
|
withSeparatorElements
|
|
19009
19170
|
};
|