@templatical/editor 0.0.1
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.
- package/dist/AiChatSidebar-0vx9TP5B.js +305 -0
- package/dist/AiFeatureMenu-CI-v74ND.js +69 -0
- package/dist/CloudEditor-Wdfv_9xn.js +1132 -0
- package/dist/CollaboratorBar-B3uV4Wtw.js +89 -0
- package/dist/CommentsSidebar-PVUlloyB.js +655 -0
- package/dist/DesignReferenceSidebar-DAlAWrxU.js +351 -0
- package/dist/ModuleBrowserModal-1JEcChd8.js +323 -0
- package/dist/ModulePreviewCanvas-Cdp484Ae.js +169 -0
- package/dist/SaveModuleDialog-eNyr3XKn.js +168 -0
- package/dist/SnapshotHistory-D-ZiIj1v.js +169 -0
- package/dist/TemplateScoringPanel-DSZPo15C.js +385 -0
- package/dist/TestEmailModal-Cwre5elw.js +128 -0
- package/dist/TextEditor-BuUOIByX.js +780 -0
- package/dist/de-BWIAblxs.js +685 -0
- package/dist/en-cYyUzNV1.js +685 -0
- package/dist/index-0tWUczNu.js +47 -0
- package/dist/index-4okvXjqk.js +41 -0
- package/dist/index-BSc6h5zo.js +967 -0
- package/dist/index-CrvwWlhN.js +41 -0
- package/dist/index-D-iD-7lO.js +10961 -0
- package/dist/index-D-ygXbc8.js +2452 -0
- package/dist/index-DbrWKz-e.js +1415 -0
- package/dist/index-DeUeHy6g.js +422 -0
- package/dist/index-Ude6e9RU.js +41 -0
- package/dist/index-ZQzHBwkr.js +12767 -0
- package/dist/liquid.browser-CeNxS2GL.js +3493 -0
- package/dist/loader-circle-tM9j2mRh.js +13 -0
- package/dist/shield-check-Ngi9jAQc.js +20 -0
- package/dist/templatical-editor.css +1 -0
- package/dist/templatical-editor.js +9 -0
- package/dist/templatical-editor.umd.cjs +600 -0
- package/package.json +64 -0
|
@@ -0,0 +1,385 @@
|
|
|
1
|
+
import { defineComponent as Z, inject as f, ref as G, watch as H, openBlock as i, createBlock as g, Transition as J, withCtx as K, createElementBlock as n, createElementVNode as s, createVNode as d, unref as t, toDisplayString as p, createCommentVNode as u, createTextVNode as I, normalizeStyle as v, Fragment as F, renderList as T, resolveDynamicComponent as B, normalizeClass as O } from "vue";
|
|
2
|
+
import { c as M, G as j, X as Q, L as U, C as b, S as L, H as W, F as Y, J as tt, K as et, t as lt } from "./index-D-iD-7lO.js";
|
|
3
|
+
import { useTemplateScoring as st } from "@templatical/core/cloud";
|
|
4
|
+
import { S as E } from "./shield-check-Ngi9jAQc.js";
|
|
5
|
+
import { L as rt } from "./loader-circle-tM9j2mRh.js";
|
|
6
|
+
/**
|
|
7
|
+
* @license lucide-vue-next v0.475.0 - ISC
|
|
8
|
+
*
|
|
9
|
+
* This source code is licensed under the ISC license.
|
|
10
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
+
*/
|
|
12
|
+
const ot = M("ShieldXIcon", [
|
|
13
|
+
[
|
|
14
|
+
"path",
|
|
15
|
+
{
|
|
16
|
+
d: "M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",
|
|
17
|
+
key: "oel41y"
|
|
18
|
+
}
|
|
19
|
+
],
|
|
20
|
+
["path", { d: "m14.5 9.5-5 5", key: "17q4r4" }],
|
|
21
|
+
["path", { d: "m9.5 9.5 5 5", key: "18nt4w" }]
|
|
22
|
+
]);
|
|
23
|
+
/**
|
|
24
|
+
* @license lucide-vue-next v0.475.0 - ISC
|
|
25
|
+
*
|
|
26
|
+
* This source code is licensed under the ISC license.
|
|
27
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
28
|
+
*/
|
|
29
|
+
const it = M("ZapIcon", [
|
|
30
|
+
[
|
|
31
|
+
"path",
|
|
32
|
+
{
|
|
33
|
+
d: "M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",
|
|
34
|
+
key: "1xq2db"
|
|
35
|
+
}
|
|
36
|
+
]
|
|
37
|
+
]), pt = {
|
|
38
|
+
key: 0,
|
|
39
|
+
class: "tpl-scoring-panel 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)]"
|
|
40
|
+
}, nt = { class: "tpl:flex tpl:items-center tpl:justify-between tpl:border-b tpl:border-[var(--tpl-border)] tpl:px-4 tpl:py-3" }, at = {
|
|
41
|
+
class: "tpl:flex tpl:items-center tpl:gap-1.5 tpl:text-sm tpl:font-medium",
|
|
42
|
+
style: { color: "var(--tpl-primary)" }
|
|
43
|
+
}, ct = { class: "tpl:flex tpl:items-center tpl:gap-1" }, dt = ["title"], ut = { class: "tpl:flex-1 tpl:overflow-y-auto tpl:p-4" }, vt = {
|
|
44
|
+
key: 0,
|
|
45
|
+
class: "tpl:flex tpl:h-full tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-3 tpl:text-center"
|
|
46
|
+
}, gt = {
|
|
47
|
+
class: "tpl:text-sm",
|
|
48
|
+
style: { color: "var(--tpl-text-muted)" }
|
|
49
|
+
}, xt = {
|
|
50
|
+
key: 1,
|
|
51
|
+
class: "tpl:flex tpl:h-full tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-3 tpl:text-center"
|
|
52
|
+
}, mt = {
|
|
53
|
+
class: "tpl:max-w-[240px] tpl:text-sm",
|
|
54
|
+
style: { color: "var(--tpl-text-muted)" }
|
|
55
|
+
}, ft = {
|
|
56
|
+
key: 2,
|
|
57
|
+
class: "tpl:flex tpl:flex-col tpl:gap-4"
|
|
58
|
+
}, yt = {
|
|
59
|
+
class: "tpl:text-xs tpl:font-medium tpl:uppercase tpl:tracking-wider",
|
|
60
|
+
style: { color: "var(--tpl-text-muted)" }
|
|
61
|
+
}, ht = {
|
|
62
|
+
key: 0,
|
|
63
|
+
class: "tpl:text-xs",
|
|
64
|
+
style: { color: "var(--tpl-text-dim)" }
|
|
65
|
+
}, bt = {
|
|
66
|
+
key: 0,
|
|
67
|
+
class: "tpl:flex tpl:items-start tpl:gap-2 tpl:rounded-lg tpl:px-3 tpl:py-2 tpl:text-xs",
|
|
68
|
+
style: { "background-color": "var(--tpl-danger-light)", color: "var(--tpl-danger)" }
|
|
69
|
+
}, kt = ["onClick"], _t = {
|
|
70
|
+
class: "tpl:flex-1 tpl:text-xs tpl:font-medium",
|
|
71
|
+
style: { color: "var(--tpl-text)" }
|
|
72
|
+
}, wt = {
|
|
73
|
+
key: 0,
|
|
74
|
+
class: "tpl:text-[10px]",
|
|
75
|
+
style: { color: "var(--tpl-text-dim)" }
|
|
76
|
+
}, Ct = {
|
|
77
|
+
key: 0,
|
|
78
|
+
class: "tpl:border-t",
|
|
79
|
+
style: { "border-color": "var(--tpl-border)" }
|
|
80
|
+
}, Rt = {
|
|
81
|
+
key: 0,
|
|
82
|
+
class: "tpl:px-3 tpl:py-3 tpl:text-center tpl:text-xs",
|
|
83
|
+
style: { color: "var(--tpl-text-dim)" }
|
|
84
|
+
}, zt = { class: "tpl:flex tpl:items-start tpl:gap-2" }, St = { class: "tpl:flex-1 tpl:min-w-0" }, It = { class: "tpl:flex tpl:items-start tpl:gap-1.5" }, Ft = {
|
|
85
|
+
class: "tpl:text-xs tpl:leading-snug",
|
|
86
|
+
style: { color: "var(--tpl-text)" }
|
|
87
|
+
}, Tt = {
|
|
88
|
+
key: 0,
|
|
89
|
+
class: "tpl:mt-1 tpl:text-[11px] tpl:leading-snug",
|
|
90
|
+
style: { color: "var(--tpl-text-dim)" }
|
|
91
|
+
}, Bt = {
|
|
92
|
+
key: 1,
|
|
93
|
+
class: "tpl:mt-2 tpl:flex tpl:justify-center"
|
|
94
|
+
}, jt = ["disabled", "onClick"], Lt = {
|
|
95
|
+
key: 3,
|
|
96
|
+
class: "tpl:flex tpl:h-full tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-3 tpl:text-center"
|
|
97
|
+
}, Et = {
|
|
98
|
+
class: "tpl:max-w-[240px] tpl:text-sm",
|
|
99
|
+
style: { color: "var(--tpl-text-muted)" }
|
|
100
|
+
}, Mt = {
|
|
101
|
+
class: "tpl:m-0 tpl:px-4 tpl:pb-2 tpl:pt-2 tpl:text-center tpl:text-[11px]",
|
|
102
|
+
style: { color: "var(--tpl-text-dim)" }
|
|
103
|
+
}, Pt = /* @__PURE__ */ Z({
|
|
104
|
+
__name: "TemplateScoringPanel",
|
|
105
|
+
props: {
|
|
106
|
+
visible: { type: Boolean }
|
|
107
|
+
},
|
|
108
|
+
emits: ["close"],
|
|
109
|
+
setup(k, { emit: P }) {
|
|
110
|
+
const V = k, $ = P, a = f("translations"), x = f("editor"), A = f("authManager"), _ = f("mergeTags", []), l = st({
|
|
111
|
+
authManager: A,
|
|
112
|
+
getTemplateId: () => {
|
|
113
|
+
var e;
|
|
114
|
+
return ((e = x.state.template) == null ? void 0 : e.id) ?? null;
|
|
115
|
+
}
|
|
116
|
+
}), m = G({
|
|
117
|
+
spam: !0,
|
|
118
|
+
readability: !0,
|
|
119
|
+
accessibility: !0,
|
|
120
|
+
bestPractices: !0
|
|
121
|
+
});
|
|
122
|
+
function N(e) {
|
|
123
|
+
m.value[e] = !m.value[e];
|
|
124
|
+
}
|
|
125
|
+
const w = [
|
|
126
|
+
"spam",
|
|
127
|
+
"readability",
|
|
128
|
+
"accessibility",
|
|
129
|
+
"bestPractices"
|
|
130
|
+
], D = {
|
|
131
|
+
spam: ot,
|
|
132
|
+
readability: W,
|
|
133
|
+
accessibility: L,
|
|
134
|
+
bestPractices: it
|
|
135
|
+
};
|
|
136
|
+
function y(e) {
|
|
137
|
+
return e >= 80 ? "var(--tpl-success)" : e >= 60 ? "var(--tpl-warning)" : "var(--tpl-danger)";
|
|
138
|
+
}
|
|
139
|
+
function C(e) {
|
|
140
|
+
return e >= 80 ? "var(--tpl-success-light)" : e >= 60 ? "var(--tpl-warning-light)" : "var(--tpl-danger-light)";
|
|
141
|
+
}
|
|
142
|
+
function R(e) {
|
|
143
|
+
return e === "high" ? "var(--tpl-danger)" : e === "medium" ? "var(--tpl-warning)" : "var(--tpl-text-muted)";
|
|
144
|
+
}
|
|
145
|
+
function X(e) {
|
|
146
|
+
return e === "high" ? "var(--tpl-danger-light)" : e === "medium" ? "var(--tpl-warning-light)" : "var(--tpl-bg-hover)";
|
|
147
|
+
}
|
|
148
|
+
function h() {
|
|
149
|
+
l.score(x.content.value, _);
|
|
150
|
+
}
|
|
151
|
+
H(
|
|
152
|
+
() => V.visible,
|
|
153
|
+
(e) => {
|
|
154
|
+
e && !l.scoringResult.value && !l.isScoring.value && h();
|
|
155
|
+
}
|
|
156
|
+
);
|
|
157
|
+
async function q(e) {
|
|
158
|
+
if (!e.blockId)
|
|
159
|
+
return;
|
|
160
|
+
const c = x.content.value.blocks.find(
|
|
161
|
+
(S) => S.id === e.blockId
|
|
162
|
+
);
|
|
163
|
+
if (!c)
|
|
164
|
+
return;
|
|
165
|
+
const r = c.content;
|
|
166
|
+
if (!r)
|
|
167
|
+
return;
|
|
168
|
+
const o = await l.fixFinding(
|
|
169
|
+
r,
|
|
170
|
+
e,
|
|
171
|
+
_
|
|
172
|
+
);
|
|
173
|
+
o && (x.updateBlock(e.blockId, { content: o }), l.removeFinding(e.category, e.id));
|
|
174
|
+
}
|
|
175
|
+
function z() {
|
|
176
|
+
return l.scoringResult.value ? w.reduce((e, c) => {
|
|
177
|
+
var r, o;
|
|
178
|
+
return e + (((o = (r = l.scoringResult.value) == null ? void 0 : r.categories[c]) == null ? void 0 : o.findings.length) ?? 0);
|
|
179
|
+
}, 0) : 0;
|
|
180
|
+
}
|
|
181
|
+
return (e, c) => (i(), g(J, {
|
|
182
|
+
"enter-active-class": "tpl-scoring-slide-enter-active",
|
|
183
|
+
"enter-from-class": "tpl:translate-x-full",
|
|
184
|
+
"enter-to-class": "tpl:translate-x-0",
|
|
185
|
+
"leave-active-class": "tpl-scoring-slide-leave-active",
|
|
186
|
+
"leave-from-class": "tpl:translate-x-0",
|
|
187
|
+
"leave-to-class": "tpl:translate-x-full"
|
|
188
|
+
}, {
|
|
189
|
+
default: K(() => [
|
|
190
|
+
k.visible ? (i(), n("div", pt, [
|
|
191
|
+
s("div", nt, [
|
|
192
|
+
s("div", at, [
|
|
193
|
+
d(t(E), {
|
|
194
|
+
size: 13,
|
|
195
|
+
"stroke-width": 2
|
|
196
|
+
}),
|
|
197
|
+
s("span", null, p(t(a).scoring.title), 1)
|
|
198
|
+
]),
|
|
199
|
+
s("div", ct, [
|
|
200
|
+
t(l).scoringResult.value && !t(l).isScoring.value ? (i(), n("button", {
|
|
201
|
+
key: 0,
|
|
202
|
+
class: "tpl:rounded-md tpl:p-0.5 tpl:transition-colors tpl:duration-150",
|
|
203
|
+
style: { color: "var(--tpl-text-muted)" },
|
|
204
|
+
title: t(a).scoring.rescore,
|
|
205
|
+
onClick: c[0] || (c[0] = (r) => h())
|
|
206
|
+
}, [
|
|
207
|
+
d(t(j), {
|
|
208
|
+
size: 14,
|
|
209
|
+
"stroke-width": 2
|
|
210
|
+
})
|
|
211
|
+
], 8, dt)) : u("", !0),
|
|
212
|
+
s("button", {
|
|
213
|
+
class: "tpl:rounded-md tpl:p-0.5 tpl:transition-colors tpl:duration-150",
|
|
214
|
+
style: { color: "var(--tpl-text-muted)" },
|
|
215
|
+
onClick: c[1] || (c[1] = (r) => $("close"))
|
|
216
|
+
}, [
|
|
217
|
+
d(t(Q), {
|
|
218
|
+
size: 14,
|
|
219
|
+
"stroke-width": 2
|
|
220
|
+
})
|
|
221
|
+
])
|
|
222
|
+
])
|
|
223
|
+
]),
|
|
224
|
+
s("div", ut, [
|
|
225
|
+
t(l).isScoring.value ? (i(), n("div", vt, [
|
|
226
|
+
s("p", gt, p(t(a).scoring.scoring), 1),
|
|
227
|
+
d(U, { class: "tpl:w-3/4" })
|
|
228
|
+
])) : t(l).error.value && !t(l).scoringResult.value ? (i(), n("div", xt, [
|
|
229
|
+
d(t(b), {
|
|
230
|
+
size: 32,
|
|
231
|
+
"stroke-width": 1.5,
|
|
232
|
+
style: { color: "var(--tpl-danger)" }
|
|
233
|
+
}),
|
|
234
|
+
s("p", mt, p(t(a).scoring.error), 1),
|
|
235
|
+
s("button", {
|
|
236
|
+
class: "tpl:mt-2 tpl:inline-flex tpl:items-center tpl:gap-1.5 tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150",
|
|
237
|
+
style: { "border-color": "var(--tpl-border)", color: "var(--tpl-text-muted)" },
|
|
238
|
+
onClick: c[2] || (c[2] = (r) => h())
|
|
239
|
+
}, [
|
|
240
|
+
d(t(j), {
|
|
241
|
+
size: 12,
|
|
242
|
+
"stroke-width": 2
|
|
243
|
+
}),
|
|
244
|
+
I(" " + p(t(a).scoring.rescore), 1)
|
|
245
|
+
])
|
|
246
|
+
])) : t(l).scoringResult.value ? (i(), n("div", ft, [
|
|
247
|
+
s("div", {
|
|
248
|
+
class: "tpl:flex tpl:flex-col tpl:items-center tpl:gap-2 tpl:rounded-[var(--tpl-radius)] tpl:p-5",
|
|
249
|
+
style: v({
|
|
250
|
+
backgroundColor: C(t(l).scoringResult.value.score)
|
|
251
|
+
})
|
|
252
|
+
}, [
|
|
253
|
+
s("span", {
|
|
254
|
+
class: "tpl:text-4xl tpl:font-bold tpl:tabular-nums",
|
|
255
|
+
style: v({
|
|
256
|
+
color: y(t(l).scoringResult.value.score)
|
|
257
|
+
})
|
|
258
|
+
}, p(t(l).scoringResult.value.score), 5),
|
|
259
|
+
s("span", yt, p(t(a).scoring.overallScore), 1),
|
|
260
|
+
z() > 0 ? (i(), n("span", ht, p(z()) + " " + p(t(a).scoring.findings), 1)) : u("", !0)
|
|
261
|
+
], 4),
|
|
262
|
+
t(l).fixError.value ? (i(), n("div", bt, [
|
|
263
|
+
d(t(b), {
|
|
264
|
+
size: 14,
|
|
265
|
+
"stroke-width": 2,
|
|
266
|
+
class: "tpl:mt-0.5 tpl:shrink-0"
|
|
267
|
+
}),
|
|
268
|
+
s("span", null, p(t(a).scoring.fixError), 1)
|
|
269
|
+
])) : u("", !0),
|
|
270
|
+
(i(), n(F, null, T(w, (r) => s("div", {
|
|
271
|
+
key: r,
|
|
272
|
+
class: "tpl:overflow-hidden tpl:rounded-[var(--tpl-radius)] tpl:border",
|
|
273
|
+
style: { "border-color": "var(--tpl-border)" }
|
|
274
|
+
}, [
|
|
275
|
+
s("button", {
|
|
276
|
+
class: "tpl:flex tpl:w-full tpl:cursor-pointer tpl:items-center tpl:gap-2.5 tpl:px-3 tpl:py-2.5 tpl:text-left tpl:transition-colors tpl:duration-100",
|
|
277
|
+
style: { "background-color": "var(--tpl-bg)" },
|
|
278
|
+
onClick: (o) => N(r)
|
|
279
|
+
}, [
|
|
280
|
+
(i(), g(B(D[r]), {
|
|
281
|
+
size: 14,
|
|
282
|
+
"stroke-width": 2,
|
|
283
|
+
style: v({
|
|
284
|
+
color: y(
|
|
285
|
+
t(l).scoringResult.value.categories[r].score
|
|
286
|
+
)
|
|
287
|
+
})
|
|
288
|
+
}, null, 8, ["style"])),
|
|
289
|
+
s("span", _t, p(t(a).scoring.categories[r]), 1),
|
|
290
|
+
s("span", {
|
|
291
|
+
class: "tpl:rounded-full tpl:px-2 tpl:py-0.5 tpl:text-xs tpl:font-semibold tpl:tabular-nums",
|
|
292
|
+
style: v({
|
|
293
|
+
color: y(
|
|
294
|
+
t(l).scoringResult.value.categories[r].score
|
|
295
|
+
),
|
|
296
|
+
backgroundColor: C(
|
|
297
|
+
t(l).scoringResult.value.categories[r].score
|
|
298
|
+
)
|
|
299
|
+
})
|
|
300
|
+
}, p(t(l).scoringResult.value.categories[r].score), 5),
|
|
301
|
+
t(l).scoringResult.value.categories[r].findings.length > 0 ? (i(), n("span", wt, p(t(l).scoringResult.value.categories[r].findings.length), 1)) : u("", !0),
|
|
302
|
+
d(t(Y), {
|
|
303
|
+
size: 12,
|
|
304
|
+
"stroke-width": 2,
|
|
305
|
+
class: O([
|
|
306
|
+
"tpl:transition-transform tpl:duration-200",
|
|
307
|
+
m.value[r] ? "tpl:rotate-0" : "tpl:-rotate-90"
|
|
308
|
+
]),
|
|
309
|
+
style: { color: "var(--tpl-text-dim)" }
|
|
310
|
+
}, null, 8, ["class"])
|
|
311
|
+
], 8, kt),
|
|
312
|
+
m.value[r] ? (i(), n("div", Ct, [
|
|
313
|
+
t(l).scoringResult.value.categories[r].findings.length === 0 ? (i(), n("div", Rt, p(t(a).scoring.noFindings), 1)) : u("", !0),
|
|
314
|
+
(i(!0), n(F, null, T(t(l).scoringResult.value.categories[r].findings, (o) => (i(), n("div", {
|
|
315
|
+
key: o.id,
|
|
316
|
+
class: "tpl:border-t tpl:px-3 tpl:py-2.5 first:tpl:border-t-0",
|
|
317
|
+
style: { "border-color": "var(--tpl-border-light)" }
|
|
318
|
+
}, [
|
|
319
|
+
s("div", zt, [
|
|
320
|
+
(i(), g(B(
|
|
321
|
+
o.severity === "high" ? t(b) : o.severity === "medium" ? t(tt) : t(et)
|
|
322
|
+
), {
|
|
323
|
+
size: 13,
|
|
324
|
+
"stroke-width": 2,
|
|
325
|
+
class: "tpl:mt-0.5 tpl:shrink-0",
|
|
326
|
+
style: v({
|
|
327
|
+
color: R(o.severity)
|
|
328
|
+
})
|
|
329
|
+
}, null, 8, ["style"])),
|
|
330
|
+
s("div", St, [
|
|
331
|
+
s("div", It, [
|
|
332
|
+
s("span", {
|
|
333
|
+
class: "tpl:mt-0.5 tpl:shrink-0 tpl:rounded tpl:px-1 tpl:py-px tpl:text-[10px] tpl:font-medium tpl:leading-tight",
|
|
334
|
+
style: v({
|
|
335
|
+
color: R(o.severity),
|
|
336
|
+
backgroundColor: X(o.severity)
|
|
337
|
+
})
|
|
338
|
+
}, p(t(a).scoring.severity[o.severity]), 5),
|
|
339
|
+
s("span", Ft, p(o.message), 1)
|
|
340
|
+
]),
|
|
341
|
+
o.suggestion ? (i(), n("p", Tt, p(o.suggestion), 1)) : u("", !0),
|
|
342
|
+
o.blockId ? (i(), n("div", Bt, [
|
|
343
|
+
s("button", {
|
|
344
|
+
class: "tpl-scoring-fix-btn tpl:inline-flex tpl:items-center tpl:gap-1.5 tpl:rounded tpl:border tpl:px-3 tpl:py-1.5 tpl:text-[11px] tpl:font-medium tpl:transition-all tpl:duration-150 tpl:disabled:opacity-50",
|
|
345
|
+
style: { "border-color": "var(--tpl-border)", color: "var(--tpl-primary)", "background-color": "transparent" },
|
|
346
|
+
disabled: t(l).fixingFindingId.value !== null,
|
|
347
|
+
onClick: (S) => q(o)
|
|
348
|
+
}, [
|
|
349
|
+
t(l).fixingFindingId.value === o.id ? (i(), g(t(rt), {
|
|
350
|
+
key: 0,
|
|
351
|
+
class: "tpl-spinner",
|
|
352
|
+
size: 11,
|
|
353
|
+
"stroke-width": 2
|
|
354
|
+
})) : (i(), g(t(L), {
|
|
355
|
+
key: 1,
|
|
356
|
+
size: 11,
|
|
357
|
+
"stroke-width": 2
|
|
358
|
+
})),
|
|
359
|
+
I(" " + p(t(l).fixingFindingId.value === o.id ? t(a).scoring.fixing : t(a).scoring.fix), 1)
|
|
360
|
+
], 8, jt)
|
|
361
|
+
])) : u("", !0)
|
|
362
|
+
])
|
|
363
|
+
])
|
|
364
|
+
]))), 128))
|
|
365
|
+
])) : u("", !0)
|
|
366
|
+
])), 64))
|
|
367
|
+
])) : (i(), n("div", Lt, [
|
|
368
|
+
d(t(E), {
|
|
369
|
+
size: 32,
|
|
370
|
+
"stroke-width": 1.5,
|
|
371
|
+
style: { color: "var(--tpl-text-dim)" }
|
|
372
|
+
}),
|
|
373
|
+
s("p", Et, p(t(a).scoring.emptyState), 1)
|
|
374
|
+
])),
|
|
375
|
+
s("p", Mt, p(t(a).aiMenu.disclaimer), 1)
|
|
376
|
+
])
|
|
377
|
+
])) : u("", !0)
|
|
378
|
+
]),
|
|
379
|
+
_: 1
|
|
380
|
+
}));
|
|
381
|
+
}
|
|
382
|
+
}), Xt = /* @__PURE__ */ lt(Pt, [["__scopeId", "data-v-3532ba3d"]]);
|
|
383
|
+
export {
|
|
384
|
+
Xt as default
|
|
385
|
+
};
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { defineComponent as h, ref as g, watch as k, openBlock as l, createBlock as w, Teleport as E, createVNode as v, Transition as S, withCtx as _, createElementBlock as e, withModifiers as C, createElementVNode as a, toDisplayString as i, unref as r, withDirectives as B, Fragment as V, renderList as L, vModelSelect as N, createCommentVNode as y, normalizeClass as T, createTextVNode as z } from "vue";
|
|
2
|
+
import { u as D } from "./index-D-iD-7lO.js";
|
|
3
|
+
import "@templatical/types";
|
|
4
|
+
import { L as K } from "./loader-circle-tM9j2mRh.js";
|
|
5
|
+
const M = {
|
|
6
|
+
class: "tpl-scale-in tpl:mx-4 tpl:w-full tpl:max-w-sm tpl:rounded-[var(--tpl-radius-lg)] tpl:p-5",
|
|
7
|
+
style: { "background-color": "var(--tpl-bg-elevated)", "box-shadow": "var(--tpl-shadow-xl)" }
|
|
8
|
+
}, j = {
|
|
9
|
+
class: "tpl:mb-4 tpl:text-sm tpl:font-semibold",
|
|
10
|
+
style: { color: "var(--tpl-text)" }
|
|
11
|
+
}, F = { class: "tpl:mb-3" }, I = {
|
|
12
|
+
class: "tpl:mb-1.5 tpl:block tpl:text-sm tpl:font-medium",
|
|
13
|
+
style: { color: "var(--tpl-text-muted)" }
|
|
14
|
+
}, U = ["value"], q = ["disabled"], A = ["value"], G = {
|
|
15
|
+
key: 0,
|
|
16
|
+
class: "tpl:mb-3 tpl:text-xs",
|
|
17
|
+
style: { color: "var(--tpl-danger)" }
|
|
18
|
+
}, H = { class: "tpl:flex tpl:justify-end tpl:gap-2" }, J = ["disabled"], O = ["disabled"], P = {
|
|
19
|
+
key: 0,
|
|
20
|
+
class: "tpl:flex tpl:items-center tpl:gap-1.5"
|
|
21
|
+
}, Q = { key: 1 }, Z = /* @__PURE__ */ h({
|
|
22
|
+
__name: "TestEmailModal",
|
|
23
|
+
props: {
|
|
24
|
+
visible: { type: Boolean },
|
|
25
|
+
allowedEmails: {},
|
|
26
|
+
isSending: { type: Boolean },
|
|
27
|
+
error: {}
|
|
28
|
+
},
|
|
29
|
+
emits: ["send", "close"],
|
|
30
|
+
setup(t, { emit: f }) {
|
|
31
|
+
const d = t, u = f, { t: n } = D(), o = g("");
|
|
32
|
+
k(
|
|
33
|
+
() => d.visible,
|
|
34
|
+
(s) => {
|
|
35
|
+
s && (o.value = d.allowedEmails[0] ?? "");
|
|
36
|
+
}
|
|
37
|
+
);
|
|
38
|
+
function m() {
|
|
39
|
+
!o.value || d.isSending || u("send", o.value);
|
|
40
|
+
}
|
|
41
|
+
function c() {
|
|
42
|
+
d.isSending || u("close");
|
|
43
|
+
}
|
|
44
|
+
function x(s) {
|
|
45
|
+
s.key === "Enter" && !s.shiftKey && (s.preventDefault(), m()), s.key === "Escape" && c();
|
|
46
|
+
}
|
|
47
|
+
return (s, b) => (l(), w(E, { to: "body" }, [
|
|
48
|
+
v(S, {
|
|
49
|
+
"enter-active-class": "tpl:transition tpl:duration-150",
|
|
50
|
+
"enter-from-class": "tpl:opacity-0",
|
|
51
|
+
"enter-to-class": "tpl:opacity-100",
|
|
52
|
+
"leave-active-class": "tpl:transition tpl:duration-100",
|
|
53
|
+
"leave-from-class": "tpl:opacity-100",
|
|
54
|
+
"leave-to-class": "tpl:opacity-0"
|
|
55
|
+
}, {
|
|
56
|
+
default: _(() => [
|
|
57
|
+
t.visible ? (l(), e("div", {
|
|
58
|
+
key: 0,
|
|
59
|
+
class: "tpl tpl:fixed tpl:inset-0 tpl:z-[10000] tpl:flex tpl:items-center tpl:justify-center",
|
|
60
|
+
style: { "background-color": "var(--tpl-overlay)", "backdrop-filter": "blur(8px)", "-webkit-backdrop-filter": "blur(8px)" },
|
|
61
|
+
onClick: C(c, ["self"]),
|
|
62
|
+
onKeydown: x
|
|
63
|
+
}, [
|
|
64
|
+
a("div", M, [
|
|
65
|
+
a("h3", j, i(r(n).testEmail.title), 1),
|
|
66
|
+
a("div", F, [
|
|
67
|
+
a("label", I, i(r(n).testEmail.recipientLabel), 1),
|
|
68
|
+
t.allowedEmails.length === 1 ? (l(), e("input", {
|
|
69
|
+
key: 0,
|
|
70
|
+
type: "text",
|
|
71
|
+
value: o.value,
|
|
72
|
+
disabled: "",
|
|
73
|
+
class: "tpl:h-9 tpl:w-full tpl:rounded-md tpl:border tpl:px-3 tpl:py-1 tpl:text-sm tpl:opacity-70 tpl:shadow-xs tpl:outline-none",
|
|
74
|
+
style: { "border-color": "var(--tpl-border)", "background-color": "var(--tpl-bg)", color: "var(--tpl-text)" }
|
|
75
|
+
}, null, 8, U)) : B((l(), e("select", {
|
|
76
|
+
key: 1,
|
|
77
|
+
"onUpdate:modelValue": b[0] || (b[0] = (p) => o.value = p),
|
|
78
|
+
class: "tpl:h-9 tpl:w-full tpl:rounded-md tpl:border tpl:px-3 tpl:py-1 tpl:text-sm tpl:shadow-xs tpl:outline-none",
|
|
79
|
+
style: { "border-color": "var(--tpl-border)", "background-color": "var(--tpl-bg)", color: "var(--tpl-text)" },
|
|
80
|
+
disabled: t.isSending
|
|
81
|
+
}, [
|
|
82
|
+
(l(!0), e(V, null, L(t.allowedEmails, (p) => (l(), e("option", {
|
|
83
|
+
key: p,
|
|
84
|
+
value: p
|
|
85
|
+
}, i(p), 9, A))), 128))
|
|
86
|
+
], 8, q)), [
|
|
87
|
+
[N, o.value]
|
|
88
|
+
])
|
|
89
|
+
]),
|
|
90
|
+
t.error ? (l(), e("p", G, i(t.error), 1)) : y("", !0),
|
|
91
|
+
a("div", H, [
|
|
92
|
+
a("button", {
|
|
93
|
+
type: "button",
|
|
94
|
+
class: T(["tpl:cursor-pointer tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-sm tpl:font-medium tpl:shadow-xs tpl:transition-all tpl:duration-150", {
|
|
95
|
+
"tpl:cursor-not-allowed tpl:opacity-50": t.isSending
|
|
96
|
+
}]),
|
|
97
|
+
style: { "border-color": "var(--tpl-border)", color: "var(--tpl-text)", "background-color": "var(--tpl-bg)" },
|
|
98
|
+
disabled: t.isSending,
|
|
99
|
+
onClick: c
|
|
100
|
+
}, i(r(n).testEmail.cancel), 11, J),
|
|
101
|
+
a("button", {
|
|
102
|
+
type: "button",
|
|
103
|
+
class: "tpl:cursor-pointer tpl:rounded-md tpl:px-3 tpl:py-1.5 tpl:text-sm tpl:font-medium tpl:shadow-xs tpl:transition-all tpl:duration-150 tpl:hover:opacity-90 tpl:disabled:cursor-not-allowed tpl:disabled:opacity-50",
|
|
104
|
+
style: { "background-color": "var(--tpl-primary)", color: "var(--tpl-bg)" },
|
|
105
|
+
disabled: !o.value || t.isSending,
|
|
106
|
+
onClick: m
|
|
107
|
+
}, [
|
|
108
|
+
t.isSending ? (l(), e("span", P, [
|
|
109
|
+
v(r(K), {
|
|
110
|
+
class: "tpl:animate-spin",
|
|
111
|
+
size: 12,
|
|
112
|
+
"stroke-width": 2
|
|
113
|
+
}),
|
|
114
|
+
z(" " + i(r(n).testEmail.sending), 1)
|
|
115
|
+
])) : (l(), e("span", Q, i(r(n).testEmail.send), 1))
|
|
116
|
+
], 8, O)
|
|
117
|
+
])
|
|
118
|
+
])
|
|
119
|
+
], 32)) : y("", !0)
|
|
120
|
+
]),
|
|
121
|
+
_: 1
|
|
122
|
+
})
|
|
123
|
+
]));
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
export {
|
|
127
|
+
Z as default
|
|
128
|
+
};
|