@pixodesk/svg-animator-core 1.0.41 → 1.0.43

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.
@@ -753,6 +753,130 @@ declare function getBindings(doc: PxAnimatedSvgDocument): PxBinding[] | undefine
753
753
  /** @public @advanced */
754
754
  declare function getChildren(doc: PxAnimatedSvgDocument): PxNode[] | undefined;
755
755
 
756
+ /**
757
+ * Every diagnostic a player can report, as a number a host can switch on.
758
+ *
759
+ * The words are not in the build: each code's description lives in the comment on its member and
760
+ * is compiled into `docs/diagnostics.md`, which every diagnostic's `message` links to.
761
+ * @public
762
+ */
763
+ declare enum PxDiagnosticCode {
764
+ /**
765
+ * The player could not be built from this document — a document that passed validation but
766
+ * still broke the builder, or a bug in the player. Report it.
767
+ * @data the Error
768
+ */
769
+ buildFailed = 1001,
770
+ /**
771
+ * The file at `src` loaded, but it is not a Pixodesk animation document.
772
+ * @data the `src` URL
773
+ */
774
+ invalidDocumentAtSrc = 1002,
775
+ /**
776
+ * The page could not fetch `src`. The file may be perfect — this is the request failing.
777
+ * @data the `src` URL · the fetch error's message
778
+ */
779
+ loadFailed = 1003,
780
+ /**
781
+ * One element's animation could not be built, so that element stays static; the rest plays.
782
+ * @data the Error
783
+ */
784
+ animationBuildFailed = 1004,
785
+ /**
786
+ * An `effects` bucket does not match the schema, so that effect is ignored or degraded.
787
+ * @data the problem, with the node's path
788
+ */
789
+ effectsShape = 1101,
790
+ /**
791
+ * Part of the per-instance `timeline` override could not be applied — most often clock-only
792
+ * keys aimed at a scroll timeline.
793
+ * @data what could not be applied
794
+ */
795
+ timelineOverrideIgnored = 1102,
796
+ /**
797
+ * An SVG tag that can execute or load remote content was dropped from the rendered tree.
798
+ * @data the tag name
799
+ */
800
+ blockedTag = 1103,
801
+ /**
802
+ * The browser will not animate these attributes, so the document fell back to the frame loop.
803
+ * @data the attribute names
804
+ */
805
+ unsupportedAnimatedAttrs = 1104,
806
+ /** A bind-by-id document carries no `animator.bindings`, so nothing is animated. */
807
+ noBindings = 1105,
808
+ /**
809
+ * A binding names no element, or names animations that `definitions.animations` does not have.
810
+ * @data the binding
811
+ */
812
+ unresolvedBinding = 1106,
813
+ /** `setupAnimationTriggers` was given no root element, so no trigger was wired. */
814
+ triggersNoRoot = 1201,
815
+ /**
816
+ * The container selector matched nothing, so there is nothing to render into.
817
+ * @data the selector
818
+ */
819
+ noRootForSelector = 1202,
820
+ /** No container was given and the document's `id` matched no element already on the page. */
821
+ noRootElement = 1203,
822
+ /**
823
+ * A binding's selector matched no element, so that binding animates nothing.
824
+ * @data the selector
825
+ */
826
+ noElementsForSelector = 1206,
827
+ /**
828
+ * An attribute write found no element for this id — the rendered SVG was probably replaced.
829
+ * @data the id or selector
830
+ */
831
+ setAttributeNoElement = 1207,
832
+ /** `smoothing` needs the player's own driver, so the browser's scroll timeline was not used. */
833
+ scrollSmoothingNeedsOwnDriver = 1301,
834
+ /** The browser refused to build a native scroll timeline; the player measures progress itself. */
835
+ scrollNativeUnavailable = 1302,
836
+ /**
837
+ * `scroll.subject` is not a valid CSS selector, so the SVG itself is measured instead.
838
+ * @data the subject
839
+ */
840
+ scrollSubjectInvalid = 1303,
841
+ /**
842
+ * `scroll.subject` matched no element, so the SVG itself is measured instead.
843
+ * @data the subject
844
+ */
845
+ scrollSubjectNoMatch = 1304,
846
+ /** There is no root element to observe, so a scroll-driven animation stays on its first frame. */
847
+ scrollNoRootToObserve = 1305,
848
+ /** `animator.trigger` does not apply to a scroll timeline — the scrollbar is the playhead. */
849
+ scrollTriggerIgnored = 1306,
850
+ /** A playback rate of `0`, or a non-finite one, is rejected everywhere — use `pause()`. */
851
+ rateRejected = 1401,
852
+ /**
853
+ * Two control tiers were set at once. The higher one wins and the lower is ignored — see the
854
+ * control-mode rule.
855
+ * @data which props conflicted, and which won
856
+ */
857
+ controlPropsConflict = 1501,
858
+ /**
859
+ * The document could not be compiled into animation tracks, so `fallback` is shown.
860
+ * @data the Error
861
+ */
862
+ rnCompileFailed = 1601,
863
+ /**
864
+ * Rendering the compiled document threw, so `fallback` is shown.
865
+ * @data the Error
866
+ */
867
+ rnRenderFailed = 1602,
868
+ /**
869
+ * The error boundary caught a render failure below this component.
870
+ * @data the Error · the React component stack
871
+ */
872
+ rnBoundaryCaught = 1603,
873
+ /**
874
+ * `react-native-svg` cannot express part of this document, so it was left out or simplified.
875
+ * @data what was left out
876
+ */
877
+ rnUnsupported = 1604
878
+ }
879
+
756
880
  /**
757
881
  * Who can do something about a diagnostic.
758
882
  *
@@ -773,18 +897,29 @@ declare const PxDiagnosticKind: {
773
897
  readonly internal: "internal";
774
898
  };
775
899
  type PxDiagnosticKind = typeof PxDiagnosticKind[keyof typeof PxDiagnosticKind];
776
- /** One thing a player has to say. @public */
900
+ /**
901
+ * One thing a player has to say.
902
+ *
903
+ * The TEXT is not here, and is not in the bundle: `code` identifies the diagnostic and
904
+ * {@link https://github.com/pixodesk/pixodesk-svg-animator/blob/main/docs/diagnostics.md the
905
+ * codes page} carries the description. That is the trade this library makes — a smaller
906
+ * download, and a stable number you can switch on instead of matching a sentence that may be
907
+ * reworded. The specifics are in `data`.
908
+ * @public
909
+ */
777
910
  interface PxDiagnostic {
911
+ /** WHICH diagnostic this is — a permanent number; look it up on the codes page. */
912
+ readonly code: PxDiagnosticCode;
778
913
  /** Who can act on it — see {@link PxDiagnosticKind}. */
779
914
  readonly kind: PxDiagnosticKind;
780
- /** Human-readable, and never carries the console prefix. */
781
- readonly message: string;
782
915
  /**
783
- * Whatever the site had to hand: the offending binding, the element map, the raw error —
784
- * or, for a React Native render failure, `{ componentStack }`.
916
+ * What the site had to hand, in the order the code's `@data` lists: a selector, a URL, the
917
+ * offending binding, an inner problem. Everything a sentence would have interpolated.
785
918
  */
786
- readonly detail?: unknown;
787
- /** Present on errors: the Error that stopped the player. Its message is `message`. */
919
+ readonly data?: ReadonlyArray<unknown>;
920
+ /** The code and a link to its description — NOT the description itself, which is not shipped. */
921
+ readonly message: string;
922
+ /** Present on errors: the Error that stopped the player. */
788
923
  readonly error?: Error;
789
924
  }
