📚 Documentação inicial do ALETHEIA
- MANUAL-PRODUTO.md: Manual do usuário final - MANUAL-VENDAS.md: Estratégia comercial e vendas - MANUAL-TECNICO.md: Infraestrutura e deploy - README.md: Visão geral do projeto
This commit is contained in:
83
frontend/node_modules/motion-dom/dist/es/animation/waapi/NativeAnimationControls.mjs
generated
vendored
Normal file
83
frontend/node_modules/motion-dom/dist/es/animation/waapi/NativeAnimationControls.mjs
generated
vendored
Normal file
@@ -0,0 +1,83 @@
|
||||
import { millisecondsToSeconds, secondsToMilliseconds, noop } from 'motion-utils';
|
||||
import { attachTimeline } from './utils/attach-timeline.mjs';
|
||||
|
||||
class NativeAnimationControls {
|
||||
constructor(animation) {
|
||||
this.animation = animation;
|
||||
}
|
||||
get duration() {
|
||||
var _a, _b, _c;
|
||||
const durationInMs = ((_b = (_a = this.animation) === null || _a === void 0 ? void 0 : _a.effect) === null || _b === void 0 ? void 0 : _b.getComputedTiming().duration) ||
|
||||
((_c = this.options) === null || _c === void 0 ? void 0 : _c.duration) ||
|
||||
300;
|
||||
return millisecondsToSeconds(Number(durationInMs));
|
||||
}
|
||||
get time() {
|
||||
var _a;
|
||||
if (this.animation) {
|
||||
return millisecondsToSeconds(((_a = this.animation) === null || _a === void 0 ? void 0 : _a.currentTime) || 0);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
set time(newTime) {
|
||||
if (this.animation) {
|
||||
this.animation.currentTime = secondsToMilliseconds(newTime);
|
||||
}
|
||||
}
|
||||
get speed() {
|
||||
return this.animation ? this.animation.playbackRate : 1;
|
||||
}
|
||||
set speed(newSpeed) {
|
||||
if (this.animation) {
|
||||
this.animation.playbackRate = newSpeed;
|
||||
}
|
||||
}
|
||||
get state() {
|
||||
return this.animation ? this.animation.playState : "finished";
|
||||
}
|
||||
get startTime() {
|
||||
return this.animation ? this.animation.startTime : null;
|
||||
}
|
||||
get finished() {
|
||||
return this.animation ? this.animation.finished : Promise.resolve();
|
||||
}
|
||||
play() {
|
||||
this.animation && this.animation.play();
|
||||
}
|
||||
pause() {
|
||||
this.animation && this.animation.pause();
|
||||
}
|
||||
stop() {
|
||||
if (!this.animation ||
|
||||
this.state === "idle" ||
|
||||
this.state === "finished") {
|
||||
return;
|
||||
}
|
||||
if (this.animation.commitStyles) {
|
||||
this.animation.commitStyles();
|
||||
}
|
||||
this.cancel();
|
||||
}
|
||||
flatten() {
|
||||
var _a;
|
||||
if (!this.animation)
|
||||
return;
|
||||
(_a = this.animation.effect) === null || _a === void 0 ? void 0 : _a.updateTiming({ easing: "linear" });
|
||||
}
|
||||
attachTimeline(timeline) {
|
||||
if (this.animation)
|
||||
attachTimeline(this.animation, timeline);
|
||||
return noop;
|
||||
}
|
||||
complete() {
|
||||
this.animation && this.animation.finish();
|
||||
}
|
||||
cancel() {
|
||||
try {
|
||||
this.animation && this.animation.cancel();
|
||||
}
|
||||
catch (e) { }
|
||||
}
|
||||
}
|
||||
|
||||
export { NativeAnimationControls };
|
||||
15
frontend/node_modules/motion-dom/dist/es/animation/waapi/PseudoAnimation.mjs
generated
vendored
Normal file
15
frontend/node_modules/motion-dom/dist/es/animation/waapi/PseudoAnimation.mjs
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
import { NativeAnimationControls } from './NativeAnimationControls.mjs';
|
||||
import { convertMotionOptionsToNative } from './utils/convert-options.mjs';
|
||||
|
||||
class PseudoAnimation extends NativeAnimationControls {
|
||||
constructor(target, pseudoElement, valueName, keyframes, options) {
|
||||
const animationOptions = convertMotionOptionsToNative(valueName, keyframes, options);
|
||||
const animation = target.animate(animationOptions.keyframes, {
|
||||
pseudoElement,
|
||||
...animationOptions.options,
|
||||
});
|
||||
super(animation);
|
||||
}
|
||||
}
|
||||
|
||||
export { PseudoAnimation };
|
||||
6
frontend/node_modules/motion-dom/dist/es/animation/waapi/utils/attach-timeline.mjs
generated
vendored
Normal file
6
frontend/node_modules/motion-dom/dist/es/animation/waapi/utils/attach-timeline.mjs
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
function attachTimeline(animation, timeline) {
|
||||
animation.timeline = timeline;
|
||||
animation.onfinish = null;
|
||||
}
|
||||
|
||||
export { attachTimeline };
|
||||
55
frontend/node_modules/motion-dom/dist/es/animation/waapi/utils/convert-options.mjs
generated
vendored
Normal file
55
frontend/node_modules/motion-dom/dist/es/animation/waapi/utils/convert-options.mjs
generated
vendored
Normal file
@@ -0,0 +1,55 @@
|
||||
import { secondsToMilliseconds } from 'motion-utils';
|
||||
import { supportsLinearEasing } from '../../../utils/supports/linear-easing.mjs';
|
||||
import { createGeneratorEasing } from '../../generators/utils/create-generator-easing.mjs';
|
||||
import { isGenerator } from '../../generators/utils/is-generator.mjs';
|
||||
import { mapEasingToNativeEasing } from './easing.mjs';
|
||||
|
||||
const defaultEasing = "easeOut";
|
||||
function applyGeneratorOptions(options) {
|
||||
var _a;
|
||||
if (isGenerator(options.type)) {
|
||||
const generatorOptions = createGeneratorEasing(options, 100, options.type);
|
||||
options.ease = supportsLinearEasing()
|
||||
? generatorOptions.ease
|
||||
: defaultEasing;
|
||||
options.duration = secondsToMilliseconds(generatorOptions.duration);
|
||||
options.type = "keyframes";
|
||||
}
|
||||
else {
|
||||
options.duration = secondsToMilliseconds((_a = options.duration) !== null && _a !== void 0 ? _a : 0.3);
|
||||
options.ease = options.ease || defaultEasing;
|
||||
}
|
||||
}
|
||||
// TODO: Reuse for NativeAnimation
|
||||
function convertMotionOptionsToNative(valueName, keyframes, options) {
|
||||
var _a;
|
||||
const nativeKeyframes = {};
|
||||
const nativeOptions = {
|
||||
fill: "both",
|
||||
easing: "linear",
|
||||
composite: "replace",
|
||||
};
|
||||
nativeOptions.delay = secondsToMilliseconds((_a = options.delay) !== null && _a !== void 0 ? _a : 0);
|
||||
applyGeneratorOptions(options);
|
||||
nativeOptions.duration = options.duration;
|
||||
const { ease, times } = options;
|
||||
if (times)
|
||||
nativeKeyframes.offset = times;
|
||||
nativeKeyframes[valueName] = keyframes;
|
||||
const easing = mapEasingToNativeEasing(ease, options.duration);
|
||||
/**
|
||||
* If this is an easing array, apply to keyframes, not animation as a whole
|
||||
*/
|
||||
if (Array.isArray(easing)) {
|
||||
nativeKeyframes.easing = easing;
|
||||
}
|
||||
else {
|
||||
nativeOptions.easing = easing;
|
||||
}
|
||||
return {
|
||||
keyframes: nativeKeyframes,
|
||||
options: nativeOptions,
|
||||
};
|
||||
}
|
||||
|
||||
export { applyGeneratorOptions, convertMotionOptionsToNative };
|
||||
44
frontend/node_modules/motion-dom/dist/es/animation/waapi/utils/easing.mjs
generated
vendored
Normal file
44
frontend/node_modules/motion-dom/dist/es/animation/waapi/utils/easing.mjs
generated
vendored
Normal file
@@ -0,0 +1,44 @@
|
||||
import { isBezierDefinition } from '../../../utils/is-bezier-definition.mjs';
|
||||
import { supportsLinearEasing } from '../../../utils/supports/linear-easing.mjs';
|
||||
import { generateLinearEasing } from './linear.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)));
|
||||
}
|
||||
const cubicBezierAsString = ([a, b, c, d]) => `cubic-bezier(${a}, ${b}, ${c}, ${d})`;
|
||||
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]),
|
||||
};
|
||||
function mapEasingToNativeEasing(easing, duration) {
|
||||
if (!easing) {
|
||||
return undefined;
|
||||
}
|
||||
else if (typeof easing === "function" && supportsLinearEasing()) {
|
||||
return generateLinearEasing(easing, duration);
|
||||
}
|
||||
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 { cubicBezierAsString, isWaapiSupportedEasing, mapEasingToNativeEasing, supportedWaapiEasing };
|
||||
14
frontend/node_modules/motion-dom/dist/es/animation/waapi/utils/linear.mjs
generated
vendored
Normal file
14
frontend/node_modules/motion-dom/dist/es/animation/waapi/utils/linear.mjs
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
import { progress } from 'motion-utils';
|
||||
|
||||
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 += easing(progress(0, numPoints - 1, i)) + ", ";
|
||||
}
|
||||
return `linear(${points.substring(0, points.length - 2)})`;
|
||||
};
|
||||
|
||||
export { generateLinearEasing };
|
||||
Reference in New Issue
Block a user