@haiyue/animation-spec 0.1.0 → 0.2.0
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 +40 -6
- package/SPECIFICATION.md +12 -2
- package/bin/hya-live2d-convert.mjs +76 -0
- package/bin/{hya-convert.mjs → hya-lottie-convert.mjs} +1 -1
- package/dist/chunks/binary-DvuTJ_hy.js +1 -0
- package/dist/chunks/clip-baked-Dv-wjX9d.js +1 -0
- package/dist/chunks/errors-Bzs3GOD9.js +1 -0
- package/dist/chunks/expression-D1cKtNwM.js +1 -0
- package/dist/chunks/extensions-DxL4AxOC.js +1 -0
- package/dist/conversion.d.ts +1 -0
- package/dist/conversion.js +1 -0
- package/dist/cubism.d.ts +1 -0
- package/dist/cubism.js +1 -0
- package/dist/deformable2d.d.ts +1 -0
- package/dist/deformable2d.js +1 -0
- package/dist/index.d.ts +1 -10
- package/dist/index.js +1 -2927
- package/dist/live2d/clip-baked.d.ts +1 -0
- package/dist/live2d/clip-baked.js +1 -0
- package/dist/live2d.d.ts +1 -0
- package/dist/live2d.js +1 -0
- package/dist/lottie.d.ts +1 -62
- package/dist/lottie.js +1 -2642
- package/dist/native3d.d.ts +1 -2
- package/dist/native3d.js +1 -907
- package/dist/shared.d.ts +1493 -0
- package/package.json +30 -10
- package/schema/animation.schema.json +92 -0
- package/schema/deformable-mesh-2d-extension.schema.json +18 -0
- package/schema/deformable-mesh-2d.contract.json +58 -0
- package/schema/parameterized-rig-2d.contract.json +63 -0
- package/schema/parameterized-rig-2d.schema.json +57 -0
- package/schema/parameterized-rig-census-map.json +128 -0
- package/schema/responsive-layout-2d-census-map.json +49 -0
- package/schema/responsive-layout-2d.contract.json +58 -0
- package/schema/responsive-layout-2d.schema.json +34 -0
- package/schema/state-machine-v2-census-map.json +1 -0
- package/schema/state-machine-v2.contract.json +66 -0
- package/schema/state-machine-v2.schema.json +55 -0
- package/schema/vector-visual-census-map.json +120 -0
- package/schema/vector-visual.contract.json +47 -0
- package/schema/vector-visual.schema.json +72 -0
- package/dist/binary.d.ts +0 -7
- package/dist/chunks/types-l6nBVYwx.js +0 -8
- package/dist/chunks/types-l6nBVYwx.js.map +0 -1
- package/dist/errors.d.ts +0 -7
- package/dist/extensions.d.ts +0 -19
- package/dist/index.js.map +0 -1
- package/dist/lottie-merge-path.d.ts +0 -11
- package/dist/lottie.js.map +0 -1
- package/dist/native3d/Animation3DError.d.ts +0 -8
- package/dist/native3d/Animation3DParser.d.ts +0 -7
- package/dist/native3d/Animation3DTypes.d.ts +0 -285
- package/dist/native3d/index.d.ts +0 -5
- package/dist/native3d.js.map +0 -1
- package/dist/parser.d.ts +0 -2
- package/dist/state-machine.d.ts +0 -130
- package/dist/text-selector.d.ts +0 -2
- package/dist/types.d.ts +0 -419
- package/dist/validation.d.ts +0 -32
- package/src/binary.ts +0 -1441
- package/src/errors.ts +0 -18
- package/src/extensions.ts +0 -55
- package/src/index.ts +0 -90
- package/src/lottie-merge-path.ts +0 -204
- package/src/lottie.ts +0 -3073
- package/src/native3d/Animation3DError.ts +0 -20
- package/src/native3d/Animation3DParser.ts +0 -964
- package/src/native3d/Animation3DTypes.ts +0 -322
- package/src/native3d/index.ts +0 -14
- package/src/native3d.ts +0 -2
- package/src/parser.ts +0 -41
- package/src/state-machine.ts +0 -645
- package/src/text-selector.ts +0 -7
- package/src/types.ts +0 -483
- package/src/validation.ts +0 -1286
- package/test/fixtures/basic-lottie.json +0 -31
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"format": "haiyue-responsive-layout-2d-contract",
|
|
4
|
+
"version": 1,
|
|
5
|
+
"extension": "org.haiyue.layout-2d@1",
|
|
6
|
+
"sourceNeutral": true,
|
|
7
|
+
"sourceRuntimeDependency": false,
|
|
8
|
+
"coordinates": "screen-y-down",
|
|
9
|
+
"shaping": {
|
|
10
|
+
"stack": "haiyue-text-shaping@1",
|
|
11
|
+
"machineFontsAllowed": false,
|
|
12
|
+
"fontBytesAndIntegrityRequired": true,
|
|
13
|
+
"revisionFields": ["backendRevision", "unicodeVersion", "graphemeRevision", "bidiRevision"]
|
|
14
|
+
},
|
|
15
|
+
"evaluation": {
|
|
16
|
+
"passes": 2,
|
|
17
|
+
"explicitUpdatePorts": true,
|
|
18
|
+
"lateWritebackAfterAbort": false,
|
|
19
|
+
"componentTiming": ["simple", "remap", "mix"],
|
|
20
|
+
"scrollModes": ["clamped", "elastic", "infinite"],
|
|
21
|
+
"nSliceTileModes": ["stretch", "repeat", "mirror"]
|
|
22
|
+
},
|
|
23
|
+
"binary": {
|
|
24
|
+
"magic": "HYLA",
|
|
25
|
+
"major": 1,
|
|
26
|
+
"minor": 0,
|
|
27
|
+
"endianness": "little",
|
|
28
|
+
"headerBytes": 40,
|
|
29
|
+
"header": ["magic:u32", "major:u16", "minor:u16", "metadataOffset:u32", "metadataBytes:u32", "byteOffset:u32", "byteCount:u32", "totalBytes:u32", "flags:u32", "reserved0:u32", "reserved1:u32"],
|
|
30
|
+
"metadata": "utf8-json",
|
|
31
|
+
"bytePool": "embedded-assets-in-document-order",
|
|
32
|
+
"poolRanges": "canonical-no-alias-no-gap",
|
|
33
|
+
"alignment": 1
|
|
34
|
+
},
|
|
35
|
+
"limits": {
|
|
36
|
+
"maxInputBytes": 67108864,
|
|
37
|
+
"maxMetadataBytes": 4194304,
|
|
38
|
+
"maxAssets": 4096,
|
|
39
|
+
"maxAssetBytes": 268435456,
|
|
40
|
+
"maxTotalAssetBytes": 1073741824,
|
|
41
|
+
"maxArtboards": 8192,
|
|
42
|
+
"maxNodes": 250000,
|
|
43
|
+
"maxTextBytes": 33554432,
|
|
44
|
+
"maxGlyphs": 1000000,
|
|
45
|
+
"maxLines": 250000,
|
|
46
|
+
"maxLayoutPasses": 64,
|
|
47
|
+
"maxNestedDepth": 128,
|
|
48
|
+
"maxComponentInstances": 8192,
|
|
49
|
+
"maxListItems": 100000,
|
|
50
|
+
"maxVirtualizedWindow": 4096,
|
|
51
|
+
"maxNslicePatches": 1000000,
|
|
52
|
+
"maxGpuBytes": 536870912
|
|
53
|
+
},
|
|
54
|
+
"diagnostics": ["E_LAYOUT_FORMAT", "E_LAYOUT_LIMIT", "E_LAYOUT_NUMBER", "E_LAYOUT_REFERENCE", "E_LAYOUT_CYCLE", "E_LAYOUT_OSCILLATION", "E_LAYOUT_SHAPING", "E_LAYOUT_ASSET_INTEGRITY", "E_LAYOUT_BINARY"],
|
|
55
|
+
"networkPolicy": "host-explicit-deny-same-origin-or-allow-list",
|
|
56
|
+
"excludedGraphs": ["data-binding", "state-machine", "audio-playback", "script"],
|
|
57
|
+
"integration": { "publicExportOwner": "G13", "importAdapterOwner": "G10", "formalOracleOwner": "G11" }
|
|
58
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://haiyue.dev/schemas/animation/responsive-layout-2d.schema.json",
|
|
4
|
+
"title": "Source-neutral HYA responsive layout 2D v1",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"required": ["format", "version", "extension", "shaping", "assets", "textStyles", "textBlocks", "artboards", "instances"],
|
|
8
|
+
"properties": {
|
|
9
|
+
"format": { "const": "haiyue-responsive-layout-2d" },
|
|
10
|
+
"version": { "const": 1 },
|
|
11
|
+
"extension": { "const": "org.haiyue.layout-2d@1" },
|
|
12
|
+
"shaping": { "$ref": "#/$defs/shaping" },
|
|
13
|
+
"assets": { "type": "array", "maxItems": 4096, "items": { "$ref": "#/$defs/asset" } },
|
|
14
|
+
"textStyles": { "type": "array", "maxItems": 250000, "items": { "type": "object", "required": ["id", "fontAssets", "fontFamily", "fontWeight", "fontStyle", "fontSize", "lineHeight", "tracking", "alignment", "fills"] },
|
|
15
|
+
"textBlocks": { "type": "array", "maxItems": 250000, "items": { "type": "object", "required": ["id", "runs", "width", "height"] } },
|
|
16
|
+
"artboards": { "type": "array", "maxItems": 8192, "items": { "$ref": "#/$defs/artboard" } },
|
|
17
|
+
"instances": { "type": "array", "maxItems": 8192, "items": { "$ref": "#/$defs/instance" } }
|
|
18
|
+
},
|
|
19
|
+
"$defs": {
|
|
20
|
+
"id": { "type": "string", "minLength": 1, "maxLength": 1024 },
|
|
21
|
+
"positive": { "type": "number", "exclusiveMinimum": 0 },
|
|
22
|
+
"integrity": { "type": "string", "pattern": "^sha256-(?:[A-Za-z0-9+/]{43}=|[a-f0-9]{64})$" },
|
|
23
|
+
"shaping": { "type": "object", "additionalProperties": false, "required": ["stack", "backendRevision", "unicodeVersion", "graphemeRevision", "bidiRevision"], "properties": { "stack": { "const": "haiyue-text-shaping@1" }, "backendRevision": { "$ref": "#/$defs/id" }, "unicodeVersion": { "$ref": "#/$defs/id" }, "graphemeRevision": { "$ref": "#/$defs/id" }, "bidiRevision": { "$ref": "#/$defs/id" } } },
|
|
24
|
+
"source": { "oneOf": [
|
|
25
|
+
{ "type": "object", "additionalProperties": false, "required": ["kind", "data", "integrity"], "properties": { "kind": { "const": "embedded" }, "data": { "type": "array", "maxItems": 268435456, "items": { "type": "integer", "minimum": 0, "maximum": 255 } }, "integrity": { "$ref": "#/$defs/integrity" } } },
|
|
26
|
+
{ "type": "object", "additionalProperties": false, "required": ["kind", "uri", "integrity"], "properties": { "kind": { "const": "referenced" }, "uri": { "$ref": "#/$defs/id" }, "integrity": { "$ref": "#/$defs/integrity" } } },
|
|
27
|
+
{ "type": "object", "additionalProperties": false, "required": ["kind", "slot", "integrity"], "properties": { "kind": { "const": "hosted" }, "slot": { "$ref": "#/$defs/id" }, "fallbackAsset": { "$ref": "#/$defs/id" }, "integrity": { "$ref": "#/$defs/integrity" } } }
|
|
28
|
+
] },
|
|
29
|
+
"asset": { "type": "object", "required": ["id", "kind"], "properties": { "id": { "$ref": "#/$defs/id" }, "kind": { "enum": ["folder", "image", "font", "audio", "blob", "manifest", "text"] }, "source": { "$ref": "#/$defs/source" } } },
|
|
30
|
+
"node": { "type": "object", "additionalProperties": false, "required": ["id", "kind", "style"], "properties": { "id": { "$ref": "#/$defs/id" }, "parent": { "$ref": "#/$defs/id" }, "kind": { "enum": ["container", "leaf", "text", "image", "component", "list", "n-slice"] }, "style": { "type": "object" }, "visual": { "type": "object" }, "intrinsicSize": { "type": "array", "minItems": 2, "maxItems": 2 }, "text": { "$ref": "#/$defs/id" }, "asset": { "$ref": "#/$defs/id" }, "component": { "type": "object" }, "list": { "type": "object" }, "nSlice": { "type": "object" }, "scroll": { "type": "object" } } },
|
|
31
|
+
"artboard": { "type": "object", "additionalProperties": false, "required": ["id", "width", "height", "root", "nodes"], "properties": { "id": { "$ref": "#/$defs/id" }, "name": { "type": "string" }, "width": { "$ref": "#/$defs/positive" }, "height": { "$ref": "#/$defs/positive" }, "root": { "$ref": "#/$defs/id" }, "nodes": { "type": "array", "maxItems": 250000, "items": { "$ref": "#/$defs/node" } } } },
|
|
32
|
+
"instance": { "type": "object", "additionalProperties": false, "required": ["id", "artboard"], "properties": { "id": { "$ref": "#/$defs/id" }, "artboard": { "$ref": "#/$defs/id" }, "fit": { "enum": ["fill", "contain", "cover", "none", "scale-down"] }, "alignment": { "type": "array", "minItems": 2, "maxItems": 2 }, "transform": { "type": "array", "minItems": 6, "maxItems": 6 } } }
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"schemaVersion":1,"compatibilityTupleId":"rive-7.3-webgl2-2.40.0","family":"timeline-state-machine","goal":"g06-timeline-state-machine-parity","objects":[{"typeKey":25,"name":"KeyedObject"},{"typeKey":26,"name":"KeyedProperty"},{"typeKey":27,"name":"Animation"},{"typeKey":28,"name":"CubicEaseInterpolator"},{"typeKey":30,"name":"KeyFrameDouble"},{"typeKey":31,"name":"LinearAnimation"},{"typeKey":37,"name":"KeyFrameColor"},{"typeKey":50,"name":"KeyFrameId"},{"typeKey":53,"name":"StateMachine"},{"typeKey":56,"name":"StateMachineNumber"},{"typeKey":57,"name":"StateMachineLayer"},{"typeKey":58,"name":"StateMachineTrigger"},{"typeKey":59,"name":"StateMachineBool"},{"typeKey":61,"name":"AnimationState"},{"typeKey":62,"name":"AnyState"},{"typeKey":63,"name":"EntryState"},{"typeKey":64,"name":"ExitState"},{"typeKey":65,"name":"StateTransition"},{"typeKey":68,"name":"TransitionTriggerCondition"},{"typeKey":70,"name":"TransitionNumberCondition"},{"typeKey":71,"name":"TransitionBoolCondition"},{"typeKey":73,"name":"BlendStateDirect"},{"typeKey":75,"name":"BlendAnimation1D"},{"typeKey":76,"name":"BlendState1DInput"},{"typeKey":77,"name":"BlendAnimationDirect"},{"typeKey":78,"name":"BlendStateTransition"},{"typeKey":84,"name":"KeyFrameBool"},{"typeKey":95,"name":"NestedStateMachine"},{"typeKey":96,"name":"NestedSimpleAnimation"},{"typeKey":98,"name":"NestedRemapAnimation"},{"typeKey":122,"name":"NestedTrigger"},{"typeKey":123,"name":"NestedBool"},{"typeKey":124,"name":"NestedNumber"},{"typeKey":138,"name":"CubicValueInterpolator"},{"typeKey":142,"name":"KeyFrameString"},{"typeKey":163,"name":"CubicInterpolatorComponent"},{"typeKey":169,"name":"StateMachineFireEvent"},{"typeKey":171,"name":"KeyFrameCallback"},{"typeKey":174,"name":"ElasticInterpolator"},{"typeKey":450,"name":"KeyFrameUint"},{"typeKey":481,"name":"TransitionValueBooleanComparator"},{"typeKey":483,"name":"TransitionValueColorComparator"},{"typeKey":484,"name":"TransitionValueNumberComparator"},{"typeKey":485,"name":"TransitionValueEnumComparator"},{"typeKey":486,"name":"TransitionValueStringComparator"},{"typeKey":496,"name":"TransitionPropertyArtboardComparator"},{"typeKey":497,"name":"TransitionArtboardCondition"},{"typeKey":505,"name":"TransitionValueTriggerComparator"},{"typeKey":593,"name":"TransitionSelfComparator"},{"typeKey":601,"name":"TransitionValueIdComparator"},{"typeKey":602,"name":"TransitionValueAssetComparator"},{"typeKey":614,"name":"StateMachineFireTrigger"},{"typeKey":630,"name":"TransitionValueArtboardComparator"},{"typeKey":652,"name":"FocusActionTarget"},{"typeKey":667,"name":"TransitionPropertyComponentComparator"},{"typeKey":672,"name":"FocusActionTraversal"},{"typeKey":1037,"name":"FocusActionClear"},{"typeKey":1038,"name":"TransitionFocusCondition"},{"typeKey":1067,"name":"KeyFrameInt"}],"properties":[{"key":51,"owner":"KeyedObject","name":"objectId"},{"key":53,"owner":"KeyedProperty","name":"propertyKey"},{"key":55,"owner":"Animation","name":"name"},{"key":56,"owner":"LinearAnimation","name":"fps"},{"key":57,"owner":"LinearAnimation","name":"duration"},{"key":58,"owner":"LinearAnimation","name":"speed"},{"key":59,"owner":"LinearAnimation","name":"loopValue"},{"key":60,"owner":"LinearAnimation","name":"workStart"},{"key":61,"owner":"LinearAnimation","name":"workEnd"},{"key":62,"owner":"LinearAnimation","name":"enableWorkArea"},{"key":63,"owner":"CubicInterpolator","name":"x1"},{"key":64,"owner":"CubicInterpolator","name":"y1"},{"key":65,"owner":"CubicInterpolator","name":"x2"},{"key":66,"owner":"CubicInterpolator","name":"y2"},{"key":67,"owner":"KeyFrame","name":"frame"},{"key":68,"owner":"InterpolatingKeyFrame","name":"interpolationType"},{"key":69,"owner":"InterpolatingKeyFrame","name":"interpolatorId"},{"key":70,"owner":"KeyFrameDouble","name":"value"},{"key":88,"owner":"KeyFrameColor","name":"value"},{"key":122,"owner":"KeyFrameId","name":"value"},{"key":138,"owner":"StateMachineComponent","name":"name"},{"key":140,"owner":"StateMachineNumber","name":"value"},{"key":141,"owner":"StateMachineBool","name":"value"},{"key":149,"owner":"AnimationState","name":"animationId"},{"key":151,"owner":"StateTransition","name":"stateToId"},{"key":152,"owner":"StateTransition","name":"flags"},{"key":155,"owner":"TransitionInputCondition","name":"inputId"},{"key":156,"owner":"TransitionValueCondition","name":"opValue"},{"key":157,"owner":"TransitionNumberCondition","name":"value"},{"key":158,"owner":"StateTransition","name":"duration"},{"key":160,"owner":"StateTransition","name":"exitTime"},{"key":165,"owner":"BlendAnimation","name":"animationId"},{"key":166,"owner":"BlendAnimation1D","name":"value"},{"key":167,"owner":"BlendState1DInput","name":"inputId"},{"key":168,"owner":"BlendAnimationDirect","name":"inputId"},{"key":171,"owner":"BlendStateTransition","name":"exitBlendAnimationId"},{"key":181,"owner":"KeyFrameBool","name":"value"},{"key":199,"owner":"NestedSimpleAnimation","name":"speed"},{"key":200,"owner":"NestedLinearAnimation","name":"mix"},{"key":201,"owner":"NestedSimpleAnimation","name":"isPlaying"},{"key":202,"owner":"NestedRemapAnimation","name":"time"},{"key":237,"owner":"NestedInput","name":"inputId"},{"key":238,"owner":"NestedBool","name":"nestedValue"},{"key":239,"owner":"NestedNumber","name":"nestedValue"},{"key":280,"owner":"KeyFrameString","name":"value"},{"key":292,"owner":"AdvanceableState","name":"speed"},{"key":297,"owner":"BlendAnimationDirect","name":"mixValue"},{"key":298,"owner":"BlendAnimationDirect","name":"blendSource"},{"key":337,"owner":"CubicInterpolatorComponent","name":"x1"},{"key":338,"owner":"CubicInterpolatorComponent","name":"y1"},{"key":339,"owner":"CubicInterpolatorComponent","name":"x2"},{"key":340,"owner":"CubicInterpolatorComponent","name":"y2"},{"key":349,"owner":"StateTransition","name":"interpolationType"},{"key":350,"owner":"StateTransition","name":"interpolatorId"},{"key":376,"owner":"LinearAnimation","name":"quantize"},{"key":392,"owner":"StateMachineFireEvent","name":"eventId"},{"key":393,"owner":"StateMachineFireAction","name":"occursValue"},{"key":401,"owner":"NestedTrigger","name":"fire"},{"key":405,"owner":"ElasticInterpolator","name":"easingValue"},{"key":406,"owner":"ElasticInterpolator","name":"amplitude"},{"key":407,"owner":"ElasticInterpolator","name":"period"},{"key":536,"owner":"LayerState","name":"flags"},{"key":537,"owner":"StateTransition","name":"randomWeight"},{"key":631,"owner":"KeyFrameUint","name":"value"},{"key":647,"owner":"TransitionValueBooleanComparator","name":"value"},{"key":651,"owner":"TransitionValueColorComparator","name":"value"},{"key":652,"owner":"TransitionValueNumberComparator","name":"value"},{"key":653,"owner":"TransitionValueIdComparator","name":"value"},{"key":654,"owner":"TransitionValueStringComparator","name":"value"},{"key":677,"owner":"TransitionPropertyArtboardComparator","name":"propertyType"},{"key":689,"owner":"TransitionValueTriggerComparator","name":"value"},{"key":871,"owner":"StateMachineFireTrigger","name":"viewModelPathIds"},{"key":952,"owner":"FocusActionTarget","name":"targetId"},{"key":977,"owner":"TransitionPropertyComponentComparator","name":"objectId"},{"key":978,"owner":"TransitionPropertyComponentComparator","name":"propertyKey"},{"key":1011,"owner":"FocusActionTraversal","name":"traversalKind"},{"key":1068,"owner":"KeyFrameInt","name":"value"}]}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"extension": "org.haiyue.animation-state-machine@2",
|
|
4
|
+
"format": "haiyue-animation-state-machine@2",
|
|
5
|
+
"sourceNeutral": true,
|
|
6
|
+
"time": {
|
|
7
|
+
"unit": "finite-seconds",
|
|
8
|
+
"seek": "reset-snapshot-and-replay",
|
|
9
|
+
"sameTimestampOrder": ["layer-order", "action-order", "track-order", "key-order"],
|
|
10
|
+
"playback": ["one-shot", "loop", "ping-pong"],
|
|
11
|
+
"speed": "finite-positive-zero-or-negative",
|
|
12
|
+
"remap": "absolute-local-seconds",
|
|
13
|
+
"angle": "shortest-signed-arc-radians"
|
|
14
|
+
},
|
|
15
|
+
"interpolation": {
|
|
16
|
+
"continuous": ["linear", "cubic-ease", "cubic-value", "elastic"],
|
|
17
|
+
"discrete": ["hold"],
|
|
18
|
+
"valueKinds": ["number", "vector", "color", "boolean", "string", "id", "integer", "unsigned", "callback"]
|
|
19
|
+
},
|
|
20
|
+
"channelFamilies": {
|
|
21
|
+
"transform": { "policies": ["override", "additive"], "transition": "blend" },
|
|
22
|
+
"paint-path": { "policies": ["override", "additive", "discrete"], "transition": "blend-or-select" },
|
|
23
|
+
"rig": { "policies": ["override", "additive", "discrete"], "transition": "blend-or-select" },
|
|
24
|
+
"text-layout": { "policies": ["override", "additive", "discrete"], "transition": "blend-or-select" },
|
|
25
|
+
"resource-data": { "policies": ["override", "additive", "discrete", "ownership"], "transition": "transfer-owner" },
|
|
26
|
+
"visibility-order": { "policies": ["discrete"], "transition": "stable-priority-select" },
|
|
27
|
+
"event-audio-script": { "policies": ["ownership"], "transition": "exactly-once-transaction" }
|
|
28
|
+
},
|
|
29
|
+
"stateGraph": {
|
|
30
|
+
"pseudoStates": ["@entry", "@any", "@exit"],
|
|
31
|
+
"motions": ["clip", "blend-1d", "blend-2d", "blend-additive", "nested"],
|
|
32
|
+
"transitionPriority": "declaration-order",
|
|
33
|
+
"conditionNormalForm": "OR-of-AND-groups",
|
|
34
|
+
"triggerConsumption": "selected-and-committed-transition-only",
|
|
35
|
+
"features": ["exit-time", "pause-when-exiting", "duration", "interpolation", "destination-offset", "interruption-metadata", "deterministic-random-weight"]
|
|
36
|
+
},
|
|
37
|
+
"ports": {
|
|
38
|
+
"observableAndCustomCondition": { "transaction": ["begin", "invoke", "commit", "rollback"], "commit": "infallible", "implementationOwner": "external-capability" },
|
|
39
|
+
"sideEffect": { "transaction": ["begin", "invoke", "commit", "rollback"], "commit": "atomic-and-infallible", "missingPort": "structured-error", "delivery": "exactly-once-per-occurrence", "lifecycle": ["pause", "resume", "reset", "stop", "dispose"] },
|
|
40
|
+
"resourceOwnership": { "transaction": ["begin", "transfer", "commit", "rollback"], "commit": "atomic-and-infallible", "missingPort": "structured-error", "release": ["restore-default", "reset", "dispose"] },
|
|
41
|
+
"nested": { "ownership": "component-instance", "lifecycle": ["create", "reset", "pause", "resume", "stop", "dispose"] }
|
|
42
|
+
},
|
|
43
|
+
"census": {
|
|
44
|
+
"map": "state-machine-v2-census-map.json",
|
|
45
|
+
"objectCount": 59,
|
|
46
|
+
"propertyCount": 77,
|
|
47
|
+
"solutions": {
|
|
48
|
+
"keyed-properties": "typed-channel-and-track",
|
|
49
|
+
"linear-animation-work-area-quantize": "timeline-clip",
|
|
50
|
+
"cubic-and-elastic-interpolators": "timeline-interpolation",
|
|
51
|
+
"entry-any-exit-and-layer-state": "state-graph",
|
|
52
|
+
"direct-and-1d-blends": "blend-additive-and-blend-1d",
|
|
53
|
+
"blend-transition-exit-animation": "transition-exit-motion",
|
|
54
|
+
"nested-animation-input-remap-mix-playing": "nested-motion-and-component-owner",
|
|
55
|
+
"value-property-focus-and-custom-comparators": "transactional-observable-condition-port",
|
|
56
|
+
"fire-event-trigger-focus-actions": "transactional-side-effect-channel",
|
|
57
|
+
"random-weight": "seeded-rollback-safe-runtime-rng"
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
"migration": {
|
|
61
|
+
"from": "haiyue-animation-state-machine@1",
|
|
62
|
+
"execution": "normalize-to-v2-before-runtime",
|
|
63
|
+
"noSecondSampler": true,
|
|
64
|
+
"parentTrackPolicy": "compiler-supplied-or-explicit-warning"
|
|
65
|
+
}
|
|
66
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://haiyue.dev/schema/state-machine-v2.schema.json",
|
|
4
|
+
"title": "HaiYue source-neutral animation state machine v2",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"required": ["format", "extension", "channels", "clips", "stateMachines"],
|
|
8
|
+
"properties": {
|
|
9
|
+
"format": { "const": "haiyue-animation-state-machine@2" },
|
|
10
|
+
"extension": { "const": "org.haiyue.animation-state-machine@2" },
|
|
11
|
+
"channels": { "type": "array", "items": { "$ref": "#/$defs/channel" }, "maxItems": 1000000 },
|
|
12
|
+
"clips": { "type": "array", "items": { "$ref": "#/$defs/clip" }, "maxItems": 10000 },
|
|
13
|
+
"stateMachines": { "type": "array", "items": { "$ref": "#/$defs/machine" }, "maxItems": 10000 },
|
|
14
|
+
"components": { "type": "array", "items": { "$ref": "#/$defs/component" }, "maxItems": 8192 }
|
|
15
|
+
},
|
|
16
|
+
"$defs": {
|
|
17
|
+
"id": { "type": "string", "minLength": 1, "maxLength": 1024 },
|
|
18
|
+
"finite": { "type": "number" },
|
|
19
|
+
"value": { "oneOf": [{ "type": "number" }, { "type": "boolean" }, { "type": "string" }, { "type": "null" }, { "type": "array", "items": { "type": "number" } }, { "type": "object" }] },
|
|
20
|
+
"channel": {
|
|
21
|
+
"type": "object", "additionalProperties": false,
|
|
22
|
+
"required": ["id", "target", "path", "family", "valueKind", "policy"],
|
|
23
|
+
"properties": {
|
|
24
|
+
"id": { "$ref": "#/$defs/id" }, "target": { "$ref": "#/$defs/id" }, "path": { "$ref": "#/$defs/id" },
|
|
25
|
+
"family": { "enum": ["transform", "paint-path", "rig", "text-layout", "resource-data", "visibility-order", "event-audio-script"] },
|
|
26
|
+
"valueKind": { "enum": ["number", "vector", "color", "boolean", "string", "id", "integer", "unsigned", "callback"] },
|
|
27
|
+
"valueSize": { "type": "integer", "minimum": 1 }, "numericMode": { "enum": ["linear", "angle-radians"] }, "defaultValue": { "$ref": "#/$defs/value" },
|
|
28
|
+
"policy": { "enum": ["override", "additive", "discrete", "ownership"] }, "effectKind": { "enum": ["event", "audio", "script"] }
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"interpolation": {
|
|
32
|
+
"oneOf": [
|
|
33
|
+
{ "type": "object", "additionalProperties": false, "required": ["kind"], "properties": { "kind": { "enum": ["linear", "hold"] } } },
|
|
34
|
+
{ "type": "object", "additionalProperties": false, "required": ["kind", "controls"], "properties": { "kind": { "const": "cubic-ease" }, "controls": { "type": "array", "prefixItems": [{ "type": "number", "minimum": 0, "maximum": 1 }, { "type": "number" }, { "type": "number", "minimum": 0, "maximum": 1 }, { "type": "number" }], "minItems": 4, "maxItems": 4 } } },
|
|
35
|
+
{ "type": "object", "additionalProperties": false, "required": ["kind", "outTangent", "inTangent"], "properties": { "kind": { "const": "cubic-value" }, "outTangent": { "type": "array", "items": { "type": "number" } }, "inTangent": { "type": "array", "items": { "type": "number" } } } },
|
|
36
|
+
{ "type": "object", "additionalProperties": false, "required": ["kind", "easing", "amplitude", "period"], "properties": { "kind": { "const": "elastic" }, "easing": { "enum": ["in", "out", "in-out"] }, "amplitude": { "type": "number", "minimum": 0 }, "period": { "type": "number", "exclusiveMinimum": 0 } } }
|
|
37
|
+
]
|
|
38
|
+
},
|
|
39
|
+
"key": { "type": "object", "additionalProperties": false, "required": ["time", "value"], "properties": { "time": { "type": "number", "minimum": 0 }, "value": { "$ref": "#/$defs/value" }, "interpolation": { "$ref": "#/$defs/interpolation" } } },
|
|
40
|
+
"track": { "type": "object", "additionalProperties": false, "required": ["id", "channel", "keys"], "properties": { "id": { "$ref": "#/$defs/id" }, "channel": { "$ref": "#/$defs/id" }, "keys": { "type": "array", "items": { "$ref": "#/$defs/key" }, "minItems": 1 } } },
|
|
41
|
+
"clip": { "type": "object", "additionalProperties": false, "required": ["id", "duration", "tracks"], "properties": { "id": { "$ref": "#/$defs/id" }, "name": { "type": "string" }, "duration": { "type": "number", "minimum": 0 }, "fps": { "type": "number", "exclusiveMinimum": 0 }, "quantize": { "type": "boolean" }, "workArea": { "type": "object", "additionalProperties": false, "required": ["start", "end"], "properties": { "start": { "type": "number", "minimum": 0 }, "end": { "type": "number", "minimum": 0 } } }, "tracks": { "type": "array", "items": { "$ref": "#/$defs/track" } } } },
|
|
42
|
+
"motion": {
|
|
43
|
+
"type": "object", "required": ["kind"],
|
|
44
|
+
"properties": { "kind": { "enum": ["clip", "blend-1d", "blend-2d", "blend-additive", "nested"] }, "clip": { "$ref": "#/$defs/id" }, "component": { "$ref": "#/$defs/id" }, "input": { "$ref": "#/$defs/id" }, "inputX": { "$ref": "#/$defs/id" }, "inputY": { "$ref": "#/$defs/id" }, "algorithm": { "enum": ["cartesian", "directional"] }, "base": { "$ref": "#/$defs/motion" }, "children": { "type": "array", "minItems": 1 }, "speed": { "type": "number" }, "speedInput": { "$ref": "#/$defs/id" }, "playback": { "enum": ["one-shot", "loop", "ping-pong"] }, "timeRemapInput": { "$ref": "#/$defs/id" }, "mixInput": { "$ref": "#/$defs/id" }, "playingInput": { "$ref": "#/$defs/id" }, "inputBindings": { "type": "object", "additionalProperties": { "$ref": "#/$defs/id" } } }
|
|
45
|
+
},
|
|
46
|
+
"input": { "type": "object", "additionalProperties": false, "required": ["id", "type"], "properties": { "id": { "$ref": "#/$defs/id" }, "type": { "enum": ["number", "integer", "boolean", "trigger"] }, "defaultValue": { "oneOf": [{ "type": "number" }, { "type": "boolean" }] } } },
|
|
47
|
+
"condition": { "type": "object", "required": ["kind"], "properties": { "kind": { "enum": ["input", "trigger", "observable", "custom"] }, "input": { "$ref": "#/$defs/id" }, "protocol": { "$ref": "#/$defs/id" }, "port": { "$ref": "#/$defs/id" }, "comparator": { "enum": ["equal", "not-equal", "greater", "greater-or-equal", "less", "less-or-equal"] }, "value": { "$ref": "#/$defs/value" }, "arguments": { "type": "object" } } },
|
|
48
|
+
"effect": { "type": "object", "additionalProperties": false, "required": ["channel", "phase"], "properties": { "channel": { "$ref": "#/$defs/id" }, "phase": { "enum": ["start", "complete"] }, "payload": { "$ref": "#/$defs/value" } } },
|
|
49
|
+
"state": { "type": "object", "additionalProperties": false, "required": ["id", "motion"], "properties": { "id": { "$ref": "#/$defs/id" }, "motion": { "$ref": "#/$defs/motion" }, "entryEffects": { "type": "array", "items": { "$ref": "#/$defs/effect" } }, "exitEffects": { "type": "array", "items": { "$ref": "#/$defs/effect" } } } },
|
|
50
|
+
"transition": { "type": "object", "additionalProperties": false, "required": ["id", "from", "to", "conditionGroups", "duration"], "properties": { "id": { "$ref": "#/$defs/id" }, "from": { "$ref": "#/$defs/id" }, "to": { "$ref": "#/$defs/id" }, "conditionGroups": { "type": "array", "items": { "type": "array", "items": { "$ref": "#/$defs/condition" }, "minItems": 1 } }, "exitTime": { "type": "number", "minimum": 0 }, "randomWeight": { "type": "number", "minimum": 0, "maximum": 1 }, "pauseWhenExiting": { "type": "boolean" }, "duration": { "type": "number", "minimum": 0 }, "destinationOffset": { "type": "number", "minimum": 0 }, "interruption": { "enum": ["none", "source", "destination", "source-then-destination", "destination-then-source"] }, "exitMotion": { "$ref": "#/$defs/motion" }, "interpolation": { "$ref": "#/$defs/interpolation" }, "effects": { "type": "array", "items": { "$ref": "#/$defs/effect" } } } },
|
|
51
|
+
"layer": { "type": "object", "additionalProperties": false, "required": ["id", "order", "states", "transitions"], "properties": { "id": { "$ref": "#/$defs/id" }, "order": { "type": "integer" }, "weight": { "type": "number", "minimum": 0, "maximum": 1 }, "weightInput": { "$ref": "#/$defs/id" }, "mode": { "enum": ["override", "additive"] }, "mask": { "type": "object", "properties": { "include": { "type": "array", "items": { "$ref": "#/$defs/id" } }, "exclude": { "type": "array", "items": { "$ref": "#/$defs/id" } } }, "additionalProperties": false }, "states": { "type": "array", "items": { "$ref": "#/$defs/state" }, "minItems": 1 }, "transitions": { "type": "array", "items": { "$ref": "#/$defs/transition" }, "minItems": 1 } } },
|
|
52
|
+
"machine": { "type": "object", "additionalProperties": false, "required": ["id", "inputs", "layers"], "properties": { "id": { "$ref": "#/$defs/id" }, "inputs": { "type": "array", "items": { "$ref": "#/$defs/input" } }, "layers": { "type": "array", "items": { "$ref": "#/$defs/layer" }, "minItems": 1 } } },
|
|
53
|
+
"component": { "type": "object", "additionalProperties": false, "required": ["id", "target", "source", "playback"], "properties": { "id": { "$ref": "#/$defs/id" }, "target": { "$ref": "#/$defs/id" }, "source": { "oneOf": [{ "type": "object", "additionalProperties": false, "required": ["kind", "clip"], "properties": { "kind": { "const": "clip" }, "clip": { "$ref": "#/$defs/id" } } }, { "type": "object", "additionalProperties": false, "required": ["kind", "machine"], "properties": { "kind": { "const": "state-machine" }, "machine": { "$ref": "#/$defs/id" } } }] }, "playback": { "enum": ["simple", "remap", "mix", "state-machine"] }, "exposedInputs": { "type": "array", "items": { "$ref": "#/$defs/id" } }, "exposedEvents": { "type": "array", "items": { "$ref": "#/$defs/id" } } } }
|
|
54
|
+
}
|
|
55
|
+
}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"format": "haiyue-vector-visual-census-map",
|
|
4
|
+
"version": 1,
|
|
5
|
+
"source": "M07 frozen visual census",
|
|
6
|
+
"sourceSpecific": true,
|
|
7
|
+
"runtimePayloadSourceNeutral": true,
|
|
8
|
+
"objects": {
|
|
9
|
+
"Shape": "nodes[].geometries[] + nodes[].paints[]",
|
|
10
|
+
"Ellipse": "nodes[].geometries[kind=ellipse]",
|
|
11
|
+
"StraightVertex": "nodes[].geometries[kind=path]",
|
|
12
|
+
"CubicDetachedVertex": "nodes[].geometries[kind=path].commands/values",
|
|
13
|
+
"Rectangle": "nodes[].geometries[kind=rectangle]",
|
|
14
|
+
"Triangle": "nodes[].geometries[kind=triangle]",
|
|
15
|
+
"PointsPath": "nodes[].geometries[kind=path]",
|
|
16
|
+
"RadialGradient": "nodes[].paints[].source[kind=radial-gradient]",
|
|
17
|
+
"SolidColor": "nodes[].paints[].source[kind=solid]",
|
|
18
|
+
"GradientStop": "nodes[].paints[].source.stops[]",
|
|
19
|
+
"Fill": "nodes[].paints[kind=fill]",
|
|
20
|
+
"LinearGradient": "nodes[].paints[].source[kind=linear-gradient]",
|
|
21
|
+
"Stroke": "nodes[].paints[kind=stroke]",
|
|
22
|
+
"CubicAsymmetricVertex": "nodes[].geometries[kind=path].commands/values",
|
|
23
|
+
"CubicMirroredVertex": "nodes[].geometries[kind=path].commands/values",
|
|
24
|
+
"ClippingShape": "clips[]",
|
|
25
|
+
"TrimPath": "nodes[].paints[kind=stroke].trim",
|
|
26
|
+
"DrawTarget": "nodes[].effectGroups[].target",
|
|
27
|
+
"DrawRules": "nodes[].drawOrder + nodes[].effectGroups[]",
|
|
28
|
+
"Polygon": "nodes[].geometries[kind=polygon]",
|
|
29
|
+
"Star": "nodes[].geometries[kind=star]",
|
|
30
|
+
"Image": "resources[kind=image] + nodes[].geometries[kind=image]",
|
|
31
|
+
"DashPath": "nodes[].paints[kind=stroke].dashOffset/dashUnits",
|
|
32
|
+
"Dash": "nodes[].paints[kind=stroke].dash[]",
|
|
33
|
+
"ForegroundLayoutDrawable": "nodes[].drawOrder",
|
|
34
|
+
"Feather": "nodes[].effectGroups[].effects[kind=feather]",
|
|
35
|
+
"ListPath": "nodes[].geometries[]",
|
|
36
|
+
"TargetEffect": "nodes[].effectGroups[].target",
|
|
37
|
+
"GroupEffect": "nodes[].effectGroups[]"
|
|
38
|
+
},
|
|
39
|
+
"properties": {
|
|
40
|
+
"ParametricPath.width": "geometries[].width",
|
|
41
|
+
"ParametricPath.height": "geometries[].height",
|
|
42
|
+
"Vertex.x": "geometries[kind=path].values[]",
|
|
43
|
+
"Vertex.y": "geometries[kind=path].values[]",
|
|
44
|
+
"StraightVertex.radius": "geometries procedural cornerRadius or baked path values",
|
|
45
|
+
"Rectangle.cornerRadiusTL": "geometries[kind=rectangle].radii[0]",
|
|
46
|
+
"PointsCommonPath.isClosed": "geometries[kind=path].commands ends Z",
|
|
47
|
+
"LinearGradient.startY": "paints[].source.start[1]",
|
|
48
|
+
"LinearGradient.endX": "paints[].source.end[0]",
|
|
49
|
+
"LinearGradient.endY": "paints[].source.end[1]",
|
|
50
|
+
"SolidColor.colorValue": "paints[].source.color",
|
|
51
|
+
"GradientStop.colorValue": "paints[].source.stops[].color",
|
|
52
|
+
"GradientStop.position": "paints[].source.stops[].offset",
|
|
53
|
+
"Fill.fillRule": "paints[kind=fill].fillRule",
|
|
54
|
+
"ShapePaint.isVisible": "paints[].visible",
|
|
55
|
+
"LinearGradient.startX": "paints[].source.start[0]",
|
|
56
|
+
"LinearGradient.opacity": "paints[].opacity",
|
|
57
|
+
"Stroke.thickness": "paints[kind=stroke].width",
|
|
58
|
+
"Stroke.cap": "paints[kind=stroke].cap",
|
|
59
|
+
"Stroke.join": "paints[kind=stroke].join",
|
|
60
|
+
"Stroke.transformAffectsStroke": "paints[kind=stroke].transformMode",
|
|
61
|
+
"CubicAsymmetricVertex.rotation": "path cubic control values",
|
|
62
|
+
"CubicAsymmetricVertex.inDistance": "path cubic control values",
|
|
63
|
+
"CubicAsymmetricVertex.outDistance": "path cubic control values",
|
|
64
|
+
"CubicMirroredVertex.rotation": "path cubic control values",
|
|
65
|
+
"CubicMirroredVertex.distance": "path cubic control values",
|
|
66
|
+
"CubicDetachedVertex.inRotation": "path cubic control values",
|
|
67
|
+
"CubicDetachedVertex.inDistance": "path cubic control values",
|
|
68
|
+
"CubicDetachedVertex.outRotation": "path cubic control values",
|
|
69
|
+
"CubicDetachedVertex.outDistance": "path cubic control values",
|
|
70
|
+
"ClippingShape.sourceId": "clips[].source",
|
|
71
|
+
"ClippingShape.fillRule": "clips[].fillRule",
|
|
72
|
+
"ClippingShape.isVisible": "nodes[].visible",
|
|
73
|
+
"TrimPath.start": "paints[kind=stroke].trim.start",
|
|
74
|
+
"TrimPath.end": "paints[kind=stroke].trim.end",
|
|
75
|
+
"TrimPath.offset": "paints[kind=stroke].trim.offset",
|
|
76
|
+
"TrimPath.modeValue": "paints[kind=stroke].trim.mode",
|
|
77
|
+
"ColorChannels.colorRed": "color[0]",
|
|
78
|
+
"DrawTarget.drawableId": "effectGroups[].target",
|
|
79
|
+
"DrawTarget.placementValue": "effectGroups array order",
|
|
80
|
+
"DrawRules.drawTargetId": "effectGroups[].target",
|
|
81
|
+
"ParametricPath.originX": "geometry local x/cx + node.transform",
|
|
82
|
+
"ParametricPath.originY": "geometry local y/cy + node.transform",
|
|
83
|
+
"Polygon.points": "geometries[kind=polygon].points",
|
|
84
|
+
"Polygon.cornerRadius": "geometries[kind=polygon].cornerRadius",
|
|
85
|
+
"Star.innerRadius": "geometries[kind=star].innerRadius",
|
|
86
|
+
"Path.pathFlags": "path fillRule/isHole/topologyPolicy",
|
|
87
|
+
"ColorChannels.colorGreen": "color[1]",
|
|
88
|
+
"Rectangle.cornerRadiusTR": "geometries[kind=rectangle].radii[1]",
|
|
89
|
+
"Rectangle.cornerRadiusBL": "geometries[kind=rectangle].radii[3]",
|
|
90
|
+
"Rectangle.cornerRadiusBR": "geometries[kind=rectangle].radii[2]",
|
|
91
|
+
"Rectangle.linkCornerRadius": "four equal geometries[kind=rectangle].radii entries",
|
|
92
|
+
"Image.assetId": "geometries[kind=image].resource",
|
|
93
|
+
"ColorChannels.colorBlue": "color[2]",
|
|
94
|
+
"ColorChannels.colorAlpha": "color[3]",
|
|
95
|
+
"Image.originX": "geometries[kind=image].x + alignment[0]",
|
|
96
|
+
"Image.originY": "geometries[kind=image].y + alignment[1]",
|
|
97
|
+
"DashPath.offset": "paints[kind=stroke].dashOffset",
|
|
98
|
+
"DashPath.offsetIsPercentage": "paints[kind=stroke].dashUnits",
|
|
99
|
+
"Dash.length": "paints[kind=stroke].dash[]",
|
|
100
|
+
"Dash.lengthIsPercentage": "paints[kind=stroke].dashUnits",
|
|
101
|
+
"ShapePaint.blendModeValue": "paints[].blendMode",
|
|
102
|
+
"Feather.spaceValue": "effects[kind=feather].space",
|
|
103
|
+
"Feather.strength": "effects[kind=feather].radiusX/radiusY",
|
|
104
|
+
"Feather.offsetX": "effects[kind=feather].offsetX",
|
|
105
|
+
"Feather.offsetY": "effects[kind=feather].offsetY",
|
|
106
|
+
"Feather.inner": "effects[kind=feather].inner",
|
|
107
|
+
"Path.isHole": "geometries[kind=path].isHole",
|
|
108
|
+
"Shape.length": "geometries.length",
|
|
109
|
+
"ListPath.listSource": "geometries array source ordering",
|
|
110
|
+
"TargetEffect.targetId": "effectGroups[].target",
|
|
111
|
+
"Image.fit": "geometries[kind=image].fit",
|
|
112
|
+
"Image.alignmentX": "geometries[kind=image].alignment[0]",
|
|
113
|
+
"Image.alignmentY": "geometries[kind=image].alignment[1]",
|
|
114
|
+
"Image.samplerFilter": "resources[kind=image].filter",
|
|
115
|
+
"Image.samplerWrapX": "resources[kind=image].wrapX",
|
|
116
|
+
"Image.samplerWrapY": "resources[kind=image].wrapY"
|
|
117
|
+
},
|
|
118
|
+
"counts": { "objects": 29, "properties": 77 },
|
|
119
|
+
"unmapped": []
|
|
120
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"format": "haiyue-vector-visual-contract",
|
|
4
|
+
"version": 1,
|
|
5
|
+
"dataFormat": "haiyue-vector-visual",
|
|
6
|
+
"dataVersion": 1,
|
|
7
|
+
"sourceNeutral": true,
|
|
8
|
+
"sourceRuntimeDependency": false,
|
|
9
|
+
"coordinates": "screen-y-down",
|
|
10
|
+
"topologyPolicies": ["stable", "discrete"],
|
|
11
|
+
"paintOrder": "array-order",
|
|
12
|
+
"compositeOrder": "clip-depth-first-then-paint-order",
|
|
13
|
+
"customPathExecution": "external-only",
|
|
14
|
+
"limits": {
|
|
15
|
+
"maxNodes": 4096,
|
|
16
|
+
"maxPathsPerNode": 64,
|
|
17
|
+
"maxCommands": 1000000,
|
|
18
|
+
"maxValues": 8000000,
|
|
19
|
+
"maxKeyframes": 36000,
|
|
20
|
+
"maxGradientStops": 256,
|
|
21
|
+
"maxPaintsPerNode": 64,
|
|
22
|
+
"maxEffectsPerGroup": 32,
|
|
23
|
+
"maxEffectGroupsPerNode": 32,
|
|
24
|
+
"maxClipNodes": 4096,
|
|
25
|
+
"maxClipDepth": 64,
|
|
26
|
+
"maxVertices": 2000000,
|
|
27
|
+
"maxIndices": 6000000,
|
|
28
|
+
"maxDashEntries": 256,
|
|
29
|
+
"maxFeather": 4096,
|
|
30
|
+
"maxOffscreenPixels": 268435456,
|
|
31
|
+
"maxImagePixels": 268435456
|
|
32
|
+
},
|
|
33
|
+
"diagnostics": [
|
|
34
|
+
"E_VECTOR_FORMAT",
|
|
35
|
+
"E_VECTOR_LIMIT",
|
|
36
|
+
"E_VECTOR_NUMBER",
|
|
37
|
+
"E_VECTOR_REFERENCE",
|
|
38
|
+
"E_VECTOR_TOPOLOGY",
|
|
39
|
+
"E_VECTOR_CYCLE"
|
|
40
|
+
],
|
|
41
|
+
"integration": {
|
|
42
|
+
"publicExportOwner": "G13",
|
|
43
|
+
"importAdapterOwner": "G12",
|
|
44
|
+
"scriptPortOwner": "G09",
|
|
45
|
+
"formalOracleOwner": "G11"
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://haiyue.dev/schemas/animation/vector-visual.schema.json",
|
|
4
|
+
"title": "Source-neutral HYA vector visual document v1",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"required": ["format", "version", "width", "height", "nodes"],
|
|
8
|
+
"properties": {
|
|
9
|
+
"format": { "const": "haiyue-vector-visual" },
|
|
10
|
+
"version": { "const": 1 },
|
|
11
|
+
"width": { "$ref": "#/$defs/positive" },
|
|
12
|
+
"height": { "$ref": "#/$defs/positive" },
|
|
13
|
+
"duration": { "$ref": "#/$defs/nonNegative" },
|
|
14
|
+
"resources": { "type": "array", "items": { "$ref": "#/$defs/imageResource" } },
|
|
15
|
+
"nodes": { "type": "array", "maxItems": 4096, "items": { "$ref": "#/$defs/node" } },
|
|
16
|
+
"clips": { "type": "array", "maxItems": 4096, "items": { "$ref": "#/$defs/clip" } }
|
|
17
|
+
},
|
|
18
|
+
"$defs": {
|
|
19
|
+
"finite": { "type": "number" },
|
|
20
|
+
"positive": { "type": "number", "exclusiveMinimum": 0 },
|
|
21
|
+
"nonNegative": { "type": "number", "minimum": 0 },
|
|
22
|
+
"id": { "type": "string", "minLength": 1, "maxLength": 256 },
|
|
23
|
+
"vec2": { "type": "array", "minItems": 2, "maxItems": 2, "items": { "$ref": "#/$defs/finite" } },
|
|
24
|
+
"color": { "type": "array", "minItems": 4, "maxItems": 4, "items": { "type": "number", "minimum": 0, "maximum": 1 } },
|
|
25
|
+
"blend": { "enum": ["normal", "multiply", "screen", "overlay", "darken", "lighten", "color-dodge", "color-burn", "hard-light", "soft-light", "difference", "exclusion", "hue", "saturation", "color", "luminosity", "add", "subtract"] },
|
|
26
|
+
"source": {
|
|
27
|
+
"oneOf": [
|
|
28
|
+
{ "type": "object", "additionalProperties": false, "required": ["kind", "color"], "properties": { "kind": { "const": "solid" }, "color": { "$ref": "#/$defs/color" } } },
|
|
29
|
+
{ "type": "object", "additionalProperties": false, "required": ["kind", "start", "end", "stops"], "properties": { "kind": { "const": "linear-gradient" }, "start": { "$ref": "#/$defs/vec2" }, "end": { "$ref": "#/$defs/vec2" }, "stops": { "$ref": "#/$defs/stops" }, "colorSpace": { "$ref": "#/$defs/colorSpace" } } },
|
|
30
|
+
{ "type": "object", "additionalProperties": false, "required": ["kind", "center", "radius", "stops"], "properties": { "kind": { "const": "radial-gradient" }, "center": { "$ref": "#/$defs/vec2" }, "radius": { "$ref": "#/$defs/positive" }, "focal": { "$ref": "#/$defs/vec2" }, "stops": { "$ref": "#/$defs/stops" }, "colorSpace": { "$ref": "#/$defs/colorSpace" } } }
|
|
31
|
+
]
|
|
32
|
+
},
|
|
33
|
+
"colorSpace": { "enum": ["srgb", "display-p3", "linear-srgb"] },
|
|
34
|
+
"stops": { "type": "array", "minItems": 2, "maxItems": 256, "items": { "type": "object", "additionalProperties": false, "required": ["offset", "color"], "properties": { "offset": { "type": "number", "minimum": 0, "maximum": 1 }, "color": { "$ref": "#/$defs/color" } } } },
|
|
35
|
+
"paintCommon": { "type": "object", "properties": { "opacity": { "type": "number", "minimum": 0, "maximum": 1 }, "blendMode": { "$ref": "#/$defs/blend" }, "visible": { "type": "boolean" } } },
|
|
36
|
+
"paint": {
|
|
37
|
+
"oneOf": [
|
|
38
|
+
{ "type": "object", "additionalProperties": false, "required": ["kind", "source"], "properties": { "kind": { "const": "fill" }, "source": { "$ref": "#/$defs/source" }, "fillRule": { "enum": ["nonzero", "evenodd"] }, "opacity": { "type": "number", "minimum": 0, "maximum": 1 }, "blendMode": { "$ref": "#/$defs/blend" }, "visible": { "type": "boolean" } } },
|
|
39
|
+
{ "type": "object", "additionalProperties": false, "required": ["kind", "source", "width"], "properties": { "kind": { "const": "stroke" }, "source": { "$ref": "#/$defs/source" }, "width": { "$ref": "#/$defs/nonNegative" }, "cap": { "enum": ["butt", "round", "square"] }, "join": { "enum": ["miter", "round", "bevel"] }, "miterLimit": { "type": "number", "minimum": 1 }, "dash": { "type": "array", "maxItems": 256, "items": { "$ref": "#/$defs/positive" } }, "dashOffset": { "$ref": "#/$defs/finite" }, "dashUnits": { "enum": ["absolute", "path-percent"] }, "trim": { "$ref": "#/$defs/trim" }, "transformMode": { "enum": ["scale", "fixed"] }, "opacity": { "type": "number", "minimum": 0, "maximum": 1 }, "blendMode": { "$ref": "#/$defs/blend" }, "visible": { "type": "boolean" } } }
|
|
40
|
+
]
|
|
41
|
+
},
|
|
42
|
+
"trim": { "type": "object", "additionalProperties": false, "required": ["start", "end"], "properties": { "start": { "type": "number", "minimum": 0, "maximum": 1 }, "end": { "type": "number", "minimum": 0, "maximum": 1 }, "offset": { "$ref": "#/$defs/finite" }, "mode": { "enum": ["simultaneous", "individual"] } } },
|
|
43
|
+
"pathFrame": { "type": "object", "additionalProperties": false, "required": ["time", "commands", "values"], "properties": { "time": { "$ref": "#/$defs/finite" }, "commands": { "type": "string", "pattern": "^[MLHVQCZ]+$" }, "values": { "type": "array", "items": { "$ref": "#/$defs/finite" } } } },
|
|
44
|
+
"mesh": { "type": "object", "additionalProperties": false, "required": ["positions", "uvs", "indices"], "properties": { "positions": { "type": "array", "maxItems": 4000000, "items": { "$ref": "#/$defs/finite" } }, "uvs": { "type": "array", "maxItems": 4000000, "items": { "$ref": "#/$defs/finite" } }, "indices": { "type": "array", "maxItems": 6000000, "items": { "type": "integer", "minimum": 0 } } } },
|
|
45
|
+
"geometry": {
|
|
46
|
+
"oneOf": [
|
|
47
|
+
{ "type": "object", "additionalProperties": false, "required": ["kind", "commands", "values"], "properties": { "kind": { "const": "path" }, "commands": { "type": "string", "pattern": "^[MLHVQCZ]+$" }, "values": { "type": "array", "items": { "$ref": "#/$defs/finite" } }, "fillRule": { "enum": ["nonzero", "evenodd"] }, "isHole": { "type": "boolean" }, "topologyPolicy": { "enum": ["stable", "discrete"] }, "frames": { "type": "array", "maxItems": 36000, "items": { "$ref": "#/$defs/pathFrame" } } } },
|
|
48
|
+
{ "type": "object", "additionalProperties": false, "required": ["kind", "cx", "cy", "rx", "ry"], "properties": { "kind": { "const": "ellipse" }, "cx": { "$ref": "#/$defs/finite" }, "cy": { "$ref": "#/$defs/finite" }, "rx": { "$ref": "#/$defs/nonNegative" }, "ry": { "$ref": "#/$defs/nonNegative" } } },
|
|
49
|
+
{ "type": "object", "additionalProperties": false, "required": ["kind", "x", "y", "width", "height"], "properties": { "kind": { "const": "rectangle" }, "x": { "$ref": "#/$defs/finite" }, "y": { "$ref": "#/$defs/finite" }, "width": { "$ref": "#/$defs/nonNegative" }, "height": { "$ref": "#/$defs/nonNegative" }, "radii": { "type": "array", "minItems": 4, "maxItems": 4, "items": { "$ref": "#/$defs/nonNegative" } } } },
|
|
50
|
+
{ "type": "object", "additionalProperties": false, "required": ["kind", "cx", "cy", "radius", "points"], "properties": { "kind": { "const": "polygon" }, "cx": { "$ref": "#/$defs/finite" }, "cy": { "$ref": "#/$defs/finite" }, "radius": { "$ref": "#/$defs/nonNegative" }, "points": { "type": "integer", "minimum": 3 }, "rotation": { "$ref": "#/$defs/finite" }, "cornerRadius": { "$ref": "#/$defs/nonNegative" } } },
|
|
51
|
+
{ "type": "object", "additionalProperties": false, "required": ["kind", "cx", "cy", "outerRadius", "innerRadius", "points"], "properties": { "kind": { "const": "star" }, "cx": { "$ref": "#/$defs/finite" }, "cy": { "$ref": "#/$defs/finite" }, "outerRadius": { "$ref": "#/$defs/nonNegative" }, "innerRadius": { "$ref": "#/$defs/nonNegative" }, "points": { "type": "integer", "minimum": 3 }, "rotation": { "$ref": "#/$defs/finite" }, "cornerRadius": { "$ref": "#/$defs/nonNegative" } } },
|
|
52
|
+
{ "type": "object", "additionalProperties": false, "required": ["kind", "points"], "properties": { "kind": { "const": "triangle" }, "points": { "type": "array", "minItems": 6, "maxItems": 6, "items": { "$ref": "#/$defs/finite" } }, "cornerRadius": { "$ref": "#/$defs/nonNegative" } } },
|
|
53
|
+
{ "type": "object", "additionalProperties": false, "required": ["kind", "resource", "x", "y", "width", "height"], "properties": { "kind": { "const": "image" }, "resource": { "$ref": "#/$defs/id" }, "x": { "$ref": "#/$defs/finite" }, "y": { "$ref": "#/$defs/finite" }, "width": { "$ref": "#/$defs/nonNegative" }, "height": { "$ref": "#/$defs/nonNegative" }, "crop": { "type": "array", "minItems": 4, "maxItems": 4, "items": { "$ref": "#/$defs/nonNegative" } }, "fit": { "enum": ["fill", "contain", "cover", "none", "scale-down"] }, "alignment": { "type": "array", "minItems": 2, "maxItems": 2, "items": { "type": "number", "minimum": -1, "maximum": 1 } }, "mesh": { "$ref": "#/$defs/mesh" } } },
|
|
54
|
+
{ "type": "object", "additionalProperties": false, "required": ["kind", "source", "x", "y", "width", "height", "sourceSize", "xCuts", "yCuts"], "properties": { "kind": { "const": "n-slice" }, "source": { "oneOf": [{ "type": "object", "additionalProperties": false, "required": ["kind", "resource"], "properties": { "kind": { "const": "image" }, "resource": { "$ref": "#/$defs/id" } } }, { "type": "object", "additionalProperties": false, "required": ["kind", "node"], "properties": { "kind": { "const": "node" }, "node": { "$ref": "#/$defs/id" } } }] }, "x": { "$ref": "#/$defs/finite" }, "y": { "$ref": "#/$defs/finite" }, "width": { "$ref": "#/$defs/nonNegative" }, "height": { "$ref": "#/$defs/nonNegative" }, "sourceSize": { "$ref": "#/$defs/vec2" }, "xCuts": { "type": "array", "items": { "$ref": "#/$defs/positive" } }, "yCuts": { "type": "array", "items": { "$ref": "#/$defs/positive" } } } }
|
|
55
|
+
]
|
|
56
|
+
},
|
|
57
|
+
"effect": {
|
|
58
|
+
"oneOf": [
|
|
59
|
+
{ "type": "object", "additionalProperties": false, "required": ["kind", "radiusX", "radiusY"], "properties": { "kind": { "const": "feather" }, "radiusX": { "type": "number", "minimum": 0, "maximum": 4096 }, "radiusY": { "type": "number", "minimum": 0, "maximum": 4096 }, "offsetX": { "$ref": "#/$defs/finite" }, "offsetY": { "$ref": "#/$defs/finite" }, "inner": { "type": "boolean" }, "space": { "enum": ["local", "world"] } } },
|
|
60
|
+
{ "type": "object", "additionalProperties": false, "required": ["kind", "value"], "properties": { "kind": { "const": "opacity" }, "value": { "type": "number", "minimum": 0, "maximum": 1 } } },
|
|
61
|
+
{ "type": "object", "additionalProperties": false, "required": ["kind", "values"], "properties": { "kind": { "const": "color-matrix" }, "values": { "type": "array", "minItems": 20, "maxItems": 20, "items": { "$ref": "#/$defs/finite" } } } },
|
|
62
|
+
{ "type": "object", "additionalProperties": false, "required": ["kind", "radiusX", "radiusY"], "properties": { "kind": { "const": "blur" }, "radiusX": { "type": "number", "minimum": 0, "maximum": 4096 }, "radiusY": { "type": "number", "minimum": 0, "maximum": 4096 } } },
|
|
63
|
+
{ "type": "object", "additionalProperties": false, "required": ["kind", "offsetX", "offsetY", "blur", "color"], "properties": { "kind": { "const": "drop-shadow" }, "offsetX": { "$ref": "#/$defs/finite" }, "offsetY": { "$ref": "#/$defs/finite" }, "blur": { "type": "number", "minimum": 0, "maximum": 4096 }, "color": { "$ref": "#/$defs/color" } } },
|
|
64
|
+
{ "type": "object", "additionalProperties": false, "required": ["kind", "port", "inputs", "execution"], "properties": { "kind": { "const": "custom-path-port" }, "port": { "$ref": "#/$defs/id" }, "inputs": { "type": "object", "additionalProperties": { "type": ["number", "boolean", "string"] } }, "execution": { "const": "external-only" } } }
|
|
65
|
+
]
|
|
66
|
+
},
|
|
67
|
+
"effectGroup": { "type": "object", "additionalProperties": false, "required": ["id", "effects"], "properties": { "id": { "$ref": "#/$defs/id" }, "target": { "$ref": "#/$defs/id" }, "blendMode": { "$ref": "#/$defs/blend" }, "effects": { "type": "array", "maxItems": 32, "items": { "$ref": "#/$defs/effect" } } } },
|
|
68
|
+
"node": { "type": "object", "additionalProperties": false, "required": ["id", "drawOrder", "geometries", "paints"], "properties": { "id": { "$ref": "#/$defs/id" }, "name": { "type": "string", "maxLength": 4096 }, "visible": { "type": "boolean" }, "solo": { "type": "boolean" }, "drawOrder": { "$ref": "#/$defs/finite" }, "opacity": { "type": "number", "minimum": 0, "maximum": 1 }, "transform": { "type": "array", "minItems": 6, "maxItems": 6, "items": { "$ref": "#/$defs/finite" } }, "geometries": { "type": "array", "maxItems": 64, "items": { "$ref": "#/$defs/geometry" } }, "paints": { "type": "array", "maxItems": 64, "items": { "$ref": "#/$defs/paint" } }, "effectGroups": { "type": "array", "maxItems": 32, "items": { "$ref": "#/$defs/effectGroup" } }, "clips": { "type": "array", "items": { "$ref": "#/$defs/id" } } } },
|
|
69
|
+
"clip": { "type": "object", "additionalProperties": false, "required": ["id", "source"], "properties": { "id": { "$ref": "#/$defs/id" }, "source": { "$ref": "#/$defs/id" }, "operation": { "enum": ["add", "subtract", "intersect", "difference"] }, "inverted": { "type": "boolean" }, "fillRule": { "enum": ["nonzero", "evenodd"] }, "children": { "type": "array", "items": { "$ref": "#/$defs/id" } } } },
|
|
70
|
+
"imageResource": { "type": "object", "additionalProperties": false, "required": ["id", "kind", "width", "height", "source"], "properties": { "id": { "$ref": "#/$defs/id" }, "kind": { "const": "image" }, "width": { "$ref": "#/$defs/positive" }, "height": { "$ref": "#/$defs/positive" }, "source": { "oneOf": [{ "type": "object", "additionalProperties": false, "required": ["kind", "resource"], "properties": { "kind": { "enum": ["embedded", "referenced"] }, "resource": { "$ref": "#/$defs/id" } } }, { "type": "object", "additionalProperties": false, "required": ["kind", "slot"], "properties": { "kind": { "const": "hosted-replacement" }, "slot": { "$ref": "#/$defs/id" }, "fallback": { "$ref": "#/$defs/id" } } }] }, "colorSpace": { "$ref": "#/$defs/colorSpace" }, "filter": { "enum": ["nearest", "linear"] }, "wrapX": { "enum": ["clamp", "repeat", "mirror-repeat"] }, "wrapY": { "enum": ["clamp", "repeat", "mirror-repeat"] } } }
|
|
71
|
+
}
|
|
72
|
+
}
|
package/dist/binary.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { AnimationDocument, AnimationParseOptions, ParsedAnimation } from './types';
|
|
2
|
-
export declare function isAnimationBinary(buffer: ArrayBuffer): boolean;
|
|
3
|
-
/** Encodes compact indexed metadata plus one contiguous zero-copy Float32 track/path pool. */
|
|
4
|
-
export declare function encodeAnimationBinary(document: AnimationDocument | ParsedAnimation, options?: AnimationParseOptions): ArrayBuffer;
|
|
5
|
-
export declare function decodeAnimationBinary(buffer: ArrayBuffer, options?: AnimationParseOptions): ParsedAnimation;
|
|
6
|
-
/** @internal Parser entry point that checks and consumes the magic with one DataView. */
|
|
7
|
-
export declare function tryDecodeAnimationBinary(buffer: ArrayBuffer, options: AnimationParseOptions): ParsedAnimation | undefined;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
const ANIMATION_FORMAT = 'haiyue-animation';
|
|
2
|
-
const ANIMATION_VERSION = '1.0';
|
|
3
|
-
const ANIMATION_MIME_TYPE = 'application/vnd.haiyue.animation';
|
|
4
|
-
const ANIMATION_FILE_EXTENSION = '.hya';
|
|
5
|
-
const ANIMATION_VECTOR_SHAPE_EXTENSION_ID = 'org.haiyue.vector-shape@1';
|
|
6
|
-
|
|
7
|
-
export { ANIMATION_VERSION as A, ANIMATION_FORMAT as a, ANIMATION_VECTOR_SHAPE_EXTENSION_ID as b, ANIMATION_FILE_EXTENSION as c, ANIMATION_MIME_TYPE as d };
|
|
8
|
-
//# sourceMappingURL=types-l6nBVYwx.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types-l6nBVYwx.js","sources":["../../src/types.ts"],"sourcesContent":[null],"names":[],"mappings":"AAAO,MAAM,gBAAgB,GAAG;AACzB,MAAM,iBAAiB,GAAG;AAC1B,MAAM,mBAAmB,GAAG;AAC5B,MAAM,wBAAwB,GAAG;AAgLjC,MAAM,mCAAmC,GAAG;;;;"}
|
package/dist/errors.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export type AnimationFormatErrorCode = 'E_ANIMATION_INVALID_FORMAT' | 'E_ANIMATION_UNSUPPORTED_VERSION' | 'E_ANIMATION_LIMIT_EXCEEDED' | 'E_ANIMATION_MISSING_EXTENSION' | 'E_ANIMATION_INVALID_BINARY';
|
|
2
|
-
export declare class AnimationFormatError extends Error {
|
|
3
|
-
readonly code: AnimationFormatErrorCode;
|
|
4
|
-
readonly path: string;
|
|
5
|
-
readonly name = "AnimationFormatError";
|
|
6
|
-
constructor(code: AnimationFormatErrorCode, message: string, path?: string);
|
|
7
|
-
}
|