@jieyin/editor-sdk 1.1.119 → 1.1.121

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.
@@ -89,14 +89,14 @@ const q = class T {
89
89
  return !1;
90
90
  if (e)
91
91
  try {
92
- const n = this.getDeviceID(), r = this.getDomain(), u = await (await fetch(`${e}/api/v1/license/verify`, {
92
+ const n = this.getDeviceID(), r = this.getDomain(), u = await (await fetch(`${e}/jet_license/interface/license/verify`, {
93
93
  method: "POST",
94
94
  headers: {
95
95
  "Content-Type": "application/json"
96
96
  },
97
97
  body: JSON.stringify({
98
98
  token: t,
99
- device_id: n,
99
+ deviceId: n,
100
100
  domain: r
101
101
  })
102
102
  })).json();
@@ -452,8 +452,8 @@ function ie(s, t, e, n, r, o) {
452
452
  for (let a = 0; a < l.length; a += 3) {
453
453
  const h = l[a], f = l[a + 1], y = l[a + 2];
454
454
  if (!w[h] || !w[f] || !w[y]) continue;
455
- const m = w[h], A = w[f], E = w[y], g = V(m.x, m.y, i), M = V(A.x, A.y, i), x = V(E.x, E.y, i), p = X(t), S = { x: g.x * p.width, y: g.y * p.height }, I = { x: M.x * p.width, y: M.y * p.height }, D = { x: x.x * p.width, y: x.y * p.height }, B = c[h], F = c[f], P = c[y];
456
- J(s, t, S, I, D, B, F, P);
455
+ const m = w[h], A = w[f], E = w[y], g = V(m.x, m.y, i), M = V(A.x, A.y, i), x = V(E.x, E.y, i), p = X(t), S = { x: g.x * p.width, y: g.y * p.height }, F = { x: M.x * p.width, y: M.y * p.height }, D = { x: x.x * p.width, y: x.y * p.height }, B = c[h], v = c[f], P = c[y];
456
+ j(s, t, S, F, D, B, v, P);
457
457
  }
458
458
  }
459
459
  function ue(s, t, e, n) {
@@ -483,20 +483,20 @@ function ce(s, t, e, n, r, o, u, i) {
483
483
  for (let g = 0; g < m; g++) {
484
484
  const M = E * 3, x = g * 3, p = [], S = m * 3 + 1;
485
485
  try {
486
- for (let v = 0; v < 4; v++)
486
+ for (let I = 0; I < 4; I++)
487
487
  for (let R = 0; R < 4; R++) {
488
- const j = (M + v) * S + (x + R);
489
- n[j] && p.push(n[j]);
488
+ const J = (M + I) * S + (x + R);
489
+ n[J] && p.push(n[J]);
490
490
  }
491
491
  } catch {
492
492
  continue;
493
493
  }
494
494
  if (p.length < 16) continue;
495
- const I = p.map((v) => {
496
- const R = (v.x - c) / f, j = (v.y - a) / y;
497
- return Q(R, j, w);
498
- }), D = r[g] / u, B = r[g + 1] / u, F = o[E] / i, P = o[E + 1] / i;
499
- le(s, t, I, D, B, F, P);
495
+ const F = p.map((I) => {
496
+ const R = (I.x - c) / f, J = (I.y - a) / y;
497
+ return Q(R, J, w);
498
+ }), D = r[g] / u, B = r[g + 1] / u, v = o[E] / i, P = o[E + 1] / i;
499
+ le(s, t, F, D, B, v, P);
500
500
  }
501
501
  }
502
502
  function ae(s, t, e, n) {
@@ -515,8 +515,8 @@ function le(s, t, e, n, r, o, u) {
515
515
  const w = X(t), c = w.width, l = w.height;
516
516
  for (let a = 0; a < 20; a++)
517
517
  for (let h = 0; h < 20; h++) {
518
- const f = h / 20, y = a / 20, m = (h + 1) / 20, A = (a + 1) / 20, E = n + f * (r - n), g = n + m * (r - n), M = o + y * (u - o), x = o + A * (u - o), p = { x: E * c, y: M * l }, S = { x: g * c, y: M * l }, I = { x: E * c, y: x * l }, D = { x: g * c, y: x * l }, B = W(f, y, e), F = W(m, y, e), P = W(f, A, e), v = W(m, A, e);
519
- J(s, t, p, S, I, B, F, P), J(s, t, S, D, I, F, v, P);
518
+ const f = h / 20, y = a / 20, m = (h + 1) / 20, A = (a + 1) / 20, E = n + f * (r - n), g = n + m * (r - n), M = o + y * (u - o), x = o + A * (u - o), p = { x: E * c, y: M * l }, S = { x: g * c, y: M * l }, F = { x: E * c, y: x * l }, D = { x: g * c, y: x * l }, B = W(f, y, e), v = W(m, y, e), P = W(f, A, e), I = W(m, A, e);
519
+ j(s, t, p, S, F, B, v, P), j(s, t, S, D, F, v, I, P);
520
520
  }
521
521
  }
522
522
  function Y(s, t, e) {
@@ -531,7 +531,7 @@ function H(s, t, e, n, r, o) {
531
531
  for (let l = 0; l < o; l++) {
532
532
  const a = l / o, h = c / o, f = (l + 1) / o, y = (c + 1) / o, m = { x: a * i, y: h * w }, A = { x: f * i, y: h * w }, E = { x: a * i, y: y * w }, g = { x: f * i, y: y * w };
533
533
  let M, x, p, S;
534
- n === "bicubic" ? (M = W(a, h, e), x = W(f, h, e), p = W(a, y, e), S = W(f, y, e)) : n === "grid" ? (M = $(a, h, e, r), x = $(f, h, e, r), p = $(a, y, e, r), S = $(f, y, e, r)) : (M = N(a, h, e), x = N(f, h, e), p = N(a, y, e), S = N(f, y, e)), J(s, t, m, A, E, M, x, p), J(s, t, A, g, E, x, S, p);
534
+ n === "bicubic" ? (M = W(a, h, e), x = W(f, h, e), p = W(a, y, e), S = W(f, y, e)) : n === "grid" ? (M = $(a, h, e, r), x = $(f, h, e, r), p = $(a, y, e, r), S = $(f, y, e, r)) : (M = N(a, h, e), x = N(f, h, e), p = N(a, y, e), S = N(f, y, e)), j(s, t, m, A, E, M, x, p), j(s, t, A, g, E, x, S, p);
535
535
  }
536
536
  }
537
537
  function K(s, t) {
@@ -594,7 +594,7 @@ function Q(s, t, e) {
594
594
  throw new Error(`WASM 应用透视变换失败: ${n}`);
595
595
  }
596
596
  }
597
- function J(s, t, e, n, r, o, u, i) {
597
+ function j(s, t, e, n, r, o, u, i) {
598
598
  if (!t || "complete" in t && !t.complete || !("naturalWidth" in t ? t.naturalWidth : t.width)) return;
599
599
  const c = (o.x + u.x + i.x) / 3, l = (o.y + u.y + i.y) / 3, a = (Math.hypot(o.x - c, o.y - l) + Math.hypot(u.x - c, u.y - l) + Math.hypot(i.x - c, i.y - l)) / 3, f = a > 1 ? (a + 1.65) / a : 1.5, y = c + (o.x - c) * f, m = l + (o.y - l) * f, A = c + (u.x - c) * f, E = l + (u.y - l) * f, g = c + (i.x - c) * f, M = l + (i.y - l) * f;
600
600
  s.save(), s.beginPath(), s.moveTo(y, m), s.lineTo(A, E), s.lineTo(g, M), s.closePath(), s.clip();
@@ -603,8 +603,8 @@ function J(s, t, e, n, r, o, u, i) {
603
603
  s.restore();
604
604
  return;
605
605
  }
606
- const p = -(e.y * (i.x - u.x) - n.y * i.x + r.y * u.x + (n.y - r.y) * o.x) / x, S = (n.y * i.y + e.y * (u.y - i.y) - r.y * u.y + (r.y - n.y) * o.y) / x, I = (e.x * (i.x - u.x) - n.x * i.x + r.x * u.x + (n.x - r.x) * o.x) / x, D = -(n.x * i.y + e.x * (u.y - i.y) - r.x * u.y + (r.x - n.x) * o.y) / x, B = (e.x * (r.y * u.x - n.y * i.x) + e.y * (n.x * i.x - r.x * u.x) + (r.x * n.y - n.x * r.y) * o.x) / x, F = (e.x * (r.y * u.y - n.y * i.y) + e.y * (n.x * i.y - r.x * u.y) + (r.x * n.y - n.x * r.y) * o.y) / x;
607
- s.transform(p, S, I, D, B, F), s.drawImage(t, 0, 0), s.restore();
606
+ const p = -(e.y * (i.x - u.x) - n.y * i.x + r.y * u.x + (n.y - r.y) * o.x) / x, S = (n.y * i.y + e.y * (u.y - i.y) - r.y * u.y + (r.y - n.y) * o.y) / x, F = (e.x * (i.x - u.x) - n.x * i.x + r.x * u.x + (n.x - r.x) * o.x) / x, D = -(n.x * i.y + e.x * (u.y - i.y) - r.x * u.y + (r.x - n.x) * o.y) / x, B = (e.x * (r.y * u.x - n.y * i.x) + e.y * (n.x * i.x - r.x * u.x) + (r.x * n.y - n.x * r.y) * o.x) / x, v = (e.x * (r.y * u.y - n.y * i.y) + e.y * (n.x * i.y - r.x * u.y) + (r.x * n.y - n.x * r.y) * o.y) / x;
607
+ s.transform(p, S, F, D, B, v), s.drawImage(t, 0, 0), s.restore();
608
608
  }
609
609
  self.onmessage = async (s) => {
610
610
  if (s.data?.type === "SET_LICENSE") {