790
925
  /**
@@ -799,15 +934,16 @@ interface PxDiagnosticsConfig {
799
934
  /**
800
935
  * IT PLAYS, but something was ignored, degraded or misspelled — an unknown easing, an
801
936
  * override that could not apply, an attribute the platform will not animate. Each
802
- * diagnostic says WHO can act on it via `kind` (`document` / `host` / `platform` / `usage` /
803
- * `internal`). Without this: `console.warn`.
937
+ * diagnostic says WHAT happened via `code` (a number — look it up on the codes page) and
938
+ * WHO can act on it via `kind` (`document` / `host` / `platform` / `usage` / `internal`);
939
+ * `data` carries the values the site had. Without this: `console.warn`.
804
940
  */
805
941
  onWarn?: (diagnostic: PxDiagnostic) => void;
806
942
  /**
807
943
  * THIS INSTANCE WILL NOT PLAY — the document failed to load, parse or build, or the render
808
944
  * threw: nothing rendered, `isReady()` false, the component's `fallback` shown. The player
809
945
  * stays inert rather than throwing at the caller. `diagnostic.error` is the Error; on React
810
- * Native `diagnostic.detail` carries `{ componentStack }` when the error boundary caught it.
946
+ * Native `diagnostic.data` carries the component stack when the error boundary caught it.
811
947
  * Without this: `console.error`.
812
948
  */
813
949
  onError?: (diagnostic: PxDiagnostic) => void;
@@ -823,10 +959,13 @@ interface PxDiagnosticsConfig {
823
959
  }
824
960
  /** The reporting channel a player writes to. @public */
825
961
  interface PxDiagnostics {
826
- /** Report something survivable — it plays. */
827
- warn(kind: PxDiagnosticKind, message: string, detail?: unknown): void;
828
- /** Report a failure that stopped this instance — it will not play. */
829
- error(kind: PxDiagnosticKind, error: Error | string, detail?: unknown): void;
962
+ /** Report something survivable — it plays. `data` is whatever the code's `@data` names. */
963
+ warn(kind: PxDiagnosticKind, code: PxDiagnosticCode, ...data: Array<unknown>): void;
964
+ /**
965
+ * Report a failure that stopped this instance — it will not play. An `Error` anywhere in
966
+ * `data` becomes the diagnostic's `error`, so a site can pass it wherever it reads best.
967
+ */
968
+ error(kind: PxDiagnosticKind, code: PxDiagnosticCode, ...data: Array<unknown>): void;
830
969
  }
831
970
  /**
832
971
  * Builds the channel a player reports through.
@@ -10984,4 +11123,4 @@ declare function diagnoseDocument(doc: unknown): PxDocumentDiagnosis;
10984
11123
  */
10985
11124
  declare function reportDocumentDiagnostics(doc: unknown, where: string): void;
10986
11125
 
