@dotit/editor 1.2.1 → 1.2.2

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.
package/dist/index.mjs CHANGED
@@ -2322,13 +2322,13 @@ function Rr({
2322
2322
  p === "divider" ? A.setNode("itDivider").run() : p === "break" ? A.setNode("itBreak").run() : p === "code" ? A.setNode("itCode", { lang: "" }).run() : ["tip", "info", "warning", "danger", "success"].includes(p) ? A.setNode("itCallout", { variant: p }).run() : A.setNode("itGenericBlock", { keyword: p, properties: "" }).run(), H();
2323
2323
  },
2324
2324
  [t]
2325
- ), q = _(
2325
+ ), nt = _(
2326
2326
  (p) => {
2327
2327
  const A = Math.min(96, Math.max(8, at + p));
2328
2328
  S(A), t?.chain().focus().setFontSize(`${A}pt`).run();
2329
2329
  },
2330
2330
  [t, at]
2331
- ), nt = _(
2331
+ ), q = _(
2332
2332
  (p) => {
2333
2333
  t?.chain().focus().setBlockProp("leading", p).run(), H();
2334
2334
  },
@@ -2483,9 +2483,9 @@ function Rr({
2483
2483
  p.value || "default"
2484
2484
  )) })
2485
2485
  ] }),
2486
- /* @__PURE__ */ o(E, { onClick: () => q(-1), title: "Decrease font size", children: /* @__PURE__ */ o(pn, { size: 14 }) }),
2486
+ /* @__PURE__ */ o(E, { onClick: () => nt(-1), title: "Decrease font size", children: /* @__PURE__ */ o(pn, { size: 14 }) }),
2487
2487
  /* @__PURE__ */ o("span", { className: "docs-tb-fontsize", children: at }),
2488
- /* @__PURE__ */ o(E, { onClick: () => q(1), title: "Increase font size", children: /* @__PURE__ */ o(Vt, { size: 14 }) })
2488
+ /* @__PURE__ */ o(E, { onClick: () => nt(1), title: "Increase font size", children: /* @__PURE__ */ o(Vt, { size: 14 }) })
2489
2489
  ] }),
2490
2490
  /* @__PURE__ */ o(dt, {}),
2491
2491
  /* @__PURE__ */ h(rt, { label: "Text", children: [
@@ -2727,7 +2727,7 @@ function Rr({
2727
2727
  "button",
2728
2728
  {
2729
2729
  className: `docs-tb-dropdown-item${Ct ? "" : " active"}`,
2730
- onClick: () => nt(null),
2730
+ onClick: () => q(null),
2731
2731
  children: "Default"
2732
2732
  }
2733
2733
  ),
@@ -2735,7 +2735,7 @@ function Rr({
2735
2735
  "button",
2736
2736
  {
2737
2737
  className: `docs-tb-dropdown-item${Ct === p ? " active" : ""}`,
2738
- onClick: () => nt(p),
2738
+ onClick: () => q(p),
2739
2739
  children: p === "1" ? "Single" : p === "2" ? "Double" : p
2740
2740
  },
2741
2741
  p
@@ -3490,8 +3490,12 @@ function qr({
3490
3490
  }
3491
3491
  }, [r]), U = tt(() => {
3492
3492
  try {
3493
- const S = ot(t), T = S.blocks.find((q) => q.type === "header")?.content || "", L = S.blocks.find((q) => q.type === "footer")?.content || "", K = S.blocks.find((q) => q.type === "meta"), J = String(K?.properties?.dir || "ltr").toLowerCase();
3494
- return { header: T, footer: L, dir: J };
3493
+ const S = ot(t), T = S.blocks.find((q) => q.type === "header")?.content || "", L = S.blocks.find((q) => q.type === "footer")?.content || "", K = S.metadata?.meta, J = String(
3494
+ S.metadata?.language || ""
3495
+ ).toLowerCase(), nt = String(
3496
+ K?.dir || (J === "rtl" ? "rtl" : "") || "ltr"
3497
+ ).toLowerCase();
3498
+ return { header: T, footer: L, dir: nt };
3495
3499
  } catch {
3496
3500
  return { header: "", footer: "", dir: "ltr" };
3497
3501
  }
@@ -3536,12 +3540,12 @@ function qr({
3536
3540
  if (b) {
3537
3541
  const { from: T, to: L } = b.state.selection;
3538
3542
  let K = 0, J = !1;
3539
- if (b.state.doc.nodesBetween(T, L, (nt) => {
3540
- if (nt.isTextblock) {
3543
+ if (b.state.doc.nodesBetween(T, L, (q) => {
3544
+ if (q.isTextblock) {
3541
3545
  K++;
3542
- const gt = nt.attrs?.dir, St = (() => {
3546
+ const gt = q.attrs?.dir, St = (() => {
3543
3547
  try {
3544
- return nt.attrs?.props ? JSON.parse(nt.attrs.props).dir : void 0;
3548
+ return q.attrs?.props ? JSON.parse(q.attrs.props).dir : void 0;
3545
3549
  } catch {
3546
3550
  return;
3547
3551
  }
@@ -3558,7 +3562,7 @@ function qr({
3558
3562
  e(rn(t, "dir", S ? null : "rtl"));
3559
3563
  }, [b, t, e, U.dir]), et = _(
3560
3564
  (S) => {
3561
- const T = y.current, L = (St) => Math.max(0, Math.round(St / st * 10) / 10), K = L(S.top ?? T.marginTop), J = L(S.right ?? T.marginRight), q = L(S.bottom ?? T.marginBottom), nt = L(S.left ?? T.marginLeft), gt = `${K}mm ${J}mm ${q}mm ${nt}mm`;
3565
+ const T = y.current, L = (St) => Math.max(0, Math.round(St / st * 10) / 10), K = L(S.top ?? T.marginTop), J = L(S.right ?? T.marginRight), nt = L(S.bottom ?? T.marginBottom), q = L(S.left ?? T.marginLeft), gt = `${K}mm ${J}mm ${nt}mm ${q}mm`;
3562
3566
  e(zn(t, gt));
3563
3567
  },
3564
3568
  [t, e]
@@ -3591,8 +3595,8 @@ function qr({
3591
3595
  if (!S || !T || L === w) return;
3592
3596
  const K = w / L;
3593
3597
  S.getBoundingClientRect();
3594
- const J = T.cx - S.scrollLeft, q = T.cy - S.scrollTop;
3595
- S.scrollLeft = T.cx * K - J, S.scrollTop = T.cy * K - q, ft.current = null, H.current = w;
3598
+ const J = T.cx - S.scrollLeft, nt = T.cy - S.scrollTop;
3599
+ S.scrollLeft = T.cx * K - J, S.scrollTop = T.cy * K - nt, ft.current = null, H.current = w;
3596
3600
  }, [w]), G(() => {
3597
3601
  const S = (T) => {
3598
3602
  if (T.metaKey || T.ctrlKey) {