@templatical/editor 0.0.3 → 0.0.5

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 (144) hide show
  1. package/dist/{AiChatSidebar-busJk9hm.js → AiChatSidebar-DwME3f-a.js} +84 -70
  2. package/dist/{AiFeatureMenu-DLGv_-pj.js → AiFeatureMenu-DJvWL1GZ.js} +23 -23
  3. package/dist/CloudEditor-Fe0ssRgi.js +1082 -0
  4. package/dist/{CollaboratorBar-Dv3l52vC.js → CollaboratorBar-DTT0EkZn.js} +25 -21
  5. package/dist/{CommentsSidebar-4tjp0VU5.js → CommentsSidebar-DrJhQRXK.js} +131 -131
  6. package/dist/{DesignReferenceSidebar-CmwXvltV.js → DesignReferenceSidebar-DdOht5zn.js} +49 -49
  7. package/dist/ModuleBrowserModal-CiV_jOEM.js +205 -0
  8. package/dist/{ModulePreviewCanvas-BcBJLnwL.js → ModulePreviewCanvas-Bmy6Y1WE.js} +2 -2
  9. package/dist/ParagraphEditor-CoQ3NlS7.js +688 -0
  10. package/dist/{RichTextEditorContent-CQqodi7p.js → RichTextEditorContent-CHJlh7HJ.js} +8 -4
  11. package/dist/{SaveModuleDialog-Bmzi72td.js → SaveModuleDialog-CD2ZYq1o.js} +25 -25
  12. package/dist/{SnapshotHistory-AEgi9Xsn.js → SnapshotHistory-DltsKvhP.js} +2 -2
  13. package/dist/TemplateScoringPanel-DmnmUE3y.js +254 -0
  14. package/dist/{TestEmailModal-Dpq1is9S.js → TestEmailModal-Dl633j9o.js} +3 -3
  15. package/dist/{TitleEditor-CLcDdcWI.js → TitleEditor-C7fds2Nc.js} +7 -7
  16. package/dist/{TplModal-CGzRjR96.js → TplModal-C5_CF-qn.js} +2 -2
  17. package/dist/{blockTypeIcons-BpPTqcok.js → blockTypeIcons-BrKZB10B.js} +1 -1
  18. package/dist/cdn/chunks/AiChatSidebar-X_Bv3Qys.js +2 -0
  19. package/dist/cdn/chunks/AiFeatureMenu-C5UQmEgV.js +59 -0
  20. package/dist/cdn/chunks/AiFeatureMenu-C5UQmEgV.js.map +1 -0
  21. package/dist/cdn/chunks/CloudEditor-DeTolKnf.js +1056 -0
  22. package/dist/cdn/chunks/CloudEditor-DeTolKnf.js.map +1 -0
  23. package/dist/cdn/chunks/CollaboratorBar-DO1nxSrr.js +51 -0
  24. package/dist/cdn/chunks/CollaboratorBar-DO1nxSrr.js.map +1 -0
  25. package/dist/cdn/chunks/CommentsSidebar-4MTw_hue.js +2 -0
  26. package/dist/cdn/chunks/DesignReferenceSidebar-Bswh4Yx4.js +2 -0
  27. package/dist/{ModuleBrowserModal-lrk3Fr0H.js → cdn/chunks/ModuleBrowserModal-ChBr3aXj.js} +52 -62
  28. package/dist/cdn/chunks/ModuleBrowserModal-ChBr3aXj.js.map +1 -0
  29. package/dist/cdn/chunks/ModulePreviewCanvas-DkSvri9H.js +107 -0
  30. package/dist/cdn/chunks/ModulePreviewCanvas-DkSvri9H.js.map +1 -0
  31. package/dist/cdn/chunks/ParagraphEditor-DU3oUKA7.js +539 -0
  32. package/dist/cdn/chunks/ParagraphEditor-DU3oUKA7.js.map +1 -0
  33. package/dist/cdn/chunks/RichTextEditorContent-BrsW1p9s.js +106 -0
  34. package/dist/cdn/chunks/RichTextEditorContent-BrsW1p9s.js.map +1 -0
  35. package/dist/cdn/chunks/SaveModuleDialog-CjqKkTEc.js +119 -0
  36. package/dist/cdn/chunks/SaveModuleDialog-CjqKkTEc.js.map +1 -0
  37. package/dist/cdn/chunks/SnapshotHistory-KME4xmn_.js +2 -0
  38. package/dist/cdn/chunks/TemplateScoringPanel-DgB3xDN6.js +2 -0
  39. package/dist/cdn/chunks/TestEmailModal-DdpvRbYf.js +2 -0
  40. package/dist/cdn/chunks/TitleEditor-C8FYbadT.js +166 -0
  41. package/dist/cdn/chunks/TitleEditor-C8FYbadT.js.map +1 -0
  42. package/dist/cdn/chunks/_rolldown_dynamic_import_helper-DMEI4TQ3.js +9 -0
  43. package/dist/cdn/chunks/blockTypeIcons-5QwYklNq.js +22 -0
  44. package/dist/cdn/chunks/blockTypeIcons-5QwYklNq.js.map +1 -0
  45. package/dist/cdn/chunks/de-BB3dgVOc.js +700 -0
  46. package/dist/cdn/chunks/de-BB3dgVOc.js.map +1 -0
  47. package/dist/cdn/chunks/de-BvYD17KT.js +89 -0
  48. package/dist/cdn/chunks/de-BvYD17KT.js.map +1 -0
  49. package/dist/cdn/chunks/dist-BF5c3Dr-.js +2 -0
  50. package/dist/cdn/chunks/dist-BGzvIxcJ.js +2 -0
  51. package/dist/cdn/chunks/dist-CFemF8rI.js +2 -0
  52. package/dist/cdn/chunks/dist-Co6uFhFK.js +2 -0
  53. package/dist/cdn/chunks/dist-DCikBY9K.js +2 -0
  54. package/dist/cdn/chunks/dist-DUILafAC.js +2 -0
  55. package/dist/cdn/chunks/dist-DghiKH0A.js +2 -0
  56. package/dist/cdn/chunks/dist-Dw8ckvfK.js +2 -0
  57. package/dist/cdn/chunks/dist-H07p0KAw.js +2 -0
  58. package/dist/cdn/chunks/dist-KYv9v_1z2.js +457 -0
  59. package/dist/cdn/chunks/dist-KYv9v_1z2.js.map +1 -0
  60. package/dist/cdn/chunks/dist-MjnKIc0W.js +2 -0
  61. package/dist/cdn/chunks/dist-odp0vGRv.js +2 -0
  62. package/dist/cdn/chunks/draggable-BQNU47zu.js +11544 -0
  63. package/dist/cdn/chunks/{draggable-ClUwYCFL.js.map → draggable-BQNU47zu.js.map} +1 -1
  64. package/dist/cdn/chunks/emojiData-BVEJHcNH.js +19 -0
  65. package/dist/cdn/chunks/{emojiData-6fVLNqeH.js.map → emojiData-BVEJHcNH.js.map} +1 -1
  66. package/dist/cdn/chunks/en-CpotcOPr.js +89 -0
  67. package/dist/cdn/chunks/en-CpotcOPr.js.map +1 -0
  68. package/dist/cdn/chunks/en-DeDcpnoS.js +700 -0
  69. package/dist/cdn/chunks/en-DeDcpnoS.js.map +1 -0
  70. package/dist/cdn/chunks/extensions-Bj7USRLr.js +419 -0
  71. package/dist/cdn/chunks/{extensions-ea_ewKUl.js.map → extensions-Bj7USRLr.js.map} +1 -1
  72. package/dist/cdn/chunks/features-Ds0XUfte.js +6737 -0
  73. package/dist/cdn/chunks/features-Ds0XUfte.js.map +1 -0
  74. package/dist/cdn/chunks/icons-fWsuSvgd.js +653 -0
  75. package/dist/cdn/chunks/icons-fWsuSvgd.js.map +1 -0
  76. package/dist/cdn/chunks/liquid.browser-C1VIYISn.js +3272 -0
  77. package/dist/cdn/chunks/liquid.browser-C1VIYISn.js.map +1 -0
  78. package/dist/cdn/chunks/media-library-BGQm_OyC.js +6005 -0
  79. package/dist/cdn/chunks/media-library-BGQm_OyC.js.map +1 -0
  80. package/dist/cdn/chunks/pusher-DJPhQnE8.js +2505 -0
  81. package/dist/cdn/chunks/pusher-DJPhQnE8.js.map +1 -0
  82. package/dist/cdn/chunks/readableTextColor-Cd_cgWO_.js +32 -0
  83. package/dist/cdn/chunks/readableTextColor-Cd_cgWO_.js.map +1 -0
  84. package/dist/cdn/chunks/rolldown-runtime-DPITmOBR.js +20 -0
  85. package/dist/cdn/chunks/src-3i8rPuqd.js +494 -0
  86. package/dist/cdn/chunks/src-3i8rPuqd.js.map +1 -0
  87. package/dist/cdn/chunks/styleConstants-DFe3I4Op.js +57 -0
  88. package/dist/cdn/chunks/{styleConstants-CNejCb-L.js.map → styleConstants-DFe3I4Op.js.map} +1 -1
  89. package/dist/cdn/chunks/styles-Dgijy53u.js +3350 -0
  90. package/dist/cdn/chunks/styles-Dgijy53u.js.map +1 -0
  91. package/dist/cdn/chunks/tiptap-BhxaWR8R.js +14208 -0
  92. package/dist/cdn/chunks/{tiptap-Cya4P9CN.js.map → tiptap-BhxaWR8R.js.map} +1 -1
  93. package/dist/cdn/editor.css +2 -1
  94. package/dist/cdn/editor.js +231 -1
  95. package/dist/cdn/editor.js.map +1 -1
  96. package/dist/{de-B4Ob4vCo.js → de-D7TLGIPA.js} +20 -4
  97. package/dist/{dist-DmpMJbmZ.js → dist-Ci5lFuUy.js} +1 -1
  98. package/dist/{en-YXsspZJG.js → en-DvtiEMwP.js} +20 -4
  99. package/dist/{extensions-CKM99njP.js → extensions-DWx_jj8v.js} +3 -3
  100. package/dist/{keys-Dwa2PmdD.js → keys-C0MQRs8d.js} +3 -3
  101. package/dist/readableTextColor-LDlmVEUv.js +30 -0
  102. package/dist/{styleConstants-D4SOZGBV.js → styleConstants-Cxw88naD.js} +5 -5
  103. package/dist/styles-fdXNRqI3.js +3556 -0
  104. package/dist/templatical-editor.css +1 -1
  105. package/dist/templatical-editor.js +122 -128
  106. package/dist/templatical-editor.umd.cjs +62 -71
  107. package/dist/{useEditorCore-Cc4RCwWq.js → useEditorCore-DUGD6pq_.js} +1247 -1088
  108. package/dist/{useI18n-DUirdXEX.js → useI18n-D6m7ZUgY.js} +1 -1
  109. package/dist/{useMergeTag-DVnlvPYJ.js → useMergeTag-BZ3X0bNr.js} +1 -1
  110. package/package.json +4 -2
  111. package/dist/CloudEditor-BDnHd6Um.js +0 -919
  112. package/dist/ParagraphEditor-DH8cSC6m.js +0 -625
  113. package/dist/TemplateScoringPanel-CTgMtc0-.js +0 -249
  114. package/dist/cdn/chunks/ParagraphEditor-CCtWbGDv.js +0 -3
  115. package/dist/cdn/chunks/ParagraphEditor-CCtWbGDv.js.map +0 -1
  116. package/dist/cdn/chunks/RichTextEditorContent-BUD9veXd.js +0 -2
  117. package/dist/cdn/chunks/RichTextEditorContent-BUD9veXd.js.map +0 -1
  118. package/dist/cdn/chunks/TitleEditor-e_UTyxjd.js +0 -3
  119. package/dist/cdn/chunks/TitleEditor-e_UTyxjd.js.map +0 -1
  120. package/dist/cdn/chunks/dist-0UheN8rK.js +0 -1
  121. package/dist/cdn/chunks/dist-55mmbGQ9.js +0 -1
  122. package/dist/cdn/chunks/dist-B31mxKyP.js +0 -1
  123. package/dist/cdn/chunks/dist-B5JI9nIg.js +0 -1
  124. package/dist/cdn/chunks/dist-B93vLKhU.js +0 -1
  125. package/dist/cdn/chunks/dist-BDt3FJvj.js +0 -1
  126. package/dist/cdn/chunks/dist-BJRuFHmi.js +0 -1
  127. package/dist/cdn/chunks/dist-BKSzrf0L.js +0 -1
  128. package/dist/cdn/chunks/dist-BL8c5gYQ.js +0 -1
  129. package/dist/cdn/chunks/dist-CYThWMP5.js +0 -1
  130. package/dist/cdn/chunks/dist-DxZbPJYt.js +0 -1
  131. package/dist/cdn/chunks/draggable-ClUwYCFL.js +0 -17
  132. package/dist/cdn/chunks/emojiData-6fVLNqeH.js +0 -2
  133. package/dist/cdn/chunks/extensions-ea_ewKUl.js +0 -2
  134. package/dist/cdn/chunks/icons-vmLJTaJk.js +0 -2
  135. package/dist/cdn/chunks/icons-vmLJTaJk.js.map +0 -1
  136. package/dist/cdn/chunks/rolldown-runtime-BakkzWXw.js +0 -1
  137. package/dist/cdn/chunks/styleConstants-CNejCb-L.js +0 -2
  138. package/dist/cdn/chunks/tiptap-Cya4P9CN.js +0 -145
  139. package/dist/cdn/chunks/useEditorCore-CwuxQuvh.js +0 -2
  140. package/dist/cdn/chunks/useEditorCore-CwuxQuvh.js.map +0 -1
  141. package/dist/cdn/chunks/useMergeTag-DVOz1v9p.js +0 -2
  142. package/dist/cdn/chunks/useMergeTag-DVOz1v9p.js.map +0 -1
  143. package/dist/i18n-CJsFtdbZ.js +0 -23
  144. package/dist/styles-DSw1VNU3.js +0 -3406
