@pixodesk/svg-animator-web 1.0.16 → 1.0.18
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/README.md +27 -0
- package/dist/index.cjs +831 -92
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +275 -64
- package/dist/index.d.ts +275 -64
- package/dist/index.js +825 -91
- package/dist/index.js.map +1 -1
- package/dist/index.min.cjs +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.umd.js +825 -91
- package/dist/index.umd.js.map +1 -1
- package/dist/index.umd.min.js +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -547,6 +547,38 @@ declare const PxTriggerSchema: PxSchema<{} & {
|
|
|
547
547
|
};
|
|
548
548
|
/** Defines when and how an animation should be triggered. */
|
|
549
549
|
type PxTrigger = PxInfer<typeof PxTriggerSchema>;
|
|
550
|
+
declare const PxGlyphSchema: PxSchema<{
|
|
551
|
+
width: number;
|
|
552
|
+
d: string;
|
|
553
|
+
} & {}, false> & {
|
|
554
|
+
readonly _shape: {
|
|
555
|
+
width: PxSchema<number, false>;
|
|
556
|
+
d: PxSchema<string, false>;
|
|
557
|
+
};
|
|
558
|
+
};
|
|
559
|
+
type PxGlyph = PxInfer<typeof PxGlyphSchema>;
|
|
560
|
+
declare const PxGlyphFontSchema: PxSchema<{
|
|
561
|
+
fFamily: string;
|
|
562
|
+
style: string;
|
|
563
|
+
ascent: number;
|
|
564
|
+
unitsPerEm: number;
|
|
565
|
+
glyphs: Record<string, {
|
|
566
|
+
width: number;
|
|
567
|
+
d: string;
|
|
568
|
+
} & {}>;
|
|
569
|
+
} & {}, false> & {
|
|
570
|
+
readonly _shape: {
|
|
571
|
+
fFamily: PxSchema<string, false>;
|
|
572
|
+
style: PxSchema<string, false>;
|
|
573
|
+
ascent: PxSchema<number, false>;
|
|
574
|
+
unitsPerEm: PxSchema<number, false>;
|
|
575
|
+
glyphs: PxSchema<Record<string, {
|
|
576
|
+
width: number;
|
|
577
|
+
d: string;
|
|
578
|
+
} & {}>, false>;
|
|
579
|
+
};
|
|
580
|
+
};
|
|
581
|
+
type PxGlyphFont = PxInfer<typeof PxGlyphFontSchema>;
|
|
550
582
|
declare const PxDefsSchema: PxSchema<{} & {
|
|
551
583
|
easings?: Record<string, [number, number, number, number]> | undefined;
|
|
552
584
|
animations?: Record<string, Record<string, {} & {
|
|
@@ -584,6 +616,16 @@ declare const PxDefsSchema: PxSchema<{} & {
|
|
|
584
616
|
autoOrient?: boolean | undefined;
|
|
585
617
|
}>> | undefined;
|
|
586
618
|
styles?: Record<string, any> | undefined;
|
|
619
|
+
glyphs?: Record<string, {
|
|
620
|
+
fFamily: string;
|
|
621
|
+
style: string;
|
|
622
|
+
ascent: number;
|
|
623
|
+
unitsPerEm: number;
|
|
624
|
+
glyphs: Record<string, {
|
|
625
|
+
width: number;
|
|
626
|
+
d: string;
|
|
627
|
+
} & {}>;
|
|
628
|
+
} & {}> | undefined;
|
|
587
629
|
}, false> & {
|
|
588
630
|
readonly _shape: {
|
|
589
631
|
easings: PxSchema<Record<string, [number, number, number, number]> | undefined, true>;
|
|
@@ -622,6 +664,16 @@ declare const PxDefsSchema: PxSchema<{} & {
|
|
|
622
664
|
autoOrient?: boolean | undefined;
|
|
623
665
|
}>> | undefined, true>;
|
|
624
666
|
styles: PxSchema<Record<string, any> | undefined, true>;
|
|
667
|
+
glyphs: PxSchema<Record<string, {
|
|
668
|
+
fFamily: string;
|
|
669
|
+
style: string;
|
|
670
|
+
ascent: number;
|
|
671
|
+
unitsPerEm: number;
|
|
672
|
+
glyphs: Record<string, {
|
|
673
|
+
width: number;
|
|
674
|
+
d: string;
|
|
675
|
+
} & {}>;
|
|
676
|
+
} & {}> | undefined, true>;
|
|
625
677
|
};
|
|
626
678
|
};
|
|
627
679
|
/** Reusable definitions library for easings, animations, and styles. */
|
|
@@ -676,6 +728,16 @@ declare const PxAnimatorConfigSchema: PxSchema<{} & {
|
|
|
676
728
|
autoOrient?: boolean | undefined;
|
|
677
729
|
}>> | undefined;
|
|
678
730
|
styles?: Record<string, any> | undefined;
|
|
731
|
+
glyphs?: Record<string, {
|
|
732
|
+
fFamily: string;
|
|
733
|
+
style: string;
|
|
734
|
+
ascent: number;
|
|
735
|
+
unitsPerEm: number;
|
|
736
|
+
glyphs: Record<string, {
|
|
737
|
+
width: number;
|
|
738
|
+
d: string;
|
|
739
|
+
} & {}>;
|
|
740
|
+
} & {}> | undefined;
|
|
679
741
|
}) | undefined;
|
|
680
742
|
animate?: Record<string, string | Record<string, {} & {
|
|
681
743
|
keyframes?: ({} & {
|
|
@@ -797,6 +859,16 @@ declare const PxAnimatorConfigSchema: PxSchema<{} & {
|
|
|
797
859
|
autoOrient?: boolean | undefined;
|
|
798
860
|
}>> | undefined;
|
|
799
861
|
styles?: Record<string, any> | undefined;
|
|
862
|
+
glyphs?: Record<string, {
|
|
863
|
+
fFamily: string;
|
|
864
|
+
style: string;
|
|
865
|
+
ascent: number;
|
|
866
|
+
unitsPerEm: number;
|
|
867
|
+
glyphs: Record<string, {
|
|
868
|
+
width: number;
|
|
869
|
+
d: string;
|
|
870
|
+
} & {}>;
|
|
871
|
+
} & {}> | undefined;
|
|
800
872
|
}) | undefined, true>;
|
|
801
873
|
animate: PxSchema<Record<string, string | Record<string, {} & {
|
|
802
874
|
keyframes?: ({} & {
|
|
@@ -1559,16 +1631,28 @@ declare const PxRetimeEffectSchema: PxSchema<{} & {
|
|
|
1559
1631
|
};
|
|
1560
1632
|
};
|
|
1561
1633
|
type PxRetimeEffect = PxInfer<typeof PxRetimeEffectSchema>;
|
|
1562
|
-
declare const
|
|
1563
|
-
baseId?: string | undefined;
|
|
1634
|
+
declare const PxCloneEffectSchema: PxSchema<{} & {
|
|
1564
1635
|
type?: string | undefined;
|
|
1636
|
+
baseId?: string | undefined;
|
|
1637
|
+
retime?: ({} & {
|
|
1638
|
+
baseId?: string | undefined;
|
|
1639
|
+
start?: number | undefined;
|
|
1640
|
+
stretch?: number | undefined;
|
|
1641
|
+
timeCrop?: [number, number] | undefined;
|
|
1642
|
+
}) | undefined;
|
|
1565
1643
|
}, false> & {
|
|
1566
1644
|
readonly _shape: {
|
|
1567
|
-
baseId: PxSchema<string | undefined, true>;
|
|
1568
1645
|
type: PxSchema<string | undefined, true>;
|
|
1646
|
+
baseId: PxSchema<string | undefined, true>;
|
|
1647
|
+
retime: PxSchema<({} & {
|
|
1648
|
+
baseId?: string | undefined;
|
|
1649
|
+
start?: number | undefined;
|
|
1650
|
+
stretch?: number | undefined;
|
|
1651
|
+
timeCrop?: [number, number] | undefined;
|
|
1652
|
+
}) | undefined, true>;
|
|
1569
1653
|
};
|
|
1570
1654
|
};
|
|
1571
|
-
type
|
|
1655
|
+
type PxCloneEffect = PxInfer<typeof PxCloneEffectSchema>;
|
|
1572
1656
|
/** Loose enums for `gradientUnits` / `spreadMethod` — kept on the wire as
|
|
1573
1657
|
* plain strings (matches the rest of the schema's loose-enum stance) but
|
|
1574
1658
|
* collected here so call sites use named constants instead of bare literals. */
|
|
@@ -1831,6 +1915,13 @@ declare const PxTextAlongPathEffectSchema: PxSchema<{
|
|
|
1831
1915
|
};
|
|
1832
1916
|
};
|
|
1833
1917
|
type PxTextAlongPathEffect = PxInfer<typeof PxTextAlongPathEffectSchema>;
|
|
1918
|
+
declare const PxTextEffectSchema: PxSchema<{} & {
|
|
1919
|
+
useGlyphs?: boolean | undefined;
|
|
1920
|
+
}, false> & {
|
|
1921
|
+
readonly _shape: {
|
|
1922
|
+
useGlyphs: PxSchema<boolean | undefined, true>;
|
|
1923
|
+
};
|
|
1924
|
+
};
|
|
1834
1925
|
declare const PxEffectsSchema: PxSchema<{} & {
|
|
1835
1926
|
transformation?: ({} & {
|
|
1836
1927
|
translate?: [number, number] | ({
|
|
@@ -2055,17 +2146,17 @@ declare const PxEffectsSchema: PxSchema<{} & {
|
|
|
2055
2146
|
}) | undefined;
|
|
2056
2147
|
trimAllAsOne?: boolean | undefined;
|
|
2057
2148
|
}) | undefined;
|
|
2058
|
-
|
|
2149
|
+
clone?: ({} & {
|
|
2150
|
+
type?: string | undefined;
|
|
2059
2151
|
baseId?: string | undefined;
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2152
|
+
retime?: ({} & {
|
|
2153
|
+
baseId?: string | undefined;
|
|
2154
|
+
start?: number | undefined;
|
|
2155
|
+
stretch?: number | undefined;
|
|
2156
|
+
timeCrop?: [number, number] | undefined;
|
|
2157
|
+
}) | undefined;
|
|
2063
2158
|
}) | undefined;
|
|
2064
2159
|
isCombinedShape?: boolean | undefined;
|
|
2065
|
-
ref?: ({} & {
|
|
2066
|
-
baseId?: string | undefined;
|
|
2067
|
-
type?: string | undefined;
|
|
2068
|
-
}) | undefined;
|
|
2069
2160
|
fillGradient?: ({
|
|
2070
2161
|
type: "linear" | "radial";
|
|
2071
2162
|
} & {
|
|
@@ -2181,6 +2272,9 @@ declare const PxEffectsSchema: PxSchema<{} & {
|
|
|
2181
2272
|
autoOrient?: boolean | undefined;
|
|
2182
2273
|
}) | undefined;
|
|
2183
2274
|
}) | undefined;
|
|
2275
|
+
text?: ({} & {
|
|
2276
|
+
useGlyphs?: boolean | undefined;
|
|
2277
|
+
}) | undefined;
|
|
2184
2278
|
}, false> & {
|
|
2185
2279
|
readonly _shape: {
|
|
2186
2280
|
transformation: PxSchema<({} & {
|
|
@@ -2406,17 +2500,17 @@ declare const PxEffectsSchema: PxSchema<{} & {
|
|
|
2406
2500
|
}) | undefined;
|
|
2407
2501
|
trimAllAsOne?: boolean | undefined;
|
|
2408
2502
|
}) | undefined, true>;
|
|
2409
|
-
|
|
2503
|
+
clone: PxSchema<({} & {
|
|
2504
|
+
type?: string | undefined;
|
|
2410
2505
|
baseId?: string | undefined;
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
2506
|
+
retime?: ({} & {
|
|
2507
|
+
baseId?: string | undefined;
|
|
2508
|
+
start?: number | undefined;
|
|
2509
|
+
stretch?: number | undefined;
|
|
2510
|
+
timeCrop?: [number, number] | undefined;
|
|
2511
|
+
}) | undefined;
|
|
2414
2512
|
}) | undefined, true>;
|
|
2415
2513
|
isCombinedShape: PxSchema<boolean | undefined, true>;
|
|
2416
|
-
ref: PxSchema<({} & {
|
|
2417
|
-
baseId?: string | undefined;
|
|
2418
|
-
type?: string | undefined;
|
|
2419
|
-
}) | undefined, true>;
|
|
2420
2514
|
fillGradient: PxSchema<({
|
|
2421
2515
|
type: "linear" | "radial";
|
|
2422
2516
|
} & {
|
|
@@ -2532,6 +2626,9 @@ declare const PxEffectsSchema: PxSchema<{} & {
|
|
|
2532
2626
|
autoOrient?: boolean | undefined;
|
|
2533
2627
|
}) | undefined;
|
|
2534
2628
|
}) | undefined, true>;
|
|
2629
|
+
text: PxSchema<({} & {
|
|
2630
|
+
useGlyphs?: boolean | undefined;
|
|
2631
|
+
}) | undefined, true>;
|
|
2535
2632
|
};
|
|
2536
2633
|
};
|
|
2537
2634
|
type PxEffects = PxInfer<typeof PxEffectsSchema>;
|
|
@@ -2782,17 +2879,17 @@ declare const PxNodeBase: PxSchema<{
|
|
|
2782
2879
|
}) | undefined;
|
|
2783
2880
|
trimAllAsOne?: boolean | undefined;
|
|
2784
2881
|
}) | undefined;
|
|
2785
|
-
|
|
2882
|
+
clone?: ({} & {
|
|
2883
|
+
type?: string | undefined;
|
|
2786
2884
|
baseId?: string | undefined;
|
|
2787
|
-
|
|
2788
|
-
|
|
2789
|
-
|
|
2885
|
+
retime?: ({} & {
|
|
2886
|
+
baseId?: string | undefined;
|
|
2887
|
+
start?: number | undefined;
|
|
2888
|
+
stretch?: number | undefined;
|
|
2889
|
+
timeCrop?: [number, number] | undefined;
|
|
2890
|
+
}) | undefined;
|
|
2790
2891
|
}) | undefined;
|
|
2791
2892
|
isCombinedShape?: boolean | undefined;
|
|
2792
|
-
ref?: ({} & {
|
|
2793
|
-
baseId?: string | undefined;
|
|
2794
|
-
type?: string | undefined;
|
|
2795
|
-
}) | undefined;
|
|
2796
2893
|
fillGradient?: ({
|
|
2797
2894
|
type: "linear" | "radial";
|
|
2798
2895
|
} & {
|
|
@@ -2908,6 +3005,9 @@ declare const PxNodeBase: PxSchema<{
|
|
|
2908
3005
|
autoOrient?: boolean | undefined;
|
|
2909
3006
|
}) | undefined;
|
|
2910
3007
|
}) | undefined;
|
|
3008
|
+
text?: ({} & {
|
|
3009
|
+
useGlyphs?: boolean | undefined;
|
|
3010
|
+
}) | undefined;
|
|
2911
3011
|
}) | undefined;
|
|
2912
3012
|
animate?: string | Record<string, {} & {
|
|
2913
3013
|
keyframes?: ({} & {
|
|
@@ -3208,17 +3308,17 @@ declare const PxNodeBase: PxSchema<{
|
|
|
3208
3308
|
}) | undefined;
|
|
3209
3309
|
trimAllAsOne?: boolean | undefined;
|
|
3210
3310
|
}) | undefined;
|
|
3211
|
-
|
|
3311
|
+
clone?: ({} & {
|
|
3312
|
+
type?: string | undefined;
|
|
3212
3313
|
baseId?: string | undefined;
|
|
3213
|
-
|
|
3214
|
-
|
|
3215
|
-
|
|
3314
|
+
retime?: ({} & {
|
|
3315
|
+
baseId?: string | undefined;
|
|
3316
|
+
start?: number | undefined;
|
|
3317
|
+
stretch?: number | undefined;
|
|
3318
|
+
timeCrop?: [number, number] | undefined;
|
|
3319
|
+
}) | undefined;
|
|
3216
3320
|
}) | undefined;
|
|
3217
3321
|
isCombinedShape?: boolean | undefined;
|
|
3218
|
-
ref?: ({} & {
|
|
3219
|
-
baseId?: string | undefined;
|
|
3220
|
-
type?: string | undefined;
|
|
3221
|
-
}) | undefined;
|
|
3222
3322
|
fillGradient?: ({
|
|
3223
3323
|
type: "linear" | "radial";
|
|
3224
3324
|
} & {
|
|
@@ -3334,6 +3434,9 @@ declare const PxNodeBase: PxSchema<{
|
|
|
3334
3434
|
autoOrient?: boolean | undefined;
|
|
3335
3435
|
}) | undefined;
|
|
3336
3436
|
}) | undefined;
|
|
3437
|
+
text?: ({} & {
|
|
3438
|
+
useGlyphs?: boolean | undefined;
|
|
3439
|
+
}) | undefined;
|
|
3337
3440
|
}) | undefined, true>;
|
|
3338
3441
|
animate: PxSchema<string | Record<string, {} & {
|
|
3339
3442
|
keyframes?: ({} & {
|
|
@@ -3477,6 +3580,16 @@ declare const PxSvgNodeExtra: PxSchema<{} & {
|
|
|
3477
3580
|
autoOrient?: boolean | undefined;
|
|
3478
3581
|
}>> | undefined;
|
|
3479
3582
|
styles?: Record<string, any> | undefined;
|
|
3583
|
+
glyphs?: Record<string, {
|
|
3584
|
+
fFamily: string;
|
|
3585
|
+
style: string;
|
|
3586
|
+
ascent: number;
|
|
3587
|
+
unitsPerEm: number;
|
|
3588
|
+
glyphs: Record<string, {
|
|
3589
|
+
width: number;
|
|
3590
|
+
d: string;
|
|
3591
|
+
} & {}>;
|
|
3592
|
+
} & {}> | undefined;
|
|
3480
3593
|
}) | undefined;
|
|
3481
3594
|
animate?: Record<string, string | Record<string, {} & {
|
|
3482
3595
|
keyframes?: ({} & {
|
|
@@ -3603,6 +3716,16 @@ declare const PxSvgNodeExtra: PxSchema<{} & {
|
|
|
3603
3716
|
autoOrient?: boolean | undefined;
|
|
3604
3717
|
}>> | undefined;
|
|
3605
3718
|
styles?: Record<string, any> | undefined;
|
|
3719
|
+
glyphs?: Record<string, {
|
|
3720
|
+
fFamily: string;
|
|
3721
|
+
style: string;
|
|
3722
|
+
ascent: number;
|
|
3723
|
+
unitsPerEm: number;
|
|
3724
|
+
glyphs: Record<string, {
|
|
3725
|
+
width: number;
|
|
3726
|
+
d: string;
|
|
3727
|
+
} & {}>;
|
|
3728
|
+
} & {}> | undefined;
|
|
3606
3729
|
}) | undefined;
|
|
3607
3730
|
animate?: Record<string, string | Record<string, {} & {
|
|
3608
3731
|
keyframes?: ({} & {
|
|
@@ -3748,6 +3871,16 @@ declare const PxAnimatedSvgDocumentSchema: PxSchema<{
|
|
|
3748
3871
|
autoOrient?: boolean | undefined;
|
|
3749
3872
|
}>> | undefined;
|
|
3750
3873
|
styles?: Record<string, any> | undefined;
|
|
3874
|
+
glyphs?: Record<string, {
|
|
3875
|
+
fFamily: string;
|
|
3876
|
+
style: string;
|
|
3877
|
+
ascent: number;
|
|
3878
|
+
unitsPerEm: number;
|
|
3879
|
+
glyphs: Record<string, {
|
|
3880
|
+
width: number;
|
|
3881
|
+
d: string;
|
|
3882
|
+
} & {}>;
|
|
3883
|
+
} & {}> | undefined;
|
|
3751
3884
|
}) | undefined;
|
|
3752
3885
|
animate?: Record<string, string | Record<string, {} & {
|
|
3753
3886
|
keyframes?: ({} & {
|
|
@@ -4045,17 +4178,17 @@ declare const PxAnimatedSvgDocumentSchema: PxSchema<{
|
|
|
4045
4178
|
}) | undefined;
|
|
4046
4179
|
trimAllAsOne?: boolean | undefined;
|
|
4047
4180
|
}) | undefined;
|
|
4048
|
-
|
|
4181
|
+
clone?: ({} & {
|
|
4182
|
+
type?: string | undefined;
|
|
4049
4183
|
baseId?: string | undefined;
|
|
4050
|
-
|
|
4051
|
-
|
|
4052
|
-
|
|
4184
|
+
retime?: ({} & {
|
|
4185
|
+
baseId?: string | undefined;
|
|
4186
|
+
start?: number | undefined;
|
|
4187
|
+
stretch?: number | undefined;
|
|
4188
|
+
timeCrop?: [number, number] | undefined;
|
|
4189
|
+
}) | undefined;
|
|
4053
4190
|
}) | undefined;
|
|
4054
4191
|
isCombinedShape?: boolean | undefined;
|
|
4055
|
-
ref?: ({} & {
|
|
4056
|
-
baseId?: string | undefined;
|
|
4057
|
-
type?: string | undefined;
|
|
4058
|
-
}) | undefined;
|
|
4059
4192
|
fillGradient?: ({
|
|
4060
4193
|
type: "linear" | "radial";
|
|
4061
4194
|
} & {
|
|
@@ -4171,6 +4304,9 @@ declare const PxAnimatedSvgDocumentSchema: PxSchema<{
|
|
|
4171
4304
|
autoOrient?: boolean | undefined;
|
|
4172
4305
|
}) | undefined;
|
|
4173
4306
|
}) | undefined;
|
|
4307
|
+
text?: ({} & {
|
|
4308
|
+
useGlyphs?: boolean | undefined;
|
|
4309
|
+
}) | undefined;
|
|
4174
4310
|
}) | undefined;
|
|
4175
4311
|
animate?: string | Record<string, {} & {
|
|
4176
4312
|
keyframes?: ({} & {
|
|
@@ -4299,6 +4435,16 @@ declare const PxAnimatedSvgDocumentSchema: PxSchema<{
|
|
|
4299
4435
|
autoOrient?: boolean | undefined;
|
|
4300
4436
|
}>> | undefined;
|
|
4301
4437
|
styles?: Record<string, any> | undefined;
|
|
4438
|
+
glyphs?: Record<string, {
|
|
4439
|
+
fFamily: string;
|
|
4440
|
+
style: string;
|
|
4441
|
+
ascent: number;
|
|
4442
|
+
unitsPerEm: number;
|
|
4443
|
+
glyphs: Record<string, {
|
|
4444
|
+
width: number;
|
|
4445
|
+
d: string;
|
|
4446
|
+
} & {}>;
|
|
4447
|
+
} & {}> | undefined;
|
|
4302
4448
|
}) | undefined;
|
|
4303
4449
|
animate?: Record<string, string | Record<string, {} & {
|
|
4304
4450
|
keyframes?: ({} & {
|
|
@@ -4596,17 +4742,17 @@ declare const PxAnimatedSvgDocumentSchema: PxSchema<{
|
|
|
4596
4742
|
}) | undefined;
|
|
4597
4743
|
trimAllAsOne?: boolean | undefined;
|
|
4598
4744
|
}) | undefined;
|
|
4599
|
-
|
|
4745
|
+
clone?: ({} & {
|
|
4746
|
+
type?: string | undefined;
|
|
4600
4747
|
baseId?: string | undefined;
|
|
4601
|
-
|
|
4602
|
-
|
|
4603
|
-
|
|
4748
|
+
retime?: ({} & {
|
|
4749
|
+
baseId?: string | undefined;
|
|
4750
|
+
start?: number | undefined;
|
|
4751
|
+
stretch?: number | undefined;
|
|
4752
|
+
timeCrop?: [number, number] | undefined;
|
|
4753
|
+
}) | undefined;
|
|
4604
4754
|
}) | undefined;
|
|
4605
4755
|
isCombinedShape?: boolean | undefined;
|
|
4606
|
-
ref?: ({} & {
|
|
4607
|
-
baseId?: string | undefined;
|
|
4608
|
-
type?: string | undefined;
|
|
4609
|
-
}) | undefined;
|
|
4610
4756
|
fillGradient?: ({
|
|
4611
4757
|
type: "linear" | "radial";
|
|
4612
4758
|
} & {
|
|
@@ -4722,6 +4868,9 @@ declare const PxAnimatedSvgDocumentSchema: PxSchema<{
|
|
|
4722
4868
|
autoOrient?: boolean | undefined;
|
|
4723
4869
|
}) | undefined;
|
|
4724
4870
|
}) | undefined;
|
|
4871
|
+
text?: ({} & {
|
|
4872
|
+
useGlyphs?: boolean | undefined;
|
|
4873
|
+
}) | undefined;
|
|
4725
4874
|
}) | undefined, true>;
|
|
4726
4875
|
animate: PxSchema<string | Record<string, {} & {
|
|
4727
4876
|
keyframes?: ({} & {
|
|
@@ -5102,18 +5251,23 @@ declare function getNormalizedProps(props: Record<string, any>): Record<string,
|
|
|
5102
5251
|
declare function renderNode(node: PxNode, defs?: PxDefs): Element | null;
|
|
5103
5252
|
|
|
5104
5253
|
/**
|
|
5105
|
-
*
|
|
5106
|
-
*
|
|
5107
|
-
*
|
|
5108
|
-
* animation configuration contains properties not supported by the browser's
|
|
5109
|
-
* Web Animations API implementation, unless forceEvenIfHasUnsupportedAttrs is true.
|
|
5254
|
+
* Element-creation factory — abstracts WHAT an "element" is so the same
|
|
5255
|
+
* geometry/layout code (e.g. the glyph text materialiser) can emit plain wire
|
|
5256
|
+
* nodes here, or the editor's React / px elements when called from the editor.
|
|
5110
5257
|
*
|
|
5111
|
-
*
|
|
5112
|
-
*
|
|
5113
|
-
*
|
|
5114
|
-
* @returns An PxAnimatorAPI instance, or null if unsupported features are used and not forced.
|
|
5258
|
+
* The signature intentionally mirrors the editor's `createPxElement(type,
|
|
5259
|
+
* props, children, fixReactKeysIfNeeded?)` so the editor's own factory drops in
|
|
5260
|
+
* unchanged.
|
|
5115
5261
|
*/
|
|
5116
|
-
|
|
5262
|
+
type PxCreateElement<E = any> = (type: string, props: {
|
|
5263
|
+
[k: string]: any;
|
|
5264
|
+
}, children?: Array<E> | E | null, fixReactKeysIfNeeded?: boolean) => E;
|
|
5265
|
+
/**
|
|
5266
|
+
* Default factory → a plain wire node `{ type, ...props, children? }`.
|
|
5267
|
+
* Drops `undefined` props and empty `children` so output matches the shape the
|
|
5268
|
+
* effects pipeline (and `JSON.stringify`) expects.
|
|
5269
|
+
*/
|
|
5270
|
+
declare const jsonElementFactory: PxCreateElement<any>;
|
|
5117
5271
|
|
|
5118
5272
|
/**
|
|
5119
5273
|
* Applier-runtime types: `ApplyContext` (per-run mutable state) and `ApplyResult`
|
|
@@ -5133,6 +5287,63 @@ interface ApplyResult {
|
|
|
5133
5287
|
errors: Array<string>;
|
|
5134
5288
|
}
|
|
5135
5289
|
|
|
5290
|
+
/**
|
|
5291
|
+
* Glyph text materialiser — turns a `<text>`/`<tspan>` subtree into `<path>`
|
|
5292
|
+
* outlines from `definitions.glyphs`, so the text renders with no external font.
|
|
5293
|
+
*
|
|
5294
|
+
* - HORIZONTAL ({@link materialiseGlyphTextHorizontal}) — left-to-right by
|
|
5295
|
+
* advance width; honours font-size, text-anchor, letter/word-spacing,
|
|
5296
|
+
* per-tspan x/y/dx/dy, fill/stroke, nested tspans.
|
|
5297
|
+
* - ALONG-PATH ({@link materialiseGlyphTextAlongPath}) — each glyph placed and
|
|
5298
|
+
* rotated to the referenced path's tangent. Static `startOffset` → glyphs
|
|
5299
|
+
* bake+merge; animated `startOffset` → per-glyph `<path>` with sampled
|
|
5300
|
+
* `animate.transform`. Ignores per-tspan positioning (a single run).
|
|
5301
|
+
*
|
|
5302
|
+
* Element creation goes through an injected {@link PxCreateElement} factory, so
|
|
5303
|
+
* the SAME layout produces plain wire nodes here (the effects pipeline) or the
|
|
5304
|
+
* editor's React/px elements when the editor calls it — see
|
|
5305
|
+
* {@link materialiseGlyphText}.
|
|
5306
|
+
*
|
|
5307
|
+
* v1 scope (see svga.text.design.md): keyframe-interval easing is linear;
|
|
5308
|
+
* kerning/ligatures, per-tspan opacity, text-level animated fill are out of scope.
|
|
5309
|
+
*/
|
|
5310
|
+
|
|
5311
|
+
/** Inputs for a glyph materialisation, decoupled from the effects `ApplyContext`
|
|
5312
|
+
* so the editor can call the materialiser directly. */
|
|
5313
|
+
interface GlyphMaterialiseOpts<E = any> {
|
|
5314
|
+
/** Embedded glyph fonts, keyed by `font-family`. */
|
|
5315
|
+
glyphs: Record<string, PxGlyphFont>;
|
|
5316
|
+
/** Element factory — defaults to plain wire nodes ({@link jsonElementFactory}). */
|
|
5317
|
+
create?: PxCreateElement<E>;
|
|
5318
|
+
/** Optional diagnostics sink. */
|
|
5319
|
+
warnings?: Array<string>;
|
|
5320
|
+
}
|
|
5321
|
+
declare function materialiseGlyphTextHorizontal<E = any>(node: PxNode, opts: GlyphMaterialiseOpts<E>): E;
|
|
5322
|
+
declare function materialiseGlyphTextAlongPath<E = any>(node: PxNode, pathD: string | undefined, startOffset: PxAnimatable<number> | undefined, opts: GlyphMaterialiseOpts<E>, textLength?: number): E | null;
|
|
5323
|
+
/** Single entry the EDITOR calls: materialises a glyph `<text>` node into the
|
|
5324
|
+
* factory's element type, choosing along-path when `alongPath` is given. */
|
|
5325
|
+
declare function materialiseGlyphText<E = any>(node: PxNode, opts: GlyphMaterialiseOpts<E> & {
|
|
5326
|
+
alongPath?: {
|
|
5327
|
+
pathD?: string;
|
|
5328
|
+
startOffset?: PxAnimatable<number>;
|
|
5329
|
+
textLength?: number;
|
|
5330
|
+
};
|
|
5331
|
+
}): E | null;
|
|
5332
|
+
|
|
5333
|
+
/**
|
|
5334
|
+
* Creates an animator instance that uses the native Web Animations API.
|
|
5335
|
+
*
|
|
5336
|
+
* This is the preferred, more performant animator. It will return null if the
|
|
5337
|
+
* animation configuration contains properties not supported by the browser's
|
|
5338
|
+
* Web Animations API implementation, unless forceEvenIfHasUnsupportedAttrs is true.
|
|
5339
|
+
*
|
|
5340
|
+
* @param callbacks Optional lifecycle callbacks.
|
|
5341
|
+
* @param rootElement Root element.
|
|
5342
|
+
* @param forceEvenIfHasUnsupportedAttrs If true, an animator will be created even if some CSS properties are not supported.
|
|
5343
|
+
* @returns An PxAnimatorAPI instance, or null if unsupported features are used and not forced.
|
|
5344
|
+
*/
|
|
5345
|
+
declare function createWebApiAnimator(doc: PxAnimatedSvgDocument, callbacks?: PxAnimatorCallbacksConfig, rootElement?: Element | null, forceEvenIfHasUnsupportedAttrs?: boolean): PxAnimatorAPI | null;
|
|
5346
|
+
|
|
5136
5347
|
/**
|
|
5137
5348
|
* Applies all player-effects in `root` and returns a materialised copy plus any
|
|
5138
5349
|
* generated <defs> nodes, warnings and errors. `root` is not mutated.
|
|
@@ -5146,7 +5357,7 @@ interface ApplyResult {
|
|
|
5146
5357
|
* Pre-pass identifies every element that is the target of a `<use>` with
|
|
5147
5358
|
* `ref:{type:'content'}` and allocates a fresh "inner" id for it; pass 1 then
|
|
5148
5359
|
* splits those sources into outer-translate + inner-content layers so the use
|
|
5149
|
-
* can target the inner layer
|
|
5360
|
+
* can target the inner layer.
|
|
5150
5361
|
*/
|
|
5151
5362
|
declare function applyPlayerEffects(root: PxNode): ApplyResult;
|
|
5152
5363
|
|
|
@@ -5170,4 +5381,4 @@ interface EffectDiff {
|
|
|
5170
5381
|
*/
|
|
5171
5382
|
declare function diffInEffect(a: VmNode, b: VmNode): Array<EffectDiff>;
|
|
5172
5383
|
|
|
5173
|
-
export { type ApplyResult, COLOUR_ATTR_NAMES, type FillMode, type JsMode, type KeysMatch, type MaterialiseAllOptions, type MotionPathMaterialisationOptions, type MotionPathSample, type OutAction, PX_ANIMATOR_DATA_KEY, PX_ANIM_ATTR_NAME, PX_ANIM_SRC_ATTR_NAME, PX_TRANSFORM_PART_KEYS, type PlaybackDirection, type PxAnimatable, type PxAnimatedSvgDocument, PxAnimatedSvgDocumentSchema, type PxAnimationDefinition, PxAnimationDefinitionSchema, type PxAnimatorAPI, type PxAnimatorCallbacksConfig, type PxAnimatorConfig, PxAnimatorConfigSchema, PxAnimatorEngine, PxAnimatorMode, type PxAnimatorOptions, type PxAttrValue, PxAttrValueSchema, type PxBezierPath, PxBezierPathSchema, type PxBinding, PxBindingSchema, type PxDefs, PxDefsSchema, PxEasingOrRefSchema, type PxEffects, PxEffectsSchema, type PxElementAnimation, PxElementAnimationSchema, type PxFillGradientEffect, PxFillGradientEffectSchema, PxGradientSpreadMethod, type PxGradientStop, PxGradientStopSchema, PxGradientType, PxGradientUnits, type PxInfer, type PxKeyframe, PxKeyframeSchema, PxLoopSchema, type PxMaskedByEffect, PxMaskedByEffectSchema, type PxNode, PxNodeBase, PxNodeSchema, type PxPlatformAdapter, type PxPropertyAnimation, PxPropertyAnimationSchema, type
|
|
5384
|
+
export { type ApplyResult, COLOUR_ATTR_NAMES, type FillMode, type GlyphMaterialiseOpts, type JsMode, type KeysMatch, type MaterialiseAllOptions, type MotionPathMaterialisationOptions, type MotionPathSample, type OutAction, PX_ANIMATOR_DATA_KEY, PX_ANIM_ATTR_NAME, PX_ANIM_SRC_ATTR_NAME, PX_TRANSFORM_PART_KEYS, type PlaybackDirection, type PxAnimatable, type PxAnimatedSvgDocument, PxAnimatedSvgDocumentSchema, type PxAnimationDefinition, PxAnimationDefinitionSchema, type PxAnimatorAPI, type PxAnimatorCallbacksConfig, type PxAnimatorConfig, PxAnimatorConfigSchema, PxAnimatorEngine, PxAnimatorMode, type PxAnimatorOptions, type PxAttrValue, PxAttrValueSchema, type PxBezierPath, PxBezierPathSchema, type PxBinding, PxBindingSchema, type PxCloneEffect, PxCloneEffectSchema, type PxCreateElement, type PxDefs, PxDefsSchema, PxEasingOrRefSchema, type PxEffects, PxEffectsSchema, type PxElementAnimation, PxElementAnimationSchema, type PxFillGradientEffect, PxFillGradientEffectSchema, type PxGlyph, type PxGlyphFont, PxGradientSpreadMethod, type PxGradientStop, PxGradientStopSchema, PxGradientType, PxGradientUnits, type PxInfer, type PxKeyframe, PxKeyframeSchema, PxLoopSchema, type PxMaskedByEffect, PxMaskedByEffectSchema, type PxNode, PxNodeBase, PxNodeSchema, type PxPlatformAdapter, type PxPropertyAnimation, PxPropertyAnimationSchema, type PxRepeaterEffect, PxRepeaterEffectSchema, type PxRetimeEffect, PxRetimeEffectSchema, type PxSchema, type PxSchemaDesc, type PxStrokeGradientEffect, PxStrokeGradientEffectSchema, type PxSvgNode, PxSvgNodeExtra, type PxTextAlongPathEffect, PxTextAlongPathEffectSchema, PxTextEffectSchema, type PxTransformPartKey, type PxTransformParts, PxTransformPartsSchema, type PxTransformValue, PxTransformValueSchema, type PxTransformationEffect, PxTransformationEffectSchema, type PxTrigger, PxTriggerSchema, type PxTrimPathEffect, PxTrimPathEffectSchema, type PxValidationContext, type PxValidationResult, type RemoveIndex, STYLE_ATTR_NAMES, type StartOn, TRANSFORM_FN_NAMES, type Vec2, applyPlayerEffects, calcAnimationValues, camelCaseToKebabWordIfNeeded, collectSampleTimes, createAnimator, createAnimatorImpl, createBasicFrameLoopAnimator, createFrameLoopAnimator, createWebApiAnimator, describeSchema, diffInEffect, evaluateMotionPathSegment, generateNewIds, getAnimatorConfig, getBindings, getChildren, getDefs, getNormalizedProps, isPxElementFileFormat, isPxElementFileFormatDeep, jsonElementFactory, loadTagAnimators, materialiseAllInTree, materialiseAnimatedUseInstances, materialiseGlyphText, materialiseGlyphTextAlongPath, materialiseGlyphTextHorizontal, materialiseInternalLoopsInPropAnim, materialiseInternalLoopsInTree, materialiseMotionPathInPropAnim, materialiseMotionPathsInTree, getNormalisedBindings as normalizeDocument, propAnimIsMotionPath, px, renderNode, schemaKeys, setupAnimationTriggers, toRGBA, validateNodeEffects, visualModelAt };
|