@templatical/editor 0.45.0 → 0.46.0

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 (140) hide show
  1. package/dist/{AiChatSidebar-BlFWWhBv.js → AiChatSidebar-DGcH4Lyo.js} +1 -1
  2. package/dist/{AiFeatureMenu-CvWygUmC.js → AiFeatureMenu-B4q-0g1S.js} +1 -1
  3. package/dist/{BlockPreviewCanvas-DwxJOTzH.js → BlockPreviewCanvas-DIZ0KgUD.js} +3 -3
  4. package/dist/{CloudHeaderExtras-BzM1QU1r.js → CloudHeaderExtras-ehMYJP68.js} +1 -1
  5. package/dist/{CloudPanels-d36YXXyn.js → CloudPanels-BwOaAlKz.js} +2 -2
  6. package/dist/{CollaboratorBar-rwXe_Qd2.js → CollaboratorBar-qOZFRNPx.js} +1 -1
  7. package/dist/{CountdownToolbar-lbjCc8ik.js → CountdownToolbar-BeF21SeB.js} +4 -4
  8. package/dist/{DesignReferenceSidebar-zlJQsP0X.js → DesignReferenceSidebar-zH93uB15.js} +1 -1
  9. package/dist/{IssuesPanel-CHx3m8SP.js → IssuesPanel-Dltw9haP.js} +1 -1
  10. package/dist/{LogicTagInsertButton-BvftbkL4.js → LogicTagInsertButton-CHa-UD76.js} +12 -12
  11. package/dist/{MergeTagInput-CR1kcj8X.js → MergeTagInput-B3ntd4dN.js} +1 -1
  12. package/dist/{MergeTagModeToggle-DssKrVYb.js → MergeTagModeToggle-C_06ZL0Q.js} +1 -1
  13. package/dist/{ParagraphEditor-DFizsZRc.js → ParagraphEditor-CxuW3TV0.js} +6 -6
  14. package/dist/{RestoreVersionDialog-Cp3q2mU4.js → RestoreVersionDialog-B1n37M1Z.js} +1 -1
  15. package/dist/{RichTextEditorContent-Cj3oaPMk.js → RichTextEditorContent-CP_uULWB.js} +2 -2
  16. package/dist/{SaveBlockDialog-BR8vW_XF.js → SaveBlockDialog-BSKX_7_v.js} +5 -5
  17. package/dist/{SavedBlocksBrowserModal-DmwbmKxI.js → SavedBlocksBrowserModal-CHKrH1gO.js} +4 -4
  18. package/dist/{SavedBlocksPanels-D4XKrs-a.js → SavedBlocksPanels-B-xDqBcz.js} +1 -1
  19. package/dist/{SavedBlocksPickBar-gfc-o5sR.js → SavedBlocksPickBar-D2J-g82g.js} +1 -1
  20. package/dist/{TemplateSettings-D7aNrd0d.js → TemplateSettings-D07K_Y4m.js} +4 -4
  21. package/dist/{TestEmailModal-DUmtcSm-.js → TestEmailModal-BNPw_lID.js} +5 -5
  22. package/dist/{TestEmailPanel-s9gISTI8.js → TestEmailPanel-8klWo8hE.js} +1 -1
  23. package/dist/{TitleEditor-C-uHqtml.js → TitleEditor-CmC9OuhA.js} +4 -4
  24. package/dist/{ToggleSwitch-CTwwCIVA.js → ToggleSwitch-COeyWGfT.js} +1 -1
  25. package/dist/{Toolbar-CLpA36RO.js → Toolbar-CqhRb6EM.js} +36 -36
  26. package/dist/{TplModal-D6XtxusQ.js → TplModal-BGFawHY9.js} +1 -1
  27. package/dist/{VersionHistoryPanels-Dvowtt7V.js → VersionHistoryPanels-DdbGjEOR.js} +1 -1
  28. package/dist/{WrapperBlock-CzJa2Mxw.js → WrapperBlock-CTkmA887.js} +1 -1
  29. package/dist/{blockTypeIcons-D3aj5u_5.js → blockTypeIcons-CVKo6V_v.js} +1 -1
  30. package/dist/bundle-stats.json +6 -6
  31. package/dist/cdn/chunks/{AiChatSidebar-SRGBP-SL.js → AiChatSidebar-kCK4NZM9.js} +2 -2
  32. package/dist/cdn/chunks/{AiChatSidebar-SRGBP-SL.js.map → AiChatSidebar-kCK4NZM9.js.map} +1 -1
  33. package/dist/cdn/chunks/{AiFeatureMenu-oZhlgsGh.js → AiFeatureMenu-K1dLeDft.js} +2 -2
  34. package/dist/cdn/chunks/{AiFeatureMenu-oZhlgsGh.js.map → AiFeatureMenu-K1dLeDft.js.map} +1 -1
  35. package/dist/cdn/chunks/{BlockPreviewCanvas-hKxE6f-k.js → BlockPreviewCanvas-Djz9YAFx.js} +4 -4
  36. package/dist/cdn/chunks/{BlockPreviewCanvas-hKxE6f-k.js.map → BlockPreviewCanvas-Djz9YAFx.js.map} +1 -1
  37. package/dist/cdn/chunks/{CloudHeaderExtras-t-_ZlHwn.js → CloudHeaderExtras-5ONQ1RCa.js} +2 -2
  38. package/dist/cdn/chunks/{CloudHeaderExtras-t-_ZlHwn.js.map → CloudHeaderExtras-5ONQ1RCa.js.map} +1 -1
  39. package/dist/cdn/chunks/{CloudPanels-DR2eEcpX.js → CloudPanels-_irSdWbi.js} +3 -3
  40. package/dist/cdn/chunks/{CloudPanels-DR2eEcpX.js.map → CloudPanels-_irSdWbi.js.map} +1 -1
  41. package/dist/cdn/chunks/{CollaboratorBar-w8_2WPE0.js → CollaboratorBar-CZufI1On.js} +2 -2
  42. package/dist/cdn/chunks/{CollaboratorBar-w8_2WPE0.js.map → CollaboratorBar-CZufI1On.js.map} +1 -1
  43. package/dist/cdn/chunks/{CountdownToolbar-CvNuDR5Z.js → CountdownToolbar-BaXCefQM.js} +5 -5
  44. package/dist/cdn/chunks/{CountdownToolbar-CvNuDR5Z.js.map → CountdownToolbar-BaXCefQM.js.map} +1 -1
  45. package/dist/cdn/chunks/{DesignReferenceSidebar-CJg_5GXU.js → DesignReferenceSidebar-GjkpHylX.js} +2 -2
  46. package/dist/cdn/chunks/{DesignReferenceSidebar-CJg_5GXU.js.map → DesignReferenceSidebar-GjkpHylX.js.map} +1 -1
  47. package/dist/cdn/chunks/{IssuesPanel-DXqlRk19.js → IssuesPanel-C1Lv2y_O.js} +2 -2
  48. package/dist/cdn/chunks/{IssuesPanel-DXqlRk19.js.map → IssuesPanel-C1Lv2y_O.js.map} +1 -1
  49. package/dist/cdn/chunks/{LogicTagInsertButton-DnHghQHb.js → LogicTagInsertButton-BYjdrDnQ.js} +4 -4
  50. package/dist/cdn/chunks/{LogicTagInsertButton-DnHghQHb.js.map → LogicTagInsertButton-BYjdrDnQ.js.map} +1 -1
  51. package/dist/cdn/chunks/{MergeTagInput-heTX9P_k.js → MergeTagInput-Cx67J_vg.js} +2 -2
  52. package/dist/cdn/chunks/{MergeTagInput-heTX9P_k.js.map → MergeTagInput-Cx67J_vg.js.map} +1 -1
  53. package/dist/cdn/chunks/{MergeTagModeToggle-C9EfuZIP.js → MergeTagModeToggle-DZ4EuXVp.js} +2 -2
  54. package/dist/cdn/chunks/{MergeTagModeToggle-C9EfuZIP.js.map → MergeTagModeToggle-DZ4EuXVp.js.map} +1 -1
  55. package/dist/cdn/chunks/{ParagraphEditor-B5DN4Sy4.js → ParagraphEditor-DndEFXmR.js} +7 -7
  56. package/dist/cdn/chunks/{ParagraphEditor-B5DN4Sy4.js.map → ParagraphEditor-DndEFXmR.js.map} +1 -1
  57. package/dist/cdn/chunks/{RestoreVersionDialog-DBgJ-Nui.js → RestoreVersionDialog-CFYs13a4.js} +2 -2
  58. package/dist/cdn/chunks/{RestoreVersionDialog-DBgJ-Nui.js.map → RestoreVersionDialog-CFYs13a4.js.map} +1 -1
  59. package/dist/cdn/chunks/{RichTextEditorContent-LOas4rfU.js → RichTextEditorContent-DKkDQ0dc.js} +3 -3
  60. package/dist/cdn/chunks/{RichTextEditorContent-LOas4rfU.js.map → RichTextEditorContent-DKkDQ0dc.js.map} +1 -1
  61. package/dist/cdn/chunks/{SaveBlockDialog-Dx-QVQCX.js → SaveBlockDialog-BOA2RaC_.js} +6 -6
  62. package/dist/cdn/chunks/{SaveBlockDialog-Dx-QVQCX.js.map → SaveBlockDialog-BOA2RaC_.js.map} +1 -1
  63. package/dist/cdn/chunks/{SavedBlocksBrowserModal-C2RQ-JCc.js → SavedBlocksBrowserModal-DQDVek3K.js} +4 -4
  64. package/dist/cdn/chunks/{SavedBlocksBrowserModal-C2RQ-JCc.js.map → SavedBlocksBrowserModal-DQDVek3K.js.map} +1 -1
  65. package/dist/cdn/chunks/{SavedBlocksPanels-BmRbvqqL.js → SavedBlocksPanels-Lu3tJ3QA.js} +2 -2
  66. package/dist/cdn/chunks/{SavedBlocksPanels-BmRbvqqL.js.map → SavedBlocksPanels-Lu3tJ3QA.js.map} +1 -1
  67. package/dist/cdn/chunks/{SavedBlocksPickBar-BzwKojoJ.js → SavedBlocksPickBar-D7MtqG6r.js} +2 -2
  68. package/dist/cdn/chunks/{SavedBlocksPickBar-BzwKojoJ.js.map → SavedBlocksPickBar-D7MtqG6r.js.map} +1 -1
  69. package/dist/cdn/chunks/{TemplateSettings-G-yV7C1C.js → TemplateSettings-rZiHmq24.js} +5 -5
  70. package/dist/cdn/chunks/{TemplateSettings-G-yV7C1C.js.map → TemplateSettings-rZiHmq24.js.map} +1 -1
  71. package/dist/cdn/chunks/{TestEmailModal-lOeztfTN.js → TestEmailModal-DWEyHXH2.js} +6 -6
  72. package/dist/cdn/chunks/{TestEmailModal-lOeztfTN.js.map → TestEmailModal-DWEyHXH2.js.map} +1 -1
  73. package/dist/cdn/chunks/{TestEmailPanel-CZswVkk_.js → TestEmailPanel-XXMD-Lnr.js} +2 -2
  74. package/dist/cdn/chunks/{TestEmailPanel-CZswVkk_.js.map → TestEmailPanel-XXMD-Lnr.js.map} +1 -1
  75. package/dist/cdn/chunks/{TitleEditor-CnTT2Y3H.js → TitleEditor-D1F0YoE-.js} +4 -4
  76. package/dist/cdn/chunks/{TitleEditor-CnTT2Y3H.js.map → TitleEditor-D1F0YoE-.js.map} +1 -1
  77. package/dist/cdn/chunks/{ToggleSwitch-CLHteVMO.js → ToggleSwitch-B5U9cqhi.js} +2 -2
  78. package/dist/cdn/chunks/{ToggleSwitch-CLHteVMO.js.map → ToggleSwitch-B5U9cqhi.js.map} +1 -1
  79. package/dist/cdn/chunks/{Toolbar-K4tIkpG1.js → Toolbar-C_5HfUQq.js} +55 -55
  80. package/dist/cdn/chunks/{Toolbar-K4tIkpG1.js.map → Toolbar-C_5HfUQq.js.map} +1 -1
  81. package/dist/cdn/chunks/{TplModal-OOT36AjS.js → TplModal-CYBbPCHL.js} +2 -2
  82. package/dist/cdn/chunks/{TplModal-OOT36AjS.js.map → TplModal-CYBbPCHL.js.map} +1 -1
  83. package/dist/cdn/chunks/{VersionHistoryPanels-BrpYRSfW.js → VersionHistoryPanels-Dq12VsTX.js} +2 -2
  84. package/dist/cdn/chunks/{VersionHistoryPanels-BrpYRSfW.js.map → VersionHistoryPanels-Dq12VsTX.js.map} +1 -1
  85. package/dist/cdn/chunks/{WrapperBlock-DdrnwH80.js → WrapperBlock-CJ0CLqi2.js} +2 -2
  86. package/dist/cdn/chunks/{WrapperBlock-DdrnwH80.js.map → WrapperBlock-CJ0CLqi2.js.map} +1 -1
  87. package/dist/cdn/chunks/{cloud-bhW8qTnh.js → cloud-h1vaHp2p.js} +2 -2
  88. package/dist/cdn/chunks/{cloud-bhW8qTnh.js.map → cloud-h1vaHp2p.js.map} +1 -1
  89. package/dist/cdn/chunks/{createCloudRuntime-CeRJkLR2.js → createCloudRuntime-bJN9EM1H.js} +3 -3
  90. package/dist/cdn/chunks/{createCloudRuntime-CeRJkLR2.js.map → createCloudRuntime-bJN9EM1H.js.map} +1 -1
  91. package/dist/cdn/chunks/{extensions-xjRsIjMP.js → extensions-CrmXF4MW.js} +6 -6
  92. package/dist/cdn/chunks/extensions-CrmXF4MW.js.map +1 -0
  93. package/dist/{preRenderCustomBlocks-DAS48ZCp.js → cdn/chunks/preRenderCustomBlocks-CyGB3lZr.js} +5 -3
  94. package/dist/cdn/chunks/{preRenderCustomBlocks-CFwa7nP9.js.map → preRenderCustomBlocks-CyGB3lZr.js.map} +1 -1
  95. package/dist/cdn/chunks/{socialIcons-CsYnPPll.js → socialIcons-ClJVDZwt.js} +82 -101
  96. package/dist/cdn/chunks/socialIcons-ClJVDZwt.js.map +1 -0
  97. package/dist/cdn/chunks/{src-HA9F2kvk.js → src-B0pZeTYO.js} +200 -183
  98. package/dist/cdn/chunks/src-B0pZeTYO.js.map +1 -0
  99. package/dist/cdn/chunks/{src-CkXmV2I2.js → src-BMw3u-iV.js} +213 -215
  100. package/dist/cdn/chunks/src-BMw3u-iV.js.map +1 -0
  101. package/dist/cdn/chunks/{src-BcqNlDMe.js → src-Bh0MoJ67.js} +280 -187
  102. package/dist/cdn/chunks/src-Bh0MoJ67.js.map +1 -0
  103. package/dist/cdn/chunks/{useEditorCore-BF1ZhcGu.js → useEditorCore-DuC7kVti.js} +323 -319
  104. package/dist/cdn/chunks/useEditorCore-DuC7kVti.js.map +1 -0
  105. package/dist/cdn/chunks/{useLogicTag-91bO_SOi.js → useLogicTag-B3uV3XHG.js} +2 -2
  106. package/dist/cdn/chunks/{useLogicTag-91bO_SOi.js.map → useLogicTag-B3uV3XHG.js.map} +1 -1
  107. package/dist/cdn/chunks/{useMergeTag-hwifK582.js → useMergeTag-DJLM-7WQ.js} +2 -2
  108. package/dist/cdn/chunks/{useMergeTag-hwifK582.js.map → useMergeTag-DJLM-7WQ.js.map} +1 -1
  109. package/dist/cdn/chunks/{useScrollToBlock-BDNJ25X1.js → useScrollToBlock-CpmB5KxW.js} +2 -3
  110. package/dist/cdn/chunks/useScrollToBlock-CpmB5KxW.js.map +1 -0
  111. package/dist/cdn/chunks/withCurrentFont-isIyuezD.js +21 -0
  112. package/dist/cdn/chunks/withCurrentFont-isIyuezD.js.map +1 -0
  113. package/dist/cdn/editor.css +1 -1
  114. package/dist/cdn/editor.js +435 -417
  115. package/dist/cdn/editor.js.map +1 -1
  116. package/dist/{cloud-CVfwPu19.js → cloud-DPGjMGfv.js} +1 -1
  117. package/dist/{createCloudRuntime-GRv_TDb2.js → createCloudRuntime-D0RRgWab.js} +2 -2
  118. package/dist/{dist-CSaWqmWM.js → dist-BI_LeQGl.js} +271 -200
  119. package/dist/{extensions-B65sfZRk.js → extensions-CYigjb1g.js} +13 -13
  120. package/dist/index.d.ts +34 -12
  121. package/dist/{cdn/chunks/preRenderCustomBlocks-CFwa7nP9.js → preRenderCustomBlocks-DokBGA_M.js} +3 -5
  122. package/dist/{socialIcons-CvAixjj8.js → socialIcons-Ct_IoqPQ.js} +107 -126
  123. package/dist/style.css +1 -1
  124. package/dist/templatical-editor.js +456 -438
  125. package/dist/{useEditorCore-DQSeKPE9.js → useEditorCore-BJAQMvNW.js} +482 -478
  126. package/dist/{useLogicTag-BH87j1vZ.js → useLogicTag-B5gjcMzn.js} +1 -1
  127. package/dist/{useMergeTag-DfPKX2Tk.js → useMergeTag-BwsBIDzR.js} +3 -3
  128. package/dist/{useScrollToBlock-Dr7Sb6Tr.js → useScrollToBlock-JRxhT1u_.js} +1 -2
  129. package/dist/withCurrentFont-C9vqrduu.js +19 -0
  130. package/package.json +8 -8
  131. package/dist/cdn/chunks/extensions-xjRsIjMP.js.map +0 -1
  132. package/dist/cdn/chunks/socialIcons-CsYnPPll.js.map +0 -1
  133. package/dist/cdn/chunks/src-BcqNlDMe.js.map +0 -1
  134. package/dist/cdn/chunks/src-CkXmV2I2.js.map +0 -1
  135. package/dist/cdn/chunks/src-HA9F2kvk.js.map +0 -1
  136. package/dist/cdn/chunks/useEditorCore-BF1ZhcGu.js.map +0 -1
  137. package/dist/cdn/chunks/useScrollToBlock-BDNJ25X1.js.map +0 -1
  138. package/dist/cdn/chunks/withCurrentFont-DeCbPVaE.js +0 -32
  139. package/dist/cdn/chunks/withCurrentFont-DeCbPVaE.js.map +0 -1
  140. package/dist/withCurrentFont-DeCbPVaE.js +0 -30
