@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.
Files changed (77) hide show
  1. package/README.md +40 -6
  2. package/SPECIFICATION.md +12 -2
  3. package/bin/hya-live2d-convert.mjs +76 -0
  4. package/bin/{hya-convert.mjs → hya-lottie-convert.mjs} +1 -1
  5. package/dist/chunks/binary-DvuTJ_hy.js +1 -0
  6. package/dist/chunks/clip-baked-Dv-wjX9d.js +1 -0
  7. package/dist/chunks/errors-Bzs3GOD9.js +1 -0
  8. package/dist/chunks/expression-D1cKtNwM.js +1 -0
  9. package/dist/chunks/extensions-DxL4AxOC.js +1 -0
  10. package/dist/conversion.d.ts +1 -0
  11. package/dist/conversion.js +1 -0
  12. package/dist/cubism.d.ts +1 -0
  13. package/dist/cubism.js +1 -0
  14. package/dist/deformable2d.d.ts +1 -0
  15. package/dist/deformable2d.js +1 -0
  16. package/dist/index.d.ts +1 -10
  17. package/dist/index.js +1 -2927
  18. package/dist/live2d/clip-baked.d.ts +1 -0
  19. package/dist/live2d/clip-baked.js +1 -0
  20. package/dist/live2d.d.ts +1 -0
  21. package/dist/live2d.js +1 -0
  22. package/dist/lottie.d.ts +1 -62
  23. package/dist/lottie.js +1 -2642
  24. package/dist/native3d.d.ts +1 -2
  25. package/dist/native3d.js +1 -907
  26. package/dist/shared.d.ts +1493 -0
  27. package/package.json +30 -10
  28. package/schema/animation.schema.json +92 -0
  29. package/schema/deformable-mesh-2d-extension.schema.json +18 -0
  30. package/schema/deformable-mesh-2d.contract.json +58 -0
  31. package/schema/parameterized-rig-2d.contract.json +63 -0
  32. package/schema/parameterized-rig-2d.schema.json +57 -0
  33. package/schema/parameterized-rig-census-map.json +128 -0
  34. package/schema/responsive-layout-2d-census-map.json +49 -0
  35. package/schema/responsive-layout-2d.contract.json +58 -0
  36. package/schema/responsive-layout-2d.schema.json +34 -0
  37. package/schema/state-machine-v2-census-map.json +1 -0
  38. package/schema/state-machine-v2.contract.json +66 -0
  39. package/schema/state-machine-v2.schema.json +55 -0
  40. package/schema/vector-visual-census-map.json +120 -0
  41. package/schema/vector-visual.contract.json +47 -0
  42. package/schema/vector-visual.schema.json +72 -0
  43. package/dist/binary.d.ts +0 -7
  44. package/dist/chunks/types-l6nBVYwx.js +0 -8
  45. package/dist/chunks/types-l6nBVYwx.js.map +0 -1
  46. package/dist/errors.d.ts +0 -7
  47. package/dist/extensions.d.ts +0 -19
  48. package/dist/index.js.map +0 -1
  49. package/dist/lottie-merge-path.d.ts +0 -11
  50. package/dist/lottie.js.map +0 -1
  51. package/dist/native3d/Animation3DError.d.ts +0 -8
  52. package/dist/native3d/Animation3DParser.d.ts +0 -7
  53. package/dist/native3d/Animation3DTypes.d.ts +0 -285
  54. package/dist/native3d/index.d.ts +0 -5
  55. package/dist/native3d.js.map +0 -1
  56. package/dist/parser.d.ts +0 -2
  57. package/dist/state-machine.d.ts +0 -130
  58. package/dist/text-selector.d.ts +0 -2
  59. package/dist/types.d.ts +0 -419
  60. package/dist/validation.d.ts +0 -32
  61. package/src/binary.ts +0 -1441
  62. package/src/errors.ts +0 -18
  63. package/src/extensions.ts +0 -55
  64. package/src/index.ts +0 -90
  65. package/src/lottie-merge-path.ts +0 -204
  66. package/src/lottie.ts +0 -3073
  67. package/src/native3d/Animation3DError.ts +0 -20
  68. package/src/native3d/Animation3DParser.ts +0 -964
  69. package/src/native3d/Animation3DTypes.ts +0 -322
  70. package/src/native3d/index.ts +0 -14
  71. package/src/native3d.ts +0 -2
  72. package/src/parser.ts +0 -41
  73. package/src/state-machine.ts +0 -645
  74. package/src/text-selector.ts +0 -7
  75. package/src/types.ts +0 -483
  76. package/src/validation.ts +0 -1286
  77. package/test/fixtures/basic-lottie.json +0 -31