10987
- export { PxLoopSchema as $, type PxDefinitions as A, PxDefinitionsSchema as B, type PxDiagnostic as C, PxDiagnosticKind as D, type PxDiagnostics as E, type PxDiagnosticsConfig as F, type PxEffects as G, PxEffectsSchema as H, type PxElementAnimation as I, PxElementAnimationSchema as J, PxFillGradientEffectSchema as K, PxFillMode as L, PxFinishAction as M, type PxGlyph as N, type PxGlyphFont as O, type PxAnimatedSvgDocument as P, PxGradientSpreadMethod as Q, PxGradientStopSchema as R, PxGradientType as S, type PxInfer as T, type PxKeyframe as U, PxKeyframeSchema as V, PxKeyframeValueSchema as W, PxLengthAdjust as X, type PxLoop as Y, PxLoopDirection as Z, PxLoopRepeatAt as _, type PxEngineCallbacks as a, generateNewIds as a$, PxMaskType as a0, PxMaskedByEffectSchema as a1, PxNodeBaseSchema as a2, PxNodeSchema as a3, PxOutAction as a4, PxPathOverflow as a5, PxPinAlign as a6, type PxPlaybackApi as a7, PxPlaybackDirection as a8, type PxPropertyAnimation as a9, PxTimelineSchema as aA, PxTransformByEffectSchema as aB, type PxTransformParts as aC, PxTransformPartsSchema as aD, type PxTransformValue as aE, PxTransformValueSchema as aF, type PxTrigger as aG, PxTriggerSchema as aH, PxUnits as aI, type PxValidationContext as aJ, type PxVec2 as aK, type PxWireConversionOptions as aL, type PxWireConversionResult as aM, PxWireStepKind as aN, type PxWireVersion as aO, PxWireVersionRelation as aP, type PxWireVersionStep as aQ, applyWireSteps as aR, calcAnimationValues as aS, compareWireVersion as aT, controlModeTakesOverTrigger as aU, convertWireDocument as aV, describeSchema as aW, diagnoseDocument as aX, downgradeWireDocument as aY, flattenAnimatorTimeline as aZ, formatWireVersion as a_, PxPropertyAnimationSchema as aa, type PxRemoveIndex as ab, PxRepeaterEffectSchema as ac, PxRetimeEffectSchema as ad, type PxSchema as ae, type PxSchemaDesc as af, type PxScroll as ag, PxScrollAxis as ah, PxScrollKind as ai, PxScrollPhase as aj, type PxScrollRangePoint as ak, PxScrollRangePointSchema as al, PxScrollRangeSchema as am, PxScrollSchema as an, PxScrollSource as ao, PxStrokeTrimEffectSchema as ap, PxStrokeTrimSubPaths as aq, type PxSvgNode as ar, PxSvgNodeRootSchema as as, PxTextEffectSchema as at, PxTextPathEffectSchema as au, PxTextPathMethod as av, PxTextPathSpacing as aw, type PxTimeline as ax, PxTimelineEngine as ay, PxTimelineEngineSetting as az, type PxAnimatorApi as b, getAnimatorConfig as b0, getBindings as b1, getChildren as b2, getDefinitions as b3, isNativeForced as b4, isPxDocument as b5, isValidPxDocument as b6, materializeAllInTree as b7, mayUseNativeScrollTimeline as b8, nestAnimatorTimeline as b9, generateUniqueId as bA, interpolateValue as bB, keyframeEasing as bC, keyframeValue as bD, materializeMotionPathInPropAnim as bE, mergeStaticTransformIntoAnimDef as bF, reportDocumentDiagnostics as bG, sanitizeAttributeValue as bH, normalizeBindings as ba, parseWireVersion as bb, px as bc, readWireVersion as bd, resolveControlMode as be, resolveTimelineEngine as bf, resolveTrigger as bg, schemaKeys as bh, toDomProps as bi, validateDocument as bj, validateNodeEffects as bk, wireVersionAdvice as bl, type PxAnimatable as bm, PX_ANIM_ATTR_NAME as bn, PX_ANIM_SRC_ATTR_NAME as bo, PX_CSS_ONLY_STYLE_PROPS as bp, PX_DISALLOWED_SVG_TAGS_LOWER as bq, PX_LOOP_JUMP_SHIFT_MS as br, PX_TEXT_CONTENT_ATTR as bs, PX_UNKNOWN_KEY_ERROR as bt, type PxAnyKeyframe as bu, type PxMaterializeAllOptions as bv, type PxNormalizedKeyframe as bw, type PxNormalizedPropertyAnimation as bx, createDiagnostics as by, deepClone as bz, type PxAnimatorConfig as c, PxStartOn as d, type PxNode as e, PX_TRANSFORM_PART_KEYS as f, PX_TRIGGER_DEFAULTS as g, PX_WIRE_BASELINE_VERSION as h, PX_WIRE_STEPS as i, PX_WIRE_VERSION as j, PX_WIRE_VERSION_KEY as k, PxAlongPathMode as l, PxAnimatedSvgDocumentSchema as m, type PxAnimationDefinition as n, type PxAnimatorCallbacks as o, PxAnimatorConfigSchema as p, type PxAnimatorHandle as q, PxAttrValueSchema as r, type PxBezierPath as s, PxBezierPathSchema as t, type PxBinding as u, PxClipPathEffectSchema as v, PxCloneEffectSchema as w, PxCloneWithout as x, PxControlMode as y, type PxControlProps as z };
11126
+ export { PxLoopRepeatAt as $, type PxDefinitions as A, PxDefinitionsSchema as B, type PxDiagnostic as C, PxDiagnosticCode as D, PxDiagnosticKind as E, type PxDiagnostics as F, type PxDiagnosticsConfig as G, type PxEffects as H, PxEffectsSchema as I, type PxElementAnimation as J, PxElementAnimationSchema as K, PxFillGradientEffectSchema as L, PxFillMode as M, PxFinishAction as N, type PxGlyph as O, type PxAnimatedSvgDocument as P, type PxGlyphFont as Q, PxGradientSpreadMethod as R, PxGradientStopSchema as S, PxGradientType as T, type PxInfer as U, type PxKeyframe as V, PxKeyframeSchema as W, PxKeyframeValueSchema as X, PxLengthAdjust as Y, type PxLoop as Z, PxLoopDirection as _, type PxEngineCallbacks as a, formatWireVersion as a$, PxLoopSchema as a0, PxMaskType as a1, PxMaskedByEffectSchema as a2, PxNodeBaseSchema as a3, PxNodeSchema as a4, PxOutAction as a5, PxPathOverflow as a6, PxPinAlign as a7, type PxPlaybackApi as a8, PxPlaybackDirection as a9, PxTimelineEngineSetting as aA, PxTimelineSchema as aB, PxTransformByEffectSchema as aC, type PxTransformParts as aD, PxTransformPartsSchema as aE, type PxTransformValue as aF, PxTransformValueSchema as aG, type PxTrigger as aH, PxTriggerSchema as aI, PxUnits as aJ, type PxValidationContext as aK, type PxVec2 as aL, type PxWireConversionOptions as aM, type PxWireConversionResult as aN, PxWireStepKind as aO, type PxWireVersion as aP, PxWireVersionRelation as aQ, type PxWireVersionStep as aR, applyWireSteps as aS, calcAnimationValues as aT, compareWireVersion as aU, controlModeTakesOverTrigger as aV, convertWireDocument as aW, describeSchema as aX, diagnoseDocument as aY, downgradeWireDocument as aZ, flattenAnimatorTimeline as a_, type PxPropertyAnimation as aa, PxPropertyAnimationSchema as ab, type PxRemoveIndex as ac, PxRepeaterEffectSchema as ad, PxRetimeEffectSchema as ae, type PxSchema as af, type PxSchemaDesc as ag, type PxScroll as ah, PxScrollAxis as ai, PxScrollKind as aj, PxScrollPhase as ak, type PxScrollRangePoint as al, PxScrollRangePointSchema as am, PxScrollRangeSchema as an, PxScrollSchema as ao, PxScrollSource as ap, PxStrokeTrimEffectSchema as aq, PxStrokeTrimSubPaths as ar, type PxSvgNode as as, PxSvgNodeRootSchema as at, PxTextEffectSchema as au, PxTextPathEffectSchema as av, PxTextPathMethod as aw, PxTextPathSpacing as ax, type PxTimeline as ay, PxTimelineEngine as az, type PxAnimatorApi as b, generateNewIds as b0, getAnimatorConfig as b1, getBindings as b2, getChildren as b3, getDefinitions as b4, isNativeForced as b5, isPxDocument as b6, isValidPxDocument as b7, materializeAllInTree as b8, mayUseNativeScrollTimeline as b9, deepClone as bA, generateUniqueId as bB, interpolateValue as bC, keyframeEasing as bD, keyframeValue as bE, materializeMotionPathInPropAnim as bF, mergeStaticTransformIntoAnimDef as bG, reportDocumentDiagnostics as bH, sanitizeAttributeValue as bI, nestAnimatorTimeline as ba, normalizeBindings as bb, parseWireVersion as bc, px as bd, readWireVersion as be, resolveControlMode as bf, resolveTimelineEngine as bg, resolveTrigger as bh, schemaKeys as bi, toDomProps as bj, validateDocument as bk, validateNodeEffects as bl, wireVersionAdvice as bm, type PxAnimatable as bn, PX_ANIM_ATTR_NAME as bo, PX_ANIM_SRC_ATTR_NAME as bp, PX_CSS_ONLY_STYLE_PROPS as bq, PX_DISALLOWED_SVG_TAGS_LOWER as br, PX_LOOP_JUMP_SHIFT_MS as bs, PX_TEXT_CONTENT_ATTR as bt, PX_UNKNOWN_KEY_ERROR as bu, type PxAnyKeyframe as bv, type PxMaterializeAllOptions as bw, type PxNormalizedKeyframe as bx, type PxNormalizedPropertyAnimation as by, createDiagnostics as bz, type PxAnimatorConfig as c, PxStartOn as d, type PxNode as e, PX_TRANSFORM_PART_KEYS as f, PX_TRIGGER_DEFAULTS as g, PX_WIRE_BASELINE_VERSION as h, PX_WIRE_STEPS as i, PX_WIRE_VERSION as j, PX_WIRE_VERSION_KEY as k, PxAlongPathMode as l, PxAnimatedSvgDocumentSchema as m, type PxAnimationDefinition as n, type PxAnimatorCallbacks as o, PxAnimatorConfigSchema as p, type PxAnimatorHandle as q, PxAttrValueSchema as r, type PxBezierPath as s, PxBezierPathSchema as t, type PxBinding as u, PxClipPathEffectSchema as v, PxCloneEffectSchema as w, PxCloneWithout as x, PxControlMode as y, type PxControlProps as z };
@@ -753,6 +753,130 @@ declare function getBindings(doc: PxAnimatedSvgDocument): PxBinding[] | undefine
753
753
  /** @public @advanced */
