exodeui 2.5.2 → 2.5.4

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/index.mjs CHANGED
@@ -157,10 +157,10 @@ class iA {
157
157
  Y[e++] = void 0, Y[e++] = void 0;
158
158
  }
159
159
  }
160
- castShape(A, I, g, C, B, i, D, o, w, h, K, s, k, M, a) {
160
+ castShape(A, I, g, C, B, i, D, o, w, h, K, s, k, M, F) {
161
161
  try {
162
162
  G(A, f), G(I, H), G(g, n), G(C, S), G(B, t), G(i, S), G(D, U);
163
- const y = Q.rawbroadphase_castShape(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, g.__wbg_ptr, C.__wbg_ptr, B.__wbg_ptr, i.__wbg_ptr, D.__wbg_ptr, o, w, h, K, J(s) ? 4294967297 : s >>> 0, !J(k), J(k) ? 0 : k, !J(M), J(M) ? 0 : M, l(a));
163
+ const y = Q.rawbroadphase_castShape(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, g.__wbg_ptr, C.__wbg_ptr, B.__wbg_ptr, i.__wbg_ptr, D.__wbg_ptr, o, w, h, K, J(s) ? 4294967297 : s >>> 0, !J(k), J(k) ? 0 : k, !J(M), J(M) ? 0 : M, l(F));
164
164
  return y === 0 ? void 0 : jA.__wrap(y);
165
165
  } finally {
166
166
  Y[e++] = void 0;
@@ -552,10 +552,10 @@ class n {
552
552
  contains(A) {
553
553
  return Q.rawcolliderset_contains(this.__wbg_ptr, A) !== 0;
554
554
  }
555
- createCollider(A, I, g, C, B, i, D, o, w, h, K, s, k, M, a, y, F, R, r, p, j, b, z, _) {
555
+ createCollider(A, I, g, C, B, i, D, o, w, h, K, s, k, M, F, y, a, R, r, p, j, b, z, _) {
556
556
  try {
557
557
  const zA = Q.__wbindgen_add_to_stack_pointer(-16);
558
- G(I, U), G(g, S), G(C, t), G(D, S), G(_, H), Q.rawcolliderset_createCollider(zA, this.__wbg_ptr, A, I.__wbg_ptr, g.__wbg_ptr, C.__wbg_ptr, B, i, D.__wbg_ptr, o, w, h, K, s, k, M, a, y, F, R, r, p, j, b, z, _.__wbg_ptr);
558
+ G(I, U), G(g, S), G(C, t), G(D, S), G(_, H), Q.rawcolliderset_createCollider(zA, this.__wbg_ptr, A, I.__wbg_ptr, g.__wbg_ptr, C.__wbg_ptr, B, i, D.__wbg_ptr, o, w, h, K, s, k, M, F, y, a, R, r, p, j, b, z, _.__wbg_ptr);
559
559
  var kA = Z().getInt32(zA + 0, !0), Wg = Z().getFloat64(zA + 8, !0);
560
560
  return kA === 0 ? void 0 : Wg;
561
561
  } finally {
@@ -1871,8 +1871,8 @@ class H {
1871
1871
  const A = Q.rawrigidbodyset_new();
1872
1872
  return this.__wbg_ptr = A >>> 0, EI.register(this, this.__wbg_ptr, this), this;
1873
1873
  }
1874
- createRigidBody(A, I, g, C, B, i, D, o, w, h, K, s, k, M, a, y, F, R, r, p, j, b) {
1875
- return G(I, S), G(g, t), G(D, S), G(o, S), Q.rawrigidbodyset_createRigidBody(this.__wbg_ptr, A, I.__wbg_ptr, g.__wbg_ptr, C, B, i, D.__wbg_ptr, o.__wbg_ptr, w, h, K, s, k, M, a, y, F, R, r, p, j, b);
1874
+ createRigidBody(A, I, g, C, B, i, D, o, w, h, K, s, k, M, F, y, a, R, r, p, j, b) {
1875
+ return G(I, S), G(g, t), G(D, S), G(o, S), Q.rawrigidbodyset_createRigidBody(this.__wbg_ptr, A, I.__wbg_ptr, g.__wbg_ptr, C, B, i, D.__wbg_ptr, o.__wbg_ptr, w, h, K, s, k, M, F, y, a, R, r, p, j, b);
1876
1876
  }
1877
1877
  remove(A, I, g, C, B) {
1878
1878
  G(I, gA), G(g, n), G(C, IA), G(B, CA), Q.rawrigidbodyset_remove(this.__wbg_ptr, A, I.__wbg_ptr, g.__wbg_ptr, C.__wbg_ptr, B.__wbg_ptr);
@@ -3192,11 +3192,11 @@ class eg {
3192
3192
  }
3193
3193
  intersectionsWithRay(A, I, g, C, B, i, D, o, w, h, K, s) {
3194
3194
  let k = N.intoRaw(C.origin), M = N.intoRaw(C.dir);
3195
- this.raw.intersectionsWithRay(A.raw, I.raw, g.raw, k, M, B, i, (a) => D(LA.fromRaw(g, a)), o, w, h, K, s), k.free(), M.free();
3195
+ this.raw.intersectionsWithRay(A.raw, I.raw, g.raw, k, M, B, i, (F) => D(LA.fromRaw(g, F)), o, w, h, K, s), k.free(), M.free();
3196
3196
  }
3197
3197
  intersectionWithShape(A, I, g, C, B, i, D, o, w, h, K) {
3198
- let s = N.intoRaw(C), k = q.intoRaw(B), M = i.intoRaw(), a = this.raw.intersectionWithShape(A.raw, I.raw, g.raw, s, k, M, D, o, w, h, K);
3199
- return s.free(), k.free(), M.free(), a;
3198
+ let s = N.intoRaw(C), k = q.intoRaw(B), M = i.intoRaw(), F = this.raw.intersectionWithShape(A.raw, I.raw, g.raw, s, k, M, D, o, w, h, K);
3199
+ return s.free(), k.free(), M.free(), F;
3200
3200
  }
3201
3201
  projectPoint(A, I, g, C, B, i, D, o, w, h) {
3202
3202
  let K = N.intoRaw(C), s = qA.fromRaw(g, this.raw.projectPoint(A.raw, I.raw, g.raw, K, B, i, D, o, w, h));
@@ -3210,13 +3210,13 @@ class eg {
3210
3210
  let K = N.intoRaw(C);
3211
3211
  this.raw.intersectionsWithPoint(A.raw, I.raw, g.raw, K, B, i, D, o, w, h), K.free();
3212
3212
  }
3213
- castShape(A, I, g, C, B, i, D, o, w, h, K, s, k, M, a) {
3214
- let y = N.intoRaw(C), F = q.intoRaw(B), R = N.intoRaw(i), r = D.intoRaw(), p = HA.fromRaw(g, this.raw.castShape(A.raw, I.raw, g.raw, y, F, R, r, o, w, h, K, s, k, M, a));
3215
- return y.free(), F.free(), R.free(), r.free(), p;
3213
+ castShape(A, I, g, C, B, i, D, o, w, h, K, s, k, M, F) {
3214
+ let y = N.intoRaw(C), a = q.intoRaw(B), R = N.intoRaw(i), r = D.intoRaw(), p = HA.fromRaw(g, this.raw.castShape(A.raw, I.raw, g.raw, y, a, R, r, o, w, h, K, s, k, M, F));
3215
+ return y.free(), a.free(), R.free(), r.free(), p;
3216
3216
  }
3217
3217
  intersectionsWithShape(A, I, g, C, B, i, D, o, w, h, K, s) {
3218
- let k = N.intoRaw(C), M = q.intoRaw(B), a = i.intoRaw();
3219
- this.raw.intersectionsWithShape(A.raw, I.raw, g.raw, k, M, a, D, o, w, h, K, s), k.free(), M.free(), a.free();
3218
+ let k = N.intoRaw(C), M = q.intoRaw(B), F = i.intoRaw();
3219
+ this.raw.intersectionsWithShape(A.raw, I.raw, g.raw, k, M, F, D, o, w, h, K, s), k.free(), M.free(), F.free();
3220
3220
  }
3221
3221
  collidersWithAabbIntersectingAabb(A, I, g, C, B, i) {
3222
3222
  let D = N.intoRaw(C), o = N.intoRaw(B);
@@ -3355,8 +3355,8 @@ class W {
3355
3355
  const k = A.coTriMeshFlags(I);
3356
3356
  return new fI(i, D, k);
3357
3357
  case x.HeightField:
3358
- const M = A.coHeightfieldScale(I), a = A.coHeightfieldHeights(I);
3359
- return new bI(a, M);
3358
+ const M = A.coHeightfieldScale(I), F = A.coHeightfieldHeights(I);
3359
+ return new bI(F, M);
3360
3360
  case x.ConvexPolygon:
3361
3361
  return i = A.coVertices(I), new ZA(i, !1);
3362
3362
  case x.RoundConvexPolygon:
@@ -3366,8 +3366,8 @@ class W {
3366
3366
  }
3367
3367
  }
3368
3368
  castShape(A, I, g, C, B, i, D, o, w, h) {
3369
- let K = N.intoRaw(A), s = q.intoRaw(I), k = N.intoRaw(g), M = N.intoRaw(B), a = q.intoRaw(i), y = N.intoRaw(D), F = this.intoRaw(), R = C.intoRaw(), r = sA.fromRaw(null, F.castShape(K, s, k, R, M, a, y, o, w, h));
3370
- return K.free(), s.free(), k.free(), M.free(), a.free(), y.free(), F.free(), R.free(), r;
3369
+ let K = N.intoRaw(A), s = q.intoRaw(I), k = N.intoRaw(g), M = N.intoRaw(B), F = q.intoRaw(i), y = N.intoRaw(D), a = this.intoRaw(), R = C.intoRaw(), r = sA.fromRaw(null, a.castShape(K, s, k, R, M, F, y, o, w, h));
3370
+ return K.free(), s.free(), k.free(), M.free(), F.free(), y.free(), a.free(), R.free(), r;
3371
3371
  }
3372
3372
  intersectsShape(A, I, g, C, B) {
3373
3373
  let i = N.intoRaw(A), D = q.intoRaw(I), o = N.intoRaw(C), w = q.intoRaw(B), h = this.intoRaw(), K = g.intoRaw(), s = h.intersectsShape(i, D, K, o, w);
@@ -4642,7 +4642,7 @@ class KC {
4642
4642
  return this.objectStates.get(A);
4643
4643
  }
4644
4644
  load(A) {
4645
- this.artboard = A, this.reset();
4645
+ this.artboard = A, this.reset(), this.advance(0);
4646
4646
  }
4647
4647
  reset() {
4648
4648
  if (!this.artboard) return;
@@ -4705,6 +4705,27 @@ class KC {
4705
4705
  duration: I.duration
4706
4706
  });
4707
4707
  }
4708
+ this.loadFonts();
4709
+ }
4710
+ loadFonts() {
4711
+ if (!this.artboard) return;
4712
+ const A = /* @__PURE__ */ new Set();
4713
+ if (this.artboard.objects.forEach((C) => {
4714
+ C.geometry && C.geometry.type === "Text" && C.geometry.fontFamily && A.add(C.geometry.fontFamily);
4715
+ }), A.size === 0) return;
4716
+ let I = "";
4717
+ A.forEach((C) => {
4718
+ const B = C.replace(/ /g, "+");
4719
+ I += `&family=${B}:wght@400;700`;
4720
+ });
4721
+ const g = "exodeui-google-fonts";
4722
+ if (document.getElementById(g)) {
4723
+ const C = document.getElementById(g);
4724
+ C.href = `https://fonts.googleapis.com/css2?display=swap${I}`;
4725
+ } else {
4726
+ const C = document.createElement("link");
4727
+ C.id = g, C.rel = "stylesheet", C.href = `https://fonts.googleapis.com/css2?display=swap${I}`, document.head.appendChild(C);
4728
+ }
4708
4729
  }
4709
4730
  enterStates(A, I) {
4710
4731
  if (I.length === 0) return;
@@ -5091,8 +5112,8 @@ class KC {
5091
5112
  break;
5092
5113
  }
5093
5114
  const s = g * D, k = C * o;
5094
- let M = 0, a = 0;
5095
- return i.includes("Left") ? M = 0 : i.includes("Right") ? M = A - s : M = (A - s) / 2, i.includes("Top") ? a = 0 : i.includes("Bottom") ? a = I - k : a = (I - k) / 2, { scaleX: D, scaleY: o, tx: M, ty: a };
5115
+ let M = 0, F = 0;
5116
+ return i.includes("Left") ? M = 0 : i.includes("Right") ? M = A - s : M = (A - s) / 2, i.includes("Top") ? F = 0 : i.includes("Bottom") ? F = I - k : F = (I - k) / 2, { scaleX: D, scaleY: o, tx: M, ty: F };
5096
5117
  }
5097
5118
  renderObject(A, I) {
5098
5119
  const g = this.objectStates.get(I.id);
@@ -5106,15 +5127,17 @@ class KC {
5106
5127
  if (C.type === "Text") {
5107
5128
  let h = C.text;
5108
5129
  if (C.textInputId) {
5109
- const y = this.inputs.get(C.textInputId);
5110
- y !== void 0 && (h = String(y), g.geometry && (g.geometry.text = h));
5130
+ const a = this.inputs.get(C.textInputId);
5131
+ a !== void 0 && (h = String(a), g.geometry && (g.geometry.text = h));
5111
5132
  }
5112
5133
  const K = C.align || "center", s = C.width || 0;
5113
5134
  A.textAlign = K, A.textBaseline = "middle";
5114
5135
  let k = 0;
5115
5136
  K === "left" && (k = -s / 2), K === "right" && (k = s / 2);
5116
- const M = C.fontWeight || "normal", a = C.fontStyle || "normal";
5117
- A.font = `${a} ${M} ${C.fontSize}px ${C.fontFamily}`, w.fill && (A.fillStyle = w.fill.color, A.globalAlpha = (g.opacity ?? 1) * (w.fill.opacity ?? 1), A.fillText(h, k, 0)), w.stroke && w.stroke.width > 0 && (A.strokeStyle = w.stroke.color, A.lineWidth = w.stroke.width, A.globalAlpha = (g.opacity ?? 1) * (w.stroke.opacity ?? 1), A.strokeText(h, k, 0));
5137
+ const M = C.fontWeight || "normal", F = C.fontStyle || "normal";
5138
+ A.font = `${F} ${M} ${C.fontSize}px ${C.fontFamily}`;
5139
+ const y = s > 0 ? s : void 0;
5140
+ w.fill && (A.fillStyle = w.fill.color, A.globalAlpha = (g.opacity ?? 1) * (w.fill.opacity ?? 1), A.fillText(h, k, 0, y)), w.stroke && w.stroke.width > 0 && (A.strokeStyle = w.stroke.color, A.lineWidth = w.stroke.width, A.globalAlpha = (g.opacity ?? 1) * (w.stroke.opacity ?? 1), A.strokeText(h, k, 0, y));
5118
5141
  } else if (C.type === "Image") {
5119
5142
  const h = C.src;
5120
5143
  if (h) {
@@ -5129,13 +5152,13 @@ class KC {
5129
5152
  if (!k) {
5130
5153
  k = new Image();
5131
5154
  let M = h;
5132
- C.colors && C.colors.length > 0 && K.length > 0 && C.colors.forEach((F, R) => {
5155
+ C.colors && C.colors.length > 0 && K.length > 0 && C.colors.forEach((a, R) => {
5133
5156
  if (K[R]) {
5134
- const r = F.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&"), p = new RegExp(r, "gi");
5157
+ const r = a.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&"), p = new RegExp(r, "gi");
5135
5158
  M = M.replace(p, K[R]);
5136
5159
  }
5137
5160
  });
5138
- const a = new Blob([M], { type: "image/svg+xml" }), y = URL.createObjectURL(a);
5161
+ const F = new Blob([M], { type: "image/svg+xml" }), y = URL.createObjectURL(F);
5139
5162
  k.src = y, this.imageCache.set(s, k);
5140
5163
  }
5141
5164
  k.complete && k.naturalWidth > 0 && (A.globalAlpha = g.opacity ?? 1, A.drawImage(k, -B / 2, -i / 2, B, i));
@@ -5152,8 +5175,8 @@ class KC {
5152
5175
  else if (C.type === "Star") {
5153
5176
  const h = C.inner_radius, K = C.outer_radius, s = C.points || 5;
5154
5177
  for (let k = 0; k < s * 2; k++) {
5155
- const M = k * Math.PI / s - Math.PI / 2, a = k % 2 === 0 ? K : h, y = a * Math.cos(M), F = a * Math.sin(M);
5156
- k === 0 ? A.moveTo(y, F) : A.lineTo(y, F);
5178
+ const M = k * Math.PI / s - Math.PI / 2, F = k % 2 === 0 ? K : h, y = F * Math.cos(M), a = F * Math.sin(M);
5179
+ k === 0 ? A.moveTo(y, a) : A.lineTo(y, a);
5157
5180
  }
5158
5181
  A.closePath();
5159
5182
  }
@@ -5184,84 +5207,84 @@ class KC {
5184
5207
  pointFill: I.pointFill || "#ffffff",
5185
5208
  pointStrokeColor: I.pointStrokeColor || I.lineColor || "#3b82f6",
5186
5209
  pointStrokeWidth: I.pointStrokeWidth || 2
5187
- }]), !B || B.length === 0 || !B.some((a) => a.data && a.data.length >= 2)) {
5210
+ }]), !B || B.length === 0 || !B.some((F) => F.data && F.data.length >= 2)) {
5188
5211
  A.save(), A.fillStyle = "#6366f1", A.font = "12px Inter, system-ui, sans-serif", A.textAlign = "center", A.textBaseline = "middle", A.fillText("NO DATA", 0, 0), A.restore();
5189
5212
  return;
5190
5213
  }
5191
5214
  let i = 1 / 0, D = -1 / 0, o = 0;
5192
- if (B.forEach((a) => {
5193
- let y = a.data;
5194
- if (a.isVarEnabled && a.inputId) {
5195
- let F = this.inputs.get(a.inputId);
5196
- if (F === void 0) {
5197
- const R = this.inputNameMap.get(a.inputId);
5198
- R && R.length > 0 && (F = this.inputs.get(R[0]));
5215
+ if (B.forEach((F) => {
5216
+ let y = F.data;
5217
+ if (F.isVarEnabled && F.inputId) {
5218
+ let a = this.inputs.get(F.inputId);
5219
+ if (a === void 0) {
5220
+ const R = this.inputNameMap.get(F.inputId);
5221
+ R && R.length > 0 && (a = this.inputs.get(R[0]));
5199
5222
  }
5200
- F && Array.isArray(F) && (y = F);
5223
+ a && Array.isArray(a) && (y = a);
5201
5224
  }
5202
5225
  if (y && y.length > 0) {
5203
- const F = y.filter((R) => typeof R == "number" && !isNaN(R));
5204
- F.length > 0 && (i = Math.min(i, ...F), D = Math.max(D, ...F), o = Math.max(o, y.length));
5226
+ const a = y.filter((R) => typeof R == "number" && !isNaN(R));
5227
+ a.length > 0 && (i = Math.min(i, ...a), D = Math.max(D, ...a), o = Math.max(o, y.length));
5205
5228
  }
5206
- a._resolvedData = y;
5229
+ F._resolvedData = y;
5207
5230
  }), o < 2) return;
5208
- const w = D - i, h = g / (o - 1), K = (a) => {
5209
- const y = w === 0 ? 0.5 : (a - i) / w;
5231
+ const w = D - i, h = g / (o - 1), K = (F) => {
5232
+ const y = w === 0 ? 0.5 : (F - i) / w;
5210
5233
  return C / 2 - y * C;
5211
- }, s = (a) => a * h - g / 2, k = I.axisColor || "#333333";
5234
+ }, s = (F) => F * h - g / 2, k = I.axisColor || "#333333";
5212
5235
  if (I.showXAxis && (A.beginPath(), A.strokeStyle = I.xAxisColor || k, A.lineWidth = 1, A.moveTo(-g / 2, C / 2), A.lineTo(g / 2, C / 2), A.stroke()), I.showYAxis && (A.beginPath(), A.strokeStyle = I.yAxisColor || k, A.lineWidth = 1, A.moveTo(-g / 2, -C / 2), A.lineTo(-g / 2, C / 2), A.stroke()), A.fillStyle = I.axisLabelColor || "#333333", A.font = `${I.axisLabelFontSize || 10}px Inter, sans-serif`, I.showXLabels) {
5213
5236
  A.textAlign = "center", A.textBaseline = "top";
5214
- for (let a = 0; a < o; a++) {
5215
- const y = s(a);
5216
- A.fillText(`${a + 1}`, y, C / 2 + 5);
5237
+ for (let F = 0; F < o; F++) {
5238
+ const y = s(F);
5239
+ A.fillText(`${F + 1}`, y, C / 2 + 5);
5217
5240
  }
5218
5241
  }
5219
5242
  if (I.showYLabels) {
5220
5243
  A.textAlign = "right", A.textBaseline = "middle";
5221
- const a = -g / 2 - 5, y = (D + i) / 2;
5222
- A.fillText(D.toFixed(1), a, K(D)), A.fillText(y.toFixed(1), a, K(y)), A.fillText(i.toFixed(1), a, K(i));
5244
+ const F = -g / 2 - 5, y = (D + i) / 2;
5245
+ A.fillText(D.toFixed(1), F, K(D)), A.fillText(y.toFixed(1), F, K(y)), A.fillText(i.toFixed(1), F, K(i));
5223
5246
  }
5224
5247
  const M = 10;
5225
- if (B.forEach((a) => {
5226
- const y = a._resolvedData;
5248
+ if (B.forEach((F) => {
5249
+ const y = F._resolvedData;
5227
5250
  if (!(!y || y.length < 2)) {
5228
- if (a.showArea) {
5229
- if (A.beginPath(), A.moveTo(s(0), C / 2), A.lineTo(s(0), K(y[0])), a.smoothing && y.length > 2)
5230
- for (let F = 0; F < y.length - 1; F++) {
5231
- const R = y[F === 0 ? F : F - 1], r = y[F], p = y[F + 1], j = y[F + 1 === y.length - 1 ? F + 1 : F + 2];
5251
+ if (F.showArea) {
5252
+ if (A.beginPath(), A.moveTo(s(0), C / 2), A.lineTo(s(0), K(y[0])), F.smoothing && y.length > 2)
5253
+ for (let a = 0; a < y.length - 1; a++) {
5254
+ const R = y[a === 0 ? a : a - 1], r = y[a], p = y[a + 1], j = y[a + 1 === y.length - 1 ? a + 1 : a + 2];
5232
5255
  for (let b = 1; b <= M; b++) {
5233
5256
  const z = b / M, _ = this._catmullRom(R, r, p, j, z);
5234
- A.lineTo(s(F + z), K(_));
5257
+ A.lineTo(s(a + z), K(_));
5235
5258
  }
5236
5259
  }
5237
5260
  else
5238
- for (let F = 1; F < y.length; F++)
5239
- A.lineTo(s(F), K(y[F]));
5240
- A.lineTo(s(y.length - 1), C / 2), A.closePath(), A.globalAlpha = I.areaOpacity ?? 0.3, A.fillStyle = a.areaColor || "rgba(139, 92, 246, 0.2)", A.fill(), A.globalAlpha = 1;
5261
+ for (let a = 1; a < y.length; a++)
5262
+ A.lineTo(s(a), K(y[a]));
5263
+ A.lineTo(s(y.length - 1), C / 2), A.closePath(), A.globalAlpha = I.areaOpacity ?? 0.3, A.fillStyle = F.areaColor || "rgba(139, 92, 246, 0.2)", A.fill(), A.globalAlpha = 1;
5241
5264
  }
5242
- if (A.beginPath(), A.strokeStyle = a.lineColor || "#3b82f6", A.lineWidth = a.lineWidth || 2, A.lineJoin = "round", A.lineCap = "round", A.moveTo(s(0), K(y[0])), a.smoothing && y.length > 2)
5243
- for (let F = 0; F < y.length - 1; F++) {
5244
- const R = y[F === 0 ? F : F - 1], r = y[F], p = y[F + 1], j = y[F + 1 === y.length - 1 ? F + 1 : F + 2];
5265
+ if (A.beginPath(), A.strokeStyle = F.lineColor || "#3b82f6", A.lineWidth = F.lineWidth || 2, A.lineJoin = "round", A.lineCap = "round", A.moveTo(s(0), K(y[0])), F.smoothing && y.length > 2)
5266
+ for (let a = 0; a < y.length - 1; a++) {
5267
+ const R = y[a === 0 ? a : a - 1], r = y[a], p = y[a + 1], j = y[a + 1 === y.length - 1 ? a + 1 : a + 2];
5245
5268
  for (let b = 1; b <= M; b++) {
5246
5269
  const z = b / M, _ = this._catmullRom(R, r, p, j, z);
5247
- A.lineTo(s(F + z), K(_));
5270
+ A.lineTo(s(a + z), K(_));
5248
5271
  }
5249
5272
  }
5250
5273
  else
5251
- for (let F = 1; F < y.length; F++)
5252
- A.lineTo(s(F), K(y[F]));
5253
- A.stroke(), a.showPoints && y.forEach((F, R) => {
5254
- const r = s(R), p = K(F);
5255
- A.beginPath(), A.arc(r, p, (a.pointSize || 6) / 2, 0, Math.PI * 2), A.fillStyle = a.pointFill || "#ffffff", A.fill(), A.strokeStyle = a.pointStrokeColor || a.lineColor || "#3b82f6", A.lineWidth = a.pointStrokeWidth || 1, A.stroke();
5274
+ for (let a = 1; a < y.length; a++)
5275
+ A.lineTo(s(a), K(y[a]));
5276
+ A.stroke(), F.showPoints && y.forEach((a, R) => {
5277
+ const r = s(R), p = K(a);
5278
+ A.beginPath(), A.arc(r, p, (F.pointSize || 6) / 2, 0, Math.PI * 2), A.fillStyle = F.pointFill || "#ffffff", A.fill(), A.strokeStyle = F.pointStrokeColor || F.lineColor || "#3b82f6", A.lineWidth = F.pointStrokeWidth || 1, A.stroke();
5256
5279
  });
5257
5280
  }
5258
5281
  }), I.showLegend && B.length > 0) {
5259
- const a = g / 2 - 10;
5282
+ const F = g / 2 - 10;
5260
5283
  let y = -C / 2 + 15;
5261
- const F = I.legendFontSize || 10, R = F + 5;
5262
- A.font = `${F}px Inter, sans-serif`, A.textAlign = "right", A.textBaseline = "alphabetic", B.forEach((r) => {
5284
+ const a = I.legendFontSize || 10, R = a + 5;
5285
+ A.font = `${a}px Inter, sans-serif`, A.textAlign = "right", A.textBaseline = "alphabetic", B.forEach((r) => {
5263
5286
  const j = r.label || "Series", b = A.measureText(j).width;
5264
- A.beginPath(), A.rect(a - b - 8 - 5, y - (8 / 2 + 2), 8, 8), A.fillStyle = r.lineColor || "#3b82f6", A.fill(), A.fillStyle = I.legendColor || "#333333", A.fillText(j, a, y), y += R;
5287
+ A.beginPath(), A.rect(F - b - 8 - 5, y - (8 / 2 + 2), 8, 8), A.fillStyle = r.lineColor || "#3b82f6", A.fill(), A.fillStyle = I.legendColor || "#333333", A.fillText(j, F, y), y += R;
5265
5288
  });
5266
5289
  }
5267
5290
  }
@@ -5281,7 +5304,7 @@ const kC = mg(
5281
5304
  w && s.current.setInputUpdateCallback(w);
5282
5305
  }, [w]), yA(() => {
5283
5306
  (async () => {
5284
- const F = s.current;
5307
+ const a = s.current;
5285
5308
  let R = E;
5286
5309
  if (!R && A)
5287
5310
  try {
@@ -5290,27 +5313,27 @@ const kC = mg(
5290
5313
  console.error("Failed to load ExodeUI animation:", r);
5291
5314
  return;
5292
5315
  }
5293
- R && (F.load(R), D && D(F));
5316
+ R && (a.load(R), D && D(a));
5294
5317
  })();
5295
5318
  }, [E, A]), yA(() => {
5296
- const y = s.current, F = K.current;
5297
- if (!F) return;
5298
- const R = F.getContext("2d");
5319
+ const y = s.current, a = K.current;
5320
+ if (!a) return;
5321
+ const R = a.getContext("2d");
5299
5322
  if (!R) return;
5300
5323
  const r = (p) => {
5301
5324
  M.current || (M.current = p);
5302
5325
  const j = (p - M.current) / 1e3;
5303
5326
  M.current = p, C && y.advance(j);
5304
- const b = window.devicePixelRatio || 1, z = F.getBoundingClientRect(), _ = Math.floor(z.width * b), kA = Math.floor(z.height * b);
5305
- (F.width !== _ || F.height !== kA) && (F.width = _, F.height = kA), y.render(R, _, kA), k.current = requestAnimationFrame(r);
5327
+ const b = window.devicePixelRatio || 1, z = a.getBoundingClientRect(), _ = Math.floor(z.width * b), kA = Math.floor(z.height * b);
5328
+ (a.width !== _ || a.height !== kA) && (a.width = _, a.height = kA), y.render(R, _, kA), k.current = requestAnimationFrame(r);
5306
5329
  };
5307
5330
  return k.current = requestAnimationFrame(r), () => {
5308
5331
  k.current && cancelAnimationFrame(k.current);
5309
5332
  };
5310
5333
  }, [C]);
5311
- const a = (y, F) => {
5334
+ const F = (y, a) => {
5312
5335
  const R = y.currentTarget.getBoundingClientRect(), r = y.clientX - R.left, p = y.clientY - R.top, j = R.width, b = R.height;
5313
- s.current.handlePointerInput(F, r, p, j, b);
5336
+ s.current.handlePointerInput(a, r, p, j, b);
5314
5337
  };
5315
5338
  return /* @__PURE__ */ Xg(
5316
5339
  "canvas",
@@ -5318,11 +5341,11 @@ const kC = mg(
5318
5341
  ref: K,
5319
5342
  style: { width: "100%", height: "100%", ...g },
5320
5343
  className: I,
5321
- onPointerDown: (y) => a(y, "down"),
5322
- onPointerUp: (y) => a(y, "up"),
5323
- onPointerMove: (y) => a(y, "move"),
5324
- onPointerLeave: (y) => a(y, "blur"),
5325
- onClick: (y) => a(y, "click")
5344
+ onPointerDown: (y) => F(y, "down"),
5345
+ onPointerUp: (y) => F(y, "up"),
5346
+ onPointerMove: (y) => F(y, "move"),
5347
+ onPointerLeave: (y) => F(y, "blur"),
5348
+ onClick: (y) => F(y, "click")
5326
5349
  }
5327
5350
  );
5328
5351
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "exodeui",
3
- "version": "2.5.2",
3
+ "version": "2.5.4",
4
4
  "description": "React Runtime for ExodeUI Animation Engine",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",