Mission Control Dashboard - Initial implementation
This commit is contained in:
65
node_modules/motion-dom/dist/es/view/index.mjs
generated
vendored
Normal file
65
node_modules/motion-dom/dist/es/view/index.mjs
generated
vendored
Normal file
@@ -0,0 +1,65 @@
|
||||
import { noop } from 'motion-utils';
|
||||
import { addToQueue } from './queue.mjs';
|
||||
|
||||
class ViewTransitionBuilder {
|
||||
constructor(update, options = {}) {
|
||||
this.currentSubject = "root";
|
||||
this.targets = new Map();
|
||||
this.notifyReady = noop;
|
||||
this.readyPromise = new Promise((resolve) => {
|
||||
this.notifyReady = resolve;
|
||||
});
|
||||
this.update = update;
|
||||
this.options = {
|
||||
interrupt: "wait",
|
||||
...options,
|
||||
};
|
||||
addToQueue(this);
|
||||
}
|
||||
get(subject) {
|
||||
this.currentSubject = subject;
|
||||
return this;
|
||||
}
|
||||
layout(keyframes, options) {
|
||||
this.updateTarget("layout", keyframes, options);
|
||||
return this;
|
||||
}
|
||||
new(keyframes, options) {
|
||||
this.updateTarget("new", keyframes, options);
|
||||
return this;
|
||||
}
|
||||
old(keyframes, options) {
|
||||
this.updateTarget("old", keyframes, options);
|
||||
return this;
|
||||
}
|
||||
enter(keyframes, options) {
|
||||
this.updateTarget("enter", keyframes, options);
|
||||
return this;
|
||||
}
|
||||
exit(keyframes, options) {
|
||||
this.updateTarget("exit", keyframes, options);
|
||||
return this;
|
||||
}
|
||||
crossfade(options) {
|
||||
this.updateTarget("enter", { opacity: 1 }, options);
|
||||
this.updateTarget("exit", { opacity: 0 }, options);
|
||||
return this;
|
||||
}
|
||||
updateTarget(target, keyframes, options = {}) {
|
||||
const { currentSubject, targets } = this;
|
||||
if (!targets.has(currentSubject)) {
|
||||
targets.set(currentSubject, {});
|
||||
}
|
||||
const targetData = targets.get(currentSubject);
|
||||
targetData[target] = { keyframes, options };
|
||||
}
|
||||
then(resolve, reject) {
|
||||
return this.readyPromise.then(resolve, reject);
|
||||
}
|
||||
}
|
||||
function animateView(update, defaultOptions = {}) {
|
||||
return new ViewTransitionBuilder(update, defaultOptions);
|
||||
}
|
||||
|
||||
export { ViewTransitionBuilder, animateView };
|
||||
//# sourceMappingURL=index.mjs.map
|
||||
1
node_modules/motion-dom/dist/es/view/index.mjs.map
generated
vendored
Normal file
1
node_modules/motion-dom/dist/es/view/index.mjs.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
53
node_modules/motion-dom/dist/es/view/queue.mjs
generated
vendored
Normal file
53
node_modules/motion-dom/dist/es/view/queue.mjs
generated
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
import { removeItem } from 'motion-utils';
|
||||
import { microtask } from '../frameloop/microtask.mjs';
|
||||
import { startViewAnimation } from './start.mjs';
|
||||
|
||||
let builders = [];
|
||||
let current = null;
|
||||
function next() {
|
||||
current = null;
|
||||
const [nextBuilder] = builders;
|
||||
if (nextBuilder)
|
||||
start(nextBuilder);
|
||||
}
|
||||
function start(builder) {
|
||||
removeItem(builders, builder);
|
||||
current = builder;
|
||||
startViewAnimation(builder).then((animation) => {
|
||||
builder.notifyReady(animation);
|
||||
animation.finished.finally(next);
|
||||
});
|
||||
}
|
||||
function processQueue() {
|
||||
/**
|
||||
* Iterate backwards over the builders array. We can ignore the
|
||||
* "wait" animations. If we have an interrupting animation in the
|
||||
* queue then we need to batch all preceeding animations into it.
|
||||
* Currently this only batches the update functions but will also
|
||||
* need to batch the targets.
|
||||
*/
|
||||
for (let i = builders.length - 1; i >= 0; i--) {
|
||||
const builder = builders[i];
|
||||
const { interrupt } = builder.options;
|
||||
if (interrupt === "immediate") {
|
||||
const batchedUpdates = builders.slice(0, i + 1).map((b) => b.update);
|
||||
const remaining = builders.slice(i + 1);
|
||||
builder.update = () => {
|
||||
batchedUpdates.forEach((update) => update());
|
||||
};
|
||||
// Put the current builder at the front, followed by any "wait" builders
|
||||
builders = [builder, ...remaining];
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!current || builders[0]?.options.interrupt === "immediate") {
|
||||
next();
|
||||
}
|
||||
}
|
||||
function addToQueue(builder) {
|
||||
builders.push(builder);
|
||||
microtask.render(processQueue);
|
||||
}
|
||||
|
||||
export { addToQueue };
|
||||
//# sourceMappingURL=queue.mjs.map
|
||||
1
node_modules/motion-dom/dist/es/view/queue.mjs.map
generated
vendored
Normal file
1
node_modules/motion-dom/dist/es/view/queue.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"queue.mjs","sources":["../../../src/view/queue.ts"],"sourcesContent":["import { removeItem } from \"motion-utils\"\nimport type { ViewTransitionBuilder } from \".\"\nimport { microtask } from \"../frameloop/microtask\"\nimport { startViewAnimation } from \"./start\"\n\nlet builders: ViewTransitionBuilder[] = []\n\nlet current: ViewTransitionBuilder | null = null\n\nfunction next() {\n current = null\n const [nextBuilder] = builders\n if (nextBuilder) start(nextBuilder)\n}\n\nfunction start(builder: ViewTransitionBuilder) {\n removeItem(builders, builder)\n current = builder\n startViewAnimation(builder).then((animation) => {\n builder.notifyReady(animation)\n animation.finished.finally(next)\n })\n}\n\nfunction processQueue() {\n /**\n * Iterate backwards over the builders array. We can ignore the\n * \"wait\" animations. If we have an interrupting animation in the\n * queue then we need to batch all preceeding animations into it.\n * Currently this only batches the update functions but will also\n * need to batch the targets.\n */\n for (let i = builders.length - 1; i >= 0; i--) {\n const builder = builders[i]\n const { interrupt } = builder.options\n\n if (interrupt === \"immediate\") {\n const batchedUpdates = builders.slice(0, i + 1).map((b) => b.update)\n const remaining = builders.slice(i + 1)\n\n builder.update = () => {\n batchedUpdates.forEach((update) => update())\n }\n\n // Put the current builder at the front, followed by any \"wait\" builders\n builders = [builder, ...remaining]\n\n break\n }\n }\n\n if (!current || builders[0]?.options.interrupt === \"immediate\") {\n next()\n }\n}\n\nexport function addToQueue(builder: ViewTransitionBuilder) {\n builders.push(builder)\n microtask.render(processQueue)\n}\n"],"names":[],"mappings":";;;;AAKA,IAAI,QAAQ,GAA4B,EAAE;AAE1C,IAAI,OAAO,GAAiC,IAAI;AAEhD,SAAS,IAAI,GAAA;IACT,OAAO,GAAG,IAAI;AACd,IAAA,MAAM,CAAC,WAAW,CAAC,GAAG,QAAQ;AAC9B,IAAA,IAAI,WAAW;QAAE,KAAK,CAAC,WAAW,CAAC;AACvC;AAEA,SAAS,KAAK,CAAC,OAA8B,EAAA;AACzC,IAAA,UAAU,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC7B,OAAO,GAAG,OAAO;IACjB,kBAAkB,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,KAAI;AAC3C,QAAA,OAAO,CAAC,WAAW,CAAC,SAAS,CAAC;AAC9B,QAAA,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC;AACpC,IAAA,CAAC,CAAC;AACN;AAEA,SAAS,YAAY,GAAA;AACjB;;;;;;AAMG;AACH,IAAA,KAAK,IAAI,CAAC,GAAG,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE;AAC3C,QAAA,MAAM,OAAO,GAAG,QAAQ,CAAC,CAAC,CAAC;AAC3B,QAAA,MAAM,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC,OAAO;AAErC,QAAA,IAAI,SAAS,KAAK,WAAW,EAAE;YAC3B,MAAM,cAAc,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC;YACpE,MAAM,SAAS,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC;AAEvC,YAAA,OAAO,CAAC,MAAM,GAAG,MAAK;gBAClB,cAAc,CAAC,OAAO,CAAC,CAAC,MAAM,KAAK,MAAM,EAAE,CAAC;AAChD,YAAA,CAAC;;AAGD,YAAA,QAAQ,GAAG,CAAC,OAAO,EAAE,GAAG,SAAS,CAAC;YAElC;QACJ;IACJ;AAEA,IAAA,IAAI,CAAC,OAAO,IAAI,QAAQ,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,SAAS,KAAK,WAAW,EAAE;AAC5D,QAAA,IAAI,EAAE;IACV;AACJ;AAEM,SAAU,UAAU,CAAC,OAA8B,EAAA;AACrD,IAAA,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC;AACtB,IAAA,SAAS,CAAC,MAAM,CAAC,YAAY,CAAC;AAClC;;;;"}
|
||||
156
node_modules/motion-dom/dist/es/view/start.mjs
generated
vendored
Normal file
156
node_modules/motion-dom/dist/es/view/start.mjs
generated
vendored
Normal file
@@ -0,0 +1,156 @@
|
||||
import { secondsToMilliseconds } from 'motion-utils';
|
||||
import { GroupAnimation } from '../animation/GroupAnimation.mjs';
|
||||
import { NativeAnimation } from '../animation/NativeAnimation.mjs';
|
||||
import { NativeAnimationWrapper } from '../animation/NativeAnimationWrapper.mjs';
|
||||
import { getValueTransition } from '../animation/utils/get-value-transition.mjs';
|
||||
import { mapEasingToNativeEasing } from '../animation/waapi/easing/map-easing.mjs';
|
||||
import { applyGeneratorOptions } from '../animation/waapi/utils/apply-generator.mjs';
|
||||
import { chooseLayerType } from './utils/choose-layer-type.mjs';
|
||||
import { css } from './utils/css.mjs';
|
||||
import { getViewAnimationLayerInfo } from './utils/get-layer-info.mjs';
|
||||
import { getViewAnimations } from './utils/get-view-animations.mjs';
|
||||
import { hasTarget } from './utils/has-target.mjs';
|
||||
|
||||
const definitionNames = ["layout", "enter", "exit", "new", "old"];
|
||||
function startViewAnimation(builder) {
|
||||
const { update, targets, options: defaultOptions } = builder;
|
||||
if (!document.startViewTransition) {
|
||||
return new Promise(async (resolve) => {
|
||||
await update();
|
||||
resolve(new GroupAnimation([]));
|
||||
});
|
||||
}
|
||||
// TODO: Go over existing targets and ensure they all have ids
|
||||
/**
|
||||
* If we don't have any animations defined for the root target,
|
||||
* remove it from being captured.
|
||||
*/
|
||||
if (!hasTarget("root", targets)) {
|
||||
css.set(":root", {
|
||||
"view-transition-name": "none",
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Set the timing curve to linear for all view transition layers.
|
||||
* This gets baked into the keyframes, which can't be changed
|
||||
* without breaking the generated animation.
|
||||
*
|
||||
* This allows us to set easing via updateTiming - which can be changed.
|
||||
*/
|
||||
css.set("::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*)", { "animation-timing-function": "linear !important" });
|
||||
css.commit(); // Write
|
||||
const transition = document.startViewTransition(async () => {
|
||||
await update();
|
||||
// TODO: Go over new targets and ensure they all have ids
|
||||
});
|
||||
transition.finished.finally(() => {
|
||||
css.remove(); // Write
|
||||
});
|
||||
return new Promise((resolve) => {
|
||||
transition.ready.then(() => {
|
||||
const generatedViewAnimations = getViewAnimations();
|
||||
const animations = [];
|
||||
/**
|
||||
* Create animations for each of our explicitly-defined subjects.
|
||||
*/
|
||||
targets.forEach((definition, target) => {
|
||||
// TODO: If target is not "root", resolve elements
|
||||
// and iterate over each
|
||||
for (const key of definitionNames) {
|
||||
if (!definition[key])
|
||||
continue;
|
||||
const { keyframes, options } = definition[key];
|
||||
for (let [valueName, valueKeyframes] of Object.entries(keyframes)) {
|
||||
if (!valueKeyframes)
|
||||
continue;
|
||||
const valueOptions = {
|
||||
...getValueTransition(defaultOptions, valueName),
|
||||
...getValueTransition(options, valueName),
|
||||
};
|
||||
const type = chooseLayerType(key);
|
||||
/**
|
||||
* If this is an opacity animation, and keyframes are not an array,
|
||||
* we need to convert them into an array and set an initial value.
|
||||
*/
|
||||
if (valueName === "opacity" &&
|
||||
!Array.isArray(valueKeyframes)) {
|
||||
const initialValue = type === "new" ? 0 : 1;
|
||||
valueKeyframes = [initialValue, valueKeyframes];
|
||||
}
|
||||
/**
|
||||
* Resolve stagger function if provided.
|
||||
*/
|
||||
if (typeof valueOptions.delay === "function") {
|
||||
valueOptions.delay = valueOptions.delay(0, 1);
|
||||
}
|
||||
valueOptions.duration && (valueOptions.duration = secondsToMilliseconds(valueOptions.duration));
|
||||
valueOptions.delay && (valueOptions.delay = secondsToMilliseconds(valueOptions.delay));
|
||||
const animation = new NativeAnimation({
|
||||
...valueOptions,
|
||||
element: document.documentElement,
|
||||
name: valueName,
|
||||
pseudoElement: `::view-transition-${type}(${target})`,
|
||||
keyframes: valueKeyframes,
|
||||
});
|
||||
animations.push(animation);
|
||||
}
|
||||
}
|
||||
});
|
||||
/**
|
||||
* Handle browser generated animations
|
||||
*/
|
||||
for (const animation of generatedViewAnimations) {
|
||||
if (animation.playState === "finished")
|
||||
continue;
|
||||
const { effect } = animation;
|
||||
if (!effect || !(effect instanceof KeyframeEffect))
|
||||
continue;
|
||||
const { pseudoElement } = effect;
|
||||
if (!pseudoElement)
|
||||
continue;
|
||||
const name = getViewAnimationLayerInfo(pseudoElement);
|
||||
if (!name)
|
||||
continue;
|
||||
const targetDefinition = targets.get(name.layer);
|
||||
if (!targetDefinition) {
|
||||
/**
|
||||
* If transition name is group then update the timing of the animation
|
||||
* whereas if it's old or new then we could possibly replace it using
|
||||
* the above method.
|
||||
*/
|
||||
const transitionName = name.type === "group" ? "layout" : "";
|
||||
let animationTransition = {
|
||||
...getValueTransition(defaultOptions, transitionName),
|
||||
};
|
||||
animationTransition.duration && (animationTransition.duration = secondsToMilliseconds(animationTransition.duration));
|
||||
animationTransition =
|
||||
applyGeneratorOptions(animationTransition);
|
||||
const easing = mapEasingToNativeEasing(animationTransition.ease, animationTransition.duration);
|
||||
effect.updateTiming({
|
||||
delay: secondsToMilliseconds(animationTransition.delay ?? 0),
|
||||
duration: animationTransition.duration,
|
||||
easing,
|
||||
});
|
||||
animations.push(new NativeAnimationWrapper(animation));
|
||||
}
|
||||
else if (hasOpacity(targetDefinition, "enter") &&
|
||||
hasOpacity(targetDefinition, "exit") &&
|
||||
effect
|
||||
.getKeyframes()
|
||||
.some((keyframe) => keyframe.mixBlendMode)) {
|
||||
animations.push(new NativeAnimationWrapper(animation));
|
||||
}
|
||||
else {
|
||||
animation.cancel();
|
||||
}
|
||||
}
|
||||
resolve(new GroupAnimation(animations));
|
||||
});
|
||||
});
|
||||
}
|
||||
function hasOpacity(target, key) {
|
||||
return target?.[key]?.keyframes.opacity;
|
||||
}
|
||||
|
||||
export { startViewAnimation };
|
||||
//# sourceMappingURL=start.mjs.map
|
||||
1
node_modules/motion-dom/dist/es/view/start.mjs.map
generated
vendored
Normal file
1
node_modules/motion-dom/dist/es/view/start.mjs.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
12
node_modules/motion-dom/dist/es/view/utils/choose-layer-type.mjs
generated
vendored
Normal file
12
node_modules/motion-dom/dist/es/view/utils/choose-layer-type.mjs
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
function chooseLayerType(valueName) {
|
||||
if (valueName === "layout")
|
||||
return "group";
|
||||
if (valueName === "enter" || valueName === "new")
|
||||
return "new";
|
||||
if (valueName === "exit" || valueName === "old")
|
||||
return "old";
|
||||
return "group";
|
||||
}
|
||||
|
||||
export { chooseLayerType };
|
||||
//# sourceMappingURL=choose-layer-type.mjs.map
|
||||
1
node_modules/motion-dom/dist/es/view/utils/choose-layer-type.mjs.map
generated
vendored
Normal file
1
node_modules/motion-dom/dist/es/view/utils/choose-layer-type.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"choose-layer-type.mjs","sources":["../../../../src/view/utils/choose-layer-type.ts"],"sourcesContent":["export function chooseLayerType(\n valueName: \"layout\" | \"enter\" | \"exit\" | \"new\" | \"old\"\n): \"group\" | \"old\" | \"new\" {\n if (valueName === \"layout\") return \"group\"\n if (valueName === \"enter\" || valueName === \"new\") return \"new\"\n if (valueName === \"exit\" || valueName === \"old\") return \"old\"\n\n return \"group\"\n}\n"],"names":[],"mappings":"AAAM,SAAU,eAAe,CAC3B,SAAsD,EAAA;IAEtD,IAAI,SAAS,KAAK,QAAQ;AAAE,QAAA,OAAO,OAAO;AAC1C,IAAA,IAAI,SAAS,KAAK,OAAO,IAAI,SAAS,KAAK,KAAK;AAAE,QAAA,OAAO,KAAK;AAC9D,IAAA,IAAI,SAAS,KAAK,MAAM,IAAI,SAAS,KAAK,KAAK;AAAE,QAAA,OAAO,KAAK;AAE7D,IAAA,OAAO,OAAO;AAClB;;;;"}
|
||||
33
node_modules/motion-dom/dist/es/view/utils/css.mjs
generated
vendored
Normal file
33
node_modules/motion-dom/dist/es/view/utils/css.mjs
generated
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
let pendingRules = {};
|
||||
let style = null;
|
||||
const css = {
|
||||
set: (selector, values) => {
|
||||
pendingRules[selector] = values;
|
||||
},
|
||||
commit: () => {
|
||||
if (!style) {
|
||||
style = document.createElement("style");
|
||||
style.id = "motion-view";
|
||||
}
|
||||
let cssText = "";
|
||||
for (const selector in pendingRules) {
|
||||
const rule = pendingRules[selector];
|
||||
cssText += `${selector} {\n`;
|
||||
for (const [property, value] of Object.entries(rule)) {
|
||||
cssText += ` ${property}: ${value};\n`;
|
||||
}
|
||||
cssText += "}\n";
|
||||
}
|
||||
style.textContent = cssText;
|
||||
document.head.appendChild(style);
|
||||
pendingRules = {};
|
||||
},
|
||||
remove: () => {
|
||||
if (style && style.parentElement) {
|
||||
style.parentElement.removeChild(style);
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
export { css };
|
||||
//# sourceMappingURL=css.mjs.map
|
||||
1
node_modules/motion-dom/dist/es/view/utils/css.mjs.map
generated
vendored
Normal file
1
node_modules/motion-dom/dist/es/view/utils/css.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"css.mjs","sources":["../../../../src/view/utils/css.ts"],"sourcesContent":["let pendingRules: Record<string, Record<string, string>> = {}\n\nlet style: HTMLStyleElement | null = null\n\nexport const css = {\n set: (selector: string, values: Record<string, string>) => {\n pendingRules[selector] = values\n },\n\n commit: () => {\n if (!style) {\n style = document.createElement(\"style\")\n style.id = \"motion-view\"\n }\n\n let cssText = \"\"\n\n for (const selector in pendingRules) {\n const rule = pendingRules[selector]\n cssText += `${selector} {\\n`\n for (const [property, value] of Object.entries(rule)) {\n cssText += ` ${property}: ${value};\\n`\n }\n cssText += \"}\\n\"\n }\n\n style.textContent = cssText\n document.head.appendChild(style)\n\n pendingRules = {}\n },\n\n remove: () => {\n if (style && style.parentElement) {\n style.parentElement.removeChild(style)\n }\n },\n}\n"],"names":[],"mappings":"AAAA,IAAI,YAAY,GAA2C,EAAE;AAE7D,IAAI,KAAK,GAA4B,IAAI;AAElC,MAAM,GAAG,GAAG;AACf,IAAA,GAAG,EAAE,CAAC,QAAgB,EAAE,MAA8B,KAAI;AACtD,QAAA,YAAY,CAAC,QAAQ,CAAC,GAAG,MAAM;IACnC,CAAC;IAED,MAAM,EAAE,MAAK;QACT,IAAI,CAAC,KAAK,EAAE;AACR,YAAA,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC;AACvC,YAAA,KAAK,CAAC,EAAE,GAAG,aAAa;QAC5B;QAEA,IAAI,OAAO,GAAG,EAAE;AAEhB,QAAA,KAAK,MAAM,QAAQ,IAAI,YAAY,EAAE;AACjC,YAAA,MAAM,IAAI,GAAG,YAAY,CAAC,QAAQ,CAAC;AACnC,YAAA,OAAO,IAAI,CAAA,EAAG,QAAQ,CAAA,IAAA,CAAM;AAC5B,YAAA,KAAK,MAAM,CAAC,QAAQ,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;AAClD,gBAAA,OAAO,IAAI,CAAA,EAAA,EAAK,QAAQ,CAAA,EAAA,EAAK,KAAK,KAAK;YAC3C;YACA,OAAO,IAAI,KAAK;QACpB;AAEA,QAAA,KAAK,CAAC,WAAW,GAAG,OAAO;AAC3B,QAAA,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC;QAEhC,YAAY,GAAG,EAAE;IACrB,CAAC;IAED,MAAM,EAAE,MAAK;AACT,QAAA,IAAI,KAAK,IAAI,KAAK,CAAC,aAAa,EAAE;AAC9B,YAAA,KAAK,CAAC,aAAa,CAAC,WAAW,CAAC,KAAK,CAAC;QAC1C;IACJ,CAAC;;;;;"}
|
||||
9
node_modules/motion-dom/dist/es/view/utils/get-layer-info.mjs
generated
vendored
Normal file
9
node_modules/motion-dom/dist/es/view/utils/get-layer-info.mjs
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
function getViewAnimationLayerInfo(pseudoElement) {
|
||||
const match = pseudoElement.match(/::view-transition-(old|new|group|image-pair)\((.*?)\)/);
|
||||
if (!match)
|
||||
return null;
|
||||
return { layer: match[2], type: match[1] };
|
||||
}
|
||||
|
||||
export { getViewAnimationLayerInfo };
|
||||
//# sourceMappingURL=get-layer-info.mjs.map
|
||||
1
node_modules/motion-dom/dist/es/view/utils/get-layer-info.mjs.map
generated
vendored
Normal file
1
node_modules/motion-dom/dist/es/view/utils/get-layer-info.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"get-layer-info.mjs","sources":["../../../../src/view/utils/get-layer-info.ts"],"sourcesContent":["export function getViewAnimationLayerInfo(pseudoElement: string) {\n const match = pseudoElement.match(\n /::view-transition-(old|new|group|image-pair)\\((.*?)\\)/\n )\n if (!match) return null\n\n return { layer: match[2], type: match[1] }\n}\n"],"names":[],"mappings":"AAAM,SAAU,yBAAyB,CAAC,aAAqB,EAAA;IAC3D,MAAM,KAAK,GAAG,aAAa,CAAC,KAAK,CAC7B,uDAAuD,CAC1D;AACD,IAAA,IAAI,CAAC,KAAK;AAAE,QAAA,OAAO,IAAI;AAEvB,IAAA,OAAO,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE;AAC9C;;;;"}
|
||||
13
node_modules/motion-dom/dist/es/view/utils/get-view-animations.mjs
generated
vendored
Normal file
13
node_modules/motion-dom/dist/es/view/utils/get-view-animations.mjs
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
function filterViewAnimations(animation) {
|
||||
const { effect } = animation;
|
||||
if (!effect)
|
||||
return false;
|
||||
return (effect.target === document.documentElement &&
|
||||
effect.pseudoElement?.startsWith("::view-transition"));
|
||||
}
|
||||
function getViewAnimations() {
|
||||
return document.getAnimations().filter(filterViewAnimations);
|
||||
}
|
||||
|
||||
export { getViewAnimations };
|
||||
//# sourceMappingURL=get-view-animations.mjs.map
|
||||
1
node_modules/motion-dom/dist/es/view/utils/get-view-animations.mjs.map
generated
vendored
Normal file
1
node_modules/motion-dom/dist/es/view/utils/get-view-animations.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"get-view-animations.mjs","sources":["../../../../src/view/utils/get-view-animations.ts"],"sourcesContent":["function filterViewAnimations(animation: Animation) {\n const { effect } = animation\n if (!effect) return false\n\n return (\n effect.target === document.documentElement &&\n effect.pseudoElement?.startsWith(\"::view-transition\")\n )\n}\n\nexport function getViewAnimations() {\n return document.getAnimations().filter(filterViewAnimations)\n}\n"],"names":[],"mappings":"AAAA,SAAS,oBAAoB,CAAC,SAAoB,EAAA;AAC9C,IAAA,MAAM,EAAE,MAAM,EAAE,GAAG,SAAS;AAC5B,IAAA,IAAI,CAAC,MAAM;AAAE,QAAA,OAAO,KAAK;AAEzB,IAAA,QACI,MAAM,CAAC,MAAM,KAAK,QAAQ,CAAC,eAAe;QAC1C,MAAM,CAAC,aAAa,EAAE,UAAU,CAAC,mBAAmB,CAAC;AAE7D;SAEgB,iBAAiB,GAAA;IAC7B,OAAO,QAAQ,CAAC,aAAa,EAAE,CAAC,MAAM,CAAC,oBAAoB,CAAC;AAChE;;;;"}
|
||||
6
node_modules/motion-dom/dist/es/view/utils/has-target.mjs
generated
vendored
Normal file
6
node_modules/motion-dom/dist/es/view/utils/has-target.mjs
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
function hasTarget(target, targets) {
|
||||
return targets.has(target) && Object.keys(targets.get(target)).length > 0;
|
||||
}
|
||||
|
||||
export { hasTarget };
|
||||
//# sourceMappingURL=has-target.mjs.map
|
||||
1
node_modules/motion-dom/dist/es/view/utils/has-target.mjs.map
generated
vendored
Normal file
1
node_modules/motion-dom/dist/es/view/utils/has-target.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"has-target.mjs","sources":["../../../../src/view/utils/has-target.ts"],"sourcesContent":["import { ViewTransitionTarget, ViewTransitionTargetDefinition } from \"../types\"\n\nexport function hasTarget(\n target: ViewTransitionTargetDefinition,\n targets: Map<ViewTransitionTargetDefinition, ViewTransitionTarget>\n) {\n return targets.has(target) && Object.keys(targets.get(target)!).length > 0\n}\n"],"names":[],"mappings":"AAEM,SAAU,SAAS,CACrB,MAAsC,EACtC,OAAkE,EAAA;IAElE,OAAO,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAE,CAAC,CAAC,MAAM,GAAG,CAAC;AAC9E;;;;"}
|
||||
Reference in New Issue
Block a user