754
754
  declare function getChildren(doc: PxAnimatedSvgDocument): PxNode[] | undefined;
755
755
 
756
+ /**
757
+ * Every diagnostic a player can report, as a number a host can switch on.
758
+ *
759
+ * The words are not in the build: each code's description lives in the comment on its member and
760
+ * is compiled into `docs/diagnostics.md`, which every diagnostic's `message` links to.
761
+ * @public
762
+ */
763
+ declare enum PxDiagnosticCode {
764
+ /**
765
+ * The player could not be built from this document — a document that passed validation but
766
+ * still broke the builder, or a bug in the player. Report it.
767
+ * @data the Error
768
+ */
769
+ buildFailed = 1001,
770
+ /**
771
+ * The file at `src` loaded, but it is not a Pixodesk animation document.
772
+ * @data the `src` URL
773
+ */
774
+ invalidDocumentAtSrc = 1002,
775
+ /**
776
+ * The page could not fetch `src`. The file may be perfect — this is the request failing.
777
+ * @data the `src` URL · the fetch error's message
778
+ */
779
+ loadFailed = 1003,
780
+ /**
781
+ * One element's animation could not be built, so that element stays static; the rest plays.
782
+ * @data the Error
783
+ */
784
+ animationBuildFailed = 1004,
785
+ /**
786
+ * An `effects` bucket does not match the schema, so that effect is ignored or degraded.
787
+ * @data the problem, with the node's path
788
+ */
789
+ effectsShape = 1101,
790
+ /**
791
+ * Part of the per-instance `timeline` override could not be applied — most often clock-only
792
+ * keys aimed at a scroll timeline.
793
+ * @data what could not be applied
794
+ */
795
+ timelineOverrideIgnored = 1102,
796
+ /**
797
+ * An SVG tag that can execute or load remote content was dropped from the rendered tree.
798
+ * @data the tag name
799
+ */
800
+ blockedTag = 1103,
801
+ /**
802
+ * The browser will not animate these attributes, so the document fell back to the frame loop.
803
+ * @data the attribute names
804
+ */
805
+ unsupportedAnimatedAttrs = 1104,
806
+ /** A bind-by-id document carries no `animator.bindings`, so nothing is animated. */
807
+ noBindings = 1105,
808
+ /**
809
+ * A binding names no element, or names animations that `definitions.animations` does not have.
810
+ * @data the binding
811
+ */
812
+ unresolvedBinding = 1106,
813
+ /** `setupAnimationTriggers` was given no root element, so no trigger was wired. */
814
+ triggersNoRoot = 1201,
815
+ /**
816
+ * The container selector matched nothing, so there is nothing to render into.
817
+ * @data the selector
818
+ */
819
+ noRootForSelector = 1202,
820
+ /** No container was given and the document's `id` matched no element already on the page. */
821
+ noRootElement = 1203,
822
+ /**
823
+ * A binding's selector matched no element, so that binding animates nothing.
824
+ * @data the selector
825
+ */
826
+ noElementsForSelector = 1206,
827
+ /**
828
+ * An attribute write found no element for this id — the rendered SVG was probably replaced.
829
+ * @data the id or selector
830
+ */
831
+ setAttributeNoElement = 1207,
832
+ /** `smoothing` needs the player's own driver, so the browser's scroll timeline was not used. */
833
+ scrollSmoothingNeedsOwnDriver = 1301,
834
+ /** The browser refused to build a native scroll timeline; the player measures progress itself. */
835
+ scrollNativeUnavailable = 1302,
836
+ /**
837
+ * `scroll.subject` is not a valid CSS selector, so the SVG itself is measured instead.
838
+ * @data the subject
839
+ */
840
+ scrollSubjectInvalid = 1303,
841
+ /**
842
+ * `scroll.subject` matched no element, so the SVG itself is measured instead.
843
+ * @data the subject
844
+ */
845
+ scrollSubjectNoMatch = 1304,
846
+ /** There is no root element to observe, so a scroll-driven animation stays on its first frame. */
847
+ scrollNoRootToObserve = 1305,
848
+ /** `animator.trigger` does not apply to a scroll timeline — the scrollbar is the playhead. */
849
+ scrollTriggerIgnored = 1306,
850
+ /** A playback rate of `0`, or a non-finite one, is rejected everywhere — use `pause()`. */
851
+ rateRejected = 1401,
852
+ /**
853
+ * Two control tiers were set at once. The higher one wins and the lower is ignored — see the
854
+ * control-mode rule.
855
+ * @data which props conflicted, and which won
856
+ */
857
+ controlPropsConflict = 1501,
858
+ /**
859
+ * The document could not be compiled into animation tracks, so `fallback` is shown.
860
+ * @data the Error
861
+ */
862
+ rnCompileFailed = 1601,
863
+ /**
864
+ * Rendering the compiled document threw, so `fallback` is shown.
865
+ * @data the Error
866
+ */
867
+ rnRenderFailed = 1602,
868
+ /**
869
+ * The error boundary caught a render failure below this component.
870
+ * @data the Error · the React component stack
871
+ */
872
+ rnBoundaryCaught = 1603,
873
+ /**
874
+ * `react-native-svg` cannot express part of this document, so it was left out or simplified.
875
+ * @data what was left out
876
+ */
877
+ rnUnsupported = 1604
878
+ }
879
+
756
880
  /**
757
881
  * Who can do something about a diagnostic.
758
882
  *
@@ -773,18 +897,29 @@ declare const PxDiagnosticKind: {
773
897
  readonly internal: "internal";
774
898
  };
775
899
  type PxDiagnosticKind = typeof PxDiagnosticKind[keyof typeof PxDiagnosticKind];
776
- /** One thing a player has to say. @public */
900
+ /**
901
+ * One thing a player has to say.
902
+ *
903
+ * The TEXT is not here, and is not in the bundle: `code` identifies the diagnostic and
904
+ * {@link https://github.com/pixodesk/pixodesk-svg-animator/blob/main/docs/diagnostics.md the
905
+ * codes page} carries the description. That is the trade this library makes — a smaller
906
+ * download, and a stable number you can switch on instead of matching a sentence that may be
907
+ * reworded. The specifics are in `data`.
908
+ * @public
909
+ */
777
910
  interface PxDiagnostic {
911
+ /** WHICH diagnostic this is — a permanent number; look it up on the codes page. */
912
+ readonly code: PxDiagnosticCode;
778
913
  /** Who can act on it — see {@link PxDiagnosticKind}. */
779
914
  readonly kind: PxDiagnosticKind;
780
- /** Human-readable, and never carries the console prefix. */
781
- readonly message: string;
782
915
  /**
783
- * Whatever the site had to hand: the offending binding, the element map, the raw error —
784
- * or, for a React Native render failure, `{ componentStack }`.
916
+ * What the site had to hand, in the order the code's `@data` lists: a selector, a URL, the
917
+ * offending binding, an inner problem. Everything a sentence would have interpolated.
785
918
  */
786
- readonly detail?: unknown;
787
- /** Present on errors: the Error that stopped the player. Its message is `message`. */
919
+ readonly data?: ReadonlyArray<unknown>;
920
+ /** The code and a link to its description — NOT the description itself, which is not shipped. */
921
+ readonly message: string;
922
+ /** Present on errors: the Error that stopped the player. */
788
923
  readonly error?: Error;
789
924
  }
