@fileverse-dev/ddoc 2.4.15-patch-3 → 2.4.16-patch-1

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-Cpapkwxs.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-CDPJMA3f.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;
@@ -89868,7 +89868,7 @@ async function Sk(e, t) {
89868
89868
  });
89869
89869
  return V === "0x" ? { data: void 0 } : { data: V };
89870
89870
  } catch (B) {
89871
- const L = OWt(B), { offchainLookup: j, offchainLookupSignature: N } = await import("./ccip-DXudxOW5.mjs");
89871
+ const L = OWt(B), { offchainLookup: j, offchainLookupSignature: N } = await import("./ccip-CCzKwLTp.mjs");
89872
89872
  if (e.ccipRead !== !1 && (L == null ? void 0 : L.slice(0, 10)) === N && b)
89873
89873
  return { data: await j(e, { data: L, to: b }) };
89874
89874
  throw S && (L == null ? void 0 : L.slice(0, 10)) === "0x101bb98d" ? new qVt({ factory: c }) : cpe(B, {
@@ -256532,7 +256532,6 @@ const e_n = (e) => e.context.awareness, t_n = (e) => !!(e.context.isReady && e.c
256532
256532
  const W = rt(null), ee = async () => {
256533
256533
  const Ie = W.current;
256534
256534
  if (Ie && await Ie.destroy(), d && c) {
256535
- console.log("Initialising IndexedDB persistence for ddocId:", c);
256536
256535
  const $e = new PMn(c, j);
256537
256536
  W.current = $e;
256538
256537
  }
@@ -256594,37 +256593,23 @@ const e_n = (e) => e.context.awareness, t_n = (e) => !!(e.context.isReady && e.c
256594
256593
  window.removeEventListener("keydown", Ie);
256595
256594
  };
256596
256595
  }, [he, m]), He(() => {
256597
- try {
256598
- console.log({ initialContent: t, editor: he, ydoc: j }, "useDdocEditor useEffect"), !ke(t) && he && !ye.current && j ? (M(!0), queueMicrotask(() => {
256599
- if (t !== "") {
256600
- const Ie = be(t);
256601
- console.log({ isYjsEncoded: Ie, initialContent: t }), Ie ? Array.isArray(t) ? (console.log(
256602
- "Merging Yjs update for initial content:",
256603
- t
256604
- ), de(t)) : (console.log(
256605
- "Applying Yjs update for initial content:",
256606
- t
256607
- ), Kc(
256608
- j,
256609
- er(t),
256610
- "self"
256611
- )) : (console.log("Setting JSON content for initial content"), he.commands.setContent(
256612
- F9e({
256613
- data: t,
256614
- ignoreCorruptedData: g,
256615
- onInvalidContentError: p
256616
- })
256617
- ));
256618
- }
256619
- h && BS.setZoom(h), ee().then(() => {
256620
- console.log("Initial content set successfully"), M(!1);
256621
- }).catch((Ie) => {
256622
- console.log(Ie);
256623
- });
256624
- }), ye.current = !0) : t !== null && (console.log("Initial content already set"), M(!1));
256625
- } catch (Ie) {
256626
- console.log("Error in useDdocEditor useEffect:", Ie);
256627
- }
256596
+ !ke(t) && he && !ye.current && j ? (M(!0), queueMicrotask(() => {
256597
+ t !== "" && (be(t) ? Array.isArray(t) ? de(t) : Kc(
256598
+ j,
256599
+ er(t),
256600
+ "self"
256601
+ ) : he.commands.setContent(
256602
+ F9e({
256603
+ data: t,
256604
+ ignoreCorruptedData: g,
256605
+ onInvalidContentError: p
256606
+ })
256607
+ )), h && BS.setZoom(h), ee().then(() => {
256608
+ M(!1);
256609
+ }).catch((Ie) => {
256610
+ console.log(Ie);
256611
+ });
256612
+ }), ye.current = !0) : t !== null && M(!1);
256628
256613
  }, [t, he, j]), He(() => (n && (P != null && P.collaborationId) && (P != null && P.roomKey) && N({
256629
256614
  username: P == null ? void 0 : P.username,
256630
256615
  roomKey: P == null ? void 0 : P.roomKey,
@@ -258869,7 +258854,7 @@ const ioe = Ne.memo(c7e), S_n = ({
258869
258854
  return mn.addEventListener("keydown", Mn), () => {
258870
258855
  mn.removeEventListener("keydown", Mn);
258871
258856
  };
258872
- }, [ve]), console.log({ isContentLoading: at, initialContent: t }), He(() => {
258857
+ }, [ve]), He(() => {
258873
258858
  if (!Be || !ve) return;
258874
258859
  const Mn = () => {
258875
258860
  ze.current && ze.current.scrollIntoView();
@@ -259457,14 +259442,15 @@ const ioe = Ne.memo(c7e), S_n = ({
259457
259442
  ), YIn = (e) => {
259458
259443
  const t = () => {
259459
259444
  const f = new Ou(), h = () => {
259445
+ var y;
259460
259446
  const m = [];
259461
- if (e != null && e.comment) {
259462
- const y = D9e.configure({
259447
+ if ((y = e == null ? void 0 : e.optionalExtensions) != null && y.includes("comment")) {
259448
+ const b = D9e.configure({
259463
259449
  HTMLAttributes: {
259464
259450
  class: "inline-comment"
259465
259451
  }
259466
259452
  });
259467
- m.push(y);
259453
+ m.push(b);
259468
259454
  }
259469
259455
  return m;
259470
259456
  }, p = [
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-Cpapkwxs.mjs";
1
+ import { D as d, E as r, P as s, R as a, h as t, u as i } from "./index-CDPJMA3f.mjs";
2
2
  export {
3
3
  d as DdocEditor,
4
4
  r as Editor,
@@ -4,7 +4,7 @@ import { IpfsImageUploadResponse } from '../types';
4
4
 
5
5
  import * as Y from 'yjs';
6
6
  export declare const useHeadlessEditor: (props?: {
7
- comment?: boolean;
7
+ optionalExtensions?: string[];
8
8
  }) => {
9
9
  setContent: (initialContent: string | string[] | JSONContent, editor: Editor, ydoc: Y.Doc) => void;
10
10
  getEditor: () => {
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.4.15-patch-3",
5
+ "version": "2.4.16-patch-1",
6
6
  "main": "dist/index.es.js",
7
7
  "module": "dist/index.es.js",
8
8
  "exports": {