@templatical/editor 0.14.0 → 0.15.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 (152) hide show
  1. package/dist/{AiChatSidebar-J8iO_sX7.js → AiChatSidebar-BIKvYREk.js} +57 -56
  2. package/dist/{AiFeatureMenu-F2diEDgV.js → AiFeatureMenu-QbD82crt.js} +20 -20
  3. package/dist/{BlockIssueBadge-a-qlByxF.js → BlockIssueBadge-B3xVgMTh.js} +11 -11
  4. package/dist/{CloudEditor-CDjtwb4i.js → CloudEditor-DptuSf7A.js} +470 -468
  5. package/dist/{CollaboratorBar-B_EnJLtW.js → CollaboratorBar-DrA_K69w.js} +20 -20
  6. package/dist/{CommentsSidebar-DaP9BA_r.js → CommentsSidebar-D_tSGvTX.js} +154 -153
  7. package/dist/CountdownBlock-apiYUhkQ.js +92 -0
  8. package/dist/CountdownToolbar-CS0axcjz.js +210 -0
  9. package/dist/{DesignReferenceSidebar-BHRlTqlT.js → DesignReferenceSidebar-DWYK9nTk.js} +58 -57
  10. package/dist/{IssuesPanel-u7ee3Wrl.js → IssuesPanel-CR1MPaDE.js} +40 -40
  11. package/dist/{LoadingTrack-CV3ID80N.js → LoadingTrack-DsecR8Rw.js} +1 -1
  12. package/dist/MergeTagSuggestion-CH2SUxBo.js +1327 -0
  13. package/dist/{ModuleBrowserModal-DOsdaS6s.js → ModuleBrowserModal-D45rBj5C.js} +60 -59
  14. package/dist/{ModulePreviewCanvas-Cx4MOJ0X.js → ModulePreviewCanvas-BiQ6B2-l.js} +29 -29
  15. package/dist/{NumberWithSuffix-D2mW_DhT.js → NumberWithSuffix-CrA6quxx.js} +143 -142
  16. package/dist/{ParagraphEditor-DMzkVnST.js → ParagraphEditor-1NaUJpZO.js} +247 -246
  17. package/dist/{RichTextEditorContent-CRCxCwKf.js → RichTextEditorContent-BqLHIZY7.js} +45 -44
  18. package/dist/{SaveModuleDialog-DuEKgumL.js → SaveModuleDialog-B0sPOTgO.js} +38 -37
  19. package/dist/{SnapshotHistory-CVgiNJtE.js → SnapshotHistory-DslVzmSb.js} +34 -33
  20. package/dist/{TemplateScoringPanel-lm0_9nYi.js → TemplateScoringPanel-CZ62rGHz.js} +83 -82
  21. package/dist/{TestEmailModal-WBMdiW5S.js → TestEmailModal-DWGniJVu.js} +22 -21
  22. package/dist/{TitleEditor-eyT0h-Sa.js → TitleEditor-D4t_gZZJ.js} +44 -44
  23. package/dist/{TplModal-tjQ7OB0g.js → TplModal-Br2VG6cn.js} +14 -13
  24. package/dist/{blockTypeIcons-DdB3uTKD.js → blockTypeIcons-CXhCS5WV.js} +2 -2
  25. package/dist/bundle-stats.json +8 -8
  26. package/dist/cdn/chunks/{AiFeatureMenu-D7rB2SBs.js → AiFeatureMenu-3Slo_LGA.js} +5 -5
  27. package/dist/cdn/chunks/{AiFeatureMenu-D7rB2SBs.js.map → AiFeatureMenu-3Slo_LGA.js.map} +1 -1
  28. package/dist/cdn/chunks/{BlockIssueBadge-DHOe0pgx.js → BlockIssueBadge-BxwEiiF3.js} +3 -3
  29. package/dist/cdn/chunks/{BlockIssueBadge-DHOe0pgx.js.map → BlockIssueBadge-BxwEiiF3.js.map} +1 -1
  30. package/dist/cdn/chunks/{CloudEditor-DNed_Ym0.js → CloudEditor-DFIFWD9G.js} +89 -89
  31. package/dist/cdn/chunks/{CloudEditor-DNed_Ym0.js.map → CloudEditor-DFIFWD9G.js.map} +1 -1
  32. package/dist/cdn/chunks/{CollaboratorBar-sj_9Lee3.js → CollaboratorBar-Cu3vuN66.js} +4 -4
  33. package/dist/cdn/chunks/{CollaboratorBar-sj_9Lee3.js.map → CollaboratorBar-Cu3vuN66.js.map} +1 -1
  34. package/dist/cdn/chunks/{CountdownBlock-C1Ikjpn4.js → CountdownBlock-BEVAJQtQ.js} +3 -3
  35. package/dist/cdn/chunks/{CountdownBlock-C1Ikjpn4.js.map → CountdownBlock-BEVAJQtQ.js.map} +1 -1
  36. package/dist/cdn/chunks/{CountdownToolbar-j1G_X8rB.js → CountdownToolbar-CI2sQZv5.js} +4 -4
  37. package/dist/cdn/chunks/{CountdownToolbar-j1G_X8rB.js.map → CountdownToolbar-CI2sQZv5.js.map} +1 -1
  38. package/dist/cdn/chunks/{IssuesPanel-CTOf3PsH.js → IssuesPanel-BdeDoTcn.js} +4 -4
  39. package/dist/cdn/chunks/{IssuesPanel-CTOf3PsH.js.map → IssuesPanel-BdeDoTcn.js.map} +1 -1
  40. package/dist/cdn/chunks/MergeTagSuggestion-BsCAo4Co.js +213 -0
  41. package/dist/cdn/chunks/MergeTagSuggestion-BsCAo4Co.js.map +1 -0
  42. package/dist/cdn/chunks/{ModuleBrowserModal-DCh88-rr.js → ModuleBrowserModal-Dz-I5zfj.js} +6 -6
  43. package/dist/cdn/chunks/{ModuleBrowserModal-DCh88-rr.js.map → ModuleBrowserModal-Dz-I5zfj.js.map} +1 -1
  44. package/dist/cdn/chunks/{ModulePreviewCanvas-DJqvTKmg.js → ModulePreviewCanvas-BfinyuAN.js} +3 -3
  45. package/dist/cdn/chunks/{ModulePreviewCanvas-DJqvTKmg.js.map → ModulePreviewCanvas-BfinyuAN.js.map} +1 -1
  46. package/dist/cdn/chunks/{NumberWithSuffix-Bu45XWSl.js → NumberWithSuffix-CDjEa08X.js} +6 -6
  47. package/dist/cdn/chunks/{NumberWithSuffix-Bu45XWSl.js.map → NumberWithSuffix-CDjEa08X.js.map} +1 -1
  48. package/dist/cdn/chunks/{ParagraphEditor-DwZqLJp2.js → ParagraphEditor-B3fG0vge.js} +22 -22
  49. package/dist/cdn/chunks/{ParagraphEditor-DwZqLJp2.js.map → ParagraphEditor-B3fG0vge.js.map} +1 -1
  50. package/dist/cdn/chunks/{RichTextEditorContent-CIuZ-2DV.js → RichTextEditorContent-C6YPCp9j.js} +4 -4
  51. package/dist/cdn/chunks/{RichTextEditorContent-CIuZ-2DV.js.map → RichTextEditorContent-C6YPCp9j.js.map} +1 -1
  52. package/dist/cdn/chunks/{SaveModuleDialog-Bep0X2s_.js → SaveModuleDialog-C6UIIVAM.js} +3 -3
  53. package/dist/cdn/chunks/{SaveModuleDialog-Bep0X2s_.js.map → SaveModuleDialog-C6UIIVAM.js.map} +1 -1
  54. package/dist/cdn/chunks/{TitleEditor-DO1-h3RY.js → TitleEditor-BiZbLYF1.js} +10 -10
  55. package/dist/cdn/chunks/{TitleEditor-DO1-h3RY.js.map → TitleEditor-BiZbLYF1.js.map} +1 -1
  56. package/dist/cdn/chunks/{blockTypeIcons-8o24HVJu.js → blockTypeIcons-BernVG06.js} +3 -3
  57. package/dist/cdn/chunks/{blockTypeIcons-8o24HVJu.js.map → blockTypeIcons-BernVG06.js.map} +1 -1
  58. package/dist/cdn/chunks/{draggable-kPCz_3zM.js → draggable-kG-D5Xsm.js} +6 -6
  59. package/dist/cdn/chunks/draggable-kG-D5Xsm.js.map +1 -0
  60. package/dist/cdn/chunks/extensions-Drp8UDc6.js +421 -0
  61. package/dist/cdn/chunks/extensions-Drp8UDc6.js.map +1 -0
  62. package/dist/cdn/chunks/{features-CkTMVylx.js → features-Dpczf9Su.js} +884 -835
  63. package/dist/cdn/chunks/features-Dpczf9Su.js.map +1 -0
  64. package/dist/cdn/chunks/{icons-9zjCuoJx.js → icons-CuxnJiGQ.js} +26 -26
  65. package/dist/cdn/chunks/{icons-9zjCuoJx.js.map → icons-CuxnJiGQ.js.map} +1 -1
  66. package/dist/cdn/chunks/{liquid.browser-DKKBzRQu.js → liquid.browser-BJOEu6Cg.js} +693 -678
  67. package/dist/cdn/chunks/liquid.browser-BJOEu6Cg.js.map +1 -0
  68. package/dist/cdn/chunks/{media-library-DMRIPx4g.js → media-library-CiYl_BO7.js} +33 -33
  69. package/dist/cdn/chunks/{media-library-DMRIPx4g.js.map → media-library-CiYl_BO7.js.map} +1 -1
  70. package/dist/cdn/chunks/{pusher-CdEqyLwF.js → pusher-CIwiKF8H.js} +4 -4
  71. package/dist/cdn/chunks/{pusher-CdEqyLwF.js.map → pusher-CIwiKF8H.js.map} +1 -1
  72. package/dist/cdn/chunks/{quality-CyeUgs_c.js → quality-CNjGxBG0.js} +112 -112
  73. package/dist/cdn/chunks/{quality-CyeUgs_c.js.map → quality-CNjGxBG0.js.map} +1 -1
  74. package/dist/cdn/chunks/{renderer-BIKUEKDD.js → renderer-CFkg8h-K.js} +20 -20
  75. package/dist/cdn/chunks/renderer-CFkg8h-K.js.map +1 -0
  76. package/dist/cdn/chunks/{src-pDy_imWG.js → src-DRpKu4Dy.js} +5 -5
  77. package/dist/cdn/chunks/{src-pDy_imWG.js.map → src-DRpKu4Dy.js.map} +1 -1
  78. package/dist/cdn/chunks/{styles-D4Bd3SCx.js → styles-B7wryV0l.js} +1484 -1344
  79. package/dist/cdn/chunks/styles-B7wryV0l.js.map +1 -0
  80. package/dist/cdn/chunks/{tiptap-BlLFFU3M.js → tiptap-DF9PEiqH.js} +6859 -6823
  81. package/dist/cdn/chunks/tiptap-DF9PEiqH.js.map +1 -0
  82. package/dist/cdn/editor.css +1 -1
  83. package/dist/cdn/editor.js +35 -35
  84. package/dist/cdn/editor.js.map +1 -1
  85. package/dist/{check-CYJwFmjy.js → check-rl7ok6uJ.js} +1 -1
  86. package/dist/{chevron-down-C5l-DzAA.js → chevron-down-BKe__NOD.js} +1 -1
  87. package/dist/{circle-alert-wf5HUFZY.js → circle-alert-C8xmpMsK.js} +1 -1
  88. package/dist/{clock-Bj0bQw-K.js → clock-BW4JuDCN.js} +1 -1
  89. package/dist/{cloud-CoFDm9YA.js → cloud-BQusL53H.js} +208 -208
  90. package/dist/createLucideIcon-Dx-EjR9r.js +43 -0
  91. package/dist/{dist-CLpPNKy9.js → dist-B5Sov3sS.js} +7 -7
  92. package/dist/dist-BEWiuOMi.js +251 -0
  93. package/dist/{dist-CrQZ_af9.js → dist-BFmE-7hB.js} +2 -2
  94. package/dist/{dist-U5vfDdYI.js → dist-BMoa33wT.js} +2 -2
  95. package/dist/{dist-BctFrpeA.js → dist-BibU4HNl.js} +74 -65
  96. package/dist/{dist-Dd3ibRZm.js → dist-BsCGIDSt.js} +103 -102
  97. package/dist/dist-CNLKj9wa.js +5 -0
  98. package/dist/{dist-BX3gGwL8.js → dist-CNXDNYQn.js} +728 -694
  99. package/dist/{dist-Bn703mnA.js → dist-COG3IdPK.js} +3 -3
  100. package/dist/{dist-B7w6xTU6.js → dist-CQZxDvFw.js} +3 -3
  101. package/dist/{dist-34OcyoK1.js → dist-CRsjOQM-.js} +2 -2
  102. package/dist/dist-CTT6WYJ6.js +134 -0
  103. package/dist/dist-Cqa6aeAJ.js +5 -0
  104. package/dist/{dist-ChMninLH.js → dist-SXJJ2v41.js} +2 -2
  105. package/dist/{dist-CyjyYg52.js → dist-itdjZraK.js} +28 -23
  106. package/dist/extensions-DwaZAqm6.js +423 -0
  107. package/dist/{image-up-x8-WXfsx.js → image-up-BwBCmQ4P.js} +1 -1
  108. package/dist/{info-RS_fGcGi.js → info-TCn7uWR5.js} +1 -1
  109. package/dist/{keys-DgYXDafq.js → keys-Cv8-8GsD.js} +1 -1
  110. package/dist/{liquid.browser-CVjP5Mex.js → liquid.browser-DZLtv26k.js} +692 -677
  111. package/dist/{list-checks-Bf7XdDyv.js → list-checks-CSrOWNgq.js} +1 -1
  112. package/dist/{loader-circle-CLZ0_FvW.js → loader-circle-BLmicnPG.js} +1 -1
  113. package/dist/{message-circle-B-1bN9ab.js → message-circle-C9hHMQCI.js} +1 -1
  114. package/dist/{refresh-cw-CWKWqJYG.js → refresh-cw-D1JQ1LNa.js} +1 -1
  115. package/dist/runtime-dom.esm-bundler-BzuoCyNp.js +523 -0
  116. package/dist/{scan-line-BtK5dEai.js → scan-line-DgijVq9y.js} +1 -1
  117. package/dist/{send-Cn1IUdzh.js → send-DjPdq69F.js} +1 -1
  118. package/dist/{shield-check-CrvMk4Ea.js → shield-check-Bqluu8FS.js} +1 -1
  119. package/dist/{sparkles-CgfjwvnG.js → sparkles-M4azPVSP.js} +1 -1
  120. package/dist/style.css +1 -1
  121. package/dist/styles-D7fQ7f_1.js +4164 -0
  122. package/dist/templatical-editor.js +127 -126
  123. package/dist/{text-align-start-C3r_Rnvy.js → text-align-start-CMya5pCQ.js} +11 -11
  124. package/dist/{trash-2-CjERg4x9.js → trash-2-C-81rkLS.js} +1 -1
  125. package/dist/{triangle-alert-Chkny574.js → triangle-alert-BuRWnynk.js} +1 -1
  126. package/dist/{upload-e5kDRkPb.js → upload-CWBIoLd4.js} +1 -1
  127. package/dist/{useAliveFlag-cUQj9rmB.js → useAliveFlag-CECL_OUb.js} +1 -1
  128. package/dist/{useCloudI18n-CYJKqXtI.js → useCloudI18n-AKCy98qD.js} +2 -2
  129. package/dist/{useEditorCore-8JxXDOA4.js → useEditorCore-vcWLdnjN.js} +1406 -1364
  130. package/dist/{useI18n-BWqM8i78.js → useI18n-C-TDeJBt.js} +2 -2
  131. package/dist/{useMergeTag-NHC4ylza.js → useMergeTag-DSrBY0-2.js} +5 -5
  132. package/dist/usePopoverRoot-DKUDnr55.js +8 -0
  133. package/dist/{vue.runtime.esm-bundler-BPa483TZ.js → vue.runtime.esm-bundler-l0XAqiyv.js} +626 -1147
  134. package/dist/{x-DiPIbccg.js → x-CQSvXnGR.js} +1 -1
  135. package/package.json +26 -26
  136. package/dist/CountdownBlock-DtAokAVw.js +0 -92
  137. package/dist/CountdownToolbar-Dtqgwy0g.js +0 -210
  138. package/dist/cdn/chunks/draggable-kPCz_3zM.js.map +0 -1
  139. package/dist/cdn/chunks/extensions-iwBXnEwq.js +0 -605
  140. package/dist/cdn/chunks/extensions-iwBXnEwq.js.map +0 -1
  141. package/dist/cdn/chunks/features-CkTMVylx.js.map +0 -1
  142. package/dist/cdn/chunks/liquid.browser-DKKBzRQu.js.map +0 -1
  143. package/dist/cdn/chunks/renderer-BIKUEKDD.js.map +0 -1
  144. package/dist/cdn/chunks/styles-D4Bd3SCx.js.map +0 -1
  145. package/dist/cdn/chunks/tiptap-BlLFFU3M.js.map +0 -1
  146. package/dist/createLucideIcon-Bad2kKE0.js +0 -43
  147. package/dist/dist-CADDCv0o.js +0 -5
  148. package/dist/dist-CGvz7vkq.js +0 -5
  149. package/dist/dist-DuCzdgDA.js +0 -382
  150. package/dist/extensions-J439b7y7.js +0 -1720
  151. package/dist/styles-BUwDOWd3.js +0 -4022
  152. package/dist/usePopoverRoot-B1sdY4es.js +0 -8