790
925
  /**
@@ -799,15 +934,16 @@ interface PxDiagnosticsConfig {
799
934
  /**
800
935
  * IT PLAYS, but something was ignored, degraded or misspelled — an unknown easing, an
801
936
  * override that could not apply, an attribute the platform will not animate. Each
802
- * diagnostic says WHO can act on it via `kind` (`document` / `host` / `platform` / `usage` /
803
- * `internal`). Without this: `console.warn`.
937
+ * diagnostic says WHAT happened via `code` (a number — look it up on the codes page) and
938
+ * WHO can act on it via `kind` (`document` / `host` / `platform` / `usage` / `internal`);
939
+ * `data` carries the values the site had. Without this: `console.warn`.
804
940
  */
805
941
  onWarn?: (diagnostic: PxDiagnostic) => void;
806
942
  /**
807
943
  * THIS INSTANCE WILL NOT PLAY — the document failed to load, parse or build, or the render
808
944
  * threw: nothing rendered, `isReady()` false, the component's `fallback` shown. The player
809
945
  * stays inert rather than throwing at the caller. `diagnostic.error` is the Error; on React
810
- * Native `diagnostic.detail` carries `{ componentStack }` when the error boundary caught it.
946
+ * Native `diagnostic.data` carries the component stack when the error boundary caught it.
811
947
  * Without this: `console.error`.
812
948
  */
