@chaulapatrice/richtext-editor 0.1.6 → 0.1.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.
@@ -16842,7 +16842,7 @@ var pA = 3e4, vse = (e, t) => console.warn(`Permission denied to access ${e.url}
16842
16842
  connect() {
16843
16843
  this.shouldConnect = !0, !this.wsconnected && this.ws === null && (hA(this), this.connectBc());
16844
16844
  }
16845
- }, _A = new URL(window.location.href), vA = new URLSearchParams(_A.search), yA = vA.get("collabEndpoint") || "ws://localhost:1234", bA = "playground", xA = vA.get("collabId") || "0";
16845
+ }, _A = new URL(window?.location?.href || "http://localhost:3000/"), vA = new URLSearchParams(_A.search), yA = vA.get("collabEndpoint") || "ws://localhost:1234", bA = "playground", xA = vA.get("collabId") || "0";
16846
16846
  function SA(e, t) {
16847
16847
  let n = t.get(e);
16848
16848
  return n === void 0 ? (n = new jS(), t.set(e, n)) : n.load(), CA(e, n);
@@ -16852,7 +16852,7 @@ function CA(e, t) {
16852
16852
  }
16853
16853
  //#endregion
16854
16854
  //#region src/appSettings.ts
16855
- var wA = window.location.hostname, TA = {
16855
+ var wA = window?.location?.hostname || "localhost", TA = {
16856
16856
  disableBeforeInput: !1,
16857
16857
  emptyEditor: wA !== "playground.lexical.dev" && wA !== "lexical-playground.vercel.app",
16858
16858
  hasLinkAttributes: !1,
@@ -16897,6 +16897,7 @@ var wA = window.location.hostname, TA = {
16897
16897
  });
16898
16898
  }, kA = () => lc(DA);
16899
16899
  function AA(e, t) {
16900
+ if (!window) return;
16900
16901
  let n = new URL(window.location.href), r = new URLSearchParams(n.search);
16901
16902
  t === TA[e] ? r.delete(e) : r.set(e, String(t)), n.search = r.toString(), window.history.pushState(null, "", n.toString());
16902
16903
  }
@@ -19957,8 +19958,8 @@ function BM({ onClose: e, children: t, title: n, closeOnClickOutside: r }) {
19957
19958
  let n = t.target;
19958
19959
  i.current !== null && Rm(n) && !i.current.contains(n) && r && e();
19959
19960
  }, o = i.current;
19960
- return o !== null && (t = o.parentElement, t !== null && t.addEventListener("click", a)), window.addEventListener("keydown", n), () => {
19961
- window.removeEventListener("keydown", n), t !== null && t?.removeEventListener("click", a);
19961
+ return o !== null && (t = o.parentElement, t !== null && t.addEventListener("click", a)), typeof window < "u" && window.addEventListener("keydown", n), () => {
19962
+ typeof window < "u" && window.removeEventListener("keydown", n), t !== null && t?.removeEventListener("click", a);
19962
19963
  };
19963
19964
  }, [r, e]), /* @__PURE__ */ B("div", {
19964
19965
  className: "Modal__overlay",
@@ -59091,6 +59092,7 @@ function sve({ nodeKey: e, data: t, width: n, height: r }) {
59091
59092
  //#endregion
59092
59093
  //#region src/nodes/ExcalidrawNode/index.tsx
59093
59094
  function cve(e) {
59095
+ if (!window) return null;
59094
59096
  let t = e.getAttribute("data-lexical-excalidraw-json"), n = window.getComputedStyle(e), r = n.getPropertyValue("height"), i = n.getPropertyValue("width");
59095
59097
  return t ? { node: U5(t, !i || i === "inherit" ? "inherit" : parseInt(i, 10), !r || r === "inherit" ? "inherit" : parseInt(r, 10)) } : null;
59096
59098
  }
@@ -63650,8 +63652,8 @@ function kbe({ x: e, y: t, nodeKey: n, color: r, caption: i }) {
63650
63652
  let t = a.getRootElement(), n = o.current;
63651
63653
  t !== null && n !== null && (e.rootElementRect = t.getBoundingClientRect(), F9(n, e));
63652
63654
  };
63653
- return window.addEventListener("resize", r), () => {
63654
- window.removeEventListener("resize", r), n();
63655
+ return typeof window < "u" && window.addEventListener("resize", r), () => {
63656
+ typeof window < "u" && window.removeEventListener("resize", r), n();
63655
63657
  };
63656
63658
  }, [a]), F(() => {
63657
63659
  let e = o.current;
@@ -65044,8 +65046,8 @@ function qbe() {
65044
65046
  }, d = function() {
65045
65047
  a = !0;
65046
65048
  };
65047
- return window.addEventListener("keydown", l, !0), window.addEventListener("selectionchange", o, !0), window.addEventListener("beforeinput", c, !0), window.addEventListener("paste", u, !0), window.addEventListener("cut", d, !0), () => {
65048
- window.removeEventListener("keydown", l, !0), window.removeEventListener("selectionchange", o, !0), window.removeEventListener("beforeinput", c, !0), window.removeEventListener("paste", u, !0), window.removeEventListener("cut", d, !0);
65049
+ return typeof window < "u" && (window.addEventListener("keydown", l, !0), window.addEventListener("selectionchange", o, !0), window.addEventListener("beforeinput", c, !0), window.addEventListener("paste", u, !0), window.addEventListener("cut", d, !0)), () => {
65050
+ typeof window < "u" && (window.removeEventListener("keydown", l, !0), window.removeEventListener("selectionchange", o, !0), window.removeEventListener("beforeinput", c, !0), window.removeEventListener("paste", u, !0), window.removeEventListener("cut", d, !0));
65049
65051
  };
65050
65052
  }, [e]), null;
65051
65053
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chaulapatrice/richtext-editor",
3
- "version": "0.1.6",
3
+ "version": "0.1.7",
4
4
  "author": "Patrice Chaula",
5
5
  "license": "MIT",
6
6
  "repository": {