@fileverse-dev/ddoc 2.3.0-patch-1 → 2.3.0-patch-3

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 { B as p, g as m, s as w, d as k, i as b, l as L, a as O, c as E, b as x, e as R, H as y, f as M } from "./index-Cpi2heJH.mjs";
1
+ import { B as p, g as m, s as w, d as k, i as b, l as L, a as O, c as E, b as x, e as R, H as y, f as M } from "./index-C1OkUAhl.mjs";
2
2
  class S extends p {
3
3
  constructor({ callbackSelector: r, cause: a, data: n, extraData: i, sender: f, urls: t }) {
4
4
  var o;
@@ -89093,7 +89093,7 @@ async function e5(e, t) {
89093
89093
  });
89094
89094
  return Z === "0x" ? { data: void 0 } : { data: Z };
89095
89095
  } catch (G) {
89096
- const B = E7t(G), { offchainLookup: O, offchainLookupSignature: H } = await import("./ccip-K_5DUUoN.mjs");
89096
+ const B = E7t(G), { offchainLookup: O, offchainLookupSignature: H } = await import("./ccip-DHfdEhcj.mjs");
89097
89097
  if (e.ccipRead !== !1 && (B == null ? void 0 : B.slice(0, 10)) === H && k)
89098
89098
  return { data: await O(e, { data: B, to: k }) };
89099
89099
  throw D && (B == null ? void 0 : B.slice(0, 10)) === "0x101bb98d" ? new Lkt({ factory: u }) : bQ(G, {
@@ -123505,7 +123505,8 @@ const Gre = ({
123505
123505
  "text-center": e.attrs.dataAlign === "center",
123506
123506
  "text-right": e.attrs.dataAlign === "end"
123507
123507
  }
123508
- )
123508
+ ),
123509
+ disabled: r
123509
123510
  }
123510
123511
  ) }),
123511
123512
  e.attrs.caption && !e.attrs.showCaptionInput && /* @__PURE__ */ F.jsx("div", { className: "caption", children: e.attrs.caption }),
@@ -128966,9 +128967,13 @@ const ZVt = ke.memo(
128966
128967
  /youtu\.?be(?:\.com)?\/(?:.*v(?:\/|=)|(?:.*\/)?)([a-zA-Z0-9-_]+)/
128967
128968
  );
128968
128969
  if (L) {
128969
- const re = `https://www.youtube.com/embed/${L[1]}`;
128970
- q("iframe", re);
128971
- return;
128970
+ const re = D.trim(), ue = A.trim();
128971
+ if (re === ue) {
128972
+ const me = `https://www.youtube.com/embed/${L[1]}`;
128973
+ q("iframe", me);
128974
+ return;
128975
+ } else
128976
+ return;
128972
128977
  }
