@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.
- package/dist/{PxDocumentDiagnostic-COGEjBbg.d.cts → PxDocumentDiagnostic-DkBZYJ7X.d.cts} +154 -15
- package/dist/{PxDocumentDiagnostic-COGEjBbg.d.ts → PxDocumentDiagnostic-DkBZYJ7X.d.ts} +154 -15
- package/dist/{chunk-L6GJ6Y2M.js → chunk-BOTZI36B.js} +16 -14
- package/dist/{chunk-L6GJ6Y2M.js.map → chunk-BOTZI36B.js.map} +1 -1
- package/dist/{chunk-7ZO7PQKZ.min.js → chunk-CAZFG2HW.min.js} +1 -1
- package/dist/index.cjs +34 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +34 -1
- package/dist/index.js.map +1 -1
- package/dist/index.min.cjs +1 -1
- package/dist/index.min.js +1 -1
- package/dist/internal.cjs +15 -13
- package/dist/internal.cjs.map +1 -1
- package/dist/internal.d.cts +2 -2
- package/dist/internal.d.ts +2 -2
- package/dist/internal.js +1 -1
- package/dist/internal.min.cjs +1 -1
- package/dist/internal.min.js +1 -1
- package/package.json +1 -1
|
@@ -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
|
-
/**
|
|
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
|
-
*
|
|
784
|
-
*
|
|
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
|
|
787
|
-
/**
|
|
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
|
|
803
|
-
* `
|
|
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.
|
|
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,
|
|
828
|
-
/**
|
|
829
|
-
|
|
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 {
|
|
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
|
-
/**
|
|
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
|
-
*
|
|
784
|
-
*
|
|
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
|
|
787
|
-
/**
|
|
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
|
|
803
|
-
* `
|
|
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.
|
|
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,
|
|
828
|
-
/**
|
|
829
|
-
|
|
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 {
|
|
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
|
-
|
|
4377
|
-
|
|
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,
|
|
4386
|
+
warn: (kind, code, ...data) => {
|
|
4387
|
+
const message = codeLine(code);
|
|
4383
4388
|
if (config == null ? void 0 : config.onWarn) {
|
|
4384
|
-
config.onWarn({ kind,
|
|
4389
|
+
config.onWarn({ code, kind, data, message });
|
|
4385
4390
|
return;
|
|
4386
4391
|
}
|
|
4387
4392
|
if (config == null ? void 0 : config.muteWarn) return;
|
|
4388
|
-
|
|
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,
|
|
4393
|
-
const
|
|
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,
|
|
4399
|
+
config.onError({ code, kind, data, message, error });
|
|
4396
4400
|
return;
|
|
4397
4401
|
}
|
|
4398
4402
|
if (config == null ? void 0 : config.muteError) return;
|
|
4399
|
-
|
|
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-
|
|
4597
|
+
//# sourceMappingURL=chunk-BOTZI36B.js.map
|