@aswin.dev/editor 0.6.3 → 0.7.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 (158) hide show
  1. package/dist/AccessibilityPanel-CvQGLdu6.js +108 -0
  2. package/dist/AiChatSidebar-B3SJIKG_.js +229 -0
  3. package/dist/AiFeatureMenu-BLLKoOos.js +63 -0
  4. package/dist/BlockA11yBadge-CXDLqkcJ.js +34 -0
  5. package/dist/CloudEditor-BCz1ZTYC.js +1172 -0
  6. package/dist/CollaboratorBar-DuPYW5iF.js +95 -0
  7. package/dist/CommentsSidebar-B1pvJdqF.js +441 -0
  8. package/dist/CountdownBlock-BNSj1jvJ.js +92 -0
  9. package/dist/CountdownToolbar-ClJr2GzL.js +210 -0
  10. package/dist/DesignReferenceSidebar-B8V_F2yF.js +276 -0
  11. package/dist/LoadingTrack-B0CWFHXQ.js +10 -0
  12. package/dist/ModuleBrowserModal-DrUFMTDx.js +206 -0
  13. package/dist/ModulePreviewCanvas-CHdOwV_4.js +106 -0
  14. package/dist/NumberWithSuffix-DkXUez9t.js +422 -0
  15. package/dist/ParagraphEditor-D75wl3BX.js +695 -0
  16. package/dist/RichTextEditorContent-DYkIauIk.js +137 -0
  17. package/dist/SaveModuleDialog-FZ9lxY7_.js +123 -0
  18. package/dist/SnapshotHistory-BR3eV120.js +127 -0
  19. package/dist/TemplateScoringPanel-4GTNHej5.js +256 -0
  20. package/dist/TestEmailModal--ue5w9fT.js +94 -0
  21. package/dist/TitleEditor-fStSADI-.js +172 -0
  22. package/dist/TplModal-BwSfxIHf.js +44 -0
  23. package/dist/_plugin-vue_export-helper-B0hnzhyu.js +8 -0
  24. package/dist/accessibility-e8JYu_zd.js +27 -0
  25. package/dist/blockTypeIcons-BcTrDjmH.js +126 -0
  26. package/dist/bundle-stats.json +10 -0
  27. package/dist/cdn/chunks/AccessibilityPanel-B6DOjojm.js +97 -0
  28. package/dist/cdn/chunks/AccessibilityPanel-B6DOjojm.js.map +1 -0
  29. package/dist/cdn/chunks/AiFeatureMenu-qEdB2fZJ.js +59 -0
  30. package/dist/cdn/chunks/AiFeatureMenu-qEdB2fZJ.js.map +1 -0
  31. package/dist/cdn/chunks/BlockA11yBadge-DcEZftf6.js +33 -0
  32. package/dist/cdn/chunks/BlockA11yBadge-DcEZftf6.js.map +1 -0
  33. package/dist/cdn/chunks/CloudEditor-D2GsEC_n.js +1143 -0
  34. package/dist/cdn/chunks/CloudEditor-D2GsEC_n.js.map +1 -0
  35. package/dist/cdn/chunks/CollaboratorBar--nO7TX6b.js +51 -0
  36. package/dist/cdn/chunks/CollaboratorBar--nO7TX6b.js.map +1 -0
  37. package/dist/cdn/chunks/CountdownBlock-5YdT1uUu.js +93 -0
  38. package/dist/cdn/chunks/CountdownBlock-5YdT1uUu.js.map +1 -0
  39. package/dist/cdn/chunks/CountdownToolbar-DXPXrbAA.js +212 -0
  40. package/dist/cdn/chunks/CountdownToolbar-DXPXrbAA.js.map +1 -0
  41. package/dist/cdn/chunks/ModuleBrowserModal-DxoPp81s.js +195 -0
  42. package/dist/cdn/chunks/ModuleBrowserModal-DxoPp81s.js.map +1 -0
  43. package/dist/cdn/chunks/ModulePreviewCanvas-CoLdb4ar.js +107 -0
  44. package/dist/cdn/chunks/ModulePreviewCanvas-CoLdb4ar.js.map +1 -0
  45. package/dist/cdn/chunks/NumberWithSuffix-CE3NrZhH.js +423 -0
  46. package/dist/cdn/chunks/NumberWithSuffix-CE3NrZhH.js.map +1 -0
  47. package/dist/cdn/chunks/ParagraphEditor-B6Ygu-Mq.js +544 -0
  48. package/dist/cdn/chunks/ParagraphEditor-B6Ygu-Mq.js.map +1 -0
  49. package/dist/cdn/chunks/RichTextEditorContent-DL_y2SrR.js +106 -0
  50. package/dist/cdn/chunks/RichTextEditorContent-DL_y2SrR.js.map +1 -0
  51. package/dist/cdn/chunks/SaveModuleDialog-B0TnO_o9.js +119 -0
  52. package/dist/cdn/chunks/SaveModuleDialog-B0TnO_o9.js.map +1 -0
  53. package/dist/cdn/chunks/TitleEditor-BHpfxvwy.js +171 -0
  54. package/dist/cdn/chunks/TitleEditor-BHpfxvwy.js.map +1 -0
  55. package/dist/cdn/chunks/blockTypeIcons-BzzY9_kA.js +22 -0
  56. package/dist/cdn/chunks/blockTypeIcons-BzzY9_kA.js.map +1 -0
  57. package/dist/cdn/chunks/de-Ce-LbJ2J.js +89 -0
  58. package/dist/cdn/chunks/de-Ce-LbJ2J.js.map +1 -0
  59. package/dist/cdn/chunks/de-D8CnZxV9.js +523 -0
  60. package/dist/cdn/chunks/de-D8CnZxV9.js.map +1 -0
  61. package/dist/cdn/chunks/de-RQrZR56a.js +209 -0
  62. package/dist/cdn/chunks/de-RQrZR56a.js.map +1 -0
  63. package/dist/cdn/chunks/draggable-Bcb86AsV.js +11572 -0
  64. package/dist/cdn/chunks/draggable-Bcb86AsV.js.map +1 -0
  65. package/dist/cdn/chunks/emojiData-EMFlj6FJ.js +19 -0
  66. package/dist/cdn/chunks/emojiData-EMFlj6FJ.js.map +1 -0
  67. package/dist/cdn/chunks/en-8FHaQv4V.js +523 -0
  68. package/dist/cdn/chunks/en-8FHaQv4V.js.map +1 -0
  69. package/dist/cdn/chunks/en-Bl1ecfRF.js +209 -0
  70. package/dist/cdn/chunks/en-Bl1ecfRF.js.map +1 -0
  71. package/dist/cdn/chunks/en-DiCWK5fG.js +89 -0
  72. package/dist/cdn/chunks/en-DiCWK5fG.js.map +1 -0
  73. package/dist/cdn/chunks/extensions-DIxF31tA.js +598 -0
  74. package/dist/cdn/chunks/extensions-DIxF31tA.js.map +1 -0
  75. package/dist/cdn/chunks/features-DEMb13KS.js +6814 -0
  76. package/dist/cdn/chunks/features-DEMb13KS.js.map +1 -0
  77. package/dist/cdn/chunks/icons-CsLTcirh.js +700 -0
  78. package/dist/cdn/chunks/icons-CsLTcirh.js.map +1 -0
  79. package/dist/cdn/chunks/liquid.browser-lQbkge2E.js +3279 -0
  80. package/dist/cdn/chunks/liquid.browser-lQbkge2E.js.map +1 -0
  81. package/dist/cdn/chunks/media-library-CVaNvhpM.js +6014 -0
  82. package/dist/cdn/chunks/media-library-CVaNvhpM.js.map +1 -0
  83. package/dist/cdn/chunks/pusher-CDbNlZBE.js +2508 -0
  84. package/dist/cdn/chunks/pusher-CDbNlZBE.js.map +1 -0
  85. package/dist/cdn/chunks/quality-BaBfc54_.js +1456 -0
  86. package/dist/cdn/chunks/quality-BaBfc54_.js.map +1 -0
  87. package/dist/cdn/chunks/readableTextColor-DhoK4XiZ.js +32 -0
  88. package/dist/cdn/chunks/readableTextColor-DhoK4XiZ.js.map +1 -0
  89. package/dist/cdn/chunks/renderer-CUxvx7ro.js +548 -0
  90. package/dist/cdn/chunks/renderer-CUxvx7ro.js.map +1 -0
  91. package/dist/cdn/chunks/rolldown-runtime-BNuo_Jkg.js +20 -0
  92. package/dist/cdn/chunks/src-CRaqN-p8.js +497 -0
  93. package/dist/cdn/chunks/src-CRaqN-p8.js.map +1 -0
  94. package/dist/cdn/chunks/styleConstants-DP1VOca8.js +57 -0
  95. package/dist/cdn/chunks/styleConstants-DP1VOca8.js.map +1 -0
  96. package/dist/cdn/chunks/styles-BHJULjNR.js +2947 -0
  97. package/dist/cdn/chunks/styles-BHJULjNR.js.map +1 -0
  98. package/dist/cdn/chunks/tiptap-ZhwKyFp7.js +14654 -0
  99. package/dist/cdn/chunks/tiptap-ZhwKyFp7.js.map +1 -0
  100. package/dist/cdn/editor.css +2 -0
  101. package/dist/cdn/editor.js +250 -0
  102. package/dist/cdn/editor.js.map +1 -0
  103. package/dist/check-Da05j8yl.js +7 -0
  104. package/dist/chevron-down-R2uY34iD.js +7 -0
  105. package/dist/circle-alert-DZuGWPX-.js +25 -0
  106. package/dist/clock-CRp2sIub.js +12 -0
  107. package/dist/cloud-DEk_b4CR.js +1733 -0
  108. package/dist/createLucideIcon-C3pa2siy.js +43 -0
  109. package/dist/de-Brqvgr43.js +521 -0
  110. package/dist/de-DCaaCE5s.js +207 -0
  111. package/dist/dist-B1IR0bpH.js +326 -0
  112. package/dist/dist-BFawx6IS.js +519 -0
  113. package/dist/dist-BaQIYPsn.js +35 -0
  114. package/dist/dist-Cp0zXPAD.js +189 -0
  115. package/dist/dist-D6uC2xhi.js +5 -0
  116. package/dist/dist-D90y8dvT.js +2082 -0
  117. package/dist/dist-DDJIWTRY.js +776 -0
  118. package/dist/dist-DJmnUmW9.js +362 -0
  119. package/dist/dist-DjviJBCi.js +74 -0
  120. package/dist/dist-KoBJjK1G.js +61 -0
  121. package/dist/dist-aRzjfSRN.js +35 -0
  122. package/dist/dist-iLBdeBDR.js +10658 -0
  123. package/dist/dist-us-RpCWN.js +47 -0
  124. package/dist/dist-wzMIGj-D.js +5 -0
  125. package/dist/emojiData-PQyVa4bU.js +17 -0
  126. package/dist/en-DXCyK4-X.js +207 -0
  127. package/dist/en-WDVp87TE.js +521 -0
  128. package/dist/extensions-CUcl9Ok4.js +799 -0
  129. package/dist/formatRelativeTime-BOEf47hq.js +12 -0
  130. package/dist/image-up-MBZKKg9p.js +23 -0
  131. package/dist/index.d.ts +275 -0
  132. package/dist/info-CJEC7piy.js +19 -0
  133. package/dist/keys-ciNfSSGj.js +10 -0
  134. package/dist/liquid.browser-CdMv1BTn.js +3277 -0
  135. package/dist/loader-circle-DsY5Yg33.js +7 -0
  136. package/dist/message-circle-yElBbR2C.js +7 -0
  137. package/dist/readableTextColor-CY3SiRnt.js +30 -0
  138. package/dist/refresh-cw-CE_AGtn8.js +29 -0
  139. package/dist/rolldown-runtime-BZGGJVDF.js +20 -0
  140. package/dist/scan-line-D0vcUekt.js +25 -0
  141. package/dist/send-DH4oDQqC.js +10 -0
  142. package/dist/shield-check-CfJgs2Hd.js +10 -0
  143. package/dist/sparkles-CvRXGqFs.js +23 -0
  144. package/dist/style.css +2 -0
  145. package/dist/styleConstants-fWzlIIwN.js +55 -0
  146. package/dist/styles-DEXEkBvg.js +3176 -0
  147. package/dist/templatical-editor.js +249 -0
  148. package/dist/text-align-start-BT9VUDxK.js +43 -0
  149. package/dist/timeouts-BSGxjuUF.js +4 -0
  150. package/dist/trash-2-DbP2Y6t2.js +25 -0
  151. package/dist/triangle-alert-aOXceTSe.js +17 -0
  152. package/dist/useCloudI18n-BuIwR6OE.js +23 -0
  153. package/dist/useEditorCore-C6ost42Q.js +9342 -0
  154. package/dist/useI18n-lb2DHDiu.js +17 -0
  155. package/dist/useMergeTag-CBwKnnNB.js +34 -0
  156. package/dist/vue.runtime.esm-bundler-DpvJL-nX.js +5775 -0
  157. package/dist/x-u2oVmjN_.js +10 -0
  158. package/package.json +1 -1
