Area restrita - Questionario
This commit is contained in:
-1
@@ -1 +0,0 @@
|
||||
../cross-env/src/bin/cross-env.js
|
||||
-1
@@ -1 +0,0 @@
|
||||
../cross-env/src/bin/cross-env-shell.js
|
||||
+1
-1
@@ -1 +1 @@
|
||||
../nanoid/bin/nanoid.cjs
|
||||
../nanoid/bin/nanoid.js
|
||||
+2420
-1275
File diff suppressed because it is too large
Load Diff
+4
-4
@@ -1,7 +1,7 @@
|
||||
"use client";
|
||||
import {
|
||||
Presence
|
||||
} from "./chunk-INCCO7S4.js";
|
||||
} from "./chunk-THQIQPZA.js";
|
||||
import {
|
||||
Combination_default,
|
||||
DismissableLayer,
|
||||
@@ -9,7 +9,7 @@ import {
|
||||
Portal,
|
||||
hideOthers,
|
||||
useFocusGuards
|
||||
} from "./chunk-LIWCVBQK.js";
|
||||
} from "./chunk-AFOUPPSL.js";
|
||||
import {
|
||||
Primitive,
|
||||
composeEventHandlers,
|
||||
@@ -17,12 +17,12 @@ import {
|
||||
createContextScope,
|
||||
useControllableState,
|
||||
useId
|
||||
} from "./chunk-MOFDO34C.js";
|
||||
} from "./chunk-VURJIDBW.js";
|
||||
import "./chunk-YF4B4G2L.js";
|
||||
import {
|
||||
composeRefs,
|
||||
useComposedRefs
|
||||
} from "./chunk-2VUH7NEY.js";
|
||||
import "./chunk-YF4B4G2L.js";
|
||||
import {
|
||||
require_jsx_runtime
|
||||
} from "./chunk-2YVA4HRZ.js";
|
||||
|
||||
+1
-1
@@ -2,10 +2,10 @@
|
||||
import {
|
||||
createSlot
|
||||
} from "./chunk-YWBEB5PG.js";
|
||||
import "./chunk-2VUH7NEY.js";
|
||||
import {
|
||||
require_react_dom
|
||||
} from "./chunk-YF4B4G2L.js";
|
||||
import "./chunk-2VUH7NEY.js";
|
||||
import {
|
||||
require_jsx_runtime
|
||||
} from "./chunk-2YVA4HRZ.js";
|
||||
|
||||
+4
-4
@@ -1,13 +1,13 @@
|
||||
"use client";
|
||||
import {
|
||||
Presence
|
||||
} from "./chunk-INCCO7S4.js";
|
||||
} from "./chunk-THQIQPZA.js";
|
||||
import {
|
||||
createCollection,
|
||||
useDirection,
|
||||
usePrevious,
|
||||
useSize
|
||||
} from "./chunk-L2OGOWTU.js";
|
||||
} from "./chunk-BZDTGYB5.js";
|
||||
import {
|
||||
Primitive,
|
||||
composeEventHandlers,
|
||||
@@ -15,11 +15,11 @@ import {
|
||||
useCallbackRef,
|
||||
useControllableState,
|
||||
useId
|
||||
} from "./chunk-MOFDO34C.js";
|
||||
} from "./chunk-VURJIDBW.js";
|
||||
import "./chunk-YF4B4G2L.js";
|
||||
import {
|
||||
useComposedRefs
|
||||
} from "./chunk-2VUH7NEY.js";
|
||||
import "./chunk-YF4B4G2L.js";
|
||||
import {
|
||||
require_jsx_runtime
|
||||
} from "./chunk-2YVA4HRZ.js";
|
||||
|
||||
+6
-6
@@ -6,13 +6,13 @@ import {
|
||||
Portal,
|
||||
hideOthers,
|
||||
useFocusGuards
|
||||
} from "./chunk-LIWCVBQK.js";
|
||||
} from "./chunk-AFOUPPSL.js";
|
||||
import {
|
||||
createCollection,
|
||||
useDirection,
|
||||
usePrevious,
|
||||
useSize
|
||||
} from "./chunk-L2OGOWTU.js";
|
||||
} from "./chunk-BZDTGYB5.js";
|
||||
import {
|
||||
Primitive,
|
||||
composeEventHandlers,
|
||||
@@ -21,14 +21,14 @@ import {
|
||||
useControllableState,
|
||||
useId,
|
||||
useLayoutEffect2
|
||||
} from "./chunk-MOFDO34C.js";
|
||||
} from "./chunk-VURJIDBW.js";
|
||||
import {
|
||||
require_react_dom
|
||||
} from "./chunk-YF4B4G2L.js";
|
||||
import {
|
||||
composeRefs,
|
||||
useComposedRefs
|
||||
} from "./chunk-2VUH7NEY.js";
|
||||
import {
|
||||
require_react_dom
|
||||
} from "./chunk-YF4B4G2L.js";
|
||||
import {
|
||||
require_jsx_runtime
|
||||
} from "./chunk-2YVA4HRZ.js";
|
||||
|
||||
+73
-34
@@ -1,143 +1,182 @@
|
||||
{
|
||||
"hash": "bef2a67d",
|
||||
"configHash": "eccf13b4",
|
||||
"lockfileHash": "c4c8a51c",
|
||||
"browserHash": "e7109be1",
|
||||
"hash": "3027357f",
|
||||
"configHash": "79477533",
|
||||
"lockfileHash": "cc556dfa",
|
||||
"browserHash": "a4d0689f",
|
||||
"optimized": {
|
||||
"react": {
|
||||
"src": "../../react/index.js",
|
||||
"file": "react.js",
|
||||
"fileHash": "dd97ceba",
|
||||
"fileHash": "554f9983",
|
||||
"needsInterop": true
|
||||
},
|
||||
"react-dom": {
|
||||
"src": "../../react-dom/index.js",
|
||||
"file": "react-dom.js",
|
||||
"fileHash": "8becf687",
|
||||
"fileHash": "ad984ce0",
|
||||
"needsInterop": true
|
||||
},
|
||||
"react/jsx-dev-runtime": {
|
||||
"src": "../../react/jsx-dev-runtime.js",
|
||||
"file": "react_jsx-dev-runtime.js",
|
||||
"fileHash": "2c7217d2",
|
||||
"fileHash": "4d4232e1",
|
||||
"needsInterop": true
|
||||
},
|
||||
"react/jsx-runtime": {
|
||||
"src": "../../react/jsx-runtime.js",
|
||||
"file": "react_jsx-runtime.js",
|
||||
"fileHash": "e28ec614",
|
||||
"fileHash": "4eeb30cd",
|
||||
"needsInterop": true
|
||||
},
|
||||
"@radix-ui/react-dialog": {
|
||||
"src": "../../@radix-ui/react-dialog/dist/index.mjs",
|
||||
"file": "@radix-ui_react-dialog.js",
|
||||
"fileHash": "22041c72",
|
||||
"fileHash": "e7cdc883",
|
||||
"needsInterop": false
|
||||
},
|
||||
"@radix-ui/react-label": {
|
||||
"src": "../../@radix-ui/react-label/dist/index.mjs",
|
||||
"file": "@radix-ui_react-label.js",
|
||||
"fileHash": "d33ac0ed",
|
||||
"fileHash": "d639f3af",
|
||||
"needsInterop": false
|
||||
},
|
||||
"@radix-ui/react-radio-group": {
|
||||
"src": "../../@radix-ui/react-radio-group/dist/index.mjs",
|
||||
"file": "@radix-ui_react-radio-group.js",
|
||||
"fileHash": "2be9d4b7",
|
||||
"fileHash": "af0ec47d",
|
||||
"needsInterop": false
|
||||
},
|
||||
"@radix-ui/react-select": {
|
||||
"src": "../../@radix-ui/react-select/dist/index.mjs",
|
||||
"file": "@radix-ui_react-select.js",
|
||||
"fileHash": "51dd47da",
|
||||
"fileHash": "abaf0a20",
|
||||
"needsInterop": false
|
||||
},
|
||||
"@radix-ui/react-slot": {
|
||||
"src": "../../@radix-ui/react-slot/dist/index.mjs",
|
||||
"file": "@radix-ui_react-slot.js",
|
||||
"fileHash": "32dfa860",
|
||||
"fileHash": "ebd9dde0",
|
||||
"needsInterop": false
|
||||
},
|
||||
"@tanstack/react-query": {
|
||||
"src": "../../@tanstack/react-query/build/modern/index.js",
|
||||
"file": "@tanstack_react-query.js",
|
||||
"fileHash": "a13ea524",
|
||||
"needsInterop": false
|
||||
},
|
||||
"@trpc/client": {
|
||||
"src": "../../@trpc/client/dist/index.mjs",
|
||||
"file": "@trpc_client.js",
|
||||
"fileHash": "c7aefcb2",
|
||||
"needsInterop": false
|
||||
},
|
||||
"@trpc/react-query": {
|
||||
"src": "../../@trpc/react-query/dist/index.mjs",
|
||||
"file": "@trpc_react-query.js",
|
||||
"fileHash": "a5734117",
|
||||
"needsInterop": false
|
||||
},
|
||||
"class-variance-authority": {
|
||||
"src": "../../class-variance-authority/dist/index.mjs",
|
||||
"file": "class-variance-authority.js",
|
||||
"fileHash": "f4a8c6f4",
|
||||
"fileHash": "77515f47",
|
||||
"needsInterop": false
|
||||
},
|
||||
"clsx": {
|
||||
"src": "../../clsx/dist/clsx.mjs",
|
||||
"file": "clsx.js",
|
||||
"fileHash": "e5a299ae",
|
||||
"fileHash": "f3033bff",
|
||||
"needsInterop": false
|
||||
},
|
||||
"gsap": {
|
||||
"src": "../../gsap/index.js",
|
||||
"file": "gsap.js",
|
||||
"fileHash": "76791308",
|
||||
"fileHash": "c80894df",
|
||||
"needsInterop": false
|
||||
},
|
||||
"gsap/ScrollTrigger": {
|
||||
"src": "../../gsap/ScrollTrigger.js",
|
||||
"file": "gsap_ScrollTrigger.js",
|
||||
"fileHash": "187ec0aa",
|
||||
"fileHash": "e62c79bc",
|
||||
"needsInterop": false
|
||||
},
|
||||
"lucide-react": {
|
||||
"src": "../../lucide-react/dist/esm/lucide-react.js",
|
||||
"file": "lucide-react.js",
|
||||
"fileHash": "58304198",
|
||||
"fileHash": "42086d0d",
|
||||
"needsInterop": false
|
||||
},
|
||||
"react-dom/client": {
|
||||
"src": "../../react-dom/client.js",
|
||||
"file": "react-dom_client.js",
|
||||
"fileHash": "b30625c8",
|
||||
"fileHash": "d8b51de0",
|
||||
"needsInterop": true
|
||||
},
|
||||
"react-helmet-async": {
|
||||
"src": "../../react-helmet-async/lib/index.esm.js",
|
||||
"file": "react-helmet-async.js",
|
||||
"fileHash": "79a82144",
|
||||
"fileHash": "71acdb41",
|
||||
"needsInterop": false
|
||||
},
|
||||
"react-router": {
|
||||
"src": "../../react-router/dist/development/index.mjs",
|
||||
"file": "react-router.js",
|
||||
"fileHash": "d5b54b72",
|
||||
"needsInterop": false
|
||||
},
|
||||
"react-router-dom": {
|
||||
"src": "../../react-router-dom/dist/index.mjs",
|
||||
"file": "react-router-dom.js",
|
||||
"fileHash": "4427109e",
|
||||
"fileHash": "2b8d6b0b",
|
||||
"needsInterop": false
|
||||
},
|
||||
"superjson": {
|
||||
"src": "../../superjson/dist/index.js",
|
||||
"file": "superjson.js",
|
||||
"fileHash": "c81c6cdc",
|
||||
"needsInterop": false
|
||||
},
|
||||
"tailwind-merge": {
|
||||
"src": "../../tailwind-merge/dist/bundle-mjs.mjs",
|
||||
"file": "tailwind-merge.js",
|
||||
"fileHash": "9511be49",
|
||||
"fileHash": "10519efc",
|
||||
"needsInterop": false
|
||||
}
|
||||
},
|
||||
"chunks": {
|
||||
"chunk-PXXDNLPL": {
|
||||
"file": "chunk-PXXDNLPL.js"
|
||||
},
|
||||
"chunk-MD5BUWWK": {
|
||||
"file": "chunk-MD5BUWWK.js"
|
||||
},
|
||||
"chunk-U7P2NEEE": {
|
||||
"file": "chunk-U7P2NEEE.js"
|
||||
},
|
||||
"chunk-5M2SSBTA": {
|
||||
"file": "chunk-5M2SSBTA.js"
|
||||
},
|
||||
"chunk-THQIQPZA": {
|
||||
"file": "chunk-THQIQPZA.js"
|
||||
},
|
||||
"chunk-YWBEB5PG": {
|
||||
"file": "chunk-YWBEB5PG.js"
|
||||
},
|
||||
"chunk-INCCO7S4": {
|
||||
"file": "chunk-INCCO7S4.js"
|
||||
"chunk-AFOUPPSL": {
|
||||
"file": "chunk-AFOUPPSL.js"
|
||||
},
|
||||
"chunk-LIWCVBQK": {
|
||||
"file": "chunk-LIWCVBQK.js"
|
||||
"chunk-BZDTGYB5": {
|
||||
"file": "chunk-BZDTGYB5.js"
|
||||
},
|
||||
"chunk-L2OGOWTU": {
|
||||
"file": "chunk-L2OGOWTU.js"
|
||||
},
|
||||
"chunk-MOFDO34C": {
|
||||
"file": "chunk-MOFDO34C.js"
|
||||
},
|
||||
"chunk-2VUH7NEY": {
|
||||
"file": "chunk-2VUH7NEY.js"
|
||||
"chunk-VURJIDBW": {
|
||||
"file": "chunk-VURJIDBW.js"
|
||||
},
|
||||
"chunk-YF4B4G2L": {
|
||||
"file": "chunk-YF4B4G2L.js"
|
||||
},
|
||||
"chunk-2VUH7NEY": {
|
||||
"file": "chunk-2VUH7NEY.js"
|
||||
},
|
||||
"chunk-2YVA4HRZ": {
|
||||
"file": "chunk-2YVA4HRZ.js"
|
||||
},
|
||||
|
||||
-143
@@ -1,143 +0,0 @@
|
||||
import {
|
||||
useLayoutEffect2
|
||||
} from "./chunk-MOFDO34C.js";
|
||||
import {
|
||||
useComposedRefs
|
||||
} from "./chunk-2VUH7NEY.js";
|
||||
import {
|
||||
require_react
|
||||
} from "./chunk-WUR7D6NS.js";
|
||||
import {
|
||||
__toESM
|
||||
} from "./chunk-G3PMV62Z.js";
|
||||
|
||||
// node_modules/@radix-ui/react-presence/dist/index.mjs
|
||||
var React2 = __toESM(require_react(), 1);
|
||||
var React = __toESM(require_react(), 1);
|
||||
function useStateMachine(initialState, machine) {
|
||||
return React.useReducer((state, event) => {
|
||||
const nextState = machine[state][event];
|
||||
return nextState ?? state;
|
||||
}, initialState);
|
||||
}
|
||||
var Presence = (props) => {
|
||||
const { present, children } = props;
|
||||
const presence = usePresence(present);
|
||||
const child = typeof children === "function" ? children({ present: presence.isPresent }) : React2.Children.only(children);
|
||||
const ref = useComposedRefs(presence.ref, getElementRef(child));
|
||||
const forceMount = typeof children === "function";
|
||||
return forceMount || presence.isPresent ? React2.cloneElement(child, { ref }) : null;
|
||||
};
|
||||
Presence.displayName = "Presence";
|
||||
function usePresence(present) {
|
||||
const [node, setNode] = React2.useState();
|
||||
const stylesRef = React2.useRef(null);
|
||||
const prevPresentRef = React2.useRef(present);
|
||||
const prevAnimationNameRef = React2.useRef("none");
|
||||
const initialState = present ? "mounted" : "unmounted";
|
||||
const [state, send] = useStateMachine(initialState, {
|
||||
mounted: {
|
||||
UNMOUNT: "unmounted",
|
||||
ANIMATION_OUT: "unmountSuspended"
|
||||
},
|
||||
unmountSuspended: {
|
||||
MOUNT: "mounted",
|
||||
ANIMATION_END: "unmounted"
|
||||
},
|
||||
unmounted: {
|
||||
MOUNT: "mounted"
|
||||
}
|
||||
});
|
||||
React2.useEffect(() => {
|
||||
const currentAnimationName = getAnimationName(stylesRef.current);
|
||||
prevAnimationNameRef.current = state === "mounted" ? currentAnimationName : "none";
|
||||
}, [state]);
|
||||
useLayoutEffect2(() => {
|
||||
const styles = stylesRef.current;
|
||||
const wasPresent = prevPresentRef.current;
|
||||
const hasPresentChanged = wasPresent !== present;
|
||||
if (hasPresentChanged) {
|
||||
const prevAnimationName = prevAnimationNameRef.current;
|
||||
const currentAnimationName = getAnimationName(styles);
|
||||
if (present) {
|
||||
send("MOUNT");
|
||||
} else if (currentAnimationName === "none" || styles?.display === "none") {
|
||||
send("UNMOUNT");
|
||||
} else {
|
||||
const isAnimating = prevAnimationName !== currentAnimationName;
|
||||
if (wasPresent && isAnimating) {
|
||||
send("ANIMATION_OUT");
|
||||
} else {
|
||||
send("UNMOUNT");
|
||||
}
|
||||
}
|
||||
prevPresentRef.current = present;
|
||||
}
|
||||
}, [present, send]);
|
||||
useLayoutEffect2(() => {
|
||||
if (node) {
|
||||
let timeoutId;
|
||||
const ownerWindow = node.ownerDocument.defaultView ?? window;
|
||||
const handleAnimationEnd = (event) => {
|
||||
const currentAnimationName = getAnimationName(stylesRef.current);
|
||||
const isCurrentAnimation = currentAnimationName.includes(CSS.escape(event.animationName));
|
||||
if (event.target === node && isCurrentAnimation) {
|
||||
send("ANIMATION_END");
|
||||
if (!prevPresentRef.current) {
|
||||
const currentFillMode = node.style.animationFillMode;
|
||||
node.style.animationFillMode = "forwards";
|
||||
timeoutId = ownerWindow.setTimeout(() => {
|
||||
if (node.style.animationFillMode === "forwards") {
|
||||
node.style.animationFillMode = currentFillMode;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
const handleAnimationStart = (event) => {
|
||||
if (event.target === node) {
|
||||
prevAnimationNameRef.current = getAnimationName(stylesRef.current);
|
||||
}
|
||||
};
|
||||
node.addEventListener("animationstart", handleAnimationStart);
|
||||
node.addEventListener("animationcancel", handleAnimationEnd);
|
||||
node.addEventListener("animationend", handleAnimationEnd);
|
||||
return () => {
|
||||
ownerWindow.clearTimeout(timeoutId);
|
||||
node.removeEventListener("animationstart", handleAnimationStart);
|
||||
node.removeEventListener("animationcancel", handleAnimationEnd);
|
||||
node.removeEventListener("animationend", handleAnimationEnd);
|
||||
};
|
||||
} else {
|
||||
send("ANIMATION_END");
|
||||
}
|
||||
}, [node, send]);
|
||||
return {
|
||||
isPresent: ["mounted", "unmountSuspended"].includes(state),
|
||||
ref: React2.useCallback((node2) => {
|
||||
stylesRef.current = node2 ? getComputedStyle(node2) : null;
|
||||
setNode(node2);
|
||||
}, [])
|
||||
};
|
||||
}
|
||||
function getAnimationName(styles) {
|
||||
return styles?.animationName || "none";
|
||||
}
|
||||
function getElementRef(element) {
|
||||
let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get;
|
||||
let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
||||
if (mayWarn) {
|
||||
return element.ref;
|
||||
}
|
||||
getter = Object.getOwnPropertyDescriptor(element, "ref")?.get;
|
||||
mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
||||
if (mayWarn) {
|
||||
return element.props.ref;
|
||||
}
|
||||
return element.props.ref || element.ref;
|
||||
}
|
||||
|
||||
export {
|
||||
Presence
|
||||
};
|
||||
//# sourceMappingURL=chunk-INCCO7S4.js.map
|
||||
-7
File diff suppressed because one or more lines are too long
-248
@@ -1,248 +0,0 @@
|
||||
import {
|
||||
createContextScope,
|
||||
useLayoutEffect2
|
||||
} from "./chunk-MOFDO34C.js";
|
||||
import {
|
||||
composeRefs,
|
||||
useComposedRefs
|
||||
} from "./chunk-2VUH7NEY.js";
|
||||
import {
|
||||
require_jsx_runtime
|
||||
} from "./chunk-2YVA4HRZ.js";
|
||||
import {
|
||||
require_react
|
||||
} from "./chunk-WUR7D6NS.js";
|
||||
import {
|
||||
__toESM
|
||||
} from "./chunk-G3PMV62Z.js";
|
||||
|
||||
// node_modules/@radix-ui/react-collection/dist/index.mjs
|
||||
var import_react = __toESM(require_react(), 1);
|
||||
|
||||
// node_modules/@radix-ui/react-collection/node_modules/@radix-ui/react-slot/dist/index.mjs
|
||||
var React = __toESM(require_react(), 1);
|
||||
var import_jsx_runtime = __toESM(require_jsx_runtime(), 1);
|
||||
function createSlot(ownerName) {
|
||||
const SlotClone = createSlotClone(ownerName);
|
||||
const Slot2 = React.forwardRef((props, forwardedRef) => {
|
||||
const { children, ...slotProps } = props;
|
||||
const childrenArray = React.Children.toArray(children);
|
||||
const slottable = childrenArray.find(isSlottable);
|
||||
if (slottable) {
|
||||
const newElement = slottable.props.children;
|
||||
const newChildren = childrenArray.map((child) => {
|
||||
if (child === slottable) {
|
||||
if (React.Children.count(newElement) > 1) return React.Children.only(null);
|
||||
return React.isValidElement(newElement) ? newElement.props.children : null;
|
||||
} else {
|
||||
return child;
|
||||
}
|
||||
});
|
||||
return (0, import_jsx_runtime.jsx)(SlotClone, { ...slotProps, ref: forwardedRef, children: React.isValidElement(newElement) ? React.cloneElement(newElement, void 0, newChildren) : null });
|
||||
}
|
||||
return (0, import_jsx_runtime.jsx)(SlotClone, { ...slotProps, ref: forwardedRef, children });
|
||||
});
|
||||
Slot2.displayName = `${ownerName}.Slot`;
|
||||
return Slot2;
|
||||
}
|
||||
var Slot = createSlot("Slot");
|
||||
function createSlotClone(ownerName) {
|
||||
const SlotClone = React.forwardRef((props, forwardedRef) => {
|
||||
const { children, ...slotProps } = props;
|
||||
if (React.isValidElement(children)) {
|
||||
const childrenRef = getElementRef(children);
|
||||
const props2 = mergeProps(slotProps, children.props);
|
||||
if (children.type !== React.Fragment) {
|
||||
props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;
|
||||
}
|
||||
return React.cloneElement(children, props2);
|
||||
}
|
||||
return React.Children.count(children) > 1 ? React.Children.only(null) : null;
|
||||
});
|
||||
SlotClone.displayName = `${ownerName}.SlotClone`;
|
||||
return SlotClone;
|
||||
}
|
||||
var SLOTTABLE_IDENTIFIER = /* @__PURE__ */ Symbol("radix.slottable");
|
||||
function createSlottable(ownerName) {
|
||||
const Slottable2 = ({ children }) => {
|
||||
return (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children });
|
||||
};
|
||||
Slottable2.displayName = `${ownerName}.Slottable`;
|
||||
Slottable2.__radixId = SLOTTABLE_IDENTIFIER;
|
||||
return Slottable2;
|
||||
}
|
||||
var Slottable = createSlottable("Slottable");
|
||||
function isSlottable(child) {
|
||||
return React.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;
|
||||
}
|
||||
function mergeProps(slotProps, childProps) {
|
||||
const overrideProps = { ...childProps };
|
||||
for (const propName in childProps) {
|
||||
const slotPropValue = slotProps[propName];
|
||||
const childPropValue = childProps[propName];
|
||||
const isHandler = /^on[A-Z]/.test(propName);
|
||||
if (isHandler) {
|
||||
if (slotPropValue && childPropValue) {
|
||||
overrideProps[propName] = (...args) => {
|
||||
const result = childPropValue(...args);
|
||||
slotPropValue(...args);
|
||||
return result;
|
||||
};
|
||||
} else if (slotPropValue) {
|
||||
overrideProps[propName] = slotPropValue;
|
||||
}
|
||||
} else if (propName === "style") {
|
||||
overrideProps[propName] = { ...slotPropValue, ...childPropValue };
|
||||
} else if (propName === "className") {
|
||||
overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(" ");
|
||||
}
|
||||
}
|
||||
return { ...slotProps, ...overrideProps };
|
||||
}
|
||||
function getElementRef(element) {
|
||||
let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get;
|
||||
let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
||||
if (mayWarn) {
|
||||
return element.ref;
|
||||
}
|
||||
getter = Object.getOwnPropertyDescriptor(element, "ref")?.get;
|
||||
mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
||||
if (mayWarn) {
|
||||
return element.props.ref;
|
||||
}
|
||||
return element.props.ref || element.ref;
|
||||
}
|
||||
|
||||
// node_modules/@radix-ui/react-collection/dist/index.mjs
|
||||
var import_jsx_runtime2 = __toESM(require_jsx_runtime(), 1);
|
||||
var import_react2 = __toESM(require_react(), 1);
|
||||
var import_jsx_runtime3 = __toESM(require_jsx_runtime(), 1);
|
||||
function createCollection(name) {
|
||||
const PROVIDER_NAME = name + "CollectionProvider";
|
||||
const [createCollectionContext, createCollectionScope] = createContextScope(PROVIDER_NAME);
|
||||
const [CollectionProviderImpl, useCollectionContext] = createCollectionContext(
|
||||
PROVIDER_NAME,
|
||||
{ collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map() }
|
||||
);
|
||||
const CollectionProvider = (props) => {
|
||||
const { scope, children } = props;
|
||||
const ref = import_react.default.useRef(null);
|
||||
const itemMap = import_react.default.useRef(/* @__PURE__ */ new Map()).current;
|
||||
return (0, import_jsx_runtime2.jsx)(CollectionProviderImpl, { scope, itemMap, collectionRef: ref, children });
|
||||
};
|
||||
CollectionProvider.displayName = PROVIDER_NAME;
|
||||
const COLLECTION_SLOT_NAME = name + "CollectionSlot";
|
||||
const CollectionSlotImpl = createSlot(COLLECTION_SLOT_NAME);
|
||||
const CollectionSlot = import_react.default.forwardRef(
|
||||
(props, forwardedRef) => {
|
||||
const { scope, children } = props;
|
||||
const context = useCollectionContext(COLLECTION_SLOT_NAME, scope);
|
||||
const composedRefs = useComposedRefs(forwardedRef, context.collectionRef);
|
||||
return (0, import_jsx_runtime2.jsx)(CollectionSlotImpl, { ref: composedRefs, children });
|
||||
}
|
||||
);
|
||||
CollectionSlot.displayName = COLLECTION_SLOT_NAME;
|
||||
const ITEM_SLOT_NAME = name + "CollectionItemSlot";
|
||||
const ITEM_DATA_ATTR = "data-radix-collection-item";
|
||||
const CollectionItemSlotImpl = createSlot(ITEM_SLOT_NAME);
|
||||
const CollectionItemSlot = import_react.default.forwardRef(
|
||||
(props, forwardedRef) => {
|
||||
const { scope, children, ...itemData } = props;
|
||||
const ref = import_react.default.useRef(null);
|
||||
const composedRefs = useComposedRefs(forwardedRef, ref);
|
||||
const context = useCollectionContext(ITEM_SLOT_NAME, scope);
|
||||
import_react.default.useEffect(() => {
|
||||
context.itemMap.set(ref, { ref, ...itemData });
|
||||
return () => void context.itemMap.delete(ref);
|
||||
});
|
||||
return (0, import_jsx_runtime2.jsx)(CollectionItemSlotImpl, { ...{ [ITEM_DATA_ATTR]: "" }, ref: composedRefs, children });
|
||||
}
|
||||
);
|
||||
CollectionItemSlot.displayName = ITEM_SLOT_NAME;
|
||||
function useCollection(scope) {
|
||||
const context = useCollectionContext(name + "CollectionConsumer", scope);
|
||||
const getItems = import_react.default.useCallback(() => {
|
||||
const collectionNode = context.collectionRef.current;
|
||||
if (!collectionNode) return [];
|
||||
const orderedNodes = Array.from(collectionNode.querySelectorAll(`[${ITEM_DATA_ATTR}]`));
|
||||
const items = Array.from(context.itemMap.values());
|
||||
const orderedItems = items.sort(
|
||||
(a, b) => orderedNodes.indexOf(a.ref.current) - orderedNodes.indexOf(b.ref.current)
|
||||
);
|
||||
return orderedItems;
|
||||
}, [context.collectionRef, context.itemMap]);
|
||||
return getItems;
|
||||
}
|
||||
return [
|
||||
{ Provider: CollectionProvider, Slot: CollectionSlot, ItemSlot: CollectionItemSlot },
|
||||
useCollection,
|
||||
createCollectionScope
|
||||
];
|
||||
}
|
||||
|
||||
// node_modules/@radix-ui/react-direction/dist/index.mjs
|
||||
var React3 = __toESM(require_react(), 1);
|
||||
var import_jsx_runtime4 = __toESM(require_jsx_runtime(), 1);
|
||||
var DirectionContext = React3.createContext(void 0);
|
||||
function useDirection(localDir) {
|
||||
const globalDir = React3.useContext(DirectionContext);
|
||||
return localDir || globalDir || "ltr";
|
||||
}
|
||||
|
||||
// node_modules/@radix-ui/react-use-size/dist/index.mjs
|
||||
var React4 = __toESM(require_react(), 1);
|
||||
function useSize(element) {
|
||||
const [size, setSize] = React4.useState(void 0);
|
||||
useLayoutEffect2(() => {
|
||||
if (element) {
|
||||
setSize({ width: element.offsetWidth, height: element.offsetHeight });
|
||||
const resizeObserver = new ResizeObserver((entries) => {
|
||||
if (!Array.isArray(entries)) {
|
||||
return;
|
||||
}
|
||||
if (!entries.length) {
|
||||
return;
|
||||
}
|
||||
const entry = entries[0];
|
||||
let width;
|
||||
let height;
|
||||
if ("borderBoxSize" in entry) {
|
||||
const borderSizeEntry = entry["borderBoxSize"];
|
||||
const borderSize = Array.isArray(borderSizeEntry) ? borderSizeEntry[0] : borderSizeEntry;
|
||||
width = borderSize["inlineSize"];
|
||||
height = borderSize["blockSize"];
|
||||
} else {
|
||||
width = element.offsetWidth;
|
||||
height = element.offsetHeight;
|
||||
}
|
||||
setSize({ width, height });
|
||||
});
|
||||
resizeObserver.observe(element, { box: "border-box" });
|
||||
return () => resizeObserver.unobserve(element);
|
||||
} else {
|
||||
setSize(void 0);
|
||||
}
|
||||
}, [element]);
|
||||
return size;
|
||||
}
|
||||
|
||||
// node_modules/@radix-ui/react-use-previous/dist/index.mjs
|
||||
var React5 = __toESM(require_react(), 1);
|
||||
function usePrevious(value) {
|
||||
const ref = React5.useRef({ value, previous: value });
|
||||
return React5.useMemo(() => {
|
||||
if (ref.current.value !== value) {
|
||||
ref.current.previous = ref.current.value;
|
||||
ref.current.value = value;
|
||||
}
|
||||
return ref.current.previous;
|
||||
}, [value]);
|
||||
}
|
||||
|
||||
export {
|
||||
createCollection,
|
||||
useDirection,
|
||||
useSize,
|
||||
usePrevious
|
||||
};
|
||||
//# sourceMappingURL=chunk-L2OGOWTU.js.map
|
||||
-7
File diff suppressed because one or more lines are too long
-1352
File diff suppressed because it is too large
Load Diff
-7
File diff suppressed because one or more lines are too long
-354
@@ -1,354 +0,0 @@
|
||||
import {
|
||||
composeRefs
|
||||
} from "./chunk-2VUH7NEY.js";
|
||||
import {
|
||||
require_react_dom
|
||||
} from "./chunk-YF4B4G2L.js";
|
||||
import {
|
||||
require_jsx_runtime
|
||||
} from "./chunk-2YVA4HRZ.js";
|
||||
import {
|
||||
require_react
|
||||
} from "./chunk-WUR7D6NS.js";
|
||||
import {
|
||||
__toESM
|
||||
} from "./chunk-G3PMV62Z.js";
|
||||
|
||||
// node_modules/@radix-ui/primitive/dist/index.mjs
|
||||
var canUseDOM = !!(typeof window !== "undefined" && window.document && window.document.createElement);
|
||||
function composeEventHandlers(originalEventHandler, ourEventHandler, { checkForDefaultPrevented = true } = {}) {
|
||||
return function handleEvent(event) {
|
||||
originalEventHandler?.(event);
|
||||
if (checkForDefaultPrevented === false || !event.defaultPrevented) {
|
||||
return ourEventHandler?.(event);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// node_modules/@radix-ui/react-context/dist/index.mjs
|
||||
var React = __toESM(require_react(), 1);
|
||||
var import_jsx_runtime = __toESM(require_jsx_runtime(), 1);
|
||||
function createContext2(rootComponentName, defaultContext) {
|
||||
const Context = React.createContext(defaultContext);
|
||||
const Provider = (props) => {
|
||||
const { children, ...context } = props;
|
||||
const value = React.useMemo(() => context, Object.values(context));
|
||||
return (0, import_jsx_runtime.jsx)(Context.Provider, { value, children });
|
||||
};
|
||||
Provider.displayName = rootComponentName + "Provider";
|
||||
function useContext2(consumerName) {
|
||||
const context = React.useContext(Context);
|
||||
if (context) return context;
|
||||
if (defaultContext !== void 0) return defaultContext;
|
||||
throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
|
||||
}
|
||||
return [Provider, useContext2];
|
||||
}
|
||||
function createContextScope(scopeName, createContextScopeDeps = []) {
|
||||
let defaultContexts = [];
|
||||
function createContext3(rootComponentName, defaultContext) {
|
||||
const BaseContext = React.createContext(defaultContext);
|
||||
const index = defaultContexts.length;
|
||||
defaultContexts = [...defaultContexts, defaultContext];
|
||||
const Provider = (props) => {
|
||||
const { scope, children, ...context } = props;
|
||||
const Context = scope?.[scopeName]?.[index] || BaseContext;
|
||||
const value = React.useMemo(() => context, Object.values(context));
|
||||
return (0, import_jsx_runtime.jsx)(Context.Provider, { value, children });
|
||||
};
|
||||
Provider.displayName = rootComponentName + "Provider";
|
||||
function useContext2(consumerName, scope) {
|
||||
const Context = scope?.[scopeName]?.[index] || BaseContext;
|
||||
const context = React.useContext(Context);
|
||||
if (context) return context;
|
||||
if (defaultContext !== void 0) return defaultContext;
|
||||
throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
|
||||
}
|
||||
return [Provider, useContext2];
|
||||
}
|
||||
const createScope = () => {
|
||||
const scopeContexts = defaultContexts.map((defaultContext) => {
|
||||
return React.createContext(defaultContext);
|
||||
});
|
||||
return function useScope(scope) {
|
||||
const contexts = scope?.[scopeName] || scopeContexts;
|
||||
return React.useMemo(
|
||||
() => ({ [`__scope${scopeName}`]: { ...scope, [scopeName]: contexts } }),
|
||||
[scope, contexts]
|
||||
);
|
||||
};
|
||||
};
|
||||
createScope.scopeName = scopeName;
|
||||
return [createContext3, composeContextScopes(createScope, ...createContextScopeDeps)];
|
||||
}
|
||||
function composeContextScopes(...scopes) {
|
||||
const baseScope = scopes[0];
|
||||
if (scopes.length === 1) return baseScope;
|
||||
const createScope = () => {
|
||||
const scopeHooks = scopes.map((createScope2) => ({
|
||||
useScope: createScope2(),
|
||||
scopeName: createScope2.scopeName
|
||||
}));
|
||||
return function useComposedScopes(overrideScopes) {
|
||||
const nextScopes = scopeHooks.reduce((nextScopes2, { useScope, scopeName }) => {
|
||||
const scopeProps = useScope(overrideScopes);
|
||||
const currentScope = scopeProps[`__scope${scopeName}`];
|
||||
return { ...nextScopes2, ...currentScope };
|
||||
}, {});
|
||||
return React.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]);
|
||||
};
|
||||
};
|
||||
createScope.scopeName = baseScope.scopeName;
|
||||
return createScope;
|
||||
}
|
||||
|
||||
// node_modules/@radix-ui/react-use-layout-effect/dist/index.mjs
|
||||
var React2 = __toESM(require_react(), 1);
|
||||
var useLayoutEffect2 = globalThis?.document ? React2.useLayoutEffect : () => {
|
||||
};
|
||||
|
||||
// node_modules/@radix-ui/react-id/dist/index.mjs
|
||||
var React3 = __toESM(require_react(), 1);
|
||||
var useReactId = React3[" useId ".trim().toString()] || (() => void 0);
|
||||
var count = 0;
|
||||
function useId(deterministicId) {
|
||||
const [id, setId] = React3.useState(useReactId());
|
||||
useLayoutEffect2(() => {
|
||||
if (!deterministicId) setId((reactId) => reactId ?? String(count++));
|
||||
}, [deterministicId]);
|
||||
return deterministicId || (id ? `radix-${id}` : "");
|
||||
}
|
||||
|
||||
// node_modules/@radix-ui/react-use-controllable-state/dist/index.mjs
|
||||
var React5 = __toESM(require_react(), 1);
|
||||
var React22 = __toESM(require_react(), 1);
|
||||
|
||||
// node_modules/@radix-ui/react-use-effect-event/dist/index.mjs
|
||||
var React4 = __toESM(require_react(), 1);
|
||||
var useReactEffectEvent = React4[" useEffectEvent ".trim().toString()];
|
||||
var useReactInsertionEffect = React4[" useInsertionEffect ".trim().toString()];
|
||||
|
||||
// node_modules/@radix-ui/react-use-controllable-state/dist/index.mjs
|
||||
var useInsertionEffect = React5[" useInsertionEffect ".trim().toString()] || useLayoutEffect2;
|
||||
function useControllableState({
|
||||
prop,
|
||||
defaultProp,
|
||||
onChange = () => {
|
||||
},
|
||||
caller
|
||||
}) {
|
||||
const [uncontrolledProp, setUncontrolledProp, onChangeRef] = useUncontrolledState({
|
||||
defaultProp,
|
||||
onChange
|
||||
});
|
||||
const isControlled = prop !== void 0;
|
||||
const value = isControlled ? prop : uncontrolledProp;
|
||||
if (true) {
|
||||
const isControlledRef = React5.useRef(prop !== void 0);
|
||||
React5.useEffect(() => {
|
||||
const wasControlled = isControlledRef.current;
|
||||
if (wasControlled !== isControlled) {
|
||||
const from = wasControlled ? "controlled" : "uncontrolled";
|
||||
const to = isControlled ? "controlled" : "uncontrolled";
|
||||
console.warn(
|
||||
`${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.`
|
||||
);
|
||||
}
|
||||
isControlledRef.current = isControlled;
|
||||
}, [isControlled, caller]);
|
||||
}
|
||||
const setValue = React5.useCallback(
|
||||
(nextValue) => {
|
||||
if (isControlled) {
|
||||
const value2 = isFunction(nextValue) ? nextValue(prop) : nextValue;
|
||||
if (value2 !== prop) {
|
||||
onChangeRef.current?.(value2);
|
||||
}
|
||||
} else {
|
||||
setUncontrolledProp(nextValue);
|
||||
}
|
||||
},
|
||||
[isControlled, prop, setUncontrolledProp, onChangeRef]
|
||||
);
|
||||
return [value, setValue];
|
||||
}
|
||||
function useUncontrolledState({
|
||||
defaultProp,
|
||||
onChange
|
||||
}) {
|
||||
const [value, setValue] = React5.useState(defaultProp);
|
||||
const prevValueRef = React5.useRef(value);
|
||||
const onChangeRef = React5.useRef(onChange);
|
||||
useInsertionEffect(() => {
|
||||
onChangeRef.current = onChange;
|
||||
}, [onChange]);
|
||||
React5.useEffect(() => {
|
||||
if (prevValueRef.current !== value) {
|
||||
onChangeRef.current?.(value);
|
||||
prevValueRef.current = value;
|
||||
}
|
||||
}, [value, prevValueRef]);
|
||||
return [value, setValue, onChangeRef];
|
||||
}
|
||||
function isFunction(value) {
|
||||
return typeof value === "function";
|
||||
}
|
||||
|
||||
// node_modules/@radix-ui/react-primitive/dist/index.mjs
|
||||
var React7 = __toESM(require_react(), 1);
|
||||
var ReactDOM = __toESM(require_react_dom(), 1);
|
||||
|
||||
// node_modules/@radix-ui/react-primitive/node_modules/@radix-ui/react-slot/dist/index.mjs
|
||||
var React6 = __toESM(require_react(), 1);
|
||||
var import_jsx_runtime2 = __toESM(require_jsx_runtime(), 1);
|
||||
function createSlot(ownerName) {
|
||||
const SlotClone = createSlotClone(ownerName);
|
||||
const Slot2 = React6.forwardRef((props, forwardedRef) => {
|
||||
const { children, ...slotProps } = props;
|
||||
const childrenArray = React6.Children.toArray(children);
|
||||
const slottable = childrenArray.find(isSlottable);
|
||||
if (slottable) {
|
||||
const newElement = slottable.props.children;
|
||||
const newChildren = childrenArray.map((child) => {
|
||||
if (child === slottable) {
|
||||
if (React6.Children.count(newElement) > 1) return React6.Children.only(null);
|
||||
return React6.isValidElement(newElement) ? newElement.props.children : null;
|
||||
} else {
|
||||
return child;
|
||||
}
|
||||
});
|
||||
return (0, import_jsx_runtime2.jsx)(SlotClone, { ...slotProps, ref: forwardedRef, children: React6.isValidElement(newElement) ? React6.cloneElement(newElement, void 0, newChildren) : null });
|
||||
}
|
||||
return (0, import_jsx_runtime2.jsx)(SlotClone, { ...slotProps, ref: forwardedRef, children });
|
||||
});
|
||||
Slot2.displayName = `${ownerName}.Slot`;
|
||||
return Slot2;
|
||||
}
|
||||
var Slot = createSlot("Slot");
|
||||
function createSlotClone(ownerName) {
|
||||
const SlotClone = React6.forwardRef((props, forwardedRef) => {
|
||||
const { children, ...slotProps } = props;
|
||||
if (React6.isValidElement(children)) {
|
||||
const childrenRef = getElementRef(children);
|
||||
const props2 = mergeProps(slotProps, children.props);
|
||||
if (children.type !== React6.Fragment) {
|
||||
props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;
|
||||
}
|
||||
return React6.cloneElement(children, props2);
|
||||
}
|
||||
return React6.Children.count(children) > 1 ? React6.Children.only(null) : null;
|
||||
});
|
||||
SlotClone.displayName = `${ownerName}.SlotClone`;
|
||||
return SlotClone;
|
||||
}
|
||||
var SLOTTABLE_IDENTIFIER = /* @__PURE__ */ Symbol("radix.slottable");
|
||||
function createSlottable(ownerName) {
|
||||
const Slottable2 = ({ children }) => {
|
||||
return (0, import_jsx_runtime2.jsx)(import_jsx_runtime2.Fragment, { children });
|
||||
};
|
||||
Slottable2.displayName = `${ownerName}.Slottable`;
|
||||
Slottable2.__radixId = SLOTTABLE_IDENTIFIER;
|
||||
return Slottable2;
|
||||
}
|
||||
var Slottable = createSlottable("Slottable");
|
||||
function isSlottable(child) {
|
||||
return React6.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;
|
||||
}
|
||||
function mergeProps(slotProps, childProps) {
|
||||
const overrideProps = { ...childProps };
|
||||
for (const propName in childProps) {
|
||||
const slotPropValue = slotProps[propName];
|
||||
const childPropValue = childProps[propName];
|
||||
const isHandler = /^on[A-Z]/.test(propName);
|
||||
if (isHandler) {
|
||||
if (slotPropValue && childPropValue) {
|
||||
overrideProps[propName] = (...args) => {
|
||||
const result = childPropValue(...args);
|
||||
slotPropValue(...args);
|
||||
return result;
|
||||
};
|
||||
} else if (slotPropValue) {
|
||||
overrideProps[propName] = slotPropValue;
|
||||
}
|
||||
} else if (propName === "style") {
|
||||
overrideProps[propName] = { ...slotPropValue, ...childPropValue };
|
||||
} else if (propName === "className") {
|
||||
overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(" ");
|
||||
}
|
||||
}
|
||||
return { ...slotProps, ...overrideProps };
|
||||
}
|
||||
function getElementRef(element) {
|
||||
let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get;
|
||||
let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
||||
if (mayWarn) {
|
||||
return element.ref;
|
||||
}
|
||||
getter = Object.getOwnPropertyDescriptor(element, "ref")?.get;
|
||||
mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
||||
if (mayWarn) {
|
||||
return element.props.ref;
|
||||
}
|
||||
return element.props.ref || element.ref;
|
||||
}
|
||||
|
||||
// node_modules/@radix-ui/react-primitive/dist/index.mjs
|
||||
var import_jsx_runtime3 = __toESM(require_jsx_runtime(), 1);
|
||||
var NODES = [
|
||||
"a",
|
||||
"button",
|
||||
"div",
|
||||
"form",
|
||||
"h2",
|
||||
"h3",
|
||||
"img",
|
||||
"input",
|
||||
"label",
|
||||
"li",
|
||||
"nav",
|
||||
"ol",
|
||||
"p",
|
||||
"select",
|
||||
"span",
|
||||
"svg",
|
||||
"ul"
|
||||
];
|
||||
var Primitive = NODES.reduce((primitive, node) => {
|
||||
const Slot2 = createSlot(`Primitive.${node}`);
|
||||
const Node = React7.forwardRef((props, forwardedRef) => {
|
||||
const { asChild, ...primitiveProps } = props;
|
||||
const Comp = asChild ? Slot2 : node;
|
||||
if (typeof window !== "undefined") {
|
||||
window[/* @__PURE__ */ Symbol.for("radix-ui")] = true;
|
||||
}
|
||||
return (0, import_jsx_runtime3.jsx)(Comp, { ...primitiveProps, ref: forwardedRef });
|
||||
});
|
||||
Node.displayName = `Primitive.${node}`;
|
||||
return { ...primitive, [node]: Node };
|
||||
}, {});
|
||||
function dispatchDiscreteCustomEvent(target, event) {
|
||||
if (target) ReactDOM.flushSync(() => target.dispatchEvent(event));
|
||||
}
|
||||
|
||||
// node_modules/@radix-ui/react-use-callback-ref/dist/index.mjs
|
||||
var React8 = __toESM(require_react(), 1);
|
||||
function useCallbackRef(callback) {
|
||||
const callbackRef = React8.useRef(callback);
|
||||
React8.useEffect(() => {
|
||||
callbackRef.current = callback;
|
||||
});
|
||||
return React8.useMemo(() => (...args) => callbackRef.current?.(...args), []);
|
||||
}
|
||||
|
||||
export {
|
||||
composeEventHandlers,
|
||||
createContext2,
|
||||
createContextScope,
|
||||
useLayoutEffect2,
|
||||
useId,
|
||||
useControllableState,
|
||||
Primitive,
|
||||
dispatchDiscreteCustomEvent,
|
||||
useCallbackRef
|
||||
};
|
||||
//# sourceMappingURL=chunk-MOFDO34C.js.map
|
||||
-7
File diff suppressed because one or more lines are too long
+30
-43
@@ -1056,24 +1056,6 @@ var _invertEase = function _invertEase2(ease) {
|
||||
return 1 - ease(1 - p);
|
||||
};
|
||||
};
|
||||
var _propagateYoyoEase = function _propagateYoyoEase2(timeline2, isYoyo) {
|
||||
var child = timeline2._first, ease;
|
||||
while (child) {
|
||||
if (child instanceof Timeline) {
|
||||
_propagateYoyoEase2(child, isYoyo);
|
||||
} else if (child.vars.yoyoEase && (!child._yoyo || !child._repeat) && child._yoyo !== isYoyo) {
|
||||
if (child.timeline) {
|
||||
_propagateYoyoEase2(child.timeline, isYoyo);
|
||||
} else {
|
||||
ease = child._ease;
|
||||
child._ease = child._yEase;
|
||||
child._yEase = ease;
|
||||
child._yoyo = isYoyo;
|
||||
}
|
||||
}
|
||||
child = child._next;
|
||||
}
|
||||
};
|
||||
var _parseEase = function _parseEase2(ease, defaultEase) {
|
||||
return !ease ? defaultEase : (_isFunction(ease) ? ease : _easeMap[ease] || _configEaseFromString(ease)) || defaultEase;
|
||||
};
|
||||
@@ -1579,7 +1561,6 @@ var Timeline = (function(_Animation) {
|
||||
if (!this._ts && !prevPaused) {
|
||||
return this;
|
||||
}
|
||||
_propagateYoyoEase(this, isYoyo);
|
||||
}
|
||||
}
|
||||
if (this._hasPause && !this._forcing && this._lock < 2) {
|
||||
@@ -1590,7 +1571,7 @@ var Timeline = (function(_Animation) {
|
||||
}
|
||||
this._tTime = tTime;
|
||||
this._time = time;
|
||||
this._act = !timeScale;
|
||||
this._act = !!timeScale;
|
||||
if (!this._initted) {
|
||||
this._onUpdate = this.vars.onUpdate;
|
||||
this._initted = 1;
|
||||
@@ -2038,16 +2019,12 @@ var _checkPlugin = function _checkPlugin2(property, vars, tween, index, target,
|
||||
var _overwritingTween;
|
||||
var _forceAllPropTweens;
|
||||
var _initTween = function _initTween2(tween, time, tTime) {
|
||||
var vars = tween.vars, ease = vars.ease, startAt = vars.startAt, immediateRender = vars.immediateRender, lazy = vars.lazy, onUpdate = vars.onUpdate, runBackwards = vars.runBackwards, yoyoEase = vars.yoyoEase, keyframes = vars.keyframes, autoRevert = vars.autoRevert, dur = tween._dur, prevStartAt = tween._startAt, targets = tween._targets, parent = tween.parent, fullTargets = parent && parent.data === "nested" ? parent.vars.targets : targets, autoOverwrite = tween._overwrite === "auto" && !_suppressOverwrites, tl = tween.timeline, cleanVars, i, p, pt, target, hasPriority, gsData, harness, plugin, ptLookup, index, harnessVars, overwritten;
|
||||
var vars = tween.vars, ease = vars.ease, startAt = vars.startAt, immediateRender = vars.immediateRender, lazy = vars.lazy, onUpdate = vars.onUpdate, runBackwards = vars.runBackwards, yoyoEase = vars.yoyoEase, keyframes = vars.keyframes, autoRevert = vars.autoRevert, dur = tween._dur, prevStartAt = tween._startAt, targets = tween._targets, parent = tween.parent, fullTargets = parent && parent.data === "nested" ? parent.vars.targets : targets, autoOverwrite = tween._overwrite === "auto" && !_suppressOverwrites, tl = tween.timeline, reverseEase = vars.easeReverse || yoyoEase, cleanVars, i, p, pt, target, hasPriority, gsData, harness, plugin, ptLookup, index, harnessVars, overwritten;
|
||||
tl && (!keyframes || !ease) && (ease = "none");
|
||||
tween._ease = _parseEase(ease, _defaults.ease);
|
||||
tween._yEase = yoyoEase ? _invertEase(_parseEase(yoyoEase === true ? ease : yoyoEase, _defaults.ease)) : 0;
|
||||
if (yoyoEase && tween._yoyo && !tween._repeat) {
|
||||
yoyoEase = tween._yEase;
|
||||
tween._yEase = tween._ease;
|
||||
tween._ease = yoyoEase;
|
||||
}
|
||||
tween._rEase = reverseEase && (_parseEase(reverseEase) || tween._ease);
|
||||
tween._from = !tl && !!vars.runBackwards;
|
||||
if (tween._from) tween.ratio = 1;
|
||||
if (!tl || keyframes && !vars.stagger) {
|
||||
harness = targets[0] ? _getCache(targets[0]).harness : 0;
|
||||
harnessVars = harness && vars[harness.prop];
|
||||
@@ -2166,7 +2143,7 @@ var _updatePropTweens = function _updatePropTweens2(tween, property, value, star
|
||||
tween.vars[property] = "+=0";
|
||||
_initTween(tween, time);
|
||||
_forceAllPropTweens = 0;
|
||||
return skipRecursion ? _warn(property + " not eligible for reset") : 1;
|
||||
return skipRecursion ? _warn(property + " not eligible for reset. Try splitting into individual properties") : 1;
|
||||
}
|
||||
ptCache.push(pt);
|
||||
}
|
||||
@@ -2223,7 +2200,7 @@ var _parseKeyframe = function _parseKeyframe2(prop, obj, allProps, easeEach) {
|
||||
var _parseFuncOrString = function _parseFuncOrString2(value, tween, i, target, targets) {
|
||||
return _isFunction(value) ? value.call(tween, i, target, targets) : _isString(value) && ~value.indexOf("random(") ? _replaceRandom(value) : value;
|
||||
};
|
||||
var _staggerTweenProps = _callbackNames + "repeat,repeatDelay,yoyo,repeatRefresh,yoyoEase,autoRevert";
|
||||
var _staggerTweenProps = _callbackNames + "repeat,repeatDelay,yoyo,repeatRefresh,yoyoEase,easeReverse,autoRevert";
|
||||
var _staggerPropsToSkip = {};
|
||||
_forEachName(_staggerTweenProps + ",id,stagger,delay,duration,paused,scrollTrigger", function(name) {
|
||||
return _staggerPropsToSkip[name] = 1;
|
||||
@@ -2238,12 +2215,13 @@ var Tween = (function(_Animation2) {
|
||||
position = null;
|
||||
}
|
||||
_this3 = _Animation2.call(this, skipInherit ? vars : _inheritDefaults(vars)) || this;
|
||||
var _this3$vars = _this3.vars, duration = _this3$vars.duration, delay = _this3$vars.delay, immediateRender = _this3$vars.immediateRender, stagger = _this3$vars.stagger, overwrite = _this3$vars.overwrite, keyframes = _this3$vars.keyframes, defaults2 = _this3$vars.defaults, scrollTrigger = _this3$vars.scrollTrigger, yoyoEase = _this3$vars.yoyoEase, parent = vars.parent || _globalTimeline, parsedTargets = (_isArray(targets) || _isTypedArray(targets) ? _isNumber(targets[0]) : "length" in vars) ? [targets] : toArray(targets), tl, i, copy, l, p, curTarget, staggerFunc, staggerVarsToMerge;
|
||||
var _this3$vars = _this3.vars, duration = _this3$vars.duration, delay = _this3$vars.delay, immediateRender = _this3$vars.immediateRender, stagger = _this3$vars.stagger, overwrite = _this3$vars.overwrite, keyframes = _this3$vars.keyframes, defaults2 = _this3$vars.defaults, scrollTrigger = _this3$vars.scrollTrigger, parent = vars.parent || _globalTimeline, parsedTargets = (_isArray(targets) || _isTypedArray(targets) ? _isNumber(targets[0]) : "length" in vars) ? [targets] : toArray(targets), tl, i, copy, l, p, curTarget, staggerFunc, staggerVarsToMerge;
|
||||
_this3._targets = parsedTargets.length ? _harness(parsedTargets) : _warn("GSAP target " + targets + " not found. https://gsap.com", !_config.nullTargetWarn) || [];
|
||||
_this3._ptLookup = [];
|
||||
_this3._overwrite = overwrite;
|
||||
if (keyframes || stagger || _isFuncOrString(duration) || _isFuncOrString(delay)) {
|
||||
vars = _this3.vars;
|
||||
var easeReverse = vars.easeReverse || vars.yoyoEase;
|
||||
tl = _this3.timeline = new Timeline({
|
||||
data: "nested",
|
||||
defaults: defaults2 || {},
|
||||
@@ -2266,7 +2244,7 @@ var Tween = (function(_Animation2) {
|
||||
for (i = 0; i < l; i++) {
|
||||
copy = _copyExcluding(vars, _staggerPropsToSkip);
|
||||
copy.stagger = 0;
|
||||
yoyoEase && (copy.yoyoEase = yoyoEase);
|
||||
easeReverse && (copy.easeReverse = easeReverse);
|
||||
staggerVarsToMerge && _merge(copy, staggerVarsToMerge);
|
||||
curTarget = parsedTargets[i];
|
||||
copy.duration = +_parseFuncOrString(duration, _assertThisInitialized(_this3), i, curTarget, parsedTargets);
|
||||
@@ -2338,7 +2316,7 @@ var Tween = (function(_Animation2) {
|
||||
}
|
||||
var _proto3 = Tween2.prototype;
|
||||
_proto3.render = function render3(totalTime, suppressEvents, force) {
|
||||
var prevTime = this._time, tDur = this._tDur, dur = this._dur, isNegative = totalTime < 0, tTime = totalTime > tDur - _tinyNum && !isNegative ? tDur : totalTime < _tinyNum ? 0 : totalTime, time, pt, iteration, cycleDuration, prevIteration, isYoyo, ratio, timeline2, yoyoEase;
|
||||
var prevTime = this._time, tDur = this._tDur, dur = this._dur, isNegative = totalTime < 0, tTime = totalTime > tDur - _tinyNum && !isNegative ? tDur : totalTime < _tinyNum ? 0 : totalTime, time, pt, iteration, cycleDuration, prevIteration, isYoyo, ratio, timeline2;
|
||||
if (!dur) {
|
||||
_renderZeroDurationTween(this, totalTime, suppressEvents, force);
|
||||
} else if (tTime !== this._tTime || !totalTime || force || !this._initted && this._tTime || this._startAt && this._zTime < 0 !== isNegative || this._lazy) {
|
||||
@@ -2364,17 +2342,13 @@ var Tween = (function(_Animation2) {
|
||||
}
|
||||
}
|
||||
isYoyo = this._yoyo && iteration & 1;
|
||||
if (isYoyo) {
|
||||
yoyoEase = this._yEase;
|
||||
time = dur - time;
|
||||
}
|
||||
if (isYoyo) time = dur - time;
|
||||
prevIteration = _animationCycle(this._tTime, cycleDuration);
|
||||
if (time === prevTime && !force && this._initted && iteration === prevIteration) {
|
||||
this._tTime = tTime;
|
||||
return this;
|
||||
}
|
||||
if (iteration !== prevIteration) {
|
||||
timeline2 && this._yEase && _propagateYoyoEase(timeline2, isYoyo);
|
||||
if (this.vars.repeatRefresh && !isYoyo && !this._lock && time !== cycleDuration && this._initted) {
|
||||
this._lock = force = 1;
|
||||
this.render(_roundPrecise(cycleDuration * iteration), true).invalidate()._lock = 0;
|
||||
@@ -2393,16 +2367,29 @@ var Tween = (function(_Animation2) {
|
||||
return this.render(totalTime, suppressEvents, force);
|
||||
}
|
||||
}
|
||||
if (this._rEase) {
|
||||
var inv = time < prevTime;
|
||||
if (inv !== this._inv) {
|
||||
var segDur = inv ? prevTime : dur - prevTime;
|
||||
this._inv = inv;
|
||||
if (this._from) this.ratio = 1 - this.ratio;
|
||||
this._invRatio = this.ratio;
|
||||
this._invTime = prevTime;
|
||||
this._invRecip = segDur ? (inv ? -1 : 1) / segDur : 0;
|
||||
this._invScale = inv ? -this.ratio : 1 - this.ratio;
|
||||
this._invEase = inv ? this._rEase : this._ease;
|
||||
}
|
||||
this.ratio = ratio = this._invRatio + this._invScale * this._invEase((time - this._invTime) * this._invRecip);
|
||||
} else {
|
||||
this.ratio = ratio = this._ease(time / dur);
|
||||
}
|
||||
if (this._from) this.ratio = ratio = 1 - ratio;
|
||||
this._tTime = tTime;
|
||||
this._time = time;
|
||||
if (!this._act && this._ts) {
|
||||
this._act = 1;
|
||||
this._lazy = 0;
|
||||
}
|
||||
this.ratio = ratio = (yoyoEase || this._ease)(time / dur);
|
||||
if (this._from) {
|
||||
this.ratio = ratio = 1 - ratio;
|
||||
}
|
||||
if (!prevTime && tTime && !suppressEvents && !prevIteration) {
|
||||
_callback(this, "onStart");
|
||||
if (this._tTime !== tTime) {
|
||||
@@ -2674,7 +2661,7 @@ var PropTween = (function() {
|
||||
};
|
||||
return PropTween2;
|
||||
})();
|
||||
_forEachName(_callbackNames + "parent,duration,ease,delay,overwrite,runBackwards,startAt,yoyo,immediateRender,repeat,repeatDelay,data,paused,reversed,lazy,callbackScope,stringFilter,id,yoyoEase,stagger,inherit,repeatRefresh,keyframes,autoRevert,scrollTrigger", function(name) {
|
||||
_forEachName(_callbackNames + "parent,duration,ease,delay,overwrite,runBackwards,startAt,yoyo,immediateRender,repeat,repeatDelay,data,paused,reversed,lazy,callbackScope,stringFilter,id,yoyoEase,stagger,inherit,repeatRefresh,keyframes,autoRevert,scrollTrigger,easeReverse", function(name) {
|
||||
return _reservedProps[name] = 1;
|
||||
});
|
||||
_globals.TweenMax = _globals.TweenLite = Tween;
|
||||
@@ -3146,7 +3133,7 @@ var gsap = _gsap.registerPlugin({
|
||||
}
|
||||
}
|
||||
}, _buildModifierPlugin("roundProps", _roundModifier), _buildModifierPlugin("modifiers"), _buildModifierPlugin("snap", snap)) || _gsap;
|
||||
Tween.version = Timeline.version = gsap.version = "3.14.2";
|
||||
Tween.version = Timeline.version = gsap.version = "3.15.0";
|
||||
_coreReady = 1;
|
||||
_windowExists() && _wake();
|
||||
var Power0 = _easeMap.Power0;
|
||||
|
||||
+3
-3
File diff suppressed because one or more lines are too long
+19
-13
@@ -168,7 +168,7 @@ var _getVelocityProp = function _getVelocityProp2(value, minTimeRefresh, useDelt
|
||||
};
|
||||
};
|
||||
var _getEvent = function _getEvent2(e, preventDefault) {
|
||||
preventDefault && !e._gsapAllow && e.preventDefault();
|
||||
preventDefault && !e._gsapAllow && e.cancelable !== false && e.preventDefault();
|
||||
return e.changedTouches ? e.changedTouches[0] : e;
|
||||
};
|
||||
var _getAbsoluteMax = function _getAbsoluteMax2(a) {
|
||||
@@ -196,9 +196,9 @@ var _initCore = function _initCore2(core) {
|
||||
setTimeout(function() {
|
||||
return _startup = 0;
|
||||
}, 500);
|
||||
_setScrollTrigger();
|
||||
_coreInitted = 1;
|
||||
}
|
||||
ScrollTrigger || _setScrollTrigger();
|
||||
return _coreInitted;
|
||||
};
|
||||
_horizontal.op = _vertical;
|
||||
@@ -468,7 +468,7 @@ var Observer = (function() {
|
||||
}]);
|
||||
return Observer2;
|
||||
})();
|
||||
Observer.version = "3.14.2";
|
||||
Observer.version = "3.15.0";
|
||||
Observer.create = function(vars) {
|
||||
return new Observer(vars);
|
||||
};
|
||||
@@ -604,11 +604,11 @@ var _isObject = function _isObject2(value) {
|
||||
var _endAnimation = function _endAnimation2(animation, reversed, pause) {
|
||||
return animation && animation.progress(reversed ? 0 : 1) && pause && animation.pause();
|
||||
};
|
||||
var _callback = function _callback2(self, func) {
|
||||
var _callback = function _callback2(self, func, extraParam) {
|
||||
if (self.enabled) {
|
||||
var result = self._ctx ? self._ctx.add(function() {
|
||||
return func(self);
|
||||
}) : func(self);
|
||||
return func(self, extraParam);
|
||||
}) : func(self, extraParam);
|
||||
result && result.totalTime && (self.callbackAnimation = result);
|
||||
}
|
||||
};
|
||||
@@ -629,7 +629,7 @@ var _Width = "Width";
|
||||
var _Height = "Height";
|
||||
var _px = "px";
|
||||
var _getComputedStyle = function _getComputedStyle2(element) {
|
||||
return _win2.getComputedStyle(element);
|
||||
return _win2.getComputedStyle(element.nodeType === Node.DOCUMENT_NODE ? element.scrollingElement : element);
|
||||
};
|
||||
var _makePositionable = function _makePositionable2(element) {
|
||||
var position = _getComputedStyle(element).position;
|
||||
@@ -653,7 +653,7 @@ var _getBounds = function _getBounds2(element, withoutTransforms) {
|
||||
scale: 1,
|
||||
skewX: 0,
|
||||
skewY: 0
|
||||
}).progress(1), bounds = element.getBoundingClientRect();
|
||||
}).progress(1), bounds = element.getBoundingClientRect ? element.getBoundingClientRect() : element.scrollingElement.getBoundingClientRect();
|
||||
tween && tween.progress(0).kill();
|
||||
return bounds;
|
||||
};
|
||||
@@ -768,7 +768,7 @@ var _offsetToPx = function _offsetToPx2(value, size) {
|
||||
};
|
||||
var _createMarker = function _createMarker2(type, name, container, direction, _ref4, offset, matchWidthEl, containerAnimation) {
|
||||
var startColor = _ref4.startColor, endColor = _ref4.endColor, fontSize = _ref4.fontSize, indent = _ref4.indent, fontWeight = _ref4.fontWeight;
|
||||
var e = _doc2.createElement("div"), useFixedPosition = _isViewport3(container) || _getProxyProp(container, "pinType") === "fixed", isScroller = type.indexOf("scroller") !== -1, parent = useFixedPosition ? _body2 : container, isStart = type.indexOf("start") !== -1, color = isStart ? startColor : endColor, css = "border-color:" + color + ";font-size:" + fontSize + ";color:" + color + ";font-weight:" + fontWeight + ";pointer-events:none;white-space:nowrap;font-family:sans-serif,Arial;z-index:1000;padding:4px 8px;border-width:0;border-style:solid;";
|
||||
var e = _doc2.createElement("div"), useFixedPosition = _isViewport3(container) || _getProxyProp(container, "pinType") === "fixed", isScroller = type.indexOf("scroller") !== -1, parent = useFixedPosition ? _body2 : container.tagName === "IFRAME" ? container.contentDocument.body : container, isStart = type.indexOf("start") !== -1, color = isStart ? startColor : endColor, css = "border-color:" + color + ";font-size:" + fontSize + ";color:" + color + ";font-weight:" + fontWeight + ";pointer-events:none;white-space:nowrap;font-family:sans-serif,Arial;z-index:1000;padding:4px 8px;border-width:0;border-style:solid;";
|
||||
css += "position:" + ((isScroller || containerAnimation) && useFixedPosition ? "fixed;" : "absolute;");
|
||||
(isScroller || containerAnimation || !useFixedPosition) && (css += (direction === _vertical ? _right : _bottom) + ":" + (offset + parseFloat(indent)) + "px;");
|
||||
matchWidthEl && (css += "box-sizing:border-box;text-align:left;width:" + matchWidthEl.offsetWidth + "px;");
|
||||
@@ -1293,7 +1293,7 @@ var ScrollTrigger2 = (function() {
|
||||
data: _abs(endScroll - scroll),
|
||||
// record the distance so that if another snap tween occurs (conflict) we can prioritize the closest snap.
|
||||
onInterrupt: function onInterrupt() {
|
||||
return snapDelayedCall.restart(true) && _onInterrupt && _onInterrupt(self);
|
||||
return snapDelayedCall.restart(true) && _onInterrupt && _callback(self, _onInterrupt);
|
||||
},
|
||||
onComplete: function onComplete() {
|
||||
self.update();
|
||||
@@ -1303,10 +1303,10 @@ var ScrollTrigger2 = (function() {
|
||||
}
|
||||
snap1 = snap2 = animation && !isToggle ? animation.totalProgress() : self.progress;
|
||||
onSnapComplete && onSnapComplete(self);
|
||||
_onComplete && _onComplete(self);
|
||||
_onComplete && _callback(self, _onComplete);
|
||||
}
|
||||
}, scroll, change1 * change, endScroll - scroll - change1 * change);
|
||||
onStart && onStart(self, tweenTo.tween);
|
||||
onStart && _callback(self, onStart, tweenTo.tween);
|
||||
}
|
||||
} else if (self.isActive && lastSnap !== scroll) {
|
||||
snapDelayedCall.restart(true);
|
||||
@@ -2000,6 +2000,12 @@ var ScrollTrigger2 = (function() {
|
||||
_wheelListener(_removeListener3, _scrollers[i], _scrollers[i + 1]);
|
||||
_wheelListener(_removeListener3, _scrollers[i], _scrollers[i + 2]);
|
||||
}
|
||||
} else if (_doc2) {
|
||||
var onLoad = function onLoad2() {
|
||||
ScrollTrigger3.enable();
|
||||
_doc2.removeEventListener("DOMContentLoaded", onLoad2);
|
||||
};
|
||||
_doc2.addEventListener("DOMContentLoaded", onLoad);
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -2050,7 +2056,7 @@ var ScrollTrigger2 = (function() {
|
||||
};
|
||||
return ScrollTrigger3;
|
||||
})();
|
||||
ScrollTrigger2.version = "3.14.2";
|
||||
ScrollTrigger2.version = "3.15.0";
|
||||
ScrollTrigger2.saveStyles = function(targets) {
|
||||
return targets ? _toArray(targets).forEach(function(target) {
|
||||
if (target && target.style) {
|
||||
|
||||
+3
-3
File diff suppressed because one or more lines are too long
+156
-13985
File diff suppressed because it is too large
Load Diff
+4
-4
File diff suppressed because one or more lines are too long
+15
-1
@@ -54,6 +54,7 @@
|
||||
"deno": "1",
|
||||
"ios": "10",
|
||||
"samsung": "5",
|
||||
"rhino": "1.9",
|
||||
"opera_mobile": "41",
|
||||
"electron": "1.2"
|
||||
},
|
||||
@@ -219,6 +220,7 @@
|
||||
"deno": "1",
|
||||
"ios": "10",
|
||||
"samsung": "5",
|
||||
"rhino": "1.9",
|
||||
"opera_mobile": "41",
|
||||
"electron": "1.2"
|
||||
},
|
||||
@@ -280,6 +282,7 @@
|
||||
"deno": "1",
|
||||
"ios": "10",
|
||||
"samsung": "5",
|
||||
"rhino": "1.9",
|
||||
"opera_mobile": "41",
|
||||
"electron": "1.2"
|
||||
},
|
||||
@@ -1075,6 +1078,7 @@
|
||||
"deno": "1",
|
||||
"ios": "10",
|
||||
"samsung": "7",
|
||||
"rhino": "1.9",
|
||||
"opera_mobile": "43",
|
||||
"electron": "1.7"
|
||||
},
|
||||
@@ -1216,7 +1220,6 @@
|
||||
"deno": "1",
|
||||
"ios": "11.3",
|
||||
"samsung": "8",
|
||||
"rhino": "1.7.15",
|
||||
"opera_mobile": "46",
|
||||
"electron": "3.0"
|
||||
},
|
||||
@@ -1452,6 +1455,7 @@
|
||||
"deno": "1",
|
||||
"ios": "10",
|
||||
"samsung": "5",
|
||||
"rhino": "1.9",
|
||||
"opera_mobile": "37",
|
||||
"electron": "1.1"
|
||||
},
|
||||
@@ -1465,6 +1469,7 @@
|
||||
"deno": "1",
|
||||
"ios": "10",
|
||||
"samsung": "5",
|
||||
"rhino": "1.9",
|
||||
"opera_mobile": "37",
|
||||
"electron": "1.1"
|
||||
},
|
||||
@@ -1968,6 +1973,7 @@
|
||||
"deno": "1",
|
||||
"ios": "10",
|
||||
"samsung": "5",
|
||||
"rhino": "1.9",
|
||||
"opera_mobile": "41",
|
||||
"electron": "1.2"
|
||||
},
|
||||
@@ -1981,6 +1987,7 @@
|
||||
"deno": "1",
|
||||
"ios": "10",
|
||||
"samsung": "5",
|
||||
"rhino": "1.9",
|
||||
"opera_mobile": "41",
|
||||
"electron": "1.2"
|
||||
},
|
||||
@@ -1994,6 +2001,7 @@
|
||||
"deno": "1",
|
||||
"ios": "10",
|
||||
"samsung": "5",
|
||||
"rhino": "1.9",
|
||||
"opera_mobile": "41",
|
||||
"electron": "1.2"
|
||||
},
|
||||
@@ -2007,6 +2015,7 @@
|
||||
"deno": "1",
|
||||
"ios": "10",
|
||||
"samsung": "5",
|
||||
"rhino": "1.9",
|
||||
"opera_mobile": "41",
|
||||
"electron": "1.2"
|
||||
},
|
||||
@@ -2020,6 +2029,7 @@
|
||||
"deno": "1",
|
||||
"ios": "10",
|
||||
"samsung": "5",
|
||||
"rhino": "1.9",
|
||||
"opera_mobile": "41",
|
||||
"electron": "1.2"
|
||||
},
|
||||
@@ -2033,6 +2043,7 @@
|
||||
"deno": "1",
|
||||
"ios": "10",
|
||||
"samsung": "5",
|
||||
"rhino": "1.9",
|
||||
"opera_mobile": "41",
|
||||
"electron": "1.2"
|
||||
},
|
||||
@@ -2046,6 +2057,7 @@
|
||||
"deno": "1",
|
||||
"ios": "10",
|
||||
"samsung": "5",
|
||||
"rhino": "1.9",
|
||||
"opera_mobile": "41",
|
||||
"electron": "1.2"
|
||||
},
|
||||
@@ -2059,6 +2071,7 @@
|
||||
"deno": "1",
|
||||
"ios": "10",
|
||||
"samsung": "5",
|
||||
"rhino": "1.9",
|
||||
"opera_mobile": "41",
|
||||
"electron": "1.2"
|
||||
},
|
||||
@@ -2072,6 +2085,7 @@
|
||||
"deno": "1",
|
||||
"ios": "10",
|
||||
"samsung": "5",
|
||||
"rhino": "1.9",
|
||||
"opera_mobile": "41",
|
||||
"electron": "1.2"
|
||||
},
|
||||
|
||||
+3
@@ -13,6 +13,9 @@
|
||||
"bugfix/transform-safari-block-shadowing",
|
||||
"bugfix/transform-safari-for-shadowing"
|
||||
],
|
||||
"transform-destructuring": [
|
||||
"bugfix/transform-safari-rest-destructuring-rhs-array"
|
||||
],
|
||||
"transform-template-literals": [
|
||||
"bugfix/transform-tagged-template-caching"
|
||||
],
|
||||
|
||||
+28
@@ -35,6 +35,7 @@
|
||||
"deno": "1",
|
||||
"ios": "10",
|
||||
"samsung": "5",
|
||||
"rhino": "1.9",
|
||||
"opera_mobile": "41",
|
||||
"electron": "1.2"
|
||||
},
|
||||
@@ -80,6 +81,19 @@
|
||||
"opera_mobile": "36",
|
||||
"electron": "0.37"
|
||||
},
|
||||
"bugfix/transform-safari-rest-destructuring-rhs-array": {
|
||||
"chrome": "49",
|
||||
"opera": "36",
|
||||
"edge": "14",
|
||||
"firefox": "34",
|
||||
"safari": "14.1",
|
||||
"node": "6",
|
||||
"deno": "1",
|
||||
"ios": "14.5",
|
||||
"samsung": "5",
|
||||
"opera_mobile": "36",
|
||||
"electron": "0.37"
|
||||
},
|
||||
"bugfix/transform-tagged-template-caching": {
|
||||
"chrome": "41",
|
||||
"opera": "28",
|
||||
@@ -171,6 +185,7 @@
|
||||
"deno": "1",
|
||||
"ios": "9",
|
||||
"samsung": "3.4",
|
||||
"rhino": "1.9",
|
||||
"opera_mobile": "28",
|
||||
"electron": "0.21"
|
||||
},
|
||||
@@ -187,6 +202,19 @@
|
||||
"opera_mobile": "41",
|
||||
"electron": "1.2"
|
||||
},
|
||||
"transform-destructuring": {
|
||||
"chrome": "51",
|
||||
"opera": "38",
|
||||
"edge": "15",
|
||||
"firefox": "53",
|
||||
"safari": "10",
|
||||
"node": "6.5",
|
||||
"deno": "1",
|
||||
"ios": "10",
|
||||
"samsung": "5",
|
||||
"opera_mobile": "41",
|
||||
"electron": "1.2"
|
||||
},
|
||||
"transform-block-scoping": {
|
||||
"chrome": "50",
|
||||
"opera": "37",
|
||||
|
||||
+11
-6
@@ -1,10 +1,10 @@
|
||||
{
|
||||
"transform-explicit-resource-management": {
|
||||
"chrome": "134",
|
||||
"edge": "134",
|
||||
"chrome": "141",
|
||||
"edge": "141",
|
||||
"firefox": "141",
|
||||
"node": "24",
|
||||
"electron": "35.0"
|
||||
"node": "25",
|
||||
"electron": "39.0"
|
||||
},
|
||||
"transform-duplicate-named-capturing-groups-regex": {
|
||||
"chrome": "126",
|
||||
@@ -14,6 +14,7 @@
|
||||
"safari": "17.4",
|
||||
"node": "23",
|
||||
"ios": "17.4",
|
||||
"rhino": "1.9",
|
||||
"electron": "31.0"
|
||||
},
|
||||
"transform-regexp-modifiers": {
|
||||
@@ -432,6 +433,7 @@
|
||||
"deno": "1",
|
||||
"ios": "11.3",
|
||||
"samsung": "9",
|
||||
"rhino": "1.9",
|
||||
"opera_mobile": "47",
|
||||
"electron": "3.0"
|
||||
},
|
||||
@@ -445,6 +447,7 @@
|
||||
"deno": "1",
|
||||
"ios": "11.3",
|
||||
"samsung": "9",
|
||||
"rhino": "1.9",
|
||||
"opera_mobile": "47",
|
||||
"electron": "3.0"
|
||||
},
|
||||
@@ -458,6 +461,7 @@
|
||||
"deno": "1",
|
||||
"ios": "11.3",
|
||||
"samsung": "9",
|
||||
"rhino": "1.9",
|
||||
"opera_mobile": "47",
|
||||
"electron": "3.0"
|
||||
},
|
||||
@@ -498,6 +502,7 @@
|
||||
"deno": "1",
|
||||
"ios": "13",
|
||||
"samsung": "3.4",
|
||||
"rhino": "1.9",
|
||||
"opera_mobile": "28",
|
||||
"electron": "0.21"
|
||||
},
|
||||
@@ -695,10 +700,10 @@
|
||||
"opera": "38",
|
||||
"edge": "15",
|
||||
"firefox": "53",
|
||||
"safari": "10",
|
||||
"safari": "14.1",
|
||||
"node": "6.5",
|
||||
"deno": "1",
|
||||
"ios": "10",
|
||||
"ios": "14.5",
|
||||
"samsung": "5",
|
||||
"opera_mobile": "41",
|
||||
"electron": "1.2"
|
||||
|
||||
+3
-3
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/compat-data",
|
||||
"version": "7.28.6",
|
||||
"version": "7.29.7",
|
||||
"author": "The Babel Team (https://babel.dev/team)",
|
||||
"license": "MIT",
|
||||
"description": "The compat-data to determine required Babel plugins",
|
||||
@@ -30,8 +30,8 @@
|
||||
],
|
||||
"devDependencies": {
|
||||
"@mdn/browser-compat-data": "^6.0.8",
|
||||
"core-js-compat": "^3.43.0",
|
||||
"electron-to-chromium": "^1.5.140"
|
||||
"core-js-compat": "^3.48.0",
|
||||
"electron-to-chromium": "^1.5.278"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
|
||||
+3
-3
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/helper-annotate-as-pure",
|
||||
"version": "7.27.3",
|
||||
"version": "7.29.7",
|
||||
"description": "Helper function to annotate paths and nodes with #__PURE__ comment",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -14,10 +14,10 @@
|
||||
},
|
||||
"main": "./lib/index.js",
|
||||
"dependencies": {
|
||||
"@babel/types": "^7.27.3"
|
||||
"@babel/types": "^7.29.7"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/traverse": "^7.27.3"
|
||||
"@babel/traverse": "^7.29.7"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
|
||||
+4
-4
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/helper-compilation-targets",
|
||||
"version": "7.28.6",
|
||||
"version": "7.29.7",
|
||||
"author": "The Babel Team (https://babel.dev/team)",
|
||||
"license": "MIT",
|
||||
"description": "Helper functions on Babel compilation targets",
|
||||
@@ -25,14 +25,14 @@
|
||||
"babel-plugin"
|
||||
],
|
||||
"dependencies": {
|
||||
"@babel/compat-data": "^7.28.6",
|
||||
"@babel/helper-validator-option": "^7.27.1",
|
||||
"@babel/compat-data": "^7.29.7",
|
||||
"@babel/helper-validator-option": "^7.29.7",
|
||||
"browserslist": "^4.24.0",
|
||||
"lru-cache": "^5.1.1",
|
||||
"semver": "^6.3.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/helper-plugin-test-runner": "^7.27.1",
|
||||
"@babel/helper-plugin-test-runner": "^7.29.7",
|
||||
"@types/lru-cache": "^5.1.1",
|
||||
"@types/semver": "^5.5.0"
|
||||
},
|
||||
|
||||
+11
-9
@@ -877,6 +877,17 @@ function transformClass(path, state, constantSuper, ignoreFunctionLength, classN
|
||||
classLocals.push(classIdLocal, classInitLocal);
|
||||
const statics = [];
|
||||
path.get("body.body").forEach(element => {
|
||||
if (element.isStaticBlock() || !element.isClassMethod() && element.node.static) {
|
||||
const replaceSupers = new _helperReplaceSupers.default({
|
||||
constantSuper,
|
||||
methodPath: element,
|
||||
objectRef: classIdLocal,
|
||||
superRef: path.node.superClass,
|
||||
file: state.file,
|
||||
refToPreserve: classIdLocal
|
||||
});
|
||||
replaceSupers.replace();
|
||||
}
|
||||
if (element.isStaticBlock()) {
|
||||
if (hasInstancePrivateAccess(element, instancePrivateNames)) {
|
||||
const staticBlockClosureId = memoiseExpression(staticBlockToFunctionClosure(element.node), "staticBlock", staticClosures);
|
||||
@@ -904,15 +915,6 @@ function transformClass(path, state, constantSuper, ignoreFunctionLength, classN
|
||||
static: true
|
||||
})) {
|
||||
if (hasInstancePrivateAccess(element, instancePrivateNames)) {
|
||||
const replaceSupers = new _helperReplaceSupers.default({
|
||||
constantSuper,
|
||||
methodPath: element,
|
||||
objectRef: classIdLocal,
|
||||
superRef: path.node.superClass,
|
||||
file: state.file,
|
||||
refToPreserve: classIdLocal
|
||||
});
|
||||
replaceSupers.replace();
|
||||
const privateMethodDelegateId = memoiseExpression(createFunctionExpressionFromPrivateMethod(element.node), element.get("key.id").node.name, staticClosures);
|
||||
if (ignoreFunctionLength) {
|
||||
element.node.params = [_core.types.restElement(_core.types.identifier("arg"))];
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
+5
-5
@@ -95,18 +95,18 @@ function createClassFeaturePlugin({
|
||||
pre(file) {
|
||||
(0, _features.enableFeature)(file, feature, loose);
|
||||
if (typeof file.get(versionKey) === "number") {
|
||||
file.set(versionKey, "7.28.6");
|
||||
file.set(versionKey, "7.29.7");
|
||||
return;
|
||||
}
|
||||
if (!file.get(versionKey) || _semver.lt(file.get(versionKey), "7.28.6")) {
|
||||
file.set(versionKey, "7.28.6");
|
||||
if (!file.get(versionKey) || _semver.lt(file.get(versionKey), "7.29.7")) {
|
||||
file.set(versionKey, "7.29.7");
|
||||
}
|
||||
},
|
||||
visitor: {
|
||||
Class(path, {
|
||||
file
|
||||
}) {
|
||||
if (file.get(versionKey) !== "7.28.6") return;
|
||||
if (file.get(versionKey) !== "7.29.7") return;
|
||||
if (!(0, _features.shouldTransform)(path, file)) return;
|
||||
const pathIsClassDeclaration = path.isClassDeclaration();
|
||||
if (pathIsClassDeclaration) (0, _typescript.assertFieldTransformed)(path);
|
||||
@@ -218,7 +218,7 @@ function createClassFeaturePlugin({
|
||||
ExportDefaultDeclaration(path, {
|
||||
file
|
||||
}) {
|
||||
if (file.get(versionKey) !== "7.28.6") return;
|
||||
if (file.get(versionKey) !== "7.29.7") return;
|
||||
const decl = path.get("declaration");
|
||||
if (decl.isClassDeclaration() && (0, _decorators.hasDecorators)(decl.node)) {
|
||||
if (decl.node.id) {
|
||||
|
||||
+10
-10
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/helper-create-class-features-plugin",
|
||||
"version": "7.28.6",
|
||||
"version": "7.29.7",
|
||||
"author": "The Babel Team (https://babel.dev/team)",
|
||||
"license": "MIT",
|
||||
"description": "Compile class public and private fields, private methods and decorators to ES6",
|
||||
@@ -18,21 +18,21 @@
|
||||
"babel-plugin"
|
||||
],
|
||||
"dependencies": {
|
||||
"@babel/helper-annotate-as-pure": "^7.27.3",
|
||||
"@babel/helper-member-expression-to-functions": "^7.28.5",
|
||||
"@babel/helper-optimise-call-expression": "^7.27.1",
|
||||
"@babel/helper-replace-supers": "^7.28.6",
|
||||
"@babel/helper-skip-transparent-expression-wrappers": "^7.27.1",
|
||||
"@babel/traverse": "^7.28.6",
|
||||
"@babel/helper-annotate-as-pure": "^7.29.7",
|
||||
"@babel/helper-member-expression-to-functions": "^7.29.7",
|
||||
"@babel/helper-optimise-call-expression": "^7.29.7",
|
||||
"@babel/helper-replace-supers": "^7.29.7",
|
||||
"@babel/helper-skip-transparent-expression-wrappers": "^7.29.7",
|
||||
"@babel/traverse": "^7.29.7",
|
||||
"semver": "^6.3.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@babel/core": "^7.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.28.6",
|
||||
"@babel/helper-plugin-test-runner": "^7.27.1",
|
||||
"@babel/preset-env": "^7.28.6",
|
||||
"@babel/core": "^7.29.7",
|
||||
"@babel/helper-plugin-test-runner": "^7.29.7",
|
||||
"@babel/preset-env": "^7.29.7",
|
||||
"@types/charcodes": "^0.2.0",
|
||||
"charcodes": "^0.2.0"
|
||||
},
|
||||
|
||||
+5
-7
@@ -47,14 +47,12 @@ function createRegExpFeaturePlugin({
|
||||
file.set(_features.runtimeKey, runtime);
|
||||
}
|
||||
}
|
||||
{
|
||||
if (typeof file.get(versionKey) === "number") {
|
||||
file.set(versionKey, "7.28.5");
|
||||
return;
|
||||
}
|
||||
if (typeof file.get(versionKey) === "number") {
|
||||
file.set(versionKey, "7.29.7");
|
||||
return;
|
||||
}
|
||||
if (!file.get(versionKey) || _semver.lt(file.get(versionKey), "7.28.5")) {
|
||||
file.set(versionKey, "7.28.5");
|
||||
if (!file.get(versionKey) || _semver.lt(file.get(versionKey), "7.29.7")) {
|
||||
file.set(versionKey, "7.29.7");
|
||||
}
|
||||
},
|
||||
visitor: {
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
+4
-4
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/helper-create-regexp-features-plugin",
|
||||
"version": "7.28.5",
|
||||
"version": "7.29.7",
|
||||
"author": "The Babel Team (https://babel.dev/team)",
|
||||
"license": "MIT",
|
||||
"description": "Compile ESNext Regular Expressions to ES5",
|
||||
@@ -18,7 +18,7 @@
|
||||
"babel-plugin"
|
||||
],
|
||||
"dependencies": {
|
||||
"@babel/helper-annotate-as-pure": "^7.27.3",
|
||||
"@babel/helper-annotate-as-pure": "^7.29.7",
|
||||
"regexpu-core": "^6.3.1",
|
||||
"semver": "^6.3.1"
|
||||
},
|
||||
@@ -26,8 +26,8 @@
|
||||
"@babel/core": "^7.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.28.5",
|
||||
"@babel/helper-plugin-test-runner": "^7.27.1"
|
||||
"@babel/core": "^7.29.7",
|
||||
"@babel/helper-plugin-test-runner": "^7.29.7"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
|
||||
+235
-19
@@ -6,6 +6,7 @@ const {
|
||||
types: t$1,
|
||||
template: template
|
||||
} = _babel.default || _babel;
|
||||
const PossibleGlobalObjects = new Set(["global", "globalThis", "self", "window"]);
|
||||
function intersection(a, b) {
|
||||
const result = new Set();
|
||||
a.forEach(v => b.has(v) && result.add(v));
|
||||
@@ -14,18 +15,18 @@ function intersection(a, b) {
|
||||
function has$1(object, key) {
|
||||
return Object.prototype.hasOwnProperty.call(object, key);
|
||||
}
|
||||
function resolve$1(path, resolved = new Set()) {
|
||||
if (resolved.has(path)) return;
|
||||
resolved.add(path);
|
||||
function resolve$1(path, seen = new Set()) {
|
||||
if (seen.has(path)) return;
|
||||
seen.add(path);
|
||||
if (path.isVariableDeclarator()) {
|
||||
if (path.get("id").isIdentifier()) {
|
||||
return resolve$1(path.get("init"), resolved);
|
||||
return resolve$1(path.get("init"), seen);
|
||||
}
|
||||
} else if (path.isReferencedIdentifier()) {
|
||||
const binding = path.scope.getBinding(path.node.name);
|
||||
if (!binding) return path;
|
||||
if (!binding.constant) return;
|
||||
return resolve$1(binding.path, resolved);
|
||||
return resolve$1(binding.path, seen);
|
||||
}
|
||||
return path;
|
||||
}
|
||||
@@ -33,6 +34,17 @@ function resolveId(path) {
|
||||
if (path.isIdentifier() && !path.scope.hasBinding(path.node.name, /* noGlobals */true)) {
|
||||
return path.node.name;
|
||||
}
|
||||
|
||||
// globalThis.Object / window.Array / self.Map / global.Set -> resolve to
|
||||
// the property name, because accessing a built-in through a global object
|
||||
// reference is equivalent to accessing it directly.
|
||||
if (path.isMemberExpression() && !path.node.computed) {
|
||||
const object = path.get("object");
|
||||
const property = path.get("property");
|
||||
if (object.isIdentifier() && !object.scope.hasBinding(object.node.name, /* noGlobals */true) && PossibleGlobalObjects.has(object.node.name) && property.isIdentifier()) {
|
||||
return property.node.name;
|
||||
}
|
||||
}
|
||||
const resolved = resolve$1(path);
|
||||
if (resolved != null && resolved.isIdentifier()) {
|
||||
return resolved.node.name;
|
||||
@@ -60,7 +72,18 @@ function resolveKey(path, computed = false) {
|
||||
if (typeof value === "string") return value;
|
||||
}
|
||||
}
|
||||
function resolveSource(obj) {
|
||||
function resolveInstance(obj, seen) {
|
||||
const source = resolveSource(obj, seen);
|
||||
return source.placement === "prototype" ? source.id : null;
|
||||
}
|
||||
function resolveSource(obj, seen) {
|
||||
if (seen.has(obj)) {
|
||||
return {
|
||||
id: null,
|
||||
placement: null
|
||||
};
|
||||
}
|
||||
seen.add(obj);
|
||||
if (obj.isMemberExpression() && obj.get("property").isIdentifier({
|
||||
name: "prototype"
|
||||
})) {
|
||||
@@ -85,22 +108,23 @@ function resolveSource(obj) {
|
||||
}
|
||||
const path = resolve$1(obj);
|
||||
switch (path == null ? void 0 : path.type) {
|
||||
case "NullLiteral":
|
||||
return {
|
||||
id: null,
|
||||
placement: null
|
||||
};
|
||||
case "RegExpLiteral":
|
||||
return {
|
||||
id: "RegExp",
|
||||
placement: "prototype"
|
||||
};
|
||||
case "FunctionExpression":
|
||||
return {
|
||||
id: "Function",
|
||||
placement: "prototype"
|
||||
};
|
||||
case "StringLiteral":
|
||||
case "TemplateLiteral":
|
||||
return {
|
||||
id: "String",
|
||||
placement: "prototype"
|
||||
};
|
||||
case "NumberLiteral":
|
||||
case "NumericLiteral":
|
||||
return {
|
||||
id: "Number",
|
||||
placement: "prototype"
|
||||
@@ -110,6 +134,11 @@ function resolveSource(obj) {
|
||||
id: "Boolean",
|
||||
placement: "prototype"
|
||||
};
|
||||
case "BigIntLiteral":
|
||||
return {
|
||||
id: "BigInt",
|
||||
placement: "prototype"
|
||||
};
|
||||
case "ObjectExpression":
|
||||
return {
|
||||
id: "Object",
|
||||
@@ -120,6 +149,192 @@ function resolveSource(obj) {
|
||||
id: "Array",
|
||||
placement: "prototype"
|
||||
};
|
||||
case "FunctionExpression":
|
||||
case "ArrowFunctionExpression":
|
||||
case "ClassExpression":
|
||||
return {
|
||||
id: "Function",
|
||||
placement: "prototype"
|
||||
};
|
||||
// new Constructor() -> resolve the constructor name
|
||||
case "NewExpression":
|
||||
{
|
||||
const calleeId = resolveId(path.get("callee"));
|
||||
if (calleeId) return {
|
||||
id: calleeId,
|
||||
placement: "prototype"
|
||||
};
|
||||
return {
|
||||
id: null,
|
||||
placement: null
|
||||
};
|
||||
}
|
||||
// Unary expressions -> result type depends on operator
|
||||
case "UnaryExpression":
|
||||
{
|
||||
const {
|
||||
operator
|
||||
} = path.node;
|
||||
if (operator === "typeof") return {
|
||||
id: "String",
|
||||
placement: "prototype"
|
||||
};
|
||||
if (operator === "!" || operator === "delete") return {
|
||||
id: "Boolean",
|
||||
placement: "prototype"
|
||||
};
|
||||
// Unary + always produces Number (throws on BigInt)
|
||||
if (operator === "+") return {
|
||||
id: "Number",
|
||||
placement: "prototype"
|
||||
};
|
||||
// Unary - and ~ can produce Number or BigInt depending on operand
|
||||
if (operator === "-" || operator === "~") {
|
||||
const arg = resolveInstance(path.get("argument"), seen);
|
||||
if (arg === "BigInt") return {
|
||||
id: "BigInt",
|
||||
placement: "prototype"
|
||||
};
|
||||
if (arg !== null) return {
|
||||
id: "Number",
|
||||
placement: "prototype"
|
||||
};
|
||||
return {
|
||||
id: null,
|
||||
placement: null
|
||||
};
|
||||
}
|
||||
return {
|
||||
id: null,
|
||||
placement: null
|
||||
};
|
||||
}
|
||||
// ++i, i++ produce Number or BigInt depending on the argument
|
||||
case "UpdateExpression":
|
||||
{
|
||||
const arg = resolveInstance(path.get("argument"), seen);
|
||||
if (arg === "BigInt") return {
|
||||
id: "BigInt",
|
||||
placement: "prototype"
|
||||
};
|
||||
if (arg !== null) return {
|
||||
id: "Number",
|
||||
placement: "prototype"
|
||||
};
|
||||
return {
|
||||
id: null,
|
||||
placement: null
|
||||
};
|
||||
}
|
||||
// Binary expressions -> result type depends on operator
|
||||
case "BinaryExpression":
|
||||
{
|
||||
const {
|
||||
operator
|
||||
} = path.node;
|
||||
if (operator === "==" || operator === "!=" || operator === "===" || operator === "!==" || operator === "<" || operator === ">" || operator === "<=" || operator === ">=" || operator === "instanceof" || operator === "in") {
|
||||
return {
|
||||
id: "Boolean",
|
||||
placement: "prototype"
|
||||
};
|
||||
}
|
||||
// >>> always produces Number
|
||||
if (operator === ">>>") {
|
||||
return {
|
||||
id: "Number",
|
||||
placement: "prototype"
|
||||
};
|
||||
}
|
||||
// Arithmetic and bitwise operators can produce Number or BigInt
|
||||
if (operator === "-" || operator === "*" || operator === "/" || operator === "%" || operator === "**" || operator === "&" || operator === "|" || operator === "^" || operator === "<<" || operator === ">>") {
|
||||
const left = resolveInstance(path.get("left"), seen);
|
||||
const right = resolveInstance(path.get("right"), seen);
|
||||
if (left === "BigInt" && right === "BigInt") {
|
||||
return {
|
||||
id: "BigInt",
|
||||
placement: "prototype"
|
||||
};
|
||||
}
|
||||
if (left !== null && right !== null) {
|
||||
return {
|
||||
id: "Number",
|
||||
placement: "prototype"
|
||||
};
|
||||
}
|
||||
return {
|
||||
id: null,
|
||||
placement: null
|
||||
};
|
||||
}
|
||||
// + depends on operand types: string wins, otherwise number or bigint
|
||||
if (operator === "+") {
|
||||
const left = resolveInstance(path.get("left"), seen);
|
||||
const right = resolveInstance(path.get("right"), seen);
|
||||
if (left === "String" || right === "String") {
|
||||
return {
|
||||
id: "String",
|
||||
placement: "prototype"
|
||||
};
|
||||
}
|
||||
if (left === "Number" && right === "Number") {
|
||||
return {
|
||||
id: "Number",
|
||||
placement: "prototype"
|
||||
};
|
||||
}
|
||||
if (left === "BigInt" && right === "BigInt") {
|
||||
return {
|
||||
id: "BigInt",
|
||||
placement: "prototype"
|
||||
};
|
||||
}
|
||||
}
|
||||
return {
|
||||
id: null,
|
||||
placement: null
|
||||
};
|
||||
}
|
||||
// (a, b, c) -> the result is the last expression
|
||||
case "SequenceExpression":
|
||||
{
|
||||
const expressions = path.get("expressions");
|
||||
return resolveSource(expressions[expressions.length - 1], seen);
|
||||
}
|
||||
// a = b -> the result is the right side
|
||||
case "AssignmentExpression":
|
||||
{
|
||||
if (path.node.operator === "=") {
|
||||
return resolveSource(path.get("right"), seen);
|
||||
}
|
||||
return {
|
||||
id: null,
|
||||
placement: null
|
||||
};
|
||||
}
|
||||
// a ? b : c -> if both branches resolve to the same type, use it
|
||||
case "ConditionalExpression":
|
||||
{
|
||||
const consequent = resolveSource(path.get("consequent"), seen);
|
||||
const alternate = resolveSource(path.get("alternate"), seen);
|
||||
if (consequent.id && consequent.id === alternate.id) {
|
||||
return consequent;
|
||||
}
|
||||
return {
|
||||
id: null,
|
||||
placement: null
|
||||
};
|
||||
}
|
||||
// (expr) -> unwrap parenthesized expressions
|
||||
case "ParenthesizedExpression":
|
||||
return resolveSource(path.get("expression"), seen);
|
||||
// TypeScript / Flow type wrappers -> unwrap to the inner expression
|
||||
case "TSAsExpression":
|
||||
case "TSSatisfiesExpression":
|
||||
case "TSNonNullExpression":
|
||||
case "TSInstantiationExpression":
|
||||
case "TSTypeAssertion":
|
||||
case "TypeCastExpression":
|
||||
return resolveSource(path.get("expression"), seen);
|
||||
}
|
||||
return {
|
||||
id: null,
|
||||
@@ -419,10 +634,12 @@ var usage = callProvider => {
|
||||
objectIsGlobalIdentifier = false;
|
||||
}
|
||||
}
|
||||
const source = resolveSource(object);
|
||||
let skipObject = property(source.id, key, source.placement, path);
|
||||
skipObject || (skipObject = !objectIsGlobalIdentifier || path.shouldSkip || object.shouldSkip || isRemoved(object));
|
||||
if (!skipObject) handleReferencedIdentifier(object);
|
||||
const source = resolveSource(object, new Set());
|
||||
const skipObject = property(source.id, key, source.placement, path);
|
||||
const canHandleObject = objectIsGlobalIdentifier && !path.shouldSkip && !object.shouldSkip && !isRemoved(object);
|
||||
if (canHandleObject && (!skipObject || PossibleGlobalObjects.has(source.id))) {
|
||||
handleReferencedIdentifier(object);
|
||||
}
|
||||
},
|
||||
ObjectPattern(path) {
|
||||
const {
|
||||
@@ -452,7 +669,7 @@ var usage = callProvider => {
|
||||
if (obj) ({
|
||||
id,
|
||||
placement
|
||||
} = resolveSource(obj));
|
||||
} = resolveSource(obj, new Set()));
|
||||
for (const prop of path.get("properties")) {
|
||||
if (prop.isObjectProperty()) {
|
||||
const key = resolveKey(prop.get("key"));
|
||||
@@ -462,7 +679,7 @@ var usage = callProvider => {
|
||||
},
|
||||
BinaryExpression(path) {
|
||||
if (path.node.operator !== "in") return;
|
||||
const source = resolveSource(path.get("right"));
|
||||
const source = resolveSource(path.get("right"), new Set());
|
||||
const key = resolveKey(path.get("left"), true);
|
||||
if (!key) return;
|
||||
callProvider({
|
||||
@@ -512,7 +729,6 @@ function logMissing(missingDeps) {}
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
function laterLogMissing(missingDeps) {}
|
||||
|
||||
const PossibleGlobalObjects = new Set(["global", "globalThis", "self", "window"]);
|
||||
function createMetaResolver(polyfills) {
|
||||
const {
|
||||
static: staticP,
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
+235
-19
@@ -10,6 +10,7 @@ const {
|
||||
types: t$1,
|
||||
template: template
|
||||
} = _babel.default || _babel;
|
||||
const PossibleGlobalObjects = new Set(["global", "globalThis", "self", "window"]);
|
||||
function intersection(a, b) {
|
||||
const result = new Set();
|
||||
a.forEach(v => b.has(v) && result.add(v));
|
||||
@@ -18,18 +19,18 @@ function intersection(a, b) {
|
||||
function has$1(object, key) {
|
||||
return Object.prototype.hasOwnProperty.call(object, key);
|
||||
}
|
||||
function resolve$1(path, resolved = new Set()) {
|
||||
if (resolved.has(path)) return;
|
||||
resolved.add(path);
|
||||
function resolve$1(path, seen = new Set()) {
|
||||
if (seen.has(path)) return;
|
||||
seen.add(path);
|
||||
if (path.isVariableDeclarator()) {
|
||||
if (path.get("id").isIdentifier()) {
|
||||
return resolve$1(path.get("init"), resolved);
|
||||
return resolve$1(path.get("init"), seen);
|
||||
}
|
||||
} else if (path.isReferencedIdentifier()) {
|
||||
const binding = path.scope.getBinding(path.node.name);
|
||||
if (!binding) return path;
|
||||
if (!binding.constant) return;
|
||||
return resolve$1(binding.path, resolved);
|
||||
return resolve$1(binding.path, seen);
|
||||
}
|
||||
return path;
|
||||
}
|
||||
@@ -37,6 +38,17 @@ function resolveId(path) {
|
||||
if (path.isIdentifier() && !path.scope.hasBinding(path.node.name, /* noGlobals */true)) {
|
||||
return path.node.name;
|
||||
}
|
||||
|
||||
// globalThis.Object / window.Array / self.Map / global.Set -> resolve to
|
||||
// the property name, because accessing a built-in through a global object
|
||||
// reference is equivalent to accessing it directly.
|
||||
if (path.isMemberExpression() && !path.node.computed) {
|
||||
const object = path.get("object");
|
||||
const property = path.get("property");
|
||||
if (object.isIdentifier() && !object.scope.hasBinding(object.node.name, /* noGlobals */true) && PossibleGlobalObjects.has(object.node.name) && property.isIdentifier()) {
|
||||
return property.node.name;
|
||||
}
|
||||
}
|
||||
const resolved = resolve$1(path);
|
||||
if (resolved != null && resolved.isIdentifier()) {
|
||||
return resolved.node.name;
|
||||
@@ -64,7 +76,18 @@ function resolveKey(path, computed = false) {
|
||||
if (typeof value === "string") return value;
|
||||
}
|
||||
}
|
||||
function resolveSource(obj) {
|
||||
function resolveInstance(obj, seen) {
|
||||
const source = resolveSource(obj, seen);
|
||||
return source.placement === "prototype" ? source.id : null;
|
||||
}
|
||||
function resolveSource(obj, seen) {
|
||||
if (seen.has(obj)) {
|
||||
return {
|
||||
id: null,
|
||||
placement: null
|
||||
};
|
||||
}
|
||||
seen.add(obj);
|
||||
if (obj.isMemberExpression() && obj.get("property").isIdentifier({
|
||||
name: "prototype"
|
||||
})) {
|
||||
@@ -89,22 +112,23 @@ function resolveSource(obj) {
|
||||
}
|
||||
const path = resolve$1(obj);
|
||||
switch (path == null ? void 0 : path.type) {
|
||||
case "NullLiteral":
|
||||
return {
|
||||
id: null,
|
||||
placement: null
|
||||
};
|
||||
case "RegExpLiteral":
|
||||
return {
|
||||
id: "RegExp",
|
||||
placement: "prototype"
|
||||
};
|
||||
case "FunctionExpression":
|
||||
return {
|
||||
id: "Function",
|
||||
placement: "prototype"
|
||||
};
|
||||
case "StringLiteral":
|
||||
case "TemplateLiteral":
|
||||
return {
|
||||
id: "String",
|
||||
placement: "prototype"
|
||||
};
|
||||
case "NumberLiteral":
|
||||
case "NumericLiteral":
|
||||
return {
|
||||
id: "Number",
|
||||
placement: "prototype"
|
||||
@@ -114,6 +138,11 @@ function resolveSource(obj) {
|
||||
id: "Boolean",
|
||||
placement: "prototype"
|
||||
};
|
||||
case "BigIntLiteral":
|
||||
return {
|
||||
id: "BigInt",
|
||||
placement: "prototype"
|
||||
};
|
||||
case "ObjectExpression":
|
||||
return {
|
||||
id: "Object",
|
||||
@@ -124,6 +153,192 @@ function resolveSource(obj) {
|
||||
id: "Array",
|
||||
placement: "prototype"
|
||||
};
|
||||
case "FunctionExpression":
|
||||
case "ArrowFunctionExpression":
|
||||
case "ClassExpression":
|
||||
return {
|
||||
id: "Function",
|
||||
placement: "prototype"
|
||||
};
|
||||
// new Constructor() -> resolve the constructor name
|
||||
case "NewExpression":
|
||||
{
|
||||
const calleeId = resolveId(path.get("callee"));
|
||||
if (calleeId) return {
|
||||
id: calleeId,
|
||||
placement: "prototype"
|
||||
};
|
||||
return {
|
||||
id: null,
|
||||
placement: null
|
||||
};
|
||||
}
|
||||
// Unary expressions -> result type depends on operator
|
||||
case "UnaryExpression":
|
||||
{
|
||||
const {
|
||||
operator
|
||||
} = path.node;
|
||||
if (operator === "typeof") return {
|
||||
id: "String",
|
||||
placement: "prototype"
|
||||
};
|
||||
if (operator === "!" || operator === "delete") return {
|
||||
id: "Boolean",
|
||||
placement: "prototype"
|
||||
};
|
||||
// Unary + always produces Number (throws on BigInt)
|
||||
if (operator === "+") return {
|
||||
id: "Number",
|
||||
placement: "prototype"
|
||||
};
|
||||
// Unary - and ~ can produce Number or BigInt depending on operand
|
||||
if (operator === "-" || operator === "~") {
|
||||
const arg = resolveInstance(path.get("argument"), seen);
|
||||
if (arg === "BigInt") return {
|
||||
id: "BigInt",
|
||||
placement: "prototype"
|
||||
};
|
||||
if (arg !== null) return {
|
||||
id: "Number",
|
||||
placement: "prototype"
|
||||
};
|
||||
return {
|
||||
id: null,
|
||||
placement: null
|
||||
};
|
||||
}
|
||||
return {
|
||||
id: null,
|
||||
placement: null
|
||||
};
|
||||
}
|
||||
// ++i, i++ produce Number or BigInt depending on the argument
|
||||
case "UpdateExpression":
|
||||
{
|
||||
const arg = resolveInstance(path.get("argument"), seen);
|
||||
if (arg === "BigInt") return {
|
||||
id: "BigInt",
|
||||
placement: "prototype"
|
||||
};
|
||||
if (arg !== null) return {
|
||||
id: "Number",
|
||||
placement: "prototype"
|
||||
};
|
||||
return {
|
||||
id: null,
|
||||
placement: null
|
||||
};
|
||||
}
|
||||
// Binary expressions -> result type depends on operator
|
||||
case "BinaryExpression":
|
||||
{
|
||||
const {
|
||||
operator
|
||||
} = path.node;
|
||||
if (operator === "==" || operator === "!=" || operator === "===" || operator === "!==" || operator === "<" || operator === ">" || operator === "<=" || operator === ">=" || operator === "instanceof" || operator === "in") {
|
||||
return {
|
||||
id: "Boolean",
|
||||
placement: "prototype"
|
||||
};
|
||||
}
|
||||
// >>> always produces Number
|
||||
if (operator === ">>>") {
|
||||
return {
|
||||
id: "Number",
|
||||
placement: "prototype"
|
||||
};
|
||||
}
|
||||
// Arithmetic and bitwise operators can produce Number or BigInt
|
||||
if (operator === "-" || operator === "*" || operator === "/" || operator === "%" || operator === "**" || operator === "&" || operator === "|" || operator === "^" || operator === "<<" || operator === ">>") {
|
||||
const left = resolveInstance(path.get("left"), seen);
|
||||
const right = resolveInstance(path.get("right"), seen);
|
||||
if (left === "BigInt" && right === "BigInt") {
|
||||
return {
|
||||
id: "BigInt",
|
||||
placement: "prototype"
|
||||
};
|
||||
}
|
||||
if (left !== null && right !== null) {
|
||||
return {
|
||||
id: "Number",
|
||||
placement: "prototype"
|
||||
};
|
||||
}
|
||||
return {
|
||||
id: null,
|
||||
placement: null
|
||||
};
|
||||
}
|
||||
// + depends on operand types: string wins, otherwise number or bigint
|
||||
if (operator === "+") {
|
||||
const left = resolveInstance(path.get("left"), seen);
|
||||
const right = resolveInstance(path.get("right"), seen);
|
||||
if (left === "String" || right === "String") {
|
||||
return {
|
||||
id: "String",
|
||||
placement: "prototype"
|
||||
};
|
||||
}
|
||||
if (left === "Number" && right === "Number") {
|
||||
return {
|
||||
id: "Number",
|
||||
placement: "prototype"
|
||||
};
|
||||
}
|
||||
if (left === "BigInt" && right === "BigInt") {
|
||||
return {
|
||||
id: "BigInt",
|
||||
placement: "prototype"
|
||||
};
|
||||
}
|
||||
}
|
||||
return {
|
||||
id: null,
|
||||
placement: null
|
||||
};
|
||||
}
|
||||
// (a, b, c) -> the result is the last expression
|
||||
case "SequenceExpression":
|
||||
{
|
||||
const expressions = path.get("expressions");
|
||||
return resolveSource(expressions[expressions.length - 1], seen);
|
||||
}
|
||||
// a = b -> the result is the right side
|
||||
case "AssignmentExpression":
|
||||
{
|
||||
if (path.node.operator === "=") {
|
||||
return resolveSource(path.get("right"), seen);
|
||||
}
|
||||
return {
|
||||
id: null,
|
||||
placement: null
|
||||
};
|
||||
}
|
||||
// a ? b : c -> if both branches resolve to the same type, use it
|
||||
case "ConditionalExpression":
|
||||
{
|
||||
const consequent = resolveSource(path.get("consequent"), seen);
|
||||
const alternate = resolveSource(path.get("alternate"), seen);
|
||||
if (consequent.id && consequent.id === alternate.id) {
|
||||
return consequent;
|
||||
}
|
||||
return {
|
||||
id: null,
|
||||
placement: null
|
||||
};
|
||||
}
|
||||
// (expr) -> unwrap parenthesized expressions
|
||||
case "ParenthesizedExpression":
|
||||
return resolveSource(path.get("expression"), seen);
|
||||
// TypeScript / Flow type wrappers -> unwrap to the inner expression
|
||||
case "TSAsExpression":
|
||||
case "TSSatisfiesExpression":
|
||||
case "TSNonNullExpression":
|
||||
case "TSInstantiationExpression":
|
||||
case "TSTypeAssertion":
|
||||
case "TypeCastExpression":
|
||||
return resolveSource(path.get("expression"), seen);
|
||||
}
|
||||
return {
|
||||
id: null,
|
||||
@@ -423,10 +638,12 @@ var usage = callProvider => {
|
||||
objectIsGlobalIdentifier = false;
|
||||
}
|
||||
}
|
||||
const source = resolveSource(object);
|
||||
let skipObject = property(source.id, key, source.placement, path);
|
||||
skipObject || (skipObject = !objectIsGlobalIdentifier || path.shouldSkip || object.shouldSkip || isRemoved(object));
|
||||
if (!skipObject) handleReferencedIdentifier(object);
|
||||
const source = resolveSource(object, new Set());
|
||||
const skipObject = property(source.id, key, source.placement, path);
|
||||
const canHandleObject = objectIsGlobalIdentifier && !path.shouldSkip && !object.shouldSkip && !isRemoved(object);
|
||||
if (canHandleObject && (!skipObject || PossibleGlobalObjects.has(source.id))) {
|
||||
handleReferencedIdentifier(object);
|
||||
}
|
||||
},
|
||||
ObjectPattern(path) {
|
||||
const {
|
||||
@@ -456,7 +673,7 @@ var usage = callProvider => {
|
||||
if (obj) ({
|
||||
id,
|
||||
placement
|
||||
} = resolveSource(obj));
|
||||
} = resolveSource(obj, new Set()));
|
||||
for (const prop of path.get("properties")) {
|
||||
if (prop.isObjectProperty()) {
|
||||
const key = resolveKey(prop.get("key"));
|
||||
@@ -466,7 +683,7 @@ var usage = callProvider => {
|
||||
},
|
||||
BinaryExpression(path) {
|
||||
if (path.node.operator !== "in") return;
|
||||
const source = resolveSource(path.get("right"));
|
||||
const source = resolveSource(path.get("right"), new Set());
|
||||
const key = resolveKey(path.get("left"), true);
|
||||
if (!key) return;
|
||||
callProvider({
|
||||
@@ -556,7 +773,6 @@ function laterLogMissing(missingDeps) {
|
||||
laterLogMissingDependencies();
|
||||
}
|
||||
|
||||
const PossibleGlobalObjects = new Set(["global", "globalThis", "self", "window"]);
|
||||
function createMetaResolver(polyfills) {
|
||||
const {
|
||||
static: staticP,
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
+1
-2
@@ -3,7 +3,6 @@
|
||||
exports.__esModule = true;
|
||||
exports.default = createMetaResolver;
|
||||
var _utils = require("./utils");
|
||||
const PossibleGlobalObjects = new Set(["global", "globalThis", "self", "window"]);
|
||||
function createMetaResolver(polyfills) {
|
||||
const {
|
||||
static: staticP,
|
||||
@@ -25,7 +24,7 @@ function createMetaResolver(polyfills) {
|
||||
key
|
||||
} = meta;
|
||||
if (object && placement === "static") {
|
||||
if (globalP && PossibleGlobalObjects.has(object) && (0, _utils.has)(globalP, key)) {
|
||||
if (globalP && _utils.PossibleGlobalObjects.has(object) && (0, _utils.has)(globalP, key)) {
|
||||
return {
|
||||
kind: "global",
|
||||
desc: globalP[key],
|
||||
|
||||
+228
-12
@@ -1,6 +1,7 @@
|
||||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.PossibleGlobalObjects = void 0;
|
||||
exports.createUtilsGetter = createUtilsGetter;
|
||||
exports.getImportSource = getImportSource;
|
||||
exports.getRequireSource = getRequireSource;
|
||||
@@ -14,6 +15,7 @@ const {
|
||||
types: t,
|
||||
template: template
|
||||
} = _babel.default || _babel;
|
||||
const PossibleGlobalObjects = exports.PossibleGlobalObjects = new Set(["global", "globalThis", "self", "window"]);
|
||||
function intersection(a, b) {
|
||||
const result = new Set();
|
||||
a.forEach(v => b.has(v) && result.add(v));
|
||||
@@ -22,18 +24,18 @@ function intersection(a, b) {
|
||||
function has(object, key) {
|
||||
return Object.prototype.hasOwnProperty.call(object, key);
|
||||
}
|
||||
function resolve(path, resolved = new Set()) {
|
||||
if (resolved.has(path)) return;
|
||||
resolved.add(path);
|
||||
function resolve(path, seen = new Set()) {
|
||||
if (seen.has(path)) return;
|
||||
seen.add(path);
|
||||
if (path.isVariableDeclarator()) {
|
||||
if (path.get("id").isIdentifier()) {
|
||||
return resolve(path.get("init"), resolved);
|
||||
return resolve(path.get("init"), seen);
|
||||
}
|
||||
} else if (path.isReferencedIdentifier()) {
|
||||
const binding = path.scope.getBinding(path.node.name);
|
||||
if (!binding) return path;
|
||||
if (!binding.constant) return;
|
||||
return resolve(binding.path, resolved);
|
||||
return resolve(binding.path, seen);
|
||||
}
|
||||
return path;
|
||||
}
|
||||
@@ -41,6 +43,17 @@ function resolveId(path) {
|
||||
if (path.isIdentifier() && !path.scope.hasBinding(path.node.name, /* noGlobals */true)) {
|
||||
return path.node.name;
|
||||
}
|
||||
|
||||
// globalThis.Object / window.Array / self.Map / global.Set -> resolve to
|
||||
// the property name, because accessing a built-in through a global object
|
||||
// reference is equivalent to accessing it directly.
|
||||
if (path.isMemberExpression() && !path.node.computed) {
|
||||
const object = path.get("object");
|
||||
const property = path.get("property");
|
||||
if (object.isIdentifier() && !object.scope.hasBinding(object.node.name, /* noGlobals */true) && PossibleGlobalObjects.has(object.node.name) && property.isIdentifier()) {
|
||||
return property.node.name;
|
||||
}
|
||||
}
|
||||
const resolved = resolve(path);
|
||||
if (resolved != null && resolved.isIdentifier()) {
|
||||
return resolved.node.name;
|
||||
@@ -68,7 +81,18 @@ function resolveKey(path, computed = false) {
|
||||
if (typeof value === "string") return value;
|
||||
}
|
||||
}
|
||||
function resolveSource(obj) {
|
||||
function resolveInstance(obj, seen) {
|
||||
const source = resolveSource(obj, seen);
|
||||
return source.placement === "prototype" ? source.id : null;
|
||||
}
|
||||
function resolveSource(obj, seen) {
|
||||
if (seen.has(obj)) {
|
||||
return {
|
||||
id: null,
|
||||
placement: null
|
||||
};
|
||||
}
|
||||
seen.add(obj);
|
||||
if (obj.isMemberExpression() && obj.get("property").isIdentifier({
|
||||
name: "prototype"
|
||||
})) {
|
||||
@@ -93,22 +117,23 @@ function resolveSource(obj) {
|
||||
}
|
||||
const path = resolve(obj);
|
||||
switch (path == null ? void 0 : path.type) {
|
||||
case "NullLiteral":
|
||||
return {
|
||||
id: null,
|
||||
placement: null
|
||||
};
|
||||
case "RegExpLiteral":
|
||||
return {
|
||||
id: "RegExp",
|
||||
placement: "prototype"
|
||||
};
|
||||
case "FunctionExpression":
|
||||
return {
|
||||
id: "Function",
|
||||
placement: "prototype"
|
||||
};
|
||||
case "StringLiteral":
|
||||
case "TemplateLiteral":
|
||||
return {
|
||||
id: "String",
|
||||
placement: "prototype"
|
||||
};
|
||||
case "NumberLiteral":
|
||||
case "NumericLiteral":
|
||||
return {
|
||||
id: "Number",
|
||||
placement: "prototype"
|
||||
@@ -118,6 +143,11 @@ function resolveSource(obj) {
|
||||
id: "Boolean",
|
||||
placement: "prototype"
|
||||
};
|
||||
case "BigIntLiteral":
|
||||
return {
|
||||
id: "BigInt",
|
||||
placement: "prototype"
|
||||
};
|
||||
case "ObjectExpression":
|
||||
return {
|
||||
id: "Object",
|
||||
@@ -128,6 +158,192 @@ function resolveSource(obj) {
|
||||
id: "Array",
|
||||
placement: "prototype"
|
||||
};
|
||||
case "FunctionExpression":
|
||||
case "ArrowFunctionExpression":
|
||||
case "ClassExpression":
|
||||
return {
|
||||
id: "Function",
|
||||
placement: "prototype"
|
||||
};
|
||||
// new Constructor() -> resolve the constructor name
|
||||
case "NewExpression":
|
||||
{
|
||||
const calleeId = resolveId(path.get("callee"));
|
||||
if (calleeId) return {
|
||||
id: calleeId,
|
||||
placement: "prototype"
|
||||
};
|
||||
return {
|
||||
id: null,
|
||||
placement: null
|
||||
};
|
||||
}
|
||||
// Unary expressions -> result type depends on operator
|
||||
case "UnaryExpression":
|
||||
{
|
||||
const {
|
||||
operator
|
||||
} = path.node;
|
||||
if (operator === "typeof") return {
|
||||
id: "String",
|
||||
placement: "prototype"
|
||||
};
|
||||
if (operator === "!" || operator === "delete") return {
|
||||
id: "Boolean",
|
||||
placement: "prototype"
|
||||
};
|
||||
// Unary + always produces Number (throws on BigInt)
|
||||
if (operator === "+") return {
|
||||
id: "Number",
|
||||
placement: "prototype"
|
||||
};
|
||||
// Unary - and ~ can produce Number or BigInt depending on operand
|
||||
if (operator === "-" || operator === "~") {
|
||||
const arg = resolveInstance(path.get("argument"), seen);
|
||||
if (arg === "BigInt") return {
|
||||
id: "BigInt",
|
||||
placement: "prototype"
|
||||
};
|
||||
if (arg !== null) return {
|
||||
id: "Number",
|
||||
placement: "prototype"
|
||||
};
|
||||
return {
|
||||
id: null,
|
||||
placement: null
|
||||
};
|
||||
}
|
||||
return {
|
||||
id: null,
|
||||
placement: null
|
||||
};
|
||||
}
|
||||
// ++i, i++ produce Number or BigInt depending on the argument
|
||||
case "UpdateExpression":
|
||||
{
|
||||
const arg = resolveInstance(path.get("argument"), seen);
|
||||
if (arg === "BigInt") return {
|
||||
id: "BigInt",
|
||||
placement: "prototype"
|
||||
};
|
||||
if (arg !== null) return {
|
||||
id: "Number",
|
||||
placement: "prototype"
|
||||
};
|
||||
return {
|
||||
id: null,
|
||||
placement: null
|
||||
};
|
||||
}
|
||||
// Binary expressions -> result type depends on operator
|
||||
case "BinaryExpression":
|
||||
{
|
||||
const {
|
||||
operator
|
||||
} = path.node;
|
||||
if (operator === "==" || operator === "!=" || operator === "===" || operator === "!==" || operator === "<" || operator === ">" || operator === "<=" || operator === ">=" || operator === "instanceof" || operator === "in") {
|
||||
return {
|
||||
id: "Boolean",
|
||||
placement: "prototype"
|
||||
};
|
||||
}
|
||||
// >>> always produces Number
|
||||
if (operator === ">>>") {
|
||||
return {
|
||||
id: "Number",
|
||||
placement: "prototype"
|
||||
};
|
||||
}
|
||||
// Arithmetic and bitwise operators can produce Number or BigInt
|
||||
if (operator === "-" || operator === "*" || operator === "/" || operator === "%" || operator === "**" || operator === "&" || operator === "|" || operator === "^" || operator === "<<" || operator === ">>") {
|
||||
const left = resolveInstance(path.get("left"), seen);
|
||||
const right = resolveInstance(path.get("right"), seen);
|
||||
if (left === "BigInt" && right === "BigInt") {
|
||||
return {
|
||||
id: "BigInt",
|
||||
placement: "prototype"
|
||||
};
|
||||
}
|
||||
if (left !== null && right !== null) {
|
||||
return {
|
||||
id: "Number",
|
||||
placement: "prototype"
|
||||
};
|
||||
}
|
||||
return {
|
||||
id: null,
|
||||
placement: null
|
||||
};
|
||||
}
|
||||
// + depends on operand types: string wins, otherwise number or bigint
|
||||
if (operator === "+") {
|
||||
const left = resolveInstance(path.get("left"), seen);
|
||||
const right = resolveInstance(path.get("right"), seen);
|
||||
if (left === "String" || right === "String") {
|
||||
return {
|
||||
id: "String",
|
||||
placement: "prototype"
|
||||
};
|
||||
}
|
||||
if (left === "Number" && right === "Number") {
|
||||
return {
|
||||
id: "Number",
|
||||
placement: "prototype"
|
||||
};
|
||||
}
|
||||
if (left === "BigInt" && right === "BigInt") {
|
||||
return {
|
||||
id: "BigInt",
|
||||
placement: "prototype"
|
||||
};
|
||||
}
|
||||
}
|
||||
return {
|
||||
id: null,
|
||||
placement: null
|
||||
};
|
||||
}
|
||||
// (a, b, c) -> the result is the last expression
|
||||
case "SequenceExpression":
|
||||
{
|
||||
const expressions = path.get("expressions");
|
||||
return resolveSource(expressions[expressions.length - 1], seen);
|
||||
}
|
||||
// a = b -> the result is the right side
|
||||
case "AssignmentExpression":
|
||||
{
|
||||
if (path.node.operator === "=") {
|
||||
return resolveSource(path.get("right"), seen);
|
||||
}
|
||||
return {
|
||||
id: null,
|
||||
placement: null
|
||||
};
|
||||
}
|
||||
// a ? b : c -> if both branches resolve to the same type, use it
|
||||
case "ConditionalExpression":
|
||||
{
|
||||
const consequent = resolveSource(path.get("consequent"), seen);
|
||||
const alternate = resolveSource(path.get("alternate"), seen);
|
||||
if (consequent.id && consequent.id === alternate.id) {
|
||||
return consequent;
|
||||
}
|
||||
return {
|
||||
id: null,
|
||||
placement: null
|
||||
};
|
||||
}
|
||||
// (expr) -> unwrap parenthesized expressions
|
||||
case "ParenthesizedExpression":
|
||||
return resolveSource(path.get("expression"), seen);
|
||||
// TypeScript / Flow type wrappers -> unwrap to the inner expression
|
||||
case "TSAsExpression":
|
||||
case "TSSatisfiesExpression":
|
||||
case "TSNonNullExpression":
|
||||
case "TSInstantiationExpression":
|
||||
case "TSTypeAssertion":
|
||||
case "TypeCastExpression":
|
||||
return resolveSource(path.get("expression"), seen);
|
||||
}
|
||||
return {
|
||||
id: null,
|
||||
|
||||
+8
-6
@@ -72,10 +72,12 @@ var _default = callProvider => {
|
||||
objectIsGlobalIdentifier = false;
|
||||
}
|
||||
}
|
||||
const source = (0, _utils.resolveSource)(object);
|
||||
let skipObject = property(source.id, key, source.placement, path);
|
||||
skipObject || (skipObject = !objectIsGlobalIdentifier || path.shouldSkip || object.shouldSkip || isRemoved(object));
|
||||
if (!skipObject) handleReferencedIdentifier(object);
|
||||
const source = (0, _utils.resolveSource)(object, new Set());
|
||||
const skipObject = property(source.id, key, source.placement, path);
|
||||
const canHandleObject = objectIsGlobalIdentifier && !path.shouldSkip && !object.shouldSkip && !isRemoved(object);
|
||||
if (canHandleObject && (!skipObject || _utils.PossibleGlobalObjects.has(source.id))) {
|
||||
handleReferencedIdentifier(object);
|
||||
}
|
||||
},
|
||||
ObjectPattern(path) {
|
||||
const {
|
||||
@@ -105,7 +107,7 @@ var _default = callProvider => {
|
||||
if (obj) ({
|
||||
id,
|
||||
placement
|
||||
} = (0, _utils.resolveSource)(obj));
|
||||
} = (0, _utils.resolveSource)(obj, new Set()));
|
||||
for (const prop of path.get("properties")) {
|
||||
if (prop.isObjectProperty()) {
|
||||
const key = (0, _utils.resolveKey)(prop.get("key"));
|
||||
@@ -115,7 +117,7 @@ var _default = callProvider => {
|
||||
},
|
||||
BinaryExpression(path) {
|
||||
if (path.node.operator !== "in") return;
|
||||
const source = (0, _utils.resolveSource)(path.get("right"));
|
||||
const source = (0, _utils.resolveSource)(path.get("right"), new Set());
|
||||
const key = (0, _utils.resolveKey)(path.get("left"), true);
|
||||
if (!key) return;
|
||||
callProvider({
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/helper-define-polyfill-provider",
|
||||
"version": "0.6.6",
|
||||
"version": "0.6.8",
|
||||
"description": "Babel helper to create your own polyfill provider",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -55,5 +55,5 @@
|
||||
"webpack": "^4.47.0",
|
||||
"webpack-cli": "^3.3.12"
|
||||
},
|
||||
"gitHead": "9b040e303af7d703a57f16d46538d1b0d5462237"
|
||||
"gitHead": "86eff78e98adc17cdf0eb9ba4d94140eb7cb0da0"
|
||||
}
|
||||
+3
-3
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/helper-member-expression-to-functions",
|
||||
"version": "7.28.5",
|
||||
"version": "7.29.7",
|
||||
"description": "Helper function to replace certain member expressions with function calls",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -15,8 +15,8 @@
|
||||
"main": "./lib/index.js",
|
||||
"author": "The Babel Team (https://babel.dev/team)",
|
||||
"dependencies": {
|
||||
"@babel/traverse": "^7.28.5",
|
||||
"@babel/types": "^7.28.5"
|
||||
"@babel/traverse": "^7.29.7",
|
||||
"@babel/types": "^7.29.7"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
|
||||
+4
-4
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/helper-optimise-call-expression",
|
||||
"version": "7.27.1",
|
||||
"version": "7.29.7",
|
||||
"description": "Helper function to optimise call expression",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -14,11 +14,11 @@
|
||||
},
|
||||
"main": "./lib/index.js",
|
||||
"dependencies": {
|
||||
"@babel/types": "^7.27.1"
|
||||
"@babel/types": "^7.29.7"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/generator": "^7.27.1",
|
||||
"@babel/parser": "^7.27.1"
|
||||
"@babel/generator": "^7.29.7",
|
||||
"@babel/parser": "^7.29.7"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
|
||||
+5
-5
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/helper-remap-async-to-generator",
|
||||
"version": "7.27.1",
|
||||
"version": "7.29.7",
|
||||
"description": "Helper function to remap async functions to generators",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -14,12 +14,12 @@
|
||||
},
|
||||
"main": "./lib/index.js",
|
||||
"dependencies": {
|
||||
"@babel/helper-annotate-as-pure": "^7.27.1",
|
||||
"@babel/helper-wrap-function": "^7.27.1",
|
||||
"@babel/traverse": "^7.27.1"
|
||||
"@babel/helper-annotate-as-pure": "^7.29.7",
|
||||
"@babel/helper-wrap-function": "^7.29.7",
|
||||
"@babel/traverse": "^7.29.7"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.27.1"
|
||||
"@babel/core": "^7.29.7"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@babel/core": "^7.0.0"
|
||||
|
||||
+5
-5
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/helper-replace-supers",
|
||||
"version": "7.28.6",
|
||||
"version": "7.29.7",
|
||||
"description": "Helper function to replace supers",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -14,12 +14,12 @@
|
||||
},
|
||||
"main": "./lib/index.js",
|
||||
"dependencies": {
|
||||
"@babel/helper-member-expression-to-functions": "^7.28.5",
|
||||
"@babel/helper-optimise-call-expression": "^7.27.1",
|
||||
"@babel/traverse": "^7.28.6"
|
||||
"@babel/helper-member-expression-to-functions": "^7.29.7",
|
||||
"@babel/helper-optimise-call-expression": "^7.29.7",
|
||||
"@babel/traverse": "^7.29.7"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.28.6"
|
||||
"@babel/core": "^7.29.7"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@babel/core": "^7.0.0"
|
||||
|
||||
+3
-3
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/helper-skip-transparent-expression-wrappers",
|
||||
"version": "7.27.1",
|
||||
"version": "7.29.7",
|
||||
"description": "Helper which skips types and parentheses",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -20,8 +20,8 @@
|
||||
"./package.json": "./package.json"
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/traverse": "^7.27.1",
|
||||
"@babel/types": "^7.27.1"
|
||||
"@babel/traverse": "^7.29.7",
|
||||
"@babel/types": "^7.29.7"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/helper-validator-option",
|
||||
"version": "7.27.1",
|
||||
"version": "7.29.7",
|
||||
"description": "Validate plugin/preset options",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
||||
+4
-4
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/helper-wrap-function",
|
||||
"version": "7.28.6",
|
||||
"version": "7.29.7",
|
||||
"description": "Helper to wrap functions inside a function call.",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -14,9 +14,9 @@
|
||||
},
|
||||
"main": "./lib/index.js",
|
||||
"dependencies": {
|
||||
"@babel/template": "^7.28.6",
|
||||
"@babel/traverse": "^7.28.6",
|
||||
"@babel/types": "^7.28.6"
|
||||
"@babel/template": "^7.29.7",
|
||||
"@babel/traverse": "^7.29.7",
|
||||
"@babel/types": "^7.29.7"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
|
||||
Generated
Vendored
+2
-6
@@ -36,9 +36,7 @@ var _default = exports.default = (0, _helperPluginUtils.declare)(({
|
||||
const state = {
|
||||
found: false
|
||||
};
|
||||
{
|
||||
path.traverse(containsClassExpressionVisitor, state);
|
||||
}
|
||||
path.traverse(containsClassExpressionVisitor, state);
|
||||
return state.found;
|
||||
}
|
||||
function wrap(path) {
|
||||
@@ -46,9 +44,7 @@ var _default = exports.default = (0, _helperPluginUtils.declare)(({
|
||||
yield: t.isYieldExpression(path.node),
|
||||
await: t.isAwaitExpression(path.node)
|
||||
};
|
||||
{
|
||||
path.traverse(containsYieldOrAwaitVisitor, context);
|
||||
}
|
||||
path.traverse(containsYieldOrAwaitVisitor, context);
|
||||
let replacement;
|
||||
if (context.yield) {
|
||||
const fn = t.functionExpression(null, [], t.blockStatement([t.returnStatement(path.node)]), true, context.await);
|
||||
|
||||
Generated
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Generated
Vendored
+5
-5
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/plugin-bugfix-firefox-class-in-computed-class-key",
|
||||
"version": "7.28.5",
|
||||
"version": "7.29.7",
|
||||
"description": "Wraps classes defined in computed keys of other classes affected by https://bugzilla.mozilla.org/show_bug.cgi?id=1887677",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -25,15 +25,15 @@
|
||||
"bugfix"
|
||||
],
|
||||
"dependencies": {
|
||||
"@babel/helper-plugin-utils": "^7.27.1",
|
||||
"@babel/traverse": "^7.28.5"
|
||||
"@babel/helper-plugin-utils": "^7.29.7",
|
||||
"@babel/traverse": "^7.29.7"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@babel/core": "^7.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.28.5",
|
||||
"@babel/helper-plugin-test-runner": "^7.27.1"
|
||||
"@babel/core": "^7.29.7",
|
||||
"@babel/helper-plugin-test-runner": "^7.29.7"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
|
||||
Generated
Vendored
+5
-5
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/plugin-bugfix-safari-class-field-initializer-scope",
|
||||
"version": "7.27.1",
|
||||
"version": "7.29.7",
|
||||
"description": "Wrap class field initializers with IIFE to workaround https://webkit.org/b/236843",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -25,15 +25,15 @@
|
||||
"bugfix"
|
||||
],
|
||||
"dependencies": {
|
||||
"@babel/helper-plugin-utils": "^7.27.1"
|
||||
"@babel/helper-plugin-utils": "^7.29.7"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@babel/core": "^7.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.27.1",
|
||||
"@babel/helper-plugin-test-runner": "^7.27.1",
|
||||
"@babel/traverse": "^7.27.1"
|
||||
"@babel/core": "^7.29.7",
|
||||
"@babel/helper-plugin-test-runner": "^7.29.7",
|
||||
"@babel/traverse": "^7.29.7"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
|
||||
Generated
Vendored
+5
-5
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression",
|
||||
"version": "7.27.1",
|
||||
"version": "7.29.7",
|
||||
"description": "Rename destructuring parameter to workaround https://bugs.webkit.org/show_bug.cgi?id=220517",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -25,15 +25,15 @@
|
||||
"bugfix"
|
||||
],
|
||||
"dependencies": {
|
||||
"@babel/helper-plugin-utils": "^7.27.1"
|
||||
"@babel/helper-plugin-utils": "^7.29.7"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@babel/core": "^7.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.27.1",
|
||||
"@babel/helper-plugin-test-runner": "^7.27.1",
|
||||
"@babel/traverse": "^7.27.1"
|
||||
"@babel/core": "^7.29.7",
|
||||
"@babel/helper-plugin-test-runner": "^7.29.7",
|
||||
"@babel/traverse": "^7.29.7"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
|
||||
Generated
Vendored
+7
-7
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining",
|
||||
"version": "7.27.1",
|
||||
"version": "7.29.7",
|
||||
"description": "Transform optional chaining operators to workaround https://crbug.com/v8/11558",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -25,17 +25,17 @@
|
||||
"bugfix"
|
||||
],
|
||||
"dependencies": {
|
||||
"@babel/helper-plugin-utils": "^7.27.1",
|
||||
"@babel/helper-skip-transparent-expression-wrappers": "^7.27.1",
|
||||
"@babel/plugin-transform-optional-chaining": "^7.27.1"
|
||||
"@babel/helper-plugin-utils": "^7.29.7",
|
||||
"@babel/helper-skip-transparent-expression-wrappers": "^7.29.7",
|
||||
"@babel/plugin-transform-optional-chaining": "^7.29.7"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@babel/core": "^7.13.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.27.1",
|
||||
"@babel/helper-plugin-test-runner": "^7.27.1",
|
||||
"@babel/traverse": "^7.27.1"
|
||||
"@babel/core": "^7.29.7",
|
||||
"@babel/helper-plugin-test-runner": "^7.29.7",
|
||||
"@babel/traverse": "^7.29.7"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
|
||||
Generated
Vendored
+6
-6
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly",
|
||||
"version": "7.28.6",
|
||||
"version": "7.29.7",
|
||||
"description": "Transform static class fields assignments that are affected by https://crbug.com/v8/12421",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -25,16 +25,16 @@
|
||||
"bugfix"
|
||||
],
|
||||
"dependencies": {
|
||||
"@babel/helper-plugin-utils": "^7.28.6",
|
||||
"@babel/traverse": "^7.28.6"
|
||||
"@babel/helper-plugin-utils": "^7.29.7",
|
||||
"@babel/traverse": "^7.29.7"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@babel/core": "^7.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.28.6",
|
||||
"@babel/helper-plugin-test-runner": "^7.27.1",
|
||||
"@babel/traverse": "^7.28.6"
|
||||
"@babel/core": "^7.29.7",
|
||||
"@babel/helper-plugin-test-runner": "^7.29.7",
|
||||
"@babel/traverse": "^7.29.7"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
|
||||
+8
-8
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/plugin-proposal-decorators",
|
||||
"version": "7.28.6",
|
||||
"version": "7.29.7",
|
||||
"author": "The Babel Team (https://babel.dev/team)",
|
||||
"license": "MIT",
|
||||
"publishConfig": {
|
||||
@@ -20,19 +20,19 @@
|
||||
"decorators"
|
||||
],
|
||||
"dependencies": {
|
||||
"@babel/helper-create-class-features-plugin": "^7.28.6",
|
||||
"@babel/helper-plugin-utils": "^7.28.6",
|
||||
"@babel/plugin-syntax-decorators": "^7.28.6"
|
||||
"@babel/helper-create-class-features-plugin": "^7.29.7",
|
||||
"@babel/helper-plugin-utils": "^7.29.7",
|
||||
"@babel/plugin-syntax-decorators": "^7.29.7"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@babel/core": "^7.0.0-0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.28.6",
|
||||
"@babel/helper-plugin-test-runner": "^7.27.1",
|
||||
"@babel/traverse": "^7.28.6",
|
||||
"@babel/core": "^7.29.7",
|
||||
"@babel/helper-plugin-test-runner": "^7.29.7",
|
||||
"@babel/traverse": "^7.29.7",
|
||||
"array.prototype.concat": "^1.0.2",
|
||||
"babel-plugin-polyfill-es-shims": "^0.10.8",
|
||||
"babel-plugin-polyfill-es-shims": "^0.10.9",
|
||||
"object.getownpropertydescriptors": "^2.1.1"
|
||||
},
|
||||
"engines": {
|
||||
|
||||
+3
-3
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/plugin-syntax-decorators",
|
||||
"version": "7.28.6",
|
||||
"version": "7.29.7",
|
||||
"description": "Allow parsing of decorators",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -17,13 +17,13 @@
|
||||
"babel-plugin"
|
||||
],
|
||||
"dependencies": {
|
||||
"@babel/helper-plugin-utils": "^7.28.6"
|
||||
"@babel/helper-plugin-utils": "^7.29.7"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@babel/core": "^7.0.0-0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.28.6"
|
||||
"@babel/core": "^7.29.7"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
|
||||
+3
-3
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/plugin-syntax-import-assertions",
|
||||
"version": "7.28.6",
|
||||
"version": "7.29.7",
|
||||
"description": "Allow parsing of the module assertion attributes in the import statement",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -16,13 +16,13 @@
|
||||
"babel-plugin"
|
||||
],
|
||||
"dependencies": {
|
||||
"@babel/helper-plugin-utils": "^7.28.6"
|
||||
"@babel/helper-plugin-utils": "^7.29.7"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@babel/core": "^7.0.0-0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.28.6"
|
||||
"@babel/core": "^7.29.7"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
|
||||
+4
-4
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/plugin-syntax-import-attributes",
|
||||
"version": "7.28.6",
|
||||
"version": "7.29.7",
|
||||
"description": "Allow parsing of the module attributes in the import statement",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -16,14 +16,14 @@
|
||||
"babel-plugin"
|
||||
],
|
||||
"dependencies": {
|
||||
"@babel/helper-plugin-utils": "^7.28.6"
|
||||
"@babel/helper-plugin-utils": "^7.29.7"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@babel/core": "^7.0.0-0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.28.6",
|
||||
"@babel/helper-plugin-test-runner": "^7.27.1"
|
||||
"@babel/core": "^7.29.7",
|
||||
"@babel/helper-plugin-test-runner": "^7.29.7"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
|
||||
+3
-3
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/plugin-syntax-jsx",
|
||||
"version": "7.28.6",
|
||||
"version": "7.29.7",
|
||||
"description": "Allow parsing of jsx",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -17,13 +17,13 @@
|
||||
"babel-plugin"
|
||||
],
|
||||
"dependencies": {
|
||||
"@babel/helper-plugin-utils": "^7.28.6"
|
||||
"@babel/helper-plugin-utils": "^7.29.7"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@babel/core": "^7.0.0-0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.28.6"
|
||||
"@babel/core": "^7.29.7"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
|
||||
+4
-4
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/plugin-syntax-typescript",
|
||||
"version": "7.28.6",
|
||||
"version": "7.29.7",
|
||||
"description": "Allow parsing of TypeScript syntax",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -18,14 +18,14 @@
|
||||
"typescript"
|
||||
],
|
||||
"dependencies": {
|
||||
"@babel/helper-plugin-utils": "^7.28.6"
|
||||
"@babel/helper-plugin-utils": "^7.29.7"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@babel/core": "^7.0.0-0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.28.6",
|
||||
"@babel/helper-plugin-test-runner": "^7.27.1"
|
||||
"@babel/core": "^7.29.7",
|
||||
"@babel/helper-plugin-test-runner": "^7.29.7"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
|
||||
+5
-7
@@ -14,13 +14,11 @@ var _default = exports.default = (0, _helperPluginUtils.declare)((api, options)
|
||||
visitor: {
|
||||
ArrowFunctionExpression(path) {
|
||||
if (!path.isArrowFunctionExpression()) return;
|
||||
{
|
||||
path.arrowFunctionToExpression({
|
||||
allowInsertArrow: false,
|
||||
noNewArrows,
|
||||
specCompliant: !noNewArrows
|
||||
});
|
||||
}
|
||||
path.arrowFunctionToExpression({
|
||||
allowInsertArrow: false,
|
||||
noNewArrows,
|
||||
specCompliant: !noNewArrows
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
{"version":3,"names":["_helperPluginUtils","require","_default","exports","default","declare","api","options","_api$assumption","assertVersion","noNewArrows","assumption","spec","name","visitor","ArrowFunctionExpression","path","isArrowFunctionExpression","arrowFunctionToExpression","allowInsertArrow","specCompliant"],"sources":["../src/index.ts"],"sourcesContent":["import { declare } from \"@babel/helper-plugin-utils\";\n\nexport interface Options {\n spec?: boolean;\n}\n\nexport default declare((api, options: Options) => {\n api.assertVersion(REQUIRED_VERSION(7));\n\n const noNewArrows = api.assumption(\"noNewArrows\") ?? !options.spec;\n\n return {\n name: \"transform-arrow-functions\",\n\n visitor: {\n ArrowFunctionExpression(path) {\n // In some conversion cases, it may have already been converted to a function while this callback\n // was queued up.\n if (!path.isArrowFunctionExpression()) return;\n\n if (process.env.BABEL_8_BREAKING) {\n path.arrowFunctionToExpression({\n // While other utils may be fine inserting other arrows to make more transforms possible,\n // the arrow transform itself absolutely cannot insert new arrow functions.\n allowInsertArrow: false,\n noNewArrows,\n });\n } else {\n path.arrowFunctionToExpression({\n allowInsertArrow: false,\n noNewArrows,\n\n // This is only needed for backward compat with @babel/traverse <7.13.0\n // @ts-ignore(Babel 7 vs Babel 8) Removed in Babel 8\n specCompliant: !noNewArrows,\n });\n }\n },\n },\n };\n});\n"],"mappings":";;;;;;AAAA,IAAAA,kBAAA,GAAAC,OAAA;AAAqD,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAMtC,IAAAC,0BAAO,EAAC,CAACC,GAAG,EAAEC,OAAgB,KAAK;EAAA,IAAAC,eAAA;EAChDF,GAAG,CAACG,aAAa,CAAkB,CAAE,CAAC;EAEtC,MAAMC,WAAW,IAAAF,eAAA,GAAGF,GAAG,CAACK,UAAU,CAAC,aAAa,CAAC,YAAAH,eAAA,GAAI,CAACD,OAAO,CAACK,IAAI;EAElE,OAAO;IACLC,IAAI,EAAE,2BAA2B;IAEjCC,OAAO,EAAE;MACPC,uBAAuBA,CAACC,IAAI,EAAE;QAG5B,IAAI,CAACA,IAAI,CAACC,yBAAyB,CAAC,CAAC,EAAE;QAShC;UACLD,IAAI,CAACE,yBAAyB,CAAC;YAC7BC,gBAAgB,EAAE,KAAK;YACvBT,WAAW;YAIXU,aAAa,EAAE,CAACV;UAClB,CAAC,CAAC;QACJ;MACF;IACF;EACF,CAAC;AACH,CAAC,CAAC","ignoreList":[]}
|
||||
{"version":3,"names":["_helperPluginUtils","require","_default","exports","default","declare","api","options","_api$assumption","assertVersion","noNewArrows","assumption","spec","name","visitor","ArrowFunctionExpression","path","isArrowFunctionExpression","arrowFunctionToExpression","allowInsertArrow","specCompliant"],"sources":["../src/index.ts"],"sourcesContent":["import { declare } from \"@babel/helper-plugin-utils\";\n\nexport interface Options {\n spec?: boolean;\n}\n\nexport default declare((api, options: Options) => {\n api.assertVersion(REQUIRED_VERSION(7));\n\n const noNewArrows = api.assumption(\"noNewArrows\") ?? !options.spec;\n\n return {\n name: \"transform-arrow-functions\",\n\n visitor: {\n ArrowFunctionExpression(path) {\n // In some conversion cases, it may have already been converted to a function while this callback\n // was queued up.\n if (!path.isArrowFunctionExpression()) return;\n\n if (process.env.BABEL_8_BREAKING) {\n path.arrowFunctionToExpression({\n // While other utils may be fine inserting other arrows to make more transforms possible,\n // the arrow transform itself absolutely cannot insert new arrow functions.\n allowInsertArrow: false,\n noNewArrows,\n });\n } else {\n path.arrowFunctionToExpression({\n allowInsertArrow: false,\n noNewArrows,\n\n // This is only needed for backward compat with @babel/traverse <7.13.0\n // @ts-ignore(Babel 7 vs Babel 8) Removed in Babel 8\n specCompliant: !noNewArrows,\n });\n }\n },\n },\n };\n});\n"],"mappings":";;;;;;AAAA,IAAAA,kBAAA,GAAAC,OAAA;AAAqD,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAMtC,IAAAC,0BAAO,EAAC,CAACC,GAAG,EAAEC,OAAgB,KAAK;EAAA,IAAAC,eAAA;EAChDF,GAAG,CAACG,aAAa,CAAkB,CAAE,CAAC;EAEtC,MAAMC,WAAW,IAAAF,eAAA,GAAGF,GAAG,CAACK,UAAU,CAAC,aAAa,CAAC,YAAAH,eAAA,GAAI,CAACD,OAAO,CAACK,IAAI;EAElE,OAAO;IACLC,IAAI,EAAE,2BAA2B;IAEjCC,OAAO,EAAE;MACPC,uBAAuBA,CAACC,IAAI,EAAE;QAG5B,IAAI,CAACA,IAAI,CAACC,yBAAyB,CAAC,CAAC,EAAE;QAUrCD,IAAI,CAACE,yBAAyB,CAAC;UAC7BC,gBAAgB,EAAE,KAAK;UACvBT,WAAW;UAIXU,aAAa,EAAE,CAACV;QAClB,CAAC,CAAC;MAEN;IACF;EACF,CAAC;AACH,CAAC,CAAC","ignoreList":[]}
|
||||
+6
-6
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/plugin-transform-arrow-functions",
|
||||
"version": "7.27.1",
|
||||
"version": "7.29.7",
|
||||
"description": "Compile ES2015 arrow functions to ES5",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -17,16 +17,16 @@
|
||||
"babel-plugin"
|
||||
],
|
||||
"dependencies": {
|
||||
"@babel/helper-plugin-utils": "^7.27.1"
|
||||
"@babel/helper-plugin-utils": "^7.29.7"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@babel/core": "^7.0.0-0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.27.1",
|
||||
"@babel/helper-plugin-test-runner": "^7.27.1",
|
||||
"@babel/traverse": "^7.27.1",
|
||||
"@babel/types": "^7.27.1"
|
||||
"@babel/core": "^7.29.7",
|
||||
"@babel/helper-plugin-test-runner": "^7.29.7",
|
||||
"@babel/traverse": "^7.29.7",
|
||||
"@babel/types": "^7.29.7"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
|
||||
+8
-8
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/plugin-transform-async-generator-functions",
|
||||
"version": "7.28.6",
|
||||
"version": "7.29.7",
|
||||
"description": "Turn async generator functions into ES2015 generators",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -17,18 +17,18 @@
|
||||
"babel-plugin"
|
||||
],
|
||||
"dependencies": {
|
||||
"@babel/helper-plugin-utils": "^7.28.6",
|
||||
"@babel/helper-remap-async-to-generator": "^7.27.1",
|
||||
"@babel/traverse": "^7.28.6"
|
||||
"@babel/helper-plugin-utils": "^7.29.7",
|
||||
"@babel/helper-remap-async-to-generator": "^7.29.7",
|
||||
"@babel/traverse": "^7.29.7"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@babel/core": "^7.0.0-0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.28.6",
|
||||
"@babel/helper-plugin-test-runner": "^7.27.1",
|
||||
"babel-plugin-polyfill-corejs3": "^0.13.0",
|
||||
"core-js-pure": "^3.43.0"
|
||||
"@babel/core": "^7.29.7",
|
||||
"@babel/helper-plugin-test-runner": "^7.29.7",
|
||||
"babel-plugin-polyfill-corejs3": "^0.14.0",
|
||||
"core-js-pure": "^3.48.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
|
||||
+6
-6
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/plugin-transform-async-to-generator",
|
||||
"version": "7.28.6",
|
||||
"version": "7.29.7",
|
||||
"description": "Turn async functions into ES2015 generators",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -17,16 +17,16 @@
|
||||
"babel-plugin"
|
||||
],
|
||||
"dependencies": {
|
||||
"@babel/helper-module-imports": "^7.28.6",
|
||||
"@babel/helper-plugin-utils": "^7.28.6",
|
||||
"@babel/helper-remap-async-to-generator": "^7.27.1"
|
||||
"@babel/helper-module-imports": "^7.29.7",
|
||||
"@babel/helper-plugin-utils": "^7.29.7",
|
||||
"@babel/helper-remap-async-to-generator": "^7.29.7"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@babel/core": "^7.0.0-0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.28.6",
|
||||
"@babel/helper-plugin-test-runner": "^7.27.1"
|
||||
"@babel/core": "^7.29.7",
|
||||
"@babel/helper-plugin-test-runner": "^7.29.7"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
|
||||
-2
@@ -9,10 +9,8 @@ var _core = require("@babel/core");
|
||||
var _default = exports.default = (0, _helperPluginUtils.declare)(api => {
|
||||
api.assertVersion(7);
|
||||
function transformStatementList(parentPath, paths) {
|
||||
;
|
||||
for (const path of paths) {
|
||||
if (!path.isFunctionDeclaration()) continue;
|
||||
;
|
||||
const func = path.node;
|
||||
const declar = _core.types.variableDeclaration("let", [_core.types.variableDeclarator(func.id, _core.types.toExpression(func))]);
|
||||
declar._blockHoist = 2;
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
{"version":3,"names":["_helperPluginUtils","require","_core","_default","exports","default","declare","api","assertVersion","transformStatementList","parentPath","paths","path","isFunctionDeclaration","func","node","declar","t","variableDeclaration","variableDeclarator","id","toExpression","_blockHoist","replaceWith","name","visitor","BlockStatement","parent","isFunction","body","isExportDeclaration","get","SwitchCase"],"sources":["../src/index.ts"],"sourcesContent":["import { declare } from \"@babel/helper-plugin-utils\";\nimport { types as t, type NodePath } from \"@babel/core\";\n\nexport default declare(api => {\n api.assertVersion(REQUIRED_VERSION(7));\n\n function transformStatementList(\n parentPath: NodePath,\n paths: NodePath<t.Statement>[],\n ) {\n if (process.env.BABEL_8_BREAKING) {\n // eslint-disable-next-line no-var\n var isInStrictMode = parentPath.isInStrictMode();\n }\n\n for (const path of paths) {\n if (!path.isFunctionDeclaration()) continue;\n\n if (\n process.env.BABEL_8_BREAKING &&\n !isInStrictMode &&\n !(\n path.node.async ||\n path.node.generator ||\n path.getData(\n \"@babel/plugin-transform-async-generator-functions/async_generator_function\",\n )\n )\n ) {\n continue;\n }\n\n const func = path.node;\n const declar = t.variableDeclaration(\"let\", [\n t.variableDeclarator(func.id, t.toExpression(func)),\n ]);\n\n // hoist it up above everything else\n // @ts-expect-error todo(flow->ts): avoid mutations\n declar._blockHoist = 2;\n\n // todo: name this\n func.id = null;\n\n path.replaceWith(declar);\n }\n }\n\n return {\n name: \"transform-block-scoped-functions\",\n\n visitor: {\n BlockStatement(path) {\n const { node, parent } = path;\n if (\n t.isFunction(parent, { body: node }) ||\n t.isExportDeclaration(parent)\n ) {\n return;\n }\n\n transformStatementList(path, path.get(\"body\"));\n },\n\n SwitchCase(path) {\n transformStatementList(path, path.get(\"consequent\"));\n },\n },\n };\n});\n"],"mappings":";;;;;;AAAA,IAAAA,kBAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAAwD,IAAAE,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEzC,IAAAC,0BAAO,EAACC,GAAG,IAAI;EAC5BA,GAAG,CAACC,aAAa,CAAkB,CAAE,CAAC;EAEtC,SAASC,sBAAsBA,CAC7BC,UAAoB,EACpBC,KAA8B,EAC9B;IAAA;IAMA,KAAK,MAAMC,IAAI,IAAID,KAAK,EAAE;MACxB,IAAI,CAACC,IAAI,CAACC,qBAAqB,CAAC,CAAC,EAAE;MAAS;MAgB5C,MAAMC,IAAI,GAAGF,IAAI,CAACG,IAAI;MACtB,MAAMC,MAAM,GAAGC,WAAC,CAACC,mBAAmB,CAAC,KAAK,EAAE,CAC1CD,WAAC,CAACE,kBAAkB,CAACL,IAAI,CAACM,EAAE,EAAEH,WAAC,CAACI,YAAY,CAACP,IAAI,CAAC,CAAC,CACpD,CAAC;MAIFE,MAAM,CAACM,WAAW,GAAG,CAAC;MAGtBR,IAAI,CAACM,EAAE,GAAG,IAAI;MAEdR,IAAI,CAACW,WAAW,CAACP,MAAM,CAAC;IAC1B;EACF;EAEA,OAAO;IACLQ,IAAI,EAAE,kCAAkC;IAExCC,OAAO,EAAE;MACPC,cAAcA,CAACd,IAAI,EAAE;QACnB,MAAM;UAAEG,IAAI;UAAEY;QAAO,CAAC,GAAGf,IAAI;QAC7B,IACEK,WAAC,CAACW,UAAU,CAACD,MAAM,EAAE;UAAEE,IAAI,EAAEd;QAAK,CAAC,CAAC,IACpCE,WAAC,CAACa,mBAAmB,CAACH,MAAM,CAAC,EAC7B;UACA;QACF;QAEAlB,sBAAsB,CAACG,IAAI,EAAEA,IAAI,CAACmB,GAAG,CAAC,MAAM,CAAC,CAAC;MAChD,CAAC;MAEDC,UAAUA,CAACpB,IAAI,EAAE;QACfH,sBAAsB,CAACG,IAAI,EAAEA,IAAI,CAACmB,GAAG,CAAC,YAAY,CAAC,CAAC;MACtD;IACF;EACF,CAAC;AACH,CAAC,CAAC","ignoreList":[]}
|
||||
{"version":3,"names":["_helperPluginUtils","require","_core","_default","exports","default","declare","api","assertVersion","transformStatementList","parentPath","paths","path","isFunctionDeclaration","func","node","declar","t","variableDeclaration","variableDeclarator","id","toExpression","_blockHoist","replaceWith","name","visitor","BlockStatement","parent","isFunction","body","isExportDeclaration","get","SwitchCase"],"sources":["../src/index.ts"],"sourcesContent":["import { declare } from \"@babel/helper-plugin-utils\";\nimport { types as t, type NodePath } from \"@babel/core\";\n\nexport default declare(api => {\n api.assertVersion(REQUIRED_VERSION(7));\n\n function transformStatementList(\n parentPath: NodePath,\n paths: NodePath<t.Statement>[],\n ) {\n if (process.env.BABEL_8_BREAKING) {\n // eslint-disable-next-line no-var\n var isInStrictMode = parentPath.isInStrictMode();\n }\n\n for (const path of paths) {\n if (!path.isFunctionDeclaration()) continue;\n\n if (\n process.env.BABEL_8_BREAKING &&\n !isInStrictMode &&\n !(\n path.node.async ||\n path.node.generator ||\n path.getData(\n \"@babel/plugin-transform-async-generator-functions/async_generator_function\",\n )\n )\n ) {\n continue;\n }\n\n const func = path.node;\n const declar = t.variableDeclaration(\"let\", [\n t.variableDeclarator(func.id, t.toExpression(func)),\n ]);\n\n // hoist it up above everything else\n // @ts-expect-error todo(flow->ts): avoid mutations\n declar._blockHoist = 2;\n\n // todo: name this\n func.id = null;\n\n path.replaceWith(declar);\n }\n }\n\n return {\n name: \"transform-block-scoped-functions\",\n\n visitor: {\n BlockStatement(path) {\n const { node, parent } = path;\n if (\n t.isFunction(parent, { body: node }) ||\n t.isExportDeclaration(parent)\n ) {\n return;\n }\n\n transformStatementList(path, path.get(\"body\"));\n },\n\n SwitchCase(path) {\n transformStatementList(path, path.get(\"consequent\"));\n },\n },\n };\n});\n"],"mappings":";;;;;;AAAA,IAAAA,kBAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAAwD,IAAAE,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEzC,IAAAC,0BAAO,EAACC,GAAG,IAAI;EAC5BA,GAAG,CAACC,aAAa,CAAkB,CAAE,CAAC;EAEtC,SAASC,sBAAsBA,CAC7BC,UAAoB,EACpBC,KAA8B,EAC9B;IAMA,KAAK,MAAMC,IAAI,IAAID,KAAK,EAAE;MACxB,IAAI,CAACC,IAAI,CAACC,qBAAqB,CAAC,CAAC,EAAE;MAgBnC,MAAMC,IAAI,GAAGF,IAAI,CAACG,IAAI;MACtB,MAAMC,MAAM,GAAGC,WAAC,CAACC,mBAAmB,CAAC,KAAK,EAAE,CAC1CD,WAAC,CAACE,kBAAkB,CAACL,IAAI,CAACM,EAAE,EAAEH,WAAC,CAACI,YAAY,CAACP,IAAI,CAAC,CAAC,CACpD,CAAC;MAIFE,MAAM,CAACM,WAAW,GAAG,CAAC;MAGtBR,IAAI,CAACM,EAAE,GAAG,IAAI;MAEdR,IAAI,CAACW,WAAW,CAACP,MAAM,CAAC;IAC1B;EACF;EAEA,OAAO;IACLQ,IAAI,EAAE,kCAAkC;IAExCC,OAAO,EAAE;MACPC,cAAcA,CAACd,IAAI,EAAE;QACnB,MAAM;UAAEG,IAAI;UAAEY;QAAO,CAAC,GAAGf,IAAI;QAC7B,IACEK,WAAC,CAACW,UAAU,CAACD,MAAM,EAAE;UAAEE,IAAI,EAAEd;QAAK,CAAC,CAAC,IACpCE,WAAC,CAACa,mBAAmB,CAACH,MAAM,CAAC,EAC7B;UACA;QACF;QAEAlB,sBAAsB,CAACG,IAAI,EAAEA,IAAI,CAACmB,GAAG,CAAC,MAAM,CAAC,CAAC;MAChD,CAAC;MAEDC,UAAUA,CAACpB,IAAI,EAAE;QACfH,sBAAsB,CAACG,IAAI,EAAEA,IAAI,CAACmB,GAAG,CAAC,YAAY,CAAC,CAAC;MACtD;IACF;EACF,CAAC;AACH,CAAC,CAAC","ignoreList":[]}
|
||||
+4
-4
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/plugin-transform-block-scoped-functions",
|
||||
"version": "7.27.1",
|
||||
"version": "7.29.7",
|
||||
"description": "Babel plugin to ensure function declarations at the block level are block scoped",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -17,14 +17,14 @@
|
||||
"babel-plugin"
|
||||
],
|
||||
"dependencies": {
|
||||
"@babel/helper-plugin-utils": "^7.27.1"
|
||||
"@babel/helper-plugin-utils": "^7.29.7"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@babel/core": "^7.0.0-0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.27.1",
|
||||
"@babel/helper-plugin-test-runner": "^7.27.1"
|
||||
"@babel/core": "^7.29.7",
|
||||
"@babel/helper-plugin-test-runner": "^7.29.7"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
|
||||
+5
-5
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/plugin-transform-block-scoping",
|
||||
"version": "7.28.6",
|
||||
"version": "7.29.7",
|
||||
"description": "Compile ES2015 block scoping (const and let) to ES5",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -14,7 +14,7 @@
|
||||
},
|
||||
"main": "./lib/index.js",
|
||||
"dependencies": {
|
||||
"@babel/helper-plugin-utils": "^7.28.6"
|
||||
"@babel/helper-plugin-utils": "^7.29.7"
|
||||
},
|
||||
"keywords": [
|
||||
"babel-plugin"
|
||||
@@ -23,9 +23,9 @@
|
||||
"@babel/core": "^7.0.0-0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.28.6",
|
||||
"@babel/helper-plugin-test-runner": "^7.27.1",
|
||||
"@babel/traverse": "^7.28.6"
|
||||
"@babel/core": "^7.29.7",
|
||||
"@babel/helper-plugin-test-runner": "^7.29.7",
|
||||
"@babel/traverse": "^7.29.7"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
|
||||
+5
-5
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/plugin-transform-class-properties",
|
||||
"version": "7.28.6",
|
||||
"version": "7.29.7",
|
||||
"description": "This plugin transforms static class properties as well as properties declared with the property initializer syntax",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -17,15 +17,15 @@
|
||||
"babel-plugin"
|
||||
],
|
||||
"dependencies": {
|
||||
"@babel/helper-create-class-features-plugin": "^7.28.6",
|
||||
"@babel/helper-plugin-utils": "^7.28.6"
|
||||
"@babel/helper-create-class-features-plugin": "^7.29.7",
|
||||
"@babel/helper-plugin-utils": "^7.29.7"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@babel/core": "^7.0.0-0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.28.6",
|
||||
"@babel/helper-plugin-test-runner": "^7.27.1"
|
||||
"@babel/core": "^7.29.7",
|
||||
"@babel/helper-plugin-test-runner": "^7.29.7"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
|
||||
+9
-9
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/plugin-transform-class-static-block",
|
||||
"version": "7.28.6",
|
||||
"version": "7.29.7",
|
||||
"description": "Transform class static blocks",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -23,19 +23,19 @@
|
||||
"babel-plugin"
|
||||
],
|
||||
"dependencies": {
|
||||
"@babel/helper-create-class-features-plugin": "^7.28.6",
|
||||
"@babel/helper-plugin-utils": "^7.28.6"
|
||||
"@babel/helper-create-class-features-plugin": "^7.29.7",
|
||||
"@babel/helper-plugin-utils": "^7.29.7"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@babel/core": "^7.12.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.28.6",
|
||||
"@babel/helper-plugin-test-runner": "^7.27.1",
|
||||
"@babel/plugin-external-helpers": "^7.27.1",
|
||||
"@babel/plugin-transform-class-properties": "^7.28.6",
|
||||
"@babel/traverse": "^7.28.6",
|
||||
"@babel/types": "^7.28.6"
|
||||
"@babel/core": "^7.29.7",
|
||||
"@babel/helper-plugin-test-runner": "^7.29.7",
|
||||
"@babel/plugin-external-helpers": "^7.29.7",
|
||||
"@babel/plugin-transform-class-properties": "^7.29.7",
|
||||
"@babel/traverse": "^7.29.7",
|
||||
"@babel/types": "^7.29.7"
|
||||
},
|
||||
"homepage": "https://babel.dev/docs/en/next/babel-plugin-transform-class-static-block",
|
||||
"engines": {
|
||||
|
||||
+9
-9
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/plugin-transform-classes",
|
||||
"version": "7.28.6",
|
||||
"version": "7.29.7",
|
||||
"description": "Compile ES2015 classes to ES5",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -14,12 +14,12 @@
|
||||
},
|
||||
"main": "./lib/index.js",
|
||||
"dependencies": {
|
||||
"@babel/helper-annotate-as-pure": "^7.27.3",
|
||||
"@babel/helper-compilation-targets": "^7.28.6",
|
||||
"@babel/helper-globals": "^7.28.0",
|
||||
"@babel/helper-plugin-utils": "^7.28.6",
|
||||
"@babel/helper-replace-supers": "^7.28.6",
|
||||
"@babel/traverse": "^7.28.6"
|
||||
"@babel/helper-annotate-as-pure": "^7.29.7",
|
||||
"@babel/helper-compilation-targets": "^7.29.7",
|
||||
"@babel/helper-globals": "^7.29.7",
|
||||
"@babel/helper-plugin-utils": "^7.29.7",
|
||||
"@babel/helper-replace-supers": "^7.29.7",
|
||||
"@babel/traverse": "^7.29.7"
|
||||
},
|
||||
"keywords": [
|
||||
"babel-plugin"
|
||||
@@ -28,8 +28,8 @@
|
||||
"@babel/core": "^7.0.0-0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.28.6",
|
||||
"@babel/helper-plugin-test-runner": "^7.27.1"
|
||||
"@babel/core": "^7.29.7",
|
||||
"@babel/helper-plugin-test-runner": "^7.29.7"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
|
||||
+5
-5
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/plugin-transform-computed-properties",
|
||||
"version": "7.28.6",
|
||||
"version": "7.29.7",
|
||||
"description": "Compile ES2015 computed properties to ES5",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -17,15 +17,15 @@
|
||||
"babel-plugin"
|
||||
],
|
||||
"dependencies": {
|
||||
"@babel/helper-plugin-utils": "^7.28.6",
|
||||
"@babel/template": "^7.28.6"
|
||||
"@babel/helper-plugin-utils": "^7.29.7",
|
||||
"@babel/template": "^7.29.7"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@babel/core": "^7.0.0-0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.28.6",
|
||||
"@babel/helper-plugin-test-runner": "^7.27.1"
|
||||
"@babel/core": "^7.29.7",
|
||||
"@babel/helper-plugin-test-runner": "^7.29.7"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
|
||||
+2
-4
@@ -475,13 +475,11 @@ var index = helperPluginUtils.declare((api, options) => {
|
||||
name: "transform-destructuring",
|
||||
visitor: {
|
||||
ExportNamedDeclaration(path) {
|
||||
var _path$splitExportDecl;
|
||||
const declaration = path.get("declaration");
|
||||
if (!declaration.isVariableDeclaration()) return;
|
||||
if (!variableDeclarationHasDestructuringPattern(declaration.node)) return;
|
||||
{
|
||||
var _path$splitExportDecl;
|
||||
(_path$splitExportDecl = path.splitExportDeclaration) != null ? _path$splitExportDecl : path.splitExportDeclaration = require("@babel/traverse").NodePath.prototype.splitExportDeclaration;
|
||||
}
|
||||
(_path$splitExportDecl = path.splitExportDeclaration) != null ? _path$splitExportDecl : path.splitExportDeclaration = require("@babel/traverse").NodePath.prototype.splitExportDeclaration;
|
||||
path.splitExportDeclaration();
|
||||
},
|
||||
ForXStatement(path) {
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
+5
-5
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/plugin-transform-destructuring",
|
||||
"version": "7.28.5",
|
||||
"version": "7.29.7",
|
||||
"description": "Compile ES2015 destructuring to ES5",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -17,15 +17,15 @@
|
||||
"babel-plugin"
|
||||
],
|
||||
"dependencies": {
|
||||
"@babel/helper-plugin-utils": "^7.27.1",
|
||||
"@babel/traverse": "^7.28.5"
|
||||
"@babel/helper-plugin-utils": "^7.29.7",
|
||||
"@babel/traverse": "^7.29.7"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@babel/core": "^7.0.0-0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.28.5",
|
||||
"@babel/helper-plugin-test-runner": "^7.27.1"
|
||||
"@babel/core": "^7.29.7",
|
||||
"@babel/helper-plugin-test-runner": "^7.29.7"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
|
||||
+5
-5
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/plugin-transform-dotall-regex",
|
||||
"version": "7.28.6",
|
||||
"version": "7.29.7",
|
||||
"description": "Compile regular expressions using the `s` (`dotAll`) flag to ES5.",
|
||||
"homepage": "https://babel.dev/docs/en/next/babel-plugin-transform-dotall-regex",
|
||||
"license": "MIT",
|
||||
@@ -22,15 +22,15 @@
|
||||
},
|
||||
"bugs": "https://github.com/babel/babel/issues",
|
||||
"dependencies": {
|
||||
"@babel/helper-create-regexp-features-plugin": "^7.28.5",
|
||||
"@babel/helper-plugin-utils": "^7.28.6"
|
||||
"@babel/helper-create-regexp-features-plugin": "^7.29.7",
|
||||
"@babel/helper-plugin-utils": "^7.29.7"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@babel/core": "^7.0.0-0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.28.6",
|
||||
"@babel/helper-plugin-test-runner": "^7.27.1"
|
||||
"@babel/core": "^7.29.7",
|
||||
"@babel/helper-plugin-test-runner": "^7.29.7"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
|
||||
+4
-4
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/plugin-transform-duplicate-keys",
|
||||
"version": "7.27.1",
|
||||
"version": "7.29.7",
|
||||
"description": "Compile objects with duplicate keys to valid strict ES5",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -17,14 +17,14 @@
|
||||
"babel-plugin"
|
||||
],
|
||||
"dependencies": {
|
||||
"@babel/helper-plugin-utils": "^7.27.1"
|
||||
"@babel/helper-plugin-utils": "^7.29.7"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@babel/core": "^7.0.0-0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.27.1",
|
||||
"@babel/helper-plugin-test-runner": "^7.27.1"
|
||||
"@babel/core": "^7.29.7",
|
||||
"@babel/helper-plugin-test-runner": "^7.29.7"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
|
||||
Generated
Vendored
+6
-6
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/plugin-transform-duplicate-named-capturing-groups-regex",
|
||||
"version": "7.28.6",
|
||||
"version": "7.29.7",
|
||||
"description": "Compile regular expressions using duplicate named groups to index-based groups.",
|
||||
"homepage": "https://babel.dev/docs/en/next/babel-plugin-transform-duplicate-named-capturing-groups-regex",
|
||||
"license": "MIT",
|
||||
@@ -21,16 +21,16 @@
|
||||
},
|
||||
"bugs": "https://github.com/babel/babel/issues",
|
||||
"dependencies": {
|
||||
"@babel/helper-create-regexp-features-plugin": "^7.28.5",
|
||||
"@babel/helper-plugin-utils": "^7.28.6"
|
||||
"@babel/helper-create-regexp-features-plugin": "^7.29.7",
|
||||
"@babel/helper-plugin-utils": "^7.29.7"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@babel/core": "^7.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.28.6",
|
||||
"@babel/helper-plugin-test-runner": "^7.27.1",
|
||||
"core-js": "^3.30.2"
|
||||
"@babel/core": "^7.29.7",
|
||||
"@babel/helper-plugin-test-runner": "^7.29.7",
|
||||
"core-js": "^3.48.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
|
||||
+1
-1
@@ -24,7 +24,7 @@ var _default = exports.default = (0, _helperPluginUtils.declare)(api => {
|
||||
name: "transform-dynamic-import",
|
||||
manipulateOptions: (_, parser) => parser.plugins.push("dynamicImport"),
|
||||
pre() {
|
||||
this.file.set("@babel/plugin-proposal-dynamic-import", "7.27.1");
|
||||
this.file.set("@babel/plugin-proposal-dynamic-import", "7.29.7");
|
||||
},
|
||||
visitor: {
|
||||
Program() {
|
||||
|
||||
+4
-4
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/plugin-transform-dynamic-import",
|
||||
"version": "7.27.1",
|
||||
"version": "7.29.7",
|
||||
"description": "Transform import() expressions",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -16,14 +16,14 @@
|
||||
"babel-plugin"
|
||||
],
|
||||
"dependencies": {
|
||||
"@babel/helper-plugin-utils": "^7.27.1"
|
||||
"@babel/helper-plugin-utils": "^7.29.7"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@babel/core": "^7.0.0-0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.27.1",
|
||||
"@babel/helper-plugin-test-runner": "^7.27.1"
|
||||
"@babel/core": "^7.29.7",
|
||||
"@babel/helper-plugin-test-runner": "^7.29.7"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
|
||||
+5
-5
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/plugin-transform-explicit-resource-management",
|
||||
"version": "7.28.6",
|
||||
"version": "7.29.7",
|
||||
"description": "Compile `using` and `await using` declarations to ES2015",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -17,15 +17,15 @@
|
||||
"babel-plugin"
|
||||
],
|
||||
"dependencies": {
|
||||
"@babel/helper-plugin-utils": "^7.28.6",
|
||||
"@babel/plugin-transform-destructuring": "^7.28.5"
|
||||
"@babel/helper-plugin-utils": "^7.29.7",
|
||||
"@babel/plugin-transform-destructuring": "^7.29.7"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@babel/core": "^7.0.0-0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.28.6",
|
||||
"@babel/helper-plugin-test-runner": "^7.27.1"
|
||||
"@babel/core": "^7.29.7",
|
||||
"@babel/helper-plugin-test-runner": "^7.29.7"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
|
||||
+4
-4
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/plugin-transform-exponentiation-operator",
|
||||
"version": "7.28.6",
|
||||
"version": "7.29.7",
|
||||
"description": "Compile exponentiation operator to ES5",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -17,14 +17,14 @@
|
||||
"babel-plugin"
|
||||
],
|
||||
"dependencies": {
|
||||
"@babel/helper-plugin-utils": "^7.28.6"
|
||||
"@babel/helper-plugin-utils": "^7.29.7"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@babel/core": "^7.0.0-0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.28.6",
|
||||
"@babel/helper-plugin-test-runner": "^7.27.1"
|
||||
"@babel/core": "^7.29.7",
|
||||
"@babel/helper-plugin-test-runner": "^7.29.7"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
|
||||
+4
-4
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/plugin-transform-export-namespace-from",
|
||||
"version": "7.27.1",
|
||||
"version": "7.29.7",
|
||||
"description": "Compile export namespace to ES2015",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -16,14 +16,14 @@
|
||||
"babel-plugin"
|
||||
],
|
||||
"dependencies": {
|
||||
"@babel/helper-plugin-utils": "^7.27.1"
|
||||
"@babel/helper-plugin-utils": "^7.29.7"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@babel/core": "^7.0.0-0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.27.1",
|
||||
"@babel/helper-plugin-test-runner": "^7.27.1"
|
||||
"@babel/core": "^7.29.7",
|
||||
"@babel/helper-plugin-test-runner": "^7.29.7"
|
||||
},
|
||||
"homepage": "https://babel.dev/docs/en/next/babel-plugin-transform-export-namespace-from",
|
||||
"engines": {
|
||||
|
||||
+5
-9
@@ -35,10 +35,8 @@ var _default = exports.default = (0, _helperPluginUtils.declare)((api, options)
|
||||
if (assumeArray === true && allowArrayLike === true) {
|
||||
throw new Error(`The assumeArray and allowArrayLike options cannot be used together in @babel/plugin-transform-for-of`);
|
||||
}
|
||||
{
|
||||
if (allowArrayLike && /^7\.\d\./.test(api.version)) {
|
||||
throw new Error(`The allowArrayLike is only supported when using @babel/core@^7.10.0`);
|
||||
}
|
||||
if (allowArrayLike && /^7\.\d\./.test(api.version)) {
|
||||
throw new Error(`The allowArrayLike is only supported when using @babel/core@^7.10.0`);
|
||||
}
|
||||
}
|
||||
const iterableIsArray = (_options$assumeArray = options.assumeArray) != null ? _options$assumeArray : !options.loose && api.assumption("iterableIsArray");
|
||||
@@ -148,11 +146,9 @@ var _default = exports.default = (0, _helperPluginUtils.declare)((api, options)
|
||||
path.replaceWith(_ForOfStatementArray(path));
|
||||
return;
|
||||
}
|
||||
{
|
||||
if (!state.availableHelper(builder.helper)) {
|
||||
(0, _noHelperImplementation.default)(skipIteratorClosing, path, state);
|
||||
return;
|
||||
}
|
||||
if (!state.availableHelper(builder.helper)) {
|
||||
(0, _noHelperImplementation.default)(skipIteratorClosing, path, state);
|
||||
return;
|
||||
}
|
||||
const {
|
||||
node,
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
-1
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
||||
});
|
||||
exports.default = transformWithoutHelper;
|
||||
var _core = require("@babel/core");
|
||||
;
|
||||
function transformWithoutHelper(loose, path, state) {
|
||||
const pushComputedProps = loose ? pushComputedPropsLoose : pushComputedPropsSpec;
|
||||
const {
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
+5
-5
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/plugin-transform-for-of",
|
||||
"version": "7.27.1",
|
||||
"version": "7.29.7",
|
||||
"description": "Compile ES2015 for...of to ES5",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -17,15 +17,15 @@
|
||||
"babel-plugin"
|
||||
],
|
||||
"dependencies": {
|
||||
"@babel/helper-plugin-utils": "^7.27.1",
|
||||
"@babel/helper-skip-transparent-expression-wrappers": "^7.27.1"
|
||||
"@babel/helper-plugin-utils": "^7.29.7",
|
||||
"@babel/helper-skip-transparent-expression-wrappers": "^7.29.7"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@babel/core": "^7.0.0-0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.27.1",
|
||||
"@babel/helper-plugin-test-runner": "^7.27.1"
|
||||
"@babel/core": "^7.29.7",
|
||||
"@babel/helper-plugin-test-runner": "^7.29.7"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
|
||||
+4
-8
@@ -15,10 +15,8 @@ var _default = exports.default = (0, _helperPluginUtils.declare)(api => {
|
||||
FunctionExpression: {
|
||||
exit(path) {
|
||||
if (path.key !== "value" && !path.parentPath.isObjectProperty()) {
|
||||
{
|
||||
var _path$ensureFunctionN;
|
||||
(_path$ensureFunctionN = path.ensureFunctionName) != null ? _path$ensureFunctionN : path.ensureFunctionName = require("@babel/traverse").NodePath.prototype.ensureFunctionName;
|
||||
}
|
||||
var _path$ensureFunctionN;
|
||||
(_path$ensureFunctionN = path.ensureFunctionName) != null ? _path$ensureFunctionN : path.ensureFunctionName = require("@babel/traverse").NodePath.prototype.ensureFunctionName;
|
||||
path.ensureFunctionName(supportUnicodeId);
|
||||
}
|
||||
}
|
||||
@@ -26,10 +24,8 @@ var _default = exports.default = (0, _helperPluginUtils.declare)(api => {
|
||||
ObjectProperty(path) {
|
||||
const value = path.get("value");
|
||||
if (value.isFunction()) {
|
||||
{
|
||||
var _value$ensureFunction;
|
||||
(_value$ensureFunction = value.ensureFunctionName) != null ? _value$ensureFunction : value.ensureFunctionName = require("@babel/traverse").NodePath.prototype.ensureFunctionName;
|
||||
}
|
||||
var _value$ensureFunction;
|
||||
(_value$ensureFunction = value.ensureFunctionName) != null ? _value$ensureFunction : value.ensureFunctionName = require("@babel/traverse").NodePath.prototype.ensureFunctionName;
|
||||
value.ensureFunctionName(supportUnicodeId);
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
{"version":3,"names":["_helperCompilationTargets","require","_helperPluginUtils","_default","exports","default","declare","api","assertVersion","supportUnicodeId","isRequired","targets","name","visitor","FunctionExpression","exit","path","key","parentPath","isObjectProperty","_path$ensureFunctionN","ensureFunctionName","NodePath","prototype","ObjectProperty","value","get","isFunction","_value$ensureFunction"],"sources":["../src/index.ts"],"sourcesContent":["import { isRequired } from \"@babel/helper-compilation-targets\";\nimport { declare } from \"@babel/helper-plugin-utils\";\n\nexport default declare(api => {\n api.assertVersion(REQUIRED_VERSION(7));\n const supportUnicodeId = !isRequired(\n \"transform-unicode-escapes\",\n api.targets(),\n );\n\n return {\n name: \"transform-function-name\",\n\n visitor: {\n FunctionExpression: {\n exit(path) {\n if (path.key !== \"value\" && !path.parentPath.isObjectProperty()) {\n if (!process.env.BABEL_8_BREAKING && !USE_ESM && !IS_STANDALONE) {\n // polyfill when being run by an older Babel version\n path.ensureFunctionName ??=\n // eslint-disable-next-line no-restricted-globals\n require(\"@babel/traverse\").NodePath.prototype.ensureFunctionName;\n }\n path.ensureFunctionName(supportUnicodeId);\n }\n },\n },\n\n ObjectProperty(path) {\n const value = path.get(\"value\");\n if (value.isFunction()) {\n if (!process.env.BABEL_8_BREAKING && !USE_ESM && !IS_STANDALONE) {\n // polyfill when being run by an older Babel version\n value.ensureFunctionName ??=\n // eslint-disable-next-line no-restricted-globals\n require(\"@babel/traverse\").NodePath.prototype.ensureFunctionName;\n }\n // @ts-expect-error Fixme: should check ArrowFunctionExpression\n value.ensureFunctionName(supportUnicodeId);\n }\n },\n },\n };\n});\n"],"mappings":";;;;;;AAAA,IAAAA,yBAAA,GAAAC,OAAA;AACA,IAAAC,kBAAA,GAAAD,OAAA;AAAqD,IAAAE,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEtC,IAAAC,0BAAO,EAACC,GAAG,IAAI;EAC5BA,GAAG,CAACC,aAAa,CAAkB,CAAE,CAAC;EACtC,MAAMC,gBAAgB,GAAG,CAAC,IAAAC,oCAAU,EAClC,2BAA2B,EAC3BH,GAAG,CAACI,OAAO,CAAC,CACd,CAAC;EAED,OAAO;IACLC,IAAI,EAAE,yBAAyB;IAE/BC,OAAO,EAAE;MACPC,kBAAkB,EAAE;QAClBC,IAAIA,CAACC,IAAI,EAAE;UACT,IAAIA,IAAI,CAACC,GAAG,KAAK,OAAO,IAAI,CAACD,IAAI,CAACE,UAAU,CAACC,gBAAgB,CAAC,CAAC,EAAE;YACE;cAAA,IAAAC,qBAAA;cAE/D,CAAAA,qBAAA,GAAAJ,IAAI,CAACK,kBAAkB,YAAAD,qBAAA,GAAvBJ,IAAI,CAACK,kBAAkB,GAErBpB,OAAO,CAAC,iBAAiB,CAAC,CAACqB,QAAQ,CAACC,SAAS,CAACF,kBAAkB;YACpE;YACAL,IAAI,CAACK,kBAAkB,CAACZ,gBAAgB,CAAC;UAC3C;QACF;MACF,CAAC;MAEDe,cAAcA,CAACR,IAAI,EAAE;QACnB,MAAMS,KAAK,GAAGT,IAAI,CAACU,GAAG,CAAC,OAAO,CAAC;QAC/B,IAAID,KAAK,CAACE,UAAU,CAAC,CAAC,EAAE;UAC2C;YAAA,IAAAC,qBAAA;YAE/D,CAAAA,qBAAA,GAAAH,KAAK,CAACJ,kBAAkB,YAAAO,qBAAA,GAAxBH,KAAK,CAACJ,kBAAkB,GAEtBpB,OAAO,CAAC,iBAAiB,CAAC,CAACqB,QAAQ,CAACC,SAAS,CAACF,kBAAkB;UACpE;UAEAI,KAAK,CAACJ,kBAAkB,CAACZ,gBAAgB,CAAC;QAC5C;MACF;IACF;EACF,CAAC;AACH,CAAC,CAAC","ignoreList":[]}
|
||||
{"version":3,"names":["_helperCompilationTargets","require","_helperPluginUtils","_default","exports","default","declare","api","assertVersion","supportUnicodeId","isRequired","targets","name","visitor","FunctionExpression","exit","path","key","parentPath","isObjectProperty","_path$ensureFunctionN","ensureFunctionName","NodePath","prototype","ObjectProperty","value","get","isFunction","_value$ensureFunction"],"sources":["../src/index.ts"],"sourcesContent":["import { isRequired } from \"@babel/helper-compilation-targets\";\nimport { declare } from \"@babel/helper-plugin-utils\";\n\nexport default declare(api => {\n api.assertVersion(REQUIRED_VERSION(7));\n const supportUnicodeId = !isRequired(\n \"transform-unicode-escapes\",\n api.targets(),\n );\n\n return {\n name: \"transform-function-name\",\n\n visitor: {\n FunctionExpression: {\n exit(path) {\n if (path.key !== \"value\" && !path.parentPath.isObjectProperty()) {\n if (!process.env.BABEL_8_BREAKING && !USE_ESM && !IS_STANDALONE) {\n // polyfill when being run by an older Babel version\n path.ensureFunctionName ??=\n // eslint-disable-next-line no-restricted-globals\n require(\"@babel/traverse\").NodePath.prototype.ensureFunctionName;\n }\n path.ensureFunctionName(supportUnicodeId);\n }\n },\n },\n\n ObjectProperty(path) {\n const value = path.get(\"value\");\n if (value.isFunction()) {\n if (!process.env.BABEL_8_BREAKING && !USE_ESM && !IS_STANDALONE) {\n // polyfill when being run by an older Babel version\n value.ensureFunctionName ??=\n // eslint-disable-next-line no-restricted-globals\n require(\"@babel/traverse\").NodePath.prototype.ensureFunctionName;\n }\n // @ts-expect-error Fixme: should check ArrowFunctionExpression\n value.ensureFunctionName(supportUnicodeId);\n }\n },\n },\n };\n});\n"],"mappings":";;;;;;AAAA,IAAAA,yBAAA,GAAAC,OAAA;AACA,IAAAC,kBAAA,GAAAD,OAAA;AAAqD,IAAAE,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEtC,IAAAC,0BAAO,EAACC,GAAG,IAAI;EAC5BA,GAAG,CAACC,aAAa,CAAkB,CAAE,CAAC;EACtC,MAAMC,gBAAgB,GAAG,CAAC,IAAAC,oCAAU,EAClC,2BAA2B,EAC3BH,GAAG,CAACI,OAAO,CAAC,CACd,CAAC;EAED,OAAO;IACLC,IAAI,EAAE,yBAAyB;IAE/BC,OAAO,EAAE;MACPC,kBAAkB,EAAE;QAClBC,IAAIA,CAACC,IAAI,EAAE;UACT,IAAIA,IAAI,CAACC,GAAG,KAAK,OAAO,IAAI,CAACD,IAAI,CAACE,UAAU,CAACC,gBAAgB,CAAC,CAAC,EAAE;YAAA,IAAAC,qBAAA;YAG7D,CAAAA,qBAAA,GAAAJ,IAAI,CAACK,kBAAkB,YAAAD,qBAAA,GAAvBJ,IAAI,CAACK,kBAAkB,GAErBpB,OAAO,CAAC,iBAAiB,CAAC,CAACqB,QAAQ,CAACC,SAAS,CAACF,kBAAkB;YAEpEL,IAAI,CAACK,kBAAkB,CAACZ,gBAAgB,CAAC;UAC3C;QACF;MACF,CAAC;MAEDe,cAAcA,CAACR,IAAI,EAAE;QACnB,MAAMS,KAAK,GAAGT,IAAI,CAACU,GAAG,CAAC,OAAO,CAAC;QAC/B,IAAID,KAAK,CAACE,UAAU,CAAC,CAAC,EAAE;UAAA,IAAAC,qBAAA;UAGpB,CAAAA,qBAAA,GAAAH,KAAK,CAACJ,kBAAkB,YAAAO,qBAAA,GAAxBH,KAAK,CAACJ,kBAAkB,GAEtBpB,OAAO,CAAC,iBAAiB,CAAC,CAACqB,QAAQ,CAACC,SAAS,CAACF,kBAAkB;UAGpEI,KAAK,CAACJ,kBAAkB,CAACZ,gBAAgB,CAAC;QAC5C;MACF;IACF;EACF,CAAC;AACH,CAAC,CAAC","ignoreList":[]}
|
||||
+6
-6
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/plugin-transform-function-name",
|
||||
"version": "7.27.1",
|
||||
"version": "7.29.7",
|
||||
"description": "Apply ES2015 function.name semantics to all functions",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -17,16 +17,16 @@
|
||||
"babel-plugin"
|
||||
],
|
||||
"dependencies": {
|
||||
"@babel/helper-compilation-targets": "^7.27.1",
|
||||
"@babel/helper-plugin-utils": "^7.27.1",
|
||||
"@babel/traverse": "^7.27.1"
|
||||
"@babel/helper-compilation-targets": "^7.29.7",
|
||||
"@babel/helper-plugin-utils": "^7.29.7",
|
||||
"@babel/traverse": "^7.29.7"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@babel/core": "^7.0.0-0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.27.1",
|
||||
"@babel/helper-plugin-test-runner": "^7.27.1"
|
||||
"@babel/core": "^7.29.7",
|
||||
"@babel/helper-plugin-test-runner": "^7.29.7"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
|
||||
+4
-4
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/plugin-transform-json-strings",
|
||||
"version": "7.28.6",
|
||||
"version": "7.29.7",
|
||||
"description": "Escape U+2028 LINE SEPARATOR and U+2029 PARAGRAPH SEPARATOR in JS strings",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -17,14 +17,14 @@
|
||||
"babel-plugin"
|
||||
],
|
||||
"dependencies": {
|
||||
"@babel/helper-plugin-utils": "^7.28.6"
|
||||
"@babel/helper-plugin-utils": "^7.29.7"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@babel/core": "^7.0.0-0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.28.6",
|
||||
"@babel/helper-plugin-test-runner": "^7.27.1"
|
||||
"@babel/core": "^7.29.7",
|
||||
"@babel/helper-plugin-test-runner": "^7.29.7"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
|
||||
+4
-4
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/plugin-transform-literals",
|
||||
"version": "7.27.1",
|
||||
"version": "7.29.7",
|
||||
"description": "Compile ES2015 unicode string and number literals to ES5",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -17,14 +17,14 @@
|
||||
"babel-plugin"
|
||||
],
|
||||
"dependencies": {
|
||||
"@babel/helper-plugin-utils": "^7.27.1"
|
||||
"@babel/helper-plugin-utils": "^7.29.7"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@babel/core": "^7.0.0-0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.27.1",
|
||||
"@babel/helper-plugin-test-runner": "^7.27.1"
|
||||
"@babel/core": "^7.29.7",
|
||||
"@babel/helper-plugin-test-runner": "^7.29.7"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
|
||||
+5
-5
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/plugin-transform-logical-assignment-operators",
|
||||
"version": "7.28.6",
|
||||
"version": "7.29.7",
|
||||
"description": "Transforms logical assignment operators into short-circuited assignments",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -16,15 +16,15 @@
|
||||
"babel-plugin"
|
||||
],
|
||||
"dependencies": {
|
||||
"@babel/helper-plugin-utils": "^7.28.6"
|
||||
"@babel/helper-plugin-utils": "^7.29.7"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@babel/core": "^7.0.0-0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.28.6",
|
||||
"@babel/helper-plugin-test-runner": "^7.27.1",
|
||||
"@babel/plugin-transform-nullish-coalescing-operator": "^7.28.6"
|
||||
"@babel/core": "^7.29.7",
|
||||
"@babel/helper-plugin-test-runner": "^7.29.7",
|
||||
"@babel/plugin-transform-nullish-coalescing-operator": "^7.29.7"
|
||||
},
|
||||
"homepage": "https://babel.dev/docs/en/next/babel-plugin-transform-logical-assignment-operators",
|
||||
"engines": {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user