@pie-element/hotspot 11.1.2-next.8 → 11.1.2-next.9

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.
@@ -1,5 +1,5 @@
1
1
  import { a as e, n as t, o as n, s as r, t as i } from "../browser-D4gLESxz.js";
2
- import { $ as a, A as o, At as s, B as c, Bt as l, C as u, Ct as d, Dt as f, Et as p, F as m, Ft as h, G as g, Gt as _, H as v, Ht as y, I as b, It as x, J as S, Jt as C, K as ee, Kt as w, Lt as T, M as E, Mt as D, N as O, Nt as te, Ot as ne, P as re, Pt as ie, Q as k, Qt as ae, R as oe, Rt as se, S as ce, St as A, Tt as le, U as ue, Ut as de, V as fe, Vt as pe, Wt as me, X as he, Xt as ge, Y as _e, Yt as j, Z as ve, Zt as ye, _ as be, _t as xe, a as Se, at as Ce, b as we, bt as Te, c as Ee, ct as De, d as Oe, dt as ke, et as Ae, f as je, ft as Me, g as Ne, gt as Pe, h as Fe, ht as Ie, it as Le, j as Re, jt as ze, kt as Be, lt as Ve, m as He, mt as Ue, n as We, nt as Ge, o as Ke, ot as qe, p as Je, pt as Ye, q as Xe, qt as Ze, r as Qe, rt as $e, s as et, st as tt, t as nt, tt as rt, u as it, ut as at, v as ot, vt as st, w as ct, x as lt, xt as ut, y as dt, yt as ft, z as pt, zt as mt } from "../ReactKonva-Bvc_MS6V.js";
2
+ import { $ as a, A as o, At as s, B as c, Bt as l, C as u, Ct as d, Dt as f, Et as p, F as m, Ft as h, G as g, Gt as _, H as v, Ht as y, I as b, It as x, J as S, Jt as C, K as ee, Kt as w, Lt as T, M as E, Mt as D, N as O, Nt as te, Ot as ne, P as re, Pt as ie, Q as k, Qt as ae, R as oe, Rt as se, S as ce, St as A, Tt as le, U as ue, Ut as de, V as fe, Vt as pe, Wt as me, X as he, Xt as ge, Y as _e, Yt as j, Z as ve, Zt as ye, _ as be, _t as xe, a as Se, at as Ce, b as we, bt as Te, c as Ee, ct as De, d as Oe, dt as ke, et as Ae, f as je, ft as Me, g as Ne, gt as Pe, h as Fe, ht as Ie, it as Le, j as Re, jt as ze, kt as Be, lt as Ve, m as He, mt as Ue, n as We, nt as Ge, o as Ke, ot as qe, p as Je, pt as Ye, q as Xe, qt as Ze, r as Qe, rt as $e, s as et, st as tt, t as nt, tt as rt, u as it, ut as at, v as ot, vt as st, w as ct, x as lt, xt as ut, y as dt, yt as ft, z as pt, zt as mt } from "../ReactKonva-Cj44B3Ds.js";
3
3
  import { a as ht, c as gt, d as _t, f as vt, i as yt, l as bt, n as xt, o as St, r as Ct, s as wt, t as Tt, u as Et } from "../dist-CJeYAWp3.js";
4
4
  import * as M from "react";
5
5
  import N, { Component as Dt, createContext as Ot, createElement as kt, createRef as At, forwardRef as jt, memo as Mt, useCallback as Nt, useContext as Pt, useDebugValue as Ft, useEffect as It, useLayoutEffect as Lt, useMemo as Rt, useRef as zt, useState as Bt, version as Vt } from "react";
