Mission Control Dashboard - Initial implementation

This commit is contained in:
Daniel Arroyo
2026-03-27 18:36:05 +00:00
parent 257cea2c7d
commit a8fb4d4555
12516 changed files with 2307128 additions and 2 deletions

View File

@@ -0,0 +1,4 @@
const cubicBezierAsString = ([a, b, c, d]) => `cubic-bezier(${a}, ${b}, ${c}, ${d})`;
export { cubicBezierAsString };
//# sourceMappingURL=cubic-bezier.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"cubic-bezier.mjs","sources":["../../../../../src/animation/waapi/easing/cubic-bezier.ts"],"sourcesContent":["import { BezierDefinition } from \"motion-utils\"\n\nexport const cubicBezierAsString = ([a, b, c, d]: BezierDefinition) =>\n `cubic-bezier(${a}, ${b}, ${c}, ${d})`\n"],"names":[],"mappings":"AAEO,MAAM,mBAAmB,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAmB,KAC9D,CAAA,aAAA,EAAgB,CAAC,CAAA,EAAA,EAAK,CAAC,CAAA,EAAA,EAAK,CAAC,CAAA,EAAA,EAAK,CAAC,CAAA,CAAA;;;;"}

View File

@@ -0,0 +1,15 @@
import { isBezierDefinition } from 'motion-utils';
import { supportsLinearEasing } from '../../../utils/supports/linear-easing.mjs';
import { supportedWaapiEasing } from './supported.mjs';
function isWaapiSupportedEasing(easing) {
return Boolean((typeof easing === "function" && supportsLinearEasing()) ||
!easing ||
(typeof easing === "string" &&
(easing in supportedWaapiEasing || supportsLinearEasing())) ||
isBezierDefinition(easing) ||
(Array.isArray(easing) && easing.every(isWaapiSupportedEasing)));
}
export { isWaapiSupportedEasing };
//# sourceMappingURL=is-supported.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"is-supported.mjs","sources":["../../../../../src/animation/waapi/easing/is-supported.ts"],"sourcesContent":["import { Easing, isBezierDefinition } from \"motion-utils\"\nimport { supportsLinearEasing } from \"../../../utils/supports/linear-easing\"\nimport { supportedWaapiEasing } from \"./supported\"\n\nexport function isWaapiSupportedEasing(easing?: Easing | Easing[]): boolean {\n return Boolean(\n (typeof easing === \"function\" && supportsLinearEasing()) ||\n !easing ||\n (typeof easing === \"string\" &&\n (easing in supportedWaapiEasing || supportsLinearEasing())) ||\n isBezierDefinition(easing) ||\n (Array.isArray(easing) && easing.every(isWaapiSupportedEasing))\n )\n}\n"],"names":[],"mappings":";;;;AAIM,SAAU,sBAAsB,CAAC,MAA0B,EAAA;IAC7D,OAAO,OAAO,CACV,CAAC,OAAO,MAAM,KAAK,UAAU,IAAI,oBAAoB,EAAE;AACnD,QAAA,CAAC,MAAM;SACN,OAAO,MAAM,KAAK,QAAQ;AACvB,aAAC,MAAM,IAAI,oBAAoB,IAAI,oBAAoB,EAAE,CAAC,CAAC;QAC/D,kBAAkB,CAAC,MAAM,CAAC;AAC1B,SAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,MAAM,CAAC,KAAK,CAAC,sBAAsB,CAAC,CAAC,CACtE;AACL;;;;"}

View File

