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
package/react/index.js
CHANGED
|
@@ -11311,12 +11311,12 @@ const defaultProps$8 = {
|
|
|
11311
11311
|
});
|
|
11312
11312
|
Tree.displayName = "@mantine/core/Tree";
|
|
11313
11313
|
Tree.classes = classes$2;
|
|
11314
|
-
const
|
|
11314
|
+
const LayoutGroupContext = createContext({});
|
|
11315
11315
|
function useConstant(init2) {
|
|
11316
11316
|
const ref = useRef$1(null);
|
|
11317
11317
|
return ref.current === null && (ref.current = init2()), ref.current;
|
|
11318
11318
|
}
|
|
11319
|
-
const MotionConfigContext = createContext({
|
|
11319
|
+
const PresenceContext = createContext(null), MotionConfigContext = createContext({
|
|
11320
11320
|
transformPagePoint: (p2) => p2,
|
|
11321
11321
|
isStatic: !1,
|
|
11322
11322
|
reducedMotion: "never"
|
|
@@ -11397,24 +11397,26 @@ const PresenceChild = ({ children: children2, initial, isPresent, onExitComplete
|
|
|
11397
11397
|
function newChildrenMap() {
|
|
11398
11398
|
return /* @__PURE__ */ new Map();
|
|
11399
11399
|
}
|
|
11400
|
-
|
|
11401
|
-
|
|
11402
|
-
|
|
11403
|
-
|
|
11404
|
-
|
|
11400
|
+
function usePresence(subscribe = !0) {
|
|
11401
|
+
const context = useContext(PresenceContext);
|
|
11402
|
+
if (context === null)
|
|
11403
|
+
return [!0, null];
|
|
11404
|
+
const { isPresent, onExitComplete, register } = context, id2 = useId$2();
|
|
11405
|
+
useEffect$2(() => {
|
|
11406
|
+
subscribe && register(id2);
|
|
11407
|
+
}, [subscribe]);
|
|
11408
|
+
const safeToRemove = useCallback(() => subscribe && onExitComplete && onExitComplete(id2), [id2, onExitComplete, subscribe]);
|
|
11409
|
+
return !isPresent && onExitComplete ? [!1, safeToRemove] : [!0];
|
|
11405
11410
|
}
|
|
11406
|
-
const
|
|
11407
|
-
const toFromDifference = to - from;
|
|
11408
|
-
return toFromDifference === 0 ? 1 : (value - from) / toFromDifference;
|
|
11409
|
-
}, secondsToMilliseconds = (seconds) => seconds * 1e3, millisecondsToSeconds = (milliseconds) => milliseconds / 1e3, getChildKey = (child) => child.key || "";
|
|
11411
|
+
const getChildKey = (child) => child.key || "";
|
|
11410
11412
|
function onlyElements(children2) {
|
|
11411
11413
|
const filtered = [];
|
|
11412
11414
|
return Children.forEach(children2, (child) => {
|
|
11413
11415
|
isValidElement(child) && filtered.push(child);
|
|
11414
11416
|
}), filtered;
|
|
11415
11417
|
}
|
|
11416
|
-
const isBrowser$1 = typeof window < "u", useIsomorphicLayoutEffect$2 = isBrowser$1 ? useLayoutEffect$1 : useEffect$2, AnimatePresence = ({ children: children2,
|
|
11417
|
-
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);
|
|
11418
|
+
const isBrowser$1 = typeof window < "u", useIsomorphicLayoutEffect$2 = isBrowser$1 ? useLayoutEffect$1 : useEffect$2, AnimatePresence = ({ children: children2, custom: custom5, initial = !0, onExitComplete, presenceAffectsLayout = !0, mode = "sync", propagate = !1 }) => {
|
|
11419
|
+
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);
|
|
11418
11420
|
useIsomorphicLayoutEffect$2(() => {
|
|
11419
11421
|
isInitialRender.current = !1, pendingPresentChildren.current = presentChildren;
|
|
11420
11422
|
for (let i2 = 0; i2 < renderedChildren.length; i2++) {
|
|
@@ -11434,7 +11436,7 @@ const isBrowser$1 = typeof window < "u", useIsomorphicLayoutEffect$2 = isBrowser
|
|
|
11434
11436
|
}
|
|
11435
11437
|
const { forceRender } = useContext(LayoutGroupContext);
|
|
11436
11438
|
return jsx(Fragment$1, { children: renderedChildren.map((child) => {
|
|
11437
|
-
const key = getChildKey(child), isPresent = presentChildren === renderedChildren || presentKeys.includes(key), onExit = () => {
|
|
11439
|
+
const key = getChildKey(child), isPresent = propagate && !isParentPresent ? !1 : presentChildren === renderedChildren || presentKeys.includes(key), onExit = () => {
|
|
11438
11440
|
if (exitComplete.has(key))
|
|
11439
11441
|
exitComplete.set(key, !0);
|
|
11440
11442
|
else
|
|
@@ -11442,7 +11444,7 @@ const isBrowser$1 = typeof window < "u", useIsomorphicLayoutEffect$2 = isBrowser
|
|
|
11442
11444
|
let isEveryExitComplete = !0;
|
|
11443
11445
|
exitComplete.forEach((isExitComplete) => {
|
|
11444
11446
|
isExitComplete || (isEveryExitComplete = !1);
|
|
11445
|
-
}), isEveryExitComplete && (forceRender == null || forceRender(), setRenderedChildren(pendingPresentChildren.current), onExitComplete && onExitComplete());
|
|
11447
|
+
}), isEveryExitComplete && (forceRender == null || forceRender(), setRenderedChildren(pendingPresentChildren.current), propagate && (safeToRemove == null || safeToRemove()), onExitComplete && onExitComplete());
|
|
11446
11448
|
};
|
|
11447
11449
|
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);
|
|
11448
11450
|
}) });
|
|
@@ -11453,7 +11455,17 @@ function useIsMounted() {
|
|
|
11453
11455
|
isMounted.current = !1;
|
|
11454
11456
|
}), []), isMounted;
|
|
11455
11457
|
}
|
|
11456
|
-
const
|
|
11458
|
+
const noop$3 = /* @__NO_SIDE_EFFECTS__ */ (any) => any;
|
|
11459
|
+
let invariant = noop$3;
|
|
11460
|
+
// @__NO_SIDE_EFFECTS__
|
|
11461
|
+
function memo$1(callback) {
|
|
11462
|
+
let result;
|
|
11463
|
+
return () => (result === void 0 && (result = callback()), result);
|
|
11464
|
+
}
|
|
11465
|
+
const progress = /* @__NO_SIDE_EFFECTS__ */ (from, to, value) => {
|
|
11466
|
+
const toFromDifference = to - from;
|
|
11467
|
+
return toFromDifference === 0 ? 1 : (value - from) / toFromDifference;
|
|
11468
|
+
}, secondsToMilliseconds = /* @__NO_SIDE_EFFECTS__ */ (seconds) => seconds * 1e3, millisecondsToSeconds = /* @__NO_SIDE_EFFECTS__ */ (milliseconds) => milliseconds / 1e3, MotionGlobalConfig = {
|
|
11457
11469
|
skipAnimations: !1,
|
|
11458
11470
|
useManualTiming: !1
|
|
11459
11471
|
};
|
|
@@ -11726,7 +11738,7 @@ function isRefObject(ref) {
|
|
|
11726
11738
|
function useMotionRef(visualState, visualElement, externalRef) {
|
|
11727
11739
|
return useCallback(
|
|
11728
11740
|
(instance) => {
|
|
11729
|
-
instance && visualState.
|
|
11741
|
+
instance && visualState.onMount && visualState.onMount(instance), visualElement && (instance ? visualElement.mount(instance) : visualElement.unmount()), externalRef && (typeof externalRef == "function" ? externalRef(instance) : isRefObject(externalRef) && (externalRef.current = instance));
|
|
11730
11742
|
},
|
|
11731
11743
|
/**
|
|
11732
11744
|
* Only pass a new ref callback to React if we've received a visual element
|
|
@@ -11873,83 +11885,6 @@ function isSVGComponent(Component2) {
|
|
|
11873
11885
|
)
|
|
11874
11886
|
);
|
|
11875
11887
|
}
|
|
11876
|
-
function renderHTML(element, { style: style2, vars: vars2 }, styleProp, projection) {
|
|
11877
|
-
Object.assign(element.style, style2, projection && projection.getProjectionStyles(styleProp));
|
|
11878
|
-
for (const key in vars2)
|
|
11879
|
-
element.style.setProperty(key, vars2[key]);
|
|
11880
|
-
}
|
|
11881
|
-
const camelCaseAttributes = /* @__PURE__ */ new Set([
|
|
11882
|
-
"baseFrequency",
|
|
11883
|
-
"diffuseConstant",
|
|
11884
|
-
"kernelMatrix",
|
|
11885
|
-
"kernelUnitLength",
|
|
11886
|
-
"keySplines",
|
|
11887
|
-
"keyTimes",
|
|
11888
|
-
"limitingConeAngle",
|
|
11889
|
-
"markerHeight",
|
|
11890
|
-
"markerWidth",
|
|
11891
|
-
"numOctaves",
|
|
11892
|
-
"targetX",
|
|
11893
|
-
"targetY",
|
|
11894
|
-
"surfaceScale",
|
|
11895
|
-
"specularConstant",
|
|
11896
|
-
"specularExponent",
|
|
11897
|
-
"stdDeviation",
|
|
11898
|
-
"tableValues",
|
|
11899
|
-
"viewBox",
|
|
11900
|
-
"gradientTransform",
|
|
11901
|
-
"pathLength",
|
|
11902
|
-
"startOffset",
|
|
11903
|
-
"textLength",
|
|
11904
|
-
"lengthAdjust"
|
|
11905
|
-
]);
|
|
11906
|
-
function renderSVG(element, renderState, _styleProp, projection) {
|
|
11907
|
-
renderHTML(element, renderState, void 0, projection);
|
|
11908
|
-
for (const key in renderState.attrs)
|
|
11909
|
-
element.setAttribute(camelCaseAttributes.has(key) ? key : camelToDash(key), renderState.attrs[key]);
|
|
11910
|
-
}
|
|
11911
|
-
const isMotionValue = (value) => !!(value && value.getVelocity), scaleCorrectors = {};
|
|
11912
|
-
function addScaleCorrector(correctors) {
|
|
11913
|
-
Object.assign(scaleCorrectors, correctors);
|
|
11914
|
-
}
|
|
11915
|
-
const transformPropOrder = [
|
|
11916
|
-
"transformPerspective",
|
|
11917
|
-
"x",
|
|
11918
|
-
"y",
|
|
11919
|
-
"z",
|
|
11920
|
-
"translateX",
|
|
11921
|
-
"translateY",
|
|
11922
|
-
"translateZ",
|
|
11923
|
-
"scale",
|
|
11924
|
-
"scaleX",
|
|
11925
|
-
"scaleY",
|
|
11926
|
-
"rotate",
|
|
11927
|
-
"rotateX",
|
|
11928
|
-
"rotateY",
|
|
11929
|
-
"rotateZ",
|
|
11930
|
-
"skew",
|
|
11931
|
-
"skewX",
|
|
11932
|
-
"skewY"
|
|
11933
|
-
], transformProps = new Set(transformPropOrder);
|
|
11934
|
-
function isForcedMotionValue(key, { layout: layout2, layoutId }) {
|
|
11935
|
-
return transformProps.has(key) || key.startsWith("origin") || (layout2 || layoutId !== void 0) && (!!scaleCorrectors[key] || key === "opacity");
|
|
11936
|
-
}
|
|
11937
|
-
function scrapeMotionValuesFromProps$1(props, prevProps, visualElement) {
|
|
11938
|
-
var _a;
|
|
11939
|
-
const { style: style2 } = props, newValues = {};
|
|
11940
|
-
for (const key in style2)
|
|
11941
|
-
(isMotionValue(style2[key]) || prevProps.style && isMotionValue(prevProps.style[key]) || isForcedMotionValue(key, props) || ((_a = visualElement == null ? void 0 : visualElement.getValue(key)) === null || _a === void 0 ? void 0 : _a.liveStyle) !== void 0) && (newValues[key] = style2[key]);
|
|
11942
|
-
return newValues;
|
|
11943
|
-
}
|
|
11944
|
-
function scrapeMotionValuesFromProps(props, prevProps, visualElement) {
|
|
11945
|
-
const newValues = scrapeMotionValuesFromProps$1(props, prevProps, visualElement);
|
|
11946
|
-
for (const key in props)
|
|
11947
|
-
if (isMotionValue(props[key]) || isMotionValue(prevProps[key])) {
|
|
11948
|
-
const targetKey = transformPropOrder.indexOf(key) !== -1 ? "attr" + key.charAt(0).toUpperCase() + key.substring(1) : key;
|
|
11949
|
-
newValues[targetKey] = props[key];
|
|
11950
|
-
}
|
|
11951
|
-
return newValues;
|
|
11952
|
-
}
|
|
11953
11888
|
function getValueState(visualElement) {
|
|
11954
11889
|
const state = [{}, {}];
|
|
11955
11890
|
return visualElement == null || visualElement.values.forEach((value, key) => {
|
|
@@ -11967,17 +11902,17 @@ function resolveVariantFromProps(props, definition, custom5, visualElement) {
|
|
|
11967
11902
|
}
|
|
11968
11903
|
return definition;
|
|
11969
11904
|
}
|
|
11970
|
-
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;
|
|
11905
|
+
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);
|
|
11971
11906
|
function resolveMotionValue(value) {
|
|
11972
11907
|
const unwrappedValue = isMotionValue(value) ? value.get() : value;
|
|
11973
11908
|
return isCustomValue(unwrappedValue) ? unwrappedValue.toValue() : unwrappedValue;
|
|
11974
11909
|
}
|
|
11975
|
-
function makeState({ scrapeMotionValuesFromProps: scrapeMotionValuesFromProps2, createRenderState,
|
|
11910
|
+
function makeState({ scrapeMotionValuesFromProps: scrapeMotionValuesFromProps2, createRenderState, onUpdate }, props, context, presenceContext) {
|
|
11976
11911
|
const state = {
|
|
11977
11912
|
latestValues: makeLatestValues(props, context, presenceContext, scrapeMotionValuesFromProps2),
|
|
11978
11913
|
renderState: createRenderState()
|
|
11979
11914
|
};
|
|
11980
|
-
return
|
|
11915
|
+
return onUpdate && (state.onMount = (instance) => onUpdate({ props, current: instance, ...state }), state.onUpdate = (visualElement) => onUpdate(visualElement)), state;
|
|
11981
11916
|
}
|
|
11982
11917
|
const makeUseVisualState = (config) => (props, isStatic) => {
|
|
11983
11918
|
const context = useContext(MotionContext), presenceContext = useContext(PresenceContext), make = () => makeState(config, props, context, presenceContext);
|
|
@@ -12014,15 +11949,25 @@ function makeLatestValues(props, context, presenceContext, scrapeMotionValues) {
|
|
|
12014
11949
|
}
|
|
12015
11950
|
return values2;
|
|
12016
11951
|
}
|
|
12017
|
-
const
|
|
12018
|
-
|
|
12019
|
-
|
|
12020
|
-
|
|
12021
|
-
|
|
12022
|
-
|
|
12023
|
-
|
|
12024
|
-
|
|
12025
|
-
|
|
11952
|
+
const transformPropOrder = [
|
|
11953
|
+
"transformPerspective",
|
|
11954
|
+
"x",
|
|
11955
|
+
"y",
|
|
11956
|
+
"z",
|
|
11957
|
+
"translateX",
|
|
11958
|
+
"translateY",
|
|
11959
|
+
"translateZ",
|
|
11960
|
+
"scale",
|
|
11961
|
+
"scaleX",
|
|
11962
|
+
"scaleY",
|
|
11963
|
+
"rotate",
|
|
11964
|
+
"rotateX",
|
|
11965
|
+
"rotateY",
|
|
11966
|
+
"rotateZ",
|
|
11967
|
+
"skew",
|
|
11968
|
+
"skewX",
|
|
11969
|
+
"skewY"
|
|
11970
|
+
], 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 = {
|
|
12026
11971
|
test: (v2) => typeof v2 == "number",
|
|
12027
11972
|
parse: parseFloat,
|
|
12028
11973
|
transform: (v2) => v2
|
|
@@ -12138,7 +12083,6 @@ function buildTransform(latestValues, transform2, transformTemplate) {
|
|
|
12138
12083
|
}
|
|
12139
12084
|
return transformString = transformString.trim(), transformTemplate ? transformString = transformTemplate(transform2, transformIsDefault ? "" : transformString) : transformIsDefault && (transformString = "none"), transformString;
|
|
12140
12085
|
}
|
|
12141
|
-
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;
|
|
12142
12086
|
function buildHTMLStyles(state, latestValues, transformTemplate) {
|
|
12143
12087
|
const { style: style2, vars: vars2, transformOrigin } = state;
|
|
12144
12088
|
let hasTransform2 = !1, hasTransformOrigin = !1;
|
|
@@ -12160,13 +12104,6 @@ function buildHTMLStyles(state, latestValues, transformTemplate) {
|
|
|
12160
12104
|
style2.transformOrigin = `${originX} ${originY} ${originZ}`;
|
|
12161
12105
|
}
|
|
12162
12106
|
}
|
|
12163
|
-
function calcOrigin$1(origin, offset2, size2) {
|
|
12164
|
-
return typeof origin == "string" ? origin : px.transform(offset2 + size2 * origin);
|
|
12165
|
-
}
|
|
12166
|
-
function calcSVGTransformOrigin(dimensions, originX, originY) {
|
|
12167
|
-
const pxOriginX = calcOrigin$1(originX, dimensions.x, dimensions.width), pxOriginY = calcOrigin$1(originY, dimensions.y, dimensions.height);
|
|
12168
|
-
return `${pxOriginX} ${pxOriginY}`;
|
|
12169
|
-
}
|
|
12170
12107
|
const dashKeys = {
|
|
12171
12108
|
offset: "stroke-dashoffset",
|
|
12172
12109
|
array: "stroke-dasharray"
|
|
@@ -12181,6 +12118,13 @@ function buildSVGPath(attrs, length, spacing = 1, offset2 = 0, useDashCase = !0)
|
|
|
12181
12118
|
const pathLength = px.transform(length), pathSpacing = px.transform(spacing);
|
|
12182
12119
|
attrs[keys2.array] = `${pathLength} ${pathSpacing}`;
|
|
12183
12120
|
}
|
|
12121
|
+
function calcOrigin$1(origin, offset2, size2) {
|
|
12122
|
+
return typeof origin == "string" ? origin : px.transform(offset2 + size2 * origin);
|
|
12123
|
+
}
|
|
12124
|
+
function calcSVGTransformOrigin(dimensions, originX, originY) {
|
|
12125
|
+
const pxOriginX = calcOrigin$1(originX, dimensions.x, dimensions.width), pxOriginY = calcOrigin$1(originY, dimensions.y, dimensions.height);
|
|
12126
|
+
return `${pxOriginX} ${pxOriginY}`;
|
|
12127
|
+
}
|
|
12184
12128
|
function buildSVGAttrs(state, {
|
|
12185
12129
|
attrX,
|
|
12186
12130
|
attrY,
|
|
@@ -12201,24 +12145,112 @@ function buildSVGAttrs(state, {
|
|
|
12201
12145
|
const { attrs, style: style2, dimensions } = state;
|
|
12202
12146
|
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);
|
|
12203
12147
|
}
|
|
12204
|
-
const
|
|
12148
|
+
const createHtmlRenderState = () => ({
|
|
12149
|
+
style: {},
|
|
12150
|
+
transform: {},
|
|
12151
|
+
transformOrigin: {},
|
|
12152
|
+
vars: {}
|
|
12153
|
+
}), createSvgRenderState = () => ({
|
|
12154
|
+
...createHtmlRenderState(),
|
|
12155
|
+
attrs: {}
|
|
12156
|
+
}), isSVGTag = (tag) => typeof tag == "string" && tag.toLowerCase() === "svg";
|
|
12157
|
+
function renderHTML(element, { style: style2, vars: vars2 }, styleProp, projection) {
|
|
12158
|
+
Object.assign(element.style, style2, projection && projection.getProjectionStyles(styleProp));
|
|
12159
|
+
for (const key in vars2)
|
|
12160
|
+
element.style.setProperty(key, vars2[key]);
|
|
12161
|
+
}
|
|
12162
|
+
const camelCaseAttributes = /* @__PURE__ */ new Set([
|
|
12163
|
+
"baseFrequency",
|
|
12164
|
+
"diffuseConstant",
|
|
12165
|
+
"kernelMatrix",
|
|
12166
|
+
"kernelUnitLength",
|
|
12167
|
+
"keySplines",
|
|
12168
|
+
"keyTimes",
|
|
12169
|
+
"limitingConeAngle",
|
|
12170
|
+
"markerHeight",
|
|
12171
|
+
"markerWidth",
|
|
12172
|
+
"numOctaves",
|
|
12173
|
+
"targetX",
|
|
12174
|
+
"targetY",
|
|
12175
|
+
"surfaceScale",
|
|
12176
|
+
"specularConstant",
|
|
12177
|
+
"specularExponent",
|
|
12178
|
+
"stdDeviation",
|
|
12179
|
+
"tableValues",
|
|
12180
|
+
"viewBox",
|
|
12181
|
+
"gradientTransform",
|
|
12182
|
+
"pathLength",
|
|
12183
|
+
"startOffset",
|
|
12184
|
+
"textLength",
|
|
12185
|
+
"lengthAdjust"
|
|
12186
|
+
]);
|
|
12187
|
+
function renderSVG(element, renderState, _styleProp, projection) {
|
|
12188
|
+
renderHTML(element, renderState, void 0, projection);
|
|
12189
|
+
for (const key in renderState.attrs)
|
|
12190
|
+
element.setAttribute(camelCaseAttributes.has(key) ? key : camelToDash(key), renderState.attrs[key]);
|
|
12191
|
+
}
|
|
12192
|
+
const scaleCorrectors = {};
|
|
12193
|
+
function addScaleCorrector(correctors) {
|
|
12194
|
+
Object.assign(scaleCorrectors, correctors);
|
|
12195
|
+
}
|
|
12196
|
+
function isForcedMotionValue(key, { layout: layout2, layoutId }) {
|
|
12197
|
+
return transformProps.has(key) || key.startsWith("origin") || (layout2 || layoutId !== void 0) && (!!scaleCorrectors[key] || key === "opacity");
|
|
12198
|
+
}
|
|
12199
|
+
function scrapeMotionValuesFromProps$1(props, prevProps, visualElement) {
|
|
12200
|
+
var _a;
|
|
12201
|
+
const { style: style2 } = props, newValues = {};
|
|
12202
|
+
for (const key in style2)
|
|
12203
|
+
(isMotionValue(style2[key]) || prevProps.style && isMotionValue(prevProps.style[key]) || isForcedMotionValue(key, props) || ((_a = visualElement == null ? void 0 : visualElement.getValue(key)) === null || _a === void 0 ? void 0 : _a.liveStyle) !== void 0) && (newValues[key] = style2[key]);
|
|
12204
|
+
return newValues;
|
|
12205
|
+
}
|
|
12206
|
+
function scrapeMotionValuesFromProps(props, prevProps, visualElement) {
|
|
12207
|
+
const newValues = scrapeMotionValuesFromProps$1(props, prevProps, visualElement);
|
|
12208
|
+
for (const key in props)
|
|
12209
|
+
if (isMotionValue(props[key]) || isMotionValue(prevProps[key])) {
|
|
12210
|
+
const targetKey = transformPropOrder.indexOf(key) !== -1 ? "attr" + key.charAt(0).toUpperCase() + key.substring(1) : key;
|
|
12211
|
+
newValues[targetKey] = props[key];
|
|
12212
|
+
}
|
|
12213
|
+
return newValues;
|
|
12214
|
+
}
|
|
12215
|
+
function updateSVGDimensions(instance, renderState) {
|
|
12216
|
+
try {
|
|
12217
|
+
renderState.dimensions = typeof instance.getBBox == "function" ? instance.getBBox() : instance.getBoundingClientRect();
|
|
12218
|
+
} catch {
|
|
12219
|
+
renderState.dimensions = {
|
|
12220
|
+
x: 0,
|
|
12221
|
+
y: 0,
|
|
12222
|
+
width: 0,
|
|
12223
|
+
height: 0
|
|
12224
|
+
};
|
|
12225
|
+
}
|
|
12226
|
+
}
|
|
12227
|
+
const layoutProps = ["x", "y", "width", "height", "cx", "cy", "r"], svgMotionConfig = {
|
|
12205
12228
|
useVisualState: makeUseVisualState({
|
|
12206
12229
|
scrapeMotionValuesFromProps,
|
|
12207
12230
|
createRenderState: createSvgRenderState,
|
|
12208
|
-
|
|
12209
|
-
|
|
12210
|
-
|
|
12211
|
-
|
|
12212
|
-
|
|
12213
|
-
|
|
12214
|
-
|
|
12215
|
-
|
|
12216
|
-
|
|
12217
|
-
|
|
12218
|
-
|
|
12231
|
+
onUpdate: ({ props, prevProps, current, renderState, latestValues }) => {
|
|
12232
|
+
if (!current)
|
|
12233
|
+
return;
|
|
12234
|
+
let hasTransform2 = !!props.drag;
|
|
12235
|
+
if (!hasTransform2) {
|
|
12236
|
+
for (const key in latestValues)
|
|
12237
|
+
if (transformProps.has(key)) {
|
|
12238
|
+
hasTransform2 = !0;
|
|
12239
|
+
break;
|
|
12240
|
+
}
|
|
12241
|
+
}
|
|
12242
|
+
if (!hasTransform2)
|
|
12243
|
+
return;
|
|
12244
|
+
let needsMeasure = !prevProps;
|
|
12245
|
+
if (prevProps)
|
|
12246
|
+
for (let i2 = 0; i2 < layoutProps.length; i2++) {
|
|
12247
|
+
const key = layoutProps[i2];
|
|
12248
|
+
props[key] !== prevProps[key] && (needsMeasure = !0);
|
|
12219
12249
|
}
|
|
12220
|
-
|
|
12221
|
-
|
|
12250
|
+
needsMeasure && frame$1.read(() => {
|
|
12251
|
+
updateSVGDimensions(current, renderState), frame$1.render(() => {
|
|
12252
|
+
buildSVGAttrs(renderState, latestValues, isSVGTag(current.tagName), props.transformTemplate), renderSVG(current, renderState);
|
|
12253
|
+
});
|
|
12222
12254
|
});
|
|
12223
12255
|
}
|
|
12224
12256
|
})
|
|
@@ -12297,7 +12329,7 @@ function resolveVariant(visualElement, definition, custom5) {
|
|
|
12297
12329
|
const props = visualElement.getProps();
|
|
12298
12330
|
return resolveVariantFromProps(props, definition, custom5 !== void 0 ? custom5 : props.custom, visualElement);
|
|
12299
12331
|
}
|
|
12300
|
-
const supportsScrollTimeline = memo$1(() => window.ScrollTimeline !== void 0);
|
|
12332
|
+
const supportsScrollTimeline = /* @__PURE__ */ memo$1(() => window.ScrollTimeline !== void 0);
|
|
12301
12333
|
class BaseGroupPlaybackControls {
|
|
12302
12334
|
constructor(animations2) {
|
|
12303
12335
|
this.stop = () => this.runAll("stop"), this.animations = animations2.filter(Boolean);
|
|
@@ -12316,7 +12348,12 @@ class BaseGroupPlaybackControls {
|
|
|
12316
12348
|
this.animations[i2][propName] = newValue;
|
|
12317
12349
|
}
|
|
12318
12350
|
attachTimeline(timeline, fallback) {
|
|
12319
|
-
const subscriptions = this.animations.map((animation) =>
|
|
12351
|
+
const subscriptions = this.animations.map((animation) => {
|
|
12352
|
+
if (supportsScrollTimeline() && animation.attachTimeline)
|
|
12353
|
+
return animation.attachTimeline(timeline);
|
|
12354
|
+
if (typeof fallback == "function")
|
|
12355
|
+
return fallback(animation);
|
|
12356
|
+
});
|
|
12320
12357
|
return () => {
|
|
12321
12358
|
subscriptions.forEach((cancel2, i2) => {
|
|
12322
12359
|
cancel2 && cancel2(), this.animations[i2].stop();
|
|
@@ -12385,7 +12422,7 @@ function createGeneratorEasing(options, scale2 = 100, createGenerator) {
|
|
|
12385
12422
|
return {
|
|
12386
12423
|
type: "keyframes",
|
|
12387
12424
|
ease: (progress2) => generator.next(duration * progress2).value / scale2,
|
|
12388
|
-
duration: millisecondsToSeconds(duration)
|
|
12425
|
+
duration: /* @__PURE__ */ millisecondsToSeconds(duration)
|
|
12389
12426
|
};
|
|
12390
12427
|
}
|
|
12391
12428
|
function isGenerator(type) {
|
|
@@ -12398,7 +12435,7 @@ const isBezierDefinition = (easing) => Array.isArray(easing) && typeof easing[0]
|
|
|
12398
12435
|
linearEasing: void 0
|
|
12399
12436
|
};
|
|
12400
12437
|
function memoSupports(callback, supportsFlag) {
|
|
12401
|
-
const memoized = memo$1(callback);
|
|
12438
|
+
const memoized = /* @__PURE__ */ memo$1(callback);
|
|
12402
12439
|
return () => {
|
|
12403
12440
|
var _a;
|
|
12404
12441
|
return (_a = supportsFlags[supportsFlag]) !== null && _a !== void 0 ? _a : memoized();
|
|
@@ -12415,7 +12452,7 @@ const supportsLinearEasing = /* @__PURE__ */ memoSupports(() => {
|
|
|
12415
12452
|
let points = "";
|
|
12416
12453
|
const numPoints = Math.max(Math.round(duration / resolution), 2);
|
|
12417
12454
|
for (let i2 = 0; i2 < numPoints; i2++)
|
|
12418
|
-
points += easing(progress(0, numPoints - 1, i2)) + ", ";
|
|
12455
|
+
points += easing(/* @__PURE__ */ progress(0, numPoints - 1, i2)) + ", ";
|
|
12419
12456
|
return `linear(${points.substring(0, points.length - 2)})`;
|
|
12420
12457
|
};
|
|
12421
12458
|
function isWaapiSupportedEasing(easing) {
|
|
@@ -12544,6 +12581,15 @@ function setDragLock(axis) {
|
|
|
12544
12581
|
isDragging.x = isDragging.y = !1;
|
|
12545
12582
|
});
|
|
12546
12583
|
}
|
|
12584
|
+
const positionalKeys = /* @__PURE__ */ new Set([
|
|
12585
|
+
"width",
|
|
12586
|
+
"height",
|
|
12587
|
+
"top",
|
|
12588
|
+
"left",
|
|
12589
|
+
"right",
|
|
12590
|
+
"bottom",
|
|
12591
|
+
...transformPropOrder
|
|
12592
|
+
]);
|
|
12547
12593
|
let now$1;
|
|
12548
12594
|
function clearTime() {
|
|
12549
12595
|
now$1 = void 0;
|
|
@@ -12600,7 +12646,7 @@ class MotionValue {
|
|
|
12600
12646
|
* @internal
|
|
12601
12647
|
*/
|
|
12602
12648
|
constructor(init2, options = {}) {
|
|
12603
|
-
this.version = "11.
|
|
12649
|
+
this.version = "11.18.2", this.canTrackVelocity = null, this.events = {}, this.updateAndNotify = (v2, render = !0) => {
|
|
12604
12650
|
const currentTime = time$1.now();
|
|
12605
12651
|
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);
|
|
12606
12652
|
}, this.hasAnimated = !1, this.setCurrent(init2), this.owner = options.owner;
|
|
@@ -12828,144 +12874,6 @@ const mirrorEasing = (easing) => (p2) => p2 <= 0.5 ? easing(2 * p2) / 2 : (2 - e
|
|
|
12828
12874
|
function isNone(value) {
|
|
12829
12875
|
return typeof value == "number" ? value === 0 : value !== null ? value === "none" || value === "0" || isZeroValueString(value) : !0;
|
|
12830
12876
|
}
|
|
12831
|
-
const isNumericalString = (v2) => /^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(v2), splitCSSVariableRegex = (
|
|
12832
|
-
// eslint-disable-next-line redos-detector/no-unsafe-regex -- false positive, as it can match a lot of words
|
|
12833
|
-
/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u
|
|
12834
|
-
);
|
|
12835
|
-
function parseCSSVariable(current) {
|
|
12836
|
-
const match = splitCSSVariableRegex.exec(current);
|
|
12837
|
-
if (!match)
|
|
12838
|
-
return [,];
|
|
12839
|
-
const [, token1, token2, fallback] = match;
|
|
12840
|
-
return [`--${token1 ?? token2}`, fallback];
|
|
12841
|
-
}
|
|
12842
|
-
function getVariableValue(current, element, depth = 1) {
|
|
12843
|
-
const [token, fallback] = parseCSSVariable(current);
|
|
12844
|
-
if (!token)
|
|
12845
|
-
return;
|
|
12846
|
-
const resolved = window.getComputedStyle(element).getPropertyValue(token);
|
|
12847
|
-
if (resolved) {
|
|
12848
|
-
const trimmed = resolved.trim();
|
|
12849
|
-
return isNumericalString(trimmed) ? parseFloat(trimmed) : trimmed;
|
|
12850
|
-
}
|
|
12851
|
-
return isCSSVariableToken(fallback) ? getVariableValue(fallback, element, depth + 1) : fallback;
|
|
12852
|
-
}
|
|
12853
|
-
const positionalKeys = /* @__PURE__ */ new Set([
|
|
12854
|
-
"width",
|
|
12855
|
-
"height",
|
|
12856
|
-
"top",
|
|
12857
|
-
"left",
|
|
12858
|
-
"right",
|
|
12859
|
-
"bottom",
|
|
12860
|
-
"x",
|
|
12861
|
-
"y",
|
|
12862
|
-
"translateX",
|
|
12863
|
-
"translateY"
|
|
12864
|
-
]), isNumOrPxType = (v2) => v2 === number || v2 === px, getPosFromMatrix = (matrix, pos) => parseFloat(matrix.split(", ")[pos]), getTranslateFromMatrix = (pos2, pos3) => (_bbox, { transform: transform2 }) => {
|
|
12865
|
-
if (transform2 === "none" || !transform2)
|
|
12866
|
-
return 0;
|
|
12867
|
-
const matrix3d = transform2.match(/^matrix3d\((.+)\)$/u);
|
|
12868
|
-
if (matrix3d)
|
|
12869
|
-
return getPosFromMatrix(matrix3d[1], pos3);
|
|
12870
|
-
{
|
|
12871
|
-
const matrix = transform2.match(/^matrix\((.+)\)$/u);
|
|
12872
|
-
return matrix ? getPosFromMatrix(matrix[1], pos2) : 0;
|
|
12873
|
-
}
|
|
12874
|
-
}, transformKeys = /* @__PURE__ */ new Set(["x", "y", "z"]), nonTranslationalTransformKeys = transformPropOrder.filter((key) => !transformKeys.has(key));
|
|
12875
|
-
function removeNonTranslationalTransform(visualElement) {
|
|
12876
|
-
const removedTransforms = [];
|
|
12877
|
-
return nonTranslationalTransformKeys.forEach((key) => {
|
|
12878
|
-
const value = visualElement.getValue(key);
|
|
12879
|
-
value !== void 0 && (removedTransforms.push([key, value.get()]), value.set(key.startsWith("scale") ? 1 : 0));
|
|
12880
|
-
}), removedTransforms;
|
|
12881
|
-
}
|
|
12882
|
-
const positionalValues = {
|
|
12883
|
-
// Dimensions
|
|
12884
|
-
width: ({ x: x2 }, { paddingLeft = "0", paddingRight = "0" }) => x2.max - x2.min - parseFloat(paddingLeft) - parseFloat(paddingRight),
|
|
12885
|
-
height: ({ y: y2 }, { paddingTop = "0", paddingBottom = "0" }) => y2.max - y2.min - parseFloat(paddingTop) - parseFloat(paddingBottom),
|
|
12886
|
-
top: (_bbox, { top }) => parseFloat(top),
|
|
12887
|
-
left: (_bbox, { left }) => parseFloat(left),
|
|
12888
|
-
bottom: ({ y: y2 }, { top }) => parseFloat(top) + (y2.max - y2.min),
|
|
12889
|
-
right: ({ x: x2 }, { left }) => parseFloat(left) + (x2.max - x2.min),
|
|
12890
|
-
// Transform
|
|
12891
|
-
x: getTranslateFromMatrix(4, 13),
|
|
12892
|
-
y: getTranslateFromMatrix(5, 14)
|
|
12893
|
-
};
|
|
12894
|
-
positionalValues.translateX = positionalValues.x;
|
|
12895
|
-
positionalValues.translateY = positionalValues.y;
|
|
12896
|
-
const testValueType = (v2) => (type) => type.test(v2), auto = {
|
|
12897
|
-
test: (v2) => v2 === "auto",
|
|
12898
|
-
parse: (v2) => v2
|
|
12899
|
-
}, dimensionValueTypes = [number, px, percent, degrees$1, vw, vh, auto], findDimensionValueType = (v2) => dimensionValueTypes.find(testValueType(v2)), toResolve = /* @__PURE__ */ new Set();
|
|
12900
|
-
let isScheduled = !1, anyNeedsMeasurement = !1;
|
|
12901
|
-
function measureAllKeyframes() {
|
|
12902
|
-
if (anyNeedsMeasurement) {
|
|
12903
|
-
const resolversToMeasure = Array.from(toResolve).filter((resolver) => resolver.needsMeasurement), elementsToMeasure = new Set(resolversToMeasure.map((resolver) => resolver.element)), transformsToRestore = /* @__PURE__ */ new Map();
|
|
12904
|
-
elementsToMeasure.forEach((element) => {
|
|
12905
|
-
const removedTransforms = removeNonTranslationalTransform(element);
|
|
12906
|
-
removedTransforms.length && (transformsToRestore.set(element, removedTransforms), element.render());
|
|
12907
|
-
}), resolversToMeasure.forEach((resolver) => resolver.measureInitialState()), elementsToMeasure.forEach((element) => {
|
|
12908
|
-
element.render();
|
|
12909
|
-
const restore = transformsToRestore.get(element);
|
|
12910
|
-
restore && restore.forEach(([key, value]) => {
|
|
12911
|
-
var _a;
|
|
12912
|
-
(_a = element.getValue(key)) === null || _a === void 0 || _a.set(value);
|
|
12913
|
-
});
|
|
12914
|
-
}), resolversToMeasure.forEach((resolver) => resolver.measureEndState()), resolversToMeasure.forEach((resolver) => {
|
|
12915
|
-
resolver.suspendedScrollY !== void 0 && window.scrollTo(0, resolver.suspendedScrollY);
|
|
12916
|
-
});
|
|
12917
|
-
}
|
|
12918
|
-
anyNeedsMeasurement = !1, isScheduled = !1, toResolve.forEach((resolver) => resolver.complete()), toResolve.clear();
|
|
12919
|
-
}
|
|
12920
|
-
function readAllKeyframes() {
|
|
12921
|
-
toResolve.forEach((resolver) => {
|
|
12922
|
-
resolver.readKeyframes(), resolver.needsMeasurement && (anyNeedsMeasurement = !0);
|
|
12923
|
-
});
|
|
12924
|
-
}
|
|
12925
|
-
function flushKeyframeResolvers() {
|
|
12926
|
-
readAllKeyframes(), measureAllKeyframes();
|
|
12927
|
-
}
|
|
12928
|
-
class KeyframeResolver {
|
|
12929
|
-
constructor(unresolvedKeyframes, onComplete, name, motionValue2, element, isAsync = !1) {
|
|
12930
|
-
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;
|
|
12931
|
-
}
|
|
12932
|
-
scheduleResolve() {
|
|
12933
|
-
this.isScheduled = !0, this.isAsync ? (toResolve.add(this), isScheduled || (isScheduled = !0, frame$1.read(readAllKeyframes), frame$1.resolveKeyframes(measureAllKeyframes))) : (this.readKeyframes(), this.complete());
|
|
12934
|
-
}
|
|
12935
|
-
readKeyframes() {
|
|
12936
|
-
const { unresolvedKeyframes, name, element, motionValue: motionValue2 } = this;
|
|
12937
|
-
for (let i2 = 0; i2 < unresolvedKeyframes.length; i2++)
|
|
12938
|
-
if (unresolvedKeyframes[i2] === null)
|
|
12939
|
-
if (i2 === 0) {
|
|
12940
|
-
const currentValue = motionValue2 == null ? void 0 : motionValue2.get(), finalKeyframe = unresolvedKeyframes[unresolvedKeyframes.length - 1];
|
|
12941
|
-
if (currentValue !== void 0)
|
|
12942
|
-
unresolvedKeyframes[0] = currentValue;
|
|
12943
|
-
else if (element && name) {
|
|
12944
|
-
const valueAsRead = element.readValue(name, finalKeyframe);
|
|
12945
|
-
valueAsRead != null && (unresolvedKeyframes[0] = valueAsRead);
|
|
12946
|
-
}
|
|
12947
|
-
unresolvedKeyframes[0] === void 0 && (unresolvedKeyframes[0] = finalKeyframe), motionValue2 && currentValue === void 0 && motionValue2.set(unresolvedKeyframes[0]);
|
|
12948
|
-
} else
|
|
12949
|
-
unresolvedKeyframes[i2] = unresolvedKeyframes[i2 - 1];
|
|
12950
|
-
}
|
|
12951
|
-
setFinalKeyframe() {
|
|
12952
|
-
}
|
|
12953
|
-
measureInitialState() {
|
|
12954
|
-
}
|
|
12955
|
-
renderEndStyles() {
|
|
12956
|
-
}
|
|
12957
|
-
measureEndState() {
|
|
12958
|
-
}
|
|
12959
|
-
complete() {
|
|
12960
|
-
this.isComplete = !0, this.onComplete(this.unresolvedKeyframes, this.finalKeyframe), toResolve.delete(this);
|
|
12961
|
-
}
|
|
12962
|
-
cancel() {
|
|
12963
|
-
this.isComplete || (this.isScheduled = !1, toResolve.delete(this));
|
|
12964
|
-
}
|
|
12965
|
-
resume() {
|
|
12966
|
-
this.isComplete || this.scheduleResolve();
|
|
12967
|
-
}
|
|
12968
|
-
}
|
|
12969
12877
|
const sanitize = (v2) => Math.round(v2 * 1e5) / 1e5, floatRegex = /-?(?:\d+(?:\.\d+)?|\.\d+)/gu;
|
|
12970
12878
|
function isNullish(v2) {
|
|
12971
12879
|
return v2 == null;
|
|
@@ -13100,6 +13008,134 @@ function makeNoneKeyframesAnimatable(unresolvedKeyframes, noneKeyframeIndexes, n
|
|
|
13100
13008
|
for (const noneIndex of noneKeyframeIndexes)
|
|
13101
13009
|
unresolvedKeyframes[noneIndex] = getAnimatableNone(name, animatableTemplate);
|
|
13102
13010
|
}
|
|
13011
|
+
const isNumOrPxType = (v2) => v2 === number || v2 === px, getPosFromMatrix = (matrix, pos) => parseFloat(matrix.split(", ")[pos]), getTranslateFromMatrix = (pos2, pos3) => (_bbox, { transform: transform2 }) => {
|
|
13012
|
+
if (transform2 === "none" || !transform2)
|
|
13013
|
+
return 0;
|
|
13014
|
+
const matrix3d = transform2.match(/^matrix3d\((.+)\)$/u);
|
|
13015
|
+
if (matrix3d)
|
|
13016
|
+
return getPosFromMatrix(matrix3d[1], pos3);
|
|
13017
|
+
{
|
|
13018
|
+
const matrix = transform2.match(/^matrix\((.+)\)$/u);
|
|
13019
|
+
return matrix ? getPosFromMatrix(matrix[1], pos2) : 0;
|
|
13020
|
+
}
|
|
13021
|
+
}, transformKeys = /* @__PURE__ */ new Set(["x", "y", "z"]), nonTranslationalTransformKeys = transformPropOrder.filter((key) => !transformKeys.has(key));
|
|
13022
|
+
function removeNonTranslationalTransform(visualElement) {
|
|
13023
|
+
const removedTransforms = [];
|
|
13024
|
+
return nonTranslationalTransformKeys.forEach((key) => {
|
|
13025
|
+
const value = visualElement.getValue(key);
|
|
13026
|
+
value !== void 0 && (removedTransforms.push([key, value.get()]), value.set(key.startsWith("scale") ? 1 : 0));
|
|
13027
|
+
}), removedTransforms;
|
|
13028
|
+
}
|
|
13029
|
+
const positionalValues = {
|
|
13030
|
+
// Dimensions
|
|
13031
|
+
width: ({ x: x2 }, { paddingLeft = "0", paddingRight = "0" }) => x2.max - x2.min - parseFloat(paddingLeft) - parseFloat(paddingRight),
|
|
13032
|
+
height: ({ y: y2 }, { paddingTop = "0", paddingBottom = "0" }) => y2.max - y2.min - parseFloat(paddingTop) - parseFloat(paddingBottom),
|
|
13033
|
+
top: (_bbox, { top }) => parseFloat(top),
|
|
13034
|
+
left: (_bbox, { left }) => parseFloat(left),
|
|
13035
|
+
bottom: ({ y: y2 }, { top }) => parseFloat(top) + (y2.max - y2.min),
|
|
13036
|
+
right: ({ x: x2 }, { left }) => parseFloat(left) + (x2.max - x2.min),
|
|
13037
|
+
// Transform
|
|
13038
|
+
x: getTranslateFromMatrix(4, 13),
|
|
13039
|
+
y: getTranslateFromMatrix(5, 14)
|
|
13040
|
+
};
|
|
13041
|
+
positionalValues.translateX = positionalValues.x;
|
|
13042
|
+
positionalValues.translateY = positionalValues.y;
|
|
13043
|
+
const toResolve = /* @__PURE__ */ new Set();
|
|
13044
|
+
let isScheduled = !1, anyNeedsMeasurement = !1;
|
|
13045
|
+
function measureAllKeyframes() {
|
|
13046
|
+
if (anyNeedsMeasurement) {
|
|
13047
|
+
const resolversToMeasure = Array.from(toResolve).filter((resolver) => resolver.needsMeasurement), elementsToMeasure = new Set(resolversToMeasure.map((resolver) => resolver.element)), transformsToRestore = /* @__PURE__ */ new Map();
|
|
13048
|
+
elementsToMeasure.forEach((element) => {
|
|
13049
|
+
const removedTransforms = removeNonTranslationalTransform(element);
|
|
13050
|
+
removedTransforms.length && (transformsToRestore.set(element, removedTransforms), element.render());
|
|
13051
|
+
}), resolversToMeasure.forEach((resolver) => resolver.measureInitialState()), elementsToMeasure.forEach((element) => {
|
|
13052
|
+
element.render();
|
|
13053
|
+
const restore = transformsToRestore.get(element);
|
|
13054
|
+
restore && restore.forEach(([key, value]) => {
|
|
13055
|
+
var _a;
|
|
13056
|
+
(_a = element.getValue(key)) === null || _a === void 0 || _a.set(value);
|
|
13057
|
+
});
|
|
13058
|
+
}), resolversToMeasure.forEach((resolver) => resolver.measureEndState()), resolversToMeasure.forEach((resolver) => {
|
|
13059
|
+
resolver.suspendedScrollY !== void 0 && window.scrollTo(0, resolver.suspendedScrollY);
|
|
13060
|
+
});
|
|
13061
|
+
}
|
|
13062
|
+
anyNeedsMeasurement = !1, isScheduled = !1, toResolve.forEach((resolver) => resolver.complete()), toResolve.clear();
|
|
13063
|
+
}
|
|
13064
|
+
function readAllKeyframes() {
|
|
13065
|
+
toResolve.forEach((resolver) => {
|
|
13066
|
+
resolver.readKeyframes(), resolver.needsMeasurement && (anyNeedsMeasurement = !0);
|
|
13067
|
+
});
|
|
13068
|
+
}
|
|
13069
|
+
function flushKeyframeResolvers() {
|
|
13070
|
+
readAllKeyframes(), measureAllKeyframes();
|
|
13071
|
+
}
|
|
13072
|
+
class KeyframeResolver {
|
|
13073
|
+
constructor(unresolvedKeyframes, onComplete, name, motionValue2, element, isAsync = !1) {
|
|
13074
|
+
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;
|
|
13075
|
+
}
|
|
13076
|
+
scheduleResolve() {
|
|
13077
|
+
this.isScheduled = !0, this.isAsync ? (toResolve.add(this), isScheduled || (isScheduled = !0, frame$1.read(readAllKeyframes), frame$1.resolveKeyframes(measureAllKeyframes))) : (this.readKeyframes(), this.complete());
|
|
13078
|
+
}
|
|
13079
|
+
readKeyframes() {
|
|
13080
|
+
const { unresolvedKeyframes, name, element, motionValue: motionValue2 } = this;
|
|
13081
|
+
for (let i2 = 0; i2 < unresolvedKeyframes.length; i2++)
|
|
13082
|
+
if (unresolvedKeyframes[i2] === null)
|
|
13083
|
+
if (i2 === 0) {
|
|
13084
|
+
const currentValue = motionValue2 == null ? void 0 : motionValue2.get(), finalKeyframe = unresolvedKeyframes[unresolvedKeyframes.length - 1];
|
|
13085
|
+
if (currentValue !== void 0)
|
|
13086
|
+
unresolvedKeyframes[0] = currentValue;
|
|
13087
|
+
else if (element && name) {
|
|
13088
|
+
const valueAsRead = element.readValue(name, finalKeyframe);
|
|
13089
|
+
valueAsRead != null && (unresolvedKeyframes[0] = valueAsRead);
|
|
13090
|
+
}
|
|
13091
|
+
unresolvedKeyframes[0] === void 0 && (unresolvedKeyframes[0] = finalKeyframe), motionValue2 && currentValue === void 0 && motionValue2.set(unresolvedKeyframes[0]);
|
|
13092
|
+
} else
|
|
13093
|
+
unresolvedKeyframes[i2] = unresolvedKeyframes[i2 - 1];
|
|
13094
|
+
}
|
|
13095
|
+
setFinalKeyframe() {
|
|
13096
|
+
}
|
|
13097
|
+
measureInitialState() {
|
|
13098
|
+
}
|
|
13099
|
+
renderEndStyles() {
|
|
13100
|
+
}
|
|
13101
|
+
measureEndState() {
|
|
13102
|
+
}
|
|
13103
|
+
complete() {
|
|
13104
|
+
this.isComplete = !0, this.onComplete(this.unresolvedKeyframes, this.finalKeyframe), toResolve.delete(this);
|
|
13105
|
+
}
|
|
13106
|
+
cancel() {
|
|
13107
|
+
this.isComplete || (this.isScheduled = !1, toResolve.delete(this));
|
|
13108
|
+
}
|
|
13109
|
+
resume() {
|
|
13110
|
+
this.isComplete || this.scheduleResolve();
|
|
13111
|
+
}
|
|
13112
|
+
}
|
|
13113
|
+
const isNumericalString = (v2) => /^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(v2), splitCSSVariableRegex = (
|
|
13114
|
+
// eslint-disable-next-line redos-detector/no-unsafe-regex -- false positive, as it can match a lot of words
|
|
13115
|
+
/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u
|
|
13116
|
+
);
|
|
13117
|
+
function parseCSSVariable(current) {
|
|
13118
|
+
const match = splitCSSVariableRegex.exec(current);
|
|
13119
|
+
if (!match)
|
|
13120
|
+
return [,];
|
|
13121
|
+
const [, token1, token2, fallback] = match;
|
|
13122
|
+
return [`--${token1 ?? token2}`, fallback];
|
|
13123
|
+
}
|
|
13124
|
+
function getVariableValue(current, element, depth = 1) {
|
|
13125
|
+
const [token, fallback] = parseCSSVariable(current);
|
|
13126
|
+
if (!token)
|
|
13127
|
+
return;
|
|
13128
|
+
const resolved = window.getComputedStyle(element).getPropertyValue(token);
|
|
13129
|
+
if (resolved) {
|
|
13130
|
+
const trimmed = resolved.trim();
|
|
13131
|
+
return isNumericalString(trimmed) ? parseFloat(trimmed) : trimmed;
|
|
13132
|
+
}
|
|
13133
|
+
return isCSSVariableToken(fallback) ? getVariableValue(fallback, element, depth + 1) : fallback;
|
|
13134
|
+
}
|
|
13135
|
+
const testValueType = (v2) => (type) => type.test(v2), auto = {
|
|
13136
|
+
test: (v2) => v2 === "auto",
|
|
13137
|
+
parse: (v2) => v2
|
|
13138
|
+
}, dimensionValueTypes = [number, px, percent, degrees$1, vw, vh, auto], findDimensionValueType = (v2) => dimensionValueTypes.find(testValueType(v2));
|
|
13103
13139
|
class DOMKeyframesResolver extends KeyframeResolver {
|
|
13104
13140
|
constructor(unresolvedKeyframes, onComplete, name, motionValue2, element) {
|
|
13105
13141
|
super(unresolvedKeyframes, onComplete, name, motionValue2, element, !0);
|
|
@@ -13226,7 +13262,7 @@ class BaseAnimation {
|
|
|
13226
13262
|
if (delay2)
|
|
13227
13263
|
this.options.duration = 0;
|
|
13228
13264
|
else {
|
|
13229
|
-
onUpdate
|
|
13265
|
+
onUpdate && onUpdate(getFinalKeyframe(keyframes2, this.options, finalKeyframe)), onComplete && onComplete(), this.resolveFinishedPromise();
|
|
13230
13266
|
return;
|
|
13231
13267
|
}
|
|
13232
13268
|
const resolvedAnimation = this.initPlayback(keyframes2, finalKeyframe);
|
|
@@ -13375,7 +13411,7 @@ const springDefaults = {
|
|
|
13375
13411
|
}, safeMin = 1e-3;
|
|
13376
13412
|
function findSpring({ duration = springDefaults.duration, bounce = springDefaults.bounce, velocity = springDefaults.velocity, mass = springDefaults.mass }) {
|
|
13377
13413
|
let envelope, derivative, dampingRatio = 1 - bounce;
|
|
13378
|
-
dampingRatio = clamp$1(springDefaults.minDamping, springDefaults.maxDamping, dampingRatio), duration = clamp$1(springDefaults.minDuration, springDefaults.maxDuration, millisecondsToSeconds(duration)), dampingRatio < 1 ? (envelope = (undampedFreq2) => {
|
|
13414
|
+
dampingRatio = clamp$1(springDefaults.minDamping, springDefaults.maxDamping, dampingRatio), duration = clamp$1(springDefaults.minDuration, springDefaults.maxDuration, /* @__PURE__ */ millisecondsToSeconds(duration)), dampingRatio < 1 ? (envelope = (undampedFreq2) => {
|
|
13379
13415
|
const exponentialDecay = undampedFreq2 * dampingRatio, delta = exponentialDecay * duration, a2 = exponentialDecay - velocity, b2 = calcAngularFreq(undampedFreq2, dampingRatio), c2 = Math.exp(-delta);
|
|
13380
13416
|
return safeMin - a2 / b2 * c2;
|
|
13381
13417
|
}, derivative = (undampedFreq2) => {
|
|
@@ -13389,7 +13425,7 @@ function findSpring({ duration = springDefaults.duration, bounce = springDefault
|
|
|
13389
13425
|
return a2 * b2;
|
|
13390
13426
|
});
|
|
13391
13427
|
const initialGuess = 5 / duration, undampedFreq = approximateRoot(envelope, derivative, initialGuess);
|
|
13392
|
-
if (duration = secondsToMilliseconds(duration), isNaN(undampedFreq))
|
|
13428
|
+
if (duration = /* @__PURE__ */ secondsToMilliseconds(duration), isNaN(undampedFreq))
|
|
13393
13429
|
return {
|
|
13394
13430
|
stiffness: springDefaults.stiffness,
|
|
13395
13431
|
damping: springDefaults.damping,
|
|
@@ -13455,8 +13491,8 @@ function spring(optionsOrVisualDuration = springDefaults.visualDuration, bounce
|
|
|
13455
13491
|
let { restSpeed, restDelta } = options;
|
|
13456
13492
|
const origin = options.keyframes[0], target = options.keyframes[options.keyframes.length - 1], state = { done: !1, value: origin }, { stiffness, damping, mass, duration, velocity, isResolvedFromDuration } = getSpringOptions({
|
|
13457
13493
|
...options,
|
|
13458
|
-
velocity:
|
|
13459
|
-
}), initialVelocity = velocity || 0, dampingRatio = damping / (2 * Math.sqrt(stiffness * mass)), initialDelta = target - origin, undampedAngularFreq = millisecondsToSeconds(Math.sqrt(stiffness / mass)), isGranularScale = Math.abs(initialDelta) < 5;
|
|
13494
|
+
velocity: -/* @__PURE__ */ millisecondsToSeconds(options.velocity || 0)
|
|
13495
|
+
}), 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;
|
|
13460
13496
|
restSpeed || (restSpeed = isGranularScale ? springDefaults.restSpeed.granular : springDefaults.restSpeed.default), restDelta || (restDelta = isGranularScale ? springDefaults.restDelta.granular : springDefaults.restDelta.default);
|
|
13461
13497
|
let resolveSpring;
|
|
13462
13498
|
if (dampingRatio < 1) {
|
|
@@ -13482,7 +13518,7 @@ function spring(optionsOrVisualDuration = springDefaults.visualDuration, bounce
|
|
|
13482
13518
|
state.done = t2 >= duration;
|
|
13483
13519
|
else {
|
|
13484
13520
|
let currentVelocity = 0;
|
|
13485
|
-
dampingRatio < 1 && (currentVelocity = t2 === 0 ? secondsToMilliseconds(initialVelocity) : calcGeneratorVelocity(resolveSpring, t2, current));
|
|
13521
|
+
dampingRatio < 1 && (currentVelocity = t2 === 0 ? /* @__PURE__ */ secondsToMilliseconds(initialVelocity) : calcGeneratorVelocity(resolveSpring, t2, current));
|
|
13486
13522
|
const isBelowVelocityThreshold = Math.abs(currentVelocity) <= restSpeed, isBelowDisplacementThreshold = Math.abs(target - current) <= restDelta;
|
|
13487
13523
|
state.done = isBelowVelocityThreshold && isBelowDisplacementThreshold;
|
|
13488
13524
|
}
|
|
@@ -13564,15 +13600,18 @@ function interpolate$1(input, output, { clamp: isClamp = !0, ease: ease2, mixer
|
|
|
13564
13600
|
const inputLength = input.length;
|
|
13565
13601
|
if (invariant(inputLength === output.length), inputLength === 1)
|
|
13566
13602
|
return () => output[0];
|
|
13567
|
-
if (inputLength === 2 &&
|
|
13603
|
+
if (inputLength === 2 && output[0] === output[1])
|
|
13568
13604
|
return () => output[1];
|
|
13605
|
+
const isZeroDeltaRange = input[0] === input[1];
|
|
13569
13606
|
input[0] > input[inputLength - 1] && (input = [...input].reverse(), output = [...output].reverse());
|
|
13570
13607
|
const mixers = createMixers(output, ease2, mixer), numMixers = mixers.length, interpolator = (v2) => {
|
|
13608
|
+
if (isZeroDeltaRange && v2 < input[0])
|
|
13609
|
+
return output[0];
|
|
13571
13610
|
let i2 = 0;
|
|
13572
13611
|
if (numMixers > 1)
|
|
13573
13612
|
for (; i2 < input.length - 2 && !(v2 < input[i2 + 1]); i2++)
|
|
13574
13613
|
;
|
|
13575
|
-
const progressInRange = progress(input[i2], input[i2 + 1], v2);
|
|
13614
|
+
const progressInRange = /* @__PURE__ */ progress(input[i2], input[i2 + 1], v2);
|
|
13576
13615
|
return mixers[i2](progressInRange);
|
|
13577
13616
|
};
|
|
13578
13617
|
return isClamp ? (v2) => interpolator(clamp$1(input[0], input[inputLength - 1], v2)) : interpolator;
|
|
@@ -13580,7 +13619,7 @@ function interpolate$1(input, output, { clamp: isClamp = !0, ease: ease2, mixer
|
|
|
13580
13619
|
function fillOffset(offset2, remaining) {
|
|
13581
13620
|
const min2 = offset2[offset2.length - 1];
|
|
13582
13621
|
for (let i2 = 1; i2 <= remaining; i2++) {
|
|
13583
|
-
const offsetProgress = progress(0, remaining, i2);
|
|
13622
|
+
const offsetProgress = /* @__PURE__ */ progress(0, remaining, i2);
|
|
13584
13623
|
offset2.push(mixNumber$1(min2, 1, offsetProgress));
|
|
13585
13624
|
}
|
|
13586
13625
|
}
|
|
@@ -13696,20 +13735,20 @@ class MainThreadAnimation extends BaseAnimation {
|
|
|
13696
13735
|
}
|
|
13697
13736
|
get duration() {
|
|
13698
13737
|
const { resolved } = this;
|
|
13699
|
-
return resolved ? millisecondsToSeconds(resolved.calculatedDuration) : 0;
|
|
13738
|
+
return resolved ? /* @__PURE__ */ millisecondsToSeconds(resolved.calculatedDuration) : 0;
|
|
13700
13739
|
}
|
|
13701
13740
|
get time() {
|
|
13702
|
-
return millisecondsToSeconds(this.currentTime);
|
|
13741
|
+
return /* @__PURE__ */ millisecondsToSeconds(this.currentTime);
|
|
13703
13742
|
}
|
|
13704
13743
|
set time(newTime) {
|
|
13705
|
-
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);
|
|
13744
|
+
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);
|
|
13706
13745
|
}
|
|
13707
13746
|
get speed() {
|
|
13708
13747
|
return this.playbackSpeed;
|
|
13709
13748
|
}
|
|
13710
13749
|
set speed(newSpeed) {
|
|
13711
13750
|
const hasChanged = this.playbackSpeed !== newSpeed;
|
|
13712
|
-
this.playbackSpeed = newSpeed, hasChanged && (this.time = millisecondsToSeconds(this.currentTime));
|
|
13751
|
+
this.playbackSpeed = newSpeed, hasChanged && (this.time = /* @__PURE__ */ millisecondsToSeconds(this.currentTime));
|
|
13713
13752
|
}
|
|
13714
13753
|
play() {
|
|
13715
13754
|
if (this.resolver.isScheduled || this.resolver.resume(), !this._resolved) {
|
|
@@ -13813,9 +13852,8 @@ class AcceleratedAnimation extends BaseAnimation {
|
|
|
13813
13852
|
this.resolver = new DOMKeyframesResolver(keyframes2, (resolvedKeyframes, finalKeyframe) => this.onKeyframesResolved(resolvedKeyframes, finalKeyframe), name, motionValue2, element), this.resolver.scheduleResolve();
|
|
13814
13853
|
}
|
|
13815
13854
|
initPlayback(keyframes2, finalKeyframe) {
|
|
13816
|
-
var _a;
|
|
13817
13855
|
let { duration = 300, times, ease: ease2, type, motionValue: motionValue2, name, startTime } = this.options;
|
|
13818
|
-
if (!
|
|
13856
|
+
if (!motionValue2.owner || !motionValue2.owner.current)
|
|
13819
13857
|
return !1;
|
|
13820
13858
|
if (typeof ease2 == "string" && supportsLinearEasing() && isUnsupportedEase(ease2) && (ease2 = unsupportedEasingFunctions[ease2]), requiresPregeneratedKeyframes(this.options)) {
|
|
13821
13859
|
const { onComplete, onUpdate, motionValue: motionValue3, element, ...options } = this.options, pregeneratedAnimation = pregenerateKeyframes(keyframes2, options);
|
|
@@ -13839,21 +13877,21 @@ class AcceleratedAnimation extends BaseAnimation {
|
|
|
13839
13877
|
if (!resolved)
|
|
13840
13878
|
return 0;
|
|
13841
13879
|
const { duration } = resolved;
|
|
13842
|
-
return millisecondsToSeconds(duration);
|
|
13880
|
+
return /* @__PURE__ */ millisecondsToSeconds(duration);
|
|
13843
13881
|
}
|
|
13844
13882
|
get time() {
|
|
13845
13883
|
const { resolved } = this;
|
|
13846
13884
|
if (!resolved)
|
|
13847
13885
|
return 0;
|
|
13848
13886
|
const { animation } = resolved;
|
|
13849
|
-
return millisecondsToSeconds(animation.currentTime || 0);
|
|
13887
|
+
return /* @__PURE__ */ millisecondsToSeconds(animation.currentTime || 0);
|
|
13850
13888
|
}
|
|
13851
13889
|
set time(newTime) {
|
|
13852
13890
|
const { resolved } = this;
|
|
13853
13891
|
if (!resolved)
|
|
13854
13892
|
return;
|
|
13855
13893
|
const { animation } = resolved;
|
|
13856
|
-
animation.currentTime = secondsToMilliseconds(newTime);
|
|
13894
|
+
animation.currentTime = /* @__PURE__ */ secondsToMilliseconds(newTime);
|
|
13857
13895
|
}
|
|
13858
13896
|
get speed() {
|
|
13859
13897
|
const { resolved } = this;
|
|
@@ -13934,7 +13972,7 @@ class AcceleratedAnimation extends BaseAnimation {
|
|
|
13934
13972
|
ease: ease2,
|
|
13935
13973
|
times,
|
|
13936
13974
|
isGenerator: !0
|
|
13937
|
-
}), sampleTime = secondsToMilliseconds(this.time);
|
|
13975
|
+
}), sampleTime = /* @__PURE__ */ secondsToMilliseconds(this.time);
|
|
13938
13976
|
motionValue2.setWithVelocity(sampleAnimation.sample(sampleTime - sampleDelta).value, sampleAnimation.sample(sampleTime).value, sampleDelta);
|
|
13939
13977
|
}
|
|
13940
13978
|
const { onStop } = this.options;
|
|
@@ -13950,11 +13988,14 @@ class AcceleratedAnimation extends BaseAnimation {
|
|
|
13950
13988
|
}
|
|
13951
13989
|
static supports(options) {
|
|
13952
13990
|
const { motionValue: motionValue2, name, repeatDelay, repeatType, damping, type } = options;
|
|
13953
|
-
|
|
13991
|
+
if (!motionValue2 || !motionValue2.owner || !(motionValue2.owner.current instanceof HTMLElement))
|
|
13992
|
+
return !1;
|
|
13993
|
+
const { onUpdate, transformTemplate } = motionValue2.owner.getProps();
|
|
13994
|
+
return supportsWaapi() && name && acceleratedValues.has(name) && /**
|
|
13954
13995
|
* If we're outputting values to onUpdate then we can't use WAAPI as there's
|
|
13955
13996
|
* no way to read the value from WAAPI every frame.
|
|
13956
13997
|
*/
|
|
13957
|
-
!
|
|
13998
|
+
!onUpdate && !transformTemplate && !repeatDelay && repeatType !== "mirror" && damping !== 0 && type !== "inertia";
|
|
13958
13999
|
}
|
|
13959
14000
|
}
|
|
13960
14001
|
const underDampedSpring = {
|
|
@@ -13981,7 +14022,7 @@ function isTransitionDefined({ when, delay: _delay, delayChildren, staggerChildr
|
|
|
13981
14022
|
const animateMotionValue = (name, value, target, transition = {}, element, isHandoff) => (onComplete) => {
|
|
13982
14023
|
const valueTransition = getValueTransition$1(transition, name) || {}, delay2 = valueTransition.delay || transition.delay || 0;
|
|
13983
14024
|
let { elapsed = 0 } = transition;
|
|
13984
|
-
elapsed = elapsed - secondsToMilliseconds(delay2);
|
|
14025
|
+
elapsed = elapsed - /* @__PURE__ */ secondsToMilliseconds(delay2);
|
|
13985
14026
|
let options = {
|
|
13986
14027
|
keyframes: Array.isArray(target) ? target : [null, target],
|
|
13987
14028
|
ease: "easeOut",
|
|
@@ -14001,7 +14042,7 @@ const animateMotionValue = (name, value, target, transition = {}, element, isHan
|
|
|
14001
14042
|
isTransitionDefined(valueTransition) || (options = {
|
|
14002
14043
|
...options,
|
|
14003
14044
|
...getDefaultTransition(name, options)
|
|
14004
|
-
}), options.duration && (options.duration = secondsToMilliseconds(options.duration)), options.repeatDelay && (options.repeatDelay = secondsToMilliseconds(options.repeatDelay)), options.from !== void 0 && (options.keyframes[0] = options.from);
|
|
14045
|
+
}), 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);
|
|
14005
14046
|
let shouldSkip = !1;
|
|
14006
14047
|
if ((options.type === !1 || options.duration === 0 && !options.repeatDelay) && (options.duration = 0, options.delay === 0 && (shouldSkip = !0)), shouldSkip && !isHandoff && value.get() !== void 0) {
|
|
14007
14048
|
const finalKeyframe = getFinalKeyframe(options.keyframes, valueTransition);
|
|
@@ -14037,7 +14078,7 @@ function animateTarget(visualElement, targetAndTransition, { delay: delay2 = 0,
|
|
|
14037
14078
|
startTime !== null && (valueTransition.startTime = startTime, isHandoff = !0);
|
|
14038
14079
|
}
|
|
14039
14080
|
}
|
|
14040
|
-
addValueToWillChange(visualElement, key), value.start(animateMotionValue(key, value, valueTarget, visualElement.shouldReduceMotion &&
|
|
14081
|
+
addValueToWillChange(visualElement, key), value.start(animateMotionValue(key, value, valueTarget, visualElement.shouldReduceMotion && positionalKeys.has(key) ? { type: !1 } : valueTransition, visualElement, isHandoff));
|
|
14041
14082
|
const animation = value.animation;
|
|
14042
14083
|
animation && animations2.push(animation);
|
|
14043
14084
|
}
|
|
@@ -14362,11 +14403,11 @@ function getVelocity(history, timeDelta) {
|
|
|
14362
14403
|
return { x: 0, y: 0 };
|
|
14363
14404
|
let i2 = history.length - 1, timestampedPoint = null;
|
|
14364
14405
|
const lastPoint = lastDevicePoint(history);
|
|
14365
|
-
for (; i2 >= 0 && (timestampedPoint = history[i2], !(lastPoint.timestamp - timestampedPoint.timestamp > secondsToMilliseconds(timeDelta))); )
|
|
14406
|
+
for (; i2 >= 0 && (timestampedPoint = history[i2], !(lastPoint.timestamp - timestampedPoint.timestamp > /* @__PURE__ */ secondsToMilliseconds(timeDelta))); )
|
|
14366
14407
|
i2--;
|
|
14367
14408
|
if (!timestampedPoint)
|
|
14368
14409
|
return { x: 0, y: 0 };
|
|
14369
|
-
const time2 = millisecondsToSeconds(lastPoint.timestamp - timestampedPoint.timestamp);
|
|
14410
|
+
const time2 = /* @__PURE__ */ millisecondsToSeconds(lastPoint.timestamp - timestampedPoint.timestamp);
|
|
14370
14411
|
if (time2 === 0)
|
|
14371
14412
|
return { x: 0, y: 0 };
|
|
14372
14413
|
const currentVelocity = {
|
|
@@ -14428,7 +14469,7 @@ function calcViewportConstraints(layoutBox, constraintsBox) {
|
|
|
14428
14469
|
function calcOrigin(source, target) {
|
|
14429
14470
|
let origin = 0.5;
|
|
14430
14471
|
const sourceLength = calcLength(source), targetLength = calcLength(target);
|
|
14431
|
-
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);
|
|
14472
|
+
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);
|
|
14432
14473
|
}
|
|
14433
14474
|
function rebaseAxisConstraints(layout2, constraints) {
|
|
14434
14475
|
const relativeConstraints = {};
|
|
@@ -14824,15 +14865,6 @@ class PanGesture extends Feature {
|
|
|
14824
14865
|
this.removePointerDownListener(), this.session && this.session.end();
|
|
14825
14866
|
}
|
|
14826
14867
|
}
|
|
14827
|
-
function usePresence() {
|
|
14828
|
-
const context = useContext(PresenceContext);
|
|
14829
|
-
if (context === null)
|
|
14830
|
-
return [!0, null];
|
|
14831
|
-
const { isPresent, onExitComplete, register } = context, id2 = useId$2();
|
|
14832
|
-
useEffect$2(() => register(id2), []);
|
|
14833
|
-
const safeToRemove = useCallback(() => onExitComplete && onExitComplete(id2), [id2, onExitComplete]);
|
|
14834
|
-
return !isPresent && onExitComplete ? [!1, safeToRemove] : [!0];
|
|
14835
|
-
}
|
|
14836
14868
|
const globalProjectionState = {
|
|
14837
14869
|
/**
|
|
14838
14870
|
* Global flag as to whether the tree has animated since the last time
|
|
@@ -14982,7 +15014,7 @@ function getRadius(values2, radiusName) {
|
|
|
14982
15014
|
}
|
|
14983
15015
|
const easeCrossfadeIn = /* @__PURE__ */ compress(0, 0.5, circOut), easeCrossfadeOut = /* @__PURE__ */ compress(0.5, 0.95, noop$3);
|
|
14984
15016
|
function compress(min2, max2, easing) {
|
|
14985
|
-
return (p2) => p2 < min2 ? 0 : p2 > max2 ? 1 : easing(progress(min2, max2, p2));
|
|
15017
|
+
return (p2) => p2 < min2 ? 0 : p2 > max2 ? 1 : easing(/* @__PURE__ */ progress(min2, max2, p2));
|
|
14986
15018
|
}
|
|
14987
15019
|
function copyAxisInto(axis, originAxis) {
|
|
14988
15020
|
axis.min = originAxis.min, axis.max = originAxis.max;
|
|
@@ -15844,6 +15876,7 @@ function initPrefersReducedMotion() {
|
|
|
15844
15876
|
} else
|
|
15845
15877
|
prefersReducedMotion.current = !1;
|
|
15846
15878
|
}
|
|
15879
|
+
const valueTypes = [...dimensionValueTypes, color$1, complex], findValueType = (v2) => valueTypes.find(testValueType(v2)), visualElementStore = /* @__PURE__ */ new WeakMap();
|
|
15847
15880
|
function updateMotionValuesFromProps(element, next, prev) {
|
|
15848
15881
|
for (const key in next) {
|
|
15849
15882
|
const nextValue = next[key], prevValue = prev[key];
|
|
@@ -15864,7 +15897,7 @@ function updateMotionValuesFromProps(element, next, prev) {
|
|
|
15864
15897
|
next[key] === void 0 && element.removeValue(key);
|
|
15865
15898
|
return next;
|
|
15866
15899
|
}
|
|
15867
|
-
const
|
|
15900
|
+
const propEventHandlers = [
|
|
15868
15901
|
"AnimationStart",
|
|
15869
15902
|
"AnimationComplete",
|
|
15870
15903
|
"Update",
|
|
@@ -15891,8 +15924,8 @@ class VisualElement {
|
|
|
15891
15924
|
const now2 = time$1.now();
|
|
15892
15925
|
this.renderScheduledAt < now2 && (this.renderScheduledAt = now2, frame$1.render(this.render, !1, !0));
|
|
15893
15926
|
};
|
|
15894
|
-
const { latestValues, renderState } = visualState;
|
|
15895
|
-
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);
|
|
15927
|
+
const { latestValues, renderState, onUpdate } = visualState;
|
|
15928
|
+
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);
|
|
15896
15929
|
const { willChange, ...initialMotionValues } = this.scrapeMotionValuesFromProps(props, {}, this);
|
|
15897
15930
|
for (const key in initialMotionValues) {
|
|
15898
15931
|
const value = initialMotionValues[key];
|
|
@@ -15967,7 +16000,7 @@ class VisualElement {
|
|
|
15967
16000
|
const listenerName = "on" + key, listener = props[listenerName];
|
|
15968
16001
|
listener && (this.propEventSubscriptions[key] = this.on(key, listener));
|
|
15969
16002
|
}
|
|
15970
|
-
this.prevMotionValues = updateMotionValuesFromProps(this, this.scrapeMotionValuesFromProps(props, this.prevProps, this), this.prevMotionValues), this.handleChildMotionValue && this.handleChildMotionValue();
|
|
16003
|
+
this.prevMotionValues = updateMotionValuesFromProps(this, this.scrapeMotionValuesFromProps(props, this.prevProps, this), this.prevMotionValues), this.handleChildMotionValue && this.handleChildMotionValue(), this.onUpdate && this.onUpdate(this);
|
|
15971
16004
|
}
|
|
15972
16005
|
getProps() {
|
|
15973
16006
|
return this.props;
|
|
@@ -16233,7 +16266,7 @@ function createAnimationsFromSequence(sequence, { defaultTransition: defaultTran
|
|
|
16233
16266
|
absoluteDelta = Math.abs(delta);
|
|
16234
16267
|
}
|
|
16235
16268
|
const springTransition = { ...remainingTransition };
|
|
16236
|
-
duration !== void 0 && (springTransition.duration = secondsToMilliseconds(duration));
|
|
16269
|
+
duration !== void 0 && (springTransition.duration = /* @__PURE__ */ secondsToMilliseconds(duration));
|
|
16237
16270
|
const springEasing = createGeneratorEasing(springTransition, absoluteDelta, createGenerator);
|
|
16238
16271
|
ease2 = springEasing.ease, duration = springEasing.duration;
|
|
16239
16272
|
}
|
|
@@ -16277,7 +16310,7 @@ function createAnimationsFromSequence(sequence, { defaultTransition: defaultTran
|
|
|
16277
16310
|
const keyframes2 = [], valueOffset = [], valueEasing = [];
|
|
16278
16311
|
for (let i2 = 0; i2 < valueSequence.length; i2++) {
|
|
16279
16312
|
const { at, value, easing } = valueSequence[i2];
|
|
16280
|
-
keyframes2.push(value), valueOffset.push(progress(0, totalDuration, at)), valueEasing.push(easing || "easeOut");
|
|
16313
|
+
keyframes2.push(value), valueOffset.push(/* @__PURE__ */ progress(0, totalDuration, at)), valueEasing.push(easing || "easeOut");
|
|
16281
16314
|
}
|
|
16282
16315
|
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, {
|
|
16283
16316
|
keyframes: {},
|
|
@@ -16397,7 +16430,7 @@ function animateSequence(sequence, options, scope) {
|
|
|
16397
16430
|
}), animations2;
|
|
16398
16431
|
}
|
|
16399
16432
|
function isSequence(value) {
|
|
16400
|
-
return Array.isArray(value) && Array.isArray
|
|
16433
|
+
return Array.isArray(value) && value.some(Array.isArray);
|
|
16401
16434
|
}
|
|
16402
16435
|
function createScopedAnimate(scope) {
|
|
16403
16436
|
function scopedAnimate(subjectOrSequence, optionsOrKeyframes, options) {
|
|
@@ -30634,12 +30667,18 @@ function useDiagram() {
|
|
|
30634
30667
|
}), [actor]);
|
|
30635
30668
|
}
|
|
30636
30669
|
class Rect {
|
|
30637
|
-
constructor() {
|
|
30670
|
+
constructor(xynode, parent = null) {
|
|
30638
30671
|
__publicField(this, "id");
|
|
30639
30672
|
__publicField(this, "minX", 1 / 0);
|
|
30640
30673
|
__publicField(this, "minY", 1 / 0);
|
|
30641
30674
|
__publicField(this, "maxX", -1 / 0);
|
|
30642
30675
|
__publicField(this, "maxY", -1 / 0);
|
|
30676
|
+
this.id = xynode.id, this.positionAbsolute = parent ? {
|
|
30677
|
+
x: xynode.position.x + parent.minX,
|
|
30678
|
+
y: xynode.position.y + parent.minY
|
|
30679
|
+
} : xynode.position;
|
|
30680
|
+
const { width: width2, height } = getNodeDimensions(xynode);
|
|
30681
|
+
this.maxX = this.minX + Math.ceil(width2), this.maxY = this.minY + Math.ceil(height), parent && parent.children.push(this);
|
|
30643
30682
|
}
|
|
30644
30683
|
get positionAbsolute() {
|
|
30645
30684
|
return {
|
|
@@ -30672,16 +30711,14 @@ class Rect {
|
|
|
30672
30711
|
__publicField(Rect, "LeftPadding", 40), __publicField(Rect, "RightPadding", 40), __publicField(Rect, "TopPadding", 55), __publicField(Rect, "BottomPadding", 40);
|
|
30673
30712
|
class Compound extends Rect {
|
|
30674
30713
|
constructor(xynode, parent = null) {
|
|
30675
|
-
super();
|
|
30714
|
+
super(xynode, parent);
|
|
30676
30715
|
__publicField(this, "children", []);
|
|
30677
|
-
this.parent = parent
|
|
30716
|
+
this.parent = parent;
|
|
30678
30717
|
}
|
|
30679
30718
|
}
|
|
30680
30719
|
class Leaf extends Rect {
|
|
30681
30720
|
constructor(xynode, parent = null) {
|
|
30682
|
-
super(), this.parent = parent
|
|
30683
|
-
const { width: width2, height } = getNodeDimensions(xynode);
|
|
30684
|
-
this.maxX = this.minX + Math.ceil(width2), this.maxY = this.minY + Math.ceil(height), parent && parent.children.push(this);
|
|
30721
|
+
super(xynode, parent), this.parent = parent;
|
|
30685
30722
|
}
|
|
30686
30723
|
}
|
|
30687
30724
|
function createLayoutConstraints(xyflowApi, editingNodeIds) {
|
|
@@ -34181,7 +34218,7 @@ function useRelationshipsBrowser() {
|
|
|
34181
34218
|
}), [actor]);
|
|
34182
34219
|
}
|
|
34183
34220
|
const ElementActions$2 = (props) => {
|
|
34184
|
-
const { enableNavigateTo } = useEnabledFeature("NavigateTo"), diagram = useDiagram(), browser = useRelationshipsBrowser(), buttons2 = [], { navigateTo, fqn: fqn2 } = props.data;
|
|
34221
|
+
const { enableNavigateTo, enableVscode } = useEnabledFeature("NavigateTo", "Vscode"), diagram = useDiagram(), browser = useRelationshipsBrowser(), buttons2 = [], { navigateTo, fqn: fqn2 } = props.data;
|
|
34185
34222
|
return navigateTo && enableNavigateTo && buttons2.push({
|
|
34186
34223
|
key: "navigate",
|
|
34187
34224
|
icon: /* @__PURE__ */ jsx(IconZoomScan, {}),
|
|
@@ -34194,6 +34231,12 @@ const ElementActions$2 = (props) => {
|
|
|
34194
34231
|
onClick: (e2) => {
|
|
34195
34232
|
e2.stopPropagation(), browser.navigateTo(fqn2, props.id);
|
|
34196
34233
|
}
|
|
34234
|
+
}), enableVscode && buttons2.push({
|
|
34235
|
+
key: "goToSource",
|
|
34236
|
+
icon: /* @__PURE__ */ jsx(IconFileSymlink, {}),
|
|
34237
|
+
onClick: (e2) => {
|
|
34238
|
+
e2.stopPropagation(), diagram.openSource({ element: fqn2 });
|
|
34239
|
+
}
|
|
34197
34240
|
}), /* @__PURE__ */ jsx(
|
|
34198
34241
|
ElementActionButtons,
|
|
34199
34242
|
{
|
|
@@ -34582,7 +34625,7 @@ function TabPanelRelationships({
|
|
|
34582
34625
|
}) {
|
|
34583
34626
|
const layoutId = useId$1();
|
|
34584
34627
|
useState$1("view");
|
|
34585
|
-
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)
|
|
34628
|
+
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 = [
|
|
34586
34629
|
...incoming,
|
|
34587
34630
|
...outgoing
|
|
34588
34631
|
].filter((r2) => !incomingInView.includes(r2) && !outgoingInView.includes(r2)).length;
|