likec4 1.20.2 → 1.20.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/__app__/src/chunks/{-index-overview-XuOb1YP0.js → -index-overview-TebwYeV7.js} +1 -1
- package/__app__/src/chunks/{main-BTT9mi5e.js → main-DSlxn73B.js} +3846 -3801
- package/__app__/src/main.js +1 -1
- package/__app__/webcomponent/webcomponent.js +367 -324
- package/dist/cli/index.cjs +45 -43
- package/dist/cli/index.mjs +109 -107
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +24 -632
- package/dist/index.d.mts +24 -632
- package/dist/index.d.ts +24 -632
- package/dist/index.mjs +1 -1
- package/dist/shared/likec4.32ndthTo.cjs +1855 -0
- package/dist/shared/likec4.BgEQuI_b.mjs +1855 -0
- package/package.json +14 -12
- package/react/index.js +367 -324
- package/dist/shared/likec4.DpEZnw1B.cjs +0 -1856
- package/dist/shared/likec4.EF3jY6Mw.mjs +0 -1856
|
@@ -11235,12 +11235,12 @@ const defaultProps$8 = {
|
|
|
11235
11235
|
});
|
|
11236
11236
|
Tree.displayName = "@mantine/core/Tree";
|
|
11237
11237
|
Tree.classes = classes$2;
|
|
11238
|
-
const
|
|
11238
|
+
const LayoutGroupContext = createContext({});
|
|
11239
11239
|
function useConstant(init2) {
|
|
11240
11240
|
const ref = useRef$1(null);
|
|
11241
11241
|
return ref.current === null && (ref.current = init2()), ref.current;
|
|
11242
11242
|
}
|
|
11243
|
-
const MotionConfigContext = createContext({
|
|
11243
|
+
const PresenceContext = createContext(null), MotionConfigContext = createContext({
|
|
11244
11244
|
transformPagePoint: (p2) => p2,
|
|
11245
11245
|
isStatic: !1,
|
|
11246
11246
|
reducedMotion: "never"
|
|
@@ -11321,24 +11321,26 @@ const PresenceChild = ({ children: children2, initial, isPresent, onExitComplete
|
|
|
11321
11321
|
function newChildrenMap() {
|
|
11322
11322
|
return /* @__PURE__ */ new Map();
|
|
11323
11323
|
}
|
|
11324
|
-
|
|
11325
|
-
|
|
11326
|
-
|
|
11327
|
-
|
|
11328
|
-
|
|
11324
|
+
function usePresence(subscribe = !0) {
|
|
11325
|
+
const context = useContext(PresenceContext);
|
|
11326
|
+
if (context === null)
|
|
11327
|
+
return [!0, null];
|
|
11328
|
+
const { isPresent, onExitComplete, register } = context, id2 = useId$2();
|
|
11329
|
+
useEffect$2(() => {
|
|
11330
|
+
subscribe && register(id2);
|
|
11331
|
+
}, [subscribe]);
|
|
11332
|
+
const safeToRemove = useCallback(() => subscribe && onExitComplete && onExitComplete(id2), [id2, onExitComplete, subscribe]);
|
|
11333
|
+
return !isPresent && onExitComplete ? [!1, safeToRemove] : [!0];
|
|
11329
11334
|
}
|
|
11330
|
-
const
|
|
11331
|
-
const toFromDifference = to - from;
|
|
11332
|
-
return toFromDifference === 0 ? 1 : (value - from) / toFromDifference;
|
|
11333
|
-
}, secondsToMilliseconds = (seconds) => seconds * 1e3, millisecondsToSeconds = (milliseconds) => milliseconds / 1e3, getChildKey = (child) => child.key || "";
|
|
11335
|
+
const getChildKey = (child) => child.key || "";
|
|
11334
11336
|
function onlyElements(children2) {
|
|
11335
11337
|
const filtered = [];
|
|
11336
11338
|
return Children.forEach(children2, (child) => {
|
|
11337
11339
|
isValidElement(child) && filtered.push(child);
|
|
11338
11340
|
}), filtered;
|
|
11339
11341
|
}
|
|
11340
|
-
const isBrowser$1 = typeof window < "u", useIsomorphicLayoutEffect$1 = isBrowser$1 ? useLayoutEffect$1 : useEffect$2, AnimatePresence = ({ children: children2,
|
|
11341
|
-
const presentChildren = useMemo$1(() => onlyElements(children2), [children2]), presentKeys = presentChildren.map(getChildKey), isInitialRender = useRef$1(!0), pendingPresentChildren = useRef$1(presentChildren), exitComplete = useConstant(() => /* @__PURE__ */ new Map()), [diffedChildren, setDiffedChildren] = useState$1(presentChildren), [renderedChildren, setRenderedChildren] = useState$1(presentChildren);
|
|
11342
|
+
const isBrowser$1 = typeof window < "u", useIsomorphicLayoutEffect$1 = isBrowser$1 ? useLayoutEffect$1 : useEffect$2, AnimatePresence = ({ children: children2, custom: custom5, initial = !0, onExitComplete, presenceAffectsLayout = !0, mode = "sync", propagate = !1 }) => {
|
|
11343
|
+
const [isParentPresent, safeToRemove] = usePresence(propagate), presentChildren = useMemo$1(() => onlyElements(children2), [children2]), presentKeys = propagate && !isParentPresent ? [] : presentChildren.map(getChildKey), isInitialRender = useRef$1(!0), pendingPresentChildren = useRef$1(presentChildren), exitComplete = useConstant(() => /* @__PURE__ */ new Map()), [diffedChildren, setDiffedChildren] = useState$1(presentChildren), [renderedChildren, setRenderedChildren] = useState$1(presentChildren);
|
|
11342
11344
|
useIsomorphicLayoutEffect$1(() => {
|
|
11343
11345
|
isInitialRender.current = !1, pendingPresentChildren.current = presentChildren;
|
|
11344
11346
|
for (let i2 = 0; i2 < renderedChildren.length; i2++) {
|
|
@@ -11358,7 +11360,7 @@ const isBrowser$1 = typeof window < "u", useIsomorphicLayoutEffect$1 = isBrowser
|
|
|
11358
11360
|
}
|
|
11359
11361
|
const { forceRender } = useContext(LayoutGroupContext);
|
|
11360
11362
|
return jsx(Fragment$1, { children: renderedChildren.map((child) => {
|
|
11361
|
-
const key = getChildKey(child), isPresent = presentChildren === renderedChildren || presentKeys.includes(key), onExit = () => {
|
|
11363
|
+
const key = getChildKey(child), isPresent = propagate && !isParentPresent ? !1 : presentChildren === renderedChildren || presentKeys.includes(key), onExit = () => {
|
|
11362
11364
|
if (exitComplete.has(key))
|
|
11363
11365
|
exitComplete.set(key, !0);
|
|
11364
11366
|
else
|
|
@@ -11366,7 +11368,7 @@ const isBrowser$1 = typeof window < "u", useIsomorphicLayoutEffect$1 = isBrowser
|
|
|
11366
11368
|
let isEveryExitComplete = !0;
|
|
11367
11369
|
exitComplete.forEach((isExitComplete) => {
|
|
11368
11370
|
isExitComplete || (isEveryExitComplete = !1);
|
|
11369
|
-
}), isEveryExitComplete && (forceRender?.(), setRenderedChildren(pendingPresentChildren.current), onExitComplete && onExitComplete());
|
|
11371
|
+
}), isEveryExitComplete && (forceRender?.(), setRenderedChildren(pendingPresentChildren.current), propagate && safeToRemove?.(), onExitComplete && onExitComplete());
|
|
11370
11372
|
};
|
|
11371
11373
|
return jsx(PresenceChild, { isPresent, initial: !isInitialRender.current || initial ? void 0 : !1, custom: isPresent ? void 0 : custom5, presenceAffectsLayout, mode, onExitComplete: isPresent ? void 0 : onExit, children: child }, key);
|
|
11372
11374
|
}) });
|
|
@@ -11377,7 +11379,17 @@ function useIsMounted() {
|
|
|
11377
11379
|
isMounted.current = !1;
|
|
11378
11380
|
}), []), isMounted;
|
|
11379
11381
|
}
|
|
11380
|
-
const
|
|
11382
|
+
const noop$3 = /* @__NO_SIDE_EFFECTS__ */ (any) => any;
|
|
11383
|
+
let invariant = noop$3;
|
|
11384
|
+
// @__NO_SIDE_EFFECTS__
|
|
11385
|
+
function memo$1(callback) {
|
|
11386
|
+
let result;
|
|
11387
|
+
return () => (result === void 0 && (result = callback()), result);
|
|
11388
|
+
}
|
|
11389
|
+
const progress = /* @__NO_SIDE_EFFECTS__ */ (from, to, value) => {
|
|
11390
|
+
const toFromDifference = to - from;
|
|
11391
|
+
return toFromDifference === 0 ? 1 : (value - from) / toFromDifference;
|
|
11392
|
+
}, secondsToMilliseconds = /* @__NO_SIDE_EFFECTS__ */ (seconds) => seconds * 1e3, millisecondsToSeconds = /* @__NO_SIDE_EFFECTS__ */ (milliseconds) => milliseconds / 1e3, MotionGlobalConfig = {
|
|
11381
11393
|
skipAnimations: !1,
|
|
11382
11394
|
useManualTiming: !1
|
|
11383
11395
|
};
|
|
@@ -11650,7 +11662,7 @@ function isRefObject(ref) {
|
|
|
11650
11662
|
function useMotionRef(visualState, visualElement, externalRef) {
|
|
11651
11663
|
return useCallback(
|
|
11652
11664
|
(instance) => {
|
|
11653
|
-
instance && visualState.
|
|
11665
|
+
instance && visualState.onMount && visualState.onMount(instance), visualElement && (instance ? visualElement.mount(instance) : visualElement.unmount()), externalRef && (typeof externalRef == "function" ? externalRef(instance) : isRefObject(externalRef) && (externalRef.current = instance));
|
|
11654
11666
|
},
|
|
11655
11667
|
/**
|
|
11656
11668
|
* Only pass a new ref callback to React if we've received a visual element
|
|
@@ -11797,83 +11809,6 @@ function isSVGComponent(Component2) {
|
|
|
11797
11809
|
)
|
|
11798
11810
|
);
|
|
11799
11811
|
}
|
|
11800
|
-
function renderHTML(element, { style: style2, vars: vars2 }, styleProp, projection) {
|
|
11801
|
-
Object.assign(element.style, style2, projection && projection.getProjectionStyles(styleProp));
|
|
11802
|
-
for (const key in vars2)
|
|
11803
|
-
element.style.setProperty(key, vars2[key]);
|
|
11804
|
-
}
|
|
11805
|
-
const camelCaseAttributes = /* @__PURE__ */ new Set([
|
|
11806
|
-
"baseFrequency",
|
|
11807
|
-
"diffuseConstant",
|
|
11808
|
-
"kernelMatrix",
|
|
11809
|
-
"kernelUnitLength",
|
|
11810
|
-
"keySplines",
|
|
11811
|
-
"keyTimes",
|
|
11812
|
-
"limitingConeAngle",
|
|
11813
|
-
"markerHeight",
|
|
11814
|
-
"markerWidth",
|
|
11815
|
-
"numOctaves",
|
|
11816
|
-
"targetX",
|
|
11817
|
-
"targetY",
|
|
11818
|
-
"surfaceScale",
|
|
11819
|
-
"specularConstant",
|
|
11820
|
-
"specularExponent",
|
|
11821
|
-
"stdDeviation",
|
|
11822
|
-
"tableValues",
|
|
11823
|
-
"viewBox",
|
|
11824
|
-
"gradientTransform",
|
|
11825
|
-
"pathLength",
|
|
11826
|
-
"startOffset",
|
|
11827
|
-
"textLength",
|
|
11828
|
-
"lengthAdjust"
|
|
11829
|
-
]);
|
|
11830
|
-
function renderSVG(element, renderState, _styleProp, projection) {
|
|
11831
|
-
renderHTML(element, renderState, void 0, projection);
|
|
11832
|
-
for (const key in renderState.attrs)
|
|
11833
|
-
element.setAttribute(camelCaseAttributes.has(key) ? key : camelToDash(key), renderState.attrs[key]);
|
|
11834
|
-
}
|
|
11835
|
-
const isMotionValue = (value) => !!(value && value.getVelocity), scaleCorrectors = {};
|
|
11836
|
-
function addScaleCorrector(correctors) {
|
|
11837
|
-
Object.assign(scaleCorrectors, correctors);
|
|
11838
|
-
}
|
|
11839
|
-
const transformPropOrder = [
|
|
11840
|
-
"transformPerspective",
|
|
11841
|
-
"x",
|
|
11842
|
-
"y",
|
|
11843
|
-
"z",
|
|
11844
|
-
"translateX",
|
|
11845
|
-
"translateY",
|
|
11846
|
-
"translateZ",
|
|
11847
|
-
"scale",
|
|
11848
|
-
"scaleX",
|
|
11849
|
-
"scaleY",
|
|
11850
|
-
"rotate",
|
|
11851
|
-
"rotateX",
|
|
11852
|
-
"rotateY",
|
|
11853
|
-
"rotateZ",
|
|
11854
|
-
"skew",
|
|
11855
|
-
"skewX",
|
|
11856
|
-
"skewY"
|
|
11857
|
-
], transformProps = new Set(transformPropOrder);
|
|
11858
|
-
function isForcedMotionValue(key, { layout: layout2, layoutId }) {
|
|
11859
|
-
return transformProps.has(key) || key.startsWith("origin") || (layout2 || layoutId !== void 0) && (!!scaleCorrectors[key] || key === "opacity");
|
|
11860
|
-
}
|
|
11861
|
-
function scrapeMotionValuesFromProps$1(props, prevProps, visualElement) {
|
|
11862
|
-
var _a;
|
|
11863
|
-
const { style: style2 } = props, newValues = {};
|
|
11864
|
-
for (const key in style2)
|
|
11865
|
-
(isMotionValue(style2[key]) || prevProps.style && isMotionValue(prevProps.style[key]) || isForcedMotionValue(key, props) || ((_a = visualElement?.getValue(key)) === null || _a === void 0 ? void 0 : _a.liveStyle) !== void 0) && (newValues[key] = style2[key]);
|
|
11866
|
-
return newValues;
|
|
11867
|
-
}
|
|
11868
|
-
function scrapeMotionValuesFromProps(props, prevProps, visualElement) {
|
|
11869
|
-
const newValues = scrapeMotionValuesFromProps$1(props, prevProps, visualElement);
|
|
11870
|
-
for (const key in props)
|
|
11871
|
-
if (isMotionValue(props[key]) || isMotionValue(prevProps[key])) {
|
|
11872
|
-
const targetKey = transformPropOrder.indexOf(key) !== -1 ? "attr" + key.charAt(0).toUpperCase() + key.substring(1) : key;
|
|
11873
|
-
newValues[targetKey] = props[key];
|
|
11874
|
-
}
|
|
11875
|
-
return newValues;
|
|
11876
|
-
}
|
|
11877
11812
|
function getValueState(visualElement) {
|
|
11878
11813
|
const state = [{}, {}];
|
|
11879
11814
|
return visualElement?.values.forEach((value, key) => {
|
|
@@ -11891,17 +11826,17 @@ function resolveVariantFromProps(props, definition, custom5, visualElement) {
|
|
|
11891
11826
|
}
|
|
11892
11827
|
return definition;
|
|
11893
11828
|
}
|
|
11894
|
-
const isKeyframesTarget = (v2) => Array.isArray(v2), isCustomValue = (v2) => !!(v2 && typeof v2 == "object" && v2.mix && v2.toValue), resolveFinalValueInKeyframes = (v2) => isKeyframesTarget(v2) ? v2[v2.length - 1] || 0 : v2;
|
|
11829
|
+
const isKeyframesTarget = (v2) => Array.isArray(v2), isCustomValue = (v2) => !!(v2 && typeof v2 == "object" && v2.mix && v2.toValue), resolveFinalValueInKeyframes = (v2) => isKeyframesTarget(v2) ? v2[v2.length - 1] || 0 : v2, isMotionValue = (value) => !!(value && value.getVelocity);
|
|
11895
11830
|
function resolveMotionValue(value) {
|
|
11896
11831
|
const unwrappedValue = isMotionValue(value) ? value.get() : value;
|
|
11897
11832
|
return isCustomValue(unwrappedValue) ? unwrappedValue.toValue() : unwrappedValue;
|
|
11898
11833
|
}
|
|
11899
|
-
function makeState({ scrapeMotionValuesFromProps: scrapeMotionValuesFromProps2, createRenderState,
|
|
11834
|
+
function makeState({ scrapeMotionValuesFromProps: scrapeMotionValuesFromProps2, createRenderState, onUpdate }, props, context, presenceContext) {
|
|
11900
11835
|
const state = {
|
|
11901
11836
|
latestValues: makeLatestValues(props, context, presenceContext, scrapeMotionValuesFromProps2),
|
|
11902
11837
|
renderState: createRenderState()
|
|
11903
11838
|
};
|
|
11904
|
-
return
|
|
11839
|
+
return onUpdate && (state.onMount = (instance) => onUpdate({ props, current: instance, ...state }), state.onUpdate = (visualElement) => onUpdate(visualElement)), state;
|
|
11905
11840
|
}
|
|
11906
11841
|
const makeUseVisualState = (config) => (props, isStatic) => {
|
|
11907
11842
|
const context = useContext(MotionContext), presenceContext = useContext(PresenceContext), make = () => makeState(config, props, context, presenceContext);
|
|
@@ -11938,15 +11873,25 @@ function makeLatestValues(props, context, presenceContext, scrapeMotionValues) {
|
|
|
11938
11873
|
}
|
|
11939
11874
|
return values2;
|
|
11940
11875
|
}
|
|
11941
|
-
const
|
|
11942
|
-
|
|
11943
|
-
|
|
11944
|
-
|
|
11945
|
-
|
|
11946
|
-
|
|
11947
|
-
|
|
11948
|
-
|
|
11949
|
-
|
|
11876
|
+
const transformPropOrder = [
|
|
11877
|
+
"transformPerspective",
|
|
11878
|
+
"x",
|
|
11879
|
+
"y",
|
|
11880
|
+
"z",
|
|
11881
|
+
"translateX",
|
|
11882
|
+
"translateY",
|
|
11883
|
+
"translateZ",
|
|
11884
|
+
"scale",
|
|
11885
|
+
"scaleX",
|
|
11886
|
+
"scaleY",
|
|
11887
|
+
"rotate",
|
|
11888
|
+
"rotateX",
|
|
11889
|
+
"rotateY",
|
|
11890
|
+
"rotateZ",
|
|
11891
|
+
"skew",
|
|
11892
|
+
"skewX",
|
|
11893
|
+
"skewY"
|
|
11894
|
+
], transformProps = new Set(transformPropOrder), checkStringStartsWith = (token) => (key) => typeof key == "string" && key.startsWith(token), isCSSVariableName = /* @__PURE__ */ checkStringStartsWith("--"), startsAsVariableToken = /* @__PURE__ */ checkStringStartsWith("var(--"), isCSSVariableToken = (value) => startsAsVariableToken(value) ? singleCssVariableRegex.test(value.split("/*")[0].trim()) : !1, singleCssVariableRegex = /var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu, getValueAsType = (value, type) => type && typeof value == "number" ? type.transform(value) : value, clamp$1 = (min2, max2, v2) => v2 > max2 ? max2 : v2 < min2 ? min2 : v2, number = {
|
|
11950
11895
|
test: (v2) => typeof v2 == "number",
|
|
11951
11896
|
parse: parseFloat,
|
|
11952
11897
|
transform: (v2) => v2
|
|
@@ -12062,7 +12007,6 @@ function buildTransform(latestValues, transform2, transformTemplate) {
|
|
|
12062
12007
|
}
|
|
12063
12008
|
return transformString = transformString.trim(), transformTemplate ? transformString = transformTemplate(transform2, transformIsDefault ? "" : transformString) : transformIsDefault && (transformString = "none"), transformString;
|
|
12064
12009
|
}
|
|
12065
|
-
const checkStringStartsWith = (token) => (key) => typeof key == "string" && key.startsWith(token), isCSSVariableName = /* @__PURE__ */ checkStringStartsWith("--"), startsAsVariableToken = /* @__PURE__ */ checkStringStartsWith("var(--"), isCSSVariableToken = (value) => startsAsVariableToken(value) ? singleCssVariableRegex.test(value.split("/*")[0].trim()) : !1, singleCssVariableRegex = /var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;
|
|
12066
12010
|
function buildHTMLStyles(state, latestValues, transformTemplate) {
|
|
12067
12011
|
const { style: style2, vars: vars2, transformOrigin } = state;
|
|
12068
12012
|
let hasTransform2 = !1, hasTransformOrigin = !1;
|
|
@@ -12084,13 +12028,6 @@ function buildHTMLStyles(state, latestValues, transformTemplate) {
|
|
|
12084
12028
|
style2.transformOrigin = `${originX} ${originY} ${originZ}`;
|
|
12085
12029
|
}
|
|
12086
12030
|
}
|
|
12087
|
-
function calcOrigin$1(origin, offset2, size2) {
|
|
12088
|
-
return typeof origin == "string" ? origin : px.transform(offset2 + size2 * origin);
|
|
12089
|
-
}
|
|
12090
|
-
function calcSVGTransformOrigin(dimensions, originX, originY) {
|
|
12091
|
-
const pxOriginX = calcOrigin$1(originX, dimensions.x, dimensions.width), pxOriginY = calcOrigin$1(originY, dimensions.y, dimensions.height);
|
|
12092
|
-
return `${pxOriginX} ${pxOriginY}`;
|
|
12093
|
-
}
|
|
12094
12031
|
const dashKeys = {
|
|
12095
12032
|
offset: "stroke-dashoffset",
|
|
12096
12033
|
array: "stroke-dasharray"
|
|
@@ -12105,6 +12042,13 @@ function buildSVGPath(attrs, length, spacing = 1, offset2 = 0, useDashCase = !0)
|
|
|
12105
12042
|
const pathLength = px.transform(length), pathSpacing = px.transform(spacing);
|
|
12106
12043
|
attrs[keys2.array] = `${pathLength} ${pathSpacing}`;
|
|
12107
12044
|
}
|
|
12045
|
+
function calcOrigin$1(origin, offset2, size2) {
|
|
12046
|
+
return typeof origin == "string" ? origin : px.transform(offset2 + size2 * origin);
|
|
12047
|
+
}
|
|
12048
|
+
function calcSVGTransformOrigin(dimensions, originX, originY) {
|
|
12049
|
+
const pxOriginX = calcOrigin$1(originX, dimensions.x, dimensions.width), pxOriginY = calcOrigin$1(originY, dimensions.y, dimensions.height);
|
|
12050
|
+
return `${pxOriginX} ${pxOriginY}`;
|
|
12051
|
+
}
|
|
12108
12052
|
function buildSVGAttrs(state, {
|
|
12109
12053
|
attrX,
|
|
12110
12054
|
attrY,
|
|
@@ -12125,24 +12069,112 @@ function buildSVGAttrs(state, {
|
|
|
12125
12069
|
const { attrs, style: style2, dimensions } = state;
|
|
12126
12070
|
attrs.transform && (dimensions && (style2.transform = attrs.transform), delete attrs.transform), dimensions && (originX !== void 0 || originY !== void 0 || style2.transform) && (style2.transformOrigin = calcSVGTransformOrigin(dimensions, originX !== void 0 ? originX : 0.5, originY !== void 0 ? originY : 0.5)), attrX !== void 0 && (attrs.x = attrX), attrY !== void 0 && (attrs.y = attrY), attrScale !== void 0 && (attrs.scale = attrScale), pathLength !== void 0 && buildSVGPath(attrs, pathLength, pathSpacing, pathOffset, !1);
|
|
12127
12071
|
}
|
|
12128
|
-
const
|
|
12072
|
+
const createHtmlRenderState = () => ({
|
|
12073
|
+
style: {},
|
|
12074
|
+
transform: {},
|
|
12075
|
+
transformOrigin: {},
|
|
12076
|
+
vars: {}
|
|
12077
|
+
}), createSvgRenderState = () => ({
|
|
12078
|
+
...createHtmlRenderState(),
|
|
12079
|
+
attrs: {}
|
|
12080
|
+
}), isSVGTag = (tag) => typeof tag == "string" && tag.toLowerCase() === "svg";
|
|
12081
|
+
function renderHTML(element, { style: style2, vars: vars2 }, styleProp, projection) {
|
|
12082
|
+
Object.assign(element.style, style2, projection && projection.getProjectionStyles(styleProp));
|
|
12083
|
+
for (const key in vars2)
|
|
12084
|
+
element.style.setProperty(key, vars2[key]);
|
|
12085
|
+
}
|
|
12086
|
+
const camelCaseAttributes = /* @__PURE__ */ new Set([
|
|
12087
|
+
"baseFrequency",
|
|
12088
|
+
"diffuseConstant",
|
|
12089
|
+
"kernelMatrix",
|
|
12090
|
+
"kernelUnitLength",
|
|
12091
|
+
"keySplines",
|
|
12092
|
+
"keyTimes",
|
|
12093
|
+
"limitingConeAngle",
|
|
12094
|
+
"markerHeight",
|
|
12095
|
+
"markerWidth",
|
|
12096
|
+
"numOctaves",
|
|
12097
|
+
"targetX",
|
|
12098
|
+
"targetY",
|
|
12099
|
+
"surfaceScale",
|
|
12100
|
+
"specularConstant",
|
|
12101
|
+
"specularExponent",
|
|
12102
|
+
"stdDeviation",
|
|
12103
|
+
"tableValues",
|
|
12104
|
+
"viewBox",
|
|
12105
|
+
"gradientTransform",
|
|
12106
|
+
"pathLength",
|
|
12107
|
+
"startOffset",
|
|
12108
|
+
"textLength",
|
|
12109
|
+
"lengthAdjust"
|
|
12110
|
+
]);
|
|
12111
|
+
function renderSVG(element, renderState, _styleProp, projection) {
|
|
12112
|
+
renderHTML(element, renderState, void 0, projection);
|
|
12113
|
+
for (const key in renderState.attrs)
|
|
12114
|
+
element.setAttribute(camelCaseAttributes.has(key) ? key : camelToDash(key), renderState.attrs[key]);
|
|
12115
|
+
}
|
|
12116
|
+
const scaleCorrectors = {};
|
|
12117
|
+
function addScaleCorrector(correctors) {
|
|
12118
|
+
Object.assign(scaleCorrectors, correctors);
|
|
12119
|
+
}
|
|
12120
|
+
function isForcedMotionValue(key, { layout: layout2, layoutId }) {
|
|
12121
|
+
return transformProps.has(key) || key.startsWith("origin") || (layout2 || layoutId !== void 0) && (!!scaleCorrectors[key] || key === "opacity");
|
|
12122
|
+
}
|
|
12123
|
+
function scrapeMotionValuesFromProps$1(props, prevProps, visualElement) {
|
|
12124
|
+
var _a;
|
|
12125
|
+
const { style: style2 } = props, newValues = {};
|
|
12126
|
+
for (const key in style2)
|
|
12127
|
+
(isMotionValue(style2[key]) || prevProps.style && isMotionValue(prevProps.style[key]) || isForcedMotionValue(key, props) || ((_a = visualElement?.getValue(key)) === null || _a === void 0 ? void 0 : _a.liveStyle) !== void 0) && (newValues[key] = style2[key]);
|
|
12128
|
+
return newValues;
|
|
12129
|
+
}
|
|
12130
|
+
function scrapeMotionValuesFromProps(props, prevProps, visualElement) {
|
|
12131
|
+
const newValues = scrapeMotionValuesFromProps$1(props, prevProps, visualElement);
|
|
12132
|
+
for (const key in props)
|
|
12133
|
+
if (isMotionValue(props[key]) || isMotionValue(prevProps[key])) {
|
|
12134
|
+
const targetKey = transformPropOrder.indexOf(key) !== -1 ? "attr" + key.charAt(0).toUpperCase() + key.substring(1) : key;
|
|
12135
|
+
newValues[targetKey] = props[key];
|
|
12136
|
+
}
|
|
12137
|
+
return newValues;
|
|
12138
|
+
}
|
|
12139
|
+
function updateSVGDimensions(instance, renderState) {
|
|
12140
|
+
try {
|
|
12141
|
+
renderState.dimensions = typeof instance.getBBox == "function" ? instance.getBBox() : instance.getBoundingClientRect();
|
|
12142
|
+
} catch {
|
|
12143
|
+
renderState.dimensions = {
|
|
12144
|
+
x: 0,
|
|
12145
|
+
y: 0,
|
|
12146
|
+
width: 0,
|
|
12147
|
+
height: 0
|
|
12148
|
+
};
|
|
12149
|
+
}
|
|
12150
|
+
}
|
|
12151
|
+
const layoutProps = ["x", "y", "width", "height", "cx", "cy", "r"], svgMotionConfig = {
|
|
12129
12152
|
useVisualState: makeUseVisualState({
|
|
12130
12153
|
scrapeMotionValuesFromProps,
|
|
12131
12154
|
createRenderState: createSvgRenderState,
|
|
12132
|
-
|
|
12133
|
-
|
|
12134
|
-
|
|
12135
|
-
|
|
12136
|
-
|
|
12137
|
-
|
|
12138
|
-
|
|
12139
|
-
|
|
12140
|
-
|
|
12141
|
-
|
|
12142
|
-
|
|
12155
|
+
onUpdate: ({ props, prevProps, current, renderState, latestValues }) => {
|
|
12156
|
+
if (!current)
|
|
12157
|
+
return;
|
|
12158
|
+
let hasTransform2 = !!props.drag;
|
|
12159
|
+
if (!hasTransform2) {
|
|
12160
|
+
for (const key in latestValues)
|
|
12161
|
+
if (transformProps.has(key)) {
|
|
12162
|
+
hasTransform2 = !0;
|
|
12163
|
+
break;
|
|
12164
|
+
}
|
|
12165
|
+
}
|
|
12166
|
+
if (!hasTransform2)
|
|
12167
|
+
return;
|
|
12168
|
+
let needsMeasure = !prevProps;
|
|
12169
|
+
if (prevProps)
|
|
12170
|
+
for (let i2 = 0; i2 < layoutProps.length; i2++) {
|
|
12171
|
+
const key = layoutProps[i2];
|
|
12172
|
+
props[key] !== prevProps[key] && (needsMeasure = !0);
|
|
12143
12173
|
}
|
|
12144
|
-
|
|
12145
|
-
|
|
12174
|
+
needsMeasure && frame$1.read(() => {
|
|
12175
|
+
updateSVGDimensions(current, renderState), frame$1.render(() => {
|
|
12176
|
+
buildSVGAttrs(renderState, latestValues, isSVGTag(current.tagName), props.transformTemplate), renderSVG(current, renderState);
|
|
12177
|
+
});
|
|
12146
12178
|
});
|
|
12147
12179
|
}
|
|
12148
12180
|
})
|
|
@@ -12221,7 +12253,7 @@ function resolveVariant(visualElement, definition, custom5) {
|
|
|
12221
12253
|
const props = visualElement.getProps();
|
|
12222
12254
|
return resolveVariantFromProps(props, definition, custom5 !== void 0 ? custom5 : props.custom, visualElement);
|
|
12223
12255
|
}
|
|
12224
|
-
const supportsScrollTimeline = memo$1(() => window.ScrollTimeline !== void 0);
|
|
12256
|
+
const supportsScrollTimeline = /* @__PURE__ */ memo$1(() => window.ScrollTimeline !== void 0);
|
|
12225
12257
|
class BaseGroupPlaybackControls {
|
|
12226
12258
|
constructor(animations2) {
|
|
12227
12259
|
this.stop = () => this.runAll("stop"), this.animations = animations2.filter(Boolean);
|
|
@@ -12240,7 +12272,12 @@ class BaseGroupPlaybackControls {
|
|
|
12240
12272
|
this.animations[i2][propName] = newValue;
|
|
12241
12273
|
}
|
|
12242
12274
|
attachTimeline(timeline, fallback) {
|
|
12243
|
-
const subscriptions = this.animations.map((animation) =>
|
|
12275
|
+
const subscriptions = this.animations.map((animation) => {
|
|
12276
|
+
if (supportsScrollTimeline() && animation.attachTimeline)
|
|
12277
|
+
return animation.attachTimeline(timeline);
|
|
12278
|
+
if (typeof fallback == "function")
|
|
12279
|
+
return fallback(animation);
|
|
12280
|
+
});
|
|
12244
12281
|
return () => {
|
|
12245
12282
|
subscriptions.forEach((cancel2, i2) => {
|
|
12246
12283
|
cancel2 && cancel2(), this.animations[i2].stop();
|
|
@@ -12309,7 +12346,7 @@ function createGeneratorEasing(options, scale2 = 100, createGenerator) {
|
|
|
12309
12346
|
return {
|
|
12310
12347
|
type: "keyframes",
|
|
12311
12348
|
ease: (progress2) => generator.next(duration * progress2).value / scale2,
|
|
12312
|
-
duration: millisecondsToSeconds(duration)
|
|
12349
|
+
duration: /* @__PURE__ */ millisecondsToSeconds(duration)
|
|
12313
12350
|
};
|
|
12314
12351
|
}
|
|
12315
12352
|
function isGenerator(type) {
|
|
@@ -12322,7 +12359,7 @@ const isBezierDefinition = (easing) => Array.isArray(easing) && typeof easing[0]
|
|
|
12322
12359
|
linearEasing: void 0
|
|
12323
12360
|
};
|
|
12324
12361
|
function memoSupports(callback, supportsFlag) {
|
|
12325
|
-
const memoized = memo$1(callback);
|
|
12362
|
+
const memoized = /* @__PURE__ */ memo$1(callback);
|
|
12326
12363
|
return () => {
|
|
12327
12364
|
var _a;
|
|
12328
12365
|
return (_a = supportsFlags[supportsFlag]) !== null && _a !== void 0 ? _a : memoized();
|
|
@@ -12339,7 +12376,7 @@ const supportsLinearEasing = /* @__PURE__ */ memoSupports(() => {
|
|
|
12339
12376
|
let points = "";
|
|
12340
12377
|
const numPoints = Math.max(Math.round(duration / resolution), 2);
|
|
12341
12378
|
for (let i2 = 0; i2 < numPoints; i2++)
|
|
12342
|
-
points += easing(progress(0, numPoints - 1, i2)) + ", ";
|
|
12379
|
+
points += easing(/* @__PURE__ */ progress(0, numPoints - 1, i2)) + ", ";
|
|
12343
12380
|
return `linear(${points.substring(0, points.length - 2)})`;
|
|
12344
12381
|
};
|
|
12345
12382
|
function isWaapiSupportedEasing(easing) {
|
|
@@ -12468,6 +12505,15 @@ function setDragLock(axis) {
|
|
|
12468
12505
|
isDragging.x = isDragging.y = !1;
|
|
12469
12506
|
});
|
|
12470
12507
|
}
|
|
12508
|
+
const positionalKeys = /* @__PURE__ */ new Set([
|
|
12509
|
+
"width",
|
|
12510
|
+
"height",
|
|
12511
|
+
"top",
|
|
12512
|
+
"left",
|
|
12513
|
+
"right",
|
|
12514
|
+
"bottom",
|
|
12515
|
+
...transformPropOrder
|
|
12516
|
+
]);
|
|
12471
12517
|
let now$1;
|
|
12472
12518
|
function clearTime() {
|
|
12473
12519
|
now$1 = void 0;
|
|
@@ -12524,7 +12570,7 @@ class MotionValue {
|
|
|
12524
12570
|
* @internal
|
|
12525
12571
|
*/
|
|
12526
12572
|
constructor(init2, options = {}) {
|
|
12527
|
-
this.version = "11.
|
|
12573
|
+
this.version = "11.18.2", this.canTrackVelocity = null, this.events = {}, this.updateAndNotify = (v2, render = !0) => {
|
|
12528
12574
|
const currentTime = time$1.now();
|
|
12529
12575
|
this.updatedAt !== currentTime && this.setPrevFrameValue(), this.prev = this.current, this.setCurrent(v2), this.current !== this.prev && this.events.change && this.events.change.notify(this.current), render && this.events.renderRequest && this.events.renderRequest.notify(this.current);
|
|
12530
12576
|
}, this.hasAnimated = !1, this.setCurrent(init2), this.owner = options.owner;
|
|
@@ -12752,144 +12798,6 @@ const mirrorEasing = (easing) => (p2) => p2 <= 0.5 ? easing(2 * p2) / 2 : (2 - e
|
|
|
12752
12798
|
function isNone(value) {
|
|
12753
12799
|
return typeof value == "number" ? value === 0 : value !== null ? value === "none" || value === "0" || isZeroValueString(value) : !0;
|
|
12754
12800
|
}
|
|
12755
|
-
const isNumericalString = (v2) => /^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(v2), splitCSSVariableRegex = (
|
|
12756
|
-
// eslint-disable-next-line redos-detector/no-unsafe-regex -- false positive, as it can match a lot of words
|
|
12757
|
-
/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u
|
|
12758
|
-
);
|
|
12759
|
-
function parseCSSVariable(current) {
|
|
12760
|
-
const match = splitCSSVariableRegex.exec(current);
|
|
12761
|
-
if (!match)
|
|
12762
|
-
return [,];
|
|
12763
|
-
const [, token1, token2, fallback] = match;
|
|
12764
|
-
return [`--${token1 ?? token2}`, fallback];
|
|
12765
|
-
}
|
|
12766
|
-
function getVariableValue(current, element, depth = 1) {
|
|
12767
|
-
const [token, fallback] = parseCSSVariable(current);
|
|
12768
|
-
if (!token)
|
|
12769
|
-
return;
|
|
12770
|
-
const resolved = window.getComputedStyle(element).getPropertyValue(token);
|
|
12771
|
-
if (resolved) {
|
|
12772
|
-
const trimmed = resolved.trim();
|
|
12773
|
-
return isNumericalString(trimmed) ? parseFloat(trimmed) : trimmed;
|
|
12774
|
-
}
|
|
12775
|
-
return isCSSVariableToken(fallback) ? getVariableValue(fallback, element, depth + 1) : fallback;
|
|
12776
|
-
}
|
|
12777
|
-
const positionalKeys = /* @__PURE__ */ new Set([
|
|
12778
|
-
"width",
|
|
12779
|
-
"height",
|
|
12780
|
-
"top",
|
|
12781
|
-
"left",
|
|
12782
|
-
"right",
|
|
12783
|
-
"bottom",
|
|
12784
|
-
"x",
|
|
12785
|
-
"y",
|
|
12786
|
-
"translateX",
|
|
12787
|
-
"translateY"
|
|
12788
|
-
]), isNumOrPxType = (v2) => v2 === number || v2 === px, getPosFromMatrix = (matrix, pos) => parseFloat(matrix.split(", ")[pos]), getTranslateFromMatrix = (pos2, pos3) => (_bbox, { transform: transform2 }) => {
|
|
12789
|
-
if (transform2 === "none" || !transform2)
|
|
12790
|
-
return 0;
|
|
12791
|
-
const matrix3d = transform2.match(/^matrix3d\((.+)\)$/u);
|
|
12792
|
-
if (matrix3d)
|
|
12793
|
-
return getPosFromMatrix(matrix3d[1], pos3);
|
|
12794
|
-
{
|
|
12795
|
-
const matrix = transform2.match(/^matrix\((.+)\)$/u);
|
|
12796
|
-
return matrix ? getPosFromMatrix(matrix[1], pos2) : 0;
|
|
12797
|
-
}
|
|
12798
|
-
}, transformKeys = /* @__PURE__ */ new Set(["x", "y", "z"]), nonTranslationalTransformKeys = transformPropOrder.filter((key) => !transformKeys.has(key));
|
|
12799
|
-
function removeNonTranslationalTransform(visualElement) {
|
|
12800
|
-
const removedTransforms = [];
|
|
12801
|
-
return nonTranslationalTransformKeys.forEach((key) => {
|
|
12802
|
-
const value = visualElement.getValue(key);
|
|
12803
|
-
value !== void 0 && (removedTransforms.push([key, value.get()]), value.set(key.startsWith("scale") ? 1 : 0));
|
|
12804
|
-
}), removedTransforms;
|
|
12805
|
-
}
|
|
12806
|
-
const positionalValues = {
|
|
12807
|
-
// Dimensions
|
|
12808
|
-
width: ({ x: x2 }, { paddingLeft = "0", paddingRight = "0" }) => x2.max - x2.min - parseFloat(paddingLeft) - parseFloat(paddingRight),
|
|
12809
|
-
height: ({ y: y2 }, { paddingTop = "0", paddingBottom = "0" }) => y2.max - y2.min - parseFloat(paddingTop) - parseFloat(paddingBottom),
|
|
12810
|
-
top: (_bbox, { top }) => parseFloat(top),
|
|
12811
|
-
left: (_bbox, { left }) => parseFloat(left),
|
|
12812
|
-
bottom: ({ y: y2 }, { top }) => parseFloat(top) + (y2.max - y2.min),
|
|
12813
|
-
right: ({ x: x2 }, { left }) => parseFloat(left) + (x2.max - x2.min),
|
|
12814
|
-
// Transform
|
|
12815
|
-
x: getTranslateFromMatrix(4, 13),
|
|
12816
|
-
y: getTranslateFromMatrix(5, 14)
|
|
12817
|
-
};
|
|
12818
|
-
positionalValues.translateX = positionalValues.x;
|
|
12819
|
-
positionalValues.translateY = positionalValues.y;
|
|
12820
|
-
const testValueType = (v2) => (type) => type.test(v2), auto = {
|
|
12821
|
-
test: (v2) => v2 === "auto",
|
|
12822
|
-
parse: (v2) => v2
|
|
12823
|
-
}, dimensionValueTypes = [number, px, percent, degrees$1, vw, vh, auto], findDimensionValueType = (v2) => dimensionValueTypes.find(testValueType(v2)), toResolve = /* @__PURE__ */ new Set();
|
|
12824
|
-
let isScheduled = !1, anyNeedsMeasurement = !1;
|
|
12825
|
-
function measureAllKeyframes() {
|
|
12826
|
-
if (anyNeedsMeasurement) {
|
|
12827
|
-
const resolversToMeasure = Array.from(toResolve).filter((resolver) => resolver.needsMeasurement), elementsToMeasure = new Set(resolversToMeasure.map((resolver) => resolver.element)), transformsToRestore = /* @__PURE__ */ new Map();
|
|
12828
|
-
elementsToMeasure.forEach((element) => {
|
|
12829
|
-
const removedTransforms = removeNonTranslationalTransform(element);
|
|
12830
|
-
removedTransforms.length && (transformsToRestore.set(element, removedTransforms), element.render());
|
|
12831
|
-
}), resolversToMeasure.forEach((resolver) => resolver.measureInitialState()), elementsToMeasure.forEach((element) => {
|
|
12832
|
-
element.render();
|
|
12833
|
-
const restore = transformsToRestore.get(element);
|
|
12834
|
-
restore && restore.forEach(([key, value]) => {
|
|
12835
|
-
var _a;
|
|
12836
|
-
(_a = element.getValue(key)) === null || _a === void 0 || _a.set(value);
|
|
12837
|
-
});
|
|
12838
|
-
}), resolversToMeasure.forEach((resolver) => resolver.measureEndState()), resolversToMeasure.forEach((resolver) => {
|
|
12839
|
-
resolver.suspendedScrollY !== void 0 && window.scrollTo(0, resolver.suspendedScrollY);
|
|
12840
|
-
});
|
|
12841
|
-
}
|
|
12842
|
-
anyNeedsMeasurement = !1, isScheduled = !1, toResolve.forEach((resolver) => resolver.complete()), toResolve.clear();
|
|
12843
|
-
}
|
|
12844
|
-
function readAllKeyframes() {
|
|
12845
|
-
toResolve.forEach((resolver) => {
|
|
12846
|
-
resolver.readKeyframes(), resolver.needsMeasurement && (anyNeedsMeasurement = !0);
|
|
12847
|
-
});
|
|
12848
|
-
}
|
|
12849
|
-
function flushKeyframeResolvers() {
|
|
12850
|
-
readAllKeyframes(), measureAllKeyframes();
|
|
12851
|
-
}
|
|
12852
|
-
class KeyframeResolver {
|
|
12853
|
-
constructor(unresolvedKeyframes, onComplete, name, motionValue2, element, isAsync = !1) {
|
|
12854
|
-
this.isComplete = !1, this.isAsync = !1, this.needsMeasurement = !1, this.isScheduled = !1, this.unresolvedKeyframes = [...unresolvedKeyframes], this.onComplete = onComplete, this.name = name, this.motionValue = motionValue2, this.element = element, this.isAsync = isAsync;
|
|
12855
|
-
}
|
|
12856
|
-
scheduleResolve() {
|
|
12857
|
-
this.isScheduled = !0, this.isAsync ? (toResolve.add(this), isScheduled || (isScheduled = !0, frame$1.read(readAllKeyframes), frame$1.resolveKeyframes(measureAllKeyframes))) : (this.readKeyframes(), this.complete());
|
|
12858
|
-
}
|
|
12859
|
-
readKeyframes() {
|
|
12860
|
-
const { unresolvedKeyframes, name, element, motionValue: motionValue2 } = this;
|
|
12861
|
-
for (let i2 = 0; i2 < unresolvedKeyframes.length; i2++)
|
|
12862
|
-
if (unresolvedKeyframes[i2] === null)
|
|
12863
|
-
if (i2 === 0) {
|
|
12864
|
-
const currentValue = motionValue2?.get(), finalKeyframe = unresolvedKeyframes[unresolvedKeyframes.length - 1];
|
|
12865
|
-
if (currentValue !== void 0)
|
|
12866
|
-
unresolvedKeyframes[0] = currentValue;
|
|
12867
|
-
else if (element && name) {
|
|
12868
|
-
const valueAsRead = element.readValue(name, finalKeyframe);
|
|
12869
|
-
valueAsRead != null && (unresolvedKeyframes[0] = valueAsRead);
|
|
12870
|
-
}
|
|
12871
|
-
unresolvedKeyframes[0] === void 0 && (unresolvedKeyframes[0] = finalKeyframe), motionValue2 && currentValue === void 0 && motionValue2.set(unresolvedKeyframes[0]);
|
|
12872
|
-
} else
|
|
12873
|
-
unresolvedKeyframes[i2] = unresolvedKeyframes[i2 - 1];
|
|
12874
|
-
}
|
|
12875
|
-
setFinalKeyframe() {
|
|
12876
|
-
}
|
|
12877
|
-
measureInitialState() {
|
|
12878
|
-
}
|
|
12879
|
-
renderEndStyles() {
|
|
12880
|
-
}
|
|
12881
|
-
measureEndState() {
|
|
12882
|
-
}
|
|
12883
|
-
complete() {
|
|
12884
|
-
this.isComplete = !0, this.onComplete(this.unresolvedKeyframes, this.finalKeyframe), toResolve.delete(this);
|
|
12885
|
-
}
|
|
12886
|
-
cancel() {
|
|
12887
|
-
this.isComplete || (this.isScheduled = !1, toResolve.delete(this));
|
|
12888
|
-
}
|
|
12889
|
-
resume() {
|
|
12890
|
-
this.isComplete || this.scheduleResolve();
|
|
12891
|
-
}
|
|
12892
|
-
}
|
|
12893
12801
|
const sanitize = (v2) => Math.round(v2 * 1e5) / 1e5, floatRegex = /-?(?:\d+(?:\.\d+)?|\.\d+)/gu;
|
|
12894
12802
|
function isNullish(v2) {
|
|
12895
12803
|
return v2 == null;
|
|
@@ -13024,6 +12932,134 @@ function makeNoneKeyframesAnimatable(unresolvedKeyframes, noneKeyframeIndexes, n
|
|
|
13024
12932
|
for (const noneIndex of noneKeyframeIndexes)
|
|
13025
12933
|
unresolvedKeyframes[noneIndex] = getAnimatableNone(name, animatableTemplate);
|
|
13026
12934
|
}
|
|
12935
|
+
const isNumOrPxType = (v2) => v2 === number || v2 === px, getPosFromMatrix = (matrix, pos) => parseFloat(matrix.split(", ")[pos]), getTranslateFromMatrix = (pos2, pos3) => (_bbox, { transform: transform2 }) => {
|
|
12936
|
+
if (transform2 === "none" || !transform2)
|
|
12937
|
+
return 0;
|
|
12938
|
+
const matrix3d = transform2.match(/^matrix3d\((.+)\)$/u);
|
|
12939
|
+
if (matrix3d)
|
|
12940
|
+
return getPosFromMatrix(matrix3d[1], pos3);
|
|
12941
|
+
{
|
|
12942
|
+
const matrix = transform2.match(/^matrix\((.+)\)$/u);
|
|
12943
|
+
return matrix ? getPosFromMatrix(matrix[1], pos2) : 0;
|
|
12944
|
+
}
|
|
12945
|
+
}, transformKeys = /* @__PURE__ */ new Set(["x", "y", "z"]), nonTranslationalTransformKeys = transformPropOrder.filter((key) => !transformKeys.has(key));
|
|
12946
|
+
function removeNonTranslationalTransform(visualElement) {
|
|
12947
|
+
const removedTransforms = [];
|
|
12948
|
+
return nonTranslationalTransformKeys.forEach((key) => {
|
|
12949
|
+
const value = visualElement.getValue(key);
|
|
12950
|
+
value !== void 0 && (removedTransforms.push([key, value.get()]), value.set(key.startsWith("scale") ? 1 : 0));
|
|
12951
|
+
}), removedTransforms;
|
|
12952
|
+
}
|
|
12953
|
+
const positionalValues = {
|
|
12954
|
+
// Dimensions
|
|
12955
|
+
width: ({ x: x2 }, { paddingLeft = "0", paddingRight = "0" }) => x2.max - x2.min - parseFloat(paddingLeft) - parseFloat(paddingRight),
|
|
12956
|
+
height: ({ y: y2 }, { paddingTop = "0", paddingBottom = "0" }) => y2.max - y2.min - parseFloat(paddingTop) - parseFloat(paddingBottom),
|
|
12957
|
+
top: (_bbox, { top }) => parseFloat(top),
|
|
12958
|
+
left: (_bbox, { left }) => parseFloat(left),
|
|
12959
|
+
bottom: ({ y: y2 }, { top }) => parseFloat(top) + (y2.max - y2.min),
|
|
12960
|
+
right: ({ x: x2 }, { left }) => parseFloat(left) + (x2.max - x2.min),
|
|
12961
|
+
// Transform
|
|
12962
|
+
x: getTranslateFromMatrix(4, 13),
|
|
12963
|
+
y: getTranslateFromMatrix(5, 14)
|
|
12964
|
+
};
|
|
12965
|
+
positionalValues.translateX = positionalValues.x;
|
|
12966
|
+
positionalValues.translateY = positionalValues.y;
|
|
12967
|
+
const toResolve = /* @__PURE__ */ new Set();
|
|
12968
|
+
let isScheduled = !1, anyNeedsMeasurement = !1;
|
|
12969
|
+
function measureAllKeyframes() {
|
|
12970
|
+
if (anyNeedsMeasurement) {
|
|
12971
|
+
const resolversToMeasure = Array.from(toResolve).filter((resolver) => resolver.needsMeasurement), elementsToMeasure = new Set(resolversToMeasure.map((resolver) => resolver.element)), transformsToRestore = /* @__PURE__ */ new Map();
|
|
12972
|
+
elementsToMeasure.forEach((element) => {
|
|
12973
|
+
const removedTransforms = removeNonTranslationalTransform(element);
|
|
12974
|
+
removedTransforms.length && (transformsToRestore.set(element, removedTransforms), element.render());
|
|
12975
|
+
}), resolversToMeasure.forEach((resolver) => resolver.measureInitialState()), elementsToMeasure.forEach((element) => {
|
|
12976
|
+
element.render();
|
|
12977
|
+
const restore = transformsToRestore.get(element);
|
|
12978
|
+
restore && restore.forEach(([key, value]) => {
|
|
12979
|
+
var _a;
|
|
12980
|
+
(_a = element.getValue(key)) === null || _a === void 0 || _a.set(value);
|
|
12981
|
+
});
|
|
12982
|
+
}), resolversToMeasure.forEach((resolver) => resolver.measureEndState()), resolversToMeasure.forEach((resolver) => {
|
|
12983
|
+
resolver.suspendedScrollY !== void 0 && window.scrollTo(0, resolver.suspendedScrollY);
|
|
12984
|
+
});
|
|
12985
|
+
}
|
|
12986
|
+
anyNeedsMeasurement = !1, isScheduled = !1, toResolve.forEach((resolver) => resolver.complete()), toResolve.clear();
|
|
12987
|
+
}
|
|
12988
|
+
function readAllKeyframes() {
|
|
12989
|
+
toResolve.forEach((resolver) => {
|
|
12990
|
+
resolver.readKeyframes(), resolver.needsMeasurement && (anyNeedsMeasurement = !0);
|
|
12991
|
+
});
|
|
12992
|
+
}
|
|
12993
|
+
function flushKeyframeResolvers() {
|
|
12994
|
+
readAllKeyframes(), measureAllKeyframes();
|
|
12995
|
+
}
|
|
12996
|
+
class KeyframeResolver {
|
|
12997
|
+
constructor(unresolvedKeyframes, onComplete, name, motionValue2, element, isAsync = !1) {
|
|
12998
|
+
this.isComplete = !1, this.isAsync = !1, this.needsMeasurement = !1, this.isScheduled = !1, this.unresolvedKeyframes = [...unresolvedKeyframes], this.onComplete = onComplete, this.name = name, this.motionValue = motionValue2, this.element = element, this.isAsync = isAsync;
|
|
12999
|
+
}
|
|
13000
|
+
scheduleResolve() {
|
|
13001
|
+
this.isScheduled = !0, this.isAsync ? (toResolve.add(this), isScheduled || (isScheduled = !0, frame$1.read(readAllKeyframes), frame$1.resolveKeyframes(measureAllKeyframes))) : (this.readKeyframes(), this.complete());
|
|
13002
|
+
}
|
|
13003
|
+
readKeyframes() {
|
|
13004
|
+
const { unresolvedKeyframes, name, element, motionValue: motionValue2 } = this;
|
|
13005
|
+
for (let i2 = 0; i2 < unresolvedKeyframes.length; i2++)
|
|
13006
|
+
if (unresolvedKeyframes[i2] === null)
|
|
13007
|
+
if (i2 === 0) {
|
|
13008
|
+
const currentValue = motionValue2?.get(), finalKeyframe = unresolvedKeyframes[unresolvedKeyframes.length - 1];
|
|
13009
|
+
if (currentValue !== void 0)
|
|
13010
|
+
unresolvedKeyframes[0] = currentValue;
|
|
13011
|
+
else if (element && name) {
|
|
13012
|
+
const valueAsRead = element.readValue(name, finalKeyframe);
|
|
13013
|
+
valueAsRead != null && (unresolvedKeyframes[0] = valueAsRead);
|
|
13014
|
+
}
|
|
13015
|
+
unresolvedKeyframes[0] === void 0 && (unresolvedKeyframes[0] = finalKeyframe), motionValue2 && currentValue === void 0 && motionValue2.set(unresolvedKeyframes[0]);
|
|
13016
|
+
} else
|
|
13017
|
+
unresolvedKeyframes[i2] = unresolvedKeyframes[i2 - 1];
|
|
13018
|
+
}
|
|
13019
|
+
setFinalKeyframe() {
|
|
13020
|
+
}
|
|
13021
|
+
measureInitialState() {
|
|
13022
|
+
}
|
|
13023
|
+
renderEndStyles() {
|
|
13024
|
+
}
|
|
13025
|
+
measureEndState() {
|
|
13026
|
+
}
|
|
13027
|
+
complete() {
|
|
13028
|
+
this.isComplete = !0, this.onComplete(this.unresolvedKeyframes, this.finalKeyframe), toResolve.delete(this);
|
|
13029
|
+
}
|
|
13030
|
+
cancel() {
|
|
13031
|
+
this.isComplete || (this.isScheduled = !1, toResolve.delete(this));
|
|
13032
|
+
}
|
|
13033
|
+
resume() {
|
|
13034
|
+
this.isComplete || this.scheduleResolve();
|
|
13035
|
+
}
|
|
13036
|
+
}
|
|
13037
|
+
const isNumericalString = (v2) => /^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(v2), splitCSSVariableRegex = (
|
|
13038
|
+
// eslint-disable-next-line redos-detector/no-unsafe-regex -- false positive, as it can match a lot of words
|
|
13039
|
+
/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u
|
|
13040
|
+
);
|
|
13041
|
+
function parseCSSVariable(current) {
|
|
13042
|
+
const match = splitCSSVariableRegex.exec(current);
|
|
13043
|
+
if (!match)
|
|
13044
|
+
return [,];
|
|
13045
|
+
const [, token1, token2, fallback] = match;
|
|
13046
|
+
return [`--${token1 ?? token2}`, fallback];
|
|
13047
|
+
}
|
|
13048
|
+
function getVariableValue(current, element, depth = 1) {
|
|
13049
|
+
const [token, fallback] = parseCSSVariable(current);
|
|
13050
|
+
if (!token)
|
|
13051
|
+
return;
|
|
13052
|
+
const resolved = window.getComputedStyle(element).getPropertyValue(token);
|
|
13053
|
+
if (resolved) {
|
|
13054
|
+
const trimmed = resolved.trim();
|
|
13055
|
+
return isNumericalString(trimmed) ? parseFloat(trimmed) : trimmed;
|
|
13056
|
+
}
|
|
13057
|
+
return isCSSVariableToken(fallback) ? getVariableValue(fallback, element, depth + 1) : fallback;
|
|
13058
|
+
}
|
|
13059
|
+
const testValueType = (v2) => (type) => type.test(v2), auto = {
|
|
13060
|
+
test: (v2) => v2 === "auto",
|
|
13061
|
+
parse: (v2) => v2
|
|
13062
|
+
}, dimensionValueTypes = [number, px, percent, degrees$1, vw, vh, auto], findDimensionValueType = (v2) => dimensionValueTypes.find(testValueType(v2));
|
|
13027
13063
|
class DOMKeyframesResolver extends KeyframeResolver {
|
|
13028
13064
|
constructor(unresolvedKeyframes, onComplete, name, motionValue2, element) {
|
|
13029
13065
|
super(unresolvedKeyframes, onComplete, name, motionValue2, element, !0);
|
|
@@ -13150,7 +13186,7 @@ class BaseAnimation {
|
|
|
13150
13186
|
if (delay2)
|
|
13151
13187
|
this.options.duration = 0;
|
|
13152
13188
|
else {
|
|
13153
|
-
onUpdate
|
|
13189
|
+
onUpdate && onUpdate(getFinalKeyframe(keyframes2, this.options, finalKeyframe)), onComplete && onComplete(), this.resolveFinishedPromise();
|
|
13154
13190
|
return;
|
|
13155
13191
|
}
|
|
13156
13192
|
const resolvedAnimation = this.initPlayback(keyframes2, finalKeyframe);
|
|
@@ -13299,7 +13335,7 @@ const springDefaults = {
|
|
|
13299
13335
|
}, safeMin = 1e-3;
|
|
13300
13336
|
function findSpring({ duration = springDefaults.duration, bounce = springDefaults.bounce, velocity = springDefaults.velocity, mass = springDefaults.mass }) {
|
|
13301
13337
|
let envelope, derivative, dampingRatio = 1 - bounce;
|
|
13302
|
-
dampingRatio = clamp$1(springDefaults.minDamping, springDefaults.maxDamping, dampingRatio), duration = clamp$1(springDefaults.minDuration, springDefaults.maxDuration, millisecondsToSeconds(duration)), dampingRatio < 1 ? (envelope = (undampedFreq2) => {
|
|
13338
|
+
dampingRatio = clamp$1(springDefaults.minDamping, springDefaults.maxDamping, dampingRatio), duration = clamp$1(springDefaults.minDuration, springDefaults.maxDuration, /* @__PURE__ */ millisecondsToSeconds(duration)), dampingRatio < 1 ? (envelope = (undampedFreq2) => {
|
|
13303
13339
|
const exponentialDecay = undampedFreq2 * dampingRatio, delta = exponentialDecay * duration, a2 = exponentialDecay - velocity, b2 = calcAngularFreq(undampedFreq2, dampingRatio), c2 = Math.exp(-delta);
|
|
13304
13340
|
return safeMin - a2 / b2 * c2;
|
|
13305
13341
|
}, derivative = (undampedFreq2) => {
|
|
@@ -13313,7 +13349,7 @@ function findSpring({ duration = springDefaults.duration, bounce = springDefault
|
|
|
13313
13349
|
return a2 * b2;
|
|
13314
13350
|
});
|
|
13315
13351
|
const initialGuess = 5 / duration, undampedFreq = approximateRoot(envelope, derivative, initialGuess);
|
|
13316
|
-
if (duration = secondsToMilliseconds(duration), isNaN(undampedFreq))
|
|
13352
|
+
if (duration = /* @__PURE__ */ secondsToMilliseconds(duration), isNaN(undampedFreq))
|
|
13317
13353
|
return {
|
|
13318
13354
|
stiffness: springDefaults.stiffness,
|
|
13319
13355
|
damping: springDefaults.damping,
|
|
@@ -13379,8 +13415,8 @@ function spring(optionsOrVisualDuration = springDefaults.visualDuration, bounce
|
|
|
13379
13415
|
let { restSpeed, restDelta } = options;
|
|
13380
13416
|
const origin = options.keyframes[0], target = options.keyframes[options.keyframes.length - 1], state = { done: !1, value: origin }, { stiffness, damping, mass, duration, velocity, isResolvedFromDuration } = getSpringOptions({
|
|
13381
13417
|
...options,
|
|
13382
|
-
velocity:
|
|
13383
|
-
}), initialVelocity = velocity || 0, dampingRatio = damping / (2 * Math.sqrt(stiffness * mass)), initialDelta = target - origin, undampedAngularFreq = millisecondsToSeconds(Math.sqrt(stiffness / mass)), isGranularScale = Math.abs(initialDelta) < 5;
|
|
13418
|
+
velocity: -/* @__PURE__ */ millisecondsToSeconds(options.velocity || 0)
|
|
13419
|
+
}), initialVelocity = velocity || 0, dampingRatio = damping / (2 * Math.sqrt(stiffness * mass)), initialDelta = target - origin, undampedAngularFreq = /* @__PURE__ */ millisecondsToSeconds(Math.sqrt(stiffness / mass)), isGranularScale = Math.abs(initialDelta) < 5;
|
|
13384
13420
|
restSpeed || (restSpeed = isGranularScale ? springDefaults.restSpeed.granular : springDefaults.restSpeed.default), restDelta || (restDelta = isGranularScale ? springDefaults.restDelta.granular : springDefaults.restDelta.default);
|
|
13385
13421
|
let resolveSpring;
|
|
13386
13422
|
if (dampingRatio < 1) {
|
|
@@ -13406,7 +13442,7 @@ function spring(optionsOrVisualDuration = springDefaults.visualDuration, bounce
|
|
|
13406
13442
|
state.done = t2 >= duration;
|
|
13407
13443
|
else {
|
|
13408
13444
|
let currentVelocity = 0;
|
|
13409
|
-
dampingRatio < 1 && (currentVelocity = t2 === 0 ? secondsToMilliseconds(initialVelocity) : calcGeneratorVelocity(resolveSpring, t2, current));
|
|
13445
|
+
dampingRatio < 1 && (currentVelocity = t2 === 0 ? /* @__PURE__ */ secondsToMilliseconds(initialVelocity) : calcGeneratorVelocity(resolveSpring, t2, current));
|
|
13410
13446
|
const isBelowVelocityThreshold = Math.abs(currentVelocity) <= restSpeed, isBelowDisplacementThreshold = Math.abs(target - current) <= restDelta;
|
|
13411
13447
|
state.done = isBelowVelocityThreshold && isBelowDisplacementThreshold;
|
|
13412
13448
|
}
|
|
@@ -13488,15 +13524,18 @@ function interpolate$1(input, output, { clamp: isClamp = !0, ease: ease2, mixer
|
|
|
13488
13524
|
const inputLength = input.length;
|
|
13489
13525
|
if (invariant(inputLength === output.length), inputLength === 1)
|
|
13490
13526
|
return () => output[0];
|
|
13491
|
-
if (inputLength === 2 &&
|
|
13527
|
+
if (inputLength === 2 && output[0] === output[1])
|
|
13492
13528
|
return () => output[1];
|
|
13529
|
+
const isZeroDeltaRange = input[0] === input[1];
|
|
13493
13530
|
input[0] > input[inputLength - 1] && (input = [...input].reverse(), output = [...output].reverse());
|
|
13494
13531
|
const mixers = createMixers(output, ease2, mixer), numMixers = mixers.length, interpolator = (v2) => {
|
|
13532
|
+
if (isZeroDeltaRange && v2 < input[0])
|
|
13533
|
+
return output[0];
|
|
13495
13534
|
let i2 = 0;
|
|
13496
13535
|
if (numMixers > 1)
|
|
13497
13536
|
for (; i2 < input.length - 2 && !(v2 < input[i2 + 1]); i2++)
|
|
13498
13537
|
;
|
|
13499
|
-
const progressInRange = progress(input[i2], input[i2 + 1], v2);
|
|
13538
|
+
const progressInRange = /* @__PURE__ */ progress(input[i2], input[i2 + 1], v2);
|
|
13500
13539
|
return mixers[i2](progressInRange);
|
|
13501
13540
|
};
|
|
13502
13541
|
return isClamp ? (v2) => interpolator(clamp$1(input[0], input[inputLength - 1], v2)) : interpolator;
|
|
@@ -13504,7 +13543,7 @@ function interpolate$1(input, output, { clamp: isClamp = !0, ease: ease2, mixer
|
|
|
13504
13543
|
function fillOffset(offset2, remaining) {
|
|
13505
13544
|
const min2 = offset2[offset2.length - 1];
|
|
13506
13545
|
for (let i2 = 1; i2 <= remaining; i2++) {
|
|
13507
|
-
const offsetProgress = progress(0, remaining, i2);
|
|
13546
|
+
const offsetProgress = /* @__PURE__ */ progress(0, remaining, i2);
|
|
13508
13547
|
offset2.push(mixNumber$1(min2, 1, offsetProgress));
|
|
13509
13548
|
}
|
|
13510
13549
|
}
|
|
@@ -13620,20 +13659,20 @@ class MainThreadAnimation extends BaseAnimation {
|
|
|
13620
13659
|
}
|
|
13621
13660
|
get duration() {
|
|
13622
13661
|
const { resolved } = this;
|
|
13623
|
-
return resolved ? millisecondsToSeconds(resolved.calculatedDuration) : 0;
|
|
13662
|
+
return resolved ? /* @__PURE__ */ millisecondsToSeconds(resolved.calculatedDuration) : 0;
|
|
13624
13663
|
}
|
|
13625
13664
|
get time() {
|
|
13626
|
-
return millisecondsToSeconds(this.currentTime);
|
|
13665
|
+
return /* @__PURE__ */ millisecondsToSeconds(this.currentTime);
|
|
13627
13666
|
}
|
|
13628
13667
|
set time(newTime) {
|
|
13629
|
-
newTime = secondsToMilliseconds(newTime), this.currentTime = newTime, this.holdTime !== null || this.speed === 0 ? this.holdTime = newTime : this.driver && (this.startTime = this.driver.now() - newTime / this.speed);
|
|
13668
|
+
newTime = /* @__PURE__ */ secondsToMilliseconds(newTime), this.currentTime = newTime, this.holdTime !== null || this.speed === 0 ? this.holdTime = newTime : this.driver && (this.startTime = this.driver.now() - newTime / this.speed);
|
|
13630
13669
|
}
|
|
13631
13670
|
get speed() {
|
|
13632
13671
|
return this.playbackSpeed;
|
|
13633
13672
|
}
|
|
13634
13673
|
set speed(newSpeed) {
|
|
13635
13674
|
const hasChanged = this.playbackSpeed !== newSpeed;
|
|
13636
|
-
this.playbackSpeed = newSpeed, hasChanged && (this.time = millisecondsToSeconds(this.currentTime));
|
|
13675
|
+
this.playbackSpeed = newSpeed, hasChanged && (this.time = /* @__PURE__ */ millisecondsToSeconds(this.currentTime));
|
|
13637
13676
|
}
|
|
13638
13677
|
play() {
|
|
13639
13678
|
if (this.resolver.isScheduled || this.resolver.resume(), !this._resolved) {
|
|
@@ -13737,9 +13776,8 @@ class AcceleratedAnimation extends BaseAnimation {
|
|
|
13737
13776
|
this.resolver = new DOMKeyframesResolver(keyframes2, (resolvedKeyframes, finalKeyframe) => this.onKeyframesResolved(resolvedKeyframes, finalKeyframe), name, motionValue2, element), this.resolver.scheduleResolve();
|
|
13738
13777
|
}
|
|
13739
13778
|
initPlayback(keyframes2, finalKeyframe) {
|
|
13740
|
-
var _a;
|
|
13741
13779
|
let { duration = 300, times, ease: ease2, type, motionValue: motionValue2, name, startTime } = this.options;
|
|
13742
|
-
if (!
|
|
13780
|
+
if (!motionValue2.owner || !motionValue2.owner.current)
|
|
13743
13781
|
return !1;
|
|
13744
13782
|
if (typeof ease2 == "string" && supportsLinearEasing() && isUnsupportedEase(ease2) && (ease2 = unsupportedEasingFunctions[ease2]), requiresPregeneratedKeyframes(this.options)) {
|
|
13745
13783
|
const { onComplete, onUpdate, motionValue: motionValue3, element, ...options } = this.options, pregeneratedAnimation = pregenerateKeyframes(keyframes2, options);
|
|
@@ -13763,21 +13801,21 @@ class AcceleratedAnimation extends BaseAnimation {
|
|
|
13763
13801
|
if (!resolved)
|
|
13764
13802
|
return 0;
|
|
13765
13803
|
const { duration } = resolved;
|
|
13766
|
-
return millisecondsToSeconds(duration);
|
|
13804
|
+
return /* @__PURE__ */ millisecondsToSeconds(duration);
|
|
13767
13805
|
}
|
|
13768
13806
|
get time() {
|
|
13769
13807
|
const { resolved } = this;
|
|
13770
13808
|
if (!resolved)
|
|
13771
13809
|
return 0;
|
|
13772
13810
|
const { animation } = resolved;
|
|
13773
|
-
return millisecondsToSeconds(animation.currentTime || 0);
|
|
13811
|
+
return /* @__PURE__ */ millisecondsToSeconds(animation.currentTime || 0);
|
|
13774
13812
|
}
|
|
13775
13813
|
set time(newTime) {
|
|
13776
13814
|
const { resolved } = this;
|
|
13777
13815
|
if (!resolved)
|
|
13778
13816
|
return;
|
|
13779
13817
|
const { animation } = resolved;
|
|
13780
|
-
animation.currentTime = secondsToMilliseconds(newTime);
|
|
13818
|
+
animation.currentTime = /* @__PURE__ */ secondsToMilliseconds(newTime);
|
|
13781
13819
|
}
|
|
13782
13820
|
get speed() {
|
|
13783
13821
|
const { resolved } = this;
|
|
@@ -13858,7 +13896,7 @@ class AcceleratedAnimation extends BaseAnimation {
|
|
|
13858
13896
|
ease: ease2,
|
|
13859
13897
|
times,
|
|
13860
13898
|
isGenerator: !0
|
|
13861
|
-
}), sampleTime = secondsToMilliseconds(this.time);
|
|
13899
|
+
}), sampleTime = /* @__PURE__ */ secondsToMilliseconds(this.time);
|
|
13862
13900
|
motionValue2.setWithVelocity(sampleAnimation.sample(sampleTime - sampleDelta).value, sampleAnimation.sample(sampleTime).value, sampleDelta);
|
|
13863
13901
|
}
|
|
13864
13902
|
const { onStop } = this.options;
|
|
@@ -13874,11 +13912,14 @@ class AcceleratedAnimation extends BaseAnimation {
|
|
|
13874
13912
|
}
|
|
13875
13913
|
static supports(options) {
|
|
13876
13914
|
const { motionValue: motionValue2, name, repeatDelay, repeatType, damping, type } = options;
|
|
13877
|
-
|
|
13915
|
+
if (!motionValue2 || !motionValue2.owner || !(motionValue2.owner.current instanceof HTMLElement))
|
|
13916
|
+
return !1;
|
|
13917
|
+
const { onUpdate, transformTemplate } = motionValue2.owner.getProps();
|
|
13918
|
+
return supportsWaapi() && name && acceleratedValues.has(name) && /**
|
|
13878
13919
|
* If we're outputting values to onUpdate then we can't use WAAPI as there's
|
|
13879
13920
|
* no way to read the value from WAAPI every frame.
|
|
13880
13921
|
*/
|
|
13881
|
-
!
|
|
13922
|
+
!onUpdate && !transformTemplate && !repeatDelay && repeatType !== "mirror" && damping !== 0 && type !== "inertia";
|
|
13882
13923
|
}
|
|
13883
13924
|
}
|
|
13884
13925
|
const underDampedSpring = {
|
|
@@ -13905,7 +13946,7 @@ function isTransitionDefined({ when, delay: _delay, delayChildren, staggerChildr
|
|
|
13905
13946
|
const animateMotionValue = (name, value, target, transition = {}, element, isHandoff) => (onComplete) => {
|
|
13906
13947
|
const valueTransition = getValueTransition$1(transition, name) || {}, delay2 = valueTransition.delay || transition.delay || 0;
|
|
13907
13948
|
let { elapsed = 0 } = transition;
|
|
13908
|
-
elapsed = elapsed - secondsToMilliseconds(delay2);
|
|
13949
|
+
elapsed = elapsed - /* @__PURE__ */ secondsToMilliseconds(delay2);
|
|
13909
13950
|
let options = {
|
|
13910
13951
|
keyframes: Array.isArray(target) ? target : [null, target],
|
|
13911
13952
|
ease: "easeOut",
|
|
@@ -13925,7 +13966,7 @@ const animateMotionValue = (name, value, target, transition = {}, element, isHan
|
|
|
13925
13966
|
isTransitionDefined(valueTransition) || (options = {
|
|
13926
13967
|
...options,
|
|
13927
13968
|
...getDefaultTransition(name, options)
|
|
13928
|
-
}), options.duration && (options.duration = secondsToMilliseconds(options.duration)), options.repeatDelay && (options.repeatDelay = secondsToMilliseconds(options.repeatDelay)), options.from !== void 0 && (options.keyframes[0] = options.from);
|
|
13969
|
+
}), options.duration && (options.duration = /* @__PURE__ */ secondsToMilliseconds(options.duration)), options.repeatDelay && (options.repeatDelay = /* @__PURE__ */ secondsToMilliseconds(options.repeatDelay)), options.from !== void 0 && (options.keyframes[0] = options.from);
|
|
13929
13970
|
let shouldSkip = !1;
|
|
13930
13971
|
if ((options.type === !1 || options.duration === 0 && !options.repeatDelay) && (options.duration = 0, options.delay === 0 && (shouldSkip = !0)), shouldSkip && !isHandoff && value.get() !== void 0) {
|
|
13931
13972
|
const finalKeyframe = getFinalKeyframe(options.keyframes, valueTransition);
|
|
@@ -13961,7 +14002,7 @@ function animateTarget(visualElement, targetAndTransition, { delay: delay2 = 0,
|
|
|
13961
14002
|
startTime !== null && (valueTransition.startTime = startTime, isHandoff = !0);
|
|
13962
14003
|
}
|
|
13963
14004
|
}
|
|
13964
|
-
addValueToWillChange(visualElement, key), value.start(animateMotionValue(key, value, valueTarget, visualElement.shouldReduceMotion &&
|
|
14005
|
+
addValueToWillChange(visualElement, key), value.start(animateMotionValue(key, value, valueTarget, visualElement.shouldReduceMotion && positionalKeys.has(key) ? { type: !1 } : valueTransition, visualElement, isHandoff));
|
|
13965
14006
|
const animation = value.animation;
|
|
13966
14007
|
animation && animations2.push(animation);
|
|
13967
14008
|
}
|
|
@@ -14286,11 +14327,11 @@ function getVelocity(history, timeDelta) {
|
|
|
14286
14327
|
return { x: 0, y: 0 };
|
|
14287
14328
|
let i2 = history.length - 1, timestampedPoint = null;
|
|
14288
14329
|
const lastPoint = lastDevicePoint(history);
|
|
14289
|
-
for (; i2 >= 0 && (timestampedPoint = history[i2], !(lastPoint.timestamp - timestampedPoint.timestamp > secondsToMilliseconds(timeDelta))); )
|
|
14330
|
+
for (; i2 >= 0 && (timestampedPoint = history[i2], !(lastPoint.timestamp - timestampedPoint.timestamp > /* @__PURE__ */ secondsToMilliseconds(timeDelta))); )
|
|
14290
14331
|
i2--;
|
|
14291
14332
|
if (!timestampedPoint)
|
|
14292
14333
|
return { x: 0, y: 0 };
|
|
14293
|
-
const time2 = millisecondsToSeconds(lastPoint.timestamp - timestampedPoint.timestamp);
|
|
14334
|
+
const time2 = /* @__PURE__ */ millisecondsToSeconds(lastPoint.timestamp - timestampedPoint.timestamp);
|
|
14294
14335
|
if (time2 === 0)
|
|
14295
14336
|
return { x: 0, y: 0 };
|
|
14296
14337
|
const currentVelocity = {
|
|
@@ -14352,7 +14393,7 @@ function calcViewportConstraints(layoutBox, constraintsBox) {
|
|
|
14352
14393
|
function calcOrigin(source, target) {
|
|
14353
14394
|
let origin = 0.5;
|
|
14354
14395
|
const sourceLength = calcLength(source), targetLength = calcLength(target);
|
|
14355
|
-
return targetLength > sourceLength ? origin = progress(target.min, target.max - sourceLength, source.min) : sourceLength > targetLength && (origin = progress(source.min, source.max - targetLength, target.min)), clamp$1(0, 1, origin);
|
|
14396
|
+
return targetLength > sourceLength ? origin = /* @__PURE__ */ progress(target.min, target.max - sourceLength, source.min) : sourceLength > targetLength && (origin = /* @__PURE__ */ progress(source.min, source.max - targetLength, target.min)), clamp$1(0, 1, origin);
|
|
14356
14397
|
}
|
|
14357
14398
|
function rebaseAxisConstraints(layout2, constraints) {
|
|
14358
14399
|
const relativeConstraints = {};
|
|
@@ -14748,15 +14789,6 @@ class PanGesture extends Feature {
|
|
|
14748
14789
|
this.removePointerDownListener(), this.session && this.session.end();
|
|
14749
14790
|
}
|
|
14750
14791
|
}
|
|
14751
|
-
function usePresence() {
|
|
14752
|
-
const context = useContext(PresenceContext);
|
|
14753
|
-
if (context === null)
|
|
14754
|
-
return [!0, null];
|
|
14755
|
-
const { isPresent, onExitComplete, register } = context, id2 = useId$2();
|
|
14756
|
-
useEffect$2(() => register(id2), []);
|
|
14757
|
-
const safeToRemove = useCallback(() => onExitComplete && onExitComplete(id2), [id2, onExitComplete]);
|
|
14758
|
-
return !isPresent && onExitComplete ? [!1, safeToRemove] : [!0];
|
|
14759
|
-
}
|
|
14760
14792
|
const globalProjectionState = {
|
|
14761
14793
|
/**
|
|
14762
14794
|
* Global flag as to whether the tree has animated since the last time
|
|
@@ -14906,7 +14938,7 @@ function getRadius(values2, radiusName) {
|
|
|
14906
14938
|
}
|
|
14907
14939
|
const easeCrossfadeIn = /* @__PURE__ */ compress(0, 0.5, circOut), easeCrossfadeOut = /* @__PURE__ */ compress(0.5, 0.95, noop$3);
|
|
14908
14940
|
function compress(min2, max2, easing) {
|
|
14909
|
-
return (p2) => p2 < min2 ? 0 : p2 > max2 ? 1 : easing(progress(min2, max2, p2));
|
|
14941
|
+
return (p2) => p2 < min2 ? 0 : p2 > max2 ? 1 : easing(/* @__PURE__ */ progress(min2, max2, p2));
|
|
14910
14942
|
}
|
|
14911
14943
|
function copyAxisInto(axis, originAxis) {
|
|
14912
14944
|
axis.min = originAxis.min, axis.max = originAxis.max;
|
|
@@ -15768,6 +15800,7 @@ function initPrefersReducedMotion() {
|
|
|
15768
15800
|
} else
|
|
15769
15801
|
prefersReducedMotion.current = !1;
|
|
15770
15802
|
}
|
|
15803
|
+
const valueTypes = [...dimensionValueTypes, color$1, complex], findValueType = (v2) => valueTypes.find(testValueType(v2)), visualElementStore = /* @__PURE__ */ new WeakMap();
|
|
15771
15804
|
function updateMotionValuesFromProps(element, next, prev) {
|
|
15772
15805
|
for (const key in next) {
|
|
15773
15806
|
const nextValue = next[key], prevValue = prev[key];
|
|
@@ -15788,7 +15821,7 @@ function updateMotionValuesFromProps(element, next, prev) {
|
|
|
15788
15821
|
next[key] === void 0 && element.removeValue(key);
|
|
15789
15822
|
return next;
|
|
15790
15823
|
}
|
|
15791
|
-
const
|
|
15824
|
+
const propEventHandlers = [
|
|
15792
15825
|
"AnimationStart",
|
|
15793
15826
|
"AnimationComplete",
|
|
15794
15827
|
"Update",
|
|
@@ -15815,8 +15848,8 @@ class VisualElement {
|
|
|
15815
15848
|
const now2 = time$1.now();
|
|
15816
15849
|
this.renderScheduledAt < now2 && (this.renderScheduledAt = now2, frame$1.render(this.render, !1, !0));
|
|
15817
15850
|
};
|
|
15818
|
-
const { latestValues, renderState } = visualState;
|
|
15819
|
-
this.latestValues = latestValues, this.baseTarget = { ...latestValues }, this.initialValues = props.initial ? { ...latestValues } : {}, this.renderState = renderState, this.parent = parent, this.props = props, this.presenceContext = presenceContext, this.depth = parent ? parent.depth + 1 : 0, this.reducedMotionConfig = reducedMotionConfig, this.options = options, this.blockInitialAnimation = !!blockInitialAnimation, this.isControllingVariants = isControllingVariants(props), this.isVariantNode = isVariantNode(props), this.isVariantNode && (this.variantChildren = /* @__PURE__ */ new Set()), this.manuallyAnimateOnMount = !!(parent && parent.current);
|
|
15851
|
+
const { latestValues, renderState, onUpdate } = visualState;
|
|
15852
|
+
this.onUpdate = onUpdate, this.latestValues = latestValues, this.baseTarget = { ...latestValues }, this.initialValues = props.initial ? { ...latestValues } : {}, this.renderState = renderState, this.parent = parent, this.props = props, this.presenceContext = presenceContext, this.depth = parent ? parent.depth + 1 : 0, this.reducedMotionConfig = reducedMotionConfig, this.options = options, this.blockInitialAnimation = !!blockInitialAnimation, this.isControllingVariants = isControllingVariants(props), this.isVariantNode = isVariantNode(props), this.isVariantNode && (this.variantChildren = /* @__PURE__ */ new Set()), this.manuallyAnimateOnMount = !!(parent && parent.current);
|
|
15820
15853
|
const { willChange, ...initialMotionValues } = this.scrapeMotionValuesFromProps(props, {}, this);
|
|
15821
15854
|
for (const key in initialMotionValues) {
|
|
15822
15855
|
const value = initialMotionValues[key];
|
|
@@ -15891,7 +15924,7 @@ class VisualElement {
|
|
|
15891
15924
|
const listenerName = "on" + key, listener = props[listenerName];
|
|
15892
15925
|
listener && (this.propEventSubscriptions[key] = this.on(key, listener));
|
|
15893
15926
|
}
|
|
15894
|
-
this.prevMotionValues = updateMotionValuesFromProps(this, this.scrapeMotionValuesFromProps(props, this.prevProps, this), this.prevMotionValues), this.handleChildMotionValue && this.handleChildMotionValue();
|
|
15927
|
+
this.prevMotionValues = updateMotionValuesFromProps(this, this.scrapeMotionValuesFromProps(props, this.prevProps, this), this.prevMotionValues), this.handleChildMotionValue && this.handleChildMotionValue(), this.onUpdate && this.onUpdate(this);
|
|
15895
15928
|
}
|
|
15896
15929
|
getProps() {
|
|
15897
15930
|
return this.props;
|
|
@@ -16157,7 +16190,7 @@ function createAnimationsFromSequence(sequence, { defaultTransition: defaultTran
|
|
|
16157
16190
|
absoluteDelta = Math.abs(delta);
|
|
16158
16191
|
}
|
|
16159
16192
|
const springTransition = { ...remainingTransition };
|
|
16160
|
-
duration !== void 0 && (springTransition.duration = secondsToMilliseconds(duration));
|
|
16193
|
+
duration !== void 0 && (springTransition.duration = /* @__PURE__ */ secondsToMilliseconds(duration));
|
|
16161
16194
|
const springEasing = createGeneratorEasing(springTransition, absoluteDelta, createGenerator);
|
|
16162
16195
|
ease2 = springEasing.ease, duration = springEasing.duration;
|
|
16163
16196
|
}
|
|
@@ -16201,7 +16234,7 @@ function createAnimationsFromSequence(sequence, { defaultTransition: defaultTran
|
|
|
16201
16234
|
const keyframes2 = [], valueOffset = [], valueEasing = [];
|
|
16202
16235
|
for (let i2 = 0; i2 < valueSequence.length; i2++) {
|
|
16203
16236
|
const { at, value, easing } = valueSequence[i2];
|
|
16204
|
-
keyframes2.push(value), valueOffset.push(progress(0, totalDuration, at)), valueEasing.push(easing || "easeOut");
|
|
16237
|
+
keyframes2.push(value), valueOffset.push(/* @__PURE__ */ progress(0, totalDuration, at)), valueEasing.push(easing || "easeOut");
|
|
16205
16238
|
}
|
|
16206
16239
|
valueOffset[0] !== 0 && (valueOffset.unshift(0), keyframes2.unshift(keyframes2[0]), valueEasing.unshift(defaultSegmentEasing)), valueOffset[valueOffset.length - 1] !== 1 && (valueOffset.push(1), keyframes2.push(null)), animationDefinitions.has(element) || animationDefinitions.set(element, {
|
|
16207
16240
|
keyframes: {},
|
|
@@ -16321,7 +16354,7 @@ function animateSequence(sequence, options, scope) {
|
|
|
16321
16354
|
}), animations2;
|
|
16322
16355
|
}
|
|
16323
16356
|
function isSequence(value) {
|
|
16324
|
-
return Array.isArray(value) && Array.isArray
|
|
16357
|
+
return Array.isArray(value) && value.some(Array.isArray);
|
|
16325
16358
|
}
|
|
16326
16359
|
function createScopedAnimate(scope) {
|
|
16327
16360
|
function scopedAnimate(subjectOrSequence, optionsOrKeyframes, options) {
|
|
@@ -30740,12 +30773,18 @@ function useDiagram() {
|
|
|
30740
30773
|
}), [actor]);
|
|
30741
30774
|
}
|
|
30742
30775
|
class Rect {
|
|
30743
|
-
constructor() {
|
|
30776
|
+
constructor(xynode, parent = null) {
|
|
30744
30777
|
__publicField(this, "id");
|
|
30745
30778
|
__publicField(this, "minX", 1 / 0);
|
|
30746
30779
|
__publicField(this, "minY", 1 / 0);
|
|
30747
30780
|
__publicField(this, "maxX", -1 / 0);
|
|
30748
30781
|
__publicField(this, "maxY", -1 / 0);
|
|
30782
|
+
this.id = xynode.id, this.positionAbsolute = parent ? {
|
|
30783
|
+
x: xynode.position.x + parent.minX,
|
|
30784
|
+
y: xynode.position.y + parent.minY
|
|
30785
|
+
} : xynode.position;
|
|
30786
|
+
const { width: width2, height } = getNodeDimensions(xynode);
|
|
30787
|
+
this.maxX = this.minX + Math.ceil(width2), this.maxY = this.minY + Math.ceil(height), parent && parent.children.push(this);
|
|
30749
30788
|
}
|
|
30750
30789
|
get positionAbsolute() {
|
|
30751
30790
|
return {
|
|
@@ -30778,16 +30817,14 @@ class Rect {
|
|
|
30778
30817
|
__publicField(Rect, "LeftPadding", 40), __publicField(Rect, "RightPadding", 40), __publicField(Rect, "TopPadding", 55), __publicField(Rect, "BottomPadding", 40);
|
|
30779
30818
|
class Compound extends Rect {
|
|
30780
30819
|
constructor(xynode, parent = null) {
|
|
30781
|
-
super();
|
|
30820
|
+
super(xynode, parent);
|
|
30782
30821
|
__publicField(this, "children", []);
|
|
30783
|
-
this.parent = parent
|
|
30822
|
+
this.parent = parent;
|
|
30784
30823
|
}
|
|
30785
30824
|
}
|
|
30786
30825
|
class Leaf extends Rect {
|
|
30787
30826
|
constructor(xynode, parent = null) {
|
|
30788
|
-
super(), this.parent = parent
|
|
30789
|
-
const { width: width2, height } = getNodeDimensions(xynode);
|
|
30790
|
-
this.maxX = this.minX + Math.ceil(width2), this.maxY = this.minY + Math.ceil(height), parent && parent.children.push(this);
|
|
30827
|
+
super(xynode, parent), this.parent = parent;
|
|
30791
30828
|
}
|
|
30792
30829
|
}
|
|
30793
30830
|
function createLayoutConstraints(xyflowApi, editingNodeIds) {
|
|
@@ -34269,7 +34306,7 @@ function useRelationshipsBrowser() {
|
|
|
34269
34306
|
}), [actor]);
|
|
34270
34307
|
}
|
|
34271
34308
|
const ElementActions$2 = (props) => {
|
|
34272
|
-
const { enableNavigateTo } = useEnabledFeature("NavigateTo"), diagram = useDiagram(), browser = useRelationshipsBrowser(), buttons2 = [], { navigateTo, fqn: fqn2 } = props.data;
|
|
34309
|
+
const { enableNavigateTo, enableVscode } = useEnabledFeature("NavigateTo", "Vscode"), diagram = useDiagram(), browser = useRelationshipsBrowser(), buttons2 = [], { navigateTo, fqn: fqn2 } = props.data;
|
|
34273
34310
|
return navigateTo && enableNavigateTo && buttons2.push({
|
|
34274
34311
|
key: "navigate",
|
|
34275
34312
|
icon: /* @__PURE__ */ jsx(IconZoomScan, {}),
|
|
@@ -34282,6 +34319,12 @@ const ElementActions$2 = (props) => {
|
|
|
34282
34319
|
onClick: (e2) => {
|
|
34283
34320
|
e2.stopPropagation(), browser.navigateTo(fqn2, props.id);
|
|
34284
34321
|
}
|
|
34322
|
+
}), enableVscode && buttons2.push({
|
|
34323
|
+
key: "goToSource",
|
|
34324
|
+
icon: /* @__PURE__ */ jsx(IconFileSymlink, {}),
|
|
34325
|
+
onClick: (e2) => {
|
|
34326
|
+
e2.stopPropagation(), diagram.openSource({ element: fqn2 });
|
|
34327
|
+
}
|
|
34285
34328
|
}), /* @__PURE__ */ jsx(
|
|
34286
34329
|
ElementActionButtons,
|
|
34287
34330
|
{
|
|
@@ -34667,7 +34710,7 @@ function TabPanelRelationships({
|
|
|
34667
34710
|
}) {
|
|
34668
34711
|
const layoutId = useId$1();
|
|
34669
34712
|
useState$1("view");
|
|
34670
|
-
const incoming = [...element.incoming()].map((r2) => r2.id), outgoing = [...element.outgoing()].map((r2) => r2.id), incomingInView = i$9(node2.incoming().flatMap((e2) => e2.$edge.relations)
|
|
34713
|
+
const incoming = [...element.incoming()].map((r2) => r2.id), outgoing = [...element.outgoing()].map((r2) => r2.id), incomingInView = i$9([...node2.incoming()].flatMap((e2) => e2.$edge.relations)), outgoingInView = i$9([...node2.outgoing()].flatMap((e2) => e2.$edge.relations)), notIncludedRelations = [
|
|
34671
34714
|
...incoming,
|
|
34672
34715
|
...outgoing
|
|
34673
34716
|
].filter((r2) => !incomingInView.includes(r2) && !outgoingInView.includes(r2)).length;
|