@@ -0,0 +1,29 @@
import { isBezierDefinition } from 'motion-utils';
import { supportsLinearEasing } from '../../../utils/supports/linear-easing.mjs';
import { generateLinearEasing } from '../utils/linear.mjs';
import { cubicBezierAsString } from './cubic-bezier.mjs';
import { supportedWaapiEasing } from './supported.mjs';
function mapEasingToNativeEasing(easing, duration) {
if (!easing) {
return undefined;
}
else if (typeof easing === "function") {
return supportsLinearEasing()
? generateLinearEasing(easing, duration)
: "ease-out";
}
else if (isBezierDefinition(easing)) {
return cubicBezierAsString(easing);
}
else if (Array.isArray(easing)) {
return easing.map((segmentEasing) => mapEasingToNativeEasing(segmentEasing, duration) ||
supportedWaapiEasing.easeOut);
}
else {
return supportedWaapiEasing[easing];
}
}
export { mapEasingToNativeEasing };
//# sourceMappingURL=map-easing.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"map-easing.mjs","sources":["../../../../../src/animation/waapi/easing/map-easing.ts"],"sourcesContent":["import { Easing, isBezierDefinition } from \"motion-utils\"\nimport { supportsLinearEasing } from \"../../../utils/supports/linear-easing\"\nimport { generateLinearEasing } from \"../utils/linear\"\nimport { cubicBezierAsString } from \"./cubic-bezier\"\nimport { supportedWaapiEasing } from \"./supported\"\n\nexport function mapEasingToNativeEasing(\n easing: Easing | Easing[] | undefined,\n duration: number\n): undefined | string | string[] {\n if (!easing) {\n return undefined\n } else if (typeof easing === \"function\") {\n return supportsLinearEasing()\n ? generateLinearEasing(easing, duration)\n : \"ease-out\"\n } else if (isBezierDefinition(easing)) {\n return cubicBezierAsString(easing)\n } else if (Array.isArray(easing)) {\n return easing.map(\n (segmentEasing) =>\n (mapEasingToNativeEasing(segmentEasing, duration) as string) ||\n supportedWaapiEasing.easeOut\n )\n } else {\n return supportedWaapiEasing[easing as keyof typeof supportedWaapiEasing]\n }\n}\n"],"names":[],"mappings":";;;;;;AAMM,SAAU,uBAAuB,CACnC,MAAqC,EACrC,QAAgB,EAAA;IAEhB,IAAI,CAAC,MAAM,EAAE;AACT,QAAA,OAAO,SAAS;IACpB;AAAO,SAAA,IAAI,OAAO,MAAM,KAAK,UAAU,EAAE;AACrC,QAAA,OAAO,oBAAoB;AACvB,cAAE,oBAAoB,CAAC,MAAM,EAAE,QAAQ;cACrC,UAAU;IACpB;AAAO,SAAA,IAAI,kBAAkB,CAAC,MAAM,CAAC,EAAE;AACnC,QAAA,OAAO,mBAAmB,CAAC,MAAM,CAAC;IACtC;AAAO,SAAA,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;AAC9B,QAAA,OAAO,MAAM,CAAC,GAAG,CACb,CAAC,aAAa,KACT,uBAAuB,CAAC,aAAa,EAAE,QAAQ,CAAY;YAC5D,oBAAoB,CAAC,OAAO,CACnC;IACL;SAAO;AACH,QAAA,OAAO,oBAAoB,CAAC,MAA2C,CAAC;IAC5E;AACJ;;;;"}

View File

@@ -0,0 +1,16 @@
import { cubicBezierAsString } from './cubic-bezier.mjs';
const supportedWaapiEasing = {
linear: "linear",
ease: "ease",
easeIn: "ease-in",
easeOut: "ease-out",
easeInOut: "ease-in-out",
circIn: /*@__PURE__*/ cubicBezierAsString([0, 0.65, 0.55, 1]),
circOut: /*@__PURE__*/ cubicBezierAsString([0.55, 0, 1, 0.45]),
backIn: /*@__PURE__*/ cubicBezierAsString([0.31, 0.01, 0.66, -0.59]),
backOut: /*@__PURE__*/ cubicBezierAsString([0.33, 1.53, 0.69, 0.99]),
};
export { supportedWaapiEasing };
//# sourceMappingURL=supported.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"supported.mjs","sources":["../../../../../src/animation/waapi/easing/supported.ts"],"sourcesContent":["import { cubicBezierAsString } from \"./cubic-bezier\"\n\nexport const supportedWaapiEasing = {\n linear: \"linear\",\n ease: \"ease\",\n easeIn: \"ease-in\",\n easeOut: \"ease-out\",\n easeInOut: \"ease-in-out\",\n circIn: /*@__PURE__*/ cubicBezierAsString([0, 0.65, 0.55, 1]),\n circOut: /*@__PURE__*/ cubicBezierAsString([0.55, 0, 1, 0.45]),\n backIn: /*@__PURE__*/ cubicBezierAsString([0.31, 0.01, 0.66, -0.59]),\n backOut: /*@__PURE__*/ cubicBezierAsString([0.33, 1.53, 0.69, 0.99]),\n}\n"],"names":[],"mappings":";;AAEO,MAAM,oBAAoB,GAAG;AAChC,IAAA,MAAM,EAAE,QAAQ;AAChB,IAAA,IAAI,EAAE,MAAM;AACZ,IAAA,MAAM,EAAE,SAAS;AACjB,IAAA,OAAO,EAAE,UAAU;AACnB,IAAA,SAAS,EAAE,aAAa;AACxB,IAAA,MAAM,gBAAgB,mBAAmB,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;AAC7D,IAAA,OAAO,gBAAgB,mBAAmB,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,CAAC;AAC9D,IAAA,MAAM,gBAAgB,mBAAmB,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;AACpE,IAAA,OAAO,gBAAgB,mBAAmB,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;;;;;"}

