@pie-element/multiple-choice 13.3.5-next.3 → 13.3.5-next.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.
@@ -1,4 +1,4 @@
1
- import { $ as e, A as t, At as n, B as r, Bt as i, C as a, Ct as o, D as s, Dt as c, E as l, Et as u, F as d, Ft as f, G as p, H as m, I as h, It as g, J as _, K as v, L as y, Lt as b, M as x, Mt as S, N as C, Nt as w, O as ee, Ot as T, P as te, Pt as ne, Q as E, R as re, Rt as ie, S as ae, St as oe, T as D, Tt as se, U as O, V as ce, Vt as le, W as ue, X as k, Y as de, Z as fe, _ as pe, a as me, at as he, b as ge, bt as _e, c as ve, ct as ye, d as be, dt as xe, et as Se, f as Ce, ft as we, i as Te, it as Ee, jt as A, k as De, kt as Oe, l as ke, lt as Ae, mt as je, n as Me, nt as Ne, o as Pe, ot as Fe, pt as Ie, q as Le, r as Re, rt as ze, s as Be, st as Ve, t as He, tt as Ue, u as We, ut as Ge, v as Ke, vt as qe, wt as Je, x as Ye, xt as Xe, y as Ze, yt as j, z as Qe, zt as $e } from "../Radio-IHruwm6F.js";
1
+ import { $ as e, A as t, At as n, B as r, Bt as i, C as a, Ct as o, D as s, Dt as c, E as l, Et as u, F as d, Ft as f, G as p, H as m, I as h, It as g, J as _, K as v, L as y, Lt as b, M as x, Mt as S, N as C, Nt as w, O as ee, Ot as T, P as te, Pt as ne, Q as E, R as re, Rt as ie, S as ae, St as oe, T as D, Tt as se, U as O, V as ce, Vt as le, W as ue, X as k, Y as de, Z as fe, _ as pe, a as me, at as he, b as ge, bt as _e, c as ve, ct as ye, d as be, dt as xe, et as Se, f as Ce, ft as we, i as Te, it as Ee, jt as A, k as De, kt as Oe, l as ke, lt as Ae, mt as je, n as Me, nt as Ne, o as Pe, ot as Fe, pt as Ie, q as Le, r as Re, rt as ze, s as Be, st as Ve, t as He, tt as Ue, u as We, ut as Ge, v as Ke, vt as qe, wt as Je, x as Ye, xt as Xe, y as Ze, yt as j, z as Qe, zt as $e } from "../Radio-xWBQ-YBe.js";
2
2
  import { a as et, c as tt, d as nt, f as rt, h as it, i as at, m as ot, n as st, o as ct, p as lt, r as ut, s as dt, t as ft, u as pt } from "../dist-CHbLnyuX.js";
3
3
  import * as M from "react";
4
4
  import mt, { Component as ht, createContext as gt, createElement as _t, createRef as vt, forwardRef as yt, memo as bt, useCallback as xt, useContext as St, useDebugValue as Ct, useEffect as wt, useLayoutEffect as Tt, useMemo as Et, useRef as Dt, useState as Ot, version as kt } from "react";
@@ -39339,34 +39339,55 @@ var Bq = zm.create({
39339
39339
  },
39340
39340
  addNodeView() {
39341
39341
  if (!this.options.resize || !this.options.resize.enabled || typeof document > "u") return null;
39342
- let { directions: e, minWidth: t, minHeight: n, alwaysPreserveAspectRatio: r } = this.options.resize;
39343
- return ({ node: i, getPos: a, HTMLAttributes: o, editor: s }) => {
39344
- let c = document.createElement("img");
39345
- Object.entries(o).forEach(([e, t]) => {
39342
+ let { directions: e, minWidth: t, minHeight: n, alwaysPreserveAspectRatio: r } = this.options.resize, i = /* @__PURE__ */ new Set([
39343
+ "src",
39344
+ "width",
39345
+ "height"
39346
+ ]);
39347
+ return ({ node: a, getPos: o, HTMLAttributes: s, editor: c }) => {
39348
+ let l = document.createElement("img");
39349
+ l.draggable = !1;
39350
+ let u = Dp(this.options.HTMLAttributes, s);
39351
+ Object.entries(u).forEach(([e, t]) => {
39346
39352
  if (t != null) switch (e) {
39353
+ case "src":
39347
39354
  case "width":
39348
39355
  case "height": break;
39349
- default:
39350
- c.setAttribute(e, t);
39351
- break;
39356
+ default: l.setAttribute(e, t);
39352
39357
  }
39353
- }), c.src = o.src;
39354
- let l = new fh({
39355
- element: c,
39356
- editor: s,
39357
- node: i,
39358
- getPos: a,
39358
+ }), u.src !== null && (l.src = u.src);
39359
+ let d = { ...s }, f = (e) => {
39360
+ if (typeof e == "string" && e !== "") {
39361
+ l.getAttribute("src") !== e && (l.src = e);
39362
+ return;
39363
+ }
39364
+ l.hasAttribute("src") && l.removeAttribute("src"), l.src !== "" && (l.src = "");
39365
+ };
39366
+ f(s.src);
39367
+ let p = new fh({
39368
+ element: l,
39369
+ editor: c,
39370
+ node: a,
39371
+ getPos: o,
39359
39372
  onResize: (e, t) => {
39360
- c.style.width = `${e}px`, c.style.height = `${t}px`;
39373
+ l.style.width = `${e}px`, l.style.height = `${t}px`;
39361
39374
  },
39362
39375
  onCommit: (e, t) => {
39363
- let n = a();
39376
+ let n = o();
39364
39377
  n !== void 0 && this.editor.chain().setNodeSelection(n).updateAttributes(this.name, {
39365
39378
  width: e,
39366
39379
  height: t
39367
39380
  }).run();
39368
39381
  },
39369
- onUpdate: (e, t, n) => e.type === i.type,
39382
+ onUpdate: (e) => {
39383
+ if (e.type !== a.type) return !1;
39384
+ let t = Op(e, c.extensionManager.attributes.filter((t) => t.type === e.type.name));
39385
+ return Object.keys(d).forEach((e) => {
39386
+ !i.has(e) && !(e in t) && l.removeAttribute(e);
39387
+ }), Object.entries(t).forEach(([e, t]) => {
39388
+ i.has(e) || (t == null ? l.removeAttribute(e) : l.setAttribute(e, t));
39389
+ }), f(t.src), d = t, !0;
39390
+ },
39370
39391
  options: {
39371
39392
  directions: e,
39372
39393
  min: {
@@ -39375,10 +39396,10 @@ var Bq = zm.create({
39375
39396
  },
39376
39397
  preserveAspectRatio: r === !0
39377
39398
  }
39378
- }), u = l.dom;
39379
- return u.style.visibility = "hidden", u.style.pointerEvents = "none", c.onload = () => {
39380
- u.style.visibility = "", u.style.pointerEvents = "";
39381
- }, l;
39399
+ }), m = p.dom, h = () => {
39400
+ m.style.visibility = "", m.style.pointerEvents = "";
39401
+ };
39402
+ return m.style.visibility = "hidden", m.style.pointerEvents = "none", l.complete && l.naturalWidth > 0 ? h() : (l.onload = h, l.onerror = h), p;
39382
39403
  };
39383
39404
  },
39384
39405
  addCommands() {