@pixodesk/svg-animator-web 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/chunk-2AFALI5O.min.js +1 -0
- package/dist/{chunk-QE7KJWAN.js → chunk-ZBGGXE5W.js} +143 -83
- package/dist/chunk-ZBGGXE5W.js.map +1 -0
- package/dist/index.cjs +144 -85
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +6 -5
- 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 +107 -72
- 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 +111 -77
- package/dist/index.prerendered.umd.js.map +1 -1
- package/dist/index.prerendered.umd.min.js +1 -1
- package/dist/internal.cjs +104 -69
- package/dist/internal.cjs.map +1 -1
- package/dist/internal.js +1 -1
- package/dist/internal.min.cjs +1 -1
- package/dist/internal.min.js +1 -1
- package/dist/pixodesk-svg-animator.umd.js +143 -84
- package/dist/pixodesk-svg-animator.umd.js.map +1 -1
- package/dist/pixodesk-svg-animator.umd.min.js +1 -1
- package/mangle-reserved.json +2 -0
- package/package.json +2 -2
- package/dist/chunk-QE7KJWAN.js.map +0 -1
- package/dist/chunk-RQ5KZXDT.min.js +0 -1
|
@@ -67,19 +67,31 @@ var PixodeskAnimator = (() => {
|
|
|
67
67
|
return result;
|
|
68
68
|
}
|
|
69
69
|
var Base = class {
|
|
70
|
+
/** Structural schemas (objects, arrays, unions of objects…) pass `false`: they state no scalar default. */
|
|
71
|
+
constructor(_statesDefault) {
|
|
72
|
+
this._statesDefault = _statesDefault;
|
|
73
|
+
}
|
|
70
74
|
_canSanitize(raw) {
|
|
71
75
|
return this.isValid(raw);
|
|
72
76
|
}
|
|
77
|
+
/** A REQUIRED field is never absent; its default is the repair value. */
|
|
78
|
+
absentDefault() {
|
|
79
|
+
return this._default;
|
|
80
|
+
}
|
|
73
81
|
optional() {
|
|
74
82
|
return new Optional(this);
|
|
75
83
|
}
|
|
76
84
|
};
|
|
77
85
|
var Optional = class extends Base {
|
|
78
86
|
constructor(inner) {
|
|
79
|
-
super();
|
|
87
|
+
super(inner._statesDefault);
|
|
80
88
|
this.inner = inner;
|
|
81
89
|
this._default = void 0;
|
|
82
90
|
}
|
|
91
|
+
/** Absent means the inner schema's STATED default — or nothing at all when it states none. */
|
|
92
|
+
absentDefault() {
|
|
93
|
+
return this.inner._statesDefault ? this.inner._default : void 0;
|
|
94
|
+
}
|
|
83
95
|
sanitize(raw) {
|
|
84
96
|
if (raw === void 0 || raw === null) return void 0;
|
|
85
97
|
return this.inner._canSanitize(raw) ? this.inner.sanitize(raw) : void 0;
|
|
@@ -93,8 +105,8 @@ var PixodeskAnimator = (() => {
|
|
|
93
105
|
}
|
|
94
106
|
};
|
|
95
107
|
var Str = class extends Base {
|
|
96
|
-
constructor(_default
|
|
97
|
-
super();
|
|
108
|
+
constructor(_default, statesDefault) {
|
|
109
|
+
super(statesDefault);
|
|
98
110
|
this._default = _default;
|
|
99
111
|
}
|
|
100
112
|
sanitize(raw) {
|
|
@@ -107,8 +119,8 @@ var PixodeskAnimator = (() => {
|
|
|
107
119
|
}
|
|
108
120
|
};
|
|
109
121
|
var Num = class extends Base {
|
|
110
|
-
constructor(_default
|
|
111
|
-
super();
|
|
122
|
+
constructor(_default, statesDefault) {
|
|
123
|
+
super(statesDefault);
|
|
112
124
|
this._default = _default;
|
|
113
125
|
}
|
|
114
126
|
sanitize(raw) {
|
|
@@ -121,8 +133,8 @@ var PixodeskAnimator = (() => {
|
|
|
121
133
|
}
|
|
122
134
|
};
|
|
123
135
|
var Bool = class extends Base {
|
|
124
|
-
constructor(_default
|
|
125
|
-
super();
|
|
136
|
+
constructor(_default, statesDefault) {
|
|
137
|
+
super(statesDefault);
|
|
126
138
|
this._default = _default;
|
|
127
139
|
}
|
|
128
140
|
sanitize(raw) {
|
|
@@ -135,8 +147,9 @@ var PixodeskAnimator = (() => {
|
|
|
135
147
|
}
|
|
136
148
|
};
|
|
137
149
|
var Literal = class extends Base {
|
|
150
|
+
/** A literal IS its own value: absent means it. */
|
|
138
151
|
constructor(value) {
|
|
139
|
-
super();
|
|
152
|
+
super(true);
|
|
140
153
|
this.value = value;
|
|
141
154
|
this._default = value;
|
|
142
155
|
}
|
|
@@ -150,8 +163,8 @@ var PixodeskAnimator = (() => {
|
|
|
150
163
|
}
|
|
151
164
|
};
|
|
152
165
|
var Enum = class extends Base {
|
|
153
|
-
constructor(values, defaultVal) {
|
|
154
|
-
super();
|
|
166
|
+
constructor(values, defaultVal, statesDefault) {
|
|
167
|
+
super(statesDefault);
|
|
155
168
|
this.values = values;
|
|
156
169
|
this._default = defaultVal != null ? defaultVal : values[0];
|
|
157
170
|
}
|
|
@@ -166,8 +179,8 @@ var PixodeskAnimator = (() => {
|
|
|
166
179
|
};
|
|
167
180
|
var UNION_MEMBER_ERROR_LIMIT = 4;
|
|
168
181
|
var Union = class extends Base {
|
|
169
|
-
constructor(schemas, defaultVal) {
|
|
170
|
-
super();
|
|
182
|
+
constructor(schemas, defaultVal, statesDefault) {
|
|
183
|
+
super(statesDefault);
|
|
171
184
|
this.schemas = schemas;
|
|
172
185
|
/** Structural tag read by {@link describeSchema} — `schemas` alone cannot tell Union from Tuple. */
|
|
173
186
|
this._kind = "union";
|
|
@@ -221,7 +234,7 @@ var PixodeskAnimator = (() => {
|
|
|
221
234
|
var DiscriminatedUnion = class extends Base {
|
|
222
235
|
constructor(_key, _schemas, defaultVal) {
|
|
223
236
|
var _a;
|
|
224
|
-
super();
|
|
237
|
+
super(false);
|
|
225
238
|
this._key = _key;
|
|
226
239
|
this._schemas = _schemas;
|
|
227
240
|
/** Structural tag read by {@link describeSchema}. */
|
|
@@ -261,13 +274,19 @@ var PixodeskAnimator = (() => {
|
|
|
261
274
|
return schema ? schema._canSanitize(raw) : this._schemas[0]._canSanitize(raw);
|
|
262
275
|
}
|
|
263
276
|
};
|
|
277
|
+
function statedDefaults(shape) {
|
|
278
|
+
const out = {};
|
|
279
|
+
for (const key of Object.keys(shape)) if (shape[key]._statesDefault) out[key] = shape[key].absentDefault();
|
|
280
|
+
return Object.freeze(out);
|
|
281
|
+
}
|
|
264
282
|
var Obj = class extends Base {
|
|
265
283
|
constructor(_shape) {
|
|
266
|
-
super();
|
|
284
|
+
super(false);
|
|
267
285
|
this._shape = _shape;
|
|
268
286
|
const d = {};
|
|
269
287
|
for (const key of Object.keys(_shape)) d[key] = _shape[key]._default;
|
|
270
288
|
this._default = d;
|
|
289
|
+
this.defaults = statedDefaults(_shape);
|
|
271
290
|
}
|
|
272
291
|
sanitize(raw) {
|
|
273
292
|
const src = raw && typeof raw === "object" && !Array.isArray(raw) ? raw : {};
|
|
@@ -309,12 +328,13 @@ var PixodeskAnimator = (() => {
|
|
|
309
328
|
};
|
|
310
329
|
var OpenObj = class extends Base {
|
|
311
330
|
constructor(_shape, _openSchema) {
|
|
312
|
-
super();
|
|
331
|
+
super(false);
|
|
313
332
|
this._shape = _shape;
|
|
314
333
|
this._openSchema = _openSchema;
|
|
315
334
|
const d = {};
|
|
316
335
|
for (const key of Object.keys(_shape)) d[key] = _shape[key]._default;
|
|
317
336
|
this._default = d;
|
|
337
|
+
this.defaults = statedDefaults(_shape);
|
|
318
338
|
}
|
|
319
339
|
sanitize(raw) {
|
|
320
340
|
const src = raw && typeof raw === "object" && !Array.isArray(raw) ? raw : {};
|
|
@@ -359,7 +379,7 @@ var PixodeskAnimator = (() => {
|
|
|
359
379
|
};
|
|
360
380
|
var Arr = class extends Base {
|
|
361
381
|
constructor(item) {
|
|
362
|
-
super();
|
|
382
|
+
super(false);
|
|
363
383
|
this.item = item;
|
|
364
384
|
this._default = [];
|
|
365
385
|
}
|
|
@@ -391,7 +411,7 @@ var PixodeskAnimator = (() => {
|
|
|
391
411
|
};
|
|
392
412
|
var Rec = class extends Base {
|
|
393
413
|
constructor(value) {
|
|
394
|
-
super();
|
|
414
|
+
super(false);
|
|
395
415
|
this.value = value;
|
|
396
416
|
/** Structural tag read by {@link describeSchema}. */
|
|
397
417
|
this._kind = "record";
|
|
@@ -425,7 +445,7 @@ var PixodeskAnimator = (() => {
|
|
|
425
445
|
};
|
|
426
446
|
var Any = class extends Base {
|
|
427
447
|
constructor() {
|
|
428
|
-
super(
|
|
448
|
+
super(false);
|
|
429
449
|
this._default = void 0;
|
|
430
450
|
}
|
|
431
451
|
sanitize(raw) {
|
|
@@ -440,7 +460,7 @@ var PixodeskAnimator = (() => {
|
|
|
440
460
|
};
|
|
441
461
|
var Defined = class extends Base {
|
|
442
462
|
constructor() {
|
|
443
|
-
super(
|
|
463
|
+
super(false);
|
|
444
464
|
this._default = void 0;
|
|
445
465
|
}
|
|
446
466
|
sanitize(raw) {
|
|
@@ -457,7 +477,7 @@ var PixodeskAnimator = (() => {
|
|
|
457
477
|
};
|
|
458
478
|
var Lazy = class extends Base {
|
|
459
479
|
constructor(fn, _default) {
|
|
460
|
-
super();
|
|
480
|
+
super(false);
|
|
461
481
|
this.fn = fn;
|
|
462
482
|
this._default = _default;
|
|
463
483
|
this.resolved = null;
|
|
@@ -478,7 +498,7 @@ var PixodeskAnimator = (() => {
|
|
|
478
498
|
};
|
|
479
499
|
var Tuple = class extends Base {
|
|
480
500
|
constructor(schemas) {
|
|
481
|
-
super();
|
|
501
|
+
super(false);
|
|
482
502
|
this.schemas = schemas;
|
|
483
503
|
/** Structural tag read by {@link describeSchema} — `schemas` alone cannot tell Tuple from Union. */
|
|
484
504
|
this._kind = "tuple";
|
|
@@ -510,22 +530,29 @@ var PixodeskAnimator = (() => {
|
|
|
510
530
|
function implementsInterface() {
|
|
511
531
|
return (schema) => schema;
|
|
512
532
|
}
|
|
533
|
+
function string(defaultVal) {
|
|
534
|
+
return defaultVal === void 0 ? new Str("", false) : new Str(defaultVal, true);
|
|
535
|
+
}
|
|
536
|
+
function number(defaultVal) {
|
|
537
|
+
return defaultVal === void 0 ? new Num(0, false) : new Num(defaultVal, true);
|
|
538
|
+
}
|
|
539
|
+
function boolean(defaultVal) {
|
|
540
|
+
return defaultVal === void 0 ? new Bool(false, false) : new Bool(defaultVal, true);
|
|
541
|
+
}
|
|
542
|
+
function oneOf(values, defaultVal) {
|
|
543
|
+
return defaultVal === void 0 ? new Enum(values, void 0, false) : new Enum(values, defaultVal, true);
|
|
544
|
+
}
|
|
545
|
+
function unionOf(schemas, defaultVal) {
|
|
546
|
+
return defaultVal === void 0 ? new Union(schemas, void 0, false) : new Union(schemas, defaultVal, true);
|
|
547
|
+
}
|
|
513
548
|
var px = {
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
/** Matches a boolean. Default: false or provided value. */
|
|
519
|
-
boolean: (defaultVal = false) => new Bool(defaultVal),
|
|
520
|
-
/** Matches one exact primitive value; its default is the value itself. */
|
|
549
|
+
string,
|
|
550
|
+
number,
|
|
551
|
+
boolean,
|
|
552
|
+
/** Matches one exact primitive value; absent means the value itself. */
|
|
521
553
|
literal: (value) => new Literal(value),
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
/**
|
|
525
|
-
* Returns the first schema whose isValid passes.
|
|
526
|
-
* TypeScript infers the union of all member types automatically.
|
|
527
|
-
*/
|
|
528
|
-
union: (schemas, defaultVal) => new Union(schemas, defaultVal),
|
|
554
|
+
enum: oneOf,
|
|
555
|
+
union: unionOf,
|
|
529
556
|
/**
|
|
530
557
|
* Discriminated union — reads `raw[key]`, finds the member schema whose
|
|
531
558
|
* literal at `key` matches, then delegates sanitize/isValid to that member.
|
|
@@ -533,7 +560,8 @@ var PixodeskAnimator = (() => {
|
|
|
533
560
|
* TypeScript infers the union of all member types automatically.
|
|
534
561
|
*/
|
|
535
562
|
discriminatedUnion: (key, schemas) => new DiscriminatedUnion(key, schemas),
|
|
536
|
-
/** Typed object — unknown keys are stripped. Required fields fall back to their default.
|
|
563
|
+
/** Typed object — unknown keys are stripped. Required fields fall back to their default.
|
|
564
|
+
* Its `defaults` say what each stated field means when a document leaves it out. */
|
|
537
565
|
object: (shape) => new Obj(shape),
|
|
538
566
|
/**
|
|
539
567
|
* Open object — validates known keys; passes unknown keys through as-is,
|
|
@@ -655,8 +683,11 @@ var PixodeskAnimator = (() => {
|
|
|
655
683
|
offScreen: "pause",
|
|
656
684
|
mouseOut: "continue",
|
|
657
685
|
visibilityThreshold: 0.5,
|
|
658
|
-
visibilityDebounce: 150
|
|
686
|
+
visibilityDebounce: 150,
|
|
687
|
+
finish: "hold"
|
|
659
688
|
};
|
|
689
|
+
var PX_DEFAULT_DURATION_MS = 1e3;
|
|
690
|
+
var PX_DEFAULT_ITERATIONS = 1;
|
|
660
691
|
function resolveTrigger(trigger) {
|
|
661
692
|
var _a, _b, _c, _d, _e;
|
|
662
693
|
return {
|
|
@@ -853,15 +884,15 @@ var PixodeskAnimator = (() => {
|
|
|
853
884
|
var keyframeTangentOut = (kf) => anyKf(kf).tangentOut;
|
|
854
885
|
var PxLoopSchema = implementsInterface()(px.object({
|
|
855
886
|
segmentCount: px.number().optional(),
|
|
856
|
-
repeatAt: px.enum([PxLoopRepeatAt.start, PxLoopRepeatAt.end]).optional(),
|
|
857
|
-
direction: px.enum([PxLoopDirection.normal, PxLoopDirection.alternate]).optional()
|
|
887
|
+
repeatAt: px.enum([PxLoopRepeatAt.start, PxLoopRepeatAt.end], PxLoopRepeatAt.end).optional(),
|
|
888
|
+
direction: px.enum([PxLoopDirection.normal, PxLoopDirection.alternate], PxLoopDirection.normal).optional()
|
|
858
889
|
}));
|
|
859
890
|
var PxPropertyAnimationSchema = implementsInterface()(px.object({
|
|
860
891
|
value: PxKeyframeValueSchema.optional(),
|
|
861
892
|
keyframes: px.array(PxKeyframeSchema).optional(),
|
|
862
893
|
loop: px.union([PxLoopSchema, px.boolean()]).optional(),
|
|
863
894
|
autoOrient: px.boolean().optional(),
|
|
864
|
-
alongPathMode: px.enum([PxAlongPathMode.sampled, PxAlongPathMode.offsetPath]).optional()
|
|
895
|
+
alongPathMode: px.enum([PxAlongPathMode.sampled, PxAlongPathMode.offsetPath], PxAlongPathMode.sampled).optional()
|
|
865
896
|
}));
|
|
866
897
|
var PxTransformPartsSchema = implementsInterface()(px.object({
|
|
867
898
|
translate: px.tuple([px.number(), px.number()]).optional(),
|
|
@@ -891,9 +922,9 @@ var PixodeskAnimator = (() => {
|
|
|
891
922
|
// What happens after a NATURAL finish — `'hold'` (default: keep the end state per
|
|
892
923
|
// `fill`) or `'reset'` (snap back to the start state). One of four occasion keys
|
|
893
924
|
// (`start`, `offScreen`, `mouseOut`, `finish`), all named the same way.
|
|
894
|
-
finish: px.enum([PxFinishAction.hold, PxFinishAction.reset]).optional(),
|
|
895
|
-
visibilityThreshold: px.number().optional(),
|
|
896
|
-
visibilityDebounce: px.number().optional()
|
|
925
|
+
finish: px.enum([PxFinishAction.hold, PxFinishAction.reset], PX_TRIGGER_DEFAULTS.finish).optional(),
|
|
926
|
+
visibilityThreshold: px.number(PX_TRIGGER_DEFAULTS.visibilityThreshold).optional(),
|
|
927
|
+
visibilityDebounce: px.number(PX_TRIGGER_DEFAULTS.visibilityDebounce).optional()
|
|
897
928
|
}));
|
|
898
929
|
var PxGlyphSchema = implementsInterface()(px.object({
|
|
899
930
|
width: px.number(),
|
|
@@ -919,7 +950,7 @@ var PixodeskAnimator = (() => {
|
|
|
919
950
|
PxScrollPhase.exit,
|
|
920
951
|
PxScrollPhase.entryCrossing,
|
|
921
952
|
PxScrollPhase.exitCrossing
|
|
922
|
-
]).optional(),
|
|
953
|
+
], PxScrollPhase.cover).optional(),
|
|
923
954
|
fraction: px.number().optional()
|
|
924
955
|
}));
|
|
925
956
|
var PxScrollRangeSchema = px.object({
|
|
@@ -927,37 +958,37 @@ var PixodeskAnimator = (() => {
|
|
|
927
958
|
end: PxScrollRangePointSchema.optional()
|
|
928
959
|
});
|
|
929
960
|
var PxScrollSchema = implementsInterface()(px.object({
|
|
930
|
-
kind: px.enum([PxScrollKind.view, PxScrollKind.scroll]).optional(),
|
|
931
|
-
axis: px.enum([PxScrollAxis.block, PxScrollAxis.inline, PxScrollAxis.x, PxScrollAxis.y]).optional(),
|
|
932
|
-
source: px.enum([PxScrollSource.nearest, PxScrollSource.root]).optional(),
|
|
961
|
+
kind: px.enum([PxScrollKind.view, PxScrollKind.scroll], PxScrollKind.view).optional(),
|
|
962
|
+
axis: px.enum([PxScrollAxis.block, PxScrollAxis.inline, PxScrollAxis.x, PxScrollAxis.y], PxScrollAxis.block).optional(),
|
|
963
|
+
source: px.enum([PxScrollSource.nearest, PxScrollSource.root], PxScrollSource.nearest).optional(),
|
|
933
964
|
// Free-form: the two keywords `parent`/`scroller` plus any CSS selector.
|
|
934
965
|
subject: px.string().optional(),
|
|
935
966
|
smoothing: px.number().optional(),
|
|
936
|
-
pin: px.boolean().optional(),
|
|
937
|
-
pinAlign: px.enum([PxPinAlign.top, PxPinAlign.center, PxPinAlign.bottom]).optional(),
|
|
967
|
+
pin: px.boolean(false).optional(),
|
|
968
|
+
pinAlign: px.enum([PxPinAlign.top, PxPinAlign.center, PxPinAlign.bottom], PxPinAlign.top).optional(),
|
|
938
969
|
pinOffset: px.number().optional(),
|
|
939
970
|
pinDistance: px.number().optional(),
|
|
940
971
|
range: PxScrollRangeSchema.optional()
|
|
941
972
|
}));
|
|
942
973
|
var PxTimelinePinSchema = implementsInterface()(px.object({
|
|
943
|
-
align: px.enum([PxPinAlign.top, PxPinAlign.center, PxPinAlign.bottom]).optional(),
|
|
974
|
+
align: px.enum([PxPinAlign.top, PxPinAlign.center, PxPinAlign.bottom], PxPinAlign.top).optional(),
|
|
944
975
|
offset: px.number().optional(),
|
|
945
976
|
distance: px.number().optional()
|
|
946
977
|
}));
|
|
947
|
-
var PxTimelineEngineSchema = px.enum([PxTimelineEngineSetting.auto, PxTimelineEngineSetting.native, PxTimelineEngineSetting.js]).optional();
|
|
978
|
+
var PxTimelineEngineSchema = px.enum([PxTimelineEngineSetting.auto, PxTimelineEngineSetting.native, PxTimelineEngineSetting.js], PxTimelineEngineSetting.auto).optional();
|
|
948
979
|
var PxTimeTimelineSchema = implementsInterface()(px.object({
|
|
949
980
|
type: px.literal("time").optional(),
|
|
950
981
|
engine: PxTimelineEngineSchema,
|
|
951
982
|
frameRate: px.number().optional(),
|
|
952
983
|
// §2.8: duration is a property of the TIMELINE — how long one pass takes.
|
|
953
|
-
duration: px.number().optional(),
|
|
984
|
+
duration: px.number(PX_DEFAULT_DURATION_MS).optional(),
|
|
954
985
|
trigger: PxTriggerSchema.optional(),
|
|
955
|
-
delay: px.number().optional(),
|
|
956
|
-
iterations: px.union([px.number(), px.literal("infinite")]).optional(),
|
|
986
|
+
delay: px.number(0).optional(),
|
|
987
|
+
iterations: px.union([px.number(PX_DEFAULT_ITERATIONS), px.literal("infinite")], PX_DEFAULT_ITERATIONS).optional(),
|
|
957
988
|
// `fillMode` on the wire (CSS `animation-fill-mode`; the runtime view calls it `fill`)
|
|
958
989
|
// — never `fill`, which is paint everywhere else in the format.
|
|
959
|
-
fillMode: px.enum([PxFillMode.forwards, PxFillMode.backwards, PxFillMode.both, PxFillMode.none]).optional(),
|
|
960
|
-
direction: px.enum([PxPlaybackDirection.normal, PxPlaybackDirection.reverse, PxPlaybackDirection.alternate, PxPlaybackDirection.alternateReverse]).optional()
|
|
990
|
+
fillMode: px.enum([PxFillMode.forwards, PxFillMode.backwards, PxFillMode.both, PxFillMode.none], PxFillMode.forwards).optional(),
|
|
991
|
+
direction: px.enum([PxPlaybackDirection.normal, PxPlaybackDirection.reverse, PxPlaybackDirection.alternate, PxPlaybackDirection.alternateReverse], PxPlaybackDirection.normal).optional()
|
|
961
992
|
}));
|
|
962
993
|
var scrollishTimelineShape = {
|
|
963
994
|
// §2.8: duration is a property of the TIMELINE — under scrubbing it is the keyframe
|
|
@@ -968,8 +999,8 @@ var PixodeskAnimator = (() => {
|
|
|
968
999
|
iterations: px.number().optional(),
|
|
969
1000
|
engine: PxTimelineEngineSchema,
|
|
970
1001
|
frameRate: px.number().optional(),
|
|
971
|
-
axis: px.enum([PxScrollAxis.block, PxScrollAxis.inline, PxScrollAxis.x, PxScrollAxis.y]).optional(),
|
|
972
|
-
source: px.enum([PxScrollSource.nearest, PxScrollSource.root]).optional(),
|
|
1002
|
+
axis: px.enum([PxScrollAxis.block, PxScrollAxis.inline, PxScrollAxis.x, PxScrollAxis.y], PxScrollAxis.block).optional(),
|
|
1003
|
+
source: px.enum([PxScrollSource.nearest, PxScrollSource.root], PxScrollSource.nearest).optional(),
|
|
973
1004
|
subject: px.string().optional(),
|
|
974
1005
|
// 'parent' | 'scroller' | any CSS selector
|
|
975
1006
|
smoothing: px.number().optional(),
|
|
@@ -1049,9 +1080,10 @@ var PixodeskAnimator = (() => {
|
|
|
1049
1080
|
}));
|
|
1050
1081
|
var PxMaskedByEffectSchema = implementsInterface()(px.object({
|
|
1051
1082
|
source: px.string().optional(),
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1083
|
+
// SVG's own initial values — what a <mask> does when the attribute is not there.
|
|
1084
|
+
maskType: px.enum([PxMaskType.luminance, PxMaskType.alpha], PxMaskType.luminance).optional(),
|
|
1085
|
+
maskUnits: px.enum([PxUnits.userSpaceOnUse, PxUnits.objectBoundingBox], PxUnits.objectBoundingBox).optional(),
|
|
1086
|
+
maskContentUnits: px.enum([PxUnits.userSpaceOnUse, PxUnits.objectBoundingBox], PxUnits.userSpaceOnUse).optional(),
|
|
1055
1087
|
x: px.number().optional(),
|
|
1056
1088
|
y: px.number().optional(),
|
|
1057
1089
|
width: px.number().optional(),
|
|
@@ -1063,7 +1095,7 @@ var PixodeskAnimator = (() => {
|
|
|
1063
1095
|
var PxStrokeTrimEffectSchema = implementsInterface()(px.object({
|
|
1064
1096
|
offset: PxAnimatableNumberSchema.optional(),
|
|
1065
1097
|
range: PxAnimatableVec2Schema.optional(),
|
|
1066
|
-
subPaths: px.enum([PxStrokeTrimSubPaths.separate, PxStrokeTrimSubPaths.combined]).optional()
|
|
1098
|
+
subPaths: px.enum([PxStrokeTrimSubPaths.separate, PxStrokeTrimSubPaths.combined], PxStrokeTrimSubPaths.separate).optional()
|
|
1067
1099
|
}));
|
|
1068
1100
|
var PxRetimeEffectSchema = implementsInterface()(px.object({
|
|
1069
1101
|
start: px.number().optional(),
|
|
@@ -1095,17 +1127,20 @@ var PixodeskAnimator = (() => {
|
|
|
1095
1127
|
radius: PxAnimatableNumberSchema.optional(),
|
|
1096
1128
|
focal: PxAnimatableVec2Schema.optional(),
|
|
1097
1129
|
stops: PxAnimatableGradientStopsSchema.optional(),
|
|
1098
|
-
|
|
1099
|
-
|
|
1130
|
+
// SVG's own initial values — what a gradient does when the attribute is not there.
|
|
1131
|
+
gradientUnits: px.enum([PxUnits.userSpaceOnUse, PxUnits.objectBoundingBox], PxUnits.objectBoundingBox).optional(),
|
|
1132
|
+
spreadMethod: px.enum([PxGradientSpreadMethod.pad, PxGradientSpreadMethod.reflect, PxGradientSpreadMethod.repeat], PxGradientSpreadMethod.pad).optional(),
|
|
1100
1133
|
gradientTransform: px.string().optional()
|
|
1101
1134
|
}));
|
|
1102
1135
|
var PxStrokeGradientEffectSchema = PxFillGradientEffectSchema;
|
|
1103
1136
|
var PxTextPathEffectSchema = implementsInterface()(px.object({
|
|
1104
1137
|
pathData: px.string(),
|
|
1105
|
-
pathOverflow
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1138
|
+
// `extend` is what an omitted pathOverflow means (glyphs continue along the tangent); the
|
|
1139
|
+
// other three are SVG's own initial values for the native <textPath> attributes.
|
|
1140
|
+
pathOverflow: px.enum([PxPathOverflow.clip, PxPathOverflow.extend], PxPathOverflow.extend).optional(),
|
|
1141
|
+
lengthAdjust: px.enum([PxLengthAdjust.spacing, PxLengthAdjust.spacingAndGlyphs], PxLengthAdjust.spacing).optional(),
|
|
1142
|
+
method: px.enum([PxTextPathMethod.align, PxTextPathMethod.stretch], PxTextPathMethod.align).optional(),
|
|
1143
|
+
spacing: px.enum([PxTextPathSpacing.auto, PxTextPathSpacing.exact], PxTextPathSpacing.exact).optional(),
|
|
1109
1144
|
startOffset: PxAnimatableNumberSchema.optional(),
|
|
1110
1145
|
textLength: PxAnimatableNumberSchema.optional()
|
|
1111
1146
|
}));
|
|
@@ -1465,7 +1500,6 @@ var PixodeskAnimator = (() => {
|
|
|
1465
1500
|
return Object.keys(out).length ? out : void 0;
|
|
1466
1501
|
}
|
|
1467
1502
|
var PX_STYLE_ATTR_NAMES = /* @__PURE__ */ new Set(["offset-distance", "offsetDistance"]);
|
|
1468
|
-
var PX_DEFAULT_DURATION_MS = 1e3;
|
|
1469
1503
|
function kebabToCamelCaseWord(kebab) {
|
|
1470
1504
|
return kebab.includes("-") ? kebab.replace(/-([a-z])/g, (_, letter) => letter.toUpperCase()) : kebab;
|
|
1471
1505
|
}
|
|
@@ -2687,13 +2721,13 @@ var PixodeskAnimator = (() => {
|
|
|
2687
2721
|
const bindings = normalizeBindings(doc, PxTimelineEngine.js);
|
|
2688
2722
|
const _iterations = config.iterations;
|
|
2689
2723
|
let iterations = 1;
|
|
2690
|
-
if (typeof _iterations === "number") iterations = _iterations ||
|
|
2724
|
+
if (typeof _iterations === "number") iterations = _iterations || PX_DEFAULT_ITERATIONS;
|
|
2691
2725
|
if (_iterations === "infinite") iterations = Infinity;
|
|
2692
2726
|
if (iterations < 1) iterations = 1;
|
|
2693
2727
|
const duration = +(config.duration || PX_DEFAULT_DURATION_MS);
|
|
2694
|
-
const totalDuration = duration && iterations ? duration * (iterations === Infinity ? Infinity : iterations) : duration ? (iterations != null ? iterations :
|
|
2695
|
-
const direction = config.direction ||
|
|
2696
|
-
const fill = (_a = config.fill) != null ? _a :
|
|
2728
|
+
const totalDuration = duration && iterations ? duration * (iterations === Infinity ? Infinity : iterations) : duration ? (iterations != null ? iterations : PX_DEFAULT_ITERATIONS) * duration : 0;
|
|
2729
|
+
const direction = config.direction || PxTimeTimelineSchema.defaults.direction;
|
|
2730
|
+
const fill = (_a = config.fill) != null ? _a : PxTimeTimelineSchema.defaults.fillMode;
|
|
2697
2731
|
const fillsForwards = fill === "forwards" || fill === "both";
|
|
2698
2732
|
const fillsBackwards = fill === "backwards" || fill === "both";
|
|
2699
2733
|
let timerId = null;
|
|
@@ -3584,7 +3618,7 @@ var PixodeskAnimator = (() => {
|
|
|
3584
3618
|
let seekPosition;
|
|
3585
3619
|
if (config.delay && config.delay < 0 && config.duration) {
|
|
3586
3620
|
const rawSeek = -config.delay;
|
|
3587
|
-
seekPosition = iterations === Infinity ? rawSeek % config.duration : Math.min(rawSeek, config.duration * (iterations != null ? iterations :
|
|
3621
|
+
seekPosition = iterations === Infinity ? rawSeek % config.duration : Math.min(rawSeek, config.duration * (iterations != null ? iterations : PX_DEFAULT_ITERATIONS));
|
|
3588
3622
|
}
|
|
3589
3623
|
const effectOptions = {
|
|
3590
3624
|
duration: config.duration,
|
|
@@ -3691,7 +3725,7 @@ var PixodeskAnimator = (() => {
|
|
|
3691
3725
|
},
|
|
3692
3726
|
"setCurrentTime": (time) => {
|
|
3693
3727
|
var _a2;
|
|
3694
|
-
const ceiling = seekCeilingMs((_a2 = config.duration) != null ? _a2 : 0, iterations != null ? iterations :
|
|
3728
|
+
const ceiling = seekCeilingMs((_a2 = config.duration) != null ? _a2 : 0, iterations != null ? iterations : PX_DEFAULT_ITERATIONS);
|
|
3695
3729
|
const seek = ceiling > 0 ? clampSeekMs(time, ceiling) : Math.max(0, time);
|
|
3696
3730
|
finishNotified = false;
|
|
3697
3731
|
animations.forEach((a) => {
|
|
@@ -3701,11 +3735,11 @@ var PixodeskAnimator = (() => {
|
|
|
3701
3735
|
"getCurrentProgress": () => {
|
|
3702
3736
|
var _a2;
|
|
3703
3737
|
const t = api.getCurrentTime();
|
|
3704
|
-
return t === null ? null : timeToProgress(t, (_a2 = config.duration) != null ? _a2 : 0, iterations != null ? iterations :
|
|
3738
|
+
return t === null ? null : timeToProgress(t, (_a2 = config.duration) != null ? _a2 : 0, iterations != null ? iterations : PX_DEFAULT_ITERATIONS);
|
|
3705
3739
|
},
|
|
3706
3740
|
"setCurrentProgress": (progress) => {
|
|
3707
3741
|
var _a2;
|
|
3708
|
-
api.setCurrentTime(progressToTimeMs(progress, (_a2 = config.duration) != null ? _a2 : 0, iterations != null ? iterations :
|
|
3742
|
+
api.setCurrentTime(progressToTimeMs(progress, (_a2 = config.duration) != null ? _a2 : 0, iterations != null ? iterations : PX_DEFAULT_ITERATIONS));
|
|
3709
3743
|
},
|
|
3710
3744
|
"destroy": () => {
|
|
3711
3745
|
var _a2;
|