@@ -1,25 +1,25 @@
1
1
  import { H as e, J as t, R as n, X as r, Y as i, Z as a, ot as o, rt as s, s as c } from "./vue.runtime.esm-bundler-CctRY8kr.js";
2
- import { $ as l, P as u, d, f, h as p, l as m, s as h, y as g } from "./dist-CSaWqmWM.js";
3
- import { r as _ } from "./dist-B_vYjCsk.js";
4
- import { o as v, s as y } from "./usePopoverPosition-DkBrHfCo.js";
5
- import { t as b } from "./createLucideIcon-BAPyioGd.js";
2
+ import { I as l, b as u, c as d, f, g as p, m, nt as h, p as g, u as _ } from "./dist-BI_LeQGl.js";
3
+ import { r as v } from "./dist-B_vYjCsk.js";
4
+ import { o as y, s as b } from "./usePopoverPosition-DkBrHfCo.js";
5
+ import { t as x } from "./createLucideIcon-BAPyioGd.js";
6
6
  //#region ../core/dist/index.js
7
- function x(e) {
7
+ function S(e) {
8
8
  return e instanceof Error ? e : Error(String(e), { cause: e });
9
9
  }
10
- function S(e, t) {
10
+ function C(e, t) {
11
11
  try {
12
12
  t();
13
13
  } catch (t) {
14
- e?.(x(t));
14
+ e?.(S(t));
15
15
  }
16
16
  }
17
- function C(e) {
17
+ function w(e) {
18
18
  return e === "1" ? 1 : e === "3" ? 3 : 2;
19
19
  }
20
- function w(t) {
21
- let n = t.content ?? g(t.defaultFontFamily, t.templateDefaults);
22
- d(n), f(n);
20
+ function T(t) {
21
+ let n = t.content ?? u(t.defaultFontFamily, t.templateDefaults);
22
+ f(n), g(n);
23
23
  let a = i({
24
24
  template: null,
25
25
  content: n,
@@ -40,12 +40,12 @@ function w(t) {
40
40
  set: (e) => {
41
41
  a.content = e, s();
42
42
  }
43
- }), l = e(() => a.selectedBlockId ? u(a.content.blocks, a.selectedBlockId) : null);
44
- function u(e, t) {
43
+ }), l = e(() => a.selectedBlockId ? d(a.content.blocks, a.selectedBlockId) : null);
44
+ function d(e, t) {
45
45
  for (let n of e) {
46
46
  if (n.id === t) return n;
47
47
  if (n.type === "section") for (let e of n.children) {
48
- let n = u(e, t);
48
+ let n = d(e, t);
49
49
  if (n) return n;
50
50
  }
51
51
  }
@@ -54,12 +54,12 @@ function w(t) {
54
54
  function p(e, t) {
55
55
  if (t.add(e.id), e.type === "section") for (let n of e.children) for (let e of n) p(e, t);
56
56
  }
57
- function h(e, t, n = { blocks: e }) {
57
+ function m(e, t, n = { blocks: e }) {
58
58
  for (let r = 0; r < e.length; r++) {
59
59
  let i = e[r];
60
60
  if (i.id === t) return n;
61
61
  if (i.type === "section") for (let e = 0; e < i.children.length; e++) {
62
- let n = h(i.children[e], t, {
62
+ let n = m(i.children[e], t, {
63
63
  blocks: i.children[e],
64
64
  sectionId: i.id,
65
65
  columnIndex: e
@@ -69,11 +69,11 @@ function w(t) {
69
69
  }
70
70
  return null;
71
71
  }
72
- function _(e) {
72
+ function h(e) {
73
73
  return t.lockedBlocks?.value.has(e) ?? !1;
74
74
  }
75
75
  function v(e) {
76
- let t = h(a.content.blocks, e);
76
+ let t = m(a.content.blocks, e);
77
77
  if (!t) return null;
78
78
  let n = t.blocks.findIndex((t) => t.id === e);
79
79
  return n === -1 ? null : {
@@ -83,15 +83,15 @@ function w(t) {
83
83
  };
84
84
  }
85
85
  function y(e, t = !0) {
86
- d(e), f(e), a.content = e, t && s();
86
+ f(e), g(e), a.content = e, t && s();
87
87
  }
88
88
  function b(e) {
89
- e && _(e) || (a.selectedBlockId = e);
89
+ e && h(e) || (a.selectedBlockId = e);
90
90
  }
91
91
  function x(e) {
92
92
  a.viewport = e;
93
93
  }
94
- function w(e) {
94
+ function S(e) {
95
95
  a.darkMode = e;
96
96
  }
97
97
  function T(e) {
@@ -101,8 +101,8 @@ function w(t) {
101
101
  a.previewMode = e, e && (a.selectedBlockId = null);
102
102
  }
103
103
  function D(e, t) {
104
- if (_(e)) return;
105
- let n = u(a.content.blocks, e);
104
+ if (h(e)) return;
105
+ let n = d(a.content.blocks, e);
106
106
  n && (Object.assign(n, t), s());
107
107
  }
108
108
  function O(e) {
@@ -116,12 +116,12 @@ function w(t) {
116
116
  settings: a.content.settings,
117
117
  blocks: [e]
118
118
  };
119
- if (d(i), f(i), !(t && e.type === "section")) {
119
+ if (f(i), g(i), !(t && e.type === "section")) {
120
120
  if (t) {
121
- if (_(t)) return;
122
- let i = u(a.content.blocks, t);
121
+ if (h(t)) return;
122
+ let i = d(a.content.blocks, t);
123
123
  if (i && i.type === "section") {
124
- if (n < 0 || n >= C(i.columns)) return;
124
+ if (n < 0 || n >= w(i.columns)) return;
125
125
  i.children[n] = i.children[n] || [];
126
126
  let t = i.children[n];
127
127
  r !== void 0 && r < t.length ? t.splice(r, 0, e) : t.push(e);
@@ -131,8 +131,8 @@ function w(t) {
131
131
  }
132
132
  }
133
133
  function A(e) {
134
- if (_(e)) return;
135
- let t = h(a.content.blocks, e);
134
+ if (h(e)) return;
135
+ let t = m(a.content.blocks, e);
136
136
  if (t) {
137
137
  let n = t.blocks.findIndex((t) => t.id === e);
138
138
  if (n !== -1) {
@@ -146,15 +146,15 @@ function w(t) {
146
146
  }
147
147
  }
148
148
  function j(e, t, n, r = 0) {
149
- if (_(e) || n && _(n)) return;
150
- let i = h(a.content.blocks, e);
149
+ if (h(e) || n && h(n)) return;
150
+ let i = m(a.content.blocks, e);
151
151
  if (!i) return;
152
152
  let o = i.blocks.findIndex((t) => t.id === e);
153
153
  if (o === -1 || n && i.blocks[o].type === "section") return;
154
154
  let c;
155
155
  if (n) {
156
- let e = u(a.content.blocks, n);
157
- if (!e || e.type !== "section" || r < 0 || r >= C(e.columns)) return;
156
+ let e = d(a.content.blocks, n);
157
+ if (!e || e.type !== "section" || r < 0 || r >= w(e.columns)) return;
158
158
  e.children[r] = e.children[r] || [], c = e.children[r];
159
159
  } else c = a.content.blocks;
160
160
  let [l] = i.blocks.splice(o, 1);
@@ -164,10 +164,10 @@ function w(t) {
164
164
  s();
165
165
  }
166
166
  function N(e, t) {
167
- throw new m(`[Templatical] Templates: ${e} ${t}`);
167
+ throw new _(`[Templatical] Templates: ${e} ${t}`);
168
168
  }
169
169
  function P(e) {
170
- S(t.onError, e);
170
+ C(t.onError, e);
171
171
  }
172
172
  function F(e) {
173
173
  let { templates: n } = t;
@@ -202,7 +202,7 @@ function w(t) {
202
202
  let n = F("load()"), r;
203
203
  a.isLoading = !0;
204
204
  try {
205
- r = await n.load(e), d(r.content), f(r.content), a.template = r, a.content = r.content, a.isDirty = !1;
205
+ r = await n.load(e), f(r.content), g(r.content), a.template = r, a.content = r.content, a.isDirty = !1;
206
206
  } catch (e) {
207
207
  throw t.onError?.(e), e;
208
208
  } finally {
@@ -244,11 +244,11 @@ function w(t) {
244
244
  state: r(a),
245
245
  content: c,
246
246
  selectedBlock: l,
247
- isBlockLocked: _,
247
+ isBlockLocked: h,
248
248
  setContent: y,
249
249
  selectBlock: b,
250
250
  setViewport: x,
251
- setDarkMode: w,
251
+ setDarkMode: S,
252
252
  setUiTheme: T,
253
253
  setPreviewMode: E,
254
254
  updateBlock: D,
@@ -265,58 +265,58 @@ function w(t) {
265
265
  hasTemplate: B
266
266
  };
267
267
  }
268
- var T = 50, E = 300, D = 1500;
269
- function O(t) {
270
- let { content: n, setContent: r, isRemoteOperation: i, maxSize: o = T } = t, s = a([]), c = a([]), u = a(!1), d = null, f = null, p = e(() => s.value.length > 0), m = e(() => c.value.length > 0);
271
- function h() {
272
- return l(n.value);
268
+ var E = 50, D = 300, O = 1500;
269
+ function k(t) {
270
+ let { content: n, setContent: r, isRemoteOperation: i, maxSize: o = E } = t, s = a([]), c = a([]), l = a(!1), u = null, d = null, f = e(() => s.value.length > 0), p = e(() => c.value.length > 0);
271
+ function m() {
272
+ return h(n.value);
273
273
  }
274
274
  function g(e) {
275
275
  s.value.push(e), s.value.length > o && s.value.splice(0, s.value.length - o);
276
276
  }
277
277
  function _() {
278
- f &&= (clearTimeout(f.timeoutId), null);
278
+ d &&= (clearTimeout(d.timeoutId), null);
279
279
  }
280
280
  function v() {
281
- i?.() || (_(), g(h()), c.value = []);
281
+ i?.() || (_(), g(m()), c.value = []);
282
282
  }
283
283
  function y(e) {
284
- i?.() || (f && f.blockId === e ? (clearTimeout(f.timeoutId), f.timeoutId = setTimeout(() => {
285
- f = null;
286
- }, E)) : (_(), g(h()), c.value = [], f = {
284
+ i?.() || (d && d.blockId === e ? (clearTimeout(d.timeoutId), d.timeoutId = setTimeout(() => {
285
+ d = null;
286
+ }, D)) : (_(), g(m()), c.value = [], d = {
287
287
  blockId: e,
288
288
  timeoutId: setTimeout(() => {
289
- f = null;
290
- }, E)
289
+ d = null;
290
+ }, D)
291
291
  }));
292
292
  }
293
293
  function b() {
294
- u.value = !0, d && clearTimeout(d), d = setTimeout(() => {
295
- u.value = !1, d = null;
296
- }, D);
294
+ l.value = !0, u && clearTimeout(u), u = setTimeout(() => {
295
+ l.value = !1, u = null;
296
+ }, O);
297
297
  }
298
298
  function x() {
299
299
  if (s.value.length === 0) return;
300
300
  _();
301
301
  let e = s.value.pop();
302
- c.value.push(h()), r(e, !0), b();
302
+ c.value.push(m()), r(e, !0), b();
303
303
  }
304
304
  function S() {
305
305
  if (c.value.length === 0) return;
306
306
  _();
307
307
  let e = c.value.pop();
308
- s.value.push(h()), r(e, !0), b();
308
+ s.value.push(m()), r(e, !0), b();
309
309
  }
310
310
  function C() {
311
311
  s.value = [], c.value = [], _();
312
312
  }
313
313
  function w() {
314
- C(), d &&= (clearTimeout(d), null);
314
+ C(), u &&= (clearTimeout(u), null);
315
315
  }
316
316
  return {
317
- canUndo: p,
318
- canRedo: m,
319
- isNavigating: u,
317
+ canUndo: f,
318
+ canRedo: p,
319
+ isNavigating: l,
320
320
  undo: x,
321
321
  redo: S,
322
322
  record: v,
@@ -325,22 +325,6 @@ function O(t) {
325
325
  destroy: w
326
326
  };
327
327
  }
328
- function k(e) {
329
- e.type === "table" ? e.rows = e.rows.map((e) => ({
330
- ...e,
331
- id: u(),
332
- cells: e.cells.map((e) => ({
333
- ...e,
334
- id: u()
335
- }))
336
- })) : e.type === "social" ? e.icons = e.icons.map((e) => ({
337
- ...e,
338
- id: u()
339
- })) : e.type === "menu" && (e.items = e.items.map((e) => ({
340
- ...e,
341
- id: u()
342
- })));
343
- }
344
328
  function A(e) {
345
329
  let { addBlock: t, removeBlock: n, updateBlock: r, selectBlock: i, findBlockLocation: a } = e;
346
330
  function o(n, r, a) {
@@ -348,11 +332,8 @@ function A(e) {
348
332
  return t(s, r, a), i(s.id), s;
349
333
  }
350
334
  function s(e, n, r) {
351
- let o = JSON.parse(JSON.stringify(e));
352
- if (o.id = u(), k(o), o.type === "section" && (o.children = o.children.map((e) => e.map((e) => {
353
- let t = JSON.parse(JSON.stringify(e));
354
- return t.id = u(), k(t), t;
355
- }))), n !== void 0 || r !== void 0) t(o, n, r);
335
+ let o = m(e);
336
+ if (n !== void 0 || r !== void 0) t(o, n, r);
356
337
  else {
357
338
  let i = a?.(e.id) ?? null;
358
339
  i ? t(o, i.targetSectionId, i.columnIndex, i.index + 1) : t(o, n, r);
@@ -487,12 +468,12 @@ function I(e) {
487
468
  return l.value && e.canDelete !== !1;
488
469
  }
489
470
  function f(e, t) {
490
- throw new m(`[Templatical] Saved blocks: ${e} is ${t}. Check the capability before calling — the editor's own UI hides the action.`);
471
+ throw new _(`[Templatical] Saved blocks: ${e} is ${t}. Check the capability before calling — the editor's own UI hides the action.`);
491
472
  }
492
473
  function p(t) {
493
- S(e.onError, t);
474
+ C(e.onError, t);
494
475
  }
495
- async function h(i) {
476
+ async function m(i) {
496
477
  r.value = !0;
497
478
  try {
498
479
  n.value = await t.list(i);
@@ -502,7 +483,7 @@ function I(e) {
502
483
  r.value = !1;
503
484
  }
504
485
  }
505
- async function g(r, i, a) {
486
+ async function h(r, i, a) {
506
487
  let { create: o } = t;
507
488
  typeof o != "function" && f("create", "disabled by the provider");
508
489
  try {
@@ -519,7 +500,7 @@ function I(e) {
519
500
  throw e.onError?.(t), t;
520
501
  }
521
502
  }
522
- async function _(r, i) {
503
+ async function g(r, i) {
523
504
  let { update: a } = t;
524
505
  typeof a != "function" && f("update", "disabled by the provider");
525
506
  let o = n.value.find((e) => e.id === r);
@@ -551,9 +532,9 @@ function I(e) {
551
532
  canDelete: l,
552
533
  canUpdateBlock: u,
553
534
  canDeleteBlock: d,
554
- load: h,
555
- create: g,
556
- update: _,
535
+ load: m,
536
+ create: h,
537
+ update: g,
557
538
  remove: v
558
539
  };
559
540
  }
@@ -584,7 +565,7 @@ function R(e = {}) {
584
565
  },
585
566
  async create(e) {
586
567
  let t = (/* @__PURE__ */ new Date()).toISOString(), n = {
587
- id: u(),
568
+ id: l(),
588
569
  name: e.name,
589
570
  content: e.content,
590
571
  ...e.category ? { category: e.category } : {},
@@ -650,7 +631,7 @@ function V(e = {}) {
650
631
  },
651
632
  async create(e) {
652
633
  let t = await a(e.file), n = (/* @__PURE__ */ new Date()).toISOString(), o = {
653
- id: u(),
634
+ id: l(),
654
635
  url: t,
655
636
  filename: e.filename || e.file.name,
656
637
  createdAt: n,
@@ -689,16 +670,16 @@ function H(e) {
689
670
  let { provider: t, getTemplateId: n } = e, r = a([]), i = a(!1), o = a(void 0), s = a(!1), l = /* @__PURE__ */ new Map(), u = c(() => typeof t.create == "function"), d = c(() => typeof t.restore == "function");
690
671
  function f(e) {
691
672
  let t = n();
692
- if (!t) throw new m(`[Templatical] Version history: ${e} needs a template. Call create() or load() first.`);
673
+ if (!t) throw new _(`[Templatical] Version history: ${e} needs a template. Call create() or load() first.`);
693
674
  return t;
694
675
  }
695
676
  function p(e) {
696
- throw new m(`[Templatical] Version history: ${e} is disabled by the provider. Check the capability before calling — the editor's own UI hides the action.`);
677
+ throw new _(`[Templatical] Version history: ${e} is disabled by the provider. Check the capability before calling — the editor's own UI hides the action.`);
697
678
  }
698
- function h(t) {
699
- S(e.onError, t);
679
+ function m(t) {
680
+ C(e.onError, t);
700
681
  }
701
- async function g(n) {
682
+ async function h(n) {
702
683
  let a = f("list");
703
684
  i.value = !0;
704
685
  try {
@@ -710,11 +691,11 @@ function H(e) {
710
691
  i.value = !1;
711
692
  }
712
693
  }
713
- function _(e) {
694
+ function g(e) {
714
695
  return e.content ?? l.get(e.id) ?? null;
715
696
  }
716
697
  async function v(n) {
717
- let r = _(n);
698
+ let r = g(n);
718
699
  if (r) return r;
719
700
  let i = f("get");
720
701
  try {
@@ -730,7 +711,7 @@ function H(e) {
730
711
  let o = f("create");
731
712
  try {
732
713
  let e = await a(o, n, i);
733
- return r.value = [e, ...r.value], h(() => t.onCreated?.(e)), e;
714
+ return r.value = [e, ...r.value], m(() => t.onCreated?.(e)), e;
734
715
  } catch (t) {
735
716
  throw e.onError?.(t), t;
736
717
  }
@@ -747,7 +728,7 @@ function H(e) {
747
728
  } finally {
748
729
  s.value = !1;
749
730
  }
750
- return h(() => t.onRestored?.(a)), a;
731
+ return m(() => t.onRestored?.(a)), a;
751
732
  }
752
733
  return {
753
734
  nextCursor: o,
@@ -756,31 +737,31 @@ function H(e) {
756
737
  isRestoring: s,
757
738
  canCreate: u,
758
739
  canRestore: d,
759
- load: g,
760
- peekContent: _,
740
+ load: h,
741
+ peekContent: g,
761
742
  resolveContent: v,
762
743
  create: y,
763
744
  restore: b
764
745
  };
765
746
  }
766
747
  function U(e) {
767
- let { provider: t, getTemplateId: n, getUser: r } = e, i = a([]), o = a(!1), s = a(!1), l = c(() => typeof t.create == "function"), u = c(() => typeof t.update == "function"), d = c(() => typeof t.delete == "function"), f = c(() => typeof t.setResolved == "function"), p = c(() => i.value.reduce((e, t) => e + 1 + (t.replies?.length ?? 0), 0)), h = c(() => i.value.filter((e) => !e.resolvedAt).length), g = c(() => {
748
+ let { provider: t, getTemplateId: n, getUser: r } = e, i = a([]), o = a(!1), s = a(!1), l = c(() => typeof t.create == "function"), u = c(() => typeof t.update == "function"), d = c(() => typeof t.delete == "function"), f = c(() => typeof t.setResolved == "function"), p = c(() => i.value.reduce((e, t) => e + 1 + (t.replies?.length ?? 0), 0)), m = c(() => i.value.filter((e) => !e.resolvedAt).length), h = c(() => {
768
749
  let e = /* @__PURE__ */ new Map();
769
750
  for (let t of i.value) t.blockId && e.set(t.blockId, (e.get(t.blockId) ?? 0) + 1 + (t.replies?.length ?? 0));
770
751
  return e;
771
752
  });
772
- function _(e) {
753
+ function g(e) {
773
754
  let t = n();
774
- if (!t) throw new m(`[Templatical] Comments: ${e} needs a template. Call create() or load() first.`);
755
+ if (!t) throw new _(`[Templatical] Comments: ${e} needs a template. Call create() or load() first.`);
775
756
  return t;
776
757
  }
777
758
  function v(e) {
778
759
  let t = r();
779
- if (!t) throw new m(`[Templatical] Comments: ${e} needs to know who is commenting. Pass init({ user: { id, name } }) — an unattributed comment is not written.`);
760
+ if (!t) throw new _(`[Templatical] Comments: ${e} needs to know who is commenting. Pass init({ user: { id, name } }) — an unattributed comment is not written.`);
780
761
  return t;
781
762
  }
782
763
  function y(e) {
783
- throw new m(`[Templatical] Comments: ${e} is disabled by the provider. Check the capability before calling — the editor's own UI hides the action.`);
764
+ throw new _(`[Templatical] Comments: ${e} is disabled by the provider. Check the capability before calling — the editor's own UI hides the action.`);
784
765
  }
785
766
  function b(e) {
786
767
  for (let t of i.value) {
@@ -789,16 +770,16 @@ function U(e) {
789
770
  }
790
771
  return null;
791
772
  }
792
- function C(e) {
773
+ function x(e) {
793
774
  let t = r();
794
775
  return t !== null && e.author.id === t.id;
795
776
  }
796
777
  function w(t) {
797
- let n = x(t);
778
+ let n = S(t);
798
779
  throw e.onError?.(n), n;
799
780
  }
800
781
  function T(t) {
801
- S(e.onError, t);
782
+ C(e.onError, t);
802
783
  }
803
784
  function E(e, t, n) {
804
785
  return [
@@ -838,7 +819,7 @@ function U(e) {
838
819
  } : t) : i.value = i.value.filter((t) => t.id !== e), n;
839
820
  }
840
821
  async function A(e) {
841
- let n = _("list");
822
+ let n = g("list");
842
823
  o.value = !0;
843
824
  try {
844
825
  i.value = await t.list(n, e);
@@ -851,7 +832,7 @@ function U(e) {
851
832
  async function j(e) {
852
833
  let { create: n } = t;
853
834
  typeof n != "function" && y("create");
854
- let r = _("create");
835
+ let r = g("create");
855
836
  v("create"), s.value = !0;
856
837
  try {
857
838
  let i = await n(r, e);
@@ -865,7 +846,7 @@ function U(e) {
865
846
  async function M(e, n) {
866
847
  let { update: r } = t;
867
848
  typeof r != "function" && y("update");
868
- let i = _("update");
849
+ let i = g("update");
869
850
  v("update"), s.value = !0;
870
851
  try {
871
852
  let a = await r(i, e, n);
@@ -879,7 +860,7 @@ function U(e) {
879
860
  async function N(e) {
880
861
  let { delete: n } = t;
881
862
  typeof n != "function" && y("delete");
882
- let r = _("delete");
863
+ let r = g("delete");
883
864
  v("delete");
884
865
  let i = b(e);
885
866
  s.value = !0;
@@ -894,7 +875,7 @@ function U(e) {
894
875
  async function P(e, n) {
895
876
  let { setResolved: r } = t;
896
877
  typeof r != "function" && y("setResolved");
897
- let i = _("setResolved");
878
+ let i = g("setResolved");
898
879
  v("setResolved"), s.value = !0;
899
880
  try {
900
881
  let a = await r(i, e, n);
@@ -924,15 +905,15 @@ function U(e) {
924
905
  canDelete: d,
925
906
  canResolve: f,
926
907
  totalCount: p,
927
- unresolvedCount: h,
928
- commentCountByBlock: g,
908
+ unresolvedCount: m,
909
+ commentCountByBlock: h,
929
910
  load: A,
930
911
  create: j,
931
912
  update: M,
932
913
  remove: N,
933
914
  setResolved: P,
934
915
  find: b,
935
- isOwn: C,
916
+ isOwn: x,
936
917
  applyRemoteCreate: F,
937
918
  applyRemoteUpdate: I,
938
919
  applyRemoteDelete: L
@@ -972,7 +953,7 @@ function K(e, t, n = []) {
972
953
  //#endregion
973
954
  //#region src/utils/resolveFieldColors.ts
974
955
  function q(e, t) {
975
- let n = y({ presets: e.presets }, v), r = n.presets.length === 0, i = e.allowCustom ?? t.allowCustom;
956
+ let n = b({ presets: e.presets }, y), r = n.presets.length === 0, i = e.allowCustom ?? t.allowCustom;
976
957
  return {
977
958
  presets: r ? t.presets : n.presets,
978
959
  allowCustom: t.allowCustom !== !1 && i,
@@ -982,7 +963,7 @@ function q(e, t) {
982
963
  allowCustomIgnored: e.allowCustom === !0 && t.allowCustom === !1
983
964
  };
984
965
  }
985
- var J = b({
966
+ var J = x({
986
967
  name: "code",
987
968
  size: 24,
988
969
  node: [["path", {
@@ -992,7 +973,7 @@ var J = b({
992
973
  d: "m8 6-6 6 6 6",
993
974
  key: "ppft3o"
994
975
  }]]
995
- }), Y = b({
976
+ }), Y = x({
996
977
  name: "image",
997
978
  size: 24,
998
979
  node: [
@@ -1016,14 +997,14 @@ var J = b({
1016
997
  key: "1xmnt7"
1017
998
  }]
1018
999
  ]
1019
- }), X = b({
1000
+ }), X = x({
1020
1001
  name: "navigation",
1021
1002
  size: 24,
1022
1003
  node: [["polygon", {
1023
1004
  points: "3 11 22 2 13 21 11 13 3 11",
1024
1005
  key: "1ltx0t"
1025
1006
  }]]
1026
- }), Z = b({
1007
+ }), Z = x({
1027
1008
  name: "share-2",
1028
1009
  size: 24,
1029
1010
  node: [
@@ -1060,7 +1041,7 @@ var J = b({
1060
1041
  key: "1n3mei"
1061
1042
  }]
1062
1043
  ]
1063
- }), Q = b({
1044
+ }), Q = x({
1064
1045
  name: "table",
1065
1046
  size: 24,
1066
1047
  node: [
@@ -1087,7 +1068,7 @@ var J = b({
1087
1068
  ]
1088
1069
  }), $ = "image/";
1089
1070
  function ee(e) {
1090
- let { target: t, onFiles: n, enabled: r } = e, i = () => r === void 0 || s(r), { isOverDropZone: a } = _(t, {
1071
+ let { target: t, onFiles: n, enabled: r } = e, i = () => r === void 0 || s(r), { isOverDropZone: a } = v(t, {
1091
1072
  preventDefaultForUnhandled: !0,
1092
1073
  onDrop: (e) => {
1093
1074
  if (!i()) return;
@@ -1099,7 +1080,7 @@ function ee(e) {
1099
1080
  }
1100
1081
  //#endregion
1101
1082
  //#region src/constants/socialIcons.ts
1102
- var te = h, ne = {
1083
+ var te = d, ne = {
1103
1084
  small: 24,
1104
1085
  medium: 32,
1105
1086
  large: 48
@@ -1123,4 +1104,4 @@ var te = h, ne = {
1123
1104
  "behance"
1124
1105
  ];
1125
1106
  //#endregion
1126
- export { O as C, H as E, w as S, I as T, A as _, Q as a, N as b, Y as c, K as d, G as f, M as g, R as h, ee as i, J as l, V as m, te as n, Z as o, j as p, re as r, X as s, ne as t, q as u, W as v, F as w, P as x, U as y };
1107
+ export { k as C, H as E, T as S, I as T, A as _, Q as a, N as b, Y as c, K as d, G as f, M as g, R as h, ee as i, J as l, V as m, te as n, Z as o, j as p, re as r, X as s, ne as t, q as u, W as v, F as w, P as x, U as y };