@templatical/editor 0.0.1 → 0.0.3

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 (130) hide show
  1. package/dist/AiChatSidebar-busJk9hm.js +214 -0
  2. package/dist/AiFeatureMenu-DLGv_-pj.js +63 -0
  3. package/dist/CloudEditor-BDnHd6Um.js +919 -0
  4. package/dist/CollaboratorBar-Dv3l52vC.js +91 -0
  5. package/dist/CommentsSidebar-4tjp0VU5.js +439 -0
  6. package/dist/DesignReferenceSidebar-CmwXvltV.js +273 -0
  7. package/dist/LoadingTrack-vK8W2PJf.js +10 -0
  8. package/dist/ModuleBrowserModal-lrk3Fr0H.js +205 -0
  9. package/dist/ModulePreviewCanvas-BcBJLnwL.js +106 -0
  10. package/dist/ParagraphEditor-DH8cSC6m.js +625 -0
  11. package/dist/RichTextEditorContent-CQqodi7p.js +133 -0
  12. package/dist/SaveModuleDialog-Bmzi72td.js +122 -0
  13. package/dist/SnapshotHistory-AEgi9Xsn.js +126 -0
  14. package/dist/TemplateScoringPanel-CTgMtc0-.js +249 -0
  15. package/dist/TestEmailModal-Dpq1is9S.js +94 -0
  16. package/dist/TitleEditor-CLcDdcWI.js +167 -0
  17. package/dist/TplModal-CGzRjR96.js +44 -0
  18. package/dist/_plugin-vue_export-helper-B1-bu7yR.js +47 -0
  19. package/dist/blockTypeIcons-BpPTqcok.js +126 -0
  20. package/dist/cdn/chunks/ParagraphEditor-CCtWbGDv.js +3 -0
  21. package/dist/cdn/chunks/ParagraphEditor-CCtWbGDv.js.map +1 -0
  22. package/dist/cdn/chunks/RichTextEditorContent-BUD9veXd.js +2 -0
  23. package/dist/cdn/chunks/RichTextEditorContent-BUD9veXd.js.map +1 -0
  24. package/dist/cdn/chunks/TitleEditor-e_UTyxjd.js +3 -0
  25. package/dist/cdn/chunks/TitleEditor-e_UTyxjd.js.map +1 -0
  26. package/dist/cdn/chunks/dist-0UheN8rK.js +1 -0
  27. package/dist/cdn/chunks/dist-55mmbGQ9.js +1 -0
  28. package/dist/cdn/chunks/dist-B31mxKyP.js +1 -0
  29. package/dist/cdn/chunks/dist-B5JI9nIg.js +1 -0
  30. package/dist/cdn/chunks/dist-B93vLKhU.js +1 -0
  31. package/dist/cdn/chunks/dist-BDt3FJvj.js +1 -0
  32. package/dist/cdn/chunks/dist-BJRuFHmi.js +1 -0
  33. package/dist/cdn/chunks/dist-BKSzrf0L.js +1 -0
  34. package/dist/cdn/chunks/dist-BL8c5gYQ.js +1 -0
  35. package/dist/cdn/chunks/dist-CYThWMP5.js +1 -0
  36. package/dist/cdn/chunks/dist-DxZbPJYt.js +1 -0
  37. package/dist/cdn/chunks/draggable-ClUwYCFL.js +17 -0
  38. package/dist/cdn/chunks/draggable-ClUwYCFL.js.map +1 -0
  39. package/dist/cdn/chunks/emojiData-6fVLNqeH.js +2 -0
  40. package/dist/cdn/chunks/emojiData-6fVLNqeH.js.map +1 -0
  41. package/dist/cdn/chunks/extensions-ea_ewKUl.js +2 -0
  42. package/dist/cdn/chunks/extensions-ea_ewKUl.js.map +1 -0
  43. package/dist/cdn/chunks/icons-vmLJTaJk.js +2 -0
  44. package/dist/cdn/chunks/icons-vmLJTaJk.js.map +1 -0
  45. package/dist/cdn/chunks/rolldown-runtime-BakkzWXw.js +1 -0
  46. package/dist/cdn/chunks/styleConstants-CNejCb-L.js +2 -0
  47. package/dist/cdn/chunks/styleConstants-CNejCb-L.js.map +1 -0
  48. package/dist/cdn/chunks/tiptap-Cya4P9CN.js +145 -0
  49. package/dist/cdn/chunks/tiptap-Cya4P9CN.js.map +1 -0
  50. package/dist/cdn/chunks/useEditorCore-CwuxQuvh.js +2 -0
  51. package/dist/cdn/chunks/useEditorCore-CwuxQuvh.js.map +1 -0
  52. package/dist/cdn/chunks/useMergeTag-DVOz1v9p.js +2 -0
  53. package/dist/cdn/chunks/useMergeTag-DVOz1v9p.js.map +1 -0
  54. package/dist/cdn/editor.css +1 -0
  55. package/dist/cdn/editor.js +2 -0
  56. package/dist/cdn/editor.js.map +1 -0
  57. package/dist/check-B7kDuZmP.js +7 -0
  58. package/dist/chevron-down-DJLW2Q9Z.js +7 -0
  59. package/dist/circle-alert-E2vYPs5r.js +25 -0
  60. package/dist/clock-lWIIQA3C.js +12 -0
  61. package/dist/de-B4Ob4vCo.js +682 -0
  62. package/dist/dist-4LiM9FDd.js +35 -0
  63. package/dist/dist-Bu7veieH.js +776 -0
  64. package/dist/dist-C1BIRHCQ.js +61 -0
  65. package/dist/dist-CG-vEqSU.js +314 -0
  66. package/dist/dist-C_ymrGFi.js +10625 -0
  67. package/dist/dist-ChAGLpWo.js +35 -0
  68. package/dist/dist-D_HQYSY-.js +189 -0
  69. package/dist/dist-DkypH7qG.js +5 -0
  70. package/dist/dist-DmOE-Ubp.js +74 -0
  71. package/dist/dist-DmpMJbmZ.js +513 -0
  72. package/dist/dist-DrvKRSU6.js +47 -0
  73. package/dist/dist-Dxnd0GRf.js +5 -0
  74. package/dist/dist-DysAFIPy.js +2054 -0
  75. package/dist/emojiData-BfWQS72m.js +17 -0
  76. package/dist/en-YXsspZJG.js +682 -0
  77. package/dist/extensions-CKM99njP.js +420 -0
  78. package/dist/formatRelativeTime-DX3FgqN9.js +8 -0
  79. package/dist/i18n-CJsFtdbZ.js +23 -0
  80. package/dist/image-up-X4xIq4ea.js +23 -0
  81. package/dist/keys-Dwa2PmdD.js +10 -0
  82. package/dist/liquid.browser-BemTg3sZ.js +3272 -0
  83. package/dist/loader-circle-BTQQxC3l.js +7 -0
  84. package/dist/message-circle-Blgm6V_h.js +7 -0
  85. package/dist/refresh-cw-Bb4PEeW1.js +44 -0
  86. package/dist/scan-line-7lZPfOdm.js +25 -0
  87. package/dist/send-C0ltAQrv.js +10 -0
  88. package/dist/shield-check-f-qv4RKs.js +10 -0
  89. package/dist/sparkles-KhBCGlqB.js +23 -0
  90. package/dist/styleConstants-D4SOZGBV.js +94 -0
  91. package/dist/styles-DSw1VNU3.js +3406 -0
  92. package/dist/templatical-editor.css +2 -1
  93. package/dist/templatical-editor.js +242 -9
  94. package/dist/templatical-editor.umd.cjs +112 -524
  95. package/dist/timeouts-CmBrLeZA.js +4 -0
  96. package/dist/trash-2-OwjZ-guZ.js +25 -0
  97. package/dist/triangle-alert-DOSRIUYZ.js +17 -0
  98. package/dist/useEditorCore-Cc4RCwWq.js +5556 -0
  99. package/dist/useI18n-DUirdXEX.js +17 -0
  100. package/dist/useMergeTag-DVnlvPYJ.js +33 -0
  101. package/dist/x-CGlq2XQe.js +10 -0
  102. package/package.json +30 -20
  103. package/dist/AiChatSidebar-0vx9TP5B.js +0 -305
  104. package/dist/AiFeatureMenu-CI-v74ND.js +0 -69
  105. package/dist/CloudEditor-Wdfv_9xn.js +0 -1132
  106. package/dist/CollaboratorBar-B3uV4Wtw.js +0 -89
  107. package/dist/CommentsSidebar-PVUlloyB.js +0 -655
  108. package/dist/DesignReferenceSidebar-DAlAWrxU.js +0 -351
  109. package/dist/ModuleBrowserModal-1JEcChd8.js +0 -323
  110. package/dist/ModulePreviewCanvas-Cdp484Ae.js +0 -169
  111. package/dist/SaveModuleDialog-eNyr3XKn.js +0 -168
  112. package/dist/SnapshotHistory-D-ZiIj1v.js +0 -169
  113. package/dist/TemplateScoringPanel-DSZPo15C.js +0 -385
  114. package/dist/TestEmailModal-Cwre5elw.js +0 -128
  115. package/dist/TextEditor-BuUOIByX.js +0 -780
  116. package/dist/de-BWIAblxs.js +0 -685
  117. package/dist/en-cYyUzNV1.js +0 -685
  118. package/dist/index-0tWUczNu.js +0 -47
  119. package/dist/index-4okvXjqk.js +0 -41
  120. package/dist/index-BSc6h5zo.js +0 -967
  121. package/dist/index-CrvwWlhN.js +0 -41
  122. package/dist/index-D-iD-7lO.js +0 -10961
  123. package/dist/index-D-ygXbc8.js +0 -2452
  124. package/dist/index-DbrWKz-e.js +0 -1415
  125. package/dist/index-DeUeHy6g.js +0 -422
  126. package/dist/index-Ude6e9RU.js +0 -41
  127. package/dist/index-ZQzHBwkr.js +0 -12767
  128. package/dist/liquid.browser-CeNxS2GL.js +0 -3493
  129. package/dist/loader-circle-tM9j2mRh.js +0 -13
  130. package/dist/shield-check-Ngi9jAQc.js +0 -20