@@ -40839,34 +40839,55 @@ var OY = Wx.create({
40839
40839
  },
40840
40840
  addNodeView() {
40841
40841
  if (!this.options.resize || !this.options.resize.enabled || typeof document > "u") return null;
40842
- let { directions: e, minWidth: t, minHeight: n, alwaysPreserveAspectRatio: r } = this.options.resize;
40843
- return ({ node: i, getPos: a, HTMLAttributes: o, editor: s }) => {
40844
- let c = document.createElement("img");
40845
- Object.entries(o).forEach(([e, t]) => {
40842
+ let { directions: e, minWidth: t, minHeight: n, alwaysPreserveAspectRatio: r } = this.options.resize, i = /* @__PURE__ */ new Set([
40843
+ "src",
40844
+ "width",
40845
+ "height"
40846
+ ]);
40847
+ return ({ node: a, getPos: o, HTMLAttributes: s, editor: c }) => {
40848
+ let l = document.createElement("img");
40849
+ l.draggable = !1;
40850
+ let u = Mb(this.options.HTMLAttributes, s);
40851
+ Object.entries(u).forEach(([e, t]) => {
40846
40852
  if (t != null) switch (e) {
40853
+ case "src":
40847
40854
  case "width":
40848
40855
  case "height": break;
40849
- default:
40850
- c.setAttribute(e, t);
40851
- break;
40856
+ default: l.setAttribute(e, t);
40852
40857
  }
40853
- }), c.src = o.src;
40854
- let l = new _S({
40855
- element: c,
40856
- editor: s,
40857
- node: i,
40858
- getPos: a,
40858
+ }), u.src !== null && (l.src = u.src);
40859
+ let d = { ...s }, f = (e) => {
40860
+ if (typeof e == "string" && e !== "") {
40861
+ l.getAttribute("src") !== e && (l.src = e);
40862
+ return;
40863
+ }
40864
+ l.hasAttribute("src") && l.removeAttribute("src"), l.src !== "" && (l.src = "");
40865
+ };
40866
+ f(s.src);
40867
+ let p = new _S({
40868
+ element: l,
40869
+ editor: c,
40870
+ node: a,
40871
+ getPos: o,
40859
40872
  onResize: (e, t) => {
40860
- c.style.width = `${e}px`, c.style.height = `${t}px`;
40873
+ l.style.width = `${e}px`, l.style.height = `${t}px`;
40861
40874
  },
40862
40875
  onCommit: (e, t) => {
40863
- let n = a();
40876
+ let n = o();
40864
40877
  n !== void 0 && this.editor.chain().setNodeSelection(n).updateAttributes(this.name, {
40865
40878
  width: e,
40866
40879
  height: t
40867
40880
  }).run();
40868
40881
  },
40869
- onUpdate: (e, t, n) => e.type === i.type,
40882
+ onUpdate: (e) => {
40883
+ if (e.type !== a.type) return !1;
40884
+ let t = Nb(e, c.extensionManager.attributes.filter((t) => t.type === e.type.name));
40885
+ return Object.keys(d).forEach((e) => {
40886
+ !i.has(e) && !(e in t) && l.removeAttribute(e);
40887
+ }), Object.entries(t).forEach(([e, t]) => {
40888
+ i.has(e) || (t == null ? l.removeAttribute(e) : l.setAttribute(e, t));
40889
+ }), f(t.src), d = t, !0;
40890
+ },
40870
40891
  options: {
40871
40892
  directions: e,
40872
40893
  min: {
@@ -40875,10 +40896,10 @@ var OY = Wx.create({
40875
40896
  },
40876
40897
  preserveAspectRatio: r === !0
40877
40898
  }
40878
- }), u = l.dom;
40879
- return u.style.visibility = "hidden", u.style.pointerEvents = "none", c.onload = () => {
40880
- u.style.visibility = "", u.style.pointerEvents = "";
40881
- }, l;
40899
+ }), m = p.dom, h = () => {
40900
+ m.style.visibility = "", m.style.pointerEvents = "";
40901
+ };
40902
+ return m.style.visibility = "hidden", m.style.pointerEvents = "none", l.complete && l.naturalWidth > 0 ? h() : (l.onload = h, l.onerror = h), p;
40882
40903
  };
40883
40904
  },
40884
40905
  addCommands() {