@templatical/editor 0.0.3 → 0.0.4

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 (141) hide show
  1. package/dist/{AiChatSidebar-busJk9hm.js → AiChatSidebar-CjfhTZwo.js} +1 -1
  2. package/dist/{AiFeatureMenu-DLGv_-pj.js → AiFeatureMenu-K44aZa_P.js} +3 -3
  3. package/dist/CloudEditor-DFyuRxUV.js +926 -0
  4. package/dist/{CollaboratorBar-Dv3l52vC.js → CollaboratorBar-BuCEcdbB.js} +25 -21
  5. package/dist/{CommentsSidebar-4tjp0VU5.js → CommentsSidebar-2lcqMfIP.js} +2 -2
  6. package/dist/{DesignReferenceSidebar-CmwXvltV.js → DesignReferenceSidebar-CNMu4Zrx.js} +2 -2
  7. package/dist/{ModuleBrowserModal-lrk3Fr0H.js → ModuleBrowserModal-CvQ0xyQf.js} +6 -6
  8. package/dist/{ModulePreviewCanvas-BcBJLnwL.js → ModulePreviewCanvas-Be2B3Y07.js} +2 -2
  9. package/dist/ParagraphEditor-CcMPnbDr.js +652 -0
  10. package/dist/{RichTextEditorContent-CQqodi7p.js → RichTextEditorContent-CHJlh7HJ.js} +8 -4
  11. package/dist/{SaveModuleDialog-Bmzi72td.js → SaveModuleDialog-BaaeH5Xm.js} +5 -5
  12. package/dist/{SnapshotHistory-AEgi9Xsn.js → SnapshotHistory-BPfjiuu1.js} +2 -2
  13. package/dist/{TemplateScoringPanel-CTgMtc0-.js → TemplateScoringPanel-D58A23Vq.js} +3 -3
  14. package/dist/{TestEmailModal-Dpq1is9S.js → TestEmailModal-DIAlB3e_.js} +3 -3
  15. package/dist/{TitleEditor-CLcDdcWI.js → TitleEditor-D9DPjQkX.js} +7 -7
  16. package/dist/{TplModal-CGzRjR96.js → TplModal-CmTSvCY-.js} +2 -2
  17. package/dist/{blockTypeIcons-BpPTqcok.js → blockTypeIcons-D1RTWOkx.js} +1 -1
  18. package/dist/cdn/chunks/AiChatSidebar-CmPTbTFG.js +2 -0
  19. package/dist/cdn/chunks/AiFeatureMenu-lxVm1RjH.js +59 -0
  20. package/dist/cdn/chunks/AiFeatureMenu-lxVm1RjH.js.map +1 -0
  21. package/dist/cdn/chunks/CloudEditor-Bmp5IlWi.js +900 -0
  22. package/dist/cdn/chunks/CloudEditor-Bmp5IlWi.js.map +1 -0
  23. package/dist/cdn/chunks/CollaboratorBar-D2PKtlOw.js +51 -0
  24. package/dist/cdn/chunks/CollaboratorBar-D2PKtlOw.js.map +1 -0
  25. package/dist/cdn/chunks/CommentsSidebar-BOelj4Ca.js +2 -0
  26. package/dist/cdn/chunks/DesignReferenceSidebar-Bf6rg0A7.js +2 -0
  27. package/dist/cdn/chunks/ModuleBrowserModal-CxDXzkKS.js +195 -0
  28. package/dist/cdn/chunks/ModuleBrowserModal-CxDXzkKS.js.map +1 -0
  29. package/dist/cdn/chunks/ModulePreviewCanvas-DEfHampA.js +107 -0
  30. package/dist/cdn/chunks/ModulePreviewCanvas-DEfHampA.js.map +1 -0
  31. package/dist/cdn/chunks/ParagraphEditor-DHdu6lb3.js +503 -0
  32. package/dist/cdn/chunks/ParagraphEditor-DHdu6lb3.js.map +1 -0
  33. package/dist/cdn/chunks/RichTextEditorContent-DWUzizsC.js +106 -0
  34. package/dist/cdn/chunks/RichTextEditorContent-DWUzizsC.js.map +1 -0
  35. package/dist/cdn/chunks/SaveModuleDialog-DVna2xUl.js +119 -0
  36. package/dist/cdn/chunks/SaveModuleDialog-DVna2xUl.js.map +1 -0
  37. package/dist/cdn/chunks/SnapshotHistory-BFF2SsTN.js +2 -0
  38. package/dist/cdn/chunks/TemplateScoringPanel-gi8wc_m7.js +2 -0
  39. package/dist/cdn/chunks/TestEmailModal-Qtd6aC-6.js +2 -0
  40. package/dist/cdn/chunks/TitleEditor-DDf_OcHS.js +166 -0
  41. package/dist/cdn/chunks/TitleEditor-DDf_OcHS.js.map +1 -0
  42. package/dist/cdn/chunks/_rolldown_dynamic_import_helper-DMEI4TQ3.js +9 -0
  43. package/dist/cdn/chunks/blockTypeIcons-BnobReQm.js +22 -0
  44. package/dist/cdn/chunks/blockTypeIcons-BnobReQm.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-B6AUkMyh.js +2 -0
  50. package/dist/cdn/chunks/dist-B878xb_62.js +457 -0
  51. package/dist/cdn/chunks/dist-B878xb_62.js.map +1 -0
  52. package/dist/cdn/chunks/dist-Bf1Op9A1.js +2 -0
  53. package/dist/cdn/chunks/dist-BkETaOfw.js +2 -0
  54. package/dist/cdn/chunks/dist-CJcMnY7o.js +2 -0
  55. package/dist/cdn/chunks/dist-CWsl6S1K.js +2 -0
  56. package/dist/cdn/chunks/dist-CllLxIMQ.js +2 -0
  57. package/dist/cdn/chunks/dist-Cs0wFwdw.js +2 -0
  58. package/dist/cdn/chunks/dist-DLWHlekl.js +2 -0
  59. package/dist/cdn/chunks/dist-DS3_HVpX.js +2 -0
  60. package/dist/cdn/chunks/dist-DTXopj1a.js +2 -0
  61. package/dist/cdn/chunks/dist-DnwLoNLm.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-B_kcV0tK.js +419 -0
  71. package/dist/cdn/chunks/{extensions-ea_ewKUl.js.map → extensions-B_kcV0tK.js.map} +1 -1
  72. package/dist/cdn/chunks/features-ofOGnSC0.js +6700 -0
  73. package/dist/cdn/chunks/features-ofOGnSC0.js.map +1 -0
  74. package/dist/cdn/chunks/icons-bIb7PBOE.js +653 -0
  75. package/dist/cdn/chunks/icons-bIb7PBOE.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-BIYzV2Y2.js +6005 -0
  79. package/dist/cdn/chunks/media-library-BIYzV2Y2.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-BuW9oYtm.js +494 -0
  86. package/dist/cdn/chunks/src-BuW9oYtm.js.map +1 -0
  87. package/dist/cdn/chunks/styleConstants-1KwsBMxJ.js +57 -0
  88. package/dist/cdn/chunks/{styleConstants-CNejCb-L.js.map → styleConstants-1KwsBMxJ.js.map} +1 -1
  89. package/dist/cdn/chunks/styles-DQFExz-T.js +3222 -0
  90. package/dist/cdn/chunks/styles-DQFExz-T.js.map +1 -0
  91. package/dist/cdn/chunks/tiptap-DplY-S-k.js +14208 -0
  92. package/dist/cdn/chunks/{tiptap-Cya4P9CN.js.map → tiptap-DplY-S-k.js.map} +1 -1
  93. package/dist/cdn/editor.css +2 -1
  94. package/dist/cdn/editor.js +260 -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-BkIys9zn.js} +1 -1
  98. package/dist/{en-YXsspZJG.js → en-DvtiEMwP.js} +20 -4
  99. package/dist/{extensions-CKM99njP.js → extensions-DEjfEFhD.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/{styles-DSw1VNU3.js → styles-CgLaxDfu.js} +1096 -1074
  103. package/dist/templatical-editor.css +1 -1
  104. package/dist/templatical-editor.js +113 -89
  105. package/dist/templatical-editor.umd.cjs +59 -59
  106. package/dist/{useEditorCore-Cc4RCwWq.js → useEditorCore-CjwRMl7K.js} +1152 -1014
  107. package/dist/{useI18n-DUirdXEX.js → useI18n-D6m7ZUgY.js} +1 -1
  108. package/dist/{useMergeTag-DVnlvPYJ.js → useMergeTag-BZ3X0bNr.js} +1 -1
  109. package/package.json +2 -2
  110. package/dist/CloudEditor-BDnHd6Um.js +0 -919
  111. package/dist/ParagraphEditor-DH8cSC6m.js +0 -625
  112. package/dist/cdn/chunks/ParagraphEditor-CCtWbGDv.js +0 -3
  113. package/dist/cdn/chunks/ParagraphEditor-CCtWbGDv.js.map +0 -1
  114. package/dist/cdn/chunks/RichTextEditorContent-BUD9veXd.js +0 -2
  115. package/dist/cdn/chunks/RichTextEditorContent-BUD9veXd.js.map +0 -1
  116. package/dist/cdn/chunks/TitleEditor-e_UTyxjd.js +0 -3
  117. package/dist/cdn/chunks/TitleEditor-e_UTyxjd.js.map +0 -1
  118. package/dist/cdn/chunks/dist-0UheN8rK.js +0 -1
  119. package/dist/cdn/chunks/dist-55mmbGQ9.js +0 -1
  120. package/dist/cdn/chunks/dist-B31mxKyP.js +0 -1
  121. package/dist/cdn/chunks/dist-B5JI9nIg.js +0 -1
  122. package/dist/cdn/chunks/dist-B93vLKhU.js +0 -1
  123. package/dist/cdn/chunks/dist-BDt3FJvj.js +0 -1
  124. package/dist/cdn/chunks/dist-BJRuFHmi.js +0 -1
  125. package/dist/cdn/chunks/dist-BKSzrf0L.js +0 -1
  126. package/dist/cdn/chunks/dist-BL8c5gYQ.js +0 -1
  127. package/dist/cdn/chunks/dist-CYThWMP5.js +0 -1
  128. package/dist/cdn/chunks/dist-DxZbPJYt.js +0 -1
  129. package/dist/cdn/chunks/draggable-ClUwYCFL.js +0 -17
  130. package/dist/cdn/chunks/emojiData-6fVLNqeH.js +0 -2
  131. package/dist/cdn/chunks/extensions-ea_ewKUl.js +0 -2
  132. package/dist/cdn/chunks/icons-vmLJTaJk.js +0 -2
  133. package/dist/cdn/chunks/icons-vmLJTaJk.js.map +0 -1
  134. package/dist/cdn/chunks/rolldown-runtime-BakkzWXw.js +0 -1
  135. package/dist/cdn/chunks/styleConstants-CNejCb-L.js +0 -2
  136. package/dist/cdn/chunks/tiptap-Cya4P9CN.js +0 -145
  137. package/dist/cdn/chunks/useEditorCore-CwuxQuvh.js +0 -2
  138. package/dist/cdn/chunks/useEditorCore-CwuxQuvh.js.map +0 -1
  139. package/dist/cdn/chunks/useMergeTag-DVOz1v9p.js +0 -2
  140. package/dist/cdn/chunks/useMergeTag-DVOz1v9p.js.map +0 -1
  141. package/dist/i18n-CJsFtdbZ.js +0 -23
@@ -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 };
@@ -1,3 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["chunks/dist-BKSzrf0L.js","chunks/tiptap-Cya4P9CN.js","chunks/icons-vmLJTaJk.js","chunks/draggable-ClUwYCFL.js","chunks/rolldown-runtime-BakkzWXw.js","chunks/dist-B5JI9nIg.js","chunks/dist-0UheN8rK.js","chunks/dist-55mmbGQ9.js","chunks/dist-BL8c5gYQ.js","chunks/dist-DxZbPJYt.js","chunks/dist-B93vLKhU.js","chunks/dist-BDt3FJvj.js","chunks/dist-BJRuFHmi.js","chunks/dist-B31mxKyP.js","chunks/dist-CYThWMP5.js","chunks/extensions-ea_ewKUl.js","chunks/useMergeTag-DVOz1v9p.js"])))=>i.map(i=>d[i]);
2
- import{E as e,F as t,G as n,K as r,W as i,c as a,d as o,f as s,g as c,h as l,m as u,p as d,q as f,s as p,u as m,w as h,y as g}from"./draggable-ClUwYCFL.js";import{_,a as v,c as y,d as b,f as x,g as S,h as C,i as ee,l as w,m as T,n as te,o as ne,p as re,r as E,s as D,u as O}from"./icons-vmLJTaJk.js";import{c as k,d as A,i as j,n as M,u as N}from"./useMergeTag-DVOz1v9p.js";import{n as P,r as F,t as I}from"./useEditorCore-CwuxQuvh.js";import{a as ie,i as ae,r as L}from"./styleConstants-CNejCb-L.js";import{n as R,t as z}from"./RichTextEditorContent-BUD9veXd.js";var B={class:`tpl:relative`},V=[`aria-label`,`title`],H={key:0,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`},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=c({__name:`EmojiPickerDropdown`,emits:[`insert`],setup(t,{emit:r}){let a=r,{categories:o,isOpen:c,toggle:u}=P(),{t:g}=M();return(t,r)=>(h(),d(`div`,B,[m(`button`,{type:`button`,class:n([`tpl-text-toolbar-btn`,{"tpl-text-toolbar-btn--active":i(c)}]),"aria-label":i(g).paragraphEditor.insertEmoji,title:i(g).paragraphEditor.insertEmoji,onClick:r[0]||=(...e)=>i(u)&&i(u)(...e)},[l(i(w),{size:16,"stroke-width":2})],10,V),i(c)?(h(),d(`div`,H,[(h(!0),d(p,null,e(i(o),t=>(h(),d(`div`,{key:t.key,class:`tpl:mb-2 tpl:last:mb-0`},[m(`div`,U,f(i(g).emoji[t.key]),1),m(`div`,W,[(h(!0),d(p,null,e(t.emojis,e=>(h(),d(`button`,{key:e,type:`button`,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)]`,onClick:t=>a(`insert`,e)},f(e),9,G))),128))])]))),128))])):s(``,!0)]))}}),q=[`data-tpl-theme`,`aria-label`],J={class:`tpl:flex tpl:items-center tpl:gap-1`},oe=[`value`,`aria-label`,`title`],se={value:``},ce=[`value`],le=[`value`,`aria-label`,`title`],ue={value:``},Y=[`value`],de={class:`tpl:relative`},fe=[`value`,`aria-label`,`title`],pe={class:`tpl:relative`},me=[`value`,`aria-label`,`title`],he=[`aria-label`,`title`],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={class:`tpl:flex tpl:items-center tpl:gap-1`},Ce=[`aria-label`,`title`],we=[`aria-label`,`title`],Te=[`aria-label`,`title`],Ee=[`aria-label`,`title`],De=[`aria-label`,`title`],Oe=[`value`,`title`],ke=[`value`],Ae=[`value`,`title`],je=[`value`],Me=[`aria-label`,`title`],Ne={key:0,class:`tpl:mx-1.5 tpl:h-6 tpl:w-px tpl:bg-[var(--tpl-border)]`},Pe=[`aria-label`,`title`],Fe={key:1,class:`tpl:flex tpl:items-center tpl:gap-2 tpl:px-2 tpl:text-xs tpl:text-[var(--tpl-text-dim)]`},X=c({__name:`ParagraphToolbar`,props:{editor:{},toolbarPosition:{},isLoading:{type:Boolean},mergeTagEnabled:{type:Boolean}},emits:[`open-link-dialog`,`add-merge-tag`],setup(t,{emit:c}){let w=t,P=c,F=g(k,null),I=g(N,null),R=A(j,`ParagraphToolbar`),{t:z}=M(),B=R.fonts;function V(e){w.editor?.chain().focus().insertContent(e).run()}function H(){return w.editor?.getAttributes(`textStyle`).fontFamily||``}function U(){return w.editor?.getAttributes(`textStyle`).fontSize||``}function W(){return w.editor?.getAttributes(`textStyle`).color||``}function G(e){e?w.editor?.chain().focus().setFontFamily(e).run():w.editor?.chain().focus().unsetFontFamily().run()}function X(e){e?w.editor?.chain().focus().setFontSize(e).run():w.editor?.chain().focus().unsetFontSize().run()}function Z(e){e?w.editor?.chain().focus().setColor(e).run():w.editor?.chain().focus().unsetColor().run()}function Q(){return w.editor?.getAttributes(`paragraph`).lineHeight||``}function Ie(e){e?w.editor?.chain().focus().setLineHeight(e).run():w.editor?.chain().focus().unsetLineHeight().run()}function Le(){return w.editor?.getAttributes(`textStyle`).letterSpacing||``}function Re(e){e&&e!==`normal`?w.editor?.chain().focus().setLetterSpacing(e).run():w.editor?.chain().focus().unsetLetterSpacing().run()}function $(){return w.editor?.getAttributes(`highlight`).color||``}function ze(e){e?w.editor?.chain().focus().setHighlight({color:e}).run():w.editor?.chain().focus().unsetHighlight().run()}return(c,g)=>(h(),o(a,{to:`body`},[m(`div`,{"data-tpl-theme":i(I),role:`toolbar`,"aria-label":i(z).paragraphEditor.toolbar,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`,style:r({...i(F),top:`${t.toolbarPosition.top}px`,left:`${t.toolbarPosition.left}px`,transform:`translateY(-100%)`,flexDirection:`column`})},[!t.isLoading&&t.editor?(h(),d(p,{key:0},[m(`div`,J,[m(`select`,{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`,value:H(),"aria-label":i(z).paragraphEditor.fontFamily,title:i(z).paragraphEditor.fontFamily,onChange:g[0]||=e=>G(e.target.value)},[m(`option`,se,f(i(z).paragraphEditor.defaultFont),1),(h(!0),d(p,null,e(i(B),e=>(h(),d(`option`,{key:e.value,value:e.value},f(e.label),9,ce))),128))],40,oe),m(`select`,{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`,value:U(),"aria-label":i(z).paragraphEditor.fontSize,title:i(z).paragraphEditor.fontSize,onChange:g[1]||=e=>X(e.target.value)},[m(`option`,ue,f(i(z).paragraphEditor.defaultSize),1),(h(!0),d(p,null,e(i(L),e=>(h(),d(`option`,{key:e,value:e},f(e),9,Y))),128))],40,le),g[20]||=m(`span`,{class:`tpl:mx-1 tpl:h-6 tpl:w-px tpl:bg-[var(--tpl-border)]`,"aria-hidden":`true`},null,-1),m(`div`,de,[m(`input`,{type:`color`,class:`tpl:size-8 tpl:cursor-pointer tpl:rounded tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:p-1`,value:W()||i(`#000000`),"aria-label":i(z).paragraphEditor.textColor,title:i(z).paragraphEditor.textColor,onInput:g[2]||=e=>Z(e.target.value)},null,40,fe)]),m(`div`,pe,[m(`input`,{type:`color`,class:`tpl:size-8 tpl:cursor-pointer tpl:rounded tpl:border tpl:border-[var(--tpl-border)] tpl:p-1`,style:r({backgroundColor:$()||`var(--tpl-bg)`}),value:$()||i(`#ffff00`),"aria-label":i(z).paragraphEditor.highlightColor,title:i(z).paragraphEditor.highlightColor,onInput:g[3]||=e=>ze(e.target.value)},null,44,me)]),g[21]||=m(`span`,{class:`tpl:mx-1 tpl:h-6 tpl:w-px tpl:bg-[var(--tpl-border)]`,"aria-hidden":`true`},null,-1),m(`button`,{type:`button`,class:n([`tpl-text-toolbar-btn`,{"tpl-text-toolbar-btn--active":t.editor?.isActive(`bold`)}]),"aria-label":i(z).paragraphEditor.bold,title:i(z).paragraphEditor.bold,onClick:g[4]||=e=>t.editor?.chain().focus().toggleBold().run()},[l(i(_),{size:16,"stroke-width":2.5})],10,he),m(`button`,{type:`button`,class:n([`tpl-text-toolbar-btn`,{"tpl-text-toolbar-btn--active":t.editor?.isActive(`italic`)}]),"aria-label":i(z).paragraphEditor.italic,title:i(z).paragraphEditor.italic,onClick:g[5]||=e=>t.editor?.chain().focus().toggleItalic().run()},[l(i(S),{size:16,"stroke-width":2})],10,ge),m(`button`,{type:`button`,class:n([`tpl-text-toolbar-btn`,{"tpl-text-toolbar-btn--active":t.editor?.isActive(`underline`)}]),"aria-label":i(z).paragraphEditor.underline,title:i(z).paragraphEditor.underline,onClick:g[6]||=e=>t.editor?.chain().focus().toggleUnderline().run()},[l(i(te),{size:16,"stroke-width":2})],10,_e),m(`button`,{type:`button`,class:n([`tpl-text-toolbar-btn`,{"tpl-text-toolbar-btn--active":t.editor?.isActive(`strike`)}]),"aria-label":i(z).paragraphEditor.strikethrough,title:i(z).paragraphEditor.strikethrough,onClick:g[7]||=e=>t.editor?.chain().focus().toggleStrike().run()},[l(i(y),{size:16,"stroke-width":2})],10,ve),g[22]||=m(`span`,{class:`tpl:mx-1 tpl:h-6 tpl:w-px tpl:bg-[var(--tpl-border)]`,"aria-hidden":`true`},null,-1),m(`button`,{type:`button`,class:n([`tpl-text-toolbar-btn`,{"tpl-text-toolbar-btn--active":t.editor?.isActive(`subscript`)}]),"aria-label":i(z).paragraphEditor.subscript,title:i(z).paragraphEditor.subscript,onClick:g[8]||=e=>t.editor?.chain().focus().toggleSubscript().run()},[l(i(D),{size:16,"stroke-width":2})],10,ye),m(`button`,{type:`button`,class:n([`tpl-text-toolbar-btn`,{"tpl-text-toolbar-btn--active":t.editor?.isActive(`superscript`)}]),"aria-label":i(z).paragraphEditor.superscript,title:i(z).paragraphEditor.superscript,onClick:g[9]||=e=>t.editor?.chain().focus().toggleSuperscript().run()},[l(i(ne),{size:16,"stroke-width":2})],10,be),g[23]||=m(`span`,{class:`tpl:mx-1 tpl:h-6 tpl:w-px tpl:bg-[var(--tpl-border)]`,"aria-hidden":`true`},null,-1),m(`button`,{type:`button`,class:n([`tpl-text-toolbar-btn`,{"tpl-text-toolbar-btn--active":t.editor?.isActive(`link`)}]),"aria-label":i(z).paragraphEditor.addLink,title:i(z).paragraphEditor.addLink,onClick:g[10]||=e=>P(`open-link-dialog`)},[l(i(C),{size:16,"stroke-width":2})],10,xe)]),m(`div`,Se,[m(`button`,{type:`button`,class:n([`tpl-text-toolbar-btn`,{"tpl-text-toolbar-btn--active":t.editor?.isActive(`bulletList`)}]),"aria-label":i(z).paragraphEditor.bulletList,title:i(z).paragraphEditor.bulletList,onClick:g[11]||=e=>t.editor?.chain().focus().toggleBulletList().run()},[l(i(re),{size:16,"stroke-width":2})],10,Ce),m(`button`,{type:`button`,class:n([`tpl-text-toolbar-btn`,{"tpl-text-toolbar-btn--active":t.editor?.isActive(`orderedList`)}]),"aria-label":i(z).paragraphEditor.numberedList,title:i(z).paragraphEditor.numberedList,onClick:g[12]||=e=>t.editor?.chain().focus().toggleOrderedList().run()},[l(i(T),{size:16,"stroke-width":2})],10,we),g[26]||=m(`span`,{class:`tpl:mx-1.5 tpl:h-6 tpl:w-px tpl:bg-[var(--tpl-border)]`,"aria-hidden":`true`},null,-1),m(`button`,{type:`button`,class:n([`tpl-text-toolbar-btn`,{"tpl-text-toolbar-btn--active":t.editor?.isActive({textAlign:`left`})}]),"aria-label":i(z).paragraphEditor.alignLeft,title:i(z).paragraphEditor.alignLeft,onClick:g[13]||=e=>t.editor?.chain().focus().setTextAlign(`left`).run()},[l(i(E),{size:16,"stroke-width":2})],10,Te),m(`button`,{type:`button`,class:n([`tpl-text-toolbar-btn`,{"tpl-text-toolbar-btn--active":t.editor?.isActive({textAlign:`center`})}]),"aria-label":i(z).paragraphEditor.alignCenter,title:i(z).paragraphEditor.alignCenter,onClick:g[14]||=e=>t.editor?.chain().focus().setTextAlign(`center`).run()},[l(i(v),{size:16,"stroke-width":2})],10,Ee),m(`button`,{type:`button`,class:n([`tpl-text-toolbar-btn`,{"tpl-text-toolbar-btn--active":t.editor?.isActive({textAlign:`right`})}]),"aria-label":i(z).paragraphEditor.alignRight,title:i(z).paragraphEditor.alignRight,onClick:g[15]||=e=>t.editor?.chain().focus().setTextAlign(`right`).run()},[l(i(ee),{size:16,"stroke-width":2})],10,De),g[27]||=m(`span`,{class:`tpl:mx-1.5 tpl:h-6 tpl:w-px tpl:bg-[var(--tpl-border)]`,"aria-hidden":`true`},null,-1),m(`select`,{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`,value:Q(),title:i(z).paragraphEditor.lineHeight,onChange:g[16]||=e=>Ie(e.target.value)},[g[24]||=m(`option`,{value:``},`LH`,-1),(h(!0),d(p,null,e(i(ie),e=>(h(),d(`option`,{key:e,value:e},f(e),9,ke))),128))],40,Oe),m(`select`,{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`,value:Le(),title:i(z).paragraphEditor.letterSpacing,onChange:g[17]||=e=>Re(e.target.value)},[g[25]||=m(`option`,{value:``},`LS`,-1),(h(!0),d(p,null,e(i(ae),e=>(h(),d(`option`,{key:e.value,value:e.value},f(e.label),9,je))),128))],40,Ae),g[28]||=m(`span`,{class:`tpl:mx-1.5 tpl:h-6 tpl:w-px tpl:bg-[var(--tpl-border)]`,"aria-hidden":`true`},null,-1),m(`button`,{type:`button`,class:`tpl-text-toolbar-btn`,"aria-label":i(z).paragraphEditor.clearFormatting,title:i(z).paragraphEditor.clearFormatting,onClick:g[18]||=e=>t.editor?.chain().focus().clearNodes().unsetAllMarks().run()},[l(i(b),{size:16,"stroke-width":2})],8,Me),g[29]||=m(`span`,{class:`tpl:mx-1.5 tpl:h-6 tpl:w-px tpl:bg-[var(--tpl-border)]`,"aria-hidden":`true`},null,-1),l(K,{onInsert:V}),t.mergeTagEnabled?(h(),d(`span`,Ne)):s(``,!0),t.mergeTagEnabled?(h(),d(`button`,{key:1,type:`button`,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)]`,"aria-label":i(z).mergeTag.add,title:i(z).mergeTag.add,onClick:g[19]||=e=>P(`add-merge-tag`)},[l(i(O),{size:16,"stroke-width":2}),u(` `+f(i(z).mergeTag.add),1)],8,Pe)):s(``,!0)])],64)):(h(),d(`div`,Fe,[l(i(x),{class:`tpl-spinner`,size:14,"stroke-width":2}),u(` `+f(i(z).errors.editorLoading),1)]))],12,q)]))}}),Z={class:`tpl-text-editor-wrapper tpl:relative`},Q=c({__name:`ParagraphEditor`,props:{block:{},toolbarPosition:{}},emits:[`done`],setup(e,{emit:n}){let r=e,a=n,{editor:o,EditorContent:s,isLoading:c,initError:u,retry:f,showLinkDialog:p,linkUrl:m,linkDialogRef:g,mergeTagEnabled:_,openLinkDialog:v,insertLink:y,removeLink:b,closeLinkDialog:x,handleLinkKeydown:S,handleAddMergeTag:C}=I({blockId:()=>r.block.id,blockContent:()=>r.block.content,onDone:()=>a(`done`),editorName:`ParagraphEditor`,async loadExtensions({mergeTags:e,syntax:t}){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([F(()=>import(`./dist-BKSzrf0L.js`),__vite__mapDeps([0,1,2,3,4])),F(()=>import(`./dist-B5JI9nIg.js`),__vite__mapDeps([5,1,2,3,4])),F(()=>import(`./dist-0UheN8rK.js`),__vite__mapDeps([6,1,2,3,4])),F(()=>import(`./dist-55mmbGQ9.js`),__vite__mapDeps([7,1,2,3,4])),F(()=>import(`./dist-BL8c5gYQ.js`),__vite__mapDeps([8,1,2,3,4])),F(()=>import(`./dist-DxZbPJYt.js`),__vite__mapDeps([9,1,2,3,4])),F(()=>import(`./dist-B93vLKhU.js`),__vite__mapDeps([10,1,2,3,4])),F(()=>import(`./dist-BDt3FJvj.js`),__vite__mapDeps([11,1,2,3,4])),F(()=>import(`./dist-BJRuFHmi.js`),__vite__mapDeps([12,1,2,3,4])),F(()=>import(`./dist-B31mxKyP.js`),__vite__mapDeps([13,1,2,3,4])),F(()=>import(`./dist-CYThWMP5.js`),__vite__mapDeps([14,1,2,3,4])),F(()=>import(`./extensions-ea_ewKUl.js`),__vite__mapDeps([15,2,3,4,1,16]))]);return{TiptapEditor:n,EC:r,extensions:[i.configure({heading:!1,codeBlock:!1,blockquote:!1,horizontalRule:!1}),o,s,c,a.configure({openOnClick:!1,HTMLAttributes:{target:`_blank`,rel:`noopener noreferrer`}}),l.configure({types:[`paragraph`]}),u,d,f,p.configure({multicolor:!0}),g,_,v,m.configure({mergeTags:e,syntax:t}),h.configure({syntax:t})]}}});return(n,r)=>(h(),d(`div`,Z,[l(X,{editor:i(o),"toolbar-position":e.toolbarPosition,"is-loading":i(c),"merge-tag-enabled":i(_),onOpenLinkDialog:i(v),onAddMergeTag:i(C)},null,8,[`editor`,`toolbar-position`,`is-loading`,`merge-tag-enabled`,`onOpenLinkDialog`,`onAddMergeTag`]),l(z,{editor:i(o),"editor-content":i(s),"is-loading":i(c),"init-error":i(u),onRetry:i(f)},null,8,[`editor`,`editor-content`,`is-loading`,`init-error`,`onRetry`]),l(R,{visible:i(p),"is-editing-link":i(o)?.isActive(`link`)??!1,"dialog-ref":i(g),"onUpdate:dialogRef":r[0]||=e=>t(g)?g.value=e:null,"link-url":i(m),"onUpdate:linkUrl":r[1]||=e=>t(m)?m.value=e:null,onClose:i(x),onInsert:i(y),onRemove:i(b),onKeydown:i(S)},null,8,[`visible`,`is-editing-link`,`dialog-ref`,`link-url`,`onClose`,`onInsert`,`onRemove`,`onKeydown`])]))}});export{Q as default};
3
- //# sourceMappingURL=ParagraphEditor-CCtWbGDv.js.map