View File

@@ -0,0 +1,40 @@
import { activeAnimations } from '../../stats/animation-count.mjs';
import { statsBuffer } from '../../stats/buffer.mjs';
import { mapEasingToNativeEasing } from './easing/map-easing.mjs';
function startWaapiAnimation(element, valueName, keyframes, { delay = 0, duration = 300, repeat = 0, repeatType = "loop", ease = "easeOut", times, } = {}, pseudoElement = undefined) {
const keyframeOptions = {
[valueName]: keyframes,
};
if (times)
keyframeOptions.offset = times;
const easing = mapEasingToNativeEasing(ease, duration);
/**
* If this is an easing array, apply to keyframes, not animation as a whole
*/
if (Array.isArray(easing))
keyframeOptions.easing = easing;
if (statsBuffer.value) {
activeAnimations.waapi++;
}
const options = {
delay,
duration,
easing: !Array.isArray(easing) ? easing : "linear",
fill: "both",
iterations: repeat + 1,
direction: repeatType === "reverse" ? "alternate" : "normal",
};
if (pseudoElement)
options.pseudoElement = pseudoElement;
const animation = element.animate(keyframeOptions, options);
if (statsBuffer.value) {
animation.finished.finally(() => {
activeAnimations.waapi--;
});
}
return animation;
}
export { startWaapiAnimation };
//# sourceMappingURL=start-waapi-animation.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"start-waapi-animation.mjs","sources":["../../../../src/animation/waapi/start-waapi-animation.ts"],"sourcesContent":["import { activeAnimations } from \"../../stats/animation-count\"\nimport { statsBuffer } from \"../../stats/buffer\"\nimport { ValueKeyframesDefinition, ValueTransition } from \"../types\"\nimport { mapEasingToNativeEasing } from \"./easing/map-easing\"\n\nexport function startWaapiAnimation(\n element: Element,\n valueName: string,\n keyframes: ValueKeyframesDefinition,\n {\n delay = 0,\n duration = 300,\n repeat = 0,\n repeatType = \"loop\",\n ease = \"easeOut\",\n times,\n }: ValueTransition = {},\n pseudoElement: string | undefined = undefined\n) {\n const keyframeOptions: PropertyIndexedKeyframes = {\n [valueName]: keyframes as string[],\n }\n if (times) keyframeOptions.offset = times\n\n const easing = mapEasingToNativeEasing(ease, duration)\n\n /**\n * If this is an easing array, apply to keyframes, not animation as a whole\n */\n if (Array.isArray(easing)) keyframeOptions.easing = easing\n\n if (statsBuffer.value) {\n activeAnimations.waapi++\n }\n\n const options: KeyframeAnimationOptions = {\n delay,\n duration,\n easing: !Array.isArray(easing) ? easing : \"linear\",\n fill: \"both\",\n iterations: repeat + 1,\n direction: repeatType === \"reverse\" ? \"alternate\" : \"normal\",\n }\n\n if (pseudoElement) options.pseudoElement = pseudoElement\n\n const animation = element.animate(keyframeOptions, options)\n\n if (statsBuffer.value) {\n animation.finished.finally(() => {\n activeAnimations.waapi--\n })\n }\n\n return animation\n}\n"],"names":[],"mappings":";;;;AAKM,SAAU,mBAAmB,CAC/B,OAAgB,EAChB,SAAiB,EACjB,SAAmC,EACnC,EACI,KAAK,GAAG,CAAC,EACT,QAAQ,GAAG,GAAG,EACd,MAAM,GAAG,CAAC,EACV,UAAU,GAAG,MAAM,EACnB,IAAI,GAAG,SAAS,EAChB,KAAK,GAAA,GACY,EAAE,EACvB,gBAAoC,SAAS,EAAA;AAE7C,IAAA,MAAM,eAAe,GAA6B;QAC9C,CAAC,SAAS,GAAG,SAAqB;KACrC;AACD,IAAA,IAAI,KAAK;AAAE,QAAA,eAAe,CAAC,MAAM,GAAG,KAAK;IAEzC,MAAM,MAAM,GAAG,uBAAuB,CAAC,IAAI,EAAE,QAAQ,CAAC;AAEtD;;AAEG;AACH,IAAA,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC;AAAE,QAAA,eAAe,CAAC,MAAM,GAAG,MAAM;AAE1D,IAAA,IAAI,WAAW,CAAC,KAAK,EAAE;QACnB,gBAAgB,CAAC,KAAK,EAAE;IAC5B;AAEA,IAAA,MAAM,OAAO,GAA6B;QACtC,KAAK;QACL,QAAQ;AACR,QAAA,MAAM,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,MAAM,GAAG,QAAQ;AAClD,QAAA,IAAI,EAAE,MAAM;QACZ,UAAU,EAAE,MAAM,GAAG,CAAC;QACtB,SAAS,EAAE,UAAU,KAAK,SAAS,GAAG,WAAW,GAAG,QAAQ;KAC/D;AAED,IAAA,IAAI,aAAa;AAAE,QAAA,OAAO,CAAC,aAAa,GAAG,aAAa;IAExD,MAAM,SAAS,GAAG,OAAO,CAAC,OAAO,CAAC,eAAe,EAAE,OAAO,CAAC;AAE3D,IAAA,IAAI,WAAW,CAAC,KAAK,EAAE;AACnB,QAAA,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAK;YAC5B,gBAAgB,CAAC,KAAK,EAAE;AAC5B,QAAA,CAAC,CAAC;IACN;AAEA,IAAA,OAAO,SAAS;AACpB;;;;"}

