@pixodesk/svg-animator-web 1.0.29 → 1.0.30
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 +1 -1
- package/dist/index.cjs +13 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +12 -12
- 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.map +1 -1
- package/dist/index.prerendered.umd.js.map +1 -1
- package/dist/index.umd.js +12 -12
- package/dist/index.umd.js.map +1 -1
- package/dist/index.umd.min.js +1 -1
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PxAnimatorAPI as PxAnimatorAPI$1, PxBasicAnimatorAPI as PxBasicAnimatorAPI$1, PxAnimatedSvgDocument, PxPlatformAdapter, PxAnimatorCallbacksConfig, PxTrigger, PxNode, PxDefs } from '@pixodesk/svg-animator-core';
|
|
2
|
-
export { ApplyResult, COLOUR_ATTR_NAMES, ExtendPathOpts, ExtendedPath, FillMode, GlyphCharBox, GlyphCharBoxAlongPath, GlyphMaterialiseOpts, JsMode, KeysMatch, MISSING_GLYPH_CLASS_NAME, MaterialiseAllOptions, MotionPathMaterialisationOptions, MotionPathSample, OutAction, PX_ANIM_ATTR_NAME, PX_ANIM_SRC_ATTR_NAME, PX_TRANSFORM_PART_KEYS, PathPoint, PathSampler, PlaybackDirection, PxAnimatable, PxAnimatedSvgDocument, PxAnimatedSvgDocumentSchema, PxAnimationDefinition, PxAnimationDefinitionSchema, PxAnimatorCallbacksConfig, PxAnimatorConfig, PxAnimatorConfigSchema, PxAnimatorEngine, PxAnimatorMode, PxAttrValue, PxAttrValueSchema, PxBezierPath, PxBezierPathSchema, PxBinding, PxBindingSchema, PxCloneEffect, PxCloneEffectSchema, PxCreateElement, PxDefs, PxDefsSchema, PxEasingOrRefSchema, PxEffects, PxEffectsSchema, PxElementAnimation, PxElementAnimationSchema, PxFillGradientEffect, PxFillGradientEffectSchema, PxGlyph, PxGlyphFont, PxGradientSpreadMethod, PxGradientStop, PxGradientStopSchema, PxGradientType, PxGradientUnits, PxInfer, PxKeyframe, PxKeyframeSchema, PxKeyframeValueSchema, PxLoop, PxLoopSchema, PxMaskedByEffect, PxMaskedByEffectSchema, PxNode, PxNodeBase, PxNodeSchema, PxPlatformAdapter, PxPropertyAnimation, PxPropertyAnimationSchema, PxRepeaterEffect, PxRepeaterEffectSchema, PxRetimeEffect, PxRetimeEffectSchema, PxSchema, PxSchemaDesc, PxStrokeGradientEffect, PxStrokeGradientEffectSchema, PxSvgNode, PxSvgNodeExtra, PxTextEffectSchema, PxTextPathEffect, PxTextPathEffectSchema, PxTransformByEffect, PxTransformByEffectSchema, PxTransformPartKey, PxTransformParts, PxTransformPartsSchema, PxTransformValue, PxTransformValueSchema, PxTrigger, PxTriggerSchema,
|
|
2
|
+
export { ApplyResult, COLOUR_ATTR_NAMES, ExtendPathOpts, ExtendedPath, FillMode, GlyphCharBox, GlyphCharBoxAlongPath, GlyphMaterialiseOpts, JsMode, KeysMatch, MISSING_GLYPH_CLASS_NAME, MaterialiseAllOptions, MotionPathMaterialisationOptions, MotionPathSample, OutAction, PX_ANIM_ATTR_NAME, PX_ANIM_SRC_ATTR_NAME, PX_TRANSFORM_PART_KEYS, PathPoint, PathSampler, PlaybackDirection, PxAnimatable, PxAnimatedSvgDocument, PxAnimatedSvgDocumentSchema, PxAnimationDefinition, PxAnimationDefinitionSchema, PxAnimatorCallbacksConfig, PxAnimatorConfig, PxAnimatorConfigSchema, PxAnimatorEngine, PxAnimatorMode, PxAttrValue, PxAttrValueSchema, PxBezierPath, PxBezierPathSchema, PxBinding, PxBindingSchema, PxCloneEffect, PxCloneEffectSchema, PxCreateElement, PxDefs, PxDefsSchema, PxEasingOrRefSchema, PxEffects, PxEffectsSchema, PxElementAnimation, PxElementAnimationSchema, PxFillGradientEffect, PxFillGradientEffectSchema, PxGlyph, PxGlyphFont, PxGradientSpreadMethod, PxGradientStop, PxGradientStopSchema, PxGradientType, PxGradientUnits, PxInfer, PxKeyframe, PxKeyframeSchema, PxKeyframeValueSchema, PxLoop, PxLoopSchema, PxMaskedByEffect, PxMaskedByEffectSchema, PxNode, PxNodeBase, PxNodeSchema, PxPlatformAdapter, PxPropertyAnimation, PxPropertyAnimationSchema, PxRepeaterEffect, PxRepeaterEffectSchema, PxRetimeEffect, PxRetimeEffectSchema, PxSchema, PxSchemaDesc, PxStrokeGradientEffect, PxStrokeGradientEffectSchema, PxStrokeTrimEffect, PxStrokeTrimEffectSchema, PxSvgNode, PxSvgNodeExtra, PxTextEffectSchema, PxTextPathEffect, PxTextPathEffectSchema, PxTransformByEffect, PxTransformByEffectSchema, PxTransformPartKey, PxTransformParts, PxTransformPartsSchema, PxTransformValue, PxTransformValueSchema, PxTrigger, PxTriggerSchema, PxValidationContext, PxValidationResult, RemoveIndex, STYLE_ATTR_NAMES, StartOn, TRANSFORM_FN_NAMES, Vec2, applyPlayerEffects, calcAnimationValues, camelCaseToKebabWordIfNeeded, collectSampleTimes, createBasicFrameLoopAnimator, createPathSampler, describeSchema, diffInEffect, evaluateMotionPathSegment, extendedPathForBrowser, generateNewIds, getAnimatorConfig, getBindings, getChildren, getDefs, getNormalizedProps, isPxElementFileFormat, isPxElementFileFormatDeep, jsonElementFactory, layoutGlyphTextChars, materialiseAllInTree, materialiseAnimatedUseInstances, materialiseGlyphText, materialiseGlyphTextAlongPath, materialiseGlyphTextHorizontal, materialiseInternalLoopsInPropAnim, materialiseInternalLoopsInTree, materialiseMotionPathInPropAnim, materialiseMotionPathsInTree, getNormalisedBindings as normalizeDocument, propAnimIsMotionPath, px, schemaKeys, shiftAnimatable, toRGBA, validateNodeEffects, visualModelAt } from '@pixodesk/svg-animator-core';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* DOM specialisations of the platform-neutral animator API types.
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PxAnimatorAPI as PxAnimatorAPI$1, PxBasicAnimatorAPI as PxBasicAnimatorAPI$1, PxAnimatedSvgDocument, PxPlatformAdapter, PxAnimatorCallbacksConfig, PxTrigger, PxNode, PxDefs } from '@pixodesk/svg-animator-core';
|
|
2
|
-
export { ApplyResult, COLOUR_ATTR_NAMES, ExtendPathOpts, ExtendedPath, FillMode, GlyphCharBox, GlyphCharBoxAlongPath, GlyphMaterialiseOpts, JsMode, KeysMatch, MISSING_GLYPH_CLASS_NAME, MaterialiseAllOptions, MotionPathMaterialisationOptions, MotionPathSample, OutAction, PX_ANIM_ATTR_NAME, PX_ANIM_SRC_ATTR_NAME, PX_TRANSFORM_PART_KEYS, PathPoint, PathSampler, PlaybackDirection, PxAnimatable, PxAnimatedSvgDocument, PxAnimatedSvgDocumentSchema, PxAnimationDefinition, PxAnimationDefinitionSchema, PxAnimatorCallbacksConfig, PxAnimatorConfig, PxAnimatorConfigSchema, PxAnimatorEngine, PxAnimatorMode, PxAttrValue, PxAttrValueSchema, PxBezierPath, PxBezierPathSchema, PxBinding, PxBindingSchema, PxCloneEffect, PxCloneEffectSchema, PxCreateElement, PxDefs, PxDefsSchema, PxEasingOrRefSchema, PxEffects, PxEffectsSchema, PxElementAnimation, PxElementAnimationSchema, PxFillGradientEffect, PxFillGradientEffectSchema, PxGlyph, PxGlyphFont, PxGradientSpreadMethod, PxGradientStop, PxGradientStopSchema, PxGradientType, PxGradientUnits, PxInfer, PxKeyframe, PxKeyframeSchema, PxKeyframeValueSchema, PxLoop, PxLoopSchema, PxMaskedByEffect, PxMaskedByEffectSchema, PxNode, PxNodeBase, PxNodeSchema, PxPlatformAdapter, PxPropertyAnimation, PxPropertyAnimationSchema, PxRepeaterEffect, PxRepeaterEffectSchema, PxRetimeEffect, PxRetimeEffectSchema, PxSchema, PxSchemaDesc, PxStrokeGradientEffect, PxStrokeGradientEffectSchema, PxSvgNode, PxSvgNodeExtra, PxTextEffectSchema, PxTextPathEffect, PxTextPathEffectSchema, PxTransformByEffect, PxTransformByEffectSchema, PxTransformPartKey, PxTransformParts, PxTransformPartsSchema, PxTransformValue, PxTransformValueSchema, PxTrigger, PxTriggerSchema,
|
|
2
|
+
export { ApplyResult, COLOUR_ATTR_NAMES, ExtendPathOpts, ExtendedPath, FillMode, GlyphCharBox, GlyphCharBoxAlongPath, GlyphMaterialiseOpts, JsMode, KeysMatch, MISSING_GLYPH_CLASS_NAME, MaterialiseAllOptions, MotionPathMaterialisationOptions, MotionPathSample, OutAction, PX_ANIM_ATTR_NAME, PX_ANIM_SRC_ATTR_NAME, PX_TRANSFORM_PART_KEYS, PathPoint, PathSampler, PlaybackDirection, PxAnimatable, PxAnimatedSvgDocument, PxAnimatedSvgDocumentSchema, PxAnimationDefinition, PxAnimationDefinitionSchema, PxAnimatorCallbacksConfig, PxAnimatorConfig, PxAnimatorConfigSchema, PxAnimatorEngine, PxAnimatorMode, PxAttrValue, PxAttrValueSchema, PxBezierPath, PxBezierPathSchema, PxBinding, PxBindingSchema, PxCloneEffect, PxCloneEffectSchema, PxCreateElement, PxDefs, PxDefsSchema, PxEasingOrRefSchema, PxEffects, PxEffectsSchema, PxElementAnimation, PxElementAnimationSchema, PxFillGradientEffect, PxFillGradientEffectSchema, PxGlyph, PxGlyphFont, PxGradientSpreadMethod, PxGradientStop, PxGradientStopSchema, PxGradientType, PxGradientUnits, PxInfer, PxKeyframe, PxKeyframeSchema, PxKeyframeValueSchema, PxLoop, PxLoopSchema, PxMaskedByEffect, PxMaskedByEffectSchema, PxNode, PxNodeBase, PxNodeSchema, PxPlatformAdapter, PxPropertyAnimation, PxPropertyAnimationSchema, PxRepeaterEffect, PxRepeaterEffectSchema, PxRetimeEffect, PxRetimeEffectSchema, PxSchema, PxSchemaDesc, PxStrokeGradientEffect, PxStrokeGradientEffectSchema, PxStrokeTrimEffect, PxStrokeTrimEffectSchema, PxSvgNode, PxSvgNodeExtra, PxTextEffectSchema, PxTextPathEffect, PxTextPathEffectSchema, PxTransformByEffect, PxTransformByEffectSchema, PxTransformPartKey, PxTransformParts, PxTransformPartsSchema, PxTransformValue, PxTransformValueSchema, PxTrigger, PxTriggerSchema, PxValidationContext, PxValidationResult, RemoveIndex, STYLE_ATTR_NAMES, StartOn, TRANSFORM_FN_NAMES, Vec2, applyPlayerEffects, calcAnimationValues, camelCaseToKebabWordIfNeeded, collectSampleTimes, createBasicFrameLoopAnimator, createPathSampler, describeSchema, diffInEffect, evaluateMotionPathSegment, extendedPathForBrowser, generateNewIds, getAnimatorConfig, getBindings, getChildren, getDefs, getNormalizedProps, isPxElementFileFormat, isPxElementFileFormatDeep, jsonElementFactory, layoutGlyphTextChars, materialiseAllInTree, materialiseAnimatedUseInstances, materialiseGlyphText, materialiseGlyphTextAlongPath, materialiseGlyphTextHorizontal, materialiseInternalLoopsInPropAnim, materialiseInternalLoopsInTree, materialiseMotionPathInPropAnim, materialiseMotionPathsInTree, getNormalisedBindings as normalizeDocument, propAnimIsMotionPath, px, schemaKeys, shiftAnimatable, toRGBA, validateNodeEffects, visualModelAt } from '@pixodesk/svg-animator-core';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* DOM specialisations of the platform-neutral animator API types.
|
package/dist/index.js
CHANGED
|
@@ -1052,7 +1052,7 @@ var PxTextPathSpacing = {
|
|
|
1052
1052
|
auto: "auto",
|
|
1053
1053
|
exact: "exact"
|
|
1054
1054
|
};
|
|
1055
|
-
var
|
|
1055
|
+
var PxStrokeTrimSubPaths = {
|
|
1056
1056
|
separate: "separate",
|
|
1057
1057
|
combined: "combined"
|
|
1058
1058
|
};
|
|
@@ -1294,10 +1294,10 @@ var PxClipPathEffectSchema = implementsInterface()(px.object({
|
|
|
1294
1294
|
d: PxAnimatableStringSchema.optional(),
|
|
1295
1295
|
animate: PxPropertyAnimationSchema.optional()
|
|
1296
1296
|
}));
|
|
1297
|
-
var
|
|
1297
|
+
var PxStrokeTrimEffectSchema = implementsInterface()(px.object({
|
|
1298
1298
|
offset: PxAnimatableNumberSchema.optional(),
|
|
1299
1299
|
range: PxAnimatableVec2Schema.optional(),
|
|
1300
|
-
subPaths: px.enum([
|
|
1300
|
+
subPaths: px.enum([PxStrokeTrimSubPaths.separate, PxStrokeTrimSubPaths.combined]).optional()
|
|
1301
1301
|
}));
|
|
1302
1302
|
var PxRetimeEffectSchema = implementsInterface()(px.object({
|
|
1303
1303
|
sourceId: px.string().optional(),
|
|
@@ -1351,7 +1351,7 @@ var PxEffectsSchema = implementsInterface()(px.object({
|
|
|
1351
1351
|
repeater: PxRepeaterEffectSchema.optional(),
|
|
1352
1352
|
maskedBy: PxMaskedByEffectSchema.optional(),
|
|
1353
1353
|
clipPath: PxClipPathEffectSchema.optional(),
|
|
1354
|
-
|
|
1354
|
+
strokeTrim: PxStrokeTrimEffectSchema.optional(),
|
|
1355
1355
|
clone: PxCloneEffectSchema.optional(),
|
|
1356
1356
|
fillGradient: PxFillGradientEffectSchema.optional(),
|
|
1357
1357
|
strokeGradient: PxStrokeGradientEffectSchema.optional(),
|
|
@@ -4989,9 +4989,9 @@ function applyTextGlyphsAlongPath(node, ctx, pathD, startOffset, textLength, pat
|
|
|
4989
4989
|
}
|
|
4990
4990
|
return materialiseGlyphTextAlongPath(node, pathD, startOffset, { glyphs: ctx.glyphs, warnings: ctx.warnings }, textLength, pathOverflow);
|
|
4991
4991
|
}
|
|
4992
|
-
function
|
|
4993
|
-
if (!
|
|
4994
|
-
const combined =
|
|
4992
|
+
function applyStrokeTrimEffect(node, strokeTrim, ctx) {
|
|
4993
|
+
if (!strokeTrim) return node;
|
|
4994
|
+
const combined = strokeTrim.subPaths === PxStrokeTrimSubPaths.combined;
|
|
4995
4995
|
const leafEntries = [];
|
|
4996
4996
|
const measure = (n) => {
|
|
4997
4997
|
if (Array.isArray(n.children) && n.children.length > 0) {
|
|
@@ -5022,9 +5022,9 @@ function applyTrimPathEffect(node, trimPath, ctx) {
|
|
|
5022
5022
|
}
|
|
5023
5023
|
const chainLengthPx = acc;
|
|
5024
5024
|
if (combined && chainLengthPx < 1e-3) return node;
|
|
5025
|
-
const offsetReadRaw = readAnimatable(
|
|
5025
|
+
const offsetReadRaw = readAnimatable(strokeTrim.offset);
|
|
5026
5026
|
const offsetRead = offsetReadRaw.kind === "absent" ? { kind: "static", value: 0 } : offsetReadRaw;
|
|
5027
|
-
const rangeReadRaw = readRangeWithCrossings(
|
|
5027
|
+
const rangeReadRaw = readRangeWithCrossings(strokeTrim.range);
|
|
5028
5028
|
const rangeRead = rangeReadRaw.kind === "absent" ? { kind: "static", value: [0, 1] } : rangeReadRaw;
|
|
5029
5029
|
const offsetValues = readScalarValues(offsetRead);
|
|
5030
5030
|
const minOffset = offsetValues.length ? Math.min(...offsetValues) : 0;
|
|
@@ -5354,7 +5354,7 @@ function applyPlayerEffects_exceptRetime(node, ctx) {
|
|
|
5354
5354
|
const originalId = typeof node.id === "string" ? node.id : void 0;
|
|
5355
5355
|
const innerIdForContentRef = originalId ? ctx.contentRefInnerIds.get(originalId) : void 0;
|
|
5356
5356
|
if (!fx && !innerIdForContentRef) return node;
|
|
5357
|
-
const { transformBy, repeater, maskedBy, clipPath,
|
|
5357
|
+
const { transformBy, repeater, maskedBy, clipPath, strokeTrim, clone: cloneFx, fillGradient, strokeGradient, textPath, text } = fx != null ? fx : {};
|
|
5358
5358
|
if (fx) delete node.effects;
|
|
5359
5359
|
let n = node;
|
|
5360
5360
|
let consumedByGlyphs = false;
|
|
@@ -5374,7 +5374,7 @@ function applyPlayerEffects_exceptRetime(node, ctx) {
|
|
|
5374
5374
|
if (!consumedByGlyphs) n = applyTextPathEffect(n, textPath, ctx);
|
|
5375
5375
|
n = applyFillGradientEffect(n, fillGradient, ctx);
|
|
5376
5376
|
n = applyStrokeGradientEffect(n, strokeGradient, ctx);
|
|
5377
|
-
n =
|
|
5377
|
+
n = applyStrokeTrimEffect(n, strokeTrim, ctx);
|
|
5378
5378
|
n = applyRepeaterEffect(n, repeater, ctx);
|
|
5379
5379
|
n = applyMaskedByEffect(n, maskedBy, transformBy, ctx);
|
|
5380
5380
|
n = applyClipPathEffect(n, clipPath, ctx);
|
|
@@ -7018,6 +7018,7 @@ export {
|
|
|
7018
7018
|
PxRepeaterEffectSchema,
|
|
7019
7019
|
PxRetimeEffectSchema,
|
|
7020
7020
|
PxStrokeGradientEffectSchema,
|
|
7021
|
+
PxStrokeTrimEffectSchema,
|
|
7021
7022
|
PxSvgNodeExtra,
|
|
7022
7023
|
PxTextEffectSchema,
|
|
7023
7024
|
PxTextPathEffectSchema,
|
|
@@ -7025,7 +7026,6 @@ export {
|
|
|
7025
7026
|
PxTransformPartsSchema,
|
|
7026
7027
|
PxTransformValueSchema,
|
|
7027
7028
|
PxTriggerSchema,
|
|
7028
|
-
PxTrimPathEffectSchema,
|
|
7029
7029
|
STYLE_ATTR_NAMES,
|
|
7030
7030
|
TRANSFORM_FN_NAMES,
|
|
7031
7031
|
applyPlayerEffects,
|