@fileverse-dev/ddoc 2.3.0-patch-2 → 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-a0yFL4wH.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-D_6WqKfg.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, {
@@ -128967,9 +128967,13 @@ const ZVt = ke.memo(
128967
128967
  /youtu\.?be(?:\.com)?\/(?:.*v(?:\/|=)|(?:.*\/)?)([a-zA-Z0-9-_]+)/
128968
128968
  );
128969
128969
  if (L) {
128970
- const re = `https://www.youtube.com/embed/${L[1]}`;
128971
- q("iframe", re);
128972
- 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;
128973
128977
  }
128974
128978
  const z = D.match(
128975
128979
  /vimeo\.com\/([a-zA-Z0-9-_]+)/
@@ -129368,82 +129372,79 @@ const boe = Pt.create({
129368
129372
  return !1;
129369
129373
  },
129370
129374
  Backspace: ({ editor: e }) => {
129371
- var f;
129375
+ var d;
129372
129376
  const {
129373
129377
  selection: { $head: t, from: n, to: r },
129374
129378
  doc: o
129375
129379
  } = e.state;
129376
129380
  if (n !== r)
129377
129381
  return n <= 2 ? !1 : e.chain().deleteSelection().focus().run();
129378
- const i = t.node(t.depth - 1), a = t.node(t.depth), l = t.start() === n;
129379
- if (n === 2 && n === r)
129380
- return e.chain().deleteNode(this.name).focus().run();
129381
- 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) === "";
129382
129383
  if ((i == null ? void 0 : i.type.name) !== "dBlock") {
129383
- let h = !1, p = -1;
129384
- if (o.descendants((m, g) => {
129385
- if (p !== -1) return !1;
129386
- m.type.name === "pageBreak" && g < n && (h = !0, p = g);
129387
- }), 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)
129388
129389
  return !0;
129389
- if (l && u) {
129390
- 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(
129391
- (j) => j.type.name === "bulletList" || j.type.name === "orderedList" || j.type.name === "taskList"
129392
- ), w = n <= 4, M = b && w, E = () => {
129393
- var I;
129394
- const j = t.node(t.depth - 2), D = t.before(t.depth - 2), T = D + j.nodeSize;
129395
- if (j.content && j.content.size > 0) {
129396
- const _ = j.content.firstChild, q = [];
129397
- if (_) {
129398
- const U = ((I = _.content) == null ? void 0 : I.toJSON()) || [], G = U.filter(
129399
- (O) => !["bulletList", "orderedList", "taskList"].includes(
129400
- 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
129401
129402
  )
129402
129403
  );
129403
- q.push({
129404
+ _.push({
129404
129405
  type: "dBlock",
129405
- content: G.length > 0 ? G : [
129406
+ content: U.length > 0 ? U : [
129406
129407
  {
129407
129408
  type: "paragraph"
129408
129409
  }
129409
129410
  ]
129410
129411
  });
129411
- const B = U.filter(
129412
- (O) => ["bulletList", "orderedList", "taskList"].includes(
129413
- O.type
129412
+ const G = q.filter(
129413
+ (B) => ["bulletList", "orderedList", "taskList"].includes(
129414
+ B.type
129414
129415
  )
129415
129416
  );
129416
- if (B && B.length > 0 && B.forEach((O) => {
129417
- q.push({
129417
+ if (G && G.length > 0 && G.forEach((B) => {
129418
+ _.push({
129418
129419
  type: "dBlock",
129419
- content: [O]
129420
+ content: [B]
129420
129421
  });
129421
- }), j.content.size > 1) {
129422
- const O = j.content.toJSON().slice(1);
129423
- O.length > 0 && q.push({
129422
+ }), E.content.size > 1) {
129423
+ const B = E.content.toJSON().slice(1);
129424
+ B.length > 0 && _.push({
129424
129425
  type: "dBlock",
129425
129426
  content: [
129426
129427
  {
129427
- type: j.type.name,
129428
- content: O
129428
+ type: E.type.name,
129429
+ content: B
129429
129430
  }
129430
129431
  ]
129431
129432
  });
129432
129433
  }
129433
129434
  }
129434
- return e.chain().command(({ tr: U, dispatch: G }) => {
129435
- if (G) {
129436
- U.replaceWith(
129435
+ return e.chain().command(({ tr: q, dispatch: U }) => {
129436
+ if (U) {
129437
+ q.replaceWith(
129438
+ j,
129437
129439
  D,
129438
- T,
129439
129440
  e.schema.nodeFromJSON({
129440
129441
  type: "doc",
129441
- content: q
129442
+ content: _
129442
129443
  })
129443
129444
  );
129444
- const B = D + 4;
129445
- U.setSelection(
129446
- ht.create(U.doc, B)
129445
+ const G = j + 4;
129446
+ q.setSelection(
129447
+ ht.create(q.doc, G)
129447
129448
  );
129448
129449
  }
129449
129450
  return !1;
@@ -129451,16 +129452,16 @@ const boe = Pt.create({
129451
129452
  }
129452
129453
  return !1;
129453
129454
  };
129454
- if (M && n === 4 || d && x)
129455
- return E();
129456
- if (d && b && !x)
129457
- return k && m ? E() : !1;
129458
- if (d && !b)
129459
- 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;
129460
129461
  if (l)
129461
- return b && m ? E() : !1;
129462
- if (v && d && !x)
129463
- return E();
129462
+ return g && p ? M() : !1;
129463
+ if (k && u && !v)
129464
+ return M();
129464
129465
  }
129465
129466
  }
129466
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-a0yFL4wH.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-2",
5
+ "version": "2.3.0-patch-3",
6
6
  "main": "dist/index.es.js",
7
7
  "module": "dist/index.es.js",
8
8
  "exports": {