View File

@@ -0,0 +1,14 @@
import { memo } from 'motion-utils';
const supportsPartialKeyframes = /*@__PURE__*/ memo(() => {
try {
document.createElement("div").animate({ opacity: [1] });
}
catch (e) {
return false;
}
return true;
});
export { supportsPartialKeyframes };
//# sourceMappingURL=partial-keyframes.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"partial-keyframes.mjs","sources":["../../../../../src/animation/waapi/supports/partial-keyframes.ts"],"sourcesContent":["import { memo } from \"motion-utils\"\n\nexport const supportsPartialKeyframes = /*@__PURE__*/ memo(() => {\n try {\n document.createElement(\"div\").animate({ opacity: [1] })\n } catch (e) {\n return false\n }\n return true\n})\n"],"names":[],"mappings":";;MAEa,wBAAwB,iBAAiB,IAAI,CAAC,MAAK;AAC5D,IAAA,IAAI;AACA,QAAA,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IAC3D;IAAE,OAAO,CAAC,EAAE;AACR,QAAA,OAAO,KAAK;IAChB;AACA,IAAA,OAAO,IAAI;AACf,CAAC;;;;"}

View File

@@ -0,0 +1,53 @@
import { memo } from 'motion-utils';
import { acceleratedValues } from '../utils/accelerated-values.mjs';
import { hasBrowserOnlyColors } from '../utils/is-browser-color.mjs';
const colorProperties = new Set([
"color",
"backgroundColor",
"outlineColor",
"fill",
"stroke",
"borderColor",
"borderTopColor",
"borderRightColor",
"borderBottomColor",
"borderLeftColor",
]);
const supportsWaapi = /*@__PURE__*/ memo(() => Object.hasOwnProperty.call(Element.prototype, "animate"));
function supportsBrowserAnimation(options) {
const { motionValue, name, repeatDelay, repeatType, damping, type, keyframes, } = options;
const subject = motionValue?.owner?.current;
/**
* We use this check instead of isHTMLElement() because we explicitly
* **don't** want elements in different timing contexts (i.e. popups)
* to be accelerated, as it's not possible to sync these animations
* properly with those driven from the main window frameloop.
*/
if (!(subject instanceof HTMLElement)) {
return false;
}
const { onUpdate, transformTemplate } = motionValue.owner.getProps();
return (supportsWaapi() &&
name &&
/**
* Force WAAPI for color properties with browser-only color formats
* (oklch, oklab, lab, lch, etc.) that the JS animation path can't parse.
*/
(acceleratedValues.has(name) ||
(colorProperties.has(name) &&
hasBrowserOnlyColors(keyframes))) &&
(name !== "transform" || !transformTemplate) &&
/**
* If we're outputting values to onUpdate then we can't use WAAPI as there's
* no way to read the value from WAAPI every frame.
*/
!onUpdate &&
!repeatDelay &&
repeatType !== "mirror" &&
damping !== 0 &&
type !== "inertia");
}
export { supportsBrowserAnimation };
//# sourceMappingURL=waapi.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"waapi.mjs","sources":["../../../../../src/animation/waapi/supports/waapi.ts"],"sourcesContent":["import { memo } from \"motion-utils\"\nimport {\n AnyResolvedKeyframe,\n ValueAnimationOptionsWithRenderContext,\n} from \"../../types\"\nimport { acceleratedValues } from \"../utils/accelerated-values\"\nimport { hasBrowserOnlyColors } from \"../utils/is-browser-color\"\n\nconst colorProperties = new Set([\n \"color\",\n \"backgroundColor\",\n \"outlineColor\",\n \"fill\",\n \"stroke\",\n \"borderColor\",\n \"borderTopColor\",\n \"borderRightColor\",\n \"borderBottomColor\",\n \"borderLeftColor\",\n])\n\nconst supportsWaapi = /*@__PURE__*/ memo(() =>\n Object.hasOwnProperty.call(Element.prototype, \"animate\")\n)\n\nexport function supportsBrowserAnimation<T extends AnyResolvedKeyframe>(\n options: ValueAnimationOptionsWithRenderContext<T>\n) {\n const {\n motionValue,\n name,\n repeatDelay,\n repeatType,\n damping,\n type,\n keyframes,\n } = options\n\n const subject = motionValue?.owner?.current\n\n /**\n * We use this check instead of isHTMLElement() because we explicitly\n * **don't** want elements in different timing contexts (i.e. popups)\n * to be accelerated, as it's not possible to sync these animations\n * properly with those driven from the main window frameloop.\n */\n if (!(subject instanceof HTMLElement)) {\n return false\n }\n\n const { onUpdate, transformTemplate } = motionValue!.owner!.getProps()\n\n return (\n supportsWaapi() &&\n name &&\n /**\n * Force WAAPI for color properties with browser-only color formats\n * (oklch, oklab, lab, lch, etc.) that the JS animation path can't parse.\n */\n (acceleratedValues.has(name) ||\n (colorProperties.has(name) &&\n hasBrowserOnlyColors(keyframes))) &&\n (name !== \"transform\" || !transformTemplate) &&\n /**\n * If we're outputting values to onUpdate then we can't use WAAPI as there's\n * no way to read the value from WAAPI every frame.\n */\n !onUpdate &&\n !repeatDelay &&\n repeatType !== \"mirror\" &&\n damping !== 0 &&\n type !== \"inertia\"\n )\n}\n"],"names":[],"mappings":";;;;AAQA,MAAM,eAAe,GAAG,IAAI,GAAG,CAAC;IAC5B,OAAO;IACP,iBAAiB;IACjB,cAAc;IACd,MAAM;IACN,QAAQ;IACR,aAAa;IACb,gBAAgB;IAChB,kBAAkB;IAClB,mBAAmB;IACnB,iBAAiB;AACpB,CAAA,CAAC;AAEF,MAAM,aAAa,iBAAiB,IAAI,CAAC,MACrC,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,SAAS,CAAC,CAC3D;AAEK,SAAU,wBAAwB,CACpC,OAAkD,EAAA;AAElD,IAAA,MAAM,EACF,WAAW,EACX,IAAI,EACJ,WAAW,EACX,UAAU,EACV,OAAO,EACP,IAAI,EACJ,SAAS,GACZ,GAAG,OAAO;AAEX,IAAA,MAAM,OAAO,GAAG,WAAW,EAAE,KAAK,EAAE,OAAO;AAE3C;;;;;AAKG;AACH,IAAA,IAAI,EAAE,OAAO,YAAY,WAAW,CAAC,EAAE;AACnC,QAAA,OAAO,KAAK;IAChB;AAEA,IAAA,MAAM,EAAE,QAAQ,EAAE,iBAAiB,EAAE,GAAG,WAAY,CAAC,KAAM,CAAC,QAAQ,EAAE;IAEtE,QACI,aAAa,EAAE;QACf,IAAI;AACJ;;;AAGG;AACH,SAAC,iBAAiB,CAAC,GAAG,CAAC,IAAI,CAAC;AACxB,aAAC,eAAe,CAAC,GAAG,CAAC,IAAI,CAAC;AACtB,gBAAA,oBAAoB,CAAC,SAAS,CAAC,CAAC,CAAC;AACzC,SAAC,IAAI,KAAK,WAAW,IAAI,CAAC,iBAAiB,CAAC;AAC5C;;;AAGG;AACH,QAAA,CAAC,QAAQ;AACT,QAAA,CAAC,WAAW;AACZ,QAAA,UAAU,KAAK,QAAQ;AACvB,QAAA,OAAO,KAAK,CAAC;QACb,IAAI,KAAK,SAAS;AAE1B;;;;"}