813
949
  onError?: (diagnostic: PxDiagnostic) => void;
@@ -823,10 +959,13 @@ interface PxDiagnosticsConfig {
823
959
  }
824
960
  /** The reporting channel a player writes to. @public */
825
961
  interface PxDiagnostics {
826
- /** Report something survivable — it plays. */
827
- warn(kind: PxDiagnosticKind, message: string, detail?: unknown): void;
828
- /** Report a failure that stopped this instance — it will not play. */
829
- error(kind: PxDiagnosticKind, error: Error | string, detail?: unknown): void;
962
+ /** Report something survivable — it plays. `data` is whatever the code's `@data` names. */
963
+ warn(kind: PxDiagnosticKind, code: PxDiagnosticCode, ...data: Array<unknown>): void;
964
+ /**
965
+ * Report a failure that stopped this instance — it will not play. An `Error` anywhere in
966
+ * `data` becomes the diagnostic's `error`, so a site can pass it wherever it reads best.
967
+ */
968
+ error(kind: PxDiagnosticKind, code: PxDiagnosticCode, ...data: Array<unknown>): void;
830
969
  }
831
970
  /**
832
971
  * Builds the channel a player reports through.
@@ -10984,4 +11123,4 @@ declare function diagnoseDocument(doc: unknown): PxDocumentDiagnosis;
10984
11123
  */
10985
11124
  declare function reportDocumentDiagnostics(doc: unknown, where: string): void;
10986
11125
 
