@noya-app/noya-designsystem 0.1.81 → 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 +10 -10
- package/CHANGELOG.md +7 -0
- package/dist/chunk-QDV7OQMJ.mjs +37 -0
- package/dist/chunk-QDV7OQMJ.mjs.map +1 -0
- 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 +206 -131
- 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/dist/index.mjs
CHANGED
|
@@ -15,12 +15,12 @@ var require_use_sync_external_store_shim_production = __commonJS({
|
|
|
15
15
|
return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y;
|
|
16
16
|
}
|
|
17
17
|
var objectIs = "function" === typeof Object.is ? Object.is : is;
|
|
18
|
-
var
|
|
19
|
-
var
|
|
18
|
+
var useState80 = React321.useState;
|
|
19
|
+
var useEffect61 = React321.useEffect;
|
|
20
20
|
var useLayoutEffect12 = React321.useLayoutEffect;
|
|
21
21
|
var useDebugValue2 = React321.useDebugValue;
|
|
22
22
|
function useSyncExternalStore$2(subscribe, getSnapshot) {
|
|
23
|
-
var value = getSnapshot(), _useState =
|
|
23
|
+
var value = getSnapshot(), _useState = useState80({ inst: { value, getSnapshot } }), inst = _useState[0].inst, forceUpdate = _useState[1];
|
|
24
24
|
useLayoutEffect12(
|
|
25
25
|
function() {
|
|
26
26
|
inst.value = value;
|
|
@@ -29,7 +29,7 @@ var require_use_sync_external_store_shim_production = __commonJS({
|
|
|
29
29
|
},
|
|
30
30
|
[subscribe, value, getSnapshot]
|
|
31
31
|
);
|
|
32
|
-
|
|
32
|
+
useEffect61(
|
|
33
33
|
function() {
|
|
34
34
|
checkIfSnapshotChanged(inst) && forceUpdate({ inst });
|
|
35
35
|
return subscribe(function() {
|
|
@@ -78,7 +78,7 @@ var require_use_sync_external_store_shim_development = __commonJS({
|
|
|
78
78
|
"The result of getSnapshot should be cached to avoid an infinite loop"
|
|
79
79
|
), didWarnUncachedGetSnapshot = true);
|
|
80
80
|
}
|
|
81
|
-
cachedValue =
|
|
81
|
+
cachedValue = useState80({
|
|
82
82
|
inst: { value, getSnapshot }
|
|
83
83
|
});
|
|
84
84
|
var inst = cachedValue[0].inst, forceUpdate = cachedValue[1];
|
|
@@ -90,7 +90,7 @@ var require_use_sync_external_store_shim_development = __commonJS({
|
|
|
90
90
|
},
|
|
91
91
|
[subscribe, value, getSnapshot]
|
|
92
92
|
);
|
|
93
|
-
|
|
93
|
+
useEffect61(
|
|
94
94
|
function() {
|
|
95
95
|
checkIfSnapshotChanged(inst) && forceUpdate({ inst });
|
|
96
96
|
return subscribe(function() {
|
|
@@ -116,7 +116,7 @@ var require_use_sync_external_store_shim_development = __commonJS({
|
|
|
116
116
|
return getSnapshot();
|
|
117
117
|
}
|
|
118
118
|
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
|
119
|
-
var React321 = __require("react"), objectIs = "function" === typeof Object.is ? Object.is : is,
|
|
119
|
+
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;
|
|
120
120
|
exports.useSyncExternalStore = void 0 !== React321.useSyncExternalStore ? React321.useSyncExternalStore : shim;
|
|
121
121
|
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
|
|
122
122
|
}();
|
|
@@ -147,7 +147,7 @@ var require_with_selector_production = __commonJS({
|
|
|
147
147
|
var objectIs = "function" === typeof Object.is ? Object.is : is;
|
|
148
148
|
var useSyncExternalStore3 = shim.useSyncExternalStore;
|
|
149
149
|
var useRef95 = React321.useRef;
|
|
150
|
-
var
|
|
150
|
+
var useEffect61 = React321.useEffect;
|
|
151
151
|
var useMemo157 = React321.useMemo;
|
|
152
152
|
var useDebugValue2 = React321.useDebugValue;
|
|
153
153
|
exports.useSyncExternalStoreWithSelector = function(subscribe, getSnapshot, getServerSnapshot, selector, isEqual) {
|
|
@@ -191,7 +191,7 @@ var require_with_selector_production = __commonJS({
|
|
|
191
191
|
[getSnapshot, getServerSnapshot, selector, isEqual]
|
|
192
192
|
);
|
|
193
193
|
var value = useSyncExternalStore3(subscribe, instRef[0], instRef[1]);
|
|
194
|
-
|
|
194
|
+
useEffect61(
|
|
195
195
|
function() {
|
|
196
196
|
inst.hasValue = true;
|
|
197
197
|
inst.value = value;
|
|
@@ -213,7 +213,7 @@ var require_with_selector_development = __commonJS({
|
|
|
213
213
|
return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y;
|
|
214
214
|
}
|
|
215
215
|
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
|
216
|
-
var React321 = __require("react"), shim = require_shim(), objectIs = "function" === typeof Object.is ? Object.is : is, useSyncExternalStore3 = shim.useSyncExternalStore, useRef95 = React321.useRef,
|
|
216
|
+
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;
|
|
217
217
|
exports.useSyncExternalStoreWithSelector = function(subscribe, getSnapshot, getServerSnapshot, selector, isEqual) {
|
|
218
218
|
var instRef = useRef95(null);
|
|
219
219
|
if (null === instRef.current) {
|
|
@@ -256,7 +256,7 @@ var require_with_selector_development = __commonJS({
|
|
|
256
256
|
[getSnapshot, getServerSnapshot, selector, isEqual]
|
|
257
257
|
);
|
|
258
258
|
var value = useSyncExternalStore3(subscribe, instRef[0], instRef[1]);
|
|
259
|
-
|
|
259
|
+
useEffect61(
|
|
260
260
|
function() {
|
|
261
261
|
inst.hasValue = true;
|
|
262
262
|
inst.value = value;
|
|
@@ -3819,6 +3819,15 @@ var ClientStorage = class {
|
|
|
3819
3819
|
};
|
|
3820
3820
|
var clientStorage = new ClientStorage();
|
|
3821
3821
|
|
|
3822
|
+
// ../noya-react-utils/src/utils/composeRefs.ts
|
|
3823
|
+
function composeRefs(...refs) {
|
|
3824
|
+
return (value) => {
|
|
3825
|
+
for (const ref of refs) {
|
|
3826
|
+
assignRef(ref, value);
|
|
3827
|
+
}
|
|
3828
|
+
};
|
|
3829
|
+
}
|
|
3830
|
+
|
|
3822
3831
|
// src/components/ActionMenu.tsx
|
|
3823
3832
|
import React166, { useMemo as useMemo87 } from "react";
|
|
3824
3833
|
|
|
@@ -6290,11 +6299,11 @@ function getGridNavigatedIndex(listRef, {
|
|
|
6290
6299
|
if (loopFocus && (prevIndex - cols < minIndex || nextIndex < 0)) {
|
|
6291
6300
|
const col = prevIndex % cols;
|
|
6292
6301
|
const maxCol = maxIndex % cols;
|
|
6293
|
-
const
|
|
6302
|
+
const offset5 = maxIndex - (maxCol - col);
|
|
6294
6303
|
if (maxCol === col) {
|
|
6295
6304
|
nextIndex = maxIndex;
|
|
6296
6305
|
} else {
|
|
6297
|
-
nextIndex = maxCol > col ?
|
|
6306
|
+
nextIndex = maxCol > col ? offset5 : offset5 - cols;
|
|
6298
6307
|
}
|
|
6299
6308
|
}
|
|
6300
6309
|
}
|
|
@@ -8787,7 +8796,7 @@ var limitShift = function(options) {
|
|
|
8787
8796
|
middlewareData
|
|
8788
8797
|
} = state;
|
|
8789
8798
|
const {
|
|
8790
|
-
offset:
|
|
8799
|
+
offset: offset5 = 0,
|
|
8791
8800
|
mainAxis: checkMainAxis = true,
|
|
8792
8801
|
crossAxis: checkCrossAxis = true
|
|
8793
8802
|
} = evaluate(options, state);
|
|
@@ -8799,7 +8808,7 @@ var limitShift = function(options) {
|
|
|
8799
8808
|
const mainAxis = getOppositeAxis(crossAxis);
|
|
8800
8809
|
let mainAxisCoord = coords[mainAxis];
|
|
8801
8810
|
let crossAxisCoord = coords[crossAxis];
|
|
8802
|
-
const rawOffset = evaluate(
|
|
8811
|
+
const rawOffset = evaluate(offset5, state);
|
|
8803
8812
|
const computedOffset = typeof rawOffset === "number" ? {
|
|
8804
8813
|
mainAxis: rawOffset,
|
|
8805
8814
|
crossAxis: 0
|
|
@@ -13375,14 +13384,14 @@ var baseArrow = (options) => ({
|
|
|
13375
13384
|
const min2 = minPadding;
|
|
13376
13385
|
const max2 = clientSize - arrowDimensions[length] - maxPadding;
|
|
13377
13386
|
const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;
|
|
13378
|
-
const
|
|
13379
|
-
const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !==
|
|
13387
|
+
const offset5 = clamp(min2, center, max2);
|
|
13388
|
+
const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset5 && rects.reference[length] / 2 - (center < min2 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0;
|
|
13380
13389
|
const alignmentOffset = shouldAddOffset ? center < min2 ? center - min2 : center - max2 : 0;
|
|
13381
13390
|
return {
|
|
13382
13391
|
[axis]: coords[axis] + alignmentOffset,
|
|
13383
13392
|
data: {
|
|
13384
|
-
[axis]:
|
|
13385
|
-
centerOffset: center -
|
|
13393
|
+
[axis]: offset5,
|
|
13394
|
+
centerOffset: center - offset5 - alignmentOffset,
|
|
13386
13395
|
...shouldAddOffset && {
|
|
13387
13396
|
alignmentOffset
|
|
13388
13397
|
}
|
|
@@ -16835,8 +16844,8 @@ var TooltipViewport = /* @__PURE__ */ React102.forwardRef(function TooltipViewpo
|
|
|
16835
16844
|
if (activeTrigger && previousActiveTrigger && activeTrigger !== previousActiveTrigger && lastHandledTriggerRef.current !== activeTrigger && capturedNodeRef.current) {
|
|
16836
16845
|
setPreviousContentNode(capturedNodeRef.current);
|
|
16837
16846
|
setShowStartingStyleAttribute(true);
|
|
16838
|
-
const
|
|
16839
|
-
setNewTriggerOffset(
|
|
16847
|
+
const offset5 = calculateRelativePosition(previousActiveTrigger, activeTrigger);
|
|
16848
|
+
setNewTriggerOffset(offset5);
|
|
16840
16849
|
cleanupFrame.request(() => {
|
|
16841
16850
|
cleanupFrame.request(() => {
|
|
16842
16851
|
setShowStartingStyleAttribute(false);
|
|
@@ -16913,11 +16922,11 @@ var TooltipViewport = /* @__PURE__ */ React102.forwardRef(function TooltipViewpo
|
|
|
16913
16922
|
});
|
|
16914
16923
|
});
|
|
16915
16924
|
if (process.env.NODE_ENV !== "production") TooltipViewport.displayName = "TooltipViewport";
|
|
16916
|
-
function getActivationDirection(
|
|
16917
|
-
if (!
|
|
16925
|
+
function getActivationDirection(offset5) {
|
|
16926
|
+
if (!offset5) {
|
|
16918
16927
|
return void 0;
|
|
16919
16928
|
}
|
|
16920
|
-
return `${getValueWithTolerance(
|
|
16929
|
+
return `${getValueWithTolerance(offset5.horizontal, 5, "right", "left")} ${getValueWithTolerance(offset5.vertical, 5, "down", "up")}`;
|
|
16921
16930
|
}
|
|
16922
16931
|
function getValueWithTolerance(value, tolerance, positiveLabel, negativeLabel) {
|
|
16923
16932
|
if (value > tolerance) {
|
|
@@ -17003,6 +17012,29 @@ function mergePropsWithEventComposition(triggerProps, childProps) {
|
|
|
17003
17012
|
};
|
|
17004
17013
|
}
|
|
17005
17014
|
}
|
|
17015
|
+
if (triggerProps.ref || childProps.ref) {
|
|
17016
|
+
const triggerRef = triggerProps.ref;
|
|
17017
|
+
const childRef = childProps.ref;
|
|
17018
|
+
if (triggerRef && childRef) {
|
|
17019
|
+
mergedProps.ref = (value) => {
|
|
17020
|
+
assignRef(triggerRef, value);
|
|
17021
|
+
assignRef(childRef, value);
|
|
17022
|
+
};
|
|
17023
|
+
} else if (childRef) {
|
|
17024
|
+
mergedProps.ref = childRef;
|
|
17025
|
+
}
|
|
17026
|
+
}
|
|
17027
|
+
if (typeof triggerProps.style === "object" && triggerProps.style !== null && typeof childProps.style === "object" && childProps.style !== null) {
|
|
17028
|
+
mergedProps.style = { ...triggerProps.style, ...childProps.style };
|
|
17029
|
+
} else if (childProps.style !== void 0) {
|
|
17030
|
+
mergedProps.style = childProps.style;
|
|
17031
|
+
}
|
|
17032
|
+
if (triggerProps.className || childProps.className) {
|
|
17033
|
+
const classes = [triggerProps.className, childProps.className].filter(Boolean).join(" ");
|
|
17034
|
+
if (classes) {
|
|
17035
|
+
mergedProps.className = classes;
|
|
17036
|
+
}
|
|
17037
|
+
}
|
|
17006
17038
|
return mergedProps;
|
|
17007
17039
|
}
|
|
17008
17040
|
function cloneElementWithMergedProps(element, triggerProps) {
|
|
@@ -19844,7 +19876,7 @@ var getInsetEndStyles = (size4 = "medium") => {
|
|
|
19844
19876
|
var startBaseStyles = "n-absolute n-left-1.5 n-inset-y-0 n-flex n-items-center";
|
|
19845
19877
|
|
|
19846
19878
|
// src/components/internal/TextInput.tsx
|
|
19847
|
-
import { composeRefs } from "@radix-ui/react-compose-refs";
|
|
19879
|
+
import { composeRefs as composeRefs2 } from "@radix-ui/react-compose-refs";
|
|
19848
19880
|
import React140, {
|
|
19849
19881
|
forwardRef as forwardRef50,
|
|
19850
19882
|
useCallback as useCallback34,
|
|
@@ -20053,7 +20085,7 @@ var SubmittableTextInput = forwardRef50(function SubmittableTextInput2({
|
|
|
20053
20085
|
return /* @__PURE__ */ React140.createElement(
|
|
20054
20086
|
"input",
|
|
20055
20087
|
{
|
|
20056
|
-
ref:
|
|
20088
|
+
ref: composeRefs2(ref, forwardedRef),
|
|
20057
20089
|
...rest,
|
|
20058
20090
|
value: internalValue,
|
|
20059
20091
|
onKeyDown: handleKeyDown,
|
|
@@ -21072,8 +21104,8 @@ var PopoverViewport = /* @__PURE__ */ React156.forwardRef(function PopoverViewpo
|
|
|
21072
21104
|
if (activeTrigger && previousActiveTrigger && activeTrigger !== previousActiveTrigger && lastHandledTriggerRef.current !== activeTrigger && capturedNodeRef.current) {
|
|
21073
21105
|
setPreviousContentNode(capturedNodeRef.current);
|
|
21074
21106
|
setShowStartingStyleAttribute(true);
|
|
21075
|
-
const
|
|
21076
|
-
setNewTriggerOffset(
|
|
21107
|
+
const offset5 = calculateRelativePosition2(previousActiveTrigger, activeTrigger);
|
|
21108
|
+
setNewTriggerOffset(offset5);
|
|
21077
21109
|
cleanupFrame.request(() => {
|
|
21078
21110
|
cleanupFrame.request(() => {
|
|
21079
21111
|
setShowStartingStyleAttribute(false);
|
|
@@ -21138,11 +21170,11 @@ var PopoverViewport = /* @__PURE__ */ React156.forwardRef(function PopoverViewpo
|
|
|
21138
21170
|
});
|
|
21139
21171
|
});
|
|
21140
21172
|
if (process.env.NODE_ENV !== "production") PopoverViewport.displayName = "PopoverViewport";
|
|
21141
|
-
function getActivationDirection2(
|
|
21142
|
-
if (!
|
|
21173
|
+
function getActivationDirection2(offset5) {
|
|
21174
|
+
if (!offset5) {
|
|
21143
21175
|
return void 0;
|
|
21144
21176
|
}
|
|
21145
|
-
return `${getValueWithTolerance2(
|
|
21177
|
+
return `${getValueWithTolerance2(offset5.horizontal, 5, "right", "left")} ${getValueWithTolerance2(offset5.vertical, 5, "down", "up")}`;
|
|
21146
21178
|
}
|
|
21147
21179
|
function getValueWithTolerance2(value, tolerance, positiveLabel, negativeLabel) {
|
|
21148
21180
|
if (value > tolerance) {
|
|
@@ -21350,9 +21382,12 @@ function Popover({
|
|
|
21350
21382
|
triggerProps,
|
|
21351
21383
|
childProps
|
|
21352
21384
|
);
|
|
21353
|
-
mergedProps.ref = (
|
|
21354
|
-
|
|
21355
|
-
|
|
21385
|
+
mergedProps.ref = composeRefs(
|
|
21386
|
+
mergedProps.ref,
|
|
21387
|
+
(node) => {
|
|
21388
|
+
if (node) setAnchorElement(node);
|
|
21389
|
+
}
|
|
21390
|
+
);
|
|
21356
21391
|
return React158.cloneElement(
|
|
21357
21392
|
element,
|
|
21358
21393
|
mergedProps
|
|
@@ -26530,18 +26565,18 @@ function buildMeasurements({
|
|
|
26530
26565
|
gap
|
|
26531
26566
|
}) {
|
|
26532
26567
|
const measurements = [];
|
|
26533
|
-
let
|
|
26568
|
+
let offset5 = paddingTop;
|
|
26534
26569
|
for (let index2 = 0; index2 < itemCount; index2 += 1) {
|
|
26535
26570
|
const size4 = Math.max(0, getItemHeight(index2));
|
|
26536
|
-
const start =
|
|
26571
|
+
const start = offset5;
|
|
26537
26572
|
const end = start + size4;
|
|
26538
26573
|
measurements.push({ index: index2, size: size4, start, end });
|
|
26539
|
-
|
|
26574
|
+
offset5 = end + gap;
|
|
26540
26575
|
}
|
|
26541
26576
|
const totalHeight = measurements.length ? measurements[measurements.length - 1].end + paddingBottom : paddingTop + paddingBottom;
|
|
26542
26577
|
return { measurements, totalHeight };
|
|
26543
26578
|
}
|
|
26544
|
-
function findFirstVisibleIndex(measurements,
|
|
26579
|
+
function findFirstVisibleIndex(measurements, offset5) {
|
|
26545
26580
|
if (!measurements.length) return 0;
|
|
26546
26581
|
let low = 0;
|
|
26547
26582
|
let high = measurements.length - 1;
|
|
@@ -26549,7 +26584,7 @@ function findFirstVisibleIndex(measurements, offset4) {
|
|
|
26549
26584
|
while (low <= high) {
|
|
26550
26585
|
const middle = Math.floor((low + high) / 2);
|
|
26551
26586
|
const measurement = measurements[middle];
|
|
26552
|
-
if (measurement.end >
|
|
26587
|
+
if (measurement.end > offset5) {
|
|
26553
26588
|
match = middle;
|
|
26554
26589
|
high = middle - 1;
|
|
26555
26590
|
} else {
|
|
@@ -26766,8 +26801,8 @@ var VirtualizedInner = React204.forwardRef(function Virtualized({
|
|
|
26766
26801
|
},
|
|
26767
26802
|
visibleRange.end >= visibleRange.start && Array.from(
|
|
26768
26803
|
{ length: visibleRange.end - visibleRange.start + 1 },
|
|
26769
|
-
(_,
|
|
26770
|
-
const index2 = visibleRange.start +
|
|
26804
|
+
(_, offset5) => {
|
|
26805
|
+
const index2 = visibleRange.start + offset5;
|
|
26771
26806
|
const measurement = measurements[index2];
|
|
26772
26807
|
const key = itemKey ? itemKey(index2) : index2;
|
|
26773
26808
|
return /* @__PURE__ */ React204.createElement(
|
|
@@ -27867,7 +27902,7 @@ var ListViewRoot = memoGeneric(
|
|
|
27867
27902
|
);
|
|
27868
27903
|
|
|
27869
27904
|
// src/components/listView/ListViewRow.tsx
|
|
27870
|
-
import { composeRefs as
|
|
27905
|
+
import { composeRefs as composeRefs3 } from "@radix-ui/react-compose-refs";
|
|
27871
27906
|
import React210, {
|
|
27872
27907
|
forwardRef as forwardRef84,
|
|
27873
27908
|
useCallback as useCallback51,
|
|
@@ -28182,7 +28217,7 @@ var ListViewRow = memoGeneric(
|
|
|
28182
28217
|
},
|
|
28183
28218
|
({ ref: sortableRef, ...sortableProps }, { relativeDropPosition }) => renderContent(
|
|
28184
28219
|
sortableProps,
|
|
28185
|
-
|
|
28220
|
+
composeRefs3(sortableRef, forwardedRef),
|
|
28186
28221
|
relativeDropPosition
|
|
28187
28222
|
)
|
|
28188
28223
|
);
|
|
@@ -30797,9 +30832,12 @@ var Drawer = React229.memo(
|
|
|
30797
30832
|
triggerProps,
|
|
30798
30833
|
childProps
|
|
30799
30834
|
);
|
|
30800
|
-
mergedProps.ref = (
|
|
30801
|
-
|
|
30802
|
-
|
|
30835
|
+
mergedProps.ref = composeRefs(
|
|
30836
|
+
mergedProps.ref,
|
|
30837
|
+
(node) => {
|
|
30838
|
+
if (node) setAnchorElement(node);
|
|
30839
|
+
}
|
|
30840
|
+
);
|
|
30803
30841
|
return React229.cloneElement(
|
|
30804
30842
|
element,
|
|
30805
30843
|
mergedProps
|
|
@@ -31002,6 +31040,7 @@ var SegmentedControl = memoGeneric(function SegmentedControl2({
|
|
|
31002
31040
|
const containerRef = useRef71(null);
|
|
31003
31041
|
const itemRefs = useRef71([]);
|
|
31004
31042
|
const [indicatorStyle, setIndicatorStyle] = useState61(null);
|
|
31043
|
+
const [resizeTrigger, setResizeTrigger] = useState61(0);
|
|
31005
31044
|
const selectedIndex = useMemo117(() => {
|
|
31006
31045
|
if (!value) return -1;
|
|
31007
31046
|
return items.findIndex((item) => item.value === value);
|
|
@@ -31024,7 +31063,16 @@ var SegmentedControl = memoGeneric(function SegmentedControl2({
|
|
|
31024
31063
|
width: itemRect.width
|
|
31025
31064
|
});
|
|
31026
31065
|
hasInitialized.current = true;
|
|
31027
|
-
}, [selectedIndex, variant, items.length]);
|
|
31066
|
+
}, [selectedIndex, variant, items.length, resizeTrigger]);
|
|
31067
|
+
useLayoutEffect10(() => {
|
|
31068
|
+
const container = containerRef.current;
|
|
31069
|
+
if (!container || variant !== "default") return;
|
|
31070
|
+
const observer = new ResizeObserver(() => {
|
|
31071
|
+
setResizeTrigger((prev) => prev + 1);
|
|
31072
|
+
});
|
|
31073
|
+
observer.observe(container);
|
|
31074
|
+
return () => observer.disconnect();
|
|
31075
|
+
}, [variant]);
|
|
31028
31076
|
const handleSelect = useCallback57(
|
|
31029
31077
|
(newValue) => {
|
|
31030
31078
|
if (!allowEmpty && !newValue) return;
|
|
@@ -31131,6 +31179,7 @@ var SECTION_HEADER_HEIGHT = 24;
|
|
|
31131
31179
|
var HEADER_HEIGHT = 80;
|
|
31132
31180
|
var FOOTER_HEIGHT = 40;
|
|
31133
31181
|
var HORIZONTAL_PADDING = 8;
|
|
31182
|
+
var SEGMENTED_CONTROL_ITEM_WIDTH = 31;
|
|
31134
31183
|
var categoryIcons = {
|
|
31135
31184
|
search: /* @__PURE__ */ React231.createElement(MagnifyingGlassIcon, null),
|
|
31136
31185
|
frequent: /* @__PURE__ */ React231.createElement(ClockIcon, null),
|
|
@@ -31472,6 +31521,14 @@ var EmojiPicker = memo25(function EmojiPicker2({
|
|
|
31472
31521
|
],
|
|
31473
31522
|
[frequentlyUsed.length]
|
|
31474
31523
|
);
|
|
31524
|
+
const segmentedControlGap = useMemo118(() => {
|
|
31525
|
+
const numItems = categoryItems.length;
|
|
31526
|
+
const availableWidth = size4.width - HORIZONTAL_PADDING * 2;
|
|
31527
|
+
const totalItemsWidth = numItems * SEGMENTED_CONTROL_ITEM_WIDTH;
|
|
31528
|
+
const remainingSpace = availableWidth - totalItemsWidth;
|
|
31529
|
+
const numGaps = numItems - 1;
|
|
31530
|
+
return numGaps > 0 ? Math.max(0, remainingSpace / numGaps) : 0;
|
|
31531
|
+
}, [categoryItems.length, size4.width]);
|
|
31475
31532
|
const displayEmoji = hoveredEmoji ?? selectedEmoji;
|
|
31476
31533
|
const footerText = displayEmoji ? `:${displayEmoji.names[0]}:${displayEmoji.names.length > 1 ? ` :${displayEmoji.names[1]}:` : ""}` : "";
|
|
31477
31534
|
const skinToneMenuItems = useMemo118(
|
|
@@ -31496,7 +31553,8 @@ var EmojiPicker = memo25(function EmojiPicker2({
|
|
|
31496
31553
|
value: activeCategory ?? "search",
|
|
31497
31554
|
onValueChange: handleCategoryChange,
|
|
31498
31555
|
allowEmpty: true,
|
|
31499
|
-
className: "n-flex-nowrap n-px-2"
|
|
31556
|
+
className: "n-flex-nowrap n-px-2",
|
|
31557
|
+
style: { gap: segmentedControlGap }
|
|
31500
31558
|
}
|
|
31501
31559
|
),
|
|
31502
31560
|
/* @__PURE__ */ React231.createElement(Divider, null),
|
|
@@ -36347,27 +36405,24 @@ var Section = memo31(function InspectorSection({
|
|
|
36347
36405
|
});
|
|
36348
36406
|
|
|
36349
36407
|
// src/components/SelectionToolbar.tsx
|
|
36350
|
-
import
|
|
36351
|
-
|
|
36352
|
-
|
|
36353
|
-
|
|
36354
|
-
|
|
36355
|
-
|
|
36356
|
-
|
|
36357
|
-
|
|
36358
|
-
|
|
36359
|
-
|
|
36360
|
-
|
|
36361
|
-
|
|
36362
|
-
|
|
36363
|
-
|
|
36364
|
-
})
|
|
36365
|
-
});
|
|
36408
|
+
import {
|
|
36409
|
+
useFloating as useFloating3,
|
|
36410
|
+
offset as offset4,
|
|
36411
|
+
flip as flip4,
|
|
36412
|
+
shift as shift4,
|
|
36413
|
+
FloatingPortal as FloatingPortal3
|
|
36414
|
+
} from "@floating-ui/react";
|
|
36415
|
+
import React261, { memo as memo32, useCallback as useCallback64, useEffect as useEffect54, useMemo as useMemo129, useState as useState68 } from "react";
|
|
36416
|
+
function getPlacement(side, align) {
|
|
36417
|
+
if (align === "center") {
|
|
36418
|
+
return side;
|
|
36419
|
+
}
|
|
36420
|
+
return `${side}-${align}`;
|
|
36421
|
+
}
|
|
36366
36422
|
var SelectionToolbarContainer = memo32(
|
|
36367
36423
|
function SelectionToolbarContainer2({
|
|
36368
36424
|
rect,
|
|
36369
36425
|
children,
|
|
36370
|
-
portalContainer,
|
|
36371
36426
|
side = "top",
|
|
36372
36427
|
sideOffset = 10,
|
|
36373
36428
|
align = "center",
|
|
@@ -36377,31 +36432,52 @@ var SelectionToolbarContainer = memo32(
|
|
|
36377
36432
|
transitionDuration = 0.2
|
|
36378
36433
|
}) {
|
|
36379
36434
|
const portalScopeId = usePortalScopeId();
|
|
36380
|
-
const
|
|
36381
|
-
const
|
|
36382
|
-
|
|
36435
|
+
const [containerElement, setContainerElement] = useState68(null);
|
|
36436
|
+
const containerRef = useCallback64((el) => {
|
|
36437
|
+
setContainerElement(el);
|
|
36438
|
+
}, []);
|
|
36439
|
+
const containerRefObject = useMemo129(
|
|
36440
|
+
() => ({ current: containerElement }),
|
|
36441
|
+
[containerElement]
|
|
36442
|
+
);
|
|
36443
|
+
const size4 = useSize(containerRefObject, "width");
|
|
36444
|
+
const virtualElement = useMemo129(
|
|
36383
36445
|
() => ({
|
|
36384
|
-
|
|
36446
|
+
getBoundingClientRect: () => ({
|
|
36447
|
+
width: rect.width,
|
|
36448
|
+
height: rect.height,
|
|
36449
|
+
x: rect.x,
|
|
36450
|
+
y: rect.y,
|
|
36451
|
+
top: rect.y,
|
|
36452
|
+
right: rect.x + rect.width,
|
|
36453
|
+
bottom: rect.y + rect.height,
|
|
36454
|
+
left: rect.x
|
|
36455
|
+
})
|
|
36385
36456
|
}),
|
|
36386
36457
|
[rect]
|
|
36387
36458
|
);
|
|
36388
|
-
const
|
|
36389
|
-
|
|
36459
|
+
const placement = getPlacement(side, align);
|
|
36460
|
+
const { refs, floatingStyles } = useFloating3({
|
|
36461
|
+
placement,
|
|
36462
|
+
middleware: avoidCollisions ? [offset4(sideOffset), flip4(), shift4({ padding: 10 })] : [offset4(sideOffset)]
|
|
36463
|
+
});
|
|
36464
|
+
useEffect54(() => {
|
|
36465
|
+
refs.setPositionReference(virtualElement);
|
|
36466
|
+
}, [refs, virtualElement]);
|
|
36467
|
+
return /* @__PURE__ */ React261.createElement(FloatingPortal3, null, /* @__PURE__ */ React261.createElement(
|
|
36468
|
+
"div",
|
|
36390
36469
|
{
|
|
36470
|
+
ref: refs.setFloating,
|
|
36391
36471
|
...portalScopeProps(portalScopeId),
|
|
36392
|
-
side,
|
|
36393
|
-
sideOffset,
|
|
36394
|
-
align,
|
|
36395
|
-
avoidCollisions,
|
|
36396
|
-
collisionPadding: 10,
|
|
36397
36472
|
contentEditable: false,
|
|
36398
36473
|
style: {
|
|
36399
|
-
|
|
36474
|
+
...floatingStyles,
|
|
36400
36475
|
opacity: size4 ? 1 : 0,
|
|
36401
36476
|
transition: `opacity ${transitionDuration}s ease-in-out`,
|
|
36402
36477
|
[cssVarNames.colors.inputBackground]: "transparent",
|
|
36403
36478
|
[cssVarNames.colors.buttonBackground]: "transparent"
|
|
36404
|
-
}
|
|
36479
|
+
},
|
|
36480
|
+
className: "n-z-menu"
|
|
36405
36481
|
},
|
|
36406
36482
|
/* @__PURE__ */ React261.createElement(
|
|
36407
36483
|
"div",
|
|
@@ -36419,8 +36495,7 @@ var SelectionToolbarContainer = memo32(
|
|
|
36419
36495
|
},
|
|
36420
36496
|
children
|
|
36421
36497
|
)
|
|
36422
|
-
);
|
|
36423
|
-
return /* @__PURE__ */ React261.createElement(PopperPrimitive.Root, null, /* @__PURE__ */ React261.createElement(PopperPrimitive.Anchor, { virtualRef }), portalContainer ? createPortal5(popperContent, portalContainer) : popperContent);
|
|
36498
|
+
));
|
|
36424
36499
|
}
|
|
36425
36500
|
);
|
|
36426
36501
|
|
|
@@ -38797,9 +38872,9 @@ if (process.env.NODE_ENV !== "production") SelectGroupLabel.displayName = "Selec
|
|
|
38797
38872
|
|
|
38798
38873
|
// src/components/SelectMenu.tsx
|
|
38799
38874
|
import React290, {
|
|
38800
|
-
useCallback as
|
|
38875
|
+
useCallback as useCallback66,
|
|
38801
38876
|
useMemo as useMemo142,
|
|
38802
|
-
useState as
|
|
38877
|
+
useState as useState71
|
|
38803
38878
|
} from "react";
|
|
38804
38879
|
var readOnlyStyle = {
|
|
38805
38880
|
justifyContent: "flex-start",
|
|
@@ -38907,20 +38982,20 @@ var SelectMenu = memoGeneric(function SelectMenu2({
|
|
|
38907
38982
|
(item) => isSelectableMenuItem(item) && item.value === value
|
|
38908
38983
|
);
|
|
38909
38984
|
const icon = selectedItem?.icon;
|
|
38910
|
-
const [internalOpen, setInternalOpen] =
|
|
38985
|
+
const [internalOpen, setInternalOpen] = useState71(open2 ?? false);
|
|
38911
38986
|
const { label, fieldId: id } = useLabel({
|
|
38912
38987
|
label: props.label,
|
|
38913
38988
|
fieldId: props.id
|
|
38914
38989
|
});
|
|
38915
38990
|
const labelType = useLabelType();
|
|
38916
|
-
const handleOpenChange =
|
|
38991
|
+
const handleOpenChange = useCallback66(
|
|
38917
38992
|
(newOpen) => {
|
|
38918
38993
|
onOpenChange?.(newOpen);
|
|
38919
38994
|
setInternalOpen(newOpen);
|
|
38920
38995
|
},
|
|
38921
38996
|
[onOpenChange]
|
|
38922
38997
|
);
|
|
38923
|
-
const handleValueChange =
|
|
38998
|
+
const handleValueChange = useCallback66(
|
|
38924
38999
|
(newValue) => {
|
|
38925
39000
|
if (newValue !== null) {
|
|
38926
39001
|
onSelect?.(newValue);
|
|
@@ -40311,8 +40386,8 @@ var SliderThumb = /* @__PURE__ */ React296.forwardRef(function SliderThumb2(comp
|
|
|
40311
40386
|
if (thumbRef.current != null) {
|
|
40312
40387
|
const axis = orientation === "horizontal" ? "x" : "y";
|
|
40313
40388
|
const midpoint = getMidpoint(thumbRef.current);
|
|
40314
|
-
const
|
|
40315
|
-
pressedThumbCenterOffsetRef.current =
|
|
40389
|
+
const offset5 = (orientation === "horizontal" ? event2.clientX : event2.clientY) - midpoint[axis];
|
|
40390
|
+
pressedThumbCenterOffsetRef.current = offset5;
|
|
40316
40391
|
}
|
|
40317
40392
|
if (inputRef.current != null && pressedInputRef.current !== inputRef.current) {
|
|
40318
40393
|
pressedInputRef.current = inputRef.current;
|
|
@@ -40405,7 +40480,7 @@ var SliderIndicator = /* @__PURE__ */ React297.forwardRef(function SliderIndicat
|
|
|
40405
40480
|
if (process.env.NODE_ENV !== "production") SliderIndicator.displayName = "SliderIndicator";
|
|
40406
40481
|
|
|
40407
40482
|
// src/components/Slider.tsx
|
|
40408
|
-
import React298, { memo as memo36, useCallback as
|
|
40483
|
+
import React298, { memo as memo36, useCallback as useCallback68 } from "react";
|
|
40409
40484
|
var THUMB_WIDTH = 8;
|
|
40410
40485
|
var thumbStyle = {
|
|
40411
40486
|
width: THUMB_WIDTH
|
|
@@ -40428,7 +40503,7 @@ var Slider = memo36(function Slider2({
|
|
|
40428
40503
|
const { fieldId: id } = useLabel({
|
|
40429
40504
|
fieldId: props.id
|
|
40430
40505
|
});
|
|
40431
|
-
const handleValueChange =
|
|
40506
|
+
const handleValueChange = useCallback68(
|
|
40432
40507
|
(newValue) => {
|
|
40433
40508
|
onValueChange(newValue);
|
|
40434
40509
|
},
|
|
@@ -40512,7 +40587,7 @@ function createSharedDrag() {
|
|
|
40512
40587
|
|
|
40513
40588
|
// src/components/Stepper.tsx
|
|
40514
40589
|
import { clamp as clamp9 } from "@noya-app/noya-utils";
|
|
40515
|
-
import React300, { memo as memo37, useCallback as
|
|
40590
|
+
import React300, { memo as memo37, useCallback as useCallback69, useMemo as useMemo146 } from "react";
|
|
40516
40591
|
var Stepper = memo37(function Stepper2({
|
|
40517
40592
|
style: style2,
|
|
40518
40593
|
className,
|
|
@@ -40533,7 +40608,7 @@ var Stepper = memo37(function Stepper2({
|
|
|
40533
40608
|
const value = useMemo146(() => {
|
|
40534
40609
|
return clamp9(valueProp, min2, max2);
|
|
40535
40610
|
}, [valueProp, min2, max2]);
|
|
40536
|
-
const handleValueChange =
|
|
40611
|
+
const handleValueChange = useCallback69(
|
|
40537
40612
|
(value2) => {
|
|
40538
40613
|
const newValue = clamp9(value2, min2, max2);
|
|
40539
40614
|
onValueChange(newValue);
|
|
@@ -40914,7 +40989,7 @@ function Tabs({
|
|
|
40914
40989
|
}
|
|
40915
40990
|
|
|
40916
40991
|
// src/components/UserPicker.tsx
|
|
40917
|
-
import React306, { useCallback as
|
|
40992
|
+
import React306, { useCallback as useCallback70, useMemo as useMemo148, useState as useState75 } from "react";
|
|
40918
40993
|
function UserPicker({
|
|
40919
40994
|
users,
|
|
40920
40995
|
value,
|
|
@@ -40938,13 +41013,13 @@ function UserPicker({
|
|
|
40938
41013
|
return sortedUsers.map(createUserMenuItem);
|
|
40939
41014
|
}, [sortedUsers]);
|
|
40940
41015
|
const isControlled = value !== void 0;
|
|
40941
|
-
const [uncontrolledValue, setUncontrolledValue] =
|
|
41016
|
+
const [uncontrolledValue, setUncontrolledValue] = useState75(defaultValue2);
|
|
40942
41017
|
const selectedUserId = isControlled ? value : uncontrolledValue;
|
|
40943
41018
|
const selectedItem = useMemo148(() => {
|
|
40944
41019
|
if (!selectedUserId) return void 0;
|
|
40945
41020
|
return items.find((item) => item.value === selectedUserId);
|
|
40946
41021
|
}, [items, selectedUserId]);
|
|
40947
|
-
const updateSelectedUserId =
|
|
41022
|
+
const updateSelectedUserId = useCallback70(
|
|
40948
41023
|
(userId) => {
|
|
40949
41024
|
if (!isControlled) {
|
|
40950
41025
|
setUncontrolledValue(userId);
|
|
@@ -40953,7 +41028,7 @@ function UserPicker({
|
|
|
40953
41028
|
},
|
|
40954
41029
|
[isControlled, onChangeUserId]
|
|
40955
41030
|
);
|
|
40956
|
-
const handleSelectItem =
|
|
41031
|
+
const handleSelectItem = useCallback70(
|
|
40957
41032
|
(item) => {
|
|
40958
41033
|
updateSelectedUserId(item.value);
|
|
40959
41034
|
onSelectUser?.(usersById.get(item.value));
|
|
@@ -41154,7 +41229,7 @@ var UserPointer = memo38(function UserPointer2({
|
|
|
41154
41229
|
import { useKeyboardShortcuts as useKeyboardShortcuts4 } from "@noya-app/noya-keymap";
|
|
41155
41230
|
import React317, {
|
|
41156
41231
|
memo as memo40,
|
|
41157
|
-
useCallback as
|
|
41232
|
+
useCallback as useCallback74,
|
|
41158
41233
|
useImperativeHandle as useImperativeHandle18,
|
|
41159
41234
|
useMemo as useMemo155,
|
|
41160
41235
|
useRef as useRef94
|
|
@@ -41229,7 +41304,7 @@ function OverlayToolbar({
|
|
|
41229
41304
|
}
|
|
41230
41305
|
|
|
41231
41306
|
// src/components/workspace/DrawerWorkspaceLayout.tsx
|
|
41232
|
-
import React312, { useMemo as useMemo152, useRef as useRef90, useState as
|
|
41307
|
+
import React312, { useMemo as useMemo152, useRef as useRef90, useState as useState76 } from "react";
|
|
41233
41308
|
|
|
41234
41309
|
// src/components/workspace/constants.ts
|
|
41235
41310
|
var EDITOR_PANEL_GROUP_ID = "editor-panel-group";
|
|
@@ -41602,7 +41677,7 @@ var DrawerWorkspaceLayout = memoGeneric(function DrawerWorkspaceLayout2({
|
|
|
41602
41677
|
compactDrawerMenu
|
|
41603
41678
|
}) {
|
|
41604
41679
|
const portalContainer = useRef90(null);
|
|
41605
|
-
const [{ leftSidebarCollapsed, rightSidebarCollapsed }, setLayoutState] =
|
|
41680
|
+
const [{ leftSidebarCollapsed, rightSidebarCollapsed }, setLayoutState] = useState76({
|
|
41606
41681
|
leftSidebarCollapsed: true,
|
|
41607
41682
|
rightSidebarCollapsed: true
|
|
41608
41683
|
});
|
|
@@ -41754,12 +41829,12 @@ var DrawerWorkspaceLayout = memoGeneric(function DrawerWorkspaceLayout2({
|
|
|
41754
41829
|
});
|
|
41755
41830
|
|
|
41756
41831
|
// src/components/workspace/PanelWorkspaceLayout.tsx
|
|
41757
|
-
import React316, { useCallback as
|
|
41832
|
+
import React316, { useCallback as useCallback73, useMemo as useMemo154, useRef as useRef93, useState as useState78 } from "react";
|
|
41758
41833
|
|
|
41759
41834
|
// src/components/resizablePanels/Panel.tsx
|
|
41760
41835
|
import React313, {
|
|
41761
41836
|
forwardRef as forwardRef124,
|
|
41762
|
-
useEffect as
|
|
41837
|
+
useEffect as useEffect58,
|
|
41763
41838
|
useId as useId5,
|
|
41764
41839
|
useImperativeHandle as useImperativeHandle16
|
|
41765
41840
|
} from "react";
|
|
@@ -41791,7 +41866,7 @@ var Panel = forwardRef124(
|
|
|
41791
41866
|
collapsePanel,
|
|
41792
41867
|
isPanelExpanded
|
|
41793
41868
|
} = context;
|
|
41794
|
-
|
|
41869
|
+
useEffect58(() => {
|
|
41795
41870
|
registerPanel({
|
|
41796
41871
|
id,
|
|
41797
41872
|
order,
|
|
@@ -41837,12 +41912,12 @@ var Panel = forwardRef124(
|
|
|
41837
41912
|
// src/components/resizablePanels/PanelGroup.tsx
|
|
41838
41913
|
import React314, {
|
|
41839
41914
|
forwardRef as forwardRef125,
|
|
41840
|
-
useCallback as
|
|
41841
|
-
useEffect as
|
|
41915
|
+
useCallback as useCallback71,
|
|
41916
|
+
useEffect as useEffect59,
|
|
41842
41917
|
useImperativeHandle as useImperativeHandle17,
|
|
41843
41918
|
useMemo as useMemo153,
|
|
41844
41919
|
useRef as useRef91,
|
|
41845
|
-
useState as
|
|
41920
|
+
useState as useState77
|
|
41846
41921
|
} from "react";
|
|
41847
41922
|
function getStorageKey(autoSaveId) {
|
|
41848
41923
|
return `noya-panels:${autoSaveId}`;
|
|
@@ -41866,10 +41941,10 @@ var PanelGroup = forwardRef125(
|
|
|
41866
41941
|
const containerRef = useRef91(null);
|
|
41867
41942
|
const containerSize = useSize(containerRef);
|
|
41868
41943
|
const containerWidth = containerSize?.width ?? 0;
|
|
41869
|
-
const [panels, setPanels] =
|
|
41944
|
+
const [panels, setPanels] = useState77(/* @__PURE__ */ new Map());
|
|
41870
41945
|
const panelsRef = useRef91(panels);
|
|
41871
41946
|
panelsRef.current = panels;
|
|
41872
|
-
const [resizing, setResizing] =
|
|
41947
|
+
const [resizing, setResizing] = useState77(null);
|
|
41873
41948
|
const sortedPanels = useMemo153(() => {
|
|
41874
41949
|
return Array.from(panels.values()).sort((a, b) => a.order - b.order);
|
|
41875
41950
|
}, [panels]);
|
|
@@ -41881,7 +41956,7 @@ var PanelGroup = forwardRef125(
|
|
|
41881
41956
|
}
|
|
41882
41957
|
return null;
|
|
41883
41958
|
}, [sortedPanels]);
|
|
41884
|
-
const calculateLayout =
|
|
41959
|
+
const calculateLayout = useCallback71(
|
|
41885
41960
|
(panelStates, width) => {
|
|
41886
41961
|
if (width === 0) return panelStates;
|
|
41887
41962
|
const sorted = Array.from(panelStates.values()).sort(
|
|
@@ -41906,18 +41981,18 @@ var PanelGroup = forwardRef125(
|
|
|
41906
41981
|
},
|
|
41907
41982
|
[]
|
|
41908
41983
|
);
|
|
41909
|
-
|
|
41984
|
+
useEffect59(() => {
|
|
41910
41985
|
if (containerWidth > 0 && panels.size > 0) {
|
|
41911
41986
|
setPanels((prev) => calculateLayout(prev, containerWidth));
|
|
41912
41987
|
}
|
|
41913
41988
|
}, [containerWidth, calculateLayout, panels.size]);
|
|
41914
|
-
|
|
41989
|
+
useEffect59(() => {
|
|
41915
41990
|
if (onLayout && sortedPanels.length > 0) {
|
|
41916
41991
|
const sizes = sortedPanels.map((p) => p.collapsed ? 0 : p.size);
|
|
41917
41992
|
onLayout(sizes);
|
|
41918
41993
|
}
|
|
41919
41994
|
}, [onLayout, sortedPanels]);
|
|
41920
|
-
const registerPanel =
|
|
41995
|
+
const registerPanel = useCallback71(
|
|
41921
41996
|
(panel) => {
|
|
41922
41997
|
setPanels((prev) => {
|
|
41923
41998
|
const savedSizes = loadSavedSizes(autoSaveId);
|
|
@@ -41937,26 +42012,26 @@ var PanelGroup = forwardRef125(
|
|
|
41937
42012
|
},
|
|
41938
42013
|
[autoSaveId, calculateLayout, containerWidth]
|
|
41939
42014
|
);
|
|
41940
|
-
const unregisterPanel =
|
|
42015
|
+
const unregisterPanel = useCallback71((panelId) => {
|
|
41941
42016
|
setPanels((prev) => {
|
|
41942
42017
|
const newPanels = new Map(prev);
|
|
41943
42018
|
newPanels.delete(panelId);
|
|
41944
42019
|
return newPanels;
|
|
41945
42020
|
});
|
|
41946
42021
|
}, []);
|
|
41947
|
-
const getPanelSize =
|
|
42022
|
+
const getPanelSize = useCallback71(
|
|
41948
42023
|
(panelId) => {
|
|
41949
42024
|
return panels.get(panelId)?.size ?? 0;
|
|
41950
42025
|
},
|
|
41951
42026
|
[panels]
|
|
41952
42027
|
);
|
|
41953
|
-
const getPanelIndex =
|
|
42028
|
+
const getPanelIndex = useCallback71(
|
|
41954
42029
|
(panelId) => {
|
|
41955
42030
|
return sortedPanels.findIndex((p) => p.id === panelId);
|
|
41956
42031
|
},
|
|
41957
42032
|
[sortedPanels]
|
|
41958
42033
|
);
|
|
41959
|
-
const setPanelSize =
|
|
42034
|
+
const setPanelSize = useCallback71(
|
|
41960
42035
|
(panelId, size4) => {
|
|
41961
42036
|
setPanels((prev) => {
|
|
41962
42037
|
const panel = prev.get(panelId);
|
|
@@ -41984,7 +42059,7 @@ var PanelGroup = forwardRef125(
|
|
|
41984
42059
|
},
|
|
41985
42060
|
[autoSaveId, calculateLayout, containerWidth]
|
|
41986
42061
|
);
|
|
41987
|
-
const expandPanel =
|
|
42062
|
+
const expandPanel = useCallback71(
|
|
41988
42063
|
(panelId) => {
|
|
41989
42064
|
setPanels((prev) => {
|
|
41990
42065
|
const panel = prev.get(panelId);
|
|
@@ -42009,7 +42084,7 @@ var PanelGroup = forwardRef125(
|
|
|
42009
42084
|
},
|
|
42010
42085
|
[autoSaveId, calculateLayout, containerWidth]
|
|
42011
42086
|
);
|
|
42012
|
-
const collapsePanel =
|
|
42087
|
+
const collapsePanel = useCallback71(
|
|
42013
42088
|
(panelId) => {
|
|
42014
42089
|
setPanels((prev) => {
|
|
42015
42090
|
const panel = prev.get(panelId);
|
|
@@ -42033,14 +42108,14 @@ var PanelGroup = forwardRef125(
|
|
|
42033
42108
|
},
|
|
42034
42109
|
[autoSaveId, calculateLayout, containerWidth]
|
|
42035
42110
|
);
|
|
42036
|
-
const isPanelExpanded =
|
|
42111
|
+
const isPanelExpanded = useCallback71(
|
|
42037
42112
|
(panelId) => {
|
|
42038
42113
|
const panel = panels.get(panelId);
|
|
42039
42114
|
return panel ? !panel.collapsed : false;
|
|
42040
42115
|
},
|
|
42041
42116
|
[panels]
|
|
42042
42117
|
);
|
|
42043
|
-
const startResize =
|
|
42118
|
+
const startResize = useCallback71(
|
|
42044
42119
|
(handleIndex, startX) => {
|
|
42045
42120
|
const startSizes = sortedPanels.map((p) => p.size);
|
|
42046
42121
|
setResizing({
|
|
@@ -42051,7 +42126,7 @@ var PanelGroup = forwardRef125(
|
|
|
42051
42126
|
},
|
|
42052
42127
|
[sortedPanels]
|
|
42053
42128
|
);
|
|
42054
|
-
|
|
42129
|
+
useEffect59(() => {
|
|
42055
42130
|
if (!resizing) return;
|
|
42056
42131
|
const handleMouseMove = (e) => {
|
|
42057
42132
|
const delta = e.clientX - resizing.startX;
|
|
@@ -42202,7 +42277,7 @@ var PanelGroup = forwardRef125(
|
|
|
42202
42277
|
);
|
|
42203
42278
|
|
|
42204
42279
|
// src/components/resizablePanels/PanelResizeHandle.tsx
|
|
42205
|
-
import React315, { useCallback as
|
|
42280
|
+
import React315, { useCallback as useCallback72, useContext as useContext65, useRef as useRef92 } from "react";
|
|
42206
42281
|
function PanelResizeHandle({
|
|
42207
42282
|
className,
|
|
42208
42283
|
disabled: disabled2,
|
|
@@ -42210,7 +42285,7 @@ function PanelResizeHandle({
|
|
|
42210
42285
|
}) {
|
|
42211
42286
|
const context = useContext65(PanelGroupContext);
|
|
42212
42287
|
const handleRef = useRef92(null);
|
|
42213
|
-
const handleMouseDown =
|
|
42288
|
+
const handleMouseDown = useCallback72(
|
|
42214
42289
|
(e) => {
|
|
42215
42290
|
if (disabled2 || !context) return;
|
|
42216
42291
|
e.preventDefault();
|
|
@@ -42272,13 +42347,13 @@ var PanelWorkspaceLayout = memoGeneric(function PanelWorkspaceLayout2({
|
|
|
42272
42347
|
const autoSaveId = useMemo154(() => {
|
|
42273
42348
|
return autoSavePrefix ? `${autoSavePrefix}--v3--${EDITOR_PANEL_GROUP_ID}` : Math.random().toString(36).substring(2, 15);
|
|
42274
42349
|
}, [autoSavePrefix]);
|
|
42275
|
-
const [leftSidebarCollapsed, setLeftSidebarCollapsed] =
|
|
42350
|
+
const [leftSidebarCollapsed, setLeftSidebarCollapsed] = useState78(
|
|
42276
42351
|
leftSidebarOptions.defaultCollapsed ?? false
|
|
42277
42352
|
);
|
|
42278
|
-
const [rightSidebarCollapsed, setRightSidebarCollapsed] =
|
|
42353
|
+
const [rightSidebarCollapsed, setRightSidebarCollapsed] = useState78(
|
|
42279
42354
|
rightSidebarOptions.defaultCollapsed ?? false
|
|
42280
42355
|
);
|
|
42281
|
-
const handleLayoutChange =
|
|
42356
|
+
const handleLayoutChange = useCallback73(
|
|
42282
42357
|
(sizes) => {
|
|
42283
42358
|
const leftIndex = leftPanel ? 0 : -1;
|
|
42284
42359
|
const rightIndex = rightPanel ? leftPanel ? 2 : 1 : -1;
|
|
@@ -42291,7 +42366,7 @@ var PanelWorkspaceLayout = memoGeneric(function PanelWorkspaceLayout2({
|
|
|
42291
42366
|
},
|
|
42292
42367
|
[leftPanel, rightPanel]
|
|
42293
42368
|
);
|
|
42294
|
-
const handleLeftTabChange =
|
|
42369
|
+
const handleLeftTabChange = useCallback73(
|
|
42295
42370
|
(value) => {
|
|
42296
42371
|
if (value === leftTabValue) {
|
|
42297
42372
|
if (leftSidebarRef.current?.isExpanded()) {
|
|
@@ -42308,7 +42383,7 @@ var PanelWorkspaceLayout = memoGeneric(function PanelWorkspaceLayout2({
|
|
|
42308
42383
|
},
|
|
42309
42384
|
[leftSidebarRef, leftTabValue, onChangeLeftTab]
|
|
42310
42385
|
);
|
|
42311
|
-
const handleRightTabChange =
|
|
42386
|
+
const handleRightTabChange = useCallback73(
|
|
42312
42387
|
(value) => {
|
|
42313
42388
|
if (value === rightTabValue) {
|
|
42314
42389
|
if (rightSidebarRef.current?.isExpanded()) {
|
|
@@ -42563,12 +42638,12 @@ var WorkspaceLayout = forwardRefGeneric(function WorkspaceLayout2({
|
|
|
42563
42638
|
}
|
|
42564
42639
|
});
|
|
42565
42640
|
const isDrawerActive = sideType === "drawer" || sideType === "auto" && parentSize.width <= sideTypeBreakpoint;
|
|
42566
|
-
const closeLeftSidebar =
|
|
42641
|
+
const closeLeftSidebar = useCallback74(() => {
|
|
42567
42642
|
if (isDrawerActive) {
|
|
42568
42643
|
leftSidebarRef.current?.collapse();
|
|
42569
42644
|
}
|
|
42570
42645
|
}, [isDrawerActive]);
|
|
42571
|
-
const closeRightSidebar =
|
|
42646
|
+
const closeRightSidebar = useCallback74(() => {
|
|
42572
42647
|
if (isDrawerActive) {
|
|
42573
42648
|
rightSidebarRef.current?.collapse();
|
|
42574
42649
|
}
|
|
@@ -42745,9 +42820,9 @@ function usePlatformModKey() {
|
|
|
42745
42820
|
}
|
|
42746
42821
|
|
|
42747
42822
|
// src/hooks/useTheme.ts
|
|
42748
|
-
import { useEffect as
|
|
42823
|
+
import { useEffect as useEffect60, useState as useState79 } from "react";
|
|
42749
42824
|
function useTheme() {
|
|
42750
|
-
const [theme, setTheme] =
|
|
42825
|
+
const [theme, setTheme] = useState79("light");
|
|
42751
42826
|
const checkTheme = () => {
|
|
42752
42827
|
const currentTheme = document.body.getAttribute("data-theme");
|
|
42753
42828
|
switch (currentTheme) {
|
|
@@ -42759,7 +42834,7 @@ function useTheme() {
|
|
|
42759
42834
|
break;
|
|
42760
42835
|
}
|
|
42761
42836
|
};
|
|
42762
|
-
|
|
42837
|
+
useEffect60(() => {
|
|
42763
42838
|
checkTheme();
|
|
42764
42839
|
const observer = new MutationObserver((mutations) => {
|
|
42765
42840
|
mutations.forEach((mutation) => {
|