128973
128978
  const z = D.match(
128974
128979
  /vimeo\.com\/([a-zA-Z0-9-_]+)/
@@ -129367,82 +129372,79 @@ const boe = Pt.create({
129367
129372
  return !1;
129368
129373
  },
129369
129374
  Backspace: ({ editor: e }) => {
129370
- var f;
129375
+ var d;
129371
129376
  const {
129372
129377
  selection: { $head: t, from: n, to: r },
129373
129378
  doc: o
129374
129379
  } = e.state;
129375
129380
  if (n !== r)
129376
129381
  return n <= 2 ? !1 : e.chain().deleteSelection().focus().run();
129377
- const i = t.node(t.depth - 1), a = t.node(t.depth), l = t.start() === n;
129378
- if (n === 2 && n === r)
129379
- return e.chain().deleteNode(this.name).focus().run();
129380
- const u = (i == null ? void 0 : i.type.name) === "listItem" || (i == null ? void 0 : i.type.name) === "taskItem", d = (a == null ? void 0 : a.textContent) === "";
129382
+ const i = t.node(t.depth - 1), a = t.node(t.depth), l = t.start() === n, c = (i == null ? void 0 : i.type.name) === "listItem" || (i == null ? void 0 : i.type.name) === "taskItem", u = (a == null ? void 0 : a.textContent) === "";
129381
129383
  if ((i == null ? void 0 : i.type.name) !== "dBlock") {
129382
- let h = !1, p = -1;
129383
- if (o.descendants((m, g) => {
129384
- if (p !== -1) return !1;
129385
- m.type.name === "pageBreak" && g < n && (h = !0, p = g);
129386
- }), h && d && n === p + 2)
129384
+ let f = !1, h = -1;
129385
+ if (o.descendants((p, m) => {
129386
+ if (h !== -1) return !1;
129387
+ p.type.name === "pageBreak" && m < n && (f = !0, h = m);
129388
+ }), f && u && n === h + 2)
129387
129389
  return !0;
129388
- if (l && u) {
129389
- const m = n > 4 ? ((f = o.nodeAt(n - 4)) == null ? void 0 : f.type.name) === "dBlock" : !1, g = t.node(t.depth - 2), b = t.index(t.depth - 2) === 0, k = g.childCount === 1, v = t.index(t.depth - 2) === g.childCount - 1, x = a.content.content.some(
129390
- (j) => j.type.name === "bulletList" || j.type.name === "orderedList" || j.type.name === "taskList"
129391
- ), w = n <= 4, M = b && w, E = () => {
129392
- var I;
129393
- const j = t.node(t.depth - 2), D = t.before(t.depth - 2), T = D + j.nodeSize;
129394
- if (j.content && j.content.size > 0) {
129395
- const _ = j.content.firstChild, q = [];
129396
- if (_) {
129397
- const U = ((I = _.content) == null ? void 0 : I.toJSON()) || [], G = U.filter(
129398
- (O) => !["bulletList", "orderedList", "taskList"].includes(
129399
- O.type
129390
+ if (l && c) {
129391
+ const p = n > 4 ? ((d = o.nodeAt(n - 4)) == null ? void 0 : d.type.name) === "dBlock" : !1, m = t.node(t.depth - 2), g = t.index(t.depth - 2) === 0, b = m.childCount === 1, k = t.index(t.depth - 2) === m.childCount - 1, v = a.content.content.some(
129392
+ (E) => E.type.name === "bulletList" || E.type.name === "orderedList" || E.type.name === "taskList"
129393
+ ), x = n <= 4, w = g && x, M = () => {
129394
+ var T;
129395
+ const E = t.node(t.depth - 2), j = t.before(t.depth - 2), D = j + E.nodeSize;
129396
+ if (E.content && E.content.size > 0) {
129397
+ const I = E.content.firstChild, _ = [];
129398
+ if (I) {
129399
+ const q = ((T = I.content) == null ? void 0 : T.toJSON()) || [], U = q.filter(
129400
+ (B) => !["bulletList", "orderedList", "taskList"].includes(
129401
+ B.type
129400
129402
  )
129401
129403
  );
129402
- q.push({
129404
+ _.push({
129403
129405
  type: "dBlock",
129404
- content: G.length > 0 ? G : [
129406
+ content: U.length > 0 ? U : [
129405
129407
  {
129406
129408
  type: "paragraph"
129407
129409
  }
129408
129410
  ]
129409
129411
  });
129410
- const B = U.filter(
129411
- (O) => ["bulletList", "orderedList", "taskList"].includes(
129412
- O.type
129412
+ const G = q.filter(
129413
+ (B) => ["bulletList", "orderedList", "taskList"].includes(
129414
+ B.type
129413
129415
  )
129414
129416
  );
129415
- if (B && B.length > 0 && B.forEach((O) => {
129416
- q.push({
129417
+ if (G && G.length > 0 && G.forEach((B) => {
129418
+ _.push({
129417
129419
  type: "dBlock",
129418
- content: [O]
129420
+ content: [B]
129419
129421
  });
129420
- }), j.content.size > 1) {
129421
- const O = j.content.toJSON().slice(1);
129422
- O.length > 0 && q.push({
129422
+ }), E.content.size > 1) {
129423
+ const B = E.content.toJSON().slice(1);
129424
+ B.length > 0 && _.push({
129423
129425
  type: "dBlock",
129424
129426
  content: [
129425
129427
  {
129426
- type: j.type.name,
129427
- content: O
129428
+ type: E.type.name,
129429
+ content: B
129428
129430
  }
129429
129431
  ]
129430
129432
  });
129431
129433
  }
129432
129434
  }
129433
- return e.chain().command(({ tr: U, dispatch: G }) => {
129434
- if (G) {
129435
- U.replaceWith(
129435
+ return e.chain().command(({ tr: q, dispatch: U }) => {
129436
+ if (U) {
129437
+ q.replaceWith(
129438
+ j,
129436
129439
  D,
129437
- T,
129438
129440
  e.schema.nodeFromJSON({
129439
129441
  type: "doc",
129440
- content: q
129442
+ content: _
129441
129443
  })
129442
129444
  );
129443
- const B = D + 4;
129444
- U.setSelection(
129445
- ht.create(U.doc, B)
129445
+ const G = j + 4;
129446
+ q.setSelection(
129447
+ ht.create(q.doc, G)
129446
129448
  );
129447
129449
  }
129448
129450
  return !1;
@@ -129450,16 +129452,16 @@ const boe = Pt.create({
129450
129452
  }
129451
129453
  return !1;
129452
129454
  };
129453
- if (M && n === 4 || d && x)
129454
- return E();
129455
- if (d && b && !x)
129456
- return k && m ? E() : !1;
129457
- if (d && !b)
129458
- return x ? E() : !1;
129455
+ if (w && n === 4 || u && v)
129456
+ return M();
129457
+ if (u && g && !v)
129458
+ return b && p ? M() : !1;
129459
+ if (u && !g)
129460
+ return v ? M() : !1;
129459
129461
  if (l)
129460
- return b && m ? E() : !1;
129461
- if (v && d && !x)
129462
- return E();
129462
+ return g && p ? M() : !1;
129463
+ if (k && u && !v)
129464
+ return M();
129463
129465
  }
129464
129466
  }
129465
129467
  return !1;
package/dist/index.es.js CHANGED
@@ -1,4 +1,4 @@
1
- import { D as d, E as r, P as s, R as a, h as t, u as i } from "./index-Cpi2heJH.mjs";
1
+ import { D as d, E as r, P as s, R as a, h as t, u as i } from "./index-C1OkUAhl.mjs";
2
2
  export {
3
3
  d as DdocEditor,
4
4
  r as Editor,
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@fileverse-dev/ddoc",
3
3
  "private": false,
4
4
  "description": "DDoc",
5
- "version": "2.3.0-patch-1",
5
+ "version": "2.3.0-patch-3",
6
6
  "main": "dist/index.es.js",
7
7
  "module": "dist/index.es.js",
8
8
  "exports": {