@@ -0,0 +1,695 @@
1
+ import { Dt as e, E as t, L as n, M as r, Mt as i, Ot as a, P as o, Q as s, S as c, _ as l, b as u, d, f, g as p, h as m, it as h, l as g, m as _, p as v, q as y, u as b, y as x } from "./vue.runtime.esm-bundler-DpvJL-nX.js";
2
+ import { C as S, b as C, w } from "./useEditorCore-C6ost42Q.js";
3
+ import { t as T } from "./dist-B1IR0bpH.js";
4
+ import { D as E, O as D, T as O, h as k } from "./keys-ciNfSSGj.js";
5
+ import { t as A } from "./useI18n-lb2DHDiu.js";
6
+ import { t as j } from "./createLucideIcon-C3pa2siy.js";
7
+ import { a as ee, i as M, n as N, r as P, t as F } from "./RichTextEditorContent-DYkIauIk.js";
8
+ import { t as te } from "./loader-circle-DsY5Yg33.js";
9
+ import { t as ne } from "./scan-line-D0vcUekt.js";
10
+ import { n as re, r as ie, t as I } from "./text-align-start-BT9VUDxK.js";
11
+ import { t as L } from "./_plugin-vue_export-helper-B0hnzhyu.js";
12
+ import { a as R, o as z, s as B } from "./styleConstants-fWzlIIwN.js";
13
+ var V = j("list-ordered", [
14
+ ["path", {
15
+ d: "M11 5h10",
16
+ key: "1cz7ny"
17
+ }],
18
+ ["path", {
19
+ d: "M11 12h10",
20
+ key: "1438ji"
21
+ }],
22
+ ["path", {
23
+ d: "M11 19h10",
24
+ key: "11t30w"
25
+ }],
26
+ ["path", {
27
+ d: "M4 4h1v5",
28
+ key: "10yrso"
29
+ }],
30
+ ["path", {
31
+ d: "M4 9h2",
32
+ key: "r1h2o0"
33
+ }],
34
+ ["path", {
35
+ d: "M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02",
36
+ key: "xtkcd5"
37
+ }]
38
+ ]), H = j("list", [
39
+ ["path", {
40
+ d: "M3 5h.01",
41
+ key: "18ugdj"
42
+ }],
43
+ ["path", {
44
+ d: "M3 12h.01",
45
+ key: "nlz23k"
46
+ }],
47
+ ["path", {
48
+ d: "M3 19h.01",
49
+ key: "noohij"
50
+ }],
51
+ ["path", {
52
+ d: "M8 5h13",
53
+ key: "1pao27"
54
+ }],
55
+ ["path", {
56
+ d: "M8 12h13",
57
+ key: "1za7za"
58
+ }],
59
+ ["path", {
60
+ d: "M8 19h13",
61
+ key: "m83p4d"
62
+ }]
63
+ ]), U = j("remove-formatting", [
64
+ ["path", {
65
+ d: "M4 7V4h16v3",
66
+ key: "9msm58"
67
+ }],
68
+ ["path", {
69
+ d: "M5 20h6",
70
+ key: "1h6pxn"
71
+ }],
72
+ ["path", {
73
+ d: "M13 4 8 20",
74
+ key: "kqq6aj"
75
+ }],
76
+ ["path", {
77
+ d: "m15 15 5 5",
78
+ key: "me55sn"
79
+ }],
80
+ ["path", {
81
+ d: "m20 15-5 5",
82
+ key: "11p7ol"
83
+ }]
84
+ ]), W = j("smile", [
85
+ ["circle", {
86
+ cx: "12",
87
+ cy: "12",
88
+ r: "10",
89
+ key: "1mglay"
90
+ }],
91
+ ["path", {
92
+ d: "M8 14s1.5 2 4 2 4-2 4-2",
93
+ key: "1y1vjs"
94
+ }],
95
+ ["line", {
96
+ x1: "9",
97
+ x2: "9.01",
98
+ y1: "9",
99
+ y2: "9",
100
+ key: "yxxnd0"
101
+ }],
102
+ ["line", {
103
+ x1: "15",
104
+ x2: "15.01",
105
+ y1: "9",
106
+ y2: "9",
107
+ key: "1p4y9e"
108
+ }]
109
+ ]), G = j("strikethrough", [
110
+ ["path", {
111
+ d: "M16 4H9a3 3 0 0 0-2.83 4",
112
+ key: "43sutm"
113
+ }],
114
+ ["path", {
115
+ d: "M14 12a4 4 0 0 1 0 8H6",
116
+ key: "nlfj13"
117
+ }],
118
+ ["line", {
119
+ x1: "4",
120
+ x2: "20",
121
+ y1: "12",
122
+ y2: "12",
123
+ key: "1e0a9i"
124
+ }]
125
+ ]), K = j("subscript", [
126
+ ["path", {
127
+ d: "m4 5 8 8",
128
+ key: "1eunvl"
129
+ }],
130
+ ["path", {
131
+ d: "m12 5-8 8",
132
+ key: "1ah0jp"
133
+ }],
134
+ ["path", {
135
+ 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",
136
+ key: "e8ta8j"
137
+ }]
138
+ ]), q = j("superscript", [
139
+ ["path", {
140
+ d: "m4 19 8-8",
141
+ key: "hr47gm"
142
+ }],
143
+ ["path", {
144
+ d: "m12 19-8-8",
145
+ key: "1dhhmo"
146
+ }],
147
+ ["path", {
148
+ 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",
149
+ key: "1dfcux"
150
+ }]
151
+ ]), J = j("underline", [["path", {
152
+ d: "M6 4v6a6 6 0 0 0 12 0V4",
153
+ key: "9kb039"
154
+ }], ["line", {
155
+ x1: "4",
156
+ x2: "20",
157
+ y1: "20",
158
+ y2: "20",
159
+ key: "nun2al"
160
+ }]]), Y = [
161
+ "aria-label",
162
+ "title",
163
+ "aria-expanded"
164
+ ], ae = ["aria-label"], oe = { class: "tpl:mb-1.5 tpl:text-[10px] tpl:font-medium tpl:tracking-wide tpl:text-[var(--tpl-text-muted)] tpl:uppercase" }, se = { class: "tpl:grid tpl:grid-cols-10 tpl:gap-0.5" }, ce = ["aria-label", "onClick"], le = /* @__PURE__ */ c({
165
+ __name: "EmojiPickerDropdown",
166
+ emits: ["insert"],
167
+ setup(t, { emit: n }) {
168
+ let a = n, { categories: c, isOpen: f, toggle: m, close: y } = S(), { t: x, format: C } = A(), E = s(null), D = s(null);
169
+ w(E, v(() => f.value)), T(D, () => {
170
+ f.value && y();
171
+ });
172
+ function O(e) {
173
+ a("insert", e), y();
174
+ }
175
+ return (t, n) => (r(), l("div", {
176
+ ref_key: "rootRef",
177
+ ref: D,
178
+ class: "tpl:relative"
179
+ }, [_("button", {
180
+ type: "button",
181
+ class: e(["tpl-text-toolbar-btn", { "tpl-text-toolbar-btn--active": h(f) }]),
182
+ "aria-label": h(x).paragraphEditor.insertEmoji,
183
+ title: h(x).paragraphEditor.insertEmoji,
184
+ "aria-expanded": h(f),
185
+ "aria-haspopup": "dialog",
186
+ "aria-controls": "tpl-emoji-picker",
187
+ onClick: n[0] ||= (...e) => h(m) && h(m)(...e)
188
+ }, [u(h(W), {
189
+ size: 16,
190
+ "stroke-width": 2
191
+ })], 10, Y), h(f) ? (r(), l("div", {
192
+ key: 0,
193
+ id: "tpl-emoji-picker",
194
+ ref_key: "pickerRef",
195
+ ref: E,
196
+ role: "dialog",
197
+ "aria-modal": "false",
198
+ "aria-label": h(x).paragraphEditor.insertEmoji,
199
+ tabindex: "-1",
200
+ 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",
201
+ onKeydown: n[1] ||= g(b((...e) => h(y) && h(y)(...e), ["stop", "prevent"]), ["esc"])
202
+ }, [(r(!0), l(d, null, o(h(c), (e) => (r(), l("div", {
203
+ key: e.key,
204
+ class: "tpl:mb-2 tpl:last:mb-0"
205
+ }, [_("div", oe, i(h(x).emoji[e.key]), 1), _("div", se, [(r(!0), l(d, null, o(e.emojis, (e) => (r(), l("button", {
206
+ key: e,
207
+ type: "button",
208
+ "aria-label": h(C)(h(x).paragraphEditor.emojiItemLabel, { emoji: e }),
209
+ 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)]",
210
+ onClick: (t) => O(e)
211
+ }, i(e), 9, ce))), 128))])]))), 128))], 40, ae)) : p("", !0)], 512));
212
+ }
213
+ }), ue = [
214
+ "aria-label",
215
+ "title",
216
+ "aria-pressed"
217
+ ], X = /* @__PURE__ */ c({
218
+ __name: "ToolbarIconButton",
219
+ props: {
220
+ icon: {},
221
+ label: {},
222
+ active: { type: Boolean },
223
+ strokeWidth: {},
224
+ size: {}
225
+ },
226
+ setup(t) {
227
+ return (i, a) => (r(), l("button", {
228
+ type: "button",
229
+ class: e(["tpl-text-toolbar-btn", { "tpl-text-toolbar-btn--active": t.active }]),
230
+ "aria-label": t.label,
231
+ title: t.label,
232
+ "aria-pressed": t.active ? "true" : "false"
233
+ }, [(r(), m(n(t.icon), {
234
+ size: t.size ?? 16,
235
+ "stroke-width": t.strokeWidth ?? 2
236
+ }, null, 8, ["size", "stroke-width"]))], 10, ue));
237
+ }
238
+ }), de = {}, fe = {
239
+ class: "tpl:mx-1 tpl:h-6 tpl:w-px tpl:bg-[var(--tpl-border)]",
240
+ "aria-hidden": "true"
241
+ };
242
+ function pe(e, t) {
243
+ return r(), l("span", fe);
244
+ }
245
+ var Z = /* @__PURE__ */ L(de, [["render", pe]]), me = [
246
+ "value",
247
+ "aria-label",
248
+ "title"
249
+ ], he = { value: "" }, ge = ["value"], Q = /* @__PURE__ */ c({
250
+ __name: "ToolbarSelect",
251
+ props: {
252
+ modelValue: {},
253
+ options: {},
254
+ label: {},
255
+ placeholder: {},
256
+ widthClass: {}
257
+ },
258
+ emits: ["update:modelValue"],
259
+ setup(t, { emit: n }) {
260
+ let a = n;
261
+ function s(e) {
262
+ a("update:modelValue", e.target.value);
263
+ }
264
+ function c(e) {
265
+ return typeof e == "string" ? e : e.value;
266
+ }
267
+ function u(e) {
268
+ return typeof e == "string" ? e : e.label;
269
+ }
270
+ return (n, a) => (r(), l("select", {
271
+ class: e(["tpl:h-8 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", t.widthClass ?? "tpl:w-20"]),
272
+ value: t.modelValue,
273
+ "aria-label": t.label,
274
+ title: t.label,
275
+ onChange: s
276
+ }, [_("option", he, i(t.placeholder ?? ""), 1), (r(!0), l(d, null, o(t.options, (e) => (r(), l("option", {
277
+ key: c(e),
278
+ value: c(e)
279
+ }, i(u(e)), 9, ge))), 128))], 42, me));
280
+ }
281
+ }), _e = ["data-tpl-theme", "aria-label"], ve = { class: "tpl:flex tpl:items-center tpl:gap-1" }, ye = { class: "tpl:relative" }, be = [
282
+ "value",
283
+ "aria-label",
284
+ "title"
285
+ ], $ = { class: "tpl:relative" }, xe = [
286
+ "value",
287
+ "aria-label",
288
+ "title"
289
+ ], Se = { class: "tpl:flex tpl:items-center tpl:gap-1" }, Ce = ["aria-label", "title"], we = {
290
+ key: 1,
291
+ class: "tpl:flex tpl:items-center tpl:gap-2 tpl:px-2 tpl:text-xs tpl:text-[var(--tpl-text-dim)]"
292
+ }, Te = /* @__PURE__ */ c({
293
+ __name: "ParagraphToolbar",
294
+ props: {
295
+ editor: {},
296
+ toolbarPosition: {},
297
+ isLoading: { type: Boolean },
298
+ canRequestMergeTag: { type: Boolean }
299
+ },
300
+ emits: ["open-link-dialog", "add-merge-tag"],
301
+ setup(e, { emit: n }) {
302
+ let o = e, s = n, c = t(O, null), g = t(E, null), v = D(k, "ParagraphToolbar"), { t: y } = A(), b = v.fonts;
303
+ function S(e) {
304
+ o.editor?.chain().focus().insertContent(e).run();
305
+ }
306
+ function C(e) {
307
+ return o.editor?.getAttributes("textStyle")[e] || "";
308
+ }
309
+ function w(e) {
310
+ let t = o.editor?.chain().focus();
311
+ e ? t?.setFontFamily(e).run() : t?.unsetFontFamily().run();
312
+ }
313
+ function T(e) {
314
+ let t = o.editor?.chain().focus();
315
+ e ? t?.setFontSize(e).run() : t?.unsetFontSize().run();
316
+ }
317
+ function j(e) {
318
+ let t = o.editor?.chain().focus();
319
+ e ? t?.setColor(e).run() : t?.unsetColor().run();
320
+ }
321
+ function N() {
322
+ return o.editor?.getAttributes("paragraph").lineHeight || "";
323
+ }
324
+ function F(e) {
325
+ let t = o.editor?.chain().focus();
326
+ e ? t?.setLineHeight(e).run() : t?.unsetLineHeight().run();
327
+ }
328
+ function L(e) {
329
+ let t = o.editor?.chain().focus();
330
+ e && e !== "normal" ? t?.setLetterSpacing(e).run() : t?.unsetLetterSpacing().run();
331
+ }
332
+ function W() {
333
+ return o.editor?.getAttributes("highlight").color || "";
334
+ }
335
+ function Y(e) {
336
+ let t = o.editor?.chain().focus();
337
+ e ? t?.setHighlight({ color: e }).run() : t?.unsetHighlight().run();
338
+ }
339
+ return (t, n) => (r(), m(f, { to: "body" }, [_("div", {
340
+ "data-tpl-theme": h(g),
341
+ role: "toolbar",
342
+ "aria-label": h(y).paragraphEditor.toolbar,
343
+ 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",
344
+ style: a({
345
+ ...h(c),
346
+ top: `${e.toolbarPosition.top}px`,
347
+ left: `${e.toolbarPosition.left}px`,
348
+ transform: "translateY(-100%)",
349
+ flexDirection: "column"
350
+ })
351
+ }, [!e.isLoading && e.editor ? (r(), l(d, { key: 0 }, [_("div", ve, [
352
+ u(Q, {
353
+ "model-value": C("fontFamily"),
354
+ options: h(b),
355
+ label: h(y).paragraphEditor.fontFamily,
356
+ placeholder: h(y).paragraphEditor.defaultFont,
357
+ "width-class": "tpl:w-32",
358
+ "onUpdate:modelValue": w
359
+ }, null, 8, [
360
+ "model-value",
361
+ "options",
362
+ "label",
363
+ "placeholder"
364
+ ]),
365
+ u(Q, {
366
+ "model-value": C("fontSize"),
367
+ options: h(R),
368
+ label: h(y).paragraphEditor.fontSize,
369
+ placeholder: h(y).paragraphEditor.defaultSize,
370
+ "width-class": "tpl:w-20",
371
+ "onUpdate:modelValue": T
372
+ }, null, 8, [
373
+ "model-value",
374
+ "options",
375
+ "label",
376
+ "placeholder"
377
+ ]),
378
+ u(Z),
379
+ _("div", ye, [_("input", {
380
+ type: "color",
381
+ class: "tpl:size-8 tpl:cursor-pointer tpl:rounded tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:p-1",
382
+ value: C("color") || h("#000000"),
383
+ "aria-label": h(y).paragraphEditor.textColor,
384
+ title: h(y).paragraphEditor.textColor,
385
+ onInput: n[0] ||= (e) => j(e.target.value)
386
+ }, null, 40, be)]),
387
+ _("div", $, [_("input", {
388
+ type: "color",
389
+ class: "tpl:size-8 tpl:cursor-pointer tpl:rounded tpl:border tpl:border-[var(--tpl-border)] tpl:p-1",
390
+ style: a({ backgroundColor: W() || "var(--tpl-bg)" }),
391
+ value: W() || h("#ffff00"),
392
+ "aria-label": h(y).paragraphEditor.highlightColor,
393
+ title: h(y).paragraphEditor.highlightColor,
394
+ onInput: n[1] ||= (e) => Y(e.target.value)
395
+ }, null, 44, xe)]),
396
+ u(Z),
397
+ u(X, {
398
+ icon: h(ee),
399
+ label: h(y).paragraphEditor.bold,
400
+ active: e.editor.isActive("bold"),
401
+ "stroke-width": 2.5,
402
+ onClick: n[2] ||= (t) => e.editor.chain().focus().toggleBold().run()
403
+ }, null, 8, [
404
+ "icon",
405
+ "label",
406
+ "active"
407
+ ]),
408
+ u(X, {
409
+ icon: h(M),
410
+ label: h(y).paragraphEditor.italic,
411
+ active: e.editor.isActive("italic"),
412
+ onClick: n[3] ||= (t) => e.editor.chain().focus().toggleItalic().run()
413
+ }, null, 8, [
414
+ "icon",
415
+ "label",
416
+ "active"
417
+ ]),
418
+ u(X, {
419
+ icon: h(J),
420
+ label: h(y).paragraphEditor.underline,
421
+ active: e.editor.isActive("underline"),
422
+ onClick: n[4] ||= (t) => e.editor.chain().focus().toggleUnderline().run()
423
+ }, null, 8, [
424
+ "icon",
425
+ "label",
426
+ "active"
427
+ ]),
428
+ u(X, {
429
+ icon: h(G),
430
+ label: h(y).paragraphEditor.strikethrough,
431
+ active: e.editor.isActive("strike"),
432
+ onClick: n[5] ||= (t) => e.editor.chain().focus().toggleStrike().run()
433
+ }, null, 8, [
434
+ "icon",
435
+ "label",
436
+ "active"
437
+ ]),
438
+ u(Z),
439
+ u(X, {
440
+ icon: h(K),
441
+ label: h(y).paragraphEditor.subscript,
442
+ active: e.editor.isActive("subscript"),
443
+ onClick: n[6] ||= (t) => e.editor.chain().focus().toggleSubscript().run()
444
+ }, null, 8, [
445
+ "icon",
446
+ "label",
447
+ "active"
448
+ ]),
449
+ u(X, {
450
+ icon: h(q),
451
+ label: h(y).paragraphEditor.superscript,
452
+ active: e.editor.isActive("superscript"),
453
+ onClick: n[7] ||= (t) => e.editor.chain().focus().toggleSuperscript().run()
454
+ }, null, 8, [
455
+ "icon",
456
+ "label",
457
+ "active"
458
+ ]),
459
+ u(Z),
460
+ u(X, {
461
+ icon: h(P),
462
+ label: h(y).paragraphEditor.addLink,
463
+ active: e.editor.isActive("link"),
464
+ onClick: n[8] ||= (e) => s("open-link-dialog")
465
+ }, null, 8, [
466
+ "icon",
467
+ "label",
468
+ "active"
469
+ ])
470
+ ]), _("div", Se, [
471
+ u(X, {
472
+ icon: h(H),
473
+ label: h(y).paragraphEditor.bulletList,
474
+ active: e.editor.isActive("bulletList"),
475
+ onClick: n[9] ||= (t) => e.editor.chain().focus().toggleBulletList().run()
476
+ }, null, 8, [
477
+ "icon",
478
+ "label",
479
+ "active"
480
+ ]),
481
+ u(X, {
482
+ icon: h(V),
483
+ label: h(y).paragraphEditor.numberedList,
484
+ active: e.editor.isActive("orderedList"),
485
+ onClick: n[10] ||= (t) => e.editor.chain().focus().toggleOrderedList().run()
486
+ }, null, 8, [
487
+ "icon",
488
+ "label",
489
+ "active"
490
+ ]),
491
+ u(Z),
492
+ u(X, {
493
+ icon: h(I),
494
+ label: h(y).paragraphEditor.alignLeft,
495
+ active: e.editor.isActive({ textAlign: "left" }),
496
+ onClick: n[11] ||= (t) => e.editor.chain().focus().setTextAlign("left").run()
497
+ }, null, 8, [
498
+ "icon",
499
+ "label",
500
+ "active"
501
+ ]),
502
+ u(X, {
503
+ icon: h(ie),
504
+ label: h(y).paragraphEditor.alignCenter,
505
+ active: e.editor.isActive({ textAlign: "center" }),
506
+ onClick: n[12] ||= (t) => e.editor.chain().focus().setTextAlign("center").run()
507
+ }, null, 8, [
508
+ "icon",
509
+ "label",
510
+ "active"
511
+ ]),
512
+ u(X, {
513
+ icon: h(re),
514
+ label: h(y).paragraphEditor.alignRight,
515
+ active: e.editor.isActive({ textAlign: "right" }),
516
+ onClick: n[13] ||= (t) => e.editor.chain().focus().setTextAlign("right").run()
517
+ }, null, 8, [
518
+ "icon",
519
+ "label",
520
+ "active"
521
+ ]),
522
+ u(Z),
523
+ u(Q, {
524
+ "model-value": N(),
525
+ options: h(B),
526
+ label: h(y).paragraphEditor.lineHeight,
527
+ placeholder: "LH",
528
+ "width-class": "tpl:w-16",
529
+ "onUpdate:modelValue": F
530
+ }, null, 8, [
531
+ "model-value",
532
+ "options",
533
+ "label"
534
+ ]),
535
+ u(Q, {
536
+ "model-value": C("letterSpacing"),
537
+ options: h(z),
538
+ label: h(y).paragraphEditor.letterSpacing,
539
+ placeholder: "LS",
540
+ "width-class": "tpl:w-20",
541
+ "onUpdate:modelValue": L
542
+ }, null, 8, [
543
+ "model-value",
544
+ "options",
545
+ "label"
546
+ ]),
547
+ u(Z),
548
+ u(X, {
549
+ icon: h(U),
550
+ label: h(y).paragraphEditor.clearFormatting,
551
+ onClick: n[14] ||= (t) => e.editor.chain().focus().clearNodes().unsetAllMarks().run()
552
+ }, null, 8, ["icon", "label"]),
553
+ u(Z),
554
+ u(le, { onInsert: S }),
555
+ e.canRequestMergeTag ? (r(), l(d, { key: 0 }, [u(Z), _("button", {
556
+ type: "button",
557
+ 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)]",
558
+ "aria-label": h(y).mergeTag.add,
559
+ title: h(y).mergeTag.add,
560
+ onClick: n[15] ||= (e) => s("add-merge-tag")
561
+ }, [u(h(ne), {
562
+ size: 16,
563
+ "stroke-width": 2
564
+ }), x(" " + i(h(y).mergeTag.add), 1)], 8, Ce)], 64)) : p("", !0)
565
+ ])], 64)) : (r(), l("div", we, [u(h(te), {
566
+ class: "tpl-spinner",
567
+ size: 14,
568
+ "stroke-width": 2
569
+ }), x(" " + i(h(y).errors.editorLoading), 1)]))], 12, _e)]));
570
+ }
571
+ }), Ee = { class: "tpl-text-editor-wrapper tpl:relative" }, De = /* @__PURE__ */ c({
572
+ __name: "ParagraphEditor",
573
+ props: {
574
+ block: {},
575
+ toolbarPosition: {}
576
+ },
577
+ emits: ["done"],
578
+ setup(e, { emit: t }) {
579
+ let n = e, i = t, { editor: a, EditorContent: o, isLoading: s, initError: c, retry: d, showLinkDialog: f, linkUrl: p, linkDialogRef: m, canRequestMergeTag: g, openLinkDialog: _, insertLink: v, removeLink: b, closeLinkDialog: x, handleLinkKeydown: S, handleAddMergeTag: w } = C({
580
+ blockId: () => n.block.id,
581
+ blockContent: () => n.block.content,
582
+ onDone: () => i("done"),
583
+ editorName: "ParagraphEditor",
584
+ async loadExtensions({ mergeTags: e, syntax: t, triggerChar: n, autocompleteEnabled: r, suggestionEmptyText: i }) {
585
+ let [{ Editor: a, EditorContent: o }, { default: s }, { default: c }, { default: l }, { default: u }, { default: d }, { default: f }, { TextStyle: p }, { default: m }, { default: h }, { default: g }, { MergeTagNode: _, MergeTagSuggestion: v, LogicMergeTagNode: y, FontSize: b, LineHeight: x, LetterSpacing: S }] = await Promise.all([
586
+ import("./dist-BFawx6IS.js").then((e) => e.r),
587
+ import("./dist-D90y8dvT.js"),
588
+ import("./dist-DDJIWTRY.js"),
589
+ import("./dist-KoBJjK1G.js"),
590
+ import("./dist-BaQIYPsn.js"),
591
+ import("./dist-aRzjfSRN.js"),
592
+ import("./dist-us-RpCWN.js"),
593
+ import("./dist-Cp0zXPAD.js"),
594
+ import("./dist-D6uC2xhi.js"),
595
+ import("./dist-wzMIGj-D.js"),
596
+ import("./dist-DjviJBCi.js"),
597
+ import("./extensions-CUcl9Ok4.js")
598
+ ]);
599
+ return {
600
+ TiptapEditor: a,
601
+ EC: o,
602
+ extensions: [
603
+ s.configure({
604
+ heading: !1,
605
+ codeBlock: !1,
606
+ blockquote: !1,
607
+ horizontalRule: !1
608
+ }),
609
+ l,
610
+ u,
611
+ d,
612
+ c.configure({
613
+ openOnClick: !1,
614
+ HTMLAttributes: {
615
+ target: "_blank",
616
+ rel: "noopener noreferrer"
617
+ }
618
+ }),
619
+ f.configure({ types: ["paragraph"] }),
620
+ p,
621
+ m,
622
+ h,
623
+ g.configure({ multicolor: !0 }),
624
+ b,
625
+ x,
626
+ S,
627
+ _.configure({
628
+ mergeTags: e,
629
+ syntax: t
630
+ }),
631
+ y.configure({ syntax: t }),
632
+ ...r && n && e.length > 0 ? [v.configure({
633
+ mergeTags: e,
634
+ char: n,
635
+ emptyText: i
636
+ })] : []
637
+ ]
638
+ };
639
+ }
640
+ });
641
+ return (t, n) => (r(), l("div", Ee, [
642
+ u(Te, {
643
+ editor: h(a),
644
+ "toolbar-position": e.toolbarPosition,
645
+ "is-loading": h(s),
646
+ "can-request-merge-tag": h(g),
647
+ onOpenLinkDialog: h(_),
648
+ onAddMergeTag: h(w)
649
+ }, null, 8, [
650
+ "editor",
651
+ "toolbar-position",
652
+ "is-loading",
653
+ "can-request-merge-tag",
654
+ "onOpenLinkDialog",
655
+ "onAddMergeTag"
656
+ ]),
657
+ u(F, {
658
+ editor: h(a),
659
+ "editor-content": h(o),
660
+ "is-loading": h(s),
661
+ "init-error": h(c),
662
+ onRetry: h(d)
663
+ }, null, 8, [
664
+ "editor",
665
+ "editor-content",
666
+ "is-loading",
667
+ "init-error",
668
+ "onRetry"
669
+ ]),
670
+ u(N, {
671
+ visible: h(f),
672
+ "is-editing-link": h(a)?.isActive("link") ?? !1,
673
+ "dialog-ref": h(m),
674
+ "onUpdate:dialogRef": n[0] ||= (e) => y(m) ? m.value = e : null,
675
+ "link-url": h(p),
676
+ "onUpdate:linkUrl": n[1] ||= (e) => y(p) ? p.value = e : null,
677
+ onClose: h(x),
678
+ onInsert: h(v),
679
+ onRemove: h(b),
680
+ onKeydown: h(S)
681
+ }, null, 8, [
682
+ "visible",
683
+ "is-editing-link",
684
+ "dialog-ref",
685
+ "link-url",
686
+ "onClose",
687
+ "onInsert",
688
+ "onRemove",
689
+ "onKeydown"
690
+ ])
691
+ ]));
692
+ }
693
+ });
694
+ //#endregion
695
+ export { De as default };