@pixodesk/svg-animator-core 1.0.21 → 1.0.22

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.js CHANGED
@@ -605,6 +605,7 @@ var PxAnimatorConfigSchema = implementsInterface()(px.object({
605
605
  resetOnFinish: px.boolean().optional(),
606
606
  definitions: PxDefsSchema.optional(),
607
607
  animate: px.record(PxElementAnimationSchema).optional(),
608
+ timeline: px.string().optional(),
608
609
  debug: px.boolean().optional(),
609
610
  debugInstName: px.string().optional()
610
611
  }));
@@ -696,6 +697,17 @@ var PxAnimatableGradientStopsSchema = px.union([
696
697
  px.object({ value: px.array(PxGradientStopSchema) }),
697
698
  px.object({ keyframes: px.array(PxKeyframeSchema) })
698
699
  ]);
700
+ var PxGradientGeometryAnimationSchema = implementsInterface()(px.object({
701
+ gradientX1: PxPropertyAnimationSchema.optional(),
702
+ gradientY1: PxPropertyAnimationSchema.optional(),
703
+ gradientX2: PxPropertyAnimationSchema.optional(),
704
+ gradientY2: PxPropertyAnimationSchema.optional(),
705
+ gradientCx: PxPropertyAnimationSchema.optional(),
706
+ gradientCy: PxPropertyAnimationSchema.optional(),
707
+ gradientFx: PxPropertyAnimationSchema.optional(),
708
+ gradientFy: PxPropertyAnimationSchema.optional(),
709
+ gradientR: PxPropertyAnimationSchema.optional()
710
+ }));
699
711
  var PxFillGradientEffectSchema = implementsInterface()(px.object({
700
712
  type: px.enum([PxGradientType.linear, PxGradientType.radial]),
701
713
  p1: px.tuple([px.number(), px.number()]).optional(),
@@ -706,7 +718,8 @@ var PxFillGradientEffectSchema = implementsInterface()(px.object({
706
718
  stops: PxAnimatableGradientStopsSchema.optional(),
707
719
  gradientUnits: px.string().optional(),
708
720
  spreadMethod: px.string().optional(),
709
- gradientTransform: px.string().optional()
721
+ gradientTransform: px.string().optional(),
722
+ animate: PxGradientGeometryAnimationSchema.optional()
710
723
  }));
711
724
  var PxStrokeGradientEffectSchema = PxFillGradientEffectSchema;
712
725
  var PxTextPathEffectSchema = implementsInterface()(px.object({
@@ -2719,17 +2732,34 @@ function partsRecord(part, value, origin) {
2719
2732
  return rec;
2720
2733
  }
2721
2734
  function readAnimatable(raw) {
2735
+ var _a, _b;
2722
2736
  if (raw === void 0) return { kind: "absent" /* Absent */ };
2723
2737
  if (Array.isArray(raw)) return { kind: "static" /* Static */, value: raw };
2724
2738
  if (typeof raw === "object") {
2725
2739
  const obj = raw;
2726
- if (obj.keyframes) {
2727
- return { kind: "animated" /* Animated */, keyframes: obj.keyframes, autoOrient: obj.autoOrient, loop: obj.loop };
2740
+ const kfs = (_a = obj.keyframes) != null ? _a : obj.kfs;
2741
+ if (kfs) {
2742
+ return { kind: "animated" /* Animated */, keyframes: kfs.map(normaliseKeyframe), autoOrient: obj.autoOrient, loop: obj.loop };
2728
2743
  }
2729
- if (obj.value !== void 0) return { kind: "static" /* Static */, value: obj.value };
2744
+ const staticValue = (_b = obj.value) != null ? _b : obj.v;
2745
+ if (staticValue !== void 0) return { kind: "static" /* Static */, value: staticValue };
2730
2746
  }
2731
2747
  return { kind: "static" /* Static */, value: raw };
2732
2748
  }
2749
+ function normaliseKeyframe(kf) {
2750
+ if (!kf || typeof kf !== "object") return kf;
2751
+ const k = kf;
2752
+ if (k.t === void 0 && k.v === void 0 && k.e === void 0 && k.to === void 0 && k.ti === void 0) {
2753
+ return kf;
2754
+ }
2755
+ const out = __spreadValues({}, k);
2756
+ if (out.time === void 0 && k.t !== void 0) out.time = k.t;
2757
+ if (out.value === void 0 && k.v !== void 0) out.value = k.v;
2758
+ if (out.easing === void 0 && k.e !== void 0) out.easing = k.e;
2759
+ if (out.tangentOut === void 0 && k.to !== void 0) out.tangentOut = k.to;
2760
+ if (out.tangentIn === void 0 && k.ti !== void 0) out.tangentIn = k.ti;
2761
+ return out;
2762
+ }
2733
2763
  function readStaticOrigin(raw, ctx) {
2734
2764
  var _a;
2735
2765
  const o = readAnimatable(raw);
@@ -5633,6 +5663,7 @@ export {
5633
5663
  PxEffectsSchema,
5634
5664
  PxElementAnimationSchema,
5635
5665
  PxFillGradientEffectSchema,
5666
+ PxGradientGeometryAnimationSchema,
5636
5667
  PxGradientSpreadMethod,
5637
5668
  PxGradientStopSchema,
5638
5669
  PxGradientType,