@fileverse-dev/ddoc 3.4.6-mp-fixes-6 → 3.4.6-mp-fixes-7

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.
Files changed (2) hide show
  1. package/dist/index.es.js +55 -34
  2. package/package.json +1 -1
package/dist/index.es.js CHANGED
@@ -171577,7 +171577,7 @@ User prompt: ${u} /no_think` : `${u} /no_think`;
171577
171577
  isDestroyed: e.isDestroyed,
171578
171578
  isEmpty: e.isEmpty,
171579
171579
  editable: (t = e.view) == null ? void 0 : t.editable,
171580
- contentEditable: (r = (n = e.view) == null ? void 0 : n.dom) == null ? void 0 : r.getAttribute("contenteditable"),
171580
+ contentEditable: (r = (n = e == null ? void 0 : e.view) == null ? void 0 : n.dom) == null ? void 0 : r.getAttribute("contenteditable"),
171581
171581
  docContentSize: ((i = (o = e.state) == null ? void 0 : o.doc) == null ? void 0 : i.content.size) ?? null,
171582
171582
  topLevelChildCount: ((a = (s = e.state) == null ? void 0 : s.doc) == null ? void 0 : a.childCount) ?? null
171583
171583
  };
@@ -171826,9 +171826,7 @@ User prompt: ${u} /no_think` : `${u} /no_think`;
171826
171826
  return !Ht || !(((On = ge.current) == null ? void 0 : On.getState().focusSubmittedSuggestionFromEditor(Ht)) ?? !1) ? !1 : (Pe.preventDefault(), Pe.stopPropagation(), Re.dom.blur(), !0);
171827
171827
  },
171828
171828
  [ge]
171829
- ), Be = Te(!0), [Ie, $e] = Ne([]), [_e, ft] = Ne(null), [lt, Gt] = Ne([]), kt = Te(
171830
- /* @__PURE__ */ new Map()
171831
- ), Dt = Te(!0), Ut = Te(o);
171829
+ ), Be = Te(!0), [Ie, $e] = Ne([]), [_e, ft] = Ne(null), [lt, Gt] = Ne([]), kt = Te(/* @__PURE__ */ new Map()), Dt = Te(!0), Ut = Te(o);
171832
171830
  Ut.current = o;
171833
171831
  const Ft = Te(M);
171834
171832
  Ft.current = M, Se(() => {
@@ -172135,14 +172133,20 @@ User prompt: ${u} /no_think` : `${u} /no_think`;
172135
172133
  Zt("tab-editor-active-tab-effect-enter", {
172136
172134
  activeTabId: ne,
172137
172135
  cacheBefore: $i(kt.current, ne),
172138
- fragment: xs(se.current.ydoc, ne)
172136
+ fragment: xs(
172137
+ se.current.ydoc,
172138
+ ne
172139
+ )
172139
172140
  });
172140
172141
  const Re = ht(ne);
172141
172142
  V.current = Re.editor, ft(Re.editor), yt(), $t(), Ze(), Zt("tab-editor-active-editor-assigned", {
172142
172143
  activeTabId: ne,
172143
172144
  editor: Qn(Re.editor),
172144
172145
  cacheAfter: $i(kt.current, ne),
172145
- fragment: xs(se.current.ydoc, ne)
172146
+ fragment: xs(
172147
+ se.current.ydoc,
172148
+ ne
172149
+ )
172146
172150
  });
172147
172151
  }, [
172148
172152
  ne,
@@ -172171,7 +172175,12 @@ User prompt: ${u} /no_think` : `${u} /no_think`;
172171
172175
  te.current
172172
172176
  )
172173
172177
  }), Ze());
172174
- }, [dt, Ze, ee, Vt]), Se(() => {
172178
+ }, [
172179
+ dt,
172180
+ Ze,
172181
+ ee,
172182
+ Vt
172183
+ ]), Se(() => {
172175
172184
  V.current = _e, ue && (ue.current = _e ?? null);
172176
172185
  }, [_e, ue]);
