@pixodesk/svg-animator-web 1.0.24 → 1.0.26
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/dist/index.cjs +156 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +156 -4
- package/dist/index.js.map +1 -1
- package/dist/index.min.cjs +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.prerendered-waapi.umd.js +24 -2
- package/dist/index.prerendered-waapi.umd.js.map +1 -1
- package/dist/index.prerendered-waapi.umd.min.js +1 -1
- package/dist/index.prerendered.umd.js +23 -2
- package/dist/index.prerendered.umd.js.map +1 -1
- package/dist/index.prerendered.umd.min.js +1 -1
- package/dist/index.umd.js +158 -4
- package/dist/index.umd.js.map +1 -1
- package/dist/index.umd.min.js +1 -1
- package/package.json +2 -2
|
@@ -305,6 +305,7 @@ var PixodeskAnimator = (() => {
|
|
|
305
305
|
}
|
|
306
306
|
var COLOUR_ATTR_NAMES = /* @__PURE__ */ new Set(["color", "fill", "flood-color", "lighting-color", "stop-color", "stroke"]);
|
|
307
307
|
var TRANSFORM_FN_NAMES = /* @__PURE__ */ new Set(["translate", "rotate", "scale", "skew"]);
|
|
308
|
+
var PCT_BASED_ATTR_NAMES = /* @__PURE__ */ new Set(["offset-distance", "offsetDistance"]);
|
|
308
309
|
function composeTransformParts(parts, opts) {
|
|
309
310
|
var _a;
|
|
310
311
|
if (!parts) return "";
|
|
@@ -801,7 +802,7 @@ var PixodeskAnimator = (() => {
|
|
|
801
802
|
}
|
|
802
803
|
|
|
803
804
|
// ../svg-animator-core/src/PxDefinitions.ts
|
|
804
|
-
var LOOP_JUMP_SHIFT_MS =
|
|
805
|
+
var LOOP_JUMP_SHIFT_MS = 1;
|
|
805
806
|
function deepEqualValue(a, b) {
|
|
806
807
|
if (a === b) return true;
|
|
807
808
|
if (typeof a !== typeof b || a === null || b === null || typeof a !== "object") return false;
|
|
@@ -1050,6 +1051,8 @@ var PixodeskAnimator = (() => {
|
|
|
1050
1051
|
const looped = [];
|
|
1051
1052
|
const separateBoundary = loop.extend !== PxLoopExtend.before;
|
|
1052
1053
|
const originalTerminalKf = keyframes[keyframes.length - 1];
|
|
1054
|
+
let terminalEasingOverride;
|
|
1055
|
+
let hasTerminalEasingOverride = false;
|
|
1053
1056
|
function appendRep(repStart, isReversed, partial) {
|
|
1054
1057
|
var _a2;
|
|
1055
1058
|
let entries;
|
|
@@ -1090,7 +1093,16 @@ var PixodeskAnimator = (() => {
|
|
|
1090
1093
|
const prevKf = looped.length > 0 ? looped[looped.length - 1] : originalTerminalKf;
|
|
1091
1094
|
const isBoundary = separateBoundary && i === 0 && prevKf !== void 0 && Math.abs(((_a2 = prevKf.t) != null ? _a2 : 0) - (repStart + entry.relT * segDuration)) < 1e-9;
|
|
1092
1095
|
if (isBoundary) {
|
|
1093
|
-
if (deepEqualValue(prevKf.v, entry.v))
|
|
1096
|
+
if (deepEqualValue(prevKf.v, entry.v)) {
|
|
1097
|
+
if (looped.length > 0) {
|
|
1098
|
+
prevKf.e = entry.e;
|
|
1099
|
+
prevKf.tangentOut = entry.tangentOut;
|
|
1100
|
+
} else {
|
|
1101
|
+
terminalEasingOverride = entry.e;
|
|
1102
|
+
hasTerminalEasingOverride = true;
|
|
1103
|
+
}
|
|
1104
|
+
continue;
|
|
1105
|
+
}
|
|
1094
1106
|
if (looped.length > 0) {
|
|
1095
1107
|
delete prevKf.tangentIn;
|
|
1096
1108
|
delete prevKf.tangentOut;
|
|
@@ -1171,6 +1183,11 @@ var PixodeskAnimator = (() => {
|
|
|
1171
1183
|
if (loop.extend === PxLoopExtend.before) {
|
|
1172
1184
|
return [...looped, ...keyframes];
|
|
1173
1185
|
} else {
|
|
1186
|
+
if (hasTerminalEasingOverride && keyframes.length > 0) {
|
|
1187
|
+
const head = keyframes.slice(0, -1);
|
|
1188
|
+
const tail = __spreadProps(__spreadValues({}, keyframes[keyframes.length - 1]), { e: terminalEasingOverride });
|
|
1189
|
+
return [...head, tail, ...looped];
|
|
1190
|
+
}
|
|
1174
1191
|
return [...keyframes, ...looped];
|
|
1175
1192
|
}
|
|
1176
1193
|
}
|
|
@@ -1227,6 +1244,9 @@ var PixodeskAnimator = (() => {
|
|
|
1227
1244
|
function normalizeAnimationDefinition(animDef, duration, defs, engine = PxAnimatorEngine.waapi) {
|
|
1228
1245
|
const normalized = {};
|
|
1229
1246
|
for (const [propName, propAnim] of Object.entries(animDef)) {
|
|
1247
|
+
if (propName === "transform" && propAnim.alongPathMode === "offsetPath" && animDef["offsetDistance"] !== void 0) {
|
|
1248
|
+
continue;
|
|
1249
|
+
}
|
|
1230
1250
|
const normalizedKfs = normalizeKeyframes(propName, propAnim, duration, defs);
|
|
1231
1251
|
if (normalizedKfs.length > 0) {
|
|
1232
1252
|
const out = { kfs: normalizedKfs };
|
|
@@ -1420,6 +1440,8 @@ var PixodeskAnimator = (() => {
|
|
|
1420
1440
|
} else if (propName === "d") {
|
|
1421
1441
|
const paths = value && typeof value === "object" && Array.isArray(value.paths) ? value.paths : [];
|
|
1422
1442
|
cssValue = 'path("' + paths.map((bz) => bezierToSvgPath(bz, true)).join("") + '")';
|
|
1443
|
+
} else if (PCT_BASED_ATTR_NAMES.has(propName) && typeof value === "number") {
|
|
1444
|
+
cssValue = value * 100 + "%";
|
|
1423
1445
|
} else {
|
|
1424
1446
|
cssValue = "" + value;
|
|
1425
1447
|
}
|