@@ -1,655 +0,0 @@
1
- import { defineComponent as St, inject as E, ref as y, computed as I, watch as et, openBlock as p, createBlock as K, Transition as U, withCtx as R, createElementBlock as i, createElementVNode as s, createVNode as m, unref as l, toDisplayString as r, createCommentVNode as d, normalizeClass as V, Fragment as ot, renderList as st, normalizeStyle as Mt, withDirectives as H, vModelText as N, createTextVNode as Kt, nextTick as Dt } from "vue";
2
- import { c as D, M as nt, X as pt, E as it, F as Tt, t as jt } from "./index-D-iD-7lO.js";
3
- import { L as rt } from "./loader-circle-tM9j2mRh.js";
4
- import { S as at } from "./CloudEditor-Wdfv_9xn.js";
5
- /**
6
- * @license lucide-vue-next v0.475.0 - ISC
7
- *
8
- * This source code is licensed under the ISC license.
9
- * See the LICENSE file in the root directory of this source tree.
10
- */
11
- const Et = D("CheckIcon", [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]]);
12
- /**
13
- * @license lucide-vue-next v0.475.0 - ISC
14
- *
15
- * This source code is licensed under the ISC license.
16
- * See the LICENSE file in the root directory of this source tree.
17
- */
18
- const It = D("ChevronUpIcon", [
19
- ["path", { d: "m18 15-6-6-6 6", key: "153udz" }]
20
- ]);
21
- /**
22
- * @license lucide-vue-next v0.475.0 - ISC
23
- *
24
- * This source code is licensed under the ISC license.
25
- * See the LICENSE file in the root directory of this source tree.
26
- */
27
- const Ut = D("CircleCheckIcon", [
28
- ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
29
- ["path", { d: "m9 12 2 2 4-4", key: "dzmm74" }]
30
- ]);
31
- /**
32
- * @license lucide-vue-next v0.475.0 - ISC
33
- *
34
- * This source code is licensed under the ISC license.
35
- * See the LICENSE file in the root directory of this source tree.
36
- */
37
- const ct = D("PencilIcon", [
38
- [
39
- "path",
40
- {
41
- d: "M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",
42
- key: "1a8usu"
43
- }
44
- ],
45
- ["path", { d: "m15 5 4 4", key: "1mk7zo" }]
46
- ]);
47
- /**
48
- * @license lucide-vue-next v0.475.0 - ISC
49
- *
50
- * This source code is licensed under the ISC license.
51
- * See the LICENSE file in the root directory of this source tree.
52
- */
53
- const Rt = D("ReplyIcon", [
54
- ["polyline", { points: "9 17 4 12 9 7", key: "hvgpf2" }],
55
- ["path", { d: "M20 18v-2a4 4 0 0 0-4-4H4", key: "5vmcpk" }]
56
- ]), Vt = {
57
- key: 0,
58
- class: "tpl-comments-sidebar tpl:absolute tpl:top-14 tpl:right-0 tpl:bottom-0 tpl:z-[45] tpl:flex tpl:w-[360px] tpl:flex-col tpl:border-l tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-elevated)]"
59
- }, Ht = { class: "tpl:flex tpl:items-center tpl:justify-between tpl:border-b tpl:border-[var(--tpl-border)] tpl:px-4 tpl:py-3" }, Nt = {
60
- class: "tpl:flex tpl:items-center tpl:gap-1.5 tpl:text-sm tpl:font-medium",
61
- style: { color: "var(--tpl-text)" }
62
- }, Lt = {
63
- key: 0,
64
- class: "tpl:ml-1 tpl:inline-flex tpl:size-5 tpl:items-center tpl:justify-center tpl:rounded-full tpl:text-[10px] tpl:font-semibold",
65
- style: { "background-color": "var(--tpl-primary)", color: "var(--tpl-bg)" }
66
- }, At = { class: "tpl:flex tpl:gap-1 tpl:border-b tpl:border-[var(--tpl-border)] tpl:px-4 tpl:py-2" }, Ft = { class: "tpl:flex-1 tpl:overflow-y-auto" }, Pt = {
67
- key: 0,
68
- class: "tpl:flex tpl:h-full tpl:items-center tpl:justify-center"
69
- }, Ot = {
70
- key: 1,
71
- class: "tpl:flex tpl:h-full tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-3 tpl:px-6 tpl:text-center"
72
- }, Yt = {
73
- class: "tpl:max-w-[240px] tpl:text-sm",
74
- style: { color: "var(--tpl-text-muted)" }
75
- }, Xt = {
76
- key: 2,
77
- class: "tpl:flex tpl:flex-col tpl:gap-3 tpl:p-3"
78
- }, qt = { class: "tpl-comment-card tpl:rounded-lg tpl:border tpl:px-3.5 tpl:py-3" }, Gt = { class: "tpl:flex tpl:items-start tpl:justify-between tpl:gap-2" }, Jt = { class: "tpl:flex tpl:items-center tpl:gap-1.5" }, Qt = {
79
- class: "tpl:text-xs tpl:font-semibold",
80
- style: { color: "var(--tpl-text)" }
81
- }, Wt = {
82
- class: "tpl:text-[10px]",
83
- style: { color: "var(--tpl-text-dim)" }
84
- }, Zt = {
85
- key: 0,
86
- class: "tpl:text-[10px] tpl:italic",
87
- style: { color: "var(--tpl-text-dim)" }
88
- }, tl = { class: "tpl:flex tpl:items-center tpl:gap-0.5" }, ll = ["title", "onClick"], el = ["title", "onClick"], ol = ["title", "onClick"], sl = {
89
- key: 0,
90
- class: "tpl:mt-1 tpl:flex tpl:items-center tpl:gap-1 tpl:text-[10px]",
91
- style: { color: "var(--tpl-primary)" }
92
- }, nl = {
93
- key: 0,
94
- class: "tpl:mt-1 tpl:inline-flex tpl:items-center tpl:gap-1 tpl:rounded tpl:px-1.5 tpl:py-0.5 tpl:text-[10px] tpl:font-medium",
95
- style: { "background-color": "var(--tpl-warning-light)", color: "var(--tpl-warning)" }
96
- }, pl = ["onClick"], il = {
97
- key: 2,
98
- class: "tpl:mt-2"
99
- }, rl = ["onKeydown"], al = { class: "tpl:mt-1.5 tpl:flex tpl:gap-1.5" }, cl = ["disabled", "onClick"], dl = {
100
- key: 3,
101
- class: "tpl:mt-1.5 tpl:text-xs tpl:leading-relaxed tpl:whitespace-pre-wrap",
102
- style: { color: "var(--tpl-text)" }
103
- }, ul = {
104
- key: 4,
105
- class: "tpl:mt-2 tpl:flex tpl:items-center tpl:gap-2 tpl:rounded-md tpl:px-2.5 tpl:py-2 tpl:text-xs",
106
- style: { "background-color": "var(--tpl-danger-light)", color: "var(--tpl-danger)" }
107
- }, ml = { class: "tpl:flex-1" }, vl = ["onClick"], fl = {
108
- key: 5,
109
- class: "tpl:mt-2 tpl:flex tpl:items-center tpl:gap-2"
110
- }, xl = ["title", "onClick"], yl = ["onClick"], kl = {
111
- key: 0,
112
- class: "tpl-comment-replies tpl:ml-5 tpl:pl-3 tpl:pt-2"
113
- }, bl = { class: "tpl:flex tpl:items-start tpl:justify-between tpl:gap-2" }, _l = { class: "tpl:flex tpl:items-center tpl:gap-1.5" }, gl = {
114
- class: "tpl:text-xs tpl:font-semibold",
115
- style: { color: "var(--tpl-text)" }
116
- }, hl = {
117
- class: "tpl:text-[10px]",
118
- style: { color: "var(--tpl-text-dim)" }
119
- }, wl = {
120
- key: 0,
121
- class: "tpl:text-[10px] tpl:italic",
122
- style: { color: "var(--tpl-text-dim)" }
123
- }, Cl = { class: "tpl:flex tpl:items-center tpl:gap-0.5" }, zl = ["title", "onClick"], Bl = ["title", "onClick"], $l = {
124
- key: 0,
125
- class: "tpl:mt-1.5"
126
- }, Sl = ["onKeydown"], Ml = { class: "tpl:mt-1.5 tpl:flex tpl:gap-1.5" }, Kl = ["disabled", "onClick"], Dl = {
127
- key: 1,
128
- class: "tpl:mt-1 tpl:text-xs tpl:leading-relaxed tpl:whitespace-pre-wrap",
129
- style: { color: "var(--tpl-text)" }
130
- }, Tl = {
131
- key: 2,
132
- class: "tpl:mt-2 tpl:flex tpl:items-center tpl:gap-2 tpl:rounded-md tpl:px-2.5 tpl:py-2 tpl:text-xs",
133
- style: { "background-color": "var(--tpl-danger-light)", color: "var(--tpl-danger)" }
134
- }, jl = { class: "tpl:flex-1" }, El = ["onClick"], Il = {
135
- key: 0,
136
- class: "tpl-comment-replies tpl:ml-5 tpl:pl-3 tpl:pt-2"
137
- }, Ul = { class: "tpl:flex tpl:items-end tpl:gap-2" }, Rl = ["placeholder", "onKeydown"], Vl = { class: "tpl:flex tpl:shrink-0 tpl:flex-col tpl:gap-1" }, Hl = ["disabled", "onClick"], Nl = {
138
- class: "tpl:border-t tpl:p-3",
139
- style: { "border-color": "var(--tpl-border)" }
140
- }, Ll = {
141
- key: 0,
142
- class: "tpl:flex tpl:min-h-[68px] tpl:items-center tpl:rounded-md tpl:px-3 tpl:py-2 tpl:text-xs",
143
- style: { "background-color": "var(--tpl-warning-light)", color: "var(--tpl-warning)" }
144
- }, Al = {
145
- key: 1,
146
- class: "tpl-comments-input-wrapper tpl:flex tpl:min-h-[68px] tpl:items-end tpl:gap-2 tpl:rounded-[var(--tpl-radius)] tpl:border tpl:px-3 tpl:py-2",
147
- style: { "border-color": "var(--tpl-border)", "background-color": "var(--tpl-bg)" }
148
- }, Fl = ["placeholder", "disabled"], Pl = ["disabled"], Ol = /* @__PURE__ */ St({
149
- __name: "CommentsSidebar",
150
- props: {
151
- visible: { type: Boolean }
152
- },
153
- emits: ["close", "filterBlock"],
154
- setup(F, { expose: dt, emit: ut }) {
155
- const mt = F, P = ut, n = E("translations"), w = E("editor"), vt = E("authManager"), c = E("comments"), v = y("unresolved"), b = y(null), $ = y(""), S = y(null), _ = y(""), g = y(null), f = y(""), h = y(/* @__PURE__ */ new Set()), C = y(null), O = y(null), ft = I(() => {
156
- var t;
157
- return ((t = vt.userConfig) == null ? void 0 : t.id) ?? null;
158
- }), xt = I(() => {
159
- const t = /* @__PURE__ */ new Set();
160
- for (const o of w.content.value.blocks)
161
- if (t.add(o.id), o.type === "section")
162
- for (const e of o.children)
163
- for (const x of e)
164
- t.add(x.id);
165
- return t;
166
- });
167
- function yt(t) {
168
- return t ? !xt.value.has(t) : !1;
169
- }
170
- const kt = I(() => v.value !== "block" || !b.value ? !1 : !w.savedBlockIds.value.has(b.value)), Y = I(() => {
171
- let t = c.comments.value;
172
- return v.value === "unresolved" ? t = t.filter((o) => !o.resolved_at) : v.value === "block" && b.value && (t = t.filter((o) => o.block_id === b.value)), t;
173
- });
174
- et(
175
- () => mt.visible,
176
- (t) => {
177
- t && c.loadComments();
178
- }
179
- ), et(
180
- () => w.state.selectedBlockId,
181
- (t) => {
182
- v.value === "block" && t && (b.value = t);
183
- }
184
- );
185
- function T(t, o) {
186
- v.value = t, b.value = t === "block" ? o ?? null : null;
187
- }
188
- function bt(t) {
189
- T("block", t), P("filterBlock", t);
190
- }
191
- function _t(t) {
192
- h.value.has(t) ? h.value.delete(t) : h.value.add(t);
193
- }
194
- function gt(t) {
195
- S.value = t, _.value = "", g.value = null, h.value.has(t) || h.value.add(t);
196
- }
197
- function ht() {
198
- S.value = null, _.value = "";
199
- }
200
- function X(t) {
201
- g.value = t.id, f.value = t.body, S.value = null;
202
- }
203
- function L() {
204
- g.value = null, f.value = "";
205
- }
206
- function q(t) {
207
- C.value = t;
208
- }
209
- function G() {
210
- C.value = null;
211
- }
212
- async function J() {
213
- const t = $.value.trim();
214
- if (!t)
215
- return;
216
- const o = v.value === "block" ? b.value : void 0;
217
- await c.addComment(t, o ?? void 0), $.value = "";
218
- }
219
- async function Q(t) {
220
- const o = _.value.trim();
221
- if (!o)
222
- return;
223
- const e = c.comments.value.find((x) => x.id === t);
224
- await c.addComment(o, (e == null ? void 0 : e.block_id) ?? void 0, t), S.value = null, _.value = "";
225
- }
226
- async function A(t) {
227
- const o = f.value.trim();
228
- o && (await c.editComment(t, o), g.value = null, f.value = "");
229
- }
230
- async function W(t) {
231
- await c.removeComment(t), C.value = null;
232
- }
233
- async function wt(t) {
234
- await c.toggleResolve(t);
235
- }
236
- function z(t) {
237
- return t.author_identifier === ft.value;
238
- }
239
- function Z(t) {
240
- const o = new Date(t), x = (/* @__PURE__ */ new Date()).getTime() - o.getTime(), B = Math.floor(x / 6e4), M = Math.floor(x / 36e5), j = Math.floor(x / 864e5);
241
- return B < 1 ? n.snapshotHistory.justNow : B < 60 ? n.snapshotHistory.minutesAgo.replace(
242
- "{minutes}",
243
- String(B)
244
- ) : M < 24 ? n.snapshotHistory.hoursAgo.replace(
245
- "{hours}",
246
- String(M)
247
- ) : n.snapshotHistory.daysAgo.replace(
248
- "{days}",
249
- String(j)
250
- );
251
- }
252
- function Ct(t) {
253
- t.key === "Enter" && !t.shiftKey && (t.preventDefault(), J());
254
- }
255
- function zt(t, o) {
256
- t.key === "Enter" && !t.shiftKey && (t.preventDefault(), Q(o));
257
- }
258
- function tt(t, o) {
259
- t.key === "Enter" && !t.shiftKey && (t.preventDefault(), A(o)), t.key === "Escape" && L();
260
- }
261
- function Bt() {
262
- Dt(() => {
263
- var t;
264
- (t = O.value) == null || t.focus();
265
- });
266
- }
267
- return dt({ filterByBlock: bt, focusNewComment: Bt }), (t, o) => (p(), K(U, {
268
- "enter-active-class": "tpl-comments-slide-enter-active",
269
- "enter-from-class": "tpl:translate-x-full",
270
- "enter-to-class": "tpl:translate-x-0",
271
- "leave-active-class": "tpl-comments-slide-leave-active",
272
- "leave-from-class": "tpl:translate-x-0",
273
- "leave-to-class": "tpl:translate-x-full"
274
- }, {
275
- default: R(() => [
276
- F.visible ? (p(), i("div", Vt, [
277
- s("div", Ht, [
278
- s("div", Nt, [
279
- m(l(nt), {
280
- size: 13,
281
- "stroke-width": 2
282
- }),
283
- s("span", null, r(l(n).comments.title), 1),
284
- l(c).unresolvedCount.value > 0 ? (p(), i("span", Lt, r(l(c).unresolvedCount.value), 1)) : d("", !0)
285
- ]),
286
- s("button", {
287
- class: "tpl:rounded-md tpl:p-0.5 tpl:transition-colors tpl:duration-150",
288
- style: { color: "var(--tpl-text-muted)" },
289
- onClick: o[0] || (o[0] = (e) => P("close"))
290
- }, [
291
- m(l(pt), {
292
- size: 14,
293
- "stroke-width": 2
294
- })
295
- ])
296
- ]),
297
- s("div", At, [
298
- s("button", {
299
- class: V([
300
- "tpl-comment-filter tpl:rounded-md tpl:px-2.5 tpl:py-1 tpl:text-xs tpl:font-medium tpl:transition-colors tpl:duration-150",
301
- v.value === "unresolved" ? "tpl-comment-filter--active" : ""
302
- ]),
303
- onClick: o[1] || (o[1] = (e) => T("unresolved"))
304
- }, r(l(n).comments.filterUnresolved), 3),
305
- s("button", {
306
- class: V(["tpl-comment-filter tpl:rounded-md tpl:px-2.5 tpl:py-1 tpl:text-xs tpl:font-medium tpl:transition-colors tpl:duration-150", v.value === "all" ? "tpl-comment-filter--active" : ""]),
307
- onClick: o[2] || (o[2] = (e) => T("all"))
308
- }, r(l(n).comments.filterAll), 3),
309
- l(w).state.selectedBlockId ? (p(), i("button", {
310
- key: 0,
311
- class: V(["tpl-comment-filter tpl:rounded-md tpl:px-2.5 tpl:py-1 tpl:text-xs tpl:font-medium tpl:transition-colors tpl:duration-150", v.value === "block" ? "tpl-comment-filter--active" : ""]),
312
- onClick: o[3] || (o[3] = (e) => T("block", l(w).state.selectedBlockId ?? void 0))
313
- }, r(l(n).comments.filterBlock), 3)) : d("", !0)
314
- ]),
315
- s("div", Ft, [
316
- l(c).isLoading.value ? (p(), i("div", Pt, [
317
- m(l(rt), {
318
- class: "tpl-spinner",
319
- size: 24,
320
- "stroke-width": 2,
321
- style: { color: "var(--tpl-text-muted)" }
322
- })
323
- ])) : Y.value.length === 0 ? (p(), i("div", Ot, [
324
- m(l(nt), {
325
- size: 32,
326
- "stroke-width": 1.5,
327
- style: { color: "var(--tpl-text-dim)" }
328
- }),
329
- s("p", Yt, r(v.value === "all" ? l(n).comments.noCommentsHint : l(n).comments.noComments), 1)
330
- ])) : (p(), i("div", Xt, [
331
- (p(!0), i(ot, null, st(Y.value, (e) => {
332
- var x, B, M, j;
333
- return p(), i("div", {
334
- key: e.id,
335
- class: "tpl-comment-thread"
336
- }, [
337
- s("div", qt, [
338
- s("div", Gt, [
339
- s("div", Jt, [
340
- s("span", Qt, r(z(e) ? l(n).comments.ownedByYou : e.author_name), 1),
341
- s("span", Wt, r(Z(e.created_at)), 1),
342
- e.updated_at !== e.created_at ? (p(), i("span", Zt, " (" + r(l(n).comments.edited) + ") ", 1)) : d("", !0)
343
- ]),
344
- s("div", tl, [
345
- s("button", {
346
- class: "tpl-comment-action tpl:rounded tpl:p-1 tpl:transition-colors tpl:duration-150",
347
- title: e.resolved_at ? l(n).comments.unresolve : l(n).comments.resolve,
348
- onClick: (a) => wt(e.id)
349
- }, [
350
- m(l(Ut), {
351
- size: 13,
352
- "stroke-width": 2,
353
- class: "tpl-resolve-icon",
354
- style: Mt({
355
- color: e.resolved_at ? "var(--tpl-primary)" : void 0
356
- })
357
- }, null, 8, ["style"])
358
- ], 8, ll),
359
- z(e) ? (p(), i("button", {
360
- key: 0,
361
- class: "tpl-comment-action tpl:rounded tpl:p-1 tpl:transition-colors tpl:duration-150",
362
- title: l(n).comments.edit,
363
- onClick: (a) => X(e)
364
- }, [
365
- m(l(ct), {
366
- size: 12,
367
- "stroke-width": 2
368
- })
369
- ], 8, el)) : d("", !0),
370
- z(e) ? (p(), i("button", {
371
- key: 1,
372
- class: "tpl-comment-action tpl-comment-delete tpl:rounded tpl:p-1 tpl:transition-colors tpl:duration-150",
373
- title: l(n).comments.delete,
374
- onClick: (a) => q(e.id)
375
- }, [
376
- m(l(it), {
377
- size: 12,
378
- "stroke-width": 2
379
- })
380
- ], 8, ol)) : d("", !0)
381
- ])
382
- ]),
383
- m(U, { name: "tpl-resolve" }, {
384
- default: R(() => [
385
- e.resolved_at ? (p(), i("div", sl, [
386
- m(l(Et), {
387
- size: 10,
388
- "stroke-width": 2.5
389
- }),
390
- s("span", null, r(l(n).comments.resolvedBy.replace(
391
- "{name}",
392
- e.resolved_by_name ?? ""
393
- )), 1)
394
- ])) : d("", !0)
395
- ]),
396
- _: 2
397
- }, 1024),
398
- e.block_id && yt(e.block_id) ? (p(), i("span", nl, r(l(n).comments.missingBlock), 1)) : e.block_id ? (p(), i("button", {
399
- key: 1,
400
- class: "tpl:mt-1 tpl:inline-flex tpl:items-center tpl:gap-1 tpl:rounded tpl:px-1.5 tpl:py-0.5 tpl:text-[10px] tpl:font-medium tpl:transition-colors tpl:duration-150",
401
- style: { "background-color": "var(--tpl-bg-hover)", color: "var(--tpl-text-muted)" },
402
- onClick: (a) => l(w).selectBlock(e.block_id ?? "")
403
- }, " Block ", 8, pl)) : d("", !0),
404
- g.value === e.id ? (p(), i("div", il, [
405
- H(s("textarea", {
406
- "onUpdate:modelValue": o[4] || (o[4] = (a) => f.value = a),
407
- class: "tpl:w-full tpl:resize-none tpl:rounded-md tpl:border tpl:px-2.5 tpl:py-2 tpl:font-sans tpl:text-xs tpl:outline-none",
408
- style: { "border-color": "var(--tpl-border)", "background-color": "var(--tpl-bg)", color: "var(--tpl-text)" },
409
- rows: "3",
410
- onKeydown: (a) => tt(a, e.id)
411
- }, null, 40, rl), [
412
- [N, f.value]
413
- ]),
414
- s("div", al, [
415
- s("button", {
416
- class: "tpl:rounded-md tpl:px-2.5 tpl:py-1 tpl:text-xs tpl:font-medium tpl:transition-colors tpl:duration-150",
417
- style: { "background-color": "var(--tpl-primary)", color: "var(--tpl-bg)" },
418
- disabled: !f.value.trim() || l(c).isSubmitting.value,
419
- onClick: (a) => A(e.id)
420
- }, r(l(n).comments.save), 9, cl),
421
- s("button", {
422
- class: "tpl:rounded-md tpl:px-2.5 tpl:py-1 tpl:text-xs tpl:font-medium tpl:transition-colors tpl:duration-150",
423
- style: { color: "var(--tpl-text-muted)" },
424
- onClick: o[5] || (o[5] = (a) => L())
425
- }, r(l(n).comments.cancel), 1)
426
- ])
427
- ])) : (p(), i("p", dl, r(e.body), 1)),
428
- C.value === e.id ? (p(), i("div", ul, [
429
- s("span", ml, r(l(n).comments.deleteConfirm), 1),
430
- s("button", {
431
- class: "tpl:rounded tpl:px-2 tpl:py-0.5 tpl:text-xs tpl:font-medium",
432
- style: { "background-color": "var(--tpl-danger)", color: "white" },
433
- onClick: (a) => W(e.id)
434
- }, r(l(n).comments.delete), 9, vl),
435
- s("button", {
436
- class: "tpl:text-xs tpl:font-medium",
437
- style: { color: "var(--tpl-text-muted)" },
438
- onClick: o[6] || (o[6] = (a) => G())
439
- }, r(l(n).comments.cancel), 1)
440
- ])) : d("", !0),
441
- g.value !== e.id && C.value !== e.id ? (p(), i("div", fl, [
442
- s("button", {
443
- class: "tpl-comment-action tpl:rounded tpl:p-1 tpl:transition-colors tpl:duration-150",
444
- title: l(n).comments.reply,
445
- onClick: (a) => gt(e.id)
446
- }, [
447
- m(l(Rt), {
448
- size: 13,
449
- "stroke-width": 2,
450
- style: { color: "var(--tpl-primary)" }
451
- })
452
- ], 8, xl),
453
- (((x = e.replies) == null ? void 0 : x.length) ?? 0) > 0 ? (p(), i("button", {
454
- key: 0,
455
- class: "tpl:flex tpl:items-center tpl:gap-0.5 tpl:text-[11px] tpl:font-medium tpl:transition-colors tpl:duration-150",
456
- style: { color: "var(--tpl-text-muted)" },
457
- onClick: (a) => _t(e.id)
458
- }, [
459
- h.value.has(e.id) ? (p(), K(l(It), {
460
- key: 0,
461
- size: 11,
462
- "stroke-width": 2
463
- })) : (p(), K(l(Tt), {
464
- key: 1,
465
- size: 11,
466
- "stroke-width": 2
467
- })),
468
- Kt(" " + r((((B = e.replies) == null ? void 0 : B.length) ?? 0) === 1 ? l(n).comments.replyOne.replace(
469
- "{count}",
470
- String(((M = e.replies) == null ? void 0 : M.length) ?? 0)
471
- ) : l(n).comments.replyMany.replace(
472
- "{count}",
473
- String(((j = e.replies) == null ? void 0 : j.length) ?? 0)
474
- )), 1)
475
- ], 8, yl)) : d("", !0)
476
- ])) : d("", !0)
477
- ]),
478
- m(U, { name: "tpl-replies" }, {
479
- default: R(() => {
480
- var a;
481
- return [
482
- h.value.has(e.id) && (((a = e.replies) == null ? void 0 : a.length) ?? 0) > 0 ? (p(), i("div", kl, [
483
- (p(!0), i(ot, null, st(e.replies, (u, $t) => {
484
- var lt;
485
- return p(), i("div", {
486
- key: u.id,
487
- class: V([
488
- "tpl-comment-reply-card tpl:relative tpl:rounded-lg tpl:border tpl:px-3.5 tpl:py-2.5",
489
- $t < (((lt = e.replies) == null ? void 0 : lt.length) ?? 0) - 1 ? "tpl:mb-2" : ""
490
- ])
491
- }, [
492
- s("div", bl, [
493
- s("div", _l, [
494
- s("span", gl, r(z(u) ? l(n).comments.ownedByYou : u.author_name), 1),
495
- s("span", hl, r(Z(u.created_at)), 1),
496
- u.updated_at !== u.created_at ? (p(), i("span", wl, " (" + r(l(n).comments.edited) + ") ", 1)) : d("", !0)
497
- ]),
498
- s("div", Cl, [
499
- z(u) ? (p(), i("button", {
500
- key: 0,
501
- class: "tpl-comment-action tpl:rounded tpl:p-1 tpl:transition-colors tpl:duration-150",
502
- title: l(n).comments.edit,
503
- onClick: (k) => X(u)
504
- }, [
505
- m(l(ct), {
506
- size: 11,
507
- "stroke-width": 2
508
- })
509
- ], 8, zl)) : d("", !0),
510
- z(u) ? (p(), i("button", {
511
- key: 1,
512
- class: "tpl-comment-action tpl-comment-delete tpl:rounded tpl:p-1 tpl:transition-colors tpl:duration-150",
513
- title: l(n).comments.delete,
514
- onClick: (k) => q(u.id)
515
- }, [
516
- m(l(it), {
517
- size: 11,
518
- "stroke-width": 2
519
- })
520
- ], 8, Bl)) : d("", !0)
521
- ])
522
- ]),
523
- g.value === u.id ? (p(), i("div", $l, [
524
- H(s("textarea", {
525
- "onUpdate:modelValue": o[7] || (o[7] = (k) => f.value = k),
526
- class: "tpl:w-full tpl:resize-none tpl:rounded-md tpl:border tpl:px-2.5 tpl:py-2 tpl:font-sans tpl:text-xs tpl:outline-none",
527
- style: { "border-color": "var(--tpl-border)", "background-color": "var(--tpl-bg)", color: "var(--tpl-text)" },
528
- rows: "2",
529
- onKeydown: (k) => tt(k, u.id)
530
- }, null, 40, Sl), [
531
- [N, f.value]
532
- ]),
533
- s("div", Ml, [
534
- s("button", {
535
- class: "tpl:rounded-md tpl:px-2.5 tpl:py-1 tpl:text-xs tpl:font-medium",
536
- style: { "background-color": "var(--tpl-primary)", color: "var(--tpl-bg)" },
537
- disabled: !f.value.trim() || l(c).isSubmitting.value,
538
- onClick: (k) => A(u.id)
539
- }, r(l(n).comments.save), 9, Kl),
540
- s("button", {
541
- class: "tpl:rounded-md tpl:px-2.5 tpl:py-1 tpl:text-xs tpl:font-medium",
542
- style: { color: "var(--tpl-text-muted)" },
543
- onClick: o[8] || (o[8] = (k) => L())
544
- }, r(l(n).comments.cancel), 1)
545
- ])
546
- ])) : (p(), i("p", Dl, r(u.body), 1)),
547
- C.value === u.id ? (p(), i("div", Tl, [
548
- s("span", jl, r(l(n).comments.deleteConfirm), 1),
549
- s("button", {
550
- class: "tpl:rounded tpl:px-2 tpl:py-0.5 tpl:text-xs tpl:font-medium",
551
- style: { "background-color": "var(--tpl-danger)", color: "white" },
552
- onClick: (k) => W(u.id)
553
- }, r(l(n).comments.delete), 9, El),
554
- s("button", {
555
- class: "tpl:text-xs tpl:font-medium",
556
- style: { color: "var(--tpl-text-muted)" },
557
- onClick: o[9] || (o[9] = (k) => G())
558
- }, r(l(n).comments.cancel), 1)
559
- ])) : d("", !0)
560
- ], 2);
561
- }), 128))
562
- ])) : d("", !0)
563
- ];
564
- }),
565
- _: 2
566
- }, 1024),
567
- m(U, { name: "tpl-replies" }, {
568
- default: R(() => [
569
- S.value === e.id ? (p(), i("div", Il, [
570
- s("div", Ul, [
571
- H(s("textarea", {
572
- "onUpdate:modelValue": o[10] || (o[10] = (a) => _.value = a),
573
- class: "tpl:flex-1 tpl:resize-none tpl:rounded-md tpl:border tpl:px-2.5 tpl:py-2 tpl:font-sans tpl:text-xs tpl:outline-none",
574
- style: { "border-color": "var(--tpl-border)", "background-color": "var(--tpl-bg)", color: "var(--tpl-text)" },
575
- placeholder: l(n).comments.replyPlaceholder,
576
- rows: "2",
577
- onKeydown: (a) => zt(a, e.id)
578
- }, null, 40, Rl), [
579
- [N, _.value]
580
- ]),
581
- s("div", Vl, [
582
- s("button", {
583
- class: "tpl:flex tpl:items-center tpl:justify-center tpl:rounded-md tpl:p-1.5 tpl:transition-colors tpl:duration-150 tpl:disabled:opacity-40",
584
- style: { color: "var(--tpl-primary)" },
585
- disabled: !_.value.trim() || l(c).isSubmitting.value,
586
- onClick: (a) => Q(e.id)
587
- }, [
588
- m(l(at), {
589
- size: 14,
590
- "stroke-width": 2
591
- })
592
- ], 8, Hl),
593
- s("button", {
594
- class: "tpl:flex tpl:items-center tpl:justify-center tpl:rounded-md tpl:p-1.5 tpl:transition-colors tpl:duration-150",
595
- style: { color: "var(--tpl-text-muted)" },
596
- onClick: o[11] || (o[11] = (a) => ht())
597
- }, [
598
- m(l(pt), {
599
- size: 14,
600
- "stroke-width": 2
601
- })
602
- ])
603
- ])
604
- ])
605
- ])) : d("", !0)
606
- ]),
607
- _: 2
608
- }, 1024)
609
- ]);
610
- }), 128))
611
- ]))
612
- ]),
613
- s("div", Nl, [
614
- kt.value ? (p(), i("div", Ll, r(l(n).comments.saveTemplateFirst), 1)) : (p(), i("div", Al, [
615
- H(s("textarea", {
616
- ref_key: "newCommentInput",
617
- ref: O,
618
- "onUpdate:modelValue": o[12] || (o[12] = (e) => $.value = e),
619
- class: "tpl:max-h-24 tpl:min-h-[48px] tpl:flex-1 tpl:resize-none tpl:border-none tpl:bg-transparent tpl:font-sans tpl:text-xs tpl:outline-none",
620
- style: { color: "var(--tpl-text)" },
621
- placeholder: l(n).comments.placeholder,
622
- disabled: l(c).isSubmitting.value,
623
- rows: "2",
624
- onKeydown: Ct
625
- }, null, 40, Fl), [
626
- [N, $.value]
627
- ]),
628
- s("button", {
629
- class: "tpl-comments-send-btn tpl:flex tpl:shrink-0 tpl:items-center tpl:justify-center tpl:rounded-md tpl:p-1.5 tpl:transition-all tpl:duration-150 tpl:disabled:opacity-40",
630
- style: { color: "var(--tpl-primary)" },
631
- disabled: !$.value.trim() || l(c).isSubmitting.value,
632
- onClick: J
633
- }, [
634
- l(c).isSubmitting.value ? (p(), K(l(rt), {
635
- key: 0,
636
- class: "tpl-spinner",
637
- size: 16,
638
- "stroke-width": 2
639
- })) : (p(), K(l(at), {
640
- key: 1,
641
- size: 16,
642
- "stroke-width": 2
643
- }))
644
- ], 8, Pl)
645
- ]))
646
- ])
647
- ])) : d("", !0)
648
- ]),
649
- _: 1
650
- }));
651
- }
652
- }), Jl = /* @__PURE__ */ jt(Ol, [["__scopeId", "data-v-7cf62c4b"]]);
653
- export {
654
- Jl as default
655
- };