Add files using upload-large-folder tool
Browse filesThis view is limited to 50 files because it contains too many changes.
See raw diff
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/ui/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/primitive/dist/index.d.mts +20 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/ui/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-dismissable-layer/dist/index.js +253 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/ui/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-popper/dist/index.d.mts +46 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/ui/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-popper/dist/index.mjs +308 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/ui/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-popper/dist/index.mjs.map +7 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/ui/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-presence/README.md +3 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/ui/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-presence/dist/index.d.mts +12 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/ui/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-presence/dist/index.d.ts +12 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/ui/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-presence/dist/index.js +171 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/ui/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-presence/dist/index.js.map +7 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/ui/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-presence/dist/index.mjs +139 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/ui/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-presence/dist/index.mjs.map +7 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/ui/node_modules/@radix-ui/react-use-callback-ref/dist/index.d.mts +7 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/ui/node_modules/@radix-ui/react-use-callback-ref/dist/index.d.ts +7 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/ui/node_modules/@radix-ui/react-use-callback-ref/dist/index.js +46 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/ui/node_modules/@radix-ui/react-use-callback-ref/dist/index.js.map +7 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/ui/node_modules/@radix-ui/react-use-callback-ref/dist/index.mjs +13 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/ui/node_modules/@radix-ui/react-use-callback-ref/dist/index.mjs.map +7 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/ui/node_modules/@radix-ui/react-use-controllable-state/dist/index.d.mts +40 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/ui/node_modules/@radix-ui/react-use-controllable-state/dist/index.d.ts +40 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/ui/node_modules/@radix-ui/react-use-controllable-state/dist/index.js +169 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/ui/node_modules/@radix-ui/react-use-controllable-state/dist/index.js.map +7 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/ui/node_modules/@radix-ui/react-use-controllable-state/dist/index.mjs +136 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/ui/node_modules/@radix-ui/react-use-controllable-state/dist/index.mjs.map +7 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/ui/node_modules/@radix-ui/react-use-effect-event/dist/index.d.mts +8 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/ui/node_modules/@radix-ui/react-use-effect-event/dist/index.d.ts +8 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/ui/node_modules/@radix-ui/react-use-effect-event/dist/index.js +60 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/ui/node_modules/@radix-ui/react-use-effect-event/dist/index.js.map +7 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/ui/node_modules/@radix-ui/react-use-effect-event/dist/index.mjs +27 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/ui/node_modules/@radix-ui/react-use-effect-event/dist/index.mjs.map +7 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/ui/node_modules/@radix-ui/react-use-effect-event/src/index.ts +1 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/ui/node_modules/@radix-ui/react-use-effect-event/src/use-effect-event.tsx +36 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/ui/node_modules/@radix-ui/react-use-escape-keydown/dist/index.d.mts +6 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/ui/node_modules/@radix-ui/react-use-escape-keydown/dist/index.d.ts +6 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/ui/node_modules/@radix-ui/react-use-escape-keydown/dist/index.js +52 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/ui/node_modules/@radix-ui/react-use-escape-keydown/dist/index.js.map +7 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/ui/node_modules/@radix-ui/react-use-escape-keydown/dist/index.mjs +19 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/ui/node_modules/@radix-ui/react-use-escape-keydown/dist/index.mjs.map +7 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/ui/node_modules/@radix-ui/react-use-layout-effect/dist/index.d.mts +12 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/ui/node_modules/@radix-ui/react-use-layout-effect/dist/index.d.ts +12 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/ui/node_modules/@radix-ui/react-use-layout-effect/dist/index.js +41 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/ui/node_modules/@radix-ui/react-use-layout-effect/dist/index.js.map +7 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/ui/node_modules/@radix-ui/react-use-layout-effect/dist/index.mjs +8 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/ui/node_modules/@radix-ui/react-use-layout-effect/dist/index.mjs.map +7 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/ui/node_modules/@radix-ui/react-use-previous/dist/index.d.mts +3 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/ui/node_modules/@radix-ui/react-use-previous/dist/index.d.ts +3 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/ui/node_modules/@radix-ui/react-use-previous/dist/index.js +49 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/ui/node_modules/@radix-ui/react-use-previous/dist/index.js.map +7 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/ui/node_modules/@radix-ui/react-use-previous/dist/index.mjs +16 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/ui/node_modules/@radix-ui/react-use-previous/dist/index.mjs.map +7 -0
platform/aiml/elizabeth/e-1-first_session/claude-code-router/ui/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/primitive/dist/index.d.mts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
declare const canUseDOM: boolean;
|
| 2 |
+
declare function composeEventHandlers<E extends {
|
| 3 |
+
defaultPrevented: boolean;
|
| 4 |
+
}>(originalEventHandler?: (event: E) => void, ourEventHandler?: (event: E) => void, { checkForDefaultPrevented }?: {
|
| 5 |
+
checkForDefaultPrevented?: boolean | undefined;
|
| 6 |
+
}): (event: E) => void;
|
| 7 |
+
declare function getOwnerWindow(element: Node | null | undefined): Window & typeof globalThis;
|
| 8 |
+
declare function getOwnerDocument(element: Node | null | undefined): Document;
|
| 9 |
+
/**
|
| 10 |
+
* Lifted from https://github.com/ariakit/ariakit/blob/main/packages/ariakit-core/src/utils/dom.ts#L37
|
| 11 |
+
* MIT License, Copyright (c) AriaKit.
|
| 12 |
+
*/
|
| 13 |
+
declare function getActiveElement(node: Node | null | undefined, activeDescendant?: boolean): HTMLElement | null;
|
| 14 |
+
declare function isFrame(element: Element): element is HTMLIFrameElement;
|
| 15 |
+
|
| 16 |
+
type Timeout = ReturnType<typeof setTimeout>;
|
| 17 |
+
type Interval = ReturnType<typeof setInterval>;
|
| 18 |
+
type Immediate = ReturnType<typeof setImmediate>;
|
| 19 |
+
|
| 20 |
+
export { type Immediate, type Interval, type Timeout, canUseDOM, composeEventHandlers, getActiveElement, getOwnerDocument, getOwnerWindow, isFrame };
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/ui/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-dismissable-layer/dist/index.js
ADDED
|
@@ -0,0 +1,253 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
+
"use strict";
|
| 2 |
+
"use client";
|
| 3 |
+
var __create = Object.create;
|
| 4 |
+
var __defProp = Object.defineProperty;
|
| 5 |
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
| 6 |
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
| 7 |
+
var __getProtoOf = Object.getPrototypeOf;
|
| 8 |
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
| 9 |
+
var __export = (target, all) => {
|
| 10 |
+
for (var name in all)
|
| 11 |
+
__defProp(target, name, { get: all[name], enumerable: true });
|
| 12 |
+
};
|
| 13 |
+
var __copyProps = (to, from, except, desc) => {
|
| 14 |
+
if (from && typeof from === "object" || typeof from === "function") {
|
| 15 |
+
for (let key of __getOwnPropNames(from))
|
| 16 |
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
| 17 |
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
| 18 |
+
}
|
| 19 |
+
return to;
|
| 20 |
+
};
|
| 21 |
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
| 22 |
+
// If the importer is in node compatibility mode or this is not an ESM
|
| 23 |
+
// file that has been converted to a CommonJS file using a Babel-
|
| 24 |
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
| 25 |
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
| 26 |
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
| 27 |
+
mod
|
| 28 |
+
));
|
| 29 |
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
| 30 |
+
|
| 31 |
+
// src/index.ts
|
| 32 |
+
var index_exports = {};
|
| 33 |
+
__export(index_exports, {
|
| 34 |
+
Branch: () => Branch,
|
| 35 |
+
DismissableLayer: () => DismissableLayer,
|
| 36 |
+
DismissableLayerBranch: () => DismissableLayerBranch,
|
| 37 |
+
Root: () => Root
|
| 38 |
+
});
|
| 39 |
+
module.exports = __toCommonJS(index_exports);
|
| 40 |
+
|
| 41 |
+
// src/dismissable-layer.tsx
|
| 42 |
+
var React = __toESM(require("react"));
|
| 43 |
+
var import_primitive = require("@radix-ui/primitive");
|
| 44 |
+
var import_react_primitive = require("@radix-ui/react-primitive");
|
| 45 |
+
var import_react_compose_refs = require("@radix-ui/react-compose-refs");
|
| 46 |
+
var import_react_use_callback_ref = require("@radix-ui/react-use-callback-ref");
|
| 47 |
+
var import_react_use_escape_keydown = require("@radix-ui/react-use-escape-keydown");
|
| 48 |
+
var import_jsx_runtime = require("react/jsx-runtime");
|
| 49 |
+
var DISMISSABLE_LAYER_NAME = "DismissableLayer";
|
| 50 |
+
var CONTEXT_UPDATE = "dismissableLayer.update";
|
| 51 |
+
var POINTER_DOWN_OUTSIDE = "dismissableLayer.pointerDownOutside";
|
| 52 |
+
var FOCUS_OUTSIDE = "dismissableLayer.focusOutside";
|
| 53 |
+
var originalBodyPointerEvents;
|
| 54 |
+
var DismissableLayerContext = React.createContext({
|
| 55 |
+
layers: /* @__PURE__ */ new Set(),
|
| 56 |
+
layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
|
| 57 |
+
branches: /* @__PURE__ */ new Set()
|
| 58 |
+
});
|
| 59 |
+
var DismissableLayer = React.forwardRef(
|
| 60 |
+
(props, forwardedRef) => {
|
| 61 |
+
const {
|
| 62 |
+
disableOutsidePointerEvents = false,
|
| 63 |
+
onEscapeKeyDown,
|
| 64 |
+
onPointerDownOutside,
|
| 65 |
+
onFocusOutside,
|
| 66 |
+
onInteractOutside,
|
| 67 |
+
onDismiss,
|
| 68 |
+
...layerProps
|
| 69 |
+
} = props;
|
| 70 |
+
const context = React.useContext(DismissableLayerContext);
|
| 71 |
+
const [node, setNode] = React.useState(null);
|
| 72 |
+
const ownerDocument = node?.ownerDocument ?? globalThis?.document;
|
| 73 |
+
const [, force] = React.useState({});
|
| 74 |
+
const composedRefs = (0, import_react_compose_refs.useComposedRefs)(forwardedRef, (node2) => setNode(node2));
|
| 75 |
+
const layers = Array.from(context.layers);
|
| 76 |
+
const [highestLayerWithOutsidePointerEventsDisabled] = [...context.layersWithOutsidePointerEventsDisabled].slice(-1);
|
| 77 |
+
const highestLayerWithOutsidePointerEventsDisabledIndex = layers.indexOf(highestLayerWithOutsidePointerEventsDisabled);
|
| 78 |
+
const index = node ? layers.indexOf(node) : -1;
|
| 79 |
+
const isBodyPointerEventsDisabled = context.layersWithOutsidePointerEventsDisabled.size > 0;
|
| 80 |
+
const isPointerEventsEnabled = index >= highestLayerWithOutsidePointerEventsDisabledIndex;
|
| 81 |
+
const pointerDownOutside = usePointerDownOutside((event) => {
|
| 82 |
+
const target = event.target;
|
| 83 |
+
const isPointerDownOnBranch = [...context.branches].some((branch) => branch.contains(target));
|
| 84 |
+
if (!isPointerEventsEnabled || isPointerDownOnBranch) return;
|
| 85 |
+
onPointerDownOutside?.(event);
|
| 86 |
+
onInteractOutside?.(event);
|
| 87 |
+
if (!event.defaultPrevented) onDismiss?.();
|
| 88 |
+
}, ownerDocument);
|
| 89 |
+
const focusOutside = useFocusOutside((event) => {
|
| 90 |
+
const target = event.target;
|
| 91 |
+
const isFocusInBranch = [...context.branches].some((branch) => branch.contains(target));
|
| 92 |
+
if (isFocusInBranch) return;
|
| 93 |
+
onFocusOutside?.(event);
|
| 94 |
+
onInteractOutside?.(event);
|
| 95 |
+
if (!event.defaultPrevented) onDismiss?.();
|
| 96 |
+
}, ownerDocument);
|
| 97 |
+
(0, import_react_use_escape_keydown.useEscapeKeydown)((event) => {
|
| 98 |
+
const isHighestLayer = index === context.layers.size - 1;
|
| 99 |
+
if (!isHighestLayer) return;
|
| 100 |
+
onEscapeKeyDown?.(event);
|
| 101 |
+
if (!event.defaultPrevented && onDismiss) {
|
| 102 |
+
event.preventDefault();
|
| 103 |
+
onDismiss();
|
| 104 |
+
}
|
| 105 |
+
}, ownerDocument);
|
| 106 |
+
React.useEffect(() => {
|
| 107 |
+
if (!node) return;
|
| 108 |
+
if (disableOutsidePointerEvents) {
|
| 109 |
+
if (context.layersWithOutsidePointerEventsDisabled.size === 0) {
|
| 110 |
+
originalBodyPointerEvents = ownerDocument.body.style.pointerEvents;
|
| 111 |
+
ownerDocument.body.style.pointerEvents = "none";
|
| 112 |
+
}
|
| 113 |
+
context.layersWithOutsidePointerEventsDisabled.add(node);
|
| 114 |
+
}
|
| 115 |
+
context.layers.add(node);
|
| 116 |
+
dispatchUpdate();
|
| 117 |
+
return () => {
|
| 118 |
+
if (disableOutsidePointerEvents && context.layersWithOutsidePointerEventsDisabled.size === 1) {
|
| 119 |
+
ownerDocument.body.style.pointerEvents = originalBodyPointerEvents;
|
| 120 |
+
}
|
| 121 |
+
};
|
| 122 |
+
}, [node, ownerDocument, disableOutsidePointerEvents, context]);
|
| 123 |
+
React.useEffect(() => {
|
| 124 |
+
return () => {
|
| 125 |
+
if (!node) return;
|
| 126 |
+
context.layers.delete(node);
|
| 127 |
+
context.layersWithOutsidePointerEventsDisabled.delete(node);
|
| 128 |
+
dispatchUpdate();
|
| 129 |
+
};
|
| 130 |
+
}, [node, context]);
|
| 131 |
+
React.useEffect(() => {
|
| 132 |
+
const handleUpdate = () => force({});
|
| 133 |
+
document.addEventListener(CONTEXT_UPDATE, handleUpdate);
|
| 134 |
+
return () => document.removeEventListener(CONTEXT_UPDATE, handleUpdate);
|
| 135 |
+
}, []);
|
| 136 |
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
| 137 |
+
import_react_primitive.Primitive.div,
|
| 138 |
+
{
|
| 139 |
+
...layerProps,
|
| 140 |
+
ref: composedRefs,
|
| 141 |
+
style: {
|
| 142 |
+
pointerEvents: isBodyPointerEventsDisabled ? isPointerEventsEnabled ? "auto" : "none" : void 0,
|
| 143 |
+
...props.style
|
| 144 |
+
},
|
| 145 |
+
onFocusCapture: (0, import_primitive.composeEventHandlers)(props.onFocusCapture, focusOutside.onFocusCapture),
|
| 146 |
+
onBlurCapture: (0, import_primitive.composeEventHandlers)(props.onBlurCapture, focusOutside.onBlurCapture),
|
| 147 |
+
onPointerDownCapture: (0, import_primitive.composeEventHandlers)(
|
| 148 |
+
props.onPointerDownCapture,
|
| 149 |
+
pointerDownOutside.onPointerDownCapture
|
| 150 |
+
)
|
| 151 |
+
}
|
| 152 |
+
);
|
| 153 |
+
}
|
| 154 |
+
);
|
| 155 |
+
DismissableLayer.displayName = DISMISSABLE_LAYER_NAME;
|
| 156 |
+
var BRANCH_NAME = "DismissableLayerBranch";
|
| 157 |
+
var DismissableLayerBranch = React.forwardRef((props, forwardedRef) => {
|
| 158 |
+
const context = React.useContext(DismissableLayerContext);
|
| 159 |
+
const ref = React.useRef(null);
|
| 160 |
+
const composedRefs = (0, import_react_compose_refs.useComposedRefs)(forwardedRef, ref);
|
| 161 |
+
React.useEffect(() => {
|
| 162 |
+
const node = ref.current;
|
| 163 |
+
if (node) {
|
| 164 |
+
context.branches.add(node);
|
| 165 |
+
return () => {
|
| 166 |
+
context.branches.delete(node);
|
| 167 |
+
};
|
| 168 |
+
}
|
| 169 |
+
}, [context.branches]);
|
| 170 |
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_primitive.Primitive.div, { ...props, ref: composedRefs });
|
| 171 |
+
});
|
| 172 |
+
DismissableLayerBranch.displayName = BRANCH_NAME;
|
| 173 |
+
function usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis?.document) {
|
| 174 |
+
const handlePointerDownOutside = (0, import_react_use_callback_ref.useCallbackRef)(onPointerDownOutside);
|
| 175 |
+
const isPointerInsideReactTreeRef = React.useRef(false);
|
| 176 |
+
const handleClickRef = React.useRef(() => {
|
| 177 |
+
});
|
| 178 |
+
React.useEffect(() => {
|
| 179 |
+
const handlePointerDown = (event) => {
|
| 180 |
+
if (event.target && !isPointerInsideReactTreeRef.current) {
|
| 181 |
+
let handleAndDispatchPointerDownOutsideEvent2 = function() {
|
| 182 |
+
handleAndDispatchCustomEvent(
|
| 183 |
+
POINTER_DOWN_OUTSIDE,
|
| 184 |
+
handlePointerDownOutside,
|
| 185 |
+
eventDetail,
|
| 186 |
+
{ discrete: true }
|
| 187 |
+
);
|
| 188 |
+
};
|
| 189 |
+
var handleAndDispatchPointerDownOutsideEvent = handleAndDispatchPointerDownOutsideEvent2;
|
| 190 |
+
const eventDetail = { originalEvent: event };
|
| 191 |
+
if (event.pointerType === "touch") {
|
| 192 |
+
ownerDocument.removeEventListener("click", handleClickRef.current);
|
| 193 |
+
handleClickRef.current = handleAndDispatchPointerDownOutsideEvent2;
|
| 194 |
+
ownerDocument.addEventListener("click", handleClickRef.current, { once: true });
|
| 195 |
+
} else {
|
| 196 |
+
handleAndDispatchPointerDownOutsideEvent2();
|
| 197 |
+
}
|
| 198 |
+
} else {
|
| 199 |
+
ownerDocument.removeEventListener("click", handleClickRef.current);
|
| 200 |
+
}
|
| 201 |
+
isPointerInsideReactTreeRef.current = false;
|
| 202 |
+
};
|
| 203 |
+
const timerId = window.setTimeout(() => {
|
| 204 |
+
ownerDocument.addEventListener("pointerdown", handlePointerDown);
|
| 205 |
+
}, 0);
|
| 206 |
+
return () => {
|
| 207 |
+
window.clearTimeout(timerId);
|
| 208 |
+
ownerDocument.removeEventListener("pointerdown", handlePointerDown);
|
| 209 |
+
ownerDocument.removeEventListener("click", handleClickRef.current);
|
| 210 |
+
};
|
| 211 |
+
}, [ownerDocument, handlePointerDownOutside]);
|
| 212 |
+
return {
|
| 213 |
+
// ensures we check React component tree (not just DOM tree)
|
| 214 |
+
onPointerDownCapture: () => isPointerInsideReactTreeRef.current = true
|
| 215 |
+
};
|
| 216 |
+
}
|
| 217 |
+
function useFocusOutside(onFocusOutside, ownerDocument = globalThis?.document) {
|
| 218 |
+
const handleFocusOutside = (0, import_react_use_callback_ref.useCallbackRef)(onFocusOutside);
|
| 219 |
+
const isFocusInsideReactTreeRef = React.useRef(false);
|
| 220 |
+
React.useEffect(() => {
|
| 221 |
+
const handleFocus = (event) => {
|
| 222 |
+
if (event.target && !isFocusInsideReactTreeRef.current) {
|
| 223 |
+
const eventDetail = { originalEvent: event };
|
| 224 |
+
handleAndDispatchCustomEvent(FOCUS_OUTSIDE, handleFocusOutside, eventDetail, {
|
| 225 |
+
discrete: false
|
| 226 |
+
});
|
| 227 |
+
}
|
| 228 |
+
};
|
| 229 |
+
ownerDocument.addEventListener("focusin", handleFocus);
|
| 230 |
+
return () => ownerDocument.removeEventListener("focusin", handleFocus);
|
| 231 |
+
}, [ownerDocument, handleFocusOutside]);
|
| 232 |
+
return {
|
| 233 |
+
onFocusCapture: () => isFocusInsideReactTreeRef.current = true,
|
| 234 |
+
onBlurCapture: () => isFocusInsideReactTreeRef.current = false
|
| 235 |
+
};
|
| 236 |
+
}
|
| 237 |
+
function dispatchUpdate() {
|
| 238 |
+
const event = new CustomEvent(CONTEXT_UPDATE);
|
| 239 |
+
document.dispatchEvent(event);
|
| 240 |
+
}
|
| 241 |
+
function handleAndDispatchCustomEvent(name, handler, detail, { discrete }) {
|
| 242 |
+
const target = detail.originalEvent.target;
|
| 243 |
+
const event = new CustomEvent(name, { bubbles: false, cancelable: true, detail });
|
| 244 |
+
if (handler) target.addEventListener(name, handler, { once: true });
|
| 245 |
+
if (discrete) {
|
| 246 |
+
(0, import_react_primitive.dispatchDiscreteCustomEvent)(target, event);
|
| 247 |
+
} else {
|
| 248 |
+
target.dispatchEvent(event);
|
| 249 |
+
}
|
| 250 |
+
}
|
| 251 |
+
var Root = DismissableLayer;
|
| 252 |
+
var Branch = DismissableLayerBranch;
|
| 253 |
+
//# sourceMappingURL=index.js.map
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/ui/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-popper/dist/index.d.mts
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import * as _radix_ui_react_context from '@radix-ui/react-context';
|
| 2 |
+
import * as React from 'react';
|
| 3 |
+
import * as ArrowPrimitive from '@radix-ui/react-arrow';
|
| 4 |
+
import { Primitive } from '@radix-ui/react-primitive';
|
| 5 |
+
import { Measurable } from '@radix-ui/rect';
|
| 6 |
+
|
| 7 |
+
declare const SIDE_OPTIONS: readonly ["top", "right", "bottom", "left"];
|
| 8 |
+
declare const ALIGN_OPTIONS: readonly ["start", "center", "end"];
|
| 9 |
+
type Side = (typeof SIDE_OPTIONS)[number];
|
| 10 |
+
type Align = (typeof ALIGN_OPTIONS)[number];
|
| 11 |
+
declare const createPopperScope: _radix_ui_react_context.CreateScope;
|
| 12 |
+
interface PopperProps {
|
| 13 |
+
children?: React.ReactNode;
|
| 14 |
+
}
|
| 15 |
+
declare const Popper: React.FC<PopperProps>;
|
| 16 |
+
type PrimitiveDivProps = React.ComponentPropsWithoutRef<typeof Primitive.div>;
|
| 17 |
+
interface PopperAnchorProps extends PrimitiveDivProps {
|
| 18 |
+
virtualRef?: React.RefObject<Measurable>;
|
| 19 |
+
}
|
| 20 |
+
declare const PopperAnchor: React.ForwardRefExoticComponent<PopperAnchorProps & React.RefAttributes<HTMLDivElement>>;
|
| 21 |
+
type Boundary = Element | null;
|
| 22 |
+
interface PopperContentProps extends PrimitiveDivProps {
|
| 23 |
+
side?: Side;
|
| 24 |
+
sideOffset?: number;
|
| 25 |
+
align?: Align;
|
| 26 |
+
alignOffset?: number;
|
| 27 |
+
arrowPadding?: number;
|
| 28 |
+
avoidCollisions?: boolean;
|
| 29 |
+
collisionBoundary?: Boundary | Boundary[];
|
| 30 |
+
collisionPadding?: number | Partial<Record<Side, number>>;
|
| 31 |
+
sticky?: 'partial' | 'always';
|
| 32 |
+
hideWhenDetached?: boolean;
|
| 33 |
+
updatePositionStrategy?: 'optimized' | 'always';
|
| 34 |
+
onPlaced?: () => void;
|
| 35 |
+
}
|
| 36 |
+
declare const PopperContent: React.ForwardRefExoticComponent<PopperContentProps & React.RefAttributes<HTMLDivElement>>;
|
| 37 |
+
type ArrowProps = React.ComponentPropsWithoutRef<typeof ArrowPrimitive.Root>;
|
| 38 |
+
interface PopperArrowProps extends ArrowProps {
|
| 39 |
+
}
|
| 40 |
+
declare const PopperArrow: React.ForwardRefExoticComponent<PopperArrowProps & React.RefAttributes<SVGSVGElement>>;
|
| 41 |
+
declare const Root: React.FC<PopperProps>;
|
| 42 |
+
declare const Anchor: React.ForwardRefExoticComponent<PopperAnchorProps & React.RefAttributes<HTMLDivElement>>;
|
| 43 |
+
declare const Content: React.ForwardRefExoticComponent<PopperContentProps & React.RefAttributes<HTMLDivElement>>;
|
| 44 |
+
declare const Arrow: React.ForwardRefExoticComponent<PopperArrowProps & React.RefAttributes<SVGSVGElement>>;
|
| 45 |
+
|
| 46 |
+
export { ALIGN_OPTIONS, Anchor, Arrow, Content, Popper, PopperAnchor, type PopperAnchorProps, PopperArrow, type PopperArrowProps, PopperContent, type PopperContentProps, type PopperProps, Root, SIDE_OPTIONS, createPopperScope };
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/ui/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-popper/dist/index.mjs
ADDED
|
@@ -0,0 +1,308 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use client";
|
| 2 |
+
|
| 3 |
+
// src/popper.tsx
|
| 4 |
+
import * as React from "react";
|
| 5 |
+
import {
|
| 6 |
+
useFloating,
|
| 7 |
+
autoUpdate,
|
| 8 |
+
offset,
|
| 9 |
+
shift,
|
| 10 |
+
limitShift,
|
| 11 |
+
hide,
|
| 12 |
+
arrow as floatingUIarrow,
|
| 13 |
+
flip,
|
| 14 |
+
size
|
| 15 |
+
} from "@floating-ui/react-dom";
|
| 16 |
+
import * as ArrowPrimitive from "@radix-ui/react-arrow";
|
| 17 |
+
import { useComposedRefs } from "@radix-ui/react-compose-refs";
|
| 18 |
+
import { createContextScope } from "@radix-ui/react-context";
|
| 19 |
+
import { Primitive } from "@radix-ui/react-primitive";
|
| 20 |
+
import { useCallbackRef } from "@radix-ui/react-use-callback-ref";
|
| 21 |
+
import { useLayoutEffect } from "@radix-ui/react-use-layout-effect";
|
| 22 |
+
import { useSize } from "@radix-ui/react-use-size";
|
| 23 |
+
import { jsx } from "react/jsx-runtime";
|
| 24 |
+
var SIDE_OPTIONS = ["top", "right", "bottom", "left"];
|
| 25 |
+
var ALIGN_OPTIONS = ["start", "center", "end"];
|
| 26 |
+
var POPPER_NAME = "Popper";
|
| 27 |
+
var [createPopperContext, createPopperScope] = createContextScope(POPPER_NAME);
|
| 28 |
+
var [PopperProvider, usePopperContext] = createPopperContext(POPPER_NAME);
|
| 29 |
+
var Popper = (props) => {
|
| 30 |
+
const { __scopePopper, children } = props;
|
| 31 |
+
const [anchor, setAnchor] = React.useState(null);
|
| 32 |
+
return /* @__PURE__ */ jsx(PopperProvider, { scope: __scopePopper, anchor, onAnchorChange: setAnchor, children });
|
| 33 |
+
};
|
| 34 |
+
Popper.displayName = POPPER_NAME;
|
| 35 |
+
var ANCHOR_NAME = "PopperAnchor";
|
| 36 |
+
var PopperAnchor = React.forwardRef(
|
| 37 |
+
(props, forwardedRef) => {
|
| 38 |
+
const { __scopePopper, virtualRef, ...anchorProps } = props;
|
| 39 |
+
const context = usePopperContext(ANCHOR_NAME, __scopePopper);
|
| 40 |
+
const ref = React.useRef(null);
|
| 41 |
+
const composedRefs = useComposedRefs(forwardedRef, ref);
|
| 42 |
+
const anchorRef = React.useRef(null);
|
| 43 |
+
React.useEffect(() => {
|
| 44 |
+
const previousAnchor = anchorRef.current;
|
| 45 |
+
anchorRef.current = virtualRef?.current || ref.current;
|
| 46 |
+
if (previousAnchor !== anchorRef.current) {
|
| 47 |
+
context.onAnchorChange(anchorRef.current);
|
| 48 |
+
}
|
| 49 |
+
});
|
| 50 |
+
return virtualRef ? null : /* @__PURE__ */ jsx(Primitive.div, { ...anchorProps, ref: composedRefs });
|
| 51 |
+
}
|
| 52 |
+
);
|
| 53 |
+
PopperAnchor.displayName = ANCHOR_NAME;
|
| 54 |
+
var CONTENT_NAME = "PopperContent";
|
| 55 |
+
var [PopperContentProvider, useContentContext] = createPopperContext(CONTENT_NAME);
|
| 56 |
+
var PopperContent = React.forwardRef(
|
| 57 |
+
(props, forwardedRef) => {
|
| 58 |
+
const {
|
| 59 |
+
__scopePopper,
|
| 60 |
+
side = "bottom",
|
| 61 |
+
sideOffset = 0,
|
| 62 |
+
align = "center",
|
| 63 |
+
alignOffset = 0,
|
| 64 |
+
arrowPadding = 0,
|
| 65 |
+
avoidCollisions = true,
|
| 66 |
+
collisionBoundary = [],
|
| 67 |
+
collisionPadding: collisionPaddingProp = 0,
|
| 68 |
+
sticky = "partial",
|
| 69 |
+
hideWhenDetached = false,
|
| 70 |
+
updatePositionStrategy = "optimized",
|
| 71 |
+
onPlaced,
|
| 72 |
+
...contentProps
|
| 73 |
+
} = props;
|
| 74 |
+
const context = usePopperContext(CONTENT_NAME, __scopePopper);
|
| 75 |
+
const [content, setContent] = React.useState(null);
|
| 76 |
+
const composedRefs = useComposedRefs(forwardedRef, (node) => setContent(node));
|
| 77 |
+
const [arrow, setArrow] = React.useState(null);
|
| 78 |
+
const arrowSize = useSize(arrow);
|
| 79 |
+
const arrowWidth = arrowSize?.width ?? 0;
|
| 80 |
+
const arrowHeight = arrowSize?.height ?? 0;
|
| 81 |
+
const desiredPlacement = side + (align !== "center" ? "-" + align : "");
|
| 82 |
+
const collisionPadding = typeof collisionPaddingProp === "number" ? collisionPaddingProp : { top: 0, right: 0, bottom: 0, left: 0, ...collisionPaddingProp };
|
| 83 |
+
const boundary = Array.isArray(collisionBoundary) ? collisionBoundary : [collisionBoundary];
|
| 84 |
+
const hasExplicitBoundaries = boundary.length > 0;
|
| 85 |
+
const detectOverflowOptions = {
|
| 86 |
+
padding: collisionPadding,
|
| 87 |
+
boundary: boundary.filter(isNotNull),
|
| 88 |
+
// with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
|
| 89 |
+
altBoundary: hasExplicitBoundaries
|
| 90 |
+
};
|
| 91 |
+
const { refs, floatingStyles, placement, isPositioned, middlewareData } = useFloating({
|
| 92 |
+
// default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues
|
| 93 |
+
strategy: "fixed",
|
| 94 |
+
placement: desiredPlacement,
|
| 95 |
+
whileElementsMounted: (...args) => {
|
| 96 |
+
const cleanup = autoUpdate(...args, {
|
| 97 |
+
animationFrame: updatePositionStrategy === "always"
|
| 98 |
+
});
|
| 99 |
+
return cleanup;
|
| 100 |
+
},
|
| 101 |
+
elements: {
|
| 102 |
+
reference: context.anchor
|
| 103 |
+
},
|
| 104 |
+
middleware: [
|
| 105 |
+
offset({ mainAxis: sideOffset + arrowHeight, alignmentAxis: alignOffset }),
|
| 106 |
+
avoidCollisions && shift({
|
| 107 |
+
mainAxis: true,
|
| 108 |
+
crossAxis: false,
|
| 109 |
+
limiter: sticky === "partial" ? limitShift() : void 0,
|
| 110 |
+
...detectOverflowOptions
|
| 111 |
+
}),
|
| 112 |
+
avoidCollisions && flip({ ...detectOverflowOptions }),
|
| 113 |
+
size({
|
| 114 |
+
...detectOverflowOptions,
|
| 115 |
+
apply: ({ elements, rects, availableWidth, availableHeight }) => {
|
| 116 |
+
const { width: anchorWidth, height: anchorHeight } = rects.reference;
|
| 117 |
+
const contentStyle = elements.floating.style;
|
| 118 |
+
contentStyle.setProperty("--radix-popper-available-width", `${availableWidth}px`);
|
| 119 |
+
contentStyle.setProperty("--radix-popper-available-height", `${availableHeight}px`);
|
| 120 |
+
contentStyle.setProperty("--radix-popper-anchor-width", `${anchorWidth}px`);
|
| 121 |
+
contentStyle.setProperty("--radix-popper-anchor-height", `${anchorHeight}px`);
|
| 122 |
+
}
|
| 123 |
+
}),
|
| 124 |
+
arrow && floatingUIarrow({ element: arrow, padding: arrowPadding }),
|
| 125 |
+
transformOrigin({ arrowWidth, arrowHeight }),
|
| 126 |
+
hideWhenDetached && hide({ strategy: "referenceHidden", ...detectOverflowOptions })
|
| 127 |
+
]
|
| 128 |
+
});
|
| 129 |
+
const [placedSide, placedAlign] = getSideAndAlignFromPlacement(placement);
|
| 130 |
+
const handlePlaced = useCallbackRef(onPlaced);
|
| 131 |
+
useLayoutEffect(() => {
|
| 132 |
+
if (isPositioned) {
|
| 133 |
+
handlePlaced?.();
|
| 134 |
+
}
|
| 135 |
+
}, [isPositioned, handlePlaced]);
|
| 136 |
+
const arrowX = middlewareData.arrow?.x;
|
| 137 |
+
const arrowY = middlewareData.arrow?.y;
|
| 138 |
+
const cannotCenterArrow = middlewareData.arrow?.centerOffset !== 0;
|
| 139 |
+
const [contentZIndex, setContentZIndex] = React.useState();
|
| 140 |
+
useLayoutEffect(() => {
|
| 141 |
+
if (content) setContentZIndex(window.getComputedStyle(content).zIndex);
|
| 142 |
+
}, [content]);
|
| 143 |
+
return /* @__PURE__ */ jsx(
|
| 144 |
+
"div",
|
| 145 |
+
{
|
| 146 |
+
ref: refs.setFloating,
|
| 147 |
+
"data-radix-popper-content-wrapper": "",
|
| 148 |
+
style: {
|
| 149 |
+
...floatingStyles,
|
| 150 |
+
transform: isPositioned ? floatingStyles.transform : "translate(0, -200%)",
|
| 151 |
+
// keep off the page when measuring
|
| 152 |
+
minWidth: "max-content",
|
| 153 |
+
zIndex: contentZIndex,
|
| 154 |
+
["--radix-popper-transform-origin"]: [
|
| 155 |
+
middlewareData.transformOrigin?.x,
|
| 156 |
+
middlewareData.transformOrigin?.y
|
| 157 |
+
].join(" "),
|
| 158 |
+
// hide the content if using the hide middleware and should be hidden
|
| 159 |
+
// set visibility to hidden and disable pointer events so the UI behaves
|
| 160 |
+
// as if the PopperContent isn't there at all
|
| 161 |
+
...middlewareData.hide?.referenceHidden && {
|
| 162 |
+
visibility: "hidden",
|
| 163 |
+
pointerEvents: "none"
|
| 164 |
+
}
|
| 165 |
+
},
|
| 166 |
+
dir: props.dir,
|
| 167 |
+
children: /* @__PURE__ */ jsx(
|
| 168 |
+
PopperContentProvider,
|
| 169 |
+
{
|
| 170 |
+
scope: __scopePopper,
|
| 171 |
+
placedSide,
|
| 172 |
+
onArrowChange: setArrow,
|
| 173 |
+
arrowX,
|
| 174 |
+
arrowY,
|
| 175 |
+
shouldHideArrow: cannotCenterArrow,
|
| 176 |
+
children: /* @__PURE__ */ jsx(
|
| 177 |
+
Primitive.div,
|
| 178 |
+
{
|
| 179 |
+
"data-side": placedSide,
|
| 180 |
+
"data-align": placedAlign,
|
| 181 |
+
...contentProps,
|
| 182 |
+
ref: composedRefs,
|
| 183 |
+
style: {
|
| 184 |
+
...contentProps.style,
|
| 185 |
+
// if the PopperContent hasn't been placed yet (not all measurements done)
|
| 186 |
+
// we prevent animations so that users's animation don't kick in too early referring wrong sides
|
| 187 |
+
animation: !isPositioned ? "none" : void 0
|
| 188 |
+
}
|
| 189 |
+
}
|
| 190 |
+
)
|
| 191 |
+
}
|
| 192 |
+
)
|
| 193 |
+
}
|
| 194 |
+
);
|
| 195 |
+
}
|
| 196 |
+
);
|
| 197 |
+
PopperContent.displayName = CONTENT_NAME;
|
| 198 |
+
var ARROW_NAME = "PopperArrow";
|
| 199 |
+
var OPPOSITE_SIDE = {
|
| 200 |
+
top: "bottom",
|
| 201 |
+
right: "left",
|
| 202 |
+
bottom: "top",
|
| 203 |
+
left: "right"
|
| 204 |
+
};
|
| 205 |
+
var PopperArrow = React.forwardRef(function PopperArrow2(props, forwardedRef) {
|
| 206 |
+
const { __scopePopper, ...arrowProps } = props;
|
| 207 |
+
const contentContext = useContentContext(ARROW_NAME, __scopePopper);
|
| 208 |
+
const baseSide = OPPOSITE_SIDE[contentContext.placedSide];
|
| 209 |
+
return (
|
| 210 |
+
// we have to use an extra wrapper because `ResizeObserver` (used by `useSize`)
|
| 211 |
+
// doesn't report size as we'd expect on SVG elements.
|
| 212 |
+
// it reports their bounding box which is effectively the largest path inside the SVG.
|
| 213 |
+
/* @__PURE__ */ jsx(
|
| 214 |
+
"span",
|
| 215 |
+
{
|
| 216 |
+
ref: contentContext.onArrowChange,
|
| 217 |
+
style: {
|
| 218 |
+
position: "absolute",
|
| 219 |
+
left: contentContext.arrowX,
|
| 220 |
+
top: contentContext.arrowY,
|
| 221 |
+
[baseSide]: 0,
|
| 222 |
+
transformOrigin: {
|
| 223 |
+
top: "",
|
| 224 |
+
right: "0 0",
|
| 225 |
+
bottom: "center 0",
|
| 226 |
+
left: "100% 0"
|
| 227 |
+
}[contentContext.placedSide],
|
| 228 |
+
transform: {
|
| 229 |
+
top: "translateY(100%)",
|
| 230 |
+
right: "translateY(50%) rotate(90deg) translateX(-50%)",
|
| 231 |
+
bottom: `rotate(180deg)`,
|
| 232 |
+
left: "translateY(50%) rotate(-90deg) translateX(50%)"
|
| 233 |
+
}[contentContext.placedSide],
|
| 234 |
+
visibility: contentContext.shouldHideArrow ? "hidden" : void 0
|
| 235 |
+
},
|
| 236 |
+
children: /* @__PURE__ */ jsx(
|
| 237 |
+
ArrowPrimitive.Root,
|
| 238 |
+
{
|
| 239 |
+
...arrowProps,
|
| 240 |
+
ref: forwardedRef,
|
| 241 |
+
style: {
|
| 242 |
+
...arrowProps.style,
|
| 243 |
+
// ensures the element can be measured correctly (mostly for if SVG)
|
| 244 |
+
display: "block"
|
| 245 |
+
}
|
| 246 |
+
}
|
| 247 |
+
)
|
| 248 |
+
}
|
| 249 |
+
)
|
| 250 |
+
);
|
| 251 |
+
});
|
| 252 |
+
PopperArrow.displayName = ARROW_NAME;
|
| 253 |
+
function isNotNull(value) {
|
| 254 |
+
return value !== null;
|
| 255 |
+
}
|
| 256 |
+
var transformOrigin = (options) => ({
|
| 257 |
+
name: "transformOrigin",
|
| 258 |
+
options,
|
| 259 |
+
fn(data) {
|
| 260 |
+
const { placement, rects, middlewareData } = data;
|
| 261 |
+
const cannotCenterArrow = middlewareData.arrow?.centerOffset !== 0;
|
| 262 |
+
const isArrowHidden = cannotCenterArrow;
|
| 263 |
+
const arrowWidth = isArrowHidden ? 0 : options.arrowWidth;
|
| 264 |
+
const arrowHeight = isArrowHidden ? 0 : options.arrowHeight;
|
| 265 |
+
const [placedSide, placedAlign] = getSideAndAlignFromPlacement(placement);
|
| 266 |
+
const noArrowAlign = { start: "0%", center: "50%", end: "100%" }[placedAlign];
|
| 267 |
+
const arrowXCenter = (middlewareData.arrow?.x ?? 0) + arrowWidth / 2;
|
| 268 |
+
const arrowYCenter = (middlewareData.arrow?.y ?? 0) + arrowHeight / 2;
|
| 269 |
+
let x = "";
|
| 270 |
+
let y = "";
|
| 271 |
+
if (placedSide === "bottom") {
|
| 272 |
+
x = isArrowHidden ? noArrowAlign : `${arrowXCenter}px`;
|
| 273 |
+
y = `${-arrowHeight}px`;
|
| 274 |
+
} else if (placedSide === "top") {
|
| 275 |
+
x = isArrowHidden ? noArrowAlign : `${arrowXCenter}px`;
|
| 276 |
+
y = `${rects.floating.height + arrowHeight}px`;
|
| 277 |
+
} else if (placedSide === "right") {
|
| 278 |
+
x = `${-arrowHeight}px`;
|
| 279 |
+
y = isArrowHidden ? noArrowAlign : `${arrowYCenter}px`;
|
| 280 |
+
} else if (placedSide === "left") {
|
| 281 |
+
x = `${rects.floating.width + arrowHeight}px`;
|
| 282 |
+
y = isArrowHidden ? noArrowAlign : `${arrowYCenter}px`;
|
| 283 |
+
}
|
| 284 |
+
return { data: { x, y } };
|
| 285 |
+
}
|
| 286 |
+
});
|
| 287 |
+
function getSideAndAlignFromPlacement(placement) {
|
| 288 |
+
const [side, align = "center"] = placement.split("-");
|
| 289 |
+
return [side, align];
|
| 290 |
+
}
|
| 291 |
+
var Root2 = Popper;
|
| 292 |
+
var Anchor = PopperAnchor;
|
| 293 |
+
var Content = PopperContent;
|
| 294 |
+
var Arrow = PopperArrow;
|
| 295 |
+
export {
|
| 296 |
+
ALIGN_OPTIONS,
|
| 297 |
+
Anchor,
|
| 298 |
+
Arrow,
|
| 299 |
+
Content,
|
| 300 |
+
Popper,
|
| 301 |
+
PopperAnchor,
|
| 302 |
+
PopperArrow,
|
| 303 |
+
PopperContent,
|
| 304 |
+
Root2 as Root,
|
| 305 |
+
SIDE_OPTIONS,
|
| 306 |
+
createPopperScope
|
| 307 |
+
};
|
| 308 |
+
//# sourceMappingURL=index.mjs.map
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/ui/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-popper/dist/index.mjs.map
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"version": 3,
|
| 3 |
+
"sources": ["../src/popper.tsx"],
|
| 4 |
+
"sourcesContent": ["import * as React from 'react';\nimport {\n useFloating,\n autoUpdate,\n offset,\n shift,\n limitShift,\n hide,\n arrow as floatingUIarrow,\n flip,\n size,\n} from '@floating-ui/react-dom';\nimport * as ArrowPrimitive from '@radix-ui/react-arrow';\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport { createContextScope } from '@radix-ui/react-context';\nimport { Primitive } from '@radix-ui/react-primitive';\nimport { useCallbackRef } from '@radix-ui/react-use-callback-ref';\nimport { useLayoutEffect } from '@radix-ui/react-use-layout-effect';\nimport { useSize } from '@radix-ui/react-use-size';\n\nimport type { Placement, Middleware } from '@floating-ui/react-dom';\nimport type { Scope } from '@radix-ui/react-context';\nimport type { Measurable } from '@radix-ui/rect';\n\nconst SIDE_OPTIONS = ['top', 'right', 'bottom', 'left'] as const;\nconst ALIGN_OPTIONS = ['start', 'center', 'end'] as const;\n\ntype Side = (typeof SIDE_OPTIONS)[number];\ntype Align = (typeof ALIGN_OPTIONS)[number];\n\n/* -------------------------------------------------------------------------------------------------\n * Popper\n * -----------------------------------------------------------------------------------------------*/\n\nconst POPPER_NAME = 'Popper';\n\ntype ScopedProps<P> = P & { __scopePopper?: Scope };\nconst [createPopperContext, createPopperScope] = createContextScope(POPPER_NAME);\n\ntype PopperContextValue = {\n anchor: Measurable | null;\n onAnchorChange(anchor: Measurable | null): void;\n};\nconst [PopperProvider, usePopperContext] = createPopperContext<PopperContextValue>(POPPER_NAME);\n\ninterface PopperProps {\n children?: React.ReactNode;\n}\nconst Popper: React.FC<PopperProps> = (props: ScopedProps<PopperProps>) => {\n const { __scopePopper, children } = props;\n const [anchor, setAnchor] = React.useState<Measurable | null>(null);\n return (\n <PopperProvider scope={__scopePopper} anchor={anchor} onAnchorChange={setAnchor}>\n {children}\n </PopperProvider>\n );\n};\n\nPopper.displayName = POPPER_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * PopperAnchor\n * -----------------------------------------------------------------------------------------------*/\n\nconst ANCHOR_NAME = 'PopperAnchor';\n\ntype PopperAnchorElement = React.ComponentRef<typeof Primitive.div>;\ntype PrimitiveDivProps = React.ComponentPropsWithoutRef<typeof Primitive.div>;\ninterface PopperAnchorProps extends PrimitiveDivProps {\n virtualRef?: React.RefObject<Measurable>;\n}\n\nconst PopperAnchor = React.forwardRef<PopperAnchorElement, PopperAnchorProps>(\n (props: ScopedProps<PopperAnchorProps>, forwardedRef) => {\n const { __scopePopper, virtualRef, ...anchorProps } = props;\n const context = usePopperContext(ANCHOR_NAME, __scopePopper);\n const ref = React.useRef<PopperAnchorElement>(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n\n const anchorRef = React.useRef<Measurable | null>(null);\n React.useEffect(() => {\n const previousAnchor = anchorRef.current;\n anchorRef.current = virtualRef?.current || ref.current;\n if (previousAnchor !== anchorRef.current) {\n // Consumer can anchor the popper to something that isn't\n // a DOM node e.g. pointer position, so we override the\n // `anchorRef` with their virtual ref in this case.\n context.onAnchorChange(anchorRef.current);\n }\n });\n\n return virtualRef ? null : <Primitive.div {...anchorProps} ref={composedRefs} />;\n }\n);\n\nPopperAnchor.displayName = ANCHOR_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * PopperContent\n * -----------------------------------------------------------------------------------------------*/\n\nconst CONTENT_NAME = 'PopperContent';\n\ntype PopperContentContextValue = {\n placedSide: Side;\n onArrowChange(arrow: HTMLSpanElement | null): void;\n arrowX?: number;\n arrowY?: number;\n shouldHideArrow: boolean;\n};\n\nconst [PopperContentProvider, useContentContext] =\n createPopperContext<PopperContentContextValue>(CONTENT_NAME);\n\ntype Boundary = Element | null;\n\ntype PopperContentElement = React.ComponentRef<typeof Primitive.div>;\ninterface PopperContentProps extends PrimitiveDivProps {\n side?: Side;\n sideOffset?: number;\n align?: Align;\n alignOffset?: number;\n arrowPadding?: number;\n avoidCollisions?: boolean;\n collisionBoundary?: Boundary | Boundary[];\n collisionPadding?: number | Partial<Record<Side, number>>;\n sticky?: 'partial' | 'always';\n hideWhenDetached?: boolean;\n updatePositionStrategy?: 'optimized' | 'always';\n onPlaced?: () => void;\n}\n\nconst PopperContent = React.forwardRef<PopperContentElement, PopperContentProps>(\n (props: ScopedProps<PopperContentProps>, forwardedRef) => {\n const {\n __scopePopper,\n side = 'bottom',\n sideOffset = 0,\n align = 'center',\n alignOffset = 0,\n arrowPadding = 0,\n avoidCollisions = true,\n collisionBoundary = [],\n collisionPadding: collisionPaddingProp = 0,\n sticky = 'partial',\n hideWhenDetached = false,\n updatePositionStrategy = 'optimized',\n onPlaced,\n ...contentProps\n } = props;\n\n const context = usePopperContext(CONTENT_NAME, __scopePopper);\n\n const [content, setContent] = React.useState<HTMLDivElement | null>(null);\n const composedRefs = useComposedRefs(forwardedRef, (node) => setContent(node));\n\n const [arrow, setArrow] = React.useState<HTMLSpanElement | null>(null);\n const arrowSize = useSize(arrow);\n const arrowWidth = arrowSize?.width ?? 0;\n const arrowHeight = arrowSize?.height ?? 0;\n\n const desiredPlacement = (side + (align !== 'center' ? '-' + align : '')) as Placement;\n\n const collisionPadding =\n typeof collisionPaddingProp === 'number'\n ? collisionPaddingProp\n : { top: 0, right: 0, bottom: 0, left: 0, ...collisionPaddingProp };\n\n const boundary = Array.isArray(collisionBoundary) ? collisionBoundary : [collisionBoundary];\n const hasExplicitBoundaries = boundary.length > 0;\n\n const detectOverflowOptions = {\n padding: collisionPadding,\n boundary: boundary.filter(isNotNull),\n // with `strategy: 'fixed'`, this is the only way to get it to respect boundaries\n altBoundary: hasExplicitBoundaries,\n };\n\n const { refs, floatingStyles, placement, isPositioned, middlewareData } = useFloating({\n // default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues\n strategy: 'fixed',\n placement: desiredPlacement,\n whileElementsMounted: (...args) => {\n const cleanup = autoUpdate(...args, {\n animationFrame: updatePositionStrategy === 'always',\n });\n return cleanup;\n },\n elements: {\n reference: context.anchor,\n },\n middleware: [\n offset({ mainAxis: sideOffset + arrowHeight, alignmentAxis: alignOffset }),\n avoidCollisions &&\n shift({\n mainAxis: true,\n crossAxis: false,\n limiter: sticky === 'partial' ? limitShift() : undefined,\n ...detectOverflowOptions,\n }),\n avoidCollisions && flip({ ...detectOverflowOptions }),\n size({\n ...detectOverflowOptions,\n apply: ({ elements, rects, availableWidth, availableHeight }) => {\n const { width: anchorWidth, height: anchorHeight } = rects.reference;\n const contentStyle = elements.floating.style;\n contentStyle.setProperty('--radix-popper-available-width', `${availableWidth}px`);\n contentStyle.setProperty('--radix-popper-available-height', `${availableHeight}px`);\n contentStyle.setProperty('--radix-popper-anchor-width', `${anchorWidth}px`);\n contentStyle.setProperty('--radix-popper-anchor-height', `${anchorHeight}px`);\n },\n }),\n arrow && floatingUIarrow({ element: arrow, padding: arrowPadding }),\n transformOrigin({ arrowWidth, arrowHeight }),\n hideWhenDetached && hide({ strategy: 'referenceHidden', ...detectOverflowOptions }),\n ],\n });\n\n const [placedSide, placedAlign] = getSideAndAlignFromPlacement(placement);\n\n const handlePlaced = useCallbackRef(onPlaced);\n useLayoutEffect(() => {\n if (isPositioned) {\n handlePlaced?.();\n }\n }, [isPositioned, handlePlaced]);\n\n const arrowX = middlewareData.arrow?.x;\n const arrowY = middlewareData.arrow?.y;\n const cannotCenterArrow = middlewareData.arrow?.centerOffset !== 0;\n\n const [contentZIndex, setContentZIndex] = React.useState<string>();\n useLayoutEffect(() => {\n if (content) setContentZIndex(window.getComputedStyle(content).zIndex);\n }, [content]);\n\n return (\n <div\n ref={refs.setFloating}\n data-radix-popper-content-wrapper=\"\"\n style={{\n ...floatingStyles,\n transform: isPositioned ? floatingStyles.transform : 'translate(0, -200%)', // keep off the page when measuring\n minWidth: 'max-content',\n zIndex: contentZIndex,\n ['--radix-popper-transform-origin' as any]: [\n middlewareData.transformOrigin?.x,\n middlewareData.transformOrigin?.y,\n ].join(' '),\n\n // hide the content if using the hide middleware and should be hidden\n // set visibility to hidden and disable pointer events so the UI behaves\n // as if the PopperContent isn't there at all\n ...(middlewareData.hide?.referenceHidden && {\n visibility: 'hidden',\n pointerEvents: 'none',\n }),\n }}\n // Floating UI interally calculates logical alignment based the `dir` attribute on\n // the reference/floating node, we must add this attribute here to ensure\n // this is calculated when portalled as well as inline.\n dir={props.dir}\n >\n <PopperContentProvider\n scope={__scopePopper}\n placedSide={placedSide}\n onArrowChange={setArrow}\n arrowX={arrowX}\n arrowY={arrowY}\n shouldHideArrow={cannotCenterArrow}\n >\n <Primitive.div\n data-side={placedSide}\n data-align={placedAlign}\n {...contentProps}\n ref={composedRefs}\n style={{\n ...contentProps.style,\n // if the PopperContent hasn't been placed yet (not all measurements done)\n // we prevent animations so that users's animation don't kick in too early referring wrong sides\n animation: !isPositioned ? 'none' : undefined,\n }}\n />\n </PopperContentProvider>\n </div>\n );\n }\n);\n\nPopperContent.displayName = CONTENT_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * PopperArrow\n * -----------------------------------------------------------------------------------------------*/\n\nconst ARROW_NAME = 'PopperArrow';\n\nconst OPPOSITE_SIDE: Record<Side, Side> = {\n top: 'bottom',\n right: 'left',\n bottom: 'top',\n left: 'right',\n};\n\ntype PopperArrowElement = React.ComponentRef<typeof ArrowPrimitive.Root>;\ntype ArrowProps = React.ComponentPropsWithoutRef<typeof ArrowPrimitive.Root>;\ninterface PopperArrowProps extends ArrowProps {}\n\nconst PopperArrow = React.forwardRef<PopperArrowElement, PopperArrowProps>(function PopperArrow(\n props: ScopedProps<PopperArrowProps>,\n forwardedRef\n) {\n const { __scopePopper, ...arrowProps } = props;\n const contentContext = useContentContext(ARROW_NAME, __scopePopper);\n const baseSide = OPPOSITE_SIDE[contentContext.placedSide];\n\n return (\n // we have to use an extra wrapper because `ResizeObserver` (used by `useSize`)\n // doesn't report size as we'd expect on SVG elements.\n // it reports their bounding box which is effectively the largest path inside the SVG.\n <span\n ref={contentContext.onArrowChange}\n style={{\n position: 'absolute',\n left: contentContext.arrowX,\n top: contentContext.arrowY,\n [baseSide]: 0,\n transformOrigin: {\n top: '',\n right: '0 0',\n bottom: 'center 0',\n left: '100% 0',\n }[contentContext.placedSide],\n transform: {\n top: 'translateY(100%)',\n right: 'translateY(50%) rotate(90deg) translateX(-50%)',\n bottom: `rotate(180deg)`,\n left: 'translateY(50%) rotate(-90deg) translateX(50%)',\n }[contentContext.placedSide],\n visibility: contentContext.shouldHideArrow ? 'hidden' : undefined,\n }}\n >\n <ArrowPrimitive.Root\n {...arrowProps}\n ref={forwardedRef}\n style={{\n ...arrowProps.style,\n // ensures the element can be measured correctly (mostly for if SVG)\n display: 'block',\n }}\n />\n </span>\n );\n});\n\nPopperArrow.displayName = ARROW_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\nfunction isNotNull<T>(value: T | null): value is T {\n return value !== null;\n}\n\nconst transformOrigin = (options: { arrowWidth: number; arrowHeight: number }): Middleware => ({\n name: 'transformOrigin',\n options,\n fn(data) {\n const { placement, rects, middlewareData } = data;\n\n const cannotCenterArrow = middlewareData.arrow?.centerOffset !== 0;\n const isArrowHidden = cannotCenterArrow;\n const arrowWidth = isArrowHidden ? 0 : options.arrowWidth;\n const arrowHeight = isArrowHidden ? 0 : options.arrowHeight;\n\n const [placedSide, placedAlign] = getSideAndAlignFromPlacement(placement);\n const noArrowAlign = { start: '0%', center: '50%', end: '100%' }[placedAlign];\n\n const arrowXCenter = (middlewareData.arrow?.x ?? 0) + arrowWidth / 2;\n const arrowYCenter = (middlewareData.arrow?.y ?? 0) + arrowHeight / 2;\n\n let x = '';\n let y = '';\n\n if (placedSide === 'bottom') {\n x = isArrowHidden ? noArrowAlign : `${arrowXCenter}px`;\n y = `${-arrowHeight}px`;\n } else if (placedSide === 'top') {\n x = isArrowHidden ? noArrowAlign : `${arrowXCenter}px`;\n y = `${rects.floating.height + arrowHeight}px`;\n } else if (placedSide === 'right') {\n x = `${-arrowHeight}px`;\n y = isArrowHidden ? noArrowAlign : `${arrowYCenter}px`;\n } else if (placedSide === 'left') {\n x = `${rects.floating.width + arrowHeight}px`;\n y = isArrowHidden ? noArrowAlign : `${arrowYCenter}px`;\n }\n return { data: { x, y } };\n },\n});\n\nfunction getSideAndAlignFromPlacement(placement: Placement) {\n const [side, align = 'center'] = placement.split('-');\n return [side as Side, align as Align] as const;\n}\n\nconst Root = Popper;\nconst Anchor = PopperAnchor;\nconst Content = PopperContent;\nconst Arrow = PopperArrow;\n\nexport {\n createPopperScope,\n //\n Popper,\n PopperAnchor,\n PopperContent,\n PopperArrow,\n //\n Root,\n Anchor,\n Content,\n Arrow,\n //\n SIDE_OPTIONS,\n ALIGN_OPTIONS,\n};\nexport type { PopperProps, PopperAnchorProps, PopperContentProps, PopperArrowProps };\n"],
|
| 5 |
+
"mappings": ";;;AAAA,YAAY,WAAW;AACvB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,SAAS;AAAA,EACT;AAAA,EACA;AAAA,OACK;AACP,YAAY,oBAAoB;AAChC,SAAS,uBAAuB;AAChC,SAAS,0BAA0B;AACnC,SAAS,iBAAiB;AAC1B,SAAS,sBAAsB;AAC/B,SAAS,uBAAuB;AAChC,SAAS,eAAe;AAkCpB;AA5BJ,IAAM,eAAe,CAAC,OAAO,SAAS,UAAU,MAAM;AACtD,IAAM,gBAAgB,CAAC,SAAS,UAAU,KAAK;AAS/C,IAAM,cAAc;AAGpB,IAAM,CAAC,qBAAqB,iBAAiB,IAAI,mBAAmB,WAAW;AAM/E,I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S,WAAW;AAAA,IAC5C,WAAW,eAAe,SAAS;AACjC,UAAI,GAAG,CAAC,WAAW;AACnB,UAAI,gBAAgB,eAAe,GAAG,YAAY;AAAA,IACpD,WAAW,eAAe,QAAQ;AAChC,UAAI,GAAG,MAAM,SAAS,QAAQ,WAAW;AACzC,UAAI,gBAAgB,eAAe,GAAG,YAAY;AAAA,IACpD;AACA,WAAO,EAAE,MAAM,EAAE,GAAG,EAAE,EAAE;AAAA,EAC1B;AACF;AAEA,SAAS,6BAA6B,WAAsB;AAC1D,QAAM,CAAC,MAAM,QAAQ,QAAQ,IAAI,UAAU,MAAM,GAAG;AACpD,SAAO,CAAC,MAAc,KAAc;AACtC;AAEA,IAAMC,QAAO;AACb,IAAM,SAAS;AACf,IAAM,UAAU;AAChB,IAAM,QAAQ;",
|
| 6 |
+
"names": ["PopperArrow", "Root"]
|
| 7 |
+
}
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/ui/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-presence/README.md
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# `react-presence`
|
| 2 |
+
|
| 3 |
+
This is an internal utility, not intended for public usage.
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/ui/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-presence/dist/index.d.mts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import * as React from 'react';
|
| 2 |
+
|
| 3 |
+
interface PresenceProps {
|
| 4 |
+
children: React.ReactElement | ((props: {
|
| 5 |
+
present: boolean;
|
| 6 |
+
}) => React.ReactElement);
|
| 7 |
+
present: boolean;
|
| 8 |
+
}
|
| 9 |
+
declare const Presence: React.FC<PresenceProps>;
|
| 10 |
+
declare const Root: React.FC<PresenceProps>;
|
| 11 |
+
|
| 12 |
+
export { Presence, type PresenceProps, Root };
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/ui/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-presence/dist/index.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import * as React from 'react';
|
| 2 |
+
|
| 3 |
+
interface PresenceProps {
|
| 4 |
+
children: React.ReactElement | ((props: {
|
| 5 |
+
present: boolean;
|
| 6 |
+
}) => React.ReactElement);
|
| 7 |
+
present: boolean;
|
| 8 |
+
}
|
| 9 |
+
declare const Presence: React.FC<PresenceProps>;
|
| 10 |
+
declare const Root: React.FC<PresenceProps>;
|
| 11 |
+
|
| 12 |
+
export { Presence, type PresenceProps, Root };
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/ui/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-presence/dist/index.js
ADDED
|
@@ -0,0 +1,171 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
"use client";
|
| 3 |
+
var __create = Object.create;
|
| 4 |
+
var __defProp = Object.defineProperty;
|
| 5 |
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
| 6 |
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
| 7 |
+
var __getProtoOf = Object.getPrototypeOf;
|
| 8 |
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
| 9 |
+
var __export = (target, all) => {
|
| 10 |
+
for (var name in all)
|
| 11 |
+
__defProp(target, name, { get: all[name], enumerable: true });
|
| 12 |
+
};
|
| 13 |
+
var __copyProps = (to, from, except, desc) => {
|
| 14 |
+
if (from && typeof from === "object" || typeof from === "function") {
|
| 15 |
+
for (let key of __getOwnPropNames(from))
|
| 16 |
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
| 17 |
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
| 18 |
+
}
|
| 19 |
+
return to;
|
| 20 |
+
};
|
| 21 |
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
| 22 |
+
// If the importer is in node compatibility mode or this is not an ESM
|
| 23 |
+
// file that has been converted to a CommonJS file using a Babel-
|
| 24 |
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
| 25 |
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
| 26 |
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
| 27 |
+
mod
|
| 28 |
+
));
|
| 29 |
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
| 30 |
+
|
| 31 |
+
// src/index.ts
|
| 32 |
+
var index_exports = {};
|
| 33 |
+
__export(index_exports, {
|
| 34 |
+
Presence: () => Presence,
|
| 35 |
+
Root: () => Root
|
| 36 |
+
});
|
| 37 |
+
module.exports = __toCommonJS(index_exports);
|
| 38 |
+
|
| 39 |
+
// src/presence.tsx
|
| 40 |
+
var React2 = __toESM(require("react"));
|
| 41 |
+
var import_react_compose_refs = require("@radix-ui/react-compose-refs");
|
| 42 |
+
var import_react_use_layout_effect = require("@radix-ui/react-use-layout-effect");
|
| 43 |
+
|
| 44 |
+
// src/use-state-machine.tsx
|
| 45 |
+
var React = __toESM(require("react"));
|
| 46 |
+
function useStateMachine(initialState, machine) {
|
| 47 |
+
return React.useReducer((state, event) => {
|
| 48 |
+
const nextState = machine[state][event];
|
| 49 |
+
return nextState ?? state;
|
| 50 |
+
}, initialState);
|
| 51 |
+
}
|
| 52 |
+
|
| 53 |
+
// src/presence.tsx
|
| 54 |
+
var Presence = (props) => {
|
| 55 |
+
const { present, children } = props;
|
| 56 |
+
const presence = usePresence(present);
|
| 57 |
+
const child = typeof children === "function" ? children({ present: presence.isPresent }) : React2.Children.only(children);
|
| 58 |
+
const ref = (0, import_react_compose_refs.useComposedRefs)(presence.ref, getElementRef(child));
|
| 59 |
+
const forceMount = typeof children === "function";
|
| 60 |
+
return forceMount || presence.isPresent ? React2.cloneElement(child, { ref }) : null;
|
| 61 |
+
};
|
| 62 |
+
Presence.displayName = "Presence";
|
| 63 |
+
function usePresence(present) {
|
| 64 |
+
const [node, setNode] = React2.useState();
|
| 65 |
+
const stylesRef = React2.useRef(null);
|
| 66 |
+
const prevPresentRef = React2.useRef(present);
|
| 67 |
+
const prevAnimationNameRef = React2.useRef("none");
|
| 68 |
+
const initialState = present ? "mounted" : "unmounted";
|
| 69 |
+
const [state, send] = useStateMachine(initialState, {
|
| 70 |
+
mounted: {
|
| 71 |
+
UNMOUNT: "unmounted",
|
| 72 |
+
ANIMATION_OUT: "unmountSuspended"
|
| 73 |
+
},
|
| 74 |
+
unmountSuspended: {
|
| 75 |
+
MOUNT: "mounted",
|
| 76 |
+
ANIMATION_END: "unmounted"
|
| 77 |
+
},
|
| 78 |
+
unmounted: {
|
| 79 |
+
MOUNT: "mounted"
|
| 80 |
+
}
|
| 81 |
+
});
|
| 82 |
+
React2.useEffect(() => {
|
| 83 |
+
const currentAnimationName = getAnimationName(stylesRef.current);
|
| 84 |
+
prevAnimationNameRef.current = state === "mounted" ? currentAnimationName : "none";
|
| 85 |
+
}, [state]);
|
| 86 |
+
(0, import_react_use_layout_effect.useLayoutEffect)(() => {
|
| 87 |
+
const styles = stylesRef.current;
|
| 88 |
+
const wasPresent = prevPresentRef.current;
|
| 89 |
+
const hasPresentChanged = wasPresent !== present;
|
| 90 |
+
if (hasPresentChanged) {
|
| 91 |
+
const prevAnimationName = prevAnimationNameRef.current;
|
| 92 |
+
const currentAnimationName = getAnimationName(styles);
|
| 93 |
+
if (present) {
|
| 94 |
+
send("MOUNT");
|
| 95 |
+
} else if (currentAnimationName === "none" || styles?.display === "none") {
|
| 96 |
+
send("UNMOUNT");
|
| 97 |
+
} else {
|
| 98 |
+
const isAnimating = prevAnimationName !== currentAnimationName;
|
| 99 |
+
if (wasPresent && isAnimating) {
|
| 100 |
+
send("ANIMATION_OUT");
|
| 101 |
+
} else {
|
| 102 |
+
send("UNMOUNT");
|
| 103 |
+
}
|
| 104 |
+
}
|
| 105 |
+
prevPresentRef.current = present;
|
| 106 |
+
}
|
| 107 |
+
}, [present, send]);
|
| 108 |
+
(0, import_react_use_layout_effect.useLayoutEffect)(() => {
|
| 109 |
+
if (node) {
|
| 110 |
+
let timeoutId;
|
| 111 |
+
const ownerWindow = node.ownerDocument.defaultView ?? window;
|
| 112 |
+
const handleAnimationEnd = (event) => {
|
| 113 |
+
const currentAnimationName = getAnimationName(stylesRef.current);
|
| 114 |
+
const isCurrentAnimation = currentAnimationName.includes(CSS.escape(event.animationName));
|
| 115 |
+
if (event.target === node && isCurrentAnimation) {
|
| 116 |
+
send("ANIMATION_END");
|
| 117 |
+
if (!prevPresentRef.current) {
|
| 118 |
+
const currentFillMode = node.style.animationFillMode;
|
| 119 |
+
node.style.animationFillMode = "forwards";
|
| 120 |
+
timeoutId = ownerWindow.setTimeout(() => {
|
| 121 |
+
if (node.style.animationFillMode === "forwards") {
|
| 122 |
+
node.style.animationFillMode = currentFillMode;
|
| 123 |
+
}
|
| 124 |
+
});
|
| 125 |
+
}
|
| 126 |
+
}
|
| 127 |
+
};
|
| 128 |
+
const handleAnimationStart = (event) => {
|
| 129 |
+
if (event.target === node) {
|
| 130 |
+
prevAnimationNameRef.current = getAnimationName(stylesRef.current);
|
| 131 |
+
}
|
| 132 |
+
};
|
| 133 |
+
node.addEventListener("animationstart", handleAnimationStart);
|
| 134 |
+
node.addEventListener("animationcancel", handleAnimationEnd);
|
| 135 |
+
node.addEventListener("animationend", handleAnimationEnd);
|
| 136 |
+
return () => {
|
| 137 |
+
ownerWindow.clearTimeout(timeoutId);
|
| 138 |
+
node.removeEventListener("animationstart", handleAnimationStart);
|
| 139 |
+
node.removeEventListener("animationcancel", handleAnimationEnd);
|
| 140 |
+
node.removeEventListener("animationend", handleAnimationEnd);
|
| 141 |
+
};
|
| 142 |
+
} else {
|
| 143 |
+
send("ANIMATION_END");
|
| 144 |
+
}
|
| 145 |
+
}, [node, send]);
|
| 146 |
+
return {
|
| 147 |
+
isPresent: ["mounted", "unmountSuspended"].includes(state),
|
| 148 |
+
ref: React2.useCallback((node2) => {
|
| 149 |
+
stylesRef.current = node2 ? getComputedStyle(node2) : null;
|
| 150 |
+
setNode(node2);
|
| 151 |
+
}, [])
|
| 152 |
+
};
|
| 153 |
+
}
|
| 154 |
+
function getAnimationName(styles) {
|
| 155 |
+
return styles?.animationName || "none";
|
| 156 |
+
}
|
| 157 |
+
function getElementRef(element) {
|
| 158 |
+
let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get;
|
| 159 |
+
let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
| 160 |
+
if (mayWarn) {
|
| 161 |
+
return element.ref;
|
| 162 |
+
}
|
| 163 |
+
getter = Object.getOwnPropertyDescriptor(element, "ref")?.get;
|
| 164 |
+
mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
| 165 |
+
if (mayWarn) {
|
| 166 |
+
return element.props.ref;
|
| 167 |
+
}
|
| 168 |
+
return element.props.ref || element.ref;
|
| 169 |
+
}
|
| 170 |
+
var Root = Presence;
|
| 171 |
+
//# sourceMappingURL=index.js.map
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/ui/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-presence/dist/index.js.map
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"version": 3,
|
| 3 |
+
"sources": ["../src/index.ts", "../src/presence.tsx", "../src/use-state-machine.tsx"],
|
| 4 |
+
"sourcesContent": ["'use client';\nexport { Presence, Root } from './presence';\nexport type { PresenceProps } from './presence';\n", "import * as React from 'react';\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport { useLayoutEffect } from '@radix-ui/react-use-layout-effect';\nimport { useStateMachine } from './use-state-machine';\n\ninterface PresenceProps {\n children: React.ReactElement | ((props: { present: boolean }) => React.ReactElement);\n present: boolean;\n}\n\nconst Presence: React.FC<PresenceProps> = (props) => {\n const { present, children } = props;\n const presence = usePresence(present);\n\n const child = (\n typeof children === 'function'\n ? children({ present: presence.isPresent })\n : React.Children.only(children)\n ) as React.ReactElement<{ ref?: React.Ref<HTMLElement> }>;\n\n const ref = useComposedRefs(presence.ref, getElementRef(child));\n const forceMount = typeof children === 'function';\n return forceMount || presence.isPresent ? React.cloneElement(child, { ref }) : null;\n};\n\nPresence.displayName = 'Presence';\n\n/* -------------------------------------------------------------------------------------------------\n * usePresence\n * -----------------------------------------------------------------------------------------------*/\n\nfunction usePresence(present: boolean) {\n const [node, setNode] = React.useState<HTMLElement>();\n const stylesRef = React.useRef<CSSStyleDeclaration | null>(null);\n const prevPresentRef = React.useRef(present);\n const prevAnimationNameRef = React.useRef<string>('none');\n const initialState = present ? 'mounted' : 'unmounted';\n const [state, send] = useStateMachine(initialState, {\n mounted: {\n UNMOUNT: 'unmounted',\n ANIMATION_OUT: 'unmountSuspended',\n },\n unmountSuspended: {\n MOUNT: 'mounted',\n ANIMATION_END: 'unmounted',\n },\n unmounted: {\n MOUNT: 'mounted',\n },\n });\n\n React.useEffect(() => {\n const currentAnimationName = getAnimationName(stylesRef.current);\n prevAnimationNameRef.current = state === 'mounted' ? currentAnimationName : 'none';\n }, [state]);\n\n useLayoutEffect(() => {\n const styles = stylesRef.current;\n const wasPresent = prevPresentRef.current;\n const hasPresentChanged = wasPresent !== present;\n\n if (hasPresentChanged) {\n const prevAnimationName = prevAnimationNameRef.current;\n const currentAnimationName = getAnimationName(styles);\n\n if (present) {\n send('MOUNT');\n } else if (currentAnimationName === 'none' || styles?.display === 'none') {\n // If there is no exit animation or the element is hidden, animations won't run\n // so we unmount instantly\n send('UNMOUNT');\n } else {\n /**\n * When `present` changes to `false`, we check changes to animation-name to\n * determine whether an animation has started. We chose this approach (reading\n * computed styles) because there is no `animationrun` event and `animationstart`\n * fires after `animation-delay` has expired which would be too late.\n */\n const isAnimating = prevAnimationName !== currentAnimationName;\n\n if (wasPresent && isAnimating) {\n send('ANIMATION_OUT');\n } else {\n send('UNMOUNT');\n }\n }\n\n prevPresentRef.current = present;\n }\n }, [present, send]);\n\n useLayoutEffect(() => {\n if (node) {\n let timeoutId: number;\n const ownerWindow = node.ownerDocument.defaultView ?? window;\n /**\n * Triggering an ANIMATION_OUT during an ANIMATION_IN will fire an `animationcancel`\n * event for ANIMATION_IN after we have entered `unmountSuspended` state. So, we\n * make sure we only trigger ANIMATION_END for the currently active animation.\n */\n const handleAnimationEnd = (event: AnimationEvent) => {\n const currentAnimationName = getAnimationName(stylesRef.current);\n // The event.animationName is unescaped for CSS syntax,\n // so we need to escape it to compare with the animationName computed from the style.\n const isCurrentAnimation = currentAnimationName.includes(CSS.escape(event.animationName));\n if (event.target === node && isCurrentAnimation) {\n // With React 18 concurrency this update is applied a frame after the\n // animation ends, creating a flash of visible content. By setting the\n // animation fill mode to \"forwards\", we force the node to keep the\n // styles of the last keyframe, removing the flash.\n //\n // Previously we flushed the update via ReactDom.flushSync, but with\n // exit animations this resulted in the node being removed from the\n // DOM before the synthetic animationEnd event was dispatched, meaning\n // user-provided event handlers would not be called.\n // https://github.com/radix-ui/primitives/pull/1849\n send('ANIMATION_END');\n if (!prevPresentRef.current) {\n const currentFillMode = node.style.animationFillMode;\n node.style.animationFillMode = 'forwards';\n // Reset the style after the node had time to unmount (for cases\n // where the component chooses not to unmount). Doing this any\n // sooner than `setTimeout` (e.g. with `requestAnimationFrame`)\n // still causes a flash.\n timeoutId = ownerWindow.setTimeout(() => {\n if (node.style.animationFillMode === 'forwards') {\n node.style.animationFillMode = currentFillMode;\n }\n });\n }\n }\n };\n const handleAnimationStart = (event: AnimationEvent) => {\n if (event.target === node) {\n // if animation occurred, store its name as the previous animation.\n prevAnimationNameRef.current = getAnimationName(stylesRef.current);\n }\n };\n node.addEventListener('animationstart', handleAnimationStart);\n node.addEventListener('animationcancel', handleAnimationEnd);\n node.addEventListener('animationend', handleAnimationEnd);\n return () => {\n ownerWindow.clearTimeout(timeoutId);\n node.removeEventListener('animationstart', handleAnimationStart);\n node.removeEventListener('animationcancel', handleAnimationEnd);\n node.removeEventListener('animationend', handleAnimationEnd);\n };\n } else {\n // Transition to the unmounted state if the node is removed prematurely.\n // We avoid doing so during cleanup as the node may change but still exist.\n send('ANIMATION_END');\n }\n }, [node, send]);\n\n return {\n isPresent: ['mounted', 'unmountSuspended'].includes(state),\n ref: React.useCallback((node: HTMLElement) => {\n stylesRef.current = node ? getComputedStyle(node) : null;\n setNode(node);\n }, []),\n };\n}\n\n/* -----------------------------------------------------------------------------------------------*/\n\nfunction getAnimationName(styles: CSSStyleDeclaration | null) {\n return styles?.animationName || 'none';\n}\n\n// Before React 19 accessing `element.props.ref` will throw a warning and suggest using `element.ref`\n// After React 19 accessing `element.ref` does the opposite.\n// https://github.com/facebook/react/pull/28348\n//\n// Access the ref using the method that doesn't yield a warning.\nfunction getElementRef(element: React.ReactElement<{ ref?: React.Ref<unknown> }>) {\n // React <=18 in DEV\n let getter = Object.getOwnPropertyDescriptor(element.props, 'ref')?.get;\n let mayWarn = getter && 'isReactWarning' in getter && getter.isReactWarning;\n if (mayWarn) {\n return (element as any).ref;\n }\n\n // React 19 in DEV\n getter = Object.getOwnPropertyDescriptor(element, 'ref')?.get;\n mayWarn = getter && 'isReactWarning' in getter && getter.isReactWarning;\n if (mayWarn) {\n return element.props.ref;\n }\n\n // Not DEV\n return element.props.ref || (element as any).ref;\n}\n\nconst Root = Presence;\n\nexport {\n Presence,\n //\n Root,\n};\nexport type { PresenceProps };\n", "import * as React from 'react';\n\ntype Machine<S> = { [k: string]: { [k: string]: S } };\ntype MachineState<T> = keyof T;\ntype MachineEvent<T> = keyof UnionToIntersection<T[keyof T]>;\n\n// \uD83E\uDD2F https://fettblog.eu/typescript-union-to-intersection/\ntype UnionToIntersection<T> = (T extends any ? (x: T) => any : never) extends (x: infer R) => any\n ? R\n : never;\n\nexport function useStateMachine<M>(\n initialState: MachineState<M>,\n machine: M & Machine<MachineState<M>>\n) {\n return React.useReducer((state: MachineState<M>, event: MachineEvent<M>): MachineState<M> => {\n const nextState = (machine[state] as any)[event];\n return nextState ?? state;\n }, initialState);\n}\n"],
|
| 5 |
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,SAAuB;AACvB,gCAAgC;AAChC,qCAAgC;;;ACFhC,YAAuB;AAWhB,SAAS,gBACd,cACA,SACA;AACA,SAAa,iBAAW,CAAC,OAAwB,UAA4C;AAC3F,UAAM,YAAa,QAAQ,KAAK,EAAU,KAAK;AAC/C,WAAO,aAAa;AAAA,EACtB,GAAG,YAAY;AACjB;;;ADTA,IAAM,WAAoC,CAAC,UAAU;AACnD,QAAM,EAAE,SAAS,SAAS,IAAI;AAC9B,QAAM,WAAW,YAAY,OAAO;AAEpC,QAAM,QACJ,OAAO,aAAa,aAChB,SAAS,EAAE,SAAS,SAAS,UAAU,CAAC,IAClC,gBAAS,KAAK,QAAQ;AAGlC,QAAM,UAAM,2CAAgB,SAAS,KAAK,cAAc,KAAK,CAAC;AAC9D,QAAM,aAAa,OAAO,aAAa;AACvC,SAAO,cAAc,SAAS,YAAkB,oBAAa,OAAO,EAAE,IAAI,CAAC,IAAI;AACjF;AAEA,SAAS,cAAc;AAMvB,SAAS,YAAY,SAAkB;AACrC,QAAM,CAAC,MAAM,OAAO,IAAU,gBAAsB;AACpD,QAAM,YAAkB,cAAmC,IAAI;AAC/D,QAAM,iBAAuB,cAAO,OAAO;AAC3C,QAAM,uBAA6B,cAAe,MAAM;AACxD,QAAM,eAAe,UAAU,YAAY;AAC3C,QAAM,CAAC,OAAO,IAAI,IAAI,gBAAgB,cAAc;AAAA,IAClD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
|
|
|
|
|
|
|
|
| 1 |
+
"use client";
|
| 2 |
+
|
| 3 |
+
// src/presence.tsx
|
| 4 |
+
import * as React2 from "react";
|
| 5 |
+
import { useComposedRefs } from "@radix-ui/react-compose-refs";
|
| 6 |
+
import { useLayoutEffect } from "@radix-ui/react-use-layout-effect";
|
| 7 |
+
|
| 8 |
+
// src/use-state-machine.tsx
|
| 9 |
+
import * as React from "react";
|
| 10 |
+
function useStateMachine(initialState, machine) {
|
| 11 |
+
return React.useReducer((state, event) => {
|
| 12 |
+
const nextState = machine[state][event];
|
| 13 |
+
return nextState ?? state;
|
| 14 |
+
}, initialState);
|
| 15 |
+
}
|
| 16 |
+
|
| 17 |
+
// src/presence.tsx
|
| 18 |
+
var Presence = (props) => {
|
| 19 |
+
const { present, children } = props;
|
| 20 |
+
const presence = usePresence(present);
|
| 21 |
+
const child = typeof children === "function" ? children({ present: presence.isPresent }) : React2.Children.only(children);
|
| 22 |
+
const ref = useComposedRefs(presence.ref, getElementRef(child));
|
| 23 |
+
const forceMount = typeof children === "function";
|
| 24 |
+
return forceMount || presence.isPresent ? React2.cloneElement(child, { ref }) : null;
|
| 25 |
+
};
|
| 26 |
+
Presence.displayName = "Presence";
|
| 27 |
+
function usePresence(present) {
|
| 28 |
+
const [node, setNode] = React2.useState();
|
| 29 |
+
const stylesRef = React2.useRef(null);
|
| 30 |
+
const prevPresentRef = React2.useRef(present);
|
| 31 |
+
const prevAnimationNameRef = React2.useRef("none");
|
| 32 |
+
const initialState = present ? "mounted" : "unmounted";
|
| 33 |
+
const [state, send] = useStateMachine(initialState, {
|
| 34 |
+
mounted: {
|
| 35 |
+
UNMOUNT: "unmounted",
|
| 36 |
+
ANIMATION_OUT: "unmountSuspended"
|
| 37 |
+
},
|
| 38 |
+
unmountSuspended: {
|
| 39 |
+
MOUNT: "mounted",
|
| 40 |
+
ANIMATION_END: "unmounted"
|
| 41 |
+
},
|
| 42 |
+
unmounted: {
|
| 43 |
+
MOUNT: "mounted"
|
| 44 |
+
}
|
| 45 |
+
});
|
| 46 |
+
React2.useEffect(() => {
|
| 47 |
+
const currentAnimationName = getAnimationName(stylesRef.current);
|
| 48 |
+
prevAnimationNameRef.current = state === "mounted" ? currentAnimationName : "none";
|
| 49 |
+
}, [state]);
|
| 50 |
+
useLayoutEffect(() => {
|
| 51 |
+
const styles = stylesRef.current;
|
| 52 |
+
const wasPresent = prevPresentRef.current;
|
| 53 |
+
const hasPresentChanged = wasPresent !== present;
|
| 54 |
+
if (hasPresentChanged) {
|
| 55 |
+
const prevAnimationName = prevAnimationNameRef.current;
|
| 56 |
+
const currentAnimationName = getAnimationName(styles);
|
| 57 |
+
if (present) {
|
| 58 |
+
send("MOUNT");
|
| 59 |
+
} else if (currentAnimationName === "none" || styles?.display === "none") {
|
| 60 |
+
send("UNMOUNT");
|
| 61 |
+
} else {
|
| 62 |
+
const isAnimating = prevAnimationName !== currentAnimationName;
|
| 63 |
+
if (wasPresent && isAnimating) {
|
| 64 |
+
send("ANIMATION_OUT");
|
| 65 |
+
} else {
|
| 66 |
+
send("UNMOUNT");
|
| 67 |
+
}
|
| 68 |
+
}
|
| 69 |
+
prevPresentRef.current = present;
|
| 70 |
+
}
|
| 71 |
+
}, [present, send]);
|
| 72 |
+
useLayoutEffect(() => {
|
| 73 |
+
if (node) {
|
| 74 |
+
let timeoutId;
|
| 75 |
+
const ownerWindow = node.ownerDocument.defaultView ?? window;
|
| 76 |
+
const handleAnimationEnd = (event) => {
|
| 77 |
+
const currentAnimationName = getAnimationName(stylesRef.current);
|
| 78 |
+
const isCurrentAnimation = currentAnimationName.includes(CSS.escape(event.animationName));
|
| 79 |
+
if (event.target === node && isCurrentAnimation) {
|
| 80 |
+
send("ANIMATION_END");
|
| 81 |
+
if (!prevPresentRef.current) {
|
| 82 |
+
const currentFillMode = node.style.animationFillMode;
|
| 83 |
+
node.style.animationFillMode = "forwards";
|
| 84 |
+
timeoutId = ownerWindow.setTimeout(() => {
|
| 85 |
+
if (node.style.animationFillMode === "forwards") {
|
| 86 |
+
node.style.animationFillMode = currentFillMode;
|
| 87 |
+
}
|
| 88 |
+
});
|
| 89 |
+
}
|
| 90 |
+
}
|
| 91 |
+
};
|
| 92 |
+
const handleAnimationStart = (event) => {
|
| 93 |
+
if (event.target === node) {
|
| 94 |
+
prevAnimationNameRef.current = getAnimationName(stylesRef.current);
|
| 95 |
+
}
|
| 96 |
+
};
|
| 97 |
+
node.addEventListener("animationstart", handleAnimationStart);
|
| 98 |
+
node.addEventListener("animationcancel", handleAnimationEnd);
|
| 99 |
+
node.addEventListener("animationend", handleAnimationEnd);
|
| 100 |
+
return () => {
|
| 101 |
+
ownerWindow.clearTimeout(timeoutId);
|
| 102 |
+
node.removeEventListener("animationstart", handleAnimationStart);
|
| 103 |
+
node.removeEventListener("animationcancel", handleAnimationEnd);
|
| 104 |
+
node.removeEventListener("animationend", handleAnimationEnd);
|
| 105 |
+
};
|
| 106 |
+
} else {
|
| 107 |
+
send("ANIMATION_END");
|
| 108 |
+
}
|
| 109 |
+
}, [node, send]);
|
| 110 |
+
return {
|
| 111 |
+
isPresent: ["mounted", "unmountSuspended"].includes(state),
|
| 112 |
+
ref: React2.useCallback((node2) => {
|
| 113 |
+
stylesRef.current = node2 ? getComputedStyle(node2) : null;
|
| 114 |
+
setNode(node2);
|
| 115 |
+
}, [])
|
| 116 |
+
};
|
| 117 |
+
}
|
| 118 |
+
function getAnimationName(styles) {
|
| 119 |
+
return styles?.animationName || "none";
|
| 120 |
+
}
|
| 121 |
+
function getElementRef(element) {
|
| 122 |
+
let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get;
|
| 123 |
+
let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
| 124 |
+
if (mayWarn) {
|
| 125 |
+
return element.ref;
|
| 126 |
+
}
|
| 127 |
+
getter = Object.getOwnPropertyDescriptor(element, "ref")?.get;
|
| 128 |
+
mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
| 129 |
+
if (mayWarn) {
|
| 130 |
+
return element.props.ref;
|
| 131 |
+
}
|
| 132 |
+
return element.props.ref || element.ref;
|
| 133 |
+
}
|
| 134 |
+
var Root = Presence;
|
| 135 |
+
export {
|
| 136 |
+
Presence,
|
| 137 |
+
Root
|
| 138 |
+
};
|
| 139 |
+
//# sourceMappingURL=index.mjs.map
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/ui/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-presence/dist/index.mjs.map
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"version": 3,
|
| 3 |
+
"sources": ["../src/presence.tsx", "../src/use-state-machine.tsx"],
|
| 4 |
+
"sourcesContent": ["import * as React from 'react';\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport { useLayoutEffect } from '@radix-ui/react-use-layout-effect';\nimport { useStateMachine } from './use-state-machine';\n\ninterface PresenceProps {\n children: React.ReactElement | ((props: { present: boolean }) => React.ReactElement);\n present: boolean;\n}\n\nconst Presence: React.FC<PresenceProps> = (props) => {\n const { present, children } = props;\n const presence = usePresence(present);\n\n const child = (\n typeof children === 'function'\n ? children({ present: presence.isPresent })\n : React.Children.only(children)\n ) as React.ReactElement<{ ref?: React.Ref<HTMLElement> }>;\n\n const ref = useComposedRefs(presence.ref, getElementRef(child));\n const forceMount = typeof children === 'function';\n return forceMount || presence.isPresent ? React.cloneElement(child, { ref }) : null;\n};\n\nPresence.displayName = 'Presence';\n\n/* -------------------------------------------------------------------------------------------------\n * usePresence\n * -----------------------------------------------------------------------------------------------*/\n\nfunction usePresence(present: boolean) {\n const [node, setNode] = React.useState<HTMLElement>();\n const stylesRef = React.useRef<CSSStyleDeclaration | null>(null);\n const prevPresentRef = React.useRef(present);\n const prevAnimationNameRef = React.useRef<string>('none');\n const initialState = present ? 'mounted' : 'unmounted';\n const [state, send] = useStateMachine(initialState, {\n mounted: {\n UNMOUNT: 'unmounted',\n ANIMATION_OUT: 'unmountSuspended',\n },\n unmountSuspended: {\n MOUNT: 'mounted',\n ANIMATION_END: 'unmounted',\n },\n unmounted: {\n MOUNT: 'mounted',\n },\n });\n\n React.useEffect(() => {\n const currentAnimationName = getAnimationName(stylesRef.current);\n prevAnimationNameRef.current = state === 'mounted' ? currentAnimationName : 'none';\n }, [state]);\n\n useLayoutEffect(() => {\n const styles = stylesRef.current;\n const wasPresent = prevPresentRef.current;\n const hasPresentChanged = wasPresent !== present;\n\n if (hasPresentChanged) {\n const prevAnimationName = prevAnimationNameRef.current;\n const currentAnimationName = getAnimationName(styles);\n\n if (present) {\n send('MOUNT');\n } else if (currentAnimationName === 'none' || styles?.display === 'none') {\n // If there is no exit animation or the element is hidden, animations won't run\n // so we unmount instantly\n send('UNMOUNT');\n } else {\n /**\n * When `present` changes to `false`, we check changes to animation-name to\n * determine whether an animation has started. We chose this approach (reading\n * computed styles) because there is no `animationrun` event and `animationstart`\n * fires after `animation-delay` has expired which would be too late.\n */\n const isAnimating = prevAnimationName !== currentAnimationName;\n\n if (wasPresent && isAnimating) {\n send('ANIMATION_OUT');\n } else {\n send('UNMOUNT');\n }\n }\n\n prevPresentRef.current = present;\n }\n }, [present, send]);\n\n useLayoutEffect(() => {\n if (node) {\n let timeoutId: number;\n const ownerWindow = node.ownerDocument.defaultView ?? window;\n /**\n * Triggering an ANIMATION_OUT during an ANIMATION_IN will fire an `animationcancel`\n * event for ANIMATION_IN after we have entered `unmountSuspended` state. So, we\n * make sure we only trigger ANIMATION_END for the currently active animation.\n */\n const handleAnimationEnd = (event: AnimationEvent) => {\n const currentAnimationName = getAnimationName(stylesRef.current);\n // The event.animationName is unescaped for CSS syntax,\n // so we need to escape it to compare with the animationName computed from the style.\n const isCurrentAnimation = currentAnimationName.includes(CSS.escape(event.animationName));\n if (event.target === node && isCurrentAnimation) {\n // With React 18 concurrency this update is applied a frame after the\n // animation ends, creating a flash of visible content. By setting the\n // animation fill mode to \"forwards\", we force the node to keep the\n // styles of the last keyframe, removing the flash.\n //\n // Previously we flushed the update via ReactDom.flushSync, but with\n // exit animations this resulted in the node being removed from the\n // DOM before the synthetic animationEnd event was dispatched, meaning\n // user-provided event handlers would not be called.\n // https://github.com/radix-ui/primitives/pull/1849\n send('ANIMATION_END');\n if (!prevPresentRef.current) {\n const currentFillMode = node.style.animationFillMode;\n node.style.animationFillMode = 'forwards';\n // Reset the style after the node had time to unmount (for cases\n // where the component chooses not to unmount). Doing this any\n // sooner than `setTimeout` (e.g. with `requestAnimationFrame`)\n // still causes a flash.\n timeoutId = ownerWindow.setTimeout(() => {\n if (node.style.animationFillMode === 'forwards') {\n node.style.animationFillMode = currentFillMode;\n }\n });\n }\n }\n };\n const handleAnimationStart = (event: AnimationEvent) => {\n if (event.target === node) {\n // if animation occurred, store its name as the previous animation.\n prevAnimationNameRef.current = getAnimationName(stylesRef.current);\n }\n };\n node.addEventListener('animationstart', handleAnimationStart);\n node.addEventListener('animationcancel', handleAnimationEnd);\n node.addEventListener('animationend', handleAnimationEnd);\n return () => {\n ownerWindow.clearTimeout(timeoutId);\n node.removeEventListener('animationstart', handleAnimationStart);\n node.removeEventListener('animationcancel', handleAnimationEnd);\n node.removeEventListener('animationend', handleAnimationEnd);\n };\n } else {\n // Transition to the unmounted state if the node is removed prematurely.\n // We avoid doing so during cleanup as the node may change but still exist.\n send('ANIMATION_END');\n }\n }, [node, send]);\n\n return {\n isPresent: ['mounted', 'unmountSuspended'].includes(state),\n ref: React.useCallback((node: HTMLElement) => {\n stylesRef.current = node ? getComputedStyle(node) : null;\n setNode(node);\n }, []),\n };\n}\n\n/* -----------------------------------------------------------------------------------------------*/\n\nfunction getAnimationName(styles: CSSStyleDeclaration | null) {\n return styles?.animationName || 'none';\n}\n\n// Before React 19 accessing `element.props.ref` will throw a warning and suggest using `element.ref`\n// After React 19 accessing `element.ref` does the opposite.\n// https://github.com/facebook/react/pull/28348\n//\n// Access the ref using the method that doesn't yield a warning.\nfunction getElementRef(element: React.ReactElement<{ ref?: React.Ref<unknown> }>) {\n // React <=18 in DEV\n let getter = Object.getOwnPropertyDescriptor(element.props, 'ref')?.get;\n let mayWarn = getter && 'isReactWarning' in getter && getter.isReactWarning;\n if (mayWarn) {\n return (element as any).ref;\n }\n\n // React 19 in DEV\n getter = Object.getOwnPropertyDescriptor(element, 'ref')?.get;\n mayWarn = getter && 'isReactWarning' in getter && getter.isReactWarning;\n if (mayWarn) {\n return element.props.ref;\n }\n\n // Not DEV\n return element.props.ref || (element as any).ref;\n}\n\nconst Root = Presence;\n\nexport {\n Presence,\n //\n Root,\n};\nexport type { PresenceProps };\n", "import * as React from 'react';\n\ntype Machine<S> = { [k: string]: { [k: string]: S } };\ntype MachineState<T> = keyof T;\ntype MachineEvent<T> = keyof UnionToIntersection<T[keyof T]>;\n\n// \uD83E\uDD2F https://fettblog.eu/typescript-union-to-intersection/\ntype UnionToIntersection<T> = (T extends any ? (x: T) => any : never) extends (x: infer R) => any\n ? R\n : never;\n\nexport function useStateMachine<M>(\n initialState: MachineState<M>,\n machine: M & Machine<MachineState<M>>\n) {\n return React.useReducer((state: MachineState<M>, event: MachineEvent<M>): MachineState<M> => {\n const nextState = (machine[state] as any)[event];\n return nextState ?? state;\n }, initialState);\n}\n"],
|
| 5 |
+
"mappings": ";;;AAAA,YAAYA,YAAW;AACvB,SAAS,uBAAuB;AAChC,SAAS,uBAAuB;;;ACFhC,YAAY,WAAW;AAWhB,SAAS,gBACd,cACA,SACA;AACA,SAAa,iBAAW,CAAC,OAAwB,UAA4C;AAC3F,UAAM,YAAa,QAAQ,KAAK,EAAU,KAAK;AAC/C,WAAO,aAAa;AAAA,EACtB,GAAG,YAAY;AACjB;;;ADTA,IAAM,WAAoC,CAAC,UAAU;AACnD,QAAM,EAAE,SAAS,SAAS,IAAI;AAC9B,QAAM,WAAW,YAAY,OAAO;AAEpC,QAAM,QACJ,OAAO,aAAa,aAChB,SAAS,EAAE,SAAS,SAAS,UAAU,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gBAAU,UAAUA,QAAO,iBAAiBA,KAAI,IAAI;AACpD,cAAQA,KAAI;AAAA,IACd,GAAG,CAAC,CAAC;AAAA,EACP;AACF;AAIA,SAAS,iBAAiB,QAAoC;AAC5D,SAAO,QAAQ,iBAAiB;AAClC;AAOA,SAAS,cAAc,SAA2D;AAEhF,MAAI,SAAS,OAAO,yBAAyB,QAAQ,OAAO,KAAK,GAAG;AACpE,MAAI,UAAU,UAAU,oBAAoB,UAAU,OAAO;AAC7D,MAAI,SAAS;AACX,WAAQ,QAAgB;AAAA,EAC1B;AAGA,WAAS,OAAO,yBAAyB,SAAS,KAAK,GAAG;AAC1D,YAAU,UAAU,oBAAoB,UAAU,OAAO;AACzD,MAAI,SAAS;AACX,WAAO,QAAQ,MAAM;AAAA,EACvB;AAGA,SAAO,QAAQ,MAAM,OAAQ,QAAgB;AAC/C;AAEA,IAAM,OAAO;",
|
| 6 |
+
"names": ["React", "node"]
|
| 7 |
+
}
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/ui/node_modules/@radix-ui/react-use-callback-ref/dist/index.d.mts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/**
|
| 2 |
+
* A custom hook that converts a callback to a ref to avoid triggering re-renders when passed as a
|
| 3 |
+
* prop or avoid re-executing effects when passed as a dependency
|
| 4 |
+
*/
|
| 5 |
+
declare function useCallbackRef<T extends (...args: any[]) => any>(callback: T | undefined): T;
|
| 6 |
+
|
| 7 |
+
export { useCallbackRef };
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/ui/node_modules/@radix-ui/react-use-callback-ref/dist/index.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/**
|
| 2 |
+
* A custom hook that converts a callback to a ref to avoid triggering re-renders when passed as a
|
| 3 |
+
* prop or avoid re-executing effects when passed as a dependency
|
| 4 |
+
*/
|
| 5 |
+
declare function useCallbackRef<T extends (...args: any[]) => any>(callback: T | undefined): T;
|
| 6 |
+
|
| 7 |
+
export { useCallbackRef };
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/ui/node_modules/@radix-ui/react-use-callback-ref/dist/index.js
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
var __create = Object.create;
|
| 3 |
+
var __defProp = Object.defineProperty;
|
| 4 |
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
| 5 |
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
| 6 |
+
var __getProtoOf = Object.getPrototypeOf;
|
| 7 |
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
| 8 |
+
var __export = (target, all) => {
|
| 9 |
+
for (var name in all)
|
| 10 |
+
__defProp(target, name, { get: all[name], enumerable: true });
|
| 11 |
+
};
|
| 12 |
+
var __copyProps = (to, from, except, desc) => {
|
| 13 |
+
if (from && typeof from === "object" || typeof from === "function") {
|
| 14 |
+
for (let key of __getOwnPropNames(from))
|
| 15 |
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
| 16 |
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
| 17 |
+
}
|
| 18 |
+
return to;
|
| 19 |
+
};
|
| 20 |
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
| 21 |
+
// If the importer is in node compatibility mode or this is not an ESM
|
| 22 |
+
// file that has been converted to a CommonJS file using a Babel-
|
| 23 |
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
| 24 |
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
| 25 |
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
| 26 |
+
mod
|
| 27 |
+
));
|
| 28 |
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
| 29 |
+
|
| 30 |
+
// packages/react/use-callback-ref/src/index.ts
|
| 31 |
+
var index_exports = {};
|
| 32 |
+
__export(index_exports, {
|
| 33 |
+
useCallbackRef: () => useCallbackRef
|
| 34 |
+
});
|
| 35 |
+
module.exports = __toCommonJS(index_exports);
|
| 36 |
+
|
| 37 |
+
// packages/react/use-callback-ref/src/use-callback-ref.tsx
|
| 38 |
+
var React = __toESM(require("react"));
|
| 39 |
+
function useCallbackRef(callback) {
|
| 40 |
+
const callbackRef = React.useRef(callback);
|
| 41 |
+
React.useEffect(() => {
|
| 42 |
+
callbackRef.current = callback;
|
| 43 |
+
});
|
| 44 |
+
return React.useMemo(() => (...args) => callbackRef.current?.(...args), []);
|
| 45 |
+
}
|
| 46 |
+
//# sourceMappingURL=index.js.map
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/ui/node_modules/@radix-ui/react-use-callback-ref/dist/index.js.map
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"version": 3,
|
| 3 |
+
"sources": ["../src/index.ts", "../src/use-callback-ref.tsx"],
|
| 4 |
+
"sourcesContent": ["export { useCallbackRef } from './use-callback-ref';\n", "import * as React from 'react';\n\n/**\n * A custom hook that converts a callback to a ref to avoid triggering re-renders when passed as a\n * prop or avoid re-executing effects when passed as a dependency\n */\nfunction useCallbackRef<T extends (...args: any[]) => any>(callback: T | undefined): T {\n const callbackRef = React.useRef(callback);\n\n React.useEffect(() => {\n callbackRef.current = callback;\n });\n\n // https://github.com/facebook/react/issues/19240\n return React.useMemo(() => ((...args) => callbackRef.current?.(...args)) as T, []);\n}\n\nexport { useCallbackRef };\n"],
|
| 5 |
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,YAAuB;AAMvB,SAAS,eAAkD,UAA4B;AACrF,QAAM,cAAoB,aAAO,QAAQ;AAEzC,EAAM,gBAAU,MAAM;AACpB,gBAAY,UAAU;AAAA,EACxB,CAAC;AAGD,SAAa,cAAQ,MAAO,IAAI,SAAS,YAAY,UAAU,GAAG,IAAI,GAAS,CAAC,CAAC;AACnF;",
|
| 6 |
+
"names": []
|
| 7 |
+
}
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/ui/node_modules/@radix-ui/react-use-callback-ref/dist/index.mjs
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// packages/react/use-callback-ref/src/use-callback-ref.tsx
|
| 2 |
+
import * as React from "react";
|
| 3 |
+
function useCallbackRef(callback) {
|
| 4 |
+
const callbackRef = React.useRef(callback);
|
| 5 |
+
React.useEffect(() => {
|
| 6 |
+
callbackRef.current = callback;
|
| 7 |
+
});
|
| 8 |
+
return React.useMemo(() => (...args) => callbackRef.current?.(...args), []);
|
| 9 |
+
}
|
| 10 |
+
export {
|
| 11 |
+
useCallbackRef
|
| 12 |
+
};
|
| 13 |
+
//# sourceMappingURL=index.mjs.map
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/ui/node_modules/@radix-ui/react-use-callback-ref/dist/index.mjs.map
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"version": 3,
|
| 3 |
+
"sources": ["../src/use-callback-ref.tsx"],
|
| 4 |
+
"sourcesContent": ["import * as React from 'react';\n\n/**\n * A custom hook that converts a callback to a ref to avoid triggering re-renders when passed as a\n * prop or avoid re-executing effects when passed as a dependency\n */\nfunction useCallbackRef<T extends (...args: any[]) => any>(callback: T | undefined): T {\n const callbackRef = React.useRef(callback);\n\n React.useEffect(() => {\n callbackRef.current = callback;\n });\n\n // https://github.com/facebook/react/issues/19240\n return React.useMemo(() => ((...args) => callbackRef.current?.(...args)) as T, []);\n}\n\nexport { useCallbackRef };\n"],
|
| 5 |
+
"mappings": ";AAAA,YAAY,WAAW;AAMvB,SAAS,eAAkD,UAA4B;AACrF,QAAM,cAAoB,aAAO,QAAQ;AAEzC,EAAM,gBAAU,MAAM;AACpB,gBAAY,UAAU;AAAA,EACxB,CAAC;AAGD,SAAa,cAAQ,MAAO,IAAI,SAAS,YAAY,UAAU,GAAG,IAAI,GAAS,CAAC,CAAC;AACnF;",
|
| 6 |
+
"names": []
|
| 7 |
+
}
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/ui/node_modules/@radix-ui/react-use-controllable-state/dist/index.d.mts
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import * as React from 'react';
|
| 2 |
+
|
| 3 |
+
type ChangeHandler$1<T> = (state: T) => void;
|
| 4 |
+
type SetStateFn<T> = React.Dispatch<React.SetStateAction<T>>;
|
| 5 |
+
interface UseControllableStateParams$1<T> {
|
| 6 |
+
prop?: T | undefined;
|
| 7 |
+
defaultProp: T;
|
| 8 |
+
onChange?: ChangeHandler$1<T>;
|
| 9 |
+
caller?: string;
|
| 10 |
+
}
|
| 11 |
+
declare function useControllableState<T>({ prop, defaultProp, onChange, caller, }: UseControllableStateParams$1<T>): [T, SetStateFn<T>];
|
| 12 |
+
|
| 13 |
+
type ChangeHandler<T> = (state: T) => void;
|
| 14 |
+
interface UseControllableStateParams<T> {
|
| 15 |
+
prop: T | undefined;
|
| 16 |
+
defaultProp: T;
|
| 17 |
+
onChange: ChangeHandler<T> | undefined;
|
| 18 |
+
caller: string;
|
| 19 |
+
}
|
| 20 |
+
interface AnyAction {
|
| 21 |
+
type: string;
|
| 22 |
+
}
|
| 23 |
+
declare function useControllableStateReducer<T, S extends {}, A extends AnyAction>(reducer: (prevState: S & {
|
| 24 |
+
state: T;
|
| 25 |
+
}, action: A) => S & {
|
| 26 |
+
state: T;
|
| 27 |
+
}, userArgs: UseControllableStateParams<T>, initialState: S): [S & {
|
| 28 |
+
state: T;
|
| 29 |
+
}, React.Dispatch<A>];
|
| 30 |
+
declare function useControllableStateReducer<T, S extends {}, I, A extends AnyAction>(reducer: (prevState: S & {
|
| 31 |
+
state: T;
|
| 32 |
+
}, action: A) => S & {
|
| 33 |
+
state: T;
|
| 34 |
+
}, userArgs: UseControllableStateParams<T>, initialArg: I, init: (i: I & {
|
| 35 |
+
state: T;
|
| 36 |
+
}) => S): [S & {
|
| 37 |
+
state: T;
|
| 38 |
+
}, React.Dispatch<A>];
|
| 39 |
+
|
| 40 |
+
export { useControllableState, useControllableStateReducer };
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/ui/node_modules/@radix-ui/react-use-controllable-state/dist/index.d.ts
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import * as React from 'react';
|
| 2 |
+
|
| 3 |
+
type ChangeHandler$1<T> = (state: T) => void;
|
| 4 |
+
type SetStateFn<T> = React.Dispatch<React.SetStateAction<T>>;
|
| 5 |
+
interface UseControllableStateParams$1<T> {
|
| 6 |
+
prop?: T | undefined;
|
| 7 |
+
defaultProp: T;
|
| 8 |
+
onChange?: ChangeHandler$1<T>;
|
| 9 |
+
caller?: string;
|
| 10 |
+
}
|
| 11 |
+
declare function useControllableState<T>({ prop, defaultProp, onChange, caller, }: UseControllableStateParams$1<T>): [T, SetStateFn<T>];
|
| 12 |
+
|
| 13 |
+
type ChangeHandler<T> = (state: T) => void;
|
| 14 |
+
interface UseControllableStateParams<T> {
|
| 15 |
+
prop: T | undefined;
|
| 16 |
+
defaultProp: T;
|
| 17 |
+
onChange: ChangeHandler<T> | undefined;
|
| 18 |
+
caller: string;
|
| 19 |
+
}
|
| 20 |
+
interface AnyAction {
|
| 21 |
+
type: string;
|
| 22 |
+
}
|
| 23 |
+
declare function useControllableStateReducer<T, S extends {}, A extends AnyAction>(reducer: (prevState: S & {
|
| 24 |
+
state: T;
|
| 25 |
+
}, action: A) => S & {
|
| 26 |
+
state: T;
|
| 27 |
+
}, userArgs: UseControllableStateParams<T>, initialState: S): [S & {
|
| 28 |
+
state: T;
|
| 29 |
+
}, React.Dispatch<A>];
|
| 30 |
+
declare function useControllableStateReducer<T, S extends {}, I, A extends AnyAction>(reducer: (prevState: S & {
|
| 31 |
+
state: T;
|
| 32 |
+
}, action: A) => S & {
|
| 33 |
+
state: T;
|
| 34 |
+
}, userArgs: UseControllableStateParams<T>, initialArg: I, init: (i: I & {
|
| 35 |
+
state: T;
|
| 36 |
+
}) => S): [S & {
|
| 37 |
+
state: T;
|
| 38 |
+
}, React.Dispatch<A>];
|
| 39 |
+
|
| 40 |
+
export { useControllableState, useControllableStateReducer };
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/ui/node_modules/@radix-ui/react-use-controllable-state/dist/index.js
ADDED
|
@@ -0,0 +1,169 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
var __create = Object.create;
|
| 3 |
+
var __defProp = Object.defineProperty;
|
| 4 |
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
| 5 |
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
| 6 |
+
var __getProtoOf = Object.getPrototypeOf;
|
| 7 |
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
| 8 |
+
var __export = (target, all) => {
|
| 9 |
+
for (var name in all)
|
| 10 |
+
__defProp(target, name, { get: all[name], enumerable: true });
|
| 11 |
+
};
|
| 12 |
+
var __copyProps = (to, from, except, desc) => {
|
| 13 |
+
if (from && typeof from === "object" || typeof from === "function") {
|
| 14 |
+
for (let key of __getOwnPropNames(from))
|
| 15 |
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
| 16 |
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
| 17 |
+
}
|
| 18 |
+
return to;
|
| 19 |
+
};
|
| 20 |
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
| 21 |
+
// If the importer is in node compatibility mode or this is not an ESM
|
| 22 |
+
// file that has been converted to a CommonJS file using a Babel-
|
| 23 |
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
| 24 |
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
| 25 |
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
| 26 |
+
mod
|
| 27 |
+
));
|
| 28 |
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
| 29 |
+
|
| 30 |
+
// src/index.ts
|
| 31 |
+
var index_exports = {};
|
| 32 |
+
__export(index_exports, {
|
| 33 |
+
useControllableState: () => useControllableState,
|
| 34 |
+
useControllableStateReducer: () => useControllableStateReducer
|
| 35 |
+
});
|
| 36 |
+
module.exports = __toCommonJS(index_exports);
|
| 37 |
+
|
| 38 |
+
// src/use-controllable-state.tsx
|
| 39 |
+
var React = __toESM(require("react"));
|
| 40 |
+
var import_react_use_layout_effect = require("@radix-ui/react-use-layout-effect");
|
| 41 |
+
var useInsertionEffect = React[" useInsertionEffect ".trim().toString()] || import_react_use_layout_effect.useLayoutEffect;
|
| 42 |
+
function useControllableState({
|
| 43 |
+
prop,
|
| 44 |
+
defaultProp,
|
| 45 |
+
onChange = () => {
|
| 46 |
+
},
|
| 47 |
+
caller
|
| 48 |
+
}) {
|
| 49 |
+
const [uncontrolledProp, setUncontrolledProp, onChangeRef] = useUncontrolledState({
|
| 50 |
+
defaultProp,
|
| 51 |
+
onChange
|
| 52 |
+
});
|
| 53 |
+
const isControlled = prop !== void 0;
|
| 54 |
+
const value = isControlled ? prop : uncontrolledProp;
|
| 55 |
+
if (true) {
|
| 56 |
+
const isControlledRef = React.useRef(prop !== void 0);
|
| 57 |
+
React.useEffect(() => {
|
| 58 |
+
const wasControlled = isControlledRef.current;
|
| 59 |
+
if (wasControlled !== isControlled) {
|
| 60 |
+
const from = wasControlled ? "controlled" : "uncontrolled";
|
| 61 |
+
const to = isControlled ? "controlled" : "uncontrolled";
|
| 62 |
+
console.warn(
|
| 63 |
+
`${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.`
|
| 64 |
+
);
|
| 65 |
+
}
|
| 66 |
+
isControlledRef.current = isControlled;
|
| 67 |
+
}, [isControlled, caller]);
|
| 68 |
+
}
|
| 69 |
+
const setValue = React.useCallback(
|
| 70 |
+
(nextValue) => {
|
| 71 |
+
if (isControlled) {
|
| 72 |
+
const value2 = isFunction(nextValue) ? nextValue(prop) : nextValue;
|
| 73 |
+
if (value2 !== prop) {
|
| 74 |
+
onChangeRef.current?.(value2);
|
| 75 |
+
}
|
| 76 |
+
} else {
|
| 77 |
+
setUncontrolledProp(nextValue);
|
| 78 |
+
}
|
| 79 |
+
},
|
| 80 |
+
[isControlled, prop, setUncontrolledProp, onChangeRef]
|
| 81 |
+
);
|
| 82 |
+
return [value, setValue];
|
| 83 |
+
}
|
| 84 |
+
function useUncontrolledState({
|
| 85 |
+
defaultProp,
|
| 86 |
+
onChange
|
| 87 |
+
}) {
|
| 88 |
+
const [value, setValue] = React.useState(defaultProp);
|
| 89 |
+
const prevValueRef = React.useRef(value);
|
| 90 |
+
const onChangeRef = React.useRef(onChange);
|
| 91 |
+
useInsertionEffect(() => {
|
| 92 |
+
onChangeRef.current = onChange;
|
| 93 |
+
}, [onChange]);
|
| 94 |
+
React.useEffect(() => {
|
| 95 |
+
if (prevValueRef.current !== value) {
|
| 96 |
+
onChangeRef.current?.(value);
|
| 97 |
+
prevValueRef.current = value;
|
| 98 |
+
}
|
| 99 |
+
}, [value, prevValueRef]);
|
| 100 |
+
return [value, setValue, onChangeRef];
|
| 101 |
+
}
|
| 102 |
+
function isFunction(value) {
|
| 103 |
+
return typeof value === "function";
|
| 104 |
+
}
|
| 105 |
+
|
| 106 |
+
// src/use-controllable-state-reducer.tsx
|
| 107 |
+
var React2 = __toESM(require("react"));
|
| 108 |
+
var import_react_use_effect_event = require("@radix-ui/react-use-effect-event");
|
| 109 |
+
var SYNC_STATE = Symbol("RADIX:SYNC_STATE");
|
| 110 |
+
function useControllableStateReducer(reducer, userArgs, initialArg, init) {
|
| 111 |
+
const { prop: controlledState, defaultProp, onChange: onChangeProp, caller } = userArgs;
|
| 112 |
+
const isControlled = controlledState !== void 0;
|
| 113 |
+
const onChange = (0, import_react_use_effect_event.useEffectEvent)(onChangeProp);
|
| 114 |
+
if (true) {
|
| 115 |
+
const isControlledRef = React2.useRef(controlledState !== void 0);
|
| 116 |
+
React2.useEffect(() => {
|
| 117 |
+
const wasControlled = isControlledRef.current;
|
| 118 |
+
if (wasControlled !== isControlled) {
|
| 119 |
+
const from = wasControlled ? "controlled" : "uncontrolled";
|
| 120 |
+
const to = isControlled ? "controlled" : "uncontrolled";
|
| 121 |
+
console.warn(
|
| 122 |
+
`${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.`
|
| 123 |
+
);
|
| 124 |
+
}
|
| 125 |
+
isControlledRef.current = isControlled;
|
| 126 |
+
}, [isControlled, caller]);
|
| 127 |
+
}
|
| 128 |
+
const args = [{ ...initialArg, state: defaultProp }];
|
| 129 |
+
if (init) {
|
| 130 |
+
args.push(init);
|
| 131 |
+
}
|
| 132 |
+
const [internalState, dispatch] = React2.useReducer(
|
| 133 |
+
(state2, action) => {
|
| 134 |
+
if (action.type === SYNC_STATE) {
|
| 135 |
+
return { ...state2, state: action.state };
|
| 136 |
+
}
|
| 137 |
+
const next = reducer(state2, action);
|
| 138 |
+
if (isControlled && !Object.is(next.state, state2.state)) {
|
| 139 |
+
onChange(next.state);
|
| 140 |
+
}
|
| 141 |
+
return next;
|
| 142 |
+
},
|
| 143 |
+
...args
|
| 144 |
+
);
|
| 145 |
+
const uncontrolledState = internalState.state;
|
| 146 |
+
const prevValueRef = React2.useRef(uncontrolledState);
|
| 147 |
+
React2.useEffect(() => {
|
| 148 |
+
if (prevValueRef.current !== uncontrolledState) {
|
| 149 |
+
prevValueRef.current = uncontrolledState;
|
| 150 |
+
if (!isControlled) {
|
| 151 |
+
onChange(uncontrolledState);
|
| 152 |
+
}
|
| 153 |
+
}
|
| 154 |
+
}, [onChange, uncontrolledState, prevValueRef, isControlled]);
|
| 155 |
+
const state = React2.useMemo(() => {
|
| 156 |
+
const isControlled2 = controlledState !== void 0;
|
| 157 |
+
if (isControlled2) {
|
| 158 |
+
return { ...internalState, state: controlledState };
|
| 159 |
+
}
|
| 160 |
+
return internalState;
|
| 161 |
+
}, [internalState, controlledState]);
|
| 162 |
+
React2.useEffect(() => {
|
| 163 |
+
if (isControlled && !Object.is(controlledState, internalState.state)) {
|
| 164 |
+
dispatch({ type: SYNC_STATE, state: controlledState });
|
| 165 |
+
}
|
| 166 |
+
}, [controlledState, internalState.state, isControlled]);
|
| 167 |
+
return [state, dispatch];
|
| 168 |
+
}
|
| 169 |
+
//# sourceMappingURL=index.js.map
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/ui/node_modules/@radix-ui/react-use-controllable-state/dist/index.js.map
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"version": 3,
|
| 3 |
+
"sources": ["../src/index.ts", "../src/use-controllable-state.tsx", "../src/use-controllable-state-reducer.tsx"],
|
| 4 |
+
"sourcesContent": ["export { useControllableState } from './use-controllable-state';\nexport { useControllableStateReducer } from './use-controllable-state-reducer';\n", "import * as React from 'react';\nimport { useLayoutEffect } from '@radix-ui/react-use-layout-effect';\n\n// Prevent bundlers from trying to optimize the import\nconst useInsertionEffect: typeof useLayoutEffect =\n (React as any)[' useInsertionEffect '.trim().toString()] || useLayoutEffect;\n\ntype ChangeHandler<T> = (state: T) => void;\ntype SetStateFn<T> = React.Dispatch<React.SetStateAction<T>>;\n\ninterface UseControllableStateParams<T> {\n prop?: T | undefined;\n defaultProp: T;\n onChange?: ChangeHandler<T>;\n caller?: string;\n}\n\nexport function useControllableState<T>({\n prop,\n defaultProp,\n onChange = () => {},\n caller,\n}: UseControllableStateParams<T>): [T, SetStateFn<T>] {\n const [uncontrolledProp, setUncontrolledProp, onChangeRef] = useUncontrolledState({\n defaultProp,\n onChange,\n });\n const isControlled = prop !== undefined;\n const value = isControlled ? prop : uncontrolledProp;\n\n // OK to disable conditionally calling hooks here because they will always run\n // consistently in the same environment. Bundlers should be able to remove the\n // code block entirely in production.\n /* eslint-disable react-hooks/rules-of-hooks */\n if (process.env.NODE_ENV !== 'production') {\n const isControlledRef = React.useRef(prop !== undefined);\n React.useEffect(() => {\n const wasControlled = isControlledRef.current;\n if (wasControlled !== isControlled) {\n const from = wasControlled ? 'controlled' : 'uncontrolled';\n const to = isControlled ? 'controlled' : 'uncontrolled';\n console.warn(\n `${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.`\n );\n }\n isControlledRef.current = isControlled;\n }, [isControlled, caller]);\n }\n /* eslint-enable react-hooks/rules-of-hooks */\n\n const setValue = React.useCallback<SetStateFn<T>>(\n (nextValue) => {\n if (isControlled) {\n const value = isFunction(nextValue) ? nextValue(prop) : nextValue;\n if (value !== prop) {\n onChangeRef.current?.(value);\n }\n } else {\n setUncontrolledProp(nextValue);\n }\n },\n [isControlled, prop, setUncontrolledProp, onChangeRef]\n );\n\n return [value, setValue];\n}\n\nfunction useUncontrolledState<T>({\n defaultProp,\n onChange,\n}: Omit<UseControllableStateParams<T>, 'prop'>): [\n Value: T,\n setValue: React.Dispatch<React.SetStateAction<T>>,\n OnChangeRef: React.RefObject<ChangeHandler<T> | undefined>,\n] {\n const [value, setValue] = React.useState(defaultProp);\n const prevValueRef = React.useRef(value);\n\n const onChangeRef = React.useRef(onChange);\n useInsertionEffect(() => {\n onChangeRef.current = onChange;\n }, [onChange]);\n\n React.useEffect(() => {\n if (prevValueRef.current !== value) {\n onChangeRef.current?.(value);\n prevValueRef.current = value;\n }\n }, [value, prevValueRef]);\n\n return [value, setValue, onChangeRef];\n}\n\nfunction isFunction(value: unknown): value is (...args: any[]) => any {\n return typeof value === 'function';\n}\n", "import * as React from 'react';\nimport { useEffectEvent } from '@radix-ui/react-use-effect-event';\n\ntype ChangeHandler<T> = (state: T) => void;\n\ninterface UseControllableStateParams<T> {\n prop: T | undefined;\n defaultProp: T;\n onChange: ChangeHandler<T> | undefined;\n caller: string;\n}\n\ninterface AnyAction {\n type: string;\n}\n\nconst SYNC_STATE = Symbol('RADIX:SYNC_STATE');\n\ninterface SyncStateAction<T> {\n type: typeof SYNC_STATE;\n state: T;\n}\n\nexport function useControllableStateReducer<T, S extends {}, A extends AnyAction>(\n reducer: (prevState: S & { state: T }, action: A) => S & { state: T },\n userArgs: UseControllableStateParams<T>,\n initialState: S\n): [S & { state: T }, React.Dispatch<A>];\n\nexport function useControllableStateReducer<T, S extends {}, I, A extends AnyAction>(\n reducer: (prevState: S & { state: T }, action: A) => S & { state: T },\n userArgs: UseControllableStateParams<T>,\n initialArg: I,\n init: (i: I & { state: T }) => S\n): [S & { state: T }, React.Dispatch<A>];\n\nexport function useControllableStateReducer<T, S extends {}, A extends AnyAction>(\n reducer: (prevState: S & { state: T }, action: A) => S & { state: T },\n userArgs: UseControllableStateParams<T>,\n initialArg: any,\n init?: (i: any) => Omit<S, 'state'>\n): [S & { state: T }, React.Dispatch<A>] {\n const { prop: controlledState, defaultProp, onChange: onChangeProp, caller } = userArgs;\n const isControlled = controlledState !== undefined;\n\n const onChange = useEffectEvent(onChangeProp);\n\n // OK to disable conditionally calling hooks here because they will always run\n // consistently in the same environment. Bundlers should be able to remove the\n // code block entirely in production.\n /* eslint-disable react-hooks/rules-of-hooks */\n if (process.env.NODE_ENV !== 'production') {\n const isControlledRef = React.useRef(controlledState !== undefined);\n React.useEffect(() => {\n const wasControlled = isControlledRef.current;\n if (wasControlled !== isControlled) {\n const from = wasControlled ? 'controlled' : 'uncontrolled';\n const to = isControlled ? 'controlled' : 'uncontrolled';\n console.warn(\n `${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.`\n );\n }\n isControlledRef.current = isControlled;\n }, [isControlled, caller]);\n }\n /* eslint-enable react-hooks/rules-of-hooks */\n\n type InternalState = S & { state: T };\n const args: [InternalState] = [{ ...initialArg, state: defaultProp }];\n if (init) {\n // @ts-expect-error\n args.push(init);\n }\n\n const [internalState, dispatch] = React.useReducer(\n (state: InternalState, action: A | SyncStateAction<T>): InternalState => {\n if (action.type === SYNC_STATE) {\n return { ...state, state: action.state };\n }\n\n const next = reducer(state, action);\n if (isControlled && !Object.is(next.state, state.state)) {\n onChange(next.state);\n }\n return next;\n },\n ...args\n );\n\n const uncontrolledState = internalState.state;\n const prevValueRef = React.useRef(uncontrolledState);\n React.useEffect(() => {\n if (prevValueRef.current !== uncontrolledState) {\n prevValueRef.current = uncontrolledState;\n if (!isControlled) {\n onChange(uncontrolledState);\n }\n }\n }, [onChange, uncontrolledState, prevValueRef, isControlled]);\n\n const state = React.useMemo(() => {\n const isControlled = controlledState !== undefined;\n if (isControlled) {\n return { ...internalState, state: controlledState };\n }\n\n return internalState;\n }, [internalState, controlledState]);\n\n React.useEffect(() => {\n // Sync internal state for controlled components so that reducer is called\n // with the correct state values\n if (isControlled && !Object.is(controlledState, internalState.state)) {\n dispatch({ type: SYNC_STATE, state: controlledState });\n }\n }, [controlledState, internalState.state, isControlled]);\n\n return [state, dispatch as React.Dispatch<A>];\n}\n"],
|
| 5 |
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,YAAuB;AACvB,qCAAgC;AAGhC,IAAM,qBACH,MAAc,uBAAuB,KAAK,EAAE,SAAS,CAAC,KAAK;AAYvD,SAAS,qBAAwB;AAAA,EACtC;AAAA,EACA;AAAA,EACA,WAAW,MAAM;AAAA,EAAC;AAAA,EAClB;AACF,GAAsD;AACpD,QAAM,CAAC,kBAAkB,qBAAqB,WAAW,IAAI,qBAAqB;AAAA,IAChF;AAAA,IACA;AAAA,EACF,CAAC;AACD,QAAM,eAAe,SAAS;AAC9B,QAAM,QAAQ,eAAe,OAAO;AAMpC,MAAI,MAAuC;AACzC,UAAM,kBAAwB,aAAO,SAAS,MAAS;AACvD,IAAM,gB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;AAE5D,QAAM,QAAc,eAAQ,MAAM;AAChC,UAAMC,gBAAe,oBAAoB;AACzC,QAAIA,eAAc;AAChB,aAAO,EAAE,GAAG,eAAe,OAAO,gBAAgB;AAAA,IACpD;AAEA,WAAO;AAAA,EACT,GAAG,CAAC,eAAe,eAAe,CAAC;AAEnC,EAAM,iBAAU,MAAM;AAGpB,QAAI,gBAAgB,CAAC,OAAO,GAAG,iBAAiB,cAAc,KAAK,GAAG;AACpE,eAAS,EAAE,MAAM,YAAY,OAAO,gBAAgB,CAAC;AAAA,IACvD;AAAA,EACF,GAAG,CAAC,iBAAiB,cAAc,OAAO,YAAY,CAAC;AAEvD,SAAO,CAAC,OAAO,QAA6B;AAC9C;",
|
| 6 |
+
"names": ["value", "React", "state", "isControlled"]
|
| 7 |
+
}
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/ui/node_modules/@radix-ui/react-use-controllable-state/dist/index.mjs
ADDED
|
@@ -0,0 +1,136 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// src/use-controllable-state.tsx
|
| 2 |
+
import * as React from "react";
|
| 3 |
+
import { useLayoutEffect } from "@radix-ui/react-use-layout-effect";
|
| 4 |
+
var useInsertionEffect = React[" useInsertionEffect ".trim().toString()] || useLayoutEffect;
|
| 5 |
+
function useControllableState({
|
| 6 |
+
prop,
|
| 7 |
+
defaultProp,
|
| 8 |
+
onChange = () => {
|
| 9 |
+
},
|
| 10 |
+
caller
|
| 11 |
+
}) {
|
| 12 |
+
const [uncontrolledProp, setUncontrolledProp, onChangeRef] = useUncontrolledState({
|
| 13 |
+
defaultProp,
|
| 14 |
+
onChange
|
| 15 |
+
});
|
| 16 |
+
const isControlled = prop !== void 0;
|
| 17 |
+
const value = isControlled ? prop : uncontrolledProp;
|
| 18 |
+
if (true) {
|
| 19 |
+
const isControlledRef = React.useRef(prop !== void 0);
|
| 20 |
+
React.useEffect(() => {
|
| 21 |
+
const wasControlled = isControlledRef.current;
|
| 22 |
+
if (wasControlled !== isControlled) {
|
| 23 |
+
const from = wasControlled ? "controlled" : "uncontrolled";
|
| 24 |
+
const to = isControlled ? "controlled" : "uncontrolled";
|
| 25 |
+
console.warn(
|
| 26 |
+
`${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.`
|
| 27 |
+
);
|
| 28 |
+
}
|
| 29 |
+
isControlledRef.current = isControlled;
|
| 30 |
+
}, [isControlled, caller]);
|
| 31 |
+
}
|
| 32 |
+
const setValue = React.useCallback(
|
| 33 |
+
(nextValue) => {
|
| 34 |
+
if (isControlled) {
|
| 35 |
+
const value2 = isFunction(nextValue) ? nextValue(prop) : nextValue;
|
| 36 |
+
if (value2 !== prop) {
|
| 37 |
+
onChangeRef.current?.(value2);
|
| 38 |
+
}
|
| 39 |
+
} else {
|
| 40 |
+
setUncontrolledProp(nextValue);
|
| 41 |
+
}
|
| 42 |
+
},
|
| 43 |
+
[isControlled, prop, setUncontrolledProp, onChangeRef]
|
| 44 |
+
);
|
| 45 |
+
return [value, setValue];
|
| 46 |
+
}
|
| 47 |
+
function useUncontrolledState({
|
| 48 |
+
defaultProp,
|
| 49 |
+
onChange
|
| 50 |
+
}) {
|
| 51 |
+
const [value, setValue] = React.useState(defaultProp);
|
| 52 |
+
const prevValueRef = React.useRef(value);
|
| 53 |
+
const onChangeRef = React.useRef(onChange);
|
| 54 |
+
useInsertionEffect(() => {
|
| 55 |
+
onChangeRef.current = onChange;
|
| 56 |
+
}, [onChange]);
|
| 57 |
+
React.useEffect(() => {
|
| 58 |
+
if (prevValueRef.current !== value) {
|
| 59 |
+
onChangeRef.current?.(value);
|
| 60 |
+
prevValueRef.current = value;
|
| 61 |
+
}
|
| 62 |
+
}, [value, prevValueRef]);
|
| 63 |
+
return [value, setValue, onChangeRef];
|
| 64 |
+
}
|
| 65 |
+
function isFunction(value) {
|
| 66 |
+
return typeof value === "function";
|
| 67 |
+
}
|
| 68 |
+
|
| 69 |
+
// src/use-controllable-state-reducer.tsx
|
| 70 |
+
import * as React2 from "react";
|
| 71 |
+
import { useEffectEvent } from "@radix-ui/react-use-effect-event";
|
| 72 |
+
var SYNC_STATE = Symbol("RADIX:SYNC_STATE");
|
| 73 |
+
function useControllableStateReducer(reducer, userArgs, initialArg, init) {
|
| 74 |
+
const { prop: controlledState, defaultProp, onChange: onChangeProp, caller } = userArgs;
|
| 75 |
+
const isControlled = controlledState !== void 0;
|
| 76 |
+
const onChange = useEffectEvent(onChangeProp);
|
| 77 |
+
if (true) {
|
| 78 |
+
const isControlledRef = React2.useRef(controlledState !== void 0);
|
| 79 |
+
React2.useEffect(() => {
|
| 80 |
+
const wasControlled = isControlledRef.current;
|
| 81 |
+
if (wasControlled !== isControlled) {
|
| 82 |
+
const from = wasControlled ? "controlled" : "uncontrolled";
|
| 83 |
+
const to = isControlled ? "controlled" : "uncontrolled";
|
| 84 |
+
console.warn(
|
| 85 |
+
`${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.`
|
| 86 |
+
);
|
| 87 |
+
}
|
| 88 |
+
isControlledRef.current = isControlled;
|
| 89 |
+
}, [isControlled, caller]);
|
| 90 |
+
}
|
| 91 |
+
const args = [{ ...initialArg, state: defaultProp }];
|
| 92 |
+
if (init) {
|
| 93 |
+
args.push(init);
|
| 94 |
+
}
|
| 95 |
+
const [internalState, dispatch] = React2.useReducer(
|
| 96 |
+
(state2, action) => {
|
| 97 |
+
if (action.type === SYNC_STATE) {
|
| 98 |
+
return { ...state2, state: action.state };
|
| 99 |
+
}
|
| 100 |
+
const next = reducer(state2, action);
|
| 101 |
+
if (isControlled && !Object.is(next.state, state2.state)) {
|
| 102 |
+
onChange(next.state);
|
| 103 |
+
}
|
| 104 |
+
return next;
|
| 105 |
+
},
|
| 106 |
+
...args
|
| 107 |
+
);
|
| 108 |
+
const uncontrolledState = internalState.state;
|
| 109 |
+
const prevValueRef = React2.useRef(uncontrolledState);
|
| 110 |
+
React2.useEffect(() => {
|
| 111 |
+
if (prevValueRef.current !== uncontrolledState) {
|
| 112 |
+
prevValueRef.current = uncontrolledState;
|
| 113 |
+
if (!isControlled) {
|
| 114 |
+
onChange(uncontrolledState);
|
| 115 |
+
}
|
| 116 |
+
}
|
| 117 |
+
}, [onChange, uncontrolledState, prevValueRef, isControlled]);
|
| 118 |
+
const state = React2.useMemo(() => {
|
| 119 |
+
const isControlled2 = controlledState !== void 0;
|
| 120 |
+
if (isControlled2) {
|
| 121 |
+
return { ...internalState, state: controlledState };
|
| 122 |
+
}
|
| 123 |
+
return internalState;
|
| 124 |
+
}, [internalState, controlledState]);
|
| 125 |
+
React2.useEffect(() => {
|
| 126 |
+
if (isControlled && !Object.is(controlledState, internalState.state)) {
|
| 127 |
+
dispatch({ type: SYNC_STATE, state: controlledState });
|
| 128 |
+
}
|
| 129 |
+
}, [controlledState, internalState.state, isControlled]);
|
| 130 |
+
return [state, dispatch];
|
| 131 |
+
}
|
| 132 |
+
export {
|
| 133 |
+
useControllableState,
|
| 134 |
+
useControllableStateReducer
|
| 135 |
+
};
|
| 136 |
+
//# sourceMappingURL=index.mjs.map
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/ui/node_modules/@radix-ui/react-use-controllable-state/dist/index.mjs.map
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"version": 3,
|
| 3 |
+
"sources": ["../src/use-controllable-state.tsx", "../src/use-controllable-state-reducer.tsx"],
|
| 4 |
+
"sourcesContent": ["import * as React from 'react';\nimport { useLayoutEffect } from '@radix-ui/react-use-layout-effect';\n\n// Prevent bundlers from trying to optimize the import\nconst useInsertionEffect: typeof useLayoutEffect =\n (React as any)[' useInsertionEffect '.trim().toString()] || useLayoutEffect;\n\ntype ChangeHandler<T> = (state: T) => void;\ntype SetStateFn<T> = React.Dispatch<React.SetStateAction<T>>;\n\ninterface UseControllableStateParams<T> {\n prop?: T | undefined;\n defaultProp: T;\n onChange?: ChangeHandler<T>;\n caller?: string;\n}\n\nexport function useControllableState<T>({\n prop,\n defaultProp,\n onChange = () => {},\n caller,\n}: UseControllableStateParams<T>): [T, SetStateFn<T>] {\n const [uncontrolledProp, setUncontrolledProp, onChangeRef] = useUncontrolledState({\n defaultProp,\n onChange,\n });\n const isControlled = prop !== undefined;\n const value = isControlled ? prop : uncontrolledProp;\n\n // OK to disable conditionally calling hooks here because they will always run\n // consistently in the same environment. Bundlers should be able to remove the\n // code block entirely in production.\n /* eslint-disable react-hooks/rules-of-hooks */\n if (process.env.NODE_ENV !== 'production') {\n const isControlledRef = React.useRef(prop !== undefined);\n React.useEffect(() => {\n const wasControlled = isControlledRef.current;\n if (wasControlled !== isControlled) {\n const from = wasControlled ? 'controlled' : 'uncontrolled';\n const to = isControlled ? 'controlled' : 'uncontrolled';\n console.warn(\n `${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.`\n );\n }\n isControlledRef.current = isControlled;\n }, [isControlled, caller]);\n }\n /* eslint-enable react-hooks/rules-of-hooks */\n\n const setValue = React.useCallback<SetStateFn<T>>(\n (nextValue) => {\n if (isControlled) {\n const value = isFunction(nextValue) ? nextValue(prop) : nextValue;\n if (value !== prop) {\n onChangeRef.current?.(value);\n }\n } else {\n setUncontrolledProp(nextValue);\n }\n },\n [isControlled, prop, setUncontrolledProp, onChangeRef]\n );\n\n return [value, setValue];\n}\n\nfunction useUncontrolledState<T>({\n defaultProp,\n onChange,\n}: Omit<UseControllableStateParams<T>, 'prop'>): [\n Value: T,\n setValue: React.Dispatch<React.SetStateAction<T>>,\n OnChangeRef: React.RefObject<ChangeHandler<T> | undefined>,\n] {\n const [value, setValue] = React.useState(defaultProp);\n const prevValueRef = React.useRef(value);\n\n const onChangeRef = React.useRef(onChange);\n useInsertionEffect(() => {\n onChangeRef.current = onChange;\n }, [onChange]);\n\n React.useEffect(() => {\n if (prevValueRef.current !== value) {\n onChangeRef.current?.(value);\n prevValueRef.current = value;\n }\n }, [value, prevValueRef]);\n\n return [value, setValue, onChangeRef];\n}\n\nfunction isFunction(value: unknown): value is (...args: any[]) => any {\n return typeof value === 'function';\n}\n", "import * as React from 'react';\nimport { useEffectEvent } from '@radix-ui/react-use-effect-event';\n\ntype ChangeHandler<T> = (state: T) => void;\n\ninterface UseControllableStateParams<T> {\n prop: T | undefined;\n defaultProp: T;\n onChange: ChangeHandler<T> | undefined;\n caller: string;\n}\n\ninterface AnyAction {\n type: string;\n}\n\nconst SYNC_STATE = Symbol('RADIX:SYNC_STATE');\n\ninterface SyncStateAction<T> {\n type: typeof SYNC_STATE;\n state: T;\n}\n\nexport function useControllableStateReducer<T, S extends {}, A extends AnyAction>(\n reducer: (prevState: S & { state: T }, action: A) => S & { state: T },\n userArgs: UseControllableStateParams<T>,\n initialState: S\n): [S & { state: T }, React.Dispatch<A>];\n\nexport function useControllableStateReducer<T, S extends {}, I, A extends AnyAction>(\n reducer: (prevState: S & { state: T }, action: A) => S & { state: T },\n userArgs: UseControllableStateParams<T>,\n initialArg: I,\n init: (i: I & { state: T }) => S\n): [S & { state: T }, React.Dispatch<A>];\n\nexport function useControllableStateReducer<T, S extends {}, A extends AnyAction>(\n reducer: (prevState: S & { state: T }, action: A) => S & { state: T },\n userArgs: UseControllableStateParams<T>,\n initialArg: any,\n init?: (i: any) => Omit<S, 'state'>\n): [S & { state: T }, React.Dispatch<A>] {\n const { prop: controlledState, defaultProp, onChange: onChangeProp, caller } = userArgs;\n const isControlled = controlledState !== undefined;\n\n const onChange = useEffectEvent(onChangeProp);\n\n // OK to disable conditionally calling hooks here because they will always run\n // consistently in the same environment. Bundlers should be able to remove the\n // code block entirely in production.\n /* eslint-disable react-hooks/rules-of-hooks */\n if (process.env.NODE_ENV !== 'production') {\n const isControlledRef = React.useRef(controlledState !== undefined);\n React.useEffect(() => {\n const wasControlled = isControlledRef.current;\n if (wasControlled !== isControlled) {\n const from = wasControlled ? 'controlled' : 'uncontrolled';\n const to = isControlled ? 'controlled' : 'uncontrolled';\n console.warn(\n `${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.`\n );\n }\n isControlledRef.current = isControlled;\n }, [isControlled, caller]);\n }\n /* eslint-enable react-hooks/rules-of-hooks */\n\n type InternalState = S & { state: T };\n const args: [InternalState] = [{ ...initialArg, state: defaultProp }];\n if (init) {\n // @ts-expect-error\n args.push(init);\n }\n\n const [internalState, dispatch] = React.useReducer(\n (state: InternalState, action: A | SyncStateAction<T>): InternalState => {\n if (action.type === SYNC_STATE) {\n return { ...state, state: action.state };\n }\n\n const next = reducer(state, action);\n if (isControlled && !Object.is(next.state, state.state)) {\n onChange(next.state);\n }\n return next;\n },\n ...args\n );\n\n const uncontrolledState = internalState.state;\n const prevValueRef = React.useRef(uncontrolledState);\n React.useEffect(() => {\n if (prevValueRef.current !== uncontrolledState) {\n prevValueRef.current = uncontrolledState;\n if (!isControlled) {\n onChange(uncontrolledState);\n }\n }\n }, [onChange, uncontrolledState, prevValueRef, isControlled]);\n\n const state = React.useMemo(() => {\n const isControlled = controlledState !== undefined;\n if (isControlled) {\n return { ...internalState, state: controlledState };\n }\n\n return internalState;\n }, [internalState, controlledState]);\n\n React.useEffect(() => {\n // Sync internal state for controlled components so that reducer is called\n // with the correct state values\n if (isControlled && !Object.is(controlledState, internalState.state)) {\n dispatch({ type: SYNC_STATE, state: controlledState });\n }\n }, [controlledState, internalState.state, isControlled]);\n\n return [state, dispatch as React.Dispatch<A>];\n}\n"],
|
| 5 |
+
"mappings": ";AAAA,YAAY,WAAW;AACvB,SAAS,uBAAuB;AAGhC,IAAM,qBACH,MAAc,uBAAuB,KAAK,EAAE,SAAS,CAAC,KAAK;AAYvD,SAAS,qBAAwB;AAAA,EACtC;AAAA,EACA;AAAA,EACA,WAAW,MAAM;AAAA,EAAC;AAAA,EAClB;AACF,GAAsD;AACpD,QAAM,CAAC,kBAAkB,qBAAqB,WAAW,IAAI,qBAAqB;AAAA,IAChF;AAAA,IACA;AAAA,EACF,CAAC;AACD,QAAM,eAAe,SAAS;AAC9B,QAAM,QAAQ,eAAe,OAAO;AAMpC,MAAI,MAAuC;AACzC,UAAM,kBAAwB,aAAO,SAAS,MAAS;AACvD,IAAM,gBAAU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;AAE5D,QAAM,QAAc,eAAQ,MAAM;AAChC,UAAMC,gBAAe,oBAAoB;AACzC,QAAIA,eAAc;AAChB,aAAO,EAAE,GAAG,eAAe,OAAO,gBAAgB;AAAA,IACpD;AAEA,WAAO;AAAA,EACT,GAAG,CAAC,eAAe,eAAe,CAAC;AAEnC,EAAM,iBAAU,MAAM;AAGpB,QAAI,gBAAgB,CAAC,OAAO,GAAG,iBAAiB,cAAc,KAAK,GAAG;AACpE,eAAS,EAAE,MAAM,YAAY,OAAO,gBAAgB,CAAC;AAAA,IACvD;AAAA,EACF,GAAG,CAAC,iBAAiB,cAAc,OAAO,YAAY,CAAC;AAEvD,SAAO,CAAC,OAAO,QAA6B;AAC9C;",
|
| 6 |
+
"names": ["value", "React", "state", "isControlled"]
|
| 7 |
+
}
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/ui/node_modules/@radix-ui/react-use-effect-event/dist/index.d.mts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
type AnyFunction = (...args: any[]) => any;
|
| 2 |
+
/**
|
| 3 |
+
* Designed to approximate the behavior on `experimental_useEffectEvent` as best
|
| 4 |
+
* as possible until its stable release, and back-fill it as a shim as needed.
|
| 5 |
+
*/
|
| 6 |
+
declare function useEffectEvent<T extends AnyFunction>(callback?: T): T;
|
| 7 |
+
|
| 8 |
+
export { useEffectEvent };
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/ui/node_modules/@radix-ui/react-use-effect-event/dist/index.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
type AnyFunction = (...args: any[]) => any;
|
| 2 |
+
/**
|
| 3 |
+
* Designed to approximate the behavior on `experimental_useEffectEvent` as best
|
| 4 |
+
* as possible until its stable release, and back-fill it as a shim as needed.
|
| 5 |
+
*/
|
| 6 |
+
declare function useEffectEvent<T extends AnyFunction>(callback?: T): T;
|
| 7 |
+
|
| 8 |
+
export { useEffectEvent };
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/ui/node_modules/@radix-ui/react-use-effect-event/dist/index.js
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
var __create = Object.create;
|
| 3 |
+
var __defProp = Object.defineProperty;
|
| 4 |
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
| 5 |
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
| 6 |
+
var __getProtoOf = Object.getPrototypeOf;
|
| 7 |
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
| 8 |
+
var __export = (target, all) => {
|
| 9 |
+
for (var name in all)
|
| 10 |
+
__defProp(target, name, { get: all[name], enumerable: true });
|
| 11 |
+
};
|
| 12 |
+
var __copyProps = (to, from, except, desc) => {
|
| 13 |
+
if (from && typeof from === "object" || typeof from === "function") {
|
| 14 |
+
for (let key of __getOwnPropNames(from))
|
| 15 |
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
| 16 |
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
| 17 |
+
}
|
| 18 |
+
return to;
|
| 19 |
+
};
|
| 20 |
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
| 21 |
+
// If the importer is in node compatibility mode or this is not an ESM
|
| 22 |
+
// file that has been converted to a CommonJS file using a Babel-
|
| 23 |
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
| 24 |
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
| 25 |
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
| 26 |
+
mod
|
| 27 |
+
));
|
| 28 |
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
| 29 |
+
|
| 30 |
+
// src/index.ts
|
| 31 |
+
var index_exports = {};
|
| 32 |
+
__export(index_exports, {
|
| 33 |
+
useEffectEvent: () => useEffectEvent
|
| 34 |
+
});
|
| 35 |
+
module.exports = __toCommonJS(index_exports);
|
| 36 |
+
|
| 37 |
+
// src/use-effect-event.tsx
|
| 38 |
+
var import_react_use_layout_effect = require("@radix-ui/react-use-layout-effect");
|
| 39 |
+
var React = __toESM(require("react"));
|
| 40 |
+
var useReactEffectEvent = React[" useEffectEvent ".trim().toString()];
|
| 41 |
+
var useReactInsertionEffect = React[" useInsertionEffect ".trim().toString()];
|
| 42 |
+
function useEffectEvent(callback) {
|
| 43 |
+
if (typeof useReactEffectEvent === "function") {
|
| 44 |
+
return useReactEffectEvent(callback);
|
| 45 |
+
}
|
| 46 |
+
const ref = React.useRef(() => {
|
| 47 |
+
throw new Error("Cannot call an event handler while rendering.");
|
| 48 |
+
});
|
| 49 |
+
if (typeof useReactInsertionEffect === "function") {
|
| 50 |
+
useReactInsertionEffect(() => {
|
| 51 |
+
ref.current = callback;
|
| 52 |
+
});
|
| 53 |
+
} else {
|
| 54 |
+
(0, import_react_use_layout_effect.useLayoutEffect)(() => {
|
| 55 |
+
ref.current = callback;
|
| 56 |
+
});
|
| 57 |
+
}
|
| 58 |
+
return React.useMemo(() => (...args) => ref.current?.(...args), []);
|
| 59 |
+
}
|
| 60 |
+
//# sourceMappingURL=index.js.map
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/ui/node_modules/@radix-ui/react-use-effect-event/dist/index.js.map
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"version": 3,
|
| 3 |
+
"sources": ["../src/index.ts", "../src/use-effect-event.tsx"],
|
| 4 |
+
"sourcesContent": ["export { useEffectEvent } from './use-effect-event';\n", "/* eslint-disable react-hooks/rules-of-hooks */\nimport { useLayoutEffect } from '@radix-ui/react-use-layout-effect';\nimport * as React from 'react';\n\ntype AnyFunction = (...args: any[]) => any;\n\n// See https://github.com/webpack/webpack/issues/14814\nconst useReactEffectEvent = (React as any)[' useEffectEvent '.trim().toString()];\nconst useReactInsertionEffect = (React as any)[' useInsertionEffect '.trim().toString()];\n\n/**\n * Designed to approximate the behavior on `experimental_useEffectEvent` as best\n * as possible until its stable release, and back-fill it as a shim as needed.\n */\nexport function useEffectEvent<T extends AnyFunction>(callback?: T): T {\n if (typeof useReactEffectEvent === 'function') {\n return useReactEffectEvent(callback);\n }\n\n const ref = React.useRef<AnyFunction | undefined>(() => {\n throw new Error('Cannot call an event handler while rendering.');\n });\n // See https://github.com/webpack/webpack/issues/14814\n if (typeof useReactInsertionEffect === 'function') {\n useReactInsertionEffect(() => {\n ref.current = callback;\n });\n } else {\n useLayoutEffect(() => {\n ref.current = callback;\n });\n }\n\n // https://github.com/facebook/react/issues/19240\n return React.useMemo(() => ((...args) => ref.current?.(...args)) as T, []);\n}\n"],
|
| 5 |
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACCA,qCAAgC;AAChC,YAAuB;AAKvB,IAAM,sBAAuB,MAAc,mBAAmB,KAAK,EAAE,SAAS,CAAC;AAC/E,IAAM,0BAA2B,MAAc,uBAAuB,KAAK,EAAE,SAAS,CAAC;AAMhF,SAAS,eAAsC,UAAiB;AACrE,MAAI,OAAO,wBAAwB,YAAY;AAC7C,WAAO,oBAAoB,QAAQ;AAAA,EACrC;AAEA,QAAM,MAAY,aAAgC,MAAM;AACtD,UAAM,IAAI,MAAM,+CAA+C;AAAA,EACjE,CAAC;AAED,MAAI,OAAO,4BAA4B,YAAY;AACjD,4BAAwB,MAAM;AAC5B,UAAI,UAAU;AAAA,IAChB,CAAC;AAAA,EACH,OAAO;AACL,wDAAgB,MAAM;AACpB,UAAI,UAAU;AAAA,IAChB,CAAC;AAAA,EACH;AAGA,SAAa,cAAQ,MAAO,IAAI,SAAS,IAAI,UAAU,GAAG,IAAI,GAAS,CAAC,CAAC;AAC3E;",
|
| 6 |
+
"names": []
|
| 7 |
+
}
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/ui/node_modules/@radix-ui/react-use-effect-event/dist/index.mjs
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// src/use-effect-event.tsx
|
| 2 |
+
import { useLayoutEffect } from "@radix-ui/react-use-layout-effect";
|
| 3 |
+
import * as React from "react";
|
| 4 |
+
var useReactEffectEvent = React[" useEffectEvent ".trim().toString()];
|
| 5 |
+
var useReactInsertionEffect = React[" useInsertionEffect ".trim().toString()];
|
| 6 |
+
function useEffectEvent(callback) {
|
| 7 |
+
if (typeof useReactEffectEvent === "function") {
|
| 8 |
+
return useReactEffectEvent(callback);
|
| 9 |
+
}
|
| 10 |
+
const ref = React.useRef(() => {
|
| 11 |
+
throw new Error("Cannot call an event handler while rendering.");
|
| 12 |
+
});
|
| 13 |
+
if (typeof useReactInsertionEffect === "function") {
|
| 14 |
+
useReactInsertionEffect(() => {
|
| 15 |
+
ref.current = callback;
|
| 16 |
+
});
|
| 17 |
+
} else {
|
| 18 |
+
useLayoutEffect(() => {
|
| 19 |
+
ref.current = callback;
|
| 20 |
+
});
|
| 21 |
+
}
|
| 22 |
+
return React.useMemo(() => (...args) => ref.current?.(...args), []);
|
| 23 |
+
}
|
| 24 |
+
export {
|
| 25 |
+
useEffectEvent
|
| 26 |
+
};
|
| 27 |
+
//# sourceMappingURL=index.mjs.map
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/ui/node_modules/@radix-ui/react-use-effect-event/dist/index.mjs.map
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"version": 3,
|
| 3 |
+
"sources": ["../src/use-effect-event.tsx"],
|
| 4 |
+
"sourcesContent": ["/* eslint-disable react-hooks/rules-of-hooks */\nimport { useLayoutEffect } from '@radix-ui/react-use-layout-effect';\nimport * as React from 'react';\n\ntype AnyFunction = (...args: any[]) => any;\n\n// See https://github.com/webpack/webpack/issues/14814\nconst useReactEffectEvent = (React as any)[' useEffectEvent '.trim().toString()];\nconst useReactInsertionEffect = (React as any)[' useInsertionEffect '.trim().toString()];\n\n/**\n * Designed to approximate the behavior on `experimental_useEffectEvent` as best\n * as possible until its stable release, and back-fill it as a shim as needed.\n */\nexport function useEffectEvent<T extends AnyFunction>(callback?: T): T {\n if (typeof useReactEffectEvent === 'function') {\n return useReactEffectEvent(callback);\n }\n\n const ref = React.useRef<AnyFunction | undefined>(() => {\n throw new Error('Cannot call an event handler while rendering.');\n });\n // See https://github.com/webpack/webpack/issues/14814\n if (typeof useReactInsertionEffect === 'function') {\n useReactInsertionEffect(() => {\n ref.current = callback;\n });\n } else {\n useLayoutEffect(() => {\n ref.current = callback;\n });\n }\n\n // https://github.com/facebook/react/issues/19240\n return React.useMemo(() => ((...args) => ref.current?.(...args)) as T, []);\n}\n"],
|
| 5 |
+
"mappings": ";AACA,SAAS,uBAAuB;AAChC,YAAY,WAAW;AAKvB,IAAM,sBAAuB,MAAc,mBAAmB,KAAK,EAAE,SAAS,CAAC;AAC/E,IAAM,0BAA2B,MAAc,uBAAuB,KAAK,EAAE,SAAS,CAAC;AAMhF,SAAS,eAAsC,UAAiB;AACrE,MAAI,OAAO,wBAAwB,YAAY;AAC7C,WAAO,oBAAoB,QAAQ;AAAA,EACrC;AAEA,QAAM,MAAY,aAAgC,MAAM;AACtD,UAAM,IAAI,MAAM,+CAA+C;AAAA,EACjE,CAAC;AAED,MAAI,OAAO,4BAA4B,YAAY;AACjD,4BAAwB,MAAM;AAC5B,UAAI,UAAU;AAAA,IAChB,CAAC;AAAA,EACH,OAAO;AACL,oBAAgB,MAAM;AACpB,UAAI,UAAU;AAAA,IAChB,CAAC;AAAA,EACH;AAGA,SAAa,cAAQ,MAAO,IAAI,SAAS,IAAI,UAAU,GAAG,IAAI,GAAS,CAAC,CAAC;AAC3E;",
|
| 6 |
+
"names": []
|
| 7 |
+
}
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/ui/node_modules/@radix-ui/react-use-effect-event/src/index.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
export { useEffectEvent } from './use-effect-event';
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/ui/node_modules/@radix-ui/react-use-effect-event/src/use-effect-event.tsx
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/* eslint-disable react-hooks/rules-of-hooks */
|
| 2 |
+
import { useLayoutEffect } from '@radix-ui/react-use-layout-effect';
|
| 3 |
+
import * as React from 'react';
|
| 4 |
+
|
| 5 |
+
type AnyFunction = (...args: any[]) => any;
|
| 6 |
+
|
| 7 |
+
// See https://github.com/webpack/webpack/issues/14814
|
| 8 |
+
const useReactEffectEvent = (React as any)[' useEffectEvent '.trim().toString()];
|
| 9 |
+
const useReactInsertionEffect = (React as any)[' useInsertionEffect '.trim().toString()];
|
| 10 |
+
|
| 11 |
+
/**
|
| 12 |
+
* Designed to approximate the behavior on `experimental_useEffectEvent` as best
|
| 13 |
+
* as possible until its stable release, and back-fill it as a shim as needed.
|
| 14 |
+
*/
|
| 15 |
+
export function useEffectEvent<T extends AnyFunction>(callback?: T): T {
|
| 16 |
+
if (typeof useReactEffectEvent === 'function') {
|
| 17 |
+
return useReactEffectEvent(callback);
|
| 18 |
+
}
|
| 19 |
+
|
| 20 |
+
const ref = React.useRef<AnyFunction | undefined>(() => {
|
| 21 |
+
throw new Error('Cannot call an event handler while rendering.');
|
| 22 |
+
});
|
| 23 |
+
// See https://github.com/webpack/webpack/issues/14814
|
| 24 |
+
if (typeof useReactInsertionEffect === 'function') {
|
| 25 |
+
useReactInsertionEffect(() => {
|
| 26 |
+
ref.current = callback;
|
| 27 |
+
});
|
| 28 |
+
} else {
|
| 29 |
+
useLayoutEffect(() => {
|
| 30 |
+
ref.current = callback;
|
| 31 |
+
});
|
| 32 |
+
}
|
| 33 |
+
|
| 34 |
+
// https://github.com/facebook/react/issues/19240
|
| 35 |
+
return React.useMemo(() => ((...args) => ref.current?.(...args)) as T, []);
|
| 36 |
+
}
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/ui/node_modules/@radix-ui/react-use-escape-keydown/dist/index.d.mts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/**
|
| 2 |
+
* Listens for when the escape key is down
|
| 3 |
+
*/
|
| 4 |
+
declare function useEscapeKeydown(onEscapeKeyDownProp?: (event: KeyboardEvent) => void, ownerDocument?: Document): void;
|
| 5 |
+
|
| 6 |
+
export { useEscapeKeydown };
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/ui/node_modules/@radix-ui/react-use-escape-keydown/dist/index.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/**
|
| 2 |
+
* Listens for when the escape key is down
|
| 3 |
+
*/
|
| 4 |
+
declare function useEscapeKeydown(onEscapeKeyDownProp?: (event: KeyboardEvent) => void, ownerDocument?: Document): void;
|
| 5 |
+
|
| 6 |
+
export { useEscapeKeydown };
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/ui/node_modules/@radix-ui/react-use-escape-keydown/dist/index.js
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
var __create = Object.create;
|
| 3 |
+
var __defProp = Object.defineProperty;
|
| 4 |
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
| 5 |
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
| 6 |
+
var __getProtoOf = Object.getPrototypeOf;
|
| 7 |
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
| 8 |
+
var __export = (target, all) => {
|
| 9 |
+
for (var name in all)
|
| 10 |
+
__defProp(target, name, { get: all[name], enumerable: true });
|
| 11 |
+
};
|
| 12 |
+
var __copyProps = (to, from, except, desc) => {
|
| 13 |
+
if (from && typeof from === "object" || typeof from === "function") {
|
| 14 |
+
for (let key of __getOwnPropNames(from))
|
| 15 |
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
| 16 |
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
| 17 |
+
}
|
| 18 |
+
return to;
|
| 19 |
+
};
|
| 20 |
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
| 21 |
+
// If the importer is in node compatibility mode or this is not an ESM
|
| 22 |
+
// file that has been converted to a CommonJS file using a Babel-
|
| 23 |
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
| 24 |
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
| 25 |
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
| 26 |
+
mod
|
| 27 |
+
));
|
| 28 |
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
| 29 |
+
|
| 30 |
+
// packages/react/use-escape-keydown/src/index.ts
|
| 31 |
+
var index_exports = {};
|
| 32 |
+
__export(index_exports, {
|
| 33 |
+
useEscapeKeydown: () => useEscapeKeydown
|
| 34 |
+
});
|
| 35 |
+
module.exports = __toCommonJS(index_exports);
|
| 36 |
+
|
| 37 |
+
// packages/react/use-escape-keydown/src/use-escape-keydown.tsx
|
| 38 |
+
var React = __toESM(require("react"));
|
| 39 |
+
var import_react_use_callback_ref = require("@radix-ui/react-use-callback-ref");
|
| 40 |
+
function useEscapeKeydown(onEscapeKeyDownProp, ownerDocument = globalThis?.document) {
|
| 41 |
+
const onEscapeKeyDown = (0, import_react_use_callback_ref.useCallbackRef)(onEscapeKeyDownProp);
|
| 42 |
+
React.useEffect(() => {
|
| 43 |
+
const handleKeyDown = (event) => {
|
| 44 |
+
if (event.key === "Escape") {
|
| 45 |
+
onEscapeKeyDown(event);
|
| 46 |
+
}
|
| 47 |
+
};
|
| 48 |
+
ownerDocument.addEventListener("keydown", handleKeyDown, { capture: true });
|
| 49 |
+
return () => ownerDocument.removeEventListener("keydown", handleKeyDown, { capture: true });
|
| 50 |
+
}, [onEscapeKeyDown, ownerDocument]);
|
| 51 |
+
}
|
| 52 |
+
//# sourceMappingURL=index.js.map
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/ui/node_modules/@radix-ui/react-use-escape-keydown/dist/index.js.map
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"version": 3,
|
| 3 |
+
"sources": ["../src/index.ts", "../src/use-escape-keydown.tsx"],
|
| 4 |
+
"sourcesContent": ["export { useEscapeKeydown } from './use-escape-keydown';\n", "import * as React from 'react';\nimport { useCallbackRef } from '@radix-ui/react-use-callback-ref';\n\n/**\n * Listens for when the escape key is down\n */\nfunction useEscapeKeydown(\n onEscapeKeyDownProp?: (event: KeyboardEvent) => void,\n ownerDocument: Document = globalThis?.document\n) {\n const onEscapeKeyDown = useCallbackRef(onEscapeKeyDownProp);\n\n React.useEffect(() => {\n const handleKeyDown = (event: KeyboardEvent) => {\n if (event.key === 'Escape') {\n onEscapeKeyDown(event);\n }\n };\n ownerDocument.addEventListener('keydown', handleKeyDown, { capture: true });\n return () => ownerDocument.removeEventListener('keydown', handleKeyDown, { capture: true });\n }, [onEscapeKeyDown, ownerDocument]);\n}\n\nexport { useEscapeKeydown };\n"],
|
| 5 |
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,YAAuB;AACvB,oCAA+B;AAK/B,SAAS,iBACP,qBACA,gBAA0B,YAAY,UACtC;AACA,QAAM,sBAAkB,8CAAe,mBAAmB;AAE1D,EAAM,gBAAU,MAAM;AACpB,UAAM,gBAAgB,CAAC,UAAyB;AAC9C,UAAI,MAAM,QAAQ,UAAU;AAC1B,wBAAgB,KAAK;AAAA,MACvB;AAAA,IACF;AACA,kBAAc,iBAAiB,WAAW,eAAe,EAAE,SAAS,KAAK,CAAC;AAC1E,WAAO,MAAM,cAAc,oBAAoB,WAAW,eAAe,EAAE,SAAS,KAAK,CAAC;AAAA,EAC5F,GAAG,CAAC,iBAAiB,aAAa,CAAC;AACrC;",
|
| 6 |
+
"names": []
|
| 7 |
+
}
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/ui/node_modules/@radix-ui/react-use-escape-keydown/dist/index.mjs
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// packages/react/use-escape-keydown/src/use-escape-keydown.tsx
|
| 2 |
+
import * as React from "react";
|
| 3 |
+
import { useCallbackRef } from "@radix-ui/react-use-callback-ref";
|
| 4 |
+
function useEscapeKeydown(onEscapeKeyDownProp, ownerDocument = globalThis?.document) {
|
| 5 |
+
const onEscapeKeyDown = useCallbackRef(onEscapeKeyDownProp);
|
| 6 |
+
React.useEffect(() => {
|
| 7 |
+
const handleKeyDown = (event) => {
|
| 8 |
+
if (event.key === "Escape") {
|
| 9 |
+
onEscapeKeyDown(event);
|
| 10 |
+
}
|
| 11 |
+
};
|
| 12 |
+
ownerDocument.addEventListener("keydown", handleKeyDown, { capture: true });
|
| 13 |
+
return () => ownerDocument.removeEventListener("keydown", handleKeyDown, { capture: true });
|
| 14 |
+
}, [onEscapeKeyDown, ownerDocument]);
|
| 15 |
+
}
|
| 16 |
+
export {
|
| 17 |
+
useEscapeKeydown
|
| 18 |
+
};
|
| 19 |
+
//# sourceMappingURL=index.mjs.map
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/ui/node_modules/@radix-ui/react-use-escape-keydown/dist/index.mjs.map
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"version": 3,
|
| 3 |
+
"sources": ["../src/use-escape-keydown.tsx"],
|
| 4 |
+
"sourcesContent": ["import * as React from 'react';\nimport { useCallbackRef } from '@radix-ui/react-use-callback-ref';\n\n/**\n * Listens for when the escape key is down\n */\nfunction useEscapeKeydown(\n onEscapeKeyDownProp?: (event: KeyboardEvent) => void,\n ownerDocument: Document = globalThis?.document\n) {\n const onEscapeKeyDown = useCallbackRef(onEscapeKeyDownProp);\n\n React.useEffect(() => {\n const handleKeyDown = (event: KeyboardEvent) => {\n if (event.key === 'Escape') {\n onEscapeKeyDown(event);\n }\n };\n ownerDocument.addEventListener('keydown', handleKeyDown, { capture: true });\n return () => ownerDocument.removeEventListener('keydown', handleKeyDown, { capture: true });\n }, [onEscapeKeyDown, ownerDocument]);\n}\n\nexport { useEscapeKeydown };\n"],
|
| 5 |
+
"mappings": ";AAAA,YAAY,WAAW;AACvB,SAAS,sBAAsB;AAK/B,SAAS,iBACP,qBACA,gBAA0B,YAAY,UACtC;AACA,QAAM,kBAAkB,eAAe,mBAAmB;AAE1D,EAAM,gBAAU,MAAM;AACpB,UAAM,gBAAgB,CAAC,UAAyB;AAC9C,UAAI,MAAM,QAAQ,UAAU;AAC1B,wBAAgB,KAAK;AAAA,MACvB;AAAA,IACF;AACA,kBAAc,iBAAiB,WAAW,eAAe,EAAE,SAAS,KAAK,CAAC;AAC1E,WAAO,MAAM,cAAc,oBAAoB,WAAW,eAAe,EAAE,SAAS,KAAK,CAAC;AAAA,EAC5F,GAAG,CAAC,iBAAiB,aAAa,CAAC;AACrC;",
|
| 6 |
+
"names": []
|
| 7 |
+
}
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/ui/node_modules/@radix-ui/react-use-layout-effect/dist/index.d.mts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import * as React from 'react';
|
| 2 |
+
|
| 3 |
+
/**
|
| 4 |
+
* On the server, React emits a warning when calling `useLayoutEffect`.
|
| 5 |
+
* This is because neither `useLayoutEffect` nor `useEffect` run on the server.
|
| 6 |
+
* We use this safe version which suppresses the warning by replacing it with a noop on the server.
|
| 7 |
+
*
|
| 8 |
+
* See: https://reactjs.org/docs/hooks-reference.html#uselayouteffect
|
| 9 |
+
*/
|
| 10 |
+
declare const useLayoutEffect: typeof React.useLayoutEffect;
|
| 11 |
+
|
| 12 |
+
export { useLayoutEffect };
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/ui/node_modules/@radix-ui/react-use-layout-effect/dist/index.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import * as React from 'react';
|
| 2 |
+
|
| 3 |
+
/**
|
| 4 |
+
* On the server, React emits a warning when calling `useLayoutEffect`.
|
| 5 |
+
* This is because neither `useLayoutEffect` nor `useEffect` run on the server.
|
| 6 |
+
* We use this safe version which suppresses the warning by replacing it with a noop on the server.
|
| 7 |
+
*
|
| 8 |
+
* See: https://reactjs.org/docs/hooks-reference.html#uselayouteffect
|
| 9 |
+
*/
|
| 10 |
+
declare const useLayoutEffect: typeof React.useLayoutEffect;
|
| 11 |
+
|
| 12 |
+
export { useLayoutEffect };
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/ui/node_modules/@radix-ui/react-use-layout-effect/dist/index.js
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
var __create = Object.create;
|
| 3 |
+
var __defProp = Object.defineProperty;
|
| 4 |
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
| 5 |
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
| 6 |
+
var __getProtoOf = Object.getPrototypeOf;
|
| 7 |
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
| 8 |
+
var __export = (target, all) => {
|
| 9 |
+
for (var name in all)
|
| 10 |
+
__defProp(target, name, { get: all[name], enumerable: true });
|
| 11 |
+
};
|
| 12 |
+
var __copyProps = (to, from, except, desc) => {
|
| 13 |
+
if (from && typeof from === "object" || typeof from === "function") {
|
| 14 |
+
for (let key of __getOwnPropNames(from))
|
| 15 |
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
| 16 |
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
| 17 |
+
}
|
| 18 |
+
return to;
|
| 19 |
+
};
|
| 20 |
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
| 21 |
+
// If the importer is in node compatibility mode or this is not an ESM
|
| 22 |
+
// file that has been converted to a CommonJS file using a Babel-
|
| 23 |
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
| 24 |
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
| 25 |
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
| 26 |
+
mod
|
| 27 |
+
));
|
| 28 |
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
| 29 |
+
|
| 30 |
+
// packages/react/use-layout-effect/src/index.ts
|
| 31 |
+
var index_exports = {};
|
| 32 |
+
__export(index_exports, {
|
| 33 |
+
useLayoutEffect: () => useLayoutEffect2
|
| 34 |
+
});
|
| 35 |
+
module.exports = __toCommonJS(index_exports);
|
| 36 |
+
|
| 37 |
+
// packages/react/use-layout-effect/src/use-layout-effect.tsx
|
| 38 |
+
var React = __toESM(require("react"));
|
| 39 |
+
var useLayoutEffect2 = globalThis?.document ? React.useLayoutEffect : () => {
|
| 40 |
+
};
|
| 41 |
+
//# sourceMappingURL=index.js.map
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/ui/node_modules/@radix-ui/react-use-layout-effect/dist/index.js.map
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"version": 3,
|
| 3 |
+
"sources": ["../src/index.ts", "../src/use-layout-effect.tsx"],
|
| 4 |
+
"sourcesContent": ["export { useLayoutEffect } from './use-layout-effect';\n", "import * as React from 'react';\n\n/**\n * On the server, React emits a warning when calling `useLayoutEffect`.\n * This is because neither `useLayoutEffect` nor `useEffect` run on the server.\n * We use this safe version which suppresses the warning by replacing it with a noop on the server.\n *\n * See: https://reactjs.org/docs/hooks-reference.html#uselayouteffect\n */\nconst useLayoutEffect = globalThis?.document ? React.useLayoutEffect : () => {};\n\nexport { useLayoutEffect };\n"],
|
| 5 |
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,yBAAAA;AAAA;AAAA;;;ACAA,YAAuB;AASvB,IAAMC,mBAAkB,YAAY,WAAiB,wBAAkB,MAAM;AAAC;",
|
| 6 |
+
"names": ["useLayoutEffect", "useLayoutEffect"]
|
| 7 |
+
}
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/ui/node_modules/@radix-ui/react-use-layout-effect/dist/index.mjs
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// packages/react/use-layout-effect/src/use-layout-effect.tsx
|
| 2 |
+
import * as React from "react";
|
| 3 |
+
var useLayoutEffect2 = globalThis?.document ? React.useLayoutEffect : () => {
|
| 4 |
+
};
|
| 5 |
+
export {
|
| 6 |
+
useLayoutEffect2 as useLayoutEffect
|
| 7 |
+
};
|
| 8 |
+
//# sourceMappingURL=index.mjs.map
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/ui/node_modules/@radix-ui/react-use-layout-effect/dist/index.mjs.map
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"version": 3,
|
| 3 |
+
"sources": ["../src/use-layout-effect.tsx"],
|
| 4 |
+
"sourcesContent": ["import * as React from 'react';\n\n/**\n * On the server, React emits a warning when calling `useLayoutEffect`.\n * This is because neither `useLayoutEffect` nor `useEffect` run on the server.\n * We use this safe version which suppresses the warning by replacing it with a noop on the server.\n *\n * See: https://reactjs.org/docs/hooks-reference.html#uselayouteffect\n */\nconst useLayoutEffect = globalThis?.document ? React.useLayoutEffect : () => {};\n\nexport { useLayoutEffect };\n"],
|
| 5 |
+
"mappings": ";AAAA,YAAY,WAAW;AASvB,IAAMA,mBAAkB,YAAY,WAAiB,wBAAkB,MAAM;AAAC;",
|
| 6 |
+
"names": ["useLayoutEffect"]
|
| 7 |
+
}
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/ui/node_modules/@radix-ui/react-use-previous/dist/index.d.mts
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
declare function usePrevious<T>(value: T): T;
|
| 2 |
+
|
| 3 |
+
export { usePrevious };
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/ui/node_modules/@radix-ui/react-use-previous/dist/index.d.ts
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
declare function usePrevious<T>(value: T): T;
|
| 2 |
+
|
| 3 |
+
export { usePrevious };
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/ui/node_modules/@radix-ui/react-use-previous/dist/index.js
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
var __create = Object.create;
|
| 3 |
+
var __defProp = Object.defineProperty;
|
| 4 |
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
| 5 |
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
| 6 |
+
var __getProtoOf = Object.getPrototypeOf;
|
| 7 |
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
| 8 |
+
var __export = (target, all) => {
|
| 9 |
+
for (var name in all)
|
| 10 |
+
__defProp(target, name, { get: all[name], enumerable: true });
|
| 11 |
+
};
|
| 12 |
+
var __copyProps = (to, from, except, desc) => {
|
| 13 |
+
if (from && typeof from === "object" || typeof from === "function") {
|
| 14 |
+
for (let key of __getOwnPropNames(from))
|
| 15 |
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
| 16 |
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
| 17 |
+
}
|
| 18 |
+
return to;
|
| 19 |
+
};
|
| 20 |
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
| 21 |
+
// If the importer is in node compatibility mode or this is not an ESM
|
| 22 |
+
// file that has been converted to a CommonJS file using a Babel-
|
| 23 |
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
| 24 |
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
| 25 |
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
| 26 |
+
mod
|
| 27 |
+
));
|
| 28 |
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
| 29 |
+
|
| 30 |
+
// packages/react/use-previous/src/index.ts
|
| 31 |
+
var index_exports = {};
|
| 32 |
+
__export(index_exports, {
|
| 33 |
+
usePrevious: () => usePrevious
|
| 34 |
+
});
|
| 35 |
+
module.exports = __toCommonJS(index_exports);
|
| 36 |
+
|
| 37 |
+
// packages/react/use-previous/src/use-previous.tsx
|
| 38 |
+
var React = __toESM(require("react"));
|
| 39 |
+
function usePrevious(value) {
|
| 40 |
+
const ref = React.useRef({ value, previous: value });
|
| 41 |
+
return React.useMemo(() => {
|
| 42 |
+
if (ref.current.value !== value) {
|
| 43 |
+
ref.current.previous = ref.current.value;
|
| 44 |
+
ref.current.value = value;
|
| 45 |
+
}
|
| 46 |
+
return ref.current.previous;
|
| 47 |
+
}, [value]);
|
| 48 |
+
}
|
| 49 |
+
//# sourceMappingURL=index.js.map
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/ui/node_modules/@radix-ui/react-use-previous/dist/index.js.map
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"version": 3,
|
| 3 |
+
"sources": ["../src/index.ts", "../src/use-previous.tsx"],
|
| 4 |
+
"sourcesContent": ["export { usePrevious } from './use-previous';\n", "import * as React from 'react';\n\nfunction usePrevious<T>(value: T) {\n const ref = React.useRef({ value, previous: value });\n\n // We compare values before making an update to ensure that\n // a change has been made. This ensures the previous value is\n // persisted correctly between renders.\n return React.useMemo(() => {\n if (ref.current.value !== value) {\n ref.current.previous = ref.current.value;\n ref.current.value = value;\n }\n return ref.current.previous;\n }, [value]);\n}\n\nexport { usePrevious };\n"],
|
| 5 |
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,YAAuB;AAEvB,SAAS,YAAe,OAAU;AAChC,QAAM,MAAY,aAAO,EAAE,OAAO,UAAU,MAAM,CAAC;AAKnD,SAAa,cAAQ,MAAM;AACzB,QAAI,IAAI,QAAQ,UAAU,OAAO;AAC/B,UAAI,QAAQ,WAAW,IAAI,QAAQ;AACnC,UAAI,QAAQ,QAAQ;AAAA,IACtB;AACA,WAAO,IAAI,QAAQ;AAAA,EACrB,GAAG,CAAC,KAAK,CAAC;AACZ;",
|
| 6 |
+
"names": []
|
| 7 |
+
}
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/ui/node_modules/@radix-ui/react-use-previous/dist/index.mjs
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// packages/react/use-previous/src/use-previous.tsx
|
| 2 |
+
import * as React from "react";
|
| 3 |
+
function usePrevious(value) {
|
| 4 |
+
const ref = React.useRef({ value, previous: value });
|
| 5 |
+
return React.useMemo(() => {
|
| 6 |
+
if (ref.current.value !== value) {
|
| 7 |
+
ref.current.previous = ref.current.value;
|
| 8 |
+
ref.current.value = value;
|
| 9 |
+
}
|
| 10 |
+
return ref.current.previous;
|
| 11 |
+
}, [value]);
|
| 12 |
+
}
|
| 13 |
+
export {
|
| 14 |
+
usePrevious
|
| 15 |
+
};
|
| 16 |
+
//# sourceMappingURL=index.mjs.map
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/ui/node_modules/@radix-ui/react-use-previous/dist/index.mjs.map
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"version": 3,
|
| 3 |
+
"sources": ["../src/use-previous.tsx"],
|
| 4 |
+
"sourcesContent": ["import * as React from 'react';\n\nfunction usePrevious<T>(value: T) {\n const ref = React.useRef({ value, previous: value });\n\n // We compare values before making an update to ensure that\n // a change has been made. This ensures the previous value is\n // persisted correctly between renders.\n return React.useMemo(() => {\n if (ref.current.value !== value) {\n ref.current.previous = ref.current.value;\n ref.current.value = value;\n }\n return ref.current.previous;\n }, [value]);\n}\n\nexport { usePrevious };\n"],
|
| 5 |
+
"mappings": ";AAAA,YAAY,WAAW;AAEvB,SAAS,YAAe,OAAU;AAChC,QAAM,MAAY,aAAO,EAAE,OAAO,UAAU,MAAM,CAAC;AAKnD,SAAa,cAAQ,MAAM;AACzB,QAAI,IAAI,QAAQ,UAAU,OAAO;AAC/B,UAAI,QAAQ,WAAW,IAAI,QAAQ;AACnC,UAAI,QAAQ,QAAQ;AAAA,IACtB;AACA,WAAO,IAAI,QAAQ;AAAA,EACrB,GAAG,CAAC,KAAK,CAAC;AACZ;",
|
| 6 |
+
"names": []
|
| 7 |
+
}
|