@chaulapatrice/richtext-editor 0.1.8 → 0.1.9

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.
@@ -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 || "localhost", TA = {
16855
+ var wA = typeof window < "u" && 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,
@@ -22068,7 +22068,7 @@ var aF = !0;
22068
22068
  function oF({ className: e, format: t, loadingComponent: n, nodeKey: r, onError: i, onLoad: a, tweetID: o }) {
22069
22069
  let s = L(null), c = L(""), [l, u] = R(!1), d = P(async () => {
22070
22070
  try {
22071
- await window.twttr.widgets.createTweet(o, s.current), u(!1), aF = !1, a && a();
22071
+ typeof window < "u" && window.twttr && await window.twttr.widgets.createTweet(o, s.current), u(!1), aF = !1, a && a();
22072
22072
  } catch (e) {
22073
22073
  i && i(String(e));
22074
22074
  }
@@ -22757,8 +22757,8 @@ function Lse() {
22757
22757
  }, []);
22758
22758
  }
22759
22759
  function Rse(e) {
22760
- let t = window.navigator.userAgentData;
22761
- return `${e} ${(t === void 0 ? window.innerWidth <= 800 && window.innerHeight <= 600 : t.mobile) ? "(SWIPE ⮕)" : "(TAB)"}`;
22760
+ let t = typeof window < "u" ? window.navigator.userAgentData : void 0;
22761
+ return `${e} ${(t === void 0 ? typeof window < "u" && window.innerWidth <= 800 && window.innerHeight <= 600 : t.mobile) ? "(SWIPE ⮕)" : "(TAB)"}`;
22762
22762
  }
22763
22763
  function zse() {
22764
22764
  let [e] = H(), t = Lse(), { toolbarState: n } = DF();
@@ -59092,7 +59092,7 @@ function sve({ nodeKey: e, data: t, width: n, height: r }) {
59092
59092
  //#endregion
59093
59093
  //#region src/nodes/ExcalidrawNode/index.tsx
59094
59094
  function cve(e) {
59095
- if (!window) return null;
59095
+ if (typeof window > "u") return null;
59096
59096
  let t = e.getAttribute("data-lexical-excalidraw-json"), n = window.getComputedStyle(e), r = n.getPropertyValue("height"), i = n.getPropertyValue("width");
59097
59097
  return t ? { node: U5(t, !i || i === "inherit" ? "inherit" : parseInt(i, 10), !r || r === "inherit" ? "inherit" : parseInt(r, 10)) } : null;
59098
59098
  }
@@ -59480,7 +59480,9 @@ function n7({ disabled: e = !1, buttonLabel: t, buttonAriaLabel: n, buttonClassN
59480
59480
  let e = l.current, t = c.current, n = Xg(t, !0);
59481
59481
  if (u && e !== null && t !== null) {
59482
59482
  let { top: r, left: i } = e.getBoundingClientRect();
59483
- t.style.top = `${r / n + e.offsetHeight + e7}px`, t.style.left = `${Math.min(i, window.innerWidth - t.offsetWidth - 20) / n}px`;
59483
+ t.style.top = `${r / n + e.offsetHeight + e7}px`;
59484
+ let a = typeof window < "u" ? window.innerWidth : 0;
59485
+ t.style.left = `${Math.min(i, a - t.offsetWidth - 20) / n}px`;
59484
59486
  }
59485
59487
  }, [
59486
59488
  c,
@@ -61444,11 +61446,11 @@ function dye(e, t, n, r = !1, i = lye, a = uye) {
61444
61446
  t.style.opacity = "0", t.style.transform = "translate(-10000px, -10000px)";
61445
61447
  return;
61446
61448
  }
61447
- let s = t.getBoundingClientRect(), c = n.getBoundingClientRect(), l = o.getBoundingClientRect(), u = e.top - s.height - i, d = e.left - a, f = window.getSelection();
61449
+ let s = t.getBoundingClientRect(), c = n.getBoundingClientRect(), l = o.getBoundingClientRect(), u = e.top - s.height - i, d = e.left - a, f = typeof window < "u" ? window.getSelection() : null;
61448
61450
  if (f && f.rangeCount > 0) {
61449
61451
  let t = f.getRangeAt(0).startContainer;
61450
61452
  if (t.nodeType === Node.ELEMENT_NODE || t.parentElement) {
61451
- let n = t.nodeType === Node.ELEMENT_NODE ? t : t.parentElement, r = window.getComputedStyle(n).textAlign;
61453
+ let n = t.nodeType === Node.ELEMENT_NODE ? t : t.parentElement, r = typeof window < "u" ? window.getComputedStyle(n).textAlign : "";
61452
61454
  (r === "right" || r === "end") && (d = e.right - s.width + a);
61453
61455
  }
61454
61456
  }
@@ -65213,16 +65215,16 @@ var exe = [
65213
65215
  r9,
65214
65216
  jX,
65215
65217
  X9
65216
- ], Q9 = "main", $9 = window.parent != null && window.parent.frames.right === window;
65218
+ ], Q9 = "main", $9 = typeof window < "u" && window.parent != null && window.parent.frames.right === window;
65217
65219
  function txe({ onChange: e, value: t }) {
65218
65220
  let { historyState: n } = NA(), { settings: { isCodeHighlighted: r, isCodeShiki: i, isCollab: a, useCollabV2: o, isAutocomplete: s, isMaxLength: c, isCharLimit: l, hasLinkAttributes: u, hasNestedTables: d, isCharLimitUtf8: f, isRichText: p, showTreeView: m, showTableOfContents: h, shouldUseLexicalContextMenu: g, shouldPreserveNewLinesInMarkdown: _, tableCellMerge: v, tableCellBackgroundColor: y, tableHorizontalScroll: b, shouldAllowHighlightingWithBrackets: x, selectionAlwaysOnDisplay: S, listStrictIndent: C } } = kA(), w = jD(), ee = a ? "Enter some collaborative rich text..." : p ? "Enter some rich text..." : "Enter some plain text...", [te, ne] = R(null), [re, ie] = R(!1), [ae] = H(), [oe, se] = R(ae), [ce, le] = R(!1);
65219
65221
  return F(() => {
65220
65222
  let e = () => {
65221
- let e = Tg && window.matchMedia("(max-width: 1025px)").matches;
65223
+ let e = Tg && typeof window < "u" && window.matchMedia("(max-width: 1025px)").matches;
65222
65224
  e !== re && ie(e);
65223
65225
  };
65224
- return e(), window.addEventListener("resize", e), () => {
65225
- window.removeEventListener("resize", e);
65226
+ return e(), typeof window < "u" && window.addEventListener("resize", e), () => {
65227
+ typeof window < "u" && window.removeEventListener("resize", e);
65226
65228
  };
65227
65229
  }, [re]), /* @__PURE__ */ V(z, { children: [
65228
65230
  p && /* @__PURE__ */ B(Bbe, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chaulapatrice/richtext-editor",
3
- "version": "0.1.8",
3
+ "version": "0.1.9",
4
4
  "author": "Patrice Chaula",
5
5
  "license": "MIT",
6
6
  "repository": {