10987
- export { PxLoopSchema as $, type PxDefinitions as A, PxDefinitionsSchema as B, type PxDiagnostic as C, PxDiagnosticKind as D, type PxDiagnostics as E, type PxDiagnosticsConfig as F, type PxEffects as G, PxEffectsSchema as H, type PxElementAnimation as I, PxElementAnimationSchema as J, PxFillGradientEffectSchema as K, PxFillMode as L, PxFinishAction as M, type PxGlyph as N, type PxGlyphFont as O, type PxAnimatedSvgDocument as P, PxGradientSpreadMethod as Q, PxGradientStopSchema as R, PxGradientType as S, type PxInfer as T, type PxKeyframe as U, PxKeyframeSchema as V, PxKeyframeValueSchema as W, PxLengthAdjust as X, type PxLoop as Y, PxLoopDirection as Z, PxLoopRepeatAt as _, type PxEngineCallbacks as a, generateNewIds as a$, PxMaskType as a0, PxMaskedByEffectSchema as a1, PxNodeBaseSchema as a2, PxNodeSchema as a3, PxOutAction as a4, PxPathOverflow as a5, PxPinAlign as a6, type PxPlaybackApi as a7, PxPlaybackDirection as a8, type PxPropertyAnimation as a9, PxTimelineSchema as aA, PxTransformByEffectSchema as aB, type PxTransformParts as aC, PxTransformPartsSchema as aD, type PxTransformValue as aE, PxTransformValueSchema as aF, type PxTrigger as aG, PxTriggerSchema as aH, PxUnits as aI, type PxValidationContext as aJ, type PxVec2 as aK, type PxWireConversionOptions as aL, type PxWireConversionResult as aM, PxWireStepKind as aN, type PxWireVersion as aO, PxWireVersionRelation as aP, type PxWireVersionStep as aQ, applyWireSteps as aR, calcAnimationValues as aS, compareWireVersion as aT, controlModeTakesOverTrigger as aU, convertWireDocument as aV, describeSchema as aW, diagnoseDocument as aX, downgradeWireDocument as aY, flattenAnimatorTimeline as aZ, formatWireVersion as a_, PxPropertyAnimationSchema as aa, type PxRemoveIndex as ab, PxRepeaterEffectSchema as ac, PxRetimeEffectSchema as ad, type PxSchema as ae, type PxSchemaDesc as af, type PxScroll as ag, PxScrollAxis as ah, PxScrollKind as ai, PxScrollPhase as aj, type PxScrollRangePoint as ak, PxScrollRangePointSchema as al, PxScrollRangeSchema as am, PxScrollSchema as an, PxScrollSource as ao, PxStrokeTrimEffectSchema as ap, PxStrokeTrimSubPaths as aq, type PxSvgNode as ar, PxSvgNodeRootSchema as as, PxTextEffectSchema as at, PxTextPathEffectSchema as au, PxTextPathMethod as av, PxTextPathSpacing as aw, type PxTimeline as ax, PxTimelineEngine as ay, PxTimelineEngineSetting as az, type PxAnimatorApi as b, getAnimatorConfig as b0, getBindings as b1, getChildren as b2, getDefinitions as b3, isNativeForced as b4, isPxDocument as b5, isValidPxDocument as b6, materializeAllInTree as b7, mayUseNativeScrollTimeline as b8, nestAnimatorTimeline as b9, generateUniqueId as bA, interpolateValue as bB, keyframeEasing as bC, keyframeValue as bD, materializeMotionPathInPropAnim as bE, mergeStaticTransformIntoAnimDef as bF, reportDocumentDiagnostics as bG, sanitizeAttributeValue as bH, normalizeBindings as ba, parseWireVersion as bb, px as bc, readWireVersion as bd, resolveControlMode as be, resolveTimelineEngine as bf, resolveTrigger as bg, schemaKeys as bh, toDomProps as bi, validateDocument as bj, validateNodeEffects as bk, wireVersionAdvice as bl, type PxAnimatable as bm, PX_ANIM_ATTR_NAME as bn, PX_ANIM_SRC_ATTR_NAME as bo, PX_CSS_ONLY_STYLE_PROPS as bp, PX_DISALLOWED_SVG_TAGS_LOWER as bq, PX_LOOP_JUMP_SHIFT_MS as br, PX_TEXT_CONTENT_ATTR as bs, PX_UNKNOWN_KEY_ERROR as bt, type PxAnyKeyframe as bu, type PxMaterializeAllOptions as bv, type PxNormalizedKeyframe as bw, type PxNormalizedPropertyAnimation as bx, createDiagnostics as by, deepClone as bz, type PxAnimatorConfig as c, PxStartOn as d, type PxNode as e, PX_TRANSFORM_PART_KEYS as f, PX_TRIGGER_DEFAULTS as g, PX_WIRE_BASELINE_VERSION as h, PX_WIRE_STEPS as i, PX_WIRE_VERSION as j, PX_WIRE_VERSION_KEY as k, PxAlongPathMode as l, PxAnimatedSvgDocumentSchema as m, type PxAnimationDefinition as n, type PxAnimatorCallbacks as o, PxAnimatorConfigSchema as p, type PxAnimatorHandle as q, PxAttrValueSchema as r, type PxBezierPath as s, PxBezierPathSchema as t, type PxBinding as u, PxClipPathEffectSchema as v, PxCloneEffectSchema as w, PxCloneWithout as x, PxControlMode as y, type PxControlProps as z };
11126
+ export { PxLoopRepeatAt as $, type PxDefinitions as A, PxDefinitionsSchema as B, type PxDiagnostic as C, PxDiagnosticCode as D, PxDiagnosticKind as E, type PxDiagnostics as F, type PxDiagnosticsConfig as G, type PxEffects as H, PxEffectsSchema as I, type PxElementAnimation as J, PxElementAnimationSchema as K, PxFillGradientEffectSchema as L, PxFillMode as M, PxFinishAction as N, type PxGlyph as O, type PxAnimatedSvgDocument as P, type PxGlyphFont as Q, PxGradientSpreadMethod as R, PxGradientStopSchema as S, PxGradientType as T, type PxInfer as U, type PxKeyframe as V, PxKeyframeSchema as W, PxKeyframeValueSchema as X, PxLengthAdjust as Y, type PxLoop as Z, PxLoopDirection as _, type PxEngineCallbacks as a, formatWireVersion as a$, PxLoopSchema as a0, PxMaskType as a1, PxMaskedByEffectSchema as a2, PxNodeBaseSchema as a3, PxNodeSchema as a4, PxOutAction as a5, PxPathOverflow as a6, PxPinAlign as a7, type PxPlaybackApi as a8, PxPlaybackDirection as a9, PxTimelineEngineSetting as aA, PxTimelineSchema as aB, PxTransformByEffectSchema as aC, type PxTransformParts as aD, PxTransformPartsSchema as aE, type PxTransformValue as aF, PxTransformValueSchema as aG, type PxTrigger as aH, PxTriggerSchema as aI, PxUnits as aJ, type PxValidationContext as aK, type PxVec2 as aL, type PxWireConversionOptions as aM, type PxWireConversionResult as aN, PxWireStepKind as aO, type PxWireVersion as aP, PxWireVersionRelation as aQ, type PxWireVersionStep as aR, applyWireSteps as aS, calcAnimationValues as aT, compareWireVersion as aU, controlModeTakesOverTrigger as aV, convertWireDocument as aW, describeSchema as aX, diagnoseDocument as aY, downgradeWireDocument as aZ, flattenAnimatorTimeline as a_, type PxPropertyAnimation as aa, PxPropertyAnimationSchema as ab, type PxRemoveIndex as ac, PxRepeaterEffectSchema as ad, PxRetimeEffectSchema as ae, type PxSchema as af, type PxSchemaDesc as ag, type PxScroll as ah, PxScrollAxis as ai, PxScrollKind as aj, PxScrollPhase as ak, type PxScrollRangePoint as al, PxScrollRangePointSchema as am, PxScrollRangeSchema as an, PxScrollSchema as ao, PxScrollSource as ap, PxStrokeTrimEffectSchema as aq, PxStrokeTrimSubPaths as ar, type PxSvgNode as as, PxSvgNodeRootSchema as at, PxTextEffectSchema as au, PxTextPathEffectSchema as av, PxTextPathMethod as aw, PxTextPathSpacing as ax, type PxTimeline as ay, PxTimelineEngine as az, type PxAnimatorApi as b, generateNewIds as b0, getAnimatorConfig as b1, getBindings as b2, getChildren as b3, getDefinitions as b4, isNativeForced as b5, isPxDocument as b6, isValidPxDocument as b7, materializeAllInTree as b8, mayUseNativeScrollTimeline as b9, deepClone as bA, generateUniqueId as bB, interpolateValue as bC, keyframeEasing as bD, keyframeValue as bE, materializeMotionPathInPropAnim as bF, mergeStaticTransformIntoAnimDef as bG, reportDocumentDiagnostics as bH, sanitizeAttributeValue as bI, nestAnimatorTimeline as ba, normalizeBindings as bb, parseWireVersion as bc, px as bd, readWireVersion as be, resolveControlMode as bf, resolveTimelineEngine as bg, resolveTrigger as bh, schemaKeys as bi, toDomProps as bj, validateDocument as bk, validateNodeEffects as bl, wireVersionAdvice as bm, type PxAnimatable as bn, PX_ANIM_ATTR_NAME as bo, PX_ANIM_SRC_ATTR_NAME as bp, PX_CSS_ONLY_STYLE_PROPS as bq, PX_DISALLOWED_SVG_TAGS_LOWER as br, PX_LOOP_JUMP_SHIFT_MS as bs, PX_TEXT_CONTENT_ATTR as bt, PX_UNKNOWN_KEY_ERROR as bu, type PxAnyKeyframe as bv, type PxMaterializeAllOptions as bw, type PxNormalizedKeyframe as bx, type PxNormalizedPropertyAnimation as by, createDiagnostics as bz, type PxAnimatorConfig as c, PxStartOn as d, type PxNode as e, PX_TRANSFORM_PART_KEYS as f, PX_TRIGGER_DEFAULTS as g, PX_WIRE_BASELINE_VERSION as h, PX_WIRE_STEPS as i, PX_WIRE_VERSION as j, PX_WIRE_VERSION_KEY as k, PxAlongPathMode as l, PxAnimatedSvgDocumentSchema as m, type PxAnimationDefinition as n, type PxAnimatorCallbacks as o, PxAnimatorConfigSchema as p, type PxAnimatorHandle as q, PxAttrValueSchema as r, type PxBezierPath as s, PxBezierPathSchema as t, type PxBinding as u, PxClipPathEffectSchema as v, PxCloneEffectSchema as w, PxCloneWithout as x, PxControlMode as y, type PxControlProps as z };
@@ -4373,32 +4373,34 @@ var PxDiagnosticKind = {
4373
4373
  /** The player failed where it did not expect to — report it to us. */
4374
4374
  internal: "internal"
4375
4375
  };
