@pixodesk/svg-animator-vue 1.0.45 → 1.0.46
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.umd.js +304 -186
- package/dist/index.umd.js.map +1 -1
- package/package.json +3 -3
package/dist/index.umd.js
CHANGED
|
@@ -401,8 +401,8 @@ var PixodeskAnimatorVue = (() => {
|
|
|
401
401
|
return type === "string" || type === "number" || type === "boolean";
|
|
402
402
|
}
|
|
403
403
|
var escapeRE = /["'&<>]/;
|
|
404
|
-
function escapeHtml(
|
|
405
|
-
const str3 = "" +
|
|
404
|
+
function escapeHtml(string3) {
|
|
405
|
+
const str3 = "" + string3;
|
|
406
406
|
const match = escapeRE.exec(str3);
|
|
407
407
|
if (!match) {
|
|
408
408
|
return str3;
|
|
@@ -990,8 +990,8 @@ var PixodeskAnimatorVue = (() => {
|
|
|
990
990
|
return type === "string" || type === "number" || type === "boolean";
|
|
991
991
|
}
|
|
992
992
|
var escapeRE = /["'&<>]/;
|
|
993
|
-
function escapeHtml(
|
|
994
|
-
const str3 = "" +
|
|
993
|
+
function escapeHtml(string3) {
|
|
994
|
+
const str3 = "" + string3;
|
|
995
995
|
const match = escapeRE.exec(str3);
|
|
996
996
|
if (!match) {
|
|
997
997
|
return str3;
|
|
@@ -16603,11 +16603,11 @@ var PixodeskAnimatorVue = (() => {
|
|
|
16603
16603
|
"../../node_modules/.pnpm/source-map-js@1.2.1/node_modules/source-map-js/lib/base64.js"(exports) {
|
|
16604
16604
|
"use strict";
|
|
16605
16605
|
var intToCharMap = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");
|
|
16606
|
-
exports.encode = function(
|
|
16607
|
-
if (0 <=
|
|
16608
|
-
return intToCharMap[
|
|
16606
|
+
exports.encode = function(number3) {
|
|
16607
|
+
if (0 <= number3 && number3 < intToCharMap.length) {
|
|
16608
|
+
return intToCharMap[number3];
|
|
16609
16609
|
}
|
|
16610
|
-
throw new TypeError("Must be between 0 and 63: " +
|
|
16610
|
+
throw new TypeError("Must be between 0 and 63: " + number3);
|
|
16611
16611
|
};
|
|
16612
16612
|
exports.decode = function(charCode) {
|
|
16613
16613
|
var bigA = 65;
|
|
@@ -54311,15 +54311,15 @@ Component that was made reactive: `,
|
|
|
54311
54311
|
}
|
|
54312
54312
|
}
|
|
54313
54313
|
var assignKey = /* @__PURE__ */ Symbol("_assign");
|
|
54314
|
-
function castValue(value, trim,
|
|
54314
|
+
function castValue(value, trim, number3) {
|
|
54315
54315
|
if (trim) value = value.trim();
|
|
54316
|
-
if (
|
|
54316
|
+
if (number3) value = shared.looseToNumber(value);
|
|
54317
54317
|
return value;
|
|
54318
54318
|
}
|
|
54319
54319
|
var vModelText = {
|
|
54320
|
-
created(el, { modifiers: { lazy, trim, number } }, vnode) {
|
|
54320
|
+
created(el, { modifiers: { lazy, trim, number: number3 } }, vnode) {
|
|
54321
54321
|
el[assignKey] = getModelAssigner(vnode);
|
|
54322
|
-
const castToNumber =
|
|
54322
|
+
const castToNumber = number3 || vnode.props && vnode.props.type === "number";
|
|
54323
54323
|
addEventListener(el, lazy ? "change" : "input", (e) => {
|
|
54324
54324
|
if (e.target.composing) return;
|
|
54325
54325
|
el[assignKey](castValue(el.value, trim, castToNumber));
|
|
@@ -54339,10 +54339,10 @@ Component that was made reactive: `,
|
|
|
54339
54339
|
mounted(el, { value }) {
|
|
54340
54340
|
el.value = value == null ? "" : value;
|
|
54341
54341
|
},
|
|
54342
|
-
beforeUpdate(el, { value, oldValue, modifiers: { lazy, trim, number } }, vnode) {
|
|
54342
|
+
beforeUpdate(el, { value, oldValue, modifiers: { lazy, trim, number: number3 } }, vnode) {
|
|
54343
54343
|
el[assignKey] = getModelAssigner(vnode);
|
|
54344
54344
|
if (el.composing) return;
|
|
54345
|
-
const elValue = (
|
|
54345
|
+
const elValue = (number3 || el.type === "number") && !/^0\d/.test(el.value) ? shared.looseToNumber(el.value) : el.value;
|
|
54346
54346
|
const newValue = value == null ? "" : value;
|
|
54347
54347
|
if (elValue === newValue) {
|
|
54348
54348
|
return;
|
|
@@ -54431,11 +54431,11 @@ Component that was made reactive: `,
|
|
|
54431
54431
|
var vModelSelect = {
|
|
54432
54432
|
// <select multiple> value need to be deep traversed
|
|
54433
54433
|
deep: true,
|
|
54434
|
-
created(el, { value, modifiers: { number } }, vnode) {
|
|
54434
|
+
created(el, { value, modifiers: { number: number3 } }, vnode) {
|
|
54435
54435
|
const isSetModel = shared.isSet(value);
|
|
54436
54436
|
addEventListener(el, "change", () => {
|
|
54437
54437
|
const selectedVal = Array.prototype.filter.call(el.options, (o) => o.selected).map(
|
|
54438
|
-
(o) =>
|
|
54438
|
+
(o) => number3 ? shared.looseToNumber(getValue(o)) : getValue(o)
|
|
54439
54439
|
);
|
|
54440
54440
|
el[assignKey](
|
|
54441
54441
|
el.multiple ? isSetModel ? new Set(selectedVal) : selectedVal : selectedVal[0]
|
|
@@ -56126,15 +56126,15 @@ Expected function or array of functions, received type ${typeof value}.`
|
|
|
56126
56126
|
}
|
|
56127
56127
|
}
|
|
56128
56128
|
var assignKey = /* @__PURE__ */ Symbol("_assign");
|
|
56129
|
-
function castValue(value, trim,
|
|
56129
|
+
function castValue(value, trim, number3) {
|
|
56130
56130
|
if (trim) value = value.trim();
|
|
56131
|
-
if (
|
|
56131
|
+
if (number3) value = shared.looseToNumber(value);
|
|
56132
56132
|
return value;
|
|
56133
56133
|
}
|
|
56134
56134
|
var vModelText = {
|
|
56135
|
-
created(el, { modifiers: { lazy, trim, number } }, vnode) {
|
|
56135
|
+
created(el, { modifiers: { lazy, trim, number: number3 } }, vnode) {
|
|
56136
56136
|
el[assignKey] = getModelAssigner(vnode);
|
|
56137
|
-
const castToNumber =
|
|
56137
|
+
const castToNumber = number3 || vnode.props && vnode.props.type === "number";
|
|
56138
56138
|
addEventListener(el, lazy ? "change" : "input", (e) => {
|
|
56139
56139
|
if (e.target.composing) return;
|
|
56140
56140
|
el[assignKey](castValue(el.value, trim, castToNumber));
|
|
@@ -56154,10 +56154,10 @@ Expected function or array of functions, received type ${typeof value}.`
|
|
|
56154
56154
|
mounted(el, { value }) {
|
|
56155
56155
|
el.value = value == null ? "" : value;
|
|
56156
56156
|
},
|
|
56157
|
-
beforeUpdate(el, { value, oldValue, modifiers: { lazy, trim, number } }, vnode) {
|
|
56157
|
+
beforeUpdate(el, { value, oldValue, modifiers: { lazy, trim, number: number3 } }, vnode) {
|
|
56158
56158
|
el[assignKey] = getModelAssigner(vnode);
|
|
56159
56159
|
if (el.composing) return;
|
|
56160
|
-
const elValue = (
|
|
56160
|
+
const elValue = (number3 || el.type === "number") && !/^0\d/.test(el.value) ? shared.looseToNumber(el.value) : el.value;
|
|
56161
56161
|
const newValue = value == null ? "" : value;
|
|
56162
56162
|
if (elValue === newValue) {
|
|
56163
56163
|
return;
|
|
@@ -56246,11 +56246,11 @@ Expected function or array of functions, received type ${typeof value}.`
|
|
|
56246
56246
|
var vModelSelect = {
|
|
56247
56247
|
// <select multiple> value need to be deep traversed
|
|
56248
56248
|
deep: true,
|
|
56249
|
-
created(el, { value, modifiers: { number } }, vnode) {
|
|
56249
|
+
created(el, { value, modifiers: { number: number3 } }, vnode) {
|
|
56250
56250
|
const isSetModel = shared.isSet(value);
|
|
56251
56251
|
addEventListener(el, "change", () => {
|
|
56252
56252
|
const selectedVal = Array.prototype.filter.call(el.options, (o) => o.selected).map(
|
|
56253
|
-
(o) =>
|
|
56253
|
+
(o) => number3 ? shared.looseToNumber(getValue(o)) : getValue(o)
|
|
56254
56254
|
);
|
|
56255
56255
|
el[assignKey](
|
|
56256
56256
|
el.multiple ? isSetModel ? new Set(selectedVal) : selectedVal : selectedVal[0]
|
|
@@ -56761,7 +56761,7 @@ ${codeFrame}` : message);
|
|
|
56761
56761
|
PixodeskSvgCssAnimator: () => PixodeskSvgCssAnimator_default
|
|
56762
56762
|
});
|
|
56763
56763
|
|
|
56764
|
-
// ../svg-animator-web/dist/chunk-
|
|
56764
|
+
// ../svg-animator-web/dist/chunk-ZBGGXE5W.js
|
|
56765
56765
|
var __defProp2 = Object.defineProperty;
|
|
56766
56766
|
var __defProps = Object.defineProperties;
|
|
56767
56767
|
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
@@ -56824,19 +56824,31 @@ ${codeFrame}` : message);
|
|
|
56824
56824
|
return result;
|
|
56825
56825
|
}
|
|
56826
56826
|
var Base = class {
|
|
56827
|
+
/** Structural schemas (objects, arrays, unions of objects…) pass `false`: they state no scalar default. */
|
|
56828
|
+
constructor(_statesDefault) {
|
|
56829
|
+
this._statesDefault = _statesDefault;
|
|
56830
|
+
}
|
|
56827
56831
|
_canSanitize(raw) {
|
|
56828
56832
|
return this.isValid(raw);
|
|
56829
56833
|
}
|
|
56834
|
+
/** A REQUIRED field is never absent; its default is the repair value. */
|
|
56835
|
+
absentDefault() {
|
|
56836
|
+
return this._default;
|
|
56837
|
+
}
|
|
56830
56838
|
optional() {
|
|
56831
56839
|
return new Optional(this);
|
|
56832
56840
|
}
|
|
56833
56841
|
};
|
|
56834
56842
|
var Optional = class extends Base {
|
|
56835
56843
|
constructor(inner) {
|
|
56836
|
-
super();
|
|
56844
|
+
super(inner._statesDefault);
|
|
56837
56845
|
this.inner = inner;
|
|
56838
56846
|
this._default = void 0;
|
|
56839
56847
|
}
|
|
56848
|
+
/** Absent means the inner schema's STATED default — or nothing at all when it states none. */
|
|
56849
|
+
absentDefault() {
|
|
56850
|
+
return this.inner._statesDefault ? this.inner._default : void 0;
|
|
56851
|
+
}
|
|
56840
56852
|
sanitize(raw) {
|
|
56841
56853
|
if (raw === void 0 || raw === null) return void 0;
|
|
56842
56854
|
return this.inner._canSanitize(raw) ? this.inner.sanitize(raw) : void 0;
|
|
@@ -56850,8 +56862,8 @@ ${codeFrame}` : message);
|
|
|
56850
56862
|
}
|
|
56851
56863
|
};
|
|
56852
56864
|
var Str = class extends Base {
|
|
56853
|
-
constructor(_default
|
|
56854
|
-
super();
|
|
56865
|
+
constructor(_default, statesDefault) {
|
|
56866
|
+
super(statesDefault);
|
|
56855
56867
|
this._default = _default;
|
|
56856
56868
|
}
|
|
56857
56869
|
sanitize(raw) {
|
|
@@ -56864,8 +56876,8 @@ ${codeFrame}` : message);
|
|
|
56864
56876
|
}
|
|
56865
56877
|
};
|
|
56866
56878
|
var Num = class extends Base {
|
|
56867
|
-
constructor(_default
|
|
56868
|
-
super();
|
|
56879
|
+
constructor(_default, statesDefault) {
|
|
56880
|
+
super(statesDefault);
|
|
56869
56881
|
this._default = _default;
|
|
56870
56882
|
}
|
|
56871
56883
|
sanitize(raw) {
|
|
@@ -56878,8 +56890,8 @@ ${codeFrame}` : message);
|
|
|
56878
56890
|
}
|
|
56879
56891
|
};
|
|
56880
56892
|
var Bool = class extends Base {
|
|
56881
|
-
constructor(_default
|
|
56882
|
-
super();
|
|
56893
|
+
constructor(_default, statesDefault) {
|
|
56894
|
+
super(statesDefault);
|
|
56883
56895
|
this._default = _default;
|
|
56884
56896
|
}
|
|
56885
56897
|
sanitize(raw) {
|
|
@@ -56892,8 +56904,9 @@ ${codeFrame}` : message);
|
|
|
56892
56904
|
}
|
|
56893
56905
|
};
|
|
56894
56906
|
var Literal = class extends Base {
|
|
56907
|
+
/** A literal IS its own value: absent means it. */
|
|
56895
56908
|
constructor(value) {
|
|
56896
|
-
super();
|
|
56909
|
+
super(true);
|
|
56897
56910
|
this.value = value;
|
|
56898
56911
|
this._default = value;
|
|
56899
56912
|
}
|
|
@@ -56907,8 +56920,8 @@ ${codeFrame}` : message);
|
|
|
56907
56920
|
}
|
|
56908
56921
|
};
|
|
56909
56922
|
var Enum = class extends Base {
|
|
56910
|
-
constructor(values, defaultVal) {
|
|
56911
|
-
super();
|
|
56923
|
+
constructor(values, defaultVal, statesDefault) {
|
|
56924
|
+
super(statesDefault);
|
|
56912
56925
|
this.values = values;
|
|
56913
56926
|
this._default = defaultVal != null ? defaultVal : values[0];
|
|
56914
56927
|
}
|
|
@@ -56923,8 +56936,8 @@ ${codeFrame}` : message);
|
|
|
56923
56936
|
};
|
|
56924
56937
|
var UNION_MEMBER_ERROR_LIMIT = 4;
|
|
56925
56938
|
var Union = class extends Base {
|
|
56926
|
-
constructor(schemas, defaultVal) {
|
|
56927
|
-
super();
|
|
56939
|
+
constructor(schemas, defaultVal, statesDefault) {
|
|
56940
|
+
super(statesDefault);
|
|
56928
56941
|
this.schemas = schemas;
|
|
56929
56942
|
this._kind = "union";
|
|
56930
56943
|
this._default = defaultVal != null ? defaultVal : schemas[0]._default;
|
|
@@ -56977,7 +56990,7 @@ ${codeFrame}` : message);
|
|
|
56977
56990
|
var DiscriminatedUnion = class extends Base {
|
|
56978
56991
|
constructor(_key, _schemas, defaultVal) {
|
|
56979
56992
|
var _a22;
|
|
56980
|
-
super();
|
|
56993
|
+
super(false);
|
|
56981
56994
|
this._key = _key;
|
|
56982
56995
|
this._schemas = _schemas;
|
|
56983
56996
|
this._kind = "discriminatedUnion";
|
|
@@ -57016,13 +57029,19 @@ ${codeFrame}` : message);
|
|
|
57016
57029
|
return schema ? schema._canSanitize(raw) : this._schemas[0]._canSanitize(raw);
|
|
57017
57030
|
}
|
|
57018
57031
|
};
|
|
57032
|
+
function statedDefaults(shape) {
|
|
57033
|
+
const out = {};
|
|
57034
|
+
for (const key of Object.keys(shape)) if (shape[key]._statesDefault) out[key] = shape[key].absentDefault();
|
|
57035
|
+
return Object.freeze(out);
|
|
57036
|
+
}
|
|
57019
57037
|
var Obj = class extends Base {
|
|
57020
57038
|
constructor(_shape) {
|
|
57021
|
-
super();
|
|
57039
|
+
super(false);
|
|
57022
57040
|
this._shape = _shape;
|
|
57023
57041
|
const d = {};
|
|
57024
57042
|
for (const key of Object.keys(_shape)) d[key] = _shape[key]._default;
|
|
57025
57043
|
this._default = d;
|
|
57044
|
+
this.defaults = statedDefaults(_shape);
|
|
57026
57045
|
}
|
|
57027
57046
|
sanitize(raw) {
|
|
57028
57047
|
const src = raw && typeof raw === "object" && !Array.isArray(raw) ? raw : {};
|
|
@@ -57064,12 +57083,13 @@ ${codeFrame}` : message);
|
|
|
57064
57083
|
};
|
|
57065
57084
|
var OpenObj = class extends Base {
|
|
57066
57085
|
constructor(_shape, _openSchema) {
|
|
57067
|
-
super();
|
|
57086
|
+
super(false);
|
|
57068
57087
|
this._shape = _shape;
|
|
57069
57088
|
this._openSchema = _openSchema;
|
|
57070
57089
|
const d = {};
|
|
57071
57090
|
for (const key of Object.keys(_shape)) d[key] = _shape[key]._default;
|
|
57072
57091
|
this._default = d;
|
|
57092
|
+
this.defaults = statedDefaults(_shape);
|
|
57073
57093
|
}
|
|
57074
57094
|
sanitize(raw) {
|
|
57075
57095
|
const src = raw && typeof raw === "object" && !Array.isArray(raw) ? raw : {};
|
|
@@ -57114,7 +57134,7 @@ ${codeFrame}` : message);
|
|
|
57114
57134
|
};
|
|
57115
57135
|
var Arr = class extends Base {
|
|
57116
57136
|
constructor(item) {
|
|
57117
|
-
super();
|
|
57137
|
+
super(false);
|
|
57118
57138
|
this.item = item;
|
|
57119
57139
|
this._default = [];
|
|
57120
57140
|
}
|
|
@@ -57146,7 +57166,7 @@ ${codeFrame}` : message);
|
|
|
57146
57166
|
};
|
|
57147
57167
|
var Rec = class extends Base {
|
|
57148
57168
|
constructor(value) {
|
|
57149
|
-
super();
|
|
57169
|
+
super(false);
|
|
57150
57170
|
this.value = value;
|
|
57151
57171
|
this._kind = "record";
|
|
57152
57172
|
this._default = {};
|
|
@@ -57179,7 +57199,7 @@ ${codeFrame}` : message);
|
|
|
57179
57199
|
};
|
|
57180
57200
|
var Any = class extends Base {
|
|
57181
57201
|
constructor() {
|
|
57182
|
-
super(
|
|
57202
|
+
super(false);
|
|
57183
57203
|
this._default = void 0;
|
|
57184
57204
|
}
|
|
57185
57205
|
sanitize(raw) {
|
|
@@ -57194,7 +57214,7 @@ ${codeFrame}` : message);
|
|
|
57194
57214
|
};
|
|
57195
57215
|
var Defined = class extends Base {
|
|
57196
57216
|
constructor() {
|
|
57197
|
-
super(
|
|
57217
|
+
super(false);
|
|
57198
57218
|
this._default = void 0;
|
|
57199
57219
|
}
|
|
57200
57220
|
sanitize(raw) {
|
|
@@ -57211,7 +57231,7 @@ ${codeFrame}` : message);
|
|
|
57211
57231
|
};
|
|
57212
57232
|
var Lazy = class extends Base {
|
|
57213
57233
|
constructor(fn, _default) {
|
|
57214
|
-
super();
|
|
57234
|
+
super(false);
|
|
57215
57235
|
this.fn = fn;
|
|
57216
57236
|
this._default = _default;
|
|
57217
57237
|
this.resolved = null;
|
|
@@ -57232,7 +57252,7 @@ ${codeFrame}` : message);
|
|
|
57232
57252
|
};
|
|
57233
57253
|
var Tuple = class extends Base {
|
|
57234
57254
|
constructor(schemas) {
|
|
57235
|
-
super();
|
|
57255
|
+
super(false);
|
|
57236
57256
|
this.schemas = schemas;
|
|
57237
57257
|
this._kind = "tuple";
|
|
57238
57258
|
this._default = schemas.map((s) => s._default);
|
|
@@ -57263,22 +57283,29 @@ ${codeFrame}` : message);
|
|
|
57263
57283
|
function implementsInterface() {
|
|
57264
57284
|
return (schema) => schema;
|
|
57265
57285
|
}
|
|
57286
|
+
function string(defaultVal) {
|
|
57287
|
+
return defaultVal === void 0 ? new Str("", false) : new Str(defaultVal, true);
|
|
57288
|
+
}
|
|
57289
|
+
function number(defaultVal) {
|
|
57290
|
+
return defaultVal === void 0 ? new Num(0, false) : new Num(defaultVal, true);
|
|
57291
|
+
}
|
|
57292
|
+
function boolean(defaultVal) {
|
|
57293
|
+
return defaultVal === void 0 ? new Bool(false, false) : new Bool(defaultVal, true);
|
|
57294
|
+
}
|
|
57295
|
+
function oneOf(values, defaultVal) {
|
|
57296
|
+
return defaultVal === void 0 ? new Enum(values, void 0, false) : new Enum(values, defaultVal, true);
|
|
57297
|
+
}
|
|
57298
|
+
function unionOf(schemas, defaultVal) {
|
|
57299
|
+
return defaultVal === void 0 ? new Union(schemas, void 0, false) : new Union(schemas, defaultVal, true);
|
|
57300
|
+
}
|
|
57266
57301
|
var px = {
|
|
57267
|
-
|
|
57268
|
-
|
|
57269
|
-
|
|
57270
|
-
|
|
57271
|
-
/** Matches a boolean. Default: false or provided value. */
|
|
57272
|
-
boolean: (defaultVal = false) => new Bool(defaultVal),
|
|
57273
|
-
/** Matches one exact primitive value; its default is the value itself. */
|
|
57302
|
+
string,
|
|
57303
|
+
number,
|
|
57304
|
+
boolean,
|
|
57305
|
+
/** Matches one exact primitive value; absent means the value itself. */
|
|
57274
57306
|
literal: (value) => new Literal(value),
|
|
57275
|
-
|
|
57276
|
-
|
|
57277
|
-
/**
|
|
57278
|
-
* Returns the first schema whose isValid passes.
|
|
57279
|
-
* TypeScript infers the union of all member types automatically.
|
|
57280
|
-
*/
|
|
57281
|
-
union: (schemas, defaultVal) => new Union(schemas, defaultVal),
|
|
57307
|
+
enum: oneOf,
|
|
57308
|
+
union: unionOf,
|
|
57282
57309
|
/**
|
|
57283
57310
|
* Discriminated union — reads `raw[key]`, finds the member schema whose
|
|
57284
57311
|
* literal at `key` matches, then delegates sanitize/isValid to that member.
|
|
@@ -57286,7 +57313,8 @@ ${codeFrame}` : message);
|
|
|
57286
57313
|
* TypeScript infers the union of all member types automatically.
|
|
57287
57314
|
*/
|
|
57288
57315
|
discriminatedUnion: (key, schemas) => new DiscriminatedUnion(key, schemas),
|
|
57289
|
-
/** Typed object — unknown keys are stripped. Required fields fall back to their default.
|
|
57316
|
+
/** Typed object — unknown keys are stripped. Required fields fall back to their default.
|
|
57317
|
+
* Its `defaults` say what each stated field means when a document leaves it out. */
|
|
57290
57318
|
object: (shape) => new Obj(shape),
|
|
57291
57319
|
/**
|
|
57292
57320
|
* Open object — validates known keys; passes unknown keys through as-is,
|
|
@@ -57419,8 +57447,11 @@ ${codeFrame}` : message);
|
|
|
57419
57447
|
offScreen: "pause",
|
|
57420
57448
|
mouseOut: "continue",
|
|
57421
57449
|
visibilityThreshold: 0.5,
|
|
57422
|
-
visibilityDebounce: 150
|
|
57450
|
+
visibilityDebounce: 150,
|
|
57451
|
+
finish: "hold"
|
|
57423
57452
|
};
|
|
57453
|
+
var PX_DEFAULT_DURATION_MS = 1e3;
|
|
57454
|
+
var PX_DEFAULT_ITERATIONS = 1;
|
|
57424
57455
|
function resolveTrigger(trigger) {
|
|
57425
57456
|
var _a22, _b, _c, _d, _e;
|
|
57426
57457
|
return {
|
|
@@ -57633,15 +57664,15 @@ ${codeFrame}` : message);
|
|
|
57633
57664
|
var keyframeTangentOut = (kf) => anyKf(kf).tangentOut;
|
|
57634
57665
|
var PxLoopSchema = implementsInterface()(px.object({
|
|
57635
57666
|
segmentCount: px.number().optional(),
|
|
57636
|
-
repeatAt: px.enum([PxLoopRepeatAt.start, PxLoopRepeatAt.end]).optional(),
|
|
57637
|
-
direction: px.enum([PxLoopDirection.normal, PxLoopDirection.alternate]).optional()
|
|
57667
|
+
repeatAt: px.enum([PxLoopRepeatAt.start, PxLoopRepeatAt.end], PxLoopRepeatAt.end).optional(),
|
|
57668
|
+
direction: px.enum([PxLoopDirection.normal, PxLoopDirection.alternate], PxLoopDirection.normal).optional()
|
|
57638
57669
|
}));
|
|
57639
57670
|
var PxPropertyAnimationSchema = implementsInterface()(px.object({
|
|
57640
57671
|
value: PxKeyframeValueSchema.optional(),
|
|
57641
57672
|
keyframes: px.array(PxKeyframeSchema).optional(),
|
|
57642
57673
|
loop: px.union([PxLoopSchema, px.boolean()]).optional(),
|
|
57643
57674
|
autoOrient: px.boolean().optional(),
|
|
57644
|
-
alongPathMode: px.enum([PxAlongPathMode.sampled, PxAlongPathMode.offsetPath]).optional()
|
|
57675
|
+
alongPathMode: px.enum([PxAlongPathMode.sampled, PxAlongPathMode.offsetPath], PxAlongPathMode.sampled).optional()
|
|
57645
57676
|
}));
|
|
57646
57677
|
var PxTransformPartsSchema = implementsInterface()(px.object({
|
|
57647
57678
|
translate: px.tuple([px.number(), px.number()]).optional(),
|
|
@@ -57671,9 +57702,9 @@ ${codeFrame}` : message);
|
|
|
57671
57702
|
// What happens after a NATURAL finish — `'hold'` (default: keep the end state per
|
|
57672
57703
|
// `fill`) or `'reset'` (snap back to the start state). One of four occasion keys
|
|
57673
57704
|
// (`start`, `offScreen`, `mouseOut`, `finish`), all named the same way.
|
|
57674
|
-
finish: px.enum([PxFinishAction.hold, PxFinishAction.reset]).optional(),
|
|
57675
|
-
visibilityThreshold: px.number().optional(),
|
|
57676
|
-
visibilityDebounce: px.number().optional()
|
|
57705
|
+
finish: px.enum([PxFinishAction.hold, PxFinishAction.reset], PX_TRIGGER_DEFAULTS.finish).optional(),
|
|
57706
|
+
visibilityThreshold: px.number(PX_TRIGGER_DEFAULTS.visibilityThreshold).optional(),
|
|
57707
|
+
visibilityDebounce: px.number(PX_TRIGGER_DEFAULTS.visibilityDebounce).optional()
|
|
57677
57708
|
}));
|
|
57678
57709
|
var PxGlyphSchema = implementsInterface()(px.object({
|
|
57679
57710
|
width: px.number(),
|
|
@@ -57699,7 +57730,7 @@ ${codeFrame}` : message);
|
|
|
57699
57730
|
PxScrollPhase.exit,
|
|
57700
57731
|
PxScrollPhase.entryCrossing,
|
|
57701
57732
|
PxScrollPhase.exitCrossing
|
|
57702
|
-
]).optional(),
|
|
57733
|
+
], PxScrollPhase.cover).optional(),
|
|
57703
57734
|
fraction: px.number().optional()
|
|
57704
57735
|
}));
|
|
57705
57736
|
var PxScrollRangeSchema = px.object({
|
|
@@ -57707,37 +57738,37 @@ ${codeFrame}` : message);
|
|
|
57707
57738
|
end: PxScrollRangePointSchema.optional()
|
|
57708
57739
|
});
|
|
57709
57740
|
var PxScrollSchema = implementsInterface()(px.object({
|
|
57710
|
-
kind: px.enum([PxScrollKind.view, PxScrollKind.scroll]).optional(),
|
|
57711
|
-
axis: px.enum([PxScrollAxis.block, PxScrollAxis.inline, PxScrollAxis.x, PxScrollAxis.y]).optional(),
|
|
57712
|
-
source: px.enum([PxScrollSource.nearest, PxScrollSource.root]).optional(),
|
|
57741
|
+
kind: px.enum([PxScrollKind.view, PxScrollKind.scroll], PxScrollKind.view).optional(),
|
|
57742
|
+
axis: px.enum([PxScrollAxis.block, PxScrollAxis.inline, PxScrollAxis.x, PxScrollAxis.y], PxScrollAxis.block).optional(),
|
|
57743
|
+
source: px.enum([PxScrollSource.nearest, PxScrollSource.root], PxScrollSource.nearest).optional(),
|
|
57713
57744
|
// Free-form: the two keywords `parent`/`scroller` plus any CSS selector.
|
|
57714
57745
|
subject: px.string().optional(),
|
|
57715
57746
|
smoothing: px.number().optional(),
|
|
57716
|
-
pin: px.boolean().optional(),
|
|
57717
|
-
pinAlign: px.enum([PxPinAlign.top, PxPinAlign.center, PxPinAlign.bottom]).optional(),
|
|
57747
|
+
pin: px.boolean(false).optional(),
|
|
57748
|
+
pinAlign: px.enum([PxPinAlign.top, PxPinAlign.center, PxPinAlign.bottom], PxPinAlign.top).optional(),
|
|
57718
57749
|
pinOffset: px.number().optional(),
|
|
57719
57750
|
pinDistance: px.number().optional(),
|
|
57720
57751
|
range: PxScrollRangeSchema.optional()
|
|
57721
57752
|
}));
|
|
57722
57753
|
var PxTimelinePinSchema = implementsInterface()(px.object({
|
|
57723
|
-
align: px.enum([PxPinAlign.top, PxPinAlign.center, PxPinAlign.bottom]).optional(),
|
|
57754
|
+
align: px.enum([PxPinAlign.top, PxPinAlign.center, PxPinAlign.bottom], PxPinAlign.top).optional(),
|
|
57724
57755
|
offset: px.number().optional(),
|
|
57725
57756
|
distance: px.number().optional()
|
|
57726
57757
|
}));
|
|
57727
|
-
var PxTimelineEngineSchema = px.enum([PxTimelineEngineSetting.auto, PxTimelineEngineSetting.native, PxTimelineEngineSetting.js]).optional();
|
|
57758
|
+
var PxTimelineEngineSchema = px.enum([PxTimelineEngineSetting.auto, PxTimelineEngineSetting.native, PxTimelineEngineSetting.js], PxTimelineEngineSetting.auto).optional();
|
|
57728
57759
|
var PxTimeTimelineSchema = implementsInterface()(px.object({
|
|
57729
57760
|
type: px.literal("time").optional(),
|
|
57730
57761
|
engine: PxTimelineEngineSchema,
|
|
57731
57762
|
frameRate: px.number().optional(),
|
|
57732
57763
|
// §2.8: duration is a property of the TIMELINE — how long one pass takes.
|
|
57733
|
-
duration: px.number().optional(),
|
|
57764
|
+
duration: px.number(PX_DEFAULT_DURATION_MS).optional(),
|
|
57734
57765
|
trigger: PxTriggerSchema.optional(),
|
|
57735
|
-
delay: px.number().optional(),
|
|
57736
|
-
iterations: px.union([px.number(), px.literal("infinite")]).optional(),
|
|
57766
|
+
delay: px.number(0).optional(),
|
|
57767
|
+
iterations: px.union([px.number(PX_DEFAULT_ITERATIONS), px.literal("infinite")], PX_DEFAULT_ITERATIONS).optional(),
|
|
57737
57768
|
// `fillMode` on the wire (CSS `animation-fill-mode`; the runtime view calls it `fill`)
|
|
57738
57769
|
// — never `fill`, which is paint everywhere else in the format.
|
|
57739
|
-
fillMode: px.enum([PxFillMode.forwards, PxFillMode.backwards, PxFillMode.both, PxFillMode.none]).optional(),
|
|
57740
|
-
direction: px.enum([PxPlaybackDirection.normal, PxPlaybackDirection.reverse, PxPlaybackDirection.alternate, PxPlaybackDirection.alternateReverse]).optional()
|
|
57770
|
+
fillMode: px.enum([PxFillMode.forwards, PxFillMode.backwards, PxFillMode.both, PxFillMode.none], PxFillMode.forwards).optional(),
|
|
57771
|
+
direction: px.enum([PxPlaybackDirection.normal, PxPlaybackDirection.reverse, PxPlaybackDirection.alternate, PxPlaybackDirection.alternateReverse], PxPlaybackDirection.normal).optional()
|
|
57741
57772
|
}));
|
|
57742
57773
|
var scrollishTimelineShape = {
|
|
57743
57774
|
// §2.8: duration is a property of the TIMELINE — under scrubbing it is the keyframe
|
|
@@ -57748,8 +57779,8 @@ ${codeFrame}` : message);
|
|
|
57748
57779
|
iterations: px.number().optional(),
|
|
57749
57780
|
engine: PxTimelineEngineSchema,
|
|
57750
57781
|
frameRate: px.number().optional(),
|
|
57751
|
-
axis: px.enum([PxScrollAxis.block, PxScrollAxis.inline, PxScrollAxis.x, PxScrollAxis.y]).optional(),
|
|
57752
|
-
source: px.enum([PxScrollSource.nearest, PxScrollSource.root]).optional(),
|
|
57782
|
+
axis: px.enum([PxScrollAxis.block, PxScrollAxis.inline, PxScrollAxis.x, PxScrollAxis.y], PxScrollAxis.block).optional(),
|
|
57783
|
+
source: px.enum([PxScrollSource.nearest, PxScrollSource.root], PxScrollSource.nearest).optional(),
|
|
57753
57784
|
subject: px.string().optional(),
|
|
57754
57785
|
// 'parent' | 'scroller' | any CSS selector
|
|
57755
57786
|
smoothing: px.number().optional(),
|
|
@@ -57829,9 +57860,10 @@ ${codeFrame}` : message);
|
|
|
57829
57860
|
}));
|
|
57830
57861
|
var PxMaskedByEffectSchema = implementsInterface()(px.object({
|
|
57831
57862
|
source: px.string().optional(),
|
|
57832
|
-
|
|
57833
|
-
|
|
57834
|
-
|
|
57863
|
+
// SVG's own initial values — what a <mask> does when the attribute is not there.
|
|
57864
|
+
maskType: px.enum([PxMaskType.luminance, PxMaskType.alpha], PxMaskType.luminance).optional(),
|
|
57865
|
+
maskUnits: px.enum([PxUnits.userSpaceOnUse, PxUnits.objectBoundingBox], PxUnits.objectBoundingBox).optional(),
|
|
57866
|
+
maskContentUnits: px.enum([PxUnits.userSpaceOnUse, PxUnits.objectBoundingBox], PxUnits.userSpaceOnUse).optional(),
|
|
57835
57867
|
x: px.number().optional(),
|
|
57836
57868
|
y: px.number().optional(),
|
|
57837
57869
|
width: px.number().optional(),
|
|
@@ -57843,7 +57875,7 @@ ${codeFrame}` : message);
|
|
|
57843
57875
|
var PxStrokeTrimEffectSchema = implementsInterface()(px.object({
|
|
57844
57876
|
offset: PxAnimatableNumberSchema.optional(),
|
|
57845
57877
|
range: PxAnimatableVec2Schema.optional(),
|
|
57846
|
-
subPaths: px.enum([PxStrokeTrimSubPaths.separate, PxStrokeTrimSubPaths.combined]).optional()
|
|
57878
|
+
subPaths: px.enum([PxStrokeTrimSubPaths.separate, PxStrokeTrimSubPaths.combined], PxStrokeTrimSubPaths.separate).optional()
|
|
57847
57879
|
}));
|
|
57848
57880
|
var PxRetimeEffectSchema = implementsInterface()(px.object({
|
|
57849
57881
|
start: px.number().optional(),
|
|
@@ -57875,17 +57907,20 @@ ${codeFrame}` : message);
|
|
|
57875
57907
|
radius: PxAnimatableNumberSchema.optional(),
|
|
57876
57908
|
focal: PxAnimatableVec2Schema.optional(),
|
|
57877
57909
|
stops: PxAnimatableGradientStopsSchema.optional(),
|
|
57878
|
-
|
|
57879
|
-
|
|
57910
|
+
// SVG's own initial values — what a gradient does when the attribute is not there.
|
|
57911
|
+
gradientUnits: px.enum([PxUnits.userSpaceOnUse, PxUnits.objectBoundingBox], PxUnits.objectBoundingBox).optional(),
|
|
57912
|
+
spreadMethod: px.enum([PxGradientSpreadMethod.pad, PxGradientSpreadMethod.reflect, PxGradientSpreadMethod.repeat], PxGradientSpreadMethod.pad).optional(),
|
|
57880
57913
|
gradientTransform: px.string().optional()
|
|
57881
57914
|
}));
|
|
57882
57915
|
var PxStrokeGradientEffectSchema = PxFillGradientEffectSchema;
|
|
57883
57916
|
var PxTextPathEffectSchema = implementsInterface()(px.object({
|
|
57884
57917
|
pathData: px.string(),
|
|
57885
|
-
pathOverflow
|
|
57886
|
-
|
|
57887
|
-
|
|
57888
|
-
|
|
57918
|
+
// `extend` is what an omitted pathOverflow means (glyphs continue along the tangent); the
|
|
57919
|
+
// other three are SVG's own initial values for the native <textPath> attributes.
|
|
57920
|
+
pathOverflow: px.enum([PxPathOverflow.clip, PxPathOverflow.extend], PxPathOverflow.extend).optional(),
|
|
57921
|
+
lengthAdjust: px.enum([PxLengthAdjust.spacing, PxLengthAdjust.spacingAndGlyphs], PxLengthAdjust.spacing).optional(),
|
|
57922
|
+
method: px.enum([PxTextPathMethod.align, PxTextPathMethod.stretch], PxTextPathMethod.align).optional(),
|
|
57923
|
+
spacing: px.enum([PxTextPathSpacing.auto, PxTextPathSpacing.exact], PxTextPathSpacing.exact).optional(),
|
|
57889
57924
|
startOffset: PxAnimatableNumberSchema.optional(),
|
|
57890
57925
|
textLength: PxAnimatableNumberSchema.optional()
|
|
57891
57926
|
}));
|
|
@@ -58445,7 +58480,6 @@ ${codeFrame}` : message);
|
|
|
58445
58480
|
return Object.keys(out).length ? out : void 0;
|
|
58446
58481
|
}
|
|
58447
58482
|
var PX_STYLE_ATTR_NAMES = /* @__PURE__ */ new Set(["offset-distance", "offsetDistance"]);
|
|
58448
|
-
var PX_DEFAULT_DURATION_MS = 1e3;
|
|
58449
58483
|
function kebabToCamelCaseWord(kebab) {
|
|
58450
58484
|
return kebab.includes("-") ? kebab.replace(/-([a-z])/g, (_, letter) => letter.toUpperCase()) : kebab;
|
|
58451
58485
|
}
|
|
@@ -62442,9 +62476,10 @@ ${codeFrame}` : message);
|
|
|
62442
62476
|
}
|
|
62443
62477
|
var TRANSFORM_CHANNEL = "transform";
|
|
62444
62478
|
var REVERSED_DIRECTIONS = /* @__PURE__ */ new Set(["reverse", "alternate-reverse"]);
|
|
62479
|
+
var VERIFY_SAMPLE_FRACTIONS = [0, 0.25, 0.5, 0.75, 1];
|
|
62445
62480
|
var SCRATCH_ID_PREFIX = "__px_rest_";
|
|
62446
62481
|
function materializeRestPosesInTree(root, engine) {
|
|
62447
|
-
var _a22;
|
|
62482
|
+
var _a22, _b;
|
|
62448
62483
|
const out = deepClone(root);
|
|
62449
62484
|
const config = getAnimatorConfig(out) || {};
|
|
62450
62485
|
const duration = +(config.duration || PX_DEFAULT_DURATION_MS);
|
|
@@ -62456,18 +62491,27 @@ ${codeFrame}` : message);
|
|
|
62456
62491
|
for (const [key, animate] of before) {
|
|
62457
62492
|
const node = nodes.get(key);
|
|
62458
62493
|
if (!node) continue;
|
|
62459
|
-
|
|
62494
|
+
const channels = Object.keys(animate);
|
|
62495
|
+
for (const channel of channels) {
|
|
62496
|
+
if (PX_TRANSFORM_FN_NAMES.has(channel)) continue;
|
|
62460
62497
|
if (!mayCarryRestPose(node, channel)) continue;
|
|
62461
62498
|
const value = firstFrameValue(animate, channel, firstFrameTime);
|
|
62462
62499
|
if (value === void 0) continue;
|
|
62463
62500
|
node[channel] = value;
|
|
62464
62501
|
added.set(key, [...(_a22 = added.get(key)) != null ? _a22 : [], channel]);
|
|
62465
62502
|
}
|
|
62503
|
+
if (channels.some((channel) => PX_TRANSFORM_FN_NAMES.has(channel)) && mayCarryTransformRestPose(node)) {
|
|
62504
|
+
const parts = firstFrameTransformParts(animate, firstFrameTime);
|
|
62505
|
+
if (parts) {
|
|
62506
|
+
node[TRANSFORM_CHANNEL] = parts;
|
|
62507
|
+
added.set(key, [...(_b = added.get(key)) != null ? _b : [], TRANSFORM_CHANNEL]);
|
|
62508
|
+
}
|
|
62509
|
+
}
|
|
62466
62510
|
}
|
|
62467
62511
|
if (added.size) {
|
|
62468
62512
|
const after = bindingsOf(out, engine);
|
|
62469
62513
|
for (const [key, channels] of added) {
|
|
62470
|
-
if (
|
|
62514
|
+
if (writesTheSameFrames(before.get(key), after.get(key), duration)) continue;
|
|
62471
62515
|
const node = nodes.get(key);
|
|
62472
62516
|
if (node) for (const channel of channels) delete node[channel];
|
|
62473
62517
|
}
|
|
@@ -62476,16 +62520,31 @@ ${codeFrame}` : message);
|
|
|
62476
62520
|
}
|
|
62477
62521
|
function mayCarryRestPose(node, channel) {
|
|
62478
62522
|
if (node[channel] !== void 0) return false;
|
|
62479
|
-
if (
|
|
62480
|
-
|
|
62481
|
-
|
|
62482
|
-
|
|
62523
|
+
if (channel === TRANSFORM_CHANNEL) return mayCarryTransformRestPose(node);
|
|
62524
|
+
return true;
|
|
62525
|
+
}
|
|
62526
|
+
function mayCarryTransformRestPose(node) {
|
|
62527
|
+
if (node[TRANSFORM_CHANNEL] !== void 0) return false;
|
|
62528
|
+
for (const part of PX_TRANSFORM_FN_NAMES) if (node[part] !== void 0) return false;
|
|
62483
62529
|
return true;
|
|
62484
62530
|
}
|
|
62485
62531
|
function firstFrameValue(animate, channel, timeMs) {
|
|
62486
62532
|
const values = Object.values(calcAnimationValues({ [channel]: animate[channel] }, timeMs));
|
|
62487
62533
|
return values.length === 1 && values[0] !== "" ? values[0] : void 0;
|
|
62488
62534
|
}
|
|
62535
|
+
function firstFrameTransformParts(animate, timeMs) {
|
|
62536
|
+
const family = {};
|
|
62537
|
+
for (const channel of Object.keys(animate)) if (PX_TRANSFORM_FN_NAMES.has(channel)) family[channel] = animate[channel];
|
|
62538
|
+
const written = calcAnimationValues(family, timeMs)[TRANSFORM_CHANNEL];
|
|
62539
|
+
if (!written) return void 0;
|
|
62540
|
+
const parts = parseTransformParts(written.replace(/(px|deg)\b/g, ""));
|
|
62541
|
+
return parts && Object.keys(parts).length ? parts : void 0;
|
|
62542
|
+
}
|
|
62543
|
+
function writesTheSameFrames(a, b, durationMs) {
|
|
62544
|
+
if (!a || !b) return a === b;
|
|
62545
|
+
const frame = (animate, t) => JSON.stringify(calcAnimationValues(animate, t)).replace(/\s+/g, "");
|
|
62546
|
+
return VERIFY_SAMPLE_FRACTIONS.every((fraction) => frame(a, fraction * durationMs) === frame(b, fraction * durationMs));
|
|
62547
|
+
}
|
|
62489
62548
|
function bindingsOf(tree, engine) {
|
|
62490
62549
|
const scratch = deepClone(tree);
|
|
62491
62550
|
const keyById = /* @__PURE__ */ new Map();
|
|
@@ -62694,13 +62753,13 @@ ${codeFrame}` : message);
|
|
|
62694
62753
|
const bindings = normalizeBindings(doc, PxTimelineEngine.js);
|
|
62695
62754
|
const _iterations = config.iterations;
|
|
62696
62755
|
let iterations = 1;
|
|
62697
|
-
if (typeof _iterations === "number") iterations = _iterations ||
|
|
62756
|
+
if (typeof _iterations === "number") iterations = _iterations || PX_DEFAULT_ITERATIONS;
|
|
62698
62757
|
if (_iterations === "infinite") iterations = Infinity;
|
|
62699
62758
|
if (iterations < 1) iterations = 1;
|
|
62700
62759
|
const duration = +(config.duration || PX_DEFAULT_DURATION_MS);
|
|
62701
|
-
const totalDuration = duration && iterations ? duration * (iterations === Infinity ? Infinity : iterations) : duration ? (iterations != null ? iterations :
|
|
62702
|
-
const direction = config.direction ||
|
|
62703
|
-
const fill = (_a22 = config.fill) != null ? _a22 :
|
|
62760
|
+
const totalDuration = duration && iterations ? duration * (iterations === Infinity ? Infinity : iterations) : duration ? (iterations != null ? iterations : PX_DEFAULT_ITERATIONS) * duration : 0;
|
|
62761
|
+
const direction = config.direction || PxTimeTimelineSchema.defaults.direction;
|
|
62762
|
+
const fill = (_a22 = config.fill) != null ? _a22 : PxTimeTimelineSchema.defaults.fillMode;
|
|
62704
62763
|
const fillsForwards = fill === "forwards" || fill === "both";
|
|
62705
62764
|
const fillsBackwards = fill === "backwards" || fill === "both";
|
|
62706
62765
|
let timerId = null;
|
|
@@ -63703,7 +63762,7 @@ ${codeFrame}` : message);
|
|
|
63703
63762
|
let seekPosition;
|
|
63704
63763
|
if (config.delay && config.delay < 0 && config.duration) {
|
|
63705
63764
|
const rawSeek = -config.delay;
|
|
63706
|
-
seekPosition = iterations === Infinity ? rawSeek % config.duration : Math.min(rawSeek, config.duration * (iterations != null ? iterations :
|
|
63765
|
+
seekPosition = iterations === Infinity ? rawSeek % config.duration : Math.min(rawSeek, config.duration * (iterations != null ? iterations : PX_DEFAULT_ITERATIONS));
|
|
63707
63766
|
}
|
|
63708
63767
|
const effectOptions = {
|
|
63709
63768
|
duration: config.duration,
|
|
@@ -63810,7 +63869,7 @@ ${codeFrame}` : message);
|
|
|
63810
63869
|
},
|
|
63811
63870
|
"setCurrentTime": (time) => {
|
|
63812
63871
|
var _a22;
|
|
63813
|
-
const ceiling = seekCeilingMs((_a22 = config.duration) != null ? _a22 : 0, iterations != null ? iterations :
|
|
63872
|
+
const ceiling = seekCeilingMs((_a22 = config.duration) != null ? _a22 : 0, iterations != null ? iterations : PX_DEFAULT_ITERATIONS);
|
|
63814
63873
|
const seek = ceiling > 0 ? clampSeekMs(time, ceiling) : Math.max(0, time);
|
|
63815
63874
|
finishNotified = false;
|
|
63816
63875
|
animations.forEach((a) => {
|
|
@@ -63820,11 +63879,11 @@ ${codeFrame}` : message);
|
|
|
63820
63879
|
"getCurrentProgress": () => {
|
|
63821
63880
|
var _a22;
|
|
63822
63881
|
const t = api.getCurrentTime();
|
|
63823
|
-
return t === null ? null : timeToProgress(t, (_a22 = config.duration) != null ? _a22 : 0, iterations != null ? iterations :
|
|
63882
|
+
return t === null ? null : timeToProgress(t, (_a22 = config.duration) != null ? _a22 : 0, iterations != null ? iterations : PX_DEFAULT_ITERATIONS);
|
|
63824
63883
|
},
|
|
63825
63884
|
"setCurrentProgress": (progress) => {
|
|
63826
63885
|
var _a22;
|
|
63827
|
-
api.setCurrentTime(progressToTimeMs(progress, (_a22 = config.duration) != null ? _a22 : 0, iterations != null ? iterations :
|
|
63886
|
+
api.setCurrentTime(progressToTimeMs(progress, (_a22 = config.duration) != null ? _a22 : 0, iterations != null ? iterations : PX_DEFAULT_ITERATIONS));
|
|
63828
63887
|
},
|
|
63829
63888
|
"destroy": () => {
|
|
63830
63889
|
var _a22;
|
|
@@ -64342,7 +64401,7 @@ ${codeFrame}` : message);
|
|
|
64342
64401
|
return proxy;
|
|
64343
64402
|
}
|
|
64344
64403
|
|
|
64345
|
-
// ../svg-animator-core/dist/chunk-
|
|
64404
|
+
// ../svg-animator-core/dist/chunk-37OFJ3RX.js
|
|
64346
64405
|
var __defProp3 = Object.defineProperty;
|
|
64347
64406
|
var __defProps3 = Object.defineProperties;
|
|
64348
64407
|
var __getOwnPropDescs3 = Object.getOwnPropertyDescriptors;
|
|
@@ -64386,19 +64445,31 @@ ${codeFrame}` : message);
|
|
|
64386
64445
|
return result;
|
|
64387
64446
|
}
|
|
64388
64447
|
var Base2 = class {
|
|
64448
|
+
/** Structural schemas (objects, arrays, unions of objects…) pass `false`: they state no scalar default. */
|
|
64449
|
+
constructor(_statesDefault) {
|
|
64450
|
+
this._statesDefault = _statesDefault;
|
|
64451
|
+
}
|
|
64389
64452
|
_canSanitize(raw) {
|
|
64390
64453
|
return this.isValid(raw);
|
|
64391
64454
|
}
|
|
64455
|
+
/** A REQUIRED field is never absent; its default is the repair value. */
|
|
64456
|
+
absentDefault() {
|
|
64457
|
+
return this._default;
|
|
64458
|
+
}
|
|
64392
64459
|
optional() {
|
|
64393
64460
|
return new Optional2(this);
|
|
64394
64461
|
}
|
|
64395
64462
|
};
|
|
64396
64463
|
var Optional2 = class extends Base2 {
|
|
64397
64464
|
constructor(inner) {
|
|
64398
|
-
super();
|
|
64465
|
+
super(inner._statesDefault);
|
|
64399
64466
|
this.inner = inner;
|
|
64400
64467
|
this._default = void 0;
|
|
64401
64468
|
}
|
|
64469
|
+
/** Absent means the inner schema's STATED default — or nothing at all when it states none. */
|
|
64470
|
+
absentDefault() {
|
|
64471
|
+
return this.inner._statesDefault ? this.inner._default : void 0;
|
|
64472
|
+
}
|
|
64402
64473
|
sanitize(raw) {
|
|
64403
64474
|
if (raw === void 0 || raw === null) return void 0;
|
|
64404
64475
|
return this.inner._canSanitize(raw) ? this.inner.sanitize(raw) : void 0;
|
|
@@ -64412,8 +64483,8 @@ ${codeFrame}` : message);
|
|
|
64412
64483
|
}
|
|
64413
64484
|
};
|
|
64414
64485
|
var Str2 = class extends Base2 {
|
|
64415
|
-
constructor(_default
|
|
64416
|
-
super();
|
|
64486
|
+
constructor(_default, statesDefault) {
|
|
64487
|
+
super(statesDefault);
|
|
64417
64488
|
this._default = _default;
|
|
64418
64489
|
}
|
|
64419
64490
|
sanitize(raw) {
|
|
@@ -64426,8 +64497,8 @@ ${codeFrame}` : message);
|
|
|
64426
64497
|
}
|
|
64427
64498
|
};
|
|
64428
64499
|
var Num2 = class extends Base2 {
|
|
64429
|
-
constructor(_default
|
|
64430
|
-
super();
|
|
64500
|
+
constructor(_default, statesDefault) {
|
|
64501
|
+
super(statesDefault);
|
|
64431
64502
|
this._default = _default;
|
|
64432
64503
|
}
|
|
64433
64504
|
sanitize(raw) {
|
|
@@ -64440,8 +64511,8 @@ ${codeFrame}` : message);
|
|
|
64440
64511
|
}
|
|
64441
64512
|
};
|
|
64442
64513
|
var Bool2 = class extends Base2 {
|
|
64443
|
-
constructor(_default
|
|
64444
|
-
super();
|
|
64514
|
+
constructor(_default, statesDefault) {
|
|
64515
|
+
super(statesDefault);
|
|
64445
64516
|
this._default = _default;
|
|
64446
64517
|
}
|
|
64447
64518
|
sanitize(raw) {
|
|
@@ -64454,8 +64525,9 @@ ${codeFrame}` : message);
|
|
|
64454
64525
|
}
|
|
64455
64526
|
};
|
|
64456
64527
|
var Literal2 = class extends Base2 {
|
|
64528
|
+
/** A literal IS its own value: absent means it. */
|
|
64457
64529
|
constructor(value) {
|
|
64458
|
-
super();
|
|
64530
|
+
super(true);
|
|
64459
64531
|
this.value = value;
|
|
64460
64532
|
this._default = value;
|
|
64461
64533
|
}
|
|
@@ -64469,8 +64541,8 @@ ${codeFrame}` : message);
|
|
|
64469
64541
|
}
|
|
64470
64542
|
};
|
|
64471
64543
|
var Enum2 = class extends Base2 {
|
|
64472
|
-
constructor(values, defaultVal) {
|
|
64473
|
-
super();
|
|
64544
|
+
constructor(values, defaultVal, statesDefault) {
|
|
64545
|
+
super(statesDefault);
|
|
64474
64546
|
this.values = values;
|
|
64475
64547
|
this._default = defaultVal != null ? defaultVal : values[0];
|
|
64476
64548
|
}
|
|
@@ -64485,8 +64557,8 @@ ${codeFrame}` : message);
|
|
|
64485
64557
|
};
|
|
64486
64558
|
var UNION_MEMBER_ERROR_LIMIT2 = 4;
|
|
64487
64559
|
var Union2 = class extends Base2 {
|
|
64488
|
-
constructor(schemas, defaultVal) {
|
|
64489
|
-
super();
|
|
64560
|
+
constructor(schemas, defaultVal, statesDefault) {
|
|
64561
|
+
super(statesDefault);
|
|
64490
64562
|
this.schemas = schemas;
|
|
64491
64563
|
this._kind = "union";
|
|
64492
64564
|
this._default = defaultVal != null ? defaultVal : schemas[0]._default;
|
|
@@ -64539,7 +64611,7 @@ ${codeFrame}` : message);
|
|
|
64539
64611
|
var DiscriminatedUnion2 = class extends Base2 {
|
|
64540
64612
|
constructor(_key, _schemas, defaultVal) {
|
|
64541
64613
|
var _a22;
|
|
64542
|
-
super();
|
|
64614
|
+
super(false);
|
|
64543
64615
|
this._key = _key;
|
|
64544
64616
|
this._schemas = _schemas;
|
|
64545
64617
|
this._kind = "discriminatedUnion";
|
|
@@ -64578,13 +64650,19 @@ ${codeFrame}` : message);
|
|
|
64578
64650
|
return schema ? schema._canSanitize(raw) : this._schemas[0]._canSanitize(raw);
|
|
64579
64651
|
}
|
|
64580
64652
|
};
|
|
64653
|
+
function statedDefaults2(shape) {
|
|
64654
|
+
const out = {};
|
|
64655
|
+
for (const key of Object.keys(shape)) if (shape[key]._statesDefault) out[key] = shape[key].absentDefault();
|
|
64656
|
+
return Object.freeze(out);
|
|
64657
|
+
}
|
|
64581
64658
|
var Obj2 = class extends Base2 {
|
|
64582
64659
|
constructor(_shape) {
|
|
64583
|
-
super();
|
|
64660
|
+
super(false);
|
|
64584
64661
|
this._shape = _shape;
|
|
64585
64662
|
const d = {};
|
|
64586
64663
|
for (const key of Object.keys(_shape)) d[key] = _shape[key]._default;
|
|
64587
64664
|
this._default = d;
|
|
64665
|
+
this.defaults = statedDefaults2(_shape);
|
|
64588
64666
|
}
|
|
64589
64667
|
sanitize(raw) {
|
|
64590
64668
|
const src = raw && typeof raw === "object" && !Array.isArray(raw) ? raw : {};
|
|
@@ -64626,12 +64704,13 @@ ${codeFrame}` : message);
|
|
|
64626
64704
|
};
|
|
64627
64705
|
var OpenObj2 = class extends Base2 {
|
|
64628
64706
|
constructor(_shape, _openSchema) {
|
|
64629
|
-
super();
|
|
64707
|
+
super(false);
|
|
64630
64708
|
this._shape = _shape;
|
|
64631
64709
|
this._openSchema = _openSchema;
|
|
64632
64710
|
const d = {};
|
|
64633
64711
|
for (const key of Object.keys(_shape)) d[key] = _shape[key]._default;
|
|
64634
64712
|
this._default = d;
|
|
64713
|
+
this.defaults = statedDefaults2(_shape);
|
|
64635
64714
|
}
|
|
64636
64715
|
sanitize(raw) {
|
|
64637
64716
|
const src = raw && typeof raw === "object" && !Array.isArray(raw) ? raw : {};
|
|
@@ -64676,7 +64755,7 @@ ${codeFrame}` : message);
|
|
|
64676
64755
|
};
|
|
64677
64756
|
var Arr2 = class extends Base2 {
|
|
64678
64757
|
constructor(item) {
|
|
64679
|
-
super();
|
|
64758
|
+
super(false);
|
|
64680
64759
|
this.item = item;
|
|
64681
64760
|
this._default = [];
|
|
64682
64761
|
}
|
|
@@ -64708,7 +64787,7 @@ ${codeFrame}` : message);
|
|
|
64708
64787
|
};
|
|
64709
64788
|
var Rec2 = class extends Base2 {
|
|
64710
64789
|
constructor(value) {
|
|
64711
|
-
super();
|
|
64790
|
+
super(false);
|
|
64712
64791
|
this.value = value;
|
|
64713
64792
|
this._kind = "record";
|
|
64714
64793
|
this._default = {};
|
|
@@ -64741,7 +64820,7 @@ ${codeFrame}` : message);
|
|
|
64741
64820
|
};
|
|
64742
64821
|
var Any2 = class extends Base2 {
|
|
64743
64822
|
constructor() {
|
|
64744
|
-
super(
|
|
64823
|
+
super(false);
|
|
64745
64824
|
this._default = void 0;
|
|
64746
64825
|
}
|
|
64747
64826
|
sanitize(raw) {
|
|
@@ -64756,7 +64835,7 @@ ${codeFrame}` : message);
|
|
|
64756
64835
|
};
|
|
64757
64836
|
var Defined2 = class extends Base2 {
|
|
64758
64837
|
constructor() {
|
|
64759
|
-
super(
|
|
64838
|
+
super(false);
|
|
64760
64839
|
this._default = void 0;
|
|
64761
64840
|
}
|
|
64762
64841
|
sanitize(raw) {
|
|
@@ -64773,7 +64852,7 @@ ${codeFrame}` : message);
|
|
|
64773
64852
|
};
|
|
64774
64853
|
var Lazy2 = class extends Base2 {
|
|
64775
64854
|
constructor(fn, _default) {
|
|
64776
|
-
super();
|
|
64855
|
+
super(false);
|
|
64777
64856
|
this.fn = fn;
|
|
64778
64857
|
this._default = _default;
|
|
64779
64858
|
this.resolved = null;
|
|
@@ -64794,7 +64873,7 @@ ${codeFrame}` : message);
|
|
|
64794
64873
|
};
|
|
64795
64874
|
var Tuple2 = class extends Base2 {
|
|
64796
64875
|
constructor(schemas) {
|
|
64797
|
-
super();
|
|
64876
|
+
super(false);
|
|
64798
64877
|
this.schemas = schemas;
|
|
64799
64878
|
this._kind = "tuple";
|
|
64800
64879
|
this._default = schemas.map((s) => s._default);
|
|
@@ -64825,22 +64904,29 @@ ${codeFrame}` : message);
|
|
|
64825
64904
|
function implementsInterface2() {
|
|
64826
64905
|
return (schema) => schema;
|
|
64827
64906
|
}
|
|
64907
|
+
function string2(defaultVal) {
|
|
64908
|
+
return defaultVal === void 0 ? new Str2("", false) : new Str2(defaultVal, true);
|
|
64909
|
+
}
|
|
64910
|
+
function number2(defaultVal) {
|
|
64911
|
+
return defaultVal === void 0 ? new Num2(0, false) : new Num2(defaultVal, true);
|
|
64912
|
+
}
|
|
64913
|
+
function boolean2(defaultVal) {
|
|
64914
|
+
return defaultVal === void 0 ? new Bool2(false, false) : new Bool2(defaultVal, true);
|
|
64915
|
+
}
|
|
64916
|
+
function oneOf2(values, defaultVal) {
|
|
64917
|
+
return defaultVal === void 0 ? new Enum2(values, void 0, false) : new Enum2(values, defaultVal, true);
|
|
64918
|
+
}
|
|
64919
|
+
function unionOf2(schemas, defaultVal) {
|
|
64920
|
+
return defaultVal === void 0 ? new Union2(schemas, void 0, false) : new Union2(schemas, defaultVal, true);
|
|
64921
|
+
}
|
|
64828
64922
|
var px2 = {
|
|
64829
|
-
|
|
64830
|
-
|
|
64831
|
-
|
|
64832
|
-
|
|
64833
|
-
/** Matches a boolean. Default: false or provided value. */
|
|
64834
|
-
boolean: (defaultVal = false) => new Bool2(defaultVal),
|
|
64835
|
-
/** Matches one exact primitive value; its default is the value itself. */
|
|
64923
|
+
string: string2,
|
|
64924
|
+
number: number2,
|
|
64925
|
+
boolean: boolean2,
|
|
64926
|
+
/** Matches one exact primitive value; absent means the value itself. */
|
|
64836
64927
|
literal: (value) => new Literal2(value),
|
|
64837
|
-
|
|
64838
|
-
|
|
64839
|
-
/**
|
|
64840
|
-
* Returns the first schema whose isValid passes.
|
|
64841
|
-
* TypeScript infers the union of all member types automatically.
|
|
64842
|
-
*/
|
|
64843
|
-
union: (schemas, defaultVal) => new Union2(schemas, defaultVal),
|
|
64928
|
+
enum: oneOf2,
|
|
64929
|
+
union: unionOf2,
|
|
64844
64930
|
/**
|
|
64845
64931
|
* Discriminated union — reads `raw[key]`, finds the member schema whose
|
|
64846
64932
|
* literal at `key` matches, then delegates sanitize/isValid to that member.
|
|
@@ -64848,7 +64934,8 @@ ${codeFrame}` : message);
|
|
|
64848
64934
|
* TypeScript infers the union of all member types automatically.
|
|
64849
64935
|
*/
|
|
64850
64936
|
discriminatedUnion: (key, schemas) => new DiscriminatedUnion2(key, schemas),
|
|
64851
|
-
/** Typed object — unknown keys are stripped. Required fields fall back to their default.
|
|
64937
|
+
/** Typed object — unknown keys are stripped. Required fields fall back to their default.
|
|
64938
|
+
* Its `defaults` say what each stated field means when a document leaves it out. */
|
|
64852
64939
|
object: (shape) => new Obj2(shape),
|
|
64853
64940
|
/**
|
|
64854
64941
|
* Open object — validates known keys; passes unknown keys through as-is,
|
|
@@ -64975,8 +65062,11 @@ ${codeFrame}` : message);
|
|
|
64975
65062
|
offScreen: "pause",
|
|
64976
65063
|
mouseOut: "continue",
|
|
64977
65064
|
visibilityThreshold: 0.5,
|
|
64978
|
-
visibilityDebounce: 150
|
|
65065
|
+
visibilityDebounce: 150,
|
|
65066
|
+
finish: "hold"
|
|
64979
65067
|
};
|
|
65068
|
+
var PX_DEFAULT_DURATION_MS2 = 1e3;
|
|
65069
|
+
var PX_DEFAULT_ITERATIONS2 = 1;
|
|
64980
65070
|
var PxControlMode = {
|
|
64981
65071
|
/** No control props — the document's trigger decides, and nothing is taken over. */
|
|
64982
65072
|
static: "static",
|
|
@@ -65204,15 +65294,15 @@ ${codeFrame}` : message);
|
|
|
65204
65294
|
var keyframeTangentOut2 = (kf) => anyKf2(kf).tangentOut;
|
|
65205
65295
|
var PxLoopSchema2 = implementsInterface2()(px2.object({
|
|
65206
65296
|
segmentCount: px2.number().optional(),
|
|
65207
|
-
repeatAt: px2.enum([PxLoopRepeatAt2.start, PxLoopRepeatAt2.end]).optional(),
|
|
65208
|
-
direction: px2.enum([PxLoopDirection2.normal, PxLoopDirection2.alternate]).optional()
|
|
65297
|
+
repeatAt: px2.enum([PxLoopRepeatAt2.start, PxLoopRepeatAt2.end], PxLoopRepeatAt2.end).optional(),
|
|
65298
|
+
direction: px2.enum([PxLoopDirection2.normal, PxLoopDirection2.alternate], PxLoopDirection2.normal).optional()
|
|
65209
65299
|
}));
|
|
65210
65300
|
var PxPropertyAnimationSchema2 = implementsInterface2()(px2.object({
|
|
65211
65301
|
value: PxKeyframeValueSchema2.optional(),
|
|
65212
65302
|
keyframes: px2.array(PxKeyframeSchema2).optional(),
|
|
65213
65303
|
loop: px2.union([PxLoopSchema2, px2.boolean()]).optional(),
|
|
65214
65304
|
autoOrient: px2.boolean().optional(),
|
|
65215
|
-
alongPathMode: px2.enum([PxAlongPathMode2.sampled, PxAlongPathMode2.offsetPath]).optional()
|
|
65305
|
+
alongPathMode: px2.enum([PxAlongPathMode2.sampled, PxAlongPathMode2.offsetPath], PxAlongPathMode2.sampled).optional()
|
|
65216
65306
|
}));
|
|
65217
65307
|
var PxTransformPartsSchema2 = implementsInterface2()(px2.object({
|
|
65218
65308
|
translate: px2.tuple([px2.number(), px2.number()]).optional(),
|
|
@@ -65242,9 +65332,9 @@ ${codeFrame}` : message);
|
|
|
65242
65332
|
// What happens after a NATURAL finish — `'hold'` (default: keep the end state per
|
|
65243
65333
|
// `fill`) or `'reset'` (snap back to the start state). One of four occasion keys
|
|
65244
65334
|
// (`start`, `offScreen`, `mouseOut`, `finish`), all named the same way.
|
|
65245
|
-
finish: px2.enum([PxFinishAction2.hold, PxFinishAction2.reset]).optional(),
|
|
65246
|
-
visibilityThreshold: px2.number().optional(),
|
|
65247
|
-
visibilityDebounce: px2.number().optional()
|
|
65335
|
+
finish: px2.enum([PxFinishAction2.hold, PxFinishAction2.reset], PX_TRIGGER_DEFAULTS2.finish).optional(),
|
|
65336
|
+
visibilityThreshold: px2.number(PX_TRIGGER_DEFAULTS2.visibilityThreshold).optional(),
|
|
65337
|
+
visibilityDebounce: px2.number(PX_TRIGGER_DEFAULTS2.visibilityDebounce).optional()
|
|
65248
65338
|
}));
|
|
65249
65339
|
var PxGlyphSchema2 = implementsInterface2()(px2.object({
|
|
65250
65340
|
width: px2.number(),
|
|
@@ -65270,7 +65360,7 @@ ${codeFrame}` : message);
|
|
|
65270
65360
|
PxScrollPhase2.exit,
|
|
65271
65361
|
PxScrollPhase2.entryCrossing,
|
|
65272
65362
|
PxScrollPhase2.exitCrossing
|
|
65273
|
-
]).optional(),
|
|
65363
|
+
], PxScrollPhase2.cover).optional(),
|
|
65274
65364
|
fraction: px2.number().optional()
|
|
65275
65365
|
}));
|
|
65276
65366
|
var PxScrollRangeSchema2 = px2.object({
|
|
@@ -65278,37 +65368,37 @@ ${codeFrame}` : message);
|
|
|
65278
65368
|
end: PxScrollRangePointSchema2.optional()
|
|
65279
65369
|
});
|
|
65280
65370
|
var PxScrollSchema2 = implementsInterface2()(px2.object({
|
|
65281
|
-
kind: px2.enum([PxScrollKind2.view, PxScrollKind2.scroll]).optional(),
|
|
65282
|
-
axis: px2.enum([PxScrollAxis2.block, PxScrollAxis2.inline, PxScrollAxis2.x, PxScrollAxis2.y]).optional(),
|
|
65283
|
-
source: px2.enum([PxScrollSource2.nearest, PxScrollSource2.root]).optional(),
|
|
65371
|
+
kind: px2.enum([PxScrollKind2.view, PxScrollKind2.scroll], PxScrollKind2.view).optional(),
|
|
65372
|
+
axis: px2.enum([PxScrollAxis2.block, PxScrollAxis2.inline, PxScrollAxis2.x, PxScrollAxis2.y], PxScrollAxis2.block).optional(),
|
|
65373
|
+
source: px2.enum([PxScrollSource2.nearest, PxScrollSource2.root], PxScrollSource2.nearest).optional(),
|
|
65284
65374
|
// Free-form: the two keywords `parent`/`scroller` plus any CSS selector.
|
|
65285
65375
|
subject: px2.string().optional(),
|
|
65286
65376
|
smoothing: px2.number().optional(),
|
|
65287
|
-
pin: px2.boolean().optional(),
|
|
65288
|
-
pinAlign: px2.enum([PxPinAlign2.top, PxPinAlign2.center, PxPinAlign2.bottom]).optional(),
|
|
65377
|
+
pin: px2.boolean(false).optional(),
|
|
65378
|
+
pinAlign: px2.enum([PxPinAlign2.top, PxPinAlign2.center, PxPinAlign2.bottom], PxPinAlign2.top).optional(),
|
|
65289
65379
|
pinOffset: px2.number().optional(),
|
|
65290
65380
|
pinDistance: px2.number().optional(),
|
|
65291
65381
|
range: PxScrollRangeSchema2.optional()
|
|
65292
65382
|
}));
|
|
65293
65383
|
var PxTimelinePinSchema2 = implementsInterface2()(px2.object({
|
|
65294
|
-
align: px2.enum([PxPinAlign2.top, PxPinAlign2.center, PxPinAlign2.bottom]).optional(),
|
|
65384
|
+
align: px2.enum([PxPinAlign2.top, PxPinAlign2.center, PxPinAlign2.bottom], PxPinAlign2.top).optional(),
|
|
65295
65385
|
offset: px2.number().optional(),
|
|
65296
65386
|
distance: px2.number().optional()
|
|
65297
65387
|
}));
|
|
65298
|
-
var PxTimelineEngineSchema2 = px2.enum([PxTimelineEngineSetting2.auto, PxTimelineEngineSetting2.native, PxTimelineEngineSetting2.js]).optional();
|
|
65388
|
+
var PxTimelineEngineSchema2 = px2.enum([PxTimelineEngineSetting2.auto, PxTimelineEngineSetting2.native, PxTimelineEngineSetting2.js], PxTimelineEngineSetting2.auto).optional();
|
|
65299
65389
|
var PxTimeTimelineSchema2 = implementsInterface2()(px2.object({
|
|
65300
65390
|
type: px2.literal("time").optional(),
|
|
65301
65391
|
engine: PxTimelineEngineSchema2,
|
|
65302
65392
|
frameRate: px2.number().optional(),
|
|
65303
65393
|
// §2.8: duration is a property of the TIMELINE — how long one pass takes.
|
|
65304
|
-
duration: px2.number().optional(),
|
|
65394
|
+
duration: px2.number(PX_DEFAULT_DURATION_MS2).optional(),
|
|
65305
65395
|
trigger: PxTriggerSchema2.optional(),
|
|
65306
|
-
delay: px2.number().optional(),
|
|
65307
|
-
iterations: px2.union([px2.number(), px2.literal("infinite")]).optional(),
|
|
65396
|
+
delay: px2.number(0).optional(),
|
|
65397
|
+
iterations: px2.union([px2.number(PX_DEFAULT_ITERATIONS2), px2.literal("infinite")], PX_DEFAULT_ITERATIONS2).optional(),
|
|
65308
65398
|
// `fillMode` on the wire (CSS `animation-fill-mode`; the runtime view calls it `fill`)
|
|
65309
65399
|
// — never `fill`, which is paint everywhere else in the format.
|
|
65310
|
-
fillMode: px2.enum([PxFillMode2.forwards, PxFillMode2.backwards, PxFillMode2.both, PxFillMode2.none]).optional(),
|
|
65311
|
-
direction: px2.enum([PxPlaybackDirection2.normal, PxPlaybackDirection2.reverse, PxPlaybackDirection2.alternate, PxPlaybackDirection2.alternateReverse]).optional()
|
|
65400
|
+
fillMode: px2.enum([PxFillMode2.forwards, PxFillMode2.backwards, PxFillMode2.both, PxFillMode2.none], PxFillMode2.forwards).optional(),
|
|
65401
|
+
direction: px2.enum([PxPlaybackDirection2.normal, PxPlaybackDirection2.reverse, PxPlaybackDirection2.alternate, PxPlaybackDirection2.alternateReverse], PxPlaybackDirection2.normal).optional()
|
|
65312
65402
|
}));
|
|
65313
65403
|
var scrollishTimelineShape2 = {
|
|
65314
65404
|
// §2.8: duration is a property of the TIMELINE — under scrubbing it is the keyframe
|
|
@@ -65319,8 +65409,8 @@ ${codeFrame}` : message);
|
|
|
65319
65409
|
iterations: px2.number().optional(),
|
|
65320
65410
|
engine: PxTimelineEngineSchema2,
|
|
65321
65411
|
frameRate: px2.number().optional(),
|
|
65322
|
-
axis: px2.enum([PxScrollAxis2.block, PxScrollAxis2.inline, PxScrollAxis2.x, PxScrollAxis2.y]).optional(),
|
|
65323
|
-
source: px2.enum([PxScrollSource2.nearest, PxScrollSource2.root]).optional(),
|
|
65412
|
+
axis: px2.enum([PxScrollAxis2.block, PxScrollAxis2.inline, PxScrollAxis2.x, PxScrollAxis2.y], PxScrollAxis2.block).optional(),
|
|
65413
|
+
source: px2.enum([PxScrollSource2.nearest, PxScrollSource2.root], PxScrollSource2.nearest).optional(),
|
|
65324
65414
|
subject: px2.string().optional(),
|
|
65325
65415
|
// 'parent' | 'scroller' | any CSS selector
|
|
65326
65416
|
smoothing: px2.number().optional(),
|
|
@@ -65400,9 +65490,10 @@ ${codeFrame}` : message);
|
|
|
65400
65490
|
}));
|
|
65401
65491
|
var PxMaskedByEffectSchema2 = implementsInterface2()(px2.object({
|
|
65402
65492
|
source: px2.string().optional(),
|
|
65403
|
-
|
|
65404
|
-
|
|
65405
|
-
|
|
65493
|
+
// SVG's own initial values — what a <mask> does when the attribute is not there.
|
|
65494
|
+
maskType: px2.enum([PxMaskType2.luminance, PxMaskType2.alpha], PxMaskType2.luminance).optional(),
|
|
65495
|
+
maskUnits: px2.enum([PxUnits2.userSpaceOnUse, PxUnits2.objectBoundingBox], PxUnits2.objectBoundingBox).optional(),
|
|
65496
|
+
maskContentUnits: px2.enum([PxUnits2.userSpaceOnUse, PxUnits2.objectBoundingBox], PxUnits2.userSpaceOnUse).optional(),
|
|
65406
65497
|
x: px2.number().optional(),
|
|
65407
65498
|
y: px2.number().optional(),
|
|
65408
65499
|
width: px2.number().optional(),
|
|
@@ -65414,7 +65505,7 @@ ${codeFrame}` : message);
|
|
|
65414
65505
|
var PxStrokeTrimEffectSchema2 = implementsInterface2()(px2.object({
|
|
65415
65506
|
offset: PxAnimatableNumberSchema2.optional(),
|
|
65416
65507
|
range: PxAnimatableVec2Schema2.optional(),
|
|
65417
|
-
subPaths: px2.enum([PxStrokeTrimSubPaths2.separate, PxStrokeTrimSubPaths2.combined]).optional()
|
|
65508
|
+
subPaths: px2.enum([PxStrokeTrimSubPaths2.separate, PxStrokeTrimSubPaths2.combined], PxStrokeTrimSubPaths2.separate).optional()
|
|
65418
65509
|
}));
|
|
65419
65510
|
var PxRetimeEffectSchema2 = implementsInterface2()(px2.object({
|
|
65420
65511
|
start: px2.number().optional(),
|
|
@@ -65446,17 +65537,20 @@ ${codeFrame}` : message);
|
|
|
65446
65537
|
radius: PxAnimatableNumberSchema2.optional(),
|
|
65447
65538
|
focal: PxAnimatableVec2Schema2.optional(),
|
|
65448
65539
|
stops: PxAnimatableGradientStopsSchema2.optional(),
|
|
65449
|
-
|
|
65450
|
-
|
|
65540
|
+
// SVG's own initial values — what a gradient does when the attribute is not there.
|
|
65541
|
+
gradientUnits: px2.enum([PxUnits2.userSpaceOnUse, PxUnits2.objectBoundingBox], PxUnits2.objectBoundingBox).optional(),
|
|
65542
|
+
spreadMethod: px2.enum([PxGradientSpreadMethod2.pad, PxGradientSpreadMethod2.reflect, PxGradientSpreadMethod2.repeat], PxGradientSpreadMethod2.pad).optional(),
|
|
65451
65543
|
gradientTransform: px2.string().optional()
|
|
65452
65544
|
}));
|
|
65453
65545
|
var PxStrokeGradientEffectSchema2 = PxFillGradientEffectSchema2;
|
|
65454
65546
|
var PxTextPathEffectSchema2 = implementsInterface2()(px2.object({
|
|
65455
65547
|
pathData: px2.string(),
|
|
65456
|
-
pathOverflow
|
|
65457
|
-
|
|
65458
|
-
|
|
65459
|
-
|
|
65548
|
+
// `extend` is what an omitted pathOverflow means (glyphs continue along the tangent); the
|
|
65549
|
+
// other three are SVG's own initial values for the native <textPath> attributes.
|
|
65550
|
+
pathOverflow: px2.enum([PxPathOverflow2.clip, PxPathOverflow2.extend], PxPathOverflow2.extend).optional(),
|
|
65551
|
+
lengthAdjust: px2.enum([PxLengthAdjust2.spacing, PxLengthAdjust2.spacingAndGlyphs], PxLengthAdjust2.spacing).optional(),
|
|
65552
|
+
method: px2.enum([PxTextPathMethod2.align, PxTextPathMethod2.stretch], PxTextPathMethod2.align).optional(),
|
|
65553
|
+
spacing: px2.enum([PxTextPathSpacing2.auto, PxTextPathSpacing2.exact], PxTextPathSpacing2.exact).optional(),
|
|
65460
65554
|
startOffset: PxAnimatableNumberSchema2.optional(),
|
|
65461
65555
|
textLength: PxAnimatableNumberSchema2.optional()
|
|
65462
65556
|
}));
|
|
@@ -65928,7 +66022,6 @@ ${codeFrame}` : message);
|
|
|
65928
66022
|
if (str22.replace(/([a-zA-Z]+)\s*\(([^)]*)\)/g, "").replace(/[\s,]/g, "").length) return void 0;
|
|
65929
66023
|
return Object.keys(out).length ? out : void 0;
|
|
65930
66024
|
}
|
|
65931
|
-
var PX_DEFAULT_DURATION_MS2 = 1e3;
|
|
65932
66025
|
function kebabToCamelCaseWord2(kebab) {
|
|
65933
66026
|
return kebab.includes("-") ? kebab.replace(/-([a-z])/g, (_, letter) => letter.toUpperCase()) : kebab;
|
|
65934
66027
|
}
|
|
@@ -69925,9 +70018,10 @@ ${codeFrame}` : message);
|
|
|
69925
70018
|
}
|
|
69926
70019
|
var TRANSFORM_CHANNEL2 = "transform";
|
|
69927
70020
|
var REVERSED_DIRECTIONS2 = /* @__PURE__ */ new Set(["reverse", "alternate-reverse"]);
|
|
70021
|
+
var VERIFY_SAMPLE_FRACTIONS2 = [0, 0.25, 0.5, 0.75, 1];
|
|
69928
70022
|
var SCRATCH_ID_PREFIX2 = "__px_rest_";
|
|
69929
70023
|
function materializeRestPosesInTree2(root, engine) {
|
|
69930
|
-
var _a22;
|
|
70024
|
+
var _a22, _b;
|
|
69931
70025
|
const out = deepClone2(root);
|
|
69932
70026
|
const config = getAnimatorConfig2(out) || {};
|
|
69933
70027
|
const duration = +(config.duration || PX_DEFAULT_DURATION_MS2);
|
|
@@ -69939,18 +70033,27 @@ ${codeFrame}` : message);
|
|
|
69939
70033
|
for (const [key, animate] of before) {
|
|
69940
70034
|
const node = nodes.get(key);
|
|
69941
70035
|
if (!node) continue;
|
|
69942
|
-
|
|
70036
|
+
const channels = Object.keys(animate);
|
|
70037
|
+
for (const channel of channels) {
|
|
70038
|
+
if (PX_TRANSFORM_FN_NAMES2.has(channel)) continue;
|
|
69943
70039
|
if (!mayCarryRestPose2(node, channel)) continue;
|
|
69944
70040
|
const value = firstFrameValue2(animate, channel, firstFrameTime);
|
|
69945
70041
|
if (value === void 0) continue;
|
|
69946
70042
|
node[channel] = value;
|
|
69947
70043
|
added.set(key, [...(_a22 = added.get(key)) != null ? _a22 : [], channel]);
|
|
69948
70044
|
}
|
|
70045
|
+
if (channels.some((channel) => PX_TRANSFORM_FN_NAMES2.has(channel)) && mayCarryTransformRestPose2(node)) {
|
|
70046
|
+
const parts = firstFrameTransformParts2(animate, firstFrameTime);
|
|
70047
|
+
if (parts) {
|
|
70048
|
+
node[TRANSFORM_CHANNEL2] = parts;
|
|
70049
|
+
added.set(key, [...(_b = added.get(key)) != null ? _b : [], TRANSFORM_CHANNEL2]);
|
|
70050
|
+
}
|
|
70051
|
+
}
|
|
69949
70052
|
}
|
|
69950
70053
|
if (added.size) {
|
|
69951
70054
|
const after = bindingsOf2(out, engine);
|
|
69952
70055
|
for (const [key, channels] of added) {
|
|
69953
|
-
if (
|
|
70056
|
+
if (writesTheSameFrames2(before.get(key), after.get(key), duration)) continue;
|
|
69954
70057
|
const node = nodes.get(key);
|
|
69955
70058
|
if (node) for (const channel of channels) delete node[channel];
|
|
69956
70059
|
}
|
|
@@ -69959,16 +70062,31 @@ ${codeFrame}` : message);
|
|
|
69959
70062
|
}
|
|
69960
70063
|
function mayCarryRestPose2(node, channel) {
|
|
69961
70064
|
if (node[channel] !== void 0) return false;
|
|
69962
|
-
if (
|
|
69963
|
-
|
|
69964
|
-
|
|
69965
|
-
|
|
70065
|
+
if (channel === TRANSFORM_CHANNEL2) return mayCarryTransformRestPose2(node);
|
|
70066
|
+
return true;
|
|
70067
|
+
}
|
|
70068
|
+
function mayCarryTransformRestPose2(node) {
|
|
70069
|
+
if (node[TRANSFORM_CHANNEL2] !== void 0) return false;
|
|
70070
|
+
for (const part of PX_TRANSFORM_FN_NAMES2) if (node[part] !== void 0) return false;
|
|
69966
70071
|
return true;
|
|
69967
70072
|
}
|
|
69968
70073
|
function firstFrameValue2(animate, channel, timeMs) {
|
|
69969
70074
|
const values = Object.values(calcAnimationValues2({ [channel]: animate[channel] }, timeMs));
|
|
69970
70075
|
return values.length === 1 && values[0] !== "" ? values[0] : void 0;
|
|
69971
70076
|
}
|
|
70077
|
+
function firstFrameTransformParts2(animate, timeMs) {
|
|
70078
|
+
const family = {};
|
|
70079
|
+
for (const channel of Object.keys(animate)) if (PX_TRANSFORM_FN_NAMES2.has(channel)) family[channel] = animate[channel];
|
|
70080
|
+
const written = calcAnimationValues2(family, timeMs)[TRANSFORM_CHANNEL2];
|
|
70081
|
+
if (!written) return void 0;
|
|
70082
|
+
const parts = parseTransformParts2(written.replace(/(px|deg)\b/g, ""));
|
|
70083
|
+
return parts && Object.keys(parts).length ? parts : void 0;
|
|
70084
|
+
}
|
|
70085
|
+
function writesTheSameFrames2(a, b, durationMs) {
|
|
70086
|
+
if (!a || !b) return a === b;
|
|
70087
|
+
const frame = (animate, t) => JSON.stringify(calcAnimationValues2(animate, t)).replace(/\s+/g, "");
|
|
70088
|
+
return VERIFY_SAMPLE_FRACTIONS2.every((fraction) => frame(a, fraction * durationMs) === frame(b, fraction * durationMs));
|
|
70089
|
+
}
|
|
69972
70090
|
function bindingsOf2(tree, engine) {
|
|
69973
70091
|
const scratch = deepClone2(tree);
|
|
69974
70092
|
const keyById = /* @__PURE__ */ new Map();
|