@@ -1,625 +0,0 @@
1
- import { C as e, b as t } from "./useEditorCore-Cc4RCwWq.js";
2
- import { C as n, p as r, w as i, x as a } from "./keys-Dwa2PmdD.js";
3
- import { t as o } from "./useI18n-DUirdXEX.js";
4
- import { n as s } from "./_plugin-vue_export-helper-B1-bu7yR.js";
5
- import { a as c, i as l, n as u, r as d, t as f } from "./RichTextEditorContent-CQqodi7p.js";
6
- import { t as p } from "./loader-circle-BTQQxC3l.js";
7
- import { t as m } from "./scan-line-7lZPfOdm.js";
8
- import { _ as h, a as g, g as _, h as v, o as y, s as b } from "./styleConstants-D4SOZGBV.js";
9
- import { Fragment as x, Teleport as ee, createBlock as S, createCommentVNode as C, createElementBlock as w, createElementVNode as T, createTextVNode as E, createVNode as D, defineComponent as O, inject as k, isRef as A, normalizeClass as j, normalizeStyle as M, openBlock as N, renderList as P, toDisplayString as F, unref as I } from "vue";
10
- var te = s("list-ordered", [
11
- ["path", {
12
- d: "M11 5h10",
13
- key: "1cz7ny"
14
- }],
15
- ["path", {
16
- d: "M11 12h10",
17
- key: "1438ji"
18
- }],
19
- ["path", {
20
- d: "M11 19h10",
21
- key: "11t30w"
22
- }],
23
- ["path", {
24
- d: "M4 4h1v5",
25
- key: "10yrso"
26
- }],
27
- ["path", {
28
- d: "M4 9h2",
29
- key: "r1h2o0"
30
- }],
31
- ["path", {
32
- d: "M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02",
33
- key: "xtkcd5"
34
- }]
35
- ]), ne = s("list", [
36
- ["path", {
37
- d: "M3 5h.01",
38
- key: "18ugdj"
39
- }],
40
- ["path", {
41
- d: "M3 12h.01",
42
- key: "nlz23k"
43
- }],
44
- ["path", {
45
- d: "M3 19h.01",
46
- key: "noohij"
47
- }],
48
- ["path", {
49
- d: "M8 5h13",
50
- key: "1pao27"
51
- }],
52
- ["path", {
53
- d: "M8 12h13",
54
- key: "1za7za"
55
- }],
56
- ["path", {
57
- d: "M8 19h13",
58
- key: "m83p4d"
59
- }]
60
- ]), L = s("remove-formatting", [
61
- ["path", {
62
- d: "M4 7V4h16v3",
63
- key: "9msm58"
64
- }],
65
- ["path", {
66
- d: "M5 20h6",
67
- key: "1h6pxn"
68
- }],
69
- ["path", {
70
- d: "M13 4 8 20",
71
- key: "kqq6aj"
72
- }],
73
- ["path", {
74
- d: "m15 15 5 5",
75
- key: "me55sn"
76
- }],
77
- ["path", {
78
- d: "m20 15-5 5",
79
- key: "11p7ol"
80
- }]
81
- ]), R = s("smile", [
82
- ["circle", {
83
- cx: "12",
84
- cy: "12",
85
- r: "10",
86
- key: "1mglay"
87
- }],
88
- ["path", {
89
- d: "M8 14s1.5 2 4 2 4-2 4-2",
90
- key: "1y1vjs"
91
- }],
92
- ["line", {
93
- x1: "9",
94
- x2: "9.01",
95
- y1: "9",
96
- y2: "9",
97
- key: "yxxnd0"
98
- }],
99
- ["line", {
100
- x1: "15",
101
- x2: "15.01",
102
- y1: "9",
103
- y2: "9",
104
- key: "1p4y9e"
105
- }]
106
- ]), z = s("strikethrough", [
107
- ["path", {
108
- d: "M16 4H9a3 3 0 0 0-2.83 4",
109
- key: "43sutm"
110
- }],
111
- ["path", {
112
- d: "M14 12a4 4 0 0 1 0 8H6",
113
- key: "nlfj13"
114
- }],
115
- ["line", {
116
- x1: "4",
117
- x2: "20",
118
- y1: "12",
119
- y2: "12",
120
- key: "1e0a9i"
121
- }]
122
- ]), re = s("subscript", [
123
- ["path", {
124
- d: "m4 5 8 8",
125
- key: "1eunvl"
126
- }],
127
- ["path", {
128
- d: "m12 5-8 8",
129
- key: "1ah0jp"
130
- }],
131
- ["path", {
132
- d: "M20 19h-4c0-1.5.44-2 1.5-2.5S20 15.33 20 14c0-.47-.17-.93-.48-1.29a2.11 2.11 0 0 0-2.62-.44c-.42.24-.74.62-.9 1.07",
133
- key: "e8ta8j"
134
- }]
135
- ]), ie = s("superscript", [
136
- ["path", {
137
- d: "m4 19 8-8",
138
- key: "hr47gm"
139
- }],
140
- ["path", {
141
- d: "m12 19-8-8",
142
- key: "1dhhmo"
143
- }],
144
- ["path", {
145
- d: "M20 12h-4c0-1.5.442-2 1.5-2.5S20 8.334 20 7.002c0-.472-.17-.93-.484-1.29a2.105 2.105 0 0 0-2.617-.436c-.42.239-.738.614-.899 1.06",
146
- key: "1dfcux"
147
- }]
148
- ]), ae = s("underline", [["path", {
149
- d: "M6 4v6a6 6 0 0 0 12 0V4",
150
- key: "9kb039"
151
- }], ["line", {
152
- x1: "4",
153
- x2: "20",
154
- y1: "20",
155
- y2: "20",
156
- key: "nun2al"
157
- }]]), B = { class: "tpl:relative" }, V = ["aria-label", "title"], H = {
158
- key: 0,
159
- class: "tpl-emoji-picker tpl:absolute tpl:top-full tpl:left-0 tpl:z-10 tpl:mt-2 tpl:w-72 tpl:rounded-lg tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:p-2 tpl:shadow-lg"
160
- }, U = { class: "tpl:mb-1.5 tpl:text-[10px] tpl:font-medium tpl:tracking-wide tpl:text-[var(--tpl-text-muted)] tpl:uppercase" }, W = { class: "tpl:grid tpl:grid-cols-10 tpl:gap-0.5" }, G = ["onClick"], K = /* @__PURE__ */ O({
161
- __name: "EmojiPickerDropdown",
162
- emits: ["insert"],
163
- setup(t, { emit: n }) {
164
- let r = n, { categories: i, isOpen: a, toggle: s } = e(), { t: c } = o();
165
- return (e, t) => (N(), w("div", B, [T("button", {
166
- type: "button",
167
- class: j(["tpl-text-toolbar-btn", { "tpl-text-toolbar-btn--active": I(a) }]),
168
- "aria-label": I(c).paragraphEditor.insertEmoji,
169
- title: I(c).paragraphEditor.insertEmoji,
170
- onClick: t[0] ||= (...e) => I(s) && I(s)(...e)
171
- }, [D(I(R), {
172
- size: 16,
173
- "stroke-width": 2
174
- })], 10, V), I(a) ? (N(), w("div", H, [(N(!0), w(x, null, P(I(i), (e) => (N(), w("div", {
175
- key: e.key,
176
- class: "tpl:mb-2 tpl:last:mb-0"
177
- }, [T("div", U, F(I(c).emoji[e.key]), 1), T("div", W, [(N(!0), w(x, null, P(e.emojis, (e) => (N(), w("button", {
178
- key: e,
179
- type: "button",
180
- class: "tpl:flex tpl:size-6 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded tpl:border-none tpl:bg-transparent tpl:text-base tpl:transition-all tpl:duration-100 tpl:hover:scale-125 tpl:hover:bg-[var(--tpl-bg-active)]",
181
- onClick: (t) => r("insert", e)
182
- }, F(e), 9, G))), 128))])]))), 128))])) : C("", !0)]));
183
- }
184
- }), q = ["data-tpl-theme", "aria-label"], J = { class: "tpl:flex tpl:items-center tpl:gap-1" }, oe = [
185
- "value",
186
- "aria-label",
187
- "title"
188
- ], se = { value: "" }, ce = ["value"], le = [
189
- "value",
190
- "aria-label",
191
- "title"
192
- ], ue = { value: "" }, de = ["value"], fe = { class: "tpl:relative" }, pe = [
193
- "value",
194
- "aria-label",
195
- "title"
196
- ], me = { class: "tpl:relative" }, he = [
197
- "value",
198
- "aria-label",
199
- "title"
200
- ], ge = ["aria-label", "title"], _e = ["aria-label", "title"], ve = ["aria-label", "title"], ye = ["aria-label", "title"], be = ["aria-label", "title"], xe = ["aria-label", "title"], Se = ["aria-label", "title"], Ce = { class: "tpl:flex tpl:items-center tpl:gap-1" }, we = ["aria-label", "title"], Te = ["aria-label", "title"], Ee = ["aria-label", "title"], De = ["aria-label", "title"], Oe = ["aria-label", "title"], ke = ["value", "title"], Ae = ["value"], je = ["value", "title"], Me = ["value"], Y = ["aria-label", "title"], Ne = {
201
- key: 0,
202
- class: "tpl:mx-1.5 tpl:h-6 tpl:w-px tpl:bg-[var(--tpl-border)]"
203
- }, Pe = ["aria-label", "title"], Fe = {
204
- key: 1,
205
- class: "tpl:flex tpl:items-center tpl:gap-2 tpl:px-2 tpl:text-xs tpl:text-[var(--tpl-text-dim)]"
206
- }, X = /* @__PURE__ */ O({
207
- __name: "ParagraphToolbar",
208
- props: {
209
- editor: {},
210
- toolbarPosition: {},
211
- isLoading: { type: Boolean },
212
- mergeTagEnabled: { type: Boolean }
213
- },
214
- emits: ["open-link-dialog", "add-merge-tag"],
215
- setup(e, { emit: t }) {
216
- let s = e, u = t, f = k(a, null), O = k(n, null), A = i(r, "ParagraphToolbar"), { t: R } = o(), B = A.fonts;
217
- function V(e) {
218
- s.editor?.chain().focus().insertContent(e).run();
219
- }
220
- function H() {
221
- return s.editor?.getAttributes("textStyle").fontFamily || "";
222
- }
223
- function U() {
224
- return s.editor?.getAttributes("textStyle").fontSize || "";
225
- }
226
- function W() {
227
- return s.editor?.getAttributes("textStyle").color || "";
228
- }
229
- function G(e) {
230
- e ? s.editor?.chain().focus().setFontFamily(e).run() : s.editor?.chain().focus().unsetFontFamily().run();
231
- }
232
- function X(e) {
233
- e ? s.editor?.chain().focus().setFontSize(e).run() : s.editor?.chain().focus().unsetFontSize().run();
234
- }
235
- function Z(e) {
236
- e ? s.editor?.chain().focus().setColor(e).run() : s.editor?.chain().focus().unsetColor().run();
237
- }
238
- function Q() {
239
- return s.editor?.getAttributes("paragraph").lineHeight || "";
240
- }
241
- function Ie(e) {
242
- e ? s.editor?.chain().focus().setLineHeight(e).run() : s.editor?.chain().focus().unsetLineHeight().run();
243
- }
244
- function Le() {
245
- return s.editor?.getAttributes("textStyle").letterSpacing || "";
246
- }
247
- function Re(e) {
248
- e && e !== "normal" ? s.editor?.chain().focus().setLetterSpacing(e).run() : s.editor?.chain().focus().unsetLetterSpacing().run();
249
- }
250
- function $() {
251
- return s.editor?.getAttributes("highlight").color || "";
252
- }
253
- function ze(e) {
254
- e ? s.editor?.chain().focus().setHighlight({ color: e }).run() : s.editor?.chain().focus().unsetHighlight().run();
255
- }
256
- return (t, n) => (N(), S(ee, { to: "body" }, [T("div", {
257
- "data-tpl-theme": I(O),
258
- role: "toolbar",
259
- "aria-label": I(R).paragraphEditor.toolbar,
260
- class: "tpl tpl-text-toolbar tpl:fixed tpl:z-popover tpl:flex tpl:gap-1 tpl:rounded-lg tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:px-3 tpl:py-2 tpl:shadow-lg",
261
- style: M({
262
- ...I(f),
263
- top: `${e.toolbarPosition.top}px`,
264
- left: `${e.toolbarPosition.left}px`,
265
- transform: "translateY(-100%)",
266
- flexDirection: "column"
267
- })
268
- }, [!e.isLoading && e.editor ? (N(), w(x, { key: 0 }, [T("div", J, [
269
- T("select", {
270
- class: "tpl:h-8 tpl:w-32 tpl:cursor-pointer tpl:rounded tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:px-2 tpl:text-xs tpl:text-[var(--tpl-text)] tpl:outline-none",
271
- value: H(),
272
- "aria-label": I(R).paragraphEditor.fontFamily,
273
- title: I(R).paragraphEditor.fontFamily,
274
- onChange: n[0] ||= (e) => G(e.target.value)
275
- }, [T("option", se, F(I(R).paragraphEditor.defaultFont), 1), (N(!0), w(x, null, P(I(B), (e) => (N(), w("option", {
276
- key: e.value,
277
- value: e.value
278
- }, F(e.label), 9, ce))), 128))], 40, oe),
279
- T("select", {
280
- class: "tpl:h-8 tpl:w-20 tpl:cursor-pointer tpl:rounded tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:px-2 tpl:text-xs tpl:text-[var(--tpl-text)] tpl:outline-none",
281
- value: U(),
282
- "aria-label": I(R).paragraphEditor.fontSize,
283
- title: I(R).paragraphEditor.fontSize,
284
- onChange: n[1] ||= (e) => X(e.target.value)
285
- }, [T("option", ue, F(I(R).paragraphEditor.defaultSize), 1), (N(!0), w(x, null, P(I(g), (e) => (N(), w("option", {
286
- key: e,
287
- value: e
288
- }, F(e), 9, de))), 128))], 40, le),
289
- n[20] ||= T("span", {
290
- class: "tpl:mx-1 tpl:h-6 tpl:w-px tpl:bg-[var(--tpl-border)]",
291
- "aria-hidden": "true"
292
- }, null, -1),
293
- T("div", fe, [T("input", {
294
- type: "color",
295
- class: "tpl:size-8 tpl:cursor-pointer tpl:rounded tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:p-1",
296
- value: W() || I("#000000"),
297
- "aria-label": I(R).paragraphEditor.textColor,
298
- title: I(R).paragraphEditor.textColor,
299
- onInput: n[2] ||= (e) => Z(e.target.value)
300
- }, null, 40, pe)]),
301
- T("div", me, [T("input", {
302
- type: "color",
303
- class: "tpl:size-8 tpl:cursor-pointer tpl:rounded tpl:border tpl:border-[var(--tpl-border)] tpl:p-1",
304
- style: M({ backgroundColor: $() || "var(--tpl-bg)" }),
305
- value: $() || I("#ffff00"),
306
- "aria-label": I(R).paragraphEditor.highlightColor,
307
- title: I(R).paragraphEditor.highlightColor,
308
- onInput: n[3] ||= (e) => ze(e.target.value)
309
- }, null, 44, he)]),
310
- n[21] ||= T("span", {
311
- class: "tpl:mx-1 tpl:h-6 tpl:w-px tpl:bg-[var(--tpl-border)]",
312
- "aria-hidden": "true"
313
- }, null, -1),
314
- T("button", {
315
- type: "button",
316
- class: j(["tpl-text-toolbar-btn", { "tpl-text-toolbar-btn--active": e.editor?.isActive("bold") }]),
317
- "aria-label": I(R).paragraphEditor.bold,
318
- title: I(R).paragraphEditor.bold,
319
- onClick: n[4] ||= (t) => e.editor?.chain().focus().toggleBold().run()
320
- }, [D(I(c), {
321
- size: 16,
322
- "stroke-width": 2.5
323
- })], 10, ge),
324
- T("button", {
325
- type: "button",
326
- class: j(["tpl-text-toolbar-btn", { "tpl-text-toolbar-btn--active": e.editor?.isActive("italic") }]),
327
- "aria-label": I(R).paragraphEditor.italic,
328
- title: I(R).paragraphEditor.italic,
329
- onClick: n[5] ||= (t) => e.editor?.chain().focus().toggleItalic().run()
330
- }, [D(I(l), {
331
- size: 16,
332
- "stroke-width": 2
333
- })], 10, _e),
334
- T("button", {
335
- type: "button",
336
- class: j(["tpl-text-toolbar-btn", { "tpl-text-toolbar-btn--active": e.editor?.isActive("underline") }]),
337
- "aria-label": I(R).paragraphEditor.underline,
338
- title: I(R).paragraphEditor.underline,
339
- onClick: n[6] ||= (t) => e.editor?.chain().focus().toggleUnderline().run()
340
- }, [D(I(ae), {
341
- size: 16,
342
- "stroke-width": 2
343
- })], 10, ve),
344
- T("button", {
345
- type: "button",
346
- class: j(["tpl-text-toolbar-btn", { "tpl-text-toolbar-btn--active": e.editor?.isActive("strike") }]),
347
- "aria-label": I(R).paragraphEditor.strikethrough,
348
- title: I(R).paragraphEditor.strikethrough,
349
- onClick: n[7] ||= (t) => e.editor?.chain().focus().toggleStrike().run()
350
- }, [D(I(z), {
351
- size: 16,
352
- "stroke-width": 2
353
- })], 10, ye),
354
- n[22] ||= T("span", {
355
- class: "tpl:mx-1 tpl:h-6 tpl:w-px tpl:bg-[var(--tpl-border)]",
356
- "aria-hidden": "true"
357
- }, null, -1),
358
- T("button", {
359
- type: "button",
360
- class: j(["tpl-text-toolbar-btn", { "tpl-text-toolbar-btn--active": e.editor?.isActive("subscript") }]),
361
- "aria-label": I(R).paragraphEditor.subscript,
362
- title: I(R).paragraphEditor.subscript,
363
- onClick: n[8] ||= (t) => e.editor?.chain().focus().toggleSubscript().run()
364
- }, [D(I(re), {
365
- size: 16,
366
- "stroke-width": 2
367
- })], 10, be),
368
- T("button", {
369
- type: "button",
370
- class: j(["tpl-text-toolbar-btn", { "tpl-text-toolbar-btn--active": e.editor?.isActive("superscript") }]),
371
- "aria-label": I(R).paragraphEditor.superscript,
372
- title: I(R).paragraphEditor.superscript,
373
- onClick: n[9] ||= (t) => e.editor?.chain().focus().toggleSuperscript().run()
374
- }, [D(I(ie), {
375
- size: 16,
376
- "stroke-width": 2
377
- })], 10, xe),
378
- n[23] ||= T("span", {
379
- class: "tpl:mx-1 tpl:h-6 tpl:w-px tpl:bg-[var(--tpl-border)]",
380
- "aria-hidden": "true"
381
- }, null, -1),
382
- T("button", {
383
- type: "button",
384
- class: j(["tpl-text-toolbar-btn", { "tpl-text-toolbar-btn--active": e.editor?.isActive("link") }]),
385
- "aria-label": I(R).paragraphEditor.addLink,
386
- title: I(R).paragraphEditor.addLink,
387
- onClick: n[10] ||= (e) => u("open-link-dialog")
388
- }, [D(I(d), {
389
- size: 16,
390
- "stroke-width": 2
391
- })], 10, Se)
392
- ]), T("div", Ce, [
393
- T("button", {
394
- type: "button",
395
- class: j(["tpl-text-toolbar-btn", { "tpl-text-toolbar-btn--active": e.editor?.isActive("bulletList") }]),
396
- "aria-label": I(R).paragraphEditor.bulletList,
397
- title: I(R).paragraphEditor.bulletList,
398
- onClick: n[11] ||= (t) => e.editor?.chain().focus().toggleBulletList().run()
399
- }, [D(I(ne), {
400
- size: 16,
401
- "stroke-width": 2
402
- })], 10, we),
403
- T("button", {
404
- type: "button",
405
- class: j(["tpl-text-toolbar-btn", { "tpl-text-toolbar-btn--active": e.editor?.isActive("orderedList") }]),
406
- "aria-label": I(R).paragraphEditor.numberedList,
407
- title: I(R).paragraphEditor.numberedList,
408
- onClick: n[12] ||= (t) => e.editor?.chain().focus().toggleOrderedList().run()
409
- }, [D(I(te), {
410
- size: 16,
411
- "stroke-width": 2
412
- })], 10, Te),
413
- n[26] ||= T("span", {
414
- class: "tpl:mx-1.5 tpl:h-6 tpl:w-px tpl:bg-[var(--tpl-border)]",
415
- "aria-hidden": "true"
416
- }, null, -1),
417
- T("button", {
418
- type: "button",
419
- class: j(["tpl-text-toolbar-btn", { "tpl-text-toolbar-btn--active": e.editor?.isActive({ textAlign: "left" }) }]),
420
- "aria-label": I(R).paragraphEditor.alignLeft,
421
- title: I(R).paragraphEditor.alignLeft,
422
- onClick: n[13] ||= (t) => e.editor?.chain().focus().setTextAlign("left").run()
423
- }, [D(I(v), {
424
- size: 16,
425
- "stroke-width": 2
426
- })], 10, Ee),
427
- T("button", {
428
- type: "button",
429
- class: j(["tpl-text-toolbar-btn", { "tpl-text-toolbar-btn--active": e.editor?.isActive({ textAlign: "center" }) }]),
430
- "aria-label": I(R).paragraphEditor.alignCenter,
431
- title: I(R).paragraphEditor.alignCenter,
432
- onClick: n[14] ||= (t) => e.editor?.chain().focus().setTextAlign("center").run()
433
- }, [D(I(h), {
434
- size: 16,
435
- "stroke-width": 2
436
- })], 10, De),
437
- T("button", {
438
- type: "button",
439
- class: j(["tpl-text-toolbar-btn", { "tpl-text-toolbar-btn--active": e.editor?.isActive({ textAlign: "right" }) }]),
440
- "aria-label": I(R).paragraphEditor.alignRight,
441
- title: I(R).paragraphEditor.alignRight,
442
- onClick: n[15] ||= (t) => e.editor?.chain().focus().setTextAlign("right").run()
443
- }, [D(I(_), {
444
- size: 16,
445
- "stroke-width": 2
446
- })], 10, Oe),
447
- n[27] ||= T("span", {
448
- class: "tpl:mx-1.5 tpl:h-6 tpl:w-px tpl:bg-[var(--tpl-border)]",
449
- "aria-hidden": "true"
450
- }, null, -1),
451
- T("select", {
452
- class: "tpl:h-8 tpl:w-16 tpl:cursor-pointer tpl:rounded tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:px-1 tpl:text-xs tpl:text-[var(--tpl-text)] tpl:outline-none",
453
- value: Q(),
454
- title: I(R).paragraphEditor.lineHeight,
455
- onChange: n[16] ||= (e) => Ie(e.target.value)
456
- }, [n[24] ||= T("option", { value: "" }, "LH", -1), (N(!0), w(x, null, P(I(b), (e) => (N(), w("option", {
457
- key: e,
458
- value: e
459
- }, F(e), 9, Ae))), 128))], 40, ke),
460
- T("select", {
461
- class: "tpl:h-8 tpl:w-20 tpl:cursor-pointer tpl:rounded tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:px-1 tpl:text-xs tpl:text-[var(--tpl-text)] tpl:outline-none",
462
- value: Le(),
463
- title: I(R).paragraphEditor.letterSpacing,
464
- onChange: n[17] ||= (e) => Re(e.target.value)
465
- }, [n[25] ||= T("option", { value: "" }, "LS", -1), (N(!0), w(x, null, P(I(y), (e) => (N(), w("option", {
466
- key: e.value,
467
- value: e.value
468
- }, F(e.label), 9, Me))), 128))], 40, je),
469
- n[28] ||= T("span", {
470
- class: "tpl:mx-1.5 tpl:h-6 tpl:w-px tpl:bg-[var(--tpl-border)]",
471
- "aria-hidden": "true"
472
- }, null, -1),
473
- T("button", {
474
- type: "button",
475
- class: "tpl-text-toolbar-btn",
476
- "aria-label": I(R).paragraphEditor.clearFormatting,
477
- title: I(R).paragraphEditor.clearFormatting,
478
- onClick: n[18] ||= (t) => e.editor?.chain().focus().clearNodes().unsetAllMarks().run()
479
- }, [D(I(L), {
480
- size: 16,
481
- "stroke-width": 2
482
- })], 8, Y),
483
- n[29] ||= T("span", {
484
- class: "tpl:mx-1.5 tpl:h-6 tpl:w-px tpl:bg-[var(--tpl-border)]",
485
- "aria-hidden": "true"
486
- }, null, -1),
487
- D(K, { onInsert: V }),
488
- e.mergeTagEnabled ? (N(), w("span", Ne)) : C("", !0),
489
- e.mergeTagEnabled ? (N(), w("button", {
490
- key: 1,
491
- type: "button",
492
- class: "tpl:flex tpl:h-8 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:gap-1.5 tpl:rounded tpl:border-none tpl:bg-transparent tpl:px-2.5 tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-text)] tpl:transition-all tpl:duration-150 tpl:hover:bg-[var(--tpl-bg-active)]",
493
- "aria-label": I(R).mergeTag.add,
494
- title: I(R).mergeTag.add,
495
- onClick: n[19] ||= (e) => u("add-merge-tag")
496
- }, [D(I(m), {
497
- size: 16,
498
- "stroke-width": 2
499
- }), E(" " + F(I(R).mergeTag.add), 1)], 8, Pe)) : C("", !0)
500
- ])], 64)) : (N(), w("div", Fe, [D(I(p), {
501
- class: "tpl-spinner",
502
- size: 14,
503
- "stroke-width": 2
504
- }), E(" " + F(I(R).errors.editorLoading), 1)]))], 12, q)]));
505
- }
506
- }), Z = { class: "tpl-text-editor-wrapper tpl:relative" }, Q = /* @__PURE__ */ O({
507
- __name: "ParagraphEditor",
508
- props: {
509
- block: {},
510
- toolbarPosition: {}
511
- },
512
- emits: ["done"],
513
- setup(e, { emit: n }) {
514
- let r = e, i = n, { editor: a, EditorContent: o, isLoading: s, initError: c, retry: l, showLinkDialog: d, linkUrl: p, linkDialogRef: m, mergeTagEnabled: h, openLinkDialog: g, insertLink: _, removeLink: v, closeLinkDialog: y, handleLinkKeydown: b, handleAddMergeTag: x } = t({
515
- blockId: () => r.block.id,
516
- blockContent: () => r.block.content,
517
- onDone: () => i("done"),
518
- editorName: "ParagraphEditor",
519
- async loadExtensions({ mergeTags: e, syntax: t }) {
520
- let [{ Editor: n, EditorContent: r }, { default: i }, { default: a }, { default: o }, { default: s }, { default: c }, { default: l }, { TextStyle: u }, { default: d }, { default: f }, { default: p }, { MergeTagNode: m, LogicMergeTagNode: h, FontSize: g, LineHeight: _, LetterSpacing: v }] = await Promise.all([
521
- import("./dist-DmpMJbmZ.js").then((e) => e.r),
522
- import("./dist-DysAFIPy.js"),
523
- import("./dist-Bu7veieH.js"),
524
- import("./dist-C1BIRHCQ.js"),
525
- import("./dist-ChAGLpWo.js"),
526
- import("./dist-4LiM9FDd.js"),
527
- import("./dist-DrvKRSU6.js"),
528
- import("./dist-D_HQYSY-.js"),
529
- import("./dist-Dxnd0GRf.js"),
530
- import("./dist-DkypH7qG.js"),
531
- import("./dist-DmOE-Ubp.js"),
532
- import("./extensions-CKM99njP.js")
533
- ]);
534
- return {
535
- TiptapEditor: n,
536
- EC: r,
537
- extensions: [
538
- i.configure({
539
- heading: !1,
540
- codeBlock: !1,
541
- blockquote: !1,
542
- horizontalRule: !1
543
- }),
544
- o,
545
- s,
546
- c,
547
- a.configure({
548
- openOnClick: !1,
549
- HTMLAttributes: {
550
- target: "_blank",
551
- rel: "noopener noreferrer"
552
- }
553
- }),
554
- l.configure({ types: ["paragraph"] }),
555
- u,
556
- d,
557
- f,
558
- p.configure({ multicolor: !0 }),
559
- g,
560
- _,
561
- v,
562
- m.configure({
563
- mergeTags: e,
564
- syntax: t
565
- }),
566
- h.configure({ syntax: t })
567
- ]
568
- };
569
- }
570
- });
571
- return (t, n) => (N(), w("div", Z, [
572
- D(X, {
573
- editor: I(a),
574
- "toolbar-position": e.toolbarPosition,
575
- "is-loading": I(s),
576
- "merge-tag-enabled": I(h),
577
- onOpenLinkDialog: I(g),
578
- onAddMergeTag: I(x)
579
- }, null, 8, [
580
- "editor",
581
- "toolbar-position",
582
- "is-loading",
583
- "merge-tag-enabled",
584
- "onOpenLinkDialog",
585
- "onAddMergeTag"
586
- ]),
587
- D(f, {
588
- editor: I(a),
589
- "editor-content": I(o),
590
- "is-loading": I(s),
591
- "init-error": I(c),
592
- onRetry: I(l)
593
- }, null, 8, [
594
- "editor",
595
- "editor-content",
596
- "is-loading",
597
- "init-error",
598
- "onRetry"
599
- ]),
600
- D(u, {
601
- visible: I(d),
602
- "is-editing-link": I(a)?.isActive("link") ?? !1,
603
- "dialog-ref": I(m),
604
- "onUpdate:dialogRef": n[0] ||= (e) => A(m) ? m.value = e : null,
605
- "link-url": I(p),
606
- "onUpdate:linkUrl": n[1] ||= (e) => A(p) ? p.value = e : null,
607
- onClose: I(y),
608
- onInsert: I(_),
609
- onRemove: I(v),
610
- onKeydown: I(b)
611
- }, null, 8, [
612
- "visible",
613
- "is-editing-link",
614
- "dialog-ref",
615
- "link-url",
616
- "onClose",
617
- "onInsert",
618
- "onRemove",
619
- "onKeydown"
620
- ])
621
- ]));
622
- }
623
- });
624
- //#endregion
625
- export { Q as default };