@noya-app/noya-designsystem 0.1.94 → 0.1.95
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 +9 -9
- package/CHANGELOG.md +10 -0
- package/dist/index.css +1 -1
- package/dist/index.d.mts +158 -93
- package/dist/index.d.ts +158 -93
- package/dist/index.js +1307 -1034
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1231 -962
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
- package/src/__tests__/SharedDragProvider.test.ts +72 -29
- package/src/__tests__/fuzzyScorer.test.ts +49 -1
- package/src/components/Button.tsx +1 -1
- package/src/components/Combobox.tsx +23 -3
- package/src/components/ComboboxMenu.tsx +32 -15
- package/src/components/ContextMenu.tsx +26 -7
- package/src/components/DimensionInput.tsx +12 -2
- package/src/components/DropdownMenu.tsx +23 -8
- package/src/components/InputField.tsx +1 -0
- package/src/components/InspectorContainer.tsx +16 -1
- package/src/components/List.tsx +25 -3
- package/src/components/Popover.tsx +13 -1
- package/src/components/Section.tsx +35 -11
- package/src/components/SegmentedControl.tsx +14 -4
- package/src/components/Toolbar.tsx +16 -1
- package/src/components/ToolbarItems.tsx +322 -0
- package/src/components/Tooltip.tsx +8 -1
- package/src/components/__tests__/ToolbarItems.test.tsx +205 -0
- package/src/components/internal/Menu.tsx +4 -1
- package/src/components/internal/TextInput.tsx +43 -2
- package/src/components/internal/__tests__/TextInput.test.tsx +77 -0
- package/src/components/listView/ListViewEditableRowTitle.tsx +37 -1
- package/src/components/listView/ListViewRow.tsx +3 -0
- package/src/components/listView/__tests__/ListViewEditableRowTitle.test.tsx +69 -0
- package/src/components/sorting/Sortable.tsx +4 -1
- package/src/index.tsx +0 -1
- package/src/utils/combobox.ts +22 -5
- package/src/utils/fuzzyScorer.ts +71 -0
- package/tailwind.config.ts +7 -0
- package/src/components/InspectorPrimitives.tsx +0 -188
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 useState83 = React340.useState;
|
|
19
|
+
var useEffect60 = React340.useEffect;
|
|
20
20
|
var useLayoutEffect12 = React340.useLayoutEffect;
|
|
21
21
|
var useDebugValue2 = React340.useDebugValue;
|
|
22
22
|
function useSyncExternalStore$2(subscribe2, getSnapshot2) {
|
|
23
|
-
var value = getSnapshot2(), _useState =
|
|
23
|
+
var value = getSnapshot2(), _useState = useState83({ inst: { value, getSnapshot: getSnapshot2 } }), 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
|
[subscribe2, value, getSnapshot2]
|
|
31
31
|
);
|
|
32
|
-
|
|
32
|
+
useEffect60(
|
|
33
33
|
function() {
|
|
34
34
|
checkIfSnapshotChanged(inst) && forceUpdate({ inst });
|
|
35
35
|
return subscribe2(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 = useState83({
|
|
82
82
|
inst: { value, getSnapshot: getSnapshot2 }
|
|
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
|
[subscribe2, value, getSnapshot2]
|
|
92
92
|
);
|
|
93
|
-
|
|
93
|
+
useEffect60(
|
|
94
94
|
function() {
|
|
95
95
|
checkIfSnapshotChanged(inst) && forceUpdate({ inst });
|
|
96
96
|
return subscribe2(function() {
|
|
@@ -116,7 +116,7 @@ var require_use_sync_external_store_shim_development = __commonJS({
|
|
|
116
116
|
return getSnapshot2();
|
|
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 React340 = __require("react"), objectIs = "function" === typeof Object.is ? Object.is : is,
|
|
119
|
+
var React340 = __require("react"), objectIs = "function" === typeof Object.is ? Object.is : is, useState83 = React340.useState, useEffect60 = React340.useEffect, useLayoutEffect12 = React340.useLayoutEffect, useDebugValue2 = React340.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 !== React340.useSyncExternalStore ? React340.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 useSyncExternalStore5 = shim.useSyncExternalStore;
|
|
149
149
|
var useRef99 = React340.useRef;
|
|
150
|
-
var
|
|
150
|
+
var useEffect60 = React340.useEffect;
|
|
151
151
|
var useMemo102 = React340.useMemo;
|
|
152
152
|
var useDebugValue2 = React340.useDebugValue;
|
|
153
153
|
exports.useSyncExternalStoreWithSelector = function(subscribe2, getSnapshot2, getServerSnapshot2, selector, isEqual) {
|
|
@@ -191,7 +191,7 @@ var require_with_selector_production = __commonJS({
|
|
|
191
191
|
[getSnapshot2, getServerSnapshot2, selector, isEqual]
|
|
192
192
|
);
|
|
193
193
|
var value = useSyncExternalStore5(subscribe2, instRef[0], instRef[1]);
|
|
194
|
-
|
|
194
|
+
useEffect60(
|
|
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 React340 = __require("react"), shim = require_shim(), objectIs = "function" === typeof Object.is ? Object.is : is, useSyncExternalStore5 = shim.useSyncExternalStore, useRef99 = React340.useRef,
|
|
216
|
+
var React340 = __require("react"), shim = require_shim(), objectIs = "function" === typeof Object.is ? Object.is : is, useSyncExternalStore5 = shim.useSyncExternalStore, useRef99 = React340.useRef, useEffect60 = React340.useEffect, useMemo102 = React340.useMemo, useDebugValue2 = React340.useDebugValue;
|
|
217
217
|
exports.useSyncExternalStoreWithSelector = function(subscribe2, getSnapshot2, getServerSnapshot2, selector, isEqual) {
|
|
218
218
|
var instRef = useRef99(null);
|
|
219
219
|
if (null === instRef.current) {
|
|
@@ -256,7 +256,7 @@ var require_with_selector_development = __commonJS({
|
|
|
256
256
|
[getSnapshot2, getServerSnapshot2, selector, isEqual]
|
|
257
257
|
);
|
|
258
258
|
var value = useSyncExternalStore5(subscribe2, instRef[0], instRef[1]);
|
|
259
|
-
|
|
259
|
+
useEffect60(
|
|
260
260
|
function() {
|
|
261
261
|
inst.hasValue = true;
|
|
262
262
|
inst.value = value;
|
|
@@ -292,12 +292,12 @@ var require_use_sync_external_store_shim_production2 = __commonJS({
|
|
|
292
292
|
return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y;
|
|
293
293
|
}
|
|
294
294
|
var objectIs = "function" === typeof Object.is ? Object.is : is;
|
|
295
|
-
var
|
|
296
|
-
var
|
|
295
|
+
var useState83 = React340.useState;
|
|
296
|
+
var useEffect60 = React340.useEffect;
|
|
297
297
|
var useLayoutEffect12 = React340.useLayoutEffect;
|
|
298
298
|
var useDebugValue2 = React340.useDebugValue;
|
|
299
299
|
function useSyncExternalStore$2(subscribe2, getSnapshot2) {
|
|
300
|
-
var value = getSnapshot2(), _useState =
|
|
300
|
+
var value = getSnapshot2(), _useState = useState83({ inst: { value, getSnapshot: getSnapshot2 } }), inst = _useState[0].inst, forceUpdate = _useState[1];
|
|
301
301
|
useLayoutEffect12(
|
|
302
302
|
function() {
|
|
303
303
|
inst.value = value;
|
|
@@ -306,7 +306,7 @@ var require_use_sync_external_store_shim_production2 = __commonJS({
|
|
|
306
306
|
},
|
|
307
307
|
[subscribe2, value, getSnapshot2]
|
|
308
308
|
);
|
|
309
|
-
|
|
309
|
+
useEffect60(
|
|
310
310
|
function() {
|
|
311
311
|
checkIfSnapshotChanged(inst) && forceUpdate({ inst });
|
|
312
312
|
return subscribe2(function() {
|
|
@@ -355,7 +355,7 @@ var require_use_sync_external_store_shim_development2 = __commonJS({
|
|
|
355
355
|
"The result of getSnapshot should be cached to avoid an infinite loop"
|
|
356
356
|
), didWarnUncachedGetSnapshot = true);
|
|
357
357
|
}
|
|
358
|
-
cachedValue =
|
|
358
|
+
cachedValue = useState83({
|
|
359
359
|
inst: { value, getSnapshot: getSnapshot2 }
|
|
360
360
|
});
|
|
361
361
|
var inst = cachedValue[0].inst, forceUpdate = cachedValue[1];
|
|
@@ -367,7 +367,7 @@ var require_use_sync_external_store_shim_development2 = __commonJS({
|
|
|
367
367
|
},
|
|
368
368
|
[subscribe2, value, getSnapshot2]
|
|
369
369
|
);
|
|
370
|
-
|
|
370
|
+
useEffect60(
|
|
371
371
|
function() {
|
|
372
372
|
checkIfSnapshotChanged(inst) && forceUpdate({ inst });
|
|
373
373
|
return subscribe2(function() {
|
|
@@ -393,7 +393,7 @@ var require_use_sync_external_store_shim_development2 = __commonJS({
|
|
|
393
393
|
return getSnapshot2();
|
|
394
394
|
}
|
|
395
395
|
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
|
396
|
-
var React340 = __require("react"), objectIs = "function" === typeof Object.is ? Object.is : is,
|
|
396
|
+
var React340 = __require("react"), objectIs = "function" === typeof Object.is ? Object.is : is, useState83 = React340.useState, useEffect60 = React340.useEffect, useLayoutEffect12 = React340.useLayoutEffect, useDebugValue2 = React340.useDebugValue, didWarnOld18Alpha = false, didWarnUncachedGetSnapshot = false, shim = "undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement ? useSyncExternalStore$1 : useSyncExternalStore$2;
|
|
397
397
|
exports.useSyncExternalStore = void 0 !== React340.useSyncExternalStore ? React340.useSyncExternalStore : shim;
|
|
398
398
|
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
|
|
399
399
|
}();
|
|
@@ -779,14 +779,14 @@ var require_grammarDiagnostics = __commonJS({
|
|
|
779
779
|
rootNonTerminating.add(name);
|
|
780
780
|
}
|
|
781
781
|
}
|
|
782
|
-
const
|
|
782
|
+
const memo43 = /* @__PURE__ */ new Map();
|
|
783
783
|
const collectCauses = (name, path) => {
|
|
784
|
-
if (
|
|
785
|
-
return
|
|
784
|
+
if (memo43.has(name)) {
|
|
785
|
+
return memo43.get(name);
|
|
786
786
|
}
|
|
787
787
|
if (rootNonTerminating.has(name)) {
|
|
788
788
|
const direct = /* @__PURE__ */ new Set([name]);
|
|
789
|
-
|
|
789
|
+
memo43.set(name, direct);
|
|
790
790
|
return direct;
|
|
791
791
|
}
|
|
792
792
|
if (path.has(name)) {
|
|
@@ -805,7 +805,7 @@ var require_grammarDiagnostics = __commonJS({
|
|
|
805
805
|
}
|
|
806
806
|
}
|
|
807
807
|
path.delete(name);
|
|
808
|
-
|
|
808
|
+
memo43.set(name, result);
|
|
809
809
|
return result;
|
|
810
810
|
};
|
|
811
811
|
const dependencyIssues = [];
|
|
@@ -17593,7 +17593,8 @@ var Tooltip = React110.memo(function Tooltip2({
|
|
|
17593
17593
|
content,
|
|
17594
17594
|
sideOffset = 2,
|
|
17595
17595
|
side = "bottom",
|
|
17596
|
-
portalContainer
|
|
17596
|
+
portalContainer,
|
|
17597
|
+
contentClassName
|
|
17597
17598
|
}) {
|
|
17598
17599
|
const portalScopeId = usePortalScopeId();
|
|
17599
17600
|
return /* @__PURE__ */ React110.createElement(index_parts_exports2.Provider, null, /* @__PURE__ */ React110.createElement(index_parts_exports2.Root, null, /* @__PURE__ */ React110.createElement(
|
|
@@ -17614,7 +17615,7 @@ var Tooltip = React110.memo(function Tooltip2({
|
|
|
17614
17615
|
/* @__PURE__ */ React110.createElement(
|
|
17615
17616
|
index_parts_exports2.Popup,
|
|
17616
17617
|
{
|
|
17617
|
-
className: `${textStyles.small} n-text-text n-rounded-sm n-p-2 n-bg-popover-background n-shadow-tooltip n-z-menu`
|
|
17618
|
+
className: contentClassName ?? `${textStyles.small} n-text-text n-rounded-sm n-p-2 n-bg-popover-background n-shadow-tooltip n-z-menu`
|
|
17618
17619
|
},
|
|
17619
17620
|
content
|
|
17620
17621
|
)
|
|
@@ -17664,7 +17665,7 @@ var Button = forwardRef31(function Button2({
|
|
|
17664
17665
|
}, forwardedRef) {
|
|
17665
17666
|
const colorScheme = colorSchemeProp ?? "default";
|
|
17666
17667
|
const baseClassName = cx(
|
|
17667
|
-
"n-no-underline n-leading-[1] n-relative n-outline-none n-select-none n-text-left n-rounded n-flex n-items-center n-justify-center [&>*]:n-pointer-events-none n-[-webkit-app-region:no-drag] focus:n-ring-2 focus:n-ring-primary focus:n-shadow-[0_0_0_1px_var(--n-popover-background)_inset] n-transition-all",
|
|
17668
|
+
"n-no-underline n-leading-[1] n-relative n-outline-none n-select-none n-text-left n-rounded n-flex n-items-center n-justify-center [&>*]:n-pointer-events-none n-[-webkit-app-region:no-drag] focus-visible:n-ring-2 focus-visible:n-ring-primary focus-visible:n-shadow-[0_0_0_1px_var(--n-popover-background)_inset] n-transition-all",
|
|
17668
17669
|
variant === "ghost" ? "n-border" : "n-border-0",
|
|
17669
17670
|
disabled2 ? "n-opacity-25" : "",
|
|
17670
17671
|
!className?.includes("flex") ? "n-flex-none" : "",
|
|
@@ -17710,6 +17711,28 @@ var Button = forwardRef31(function Button2({
|
|
|
17710
17711
|
return tooltip ? /* @__PURE__ */ React111.createElement(Tooltip, { content: tooltip }, buttonElement) : buttonElement;
|
|
17711
17712
|
});
|
|
17712
17713
|
|
|
17714
|
+
// src/components/IconButton.tsx
|
|
17715
|
+
import * as React112 from "react";
|
|
17716
|
+
var IconButton = React112.memo(
|
|
17717
|
+
React112.forwardRef(function IconButton2({ selected, iconName, color, size: size4, contentStyle, ...props }, forwardedRef) {
|
|
17718
|
+
const Icon2 = Icons[iconName];
|
|
17719
|
+
const style2 = React112.useMemo(() => {
|
|
17720
|
+
return {
|
|
17721
|
+
padding: "0 2px",
|
|
17722
|
+
...size4 && { minHeight: size4 },
|
|
17723
|
+
...contentStyle
|
|
17724
|
+
};
|
|
17725
|
+
}, [contentStyle, size4]);
|
|
17726
|
+
return /* @__PURE__ */ React112.createElement(Button, { ref: forwardedRef, ...props, variant: "none", contentStyle: style2 }, /* @__PURE__ */ React112.createElement(
|
|
17727
|
+
Icon2,
|
|
17728
|
+
{
|
|
17729
|
+
color: color ?? (selected ? cssVars.colors.iconSelected : cssVars.colors.icon),
|
|
17730
|
+
...size4 && { width: size4, height: size4 }
|
|
17731
|
+
}
|
|
17732
|
+
));
|
|
17733
|
+
})
|
|
17734
|
+
);
|
|
17735
|
+
|
|
17713
17736
|
// src/components/internal/Menu.tsx
|
|
17714
17737
|
import { getShortcutDisplayParts } from "@noya-app/noya-keymap";
|
|
17715
17738
|
import React172, { memo as memo11 } from "react";
|
|
@@ -17737,14 +17760,14 @@ __export(index_parts_exports3, {
|
|
|
17737
17760
|
});
|
|
17738
17761
|
|
|
17739
17762
|
// ../../node_modules/@base-ui/react/toast/provider/ToastProvider.mjs
|
|
17740
|
-
import * as
|
|
17763
|
+
import * as React114 from "react";
|
|
17741
17764
|
|
|
17742
17765
|
// ../../node_modules/@base-ui/react/toast/provider/ToastProviderContext.mjs
|
|
17743
|
-
import * as
|
|
17744
|
-
var ToastContext = /* @__PURE__ */
|
|
17766
|
+
import * as React113 from "react";
|
|
17767
|
+
var ToastContext = /* @__PURE__ */ React113.createContext(void 0);
|
|
17745
17768
|
if (process.env.NODE_ENV !== "production") ToastContext.displayName = "ToastContext";
|
|
17746
17769
|
function useToastProviderContext() {
|
|
17747
|
-
const context =
|
|
17770
|
+
const context = React113.useContext(ToastContext);
|
|
17748
17771
|
if (!context) {
|
|
17749
17772
|
throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: useToastManager must be used within <Toast.Provider>." : formatErrorMessage_default(73));
|
|
17750
17773
|
}
|
|
@@ -18153,7 +18176,7 @@ var ToastProvider = function ToastProvider2(props) {
|
|
|
18153
18176
|
prevFocusElement: null
|
|
18154
18177
|
})).current;
|
|
18155
18178
|
useOnMount(store.disposeEffect);
|
|
18156
|
-
|
|
18179
|
+
React114.useEffect(function subscribeToToastManager() {
|
|
18157
18180
|
if (!toastManager) {
|
|
18158
18181
|
return void 0;
|
|
18159
18182
|
}
|
|
@@ -18197,9 +18220,9 @@ function ToastProviderPropsSynchronizer(props) {
|
|
|
18197
18220
|
}
|
|
18198
18221
|
|
|
18199
18222
|
// ../../node_modules/@base-ui/react/toast/viewport/ToastViewport.mjs
|
|
18200
|
-
import * as
|
|
18223
|
+
import * as React115 from "react";
|
|
18201
18224
|
import { jsx as _jsx24, jsxs as _jsxs10 } from "react/jsx-runtime";
|
|
18202
|
-
var ToastViewport = /* @__PURE__ */
|
|
18225
|
+
var ToastViewport = /* @__PURE__ */ React115.forwardRef(function ToastViewport2(componentProps, forwardedRef) {
|
|
18203
18226
|
const {
|
|
18204
18227
|
render,
|
|
18205
18228
|
className,
|
|
@@ -18209,9 +18232,9 @@ var ToastViewport = /* @__PURE__ */ React114.forwardRef(function ToastViewport2(
|
|
|
18209
18232
|
} = componentProps;
|
|
18210
18233
|
const store = useToastProviderContext();
|
|
18211
18234
|
const windowFocusTimeout = useTimeout();
|
|
18212
|
-
const handlingFocusGuardRef =
|
|
18213
|
-
const markedReadyForMouseLeaveRef =
|
|
18214
|
-
const touchActiveRef =
|
|
18235
|
+
const handlingFocusGuardRef = React115.useRef(false);
|
|
18236
|
+
const markedReadyForMouseLeaveRef = React115.useRef(false);
|
|
18237
|
+
const touchActiveRef = React115.useRef(false);
|
|
18215
18238
|
const isEmpty = store.useState("isEmpty");
|
|
18216
18239
|
const toasts = store.useState("toasts");
|
|
18217
18240
|
const focused = store.useState("focused");
|
|
@@ -18220,7 +18243,7 @@ var ToastViewport = /* @__PURE__ */ React114.forwardRef(function ToastViewport2(
|
|
|
18220
18243
|
const frontmostHeight = toasts[0]?.height;
|
|
18221
18244
|
const hasTransitioningToasts = toasts.some((toast) => toast.transitionStatus === "ending");
|
|
18222
18245
|
const highPriorityToasts = toasts.filter((toast) => toast.priority === "high");
|
|
18223
|
-
|
|
18246
|
+
React115.useEffect(() => {
|
|
18224
18247
|
const viewport = store.state.viewport;
|
|
18225
18248
|
if (!viewport || isEmpty) {
|
|
18226
18249
|
return void 0;
|
|
@@ -18284,7 +18307,7 @@ var ToastViewport = /* @__PURE__ */ React114.forwardRef(function ToastViewport2(
|
|
|
18284
18307
|
store.set("hovering", false);
|
|
18285
18308
|
markedReadyForMouseLeaveRef.current = false;
|
|
18286
18309
|
}
|
|
18287
|
-
|
|
18310
|
+
React115.useEffect(flushMouseLeave, [hasTransitioningToasts, store]);
|
|
18288
18311
|
function handleMouseEnter() {
|
|
18289
18312
|
store.pauseTimers();
|
|
18290
18313
|
store.set("hovering", true);
|
|
@@ -18362,12 +18385,12 @@ var ToastViewport = /* @__PURE__ */ React114.forwardRef(function ToastViewport2(
|
|
|
18362
18385
|
ref: [forwardedRef, store.setViewport],
|
|
18363
18386
|
state,
|
|
18364
18387
|
props: [defaultProps, elementProps, {
|
|
18365
|
-
children: /* @__PURE__ */ _jsxs10(
|
|
18388
|
+
children: /* @__PURE__ */ _jsxs10(React115.Fragment, {
|
|
18366
18389
|
children: [focusGuard, children, focusGuard]
|
|
18367
18390
|
})
|
|
18368
18391
|
}]
|
|
18369
18392
|
});
|
|
18370
|
-
return /* @__PURE__ */ _jsxs10(
|
|
18393
|
+
return /* @__PURE__ */ _jsxs10(React115.Fragment, {
|
|
18371
18394
|
children: [focusGuard, element, !focused && highPriorityToasts.length > 0 && /* @__PURE__ */ _jsx24("div", {
|
|
18372
18395
|
style: visuallyHidden,
|
|
18373
18396
|
children: highPriorityToasts.map((toast) => /* @__PURE__ */ _jsxs10("div", {
|
|
@@ -18385,15 +18408,15 @@ var ToastViewport = /* @__PURE__ */ React114.forwardRef(function ToastViewport2(
|
|
|
18385
18408
|
if (process.env.NODE_ENV !== "production") ToastViewport.displayName = "ToastViewport";
|
|
18386
18409
|
|
|
18387
18410
|
// ../../node_modules/@base-ui/react/toast/root/ToastRoot.mjs
|
|
18388
|
-
import * as
|
|
18411
|
+
import * as React118 from "react";
|
|
18389
18412
|
import * as ReactDOM9 from "react-dom";
|
|
18390
18413
|
|
|
18391
18414
|
// ../../node_modules/@base-ui/react/toast/root/ToastRootContext.mjs
|
|
18392
|
-
import * as
|
|
18393
|
-
var ToastRootContext = /* @__PURE__ */
|
|
18415
|
+
import * as React116 from "react";
|
|
18416
|
+
var ToastRootContext = /* @__PURE__ */ React116.createContext(void 0);
|
|
18394
18417
|
if (process.env.NODE_ENV !== "production") ToastRootContext.displayName = "ToastRootContext";
|
|
18395
18418
|
function useToastRootContext() {
|
|
18396
|
-
const context =
|
|
18419
|
+
const context = React116.useContext(ToastRootContext);
|
|
18397
18420
|
if (!context) {
|
|
18398
18421
|
throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: ToastRootContext is missing. Toast parts must be used within <Toast.Root>." : formatErrorMessage_default(66));
|
|
18399
18422
|
}
|
|
@@ -18401,7 +18424,7 @@ function useToastRootContext() {
|
|
|
18401
18424
|
}
|
|
18402
18425
|
|
|
18403
18426
|
// ../../node_modules/@base-ui/react/utils/useSwipeDismiss.mjs
|
|
18404
|
-
import * as
|
|
18427
|
+
import * as React117 from "react";
|
|
18405
18428
|
|
|
18406
18429
|
// ../../node_modules/@base-ui/react/internals/clamp.mjs
|
|
18407
18430
|
function clamp2(val, min2 = Number.MIN_SAFE_INTEGER, max2 = Number.MAX_SAFE_INTEGER) {
|
|
@@ -18466,7 +18489,7 @@ var REVERSE_CANCEL_THRESHOLD = 10;
|
|
|
18466
18489
|
var OPPOSITE_DIRECTION_DAMPING_FACTOR = 0.5;
|
|
18467
18490
|
var MIN_DRAG_THRESHOLD = 1;
|
|
18468
18491
|
var TOAST_SWIPE_IGNORE_SELECTOR = `${BASE_UI_SWIPE_IGNORE_SELECTOR},${LEGACY_SWIPE_IGNORE_SELECTOR}`;
|
|
18469
|
-
var ToastRoot = /* @__PURE__ */
|
|
18492
|
+
var ToastRoot = /* @__PURE__ */ React118.forwardRef(function ToastRoot2(componentProps, forwardedRef) {
|
|
18470
18493
|
const {
|
|
18471
18494
|
toast,
|
|
18472
18495
|
render,
|
|
@@ -18482,46 +18505,46 @@ var ToastRoot = /* @__PURE__ */ React117.forwardRef(function ToastRoot2(componen
|
|
|
18482
18505
|
}
|
|
18483
18506
|
const swipeEnabled = swipeDirections.length > 0;
|
|
18484
18507
|
const store = useToastProviderContext();
|
|
18485
|
-
const [currentSwipeDirection, setCurrentSwipeDirection] =
|
|
18486
|
-
const [isSwiping, setIsSwiping] =
|
|
18487
|
-
const [isRealSwipe, setIsRealSwipe] =
|
|
18488
|
-
const [dragOffset, setDragOffset] =
|
|
18508
|
+
const [currentSwipeDirection, setCurrentSwipeDirection] = React118.useState(void 0);
|
|
18509
|
+
const [isSwiping, setIsSwiping] = React118.useState(false);
|
|
18510
|
+
const [isRealSwipe, setIsRealSwipe] = React118.useState(false);
|
|
18511
|
+
const [dragOffset, setDragOffset] = React118.useState({
|
|
18489
18512
|
x: 0,
|
|
18490
18513
|
y: 0
|
|
18491
18514
|
});
|
|
18492
|
-
const [initialTransform, setInitialTransform] =
|
|
18515
|
+
const [initialTransform, setInitialTransform] = React118.useState({
|
|
18493
18516
|
x: 0,
|
|
18494
18517
|
y: 0,
|
|
18495
18518
|
scale: 1
|
|
18496
18519
|
});
|
|
18497
|
-
const [titleId, setTitleId] =
|
|
18498
|
-
const [descriptionId, setDescriptionId] =
|
|
18499
|
-
const [lockedDirection, setLockedDirection] =
|
|
18500
|
-
const rootRef =
|
|
18501
|
-
const lastToastIdRef =
|
|
18502
|
-
const dragStartPosRef =
|
|
18520
|
+
const [titleId, setTitleId] = React118.useState();
|
|
18521
|
+
const [descriptionId, setDescriptionId] = React118.useState();
|
|
18522
|
+
const [lockedDirection, setLockedDirection] = React118.useState(null);
|
|
18523
|
+
const rootRef = React118.useRef(null);
|
|
18524
|
+
const lastToastIdRef = React118.useRef(void 0);
|
|
18525
|
+
const dragStartPosRef = React118.useRef({
|
|
18503
18526
|
x: 0,
|
|
18504
18527
|
y: 0
|
|
18505
18528
|
});
|
|
18506
|
-
const initialTransformRef =
|
|
18529
|
+
const initialTransformRef = React118.useRef({
|
|
18507
18530
|
x: 0,
|
|
18508
18531
|
y: 0,
|
|
18509
18532
|
scale: 1
|
|
18510
18533
|
});
|
|
18511
|
-
const intendedSwipeDirectionRef =
|
|
18512
|
-
const maxSwipeDisplacementRef =
|
|
18513
|
-
const cancelledSwipeRef =
|
|
18514
|
-
const swipeCancelBaselineRef =
|
|
18534
|
+
const intendedSwipeDirectionRef = React118.useRef(void 0);
|
|
18535
|
+
const maxSwipeDisplacementRef = React118.useRef(0);
|
|
18536
|
+
const cancelledSwipeRef = React118.useRef(false);
|
|
18537
|
+
const swipeCancelBaselineRef = React118.useRef({
|
|
18515
18538
|
x: 0,
|
|
18516
18539
|
y: 0
|
|
18517
18540
|
});
|
|
18518
|
-
const isFirstPointerMoveRef =
|
|
18519
|
-
const dragOffsetRef =
|
|
18541
|
+
const isFirstPointerMoveRef = React118.useRef(false);
|
|
18542
|
+
const dragOffsetRef = React118.useRef({
|
|
18520
18543
|
x: 0,
|
|
18521
18544
|
y: 0
|
|
18522
18545
|
});
|
|
18523
|
-
const activePointerIdRef =
|
|
18524
|
-
const dragAbortControllerRef =
|
|
18546
|
+
const activePointerIdRef = React118.useRef(null);
|
|
18547
|
+
const dragAbortControllerRef = React118.useRef(null);
|
|
18525
18548
|
const domIndex = store.useState("toastIndex", toast.id);
|
|
18526
18549
|
const visibleIndex = store.useState("toastVisibleIndex", toast.id);
|
|
18527
18550
|
const offsetY = store.useState("toastOffsetY", toast.id);
|
|
@@ -18789,7 +18812,7 @@ var ToastRoot = /* @__PURE__ */ React117.forwardRef(function ToastRoot2(componen
|
|
|
18789
18812
|
store.closeToast(toast.id);
|
|
18790
18813
|
}
|
|
18791
18814
|
}
|
|
18792
|
-
|
|
18815
|
+
React118.useEffect(() => {
|
|
18793
18816
|
const element2 = rootRef.current;
|
|
18794
18817
|
if (!swipeEnabled || !element2) {
|
|
18795
18818
|
return void 0;
|
|
@@ -18837,7 +18860,7 @@ var ToastRoot = /* @__PURE__ */ React117.forwardRef(function ToastRoot2(componen
|
|
|
18837
18860
|
["--toast-height"]: toast.height ? `${toast.height}px` : void 0
|
|
18838
18861
|
}
|
|
18839
18862
|
};
|
|
18840
|
-
const toastRoot =
|
|
18863
|
+
const toastRoot = React118.useMemo(() => ({
|
|
18841
18864
|
toast,
|
|
18842
18865
|
setTitleId,
|
|
18843
18866
|
setDescriptionId,
|
|
@@ -18867,8 +18890,8 @@ var ToastRoot = /* @__PURE__ */ React117.forwardRef(function ToastRoot2(componen
|
|
|
18867
18890
|
if (process.env.NODE_ENV !== "production") ToastRoot.displayName = "ToastRoot";
|
|
18868
18891
|
|
|
18869
18892
|
// ../../node_modules/@base-ui/react/toast/content/ToastContent.mjs
|
|
18870
|
-
import * as
|
|
18871
|
-
var ToastContent = /* @__PURE__ */
|
|
18893
|
+
import * as React119 from "react";
|
|
18894
|
+
var ToastContent = /* @__PURE__ */ React119.forwardRef(function ToastContent2(componentProps, forwardedRef) {
|
|
18872
18895
|
const {
|
|
18873
18896
|
render,
|
|
18874
18897
|
className,
|
|
@@ -18880,7 +18903,7 @@ var ToastContent = /* @__PURE__ */ React118.forwardRef(function ToastContent2(co
|
|
|
18880
18903
|
expanded,
|
|
18881
18904
|
recalculateHeight
|
|
18882
18905
|
} = useToastRootContext();
|
|
18883
|
-
const contentRef =
|
|
18906
|
+
const contentRef = React119.useRef(null);
|
|
18884
18907
|
useIsoLayoutEffect(() => {
|
|
18885
18908
|
recalculateHeight();
|
|
18886
18909
|
const node = contentRef.current;
|
|
@@ -18914,10 +18937,10 @@ var ToastContent = /* @__PURE__ */ React118.forwardRef(function ToastContent2(co
|
|
|
18914
18937
|
if (process.env.NODE_ENV !== "production") ToastContent.displayName = "ToastContent";
|
|
18915
18938
|
|
|
18916
18939
|
// ../../node_modules/@base-ui/react/toast/description/ToastDescription.mjs
|
|
18917
|
-
import * as
|
|
18940
|
+
import * as React121 from "react";
|
|
18918
18941
|
|
|
18919
18942
|
// ../../node_modules/@base-ui/react/toast/utils/isRenderableNode.mjs
|
|
18920
|
-
import * as
|
|
18943
|
+
import * as React120 from "react";
|
|
18921
18944
|
function isRenderableNode(node) {
|
|
18922
18945
|
if (node == null || typeof node === "boolean" || node === "") {
|
|
18923
18946
|
return false;
|
|
@@ -18928,7 +18951,7 @@ function isRenderableNode(node) {
|
|
|
18928
18951
|
return true;
|
|
18929
18952
|
}
|
|
18930
18953
|
function hasRenderableChildren(element) {
|
|
18931
|
-
return /* @__PURE__ */
|
|
18954
|
+
return /* @__PURE__ */ React120.isValidElement(element) && isRenderableNode(element.props.children);
|
|
18932
18955
|
}
|
|
18933
18956
|
|
|
18934
18957
|
// ../../node_modules/@base-ui/react/toast/utils/useToastLabelPart.mjs
|
|
@@ -18963,7 +18986,7 @@ function useToastLabelElement(element, id, setId) {
|
|
|
18963
18986
|
}
|
|
18964
18987
|
|
|
18965
18988
|
// ../../node_modules/@base-ui/react/toast/description/ToastDescription.mjs
|
|
18966
|
-
var ToastDescription = /* @__PURE__ */
|
|
18989
|
+
var ToastDescription = /* @__PURE__ */ React121.forwardRef(function ToastDescription2(componentProps, forwardedRef) {
|
|
18967
18990
|
const {
|
|
18968
18991
|
render,
|
|
18969
18992
|
className,
|
|
@@ -18995,8 +19018,8 @@ var ToastDescription = /* @__PURE__ */ React120.forwardRef(function ToastDescrip
|
|
|
18995
19018
|
if (process.env.NODE_ENV !== "production") ToastDescription.displayName = "ToastDescription";
|
|
18996
19019
|
|
|
18997
19020
|
// ../../node_modules/@base-ui/react/toast/title/ToastTitle.mjs
|
|
18998
|
-
import * as
|
|
18999
|
-
var ToastTitle = /* @__PURE__ */
|
|
19021
|
+
import * as React122 from "react";
|
|
19022
|
+
var ToastTitle = /* @__PURE__ */ React122.forwardRef(function ToastTitle2(componentProps, forwardedRef) {
|
|
19000
19023
|
const {
|
|
19001
19024
|
render,
|
|
19002
19025
|
className,
|
|
@@ -19028,8 +19051,8 @@ var ToastTitle = /* @__PURE__ */ React121.forwardRef(function ToastTitle2(compon
|
|
|
19028
19051
|
if (process.env.NODE_ENV !== "production") ToastTitle.displayName = "ToastTitle";
|
|
19029
19052
|
|
|
19030
19053
|
// ../../node_modules/@base-ui/react/toast/close/ToastClose.mjs
|
|
19031
|
-
import * as
|
|
19032
|
-
var ToastClose = /* @__PURE__ */
|
|
19054
|
+
import * as React123 from "react";
|
|
19055
|
+
var ToastClose = /* @__PURE__ */ React123.forwardRef(function ToastClose2(componentProps, forwardedRef) {
|
|
19033
19056
|
const {
|
|
19034
19057
|
render,
|
|
19035
19058
|
className,
|
|
@@ -19043,7 +19066,7 @@ var ToastClose = /* @__PURE__ */ React122.forwardRef(function ToastClose2(compon
|
|
|
19043
19066
|
toast,
|
|
19044
19067
|
expanded
|
|
19045
19068
|
} = useToastRootContext();
|
|
19046
|
-
const [hasFocus, setHasFocus] =
|
|
19069
|
+
const [hasFocus, setHasFocus] = React123.useState(false);
|
|
19047
19070
|
const {
|
|
19048
19071
|
getButtonProps,
|
|
19049
19072
|
buttonRef
|
|
@@ -19074,8 +19097,8 @@ var ToastClose = /* @__PURE__ */ React122.forwardRef(function ToastClose2(compon
|
|
|
19074
19097
|
if (process.env.NODE_ENV !== "production") ToastClose.displayName = "ToastClose";
|
|
19075
19098
|
|
|
19076
19099
|
// ../../node_modules/@base-ui/react/toast/action/ToastAction.mjs
|
|
19077
|
-
import * as
|
|
19078
|
-
var ToastAction = /* @__PURE__ */
|
|
19100
|
+
import * as React124 from "react";
|
|
19101
|
+
var ToastAction = /* @__PURE__ */ React124.forwardRef(function ToastAction2(componentProps, forwardedRef) {
|
|
19079
19102
|
const {
|
|
19080
19103
|
render,
|
|
19081
19104
|
className,
|
|
@@ -19110,9 +19133,9 @@ var ToastAction = /* @__PURE__ */ React123.forwardRef(function ToastAction2(comp
|
|
|
19110
19133
|
if (process.env.NODE_ENV !== "production") ToastAction.displayName = "ToastAction";
|
|
19111
19134
|
|
|
19112
19135
|
// ../../node_modules/@base-ui/react/toast/portal/ToastPortal.mjs
|
|
19113
|
-
import * as
|
|
19136
|
+
import * as React125 from "react";
|
|
19114
19137
|
import { jsx as _jsx26 } from "react/jsx-runtime";
|
|
19115
|
-
var ToastPortal = /* @__PURE__ */
|
|
19138
|
+
var ToastPortal = /* @__PURE__ */ React125.forwardRef(function ToastPortal2(props, forwardedRef) {
|
|
19116
19139
|
return /* @__PURE__ */ _jsx26(FloatingPortalLite, {
|
|
19117
19140
|
ref: forwardedRef,
|
|
19118
19141
|
...props
|
|
@@ -19121,14 +19144,14 @@ var ToastPortal = /* @__PURE__ */ React124.forwardRef(function ToastPortal2(prop
|
|
|
19121
19144
|
if (process.env.NODE_ENV !== "production") ToastPortal.displayName = "ToastPortal";
|
|
19122
19145
|
|
|
19123
19146
|
// ../../node_modules/@base-ui/react/toast/positioner/ToastPositioner.mjs
|
|
19124
|
-
import * as
|
|
19147
|
+
import * as React127 from "react";
|
|
19125
19148
|
|
|
19126
19149
|
// ../../node_modules/@base-ui/react/toast/positioner/ToastPositionerContext.mjs
|
|
19127
|
-
import * as
|
|
19128
|
-
var ToastPositionerContext = /* @__PURE__ */
|
|
19150
|
+
import * as React126 from "react";
|
|
19151
|
+
var ToastPositionerContext = /* @__PURE__ */ React126.createContext(void 0);
|
|
19129
19152
|
if (process.env.NODE_ENV !== "production") ToastPositionerContext.displayName = "ToastPositionerContext";
|
|
19130
19153
|
function useToastPositionerContext() {
|
|
19131
|
-
const context =
|
|
19154
|
+
const context = React126.useContext(ToastPositionerContext);
|
|
19132
19155
|
if (context === void 0) {
|
|
19133
19156
|
throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: ToastPositionerContext is missing. ToastPositioner parts must be placed within <Toast.Positioner>." : formatErrorMessage_default(84));
|
|
19134
19157
|
}
|
|
@@ -19137,7 +19160,7 @@ function useToastPositionerContext() {
|
|
|
19137
19160
|
|
|
19138
19161
|
// ../../node_modules/@base-ui/react/toast/positioner/ToastPositioner.mjs
|
|
19139
19162
|
import { jsx as _jsx27 } from "react/jsx-runtime";
|
|
19140
|
-
var ToastPositioner = /* @__PURE__ */
|
|
19163
|
+
var ToastPositioner = /* @__PURE__ */ React127.forwardRef(function ToastPositioner2(componentProps, forwardedRef) {
|
|
19141
19164
|
const {
|
|
19142
19165
|
toast,
|
|
19143
19166
|
...props
|
|
@@ -19162,7 +19185,7 @@ var ToastPositioner = /* @__PURE__ */ React126.forwardRef(function ToastPosition
|
|
|
19162
19185
|
style: style2,
|
|
19163
19186
|
...elementProps
|
|
19164
19187
|
} = props;
|
|
19165
|
-
const [positionerElement, setPositionerElement] =
|
|
19188
|
+
const [positionerElement, setPositionerElement] = React127.useState(null);
|
|
19166
19189
|
const domIndex = store.useState("toastIndex", toast.id);
|
|
19167
19190
|
const visibleIndex = store.useState("toastVisibleIndex", toast.id);
|
|
19168
19191
|
const anchor = isElement(anchorProp) ? anchorProp : null;
|
|
@@ -19213,8 +19236,8 @@ var ToastPositioner = /* @__PURE__ */ React126.forwardRef(function ToastPosition
|
|
|
19213
19236
|
if (process.env.NODE_ENV !== "production") ToastPositioner.displayName = "ToastPositioner";
|
|
19214
19237
|
|
|
19215
19238
|
// ../../node_modules/@base-ui/react/toast/arrow/ToastArrow.mjs
|
|
19216
|
-
import * as
|
|
19217
|
-
var ToastArrow = /* @__PURE__ */
|
|
19239
|
+
import * as React128 from "react";
|
|
19240
|
+
var ToastArrow = /* @__PURE__ */ React128.forwardRef(function ToastArrow2(componentProps, forwardedRef) {
|
|
19218
19241
|
const {
|
|
19219
19242
|
className,
|
|
19220
19243
|
render,
|
|
@@ -19245,11 +19268,11 @@ var ToastArrow = /* @__PURE__ */ React127.forwardRef(function ToastArrow2(compon
|
|
|
19245
19268
|
if (process.env.NODE_ENV !== "production") ToastArrow.displayName = "ToastArrow";
|
|
19246
19269
|
|
|
19247
19270
|
// ../../node_modules/@base-ui/react/toast/useToastManager.mjs
|
|
19248
|
-
import * as
|
|
19271
|
+
import * as React129 from "react";
|
|
19249
19272
|
function useToastManager() {
|
|
19250
19273
|
const store = useToastProviderContext();
|
|
19251
19274
|
const toasts = store.useState("toasts");
|
|
19252
|
-
return
|
|
19275
|
+
return React129.useMemo(() => ({
|
|
19253
19276
|
toasts,
|
|
19254
19277
|
add: store.addToast,
|
|
19255
19278
|
close: store.closeToast,
|
|
@@ -19322,30 +19345,6 @@ function createToastManager() {
|
|
|
19322
19345
|
|
|
19323
19346
|
// src/components/Toast.tsx
|
|
19324
19347
|
import React130, { createContext as createContext26, useCallback as useCallback24, useContext as useContext26 } from "react";
|
|
19325
|
-
|
|
19326
|
-
// src/components/IconButton.tsx
|
|
19327
|
-
import * as React129 from "react";
|
|
19328
|
-
var IconButton = React129.memo(
|
|
19329
|
-
React129.forwardRef(function IconButton2({ selected, iconName, color, size: size4, contentStyle, ...props }, forwardedRef) {
|
|
19330
|
-
const Icon2 = Icons[iconName];
|
|
19331
|
-
const style2 = React129.useMemo(() => {
|
|
19332
|
-
return {
|
|
19333
|
-
padding: "0 2px",
|
|
19334
|
-
...size4 && { minHeight: size4 },
|
|
19335
|
-
...contentStyle
|
|
19336
|
-
};
|
|
19337
|
-
}, [contentStyle, size4]);
|
|
19338
|
-
return /* @__PURE__ */ React129.createElement(Button, { ref: forwardedRef, ...props, variant: "none", contentStyle: style2 }, /* @__PURE__ */ React129.createElement(
|
|
19339
|
-
Icon2,
|
|
19340
|
-
{
|
|
19341
|
-
color: color ?? (selected ? cssVars.colors.iconSelected : cssVars.colors.icon),
|
|
19342
|
-
...size4 && { width: size4, height: size4 }
|
|
19343
|
-
}
|
|
19344
|
-
));
|
|
19345
|
-
})
|
|
19346
|
-
);
|
|
19347
|
-
|
|
19348
|
-
// src/components/Toast.tsx
|
|
19349
19348
|
var ToastContext2 = createContext26(null);
|
|
19350
19349
|
function useToast() {
|
|
19351
19350
|
const context = useContext26(ToastContext2);
|
|
@@ -20460,7 +20459,11 @@ var SubmittableTextInput = forwardRef52(function SubmittableTextInput2({
|
|
|
20460
20459
|
const handleSubmit = useCallback25(() => {
|
|
20461
20460
|
const submissionValue = isSubmitTriggeredByEscapeKey.current ? value : internalValue;
|
|
20462
20461
|
isSubmitTriggeredByEscapeKey.current = false;
|
|
20463
|
-
if (submissionValue === value && !allowSubmittingWithSameValue)
|
|
20462
|
+
if (submissionValue === value && !allowSubmittingWithSameValue) {
|
|
20463
|
+
userDidEdit.current = false;
|
|
20464
|
+
setInternalValue(latestValue.current);
|
|
20465
|
+
return;
|
|
20466
|
+
}
|
|
20464
20467
|
onSubmit(submissionValue);
|
|
20465
20468
|
userDidEdit.current = false;
|
|
20466
20469
|
setInternalValue(latestValue.current);
|
|
@@ -20479,12 +20482,16 @@ var SubmittableTextInput = forwardRef52(function SubmittableTextInput2({
|
|
|
20479
20482
|
event.stopPropagation();
|
|
20480
20483
|
} else if (event.key === "Escape") {
|
|
20481
20484
|
isSubmitTriggeredByEscapeKey.current = true;
|
|
20485
|
+
if (internalValue !== value) {
|
|
20486
|
+
event.preventDefault();
|
|
20487
|
+
event.stopPropagation();
|
|
20488
|
+
}
|
|
20482
20489
|
ref.current?.blur();
|
|
20483
20490
|
} else {
|
|
20484
20491
|
onKeyDown?.(event);
|
|
20485
20492
|
}
|
|
20486
20493
|
},
|
|
20487
|
-
[onKeyDown, handleSubmit]
|
|
20494
|
+
[onKeyDown, handleSubmit, internalValue, value]
|
|
20488
20495
|
);
|
|
20489
20496
|
const handleChange = useCallback25(
|
|
20490
20497
|
(event) => {
|
|
@@ -20503,13 +20510,27 @@ var SubmittableTextInput = forwardRef52(function SubmittableTextInput2({
|
|
|
20503
20510
|
},
|
|
20504
20511
|
[onBlur, onFocusChange, handleSubmit, submitOnBlur]
|
|
20505
20512
|
);
|
|
20513
|
+
const isFocusingFromPointer = useRef52(false);
|
|
20514
|
+
const handleMouseDown = useCallback25((event) => {
|
|
20515
|
+
if (document.activeElement !== event.currentTarget) {
|
|
20516
|
+
isFocusingFromPointer.current = true;
|
|
20517
|
+
}
|
|
20518
|
+
}, []);
|
|
20506
20519
|
const handleFocusCapture = useCallback25(
|
|
20507
20520
|
(event) => {
|
|
20508
20521
|
onFocusCapture?.(event);
|
|
20509
20522
|
onFocusChange?.(true);
|
|
20523
|
+
if (isFocusingFromPointer.current) {
|
|
20524
|
+
event.currentTarget.select();
|
|
20525
|
+
}
|
|
20510
20526
|
},
|
|
20511
20527
|
[onFocusCapture, onFocusChange]
|
|
20512
20528
|
);
|
|
20529
|
+
const handleMouseUp = useCallback25((event) => {
|
|
20530
|
+
if (!isFocusingFromPointer.current) return;
|
|
20531
|
+
isFocusingFromPointer.current = false;
|
|
20532
|
+
event.preventDefault();
|
|
20533
|
+
}, []);
|
|
20513
20534
|
const autoSubmitTimeoutRef = useRef52(
|
|
20514
20535
|
null
|
|
20515
20536
|
);
|
|
@@ -20540,7 +20561,9 @@ var SubmittableTextInput = forwardRef52(function SubmittableTextInput2({
|
|
|
20540
20561
|
onKeyDown: handleKeyDown,
|
|
20541
20562
|
onChange: handleChange,
|
|
20542
20563
|
onBlur: handleBlur,
|
|
20543
|
-
onFocusCapture: handleFocusCapture
|
|
20564
|
+
onFocusCapture: handleFocusCapture,
|
|
20565
|
+
onMouseDown: handleMouseDown,
|
|
20566
|
+
onMouseUp: handleMouseUp
|
|
20544
20567
|
}
|
|
20545
20568
|
);
|
|
20546
20569
|
});
|
|
@@ -21585,6 +21608,7 @@ function Popover({
|
|
|
21585
21608
|
closable,
|
|
21586
21609
|
open,
|
|
21587
21610
|
side,
|
|
21611
|
+
align = "center",
|
|
21588
21612
|
sideOffset = 4,
|
|
21589
21613
|
showArrow = true,
|
|
21590
21614
|
onOpenChange,
|
|
@@ -21593,7 +21617,8 @@ function Popover({
|
|
|
21593
21617
|
portalContainer,
|
|
21594
21618
|
style: style2,
|
|
21595
21619
|
initialFocus,
|
|
21596
|
-
shouldCloseOnInteractOutside
|
|
21620
|
+
shouldCloseOnInteractOutside,
|
|
21621
|
+
nativeButtonTrigger = true
|
|
21597
21622
|
}) {
|
|
21598
21623
|
const defaultId = useId2();
|
|
21599
21624
|
const portalScopeId = usePortalScopeId();
|
|
@@ -21615,6 +21640,7 @@ function Popover({
|
|
|
21615
21640
|
return /* @__PURE__ */ React166.createElement(index_parts_exports5.Root, { open: isOpen, onOpenChange: handleOpenChange }, /* @__PURE__ */ React166.createElement(
|
|
21616
21641
|
index_parts_exports5.Trigger,
|
|
21617
21642
|
{
|
|
21643
|
+
nativeButton: nativeButtonTrigger,
|
|
21618
21644
|
render: (triggerProps) => {
|
|
21619
21645
|
const element = React166.isValidElement(trigger) ? trigger : /* @__PURE__ */ React166.createElement("span", null, trigger);
|
|
21620
21646
|
const childProps = element.props;
|
|
@@ -21640,7 +21666,7 @@ function Popover({
|
|
|
21640
21666
|
...portalScopeProps(portalScopeId),
|
|
21641
21667
|
anchor: anchorElement,
|
|
21642
21668
|
side,
|
|
21643
|
-
align
|
|
21669
|
+
align,
|
|
21644
21670
|
sideOffset,
|
|
21645
21671
|
collisionPadding: 8,
|
|
21646
21672
|
arrowPadding: 2,
|
|
@@ -22067,7 +22093,8 @@ function InputFieldRoot({
|
|
|
22067
22093
|
trigger: rootElement,
|
|
22068
22094
|
initialFocus: false,
|
|
22069
22095
|
sideOffset,
|
|
22070
|
-
showArrow: false
|
|
22096
|
+
showArrow: false,
|
|
22097
|
+
nativeButtonTrigger: false
|
|
22071
22098
|
},
|
|
22072
22099
|
measuredWidthObject && /* @__PURE__ */ React167.createElement(
|
|
22073
22100
|
"div",
|
|
@@ -22558,7 +22585,10 @@ var styles = {
|
|
|
22558
22585
|
marginRight: -CHECKBOX_RIGHT_INSET
|
|
22559
22586
|
}
|
|
22560
22587
|
},
|
|
22561
|
-
|
|
22588
|
+
// n-outline-none: the popup itself can take focus (e.g. a right-click
|
|
22589
|
+
// context menu) and the browser's default focus outline reads as a stray
|
|
22590
|
+
// black border on the light surface; keyboard focus is shown on items.
|
|
22591
|
+
contentStyle: "n-rounded n-bg-popover-background n-text-text n-shadow-popover n-z-menu n-py-1 n-outline-none"
|
|
22562
22592
|
};
|
|
22563
22593
|
function getKeyboardShortcuts(item) {
|
|
22564
22594
|
if (item.type === "separator") return [];
|
|
@@ -22638,6 +22668,7 @@ var SectionHeaderMenuItem = memo11(function SectionHeaderMenuItem2({
|
|
|
22638
22668
|
});
|
|
22639
22669
|
|
|
22640
22670
|
// src/components/DropdownMenu.tsx
|
|
22671
|
+
var MenuContentStyleContext = React173.createContext(void 0);
|
|
22641
22672
|
var itemStyle = (state) => cx(
|
|
22642
22673
|
"n-flex-none n-select-none n-cursor-pointer n-rounded",
|
|
22643
22674
|
"n-py-1.5 n-px-2",
|
|
@@ -22678,6 +22709,7 @@ function SubmenuItem({
|
|
|
22678
22709
|
portalScopeId
|
|
22679
22710
|
}) {
|
|
22680
22711
|
const [open, setOpen] = useState45(false);
|
|
22712
|
+
const inheritedContentStyle = React173.useContext(MenuContentStyleContext);
|
|
22681
22713
|
const submenuHasCheckedItem = item.items.some(
|
|
22682
22714
|
(subItem) => isSelectableMenuItem(subItem) && subItem.checked
|
|
22683
22715
|
);
|
|
@@ -22721,14 +22753,21 @@ function SubmenuItem({
|
|
|
22721
22753
|
alignOffset: -5,
|
|
22722
22754
|
className: "n-z-menu n-outline-none"
|
|
22723
22755
|
},
|
|
22724
|
-
/* @__PURE__ */ React173.createElement(
|
|
22725
|
-
|
|
22756
|
+
/* @__PURE__ */ React173.createElement(
|
|
22757
|
+
index_parts_exports.Popup,
|
|
22726
22758
|
{
|
|
22727
|
-
|
|
22728
|
-
|
|
22729
|
-
|
|
22730
|
-
|
|
22731
|
-
|
|
22759
|
+
className: styles.contentStyle,
|
|
22760
|
+
style: inheritedContentStyle
|
|
22761
|
+
},
|
|
22762
|
+
/* @__PURE__ */ React173.createElement(
|
|
22763
|
+
MenuViewport3,
|
|
22764
|
+
{
|
|
22765
|
+
items: item.items,
|
|
22766
|
+
onSelect,
|
|
22767
|
+
hasCheckedItem: submenuHasCheckedItem
|
|
22768
|
+
}
|
|
22769
|
+
)
|
|
22770
|
+
)
|
|
22732
22771
|
))
|
|
22733
22772
|
);
|
|
22734
22773
|
}
|
|
@@ -22844,7 +22883,7 @@ var DropdownMenuRoot = forwardRefGeneric(function DropdownMenuRoot2(props, forwa
|
|
|
22844
22883
|
(item) => isSelectableMenuItem(item) && item.checked
|
|
22845
22884
|
);
|
|
22846
22885
|
const childContent = typeof children === "function" ? children({ open }) : children || /* @__PURE__ */ React173.createElement(Button, { icon, active: open, iconRight: "DropdownChevronIcon" }, title);
|
|
22847
|
-
const isNativeButton = React173.isValidElement(childContent) && (childContent.type === "button" || childContent.type === Button && childContent.props.as !== "a");
|
|
22886
|
+
const isNativeButton = React173.isValidElement(childContent) && (childContent.type === "button" || (childContent.type === Button || childContent.type === IconButton) && childContent.props.as !== "a");
|
|
22848
22887
|
return /* @__PURE__ */ React173.createElement(
|
|
22849
22888
|
index_parts_exports.Root,
|
|
22850
22889
|
{
|
|
@@ -22895,14 +22934,14 @@ var DropdownMenuRoot = forwardRefGeneric(function DropdownMenuRoot2(props, forwa
|
|
|
22895
22934
|
collisionPadding,
|
|
22896
22935
|
className: "n-z-menu n-outline-none"
|
|
22897
22936
|
},
|
|
22898
|
-
/* @__PURE__ */ React173.createElement(index_parts_exports.Popup, { className: styles.contentStyle, style: contentStyles }, items.length === 0 ? emptyState : null, /* @__PURE__ */ React173.createElement(
|
|
22937
|
+
/* @__PURE__ */ React173.createElement(index_parts_exports.Popup, { className: styles.contentStyle, style: contentStyles }, /* @__PURE__ */ React173.createElement(MenuContentStyleContext.Provider, { value: contentStyle }, items.length === 0 ? emptyState : null, /* @__PURE__ */ React173.createElement(
|
|
22899
22938
|
MenuViewport3,
|
|
22900
22939
|
{
|
|
22901
22940
|
items,
|
|
22902
22941
|
onSelect,
|
|
22903
22942
|
hasCheckedItem
|
|
22904
22943
|
}
|
|
22905
|
-
))
|
|
22944
|
+
)))
|
|
22906
22945
|
))
|
|
22907
22946
|
);
|
|
22908
22947
|
});
|
|
@@ -24945,6 +24984,7 @@ if (process.env.NODE_ENV !== "production") ContextMenuTrigger.displayName = "Con
|
|
|
24945
24984
|
import { CheckIcon as CheckIcon2, ChevronRightIcon as ChevronRightIcon2 } from "@noya-app/noya-icons";
|
|
24946
24985
|
import { useKeyboardShortcuts as useKeyboardShortcuts2 } from "@noya-app/noya-keymap";
|
|
24947
24986
|
import React199, { useCallback as useCallback33, useMemo as useMemo53, useState as useState53 } from "react";
|
|
24987
|
+
var ContextMenuContentStyleContext = React199.createContext(void 0);
|
|
24948
24988
|
var itemStyle2 = (state) => cx(
|
|
24949
24989
|
"n-flex-none n-select-none n-cursor-pointer n-rounded",
|
|
24950
24990
|
"n-py-1.5 n-px-2",
|
|
@@ -24985,6 +25025,9 @@ function SubmenuItem2({
|
|
|
24985
25025
|
portalScopeId
|
|
24986
25026
|
}) {
|
|
24987
25027
|
const [open, setOpen] = useState53(false);
|
|
25028
|
+
const inheritedContentStyle = React199.useContext(
|
|
25029
|
+
ContextMenuContentStyleContext
|
|
25030
|
+
);
|
|
24988
25031
|
const submenuHasCheckedItem = item.items.some(
|
|
24989
25032
|
(subItem) => isSelectableMenuItem(subItem) && subItem.checked
|
|
24990
25033
|
);
|
|
@@ -25024,14 +25067,21 @@ function SubmenuItem2({
|
|
|
25024
25067
|
alignOffset: -5,
|
|
25025
25068
|
className: "n-z-menu n-outline-none"
|
|
25026
25069
|
},
|
|
25027
|
-
/* @__PURE__ */ React199.createElement(
|
|
25028
|
-
|
|
25070
|
+
/* @__PURE__ */ React199.createElement(
|
|
25071
|
+
index_parts_exports7.Popup,
|
|
25029
25072
|
{
|
|
25030
|
-
|
|
25031
|
-
|
|
25032
|
-
|
|
25033
|
-
|
|
25034
|
-
|
|
25073
|
+
className: styles.contentStyle,
|
|
25074
|
+
style: inheritedContentStyle
|
|
25075
|
+
},
|
|
25076
|
+
/* @__PURE__ */ React199.createElement(
|
|
25077
|
+
ContextMenuViewport,
|
|
25078
|
+
{
|
|
25079
|
+
items: item.items,
|
|
25080
|
+
onSelect,
|
|
25081
|
+
hasCheckedItem: submenuHasCheckedItem
|
|
25082
|
+
}
|
|
25083
|
+
)
|
|
25084
|
+
)
|
|
25035
25085
|
))
|
|
25036
25086
|
);
|
|
25037
25087
|
}
|
|
@@ -25108,7 +25158,8 @@ function ContextMenuRoot2({
|
|
|
25108
25158
|
children,
|
|
25109
25159
|
onSelect,
|
|
25110
25160
|
shouldBindKeyboardShortcuts,
|
|
25111
|
-
onOpenChange
|
|
25161
|
+
onOpenChange,
|
|
25162
|
+
contentStyle
|
|
25112
25163
|
}) {
|
|
25113
25164
|
const keymap = useMemo53(
|
|
25114
25165
|
() => shouldBindKeyboardShortcuts === false ? {} : getKeyboardShortcutsForMenuItems(items, onSelect),
|
|
@@ -25143,14 +25194,21 @@ function ContextMenuRoot2({
|
|
|
25143
25194
|
...portalScopeProps(portalScopeId),
|
|
25144
25195
|
className: "n-z-menu n-outline-none"
|
|
25145
25196
|
},
|
|
25146
|
-
/* @__PURE__ */ React199.createElement(
|
|
25147
|
-
|
|
25197
|
+
/* @__PURE__ */ React199.createElement(
|
|
25198
|
+
index_parts_exports7.Popup,
|
|
25148
25199
|
{
|
|
25149
|
-
|
|
25150
|
-
|
|
25151
|
-
|
|
25152
|
-
}
|
|
25153
|
-
|
|
25200
|
+
className: styles.contentStyle,
|
|
25201
|
+
style: contentStyle
|
|
25202
|
+
},
|
|
25203
|
+
/* @__PURE__ */ React199.createElement(ContextMenuContentStyleContext.Provider, { value: contentStyle }, /* @__PURE__ */ React199.createElement(
|
|
25204
|
+
ContextMenuViewport,
|
|
25205
|
+
{
|
|
25206
|
+
items,
|
|
25207
|
+
onSelect: handleSelectItem,
|
|
25208
|
+
hasCheckedItem
|
|
25209
|
+
}
|
|
25210
|
+
))
|
|
25211
|
+
)
|
|
25154
25212
|
)));
|
|
25155
25213
|
}
|
|
25156
25214
|
var ContextMenu = memoGeneric(ContextMenuRoot2);
|
|
@@ -26778,6 +26836,32 @@ var ListViewEditableRowTitle = memo19(function ListViewEditableRowTitle2({
|
|
|
26778
26836
|
selectBeforeDot = false
|
|
26779
26837
|
}) {
|
|
26780
26838
|
const inputRef = useRef68(null);
|
|
26839
|
+
const submittedRef = useRef68(false);
|
|
26840
|
+
const handleSubmitEditing = (nextValue) => {
|
|
26841
|
+
if (submittedRef.current) return;
|
|
26842
|
+
submittedRef.current = true;
|
|
26843
|
+
onSubmitEditing(nextValue);
|
|
26844
|
+
};
|
|
26845
|
+
const handleSubmitEditingRef = useRef68(handleSubmitEditing);
|
|
26846
|
+
handleSubmitEditingRef.current = handleSubmitEditing;
|
|
26847
|
+
useLayoutEffect7(() => {
|
|
26848
|
+
const handlePointerDown = (event) => {
|
|
26849
|
+
const element = inputRef.current;
|
|
26850
|
+
if (!element) return;
|
|
26851
|
+
if (event.target instanceof Node && (element === event.target || element.contains(event.target))) {
|
|
26852
|
+
return;
|
|
26853
|
+
}
|
|
26854
|
+
handleSubmitEditingRef.current(element.value);
|
|
26855
|
+
};
|
|
26856
|
+
document.addEventListener("pointerdown", handlePointerDown, {
|
|
26857
|
+
capture: true
|
|
26858
|
+
});
|
|
26859
|
+
return () => {
|
|
26860
|
+
document.removeEventListener("pointerdown", handlePointerDown, {
|
|
26861
|
+
capture: true
|
|
26862
|
+
});
|
|
26863
|
+
};
|
|
26864
|
+
}, []);
|
|
26781
26865
|
useLayoutEffect7(() => {
|
|
26782
26866
|
const element = inputRef.current;
|
|
26783
26867
|
if (!element || !autoFocus) return;
|
|
@@ -26804,7 +26888,7 @@ var ListViewEditableRowTitle = memo19(function ListViewEditableRowTitle2({
|
|
|
26804
26888
|
ref: inputRef,
|
|
26805
26889
|
value,
|
|
26806
26890
|
placeholder,
|
|
26807
|
-
onSubmit:
|
|
26891
|
+
onSubmit: handleSubmitEditing,
|
|
26808
26892
|
allowSubmittingWithSameValue: true,
|
|
26809
26893
|
className: cx(
|
|
26810
26894
|
"-n-mx-input-padding-x -n-my-1 n-bg-listview-editing-background",
|
|
@@ -27829,7 +27913,10 @@ function SortableItem({
|
|
|
27829
27913
|
ref,
|
|
27830
27914
|
...attributes,
|
|
27831
27915
|
...listeners,
|
|
27832
|
-
|
|
27916
|
+
// Only set an inline opacity while dragging — an always-on inline
|
|
27917
|
+
// `opacity: 1` would override class-based opacity styling on rows
|
|
27918
|
+
// (e.g. dimmed hidden layers).
|
|
27919
|
+
...isDragging ? { style: { opacity: 0.5 } } : {}
|
|
27833
27920
|
}),
|
|
27834
27921
|
[ref, attributes, listeners, isDragging]
|
|
27835
27922
|
);
|
|
@@ -28340,6 +28427,9 @@ var RowContainer = forwardRef87(
|
|
|
28340
28427
|
$clickable ? "n-cursor-pointer" : "n-cursor-default",
|
|
28341
28428
|
$isSectionHeader && "n-bg-listview-raised-background",
|
|
28342
28429
|
"n-flex n-flex-[0_0_auto] n-select-none n-items-center n-relative",
|
|
28430
|
+
// Rows own their focus styling: the standard primary ring for
|
|
28431
|
+
// keyboard focus instead of the UA default black outline.
|
|
28432
|
+
"n-outline-none focus-visible:n-ring-1 focus-visible:n-ring-primary focus-visible:n-ring-inset",
|
|
28343
28433
|
className
|
|
28344
28434
|
),
|
|
28345
28435
|
style: {
|
|
@@ -28924,9 +29014,11 @@ var List = memoGeneric(
|
|
|
28924
29014
|
},
|
|
28925
29015
|
onKeyDown: (e) => {
|
|
28926
29016
|
if (e.key !== "Enter" && e.key !== " ") return;
|
|
29017
|
+
if (e.nativeEvent.defaultPrevented) return;
|
|
28927
29018
|
e.preventDefault();
|
|
29019
|
+
e.stopPropagation();
|
|
28928
29020
|
handleSelect(id, e);
|
|
28929
|
-
if (e.key === "Enter") {
|
|
29021
|
+
if (e.key === "Enter" && !e.metaKey && !e.ctrlKey && !e.altKey && !e.shiftKey) {
|
|
28930
29022
|
setRenamingId(id);
|
|
28931
29023
|
}
|
|
28932
29024
|
},
|
|
@@ -28956,7 +29048,9 @@ var List = memoGeneric(
|
|
|
28956
29048
|
"div",
|
|
28957
29049
|
{
|
|
28958
29050
|
className: cx(
|
|
28959
|
-
|
|
29051
|
+
// outline-none: focusable-by-click (tabIndex -1)
|
|
29052
|
+
// wrapper must never show the UA focus outline.
|
|
29053
|
+
"n-overflow-hidden n-flex-none n-flex n-items-center n-justify-center n-outline-none",
|
|
28960
29054
|
thumbnailSize === "auto" && thumbnailSizeMap[size4],
|
|
28961
29055
|
isSelected && "n-text-selected-list-item-text",
|
|
28962
29056
|
roundedMap[size4]
|
|
@@ -28968,7 +29062,7 @@ var List = memoGeneric(
|
|
|
28968
29062
|
/* @__PURE__ */ React223.createElement("div", { className: "n-flex n-flex-col n-flex-1 n-w-0" }, /* @__PURE__ */ React223.createElement("div", { className: "n-flex n-items-center n-min-h-input-height n-flex-1 n-gap-2" }, /* @__PURE__ */ React223.createElement(
|
|
28969
29063
|
"div",
|
|
28970
29064
|
{
|
|
28971
|
-
className: "n-flex-1 n-w-0 n-flex n-items-center",
|
|
29065
|
+
className: "n-flex-1 n-w-0 n-flex n-items-center n-outline-none",
|
|
28972
29066
|
tabIndex: -1
|
|
28973
29067
|
},
|
|
28974
29068
|
isRenaming ? /* @__PURE__ */ React223.createElement(
|
|
@@ -29174,9 +29268,9 @@ var rgbaToHsva = ({ r, g, b, a }) => {
|
|
|
29174
29268
|
const delta = max2 - Math.min(r, g, b);
|
|
29175
29269
|
const hh = delta ? max2 === r ? (g - b) / delta : max2 === g ? 2 + (b - r) / delta : 4 + (r - g) / delta : 0;
|
|
29176
29270
|
return {
|
|
29177
|
-
h: round2(60 * (hh < 0 ? hh + 6 : hh)),
|
|
29178
|
-
s: round2(max2 ? delta / max2 * 100 : 0),
|
|
29179
|
-
v: round2(max2 / 255 * 100),
|
|
29271
|
+
h: round2(60 * (hh < 0 ? hh + 6 : hh), 2),
|
|
29272
|
+
s: round2(max2 ? delta / max2 * 100 : 0, 2),
|
|
29273
|
+
v: round2(max2 / 255 * 100, 2),
|
|
29180
29274
|
a
|
|
29181
29275
|
};
|
|
29182
29276
|
};
|
|
@@ -29874,6 +29968,53 @@ function fuzzyFilter({
|
|
|
29874
29968
|
if (!query) return scoredItems;
|
|
29875
29969
|
return scoredItems.filter(({ score }) => score > scoreThreshold).sort((a, b) => b.score - a.score);
|
|
29876
29970
|
}
|
|
29971
|
+
function wordPrefixFilter({
|
|
29972
|
+
items,
|
|
29973
|
+
query
|
|
29974
|
+
}) {
|
|
29975
|
+
const normalizedQuery = query.trim().toLowerCase();
|
|
29976
|
+
if (!normalizedQuery) {
|
|
29977
|
+
return items.map((_, index2) => ({ index: index2, score: 0 }));
|
|
29978
|
+
}
|
|
29979
|
+
const boundaryMatches = [];
|
|
29980
|
+
const substringMatches = [];
|
|
29981
|
+
items.forEach((text, index2) => {
|
|
29982
|
+
const lower = text.toLowerCase();
|
|
29983
|
+
const makeItem = (score, start) => ({
|
|
29984
|
+
index: index2,
|
|
29985
|
+
score,
|
|
29986
|
+
labelMatch: [{ start, end: start + normalizedQuery.length }]
|
|
29987
|
+
});
|
|
29988
|
+
if (lower === normalizedQuery) {
|
|
29989
|
+
boundaryMatches.push({
|
|
29990
|
+
index: index2,
|
|
29991
|
+
score: 4e3,
|
|
29992
|
+
labelMatch: [{ start: 0, end: text.length }]
|
|
29993
|
+
});
|
|
29994
|
+
return;
|
|
29995
|
+
}
|
|
29996
|
+
if (lower.startsWith(normalizedQuery)) {
|
|
29997
|
+
boundaryMatches.push(makeItem(3e3, 0));
|
|
29998
|
+
return;
|
|
29999
|
+
}
|
|
30000
|
+
const wordStart = lower.search(
|
|
30001
|
+
new RegExp(`[\\s-]${escapeRegExp(normalizedQuery)}`)
|
|
30002
|
+
);
|
|
30003
|
+
if (wordStart !== -1) {
|
|
30004
|
+
boundaryMatches.push(makeItem(2e3 - wordStart, wordStart + 1));
|
|
30005
|
+
return;
|
|
30006
|
+
}
|
|
30007
|
+
const substringIndex = lower.indexOf(normalizedQuery);
|
|
30008
|
+
if (substringIndex !== -1) {
|
|
30009
|
+
substringMatches.push(makeItem(1, substringIndex));
|
|
30010
|
+
}
|
|
30011
|
+
});
|
|
30012
|
+
const result = boundaryMatches.length > 0 ? boundaryMatches : substringMatches;
|
|
30013
|
+
return result.sort((a, b) => b.score - a.score);
|
|
30014
|
+
}
|
|
30015
|
+
function escapeRegExp(value) {
|
|
30016
|
+
return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
30017
|
+
}
|
|
29877
30018
|
function fuzzyTokenize({
|
|
29878
30019
|
item,
|
|
29879
30020
|
itemScore
|
|
@@ -29937,7 +30078,9 @@ var ComboboxState = class {
|
|
|
29937
30078
|
subscribers = [];
|
|
29938
30079
|
version = 0;
|
|
29939
30080
|
_cachedSnapshot;
|
|
29940
|
-
|
|
30081
|
+
filterStrategy;
|
|
30082
|
+
constructor(items, initialTitle, allowArbitraryValues, filterStrategy = "fuzzy") {
|
|
30083
|
+
this.filterStrategy = filterStrategy;
|
|
29941
30084
|
this.items = items;
|
|
29942
30085
|
this.lastSubmittedValue = {
|
|
29943
30086
|
filter: initialTitle,
|
|
@@ -30000,7 +30143,9 @@ var ComboboxState = class {
|
|
|
30000
30143
|
this.subscribers.forEach((listener) => listener());
|
|
30001
30144
|
}
|
|
30002
30145
|
getFilteredItems() {
|
|
30003
|
-
return filterWithGroupedSections(this.items, this.filter
|
|
30146
|
+
return filterWithGroupedSections(this.items, this.filter, {
|
|
30147
|
+
filterStrategy: this.filterStrategy
|
|
30148
|
+
});
|
|
30004
30149
|
}
|
|
30005
30150
|
getSnapshot = () => {
|
|
30006
30151
|
if (this._cachedSnapshot && this._cachedSnapshot[0] === this.version) {
|
|
@@ -30123,7 +30268,8 @@ var ComboboxState = class {
|
|
|
30123
30268
|
this.notifyChange();
|
|
30124
30269
|
}
|
|
30125
30270
|
};
|
|
30126
|
-
function filterWithGroupedSections(items, query) {
|
|
30271
|
+
function filterWithGroupedSections(items, query, options = {}) {
|
|
30272
|
+
const filterItems = options.filterStrategy === "wordPrefix" ? wordPrefixFilter : fuzzyFilter;
|
|
30127
30273
|
const sections = chunkBy(items, (_a, b) => isSelectableMenuItem(b));
|
|
30128
30274
|
let result = [];
|
|
30129
30275
|
let currentIndex = 0;
|
|
@@ -30153,7 +30299,7 @@ function filterWithGroupedSections(items, query) {
|
|
|
30153
30299
|
(item, index2) => createExtraItem(item, index2)
|
|
30154
30300
|
);
|
|
30155
30301
|
} else {
|
|
30156
|
-
const scoredItems =
|
|
30302
|
+
const scoredItems = filterItems({
|
|
30157
30303
|
items: selectableItems.map((item) => {
|
|
30158
30304
|
const title = item.title?.toString?.() ?? "";
|
|
30159
30305
|
const tooltipText = getNodeText(item.tooltip);
|
|
@@ -30229,7 +30375,8 @@ var ComboboxMenu = memoGeneric(
|
|
|
30229
30375
|
indented,
|
|
30230
30376
|
iconPosition = "right",
|
|
30231
30377
|
itemHeight,
|
|
30232
|
-
getRowHeightForItem
|
|
30378
|
+
getRowHeightForItem,
|
|
30379
|
+
renderItemContent
|
|
30233
30380
|
}, forwardedRef) {
|
|
30234
30381
|
return /* @__PURE__ */ React234.createElement(
|
|
30235
30382
|
ListView.Root,
|
|
@@ -30282,17 +30429,20 @@ var ComboboxMenu = memoGeneric(
|
|
|
30282
30429
|
{
|
|
30283
30430
|
size: CHECKBOX_WIDTH - CHECKBOX_RIGHT_INSET
|
|
30284
30431
|
}
|
|
30285
|
-
) : null, iconPosition === "left" && item.icon && /* @__PURE__ */ React234.createElement(React234.Fragment, null, /* @__PURE__ */ React234.createElement(MenuIcon, { icon: item.icon }), /* @__PURE__ */ React234.createElement(Spacer.Horizontal, { size: 8 })), /* @__PURE__ */ React234.createElement("div", { className: "n-flex n-flex-col n-min-w-0 n-flex-1" },
|
|
30286
|
-
"
|
|
30287
|
-
|
|
30288
|
-
|
|
30289
|
-
|
|
30290
|
-
|
|
30291
|
-
|
|
30292
|
-
|
|
30293
|
-
|
|
30294
|
-
|
|
30295
|
-
|
|
30432
|
+
) : null, iconPosition === "left" && item.icon && /* @__PURE__ */ React234.createElement(React234.Fragment, null, /* @__PURE__ */ React234.createElement(MenuIcon, { icon: item.icon }), /* @__PURE__ */ React234.createElement(Spacer.Horizontal, { size: 8 })), /* @__PURE__ */ React234.createElement("div", { className: "n-flex n-flex-col n-min-w-0 n-flex-1" }, (() => {
|
|
30433
|
+
const defaultContent = /* @__PURE__ */ React234.createElement("div", { className: "n-min-w-0 n-truncate" }, tokens.map((token, j) => /* @__PURE__ */ React234.createElement(
|
|
30434
|
+
"span",
|
|
30435
|
+
{
|
|
30436
|
+
key: `${item.value}-token-${j}`,
|
|
30437
|
+
className: cx(
|
|
30438
|
+
token.type === "match" ? "n-font-bold" : "n-font-normal",
|
|
30439
|
+
"n-whitespace-pre n-truncate"
|
|
30440
|
+
)
|
|
30441
|
+
},
|
|
30442
|
+
token.text
|
|
30443
|
+
)));
|
|
30444
|
+
return renderItemContent ? renderItemContent(item, defaultContent) : defaultContent;
|
|
30445
|
+
})(), tooltip && /* @__PURE__ */ React234.createElement(Small, { color: "textSubtle", className: "n-truncate" }, tooltip))),
|
|
30296
30446
|
(item.shortcut || item.icon && iconPosition === "right") && /* @__PURE__ */ React234.createElement("div", { className: "n-flex n-items-center n-min-w-0 n-ml-2" }, item.shortcut ? /* @__PURE__ */ React234.createElement(KeyboardShortcut, { shortcut: item.shortcut }) : item.icon && /* @__PURE__ */ React234.createElement(MenuIcon, { icon: item.icon }))
|
|
30297
30447
|
);
|
|
30298
30448
|
}
|
|
@@ -30323,6 +30473,8 @@ var Combobox = memoGeneric(
|
|
|
30323
30473
|
onFocus,
|
|
30324
30474
|
onDeleteWhenEmpty,
|
|
30325
30475
|
iconPosition = "right",
|
|
30476
|
+
renderItemContent,
|
|
30477
|
+
filterStrategy = "fuzzy",
|
|
30326
30478
|
...rest
|
|
30327
30479
|
}, forwardedRef) {
|
|
30328
30480
|
const props = useMemo69(() => {
|
|
@@ -30375,7 +30527,8 @@ var Combobox = memoGeneric(
|
|
|
30375
30527
|
() => new ComboboxState(
|
|
30376
30528
|
items,
|
|
30377
30529
|
initialValueString,
|
|
30378
|
-
props.mode === "string" && (props.allowArbitraryValues ?? false)
|
|
30530
|
+
props.mode === "string" && (props.allowArbitraryValues ?? false),
|
|
30531
|
+
filterStrategy
|
|
30379
30532
|
)
|
|
30380
30533
|
);
|
|
30381
30534
|
const state = useComboboxState(comboboxState);
|
|
@@ -30678,7 +30831,9 @@ var Combobox = memoGeneric(
|
|
|
30678
30831
|
menuItemsCount,
|
|
30679
30832
|
sectionHeaderCount,
|
|
30680
30833
|
tallMenuItemsCount,
|
|
30681
|
-
|
|
30834
|
+
// Whole rows only: a half-cut last row reads as a rendering bug
|
|
30835
|
+
// rather than a scrollable list.
|
|
30836
|
+
maxBaseRows: 10
|
|
30682
30837
|
});
|
|
30683
30838
|
const adjustedListSize = { width, height: computedHeight };
|
|
30684
30839
|
return /* @__PURE__ */ React235.createElement(
|
|
@@ -30699,6 +30854,7 @@ var Combobox = memoGeneric(
|
|
|
30699
30854
|
onHoverIndex: handleIndexChange,
|
|
30700
30855
|
listSize: adjustedListSize,
|
|
30701
30856
|
iconPosition,
|
|
30857
|
+
renderItemContent,
|
|
30702
30858
|
style: {
|
|
30703
30859
|
flex: `0 0 ${computedHeight}px`
|
|
30704
30860
|
},
|
|
@@ -32009,8 +32165,8 @@ var SegmentedControlItem = forwardRef93(function SegmentedControlItem2({
|
|
|
32009
32165
|
// checked
|
|
32010
32166
|
variant === "tabs" ? "data-[pressed]:n-text-primary" : variant === "buttons" ? "active:n-text-button-text-active active:n-bg-button-background-active data-[pressed]:n-text-button-text-active data-[pressed]:n-bg-button-background-active" : variant === "default" ? (
|
|
32011
32167
|
// default variant: only text color, background handled by sliding indicator
|
|
32012
|
-
colorScheme === "secondary" || colorScheme === "primary" ? "data-[pressed]:n-text-white" : "data-[pressed]:n-text-segmented-control-item-active-text"
|
|
32013
|
-
) : colorScheme === "secondary" ? "data-[pressed]:n-bg-secondary data-[pressed]:n-text-white" : colorScheme === "primary" ? "data-[pressed]:n-bg-primary data-[pressed]:n-text-white" : "data-[pressed]:n-bg-segmented-control-item-active-background data-[pressed]:n-text-segmented-control-item-active-text",
|
|
32168
|
+
colorScheme === "secondary" || colorScheme === "primary" ? "data-[pressed]:n-text-white" : colorScheme === "primaryTint" ? "data-[pressed]:n-text-primary" : "data-[pressed]:n-text-segmented-control-item-active-text"
|
|
32169
|
+
) : colorScheme === "secondary" ? "data-[pressed]:n-bg-secondary data-[pressed]:n-text-white" : colorScheme === "primary" ? "data-[pressed]:n-bg-primary data-[pressed]:n-text-white" : colorScheme === "primaryTint" ? "data-[pressed]:n-bg-primary-pastel data-[pressed]:n-text-primary" : "data-[pressed]:n-bg-segmented-control-item-active-background data-[pressed]:n-text-segmented-control-item-active-text",
|
|
32014
32170
|
"focus-visible:n-z-interactable",
|
|
32015
32171
|
// checked default (all colorSchemes) - hide separators near selected
|
|
32016
32172
|
variant === "default" && "data-[pressed]:after:n-hidden [&:has(+[data-pressed])]:after:n-hidden",
|
|
@@ -32218,7 +32374,7 @@ var SegmentedControl = memoGeneric(function SegmentedControl2({
|
|
|
32218
32374
|
() => ({ colorScheme, onSelect: handleSelect, itemWidth, isCompact }),
|
|
32219
32375
|
[colorScheme, handleSelect, itemWidth, isCompact]
|
|
32220
32376
|
);
|
|
32221
|
-
const indicatorBgClass = colorScheme === "secondary" ? "n-bg-secondary" : colorScheme === "primary" ? "n-bg-primary" : "n-bg-segmented-control-item-active-background";
|
|
32377
|
+
const indicatorBgClass = colorScheme === "secondary" ? "n-bg-secondary" : colorScheme === "primary" ? "n-bg-primary" : colorScheme === "primaryTint" ? "n-bg-primary-pastel" : "n-bg-segmented-control-item-active-background";
|
|
32222
32378
|
return /* @__PURE__ */ React245.createElement(SegmentedControlContext.Provider, { value: contextValue }, /* @__PURE__ */ React245.createElement(
|
|
32223
32379
|
ToggleGroup,
|
|
32224
32380
|
{
|
|
@@ -36158,6 +36314,7 @@ var InspectorContainer = memo27(
|
|
|
36158
36314
|
header,
|
|
36159
36315
|
children,
|
|
36160
36316
|
fallback,
|
|
36317
|
+
footer,
|
|
36161
36318
|
showDividers,
|
|
36162
36319
|
id,
|
|
36163
36320
|
className,
|
|
@@ -36178,7 +36335,15 @@ var InspectorContainer = memo27(
|
|
|
36178
36335
|
}
|
|
36179
36336
|
},
|
|
36180
36337
|
header,
|
|
36181
|
-
children ? /* @__PURE__ */ React261.createElement(ScrollArea, { className: "n-flex-1 n-min-h-0" }, /* @__PURE__ */ React261.createElement(
|
|
36338
|
+
children ? /* @__PURE__ */ React261.createElement(ScrollArea, { className: "n-flex-1 n-min-h-0" }, /* @__PURE__ */ React261.createElement(
|
|
36339
|
+
"div",
|
|
36340
|
+
{
|
|
36341
|
+
className: "n-flex n-flex-col n-relative",
|
|
36342
|
+
style: footer != null ? { minHeight: "100%" } : void 0
|
|
36343
|
+
},
|
|
36344
|
+
showDividers ? withSeparatorElements(children, /* @__PURE__ */ React261.createElement(Divider, null)) : children,
|
|
36345
|
+
footer != null && /* @__PURE__ */ React261.createElement(React261.Fragment, null, /* @__PURE__ */ React261.createElement("div", { className: "n-flex-1" }), footer)
|
|
36346
|
+
)) : fallback ? /* @__PURE__ */ React261.createElement("div", { className: "n-flex n-flex-col n-relative n-h-full" }, fallback) : null
|
|
36182
36347
|
);
|
|
36183
36348
|
})
|
|
36184
36349
|
);
|
|
@@ -36830,6 +36995,24 @@ function ScrollableSidebar({ children }) {
|
|
|
36830
36995
|
|
|
36831
36996
|
// src/components/Section.tsx
|
|
36832
36997
|
import React272, { memo as memo31, useMemo as useMemo82 } from "react";
|
|
36998
|
+
var SectionHeaderShell = ({
|
|
36999
|
+
className,
|
|
37000
|
+
...props
|
|
37001
|
+
}) => /* @__PURE__ */ React272.createElement("div", { className: cx(`n-flex n-items-center`, className), ...props });
|
|
37002
|
+
var TitleShell = ({
|
|
37003
|
+
className,
|
|
37004
|
+
$textStyle,
|
|
37005
|
+
...props
|
|
37006
|
+
}) => /* @__PURE__ */ React272.createElement(
|
|
37007
|
+
"div",
|
|
37008
|
+
{
|
|
37009
|
+
className: cx(
|
|
37010
|
+
`n-flex n-select-none ${$textStyle ? `${textStyles[$textStyle]} n-text-text` : "n-font-sans n-text-label n-text-text-muted n-font-semibold"} `,
|
|
37011
|
+
className
|
|
37012
|
+
),
|
|
37013
|
+
...props
|
|
37014
|
+
}
|
|
37015
|
+
);
|
|
36833
37016
|
var titleIconStyle = {
|
|
36834
37017
|
marginRight: "6px",
|
|
36835
37018
|
alignSelf: "flex-start",
|
|
@@ -36857,34 +37040,16 @@ function SectionHeader({
|
|
|
36857
37040
|
}),
|
|
36858
37041
|
[style2]
|
|
36859
37042
|
);
|
|
36860
|
-
const titleElement = title ? /* @__PURE__ */ React272.createElement(
|
|
36861
|
-
|
|
37043
|
+
const titleElement = title ? /* @__PURE__ */ React272.createElement(TitleShell, { $textStyle: titleTextStyle, className: titleClassName }, title) : null;
|
|
37044
|
+
return /* @__PURE__ */ React272.createElement(SectionHeaderShell, { style: headerStyle, className }, titleIcon && /* @__PURE__ */ React272.createElement("div", { style: titleIconStyle, className: textStyles[titleTextStyle] }, "\u200B", renderIcon(titleIcon)), titleElement && /* @__PURE__ */ React272.createElement(React272.Fragment, null, onClickTitle ? /* @__PURE__ */ React272.createElement(Button, { variant: "none", onClick: onClickTitle }, titleElement) : titleElement), headerSeparator === "space" && /* @__PURE__ */ React272.createElement(Spacer.Horizontal, null), headerSeparator === "dot" && /* @__PURE__ */ React272.createElement(
|
|
37045
|
+
Text,
|
|
36862
37046
|
{
|
|
36863
|
-
|
|
36864
|
-
|
|
37047
|
+
variant: titleTextStyle,
|
|
37048
|
+
color: "textDisabled",
|
|
37049
|
+
style: { padding: "0 4px" }
|
|
36865
37050
|
},
|
|
36866
|
-
|
|
36867
|
-
)
|
|
36868
|
-
return /* @__PURE__ */ React272.createElement(
|
|
36869
|
-
InspectorPrimitives_exports.SectionHeader,
|
|
36870
|
-
{
|
|
36871
|
-
style: headerStyle,
|
|
36872
|
-
className
|
|
36873
|
-
},
|
|
36874
|
-
titleIcon && /* @__PURE__ */ React272.createElement("div", { style: titleIconStyle, className: textStyles[titleTextStyle] }, "\u200B", renderIcon(titleIcon)),
|
|
36875
|
-
titleElement && /* @__PURE__ */ React272.createElement(React272.Fragment, null, onClickTitle ? /* @__PURE__ */ React272.createElement(Button, { variant: "none", onClick: onClickTitle }, titleElement) : titleElement),
|
|
36876
|
-
headerSeparator === "space" && /* @__PURE__ */ React272.createElement(Spacer.Horizontal, null),
|
|
36877
|
-
headerSeparator === "dot" && /* @__PURE__ */ React272.createElement(
|
|
36878
|
-
Text,
|
|
36879
|
-
{
|
|
36880
|
-
variant: titleTextStyle,
|
|
36881
|
-
color: "textDisabled",
|
|
36882
|
-
style: { padding: "0 4px" }
|
|
36883
|
-
},
|
|
36884
|
-
"\u2022"
|
|
36885
|
-
),
|
|
36886
|
-
right
|
|
36887
|
-
);
|
|
37051
|
+
"\u2022"
|
|
37052
|
+
), right);
|
|
36888
37053
|
}
|
|
36889
37054
|
var SectionInternal = ({
|
|
36890
37055
|
children,
|
|
@@ -36975,13 +37140,518 @@ import {
|
|
|
36975
37140
|
shift as shift4,
|
|
36976
37141
|
FloatingPortal as FloatingPortal3
|
|
36977
37142
|
} from "@floating-ui/react";
|
|
36978
|
-
import
|
|
37143
|
+
import React277, { memo as memo33, useCallback as useCallback51, useEffect as useEffect52, useMemo as useMemo83, useState as useState71 } from "react";
|
|
36979
37144
|
|
|
36980
37145
|
// src/components/Toolbar.tsx
|
|
36981
|
-
import
|
|
36982
|
-
|
|
36983
|
-
|
|
36984
|
-
|
|
37146
|
+
import React276, { forwardRef as forwardRef102 } from "react";
|
|
37147
|
+
|
|
37148
|
+
// src/components/ToolbarItems.tsx
|
|
37149
|
+
import React275, { useEffect as useEffect51, useState as useState70 } from "react";
|
|
37150
|
+
|
|
37151
|
+
// src/components/AppToolbar.tsx
|
|
37152
|
+
import { useKeyboardShortcuts as useKeyboardShortcuts3 } from "@noya-app/noya-keymap";
|
|
37153
|
+
import React274, {
|
|
37154
|
+
createContext as createContext53,
|
|
37155
|
+
useContext as useContext54
|
|
37156
|
+
} from "react";
|
|
37157
|
+
|
|
37158
|
+
// src/components/ToolbarDrawer.tsx
|
|
37159
|
+
import React273, { forwardRef as forwardRef101, memo as memo32 } from "react";
|
|
37160
|
+
var ToolbarDrawer = memo32(
|
|
37161
|
+
forwardRef101(function ToolbarDrawer2({ children, trigger, sideOffset = 8 }, ref) {
|
|
37162
|
+
return /* @__PURE__ */ React273.createElement("div", { className: "n-relative", ref }, /* @__PURE__ */ React273.createElement(
|
|
37163
|
+
"div",
|
|
37164
|
+
{
|
|
37165
|
+
className: "n-absolute n-bottom-full n-left-1/2 -n-translate-x-1/2 n-rounded-t-lg n-border n-border-toolbar-drawer-border n-border-b-transparent n-bg-toolbar-drawer-background -n-z-10",
|
|
37166
|
+
style: {
|
|
37167
|
+
marginBottom: `${sideOffset}px`,
|
|
37168
|
+
boxShadow: "0px -2px 12px 0px var(--n-toolbar-drawer-shadow)"
|
|
37169
|
+
}
|
|
37170
|
+
},
|
|
37171
|
+
children
|
|
37172
|
+
), trigger);
|
|
37173
|
+
})
|
|
37174
|
+
);
|
|
37175
|
+
|
|
37176
|
+
// src/components/AppToolbar.tsx
|
|
37177
|
+
var SIDE_OFFSET = 6;
|
|
37178
|
+
var ToolbarMenuContext = createContext53({});
|
|
37179
|
+
var ToolbarMenuDropdown = memoGeneric(function ToolbarMenuDropdown2({
|
|
37180
|
+
item,
|
|
37181
|
+
onSelectMenuItem,
|
|
37182
|
+
onPopoverOpenChange
|
|
37183
|
+
}) {
|
|
37184
|
+
const [open, setOpen] = React274.useState(false);
|
|
37185
|
+
const handleOpenChange = React274.useCallback(
|
|
37186
|
+
(newOpen) => {
|
|
37187
|
+
setOpen(newOpen);
|
|
37188
|
+
onPopoverOpenChange?.(newOpen);
|
|
37189
|
+
},
|
|
37190
|
+
[onPopoverOpenChange]
|
|
37191
|
+
);
|
|
37192
|
+
return /* @__PURE__ */ React274.createElement(
|
|
37193
|
+
DropdownMenu,
|
|
37194
|
+
{
|
|
37195
|
+
open,
|
|
37196
|
+
onOpenChange: handleOpenChange,
|
|
37197
|
+
items: item.items,
|
|
37198
|
+
modal: false,
|
|
37199
|
+
onSelect: (value) => {
|
|
37200
|
+
if (onSelectMenuItem && value) {
|
|
37201
|
+
onSelectMenuItem(value);
|
|
37202
|
+
}
|
|
37203
|
+
}
|
|
37204
|
+
},
|
|
37205
|
+
/* @__PURE__ */ React274.createElement(
|
|
37206
|
+
Button,
|
|
37207
|
+
{
|
|
37208
|
+
disabled: item.disabled,
|
|
37209
|
+
active: item.checked || open,
|
|
37210
|
+
icon: item.icon,
|
|
37211
|
+
iconRight: item.icon === "DotsVerticalIcon" || item.icon === "DotsHorizontalIcon" ? void 0 : "DropdownChevronIcon"
|
|
37212
|
+
},
|
|
37213
|
+
item.title
|
|
37214
|
+
)
|
|
37215
|
+
);
|
|
37216
|
+
});
|
|
37217
|
+
var ToolbarShortcut = ({
|
|
37218
|
+
shortcut,
|
|
37219
|
+
label
|
|
37220
|
+
}) => {
|
|
37221
|
+
return /* @__PURE__ */ React274.createElement("div", { className: "n-flex n-items-center" }, label, /* @__PURE__ */ React274.createElement(Spacer.Horizontal, { size: 6 }), /* @__PURE__ */ React274.createElement(KeyboardShortcut, { shortcut }));
|
|
37222
|
+
};
|
|
37223
|
+
var ToolbarMenuPopover = memoGeneric(function ToolbarMenuPopover2({
|
|
37224
|
+
item,
|
|
37225
|
+
portalContainer,
|
|
37226
|
+
onPopoverOpenChange
|
|
37227
|
+
}) {
|
|
37228
|
+
const {
|
|
37229
|
+
disabled: disabled2,
|
|
37230
|
+
icon,
|
|
37231
|
+
title,
|
|
37232
|
+
tooltip,
|
|
37233
|
+
content: itemContent,
|
|
37234
|
+
checked,
|
|
37235
|
+
popoverClassName,
|
|
37236
|
+
triggerProps: buttonProps
|
|
37237
|
+
} = item;
|
|
37238
|
+
const [open, setOpen] = React274.useState(false);
|
|
37239
|
+
const handleOpenChange = React274.useCallback(
|
|
37240
|
+
(newOpen) => {
|
|
37241
|
+
setOpen(newOpen);
|
|
37242
|
+
onPopoverOpenChange?.(newOpen);
|
|
37243
|
+
},
|
|
37244
|
+
[onPopoverOpenChange]
|
|
37245
|
+
);
|
|
37246
|
+
const { useDialogOnSmallScreen, isSmallScreen, openDialog } = useContext54(ToolbarMenuContext);
|
|
37247
|
+
const shouldUseDialog = useDialogOnSmallScreen && isSmallScreen && openDialog;
|
|
37248
|
+
const handleOpenDialog = React274.useCallback(() => {
|
|
37249
|
+
if (!openDialog) return;
|
|
37250
|
+
handleOpenChange(true);
|
|
37251
|
+
const dialogContent = typeof itemContent === "function" ? (props) => /* @__PURE__ */ React274.createElement("div", { className: "-n-m-3" }, itemContent(props)) : /* @__PURE__ */ React274.createElement("div", { className: "-n-m-3" }, itemContent);
|
|
37252
|
+
const dialog = openDialog({
|
|
37253
|
+
title,
|
|
37254
|
+
children: dialogContent
|
|
37255
|
+
});
|
|
37256
|
+
dialog.then(() => handleOpenChange(false));
|
|
37257
|
+
}, [openDialog, itemContent, title, handleOpenChange]);
|
|
37258
|
+
const trigger = /* @__PURE__ */ React274.createElement(
|
|
37259
|
+
Button,
|
|
37260
|
+
{
|
|
37261
|
+
disabled: disabled2,
|
|
37262
|
+
active: checked || open,
|
|
37263
|
+
icon,
|
|
37264
|
+
iconRight: "DropdownChevronIcon",
|
|
37265
|
+
onClick: shouldUseDialog ? handleOpenDialog : void 0,
|
|
37266
|
+
...buttonProps
|
|
37267
|
+
},
|
|
37268
|
+
title
|
|
37269
|
+
);
|
|
37270
|
+
if (shouldUseDialog) {
|
|
37271
|
+
return tooltip && !open ? /* @__PURE__ */ React274.createElement(
|
|
37272
|
+
Tooltip,
|
|
37273
|
+
{
|
|
37274
|
+
sideOffset: SIDE_OFFSET,
|
|
37275
|
+
side: "top",
|
|
37276
|
+
content: tooltip,
|
|
37277
|
+
portalContainer
|
|
37278
|
+
},
|
|
37279
|
+
trigger
|
|
37280
|
+
) : trigger;
|
|
37281
|
+
}
|
|
37282
|
+
const content = /* @__PURE__ */ React274.createElement("span", null, /* @__PURE__ */ React274.createElement(
|
|
37283
|
+
Popover,
|
|
37284
|
+
{
|
|
37285
|
+
open,
|
|
37286
|
+
onOpenChange: handleOpenChange,
|
|
37287
|
+
side: "top",
|
|
37288
|
+
showArrow: false,
|
|
37289
|
+
sideOffset: SIDE_OFFSET,
|
|
37290
|
+
portalContainer,
|
|
37291
|
+
trigger,
|
|
37292
|
+
className: popoverClassName
|
|
37293
|
+
},
|
|
37294
|
+
typeof itemContent === "function" ? itemContent({ close: () => handleOpenChange(false) }) : itemContent
|
|
37295
|
+
));
|
|
37296
|
+
return tooltip && !open ? /* @__PURE__ */ React274.createElement(
|
|
37297
|
+
Tooltip,
|
|
37298
|
+
{
|
|
37299
|
+
sideOffset: SIDE_OFFSET,
|
|
37300
|
+
side: "top",
|
|
37301
|
+
content: tooltip,
|
|
37302
|
+
portalContainer
|
|
37303
|
+
},
|
|
37304
|
+
content
|
|
37305
|
+
) : content;
|
|
37306
|
+
});
|
|
37307
|
+
var ToolbarMenuButton = memoGeneric(function ToolbarMenuButton2({
|
|
37308
|
+
item,
|
|
37309
|
+
onSelectMenuItem,
|
|
37310
|
+
as,
|
|
37311
|
+
activeValue,
|
|
37312
|
+
tooltipSide,
|
|
37313
|
+
displayFilter
|
|
37314
|
+
}) {
|
|
37315
|
+
const isActive = item.checked || activeValue === item.value;
|
|
37316
|
+
const content = /* @__PURE__ */ React274.createElement(
|
|
37317
|
+
Button,
|
|
37318
|
+
{
|
|
37319
|
+
as,
|
|
37320
|
+
disabled: item.disabled,
|
|
37321
|
+
active: isActive,
|
|
37322
|
+
icon: displayFilter === "textOnly" ? void 0 : item.icon,
|
|
37323
|
+
...as === "a" && { href: item.value },
|
|
37324
|
+
onClick: () => {
|
|
37325
|
+
if (onSelectMenuItem && item.value) {
|
|
37326
|
+
onSelectMenuItem(item.value);
|
|
37327
|
+
}
|
|
37328
|
+
}
|
|
37329
|
+
},
|
|
37330
|
+
displayFilter === "iconOnly" ? void 0 : item.title
|
|
37331
|
+
);
|
|
37332
|
+
const tooltip = item.tooltip ?? (displayFilter === "iconOnly" && item.title ? item.title : void 0);
|
|
37333
|
+
return item.drawer && isActive ? /* @__PURE__ */ React274.createElement(ToolbarDrawer, { trigger: content }, item.drawer) : tooltip ? /* @__PURE__ */ React274.createElement(Tooltip, { sideOffset: SIDE_OFFSET, content: tooltip, side: tooltipSide }, content) : content;
|
|
37334
|
+
});
|
|
37335
|
+
var ToolbarMenuItem = memoGeneric(function ToolbarMenuItem2({
|
|
37336
|
+
item,
|
|
37337
|
+
onSelectMenuItem,
|
|
37338
|
+
buttonAs,
|
|
37339
|
+
activeValue,
|
|
37340
|
+
tooltipSide,
|
|
37341
|
+
portalContainer,
|
|
37342
|
+
displayFilter,
|
|
37343
|
+
dividerOverflow: dividerOverflowProp,
|
|
37344
|
+
onPopoverOpenChange
|
|
37345
|
+
}) {
|
|
37346
|
+
const { dividerOverflow: contextDividerOverflow } = useContext54(ToolbarMenuContext);
|
|
37347
|
+
const dividerOverflow = dividerOverflowProp ?? contextDividerOverflow ?? 4;
|
|
37348
|
+
if (item.type === "sectionHeader") return null;
|
|
37349
|
+
if (item.type === "separator") {
|
|
37350
|
+
return /* @__PURE__ */ React274.createElement(DividerVertical, { overflow: dividerOverflow });
|
|
37351
|
+
}
|
|
37352
|
+
if (item.type === "popover") {
|
|
37353
|
+
return /* @__PURE__ */ React274.createElement(
|
|
37354
|
+
ToolbarMenuPopover,
|
|
37355
|
+
{
|
|
37356
|
+
item,
|
|
37357
|
+
portalContainer,
|
|
37358
|
+
onPopoverOpenChange
|
|
37359
|
+
}
|
|
37360
|
+
);
|
|
37361
|
+
}
|
|
37362
|
+
if (isSelectableMenuItem(item)) {
|
|
37363
|
+
return /* @__PURE__ */ React274.createElement(
|
|
37364
|
+
ToolbarMenuButton,
|
|
37365
|
+
{
|
|
37366
|
+
item,
|
|
37367
|
+
onSelectMenuItem,
|
|
37368
|
+
as: buttonAs,
|
|
37369
|
+
activeValue,
|
|
37370
|
+
tooltipSide,
|
|
37371
|
+
displayFilter
|
|
37372
|
+
}
|
|
37373
|
+
);
|
|
37374
|
+
}
|
|
37375
|
+
return /* @__PURE__ */ React274.createElement(
|
|
37376
|
+
ToolbarMenuDropdown,
|
|
37377
|
+
{
|
|
37378
|
+
item,
|
|
37379
|
+
onSelectMenuItem,
|
|
37380
|
+
onPopoverOpenChange
|
|
37381
|
+
}
|
|
37382
|
+
);
|
|
37383
|
+
});
|
|
37384
|
+
var ToolbarMenu = memoGeneric(function ToolbarMenu2({
|
|
37385
|
+
items,
|
|
37386
|
+
onSelectMenuItem,
|
|
37387
|
+
buttonAs,
|
|
37388
|
+
activeValue,
|
|
37389
|
+
tooltipSide,
|
|
37390
|
+
portalContainer,
|
|
37391
|
+
displayFilter = "iconAndText",
|
|
37392
|
+
dividerOverflow,
|
|
37393
|
+
onPopoverOpenChange
|
|
37394
|
+
}) {
|
|
37395
|
+
return /* @__PURE__ */ React274.createElement(React274.Fragment, null, items.map((item, i) => {
|
|
37396
|
+
return /* @__PURE__ */ React274.createElement(
|
|
37397
|
+
ToolbarMenuItem,
|
|
37398
|
+
{
|
|
37399
|
+
key: i,
|
|
37400
|
+
item,
|
|
37401
|
+
onSelectMenuItem,
|
|
37402
|
+
buttonAs,
|
|
37403
|
+
activeValue,
|
|
37404
|
+
tooltipSide,
|
|
37405
|
+
portalContainer,
|
|
37406
|
+
displayFilter,
|
|
37407
|
+
dividerOverflow,
|
|
37408
|
+
onPopoverOpenChange
|
|
37409
|
+
}
|
|
37410
|
+
);
|
|
37411
|
+
}));
|
|
37412
|
+
});
|
|
37413
|
+
function useBindKeyboardShortcutsForMenuItems(items, onSelectMenuItem) {
|
|
37414
|
+
return useKeyboardShortcuts3(
|
|
37415
|
+
React274.useMemo(
|
|
37416
|
+
() => onSelectMenuItem ? getKeyboardShortcutsForMenuItems(items, onSelectMenuItem) : {},
|
|
37417
|
+
[items, onSelectMenuItem]
|
|
37418
|
+
)
|
|
37419
|
+
);
|
|
37420
|
+
}
|
|
37421
|
+
function AppToolbar({
|
|
37422
|
+
children,
|
|
37423
|
+
logo,
|
|
37424
|
+
leftMenuItems = [],
|
|
37425
|
+
rightMenuItems = [],
|
|
37426
|
+
onSelectMenuItem,
|
|
37427
|
+
shouldBindKeyboardShortcuts = true,
|
|
37428
|
+
dividerOverflow
|
|
37429
|
+
}) {
|
|
37430
|
+
const allMenuItems = React274.useMemo(
|
|
37431
|
+
() => [...leftMenuItems, ...rightMenuItems],
|
|
37432
|
+
[leftMenuItems, rightMenuItems]
|
|
37433
|
+
);
|
|
37434
|
+
useBindKeyboardShortcutsForMenuItems(
|
|
37435
|
+
allMenuItems,
|
|
37436
|
+
shouldBindKeyboardShortcuts ? onSelectMenuItem : void 0
|
|
37437
|
+
);
|
|
37438
|
+
return /* @__PURE__ */ React274.createElement(
|
|
37439
|
+
BaseToolbar,
|
|
37440
|
+
{
|
|
37441
|
+
logo,
|
|
37442
|
+
left: leftMenuItems.length > 0 && /* @__PURE__ */ React274.createElement("div", { className: "n-flex n-gap-2" }, /* @__PURE__ */ React274.createElement(
|
|
37443
|
+
ToolbarMenu,
|
|
37444
|
+
{
|
|
37445
|
+
items: leftMenuItems,
|
|
37446
|
+
onSelectMenuItem,
|
|
37447
|
+
dividerOverflow
|
|
37448
|
+
}
|
|
37449
|
+
)),
|
|
37450
|
+
right: rightMenuItems.length > 0 && /* @__PURE__ */ React274.createElement("div", { className: "n-flex n-gap-2" }, /* @__PURE__ */ React274.createElement(
|
|
37451
|
+
ToolbarMenu,
|
|
37452
|
+
{
|
|
37453
|
+
items: rightMenuItems,
|
|
37454
|
+
onSelectMenuItem,
|
|
37455
|
+
dividerOverflow
|
|
37456
|
+
}
|
|
37457
|
+
))
|
|
37458
|
+
},
|
|
37459
|
+
children
|
|
37460
|
+
);
|
|
37461
|
+
}
|
|
37462
|
+
|
|
37463
|
+
// src/components/ToolbarItems.tsx
|
|
37464
|
+
var POPUP_OFFSET = 10;
|
|
37465
|
+
function labelForTitle(title) {
|
|
37466
|
+
return typeof title === "string" ? title : void 0;
|
|
37467
|
+
}
|
|
37468
|
+
function ToolbarItemButton({
|
|
37469
|
+
item,
|
|
37470
|
+
tooltipSide,
|
|
37471
|
+
onClick
|
|
37472
|
+
}) {
|
|
37473
|
+
const label = labelForTitle(item.title);
|
|
37474
|
+
const button = /* @__PURE__ */ React275.createElement(
|
|
37475
|
+
"button",
|
|
37476
|
+
{
|
|
37477
|
+
type: "button",
|
|
37478
|
+
"aria-label": label,
|
|
37479
|
+
"aria-pressed": item.checked ?? false,
|
|
37480
|
+
disabled: item.disabled,
|
|
37481
|
+
onClick,
|
|
37482
|
+
className: cx(
|
|
37483
|
+
"n-flex n-h-input-height n-flex-none n-cursor-default n-items-center n-justify-center n-rounded n-border-0 n-outline-none n-transition-colors focus-visible:n-ring-2 focus-visible:n-ring-primary",
|
|
37484
|
+
// Icon items are square at the design system's floating-toolbar
|
|
37485
|
+
// control size (27px, see Button variant="floating" and
|
|
37486
|
+
// INPUT_HEIGHT); text titles get auto width with the same padding
|
|
37487
|
+
// and type style as the popover text trigger.
|
|
37488
|
+
item.icon ? "n-w-input-height n-p-0" : "n-px-2 n-py-0 n-font-sans n-text-[12px] n-font-medium",
|
|
37489
|
+
item.checked ? "n-bg-primary n-text-white" : "n-bg-transparent n-text-text hover:n-bg-input-background-light",
|
|
37490
|
+
item.disabled && "n-pointer-events-none n-opacity-30"
|
|
37491
|
+
)
|
|
37492
|
+
},
|
|
37493
|
+
item.icon ? renderIcon(item.icon) : item.title
|
|
37494
|
+
);
|
|
37495
|
+
if (item.disabled) return button;
|
|
37496
|
+
return /* @__PURE__ */ React275.createElement(
|
|
37497
|
+
Tooltip,
|
|
37498
|
+
{
|
|
37499
|
+
side: tooltipSide,
|
|
37500
|
+
sideOffset: POPUP_OFFSET,
|
|
37501
|
+
content: item.tooltip ?? (item.shortcut ? /* @__PURE__ */ React275.createElement(ToolbarShortcut, { shortcut: item.shortcut, label: item.title }) : item.title)
|
|
37502
|
+
},
|
|
37503
|
+
button
|
|
37504
|
+
);
|
|
37505
|
+
}
|
|
37506
|
+
function renderGroupChevron({
|
|
37507
|
+
label,
|
|
37508
|
+
open,
|
|
37509
|
+
disabled: disabled2
|
|
37510
|
+
}) {
|
|
37511
|
+
return /* @__PURE__ */ React275.createElement(
|
|
37512
|
+
"button",
|
|
37513
|
+
{
|
|
37514
|
+
type: "button",
|
|
37515
|
+
"aria-label": label,
|
|
37516
|
+
disabled: disabled2,
|
|
37517
|
+
className: cx(
|
|
37518
|
+
"n--ml-0.5 n-flex n-h-input-height n-w-3.5 n-flex-none n-cursor-default n-items-center n-justify-center n-rounded n-border-0 n-p-0 n-outline-none n-transition-colors focus-visible:n-ring-2 focus-visible:n-ring-primary",
|
|
37519
|
+
open ? "n-bg-input-background-light n-text-text" : "n-bg-transparent n-text-text-muted hover:n-bg-input-background-light hover:n-text-text",
|
|
37520
|
+
disabled2 && "n-pointer-events-none n-opacity-30"
|
|
37521
|
+
)
|
|
37522
|
+
},
|
|
37523
|
+
renderIcon("DropdownChevronIcon")
|
|
37524
|
+
);
|
|
37525
|
+
}
|
|
37526
|
+
function ToolbarItemGroup({
|
|
37527
|
+
group,
|
|
37528
|
+
onSelect,
|
|
37529
|
+
side,
|
|
37530
|
+
tooltipSide
|
|
37531
|
+
}) {
|
|
37532
|
+
const { items } = group;
|
|
37533
|
+
const checkedItem = items.find((item) => item.checked);
|
|
37534
|
+
const [lastUsed, setLastUsed] = useState70(void 0);
|
|
37535
|
+
const checkedValue = checkedItem?.value;
|
|
37536
|
+
useEffect51(() => {
|
|
37537
|
+
if (checkedValue !== void 0) setLastUsed(checkedValue);
|
|
37538
|
+
}, [checkedValue]);
|
|
37539
|
+
const representative = checkedItem ?? items.find((item) => item.value === lastUsed) ?? items[0];
|
|
37540
|
+
if (!representative) return null;
|
|
37541
|
+
const allDisabled = items.every((item) => item.disabled);
|
|
37542
|
+
const label = labelForTitle(representative.title);
|
|
37543
|
+
const chevronLabel = `${label ?? "More"} tools`;
|
|
37544
|
+
return /* @__PURE__ */ React275.createElement("div", { className: "n-flex n-items-center" }, /* @__PURE__ */ React275.createElement(
|
|
37545
|
+
ToolbarItemButton,
|
|
37546
|
+
{
|
|
37547
|
+
item: { ...representative, checked: checkedItem !== void 0 },
|
|
37548
|
+
tooltipSide,
|
|
37549
|
+
onClick: () => {
|
|
37550
|
+
setLastUsed(representative.value);
|
|
37551
|
+
onSelect(representative.value);
|
|
37552
|
+
}
|
|
37553
|
+
}
|
|
37554
|
+
), allDisabled ? (
|
|
37555
|
+
// Not wrapped in DropdownMenu (whose trigger would re-enable the
|
|
37556
|
+
// native button) — a fully disabled group has nothing to open.
|
|
37557
|
+
renderGroupChevron({
|
|
37558
|
+
label: chevronLabel,
|
|
37559
|
+
open: false,
|
|
37560
|
+
disabled: true
|
|
37561
|
+
})
|
|
37562
|
+
) : /* @__PURE__ */ React275.createElement(
|
|
37563
|
+
DropdownMenu,
|
|
37564
|
+
{
|
|
37565
|
+
items,
|
|
37566
|
+
side,
|
|
37567
|
+
sideOffset: POPUP_OFFSET + 4,
|
|
37568
|
+
align: "start",
|
|
37569
|
+
alignOffset: -29,
|
|
37570
|
+
shouldBindKeyboardShortcuts: false,
|
|
37571
|
+
onSelect: (value) => {
|
|
37572
|
+
setLastUsed(value);
|
|
37573
|
+
onSelect(value);
|
|
37574
|
+
}
|
|
37575
|
+
},
|
|
37576
|
+
({ open }) => renderGroupChevron({
|
|
37577
|
+
label: chevronLabel,
|
|
37578
|
+
open
|
|
37579
|
+
})
|
|
37580
|
+
));
|
|
37581
|
+
}
|
|
37582
|
+
function ToolbarItemPopover({
|
|
37583
|
+
item,
|
|
37584
|
+
side
|
|
37585
|
+
}) {
|
|
37586
|
+
const [open, setOpen] = useState70(false);
|
|
37587
|
+
const label = labelForTitle(item.title);
|
|
37588
|
+
const trigger = /* @__PURE__ */ React275.createElement(
|
|
37589
|
+
"button",
|
|
37590
|
+
{
|
|
37591
|
+
type: "button",
|
|
37592
|
+
"aria-label": label,
|
|
37593
|
+
className: cx(
|
|
37594
|
+
"n-flex n-h-input-height n-flex-none n-cursor-default n-items-center n-justify-center n-rounded n-border-0 n-outline-none n-transition-colors focus-visible:n-ring-2 focus-visible:n-ring-primary",
|
|
37595
|
+
item.icon ? "n-w-input-height n-p-0" : "n-px-2 n-font-sans n-text-[12px] n-font-medium",
|
|
37596
|
+
open ? "n-bg-input-background-light n-text-text" : "n-bg-transparent n-text-text hover:n-bg-input-background-light"
|
|
37597
|
+
)
|
|
37598
|
+
},
|
|
37599
|
+
item.icon ? renderIcon(item.icon) : item.title
|
|
37600
|
+
);
|
|
37601
|
+
return /* @__PURE__ */ React275.createElement(
|
|
37602
|
+
Popover,
|
|
37603
|
+
{
|
|
37604
|
+
open,
|
|
37605
|
+
onOpenChange: setOpen,
|
|
37606
|
+
side,
|
|
37607
|
+
showArrow: false,
|
|
37608
|
+
sideOffset: POPUP_OFFSET,
|
|
37609
|
+
trigger
|
|
37610
|
+
},
|
|
37611
|
+
typeof item.content === "function" ? item.content(() => setOpen(false)) : item.content
|
|
37612
|
+
);
|
|
37613
|
+
}
|
|
37614
|
+
function ToolbarItems({
|
|
37615
|
+
items,
|
|
37616
|
+
onSelect,
|
|
37617
|
+
side = "top",
|
|
37618
|
+
tooltipSide = "top"
|
|
37619
|
+
}) {
|
|
37620
|
+
return /* @__PURE__ */ React275.createElement(React275.Fragment, null, items.map((item, index2) => {
|
|
37621
|
+
if (item.type === "separator") {
|
|
37622
|
+
return /* @__PURE__ */ React275.createElement(DividerVertical, { key: `separator-${index2}` });
|
|
37623
|
+
}
|
|
37624
|
+
if (item.type === "group") {
|
|
37625
|
+
return /* @__PURE__ */ React275.createElement(
|
|
37626
|
+
ToolbarItemGroup,
|
|
37627
|
+
{
|
|
37628
|
+
key: item.id,
|
|
37629
|
+
group: item,
|
|
37630
|
+
onSelect,
|
|
37631
|
+
side,
|
|
37632
|
+
tooltipSide
|
|
37633
|
+
}
|
|
37634
|
+
);
|
|
37635
|
+
}
|
|
37636
|
+
if (item.type === "popover") {
|
|
37637
|
+
return /* @__PURE__ */ React275.createElement(ToolbarItemPopover, { key: item.id, item, side });
|
|
37638
|
+
}
|
|
37639
|
+
return /* @__PURE__ */ React275.createElement(
|
|
37640
|
+
ToolbarItemButton,
|
|
37641
|
+
{
|
|
37642
|
+
key: item.value,
|
|
37643
|
+
item,
|
|
37644
|
+
tooltipSide,
|
|
37645
|
+
onClick: () => onSelect(item.value)
|
|
37646
|
+
}
|
|
37647
|
+
);
|
|
37648
|
+
}));
|
|
37649
|
+
}
|
|
37650
|
+
|
|
37651
|
+
// src/components/Toolbar.tsx
|
|
37652
|
+
var ToolbarRoot = forwardRef102(
|
|
37653
|
+
function Toolbar({ children, className, role = "toolbar", size: size4 = "medium", style: style2, ...props }, ref) {
|
|
37654
|
+
return /* @__PURE__ */ React276.createElement(
|
|
36985
37655
|
"div",
|
|
36986
37656
|
{
|
|
36987
37657
|
ref,
|
|
@@ -36998,6 +37668,7 @@ var Toolbar = forwardRef101(
|
|
|
36998
37668
|
);
|
|
36999
37669
|
}
|
|
37000
37670
|
);
|
|
37671
|
+
var Toolbar2 = Object.assign(ToolbarRoot, { Items: ToolbarItems });
|
|
37001
37672
|
|
|
37002
37673
|
// src/components/SelectionToolbar.tsx
|
|
37003
37674
|
function getPlacement(side, align) {
|
|
@@ -37006,7 +37677,7 @@ function getPlacement(side, align) {
|
|
|
37006
37677
|
}
|
|
37007
37678
|
return `${side}-${align}`;
|
|
37008
37679
|
}
|
|
37009
|
-
var SelectionToolbarContainer =
|
|
37680
|
+
var SelectionToolbarContainer = memo33(
|
|
37010
37681
|
function SelectionToolbarContainer2({
|
|
37011
37682
|
rect,
|
|
37012
37683
|
children,
|
|
@@ -37019,7 +37690,7 @@ var SelectionToolbarContainer = memo32(
|
|
|
37019
37690
|
transitionDuration = 0.2
|
|
37020
37691
|
}) {
|
|
37021
37692
|
const portalScopeId = usePortalScopeId();
|
|
37022
|
-
const [containerElement, setContainerElement] =
|
|
37693
|
+
const [containerElement, setContainerElement] = useState71(null);
|
|
37023
37694
|
const containerRef = useCallback51((el) => {
|
|
37024
37695
|
setContainerElement(el);
|
|
37025
37696
|
}, []);
|
|
@@ -37048,10 +37719,10 @@ var SelectionToolbarContainer = memo32(
|
|
|
37048
37719
|
placement,
|
|
37049
37720
|
middleware: avoidCollisions ? [offset4(sideOffset), flip4(), shift4({ padding: 10 })] : [offset4(sideOffset)]
|
|
37050
37721
|
});
|
|
37051
|
-
|
|
37722
|
+
useEffect52(() => {
|
|
37052
37723
|
refs.setPositionReference(virtualElement);
|
|
37053
37724
|
}, [refs, virtualElement]);
|
|
37054
|
-
return /* @__PURE__ */
|
|
37725
|
+
return /* @__PURE__ */ React277.createElement(FloatingPortal3, null, /* @__PURE__ */ React277.createElement(
|
|
37055
37726
|
"div",
|
|
37056
37727
|
{
|
|
37057
37728
|
ref: refs.setFloating,
|
|
@@ -37064,8 +37735,8 @@ var SelectionToolbarContainer = memo32(
|
|
|
37064
37735
|
},
|
|
37065
37736
|
className: "n-z-menu"
|
|
37066
37737
|
},
|
|
37067
|
-
/* @__PURE__ */
|
|
37068
|
-
|
|
37738
|
+
/* @__PURE__ */ React277.createElement(
|
|
37739
|
+
Toolbar2,
|
|
37069
37740
|
{
|
|
37070
37741
|
ref: containerRef,
|
|
37071
37742
|
size: "small",
|
|
@@ -37115,12 +37786,12 @@ __export(index_parts_exports10, {
|
|
|
37115
37786
|
});
|
|
37116
37787
|
|
|
37117
37788
|
// ../../node_modules/@base-ui/react/select/root/SelectRoot.mjs
|
|
37118
|
-
import * as
|
|
37789
|
+
import * as React285 from "react";
|
|
37119
37790
|
|
|
37120
37791
|
// ../../node_modules/@base-ui/utils/useOnFirstRender.mjs
|
|
37121
|
-
import * as
|
|
37792
|
+
import * as React278 from "react";
|
|
37122
37793
|
function useOnFirstRender(fn) {
|
|
37123
|
-
const ref =
|
|
37794
|
+
const ref = React278.useRef(true);
|
|
37124
37795
|
if (ref.current) {
|
|
37125
37796
|
ref.current = false;
|
|
37126
37797
|
fn();
|
|
@@ -37128,11 +37799,11 @@ function useOnFirstRender(fn) {
|
|
|
37128
37799
|
}
|
|
37129
37800
|
|
|
37130
37801
|
// ../../node_modules/@base-ui/react/select/root/SelectRootContext.mjs
|
|
37131
|
-
import * as
|
|
37132
|
-
var SelectRootContext = /* @__PURE__ */
|
|
37802
|
+
import * as React279 from "react";
|
|
37803
|
+
var SelectRootContext = /* @__PURE__ */ React279.createContext(null);
|
|
37133
37804
|
if (process.env.NODE_ENV !== "production") SelectRootContext.displayName = "SelectRootContext";
|
|
37134
37805
|
function useSelectRootContext() {
|
|
37135
|
-
const context =
|
|
37806
|
+
const context = React279.useContext(SelectRootContext);
|
|
37136
37807
|
if (context === null) {
|
|
37137
37808
|
throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: SelectRootContext is missing. Select parts must be placed within <Select.Root>." : formatErrorMessage_default(60));
|
|
37138
37809
|
}
|
|
@@ -37140,7 +37811,7 @@ function useSelectRootContext() {
|
|
|
37140
37811
|
}
|
|
37141
37812
|
|
|
37142
37813
|
// ../../node_modules/@base-ui/react/internals/field-root-context/FieldRootContext.mjs
|
|
37143
|
-
import * as
|
|
37814
|
+
import * as React280 from "react";
|
|
37144
37815
|
|
|
37145
37816
|
// ../../node_modules/@base-ui/react/internals/field-constants/constants.mjs
|
|
37146
37817
|
var DEFAULT_VALIDITY_STATE = {
|
|
@@ -37217,10 +37888,10 @@ var DEFAULT_FIELD_ROOT_CONTEXT = {
|
|
|
37217
37888
|
change: NOOP
|
|
37218
37889
|
}
|
|
37219
37890
|
};
|
|
37220
|
-
var FieldRootContext = /* @__PURE__ */
|
|
37891
|
+
var FieldRootContext = /* @__PURE__ */ React280.createContext(DEFAULT_FIELD_ROOT_CONTEXT);
|
|
37221
37892
|
if (process.env.NODE_ENV !== "production") FieldRootContext.displayName = "FieldRootContext";
|
|
37222
37893
|
function useFieldRootContext(optional = true) {
|
|
37223
|
-
const context =
|
|
37894
|
+
const context = React280.useContext(FieldRootContext);
|
|
37224
37895
|
if (context.setValidityData === NOOP && !optional) {
|
|
37225
37896
|
throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: FieldRootContext is missing. Field parts must be placed within <Field.Root>." : formatErrorMessage_default(28));
|
|
37226
37897
|
}
|
|
@@ -37257,11 +37928,11 @@ function useRegisterFieldControl(controlRef, id, value, getFormValueOverride, en
|
|
|
37257
37928
|
}
|
|
37258
37929
|
|
|
37259
37930
|
// ../../node_modules/@base-ui/react/internals/labelable-provider/useLabelableId.mjs
|
|
37260
|
-
import * as
|
|
37931
|
+
import * as React282 from "react";
|
|
37261
37932
|
|
|
37262
37933
|
// ../../node_modules/@base-ui/react/internals/labelable-provider/LabelableContext.mjs
|
|
37263
|
-
import * as
|
|
37264
|
-
var LabelableContext = /* @__PURE__ */
|
|
37934
|
+
import * as React281 from "react";
|
|
37935
|
+
var LabelableContext = /* @__PURE__ */ React281.createContext({
|
|
37265
37936
|
controlId: void 0,
|
|
37266
37937
|
registerControlId: NOOP,
|
|
37267
37938
|
labelId: void 0,
|
|
@@ -37272,7 +37943,7 @@ var LabelableContext = /* @__PURE__ */ React278.createContext({
|
|
|
37272
37943
|
});
|
|
37273
37944
|
if (process.env.NODE_ENV !== "production") LabelableContext.displayName = "LabelableContext";
|
|
37274
37945
|
function useLabelableContext() {
|
|
37275
|
-
return
|
|
37946
|
+
return React281.useContext(LabelableContext);
|
|
37276
37947
|
}
|
|
37277
37948
|
|
|
37278
37949
|
// ../../node_modules/@base-ui/react/internals/labelable-provider/useLabelableId.mjs
|
|
@@ -37289,8 +37960,8 @@ function useLabelableId(params = {}) {
|
|
|
37289
37960
|
const defaultId = useBaseUiId(id);
|
|
37290
37961
|
const controlIdForEffect = implicit ? controlId : void 0;
|
|
37291
37962
|
const controlSourceRef = useRefWithInit(() => Symbol());
|
|
37292
|
-
const hasRegisteredRef =
|
|
37293
|
-
const hadExplicitIdRef =
|
|
37963
|
+
const hasRegisteredRef = React282.useRef(false);
|
|
37964
|
+
const hadExplicitIdRef = React282.useRef(id != null);
|
|
37294
37965
|
const unregisterControlId = useStableCallback2(() => {
|
|
37295
37966
|
if (!hasRegisteredRef.current || registerControlId === NOOP) {
|
|
37296
37967
|
return;
|
|
@@ -37327,7 +37998,7 @@ function useLabelableId(params = {}) {
|
|
|
37327
37998
|
registerControlId(controlSourceRef.current, nextId);
|
|
37328
37999
|
return void 0;
|
|
37329
38000
|
}, [id, controlRef, controlIdForEffect, registerControlId, implicit, defaultId, controlSourceRef, unregisterControlId]);
|
|
37330
|
-
|
|
38001
|
+
React282.useEffect(() => {
|
|
37331
38002
|
return unregisterControlId;
|
|
37332
38003
|
}, [unregisterControlId]);
|
|
37333
38004
|
return controlId ?? defaultId;
|
|
@@ -37357,7 +38028,7 @@ function removeItem(selectedValues, itemValue, comparer) {
|
|
|
37357
38028
|
}
|
|
37358
38029
|
|
|
37359
38030
|
// ../../node_modules/@base-ui/react/internals/resolveValueLabel.mjs
|
|
37360
|
-
import * as
|
|
38031
|
+
import * as React283 from "react";
|
|
37361
38032
|
|
|
37362
38033
|
// ../../node_modules/@base-ui/react/internals/serializeValue.mjs
|
|
37363
38034
|
function serializeValue(value) {
|
|
@@ -37461,7 +38132,7 @@ function resolveMultipleLabels(values, items, itemToStringLabel) {
|
|
|
37461
38132
|
if (index2 > 0) {
|
|
37462
38133
|
acc.push(", ");
|
|
37463
38134
|
}
|
|
37464
|
-
acc.push(/* @__PURE__ */ _jsx45(
|
|
38135
|
+
acc.push(/* @__PURE__ */ _jsx45(React283.Fragment, {
|
|
37465
38136
|
children: resolveSelectedLabel(value, items, itemToStringLabel)
|
|
37466
38137
|
}, index2));
|
|
37467
38138
|
return acc;
|
|
@@ -37525,8 +38196,8 @@ var selectors7 = {
|
|
|
37525
38196
|
};
|
|
37526
38197
|
|
|
37527
38198
|
// ../../node_modules/@base-ui/react/internals/form-context/FormContext.mjs
|
|
37528
|
-
import * as
|
|
37529
|
-
var FormContext = /* @__PURE__ */
|
|
38199
|
+
import * as React284 from "react";
|
|
38200
|
+
var FormContext = /* @__PURE__ */ React284.createContext({
|
|
37530
38201
|
elementRef: {
|
|
37531
38202
|
current: null
|
|
37532
38203
|
},
|
|
@@ -37544,7 +38215,7 @@ var FormContext = /* @__PURE__ */ React281.createContext({
|
|
|
37544
38215
|
});
|
|
37545
38216
|
if (process.env.NODE_ENV !== "production") FormContext.displayName = "FormContext";
|
|
37546
38217
|
function useFormContext() {
|
|
37547
|
-
return
|
|
38218
|
+
return React284.useContext(FormContext);
|
|
37548
38219
|
}
|
|
37549
38220
|
|
|
37550
38221
|
// ../../node_modules/@base-ui/react/internals/areArraysEqual.mjs
|
|
@@ -37612,22 +38283,22 @@ function SelectRoot(props) {
|
|
|
37612
38283
|
name: "Select",
|
|
37613
38284
|
state: "open"
|
|
37614
38285
|
});
|
|
37615
|
-
const listRef =
|
|
37616
|
-
const labelsRef =
|
|
37617
|
-
const popupRef =
|
|
37618
|
-
const scrollHandlerRef =
|
|
37619
|
-
const scrollArrowsMountedCountRef =
|
|
37620
|
-
const valueRef =
|
|
37621
|
-
const valuesRef =
|
|
37622
|
-
const typingRef =
|
|
37623
|
-
const firstItemTextRef =
|
|
37624
|
-
const selectedItemTextRef =
|
|
37625
|
-
const selectionRef =
|
|
38286
|
+
const listRef = React285.useRef([]);
|
|
38287
|
+
const labelsRef = React285.useRef([]);
|
|
38288
|
+
const popupRef = React285.useRef(null);
|
|
38289
|
+
const scrollHandlerRef = React285.useRef(null);
|
|
38290
|
+
const scrollArrowsMountedCountRef = React285.useRef(0);
|
|
38291
|
+
const valueRef = React285.useRef(null);
|
|
38292
|
+
const valuesRef = React285.useRef([]);
|
|
38293
|
+
const typingRef = React285.useRef(false);
|
|
38294
|
+
const firstItemTextRef = React285.useRef(null);
|
|
38295
|
+
const selectedItemTextRef = React285.useRef(null);
|
|
38296
|
+
const selectionRef = React285.useRef({
|
|
37626
38297
|
allowSelectedMouseUp: false,
|
|
37627
38298
|
allowUnselectedMouseUp: false,
|
|
37628
38299
|
dragY: 0
|
|
37629
38300
|
});
|
|
37630
|
-
const alignItemWithTriggerActiveRef =
|
|
38301
|
+
const alignItemWithTriggerActiveRef = React285.useRef(false);
|
|
37631
38302
|
const {
|
|
37632
38303
|
mounted,
|
|
37633
38304
|
setMounted,
|
|
@@ -37670,13 +38341,13 @@ function SelectRoot(props) {
|
|
|
37670
38341
|
const positionerElement = useStore(store, selectors7.positionerElement);
|
|
37671
38342
|
const previousOpenMethod = usePreviousValue(openMethod);
|
|
37672
38343
|
const renderedOpenMethod = openMethod ?? previousOpenMethod;
|
|
37673
|
-
const serializedValue =
|
|
38344
|
+
const serializedValue = React285.useMemo(() => {
|
|
37674
38345
|
if (multiple) {
|
|
37675
38346
|
return "";
|
|
37676
38347
|
}
|
|
37677
38348
|
return stringifyAsValue(value, itemToStringValue);
|
|
37678
38349
|
}, [multiple, value, itemToStringValue]);
|
|
37679
|
-
const fieldStringValue =
|
|
38350
|
+
const fieldStringValue = React285.useMemo(() => {
|
|
37680
38351
|
if (multiple && Array.isArray(value)) {
|
|
37681
38352
|
return value.map((currentValue) => stringifyAsValue(currentValue, itemToStringValue));
|
|
37682
38353
|
}
|
|
@@ -37685,7 +38356,7 @@ function SelectRoot(props) {
|
|
|
37685
38356
|
const controlRef = useValueAsRef(triggerElement);
|
|
37686
38357
|
const getStringifiedValueForForm = useStableCallback2(() => fieldStringValue);
|
|
37687
38358
|
useRegisterFieldControl(controlRef, generatedId, value, getStringifiedValueForForm, !disabled2, nameProp);
|
|
37688
|
-
const initialValueRef =
|
|
38359
|
+
const initialValueRef = React285.useRef(value);
|
|
37689
38360
|
const hasSelectedValue = multiple ? Array.isArray(value) && value.length > 0 : value != null && serializedValue !== "";
|
|
37690
38361
|
useIsoLayoutEffect(() => {
|
|
37691
38362
|
setFilled(hasSelectedValue);
|
|
@@ -37754,7 +38425,7 @@ function SelectRoot(props) {
|
|
|
37754
38425
|
}
|
|
37755
38426
|
}
|
|
37756
38427
|
});
|
|
37757
|
-
|
|
38428
|
+
React285.useImperativeHandle(actionsRef, () => ({
|
|
37758
38429
|
unmount: handleUnmount
|
|
37759
38430
|
}), [handleUnmount]);
|
|
37760
38431
|
const setValue = useStableCallback2((nextValue, eventDetails) => {
|
|
@@ -37821,8 +38492,8 @@ function SelectRoot(props) {
|
|
|
37821
38492
|
typingRef.current = typing;
|
|
37822
38493
|
}
|
|
37823
38494
|
});
|
|
37824
|
-
const mergedTriggerProps =
|
|
37825
|
-
const popupProps =
|
|
38495
|
+
const mergedTriggerProps = React285.useMemo(() => mergeProps(typeahead.reference, listNavigation2.reference, dismiss.reference, click.reference, interactionTypeProps), [click.reference, typeahead.reference, listNavigation2.reference, dismiss.reference, interactionTypeProps]);
|
|
38496
|
+
const popupProps = React285.useMemo(() => mergeProps(FOCUSABLE_POPUP_PROPS, typeahead.floating, listNavigation2.floating, dismiss.floating), [typeahead.floating, listNavigation2.floating, dismiss.floating]);
|
|
37826
38497
|
const itemProps = listNavigation2.item ?? EMPTY_OBJECT;
|
|
37827
38498
|
useOnFirstRender(() => {
|
|
37828
38499
|
store.update({
|
|
@@ -37846,7 +38517,7 @@ function SelectRoot(props) {
|
|
|
37846
38517
|
isItemEqualToValue,
|
|
37847
38518
|
openMethod: renderedOpenMethod
|
|
37848
38519
|
});
|
|
37849
|
-
const contextValue =
|
|
38520
|
+
const contextValue = React285.useMemo(() => ({
|
|
37850
38521
|
store,
|
|
37851
38522
|
floatingContext,
|
|
37852
38523
|
required,
|
|
@@ -37876,7 +38547,7 @@ function SelectRoot(props) {
|
|
|
37876
38547
|
}), [store, floatingContext, required, disabled2, readOnly, multiple, highlightItemOnHover, setValue, setOpen, itemProps, validation, onOpenChangeComplete, handleScrollArrowVisibility]);
|
|
37877
38548
|
const ref = useMergedRefs(inputRef, validation.inputRef);
|
|
37878
38549
|
const hiddenInputName = multiple ? void 0 : name;
|
|
37879
|
-
const hiddenInputs =
|
|
38550
|
+
const hiddenInputs = React285.useMemo(() => {
|
|
37880
38551
|
if (!multiple || !Array.isArray(value) || !name) {
|
|
37881
38552
|
return null;
|
|
37882
38553
|
}
|
|
@@ -37947,7 +38618,7 @@ function SelectRoot(props) {
|
|
|
37947
38618
|
}
|
|
37948
38619
|
|
|
37949
38620
|
// ../../node_modules/@base-ui/react/select/label/SelectLabel.mjs
|
|
37950
|
-
import * as
|
|
38621
|
+
import * as React286 from "react";
|
|
37951
38622
|
|
|
37952
38623
|
// ../../node_modules/@base-ui/react/internals/labelable-provider/useLabel.mjs
|
|
37953
38624
|
function useLabel2(params = {}) {
|
|
@@ -38023,7 +38694,7 @@ function resolveAriaLabelledBy(fieldLabelId, localLabelId) {
|
|
|
38023
38694
|
}
|
|
38024
38695
|
|
|
38025
38696
|
// ../../node_modules/@base-ui/react/select/label/SelectLabel.mjs
|
|
38026
|
-
var SelectLabel = /* @__PURE__ */
|
|
38697
|
+
var SelectLabel = /* @__PURE__ */ React286.forwardRef(function SelectLabel2(componentProps, forwardedRef) {
|
|
38027
38698
|
const {
|
|
38028
38699
|
render,
|
|
38029
38700
|
className,
|
|
@@ -38057,7 +38728,7 @@ var SelectLabel = /* @__PURE__ */ React283.forwardRef(function SelectLabel2(comp
|
|
|
38057
38728
|
if (process.env.NODE_ENV !== "production") SelectLabel.displayName = "SelectLabel";
|
|
38058
38729
|
|
|
38059
38730
|
// ../../node_modules/@base-ui/react/select/trigger/SelectTrigger.mjs
|
|
38060
|
-
import * as
|
|
38731
|
+
import * as React287 from "react";
|
|
38061
38732
|
var SELECTED_DELAY = 400;
|
|
38062
38733
|
var stateAttributesMapping2 = {
|
|
38063
38734
|
...pressableTriggerOpenStateMapping,
|
|
@@ -38067,7 +38738,7 @@ var stateAttributesMapping2 = {
|
|
|
38067
38738
|
} : null,
|
|
38068
38739
|
value: () => null
|
|
38069
38740
|
};
|
|
38070
|
-
var SelectTrigger = /* @__PURE__ */
|
|
38741
|
+
var SelectTrigger = /* @__PURE__ */ React287.forwardRef(function SelectTrigger2(componentProps, forwardedRef) {
|
|
38071
38742
|
const {
|
|
38072
38743
|
render,
|
|
38073
38744
|
className,
|
|
@@ -38115,7 +38786,7 @@ var SelectTrigger = /* @__PURE__ */ React284.forwardRef(function SelectTrigger2(
|
|
|
38115
38786
|
id
|
|
38116
38787
|
});
|
|
38117
38788
|
const positionerRef = useValueAsRef(positionerElement);
|
|
38118
|
-
const triggerRef =
|
|
38789
|
+
const triggerRef = React287.useRef(null);
|
|
38119
38790
|
const {
|
|
38120
38791
|
getButtonProps,
|
|
38121
38792
|
buttonRef
|
|
@@ -38127,7 +38798,7 @@ var SelectTrigger = /* @__PURE__ */ React284.forwardRef(function SelectTrigger2(
|
|
|
38127
38798
|
const timeoutFocus = useTimeout();
|
|
38128
38799
|
const timeoutMouseDown = useTimeout();
|
|
38129
38800
|
const selectedDelayTimeout = useTimeout();
|
|
38130
|
-
|
|
38801
|
+
React287.useEffect(() => {
|
|
38131
38802
|
if (open) {
|
|
38132
38803
|
selectedDelayTimeout.start(SELECTED_DELAY, () => {
|
|
38133
38804
|
selectionRef.current.allowUnselectedMouseUp = true;
|
|
@@ -38220,11 +38891,11 @@ var SelectTrigger = /* @__PURE__ */ React284.forwardRef(function SelectTrigger2(
|
|
|
38220
38891
|
if (process.env.NODE_ENV !== "production") SelectTrigger.displayName = "SelectTrigger";
|
|
38221
38892
|
|
|
38222
38893
|
// ../../node_modules/@base-ui/react/select/value/SelectValue.mjs
|
|
38223
|
-
import * as
|
|
38894
|
+
import * as React288 from "react";
|
|
38224
38895
|
var stateAttributesMapping3 = {
|
|
38225
38896
|
value: () => null
|
|
38226
38897
|
};
|
|
38227
|
-
var SelectValue = /* @__PURE__ */
|
|
38898
|
+
var SelectValue = /* @__PURE__ */ React288.forwardRef(function SelectValue2(componentProps, forwardedRef) {
|
|
38228
38899
|
const {
|
|
38229
38900
|
className,
|
|
38230
38901
|
render,
|
|
@@ -38272,8 +38943,8 @@ var SelectValue = /* @__PURE__ */ React285.forwardRef(function SelectValue2(comp
|
|
|
38272
38943
|
if (process.env.NODE_ENV !== "production") SelectValue.displayName = "SelectValue";
|
|
38273
38944
|
|
|
38274
38945
|
// ../../node_modules/@base-ui/react/select/icon/SelectIcon.mjs
|
|
38275
|
-
import * as
|
|
38276
|
-
var SelectIcon = /* @__PURE__ */
|
|
38946
|
+
import * as React289 from "react";
|
|
38947
|
+
var SelectIcon = /* @__PURE__ */ React289.forwardRef(function SelectIcon2(componentProps, forwardedRef) {
|
|
38277
38948
|
const {
|
|
38278
38949
|
render,
|
|
38279
38950
|
className,
|
|
@@ -38301,9 +38972,9 @@ var SelectIcon = /* @__PURE__ */ React286.forwardRef(function SelectIcon2(compon
|
|
|
38301
38972
|
if (process.env.NODE_ENV !== "production") SelectIcon.displayName = "SelectIcon";
|
|
38302
38973
|
|
|
38303
38974
|
// ../../node_modules/@base-ui/react/select/portal/SelectPortal.mjs
|
|
38304
|
-
import * as
|
|
38975
|
+
import * as React290 from "react";
|
|
38305
38976
|
import { jsx as _jsx47 } from "react/jsx-runtime";
|
|
38306
|
-
var SelectPortal = /* @__PURE__ */
|
|
38977
|
+
var SelectPortal = /* @__PURE__ */ React290.forwardRef(function SelectPortal2(portalProps, forwardedRef) {
|
|
38307
38978
|
const {
|
|
38308
38979
|
store
|
|
38309
38980
|
} = useSelectRootContext();
|
|
@@ -38321,12 +38992,12 @@ var SelectPortal = /* @__PURE__ */ React287.forwardRef(function SelectPortal2(po
|
|
|
38321
38992
|
if (process.env.NODE_ENV !== "production") SelectPortal.displayName = "SelectPortal";
|
|
38322
38993
|
|
|
38323
38994
|
// ../../node_modules/@base-ui/react/select/backdrop/SelectBackdrop.mjs
|
|
38324
|
-
import * as
|
|
38995
|
+
import * as React291 from "react";
|
|
38325
38996
|
var stateAttributesMapping4 = {
|
|
38326
38997
|
...popupStateMapping,
|
|
38327
38998
|
...transitionStatusMapping
|
|
38328
38999
|
};
|
|
38329
|
-
var SelectBackdrop = /* @__PURE__ */
|
|
39000
|
+
var SelectBackdrop = /* @__PURE__ */ React291.forwardRef(function SelectBackdrop2(componentProps, forwardedRef) {
|
|
38330
39001
|
const {
|
|
38331
39002
|
render,
|
|
38332
39003
|
className,
|
|
@@ -38361,14 +39032,14 @@ var SelectBackdrop = /* @__PURE__ */ React288.forwardRef(function SelectBackdrop
|
|
|
38361
39032
|
if (process.env.NODE_ENV !== "production") SelectBackdrop.displayName = "SelectBackdrop";
|
|
38362
39033
|
|
|
38363
39034
|
// ../../node_modules/@base-ui/react/select/positioner/SelectPositioner.mjs
|
|
38364
|
-
import * as
|
|
39035
|
+
import * as React293 from "react";
|
|
38365
39036
|
|
|
38366
39037
|
// ../../node_modules/@base-ui/react/select/positioner/SelectPositionerContext.mjs
|
|
38367
|
-
import * as
|
|
38368
|
-
var SelectPositionerContext = /* @__PURE__ */
|
|
39038
|
+
import * as React292 from "react";
|
|
39039
|
+
var SelectPositionerContext = /* @__PURE__ */ React292.createContext(void 0);
|
|
38369
39040
|
if (process.env.NODE_ENV !== "production") SelectPositionerContext.displayName = "SelectPositionerContext";
|
|
38370
39041
|
function useSelectPositionerContext() {
|
|
38371
|
-
const context =
|
|
39042
|
+
const context = React292.useContext(SelectPositionerContext);
|
|
38372
39043
|
if (!context) {
|
|
38373
39044
|
throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: SelectPositionerContext is missing. SelectPositioner parts must be placed within <Select.Positioner>." : formatErrorMessage_default(59));
|
|
38374
39045
|
}
|
|
@@ -38393,7 +39064,7 @@ import { jsx as _jsx48, jsxs as _jsxs19 } from "react/jsx-runtime";
|
|
|
38393
39064
|
var FIXED = {
|
|
38394
39065
|
position: "fixed"
|
|
38395
39066
|
};
|
|
38396
|
-
var SelectPositioner = /* @__PURE__ */
|
|
39067
|
+
var SelectPositioner = /* @__PURE__ */ React293.forwardRef(function SelectPositioner2(componentProps, forwardedRef) {
|
|
38397
39068
|
const {
|
|
38398
39069
|
anchor,
|
|
38399
39070
|
className,
|
|
@@ -38436,14 +39107,14 @@ var SelectPositioner = /* @__PURE__ */ React290.forwardRef(function SelectPositi
|
|
|
38436
39107
|
const triggerElement = useStore(store, selectors7.triggerElement);
|
|
38437
39108
|
const isItemEqualToValue = useStore(store, selectors7.isItemEqualToValue);
|
|
38438
39109
|
const transitionStatus = useStore(store, selectors7.transitionStatus);
|
|
38439
|
-
const scrollUpArrowRef =
|
|
38440
|
-
const scrollDownArrowRef =
|
|
38441
|
-
const [controlledAlignItemWithTrigger, setControlledAlignItemWithTrigger] =
|
|
39110
|
+
const scrollUpArrowRef = React293.useRef(null);
|
|
39111
|
+
const scrollDownArrowRef = React293.useRef(null);
|
|
39112
|
+
const [controlledAlignItemWithTrigger, setControlledAlignItemWithTrigger] = React293.useState(alignItemWithTrigger);
|
|
38442
39113
|
const alignItemWithTriggerActive = mounted && controlledAlignItemWithTrigger && openMethod !== "touch";
|
|
38443
39114
|
if (!mounted && controlledAlignItemWithTrigger !== alignItemWithTrigger) {
|
|
38444
39115
|
setControlledAlignItemWithTrigger(alignItemWithTrigger);
|
|
38445
39116
|
}
|
|
38446
|
-
|
|
39117
|
+
React293.useImperativeHandle(alignItemWithTriggerActiveRef, () => alignItemWithTriggerActive);
|
|
38447
39118
|
useAnchoredPopupScrollLock((alignItemWithTriggerActive || modal) && open, openMethod === "touch", positionerElement, triggerElement);
|
|
38448
39119
|
const positioning = useAnchorPositioning({
|
|
38449
39120
|
anchor,
|
|
@@ -38482,7 +39153,7 @@ var SelectPositioner = /* @__PURE__ */ React290.forwardRef(function SelectPositi
|
|
|
38482
39153
|
hidden: !mounted,
|
|
38483
39154
|
inert: !open
|
|
38484
39155
|
});
|
|
38485
|
-
const prevMapSizeRef =
|
|
39156
|
+
const prevMapSizeRef = React293.useRef(0);
|
|
38486
39157
|
const onMapChange = useStableCallback2((map) => {
|
|
38487
39158
|
if (valuesRef.current.length === 0) {
|
|
38488
39159
|
return;
|
|
@@ -38528,7 +39199,7 @@ var SelectPositioner = /* @__PURE__ */ React290.forwardRef(function SelectPositi
|
|
|
38528
39199
|
clearStyles(popupRef.current, stylesToClear);
|
|
38529
39200
|
}
|
|
38530
39201
|
});
|
|
38531
|
-
const contextValue =
|
|
39202
|
+
const contextValue = React293.useMemo(() => ({
|
|
38532
39203
|
...positioning,
|
|
38533
39204
|
side: renderedSide,
|
|
38534
39205
|
alignItemWithTriggerActive,
|
|
@@ -38552,13 +39223,13 @@ var SelectPositioner = /* @__PURE__ */ React290.forwardRef(function SelectPositi
|
|
|
38552
39223
|
if (process.env.NODE_ENV !== "production") SelectPositioner.displayName = "SelectPositioner";
|
|
38553
39224
|
|
|
38554
39225
|
// ../../node_modules/@base-ui/react/select/popup/SelectPopup.mjs
|
|
38555
|
-
import * as
|
|
39226
|
+
import * as React294 from "react";
|
|
38556
39227
|
import { jsx as _jsx49, jsxs as _jsxs20 } from "react/jsx-runtime";
|
|
38557
39228
|
var stateAttributesMapping5 = {
|
|
38558
39229
|
...popupStateMapping,
|
|
38559
39230
|
...transitionStatusMapping
|
|
38560
39231
|
};
|
|
38561
|
-
var SelectPopup = /* @__PURE__ */
|
|
39232
|
+
var SelectPopup = /* @__PURE__ */ React294.forwardRef(function SelectPopup2(componentProps, forwardedRef) {
|
|
38562
39233
|
const {
|
|
38563
39234
|
render,
|
|
38564
39235
|
className,
|
|
@@ -38603,9 +39274,9 @@ var SelectPopup = /* @__PURE__ */ React291.forwardRef(function SelectPopup2(comp
|
|
|
38603
39274
|
const triggerElement = useStore(store, selectors7.triggerElement);
|
|
38604
39275
|
const positionerElement = useStore(store, selectors7.positionerElement);
|
|
38605
39276
|
const listElement = useStore(store, selectors7.listElement);
|
|
38606
|
-
const reachedMaxHeightRef =
|
|
38607
|
-
const initialPlacedRef =
|
|
38608
|
-
const originalPositionerStylesRef =
|
|
39277
|
+
const reachedMaxHeightRef = React294.useRef(false);
|
|
39278
|
+
const initialPlacedRef = React294.useRef(false);
|
|
39279
|
+
const originalPositionerStylesRef = React294.useRef({});
|
|
38609
39280
|
const scrollArrowFrame = useAnimationFrame();
|
|
38610
39281
|
const handleScroll = useStableCallback2((scroller) => {
|
|
38611
39282
|
if (!positionerElement || !popupRef.current || !initialPlacedRef.current) {
|
|
@@ -38667,7 +39338,7 @@ var SelectPopup = /* @__PURE__ */ React291.forwardRef(function SelectPopup2(comp
|
|
|
38667
39338
|
}
|
|
38668
39339
|
handleScrollArrowVisibility(scroller);
|
|
38669
39340
|
});
|
|
38670
|
-
|
|
39341
|
+
React294.useImperativeHandle(scrollHandlerRef, () => handleScroll, [handleScroll]);
|
|
38671
39342
|
useOpenChangeComplete({
|
|
38672
39343
|
open,
|
|
38673
39344
|
ref: popupRef,
|
|
@@ -38809,7 +39480,7 @@ var SelectPopup = /* @__PURE__ */ React291.forwardRef(function SelectPopup2(comp
|
|
|
38809
39480
|
restoreTransformStyles();
|
|
38810
39481
|
}
|
|
38811
39482
|
}, [store, open, positionerElement, triggerElement, valueRef, firstItemTextRef, selectedItemTextRef, popupRef, handleScrollArrowVisibility, alignItemWithTriggerActive, setControlledAlignItemWithTrigger, scrollArrowFrame, listElement, listRef, highlightItemOnHover, direction, isPositioned]);
|
|
38812
|
-
|
|
39483
|
+
React294.useEffect(() => {
|
|
38813
39484
|
if (!alignItemWithTriggerActive || !positionerElement || !open) {
|
|
38814
39485
|
return void 0;
|
|
38815
39486
|
}
|
|
@@ -38852,7 +39523,7 @@ var SelectPopup = /* @__PURE__ */ React291.forwardRef(function SelectPopup2(comp
|
|
|
38852
39523
|
stateAttributesMapping: stateAttributesMapping5,
|
|
38853
39524
|
props: [popupProps, defaultProps, getDisabledMountTransitionStyles(transitionStatus), elementProps]
|
|
38854
39525
|
});
|
|
38855
|
-
return /* @__PURE__ */ _jsxs20(
|
|
39526
|
+
return /* @__PURE__ */ _jsxs20(React294.Fragment, {
|
|
38856
39527
|
children: [!disableStyleElements && styleDisableScrollbar.getElement(nonce), /* @__PURE__ */ _jsx49(FloatingFocusManager, {
|
|
38857
39528
|
context: floatingRootContext,
|
|
38858
39529
|
modal: false,
|
|
@@ -38909,8 +39580,8 @@ function unsetTransformStyles(popupElement) {
|
|
|
38909
39580
|
}
|
|
38910
39581
|
|
|
38911
39582
|
// ../../node_modules/@base-ui/react/select/list/SelectList.mjs
|
|
38912
|
-
import * as
|
|
38913
|
-
var SelectList = /* @__PURE__ */
|
|
39583
|
+
import * as React295 from "react";
|
|
39584
|
+
var SelectList = /* @__PURE__ */ React295.forwardRef(function SelectList2(componentProps, forwardedRef) {
|
|
38914
39585
|
const {
|
|
38915
39586
|
render,
|
|
38916
39587
|
className,
|
|
@@ -38949,14 +39620,14 @@ var SelectList = /* @__PURE__ */ React292.forwardRef(function SelectList2(compon
|
|
|
38949
39620
|
if (process.env.NODE_ENV !== "production") SelectList.displayName = "SelectList";
|
|
38950
39621
|
|
|
38951
39622
|
// ../../node_modules/@base-ui/react/select/item/SelectItem.mjs
|
|
38952
|
-
import * as
|
|
39623
|
+
import * as React297 from "react";
|
|
38953
39624
|
|
|
38954
39625
|
// ../../node_modules/@base-ui/react/select/item/SelectItemContext.mjs
|
|
38955
|
-
import * as
|
|
38956
|
-
var SelectItemContext = /* @__PURE__ */
|
|
39626
|
+
import * as React296 from "react";
|
|
39627
|
+
var SelectItemContext = /* @__PURE__ */ React296.createContext(void 0);
|
|
38957
39628
|
if (process.env.NODE_ENV !== "production") SelectItemContext.displayName = "SelectItemContext";
|
|
38958
39629
|
function useSelectItemContext() {
|
|
38959
|
-
const context =
|
|
39630
|
+
const context = React296.useContext(SelectItemContext);
|
|
38960
39631
|
if (!context) {
|
|
38961
39632
|
throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: SelectItemContext is missing. SelectItem parts must be placed within <Select.Item>." : formatErrorMessage_default(57));
|
|
38962
39633
|
}
|
|
@@ -38965,7 +39636,7 @@ function useSelectItemContext() {
|
|
|
38965
39636
|
|
|
38966
39637
|
// ../../node_modules/@base-ui/react/select/item/SelectItem.mjs
|
|
38967
39638
|
import { jsx as _jsx50 } from "react/jsx-runtime";
|
|
38968
|
-
var SelectItem = /* @__PURE__ */
|
|
39639
|
+
var SelectItem = /* @__PURE__ */ React297.memo(/* @__PURE__ */ React297.forwardRef(function SelectItem2(componentProps, forwardedRef) {
|
|
38969
39640
|
const {
|
|
38970
39641
|
render,
|
|
38971
39642
|
className,
|
|
@@ -38976,7 +39647,7 @@ var SelectItem = /* @__PURE__ */ React294.memo(/* @__PURE__ */ React294.forwardR
|
|
|
38976
39647
|
nativeButton = false,
|
|
38977
39648
|
...elementProps
|
|
38978
39649
|
} = componentProps;
|
|
38979
|
-
const textRef =
|
|
39650
|
+
const textRef = React297.useRef(null);
|
|
38980
39651
|
const listItem = useCompositeListItem({
|
|
38981
39652
|
guess: true,
|
|
38982
39653
|
label,
|
|
@@ -39002,7 +39673,7 @@ var SelectItem = /* @__PURE__ */ React294.memo(/* @__PURE__ */ React294.forwardR
|
|
|
39002
39673
|
const selectedByFocus = useStore(store, selectors7.isSelectedByFocus, listItem.index);
|
|
39003
39674
|
const isItemEqualToValue = useStore(store, selectors7.isItemEqualToValue);
|
|
39004
39675
|
const index2 = listItem.index;
|
|
39005
|
-
const itemRef =
|
|
39676
|
+
const itemRef = React297.useRef(null);
|
|
39006
39677
|
useIsoLayoutEffect(() => {
|
|
39007
39678
|
const values = valuesRef.current;
|
|
39008
39679
|
values[index2] = itemValue;
|
|
@@ -39023,8 +39694,8 @@ var SelectItem = /* @__PURE__ */ React294.memo(/* @__PURE__ */ React294.forwardR
|
|
|
39023
39694
|
}
|
|
39024
39695
|
}
|
|
39025
39696
|
}, [index2, multiple, isItemEqualToValue, store, itemValue, selectedItemTextRef]);
|
|
39026
|
-
const pointerTypeRef =
|
|
39027
|
-
const allowMouseSelectionRef =
|
|
39697
|
+
const pointerTypeRef = React297.useRef("mouse");
|
|
39698
|
+
const allowMouseSelectionRef = React297.useRef(false);
|
|
39028
39699
|
const {
|
|
39029
39700
|
getButtonProps,
|
|
39030
39701
|
buttonRef
|
|
@@ -39120,7 +39791,7 @@ var SelectItem = /* @__PURE__ */ React294.memo(/* @__PURE__ */ React294.forwardR
|
|
|
39120
39791
|
state,
|
|
39121
39792
|
props: [itemProps, defaultProps, elementProps, getButtonProps]
|
|
39122
39793
|
});
|
|
39123
|
-
const contextValue =
|
|
39794
|
+
const contextValue = React297.useMemo(() => ({
|
|
39124
39795
|
selected,
|
|
39125
39796
|
index: index2,
|
|
39126
39797
|
textRef,
|
|
@@ -39134,9 +39805,9 @@ var SelectItem = /* @__PURE__ */ React294.memo(/* @__PURE__ */ React294.forwardR
|
|
|
39134
39805
|
if (process.env.NODE_ENV !== "production") SelectItem.displayName = "SelectItem";
|
|
39135
39806
|
|
|
39136
39807
|
// ../../node_modules/@base-ui/react/select/item-indicator/SelectItemIndicator.mjs
|
|
39137
|
-
import * as
|
|
39808
|
+
import * as React298 from "react";
|
|
39138
39809
|
import { jsx as _jsx51 } from "react/jsx-runtime";
|
|
39139
|
-
var SelectItemIndicator = /* @__PURE__ */
|
|
39810
|
+
var SelectItemIndicator = /* @__PURE__ */ React298.forwardRef(function SelectItemIndicator2(componentProps, forwardedRef) {
|
|
39140
39811
|
const {
|
|
39141
39812
|
selected
|
|
39142
39813
|
} = useSelectItemContext();
|
|
@@ -39150,7 +39821,7 @@ var SelectItemIndicator = /* @__PURE__ */ React295.forwardRef(function SelectIte
|
|
|
39150
39821
|
});
|
|
39151
39822
|
});
|
|
39152
39823
|
if (process.env.NODE_ENV !== "production") SelectItemIndicator.displayName = "SelectItemIndicator";
|
|
39153
|
-
var Inner = /* @__PURE__ */
|
|
39824
|
+
var Inner = /* @__PURE__ */ React298.memo(/* @__PURE__ */ React298.forwardRef((componentProps, forwardedRef) => {
|
|
39154
39825
|
const {
|
|
39155
39826
|
render,
|
|
39156
39827
|
className,
|
|
@@ -39161,7 +39832,7 @@ var Inner = /* @__PURE__ */ React295.memo(/* @__PURE__ */ React295.forwardRef((c
|
|
|
39161
39832
|
const {
|
|
39162
39833
|
selected
|
|
39163
39834
|
} = useSelectItemContext();
|
|
39164
|
-
const indicatorRef =
|
|
39835
|
+
const indicatorRef = React298.useRef(null);
|
|
39165
39836
|
const {
|
|
39166
39837
|
transitionStatus,
|
|
39167
39838
|
setMounted
|
|
@@ -39193,8 +39864,8 @@ var Inner = /* @__PURE__ */ React295.memo(/* @__PURE__ */ React295.forwardRef((c
|
|
|
39193
39864
|
if (process.env.NODE_ENV !== "production") Inner.displayName = "Inner";
|
|
39194
39865
|
|
|
39195
39866
|
// ../../node_modules/@base-ui/react/select/item-text/SelectItemText.mjs
|
|
39196
|
-
import * as
|
|
39197
|
-
var SelectItemText = /* @__PURE__ */
|
|
39867
|
+
import * as React299 from "react";
|
|
39868
|
+
var SelectItemText = /* @__PURE__ */ React299.memo(/* @__PURE__ */ React299.forwardRef(function SelectItemText2(componentProps, forwardedRef) {
|
|
39198
39869
|
const {
|
|
39199
39870
|
index: index2,
|
|
39200
39871
|
textRef,
|
|
@@ -39210,7 +39881,7 @@ var SelectItemText = /* @__PURE__ */ React296.memo(/* @__PURE__ */ React296.forw
|
|
|
39210
39881
|
style: style2,
|
|
39211
39882
|
...elementProps
|
|
39212
39883
|
} = componentProps;
|
|
39213
|
-
const localRef =
|
|
39884
|
+
const localRef = React299.useCallback((node) => {
|
|
39214
39885
|
if (!node) {
|
|
39215
39886
|
return;
|
|
39216
39887
|
}
|
|
@@ -39230,8 +39901,8 @@ var SelectItemText = /* @__PURE__ */ React296.memo(/* @__PURE__ */ React296.forw
|
|
|
39230
39901
|
if (process.env.NODE_ENV !== "production") SelectItemText.displayName = "SelectItemText";
|
|
39231
39902
|
|
|
39232
39903
|
// ../../node_modules/@base-ui/react/select/arrow/SelectArrow.mjs
|
|
39233
|
-
import * as
|
|
39234
|
-
var SelectArrow = /* @__PURE__ */
|
|
39904
|
+
import * as React300 from "react";
|
|
39905
|
+
var SelectArrow = /* @__PURE__ */ React300.forwardRef(function SelectArrow2(componentProps, forwardedRef) {
|
|
39235
39906
|
const {
|
|
39236
39907
|
render,
|
|
39237
39908
|
className,
|
|
@@ -39273,11 +39944,11 @@ var SelectArrow = /* @__PURE__ */ React297.forwardRef(function SelectArrow2(comp
|
|
|
39273
39944
|
if (process.env.NODE_ENV !== "production") SelectArrow.displayName = "SelectArrow";
|
|
39274
39945
|
|
|
39275
39946
|
// ../../node_modules/@base-ui/react/select/scroll-down-arrow/SelectScrollDownArrow.mjs
|
|
39276
|
-
import * as
|
|
39947
|
+
import * as React302 from "react";
|
|
39277
39948
|
|
|
39278
39949
|
// ../../node_modules/@base-ui/react/select/scroll-arrow/SelectScrollArrow.mjs
|
|
39279
|
-
import * as
|
|
39280
|
-
var SelectScrollArrow = /* @__PURE__ */
|
|
39950
|
+
import * as React301 from "react";
|
|
39951
|
+
var SelectScrollArrow = /* @__PURE__ */ React301.forwardRef(function SelectScrollArrow2(componentProps, forwardedRef) {
|
|
39281
39952
|
const {
|
|
39282
39953
|
render,
|
|
39283
39954
|
className,
|
|
@@ -39420,7 +40091,7 @@ function getTargetScrollTop(items, isUp, scrollTop, clientHeight, scrollArrowHei
|
|
|
39420
40091
|
|
|
39421
40092
|
// ../../node_modules/@base-ui/react/select/scroll-down-arrow/SelectScrollDownArrow.mjs
|
|
39422
40093
|
import { jsx as _jsx52 } from "react/jsx-runtime";
|
|
39423
|
-
var SelectScrollDownArrow = /* @__PURE__ */
|
|
40094
|
+
var SelectScrollDownArrow = /* @__PURE__ */ React302.forwardRef(function SelectScrollDownArrow2(props, forwardedRef) {
|
|
39424
40095
|
return /* @__PURE__ */ _jsx52(SelectScrollArrow, {
|
|
39425
40096
|
...props,
|
|
39426
40097
|
ref: forwardedRef,
|
|
@@ -39430,9 +40101,9 @@ var SelectScrollDownArrow = /* @__PURE__ */ React299.forwardRef(function SelectS
|
|
|
39430
40101
|
if (process.env.NODE_ENV !== "production") SelectScrollDownArrow.displayName = "SelectScrollDownArrow";
|
|
39431
40102
|
|
|
39432
40103
|
// ../../node_modules/@base-ui/react/select/scroll-up-arrow/SelectScrollUpArrow.mjs
|
|
39433
|
-
import * as
|
|
40104
|
+
import * as React303 from "react";
|
|
39434
40105
|
import { jsx as _jsx53 } from "react/jsx-runtime";
|
|
39435
|
-
var SelectScrollUpArrow = /* @__PURE__ */
|
|
40106
|
+
var SelectScrollUpArrow = /* @__PURE__ */ React303.forwardRef(function SelectScrollUpArrow2(props, forwardedRef) {
|
|
39436
40107
|
return /* @__PURE__ */ _jsx53(SelectScrollArrow, {
|
|
39437
40108
|
...props,
|
|
39438
40109
|
ref: forwardedRef,
|
|
@@ -39442,14 +40113,14 @@ var SelectScrollUpArrow = /* @__PURE__ */ React300.forwardRef(function SelectScr
|
|
|
39442
40113
|
if (process.env.NODE_ENV !== "production") SelectScrollUpArrow.displayName = "SelectScrollUpArrow";
|
|
39443
40114
|
|
|
39444
40115
|
// ../../node_modules/@base-ui/react/select/group/SelectGroup.mjs
|
|
39445
|
-
import * as
|
|
40116
|
+
import * as React305 from "react";
|
|
39446
40117
|
|
|
39447
40118
|
// ../../node_modules/@base-ui/react/select/group/SelectGroupContext.mjs
|
|
39448
|
-
import * as
|
|
39449
|
-
var SelectGroupContext = /* @__PURE__ */
|
|
40119
|
+
import * as React304 from "react";
|
|
40120
|
+
var SelectGroupContext = /* @__PURE__ */ React304.createContext(void 0);
|
|
39450
40121
|
if (process.env.NODE_ENV !== "production") SelectGroupContext.displayName = "SelectGroupContext";
|
|
39451
40122
|
function useSelectGroupContext() {
|
|
39452
|
-
const context =
|
|
40123
|
+
const context = React304.useContext(SelectGroupContext);
|
|
39453
40124
|
if (context === void 0) {
|
|
39454
40125
|
throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: SelectGroupContext is missing. SelectGroup parts must be placed within <Select.Group>." : formatErrorMessage_default(56));
|
|
39455
40126
|
}
|
|
@@ -39458,15 +40129,15 @@ function useSelectGroupContext() {
|
|
|
39458
40129
|
|
|
39459
40130
|
// ../../node_modules/@base-ui/react/select/group/SelectGroup.mjs
|
|
39460
40131
|
import { jsx as _jsx54 } from "react/jsx-runtime";
|
|
39461
|
-
var SelectGroup = /* @__PURE__ */
|
|
40132
|
+
var SelectGroup = /* @__PURE__ */ React305.forwardRef(function SelectGroup2(componentProps, forwardedRef) {
|
|
39462
40133
|
const {
|
|
39463
40134
|
render,
|
|
39464
40135
|
className,
|
|
39465
40136
|
style: style2,
|
|
39466
40137
|
...elementProps
|
|
39467
40138
|
} = componentProps;
|
|
39468
|
-
const [labelId, setLabelId] =
|
|
39469
|
-
const contextValue =
|
|
40139
|
+
const [labelId, setLabelId] = React305.useState();
|
|
40140
|
+
const contextValue = React305.useMemo(() => ({
|
|
39470
40141
|
labelId,
|
|
39471
40142
|
setLabelId
|
|
39472
40143
|
}), [labelId, setLabelId]);
|
|
@@ -39485,8 +40156,8 @@ var SelectGroup = /* @__PURE__ */ React302.forwardRef(function SelectGroup2(comp
|
|
|
39485
40156
|
if (process.env.NODE_ENV !== "production") SelectGroup.displayName = "SelectGroup";
|
|
39486
40157
|
|
|
39487
40158
|
// ../../node_modules/@base-ui/react/select/group-label/SelectGroupLabel.mjs
|
|
39488
|
-
import * as
|
|
39489
|
-
var SelectGroupLabel = /* @__PURE__ */
|
|
40159
|
+
import * as React306 from "react";
|
|
40160
|
+
var SelectGroupLabel = /* @__PURE__ */ React306.forwardRef(function SelectGroupLabel2(componentProps, forwardedRef) {
|
|
39490
40161
|
const {
|
|
39491
40162
|
render,
|
|
39492
40163
|
className,
|
|
@@ -39515,8 +40186,8 @@ var SelectGroupLabel = /* @__PURE__ */ React303.forwardRef(function SelectGroupL
|
|
|
39515
40186
|
if (process.env.NODE_ENV !== "production") SelectGroupLabel.displayName = "SelectGroupLabel";
|
|
39516
40187
|
|
|
39517
40188
|
// ../../node_modules/@base-ui/react/utils/listbox-separator/ListboxSeparator.mjs
|
|
39518
|
-
import * as
|
|
39519
|
-
var ListboxSeparator = /* @__PURE__ */
|
|
40189
|
+
import * as React307 from "react";
|
|
40190
|
+
var ListboxSeparator = /* @__PURE__ */ React307.forwardRef(function ListboxSeparator2(componentProps, forwardedRef) {
|
|
39520
40191
|
const {
|
|
39521
40192
|
className,
|
|
39522
40193
|
render,
|
|
@@ -39541,10 +40212,10 @@ if (process.env.NODE_ENV !== "production") ListboxSeparator.displayName = "Listb
|
|
|
39541
40212
|
var SelectSeparator = ListboxSeparator;
|
|
39542
40213
|
|
|
39543
40214
|
// src/components/SelectMenu.tsx
|
|
39544
|
-
import
|
|
40215
|
+
import React308, {
|
|
39545
40216
|
useCallback as useCallback53,
|
|
39546
40217
|
useMemo as useMemo88,
|
|
39547
|
-
useState as
|
|
40218
|
+
useState as useState74
|
|
39548
40219
|
} from "react";
|
|
39549
40220
|
var readOnlyStyle = {
|
|
39550
40221
|
justifyContent: "flex-start",
|
|
@@ -39568,29 +40239,29 @@ function SelectItemContent({
|
|
|
39568
40239
|
indented,
|
|
39569
40240
|
children
|
|
39570
40241
|
}) {
|
|
39571
|
-
return /* @__PURE__ */
|
|
40242
|
+
return /* @__PURE__ */ React308.createElement(React308.Fragment, null, indented && /* @__PURE__ */ React308.createElement(Spacer.Horizontal, { size: CHECKBOX_INDENT_WIDTH }), checked ? /* @__PURE__ */ React308.createElement(
|
|
39572
40243
|
"span",
|
|
39573
40244
|
{
|
|
39574
40245
|
className: "n-flex n-items-center n-relative -n-left-2.5",
|
|
39575
40246
|
style: { marginRight: -CHECKBOX_RIGHT_INSET }
|
|
39576
40247
|
},
|
|
39577
|
-
/* @__PURE__ */
|
|
39578
|
-
) : indented ? /* @__PURE__ */
|
|
40248
|
+
/* @__PURE__ */ React308.createElement(CheckIcon5, null)
|
|
40249
|
+
) : indented ? /* @__PURE__ */ React308.createElement(Spacer.Horizontal, { size: CHECKBOX_WIDTH - CHECKBOX_RIGHT_INSET }) : null, icon && (typeof icon === "string" ? /* @__PURE__ */ React308.createElement(
|
|
39579
40250
|
Icon,
|
|
39580
40251
|
{
|
|
39581
40252
|
name: icon,
|
|
39582
40253
|
className: "n-mr-2 n-w-4 n-h-4 n-flex-shrink-0"
|
|
39583
40254
|
}
|
|
39584
|
-
) : /* @__PURE__ */
|
|
40255
|
+
) : /* @__PURE__ */ React308.createElement("span", { className: "n-mr-2 n-w-4 n-h-4 n-flex-shrink-0 n-flex n-items-center n-justify-center" }, icon)), /* @__PURE__ */ React308.createElement("div", { className: "n-flex n-items-center n-flex-1" }, children));
|
|
39585
40256
|
}
|
|
39586
40257
|
function SelectMenuItems({
|
|
39587
40258
|
items,
|
|
39588
40259
|
hasCheckedItem
|
|
39589
40260
|
}) {
|
|
39590
|
-
return /* @__PURE__ */
|
|
40261
|
+
return /* @__PURE__ */ React308.createElement(React308.Fragment, null, items.map((item, index2) => {
|
|
39591
40262
|
switch (item.type) {
|
|
39592
40263
|
case "separator":
|
|
39593
|
-
return /* @__PURE__ */
|
|
40264
|
+
return /* @__PURE__ */ React308.createElement(
|
|
39594
40265
|
index_parts_exports10.Separator,
|
|
39595
40266
|
{
|
|
39596
40267
|
key: index2,
|
|
@@ -39598,7 +40269,7 @@ function SelectMenuItems({
|
|
|
39598
40269
|
}
|
|
39599
40270
|
);
|
|
39600
40271
|
case "sectionHeader":
|
|
39601
|
-
return /* @__PURE__ */
|
|
40272
|
+
return /* @__PURE__ */ React308.createElement(
|
|
39602
40273
|
SectionHeaderMenuItem,
|
|
39603
40274
|
{
|
|
39604
40275
|
isFirst: index2 === 0,
|
|
@@ -39611,21 +40282,21 @@ function SelectMenuItems({
|
|
|
39611
40282
|
case "submenu":
|
|
39612
40283
|
return null;
|
|
39613
40284
|
default:
|
|
39614
|
-
return /* @__PURE__ */
|
|
40285
|
+
return /* @__PURE__ */ React308.createElement("div", { key: item.value, className: "n-px-1" }, /* @__PURE__ */ React308.createElement(
|
|
39615
40286
|
index_parts_exports10.Item,
|
|
39616
40287
|
{
|
|
39617
40288
|
value: item.value,
|
|
39618
40289
|
disabled: item.disabled,
|
|
39619
40290
|
className: itemStyle3
|
|
39620
40291
|
},
|
|
39621
|
-
/* @__PURE__ */
|
|
40292
|
+
/* @__PURE__ */ React308.createElement(
|
|
39622
40293
|
SelectItemContent,
|
|
39623
40294
|
{
|
|
39624
40295
|
icon: item.icon,
|
|
39625
40296
|
checked: item.checked,
|
|
39626
40297
|
indented: hasCheckedItem
|
|
39627
40298
|
},
|
|
39628
|
-
/* @__PURE__ */
|
|
40299
|
+
/* @__PURE__ */ React308.createElement(index_parts_exports10.ItemText, null, item.title ?? item.value)
|
|
39629
40300
|
)
|
|
39630
40301
|
));
|
|
39631
40302
|
}
|
|
@@ -39652,7 +40323,7 @@ var SelectMenu = memoGeneric(function SelectMenu2({
|
|
|
39652
40323
|
(item) => isSelectableMenuItem(item) && item.value === value
|
|
39653
40324
|
);
|
|
39654
40325
|
const icon = selectedItem?.icon;
|
|
39655
|
-
const [internalOpen, setInternalOpen] =
|
|
40326
|
+
const [internalOpen, setInternalOpen] = useState74(open ?? false);
|
|
39656
40327
|
const { label, fieldId: id } = useLabel({
|
|
39657
40328
|
label: props.label,
|
|
39658
40329
|
fieldId: props.id
|
|
@@ -39677,7 +40348,7 @@ var SelectMenu = memoGeneric(function SelectMenu2({
|
|
|
39677
40348
|
(item) => isSelectableMenuItem(item) && item.checked
|
|
39678
40349
|
);
|
|
39679
40350
|
const readOnlyButton = useMemo88(
|
|
39680
|
-
() => /* @__PURE__ */
|
|
40351
|
+
() => /* @__PURE__ */ React308.createElement(
|
|
39681
40352
|
Button,
|
|
39682
40353
|
{
|
|
39683
40354
|
id,
|
|
@@ -39687,7 +40358,7 @@ var SelectMenu = memoGeneric(function SelectMenu2({
|
|
|
39687
40358
|
disabled: disabled2
|
|
39688
40359
|
},
|
|
39689
40360
|
icon && renderIcon(icon),
|
|
39690
|
-
/* @__PURE__ */
|
|
40361
|
+
/* @__PURE__ */ React308.createElement("span", { className: "n-flex n-flex-1" }, selectedItem?.title ?? value)
|
|
39691
40362
|
),
|
|
39692
40363
|
[icon, id, style2, className, disabled2, value, selectedItem]
|
|
39693
40364
|
);
|
|
@@ -39699,7 +40370,7 @@ var SelectMenu = memoGeneric(function SelectMenu2({
|
|
|
39699
40370
|
...contentStyleProp
|
|
39700
40371
|
};
|
|
39701
40372
|
}, [contentStyleProp]);
|
|
39702
|
-
const content = /* @__PURE__ */
|
|
40373
|
+
const content = /* @__PURE__ */ React308.createElement(
|
|
39703
40374
|
index_parts_exports10.Root,
|
|
39704
40375
|
{
|
|
39705
40376
|
value,
|
|
@@ -39708,13 +40379,13 @@ var SelectMenu = memoGeneric(function SelectMenu2({
|
|
|
39708
40379
|
onOpenChange: handleOpenChange,
|
|
39709
40380
|
disabled: disabled2
|
|
39710
40381
|
},
|
|
39711
|
-
/* @__PURE__ */
|
|
40382
|
+
/* @__PURE__ */ React308.createElement(
|
|
39712
40383
|
index_parts_exports10.Trigger,
|
|
39713
40384
|
{
|
|
39714
40385
|
id,
|
|
39715
40386
|
onFocus,
|
|
39716
40387
|
onBlur,
|
|
39717
|
-
render: /* @__PURE__ */
|
|
40388
|
+
render: /* @__PURE__ */ React308.createElement(
|
|
39718
40389
|
Button,
|
|
39719
40390
|
{
|
|
39720
40391
|
style: style2,
|
|
@@ -39727,10 +40398,10 @@ var SelectMenu = memoGeneric(function SelectMenu2({
|
|
|
39727
40398
|
}
|
|
39728
40399
|
)
|
|
39729
40400
|
},
|
|
39730
|
-
icon && /* @__PURE__ */
|
|
39731
|
-
label && labelType === "inset" && /* @__PURE__ */
|
|
39732
|
-
/* @__PURE__ */
|
|
39733
|
-
/* @__PURE__ */
|
|
40401
|
+
icon && /* @__PURE__ */ React308.createElement("span", { className: "n-pr-1.5" }, renderIcon(icon)),
|
|
40402
|
+
label && labelType === "inset" && /* @__PURE__ */ React308.createElement("div", { className: insetEndStyles }, /* @__PURE__ */ React308.createElement(Label, { className: "n-pr-4 n-text-text-disabled", htmlFor: id }, label)),
|
|
40403
|
+
/* @__PURE__ */ React308.createElement("span", { className: "n-flex-1 n-flex" }, /* @__PURE__ */ React308.createElement(index_parts_exports10.Value, null, selectedItem?.title ?? value ?? placeholder)),
|
|
40404
|
+
/* @__PURE__ */ React308.createElement(index_parts_exports10.Icon, null, /* @__PURE__ */ React308.createElement(
|
|
39734
40405
|
DropdownChevronIcon3,
|
|
39735
40406
|
{
|
|
39736
40407
|
className: cx(
|
|
@@ -39740,7 +40411,7 @@ var SelectMenu = memoGeneric(function SelectMenu2({
|
|
|
39740
40411
|
}
|
|
39741
40412
|
))
|
|
39742
40413
|
),
|
|
39743
|
-
/* @__PURE__ */
|
|
40414
|
+
/* @__PURE__ */ React308.createElement(index_parts_exports10.Portal, null, /* @__PURE__ */ React308.createElement(
|
|
39744
40415
|
index_parts_exports10.Positioner,
|
|
39745
40416
|
{
|
|
39746
40417
|
...portalScopeProps(portalScopeId),
|
|
@@ -39750,12 +40421,12 @@ var SelectMenu = memoGeneric(function SelectMenu2({
|
|
|
39750
40421
|
style: contentStyle,
|
|
39751
40422
|
className: "n-z-menu"
|
|
39752
40423
|
},
|
|
39753
|
-
/* @__PURE__ */
|
|
40424
|
+
/* @__PURE__ */ React308.createElement(index_parts_exports10.Popup, { className: styles.contentStyle }, /* @__PURE__ */ React308.createElement(index_parts_exports10.ScrollUpArrow, { className: scrollButtonStyles }, /* @__PURE__ */ React308.createElement(
|
|
39754
40425
|
ChevronUpIcon,
|
|
39755
40426
|
{
|
|
39756
40427
|
className: cx("n-transition-transform n-duration-100")
|
|
39757
40428
|
}
|
|
39758
|
-
)), /* @__PURE__ */
|
|
40429
|
+
)), /* @__PURE__ */ React308.createElement(SelectMenuItems, { items, hasCheckedItem }), /* @__PURE__ */ React308.createElement(index_parts_exports10.ScrollDownArrow, { className: scrollButtonStyles }, /* @__PURE__ */ React308.createElement(ChevronDownIcon, null)))
|
|
39759
40430
|
))
|
|
39760
40431
|
);
|
|
39761
40432
|
return readOnly ? readOnlyButton : content;
|
|
@@ -39774,7 +40445,7 @@ __export(index_parts_exports11, {
|
|
|
39774
40445
|
});
|
|
39775
40446
|
|
|
39776
40447
|
// ../../node_modules/@base-ui/react/slider/root/SliderRoot.mjs
|
|
39777
|
-
import * as
|
|
40448
|
+
import * as React310 from "react";
|
|
39778
40449
|
|
|
39779
40450
|
// ../../node_modules/@base-ui/react/slider/utils/asc.mjs
|
|
39780
40451
|
function asc(a, b) {
|
|
@@ -39819,11 +40490,11 @@ var sliderStateAttributesMapping = {
|
|
|
39819
40490
|
};
|
|
39820
40491
|
|
|
39821
40492
|
// ../../node_modules/@base-ui/react/slider/root/SliderRootContext.mjs
|
|
39822
|
-
import * as
|
|
39823
|
-
var SliderRootContext = /* @__PURE__ */
|
|
40493
|
+
import * as React309 from "react";
|
|
40494
|
+
var SliderRootContext = /* @__PURE__ */ React309.createContext(void 0);
|
|
39824
40495
|
if (process.env.NODE_ENV !== "production") SliderRootContext.displayName = "SliderRootContext";
|
|
39825
40496
|
function useSliderRootContext() {
|
|
39826
|
-
const context =
|
|
40497
|
+
const context = React309.useContext(SliderRootContext);
|
|
39827
40498
|
if (context === void 0) {
|
|
39828
40499
|
throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: SliderRootContext is missing. Slider parts must be placed within <Slider.Root>." : formatErrorMessage_default(62));
|
|
39829
40500
|
}
|
|
@@ -39835,7 +40506,7 @@ import { jsx as _jsx55 } from "react/jsx-runtime";
|
|
|
39835
40506
|
function areValuesEqual(newValue, oldValue) {
|
|
39836
40507
|
return newValue === oldValue || Array.isArray(newValue) && Array.isArray(oldValue) && areArraysEqual(newValue, oldValue);
|
|
39837
40508
|
}
|
|
39838
|
-
var SliderRoot = /* @__PURE__ */
|
|
40509
|
+
var SliderRoot = /* @__PURE__ */ React310.forwardRef(function SliderRoot2(componentProps, forwardedRef) {
|
|
39839
40510
|
const {
|
|
39840
40511
|
"aria-labelledby": ariaLabelledByProp,
|
|
39841
40512
|
className,
|
|
@@ -39880,7 +40551,7 @@ var SliderRoot = /* @__PURE__ */ React307.forwardRef(function SliderRoot2(compon
|
|
|
39880
40551
|
const {
|
|
39881
40552
|
labelId: fieldLabelId
|
|
39882
40553
|
} = useLabelableContext();
|
|
39883
|
-
const [labelId, setLabelId] =
|
|
40554
|
+
const [labelId, setLabelId] = React310.useState();
|
|
39884
40555
|
const ariaLabelledby = ariaLabelledByProp ?? resolveAriaLabelledBy(fieldLabelId, labelId);
|
|
39885
40556
|
const disabled2 = fieldDisabled || disabledProp;
|
|
39886
40557
|
const name = fieldName ?? nameProp;
|
|
@@ -39889,18 +40560,18 @@ var SliderRoot = /* @__PURE__ */ React307.forwardRef(function SliderRoot2(compon
|
|
|
39889
40560
|
default: defaultValue2 ?? min2,
|
|
39890
40561
|
name: "Slider"
|
|
39891
40562
|
});
|
|
39892
|
-
const sliderRef =
|
|
39893
|
-
const controlRef =
|
|
39894
|
-
const thumbRefs =
|
|
39895
|
-
const pressedThumbCenterOffsetRef =
|
|
39896
|
-
const pressedThumbIndexRef =
|
|
39897
|
-
const pressedValuesRef =
|
|
39898
|
-
const lastChangeReasonRef =
|
|
39899
|
-
const [active, setActiveState] =
|
|
39900
|
-
const [lastUsedThumbIndex, setLastUsedThumbIndex] =
|
|
39901
|
-
const [dragging, setDragging] =
|
|
39902
|
-
const [thumbMap, setThumbMap] =
|
|
39903
|
-
const [indicatorPosition, setIndicatorPosition] =
|
|
40563
|
+
const sliderRef = React310.useRef(null);
|
|
40564
|
+
const controlRef = React310.useRef(null);
|
|
40565
|
+
const thumbRefs = React310.useRef([]);
|
|
40566
|
+
const pressedThumbCenterOffsetRef = React310.useRef(null);
|
|
40567
|
+
const pressedThumbIndexRef = React310.useRef(-1);
|
|
40568
|
+
const pressedValuesRef = React310.useRef(null);
|
|
40569
|
+
const lastChangeReasonRef = React310.useRef(reason_parts_exports.none);
|
|
40570
|
+
const [active, setActiveState] = React310.useState(-1);
|
|
40571
|
+
const [lastUsedThumbIndex, setLastUsedThumbIndex] = React310.useState(-1);
|
|
40572
|
+
const [dragging, setDragging] = React310.useState(false);
|
|
40573
|
+
const [thumbMap, setThumbMap] = React310.useState(() => /* @__PURE__ */ new Map());
|
|
40574
|
+
const [indicatorPosition, setIndicatorPosition] = React310.useState([void 0, void 0]);
|
|
39904
40575
|
const setActive = useStableCallback2((value) => {
|
|
39905
40576
|
setActiveState(value);
|
|
39906
40577
|
if (value !== -1) {
|
|
@@ -39913,7 +40584,7 @@ var SliderRoot = /* @__PURE__ */ React307.forwardRef(function SliderRoot2(compon
|
|
|
39913
40584
|
}
|
|
39914
40585
|
});
|
|
39915
40586
|
const range2 = Array.isArray(valueUnwrapped);
|
|
39916
|
-
const values =
|
|
40587
|
+
const values = React310.useMemo(() => {
|
|
39917
40588
|
if (!range2) {
|
|
39918
40589
|
return [clamp2(valueUnwrapped, min2, max2)];
|
|
39919
40590
|
}
|
|
@@ -39986,7 +40657,7 @@ var SliderRoot = /* @__PURE__ */ React307.forwardRef(function SliderRoot2(compon
|
|
|
39986
40657
|
setActive(-1);
|
|
39987
40658
|
}
|
|
39988
40659
|
}, [active, disabled2, setActive]);
|
|
39989
|
-
const state =
|
|
40660
|
+
const state = React310.useMemo(() => ({
|
|
39990
40661
|
...fieldState,
|
|
39991
40662
|
activeThumbIndex: active,
|
|
39992
40663
|
disabled: disabled2,
|
|
@@ -39998,7 +40669,7 @@ var SliderRoot = /* @__PURE__ */ React307.forwardRef(function SliderRoot2(compon
|
|
|
39998
40669
|
step,
|
|
39999
40670
|
values
|
|
40000
40671
|
}), [fieldState, active, disabled2, dragging, max2, min2, minStepsBetweenValues, orientation, step, values]);
|
|
40001
|
-
const contextValue =
|
|
40672
|
+
const contextValue = React310.useMemo(() => ({
|
|
40002
40673
|
active,
|
|
40003
40674
|
controlRef,
|
|
40004
40675
|
disabled: disabled2,
|
|
@@ -40060,8 +40731,8 @@ var SliderRoot = /* @__PURE__ */ React307.forwardRef(function SliderRoot2(compon
|
|
|
40060
40731
|
if (process.env.NODE_ENV !== "production") SliderRoot.displayName = "SliderRoot";
|
|
40061
40732
|
|
|
40062
40733
|
// ../../node_modules/@base-ui/react/slider/label/SliderLabel.mjs
|
|
40063
|
-
import * as
|
|
40064
|
-
var SliderLabel = /* @__PURE__ */
|
|
40734
|
+
import * as React311 from "react";
|
|
40735
|
+
var SliderLabel = /* @__PURE__ */ React311.forwardRef(function SliderLabel2(componentProps, forwardedRef) {
|
|
40065
40736
|
const {
|
|
40066
40737
|
render,
|
|
40067
40738
|
className,
|
|
@@ -40105,8 +40776,8 @@ var SliderLabel = /* @__PURE__ */ React308.forwardRef(function SliderLabel2(comp
|
|
|
40105
40776
|
if (process.env.NODE_ENV !== "production") SliderLabel.displayName = "SliderLabel";
|
|
40106
40777
|
|
|
40107
40778
|
// ../../node_modules/@base-ui/react/slider/value/SliderValue.mjs
|
|
40108
|
-
import * as
|
|
40109
|
-
var SliderValue = /* @__PURE__ */
|
|
40779
|
+
import * as React312 from "react";
|
|
40780
|
+
var SliderValue = /* @__PURE__ */ React312.forwardRef(function SliderValue2(componentProps, forwardedRef) {
|
|
40110
40781
|
const {
|
|
40111
40782
|
"aria-live": ariaLive = "off",
|
|
40112
40783
|
render,
|
|
@@ -40125,7 +40796,7 @@ var SliderValue = /* @__PURE__ */ React309.forwardRef(function SliderValue2(comp
|
|
|
40125
40796
|
const outputFor = Array.from(thumbMap.values(), ({
|
|
40126
40797
|
inputId
|
|
40127
40798
|
}) => inputId).join(" ").trim() || void 0;
|
|
40128
|
-
const formattedValues =
|
|
40799
|
+
const formattedValues = React312.useMemo(() => values.map((v) => formatNumber(v, locale, format)), [format, locale, values]);
|
|
40129
40800
|
const defaultDisplayValue = formattedValues.join(" \u2013 ");
|
|
40130
40801
|
const element = useRenderElement("output", componentProps, {
|
|
40131
40802
|
state,
|
|
@@ -40144,7 +40815,7 @@ var SliderValue = /* @__PURE__ */ React309.forwardRef(function SliderValue2(comp
|
|
|
40144
40815
|
if (process.env.NODE_ENV !== "production") SliderValue.displayName = "SliderValue";
|
|
40145
40816
|
|
|
40146
40817
|
// ../../node_modules/@base-ui/react/slider/control/SliderControl.mjs
|
|
40147
|
-
import * as
|
|
40818
|
+
import * as React313 from "react";
|
|
40148
40819
|
|
|
40149
40820
|
// ../../node_modules/@base-ui/react/slider/utils/getMidpoint.mjs
|
|
40150
40821
|
function getMidpoint(element, vertical) {
|
|
@@ -40330,7 +41001,7 @@ function getFingerCoords(event, touchIdRef) {
|
|
|
40330
41001
|
y: event.clientY
|
|
40331
41002
|
};
|
|
40332
41003
|
}
|
|
40333
|
-
var SliderControl = /* @__PURE__ */
|
|
41004
|
+
var SliderControl = /* @__PURE__ */ React313.forwardRef(function SliderControl2(componentProps, forwardedRef) {
|
|
40334
41005
|
const {
|
|
40335
41006
|
render: renderProp,
|
|
40336
41007
|
className,
|
|
@@ -40364,17 +41035,17 @@ var SliderControl = /* @__PURE__ */ React310.forwardRef(function SliderControl2(
|
|
|
40364
41035
|
const direction = useDirection();
|
|
40365
41036
|
const range2 = values.length > 1;
|
|
40366
41037
|
const vertical = orientation === "vertical";
|
|
40367
|
-
const controlRef =
|
|
40368
|
-
const stylesRef =
|
|
41038
|
+
const controlRef = React313.useRef(null);
|
|
41039
|
+
const stylesRef = React313.useRef(null);
|
|
40369
41040
|
const setStylesRef = useStableCallback2((element2) => {
|
|
40370
41041
|
if (element2 && stylesRef.current == null) {
|
|
40371
41042
|
stylesRef.current = getWindow2(element2).getComputedStyle(element2);
|
|
40372
41043
|
}
|
|
40373
41044
|
});
|
|
40374
|
-
const touchIdRef =
|
|
40375
|
-
const moveCountRef =
|
|
40376
|
-
const insetThumbOffsetRef =
|
|
40377
|
-
const currentInteractionValueRef =
|
|
41045
|
+
const touchIdRef = React313.useRef(null);
|
|
41046
|
+
const moveCountRef = React313.useRef(0);
|
|
41047
|
+
const insetThumbOffsetRef = React313.useRef(0);
|
|
41048
|
+
const currentInteractionValueRef = React313.useRef(null);
|
|
40378
41049
|
const latestValuesRef = useValueAsRef(values);
|
|
40379
41050
|
function getThumbInput(el) {
|
|
40380
41051
|
return el?.querySelector('input[type="range"]');
|
|
@@ -40587,7 +41258,7 @@ var SliderControl = /* @__PURE__ */ React310.forwardRef(function SliderControl2(
|
|
|
40587
41258
|
currentInteractionValueRef.current = null;
|
|
40588
41259
|
});
|
|
40589
41260
|
const focusFrame = useAnimationFrame();
|
|
40590
|
-
|
|
41261
|
+
React313.useEffect(() => {
|
|
40591
41262
|
const control = controlRef.current;
|
|
40592
41263
|
if (!control) {
|
|
40593
41264
|
return () => stopListening();
|
|
@@ -40601,7 +41272,7 @@ var SliderControl = /* @__PURE__ */ React310.forwardRef(function SliderControl2(
|
|
|
40601
41272
|
stopListening();
|
|
40602
41273
|
};
|
|
40603
41274
|
}, [stopListening, handleTouchStart, controlRef, focusFrame]);
|
|
40604
|
-
|
|
41275
|
+
React313.useEffect(() => {
|
|
40605
41276
|
if (disabled2) {
|
|
40606
41277
|
stopListening();
|
|
40607
41278
|
}
|
|
@@ -40664,8 +41335,8 @@ var SliderControl = /* @__PURE__ */ React310.forwardRef(function SliderControl2(
|
|
|
40664
41335
|
if (process.env.NODE_ENV !== "production") SliderControl.displayName = "SliderControl";
|
|
40665
41336
|
|
|
40666
41337
|
// ../../node_modules/@base-ui/react/slider/track/SliderTrack.mjs
|
|
40667
|
-
import * as
|
|
40668
|
-
var SliderTrack = /* @__PURE__ */
|
|
41338
|
+
import * as React314 from "react";
|
|
41339
|
+
var SliderTrack = /* @__PURE__ */ React314.forwardRef(function SliderTrack2(componentProps, forwardedRef) {
|
|
40669
41340
|
const {
|
|
40670
41341
|
render,
|
|
40671
41342
|
className,
|
|
@@ -40690,7 +41361,7 @@ var SliderTrack = /* @__PURE__ */ React311.forwardRef(function SliderTrack2(comp
|
|
|
40690
41361
|
if (process.env.NODE_ENV !== "production") SliderTrack.displayName = "SliderTrack";
|
|
40691
41362
|
|
|
40692
41363
|
// ../../node_modules/@base-ui/react/slider/thumb/SliderThumb.mjs
|
|
40693
|
-
import * as
|
|
41364
|
+
import * as React316 from "react";
|
|
40694
41365
|
|
|
40695
41366
|
// ../../node_modules/@base-ui/react/slider/thumb/prehydrationScript.min.mjs
|
|
40696
41367
|
var script = '!function(){const t=document.currentScript?.parentElement;if(!t)return;const e=t.closest("[data-base-ui-slider-control]");if(!e)return;const r=e.querySelector("[data-base-ui-slider-indicator]"),i=e.getBoundingClientRect(),n="vertical"===e.getAttribute("data-orientation")?"height":"width",o=e.querySelectorAll(\'input[type="range"]\'),l=o.length>1,s=o.length-1;let a=null,u=null;for(let t=0;t<o.length;t+=1){const e=o[t],y=parseFloat(e.getAttribute("value")??"");if(Number.isNaN(y))return;const c=e.parentElement;if(!c)return;const p=parseFloat(e.getAttribute("max")??"100"),g=parseFloat(e.getAttribute("min")??"0"),b=c?.getBoundingClientRect(),d=i[n]-b[n],m=100*(y-g)/(p-g),v=(b[n]/2+d*m/100)/i[n]*100;c.style.setProperty("--position",`${v}%`),Number.isFinite(v)&&(c.style.removeProperty("visibility"),r&&(0===t?(a=v,r.style.setProperty("--start-position",`${v}%`),l||r.style.removeProperty("visibility")):t===s&&(u=v-(a??0),r.style.setProperty("--end-position",`${v}%`),r.style.setProperty("--relative-size",`${u}%`),r.style.removeProperty("visibility"))))}}();';
|
|
@@ -40711,7 +41382,7 @@ function useIsHydrating() {
|
|
|
40711
41382
|
}
|
|
40712
41383
|
|
|
40713
41384
|
// ../../node_modules/@base-ui/react/internals/PrehydrationScript.mjs
|
|
40714
|
-
import * as
|
|
41385
|
+
import * as React315 from "react";
|
|
40715
41386
|
import { jsx as _jsx56 } from "react/jsx-runtime";
|
|
40716
41387
|
function PrehydrationScript(props) {
|
|
40717
41388
|
const {
|
|
@@ -40751,7 +41422,7 @@ function getNewValue(thumbValue, increment, direction, min2, max2) {
|
|
|
40751
41422
|
const roundedValue = Number(value.toFixed(Math.max(getDecimalPrecision(thumbValue), getDecimalPrecision(increment), getDecimalPrecision(min2))));
|
|
40752
41423
|
return clamp2(roundedValue, min2, max2);
|
|
40753
41424
|
}
|
|
40754
|
-
var SliderThumb = /* @__PURE__ */
|
|
41425
|
+
var SliderThumb = /* @__PURE__ */ React316.forwardRef(function SliderThumb2(componentProps, forwardedRef) {
|
|
40755
41426
|
const {
|
|
40756
41427
|
render,
|
|
40757
41428
|
children: childrenProp,
|
|
@@ -40812,9 +41483,9 @@ var SliderThumb = /* @__PURE__ */ React313.forwardRef(function SliderThumb2(comp
|
|
|
40812
41483
|
setFocused,
|
|
40813
41484
|
validationMode
|
|
40814
41485
|
} = useFieldRootContext();
|
|
40815
|
-
const thumbRef =
|
|
40816
|
-
const inputRef =
|
|
40817
|
-
const restoringFocusVisibleRef =
|
|
41486
|
+
const thumbRef = React316.useRef(null);
|
|
41487
|
+
const inputRef = React316.useRef(null);
|
|
41488
|
+
const restoringFocusVisibleRef = React316.useRef(false);
|
|
40818
41489
|
const handleFocusProp = useStableCallback2((event) => {
|
|
40819
41490
|
if (restoringFocusVisibleRef.current) {
|
|
40820
41491
|
return;
|
|
@@ -40830,7 +41501,7 @@ var SliderThumb = /* @__PURE__ */ React313.forwardRef(function SliderThumb2(comp
|
|
|
40830
41501
|
const defaultInputId = useBaseUiId();
|
|
40831
41502
|
const labelableId = useLabelableId();
|
|
40832
41503
|
const inputId = range2 ? defaultInputId : labelableId;
|
|
40833
|
-
const thumbMetadata =
|
|
41504
|
+
const thumbMetadata = React316.useMemo(() => ({
|
|
40834
41505
|
inputId
|
|
40835
41506
|
}), [inputId]);
|
|
40836
41507
|
const {
|
|
@@ -40843,7 +41514,7 @@ var SliderThumb = /* @__PURE__ */ React313.forwardRef(function SliderThumb2(comp
|
|
|
40843
41514
|
const last = index2 === sliderValues.length - 1;
|
|
40844
41515
|
const thumbValue = sliderValues[index2];
|
|
40845
41516
|
const thumbValuePercent = valueToPercent(thumbValue, min2, max2);
|
|
40846
|
-
const [positionPercent, setPositionPercent] =
|
|
41517
|
+
const [positionPercent, setPositionPercent] = React316.useState();
|
|
40847
41518
|
const isHydrating = useIsHydrating();
|
|
40848
41519
|
const safeLastUsedThumbIndex = lastUsedThumbIndex >= 0 && lastUsedThumbIndex < sliderValues.length ? lastUsedThumbIndex : -1;
|
|
40849
41520
|
const getInsetPosition = useStableCallback2(() => {
|
|
@@ -41054,7 +41725,7 @@ var SliderThumb = /* @__PURE__ */ React313.forwardRef(function SliderThumb2(comp
|
|
|
41054
41725
|
ref: [forwardedRef, listItemRef, thumbRef],
|
|
41055
41726
|
props: [{
|
|
41056
41727
|
["data-index"]: index2,
|
|
41057
|
-
children: /* @__PURE__ */ _jsxs21(
|
|
41728
|
+
children: /* @__PURE__ */ _jsxs21(React316.Fragment, {
|
|
41058
41729
|
children: [childrenProp, /* @__PURE__ */ _jsx57("input", {
|
|
41059
41730
|
ref: mergedInputRef,
|
|
41060
41731
|
...inputProps,
|
|
@@ -41082,7 +41753,7 @@ var SliderThumb = /* @__PURE__ */ React313.forwardRef(function SliderThumb2(comp
|
|
|
41082
41753
|
if (process.env.NODE_ENV !== "production") SliderThumb.displayName = "SliderThumb";
|
|
41083
41754
|
|
|
41084
41755
|
// ../../node_modules/@base-ui/react/slider/indicator/SliderIndicator.mjs
|
|
41085
|
-
import * as
|
|
41756
|
+
import * as React317 from "react";
|
|
41086
41757
|
function getIndicatorStyles(vertical, range2, inset, start, end, forceHidden) {
|
|
41087
41758
|
const styles3 = {
|
|
41088
41759
|
visibility: forceHidden || inset && (start === void 0 || range2 && end === void 0) ? "hidden" : void 0,
|
|
@@ -41103,7 +41774,7 @@ function getIndicatorStyles(vertical, range2, inset, start, end, forceHidden) {
|
|
|
41103
41774
|
styles3[vertical ? "height" : "width"] = range2 ? sizeValue : startValue;
|
|
41104
41775
|
return styles3;
|
|
41105
41776
|
}
|
|
41106
|
-
var SliderIndicator = /* @__PURE__ */
|
|
41777
|
+
var SliderIndicator = /* @__PURE__ */ React317.forwardRef(function SliderIndicator2(componentProps, forwardedRef) {
|
|
41107
41778
|
const {
|
|
41108
41779
|
render,
|
|
41109
41780
|
className,
|
|
@@ -41139,12 +41810,12 @@ var SliderIndicator = /* @__PURE__ */ React314.forwardRef(function SliderIndicat
|
|
|
41139
41810
|
if (process.env.NODE_ENV !== "production") SliderIndicator.displayName = "SliderIndicator";
|
|
41140
41811
|
|
|
41141
41812
|
// src/components/Slider.tsx
|
|
41142
|
-
import
|
|
41813
|
+
import React318, { memo as memo37, useCallback as useCallback54 } from "react";
|
|
41143
41814
|
var THUMB_WIDTH = 8;
|
|
41144
41815
|
var thumbStyle = {
|
|
41145
41816
|
width: THUMB_WIDTH
|
|
41146
41817
|
};
|
|
41147
|
-
var Slider =
|
|
41818
|
+
var Slider = memo37(function Slider2({
|
|
41148
41819
|
style: style2,
|
|
41149
41820
|
className,
|
|
41150
41821
|
value,
|
|
@@ -41169,7 +41840,7 @@ var Slider = memo36(function Slider2({
|
|
|
41169
41840
|
[onValueChange]
|
|
41170
41841
|
);
|
|
41171
41842
|
const ratio = (clampedValue - min2) / (max2 - min2);
|
|
41172
|
-
return /* @__PURE__ */
|
|
41843
|
+
return /* @__PURE__ */ React318.createElement(
|
|
41173
41844
|
index_parts_exports11.Root,
|
|
41174
41845
|
{
|
|
41175
41846
|
min: min2,
|
|
@@ -41188,7 +41859,7 @@ var Slider = memo36(function Slider2({
|
|
|
41188
41859
|
disabled: readOnly,
|
|
41189
41860
|
thumbAlignment: "edge"
|
|
41190
41861
|
},
|
|
41191
|
-
/* @__PURE__ */
|
|
41862
|
+
/* @__PURE__ */ React318.createElement(index_parts_exports11.Control, { className: "n-relative n-flex-grow n-h-[21px] n-flex n-items-center" }, /* @__PURE__ */ React318.createElement(index_parts_exports11.Track, { className: "n-relative n-flex-grow n-h-[3px] n-overflow-hidden" }, /* @__PURE__ */ React318.createElement(
|
|
41192
41863
|
"div",
|
|
41193
41864
|
{
|
|
41194
41865
|
className: "n-absolute n-h-full n-rounded-l n-bg-slider-active-background",
|
|
@@ -41199,7 +41870,7 @@ var Slider = memo36(function Slider2({
|
|
|
41199
41870
|
width: `calc(${ratio * 100}% - ${ratio * THUMB_WIDTH + 2}px)`
|
|
41200
41871
|
}
|
|
41201
41872
|
}
|
|
41202
|
-
), /* @__PURE__ */
|
|
41873
|
+
), /* @__PURE__ */ React318.createElement(
|
|
41203
41874
|
"div",
|
|
41204
41875
|
{
|
|
41205
41876
|
className: "n-absolute n-h-full n-rounded-r n-bg-input-background",
|
|
@@ -41209,7 +41880,7 @@ var Slider = memo36(function Slider2({
|
|
|
41209
41880
|
width: `calc(${(1 - ratio) * 100}% - ${(1 - ratio) * THUMB_WIDTH + 2}px)`
|
|
41210
41881
|
}
|
|
41211
41882
|
}
|
|
41212
|
-
)), /* @__PURE__ */
|
|
41883
|
+
)), /* @__PURE__ */ React318.createElement(
|
|
41213
41884
|
index_parts_exports11.Thumb,
|
|
41214
41885
|
{
|
|
41215
41886
|
style: thumbStyle,
|
|
@@ -41226,34 +41897,34 @@ var Slider = memo36(function Slider2({
|
|
|
41226
41897
|
});
|
|
41227
41898
|
|
|
41228
41899
|
// src/components/sorting/createSharedDrag.tsx
|
|
41229
|
-
import * as
|
|
41900
|
+
import * as React319 from "react";
|
|
41230
41901
|
function createSharedDrag() {
|
|
41231
|
-
const dragRegistrationContext =
|
|
41232
|
-
const activeDragContext =
|
|
41902
|
+
const dragRegistrationContext = React319.createContext(null);
|
|
41903
|
+
const activeDragContext = React319.createContext(
|
|
41233
41904
|
null
|
|
41234
41905
|
);
|
|
41235
41906
|
const sharedDragProps = {
|
|
41236
41907
|
dragRegistrationContext,
|
|
41237
41908
|
activeDragContext
|
|
41238
41909
|
};
|
|
41239
|
-
const Provider = (props) => /* @__PURE__ */
|
|
41910
|
+
const Provider = (props) => /* @__PURE__ */ React319.createElement(SharedDragProvider, { sharedDragProps, ...props });
|
|
41240
41911
|
return {
|
|
41241
41912
|
Provider,
|
|
41242
|
-
Sortable: (props) => /* @__PURE__ */
|
|
41913
|
+
Sortable: (props) => /* @__PURE__ */ React319.createElement(Sortable, { sharedDragProps, ...props }),
|
|
41243
41914
|
props: sharedDragProps
|
|
41244
41915
|
};
|
|
41245
41916
|
}
|
|
41246
41917
|
|
|
41247
41918
|
// src/components/StatCard.tsx
|
|
41248
41919
|
import { ArrowDownIcon, ArrowUpIcon } from "@noya-app/noya-icons";
|
|
41249
|
-
import
|
|
41920
|
+
import React320, { forwardRef as forwardRef129 } from "react";
|
|
41250
41921
|
var ICON_COLOR_STYLES = {
|
|
41251
41922
|
primary: "n-bg-primary",
|
|
41252
41923
|
secondary: "n-bg-secondary",
|
|
41253
41924
|
info: "n-bg-banner-info-text",
|
|
41254
41925
|
error: "n-bg-banner-error-text"
|
|
41255
41926
|
};
|
|
41256
|
-
var StatCard =
|
|
41927
|
+
var StatCard = forwardRef129(
|
|
41257
41928
|
function StatCard2({
|
|
41258
41929
|
label,
|
|
41259
41930
|
value,
|
|
@@ -41265,14 +41936,14 @@ var StatCard = forwardRef128(
|
|
|
41265
41936
|
...props
|
|
41266
41937
|
}, forwardedRef) {
|
|
41267
41938
|
const TrendIcon = trend === "down" ? ArrowDownIcon : ArrowUpIcon;
|
|
41268
|
-
return /* @__PURE__ */
|
|
41939
|
+
return /* @__PURE__ */ React320.createElement(
|
|
41269
41940
|
Card,
|
|
41270
41941
|
{
|
|
41271
41942
|
ref: forwardedRef,
|
|
41272
41943
|
className: cx("n-flex n-items-center n-gap-4", className),
|
|
41273
41944
|
...props
|
|
41274
41945
|
},
|
|
41275
|
-
icon && /* @__PURE__ */
|
|
41946
|
+
icon && /* @__PURE__ */ React320.createElement(
|
|
41276
41947
|
"div",
|
|
41277
41948
|
{
|
|
41278
41949
|
"aria-hidden": "true",
|
|
@@ -41283,24 +41954,24 @@ var StatCard = forwardRef128(
|
|
|
41283
41954
|
},
|
|
41284
41955
|
renderIcon(icon)
|
|
41285
41956
|
),
|
|
41286
|
-
/* @__PURE__ */
|
|
41957
|
+
/* @__PURE__ */ React320.createElement("div", { className: "n-flex n-min-w-0 n-flex-1 n-self-stretch n-flex-col n-justify-center n-gap-1" }, /* @__PURE__ */ React320.createElement("div", { className: "n-flex n-items-center n-gap-4" }, /* @__PURE__ */ React320.createElement(Small, { className: "n-min-w-0 n-flex-1 n-opacity-70" }, label), change !== void 0 && /* @__PURE__ */ React320.createElement(
|
|
41287
41958
|
Chip,
|
|
41288
41959
|
{
|
|
41289
41960
|
className: "n-flex-none n-gap-1",
|
|
41290
41961
|
colorScheme,
|
|
41291
41962
|
size: "large"
|
|
41292
41963
|
},
|
|
41293
|
-
trend && /* @__PURE__ */
|
|
41964
|
+
trend && /* @__PURE__ */ React320.createElement(TrendIcon, { "aria-hidden": "true" }),
|
|
41294
41965
|
change
|
|
41295
|
-
)), /* @__PURE__ */
|
|
41966
|
+
)), /* @__PURE__ */ React320.createElement(Heading1, { as: "div", className: "!n-font-bold n-leading-none" }, value))
|
|
41296
41967
|
);
|
|
41297
41968
|
}
|
|
41298
41969
|
);
|
|
41299
41970
|
|
|
41300
41971
|
// src/components/Stepper.tsx
|
|
41301
41972
|
import { clamp as clamp9 } from "@noya-app/noya-utils";
|
|
41302
|
-
import
|
|
41303
|
-
var Stepper =
|
|
41973
|
+
import React321, { memo as memo38, useCallback as useCallback55, useMemo as useMemo92 } from "react";
|
|
41974
|
+
var Stepper = memo38(function Stepper2({
|
|
41304
41975
|
style: style2,
|
|
41305
41976
|
className,
|
|
41306
41977
|
value: valueProp,
|
|
@@ -41327,7 +41998,7 @@ var Stepper = memo37(function Stepper2({
|
|
|
41327
41998
|
},
|
|
41328
41999
|
[onValueChange, min2, max2]
|
|
41329
42000
|
);
|
|
41330
|
-
return /* @__PURE__ */
|
|
42001
|
+
return /* @__PURE__ */ React321.createElement(
|
|
41331
42002
|
"div",
|
|
41332
42003
|
{
|
|
41333
42004
|
id,
|
|
@@ -41339,7 +42010,7 @@ var Stepper = memo37(function Stepper2({
|
|
|
41339
42010
|
onFocus,
|
|
41340
42011
|
onBlur
|
|
41341
42012
|
},
|
|
41342
|
-
/* @__PURE__ */
|
|
42013
|
+
/* @__PURE__ */ React321.createElement(
|
|
41343
42014
|
InputField2.Root,
|
|
41344
42015
|
{
|
|
41345
42016
|
className: "n-flex-1",
|
|
@@ -41347,7 +42018,7 @@ var Stepper = memo37(function Stepper2({
|
|
|
41347
42018
|
startClassName: "-n-ml-[3px]",
|
|
41348
42019
|
endWidth: 17,
|
|
41349
42020
|
endClassName: "-n-mr-[3px]",
|
|
41350
|
-
start: /* @__PURE__ */
|
|
42021
|
+
start: /* @__PURE__ */ React321.createElement(
|
|
41351
42022
|
IconButton,
|
|
41352
42023
|
{
|
|
41353
42024
|
iconName: "MinusIcon",
|
|
@@ -41361,7 +42032,7 @@ var Stepper = memo37(function Stepper2({
|
|
|
41361
42032
|
}
|
|
41362
42033
|
}
|
|
41363
42034
|
),
|
|
41364
|
-
end: /* @__PURE__ */
|
|
42035
|
+
end: /* @__PURE__ */ React321.createElement(
|
|
41365
42036
|
IconButton,
|
|
41366
42037
|
{
|
|
41367
42038
|
iconName: "PlusIcon",
|
|
@@ -41376,7 +42047,7 @@ var Stepper = memo37(function Stepper2({
|
|
|
41376
42047
|
}
|
|
41377
42048
|
)
|
|
41378
42049
|
},
|
|
41379
|
-
/* @__PURE__ */
|
|
42050
|
+
/* @__PURE__ */ React321.createElement(
|
|
41380
42051
|
InputField2.NumberInput,
|
|
41381
42052
|
{
|
|
41382
42053
|
value,
|
|
@@ -41397,14 +42068,14 @@ __export(index_parts_exports12, {
|
|
|
41397
42068
|
});
|
|
41398
42069
|
|
|
41399
42070
|
// ../../node_modules/@base-ui/react/switch/root/SwitchRoot.mjs
|
|
41400
|
-
import * as
|
|
42071
|
+
import * as React324 from "react";
|
|
41401
42072
|
|
|
41402
42073
|
// ../../node_modules/@base-ui/react/switch/root/SwitchRootContext.mjs
|
|
41403
|
-
import * as
|
|
41404
|
-
var SwitchRootContext = /* @__PURE__ */
|
|
42074
|
+
import * as React322 from "react";
|
|
42075
|
+
var SwitchRootContext = /* @__PURE__ */ React322.createContext(void 0);
|
|
41405
42076
|
if (process.env.NODE_ENV !== "production") SwitchRootContext.displayName = "SwitchRootContext";
|
|
41406
42077
|
function useSwitchRootContext() {
|
|
41407
|
-
const context =
|
|
42078
|
+
const context = React322.useContext(SwitchRootContext);
|
|
41408
42079
|
if (context === void 0) {
|
|
41409
42080
|
throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: SwitchRootContext is missing. Switch parts must be placed within <Switch.Root>." : formatErrorMessage_default(63));
|
|
41410
42081
|
}
|
|
@@ -41427,9 +42098,9 @@ var stateAttributesMapping6 = {
|
|
|
41427
42098
|
};
|
|
41428
42099
|
|
|
41429
42100
|
// ../../node_modules/@base-ui/react/internals/labelable-provider/useAriaLabelledBy.mjs
|
|
41430
|
-
import * as
|
|
42101
|
+
import * as React323 from "react";
|
|
41431
42102
|
function useAriaLabelledBy(explicitAriaLabelledBy, labelId, labelSourceRef, enableFallback = true, labelSourceId) {
|
|
41432
|
-
const [fallbackAriaLabelledBy, setFallbackAriaLabelledBy] =
|
|
42103
|
+
const [fallbackAriaLabelledBy, setFallbackAriaLabelledBy] = React323.useState();
|
|
41433
42104
|
const generatedLabelId = useBaseUiId(labelSourceId ? `${labelSourceId}-label` : void 0);
|
|
41434
42105
|
const ariaLabelledBy = explicitAriaLabelledBy ?? labelId ?? fallbackAriaLabelledBy;
|
|
41435
42106
|
useIsoLayoutEffect(() => {
|
|
@@ -41471,7 +42142,7 @@ function findAssociatedLabel(labelSource) {
|
|
|
41471
42142
|
|
|
41472
42143
|
// ../../node_modules/@base-ui/react/switch/root/SwitchRoot.mjs
|
|
41473
42144
|
import { jsx as _jsx58, jsxs as _jsxs22 } from "react/jsx-runtime";
|
|
41474
|
-
var SwitchRoot = /* @__PURE__ */
|
|
42145
|
+
var SwitchRoot = /* @__PURE__ */ React324.forwardRef(function SwitchRoot2(componentProps, forwardedRef) {
|
|
41475
42146
|
const {
|
|
41476
42147
|
checked: checkedProp,
|
|
41477
42148
|
className,
|
|
@@ -41512,9 +42183,9 @@ var SwitchRoot = /* @__PURE__ */ React321.forwardRef(function SwitchRoot2(compon
|
|
|
41512
42183
|
} = useLabelableContext();
|
|
41513
42184
|
const disabled2 = fieldDisabled || disabledProp;
|
|
41514
42185
|
const name = fieldName ?? nameProp;
|
|
41515
|
-
const inputRef =
|
|
42186
|
+
const inputRef = React324.useRef(null);
|
|
41516
42187
|
const handleInputRef = useMergedRefs(inputRef, externalInputRef, validation.inputRef);
|
|
41517
|
-
const switchRef =
|
|
42188
|
+
const switchRef = React324.useRef(null);
|
|
41518
42189
|
const id = useBaseUiId();
|
|
41519
42190
|
const controlId = useLabelableId({
|
|
41520
42191
|
id: idProp,
|
|
@@ -41624,7 +42295,7 @@ var SwitchRoot = /* @__PURE__ */ React321.forwardRef(function SwitchRoot2(compon
|
|
|
41624
42295
|
value
|
|
41625
42296
|
} : EMPTY_OBJECT
|
|
41626
42297
|
};
|
|
41627
|
-
const state =
|
|
42298
|
+
const state = React324.useMemo(() => ({
|
|
41628
42299
|
...fieldState,
|
|
41629
42300
|
checked,
|
|
41630
42301
|
disabled: disabled2,
|
|
@@ -41654,8 +42325,8 @@ var SwitchRoot = /* @__PURE__ */ React321.forwardRef(function SwitchRoot2(compon
|
|
|
41654
42325
|
if (process.env.NODE_ENV !== "production") SwitchRoot.displayName = "SwitchRoot";
|
|
41655
42326
|
|
|
41656
42327
|
// ../../node_modules/@base-ui/react/switch/thumb/SwitchThumb.mjs
|
|
41657
|
-
import * as
|
|
41658
|
-
var SwitchThumb = /* @__PURE__ */
|
|
42328
|
+
import * as React325 from "react";
|
|
42329
|
+
var SwitchThumb = /* @__PURE__ */ React325.forwardRef(function SwitchThumb2(componentProps, forwardedRef) {
|
|
41659
42330
|
const {
|
|
41660
42331
|
render,
|
|
41661
42332
|
className,
|
|
@@ -41673,7 +42344,7 @@ var SwitchThumb = /* @__PURE__ */ React322.forwardRef(function SwitchThumb2(comp
|
|
|
41673
42344
|
if (process.env.NODE_ENV !== "production") SwitchThumb.displayName = "SwitchThumb";
|
|
41674
42345
|
|
|
41675
42346
|
// src/components/Switch.tsx
|
|
41676
|
-
import * as
|
|
42347
|
+
import * as React326 from "react";
|
|
41677
42348
|
var Switch = function Switch2({
|
|
41678
42349
|
id,
|
|
41679
42350
|
value,
|
|
@@ -41685,7 +42356,7 @@ var Switch = function Switch2({
|
|
|
41685
42356
|
style: style2,
|
|
41686
42357
|
className
|
|
41687
42358
|
}) {
|
|
41688
|
-
return /* @__PURE__ */
|
|
42359
|
+
return /* @__PURE__ */ React326.createElement(
|
|
41689
42360
|
index_parts_exports12.Root,
|
|
41690
42361
|
{
|
|
41691
42362
|
id,
|
|
@@ -41704,12 +42375,12 @@ var Switch = function Switch2({
|
|
|
41704
42375
|
onFocus,
|
|
41705
42376
|
onBlur
|
|
41706
42377
|
},
|
|
41707
|
-
/* @__PURE__ */
|
|
42378
|
+
/* @__PURE__ */ React326.createElement(index_parts_exports12.Thumb, { className: "n-block n-w-[15px] n-h-[15px] n-bg-background n-rounded-full n-transition-transform n-translate-x-[2px] n-translate-y-[2px] data-[checked]:n-translate-x-[15px]" })
|
|
41708
42379
|
);
|
|
41709
42380
|
};
|
|
41710
42381
|
|
|
41711
42382
|
// src/components/Tabs.tsx
|
|
41712
|
-
import * as
|
|
42383
|
+
import * as React327 from "react";
|
|
41713
42384
|
function Tabs({
|
|
41714
42385
|
value,
|
|
41715
42386
|
onValueChange,
|
|
@@ -41724,7 +42395,7 @@ function Tabs({
|
|
|
41724
42395
|
value,
|
|
41725
42396
|
onChange: onValueChange
|
|
41726
42397
|
});
|
|
41727
|
-
return /* @__PURE__ */
|
|
42398
|
+
return /* @__PURE__ */ React327.createElement("div", { ...props, className: cx("n-flex n-flex-col", props.className) }, /* @__PURE__ */ React327.createElement("div", { className: "n-flex n-flex-row n-px-3" }, /* @__PURE__ */ React327.createElement(
|
|
41728
42399
|
SegmentedControl,
|
|
41729
42400
|
{
|
|
41730
42401
|
className: "n-flex-1",
|
|
@@ -41733,11 +42404,11 @@ function Tabs({
|
|
|
41733
42404
|
variant,
|
|
41734
42405
|
items: selectableItems
|
|
41735
42406
|
}
|
|
41736
|
-
)), /* @__PURE__ */
|
|
42407
|
+
)), /* @__PURE__ */ React327.createElement(Divider, null), renderContent({ value: activeTab }));
|
|
41737
42408
|
}
|
|
41738
42409
|
|
|
41739
42410
|
// src/components/UserPicker.tsx
|
|
41740
|
-
import
|
|
42411
|
+
import React328, { useCallback as useCallback56, useMemo as useMemo94, useState as useState78 } from "react";
|
|
41741
42412
|
function UserPicker({
|
|
41742
42413
|
users,
|
|
41743
42414
|
value,
|
|
@@ -41761,7 +42432,7 @@ function UserPicker({
|
|
|
41761
42432
|
return sortedUsers.map(createUserMenuItem);
|
|
41762
42433
|
}, [sortedUsers]);
|
|
41763
42434
|
const isControlled = value !== void 0;
|
|
41764
|
-
const [uncontrolledValue, setUncontrolledValue] =
|
|
42435
|
+
const [uncontrolledValue, setUncontrolledValue] = useState78(defaultValue2);
|
|
41765
42436
|
const selectedUserId = isControlled ? value : uncontrolledValue;
|
|
41766
42437
|
const selectedItem = useMemo94(() => {
|
|
41767
42438
|
if (!selectedUserId) return void 0;
|
|
@@ -41783,7 +42454,7 @@ function UserPicker({
|
|
|
41783
42454
|
},
|
|
41784
42455
|
[updateSelectedUserId, onSelectUser, usersById]
|
|
41785
42456
|
);
|
|
41786
|
-
return /* @__PURE__ */
|
|
42457
|
+
return /* @__PURE__ */ React328.createElement(
|
|
41787
42458
|
Combobox,
|
|
41788
42459
|
{
|
|
41789
42460
|
...rest,
|
|
@@ -41807,7 +42478,7 @@ function createUserMenuItem(user) {
|
|
|
41807
42478
|
return {
|
|
41808
42479
|
value: user.id,
|
|
41809
42480
|
title,
|
|
41810
|
-
icon: /* @__PURE__ */
|
|
42481
|
+
icon: /* @__PURE__ */ React328.createElement("div", { className: "n-relative n-w-[15px] n-h-[15px]" }, /* @__PURE__ */ React328.createElement(
|
|
41811
42482
|
Avatar,
|
|
41812
42483
|
{
|
|
41813
42484
|
size: 15 + overflow * 2,
|
|
@@ -41826,15 +42497,15 @@ function createUserMenuItem(user) {
|
|
|
41826
42497
|
}
|
|
41827
42498
|
|
|
41828
42499
|
// src/components/UserPointer.tsx
|
|
41829
|
-
import
|
|
41830
|
-
var UserPointerContainer =
|
|
42500
|
+
import React329, { memo as memo39, useMemo as useMemo95 } from "react";
|
|
42501
|
+
var UserPointerContainer = memo39(function UserPointerContainer2({
|
|
41831
42502
|
point,
|
|
41832
42503
|
visible,
|
|
41833
42504
|
children,
|
|
41834
42505
|
className,
|
|
41835
42506
|
style: style2
|
|
41836
42507
|
}) {
|
|
41837
|
-
return /* @__PURE__ */
|
|
42508
|
+
return /* @__PURE__ */ React329.createElement(
|
|
41838
42509
|
"div",
|
|
41839
42510
|
{
|
|
41840
42511
|
style: {
|
|
@@ -41853,7 +42524,7 @@ var UserPointerContainer = memo38(function UserPointerContainer2({
|
|
|
41853
42524
|
children
|
|
41854
42525
|
);
|
|
41855
42526
|
});
|
|
41856
|
-
var UserNameTag =
|
|
42527
|
+
var UserNameTag = memo39(function UserNameTag2({
|
|
41857
42528
|
backgroundColor,
|
|
41858
42529
|
className,
|
|
41859
42530
|
style: style2,
|
|
@@ -41862,7 +42533,7 @@ var UserNameTag = memo38(function UserNameTag2({
|
|
|
41862
42533
|
size: size4 = "medium",
|
|
41863
42534
|
bordered = true
|
|
41864
42535
|
}) {
|
|
41865
|
-
return /* @__PURE__ */
|
|
42536
|
+
return /* @__PURE__ */ React329.createElement(
|
|
41866
42537
|
"span",
|
|
41867
42538
|
{
|
|
41868
42539
|
className: cx(
|
|
@@ -41881,14 +42552,14 @@ var UserNameTag = memo38(function UserNameTag2({
|
|
|
41881
42552
|
children
|
|
41882
42553
|
);
|
|
41883
42554
|
});
|
|
41884
|
-
var UserPointerIcon =
|
|
42555
|
+
var UserPointerIcon = memo39(function PointerIcon({
|
|
41885
42556
|
size: size4,
|
|
41886
42557
|
color = "black",
|
|
41887
42558
|
className,
|
|
41888
42559
|
style: style2
|
|
41889
42560
|
}) {
|
|
41890
42561
|
const points = "0,5 10,0 10,10";
|
|
41891
|
-
return /* @__PURE__ */
|
|
42562
|
+
return /* @__PURE__ */ React329.createElement(
|
|
41892
42563
|
"svg",
|
|
41893
42564
|
{
|
|
41894
42565
|
width: size4,
|
|
@@ -41903,7 +42574,7 @@ var UserPointerIcon = memo38(function PointerIcon({
|
|
|
41903
42574
|
...style2
|
|
41904
42575
|
}
|
|
41905
42576
|
},
|
|
41906
|
-
/* @__PURE__ */
|
|
42577
|
+
/* @__PURE__ */ React329.createElement(
|
|
41907
42578
|
"polygon",
|
|
41908
42579
|
{
|
|
41909
42580
|
points,
|
|
@@ -41916,7 +42587,7 @@ var UserPointerIcon = memo38(function PointerIcon({
|
|
|
41916
42587
|
});
|
|
41917
42588
|
var POINTER_SIZE = 12;
|
|
41918
42589
|
var POINTER_OVERLAP = 6;
|
|
41919
|
-
var UserPointer =
|
|
42590
|
+
var UserPointer = memo39(function UserPointer2({
|
|
41920
42591
|
userId,
|
|
41921
42592
|
name,
|
|
41922
42593
|
visible = true,
|
|
@@ -41944,7 +42615,7 @@ var UserPointer = memo38(function UserPointer2({
|
|
|
41944
42615
|
() => ({ marginLeft: `${POINTER_SIZE - POINTER_OVERLAP + 1}px` }),
|
|
41945
42616
|
[]
|
|
41946
42617
|
);
|
|
41947
|
-
return /* @__PURE__ */
|
|
42618
|
+
return /* @__PURE__ */ React329.createElement(
|
|
41948
42619
|
UserPointerContainer,
|
|
41949
42620
|
{
|
|
41950
42621
|
point,
|
|
@@ -41952,14 +42623,14 @@ var UserPointer = memo38(function UserPointer2({
|
|
|
41952
42623
|
className,
|
|
41953
42624
|
style: style2
|
|
41954
42625
|
},
|
|
41955
|
-
name && /* @__PURE__ */
|
|
42626
|
+
name && /* @__PURE__ */ React329.createElement("div", { className: "n-relative" }, showPointerIcon && /* @__PURE__ */ React329.createElement(
|
|
41956
42627
|
UserPointerIcon,
|
|
41957
42628
|
{
|
|
41958
42629
|
size: POINTER_SIZE,
|
|
41959
42630
|
color: userBackgroundColor,
|
|
41960
42631
|
style: pointerOverlapStyle
|
|
41961
42632
|
}
|
|
41962
|
-
), /* @__PURE__ */
|
|
42633
|
+
), /* @__PURE__ */ React329.createElement(
|
|
41963
42634
|
UserNameTag,
|
|
41964
42635
|
{
|
|
41965
42636
|
backgroundColor: userBackgroundColor,
|
|
@@ -41975,7 +42646,7 @@ var UserPointer = memo38(function UserPointer2({
|
|
|
41975
42646
|
|
|
41976
42647
|
// src/components/workspace/WorkspaceLayout.tsx
|
|
41977
42648
|
import { useKeyboardShortcuts as useKeyboardShortcuts4 } from "@noya-app/noya-keymap";
|
|
41978
|
-
import
|
|
42649
|
+
import React337, {
|
|
41979
42650
|
memo as memo40,
|
|
41980
42651
|
useCallback as useCallback61,
|
|
41981
42652
|
useImperativeHandle as useImperativeHandle18,
|
|
@@ -41984,7 +42655,7 @@ import React336, {
|
|
|
41984
42655
|
} from "react";
|
|
41985
42656
|
|
|
41986
42657
|
// src/components/OverlayToolbar.tsx
|
|
41987
|
-
import
|
|
42658
|
+
import React330, { useCallback as useCallback57, useLayoutEffect as useLayoutEffect11, useMemo as useMemo96, useRef as useRef94 } from "react";
|
|
41988
42659
|
var panelClassName = "n-pointer-events-auto n-inline-flex n-items-center n-gap-toolbar-separator n-rounded-3xl n-border n-border-divider n-bg-sidebar-background n-px-3 n-py-2.5 n-shadow-2xl";
|
|
41989
42660
|
function OverlayToolbar({
|
|
41990
42661
|
left,
|
|
@@ -42064,7 +42735,7 @@ function OverlayToolbar({
|
|
|
42064
42735
|
}, [emitRects, hasLeft, hasRight, onRectsChange]);
|
|
42065
42736
|
const renderLeftPanel = (overlayId) => {
|
|
42066
42737
|
if (!left) return null;
|
|
42067
|
-
return /* @__PURE__ */
|
|
42738
|
+
return /* @__PURE__ */ React330.createElement(
|
|
42068
42739
|
"div",
|
|
42069
42740
|
{
|
|
42070
42741
|
ref: leftPanelRef,
|
|
@@ -42075,7 +42746,7 @@ function OverlayToolbar({
|
|
|
42075
42746
|
left
|
|
42076
42747
|
);
|
|
42077
42748
|
};
|
|
42078
|
-
return /* @__PURE__ */
|
|
42749
|
+
return /* @__PURE__ */ React330.createElement(React330.Fragment, null, resolvedLayout === "bottomCenterTopRight" ? /* @__PURE__ */ React330.createElement(
|
|
42079
42750
|
"div",
|
|
42080
42751
|
{
|
|
42081
42752
|
className: cx(
|
|
@@ -42084,7 +42755,7 @@ function OverlayToolbar({
|
|
|
42084
42755
|
)
|
|
42085
42756
|
},
|
|
42086
42757
|
renderLeftPanel("noya-toolbar-bottom-center")
|
|
42087
|
-
) : /* @__PURE__ */
|
|
42758
|
+
) : /* @__PURE__ */ React330.createElement(
|
|
42088
42759
|
"div",
|
|
42089
42760
|
{
|
|
42090
42761
|
className: cx(
|
|
@@ -42093,7 +42764,7 @@ function OverlayToolbar({
|
|
|
42093
42764
|
)
|
|
42094
42765
|
},
|
|
42095
42766
|
renderLeftPanel("noya-toolbar-top-left")
|
|
42096
|
-
), right && /* @__PURE__ */
|
|
42767
|
+
), right && /* @__PURE__ */ React330.createElement(
|
|
42097
42768
|
"div",
|
|
42098
42769
|
{
|
|
42099
42770
|
className: cx(
|
|
@@ -42101,7 +42772,7 @@ function OverlayToolbar({
|
|
|
42101
42772
|
className
|
|
42102
42773
|
)
|
|
42103
42774
|
},
|
|
42104
|
-
/* @__PURE__ */
|
|
42775
|
+
/* @__PURE__ */ React330.createElement(
|
|
42105
42776
|
"div",
|
|
42106
42777
|
{
|
|
42107
42778
|
ref: rightPanelRef,
|
|
@@ -42115,319 +42786,7 @@ function OverlayToolbar({
|
|
|
42115
42786
|
}
|
|
42116
42787
|
|
|
42117
42788
|
// src/components/workspace/DrawerWorkspaceLayout.tsx
|
|
42118
|
-
import
|
|
42119
|
-
|
|
42120
|
-
// src/components/AppToolbar.tsx
|
|
42121
|
-
import { useKeyboardShortcuts as useKeyboardShortcuts3 } from "@noya-app/noya-keymap";
|
|
42122
|
-
import React329, {
|
|
42123
|
-
createContext as createContext63,
|
|
42124
|
-
useContext as useContext63
|
|
42125
|
-
} from "react";
|
|
42126
|
-
|
|
42127
|
-
// src/components/ToolbarDrawer.tsx
|
|
42128
|
-
import React328, { forwardRef as forwardRef131, memo as memo39 } from "react";
|
|
42129
|
-
var ToolbarDrawer = memo39(
|
|
42130
|
-
forwardRef131(function ToolbarDrawer2({ children, trigger, sideOffset = 8 }, ref) {
|
|
42131
|
-
return /* @__PURE__ */ React328.createElement("div", { className: "n-relative", ref }, /* @__PURE__ */ React328.createElement(
|
|
42132
|
-
"div",
|
|
42133
|
-
{
|
|
42134
|
-
className: "n-absolute n-bottom-full n-left-1/2 -n-translate-x-1/2 n-rounded-t-lg n-border n-border-toolbar-drawer-border n-border-b-transparent n-bg-toolbar-drawer-background -n-z-10",
|
|
42135
|
-
style: {
|
|
42136
|
-
marginBottom: `${sideOffset}px`,
|
|
42137
|
-
boxShadow: "0px -2px 12px 0px var(--n-toolbar-drawer-shadow)"
|
|
42138
|
-
}
|
|
42139
|
-
},
|
|
42140
|
-
children
|
|
42141
|
-
), trigger);
|
|
42142
|
-
})
|
|
42143
|
-
);
|
|
42144
|
-
|
|
42145
|
-
// src/components/AppToolbar.tsx
|
|
42146
|
-
var SIDE_OFFSET = 6;
|
|
42147
|
-
var ToolbarMenuContext = createContext63({});
|
|
42148
|
-
var ToolbarMenuDropdown = memoGeneric(function ToolbarMenuDropdown2({
|
|
42149
|
-
item,
|
|
42150
|
-
onSelectMenuItem,
|
|
42151
|
-
onPopoverOpenChange
|
|
42152
|
-
}) {
|
|
42153
|
-
const [open, setOpen] = React329.useState(false);
|
|
42154
|
-
const handleOpenChange = React329.useCallback(
|
|
42155
|
-
(newOpen) => {
|
|
42156
|
-
setOpen(newOpen);
|
|
42157
|
-
onPopoverOpenChange?.(newOpen);
|
|
42158
|
-
},
|
|
42159
|
-
[onPopoverOpenChange]
|
|
42160
|
-
);
|
|
42161
|
-
return /* @__PURE__ */ React329.createElement(
|
|
42162
|
-
DropdownMenu,
|
|
42163
|
-
{
|
|
42164
|
-
open,
|
|
42165
|
-
onOpenChange: handleOpenChange,
|
|
42166
|
-
items: item.items,
|
|
42167
|
-
modal: false,
|
|
42168
|
-
onSelect: (value) => {
|
|
42169
|
-
if (onSelectMenuItem && value) {
|
|
42170
|
-
onSelectMenuItem(value);
|
|
42171
|
-
}
|
|
42172
|
-
}
|
|
42173
|
-
},
|
|
42174
|
-
/* @__PURE__ */ React329.createElement(
|
|
42175
|
-
Button,
|
|
42176
|
-
{
|
|
42177
|
-
disabled: item.disabled,
|
|
42178
|
-
active: item.checked || open,
|
|
42179
|
-
icon: item.icon,
|
|
42180
|
-
iconRight: item.icon === "DotsVerticalIcon" || item.icon === "DotsHorizontalIcon" ? void 0 : "DropdownChevronIcon"
|
|
42181
|
-
},
|
|
42182
|
-
item.title
|
|
42183
|
-
)
|
|
42184
|
-
);
|
|
42185
|
-
});
|
|
42186
|
-
var ToolbarShortcut = ({
|
|
42187
|
-
shortcut,
|
|
42188
|
-
label
|
|
42189
|
-
}) => {
|
|
42190
|
-
return /* @__PURE__ */ React329.createElement("div", { className: "n-flex n-items-center" }, label, /* @__PURE__ */ React329.createElement(Spacer.Horizontal, { size: 6 }), /* @__PURE__ */ React329.createElement(KeyboardShortcut, { shortcut }));
|
|
42191
|
-
};
|
|
42192
|
-
var ToolbarMenuPopover = memoGeneric(function ToolbarMenuPopover2({
|
|
42193
|
-
item,
|
|
42194
|
-
portalContainer,
|
|
42195
|
-
onPopoverOpenChange
|
|
42196
|
-
}) {
|
|
42197
|
-
const {
|
|
42198
|
-
disabled: disabled2,
|
|
42199
|
-
icon,
|
|
42200
|
-
title,
|
|
42201
|
-
tooltip,
|
|
42202
|
-
content: itemContent,
|
|
42203
|
-
checked,
|
|
42204
|
-
popoverClassName,
|
|
42205
|
-
triggerProps: buttonProps
|
|
42206
|
-
} = item;
|
|
42207
|
-
const [open, setOpen] = React329.useState(false);
|
|
42208
|
-
const handleOpenChange = React329.useCallback(
|
|
42209
|
-
(newOpen) => {
|
|
42210
|
-
setOpen(newOpen);
|
|
42211
|
-
onPopoverOpenChange?.(newOpen);
|
|
42212
|
-
},
|
|
42213
|
-
[onPopoverOpenChange]
|
|
42214
|
-
);
|
|
42215
|
-
const { useDialogOnSmallScreen, isSmallScreen, openDialog } = useContext63(ToolbarMenuContext);
|
|
42216
|
-
const shouldUseDialog = useDialogOnSmallScreen && isSmallScreen && openDialog;
|
|
42217
|
-
const handleOpenDialog = React329.useCallback(() => {
|
|
42218
|
-
if (!openDialog) return;
|
|
42219
|
-
handleOpenChange(true);
|
|
42220
|
-
const dialogContent = typeof itemContent === "function" ? (props) => /* @__PURE__ */ React329.createElement("div", { className: "-n-m-3" }, itemContent(props)) : /* @__PURE__ */ React329.createElement("div", { className: "-n-m-3" }, itemContent);
|
|
42221
|
-
const dialog = openDialog({
|
|
42222
|
-
title,
|
|
42223
|
-
children: dialogContent
|
|
42224
|
-
});
|
|
42225
|
-
dialog.then(() => handleOpenChange(false));
|
|
42226
|
-
}, [openDialog, itemContent, title, handleOpenChange]);
|
|
42227
|
-
const trigger = /* @__PURE__ */ React329.createElement(
|
|
42228
|
-
Button,
|
|
42229
|
-
{
|
|
42230
|
-
disabled: disabled2,
|
|
42231
|
-
active: checked || open,
|
|
42232
|
-
icon,
|
|
42233
|
-
iconRight: "DropdownChevronIcon",
|
|
42234
|
-
onClick: shouldUseDialog ? handleOpenDialog : void 0,
|
|
42235
|
-
...buttonProps
|
|
42236
|
-
},
|
|
42237
|
-
title
|
|
42238
|
-
);
|
|
42239
|
-
if (shouldUseDialog) {
|
|
42240
|
-
return tooltip && !open ? /* @__PURE__ */ React329.createElement(
|
|
42241
|
-
Tooltip,
|
|
42242
|
-
{
|
|
42243
|
-
sideOffset: SIDE_OFFSET,
|
|
42244
|
-
side: "top",
|
|
42245
|
-
content: tooltip,
|
|
42246
|
-
portalContainer
|
|
42247
|
-
},
|
|
42248
|
-
trigger
|
|
42249
|
-
) : trigger;
|
|
42250
|
-
}
|
|
42251
|
-
const content = /* @__PURE__ */ React329.createElement("span", null, /* @__PURE__ */ React329.createElement(
|
|
42252
|
-
Popover,
|
|
42253
|
-
{
|
|
42254
|
-
open,
|
|
42255
|
-
onOpenChange: handleOpenChange,
|
|
42256
|
-
side: "top",
|
|
42257
|
-
showArrow: false,
|
|
42258
|
-
sideOffset: SIDE_OFFSET,
|
|
42259
|
-
portalContainer,
|
|
42260
|
-
trigger,
|
|
42261
|
-
className: popoverClassName
|
|
42262
|
-
},
|
|
42263
|
-
typeof itemContent === "function" ? itemContent({ close: () => handleOpenChange(false) }) : itemContent
|
|
42264
|
-
));
|
|
42265
|
-
return tooltip && !open ? /* @__PURE__ */ React329.createElement(
|
|
42266
|
-
Tooltip,
|
|
42267
|
-
{
|
|
42268
|
-
sideOffset: SIDE_OFFSET,
|
|
42269
|
-
side: "top",
|
|
42270
|
-
content: tooltip,
|
|
42271
|
-
portalContainer
|
|
42272
|
-
},
|
|
42273
|
-
content
|
|
42274
|
-
) : content;
|
|
42275
|
-
});
|
|
42276
|
-
var ToolbarMenuButton = memoGeneric(function ToolbarMenuButton2({
|
|
42277
|
-
item,
|
|
42278
|
-
onSelectMenuItem,
|
|
42279
|
-
as,
|
|
42280
|
-
activeValue,
|
|
42281
|
-
tooltipSide,
|
|
42282
|
-
displayFilter
|
|
42283
|
-
}) {
|
|
42284
|
-
const isActive = item.checked || activeValue === item.value;
|
|
42285
|
-
const content = /* @__PURE__ */ React329.createElement(
|
|
42286
|
-
Button,
|
|
42287
|
-
{
|
|
42288
|
-
as,
|
|
42289
|
-
disabled: item.disabled,
|
|
42290
|
-
active: isActive,
|
|
42291
|
-
icon: displayFilter === "textOnly" ? void 0 : item.icon,
|
|
42292
|
-
...as === "a" && { href: item.value },
|
|
42293
|
-
onClick: () => {
|
|
42294
|
-
if (onSelectMenuItem && item.value) {
|
|
42295
|
-
onSelectMenuItem(item.value);
|
|
42296
|
-
}
|
|
42297
|
-
}
|
|
42298
|
-
},
|
|
42299
|
-
displayFilter === "iconOnly" ? void 0 : item.title
|
|
42300
|
-
);
|
|
42301
|
-
const tooltip = item.tooltip ?? (displayFilter === "iconOnly" && item.title ? item.title : void 0);
|
|
42302
|
-
return item.drawer && isActive ? /* @__PURE__ */ React329.createElement(ToolbarDrawer, { trigger: content }, item.drawer) : tooltip ? /* @__PURE__ */ React329.createElement(Tooltip, { sideOffset: SIDE_OFFSET, content: tooltip, side: tooltipSide }, content) : content;
|
|
42303
|
-
});
|
|
42304
|
-
var ToolbarMenuItem = memoGeneric(function ToolbarMenuItem2({
|
|
42305
|
-
item,
|
|
42306
|
-
onSelectMenuItem,
|
|
42307
|
-
buttonAs,
|
|
42308
|
-
activeValue,
|
|
42309
|
-
tooltipSide,
|
|
42310
|
-
portalContainer,
|
|
42311
|
-
displayFilter,
|
|
42312
|
-
dividerOverflow: dividerOverflowProp,
|
|
42313
|
-
onPopoverOpenChange
|
|
42314
|
-
}) {
|
|
42315
|
-
const { dividerOverflow: contextDividerOverflow } = useContext63(ToolbarMenuContext);
|
|
42316
|
-
const dividerOverflow = dividerOverflowProp ?? contextDividerOverflow ?? 4;
|
|
42317
|
-
if (item.type === "sectionHeader") return null;
|
|
42318
|
-
if (item.type === "separator") {
|
|
42319
|
-
return /* @__PURE__ */ React329.createElement(DividerVertical, { overflow: dividerOverflow });
|
|
42320
|
-
}
|
|
42321
|
-
if (item.type === "popover") {
|
|
42322
|
-
return /* @__PURE__ */ React329.createElement(
|
|
42323
|
-
ToolbarMenuPopover,
|
|
42324
|
-
{
|
|
42325
|
-
item,
|
|
42326
|
-
portalContainer,
|
|
42327
|
-
onPopoverOpenChange
|
|
42328
|
-
}
|
|
42329
|
-
);
|
|
42330
|
-
}
|
|
42331
|
-
if (isSelectableMenuItem(item)) {
|
|
42332
|
-
return /* @__PURE__ */ React329.createElement(
|
|
42333
|
-
ToolbarMenuButton,
|
|
42334
|
-
{
|
|
42335
|
-
item,
|
|
42336
|
-
onSelectMenuItem,
|
|
42337
|
-
as: buttonAs,
|
|
42338
|
-
activeValue,
|
|
42339
|
-
tooltipSide,
|
|
42340
|
-
displayFilter
|
|
42341
|
-
}
|
|
42342
|
-
);
|
|
42343
|
-
}
|
|
42344
|
-
return /* @__PURE__ */ React329.createElement(
|
|
42345
|
-
ToolbarMenuDropdown,
|
|
42346
|
-
{
|
|
42347
|
-
item,
|
|
42348
|
-
onSelectMenuItem,
|
|
42349
|
-
onPopoverOpenChange
|
|
42350
|
-
}
|
|
42351
|
-
);
|
|
42352
|
-
});
|
|
42353
|
-
var ToolbarMenu = memoGeneric(function ToolbarMenu2({
|
|
42354
|
-
items,
|
|
42355
|
-
onSelectMenuItem,
|
|
42356
|
-
buttonAs,
|
|
42357
|
-
activeValue,
|
|
42358
|
-
tooltipSide,
|
|
42359
|
-
portalContainer,
|
|
42360
|
-
displayFilter = "iconAndText",
|
|
42361
|
-
dividerOverflow,
|
|
42362
|
-
onPopoverOpenChange
|
|
42363
|
-
}) {
|
|
42364
|
-
return /* @__PURE__ */ React329.createElement(React329.Fragment, null, items.map((item, i) => {
|
|
42365
|
-
return /* @__PURE__ */ React329.createElement(
|
|
42366
|
-
ToolbarMenuItem,
|
|
42367
|
-
{
|
|
42368
|
-
key: i,
|
|
42369
|
-
item,
|
|
42370
|
-
onSelectMenuItem,
|
|
42371
|
-
buttonAs,
|
|
42372
|
-
activeValue,
|
|
42373
|
-
tooltipSide,
|
|
42374
|
-
portalContainer,
|
|
42375
|
-
displayFilter,
|
|
42376
|
-
dividerOverflow,
|
|
42377
|
-
onPopoverOpenChange
|
|
42378
|
-
}
|
|
42379
|
-
);
|
|
42380
|
-
}));
|
|
42381
|
-
});
|
|
42382
|
-
function useBindKeyboardShortcutsForMenuItems(items, onSelectMenuItem) {
|
|
42383
|
-
return useKeyboardShortcuts3(
|
|
42384
|
-
React329.useMemo(
|
|
42385
|
-
() => onSelectMenuItem ? getKeyboardShortcutsForMenuItems(items, onSelectMenuItem) : {},
|
|
42386
|
-
[items, onSelectMenuItem]
|
|
42387
|
-
)
|
|
42388
|
-
);
|
|
42389
|
-
}
|
|
42390
|
-
function AppToolbar({
|
|
42391
|
-
children,
|
|
42392
|
-
logo,
|
|
42393
|
-
leftMenuItems = [],
|
|
42394
|
-
rightMenuItems = [],
|
|
42395
|
-
onSelectMenuItem,
|
|
42396
|
-
shouldBindKeyboardShortcuts = true,
|
|
42397
|
-
dividerOverflow
|
|
42398
|
-
}) {
|
|
42399
|
-
const allMenuItems = React329.useMemo(
|
|
42400
|
-
() => [...leftMenuItems, ...rightMenuItems],
|
|
42401
|
-
[leftMenuItems, rightMenuItems]
|
|
42402
|
-
);
|
|
42403
|
-
useBindKeyboardShortcutsForMenuItems(
|
|
42404
|
-
allMenuItems,
|
|
42405
|
-
shouldBindKeyboardShortcuts ? onSelectMenuItem : void 0
|
|
42406
|
-
);
|
|
42407
|
-
return /* @__PURE__ */ React329.createElement(
|
|
42408
|
-
BaseToolbar,
|
|
42409
|
-
{
|
|
42410
|
-
logo,
|
|
42411
|
-
left: leftMenuItems.length > 0 && /* @__PURE__ */ React329.createElement("div", { className: "n-flex n-gap-2" }, /* @__PURE__ */ React329.createElement(
|
|
42412
|
-
ToolbarMenu,
|
|
42413
|
-
{
|
|
42414
|
-
items: leftMenuItems,
|
|
42415
|
-
onSelectMenuItem,
|
|
42416
|
-
dividerOverflow
|
|
42417
|
-
}
|
|
42418
|
-
)),
|
|
42419
|
-
right: rightMenuItems.length > 0 && /* @__PURE__ */ React329.createElement("div", { className: "n-flex n-gap-2" }, /* @__PURE__ */ React329.createElement(
|
|
42420
|
-
ToolbarMenu,
|
|
42421
|
-
{
|
|
42422
|
-
items: rightMenuItems,
|
|
42423
|
-
onSelectMenuItem,
|
|
42424
|
-
dividerOverflow
|
|
42425
|
-
}
|
|
42426
|
-
))
|
|
42427
|
-
},
|
|
42428
|
-
children
|
|
42429
|
-
);
|
|
42430
|
-
}
|
|
42789
|
+
import React331, { useMemo as useMemo97, useState as useState79 } from "react";
|
|
42431
42790
|
|
|
42432
42791
|
// src/components/workspace/constants.ts
|
|
42433
42792
|
var EDITOR_PANEL_GROUP_ID = "editor-panel-group";
|
|
@@ -42450,11 +42809,11 @@ var DrawerWorkspaceLayout = memoGeneric(function DrawerWorkspaceLayout2({
|
|
|
42450
42809
|
onChangeLeftTab,
|
|
42451
42810
|
compactDrawerMenu
|
|
42452
42811
|
}) {
|
|
42453
|
-
const [{ leftSidebarCollapsed, rightSidebarCollapsed }, setLayoutState] =
|
|
42812
|
+
const [{ leftSidebarCollapsed, rightSidebarCollapsed }, setLayoutState] = useState79({
|
|
42454
42813
|
leftSidebarCollapsed: true,
|
|
42455
42814
|
rightSidebarCollapsed: true
|
|
42456
42815
|
});
|
|
42457
|
-
|
|
42816
|
+
React331.useImperativeHandle(
|
|
42458
42817
|
leftSidebarRef,
|
|
42459
42818
|
() => ({
|
|
42460
42819
|
expand: () => setLayoutState((prev) => ({
|
|
@@ -42467,7 +42826,7 @@ var DrawerWorkspaceLayout = memoGeneric(function DrawerWorkspaceLayout2({
|
|
|
42467
42826
|
}),
|
|
42468
42827
|
[leftSidebarCollapsed]
|
|
42469
42828
|
);
|
|
42470
|
-
|
|
42829
|
+
React331.useImperativeHandle(
|
|
42471
42830
|
rightSidebarRef,
|
|
42472
42831
|
() => ({
|
|
42473
42832
|
expand: () => setLayoutState((prev) => ({
|
|
@@ -42540,13 +42899,13 @@ var DrawerWorkspaceLayout = memoGeneric(function DrawerWorkspaceLayout2({
|
|
|
42540
42899
|
})),
|
|
42541
42900
|
[allSelectableTabItems, activeTabValue]
|
|
42542
42901
|
);
|
|
42543
|
-
return /* @__PURE__ */
|
|
42902
|
+
return /* @__PURE__ */ React331.createElement(
|
|
42544
42903
|
"div",
|
|
42545
42904
|
{
|
|
42546
42905
|
id: EDITOR_PANEL_GROUP_ID,
|
|
42547
42906
|
className: "n-flex n-flex-col n-flex-1 n-relative focus:n-outline-none"
|
|
42548
42907
|
},
|
|
42549
|
-
hasTabs && !compactTabItem && /* @__PURE__ */
|
|
42908
|
+
hasTabs && !compactTabItem && /* @__PURE__ */ React331.createElement(React331.Fragment, null, /* @__PURE__ */ React331.createElement(
|
|
42550
42909
|
"div",
|
|
42551
42910
|
{
|
|
42552
42911
|
className: "n-flex n-flex-row n-items-center n-gap-1 n-px-2 n-py-1.5 n-bg-sidebar-background n-flex-none",
|
|
@@ -42555,15 +42914,15 @@ var DrawerWorkspaceLayout = memoGeneric(function DrawerWorkspaceLayout2({
|
|
|
42555
42914
|
[cssVarNames.colors.buttonBackground]: "transparent"
|
|
42556
42915
|
}
|
|
42557
42916
|
},
|
|
42558
|
-
/* @__PURE__ */
|
|
42917
|
+
/* @__PURE__ */ React331.createElement(
|
|
42559
42918
|
ToolbarMenu,
|
|
42560
42919
|
{
|
|
42561
42920
|
items: toolbarMenuItems,
|
|
42562
42921
|
onSelectMenuItem: handleSelectTab
|
|
42563
42922
|
}
|
|
42564
42923
|
)
|
|
42565
|
-
), /* @__PURE__ */
|
|
42566
|
-
compactTabItem && /* @__PURE__ */
|
|
42924
|
+
), /* @__PURE__ */ React331.createElement(Divider, null)),
|
|
42925
|
+
compactTabItem && /* @__PURE__ */ React331.createElement("div", { className: "n-absolute n-top-0 n-left-0 n-h-[calc(var(--n-toolbar-height)+1px)] n-w-[calc(var(--n-toolbar-height)+1px)] n-bg-sidebar-background n-border-b n-border-divider-strong n-z-10 n-flex n-items-center n-justify-center" }, /* @__PURE__ */ React331.createElement(
|
|
42567
42926
|
Button,
|
|
42568
42927
|
{
|
|
42569
42928
|
"aria-label": typeof compactTabItem.title === "string" ? compactTabItem.title : "Toggle sidebar",
|
|
@@ -42579,17 +42938,17 @@ var DrawerWorkspaceLayout = memoGeneric(function DrawerWorkspaceLayout2({
|
|
|
42579
42938
|
onClick: () => handleSelectTab(compactTabItem.value)
|
|
42580
42939
|
}
|
|
42581
42940
|
)),
|
|
42582
|
-
/* @__PURE__ */
|
|
42941
|
+
/* @__PURE__ */ React331.createElement("div", { className: "n-flex-1 n-flex n-flex-col n-relative n-min-h-0" }, isDrawerOpen && /* @__PURE__ */ React331.createElement("div", { className: "n-absolute n-inset-0 n-z-20 n-flex n-flex-col" }, /* @__PURE__ */ React331.createElement("div", { className: "n-relative n-flex-1 n-min-h-0 n-overflow-auto n-bg-sidebar-background n-border-b n-border-divider-strong n-shadow-lg" }, activeDrawerPanel)), /* @__PURE__ */ React331.createElement("div", { className: "n-z-0 n-flex-1 n-flex n-relative n-min-h-0" }, centerPanel))
|
|
42583
42942
|
);
|
|
42584
42943
|
});
|
|
42585
42944
|
|
|
42586
42945
|
// src/components/workspace/PanelWorkspaceLayout.tsx
|
|
42587
|
-
import
|
|
42946
|
+
import React336, { useCallback as useCallback60, useMemo as useMemo99, useRef as useRef97, useState as useState81 } from "react";
|
|
42588
42947
|
|
|
42589
42948
|
// src/components/resizablePanels/Panel.tsx
|
|
42590
|
-
import
|
|
42949
|
+
import React332, {
|
|
42591
42950
|
forwardRef as forwardRef132,
|
|
42592
|
-
useEffect as
|
|
42951
|
+
useEffect as useEffect57,
|
|
42593
42952
|
useId as useId5,
|
|
42594
42953
|
useImperativeHandle as useImperativeHandle16
|
|
42595
42954
|
} from "react";
|
|
@@ -42631,7 +42990,7 @@ var Panel = forwardRef132(
|
|
|
42631
42990
|
collapsePanel,
|
|
42632
42991
|
isPanelExpanded
|
|
42633
42992
|
} = context;
|
|
42634
|
-
|
|
42993
|
+
useEffect57(() => {
|
|
42635
42994
|
registerPanel({
|
|
42636
42995
|
id,
|
|
42637
42996
|
order,
|
|
@@ -42670,7 +43029,7 @@ var Panel = forwardRef132(
|
|
|
42670
43029
|
if (size4 === 0 && !isFlexPanel) {
|
|
42671
43030
|
return null;
|
|
42672
43031
|
}
|
|
42673
|
-
return /* @__PURE__ */
|
|
43032
|
+
return /* @__PURE__ */ React332.createElement(
|
|
42674
43033
|
"div",
|
|
42675
43034
|
{
|
|
42676
43035
|
"data-panel-id": id,
|
|
@@ -42685,14 +43044,14 @@ var Panel = forwardRef132(
|
|
|
42685
43044
|
);
|
|
42686
43045
|
|
|
42687
43046
|
// src/components/resizablePanels/PanelGroup.tsx
|
|
42688
|
-
import
|
|
43047
|
+
import React333, {
|
|
42689
43048
|
forwardRef as forwardRef133,
|
|
42690
43049
|
useCallback as useCallback58,
|
|
42691
|
-
useEffect as
|
|
43050
|
+
useEffect as useEffect58,
|
|
42692
43051
|
useImperativeHandle as useImperativeHandle17,
|
|
42693
43052
|
useMemo as useMemo98,
|
|
42694
43053
|
useRef as useRef95,
|
|
42695
|
-
useState as
|
|
43054
|
+
useState as useState80
|
|
42696
43055
|
} from "react";
|
|
42697
43056
|
function getStorageKey(autoSaveId) {
|
|
42698
43057
|
return `noya-panels:${autoSaveId}`;
|
|
@@ -42716,10 +43075,10 @@ var PanelGroup = forwardRef133(
|
|
|
42716
43075
|
const containerRef = useRef95(null);
|
|
42717
43076
|
const containerSize = useSize(containerRef);
|
|
42718
43077
|
const containerWidth = containerSize?.width ?? 0;
|
|
42719
|
-
const [panels, setPanels] =
|
|
43078
|
+
const [panels, setPanels] = useState80(/* @__PURE__ */ new Map());
|
|
42720
43079
|
const panelsRef = useRef95(panels);
|
|
42721
43080
|
panelsRef.current = panels;
|
|
42722
|
-
const [resizing, setResizing] =
|
|
43081
|
+
const [resizing, setResizing] = useState80(null);
|
|
42723
43082
|
const sortedPanels = useMemo98(() => {
|
|
42724
43083
|
return Array.from(panels.values()).sort((a, b) => a.order - b.order);
|
|
42725
43084
|
}, [panels]);
|
|
@@ -42756,12 +43115,12 @@ var PanelGroup = forwardRef133(
|
|
|
42756
43115
|
},
|
|
42757
43116
|
[]
|
|
42758
43117
|
);
|
|
42759
|
-
|
|
43118
|
+
useEffect58(() => {
|
|
42760
43119
|
if (containerWidth > 0 && panels.size > 0) {
|
|
42761
43120
|
setPanels((prev) => calculateLayout(prev, containerWidth));
|
|
42762
43121
|
}
|
|
42763
43122
|
}, [containerWidth, calculateLayout, panels.size]);
|
|
42764
|
-
|
|
43123
|
+
useEffect58(() => {
|
|
42765
43124
|
if (onLayout && sortedPanels.length > 0) {
|
|
42766
43125
|
const sizes = sortedPanels.map((p) => p.collapsed ? 0 : p.size);
|
|
42767
43126
|
onLayout(sizes);
|
|
@@ -42906,7 +43265,7 @@ var PanelGroup = forwardRef133(
|
|
|
42906
43265
|
},
|
|
42907
43266
|
[sortedPanels]
|
|
42908
43267
|
);
|
|
42909
|
-
|
|
43268
|
+
useEffect58(() => {
|
|
42910
43269
|
if (!resizing) return;
|
|
42911
43270
|
const handleMouseMove = (e) => {
|
|
42912
43271
|
const delta = e.clientX - resizing.startX;
|
|
@@ -43039,7 +43398,7 @@ var PanelGroup = forwardRef133(
|
|
|
43039
43398
|
containerWidth
|
|
43040
43399
|
]
|
|
43041
43400
|
);
|
|
43042
|
-
return /* @__PURE__ */
|
|
43401
|
+
return /* @__PURE__ */ React333.createElement(PanelGroupContext.Provider, { value: contextValue }, /* @__PURE__ */ React333.createElement(
|
|
43043
43402
|
"div",
|
|
43044
43403
|
{
|
|
43045
43404
|
ref: containerRef,
|
|
@@ -43057,7 +43416,7 @@ var PanelGroup = forwardRef133(
|
|
|
43057
43416
|
);
|
|
43058
43417
|
|
|
43059
43418
|
// src/components/resizablePanels/PanelResizeHandle.tsx
|
|
43060
|
-
import
|
|
43419
|
+
import React334, { useCallback as useCallback59, useContext as useContext65, useRef as useRef96 } from "react";
|
|
43061
43420
|
function PanelResizeHandle({
|
|
43062
43421
|
className,
|
|
43063
43422
|
disabled: disabled2,
|
|
@@ -43076,7 +43435,7 @@ function PanelResizeHandle({
|
|
|
43076
43435
|
if (!context) {
|
|
43077
43436
|
return null;
|
|
43078
43437
|
}
|
|
43079
|
-
return /* @__PURE__ */
|
|
43438
|
+
return /* @__PURE__ */ React334.createElement(
|
|
43080
43439
|
"div",
|
|
43081
43440
|
{
|
|
43082
43441
|
ref: handleRef,
|
|
@@ -43089,7 +43448,7 @@ function PanelResizeHandle({
|
|
|
43089
43448
|
zIndex: 10
|
|
43090
43449
|
}
|
|
43091
43450
|
},
|
|
43092
|
-
/* @__PURE__ */
|
|
43451
|
+
/* @__PURE__ */ React334.createElement(
|
|
43093
43452
|
"div",
|
|
43094
43453
|
{
|
|
43095
43454
|
style: {
|
|
@@ -43106,13 +43465,13 @@ function PanelResizeHandle({
|
|
|
43106
43465
|
}
|
|
43107
43466
|
|
|
43108
43467
|
// src/components/workspace/HorizontalTabBar.tsx
|
|
43109
|
-
import
|
|
43468
|
+
import React335 from "react";
|
|
43110
43469
|
var HorizontalTabBar = memoGeneric(function HorizontalTabBar2({ items, activeValue, onChange }) {
|
|
43111
43470
|
const selectableItems = items.filter(isSelectableMenuItem);
|
|
43112
43471
|
if (selectableItems.length <= 1) {
|
|
43113
43472
|
return null;
|
|
43114
43473
|
}
|
|
43115
|
-
return /* @__PURE__ */
|
|
43474
|
+
return /* @__PURE__ */ React335.createElement("div", { className: "n-flex n-flex-col n-bg-sidebar-background n-flex-none" }, /* @__PURE__ */ React335.createElement("div", { className: "n-flex n-flex-row n-px-3 n-py-3" }, /* @__PURE__ */ React335.createElement(
|
|
43116
43475
|
SegmentedControl,
|
|
43117
43476
|
{
|
|
43118
43477
|
enableCompactMode: true,
|
|
@@ -43157,10 +43516,10 @@ var PanelWorkspaceLayout = memoGeneric(function PanelWorkspaceLayout2({
|
|
|
43157
43516
|
if (!shouldAutoSave) return void 0;
|
|
43158
43517
|
return autoSavePrefix ? `${autoSavePrefix}--v5--${EDITOR_PANEL_GROUP_ID}` : Math.random().toString(36).substring(2, 15);
|
|
43159
43518
|
}, [autoSavePrefix, shouldAutoSave]);
|
|
43160
|
-
const [leftSidebarCollapsed, setLeftSidebarCollapsed] =
|
|
43519
|
+
const [leftSidebarCollapsed, setLeftSidebarCollapsed] = useState81(
|
|
43161
43520
|
leftSidebarOptions.defaultCollapsed ?? false
|
|
43162
43521
|
);
|
|
43163
|
-
const [rightSidebarCollapsed, setRightSidebarCollapsed] =
|
|
43522
|
+
const [rightSidebarCollapsed, setRightSidebarCollapsed] = useState81(
|
|
43164
43523
|
rightSidebarOptions.defaultCollapsed ?? false
|
|
43165
43524
|
);
|
|
43166
43525
|
const prevLeftSidebarState = useRef97(null);
|
|
@@ -43231,7 +43590,7 @@ var PanelWorkspaceLayout = memoGeneric(function PanelWorkspaceLayout2({
|
|
|
43231
43590
|
[onChangeRightTab, rightSidebarRef, rightTabValue]
|
|
43232
43591
|
);
|
|
43233
43592
|
const showLeftTabs = !!leftSidebarOptions.showTabs && !!leftTabItems;
|
|
43234
|
-
return /* @__PURE__ */
|
|
43593
|
+
return /* @__PURE__ */ React336.createElement("div", { ref: containerRef, className: "n-flex n-flex-1" }, /* @__PURE__ */ React336.createElement(
|
|
43235
43594
|
PanelGroup,
|
|
43236
43595
|
{
|
|
43237
43596
|
ref: panelGroupRef,
|
|
@@ -43241,7 +43600,7 @@ var PanelWorkspaceLayout = memoGeneric(function PanelWorkspaceLayout2({
|
|
|
43241
43600
|
autoSaveId,
|
|
43242
43601
|
onLayout: handleLayoutChange
|
|
43243
43602
|
},
|
|
43244
|
-
leftPanel && /* @__PURE__ */
|
|
43603
|
+
leftPanel && /* @__PURE__ */ React336.createElement(React336.Fragment, null, /* @__PURE__ */ React336.createElement(
|
|
43245
43604
|
Panel,
|
|
43246
43605
|
{
|
|
43247
43606
|
id: LEFT_SIDEBAR_ID,
|
|
@@ -43254,22 +43613,22 @@ var PanelWorkspaceLayout = memoGeneric(function PanelWorkspaceLayout2({
|
|
|
43254
43613
|
collapsible: true,
|
|
43255
43614
|
defaultCollapsed: leftSidebarOptions.defaultCollapsed
|
|
43256
43615
|
},
|
|
43257
|
-
leftSidebarCollapsed ? null : /* @__PURE__ */
|
|
43616
|
+
leftSidebarCollapsed ? null : /* @__PURE__ */ React336.createElement("div", { className: "n-flex n-flex-col n-h-full" }, showLeftTabs && /* @__PURE__ */ React336.createElement(
|
|
43258
43617
|
HorizontalTabBar,
|
|
43259
43618
|
{
|
|
43260
43619
|
items: leftTabItems,
|
|
43261
43620
|
activeValue: leftTabValue,
|
|
43262
43621
|
onChange: handleLeftTabChange
|
|
43263
43622
|
}
|
|
43264
|
-
), /* @__PURE__ */
|
|
43265
|
-
), /* @__PURE__ */
|
|
43623
|
+
), /* @__PURE__ */ React336.createElement("div", { className: "n-flex-1 n-relative n-min-h-0" }, leftPanel))
|
|
43624
|
+
), /* @__PURE__ */ React336.createElement(
|
|
43266
43625
|
PanelResizeHandle,
|
|
43267
43626
|
{
|
|
43268
43627
|
index: 0,
|
|
43269
43628
|
className: `n-cursor-col-resize n-w-px n-h-full ${leftSidebarCollapsed ? "" : "n-bg-divider"}`
|
|
43270
43629
|
}
|
|
43271
43630
|
)),
|
|
43272
|
-
/* @__PURE__ */
|
|
43631
|
+
/* @__PURE__ */ React336.createElement(
|
|
43273
43632
|
Panel,
|
|
43274
43633
|
{
|
|
43275
43634
|
id: CONTENT_AREA_ID,
|
|
@@ -43278,13 +43637,13 @@ var PanelWorkspaceLayout = memoGeneric(function PanelWorkspaceLayout2({
|
|
|
43278
43637
|
},
|
|
43279
43638
|
centerPanel
|
|
43280
43639
|
),
|
|
43281
|
-
rightPanel && /* @__PURE__ */
|
|
43640
|
+
rightPanel && /* @__PURE__ */ React336.createElement(React336.Fragment, null, /* @__PURE__ */ React336.createElement(
|
|
43282
43641
|
PanelResizeHandle,
|
|
43283
43642
|
{
|
|
43284
43643
|
index: 1,
|
|
43285
43644
|
className: `n-cursor-col-resize n-w-px n-h-full ${rightSidebarCollapsed ? "" : "n-bg-divider"}`
|
|
43286
43645
|
}
|
|
43287
|
-
), /* @__PURE__ */
|
|
43646
|
+
), /* @__PURE__ */ React336.createElement(
|
|
43288
43647
|
Panel,
|
|
43289
43648
|
{
|
|
43290
43649
|
id: RIGHT_SIDEBAR_ID,
|
|
@@ -43297,14 +43656,14 @@ var PanelWorkspaceLayout = memoGeneric(function PanelWorkspaceLayout2({
|
|
|
43297
43656
|
collapsible: true,
|
|
43298
43657
|
defaultCollapsed: rightSidebarOptions.defaultCollapsed
|
|
43299
43658
|
},
|
|
43300
|
-
rightSidebarCollapsed ? null : /* @__PURE__ */
|
|
43659
|
+
rightSidebarCollapsed ? null : /* @__PURE__ */ React336.createElement("div", { className: "n-flex n-flex-col n-h-full" }, rightSidebarOptions.showTabs && rightTabItems && /* @__PURE__ */ React336.createElement(
|
|
43301
43660
|
HorizontalTabBar,
|
|
43302
43661
|
{
|
|
43303
43662
|
items: rightTabItems,
|
|
43304
43663
|
activeValue: rightTabValue,
|
|
43305
43664
|
onChange: handleRightTabChange
|
|
43306
43665
|
}
|
|
43307
|
-
), /* @__PURE__ */
|
|
43666
|
+
), /* @__PURE__ */ React336.createElement("div", { className: "n-flex-1 n-relative n-min-h-0" }, rightPanel))
|
|
43308
43667
|
))
|
|
43309
43668
|
));
|
|
43310
43669
|
});
|
|
@@ -43394,7 +43753,7 @@ var WorkspaceLayout = forwardRefGeneric(function WorkspaceLayout2({
|
|
|
43394
43753
|
onRightSidebarStateChange,
|
|
43395
43754
|
shouldAutoSave
|
|
43396
43755
|
}, forwardedRef) {
|
|
43397
|
-
const containerRef =
|
|
43756
|
+
const containerRef = React337.useRef(null);
|
|
43398
43757
|
const containerSize = useSize(containerRef);
|
|
43399
43758
|
const windowSize = useWindowSize();
|
|
43400
43759
|
const parentSize = detectSize === "window" ? windowSize : containerSize && containerSize.width > 0 ? containerSize : windowSize;
|
|
@@ -43511,23 +43870,23 @@ var WorkspaceLayout = forwardRefGeneric(function WorkspaceLayout2({
|
|
|
43511
43870
|
closeSidebar: closeRightSidebar
|
|
43512
43871
|
};
|
|
43513
43872
|
}, [closeRightSidebar]);
|
|
43514
|
-
const leftPanel = left && leftVisible !== false ? /* @__PURE__ */
|
|
43873
|
+
const leftPanel = left && leftVisible !== false ? /* @__PURE__ */ React337.createElement(
|
|
43515
43874
|
PanelInner,
|
|
43516
43875
|
{
|
|
43517
43876
|
style: leftStyle,
|
|
43518
43877
|
className: cx("n-bg-sidebar-background n-flex-col", leftClassName)
|
|
43519
43878
|
},
|
|
43520
|
-
/* @__PURE__ */
|
|
43879
|
+
/* @__PURE__ */ React337.createElement(WorkspaceSideProvider, { value: leftSidebarProviderValue }, leftTabValue ? renderPanelChildren(left, leftChildrenProps) : null)
|
|
43521
43880
|
) : null;
|
|
43522
|
-
const rightPanel = right && rightVisible !== false ? /* @__PURE__ */
|
|
43881
|
+
const rightPanel = right && rightVisible !== false ? /* @__PURE__ */ React337.createElement(
|
|
43523
43882
|
PanelInner,
|
|
43524
43883
|
{
|
|
43525
43884
|
style: rightStyle,
|
|
43526
43885
|
className: cx("n-bg-sidebar-background n-flex-col", rightClassName)
|
|
43527
43886
|
},
|
|
43528
|
-
/* @__PURE__ */
|
|
43887
|
+
/* @__PURE__ */ React337.createElement(WorkspaceSideProvider, { value: rightSidebarProviderValue }, rightTabValue ? renderPanelChildren(right, rightChildrenProps) : null)
|
|
43529
43888
|
) : null;
|
|
43530
|
-
const centerPanel = /* @__PURE__ */
|
|
43889
|
+
const centerPanel = /* @__PURE__ */ React337.createElement(PanelInner, { className: "n-bg-canvas-background" }, children);
|
|
43531
43890
|
const leftSidebarOptions = useMemo100(
|
|
43532
43891
|
() => ({
|
|
43533
43892
|
minSize: leftSidebarMinPixels,
|
|
@@ -43567,7 +43926,7 @@ var WorkspaceLayout = forwardRefGeneric(function WorkspaceLayout2({
|
|
|
43567
43926
|
const LayoutComponent = sideType === "panel" ? PanelWorkspaceLayout : sideType === "drawer" ? DrawerWorkspaceLayout : parentSize.width > sideTypeBreakpoint ? PanelWorkspaceLayout : DrawerWorkspaceLayout;
|
|
43568
43927
|
const readyToRender = detectSize === "window" || containerSize && containerSize.width > 0;
|
|
43569
43928
|
const isOverlay = toolbarVariant === "overlay";
|
|
43570
|
-
return /* @__PURE__ */
|
|
43929
|
+
return /* @__PURE__ */ React337.createElement(
|
|
43571
43930
|
"div",
|
|
43572
43931
|
{
|
|
43573
43932
|
ref: containerRef,
|
|
@@ -43580,14 +43939,14 @@ var WorkspaceLayout = forwardRefGeneric(function WorkspaceLayout2({
|
|
|
43580
43939
|
"data-theme": theme
|
|
43581
43940
|
},
|
|
43582
43941
|
!isOverlay && toolbar,
|
|
43583
|
-
/* @__PURE__ */
|
|
43942
|
+
/* @__PURE__ */ React337.createElement(
|
|
43584
43943
|
"div",
|
|
43585
43944
|
{
|
|
43586
43945
|
className: "n-flex n-flex-row n-flex-1 n-min-h-0 n-relative",
|
|
43587
43946
|
"data-workspace-content": true,
|
|
43588
43947
|
style: contentTopInset > 0 ? { paddingTop: contentTopInset } : void 0
|
|
43589
43948
|
},
|
|
43590
|
-
readyToRender && /* @__PURE__ */
|
|
43949
|
+
readyToRender && /* @__PURE__ */ React337.createElement(React337.Fragment, null, /* @__PURE__ */ React337.createElement(
|
|
43591
43950
|
LayoutComponent,
|
|
43592
43951
|
{
|
|
43593
43952
|
leftPanel,
|
|
@@ -43609,7 +43968,7 @@ var WorkspaceLayout = forwardRefGeneric(function WorkspaceLayout2({
|
|
|
43609
43968
|
onRightSidebarStateChange,
|
|
43610
43969
|
shouldAutoSave
|
|
43611
43970
|
}
|
|
43612
|
-
), isOverlay && /* @__PURE__ */
|
|
43971
|
+
), isOverlay && /* @__PURE__ */ React337.createElement(
|
|
43613
43972
|
OverlayToolbar,
|
|
43614
43973
|
{
|
|
43615
43974
|
left: overlayToolbarLeft,
|
|
@@ -43626,7 +43985,7 @@ var PanelInner = memo40(function PanelInner2({
|
|
|
43626
43985
|
style: style2,
|
|
43627
43986
|
className
|
|
43628
43987
|
}) {
|
|
43629
|
-
return /* @__PURE__ */
|
|
43988
|
+
return /* @__PURE__ */ React337.createElement(
|
|
43630
43989
|
"div",
|
|
43631
43990
|
{
|
|
43632
43991
|
style: style2,
|
|
@@ -43641,22 +44000,22 @@ function getFirstTabValue(items, defaultValue2) {
|
|
|
43641
44000
|
}
|
|
43642
44001
|
|
|
43643
44002
|
// src/contexts/ImageDataContext.tsx
|
|
43644
|
-
import * as
|
|
43645
|
-
var ImageDataContext =
|
|
44003
|
+
import * as React338 from "react";
|
|
44004
|
+
var ImageDataContext = React338.createContext(
|
|
43646
44005
|
void 0
|
|
43647
44006
|
);
|
|
43648
|
-
var ImageDataProvider =
|
|
44007
|
+
var ImageDataProvider = React338.memo(function ImageDataProvider2({
|
|
43649
44008
|
children,
|
|
43650
44009
|
getImageData
|
|
43651
44010
|
}) {
|
|
43652
|
-
const contextValue =
|
|
44011
|
+
const contextValue = React338.useMemo(
|
|
43653
44012
|
() => ({ getImageData: getImageData ?? (() => void 0) }),
|
|
43654
44013
|
[getImageData]
|
|
43655
44014
|
);
|
|
43656
|
-
return /* @__PURE__ */
|
|
44015
|
+
return /* @__PURE__ */ React338.createElement(ImageDataContext.Provider, { value: contextValue }, children);
|
|
43657
44016
|
});
|
|
43658
44017
|
function useImageData(ref) {
|
|
43659
|
-
const value =
|
|
44018
|
+
const value = React338.useContext(ImageDataContext);
|
|
43660
44019
|
if (!value) {
|
|
43661
44020
|
throw new Error("Missing ImageDataProvider");
|
|
43662
44021
|
}
|
|
@@ -43673,9 +44032,9 @@ function usePlatformModKey() {
|
|
|
43673
44032
|
}
|
|
43674
44033
|
|
|
43675
44034
|
// src/hooks/useTheme.ts
|
|
43676
|
-
import { useEffect as
|
|
44035
|
+
import { useEffect as useEffect59, useState as useState82 } from "react";
|
|
43677
44036
|
function useTheme() {
|
|
43678
|
-
const [theme, setTheme] =
|
|
44037
|
+
const [theme, setTheme] = useState82("light");
|
|
43679
44038
|
const checkTheme = () => {
|
|
43680
44039
|
const currentTheme = document.body.getAttribute("data-theme");
|
|
43681
44040
|
switch (currentTheme) {
|
|
@@ -43687,7 +44046,7 @@ function useTheme() {
|
|
|
43687
44046
|
break;
|
|
43688
44047
|
}
|
|
43689
44048
|
};
|
|
43690
|
-
|
|
44049
|
+
useEffect59(() => {
|
|
43691
44050
|
checkTheme();
|
|
43692
44051
|
const observer = new MutationObserver((mutations) => {
|
|
43693
44052
|
mutations.forEach((mutation) => {
|
|
@@ -43830,140 +44189,49 @@ var SUPPORTED_CANVAS_UPLOAD_TYPES = [
|
|
|
43830
44189
|
|
|
43831
44190
|
// src/components/DimensionInput.tsx
|
|
43832
44191
|
import { round as round3 } from "@noya-app/noya-utils";
|
|
43833
|
-
import * as
|
|
44192
|
+
import * as React339 from "react";
|
|
43834
44193
|
function getNewValue2(value, mode, delta) {
|
|
43835
44194
|
return delta === void 0 ? value : mode === "replace" ? delta : value + delta;
|
|
43836
44195
|
}
|
|
43837
|
-
var DimensionInput =
|
|
44196
|
+
var DimensionInput = React339.memo(function DimensionInput2({
|
|
43838
44197
|
id,
|
|
43839
44198
|
value,
|
|
43840
44199
|
onSetValue,
|
|
43841
44200
|
label,
|
|
43842
44201
|
size: size4,
|
|
43843
|
-
|
|
44202
|
+
// Figma shows "Mixed" in numeric fields with differing values
|
|
44203
|
+
placeholder = "Mixed",
|
|
43844
44204
|
disabled: disabled2,
|
|
43845
|
-
trigger = "submit"
|
|
44205
|
+
trigger = "submit",
|
|
44206
|
+
suffix
|
|
43846
44207
|
}) {
|
|
43847
|
-
const handleNudgeValue =
|
|
44208
|
+
const handleNudgeValue = React339.useCallback(
|
|
43848
44209
|
(value2) => onSetValue(value2, "adjust"),
|
|
43849
44210
|
[onSetValue]
|
|
43850
44211
|
);
|
|
43851
|
-
const handleSetValue =
|
|
44212
|
+
const handleSetValue = React339.useCallback(
|
|
43852
44213
|
(value2) => onSetValue(value2, "replace"),
|
|
43853
44214
|
[onSetValue]
|
|
43854
44215
|
);
|
|
43855
|
-
return /* @__PURE__ */
|
|
43856
|
-
InputField2.
|
|
44216
|
+
return /* @__PURE__ */ React339.createElement(LabeledField, { label, labelType: "inset" }, /* @__PURE__ */ React339.createElement(
|
|
44217
|
+
InputField2.Root,
|
|
43857
44218
|
{
|
|
43858
|
-
|
|
43859
|
-
|
|
43860
|
-
|
|
43861
|
-
|
|
43862
|
-
|
|
43863
|
-
|
|
43864
|
-
|
|
43865
|
-
|
|
43866
|
-
|
|
43867
|
-
|
|
43868
|
-
|
|
43869
|
-
|
|
43870
|
-
|
|
43871
|
-
|
|
43872
|
-
|
|
43873
|
-
|
|
43874
|
-
Row: () => Row,
|
|
43875
|
-
RowLabel: () => RowLabel,
|
|
43876
|
-
Section: () => Section2,
|
|
43877
|
-
SectionHeader: () => SectionHeader2,
|
|
43878
|
-
Text: () => Text3,
|
|
43879
|
-
Title: () => Title,
|
|
43880
|
-
VerticalSeparator: () => VerticalSeparator
|
|
43881
|
-
});
|
|
43882
|
-
import React339, {
|
|
43883
|
-
forwardRef as forwardRef134,
|
|
43884
|
-
memo as memo43
|
|
43885
|
-
} from "react";
|
|
43886
|
-
var Section2 = forwardRef134(({ className, ...props }, ref) => /* @__PURE__ */ React339.createElement(
|
|
43887
|
-
"div",
|
|
43888
|
-
{
|
|
43889
|
-
ref,
|
|
43890
|
-
className: cx(`n-flex-none n-flex n-flex-col`, className),
|
|
43891
|
-
...props
|
|
43892
|
-
}
|
|
43893
|
-
));
|
|
43894
|
-
var SectionHeader2 = forwardRef134(({ className, ...props }, ref) => /* @__PURE__ */ React339.createElement("div", { ref, className: cx(`n-flex n-items-center`, className), ...props }));
|
|
43895
|
-
var Title = forwardRef134(({ className, $textStyle, ...props }, ref) => /* @__PURE__ */ React339.createElement(
|
|
43896
|
-
"div",
|
|
43897
|
-
{
|
|
43898
|
-
ref,
|
|
43899
|
-
className: cx(
|
|
43900
|
-
`n-flex n-select-none ${$textStyle ? `${textStyles[$textStyle]} n-text-text` : "n-font-sans n-text-label n-text-text-muted n-font-semibold"} `,
|
|
43901
|
-
className
|
|
43902
|
-
),
|
|
43903
|
-
...props
|
|
43904
|
-
}
|
|
43905
|
-
));
|
|
43906
|
-
var Row = forwardRef134(({ className, ...props }, ref) => /* @__PURE__ */ React339.createElement(
|
|
43907
|
-
"div",
|
|
43908
|
-
{
|
|
43909
|
-
ref,
|
|
43910
|
-
className: cx(`n-flex-1 n-flex n-flex-row n-items-center`, className),
|
|
43911
|
-
...props
|
|
43912
|
-
}
|
|
43913
|
-
));
|
|
43914
|
-
var Column = forwardRef134(({ className, ...props }, ref) => /* @__PURE__ */ React339.createElement(
|
|
43915
|
-
"div",
|
|
43916
|
-
{
|
|
43917
|
-
ref,
|
|
43918
|
-
className: cx(`n-flex-1 n-flex n-flex-col n-gap-1`, className),
|
|
43919
|
-
...props
|
|
43920
|
-
}
|
|
43921
|
-
));
|
|
43922
|
-
var Checkbox3 = forwardRef134(({ className, ...props }, ref) => /* @__PURE__ */ React339.createElement(
|
|
43923
|
-
"input",
|
|
43924
|
-
{
|
|
43925
|
-
ref,
|
|
43926
|
-
type: "checkbox",
|
|
43927
|
-
className: cx(`n-m-0 focus:n-z-interactable`, className),
|
|
43928
|
-
...props
|
|
43929
|
-
}
|
|
43930
|
-
));
|
|
43931
|
-
var Text3 = forwardRef134(({ className, ...props }, ref) => /* @__PURE__ */ React339.createElement(
|
|
43932
|
-
"span",
|
|
43933
|
-
{
|
|
43934
|
-
ref,
|
|
43935
|
-
className: cx(`n-font-sans n-text-heading5 n-font-normal`, className),
|
|
43936
|
-
...props
|
|
43937
|
-
}
|
|
43938
|
-
));
|
|
43939
|
-
var VerticalSeparator = () => /* @__PURE__ */ React339.createElement(Spacer.Vertical, { size: "inspector-v-separator" });
|
|
43940
|
-
var HorizontalSeparator = () => /* @__PURE__ */ React339.createElement(Spacer.Horizontal, { size: "inspector-h-separator" });
|
|
43941
|
-
var RowLabel = forwardRef134(function RowLabel2({
|
|
43942
|
-
className,
|
|
43943
|
-
$textStyle,
|
|
43944
|
-
...props
|
|
43945
|
-
}, ref) {
|
|
43946
|
-
return /* @__PURE__ */ React339.createElement(
|
|
43947
|
-
"label",
|
|
43948
|
-
{
|
|
43949
|
-
ref,
|
|
43950
|
-
className: cx(
|
|
43951
|
-
`n-font-sans n-text-label n-uppercase n-flex n-items-center n-leading-[19px] n-font-bold n-text-text-subtle n-z-label ${$textStyle && textStyles[$textStyle]} `,
|
|
43952
|
-
className
|
|
43953
|
-
),
|
|
43954
|
-
...props
|
|
43955
|
-
}
|
|
43956
|
-
);
|
|
43957
|
-
});
|
|
43958
|
-
var LabeledRow = memo43(function LabeledRow2({
|
|
43959
|
-
id,
|
|
43960
|
-
children,
|
|
43961
|
-
label,
|
|
43962
|
-
labelTextStyle,
|
|
43963
|
-
right,
|
|
43964
|
-
className
|
|
43965
|
-
}) {
|
|
43966
|
-
return /* @__PURE__ */ React339.createElement(Row, { id, className }, /* @__PURE__ */ React339.createElement(Column, null, /* @__PURE__ */ React339.createElement(RowLabel, { $textStyle: labelTextStyle }, label, right && /* @__PURE__ */ React339.createElement(Spacer.Horizontal, null), right), /* @__PURE__ */ React339.createElement(Row, null, children)));
|
|
44219
|
+
id,
|
|
44220
|
+
width: size4,
|
|
44221
|
+
end: suffix ? /* @__PURE__ */ React339.createElement(Label, null, suffix) : void 0
|
|
44222
|
+
},
|
|
44223
|
+
/* @__PURE__ */ React339.createElement(
|
|
44224
|
+
InputField2.NumberInput,
|
|
44225
|
+
{
|
|
44226
|
+
value: value === void 0 ? value : round3(value, 2),
|
|
44227
|
+
placeholder: value === void 0 ? placeholder : void 0,
|
|
44228
|
+
onNudge: handleNudgeValue,
|
|
44229
|
+
disabled: disabled2,
|
|
44230
|
+
style: suffix ? { paddingRight: 4 } : void 0,
|
|
44231
|
+
...trigger === "change" ? { onChange: handleSetValue } : { onSubmit: handleSetValue }
|
|
44232
|
+
}
|
|
44233
|
+
)
|
|
44234
|
+
));
|
|
43967
44235
|
});
|
|
43968
44236
|
export {
|
|
43969
44237
|
AIAssistantInput,
|
|
@@ -44042,7 +44310,6 @@ export {
|
|
|
44042
44310
|
IndentContext,
|
|
44043
44311
|
InputField2 as InputField,
|
|
44044
44312
|
InspectorContainer,
|
|
44045
|
-
InspectorPrimitives_exports as InspectorPrimitives,
|
|
44046
44313
|
Italic,
|
|
44047
44314
|
KeyboardShortcut,
|
|
44048
44315
|
Label,
|
|
@@ -44096,8 +44363,9 @@ export {
|
|
|
44096
44363
|
TextAreaRow,
|
|
44097
44364
|
Toast,
|
|
44098
44365
|
ToastProvider3 as ToastProvider,
|
|
44099
|
-
Toolbar,
|
|
44366
|
+
Toolbar2 as Toolbar,
|
|
44100
44367
|
ToolbarDrawer,
|
|
44368
|
+
ToolbarItems,
|
|
44101
44369
|
ToolbarMenu,
|
|
44102
44370
|
ToolbarMenuButton,
|
|
44103
44371
|
ToolbarMenuContext,
|
|
@@ -44204,7 +44472,8 @@ export {
|
|
|
44204
44472
|
validateDropIndicator,
|
|
44205
44473
|
whiteboardProseTheme,
|
|
44206
44474
|
withDragProvider,
|
|
44207
|
-
withSeparatorElements
|
|
44475
|
+
withSeparatorElements,
|
|
44476
|
+
wordPrefixFilter
|
|
44208
44477
|
};
|
|
44209
44478
|
/*! Bundled license information:
|
|
44210
44479
|
|