@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.js
CHANGED
|
@@ -3176,6 +3176,7 @@ __export(src_exports, {
|
|
|
3176
3176
|
FullscreenDialog: () => FullscreenDialog,
|
|
3177
3177
|
GlobalInputBlurProvider: () => GlobalInputBlurProvider,
|
|
3178
3178
|
Grid: () => Grid,
|
|
3179
|
+
GridBackground: () => GridBackground,
|
|
3179
3180
|
GridView: () => GridView,
|
|
3180
3181
|
Heading1: () => Heading1,
|
|
3181
3182
|
Heading2: () => Heading2,
|
|
@@ -3211,6 +3212,7 @@ __export(src_exports, {
|
|
|
3211
3212
|
Message: () => Message,
|
|
3212
3213
|
Navigator: () => Navigator,
|
|
3213
3214
|
OpenPortalsProvider: () => OpenPortalsProvider,
|
|
3215
|
+
OverlayToolbar: () => OverlayToolbar,
|
|
3214
3216
|
PipelineResultLayout: () => PipelineResultLayout,
|
|
3215
3217
|
PipelineResultLink: () => PipelineResultLink,
|
|
3216
3218
|
Popover: () => Popover,
|
|
@@ -3313,8 +3315,10 @@ __export(src_exports, {
|
|
|
3313
3315
|
separator: () => separator,
|
|
3314
3316
|
styles: () => styles,
|
|
3315
3317
|
textStyles: () => textStyles,
|
|
3318
|
+
toolbarTransparentStyle: () => toolbarTransparentStyle,
|
|
3316
3319
|
updateSelection: () => updateSelection,
|
|
3317
3320
|
useAutoResize: () => useAutoResize,
|
|
3321
|
+
useBindKeyboardShortcutsForMenuItems: () => useBindKeyboardShortcutsForMenuItems,
|
|
3318
3322
|
useComboboxState: () => useComboboxState,
|
|
3319
3323
|
useCurrentFloatingWindowInternal: () => useCurrentFloatingWindowInternal,
|
|
3320
3324
|
useDesignSystemConfiguration: () => useDesignSystemConfiguration,
|
|
@@ -3345,6 +3349,7 @@ __export(src_exports, {
|
|
|
3345
3349
|
useTheme: () => useTheme,
|
|
3346
3350
|
useWorkspaceSide: () => useWorkspaceSide,
|
|
3347
3351
|
validateDropIndicator: () => validateDropIndicator,
|
|
3352
|
+
whiteboardProseTheme: () => whiteboardProseTheme,
|
|
3348
3353
|
withDragProvider: () => withDragProvider,
|
|
3349
3354
|
withSeparatorElements: () => withSeparatorElements
|
|
3350
3355
|
});
|
|
@@ -6142,7 +6147,8 @@ var DropdownMenuRoot = forwardRefGeneric(function DropdownMenuRoot2(props, forwa
|
|
|
6142
6147
|
emptyState,
|
|
6143
6148
|
contentStyle,
|
|
6144
6149
|
title,
|
|
6145
|
-
icon
|
|
6150
|
+
icon,
|
|
6151
|
+
modal = true
|
|
6146
6152
|
} = props;
|
|
6147
6153
|
const [open, setOpen] = useControlledOrUncontrolled({
|
|
6148
6154
|
value: openProp,
|
|
@@ -6163,7 +6169,7 @@ var DropdownMenuRoot = forwardRefGeneric(function DropdownMenuRoot2(props, forwa
|
|
|
6163
6169
|
}),
|
|
6164
6170
|
[contentStyle]
|
|
6165
6171
|
);
|
|
6166
|
-
return /* @__PURE__ */ import_react38.default.createElement(import_radix_ui5.DropdownMenu.Root, { onOpenChange: setOpen, open }, /* @__PURE__ */ import_react38.default.createElement(
|
|
6172
|
+
return /* @__PURE__ */ import_react38.default.createElement(import_radix_ui5.DropdownMenu.Root, { onOpenChange: setOpen, open, modal }, /* @__PURE__ */ import_react38.default.createElement(
|
|
6167
6173
|
import_radix_ui5.DropdownMenu.Trigger,
|
|
6168
6174
|
{
|
|
6169
6175
|
ref: forwardedRef,
|
|
@@ -10728,17 +10734,22 @@ var getContrastRatio = (luminance1, luminance2) => {
|
|
|
10728
10734
|
};
|
|
10729
10735
|
var WHITE_LUMINANCE = 1;
|
|
10730
10736
|
var BLACK_LUMINANCE = 0;
|
|
10731
|
-
var
|
|
10737
|
+
var getContrastRatiosForBackground = (backgroundColor) => {
|
|
10732
10738
|
try {
|
|
10733
10739
|
const bgRgba = parseColorToRgba(backgroundColor);
|
|
10734
10740
|
const bgLuminance = getRelativeLuminance(bgRgba.r, bgRgba.g, bgRgba.b);
|
|
10735
10741
|
const contrastWithWhite = getContrastRatio(bgLuminance, WHITE_LUMINANCE);
|
|
10736
10742
|
const contrastWithBlack = getContrastRatio(bgLuminance, BLACK_LUMINANCE);
|
|
10737
|
-
return contrastWithWhite
|
|
10743
|
+
return { contrastWithWhite, contrastWithBlack };
|
|
10738
10744
|
} catch (error) {
|
|
10739
|
-
return
|
|
10745
|
+
return null;
|
|
10740
10746
|
}
|
|
10741
10747
|
};
|
|
10748
|
+
var getContrastColorForBackground = (backgroundColor) => {
|
|
10749
|
+
const ratios = getContrastRatiosForBackground(backgroundColor);
|
|
10750
|
+
if (!ratios) return "#000000";
|
|
10751
|
+
return ratios.contrastWithWhite >= ratios.contrastWithBlack ? "#ffffff" : "#000000";
|
|
10752
|
+
};
|
|
10742
10753
|
|
|
10743
10754
|
// ../noya-color/src/cssColor.ts
|
|
10744
10755
|
var import_noya_geometry2 = require("@noya-app/noya-geometry");
|
|
@@ -15226,10 +15237,42 @@ var FloatingWindow = ({
|
|
|
15226
15237
|
);
|
|
15227
15238
|
};
|
|
15228
15239
|
|
|
15229
|
-
// src/components/
|
|
15240
|
+
// src/components/GridBackground.tsx
|
|
15241
|
+
var import_noya_geometry4 = require("@noya-app/noya-geometry");
|
|
15230
15242
|
var import_react84 = __toESM(require("react"));
|
|
15231
|
-
var
|
|
15232
|
-
|
|
15243
|
+
var GridBackground = ({
|
|
15244
|
+
transform = import_noya_geometry4.AffineTransform.identity,
|
|
15245
|
+
gridSize: gridSizeProp = 10,
|
|
15246
|
+
dotSize = 1
|
|
15247
|
+
}) => {
|
|
15248
|
+
const scale = transform.scaleComponents.x;
|
|
15249
|
+
const isScaling = scale !== 1 && transform.scaleComponents.y !== 1;
|
|
15250
|
+
const gridSize = isScaling && scale > 1 ? gridSizeProp * scale : gridSizeProp;
|
|
15251
|
+
return /* @__PURE__ */ import_react84.default.createElement("div", { className: "n-absolute n-inset-0 n-pointer-events-none n-overflow-hidden" }, /* @__PURE__ */ import_react84.default.createElement(
|
|
15252
|
+
"svg",
|
|
15253
|
+
{
|
|
15254
|
+
className: "n-absolute n-inset-0 n-w-full n-h-full",
|
|
15255
|
+
style: { opacity: 0.5 }
|
|
15256
|
+
},
|
|
15257
|
+
/* @__PURE__ */ import_react84.default.createElement("defs", null, /* @__PURE__ */ import_react84.default.createElement(
|
|
15258
|
+
"pattern",
|
|
15259
|
+
{
|
|
15260
|
+
id: "dot-pattern",
|
|
15261
|
+
width: gridSize,
|
|
15262
|
+
height: gridSize,
|
|
15263
|
+
patternUnits: "userSpaceOnUse",
|
|
15264
|
+
patternTransform: `translate(${transform.tx % gridSize} ${transform.ty % gridSize})`
|
|
15265
|
+
},
|
|
15266
|
+
/* @__PURE__ */ import_react84.default.createElement("rect", { x: 0, y: 0, width: dotSize, height: dotSize, fill: "#9ca3af" })
|
|
15267
|
+
)),
|
|
15268
|
+
/* @__PURE__ */ import_react84.default.createElement("rect", { width: "100%", height: "100%", fill: "url(#dot-pattern)" })
|
|
15269
|
+
));
|
|
15270
|
+
};
|
|
15271
|
+
|
|
15272
|
+
// src/components/InspectorContainer.tsx
|
|
15273
|
+
var import_react85 = __toESM(require("react"));
|
|
15274
|
+
var InspectorContainer = (0, import_react85.memo)(
|
|
15275
|
+
(0, import_react85.forwardRef)(function InspectorContainer2({
|
|
15233
15276
|
header,
|
|
15234
15277
|
children,
|
|
15235
15278
|
fallback,
|
|
@@ -15238,7 +15281,7 @@ var InspectorContainer = (0, import_react84.memo)(
|
|
|
15238
15281
|
className,
|
|
15239
15282
|
style: style2
|
|
15240
15283
|
}, forwardedRef) {
|
|
15241
|
-
return /* @__PURE__ */
|
|
15284
|
+
return /* @__PURE__ */ import_react85.default.createElement(
|
|
15242
15285
|
"div",
|
|
15243
15286
|
{
|
|
15244
15287
|
ref: forwardedRef,
|
|
@@ -15253,32 +15296,32 @@ var InspectorContainer = (0, import_react84.memo)(
|
|
|
15253
15296
|
}
|
|
15254
15297
|
},
|
|
15255
15298
|
header,
|
|
15256
|
-
children ? /* @__PURE__ */
|
|
15299
|
+
children ? /* @__PURE__ */ import_react85.default.createElement(ScrollArea, null, /* @__PURE__ */ import_react85.default.createElement("div", { className: "n-flex n-flex-col n-relative" }, showDividers ? withSeparatorElements(children, /* @__PURE__ */ import_react85.default.createElement(Divider, null)) : children)) : fallback ? /* @__PURE__ */ import_react85.default.createElement("div", { className: "n-flex n-flex-col n-relative n-h-full" }, fallback) : null
|
|
15257
15300
|
);
|
|
15258
15301
|
})
|
|
15259
15302
|
);
|
|
15260
15303
|
|
|
15261
15304
|
// src/components/LabeledElementView.tsx
|
|
15262
15305
|
var kiwi = __toESM(require("kiwi.js"));
|
|
15263
|
-
var
|
|
15264
|
-
var LabeledElementView =
|
|
15306
|
+
var React82 = __toESM(require("react"));
|
|
15307
|
+
var LabeledElementView = React82.memo(function LabeledElementView2({
|
|
15265
15308
|
children,
|
|
15266
15309
|
renderLabel
|
|
15267
15310
|
}) {
|
|
15268
|
-
const elementIds =
|
|
15269
|
-
(child) =>
|
|
15311
|
+
const elementIds = React82.Children.toArray(children).flatMap(
|
|
15312
|
+
(child) => React82.isValidElement(child) && child.type === React82.Fragment ? child.props.children : [child]
|
|
15270
15313
|
).map(
|
|
15271
|
-
(child) =>
|
|
15314
|
+
(child) => React82.isValidElement(child) && "id" in child.props ? child.props.id : null
|
|
15272
15315
|
).filter((id) => !!id);
|
|
15273
15316
|
const serializedIds = elementIds.join(",");
|
|
15274
|
-
const containerRef =
|
|
15275
|
-
const refs =
|
|
15317
|
+
const containerRef = React82.useRef(null);
|
|
15318
|
+
const refs = React82.useMemo(() => {
|
|
15276
15319
|
return Object.fromEntries(
|
|
15277
|
-
serializedIds.split(",").map((id) => [id,
|
|
15320
|
+
serializedIds.split(",").map((id) => [id, React82.createRef()])
|
|
15278
15321
|
);
|
|
15279
15322
|
}, [serializedIds]);
|
|
15280
|
-
const labelElements =
|
|
15281
|
-
return serializedIds.split(",").map((id, index) => /* @__PURE__ */
|
|
15323
|
+
const labelElements = React82.useMemo(() => {
|
|
15324
|
+
return serializedIds.split(",").map((id, index) => /* @__PURE__ */ React82.createElement(
|
|
15282
15325
|
"span",
|
|
15283
15326
|
{
|
|
15284
15327
|
key: id,
|
|
@@ -15291,7 +15334,7 @@ var LabeledElementView = React81.memo(function LabeledElementView2({
|
|
|
15291
15334
|
})
|
|
15292
15335
|
));
|
|
15293
15336
|
}, [refs, serializedIds, renderLabel]);
|
|
15294
|
-
|
|
15337
|
+
React82.useLayoutEffect(() => {
|
|
15295
15338
|
if (!containerRef.current) return;
|
|
15296
15339
|
const containerRect = containerRef.current.getBoundingClientRect();
|
|
15297
15340
|
const solver = new kiwi.Solver();
|
|
@@ -15353,17 +15396,17 @@ var LabeledElementView = React81.memo(function LabeledElementView2({
|
|
|
15353
15396
|
`${Math.max(...heights)}px`
|
|
15354
15397
|
);
|
|
15355
15398
|
}, [refs, labelElements]);
|
|
15356
|
-
return /* @__PURE__ */
|
|
15399
|
+
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));
|
|
15357
15400
|
});
|
|
15358
15401
|
|
|
15359
15402
|
// src/components/LabeledField.tsx
|
|
15360
|
-
var
|
|
15403
|
+
var import_react87 = __toESM(require("react"));
|
|
15361
15404
|
|
|
15362
15405
|
// src/hooks/useIndent.ts
|
|
15363
|
-
var
|
|
15364
|
-
var IndentContext =
|
|
15406
|
+
var import_react86 = __toESM(require("react"));
|
|
15407
|
+
var IndentContext = import_react86.default.createContext(0);
|
|
15365
15408
|
var useIndent = () => {
|
|
15366
|
-
return
|
|
15409
|
+
return import_react86.default.useContext(IndentContext);
|
|
15367
15410
|
};
|
|
15368
15411
|
|
|
15369
15412
|
// src/components/LabeledField.tsx
|
|
@@ -15375,7 +15418,7 @@ var labeledFieldStyles = (labelType) => cx(
|
|
|
15375
15418
|
var labelTypeInset = {
|
|
15376
15419
|
type: "inset"
|
|
15377
15420
|
};
|
|
15378
|
-
var LabeledField = (0,
|
|
15421
|
+
var LabeledField = (0, import_react87.memo)(function LabeledField2({
|
|
15379
15422
|
children,
|
|
15380
15423
|
label,
|
|
15381
15424
|
labelType: labelTypeProp,
|
|
@@ -15391,15 +15434,15 @@ var LabeledField = (0, import_react86.memo)(function LabeledField2({
|
|
|
15391
15434
|
const labelWidth = labelWidthFromContext ?? minWidth;
|
|
15392
15435
|
const labelTypeFromContext = useLabelType();
|
|
15393
15436
|
const labelType = labelTypeProp ?? labelTypeFromContext;
|
|
15394
|
-
const labeledFieldClasses = (0,
|
|
15437
|
+
const labeledFieldClasses = (0, import_react87.useMemo)(
|
|
15395
15438
|
() => labeledFieldStyles(labelType),
|
|
15396
15439
|
[labelType]
|
|
15397
15440
|
);
|
|
15398
|
-
const labelContextValue = (0,
|
|
15441
|
+
const labelContextValue = (0, import_react87.useMemo)(
|
|
15399
15442
|
() => ({ fieldId, label }),
|
|
15400
15443
|
[fieldId, label]
|
|
15401
15444
|
);
|
|
15402
|
-
const indentStyle = (0,
|
|
15445
|
+
const indentStyle = (0, import_react87.useMemo)(
|
|
15403
15446
|
() => ({
|
|
15404
15447
|
width: indentLevel * 8,
|
|
15405
15448
|
flexBasis: indentLevel * 8,
|
|
@@ -15408,20 +15451,20 @@ var LabeledField = (0, import_react86.memo)(function LabeledField2({
|
|
|
15408
15451
|
}),
|
|
15409
15452
|
[indentLevel]
|
|
15410
15453
|
);
|
|
15411
|
-
const fieldStyle = (0,
|
|
15454
|
+
const fieldStyle = (0, import_react87.useMemo)(
|
|
15412
15455
|
() => ({
|
|
15413
15456
|
minWidth: `calc(100% - ${labelWidth + indentLevel * 8 + 6}px)`
|
|
15414
15457
|
}),
|
|
15415
15458
|
[labelWidth, indentLevel]
|
|
15416
15459
|
);
|
|
15417
|
-
const labelStyle = (0,
|
|
15460
|
+
const labelStyle = (0, import_react87.useMemo)(
|
|
15418
15461
|
() => ({
|
|
15419
15462
|
minWidth: `calc(${labelWidth}px - ${indentLevel * 8}px)`,
|
|
15420
15463
|
...labelStyleProp
|
|
15421
15464
|
}),
|
|
15422
15465
|
[labelWidth, indentLevel, labelStyleProp]
|
|
15423
15466
|
);
|
|
15424
|
-
return /* @__PURE__ */
|
|
15467
|
+
return /* @__PURE__ */ import_react87.default.createElement(LabelContext.Provider, { value: labelContextValue }, labelType === "inset" ? /* @__PURE__ */ import_react87.default.createElement(LabelTypeContext.Provider, { value: labelTypeInset }, children) : /* @__PURE__ */ import_react87.default.createElement("div", { className: cx("n-flex n-relative n-flex-1", className), style: style2 }, Boolean(indentLevel) && /* @__PURE__ */ import_react87.default.createElement("div", { style: indentStyle }), /* @__PURE__ */ import_react87.default.createElement("div", { className: labeledFieldClasses }, labelType !== "none" && /* @__PURE__ */ import_react87.default.createElement(
|
|
15425
15468
|
Label,
|
|
15426
15469
|
{
|
|
15427
15470
|
htmlFor: fieldId,
|
|
@@ -15430,13 +15473,13 @@ var LabeledField = (0, import_react86.memo)(function LabeledField2({
|
|
|
15430
15473
|
...props
|
|
15431
15474
|
},
|
|
15432
15475
|
label
|
|
15433
|
-
), labelType === "start" ? /* @__PURE__ */
|
|
15476
|
+
), labelType === "start" ? /* @__PURE__ */ import_react87.default.createElement("div", { className: "n-flex-auto n-flex", style: fieldStyle }, children) : children)));
|
|
15434
15477
|
});
|
|
15435
15478
|
|
|
15436
15479
|
// src/components/ListMenu.tsx
|
|
15437
15480
|
var import_noya_icons10 = require("@noya-app/noya-icons");
|
|
15438
15481
|
var import_noya_utils15 = require("@noya-app/noya-utils");
|
|
15439
|
-
var
|
|
15482
|
+
var import_react88 = __toESM(require("react"));
|
|
15440
15483
|
function getItemId(item) {
|
|
15441
15484
|
if (item.type === "submenu") {
|
|
15442
15485
|
return item.id;
|
|
@@ -15465,7 +15508,7 @@ function ListMenu({
|
|
|
15465
15508
|
const regularItems = chunk.filter(
|
|
15466
15509
|
(item) => isSubMenuItem(item) || isSelectableMenuItem(item)
|
|
15467
15510
|
);
|
|
15468
|
-
return /* @__PURE__ */
|
|
15511
|
+
return /* @__PURE__ */ import_react88.default.createElement(
|
|
15469
15512
|
List,
|
|
15470
15513
|
{
|
|
15471
15514
|
key: regularItems.map(getItemId).join("-"),
|
|
@@ -15477,31 +15520,31 @@ function ListMenu({
|
|
|
15477
15520
|
getName: (item) => item.title.toString(),
|
|
15478
15521
|
selectedIds,
|
|
15479
15522
|
renderRight,
|
|
15480
|
-
renderThumbnail: ({ item }) => /* @__PURE__ */
|
|
15481
|
-
renderDetail: (item) => isSubMenuItem(item) && /* @__PURE__ */
|
|
15523
|
+
renderThumbnail: ({ item }) => /* @__PURE__ */ import_react88.default.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)),
|
|
15524
|
+
renderDetail: (item) => isSubMenuItem(item) && /* @__PURE__ */ import_react88.default.createElement(import_noya_icons10.ArrowRightIcon, null),
|
|
15482
15525
|
onClickItem: (itemId) => onSelect(itemId)
|
|
15483
15526
|
}
|
|
15484
15527
|
);
|
|
15485
15528
|
});
|
|
15486
15529
|
return withSeparatorElements(
|
|
15487
15530
|
lists,
|
|
15488
|
-
/* @__PURE__ */
|
|
15531
|
+
/* @__PURE__ */ import_react88.default.createElement(Divider, { overflow: 12, className: "n-my-1" })
|
|
15489
15532
|
);
|
|
15490
15533
|
}
|
|
15491
15534
|
|
|
15492
15535
|
// src/components/ListNavigator.tsx
|
|
15493
|
-
var
|
|
15536
|
+
var import_react92 = __toESM(require("react"));
|
|
15494
15537
|
|
|
15495
15538
|
// src/components/Navigator.tsx
|
|
15496
|
-
var
|
|
15539
|
+
var import_react91 = __toESM(require("react"));
|
|
15497
15540
|
|
|
15498
15541
|
// src/components/StackNavigator.tsx
|
|
15499
15542
|
var import_noya_utils16 = require("@noya-app/noya-utils");
|
|
15500
|
-
var
|
|
15543
|
+
var import_react90 = __toESM(require("react"));
|
|
15501
15544
|
|
|
15502
15545
|
// src/components/BaseToolbar.tsx
|
|
15503
|
-
var
|
|
15504
|
-
var
|
|
15546
|
+
var import_react89 = __toESM(require("react"));
|
|
15547
|
+
var toolbarTransparentStyle = {
|
|
15505
15548
|
[cssVarNames.colors.buttonBackground]: "transparent",
|
|
15506
15549
|
[cssVarNames.colors.inputBackground]: "transparent"
|
|
15507
15550
|
};
|
|
@@ -15512,20 +15555,28 @@ function BaseToolbarContainer({
|
|
|
15512
15555
|
innerClassName,
|
|
15513
15556
|
enableAbsoluteBreakpoint = true
|
|
15514
15557
|
}) {
|
|
15515
|
-
return /* @__PURE__ */
|
|
15558
|
+
return /* @__PURE__ */ import_react89.default.createElement(
|
|
15516
15559
|
"div",
|
|
15517
15560
|
{
|
|
15518
|
-
className: cx(
|
|
15519
|
-
|
|
15520
|
-
enableAbsoluteBreakpoint && "n-@container/toolbar",
|
|
15521
|
-
innerClassName
|
|
15522
|
-
),
|
|
15523
|
-
style: {
|
|
15524
|
-
flex: `0 0 ${cssVars.spacing.toolbarHeight}`
|
|
15525
|
-
}
|
|
15561
|
+
className: cx("n-flex n-flex-col", className),
|
|
15562
|
+
style: toolbarTransparentStyle
|
|
15526
15563
|
},
|
|
15527
|
-
|
|
15528
|
-
|
|
15564
|
+
/* @__PURE__ */ import_react89.default.createElement(
|
|
15565
|
+
"div",
|
|
15566
|
+
{
|
|
15567
|
+
className: cx(
|
|
15568
|
+
"n-flex n-items-center n-bg-sidebar-background n-flex-none n-relative",
|
|
15569
|
+
enableAbsoluteBreakpoint && "n-@container/toolbar",
|
|
15570
|
+
innerClassName
|
|
15571
|
+
),
|
|
15572
|
+
style: {
|
|
15573
|
+
flex: `0 0 ${cssVars.spacing.toolbarHeight}`
|
|
15574
|
+
}
|
|
15575
|
+
},
|
|
15576
|
+
children
|
|
15577
|
+
),
|
|
15578
|
+
showDivider && /* @__PURE__ */ import_react89.default.createElement(Divider, { variant: "strong" })
|
|
15579
|
+
);
|
|
15529
15580
|
}
|
|
15530
15581
|
function BaseToolbar({
|
|
15531
15582
|
children,
|
|
@@ -15535,15 +15586,16 @@ function BaseToolbar({
|
|
|
15535
15586
|
showDivider = true,
|
|
15536
15587
|
className,
|
|
15537
15588
|
innerClassName,
|
|
15538
|
-
enableAbsoluteBreakpoint = true
|
|
15589
|
+
enableAbsoluteBreakpoint = true,
|
|
15590
|
+
enableContainerQuery = true
|
|
15539
15591
|
}) {
|
|
15540
15592
|
const childrenContainerClassName = cx(
|
|
15541
15593
|
"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",
|
|
15542
|
-
"@xl/toolbar:!n-absolute @xl/toolbar:!n-pl-0 @xl/toolbar:!n-pr-0"
|
|
15594
|
+
enableContainerQuery && "@xl/toolbar:!n-absolute @xl/toolbar:!n-pl-0 @xl/toolbar:!n-pr-0"
|
|
15543
15595
|
);
|
|
15544
|
-
const childrenElement = children && /* @__PURE__ */
|
|
15545
|
-
const leftElement = left && /* @__PURE__ */
|
|
15546
|
-
return /* @__PURE__ */
|
|
15596
|
+
const childrenElement = children && /* @__PURE__ */ import_react89.default.createElement("div", { className: childrenContainerClassName }, /* @__PURE__ */ import_react89.default.createElement("div", { className: "n-flex n-items-center n-justify-center n-pointer-events-auto" }, children));
|
|
15597
|
+
const leftElement = left && /* @__PURE__ */ import_react89.default.createElement("div", { className: "n-flex n-gap-toolbar-separator" }, left);
|
|
15598
|
+
return /* @__PURE__ */ import_react89.default.createElement(
|
|
15547
15599
|
BaseToolbarContainer,
|
|
15548
15600
|
{
|
|
15549
15601
|
showDivider,
|
|
@@ -15551,19 +15603,20 @@ function BaseToolbar({
|
|
|
15551
15603
|
innerClassName,
|
|
15552
15604
|
enableAbsoluteBreakpoint
|
|
15553
15605
|
},
|
|
15554
|
-
logo && /* @__PURE__ */
|
|
15555
|
-
/* @__PURE__ */
|
|
15606
|
+
logo && /* @__PURE__ */ import_react89.default.createElement(import_react89.default.Fragment, null, logo, /* @__PURE__ */ import_react89.default.createElement(DividerVertical, null)),
|
|
15607
|
+
/* @__PURE__ */ import_react89.default.createElement(Spacer.Horizontal, { size: 10 }),
|
|
15608
|
+
leftElement && !enableContainerQuery && /* @__PURE__ */ import_react89.default.createElement(import_react89.default.Fragment, null, leftElement, childrenElement && /* @__PURE__ */ import_react89.default.createElement(Spacer.Horizontal, { size: 10 })),
|
|
15556
15609
|
childrenElement,
|
|
15557
|
-
leftElement && /* @__PURE__ */
|
|
15558
|
-
/* @__PURE__ */
|
|
15559
|
-
/* @__PURE__ */
|
|
15560
|
-
/* @__PURE__ */
|
|
15561
|
-
/* @__PURE__ */
|
|
15610
|
+
leftElement && enableContainerQuery && /* @__PURE__ */ import_react89.default.createElement(import_react89.default.Fragment, null, childrenElement && /* @__PURE__ */ import_react89.default.createElement(import_react89.default.Fragment, null, /* @__PURE__ */ import_react89.default.createElement(Spacer.Horizontal, { size: 10, className: "@xl/toolbar:!n-hidden" }), /* @__PURE__ */ import_react89.default.createElement(DividerVertical, { className: "@xl/toolbar:!n-hidden" })), /* @__PURE__ */ import_react89.default.createElement(Spacer.Horizontal, { size: 10, className: "@xl/toolbar:!n-hidden" }), leftElement, /* @__PURE__ */ import_react89.default.createElement(Spacer.Horizontal, { size: 10 })),
|
|
15611
|
+
/* @__PURE__ */ import_react89.default.createElement(Spacer.Horizontal, null),
|
|
15612
|
+
/* @__PURE__ */ import_react89.default.createElement(Spacer.Horizontal, { size: 10 }),
|
|
15613
|
+
/* @__PURE__ */ import_react89.default.createElement("div", { className: "n-flex n-gap-toolbar-separator" }, right),
|
|
15614
|
+
/* @__PURE__ */ import_react89.default.createElement(Spacer.Horizontal, { size: 10 })
|
|
15562
15615
|
);
|
|
15563
15616
|
}
|
|
15564
15617
|
|
|
15565
15618
|
// src/components/StackNavigator.tsx
|
|
15566
|
-
var StackRenderContext =
|
|
15619
|
+
var StackRenderContext = import_react90.default.createContext({});
|
|
15567
15620
|
function StackNavigator({
|
|
15568
15621
|
items,
|
|
15569
15622
|
onBack,
|
|
@@ -15577,15 +15630,15 @@ function StackNavigator({
|
|
|
15577
15630
|
renderHeader
|
|
15578
15631
|
}) {
|
|
15579
15632
|
const top = items.at(-1);
|
|
15580
|
-
const previousLengthRef = (0,
|
|
15581
|
-
const direction = (0,
|
|
15633
|
+
const previousLengthRef = (0, import_react90.useRef)(items.length);
|
|
15634
|
+
const direction = (0, import_react90.useMemo)(() => {
|
|
15582
15635
|
const previous = previousLengthRef.current;
|
|
15583
15636
|
previousLengthRef.current = items.length;
|
|
15584
15637
|
return items.length >= previous ? "forward" : "back";
|
|
15585
15638
|
}, [items.length]);
|
|
15586
|
-
const [cardSizes, setCardSizes] = (0,
|
|
15587
|
-
const [containerSize, setContainerSize] = (0,
|
|
15588
|
-
const handleSizeChange = (0,
|
|
15639
|
+
const [cardSizes, setCardSizes] = (0, import_react90.useState)({});
|
|
15640
|
+
const [containerSize, setContainerSize] = (0, import_react90.useState)();
|
|
15641
|
+
const handleSizeChange = (0, import_react90.useCallback)((key, size) => {
|
|
15589
15642
|
setCardSizes((prev) => {
|
|
15590
15643
|
if ((0, import_noya_utils16.isDeepEqual)(prev[key], size)) {
|
|
15591
15644
|
return prev;
|
|
@@ -15593,7 +15646,7 @@ function StackNavigator({
|
|
|
15593
15646
|
return { ...prev, [key]: size };
|
|
15594
15647
|
});
|
|
15595
15648
|
}, []);
|
|
15596
|
-
(0,
|
|
15649
|
+
(0, import_react90.useEffect)(() => {
|
|
15597
15650
|
if (!top) {
|
|
15598
15651
|
setContainerSize(void 0);
|
|
15599
15652
|
return;
|
|
@@ -15607,7 +15660,7 @@ function StackNavigator({
|
|
|
15607
15660
|
return measuredSize;
|
|
15608
15661
|
});
|
|
15609
15662
|
}, [cardSizes, top]);
|
|
15610
|
-
(0,
|
|
15663
|
+
(0, import_react90.useEffect)(() => {
|
|
15611
15664
|
setCardSizes((prev) => {
|
|
15612
15665
|
const next = {};
|
|
15613
15666
|
let changed = false;
|
|
@@ -15625,7 +15678,7 @@ function StackNavigator({
|
|
|
15625
15678
|
return changed ? next : prev;
|
|
15626
15679
|
});
|
|
15627
15680
|
}, [items]);
|
|
15628
|
-
const animationStyles = (0,
|
|
15681
|
+
const animationStyles = (0, import_react90.useMemo)(() => {
|
|
15629
15682
|
return {
|
|
15630
15683
|
entering: {
|
|
15631
15684
|
opacity: 0,
|
|
@@ -15645,7 +15698,7 @@ function StackNavigator({
|
|
|
15645
15698
|
};
|
|
15646
15699
|
}, [direction]);
|
|
15647
15700
|
const shouldAnimateSize = containerSize !== void 0;
|
|
15648
|
-
const contentStyle = (0,
|
|
15701
|
+
const contentStyle = (0, import_react90.useMemo)(() => {
|
|
15649
15702
|
if (!containerSize) return void 0;
|
|
15650
15703
|
const style3 = {
|
|
15651
15704
|
// width: containerSize.width,
|
|
@@ -15658,11 +15711,11 @@ function StackNavigator({
|
|
|
15658
15711
|
}
|
|
15659
15712
|
return style3;
|
|
15660
15713
|
}, [containerSize, shouldAnimateSize]);
|
|
15661
|
-
const [animationStates, setAnimationStates] = (0,
|
|
15662
|
-
const [renderContentCache, setRenderContentCache] = (0,
|
|
15714
|
+
const [animationStates, setAnimationStates] = (0, import_react90.useState)({});
|
|
15715
|
+
const [renderContentCache, setRenderContentCache] = (0, import_react90.useState)(
|
|
15663
15716
|
() => Object.fromEntries(items.map((item) => [item.key, item.renderContent]))
|
|
15664
15717
|
);
|
|
15665
|
-
(0,
|
|
15718
|
+
(0, import_react90.useEffect)(() => {
|
|
15666
15719
|
setRenderContentCache((prev) => {
|
|
15667
15720
|
let changed = false;
|
|
15668
15721
|
const next = { ...prev };
|
|
@@ -15680,7 +15733,7 @@ function StackNavigator({
|
|
|
15680
15733
|
return changed ? next : prev;
|
|
15681
15734
|
});
|
|
15682
15735
|
}, [animationStates, items]);
|
|
15683
|
-
const handleChildStateChange = (0,
|
|
15736
|
+
const handleChildStateChange = (0, import_react90.useCallback)(
|
|
15684
15737
|
(key, state) => {
|
|
15685
15738
|
if (!key) return;
|
|
15686
15739
|
setAnimationStates((prev) => {
|
|
@@ -15723,7 +15776,7 @@ function StackNavigator({
|
|
|
15723
15776
|
}
|
|
15724
15777
|
return defaultRenderHeader(headerProps);
|
|
15725
15778
|
};
|
|
15726
|
-
return /* @__PURE__ */
|
|
15779
|
+
return /* @__PURE__ */ import_react90.default.createElement(
|
|
15727
15780
|
"div",
|
|
15728
15781
|
{
|
|
15729
15782
|
className: cx("n-flex n-flex-col", className),
|
|
@@ -15739,13 +15792,13 @@ function StackNavigator({
|
|
|
15739
15792
|
}
|
|
15740
15793
|
},
|
|
15741
15794
|
showHeader && renderHeaderContent(),
|
|
15742
|
-
/* @__PURE__ */
|
|
15795
|
+
/* @__PURE__ */ import_react90.default.createElement(
|
|
15743
15796
|
"div",
|
|
15744
15797
|
{
|
|
15745
15798
|
className: cx("n-relative n-overflow-hidden", contentClassName),
|
|
15746
15799
|
style: contentStyle
|
|
15747
15800
|
},
|
|
15748
|
-
/* @__PURE__ */
|
|
15801
|
+
/* @__PURE__ */ import_react90.default.createElement(StackRenderContext.Provider, { value: renderContentCache }, /* @__PURE__ */ import_react90.default.createElement(
|
|
15749
15802
|
AnimatePresence,
|
|
15750
15803
|
{
|
|
15751
15804
|
duration: 200,
|
|
@@ -15754,7 +15807,7 @@ function StackNavigator({
|
|
|
15754
15807
|
mode: "wait",
|
|
15755
15808
|
onChildStateChange: handleChildStateChange
|
|
15756
15809
|
},
|
|
15757
|
-
/* @__PURE__ */
|
|
15810
|
+
/* @__PURE__ */ import_react90.default.createElement(
|
|
15758
15811
|
StackNavigatorCard,
|
|
15759
15812
|
{
|
|
15760
15813
|
key: top.key,
|
|
@@ -15774,15 +15827,15 @@ var StackNavigatorCard = ({
|
|
|
15774
15827
|
style: style2,
|
|
15775
15828
|
className
|
|
15776
15829
|
}) => {
|
|
15777
|
-
const ref =
|
|
15830
|
+
const ref = import_react90.default.useRef(null);
|
|
15778
15831
|
const size = useSize(ref);
|
|
15779
|
-
const renderContext =
|
|
15832
|
+
const renderContext = import_react90.default.useContext(StackRenderContext);
|
|
15780
15833
|
const renderContent = renderContext?.[item.key] ?? item.renderContent;
|
|
15781
|
-
|
|
15834
|
+
import_react90.default.useEffect(() => {
|
|
15782
15835
|
if (!size || size.width === 0 || size.height === 0) return;
|
|
15783
15836
|
onSizeChange(item.key, size);
|
|
15784
15837
|
}, [item.key, onSizeChange, size]);
|
|
15785
|
-
return /* @__PURE__ */
|
|
15838
|
+
return /* @__PURE__ */ import_react90.default.createElement("div", { ref, className: cx("n-flex n-flex-col", className), style: style2 }, renderContent?.());
|
|
15786
15839
|
};
|
|
15787
15840
|
function defaultRenderHeader({
|
|
15788
15841
|
showDivider,
|
|
@@ -15791,13 +15844,14 @@ function defaultRenderHeader({
|
|
|
15791
15844
|
right,
|
|
15792
15845
|
title
|
|
15793
15846
|
}) {
|
|
15794
|
-
return /* @__PURE__ */
|
|
15847
|
+
return /* @__PURE__ */ import_react90.default.createElement(
|
|
15795
15848
|
BaseToolbar,
|
|
15796
15849
|
{
|
|
15797
15850
|
innerClassName: "n-px-1",
|
|
15798
15851
|
showDivider,
|
|
15799
15852
|
enableAbsoluteBreakpoint: false,
|
|
15800
|
-
|
|
15853
|
+
enableContainerQuery: false,
|
|
15854
|
+
left: showBackButton && /* @__PURE__ */ import_react90.default.createElement(
|
|
15801
15855
|
Button,
|
|
15802
15856
|
{
|
|
15803
15857
|
className: "-n-mx-2",
|
|
@@ -15808,7 +15862,7 @@ function defaultRenderHeader({
|
|
|
15808
15862
|
),
|
|
15809
15863
|
right
|
|
15810
15864
|
},
|
|
15811
|
-
typeof title === "string" || typeof title === "number" ? /* @__PURE__ */
|
|
15865
|
+
typeof title === "string" || typeof title === "number" ? /* @__PURE__ */ import_react90.default.createElement(Body, null, title) : title
|
|
15812
15866
|
);
|
|
15813
15867
|
}
|
|
15814
15868
|
|
|
@@ -15820,23 +15874,23 @@ var NavigatorScreen = Object.assign(
|
|
|
15820
15874
|
[navigatorScreenIdentifier]: true
|
|
15821
15875
|
}
|
|
15822
15876
|
);
|
|
15823
|
-
var NavigatorScreenContext =
|
|
15877
|
+
var NavigatorScreenContext = import_react91.default.createContext(null);
|
|
15824
15878
|
function useNavigator() {
|
|
15825
|
-
const context =
|
|
15879
|
+
const context = import_react91.default.useContext(NavigatorScreenContext);
|
|
15826
15880
|
if (!context) {
|
|
15827
15881
|
throw new Error("useNavigator must be used within a Navigator screen");
|
|
15828
15882
|
}
|
|
15829
15883
|
return context.navigation;
|
|
15830
15884
|
}
|
|
15831
15885
|
function useNavigatorRoute() {
|
|
15832
|
-
const context =
|
|
15886
|
+
const context = import_react91.default.useContext(NavigatorScreenContext);
|
|
15833
15887
|
if (!context) {
|
|
15834
15888
|
throw new Error("useNavigatorRoute must be used within a Navigator screen");
|
|
15835
15889
|
}
|
|
15836
15890
|
return context.route;
|
|
15837
15891
|
}
|
|
15838
15892
|
function isNavigatorScreenElement(child) {
|
|
15839
|
-
return (0,
|
|
15893
|
+
return (0, import_react91.isValidElement)(child) && Boolean(
|
|
15840
15894
|
child.type?.[navigatorScreenIdentifier]
|
|
15841
15895
|
);
|
|
15842
15896
|
}
|
|
@@ -15857,15 +15911,15 @@ function NavigatorImpl({
|
|
|
15857
15911
|
showHeader,
|
|
15858
15912
|
renderHeader
|
|
15859
15913
|
}) {
|
|
15860
|
-
const screens = (0,
|
|
15914
|
+
const screens = (0, import_react91.useMemo)(() => {
|
|
15861
15915
|
const configs = [];
|
|
15862
|
-
|
|
15916
|
+
import_react91.Children.forEach(children, (child) => {
|
|
15863
15917
|
if (!isNavigatorScreenElement(child)) return;
|
|
15864
15918
|
configs.push(child.props);
|
|
15865
15919
|
});
|
|
15866
15920
|
return configs;
|
|
15867
15921
|
}, [children]);
|
|
15868
|
-
const screenMap = (0,
|
|
15922
|
+
const screenMap = (0, import_react91.useMemo)(() => {
|
|
15869
15923
|
const map = /* @__PURE__ */ new Map();
|
|
15870
15924
|
for (const screen of screens) {
|
|
15871
15925
|
if (map.has(screen.name)) {
|
|
@@ -15877,8 +15931,8 @@ function NavigatorImpl({
|
|
|
15877
15931
|
}
|
|
15878
15932
|
return map;
|
|
15879
15933
|
}, [screens]);
|
|
15880
|
-
const keyRef = (0,
|
|
15881
|
-
const createEntry = (0,
|
|
15934
|
+
const keyRef = (0, import_react91.useRef)(0);
|
|
15935
|
+
const createEntry = (0, import_react91.useCallback)(
|
|
15882
15936
|
(name, params) => ({
|
|
15883
15937
|
key: `${String(name)}-${keyRef.current++}`,
|
|
15884
15938
|
name,
|
|
@@ -15892,13 +15946,13 @@ function NavigatorImpl({
|
|
|
15892
15946
|
`Navigator: initial route "${String(initialScreenName)}" is not registered as a screen.`
|
|
15893
15947
|
);
|
|
15894
15948
|
}
|
|
15895
|
-
const [stack, setStack] = (0,
|
|
15949
|
+
const [stack, setStack] = (0, import_react91.useState)(() => [
|
|
15896
15950
|
createEntry(
|
|
15897
15951
|
initialScreenName,
|
|
15898
15952
|
initialRoute.params
|
|
15899
15953
|
)
|
|
15900
15954
|
]);
|
|
15901
|
-
const push = (0,
|
|
15955
|
+
const push = (0, import_react91.useCallback)(
|
|
15902
15956
|
(...args) => {
|
|
15903
15957
|
const [name, params] = args;
|
|
15904
15958
|
const screen = screenMap.get(name);
|
|
@@ -15912,7 +15966,7 @@ function NavigatorImpl({
|
|
|
15912
15966
|
},
|
|
15913
15967
|
[createEntry, screenMap]
|
|
15914
15968
|
);
|
|
15915
|
-
const pop = (0,
|
|
15969
|
+
const pop = (0, import_react91.useCallback)(() => {
|
|
15916
15970
|
setStack((prev) => {
|
|
15917
15971
|
if (prev.length <= 1) return prev;
|
|
15918
15972
|
const nextStack = prev.slice(0, -1);
|
|
@@ -15928,7 +15982,7 @@ function NavigatorImpl({
|
|
|
15928
15982
|
return updatedStack;
|
|
15929
15983
|
});
|
|
15930
15984
|
}, [createEntry]);
|
|
15931
|
-
const replace = (0,
|
|
15985
|
+
const replace = (0, import_react91.useCallback)(
|
|
15932
15986
|
(targetKey, name, params) => {
|
|
15933
15987
|
const screen = screenMap.get(name);
|
|
15934
15988
|
if (!screen) {
|
|
@@ -15954,7 +16008,7 @@ function NavigatorImpl({
|
|
|
15954
16008
|
},
|
|
15955
16009
|
[createEntry, screenMap]
|
|
15956
16010
|
);
|
|
15957
|
-
const items = (0,
|
|
16011
|
+
const items = (0, import_react91.useMemo)(() => {
|
|
15958
16012
|
return stack.flatMap((entry) => {
|
|
15959
16013
|
const screen = screenMap.get(entry.name);
|
|
15960
16014
|
if (!screen) return [];
|
|
@@ -15992,7 +16046,7 @@ function NavigatorImpl({
|
|
|
15992
16046
|
onBack: headerProps.onBack
|
|
15993
16047
|
}),
|
|
15994
16048
|
renderContent: () => {
|
|
15995
|
-
return /* @__PURE__ */
|
|
16049
|
+
return /* @__PURE__ */ import_react91.default.createElement(NavigatorScreenContext.Provider, { value: context }, evaluateOption(screen.children, context));
|
|
15996
16050
|
}
|
|
15997
16051
|
};
|
|
15998
16052
|
});
|
|
@@ -16000,7 +16054,7 @@ function NavigatorImpl({
|
|
|
16000
16054
|
const shouldShowHeader = evaluateOption(showHeader, {
|
|
16001
16055
|
stack
|
|
16002
16056
|
});
|
|
16003
|
-
return /* @__PURE__ */
|
|
16057
|
+
return /* @__PURE__ */ import_react91.default.createElement(
|
|
16004
16058
|
StackNavigator,
|
|
16005
16059
|
{
|
|
16006
16060
|
items,
|
|
@@ -16040,7 +16094,7 @@ function ListNavigator({
|
|
|
16040
16094
|
renderHeader,
|
|
16041
16095
|
selectedIds
|
|
16042
16096
|
}) {
|
|
16043
|
-
return /* @__PURE__ */
|
|
16097
|
+
return /* @__PURE__ */ import_react92.default.createElement(
|
|
16044
16098
|
ListNavigatorInternal,
|
|
16045
16099
|
{
|
|
16046
16100
|
initialRoute: { name: "screen", params: { id: void 0 } },
|
|
@@ -16058,7 +16112,7 @@ function ListNavigator({
|
|
|
16058
16112
|
className,
|
|
16059
16113
|
style: style2
|
|
16060
16114
|
},
|
|
16061
|
-
/* @__PURE__ */
|
|
16115
|
+
/* @__PURE__ */ import_react92.default.createElement(
|
|
16062
16116
|
ListNavigatorInternal.Screen,
|
|
16063
16117
|
{
|
|
16064
16118
|
name: "screen",
|
|
@@ -16073,7 +16127,7 @@ function ListNavigator({
|
|
|
16073
16127
|
const nestedItem = items.find(
|
|
16074
16128
|
(item) => isSubMenuItem(item) && item.id === route.params.id
|
|
16075
16129
|
);
|
|
16076
|
-
return /* @__PURE__ */
|
|
16130
|
+
return /* @__PURE__ */ import_react92.default.createElement(
|
|
16077
16131
|
ListMenu,
|
|
16078
16132
|
{
|
|
16079
16133
|
items: nestedItem?.items ?? items,
|
|
@@ -16098,19 +16152,19 @@ function ListNavigator({
|
|
|
16098
16152
|
|
|
16099
16153
|
// src/components/Message.tsx
|
|
16100
16154
|
var import_noya_utils17 = require("@noya-app/noya-utils");
|
|
16101
|
-
var
|
|
16102
|
-
var Message = (0,
|
|
16103
|
-
(0,
|
|
16155
|
+
var import_react93 = __toESM(require("react"));
|
|
16156
|
+
var Message = (0, import_react93.memo)(
|
|
16157
|
+
(0, import_react93.forwardRef)(function Message2({ role, children, user, avatarSize = INPUT_HEIGHT }, ref) {
|
|
16104
16158
|
const randomId = (0, import_noya_utils17.uuid)();
|
|
16105
16159
|
const resolvedUserId = user?.authId ?? user?.connectionId ?? randomId;
|
|
16106
16160
|
const userMessageBackgroundColor = colorFromString(resolvedUserId);
|
|
16107
|
-
const styles3 = (0,
|
|
16161
|
+
const styles3 = (0, import_react93.useMemo)(
|
|
16108
16162
|
() => role === "user" ? {
|
|
16109
16163
|
backgroundColor: userMessageBackgroundColor
|
|
16110
16164
|
} : void 0,
|
|
16111
16165
|
[userMessageBackgroundColor, role]
|
|
16112
16166
|
);
|
|
16113
|
-
return /* @__PURE__ */
|
|
16167
|
+
return /* @__PURE__ */ import_react93.default.createElement(
|
|
16114
16168
|
"div",
|
|
16115
16169
|
{
|
|
16116
16170
|
className: cx(
|
|
@@ -16118,15 +16172,15 @@ var Message = (0, import_react92.memo)(
|
|
|
16118
16172
|
role === "user" ? "n-flex-row-reverse" : "n-flex-row"
|
|
16119
16173
|
)
|
|
16120
16174
|
},
|
|
16121
|
-
role === "assistant" ? /* @__PURE__ */
|
|
16175
|
+
role === "assistant" ? /* @__PURE__ */ import_react93.default.createElement(
|
|
16122
16176
|
Avatar,
|
|
16123
16177
|
{
|
|
16124
16178
|
name: "Assistant",
|
|
16125
16179
|
size: avatarSize,
|
|
16126
16180
|
backgroundColor: cssVars.colors.primaryPastel
|
|
16127
16181
|
},
|
|
16128
|
-
/* @__PURE__ */
|
|
16129
|
-
) : /* @__PURE__ */
|
|
16182
|
+
/* @__PURE__ */ import_react93.default.createElement(Logo, { style: { width: 15 }, fill: cssVars.colors.primary })
|
|
16183
|
+
) : /* @__PURE__ */ import_react93.default.createElement(
|
|
16130
16184
|
Avatar,
|
|
16131
16185
|
{
|
|
16132
16186
|
userId: resolvedUserId,
|
|
@@ -16135,7 +16189,7 @@ var Message = (0, import_react92.memo)(
|
|
|
16135
16189
|
size: avatarSize
|
|
16136
16190
|
}
|
|
16137
16191
|
),
|
|
16138
|
-
/* @__PURE__ */
|
|
16192
|
+
/* @__PURE__ */ import_react93.default.createElement(
|
|
16139
16193
|
"div",
|
|
16140
16194
|
{
|
|
16141
16195
|
className: cx(
|
|
@@ -16155,9 +16209,9 @@ var Message = (0, import_react92.memo)(
|
|
|
16155
16209
|
|
|
16156
16210
|
// src/components/pipeline/PipelineResultLayout.tsx
|
|
16157
16211
|
var import_noya_icons11 = require("@noya-app/noya-icons");
|
|
16158
|
-
var
|
|
16212
|
+
var import_react94 = __toESM(require("react"));
|
|
16159
16213
|
var PipelineResultLink = ({ url }) => {
|
|
16160
|
-
return /* @__PURE__ */
|
|
16214
|
+
return /* @__PURE__ */ import_react94.default.createElement("div", { className: "n-flex n-flex-col gap-0.5" }, /* @__PURE__ */ import_react94.default.createElement(
|
|
16161
16215
|
"a",
|
|
16162
16216
|
{
|
|
16163
16217
|
href: url,
|
|
@@ -16165,15 +16219,15 @@ var PipelineResultLink = ({ url }) => {
|
|
|
16165
16219
|
rel: "noopener noreferrer",
|
|
16166
16220
|
className: "n-flex n-text-primary hover:n-opacity-80 n-border n-border-divider n-rounded-md"
|
|
16167
16221
|
},
|
|
16168
|
-
/* @__PURE__ */
|
|
16169
|
-
/* @__PURE__ */
|
|
16170
|
-
/* @__PURE__ */
|
|
16222
|
+
/* @__PURE__ */ import_react94.default.createElement("div", { className: "n-flex n-gap-1 n-items-center n-p-2" }, /* @__PURE__ */ import_react94.default.createElement(import_noya_icons11.Link1Icon, { className: "n-w-[15px] n-h-[15px] n-flex-shrink-0" })),
|
|
16223
|
+
/* @__PURE__ */ import_react94.default.createElement(DividerVertical, null),
|
|
16224
|
+
/* @__PURE__ */ import_react94.default.createElement(Small, { className: "n-truncate n-p-2 n-flex-1" }, url)
|
|
16171
16225
|
));
|
|
16172
16226
|
};
|
|
16173
16227
|
var PipelineResultLayout = ({
|
|
16174
16228
|
children
|
|
16175
16229
|
}) => {
|
|
16176
|
-
return /* @__PURE__ */
|
|
16230
|
+
return /* @__PURE__ */ import_react94.default.createElement("div", { className: "n-flex n-flex-col n-gap-2" }, children);
|
|
16177
16231
|
};
|
|
16178
16232
|
function getPipelineResultLink(value) {
|
|
16179
16233
|
if (typeof value !== "object" || value === null) return void 0;
|
|
@@ -16187,7 +16241,7 @@ function getPipelineResultLink(value) {
|
|
|
16187
16241
|
}
|
|
16188
16242
|
|
|
16189
16243
|
// src/components/ResizableContainer.tsx
|
|
16190
|
-
var
|
|
16244
|
+
var import_react95 = __toESM(require("react"));
|
|
16191
16245
|
var ResizableContainer = ({
|
|
16192
16246
|
children,
|
|
16193
16247
|
minWidth,
|
|
@@ -16200,13 +16254,13 @@ var ResizableContainer = ({
|
|
|
16200
16254
|
onChangeWidth,
|
|
16201
16255
|
shouldResetWidthOnGestureEnd: shouldResetWidth
|
|
16202
16256
|
}) => {
|
|
16203
|
-
const containerRef = (0,
|
|
16204
|
-
const resizeableRef = (0,
|
|
16205
|
-
const handleRef = (0,
|
|
16206
|
-
const clickCounter = (0,
|
|
16207
|
-
const [width, setWidth] = (0,
|
|
16208
|
-
const [drag, setDrag] = (0,
|
|
16209
|
-
const handlePointerDown = (0,
|
|
16257
|
+
const containerRef = (0, import_react95.useRef)(null);
|
|
16258
|
+
const resizeableRef = (0, import_react95.useRef)(null);
|
|
16259
|
+
const handleRef = (0, import_react95.useRef)(null);
|
|
16260
|
+
const clickCounter = (0, import_react95.useRef)(createClickCounter({ delay: 250 }));
|
|
16261
|
+
const [width, setWidth] = (0, import_react95.useState)();
|
|
16262
|
+
const [drag, setDrag] = (0, import_react95.useState)();
|
|
16263
|
+
const handlePointerDown = (0, import_react95.useCallback)(
|
|
16210
16264
|
(event) => {
|
|
16211
16265
|
const containerWidth = containerRef.current?.getBoundingClientRect().width;
|
|
16212
16266
|
const resizeableWidth = resizeableRef.current?.getBoundingClientRect().width;
|
|
@@ -16224,7 +16278,7 @@ var ResizableContainer = ({
|
|
|
16224
16278
|
},
|
|
16225
16279
|
[maxWidth, minWidth]
|
|
16226
16280
|
);
|
|
16227
|
-
const handlePointerMove = (0,
|
|
16281
|
+
const handlePointerMove = (0, import_react95.useCallback)(
|
|
16228
16282
|
(event) => {
|
|
16229
16283
|
if (!drag) return;
|
|
16230
16284
|
const delta = event.clientX - drag.startX;
|
|
@@ -16240,7 +16294,7 @@ var ResizableContainer = ({
|
|
|
16240
16294
|
},
|
|
16241
16295
|
[drag, onChangeWidth]
|
|
16242
16296
|
);
|
|
16243
|
-
const handlePointerUp = (0,
|
|
16297
|
+
const handlePointerUp = (0, import_react95.useCallback)(
|
|
16244
16298
|
(event) => {
|
|
16245
16299
|
setDrag(void 0);
|
|
16246
16300
|
handleRef.current?.releasePointerCapture(event.pointerId);
|
|
@@ -16256,7 +16310,7 @@ var ResizableContainer = ({
|
|
|
16256
16310
|
},
|
|
16257
16311
|
[shouldResetWidth]
|
|
16258
16312
|
);
|
|
16259
|
-
return /* @__PURE__ */
|
|
16313
|
+
return /* @__PURE__ */ import_react95.default.createElement(
|
|
16260
16314
|
"div",
|
|
16261
16315
|
{
|
|
16262
16316
|
ref: containerRef,
|
|
@@ -16264,7 +16318,7 @@ var ResizableContainer = ({
|
|
|
16264
16318
|
style: { position: "relative", ...style2 },
|
|
16265
16319
|
className
|
|
16266
16320
|
},
|
|
16267
|
-
/* @__PURE__ */
|
|
16321
|
+
/* @__PURE__ */ import_react95.default.createElement(
|
|
16268
16322
|
"div",
|
|
16269
16323
|
{
|
|
16270
16324
|
ref: resizeableRef,
|
|
@@ -16275,7 +16329,7 @@ var ResizableContainer = ({
|
|
|
16275
16329
|
}
|
|
16276
16330
|
},
|
|
16277
16331
|
typeof children === "function" ? children({ width }) : children,
|
|
16278
|
-
/* @__PURE__ */
|
|
16332
|
+
/* @__PURE__ */ import_react95.default.createElement(
|
|
16279
16333
|
"div",
|
|
16280
16334
|
{
|
|
16281
16335
|
ref: handleRef,
|
|
@@ -16300,7 +16354,7 @@ var ResizableContainer = ({
|
|
|
16300
16354
|
onPointerUp: handlePointerUp,
|
|
16301
16355
|
onPointerCancel: handlePointerUp
|
|
16302
16356
|
},
|
|
16303
|
-
/* @__PURE__ */
|
|
16357
|
+
/* @__PURE__ */ import_react95.default.createElement(
|
|
16304
16358
|
"div",
|
|
16305
16359
|
{
|
|
16306
16360
|
style: {
|
|
@@ -16318,7 +16372,7 @@ var ResizableContainer = ({
|
|
|
16318
16372
|
}
|
|
16319
16373
|
)
|
|
16320
16374
|
),
|
|
16321
|
-
drag && /* @__PURE__ */
|
|
16375
|
+
drag && /* @__PURE__ */ import_react95.default.createElement(
|
|
16322
16376
|
"div",
|
|
16323
16377
|
{
|
|
16324
16378
|
style: {
|
|
@@ -16341,7 +16395,7 @@ function clamp5(value, min, max) {
|
|
|
16341
16395
|
|
|
16342
16396
|
// src/components/RingProgress.tsx
|
|
16343
16397
|
var import_noya_utils18 = require("@noya-app/noya-utils");
|
|
16344
|
-
var
|
|
16398
|
+
var React93 = __toESM(require("react"));
|
|
16345
16399
|
function RingProgress({
|
|
16346
16400
|
value,
|
|
16347
16401
|
dividedBy = 100,
|
|
@@ -16357,14 +16411,14 @@ function RingProgress({
|
|
|
16357
16411
|
const safeDivisor = dividedBy > 0 ? dividedBy : 1;
|
|
16358
16412
|
const clampedRaw = (0, import_noya_utils18.clamp)(value, 0, safeDivisor);
|
|
16359
16413
|
const clampedPercent = clampedRaw / safeDivisor * 100;
|
|
16360
|
-
const radius =
|
|
16361
|
-
const circumference =
|
|
16362
|
-
const dashOffset =
|
|
16414
|
+
const radius = React93.useMemo(() => (size - thickness) / 2, [size, thickness]);
|
|
16415
|
+
const circumference = React93.useMemo(() => 2 * Math.PI * radius, [radius]);
|
|
16416
|
+
const dashOffset = React93.useMemo(
|
|
16363
16417
|
() => (100 - clampedPercent) / 100 * circumference,
|
|
16364
16418
|
[circumference, clampedPercent]
|
|
16365
16419
|
);
|
|
16366
16420
|
const trackStroke = trackColor ?? "var(--n-input-background, rgba(0,0,0,0.08))";
|
|
16367
|
-
const colorClass =
|
|
16421
|
+
const colorClass = React93.useMemo(() => {
|
|
16368
16422
|
switch (colorScheme) {
|
|
16369
16423
|
case "primary":
|
|
16370
16424
|
return "n-stroke-primary";
|
|
@@ -16377,7 +16431,7 @@ function RingProgress({
|
|
|
16377
16431
|
return "n-stroke-text";
|
|
16378
16432
|
}
|
|
16379
16433
|
}, [colorScheme]);
|
|
16380
|
-
const computedStroke =
|
|
16434
|
+
const computedStroke = React93.useMemo(() => {
|
|
16381
16435
|
if (color) return color;
|
|
16382
16436
|
switch (colorScheme) {
|
|
16383
16437
|
case "primary":
|
|
@@ -16391,7 +16445,7 @@ function RingProgress({
|
|
|
16391
16445
|
return "var(--n-text, currentColor)";
|
|
16392
16446
|
}
|
|
16393
16447
|
}, [color, colorScheme]);
|
|
16394
|
-
return /* @__PURE__ */
|
|
16448
|
+
return /* @__PURE__ */ React93.createElement(
|
|
16395
16449
|
"span",
|
|
16396
16450
|
{
|
|
16397
16451
|
className: cx("n-inline-flex n-items-center n-justify-center", className),
|
|
@@ -16402,7 +16456,7 @@ function RingProgress({
|
|
|
16402
16456
|
"aria-valuemax": safeDivisor,
|
|
16403
16457
|
"aria-label": ariaLabel
|
|
16404
16458
|
},
|
|
16405
|
-
/* @__PURE__ */
|
|
16459
|
+
/* @__PURE__ */ React93.createElement(
|
|
16406
16460
|
"svg",
|
|
16407
16461
|
{
|
|
16408
16462
|
width: size,
|
|
@@ -16410,7 +16464,7 @@ function RingProgress({
|
|
|
16410
16464
|
viewBox: `0 0 ${size} ${size}`,
|
|
16411
16465
|
style: { display: "block" }
|
|
16412
16466
|
},
|
|
16413
|
-
/* @__PURE__ */
|
|
16467
|
+
/* @__PURE__ */ React93.createElement(
|
|
16414
16468
|
"circle",
|
|
16415
16469
|
{
|
|
16416
16470
|
cx: size / 2,
|
|
@@ -16421,7 +16475,7 @@ function RingProgress({
|
|
|
16421
16475
|
strokeWidth: thickness
|
|
16422
16476
|
}
|
|
16423
16477
|
),
|
|
16424
|
-
/* @__PURE__ */
|
|
16478
|
+
/* @__PURE__ */ React93.createElement(
|
|
16425
16479
|
"circle",
|
|
16426
16480
|
{
|
|
16427
16481
|
cx: size / 2,
|
|
@@ -16445,13 +16499,13 @@ function RingProgress({
|
|
|
16445
16499
|
}
|
|
16446
16500
|
|
|
16447
16501
|
// src/components/ScrollableSidebar.tsx
|
|
16448
|
-
var
|
|
16502
|
+
var import_react96 = __toESM(require("react"));
|
|
16449
16503
|
function ScrollableSidebar({ children }) {
|
|
16450
|
-
return /* @__PURE__ */
|
|
16504
|
+
return /* @__PURE__ */ import_react96.default.createElement("div", { className: "n-relative n-flex n-flex-col n-flex-1 n-max-h-full" }, /* @__PURE__ */ import_react96.default.createElement(ScrollArea, null, children));
|
|
16451
16505
|
}
|
|
16452
16506
|
|
|
16453
16507
|
// src/components/Section.tsx
|
|
16454
|
-
var
|
|
16508
|
+
var import_react97 = __toESM(require("react"));
|
|
16455
16509
|
var titleIconStyle = {
|
|
16456
16510
|
marginRight: "6px",
|
|
16457
16511
|
alignSelf: "flex-start",
|
|
@@ -16472,14 +16526,14 @@ function SectionHeader({
|
|
|
16472
16526
|
titleClassName,
|
|
16473
16527
|
onClickTitle
|
|
16474
16528
|
}) {
|
|
16475
|
-
const headerStyle = (0,
|
|
16529
|
+
const headerStyle = (0, import_react97.useMemo)(
|
|
16476
16530
|
() => ({
|
|
16477
16531
|
minHeight: INPUT_HEIGHT,
|
|
16478
16532
|
...style2
|
|
16479
16533
|
}),
|
|
16480
16534
|
[style2]
|
|
16481
16535
|
);
|
|
16482
|
-
const titleElement = title ? /* @__PURE__ */
|
|
16536
|
+
const titleElement = title ? /* @__PURE__ */ import_react97.default.createElement(
|
|
16483
16537
|
InspectorPrimitives_exports.Title,
|
|
16484
16538
|
{
|
|
16485
16539
|
$textStyle: titleTextStyle,
|
|
@@ -16487,16 +16541,16 @@ function SectionHeader({
|
|
|
16487
16541
|
},
|
|
16488
16542
|
title
|
|
16489
16543
|
) : null;
|
|
16490
|
-
return /* @__PURE__ */
|
|
16544
|
+
return /* @__PURE__ */ import_react97.default.createElement(
|
|
16491
16545
|
InspectorPrimitives_exports.SectionHeader,
|
|
16492
16546
|
{
|
|
16493
16547
|
style: headerStyle,
|
|
16494
16548
|
className
|
|
16495
16549
|
},
|
|
16496
|
-
titleIcon && /* @__PURE__ */
|
|
16497
|
-
titleElement && /* @__PURE__ */
|
|
16498
|
-
headerSeparator === "space" && /* @__PURE__ */
|
|
16499
|
-
headerSeparator === "dot" && /* @__PURE__ */
|
|
16550
|
+
titleIcon && /* @__PURE__ */ import_react97.default.createElement("div", { style: titleIconStyle, className: textStyles[titleTextStyle] }, "\u200B", renderIcon(titleIcon)),
|
|
16551
|
+
titleElement && /* @__PURE__ */ import_react97.default.createElement(import_react97.default.Fragment, null, onClickTitle ? /* @__PURE__ */ import_react97.default.createElement(Button, { variant: "none", onClick: onClickTitle }, titleElement) : titleElement),
|
|
16552
|
+
headerSeparator === "space" && /* @__PURE__ */ import_react97.default.createElement(Spacer.Horizontal, null),
|
|
16553
|
+
headerSeparator === "dot" && /* @__PURE__ */ import_react97.default.createElement(
|
|
16500
16554
|
Text,
|
|
16501
16555
|
{
|
|
16502
16556
|
variant: titleTextStyle,
|
|
@@ -16522,7 +16576,7 @@ var SectionInternal = ({
|
|
|
16522
16576
|
titleClassName,
|
|
16523
16577
|
headerStyle: headerStyleProp
|
|
16524
16578
|
}) => {
|
|
16525
|
-
const style2 = (0,
|
|
16579
|
+
const style2 = (0, import_react97.useMemo)(
|
|
16526
16580
|
() => ({
|
|
16527
16581
|
display: "flex",
|
|
16528
16582
|
flexDirection: "column",
|
|
@@ -16533,15 +16587,15 @@ var SectionInternal = ({
|
|
|
16533
16587
|
}),
|
|
16534
16588
|
[titleTextStyle, title, extraPadding, styleProp]
|
|
16535
16589
|
);
|
|
16536
|
-
const hasChildren =
|
|
16537
|
-
const headerStyle = (0,
|
|
16590
|
+
const hasChildren = import_react97.default.Children.toArray(children).some((child) => !!child);
|
|
16591
|
+
const headerStyle = (0, import_react97.useMemo)(
|
|
16538
16592
|
() => ({
|
|
16539
16593
|
marginBottom: hasChildren ? "4px" : void 0,
|
|
16540
16594
|
...headerStyleProp
|
|
16541
16595
|
}),
|
|
16542
16596
|
[hasChildren, headerStyleProp]
|
|
16543
16597
|
);
|
|
16544
|
-
return /* @__PURE__ */
|
|
16598
|
+
return /* @__PURE__ */ import_react97.default.createElement("div", { style: style2, className }, (title || titleIcon || right) && /* @__PURE__ */ import_react97.default.createElement(
|
|
16545
16599
|
SectionHeader,
|
|
16546
16600
|
{
|
|
16547
16601
|
style: headerStyle,
|
|
@@ -16553,7 +16607,7 @@ var SectionInternal = ({
|
|
|
16553
16607
|
right,
|
|
16554
16608
|
headerSeparator
|
|
16555
16609
|
}
|
|
16556
|
-
), /* @__PURE__ */
|
|
16610
|
+
), /* @__PURE__ */ import_react97.default.createElement(IndentContext.Provider, { value: 0 }, children));
|
|
16557
16611
|
};
|
|
16558
16612
|
var ExpandableSection = ({
|
|
16559
16613
|
storageKey,
|
|
@@ -16566,12 +16620,12 @@ var ExpandableSection = ({
|
|
|
16566
16620
|
initialVisibility
|
|
16567
16621
|
);
|
|
16568
16622
|
const expanded = visibility === "show";
|
|
16569
|
-
return /* @__PURE__ */
|
|
16623
|
+
return /* @__PURE__ */ import_react97.default.createElement(
|
|
16570
16624
|
SectionInternal,
|
|
16571
16625
|
{
|
|
16572
16626
|
...props,
|
|
16573
16627
|
right: !props.hideRightWhenCollapsed || expanded ? props.right : null,
|
|
16574
|
-
title: /* @__PURE__ */
|
|
16628
|
+
title: /* @__PURE__ */ import_react97.default.createElement("div", { className: "n-flex n-gap-1 n-items-center" }, props.title, /* @__PURE__ */ import_react97.default.createElement(
|
|
16575
16629
|
IconButton,
|
|
16576
16630
|
{
|
|
16577
16631
|
iconName: expanded ? "ChevronDownIcon2" : "ChevronRightIcon2",
|
|
@@ -16582,20 +16636,20 @@ var ExpandableSection = ({
|
|
|
16582
16636
|
expanded && props.children
|
|
16583
16637
|
);
|
|
16584
16638
|
};
|
|
16585
|
-
var Section = (0,
|
|
16639
|
+
var Section = (0, import_react97.memo)(function InspectorSection({
|
|
16586
16640
|
storageKey,
|
|
16587
16641
|
...props
|
|
16588
16642
|
}) {
|
|
16589
|
-
return storageKey ? /* @__PURE__ */
|
|
16643
|
+
return storageKey ? /* @__PURE__ */ import_react97.default.createElement(ExpandableSection, { ...props, storageKey }) : /* @__PURE__ */ import_react97.default.createElement(SectionInternal, { ...props });
|
|
16590
16644
|
});
|
|
16591
16645
|
|
|
16592
16646
|
// src/components/SegmentedControl.tsx
|
|
16593
16647
|
var import_radix_ui12 = require("radix-ui");
|
|
16594
|
-
var
|
|
16595
|
-
var SegmentedControlContext = (0,
|
|
16648
|
+
var import_react98 = __toESM(require("react"));
|
|
16649
|
+
var SegmentedControlContext = (0, import_react98.createContext)({
|
|
16596
16650
|
colorScheme: "primary"
|
|
16597
16651
|
});
|
|
16598
|
-
var SegmentedControlItem = (0,
|
|
16652
|
+
var SegmentedControlItem = (0, import_react98.forwardRef)(function SegmentedControlItem2({
|
|
16599
16653
|
value,
|
|
16600
16654
|
tooltip,
|
|
16601
16655
|
title,
|
|
@@ -16605,8 +16659,8 @@ var SegmentedControlItem = (0, import_react97.forwardRef)(function SegmentedCont
|
|
|
16605
16659
|
variant = "default",
|
|
16606
16660
|
...props
|
|
16607
16661
|
}, forwardedRef) {
|
|
16608
|
-
const { colorScheme } = (0,
|
|
16609
|
-
const itemElement = /* @__PURE__ */
|
|
16662
|
+
const { colorScheme } = (0, import_react98.useContext)(SegmentedControlContext);
|
|
16663
|
+
const itemElement = /* @__PURE__ */ import_react98.default.createElement(
|
|
16610
16664
|
import_radix_ui12.ToggleGroup.Item,
|
|
16611
16665
|
{
|
|
16612
16666
|
ref: forwardedRef,
|
|
@@ -16621,7 +16675,7 @@ var SegmentedControlItem = (0, import_react97.forwardRef)(function SegmentedCont
|
|
|
16621
16675
|
// font weight
|
|
16622
16676
|
variant === "tabs" ? "n-font-semibold" : variant === "buttons" ? "n-font-medium" : "n-font-normal",
|
|
16623
16677
|
// focus ring
|
|
16624
|
-
variant === "tabs" ? "" : variant === "buttons" ? "focus
|
|
16678
|
+
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",
|
|
16625
16679
|
// checked
|
|
16626
16680
|
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",
|
|
16627
16681
|
"focus:n-z-interactable",
|
|
@@ -16630,14 +16684,14 @@ var SegmentedControlItem = (0, import_react97.forwardRef)(function SegmentedCont
|
|
|
16630
16684
|
// hover
|
|
16631
16685
|
variant === "buttons" && "hover:n-bg-button-background-hover",
|
|
16632
16686
|
// spacing and borders
|
|
16633
|
-
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",
|
|
16687
|
+
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",
|
|
16634
16688
|
// icon only buttons
|
|
16635
16689
|
variant === "buttons" && title === "" && icon && "n-min-w-input-height",
|
|
16636
16690
|
className
|
|
16637
16691
|
),
|
|
16638
16692
|
...props
|
|
16639
16693
|
},
|
|
16640
|
-
/* @__PURE__ */
|
|
16694
|
+
/* @__PURE__ */ import_react98.default.createElement(
|
|
16641
16695
|
"span",
|
|
16642
16696
|
{
|
|
16643
16697
|
className: cx(
|
|
@@ -16649,7 +16703,7 @@ var SegmentedControlItem = (0, import_react97.forwardRef)(function SegmentedCont
|
|
|
16649
16703
|
title
|
|
16650
16704
|
)
|
|
16651
16705
|
);
|
|
16652
|
-
return tooltip ? /* @__PURE__ */
|
|
16706
|
+
return tooltip ? /* @__PURE__ */ import_react98.default.createElement(Tooltip, { content: tooltip }, itemElement) : itemElement;
|
|
16653
16707
|
});
|
|
16654
16708
|
var SegmentedControl = memoGeneric(function SegmentedControl2({
|
|
16655
16709
|
id: idProp,
|
|
@@ -16662,16 +16716,16 @@ var SegmentedControl = memoGeneric(function SegmentedControl2({
|
|
|
16662
16716
|
className,
|
|
16663
16717
|
style: style2
|
|
16664
16718
|
}) {
|
|
16665
|
-
const contextValue = (0,
|
|
16719
|
+
const contextValue = (0, import_react98.useMemo)(() => ({ colorScheme }), [colorScheme]);
|
|
16666
16720
|
const { fieldId: id } = useLabel({ fieldId: idProp });
|
|
16667
|
-
const handleValueChange = (0,
|
|
16721
|
+
const handleValueChange = (0, import_react98.useCallback)(
|
|
16668
16722
|
(value2) => {
|
|
16669
16723
|
if (!allowEmpty && !value2) return;
|
|
16670
16724
|
onValueChange?.(value2);
|
|
16671
16725
|
},
|
|
16672
16726
|
[allowEmpty, onValueChange]
|
|
16673
16727
|
);
|
|
16674
|
-
return /* @__PURE__ */
|
|
16728
|
+
return /* @__PURE__ */ import_react98.default.createElement(SegmentedControlContext.Provider, { value: contextValue }, /* @__PURE__ */ import_react98.default.createElement(
|
|
16675
16729
|
import_radix_ui12.ToggleGroup.Root,
|
|
16676
16730
|
{
|
|
16677
16731
|
id,
|
|
@@ -16690,13 +16744,13 @@ var SegmentedControl = memoGeneric(function SegmentedControl2({
|
|
|
16690
16744
|
gridTemplateColumns: `repeat(${items.length}, 1fr)`
|
|
16691
16745
|
}
|
|
16692
16746
|
},
|
|
16693
|
-
items.map((item, index) => /* @__PURE__ */
|
|
16747
|
+
items.map((item, index) => /* @__PURE__ */ import_react98.default.createElement(SegmentedControlItem, { key: index, ...item, variant }))
|
|
16694
16748
|
));
|
|
16695
16749
|
});
|
|
16696
16750
|
|
|
16697
16751
|
// src/components/SelectionToolbar.tsx
|
|
16698
16752
|
var PopperPrimitive = __toESM(require("@radix-ui/react-popper"));
|
|
16699
|
-
var
|
|
16753
|
+
var import_react99 = __toESM(require("react"));
|
|
16700
16754
|
var import_react_dom4 = require("react-dom");
|
|
16701
16755
|
var createVirtualElement = (rect) => ({
|
|
16702
16756
|
getBoundingClientRect: () => ({
|
|
@@ -16711,7 +16765,7 @@ var createVirtualElement = (rect) => ({
|
|
|
16711
16765
|
toJSON: () => null
|
|
16712
16766
|
})
|
|
16713
16767
|
});
|
|
16714
|
-
var SelectionToolbarContainer = (0,
|
|
16768
|
+
var SelectionToolbarContainer = (0, import_react99.memo)(
|
|
16715
16769
|
function SelectionToolbarContainer2({
|
|
16716
16770
|
rect,
|
|
16717
16771
|
children,
|
|
@@ -16725,15 +16779,15 @@ var SelectionToolbarContainer = (0, import_react98.memo)(
|
|
|
16725
16779
|
transitionDuration = 0.2
|
|
16726
16780
|
}) {
|
|
16727
16781
|
const portalScopeId = usePortalScopeId();
|
|
16728
|
-
const containerRef =
|
|
16782
|
+
const containerRef = import_react99.default.useRef(null);
|
|
16729
16783
|
const size = useSize(containerRef, "width");
|
|
16730
|
-
const virtualRef = (0,
|
|
16784
|
+
const virtualRef = (0, import_react99.useMemo)(
|
|
16731
16785
|
() => ({
|
|
16732
16786
|
current: createVirtualElement(rect)
|
|
16733
16787
|
}),
|
|
16734
16788
|
[rect]
|
|
16735
16789
|
);
|
|
16736
|
-
const popperContent = /* @__PURE__ */
|
|
16790
|
+
const popperContent = /* @__PURE__ */ import_react99.default.createElement(
|
|
16737
16791
|
PopperPrimitive.Content,
|
|
16738
16792
|
{
|
|
16739
16793
|
...portalScopeProps(portalScopeId),
|
|
@@ -16751,7 +16805,7 @@ var SelectionToolbarContainer = (0, import_react98.memo)(
|
|
|
16751
16805
|
[cssVarNames.colors.buttonBackground]: "transparent"
|
|
16752
16806
|
}
|
|
16753
16807
|
},
|
|
16754
|
-
/* @__PURE__ */
|
|
16808
|
+
/* @__PURE__ */ import_react99.default.createElement(
|
|
16755
16809
|
"div",
|
|
16756
16810
|
{
|
|
16757
16811
|
ref: containerRef,
|
|
@@ -16768,14 +16822,14 @@ var SelectionToolbarContainer = (0, import_react98.memo)(
|
|
|
16768
16822
|
children
|
|
16769
16823
|
)
|
|
16770
16824
|
);
|
|
16771
|
-
return /* @__PURE__ */
|
|
16825
|
+
return /* @__PURE__ */ import_react99.default.createElement(PopperPrimitive.Root, null, /* @__PURE__ */ import_react99.default.createElement(PopperPrimitive.Anchor, { virtualRef }), portalContainer ? (0, import_react_dom4.createPortal)(popperContent, portalContainer) : popperContent);
|
|
16772
16826
|
}
|
|
16773
16827
|
);
|
|
16774
16828
|
|
|
16775
16829
|
// src/components/SelectMenu.tsx
|
|
16776
16830
|
var import_noya_icons12 = require("@noya-app/noya-icons");
|
|
16777
16831
|
var import_radix_ui13 = require("radix-ui");
|
|
16778
|
-
var
|
|
16832
|
+
var import_react100 = __toESM(require("react"));
|
|
16779
16833
|
var readOnlyStyle = {
|
|
16780
16834
|
justifyContent: "flex-start",
|
|
16781
16835
|
textAlign: "left"
|
|
@@ -16798,7 +16852,7 @@ var SelectMenuTrigger = memoGeneric(function SelectMenuTrigger2({
|
|
|
16798
16852
|
fieldId: props.id
|
|
16799
16853
|
});
|
|
16800
16854
|
const labelType = useLabelType();
|
|
16801
|
-
return /* @__PURE__ */
|
|
16855
|
+
return /* @__PURE__ */ import_react100.default.createElement(import_radix_ui13.Select.SelectTrigger, { asChild: true, onFocus, onBlur }, /* @__PURE__ */ import_react100.default.createElement(
|
|
16802
16856
|
Button,
|
|
16803
16857
|
{
|
|
16804
16858
|
id,
|
|
@@ -16810,10 +16864,10 @@ var SelectMenuTrigger = memoGeneric(function SelectMenuTrigger2({
|
|
|
16810
16864
|
),
|
|
16811
16865
|
disabled
|
|
16812
16866
|
},
|
|
16813
|
-
icon && /* @__PURE__ */
|
|
16814
|
-
label && labelType === "inset" && /* @__PURE__ */
|
|
16815
|
-
/* @__PURE__ */
|
|
16816
|
-
/* @__PURE__ */
|
|
16867
|
+
icon && /* @__PURE__ */ import_react100.default.createElement("span", { className: "n-pr-1.5" }, renderIcon(icon)),
|
|
16868
|
+
label && labelType === "inset" && /* @__PURE__ */ import_react100.default.createElement("div", { className: insetEndStyles }, /* @__PURE__ */ import_react100.default.createElement(Label, { className: "n-pr-4 n-text-text-disabled", htmlFor: id }, label)),
|
|
16869
|
+
/* @__PURE__ */ import_react100.default.createElement("span", { className: "n-flex-1 n-flex" }, /* @__PURE__ */ import_react100.default.createElement(import_radix_ui13.Select.Value, { placeholder })),
|
|
16870
|
+
/* @__PURE__ */ import_react100.default.createElement(
|
|
16817
16871
|
import_noya_icons12.DropdownChevronIcon,
|
|
16818
16872
|
{
|
|
16819
16873
|
className: cx(
|
|
@@ -16850,7 +16904,7 @@ var SelectMenu = memoGeneric(function SelectMenu2({
|
|
|
16850
16904
|
(item) => isSelectableMenuItem(item) && item.value === value
|
|
16851
16905
|
);
|
|
16852
16906
|
const icon = selectedItem?.icon;
|
|
16853
|
-
const [internalOpen, setInternalOpen] = (0,
|
|
16907
|
+
const [internalOpen, setInternalOpen] = (0, import_react100.useState)(open);
|
|
16854
16908
|
const { label, fieldId: id } = useLabel({
|
|
16855
16909
|
label: props.label,
|
|
16856
16910
|
fieldId: props.id
|
|
@@ -16861,8 +16915,8 @@ var SelectMenu = memoGeneric(function SelectMenu2({
|
|
|
16861
16915
|
}
|
|
16862
16916
|
setInternalOpen(open2);
|
|
16863
16917
|
};
|
|
16864
|
-
const readOnlyButton = (0,
|
|
16865
|
-
() => /* @__PURE__ */
|
|
16918
|
+
const readOnlyButton = (0, import_react100.useMemo)(
|
|
16919
|
+
() => /* @__PURE__ */ import_react100.default.createElement(
|
|
16866
16920
|
Button,
|
|
16867
16921
|
{
|
|
16868
16922
|
id,
|
|
@@ -16872,11 +16926,11 @@ var SelectMenu = memoGeneric(function SelectMenu2({
|
|
|
16872
16926
|
disabled
|
|
16873
16927
|
},
|
|
16874
16928
|
icon && renderIcon(icon),
|
|
16875
|
-
/* @__PURE__ */
|
|
16929
|
+
/* @__PURE__ */ import_react100.default.createElement("span", { className: "n-flex n-flex-1" }, selectedItem?.title ?? value)
|
|
16876
16930
|
),
|
|
16877
16931
|
[icon, id, style2, className, disabled, value, selectedItem]
|
|
16878
16932
|
);
|
|
16879
|
-
const contentStyle = (0,
|
|
16933
|
+
const contentStyle = (0, import_react100.useMemo)(() => {
|
|
16880
16934
|
return {
|
|
16881
16935
|
width: "var(--radix-select-trigger-width)",
|
|
16882
16936
|
minWidth: "max-content",
|
|
@@ -16884,7 +16938,7 @@ var SelectMenu = memoGeneric(function SelectMenu2({
|
|
|
16884
16938
|
...contentStyleProp
|
|
16885
16939
|
};
|
|
16886
16940
|
}, [contentStyleProp]);
|
|
16887
|
-
const content = /* @__PURE__ */
|
|
16941
|
+
const content = /* @__PURE__ */ import_react100.default.createElement(
|
|
16888
16942
|
import_radix_ui13.Select.Root,
|
|
16889
16943
|
{
|
|
16890
16944
|
value,
|
|
@@ -16892,7 +16946,7 @@ var SelectMenu = memoGeneric(function SelectMenu2({
|
|
|
16892
16946
|
open,
|
|
16893
16947
|
onOpenChange: handleOpenChange
|
|
16894
16948
|
},
|
|
16895
|
-
/* @__PURE__ */
|
|
16949
|
+
/* @__PURE__ */ import_react100.default.createElement(
|
|
16896
16950
|
SelectMenuTrigger,
|
|
16897
16951
|
{
|
|
16898
16952
|
id,
|
|
@@ -16907,7 +16961,7 @@ var SelectMenu = memoGeneric(function SelectMenu2({
|
|
|
16907
16961
|
label
|
|
16908
16962
|
}
|
|
16909
16963
|
),
|
|
16910
|
-
/* @__PURE__ */
|
|
16964
|
+
/* @__PURE__ */ import_react100.default.createElement(import_radix_ui13.Select.Portal, null, /* @__PURE__ */ import_react100.default.createElement(
|
|
16911
16965
|
import_radix_ui13.Select.Content,
|
|
16912
16966
|
{
|
|
16913
16967
|
...portalScopeProps(portalScopeId),
|
|
@@ -16918,14 +16972,14 @@ var SelectMenu = memoGeneric(function SelectMenu2({
|
|
|
16918
16972
|
align: "center",
|
|
16919
16973
|
style: contentStyle
|
|
16920
16974
|
},
|
|
16921
|
-
/* @__PURE__ */
|
|
16975
|
+
/* @__PURE__ */ import_react100.default.createElement(import_radix_ui13.Select.ScrollUpButton, { className: scrollButtonStyles }, /* @__PURE__ */ import_react100.default.createElement(
|
|
16922
16976
|
import_noya_icons12.ChevronUpIcon,
|
|
16923
16977
|
{
|
|
16924
16978
|
className: cx("n-transition-transform n-duration-100")
|
|
16925
16979
|
}
|
|
16926
16980
|
)),
|
|
16927
|
-
/* @__PURE__ */
|
|
16928
|
-
/* @__PURE__ */
|
|
16981
|
+
/* @__PURE__ */ import_react100.default.createElement(import_radix_ui13.Select.Viewport, null, /* @__PURE__ */ import_react100.default.createElement(MenuViewport, { items, Components: Components3 })),
|
|
16982
|
+
/* @__PURE__ */ import_react100.default.createElement(import_radix_ui13.Select.ScrollDownButton, { className: scrollButtonStyles }, /* @__PURE__ */ import_react100.default.createElement(import_noya_icons12.ChevronDownIcon, null))
|
|
16929
16983
|
))
|
|
16930
16984
|
);
|
|
16931
16985
|
return readOnly ? readOnlyButton : content;
|
|
@@ -16933,12 +16987,12 @@ var SelectMenu = memoGeneric(function SelectMenu2({
|
|
|
16933
16987
|
|
|
16934
16988
|
// src/components/Slider.tsx
|
|
16935
16989
|
var import_radix_ui14 = require("radix-ui");
|
|
16936
|
-
var
|
|
16990
|
+
var import_react101 = __toESM(require("react"));
|
|
16937
16991
|
var THUMB_WIDTH = 8;
|
|
16938
16992
|
var thumbStyle = {
|
|
16939
16993
|
width: THUMB_WIDTH
|
|
16940
16994
|
};
|
|
16941
|
-
var Slider = (0,
|
|
16995
|
+
var Slider = (0, import_react101.memo)(function Slider2({
|
|
16942
16996
|
style: style2,
|
|
16943
16997
|
className,
|
|
16944
16998
|
value,
|
|
@@ -16952,21 +17006,21 @@ var Slider = (0, import_react100.memo)(function Slider2({
|
|
|
16952
17006
|
readOnly = false,
|
|
16953
17007
|
...props
|
|
16954
17008
|
}) {
|
|
16955
|
-
const arrayValue = (0,
|
|
17009
|
+
const arrayValue = (0, import_react101.useMemo)(
|
|
16956
17010
|
() => [Math.min(Math.max(value, min), max)],
|
|
16957
17011
|
[value, min, max]
|
|
16958
17012
|
);
|
|
16959
17013
|
const { fieldId: id } = useLabel({
|
|
16960
17014
|
fieldId: props.id
|
|
16961
17015
|
});
|
|
16962
|
-
const handleValueChange = (0,
|
|
17016
|
+
const handleValueChange = (0, import_react101.useCallback)(
|
|
16963
17017
|
(arrayValue2) => {
|
|
16964
17018
|
onValueChange(arrayValue2[0]);
|
|
16965
17019
|
},
|
|
16966
17020
|
[onValueChange]
|
|
16967
17021
|
);
|
|
16968
17022
|
const ratio = (arrayValue[0] - min) / (max - min);
|
|
16969
|
-
return /* @__PURE__ */
|
|
17023
|
+
return /* @__PURE__ */ import_react101.default.createElement(
|
|
16970
17024
|
import_radix_ui14.Slider.Root,
|
|
16971
17025
|
{
|
|
16972
17026
|
min,
|
|
@@ -16984,7 +17038,7 @@ var Slider = (0, import_react100.memo)(function Slider2({
|
|
|
16984
17038
|
onBlur,
|
|
16985
17039
|
disabled: readOnly
|
|
16986
17040
|
},
|
|
16987
|
-
/* @__PURE__ */
|
|
17041
|
+
/* @__PURE__ */ import_react101.default.createElement("div", { className: "n-relative n-flex-grow n-h-[3px] n-overflow-hidden" }, /* @__PURE__ */ import_react101.default.createElement(
|
|
16988
17042
|
"div",
|
|
16989
17043
|
{
|
|
16990
17044
|
className: "n-absolute n-h-full n-rounded-l n-bg-slider-active-background",
|
|
@@ -16993,7 +17047,7 @@ var Slider = (0, import_react100.memo)(function Slider2({
|
|
|
16993
17047
|
width: `calc(${ratio * 100}% - ${ratio * 8}px - 2px)`
|
|
16994
17048
|
}
|
|
16995
17049
|
}
|
|
16996
|
-
), /* @__PURE__ */
|
|
17050
|
+
), /* @__PURE__ */ import_react101.default.createElement(
|
|
16997
17051
|
"div",
|
|
16998
17052
|
{
|
|
16999
17053
|
className: "n-absolute n-h-full n-rounded-r n-bg-input-background",
|
|
@@ -17003,7 +17057,7 @@ var Slider = (0, import_react100.memo)(function Slider2({
|
|
|
17003
17057
|
}
|
|
17004
17058
|
}
|
|
17005
17059
|
)),
|
|
17006
|
-
/* @__PURE__ */
|
|
17060
|
+
/* @__PURE__ */ import_react101.default.createElement(
|
|
17007
17061
|
import_radix_ui14.Slider.Thumb,
|
|
17008
17062
|
{
|
|
17009
17063
|
style: thumbStyle,
|
|
@@ -17021,28 +17075,28 @@ var Slider = (0, import_react100.memo)(function Slider2({
|
|
|
17021
17075
|
});
|
|
17022
17076
|
|
|
17023
17077
|
// src/components/sorting/createSharedDrag.tsx
|
|
17024
|
-
var
|
|
17078
|
+
var React100 = __toESM(require("react"));
|
|
17025
17079
|
function createSharedDrag() {
|
|
17026
|
-
const dragRegistrationContext =
|
|
17027
|
-
const activeDragContext =
|
|
17080
|
+
const dragRegistrationContext = React100.createContext(null);
|
|
17081
|
+
const activeDragContext = React100.createContext(
|
|
17028
17082
|
null
|
|
17029
17083
|
);
|
|
17030
17084
|
const sharedDragProps = {
|
|
17031
17085
|
dragRegistrationContext,
|
|
17032
17086
|
activeDragContext
|
|
17033
17087
|
};
|
|
17034
|
-
const Provider = (props) => /* @__PURE__ */
|
|
17088
|
+
const Provider = (props) => /* @__PURE__ */ React100.createElement(SharedDragProvider, { sharedDragProps, ...props });
|
|
17035
17089
|
return {
|
|
17036
17090
|
Provider,
|
|
17037
|
-
Sortable: (props) => /* @__PURE__ */
|
|
17091
|
+
Sortable: (props) => /* @__PURE__ */ React100.createElement(Sortable, { sharedDragProps, ...props }),
|
|
17038
17092
|
props: sharedDragProps
|
|
17039
17093
|
};
|
|
17040
17094
|
}
|
|
17041
17095
|
|
|
17042
17096
|
// src/components/Stepper.tsx
|
|
17043
17097
|
var import_noya_utils19 = require("@noya-app/noya-utils");
|
|
17044
|
-
var
|
|
17045
|
-
var Stepper = (0,
|
|
17098
|
+
var import_react102 = __toESM(require("react"));
|
|
17099
|
+
var Stepper = (0, import_react102.memo)(function Stepper2({
|
|
17046
17100
|
style: style2,
|
|
17047
17101
|
className,
|
|
17048
17102
|
value: valueProp,
|
|
@@ -17059,17 +17113,17 @@ var Stepper = (0, import_react101.memo)(function Stepper2({
|
|
|
17059
17113
|
const { fieldId: id } = useLabel({
|
|
17060
17114
|
fieldId: props.id
|
|
17061
17115
|
});
|
|
17062
|
-
const value = (0,
|
|
17116
|
+
const value = (0, import_react102.useMemo)(() => {
|
|
17063
17117
|
return (0, import_noya_utils19.clamp)(valueProp, min, max);
|
|
17064
17118
|
}, [valueProp, min, max]);
|
|
17065
|
-
const handleValueChange = (0,
|
|
17119
|
+
const handleValueChange = (0, import_react102.useCallback)(
|
|
17066
17120
|
(value2) => {
|
|
17067
17121
|
const newValue = (0, import_noya_utils19.clamp)(value2, min, max);
|
|
17068
17122
|
onValueChange(newValue);
|
|
17069
17123
|
},
|
|
17070
17124
|
[onValueChange, min, max]
|
|
17071
17125
|
);
|
|
17072
|
-
return /* @__PURE__ */
|
|
17126
|
+
return /* @__PURE__ */ import_react102.default.createElement(
|
|
17073
17127
|
"div",
|
|
17074
17128
|
{
|
|
17075
17129
|
id,
|
|
@@ -17081,7 +17135,7 @@ var Stepper = (0, import_react101.memo)(function Stepper2({
|
|
|
17081
17135
|
onFocus,
|
|
17082
17136
|
onBlur
|
|
17083
17137
|
},
|
|
17084
|
-
/* @__PURE__ */
|
|
17138
|
+
/* @__PURE__ */ import_react102.default.createElement(
|
|
17085
17139
|
InputField2.Root,
|
|
17086
17140
|
{
|
|
17087
17141
|
className: "n-flex-1",
|
|
@@ -17089,7 +17143,7 @@ var Stepper = (0, import_react101.memo)(function Stepper2({
|
|
|
17089
17143
|
startClassName: "-n-ml-[3px]",
|
|
17090
17144
|
endWidth: 17,
|
|
17091
17145
|
endClassName: "-n-mr-[3px]",
|
|
17092
|
-
start: /* @__PURE__ */
|
|
17146
|
+
start: /* @__PURE__ */ import_react102.default.createElement(
|
|
17093
17147
|
IconButton,
|
|
17094
17148
|
{
|
|
17095
17149
|
iconName: "MinusIcon",
|
|
@@ -17103,7 +17157,7 @@ var Stepper = (0, import_react101.memo)(function Stepper2({
|
|
|
17103
17157
|
}
|
|
17104
17158
|
}
|
|
17105
17159
|
),
|
|
17106
|
-
end: /* @__PURE__ */
|
|
17160
|
+
end: /* @__PURE__ */ import_react102.default.createElement(
|
|
17107
17161
|
IconButton,
|
|
17108
17162
|
{
|
|
17109
17163
|
iconName: "PlusIcon",
|
|
@@ -17118,7 +17172,7 @@ var Stepper = (0, import_react101.memo)(function Stepper2({
|
|
|
17118
17172
|
}
|
|
17119
17173
|
)
|
|
17120
17174
|
},
|
|
17121
|
-
/* @__PURE__ */
|
|
17175
|
+
/* @__PURE__ */ import_react102.default.createElement(
|
|
17122
17176
|
InputField2.NumberInput,
|
|
17123
17177
|
{
|
|
17124
17178
|
value,
|
|
@@ -17133,7 +17187,7 @@ var Stepper = (0, import_react101.memo)(function Stepper2({
|
|
|
17133
17187
|
|
|
17134
17188
|
// src/components/Switch.tsx
|
|
17135
17189
|
var import_radix_ui15 = require("radix-ui");
|
|
17136
|
-
var
|
|
17190
|
+
var React102 = __toESM(require("react"));
|
|
17137
17191
|
var Switch = function Switch2({
|
|
17138
17192
|
id,
|
|
17139
17193
|
value,
|
|
@@ -17145,7 +17199,7 @@ var Switch = function Switch2({
|
|
|
17145
17199
|
style: style2,
|
|
17146
17200
|
className
|
|
17147
17201
|
}) {
|
|
17148
|
-
return /* @__PURE__ */
|
|
17202
|
+
return /* @__PURE__ */ React102.createElement(
|
|
17149
17203
|
import_radix_ui15.Switch.Root,
|
|
17150
17204
|
{
|
|
17151
17205
|
id,
|
|
@@ -17164,12 +17218,12 @@ var Switch = function Switch2({
|
|
|
17164
17218
|
onFocus,
|
|
17165
17219
|
onBlur
|
|
17166
17220
|
},
|
|
17167
|
-
/* @__PURE__ */
|
|
17221
|
+
/* @__PURE__ */ React102.createElement(import_radix_ui15.Switch.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]" })
|
|
17168
17222
|
);
|
|
17169
17223
|
};
|
|
17170
17224
|
|
|
17171
17225
|
// src/components/Tabs.tsx
|
|
17172
|
-
var
|
|
17226
|
+
var React103 = __toESM(require("react"));
|
|
17173
17227
|
function Tabs({
|
|
17174
17228
|
value,
|
|
17175
17229
|
onValueChange,
|
|
@@ -17184,7 +17238,7 @@ function Tabs({
|
|
|
17184
17238
|
value,
|
|
17185
17239
|
onChange: onValueChange
|
|
17186
17240
|
});
|
|
17187
|
-
return /* @__PURE__ */
|
|
17241
|
+
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(
|
|
17188
17242
|
SegmentedControl,
|
|
17189
17243
|
{
|
|
17190
17244
|
className: "n-flex-1",
|
|
@@ -17193,11 +17247,11 @@ function Tabs({
|
|
|
17193
17247
|
variant,
|
|
17194
17248
|
items: selectableItems
|
|
17195
17249
|
}
|
|
17196
|
-
)), /* @__PURE__ */
|
|
17250
|
+
)), /* @__PURE__ */ React103.createElement(Divider, null), renderContent({ value: activeTab }));
|
|
17197
17251
|
}
|
|
17198
17252
|
|
|
17199
17253
|
// src/components/UserPicker.tsx
|
|
17200
|
-
var
|
|
17254
|
+
var import_react103 = __toESM(require("react"));
|
|
17201
17255
|
function UserPicker({
|
|
17202
17256
|
users,
|
|
17203
17257
|
value,
|
|
@@ -17207,27 +17261,27 @@ function UserPicker({
|
|
|
17207
17261
|
placeholder = "Search users...",
|
|
17208
17262
|
...rest
|
|
17209
17263
|
}) {
|
|
17210
|
-
const sortedUsers = (0,
|
|
17264
|
+
const sortedUsers = (0, import_react103.useMemo)(() => {
|
|
17211
17265
|
return [...users].sort(
|
|
17212
17266
|
(a, b) => getUserDisplayName(a).localeCompare(getUserDisplayName(b), void 0, {
|
|
17213
17267
|
sensitivity: "base"
|
|
17214
17268
|
})
|
|
17215
17269
|
);
|
|
17216
17270
|
}, [users]);
|
|
17217
|
-
const usersById = (0,
|
|
17271
|
+
const usersById = (0, import_react103.useMemo)(() => {
|
|
17218
17272
|
return new Map(sortedUsers.map((user) => [user.id, user]));
|
|
17219
17273
|
}, [sortedUsers]);
|
|
17220
|
-
const items = (0,
|
|
17274
|
+
const items = (0, import_react103.useMemo)(() => {
|
|
17221
17275
|
return sortedUsers.map(createUserMenuItem);
|
|
17222
17276
|
}, [sortedUsers]);
|
|
17223
17277
|
const isControlled = value !== void 0;
|
|
17224
|
-
const [uncontrolledValue, setUncontrolledValue] = (0,
|
|
17278
|
+
const [uncontrolledValue, setUncontrolledValue] = (0, import_react103.useState)(defaultValue2);
|
|
17225
17279
|
const selectedUserId = isControlled ? value : uncontrolledValue;
|
|
17226
|
-
const selectedItem = (0,
|
|
17280
|
+
const selectedItem = (0, import_react103.useMemo)(() => {
|
|
17227
17281
|
if (!selectedUserId) return void 0;
|
|
17228
17282
|
return items.find((item) => item.value === selectedUserId);
|
|
17229
17283
|
}, [items, selectedUserId]);
|
|
17230
|
-
const updateSelectedUserId = (0,
|
|
17284
|
+
const updateSelectedUserId = (0, import_react103.useCallback)(
|
|
17231
17285
|
(userId) => {
|
|
17232
17286
|
if (!isControlled) {
|
|
17233
17287
|
setUncontrolledValue(userId);
|
|
@@ -17236,14 +17290,14 @@ function UserPicker({
|
|
|
17236
17290
|
},
|
|
17237
17291
|
[isControlled, onChangeUserId]
|
|
17238
17292
|
);
|
|
17239
|
-
const handleSelectItem = (0,
|
|
17293
|
+
const handleSelectItem = (0, import_react103.useCallback)(
|
|
17240
17294
|
(item) => {
|
|
17241
17295
|
updateSelectedUserId(item.value);
|
|
17242
17296
|
onSelectUser?.(usersById.get(item.value));
|
|
17243
17297
|
},
|
|
17244
17298
|
[updateSelectedUserId, onSelectUser, usersById]
|
|
17245
17299
|
);
|
|
17246
|
-
return /* @__PURE__ */
|
|
17300
|
+
return /* @__PURE__ */ import_react103.default.createElement(
|
|
17247
17301
|
Combobox,
|
|
17248
17302
|
{
|
|
17249
17303
|
...rest,
|
|
@@ -17267,7 +17321,7 @@ function createUserMenuItem(user) {
|
|
|
17267
17321
|
return {
|
|
17268
17322
|
value: user.id,
|
|
17269
17323
|
title,
|
|
17270
|
-
icon: /* @__PURE__ */
|
|
17324
|
+
icon: /* @__PURE__ */ import_react103.default.createElement("div", { className: "n-relative n-w-[15px] n-h-[15px]" }, /* @__PURE__ */ import_react103.default.createElement(
|
|
17271
17325
|
Avatar,
|
|
17272
17326
|
{
|
|
17273
17327
|
size: 15 + overflow * 2,
|
|
@@ -17286,19 +17340,21 @@ function createUserMenuItem(user) {
|
|
|
17286
17340
|
}
|
|
17287
17341
|
|
|
17288
17342
|
// src/components/UserPointer.tsx
|
|
17289
|
-
var
|
|
17290
|
-
var UserPointerContainer = (0,
|
|
17343
|
+
var import_react104 = __toESM(require("react"));
|
|
17344
|
+
var UserPointerContainer = (0, import_react104.memo)(function UserPointerContainer2({
|
|
17291
17345
|
point,
|
|
17292
17346
|
visible,
|
|
17293
17347
|
children,
|
|
17294
17348
|
className,
|
|
17295
17349
|
style: style2
|
|
17296
17350
|
}) {
|
|
17297
|
-
return /* @__PURE__ */
|
|
17351
|
+
return /* @__PURE__ */ import_react104.default.createElement(
|
|
17298
17352
|
"div",
|
|
17299
17353
|
{
|
|
17300
17354
|
style: {
|
|
17301
|
-
|
|
17355
|
+
...point && {
|
|
17356
|
+
transform: `translate(${Math.round(point.x)}px, ${Math.round(point.y)}px)`
|
|
17357
|
+
},
|
|
17302
17358
|
transition: "transform 0.075s, opacity 0.2s",
|
|
17303
17359
|
...style2
|
|
17304
17360
|
},
|
|
@@ -17311,7 +17367,7 @@ var UserPointerContainer = (0, import_react103.memo)(function UserPointerContain
|
|
|
17311
17367
|
children
|
|
17312
17368
|
);
|
|
17313
17369
|
});
|
|
17314
|
-
var UserNameTag = (0,
|
|
17370
|
+
var UserNameTag = (0, import_react104.memo)(function UserNameTag2({
|
|
17315
17371
|
backgroundColor,
|
|
17316
17372
|
className,
|
|
17317
17373
|
style: style2,
|
|
@@ -17320,7 +17376,7 @@ var UserNameTag = (0, import_react103.memo)(function UserNameTag2({
|
|
|
17320
17376
|
size = "medium",
|
|
17321
17377
|
bordered = true
|
|
17322
17378
|
}) {
|
|
17323
|
-
return /* @__PURE__ */
|
|
17379
|
+
return /* @__PURE__ */ import_react104.default.createElement(
|
|
17324
17380
|
"span",
|
|
17325
17381
|
{
|
|
17326
17382
|
className: cx(
|
|
@@ -17339,14 +17395,14 @@ var UserNameTag = (0, import_react103.memo)(function UserNameTag2({
|
|
|
17339
17395
|
children
|
|
17340
17396
|
);
|
|
17341
17397
|
});
|
|
17342
|
-
var UserPointerIcon = (0,
|
|
17398
|
+
var UserPointerIcon = (0, import_react104.memo)(function PointerIcon({
|
|
17343
17399
|
size,
|
|
17344
17400
|
color = "black",
|
|
17345
17401
|
className,
|
|
17346
17402
|
style: style2
|
|
17347
17403
|
}) {
|
|
17348
17404
|
const points = "0,5 10,0 10,10";
|
|
17349
|
-
return /* @__PURE__ */
|
|
17405
|
+
return /* @__PURE__ */ import_react104.default.createElement(
|
|
17350
17406
|
"svg",
|
|
17351
17407
|
{
|
|
17352
17408
|
width: size,
|
|
@@ -17361,7 +17417,7 @@ var UserPointerIcon = (0, import_react103.memo)(function PointerIcon({
|
|
|
17361
17417
|
...style2
|
|
17362
17418
|
}
|
|
17363
17419
|
},
|
|
17364
|
-
/* @__PURE__ */
|
|
17420
|
+
/* @__PURE__ */ import_react104.default.createElement(
|
|
17365
17421
|
"polygon",
|
|
17366
17422
|
{
|
|
17367
17423
|
points,
|
|
@@ -17374,7 +17430,7 @@ var UserPointerIcon = (0, import_react103.memo)(function PointerIcon({
|
|
|
17374
17430
|
});
|
|
17375
17431
|
var POINTER_SIZE = 12;
|
|
17376
17432
|
var POINTER_OVERLAP = 6;
|
|
17377
|
-
var UserPointer = (0,
|
|
17433
|
+
var UserPointer = (0, import_react104.memo)(function UserPointer2({
|
|
17378
17434
|
userId,
|
|
17379
17435
|
name,
|
|
17380
17436
|
visible = true,
|
|
@@ -17387,22 +17443,22 @@ var UserPointer = (0, import_react103.memo)(function UserPointer2({
|
|
|
17387
17443
|
labelSize = "medium",
|
|
17388
17444
|
bordered = true
|
|
17389
17445
|
}) {
|
|
17390
|
-
const userBackgroundColor = (0,
|
|
17446
|
+
const userBackgroundColor = (0, import_react104.useMemo)(
|
|
17391
17447
|
() => backgroundColor ?? colorFromString(userId ?? name ?? ""),
|
|
17392
17448
|
[backgroundColor, userId, name]
|
|
17393
17449
|
);
|
|
17394
|
-
const pointerOverlapStyle = (0,
|
|
17450
|
+
const pointerOverlapStyle = (0, import_react104.useMemo)(
|
|
17395
17451
|
() => ({
|
|
17396
17452
|
marginRight: `-${POINTER_OVERLAP}px`,
|
|
17397
17453
|
marginBottom: `-${POINTER_OVERLAP}px`
|
|
17398
17454
|
}),
|
|
17399
17455
|
[]
|
|
17400
17456
|
);
|
|
17401
|
-
const nameTagOverlapStyle = (0,
|
|
17457
|
+
const nameTagOverlapStyle = (0, import_react104.useMemo)(
|
|
17402
17458
|
() => ({ marginLeft: `${POINTER_SIZE - POINTER_OVERLAP + 1}px` }),
|
|
17403
17459
|
[]
|
|
17404
17460
|
);
|
|
17405
|
-
return /* @__PURE__ */
|
|
17461
|
+
return /* @__PURE__ */ import_react104.default.createElement(
|
|
17406
17462
|
UserPointerContainer,
|
|
17407
17463
|
{
|
|
17408
17464
|
point,
|
|
@@ -17410,14 +17466,14 @@ var UserPointer = (0, import_react103.memo)(function UserPointer2({
|
|
|
17410
17466
|
className,
|
|
17411
17467
|
style: style2
|
|
17412
17468
|
},
|
|
17413
|
-
name && /* @__PURE__ */
|
|
17469
|
+
name && /* @__PURE__ */ import_react104.default.createElement("div", { className: "n-relative" }, showPointerIcon && /* @__PURE__ */ import_react104.default.createElement(
|
|
17414
17470
|
UserPointerIcon,
|
|
17415
17471
|
{
|
|
17416
17472
|
size: POINTER_SIZE,
|
|
17417
17473
|
color: userBackgroundColor,
|
|
17418
17474
|
style: pointerOverlapStyle
|
|
17419
17475
|
}
|
|
17420
|
-
), /* @__PURE__ */
|
|
17476
|
+
), /* @__PURE__ */ import_react104.default.createElement(
|
|
17421
17477
|
UserNameTag,
|
|
17422
17478
|
{
|
|
17423
17479
|
backgroundColor: userBackgroundColor,
|
|
@@ -17433,10 +17489,78 @@ var UserPointer = (0, import_react103.memo)(function UserPointer2({
|
|
|
17433
17489
|
|
|
17434
17490
|
// src/components/workspace/WorkspaceLayout.tsx
|
|
17435
17491
|
var import_noya_keymap7 = require("@noya-app/noya-keymap");
|
|
17436
|
-
var
|
|
17492
|
+
var import_react112 = __toESM(require("react"));
|
|
17493
|
+
|
|
17494
|
+
// src/components/OverlayToolbar.tsx
|
|
17495
|
+
var import_react105 = __toESM(require("react"));
|
|
17496
|
+
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";
|
|
17497
|
+
function OverlayToolbar({
|
|
17498
|
+
left,
|
|
17499
|
+
right,
|
|
17500
|
+
overlayLayout = "bottomCenterTopRight",
|
|
17501
|
+
className,
|
|
17502
|
+
style: style2
|
|
17503
|
+
}) {
|
|
17504
|
+
const resolvedLayout = overlayLayout === "topLeftTopRight" ? "topLeftTopRight" : "bottomCenterTopRight";
|
|
17505
|
+
const panelStyle = (0, import_react105.useMemo)(
|
|
17506
|
+
() => ({
|
|
17507
|
+
...toolbarTransparentStyle,
|
|
17508
|
+
...style2
|
|
17509
|
+
}),
|
|
17510
|
+
[style2]
|
|
17511
|
+
);
|
|
17512
|
+
const renderLeftPanel = (overlayId) => {
|
|
17513
|
+
if (!left) return null;
|
|
17514
|
+
return /* @__PURE__ */ import_react105.default.createElement(
|
|
17515
|
+
"div",
|
|
17516
|
+
{
|
|
17517
|
+
className: panelClassName,
|
|
17518
|
+
"data-embedded-overlay-id": overlayId,
|
|
17519
|
+
style: panelStyle
|
|
17520
|
+
},
|
|
17521
|
+
left
|
|
17522
|
+
);
|
|
17523
|
+
};
|
|
17524
|
+
return /* @__PURE__ */ import_react105.default.createElement(import_react105.default.Fragment, null, resolvedLayout === "bottomCenterTopRight" ? /* @__PURE__ */ import_react105.default.createElement(
|
|
17525
|
+
"div",
|
|
17526
|
+
{
|
|
17527
|
+
className: cx(
|
|
17528
|
+
"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",
|
|
17529
|
+
className
|
|
17530
|
+
)
|
|
17531
|
+
},
|
|
17532
|
+
renderLeftPanel("noya-toolbar-bottom-center")
|
|
17533
|
+
) : /* @__PURE__ */ import_react105.default.createElement(
|
|
17534
|
+
"div",
|
|
17535
|
+
{
|
|
17536
|
+
className: cx(
|
|
17537
|
+
"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",
|
|
17538
|
+
className
|
|
17539
|
+
)
|
|
17540
|
+
},
|
|
17541
|
+
renderLeftPanel("noya-toolbar-top-left")
|
|
17542
|
+
), right && /* @__PURE__ */ import_react105.default.createElement(
|
|
17543
|
+
"div",
|
|
17544
|
+
{
|
|
17545
|
+
className: cx(
|
|
17546
|
+
"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",
|
|
17547
|
+
className
|
|
17548
|
+
)
|
|
17549
|
+
},
|
|
17550
|
+
/* @__PURE__ */ import_react105.default.createElement(
|
|
17551
|
+
"div",
|
|
17552
|
+
{
|
|
17553
|
+
className: panelClassName,
|
|
17554
|
+
"data-embedded-overlay-id": "noya-toolbar-top-right",
|
|
17555
|
+
style: panelStyle
|
|
17556
|
+
},
|
|
17557
|
+
right
|
|
17558
|
+
)
|
|
17559
|
+
));
|
|
17560
|
+
}
|
|
17437
17561
|
|
|
17438
17562
|
// src/components/workspace/DrawerWorkspaceLayout.tsx
|
|
17439
|
-
var
|
|
17563
|
+
var import_react109 = __toESM(require("react"));
|
|
17440
17564
|
|
|
17441
17565
|
// src/components/workspace/constants.ts
|
|
17442
17566
|
var EDITOR_PANEL_GROUP_ID = "editor-panel-group";
|
|
@@ -17445,17 +17569,17 @@ var RIGHT_SIDEBAR_ID = "editor-3-right-sidebar";
|
|
|
17445
17569
|
var CONTENT_AREA_ID = "editor-2-content-area";
|
|
17446
17570
|
|
|
17447
17571
|
// src/components/workspace/VerticalTabMenu.tsx
|
|
17448
|
-
var
|
|
17572
|
+
var import_react108 = __toESM(require("react"));
|
|
17449
17573
|
|
|
17450
17574
|
// src/components/Toolbar.tsx
|
|
17451
17575
|
var import_noya_keymap6 = require("@noya-app/noya-keymap");
|
|
17452
|
-
var
|
|
17576
|
+
var import_react107 = __toESM(require("react"));
|
|
17453
17577
|
|
|
17454
17578
|
// src/components/ToolbarDrawer.tsx
|
|
17455
|
-
var
|
|
17456
|
-
var ToolbarDrawer = (0,
|
|
17457
|
-
(0,
|
|
17458
|
-
return /* @__PURE__ */
|
|
17579
|
+
var import_react106 = __toESM(require("react"));
|
|
17580
|
+
var ToolbarDrawer = (0, import_react106.memo)(
|
|
17581
|
+
(0, import_react106.forwardRef)(function ToolbarDrawer2({ children, trigger, sideOffset = 8 }, ref) {
|
|
17582
|
+
return /* @__PURE__ */ import_react106.default.createElement("div", { className: "n-relative", ref }, /* @__PURE__ */ import_react106.default.createElement(
|
|
17459
17583
|
"div",
|
|
17460
17584
|
{
|
|
17461
17585
|
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",
|
|
@@ -17471,25 +17595,26 @@ var ToolbarDrawer = (0, import_react104.memo)(
|
|
|
17471
17595
|
|
|
17472
17596
|
// src/components/Toolbar.tsx
|
|
17473
17597
|
var SIDE_OFFSET = 6;
|
|
17474
|
-
var ToolbarMenuContext = (0,
|
|
17598
|
+
var ToolbarMenuContext = (0, import_react107.createContext)({});
|
|
17475
17599
|
var ToolbarMenuDropdown = memoGeneric(function ToolbarMenuDropdown2({
|
|
17476
17600
|
item,
|
|
17477
17601
|
onSelectMenuItem
|
|
17478
17602
|
}) {
|
|
17479
|
-
const [open, setOpen] =
|
|
17480
|
-
return /* @__PURE__ */
|
|
17603
|
+
const [open, setOpen] = import_react107.default.useState(false);
|
|
17604
|
+
return /* @__PURE__ */ import_react107.default.createElement(
|
|
17481
17605
|
DropdownMenu,
|
|
17482
17606
|
{
|
|
17483
17607
|
open,
|
|
17484
17608
|
onOpenChange: setOpen,
|
|
17485
17609
|
items: item.items,
|
|
17610
|
+
modal: false,
|
|
17486
17611
|
onSelect: (value) => {
|
|
17487
17612
|
if (onSelectMenuItem && value) {
|
|
17488
17613
|
onSelectMenuItem(value);
|
|
17489
17614
|
}
|
|
17490
17615
|
}
|
|
17491
17616
|
},
|
|
17492
|
-
/* @__PURE__ */
|
|
17617
|
+
/* @__PURE__ */ import_react107.default.createElement(
|
|
17493
17618
|
Button,
|
|
17494
17619
|
{
|
|
17495
17620
|
disabled: item.disabled,
|
|
@@ -17505,7 +17630,7 @@ var ToolbarShortcut = ({
|
|
|
17505
17630
|
shortcut,
|
|
17506
17631
|
label
|
|
17507
17632
|
}) => {
|
|
17508
|
-
return /* @__PURE__ */
|
|
17633
|
+
return /* @__PURE__ */ import_react107.default.createElement("div", { className: "n-flex n-items-center" }, label, /* @__PURE__ */ import_react107.default.createElement(Spacer.Horizontal, { size: 6 }), /* @__PURE__ */ import_react107.default.createElement(KeyboardShortcut, { shortcut }));
|
|
17509
17634
|
};
|
|
17510
17635
|
var ToolbarMenuPopover = memoGeneric(function ToolbarMenuPopover2({
|
|
17511
17636
|
item,
|
|
@@ -17519,8 +17644,8 @@ var ToolbarMenuPopover = memoGeneric(function ToolbarMenuPopover2({
|
|
|
17519
17644
|
content: itemContent,
|
|
17520
17645
|
checked
|
|
17521
17646
|
} = item;
|
|
17522
|
-
const [open, setOpen] =
|
|
17523
|
-
const content = /* @__PURE__ */
|
|
17647
|
+
const [open, setOpen] = import_react107.default.useState(false);
|
|
17648
|
+
const content = /* @__PURE__ */ import_react107.default.createElement("span", null, /* @__PURE__ */ import_react107.default.createElement(
|
|
17524
17649
|
Popover,
|
|
17525
17650
|
{
|
|
17526
17651
|
open,
|
|
@@ -17529,7 +17654,7 @@ var ToolbarMenuPopover = memoGeneric(function ToolbarMenuPopover2({
|
|
|
17529
17654
|
showArrow: false,
|
|
17530
17655
|
sideOffset: SIDE_OFFSET,
|
|
17531
17656
|
portalContainer,
|
|
17532
|
-
trigger: /* @__PURE__ */
|
|
17657
|
+
trigger: /* @__PURE__ */ import_react107.default.createElement(
|
|
17533
17658
|
Button,
|
|
17534
17659
|
{
|
|
17535
17660
|
disabled,
|
|
@@ -17542,7 +17667,7 @@ var ToolbarMenuPopover = memoGeneric(function ToolbarMenuPopover2({
|
|
|
17542
17667
|
},
|
|
17543
17668
|
typeof itemContent === "function" ? itemContent({ close: () => setOpen(false) }) : itemContent
|
|
17544
17669
|
));
|
|
17545
|
-
return tooltip && !open ? /* @__PURE__ */
|
|
17670
|
+
return tooltip && !open ? /* @__PURE__ */ import_react107.default.createElement(
|
|
17546
17671
|
Tooltip,
|
|
17547
17672
|
{
|
|
17548
17673
|
sideOffset: SIDE_OFFSET,
|
|
@@ -17562,7 +17687,7 @@ var ToolbarMenuButton = memoGeneric(function ToolbarMenuButton2({
|
|
|
17562
17687
|
displayFilter
|
|
17563
17688
|
}) {
|
|
17564
17689
|
const isActive = item.checked || activeValue === item.value;
|
|
17565
|
-
const content = /* @__PURE__ */
|
|
17690
|
+
const content = /* @__PURE__ */ import_react107.default.createElement(
|
|
17566
17691
|
Button,
|
|
17567
17692
|
{
|
|
17568
17693
|
as,
|
|
@@ -17579,7 +17704,7 @@ var ToolbarMenuButton = memoGeneric(function ToolbarMenuButton2({
|
|
|
17579
17704
|
displayFilter === "iconOnly" ? void 0 : item.title
|
|
17580
17705
|
);
|
|
17581
17706
|
const tooltip = item.tooltip ?? (displayFilter === "iconOnly" && item.title ? item.title : void 0);
|
|
17582
|
-
return item.drawer && isActive ? /* @__PURE__ */
|
|
17707
|
+
return item.drawer && isActive ? /* @__PURE__ */ import_react107.default.createElement(ToolbarDrawer, { trigger: content }, item.drawer) : tooltip ? /* @__PURE__ */ import_react107.default.createElement(Tooltip, { sideOffset: SIDE_OFFSET, content: tooltip, side: tooltipSide }, content) : content;
|
|
17583
17708
|
});
|
|
17584
17709
|
var ToolbarMenuItem = memoGeneric(function ToolbarMenuItem2({
|
|
17585
17710
|
item,
|
|
@@ -17591,17 +17716,17 @@ var ToolbarMenuItem = memoGeneric(function ToolbarMenuItem2({
|
|
|
17591
17716
|
displayFilter,
|
|
17592
17717
|
dividerOverflow: dividerOverflowProp
|
|
17593
17718
|
}) {
|
|
17594
|
-
const { dividerOverflow: contextDividerOverflow } = (0,
|
|
17719
|
+
const { dividerOverflow: contextDividerOverflow } = (0, import_react107.useContext)(ToolbarMenuContext);
|
|
17595
17720
|
const dividerOverflow = dividerOverflowProp ?? contextDividerOverflow ?? 4;
|
|
17596
17721
|
if (item.type === "sectionHeader") return null;
|
|
17597
17722
|
if (item.type === "separator") {
|
|
17598
|
-
return /* @__PURE__ */
|
|
17723
|
+
return /* @__PURE__ */ import_react107.default.createElement(DividerVertical, { overflow: dividerOverflow });
|
|
17599
17724
|
}
|
|
17600
17725
|
if (item.type === "popover") {
|
|
17601
|
-
return /* @__PURE__ */
|
|
17726
|
+
return /* @__PURE__ */ import_react107.default.createElement(ToolbarMenuPopover, { item, portalContainer });
|
|
17602
17727
|
}
|
|
17603
17728
|
if (isSelectableMenuItem(item)) {
|
|
17604
|
-
return /* @__PURE__ */
|
|
17729
|
+
return /* @__PURE__ */ import_react107.default.createElement(
|
|
17605
17730
|
ToolbarMenuButton,
|
|
17606
17731
|
{
|
|
17607
17732
|
item,
|
|
@@ -17613,7 +17738,7 @@ var ToolbarMenuItem = memoGeneric(function ToolbarMenuItem2({
|
|
|
17613
17738
|
}
|
|
17614
17739
|
);
|
|
17615
17740
|
}
|
|
17616
|
-
return /* @__PURE__ */
|
|
17741
|
+
return /* @__PURE__ */ import_react107.default.createElement(ToolbarMenuDropdown, { item, onSelectMenuItem });
|
|
17617
17742
|
});
|
|
17618
17743
|
var ToolbarMenu = memoGeneric(function ToolbarMenu2({
|
|
17619
17744
|
items,
|
|
@@ -17625,8 +17750,8 @@ var ToolbarMenu = memoGeneric(function ToolbarMenu2({
|
|
|
17625
17750
|
displayFilter = "iconAndText",
|
|
17626
17751
|
dividerOverflow
|
|
17627
17752
|
}) {
|
|
17628
|
-
return /* @__PURE__ */
|
|
17629
|
-
return /* @__PURE__ */
|
|
17753
|
+
return /* @__PURE__ */ import_react107.default.createElement(import_react107.default.Fragment, null, items.map((item, i) => {
|
|
17754
|
+
return /* @__PURE__ */ import_react107.default.createElement(
|
|
17630
17755
|
ToolbarMenuItem,
|
|
17631
17756
|
{
|
|
17632
17757
|
key: i,
|
|
@@ -17642,6 +17767,14 @@ var ToolbarMenu = memoGeneric(function ToolbarMenu2({
|
|
|
17642
17767
|
);
|
|
17643
17768
|
}));
|
|
17644
17769
|
});
|
|
17770
|
+
function useBindKeyboardShortcutsForMenuItems(items, onSelectMenuItem) {
|
|
17771
|
+
return (0, import_noya_keymap6.useKeyboardShortcuts)(
|
|
17772
|
+
import_react107.default.useMemo(
|
|
17773
|
+
() => onSelectMenuItem ? getKeyboardShortcutsForMenuItems(items, onSelectMenuItem) : {},
|
|
17774
|
+
[items, onSelectMenuItem]
|
|
17775
|
+
)
|
|
17776
|
+
);
|
|
17777
|
+
}
|
|
17645
17778
|
function Toolbar({
|
|
17646
17779
|
children,
|
|
17647
17780
|
logo,
|
|
@@ -17651,21 +17784,19 @@ function Toolbar({
|
|
|
17651
17784
|
shouldBindKeyboardShortcuts = true,
|
|
17652
17785
|
dividerOverflow
|
|
17653
17786
|
}) {
|
|
17654
|
-
const allMenuItems =
|
|
17787
|
+
const allMenuItems = import_react107.default.useMemo(
|
|
17655
17788
|
() => [...leftMenuItems, ...rightMenuItems],
|
|
17656
17789
|
[leftMenuItems, rightMenuItems]
|
|
17657
17790
|
);
|
|
17658
|
-
(
|
|
17659
|
-
|
|
17660
|
-
|
|
17661
|
-
[allMenuItems, onSelectMenuItem, shouldBindKeyboardShortcuts]
|
|
17662
|
-
)
|
|
17791
|
+
useBindKeyboardShortcutsForMenuItems(
|
|
17792
|
+
allMenuItems,
|
|
17793
|
+
shouldBindKeyboardShortcuts ? onSelectMenuItem : void 0
|
|
17663
17794
|
);
|
|
17664
|
-
return /* @__PURE__ */
|
|
17795
|
+
return /* @__PURE__ */ import_react107.default.createElement(
|
|
17665
17796
|
BaseToolbar,
|
|
17666
17797
|
{
|
|
17667
17798
|
logo,
|
|
17668
|
-
left: leftMenuItems.length > 0 && /* @__PURE__ */
|
|
17799
|
+
left: leftMenuItems.length > 0 && /* @__PURE__ */ import_react107.default.createElement("div", { className: "n-flex n-gap-2" }, /* @__PURE__ */ import_react107.default.createElement(
|
|
17669
17800
|
ToolbarMenu,
|
|
17670
17801
|
{
|
|
17671
17802
|
items: leftMenuItems,
|
|
@@ -17673,7 +17804,7 @@ function Toolbar({
|
|
|
17673
17804
|
dividerOverflow
|
|
17674
17805
|
}
|
|
17675
17806
|
)),
|
|
17676
|
-
right: rightMenuItems.length > 0 && /* @__PURE__ */
|
|
17807
|
+
right: rightMenuItems.length > 0 && /* @__PURE__ */ import_react107.default.createElement("div", { className: "n-flex n-gap-2" }, /* @__PURE__ */ import_react107.default.createElement(
|
|
17677
17808
|
ToolbarMenu,
|
|
17678
17809
|
{
|
|
17679
17810
|
items: rightMenuItems,
|
|
@@ -17694,19 +17825,19 @@ var VerticalTabMenu = memoGeneric(function VerticalTabMenu2({
|
|
|
17694
17825
|
onChange,
|
|
17695
17826
|
tooltipSide
|
|
17696
17827
|
}) {
|
|
17697
|
-
const style2 = (0,
|
|
17828
|
+
const style2 = (0, import_react108.useMemo)(() => {
|
|
17698
17829
|
return {
|
|
17699
17830
|
[cssVarNames.colors.inputBackground]: "transparent",
|
|
17700
17831
|
[cssVarNames.colors.buttonBackground]: "transparent"
|
|
17701
17832
|
};
|
|
17702
17833
|
}, []);
|
|
17703
|
-
return /* @__PURE__ */
|
|
17834
|
+
return /* @__PURE__ */ import_react108.default.createElement(
|
|
17704
17835
|
"div",
|
|
17705
17836
|
{
|
|
17706
17837
|
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",
|
|
17707
17838
|
style: style2
|
|
17708
17839
|
},
|
|
17709
|
-
/* @__PURE__ */
|
|
17840
|
+
/* @__PURE__ */ import_react108.default.createElement(
|
|
17710
17841
|
ToolbarMenu,
|
|
17711
17842
|
{
|
|
17712
17843
|
items,
|
|
@@ -17734,12 +17865,12 @@ var DrawerWorkspaceLayout = memoGeneric(function DrawerWorkspaceLayout2({
|
|
|
17734
17865
|
onChangeLeftTab,
|
|
17735
17866
|
compactDrawerMenu
|
|
17736
17867
|
}) {
|
|
17737
|
-
const portalContainer = (0,
|
|
17738
|
-
const [{ leftSidebarCollapsed, rightSidebarCollapsed }, setLayoutState] = (0,
|
|
17868
|
+
const portalContainer = (0, import_react109.useRef)(null);
|
|
17869
|
+
const [{ leftSidebarCollapsed, rightSidebarCollapsed }, setLayoutState] = (0, import_react109.useState)({
|
|
17739
17870
|
leftSidebarCollapsed: true,
|
|
17740
17871
|
rightSidebarCollapsed: true
|
|
17741
17872
|
});
|
|
17742
|
-
const allTabItems = (0,
|
|
17873
|
+
const allTabItems = (0, import_react109.useMemo)(
|
|
17743
17874
|
() => [
|
|
17744
17875
|
...leftPanel ? leftTabItems ?? [] : [],
|
|
17745
17876
|
...rightPanel ? rightTabItems ?? [] : []
|
|
@@ -17747,16 +17878,16 @@ var DrawerWorkspaceLayout = memoGeneric(function DrawerWorkspaceLayout2({
|
|
|
17747
17878
|
[leftTabItems, rightTabItems, leftPanel, rightPanel]
|
|
17748
17879
|
);
|
|
17749
17880
|
const hasTabs = allTabItems.length > 0;
|
|
17750
|
-
const allSelectableTabItems = (0,
|
|
17881
|
+
const allSelectableTabItems = (0, import_react109.useMemo)(
|
|
17751
17882
|
() => allTabItems.filter(isSelectableMenuItem),
|
|
17752
17883
|
[allTabItems]
|
|
17753
17884
|
);
|
|
17754
17885
|
const useCompactInToolbar = !!compactDrawerMenu && allSelectableTabItems.length <= 1;
|
|
17755
|
-
const leftSelectableTabItems = (0,
|
|
17886
|
+
const leftSelectableTabItems = (0, import_react109.useMemo)(
|
|
17756
17887
|
() => (leftTabItems ?? []).filter(isSelectableMenuItem),
|
|
17757
17888
|
[leftTabItems]
|
|
17758
17889
|
);
|
|
17759
|
-
const rightSelectableTabItems = (0,
|
|
17890
|
+
const rightSelectableTabItems = (0, import_react109.useMemo)(
|
|
17760
17891
|
() => (rightTabItems ?? []).filter(isSelectableMenuItem),
|
|
17761
17892
|
[rightTabItems]
|
|
17762
17893
|
);
|
|
@@ -17793,14 +17924,14 @@ var DrawerWorkspaceLayout = memoGeneric(function DrawerWorkspaceLayout2({
|
|
|
17793
17924
|
activeValue: rightTabValue,
|
|
17794
17925
|
isSidebarCollapsed: rightSidebarCollapsed
|
|
17795
17926
|
} : { activeValue: void 0, isSidebarCollapsed: true };
|
|
17796
|
-
return /* @__PURE__ */
|
|
17927
|
+
return /* @__PURE__ */ import_react109.default.createElement(
|
|
17797
17928
|
"div",
|
|
17798
17929
|
{
|
|
17799
17930
|
ref: portalContainer,
|
|
17800
17931
|
id: EDITOR_PANEL_GROUP_ID,
|
|
17801
17932
|
className: "n-flex n-flex-1 n-relative focus:n-outline-none"
|
|
17802
17933
|
},
|
|
17803
|
-
hasTabs && !useCompactInToolbar && /* @__PURE__ */
|
|
17934
|
+
hasTabs && !useCompactInToolbar && /* @__PURE__ */ import_react109.default.createElement(import_react109.default.Fragment, null, /* @__PURE__ */ import_react109.default.createElement(
|
|
17804
17935
|
VerticalTabMenu,
|
|
17805
17936
|
{
|
|
17806
17937
|
tooltipSide: "right",
|
|
@@ -17809,8 +17940,8 @@ var DrawerWorkspaceLayout = memoGeneric(function DrawerWorkspaceLayout2({
|
|
|
17809
17940
|
isSidebarCollapsed,
|
|
17810
17941
|
onChange: (value) => handleSelectTab(value)
|
|
17811
17942
|
}
|
|
17812
|
-
), /* @__PURE__ */
|
|
17813
|
-
useCompactInToolbar && /* @__PURE__ */
|
|
17943
|
+
), /* @__PURE__ */ import_react109.default.createElement(DividerVertical, { className: "n-h-full" })),
|
|
17944
|
+
useCompactInToolbar && /* @__PURE__ */ import_react109.default.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__ */ import_react109.default.createElement(
|
|
17814
17945
|
Button,
|
|
17815
17946
|
{
|
|
17816
17947
|
variant: "none",
|
|
@@ -17833,8 +17964,8 @@ var DrawerWorkspaceLayout = memoGeneric(function DrawerWorkspaceLayout2({
|
|
|
17833
17964
|
}
|
|
17834
17965
|
}
|
|
17835
17966
|
)),
|
|
17836
|
-
/* @__PURE__ */
|
|
17837
|
-
leftPanel && /* @__PURE__ */
|
|
17967
|
+
/* @__PURE__ */ import_react109.default.createElement("div", { className: "n-flex-1 n-flex n-relative" }, centerPanel),
|
|
17968
|
+
leftPanel && /* @__PURE__ */ import_react109.default.createElement(
|
|
17838
17969
|
Drawer,
|
|
17839
17970
|
{
|
|
17840
17971
|
ref: leftSidebarRef,
|
|
@@ -17855,7 +17986,7 @@ var DrawerWorkspaceLayout = memoGeneric(function DrawerWorkspaceLayout2({
|
|
|
17855
17986
|
},
|
|
17856
17987
|
leftPanel
|
|
17857
17988
|
),
|
|
17858
|
-
rightPanel && /* @__PURE__ */
|
|
17989
|
+
rightPanel && /* @__PURE__ */ import_react109.default.createElement(
|
|
17859
17990
|
Drawer,
|
|
17860
17991
|
{
|
|
17861
17992
|
id: RIGHT_SIDEBAR_ID,
|
|
@@ -17881,7 +18012,7 @@ var DrawerWorkspaceLayout = memoGeneric(function DrawerWorkspaceLayout2({
|
|
|
17881
18012
|
});
|
|
17882
18013
|
|
|
17883
18014
|
// src/components/workspace/PanelWorkspaceLayout.tsx
|
|
17884
|
-
var
|
|
18015
|
+
var import_react110 = __toESM(require("react"));
|
|
17885
18016
|
var import_react_resizable_panels = require("react-resizable-panels");
|
|
17886
18017
|
|
|
17887
18018
|
// src/components/workspace/panelStorage.ts
|
|
@@ -18047,11 +18178,11 @@ var PanelWorkspaceLayout = memoGeneric(function PanelWorkspaceLayout2({
|
|
|
18047
18178
|
onChangeRightTab,
|
|
18048
18179
|
compactDrawerMenu
|
|
18049
18180
|
}) {
|
|
18050
|
-
const panelGroupRef = (0,
|
|
18181
|
+
const panelGroupRef = (0, import_react110.useRef)(null);
|
|
18051
18182
|
const hasLeftPanel = !!leftPanel;
|
|
18052
18183
|
const hasRightPanel = !!rightPanel;
|
|
18053
18184
|
const hasCenterPanel = !!centerPanel;
|
|
18054
|
-
const autoSaveId = (0,
|
|
18185
|
+
const autoSaveId = (0, import_react110.useMemo)(() => {
|
|
18055
18186
|
return autoSavePrefix ? `${autoSavePrefix}--v2--${EDITOR_PANEL_GROUP_ID}` : Math.random().toString(36).substring(2, 15);
|
|
18056
18187
|
}, [autoSavePrefix]);
|
|
18057
18188
|
const layoutIds = getLayoutIds({
|
|
@@ -18078,7 +18209,7 @@ var PanelWorkspaceLayout = memoGeneric(function PanelWorkspaceLayout2({
|
|
|
18078
18209
|
});
|
|
18079
18210
|
const [data, setData] = usePersistentStateObject(clientStorage, storageKey, {});
|
|
18080
18211
|
const layoutGroup = data?.[propertyKey];
|
|
18081
|
-
const { leftSidebarCollapsed, rightSidebarCollapsed } = (0,
|
|
18212
|
+
const { leftSidebarCollapsed, rightSidebarCollapsed } = (0, import_react110.useMemo)(() => {
|
|
18082
18213
|
return getLayoutCollapsedState({
|
|
18083
18214
|
layoutGroup,
|
|
18084
18215
|
propertyKey,
|
|
@@ -18087,7 +18218,7 @@ var PanelWorkspaceLayout = memoGeneric(function PanelWorkspaceLayout2({
|
|
|
18087
18218
|
hasRightPanel
|
|
18088
18219
|
});
|
|
18089
18220
|
}, [layoutGroup, propertyKey, layoutIds, hasLeftPanel, hasRightPanel]);
|
|
18090
|
-
const handleLeftTabChange = (0,
|
|
18221
|
+
const handleLeftTabChange = (0, import_react110.useCallback)(
|
|
18091
18222
|
(value) => {
|
|
18092
18223
|
if (value === leftTabValue) {
|
|
18093
18224
|
if (leftSidebarRef.current?.isExpanded()) {
|
|
@@ -18104,7 +18235,7 @@ var PanelWorkspaceLayout = memoGeneric(function PanelWorkspaceLayout2({
|
|
|
18104
18235
|
},
|
|
18105
18236
|
[leftSidebarRef, leftTabValue, onChangeLeftTab]
|
|
18106
18237
|
);
|
|
18107
|
-
const handleRightTabChange = (0,
|
|
18238
|
+
const handleRightTabChange = (0, import_react110.useCallback)(
|
|
18108
18239
|
(value) => {
|
|
18109
18240
|
if (value === rightTabValue) {
|
|
18110
18241
|
if (rightSidebarRef.current?.isExpanded()) {
|
|
@@ -18121,7 +18252,7 @@ var PanelWorkspaceLayout = memoGeneric(function PanelWorkspaceLayout2({
|
|
|
18121
18252
|
},
|
|
18122
18253
|
[onChangeRightTab, rightSidebarRef, rightTabValue]
|
|
18123
18254
|
);
|
|
18124
|
-
const handleLayoutChange = (0,
|
|
18255
|
+
const handleLayoutChange = (0, import_react110.useCallback)(
|
|
18125
18256
|
(layout) => {
|
|
18126
18257
|
setData((prev) => {
|
|
18127
18258
|
const newData = {
|
|
@@ -18139,7 +18270,7 @@ var PanelWorkspaceLayout = memoGeneric(function PanelWorkspaceLayout2({
|
|
|
18139
18270
|
const showLeftTabs = !!leftSidebarOptions.showTabs && !!leftTabItems && // When compact drawer UI is enabled, only show the rail when the
|
|
18140
18271
|
// sidebar is collapsed (for large screens/panel layout).
|
|
18141
18272
|
(!compactDrawerMenu || leftSidebarCollapsed);
|
|
18142
|
-
return /* @__PURE__ */
|
|
18273
|
+
return /* @__PURE__ */ import_react110.default.createElement(
|
|
18143
18274
|
import_react_resizable_panels.PanelGroup,
|
|
18144
18275
|
{
|
|
18145
18276
|
ref: panelGroupRef,
|
|
@@ -18150,7 +18281,7 @@ var PanelWorkspaceLayout = memoGeneric(function PanelWorkspaceLayout2({
|
|
|
18150
18281
|
autoSaveId,
|
|
18151
18282
|
onLayout: handleLayoutChange
|
|
18152
18283
|
},
|
|
18153
|
-
leftPanel && /* @__PURE__ */
|
|
18284
|
+
leftPanel && /* @__PURE__ */ import_react110.default.createElement(import_react110.default.Fragment, null, showLeftTabs && /* @__PURE__ */ import_react110.default.createElement(
|
|
18154
18285
|
VerticalTabMenu,
|
|
18155
18286
|
{
|
|
18156
18287
|
tooltipSide: "right",
|
|
@@ -18159,7 +18290,7 @@ var PanelWorkspaceLayout = memoGeneric(function PanelWorkspaceLayout2({
|
|
|
18159
18290
|
isSidebarCollapsed: leftSidebarCollapsed,
|
|
18160
18291
|
onChange: handleLeftTabChange
|
|
18161
18292
|
}
|
|
18162
|
-
), showLeftTabs && !leftSidebarCollapsed && /* @__PURE__ */
|
|
18293
|
+
), showLeftTabs && !leftSidebarCollapsed && /* @__PURE__ */ import_react110.default.createElement(DividerVertical, { className: "n-h-full" }), /* @__PURE__ */ import_react110.default.createElement(
|
|
18163
18294
|
import_react_resizable_panels.Panel,
|
|
18164
18295
|
{
|
|
18165
18296
|
id: LEFT_SIDEBAR_ID,
|
|
@@ -18172,8 +18303,8 @@ var PanelWorkspaceLayout = memoGeneric(function PanelWorkspaceLayout2({
|
|
|
18172
18303
|
collapsible: true
|
|
18173
18304
|
},
|
|
18174
18305
|
leftSidebarCollapsed ? null : leftPanel
|
|
18175
|
-
), /* @__PURE__ */
|
|
18176
|
-
/* @__PURE__ */
|
|
18306
|
+
), /* @__PURE__ */ import_react110.default.createElement(import_react_resizable_panels.PanelResizeHandle, { className: "n-cursor-col-resize n-w-px n-h-full n-bg-divider" })),
|
|
18307
|
+
/* @__PURE__ */ import_react110.default.createElement(
|
|
18177
18308
|
import_react_resizable_panels.Panel,
|
|
18178
18309
|
{
|
|
18179
18310
|
id: CONTENT_AREA_ID,
|
|
@@ -18184,7 +18315,7 @@ var PanelWorkspaceLayout = memoGeneric(function PanelWorkspaceLayout2({
|
|
|
18184
18315
|
},
|
|
18185
18316
|
centerPanel
|
|
18186
18317
|
),
|
|
18187
|
-
rightPanel && /* @__PURE__ */
|
|
18318
|
+
rightPanel && /* @__PURE__ */ import_react110.default.createElement(import_react110.default.Fragment, null, /* @__PURE__ */ import_react110.default.createElement(import_react_resizable_panels.PanelResizeHandle, { className: "n-cursor-col-resize n-w-px n-h-full n-bg-divider" }), /* @__PURE__ */ import_react110.default.createElement(
|
|
18188
18319
|
import_react_resizable_panels.Panel,
|
|
18189
18320
|
{
|
|
18190
18321
|
id: RIGHT_SIDEBAR_ID,
|
|
@@ -18197,7 +18328,7 @@ var PanelWorkspaceLayout = memoGeneric(function PanelWorkspaceLayout2({
|
|
|
18197
18328
|
collapsible: true
|
|
18198
18329
|
},
|
|
18199
18330
|
rightSidebarCollapsed ? null : rightPanel
|
|
18200
|
-
), rightSidebarOptions.showTabs && rightTabItems && !rightSidebarCollapsed && /* @__PURE__ */
|
|
18331
|
+
), rightSidebarOptions.showTabs && rightTabItems && !rightSidebarCollapsed && /* @__PURE__ */ import_react110.default.createElement(DividerVertical, { className: "n-h-full" }), rightSidebarOptions.showTabs && rightTabItems && /* @__PURE__ */ import_react110.default.createElement(
|
|
18201
18332
|
VerticalTabMenu,
|
|
18202
18333
|
{
|
|
18203
18334
|
tooltipSide: "left",
|
|
@@ -18219,11 +18350,11 @@ function renderPanelChildren(fn, props) {
|
|
|
18219
18350
|
}
|
|
18220
18351
|
|
|
18221
18352
|
// src/components/workspace/WorkspaceSideContext.tsx
|
|
18222
|
-
var
|
|
18223
|
-
var WorkspaceSideContext = (0,
|
|
18353
|
+
var import_react111 = require("react");
|
|
18354
|
+
var WorkspaceSideContext = (0, import_react111.createContext)({});
|
|
18224
18355
|
var WorkspaceSideProvider = WorkspaceSideContext.Provider;
|
|
18225
18356
|
function useWorkspaceSide() {
|
|
18226
|
-
return (0,
|
|
18357
|
+
return (0, import_react111.useContext)(WorkspaceSideContext);
|
|
18227
18358
|
}
|
|
18228
18359
|
|
|
18229
18360
|
// src/components/workspace/WorkspaceLayout.tsx
|
|
@@ -18257,6 +18388,10 @@ var WorkspaceLayout = forwardRefGeneric(function WorkspaceLayout2({
|
|
|
18257
18388
|
className,
|
|
18258
18389
|
style: style2,
|
|
18259
18390
|
toolbar,
|
|
18391
|
+
toolbarVariant = "default",
|
|
18392
|
+
overlayToolbarLeft,
|
|
18393
|
+
overlayToolbarRight,
|
|
18394
|
+
overlayLayout,
|
|
18260
18395
|
children,
|
|
18261
18396
|
sideType = "auto",
|
|
18262
18397
|
sideTypeBreakpoint = 800,
|
|
@@ -18286,7 +18421,7 @@ var WorkspaceLayout = forwardRefGeneric(function WorkspaceLayout2({
|
|
|
18286
18421
|
theme,
|
|
18287
18422
|
compactDrawerMenu
|
|
18288
18423
|
}, forwardedRef) {
|
|
18289
|
-
const containerRef =
|
|
18424
|
+
const containerRef = import_react112.default.useRef(null);
|
|
18290
18425
|
const containerSize = useSize(containerRef);
|
|
18291
18426
|
const windowSize = useWindowSize();
|
|
18292
18427
|
const parentSize = detectSize === "window" ? windowSize : containerSize && containerSize.width > 0 ? containerSize : windowSize;
|
|
@@ -18317,8 +18452,8 @@ var WorkspaceLayout = forwardRefGeneric(function WorkspaceLayout2({
|
|
|
18317
18452
|
rightSidebarMinPercentage,
|
|
18318
18453
|
rightSidebarMaxPercentage
|
|
18319
18454
|
);
|
|
18320
|
-
const leftSidebarRef = (0,
|
|
18321
|
-
const rightSidebarRef = (0,
|
|
18455
|
+
const leftSidebarRef = (0, import_react112.useRef)(null);
|
|
18456
|
+
const rightSidebarRef = (0, import_react112.useRef)(null);
|
|
18322
18457
|
const [leftTabValue, setLeftTabValue] = useControlledOrUncontrolled({
|
|
18323
18458
|
value: leftTabValueProp,
|
|
18324
18459
|
onChange: onChangeLeftTab,
|
|
@@ -18329,7 +18464,7 @@ var WorkspaceLayout = forwardRefGeneric(function WorkspaceLayout2({
|
|
|
18329
18464
|
onChange: onChangeRightTab,
|
|
18330
18465
|
defaultValue: getFirstTabValue(rightTabItems, "")
|
|
18331
18466
|
});
|
|
18332
|
-
(0,
|
|
18467
|
+
(0, import_react112.useImperativeHandle)(forwardedRef, () => ({
|
|
18333
18468
|
setLeftExpanded: (expanded) => {
|
|
18334
18469
|
if (expanded) {
|
|
18335
18470
|
leftSidebarRef.current?.expand();
|
|
@@ -18387,56 +18522,56 @@ var WorkspaceLayout = forwardRefGeneric(function WorkspaceLayout2({
|
|
|
18387
18522
|
});
|
|
18388
18523
|
const centerPanelPercentage = 100 - (left ? leftSidebarPercentage : 0) - (right ? rightSidebarPercentage : 0);
|
|
18389
18524
|
const isDrawerActive = sideType === "drawer" || sideType === "auto" && parentSize.width <= sideTypeBreakpoint;
|
|
18390
|
-
const closeLeftSidebar = (0,
|
|
18525
|
+
const closeLeftSidebar = (0, import_react112.useCallback)(() => {
|
|
18391
18526
|
if (isDrawerActive) {
|
|
18392
18527
|
leftSidebarRef.current?.collapse();
|
|
18393
18528
|
}
|
|
18394
18529
|
}, [isDrawerActive]);
|
|
18395
|
-
const closeRightSidebar = (0,
|
|
18530
|
+
const closeRightSidebar = (0, import_react112.useCallback)(() => {
|
|
18396
18531
|
if (isDrawerActive) {
|
|
18397
18532
|
rightSidebarRef.current?.collapse();
|
|
18398
18533
|
}
|
|
18399
18534
|
}, [isDrawerActive]);
|
|
18400
|
-
const leftChildrenProps = (0,
|
|
18535
|
+
const leftChildrenProps = (0, import_react112.useMemo)(() => {
|
|
18401
18536
|
return {
|
|
18402
18537
|
activeTabValue: leftTabValue,
|
|
18403
18538
|
closeSidebar: closeLeftSidebar
|
|
18404
18539
|
};
|
|
18405
18540
|
}, [leftTabValue, closeLeftSidebar]);
|
|
18406
|
-
const rightChildrenProps = (0,
|
|
18541
|
+
const rightChildrenProps = (0, import_react112.useMemo)(() => {
|
|
18407
18542
|
return {
|
|
18408
18543
|
activeTabValue: rightTabValue,
|
|
18409
18544
|
closeSidebar: closeRightSidebar
|
|
18410
18545
|
};
|
|
18411
18546
|
}, [rightTabValue, closeRightSidebar]);
|
|
18412
|
-
const leftSidebarProviderValue = (0,
|
|
18547
|
+
const leftSidebarProviderValue = (0, import_react112.useMemo)(() => {
|
|
18413
18548
|
return {
|
|
18414
18549
|
closeSidebar: closeLeftSidebar
|
|
18415
18550
|
};
|
|
18416
18551
|
}, [closeLeftSidebar]);
|
|
18417
|
-
const rightSidebarProviderValue = (0,
|
|
18552
|
+
const rightSidebarProviderValue = (0, import_react112.useMemo)(() => {
|
|
18418
18553
|
return {
|
|
18419
18554
|
closeSidebar: closeRightSidebar
|
|
18420
18555
|
};
|
|
18421
18556
|
}, [closeRightSidebar]);
|
|
18422
|
-
const leftPanel = left && leftVisible !== false ? /* @__PURE__ */
|
|
18557
|
+
const leftPanel = left && leftVisible !== false ? /* @__PURE__ */ import_react112.default.createElement(
|
|
18423
18558
|
PanelInner,
|
|
18424
18559
|
{
|
|
18425
18560
|
style: leftStyle,
|
|
18426
18561
|
className: cx("n-bg-sidebar-background n-flex-col", leftClassName)
|
|
18427
18562
|
},
|
|
18428
|
-
/* @__PURE__ */
|
|
18563
|
+
/* @__PURE__ */ import_react112.default.createElement(WorkspaceSideProvider, { value: leftSidebarProviderValue }, leftTabValue ? renderPanelChildren(left, leftChildrenProps) : null)
|
|
18429
18564
|
) : null;
|
|
18430
|
-
const rightPanel = right && rightVisible !== false ? /* @__PURE__ */
|
|
18565
|
+
const rightPanel = right && rightVisible !== false ? /* @__PURE__ */ import_react112.default.createElement(
|
|
18431
18566
|
PanelInner,
|
|
18432
18567
|
{
|
|
18433
18568
|
style: rightStyle,
|
|
18434
18569
|
className: cx("n-bg-sidebar-background n-flex-col", rightClassName)
|
|
18435
18570
|
},
|
|
18436
|
-
/* @__PURE__ */
|
|
18571
|
+
/* @__PURE__ */ import_react112.default.createElement(WorkspaceSideProvider, { value: rightSidebarProviderValue }, rightTabValue ? renderPanelChildren(right, rightChildrenProps) : null)
|
|
18437
18572
|
) : null;
|
|
18438
|
-
const centerPanel = /* @__PURE__ */
|
|
18439
|
-
const leftSidebarOptions = (0,
|
|
18573
|
+
const centerPanel = /* @__PURE__ */ import_react112.default.createElement(PanelInner, { className: "n-bg-canvas-background" }, children);
|
|
18574
|
+
const leftSidebarOptions = (0, import_react112.useMemo)(
|
|
18440
18575
|
() => ({
|
|
18441
18576
|
minSize: leftSidebarMinPercentage,
|
|
18442
18577
|
maxSize: leftSidebarMaxPercentage,
|
|
@@ -18454,7 +18589,7 @@ var WorkspaceLayout = forwardRefGeneric(function WorkspaceLayout2({
|
|
|
18454
18589
|
leftShowTabs
|
|
18455
18590
|
]
|
|
18456
18591
|
);
|
|
18457
|
-
const rightSidebarOptions = (0,
|
|
18592
|
+
const rightSidebarOptions = (0, import_react112.useMemo)(
|
|
18458
18593
|
() => ({
|
|
18459
18594
|
minSize: rightSidebarMinPercentage,
|
|
18460
18595
|
maxSize: rightSidebarMaxPercentage,
|
|
@@ -18474,7 +18609,8 @@ var WorkspaceLayout = forwardRefGeneric(function WorkspaceLayout2({
|
|
|
18474
18609
|
);
|
|
18475
18610
|
const LayoutComponent = sideType === "panel" ? PanelWorkspaceLayout : sideType === "drawer" ? DrawerWorkspaceLayout : parentSize.width > sideTypeBreakpoint ? PanelWorkspaceLayout : DrawerWorkspaceLayout;
|
|
18476
18611
|
const readyToRender = detectSize === "window" || containerSize && containerSize.width > 0;
|
|
18477
|
-
|
|
18612
|
+
const isOverlay = toolbarVariant === "overlay";
|
|
18613
|
+
return /* @__PURE__ */ import_react112.default.createElement(
|
|
18478
18614
|
"div",
|
|
18479
18615
|
{
|
|
18480
18616
|
ref: containerRef,
|
|
@@ -18486,8 +18622,8 @@ var WorkspaceLayout = forwardRefGeneric(function WorkspaceLayout2({
|
|
|
18486
18622
|
style: style2,
|
|
18487
18623
|
"data-theme": theme
|
|
18488
18624
|
},
|
|
18489
|
-
toolbar,
|
|
18490
|
-
/* @__PURE__ */
|
|
18625
|
+
!isOverlay && toolbar,
|
|
18626
|
+
/* @__PURE__ */ import_react112.default.createElement("div", { className: "n-flex n-flex-row n-flex-1 n-relative" }, readyToRender && /* @__PURE__ */ import_react112.default.createElement(import_react112.default.Fragment, null, /* @__PURE__ */ import_react112.default.createElement(
|
|
18491
18627
|
LayoutComponent,
|
|
18492
18628
|
{
|
|
18493
18629
|
leftPanel,
|
|
@@ -18507,15 +18643,22 @@ var WorkspaceLayout = forwardRefGeneric(function WorkspaceLayout2({
|
|
|
18507
18643
|
rightSidebarRef,
|
|
18508
18644
|
compactDrawerMenu
|
|
18509
18645
|
}
|
|
18510
|
-
)
|
|
18646
|
+
), isOverlay && /* @__PURE__ */ import_react112.default.createElement(
|
|
18647
|
+
OverlayToolbar,
|
|
18648
|
+
{
|
|
18649
|
+
left: overlayToolbarLeft,
|
|
18650
|
+
right: overlayToolbarRight,
|
|
18651
|
+
overlayLayout
|
|
18652
|
+
}
|
|
18653
|
+
)))
|
|
18511
18654
|
);
|
|
18512
18655
|
});
|
|
18513
|
-
var PanelInner = (0,
|
|
18656
|
+
var PanelInner = (0, import_react112.memo)(function PanelInner2({
|
|
18514
18657
|
children,
|
|
18515
18658
|
style: style2,
|
|
18516
18659
|
className
|
|
18517
18660
|
}) {
|
|
18518
|
-
return /* @__PURE__ */
|
|
18661
|
+
return /* @__PURE__ */ import_react112.default.createElement(
|
|
18519
18662
|
"div",
|
|
18520
18663
|
{
|
|
18521
18664
|
style: style2,
|
|
@@ -18530,22 +18673,22 @@ function getFirstTabValue(items, defaultValue2) {
|
|
|
18530
18673
|
}
|
|
18531
18674
|
|
|
18532
18675
|
// src/contexts/ImageDataContext.tsx
|
|
18533
|
-
var
|
|
18534
|
-
var ImageDataContext =
|
|
18676
|
+
var React113 = __toESM(require("react"));
|
|
18677
|
+
var ImageDataContext = React113.createContext(
|
|
18535
18678
|
void 0
|
|
18536
18679
|
);
|
|
18537
|
-
var ImageDataProvider =
|
|
18680
|
+
var ImageDataProvider = React113.memo(function ImageDataProvider2({
|
|
18538
18681
|
children,
|
|
18539
18682
|
getImageData
|
|
18540
18683
|
}) {
|
|
18541
|
-
const contextValue =
|
|
18684
|
+
const contextValue = React113.useMemo(
|
|
18542
18685
|
() => ({ getImageData: getImageData ?? (() => void 0) }),
|
|
18543
18686
|
[getImageData]
|
|
18544
18687
|
);
|
|
18545
|
-
return /* @__PURE__ */
|
|
18688
|
+
return /* @__PURE__ */ React113.createElement(ImageDataContext.Provider, { value: contextValue }, children);
|
|
18546
18689
|
});
|
|
18547
18690
|
function useImageData(ref) {
|
|
18548
|
-
const value =
|
|
18691
|
+
const value = React113.useContext(ImageDataContext);
|
|
18549
18692
|
if (!value) {
|
|
18550
18693
|
throw new Error("Missing ImageDataProvider");
|
|
18551
18694
|
}
|
|
@@ -18562,9 +18705,9 @@ function usePlatformModKey() {
|
|
|
18562
18705
|
}
|
|
18563
18706
|
|
|
18564
18707
|
// src/hooks/useTheme.ts
|
|
18565
|
-
var
|
|
18708
|
+
var import_react113 = require("react");
|
|
18566
18709
|
function useTheme() {
|
|
18567
|
-
const [theme, setTheme] = (0,
|
|
18710
|
+
const [theme, setTheme] = (0, import_react113.useState)("light");
|
|
18568
18711
|
const checkTheme = () => {
|
|
18569
18712
|
const currentTheme = document.body.getAttribute("data-theme");
|
|
18570
18713
|
switch (currentTheme) {
|
|
@@ -18576,7 +18719,7 @@ function useTheme() {
|
|
|
18576
18719
|
break;
|
|
18577
18720
|
}
|
|
18578
18721
|
};
|
|
18579
|
-
(0,
|
|
18722
|
+
(0, import_react113.useEffect)(() => {
|
|
18580
18723
|
checkTheme();
|
|
18581
18724
|
const observer = new MutationObserver((mutations) => {
|
|
18582
18725
|
mutations.forEach((mutation) => {
|
|
@@ -18596,6 +18739,24 @@ function useTheme() {
|
|
|
18596
18739
|
|
|
18597
18740
|
// src/theme/proseTheme.ts
|
|
18598
18741
|
var proseTheme = "n-prose n-prose-sm n-max-w-none [[data-theme='dark']_&]:n-prose-invert prose-a:n-text-blue-600";
|
|
18742
|
+
var whiteboardProseTheme = (isDark) => [
|
|
18743
|
+
"n-prose",
|
|
18744
|
+
"n-prose-sm",
|
|
18745
|
+
"n-max-w-none",
|
|
18746
|
+
isDark ? "n-prose-invert n-text-white" : "",
|
|
18747
|
+
"prose-p:n-m-0",
|
|
18748
|
+
"prose-ul:n-m-0",
|
|
18749
|
+
"prose-ol:n-m-0",
|
|
18750
|
+
"prose-li:n-m-0",
|
|
18751
|
+
"prose-li:n-p-0",
|
|
18752
|
+
"prose-a:n-text-inherit",
|
|
18753
|
+
"prose-strong:n-text-inherit",
|
|
18754
|
+
"prose-em:n-italic",
|
|
18755
|
+
"prose-ol:n-list-inside",
|
|
18756
|
+
"prose-ul:n-list-inside",
|
|
18757
|
+
"prose-ol:n-pl-0",
|
|
18758
|
+
"prose-ul:n-pl-0"
|
|
18759
|
+
].join(" ");
|
|
18599
18760
|
|
|
18600
18761
|
// src/utils/createSectionedMenu.ts
|
|
18601
18762
|
function withSeparators(elements2, separator2) {
|
|
@@ -18699,11 +18860,11 @@ var SUPPORTED_CANVAS_UPLOAD_TYPES = [
|
|
|
18699
18860
|
|
|
18700
18861
|
// src/components/DimensionInput.tsx
|
|
18701
18862
|
var import_noya_utils21 = require("@noya-app/noya-utils");
|
|
18702
|
-
var
|
|
18863
|
+
var React114 = __toESM(require("react"));
|
|
18703
18864
|
function getNewValue(value, mode, delta) {
|
|
18704
18865
|
return delta === void 0 ? value : mode === "replace" ? delta : value + delta;
|
|
18705
18866
|
}
|
|
18706
|
-
var DimensionInput =
|
|
18867
|
+
var DimensionInput = React114.memo(function DimensionInput2({
|
|
18707
18868
|
id,
|
|
18708
18869
|
value,
|
|
18709
18870
|
onSetValue,
|
|
@@ -18713,15 +18874,15 @@ var DimensionInput = React112.memo(function DimensionInput2({
|
|
|
18713
18874
|
disabled,
|
|
18714
18875
|
trigger = "submit"
|
|
18715
18876
|
}) {
|
|
18716
|
-
const handleNudgeValue =
|
|
18877
|
+
const handleNudgeValue = React114.useCallback(
|
|
18717
18878
|
(value2) => onSetValue(value2, "adjust"),
|
|
18718
18879
|
[onSetValue]
|
|
18719
18880
|
);
|
|
18720
|
-
const handleSetValue =
|
|
18881
|
+
const handleSetValue = React114.useCallback(
|
|
18721
18882
|
(value2) => onSetValue(value2, "replace"),
|
|
18722
18883
|
[onSetValue]
|
|
18723
18884
|
);
|
|
18724
|
-
return /* @__PURE__ */
|
|
18885
|
+
return /* @__PURE__ */ React114.createElement(LabeledField, { label, labelType: "inset" }, /* @__PURE__ */ React114.createElement(InputField2.Root, { id, width: size }, /* @__PURE__ */ React114.createElement(
|
|
18725
18886
|
InputField2.NumberInput,
|
|
18726
18887
|
{
|
|
18727
18888
|
value: value === void 0 ? value : (0, import_noya_utils21.round)(value, 2),
|
|
@@ -18748,8 +18909,8 @@ __export(InspectorPrimitives_exports, {
|
|
|
18748
18909
|
Title: () => Title,
|
|
18749
18910
|
VerticalSeparator: () => VerticalSeparator
|
|
18750
18911
|
});
|
|
18751
|
-
var
|
|
18752
|
-
var Section2 = (0,
|
|
18912
|
+
var import_react114 = __toESM(require("react"));
|
|
18913
|
+
var Section2 = (0, import_react114.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ import_react114.default.createElement(
|
|
18753
18914
|
"div",
|
|
18754
18915
|
{
|
|
18755
18916
|
ref,
|
|
@@ -18757,8 +18918,8 @@ var Section2 = (0, import_react112.forwardRef)(({ className, ...props }, ref) =>
|
|
|
18757
18918
|
...props
|
|
18758
18919
|
}
|
|
18759
18920
|
));
|
|
18760
|
-
var SectionHeader2 = (0,
|
|
18761
|
-
var Title = (0,
|
|
18921
|
+
var SectionHeader2 = (0, import_react114.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ import_react114.default.createElement("div", { ref, className: cx(`n-flex n-items-center`, className), ...props }));
|
|
18922
|
+
var Title = (0, import_react114.forwardRef)(({ className, $textStyle, ...props }, ref) => /* @__PURE__ */ import_react114.default.createElement(
|
|
18762
18923
|
"div",
|
|
18763
18924
|
{
|
|
18764
18925
|
ref,
|
|
@@ -18769,7 +18930,7 @@ var Title = (0, import_react112.forwardRef)(({ className, $textStyle, ...props }
|
|
|
18769
18930
|
...props
|
|
18770
18931
|
}
|
|
18771
18932
|
));
|
|
18772
|
-
var Row = (0,
|
|
18933
|
+
var Row = (0, import_react114.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ import_react114.default.createElement(
|
|
18773
18934
|
"div",
|
|
18774
18935
|
{
|
|
18775
18936
|
ref,
|
|
@@ -18777,7 +18938,7 @@ var Row = (0, import_react112.forwardRef)(({ className, ...props }, ref) => /* @
|
|
|
18777
18938
|
...props
|
|
18778
18939
|
}
|
|
18779
18940
|
));
|
|
18780
|
-
var Column = (0,
|
|
18941
|
+
var Column = (0, import_react114.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ import_react114.default.createElement(
|
|
18781
18942
|
"div",
|
|
18782
18943
|
{
|
|
18783
18944
|
ref,
|
|
@@ -18785,7 +18946,7 @@ var Column = (0, import_react112.forwardRef)(({ className, ...props }, ref) => /
|
|
|
18785
18946
|
...props
|
|
18786
18947
|
}
|
|
18787
18948
|
));
|
|
18788
|
-
var Checkbox3 = (0,
|
|
18949
|
+
var Checkbox3 = (0, import_react114.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ import_react114.default.createElement(
|
|
18789
18950
|
"input",
|
|
18790
18951
|
{
|
|
18791
18952
|
ref,
|
|
@@ -18794,7 +18955,7 @@ var Checkbox3 = (0, import_react112.forwardRef)(({ className, ...props }, ref) =
|
|
|
18794
18955
|
...props
|
|
18795
18956
|
}
|
|
18796
18957
|
));
|
|
18797
|
-
var Text3 = (0,
|
|
18958
|
+
var Text3 = (0, import_react114.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ import_react114.default.createElement(
|
|
18798
18959
|
"span",
|
|
18799
18960
|
{
|
|
18800
18961
|
ref,
|
|
@@ -18802,14 +18963,14 @@ var Text3 = (0, import_react112.forwardRef)(({ className, ...props }, ref) => /*
|
|
|
18802
18963
|
...props
|
|
18803
18964
|
}
|
|
18804
18965
|
));
|
|
18805
|
-
var VerticalSeparator = () => /* @__PURE__ */
|
|
18806
|
-
var HorizontalSeparator = () => /* @__PURE__ */
|
|
18807
|
-
var RowLabel = (0,
|
|
18966
|
+
var VerticalSeparator = () => /* @__PURE__ */ import_react114.default.createElement(Spacer.Vertical, { size: "inspector-v-separator" });
|
|
18967
|
+
var HorizontalSeparator = () => /* @__PURE__ */ import_react114.default.createElement(Spacer.Horizontal, { size: "inspector-h-separator" });
|
|
18968
|
+
var RowLabel = (0, import_react114.forwardRef)(function RowLabel2({
|
|
18808
18969
|
className,
|
|
18809
18970
|
$textStyle,
|
|
18810
18971
|
...props
|
|
18811
18972
|
}, ref) {
|
|
18812
|
-
return /* @__PURE__ */
|
|
18973
|
+
return /* @__PURE__ */ import_react114.default.createElement(
|
|
18813
18974
|
"label",
|
|
18814
18975
|
{
|
|
18815
18976
|
ref,
|
|
@@ -18821,7 +18982,7 @@ var RowLabel = (0, import_react112.forwardRef)(function RowLabel2({
|
|
|
18821
18982
|
}
|
|
18822
18983
|
);
|
|
18823
18984
|
});
|
|
18824
|
-
var LabeledRow = (0,
|
|
18985
|
+
var LabeledRow = (0, import_react114.memo)(function LabeledRow2({
|
|
18825
18986
|
id,
|
|
18826
18987
|
children,
|
|
18827
18988
|
label,
|
|
@@ -18829,7 +18990,7 @@ var LabeledRow = (0, import_react112.memo)(function LabeledRow2({
|
|
|
18829
18990
|
right,
|
|
18830
18991
|
className
|
|
18831
18992
|
}) {
|
|
18832
|
-
return /* @__PURE__ */
|
|
18993
|
+
return /* @__PURE__ */ import_react114.default.createElement(Row, { id, className }, /* @__PURE__ */ import_react114.default.createElement(Column, null, /* @__PURE__ */ import_react114.default.createElement(RowLabel, { $textStyle: labelTextStyle }, label, right && /* @__PURE__ */ import_react114.default.createElement(Spacer.Horizontal, null), right), /* @__PURE__ */ import_react114.default.createElement(Row, null, children)));
|
|
18833
18994
|
});
|
|
18834
18995
|
// Annotate the CommonJS export names for ESM import in node:
|
|
18835
18996
|
0 && (module.exports = {
|
|
@@ -18888,6 +19049,7 @@ var LabeledRow = (0, import_react112.memo)(function LabeledRow2({
|
|
|
18888
19049
|
FullscreenDialog,
|
|
18889
19050
|
GlobalInputBlurProvider,
|
|
18890
19051
|
Grid,
|
|
19052
|
+
GridBackground,
|
|
18891
19053
|
GridView,
|
|
18892
19054
|
Heading1,
|
|
18893
19055
|
Heading2,
|
|
@@ -18923,6 +19085,7 @@ var LabeledRow = (0, import_react112.memo)(function LabeledRow2({
|
|
|
18923
19085
|
Message,
|
|
18924
19086
|
Navigator,
|
|
18925
19087
|
OpenPortalsProvider,
|
|
19088
|
+
OverlayToolbar,
|
|
18926
19089
|
PipelineResultLayout,
|
|
18927
19090
|
PipelineResultLink,
|
|
18928
19091
|
Popover,
|
|
@@ -19025,8 +19188,10 @@ var LabeledRow = (0, import_react112.memo)(function LabeledRow2({
|
|
|
19025
19188
|
separator,
|
|
19026
19189
|
styles,
|
|
19027
19190
|
textStyles,
|
|
19191
|
+
toolbarTransparentStyle,
|
|
19028
19192
|
updateSelection,
|
|
19029
19193
|
useAutoResize,
|
|
19194
|
+
useBindKeyboardShortcutsForMenuItems,
|
|
19030
19195
|
useComboboxState,
|
|
19031
19196
|
useCurrentFloatingWindowInternal,
|
|
19032
19197
|
useDesignSystemConfiguration,
|
|
@@ -19057,6 +19222,7 @@ var LabeledRow = (0, import_react112.memo)(function LabeledRow2({
|
|
|
19057
19222
|
useTheme,
|
|
19058
19223
|
useWorkspaceSide,
|
|
19059
19224
|
validateDropIndicator,
|
|
19225
|
+
whiteboardProseTheme,
|
|
19060
19226
|
withDragProvider,
|
|
19061
19227
|
withSeparatorElements
|
|
19062
19228
|
});
|