4376
- function asError(error) {
4377
- return typeof error === "string" ? new Error(error) : error;
4376
+ var DOCS_URL = "https://github.com/pixodesk/pixodesk-svg-animator/blob/main/docs/diagnostics.md";
4377
+ function codeLine(code) {
4378
+ return "PX" + code + " " + DOCS_URL + "#px" + code;
4379
+ }
4380
+ function errorIn(data) {
4381
+ return data.find((d) => d instanceof Error);
4378
4382
  }
4379
4383
  function createDiagnostics(config, prefix) {
4380
4384
  const tag = prefix ? prefix + " " : "";
4381
4385
  return {
4382
- warn: (kind, message, detail) => {
4386
+ warn: (kind, code, ...data) => {
4387
+ const message = codeLine(code);
4383
4388
  if (config == null ? void 0 : config.onWarn) {
4384
- config.onWarn({ kind, message, detail });
4389
+ config.onWarn({ code, kind, data, message });
4385
4390
  return;
4386
4391
  }
4387
4392
  if (config == null ? void 0 : config.muteWarn) return;
4388
- const line = tag + kind + ": " + message;
4389
- if (detail === void 0) console.warn(line);
4390
- else console.warn(line, detail);
4393
+ console.warn(tag + kind + " " + message, ...data);
4391
4394
  },
4392
- error: (kind, error, detail) => {
4393
- const err = asError(error);
4395
+ error: (kind, code, ...data) => {
4396
+ const message = codeLine(code);
4397
+ const error = errorIn(data);
4394
4398
  if (config == null ? void 0 : config.onError) {
4395
- config.onError({ kind, message: err.message, error: err, detail });
4399
+ config.onError({ code, kind, data, message, error });
4396
4400
  return;
4397
4401
  }
4398
4402
  if (config == null ? void 0 : config.muteError) return;
4399
- const line = tag + kind + ": " + err.message;
4400
- if (detail === void 0) console.error(line);
4401
- else console.error(line, detail);
4403
+ console.error(tag + kind + " " + message, ...data);
4402
4404
  }
4403
4405
  };
4404
4406
  }
@@ -4592,4 +4594,4 @@ export {
4592
4594
  diagnoseDocument,
4593
4595
  reportDocumentDiagnostics
4594
4596
  };
4595
- //# sourceMappingURL=chunk-L6GJ6Y2M.js.map
4597
+ //# sourceMappingURL=chunk-BOTZI36B.js.map