@nswds/app 1.126.13 → 1.126.14
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/index.cjs +80 -17
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +80 -17
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -14470,7 +14470,7 @@ function FormatToggle({ format, setFormat }) {
|
|
|
14470
14470
|
|
|
14471
14471
|
// package.json
|
|
14472
14472
|
var package_default = {
|
|
14473
|
-
version: "1.126.
|
|
14473
|
+
version: "1.126.14"};
|
|
14474
14474
|
var SluggerContext = React5__namespace.default.createContext(null);
|
|
14475
14475
|
function flattenText(nodes) {
|
|
14476
14476
|
if (nodes == null || typeof nodes === "boolean") return "";
|
|
@@ -29298,12 +29298,39 @@ var BranchPage = ({ className, ...props }) => {
|
|
|
29298
29298
|
};
|
|
29299
29299
|
var useLayoutEffect22 = globalThis?.document ? React5__namespace.useLayoutEffect : () => {
|
|
29300
29300
|
};
|
|
29301
|
+
var __defProp = Object.defineProperty;
|
|
29302
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
29303
|
+
var useReactEffectEvent = React5__namespace[" useEffectEvent ".trim().toString()];
|
|
29304
|
+
var useReactInsertionEffect = React5__namespace[" useInsertionEffect ".trim().toString()];
|
|
29305
|
+
function useEffectEvent(callback) {
|
|
29306
|
+
if (typeof useReactEffectEvent === "function") {
|
|
29307
|
+
return useReactEffectEvent(callback);
|
|
29308
|
+
}
|
|
29309
|
+
const ref = React5__namespace.useRef(() => {
|
|
29310
|
+
throw new Error("Cannot call an event handler while rendering.");
|
|
29311
|
+
});
|
|
29312
|
+
if (typeof useReactInsertionEffect === "function") {
|
|
29313
|
+
useReactInsertionEffect(() => {
|
|
29314
|
+
ref.current = callback;
|
|
29315
|
+
});
|
|
29316
|
+
} else {
|
|
29317
|
+
useLayoutEffect22(() => {
|
|
29318
|
+
ref.current = callback;
|
|
29319
|
+
});
|
|
29320
|
+
}
|
|
29321
|
+
return React5__namespace.useMemo(() => ((...args) => ref.current?.(...args)), []);
|
|
29322
|
+
}
|
|
29323
|
+
__name(useEffectEvent, "useEffectEvent");
|
|
29324
|
+
|
|
29325
|
+
// node_modules/@radix-ui/react-use-controllable-state/dist/index.mjs
|
|
29326
|
+
var __defProp2 = Object.defineProperty;
|
|
29327
|
+
var __name2 = (target, value) => __defProp2(target, "name", { value, configurable: true });
|
|
29301
29328
|
var useInsertionEffect3 = React5__namespace[" useInsertionEffect ".trim().toString()] || useLayoutEffect22;
|
|
29302
29329
|
function useControllableState({
|
|
29303
29330
|
prop,
|
|
29304
29331
|
defaultProp,
|
|
29305
|
-
onChange = () => {
|
|
29306
|
-
},
|
|
29332
|
+
onChange = /* @__PURE__ */ __name2(() => {
|
|
29333
|
+
}, "onChange"),
|
|
29307
29334
|
caller
|
|
29308
29335
|
}) {
|
|
29309
29336
|
const [uncontrolledProp, setUncontrolledProp, onChangeRef] = useUncontrolledState({
|
|
@@ -29312,20 +29339,6 @@ function useControllableState({
|
|
|
29312
29339
|
});
|
|
29313
29340
|
const isControlled = prop !== void 0;
|
|
29314
29341
|
const value = isControlled ? prop : uncontrolledProp;
|
|
29315
|
-
{
|
|
29316
|
-
const isControlledRef = React5__namespace.useRef(prop !== void 0);
|
|
29317
|
-
React5__namespace.useEffect(() => {
|
|
29318
|
-
const wasControlled = isControlledRef.current;
|
|
29319
|
-
if (wasControlled !== isControlled) {
|
|
29320
|
-
const from = wasControlled ? "controlled" : "uncontrolled";
|
|
29321
|
-
const to = isControlled ? "controlled" : "uncontrolled";
|
|
29322
|
-
console.warn(
|
|
29323
|
-
`${caller} is changing from ${from} to ${to}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`
|
|
29324
|
-
);
|
|
29325
|
-
}
|
|
29326
|
-
isControlledRef.current = isControlled;
|
|
29327
|
-
}, [isControlled, caller]);
|
|
29328
|
-
}
|
|
29329
29342
|
const setValue = React5__namespace.useCallback(
|
|
29330
29343
|
(nextValue) => {
|
|
29331
29344
|
if (isControlled) {
|
|
@@ -29341,6 +29354,7 @@ function useControllableState({
|
|
|
29341
29354
|
);
|
|
29342
29355
|
return [value, setValue];
|
|
29343
29356
|
}
|
|
29357
|
+
__name2(useControllableState, "useControllableState");
|
|
29344
29358
|
function useUncontrolledState({
|
|
29345
29359
|
defaultProp,
|
|
29346
29360
|
onChange
|
|
@@ -29359,9 +29373,58 @@ function useUncontrolledState({
|
|
|
29359
29373
|
}, [value, prevValueRef]);
|
|
29360
29374
|
return [value, setValue, onChangeRef];
|
|
29361
29375
|
}
|
|
29376
|
+
__name2(useUncontrolledState, "useUncontrolledState");
|
|
29362
29377
|
function isFunction(value) {
|
|
29363
29378
|
return typeof value === "function";
|
|
29364
29379
|
}
|
|
29380
|
+
__name2(isFunction, "isFunction");
|
|
29381
|
+
var SYNC_STATE = /* @__PURE__ */ Symbol("RADIX:SYNC_STATE");
|
|
29382
|
+
function useControllableStateReducer(reducer, userArgs, initialArg, init) {
|
|
29383
|
+
const { prop: controlledState, defaultProp, onChange: onChangeProp, caller } = userArgs;
|
|
29384
|
+
const isControlled = controlledState !== void 0;
|
|
29385
|
+
const onChange = useEffectEvent(onChangeProp);
|
|
29386
|
+
const args = [{ ...initialArg, state: defaultProp }];
|
|
29387
|
+
if (init) {
|
|
29388
|
+
args.push(init);
|
|
29389
|
+
}
|
|
29390
|
+
const [internalState, dispatch] = React5__namespace.useReducer(
|
|
29391
|
+
(state2, action) => {
|
|
29392
|
+
if (action.type === SYNC_STATE) {
|
|
29393
|
+
return { ...state2, state: action.state };
|
|
29394
|
+
}
|
|
29395
|
+
const next = reducer(state2, action);
|
|
29396
|
+
if (isControlled && !Object.is(next.state, state2.state)) {
|
|
29397
|
+
onChange(next.state);
|
|
29398
|
+
}
|
|
29399
|
+
return next;
|
|
29400
|
+
},
|
|
29401
|
+
...args
|
|
29402
|
+
);
|
|
29403
|
+
const uncontrolledState = internalState.state;
|
|
29404
|
+
const prevValueRef = React5__namespace.useRef(uncontrolledState);
|
|
29405
|
+
React5__namespace.useEffect(() => {
|
|
29406
|
+
if (prevValueRef.current !== uncontrolledState) {
|
|
29407
|
+
prevValueRef.current = uncontrolledState;
|
|
29408
|
+
if (!isControlled) {
|
|
29409
|
+
onChange(uncontrolledState);
|
|
29410
|
+
}
|
|
29411
|
+
}
|
|
29412
|
+
}, [uncontrolledState, prevValueRef, isControlled]);
|
|
29413
|
+
const state = React5__namespace.useMemo(() => {
|
|
29414
|
+
const isControlled2 = controlledState !== void 0;
|
|
29415
|
+
if (isControlled2) {
|
|
29416
|
+
return { ...internalState, state: controlledState };
|
|
29417
|
+
}
|
|
29418
|
+
return internalState;
|
|
29419
|
+
}, [internalState, controlledState]);
|
|
29420
|
+
React5__namespace.useEffect(() => {
|
|
29421
|
+
if (isControlled && !Object.is(controlledState, internalState.state)) {
|
|
29422
|
+
dispatch({ type: SYNC_STATE, state: controlledState });
|
|
29423
|
+
}
|
|
29424
|
+
}, [controlledState, internalState.state, isControlled]);
|
|
29425
|
+
return [state, dispatch];
|
|
29426
|
+
}
|
|
29427
|
+
__name2(useControllableStateReducer, "useControllableStateReducer");
|
|
29365
29428
|
var badgeVariants2 = classVarianceAuthority.cva(
|
|
29366
29429
|
"inline-flex items-center justify-center rounded-sm border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",
|
|
29367
29430
|
{
|