@noya-app/noya-designsystem 0.1.71 → 0.1.73
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 +17 -0
- package/dist/index.css +1 -1
- package/dist/index.d.mts +58 -5
- package/dist/index.d.ts +58 -5
- package/dist/index.js +990 -780
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +970 -759
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -7
- package/src/components/BaseToolbar.tsx +1 -1
- package/src/components/Breadcrumbs.tsx +1 -0
- package/src/components/Collection.tsx +1 -2
- package/src/components/ComboboxMenu.tsx +1 -1
- package/src/components/Message.tsx +3 -2
- package/src/components/ScrollArea2.tsx +22 -2
- package/src/components/Virtualized.tsx +439 -0
- package/src/components/__tests__/Virtualized.math.test.ts +153 -0
- package/src/components/__tests__/Virtualized.test.tsx +85 -0
- package/src/components/listView/ListViewContexts.tsx +1 -6
- package/src/components/listView/ListViewRoot.tsx +18 -152
- package/src/index.tsx +5 -0
package/dist/index.mjs
CHANGED
|
@@ -395,14 +395,14 @@ var require_grammarDiagnostics = __commonJS({
|
|
|
395
395
|
rootNonTerminating.add(name);
|
|
396
396
|
}
|
|
397
397
|
}
|
|
398
|
-
const
|
|
398
|
+
const memo40 = /* @__PURE__ */ new Map();
|
|
399
399
|
const collectCauses = (name, path) => {
|
|
400
|
-
if (
|
|
401
|
-
return
|
|
400
|
+
if (memo40.has(name)) {
|
|
401
|
+
return memo40.get(name);
|
|
402
402
|
}
|
|
403
403
|
if (rootNonTerminating.has(name)) {
|
|
404
404
|
const direct = /* @__PURE__ */ new Set([name]);
|
|
405
|
-
|
|
405
|
+
memo40.set(name, direct);
|
|
406
406
|
return direct;
|
|
407
407
|
}
|
|
408
408
|
if (path.has(name)) {
|
|
@@ -421,7 +421,7 @@ var require_grammarDiagnostics = __commonJS({
|
|
|
421
421
|
}
|
|
422
422
|
}
|
|
423
423
|
path.delete(name);
|
|
424
|
-
|
|
424
|
+
memo40.set(name, result);
|
|
425
425
|
return result;
|
|
426
426
|
};
|
|
427
427
|
const dependencyIssues = [];
|
|
@@ -7047,7 +7047,8 @@ var BreadcrumbSlash = () => {
|
|
|
7047
7047
|
fill: "none",
|
|
7048
7048
|
xmlns: "http://www.w3.org/2000/svg",
|
|
7049
7049
|
opacity: 0.5,
|
|
7050
|
-
style: slashStyle
|
|
7050
|
+
style: slashStyle,
|
|
7051
|
+
className: "n-flex-none"
|
|
7051
7052
|
},
|
|
7052
7053
|
/* @__PURE__ */ React42.createElement(
|
|
7053
7054
|
"path",
|
|
@@ -7365,7 +7366,7 @@ var Chip = memo15(
|
|
|
7365
7366
|
);
|
|
7366
7367
|
|
|
7367
7368
|
// src/components/Collection.tsx
|
|
7368
|
-
import
|
|
7369
|
+
import React63 from "react";
|
|
7369
7370
|
|
|
7370
7371
|
// src/components/Grid.tsx
|
|
7371
7372
|
import React50, { useImperativeHandle as useImperativeHandle3, useRef as useRef16, useState as useState23 } from "react";
|
|
@@ -8188,12 +8189,12 @@ var Grid = memoGeneric(
|
|
|
8188
8189
|
);
|
|
8189
8190
|
|
|
8190
8191
|
// src/components/List.tsx
|
|
8191
|
-
import
|
|
8192
|
-
memo as
|
|
8192
|
+
import React62, {
|
|
8193
|
+
memo as memo21,
|
|
8193
8194
|
useImperativeHandle as useImperativeHandle5,
|
|
8194
|
-
useMemo as
|
|
8195
|
+
useMemo as useMemo26,
|
|
8195
8196
|
useRef as useRef20,
|
|
8196
|
-
useState as
|
|
8197
|
+
useState as useState26
|
|
8197
8198
|
} from "react";
|
|
8198
8199
|
|
|
8199
8200
|
// src/components/listView/ListViewContexts.tsx
|
|
@@ -8218,10 +8219,6 @@ var ListRowContext = createContext10({
|
|
|
8218
8219
|
isSectionHeader: false
|
|
8219
8220
|
});
|
|
8220
8221
|
ListRowContext.displayName = "ListRowContext";
|
|
8221
|
-
var RenderItemContext = createContext10(
|
|
8222
|
-
() => null
|
|
8223
|
-
);
|
|
8224
|
-
RenderItemContext.displayName = "RenderItemContext";
|
|
8225
8222
|
|
|
8226
8223
|
// src/components/listView/ListViewEditableRowTitle.tsx
|
|
8227
8224
|
import React51, { memo as memo19, useLayoutEffect as useLayoutEffect5, useRef as useRef17 } from "react";
|
|
@@ -8274,18 +8271,347 @@ var ListViewEditableRowTitle = memo19(function ListViewEditableRowTitle2({
|
|
|
8274
8271
|
|
|
8275
8272
|
// src/components/listView/ListViewRoot.tsx
|
|
8276
8273
|
import { range } from "@noya-app/noya-utils";
|
|
8277
|
-
import
|
|
8274
|
+
import React58, {
|
|
8278
8275
|
isValidElement as isValidElement3,
|
|
8279
|
-
|
|
8280
|
-
|
|
8281
|
-
|
|
8276
|
+
useCallback as useCallback25,
|
|
8277
|
+
useMemo as useMemo24
|
|
8278
|
+
} from "react";
|
|
8279
|
+
|
|
8280
|
+
// src/components/Virtualized.tsx
|
|
8281
|
+
import React53, {
|
|
8282
|
+
useCallback as useCallback22,
|
|
8282
8283
|
useImperativeHandle as useImperativeHandle4,
|
|
8283
8284
|
useLayoutEffect as useLayoutEffect6,
|
|
8284
|
-
useMemo as
|
|
8285
|
-
useRef as
|
|
8285
|
+
useMemo as useMemo19,
|
|
8286
|
+
useRef as useRef18,
|
|
8287
|
+
useState as useState24
|
|
8286
8288
|
} from "react";
|
|
8287
|
-
import {
|
|
8288
|
-
|
|
8289
|
+
import { flushSync } from "react-dom";
|
|
8290
|
+
|
|
8291
|
+
// src/components/ScrollArea2.tsx
|
|
8292
|
+
import { ScrollArea as ScrollArea3 } from "@base-ui-components/react/scroll-area";
|
|
8293
|
+
import * as React52 from "react";
|
|
8294
|
+
var SCROLLBAR_STATE_CLASSES = "scroll-component n-opacity-0 n-transition-opacity n-delay-300 n-pointer-events-none data-[hovering]:n-opacity-100 data-[hovering]:n-delay-0 data-[hovering]:n-duration-75 data-[hovering]:n-pointer-events-auto data-[scrolling]:n-opacity-100 data-[scrolling]:n-delay-0 data-[scrolling]:n-duration-75 data-[scrolling]:n-pointer-events-auto";
|
|
8295
|
+
var SCROLLBAR_TRACK_VERTICAL = "n-m-1 n-w-1 flex n-justify-center n-rounded-md n-bg-divider-subtle";
|
|
8296
|
+
var SCROLLBAR_TRACK_HORIZONTAL = "n-m-1 n-h-1 flex n-justify-center n-rounded-md n-bg-divider-subtle";
|
|
8297
|
+
var SCROLLBAR_THUMB_VERTICAL = "scroll-component n-w-full n-rounded n-bg-scrollbar";
|
|
8298
|
+
var SCROLLBAR_THUMB_HORIZONTAL = "scroll-component n-h-full n-rounded n-bg-scrollbar";
|
|
8299
|
+
function ScrollArea22({
|
|
8300
|
+
children,
|
|
8301
|
+
className,
|
|
8302
|
+
viewportClassName,
|
|
8303
|
+
orientation = "vertical",
|
|
8304
|
+
style: style2,
|
|
8305
|
+
viewportProps
|
|
8306
|
+
}) {
|
|
8307
|
+
const {
|
|
8308
|
+
className: viewportPropsClassName,
|
|
8309
|
+
ref: viewportRef,
|
|
8310
|
+
...viewportRest
|
|
8311
|
+
} = viewportProps ?? {};
|
|
8312
|
+
return /* @__PURE__ */ React52.createElement(ScrollArea3.Root, { className: cx("n-relative", className), style: style2 }, /* @__PURE__ */ React52.createElement(
|
|
8313
|
+
ScrollArea3.Viewport,
|
|
8314
|
+
{
|
|
8315
|
+
ref: viewportRef,
|
|
8316
|
+
className: cx(
|
|
8317
|
+
"n-h-full n-overscroll-contain",
|
|
8318
|
+
viewportClassName,
|
|
8319
|
+
viewportPropsClassName
|
|
8320
|
+
),
|
|
8321
|
+
...viewportRest
|
|
8322
|
+
},
|
|
8323
|
+
children
|
|
8324
|
+
), (orientation === "vertical" || orientation === "both") && /* @__PURE__ */ React52.createElement(
|
|
8325
|
+
ScrollArea3.Scrollbar,
|
|
8326
|
+
{
|
|
8327
|
+
className: cx(SCROLLBAR_STATE_CLASSES, SCROLLBAR_TRACK_VERTICAL)
|
|
8328
|
+
},
|
|
8329
|
+
/* @__PURE__ */ React52.createElement(ScrollArea3.Thumb, { className: SCROLLBAR_THUMB_VERTICAL })
|
|
8330
|
+
), (orientation === "horizontal" || orientation === "both") && /* @__PURE__ */ React52.createElement(
|
|
8331
|
+
ScrollArea3.Scrollbar,
|
|
8332
|
+
{
|
|
8333
|
+
orientation: "horizontal",
|
|
8334
|
+
className: cx(SCROLLBAR_STATE_CLASSES, SCROLLBAR_TRACK_HORIZONTAL)
|
|
8335
|
+
},
|
|
8336
|
+
/* @__PURE__ */ React52.createElement(ScrollArea3.Thumb, { className: SCROLLBAR_THUMB_HORIZONTAL })
|
|
8337
|
+
), orientation === "both" && /* @__PURE__ */ React52.createElement(ScrollArea3.Corner, null));
|
|
8338
|
+
}
|
|
8339
|
+
|
|
8340
|
+
// src/components/Virtualized.tsx
|
|
8341
|
+
function calculateScrollOffsetForIndex({
|
|
8342
|
+
measurements,
|
|
8343
|
+
height,
|
|
8344
|
+
totalHeight,
|
|
8345
|
+
targetIndex,
|
|
8346
|
+
currentScrollTop
|
|
8347
|
+
}) {
|
|
8348
|
+
if (!measurements.length) return;
|
|
8349
|
+
const index = Math.min(Math.max(targetIndex, 0), measurements.length - 1);
|
|
8350
|
+
const measurement = measurements[index];
|
|
8351
|
+
if (!measurement) return;
|
|
8352
|
+
const viewportTop = currentScrollTop;
|
|
8353
|
+
const viewportBottom = viewportTop + height;
|
|
8354
|
+
const itemTop = measurement.start;
|
|
8355
|
+
const itemBottom = measurement.end;
|
|
8356
|
+
let nextScrollTop = viewportTop;
|
|
8357
|
+
if (itemTop < viewportTop) {
|
|
8358
|
+
nextScrollTop = itemTop;
|
|
8359
|
+
} else if (itemBottom > viewportBottom) {
|
|
8360
|
+
const canAlignTop = height >= measurement.size;
|
|
8361
|
+
nextScrollTop = canAlignTop ? itemTop : itemBottom - height;
|
|
8362
|
+
} else {
|
|
8363
|
+
return;
|
|
8364
|
+
}
|
|
8365
|
+
const maxScrollTop = Math.max(0, totalHeight - height);
|
|
8366
|
+
nextScrollTop = Math.max(0, Math.min(nextScrollTop, maxScrollTop));
|
|
8367
|
+
if (nextScrollTop === viewportTop) return;
|
|
8368
|
+
return nextScrollTop;
|
|
8369
|
+
}
|
|
8370
|
+
function resolvePaddingValues(padding) {
|
|
8371
|
+
if (typeof padding === "number") {
|
|
8372
|
+
return { top: padding, bottom: padding };
|
|
8373
|
+
}
|
|
8374
|
+
return {
|
|
8375
|
+
top: padding?.top ?? 0,
|
|
8376
|
+
bottom: padding?.bottom ?? 0
|
|
8377
|
+
};
|
|
8378
|
+
}
|
|
8379
|
+
function clampGapValue(gap) {
|
|
8380
|
+
return Math.max(0, gap ?? 0);
|
|
8381
|
+
}
|
|
8382
|
+
function buildMeasurements({
|
|
8383
|
+
itemCount,
|
|
8384
|
+
getItemHeight,
|
|
8385
|
+
paddingTop,
|
|
8386
|
+
paddingBottom,
|
|
8387
|
+
gap
|
|
8388
|
+
}) {
|
|
8389
|
+
const measurements = [];
|
|
8390
|
+
let offset = paddingTop;
|
|
8391
|
+
for (let index = 0; index < itemCount; index += 1) {
|
|
8392
|
+
const size = Math.max(0, getItemHeight(index));
|
|
8393
|
+
const start = offset;
|
|
8394
|
+
const end = start + size;
|
|
8395
|
+
measurements.push({ index, size, start, end });
|
|
8396
|
+
offset = end + gap;
|
|
8397
|
+
}
|
|
8398
|
+
const totalHeight = measurements.length ? measurements[measurements.length - 1].end + paddingBottom : paddingTop + paddingBottom;
|
|
8399
|
+
return { measurements, totalHeight };
|
|
8400
|
+
}
|
|
8401
|
+
function findFirstVisibleIndex(measurements, offset) {
|
|
8402
|
+
if (!measurements.length) return 0;
|
|
8403
|
+
let low = 0;
|
|
8404
|
+
let high = measurements.length - 1;
|
|
8405
|
+
let match = measurements.length - 1;
|
|
8406
|
+
while (low <= high) {
|
|
8407
|
+
const middle = Math.floor((low + high) / 2);
|
|
8408
|
+
const measurement = measurements[middle];
|
|
8409
|
+
if (measurement.end > offset) {
|
|
8410
|
+
match = middle;
|
|
8411
|
+
high = middle - 1;
|
|
8412
|
+
} else {
|
|
8413
|
+
low = middle + 1;
|
|
8414
|
+
}
|
|
8415
|
+
}
|
|
8416
|
+
return match;
|
|
8417
|
+
}
|
|
8418
|
+
function calculateVisibleRange({
|
|
8419
|
+
measurements,
|
|
8420
|
+
scrollTop,
|
|
8421
|
+
height,
|
|
8422
|
+
overscan
|
|
8423
|
+
}) {
|
|
8424
|
+
if (!measurements.length) {
|
|
8425
|
+
return { start: 0, end: -1 };
|
|
8426
|
+
}
|
|
8427
|
+
const viewBottom = scrollTop + height;
|
|
8428
|
+
const firstVisible = findFirstVisibleIndex(measurements, scrollTop);
|
|
8429
|
+
let lastVisibleExclusive = firstVisible;
|
|
8430
|
+
while (lastVisibleExclusive < measurements.length && measurements[lastVisibleExclusive].start < viewBottom) {
|
|
8431
|
+
lastVisibleExclusive += 1;
|
|
8432
|
+
}
|
|
8433
|
+
const lastVisible = Math.max(
|
|
8434
|
+
firstVisible,
|
|
8435
|
+
Math.min(measurements.length - 1, lastVisibleExclusive - 1)
|
|
8436
|
+
);
|
|
8437
|
+
const overscanCount = Math.max(0, Math.floor(overscan));
|
|
8438
|
+
return {
|
|
8439
|
+
start: Math.max(0, firstVisible - overscanCount),
|
|
8440
|
+
end: Math.min(measurements.length - 1, lastVisible + overscanCount)
|
|
8441
|
+
};
|
|
8442
|
+
}
|
|
8443
|
+
var DEFAULT_OVERSCAN = 2;
|
|
8444
|
+
var VirtualizedInner = React53.forwardRef(function Virtualized({
|
|
8445
|
+
height,
|
|
8446
|
+
itemCount,
|
|
8447
|
+
getItemHeight,
|
|
8448
|
+
renderItem,
|
|
8449
|
+
overscan = DEFAULT_OVERSCAN,
|
|
8450
|
+
className,
|
|
8451
|
+
style: style2,
|
|
8452
|
+
innerClassName,
|
|
8453
|
+
innerStyle,
|
|
8454
|
+
onScroll,
|
|
8455
|
+
itemKey,
|
|
8456
|
+
initialScrollOffset = 0,
|
|
8457
|
+
syncScrollUpdates = true,
|
|
8458
|
+
padding,
|
|
8459
|
+
gap = 0,
|
|
8460
|
+
useScrollArea = false,
|
|
8461
|
+
scrollAreaViewportClassName
|
|
8462
|
+
}, forwardedRef) {
|
|
8463
|
+
const containerRef = useRef18(null);
|
|
8464
|
+
const setScrollElement = useCallback22((element) => {
|
|
8465
|
+
containerRef.current = element;
|
|
8466
|
+
}, []);
|
|
8467
|
+
const [scrollTop, setScrollTop] = useState24(initialScrollOffset);
|
|
8468
|
+
const pendingInitialOffset = useRef18(initialScrollOffset);
|
|
8469
|
+
useLayoutEffect6(() => {
|
|
8470
|
+
if (pendingInitialOffset.current == null) return;
|
|
8471
|
+
if (containerRef.current) {
|
|
8472
|
+
containerRef.current.scrollTop = pendingInitialOffset.current;
|
|
8473
|
+
setScrollTop(pendingInitialOffset.current);
|
|
8474
|
+
}
|
|
8475
|
+
pendingInitialOffset.current = null;
|
|
8476
|
+
}, []);
|
|
8477
|
+
const paddingValues = useMemo19(() => resolvePaddingValues(padding), [padding]);
|
|
8478
|
+
const gapValue = useMemo19(() => clampGapValue(gap), [gap]);
|
|
8479
|
+
const { measurements, totalHeight } = useMemo19(
|
|
8480
|
+
() => buildMeasurements({
|
|
8481
|
+
itemCount,
|
|
8482
|
+
getItemHeight,
|
|
8483
|
+
paddingTop: paddingValues.top,
|
|
8484
|
+
paddingBottom: paddingValues.bottom,
|
|
8485
|
+
gap: gapValue
|
|
8486
|
+
}),
|
|
8487
|
+
[
|
|
8488
|
+
gapValue,
|
|
8489
|
+
getItemHeight,
|
|
8490
|
+
itemCount,
|
|
8491
|
+
paddingValues.bottom,
|
|
8492
|
+
paddingValues.top
|
|
8493
|
+
]
|
|
8494
|
+
);
|
|
8495
|
+
const visibleRange = useMemo19(
|
|
8496
|
+
() => calculateVisibleRange({
|
|
8497
|
+
measurements,
|
|
8498
|
+
scrollTop,
|
|
8499
|
+
height,
|
|
8500
|
+
overscan
|
|
8501
|
+
}),
|
|
8502
|
+
[height, measurements, overscan, scrollTop]
|
|
8503
|
+
);
|
|
8504
|
+
const handleScroll = useCallback22(
|
|
8505
|
+
(event) => {
|
|
8506
|
+
const nextOffset = event.currentTarget.scrollTop;
|
|
8507
|
+
if (nextOffset === scrollTop) return;
|
|
8508
|
+
if (syncScrollUpdates) {
|
|
8509
|
+
flushSync(() => {
|
|
8510
|
+
setScrollTop(nextOffset);
|
|
8511
|
+
});
|
|
8512
|
+
} else {
|
|
8513
|
+
setScrollTop(nextOffset);
|
|
8514
|
+
}
|
|
8515
|
+
onScroll?.(nextOffset);
|
|
8516
|
+
},
|
|
8517
|
+
[onScroll, scrollTop, syncScrollUpdates]
|
|
8518
|
+
);
|
|
8519
|
+
useImperativeHandle4(
|
|
8520
|
+
forwardedRef,
|
|
8521
|
+
() => ({
|
|
8522
|
+
scrollToIndex(index) {
|
|
8523
|
+
const container = containerRef.current;
|
|
8524
|
+
if (!container) return;
|
|
8525
|
+
const nextScrollTop = calculateScrollOffsetForIndex({
|
|
8526
|
+
measurements,
|
|
8527
|
+
height,
|
|
8528
|
+
totalHeight,
|
|
8529
|
+
targetIndex: index,
|
|
8530
|
+
currentScrollTop: container.scrollTop
|
|
8531
|
+
});
|
|
8532
|
+
if (nextScrollTop == null) return;
|
|
8533
|
+
container.scrollTop = nextScrollTop;
|
|
8534
|
+
setScrollTop(nextScrollTop);
|
|
8535
|
+
}
|
|
8536
|
+
}),
|
|
8537
|
+
[height, measurements, totalHeight]
|
|
8538
|
+
);
|
|
8539
|
+
const containerStyle = useMemo19(
|
|
8540
|
+
() => ({
|
|
8541
|
+
height,
|
|
8542
|
+
overflowY: "auto",
|
|
8543
|
+
overflowX: "hidden",
|
|
8544
|
+
...style2
|
|
8545
|
+
}),
|
|
8546
|
+
[height, style2]
|
|
8547
|
+
);
|
|
8548
|
+
const scrollAreaStyle = useMemo19(
|
|
8549
|
+
() => ({
|
|
8550
|
+
height,
|
|
8551
|
+
...style2
|
|
8552
|
+
}),
|
|
8553
|
+
[height, style2]
|
|
8554
|
+
);
|
|
8555
|
+
const totalContent = /* @__PURE__ */ React53.createElement(
|
|
8556
|
+
"div",
|
|
8557
|
+
{
|
|
8558
|
+
className: innerClassName,
|
|
8559
|
+
style: {
|
|
8560
|
+
position: "relative",
|
|
8561
|
+
width: "100%",
|
|
8562
|
+
height: totalHeight,
|
|
8563
|
+
...innerStyle
|
|
8564
|
+
}
|
|
8565
|
+
},
|
|
8566
|
+
visibleRange.end >= visibleRange.start && Array.from(
|
|
8567
|
+
{ length: visibleRange.end - visibleRange.start + 1 },
|
|
8568
|
+
(_, offset) => {
|
|
8569
|
+
const index = visibleRange.start + offset;
|
|
8570
|
+
const measurement = measurements[index];
|
|
8571
|
+
const key = itemKey ? itemKey(index) : index;
|
|
8572
|
+
return /* @__PURE__ */ React53.createElement(
|
|
8573
|
+
"div",
|
|
8574
|
+
{
|
|
8575
|
+
key,
|
|
8576
|
+
style: {
|
|
8577
|
+
position: "absolute",
|
|
8578
|
+
top: measurement.start,
|
|
8579
|
+
height: measurement.size,
|
|
8580
|
+
width: "100%"
|
|
8581
|
+
}
|
|
8582
|
+
},
|
|
8583
|
+
renderItem(index)
|
|
8584
|
+
);
|
|
8585
|
+
}
|
|
8586
|
+
)
|
|
8587
|
+
);
|
|
8588
|
+
if (useScrollArea) {
|
|
8589
|
+
return /* @__PURE__ */ React53.createElement(
|
|
8590
|
+
ScrollArea22,
|
|
8591
|
+
{
|
|
8592
|
+
className,
|
|
8593
|
+
style: scrollAreaStyle,
|
|
8594
|
+
viewportClassName: scrollAreaViewportClassName,
|
|
8595
|
+
viewportProps: {
|
|
8596
|
+
ref: setScrollElement,
|
|
8597
|
+
onScroll: handleScroll
|
|
8598
|
+
}
|
|
8599
|
+
},
|
|
8600
|
+
totalContent
|
|
8601
|
+
);
|
|
8602
|
+
}
|
|
8603
|
+
return /* @__PURE__ */ React53.createElement(
|
|
8604
|
+
"div",
|
|
8605
|
+
{
|
|
8606
|
+
ref: setScrollElement,
|
|
8607
|
+
className,
|
|
8608
|
+
style: containerStyle,
|
|
8609
|
+
onScroll: handleScroll
|
|
8610
|
+
},
|
|
8611
|
+
totalContent
|
|
8612
|
+
);
|
|
8613
|
+
});
|
|
8614
|
+
var Virtualized2 = React53.memo(VirtualizedInner);
|
|
8289
8615
|
|
|
8290
8616
|
// src/components/sorting/Sortable.tsx
|
|
8291
8617
|
import { useDroppable } from "@dnd-kit/core";
|
|
@@ -8295,14 +8621,14 @@ import {
|
|
|
8295
8621
|
useSortable,
|
|
8296
8622
|
verticalListSortingStrategy
|
|
8297
8623
|
} from "@dnd-kit/sortable";
|
|
8298
|
-
import * as
|
|
8299
|
-
import { useMemo as
|
|
8624
|
+
import * as React57 from "react";
|
|
8625
|
+
import { useMemo as useMemo23 } from "react";
|
|
8300
8626
|
|
|
8301
8627
|
// src/components/sorting/DragRegistration.tsx
|
|
8302
|
-
import
|
|
8303
|
-
var DragRegistrationContext =
|
|
8628
|
+
import React54 from "react";
|
|
8629
|
+
var DragRegistrationContext = React54.createContext(null);
|
|
8304
8630
|
function useDragRegistration(context) {
|
|
8305
|
-
const value =
|
|
8631
|
+
const value = React54.useContext(context);
|
|
8306
8632
|
if (!value) {
|
|
8307
8633
|
throw new Error(
|
|
8308
8634
|
"useDragRegistration must be used within a DragRegistrationProvider"
|
|
@@ -8311,11 +8637,11 @@ function useDragRegistration(context) {
|
|
|
8311
8637
|
return value;
|
|
8312
8638
|
}
|
|
8313
8639
|
function useDragRegistrationManager() {
|
|
8314
|
-
const [registeredLists, setRegisteredLists] =
|
|
8315
|
-
const registerList =
|
|
8640
|
+
const [registeredLists, setRegisteredLists] = React54.useState(/* @__PURE__ */ new Map());
|
|
8641
|
+
const registerList = React54.useCallback((list) => {
|
|
8316
8642
|
setRegisteredLists((prev) => new Map(prev).set(list.id, list));
|
|
8317
8643
|
}, []);
|
|
8318
|
-
const unregisterList =
|
|
8644
|
+
const unregisterList = React54.useCallback((listId) => {
|
|
8319
8645
|
setRegisteredLists((prev) => {
|
|
8320
8646
|
const newMap = new Map(prev);
|
|
8321
8647
|
newMap.delete(listId);
|
|
@@ -8324,15 +8650,15 @@ function useDragRegistrationManager() {
|
|
|
8324
8650
|
}, []);
|
|
8325
8651
|
return { registerList, unregisterList, registeredLists };
|
|
8326
8652
|
}
|
|
8327
|
-
var ActiveDragContext =
|
|
8653
|
+
var ActiveDragContext = React54.createContext(null);
|
|
8328
8654
|
function useActiveDrag(context) {
|
|
8329
|
-
const value =
|
|
8655
|
+
const value = React54.useContext(context);
|
|
8330
8656
|
if (!value) {
|
|
8331
8657
|
throw new Error("useActiveDrag must be used within a ActiveDragProvider");
|
|
8332
8658
|
}
|
|
8333
8659
|
return value;
|
|
8334
8660
|
}
|
|
8335
|
-
var AnyDragContext =
|
|
8661
|
+
var AnyDragContext = React54.createContext(false);
|
|
8336
8662
|
|
|
8337
8663
|
// src/components/sorting/SharedDragProvider.tsx
|
|
8338
8664
|
import {
|
|
@@ -8349,8 +8675,8 @@ import {
|
|
|
8349
8675
|
unionRects
|
|
8350
8676
|
} from "@noya-app/noya-geometry";
|
|
8351
8677
|
import { windowsOf } from "@noya-app/noya-utils";
|
|
8352
|
-
import * as
|
|
8353
|
-
import { useMemo as
|
|
8678
|
+
import * as React55 from "react";
|
|
8679
|
+
import { useMemo as useMemo21 } from "react";
|
|
8354
8680
|
import { createPortal as createPortal2 } from "react-dom";
|
|
8355
8681
|
function SharedDragProvider({
|
|
8356
8682
|
children,
|
|
@@ -8370,22 +8696,22 @@ function SharedDragProvider({
|
|
|
8370
8696
|
})
|
|
8371
8697
|
);
|
|
8372
8698
|
const mounted = useMounted();
|
|
8373
|
-
const [dragState, setDragState] =
|
|
8699
|
+
const [dragState, setDragState] = React55.useState({
|
|
8374
8700
|
source: null,
|
|
8375
8701
|
target: null,
|
|
8376
8702
|
indicator: null
|
|
8377
8703
|
});
|
|
8378
|
-
const stableOnMoveItem =
|
|
8704
|
+
const stableOnMoveItem = React55.useRef(onMoveItem);
|
|
8379
8705
|
useIsomorphicLayoutEffect(() => {
|
|
8380
8706
|
stableOnMoveItem.current = onMoveItem;
|
|
8381
8707
|
}, [onMoveItem]);
|
|
8382
|
-
const stableAcceptsDrop =
|
|
8708
|
+
const stableAcceptsDrop = React55.useRef(acceptsDrop2);
|
|
8383
8709
|
useIsomorphicLayoutEffect(() => {
|
|
8384
8710
|
stableAcceptsDrop.current = acceptsDrop2;
|
|
8385
8711
|
}, [acceptsDrop2]);
|
|
8386
8712
|
const { registerList, unregisterList, registeredLists } = useDragRegistrationManager();
|
|
8387
|
-
const activatorEventRef =
|
|
8388
|
-
const handleDragStart =
|
|
8713
|
+
const activatorEventRef = React55.useRef(null);
|
|
8714
|
+
const handleDragStart = React55.useCallback(
|
|
8389
8715
|
(event) => {
|
|
8390
8716
|
activatorEventRef.current = event.activatorEvent;
|
|
8391
8717
|
for (const [listId, list] of registeredLists) {
|
|
@@ -8407,7 +8733,7 @@ function SharedDragProvider({
|
|
|
8407
8733
|
},
|
|
8408
8734
|
[registeredLists]
|
|
8409
8735
|
);
|
|
8410
|
-
const handleDragMove =
|
|
8736
|
+
const handleDragMove = React55.useCallback(
|
|
8411
8737
|
(event) => {
|
|
8412
8738
|
const { active, over } = event;
|
|
8413
8739
|
if (!activatorEventRef.current || !dragState.source) return;
|
|
@@ -8431,7 +8757,7 @@ function SharedDragProvider({
|
|
|
8431
8757
|
},
|
|
8432
8758
|
[registeredLists, dragState.source]
|
|
8433
8759
|
);
|
|
8434
|
-
const handleDragEnd =
|
|
8760
|
+
const handleDragEnd = React55.useCallback(
|
|
8435
8761
|
(event) => {
|
|
8436
8762
|
const { active, over } = event;
|
|
8437
8763
|
if (!activatorEventRef.current || !dragState.source) return;
|
|
@@ -8475,7 +8801,7 @@ function SharedDragProvider({
|
|
|
8475
8801
|
},
|
|
8476
8802
|
[registeredLists, dragState.source, stableOnMoveItem]
|
|
8477
8803
|
);
|
|
8478
|
-
const contextValue =
|
|
8804
|
+
const contextValue = React55.useMemo(
|
|
8479
8805
|
() => ({
|
|
8480
8806
|
registerList,
|
|
8481
8807
|
unregisterList
|
|
@@ -8483,19 +8809,19 @@ function SharedDragProvider({
|
|
|
8483
8809
|
[registerList, unregisterList]
|
|
8484
8810
|
);
|
|
8485
8811
|
const activeList = dragState.source ? registeredLists.get(dragState.source.listId) : null;
|
|
8486
|
-
const activeDragContextValue =
|
|
8812
|
+
const activeDragContextValue = React55.useMemo(
|
|
8487
8813
|
() => dragState,
|
|
8488
8814
|
[dragState]
|
|
8489
8815
|
);
|
|
8490
|
-
const collisionDetection =
|
|
8816
|
+
const collisionDetection = useMemo21(() => {
|
|
8491
8817
|
return getItemFirstCollisionDetection(registeredLists, itemHitSlop);
|
|
8492
8818
|
}, [registeredLists, itemHitSlop]);
|
|
8493
|
-
return /* @__PURE__ */
|
|
8819
|
+
return /* @__PURE__ */ React55.createElement(AnyDragContext.Provider, { value: true }, /* @__PURE__ */ React55.createElement(sharedDragProps.dragRegistrationContext.Provider, { value: contextValue }, /* @__PURE__ */ React55.createElement(
|
|
8494
8820
|
sharedDragProps.activeDragContext.Provider,
|
|
8495
8821
|
{
|
|
8496
8822
|
value: activeDragContextValue
|
|
8497
8823
|
},
|
|
8498
|
-
/* @__PURE__ */
|
|
8824
|
+
/* @__PURE__ */ React55.createElement(
|
|
8499
8825
|
DndContext,
|
|
8500
8826
|
{
|
|
8501
8827
|
sensors,
|
|
@@ -8506,26 +8832,26 @@ function SharedDragProvider({
|
|
|
8506
8832
|
},
|
|
8507
8833
|
children,
|
|
8508
8834
|
mounted && activeList?.renderOverlay && dragState.source && createPortal2(
|
|
8509
|
-
/* @__PURE__ */
|
|
8835
|
+
/* @__PURE__ */ React55.createElement(DragOverlay, { dropAnimation: null }, activeList.renderOverlay(dragState.source.itemId)),
|
|
8510
8836
|
document.body
|
|
8511
8837
|
)
|
|
8512
8838
|
)
|
|
8513
8839
|
)));
|
|
8514
8840
|
}
|
|
8515
8841
|
function useMounted() {
|
|
8516
|
-
const [mounted, setMounted] =
|
|
8517
|
-
|
|
8842
|
+
const [mounted, setMounted] = React55.useState(false);
|
|
8843
|
+
React55.useEffect(() => {
|
|
8518
8844
|
setMounted(true);
|
|
8519
8845
|
}, []);
|
|
8520
8846
|
return mounted;
|
|
8521
8847
|
}
|
|
8522
8848
|
function withDragProvider(Component) {
|
|
8523
8849
|
return function WithDragProvider(props) {
|
|
8524
|
-
const anyDragContext =
|
|
8850
|
+
const anyDragContext = React55.useContext(AnyDragContext);
|
|
8525
8851
|
if (!anyDragContext) {
|
|
8526
|
-
return /* @__PURE__ */
|
|
8852
|
+
return /* @__PURE__ */ React55.createElement(SharedDragProvider, null, /* @__PURE__ */ React55.createElement(Component, { ...props }));
|
|
8527
8853
|
}
|
|
8528
|
-
return /* @__PURE__ */
|
|
8854
|
+
return /* @__PURE__ */ React55.createElement(Component, { ...props });
|
|
8529
8855
|
};
|
|
8530
8856
|
}
|
|
8531
8857
|
var getItemFirstCollisionDetection = (registeredLists, itemHitSlop) => (parameters) => {
|
|
@@ -8702,7 +9028,7 @@ function findDropTarget({
|
|
|
8702
9028
|
}
|
|
8703
9029
|
|
|
8704
9030
|
// src/components/sorting/sorting.ts
|
|
8705
|
-
import * as
|
|
9031
|
+
import * as React56 from "react";
|
|
8706
9032
|
var normalizeListTargetIndex = (index, position) => {
|
|
8707
9033
|
return position === "above" ? index : index + 1;
|
|
8708
9034
|
};
|
|
@@ -8718,7 +9044,7 @@ var defaultAcceptsDrop = ({
|
|
|
8718
9044
|
}
|
|
8719
9045
|
return true;
|
|
8720
9046
|
};
|
|
8721
|
-
var SortableItemContext =
|
|
9047
|
+
var SortableItemContext = React56.createContext({
|
|
8722
9048
|
keys: [],
|
|
8723
9049
|
acceptsDrop: defaultAcceptsDrop,
|
|
8724
9050
|
axis: "y",
|
|
@@ -8784,7 +9110,7 @@ function parseDragItemKey(key) {
|
|
|
8784
9110
|
}
|
|
8785
9111
|
|
|
8786
9112
|
// src/components/sorting/Sortable.tsx
|
|
8787
|
-
var SortableItemContext2 =
|
|
9113
|
+
var SortableItemContext2 = React57.createContext({
|
|
8788
9114
|
acceptsDrop: defaultAcceptsDrop,
|
|
8789
9115
|
listId: "",
|
|
8790
9116
|
getDropTargetParentIndex: void 0,
|
|
@@ -8797,7 +9123,7 @@ function useSortableDropIndicator({
|
|
|
8797
9123
|
acceptsDrop: acceptsDrop2,
|
|
8798
9124
|
getDropTargetParentIndex
|
|
8799
9125
|
}) {
|
|
8800
|
-
const { activeDragContext } =
|
|
9126
|
+
const { activeDragContext } = React57.useContext(SortableItemContext2);
|
|
8801
9127
|
const activeDrag = useActiveDrag(activeDragContext);
|
|
8802
9128
|
const { source, target } = activeDrag;
|
|
8803
9129
|
if (!source || !target) return;
|
|
@@ -8828,7 +9154,7 @@ function SortableItem({
|
|
|
8828
9154
|
disabled,
|
|
8829
9155
|
children
|
|
8830
9156
|
}) {
|
|
8831
|
-
const { acceptsDrop: acceptsDrop2, listId, getDropTargetParentIndex } =
|
|
9157
|
+
const { acceptsDrop: acceptsDrop2, listId, getDropTargetParentIndex } = React57.useContext(SortableItemContext2);
|
|
8832
9158
|
const dragItemKey = createDragItemKey(listId, id);
|
|
8833
9159
|
const {
|
|
8834
9160
|
attributes,
|
|
@@ -8843,7 +9169,7 @@ function SortableItem({
|
|
|
8843
9169
|
id: dragItemKey,
|
|
8844
9170
|
disabled
|
|
8845
9171
|
});
|
|
8846
|
-
const ref =
|
|
9172
|
+
const ref = React57.useCallback(
|
|
8847
9173
|
(node) => setNodeRef(node),
|
|
8848
9174
|
[setNodeRef]
|
|
8849
9175
|
);
|
|
@@ -8854,7 +9180,7 @@ function SortableItem({
|
|
|
8854
9180
|
acceptsDrop: acceptsDrop2,
|
|
8855
9181
|
getDropTargetParentIndex
|
|
8856
9182
|
});
|
|
8857
|
-
const props =
|
|
9183
|
+
const props = useMemo23(
|
|
8858
9184
|
() => ({
|
|
8859
9185
|
ref,
|
|
8860
9186
|
...attributes,
|
|
@@ -8863,7 +9189,7 @@ function SortableItem({
|
|
|
8863
9189
|
}),
|
|
8864
9190
|
[ref, attributes, listeners, isDragging]
|
|
8865
9191
|
);
|
|
8866
|
-
const extraProps =
|
|
9192
|
+
const extraProps = useMemo23(
|
|
8867
9193
|
() => ({
|
|
8868
9194
|
isDragging,
|
|
8869
9195
|
isOverlay: false,
|
|
@@ -8897,9 +9223,9 @@ function SortableRoot_({
|
|
|
8897
9223
|
containerRef,
|
|
8898
9224
|
itemHitSlop
|
|
8899
9225
|
}) {
|
|
8900
|
-
const defaultId =
|
|
9226
|
+
const defaultId = React57.useId();
|
|
8901
9227
|
const id = idProp ?? defaultId;
|
|
8902
|
-
const keys =
|
|
9228
|
+
const keys = React57.useMemo(() => {
|
|
8903
9229
|
return keysProp.map((key) => createDragItemKey(id, key));
|
|
8904
9230
|
}, [keysProp, id]);
|
|
8905
9231
|
const { registerList, unregisterList } = useDragRegistration(
|
|
@@ -8908,7 +9234,7 @@ function SortableRoot_({
|
|
|
8908
9234
|
const { setNodeRef: setDroppableRef } = useDroppable({
|
|
8909
9235
|
id
|
|
8910
9236
|
});
|
|
8911
|
-
|
|
9237
|
+
React57.useEffect(() => {
|
|
8912
9238
|
const listConfig = {
|
|
8913
9239
|
id,
|
|
8914
9240
|
keys,
|
|
@@ -8962,7 +9288,7 @@ function SortableRoot_({
|
|
|
8962
9288
|
keys,
|
|
8963
9289
|
itemHitSlop
|
|
8964
9290
|
]);
|
|
8965
|
-
const contextValue =
|
|
9291
|
+
const contextValue = React57.useMemo(
|
|
8966
9292
|
() => ({
|
|
8967
9293
|
keys,
|
|
8968
9294
|
acceptsDrop: acceptsDrop2,
|
|
@@ -8973,17 +9299,17 @@ function SortableRoot_({
|
|
|
8973
9299
|
[keys, acceptsDrop2, id, getDropTargetParentIndex, sharedDragProps]
|
|
8974
9300
|
);
|
|
8975
9301
|
const activeDragContext = sharedDragProps?.activeDragContext ?? ActiveDragContext;
|
|
8976
|
-
const dragState =
|
|
9302
|
+
const dragState = React57.useContext(activeDragContext);
|
|
8977
9303
|
const isDragging = !!dragState?.source;
|
|
8978
|
-
|
|
9304
|
+
React57.useEffect(() => {
|
|
8979
9305
|
onIsDraggingChange?.(isDragging);
|
|
8980
9306
|
}, [isDragging, onIsDraggingChange]);
|
|
8981
|
-
|
|
9307
|
+
React57.useEffect(() => {
|
|
8982
9308
|
if (containerRef) {
|
|
8983
9309
|
setDroppableRef(containerRef.current);
|
|
8984
9310
|
}
|
|
8985
9311
|
});
|
|
8986
|
-
return /* @__PURE__ */
|
|
9312
|
+
return /* @__PURE__ */ React57.createElement(SortableItemContext2.Provider, { value: contextValue }, /* @__PURE__ */ React57.createElement(
|
|
8987
9313
|
SortableContext,
|
|
8988
9314
|
{
|
|
8989
9315
|
items: keys,
|
|
@@ -9000,11 +9326,11 @@ var Sortable_ = function Sortable_2({
|
|
|
9000
9326
|
renderItem,
|
|
9001
9327
|
...rest
|
|
9002
9328
|
}) {
|
|
9003
|
-
const keys =
|
|
9329
|
+
const keys = React57.useMemo(
|
|
9004
9330
|
() => items.map(keyExtractor),
|
|
9005
9331
|
[items, keyExtractor]
|
|
9006
9332
|
);
|
|
9007
|
-
const renderOverlay =
|
|
9333
|
+
const renderOverlay = React57.useCallback(
|
|
9008
9334
|
(index) => {
|
|
9009
9335
|
return renderItem(
|
|
9010
9336
|
items[index],
|
|
@@ -9034,14 +9360,14 @@ var Sortable_ = function Sortable_2({
|
|
|
9034
9360
|
},
|
|
9035
9361
|
[renderItem, items]
|
|
9036
9362
|
);
|
|
9037
|
-
return /* @__PURE__ */
|
|
9363
|
+
return /* @__PURE__ */ React57.createElement(
|
|
9038
9364
|
SortableRoot,
|
|
9039
9365
|
{
|
|
9040
9366
|
...rest,
|
|
9041
9367
|
keys,
|
|
9042
9368
|
renderOverlay: shouldRenderOverlay ? renderOverlay : void 0
|
|
9043
9369
|
},
|
|
9044
|
-
keys.map((key, index) => /* @__PURE__ */
|
|
9370
|
+
keys.map((key, index) => /* @__PURE__ */ React57.createElement(SortableItem, { key, id: key }, (props, extraProps) => {
|
|
9045
9371
|
return renderItem(items[index], props, extraProps);
|
|
9046
9372
|
}))
|
|
9047
9373
|
);
|
|
@@ -9055,87 +9381,6 @@ var Sortable = Object.assign(Sortable_, {
|
|
|
9055
9381
|
var ROW_HEIGHT = 31;
|
|
9056
9382
|
var SECTION_HEADER_LABEL_HEIGHT = 24;
|
|
9057
9383
|
var TALL_ROW_HEIGHT = 50;
|
|
9058
|
-
var VirtualizedListRow = memo20(function VirtualizedListRow2({
|
|
9059
|
-
index,
|
|
9060
|
-
style: style2
|
|
9061
|
-
}) {
|
|
9062
|
-
const renderItem = useContext12(RenderItemContext);
|
|
9063
|
-
return /* @__PURE__ */ React56.createElement("div", { key: index, style: style2 }, renderItem(index));
|
|
9064
|
-
});
|
|
9065
|
-
var VirtualizedListInner = forwardRefGeneric(function VirtualizedListInner2({
|
|
9066
|
-
size,
|
|
9067
|
-
scrollElement,
|
|
9068
|
-
items,
|
|
9069
|
-
getItemHeight,
|
|
9070
|
-
keyExtractor,
|
|
9071
|
-
renderItem
|
|
9072
|
-
}, ref) {
|
|
9073
|
-
const listRef = useRef19(null);
|
|
9074
|
-
useImperativeHandle4(ref, () => ({
|
|
9075
|
-
scrollToIndex(index) {
|
|
9076
|
-
listRef.current?.scrollToItem(index);
|
|
9077
|
-
}
|
|
9078
|
-
}));
|
|
9079
|
-
useLayoutEffect6(() => {
|
|
9080
|
-
listRef.current?.resetAfterIndex(0);
|
|
9081
|
-
}, [
|
|
9082
|
-
// When items or the height resolver change, re-render the virtualized list
|
|
9083
|
-
// since VariableSizeList caches sizes per index.
|
|
9084
|
-
items,
|
|
9085
|
-
getItemHeight
|
|
9086
|
-
]);
|
|
9087
|
-
const listStyle = useMemo23(
|
|
9088
|
-
() => ({
|
|
9089
|
-
overflowX: "initial",
|
|
9090
|
-
overflowY: "initial",
|
|
9091
|
-
overflow: "initial"
|
|
9092
|
-
}),
|
|
9093
|
-
[]
|
|
9094
|
-
);
|
|
9095
|
-
return /* @__PURE__ */ React56.createElement(RenderItemContext.Provider, { value: renderItem }, /* @__PURE__ */ React56.createElement(
|
|
9096
|
-
WindowScroller,
|
|
9097
|
-
{
|
|
9098
|
-
scrollElement,
|
|
9099
|
-
style: useMemo23(() => ({ flex: "1 1 auto" }), [])
|
|
9100
|
-
},
|
|
9101
|
-
useCallback24(
|
|
9102
|
-
({
|
|
9103
|
-
registerChild,
|
|
9104
|
-
onChildScroll,
|
|
9105
|
-
scrollTop
|
|
9106
|
-
}) => /* @__PURE__ */ React56.createElement("div", { ref: registerChild }, /* @__PURE__ */ React56.createElement(
|
|
9107
|
-
VariableSizeList,
|
|
9108
|
-
{
|
|
9109
|
-
ref: listRef,
|
|
9110
|
-
key: scrollTop,
|
|
9111
|
-
style: listStyle,
|
|
9112
|
-
itemKey: keyExtractor,
|
|
9113
|
-
onScroll: ({ scrollOffset }) => {
|
|
9114
|
-
onChildScroll({ scrollTop: scrollOffset });
|
|
9115
|
-
},
|
|
9116
|
-
initialScrollOffset: scrollTop,
|
|
9117
|
-
width: size.width,
|
|
9118
|
-
height: size.height,
|
|
9119
|
-
itemCount: items.length,
|
|
9120
|
-
itemSize: getItemHeight,
|
|
9121
|
-
estimatedItemSize: ROW_HEIGHT
|
|
9122
|
-
},
|
|
9123
|
-
VirtualizedListRow
|
|
9124
|
-
)),
|
|
9125
|
-
[
|
|
9126
|
-
listStyle,
|
|
9127
|
-
keyExtractor,
|
|
9128
|
-
size.width,
|
|
9129
|
-
size.height,
|
|
9130
|
-
items.length,
|
|
9131
|
-
getItemHeight
|
|
9132
|
-
]
|
|
9133
|
-
)
|
|
9134
|
-
));
|
|
9135
|
-
});
|
|
9136
|
-
var VirtualizedList = memo20(
|
|
9137
|
-
VirtualizedListInner
|
|
9138
|
-
);
|
|
9139
9384
|
var ListViewRoot = memoGeneric(
|
|
9140
9385
|
forwardRefGeneric(function ListViewRootInner({
|
|
9141
9386
|
id,
|
|
@@ -9174,7 +9419,7 @@ var ListViewRoot = memoGeneric(
|
|
|
9174
9419
|
itemHeight,
|
|
9175
9420
|
getItemHeightForItem
|
|
9176
9421
|
}, forwardedRef) {
|
|
9177
|
-
const handleClick =
|
|
9422
|
+
const handleClick = useCallback25(
|
|
9178
9423
|
(event) => {
|
|
9179
9424
|
if (event.target instanceof HTMLElement && event.target.classList.contains("scroll-component"))
|
|
9180
9425
|
return;
|
|
@@ -9184,11 +9429,11 @@ var ListViewRoot = memoGeneric(
|
|
|
9184
9429
|
},
|
|
9185
9430
|
[onPress]
|
|
9186
9431
|
);
|
|
9187
|
-
const renderChild =
|
|
9432
|
+
const renderChild = useCallback25(
|
|
9188
9433
|
(index) => renderItem(data[index], index, { isDragOverlay: false }),
|
|
9189
9434
|
[data, renderItem]
|
|
9190
9435
|
);
|
|
9191
|
-
const defaultContextValue =
|
|
9436
|
+
const defaultContextValue = useMemo24(
|
|
9192
9437
|
() => ({
|
|
9193
9438
|
marginType: "none",
|
|
9194
9439
|
selectedPosition: "only",
|
|
@@ -9196,7 +9441,7 @@ var ListViewRoot = memoGeneric(
|
|
|
9196
9441
|
}),
|
|
9197
9442
|
[]
|
|
9198
9443
|
);
|
|
9199
|
-
const getItemContextValue =
|
|
9444
|
+
const getItemContextValue = useCallback25(
|
|
9200
9445
|
(i) => {
|
|
9201
9446
|
if (variant === "bare" || variant === "normal") {
|
|
9202
9447
|
const current2 = renderChild(i);
|
|
@@ -9244,27 +9489,27 @@ var ListViewRoot = memoGeneric(
|
|
|
9244
9489
|
},
|
|
9245
9490
|
[variant, defaultContextValue, renderChild, data.length]
|
|
9246
9491
|
);
|
|
9247
|
-
const draggingContextOverlayValue =
|
|
9492
|
+
const draggingContextOverlayValue = useMemo24(
|
|
9248
9493
|
() => ({
|
|
9249
9494
|
isDragOverlay: true
|
|
9250
9495
|
}),
|
|
9251
9496
|
[]
|
|
9252
9497
|
);
|
|
9253
|
-
const renderOverlay =
|
|
9254
|
-
(index) => /* @__PURE__ */
|
|
9498
|
+
const renderOverlay = useCallback25(
|
|
9499
|
+
(index) => /* @__PURE__ */ React58.createElement("div", { style: { opacity: 0.25 } }, /* @__PURE__ */ React58.createElement(ListViewDraggingContext.Provider, { value: draggingContextOverlayValue }, renderItem(data[index], index, { isDragOverlay: true }))),
|
|
9255
9500
|
[draggingContextOverlayValue, renderItem, data]
|
|
9256
9501
|
);
|
|
9257
|
-
const renderWrappedChild =
|
|
9502
|
+
const renderWrappedChild = useCallback25(
|
|
9258
9503
|
(index) => {
|
|
9259
9504
|
const contextValue2 = getItemContextValue(index);
|
|
9260
9505
|
const current = renderChild(index);
|
|
9261
9506
|
if (!contextValue2 || !isValidElement3(current)) return null;
|
|
9262
|
-
return /* @__PURE__ */
|
|
9507
|
+
return /* @__PURE__ */ React58.createElement(ListRowContext.Provider, { key: current.key, value: contextValue2 }, current);
|
|
9263
9508
|
},
|
|
9264
9509
|
[getItemContextValue, renderChild]
|
|
9265
9510
|
);
|
|
9266
|
-
const ids =
|
|
9267
|
-
const withSortable = (children) => sortable ? /* @__PURE__ */
|
|
9511
|
+
const ids = useMemo24(() => data.map(keyExtractor), [keyExtractor, data]);
|
|
9512
|
+
const withSortable = (children) => sortable ? /* @__PURE__ */ React58.createElement(
|
|
9268
9513
|
Sortable.Root,
|
|
9269
9514
|
{
|
|
9270
9515
|
id: sortableId,
|
|
@@ -9277,8 +9522,8 @@ var ListViewRoot = memoGeneric(
|
|
|
9277
9522
|
},
|
|
9278
9523
|
children
|
|
9279
9524
|
) : children;
|
|
9280
|
-
const withScrollable = (children) => scrollable ? /* @__PURE__ */
|
|
9281
|
-
const getItemHeight =
|
|
9525
|
+
const withScrollable = (children) => scrollable ? /* @__PURE__ */ React58.createElement(ScrollArea, null, children) : children;
|
|
9526
|
+
const getItemHeight = useCallback25(
|
|
9282
9527
|
(index) => {
|
|
9283
9528
|
const child = getItemContextValue(index);
|
|
9284
9529
|
if (child?.isSectionHeader && sectionHeaderVariant === "label") {
|
|
@@ -9298,13 +9543,13 @@ var ListViewRoot = memoGeneric(
|
|
|
9298
9543
|
data
|
|
9299
9544
|
]
|
|
9300
9545
|
);
|
|
9301
|
-
const getKey =
|
|
9546
|
+
const getKey = useCallback25(
|
|
9302
9547
|
(index) => keyExtractor(data[index], index),
|
|
9303
9548
|
[data, keyExtractor]
|
|
9304
9549
|
);
|
|
9305
|
-
const draggingContextValue =
|
|
9306
|
-
const gapStyle =
|
|
9307
|
-
const contextValue =
|
|
9550
|
+
const draggingContextValue = useMemo24(() => ({}), []);
|
|
9551
|
+
const gapStyle = useMemo24(() => ({ gap: `${gap}px` }), [gap]);
|
|
9552
|
+
const contextValue = useMemo24(
|
|
9308
9553
|
() => ({
|
|
9309
9554
|
pressEventName,
|
|
9310
9555
|
colorScheme,
|
|
@@ -9328,7 +9573,7 @@ var ListViewRoot = memoGeneric(
|
|
|
9328
9573
|
indentation
|
|
9329
9574
|
]
|
|
9330
9575
|
);
|
|
9331
|
-
return /* @__PURE__ */
|
|
9576
|
+
return /* @__PURE__ */ React58.createElement(ListViewContext.Provider, { value: contextValue }, /* @__PURE__ */ React58.createElement(ListViewDraggingContext.Provider, { value: draggingContextValue }, /* @__PURE__ */ React58.createElement(
|
|
9332
9577
|
"div",
|
|
9333
9578
|
{
|
|
9334
9579
|
id,
|
|
@@ -9355,21 +9600,21 @@ var ListViewRoot = memoGeneric(
|
|
|
9355
9600
|
onDragLeave,
|
|
9356
9601
|
onDrop
|
|
9357
9602
|
},
|
|
9358
|
-
data.length === 0 && renderEmptyState ? renderEmptyState() :
|
|
9359
|
-
|
|
9360
|
-
|
|
9361
|
-
|
|
9362
|
-
|
|
9363
|
-
|
|
9364
|
-
|
|
9365
|
-
|
|
9366
|
-
|
|
9367
|
-
|
|
9368
|
-
|
|
9369
|
-
|
|
9370
|
-
}
|
|
9371
|
-
) : range(0, data.length).map(renderWrappedChild)
|
|
9603
|
+
data.length === 0 && renderEmptyState ? renderEmptyState() : virtualized != null ? withSortable(
|
|
9604
|
+
/* @__PURE__ */ React58.createElement(
|
|
9605
|
+
Virtualized2,
|
|
9606
|
+
{
|
|
9607
|
+
ref: forwardedRef,
|
|
9608
|
+
height: virtualized,
|
|
9609
|
+
itemCount: data.length,
|
|
9610
|
+
getItemHeight,
|
|
9611
|
+
renderItem: renderWrappedChild,
|
|
9612
|
+
itemKey: getKey,
|
|
9613
|
+
useScrollArea: scrollable
|
|
9614
|
+
}
|
|
9372
9615
|
)
|
|
9616
|
+
) : withScrollable(
|
|
9617
|
+
withSortable(range(0, data.length).map(renderWrappedChild))
|
|
9373
9618
|
)
|
|
9374
9619
|
)));
|
|
9375
9620
|
})
|
|
@@ -9377,11 +9622,11 @@ var ListViewRoot = memoGeneric(
|
|
|
9377
9622
|
|
|
9378
9623
|
// src/components/listView/ListViewRow.tsx
|
|
9379
9624
|
import { composeRefs as composeRefs2 } from "@radix-ui/react-compose-refs";
|
|
9380
|
-
import
|
|
9625
|
+
import React59, {
|
|
9381
9626
|
forwardRef as forwardRef21,
|
|
9382
|
-
useCallback as
|
|
9383
|
-
useContext as
|
|
9384
|
-
useMemo as
|
|
9627
|
+
useCallback as useCallback26,
|
|
9628
|
+
useContext as useContext12,
|
|
9629
|
+
useMemo as useMemo25
|
|
9385
9630
|
} from "react";
|
|
9386
9631
|
|
|
9387
9632
|
// src/hooks/mergeEventHandlers.ts
|
|
@@ -9435,7 +9680,7 @@ var RowContainer = forwardRef21(
|
|
|
9435
9680
|
"aria-selected": ariaSelected,
|
|
9436
9681
|
...props
|
|
9437
9682
|
}, ref) => {
|
|
9438
|
-
return /* @__PURE__ */
|
|
9683
|
+
return /* @__PURE__ */ React59.createElement(
|
|
9439
9684
|
Component,
|
|
9440
9685
|
{
|
|
9441
9686
|
ref,
|
|
@@ -9517,7 +9762,7 @@ var ListViewDragIndicatorElement = forwardRef21(
|
|
|
9517
9762
|
style: style2,
|
|
9518
9763
|
...props
|
|
9519
9764
|
}, ref) => {
|
|
9520
|
-
return /* @__PURE__ */
|
|
9765
|
+
return /* @__PURE__ */ React59.createElement(
|
|
9521
9766
|
"div",
|
|
9522
9767
|
{
|
|
9523
9768
|
ref,
|
|
@@ -9585,27 +9830,27 @@ var ListViewRow = memoGeneric(
|
|
|
9585
9830
|
divider,
|
|
9586
9831
|
sortable,
|
|
9587
9832
|
indentation
|
|
9588
|
-
} =
|
|
9589
|
-
const { marginType, selectedPosition } =
|
|
9833
|
+
} = useContext12(ListViewContext);
|
|
9834
|
+
const { marginType, selectedPosition } = useContext12(ListRowContext);
|
|
9590
9835
|
const { hoverProps } = useHover({
|
|
9591
9836
|
onHoverChange
|
|
9592
9837
|
});
|
|
9593
|
-
const { isDragOverlay } =
|
|
9594
|
-
const handlePress =
|
|
9838
|
+
const { isDragOverlay } = useContext12(ListViewDraggingContext);
|
|
9839
|
+
const handlePress = useCallback26(
|
|
9595
9840
|
(event) => {
|
|
9596
9841
|
if (event.button !== 0) return;
|
|
9597
9842
|
onPress?.(event);
|
|
9598
9843
|
},
|
|
9599
9844
|
[onPress]
|
|
9600
9845
|
);
|
|
9601
|
-
const handleDoubleClick =
|
|
9846
|
+
const handleDoubleClick = useCallback26(
|
|
9602
9847
|
(event) => {
|
|
9603
9848
|
event.stopPropagation();
|
|
9604
9849
|
onDoubleClick?.();
|
|
9605
9850
|
},
|
|
9606
9851
|
[onDoubleClick]
|
|
9607
9852
|
);
|
|
9608
|
-
const mergedStyle =
|
|
9853
|
+
const mergedStyle = useMemo25(() => {
|
|
9609
9854
|
return isDragOverlay ? {
|
|
9610
9855
|
// TODO: Where do these offsets actually come from?
|
|
9611
9856
|
transform: `translate3d(-36px, -6px, 0)`,
|
|
@@ -9616,7 +9861,7 @@ var ListViewRow = memoGeneric(
|
|
|
9616
9861
|
const renderContent = (renderProps, ref, relativeDropPositionProp) => {
|
|
9617
9862
|
const Component = RowContainer;
|
|
9618
9863
|
const relativeDropPosition = testRelativeDropPosition ?? relativeDropPositionProp;
|
|
9619
|
-
const element = /* @__PURE__ */
|
|
9864
|
+
const element = /* @__PURE__ */ React59.createElement(
|
|
9620
9865
|
Component,
|
|
9621
9866
|
{
|
|
9622
9867
|
as,
|
|
@@ -9651,7 +9896,7 @@ var ListViewRow = memoGeneric(
|
|
|
9651
9896
|
className,
|
|
9652
9897
|
$clickable: !!onPress
|
|
9653
9898
|
},
|
|
9654
|
-
relativeDropPosition && /* @__PURE__ */
|
|
9899
|
+
relativeDropPosition && /* @__PURE__ */ React59.createElement(
|
|
9655
9900
|
ListViewDragIndicatorElement,
|
|
9656
9901
|
{
|
|
9657
9902
|
key: relativeDropPosition,
|
|
@@ -9666,11 +9911,11 @@ var ListViewRow = memoGeneric(
|
|
|
9666
9911
|
}) : dragIndicatorStyle
|
|
9667
9912
|
}
|
|
9668
9913
|
),
|
|
9669
|
-
depth > 0 && /* @__PURE__ */
|
|
9914
|
+
depth > 0 && /* @__PURE__ */ React59.createElement(Spacer.Horizontal, { size: depth * indentation }),
|
|
9670
9915
|
children
|
|
9671
9916
|
);
|
|
9672
9917
|
if (menuItems && onSelectMenuItem) {
|
|
9673
|
-
return /* @__PURE__ */
|
|
9918
|
+
return /* @__PURE__ */ React59.createElement(
|
|
9674
9919
|
ContextMenu,
|
|
9675
9920
|
{
|
|
9676
9921
|
items: menuItems,
|
|
@@ -9683,7 +9928,7 @@ var ListViewRow = memoGeneric(
|
|
|
9683
9928
|
return element;
|
|
9684
9929
|
};
|
|
9685
9930
|
if (sortable && id) {
|
|
9686
|
-
return /* @__PURE__ */
|
|
9931
|
+
return /* @__PURE__ */ React59.createElement(
|
|
9687
9932
|
Sortable.Item,
|
|
9688
9933
|
{
|
|
9689
9934
|
id,
|
|
@@ -9701,12 +9946,12 @@ var ListViewRow = memoGeneric(
|
|
|
9701
9946
|
);
|
|
9702
9947
|
|
|
9703
9948
|
// src/components/listView/ListViewRowTitle.tsx
|
|
9704
|
-
import
|
|
9705
|
-
var ListViewRowTitle =
|
|
9949
|
+
import React60, { memo as memo20 } from "react";
|
|
9950
|
+
var ListViewRowTitle = memo20(function ListViewRowTitle2({
|
|
9706
9951
|
className,
|
|
9707
9952
|
...props
|
|
9708
9953
|
}) {
|
|
9709
|
-
return /* @__PURE__ */
|
|
9954
|
+
return /* @__PURE__ */ React60.createElement(
|
|
9710
9955
|
"span",
|
|
9711
9956
|
{
|
|
9712
9957
|
className: cx(
|
|
@@ -9763,7 +10008,7 @@ var ListView;
|
|
|
9763
10008
|
})(ListView || (ListView = {}));
|
|
9764
10009
|
|
|
9765
10010
|
// src/components/TreeView.tsx
|
|
9766
|
-
import
|
|
10011
|
+
import React61, { useCallback as useCallback27, useContext as useContext13 } from "react";
|
|
9767
10012
|
var TreeRow = forwardRefGeneric(function TreeRow2({
|
|
9768
10013
|
icon,
|
|
9769
10014
|
expanded,
|
|
@@ -9774,9 +10019,9 @@ var TreeRow = forwardRefGeneric(function TreeRow2({
|
|
|
9774
10019
|
children,
|
|
9775
10020
|
...rest
|
|
9776
10021
|
}, forwardedRef) {
|
|
9777
|
-
const { expandable } =
|
|
10022
|
+
const { expandable } = useContext13(ListViewContext);
|
|
9778
10023
|
const stableOnClickChevron = useStableCallback(onClickChevron);
|
|
9779
|
-
const handleClickChevron =
|
|
10024
|
+
const handleClickChevron = useCallback27(
|
|
9780
10025
|
(event) => {
|
|
9781
10026
|
event.stopPropagation();
|
|
9782
10027
|
event.preventDefault();
|
|
@@ -9784,7 +10029,7 @@ var TreeRow = forwardRefGeneric(function TreeRow2({
|
|
|
9784
10029
|
},
|
|
9785
10030
|
[stableOnClickChevron]
|
|
9786
10031
|
);
|
|
9787
|
-
return /* @__PURE__ */
|
|
10032
|
+
return /* @__PURE__ */ React61.createElement(ListView.Row, { ref: forwardedRef, ...rest }, expandable && chevronPosition !== "end" && /* @__PURE__ */ React61.createElement(React61.Fragment, null, expanded === void 0 ? /* @__PURE__ */ React61.createElement(Spacer.Horizontal, { size: 19 }) : /* @__PURE__ */ React61.createElement(
|
|
9788
10033
|
IconButton,
|
|
9789
10034
|
{
|
|
9790
10035
|
as: chevronAs,
|
|
@@ -9793,7 +10038,7 @@ var TreeRow = forwardRefGeneric(function TreeRow2({
|
|
|
9793
10038
|
onClick: handleClickChevron,
|
|
9794
10039
|
selected: rest.selected
|
|
9795
10040
|
}
|
|
9796
|
-
), /* @__PURE__ */
|
|
10041
|
+
), /* @__PURE__ */ React61.createElement(Spacer.Horizontal, { size: 6 })), icon && /* @__PURE__ */ React61.createElement(React61.Fragment, null, renderIcon(icon), /* @__PURE__ */ React61.createElement(Spacer.Horizontal, { size: 10 })), children, expandable && chevronPosition === "end" && /* @__PURE__ */ React61.createElement(React61.Fragment, null, /* @__PURE__ */ React61.createElement(Spacer.Horizontal, { size: 6 }), expanded === void 0 ? /* @__PURE__ */ React61.createElement(React61.Fragment, null) : /* @__PURE__ */ React61.createElement(React61.Fragment, null, /* @__PURE__ */ React61.createElement(
|
|
9797
10042
|
IconButton,
|
|
9798
10043
|
{
|
|
9799
10044
|
as: chevronAs,
|
|
@@ -9802,7 +10047,7 @@ var TreeRow = forwardRefGeneric(function TreeRow2({
|
|
|
9802
10047
|
onClick: handleClickChevron,
|
|
9803
10048
|
selected: rest.selected
|
|
9804
10049
|
}
|
|
9805
|
-
), /* @__PURE__ */
|
|
10050
|
+
), /* @__PURE__ */ React61.createElement(Spacer.Horizontal, { size: 8 }))));
|
|
9806
10051
|
});
|
|
9807
10052
|
var TreeView;
|
|
9808
10053
|
((TreeView2) => {
|
|
@@ -9870,9 +10115,9 @@ var List = memoGeneric(
|
|
|
9870
10115
|
getItemStyle,
|
|
9871
10116
|
getItemClassName
|
|
9872
10117
|
} = props;
|
|
9873
|
-
const [internalHoveredId, setHoveredId] =
|
|
9874
|
-
const [internalRenamingId, setRenamingId] =
|
|
9875
|
-
const [dropdownOpenId, setDropdownOpenId] =
|
|
10118
|
+
const [internalHoveredId, setHoveredId] = useState26();
|
|
10119
|
+
const [internalRenamingId, setRenamingId] = useState26();
|
|
10120
|
+
const [dropdownOpenId, setDropdownOpenId] = useState26();
|
|
9876
10121
|
const hoveredId = internalHoveredId ?? testHoveredId;
|
|
9877
10122
|
const renamingId = testRenamingId ?? internalRenamingId;
|
|
9878
10123
|
const itemClassName = cx(
|
|
@@ -9880,7 +10125,7 @@ var List = memoGeneric(
|
|
|
9880
10125
|
pyMap[size],
|
|
9881
10126
|
itemClassNameProp
|
|
9882
10127
|
);
|
|
9883
|
-
const itemStyle =
|
|
10128
|
+
const itemStyle = useMemo26(
|
|
9884
10129
|
() => ({ ...cssVarOverrides, ...itemStyleProp }),
|
|
9885
10130
|
[itemStyleProp]
|
|
9886
10131
|
);
|
|
@@ -9918,7 +10163,7 @@ var List = memoGeneric(
|
|
|
9918
10163
|
setRenamingId(id);
|
|
9919
10164
|
}
|
|
9920
10165
|
}));
|
|
9921
|
-
return /* @__PURE__ */
|
|
10166
|
+
return /* @__PURE__ */ React62.createElement(
|
|
9922
10167
|
ViewComponent.Root,
|
|
9923
10168
|
{
|
|
9924
10169
|
variant: "bare",
|
|
@@ -9967,7 +10212,7 @@ var List = memoGeneric(
|
|
|
9967
10212
|
handleSelect(id);
|
|
9968
10213
|
}
|
|
9969
10214
|
};
|
|
9970
|
-
const action = (isHovered || isSelected) && !isRenaming && (typeof renderAction === "function" ? renderAction({ item, selected: isSelected, onOpenChange }) : renderAction === "menu" && menuItems && /* @__PURE__ */
|
|
10215
|
+
const action = (isHovered || isSelected) && !isRenaming && (typeof renderAction === "function" ? renderAction({ item, selected: isSelected, onOpenChange }) : renderAction === "menu" && menuItems && /* @__PURE__ */ React62.createElement(
|
|
9971
10216
|
ActionMenu,
|
|
9972
10217
|
{
|
|
9973
10218
|
menuItems,
|
|
@@ -9987,7 +10232,7 @@ var List = memoGeneric(
|
|
|
9987
10232
|
let below = detailPosition === "below" ? detailContent : void 0;
|
|
9988
10233
|
if (below && normalizedDetailLineClamp) {
|
|
9989
10234
|
const clampClassName = DETAIL_LINE_CLAMP_CLASSES[normalizedDetailLineClamp];
|
|
9990
|
-
below = /* @__PURE__ */
|
|
10235
|
+
below = /* @__PURE__ */ React62.createElement(
|
|
9991
10236
|
"div",
|
|
9992
10237
|
{
|
|
9993
10238
|
className: cx(
|
|
@@ -10000,7 +10245,7 @@ var List = memoGeneric(
|
|
|
10000
10245
|
}
|
|
10001
10246
|
const perItemStyle = getItemStyle?.(item, isSelected);
|
|
10002
10247
|
const perItemClassName = getItemClassName?.(item, isSelected);
|
|
10003
|
-
return /* @__PURE__ */
|
|
10248
|
+
return /* @__PURE__ */ React62.createElement(
|
|
10004
10249
|
ViewComponent.Row,
|
|
10005
10250
|
{
|
|
10006
10251
|
as: typeof href === "string" ? LinkComponent2 : void 0,
|
|
@@ -10055,7 +10300,7 @@ var List = memoGeneric(
|
|
|
10055
10300
|
},
|
|
10056
10301
|
dragIndicatorStyle
|
|
10057
10302
|
},
|
|
10058
|
-
/* @__PURE__ */
|
|
10303
|
+
/* @__PURE__ */ React62.createElement(
|
|
10059
10304
|
"div",
|
|
10060
10305
|
{
|
|
10061
10306
|
className: cx(
|
|
@@ -10063,7 +10308,7 @@ var List = memoGeneric(
|
|
|
10063
10308
|
rowGapMap[size]
|
|
10064
10309
|
)
|
|
10065
10310
|
},
|
|
10066
|
-
thumbnail && /* @__PURE__ */
|
|
10311
|
+
thumbnail && /* @__PURE__ */ React62.createElement(
|
|
10067
10312
|
"div",
|
|
10068
10313
|
{
|
|
10069
10314
|
className: cx(
|
|
@@ -10076,13 +10321,13 @@ var List = memoGeneric(
|
|
|
10076
10321
|
},
|
|
10077
10322
|
thumbnail
|
|
10078
10323
|
),
|
|
10079
|
-
/* @__PURE__ */
|
|
10324
|
+
/* @__PURE__ */ React62.createElement("div", { className: "n-flex n-flex-col n-flex-1 n-w-0" }, /* @__PURE__ */ React62.createElement("div", { className: "n-flex n-items-center n-min-h-input-height n-flex-1 n-gap-2" }, /* @__PURE__ */ React62.createElement(
|
|
10080
10325
|
"div",
|
|
10081
10326
|
{
|
|
10082
10327
|
className: "n-flex-1 n-w-0 n-flex n-items-center",
|
|
10083
10328
|
tabIndex: -1
|
|
10084
10329
|
},
|
|
10085
|
-
isRenaming ? /* @__PURE__ */
|
|
10330
|
+
isRenaming ? /* @__PURE__ */ React62.createElement(
|
|
10086
10331
|
ViewComponent.EditableRowTitle,
|
|
10087
10332
|
{
|
|
10088
10333
|
value: getName(item),
|
|
@@ -10098,7 +10343,7 @@ var List = memoGeneric(
|
|
|
10098
10343
|
e.stopPropagation();
|
|
10099
10344
|
}
|
|
10100
10345
|
}
|
|
10101
|
-
) : /* @__PURE__ */
|
|
10346
|
+
) : /* @__PURE__ */ React62.createElement(
|
|
10102
10347
|
ViewComponent.RowTitle,
|
|
10103
10348
|
{
|
|
10104
10349
|
className: cx(
|
|
@@ -10108,7 +10353,7 @@ var List = memoGeneric(
|
|
|
10108
10353
|
},
|
|
10109
10354
|
getName(item)
|
|
10110
10355
|
)
|
|
10111
|
-
), right && detailPosition === "end" && /* @__PURE__ */
|
|
10356
|
+
), right && detailPosition === "end" && /* @__PURE__ */ React62.createElement(DetailContainer, { selected: isSelected }, right), end && detailPosition === "end" && /* @__PURE__ */ React62.createElement(DetailContainer, { selected: isSelected }, end)), below && /* @__PURE__ */ React62.createElement(
|
|
10112
10357
|
DetailContainer,
|
|
10113
10358
|
{
|
|
10114
10359
|
selected: isSelected,
|
|
@@ -10116,8 +10361,8 @@ var List = memoGeneric(
|
|
|
10116
10361
|
},
|
|
10117
10362
|
below
|
|
10118
10363
|
)),
|
|
10119
|
-
right && detailPosition === "below" && /* @__PURE__ */
|
|
10120
|
-
end && detailPosition === "below" && /* @__PURE__ */
|
|
10364
|
+
right && detailPosition === "below" && /* @__PURE__ */ React62.createElement(DetailContainer, { selected: isSelected }, right),
|
|
10365
|
+
end && detailPosition === "below" && /* @__PURE__ */ React62.createElement(DetailContainer, { selected: isSelected }, end)
|
|
10121
10366
|
)
|
|
10122
10367
|
);
|
|
10123
10368
|
}
|
|
@@ -10125,12 +10370,12 @@ var List = memoGeneric(
|
|
|
10125
10370
|
);
|
|
10126
10371
|
})
|
|
10127
10372
|
);
|
|
10128
|
-
var DetailContainer =
|
|
10373
|
+
var DetailContainer = memo21(function DetailContainer2({
|
|
10129
10374
|
children,
|
|
10130
10375
|
selected,
|
|
10131
10376
|
align = "center"
|
|
10132
10377
|
}) {
|
|
10133
|
-
return /* @__PURE__ */
|
|
10378
|
+
return /* @__PURE__ */ React62.createElement(
|
|
10134
10379
|
"div",
|
|
10135
10380
|
{
|
|
10136
10381
|
className: cx(
|
|
@@ -10201,7 +10446,7 @@ var itemHeightMap = {
|
|
|
10201
10446
|
// src/components/Collection.tsx
|
|
10202
10447
|
var Collection = forwardRefGeneric(function Collection2(props, ref) {
|
|
10203
10448
|
const { viewType, ...rest } = props;
|
|
10204
|
-
return viewType === "grid" ? /* @__PURE__ */
|
|
10449
|
+
return viewType === "grid" ? /* @__PURE__ */ React63.createElement(Grid, { ref, ...rest }) : /* @__PURE__ */ React63.createElement(List, { ref, ...rest });
|
|
10205
10450
|
});
|
|
10206
10451
|
|
|
10207
10452
|
// ../noya-color/src/convert.ts
|
|
@@ -10362,7 +10607,7 @@ import { clamp as clamp3 } from "@noya-app/noya-utils";
|
|
|
10362
10607
|
|
|
10363
10608
|
// src/components/ColorSwatch.tsx
|
|
10364
10609
|
import { CheckIcon } from "@noya-app/noya-icons";
|
|
10365
|
-
import
|
|
10610
|
+
import React64, { forwardRef as forwardRef22 } from "react";
|
|
10366
10611
|
var colorSwatchSizeMap = {
|
|
10367
10612
|
xxsmall: 15,
|
|
10368
10613
|
xsmall: 21,
|
|
@@ -10380,7 +10625,7 @@ var ColorSwatch = forwardRef22(function ColorSwatch2({
|
|
|
10380
10625
|
}, ref) {
|
|
10381
10626
|
const sizePx = colorSwatchSizeMap[size];
|
|
10382
10627
|
const checkedColor = getContrastColorForBackground(color);
|
|
10383
|
-
return /* @__PURE__ */
|
|
10628
|
+
return /* @__PURE__ */ React64.createElement("div", { className: "n-relative", style: { width: sizePx, height: sizePx } }, /* @__PURE__ */ React64.createElement(
|
|
10384
10629
|
Component,
|
|
10385
10630
|
{
|
|
10386
10631
|
...props,
|
|
@@ -10396,7 +10641,7 @@ var ColorSwatch = forwardRef22(function ColorSwatch2({
|
|
|
10396
10641
|
...style2
|
|
10397
10642
|
}
|
|
10398
10643
|
}
|
|
10399
|
-
), checked && /* @__PURE__ */
|
|
10644
|
+
), checked && /* @__PURE__ */ React64.createElement(
|
|
10400
10645
|
CheckIcon,
|
|
10401
10646
|
{
|
|
10402
10647
|
color: checkedColor,
|
|
@@ -10407,7 +10652,7 @@ var ColorSwatch = forwardRef22(function ColorSwatch2({
|
|
|
10407
10652
|
|
|
10408
10653
|
// src/components/ColorSwatchControl.tsx
|
|
10409
10654
|
import { ToggleGroup as ToggleGroupPrimitive } from "radix-ui";
|
|
10410
|
-
import
|
|
10655
|
+
import React65, { useMemo as useMemo27 } from "react";
|
|
10411
10656
|
function ColorSwatchControl(props) {
|
|
10412
10657
|
const {
|
|
10413
10658
|
options,
|
|
@@ -10422,7 +10667,7 @@ function ColorSwatchControl(props) {
|
|
|
10422
10667
|
id,
|
|
10423
10668
|
style: style2
|
|
10424
10669
|
} = props;
|
|
10425
|
-
const styles3 =
|
|
10670
|
+
const styles3 = useMemo27(() => {
|
|
10426
10671
|
return {
|
|
10427
10672
|
display: "grid",
|
|
10428
10673
|
gridTemplateColumns: `repeat(auto-fill, minmax(${colorSwatchSizeMap[size]}px, 1fr))`,
|
|
@@ -10430,8 +10675,8 @@ function ColorSwatchControl(props) {
|
|
|
10430
10675
|
...style2
|
|
10431
10676
|
};
|
|
10432
10677
|
}, [size, style2]);
|
|
10433
|
-
const content = /* @__PURE__ */
|
|
10434
|
-
const item = /* @__PURE__ */
|
|
10678
|
+
const content = /* @__PURE__ */ React65.createElement("div", { className, id, style: styles3 }, options.map((option) => {
|
|
10679
|
+
const item = /* @__PURE__ */ React65.createElement(
|
|
10435
10680
|
ColorSwatch,
|
|
10436
10681
|
{
|
|
10437
10682
|
key: `${option}-color-swatch`,
|
|
@@ -10444,7 +10689,7 @@ function ColorSwatchControl(props) {
|
|
|
10444
10689
|
checked: value === option
|
|
10445
10690
|
}
|
|
10446
10691
|
);
|
|
10447
|
-
return /* @__PURE__ */
|
|
10692
|
+
return /* @__PURE__ */ React65.createElement(
|
|
10448
10693
|
ToggleGroupPrimitive.Item,
|
|
10449
10694
|
{
|
|
10450
10695
|
asChild: true,
|
|
@@ -10455,7 +10700,7 @@ function ColorSwatchControl(props) {
|
|
|
10455
10700
|
item
|
|
10456
10701
|
);
|
|
10457
10702
|
}));
|
|
10458
|
-
return /* @__PURE__ */
|
|
10703
|
+
return /* @__PURE__ */ React65.createElement(
|
|
10459
10704
|
ToggleGroupPrimitive.Root,
|
|
10460
10705
|
{
|
|
10461
10706
|
type: "single",
|
|
@@ -10470,18 +10715,18 @@ function ColorSwatchControl(props) {
|
|
|
10470
10715
|
|
|
10471
10716
|
// src/components/Combobox.tsx
|
|
10472
10717
|
import { DropdownChevronIcon as DropdownChevronIcon2 } from "@noya-app/noya-icons";
|
|
10473
|
-
import
|
|
10474
|
-
useCallback as
|
|
10718
|
+
import React68, {
|
|
10719
|
+
useCallback as useCallback28,
|
|
10475
10720
|
useEffect as useEffect20,
|
|
10476
10721
|
useImperativeHandle as useImperativeHandle6,
|
|
10477
|
-
useMemo as
|
|
10722
|
+
useMemo as useMemo28,
|
|
10478
10723
|
useRef as useRef21,
|
|
10479
|
-
useState as
|
|
10724
|
+
useState as useState27
|
|
10480
10725
|
} from "react";
|
|
10481
10726
|
|
|
10482
10727
|
// src/utils/combobox.ts
|
|
10483
10728
|
import { chunkBy, partition } from "@noya-app/noya-utils";
|
|
10484
|
-
import
|
|
10729
|
+
import React66, { useSyncExternalStore } from "react";
|
|
10485
10730
|
|
|
10486
10731
|
// src/utils/fuzzyScorer.ts
|
|
10487
10732
|
import { scoreFilePathFuzzy } from "vscode-fuzzy-scorer";
|
|
@@ -10818,7 +11063,7 @@ function getNodeText(node) {
|
|
|
10818
11063
|
return "";
|
|
10819
11064
|
if (typeof node === "string" || typeof node === "number") return String(node);
|
|
10820
11065
|
if (Array.isArray(node)) return node.map(getNodeText).join("");
|
|
10821
|
-
if (
|
|
11066
|
+
if (React66.isValidElement(node)) {
|
|
10822
11067
|
return getNodeText(node.props?.children);
|
|
10823
11068
|
}
|
|
10824
11069
|
return "";
|
|
@@ -10826,7 +11071,7 @@ function getNodeText(node) {
|
|
|
10826
11071
|
|
|
10827
11072
|
// src/components/ComboboxMenu.tsx
|
|
10828
11073
|
import { CheckIcon as CheckIcon2 } from "@noya-app/noya-icons";
|
|
10829
|
-
import
|
|
11074
|
+
import React67, { memo as memo22 } from "react";
|
|
10830
11075
|
var ComboboxMenu = memoGeneric(
|
|
10831
11076
|
forwardRefGeneric(function ComboboxMenu2({
|
|
10832
11077
|
items,
|
|
@@ -10840,7 +11085,7 @@ var ComboboxMenu = memoGeneric(
|
|
|
10840
11085
|
itemHeight,
|
|
10841
11086
|
getRowHeightForItem
|
|
10842
11087
|
}, forwardedRef) {
|
|
10843
|
-
return /* @__PURE__ */
|
|
11088
|
+
return /* @__PURE__ */ React67.createElement(
|
|
10844
11089
|
ListView.Root,
|
|
10845
11090
|
{
|
|
10846
11091
|
ref: forwardedRef,
|
|
@@ -10850,7 +11095,7 @@ var ComboboxMenu = memoGeneric(
|
|
|
10850
11095
|
return item.value;
|
|
10851
11096
|
},
|
|
10852
11097
|
data: items,
|
|
10853
|
-
virtualized: listSize,
|
|
11098
|
+
virtualized: listSize.height,
|
|
10854
11099
|
...itemHeight ? { itemHeight } : {},
|
|
10855
11100
|
...getRowHeightForItem ? { getItemHeightForItem: getRowHeightForItem } : {},
|
|
10856
11101
|
pressEventName: "onPointerDown",
|
|
@@ -10858,7 +11103,7 @@ var ComboboxMenu = memoGeneric(
|
|
|
10858
11103
|
style: style2,
|
|
10859
11104
|
renderItem: (item, i) => {
|
|
10860
11105
|
if (item.type === "sectionHeader") {
|
|
10861
|
-
return /* @__PURE__ */
|
|
11106
|
+
return /* @__PURE__ */ React67.createElement(ListView.Row, { key: item.id, isSectionHeader: true }, indented && /* @__PURE__ */ React67.createElement(
|
|
10862
11107
|
Spacer.Horizontal,
|
|
10863
11108
|
{
|
|
10864
11109
|
size: CHECKBOX_WIDTH - CHECKBOX_RIGHT_INSET + CHECKBOX_INDENT_WIDTH
|
|
@@ -10873,7 +11118,7 @@ var ComboboxMenu = memoGeneric(
|
|
|
10873
11118
|
// Only selectable items can have tooltips in this menu
|
|
10874
11119
|
isSelectableMenuItem(item) ? item.tooltip : void 0
|
|
10875
11120
|
);
|
|
10876
|
-
return /* @__PURE__ */
|
|
11121
|
+
return /* @__PURE__ */ React67.createElement(
|
|
10877
11122
|
ListView.Row,
|
|
10878
11123
|
{
|
|
10879
11124
|
key: item.value,
|
|
@@ -10886,12 +11131,12 @@ var ComboboxMenu = memoGeneric(
|
|
|
10886
11131
|
}
|
|
10887
11132
|
}
|
|
10888
11133
|
},
|
|
10889
|
-
/* @__PURE__ */
|
|
11134
|
+
/* @__PURE__ */ React67.createElement("div", { className: "n-flex n-flex-1 n-min-w-0 n-items-start" }, indented && /* @__PURE__ */ React67.createElement(Spacer.Horizontal, { size: CHECKBOX_INDENT_WIDTH }), item.checked ? /* @__PURE__ */ React67.createElement("div", { ...styles.itemIndicator }, /* @__PURE__ */ React67.createElement(CheckIcon2, null)) : indented ? /* @__PURE__ */ React67.createElement(
|
|
10890
11135
|
Spacer.Horizontal,
|
|
10891
11136
|
{
|
|
10892
11137
|
size: CHECKBOX_WIDTH - CHECKBOX_RIGHT_INSET
|
|
10893
11138
|
}
|
|
10894
|
-
) : null, iconPosition === "left" && item.icon && /* @__PURE__ */
|
|
11139
|
+
) : null, iconPosition === "left" && item.icon && /* @__PURE__ */ React67.createElement(React67.Fragment, null, /* @__PURE__ */ React67.createElement(MenuIcon, { icon: item.icon }), /* @__PURE__ */ React67.createElement(Spacer.Horizontal, { size: 8 })), /* @__PURE__ */ React67.createElement("div", { className: "n-flex n-flex-col n-min-w-0 n-flex-1" }, /* @__PURE__ */ React67.createElement("div", { className: "n-min-w-0 n-truncate" }, tokens.map((token, j) => /* @__PURE__ */ React67.createElement(
|
|
10895
11140
|
"span",
|
|
10896
11141
|
{
|
|
10897
11142
|
key: `${item.value}-token-${j}`,
|
|
@@ -10901,16 +11146,16 @@ var ComboboxMenu = memoGeneric(
|
|
|
10901
11146
|
)
|
|
10902
11147
|
},
|
|
10903
11148
|
token.text
|
|
10904
|
-
))), tooltip && /* @__PURE__ */
|
|
10905
|
-
(item.shortcut || item.icon && iconPosition === "right") && /* @__PURE__ */
|
|
11149
|
+
))), tooltip && /* @__PURE__ */ React67.createElement(Small, { color: "textSubtle", className: "n-truncate" }, tooltip))),
|
|
11150
|
+
(item.shortcut || item.icon && iconPosition === "right") && /* @__PURE__ */ React67.createElement("div", { className: "n-flex n-items-center n-min-w-0 n-ml-2" }, item.shortcut ? /* @__PURE__ */ React67.createElement(KeyboardShortcut, { shortcut: item.shortcut }) : item.icon && /* @__PURE__ */ React67.createElement(MenuIcon, { icon: item.icon }))
|
|
10906
11151
|
);
|
|
10907
11152
|
}
|
|
10908
11153
|
}
|
|
10909
11154
|
);
|
|
10910
11155
|
})
|
|
10911
11156
|
);
|
|
10912
|
-
var MenuIcon =
|
|
10913
|
-
return /* @__PURE__ */
|
|
11157
|
+
var MenuIcon = memo22(function MenuIcon2({ icon }) {
|
|
11158
|
+
return /* @__PURE__ */ React67.createElement("div", { className: "n-relative n-top-[2px]" }, renderIcon(icon));
|
|
10914
11159
|
});
|
|
10915
11160
|
|
|
10916
11161
|
// src/components/Combobox.tsx
|
|
@@ -10934,7 +11179,7 @@ var Combobox = memoGeneric(
|
|
|
10934
11179
|
iconPosition = "right",
|
|
10935
11180
|
...rest
|
|
10936
11181
|
}, forwardedRef) {
|
|
10937
|
-
const props =
|
|
11182
|
+
const props = useMemo28(() => {
|
|
10938
11183
|
if (rest.mode === "string") {
|
|
10939
11184
|
return {
|
|
10940
11185
|
mode: rest.mode,
|
|
@@ -10973,7 +11218,7 @@ var Combobox = memoGeneric(
|
|
|
10973
11218
|
}
|
|
10974
11219
|
}
|
|
10975
11220
|
const initialValueString = getInitialValueString();
|
|
10976
|
-
const [comboboxState] =
|
|
11221
|
+
const [comboboxState] = useState27(
|
|
10977
11222
|
() => new ComboboxState(
|
|
10978
11223
|
items,
|
|
10979
11224
|
initialValueString,
|
|
@@ -10981,9 +11226,9 @@ var Combobox = memoGeneric(
|
|
|
10981
11226
|
)
|
|
10982
11227
|
);
|
|
10983
11228
|
const state = useComboboxState(comboboxState);
|
|
10984
|
-
const [isFocused, setIsFocused] =
|
|
11229
|
+
const [isFocused, setIsFocused] = useState27(false);
|
|
10985
11230
|
const listRef = useRef21(null);
|
|
10986
|
-
const [shouldBlur, setShouldBlur] =
|
|
11231
|
+
const [shouldBlur, setShouldBlur] = useState27(false);
|
|
10987
11232
|
const { fieldId: id } = useLabel({
|
|
10988
11233
|
fieldId: rest.id
|
|
10989
11234
|
});
|
|
@@ -11000,7 +11245,7 @@ var Combobox = memoGeneric(
|
|
|
11000
11245
|
listRef.current.scrollToIndex(selectedIndex);
|
|
11001
11246
|
}
|
|
11002
11247
|
}, [selectedIndex]);
|
|
11003
|
-
const handleBlur =
|
|
11248
|
+
const handleBlur = useCallback28(() => {
|
|
11004
11249
|
ref.current?.blur();
|
|
11005
11250
|
comboboxState.reset(initialValueString);
|
|
11006
11251
|
if (props.mode === "string") {
|
|
@@ -11019,7 +11264,7 @@ var Combobox = memoGeneric(
|
|
|
11019
11264
|
}
|
|
11020
11265
|
setIsFocused(false);
|
|
11021
11266
|
}, [filter, initialValueString, props, state, comboboxState]);
|
|
11022
|
-
const handleFocus =
|
|
11267
|
+
const handleFocus = useCallback28(
|
|
11023
11268
|
(event) => {
|
|
11024
11269
|
setIsFocused(true);
|
|
11025
11270
|
comboboxState.reset(
|
|
@@ -11033,7 +11278,7 @@ var Combobox = memoGeneric(
|
|
|
11033
11278
|
},
|
|
11034
11279
|
[initialValueString, onFocus, openMenuBehavior, comboboxState]
|
|
11035
11280
|
);
|
|
11036
|
-
const handleUpdateSelection =
|
|
11281
|
+
const handleUpdateSelection = useCallback28(
|
|
11037
11282
|
(item) => {
|
|
11038
11283
|
if (item.type !== void 0) return;
|
|
11039
11284
|
const selectedItem = comboboxState.selectCurrentItem(item);
|
|
@@ -11049,7 +11294,7 @@ var Combobox = memoGeneric(
|
|
|
11049
11294
|
},
|
|
11050
11295
|
[props, comboboxState]
|
|
11051
11296
|
);
|
|
11052
|
-
const handleIndexChange =
|
|
11297
|
+
const handleIndexChange = useCallback28(
|
|
11053
11298
|
(index) => {
|
|
11054
11299
|
comboboxState.setSelectedIndex(index);
|
|
11055
11300
|
const item = comboboxState.getSelectedItem();
|
|
@@ -11065,7 +11310,7 @@ var Combobox = memoGeneric(
|
|
|
11065
11310
|
},
|
|
11066
11311
|
[props, comboboxState]
|
|
11067
11312
|
);
|
|
11068
|
-
const handleChange =
|
|
11313
|
+
const handleChange = useCallback28(
|
|
11069
11314
|
(value) => {
|
|
11070
11315
|
if (readOnly) return;
|
|
11071
11316
|
comboboxState.setFilter(value);
|
|
@@ -11080,7 +11325,7 @@ var Combobox = memoGeneric(
|
|
|
11080
11325
|
},
|
|
11081
11326
|
[readOnly, props, comboboxState]
|
|
11082
11327
|
);
|
|
11083
|
-
const handleKeyDown =
|
|
11328
|
+
const handleKeyDown = useCallback28(
|
|
11084
11329
|
(event) => {
|
|
11085
11330
|
let handled = false;
|
|
11086
11331
|
const item = comboboxState.getSelectedItem();
|
|
@@ -11188,7 +11433,7 @@ var Combobox = memoGeneric(
|
|
|
11188
11433
|
ref.current?.setSelectionRange(0, ref.current.value.length);
|
|
11189
11434
|
}
|
|
11190
11435
|
}));
|
|
11191
|
-
const handleChevronClick =
|
|
11436
|
+
const handleChevronClick = useCallback28(
|
|
11192
11437
|
(event) => {
|
|
11193
11438
|
event.stopPropagation();
|
|
11194
11439
|
if (shouldShowMenu) {
|
|
@@ -11215,27 +11460,27 @@ var Combobox = memoGeneric(
|
|
|
11215
11460
|
ref.current?.focus();
|
|
11216
11461
|
handleBlur();
|
|
11217
11462
|
}, [shouldBlur, handleBlur]);
|
|
11218
|
-
const { sectionHeaderCount, menuItemsCount, tallMenuItemsCount } =
|
|
11463
|
+
const { sectionHeaderCount, menuItemsCount, tallMenuItemsCount } = useMemo28(
|
|
11219
11464
|
() => ListView.getMenuMetrics(filteredItems),
|
|
11220
11465
|
[filteredItems]
|
|
11221
11466
|
);
|
|
11222
11467
|
const hasCheckedItems = items.some(
|
|
11223
11468
|
(item) => isSelectableMenuItem(item) && item.checked
|
|
11224
11469
|
);
|
|
11225
|
-
return /* @__PURE__ */
|
|
11470
|
+
return /* @__PURE__ */ React68.createElement(
|
|
11226
11471
|
InputField2.Root,
|
|
11227
11472
|
{
|
|
11228
11473
|
id,
|
|
11229
11474
|
size,
|
|
11230
11475
|
sideOffset: 6,
|
|
11231
11476
|
start: icon ? renderIcon(icon) : void 0,
|
|
11232
|
-
end: /* @__PURE__ */
|
|
11477
|
+
end: /* @__PURE__ */ React68.createElement(React68.Fragment, null, loading && /* @__PURE__ */ React68.createElement("div", { className: "pr-1.5" }, /* @__PURE__ */ React68.createElement(ActivityIndicator, null)), !readOnly && /* @__PURE__ */ React68.createElement(
|
|
11233
11478
|
InputField2.Button,
|
|
11234
11479
|
{
|
|
11235
11480
|
variant: "floating",
|
|
11236
11481
|
onClick: handleChevronClick
|
|
11237
11482
|
},
|
|
11238
|
-
/* @__PURE__ */
|
|
11483
|
+
/* @__PURE__ */ React68.createElement(
|
|
11239
11484
|
DropdownChevronIcon2,
|
|
11240
11485
|
{
|
|
11241
11486
|
className: cx(
|
|
@@ -11255,7 +11500,7 @@ var Combobox = memoGeneric(
|
|
|
11255
11500
|
maxBaseRows: 10.5
|
|
11256
11501
|
});
|
|
11257
11502
|
const adjustedListSize = { width, height: computedHeight };
|
|
11258
|
-
return /* @__PURE__ */
|
|
11503
|
+
return /* @__PURE__ */ React68.createElement(
|
|
11259
11504
|
"div",
|
|
11260
11505
|
{
|
|
11261
11506
|
className: cx(
|
|
@@ -11263,7 +11508,7 @@ var Combobox = memoGeneric(
|
|
|
11263
11508
|
shouldShowMenu && !readOnly ? "n-flex" : "n-hidden"
|
|
11264
11509
|
)
|
|
11265
11510
|
},
|
|
11266
|
-
filteredItems.length > 0 && !loading ? /* @__PURE__ */
|
|
11511
|
+
filteredItems.length > 0 && !loading ? /* @__PURE__ */ React68.createElement(
|
|
11267
11512
|
ComboboxMenu,
|
|
11268
11513
|
{
|
|
11269
11514
|
ref: listRef,
|
|
@@ -11281,11 +11526,11 @@ var Combobox = memoGeneric(
|
|
|
11281
11526
|
getRowHeightForItem: (item) => isSelectableMenuItem(item) && item.tooltip ? ListView.tallRowHeight : baseRowHeight
|
|
11282
11527
|
} : { itemHeight: baseRowHeight }
|
|
11283
11528
|
}
|
|
11284
|
-
) : /* @__PURE__ */
|
|
11529
|
+
) : /* @__PURE__ */ React68.createElement("div", { className: "n-flex n-flex-col n-h-[50px] n-p-5 n-items-center n-justify-center" }, /* @__PURE__ */ React68.createElement(Small, { className: "n-text-text-disabled" }, loading ? "Loading..." : "No results"))
|
|
11285
11530
|
);
|
|
11286
11531
|
}
|
|
11287
11532
|
},
|
|
11288
|
-
/* @__PURE__ */
|
|
11533
|
+
/* @__PURE__ */ React68.createElement(
|
|
11289
11534
|
InputField2.Input,
|
|
11290
11535
|
{
|
|
11291
11536
|
ref,
|
|
@@ -11310,7 +11555,7 @@ var Combobox = memoGeneric(
|
|
|
11310
11555
|
...readOnly ? { readOnly: true } : {}
|
|
11311
11556
|
}
|
|
11312
11557
|
),
|
|
11313
|
-
filter && typeaheadValue && typeaheadValue.toLowerCase().startsWith(filter.toLowerCase()) && /* @__PURE__ */
|
|
11558
|
+
filter && typeaheadValue && typeaheadValue.toLowerCase().startsWith(filter.toLowerCase()) && /* @__PURE__ */ React68.createElement(
|
|
11314
11559
|
InputField2.Typeahead,
|
|
11315
11560
|
{
|
|
11316
11561
|
value: typeaheadValue,
|
|
@@ -11324,18 +11569,18 @@ var Combobox = memoGeneric(
|
|
|
11324
11569
|
);
|
|
11325
11570
|
|
|
11326
11571
|
// src/components/CommandPalette.tsx
|
|
11327
|
-
import
|
|
11572
|
+
import React70, { memo as memo23 } from "react";
|
|
11328
11573
|
|
|
11329
11574
|
// src/components/SearchCompletionMenu.tsx
|
|
11330
11575
|
import { getCurrentPlatform as getCurrentPlatform2, handleKeyboardEvent } from "@noya-app/noya-keymap";
|
|
11331
|
-
import
|
|
11576
|
+
import React69, {
|
|
11332
11577
|
forwardRef as forwardRef23,
|
|
11333
|
-
useCallback as
|
|
11578
|
+
useCallback as useCallback29,
|
|
11334
11579
|
useEffect as useEffect21,
|
|
11335
11580
|
useImperativeHandle as useImperativeHandle7,
|
|
11336
|
-
useMemo as
|
|
11581
|
+
useMemo as useMemo29,
|
|
11337
11582
|
useRef as useRef22,
|
|
11338
|
-
useState as
|
|
11583
|
+
useState as useState28
|
|
11339
11584
|
} from "react";
|
|
11340
11585
|
var SearchCompletionMenu = forwardRef23(function SearchCompletionMenu2({
|
|
11341
11586
|
onSelect,
|
|
@@ -11346,17 +11591,17 @@ var SearchCompletionMenu = forwardRef23(function SearchCompletionMenu2({
|
|
|
11346
11591
|
testSelectedIndex,
|
|
11347
11592
|
testSearch
|
|
11348
11593
|
}, forwardedRef) {
|
|
11349
|
-
const [state, setState] =
|
|
11594
|
+
const [state, setState] = useState28({
|
|
11350
11595
|
search: testSearch ?? "",
|
|
11351
11596
|
index: 0
|
|
11352
11597
|
});
|
|
11353
11598
|
const { index, search } = state;
|
|
11354
|
-
const listRef =
|
|
11599
|
+
const listRef = React69.useRef(null);
|
|
11355
11600
|
const hasCheckedItems = items.some((item) => item.checked);
|
|
11356
11601
|
useEffect21(() => {
|
|
11357
11602
|
listRef.current?.scrollToIndex(index);
|
|
11358
11603
|
}, [index]);
|
|
11359
|
-
const results =
|
|
11604
|
+
const results = useMemo29(
|
|
11360
11605
|
() => fuzzyFilter({
|
|
11361
11606
|
items: items.map(
|
|
11362
11607
|
(item) => typeof item.title === "string" ? item.title : item.value
|
|
@@ -11368,10 +11613,10 @@ var SearchCompletionMenu = forwardRef23(function SearchCompletionMenu2({
|
|
|
11368
11613
|
})),
|
|
11369
11614
|
[items, search]
|
|
11370
11615
|
);
|
|
11371
|
-
const setSearch =
|
|
11616
|
+
const setSearch = useCallback29((search2) => {
|
|
11372
11617
|
setState((state2) => ({ ...state2, search: search2, index: 0 }));
|
|
11373
11618
|
}, []);
|
|
11374
|
-
const setIndex =
|
|
11619
|
+
const setIndex = useCallback29((index2) => {
|
|
11375
11620
|
setState((state2) => ({ ...state2, index: index2 }));
|
|
11376
11621
|
}, []);
|
|
11377
11622
|
useEffect21(() => {
|
|
@@ -11393,14 +11638,14 @@ var SearchCompletionMenu = forwardRef23(function SearchCompletionMenu2({
|
|
|
11393
11638
|
width: listSize.width,
|
|
11394
11639
|
height: searchHeight + listSize.height
|
|
11395
11640
|
};
|
|
11396
|
-
const selectAndClose =
|
|
11641
|
+
const selectAndClose = useCallback29(
|
|
11397
11642
|
(item) => {
|
|
11398
11643
|
onSelect(item);
|
|
11399
11644
|
onClose();
|
|
11400
11645
|
},
|
|
11401
11646
|
[onSelect, onClose]
|
|
11402
11647
|
);
|
|
11403
|
-
const handleKeyDown =
|
|
11648
|
+
const handleKeyDown = useCallback29(
|
|
11404
11649
|
(event) => {
|
|
11405
11650
|
handleKeyboardEvent(event.nativeEvent, getCurrentPlatform2(navigator), {
|
|
11406
11651
|
ArrowUp: () => {
|
|
@@ -11434,7 +11679,7 @@ var SearchCompletionMenu = forwardRef23(function SearchCompletionMenu2({
|
|
|
11434
11679
|
inputRef.current?.focus();
|
|
11435
11680
|
}
|
|
11436
11681
|
}));
|
|
11437
|
-
return /* @__PURE__ */
|
|
11682
|
+
return /* @__PURE__ */ React69.createElement("div", { ...elementSize, className: "n-flex n-flex-col n-overflow-hidden" }, /* @__PURE__ */ React69.createElement(InputField2.Root, { className: "n-flex n-flex-0" }, /* @__PURE__ */ React69.createElement(
|
|
11438
11683
|
InputField2.Input,
|
|
11439
11684
|
{
|
|
11440
11685
|
ref: inputRef,
|
|
@@ -11454,7 +11699,7 @@ var SearchCompletionMenu = forwardRef23(function SearchCompletionMenu2({
|
|
|
11454
11699
|
onChange: setSearch,
|
|
11455
11700
|
onKeyDown: handleKeyDown
|
|
11456
11701
|
}
|
|
11457
|
-
)), /* @__PURE__ */
|
|
11702
|
+
)), /* @__PURE__ */ React69.createElement(Divider, null), results.length > 0 ? /* @__PURE__ */ React69.createElement(
|
|
11458
11703
|
ComboboxMenu,
|
|
11459
11704
|
{
|
|
11460
11705
|
ref: listRef,
|
|
@@ -11469,29 +11714,29 @@ var SearchCompletionMenu = forwardRef23(function SearchCompletionMenu2({
|
|
|
11469
11714
|
onHoverIndex: setIndex,
|
|
11470
11715
|
indented: hasCheckedItems
|
|
11471
11716
|
}
|
|
11472
|
-
) : /* @__PURE__ */
|
|
11717
|
+
) : /* @__PURE__ */ React69.createElement(
|
|
11473
11718
|
"div",
|
|
11474
11719
|
{
|
|
11475
11720
|
...listSize,
|
|
11476
11721
|
className: "n-flex n-flex-col n-p-20 n-items-center n-justify-center"
|
|
11477
11722
|
},
|
|
11478
|
-
/* @__PURE__ */
|
|
11723
|
+
/* @__PURE__ */ React69.createElement(Small, { color: "textDisabled" }, "No results")
|
|
11479
11724
|
));
|
|
11480
11725
|
});
|
|
11481
11726
|
|
|
11482
11727
|
// src/components/CommandPalette.tsx
|
|
11483
|
-
var CommandPalette =
|
|
11728
|
+
var CommandPalette = memo23(function CommandPalette2({
|
|
11484
11729
|
showCommandPalette,
|
|
11485
11730
|
setShowCommandPalette,
|
|
11486
11731
|
items,
|
|
11487
11732
|
onSelect,
|
|
11488
11733
|
onHover
|
|
11489
11734
|
}) {
|
|
11490
|
-
const menuRef =
|
|
11491
|
-
const handleClose =
|
|
11735
|
+
const menuRef = React70.useRef(null);
|
|
11736
|
+
const handleClose = React70.useCallback(() => {
|
|
11492
11737
|
setShowCommandPalette(false);
|
|
11493
11738
|
}, [setShowCommandPalette]);
|
|
11494
|
-
return /* @__PURE__ */
|
|
11739
|
+
return /* @__PURE__ */ React70.createElement(
|
|
11495
11740
|
Dialog,
|
|
11496
11741
|
{
|
|
11497
11742
|
style: {
|
|
@@ -11517,7 +11762,7 @@ var CommandPalette = memo24(function CommandPalette2({
|
|
|
11517
11762
|
}, 0);
|
|
11518
11763
|
}
|
|
11519
11764
|
},
|
|
11520
|
-
/* @__PURE__ */
|
|
11765
|
+
/* @__PURE__ */ React70.createElement("div", { className: "n-flex n-flex-col n-flex-1" }, /* @__PURE__ */ React70.createElement(AutoSizer, null, (size) => /* @__PURE__ */ React70.createElement(
|
|
11521
11766
|
SearchCompletionMenu,
|
|
11522
11767
|
{
|
|
11523
11768
|
ref: menuRef,
|
|
@@ -11532,21 +11777,21 @@ var CommandPalette = memo24(function CommandPalette2({
|
|
|
11532
11777
|
});
|
|
11533
11778
|
|
|
11534
11779
|
// src/components/connected-users-menu/ConnectedUsersMenuLayout.tsx
|
|
11535
|
-
import
|
|
11536
|
-
var UserAvatar = ({ userId, name, image }) => /* @__PURE__ */
|
|
11780
|
+
import React71 from "react";
|
|
11781
|
+
var UserAvatar = ({ userId, name, image }) => /* @__PURE__ */ React71.createElement(
|
|
11537
11782
|
Tooltip,
|
|
11538
11783
|
{
|
|
11539
11784
|
key: userId,
|
|
11540
|
-
content: /* @__PURE__ */
|
|
11785
|
+
content: /* @__PURE__ */ React71.createElement("div", { className: "n-flex n-flex-col" }, /* @__PURE__ */ React71.createElement(Small, null, name))
|
|
11541
11786
|
},
|
|
11542
|
-
/* @__PURE__ */
|
|
11787
|
+
/* @__PURE__ */ React71.createElement(Avatar, { size: INPUT_HEIGHT, userId, name, image })
|
|
11543
11788
|
);
|
|
11544
11789
|
var ConnectedUsersMenuLayout = ({
|
|
11545
11790
|
renderUsers,
|
|
11546
11791
|
launchAIAssistant,
|
|
11547
11792
|
isAssistantOpen
|
|
11548
11793
|
}) => {
|
|
11549
|
-
return /* @__PURE__ */
|
|
11794
|
+
return /* @__PURE__ */ React71.createElement("div", { className: "n-flex n-gap-1.5" }, /* @__PURE__ */ React71.createElement(AvatarStack, { size: INPUT_HEIGHT }, renderUsers()), launchAIAssistant && /* @__PURE__ */ React71.createElement(Tooltip, { content: "AI Assistant" }, /* @__PURE__ */ React71.createElement(
|
|
11550
11795
|
Button,
|
|
11551
11796
|
{
|
|
11552
11797
|
active: isAssistantOpen,
|
|
@@ -11558,7 +11803,7 @@ var ConnectedUsersMenuLayout = ({
|
|
|
11558
11803
|
};
|
|
11559
11804
|
|
|
11560
11805
|
// src/components/DraggableMenuButton.tsx
|
|
11561
|
-
import
|
|
11806
|
+
import React72, { useCallback as useCallback30, useState as useState29 } from "react";
|
|
11562
11807
|
var DraggableMenuButton = memoGeneric(function DraggableMenuButton2({
|
|
11563
11808
|
open: openProp,
|
|
11564
11809
|
onOpenChange: onOpenChangeProp,
|
|
@@ -11576,8 +11821,8 @@ var DraggableMenuButton = memoGeneric(function DraggableMenuButton2({
|
|
|
11576
11821
|
onChange: onOpenChangeProp,
|
|
11577
11822
|
defaultValue: false
|
|
11578
11823
|
});
|
|
11579
|
-
const [downPosition, setDownPosition] =
|
|
11580
|
-
const handlePointerDownCapture =
|
|
11824
|
+
const [downPosition, setDownPosition] = useState29(null);
|
|
11825
|
+
const handlePointerDownCapture = useCallback30(
|
|
11581
11826
|
(event) => {
|
|
11582
11827
|
if (open) {
|
|
11583
11828
|
setDownPosition(null);
|
|
@@ -11590,7 +11835,7 @@ var DraggableMenuButton = memoGeneric(function DraggableMenuButton2({
|
|
|
11590
11835
|
},
|
|
11591
11836
|
[open]
|
|
11592
11837
|
);
|
|
11593
|
-
const handlePointerUp =
|
|
11838
|
+
const handlePointerUp = useCallback30(
|
|
11594
11839
|
(event) => {
|
|
11595
11840
|
if (open || !downPosition) {
|
|
11596
11841
|
setDownPosition(null);
|
|
@@ -11609,13 +11854,13 @@ var DraggableMenuButton = memoGeneric(function DraggableMenuButton2({
|
|
|
11609
11854
|
},
|
|
11610
11855
|
[downPosition, open, setOpen]
|
|
11611
11856
|
);
|
|
11612
|
-
const handleOpenChange =
|
|
11857
|
+
const handleOpenChange = useCallback30(
|
|
11613
11858
|
(isOpen) => {
|
|
11614
11859
|
if (!isOpen) setOpen(false);
|
|
11615
11860
|
},
|
|
11616
11861
|
[setOpen]
|
|
11617
11862
|
);
|
|
11618
|
-
return /* @__PURE__ */
|
|
11863
|
+
return /* @__PURE__ */ React72.createElement(
|
|
11619
11864
|
"div",
|
|
11620
11865
|
{
|
|
11621
11866
|
...rest,
|
|
@@ -11632,7 +11877,7 @@ var DraggableMenuButton = memoGeneric(function DraggableMenuButton2({
|
|
|
11632
11877
|
onClick?.();
|
|
11633
11878
|
}
|
|
11634
11879
|
},
|
|
11635
|
-
items && onSelect ? /* @__PURE__ */
|
|
11880
|
+
items && onSelect ? /* @__PURE__ */ React72.createElement(
|
|
11636
11881
|
DropdownMenu,
|
|
11637
11882
|
{
|
|
11638
11883
|
open,
|
|
@@ -11641,14 +11886,14 @@ var DraggableMenuButton = memoGeneric(function DraggableMenuButton2({
|
|
|
11641
11886
|
onSelect,
|
|
11642
11887
|
shouldBindKeyboardShortcuts: false
|
|
11643
11888
|
},
|
|
11644
|
-
/* @__PURE__ */
|
|
11889
|
+
/* @__PURE__ */ React72.createElement("div", { className: "n-pointer-events-none n-h-[15px]" }, /* @__PURE__ */ React72.createElement(
|
|
11645
11890
|
Icon,
|
|
11646
11891
|
{
|
|
11647
11892
|
name: iconName,
|
|
11648
11893
|
color: isVisible || open ? cssVars.colors.icon : "transparent"
|
|
11649
11894
|
}
|
|
11650
11895
|
))
|
|
11651
|
-
) : /* @__PURE__ */
|
|
11896
|
+
) : /* @__PURE__ */ React72.createElement(
|
|
11652
11897
|
Icon,
|
|
11653
11898
|
{
|
|
11654
11899
|
name: iconName,
|
|
@@ -11660,10 +11905,10 @@ var DraggableMenuButton = memoGeneric(function DraggableMenuButton2({
|
|
|
11660
11905
|
|
|
11661
11906
|
// src/components/Drawer.tsx
|
|
11662
11907
|
import { Dialog as Dialog3 } from "radix-ui";
|
|
11663
|
-
import * as
|
|
11908
|
+
import * as React73 from "react";
|
|
11664
11909
|
import { useImperativeHandle as useImperativeHandle8 } from "react";
|
|
11665
|
-
var Drawer =
|
|
11666
|
-
|
|
11910
|
+
var Drawer = React73.memo(
|
|
11911
|
+
React73.forwardRef(function Drawer2({
|
|
11667
11912
|
open,
|
|
11668
11913
|
onOpenChange,
|
|
11669
11914
|
trigger,
|
|
@@ -11695,7 +11940,7 @@ var Drawer = React71.memo(
|
|
|
11695
11940
|
return internalOpen;
|
|
11696
11941
|
}
|
|
11697
11942
|
}));
|
|
11698
|
-
const inner = /* @__PURE__ */
|
|
11943
|
+
const inner = /* @__PURE__ */ React73.createElement(React73.Fragment, null, /* @__PURE__ */ React73.createElement(
|
|
11699
11944
|
Dialog3.Overlay,
|
|
11700
11945
|
{
|
|
11701
11946
|
className: cx(
|
|
@@ -11705,7 +11950,7 @@ var Drawer = React71.memo(
|
|
|
11705
11950
|
),
|
|
11706
11951
|
style: overlayStyle
|
|
11707
11952
|
}
|
|
11708
|
-
), /* @__PURE__ */
|
|
11953
|
+
), /* @__PURE__ */ React73.createElement(
|
|
11709
11954
|
Dialog3.Content,
|
|
11710
11955
|
{
|
|
11711
11956
|
id,
|
|
@@ -11717,24 +11962,24 @@ var Drawer = React71.memo(
|
|
|
11717
11962
|
className
|
|
11718
11963
|
)
|
|
11719
11964
|
},
|
|
11720
|
-
title && /* @__PURE__ */
|
|
11965
|
+
title && /* @__PURE__ */ React73.createElement(Dialog3.Title, null, title),
|
|
11721
11966
|
children
|
|
11722
11967
|
));
|
|
11723
|
-
return /* @__PURE__ */
|
|
11968
|
+
return /* @__PURE__ */ React73.createElement(
|
|
11724
11969
|
Dialog3.Root,
|
|
11725
11970
|
{
|
|
11726
11971
|
key: "dialog",
|
|
11727
11972
|
open: internalOpen,
|
|
11728
11973
|
onOpenChange: setInternalOpen
|
|
11729
11974
|
},
|
|
11730
|
-
/* @__PURE__ */
|
|
11731
|
-
portalled ? /* @__PURE__ */
|
|
11975
|
+
/* @__PURE__ */ React73.createElement(Dialog3.Trigger, { key: "trigger" }, trigger),
|
|
11976
|
+
portalled ? /* @__PURE__ */ React73.createElement(Dialog3.Portal, { container: portalContainer }, inner) : inner
|
|
11732
11977
|
);
|
|
11733
11978
|
})
|
|
11734
11979
|
);
|
|
11735
11980
|
|
|
11736
11981
|
// src/components/Fade.tsx
|
|
11737
|
-
import
|
|
11982
|
+
import React74 from "react";
|
|
11738
11983
|
var Fade = ({
|
|
11739
11984
|
children,
|
|
11740
11985
|
direction = "right",
|
|
@@ -11756,7 +12001,7 @@ var Fade = ({
|
|
|
11756
12001
|
top: "n-left-0 n-right-0 n-top-0",
|
|
11757
12002
|
bottom: "n-left-0 n-right-0 n-bottom-0"
|
|
11758
12003
|
}[direction];
|
|
11759
|
-
return /* @__PURE__ */
|
|
12004
|
+
return /* @__PURE__ */ React74.createElement("div", { className: cx("n-relative", className), style: { height } }, position === "front" ? children : null, /* @__PURE__ */ React74.createElement(
|
|
11760
12005
|
"div",
|
|
11761
12006
|
{
|
|
11762
12007
|
className: cx(
|
|
@@ -11775,21 +12020,21 @@ var Fade = ({
|
|
|
11775
12020
|
};
|
|
11776
12021
|
|
|
11777
12022
|
// src/components/file-explorer/FileExplorerLayout.tsx
|
|
11778
|
-
import
|
|
12023
|
+
import React75 from "react";
|
|
11779
12024
|
var FileExplorerLayout = ({
|
|
11780
12025
|
children,
|
|
11781
12026
|
className,
|
|
11782
12027
|
...props
|
|
11783
|
-
}) => /* @__PURE__ */
|
|
12028
|
+
}) => /* @__PURE__ */ React75.createElement(Section, { className: cx(className, "n-px-3 n-flex-1"), ...props }, children);
|
|
11784
12029
|
var FileExplorerUploadButton = ({
|
|
11785
12030
|
showUploadButton,
|
|
11786
12031
|
onUpload,
|
|
11787
12032
|
isUploading,
|
|
11788
12033
|
children
|
|
11789
|
-
}) => /* @__PURE__ */
|
|
12034
|
+
}) => /* @__PURE__ */ React75.createElement("div", { className: "n-flex n-items-center n-gap-2" }, showUploadButton && /* @__PURE__ */ React75.createElement(
|
|
11790
12035
|
Button,
|
|
11791
12036
|
{
|
|
11792
|
-
icon: isUploading ? /* @__PURE__ */
|
|
12037
|
+
icon: isUploading ? /* @__PURE__ */ React75.createElement(ActivityIndicator, { size: 15 }) : "UploadIcon",
|
|
11793
12038
|
onClick: onUpload,
|
|
11794
12039
|
"aria-label": "Upload file",
|
|
11795
12040
|
tooltip: "Upload file",
|
|
@@ -11799,7 +12044,7 @@ var FileExplorerUploadButton = ({
|
|
|
11799
12044
|
), children);
|
|
11800
12045
|
var FileExplorerCollection = forwardRefGeneric(
|
|
11801
12046
|
function FileExplorerCollection2({ ...props }, ref) {
|
|
11802
|
-
return /* @__PURE__ */
|
|
12047
|
+
return /* @__PURE__ */ React75.createElement(Collection, { ref, className: "-n-mx-3 n-flex-1", ...props });
|
|
11803
12048
|
}
|
|
11804
12049
|
);
|
|
11805
12050
|
var FileExplorerDetail = ({
|
|
@@ -11808,7 +12053,7 @@ var FileExplorerDetail = ({
|
|
|
11808
12053
|
children,
|
|
11809
12054
|
className,
|
|
11810
12055
|
style: style2
|
|
11811
|
-
}) => /* @__PURE__ */
|
|
12056
|
+
}) => /* @__PURE__ */ React75.createElement(
|
|
11812
12057
|
"span",
|
|
11813
12058
|
{
|
|
11814
12059
|
className: cx(
|
|
@@ -11823,10 +12068,10 @@ var FileExplorerDetail = ({
|
|
|
11823
12068
|
var FileExplorerEmptyState = ({
|
|
11824
12069
|
children: label = "No files",
|
|
11825
12070
|
...props
|
|
11826
|
-
}) => /* @__PURE__ */
|
|
12071
|
+
}) => /* @__PURE__ */ React75.createElement(Banner, { className: "n-mx-3", ...props }, label);
|
|
11827
12072
|
|
|
11828
12073
|
// src/components/FileUploadIndicator.tsx
|
|
11829
|
-
import
|
|
12074
|
+
import React78 from "react";
|
|
11830
12075
|
|
|
11831
12076
|
// src/utils/formatByteSize.ts
|
|
11832
12077
|
var byteSizeUnits = ["B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"];
|
|
@@ -11846,7 +12091,7 @@ import {
|
|
|
11846
12091
|
SpeakerLoudIcon,
|
|
11847
12092
|
VideoIcon
|
|
11848
12093
|
} from "@noya-app/noya-icons";
|
|
11849
|
-
import
|
|
12094
|
+
import React76, { memo as memo25, useMemo as useMemo30 } from "react";
|
|
11850
12095
|
|
|
11851
12096
|
// src/components/catppuccin/fileIcons.ts
|
|
11852
12097
|
var fileIcons = {
|
|
@@ -14286,7 +14531,7 @@ var getThumbnailColors = (colorScheme, selected) => {
|
|
|
14286
14531
|
};
|
|
14287
14532
|
}
|
|
14288
14533
|
};
|
|
14289
|
-
var MediaThumbnail =
|
|
14534
|
+
var MediaThumbnail = memo25(function MediaThumbnail2({
|
|
14290
14535
|
contentType: contentTypeProp,
|
|
14291
14536
|
selected = false,
|
|
14292
14537
|
className,
|
|
@@ -14304,14 +14549,14 @@ var MediaThumbnail = memo26(function MediaThumbnail2({
|
|
|
14304
14549
|
selected
|
|
14305
14550
|
);
|
|
14306
14551
|
const contentType = getAssetType(contentTypeProp);
|
|
14307
|
-
const iconStyles =
|
|
14552
|
+
const iconStyles = useMemo30(
|
|
14308
14553
|
() => ({
|
|
14309
14554
|
width: iconSizeMap[size],
|
|
14310
14555
|
height: iconSizeMap[size]
|
|
14311
14556
|
}),
|
|
14312
14557
|
[size]
|
|
14313
14558
|
);
|
|
14314
|
-
const content =
|
|
14559
|
+
const content = useMemo30(() => {
|
|
14315
14560
|
if (renderThumbnailIcon) {
|
|
14316
14561
|
const rendered = renderThumbnailIcon({ fileName, contentType });
|
|
14317
14562
|
if (rendered) return rendered;
|
|
@@ -14331,7 +14576,7 @@ var MediaThumbnail = memo26(function MediaThumbnail2({
|
|
|
14331
14576
|
renderUrl.searchParams.set("url", url);
|
|
14332
14577
|
renderUrl.searchParams.set("fit", aspect);
|
|
14333
14578
|
renderUrl.searchParams.set("theme", "light");
|
|
14334
|
-
return /* @__PURE__ */
|
|
14579
|
+
return /* @__PURE__ */ React76.createElement(
|
|
14335
14580
|
"img",
|
|
14336
14581
|
{
|
|
14337
14582
|
src: renderUrl.toString(),
|
|
@@ -14345,23 +14590,23 @@ var MediaThumbnail = memo26(function MediaThumbnail2({
|
|
|
14345
14590
|
}
|
|
14346
14591
|
switch (contentType) {
|
|
14347
14592
|
case "image":
|
|
14348
|
-
return /* @__PURE__ */
|
|
14593
|
+
return /* @__PURE__ */ React76.createElement(ImageIcon2, { color: iconColor, style: iconStyles });
|
|
14349
14594
|
case "video":
|
|
14350
|
-
return /* @__PURE__ */
|
|
14595
|
+
return /* @__PURE__ */ React76.createElement(VideoIcon, { color: iconColor, style: iconStyles });
|
|
14351
14596
|
case "audio":
|
|
14352
|
-
return /* @__PURE__ */
|
|
14597
|
+
return /* @__PURE__ */ React76.createElement(SpeakerLoudIcon, { color: iconColor, style: iconStyles });
|
|
14353
14598
|
default:
|
|
14354
14599
|
if (iconName) {
|
|
14355
14600
|
const Icon2 = Icons[iconName];
|
|
14356
|
-
return /* @__PURE__ */
|
|
14601
|
+
return /* @__PURE__ */ React76.createElement(Icon2, { color: iconColor, style: iconStyles });
|
|
14357
14602
|
}
|
|
14358
14603
|
if (fileName) {
|
|
14359
14604
|
if (fileName.endsWith(".noya")) {
|
|
14360
|
-
return /* @__PURE__ */
|
|
14605
|
+
return /* @__PURE__ */ React76.createElement(NoyaIcon, { color: iconColor, style: iconStyles });
|
|
14361
14606
|
}
|
|
14362
14607
|
const fileIcon = findFileIcon(fileName);
|
|
14363
14608
|
if (fileIcon) {
|
|
14364
|
-
return /* @__PURE__ */
|
|
14609
|
+
return /* @__PURE__ */ React76.createElement(
|
|
14365
14610
|
"img",
|
|
14366
14611
|
{
|
|
14367
14612
|
src: `https://api.iconify.design/catppuccin/${fileIcon}.svg?height=none&box=1`,
|
|
@@ -14371,7 +14616,7 @@ var MediaThumbnail = memo26(function MediaThumbnail2({
|
|
|
14371
14616
|
);
|
|
14372
14617
|
}
|
|
14373
14618
|
}
|
|
14374
|
-
return /* @__PURE__ */
|
|
14619
|
+
return /* @__PURE__ */ React76.createElement(FileIcon, { color: iconColor, style: iconStyles });
|
|
14375
14620
|
}
|
|
14376
14621
|
}, [
|
|
14377
14622
|
renderThumbnailIcon,
|
|
@@ -14385,7 +14630,7 @@ var MediaThumbnail = memo26(function MediaThumbnail2({
|
|
|
14385
14630
|
iconStyles,
|
|
14386
14631
|
iconName
|
|
14387
14632
|
]);
|
|
14388
|
-
return /* @__PURE__ */
|
|
14633
|
+
return /* @__PURE__ */ React76.createElement(
|
|
14389
14634
|
"div",
|
|
14390
14635
|
{
|
|
14391
14636
|
className: cx(
|
|
@@ -14428,7 +14673,7 @@ function findFileIcon(fileName) {
|
|
|
14428
14673
|
// src/components/Progress.tsx
|
|
14429
14674
|
import { clamp as clamp4 } from "@noya-app/noya-utils";
|
|
14430
14675
|
import { Progress as ProgressPrimitive } from "radix-ui";
|
|
14431
|
-
import * as
|
|
14676
|
+
import * as React77 from "react";
|
|
14432
14677
|
function Progress({
|
|
14433
14678
|
value,
|
|
14434
14679
|
colorScheme = "normal",
|
|
@@ -14437,18 +14682,18 @@ function Progress({
|
|
|
14437
14682
|
style: styleProp
|
|
14438
14683
|
}) {
|
|
14439
14684
|
const clampedValue = clamp4(value, 0, 100);
|
|
14440
|
-
const transformStyles =
|
|
14685
|
+
const transformStyles = React77.useMemo(
|
|
14441
14686
|
() => ({
|
|
14442
14687
|
transform: `translateX(-${100 - clampedValue}%)`,
|
|
14443
14688
|
backgroundColor: color
|
|
14444
14689
|
}),
|
|
14445
14690
|
[color, clampedValue]
|
|
14446
14691
|
);
|
|
14447
|
-
const style2 =
|
|
14692
|
+
const style2 = React77.useMemo(
|
|
14448
14693
|
() => ({ transform: "translateZ(0)", ...styleProp }),
|
|
14449
14694
|
[styleProp]
|
|
14450
14695
|
);
|
|
14451
|
-
return /* @__PURE__ */
|
|
14696
|
+
return /* @__PURE__ */ React77.createElement(
|
|
14452
14697
|
ProgressPrimitive.Root,
|
|
14453
14698
|
{
|
|
14454
14699
|
className: cx(
|
|
@@ -14458,7 +14703,7 @@ function Progress({
|
|
|
14458
14703
|
style: style2,
|
|
14459
14704
|
value: clampedValue
|
|
14460
14705
|
},
|
|
14461
|
-
/* @__PURE__ */
|
|
14706
|
+
/* @__PURE__ */ React77.createElement(
|
|
14462
14707
|
ProgressPrimitive.Indicator,
|
|
14463
14708
|
{
|
|
14464
14709
|
className: cx(
|
|
@@ -14483,14 +14728,14 @@ function FileUploadIndicator({
|
|
|
14483
14728
|
}) {
|
|
14484
14729
|
const done = percent === 1;
|
|
14485
14730
|
const value = typeof percent === "number" ? Math.round(percent) : 0;
|
|
14486
|
-
return /* @__PURE__ */
|
|
14731
|
+
return /* @__PURE__ */ React78.createElement("div", { className: "n-flex n-items-center n-gap-2" }, /* @__PURE__ */ React78.createElement("div", { className: "n-w-12 n-h-12 n-bg-background n-rounded-md n-overflow-hidden" }, /* @__PURE__ */ React78.createElement(
|
|
14487
14732
|
MediaThumbnail,
|
|
14488
14733
|
{
|
|
14489
14734
|
size: "medium",
|
|
14490
14735
|
fileName: name,
|
|
14491
14736
|
contentType
|
|
14492
14737
|
}
|
|
14493
|
-
)), /* @__PURE__ */
|
|
14738
|
+
)), /* @__PURE__ */ React78.createElement("div", { className: "n-flex n-flex-col n-flex-1 n-justify-center n-gap-1 n-min-w-0" }, name && /* @__PURE__ */ React78.createElement(Small, { color: "text", className: "n-truncate n-leading-none" }, name), typeof total === "number" && typeof percent === "number" && /* @__PURE__ */ React78.createElement(
|
|
14494
14739
|
Small,
|
|
14495
14740
|
{
|
|
14496
14741
|
color: "textSubtle",
|
|
@@ -14501,7 +14746,7 @@ function FileUploadIndicator({
|
|
|
14501
14746
|
" /",
|
|
14502
14747
|
" ",
|
|
14503
14748
|
formatByteSize(total)
|
|
14504
|
-
), typeof value === "number" && /* @__PURE__ */
|
|
14749
|
+
), typeof value === "number" && /* @__PURE__ */ React78.createElement(
|
|
14505
14750
|
Progress,
|
|
14506
14751
|
{
|
|
14507
14752
|
value,
|
|
@@ -14509,7 +14754,7 @@ function FileUploadIndicator({
|
|
|
14509
14754
|
className: "n-rounded-sm",
|
|
14510
14755
|
colorScheme: "secondary"
|
|
14511
14756
|
}
|
|
14512
|
-
)), /* @__PURE__ */
|
|
14757
|
+
)), /* @__PURE__ */ React78.createElement("div", { className: "n-flex n-items-center n-justify-center n-gap-2" }, typeof value === "number" && /* @__PURE__ */ React78.createElement(
|
|
14513
14758
|
Small,
|
|
14514
14759
|
{
|
|
14515
14760
|
color: "textSubtle",
|
|
@@ -14518,12 +14763,12 @@ function FileUploadIndicator({
|
|
|
14518
14763
|
},
|
|
14519
14764
|
value,
|
|
14520
14765
|
"%"
|
|
14521
|
-
), done ? /* @__PURE__ */
|
|
14766
|
+
), done ? /* @__PURE__ */ React78.createElement("div", { className: "n-w-[15px] n-h-[15px] n-bg-secondary n-rounded-full n-flex n-items-center n-justify-center n-text-white" }, /* @__PURE__ */ React78.createElement(Checkmark, null)) : /* @__PURE__ */ React78.createElement(ActivityIndicator, { size: 15 })));
|
|
14522
14767
|
}
|
|
14523
14768
|
function FileUploadList({
|
|
14524
14769
|
uploads
|
|
14525
14770
|
}) {
|
|
14526
|
-
return /* @__PURE__ */
|
|
14771
|
+
return /* @__PURE__ */ React78.createElement(React78.Fragment, null, /* @__PURE__ */ React78.createElement("div", { className: "n-flex n-items-center n-gap-2 n-py-2 n-px-4" }, /* @__PURE__ */ React78.createElement(Heading5, null, "Uploading ", uploads.length, " ", uploads.length === 1 ? "asset" : "assets")), /* @__PURE__ */ React78.createElement(Divider, null), /* @__PURE__ */ React78.createElement("div", { className: "n-flex n-flex-col n-gap-3 n-max-h-[500px] n-overflow-y-auto n-overflow-x-hidden n-py-4 n-px-4" }, uploads.map((upload) => /* @__PURE__ */ React78.createElement(
|
|
14527
14772
|
FileUploadIndicator,
|
|
14528
14773
|
{
|
|
14529
14774
|
key: upload.id,
|
|
@@ -14536,7 +14781,7 @@ function FileUploadList({
|
|
|
14536
14781
|
}
|
|
14537
14782
|
|
|
14538
14783
|
// src/components/FloatingWindow.tsx
|
|
14539
|
-
import
|
|
14784
|
+
import React79, { useCallback as useCallback31, useRef as useRef23, useState as useState30 } from "react";
|
|
14540
14785
|
var styles2 = {
|
|
14541
14786
|
noSelect: {
|
|
14542
14787
|
userSelect: "none",
|
|
@@ -14629,7 +14874,7 @@ function defaultRenderToolbar({
|
|
|
14629
14874
|
toolbarContent,
|
|
14630
14875
|
onClose
|
|
14631
14876
|
}) {
|
|
14632
|
-
return /* @__PURE__ */
|
|
14877
|
+
return /* @__PURE__ */ React79.createElement(React79.Fragment, null, /* @__PURE__ */ React79.createElement(Small, { className: "n-flex-1 n-font-medium n-text-text" }, title), toolbarContent, /* @__PURE__ */ React79.createElement(
|
|
14633
14878
|
IconButton,
|
|
14634
14879
|
{
|
|
14635
14880
|
iconName: "Cross3Icon",
|
|
@@ -14656,15 +14901,15 @@ var FloatingWindow = ({
|
|
|
14656
14901
|
toolbarContent,
|
|
14657
14902
|
renderToolbar = defaultRenderToolbar
|
|
14658
14903
|
}) => {
|
|
14659
|
-
const [position, setPosition] =
|
|
14660
|
-
const [size, setSize] =
|
|
14904
|
+
const [position, setPosition] = useState30({ x: initialX, y: initialY });
|
|
14905
|
+
const [size, setSize] = useState30({
|
|
14661
14906
|
width: initialWidth,
|
|
14662
14907
|
height: initialHeight
|
|
14663
14908
|
});
|
|
14664
|
-
const [isDragging, setIsDragging] =
|
|
14665
|
-
const [isResizing, setIsResizing] =
|
|
14666
|
-
const [dragOffset, setDragOffset] =
|
|
14667
|
-
const [resizeDirection, setResizeDirection] =
|
|
14909
|
+
const [isDragging, setIsDragging] = useState30(false);
|
|
14910
|
+
const [isResizing, setIsResizing] = useState30(false);
|
|
14911
|
+
const [dragOffset, setDragOffset] = useState30({ x: 0, y: 0 });
|
|
14912
|
+
const [resizeDirection, setResizeDirection] = useState30(null);
|
|
14668
14913
|
const wrapperRef = useRef23(null);
|
|
14669
14914
|
const toggleGlobalTextSelection = (disable) => {
|
|
14670
14915
|
if (disable) {
|
|
@@ -14673,7 +14918,7 @@ var FloatingWindow = ({
|
|
|
14673
14918
|
document.body.style.userSelect = "";
|
|
14674
14919
|
}
|
|
14675
14920
|
};
|
|
14676
|
-
const handleMouseDown =
|
|
14921
|
+
const handleMouseDown = useCallback31((e) => {
|
|
14677
14922
|
if (!wrapperRef.current) return;
|
|
14678
14923
|
const rect = wrapperRef.current.getBoundingClientRect();
|
|
14679
14924
|
setDragOffset({
|
|
@@ -14682,7 +14927,7 @@ var FloatingWindow = ({
|
|
|
14682
14927
|
});
|
|
14683
14928
|
setIsDragging(true);
|
|
14684
14929
|
}, []);
|
|
14685
|
-
const handleResizeStart =
|
|
14930
|
+
const handleResizeStart = useCallback31(
|
|
14686
14931
|
(direction) => (e) => {
|
|
14687
14932
|
e.stopPropagation();
|
|
14688
14933
|
setIsResizing(true);
|
|
@@ -14691,7 +14936,7 @@ var FloatingWindow = ({
|
|
|
14691
14936
|
},
|
|
14692
14937
|
[]
|
|
14693
14938
|
);
|
|
14694
|
-
const handleMouseMove =
|
|
14939
|
+
const handleMouseMove = useCallback31(
|
|
14695
14940
|
(e) => {
|
|
14696
14941
|
if (isDragging) {
|
|
14697
14942
|
setPosition({
|
|
@@ -14745,13 +14990,13 @@ var FloatingWindow = ({
|
|
|
14745
14990
|
minHeight
|
|
14746
14991
|
]
|
|
14747
14992
|
);
|
|
14748
|
-
const handleMouseUp =
|
|
14993
|
+
const handleMouseUp = useCallback31((_e) => {
|
|
14749
14994
|
setIsDragging(false);
|
|
14750
14995
|
setIsResizing(false);
|
|
14751
14996
|
setResizeDirection(null);
|
|
14752
14997
|
toggleGlobalTextSelection(false);
|
|
14753
14998
|
}, []);
|
|
14754
|
-
|
|
14999
|
+
React79.useEffect(() => {
|
|
14755
15000
|
document.addEventListener("mousemove", handleMouseMove);
|
|
14756
15001
|
document.addEventListener("mouseup", handleMouseUp);
|
|
14757
15002
|
return () => {
|
|
@@ -14761,11 +15006,11 @@ var FloatingWindow = ({
|
|
|
14761
15006
|
}, [handleMouseMove, handleMouseUp]);
|
|
14762
15007
|
const floatingWindowManager = useFloatingWindowManager();
|
|
14763
15008
|
const currentFloatingWindow = useCurrentFloatingWindowInternal();
|
|
14764
|
-
const handleClose =
|
|
15009
|
+
const handleClose = useCallback31(() => {
|
|
14765
15010
|
if (onClose) onClose();
|
|
14766
15011
|
floatingWindowManager.closeWindow(currentFloatingWindow.id);
|
|
14767
15012
|
}, [currentFloatingWindow.id, floatingWindowManager, onClose]);
|
|
14768
|
-
return /* @__PURE__ */
|
|
15013
|
+
return /* @__PURE__ */ React79.createElement(
|
|
14769
15014
|
"div",
|
|
14770
15015
|
{
|
|
14771
15016
|
ref: wrapperRef,
|
|
@@ -14780,7 +15025,7 @@ var FloatingWindow = ({
|
|
|
14780
15025
|
zIndex: cssVars.zIndex.menu
|
|
14781
15026
|
}
|
|
14782
15027
|
},
|
|
14783
|
-
/* @__PURE__ */
|
|
15028
|
+
/* @__PURE__ */ React79.createElement(
|
|
14784
15029
|
"div",
|
|
14785
15030
|
{
|
|
14786
15031
|
style: {
|
|
@@ -14791,9 +15036,9 @@ var FloatingWindow = ({
|
|
|
14791
15036
|
},
|
|
14792
15037
|
renderToolbar({ title, toolbarContent, onClose: handleClose })
|
|
14793
15038
|
),
|
|
14794
|
-
/* @__PURE__ */
|
|
14795
|
-
/* @__PURE__ */
|
|
14796
|
-
Object.entries(resizeHandlePositions).map(([direction, style2]) => /* @__PURE__ */
|
|
15039
|
+
/* @__PURE__ */ React79.createElement(Divider, null),
|
|
15040
|
+
/* @__PURE__ */ React79.createElement("div", { style: styles2.content }, children),
|
|
15041
|
+
Object.entries(resizeHandlePositions).map(([direction, style2]) => /* @__PURE__ */ React79.createElement(
|
|
14797
15042
|
"div",
|
|
14798
15043
|
{
|
|
14799
15044
|
key: direction,
|
|
@@ -14805,8 +15050,8 @@ var FloatingWindow = ({
|
|
|
14805
15050
|
};
|
|
14806
15051
|
|
|
14807
15052
|
// src/components/InspectorContainer.tsx
|
|
14808
|
-
import
|
|
14809
|
-
var InspectorContainer =
|
|
15053
|
+
import React80, { forwardRef as forwardRef25, memo as memo26 } from "react";
|
|
15054
|
+
var InspectorContainer = memo26(
|
|
14810
15055
|
forwardRef25(function InspectorContainer2({
|
|
14811
15056
|
header,
|
|
14812
15057
|
children,
|
|
@@ -14816,7 +15061,7 @@ var InspectorContainer = memo27(
|
|
|
14816
15061
|
className,
|
|
14817
15062
|
style: style2
|
|
14818
15063
|
}, forwardedRef) {
|
|
14819
|
-
return /* @__PURE__ */
|
|
15064
|
+
return /* @__PURE__ */ React80.createElement(
|
|
14820
15065
|
"div",
|
|
14821
15066
|
{
|
|
14822
15067
|
ref: forwardedRef,
|
|
@@ -14831,32 +15076,32 @@ var InspectorContainer = memo27(
|
|
|
14831
15076
|
}
|
|
14832
15077
|
},
|
|
14833
15078
|
header,
|
|
14834
|
-
children ? /* @__PURE__ */
|
|
15079
|
+
children ? /* @__PURE__ */ React80.createElement(ScrollArea, null, /* @__PURE__ */ React80.createElement("div", { className: "n-flex n-flex-col n-relative" }, showDividers ? withSeparatorElements(children, /* @__PURE__ */ React80.createElement(Divider, null)) : children)) : fallback ? /* @__PURE__ */ React80.createElement("div", { className: "n-flex n-flex-col n-relative n-h-full" }, fallback) : null
|
|
14835
15080
|
);
|
|
14836
15081
|
})
|
|
14837
15082
|
);
|
|
14838
15083
|
|
|
14839
15084
|
// src/components/LabeledElementView.tsx
|
|
14840
15085
|
import * as kiwi from "kiwi.js";
|
|
14841
|
-
import * as
|
|
14842
|
-
var LabeledElementView =
|
|
15086
|
+
import * as React81 from "react";
|
|
15087
|
+
var LabeledElementView = React81.memo(function LabeledElementView2({
|
|
14843
15088
|
children,
|
|
14844
15089
|
renderLabel
|
|
14845
15090
|
}) {
|
|
14846
|
-
const elementIds =
|
|
14847
|
-
(child) =>
|
|
15091
|
+
const elementIds = React81.Children.toArray(children).flatMap(
|
|
15092
|
+
(child) => React81.isValidElement(child) && child.type === React81.Fragment ? child.props.children : [child]
|
|
14848
15093
|
).map(
|
|
14849
|
-
(child) =>
|
|
15094
|
+
(child) => React81.isValidElement(child) && "id" in child.props ? child.props.id : null
|
|
14850
15095
|
).filter((id) => !!id);
|
|
14851
15096
|
const serializedIds = elementIds.join(",");
|
|
14852
|
-
const containerRef =
|
|
14853
|
-
const refs =
|
|
15097
|
+
const containerRef = React81.useRef(null);
|
|
15098
|
+
const refs = React81.useMemo(() => {
|
|
14854
15099
|
return Object.fromEntries(
|
|
14855
|
-
serializedIds.split(",").map((id) => [id,
|
|
15100
|
+
serializedIds.split(",").map((id) => [id, React81.createRef()])
|
|
14856
15101
|
);
|
|
14857
15102
|
}, [serializedIds]);
|
|
14858
|
-
const labelElements =
|
|
14859
|
-
return serializedIds.split(",").map((id, index) => /* @__PURE__ */
|
|
15103
|
+
const labelElements = React81.useMemo(() => {
|
|
15104
|
+
return serializedIds.split(",").map((id, index) => /* @__PURE__ */ React81.createElement(
|
|
14860
15105
|
"span",
|
|
14861
15106
|
{
|
|
14862
15107
|
key: id,
|
|
@@ -14869,7 +15114,7 @@ var LabeledElementView = React79.memo(function LabeledElementView2({
|
|
|
14869
15114
|
})
|
|
14870
15115
|
));
|
|
14871
15116
|
}, [refs, serializedIds, renderLabel]);
|
|
14872
|
-
|
|
15117
|
+
React81.useLayoutEffect(() => {
|
|
14873
15118
|
if (!containerRef.current) return;
|
|
14874
15119
|
const containerRect = containerRef.current.getBoundingClientRect();
|
|
14875
15120
|
const solver = new kiwi.Solver();
|
|
@@ -14931,17 +15176,17 @@ var LabeledElementView = React79.memo(function LabeledElementView2({
|
|
|
14931
15176
|
`${Math.max(...heights)}px`
|
|
14932
15177
|
);
|
|
14933
15178
|
}, [refs, labelElements]);
|
|
14934
|
-
return /* @__PURE__ */
|
|
15179
|
+
return /* @__PURE__ */ React81.createElement("div", { className: "n-flex n-flex-1 n-flex-col n-relative", ref: containerRef }, /* @__PURE__ */ React81.createElement("div", { className: "n-flex n-flex-1 n-items-center" }, children), /* @__PURE__ */ React81.createElement("div", { className: "n-relative n-overflow-hidden n-select-none" }, labelElements));
|
|
14935
15180
|
});
|
|
14936
15181
|
|
|
14937
15182
|
// src/components/LabeledField.tsx
|
|
14938
|
-
import
|
|
15183
|
+
import React83, { memo as memo28, useMemo as useMemo33 } from "react";
|
|
14939
15184
|
|
|
14940
15185
|
// src/hooks/useIndent.ts
|
|
14941
|
-
import
|
|
14942
|
-
var IndentContext =
|
|
15186
|
+
import React82 from "react";
|
|
15187
|
+
var IndentContext = React82.createContext(0);
|
|
14943
15188
|
var useIndent = () => {
|
|
14944
|
-
return
|
|
15189
|
+
return React82.useContext(IndentContext);
|
|
14945
15190
|
};
|
|
14946
15191
|
|
|
14947
15192
|
// src/components/LabeledField.tsx
|
|
@@ -14953,7 +15198,7 @@ var labeledFieldStyles = (labelType) => cx(
|
|
|
14953
15198
|
var labelTypeInset = {
|
|
14954
15199
|
type: "inset"
|
|
14955
15200
|
};
|
|
14956
|
-
var LabeledField =
|
|
15201
|
+
var LabeledField = memo28(function LabeledField2({
|
|
14957
15202
|
children,
|
|
14958
15203
|
label,
|
|
14959
15204
|
labelType: labelTypeProp,
|
|
@@ -14969,15 +15214,15 @@ var LabeledField = memo29(function LabeledField2({
|
|
|
14969
15214
|
const labelWidth = labelWidthFromContext ?? minWidth;
|
|
14970
15215
|
const labelTypeFromContext = useLabelType();
|
|
14971
15216
|
const labelType = labelTypeProp ?? labelTypeFromContext;
|
|
14972
|
-
const labeledFieldClasses =
|
|
15217
|
+
const labeledFieldClasses = useMemo33(
|
|
14973
15218
|
() => labeledFieldStyles(labelType),
|
|
14974
15219
|
[labelType]
|
|
14975
15220
|
);
|
|
14976
|
-
const labelContextValue =
|
|
15221
|
+
const labelContextValue = useMemo33(
|
|
14977
15222
|
() => ({ fieldId, label }),
|
|
14978
15223
|
[fieldId, label]
|
|
14979
15224
|
);
|
|
14980
|
-
const indentStyle =
|
|
15225
|
+
const indentStyle = useMemo33(
|
|
14981
15226
|
() => ({
|
|
14982
15227
|
width: indentLevel * 8,
|
|
14983
15228
|
flexBasis: indentLevel * 8,
|
|
@@ -14986,20 +15231,20 @@ var LabeledField = memo29(function LabeledField2({
|
|
|
14986
15231
|
}),
|
|
14987
15232
|
[indentLevel]
|
|
14988
15233
|
);
|
|
14989
|
-
const fieldStyle =
|
|
15234
|
+
const fieldStyle = useMemo33(
|
|
14990
15235
|
() => ({
|
|
14991
15236
|
minWidth: `calc(100% - ${labelWidth + indentLevel * 8 + 6}px)`
|
|
14992
15237
|
}),
|
|
14993
15238
|
[labelWidth, indentLevel]
|
|
14994
15239
|
);
|
|
14995
|
-
const labelStyle =
|
|
15240
|
+
const labelStyle = useMemo33(
|
|
14996
15241
|
() => ({
|
|
14997
15242
|
minWidth: `calc(${labelWidth}px - ${indentLevel * 8}px)`,
|
|
14998
15243
|
...labelStyleProp
|
|
14999
15244
|
}),
|
|
15000
15245
|
[labelWidth, indentLevel, labelStyleProp]
|
|
15001
15246
|
);
|
|
15002
|
-
return /* @__PURE__ */
|
|
15247
|
+
return /* @__PURE__ */ React83.createElement(LabelContext.Provider, { value: labelContextValue }, labelType === "inset" ? /* @__PURE__ */ React83.createElement(LabelTypeContext.Provider, { value: labelTypeInset }, children) : /* @__PURE__ */ React83.createElement("div", { className: cx("n-flex n-relative n-flex-1", className), style: style2 }, Boolean(indentLevel) && /* @__PURE__ */ React83.createElement("div", { style: indentStyle }), /* @__PURE__ */ React83.createElement("div", { className: labeledFieldClasses }, labelType !== "none" && /* @__PURE__ */ React83.createElement(
|
|
15003
15248
|
Label,
|
|
15004
15249
|
{
|
|
15005
15250
|
htmlFor: fieldId,
|
|
@@ -15008,13 +15253,13 @@ var LabeledField = memo29(function LabeledField2({
|
|
|
15008
15253
|
...props
|
|
15009
15254
|
},
|
|
15010
15255
|
label
|
|
15011
|
-
), labelType === "start" ? /* @__PURE__ */
|
|
15256
|
+
), labelType === "start" ? /* @__PURE__ */ React83.createElement("div", { className: "n-flex-auto n-flex", style: fieldStyle }, children) : children)));
|
|
15012
15257
|
});
|
|
15013
15258
|
|
|
15014
15259
|
// src/components/ListMenu.tsx
|
|
15015
15260
|
import { ArrowRightIcon } from "@noya-app/noya-icons";
|
|
15016
15261
|
import { chunkBy as chunkBy2 } from "@noya-app/noya-utils";
|
|
15017
|
-
import
|
|
15262
|
+
import React84 from "react";
|
|
15018
15263
|
function getItemId(item) {
|
|
15019
15264
|
if (item.type === "submenu") {
|
|
15020
15265
|
return item.id;
|
|
@@ -15043,7 +15288,7 @@ function ListMenu({
|
|
|
15043
15288
|
const regularItems = chunk.filter(
|
|
15044
15289
|
(item) => isSubMenuItem(item) || isSelectableMenuItem(item)
|
|
15045
15290
|
);
|
|
15046
|
-
return /* @__PURE__ */
|
|
15291
|
+
return /* @__PURE__ */ React84.createElement(
|
|
15047
15292
|
List,
|
|
15048
15293
|
{
|
|
15049
15294
|
key: regularItems.map(getItemId).join("-"),
|
|
@@ -15055,43 +15300,43 @@ function ListMenu({
|
|
|
15055
15300
|
getName: (item) => item.title.toString(),
|
|
15056
15301
|
selectedIds,
|
|
15057
15302
|
renderRight,
|
|
15058
|
-
renderThumbnail: ({ item }) => /* @__PURE__ */
|
|
15059
|
-
renderDetail: (item) => isSubMenuItem(item) && /* @__PURE__ */
|
|
15303
|
+
renderThumbnail: ({ item }) => /* @__PURE__ */ React84.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)),
|
|
15304
|
+
renderDetail: (item) => isSubMenuItem(item) && /* @__PURE__ */ React84.createElement(ArrowRightIcon, null),
|
|
15060
15305
|
onClickItem: (itemId) => onSelect(itemId)
|
|
15061
15306
|
}
|
|
15062
15307
|
);
|
|
15063
15308
|
});
|
|
15064
15309
|
return withSeparatorElements(
|
|
15065
15310
|
lists,
|
|
15066
|
-
/* @__PURE__ */
|
|
15311
|
+
/* @__PURE__ */ React84.createElement(Divider, { overflow: 12, className: "n-my-1" })
|
|
15067
15312
|
);
|
|
15068
15313
|
}
|
|
15069
15314
|
|
|
15070
15315
|
// src/components/ListNavigator.tsx
|
|
15071
|
-
import
|
|
15316
|
+
import React88 from "react";
|
|
15072
15317
|
|
|
15073
15318
|
// src/components/Navigator.tsx
|
|
15074
|
-
import
|
|
15319
|
+
import React87, {
|
|
15075
15320
|
Children as Children4,
|
|
15076
15321
|
isValidElement as isValidElement5,
|
|
15077
|
-
useCallback as
|
|
15078
|
-
useMemo as
|
|
15322
|
+
useCallback as useCallback33,
|
|
15323
|
+
useMemo as useMemo35,
|
|
15079
15324
|
useRef as useRef26,
|
|
15080
|
-
useState as
|
|
15325
|
+
useState as useState32
|
|
15081
15326
|
} from "react";
|
|
15082
15327
|
|
|
15083
15328
|
// src/components/StackNavigator.tsx
|
|
15084
15329
|
import { isDeepEqual as isDeepEqual4 } from "@noya-app/noya-utils";
|
|
15085
|
-
import
|
|
15086
|
-
useCallback as
|
|
15330
|
+
import React86, {
|
|
15331
|
+
useCallback as useCallback32,
|
|
15087
15332
|
useEffect as useEffect22,
|
|
15088
|
-
useMemo as
|
|
15333
|
+
useMemo as useMemo34,
|
|
15089
15334
|
useRef as useRef25,
|
|
15090
|
-
useState as
|
|
15335
|
+
useState as useState31
|
|
15091
15336
|
} from "react";
|
|
15092
15337
|
|
|
15093
15338
|
// src/components/BaseToolbar.tsx
|
|
15094
|
-
import
|
|
15339
|
+
import React85 from "react";
|
|
15095
15340
|
var toolbarStyle = {
|
|
15096
15341
|
[cssVarNames.colors.buttonBackground]: "transparent",
|
|
15097
15342
|
[cssVarNames.colors.inputBackground]: "transparent"
|
|
@@ -15103,7 +15348,7 @@ function BaseToolbarContainer({
|
|
|
15103
15348
|
innerClassName,
|
|
15104
15349
|
enableAbsoluteBreakpoint = true
|
|
15105
15350
|
}) {
|
|
15106
|
-
return /* @__PURE__ */
|
|
15351
|
+
return /* @__PURE__ */ React85.createElement("div", { className: cx("n-flex n-flex-col", className), style: toolbarStyle }, /* @__PURE__ */ React85.createElement(
|
|
15107
15352
|
"div",
|
|
15108
15353
|
{
|
|
15109
15354
|
className: cx(
|
|
@@ -15116,7 +15361,7 @@ function BaseToolbarContainer({
|
|
|
15116
15361
|
}
|
|
15117
15362
|
},
|
|
15118
15363
|
children
|
|
15119
|
-
), showDivider && /* @__PURE__ */
|
|
15364
|
+
), showDivider && /* @__PURE__ */ React85.createElement(Divider, { variant: "strong" }));
|
|
15120
15365
|
}
|
|
15121
15366
|
function BaseToolbar({
|
|
15122
15367
|
children,
|
|
@@ -15128,7 +15373,7 @@ function BaseToolbar({
|
|
|
15128
15373
|
innerClassName,
|
|
15129
15374
|
enableAbsoluteBreakpoint = true
|
|
15130
15375
|
}) {
|
|
15131
|
-
return /* @__PURE__ */
|
|
15376
|
+
return /* @__PURE__ */ React85.createElement(
|
|
15132
15377
|
BaseToolbarContainer,
|
|
15133
15378
|
{
|
|
15134
15379
|
showDivider,
|
|
@@ -15136,25 +15381,25 @@ function BaseToolbar({
|
|
|
15136
15381
|
innerClassName,
|
|
15137
15382
|
enableAbsoluteBreakpoint
|
|
15138
15383
|
},
|
|
15139
|
-
logo && /* @__PURE__ */
|
|
15140
|
-
/* @__PURE__ */
|
|
15141
|
-
left && /* @__PURE__ */
|
|
15142
|
-
children && /* @__PURE__ */
|
|
15384
|
+
logo && /* @__PURE__ */ React85.createElement(React85.Fragment, null, logo, /* @__PURE__ */ React85.createElement(DividerVertical, null)),
|
|
15385
|
+
/* @__PURE__ */ React85.createElement(Spacer.Horizontal, { size: 10 }),
|
|
15386
|
+
left && /* @__PURE__ */ React85.createElement(React85.Fragment, null, /* @__PURE__ */ React85.createElement("div", { className: "n-flex n-gap-toolbar-separator" }, left), /* @__PURE__ */ React85.createElement(Spacer.Horizontal, { size: 10 })),
|
|
15387
|
+
children && /* @__PURE__ */ React85.createElement(
|
|
15143
15388
|
"div",
|
|
15144
15389
|
{
|
|
15145
|
-
className: "n-flex n-items-center n-justify-center n-text-text-muted n-pointer-events-none @
|
|
15390
|
+
className: "n-flex n-items-center n-justify-center n-text-text-muted n-pointer-events-none @xl/toolbar:!n-absolute n-inset-0"
|
|
15146
15391
|
},
|
|
15147
|
-
/* @__PURE__ */
|
|
15392
|
+
/* @__PURE__ */ React85.createElement("div", { className: "n-flex n-items-center n-justify-center n-pointer-events-auto" }, children)
|
|
15148
15393
|
),
|
|
15149
|
-
/* @__PURE__ */
|
|
15150
|
-
/* @__PURE__ */
|
|
15151
|
-
/* @__PURE__ */
|
|
15152
|
-
/* @__PURE__ */
|
|
15394
|
+
/* @__PURE__ */ React85.createElement(Spacer.Horizontal, null),
|
|
15395
|
+
/* @__PURE__ */ React85.createElement(Spacer.Horizontal, { size: 10 }),
|
|
15396
|
+
/* @__PURE__ */ React85.createElement("div", { className: "n-flex n-gap-toolbar-separator" }, right),
|
|
15397
|
+
/* @__PURE__ */ React85.createElement(Spacer.Horizontal, { size: 10 })
|
|
15153
15398
|
);
|
|
15154
15399
|
}
|
|
15155
15400
|
|
|
15156
15401
|
// src/components/StackNavigator.tsx
|
|
15157
|
-
var StackRenderContext =
|
|
15402
|
+
var StackRenderContext = React86.createContext({});
|
|
15158
15403
|
function StackNavigator({
|
|
15159
15404
|
items,
|
|
15160
15405
|
onBack,
|
|
@@ -15169,14 +15414,14 @@ function StackNavigator({
|
|
|
15169
15414
|
}) {
|
|
15170
15415
|
const top = items.at(-1);
|
|
15171
15416
|
const previousLengthRef = useRef25(items.length);
|
|
15172
|
-
const direction =
|
|
15417
|
+
const direction = useMemo34(() => {
|
|
15173
15418
|
const previous = previousLengthRef.current;
|
|
15174
15419
|
previousLengthRef.current = items.length;
|
|
15175
15420
|
return items.length >= previous ? "forward" : "back";
|
|
15176
15421
|
}, [items.length]);
|
|
15177
|
-
const [cardSizes, setCardSizes] =
|
|
15178
|
-
const [containerSize, setContainerSize] =
|
|
15179
|
-
const handleSizeChange =
|
|
15422
|
+
const [cardSizes, setCardSizes] = useState31({});
|
|
15423
|
+
const [containerSize, setContainerSize] = useState31();
|
|
15424
|
+
const handleSizeChange = useCallback32((key, size) => {
|
|
15180
15425
|
setCardSizes((prev) => {
|
|
15181
15426
|
if (isDeepEqual4(prev[key], size)) {
|
|
15182
15427
|
return prev;
|
|
@@ -15216,7 +15461,7 @@ function StackNavigator({
|
|
|
15216
15461
|
return changed ? next : prev;
|
|
15217
15462
|
});
|
|
15218
15463
|
}, [items]);
|
|
15219
|
-
const animationStyles =
|
|
15464
|
+
const animationStyles = useMemo34(() => {
|
|
15220
15465
|
return {
|
|
15221
15466
|
entering: {
|
|
15222
15467
|
opacity: 0,
|
|
@@ -15236,7 +15481,7 @@ function StackNavigator({
|
|
|
15236
15481
|
};
|
|
15237
15482
|
}, [direction]);
|
|
15238
15483
|
const shouldAnimateSize = containerSize !== void 0;
|
|
15239
|
-
const contentStyle =
|
|
15484
|
+
const contentStyle = useMemo34(() => {
|
|
15240
15485
|
if (!containerSize) return void 0;
|
|
15241
15486
|
const style3 = {
|
|
15242
15487
|
// width: containerSize.width,
|
|
@@ -15249,8 +15494,8 @@ function StackNavigator({
|
|
|
15249
15494
|
}
|
|
15250
15495
|
return style3;
|
|
15251
15496
|
}, [containerSize, shouldAnimateSize]);
|
|
15252
|
-
const [animationStates, setAnimationStates] =
|
|
15253
|
-
const [renderContentCache, setRenderContentCache] =
|
|
15497
|
+
const [animationStates, setAnimationStates] = useState31({});
|
|
15498
|
+
const [renderContentCache, setRenderContentCache] = useState31(
|
|
15254
15499
|
() => Object.fromEntries(items.map((item) => [item.key, item.renderContent]))
|
|
15255
15500
|
);
|
|
15256
15501
|
useEffect22(() => {
|
|
@@ -15271,7 +15516,7 @@ function StackNavigator({
|
|
|
15271
15516
|
return changed ? next : prev;
|
|
15272
15517
|
});
|
|
15273
15518
|
}, [animationStates, items]);
|
|
15274
|
-
const handleChildStateChange =
|
|
15519
|
+
const handleChildStateChange = useCallback32(
|
|
15275
15520
|
(key, state) => {
|
|
15276
15521
|
if (!key) return;
|
|
15277
15522
|
setAnimationStates((prev) => {
|
|
@@ -15314,7 +15559,7 @@ function StackNavigator({
|
|
|
15314
15559
|
}
|
|
15315
15560
|
return defaultRenderHeader(headerProps);
|
|
15316
15561
|
};
|
|
15317
|
-
return /* @__PURE__ */
|
|
15562
|
+
return /* @__PURE__ */ React86.createElement(
|
|
15318
15563
|
"div",
|
|
15319
15564
|
{
|
|
15320
15565
|
className: cx("n-flex n-flex-col", className),
|
|
@@ -15330,13 +15575,13 @@ function StackNavigator({
|
|
|
15330
15575
|
}
|
|
15331
15576
|
},
|
|
15332
15577
|
showHeader && renderHeaderContent(),
|
|
15333
|
-
/* @__PURE__ */
|
|
15578
|
+
/* @__PURE__ */ React86.createElement(
|
|
15334
15579
|
"div",
|
|
15335
15580
|
{
|
|
15336
15581
|
className: cx("n-relative n-overflow-hidden", contentClassName),
|
|
15337
15582
|
style: contentStyle
|
|
15338
15583
|
},
|
|
15339
|
-
/* @__PURE__ */
|
|
15584
|
+
/* @__PURE__ */ React86.createElement(StackRenderContext.Provider, { value: renderContentCache }, /* @__PURE__ */ React86.createElement(
|
|
15340
15585
|
AnimatePresence,
|
|
15341
15586
|
{
|
|
15342
15587
|
duration: 200,
|
|
@@ -15345,7 +15590,7 @@ function StackNavigator({
|
|
|
15345
15590
|
mode: "wait",
|
|
15346
15591
|
onChildStateChange: handleChildStateChange
|
|
15347
15592
|
},
|
|
15348
|
-
/* @__PURE__ */
|
|
15593
|
+
/* @__PURE__ */ React86.createElement(
|
|
15349
15594
|
StackNavigatorCard,
|
|
15350
15595
|
{
|
|
15351
15596
|
key: top.key,
|
|
@@ -15365,15 +15610,15 @@ var StackNavigatorCard = ({
|
|
|
15365
15610
|
style: style2,
|
|
15366
15611
|
className
|
|
15367
15612
|
}) => {
|
|
15368
|
-
const ref =
|
|
15613
|
+
const ref = React86.useRef(null);
|
|
15369
15614
|
const size = useSize(ref);
|
|
15370
|
-
const renderContext =
|
|
15615
|
+
const renderContext = React86.useContext(StackRenderContext);
|
|
15371
15616
|
const renderContent = renderContext?.[item.key] ?? item.renderContent;
|
|
15372
|
-
|
|
15617
|
+
React86.useEffect(() => {
|
|
15373
15618
|
if (!size || size.width === 0 || size.height === 0) return;
|
|
15374
15619
|
onSizeChange(item.key, size);
|
|
15375
15620
|
}, [item.key, onSizeChange, size]);
|
|
15376
|
-
return /* @__PURE__ */
|
|
15621
|
+
return /* @__PURE__ */ React86.createElement("div", { ref, className: cx("n-flex n-flex-col", className), style: style2 }, renderContent?.());
|
|
15377
15622
|
};
|
|
15378
15623
|
function defaultRenderHeader({
|
|
15379
15624
|
showDivider,
|
|
@@ -15382,13 +15627,13 @@ function defaultRenderHeader({
|
|
|
15382
15627
|
right,
|
|
15383
15628
|
title
|
|
15384
15629
|
}) {
|
|
15385
|
-
return /* @__PURE__ */
|
|
15630
|
+
return /* @__PURE__ */ React86.createElement(
|
|
15386
15631
|
BaseToolbar,
|
|
15387
15632
|
{
|
|
15388
15633
|
innerClassName: "n-px-1",
|
|
15389
15634
|
showDivider,
|
|
15390
15635
|
enableAbsoluteBreakpoint: false,
|
|
15391
|
-
left: showBackButton && /* @__PURE__ */
|
|
15636
|
+
left: showBackButton && /* @__PURE__ */ React86.createElement(
|
|
15392
15637
|
Button,
|
|
15393
15638
|
{
|
|
15394
15639
|
className: "-n-mx-2",
|
|
@@ -15399,7 +15644,7 @@ function defaultRenderHeader({
|
|
|
15399
15644
|
),
|
|
15400
15645
|
right
|
|
15401
15646
|
},
|
|
15402
|
-
typeof title === "string" || typeof title === "number" ? /* @__PURE__ */
|
|
15647
|
+
typeof title === "string" || typeof title === "number" ? /* @__PURE__ */ React86.createElement(Body, null, title) : title
|
|
15403
15648
|
);
|
|
15404
15649
|
}
|
|
15405
15650
|
|
|
@@ -15411,16 +15656,16 @@ var NavigatorScreen = Object.assign(
|
|
|
15411
15656
|
[navigatorScreenIdentifier]: true
|
|
15412
15657
|
}
|
|
15413
15658
|
);
|
|
15414
|
-
var NavigatorScreenContext =
|
|
15659
|
+
var NavigatorScreenContext = React87.createContext(null);
|
|
15415
15660
|
function useNavigator() {
|
|
15416
|
-
const context =
|
|
15661
|
+
const context = React87.useContext(NavigatorScreenContext);
|
|
15417
15662
|
if (!context) {
|
|
15418
15663
|
throw new Error("useNavigator must be used within a Navigator screen");
|
|
15419
15664
|
}
|
|
15420
15665
|
return context.navigation;
|
|
15421
15666
|
}
|
|
15422
15667
|
function useNavigatorRoute() {
|
|
15423
|
-
const context =
|
|
15668
|
+
const context = React87.useContext(NavigatorScreenContext);
|
|
15424
15669
|
if (!context) {
|
|
15425
15670
|
throw new Error("useNavigatorRoute must be used within a Navigator screen");
|
|
15426
15671
|
}
|
|
@@ -15448,7 +15693,7 @@ function NavigatorImpl({
|
|
|
15448
15693
|
showHeader,
|
|
15449
15694
|
renderHeader
|
|
15450
15695
|
}) {
|
|
15451
|
-
const screens =
|
|
15696
|
+
const screens = useMemo35(() => {
|
|
15452
15697
|
const configs = [];
|
|
15453
15698
|
Children4.forEach(children, (child) => {
|
|
15454
15699
|
if (!isNavigatorScreenElement(child)) return;
|
|
@@ -15456,7 +15701,7 @@ function NavigatorImpl({
|
|
|
15456
15701
|
});
|
|
15457
15702
|
return configs;
|
|
15458
15703
|
}, [children]);
|
|
15459
|
-
const screenMap =
|
|
15704
|
+
const screenMap = useMemo35(() => {
|
|
15460
15705
|
const map = /* @__PURE__ */ new Map();
|
|
15461
15706
|
for (const screen of screens) {
|
|
15462
15707
|
if (map.has(screen.name)) {
|
|
@@ -15469,7 +15714,7 @@ function NavigatorImpl({
|
|
|
15469
15714
|
return map;
|
|
15470
15715
|
}, [screens]);
|
|
15471
15716
|
const keyRef = useRef26(0);
|
|
15472
|
-
const createEntry =
|
|
15717
|
+
const createEntry = useCallback33(
|
|
15473
15718
|
(name, params) => ({
|
|
15474
15719
|
key: `${String(name)}-${keyRef.current++}`,
|
|
15475
15720
|
name,
|
|
@@ -15483,13 +15728,13 @@ function NavigatorImpl({
|
|
|
15483
15728
|
`Navigator: initial route "${String(initialScreenName)}" is not registered as a screen.`
|
|
15484
15729
|
);
|
|
15485
15730
|
}
|
|
15486
|
-
const [stack, setStack] =
|
|
15731
|
+
const [stack, setStack] = useState32(() => [
|
|
15487
15732
|
createEntry(
|
|
15488
15733
|
initialScreenName,
|
|
15489
15734
|
initialRoute.params
|
|
15490
15735
|
)
|
|
15491
15736
|
]);
|
|
15492
|
-
const push =
|
|
15737
|
+
const push = useCallback33(
|
|
15493
15738
|
(...args) => {
|
|
15494
15739
|
const [name, params] = args;
|
|
15495
15740
|
const screen = screenMap.get(name);
|
|
@@ -15503,7 +15748,7 @@ function NavigatorImpl({
|
|
|
15503
15748
|
},
|
|
15504
15749
|
[createEntry, screenMap]
|
|
15505
15750
|
);
|
|
15506
|
-
const pop =
|
|
15751
|
+
const pop = useCallback33(() => {
|
|
15507
15752
|
setStack((prev) => {
|
|
15508
15753
|
if (prev.length <= 1) return prev;
|
|
15509
15754
|
const nextStack = prev.slice(0, -1);
|
|
@@ -15519,7 +15764,7 @@ function NavigatorImpl({
|
|
|
15519
15764
|
return updatedStack;
|
|
15520
15765
|
});
|
|
15521
15766
|
}, [createEntry]);
|
|
15522
|
-
const replace =
|
|
15767
|
+
const replace = useCallback33(
|
|
15523
15768
|
(targetKey, name, params) => {
|
|
15524
15769
|
const screen = screenMap.get(name);
|
|
15525
15770
|
if (!screen) {
|
|
@@ -15545,7 +15790,7 @@ function NavigatorImpl({
|
|
|
15545
15790
|
},
|
|
15546
15791
|
[createEntry, screenMap]
|
|
15547
15792
|
);
|
|
15548
|
-
const items =
|
|
15793
|
+
const items = useMemo35(() => {
|
|
15549
15794
|
return stack.flatMap((entry) => {
|
|
15550
15795
|
const screen = screenMap.get(entry.name);
|
|
15551
15796
|
if (!screen) return [];
|
|
@@ -15583,7 +15828,7 @@ function NavigatorImpl({
|
|
|
15583
15828
|
onBack: headerProps.onBack
|
|
15584
15829
|
}),
|
|
15585
15830
|
renderContent: () => {
|
|
15586
|
-
return /* @__PURE__ */
|
|
15831
|
+
return /* @__PURE__ */ React87.createElement(NavigatorScreenContext.Provider, { value: context }, evaluateOption(screen.children, context));
|
|
15587
15832
|
}
|
|
15588
15833
|
};
|
|
15589
15834
|
});
|
|
@@ -15591,7 +15836,7 @@ function NavigatorImpl({
|
|
|
15591
15836
|
const shouldShowHeader = evaluateOption(showHeader, {
|
|
15592
15837
|
stack
|
|
15593
15838
|
});
|
|
15594
|
-
return /* @__PURE__ */
|
|
15839
|
+
return /* @__PURE__ */ React87.createElement(
|
|
15595
15840
|
StackNavigator,
|
|
15596
15841
|
{
|
|
15597
15842
|
items,
|
|
@@ -15631,7 +15876,7 @@ function ListNavigator({
|
|
|
15631
15876
|
renderHeader,
|
|
15632
15877
|
selectedIds
|
|
15633
15878
|
}) {
|
|
15634
|
-
return /* @__PURE__ */
|
|
15879
|
+
return /* @__PURE__ */ React88.createElement(
|
|
15635
15880
|
ListNavigatorInternal,
|
|
15636
15881
|
{
|
|
15637
15882
|
initialRoute: { name: "screen", params: { id: void 0 } },
|
|
@@ -15649,7 +15894,7 @@ function ListNavigator({
|
|
|
15649
15894
|
className,
|
|
15650
15895
|
style: style2
|
|
15651
15896
|
},
|
|
15652
|
-
/* @__PURE__ */
|
|
15897
|
+
/* @__PURE__ */ React88.createElement(
|
|
15653
15898
|
ListNavigatorInternal.Screen,
|
|
15654
15899
|
{
|
|
15655
15900
|
name: "screen",
|
|
@@ -15664,7 +15909,7 @@ function ListNavigator({
|
|
|
15664
15909
|
const nestedItem = items.find(
|
|
15665
15910
|
(item) => isSubMenuItem(item) && item.id === route.params.id
|
|
15666
15911
|
);
|
|
15667
|
-
return /* @__PURE__ */
|
|
15912
|
+
return /* @__PURE__ */ React88.createElement(
|
|
15668
15913
|
ListMenu,
|
|
15669
15914
|
{
|
|
15670
15915
|
items: nestedItem?.items ?? items,
|
|
@@ -15689,18 +15934,19 @@ function ListNavigator({
|
|
|
15689
15934
|
|
|
15690
15935
|
// src/components/Message.tsx
|
|
15691
15936
|
import { uuid as uuid2 } from "@noya-app/noya-utils";
|
|
15692
|
-
import
|
|
15693
|
-
var Message =
|
|
15937
|
+
import React89, { forwardRef as forwardRef26, memo as memo29, useMemo as useMemo36 } from "react";
|
|
15938
|
+
var Message = memo29(
|
|
15694
15939
|
forwardRef26(function Message2({ role, children, user, avatarSize = INPUT_HEIGHT }, ref) {
|
|
15695
15940
|
const randomId = uuid2();
|
|
15696
|
-
const
|
|
15697
|
-
const
|
|
15941
|
+
const resolvedUserId = user?.authId ?? user?.connectionId ?? randomId;
|
|
15942
|
+
const userMessageBackgroundColor = colorFromString(resolvedUserId);
|
|
15943
|
+
const styles3 = useMemo36(
|
|
15698
15944
|
() => role === "user" ? {
|
|
15699
15945
|
backgroundColor: userMessageBackgroundColor
|
|
15700
15946
|
} : void 0,
|
|
15701
15947
|
[userMessageBackgroundColor, role]
|
|
15702
15948
|
);
|
|
15703
|
-
return /* @__PURE__ */
|
|
15949
|
+
return /* @__PURE__ */ React89.createElement(
|
|
15704
15950
|
"div",
|
|
15705
15951
|
{
|
|
15706
15952
|
className: cx(
|
|
@@ -15708,24 +15954,24 @@ var Message = memo30(
|
|
|
15708
15954
|
role === "user" ? "n-flex-row-reverse" : "n-flex-row"
|
|
15709
15955
|
)
|
|
15710
15956
|
},
|
|
15711
|
-
role === "assistant" ? /* @__PURE__ */
|
|
15957
|
+
role === "assistant" ? /* @__PURE__ */ React89.createElement(
|
|
15712
15958
|
Avatar,
|
|
15713
15959
|
{
|
|
15714
15960
|
name: "Assistant",
|
|
15715
15961
|
size: avatarSize,
|
|
15716
15962
|
backgroundColor: cssVars.colors.primaryPastel
|
|
15717
15963
|
},
|
|
15718
|
-
/* @__PURE__ */
|
|
15719
|
-
) : /* @__PURE__ */
|
|
15964
|
+
/* @__PURE__ */ React89.createElement(Logo, { style: { width: 15 }, fill: cssVars.colors.primary })
|
|
15965
|
+
) : /* @__PURE__ */ React89.createElement(
|
|
15720
15966
|
Avatar,
|
|
15721
15967
|
{
|
|
15722
|
-
userId:
|
|
15968
|
+
userId: resolvedUserId,
|
|
15723
15969
|
name: user?.name ?? "Anonymous",
|
|
15724
15970
|
image: user?.image,
|
|
15725
15971
|
size: avatarSize
|
|
15726
15972
|
}
|
|
15727
15973
|
),
|
|
15728
|
-
/* @__PURE__ */
|
|
15974
|
+
/* @__PURE__ */ React89.createElement(
|
|
15729
15975
|
"div",
|
|
15730
15976
|
{
|
|
15731
15977
|
className: cx(
|
|
@@ -15745,9 +15991,9 @@ var Message = memo30(
|
|
|
15745
15991
|
|
|
15746
15992
|
// src/components/pipeline/PipelineResultLayout.tsx
|
|
15747
15993
|
import { Link1Icon } from "@noya-app/noya-icons";
|
|
15748
|
-
import
|
|
15994
|
+
import React90 from "react";
|
|
15749
15995
|
var PipelineResultLink = ({ url }) => {
|
|
15750
|
-
return /* @__PURE__ */
|
|
15996
|
+
return /* @__PURE__ */ React90.createElement("div", { className: "n-flex n-flex-col gap-0.5" }, /* @__PURE__ */ React90.createElement(
|
|
15751
15997
|
"a",
|
|
15752
15998
|
{
|
|
15753
15999
|
href: url,
|
|
@@ -15755,15 +16001,15 @@ var PipelineResultLink = ({ url }) => {
|
|
|
15755
16001
|
rel: "noopener noreferrer",
|
|
15756
16002
|
className: "n-flex n-text-primary hover:n-opacity-80 n-border n-border-divider n-rounded-md"
|
|
15757
16003
|
},
|
|
15758
|
-
/* @__PURE__ */
|
|
15759
|
-
/* @__PURE__ */
|
|
15760
|
-
/* @__PURE__ */
|
|
16004
|
+
/* @__PURE__ */ React90.createElement("div", { className: "n-flex n-gap-1 n-items-center n-p-2" }, /* @__PURE__ */ React90.createElement(Link1Icon, { className: "n-w-[15px] n-h-[15px] n-flex-shrink-0" })),
|
|
16005
|
+
/* @__PURE__ */ React90.createElement(DividerVertical, null),
|
|
16006
|
+
/* @__PURE__ */ React90.createElement(Small, { className: "n-truncate n-p-2 n-flex-1" }, url)
|
|
15761
16007
|
));
|
|
15762
16008
|
};
|
|
15763
16009
|
var PipelineResultLayout = ({
|
|
15764
16010
|
children
|
|
15765
16011
|
}) => {
|
|
15766
|
-
return /* @__PURE__ */
|
|
16012
|
+
return /* @__PURE__ */ React90.createElement("div", { className: "n-flex n-flex-col n-gap-2" }, children);
|
|
15767
16013
|
};
|
|
15768
16014
|
function getPipelineResultLink(value) {
|
|
15769
16015
|
if (typeof value !== "object" || value === null) return void 0;
|
|
@@ -15777,7 +16023,7 @@ function getPipelineResultLink(value) {
|
|
|
15777
16023
|
}
|
|
15778
16024
|
|
|
15779
16025
|
// src/components/ResizableContainer.tsx
|
|
15780
|
-
import
|
|
16026
|
+
import React91, { useCallback as useCallback34, useRef as useRef27, useState as useState33 } from "react";
|
|
15781
16027
|
var ResizableContainer = ({
|
|
15782
16028
|
children,
|
|
15783
16029
|
minWidth,
|
|
@@ -15794,9 +16040,9 @@ var ResizableContainer = ({
|
|
|
15794
16040
|
const resizeableRef = useRef27(null);
|
|
15795
16041
|
const handleRef = useRef27(null);
|
|
15796
16042
|
const clickCounter = useRef27(createClickCounter({ delay: 250 }));
|
|
15797
|
-
const [width, setWidth] =
|
|
15798
|
-
const [drag, setDrag] =
|
|
15799
|
-
const handlePointerDown =
|
|
16043
|
+
const [width, setWidth] = useState33();
|
|
16044
|
+
const [drag, setDrag] = useState33();
|
|
16045
|
+
const handlePointerDown = useCallback34(
|
|
15800
16046
|
(event) => {
|
|
15801
16047
|
const containerWidth = containerRef.current?.getBoundingClientRect().width;
|
|
15802
16048
|
const resizeableWidth = resizeableRef.current?.getBoundingClientRect().width;
|
|
@@ -15814,7 +16060,7 @@ var ResizableContainer = ({
|
|
|
15814
16060
|
},
|
|
15815
16061
|
[maxWidth, minWidth]
|
|
15816
16062
|
);
|
|
15817
|
-
const handlePointerMove =
|
|
16063
|
+
const handlePointerMove = useCallback34(
|
|
15818
16064
|
(event) => {
|
|
15819
16065
|
if (!drag) return;
|
|
15820
16066
|
const delta = event.clientX - drag.startX;
|
|
@@ -15830,7 +16076,7 @@ var ResizableContainer = ({
|
|
|
15830
16076
|
},
|
|
15831
16077
|
[drag, onChangeWidth]
|
|
15832
16078
|
);
|
|
15833
|
-
const handlePointerUp =
|
|
16079
|
+
const handlePointerUp = useCallback34(
|
|
15834
16080
|
(event) => {
|
|
15835
16081
|
setDrag(void 0);
|
|
15836
16082
|
handleRef.current?.releasePointerCapture(event.pointerId);
|
|
@@ -15846,7 +16092,7 @@ var ResizableContainer = ({
|
|
|
15846
16092
|
},
|
|
15847
16093
|
[shouldResetWidth]
|
|
15848
16094
|
);
|
|
15849
|
-
return /* @__PURE__ */
|
|
16095
|
+
return /* @__PURE__ */ React91.createElement(
|
|
15850
16096
|
"div",
|
|
15851
16097
|
{
|
|
15852
16098
|
ref: containerRef,
|
|
@@ -15854,7 +16100,7 @@ var ResizableContainer = ({
|
|
|
15854
16100
|
style: { position: "relative", ...style2 },
|
|
15855
16101
|
className
|
|
15856
16102
|
},
|
|
15857
|
-
/* @__PURE__ */
|
|
16103
|
+
/* @__PURE__ */ React91.createElement(
|
|
15858
16104
|
"div",
|
|
15859
16105
|
{
|
|
15860
16106
|
ref: resizeableRef,
|
|
@@ -15865,7 +16111,7 @@ var ResizableContainer = ({
|
|
|
15865
16111
|
}
|
|
15866
16112
|
},
|
|
15867
16113
|
typeof children === "function" ? children({ width }) : children,
|
|
15868
|
-
/* @__PURE__ */
|
|
16114
|
+
/* @__PURE__ */ React91.createElement(
|
|
15869
16115
|
"div",
|
|
15870
16116
|
{
|
|
15871
16117
|
ref: handleRef,
|
|
@@ -15890,7 +16136,7 @@ var ResizableContainer = ({
|
|
|
15890
16136
|
onPointerUp: handlePointerUp,
|
|
15891
16137
|
onPointerCancel: handlePointerUp
|
|
15892
16138
|
},
|
|
15893
|
-
/* @__PURE__ */
|
|
16139
|
+
/* @__PURE__ */ React91.createElement(
|
|
15894
16140
|
"div",
|
|
15895
16141
|
{
|
|
15896
16142
|
style: {
|
|
@@ -15908,7 +16154,7 @@ var ResizableContainer = ({
|
|
|
15908
16154
|
}
|
|
15909
16155
|
)
|
|
15910
16156
|
),
|
|
15911
|
-
drag && /* @__PURE__ */
|
|
16157
|
+
drag && /* @__PURE__ */ React91.createElement(
|
|
15912
16158
|
"div",
|
|
15913
16159
|
{
|
|
15914
16160
|
style: {
|
|
@@ -15931,7 +16177,7 @@ function clamp5(value, min, max) {
|
|
|
15931
16177
|
|
|
15932
16178
|
// src/components/RingProgress.tsx
|
|
15933
16179
|
import { clamp as clamp6 } from "@noya-app/noya-utils";
|
|
15934
|
-
import * as
|
|
16180
|
+
import * as React92 from "react";
|
|
15935
16181
|
function RingProgress({
|
|
15936
16182
|
value,
|
|
15937
16183
|
dividedBy = 100,
|
|
@@ -15947,14 +16193,14 @@ function RingProgress({
|
|
|
15947
16193
|
const safeDivisor = dividedBy > 0 ? dividedBy : 1;
|
|
15948
16194
|
const clampedRaw = clamp6(value, 0, safeDivisor);
|
|
15949
16195
|
const clampedPercent = clampedRaw / safeDivisor * 100;
|
|
15950
|
-
const radius =
|
|
15951
|
-
const circumference =
|
|
15952
|
-
const dashOffset =
|
|
16196
|
+
const radius = React92.useMemo(() => (size - thickness) / 2, [size, thickness]);
|
|
16197
|
+
const circumference = React92.useMemo(() => 2 * Math.PI * radius, [radius]);
|
|
16198
|
+
const dashOffset = React92.useMemo(
|
|
15953
16199
|
() => (100 - clampedPercent) / 100 * circumference,
|
|
15954
16200
|
[circumference, clampedPercent]
|
|
15955
16201
|
);
|
|
15956
16202
|
const trackStroke = trackColor ?? "var(--n-input-background, rgba(0,0,0,0.08))";
|
|
15957
|
-
const colorClass =
|
|
16203
|
+
const colorClass = React92.useMemo(() => {
|
|
15958
16204
|
switch (colorScheme) {
|
|
15959
16205
|
case "primary":
|
|
15960
16206
|
return "n-stroke-primary";
|
|
@@ -15967,7 +16213,7 @@ function RingProgress({
|
|
|
15967
16213
|
return "n-stroke-text";
|
|
15968
16214
|
}
|
|
15969
16215
|
}, [colorScheme]);
|
|
15970
|
-
const computedStroke =
|
|
16216
|
+
const computedStroke = React92.useMemo(() => {
|
|
15971
16217
|
if (color) return color;
|
|
15972
16218
|
switch (colorScheme) {
|
|
15973
16219
|
case "primary":
|
|
@@ -15981,7 +16227,7 @@ function RingProgress({
|
|
|
15981
16227
|
return "var(--n-text, currentColor)";
|
|
15982
16228
|
}
|
|
15983
16229
|
}, [color, colorScheme]);
|
|
15984
|
-
return /* @__PURE__ */
|
|
16230
|
+
return /* @__PURE__ */ React92.createElement(
|
|
15985
16231
|
"span",
|
|
15986
16232
|
{
|
|
15987
16233
|
className: cx("n-inline-flex n-items-center n-justify-center", className),
|
|
@@ -15992,7 +16238,7 @@ function RingProgress({
|
|
|
15992
16238
|
"aria-valuemax": safeDivisor,
|
|
15993
16239
|
"aria-label": ariaLabel
|
|
15994
16240
|
},
|
|
15995
|
-
/* @__PURE__ */
|
|
16241
|
+
/* @__PURE__ */ React92.createElement(
|
|
15996
16242
|
"svg",
|
|
15997
16243
|
{
|
|
15998
16244
|
width: size,
|
|
@@ -16000,7 +16246,7 @@ function RingProgress({
|
|
|
16000
16246
|
viewBox: `0 0 ${size} ${size}`,
|
|
16001
16247
|
style: { display: "block" }
|
|
16002
16248
|
},
|
|
16003
|
-
/* @__PURE__ */
|
|
16249
|
+
/* @__PURE__ */ React92.createElement(
|
|
16004
16250
|
"circle",
|
|
16005
16251
|
{
|
|
16006
16252
|
cx: size / 2,
|
|
@@ -16011,7 +16257,7 @@ function RingProgress({
|
|
|
16011
16257
|
strokeWidth: thickness
|
|
16012
16258
|
}
|
|
16013
16259
|
),
|
|
16014
|
-
/* @__PURE__ */
|
|
16260
|
+
/* @__PURE__ */ React92.createElement(
|
|
16015
16261
|
"circle",
|
|
16016
16262
|
{
|
|
16017
16263
|
cx: size / 2,
|
|
@@ -16035,49 +16281,13 @@ function RingProgress({
|
|
|
16035
16281
|
}
|
|
16036
16282
|
|
|
16037
16283
|
// src/components/ScrollableSidebar.tsx
|
|
16038
|
-
import
|
|
16284
|
+
import React93 from "react";
|
|
16039
16285
|
function ScrollableSidebar({ children }) {
|
|
16040
|
-
return /* @__PURE__ */
|
|
16041
|
-
}
|
|
16042
|
-
|
|
16043
|
-
// src/components/ScrollArea2.tsx
|
|
16044
|
-
import { ScrollArea as ScrollArea3 } from "@base-ui-components/react/scroll-area";
|
|
16045
|
-
import * as React92 from "react";
|
|
16046
|
-
var SCROLLBAR_STATE_CLASSES = "scroll-component n-opacity-0 n-transition-opacity n-delay-300 n-pointer-events-none data-[hovering]:n-opacity-100 data-[hovering]:n-delay-0 data-[hovering]:n-duration-75 data-[hovering]:n-pointer-events-auto data-[scrolling]:n-opacity-100 data-[scrolling]:n-delay-0 data-[scrolling]:n-duration-75 data-[scrolling]:n-pointer-events-auto";
|
|
16047
|
-
var SCROLLBAR_TRACK_VERTICAL = "n-m-1 n-w-1 flex n-justify-center n-rounded-md n-bg-divider-subtle";
|
|
16048
|
-
var SCROLLBAR_TRACK_HORIZONTAL = "n-m-1 n-h-1 flex n-justify-center n-rounded-md n-bg-divider-subtle";
|
|
16049
|
-
var SCROLLBAR_THUMB_VERTICAL = "scroll-component n-w-full n-rounded n-bg-scrollbar";
|
|
16050
|
-
var SCROLLBAR_THUMB_HORIZONTAL = "scroll-component n-h-full n-rounded n-bg-scrollbar";
|
|
16051
|
-
function ScrollArea22({
|
|
16052
|
-
children,
|
|
16053
|
-
className,
|
|
16054
|
-
viewportClassName,
|
|
16055
|
-
orientation = "vertical"
|
|
16056
|
-
}) {
|
|
16057
|
-
return /* @__PURE__ */ React92.createElement(ScrollArea3.Root, { className: cx("n-relative", className) }, /* @__PURE__ */ React92.createElement(
|
|
16058
|
-
ScrollArea3.Viewport,
|
|
16059
|
-
{
|
|
16060
|
-
className: cx("n-h-full n-overscroll-contain", viewportClassName)
|
|
16061
|
-
},
|
|
16062
|
-
children
|
|
16063
|
-
), (orientation === "vertical" || orientation === "both") && /* @__PURE__ */ React92.createElement(
|
|
16064
|
-
ScrollArea3.Scrollbar,
|
|
16065
|
-
{
|
|
16066
|
-
className: cx(SCROLLBAR_STATE_CLASSES, SCROLLBAR_TRACK_VERTICAL)
|
|
16067
|
-
},
|
|
16068
|
-
/* @__PURE__ */ React92.createElement(ScrollArea3.Thumb, { className: SCROLLBAR_THUMB_VERTICAL })
|
|
16069
|
-
), (orientation === "horizontal" || orientation === "both") && /* @__PURE__ */ React92.createElement(
|
|
16070
|
-
ScrollArea3.Scrollbar,
|
|
16071
|
-
{
|
|
16072
|
-
orientation: "horizontal",
|
|
16073
|
-
className: cx(SCROLLBAR_STATE_CLASSES, SCROLLBAR_TRACK_HORIZONTAL)
|
|
16074
|
-
},
|
|
16075
|
-
/* @__PURE__ */ React92.createElement(ScrollArea3.Thumb, { className: SCROLLBAR_THUMB_HORIZONTAL })
|
|
16076
|
-
), orientation === "both" && /* @__PURE__ */ React92.createElement(ScrollArea3.Corner, null));
|
|
16286
|
+
return /* @__PURE__ */ React93.createElement("div", { className: "n-relative n-flex n-flex-col n-flex-1 n-max-h-full" }, /* @__PURE__ */ React93.createElement(ScrollArea, null, children));
|
|
16077
16287
|
}
|
|
16078
16288
|
|
|
16079
16289
|
// src/components/Section.tsx
|
|
16080
|
-
import
|
|
16290
|
+
import React94, { memo as memo30, useMemo as useMemo38 } from "react";
|
|
16081
16291
|
var titleIconStyle = {
|
|
16082
16292
|
marginRight: "6px",
|
|
16083
16293
|
alignSelf: "flex-start",
|
|
@@ -16098,14 +16308,14 @@ function SectionHeader({
|
|
|
16098
16308
|
titleClassName,
|
|
16099
16309
|
onClickTitle
|
|
16100
16310
|
}) {
|
|
16101
|
-
const headerStyle =
|
|
16311
|
+
const headerStyle = useMemo38(
|
|
16102
16312
|
() => ({
|
|
16103
16313
|
minHeight: INPUT_HEIGHT,
|
|
16104
16314
|
...style2
|
|
16105
16315
|
}),
|
|
16106
16316
|
[style2]
|
|
16107
16317
|
);
|
|
16108
|
-
const titleElement = title ? /* @__PURE__ */
|
|
16318
|
+
const titleElement = title ? /* @__PURE__ */ React94.createElement(
|
|
16109
16319
|
InspectorPrimitives_exports.Title,
|
|
16110
16320
|
{
|
|
16111
16321
|
$textStyle: titleTextStyle,
|
|
@@ -16113,16 +16323,16 @@ function SectionHeader({
|
|
|
16113
16323
|
},
|
|
16114
16324
|
title
|
|
16115
16325
|
) : null;
|
|
16116
|
-
return /* @__PURE__ */
|
|
16326
|
+
return /* @__PURE__ */ React94.createElement(
|
|
16117
16327
|
InspectorPrimitives_exports.SectionHeader,
|
|
16118
16328
|
{
|
|
16119
16329
|
style: headerStyle,
|
|
16120
16330
|
className
|
|
16121
16331
|
},
|
|
16122
|
-
titleIcon && /* @__PURE__ */
|
|
16123
|
-
titleElement && /* @__PURE__ */
|
|
16124
|
-
headerSeparator === "space" && /* @__PURE__ */
|
|
16125
|
-
headerSeparator === "dot" && /* @__PURE__ */
|
|
16332
|
+
titleIcon && /* @__PURE__ */ React94.createElement("div", { style: titleIconStyle, className: textStyles[titleTextStyle] }, "\u200B", renderIcon(titleIcon)),
|
|
16333
|
+
titleElement && /* @__PURE__ */ React94.createElement(React94.Fragment, null, onClickTitle ? /* @__PURE__ */ React94.createElement(Button, { variant: "none", onClick: onClickTitle }, titleElement) : titleElement),
|
|
16334
|
+
headerSeparator === "space" && /* @__PURE__ */ React94.createElement(Spacer.Horizontal, null),
|
|
16335
|
+
headerSeparator === "dot" && /* @__PURE__ */ React94.createElement(
|
|
16126
16336
|
Text,
|
|
16127
16337
|
{
|
|
16128
16338
|
variant: titleTextStyle,
|
|
@@ -16148,7 +16358,7 @@ var SectionInternal = ({
|
|
|
16148
16358
|
titleClassName,
|
|
16149
16359
|
headerStyle: headerStyleProp
|
|
16150
16360
|
}) => {
|
|
16151
|
-
const style2 =
|
|
16361
|
+
const style2 = useMemo38(
|
|
16152
16362
|
() => ({
|
|
16153
16363
|
display: "flex",
|
|
16154
16364
|
flexDirection: "column",
|
|
@@ -16159,15 +16369,15 @@ var SectionInternal = ({
|
|
|
16159
16369
|
}),
|
|
16160
16370
|
[titleTextStyle, title, extraPadding, styleProp]
|
|
16161
16371
|
);
|
|
16162
|
-
const hasChildren =
|
|
16163
|
-
const headerStyle =
|
|
16372
|
+
const hasChildren = React94.Children.toArray(children).some((child) => !!child);
|
|
16373
|
+
const headerStyle = useMemo38(
|
|
16164
16374
|
() => ({
|
|
16165
16375
|
marginBottom: hasChildren ? "4px" : void 0,
|
|
16166
16376
|
...headerStyleProp
|
|
16167
16377
|
}),
|
|
16168
16378
|
[hasChildren, headerStyleProp]
|
|
16169
16379
|
);
|
|
16170
|
-
return /* @__PURE__ */
|
|
16380
|
+
return /* @__PURE__ */ React94.createElement("div", { style: style2, className }, (title || titleIcon || right) && /* @__PURE__ */ React94.createElement(
|
|
16171
16381
|
SectionHeader,
|
|
16172
16382
|
{
|
|
16173
16383
|
style: headerStyle,
|
|
@@ -16179,7 +16389,7 @@ var SectionInternal = ({
|
|
|
16179
16389
|
right,
|
|
16180
16390
|
headerSeparator
|
|
16181
16391
|
}
|
|
16182
|
-
), /* @__PURE__ */
|
|
16392
|
+
), /* @__PURE__ */ React94.createElement(IndentContext.Provider, { value: 0 }, children));
|
|
16183
16393
|
};
|
|
16184
16394
|
var ExpandableSection = ({
|
|
16185
16395
|
storageKey,
|
|
@@ -16192,12 +16402,12 @@ var ExpandableSection = ({
|
|
|
16192
16402
|
initialVisibility
|
|
16193
16403
|
);
|
|
16194
16404
|
const expanded = visibility === "show";
|
|
16195
|
-
return /* @__PURE__ */
|
|
16405
|
+
return /* @__PURE__ */ React94.createElement(
|
|
16196
16406
|
SectionInternal,
|
|
16197
16407
|
{
|
|
16198
16408
|
...props,
|
|
16199
16409
|
right: !props.hideRightWhenCollapsed || expanded ? props.right : null,
|
|
16200
|
-
title: /* @__PURE__ */
|
|
16410
|
+
title: /* @__PURE__ */ React94.createElement("div", { className: "n-flex n-gap-1 n-items-center" }, props.title, /* @__PURE__ */ React94.createElement(
|
|
16201
16411
|
IconButton,
|
|
16202
16412
|
{
|
|
16203
16413
|
iconName: expanded ? "ChevronDownIcon2" : "ChevronRightIcon2",
|
|
@@ -16208,21 +16418,21 @@ var ExpandableSection = ({
|
|
|
16208
16418
|
expanded && props.children
|
|
16209
16419
|
);
|
|
16210
16420
|
};
|
|
16211
|
-
var Section =
|
|
16421
|
+
var Section = memo30(function InspectorSection({
|
|
16212
16422
|
storageKey,
|
|
16213
16423
|
...props
|
|
16214
16424
|
}) {
|
|
16215
|
-
return storageKey ? /* @__PURE__ */
|
|
16425
|
+
return storageKey ? /* @__PURE__ */ React94.createElement(ExpandableSection, { ...props, storageKey }) : /* @__PURE__ */ React94.createElement(SectionInternal, { ...props });
|
|
16216
16426
|
});
|
|
16217
16427
|
|
|
16218
16428
|
// src/components/SegmentedControl.tsx
|
|
16219
16429
|
import { ToggleGroup as ToggleGroupPrimitive2 } from "radix-ui";
|
|
16220
|
-
import
|
|
16430
|
+
import React95, {
|
|
16221
16431
|
createContext as createContext13,
|
|
16222
16432
|
forwardRef as forwardRef27,
|
|
16223
|
-
useCallback as
|
|
16224
|
-
useContext as
|
|
16225
|
-
useMemo as
|
|
16433
|
+
useCallback as useCallback35,
|
|
16434
|
+
useContext as useContext14,
|
|
16435
|
+
useMemo as useMemo39
|
|
16226
16436
|
} from "react";
|
|
16227
16437
|
var SegmentedControlContext = createContext13({
|
|
16228
16438
|
colorScheme: "primary"
|
|
@@ -16237,8 +16447,8 @@ var SegmentedControlItem = forwardRef27(function SegmentedControlItem2({
|
|
|
16237
16447
|
variant = "default",
|
|
16238
16448
|
...props
|
|
16239
16449
|
}, forwardedRef) {
|
|
16240
|
-
const { colorScheme } =
|
|
16241
|
-
const itemElement = /* @__PURE__ */
|
|
16450
|
+
const { colorScheme } = useContext14(SegmentedControlContext);
|
|
16451
|
+
const itemElement = /* @__PURE__ */ React95.createElement(
|
|
16242
16452
|
ToggleGroupPrimitive2.Item,
|
|
16243
16453
|
{
|
|
16244
16454
|
ref: forwardedRef,
|
|
@@ -16269,7 +16479,7 @@ var SegmentedControlItem = forwardRef27(function SegmentedControlItem2({
|
|
|
16269
16479
|
),
|
|
16270
16480
|
...props
|
|
16271
16481
|
},
|
|
16272
|
-
/* @__PURE__ */
|
|
16482
|
+
/* @__PURE__ */ React95.createElement(
|
|
16273
16483
|
"span",
|
|
16274
16484
|
{
|
|
16275
16485
|
className: cx(
|
|
@@ -16281,7 +16491,7 @@ var SegmentedControlItem = forwardRef27(function SegmentedControlItem2({
|
|
|
16281
16491
|
title
|
|
16282
16492
|
)
|
|
16283
16493
|
);
|
|
16284
|
-
return tooltip ? /* @__PURE__ */
|
|
16494
|
+
return tooltip ? /* @__PURE__ */ React95.createElement(Tooltip, { content: tooltip }, itemElement) : itemElement;
|
|
16285
16495
|
});
|
|
16286
16496
|
var SegmentedControl = memoGeneric(function SegmentedControl2({
|
|
16287
16497
|
id: idProp,
|
|
@@ -16294,16 +16504,16 @@ var SegmentedControl = memoGeneric(function SegmentedControl2({
|
|
|
16294
16504
|
className,
|
|
16295
16505
|
style: style2
|
|
16296
16506
|
}) {
|
|
16297
|
-
const contextValue =
|
|
16507
|
+
const contextValue = useMemo39(() => ({ colorScheme }), [colorScheme]);
|
|
16298
16508
|
const { fieldId: id } = useLabel({ fieldId: idProp });
|
|
16299
|
-
const handleValueChange =
|
|
16509
|
+
const handleValueChange = useCallback35(
|
|
16300
16510
|
(value2) => {
|
|
16301
16511
|
if (!allowEmpty && !value2) return;
|
|
16302
16512
|
onValueChange?.(value2);
|
|
16303
16513
|
},
|
|
16304
16514
|
[allowEmpty, onValueChange]
|
|
16305
16515
|
);
|
|
16306
|
-
return /* @__PURE__ */
|
|
16516
|
+
return /* @__PURE__ */ React95.createElement(SegmentedControlContext.Provider, { value: contextValue }, /* @__PURE__ */ React95.createElement(
|
|
16307
16517
|
ToggleGroupPrimitive2.Root,
|
|
16308
16518
|
{
|
|
16309
16519
|
id,
|
|
@@ -16322,13 +16532,13 @@ var SegmentedControl = memoGeneric(function SegmentedControl2({
|
|
|
16322
16532
|
gridTemplateColumns: `repeat(${items.length}, 1fr)`
|
|
16323
16533
|
}
|
|
16324
16534
|
},
|
|
16325
|
-
items.map((item, index) => /* @__PURE__ */
|
|
16535
|
+
items.map((item, index) => /* @__PURE__ */ React95.createElement(SegmentedControlItem, { key: index, ...item, variant }))
|
|
16326
16536
|
));
|
|
16327
16537
|
});
|
|
16328
16538
|
|
|
16329
16539
|
// src/components/SelectionToolbar.tsx
|
|
16330
16540
|
import * as PopperPrimitive from "@radix-ui/react-popper";
|
|
16331
|
-
import
|
|
16541
|
+
import React96, { memo as memo31, useMemo as useMemo40 } from "react";
|
|
16332
16542
|
import { createPortal as createPortal3 } from "react-dom";
|
|
16333
16543
|
var createVirtualElement = (rect) => ({
|
|
16334
16544
|
getBoundingClientRect: () => ({
|
|
@@ -16343,7 +16553,7 @@ var createVirtualElement = (rect) => ({
|
|
|
16343
16553
|
toJSON: () => null
|
|
16344
16554
|
})
|
|
16345
16555
|
});
|
|
16346
|
-
var SelectionToolbarContainer =
|
|
16556
|
+
var SelectionToolbarContainer = memo31(
|
|
16347
16557
|
function SelectionToolbarContainer2({
|
|
16348
16558
|
rect,
|
|
16349
16559
|
children,
|
|
@@ -16357,15 +16567,15 @@ var SelectionToolbarContainer = memo32(
|
|
|
16357
16567
|
transitionDuration = 0.2
|
|
16358
16568
|
}) {
|
|
16359
16569
|
const portalScopeId = usePortalScopeId();
|
|
16360
|
-
const containerRef =
|
|
16570
|
+
const containerRef = React96.useRef(null);
|
|
16361
16571
|
const size = useSize(containerRef, "width");
|
|
16362
|
-
const virtualRef =
|
|
16572
|
+
const virtualRef = useMemo40(
|
|
16363
16573
|
() => ({
|
|
16364
16574
|
current: createVirtualElement(rect)
|
|
16365
16575
|
}),
|
|
16366
16576
|
[rect]
|
|
16367
16577
|
);
|
|
16368
|
-
const popperContent = /* @__PURE__ */
|
|
16578
|
+
const popperContent = /* @__PURE__ */ React96.createElement(
|
|
16369
16579
|
PopperPrimitive.Content,
|
|
16370
16580
|
{
|
|
16371
16581
|
...portalScopeProps(portalScopeId),
|
|
@@ -16383,7 +16593,7 @@ var SelectionToolbarContainer = memo32(
|
|
|
16383
16593
|
[cssVarNames.colors.buttonBackground]: "transparent"
|
|
16384
16594
|
}
|
|
16385
16595
|
},
|
|
16386
|
-
/* @__PURE__ */
|
|
16596
|
+
/* @__PURE__ */ React96.createElement(
|
|
16387
16597
|
"div",
|
|
16388
16598
|
{
|
|
16389
16599
|
ref: containerRef,
|
|
@@ -16400,7 +16610,7 @@ var SelectionToolbarContainer = memo32(
|
|
|
16400
16610
|
children
|
|
16401
16611
|
)
|
|
16402
16612
|
);
|
|
16403
|
-
return /* @__PURE__ */
|
|
16613
|
+
return /* @__PURE__ */ React96.createElement(PopperPrimitive.Root, null, /* @__PURE__ */ React96.createElement(PopperPrimitive.Anchor, { virtualRef }), portalContainer ? createPortal3(popperContent, portalContainer) : popperContent);
|
|
16404
16614
|
}
|
|
16405
16615
|
);
|
|
16406
16616
|
|
|
@@ -16411,9 +16621,9 @@ import {
|
|
|
16411
16621
|
DropdownChevronIcon as DropdownChevronIcon3
|
|
16412
16622
|
} from "@noya-app/noya-icons";
|
|
16413
16623
|
import { Select } from "radix-ui";
|
|
16414
|
-
import
|
|
16415
|
-
useMemo as
|
|
16416
|
-
useState as
|
|
16624
|
+
import React97, {
|
|
16625
|
+
useMemo as useMemo41,
|
|
16626
|
+
useState as useState34
|
|
16417
16627
|
} from "react";
|
|
16418
16628
|
var readOnlyStyle = {
|
|
16419
16629
|
justifyContent: "flex-start",
|
|
@@ -16437,7 +16647,7 @@ var SelectMenuTrigger = memoGeneric(function SelectMenuTrigger2({
|
|
|
16437
16647
|
fieldId: props.id
|
|
16438
16648
|
});
|
|
16439
16649
|
const labelType = useLabelType();
|
|
16440
|
-
return /* @__PURE__ */
|
|
16650
|
+
return /* @__PURE__ */ React97.createElement(Select.SelectTrigger, { asChild: true, onFocus, onBlur }, /* @__PURE__ */ React97.createElement(
|
|
16441
16651
|
Button,
|
|
16442
16652
|
{
|
|
16443
16653
|
id,
|
|
@@ -16449,10 +16659,10 @@ var SelectMenuTrigger = memoGeneric(function SelectMenuTrigger2({
|
|
|
16449
16659
|
),
|
|
16450
16660
|
disabled
|
|
16451
16661
|
},
|
|
16452
|
-
icon && /* @__PURE__ */
|
|
16453
|
-
label && labelType === "inset" && /* @__PURE__ */
|
|
16454
|
-
/* @__PURE__ */
|
|
16455
|
-
/* @__PURE__ */
|
|
16662
|
+
icon && /* @__PURE__ */ React97.createElement("span", { className: "n-pr-1.5" }, renderIcon(icon)),
|
|
16663
|
+
label && labelType === "inset" && /* @__PURE__ */ React97.createElement("div", { className: insetEndStyles }, /* @__PURE__ */ React97.createElement(Label, { className: "n-pr-4 n-text-text-disabled", htmlFor: id }, label)),
|
|
16664
|
+
/* @__PURE__ */ React97.createElement("span", { className: "n-flex-1 n-flex" }, /* @__PURE__ */ React97.createElement(Select.Value, { placeholder })),
|
|
16665
|
+
/* @__PURE__ */ React97.createElement(
|
|
16456
16666
|
DropdownChevronIcon3,
|
|
16457
16667
|
{
|
|
16458
16668
|
className: cx(
|
|
@@ -16489,7 +16699,7 @@ var SelectMenu = memoGeneric(function SelectMenu2({
|
|
|
16489
16699
|
(item) => isSelectableMenuItem(item) && item.value === value
|
|
16490
16700
|
);
|
|
16491
16701
|
const icon = selectedItem?.icon;
|
|
16492
|
-
const [internalOpen, setInternalOpen] =
|
|
16702
|
+
const [internalOpen, setInternalOpen] = useState34(open);
|
|
16493
16703
|
const { label, fieldId: id } = useLabel({
|
|
16494
16704
|
label: props.label,
|
|
16495
16705
|
fieldId: props.id
|
|
@@ -16500,8 +16710,8 @@ var SelectMenu = memoGeneric(function SelectMenu2({
|
|
|
16500
16710
|
}
|
|
16501
16711
|
setInternalOpen(open2);
|
|
16502
16712
|
};
|
|
16503
|
-
const readOnlyButton =
|
|
16504
|
-
() => /* @__PURE__ */
|
|
16713
|
+
const readOnlyButton = useMemo41(
|
|
16714
|
+
() => /* @__PURE__ */ React97.createElement(
|
|
16505
16715
|
Button,
|
|
16506
16716
|
{
|
|
16507
16717
|
id,
|
|
@@ -16511,11 +16721,11 @@ var SelectMenu = memoGeneric(function SelectMenu2({
|
|
|
16511
16721
|
disabled
|
|
16512
16722
|
},
|
|
16513
16723
|
icon && renderIcon(icon),
|
|
16514
|
-
/* @__PURE__ */
|
|
16724
|
+
/* @__PURE__ */ React97.createElement("span", { className: "n-flex n-flex-1" }, selectedItem?.title ?? value)
|
|
16515
16725
|
),
|
|
16516
16726
|
[icon, id, style2, className, disabled, value, selectedItem]
|
|
16517
16727
|
);
|
|
16518
|
-
const contentStyle =
|
|
16728
|
+
const contentStyle = useMemo41(() => {
|
|
16519
16729
|
return {
|
|
16520
16730
|
width: "var(--radix-select-trigger-width)",
|
|
16521
16731
|
minWidth: "max-content",
|
|
@@ -16523,7 +16733,7 @@ var SelectMenu = memoGeneric(function SelectMenu2({
|
|
|
16523
16733
|
...contentStyleProp
|
|
16524
16734
|
};
|
|
16525
16735
|
}, [contentStyleProp]);
|
|
16526
|
-
const content = /* @__PURE__ */
|
|
16736
|
+
const content = /* @__PURE__ */ React97.createElement(
|
|
16527
16737
|
Select.Root,
|
|
16528
16738
|
{
|
|
16529
16739
|
value,
|
|
@@ -16531,7 +16741,7 @@ var SelectMenu = memoGeneric(function SelectMenu2({
|
|
|
16531
16741
|
open,
|
|
16532
16742
|
onOpenChange: handleOpenChange
|
|
16533
16743
|
},
|
|
16534
|
-
/* @__PURE__ */
|
|
16744
|
+
/* @__PURE__ */ React97.createElement(
|
|
16535
16745
|
SelectMenuTrigger,
|
|
16536
16746
|
{
|
|
16537
16747
|
id,
|
|
@@ -16546,7 +16756,7 @@ var SelectMenu = memoGeneric(function SelectMenu2({
|
|
|
16546
16756
|
label
|
|
16547
16757
|
}
|
|
16548
16758
|
),
|
|
16549
|
-
/* @__PURE__ */
|
|
16759
|
+
/* @__PURE__ */ React97.createElement(Select.Portal, null, /* @__PURE__ */ React97.createElement(
|
|
16550
16760
|
Select.Content,
|
|
16551
16761
|
{
|
|
16552
16762
|
...portalScopeProps(portalScopeId),
|
|
@@ -16557,14 +16767,14 @@ var SelectMenu = memoGeneric(function SelectMenu2({
|
|
|
16557
16767
|
align: "center",
|
|
16558
16768
|
style: contentStyle
|
|
16559
16769
|
},
|
|
16560
|
-
/* @__PURE__ */
|
|
16770
|
+
/* @__PURE__ */ React97.createElement(Select.ScrollUpButton, { className: scrollButtonStyles }, /* @__PURE__ */ React97.createElement(
|
|
16561
16771
|
ChevronUpIcon,
|
|
16562
16772
|
{
|
|
16563
16773
|
className: cx("n-transition-transform n-duration-100")
|
|
16564
16774
|
}
|
|
16565
16775
|
)),
|
|
16566
|
-
/* @__PURE__ */
|
|
16567
|
-
/* @__PURE__ */
|
|
16776
|
+
/* @__PURE__ */ React97.createElement(Select.Viewport, null, /* @__PURE__ */ React97.createElement(MenuViewport, { items, Components: Components3 })),
|
|
16777
|
+
/* @__PURE__ */ React97.createElement(Select.ScrollDownButton, { className: scrollButtonStyles }, /* @__PURE__ */ React97.createElement(ChevronDownIcon, null))
|
|
16568
16778
|
))
|
|
16569
16779
|
);
|
|
16570
16780
|
return readOnly ? readOnlyButton : content;
|
|
@@ -16572,12 +16782,12 @@ var SelectMenu = memoGeneric(function SelectMenu2({
|
|
|
16572
16782
|
|
|
16573
16783
|
// src/components/Slider.tsx
|
|
16574
16784
|
import { Slider as RadixSlider } from "radix-ui";
|
|
16575
|
-
import
|
|
16785
|
+
import React98, { memo as memo32, useCallback as useCallback36, useMemo as useMemo42 } from "react";
|
|
16576
16786
|
var THUMB_WIDTH = 8;
|
|
16577
16787
|
var thumbStyle = {
|
|
16578
16788
|
width: THUMB_WIDTH
|
|
16579
16789
|
};
|
|
16580
|
-
var Slider =
|
|
16790
|
+
var Slider = memo32(function Slider2({
|
|
16581
16791
|
style: style2,
|
|
16582
16792
|
className,
|
|
16583
16793
|
value,
|
|
@@ -16591,21 +16801,21 @@ var Slider = memo33(function Slider2({
|
|
|
16591
16801
|
readOnly = false,
|
|
16592
16802
|
...props
|
|
16593
16803
|
}) {
|
|
16594
|
-
const arrayValue =
|
|
16804
|
+
const arrayValue = useMemo42(
|
|
16595
16805
|
() => [Math.min(Math.max(value, min), max)],
|
|
16596
16806
|
[value, min, max]
|
|
16597
16807
|
);
|
|
16598
16808
|
const { fieldId: id } = useLabel({
|
|
16599
16809
|
fieldId: props.id
|
|
16600
16810
|
});
|
|
16601
|
-
const handleValueChange =
|
|
16811
|
+
const handleValueChange = useCallback36(
|
|
16602
16812
|
(arrayValue2) => {
|
|
16603
16813
|
onValueChange(arrayValue2[0]);
|
|
16604
16814
|
},
|
|
16605
16815
|
[onValueChange]
|
|
16606
16816
|
);
|
|
16607
16817
|
const ratio = (arrayValue[0] - min) / (max - min);
|
|
16608
|
-
return /* @__PURE__ */
|
|
16818
|
+
return /* @__PURE__ */ React98.createElement(
|
|
16609
16819
|
RadixSlider.Root,
|
|
16610
16820
|
{
|
|
16611
16821
|
min,
|
|
@@ -16623,7 +16833,7 @@ var Slider = memo33(function Slider2({
|
|
|
16623
16833
|
onBlur,
|
|
16624
16834
|
disabled: readOnly
|
|
16625
16835
|
},
|
|
16626
|
-
/* @__PURE__ */
|
|
16836
|
+
/* @__PURE__ */ React98.createElement("div", { className: "n-relative n-flex-grow n-h-[3px] n-overflow-hidden" }, /* @__PURE__ */ React98.createElement(
|
|
16627
16837
|
"div",
|
|
16628
16838
|
{
|
|
16629
16839
|
className: "n-absolute n-h-full n-rounded-l n-bg-slider-active-background",
|
|
@@ -16632,7 +16842,7 @@ var Slider = memo33(function Slider2({
|
|
|
16632
16842
|
width: `calc(${ratio * 100}% - ${ratio * 8}px - 2px)`
|
|
16633
16843
|
}
|
|
16634
16844
|
}
|
|
16635
|
-
), /* @__PURE__ */
|
|
16845
|
+
), /* @__PURE__ */ React98.createElement(
|
|
16636
16846
|
"div",
|
|
16637
16847
|
{
|
|
16638
16848
|
className: "n-absolute n-h-full n-rounded-r n-bg-input-background",
|
|
@@ -16642,7 +16852,7 @@ var Slider = memo33(function Slider2({
|
|
|
16642
16852
|
}
|
|
16643
16853
|
}
|
|
16644
16854
|
)),
|
|
16645
|
-
/* @__PURE__ */
|
|
16855
|
+
/* @__PURE__ */ React98.createElement(
|
|
16646
16856
|
RadixSlider.Thumb,
|
|
16647
16857
|
{
|
|
16648
16858
|
style: thumbStyle,
|
|
@@ -16660,28 +16870,28 @@ var Slider = memo33(function Slider2({
|
|
|
16660
16870
|
});
|
|
16661
16871
|
|
|
16662
16872
|
// src/components/sorting/createSharedDrag.tsx
|
|
16663
|
-
import * as
|
|
16873
|
+
import * as React99 from "react";
|
|
16664
16874
|
function createSharedDrag() {
|
|
16665
|
-
const dragRegistrationContext =
|
|
16666
|
-
const activeDragContext =
|
|
16875
|
+
const dragRegistrationContext = React99.createContext(null);
|
|
16876
|
+
const activeDragContext = React99.createContext(
|
|
16667
16877
|
null
|
|
16668
16878
|
);
|
|
16669
16879
|
const sharedDragProps = {
|
|
16670
16880
|
dragRegistrationContext,
|
|
16671
16881
|
activeDragContext
|
|
16672
16882
|
};
|
|
16673
|
-
const Provider = (props) => /* @__PURE__ */
|
|
16883
|
+
const Provider = (props) => /* @__PURE__ */ React99.createElement(SharedDragProvider, { sharedDragProps, ...props });
|
|
16674
16884
|
return {
|
|
16675
16885
|
Provider,
|
|
16676
|
-
Sortable: (props) => /* @__PURE__ */
|
|
16886
|
+
Sortable: (props) => /* @__PURE__ */ React99.createElement(Sortable, { sharedDragProps, ...props }),
|
|
16677
16887
|
props: sharedDragProps
|
|
16678
16888
|
};
|
|
16679
16889
|
}
|
|
16680
16890
|
|
|
16681
16891
|
// src/components/Stepper.tsx
|
|
16682
16892
|
import { clamp as clamp7 } from "@noya-app/noya-utils";
|
|
16683
|
-
import
|
|
16684
|
-
var Stepper =
|
|
16893
|
+
import React100, { memo as memo33, useCallback as useCallback37, useMemo as useMemo43 } from "react";
|
|
16894
|
+
var Stepper = memo33(function Stepper2({
|
|
16685
16895
|
style: style2,
|
|
16686
16896
|
className,
|
|
16687
16897
|
value: valueProp,
|
|
@@ -16698,17 +16908,17 @@ var Stepper = memo34(function Stepper2({
|
|
|
16698
16908
|
const { fieldId: id } = useLabel({
|
|
16699
16909
|
fieldId: props.id
|
|
16700
16910
|
});
|
|
16701
|
-
const value =
|
|
16911
|
+
const value = useMemo43(() => {
|
|
16702
16912
|
return clamp7(valueProp, min, max);
|
|
16703
16913
|
}, [valueProp, min, max]);
|
|
16704
|
-
const handleValueChange =
|
|
16914
|
+
const handleValueChange = useCallback37(
|
|
16705
16915
|
(value2) => {
|
|
16706
16916
|
const newValue = clamp7(value2, min, max);
|
|
16707
16917
|
onValueChange(newValue);
|
|
16708
16918
|
},
|
|
16709
16919
|
[onValueChange, min, max]
|
|
16710
16920
|
);
|
|
16711
|
-
return /* @__PURE__ */
|
|
16921
|
+
return /* @__PURE__ */ React100.createElement(
|
|
16712
16922
|
"div",
|
|
16713
16923
|
{
|
|
16714
16924
|
id,
|
|
@@ -16720,7 +16930,7 @@ var Stepper = memo34(function Stepper2({
|
|
|
16720
16930
|
onFocus,
|
|
16721
16931
|
onBlur
|
|
16722
16932
|
},
|
|
16723
|
-
/* @__PURE__ */
|
|
16933
|
+
/* @__PURE__ */ React100.createElement(
|
|
16724
16934
|
InputField2.Root,
|
|
16725
16935
|
{
|
|
16726
16936
|
className: "n-flex-1",
|
|
@@ -16728,7 +16938,7 @@ var Stepper = memo34(function Stepper2({
|
|
|
16728
16938
|
startClassName: "-n-ml-[3px]",
|
|
16729
16939
|
endWidth: 17,
|
|
16730
16940
|
endClassName: "-n-mr-[3px]",
|
|
16731
|
-
start: /* @__PURE__ */
|
|
16941
|
+
start: /* @__PURE__ */ React100.createElement(
|
|
16732
16942
|
IconButton,
|
|
16733
16943
|
{
|
|
16734
16944
|
iconName: "MinusIcon",
|
|
@@ -16742,7 +16952,7 @@ var Stepper = memo34(function Stepper2({
|
|
|
16742
16952
|
}
|
|
16743
16953
|
}
|
|
16744
16954
|
),
|
|
16745
|
-
end: /* @__PURE__ */
|
|
16955
|
+
end: /* @__PURE__ */ React100.createElement(
|
|
16746
16956
|
IconButton,
|
|
16747
16957
|
{
|
|
16748
16958
|
iconName: "PlusIcon",
|
|
@@ -16757,7 +16967,7 @@ var Stepper = memo34(function Stepper2({
|
|
|
16757
16967
|
}
|
|
16758
16968
|
)
|
|
16759
16969
|
},
|
|
16760
|
-
/* @__PURE__ */
|
|
16970
|
+
/* @__PURE__ */ React100.createElement(
|
|
16761
16971
|
InputField2.NumberInput,
|
|
16762
16972
|
{
|
|
16763
16973
|
value,
|
|
@@ -16772,7 +16982,7 @@ var Stepper = memo34(function Stepper2({
|
|
|
16772
16982
|
|
|
16773
16983
|
// src/components/Switch.tsx
|
|
16774
16984
|
import { Switch as SwitchPrimitive } from "radix-ui";
|
|
16775
|
-
import * as
|
|
16985
|
+
import * as React101 from "react";
|
|
16776
16986
|
var Switch = function Switch2({
|
|
16777
16987
|
id,
|
|
16778
16988
|
value,
|
|
@@ -16784,7 +16994,7 @@ var Switch = function Switch2({
|
|
|
16784
16994
|
style: style2,
|
|
16785
16995
|
className
|
|
16786
16996
|
}) {
|
|
16787
|
-
return /* @__PURE__ */
|
|
16997
|
+
return /* @__PURE__ */ React101.createElement(
|
|
16788
16998
|
SwitchPrimitive.Root,
|
|
16789
16999
|
{
|
|
16790
17000
|
id,
|
|
@@ -16803,12 +17013,12 @@ var Switch = function Switch2({
|
|
|
16803
17013
|
onFocus,
|
|
16804
17014
|
onBlur
|
|
16805
17015
|
},
|
|
16806
|
-
/* @__PURE__ */
|
|
17016
|
+
/* @__PURE__ */ React101.createElement(SwitchPrimitive.Thumb, { className: "n-block n-w-[15px] n-h-[15px] n-bg-background n-rounded-full n-transition-transform n-translate-x-[2px] data-[state=checked]:n-translate-x-[15px]" })
|
|
16807
17017
|
);
|
|
16808
17018
|
};
|
|
16809
17019
|
|
|
16810
17020
|
// src/components/Tabs.tsx
|
|
16811
|
-
import * as
|
|
17021
|
+
import * as React102 from "react";
|
|
16812
17022
|
function Tabs({
|
|
16813
17023
|
value,
|
|
16814
17024
|
onValueChange,
|
|
@@ -16823,7 +17033,7 @@ function Tabs({
|
|
|
16823
17033
|
value,
|
|
16824
17034
|
onChange: onValueChange
|
|
16825
17035
|
});
|
|
16826
|
-
return /* @__PURE__ */
|
|
17036
|
+
return /* @__PURE__ */ React102.createElement("div", { ...props, className: cx("n-flex n-flex-col", props.className) }, /* @__PURE__ */ React102.createElement("div", { className: "n-flex n-flex-row n-px-3" }, /* @__PURE__ */ React102.createElement(
|
|
16827
17037
|
SegmentedControl,
|
|
16828
17038
|
{
|
|
16829
17039
|
className: "n-flex-1",
|
|
@@ -16832,11 +17042,11 @@ function Tabs({
|
|
|
16832
17042
|
variant,
|
|
16833
17043
|
items: selectableItems
|
|
16834
17044
|
}
|
|
16835
|
-
)), /* @__PURE__ */
|
|
17045
|
+
)), /* @__PURE__ */ React102.createElement(Divider, null), renderContent({ value: activeTab }));
|
|
16836
17046
|
}
|
|
16837
17047
|
|
|
16838
17048
|
// src/components/UserPicker.tsx
|
|
16839
|
-
import
|
|
17049
|
+
import React103, { useCallback as useCallback38, useMemo as useMemo44, useState as useState35 } from "react";
|
|
16840
17050
|
function UserPicker({
|
|
16841
17051
|
users,
|
|
16842
17052
|
value,
|
|
@@ -16846,27 +17056,27 @@ function UserPicker({
|
|
|
16846
17056
|
placeholder = "Search users...",
|
|
16847
17057
|
...rest
|
|
16848
17058
|
}) {
|
|
16849
|
-
const sortedUsers =
|
|
17059
|
+
const sortedUsers = useMemo44(() => {
|
|
16850
17060
|
return [...users].sort(
|
|
16851
17061
|
(a, b) => getUserDisplayName(a).localeCompare(getUserDisplayName(b), void 0, {
|
|
16852
17062
|
sensitivity: "base"
|
|
16853
17063
|
})
|
|
16854
17064
|
);
|
|
16855
17065
|
}, [users]);
|
|
16856
|
-
const usersById =
|
|
17066
|
+
const usersById = useMemo44(() => {
|
|
16857
17067
|
return new Map(sortedUsers.map((user) => [user.id, user]));
|
|
16858
17068
|
}, [sortedUsers]);
|
|
16859
|
-
const items =
|
|
17069
|
+
const items = useMemo44(() => {
|
|
16860
17070
|
return sortedUsers.map(createUserMenuItem);
|
|
16861
17071
|
}, [sortedUsers]);
|
|
16862
17072
|
const isControlled = value !== void 0;
|
|
16863
|
-
const [uncontrolledValue, setUncontrolledValue] =
|
|
17073
|
+
const [uncontrolledValue, setUncontrolledValue] = useState35(defaultValue2);
|
|
16864
17074
|
const selectedUserId = isControlled ? value : uncontrolledValue;
|
|
16865
|
-
const selectedItem =
|
|
17075
|
+
const selectedItem = useMemo44(() => {
|
|
16866
17076
|
if (!selectedUserId) return void 0;
|
|
16867
17077
|
return items.find((item) => item.value === selectedUserId);
|
|
16868
17078
|
}, [items, selectedUserId]);
|
|
16869
|
-
const updateSelectedUserId =
|
|
17079
|
+
const updateSelectedUserId = useCallback38(
|
|
16870
17080
|
(userId) => {
|
|
16871
17081
|
if (!isControlled) {
|
|
16872
17082
|
setUncontrolledValue(userId);
|
|
@@ -16875,14 +17085,14 @@ function UserPicker({
|
|
|
16875
17085
|
},
|
|
16876
17086
|
[isControlled, onChangeUserId]
|
|
16877
17087
|
);
|
|
16878
|
-
const handleSelectItem =
|
|
17088
|
+
const handleSelectItem = useCallback38(
|
|
16879
17089
|
(item) => {
|
|
16880
17090
|
updateSelectedUserId(item.value);
|
|
16881
17091
|
onSelectUser?.(usersById.get(item.value));
|
|
16882
17092
|
},
|
|
16883
17093
|
[updateSelectedUserId, onSelectUser, usersById]
|
|
16884
17094
|
);
|
|
16885
|
-
return /* @__PURE__ */
|
|
17095
|
+
return /* @__PURE__ */ React103.createElement(
|
|
16886
17096
|
Combobox,
|
|
16887
17097
|
{
|
|
16888
17098
|
...rest,
|
|
@@ -16906,7 +17116,7 @@ function createUserMenuItem(user) {
|
|
|
16906
17116
|
return {
|
|
16907
17117
|
value: user.id,
|
|
16908
17118
|
title,
|
|
16909
|
-
icon: /* @__PURE__ */
|
|
17119
|
+
icon: /* @__PURE__ */ React103.createElement("div", { className: "n-relative n-w-[15px] n-h-[15px]" }, /* @__PURE__ */ React103.createElement(
|
|
16910
17120
|
Avatar,
|
|
16911
17121
|
{
|
|
16912
17122
|
size: 15 + overflow * 2,
|
|
@@ -16925,15 +17135,15 @@ function createUserMenuItem(user) {
|
|
|
16925
17135
|
}
|
|
16926
17136
|
|
|
16927
17137
|
// src/components/UserPointer.tsx
|
|
16928
|
-
import
|
|
16929
|
-
var UserPointerContainer =
|
|
17138
|
+
import React104, { memo as memo34, useMemo as useMemo45 } from "react";
|
|
17139
|
+
var UserPointerContainer = memo34(function UserPointerContainer2({
|
|
16930
17140
|
point,
|
|
16931
17141
|
visible,
|
|
16932
17142
|
children,
|
|
16933
17143
|
className,
|
|
16934
17144
|
style: style2
|
|
16935
17145
|
}) {
|
|
16936
|
-
return /* @__PURE__ */
|
|
17146
|
+
return /* @__PURE__ */ React104.createElement(
|
|
16937
17147
|
"div",
|
|
16938
17148
|
{
|
|
16939
17149
|
style: {
|
|
@@ -16950,7 +17160,7 @@ var UserPointerContainer = memo35(function UserPointerContainer2({
|
|
|
16950
17160
|
children
|
|
16951
17161
|
);
|
|
16952
17162
|
});
|
|
16953
|
-
var UserNameTag =
|
|
17163
|
+
var UserNameTag = memo34(function UserNameTag2({
|
|
16954
17164
|
backgroundColor,
|
|
16955
17165
|
className,
|
|
16956
17166
|
style: style2,
|
|
@@ -16959,7 +17169,7 @@ var UserNameTag = memo35(function UserNameTag2({
|
|
|
16959
17169
|
size = "medium",
|
|
16960
17170
|
bordered = true
|
|
16961
17171
|
}) {
|
|
16962
|
-
return /* @__PURE__ */
|
|
17172
|
+
return /* @__PURE__ */ React104.createElement(
|
|
16963
17173
|
"span",
|
|
16964
17174
|
{
|
|
16965
17175
|
className: cx(
|
|
@@ -16978,14 +17188,14 @@ var UserNameTag = memo35(function UserNameTag2({
|
|
|
16978
17188
|
children
|
|
16979
17189
|
);
|
|
16980
17190
|
});
|
|
16981
|
-
var UserPointerIcon =
|
|
17191
|
+
var UserPointerIcon = memo34(function PointerIcon({
|
|
16982
17192
|
size,
|
|
16983
17193
|
color = "black",
|
|
16984
17194
|
className,
|
|
16985
17195
|
style: style2
|
|
16986
17196
|
}) {
|
|
16987
17197
|
const points = "0,5 10,0 10,10";
|
|
16988
|
-
return /* @__PURE__ */
|
|
17198
|
+
return /* @__PURE__ */ React104.createElement(
|
|
16989
17199
|
"svg",
|
|
16990
17200
|
{
|
|
16991
17201
|
width: size,
|
|
@@ -17000,7 +17210,7 @@ var UserPointerIcon = memo35(function PointerIcon({
|
|
|
17000
17210
|
...style2
|
|
17001
17211
|
}
|
|
17002
17212
|
},
|
|
17003
|
-
/* @__PURE__ */
|
|
17213
|
+
/* @__PURE__ */ React104.createElement(
|
|
17004
17214
|
"polygon",
|
|
17005
17215
|
{
|
|
17006
17216
|
points,
|
|
@@ -17013,7 +17223,7 @@ var UserPointerIcon = memo35(function PointerIcon({
|
|
|
17013
17223
|
});
|
|
17014
17224
|
var POINTER_SIZE = 12;
|
|
17015
17225
|
var POINTER_OVERLAP = 6;
|
|
17016
|
-
var UserPointer =
|
|
17226
|
+
var UserPointer = memo34(function UserPointer2({
|
|
17017
17227
|
userId,
|
|
17018
17228
|
name,
|
|
17019
17229
|
visible = true,
|
|
@@ -17026,22 +17236,22 @@ var UserPointer = memo35(function UserPointer2({
|
|
|
17026
17236
|
labelSize = "medium",
|
|
17027
17237
|
bordered = true
|
|
17028
17238
|
}) {
|
|
17029
|
-
const userBackgroundColor =
|
|
17239
|
+
const userBackgroundColor = useMemo45(
|
|
17030
17240
|
() => backgroundColor ?? colorFromString(userId ?? name ?? ""),
|
|
17031
17241
|
[backgroundColor, userId, name]
|
|
17032
17242
|
);
|
|
17033
|
-
const pointerOverlapStyle =
|
|
17243
|
+
const pointerOverlapStyle = useMemo45(
|
|
17034
17244
|
() => ({
|
|
17035
17245
|
marginRight: `-${POINTER_OVERLAP}px`,
|
|
17036
17246
|
marginBottom: `-${POINTER_OVERLAP}px`
|
|
17037
17247
|
}),
|
|
17038
17248
|
[]
|
|
17039
17249
|
);
|
|
17040
|
-
const nameTagOverlapStyle =
|
|
17250
|
+
const nameTagOverlapStyle = useMemo45(
|
|
17041
17251
|
() => ({ marginLeft: `${POINTER_SIZE - POINTER_OVERLAP + 1}px` }),
|
|
17042
17252
|
[]
|
|
17043
17253
|
);
|
|
17044
|
-
return /* @__PURE__ */
|
|
17254
|
+
return /* @__PURE__ */ React104.createElement(
|
|
17045
17255
|
UserPointerContainer,
|
|
17046
17256
|
{
|
|
17047
17257
|
point,
|
|
@@ -17049,14 +17259,14 @@ var UserPointer = memo35(function UserPointer2({
|
|
|
17049
17259
|
className,
|
|
17050
17260
|
style: style2
|
|
17051
17261
|
},
|
|
17052
|
-
name && /* @__PURE__ */
|
|
17262
|
+
name && /* @__PURE__ */ React104.createElement("div", { className: "n-relative" }, showPointerIcon && /* @__PURE__ */ React104.createElement(
|
|
17053
17263
|
UserPointerIcon,
|
|
17054
17264
|
{
|
|
17055
17265
|
size: POINTER_SIZE,
|
|
17056
17266
|
color: userBackgroundColor,
|
|
17057
17267
|
style: pointerOverlapStyle
|
|
17058
17268
|
}
|
|
17059
|
-
), /* @__PURE__ */
|
|
17269
|
+
), /* @__PURE__ */ React104.createElement(
|
|
17060
17270
|
UserNameTag,
|
|
17061
17271
|
{
|
|
17062
17272
|
backgroundColor: userBackgroundColor,
|
|
@@ -17072,16 +17282,16 @@ var UserPointer = memo35(function UserPointer2({
|
|
|
17072
17282
|
|
|
17073
17283
|
// src/components/workspace/WorkspaceLayout.tsx
|
|
17074
17284
|
import { useKeyboardShortcuts as useKeyboardShortcuts4 } from "@noya-app/noya-keymap";
|
|
17075
|
-
import
|
|
17076
|
-
memo as
|
|
17077
|
-
useCallback as
|
|
17285
|
+
import React110, {
|
|
17286
|
+
memo as memo36,
|
|
17287
|
+
useCallback as useCallback40,
|
|
17078
17288
|
useImperativeHandle as useImperativeHandle9,
|
|
17079
|
-
useMemo as
|
|
17289
|
+
useMemo as useMemo49,
|
|
17080
17290
|
useRef as useRef30
|
|
17081
17291
|
} from "react";
|
|
17082
17292
|
|
|
17083
17293
|
// src/components/workspace/DrawerWorkspaceLayout.tsx
|
|
17084
|
-
import
|
|
17294
|
+
import React108, { useMemo as useMemo47, useRef as useRef28, useState as useState36 } from "react";
|
|
17085
17295
|
|
|
17086
17296
|
// src/components/workspace/constants.ts
|
|
17087
17297
|
var EDITOR_PANEL_GROUP_ID = "editor-panel-group";
|
|
@@ -17090,20 +17300,20 @@ var RIGHT_SIDEBAR_ID = "editor-3-right-sidebar";
|
|
|
17090
17300
|
var CONTENT_AREA_ID = "editor-2-content-area";
|
|
17091
17301
|
|
|
17092
17302
|
// src/components/workspace/VerticalTabMenu.tsx
|
|
17093
|
-
import
|
|
17303
|
+
import React107, { useMemo as useMemo46 } from "react";
|
|
17094
17304
|
|
|
17095
17305
|
// src/components/Toolbar.tsx
|
|
17096
17306
|
import { useKeyboardShortcuts as useKeyboardShortcuts3 } from "@noya-app/noya-keymap";
|
|
17097
|
-
import
|
|
17307
|
+
import React106, {
|
|
17098
17308
|
createContext as createContext15,
|
|
17099
|
-
useContext as
|
|
17309
|
+
useContext as useContext15
|
|
17100
17310
|
} from "react";
|
|
17101
17311
|
|
|
17102
17312
|
// src/components/ToolbarDrawer.tsx
|
|
17103
|
-
import
|
|
17104
|
-
var ToolbarDrawer =
|
|
17313
|
+
import React105, { forwardRef as forwardRef28, memo as memo35 } from "react";
|
|
17314
|
+
var ToolbarDrawer = memo35(
|
|
17105
17315
|
forwardRef28(function ToolbarDrawer2({ children, trigger, sideOffset = 8 }, ref) {
|
|
17106
|
-
return /* @__PURE__ */
|
|
17316
|
+
return /* @__PURE__ */ React105.createElement("div", { className: "n-relative", ref }, /* @__PURE__ */ React105.createElement(
|
|
17107
17317
|
"div",
|
|
17108
17318
|
{
|
|
17109
17319
|
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",
|
|
@@ -17124,8 +17334,8 @@ var ToolbarMenuDropdown = memoGeneric(function ToolbarMenuDropdown2({
|
|
|
17124
17334
|
item,
|
|
17125
17335
|
onSelectMenuItem
|
|
17126
17336
|
}) {
|
|
17127
|
-
const [open, setOpen] =
|
|
17128
|
-
return /* @__PURE__ */
|
|
17337
|
+
const [open, setOpen] = React106.useState(false);
|
|
17338
|
+
return /* @__PURE__ */ React106.createElement(
|
|
17129
17339
|
DropdownMenu,
|
|
17130
17340
|
{
|
|
17131
17341
|
open,
|
|
@@ -17137,7 +17347,7 @@ var ToolbarMenuDropdown = memoGeneric(function ToolbarMenuDropdown2({
|
|
|
17137
17347
|
}
|
|
17138
17348
|
}
|
|
17139
17349
|
},
|
|
17140
|
-
/* @__PURE__ */
|
|
17350
|
+
/* @__PURE__ */ React106.createElement(
|
|
17141
17351
|
Button,
|
|
17142
17352
|
{
|
|
17143
17353
|
disabled: item.disabled,
|
|
@@ -17153,7 +17363,7 @@ var ToolbarShortcut = ({
|
|
|
17153
17363
|
shortcut,
|
|
17154
17364
|
label
|
|
17155
17365
|
}) => {
|
|
17156
|
-
return /* @__PURE__ */
|
|
17366
|
+
return /* @__PURE__ */ React106.createElement("div", { className: "n-flex n-items-center" }, label, /* @__PURE__ */ React106.createElement(Spacer.Horizontal, { size: 6 }), /* @__PURE__ */ React106.createElement(KeyboardShortcut, { shortcut }));
|
|
17157
17367
|
};
|
|
17158
17368
|
var ToolbarMenuPopover = memoGeneric(function ToolbarMenuPopover2({
|
|
17159
17369
|
item,
|
|
@@ -17167,8 +17377,8 @@ var ToolbarMenuPopover = memoGeneric(function ToolbarMenuPopover2({
|
|
|
17167
17377
|
content: itemContent,
|
|
17168
17378
|
checked
|
|
17169
17379
|
} = item;
|
|
17170
|
-
const [open, setOpen] =
|
|
17171
|
-
const content = /* @__PURE__ */
|
|
17380
|
+
const [open, setOpen] = React106.useState(false);
|
|
17381
|
+
const content = /* @__PURE__ */ React106.createElement("span", null, /* @__PURE__ */ React106.createElement(
|
|
17172
17382
|
Popover,
|
|
17173
17383
|
{
|
|
17174
17384
|
open,
|
|
@@ -17177,7 +17387,7 @@ var ToolbarMenuPopover = memoGeneric(function ToolbarMenuPopover2({
|
|
|
17177
17387
|
showArrow: false,
|
|
17178
17388
|
sideOffset: SIDE_OFFSET,
|
|
17179
17389
|
portalContainer,
|
|
17180
|
-
trigger: /* @__PURE__ */
|
|
17390
|
+
trigger: /* @__PURE__ */ React106.createElement(
|
|
17181
17391
|
Button,
|
|
17182
17392
|
{
|
|
17183
17393
|
disabled,
|
|
@@ -17190,7 +17400,7 @@ var ToolbarMenuPopover = memoGeneric(function ToolbarMenuPopover2({
|
|
|
17190
17400
|
},
|
|
17191
17401
|
typeof itemContent === "function" ? itemContent({ close: () => setOpen(false) }) : itemContent
|
|
17192
17402
|
));
|
|
17193
|
-
return tooltip && !open ? /* @__PURE__ */
|
|
17403
|
+
return tooltip && !open ? /* @__PURE__ */ React106.createElement(
|
|
17194
17404
|
Tooltip,
|
|
17195
17405
|
{
|
|
17196
17406
|
sideOffset: SIDE_OFFSET,
|
|
@@ -17210,7 +17420,7 @@ var ToolbarMenuButton = memoGeneric(function ToolbarMenuButton2({
|
|
|
17210
17420
|
displayFilter
|
|
17211
17421
|
}) {
|
|
17212
17422
|
const isActive = item.checked || activeValue === item.value;
|
|
17213
|
-
const content = /* @__PURE__ */
|
|
17423
|
+
const content = /* @__PURE__ */ React106.createElement(
|
|
17214
17424
|
Button,
|
|
17215
17425
|
{
|
|
17216
17426
|
as,
|
|
@@ -17227,7 +17437,7 @@ var ToolbarMenuButton = memoGeneric(function ToolbarMenuButton2({
|
|
|
17227
17437
|
displayFilter === "iconOnly" ? void 0 : item.title
|
|
17228
17438
|
);
|
|
17229
17439
|
const tooltip = item.tooltip ?? (displayFilter === "iconOnly" && item.title ? item.title : void 0);
|
|
17230
|
-
return item.drawer && isActive ? /* @__PURE__ */
|
|
17440
|
+
return item.drawer && isActive ? /* @__PURE__ */ React106.createElement(ToolbarDrawer, { trigger: content }, item.drawer) : tooltip ? /* @__PURE__ */ React106.createElement(Tooltip, { sideOffset: SIDE_OFFSET, content: tooltip, side: tooltipSide }, content) : content;
|
|
17231
17441
|
});
|
|
17232
17442
|
var ToolbarMenuItem = memoGeneric(function ToolbarMenuItem2({
|
|
17233
17443
|
item,
|
|
@@ -17239,17 +17449,17 @@ var ToolbarMenuItem = memoGeneric(function ToolbarMenuItem2({
|
|
|
17239
17449
|
displayFilter,
|
|
17240
17450
|
dividerOverflow: dividerOverflowProp
|
|
17241
17451
|
}) {
|
|
17242
|
-
const { dividerOverflow: contextDividerOverflow } =
|
|
17452
|
+
const { dividerOverflow: contextDividerOverflow } = useContext15(ToolbarMenuContext);
|
|
17243
17453
|
const dividerOverflow = dividerOverflowProp ?? contextDividerOverflow ?? 4;
|
|
17244
17454
|
if (item.type === "sectionHeader") return null;
|
|
17245
17455
|
if (item.type === "separator") {
|
|
17246
|
-
return /* @__PURE__ */
|
|
17456
|
+
return /* @__PURE__ */ React106.createElement(DividerVertical, { overflow: dividerOverflow });
|
|
17247
17457
|
}
|
|
17248
17458
|
if (item.type === "popover") {
|
|
17249
|
-
return /* @__PURE__ */
|
|
17459
|
+
return /* @__PURE__ */ React106.createElement(ToolbarMenuPopover, { item, portalContainer });
|
|
17250
17460
|
}
|
|
17251
17461
|
if (isSelectableMenuItem(item)) {
|
|
17252
|
-
return /* @__PURE__ */
|
|
17462
|
+
return /* @__PURE__ */ React106.createElement(
|
|
17253
17463
|
ToolbarMenuButton,
|
|
17254
17464
|
{
|
|
17255
17465
|
item,
|
|
@@ -17261,7 +17471,7 @@ var ToolbarMenuItem = memoGeneric(function ToolbarMenuItem2({
|
|
|
17261
17471
|
}
|
|
17262
17472
|
);
|
|
17263
17473
|
}
|
|
17264
|
-
return /* @__PURE__ */
|
|
17474
|
+
return /* @__PURE__ */ React106.createElement(ToolbarMenuDropdown, { item, onSelectMenuItem });
|
|
17265
17475
|
});
|
|
17266
17476
|
var ToolbarMenu = memoGeneric(function ToolbarMenu2({
|
|
17267
17477
|
items,
|
|
@@ -17273,8 +17483,8 @@ var ToolbarMenu = memoGeneric(function ToolbarMenu2({
|
|
|
17273
17483
|
displayFilter = "iconAndText",
|
|
17274
17484
|
dividerOverflow
|
|
17275
17485
|
}) {
|
|
17276
|
-
return /* @__PURE__ */
|
|
17277
|
-
return /* @__PURE__ */
|
|
17486
|
+
return /* @__PURE__ */ React106.createElement(React106.Fragment, null, items.map((item, i) => {
|
|
17487
|
+
return /* @__PURE__ */ React106.createElement(
|
|
17278
17488
|
ToolbarMenuItem,
|
|
17279
17489
|
{
|
|
17280
17490
|
key: i,
|
|
@@ -17299,21 +17509,21 @@ function Toolbar({
|
|
|
17299
17509
|
shouldBindKeyboardShortcuts = true,
|
|
17300
17510
|
dividerOverflow
|
|
17301
17511
|
}) {
|
|
17302
|
-
const allMenuItems =
|
|
17512
|
+
const allMenuItems = React106.useMemo(
|
|
17303
17513
|
() => [...leftMenuItems, ...rightMenuItems],
|
|
17304
17514
|
[leftMenuItems, rightMenuItems]
|
|
17305
17515
|
);
|
|
17306
17516
|
useKeyboardShortcuts3(
|
|
17307
|
-
|
|
17517
|
+
React106.useMemo(
|
|
17308
17518
|
() => onSelectMenuItem && shouldBindKeyboardShortcuts ? getKeyboardShortcutsForMenuItems(allMenuItems, onSelectMenuItem) : {},
|
|
17309
17519
|
[allMenuItems, onSelectMenuItem, shouldBindKeyboardShortcuts]
|
|
17310
17520
|
)
|
|
17311
17521
|
);
|
|
17312
|
-
return /* @__PURE__ */
|
|
17522
|
+
return /* @__PURE__ */ React106.createElement(
|
|
17313
17523
|
BaseToolbar,
|
|
17314
17524
|
{
|
|
17315
17525
|
logo,
|
|
17316
|
-
left: leftMenuItems.length > 0 && /* @__PURE__ */
|
|
17526
|
+
left: leftMenuItems.length > 0 && /* @__PURE__ */ React106.createElement("div", { className: "n-flex n-gap-2" }, /* @__PURE__ */ React106.createElement(
|
|
17317
17527
|
ToolbarMenu,
|
|
17318
17528
|
{
|
|
17319
17529
|
items: leftMenuItems,
|
|
@@ -17321,7 +17531,7 @@ function Toolbar({
|
|
|
17321
17531
|
dividerOverflow
|
|
17322
17532
|
}
|
|
17323
17533
|
)),
|
|
17324
|
-
right: rightMenuItems.length > 0 && /* @__PURE__ */
|
|
17534
|
+
right: rightMenuItems.length > 0 && /* @__PURE__ */ React106.createElement("div", { className: "n-flex n-gap-2" }, /* @__PURE__ */ React106.createElement(
|
|
17325
17535
|
ToolbarMenu,
|
|
17326
17536
|
{
|
|
17327
17537
|
items: rightMenuItems,
|
|
@@ -17342,19 +17552,19 @@ var VerticalTabMenu = memoGeneric(function VerticalTabMenu2({
|
|
|
17342
17552
|
onChange,
|
|
17343
17553
|
tooltipSide
|
|
17344
17554
|
}) {
|
|
17345
|
-
const style2 =
|
|
17555
|
+
const style2 = useMemo46(() => {
|
|
17346
17556
|
return {
|
|
17347
17557
|
[cssVarNames.colors.inputBackground]: "transparent",
|
|
17348
17558
|
[cssVarNames.colors.buttonBackground]: "transparent"
|
|
17349
17559
|
};
|
|
17350
17560
|
}, []);
|
|
17351
|
-
return /* @__PURE__ */
|
|
17561
|
+
return /* @__PURE__ */ React107.createElement(
|
|
17352
17562
|
"div",
|
|
17353
17563
|
{
|
|
17354
17564
|
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",
|
|
17355
17565
|
style: style2
|
|
17356
17566
|
},
|
|
17357
|
-
/* @__PURE__ */
|
|
17567
|
+
/* @__PURE__ */ React107.createElement(
|
|
17358
17568
|
ToolbarMenu,
|
|
17359
17569
|
{
|
|
17360
17570
|
items,
|
|
@@ -17383,11 +17593,11 @@ var DrawerWorkspaceLayout = memoGeneric(function DrawerWorkspaceLayout2({
|
|
|
17383
17593
|
compactDrawerMenu
|
|
17384
17594
|
}) {
|
|
17385
17595
|
const portalContainer = useRef28(null);
|
|
17386
|
-
const [{ leftSidebarCollapsed, rightSidebarCollapsed }, setLayoutState] =
|
|
17596
|
+
const [{ leftSidebarCollapsed, rightSidebarCollapsed }, setLayoutState] = useState36({
|
|
17387
17597
|
leftSidebarCollapsed: true,
|
|
17388
17598
|
rightSidebarCollapsed: true
|
|
17389
17599
|
});
|
|
17390
|
-
const allTabItems =
|
|
17600
|
+
const allTabItems = useMemo47(
|
|
17391
17601
|
() => [
|
|
17392
17602
|
...leftPanel ? leftTabItems ?? [] : [],
|
|
17393
17603
|
...rightPanel ? rightTabItems ?? [] : []
|
|
@@ -17395,16 +17605,16 @@ var DrawerWorkspaceLayout = memoGeneric(function DrawerWorkspaceLayout2({
|
|
|
17395
17605
|
[leftTabItems, rightTabItems, leftPanel, rightPanel]
|
|
17396
17606
|
);
|
|
17397
17607
|
const hasTabs = allTabItems.length > 0;
|
|
17398
|
-
const allSelectableTabItems =
|
|
17608
|
+
const allSelectableTabItems = useMemo47(
|
|
17399
17609
|
() => allTabItems.filter(isSelectableMenuItem),
|
|
17400
17610
|
[allTabItems]
|
|
17401
17611
|
);
|
|
17402
17612
|
const useCompactInToolbar = !!compactDrawerMenu && allSelectableTabItems.length <= 1;
|
|
17403
|
-
const leftSelectableTabItems =
|
|
17613
|
+
const leftSelectableTabItems = useMemo47(
|
|
17404
17614
|
() => (leftTabItems ?? []).filter(isSelectableMenuItem),
|
|
17405
17615
|
[leftTabItems]
|
|
17406
17616
|
);
|
|
17407
|
-
const rightSelectableTabItems =
|
|
17617
|
+
const rightSelectableTabItems = useMemo47(
|
|
17408
17618
|
() => (rightTabItems ?? []).filter(isSelectableMenuItem),
|
|
17409
17619
|
[rightTabItems]
|
|
17410
17620
|
);
|
|
@@ -17441,14 +17651,14 @@ var DrawerWorkspaceLayout = memoGeneric(function DrawerWorkspaceLayout2({
|
|
|
17441
17651
|
activeValue: rightTabValue,
|
|
17442
17652
|
isSidebarCollapsed: rightSidebarCollapsed
|
|
17443
17653
|
} : { activeValue: void 0, isSidebarCollapsed: true };
|
|
17444
|
-
return /* @__PURE__ */
|
|
17654
|
+
return /* @__PURE__ */ React108.createElement(
|
|
17445
17655
|
"div",
|
|
17446
17656
|
{
|
|
17447
17657
|
ref: portalContainer,
|
|
17448
17658
|
id: EDITOR_PANEL_GROUP_ID,
|
|
17449
17659
|
className: "n-flex n-flex-1 n-relative focus:n-outline-none"
|
|
17450
17660
|
},
|
|
17451
|
-
hasTabs && !useCompactInToolbar && /* @__PURE__ */
|
|
17661
|
+
hasTabs && !useCompactInToolbar && /* @__PURE__ */ React108.createElement(React108.Fragment, null, /* @__PURE__ */ React108.createElement(
|
|
17452
17662
|
VerticalTabMenu,
|
|
17453
17663
|
{
|
|
17454
17664
|
tooltipSide: "right",
|
|
@@ -17457,8 +17667,8 @@ var DrawerWorkspaceLayout = memoGeneric(function DrawerWorkspaceLayout2({
|
|
|
17457
17667
|
isSidebarCollapsed,
|
|
17458
17668
|
onChange: (value) => handleSelectTab(value)
|
|
17459
17669
|
}
|
|
17460
|
-
), /* @__PURE__ */
|
|
17461
|
-
useCompactInToolbar && /* @__PURE__ */
|
|
17670
|
+
), /* @__PURE__ */ React108.createElement(DividerVertical, { className: "n-h-full" })),
|
|
17671
|
+
useCompactInToolbar && /* @__PURE__ */ React108.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__ */ React108.createElement(
|
|
17462
17672
|
Button,
|
|
17463
17673
|
{
|
|
17464
17674
|
variant: "none",
|
|
@@ -17481,8 +17691,8 @@ var DrawerWorkspaceLayout = memoGeneric(function DrawerWorkspaceLayout2({
|
|
|
17481
17691
|
}
|
|
17482
17692
|
}
|
|
17483
17693
|
)),
|
|
17484
|
-
/* @__PURE__ */
|
|
17485
|
-
leftPanel && /* @__PURE__ */
|
|
17694
|
+
/* @__PURE__ */ React108.createElement("div", { className: "n-flex-1 n-flex n-relative" }, centerPanel),
|
|
17695
|
+
leftPanel && /* @__PURE__ */ React108.createElement(
|
|
17486
17696
|
Drawer,
|
|
17487
17697
|
{
|
|
17488
17698
|
ref: leftSidebarRef,
|
|
@@ -17503,7 +17713,7 @@ var DrawerWorkspaceLayout = memoGeneric(function DrawerWorkspaceLayout2({
|
|
|
17503
17713
|
},
|
|
17504
17714
|
leftPanel
|
|
17505
17715
|
),
|
|
17506
|
-
rightPanel && /* @__PURE__ */
|
|
17716
|
+
rightPanel && /* @__PURE__ */ React108.createElement(
|
|
17507
17717
|
Drawer,
|
|
17508
17718
|
{
|
|
17509
17719
|
id: RIGHT_SIDEBAR_ID,
|
|
@@ -17529,7 +17739,7 @@ var DrawerWorkspaceLayout = memoGeneric(function DrawerWorkspaceLayout2({
|
|
|
17529
17739
|
});
|
|
17530
17740
|
|
|
17531
17741
|
// src/components/workspace/PanelWorkspaceLayout.tsx
|
|
17532
|
-
import
|
|
17742
|
+
import React109, { useCallback as useCallback39, useMemo as useMemo48, useRef as useRef29 } from "react";
|
|
17533
17743
|
import {
|
|
17534
17744
|
Panel,
|
|
17535
17745
|
PanelGroup,
|
|
@@ -17703,7 +17913,7 @@ var PanelWorkspaceLayout = memoGeneric(function PanelWorkspaceLayout2({
|
|
|
17703
17913
|
const hasLeftPanel = !!leftPanel;
|
|
17704
17914
|
const hasRightPanel = !!rightPanel;
|
|
17705
17915
|
const hasCenterPanel = !!centerPanel;
|
|
17706
|
-
const autoSaveId =
|
|
17916
|
+
const autoSaveId = useMemo48(() => {
|
|
17707
17917
|
return autoSavePrefix ? `${autoSavePrefix}--v2--${EDITOR_PANEL_GROUP_ID}` : Math.random().toString(36).substring(2, 15);
|
|
17708
17918
|
}, [autoSavePrefix]);
|
|
17709
17919
|
const layoutIds = getLayoutIds({
|
|
@@ -17730,7 +17940,7 @@ var PanelWorkspaceLayout = memoGeneric(function PanelWorkspaceLayout2({
|
|
|
17730
17940
|
});
|
|
17731
17941
|
const [data, setData] = usePersistentStateObject(clientStorage, storageKey, {});
|
|
17732
17942
|
const layoutGroup = data?.[propertyKey];
|
|
17733
|
-
const { leftSidebarCollapsed, rightSidebarCollapsed } =
|
|
17943
|
+
const { leftSidebarCollapsed, rightSidebarCollapsed } = useMemo48(() => {
|
|
17734
17944
|
return getLayoutCollapsedState({
|
|
17735
17945
|
layoutGroup,
|
|
17736
17946
|
propertyKey,
|
|
@@ -17739,7 +17949,7 @@ var PanelWorkspaceLayout = memoGeneric(function PanelWorkspaceLayout2({
|
|
|
17739
17949
|
hasRightPanel
|
|
17740
17950
|
});
|
|
17741
17951
|
}, [layoutGroup, propertyKey, layoutIds, hasLeftPanel, hasRightPanel]);
|
|
17742
|
-
const handleLeftTabChange =
|
|
17952
|
+
const handleLeftTabChange = useCallback39(
|
|
17743
17953
|
(value) => {
|
|
17744
17954
|
if (value === leftTabValue) {
|
|
17745
17955
|
if (leftSidebarRef.current?.isExpanded()) {
|
|
@@ -17756,7 +17966,7 @@ var PanelWorkspaceLayout = memoGeneric(function PanelWorkspaceLayout2({
|
|
|
17756
17966
|
},
|
|
17757
17967
|
[leftSidebarRef, leftTabValue, onChangeLeftTab]
|
|
17758
17968
|
);
|
|
17759
|
-
const handleRightTabChange =
|
|
17969
|
+
const handleRightTabChange = useCallback39(
|
|
17760
17970
|
(value) => {
|
|
17761
17971
|
if (value === rightTabValue) {
|
|
17762
17972
|
if (rightSidebarRef.current?.isExpanded()) {
|
|
@@ -17773,7 +17983,7 @@ var PanelWorkspaceLayout = memoGeneric(function PanelWorkspaceLayout2({
|
|
|
17773
17983
|
},
|
|
17774
17984
|
[onChangeRightTab, rightSidebarRef, rightTabValue]
|
|
17775
17985
|
);
|
|
17776
|
-
const handleLayoutChange =
|
|
17986
|
+
const handleLayoutChange = useCallback39(
|
|
17777
17987
|
(layout) => {
|
|
17778
17988
|
setData((prev) => {
|
|
17779
17989
|
const newData = {
|
|
@@ -17791,7 +18001,7 @@ var PanelWorkspaceLayout = memoGeneric(function PanelWorkspaceLayout2({
|
|
|
17791
18001
|
const showLeftTabs = !!leftSidebarOptions.showTabs && !!leftTabItems && // When compact drawer UI is enabled, only show the rail when the
|
|
17792
18002
|
// sidebar is collapsed (for large screens/panel layout).
|
|
17793
18003
|
(!compactDrawerMenu || leftSidebarCollapsed);
|
|
17794
|
-
return /* @__PURE__ */
|
|
18004
|
+
return /* @__PURE__ */ React109.createElement(
|
|
17795
18005
|
PanelGroup,
|
|
17796
18006
|
{
|
|
17797
18007
|
ref: panelGroupRef,
|
|
@@ -17802,7 +18012,7 @@ var PanelWorkspaceLayout = memoGeneric(function PanelWorkspaceLayout2({
|
|
|
17802
18012
|
autoSaveId,
|
|
17803
18013
|
onLayout: handleLayoutChange
|
|
17804
18014
|
},
|
|
17805
|
-
leftPanel && /* @__PURE__ */
|
|
18015
|
+
leftPanel && /* @__PURE__ */ React109.createElement(React109.Fragment, null, showLeftTabs && /* @__PURE__ */ React109.createElement(
|
|
17806
18016
|
VerticalTabMenu,
|
|
17807
18017
|
{
|
|
17808
18018
|
tooltipSide: "right",
|
|
@@ -17811,7 +18021,7 @@ var PanelWorkspaceLayout = memoGeneric(function PanelWorkspaceLayout2({
|
|
|
17811
18021
|
isSidebarCollapsed: leftSidebarCollapsed,
|
|
17812
18022
|
onChange: handleLeftTabChange
|
|
17813
18023
|
}
|
|
17814
|
-
), showLeftTabs && !leftSidebarCollapsed && /* @__PURE__ */
|
|
18024
|
+
), showLeftTabs && !leftSidebarCollapsed && /* @__PURE__ */ React109.createElement(DividerVertical, { className: "n-h-full" }), /* @__PURE__ */ React109.createElement(
|
|
17815
18025
|
Panel,
|
|
17816
18026
|
{
|
|
17817
18027
|
id: LEFT_SIDEBAR_ID,
|
|
@@ -17824,8 +18034,8 @@ var PanelWorkspaceLayout = memoGeneric(function PanelWorkspaceLayout2({
|
|
|
17824
18034
|
collapsible: true
|
|
17825
18035
|
},
|
|
17826
18036
|
leftSidebarCollapsed ? null : leftPanel
|
|
17827
|
-
), /* @__PURE__ */
|
|
17828
|
-
/* @__PURE__ */
|
|
18037
|
+
), /* @__PURE__ */ React109.createElement(PanelResizeHandle, { className: "n-cursor-col-resize n-w-px n-h-full n-bg-divider" })),
|
|
18038
|
+
/* @__PURE__ */ React109.createElement(
|
|
17829
18039
|
Panel,
|
|
17830
18040
|
{
|
|
17831
18041
|
id: CONTENT_AREA_ID,
|
|
@@ -17836,7 +18046,7 @@ var PanelWorkspaceLayout = memoGeneric(function PanelWorkspaceLayout2({
|
|
|
17836
18046
|
},
|
|
17837
18047
|
centerPanel
|
|
17838
18048
|
),
|
|
17839
|
-
rightPanel && /* @__PURE__ */
|
|
18049
|
+
rightPanel && /* @__PURE__ */ React109.createElement(React109.Fragment, null, /* @__PURE__ */ React109.createElement(PanelResizeHandle, { className: "n-cursor-col-resize n-w-px n-h-full n-bg-divider" }), /* @__PURE__ */ React109.createElement(
|
|
17840
18050
|
Panel,
|
|
17841
18051
|
{
|
|
17842
18052
|
id: RIGHT_SIDEBAR_ID,
|
|
@@ -17849,7 +18059,7 @@ var PanelWorkspaceLayout = memoGeneric(function PanelWorkspaceLayout2({
|
|
|
17849
18059
|
collapsible: true
|
|
17850
18060
|
},
|
|
17851
18061
|
rightSidebarCollapsed ? null : rightPanel
|
|
17852
|
-
), rightSidebarOptions.showTabs && rightTabItems && !rightSidebarCollapsed && /* @__PURE__ */
|
|
18062
|
+
), rightSidebarOptions.showTabs && rightTabItems && !rightSidebarCollapsed && /* @__PURE__ */ React109.createElement(DividerVertical, { className: "n-h-full" }), rightSidebarOptions.showTabs && rightTabItems && /* @__PURE__ */ React109.createElement(
|
|
17853
18063
|
VerticalTabMenu,
|
|
17854
18064
|
{
|
|
17855
18065
|
tooltipSide: "left",
|
|
@@ -17871,11 +18081,11 @@ function renderPanelChildren(fn, props) {
|
|
|
17871
18081
|
}
|
|
17872
18082
|
|
|
17873
18083
|
// src/components/workspace/WorkspaceSideContext.tsx
|
|
17874
|
-
import { createContext as createContext16, useContext as
|
|
18084
|
+
import { createContext as createContext16, useContext as useContext16 } from "react";
|
|
17875
18085
|
var WorkspaceSideContext = createContext16({});
|
|
17876
18086
|
var WorkspaceSideProvider = WorkspaceSideContext.Provider;
|
|
17877
18087
|
function useWorkspaceSide() {
|
|
17878
|
-
return
|
|
18088
|
+
return useContext16(WorkspaceSideContext);
|
|
17879
18089
|
}
|
|
17880
18090
|
|
|
17881
18091
|
// src/components/workspace/WorkspaceLayout.tsx
|
|
@@ -17938,7 +18148,7 @@ var WorkspaceLayout = forwardRefGeneric(function WorkspaceLayout2({
|
|
|
17938
18148
|
theme,
|
|
17939
18149
|
compactDrawerMenu
|
|
17940
18150
|
}, forwardedRef) {
|
|
17941
|
-
const containerRef =
|
|
18151
|
+
const containerRef = React110.useRef(null);
|
|
17942
18152
|
const containerSize = useSize(containerRef);
|
|
17943
18153
|
const windowSize = useWindowSize();
|
|
17944
18154
|
const parentSize = detectSize === "window" ? windowSize : containerSize && containerSize.width > 0 ? containerSize : windowSize;
|
|
@@ -18039,56 +18249,56 @@ var WorkspaceLayout = forwardRefGeneric(function WorkspaceLayout2({
|
|
|
18039
18249
|
});
|
|
18040
18250
|
const centerPanelPercentage = 100 - (left ? leftSidebarPercentage : 0) - (right ? rightSidebarPercentage : 0);
|
|
18041
18251
|
const isDrawerActive = sideType === "drawer" || sideType === "auto" && parentSize.width <= sideTypeBreakpoint;
|
|
18042
|
-
const closeLeftSidebar =
|
|
18252
|
+
const closeLeftSidebar = useCallback40(() => {
|
|
18043
18253
|
if (isDrawerActive) {
|
|
18044
18254
|
leftSidebarRef.current?.collapse();
|
|
18045
18255
|
}
|
|
18046
18256
|
}, [isDrawerActive]);
|
|
18047
|
-
const closeRightSidebar =
|
|
18257
|
+
const closeRightSidebar = useCallback40(() => {
|
|
18048
18258
|
if (isDrawerActive) {
|
|
18049
18259
|
rightSidebarRef.current?.collapse();
|
|
18050
18260
|
}
|
|
18051
18261
|
}, [isDrawerActive]);
|
|
18052
|
-
const leftChildrenProps =
|
|
18262
|
+
const leftChildrenProps = useMemo49(() => {
|
|
18053
18263
|
return {
|
|
18054
18264
|
activeTabValue: leftTabValue,
|
|
18055
18265
|
closeSidebar: closeLeftSidebar
|
|
18056
18266
|
};
|
|
18057
18267
|
}, [leftTabValue, closeLeftSidebar]);
|
|
18058
|
-
const rightChildrenProps =
|
|
18268
|
+
const rightChildrenProps = useMemo49(() => {
|
|
18059
18269
|
return {
|
|
18060
18270
|
activeTabValue: rightTabValue,
|
|
18061
18271
|
closeSidebar: closeRightSidebar
|
|
18062
18272
|
};
|
|
18063
18273
|
}, [rightTabValue, closeRightSidebar]);
|
|
18064
|
-
const leftSidebarProviderValue =
|
|
18274
|
+
const leftSidebarProviderValue = useMemo49(() => {
|
|
18065
18275
|
return {
|
|
18066
18276
|
closeSidebar: closeLeftSidebar
|
|
18067
18277
|
};
|
|
18068
18278
|
}, [closeLeftSidebar]);
|
|
18069
|
-
const rightSidebarProviderValue =
|
|
18279
|
+
const rightSidebarProviderValue = useMemo49(() => {
|
|
18070
18280
|
return {
|
|
18071
18281
|
closeSidebar: closeRightSidebar
|
|
18072
18282
|
};
|
|
18073
18283
|
}, [closeRightSidebar]);
|
|
18074
|
-
const leftPanel = left && leftVisible !== false ? /* @__PURE__ */
|
|
18284
|
+
const leftPanel = left && leftVisible !== false ? /* @__PURE__ */ React110.createElement(
|
|
18075
18285
|
PanelInner,
|
|
18076
18286
|
{
|
|
18077
18287
|
style: leftStyle,
|
|
18078
18288
|
className: cx("n-bg-sidebar-background n-flex-col", leftClassName)
|
|
18079
18289
|
},
|
|
18080
|
-
/* @__PURE__ */
|
|
18290
|
+
/* @__PURE__ */ React110.createElement(WorkspaceSideProvider, { value: leftSidebarProviderValue }, leftTabValue ? renderPanelChildren(left, leftChildrenProps) : null)
|
|
18081
18291
|
) : null;
|
|
18082
|
-
const rightPanel = right && rightVisible !== false ? /* @__PURE__ */
|
|
18292
|
+
const rightPanel = right && rightVisible !== false ? /* @__PURE__ */ React110.createElement(
|
|
18083
18293
|
PanelInner,
|
|
18084
18294
|
{
|
|
18085
18295
|
style: rightStyle,
|
|
18086
18296
|
className: cx("n-bg-sidebar-background n-flex-col", rightClassName)
|
|
18087
18297
|
},
|
|
18088
|
-
/* @__PURE__ */
|
|
18298
|
+
/* @__PURE__ */ React110.createElement(WorkspaceSideProvider, { value: rightSidebarProviderValue }, rightTabValue ? renderPanelChildren(right, rightChildrenProps) : null)
|
|
18089
18299
|
) : null;
|
|
18090
|
-
const centerPanel = /* @__PURE__ */
|
|
18091
|
-
const leftSidebarOptions =
|
|
18300
|
+
const centerPanel = /* @__PURE__ */ React110.createElement(PanelInner, { className: "n-bg-canvas-background" }, children);
|
|
18301
|
+
const leftSidebarOptions = useMemo49(
|
|
18092
18302
|
() => ({
|
|
18093
18303
|
minSize: leftSidebarMinPercentage,
|
|
18094
18304
|
maxSize: leftSidebarMaxPercentage,
|
|
@@ -18106,7 +18316,7 @@ var WorkspaceLayout = forwardRefGeneric(function WorkspaceLayout2({
|
|
|
18106
18316
|
leftShowTabs
|
|
18107
18317
|
]
|
|
18108
18318
|
);
|
|
18109
|
-
const rightSidebarOptions =
|
|
18319
|
+
const rightSidebarOptions = useMemo49(
|
|
18110
18320
|
() => ({
|
|
18111
18321
|
minSize: rightSidebarMinPercentage,
|
|
18112
18322
|
maxSize: rightSidebarMaxPercentage,
|
|
@@ -18126,7 +18336,7 @@ var WorkspaceLayout = forwardRefGeneric(function WorkspaceLayout2({
|
|
|
18126
18336
|
);
|
|
18127
18337
|
const LayoutComponent = sideType === "panel" ? PanelWorkspaceLayout : sideType === "drawer" ? DrawerWorkspaceLayout : parentSize.width > sideTypeBreakpoint ? PanelWorkspaceLayout : DrawerWorkspaceLayout;
|
|
18128
18338
|
const readyToRender = detectSize === "window" || containerSize && containerSize.width > 0;
|
|
18129
|
-
return /* @__PURE__ */
|
|
18339
|
+
return /* @__PURE__ */ React110.createElement(
|
|
18130
18340
|
"div",
|
|
18131
18341
|
{
|
|
18132
18342
|
ref: containerRef,
|
|
@@ -18139,7 +18349,7 @@ var WorkspaceLayout = forwardRefGeneric(function WorkspaceLayout2({
|
|
|
18139
18349
|
"data-theme": theme
|
|
18140
18350
|
},
|
|
18141
18351
|
toolbar,
|
|
18142
|
-
/* @__PURE__ */
|
|
18352
|
+
/* @__PURE__ */ React110.createElement("div", { className: "n-flex n-flex-row n-flex-1 n-relative" }, readyToRender && /* @__PURE__ */ React110.createElement(
|
|
18143
18353
|
LayoutComponent,
|
|
18144
18354
|
{
|
|
18145
18355
|
leftPanel,
|
|
@@ -18162,12 +18372,12 @@ var WorkspaceLayout = forwardRefGeneric(function WorkspaceLayout2({
|
|
|
18162
18372
|
))
|
|
18163
18373
|
);
|
|
18164
18374
|
});
|
|
18165
|
-
var PanelInner =
|
|
18375
|
+
var PanelInner = memo36(function PanelInner2({
|
|
18166
18376
|
children,
|
|
18167
18377
|
style: style2,
|
|
18168
18378
|
className
|
|
18169
18379
|
}) {
|
|
18170
|
-
return /* @__PURE__ */
|
|
18380
|
+
return /* @__PURE__ */ React110.createElement(
|
|
18171
18381
|
"div",
|
|
18172
18382
|
{
|
|
18173
18383
|
style: style2,
|
|
@@ -18182,22 +18392,22 @@ function getFirstTabValue(items, defaultValue2) {
|
|
|
18182
18392
|
}
|
|
18183
18393
|
|
|
18184
18394
|
// src/contexts/ImageDataContext.tsx
|
|
18185
|
-
import * as
|
|
18186
|
-
var ImageDataContext =
|
|
18395
|
+
import * as React111 from "react";
|
|
18396
|
+
var ImageDataContext = React111.createContext(
|
|
18187
18397
|
void 0
|
|
18188
18398
|
);
|
|
18189
|
-
var ImageDataProvider =
|
|
18399
|
+
var ImageDataProvider = React111.memo(function ImageDataProvider2({
|
|
18190
18400
|
children,
|
|
18191
18401
|
getImageData
|
|
18192
18402
|
}) {
|
|
18193
|
-
const contextValue =
|
|
18403
|
+
const contextValue = React111.useMemo(
|
|
18194
18404
|
() => ({ getImageData: getImageData ?? (() => void 0) }),
|
|
18195
18405
|
[getImageData]
|
|
18196
18406
|
);
|
|
18197
|
-
return /* @__PURE__ */
|
|
18407
|
+
return /* @__PURE__ */ React111.createElement(ImageDataContext.Provider, { value: contextValue }, children);
|
|
18198
18408
|
});
|
|
18199
18409
|
function useImageData(ref) {
|
|
18200
|
-
const value =
|
|
18410
|
+
const value = React111.useContext(ImageDataContext);
|
|
18201
18411
|
if (!value) {
|
|
18202
18412
|
throw new Error("Missing ImageDataProvider");
|
|
18203
18413
|
}
|
|
@@ -18214,9 +18424,9 @@ function usePlatformModKey() {
|
|
|
18214
18424
|
}
|
|
18215
18425
|
|
|
18216
18426
|
// src/hooks/useTheme.ts
|
|
18217
|
-
import { useEffect as useEffect23, useState as
|
|
18427
|
+
import { useEffect as useEffect23, useState as useState37 } from "react";
|
|
18218
18428
|
function useTheme() {
|
|
18219
|
-
const [theme, setTheme] =
|
|
18429
|
+
const [theme, setTheme] = useState37("light");
|
|
18220
18430
|
const checkTheme = () => {
|
|
18221
18431
|
const currentTheme = document.body.getAttribute("data-theme");
|
|
18222
18432
|
switch (currentTheme) {
|
|
@@ -18351,11 +18561,11 @@ var SUPPORTED_CANVAS_UPLOAD_TYPES = [
|
|
|
18351
18561
|
|
|
18352
18562
|
// src/components/DimensionInput.tsx
|
|
18353
18563
|
import { round as round2 } from "@noya-app/noya-utils";
|
|
18354
|
-
import * as
|
|
18564
|
+
import * as React112 from "react";
|
|
18355
18565
|
function getNewValue(value, mode, delta) {
|
|
18356
18566
|
return delta === void 0 ? value : mode === "replace" ? delta : value + delta;
|
|
18357
18567
|
}
|
|
18358
|
-
var DimensionInput =
|
|
18568
|
+
var DimensionInput = React112.memo(function DimensionInput2({
|
|
18359
18569
|
id,
|
|
18360
18570
|
value,
|
|
18361
18571
|
onSetValue,
|
|
@@ -18365,15 +18575,15 @@ var DimensionInput = React111.memo(function DimensionInput2({
|
|
|
18365
18575
|
disabled,
|
|
18366
18576
|
trigger = "submit"
|
|
18367
18577
|
}) {
|
|
18368
|
-
const handleNudgeValue =
|
|
18578
|
+
const handleNudgeValue = React112.useCallback(
|
|
18369
18579
|
(value2) => onSetValue(value2, "adjust"),
|
|
18370
18580
|
[onSetValue]
|
|
18371
18581
|
);
|
|
18372
|
-
const handleSetValue =
|
|
18582
|
+
const handleSetValue = React112.useCallback(
|
|
18373
18583
|
(value2) => onSetValue(value2, "replace"),
|
|
18374
18584
|
[onSetValue]
|
|
18375
18585
|
);
|
|
18376
|
-
return /* @__PURE__ */
|
|
18586
|
+
return /* @__PURE__ */ React112.createElement(LabeledField, { label, labelType: "inset" }, /* @__PURE__ */ React112.createElement(InputField2.Root, { id, width: size }, /* @__PURE__ */ React112.createElement(
|
|
18377
18587
|
InputField2.NumberInput,
|
|
18378
18588
|
{
|
|
18379
18589
|
value: value === void 0 ? value : round2(value, 2),
|
|
@@ -18400,11 +18610,11 @@ __export(InspectorPrimitives_exports, {
|
|
|
18400
18610
|
Title: () => Title,
|
|
18401
18611
|
VerticalSeparator: () => VerticalSeparator
|
|
18402
18612
|
});
|
|
18403
|
-
import
|
|
18613
|
+
import React113, {
|
|
18404
18614
|
forwardRef as forwardRef29,
|
|
18405
|
-
memo as
|
|
18615
|
+
memo as memo39
|
|
18406
18616
|
} from "react";
|
|
18407
|
-
var Section2 = forwardRef29(({ className, ...props }, ref) => /* @__PURE__ */
|
|
18617
|
+
var Section2 = forwardRef29(({ className, ...props }, ref) => /* @__PURE__ */ React113.createElement(
|
|
18408
18618
|
"div",
|
|
18409
18619
|
{
|
|
18410
18620
|
ref,
|
|
@@ -18412,8 +18622,8 @@ var Section2 = forwardRef29(({ className, ...props }, ref) => /* @__PURE__ */ Re
|
|
|
18412
18622
|
...props
|
|
18413
18623
|
}
|
|
18414
18624
|
));
|
|
18415
|
-
var SectionHeader2 = forwardRef29(({ className, ...props }, ref) => /* @__PURE__ */
|
|
18416
|
-
var Title = forwardRef29(({ className, $textStyle, ...props }, ref) => /* @__PURE__ */
|
|
18625
|
+
var SectionHeader2 = forwardRef29(({ className, ...props }, ref) => /* @__PURE__ */ React113.createElement("div", { ref, className: cx(`n-flex n-items-center`, className), ...props }));
|
|
18626
|
+
var Title = forwardRef29(({ className, $textStyle, ...props }, ref) => /* @__PURE__ */ React113.createElement(
|
|
18417
18627
|
"div",
|
|
18418
18628
|
{
|
|
18419
18629
|
ref,
|
|
@@ -18424,7 +18634,7 @@ var Title = forwardRef29(({ className, $textStyle, ...props }, ref) => /* @__PUR
|
|
|
18424
18634
|
...props
|
|
18425
18635
|
}
|
|
18426
18636
|
));
|
|
18427
|
-
var Row = forwardRef29(({ className, ...props }, ref) => /* @__PURE__ */
|
|
18637
|
+
var Row = forwardRef29(({ className, ...props }, ref) => /* @__PURE__ */ React113.createElement(
|
|
18428
18638
|
"div",
|
|
18429
18639
|
{
|
|
18430
18640
|
ref,
|
|
@@ -18432,7 +18642,7 @@ var Row = forwardRef29(({ className, ...props }, ref) => /* @__PURE__ */ React11
|
|
|
18432
18642
|
...props
|
|
18433
18643
|
}
|
|
18434
18644
|
));
|
|
18435
|
-
var Column = forwardRef29(({ className, ...props }, ref) => /* @__PURE__ */
|
|
18645
|
+
var Column = forwardRef29(({ className, ...props }, ref) => /* @__PURE__ */ React113.createElement(
|
|
18436
18646
|
"div",
|
|
18437
18647
|
{
|
|
18438
18648
|
ref,
|
|
@@ -18440,7 +18650,7 @@ var Column = forwardRef29(({ className, ...props }, ref) => /* @__PURE__ */ Reac
|
|
|
18440
18650
|
...props
|
|
18441
18651
|
}
|
|
18442
18652
|
));
|
|
18443
|
-
var Checkbox3 = forwardRef29(({ className, ...props }, ref) => /* @__PURE__ */
|
|
18653
|
+
var Checkbox3 = forwardRef29(({ className, ...props }, ref) => /* @__PURE__ */ React113.createElement(
|
|
18444
18654
|
"input",
|
|
18445
18655
|
{
|
|
18446
18656
|
ref,
|
|
@@ -18449,7 +18659,7 @@ var Checkbox3 = forwardRef29(({ className, ...props }, ref) => /* @__PURE__ */ R
|
|
|
18449
18659
|
...props
|
|
18450
18660
|
}
|
|
18451
18661
|
));
|
|
18452
|
-
var Text3 = forwardRef29(({ className, ...props }, ref) => /* @__PURE__ */
|
|
18662
|
+
var Text3 = forwardRef29(({ className, ...props }, ref) => /* @__PURE__ */ React113.createElement(
|
|
18453
18663
|
"span",
|
|
18454
18664
|
{
|
|
18455
18665
|
ref,
|
|
@@ -18457,14 +18667,14 @@ var Text3 = forwardRef29(({ className, ...props }, ref) => /* @__PURE__ */ React
|
|
|
18457
18667
|
...props
|
|
18458
18668
|
}
|
|
18459
18669
|
));
|
|
18460
|
-
var VerticalSeparator = () => /* @__PURE__ */
|
|
18461
|
-
var HorizontalSeparator = () => /* @__PURE__ */
|
|
18670
|
+
var VerticalSeparator = () => /* @__PURE__ */ React113.createElement(Spacer.Vertical, { size: "inspector-v-separator" });
|
|
18671
|
+
var HorizontalSeparator = () => /* @__PURE__ */ React113.createElement(Spacer.Horizontal, { size: "inspector-h-separator" });
|
|
18462
18672
|
var RowLabel = forwardRef29(function RowLabel2({
|
|
18463
18673
|
className,
|
|
18464
18674
|
$textStyle,
|
|
18465
18675
|
...props
|
|
18466
18676
|
}, ref) {
|
|
18467
|
-
return /* @__PURE__ */
|
|
18677
|
+
return /* @__PURE__ */ React113.createElement(
|
|
18468
18678
|
"label",
|
|
18469
18679
|
{
|
|
18470
18680
|
ref,
|
|
@@ -18476,7 +18686,7 @@ var RowLabel = forwardRef29(function RowLabel2({
|
|
|
18476
18686
|
}
|
|
18477
18687
|
);
|
|
18478
18688
|
});
|
|
18479
|
-
var LabeledRow =
|
|
18689
|
+
var LabeledRow = memo39(function LabeledRow2({
|
|
18480
18690
|
id,
|
|
18481
18691
|
children,
|
|
18482
18692
|
label,
|
|
@@ -18484,7 +18694,7 @@ var LabeledRow = memo40(function LabeledRow2({
|
|
|
18484
18694
|
right,
|
|
18485
18695
|
className
|
|
18486
18696
|
}) {
|
|
18487
|
-
return /* @__PURE__ */
|
|
18697
|
+
return /* @__PURE__ */ React113.createElement(Row, { id, className }, /* @__PURE__ */ React113.createElement(Column, null, /* @__PURE__ */ React113.createElement(RowLabel, { $textStyle: labelTextStyle }, label, right && /* @__PURE__ */ React113.createElement(Spacer.Horizontal, null), right), /* @__PURE__ */ React113.createElement(Row, null, children)));
|
|
18488
18698
|
});
|
|
18489
18699
|
export {
|
|
18490
18700
|
AIAssistantInput,
|
|
@@ -18625,6 +18835,7 @@ export {
|
|
|
18625
18835
|
UserAvatar,
|
|
18626
18836
|
UserPicker,
|
|
18627
18837
|
UserPointer,
|
|
18838
|
+
Virtualized2 as Virtualized,
|
|
18628
18839
|
WorkspaceLayout,
|
|
18629
18840
|
WorkspaceSideProvider,
|
|
18630
18841
|
acceptsDrop,
|