@@ -0,0 +1 @@
1
+ import{A as e}from"./chunks/errors-Bzs3GOD9.js";import{A as t}from"./chunks/extensions-DxL4AxOC.js";const a="org.haiyue.deformable-mesh-2d@1",n="haiyue-deformable-mesh-2d",r=1,s=32768,i=1296324936,o=new TextEncoder,d=new TextDecoder,l=Object.freeze({maxInputBytes:67108864,maxMetadataBytes:4194304,maxDrawables:4096,maxVertices:2e6,maxFrames:36e3,maxMaskReferences:32768,maxTextures:32});class c{count=0;blocks=[];get length(){return this.count}add(e){const t=[this.count,e.length];return this.count+=e.length,this.blocks.push(e),t}build(e){const t=e(this.count);let a=0;for(const e of this.blocks)t.set(e,a),a+=e.length;return t}}function u(e){return e.byteLength>=4&&new DataView(e).getUint32(0,!0)===i}function m(e){!function(e){U(e.canvasWidth,"$.canvasWidth"),U(e.canvasHeight,"$.canvasHeight"),U(e.duration,"$.duration"),U(e.frameRate,"$.frameRate"),e.times instanceof Float32Array&&0!==e.times.length||q("Times must be a non-empty Float32Array.","$.times");p(e.times,e.duration,l.maxFrames),Array.isArray(e.drawables)&&0!==e.drawables.length||q("At least one drawable is required.","$.drawables");e.drawables.length>l.maxDrawables&&L(`Drawable count exceeds ${l.maxDrawables}.`,"$.drawables");const t=new Set(e.drawables.map(e=>e.id));(t.size!==e.drawables.length||t.has(""))&&q("Drawable ids must be non-empty and unique.","$.drawables");let a=0,n=0;for(let r=0;r<e.drawables.length;r++){const s=e.drawables[r];$(s,e.times.length,t,r),a+=s.uvs.length/2,n+=s.masks.length,a>l.maxVertices&&L(`Vertex count exceeds ${l.maxVertices}.`,`$.drawables[${r}].uvs`),n>l.maxMaskReferences&&L(`Mask reference count exceeds ${l.maxMaskReferences}.`,`$.drawables[${r}].masks`)}k(e.drawables)}(e);const t=new c,a=new c,r=t.add(e.times),s=e.drawables.map(e=>{const n=C(e.multiplyColors,[1,1,1,1])?t.add(e.multiplyColors):void 0,r=C(e.screenColors,[0,0,0,0])?t.add(e.screenColors):void 0;return{id:e.id,textureIndex:e.textureIndex,blendMode:e.blendMode,culling:e.culling,masks:[...e.masks],maskMode:e.maskMode??"alpha",uvs:t.add(e.uvs),indices:a.add(e.indices),positions:t.add(e.positions),opacities:t.add(e.opacities),renderOrders:t.add(e.renderOrders),...void 0===n?{}:{multiplyColors:n},...void 0===r?{}:{screenColors:r}}}),d=s.some(e=>void 0!==e.multiplyColors||void 0!==e.screenColors)?2:1,u={format:n,version:1,canvas:[e.canvasWidth,e.canvasHeight],duration:e.duration,frameRate:e.frameRate,times:r,drawables:s},m=o.encode(JSON.stringify(u));m.byteLength>l.maxMetadataBytes&&L(`Metadata exceeds ${l.maxMetadataBytes} bytes.`,"$binary.metadata");const f=32+m.byteLength+3&-4;const g=h(t.length,4,"$binary.floats"),b=h(a.length,4,"$binary.indices"),x=y(f,g,"$binary.indices"),w=y(x,b,"$binary");w>l.maxInputBytes&&L(`Encoded output exceeds ${l.maxInputBytes} bytes.`,"$binary");const v=t.build(e=>new Float32Array(e)),M=a.build(e=>new Uint32Array(e)),I=new ArrayBuffer(w),A=new DataView(I);return A.setUint32(0,i,!0),A.setUint16(4,1,!0),A.setUint16(6,d,!0),A.setUint32(8,32,!0),A.setUint32(12,m.byteLength,!0),A.setUint32(16,f,!0),A.setUint32(20,v.length,!0),A.setUint32(24,x,!0),A.setUint32(28,M.length,!0),new Uint8Array(I,32,m.byteLength).set(m),new Float32Array(I,f,v.length).set(v),new Uint32Array(I,x,M.length).set(M),I}function f(e,t={}){const a=function(e){return{maxInputBytes:R(e.maxInputBytes,l.maxInputBytes,"maxInputBytes"),maxMetadataBytes:R(e.maxMetadataBytes,l.maxMetadataBytes,"maxMetadataBytes"),maxDrawables:R(e.maxDrawables,l.maxDrawables,"maxDrawables"),maxVertices:R(e.maxVertices,l.maxVertices,"maxVertices"),maxFrames:R(e.maxFrames,l.maxFrames,"maxFrames"),maxMaskReferences:R(e.maxMaskReferences,l.maxMaskReferences,"maxMaskReferences")}}(t);e.byteLength>a.maxInputBytes&&L(`Input exceeds ${a.maxInputBytes} bytes.`,"$binary"),e.byteLength<32&&q("Header is truncated.","$binary");const r=new DataView(e);r.getUint32(0,!0)!==i&&q("Magic must be HYDM.","$binary.magic");const s=r.getUint16(4,!0),o=r.getUint16(6,!0);(1!==s||o>2)&&q(`Unsupported sidecar version ${s}.${o}.`,"$binary.version");const c=r.getUint32(8,!0),u=r.getUint32(12,!0),m=r.getUint32(16,!0),f=r.getUint32(20,!0),$=r.getUint32(24,!0),y=r.getUint32(28,!0);u>a.maxMetadataBytes&&L(`Metadata exceeds ${a.maxMetadataBytes} bytes.`,"$binary.metadata"),x(c,u,e.byteLength,"$binary.metadata"),32!==c&&q("Metadata must immediately follow the header.","$binary.metadata"),(3&m||m<c+u)&&q("Float pool is unaligned or overlaps metadata.","$binary.floats"),x(m,h(f,4,"$binary.floats"),e.byteLength,"$binary.floats"),(3&$||$!==m+4*f)&&q("Index pool is unaligned or does not follow floats.","$binary.indices");const C=h(y,4,"$binary.indices");let I;x($,C,e.byteLength,"$binary.indices"),$+C!==e.byteLength&&q("Sidecar has trailing or unaccounted bytes.","$binary");try{I=JSON.parse(d.decode(new Uint8Array(e,c,u)))}catch(e){q(`Metadata JSON cannot be decoded: ${e instanceof Error?e.message:String(e)}.`,"$binary.metadata")}const O=function(e,t,a){const r=F(e,"$");r.format===n&&1===r.version||q("Metadata format/version is unsupported.","$.format");const s=function(e,t){const a=D(e,t);2!==a.length&&q("Expected two numbers.",t);return[E(a[0],`${t}[0]`),E(a[1],`${t}[1]`)]}(r.canvas,"$.canvas");U(s[0],"$.canvas[0]"),U(s[1],"$.canvas[1]");const i=E(r.duration,"$.duration");U(i,"$.duration");const o=E(r.frameRate,"$.frameRate");U(o,"$.frameRate");const d=D(r.drawables,"$.drawables");(0===d.length||d.length>t.maxDrawables)&&L(`Drawable count must be 1-${t.maxDrawables}.`,"$.drawables");return{format:n,version:1,canvas:s,duration:i,frameRate:o,times:V(r.times,"$.times"),drawables:d.map((e,t)=>{const n=F(e,`$.drawables[${t}]`);return 0===a&&void 0!==n.maskMode&&q("HYDM 1.0 must not contain maskMode.",`$.drawables[${t}].maskMode`),a<2&&(void 0!==n.multiplyColors||void 0!==n.screenColors)&&q(`HYDM 1.${a} must not contain drawable color tracks.`,`$.drawables[${t}]`),{id:B(n.id,`$.drawables[${t}].id`),textureIndex:S(n.textureIndex,`$.drawables[${t}].textureIndex`),blendMode:T(n.blendMode,["normal","additive","multiplicative"],`$.drawables[${t}].blendMode`),culling:N(n.culling,`$.drawables[${t}].culling`),masks:D(n.masks,`$.drawables[${t}].masks`).map((e,a)=>B(e,`$.drawables[${t}].masks[${a}]`)),maskMode:0===a?"alpha":T(n.maskMode,["alpha","alpha-inverted"],`$.drawables[${t}].maskMode`),uvs:V(n.uvs,`$.drawables[${t}].uvs`),indices:V(n.indices,`$.drawables[${t}].indices`),positions:V(n.positions,`$.drawables[${t}].positions`),opacities:V(n.opacities,`$.drawables[${t}].opacities`),renderOrders:V(n.renderOrders,`$.drawables[${t}].renderOrders`),...a<2||void 0===n.multiplyColors?{}:{multiplyColors:V(n.multiplyColors,`$.drawables[${t}].multiplyColors`)},...a<2||void 0===n.screenColors?{}:{screenColors:V(n.screenColors,`$.drawables[${t}].screenColors`)}}})}}(I,a,o);!function(e,t,a){const n=[{range:e.times,path:"$.times"}],r=[],s=M(e.times[1],4,"$.times");for(let t=0;t<e.drawables.length;t++){const a=e.drawables[t],i=`$.drawables[${t}]`;n.push({range:a.uvs,path:`${i}.uvs`},{range:a.positions,path:`${i}.positions`},{range:a.opacities,path:`${i}.opacities`},{range:a.renderOrders,path:`${i}.renderOrders`}),void 0!==a.multiplyColors&&(a.multiplyColors[1]!==s&&q("Multiply-color track requires four values per frame.",`${i}.multiplyColors`),n.push({range:a.multiplyColors,path:`${i}.multiplyColors`})),void 0!==a.screenColors&&(a.screenColors[1]!==s&&q("Screen-color track requires four values per frame.",`${i}.screenColors`),n.push({range:a.screenColors,path:`${i}.screenColors`})),r.push({range:a.indices,path:`${i}.indices`})}v(n,t,"$binary.floats"),v(r,a,"$binary.indices")}(O,f,y);const j=new Float32Array(e,m,f),H=new Uint32Array(e,$,y);w(j,"$binary.floats");const z=g(j,O.times,"$.times");p(z,O.duration,a.maxFrames);const P=new Set;let _=0,W=0;const J=O.drawables.map((e,t)=>{const n=`$.drawables[${t}]`;e.id&&!P.has(e.id)||q("Drawable id must be non-empty and unique.",`${n}.id`),P.add(e.id),e.textureIndex>=l.maxTextures&&L(`Texture index exceeds ${l.maxTextures-1}.`,`${n}.textureIndex`);const r=g(j,e.uvs,`${n}.uvs`);(r.length<6||1&r.length)&&q("UVs require at least three xy pairs.",`${n}.uvs`);const s=r.length/2;_+=s,_>a.maxVertices&&L(`Vertex count exceeds ${a.maxVertices}.`,`${n}.uvs`);const i=g(j,e.positions,`${n}.positions`);i.length!==z.length*r.length&&q("Position count must equal frameCount * vertexCount * 2.",`${n}.positions`);const o=g(j,e.opacities,`${n}.opacities`),d=g(j,e.renderOrders,`${n}.renderOrders`),c=void 0===e.multiplyColors?void 0:g(j,e.multiplyColors,`${n}.multiplyColors`),u=void 0===e.screenColors?void 0:g(j,e.screenColors,`${n}.screenColors`);o.length===z.length&&d.length===z.length||q("Opacity and render-order tracks require one value per frame.",n),void 0!==c&&A(c,z.length,`${n}.multiplyColors`),void 0!==u&&A(u,z.length,`${n}.screenColors`);for(let e=0;e<o.length;e++)(o[e]<0||o[e]>1)&&q("Opacity must stay inside [0, 1].",`${n}.opacities[${e}]`),Number.isSafeInteger(d[e])||q("Render order must be a safe integer.",`${n}.renderOrders[${e}]`);const m=function(e,t,a){return b(t,e.length,a),e.subarray(t[0],t[0]+t[1])}(H,e.indices,`${n}.indices`);(m.length<3||m.length%3!=0)&&q("Indices must contain triangle triplets.",`${n}.indices`);for(let e=0;e<m.length;e++)m[e]>=s&&q("Index references a missing vertex.",`${n}.indices[${e}]`);return W+=e.masks.length,W>a.maxMaskReferences&&L(`Mask reference count exceeds ${a.maxMaskReferences}.`,`${n}.masks`),Object.freeze({id:e.id,textureIndex:e.textureIndex,blendMode:e.blendMode,culling:e.culling,masks:Object.freeze([...e.masks]),maskMode:e.maskMode,uvs:r,indices:m,positions:i,opacities:o,renderOrders:d,...void 0===c?{}:{multiplyColors:c},...void 0===u?{}:{screenColors:u},vertexCount:s})});for(let e=0;e<J.length;e++)for(let t=0;t<J[e].masks.length;t++){const a=J[e].masks[t];a!==J[e].id&&P.has(a)||q("Mask must reference a different existing drawable.",`$.drawables[${e}].masks[${t}]`)}return k(J),Object.freeze({format:n,version:1,canvasWidth:O.canvas[0],canvasHeight:O.canvas[1],duration:O.duration,frameRate:O.frameRate,times:z,drawables:Object.freeze(J),backingBuffer:e})}function $(e,t,a,n){const r=`$.drawables[${n}]`;(!Number.isSafeInteger(e.textureIndex)||e.textureIndex<0)&&q("Texture index must be a non-negative safe integer.",`${r}.textureIndex`),e.textureIndex>=l.maxTextures&&L(`Texture index exceeds ${l.maxTextures-1}.`,`${r}.textureIndex`),["normal","additive","multiplicative"].includes(e.blendMode)||q("Blend mode is unsupported.",`${r}.blendMode`),(!(e.uvs instanceof Float32Array)||e.uvs.length<6||1&e.uvs.length)&&q("UVs require at least three xy pairs.",`${r}.uvs`),e.indices instanceof Uint32Array&&!(e.indices.length<3)&&e.indices.length%3==0||q("Indices require Uint32 triangle triplets.",`${r}.indices`),e.positions instanceof Float32Array&&e.positions.length===t*e.uvs.length||q("Positions do not match frame and vertex counts.",`${r}.positions`),e.opacities instanceof Float32Array&&e.opacities.length===t||q("Opacities require one value per frame.",`${r}.opacities`),e.renderOrders instanceof Float32Array&&e.renderOrders.length===t||q("Render orders require one value per frame.",`${r}.renderOrders`),void 0!==e.multiplyColors&&I(e.multiplyColors,t,`${r}.multiplyColors`),void 0!==e.screenColors&&I(e.screenColors,t,`${r}.screenColors`),w(e.uvs,`${r}.uvs`),w(e.positions,`${r}.positions`),w(e.opacities,`${r}.opacities`),w(e.renderOrders,`${r}.renderOrders`);const s=e.uvs.length/2;for(let t=0;t<e.indices.length;t++)e.indices[t]>=s&&q("Index references a missing vertex.",`${r}.indices[${t}]`);for(let a=0;a<t;a++)(e.opacities[a]<0||e.opacities[a]>1)&&q("Opacity must stay inside [0, 1].",`${r}.opacities[${a}]`),Number.isSafeInteger(e.renderOrders[a])||q("Render order must be a safe integer.",`${r}.renderOrders[${a}]`);Array.isArray(e.masks)||q("Masks must be an array.",`${r}.masks`),void 0!==e.maskMode&&"alpha"!==e.maskMode&&"alpha-inverted"!==e.maskMode&&q("Mask mode is unsupported.",`${r}.maskMode`);for(let t=0;t<e.masks.length;t++){const n=e.masks[t];n&&n!==e.id&&a.has(n)||q("Mask must reference a different existing drawable.",`${r}.masks[${t}]`)}}function g(e,t,a){return b(t,e.length,a),e.subarray(t[0],t[0]+t[1])}function b(e,t,a){(e[0]>t||e[1]>t-e[0])&&q("Pool range is outside its backing array.",a)}function p(e,t,a){(0===e.length||e.length>a)&&L(`Frame count must be 1-${a}.`,"$.times");let n=-1;for(let a=0;a<e.length;a++){const r=e[a];(!Number.isFinite(r)||r<0||r<=n||r>Math.max(t,Math.fround(t)))&&q("Times must be finite, increasing and inside duration.",`$.times[${a}]`),n=r}}function h(e,t,a){const n=e*t;return Number.isSafeInteger(n)||q("Byte count overflows safe integer range.",a),n}function y(e,t,a){const n=e+t;return Number.isSafeInteger(n)||q("Byte offset overflows safe integer range.",a),n}function x(e,t,a,n){(e>a||t>a-e)&&q("Byte range is outside the buffer.",n)}function w(e,t){for(let a=0;a<e.length;a++)Number.isFinite(e[a])||q("Float data must be finite.",`${t}[${a}]`)}function v(e,t,a){const n=[...e].sort((e,t)=>e.range[0]-t.range[0]||e.range[1]-t.range[1]);let r=0;for(const e of n)b(e.range,t,e.path),e.range[0]!==r&&q(e.range[0]<r?"Packed ranges overlap.":"Packed pool contains an unreferenced gap.",e.path),r=y(e.range[0],e.range[1],e.path);r!==t&&q("Packed pool contains trailing unreferenced values.",a)}function k(e){const t=new Map(e.map(e=>[e.id,e])),a=new Set,n=new Set,r=(e,s)=>{if(a.has(e)&&q("Mask dependency graph contains a cycle.",s),n.has(e))return;a.add(e);const i=t.get(e);if(i)for(let e=0;e<i.masks.length;e++)r(i.masks[e],`${s}.masks[${e}]`);a.delete(e),n.add(e)};for(let t=0;t<e.length;t++)r(e[t].id,`$.drawables[${t}]`)}function M(e,t,a){const n=e*t;return Number.isSafeInteger(n)||q("Value count overflows safe integer range.",a),n}function C(e,t){if(void 0===e)return!1;for(let a=0;a<e.length;a++)if(e[a]!==t[3&a])return!0;return!1}function I(e,t,a){e instanceof Float32Array&&e.length===M(t,4,a)||q("Drawable color track requires four Float32 values per frame.",a),O(e,a)}function A(e,t,a){e.length!==M(t,4,a)&&q("Drawable color track requires four values per frame.",a),O(e,a)}function O(e,t){for(let a=0;a<e.length;a++){const n=e[a];(!Number.isFinite(n)||n<0||n>1)&&q("Drawable color values must be finite and inside [0, 1].",`${t}[${a}]`)}}function U(e,t){(!Number.isFinite(e)||e<=0)&&q("Expected a positive finite number.",t)}function R(e,t,a){const n=e??t;if(!Number.isSafeInteger(n)||n<1)throw new RangeError(`${a} must be a positive safe integer.`);return n}function F(e,t){return e&&"object"==typeof e&&!Array.isArray(e)||q("Expected an object.",t),e}function D(e,t){return Array.isArray(e)||q("Expected an array.",t),e}function B(e,t){return"string"==typeof e&&0!==e.length||q("Expected a non-empty string.",t),e}function N(e,t){return"boolean"!=typeof e&&q("Expected a boolean.",t),e}function E(e,t){return"number"==typeof e&&Number.isFinite(e)||q("Expected a finite number.",t),e}function S(e,t){return("number"!=typeof e||!Number.isSafeInteger(e)||e<0)&&q("Expected a non-negative safe integer.",t),e}function V(e,t){const a=D(e,t);return 2!==a.length&&q("Expected an offset/length pair.",t),[S(a[0],`${t}[0]`),S(a[1],`${t}[1]`)]}function T(e,t,a){return"string"==typeof e&&t.includes(e)||q(`Expected one of ${t.join(", ")}.`,a),e}function q(t,a){throw new e("E_ANIMATION_INVALID_FORMAT",t,a)}function L(t,a){throw new e("E_ANIMATION_LIMIT_EXCEEDED",t,a)}function j(){return{id:a,validateComponent(e,t){e.type!==a&&t.fail("Component type does not match the deformable-mesh extension.",`${t.path}.type`),"string"==typeof e.dataResource&&0!==e.dataResource.length||t.fail("dataResource must be a non-empty resource id.",`${t.path}.dataResource`),(!Array.isArray(e.textures)||e.textures.length<1||e.textures.length>32)&&t.fail("textures must contain 1-32 resource ids.",`${t.path}.textures`);const n=e.textures;for(let e=0;e<n.length;e++){const a=n[e];"string"==typeof a&&0!==a.length||t.fail("Texture resource id must be non-empty.",`${t.path}.textures[${e}]`)}}}}function H(){const e=new t;return e.register(j()),e}export{n as DEFORMABLE_MESH_2D_DATA_FORMAT,r as DEFORMABLE_MESH_2D_DATA_VERSION,a as DEFORMABLE_MESH_2D_EXTENSION_ID,s as DEFORMABLE_MESH_2D_MAX_MASK_REFERENCES,j as createDeformableMesh2DFormatHandler,H as createDeformableMesh2DFormatRegistry,f as decodeDeformableMesh2DData,m as encodeDeformableMesh2DData,u as isDeformableMesh2DBinary};//# sourceMappingURL=deformable2d.js.map
package/dist/index.d.ts CHANGED
@@ -1,10 +1 @@
1
- export { ANIMATION_FILE_EXTENSION, ANIMATION_FORMAT, ANIMATION_MIME_TYPE, ANIMATION_VERSION, ANIMATION_VECTOR_SHAPE_EXTENSION_ID, } from './types';
2
- export type { AnimationBinaryResource, AnimationAudioComponent, AnimationAudioResource, AnimationCanvas, AnimationComponent, AnimationCoordinateSystem, AnimationComposite, AnimationCompositeKind, AnimationCompositeLayer, AnimationCompositeMode, AnimationCompositeOperation, AnimationCompositeStack, AnimationDocument, AnimationEndBehavior, AnimationExtensionComponent, AnimationImageResource, AnimationInterpolation, AnimationLayerEffect, AnimationTintEffect, AnimationFillEffect, AnimationOpacityEffect, AnimationColorMatrixEffect, AnimationBlurEffect, AnimationDropShadowEffect, AnimationFillRule, AnimationNode, AnimationParseLimits, AnimationParseOptions, AnimationPath2DComponent, AnimationPathCommand, AnimationParticle2DComponent, AnimationResource, AnimationShape2DComponent, AnimationSource, AnimationSprite2DComponent, AnimationText2DComponent, AnimationTextAnimator, AnimationTextDocumentKeyframe, AnimationTextRangeSelector, AnimationTextSelectorShape, AnimationTextSelectorUnits, AnimationTrack, AnimationTrackProperty, AnimationTransform2D, AnimationVectorGradientPaint, AnimationVectorShapeComponent, AnimationVectorSolidPaint, AnimationVectorStrokePaint, AnimationVectorValueTrack, ParsedAnimation, ParsedAnimationTrack, } from './types';
3
- export { AnimationFormatError } from './errors';
4
- export type { AnimationFormatErrorCode } from './errors';
5
- export { AnimationExtensionRegistry, extensionIdFromComponentType, validateExtensionId } from './extensions';
6
- export type { AnimationExtensionHandler, AnimationExtensionValidationContext } from './extensions';
7
- export { parseAnimation } from './parser';
8
- export { decodeAnimationBinary, encodeAnimationBinary, isAnimationBinary } from './binary';
9
- export { HYA_STATE_MACHINE_CHANNEL_REGISTRY, HYA_STATE_MACHINE_EXTENSION_ID, hyaStateMachineChannelCapability, parseHyaStateMachineExtension, } from './state-machine';
10
- export type { HyaAnimationClipRange, HyaStateMachineBindingMask, HyaStateMachineBlendMode, HyaStateMachineChannelCapability, HyaStateMachineChannelId, HyaStateMachineChannelKind, HyaStateMachineChannelSupport, HyaStateMachineCondition, HyaStateMachineDefinition, HyaStateMachineExtension, HyaStateMachineLayer, HyaStateMachineLoopMode, HyaStateMachineMotion, HyaStateMachineParameter, HyaStateMachineState, HyaStateMachineTransition, } from './state-machine';
1
+ export { ac as ANIMATION_FILE_EXTENSION, ad as ANIMATION_FORMAT, ae as ANIMATION_MIME_TYPE, af as ANIMATION_VECTOR_SHAPE_EXTENSION_ID, ag as ANIMATION_VERSION, ah as AnimationAudioComponent, ai as AnimationAudioResource, aj as AnimationBinaryResource, ak as AnimationBlurEffect, al as AnimationCanvas, am as AnimationColorMatrixEffect, an as AnimationComponent, ao as AnimationComposite, ap as AnimationCompositeKind, aq as AnimationCompositeLayer, ar as AnimationCompositeMode, as as AnimationCompositeOperation, at as AnimationCompositeStack, au as AnimationCoordinateSystem, av as AnimationDocument, aw as AnimationDropShadowEffect, ax as AnimationEndBehavior, ay as AnimationExtensionComponent, az as AnimationExtensionHandler, aA as AnimationExtensionRegistry, aB as AnimationExtensionValidationContext, aC as AnimationFillEffect, aD as AnimationFillRule, aE as AnimationFormatError, aF as AnimationFormatErrorCode, aG as AnimationImageResource, aH as AnimationInterpolation, aI as AnimationLayerEffect, aJ as AnimationNode, aK as AnimationOpacityEffect, aL as AnimationParseLimits, aM as AnimationParseOptions, aN as AnimationParticle2DComponent, aO as AnimationPath2DComponent, aP as AnimationPathCommand, aQ as AnimationResource, aR as AnimationSafeExpressionContext, aS as AnimationSafeExpressionInstruction, aT as AnimationSafeExpressionProgram, aU as AnimationShape2DComponent, aV as AnimationSource, aW as AnimationSprite2DComponent, aX as AnimationText2DComponent, aY as AnimationTextAnimator, aZ as AnimationTextDocumentKeyframe, a_ as AnimationTextRangeSelector, a$ as AnimationTextSelectorShape, b0 as AnimationTextSelectorUnits, b1 as AnimationTextStyleRun, b2 as AnimationTintEffect, b3 as AnimationTrack, b4 as AnimationTrackProperty, b5 as AnimationTransform2D, b6 as AnimationVectorFeather, b7 as AnimationVectorGradientPaint, b8 as AnimationVectorShapeComponent, b9 as AnimationVectorSolidPaint, ba as AnimationVectorStrokePaint, bb as AnimationVectorValueTrack, bc as HYA_SAFE_EXPRESSION_VERSION, bd as HYA_STATE_MACHINE_CHANNEL_REGISTRY, be as HYA_STATE_MACHINE_EXTENSION_ID, bf as HyaAnimationClipRange, bg as HyaStateMachineBindingMask, bh as HyaStateMachineBlendMode, bi as HyaStateMachineChannelCapability, bj as HyaStateMachineChannelId, bk as HyaStateMachineChannelKind, bl as HyaStateMachineChannelSupport, bm as HyaStateMachineCondition, bn as HyaStateMachineDefinition, bo as HyaStateMachineExtension, bp as HyaStateMachineLayer, bq as HyaStateMachineLoopMode, br as HyaStateMachineMotion, bs as HyaStateMachineParameter, bt as HyaStateMachineState, bu as HyaStateMachineTransition, bv as ParsedAnimation, bw as ParsedAnimationTrack, bx as decodeAnimationBinary, by as encodeAnimationBinary, bz as evaluateSafeExpression, bA as extensionIdFromComponentType, bB as hyaStateMachineChannelCapability, bC as isAnimationBinary, bD as parseAnimation, bE as parseHyaStateMachineExtension, bF as safeExpressionDataResources, bG as validateExtensionId } from './shared.js';