@noya-app/noya-designsystem 0.1.80 → 0.1.82
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +11 -11
- package/CHANGELOG.md +13 -0
- package/dist/chunk-L6E2LZOL.mjs +44 -0
- package/dist/chunk-L6E2LZOL.mjs.map +1 -0
- package/dist/chunk-QDV7OQMJ.mjs +37 -0
- package/dist/chunk-QDV7OQMJ.mjs.map +1 -0
- package/dist/emojis.mjs +2 -1
- package/dist/emojis.mjs.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.mts +7 -4
- package/dist/index.d.ts +7 -4
- package/dist/index.js +374 -305
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +208 -132
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -4
- package/src/components/Drawer.tsx +8 -5
- package/src/components/EmojiPicker.tsx +13 -1
- package/src/components/Popover.tsx +8 -6
- package/src/components/SegmentedControl.tsx +17 -1
- package/src/components/SelectionToolbar.tsx +88 -71
- package/src/utils/mergeProps.ts +38 -0
- package/tsup.config.ts +8 -0
package/dist/index.js
CHANGED
|
@@ -39,12 +39,12 @@ var require_use_sync_external_store_shim_production = __commonJS({
|
|
|
39
39
|
return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y;
|
|
40
40
|
}
|
|
41
41
|
var objectIs = "function" === typeof Object.is ? Object.is : is;
|
|
42
|
-
var
|
|
43
|
-
var
|
|
42
|
+
var useState80 = React321.useState;
|
|
43
|
+
var useEffect61 = React321.useEffect;
|
|
44
44
|
var useLayoutEffect12 = React321.useLayoutEffect;
|
|
45
45
|
var useDebugValue2 = React321.useDebugValue;
|
|
46
46
|
function useSyncExternalStore$2(subscribe, getSnapshot) {
|
|
47
|
-
var value = getSnapshot(), _useState =
|
|
47
|
+
var value = getSnapshot(), _useState = useState80({ inst: { value, getSnapshot } }), inst = _useState[0].inst, forceUpdate = _useState[1];
|
|
48
48
|
useLayoutEffect12(
|
|
49
49
|
function() {
|
|
50
50
|
inst.value = value;
|
|
@@ -53,7 +53,7 @@ var require_use_sync_external_store_shim_production = __commonJS({
|
|
|
53
53
|
},
|
|
54
54
|
[subscribe, value, getSnapshot]
|
|
55
55
|
);
|
|
56
|
-
|
|
56
|
+
useEffect61(
|
|
57
57
|
function() {
|
|
58
58
|
checkIfSnapshotChanged(inst) && forceUpdate({ inst });
|
|
59
59
|
return subscribe(function() {
|
|
@@ -102,7 +102,7 @@ var require_use_sync_external_store_shim_development = __commonJS({
|
|
|
102
102
|
"The result of getSnapshot should be cached to avoid an infinite loop"
|
|
103
103
|
), didWarnUncachedGetSnapshot = true);
|
|
104
104
|
}
|
|
105
|
-
cachedValue =
|
|
105
|
+
cachedValue = useState80({
|
|
106
106
|
inst: { value, getSnapshot }
|
|
107
107
|
});
|
|
108
108
|
var inst = cachedValue[0].inst, forceUpdate = cachedValue[1];
|
|
@@ -114,7 +114,7 @@ var require_use_sync_external_store_shim_development = __commonJS({
|
|
|
114
114
|
},
|
|
115
115
|
[subscribe, value, getSnapshot]
|
|
116
116
|
);
|
|
117
|
-
|
|
117
|
+
useEffect61(
|
|
118
118
|
function() {
|
|
119
119
|
checkIfSnapshotChanged(inst) && forceUpdate({ inst });
|
|
120
120
|
return subscribe(function() {
|
|
@@ -140,7 +140,7 @@ var require_use_sync_external_store_shim_development = __commonJS({
|
|
|
140
140
|
return getSnapshot();
|
|
141
141
|
}
|
|
142
142
|
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
|
143
|
-
var React321 = require("react"), objectIs = "function" === typeof Object.is ? Object.is : is,
|
|
143
|
+
var React321 = require("react"), objectIs = "function" === typeof Object.is ? Object.is : is, useState80 = React321.useState, useEffect61 = React321.useEffect, useLayoutEffect12 = React321.useLayoutEffect, useDebugValue2 = React321.useDebugValue, didWarnOld18Alpha = false, didWarnUncachedGetSnapshot = false, shim = "undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement ? useSyncExternalStore$1 : useSyncExternalStore$2;
|
|
144
144
|
exports2.useSyncExternalStore = void 0 !== React321.useSyncExternalStore ? React321.useSyncExternalStore : shim;
|
|
145
145
|
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
|
|
146
146
|
}();
|
|
@@ -171,7 +171,7 @@ var require_with_selector_production = __commonJS({
|
|
|
171
171
|
var objectIs = "function" === typeof Object.is ? Object.is : is;
|
|
172
172
|
var useSyncExternalStore3 = shim.useSyncExternalStore;
|
|
173
173
|
var useRef95 = React321.useRef;
|
|
174
|
-
var
|
|
174
|
+
var useEffect61 = React321.useEffect;
|
|
175
175
|
var useMemo157 = React321.useMemo;
|
|
176
176
|
var useDebugValue2 = React321.useDebugValue;
|
|
177
177
|
exports2.useSyncExternalStoreWithSelector = function(subscribe, getSnapshot, getServerSnapshot, selector, isEqual) {
|
|
@@ -215,7 +215,7 @@ var require_with_selector_production = __commonJS({
|
|
|
215
215
|
[getSnapshot, getServerSnapshot, selector, isEqual]
|
|
216
216
|
);
|
|
217
217
|
var value = useSyncExternalStore3(subscribe, instRef[0], instRef[1]);
|
|
218
|
-
|
|
218
|
+
useEffect61(
|
|
219
219
|
function() {
|
|
220
220
|
inst.hasValue = true;
|
|
221
221
|
inst.value = value;
|
|
@@ -237,7 +237,7 @@ var require_with_selector_development = __commonJS({
|
|
|
237
237
|
return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y;
|
|
238
238
|
}
|
|
239
239
|
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
|
240
|
-
var React321 = require("react"), shim = require_shim(), objectIs = "function" === typeof Object.is ? Object.is : is, useSyncExternalStore3 = shim.useSyncExternalStore, useRef95 = React321.useRef,
|
|
240
|
+
var React321 = require("react"), shim = require_shim(), objectIs = "function" === typeof Object.is ? Object.is : is, useSyncExternalStore3 = shim.useSyncExternalStore, useRef95 = React321.useRef, useEffect61 = React321.useEffect, useMemo157 = React321.useMemo, useDebugValue2 = React321.useDebugValue;
|
|
241
241
|
exports2.useSyncExternalStoreWithSelector = function(subscribe, getSnapshot, getServerSnapshot, selector, isEqual) {
|
|
242
242
|
var instRef = useRef95(null);
|
|
243
243
|
if (null === instRef.current) {
|
|
@@ -280,7 +280,7 @@ var require_with_selector_development = __commonJS({
|
|
|
280
280
|
[getSnapshot, getServerSnapshot, selector, isEqual]
|
|
281
281
|
);
|
|
282
282
|
var value = useSyncExternalStore3(subscribe, instRef[0], instRef[1]);
|
|
283
|
-
|
|
283
|
+
useEffect61(
|
|
284
284
|
function() {
|
|
285
285
|
inst.hasValue = true;
|
|
286
286
|
inst.value = value;
|
|
@@ -4075,6 +4075,15 @@ var ClientStorage = class {
|
|
|
4075
4075
|
};
|
|
4076
4076
|
var clientStorage = new ClientStorage();
|
|
4077
4077
|
|
|
4078
|
+
// ../noya-react-utils/src/utils/composeRefs.ts
|
|
4079
|
+
function composeRefs(...refs) {
|
|
4080
|
+
return (value) => {
|
|
4081
|
+
for (const ref of refs) {
|
|
4082
|
+
assignRef(ref, value);
|
|
4083
|
+
}
|
|
4084
|
+
};
|
|
4085
|
+
}
|
|
4086
|
+
|
|
4078
4087
|
// src/components/ActionMenu.tsx
|
|
4079
4088
|
var import_react41 = __toESM(require("react"));
|
|
4080
4089
|
|
|
@@ -6546,11 +6555,11 @@ function getGridNavigatedIndex(listRef, {
|
|
|
6546
6555
|
if (loopFocus && (prevIndex - cols < minIndex || nextIndex < 0)) {
|
|
6547
6556
|
const col = prevIndex % cols;
|
|
6548
6557
|
const maxCol = maxIndex % cols;
|
|
6549
|
-
const
|
|
6558
|
+
const offset5 = maxIndex - (maxCol - col);
|
|
6550
6559
|
if (maxCol === col) {
|
|
6551
6560
|
nextIndex = maxIndex;
|
|
6552
6561
|
} else {
|
|
6553
|
-
nextIndex = maxCol > col ?
|
|
6562
|
+
nextIndex = maxCol > col ? offset5 : offset5 - cols;
|
|
6554
6563
|
}
|
|
6555
6564
|
}
|
|
6556
6565
|
}
|
|
@@ -9043,7 +9052,7 @@ var limitShift = function(options) {
|
|
|
9043
9052
|
middlewareData
|
|
9044
9053
|
} = state;
|
|
9045
9054
|
const {
|
|
9046
|
-
offset:
|
|
9055
|
+
offset: offset5 = 0,
|
|
9047
9056
|
mainAxis: checkMainAxis = true,
|
|
9048
9057
|
crossAxis: checkCrossAxis = true
|
|
9049
9058
|
} = evaluate(options, state);
|
|
@@ -9055,7 +9064,7 @@ var limitShift = function(options) {
|
|
|
9055
9064
|
const mainAxis = getOppositeAxis(crossAxis);
|
|
9056
9065
|
let mainAxisCoord = coords[mainAxis];
|
|
9057
9066
|
let crossAxisCoord = coords[crossAxis];
|
|
9058
|
-
const rawOffset = evaluate(
|
|
9067
|
+
const rawOffset = evaluate(offset5, state);
|
|
9059
9068
|
const computedOffset = typeof rawOffset === "number" ? {
|
|
9060
9069
|
mainAxis: rawOffset,
|
|
9061
9070
|
crossAxis: 0
|
|
@@ -13631,14 +13640,14 @@ var baseArrow = (options) => ({
|
|
|
13631
13640
|
const min2 = minPadding;
|
|
13632
13641
|
const max2 = clientSize - arrowDimensions[length] - maxPadding;
|
|
13633
13642
|
const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;
|
|
13634
|
-
const
|
|
13635
|
-
const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !==
|
|
13643
|
+
const offset5 = clamp(min2, center, max2);
|
|
13644
|
+
const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset5 && rects.reference[length] / 2 - (center < min2 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0;
|
|
13636
13645
|
const alignmentOffset = shouldAddOffset ? center < min2 ? center - min2 : center - max2 : 0;
|
|
13637
13646
|
return {
|
|
13638
13647
|
[axis]: coords[axis] + alignmentOffset,
|
|
13639
13648
|
data: {
|
|
13640
|
-
[axis]:
|
|
13641
|
-
centerOffset: center -
|
|
13649
|
+
[axis]: offset5,
|
|
13650
|
+
centerOffset: center - offset5 - alignmentOffset,
|
|
13642
13651
|
...shouldAddOffset && {
|
|
13643
13652
|
alignmentOffset
|
|
13644
13653
|
}
|
|
@@ -17084,8 +17093,8 @@ var TooltipViewport = /* @__PURE__ */ React102.forwardRef(function TooltipViewpo
|
|
|
17084
17093
|
if (activeTrigger && previousActiveTrigger && activeTrigger !== previousActiveTrigger && lastHandledTriggerRef.current !== activeTrigger && capturedNodeRef.current) {
|
|
17085
17094
|
setPreviousContentNode(capturedNodeRef.current);
|
|
17086
17095
|
setShowStartingStyleAttribute(true);
|
|
17087
|
-
const
|
|
17088
|
-
setNewTriggerOffset(
|
|
17096
|
+
const offset5 = calculateRelativePosition(previousActiveTrigger, activeTrigger);
|
|
17097
|
+
setNewTriggerOffset(offset5);
|
|
17089
17098
|
cleanupFrame.request(() => {
|
|
17090
17099
|
cleanupFrame.request(() => {
|
|
17091
17100
|
setShowStartingStyleAttribute(false);
|
|
@@ -17162,11 +17171,11 @@ var TooltipViewport = /* @__PURE__ */ React102.forwardRef(function TooltipViewpo
|
|
|
17162
17171
|
});
|
|
17163
17172
|
});
|
|
17164
17173
|
if (process.env.NODE_ENV !== "production") TooltipViewport.displayName = "TooltipViewport";
|
|
17165
|
-
function getActivationDirection(
|
|
17166
|
-
if (!
|
|
17174
|
+
function getActivationDirection(offset5) {
|
|
17175
|
+
if (!offset5) {
|
|
17167
17176
|
return void 0;
|
|
17168
17177
|
}
|
|
17169
|
-
return `${getValueWithTolerance(
|
|
17178
|
+
return `${getValueWithTolerance(offset5.horizontal, 5, "right", "left")} ${getValueWithTolerance(offset5.vertical, 5, "down", "up")}`;
|
|
17170
17179
|
}
|
|
17171
17180
|
function getValueWithTolerance(value, tolerance, positiveLabel, negativeLabel) {
|
|
17172
17181
|
if (value > tolerance) {
|
|
@@ -17252,6 +17261,29 @@ function mergePropsWithEventComposition(triggerProps, childProps) {
|
|
|
17252
17261
|
};
|
|
17253
17262
|
}
|
|
17254
17263
|
}
|
|
17264
|
+
if (triggerProps.ref || childProps.ref) {
|
|
17265
|
+
const triggerRef = triggerProps.ref;
|
|
17266
|
+
const childRef = childProps.ref;
|
|
17267
|
+
if (triggerRef && childRef) {
|
|
17268
|
+
mergedProps.ref = (value) => {
|
|
17269
|
+
assignRef(triggerRef, value);
|
|
17270
|
+
assignRef(childRef, value);
|
|
17271
|
+
};
|
|
17272
|
+
} else if (childRef) {
|
|
17273
|
+
mergedProps.ref = childRef;
|
|
17274
|
+
}
|
|
17275
|
+
}
|
|
17276
|
+
if (typeof triggerProps.style === "object" && triggerProps.style !== null && typeof childProps.style === "object" && childProps.style !== null) {
|
|
17277
|
+
mergedProps.style = { ...triggerProps.style, ...childProps.style };
|
|
17278
|
+
} else if (childProps.style !== void 0) {
|
|
17279
|
+
mergedProps.style = childProps.style;
|
|
17280
|
+
}
|
|
17281
|
+
if (triggerProps.className || childProps.className) {
|
|
17282
|
+
const classes = [triggerProps.className, childProps.className].filter(Boolean).join(" ");
|
|
17283
|
+
if (classes) {
|
|
17284
|
+
mergedProps.className = classes;
|
|
17285
|
+
}
|
|
17286
|
+
}
|
|
17255
17287
|
return mergedProps;
|
|
17256
17288
|
}
|
|
17257
17289
|
function cloneElementWithMergedProps(element, triggerProps) {
|
|
@@ -21294,8 +21326,8 @@ var PopoverViewport = /* @__PURE__ */ React156.forwardRef(function PopoverViewpo
|
|
|
21294
21326
|
if (activeTrigger && previousActiveTrigger && activeTrigger !== previousActiveTrigger && lastHandledTriggerRef.current !== activeTrigger && capturedNodeRef.current) {
|
|
21295
21327
|
setPreviousContentNode(capturedNodeRef.current);
|
|
21296
21328
|
setShowStartingStyleAttribute(true);
|
|
21297
|
-
const
|
|
21298
|
-
setNewTriggerOffset(
|
|
21329
|
+
const offset5 = calculateRelativePosition2(previousActiveTrigger, activeTrigger);
|
|
21330
|
+
setNewTriggerOffset(offset5);
|
|
21299
21331
|
cleanupFrame.request(() => {
|
|
21300
21332
|
cleanupFrame.request(() => {
|
|
21301
21333
|
setShowStartingStyleAttribute(false);
|
|
@@ -21360,11 +21392,11 @@ var PopoverViewport = /* @__PURE__ */ React156.forwardRef(function PopoverViewpo
|
|
|
21360
21392
|
});
|
|
21361
21393
|
});
|
|
21362
21394
|
if (process.env.NODE_ENV !== "production") PopoverViewport.displayName = "PopoverViewport";
|
|
21363
|
-
function getActivationDirection2(
|
|
21364
|
-
if (!
|
|
21395
|
+
function getActivationDirection2(offset5) {
|
|
21396
|
+
if (!offset5) {
|
|
21365
21397
|
return void 0;
|
|
21366
21398
|
}
|
|
21367
|
-
return `${getValueWithTolerance2(
|
|
21399
|
+
return `${getValueWithTolerance2(offset5.horizontal, 5, "right", "left")} ${getValueWithTolerance2(offset5.vertical, 5, "down", "up")}`;
|
|
21368
21400
|
}
|
|
21369
21401
|
function getValueWithTolerance2(value, tolerance, positiveLabel, negativeLabel) {
|
|
21370
21402
|
if (value > tolerance) {
|
|
@@ -21572,9 +21604,12 @@ function Popover({
|
|
|
21572
21604
|
triggerProps,
|
|
21573
21605
|
childProps
|
|
21574
21606
|
);
|
|
21575
|
-
mergedProps.ref = (
|
|
21576
|
-
|
|
21577
|
-
|
|
21607
|
+
mergedProps.ref = composeRefs(
|
|
21608
|
+
mergedProps.ref,
|
|
21609
|
+
(node) => {
|
|
21610
|
+
if (node) setAnchorElement(node);
|
|
21611
|
+
}
|
|
21612
|
+
);
|
|
21578
21613
|
return import_react33.default.cloneElement(
|
|
21579
21614
|
element,
|
|
21580
21615
|
mergedProps
|
|
@@ -26701,18 +26736,18 @@ function buildMeasurements({
|
|
|
26701
26736
|
gap
|
|
26702
26737
|
}) {
|
|
26703
26738
|
const measurements = [];
|
|
26704
|
-
let
|
|
26739
|
+
let offset5 = paddingTop;
|
|
26705
26740
|
for (let index2 = 0; index2 < itemCount; index2 += 1) {
|
|
26706
26741
|
const size4 = Math.max(0, getItemHeight(index2));
|
|
26707
|
-
const start =
|
|
26742
|
+
const start = offset5;
|
|
26708
26743
|
const end = start + size4;
|
|
26709
26744
|
measurements.push({ index: index2, size: size4, start, end });
|
|
26710
|
-
|
|
26745
|
+
offset5 = end + gap;
|
|
26711
26746
|
}
|
|
26712
26747
|
const totalHeight = measurements.length ? measurements[measurements.length - 1].end + paddingBottom : paddingTop + paddingBottom;
|
|
26713
26748
|
return { measurements, totalHeight };
|
|
26714
26749
|
}
|
|
26715
|
-
function findFirstVisibleIndex(measurements,
|
|
26750
|
+
function findFirstVisibleIndex(measurements, offset5) {
|
|
26716
26751
|
if (!measurements.length) return 0;
|
|
26717
26752
|
let low = 0;
|
|
26718
26753
|
let high = measurements.length - 1;
|
|
@@ -26720,7 +26755,7 @@ function findFirstVisibleIndex(measurements, offset4) {
|
|
|
26720
26755
|
while (low <= high) {
|
|
26721
26756
|
const middle = Math.floor((low + high) / 2);
|
|
26722
26757
|
const measurement = measurements[middle];
|
|
26723
|
-
if (measurement.end >
|
|
26758
|
+
if (measurement.end > offset5) {
|
|
26724
26759
|
match = middle;
|
|
26725
26760
|
high = middle - 1;
|
|
26726
26761
|
} else {
|
|
@@ -26937,8 +26972,8 @@ var VirtualizedInner = import_react61.default.forwardRef(function Virtualized({
|
|
|
26937
26972
|
},
|
|
26938
26973
|
visibleRange.end >= visibleRange.start && Array.from(
|
|
26939
26974
|
{ length: visibleRange.end - visibleRange.start + 1 },
|
|
26940
|
-
(_,
|
|
26941
|
-
const index2 = visibleRange.start +
|
|
26975
|
+
(_, offset5) => {
|
|
26976
|
+
const index2 = visibleRange.start + offset5;
|
|
26942
26977
|
const measurement = measurements[index2];
|
|
26943
26978
|
const key = itemKey ? itemKey(index2) : index2;
|
|
26944
26979
|
return /* @__PURE__ */ import_react61.default.createElement(
|
|
@@ -30928,9 +30963,12 @@ var Drawer = React229.memo(
|
|
|
30928
30963
|
triggerProps,
|
|
30929
30964
|
childProps
|
|
30930
30965
|
);
|
|
30931
|
-
mergedProps.ref = (
|
|
30932
|
-
|
|
30933
|
-
|
|
30966
|
+
mergedProps.ref = composeRefs(
|
|
30967
|
+
mergedProps.ref,
|
|
30968
|
+
(node) => {
|
|
30969
|
+
if (node) setAnchorElement(node);
|
|
30970
|
+
}
|
|
30971
|
+
);
|
|
30934
30972
|
return React229.cloneElement(
|
|
30935
30973
|
element,
|
|
30936
30974
|
mergedProps
|
|
@@ -31105,6 +31143,7 @@ var SegmentedControl = memoGeneric(function SegmentedControl2({
|
|
|
31105
31143
|
const containerRef = (0, import_react81.useRef)(null);
|
|
31106
31144
|
const itemRefs = (0, import_react81.useRef)([]);
|
|
31107
31145
|
const [indicatorStyle, setIndicatorStyle] = (0, import_react81.useState)(null);
|
|
31146
|
+
const [resizeTrigger, setResizeTrigger] = (0, import_react81.useState)(0);
|
|
31108
31147
|
const selectedIndex = (0, import_react81.useMemo)(() => {
|
|
31109
31148
|
if (!value) return -1;
|
|
31110
31149
|
return items.findIndex((item) => item.value === value);
|
|
@@ -31127,7 +31166,16 @@ var SegmentedControl = memoGeneric(function SegmentedControl2({
|
|
|
31127
31166
|
width: itemRect.width
|
|
31128
31167
|
});
|
|
31129
31168
|
hasInitialized.current = true;
|
|
31130
|
-
}, [selectedIndex, variant, items.length]);
|
|
31169
|
+
}, [selectedIndex, variant, items.length, resizeTrigger]);
|
|
31170
|
+
(0, import_react81.useLayoutEffect)(() => {
|
|
31171
|
+
const container = containerRef.current;
|
|
31172
|
+
if (!container || variant !== "default") return;
|
|
31173
|
+
const observer = new ResizeObserver(() => {
|
|
31174
|
+
setResizeTrigger((prev) => prev + 1);
|
|
31175
|
+
});
|
|
31176
|
+
observer.observe(container);
|
|
31177
|
+
return () => observer.disconnect();
|
|
31178
|
+
}, [variant]);
|
|
31131
31179
|
const handleSelect = (0, import_react81.useCallback)(
|
|
31132
31180
|
(newValue) => {
|
|
31133
31181
|
if (!allowEmpty && !newValue) return;
|
|
@@ -31234,6 +31282,7 @@ var SECTION_HEADER_HEIGHT = 24;
|
|
|
31234
31282
|
var HEADER_HEIGHT = 80;
|
|
31235
31283
|
var FOOTER_HEIGHT = 40;
|
|
31236
31284
|
var HORIZONTAL_PADDING = 8;
|
|
31285
|
+
var SEGMENTED_CONTROL_ITEM_WIDTH = 31;
|
|
31237
31286
|
var categoryIcons = {
|
|
31238
31287
|
search: /* @__PURE__ */ import_react82.default.createElement(import_noya_icons10.MagnifyingGlassIcon, null),
|
|
31239
31288
|
frequent: /* @__PURE__ */ import_react82.default.createElement(import_noya_icons10.ClockIcon, null),
|
|
@@ -31575,6 +31624,14 @@ var EmojiPicker = (0, import_react82.memo)(function EmojiPicker2({
|
|
|
31575
31624
|
],
|
|
31576
31625
|
[frequentlyUsed.length]
|
|
31577
31626
|
);
|
|
31627
|
+
const segmentedControlGap = (0, import_react82.useMemo)(() => {
|
|
31628
|
+
const numItems = categoryItems.length;
|
|
31629
|
+
const availableWidth = size4.width - HORIZONTAL_PADDING * 2;
|
|
31630
|
+
const totalItemsWidth = numItems * SEGMENTED_CONTROL_ITEM_WIDTH;
|
|
31631
|
+
const remainingSpace = availableWidth - totalItemsWidth;
|
|
31632
|
+
const numGaps = numItems - 1;
|
|
31633
|
+
return numGaps > 0 ? Math.max(0, remainingSpace / numGaps) : 0;
|
|
31634
|
+
}, [categoryItems.length, size4.width]);
|
|
31578
31635
|
const displayEmoji = hoveredEmoji ?? selectedEmoji;
|
|
31579
31636
|
const footerText = displayEmoji ? `:${displayEmoji.names[0]}:${displayEmoji.names.length > 1 ? ` :${displayEmoji.names[1]}:` : ""}` : "";
|
|
31580
31637
|
const skinToneMenuItems = (0, import_react82.useMemo)(
|
|
@@ -31599,7 +31656,8 @@ var EmojiPicker = (0, import_react82.memo)(function EmojiPicker2({
|
|
|
31599
31656
|
value: activeCategory ?? "search",
|
|
31600
31657
|
onValueChange: handleCategoryChange,
|
|
31601
31658
|
allowEmpty: true,
|
|
31602
|
-
className: "n-flex-nowrap n-px-2"
|
|
31659
|
+
className: "n-flex-nowrap n-px-2",
|
|
31660
|
+
style: { gap: segmentedControlGap }
|
|
31603
31661
|
}
|
|
31604
31662
|
),
|
|
31605
31663
|
/* @__PURE__ */ import_react82.default.createElement(Divider, null),
|
|
@@ -36431,27 +36489,18 @@ var Section = (0, import_react102.memo)(function InspectorSection({
|
|
|
36431
36489
|
});
|
|
36432
36490
|
|
|
36433
36491
|
// src/components/SelectionToolbar.tsx
|
|
36434
|
-
var
|
|
36435
|
-
var
|
|
36436
|
-
|
|
36437
|
-
|
|
36438
|
-
|
|
36439
|
-
|
|
36440
|
-
|
|
36441
|
-
|
|
36442
|
-
|
|
36443
|
-
top: rect.y,
|
|
36444
|
-
right: rect.x + rect.width,
|
|
36445
|
-
bottom: rect.y + rect.height,
|
|
36446
|
-
left: rect.x,
|
|
36447
|
-
toJSON: () => null
|
|
36448
|
-
})
|
|
36449
|
-
});
|
|
36450
|
-
var SelectionToolbarContainer = (0, import_react103.memo)(
|
|
36492
|
+
var import_react103 = require("@floating-ui/react");
|
|
36493
|
+
var import_react104 = __toESM(require("react"));
|
|
36494
|
+
function getPlacement(side, align) {
|
|
36495
|
+
if (align === "center") {
|
|
36496
|
+
return side;
|
|
36497
|
+
}
|
|
36498
|
+
return `${side}-${align}`;
|
|
36499
|
+
}
|
|
36500
|
+
var SelectionToolbarContainer = (0, import_react104.memo)(
|
|
36451
36501
|
function SelectionToolbarContainer2({
|
|
36452
36502
|
rect,
|
|
36453
36503
|
children,
|
|
36454
|
-
portalContainer,
|
|
36455
36504
|
side = "top",
|
|
36456
36505
|
sideOffset = 10,
|
|
36457
36506
|
align = "center",
|
|
@@ -36461,33 +36510,54 @@ var SelectionToolbarContainer = (0, import_react103.memo)(
|
|
|
36461
36510
|
transitionDuration = 0.2
|
|
36462
36511
|
}) {
|
|
36463
36512
|
const portalScopeId = usePortalScopeId();
|
|
36464
|
-
const
|
|
36465
|
-
const
|
|
36466
|
-
|
|
36513
|
+
const [containerElement, setContainerElement] = (0, import_react104.useState)(null);
|
|
36514
|
+
const containerRef = (0, import_react104.useCallback)((el) => {
|
|
36515
|
+
setContainerElement(el);
|
|
36516
|
+
}, []);
|
|
36517
|
+
const containerRefObject = (0, import_react104.useMemo)(
|
|
36518
|
+
() => ({ current: containerElement }),
|
|
36519
|
+
[containerElement]
|
|
36520
|
+
);
|
|
36521
|
+
const size4 = useSize(containerRefObject, "width");
|
|
36522
|
+
const virtualElement = (0, import_react104.useMemo)(
|
|
36467
36523
|
() => ({
|
|
36468
|
-
|
|
36524
|
+
getBoundingClientRect: () => ({
|
|
36525
|
+
width: rect.width,
|
|
36526
|
+
height: rect.height,
|
|
36527
|
+
x: rect.x,
|
|
36528
|
+
y: rect.y,
|
|
36529
|
+
top: rect.y,
|
|
36530
|
+
right: rect.x + rect.width,
|
|
36531
|
+
bottom: rect.y + rect.height,
|
|
36532
|
+
left: rect.x
|
|
36533
|
+
})
|
|
36469
36534
|
}),
|
|
36470
36535
|
[rect]
|
|
36471
36536
|
);
|
|
36472
|
-
const
|
|
36473
|
-
|
|
36537
|
+
const placement = getPlacement(side, align);
|
|
36538
|
+
const { refs, floatingStyles } = (0, import_react103.useFloating)({
|
|
36539
|
+
placement,
|
|
36540
|
+
middleware: avoidCollisions ? [(0, import_react103.offset)(sideOffset), (0, import_react103.flip)(), (0, import_react103.shift)({ padding: 10 })] : [(0, import_react103.offset)(sideOffset)]
|
|
36541
|
+
});
|
|
36542
|
+
(0, import_react104.useEffect)(() => {
|
|
36543
|
+
refs.setPositionReference(virtualElement);
|
|
36544
|
+
}, [refs, virtualElement]);
|
|
36545
|
+
return /* @__PURE__ */ import_react104.default.createElement(import_react103.FloatingPortal, null, /* @__PURE__ */ import_react104.default.createElement(
|
|
36546
|
+
"div",
|
|
36474
36547
|
{
|
|
36548
|
+
ref: refs.setFloating,
|
|
36475
36549
|
...portalScopeProps(portalScopeId),
|
|
36476
|
-
side,
|
|
36477
|
-
sideOffset,
|
|
36478
|
-
align,
|
|
36479
|
-
avoidCollisions,
|
|
36480
|
-
collisionPadding: 10,
|
|
36481
36550
|
contentEditable: false,
|
|
36482
36551
|
style: {
|
|
36483
|
-
|
|
36552
|
+
...floatingStyles,
|
|
36484
36553
|
opacity: size4 ? 1 : 0,
|
|
36485
36554
|
transition: `opacity ${transitionDuration}s ease-in-out`,
|
|
36486
36555
|
[cssVarNames.colors.inputBackground]: "transparent",
|
|
36487
36556
|
[cssVarNames.colors.buttonBackground]: "transparent"
|
|
36488
|
-
}
|
|
36557
|
+
},
|
|
36558
|
+
className: "n-z-menu"
|
|
36489
36559
|
},
|
|
36490
|
-
/* @__PURE__ */
|
|
36560
|
+
/* @__PURE__ */ import_react104.default.createElement(
|
|
36491
36561
|
"div",
|
|
36492
36562
|
{
|
|
36493
36563
|
ref: containerRef,
|
|
@@ -36503,8 +36573,7 @@ var SelectionToolbarContainer = (0, import_react103.memo)(
|
|
|
36503
36573
|
},
|
|
36504
36574
|
children
|
|
36505
36575
|
)
|
|
36506
|
-
);
|
|
36507
|
-
return /* @__PURE__ */ import_react103.default.createElement(PopperPrimitive.Root, null, /* @__PURE__ */ import_react103.default.createElement(PopperPrimitive.Anchor, { virtualRef }), portalContainer ? (0, import_react_dom8.createPortal)(popperContent, portalContainer) : popperContent);
|
|
36576
|
+
));
|
|
36508
36577
|
}
|
|
36509
36578
|
);
|
|
36510
36579
|
|
|
@@ -38875,7 +38944,7 @@ var SelectGroupLabel = /* @__PURE__ */ React289.forwardRef(function SelectGroupL
|
|
|
38875
38944
|
if (process.env.NODE_ENV !== "production") SelectGroupLabel.displayName = "SelectGroupLabel";
|
|
38876
38945
|
|
|
38877
38946
|
// src/components/SelectMenu.tsx
|
|
38878
|
-
var
|
|
38947
|
+
var import_react105 = __toESM(require("react"));
|
|
38879
38948
|
var readOnlyStyle = {
|
|
38880
38949
|
justifyContent: "flex-start",
|
|
38881
38950
|
textAlign: "left"
|
|
@@ -38898,29 +38967,29 @@ function SelectItemContent({
|
|
|
38898
38967
|
indented,
|
|
38899
38968
|
children
|
|
38900
38969
|
}) {
|
|
38901
|
-
return /* @__PURE__ */
|
|
38970
|
+
return /* @__PURE__ */ import_react105.default.createElement(import_react105.default.Fragment, null, indented && /* @__PURE__ */ import_react105.default.createElement(Spacer.Horizontal, { size: CHECKBOX_INDENT_WIDTH }), checked ? /* @__PURE__ */ import_react105.default.createElement(
|
|
38902
38971
|
"span",
|
|
38903
38972
|
{
|
|
38904
38973
|
className: "n-flex n-items-center n-relative -n-left-2.5",
|
|
38905
38974
|
style: { marginRight: -CHECKBOX_RIGHT_INSET }
|
|
38906
38975
|
},
|
|
38907
|
-
/* @__PURE__ */
|
|
38908
|
-
) : indented ? /* @__PURE__ */
|
|
38976
|
+
/* @__PURE__ */ import_react105.default.createElement(import_noya_icons14.CheckIcon, null)
|
|
38977
|
+
) : indented ? /* @__PURE__ */ import_react105.default.createElement(Spacer.Horizontal, { size: CHECKBOX_WIDTH - CHECKBOX_RIGHT_INSET }) : null, icon && (typeof icon === "string" ? /* @__PURE__ */ import_react105.default.createElement(
|
|
38909
38978
|
Icon,
|
|
38910
38979
|
{
|
|
38911
38980
|
name: icon,
|
|
38912
38981
|
className: "n-mr-2 n-w-4 n-h-4 n-flex-shrink-0"
|
|
38913
38982
|
}
|
|
38914
|
-
) : /* @__PURE__ */
|
|
38983
|
+
) : /* @__PURE__ */ import_react105.default.createElement("span", { className: "n-mr-2 n-w-4 n-h-4 n-flex-shrink-0 n-flex n-items-center n-justify-center" }, icon)), /* @__PURE__ */ import_react105.default.createElement("div", { className: "n-flex n-items-center n-flex-1" }, children));
|
|
38915
38984
|
}
|
|
38916
38985
|
function SelectMenuItems({
|
|
38917
38986
|
items,
|
|
38918
38987
|
hasCheckedItem
|
|
38919
38988
|
}) {
|
|
38920
|
-
return /* @__PURE__ */
|
|
38989
|
+
return /* @__PURE__ */ import_react105.default.createElement(import_react105.default.Fragment, null, items.map((item, index2) => {
|
|
38921
38990
|
switch (item.type) {
|
|
38922
38991
|
case "separator":
|
|
38923
|
-
return /* @__PURE__ */
|
|
38992
|
+
return /* @__PURE__ */ import_react105.default.createElement(
|
|
38924
38993
|
index_parts_exports10.Separator,
|
|
38925
38994
|
{
|
|
38926
38995
|
key: index2,
|
|
@@ -38928,7 +38997,7 @@ function SelectMenuItems({
|
|
|
38928
38997
|
}
|
|
38929
38998
|
);
|
|
38930
38999
|
case "sectionHeader":
|
|
38931
|
-
return /* @__PURE__ */
|
|
39000
|
+
return /* @__PURE__ */ import_react105.default.createElement(
|
|
38932
39001
|
SectionHeaderMenuItem,
|
|
38933
39002
|
{
|
|
38934
39003
|
isFirst: index2 === 0,
|
|
@@ -38941,21 +39010,21 @@ function SelectMenuItems({
|
|
|
38941
39010
|
case "submenu":
|
|
38942
39011
|
return null;
|
|
38943
39012
|
default:
|
|
38944
|
-
return /* @__PURE__ */
|
|
39013
|
+
return /* @__PURE__ */ import_react105.default.createElement("div", { key: item.value, className: "n-px-1" }, /* @__PURE__ */ import_react105.default.createElement(
|
|
38945
39014
|
index_parts_exports10.Item,
|
|
38946
39015
|
{
|
|
38947
39016
|
value: item.value,
|
|
38948
39017
|
disabled: item.disabled,
|
|
38949
39018
|
className: itemStyle3
|
|
38950
39019
|
},
|
|
38951
|
-
/* @__PURE__ */
|
|
39020
|
+
/* @__PURE__ */ import_react105.default.createElement(
|
|
38952
39021
|
SelectItemContent,
|
|
38953
39022
|
{
|
|
38954
39023
|
icon: item.icon,
|
|
38955
39024
|
checked: item.checked,
|
|
38956
39025
|
indented: hasCheckedItem
|
|
38957
39026
|
},
|
|
38958
|
-
/* @__PURE__ */
|
|
39027
|
+
/* @__PURE__ */ import_react105.default.createElement(index_parts_exports10.ItemText, null, item.title ?? item.value)
|
|
38959
39028
|
)
|
|
38960
39029
|
));
|
|
38961
39030
|
}
|
|
@@ -38982,20 +39051,20 @@ var SelectMenu = memoGeneric(function SelectMenu2({
|
|
|
38982
39051
|
(item) => isSelectableMenuItem(item) && item.value === value
|
|
38983
39052
|
);
|
|
38984
39053
|
const icon = selectedItem?.icon;
|
|
38985
|
-
const [internalOpen, setInternalOpen] = (0,
|
|
39054
|
+
const [internalOpen, setInternalOpen] = (0, import_react105.useState)(open2 ?? false);
|
|
38986
39055
|
const { label, fieldId: id } = useLabel({
|
|
38987
39056
|
label: props.label,
|
|
38988
39057
|
fieldId: props.id
|
|
38989
39058
|
});
|
|
38990
39059
|
const labelType = useLabelType();
|
|
38991
|
-
const handleOpenChange = (0,
|
|
39060
|
+
const handleOpenChange = (0, import_react105.useCallback)(
|
|
38992
39061
|
(newOpen) => {
|
|
38993
39062
|
onOpenChange?.(newOpen);
|
|
38994
39063
|
setInternalOpen(newOpen);
|
|
38995
39064
|
},
|
|
38996
39065
|
[onOpenChange]
|
|
38997
39066
|
);
|
|
38998
|
-
const handleValueChange = (0,
|
|
39067
|
+
const handleValueChange = (0, import_react105.useCallback)(
|
|
38999
39068
|
(newValue) => {
|
|
39000
39069
|
if (newValue !== null) {
|
|
39001
39070
|
onSelect?.(newValue);
|
|
@@ -39006,8 +39075,8 @@ var SelectMenu = memoGeneric(function SelectMenu2({
|
|
|
39006
39075
|
const hasCheckedItem = items.some(
|
|
39007
39076
|
(item) => isSelectableMenuItem(item) && item.checked
|
|
39008
39077
|
);
|
|
39009
|
-
const readOnlyButton = (0,
|
|
39010
|
-
() => /* @__PURE__ */
|
|
39078
|
+
const readOnlyButton = (0, import_react105.useMemo)(
|
|
39079
|
+
() => /* @__PURE__ */ import_react105.default.createElement(
|
|
39011
39080
|
Button,
|
|
39012
39081
|
{
|
|
39013
39082
|
id,
|
|
@@ -39017,11 +39086,11 @@ var SelectMenu = memoGeneric(function SelectMenu2({
|
|
|
39017
39086
|
disabled: disabled2
|
|
39018
39087
|
},
|
|
39019
39088
|
icon && renderIcon(icon),
|
|
39020
|
-
/* @__PURE__ */
|
|
39089
|
+
/* @__PURE__ */ import_react105.default.createElement("span", { className: "n-flex n-flex-1" }, selectedItem?.title ?? value)
|
|
39021
39090
|
),
|
|
39022
39091
|
[icon, id, style2, className, disabled2, value, selectedItem]
|
|
39023
39092
|
);
|
|
39024
|
-
const contentStyle = (0,
|
|
39093
|
+
const contentStyle = (0, import_react105.useMemo)(() => {
|
|
39025
39094
|
return {
|
|
39026
39095
|
width: "var(--anchor-width)",
|
|
39027
39096
|
minWidth: "max-content",
|
|
@@ -39029,7 +39098,7 @@ var SelectMenu = memoGeneric(function SelectMenu2({
|
|
|
39029
39098
|
...contentStyleProp
|
|
39030
39099
|
};
|
|
39031
39100
|
}, [contentStyleProp]);
|
|
39032
|
-
const content = /* @__PURE__ */
|
|
39101
|
+
const content = /* @__PURE__ */ import_react105.default.createElement(
|
|
39033
39102
|
index_parts_exports10.Root,
|
|
39034
39103
|
{
|
|
39035
39104
|
value,
|
|
@@ -39038,13 +39107,13 @@ var SelectMenu = memoGeneric(function SelectMenu2({
|
|
|
39038
39107
|
onOpenChange: handleOpenChange,
|
|
39039
39108
|
disabled: disabled2
|
|
39040
39109
|
},
|
|
39041
|
-
/* @__PURE__ */
|
|
39110
|
+
/* @__PURE__ */ import_react105.default.createElement(
|
|
39042
39111
|
index_parts_exports10.Trigger,
|
|
39043
39112
|
{
|
|
39044
39113
|
id,
|
|
39045
39114
|
onFocus,
|
|
39046
39115
|
onBlur,
|
|
39047
|
-
render: /* @__PURE__ */
|
|
39116
|
+
render: /* @__PURE__ */ import_react105.default.createElement(
|
|
39048
39117
|
Button,
|
|
39049
39118
|
{
|
|
39050
39119
|
style: style2,
|
|
@@ -39057,10 +39126,10 @@ var SelectMenu = memoGeneric(function SelectMenu2({
|
|
|
39057
39126
|
}
|
|
39058
39127
|
)
|
|
39059
39128
|
},
|
|
39060
|
-
icon && /* @__PURE__ */
|
|
39061
|
-
label && labelType === "inset" && /* @__PURE__ */
|
|
39062
|
-
/* @__PURE__ */
|
|
39063
|
-
/* @__PURE__ */
|
|
39129
|
+
icon && /* @__PURE__ */ import_react105.default.createElement("span", { className: "n-pr-1.5" }, renderIcon(icon)),
|
|
39130
|
+
label && labelType === "inset" && /* @__PURE__ */ import_react105.default.createElement("div", { className: insetEndStyles }, /* @__PURE__ */ import_react105.default.createElement(Label, { className: "n-pr-4 n-text-text-disabled", htmlFor: id }, label)),
|
|
39131
|
+
/* @__PURE__ */ import_react105.default.createElement("span", { className: "n-flex-1 n-flex" }, /* @__PURE__ */ import_react105.default.createElement(index_parts_exports10.Value, null, selectedItem?.title ?? value ?? placeholder)),
|
|
39132
|
+
/* @__PURE__ */ import_react105.default.createElement(index_parts_exports10.Icon, null, /* @__PURE__ */ import_react105.default.createElement(
|
|
39064
39133
|
import_noya_icons14.DropdownChevronIcon,
|
|
39065
39134
|
{
|
|
39066
39135
|
className: cx(
|
|
@@ -39070,7 +39139,7 @@ var SelectMenu = memoGeneric(function SelectMenu2({
|
|
|
39070
39139
|
}
|
|
39071
39140
|
))
|
|
39072
39141
|
),
|
|
39073
|
-
/* @__PURE__ */
|
|
39142
|
+
/* @__PURE__ */ import_react105.default.createElement(index_parts_exports10.Portal, null, /* @__PURE__ */ import_react105.default.createElement(
|
|
39074
39143
|
index_parts_exports10.Positioner,
|
|
39075
39144
|
{
|
|
39076
39145
|
...portalScopeProps(portalScopeId),
|
|
@@ -39080,12 +39149,12 @@ var SelectMenu = memoGeneric(function SelectMenu2({
|
|
|
39080
39149
|
style: contentStyle,
|
|
39081
39150
|
className: "n-z-menu"
|
|
39082
39151
|
},
|
|
39083
|
-
/* @__PURE__ */
|
|
39152
|
+
/* @__PURE__ */ import_react105.default.createElement(index_parts_exports10.Popup, { className: styles.contentStyle }, /* @__PURE__ */ import_react105.default.createElement(index_parts_exports10.ScrollUpArrow, { className: scrollButtonStyles }, /* @__PURE__ */ import_react105.default.createElement(
|
|
39084
39153
|
import_noya_icons14.ChevronUpIcon,
|
|
39085
39154
|
{
|
|
39086
39155
|
className: cx("n-transition-transform n-duration-100")
|
|
39087
39156
|
}
|
|
39088
|
-
)), /* @__PURE__ */
|
|
39157
|
+
)), /* @__PURE__ */ import_react105.default.createElement(SelectMenuItems, { items, hasCheckedItem }), /* @__PURE__ */ import_react105.default.createElement(index_parts_exports10.ScrollDownArrow, { className: scrollButtonStyles }, /* @__PURE__ */ import_react105.default.createElement(import_noya_icons14.ChevronDownIcon, null)))
|
|
39089
39158
|
))
|
|
39090
39159
|
);
|
|
39091
39160
|
return readOnly ? readOnlyButton : content;
|
|
@@ -40386,8 +40455,8 @@ var SliderThumb = /* @__PURE__ */ React296.forwardRef(function SliderThumb2(comp
|
|
|
40386
40455
|
if (thumbRef.current != null) {
|
|
40387
40456
|
const axis = orientation === "horizontal" ? "x" : "y";
|
|
40388
40457
|
const midpoint = getMidpoint(thumbRef.current);
|
|
40389
|
-
const
|
|
40390
|
-
pressedThumbCenterOffsetRef.current =
|
|
40458
|
+
const offset5 = (orientation === "horizontal" ? event2.clientX : event2.clientY) - midpoint[axis];
|
|
40459
|
+
pressedThumbCenterOffsetRef.current = offset5;
|
|
40391
40460
|
}
|
|
40392
40461
|
if (inputRef.current != null && pressedInputRef.current !== inputRef.current) {
|
|
40393
40462
|
pressedInputRef.current = inputRef.current;
|
|
@@ -40480,12 +40549,12 @@ var SliderIndicator = /* @__PURE__ */ React297.forwardRef(function SliderIndicat
|
|
|
40480
40549
|
if (process.env.NODE_ENV !== "production") SliderIndicator.displayName = "SliderIndicator";
|
|
40481
40550
|
|
|
40482
40551
|
// src/components/Slider.tsx
|
|
40483
|
-
var
|
|
40552
|
+
var import_react106 = __toESM(require("react"));
|
|
40484
40553
|
var THUMB_WIDTH = 8;
|
|
40485
40554
|
var thumbStyle = {
|
|
40486
40555
|
width: THUMB_WIDTH
|
|
40487
40556
|
};
|
|
40488
|
-
var Slider = (0,
|
|
40557
|
+
var Slider = (0, import_react106.memo)(function Slider2({
|
|
40489
40558
|
style: style2,
|
|
40490
40559
|
className,
|
|
40491
40560
|
value,
|
|
@@ -40503,14 +40572,14 @@ var Slider = (0, import_react105.memo)(function Slider2({
|
|
|
40503
40572
|
const { fieldId: id } = useLabel({
|
|
40504
40573
|
fieldId: props.id
|
|
40505
40574
|
});
|
|
40506
|
-
const handleValueChange = (0,
|
|
40575
|
+
const handleValueChange = (0, import_react106.useCallback)(
|
|
40507
40576
|
(newValue) => {
|
|
40508
40577
|
onValueChange(newValue);
|
|
40509
40578
|
},
|
|
40510
40579
|
[onValueChange]
|
|
40511
40580
|
);
|
|
40512
40581
|
const ratio = (clampedValue - min2) / (max2 - min2);
|
|
40513
|
-
return /* @__PURE__ */
|
|
40582
|
+
return /* @__PURE__ */ import_react106.default.createElement(
|
|
40514
40583
|
index_parts_exports11.Root,
|
|
40515
40584
|
{
|
|
40516
40585
|
min: min2,
|
|
@@ -40529,7 +40598,7 @@ var Slider = (0, import_react105.memo)(function Slider2({
|
|
|
40529
40598
|
disabled: readOnly,
|
|
40530
40599
|
thumbAlignment: "edge"
|
|
40531
40600
|
},
|
|
40532
|
-
/* @__PURE__ */
|
|
40601
|
+
/* @__PURE__ */ import_react106.default.createElement(index_parts_exports11.Control, { className: "n-relative n-flex-grow n-h-[21px] n-flex n-items-center" }, /* @__PURE__ */ import_react106.default.createElement(index_parts_exports11.Track, { className: "n-relative n-flex-grow n-h-[3px] n-overflow-hidden" }, /* @__PURE__ */ import_react106.default.createElement(
|
|
40533
40602
|
"div",
|
|
40534
40603
|
{
|
|
40535
40604
|
className: "n-absolute n-h-full n-rounded-l n-bg-slider-active-background",
|
|
@@ -40540,7 +40609,7 @@ var Slider = (0, import_react105.memo)(function Slider2({
|
|
|
40540
40609
|
width: `calc(${ratio * 100}% - ${ratio * THUMB_WIDTH + 2}px)`
|
|
40541
40610
|
}
|
|
40542
40611
|
}
|
|
40543
|
-
), /* @__PURE__ */
|
|
40612
|
+
), /* @__PURE__ */ import_react106.default.createElement(
|
|
40544
40613
|
"div",
|
|
40545
40614
|
{
|
|
40546
40615
|
className: "n-absolute n-h-full n-rounded-r n-bg-input-background",
|
|
@@ -40550,7 +40619,7 @@ var Slider = (0, import_react105.memo)(function Slider2({
|
|
|
40550
40619
|
width: `calc(${(1 - ratio) * 100}% - ${(1 - ratio) * THUMB_WIDTH + 2}px)`
|
|
40551
40620
|
}
|
|
40552
40621
|
}
|
|
40553
|
-
)), /* @__PURE__ */
|
|
40622
|
+
)), /* @__PURE__ */ import_react106.default.createElement(
|
|
40554
40623
|
index_parts_exports11.Thumb,
|
|
40555
40624
|
{
|
|
40556
40625
|
style: thumbStyle,
|
|
@@ -40587,8 +40656,8 @@ function createSharedDrag() {
|
|
|
40587
40656
|
|
|
40588
40657
|
// src/components/Stepper.tsx
|
|
40589
40658
|
var import_noya_utils19 = require("@noya-app/noya-utils");
|
|
40590
|
-
var
|
|
40591
|
-
var Stepper = (0,
|
|
40659
|
+
var import_react107 = __toESM(require("react"));
|
|
40660
|
+
var Stepper = (0, import_react107.memo)(function Stepper2({
|
|
40592
40661
|
style: style2,
|
|
40593
40662
|
className,
|
|
40594
40663
|
value: valueProp,
|
|
@@ -40605,17 +40674,17 @@ var Stepper = (0, import_react106.memo)(function Stepper2({
|
|
|
40605
40674
|
const { fieldId: id } = useLabel({
|
|
40606
40675
|
fieldId: props.id
|
|
40607
40676
|
});
|
|
40608
|
-
const value = (0,
|
|
40677
|
+
const value = (0, import_react107.useMemo)(() => {
|
|
40609
40678
|
return (0, import_noya_utils19.clamp)(valueProp, min2, max2);
|
|
40610
40679
|
}, [valueProp, min2, max2]);
|
|
40611
|
-
const handleValueChange = (0,
|
|
40680
|
+
const handleValueChange = (0, import_react107.useCallback)(
|
|
40612
40681
|
(value2) => {
|
|
40613
40682
|
const newValue = (0, import_noya_utils19.clamp)(value2, min2, max2);
|
|
40614
40683
|
onValueChange(newValue);
|
|
40615
40684
|
},
|
|
40616
40685
|
[onValueChange, min2, max2]
|
|
40617
40686
|
);
|
|
40618
|
-
return /* @__PURE__ */
|
|
40687
|
+
return /* @__PURE__ */ import_react107.default.createElement(
|
|
40619
40688
|
"div",
|
|
40620
40689
|
{
|
|
40621
40690
|
id,
|
|
@@ -40627,7 +40696,7 @@ var Stepper = (0, import_react106.memo)(function Stepper2({
|
|
|
40627
40696
|
onFocus,
|
|
40628
40697
|
onBlur
|
|
40629
40698
|
},
|
|
40630
|
-
/* @__PURE__ */
|
|
40699
|
+
/* @__PURE__ */ import_react107.default.createElement(
|
|
40631
40700
|
InputField2.Root,
|
|
40632
40701
|
{
|
|
40633
40702
|
className: "n-flex-1",
|
|
@@ -40635,7 +40704,7 @@ var Stepper = (0, import_react106.memo)(function Stepper2({
|
|
|
40635
40704
|
startClassName: "-n-ml-[3px]",
|
|
40636
40705
|
endWidth: 17,
|
|
40637
40706
|
endClassName: "-n-mr-[3px]",
|
|
40638
|
-
start: /* @__PURE__ */
|
|
40707
|
+
start: /* @__PURE__ */ import_react107.default.createElement(
|
|
40639
40708
|
IconButton,
|
|
40640
40709
|
{
|
|
40641
40710
|
iconName: "MinusIcon",
|
|
@@ -40649,7 +40718,7 @@ var Stepper = (0, import_react106.memo)(function Stepper2({
|
|
|
40649
40718
|
}
|
|
40650
40719
|
}
|
|
40651
40720
|
),
|
|
40652
|
-
end: /* @__PURE__ */
|
|
40721
|
+
end: /* @__PURE__ */ import_react107.default.createElement(
|
|
40653
40722
|
IconButton,
|
|
40654
40723
|
{
|
|
40655
40724
|
iconName: "PlusIcon",
|
|
@@ -40664,7 +40733,7 @@ var Stepper = (0, import_react106.memo)(function Stepper2({
|
|
|
40664
40733
|
}
|
|
40665
40734
|
)
|
|
40666
40735
|
},
|
|
40667
|
-
/* @__PURE__ */
|
|
40736
|
+
/* @__PURE__ */ import_react107.default.createElement(
|
|
40668
40737
|
InputField2.NumberInput,
|
|
40669
40738
|
{
|
|
40670
40739
|
value,
|
|
@@ -40989,7 +41058,7 @@ function Tabs({
|
|
|
40989
41058
|
}
|
|
40990
41059
|
|
|
40991
41060
|
// src/components/UserPicker.tsx
|
|
40992
|
-
var
|
|
41061
|
+
var import_react108 = __toESM(require("react"));
|
|
40993
41062
|
function UserPicker({
|
|
40994
41063
|
users,
|
|
40995
41064
|
value,
|
|
@@ -40999,27 +41068,27 @@ function UserPicker({
|
|
|
40999
41068
|
placeholder = "Search users...",
|
|
41000
41069
|
...rest
|
|
41001
41070
|
}) {
|
|
41002
|
-
const sortedUsers = (0,
|
|
41071
|
+
const sortedUsers = (0, import_react108.useMemo)(() => {
|
|
41003
41072
|
return [...users].sort(
|
|
41004
41073
|
(a, b) => getUserDisplayName(a).localeCompare(getUserDisplayName(b), void 0, {
|
|
41005
41074
|
sensitivity: "base"
|
|
41006
41075
|
})
|
|
41007
41076
|
);
|
|
41008
41077
|
}, [users]);
|
|
41009
|
-
const usersById = (0,
|
|
41078
|
+
const usersById = (0, import_react108.useMemo)(() => {
|
|
41010
41079
|
return new Map(sortedUsers.map((user) => [user.id, user]));
|
|
41011
41080
|
}, [sortedUsers]);
|
|
41012
|
-
const items = (0,
|
|
41081
|
+
const items = (0, import_react108.useMemo)(() => {
|
|
41013
41082
|
return sortedUsers.map(createUserMenuItem);
|
|
41014
41083
|
}, [sortedUsers]);
|
|
41015
41084
|
const isControlled = value !== void 0;
|
|
41016
|
-
const [uncontrolledValue, setUncontrolledValue] = (0,
|
|
41085
|
+
const [uncontrolledValue, setUncontrolledValue] = (0, import_react108.useState)(defaultValue2);
|
|
41017
41086
|
const selectedUserId = isControlled ? value : uncontrolledValue;
|
|
41018
|
-
const selectedItem = (0,
|
|
41087
|
+
const selectedItem = (0, import_react108.useMemo)(() => {
|
|
41019
41088
|
if (!selectedUserId) return void 0;
|
|
41020
41089
|
return items.find((item) => item.value === selectedUserId);
|
|
41021
41090
|
}, [items, selectedUserId]);
|
|
41022
|
-
const updateSelectedUserId = (0,
|
|
41091
|
+
const updateSelectedUserId = (0, import_react108.useCallback)(
|
|
41023
41092
|
(userId) => {
|
|
41024
41093
|
if (!isControlled) {
|
|
41025
41094
|
setUncontrolledValue(userId);
|
|
@@ -41028,14 +41097,14 @@ function UserPicker({
|
|
|
41028
41097
|
},
|
|
41029
41098
|
[isControlled, onChangeUserId]
|
|
41030
41099
|
);
|
|
41031
|
-
const handleSelectItem = (0,
|
|
41100
|
+
const handleSelectItem = (0, import_react108.useCallback)(
|
|
41032
41101
|
(item) => {
|
|
41033
41102
|
updateSelectedUserId(item.value);
|
|
41034
41103
|
onSelectUser?.(usersById.get(item.value));
|
|
41035
41104
|
},
|
|
41036
41105
|
[updateSelectedUserId, onSelectUser, usersById]
|
|
41037
41106
|
);
|
|
41038
|
-
return /* @__PURE__ */
|
|
41107
|
+
return /* @__PURE__ */ import_react108.default.createElement(
|
|
41039
41108
|
Combobox,
|
|
41040
41109
|
{
|
|
41041
41110
|
...rest,
|
|
@@ -41059,7 +41128,7 @@ function createUserMenuItem(user) {
|
|
|
41059
41128
|
return {
|
|
41060
41129
|
value: user.id,
|
|
41061
41130
|
title,
|
|
41062
|
-
icon: /* @__PURE__ */
|
|
41131
|
+
icon: /* @__PURE__ */ import_react108.default.createElement("div", { className: "n-relative n-w-[15px] n-h-[15px]" }, /* @__PURE__ */ import_react108.default.createElement(
|
|
41063
41132
|
Avatar,
|
|
41064
41133
|
{
|
|
41065
41134
|
size: 15 + overflow * 2,
|
|
@@ -41078,15 +41147,15 @@ function createUserMenuItem(user) {
|
|
|
41078
41147
|
}
|
|
41079
41148
|
|
|
41080
41149
|
// src/components/UserPointer.tsx
|
|
41081
|
-
var
|
|
41082
|
-
var UserPointerContainer = (0,
|
|
41150
|
+
var import_react109 = __toESM(require("react"));
|
|
41151
|
+
var UserPointerContainer = (0, import_react109.memo)(function UserPointerContainer2({
|
|
41083
41152
|
point,
|
|
41084
41153
|
visible,
|
|
41085
41154
|
children,
|
|
41086
41155
|
className,
|
|
41087
41156
|
style: style2
|
|
41088
41157
|
}) {
|
|
41089
|
-
return /* @__PURE__ */
|
|
41158
|
+
return /* @__PURE__ */ import_react109.default.createElement(
|
|
41090
41159
|
"div",
|
|
41091
41160
|
{
|
|
41092
41161
|
style: {
|
|
@@ -41105,7 +41174,7 @@ var UserPointerContainer = (0, import_react108.memo)(function UserPointerContain
|
|
|
41105
41174
|
children
|
|
41106
41175
|
);
|
|
41107
41176
|
});
|
|
41108
|
-
var UserNameTag = (0,
|
|
41177
|
+
var UserNameTag = (0, import_react109.memo)(function UserNameTag2({
|
|
41109
41178
|
backgroundColor,
|
|
41110
41179
|
className,
|
|
41111
41180
|
style: style2,
|
|
@@ -41114,7 +41183,7 @@ var UserNameTag = (0, import_react108.memo)(function UserNameTag2({
|
|
|
41114
41183
|
size: size4 = "medium",
|
|
41115
41184
|
bordered = true
|
|
41116
41185
|
}) {
|
|
41117
|
-
return /* @__PURE__ */
|
|
41186
|
+
return /* @__PURE__ */ import_react109.default.createElement(
|
|
41118
41187
|
"span",
|
|
41119
41188
|
{
|
|
41120
41189
|
className: cx(
|
|
@@ -41133,14 +41202,14 @@ var UserNameTag = (0, import_react108.memo)(function UserNameTag2({
|
|
|
41133
41202
|
children
|
|
41134
41203
|
);
|
|
41135
41204
|
});
|
|
41136
|
-
var UserPointerIcon = (0,
|
|
41205
|
+
var UserPointerIcon = (0, import_react109.memo)(function PointerIcon({
|
|
41137
41206
|
size: size4,
|
|
41138
41207
|
color = "black",
|
|
41139
41208
|
className,
|
|
41140
41209
|
style: style2
|
|
41141
41210
|
}) {
|
|
41142
41211
|
const points = "0,5 10,0 10,10";
|
|
41143
|
-
return /* @__PURE__ */
|
|
41212
|
+
return /* @__PURE__ */ import_react109.default.createElement(
|
|
41144
41213
|
"svg",
|
|
41145
41214
|
{
|
|
41146
41215
|
width: size4,
|
|
@@ -41155,7 +41224,7 @@ var UserPointerIcon = (0, import_react108.memo)(function PointerIcon({
|
|
|
41155
41224
|
...style2
|
|
41156
41225
|
}
|
|
41157
41226
|
},
|
|
41158
|
-
/* @__PURE__ */
|
|
41227
|
+
/* @__PURE__ */ import_react109.default.createElement(
|
|
41159
41228
|
"polygon",
|
|
41160
41229
|
{
|
|
41161
41230
|
points,
|
|
@@ -41168,7 +41237,7 @@ var UserPointerIcon = (0, import_react108.memo)(function PointerIcon({
|
|
|
41168
41237
|
});
|
|
41169
41238
|
var POINTER_SIZE = 12;
|
|
41170
41239
|
var POINTER_OVERLAP = 6;
|
|
41171
|
-
var UserPointer = (0,
|
|
41240
|
+
var UserPointer = (0, import_react109.memo)(function UserPointer2({
|
|
41172
41241
|
userId,
|
|
41173
41242
|
name,
|
|
41174
41243
|
visible = true,
|
|
@@ -41181,22 +41250,22 @@ var UserPointer = (0, import_react108.memo)(function UserPointer2({
|
|
|
41181
41250
|
labelSize = "medium",
|
|
41182
41251
|
bordered = true
|
|
41183
41252
|
}) {
|
|
41184
|
-
const userBackgroundColor = (0,
|
|
41253
|
+
const userBackgroundColor = (0, import_react109.useMemo)(
|
|
41185
41254
|
() => backgroundColor ?? colorFromString(userId ?? name ?? ""),
|
|
41186
41255
|
[backgroundColor, userId, name]
|
|
41187
41256
|
);
|
|
41188
|
-
const pointerOverlapStyle = (0,
|
|
41257
|
+
const pointerOverlapStyle = (0, import_react109.useMemo)(
|
|
41189
41258
|
() => ({
|
|
41190
41259
|
marginRight: `-${POINTER_OVERLAP}px`,
|
|
41191
41260
|
marginBottom: `-${POINTER_OVERLAP}px`
|
|
41192
41261
|
}),
|
|
41193
41262
|
[]
|
|
41194
41263
|
);
|
|
41195
|
-
const nameTagOverlapStyle = (0,
|
|
41264
|
+
const nameTagOverlapStyle = (0, import_react109.useMemo)(
|
|
41196
41265
|
() => ({ marginLeft: `${POINTER_SIZE - POINTER_OVERLAP + 1}px` }),
|
|
41197
41266
|
[]
|
|
41198
41267
|
);
|
|
41199
|
-
return /* @__PURE__ */
|
|
41268
|
+
return /* @__PURE__ */ import_react109.default.createElement(
|
|
41200
41269
|
UserPointerContainer,
|
|
41201
41270
|
{
|
|
41202
41271
|
point,
|
|
@@ -41204,14 +41273,14 @@ var UserPointer = (0, import_react108.memo)(function UserPointer2({
|
|
|
41204
41273
|
className,
|
|
41205
41274
|
style: style2
|
|
41206
41275
|
},
|
|
41207
|
-
name && /* @__PURE__ */
|
|
41276
|
+
name && /* @__PURE__ */ import_react109.default.createElement("div", { className: "n-relative" }, showPointerIcon && /* @__PURE__ */ import_react109.default.createElement(
|
|
41208
41277
|
UserPointerIcon,
|
|
41209
41278
|
{
|
|
41210
41279
|
size: POINTER_SIZE,
|
|
41211
41280
|
color: userBackgroundColor,
|
|
41212
41281
|
style: pointerOverlapStyle
|
|
41213
41282
|
}
|
|
41214
|
-
), /* @__PURE__ */
|
|
41283
|
+
), /* @__PURE__ */ import_react109.default.createElement(
|
|
41215
41284
|
UserNameTag,
|
|
41216
41285
|
{
|
|
41217
41286
|
backgroundColor: userBackgroundColor,
|
|
@@ -41227,10 +41296,10 @@ var UserPointer = (0, import_react108.memo)(function UserPointer2({
|
|
|
41227
41296
|
|
|
41228
41297
|
// src/components/workspace/WorkspaceLayout.tsx
|
|
41229
41298
|
var import_noya_keymap7 = require("@noya-app/noya-keymap");
|
|
41230
|
-
var
|
|
41299
|
+
var import_react121 = __toESM(require("react"));
|
|
41231
41300
|
|
|
41232
41301
|
// src/components/OverlayToolbar.tsx
|
|
41233
|
-
var
|
|
41302
|
+
var import_react110 = __toESM(require("react"));
|
|
41234
41303
|
var panelClassName = "n-pointer-events-auto n-inline-flex n-items-center n-gap-toolbar-separator n-rounded-3xl n-border n-border-divider n-bg-sidebar-background n-px-3 n-py-2.5 n-shadow-2xl";
|
|
41235
41304
|
function OverlayToolbar({
|
|
41236
41305
|
left,
|
|
@@ -41240,7 +41309,7 @@ function OverlayToolbar({
|
|
|
41240
41309
|
style: style2
|
|
41241
41310
|
}) {
|
|
41242
41311
|
const resolvedLayout = overlayLayout === "topLeftTopRight" ? "topLeftTopRight" : "bottomCenterTopRight";
|
|
41243
|
-
const panelStyle = (0,
|
|
41312
|
+
const panelStyle = (0, import_react110.useMemo)(
|
|
41244
41313
|
() => ({
|
|
41245
41314
|
...toolbarTransparentStyle,
|
|
41246
41315
|
...style2
|
|
@@ -41249,7 +41318,7 @@ function OverlayToolbar({
|
|
|
41249
41318
|
);
|
|
41250
41319
|
const renderLeftPanel = (overlayId) => {
|
|
41251
41320
|
if (!left) return null;
|
|
41252
|
-
return /* @__PURE__ */
|
|
41321
|
+
return /* @__PURE__ */ import_react110.default.createElement(
|
|
41253
41322
|
"div",
|
|
41254
41323
|
{
|
|
41255
41324
|
className: panelClassName,
|
|
@@ -41259,7 +41328,7 @@ function OverlayToolbar({
|
|
|
41259
41328
|
left
|
|
41260
41329
|
);
|
|
41261
41330
|
};
|
|
41262
|
-
return /* @__PURE__ */
|
|
41331
|
+
return /* @__PURE__ */ import_react110.default.createElement(import_react110.default.Fragment, null, resolvedLayout === "bottomCenterTopRight" ? /* @__PURE__ */ import_react110.default.createElement(
|
|
41263
41332
|
"div",
|
|
41264
41333
|
{
|
|
41265
41334
|
className: cx(
|
|
@@ -41268,7 +41337,7 @@ function OverlayToolbar({
|
|
|
41268
41337
|
)
|
|
41269
41338
|
},
|
|
41270
41339
|
renderLeftPanel("noya-toolbar-bottom-center")
|
|
41271
|
-
) : /* @__PURE__ */
|
|
41340
|
+
) : /* @__PURE__ */ import_react110.default.createElement(
|
|
41272
41341
|
"div",
|
|
41273
41342
|
{
|
|
41274
41343
|
className: cx(
|
|
@@ -41277,7 +41346,7 @@ function OverlayToolbar({
|
|
|
41277
41346
|
)
|
|
41278
41347
|
},
|
|
41279
41348
|
renderLeftPanel("noya-toolbar-top-left")
|
|
41280
|
-
), right && /* @__PURE__ */
|
|
41349
|
+
), right && /* @__PURE__ */ import_react110.default.createElement(
|
|
41281
41350
|
"div",
|
|
41282
41351
|
{
|
|
41283
41352
|
className: cx(
|
|
@@ -41285,7 +41354,7 @@ function OverlayToolbar({
|
|
|
41285
41354
|
className
|
|
41286
41355
|
)
|
|
41287
41356
|
},
|
|
41288
|
-
/* @__PURE__ */
|
|
41357
|
+
/* @__PURE__ */ import_react110.default.createElement(
|
|
41289
41358
|
"div",
|
|
41290
41359
|
{
|
|
41291
41360
|
className: panelClassName,
|
|
@@ -41298,7 +41367,7 @@ function OverlayToolbar({
|
|
|
41298
41367
|
}
|
|
41299
41368
|
|
|
41300
41369
|
// src/components/workspace/DrawerWorkspaceLayout.tsx
|
|
41301
|
-
var
|
|
41370
|
+
var import_react114 = __toESM(require("react"));
|
|
41302
41371
|
|
|
41303
41372
|
// src/components/workspace/constants.ts
|
|
41304
41373
|
var EDITOR_PANEL_GROUP_ID = "editor-panel-group";
|
|
@@ -41307,17 +41376,17 @@ var RIGHT_SIDEBAR_ID = "editor-3-right-sidebar";
|
|
|
41307
41376
|
var CONTENT_AREA_ID = "editor-2-content-area";
|
|
41308
41377
|
|
|
41309
41378
|
// src/components/workspace/VerticalTabMenu.tsx
|
|
41310
|
-
var
|
|
41379
|
+
var import_react113 = __toESM(require("react"));
|
|
41311
41380
|
|
|
41312
41381
|
// src/components/Toolbar.tsx
|
|
41313
41382
|
var import_noya_keymap6 = require("@noya-app/noya-keymap");
|
|
41314
|
-
var
|
|
41383
|
+
var import_react112 = __toESM(require("react"));
|
|
41315
41384
|
|
|
41316
41385
|
// src/components/ToolbarDrawer.tsx
|
|
41317
|
-
var
|
|
41318
|
-
var ToolbarDrawer = (0,
|
|
41319
|
-
(0,
|
|
41320
|
-
return /* @__PURE__ */
|
|
41386
|
+
var import_react111 = __toESM(require("react"));
|
|
41387
|
+
var ToolbarDrawer = (0, import_react111.memo)(
|
|
41388
|
+
(0, import_react111.forwardRef)(function ToolbarDrawer2({ children, trigger, sideOffset = 8 }, ref) {
|
|
41389
|
+
return /* @__PURE__ */ import_react111.default.createElement("div", { className: "n-relative", ref }, /* @__PURE__ */ import_react111.default.createElement(
|
|
41321
41390
|
"div",
|
|
41322
41391
|
{
|
|
41323
41392
|
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",
|
|
@@ -41333,21 +41402,21 @@ var ToolbarDrawer = (0, import_react110.memo)(
|
|
|
41333
41402
|
|
|
41334
41403
|
// src/components/Toolbar.tsx
|
|
41335
41404
|
var SIDE_OFFSET = 6;
|
|
41336
|
-
var ToolbarMenuContext = (0,
|
|
41405
|
+
var ToolbarMenuContext = (0, import_react112.createContext)({});
|
|
41337
41406
|
var ToolbarMenuDropdown = memoGeneric(function ToolbarMenuDropdown2({
|
|
41338
41407
|
item,
|
|
41339
41408
|
onSelectMenuItem,
|
|
41340
41409
|
onPopoverOpenChange
|
|
41341
41410
|
}) {
|
|
41342
|
-
const [open2, setOpen] =
|
|
41343
|
-
const handleOpenChange =
|
|
41411
|
+
const [open2, setOpen] = import_react112.default.useState(false);
|
|
41412
|
+
const handleOpenChange = import_react112.default.useCallback(
|
|
41344
41413
|
(newOpen) => {
|
|
41345
41414
|
setOpen(newOpen);
|
|
41346
41415
|
onPopoverOpenChange?.(newOpen);
|
|
41347
41416
|
},
|
|
41348
41417
|
[onPopoverOpenChange]
|
|
41349
41418
|
);
|
|
41350
|
-
return /* @__PURE__ */
|
|
41419
|
+
return /* @__PURE__ */ import_react112.default.createElement(
|
|
41351
41420
|
DropdownMenu,
|
|
41352
41421
|
{
|
|
41353
41422
|
open: open2,
|
|
@@ -41360,7 +41429,7 @@ var ToolbarMenuDropdown = memoGeneric(function ToolbarMenuDropdown2({
|
|
|
41360
41429
|
}
|
|
41361
41430
|
}
|
|
41362
41431
|
},
|
|
41363
|
-
/* @__PURE__ */
|
|
41432
|
+
/* @__PURE__ */ import_react112.default.createElement(
|
|
41364
41433
|
Button,
|
|
41365
41434
|
{
|
|
41366
41435
|
disabled: item.disabled,
|
|
@@ -41376,7 +41445,7 @@ var ToolbarShortcut = ({
|
|
|
41376
41445
|
shortcut,
|
|
41377
41446
|
label
|
|
41378
41447
|
}) => {
|
|
41379
|
-
return /* @__PURE__ */
|
|
41448
|
+
return /* @__PURE__ */ import_react112.default.createElement("div", { className: "n-flex n-items-center" }, label, /* @__PURE__ */ import_react112.default.createElement(Spacer.Horizontal, { size: 6 }), /* @__PURE__ */ import_react112.default.createElement(KeyboardShortcut, { shortcut }));
|
|
41380
41449
|
};
|
|
41381
41450
|
var ToolbarMenuPopover = memoGeneric(function ToolbarMenuPopover2({
|
|
41382
41451
|
item,
|
|
@@ -41393,20 +41462,20 @@ var ToolbarMenuPopover = memoGeneric(function ToolbarMenuPopover2({
|
|
|
41393
41462
|
popoverClassName,
|
|
41394
41463
|
triggerProps: buttonProps
|
|
41395
41464
|
} = item;
|
|
41396
|
-
const [open2, setOpen] =
|
|
41397
|
-
const handleOpenChange =
|
|
41465
|
+
const [open2, setOpen] = import_react112.default.useState(false);
|
|
41466
|
+
const handleOpenChange = import_react112.default.useCallback(
|
|
41398
41467
|
(newOpen) => {
|
|
41399
41468
|
setOpen(newOpen);
|
|
41400
41469
|
onPopoverOpenChange?.(newOpen);
|
|
41401
41470
|
},
|
|
41402
41471
|
[onPopoverOpenChange]
|
|
41403
41472
|
);
|
|
41404
|
-
const { useDialogOnSmallScreen, isSmallScreen, openDialog } = (0,
|
|
41473
|
+
const { useDialogOnSmallScreen, isSmallScreen, openDialog } = (0, import_react112.useContext)(ToolbarMenuContext);
|
|
41405
41474
|
const shouldUseDialog = useDialogOnSmallScreen && isSmallScreen && openDialog;
|
|
41406
|
-
const handleOpenDialog =
|
|
41475
|
+
const handleOpenDialog = import_react112.default.useCallback(() => {
|
|
41407
41476
|
if (!openDialog) return;
|
|
41408
41477
|
handleOpenChange(true);
|
|
41409
|
-
const dialogContent = typeof itemContent === "function" ? (props) => /* @__PURE__ */
|
|
41478
|
+
const dialogContent = typeof itemContent === "function" ? (props) => /* @__PURE__ */ import_react112.default.createElement("div", { className: "-n-m-3" }, itemContent(props)) : /* @__PURE__ */ import_react112.default.createElement("div", { className: "-n-m-3" }, itemContent);
|
|
41410
41479
|
const dialog = openDialog({
|
|
41411
41480
|
title,
|
|
41412
41481
|
className: "n-w-[90vw] n-max-w-[360px]",
|
|
@@ -41414,7 +41483,7 @@ var ToolbarMenuPopover = memoGeneric(function ToolbarMenuPopover2({
|
|
|
41414
41483
|
});
|
|
41415
41484
|
dialog.then(() => handleOpenChange(false));
|
|
41416
41485
|
}, [openDialog, itemContent, title, handleOpenChange]);
|
|
41417
|
-
const trigger = /* @__PURE__ */
|
|
41486
|
+
const trigger = /* @__PURE__ */ import_react112.default.createElement(
|
|
41418
41487
|
Button,
|
|
41419
41488
|
{
|
|
41420
41489
|
disabled: disabled2,
|
|
@@ -41427,7 +41496,7 @@ var ToolbarMenuPopover = memoGeneric(function ToolbarMenuPopover2({
|
|
|
41427
41496
|
title
|
|
41428
41497
|
);
|
|
41429
41498
|
if (shouldUseDialog) {
|
|
41430
|
-
return tooltip && !open2 ? /* @__PURE__ */
|
|
41499
|
+
return tooltip && !open2 ? /* @__PURE__ */ import_react112.default.createElement(
|
|
41431
41500
|
Tooltip,
|
|
41432
41501
|
{
|
|
41433
41502
|
sideOffset: SIDE_OFFSET,
|
|
@@ -41438,7 +41507,7 @@ var ToolbarMenuPopover = memoGeneric(function ToolbarMenuPopover2({
|
|
|
41438
41507
|
trigger
|
|
41439
41508
|
) : trigger;
|
|
41440
41509
|
}
|
|
41441
|
-
const content = /* @__PURE__ */
|
|
41510
|
+
const content = /* @__PURE__ */ import_react112.default.createElement("span", null, /* @__PURE__ */ import_react112.default.createElement(
|
|
41442
41511
|
Popover,
|
|
41443
41512
|
{
|
|
41444
41513
|
open: open2,
|
|
@@ -41452,7 +41521,7 @@ var ToolbarMenuPopover = memoGeneric(function ToolbarMenuPopover2({
|
|
|
41452
41521
|
},
|
|
41453
41522
|
typeof itemContent === "function" ? itemContent({ close: () => handleOpenChange(false) }) : itemContent
|
|
41454
41523
|
));
|
|
41455
|
-
return tooltip && !open2 ? /* @__PURE__ */
|
|
41524
|
+
return tooltip && !open2 ? /* @__PURE__ */ import_react112.default.createElement(
|
|
41456
41525
|
Tooltip,
|
|
41457
41526
|
{
|
|
41458
41527
|
sideOffset: SIDE_OFFSET,
|
|
@@ -41472,7 +41541,7 @@ var ToolbarMenuButton = memoGeneric(function ToolbarMenuButton2({
|
|
|
41472
41541
|
displayFilter
|
|
41473
41542
|
}) {
|
|
41474
41543
|
const isActive = item.checked || activeValue === item.value;
|
|
41475
|
-
const content = /* @__PURE__ */
|
|
41544
|
+
const content = /* @__PURE__ */ import_react112.default.createElement(
|
|
41476
41545
|
Button,
|
|
41477
41546
|
{
|
|
41478
41547
|
as,
|
|
@@ -41489,7 +41558,7 @@ var ToolbarMenuButton = memoGeneric(function ToolbarMenuButton2({
|
|
|
41489
41558
|
displayFilter === "iconOnly" ? void 0 : item.title
|
|
41490
41559
|
);
|
|
41491
41560
|
const tooltip = item.tooltip ?? (displayFilter === "iconOnly" && item.title ? item.title : void 0);
|
|
41492
|
-
return item.drawer && isActive ? /* @__PURE__ */
|
|
41561
|
+
return item.drawer && isActive ? /* @__PURE__ */ import_react112.default.createElement(ToolbarDrawer, { trigger: content }, item.drawer) : tooltip ? /* @__PURE__ */ import_react112.default.createElement(Tooltip, { sideOffset: SIDE_OFFSET, content: tooltip, side: tooltipSide }, content) : content;
|
|
41493
41562
|
});
|
|
41494
41563
|
var ToolbarMenuItem = memoGeneric(function ToolbarMenuItem2({
|
|
41495
41564
|
item,
|
|
@@ -41502,14 +41571,14 @@ var ToolbarMenuItem = memoGeneric(function ToolbarMenuItem2({
|
|
|
41502
41571
|
dividerOverflow: dividerOverflowProp,
|
|
41503
41572
|
onPopoverOpenChange
|
|
41504
41573
|
}) {
|
|
41505
|
-
const { dividerOverflow: contextDividerOverflow } = (0,
|
|
41574
|
+
const { dividerOverflow: contextDividerOverflow } = (0, import_react112.useContext)(ToolbarMenuContext);
|
|
41506
41575
|
const dividerOverflow = dividerOverflowProp ?? contextDividerOverflow ?? 4;
|
|
41507
41576
|
if (item.type === "sectionHeader") return null;
|
|
41508
41577
|
if (item.type === "separator") {
|
|
41509
|
-
return /* @__PURE__ */
|
|
41578
|
+
return /* @__PURE__ */ import_react112.default.createElement(DividerVertical, { overflow: dividerOverflow });
|
|
41510
41579
|
}
|
|
41511
41580
|
if (item.type === "popover") {
|
|
41512
|
-
return /* @__PURE__ */
|
|
41581
|
+
return /* @__PURE__ */ import_react112.default.createElement(
|
|
41513
41582
|
ToolbarMenuPopover,
|
|
41514
41583
|
{
|
|
41515
41584
|
item,
|
|
@@ -41519,7 +41588,7 @@ var ToolbarMenuItem = memoGeneric(function ToolbarMenuItem2({
|
|
|
41519
41588
|
);
|
|
41520
41589
|
}
|
|
41521
41590
|
if (isSelectableMenuItem(item)) {
|
|
41522
|
-
return /* @__PURE__ */
|
|
41591
|
+
return /* @__PURE__ */ import_react112.default.createElement(
|
|
41523
41592
|
ToolbarMenuButton,
|
|
41524
41593
|
{
|
|
41525
41594
|
item,
|
|
@@ -41531,7 +41600,7 @@ var ToolbarMenuItem = memoGeneric(function ToolbarMenuItem2({
|
|
|
41531
41600
|
}
|
|
41532
41601
|
);
|
|
41533
41602
|
}
|
|
41534
|
-
return /* @__PURE__ */
|
|
41603
|
+
return /* @__PURE__ */ import_react112.default.createElement(
|
|
41535
41604
|
ToolbarMenuDropdown,
|
|
41536
41605
|
{
|
|
41537
41606
|
item,
|
|
@@ -41551,8 +41620,8 @@ var ToolbarMenu = memoGeneric(function ToolbarMenu2({
|
|
|
41551
41620
|
dividerOverflow,
|
|
41552
41621
|
onPopoverOpenChange
|
|
41553
41622
|
}) {
|
|
41554
|
-
return /* @__PURE__ */
|
|
41555
|
-
return /* @__PURE__ */
|
|
41623
|
+
return /* @__PURE__ */ import_react112.default.createElement(import_react112.default.Fragment, null, items.map((item, i) => {
|
|
41624
|
+
return /* @__PURE__ */ import_react112.default.createElement(
|
|
41556
41625
|
ToolbarMenuItem,
|
|
41557
41626
|
{
|
|
41558
41627
|
key: i,
|
|
@@ -41571,7 +41640,7 @@ var ToolbarMenu = memoGeneric(function ToolbarMenu2({
|
|
|
41571
41640
|
});
|
|
41572
41641
|
function useBindKeyboardShortcutsForMenuItems(items, onSelectMenuItem) {
|
|
41573
41642
|
return (0, import_noya_keymap6.useKeyboardShortcuts)(
|
|
41574
|
-
|
|
41643
|
+
import_react112.default.useMemo(
|
|
41575
41644
|
() => onSelectMenuItem ? getKeyboardShortcutsForMenuItems(items, onSelectMenuItem) : {},
|
|
41576
41645
|
[items, onSelectMenuItem]
|
|
41577
41646
|
)
|
|
@@ -41586,7 +41655,7 @@ function Toolbar({
|
|
|
41586
41655
|
shouldBindKeyboardShortcuts = true,
|
|
41587
41656
|
dividerOverflow
|
|
41588
41657
|
}) {
|
|
41589
|
-
const allMenuItems =
|
|
41658
|
+
const allMenuItems = import_react112.default.useMemo(
|
|
41590
41659
|
() => [...leftMenuItems, ...rightMenuItems],
|
|
41591
41660
|
[leftMenuItems, rightMenuItems]
|
|
41592
41661
|
);
|
|
@@ -41594,11 +41663,11 @@ function Toolbar({
|
|
|
41594
41663
|
allMenuItems,
|
|
41595
41664
|
shouldBindKeyboardShortcuts ? onSelectMenuItem : void 0
|
|
41596
41665
|
);
|
|
41597
|
-
return /* @__PURE__ */
|
|
41666
|
+
return /* @__PURE__ */ import_react112.default.createElement(
|
|
41598
41667
|
BaseToolbar,
|
|
41599
41668
|
{
|
|
41600
41669
|
logo,
|
|
41601
|
-
left: leftMenuItems.length > 0 && /* @__PURE__ */
|
|
41670
|
+
left: leftMenuItems.length > 0 && /* @__PURE__ */ import_react112.default.createElement("div", { className: "n-flex n-gap-2" }, /* @__PURE__ */ import_react112.default.createElement(
|
|
41602
41671
|
ToolbarMenu,
|
|
41603
41672
|
{
|
|
41604
41673
|
items: leftMenuItems,
|
|
@@ -41606,7 +41675,7 @@ function Toolbar({
|
|
|
41606
41675
|
dividerOverflow
|
|
41607
41676
|
}
|
|
41608
41677
|
)),
|
|
41609
|
-
right: rightMenuItems.length > 0 && /* @__PURE__ */
|
|
41678
|
+
right: rightMenuItems.length > 0 && /* @__PURE__ */ import_react112.default.createElement("div", { className: "n-flex n-gap-2" }, /* @__PURE__ */ import_react112.default.createElement(
|
|
41610
41679
|
ToolbarMenu,
|
|
41611
41680
|
{
|
|
41612
41681
|
items: rightMenuItems,
|
|
@@ -41627,19 +41696,19 @@ var VerticalTabMenu = memoGeneric(function VerticalTabMenu2({
|
|
|
41627
41696
|
onChange,
|
|
41628
41697
|
tooltipSide
|
|
41629
41698
|
}) {
|
|
41630
|
-
const style2 = (0,
|
|
41699
|
+
const style2 = (0, import_react113.useMemo)(() => {
|
|
41631
41700
|
return {
|
|
41632
41701
|
[cssVarNames.colors.inputBackground]: "transparent",
|
|
41633
41702
|
[cssVarNames.colors.buttonBackground]: "transparent"
|
|
41634
41703
|
};
|
|
41635
41704
|
}, []);
|
|
41636
|
-
return /* @__PURE__ */
|
|
41705
|
+
return /* @__PURE__ */ import_react113.default.createElement(
|
|
41637
41706
|
"div",
|
|
41638
41707
|
{
|
|
41639
41708
|
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",
|
|
41640
41709
|
style: style2
|
|
41641
41710
|
},
|
|
41642
|
-
/* @__PURE__ */
|
|
41711
|
+
/* @__PURE__ */ import_react113.default.createElement(
|
|
41643
41712
|
ToolbarMenu,
|
|
41644
41713
|
{
|
|
41645
41714
|
items,
|
|
@@ -41667,12 +41736,12 @@ var DrawerWorkspaceLayout = memoGeneric(function DrawerWorkspaceLayout2({
|
|
|
41667
41736
|
onChangeLeftTab,
|
|
41668
41737
|
compactDrawerMenu
|
|
41669
41738
|
}) {
|
|
41670
|
-
const portalContainer = (0,
|
|
41671
|
-
const [{ leftSidebarCollapsed, rightSidebarCollapsed }, setLayoutState] = (0,
|
|
41739
|
+
const portalContainer = (0, import_react114.useRef)(null);
|
|
41740
|
+
const [{ leftSidebarCollapsed, rightSidebarCollapsed }, setLayoutState] = (0, import_react114.useState)({
|
|
41672
41741
|
leftSidebarCollapsed: true,
|
|
41673
41742
|
rightSidebarCollapsed: true
|
|
41674
41743
|
});
|
|
41675
|
-
const allTabItems = (0,
|
|
41744
|
+
const allTabItems = (0, import_react114.useMemo)(
|
|
41676
41745
|
() => [
|
|
41677
41746
|
...leftPanel ? leftTabItems ?? [] : [],
|
|
41678
41747
|
...rightPanel ? rightTabItems ?? [] : []
|
|
@@ -41680,16 +41749,16 @@ var DrawerWorkspaceLayout = memoGeneric(function DrawerWorkspaceLayout2({
|
|
|
41680
41749
|
[leftTabItems, rightTabItems, leftPanel, rightPanel]
|
|
41681
41750
|
);
|
|
41682
41751
|
const hasTabs = allTabItems.length > 0;
|
|
41683
|
-
const allSelectableTabItems = (0,
|
|
41752
|
+
const allSelectableTabItems = (0, import_react114.useMemo)(
|
|
41684
41753
|
() => allTabItems.filter(isSelectableMenuItem),
|
|
41685
41754
|
[allTabItems]
|
|
41686
41755
|
);
|
|
41687
41756
|
const useCompactInToolbar = !!compactDrawerMenu && allSelectableTabItems.length <= 1;
|
|
41688
|
-
const leftSelectableTabItems = (0,
|
|
41757
|
+
const leftSelectableTabItems = (0, import_react114.useMemo)(
|
|
41689
41758
|
() => (leftTabItems ?? []).filter(isSelectableMenuItem),
|
|
41690
41759
|
[leftTabItems]
|
|
41691
41760
|
);
|
|
41692
|
-
const rightSelectableTabItems = (0,
|
|
41761
|
+
const rightSelectableTabItems = (0, import_react114.useMemo)(
|
|
41693
41762
|
() => (rightTabItems ?? []).filter(isSelectableMenuItem),
|
|
41694
41763
|
[rightTabItems]
|
|
41695
41764
|
);
|
|
@@ -41726,14 +41795,14 @@ var DrawerWorkspaceLayout = memoGeneric(function DrawerWorkspaceLayout2({
|
|
|
41726
41795
|
activeValue: rightTabValue,
|
|
41727
41796
|
isSidebarCollapsed: rightSidebarCollapsed
|
|
41728
41797
|
} : { activeValue: void 0, isSidebarCollapsed: true };
|
|
41729
|
-
return /* @__PURE__ */
|
|
41798
|
+
return /* @__PURE__ */ import_react114.default.createElement(
|
|
41730
41799
|
"div",
|
|
41731
41800
|
{
|
|
41732
41801
|
ref: portalContainer,
|
|
41733
41802
|
id: EDITOR_PANEL_GROUP_ID,
|
|
41734
41803
|
className: "n-flex n-flex-1 n-relative focus:n-outline-none"
|
|
41735
41804
|
},
|
|
41736
|
-
hasTabs && !useCompactInToolbar && /* @__PURE__ */
|
|
41805
|
+
hasTabs && !useCompactInToolbar && /* @__PURE__ */ import_react114.default.createElement(import_react114.default.Fragment, null, /* @__PURE__ */ import_react114.default.createElement(
|
|
41737
41806
|
VerticalTabMenu,
|
|
41738
41807
|
{
|
|
41739
41808
|
tooltipSide: "right",
|
|
@@ -41742,8 +41811,8 @@ var DrawerWorkspaceLayout = memoGeneric(function DrawerWorkspaceLayout2({
|
|
|
41742
41811
|
isSidebarCollapsed,
|
|
41743
41812
|
onChange: (value) => handleSelectTab(value)
|
|
41744
41813
|
}
|
|
41745
|
-
), /* @__PURE__ */
|
|
41746
|
-
useCompactInToolbar && /* @__PURE__ */
|
|
41814
|
+
), /* @__PURE__ */ import_react114.default.createElement(DividerVertical, { className: "n-h-full" })),
|
|
41815
|
+
useCompactInToolbar && /* @__PURE__ */ import_react114.default.createElement("div", { className: "n-absolute n-top-0 n-left-0 n-h-[calc(var(--n-toolbar-height)+1px)] n-w-[calc(var(--n-toolbar-height)+1px)] n-bg-sidebar-background n-border-r n-border-b n-border-divider-strong n-z-10 n-flex n-items-center n-justify-center" }, allSelectableTabItems[0] && /* @__PURE__ */ import_react114.default.createElement(
|
|
41747
41816
|
Button,
|
|
41748
41817
|
{
|
|
41749
41818
|
variant: "none",
|
|
@@ -41770,8 +41839,8 @@ var DrawerWorkspaceLayout = memoGeneric(function DrawerWorkspaceLayout2({
|
|
|
41770
41839
|
}
|
|
41771
41840
|
}
|
|
41772
41841
|
)),
|
|
41773
|
-
/* @__PURE__ */
|
|
41774
|
-
leftPanel && /* @__PURE__ */
|
|
41842
|
+
/* @__PURE__ */ import_react114.default.createElement("div", { className: "n-flex-1 n-flex n-relative" }, centerPanel),
|
|
41843
|
+
leftPanel && /* @__PURE__ */ import_react114.default.createElement(
|
|
41775
41844
|
Drawer,
|
|
41776
41845
|
{
|
|
41777
41846
|
modal: false,
|
|
@@ -41793,7 +41862,7 @@ var DrawerWorkspaceLayout = memoGeneric(function DrawerWorkspaceLayout2({
|
|
|
41793
41862
|
},
|
|
41794
41863
|
leftPanel
|
|
41795
41864
|
),
|
|
41796
|
-
rightPanel && /* @__PURE__ */
|
|
41865
|
+
rightPanel && /* @__PURE__ */ import_react114.default.createElement(
|
|
41797
41866
|
Drawer,
|
|
41798
41867
|
{
|
|
41799
41868
|
id: RIGHT_SIDEBAR_ID,
|
|
@@ -41820,18 +41889,18 @@ var DrawerWorkspaceLayout = memoGeneric(function DrawerWorkspaceLayout2({
|
|
|
41820
41889
|
});
|
|
41821
41890
|
|
|
41822
41891
|
// src/components/workspace/PanelWorkspaceLayout.tsx
|
|
41823
|
-
var
|
|
41892
|
+
var import_react119 = __toESM(require("react"));
|
|
41824
41893
|
|
|
41825
41894
|
// src/components/resizablePanels/Panel.tsx
|
|
41826
|
-
var
|
|
41895
|
+
var import_react116 = __toESM(require("react"));
|
|
41827
41896
|
|
|
41828
41897
|
// src/components/resizablePanels/PanelGroupContext.tsx
|
|
41829
|
-
var
|
|
41830
|
-
var PanelGroupContext = (0,
|
|
41898
|
+
var import_react115 = require("react");
|
|
41899
|
+
var PanelGroupContext = (0, import_react115.createContext)(
|
|
41831
41900
|
null
|
|
41832
41901
|
);
|
|
41833
41902
|
function usePanelGroupContext() {
|
|
41834
|
-
const context = (0,
|
|
41903
|
+
const context = (0, import_react115.useContext)(PanelGroupContext);
|
|
41835
41904
|
if (!context) {
|
|
41836
41905
|
throw new Error("Panel must be used within a PanelGroup");
|
|
41837
41906
|
}
|
|
@@ -41839,9 +41908,9 @@ function usePanelGroupContext() {
|
|
|
41839
41908
|
}
|
|
41840
41909
|
|
|
41841
41910
|
// src/components/resizablePanels/Panel.tsx
|
|
41842
|
-
var Panel = (0,
|
|
41911
|
+
var Panel = (0, import_react116.forwardRef)(
|
|
41843
41912
|
function Panel2({ id: propId, order, className, defaultSize, minSize, maxSize, collapsible, defaultCollapsed, children }, ref) {
|
|
41844
|
-
const generatedId = (0,
|
|
41913
|
+
const generatedId = (0, import_react116.useId)();
|
|
41845
41914
|
const id = propId ?? generatedId;
|
|
41846
41915
|
const context = usePanelGroupContext();
|
|
41847
41916
|
const {
|
|
@@ -41852,7 +41921,7 @@ var Panel = (0, import_react115.forwardRef)(
|
|
|
41852
41921
|
collapsePanel,
|
|
41853
41922
|
isPanelExpanded
|
|
41854
41923
|
} = context;
|
|
41855
|
-
(0,
|
|
41924
|
+
(0, import_react116.useEffect)(() => {
|
|
41856
41925
|
registerPanel({
|
|
41857
41926
|
id,
|
|
41858
41927
|
order,
|
|
@@ -41868,7 +41937,7 @@ var Panel = (0, import_react115.forwardRef)(
|
|
|
41868
41937
|
}, [id, order, defaultSize, minSize, maxSize, collapsible, defaultCollapsed, registerPanel, unregisterPanel]);
|
|
41869
41938
|
const size4 = getPanelSize(id);
|
|
41870
41939
|
const isFlexPanel = defaultSize === void 0;
|
|
41871
|
-
(0,
|
|
41940
|
+
(0, import_react116.useImperativeHandle)(
|
|
41872
41941
|
ref,
|
|
41873
41942
|
() => ({
|
|
41874
41943
|
expand: () => expandPanel(id),
|
|
@@ -41881,7 +41950,7 @@ var Panel = (0, import_react115.forwardRef)(
|
|
|
41881
41950
|
if (size4 === 0 && !isFlexPanel) {
|
|
41882
41951
|
return null;
|
|
41883
41952
|
}
|
|
41884
|
-
return /* @__PURE__ */
|
|
41953
|
+
return /* @__PURE__ */ import_react116.default.createElement(
|
|
41885
41954
|
"div",
|
|
41886
41955
|
{
|
|
41887
41956
|
"data-panel-id": id,
|
|
@@ -41896,7 +41965,7 @@ var Panel = (0, import_react115.forwardRef)(
|
|
|
41896
41965
|
);
|
|
41897
41966
|
|
|
41898
41967
|
// src/components/resizablePanels/PanelGroup.tsx
|
|
41899
|
-
var
|
|
41968
|
+
var import_react117 = __toESM(require("react"));
|
|
41900
41969
|
function getStorageKey(autoSaveId) {
|
|
41901
41970
|
return `noya-panels:${autoSaveId}`;
|
|
41902
41971
|
}
|
|
@@ -41914,19 +41983,19 @@ function saveSizes(autoSaveId, sizes) {
|
|
|
41914
41983
|
if (!autoSaveId) return;
|
|
41915
41984
|
clientStorage.setItem(getStorageKey(autoSaveId), JSON.stringify(sizes));
|
|
41916
41985
|
}
|
|
41917
|
-
var PanelGroup = (0,
|
|
41986
|
+
var PanelGroup = (0, import_react117.forwardRef)(
|
|
41918
41987
|
function PanelGroup2({ id, className, direction, autoSaveId, onLayout, children }, ref) {
|
|
41919
|
-
const containerRef = (0,
|
|
41988
|
+
const containerRef = (0, import_react117.useRef)(null);
|
|
41920
41989
|
const containerSize = useSize(containerRef);
|
|
41921
41990
|
const containerWidth = containerSize?.width ?? 0;
|
|
41922
|
-
const [panels, setPanels] = (0,
|
|
41923
|
-
const panelsRef = (0,
|
|
41991
|
+
const [panels, setPanels] = (0, import_react117.useState)(/* @__PURE__ */ new Map());
|
|
41992
|
+
const panelsRef = (0, import_react117.useRef)(panels);
|
|
41924
41993
|
panelsRef.current = panels;
|
|
41925
|
-
const [resizing, setResizing] = (0,
|
|
41926
|
-
const sortedPanels = (0,
|
|
41994
|
+
const [resizing, setResizing] = (0, import_react117.useState)(null);
|
|
41995
|
+
const sortedPanels = (0, import_react117.useMemo)(() => {
|
|
41927
41996
|
return Array.from(panels.values()).sort((a, b) => a.order - b.order);
|
|
41928
41997
|
}, [panels]);
|
|
41929
|
-
const flexPanelId = (0,
|
|
41998
|
+
const flexPanelId = (0, import_react117.useMemo)(() => {
|
|
41930
41999
|
for (const panel of sortedPanels) {
|
|
41931
42000
|
if (panel.defaultSize === void 0) {
|
|
41932
42001
|
return panel.id;
|
|
@@ -41934,7 +42003,7 @@ var PanelGroup = (0, import_react116.forwardRef)(
|
|
|
41934
42003
|
}
|
|
41935
42004
|
return null;
|
|
41936
42005
|
}, [sortedPanels]);
|
|
41937
|
-
const calculateLayout = (0,
|
|
42006
|
+
const calculateLayout = (0, import_react117.useCallback)(
|
|
41938
42007
|
(panelStates, width) => {
|
|
41939
42008
|
if (width === 0) return panelStates;
|
|
41940
42009
|
const sorted = Array.from(panelStates.values()).sort(
|
|
@@ -41959,18 +42028,18 @@ var PanelGroup = (0, import_react116.forwardRef)(
|
|
|
41959
42028
|
},
|
|
41960
42029
|
[]
|
|
41961
42030
|
);
|
|
41962
|
-
(0,
|
|
42031
|
+
(0, import_react117.useEffect)(() => {
|
|
41963
42032
|
if (containerWidth > 0 && panels.size > 0) {
|
|
41964
42033
|
setPanels((prev) => calculateLayout(prev, containerWidth));
|
|
41965
42034
|
}
|
|
41966
42035
|
}, [containerWidth, calculateLayout, panels.size]);
|
|
41967
|
-
(0,
|
|
42036
|
+
(0, import_react117.useEffect)(() => {
|
|
41968
42037
|
if (onLayout && sortedPanels.length > 0) {
|
|
41969
42038
|
const sizes = sortedPanels.map((p) => p.collapsed ? 0 : p.size);
|
|
41970
42039
|
onLayout(sizes);
|
|
41971
42040
|
}
|
|
41972
42041
|
}, [onLayout, sortedPanels]);
|
|
41973
|
-
const registerPanel = (0,
|
|
42042
|
+
const registerPanel = (0, import_react117.useCallback)(
|
|
41974
42043
|
(panel) => {
|
|
41975
42044
|
setPanels((prev) => {
|
|
41976
42045
|
const savedSizes = loadSavedSizes(autoSaveId);
|
|
@@ -41990,26 +42059,26 @@ var PanelGroup = (0, import_react116.forwardRef)(
|
|
|
41990
42059
|
},
|
|
41991
42060
|
[autoSaveId, calculateLayout, containerWidth]
|
|
41992
42061
|
);
|
|
41993
|
-
const unregisterPanel = (0,
|
|
42062
|
+
const unregisterPanel = (0, import_react117.useCallback)((panelId) => {
|
|
41994
42063
|
setPanels((prev) => {
|
|
41995
42064
|
const newPanels = new Map(prev);
|
|
41996
42065
|
newPanels.delete(panelId);
|
|
41997
42066
|
return newPanels;
|
|
41998
42067
|
});
|
|
41999
42068
|
}, []);
|
|
42000
|
-
const getPanelSize = (0,
|
|
42069
|
+
const getPanelSize = (0, import_react117.useCallback)(
|
|
42001
42070
|
(panelId) => {
|
|
42002
42071
|
return panels.get(panelId)?.size ?? 0;
|
|
42003
42072
|
},
|
|
42004
42073
|
[panels]
|
|
42005
42074
|
);
|
|
42006
|
-
const getPanelIndex = (0,
|
|
42075
|
+
const getPanelIndex = (0, import_react117.useCallback)(
|
|
42007
42076
|
(panelId) => {
|
|
42008
42077
|
return sortedPanels.findIndex((p) => p.id === panelId);
|
|
42009
42078
|
},
|
|
42010
42079
|
[sortedPanels]
|
|
42011
42080
|
);
|
|
42012
|
-
const setPanelSize = (0,
|
|
42081
|
+
const setPanelSize = (0, import_react117.useCallback)(
|
|
42013
42082
|
(panelId, size4) => {
|
|
42014
42083
|
setPanels((prev) => {
|
|
42015
42084
|
const panel = prev.get(panelId);
|
|
@@ -42037,7 +42106,7 @@ var PanelGroup = (0, import_react116.forwardRef)(
|
|
|
42037
42106
|
},
|
|
42038
42107
|
[autoSaveId, calculateLayout, containerWidth]
|
|
42039
42108
|
);
|
|
42040
|
-
const expandPanel = (0,
|
|
42109
|
+
const expandPanel = (0, import_react117.useCallback)(
|
|
42041
42110
|
(panelId) => {
|
|
42042
42111
|
setPanels((prev) => {
|
|
42043
42112
|
const panel = prev.get(panelId);
|
|
@@ -42062,7 +42131,7 @@ var PanelGroup = (0, import_react116.forwardRef)(
|
|
|
42062
42131
|
},
|
|
42063
42132
|
[autoSaveId, calculateLayout, containerWidth]
|
|
42064
42133
|
);
|
|
42065
|
-
const collapsePanel = (0,
|
|
42134
|
+
const collapsePanel = (0, import_react117.useCallback)(
|
|
42066
42135
|
(panelId) => {
|
|
42067
42136
|
setPanels((prev) => {
|
|
42068
42137
|
const panel = prev.get(panelId);
|
|
@@ -42086,14 +42155,14 @@ var PanelGroup = (0, import_react116.forwardRef)(
|
|
|
42086
42155
|
},
|
|
42087
42156
|
[autoSaveId, calculateLayout, containerWidth]
|
|
42088
42157
|
);
|
|
42089
|
-
const isPanelExpanded = (0,
|
|
42158
|
+
const isPanelExpanded = (0, import_react117.useCallback)(
|
|
42090
42159
|
(panelId) => {
|
|
42091
42160
|
const panel = panels.get(panelId);
|
|
42092
42161
|
return panel ? !panel.collapsed : false;
|
|
42093
42162
|
},
|
|
42094
42163
|
[panels]
|
|
42095
42164
|
);
|
|
42096
|
-
const startResize = (0,
|
|
42165
|
+
const startResize = (0, import_react117.useCallback)(
|
|
42097
42166
|
(handleIndex, startX) => {
|
|
42098
42167
|
const startSizes = sortedPanels.map((p) => p.size);
|
|
42099
42168
|
setResizing({
|
|
@@ -42104,7 +42173,7 @@ var PanelGroup = (0, import_react116.forwardRef)(
|
|
|
42104
42173
|
},
|
|
42105
42174
|
[sortedPanels]
|
|
42106
42175
|
);
|
|
42107
|
-
(0,
|
|
42176
|
+
(0, import_react117.useEffect)(() => {
|
|
42108
42177
|
if (!resizing) return;
|
|
42109
42178
|
const handleMouseMove = (e) => {
|
|
42110
42179
|
const delta = e.clientX - resizing.startX;
|
|
@@ -42193,7 +42262,7 @@ var PanelGroup = (0, import_react116.forwardRef)(
|
|
|
42193
42262
|
containerWidth,
|
|
42194
42263
|
flexPanelId
|
|
42195
42264
|
]);
|
|
42196
|
-
(0,
|
|
42265
|
+
(0, import_react117.useImperativeHandle)(ref, () => ({
|
|
42197
42266
|
getLayout: () => sortedPanels.map((p) => p.size),
|
|
42198
42267
|
setLayout: (sizes) => {
|
|
42199
42268
|
setPanels((prev) => {
|
|
@@ -42211,7 +42280,7 @@ var PanelGroup = (0, import_react116.forwardRef)(
|
|
|
42211
42280
|
});
|
|
42212
42281
|
}
|
|
42213
42282
|
}));
|
|
42214
|
-
const contextValue = (0,
|
|
42283
|
+
const contextValue = (0, import_react117.useMemo)(
|
|
42215
42284
|
() => ({
|
|
42216
42285
|
registerPanel,
|
|
42217
42286
|
unregisterPanel,
|
|
@@ -42237,7 +42306,7 @@ var PanelGroup = (0, import_react116.forwardRef)(
|
|
|
42237
42306
|
containerWidth
|
|
42238
42307
|
]
|
|
42239
42308
|
);
|
|
42240
|
-
return /* @__PURE__ */
|
|
42309
|
+
return /* @__PURE__ */ import_react117.default.createElement(PanelGroupContext.Provider, { value: contextValue }, /* @__PURE__ */ import_react117.default.createElement(
|
|
42241
42310
|
"div",
|
|
42242
42311
|
{
|
|
42243
42312
|
ref: containerRef,
|
|
@@ -42255,15 +42324,15 @@ var PanelGroup = (0, import_react116.forwardRef)(
|
|
|
42255
42324
|
);
|
|
42256
42325
|
|
|
42257
42326
|
// src/components/resizablePanels/PanelResizeHandle.tsx
|
|
42258
|
-
var
|
|
42327
|
+
var import_react118 = __toESM(require("react"));
|
|
42259
42328
|
function PanelResizeHandle({
|
|
42260
42329
|
className,
|
|
42261
42330
|
disabled: disabled2,
|
|
42262
42331
|
index: index2
|
|
42263
42332
|
}) {
|
|
42264
|
-
const context = (0,
|
|
42265
|
-
const handleRef = (0,
|
|
42266
|
-
const handleMouseDown = (0,
|
|
42333
|
+
const context = (0, import_react118.useContext)(PanelGroupContext);
|
|
42334
|
+
const handleRef = (0, import_react118.useRef)(null);
|
|
42335
|
+
const handleMouseDown = (0, import_react118.useCallback)(
|
|
42267
42336
|
(e) => {
|
|
42268
42337
|
if (disabled2 || !context) return;
|
|
42269
42338
|
e.preventDefault();
|
|
@@ -42274,7 +42343,7 @@ function PanelResizeHandle({
|
|
|
42274
42343
|
if (!context) {
|
|
42275
42344
|
return null;
|
|
42276
42345
|
}
|
|
42277
|
-
return /* @__PURE__ */
|
|
42346
|
+
return /* @__PURE__ */ import_react118.default.createElement(
|
|
42278
42347
|
"div",
|
|
42279
42348
|
{
|
|
42280
42349
|
ref: handleRef,
|
|
@@ -42287,7 +42356,7 @@ function PanelResizeHandle({
|
|
|
42287
42356
|
zIndex: 10
|
|
42288
42357
|
}
|
|
42289
42358
|
},
|
|
42290
|
-
/* @__PURE__ */
|
|
42359
|
+
/* @__PURE__ */ import_react118.default.createElement(
|
|
42291
42360
|
"div",
|
|
42292
42361
|
{
|
|
42293
42362
|
style: {
|
|
@@ -42321,17 +42390,17 @@ var PanelWorkspaceLayout = memoGeneric(function PanelWorkspaceLayout2({
|
|
|
42321
42390
|
onChangeRightTab,
|
|
42322
42391
|
compactDrawerMenu
|
|
42323
42392
|
}) {
|
|
42324
|
-
const panelGroupRef = (0,
|
|
42325
|
-
const autoSaveId = (0,
|
|
42393
|
+
const panelGroupRef = (0, import_react119.useRef)(null);
|
|
42394
|
+
const autoSaveId = (0, import_react119.useMemo)(() => {
|
|
42326
42395
|
return autoSavePrefix ? `${autoSavePrefix}--v3--${EDITOR_PANEL_GROUP_ID}` : Math.random().toString(36).substring(2, 15);
|
|
42327
42396
|
}, [autoSavePrefix]);
|
|
42328
|
-
const [leftSidebarCollapsed, setLeftSidebarCollapsed] = (0,
|
|
42397
|
+
const [leftSidebarCollapsed, setLeftSidebarCollapsed] = (0, import_react119.useState)(
|
|
42329
42398
|
leftSidebarOptions.defaultCollapsed ?? false
|
|
42330
42399
|
);
|
|
42331
|
-
const [rightSidebarCollapsed, setRightSidebarCollapsed] = (0,
|
|
42400
|
+
const [rightSidebarCollapsed, setRightSidebarCollapsed] = (0, import_react119.useState)(
|
|
42332
42401
|
rightSidebarOptions.defaultCollapsed ?? false
|
|
42333
42402
|
);
|
|
42334
|
-
const handleLayoutChange = (0,
|
|
42403
|
+
const handleLayoutChange = (0, import_react119.useCallback)(
|
|
42335
42404
|
(sizes) => {
|
|
42336
42405
|
const leftIndex = leftPanel ? 0 : -1;
|
|
42337
42406
|
const rightIndex = rightPanel ? leftPanel ? 2 : 1 : -1;
|
|
@@ -42344,7 +42413,7 @@ var PanelWorkspaceLayout = memoGeneric(function PanelWorkspaceLayout2({
|
|
|
42344
42413
|
},
|
|
42345
42414
|
[leftPanel, rightPanel]
|
|
42346
42415
|
);
|
|
42347
|
-
const handleLeftTabChange = (0,
|
|
42416
|
+
const handleLeftTabChange = (0, import_react119.useCallback)(
|
|
42348
42417
|
(value) => {
|
|
42349
42418
|
if (value === leftTabValue) {
|
|
42350
42419
|
if (leftSidebarRef.current?.isExpanded()) {
|
|
@@ -42361,7 +42430,7 @@ var PanelWorkspaceLayout = memoGeneric(function PanelWorkspaceLayout2({
|
|
|
42361
42430
|
},
|
|
42362
42431
|
[leftSidebarRef, leftTabValue, onChangeLeftTab]
|
|
42363
42432
|
);
|
|
42364
|
-
const handleRightTabChange = (0,
|
|
42433
|
+
const handleRightTabChange = (0, import_react119.useCallback)(
|
|
42365
42434
|
(value) => {
|
|
42366
42435
|
if (value === rightTabValue) {
|
|
42367
42436
|
if (rightSidebarRef.current?.isExpanded()) {
|
|
@@ -42381,7 +42450,7 @@ var PanelWorkspaceLayout = memoGeneric(function PanelWorkspaceLayout2({
|
|
|
42381
42450
|
const showLeftTabs = !!leftSidebarOptions.showTabs && !!leftTabItems && // When compact drawer UI is enabled, only show the rail when the
|
|
42382
42451
|
// sidebar is collapsed (for large screens/panel layout).
|
|
42383
42452
|
(!compactDrawerMenu || leftSidebarCollapsed);
|
|
42384
|
-
return /* @__PURE__ */
|
|
42453
|
+
return /* @__PURE__ */ import_react119.default.createElement(
|
|
42385
42454
|
PanelGroup,
|
|
42386
42455
|
{
|
|
42387
42456
|
ref: panelGroupRef,
|
|
@@ -42391,7 +42460,7 @@ var PanelWorkspaceLayout = memoGeneric(function PanelWorkspaceLayout2({
|
|
|
42391
42460
|
autoSaveId,
|
|
42392
42461
|
onLayout: handleLayoutChange
|
|
42393
42462
|
},
|
|
42394
|
-
leftPanel && /* @__PURE__ */
|
|
42463
|
+
leftPanel && /* @__PURE__ */ import_react119.default.createElement(import_react119.default.Fragment, null, showLeftTabs && /* @__PURE__ */ import_react119.default.createElement(
|
|
42395
42464
|
VerticalTabMenu,
|
|
42396
42465
|
{
|
|
42397
42466
|
tooltipSide: "right",
|
|
@@ -42400,7 +42469,7 @@ var PanelWorkspaceLayout = memoGeneric(function PanelWorkspaceLayout2({
|
|
|
42400
42469
|
isSidebarCollapsed: leftSidebarCollapsed,
|
|
42401
42470
|
onChange: handleLeftTabChange
|
|
42402
42471
|
}
|
|
42403
|
-
), showLeftTabs && !leftSidebarCollapsed && /* @__PURE__ */
|
|
42472
|
+
), showLeftTabs && !leftSidebarCollapsed && /* @__PURE__ */ import_react119.default.createElement(DividerVertical, { className: "n-h-full" }), /* @__PURE__ */ import_react119.default.createElement(
|
|
42404
42473
|
Panel,
|
|
42405
42474
|
{
|
|
42406
42475
|
id: LEFT_SIDEBAR_ID,
|
|
@@ -42414,8 +42483,8 @@ var PanelWorkspaceLayout = memoGeneric(function PanelWorkspaceLayout2({
|
|
|
42414
42483
|
defaultCollapsed: leftSidebarOptions.defaultCollapsed
|
|
42415
42484
|
},
|
|
42416
42485
|
leftSidebarCollapsed ? null : leftPanel
|
|
42417
|
-
), /* @__PURE__ */
|
|
42418
|
-
/* @__PURE__ */
|
|
42486
|
+
), /* @__PURE__ */ import_react119.default.createElement(PanelResizeHandle, { index: 0, className: "n-cursor-col-resize n-w-px n-h-full n-bg-divider" })),
|
|
42487
|
+
/* @__PURE__ */ import_react119.default.createElement(
|
|
42419
42488
|
Panel,
|
|
42420
42489
|
{
|
|
42421
42490
|
id: CONTENT_AREA_ID,
|
|
@@ -42424,7 +42493,7 @@ var PanelWorkspaceLayout = memoGeneric(function PanelWorkspaceLayout2({
|
|
|
42424
42493
|
},
|
|
42425
42494
|
centerPanel
|
|
42426
42495
|
),
|
|
42427
|
-
rightPanel && /* @__PURE__ */
|
|
42496
|
+
rightPanel && /* @__PURE__ */ import_react119.default.createElement(import_react119.default.Fragment, null, /* @__PURE__ */ import_react119.default.createElement(PanelResizeHandle, { index: 1, className: "n-cursor-col-resize n-w-px n-h-full n-bg-divider" }), /* @__PURE__ */ import_react119.default.createElement(
|
|
42428
42497
|
Panel,
|
|
42429
42498
|
{
|
|
42430
42499
|
id: RIGHT_SIDEBAR_ID,
|
|
@@ -42438,7 +42507,7 @@ var PanelWorkspaceLayout = memoGeneric(function PanelWorkspaceLayout2({
|
|
|
42438
42507
|
defaultCollapsed: rightSidebarOptions.defaultCollapsed
|
|
42439
42508
|
},
|
|
42440
42509
|
rightSidebarCollapsed ? null : rightPanel
|
|
42441
|
-
), rightSidebarOptions.showTabs && rightTabItems && !rightSidebarCollapsed && /* @__PURE__ */
|
|
42510
|
+
), rightSidebarOptions.showTabs && rightTabItems && !rightSidebarCollapsed && /* @__PURE__ */ import_react119.default.createElement(DividerVertical, { className: "n-h-full" }), rightSidebarOptions.showTabs && rightTabItems && /* @__PURE__ */ import_react119.default.createElement(
|
|
42442
42511
|
VerticalTabMenu,
|
|
42443
42512
|
{
|
|
42444
42513
|
tooltipSide: "left",
|
|
@@ -42460,11 +42529,11 @@ function renderPanelChildren(fn, props) {
|
|
|
42460
42529
|
}
|
|
42461
42530
|
|
|
42462
42531
|
// src/components/workspace/WorkspaceSideContext.tsx
|
|
42463
|
-
var
|
|
42464
|
-
var WorkspaceSideContext = (0,
|
|
42532
|
+
var import_react120 = require("react");
|
|
42533
|
+
var WorkspaceSideContext = (0, import_react120.createContext)({});
|
|
42465
42534
|
var WorkspaceSideProvider = WorkspaceSideContext.Provider;
|
|
42466
42535
|
function useWorkspaceSide() {
|
|
42467
|
-
return (0,
|
|
42536
|
+
return (0, import_react120.useContext)(WorkspaceSideContext);
|
|
42468
42537
|
}
|
|
42469
42538
|
|
|
42470
42539
|
// src/components/workspace/WorkspaceLayout.tsx
|
|
@@ -42531,7 +42600,7 @@ var WorkspaceLayout = forwardRefGeneric(function WorkspaceLayout2({
|
|
|
42531
42600
|
theme,
|
|
42532
42601
|
compactDrawerMenu
|
|
42533
42602
|
}, forwardedRef) {
|
|
42534
|
-
const containerRef =
|
|
42603
|
+
const containerRef = import_react121.default.useRef(null);
|
|
42535
42604
|
const containerSize = useSize(containerRef);
|
|
42536
42605
|
const windowSize = useWindowSize();
|
|
42537
42606
|
const parentSize = detectSize === "window" ? windowSize : containerSize && containerSize.width > 0 ? containerSize : windowSize;
|
|
@@ -42547,8 +42616,8 @@ var WorkspaceLayout = forwardRefGeneric(function WorkspaceLayout2({
|
|
|
42547
42616
|
const rightSidebarMinPixels = toPixels(rightMinSize);
|
|
42548
42617
|
const rightSidebarMaxPixels = toPixels(rightMaxSize);
|
|
42549
42618
|
const rightSidebarInitialPixels = toPixels(rightInitialSize) ?? 280;
|
|
42550
|
-
const leftSidebarRef = (0,
|
|
42551
|
-
const rightSidebarRef = (0,
|
|
42619
|
+
const leftSidebarRef = (0, import_react121.useRef)(null);
|
|
42620
|
+
const rightSidebarRef = (0, import_react121.useRef)(null);
|
|
42552
42621
|
const [leftTabValue, setLeftTabValue] = useControlledOrUncontrolled({
|
|
42553
42622
|
value: leftTabValueProp,
|
|
42554
42623
|
onChange: onChangeLeftTab,
|
|
@@ -42559,7 +42628,7 @@ var WorkspaceLayout = forwardRefGeneric(function WorkspaceLayout2({
|
|
|
42559
42628
|
onChange: onChangeRightTab,
|
|
42560
42629
|
defaultValue: getFirstTabValue(rightTabItems, "")
|
|
42561
42630
|
});
|
|
42562
|
-
(0,
|
|
42631
|
+
(0, import_react121.useImperativeHandle)(forwardedRef, () => ({
|
|
42563
42632
|
setLeftExpanded: (expanded) => {
|
|
42564
42633
|
if (expanded) {
|
|
42565
42634
|
leftSidebarRef.current?.expand();
|
|
@@ -42616,56 +42685,56 @@ var WorkspaceLayout = forwardRefGeneric(function WorkspaceLayout2({
|
|
|
42616
42685
|
}
|
|
42617
42686
|
});
|
|
42618
42687
|
const isDrawerActive = sideType === "drawer" || sideType === "auto" && parentSize.width <= sideTypeBreakpoint;
|
|
42619
|
-
const closeLeftSidebar = (0,
|
|
42688
|
+
const closeLeftSidebar = (0, import_react121.useCallback)(() => {
|
|
42620
42689
|
if (isDrawerActive) {
|
|
42621
42690
|
leftSidebarRef.current?.collapse();
|
|
42622
42691
|
}
|
|
42623
42692
|
}, [isDrawerActive]);
|
|
42624
|
-
const closeRightSidebar = (0,
|
|
42693
|
+
const closeRightSidebar = (0, import_react121.useCallback)(() => {
|
|
42625
42694
|
if (isDrawerActive) {
|
|
42626
42695
|
rightSidebarRef.current?.collapse();
|
|
42627
42696
|
}
|
|
42628
42697
|
}, [isDrawerActive]);
|
|
42629
|
-
const leftChildrenProps = (0,
|
|
42698
|
+
const leftChildrenProps = (0, import_react121.useMemo)(() => {
|
|
42630
42699
|
return {
|
|
42631
42700
|
activeTabValue: leftTabValue,
|
|
42632
42701
|
closeSidebar: closeLeftSidebar
|
|
42633
42702
|
};
|
|
42634
42703
|
}, [leftTabValue, closeLeftSidebar]);
|
|
42635
|
-
const rightChildrenProps = (0,
|
|
42704
|
+
const rightChildrenProps = (0, import_react121.useMemo)(() => {
|
|
42636
42705
|
return {
|
|
42637
42706
|
activeTabValue: rightTabValue,
|
|
42638
42707
|
closeSidebar: closeRightSidebar
|
|
42639
42708
|
};
|
|
42640
42709
|
}, [rightTabValue, closeRightSidebar]);
|
|
42641
|
-
const leftSidebarProviderValue = (0,
|
|
42710
|
+
const leftSidebarProviderValue = (0, import_react121.useMemo)(() => {
|
|
42642
42711
|
return {
|
|
42643
42712
|
closeSidebar: closeLeftSidebar
|
|
42644
42713
|
};
|
|
42645
42714
|
}, [closeLeftSidebar]);
|
|
42646
|
-
const rightSidebarProviderValue = (0,
|
|
42715
|
+
const rightSidebarProviderValue = (0, import_react121.useMemo)(() => {
|
|
42647
42716
|
return {
|
|
42648
42717
|
closeSidebar: closeRightSidebar
|
|
42649
42718
|
};
|
|
42650
42719
|
}, [closeRightSidebar]);
|
|
42651
|
-
const leftPanel = left && leftVisible !== false ? /* @__PURE__ */
|
|
42720
|
+
const leftPanel = left && leftVisible !== false ? /* @__PURE__ */ import_react121.default.createElement(
|
|
42652
42721
|
PanelInner,
|
|
42653
42722
|
{
|
|
42654
42723
|
style: leftStyle,
|
|
42655
42724
|
className: cx("n-bg-sidebar-background n-flex-col", leftClassName)
|
|
42656
42725
|
},
|
|
42657
|
-
/* @__PURE__ */
|
|
42726
|
+
/* @__PURE__ */ import_react121.default.createElement(WorkspaceSideProvider, { value: leftSidebarProviderValue }, leftTabValue ? renderPanelChildren(left, leftChildrenProps) : null)
|
|
42658
42727
|
) : null;
|
|
42659
|
-
const rightPanel = right && rightVisible !== false ? /* @__PURE__ */
|
|
42728
|
+
const rightPanel = right && rightVisible !== false ? /* @__PURE__ */ import_react121.default.createElement(
|
|
42660
42729
|
PanelInner,
|
|
42661
42730
|
{
|
|
42662
42731
|
style: rightStyle,
|
|
42663
42732
|
className: cx("n-bg-sidebar-background n-flex-col", rightClassName)
|
|
42664
42733
|
},
|
|
42665
|
-
/* @__PURE__ */
|
|
42734
|
+
/* @__PURE__ */ import_react121.default.createElement(WorkspaceSideProvider, { value: rightSidebarProviderValue }, rightTabValue ? renderPanelChildren(right, rightChildrenProps) : null)
|
|
42666
42735
|
) : null;
|
|
42667
|
-
const centerPanel = /* @__PURE__ */
|
|
42668
|
-
const leftSidebarOptions = (0,
|
|
42736
|
+
const centerPanel = /* @__PURE__ */ import_react121.default.createElement(PanelInner, { className: "n-bg-canvas-background" }, children);
|
|
42737
|
+
const leftSidebarOptions = (0, import_react121.useMemo)(
|
|
42669
42738
|
() => ({
|
|
42670
42739
|
minSize: leftSidebarMinPixels,
|
|
42671
42740
|
maxSize: leftSidebarMaxPixels,
|
|
@@ -42683,7 +42752,7 @@ var WorkspaceLayout = forwardRefGeneric(function WorkspaceLayout2({
|
|
|
42683
42752
|
leftShowTabs
|
|
42684
42753
|
]
|
|
42685
42754
|
);
|
|
42686
|
-
const rightSidebarOptions = (0,
|
|
42755
|
+
const rightSidebarOptions = (0, import_react121.useMemo)(
|
|
42687
42756
|
() => ({
|
|
42688
42757
|
minSize: rightSidebarMinPixels,
|
|
42689
42758
|
maxSize: rightSidebarMaxPixels,
|
|
@@ -42704,7 +42773,7 @@ var WorkspaceLayout = forwardRefGeneric(function WorkspaceLayout2({
|
|
|
42704
42773
|
const LayoutComponent = sideType === "panel" ? PanelWorkspaceLayout : sideType === "drawer" ? DrawerWorkspaceLayout : parentSize.width > sideTypeBreakpoint ? PanelWorkspaceLayout : DrawerWorkspaceLayout;
|
|
42705
42774
|
const readyToRender = detectSize === "window" || containerSize && containerSize.width > 0;
|
|
42706
42775
|
const isOverlay = toolbarVariant === "overlay";
|
|
42707
|
-
return /* @__PURE__ */
|
|
42776
|
+
return /* @__PURE__ */ import_react121.default.createElement(
|
|
42708
42777
|
"div",
|
|
42709
42778
|
{
|
|
42710
42779
|
ref: containerRef,
|
|
@@ -42717,7 +42786,7 @@ var WorkspaceLayout = forwardRefGeneric(function WorkspaceLayout2({
|
|
|
42717
42786
|
"data-theme": theme
|
|
42718
42787
|
},
|
|
42719
42788
|
!isOverlay && toolbar,
|
|
42720
|
-
/* @__PURE__ */
|
|
42789
|
+
/* @__PURE__ */ import_react121.default.createElement("div", { className: "n-flex n-flex-row n-flex-1 n-relative" }, readyToRender && /* @__PURE__ */ import_react121.default.createElement(import_react121.default.Fragment, null, /* @__PURE__ */ import_react121.default.createElement(
|
|
42721
42790
|
LayoutComponent,
|
|
42722
42791
|
{
|
|
42723
42792
|
leftPanel,
|
|
@@ -42736,7 +42805,7 @@ var WorkspaceLayout = forwardRefGeneric(function WorkspaceLayout2({
|
|
|
42736
42805
|
rightSidebarRef,
|
|
42737
42806
|
compactDrawerMenu
|
|
42738
42807
|
}
|
|
42739
|
-
), isOverlay && /* @__PURE__ */
|
|
42808
|
+
), isOverlay && /* @__PURE__ */ import_react121.default.createElement(
|
|
42740
42809
|
OverlayToolbar,
|
|
42741
42810
|
{
|
|
42742
42811
|
left: overlayToolbarLeft,
|
|
@@ -42746,12 +42815,12 @@ var WorkspaceLayout = forwardRefGeneric(function WorkspaceLayout2({
|
|
|
42746
42815
|
)))
|
|
42747
42816
|
);
|
|
42748
42817
|
});
|
|
42749
|
-
var PanelInner = (0,
|
|
42818
|
+
var PanelInner = (0, import_react121.memo)(function PanelInner2({
|
|
42750
42819
|
children,
|
|
42751
42820
|
style: style2,
|
|
42752
42821
|
className
|
|
42753
42822
|
}) {
|
|
42754
|
-
return /* @__PURE__ */
|
|
42823
|
+
return /* @__PURE__ */ import_react121.default.createElement(
|
|
42755
42824
|
"div",
|
|
42756
42825
|
{
|
|
42757
42826
|
style: style2,
|
|
@@ -42798,9 +42867,9 @@ function usePlatformModKey() {
|
|
|
42798
42867
|
}
|
|
42799
42868
|
|
|
42800
42869
|
// src/hooks/useTheme.ts
|
|
42801
|
-
var
|
|
42870
|
+
var import_react122 = require("react");
|
|
42802
42871
|
function useTheme() {
|
|
42803
|
-
const [theme, setTheme] = (0,
|
|
42872
|
+
const [theme, setTheme] = (0, import_react122.useState)("light");
|
|
42804
42873
|
const checkTheme = () => {
|
|
42805
42874
|
const currentTheme = document.body.getAttribute("data-theme");
|
|
42806
42875
|
switch (currentTheme) {
|
|
@@ -42812,7 +42881,7 @@ function useTheme() {
|
|
|
42812
42881
|
break;
|
|
42813
42882
|
}
|
|
42814
42883
|
};
|
|
42815
|
-
(0,
|
|
42884
|
+
(0, import_react122.useEffect)(() => {
|
|
42816
42885
|
checkTheme();
|
|
42817
42886
|
const observer = new MutationObserver((mutations) => {
|
|
42818
42887
|
mutations.forEach((mutation) => {
|
|
@@ -43004,8 +43073,8 @@ __export(InspectorPrimitives_exports, {
|
|
|
43004
43073
|
Title: () => Title,
|
|
43005
43074
|
VerticalSeparator: () => VerticalSeparator
|
|
43006
43075
|
});
|
|
43007
|
-
var
|
|
43008
|
-
var Section2 = (0,
|
|
43076
|
+
var import_react123 = __toESM(require("react"));
|
|
43077
|
+
var Section2 = (0, import_react123.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ import_react123.default.createElement(
|
|
43009
43078
|
"div",
|
|
43010
43079
|
{
|
|
43011
43080
|
ref,
|
|
@@ -43013,8 +43082,8 @@ var Section2 = (0, import_react122.forwardRef)(({ className, ...props }, ref) =>
|
|
|
43013
43082
|
...props
|
|
43014
43083
|
}
|
|
43015
43084
|
));
|
|
43016
|
-
var SectionHeader2 = (0,
|
|
43017
|
-
var Title = (0,
|
|
43085
|
+
var SectionHeader2 = (0, import_react123.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ import_react123.default.createElement("div", { ref, className: cx(`n-flex n-items-center`, className), ...props }));
|
|
43086
|
+
var Title = (0, import_react123.forwardRef)(({ className, $textStyle, ...props }, ref) => /* @__PURE__ */ import_react123.default.createElement(
|
|
43018
43087
|
"div",
|
|
43019
43088
|
{
|
|
43020
43089
|
ref,
|
|
@@ -43025,7 +43094,7 @@ var Title = (0, import_react122.forwardRef)(({ className, $textStyle, ...props }
|
|
|
43025
43094
|
...props
|
|
43026
43095
|
}
|
|
43027
43096
|
));
|
|
43028
|
-
var Row = (0,
|
|
43097
|
+
var Row = (0, import_react123.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ import_react123.default.createElement(
|
|
43029
43098
|
"div",
|
|
43030
43099
|
{
|
|
43031
43100
|
ref,
|
|
@@ -43033,7 +43102,7 @@ var Row = (0, import_react122.forwardRef)(({ className, ...props }, ref) => /* @
|
|
|
43033
43102
|
...props
|
|
43034
43103
|
}
|
|
43035
43104
|
));
|
|
43036
|
-
var Column = (0,
|
|
43105
|
+
var Column = (0, import_react123.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ import_react123.default.createElement(
|
|
43037
43106
|
"div",
|
|
43038
43107
|
{
|
|
43039
43108
|
ref,
|
|
@@ -43041,7 +43110,7 @@ var Column = (0, import_react122.forwardRef)(({ className, ...props }, ref) => /
|
|
|
43041
43110
|
...props
|
|
43042
43111
|
}
|
|
43043
43112
|
));
|
|
43044
|
-
var Checkbox3 = (0,
|
|
43113
|
+
var Checkbox3 = (0, import_react123.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ import_react123.default.createElement(
|
|
43045
43114
|
"input",
|
|
43046
43115
|
{
|
|
43047
43116
|
ref,
|
|
@@ -43050,7 +43119,7 @@ var Checkbox3 = (0, import_react122.forwardRef)(({ className, ...props }, ref) =
|
|
|
43050
43119
|
...props
|
|
43051
43120
|
}
|
|
43052
43121
|
));
|
|
43053
|
-
var Text3 = (0,
|
|
43122
|
+
var Text3 = (0, import_react123.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ import_react123.default.createElement(
|
|
43054
43123
|
"span",
|
|
43055
43124
|
{
|
|
43056
43125
|
ref,
|
|
@@ -43058,14 +43127,14 @@ var Text3 = (0, import_react122.forwardRef)(({ className, ...props }, ref) => /*
|
|
|
43058
43127
|
...props
|
|
43059
43128
|
}
|
|
43060
43129
|
));
|
|
43061
|
-
var VerticalSeparator = () => /* @__PURE__ */
|
|
43062
|
-
var HorizontalSeparator = () => /* @__PURE__ */
|
|
43063
|
-
var RowLabel = (0,
|
|
43130
|
+
var VerticalSeparator = () => /* @__PURE__ */ import_react123.default.createElement(Spacer.Vertical, { size: "inspector-v-separator" });
|
|
43131
|
+
var HorizontalSeparator = () => /* @__PURE__ */ import_react123.default.createElement(Spacer.Horizontal, { size: "inspector-h-separator" });
|
|
43132
|
+
var RowLabel = (0, import_react123.forwardRef)(function RowLabel2({
|
|
43064
43133
|
className,
|
|
43065
43134
|
$textStyle,
|
|
43066
43135
|
...props
|
|
43067
43136
|
}, ref) {
|
|
43068
|
-
return /* @__PURE__ */
|
|
43137
|
+
return /* @__PURE__ */ import_react123.default.createElement(
|
|
43069
43138
|
"label",
|
|
43070
43139
|
{
|
|
43071
43140
|
ref,
|
|
@@ -43077,7 +43146,7 @@ var RowLabel = (0, import_react122.forwardRef)(function RowLabel2({
|
|
|
43077
43146
|
}
|
|
43078
43147
|
);
|
|
43079
43148
|
});
|
|
43080
|
-
var LabeledRow = (0,
|
|
43149
|
+
var LabeledRow = (0, import_react123.memo)(function LabeledRow2({
|
|
43081
43150
|
id,
|
|
43082
43151
|
children,
|
|
43083
43152
|
label,
|
|
@@ -43085,7 +43154,7 @@ var LabeledRow = (0, import_react122.memo)(function LabeledRow2({
|
|
|
43085
43154
|
right,
|
|
43086
43155
|
className
|
|
43087
43156
|
}) {
|
|
43088
|
-
return /* @__PURE__ */
|
|
43157
|
+
return /* @__PURE__ */ import_react123.default.createElement(Row, { id, className }, /* @__PURE__ */ import_react123.default.createElement(Column, null, /* @__PURE__ */ import_react123.default.createElement(RowLabel, { $textStyle: labelTextStyle }, label, right && /* @__PURE__ */ import_react123.default.createElement(Spacer.Horizontal, null), right), /* @__PURE__ */ import_react123.default.createElement(Row, null, children)));
|
|
43089
43158
|
});
|
|
43090
43159
|
// Annotate the CommonJS export names for ESM import in node:
|
|
43091
43160
|
0 && (module.exports = {
|