View File

@@ -0,0 +1,15 @@
/**
* A list of values that can be hardware-accelerated.
*/
const acceleratedValues = new Set([
"opacity",
"clipPath",
"filter",
"transform",
// TODO: Can be accelerated but currently disabled until https://issues.chromium.org/issues/41491098 is resolved
// or until we implement support for linear() easing.
// "background-color"
]);
export { acceleratedValues };
//# sourceMappingURL=accelerated-values.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"accelerated-values.mjs","sources":["../../../../../src/animation/waapi/utils/accelerated-values.ts"],"sourcesContent":["/**\n * A list of values that can be hardware-accelerated.\n */\nexport const acceleratedValues = new Set<string>([\n \"opacity\",\n \"clipPath\",\n \"filter\",\n \"transform\",\n // TODO: Can be accelerated but currently disabled until https://issues.chromium.org/issues/41491098 is resolved\n // or until we implement support for linear() easing.\n // \"background-color\"\n])\n"],"names":[],"mappings":"AAAA;;AAEG;AACI,MAAM,iBAAiB,GAAG,IAAI,GAAG,CAAS;IAC7C,SAAS;IACT,UAAU;IACV,QAAQ;IACR,WAAW;;;;AAId,CAAA;;;;"}

View File

@@ -0,0 +1,16 @@
import { supportsLinearEasing } from '../../../utils/supports/linear-easing.mjs';
import { isGenerator } from '../../generators/utils/is-generator.mjs';
function applyGeneratorOptions({ type, ...options }) {
if (isGenerator(type) && supportsLinearEasing()) {
return type.applyToOptions(options);
}
else {
options.duration ?? (options.duration = 300);
options.ease ?? (options.ease = "easeOut");
}
return options;
}
export { applyGeneratorOptions };
//# sourceMappingURL=apply-generator.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"apply-generator.mjs","sources":["../../../../../src/animation/waapi/utils/apply-generator.ts"],"sourcesContent":["import { ValueTransition } from \"../../../animation/types\"\nimport { supportsLinearEasing } from \"../../../utils/supports/linear-easing\"\nimport { isGenerator } from \"../../generators/utils/is-generator\"\n\nexport function applyGeneratorOptions({\n type,\n ...options\n}: ValueTransition): ValueTransition {\n if (isGenerator(type) && supportsLinearEasing()) {\n return type.applyToOptions!(options)\n } else {\n options.duration ??= 300\n options.ease ??= \"easeOut\"\n }\n\n return options\n}\n"],"names":[],"mappings":";;;AAIM,SAAU,qBAAqB,CAAC,EAClC,IAAI,EACJ,GAAG,OAAO,EACI,EAAA;IACd,IAAI,WAAW,CAAC,IAAI,CAAC,IAAI,oBAAoB,EAAE,EAAE;AAC7C,QAAA,OAAO,IAAI,CAAC,cAAe,CAAC,OAAO,CAAC;IACxC;SAAO;QACH,OAAO,CAAC,QAAQ,KAAhB,OAAO,CAAC,QAAQ,GAAK,GAAG,CAAA;QACxB,OAAO,CAAC,IAAI,KAAZ,OAAO,CAAC,IAAI,GAAK,SAAS,CAAA;IAC9B;AAEA,IAAA,OAAO,OAAO;AAClB;;;;"}

