@pixodesk/svg-animator-core 1.0.27 → 1.0.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +72 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +57 -1
- package/dist/index.d.ts +57 -1
- package/dist/index.js +71 -10
- package/dist/index.js.map +1 -1
- package/dist/index.min.cjs +1 -1
- package/dist/index.min.js +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1314,6 +1314,12 @@ declare const PxScrollSchema: PxSchema<{} & {
|
|
|
1314
1314
|
kind?: "view" | "scroll" | undefined;
|
|
1315
1315
|
axis?: "x" | "y" | "block" | "inline" | undefined;
|
|
1316
1316
|
source?: "nearest" | "root" | undefined;
|
|
1317
|
+
subject?: string | undefined;
|
|
1318
|
+
smoothing?: number | undefined;
|
|
1319
|
+
pin?: boolean | undefined;
|
|
1320
|
+
pinAlign?: "top" | "center" | "bottom" | undefined;
|
|
1321
|
+
pinTop?: number | undefined;
|
|
1322
|
+
pinDistance?: number | undefined;
|
|
1317
1323
|
range?: ({} & {
|
|
1318
1324
|
start?: ({} & {
|
|
1319
1325
|
phase?: "cover" | "contain" | "entry" | "exit" | "entry-crossing" | "exit-crossing" | undefined;
|
|
@@ -1330,6 +1336,12 @@ declare const PxScrollSchema: PxSchema<{} & {
|
|
|
1330
1336
|
kind: PxSchema<"view" | "scroll" | undefined, true>;
|
|
1331
1337
|
axis: PxSchema<"x" | "y" | "block" | "inline" | undefined, true>;
|
|
1332
1338
|
source: PxSchema<"nearest" | "root" | undefined, true>;
|
|
1339
|
+
subject: PxSchema<string | undefined, true>;
|
|
1340
|
+
smoothing: PxSchema<number | undefined, true>;
|
|
1341
|
+
pin: PxSchema<boolean | undefined, true>;
|
|
1342
|
+
pinAlign: PxSchema<"top" | "center" | "bottom" | undefined, true>;
|
|
1343
|
+
pinTop: PxSchema<number | undefined, true>;
|
|
1344
|
+
pinDistance: PxSchema<number | undefined, true>;
|
|
1333
1345
|
range: PxSchema<({} & {
|
|
1334
1346
|
start?: ({} & {
|
|
1335
1347
|
phase?: "cover" | "contain" | "entry" | "exit" | "entry-crossing" | "exit-crossing" | undefined;
|
|
@@ -1631,6 +1643,12 @@ declare const PxAnimatorConfigSchema: PxSchema<{} & {
|
|
|
1631
1643
|
kind?: "view" | "scroll" | undefined;
|
|
1632
1644
|
axis?: "x" | "y" | "block" | "inline" | undefined;
|
|
1633
1645
|
source?: "nearest" | "root" | undefined;
|
|
1646
|
+
subject?: string | undefined;
|
|
1647
|
+
smoothing?: number | undefined;
|
|
1648
|
+
pin?: boolean | undefined;
|
|
1649
|
+
pinAlign?: "top" | "center" | "bottom" | undefined;
|
|
1650
|
+
pinTop?: number | undefined;
|
|
1651
|
+
pinDistance?: number | undefined;
|
|
1634
1652
|
range?: ({} & {
|
|
1635
1653
|
start?: ({} & {
|
|
1636
1654
|
phase?: "cover" | "contain" | "entry" | "exit" | "entry-crossing" | "exit-crossing" | undefined;
|
|
@@ -1932,6 +1950,12 @@ declare const PxAnimatorConfigSchema: PxSchema<{} & {
|
|
|
1932
1950
|
kind?: "view" | "scroll" | undefined;
|
|
1933
1951
|
axis?: "x" | "y" | "block" | "inline" | undefined;
|
|
1934
1952
|
source?: "nearest" | "root" | undefined;
|
|
1953
|
+
subject?: string | undefined;
|
|
1954
|
+
smoothing?: number | undefined;
|
|
1955
|
+
pin?: boolean | undefined;
|
|
1956
|
+
pinAlign?: "top" | "center" | "bottom" | undefined;
|
|
1957
|
+
pinTop?: number | undefined;
|
|
1958
|
+
pinDistance?: number | undefined;
|
|
1935
1959
|
range?: ({} & {
|
|
1936
1960
|
start?: ({} & {
|
|
1937
1961
|
phase?: "cover" | "contain" | "entry" | "exit" | "entry-crossing" | "exit-crossing" | undefined;
|
|
@@ -17760,6 +17784,12 @@ declare const PxSvgNodeExtra: PxSchema<{} & {
|
|
|
17760
17784
|
kind?: "view" | "scroll" | undefined;
|
|
17761
17785
|
axis?: "x" | "y" | "block" | "inline" | undefined;
|
|
17762
17786
|
source?: "nearest" | "root" | undefined;
|
|
17787
|
+
subject?: string | undefined;
|
|
17788
|
+
smoothing?: number | undefined;
|
|
17789
|
+
pin?: boolean | undefined;
|
|
17790
|
+
pinAlign?: "top" | "center" | "bottom" | undefined;
|
|
17791
|
+
pinTop?: number | undefined;
|
|
17792
|
+
pinDistance?: number | undefined;
|
|
17763
17793
|
range?: ({} & {
|
|
17764
17794
|
start?: ({} & {
|
|
17765
17795
|
phase?: "cover" | "contain" | "entry" | "exit" | "entry-crossing" | "exit-crossing" | undefined;
|
|
@@ -18066,6 +18096,12 @@ declare const PxSvgNodeExtra: PxSchema<{} & {
|
|
|
18066
18096
|
kind?: "view" | "scroll" | undefined;
|
|
18067
18097
|
axis?: "x" | "y" | "block" | "inline" | undefined;
|
|
18068
18098
|
source?: "nearest" | "root" | undefined;
|
|
18099
|
+
subject?: string | undefined;
|
|
18100
|
+
smoothing?: number | undefined;
|
|
18101
|
+
pin?: boolean | undefined;
|
|
18102
|
+
pinAlign?: "top" | "center" | "bottom" | undefined;
|
|
18103
|
+
pinTop?: number | undefined;
|
|
18104
|
+
pinDistance?: number | undefined;
|
|
18069
18105
|
range?: ({} & {
|
|
18070
18106
|
start?: ({} & {
|
|
18071
18107
|
phase?: "cover" | "contain" | "entry" | "exit" | "entry-crossing" | "exit-crossing" | undefined;
|
|
@@ -18391,6 +18427,12 @@ declare const PxAnimatedSvgDocumentSchema: PxSchema<{
|
|
|
18391
18427
|
kind?: "view" | "scroll" | undefined;
|
|
18392
18428
|
axis?: "x" | "y" | "block" | "inline" | undefined;
|
|
18393
18429
|
source?: "nearest" | "root" | undefined;
|
|
18430
|
+
subject?: string | undefined;
|
|
18431
|
+
smoothing?: number | undefined;
|
|
18432
|
+
pin?: boolean | undefined;
|
|
18433
|
+
pinAlign?: "top" | "center" | "bottom" | undefined;
|
|
18434
|
+
pinTop?: number | undefined;
|
|
18435
|
+
pinDistance?: number | undefined;
|
|
18394
18436
|
range?: ({} & {
|
|
18395
18437
|
start?: ({} & {
|
|
18396
18438
|
phase?: "cover" | "contain" | "entry" | "exit" | "entry-crossing" | "exit-crossing" | undefined;
|
|
@@ -21376,6 +21418,12 @@ declare const PxAnimatedSvgDocumentSchema: PxSchema<{
|
|
|
21376
21418
|
kind?: "view" | "scroll" | undefined;
|
|
21377
21419
|
axis?: "x" | "y" | "block" | "inline" | undefined;
|
|
21378
21420
|
source?: "nearest" | "root" | undefined;
|
|
21421
|
+
subject?: string | undefined;
|
|
21422
|
+
smoothing?: number | undefined;
|
|
21423
|
+
pin?: boolean | undefined;
|
|
21424
|
+
pinAlign?: "top" | "center" | "bottom" | undefined;
|
|
21425
|
+
pinTop?: number | undefined;
|
|
21426
|
+
pinDistance?: number | undefined;
|
|
21379
21427
|
range?: ({} & {
|
|
21380
21428
|
start?: ({} & {
|
|
21381
21429
|
phase?: "cover" | "contain" | "entry" | "exit" | "entry-crossing" | "exit-crossing" | undefined;
|
|
@@ -24568,6 +24616,14 @@ interface GlyphMaterialiseOpts<E = any> {
|
|
|
24568
24616
|
/** Optional diagnostics sink. */
|
|
24569
24617
|
warnings?: Array<string>;
|
|
24570
24618
|
}
|
|
24619
|
+
/**
|
|
24620
|
+
* Class stamped on the `<path>` holding the □ placeholders — and ONLY on it: the missing
|
|
24621
|
+
* boxes are emitted separately from the real glyphs so a consumer can style them on their
|
|
24622
|
+
* own. The editor uses it to fade them in with a delay: a freshly typed character is
|
|
24623
|
+
* missing for a few frames until its glyph is fetched asynchronously, and a □ that flashes
|
|
24624
|
+
* for that long reads as a rendering glitch.
|
|
24625
|
+
*/
|
|
24626
|
+
declare const MISSING_GLYPH_CLASS_NAME = "px-missing-glyph";
|
|
24571
24627
|
declare function materialiseGlyphTextHorizontal<E = any>(node: PxNode, opts: GlyphMaterialiseOpts<E>): E;
|
|
24572
24628
|
/** Per-CHARACTER advance box (local, pre-transform coords). `x,y` = the char's baseline start,
|
|
24573
24629
|
* `width` = its advance, `ascent`/`fontSize` size its bbox. */
|
|
@@ -24698,4 +24754,4 @@ interface EffectDiff {
|
|
|
24698
24754
|
*/
|
|
24699
24755
|
declare function diffInEffect(a: VmNode, b: VmNode): Array<EffectDiff>;
|
|
24700
24756
|
|
|
24701
|
-
export { type ApplyResult, COLOUR_ATTR_NAMES, CSS_ONLY_STYLE_PROPS, DEFAULT_DURATION_MS, DISALLOWED_SVG_TAGS_LOWER, type ExtendPathOpts, type ExtendedPath, type FillMode, type GlyphCharBox, type GlyphCharBoxAlongPath, type GlyphMaterialiseOpts, INTERNAL_ATTRS, type JsMode, type KeysMatch, LOOP_JUMP_SHIFT_MS, type MaterialiseAllOptions, type MotionPathMaterialisationOptions, type MotionPathSample, type OutAction, PCT_BASED_ATTR_NAMES, PX_ANIM_ATTR_NAME, PX_ANIM_SRC_ATTR_NAME, PX_TRANSFORM_PART_KEYS, type PathPoint, type PathSampler, type PlaybackDirection, type PxAnimatable, type PxAnimatedSvgDocument, PxAnimatedSvgDocumentSchema, type PxAnimationDefinition, PxAnimationDefinitionSchema, type PxAnimatorAPI, type PxAnimatorCallbacksConfig, type PxAnimatorConfig, PxAnimatorConfigSchema, PxAnimatorEngine, PxAnimatorMode, type PxAttrValue, PxAttrValueSchema, type PxBasicAnimatorAPI, 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, PxKeyframeValueSchema, type PxLoop, PxLoopExtend, PxLoopSchema, type PxMaskedByEffect, PxMaskedByEffectSchema, type PxNode, PxNodeBase, PxNodeSchema, type PxPlatformAdapter, type PxPropertyAnimation, PxPropertyAnimationSchema, type PxRepeaterEffect, PxRepeaterEffectSchema, type PxRetimeEffect, PxRetimeEffectSchema, type PxSchema, type PxSchemaDesc, type PxScroll, type PxScrollPhase, type PxScrollRangePoint, PxScrollRangePointSchema, PxScrollRangeSchema, PxScrollSchema, type PxStrokeGradientEffect, PxStrokeGradientEffectSchema, type PxSvgNode, PxSvgNodeExtra, PxTextEffectSchema, type PxTextPathEffect, PxTextPathEffectSchema, type PxTransformByEffect, PxTransformByEffectSchema, type PxTransformPartKey, type PxTransformParts, PxTransformPartsSchema, type PxTransformValue, PxTransformValueSchema, type PxTrigger, PxTriggerSchema, type PxTrimPathEffect, PxTrimPathEffectSchema, PxTrimSubPaths, type PxValidationContext, type PxValidationResult, type RemoveIndex, STYLE_ATTR_NAMES, type StartOn, TEXT_ATTR, TEXT_CONTENT_ATTR, TRANSFORM_FN_NAMES, type Vec2, applyPlayerEffects, bezierToSvgPath, calcAnimationValues, camelCaseToKebabWordIfNeeded, clamp, collectSampleTimes, composeTransformParts, createBasicFrameLoopAnimator, createPathSampler, cubicBezier, deepClone, describeSchema, diffInEffect, evaluateMotionPathSegment, extendedPathForBrowser, generateNewIds, generateUniqueId, getAnimatorConfig, getBindings, getChildren, getDefs, getNormalisedBindings, getNormalizedProps, interpolateBeziers, interpolateValue, isPxElementFileFormat, isPxElementFileFormatDeep, isScrollTimeline, jsonElementFactory, kebabToCamelCaseWord, layoutGlyphTextChars, materialiseAllInTree, materialiseAnimatedUseInstances, materialiseGlyphText, materialiseGlyphTextAlongPath, materialiseGlyphTextHorizontal, materialiseInternalLoopsInPropAnim, materialiseInternalLoopsInTree, materialiseMotionPathInPropAnim, materialiseMotionPathsInTree, propAnimIsMotionPath, px, resolveStyle, reverseEasing, sanitiseAttributeValue, schemaKeys, scrollOffsetProgress, scrollPhaseInterval, scrollResolveAxis, scrollTotalDurationMs, scrollViewProgress, shiftAnimatable, splitEasing, subdivideCubicBezier, toRGBA, validateNodeEffects, visualModelAt };
|
|
24757
|
+
export { type ApplyResult, COLOUR_ATTR_NAMES, CSS_ONLY_STYLE_PROPS, DEFAULT_DURATION_MS, DISALLOWED_SVG_TAGS_LOWER, type ExtendPathOpts, type ExtendedPath, type FillMode, type GlyphCharBox, type GlyphCharBoxAlongPath, type GlyphMaterialiseOpts, INTERNAL_ATTRS, type JsMode, type KeysMatch, LOOP_JUMP_SHIFT_MS, MISSING_GLYPH_CLASS_NAME, type MaterialiseAllOptions, type MotionPathMaterialisationOptions, type MotionPathSample, type OutAction, PCT_BASED_ATTR_NAMES, PX_ANIM_ATTR_NAME, PX_ANIM_SRC_ATTR_NAME, PX_TRANSFORM_PART_KEYS, type PathPoint, type PathSampler, type PlaybackDirection, type PxAnimatable, type PxAnimatedSvgDocument, PxAnimatedSvgDocumentSchema, type PxAnimationDefinition, PxAnimationDefinitionSchema, type PxAnimatorAPI, type PxAnimatorCallbacksConfig, type PxAnimatorConfig, PxAnimatorConfigSchema, PxAnimatorEngine, PxAnimatorMode, type PxAttrValue, PxAttrValueSchema, type PxBasicAnimatorAPI, 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, PxKeyframeValueSchema, type PxLoop, PxLoopExtend, PxLoopSchema, type PxMaskedByEffect, PxMaskedByEffectSchema, type PxNode, PxNodeBase, PxNodeSchema, type PxPlatformAdapter, type PxPropertyAnimation, PxPropertyAnimationSchema, type PxRepeaterEffect, PxRepeaterEffectSchema, type PxRetimeEffect, PxRetimeEffectSchema, type PxSchema, type PxSchemaDesc, type PxScroll, type PxScrollPhase, type PxScrollRangePoint, PxScrollRangePointSchema, PxScrollRangeSchema, PxScrollSchema, type PxStrokeGradientEffect, PxStrokeGradientEffectSchema, type PxSvgNode, PxSvgNodeExtra, PxTextEffectSchema, type PxTextPathEffect, PxTextPathEffectSchema, type PxTransformByEffect, PxTransformByEffectSchema, type PxTransformPartKey, type PxTransformParts, PxTransformPartsSchema, type PxTransformValue, PxTransformValueSchema, type PxTrigger, PxTriggerSchema, type PxTrimPathEffect, PxTrimPathEffectSchema, PxTrimSubPaths, type PxValidationContext, type PxValidationResult, type RemoveIndex, STYLE_ATTR_NAMES, type StartOn, TEXT_ATTR, TEXT_CONTENT_ATTR, TRANSFORM_FN_NAMES, type Vec2, applyPlayerEffects, bezierToSvgPath, calcAnimationValues, camelCaseToKebabWordIfNeeded, clamp, collectSampleTimes, composeTransformParts, createBasicFrameLoopAnimator, createPathSampler, cubicBezier, deepClone, describeSchema, diffInEffect, evaluateMotionPathSegment, extendedPathForBrowser, generateNewIds, generateUniqueId, getAnimatorConfig, getBindings, getChildren, getDefs, getNormalisedBindings, getNormalizedProps, interpolateBeziers, interpolateValue, isPxElementFileFormat, isPxElementFileFormatDeep, isScrollTimeline, jsonElementFactory, kebabToCamelCaseWord, layoutGlyphTextChars, materialiseAllInTree, materialiseAnimatedUseInstances, materialiseGlyphText, materialiseGlyphTextAlongPath, materialiseGlyphTextHorizontal, materialiseInternalLoopsInPropAnim, materialiseInternalLoopsInTree, materialiseMotionPathInPropAnim, materialiseMotionPathsInTree, propAnimIsMotionPath, px, resolveStyle, reverseEasing, sanitiseAttributeValue, schemaKeys, scrollOffsetProgress, scrollPhaseInterval, scrollResolveAxis, scrollTotalDurationMs, scrollViewProgress, shiftAnimatable, splitEasing, subdivideCubicBezier, toRGBA, validateNodeEffects, visualModelAt };
|
package/dist/index.d.ts
CHANGED
|
@@ -1314,6 +1314,12 @@ declare const PxScrollSchema: PxSchema<{} & {
|
|
|
1314
1314
|
kind?: "view" | "scroll" | undefined;
|
|
1315
1315
|
axis?: "x" | "y" | "block" | "inline" | undefined;
|
|
1316
1316
|
source?: "nearest" | "root" | undefined;
|
|
1317
|
+
subject?: string | undefined;
|
|
1318
|
+
smoothing?: number | undefined;
|
|
1319
|
+
pin?: boolean | undefined;
|
|
1320
|
+
pinAlign?: "top" | "center" | "bottom" | undefined;
|
|
1321
|
+
pinTop?: number | undefined;
|
|
1322
|
+
pinDistance?: number | undefined;
|
|
1317
1323
|
range?: ({} & {
|
|
1318
1324
|
start?: ({} & {
|
|
1319
1325
|
phase?: "cover" | "contain" | "entry" | "exit" | "entry-crossing" | "exit-crossing" | undefined;
|
|
@@ -1330,6 +1336,12 @@ declare const PxScrollSchema: PxSchema<{} & {
|
|
|
1330
1336
|
kind: PxSchema<"view" | "scroll" | undefined, true>;
|
|
1331
1337
|
axis: PxSchema<"x" | "y" | "block" | "inline" | undefined, true>;
|
|
1332
1338
|
source: PxSchema<"nearest" | "root" | undefined, true>;
|
|
1339
|
+
subject: PxSchema<string | undefined, true>;
|
|
1340
|
+
smoothing: PxSchema<number | undefined, true>;
|
|
1341
|
+
pin: PxSchema<boolean | undefined, true>;
|
|
1342
|
+
pinAlign: PxSchema<"top" | "center" | "bottom" | undefined, true>;
|
|
1343
|
+
pinTop: PxSchema<number | undefined, true>;
|
|
1344
|
+
pinDistance: PxSchema<number | undefined, true>;
|
|
1333
1345
|
range: PxSchema<({} & {
|
|
1334
1346
|
start?: ({} & {
|
|
1335
1347
|
phase?: "cover" | "contain" | "entry" | "exit" | "entry-crossing" | "exit-crossing" | undefined;
|
|
@@ -1631,6 +1643,12 @@ declare const PxAnimatorConfigSchema: PxSchema<{} & {
|
|
|
1631
1643
|
kind?: "view" | "scroll" | undefined;
|
|
1632
1644
|
axis?: "x" | "y" | "block" | "inline" | undefined;
|
|
1633
1645
|
source?: "nearest" | "root" | undefined;
|
|
1646
|
+
subject?: string | undefined;
|
|
1647
|
+
smoothing?: number | undefined;
|
|
1648
|
+
pin?: boolean | undefined;
|
|
1649
|
+
pinAlign?: "top" | "center" | "bottom" | undefined;
|
|
1650
|
+
pinTop?: number | undefined;
|
|
1651
|
+
pinDistance?: number | undefined;
|
|
1634
1652
|
range?: ({} & {
|
|
1635
1653
|
start?: ({} & {
|
|
1636
1654
|
phase?: "cover" | "contain" | "entry" | "exit" | "entry-crossing" | "exit-crossing" | undefined;
|
|
@@ -1932,6 +1950,12 @@ declare const PxAnimatorConfigSchema: PxSchema<{} & {
|
|
|
1932
1950
|
kind?: "view" | "scroll" | undefined;
|
|
1933
1951
|
axis?: "x" | "y" | "block" | "inline" | undefined;
|
|
1934
1952
|
source?: "nearest" | "root" | undefined;
|
|
1953
|
+
subject?: string | undefined;
|
|
1954
|
+
smoothing?: number | undefined;
|
|
1955
|
+
pin?: boolean | undefined;
|
|
1956
|
+
pinAlign?: "top" | "center" | "bottom" | undefined;
|
|
1957
|
+
pinTop?: number | undefined;
|
|
1958
|
+
pinDistance?: number | undefined;
|
|
1935
1959
|
range?: ({} & {
|
|
1936
1960
|
start?: ({} & {
|
|
1937
1961
|
phase?: "cover" | "contain" | "entry" | "exit" | "entry-crossing" | "exit-crossing" | undefined;
|
|
@@ -17760,6 +17784,12 @@ declare const PxSvgNodeExtra: PxSchema<{} & {
|
|
|
17760
17784
|
kind?: "view" | "scroll" | undefined;
|
|
17761
17785
|
axis?: "x" | "y" | "block" | "inline" | undefined;
|
|
17762
17786
|
source?: "nearest" | "root" | undefined;
|
|
17787
|
+
subject?: string | undefined;
|
|
17788
|
+
smoothing?: number | undefined;
|
|
17789
|
+
pin?: boolean | undefined;
|
|
17790
|
+
pinAlign?: "top" | "center" | "bottom" | undefined;
|
|
17791
|
+
pinTop?: number | undefined;
|
|
17792
|
+
pinDistance?: number | undefined;
|
|
17763
17793
|
range?: ({} & {
|
|
17764
17794
|
start?: ({} & {
|
|
17765
17795
|
phase?: "cover" | "contain" | "entry" | "exit" | "entry-crossing" | "exit-crossing" | undefined;
|
|
@@ -18066,6 +18096,12 @@ declare const PxSvgNodeExtra: PxSchema<{} & {
|
|
|
18066
18096
|
kind?: "view" | "scroll" | undefined;
|
|
18067
18097
|
axis?: "x" | "y" | "block" | "inline" | undefined;
|
|
18068
18098
|
source?: "nearest" | "root" | undefined;
|
|
18099
|
+
subject?: string | undefined;
|
|
18100
|
+
smoothing?: number | undefined;
|
|
18101
|
+
pin?: boolean | undefined;
|
|
18102
|
+
pinAlign?: "top" | "center" | "bottom" | undefined;
|
|
18103
|
+
pinTop?: number | undefined;
|
|
18104
|
+
pinDistance?: number | undefined;
|
|
18069
18105
|
range?: ({} & {
|
|
18070
18106
|
start?: ({} & {
|
|
18071
18107
|
phase?: "cover" | "contain" | "entry" | "exit" | "entry-crossing" | "exit-crossing" | undefined;
|
|
@@ -18391,6 +18427,12 @@ declare const PxAnimatedSvgDocumentSchema: PxSchema<{
|
|
|
18391
18427
|
kind?: "view" | "scroll" | undefined;
|
|
18392
18428
|
axis?: "x" | "y" | "block" | "inline" | undefined;
|
|
18393
18429
|
source?: "nearest" | "root" | undefined;
|
|
18430
|
+
subject?: string | undefined;
|
|
18431
|
+
smoothing?: number | undefined;
|
|
18432
|
+
pin?: boolean | undefined;
|
|
18433
|
+
pinAlign?: "top" | "center" | "bottom" | undefined;
|
|
18434
|
+
pinTop?: number | undefined;
|
|
18435
|
+
pinDistance?: number | undefined;
|
|
18394
18436
|
range?: ({} & {
|
|
18395
18437
|
start?: ({} & {
|
|
18396
18438
|
phase?: "cover" | "contain" | "entry" | "exit" | "entry-crossing" | "exit-crossing" | undefined;
|
|
@@ -21376,6 +21418,12 @@ declare const PxAnimatedSvgDocumentSchema: PxSchema<{
|
|
|
21376
21418
|
kind?: "view" | "scroll" | undefined;
|
|
21377
21419
|
axis?: "x" | "y" | "block" | "inline" | undefined;
|
|
21378
21420
|
source?: "nearest" | "root" | undefined;
|
|
21421
|
+
subject?: string | undefined;
|
|
21422
|
+
smoothing?: number | undefined;
|
|
21423
|
+
pin?: boolean | undefined;
|
|
21424
|
+
pinAlign?: "top" | "center" | "bottom" | undefined;
|
|
21425
|
+
pinTop?: number | undefined;
|
|
21426
|
+
pinDistance?: number | undefined;
|
|
21379
21427
|
range?: ({} & {
|
|
21380
21428
|
start?: ({} & {
|
|
21381
21429
|
phase?: "cover" | "contain" | "entry" | "exit" | "entry-crossing" | "exit-crossing" | undefined;
|
|
@@ -24568,6 +24616,14 @@ interface GlyphMaterialiseOpts<E = any> {
|
|
|
24568
24616
|
/** Optional diagnostics sink. */
|
|
24569
24617
|
warnings?: Array<string>;
|
|
24570
24618
|
}
|
|
24619
|
+
/**
|
|
24620
|
+
* Class stamped on the `<path>` holding the □ placeholders — and ONLY on it: the missing
|
|
24621
|
+
* boxes are emitted separately from the real glyphs so a consumer can style them on their
|
|
24622
|
+
* own. The editor uses it to fade them in with a delay: a freshly typed character is
|
|
24623
|
+
* missing for a few frames until its glyph is fetched asynchronously, and a □ that flashes
|
|
24624
|
+
* for that long reads as a rendering glitch.
|
|
24625
|
+
*/
|
|
24626
|
+
declare const MISSING_GLYPH_CLASS_NAME = "px-missing-glyph";
|
|
24571
24627
|
declare function materialiseGlyphTextHorizontal<E = any>(node: PxNode, opts: GlyphMaterialiseOpts<E>): E;
|
|
24572
24628
|
/** Per-CHARACTER advance box (local, pre-transform coords). `x,y` = the char's baseline start,
|
|
24573
24629
|
* `width` = its advance, `ascent`/`fontSize` size its bbox. */
|
|
@@ -24698,4 +24754,4 @@ interface EffectDiff {
|
|
|
24698
24754
|
*/
|
|
24699
24755
|
declare function diffInEffect(a: VmNode, b: VmNode): Array<EffectDiff>;
|
|
24700
24756
|
|
|
24701
|
-
export { type ApplyResult, COLOUR_ATTR_NAMES, CSS_ONLY_STYLE_PROPS, DEFAULT_DURATION_MS, DISALLOWED_SVG_TAGS_LOWER, type ExtendPathOpts, type ExtendedPath, type FillMode, type GlyphCharBox, type GlyphCharBoxAlongPath, type GlyphMaterialiseOpts, INTERNAL_ATTRS, type JsMode, type KeysMatch, LOOP_JUMP_SHIFT_MS, type MaterialiseAllOptions, type MotionPathMaterialisationOptions, type MotionPathSample, type OutAction, PCT_BASED_ATTR_NAMES, PX_ANIM_ATTR_NAME, PX_ANIM_SRC_ATTR_NAME, PX_TRANSFORM_PART_KEYS, type PathPoint, type PathSampler, type PlaybackDirection, type PxAnimatable, type PxAnimatedSvgDocument, PxAnimatedSvgDocumentSchema, type PxAnimationDefinition, PxAnimationDefinitionSchema, type PxAnimatorAPI, type PxAnimatorCallbacksConfig, type PxAnimatorConfig, PxAnimatorConfigSchema, PxAnimatorEngine, PxAnimatorMode, type PxAttrValue, PxAttrValueSchema, type PxBasicAnimatorAPI, 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, PxKeyframeValueSchema, type PxLoop, PxLoopExtend, PxLoopSchema, type PxMaskedByEffect, PxMaskedByEffectSchema, type PxNode, PxNodeBase, PxNodeSchema, type PxPlatformAdapter, type PxPropertyAnimation, PxPropertyAnimationSchema, type PxRepeaterEffect, PxRepeaterEffectSchema, type PxRetimeEffect, PxRetimeEffectSchema, type PxSchema, type PxSchemaDesc, type PxScroll, type PxScrollPhase, type PxScrollRangePoint, PxScrollRangePointSchema, PxScrollRangeSchema, PxScrollSchema, type PxStrokeGradientEffect, PxStrokeGradientEffectSchema, type PxSvgNode, PxSvgNodeExtra, PxTextEffectSchema, type PxTextPathEffect, PxTextPathEffectSchema, type PxTransformByEffect, PxTransformByEffectSchema, type PxTransformPartKey, type PxTransformParts, PxTransformPartsSchema, type PxTransformValue, PxTransformValueSchema, type PxTrigger, PxTriggerSchema, type PxTrimPathEffect, PxTrimPathEffectSchema, PxTrimSubPaths, type PxValidationContext, type PxValidationResult, type RemoveIndex, STYLE_ATTR_NAMES, type StartOn, TEXT_ATTR, TEXT_CONTENT_ATTR, TRANSFORM_FN_NAMES, type Vec2, applyPlayerEffects, bezierToSvgPath, calcAnimationValues, camelCaseToKebabWordIfNeeded, clamp, collectSampleTimes, composeTransformParts, createBasicFrameLoopAnimator, createPathSampler, cubicBezier, deepClone, describeSchema, diffInEffect, evaluateMotionPathSegment, extendedPathForBrowser, generateNewIds, generateUniqueId, getAnimatorConfig, getBindings, getChildren, getDefs, getNormalisedBindings, getNormalizedProps, interpolateBeziers, interpolateValue, isPxElementFileFormat, isPxElementFileFormatDeep, isScrollTimeline, jsonElementFactory, kebabToCamelCaseWord, layoutGlyphTextChars, materialiseAllInTree, materialiseAnimatedUseInstances, materialiseGlyphText, materialiseGlyphTextAlongPath, materialiseGlyphTextHorizontal, materialiseInternalLoopsInPropAnim, materialiseInternalLoopsInTree, materialiseMotionPathInPropAnim, materialiseMotionPathsInTree, propAnimIsMotionPath, px, resolveStyle, reverseEasing, sanitiseAttributeValue, schemaKeys, scrollOffsetProgress, scrollPhaseInterval, scrollResolveAxis, scrollTotalDurationMs, scrollViewProgress, shiftAnimatable, splitEasing, subdivideCubicBezier, toRGBA, validateNodeEffects, visualModelAt };
|
|
24757
|
+
export { type ApplyResult, COLOUR_ATTR_NAMES, CSS_ONLY_STYLE_PROPS, DEFAULT_DURATION_MS, DISALLOWED_SVG_TAGS_LOWER, type ExtendPathOpts, type ExtendedPath, type FillMode, type GlyphCharBox, type GlyphCharBoxAlongPath, type GlyphMaterialiseOpts, INTERNAL_ATTRS, type JsMode, type KeysMatch, LOOP_JUMP_SHIFT_MS, MISSING_GLYPH_CLASS_NAME, type MaterialiseAllOptions, type MotionPathMaterialisationOptions, type MotionPathSample, type OutAction, PCT_BASED_ATTR_NAMES, PX_ANIM_ATTR_NAME, PX_ANIM_SRC_ATTR_NAME, PX_TRANSFORM_PART_KEYS, type PathPoint, type PathSampler, type PlaybackDirection, type PxAnimatable, type PxAnimatedSvgDocument, PxAnimatedSvgDocumentSchema, type PxAnimationDefinition, PxAnimationDefinitionSchema, type PxAnimatorAPI, type PxAnimatorCallbacksConfig, type PxAnimatorConfig, PxAnimatorConfigSchema, PxAnimatorEngine, PxAnimatorMode, type PxAttrValue, PxAttrValueSchema, type PxBasicAnimatorAPI, 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, PxKeyframeValueSchema, type PxLoop, PxLoopExtend, PxLoopSchema, type PxMaskedByEffect, PxMaskedByEffectSchema, type PxNode, PxNodeBase, PxNodeSchema, type PxPlatformAdapter, type PxPropertyAnimation, PxPropertyAnimationSchema, type PxRepeaterEffect, PxRepeaterEffectSchema, type PxRetimeEffect, PxRetimeEffectSchema, type PxSchema, type PxSchemaDesc, type PxScroll, type PxScrollPhase, type PxScrollRangePoint, PxScrollRangePointSchema, PxScrollRangeSchema, PxScrollSchema, type PxStrokeGradientEffect, PxStrokeGradientEffectSchema, type PxSvgNode, PxSvgNodeExtra, PxTextEffectSchema, type PxTextPathEffect, PxTextPathEffectSchema, type PxTransformByEffect, PxTransformByEffectSchema, type PxTransformPartKey, type PxTransformParts, PxTransformPartsSchema, type PxTransformValue, PxTransformValueSchema, type PxTrigger, PxTriggerSchema, type PxTrimPathEffect, PxTrimPathEffectSchema, PxTrimSubPaths, type PxValidationContext, type PxValidationResult, type RemoveIndex, STYLE_ATTR_NAMES, type StartOn, TEXT_ATTR, TEXT_CONTENT_ATTR, TRANSFORM_FN_NAMES, type Vec2, applyPlayerEffects, bezierToSvgPath, calcAnimationValues, camelCaseToKebabWordIfNeeded, clamp, collectSampleTimes, composeTransformParts, createBasicFrameLoopAnimator, createPathSampler, cubicBezier, deepClone, describeSchema, diffInEffect, evaluateMotionPathSegment, extendedPathForBrowser, generateNewIds, generateUniqueId, getAnimatorConfig, getBindings, getChildren, getDefs, getNormalisedBindings, getNormalizedProps, interpolateBeziers, interpolateValue, isPxElementFileFormat, isPxElementFileFormatDeep, isScrollTimeline, jsonElementFactory, kebabToCamelCaseWord, layoutGlyphTextChars, materialiseAllInTree, materialiseAnimatedUseInstances, materialiseGlyphText, materialiseGlyphTextAlongPath, materialiseGlyphTextHorizontal, materialiseInternalLoopsInPropAnim, materialiseInternalLoopsInTree, materialiseMotionPathInPropAnim, materialiseMotionPathsInTree, propAnimIsMotionPath, px, resolveStyle, reverseEasing, sanitiseAttributeValue, schemaKeys, scrollOffsetProgress, scrollPhaseInterval, scrollResolveAxis, scrollTotalDurationMs, scrollViewProgress, shiftAnimatable, splitEasing, subdivideCubicBezier, toRGBA, validateNodeEffects, visualModelAt };
|
package/dist/index.js
CHANGED
|
@@ -1184,6 +1184,13 @@ var PxScrollSchema = implementsInterface()(px.object({
|
|
|
1184
1184
|
kind: px.enum(["view", "scroll"]).optional(),
|
|
1185
1185
|
axis: px.enum(["block", "inline", "x", "y"]).optional(),
|
|
1186
1186
|
source: px.enum(["nearest", "root"]).optional(),
|
|
1187
|
+
// Free-form: the two keywords `parent`/`scroller` plus any CSS selector.
|
|
1188
|
+
subject: px.string().optional(),
|
|
1189
|
+
smoothing: px.number().optional(),
|
|
1190
|
+
pin: px.boolean().optional(),
|
|
1191
|
+
pinAlign: px.enum(["top", "center", "bottom"]).optional(),
|
|
1192
|
+
pinTop: px.number().optional(),
|
|
1193
|
+
pinDistance: px.number().optional(),
|
|
1187
1194
|
range: PxScrollRangeSchema.optional()
|
|
1188
1195
|
}));
|
|
1189
1196
|
var PxAnimatorConfigSchema = implementsInterface()(px.object({
|
|
@@ -4455,6 +4462,19 @@ var TEXT_ATTR_KEYS = [
|
|
|
4455
4462
|
TEXT_CONTENT_ATTR,
|
|
4456
4463
|
"xml:space"
|
|
4457
4464
|
];
|
|
4465
|
+
var PAINT_STATIC_KEYS = [
|
|
4466
|
+
"fillOpacity",
|
|
4467
|
+
"fillRule",
|
|
4468
|
+
"strokeOpacity",
|
|
4469
|
+
"strokeDasharray",
|
|
4470
|
+
"strokeDashoffset",
|
|
4471
|
+
"strokeLinecap",
|
|
4472
|
+
"strokeLinejoin",
|
|
4473
|
+
"strokeMiterlimit",
|
|
4474
|
+
"mixBlendMode",
|
|
4475
|
+
"filter"
|
|
4476
|
+
];
|
|
4477
|
+
var PAINT_ANIMATE_KEYS = ["fill", "stroke", "strokeWidth", "opacity", "fillOpacity", "strokeOpacity", "strokeDasharray", "strokeDashoffset"];
|
|
4458
4478
|
function parseLen(v) {
|
|
4459
4479
|
if (typeof v === "number") return v;
|
|
4460
4480
|
if (typeof v === "string") {
|
|
@@ -4466,17 +4486,39 @@ function parseLen(v) {
|
|
|
4466
4486
|
function str(v) {
|
|
4467
4487
|
return typeof v === "string" ? v : void 0;
|
|
4468
4488
|
}
|
|
4489
|
+
function paintAnimateOf(node) {
|
|
4490
|
+
const bag = node.animate;
|
|
4491
|
+
if (!bag || typeof bag !== "object") return void 0;
|
|
4492
|
+
let out;
|
|
4493
|
+
for (const k of PAINT_ANIMATE_KEYS) {
|
|
4494
|
+
if (bag[k] !== void 0) (out != null ? out : out = {})[k] = bag[k];
|
|
4495
|
+
}
|
|
4496
|
+
return out;
|
|
4497
|
+
}
|
|
4469
4498
|
function resolveStyle2(node, parent) {
|
|
4470
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
4471
|
-
|
|
4499
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
4500
|
+
const isTextRoot = node.type === "text";
|
|
4501
|
+
const nodeStyle = node.style;
|
|
4502
|
+
const own = (key) => {
|
|
4503
|
+
var _a2;
|
|
4504
|
+
return isTextRoot ? void 0 : (_a2 = node[key]) != null ? _a2 : nodeStyle == null ? void 0 : nodeStyle[key];
|
|
4505
|
+
};
|
|
4506
|
+
const res = {
|
|
4472
4507
|
fontFamily: (_a = str(node.fontFamily)) != null ? _a : parent.fontFamily,
|
|
4473
4508
|
fontSize: (_b = parseLen(node.fontSize)) != null ? _b : parent.fontSize,
|
|
4474
4509
|
fill: (_c = node.fill) != null ? _c : parent.fill,
|
|
4475
4510
|
stroke: (_d = node.stroke) != null ? _d : parent.stroke,
|
|
4476
4511
|
strokeWidth: (_e = node.strokeWidth) != null ? _e : parent.strokeWidth,
|
|
4477
4512
|
letterSpacing: (_f = parseLen(node.letterSpacing)) != null ? _f : parent.letterSpacing,
|
|
4478
|
-
wordSpacing: (_g = parseLen(node.wordSpacing)) != null ? _g : parent.wordSpacing
|
|
4513
|
+
wordSpacing: (_g = parseLen(node.wordSpacing)) != null ? _g : parent.wordSpacing,
|
|
4514
|
+
opacity: (_h = parseLen(own("opacity"))) != null ? _h : parent.opacity,
|
|
4515
|
+
animate: (_i = isTextRoot ? void 0 : paintAnimateOf(node)) != null ? _i : parent.animate
|
|
4479
4516
|
};
|
|
4517
|
+
for (const key of PAINT_STATIC_KEYS) {
|
|
4518
|
+
const v = (_j = own(key)) != null ? _j : parent[key];
|
|
4519
|
+
if (v !== void 0) res[key] = v;
|
|
4520
|
+
}
|
|
4521
|
+
return res;
|
|
4480
4522
|
}
|
|
4481
4523
|
function rootStyleOf(node) {
|
|
4482
4524
|
var _a, _b, _c;
|
|
@@ -4495,6 +4537,11 @@ function paintOf(s) {
|
|
|
4495
4537
|
if (s.fill !== void 0) p.fill = s.fill;
|
|
4496
4538
|
if (s.stroke !== void 0) p.stroke = s.stroke;
|
|
4497
4539
|
if (s.strokeWidth !== void 0) p.strokeWidth = s.strokeWidth;
|
|
4540
|
+
if (s.opacity !== void 0 && s.opacity !== 1) p.opacity = s.opacity;
|
|
4541
|
+
for (const key of PAINT_STATIC_KEYS) {
|
|
4542
|
+
if (s[key] !== void 0) p[key] = s[key];
|
|
4543
|
+
}
|
|
4544
|
+
if (s.animate !== void 0) p.animate = s.animate;
|
|
4498
4545
|
return p;
|
|
4499
4546
|
}
|
|
4500
4547
|
function glyphFontFor(s, glyphs, soleFont, warnings) {
|
|
@@ -4508,6 +4555,7 @@ function soleFontOf(glyphs) {
|
|
|
4508
4555
|
return names.length === 1 ? glyphs[names[0]] : void 0;
|
|
4509
4556
|
}
|
|
4510
4557
|
var MISSING_GLYPH_ADVANCE_EM = 0.6;
|
|
4558
|
+
var MISSING_GLYPH_CLASS_NAME = "px-missing-glyph";
|
|
4511
4559
|
function missingGlyphBoxEm(advanceEm, ascentEm) {
|
|
4512
4560
|
if (advanceEm <= 0 || ascentEm <= 0) return "";
|
|
4513
4561
|
const inset = 0.08;
|
|
@@ -4543,7 +4591,7 @@ function materialiseGlyphTextHorizontal(node, opts) {
|
|
|
4543
4591
|
pen.x += g.width * scale;
|
|
4544
4592
|
} else if (/\S/.test(ch)) {
|
|
4545
4593
|
const advEm = g && g.width > 0 ? g.width : MISSING_GLYPH_ADVANCE_EM * upm;
|
|
4546
|
-
placements.push({ glyphD: missingGlyphBoxEm(advEm, ascentEm), m: [scale, 0, 0, scale, pen.x, pen.y], paint, line, x: pen.x, y: pen.y, scale });
|
|
4594
|
+
placements.push({ glyphD: missingGlyphBoxEm(advEm, ascentEm), m: [scale, 0, 0, scale, pen.x, pen.y], paint, isMissing: true, line, x: pen.x, y: pen.y, scale });
|
|
4547
4595
|
pen.x += advEm * scale;
|
|
4548
4596
|
} else {
|
|
4549
4597
|
pen.x += (g ? g.width : 0) * scale;
|
|
@@ -4734,7 +4782,7 @@ function collectAlongPathCells(node, glyphs, soleFont, warnings) {
|
|
|
4734
4782
|
} else if (/\S/.test(ch)) {
|
|
4735
4783
|
const wEm = g && g.width > 0 ? g.width : MISSING_GLYPH_ADVANCE_EM * gf.unitsPerEm;
|
|
4736
4784
|
const boxAdv = wEm * scale;
|
|
4737
|
-
cells.push({ glyphD: missingGlyphBoxEm(wEm, ascentEm), widthEm: wEm, scale, paint, midBase: adv + boxAdv / 2 });
|
|
4785
|
+
cells.push({ glyphD: missingGlyphBoxEm(wEm, ascentEm), widthEm: wEm, scale, paint, isMissing: true, midBase: adv + boxAdv / 2 });
|
|
4738
4786
|
adv += boxAdv;
|
|
4739
4787
|
} else {
|
|
4740
4788
|
adv += (g ? g.width : 0) * scale;
|
|
@@ -4790,6 +4838,7 @@ function materialiseGlyphTextAlongPath(node, pathD, startOffset, opts, textLengt
|
|
|
4790
4838
|
const placements = placeCells.map((c) => ({
|
|
4791
4839
|
glyphD: c.glyphD,
|
|
4792
4840
|
paint: c.paint,
|
|
4841
|
+
isMissing: c.isMissing,
|
|
4793
4842
|
m: alongAffine(sampler, base + c.midBase * k, c.scale, c.widthEm, perp)
|
|
4794
4843
|
}));
|
|
4795
4844
|
return toGroup(node, buildPaths(placements, create, warnings), create);
|
|
@@ -4872,12 +4921,13 @@ function buildAnimatedAlongPath(cells, sampler, distOf, times, loop, create, isC
|
|
|
4872
4921
|
const transform = { keyframes: kfs };
|
|
4873
4922
|
if (loop !== void 0) transform.loop = loop;
|
|
4874
4923
|
const animate = { transform };
|
|
4924
|
+
if (c.paint.animate) Object.assign(animate, c.paint.animate);
|
|
4875
4925
|
if (isClip && opKfs.some((k) => k.value === 0)) {
|
|
4876
4926
|
const op = { keyframes: opKfs };
|
|
4877
4927
|
if (loop !== void 0) op.loop = loop;
|
|
4878
4928
|
animate.opacity = op;
|
|
4879
4929
|
}
|
|
4880
|
-
out.push(create("path", __spreadProps(__spreadValues({ d }, paintProps(c.paint)), { animate }), []));
|
|
4930
|
+
out.push(create("path", __spreadProps(__spreadValues(__spreadValues({ d }, paintProps(c.paint)), missingGlyphProps(c.isMissing)), { animate }), []));
|
|
4881
4931
|
}
|
|
4882
4932
|
return out;
|
|
4883
4933
|
}
|
|
@@ -4886,24 +4936,34 @@ function paintProps(paint) {
|
|
|
4886
4936
|
if (paint.fill !== void 0) p.fill = paint.fill;
|
|
4887
4937
|
if (paint.stroke !== void 0) p.stroke = paint.stroke;
|
|
4888
4938
|
if (paint.strokeWidth !== void 0) p.strokeWidth = paint.strokeWidth;
|
|
4939
|
+
if (paint.opacity !== void 0) p.opacity = paint.opacity;
|
|
4940
|
+
for (const key of PAINT_STATIC_KEYS) {
|
|
4941
|
+
if (paint[key] !== void 0) p[key] = paint[key];
|
|
4942
|
+
}
|
|
4889
4943
|
return p;
|
|
4890
4944
|
}
|
|
4945
|
+
function missingGlyphProps(isMissing) {
|
|
4946
|
+
return isMissing ? { class: MISSING_GLYPH_CLASS_NAME } : {};
|
|
4947
|
+
}
|
|
4891
4948
|
function buildPaths(placements, create, warnings) {
|
|
4892
|
-
var _a, _b, _c;
|
|
4893
4949
|
if (!placements.length) {
|
|
4894
4950
|
warnings == null ? void 0 : warnings.push("textGlyphs: nothing to render");
|
|
4895
4951
|
return [];
|
|
4896
4952
|
}
|
|
4897
4953
|
const byPaint = /* @__PURE__ */ new Map();
|
|
4898
4954
|
for (const p of placements) {
|
|
4899
|
-
const key = JSON.stringify([
|
|
4955
|
+
const key = JSON.stringify([p.paint, !!p.isMissing]);
|
|
4900
4956
|
const baked = transformPathData(p.glyphD, p.m);
|
|
4901
4957
|
const entry = byPaint.get(key);
|
|
4902
4958
|
if (entry) entry.d += baked;
|
|
4903
|
-
else byPaint.set(key, { paint: p.paint, d: baked });
|
|
4959
|
+
else byPaint.set(key, { paint: p.paint, d: baked, isMissing: p.isMissing });
|
|
4904
4960
|
}
|
|
4905
4961
|
const out = [];
|
|
4906
|
-
for (const { paint, d } of byPaint.values())
|
|
4962
|
+
for (const { paint, d, isMissing } of byPaint.values()) {
|
|
4963
|
+
out.push(create("path", __spreadValues(__spreadValues(__spreadValues({
|
|
4964
|
+
d
|
|
4965
|
+
}, paintProps(paint)), missingGlyphProps(isMissing)), paint.animate !== void 0 ? { animate: __spreadValues({}, paint.animate) } : {}), []));
|
|
4966
|
+
}
|
|
4907
4967
|
return out;
|
|
4908
4968
|
}
|
|
4909
4969
|
function toGroup(node, children, create) {
|
|
@@ -6014,6 +6074,7 @@ export {
|
|
|
6014
6074
|
DISALLOWED_SVG_TAGS_LOWER,
|
|
6015
6075
|
INTERNAL_ATTRS,
|
|
6016
6076
|
LOOP_JUMP_SHIFT_MS,
|
|
6077
|
+
MISSING_GLYPH_CLASS_NAME,
|
|
6017
6078
|
PCT_BASED_ATTR_NAMES,
|
|
6018
6079
|
PX_ANIM_ATTR_NAME,
|
|
6019
6080
|
PX_ANIM_SRC_ATTR_NAME,
|