@@ -1,605 +0,0 @@
1
- import { C as e, H as t, M as n, O as r, P as i, V as a, Z as o, c as s, ct as c, f as l, g as u, h as d, it as f, l as p, m, o as h, ot as g, p as _, r as v, st as y, u as b, x } from "./draggable-kPCz_3zM.js";
2
- import { Cn as S, Lt as C, Tn as w, tt as T, wn as E, xn as D } from "./features-CkTMVylx.js";
3
- import { _ as O, g as k, h as A, n as j, r as M, t as N, v as P, y as F } from "./tiptap-BlLFFU3M.js";
4
- //#region src/extensions/FontSize.ts
5
- var I = A.create({
6
- name: "fontSize",
7
- addOptions() {
8
- return { types: ["textStyle"] };
9
- },
10
- addGlobalAttributes() {
11
- return [{
12
- types: this.options.types,
13
- attributes: { fontSize: {
14
- default: null,
15
- parseHTML: (e) => e.style.fontSize?.replace(/['"]+/g, "") || null,
16
- renderHTML: (e) => e.fontSize ? { style: `font-size: ${e.fontSize}` } : {}
17
- } }
18
- }];
19
- },
20
- addCommands() {
21
- return {
22
- setFontSize: (e) => ({ chain: t }) => t().setMark("textStyle", { fontSize: e }).run(),
23
- unsetFontSize: () => ({ chain: e }) => e().setMark("textStyle", { fontSize: null }).removeEmptyTextStyle().run()
24
- };
25
- }
26
- }), L = A.create({
27
- name: "letterSpacing",
28
- addOptions() {
29
- return { types: ["textStyle"] };
30
- },
31
- addGlobalAttributes() {
32
- return [{
33
- types: this.options.types,
34
- attributes: { letterSpacing: {
35
- default: null,
36
- parseHTML: (e) => e.style.letterSpacing?.replace(/['"]+/g, "") || null,
37
- renderHTML: (e) => e.letterSpacing ? { style: `letter-spacing: ${e.letterSpacing}` } : {}
38
- } }
39
- }];
40
- },
41
- addCommands() {
42
- return {
43
- setLetterSpacing: (e) => ({ chain: t }) => t().setMark("textStyle", { letterSpacing: e }).run(),
44
- unsetLetterSpacing: () => ({ chain: e }) => e().setMark("textStyle", { letterSpacing: null }).removeEmptyTextStyle().run()
45
- };
46
- }
47
- }), R = A.create({
48
- name: "lineHeight",
49
- addOptions() {
50
- return {
51
- types: ["paragraph"],
52
- defaultLineHeight: "1.5"
53
- };
54
- },
55
- addGlobalAttributes() {
56
- return [{
57
- types: this.options.types,
58
- attributes: { lineHeight: {
59
- default: null,
60
- parseHTML: (e) => e.style.lineHeight || null,
61
- renderHTML: (e) => e.lineHeight ? { style: `line-height: ${e.lineHeight}` } : {}
62
- } }
63
- }];
64
- },
65
- addCommands() {
66
- return {
67
- setLineHeight: (e) => ({ commands: t }) => this.options.types.every((n) => t.updateAttributes(n, { lineHeight: e })),
68
- unsetLineHeight: () => ({ commands: e }) => this.options.types.every((t) => e.resetAttributes(t, "lineHeight"))
69
- };
70
- }
71
- }), ee = [
72
- "aria-label",
73
- "data-tooltip",
74
- "onKeydown"
75
- ], te = ["aria-label", "onKeydown"], ne = ["aria-label"], z = /* @__PURE__ */ x({
76
- __name: "LogicMergeTagNodeView",
77
- props: {
78
- node: {},
79
- editor: {},
80
- getPos: { type: Function },
81
- deleteNode: { type: Function },
82
- updateAttributes: { type: Function }
83
- },
84
- setup(e) {
85
- let i = e, { syntax: v } = T(), { t: b } = C(), x = l(() => w(i.node.attrs.value, v)), E = l(() => S(i.node.attrs.value, v)), D = o(!1), O = o(""), k = o(null), A = !1;
86
- function M() {
87
- O.value = i.node.attrs.value, A = !1, D.value = !0, r(() => {
88
- k.value?.focus(), k.value?.select();
89
- });
90
- }
91
- function N() {
92
- if (A) return;
93
- A = !0;
94
- let e = O.value.trim();
95
- if (!e) {
96
- D.value = !1;
97
- return;
98
- }
99
- e !== i.node.attrs.value && i.updateAttributes({
100
- value: e,
101
- keyword: w(e, v) ? S(e, v) : ""
102
- }), D.value = !1;
103
- }
104
- function P(e) {
105
- e.key === "Enter" ? (e.preventDefault(), N()) : e.key === "Escape" && (D.value = !1);
106
- }
107
- return (r, i) => (n(), m(f(j), {
108
- as: "span",
109
- class: g(x.value ? "tpl-logic-merge-tag-node tpl:group tpl:mx-0.5 tpl:inline-flex tpl:items-center tpl:gap-1 tpl:rounded tpl:px-1.5 tpl:py-0.5 tpl:text-[0.8em] tpl:font-bold tpl:tracking-wide tpl:uppercase tpl:select-none" : ""),
110
- style: y(x.value ? "background-color: transparent; border: 1.5px solid color-mix(in srgb, var(--tpl-primary) 50%, transparent); color: var(--tpl-primary);" : ""),
111
- contenteditable: "false"
112
- }, {
113
- default: a(() => [D.value ? t((n(), u("input", {
114
- key: 0,
115
- ref_key: "inputRef",
116
- ref: k,
117
- "onUpdate:modelValue": i[0] ||= (e) => O.value = e,
118
- type: "text",
119
- class: "tpl:w-40 tpl:rounded tpl:border-none tpl:bg-transparent tpl:px-0.5 tpl:py-0 tpl:text-[1em] tpl:font-medium tpl:normal-case tpl:outline-none tpl:text-[var(--tpl-primary)]",
120
- onBlur: N,
121
- onKeydown: P
122
- }, null, 544)), [[h, O.value]]) : x.value ? (n(), u("span", {
123
- key: 1,
124
- role: "button",
125
- tabindex: "0",
126
- "aria-label": f(b).mergeTag.editValue,
127
- class: "tpl-tooltip tpl:cursor-pointer",
128
- "data-tooltip": e.node.attrs.value,
129
- onClick: p(M, ["stop"]),
130
- onKeydown: [s(p(M, ["stop"]), ["enter"]), s(p(M, ["prevent", "stop"]), ["space"])]
131
- }, c(E.value), 41, ee)) : (n(), u("span", {
132
- key: 2,
133
- role: "button",
134
- tabindex: "0",
135
- "aria-label": f(b).mergeTag.editValue,
136
- onClick: p(M, ["stop"]),
137
- onKeydown: [s(p(M, ["stop"]), ["enter"]), s(p(M, ["prevent", "stop"]), ["space"])]
138
- }, c(e.node.attrs.value), 41, te)), x.value ? (n(), u("button", {
139
- key: 3,
140
- type: "button",
141
- "aria-label": f(b).mergeTag.deleteMergeTag,
142
- class: "tpl-merge-tag-delete tpl:flex tpl:size-5 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-full tpl:border-none tpl:bg-transparent tpl:p-0 tpl:opacity-60 tpl:transition-all hover:tpl:opacity-100 tpl:text-[var(--tpl-primary)]",
143
- contenteditable: "false",
144
- onClick: i[1] ||= p((...t) => e.deleteNode && e.deleteNode(...t), ["stop", "prevent"])
145
- }, [...i[2] ||= [_("svg", {
146
- width: "10",
147
- height: "10",
148
- viewBox: "0 0 24 24",
149
- fill: "none",
150
- stroke: "currentColor",
151
- "stroke-width": "3",
152
- "aria-hidden": "true"
153
- }, [_("line", {
154
- x1: "18",
155
- y1: "6",
156
- x2: "6",
157
- y2: "18"
158
- }), _("line", {
159
- x1: "6",
160
- y1: "6",
161
- x2: "18",
162
- y2: "18"
163
- })], -1)]], 8, ne)) : d("", !0)]),
164
- _: 1
165
- }, 8, ["class", "style"]));
166
- }
167
- });
168
- //#endregion
169
- //#region src/extensions/isNodeSelected.ts
170
- function B(e, t) {
171
- let { $from: n, $to: r } = e.state.selection;
172
- return n.pos === r.pos ? n.pos > 0 && n.nodeBefore?.type.name === t || n.nodeAfter?.type.name === t : !1;
173
- }
174
- //#endregion
175
- //#region src/extensions/renderVueNodeView.ts
176
- function V(e) {
177
- return M(e);
178
- }
179
- //#endregion
180
- //#region src/extensions/LogicMergeTagNode.ts
181
- var H = O.create({
182
- name: "logicMergeTagNode",
183
- group: "inline",
184
- inline: !0,
185
- atom: !0,
186
- addOptions() {
187
- return { syntax: D.liquid };
188
- },
189
- addAttributes() {
190
- return {
191
- value: {
192
- default: "",
193
- parseHTML: (e) => e.getAttribute("data-logic-merge-tag") || ""
194
- },
195
- keyword: {
196
- default: "",
197
- parseHTML: (e) => e.getAttribute("data-keyword") || e.textContent || ""
198
- }
199
- };
200
- },
201
- parseHTML() {
202
- return [{ tag: "span[data-logic-merge-tag]" }];
203
- },
204
- renderHTML({ node: e, HTMLAttributes: t }) {
205
- if (!w(e.attrs.value, this.options.syntax)) return [
206
- "span",
207
- {},
208
- e.attrs.value
209
- ];
210
- let n = S(e.attrs.value, this.options.syntax);
211
- return [
212
- "span",
213
- F(t, {
214
- "data-logic-merge-tag": e.attrs.value,
215
- "data-keyword": n
216
- }),
217
- n
218
- ];
219
- },
220
- addNodeView() {
221
- return V(z);
222
- },
223
- addKeyboardShortcuts() {
224
- return {
225
- Backspace: () => B(this.editor, this.name),
226
- Delete: () => B(this.editor, this.name)
227
- };
228
- },
229
- addInputRules() {
230
- return [new k({
231
- find: RegExp(this.options.syntax.logic.source + "$", ""),
232
- handler: ({ state: e, range: t, match: n }) => {
233
- let r = n[0];
234
- if (!w(r, this.options.syntax)) return;
235
- let i = S(r, this.options.syntax), a = this.type.create({
236
- value: r,
237
- keyword: i
238
- });
239
- e.tr.replaceWith(t.from, t.to, a);
240
- }
241
- })];
242
- },
243
- addPasteRules() {
244
- return [new P({
245
- find: new RegExp(this.options.syntax.logic.source, "g"),
246
- handler: ({ state: e, range: t, match: n }) => {
247
- let r = n[0];
248
- if (!w(r, this.options.syntax)) return;
249
- let i = S(r, this.options.syntax), a = this.type.create({
250
- value: r,
251
- keyword: i
252
- });
253
- e.tr.replaceWith(t.from, t.to, a);
254
- }
255
- })];
256
- }
257
- }), U = [
258
- "aria-label",
259
- "data-tooltip",
260
- "onKeydown"
261
- ], W = ["aria-label"], G = /* @__PURE__ */ x({
262
- __name: "MergeTagNodeView",
263
- props: {
264
- node: {},
265
- deleteNode: { type: Function },
266
- updateAttributes: { type: Function }
267
- },
268
- setup(e) {
269
- let i = e, { getMergeTagLabel: d } = T(), { t: g } = C(), v = l(() => d(i.node.attrs.value)), y = o(!1), b = o(""), x = o(null);
270
- function S() {
271
- b.value = i.node.attrs.value, y.value = !0, r(() => {
272
- x.value?.focus(), x.value?.select();
273
- });
274
- }
275
- function w() {
276
- let e = b.value.trim();
277
- e && e !== i.node.attrs.value && i.updateAttributes({
278
- value: e,
279
- label: d(e)
280
- }), y.value = !1;
281
- }
282
- function E(e) {
283
- e.key === "Enter" ? (e.preventDefault(), w()) : e.key === "Escape" && (y.value = !1);
284
- }
285
- return (r, i) => (n(), m(f(j), {
286
- as: "span",
287
- class: "tpl-merge-tag-node tpl:group tpl:mx-0.5 tpl:inline-flex tpl:items-center tpl:gap-1 tpl:rounded tpl:px-1.5 tpl:py-0.5 tpl:text-[0.9em] tpl:font-medium tpl:select-none tpl:text-[var(--tpl-primary)]",
288
- style: { "background-color": "color-mix(in srgb, var(--tpl-primary) 20%, transparent)" },
289
- contenteditable: "false"
290
- }, {
291
- default: a(() => [y.value ? t((n(), u("input", {
292
- key: 0,
293
- ref_key: "inputRef",
294
- ref: x,
295
- "onUpdate:modelValue": i[0] ||= (e) => b.value = e,
296
- type: "text",
297
- class: "tpl:w-32 tpl:rounded tpl:border-none tpl:bg-transparent tpl:px-0.5 tpl:py-0 tpl:text-[1em] tpl:font-medium tpl:outline-none tpl:text-[var(--tpl-primary)]",
298
- onBlur: w,
299
- onKeydown: E
300
- }, null, 544)), [[h, b.value]]) : (n(), u("span", {
301
- key: 1,
302
- role: "button",
303
- tabindex: "0",
304
- "aria-label": f(g).mergeTag.editValue,
305
- class: "tpl-tooltip tpl:cursor-pointer",
306
- "data-tooltip": e.node.attrs.value,
307
- onClick: p(S, ["stop"]),
308
- onKeydown: [s(p(S, ["stop"]), ["enter"]), s(p(S, ["prevent", "stop"]), ["space"])]
309
- }, c(v.value), 41, U)), _("button", {
310
- type: "button",
311
- "aria-label": f(g).mergeTag.deleteMergeTag,
312
- class: "tpl-merge-tag-delete tpl:flex tpl:size-5 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-full tpl:border-none tpl:bg-transparent tpl:p-0 tpl:opacity-60 tpl:transition-all hover:tpl:opacity-100 tpl:text-[var(--tpl-primary)]",
313
- contenteditable: "false",
314
- onClick: i[1] ||= p((...t) => e.deleteNode && e.deleteNode(...t), ["stop", "prevent"])
315
- }, [...i[2] ||= [_("svg", {
316
- width: "10",
317
- height: "10",
318
- viewBox: "0 0 24 24",
319
- fill: "none",
320
- stroke: "currentColor",
321
- "stroke-width": "3",
322
- "aria-hidden": "true"
323
- }, [_("line", {
324
- x1: "18",
325
- y1: "6",
326
- x2: "6",
327
- y2: "18"
328
- }), _("line", {
329
- x1: "6",
330
- y1: "6",
331
- x2: "18",
332
- y2: "18"
333
- })], -1)]], 8, W)]),
334
- _: 1
335
- }));
336
- }
337
- }), K = O.create({
338
- name: "mergeTagNode",
339
- group: "inline",
340
- inline: !0,
341
- atom: !0,
342
- addOptions() {
343
- return {
344
- mergeTags: [],
345
- syntax: D.liquid
346
- };
347
- },
348
- addAttributes() {
349
- return {
350
- label: {
351
- default: "",
352
- parseHTML: (e) => e.getAttribute("data-label") || e.textContent || ""
353
- },
354
- value: {
355
- default: "",
356
- parseHTML: (e) => e.getAttribute("data-merge-tag") || ""
357
- }
358
- };
359
- },
360
- parseHTML() {
361
- return [{ tag: "span[data-merge-tag]" }];
362
- },
363
- renderHTML({ node: e, HTMLAttributes: t }) {
364
- let n = E(e.attrs.value, this.options.mergeTags);
365
- return [
366
- "span",
367
- F(t, {
368
- "data-merge-tag": e.attrs.value,
369
- "data-label": n
370
- }),
371
- n
372
- ];
373
- },
374
- addNodeView() {
375
- return V(G);
376
- },
377
- addCommands() {
378
- return { insertMergeTag: (e) => ({ commands: t }) => t.insertContent({
379
- type: this.name,
380
- attrs: {
381
- label: e.label,
382
- value: e.value
383
- }
384
- }) };
385
- },
386
- addKeyboardShortcuts() {
387
- return {
388
- Backspace: () => B(this.editor, this.name),
389
- Delete: () => B(this.editor, this.name)
390
- };
391
- },
392
- addInputRules() {
393
- return [new k({
394
- find: RegExp(this.options.syntax.value.source + "$", ""),
395
- handler: ({ state: e, range: t, match: n }) => {
396
- let r = n[0], i = E(r, this.options.mergeTags), a = this.type.create({
397
- label: i,
398
- value: r
399
- });
400
- e.tr.replaceWith(t.from, t.to, a);
401
- }
402
- })];
403
- },
404
- addPasteRules() {
405
- return [new P({
406
- find: new RegExp(this.options.syntax.value.source, "g"),
407
- handler: ({ state: e, range: t, match: n }) => {
408
- let r = n[0], i = E(r, this.options.mergeTags), a = this.type.create({
409
- label: i,
410
- value: r
411
- });
412
- e.tr.replaceWith(t.from, t.to, a);
413
- }
414
- })];
415
- }
416
- }), q = ["id"], J = {
417
- key: 0,
418
- class: "tpl:px-3 tpl:py-2 tpl:text-xs tpl:text-[var(--tpl-text-dim)]",
419
- "data-testid": "merge-tag-suggestion-empty"
420
- }, Y = [
421
- "id",
422
- "aria-selected",
423
- "data-selected",
424
- "data-merge-tag-value",
425
- "onMousedown",
426
- "onMousemove"
427
- ], X = { class: "tpl:font-medium" }, re = { class: "tpl:text-[var(--tpl-text-dim)] tpl:font-mono" }, ie = /* @__PURE__ */ x({
428
- __name: "MergeTagSuggestionList",
429
- props: {
430
- items: {},
431
- selectedIndex: {},
432
- emptyText: {},
433
- listId: {}
434
- },
435
- emits: ["select", "hover"],
436
- setup(e) {
437
- let t = e;
438
- function r(e) {
439
- return t.listId ? `${t.listId}-opt-${e}` : void 0;
440
- }
441
- return (t, a) => (n(), u("div", {
442
- id: e.listId,
443
- class: "tpl:min-w-[200px] tpl:max-w-[320px] tpl:max-h-[50vh] tpl:overflow-y-auto tpl:rounded-[var(--tpl-radius)] tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-elevated)] tpl:py-1 tpl:shadow-lg",
444
- role: "listbox",
445
- "data-testid": "merge-tag-suggestion-list"
446
- }, [e.items.length === 0 ? (n(), u("div", J, c(e.emptyText), 1)) : d("", !0), (n(!0), u(b, null, i(e.items, (i, a) => (n(), u("button", {
447
- key: i.value,
448
- id: r(a),
449
- type: "button",
450
- role: "option",
451
- "aria-selected": a === e.selectedIndex,
452
- "data-selected": a === e.selectedIndex ? "true" : "false",
453
- "data-merge-tag-value": i.value,
454
- class: g(["tpl:flex tpl:w-full tpl:flex-col tpl:items-start tpl:gap-0.5 tpl:px-3 tpl:py-1.5 tpl:text-left tpl:text-xs tpl:transition-colors", a === e.selectedIndex ? "tpl:bg-[var(--tpl-primary-light)] tpl:text-[var(--tpl-primary)]" : "tpl:text-[var(--tpl-text)] hover:tpl:bg-[var(--tpl-bg-hover)]"]),
455
- onMousedown: p((e) => t.$emit("select", i), ["prevent", "stop"]),
456
- onMousemove: (n) => a !== e.selectedIndex && t.$emit("hover", a)
457
- }, [_("span", X, c(i.label), 1), _("span", re, c(i.value), 1)], 42, Y))), 128))], 8, q));
458
- }
459
- }), Z = 10, ae = 0;
460
- function Q(e, t) {
461
- let n = t.trim().toLowerCase();
462
- return n === "" ? e.slice(0, Z) : e.filter((e) => {
463
- let t = e.label.toLowerCase(), r = e.value.toLowerCase();
464
- return t.includes(n) || r.includes(n);
465
- }).slice(0, Z);
466
- }
467
- function $(e, t, n, r) {
468
- return t.length === 0 ? e.key === "Enter" || e.key === "Tab" : e.key === "ArrowDown" ? (n.value = (n.value + 1) % t.length, !0) : e.key === "ArrowUp" ? (n.value = (n.value - 1 + t.length) % t.length, !0) : e.key === "Enter" || e.key === "Tab" ? (r(t[n.value]), !0) : !1;
469
- }
470
- function oe(t, n) {
471
- return () => {
472
- let r = null, i = null, a = null, s = o([]), c = o(0), l = null, u = `tpl-merge-tag-suggestion-${++ae}`, d = null, f = [], p = null;
473
- function m() {
474
- b(d?.() ?? null);
475
- }
476
- function h() {
477
- m(), p !== null && cancelAnimationFrame(p), p = requestAnimationFrame(() => {
478
- p = null, m();
479
- });
480
- }
481
- function g(e) {
482
- let t = [], n = e?.parentElement ?? null;
483
- for (; n && n !== document.body && n !== document.documentElement;) {
484
- let e = window.getComputedStyle(n), r = e.overflow + e.overflowX + e.overflowY;
485
- /(auto|scroll|overlay)/.test(r) && t.push(n), n = n.parentElement;
486
- }
487
- return t;
488
- }
489
- function _(e) {
490
- f = [window, ...g(e)];
491
- for (let e of f) e.addEventListener("scroll", m, {
492
- passive: !0,
493
- capture: !0
494
- });
495
- window.addEventListener("resize", m, { passive: !0 });
496
- }
497
- function y() {
498
- for (let e of f) e.removeEventListener("scroll", m, { capture: !0 });
499
- window.removeEventListener("resize", m), f = [];
500
- }
501
- function b(e) {
502
- if (!i || !e || e.bottom < 0 || e.top > window.innerHeight) return;
503
- i.style.position = "fixed", i.style.left = `${e.left}px`, i.style.zIndex = "9999", i.style.top = `${e.bottom}px`;
504
- let t = i.offsetHeight;
505
- if (t !== 0 && window.innerHeight - e.bottom < t) {
506
- let n = Math.max(0, e.top - t);
507
- i.style.top = `${n}px`;
508
- }
509
- }
510
- function x(e, t) {
511
- let n = t?.closest("[data-tpl-theme]");
512
- if (!n) return;
513
- let r = n.getAttribute("data-tpl-theme");
514
- r && e.setAttribute("data-tpl-theme", r);
515
- let i = window.getComputedStyle(n);
516
- for (let t = 0; t < i.length; t++) {
517
- let n = i[t];
518
- n.startsWith("--tpl-") && e.style.setProperty(n, i.getPropertyValue(n));
519
- }
520
- e.style.fontFamily = i.fontFamily, e.style.fontSize = i.fontSize, e.style.lineHeight = i.lineHeight;
521
- }
522
- function S(e) {
523
- a && (e ? (a.setAttribute("role", "combobox"), a.setAttribute("aria-haspopup", "listbox"), a.setAttribute("aria-expanded", "true"), a.setAttribute("aria-controls", u)) : (a.removeAttribute("aria-expanded"), a.removeAttribute("aria-controls"), a.removeAttribute("aria-activedescendant"), a.removeAttribute("aria-haspopup"), a.removeAttribute("role")));
524
- }
525
- function C() {
526
- if (a) {
527
- if (s.value.length === 0) {
528
- a.removeAttribute("aria-activedescendant");
529
- return;
530
- }
531
- a.setAttribute("aria-activedescendant", `${u}-opt-${c.value}`);
532
- }
533
- }
534
- function w(e) {
535
- l?.(e);
536
- }
537
- return {
538
- onStart: (o) => {
539
- s.value = o.items, c.value = 0, l = (e) => o.command(e), i = document.createElement("div"), i.setAttribute("data-testid", "merge-tag-suggestion-popup");
540
- let f = o.editor.view?.dom;
541
- a = f ?? null, x(i, f ?? null), (n?.value ?? document.body).appendChild(i), r = v({ render() {
542
- return e(ie, {
543
- items: s.value,
544
- selectedIndex: c.value,
545
- emptyText: t,
546
- listId: u,
547
- onSelect: (e) => w(e),
548
- onHover: (e) => {
549
- c.value = e, C();
550
- }
551
- });
552
- } }), r.mount(i), S(!0), C(), d = o.clientRect ?? null, h(), _(f ?? null);
553
- },
554
- onUpdate: (e) => {
555
- s.value = e.items, c.value >= e.items.length && (c.value = 0), l = (t) => e.command(t), C(), d = e.clientRect ?? null, h();
556
- },
557
- onKeyDown: (e) => {
558
- if (e.event.key === "Escape") return !0;
559
- let t = $(e.event, s.value, c, w);
560
- return t && C(), t;
561
- },
562
- onExit: () => {
563
- p !== null && (cancelAnimationFrame(p), p = null), y(), S(!1), r?.unmount(), i?.remove(), r = null, i = null, a = null, l = null, d = null;
564
- }
565
- };
566
- };
567
- }
568
- var se = A.create({
569
- name: "mergeTagSuggestion",
570
- addOptions() {
571
- return {
572
- mergeTags: [],
573
- char: "{{",
574
- emptyText: "No matching merge tags",
575
- popoverRoot: null
576
- };
577
- },
578
- addProseMirrorPlugins() {
579
- let e = this.options.mergeTags, t = this.options.emptyText, n = this.options.popoverRoot, r = {
580
- char: this.options.char,
581
- allowSpaces: !1,
582
- startOfLine: !1,
583
- allowedPrefixes: null,
584
- items: ({ query: t }) => Q(e, t),
585
- command: ({ editor: e, range: t, props: n }) => {
586
- e.chain().focus().insertContentAt(t, {
587
- type: "mergeTagNode",
588
- attrs: {
589
- label: n.label,
590
- value: n.value
591
- }
592
- }).run();
593
- },
594
- render: oe(t, n)
595
- };
596
- return [N({
597
- editor: this.editor,
598
- ...r
599
- })];
600
- }
601
- });
602
- //#endregion
603
- export { I as FontSize, L as LetterSpacing, R as LineHeight, H as LogicMergeTagNode, K as MergeTagNode, se as MergeTagSuggestion, Q as filterMergeTags, $ as handleSuggestionKeyDown };
604
-
605
- //# sourceMappingURL=extensions-iwBXnEwq.js.map