View File

@@ -0,0 +1,13 @@
const browserColorFunctions = /^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;
function hasBrowserOnlyColors(keyframes) {
for (let i = 0; i < keyframes.length; i++) {
if (typeof keyframes[i] === "string" &&
browserColorFunctions.test(keyframes[i])) {
return true;
}
}
return false;
}
export { hasBrowserOnlyColors };
//# sourceMappingURL=is-browser-color.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"is-browser-color.mjs","sources":["../../../../../src/animation/waapi/utils/is-browser-color.ts"],"sourcesContent":["const browserColorFunctions =\n /^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\\(/\n\nexport function hasBrowserOnlyColors(keyframes: any[]): boolean {\n for (let i = 0; i < keyframes.length; i++) {\n if (\n typeof keyframes[i] === \"string\" &&\n browserColorFunctions.test(keyframes[i])\n ) {\n return true\n }\n }\n return false\n}\n"],"names":[],"mappings":"AAAA,MAAM,qBAAqB,GACvB,uDAAuD;AAErD,SAAU,oBAAoB,CAAC,SAAgB,EAAA;AACjD,IAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;AACvC,QAAA,IACI,OAAO,SAAS,CAAC,CAAC,CAAC,KAAK,QAAQ;YAChC,qBAAqB,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,EAC1C;AACE,YAAA,OAAO,IAAI;QACf;IACJ;AACA,IAAA,OAAO,KAAK;AAChB;;;;"}