172177
172186
  const sn = Rt(() => S, [S]);
@@ -193803,18 +193812,30 @@ const jJe = ({
193803
193812
  return { type: "object", length: t, isEmpty: t === 0 };
193804
193813
  }
193805
193814
  return { type: typeof e, length: 0, isEmpty: !1 };
193806
- }, U5 = (e) => {
193815
+ }, MJe = (e) => ({
193816
+ name: e instanceof Error ? e.name : typeof e,
193817
+ message: e instanceof Error ? e.message : String(e)
193818
+ }), U5 = (e) => {
193807
193819
  var n, r, o, i, s, a, l, u;
193808
193820
  const t = e;
193809
- return t ? {
193810
- hasEditor: !0,
193811
- isDestroyed: t.isDestroyed,
193812
- isEmpty: t.isEmpty,
193813
- editable: (n = t.view) == null ? void 0 : n.editable,
193814
- contentEditable: (o = (r = t.view) == null ? void 0 : r.dom) == null ? void 0 : o.getAttribute("contenteditable"),
193815
- docContentSize: ((a = (s = (i = t.state) == null ? void 0 : i.doc) == null ? void 0 : s.content) == null ? void 0 : a.size) ?? null,
193816
- topLevelChildCount: ((u = (l = t.state) == null ? void 0 : l.doc) == null ? void 0 : u.childCount) ?? null
193817
- } : { hasEditor: !1 };
193821
+ if (!t)
193822
+ return { hasEditor: !1 };
193823
+ try {
193824
+ return {
193825
+ hasEditor: !0,
193826
+ isDestroyed: t.isDestroyed,
193827
+ isEmpty: t.isEmpty,
193828
+ editable: (n = t.view) == null ? void 0 : n.editable,
193829
+ contentEditable: (o = (r = t.view) == null ? void 0 : r.dom) == null ? void 0 : o.getAttribute("contenteditable"),
193830
+ docContentSize: ((a = (s = (i = t.state) == null ? void 0 : i.doc) == null ? void 0 : s.content) == null ? void 0 : a.size) ?? null,
193831
+ topLevelChildCount: ((u = (l = t.state) == null ? void 0 : l.doc) == null ? void 0 : u.childCount) ?? null
193832
+ };
193833
+ } catch (c) {
193834
+ return {
193835
+ hasEditor: !0,
193836
+ error: MJe(c)
193837
+ };
193838
+ }
193818
193839
  }, vU = (e, t = {}) => {
193819
193840
  try {
193820
193841
  console.info(
@@ -193826,7 +193847,7 @@ const jJe = ({
193826
193847
  );
193827
193848
  } catch {
193828
193849
  }
193829
- }, jQe = kr(
193850
+ }, BQe = kr(
193830
193851
  ({
193831
193852
  isPreviewMode: e = !1,
193832
193853
  viewerMode: t,
@@ -194864,7 +194885,7 @@ const jJe = ({
194864
194885
  }
194865
194886
  );
194866
194887
  }
194867
- ), MJe = kr(
194888
+ ), IJe = kr(
194868
194889
  ({
194869
194890
  isPreviewMode: e = !1,
194870
194891
  initialContent: t,
@@ -195109,13 +195130,13 @@ const jJe = ({
195109
195130
  )
195110
195131
  ] });
195111
195132
  }
195112
- ), BQe = kr(
195133
+ ), NQe = kr(
195113
195134
  (e, t) => {
195114
195135
  var i, s;
195115
195136
  const n = !!((i = e.versionHistoryState) != null && i.enabled), r = ((s = e.versionHistoryState) == null ? void 0 : s.versionId) || "default", o = n ? r : "default";
195116
- return /* @__PURE__ */ x.jsx(MJe, { ...e, ref: t }, o);
195137
+ return /* @__PURE__ */ x.jsx(IJe, { ...e, ref: t }, o);
195117
195138
  }
195118
- ), IJe = (e) => {
195139
+ ), OJe = (e) => {
195119
195140
  const t = () => {
195120
195141
  const p = new zs(), h = () => {
195121
195142
  var b;
@@ -195253,14 +195274,14 @@ const jJe = ({
195253
195274
  getYjsContentFromMarkdown: c,
195254
195275
  getYjsContentFromDocx: d
195255
195276
  };
195256
- }, OJe = [
195277
+ }, RJe = [
195257
195278
  "pdf",
195258
195279
  "md",
195259
195280
  "html",
195260
195281
  "txt",
195261
195282
  "odt"
195262
- ], RJe = (e) => e !== void 0 && OJe.includes(e), NQe = (e) => {
195263
- const t = Te(null), n = Te(!1), [r, o] = Ne(null), [i, s] = Ne(!1), a = IJe(e), { getEditor: l, setContent: u } = a, c = Ae(
195283
+ ], LJe = (e) => e !== void 0 && RJe.includes(e), MQe = (e) => {
195284
+ const t = Te(null), n = Te(!1), [r, o] = Ne(null), [i, s] = Ne(!1), a = OJe(e), { getEditor: l, setContent: u } = a, c = Ae(
195264
195285
  (A, I) => {
195265
195286
  A && !A.isDestroyed && A.destroy(), I && !I.isDestroyed && I.destroy();
195266
195287
  },
@@ -195419,7 +195440,7 @@ const jJe = ({
195419
195440
  tabs: M,
195420
195441
  activeTabId: j,
195421
195442
  exportName: T,
195422
- initialFormat: RJe(A.initialFormat) ? A.initialFormat : "pdf"
195443
+ initialFormat: LJe(A.initialFormat) ? A.initialFormat : "pdf"
195423
195444
  };
195424
195445
  d(L), s(!0);
195425
195446
  } catch (M) {
@@ -195472,18 +195493,18 @@ const jJe = ({
195472
195493
  exportModalProps: C
195473
195494
  };
195474
195495
  }, E_ = { type: "doc", content: [] };
195475
- function LJe(e) {
195496
+ function UJe(e) {
195476
195497
  return e && typeof e == "object" && e.type === "doc" && Array.isArray(e.content) ? e : E_;
195477
195498
  }
195478
195499
  function P5(e, t) {
195479
195500
  try {
195480
195501
  const n = u4e(e, t);
195481
- return LJe(n);
195502
+ return UJe(n);
195482
195503
  } catch {
195483
195504
  return E_;
195484
195505
  }
195485
195506
  }
195486
- function MQe(e) {
195507
+ function IQe(e) {
195487
195508
  var n;
195488
195509
  const t = new zs();
195489
195510
  try {
@@ -195527,13 +195548,13 @@ function MQe(e) {
195527
195548
  }
195528
195549
  }
195529
195550
  export {
195530
- jQe as DdocEditor,
195551
+ BQe as DdocEditor,
195531
195552
  s4e as DdocExportModal,
195532
195553
  lm as Editor,
195533
- BQe as PreviewDdocEditor,
195534
- MQe as buildVersionDiffSnapshot,
195554
+ NQe as PreviewDdocEditor,
195555
+ IQe as buildVersionDiffSnapshot,
195535
195556
  W3 as handleContentPrint,
195536
195557
  ak as mergeTabAwareYjsUpdates,
195537
- NQe as useExportHeadlessEditorContent,
195538
- IJe as useHeadlessEditor
195558
+ MQe as useExportHeadlessEditorContent,
195559
+ OJe as useHeadlessEditor
195539
195560
  };
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@fileverse-dev/ddoc",
3
3
  "private": false,
4
4
  "description": "DDoc",
5
- "version": "3.4.6-mp-fixes-6",
5
+ "version": "3.4.6-mp-fixes-7",
6
6
  "main": "dist/index.es.js",
7
7
  "module": "dist/index.es.js",
8
8
  "exports": {