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