@powerhousedao/powerhouse-vetra-packages 6.2.3-dev.1 → 6.2.3-dev.11
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/dist/browser/assets/{entry-5_Eh4a2Z.js → entry-4ObkElbc.js} +2 -2
- package/dist/browser/assets/{projection-entry-5PVbP10h.js → projection-entry-DRGRQCSu.js} +8 -8
- package/dist/browser/{button-CuO8Gh3v.js → button-sZQCXeCo.js} +131 -24
- package/dist/browser/button-sZQCXeCo.js.map +1 -0
- package/dist/browser/chunk-CRPLlQ3x.js +28 -0
- package/dist/browser/{dist-BAJ5nRDl.js → dist-D3_ER0Dn.js} +2 -399
- package/dist/browser/dist-D3_ER0Dn.js.map +1 -0
- package/dist/browser/document-models/index.js +2 -1
- package/dist/browser/{documents-J_l59mSV.js → documents-C-lAnv6o.js} +604 -735
- package/dist/browser/documents-C-lAnv6o.js.map +1 -0
- package/dist/browser/editor-BO_s5gTQ.js +3679 -0
- package/dist/browser/editor-BO_s5gTQ.js.map +1 -0
- package/dist/browser/{editor-DZP1WlYy.js → editor-DNV-46lY.js} +5 -5
- package/dist/browser/{editor-DZP1WlYy.js.map → editor-DNV-46lY.js.map} +1 -1
- package/dist/browser/editors/document-model-editor/module.js +1 -1
- package/dist/browser/editors/generic-drive-explorer/index.js +4 -5
- package/dist/browser/editors/generic-drive-explorer/index.js.map +1 -1
- package/dist/browser/editors/generic-drive-explorer/module.js +1 -1
- package/dist/browser/folder-view-CzItU0hn.js +957 -0
- package/dist/browser/folder-view-CzItU0hn.js.map +1 -0
- package/dist/browser/{graphql-editor-Cbkb5KRZ.js → graphql-editor-BMhHl2XP.js} +7 -9
- package/dist/browser/{graphql-editor-Cbkb5KRZ.js.map → graphql-editor-BMhHl2XP.js.map} +1 -1
- package/dist/{node/hooks-D0DcS3MV.mjs → browser/hooks-Bh1JCohS.js} +2 -2
- package/dist/browser/{hooks-KKcNp2X0.js.map → hooks-Bh1JCohS.js.map} +1 -1
- package/dist/browser/index.js +120 -20
- package/dist/browser/index.js.map +1 -1
- package/dist/browser/{json-editor-CN6kPtl1.js → json-editor-DBhkG5TF.js} +3 -4
- package/dist/browser/{json-editor-CN6kPtl1.js.map → json-editor-DBhkG5TF.js.map} +1 -1
- package/dist/browser/{parser-CkF6Qt8V.js → parser-BBzK7bLd.js} +1 -1
- package/dist/browser/{parser-CkF6Qt8V.js.map → parser-BBzK7bLd.js.map} +1 -1
- package/dist/browser/{schema-context-ZyeclQwy.js → schema-context-p2bhyog_.js} +3 -3
- package/dist/browser/{schema-context-ZyeclQwy.js.map → schema-context-p2bhyog_.js.map} +1 -1
- package/dist/browser/src-CVV6HzQZ-D-OQvEkh.js +5151 -0
- package/dist/browser/src-CVV6HzQZ-D-OQvEkh.js.map +1 -0
- package/dist/browser/state-schemas-DuA5rB1e.js +694 -0
- package/dist/browser/state-schemas-DuA5rB1e.js.map +1 -0
- package/dist/browser/tslib.es6-CeIASJ2O.js +32 -0
- package/dist/browser/tslib.es6-CeIASJ2O.js.map +1 -0
- package/dist/node/{button-Da7CxMn7.mjs → button-5bnYEAVq.mjs} +130 -23
- package/dist/node/button-5bnYEAVq.mjs.map +1 -0
- package/dist/node/chunk-17FXJ3dL.mjs +31 -0
- package/dist/node/{dist-CzYOpeXN.mjs → dist-Bf_PIbO7.mjs} +2 -399
- package/dist/node/dist-Bf_PIbO7.mjs.map +1 -0
- package/dist/node/document-models/index.mjs +2 -1
- package/dist/node/documents-XAQfHX5Q.mjs +17 -0
- package/dist/node/documents-XAQfHX5Q.mjs.map +1 -0
- package/dist/node/editor-BiiLqEe9.mjs +3679 -0
- package/dist/node/editor-BiiLqEe9.mjs.map +1 -0
- package/dist/node/{editor-Dg2OZEJu.mjs → editor-Cp2TC5MJ.mjs} +5 -5
- package/dist/node/{editor-Dg2OZEJu.mjs.map → editor-Cp2TC5MJ.mjs.map} +1 -1
- package/dist/node/editors/document-model-editor/module.mjs +1 -1
- package/dist/node/editors/generic-drive-explorer/index.mjs +4 -5
- package/dist/node/editors/generic-drive-explorer/index.mjs.map +1 -1
- package/dist/node/editors/generic-drive-explorer/module.mjs +1 -1
- package/dist/node/folder-view-m_rH84Nz.mjs +962 -0
- package/dist/node/folder-view-m_rH84Nz.mjs.map +1 -0
- package/dist/node/{graphql-BfAoPeWM.mjs → graphql-BvV3tC1U.mjs} +2 -2
- package/dist/node/{graphql-BfAoPeWM.mjs.map → graphql-BvV3tC1U.mjs.map} +1 -1
- package/dist/node/{graphql-editor-DNxebuTn.mjs → graphql-editor-BhF6KN6y.mjs} +6 -7
- package/dist/node/{graphql-editor-DNxebuTn.mjs.map → graphql-editor-BhF6KN6y.mjs.map} +1 -1
- package/dist/{browser/hooks-KKcNp2X0.js → node/hooks-Di3FASx-.mjs} +2 -2
- package/dist/node/{hooks-D0DcS3MV.mjs.map → hooks-Di3FASx-.mjs.map} +1 -1
- package/dist/node/index.mjs +142 -21
- package/dist/node/index.mjs.map +1 -1
- package/dist/node/{json-editor-BpnEn9AS.mjs → json-editor-Cqc0zuz0.mjs} +3 -4
- package/dist/node/{json-editor-BpnEn9AS.mjs.map → json-editor-Cqc0zuz0.mjs.map} +1 -1
- package/dist/node/{schema-context-DL8jhi_d.mjs → schema-context-mHmP3Cl6.mjs} +3 -3
- package/dist/node/{schema-context-DL8jhi_d.mjs.map → schema-context-mHmP3Cl6.mjs.map} +1 -1
- package/dist/node/{connect-CeLh6yfj.mjs → src-CVV6HzQZ-CvqjXbXk.mjs} +1829 -11016
- package/dist/node/src-CVV6HzQZ-CvqjXbXk.mjs.map +1 -0
- package/dist/node/state-schemas-DXG02fMh.mjs +695 -0
- package/dist/node/state-schemas-DXG02fMh.mjs.map +1 -0
- package/dist/node/{main-B1tRsYOp.mjs → tslib.es6-DdiHgz9e.mjs} +3 -203
- package/dist/node/tslib.es6-DdiHgz9e.mjs.map +1 -0
- package/package.json +7 -7
- package/dist/browser/button-CuO8Gh3v.js.map +0 -1
- package/dist/browser/connect-BqgnsniX.js +0 -14322
- package/dist/browser/connect-BqgnsniX.js.map +0 -1
- package/dist/browser/dist-B4FWbuEM.js +0 -4148
- package/dist/browser/dist-B4FWbuEM.js.map +0 -1
- package/dist/browser/dist-BAJ5nRDl.js.map +0 -1
- package/dist/browser/dist-C-xkNfyD.js +0 -4641
- package/dist/browser/dist-C-xkNfyD.js.map +0 -1
- package/dist/browser/document-drive-ZQzPQfEL.js +0 -8237
- package/dist/browser/document-drive-ZQzPQfEL.js.map +0 -1
- package/dist/browser/documents-J_l59mSV.js.map +0 -1
- package/dist/browser/editor-BNgF9-uX.js +0 -1809
- package/dist/browser/editor-BNgF9-uX.js.map +0 -1
- package/dist/browser/folder-view-tx0A96ZI.js +0 -232
- package/dist/browser/folder-view-tx0A96ZI.js.map +0 -1
- package/dist/browser/lib-ewnRj2dJ.js +0 -209
- package/dist/browser/lib-ewnRj2dJ.js.map +0 -1
- package/dist/browser/printer-CEYr4JOg.js +0 -604
- package/dist/browser/printer-CEYr4JOg.js.map +0 -1
- package/dist/browser/state-schemas-CKh98ehP.js +0 -298
- package/dist/browser/state-schemas-CKh98ehP.js.map +0 -1
- package/dist/node/button-Da7CxMn7.mjs.map +0 -1
- package/dist/node/connect-CeLh6yfj.mjs.map +0 -1
- package/dist/node/dist-CUFTZwfc.mjs +0 -4649
- package/dist/node/dist-CUFTZwfc.mjs.map +0 -1
- package/dist/node/dist-CzYOpeXN.mjs.map +0 -1
- package/dist/node/dist-DT7jI9ol.mjs +0 -4148
- package/dist/node/dist-DT7jI9ol.mjs.map +0 -1
- package/dist/node/document-drive-D1NMjQQc.mjs +0 -8254
- package/dist/node/document-drive-D1NMjQQc.mjs.map +0 -1
- package/dist/node/documents-DCf53bzO.mjs +0 -747
- package/dist/node/documents-DCf53bzO.mjs.map +0 -1
- package/dist/node/editor-CXQOsbup.mjs +0 -1809
- package/dist/node/editor-CXQOsbup.mjs.map +0 -1
- package/dist/node/folder-view-DZ0o2-Ef.mjs +0 -232
- package/dist/node/folder-view-DZ0o2-Ef.mjs.map +0 -1
- package/dist/node/main-B1tRsYOp.mjs.map +0 -1
- package/dist/node/state-schemas-CuSHxrn6.mjs +0 -299
- package/dist/node/state-schemas-CuSHxrn6.mjs.map +0 -1
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as React$1 from "react";
|
|
2
|
-
import React from "react";
|
|
3
2
|
import { jsx } from "react/jsx-runtime";
|
|
4
3
|
import * as ReactDOM$1 from "react-dom";
|
|
5
4
|
//#region ../../node_modules/.pnpm/tailwind-merge@3.4.0/node_modules/tailwind-merge/dist/bundle-mjs.mjs
|
|
@@ -2191,85 +2190,6 @@ function dispatchDiscreteCustomEvent(target, event) {
|
|
|
2191
2190
|
if (target) ReactDOM$1.flushSync(() => target.dispatchEvent(event));
|
|
2192
2191
|
}
|
|
2193
2192
|
//#endregion
|
|
2194
|
-
//#region ../../node_modules/.pnpm/@radix-ui+react-collection@1.1.7_@types+react-dom@19.2.3_@types+react@19.2.14__@types+r_b94f5365b88697a700662930c56ccffc/node_modules/@radix-ui/react-collection/dist/index.mjs
|
|
2195
|
-
function createCollection(name) {
|
|
2196
|
-
const PROVIDER_NAME = name + "CollectionProvider";
|
|
2197
|
-
const [createCollectionContext, createCollectionScope] = createContextScope(PROVIDER_NAME);
|
|
2198
|
-
const [CollectionProviderImpl, useCollectionContext] = createCollectionContext(PROVIDER_NAME, {
|
|
2199
|
-
collectionRef: { current: null },
|
|
2200
|
-
itemMap: /* @__PURE__ */ new Map()
|
|
2201
|
-
});
|
|
2202
|
-
const CollectionProvider = (props) => {
|
|
2203
|
-
const { scope, children } = props;
|
|
2204
|
-
const ref = React.useRef(null);
|
|
2205
|
-
const itemMap = React.useRef(/* @__PURE__ */ new Map()).current;
|
|
2206
|
-
return /* @__PURE__ */ jsx(CollectionProviderImpl, {
|
|
2207
|
-
scope,
|
|
2208
|
-
itemMap,
|
|
2209
|
-
collectionRef: ref,
|
|
2210
|
-
children
|
|
2211
|
-
});
|
|
2212
|
-
};
|
|
2213
|
-
CollectionProvider.displayName = PROVIDER_NAME;
|
|
2214
|
-
const COLLECTION_SLOT_NAME = name + "CollectionSlot";
|
|
2215
|
-
const CollectionSlotImpl = /* @__PURE__ */ createSlot(COLLECTION_SLOT_NAME);
|
|
2216
|
-
const CollectionSlot = React.forwardRef((props, forwardedRef) => {
|
|
2217
|
-
const { scope, children } = props;
|
|
2218
|
-
return /* @__PURE__ */ jsx(CollectionSlotImpl, {
|
|
2219
|
-
ref: useComposedRefs(forwardedRef, useCollectionContext(COLLECTION_SLOT_NAME, scope).collectionRef),
|
|
2220
|
-
children
|
|
2221
|
-
});
|
|
2222
|
-
});
|
|
2223
|
-
CollectionSlot.displayName = COLLECTION_SLOT_NAME;
|
|
2224
|
-
const ITEM_SLOT_NAME = name + "CollectionItemSlot";
|
|
2225
|
-
const ITEM_DATA_ATTR = "data-radix-collection-item";
|
|
2226
|
-
const CollectionItemSlotImpl = /* @__PURE__ */ createSlot(ITEM_SLOT_NAME);
|
|
2227
|
-
const CollectionItemSlot = React.forwardRef((props, forwardedRef) => {
|
|
2228
|
-
const { scope, children, ...itemData } = props;
|
|
2229
|
-
const ref = React.useRef(null);
|
|
2230
|
-
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
2231
|
-
const context = useCollectionContext(ITEM_SLOT_NAME, scope);
|
|
2232
|
-
React.useEffect(() => {
|
|
2233
|
-
context.itemMap.set(ref, {
|
|
2234
|
-
ref,
|
|
2235
|
-
...itemData
|
|
2236
|
-
});
|
|
2237
|
-
return () => void context.itemMap.delete(ref);
|
|
2238
|
-
});
|
|
2239
|
-
return /* @__PURE__ */ jsx(CollectionItemSlotImpl, {
|
|
2240
|
-
[ITEM_DATA_ATTR]: "",
|
|
2241
|
-
ref: composedRefs,
|
|
2242
|
-
children
|
|
2243
|
-
});
|
|
2244
|
-
});
|
|
2245
|
-
CollectionItemSlot.displayName = ITEM_SLOT_NAME;
|
|
2246
|
-
function useCollection(scope) {
|
|
2247
|
-
const context = useCollectionContext(name + "CollectionConsumer", scope);
|
|
2248
|
-
return React.useCallback(() => {
|
|
2249
|
-
const collectionNode = context.collectionRef.current;
|
|
2250
|
-
if (!collectionNode) return [];
|
|
2251
|
-
const orderedNodes = Array.from(collectionNode.querySelectorAll(`[${ITEM_DATA_ATTR}]`));
|
|
2252
|
-
return Array.from(context.itemMap.values()).sort((a, b) => orderedNodes.indexOf(a.ref.current) - orderedNodes.indexOf(b.ref.current));
|
|
2253
|
-
}, [context.collectionRef, context.itemMap]);
|
|
2254
|
-
}
|
|
2255
|
-
return [
|
|
2256
|
-
{
|
|
2257
|
-
Provider: CollectionProvider,
|
|
2258
|
-
Slot: CollectionSlot,
|
|
2259
|
-
ItemSlot: CollectionItemSlot
|
|
2260
|
-
},
|
|
2261
|
-
useCollection,
|
|
2262
|
-
createCollectionScope
|
|
2263
|
-
];
|
|
2264
|
-
}
|
|
2265
|
-
//#endregion
|
|
2266
|
-
//#region ../../node_modules/.pnpm/@radix-ui+react-direction@1.1.1_@types+react@19.2.14_react@19.2.6/node_modules/@radix-ui/react-direction/dist/index.mjs
|
|
2267
|
-
var DirectionContext = React$1.createContext(void 0);
|
|
2268
|
-
function useDirection(localDir) {
|
|
2269
|
-
const globalDir = React$1.useContext(DirectionContext);
|
|
2270
|
-
return localDir || globalDir || "ltr";
|
|
2271
|
-
}
|
|
2272
|
-
//#endregion
|
|
2273
2193
|
//#region ../../node_modules/.pnpm/@radix-ui+react-use-callback-ref@1.1.1_@types+react@19.2.14_react@19.2.6/node_modules/@radix-ui/react-use-callback-ref/dist/index.mjs
|
|
2274
2194
|
function useCallbackRef(callback) {
|
|
2275
2195
|
const callbackRef = React$1.useRef(callback);
|
|
@@ -2389,323 +2309,6 @@ function getElementRef(element) {
|
|
|
2389
2309
|
return element.props.ref || element.ref;
|
|
2390
2310
|
}
|
|
2391
2311
|
//#endregion
|
|
2392
|
-
|
|
2393
|
-
var ENTRY_FOCUS = "rovingFocusGroup.onEntryFocus";
|
|
2394
|
-
var EVENT_OPTIONS = {
|
|
2395
|
-
bubbles: false,
|
|
2396
|
-
cancelable: true
|
|
2397
|
-
};
|
|
2398
|
-
var GROUP_NAME = "RovingFocusGroup";
|
|
2399
|
-
var [Collection, useCollection, createCollectionScope] = createCollection(GROUP_NAME);
|
|
2400
|
-
var [createRovingFocusGroupContext, createRovingFocusGroupScope] = createContextScope(GROUP_NAME, [createCollectionScope]);
|
|
2401
|
-
var [RovingFocusProvider, useRovingFocusContext] = createRovingFocusGroupContext(GROUP_NAME);
|
|
2402
|
-
var RovingFocusGroup = React$1.forwardRef((props, forwardedRef) => {
|
|
2403
|
-
return /* @__PURE__ */ jsx(Collection.Provider, {
|
|
2404
|
-
scope: props.__scopeRovingFocusGroup,
|
|
2405
|
-
children: /* @__PURE__ */ jsx(Collection.Slot, {
|
|
2406
|
-
scope: props.__scopeRovingFocusGroup,
|
|
2407
|
-
children: /* @__PURE__ */ jsx(RovingFocusGroupImpl, {
|
|
2408
|
-
...props,
|
|
2409
|
-
ref: forwardedRef
|
|
2410
|
-
})
|
|
2411
|
-
})
|
|
2412
|
-
});
|
|
2413
|
-
});
|
|
2414
|
-
RovingFocusGroup.displayName = GROUP_NAME;
|
|
2415
|
-
var RovingFocusGroupImpl = React$1.forwardRef((props, forwardedRef) => {
|
|
2416
|
-
const { __scopeRovingFocusGroup, orientation, loop = false, dir, currentTabStopId: currentTabStopIdProp, defaultCurrentTabStopId, onCurrentTabStopIdChange, onEntryFocus, preventScrollOnEntryFocus = false, ...groupProps } = props;
|
|
2417
|
-
const ref = React$1.useRef(null);
|
|
2418
|
-
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
2419
|
-
const direction = useDirection(dir);
|
|
2420
|
-
const [currentTabStopId, setCurrentTabStopId] = useControllableState({
|
|
2421
|
-
prop: currentTabStopIdProp,
|
|
2422
|
-
defaultProp: defaultCurrentTabStopId ?? null,
|
|
2423
|
-
onChange: onCurrentTabStopIdChange,
|
|
2424
|
-
caller: GROUP_NAME
|
|
2425
|
-
});
|
|
2426
|
-
const [isTabbingBackOut, setIsTabbingBackOut] = React$1.useState(false);
|
|
2427
|
-
const handleEntryFocus = useCallbackRef(onEntryFocus);
|
|
2428
|
-
const getItems = useCollection(__scopeRovingFocusGroup);
|
|
2429
|
-
const isClickFocusRef = React$1.useRef(false);
|
|
2430
|
-
const [focusableItemsCount, setFocusableItemsCount] = React$1.useState(0);
|
|
2431
|
-
React$1.useEffect(() => {
|
|
2432
|
-
const node = ref.current;
|
|
2433
|
-
if (node) {
|
|
2434
|
-
node.addEventListener(ENTRY_FOCUS, handleEntryFocus);
|
|
2435
|
-
return () => node.removeEventListener(ENTRY_FOCUS, handleEntryFocus);
|
|
2436
|
-
}
|
|
2437
|
-
}, [handleEntryFocus]);
|
|
2438
|
-
return /* @__PURE__ */ jsx(RovingFocusProvider, {
|
|
2439
|
-
scope: __scopeRovingFocusGroup,
|
|
2440
|
-
orientation,
|
|
2441
|
-
dir: direction,
|
|
2442
|
-
loop,
|
|
2443
|
-
currentTabStopId,
|
|
2444
|
-
onItemFocus: React$1.useCallback((tabStopId) => setCurrentTabStopId(tabStopId), [setCurrentTabStopId]),
|
|
2445
|
-
onItemShiftTab: React$1.useCallback(() => setIsTabbingBackOut(true), []),
|
|
2446
|
-
onFocusableItemAdd: React$1.useCallback(() => setFocusableItemsCount((prevCount) => prevCount + 1), []),
|
|
2447
|
-
onFocusableItemRemove: React$1.useCallback(() => setFocusableItemsCount((prevCount) => prevCount - 1), []),
|
|
2448
|
-
children: /* @__PURE__ */ jsx(Primitive.div, {
|
|
2449
|
-
tabIndex: isTabbingBackOut || focusableItemsCount === 0 ? -1 : 0,
|
|
2450
|
-
"data-orientation": orientation,
|
|
2451
|
-
...groupProps,
|
|
2452
|
-
ref: composedRefs,
|
|
2453
|
-
style: {
|
|
2454
|
-
outline: "none",
|
|
2455
|
-
...props.style
|
|
2456
|
-
},
|
|
2457
|
-
onMouseDown: composeEventHandlers(props.onMouseDown, () => {
|
|
2458
|
-
isClickFocusRef.current = true;
|
|
2459
|
-
}),
|
|
2460
|
-
onFocus: composeEventHandlers(props.onFocus, (event) => {
|
|
2461
|
-
const isKeyboardFocus = !isClickFocusRef.current;
|
|
2462
|
-
if (event.target === event.currentTarget && isKeyboardFocus && !isTabbingBackOut) {
|
|
2463
|
-
const entryFocusEvent = new CustomEvent(ENTRY_FOCUS, EVENT_OPTIONS);
|
|
2464
|
-
event.currentTarget.dispatchEvent(entryFocusEvent);
|
|
2465
|
-
if (!entryFocusEvent.defaultPrevented) {
|
|
2466
|
-
const items = getItems().filter((item) => item.focusable);
|
|
2467
|
-
focusFirst([
|
|
2468
|
-
items.find((item) => item.active),
|
|
2469
|
-
items.find((item) => item.id === currentTabStopId),
|
|
2470
|
-
...items
|
|
2471
|
-
].filter(Boolean).map((item) => item.ref.current), preventScrollOnEntryFocus);
|
|
2472
|
-
}
|
|
2473
|
-
}
|
|
2474
|
-
isClickFocusRef.current = false;
|
|
2475
|
-
}),
|
|
2476
|
-
onBlur: composeEventHandlers(props.onBlur, () => setIsTabbingBackOut(false))
|
|
2477
|
-
})
|
|
2478
|
-
});
|
|
2479
|
-
});
|
|
2480
|
-
var ITEM_NAME = "RovingFocusGroupItem";
|
|
2481
|
-
var RovingFocusGroupItem = React$1.forwardRef((props, forwardedRef) => {
|
|
2482
|
-
const { __scopeRovingFocusGroup, focusable = true, active = false, tabStopId, children, ...itemProps } = props;
|
|
2483
|
-
const autoId = useId$1();
|
|
2484
|
-
const id = tabStopId || autoId;
|
|
2485
|
-
const context = useRovingFocusContext(ITEM_NAME, __scopeRovingFocusGroup);
|
|
2486
|
-
const isCurrentTabStop = context.currentTabStopId === id;
|
|
2487
|
-
const getItems = useCollection(__scopeRovingFocusGroup);
|
|
2488
|
-
const { onFocusableItemAdd, onFocusableItemRemove, currentTabStopId } = context;
|
|
2489
|
-
React$1.useEffect(() => {
|
|
2490
|
-
if (focusable) {
|
|
2491
|
-
onFocusableItemAdd();
|
|
2492
|
-
return () => onFocusableItemRemove();
|
|
2493
|
-
}
|
|
2494
|
-
}, [
|
|
2495
|
-
focusable,
|
|
2496
|
-
onFocusableItemAdd,
|
|
2497
|
-
onFocusableItemRemove
|
|
2498
|
-
]);
|
|
2499
|
-
return /* @__PURE__ */ jsx(Collection.ItemSlot, {
|
|
2500
|
-
scope: __scopeRovingFocusGroup,
|
|
2501
|
-
id,
|
|
2502
|
-
focusable,
|
|
2503
|
-
active,
|
|
2504
|
-
children: /* @__PURE__ */ jsx(Primitive.span, {
|
|
2505
|
-
tabIndex: isCurrentTabStop ? 0 : -1,
|
|
2506
|
-
"data-orientation": context.orientation,
|
|
2507
|
-
...itemProps,
|
|
2508
|
-
ref: forwardedRef,
|
|
2509
|
-
onMouseDown: composeEventHandlers(props.onMouseDown, (event) => {
|
|
2510
|
-
if (!focusable) event.preventDefault();
|
|
2511
|
-
else context.onItemFocus(id);
|
|
2512
|
-
}),
|
|
2513
|
-
onFocus: composeEventHandlers(props.onFocus, () => context.onItemFocus(id)),
|
|
2514
|
-
onKeyDown: composeEventHandlers(props.onKeyDown, (event) => {
|
|
2515
|
-
if (event.key === "Tab" && event.shiftKey) {
|
|
2516
|
-
context.onItemShiftTab();
|
|
2517
|
-
return;
|
|
2518
|
-
}
|
|
2519
|
-
if (event.target !== event.currentTarget) return;
|
|
2520
|
-
const focusIntent = getFocusIntent(event, context.orientation, context.dir);
|
|
2521
|
-
if (focusIntent !== void 0) {
|
|
2522
|
-
if (event.metaKey || event.ctrlKey || event.altKey || event.shiftKey) return;
|
|
2523
|
-
event.preventDefault();
|
|
2524
|
-
let candidateNodes = getItems().filter((item) => item.focusable).map((item) => item.ref.current);
|
|
2525
|
-
if (focusIntent === "last") candidateNodes.reverse();
|
|
2526
|
-
else if (focusIntent === "prev" || focusIntent === "next") {
|
|
2527
|
-
if (focusIntent === "prev") candidateNodes.reverse();
|
|
2528
|
-
const currentIndex = candidateNodes.indexOf(event.currentTarget);
|
|
2529
|
-
candidateNodes = context.loop ? wrapArray(candidateNodes, currentIndex + 1) : candidateNodes.slice(currentIndex + 1);
|
|
2530
|
-
}
|
|
2531
|
-
setTimeout(() => focusFirst(candidateNodes));
|
|
2532
|
-
}
|
|
2533
|
-
}),
|
|
2534
|
-
children: typeof children === "function" ? children({
|
|
2535
|
-
isCurrentTabStop,
|
|
2536
|
-
hasTabStop: currentTabStopId != null
|
|
2537
|
-
}) : children
|
|
2538
|
-
})
|
|
2539
|
-
});
|
|
2540
|
-
});
|
|
2541
|
-
RovingFocusGroupItem.displayName = ITEM_NAME;
|
|
2542
|
-
var MAP_KEY_TO_FOCUS_INTENT = {
|
|
2543
|
-
ArrowLeft: "prev",
|
|
2544
|
-
ArrowUp: "prev",
|
|
2545
|
-
ArrowRight: "next",
|
|
2546
|
-
ArrowDown: "next",
|
|
2547
|
-
PageUp: "first",
|
|
2548
|
-
Home: "first",
|
|
2549
|
-
PageDown: "last",
|
|
2550
|
-
End: "last"
|
|
2551
|
-
};
|
|
2552
|
-
function getDirectionAwareKey(key, dir) {
|
|
2553
|
-
if (dir !== "rtl") return key;
|
|
2554
|
-
return key === "ArrowLeft" ? "ArrowRight" : key === "ArrowRight" ? "ArrowLeft" : key;
|
|
2555
|
-
}
|
|
2556
|
-
function getFocusIntent(event, orientation, dir) {
|
|
2557
|
-
const key = getDirectionAwareKey(event.key, dir);
|
|
2558
|
-
if (orientation === "vertical" && ["ArrowLeft", "ArrowRight"].includes(key)) return void 0;
|
|
2559
|
-
if (orientation === "horizontal" && ["ArrowUp", "ArrowDown"].includes(key)) return void 0;
|
|
2560
|
-
return MAP_KEY_TO_FOCUS_INTENT[key];
|
|
2561
|
-
}
|
|
2562
|
-
function focusFirst(candidates, preventScroll = false) {
|
|
2563
|
-
const PREVIOUSLY_FOCUSED_ELEMENT = document.activeElement;
|
|
2564
|
-
for (const candidate of candidates) {
|
|
2565
|
-
if (candidate === PREVIOUSLY_FOCUSED_ELEMENT) return;
|
|
2566
|
-
candidate.focus({ preventScroll });
|
|
2567
|
-
if (document.activeElement !== PREVIOUSLY_FOCUSED_ELEMENT) return;
|
|
2568
|
-
}
|
|
2569
|
-
}
|
|
2570
|
-
function wrapArray(array, startIndex) {
|
|
2571
|
-
return array.map((_, index) => array[(startIndex + index) % array.length]);
|
|
2572
|
-
}
|
|
2573
|
-
var Root = RovingFocusGroup;
|
|
2574
|
-
var Item = RovingFocusGroupItem;
|
|
2575
|
-
//#endregion
|
|
2576
|
-
//#region ../../node_modules/.pnpm/@radix-ui+react-tabs@1.1.13_@types+react-dom@19.2.3_@types+react@19.2.14__@types+react@_08684373bbac196273bdefb5472f93a8/node_modules/@radix-ui/react-tabs/dist/index.mjs
|
|
2577
|
-
var TABS_NAME = "Tabs";
|
|
2578
|
-
var [createTabsContext, createTabsScope] = createContextScope(TABS_NAME, [createRovingFocusGroupScope]);
|
|
2579
|
-
var useRovingFocusGroupScope = createRovingFocusGroupScope();
|
|
2580
|
-
var [TabsProvider, useTabsContext] = createTabsContext(TABS_NAME);
|
|
2581
|
-
var Tabs = React$1.forwardRef((props, forwardedRef) => {
|
|
2582
|
-
const { __scopeTabs, value: valueProp, onValueChange, defaultValue, orientation = "horizontal", dir, activationMode = "automatic", ...tabsProps } = props;
|
|
2583
|
-
const direction = useDirection(dir);
|
|
2584
|
-
const [value, setValue] = useControllableState({
|
|
2585
|
-
prop: valueProp,
|
|
2586
|
-
onChange: onValueChange,
|
|
2587
|
-
defaultProp: defaultValue ?? "",
|
|
2588
|
-
caller: TABS_NAME
|
|
2589
|
-
});
|
|
2590
|
-
return /* @__PURE__ */ jsx(TabsProvider, {
|
|
2591
|
-
scope: __scopeTabs,
|
|
2592
|
-
baseId: useId$1(),
|
|
2593
|
-
value,
|
|
2594
|
-
onValueChange: setValue,
|
|
2595
|
-
orientation,
|
|
2596
|
-
dir: direction,
|
|
2597
|
-
activationMode,
|
|
2598
|
-
children: /* @__PURE__ */ jsx(Primitive.div, {
|
|
2599
|
-
dir: direction,
|
|
2600
|
-
"data-orientation": orientation,
|
|
2601
|
-
...tabsProps,
|
|
2602
|
-
ref: forwardedRef
|
|
2603
|
-
})
|
|
2604
|
-
});
|
|
2605
|
-
});
|
|
2606
|
-
Tabs.displayName = TABS_NAME;
|
|
2607
|
-
var TAB_LIST_NAME = "TabsList";
|
|
2608
|
-
var TabsList = React$1.forwardRef((props, forwardedRef) => {
|
|
2609
|
-
const { __scopeTabs, loop = true, ...listProps } = props;
|
|
2610
|
-
const context = useTabsContext(TAB_LIST_NAME, __scopeTabs);
|
|
2611
|
-
return /* @__PURE__ */ jsx(Root, {
|
|
2612
|
-
asChild: true,
|
|
2613
|
-
...useRovingFocusGroupScope(__scopeTabs),
|
|
2614
|
-
orientation: context.orientation,
|
|
2615
|
-
dir: context.dir,
|
|
2616
|
-
loop,
|
|
2617
|
-
children: /* @__PURE__ */ jsx(Primitive.div, {
|
|
2618
|
-
role: "tablist",
|
|
2619
|
-
"aria-orientation": context.orientation,
|
|
2620
|
-
...listProps,
|
|
2621
|
-
ref: forwardedRef
|
|
2622
|
-
})
|
|
2623
|
-
});
|
|
2624
|
-
});
|
|
2625
|
-
TabsList.displayName = TAB_LIST_NAME;
|
|
2626
|
-
var TRIGGER_NAME = "TabsTrigger";
|
|
2627
|
-
var TabsTrigger = React$1.forwardRef((props, forwardedRef) => {
|
|
2628
|
-
const { __scopeTabs, value, disabled = false, ...triggerProps } = props;
|
|
2629
|
-
const context = useTabsContext(TRIGGER_NAME, __scopeTabs);
|
|
2630
|
-
const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeTabs);
|
|
2631
|
-
const triggerId = makeTriggerId(context.baseId, value);
|
|
2632
|
-
const contentId = makeContentId(context.baseId, value);
|
|
2633
|
-
const isSelected = value === context.value;
|
|
2634
|
-
return /* @__PURE__ */ jsx(Item, {
|
|
2635
|
-
asChild: true,
|
|
2636
|
-
...rovingFocusGroupScope,
|
|
2637
|
-
focusable: !disabled,
|
|
2638
|
-
active: isSelected,
|
|
2639
|
-
children: /* @__PURE__ */ jsx(Primitive.button, {
|
|
2640
|
-
type: "button",
|
|
2641
|
-
role: "tab",
|
|
2642
|
-
"aria-selected": isSelected,
|
|
2643
|
-
"aria-controls": contentId,
|
|
2644
|
-
"data-state": isSelected ? "active" : "inactive",
|
|
2645
|
-
"data-disabled": disabled ? "" : void 0,
|
|
2646
|
-
disabled,
|
|
2647
|
-
id: triggerId,
|
|
2648
|
-
...triggerProps,
|
|
2649
|
-
ref: forwardedRef,
|
|
2650
|
-
onMouseDown: composeEventHandlers(props.onMouseDown, (event) => {
|
|
2651
|
-
if (!disabled && event.button === 0 && event.ctrlKey === false) context.onValueChange(value);
|
|
2652
|
-
else event.preventDefault();
|
|
2653
|
-
}),
|
|
2654
|
-
onKeyDown: composeEventHandlers(props.onKeyDown, (event) => {
|
|
2655
|
-
if ([" ", "Enter"].includes(event.key)) context.onValueChange(value);
|
|
2656
|
-
}),
|
|
2657
|
-
onFocus: composeEventHandlers(props.onFocus, () => {
|
|
2658
|
-
const isAutomaticActivation = context.activationMode !== "manual";
|
|
2659
|
-
if (!isSelected && !disabled && isAutomaticActivation) context.onValueChange(value);
|
|
2660
|
-
})
|
|
2661
|
-
})
|
|
2662
|
-
});
|
|
2663
|
-
});
|
|
2664
|
-
TabsTrigger.displayName = TRIGGER_NAME;
|
|
2665
|
-
var CONTENT_NAME = "TabsContent";
|
|
2666
|
-
var TabsContent = React$1.forwardRef((props, forwardedRef) => {
|
|
2667
|
-
const { __scopeTabs, value, forceMount, children, ...contentProps } = props;
|
|
2668
|
-
const context = useTabsContext(CONTENT_NAME, __scopeTabs);
|
|
2669
|
-
const triggerId = makeTriggerId(context.baseId, value);
|
|
2670
|
-
const contentId = makeContentId(context.baseId, value);
|
|
2671
|
-
const isSelected = value === context.value;
|
|
2672
|
-
const isMountAnimationPreventedRef = React$1.useRef(isSelected);
|
|
2673
|
-
React$1.useEffect(() => {
|
|
2674
|
-
const rAF = requestAnimationFrame(() => isMountAnimationPreventedRef.current = false);
|
|
2675
|
-
return () => cancelAnimationFrame(rAF);
|
|
2676
|
-
}, []);
|
|
2677
|
-
return /* @__PURE__ */ jsx(Presence, {
|
|
2678
|
-
present: forceMount || isSelected,
|
|
2679
|
-
children: ({ present }) => /* @__PURE__ */ jsx(Primitive.div, {
|
|
2680
|
-
"data-state": isSelected ? "active" : "inactive",
|
|
2681
|
-
"data-orientation": context.orientation,
|
|
2682
|
-
role: "tabpanel",
|
|
2683
|
-
"aria-labelledby": triggerId,
|
|
2684
|
-
hidden: !present,
|
|
2685
|
-
id: contentId,
|
|
2686
|
-
tabIndex: 0,
|
|
2687
|
-
...contentProps,
|
|
2688
|
-
ref: forwardedRef,
|
|
2689
|
-
style: {
|
|
2690
|
-
...props.style,
|
|
2691
|
-
animationDuration: isMountAnimationPreventedRef.current ? "0s" : void 0
|
|
2692
|
-
},
|
|
2693
|
-
children: present && children
|
|
2694
|
-
})
|
|
2695
|
-
});
|
|
2696
|
-
});
|
|
2697
|
-
TabsContent.displayName = CONTENT_NAME;
|
|
2698
|
-
function makeTriggerId(baseId, value) {
|
|
2699
|
-
return `${baseId}-trigger-${value}`;
|
|
2700
|
-
}
|
|
2701
|
-
function makeContentId(baseId, value) {
|
|
2702
|
-
return `${baseId}-content-${value}`;
|
|
2703
|
-
}
|
|
2704
|
-
var Root2 = Tabs;
|
|
2705
|
-
var List = TabsList;
|
|
2706
|
-
var Trigger = TabsTrigger;
|
|
2707
|
-
var Content = TabsContent;
|
|
2708
|
-
//#endregion
|
|
2709
|
-
export { twJoin as C, composeEventHandlers as S, useLayoutEffect2 as _, Item as a, composeRefs as b, Presence as c, useDirection as d, createCollection as f, useControllableState as g, createSlot as h, Trigger as i, useId$1 as l, dispatchDiscreteCustomEvent as m, List as n, Root as o, Primitive as p, Root2 as r, createRovingFocusGroupScope as s, Content as t, useCallbackRef as u, createContext2 as v, twMerge as w, useComposedRefs as x, createContextScope as y };
|
|
2312
|
+
export { dispatchDiscreteCustomEvent as a, useLayoutEffect2 as c, composeRefs as d, useComposedRefs as f, twMerge as h, Primitive as i, createContext2 as l, twJoin as m, useId$1 as n, createSlot as o, composeEventHandlers as p, useCallbackRef as r, useControllableState as s, Presence as t, createContextScope as u };
|
|
2710
2313
|
|
|
2711
|
-
//# sourceMappingURL=dist-
|
|
2314
|
+
//# sourceMappingURL=dist-D3_ER0Dn.js.map
|