View File

@@ -0,0 +1,13 @@
const generateLinearEasing = (easing, duration, // as milliseconds
resolution = 10 // as milliseconds
) => {
let points = "";
const numPoints = Math.max(Math.round(duration / resolution), 2);
for (let i = 0; i < numPoints; i++) {
points += Math.round(easing(i / (numPoints - 1)) * 10000) / 10000 + ", ";
}
return `linear(${points.substring(0, points.length - 2)})`;
};
export { generateLinearEasing };
//# sourceMappingURL=linear.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"linear.mjs","sources":["../../../../../src/animation/waapi/utils/linear.ts"],"sourcesContent":["import { EasingFunction } from \"motion-utils\"\n\nexport const generateLinearEasing = (\n easing: EasingFunction,\n duration: number, // as milliseconds\n resolution: number = 10 // as milliseconds\n): string => {\n let points = \"\"\n const numPoints = Math.max(Math.round(duration / resolution), 2)\n\n for (let i = 0; i < numPoints; i++) {\n points += Math.round(easing(i / (numPoints - 1)) * 10000) / 10000 + \", \"\n }\n\n return `linear(${points.substring(0, points.length - 2)})`\n}\n"],"names":[],"mappings":"MAEa,oBAAoB,GAAG,CAChC,MAAsB,EACtB,QAAgB;AAChB,UAAA,GAAqB,EAAE;KACf;IACR,IAAI,MAAM,GAAG,EAAE;AACf,IAAA,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,GAAG,UAAU,CAAC,EAAE,CAAC,CAAC;AAEhE,IAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,EAAE,CAAC,EAAE,EAAE;QAChC,MAAM,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,SAAS,GAAG,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,GAAG,KAAK,GAAG,IAAI;IAC5E;AAEA,IAAA,OAAO,CAAA,OAAA,EAAU,MAAM,CAAC,SAAS,CAAC,CAAC,EAAE,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG;AAC9D;;;;"}

View File

@@ -0,0 +1,60 @@
const pxValues = new Set([
// Border props
"borderWidth",
"borderTopWidth",
"borderRightWidth",
"borderBottomWidth",
"borderLeftWidth",
"borderRadius",
"borderTopLeftRadius",
"borderTopRightRadius",
"borderBottomRightRadius",
"borderBottomLeftRadius",
// Positioning props
"width",
"maxWidth",
"height",
"maxHeight",
"top",
"right",
"bottom",
"left",
"inset",
"insetBlock",
"insetBlockStart",
"insetBlockEnd",
"insetInline",
"insetInlineStart",
"insetInlineEnd",
// Spacing props
"padding",
"paddingTop",
"paddingRight",
"paddingBottom",
"paddingLeft",
"paddingBlock",
"paddingBlockStart",
"paddingBlockEnd",
"paddingInline",
"paddingInlineStart",
"paddingInlineEnd",
"margin",
"marginTop",
"marginRight",
"marginBottom",
"marginLeft",
"marginBlock",
"marginBlockStart",
"marginBlockEnd",
"marginInline",
"marginInlineStart",
"marginInlineEnd",
// Typography
"fontSize",
// Misc
"backgroundPositionX",
"backgroundPositionY",
]);
export { pxValues };
//# sourceMappingURL=px-values.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"px-values.mjs","sources":["../../../../../src/animation/waapi/utils/px-values.ts"],"sourcesContent":["export const pxValues = new Set([\n // Border props\n \"borderWidth\",\n \"borderTopWidth\",\n \"borderRightWidth\",\n \"borderBottomWidth\",\n \"borderLeftWidth\",\n \"borderRadius\",\n \"borderTopLeftRadius\",\n \"borderTopRightRadius\",\n \"borderBottomRightRadius\",\n \"borderBottomLeftRadius\",\n // Positioning props\n \"width\",\n \"maxWidth\",\n \"height\",\n \"maxHeight\",\n \"top\",\n \"right\",\n \"bottom\",\n \"left\",\n \"inset\",\n \"insetBlock\",\n \"insetBlockStart\",\n \"insetBlockEnd\",\n \"insetInline\",\n \"insetInlineStart\",\n \"insetInlineEnd\",\n // Spacing props\n \"padding\",\n \"paddingTop\",\n \"paddingRight\",\n \"paddingBottom\",\n \"paddingLeft\",\n \"paddingBlock\",\n \"paddingBlockStart\",\n \"paddingBlockEnd\",\n \"paddingInline\",\n \"paddingInlineStart\",\n \"paddingInlineEnd\",\n \"margin\",\n \"marginTop\",\n \"marginRight\",\n \"marginBottom\",\n \"marginLeft\",\n \"marginBlock\",\n \"marginBlockStart\",\n \"marginBlockEnd\",\n \"marginInline\",\n \"marginInlineStart\",\n \"marginInlineEnd\",\n // Typography\n \"fontSize\",\n // Misc\n \"backgroundPositionX\",\n \"backgroundPositionY\",\n])\n"],"names":[],"mappings":"AAAO,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC;;IAE5B,aAAa;IACb,gBAAgB;IAChB,kBAAkB;IAClB,mBAAmB;IACnB,iBAAiB;IACjB,cAAc;IACd,qBAAqB;IACrB,sBAAsB;IACtB,yBAAyB;IACzB,wBAAwB;;IAExB,OAAO;IACP,UAAU;IACV,QAAQ;IACR,WAAW;IACX,KAAK;IACL,OAAO;IACP,QAAQ;IACR,MAAM;IACN,OAAO;IACP,YAAY;IACZ,iBAAiB;IACjB,eAAe;IACf,aAAa;IACb,kBAAkB;IAClB,gBAAgB;;IAEhB,SAAS;IACT,YAAY;IACZ,cAAc;IACd,eAAe;IACf,aAAa;IACb,cAAc;IACd,mBAAmB;IACnB,iBAAiB;IACjB,eAAe;IACf,oBAAoB;IACpB,kBAAkB;IAClB,QAAQ;IACR,WAAW;IACX,aAAa;IACb,cAAc;IACd,YAAY;IACZ,aAAa;IACb,kBAAkB;IAClB,gBAAgB;IAChB,cAAc;IACd,mBAAmB;IACnB,iBAAiB;;IAEjB,UAAU;;IAEV,qBAAqB;IACrB,qBAAqB;AACxB,CAAA;;;;"}

View File

@@ -0,0 +1,19 @@
import { circInOut, backInOut, anticipate } from 'motion-utils';
const unsupportedEasingFunctions = {
anticipate,
backInOut,
circInOut,
};
function isUnsupportedEase(key) {
return key in unsupportedEasingFunctions;
}
function replaceStringEasing(transition) {
if (typeof transition.ease === "string" &&
isUnsupportedEase(transition.ease)) {
transition.ease = unsupportedEasingFunctions[transition.ease];
}
}
export { replaceStringEasing };
//# sourceMappingURL=unsupported-easing.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"unsupported-easing.mjs","sources":["../../../../../src/animation/waapi/utils/unsupported-easing.ts"],"sourcesContent":["import { anticipate, backInOut, circInOut } from \"motion-utils\"\nimport { ValueAnimationTransition } from \"../../types\"\n\nconst unsupportedEasingFunctions = {\n anticipate,\n backInOut,\n circInOut,\n}\n\nfunction isUnsupportedEase(\n key: string\n): key is keyof typeof unsupportedEasingFunctions {\n return key in unsupportedEasingFunctions\n}\n\nexport function replaceStringEasing(transition: ValueAnimationTransition) {\n if (\n typeof transition.ease === \"string\" &&\n isUnsupportedEase(transition.ease)\n ) {\n transition.ease = unsupportedEasingFunctions[transition.ease]\n }\n}\n"],"names":[],"mappings":";;AAGA,MAAM,0BAA0B,GAAG;IAC/B,UAAU;IACV,SAAS;IACT,SAAS;CACZ;AAED,SAAS,iBAAiB,CACtB,GAAW,EAAA;IAEX,OAAO,GAAG,IAAI,0BAA0B;AAC5C;AAEM,SAAU,mBAAmB,CAAC,UAAoC,EAAA;AACpE,IAAA,IACI,OAAO,UAAU,CAAC,IAAI,KAAK,QAAQ;AACnC,QAAA,iBAAiB,CAAC,UAAU,CAAC,IAAI,CAAC,EACpC;QACE,UAAU,CAAC,IAAI,GAAG,0BAA0B,CAAC,UAAU,CAAC,IAAI,CAAC;IACjE;AACJ;;;;"}