@aswin.dev/editor 0.6.3 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AccessibilityPanel-CvQGLdu6.js +108 -0
- package/dist/AiChatSidebar-B3SJIKG_.js +229 -0
- package/dist/AiFeatureMenu-BLLKoOos.js +63 -0
- package/dist/BlockA11yBadge-CXDLqkcJ.js +34 -0
- package/dist/CloudEditor-BCz1ZTYC.js +1172 -0
- package/dist/CollaboratorBar-DuPYW5iF.js +95 -0
- package/dist/CommentsSidebar-B1pvJdqF.js +441 -0
- package/dist/CountdownBlock-BNSj1jvJ.js +92 -0
- package/dist/CountdownToolbar-ClJr2GzL.js +210 -0
- package/dist/DesignReferenceSidebar-B8V_F2yF.js +276 -0
- package/dist/LoadingTrack-B0CWFHXQ.js +10 -0
- package/dist/ModuleBrowserModal-DrUFMTDx.js +206 -0
- package/dist/ModulePreviewCanvas-CHdOwV_4.js +106 -0
- package/dist/NumberWithSuffix-DkXUez9t.js +422 -0
- package/dist/ParagraphEditor-D75wl3BX.js +695 -0
- package/dist/RichTextEditorContent-DYkIauIk.js +137 -0
- package/dist/SaveModuleDialog-FZ9lxY7_.js +123 -0
- package/dist/SnapshotHistory-BR3eV120.js +127 -0
- package/dist/TemplateScoringPanel-4GTNHej5.js +256 -0
- package/dist/TestEmailModal--ue5w9fT.js +94 -0
- package/dist/TitleEditor-fStSADI-.js +172 -0
- package/dist/TplModal-BwSfxIHf.js +44 -0
- package/dist/_plugin-vue_export-helper-B0hnzhyu.js +8 -0
- package/dist/accessibility-e8JYu_zd.js +27 -0
- package/dist/blockTypeIcons-BcTrDjmH.js +126 -0
- package/dist/bundle-stats.json +10 -0
- package/dist/cdn/chunks/AccessibilityPanel-B6DOjojm.js +97 -0
- package/dist/cdn/chunks/AccessibilityPanel-B6DOjojm.js.map +1 -0
- package/dist/cdn/chunks/AiFeatureMenu-qEdB2fZJ.js +59 -0
- package/dist/cdn/chunks/AiFeatureMenu-qEdB2fZJ.js.map +1 -0
- package/dist/cdn/chunks/BlockA11yBadge-DcEZftf6.js +33 -0
- package/dist/cdn/chunks/BlockA11yBadge-DcEZftf6.js.map +1 -0
- package/dist/cdn/chunks/CloudEditor-D2GsEC_n.js +1143 -0
- package/dist/cdn/chunks/CloudEditor-D2GsEC_n.js.map +1 -0
- package/dist/cdn/chunks/CollaboratorBar--nO7TX6b.js +51 -0
- package/dist/cdn/chunks/CollaboratorBar--nO7TX6b.js.map +1 -0
- package/dist/cdn/chunks/CountdownBlock-5YdT1uUu.js +93 -0
- package/dist/cdn/chunks/CountdownBlock-5YdT1uUu.js.map +1 -0
- package/dist/cdn/chunks/CountdownToolbar-DXPXrbAA.js +212 -0
- package/dist/cdn/chunks/CountdownToolbar-DXPXrbAA.js.map +1 -0
- package/dist/cdn/chunks/ModuleBrowserModal-DxoPp81s.js +195 -0
- package/dist/cdn/chunks/ModuleBrowserModal-DxoPp81s.js.map +1 -0
- package/dist/cdn/chunks/ModulePreviewCanvas-CoLdb4ar.js +107 -0
- package/dist/cdn/chunks/ModulePreviewCanvas-CoLdb4ar.js.map +1 -0
- package/dist/cdn/chunks/NumberWithSuffix-CE3NrZhH.js +423 -0
- package/dist/cdn/chunks/NumberWithSuffix-CE3NrZhH.js.map +1 -0
- package/dist/cdn/chunks/ParagraphEditor-B6Ygu-Mq.js +544 -0
- package/dist/cdn/chunks/ParagraphEditor-B6Ygu-Mq.js.map +1 -0
- package/dist/cdn/chunks/RichTextEditorContent-DL_y2SrR.js +106 -0
- package/dist/cdn/chunks/RichTextEditorContent-DL_y2SrR.js.map +1 -0
- package/dist/cdn/chunks/SaveModuleDialog-B0TnO_o9.js +119 -0
- package/dist/cdn/chunks/SaveModuleDialog-B0TnO_o9.js.map +1 -0
- package/dist/cdn/chunks/TitleEditor-BHpfxvwy.js +171 -0
- package/dist/cdn/chunks/TitleEditor-BHpfxvwy.js.map +1 -0
- package/dist/cdn/chunks/blockTypeIcons-BzzY9_kA.js +22 -0
- package/dist/cdn/chunks/blockTypeIcons-BzzY9_kA.js.map +1 -0
- package/dist/cdn/chunks/de-Ce-LbJ2J.js +89 -0
- package/dist/cdn/chunks/de-Ce-LbJ2J.js.map +1 -0
- package/dist/cdn/chunks/de-D8CnZxV9.js +523 -0
- package/dist/cdn/chunks/de-D8CnZxV9.js.map +1 -0
- package/dist/cdn/chunks/de-RQrZR56a.js +209 -0
- package/dist/cdn/chunks/de-RQrZR56a.js.map +1 -0
- package/dist/cdn/chunks/draggable-Bcb86AsV.js +11572 -0
- package/dist/cdn/chunks/draggable-Bcb86AsV.js.map +1 -0
- package/dist/cdn/chunks/emojiData-EMFlj6FJ.js +19 -0
- package/dist/cdn/chunks/emojiData-EMFlj6FJ.js.map +1 -0
- package/dist/cdn/chunks/en-8FHaQv4V.js +523 -0
- package/dist/cdn/chunks/en-8FHaQv4V.js.map +1 -0
- package/dist/cdn/chunks/en-Bl1ecfRF.js +209 -0
- package/dist/cdn/chunks/en-Bl1ecfRF.js.map +1 -0
- package/dist/cdn/chunks/en-DiCWK5fG.js +89 -0
- package/dist/cdn/chunks/en-DiCWK5fG.js.map +1 -0
- package/dist/cdn/chunks/extensions-DIxF31tA.js +598 -0
- package/dist/cdn/chunks/extensions-DIxF31tA.js.map +1 -0
- package/dist/cdn/chunks/features-DEMb13KS.js +6814 -0
- package/dist/cdn/chunks/features-DEMb13KS.js.map +1 -0
- package/dist/cdn/chunks/icons-CsLTcirh.js +700 -0
- package/dist/cdn/chunks/icons-CsLTcirh.js.map +1 -0
- package/dist/cdn/chunks/liquid.browser-lQbkge2E.js +3279 -0
- package/dist/cdn/chunks/liquid.browser-lQbkge2E.js.map +1 -0
- package/dist/cdn/chunks/media-library-CVaNvhpM.js +6014 -0
- package/dist/cdn/chunks/media-library-CVaNvhpM.js.map +1 -0
- package/dist/cdn/chunks/pusher-CDbNlZBE.js +2508 -0
- package/dist/cdn/chunks/pusher-CDbNlZBE.js.map +1 -0
- package/dist/cdn/chunks/quality-BaBfc54_.js +1456 -0
- package/dist/cdn/chunks/quality-BaBfc54_.js.map +1 -0
- package/dist/cdn/chunks/readableTextColor-DhoK4XiZ.js +32 -0
- package/dist/cdn/chunks/readableTextColor-DhoK4XiZ.js.map +1 -0
- package/dist/cdn/chunks/renderer-CUxvx7ro.js +548 -0
- package/dist/cdn/chunks/renderer-CUxvx7ro.js.map +1 -0
- package/dist/cdn/chunks/rolldown-runtime-BNuo_Jkg.js +20 -0
- package/dist/cdn/chunks/src-CRaqN-p8.js +497 -0
- package/dist/cdn/chunks/src-CRaqN-p8.js.map +1 -0
- package/dist/cdn/chunks/styleConstants-DP1VOca8.js +57 -0
- package/dist/cdn/chunks/styleConstants-DP1VOca8.js.map +1 -0
- package/dist/cdn/chunks/styles-BHJULjNR.js +2947 -0
- package/dist/cdn/chunks/styles-BHJULjNR.js.map +1 -0
- package/dist/cdn/chunks/tiptap-ZhwKyFp7.js +14654 -0
- package/dist/cdn/chunks/tiptap-ZhwKyFp7.js.map +1 -0
- package/dist/cdn/editor.css +2 -0
- package/dist/cdn/editor.js +250 -0
- package/dist/cdn/editor.js.map +1 -0
- package/dist/check-Da05j8yl.js +7 -0
- package/dist/chevron-down-R2uY34iD.js +7 -0
- package/dist/circle-alert-DZuGWPX-.js +25 -0
- package/dist/clock-CRp2sIub.js +12 -0
- package/dist/cloud-DEk_b4CR.js +1733 -0
- package/dist/createLucideIcon-C3pa2siy.js +43 -0
- package/dist/de-Brqvgr43.js +521 -0
- package/dist/de-DCaaCE5s.js +207 -0
- package/dist/dist-B1IR0bpH.js +326 -0
- package/dist/dist-BFawx6IS.js +519 -0
- package/dist/dist-BaQIYPsn.js +35 -0
- package/dist/dist-Cp0zXPAD.js +189 -0
- package/dist/dist-D6uC2xhi.js +5 -0
- package/dist/dist-D90y8dvT.js +2082 -0
- package/dist/dist-DDJIWTRY.js +776 -0
- package/dist/dist-DJmnUmW9.js +362 -0
- package/dist/dist-DjviJBCi.js +74 -0
- package/dist/dist-KoBJjK1G.js +61 -0
- package/dist/dist-aRzjfSRN.js +35 -0
- package/dist/dist-iLBdeBDR.js +10658 -0
- package/dist/dist-us-RpCWN.js +47 -0
- package/dist/dist-wzMIGj-D.js +5 -0
- package/dist/emojiData-PQyVa4bU.js +17 -0
- package/dist/en-DXCyK4-X.js +207 -0
- package/dist/en-WDVp87TE.js +521 -0
- package/dist/extensions-CUcl9Ok4.js +799 -0
- package/dist/formatRelativeTime-BOEf47hq.js +12 -0
- package/dist/image-up-MBZKKg9p.js +23 -0
- package/dist/index.d.ts +275 -0
- package/dist/info-CJEC7piy.js +19 -0
- package/dist/keys-ciNfSSGj.js +10 -0
- package/dist/liquid.browser-CdMv1BTn.js +3277 -0
- package/dist/loader-circle-DsY5Yg33.js +7 -0
- package/dist/message-circle-yElBbR2C.js +7 -0
- package/dist/readableTextColor-CY3SiRnt.js +30 -0
- package/dist/refresh-cw-CE_AGtn8.js +29 -0
- package/dist/rolldown-runtime-BZGGJVDF.js +20 -0
- package/dist/scan-line-D0vcUekt.js +25 -0
- package/dist/send-DH4oDQqC.js +10 -0
- package/dist/shield-check-CfJgs2Hd.js +10 -0
- package/dist/sparkles-CvRXGqFs.js +23 -0
- package/dist/style.css +2 -0
- package/dist/styleConstants-fWzlIIwN.js +55 -0
- package/dist/styles-DEXEkBvg.js +3176 -0
- package/dist/templatical-editor.js +249 -0
- package/dist/text-align-start-BT9VUDxK.js +43 -0
- package/dist/timeouts-BSGxjuUF.js +4 -0
- package/dist/trash-2-DbP2Y6t2.js +25 -0
- package/dist/triangle-alert-aOXceTSe.js +17 -0
- package/dist/useCloudI18n-BuIwR6OE.js +23 -0
- package/dist/useEditorCore-C6ost42Q.js +9342 -0
- package/dist/useI18n-lb2DHDiu.js +17 -0
- package/dist/useMergeTag-CBwKnnNB.js +34 -0
- package/dist/vue.runtime.esm-bundler-DpvJL-nX.js +5775 -0
- package/dist/x-u2oVmjN_.js +10 -0
- package/package.json +1 -1
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { D as e, E as t, H as n, L as r, M as i, Mt as a, Ot as o, R as s, S as c, _ as l, b as u, f as d, g as f, h as p, it as m, m as h, s as g, u as _, y as v } from "./vue.runtime.esm-bundler-DpvJL-nX.js";
|
|
2
|
+
import { D as y, T as b } from "./keys-ciNfSSGj.js";
|
|
3
|
+
import { t as x } from "./useI18n-lb2DHDiu.js";
|
|
4
|
+
import { t as S } from "./createLucideIcon-C3pa2siy.js";
|
|
5
|
+
import { t as C } from "./x-u2oVmjN_.js";
|
|
6
|
+
var w = S("bold", [["path", {
|
|
7
|
+
d: "M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8",
|
|
8
|
+
key: "mg9rjx"
|
|
9
|
+
}]]), T = S("italic", [
|
|
10
|
+
["line", {
|
|
11
|
+
x1: "19",
|
|
12
|
+
x2: "10",
|
|
13
|
+
y1: "4",
|
|
14
|
+
y2: "4",
|
|
15
|
+
key: "15jd3p"
|
|
16
|
+
}],
|
|
17
|
+
["line", {
|
|
18
|
+
x1: "14",
|
|
19
|
+
x2: "5",
|
|
20
|
+
y1: "20",
|
|
21
|
+
y2: "20",
|
|
22
|
+
key: "bu0au3"
|
|
23
|
+
}],
|
|
24
|
+
["line", {
|
|
25
|
+
x1: "15",
|
|
26
|
+
x2: "9",
|
|
27
|
+
y1: "4",
|
|
28
|
+
y2: "20",
|
|
29
|
+
key: "uljnxc"
|
|
30
|
+
}]
|
|
31
|
+
]), E = S("link", [["path", {
|
|
32
|
+
d: "M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",
|
|
33
|
+
key: "1cjeqo"
|
|
34
|
+
}], ["path", {
|
|
35
|
+
d: "M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",
|
|
36
|
+
key: "19qd67"
|
|
37
|
+
}]]), D = ["data-tpl-theme"], O = { class: "tpl:flex tpl:items-center tpl:justify-between tpl:border-b tpl:border-[var(--tpl-border)] tpl:px-5 tpl:py-4" }, k = {
|
|
38
|
+
id: "tpl-link-dialog-title",
|
|
39
|
+
class: "tpl:m-0 tpl:text-sm tpl:font-semibold tpl:text-[var(--tpl-text)]"
|
|
40
|
+
}, A = ["aria-label"], j = { class: "tpl:p-5" }, M = { class: "tpl:mb-4 tpl:last:mb-0" }, N = {
|
|
41
|
+
for: "tpl-link-dialog-url",
|
|
42
|
+
class: "tpl:mb-1.5 tpl:block tpl:text-xs tpl:font-medium tpl:tracking-wide tpl:text-[var(--tpl-text-muted)] tpl:uppercase"
|
|
43
|
+
}, P = ["placeholder"], F = { class: "tpl:flex tpl:items-center tpl:justify-between tpl:border-t tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-elevated)] tpl:px-5 tpl:py-4" }, I = { class: "tpl:ml-auto tpl:flex tpl:gap-2" }, L = /* @__PURE__ */ c({
|
|
44
|
+
__name: "RichTextLinkDialog",
|
|
45
|
+
props: /* @__PURE__ */ e({
|
|
46
|
+
visible: { type: Boolean },
|
|
47
|
+
isEditingLink: { type: Boolean }
|
|
48
|
+
}, {
|
|
49
|
+
linkUrl: { required: !0 },
|
|
50
|
+
linkUrlModifiers: {},
|
|
51
|
+
dialogRef: { required: !0 },
|
|
52
|
+
dialogRefModifiers: {}
|
|
53
|
+
}),
|
|
54
|
+
emits: /* @__PURE__ */ e([
|
|
55
|
+
"close",
|
|
56
|
+
"insert",
|
|
57
|
+
"remove",
|
|
58
|
+
"keydown"
|
|
59
|
+
], ["update:linkUrl", "update:dialogRef"]),
|
|
60
|
+
setup(e, { emit: r }) {
|
|
61
|
+
let c = s(e, "linkUrl"), v = s(e, "dialogRef"), S = r, w = t(b, null), T = t(y, null), { t: E } = x();
|
|
62
|
+
return (t, r) => (i(), p(d, { to: "body" }, [e.visible ? (i(), l("div", {
|
|
63
|
+
key: 0,
|
|
64
|
+
"data-tpl-theme": m(T),
|
|
65
|
+
class: "tpl tpl-link-dialog tpl:fixed tpl:inset-0 tpl:z-modal tpl:flex tpl:items-center tpl:justify-center",
|
|
66
|
+
style: o(m(w)),
|
|
67
|
+
onClick: r[6] ||= _((e) => S("close"), ["self"])
|
|
68
|
+
}, [h("div", {
|
|
69
|
+
ref: (e) => v.value = e,
|
|
70
|
+
role: "dialog",
|
|
71
|
+
"aria-modal": "true",
|
|
72
|
+
"aria-labelledby": "tpl-link-dialog-title",
|
|
73
|
+
class: "tpl:w-[400px] tpl:overflow-hidden tpl:rounded-lg tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:shadow-lg"
|
|
74
|
+
}, [
|
|
75
|
+
h("div", O, [h("h4", k, a(e.isEditingLink ? m(E).linkDialog.editLink : m(E).linkDialog.insertLink), 1), h("button", {
|
|
76
|
+
type: "button",
|
|
77
|
+
"aria-label": m(E).linkDialog.cancel,
|
|
78
|
+
class: "tpl:flex tpl:size-7 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded tpl:border-none tpl:bg-transparent tpl:p-0 tpl:text-[var(--tpl-text-muted)] tpl:hover:bg-[var(--tpl-bg-hover)] tpl:hover:text-[var(--tpl-text)]",
|
|
79
|
+
onClick: r[0] ||= (e) => S("close")
|
|
80
|
+
}, [u(m(C), {
|
|
81
|
+
size: 16,
|
|
82
|
+
"stroke-width": 2
|
|
83
|
+
})], 8, A)]),
|
|
84
|
+
h("div", j, [h("div", M, [h("label", N, a(m(E).linkDialog.urlLabel), 1), n(h("input", {
|
|
85
|
+
id: "tpl-link-dialog-url",
|
|
86
|
+
"onUpdate:modelValue": r[1] ||= (e) => c.value = e,
|
|
87
|
+
type: "url",
|
|
88
|
+
class: "tpl:w-full tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:px-3 tpl:py-2.5 tpl:text-sm tpl:text-[var(--tpl-text)] tpl:transition-all tpl:duration-150 tpl:outline-none tpl:placeholder:text-[var(--tpl-text-dim)] tpl:focus:border-[var(--tpl-primary)] tpl:focus:shadow-[0_0_0_3px_var(--tpl-primary-light)]",
|
|
89
|
+
placeholder: m(E).linkDialog.urlPlaceholder,
|
|
90
|
+
autofocus: "",
|
|
91
|
+
onKeydown: r[2] ||= (e) => S("keydown", e)
|
|
92
|
+
}, null, 40, P), [[g, c.value]])])]),
|
|
93
|
+
h("div", F, [e.isEditingLink ? (i(), l("button", {
|
|
94
|
+
key: 0,
|
|
95
|
+
type: "button",
|
|
96
|
+
class: "tpl:inline-flex tpl:cursor-pointer tpl:items-center tpl:rounded-md tpl:border tpl:border-[var(--tpl-danger)] tpl:bg-transparent tpl:px-4 tpl:py-2 tpl:text-[13px] tpl:font-medium tpl:text-[var(--tpl-danger)] tpl:transition-all tpl:duration-150 tpl:hover:bg-[var(--tpl-danger-light)]",
|
|
97
|
+
onClick: r[3] ||= (e) => S("remove")
|
|
98
|
+
}, a(m(E).linkDialog.removeLink), 1)) : f("", !0), h("div", I, [h("button", {
|
|
99
|
+
type: "button",
|
|
100
|
+
class: "tpl:inline-flex tpl:cursor-pointer tpl:items-center tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-transparent tpl:px-4 tpl:py-2 tpl:text-[13px] tpl:font-medium tpl:text-[var(--tpl-text-muted)] tpl:transition-all tpl:duration-150 tpl:hover:bg-[var(--tpl-bg-hover)] tpl:hover:text-[var(--tpl-text)]",
|
|
101
|
+
onClick: r[4] ||= (e) => S("close")
|
|
102
|
+
}, a(m(E).linkDialog.cancel), 1), h("button", {
|
|
103
|
+
type: "button",
|
|
104
|
+
class: "tpl:inline-flex tpl:cursor-pointer tpl:items-center tpl:rounded-md tpl:border-none tpl:bg-[var(--tpl-primary)] tpl:px-4 tpl:py-2 tpl:text-[13px] tpl:font-medium tpl:transition-all tpl:duration-150 tpl:hover:bg-[var(--tpl-primary-hover)] tpl:text-[var(--tpl-bg)]",
|
|
105
|
+
onClick: r[5] ||= (e) => S("insert")
|
|
106
|
+
}, a(e.isEditingLink ? m(E).linkDialog.updateLink : m(E).linkDialog.insertLink), 1)])])
|
|
107
|
+
], 512)], 12, D)) : f("", !0)]));
|
|
108
|
+
}
|
|
109
|
+
}), R = {
|
|
110
|
+
key: 0,
|
|
111
|
+
class: "tpl-text-editable tpl:min-h-[1.5em] tpl:rounded tpl:border tpl:border-dashed tpl:border-[var(--tpl-primary)] tpl:p-2"
|
|
112
|
+
}, z = { class: "tpl:animate-pulse tpl:text-[var(--tpl-text-dim)]" }, B = {
|
|
113
|
+
key: 1,
|
|
114
|
+
class: "tpl-text-editable tpl:min-h-[1.5em] tpl:rounded tpl:border tpl:border-dashed tpl:p-2 tpl:text-center tpl:text-xs tpl:border-[var(--tpl-danger)] tpl:text-[var(--tpl-text-muted)]"
|
|
115
|
+
}, V = /* @__PURE__ */ c({
|
|
116
|
+
__name: "RichTextEditorContent",
|
|
117
|
+
props: {
|
|
118
|
+
editor: {},
|
|
119
|
+
editorContent: {},
|
|
120
|
+
isLoading: { type: Boolean },
|
|
121
|
+
initError: {}
|
|
122
|
+
},
|
|
123
|
+
emits: ["retry"],
|
|
124
|
+
setup(e, { emit: t }) {
|
|
125
|
+
let n = t, { t: o } = x();
|
|
126
|
+
return (t, s) => e.isLoading ? (i(), l("div", R, [h("div", z, a(m(o).errors.editorLoading), 1)])) : e.initError ? (i(), l("div", B, [v(a(m(o).errors.editorLoadFailed) + " ", 1), h("button", {
|
|
127
|
+
class: "tpl:ml-1 tpl:cursor-pointer tpl:border-none tpl:bg-transparent tpl:p-0 tpl:underline tpl:text-[var(--tpl-primary)]",
|
|
128
|
+
onClick: s[0] ||= (e) => n("retry")
|
|
129
|
+
}, a(m(o).errors.retry), 1)])) : e.editorContent && e.editor ? (i(), p(r(e.editorContent), {
|
|
130
|
+
key: 2,
|
|
131
|
+
editor: e.editor,
|
|
132
|
+
class: "tpl-text-editable tpl:min-h-[1.5em] tpl:rounded tpl:border tpl:border-dashed tpl:border-[var(--tpl-primary)] tpl:p-2"
|
|
133
|
+
}, null, 8, ["editor"])) : f("", !0);
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
//#endregion
|
|
137
|
+
export { w as a, T as i, L as n, E as r, V as t };
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { Dt as e, H as t, M as n, Mt as r, Ot as i, P as a, Q as o, S as s, V as c, _ as l, b as u, d, g as f, h as p, it as m, m as h, p as g, s as _, y as v, z as y } from "./vue.runtime.esm-bundler-DpvJL-nX.js";
|
|
2
|
+
import "./useEditorCore-C6ost42Q.js";
|
|
3
|
+
import { C as b, O as x, m as S } from "./keys-ciNfSSGj.js";
|
|
4
|
+
import { t as ee } from "./useI18n-lb2DHDiu.js";
|
|
5
|
+
import { t as te } from "./loader-circle-DsY5Yg33.js";
|
|
6
|
+
import { n as ne } from "./useCloudI18n-BuIwR6OE.js";
|
|
7
|
+
import { t as C } from "./TplModal-BwSfxIHf.js";
|
|
8
|
+
//#region src/cloud/components/SaveModuleDialog.vue?vue&type=script&setup=true&lang.ts
|
|
9
|
+
var w = ["aria-busy"], T = {
|
|
10
|
+
id: "tpl-save-module-title",
|
|
11
|
+
class: "tpl:mb-4 tpl:text-sm tpl:font-semibold tpl:text-[var(--tpl-text)]"
|
|
12
|
+
}, E = { class: "tpl:mb-3" }, D = { class: "tpl:mb-1.5 tpl:block tpl:text-sm tpl:font-medium tpl:text-[var(--tpl-text-muted)]" }, O = ["placeholder", "disabled"], k = { class: "tpl:mb-3" }, A = { class: "tpl:mb-1.5 tpl:block tpl:text-sm tpl:font-medium tpl:text-[var(--tpl-text-muted)]" }, j = { class: "tpl:max-h-40 tpl:space-y-1 tpl:overflow-y-auto tpl:rounded-md tpl:border tpl:p-2 tpl:border-[var(--tpl-border)]" }, M = [
|
|
13
|
+
"checked",
|
|
14
|
+
"disabled",
|
|
15
|
+
"onChange"
|
|
16
|
+
], N = {
|
|
17
|
+
key: 0,
|
|
18
|
+
role: "alert",
|
|
19
|
+
class: "tpl:mb-3 tpl:text-xs tpl:text-[var(--tpl-danger)]"
|
|
20
|
+
}, P = { class: "tpl:flex tpl:justify-end tpl:gap-2" }, F = ["disabled"], I = ["disabled"], L = {
|
|
21
|
+
key: 0,
|
|
22
|
+
class: "tpl:flex tpl:items-center tpl:gap-1.5"
|
|
23
|
+
}, re = { key: 1 }, R = /* @__PURE__ */ s({
|
|
24
|
+
__name: "SaveModuleDialog",
|
|
25
|
+
props: {
|
|
26
|
+
visible: { type: Boolean },
|
|
27
|
+
preSelectedBlockId: {}
|
|
28
|
+
},
|
|
29
|
+
emits: ["close", "saved"],
|
|
30
|
+
setup(s, { emit: R }) {
|
|
31
|
+
let z = s, B = R, { t: V } = ee(), { t: H } = ne(), U = x(S, "SaveModuleDialog"), W = x(b, "SaveModuleDialog"), G = o(""), K = o(/* @__PURE__ */ new Set()), q = o(!1), J = o(null), Y = g(() => U.content.value.blocks);
|
|
32
|
+
function X(e, t) {
|
|
33
|
+
let n = e.type;
|
|
34
|
+
return `${V.blocks[n] ?? e.type} ${t + 1}`;
|
|
35
|
+
}
|
|
36
|
+
y(() => z.visible, (e) => {
|
|
37
|
+
e && (G.value = "", J.value = null, K.value = new Set(z.preSelectedBlockId ? [z.preSelectedBlockId] : []));
|
|
38
|
+
});
|
|
39
|
+
function ie(e) {
|
|
40
|
+
let t = new Set(K.value);
|
|
41
|
+
t.has(e) ? t.delete(e) : t.add(e), K.value = t;
|
|
42
|
+
}
|
|
43
|
+
let Z = g(() => G.value.trim().length > 0 && K.value.size > 0 && !q.value);
|
|
44
|
+
async function Q() {
|
|
45
|
+
if (Z.value) {
|
|
46
|
+
q.value = !0, J.value = null;
|
|
47
|
+
try {
|
|
48
|
+
let e = Y.value.filter((e) => K.value.has(e.id));
|
|
49
|
+
await W.createModule(G.value.trim(), e), B("saved"), B("close");
|
|
50
|
+
} catch (e) {
|
|
51
|
+
J.value = e.message;
|
|
52
|
+
} finally {
|
|
53
|
+
q.value = !1;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
function $() {
|
|
58
|
+
q.value || B("close");
|
|
59
|
+
}
|
|
60
|
+
function ae(e) {
|
|
61
|
+
e.key === "Enter" && !e.shiftKey && (e.preventDefault(), Q()), e.key === "Escape" && $();
|
|
62
|
+
}
|
|
63
|
+
return (o, g) => (n(), p(C, {
|
|
64
|
+
visible: s.visible,
|
|
65
|
+
onClose: $,
|
|
66
|
+
onKeydown: ae
|
|
67
|
+
}, {
|
|
68
|
+
default: c(() => [h("div", {
|
|
69
|
+
role: "dialog",
|
|
70
|
+
"aria-modal": "true",
|
|
71
|
+
"aria-busy": q.value,
|
|
72
|
+
"aria-labelledby": "tpl-save-module-title",
|
|
73
|
+
class: "tpl-scale-in tpl:mx-4 tpl:w-full tpl:max-w-sm tpl:rounded-[var(--tpl-radius-lg)] tpl:p-5",
|
|
74
|
+
style: {
|
|
75
|
+
"background-color": "var(--tpl-bg-elevated)",
|
|
76
|
+
"box-shadow": "var(--tpl-shadow-xl)"
|
|
77
|
+
}
|
|
78
|
+
}, [
|
|
79
|
+
h("h3", T, r(m(H).modules.saveAsModule), 1),
|
|
80
|
+
h("div", E, [h("label", D, r(m(H).modules.moduleName), 1), t(h("input", {
|
|
81
|
+
"onUpdate:modelValue": g[0] ||= (e) => G.value = e,
|
|
82
|
+
type: "text",
|
|
83
|
+
placeholder: m(H).modules.moduleNamePlaceholder,
|
|
84
|
+
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 tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:text-[var(--tpl-text)]",
|
|
85
|
+
disabled: q.value
|
|
86
|
+
}, null, 8, O), [[_, G.value]])]),
|
|
87
|
+
h("div", k, [h("label", A, r(m(H).modules.selectBlocks), 1), h("div", j, [(n(!0), l(d, null, a(Y.value, (e, t) => (n(), l("label", {
|
|
88
|
+
key: e.id,
|
|
89
|
+
class: "tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-2 tpl:rounded-sm tpl:px-2 tpl:py-1.5 tpl:text-sm tpl:transition-colors tpl:duration-100",
|
|
90
|
+
style: i({
|
|
91
|
+
color: "var(--tpl-text)",
|
|
92
|
+
backgroundColor: K.value.has(e.id) ? "var(--tpl-primary-light)" : "transparent"
|
|
93
|
+
})
|
|
94
|
+
}, [h("input", {
|
|
95
|
+
type: "checkbox",
|
|
96
|
+
checked: K.value.has(e.id),
|
|
97
|
+
class: "tpl:accent-[var(--tpl-primary)]",
|
|
98
|
+
disabled: q.value,
|
|
99
|
+
onChange: (t) => ie(e.id)
|
|
100
|
+
}, null, 40, M), v(" " + r(X(e, t)), 1)], 4))), 128))])]),
|
|
101
|
+
J.value ? (n(), l("p", N, r(J.value), 1)) : f("", !0),
|
|
102
|
+
h("div", P, [h("button", {
|
|
103
|
+
type: "button",
|
|
104
|
+
class: e(["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 tpl:border-[var(--tpl-border)] tpl:text-[var(--tpl-text)] tpl:bg-[var(--tpl-bg)]", { "tpl:cursor-not-allowed tpl:opacity-50": q.value }]),
|
|
105
|
+
disabled: q.value,
|
|
106
|
+
onClick: $
|
|
107
|
+
}, r(m(H).modules.cancel), 11, F), h("button", {
|
|
108
|
+
type: "button",
|
|
109
|
+
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 tpl:bg-[var(--tpl-primary)] tpl:text-[var(--tpl-bg)]",
|
|
110
|
+
disabled: !Z.value,
|
|
111
|
+
onClick: Q
|
|
112
|
+
}, [q.value ? (n(), l("span", L, [u(m(te), {
|
|
113
|
+
class: "tpl:animate-spin",
|
|
114
|
+
size: 12,
|
|
115
|
+
"stroke-width": 2
|
|
116
|
+
}), v(" " + r(m(H).modules.saving), 1)])) : (n(), l("span", re, r(m(H).modules.save), 1))], 8, I)])
|
|
117
|
+
], 8, w)]),
|
|
118
|
+
_: 1
|
|
119
|
+
}, 8, ["visible"]));
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
//#endregion
|
|
123
|
+
export { R as default };
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { Dt as e, M as t, Mt as n, P as r, Q as i, S as a, V as o, _ as s, b as c, d as l, g as u, it as d, m as f, p, t as m, u as h, z as g } from "./vue.runtime.esm-bundler-DpvJL-nX.js";
|
|
2
|
+
import "./useEditorCore-C6ost42Q.js";
|
|
3
|
+
import { t as _ } from "./dist-B1IR0bpH.js";
|
|
4
|
+
import { t as v } from "./useI18n-lb2DHDiu.js";
|
|
5
|
+
import { t as y } from "./createLucideIcon-C3pa2siy.js";
|
|
6
|
+
import { t as b } from "./chevron-down-R2uY34iD.js";
|
|
7
|
+
import { t as x } from "./clock-CRp2sIub.js";
|
|
8
|
+
import { t as S } from "./loader-circle-DsY5Yg33.js";
|
|
9
|
+
import { n as C } from "./useCloudI18n-BuIwR6OE.js";
|
|
10
|
+
import { t as w } from "./formatRelativeTime-BOEf47hq.js";
|
|
11
|
+
var T = y("chevron-left", [["path", {
|
|
12
|
+
d: "m15 18-6-6 6-6",
|
|
13
|
+
key: "1wnfg3"
|
|
14
|
+
}]]), E = y("chevron-right", [["path", {
|
|
15
|
+
d: "m9 18 6-6-6-6",
|
|
16
|
+
key: "mthhwq"
|
|
17
|
+
}]]), D = ["disabled", "title"], O = ["title"], k = {
|
|
18
|
+
key: 0,
|
|
19
|
+
class: "tpl-scale-in tpl:absolute tpl:top-full tpl:left-1/2 tpl:z-50 tpl:mt-2 tpl:w-72 tpl:-translate-x-1/2 tpl:overflow-hidden tpl:rounded-[var(--tpl-radius)] tpl:bg-[var(--tpl-bg-elevated)] tpl:border tpl:border-[var(--tpl-border)] tpl:shadow-[var(--tpl-shadow-lg)]",
|
|
20
|
+
style: {
|
|
21
|
+
"backdrop-filter": "blur(8px)",
|
|
22
|
+
"-webkit-backdrop-filter": "blur(8px)"
|
|
23
|
+
}
|
|
24
|
+
}, A = { class: "tpl:border-b tpl:px-3 tpl:py-2 tpl:text-xs tpl:font-semibold tpl:text-[var(--tpl-text)] tpl:border-[var(--tpl-border)]" }, j = {
|
|
25
|
+
key: 0,
|
|
26
|
+
class: "tpl:flex tpl:items-center tpl:justify-center tpl:py-8"
|
|
27
|
+
}, M = {
|
|
28
|
+
key: 1,
|
|
29
|
+
class: "tpl:px-3 tpl:py-6 tpl:text-center tpl:text-xs tpl:text-[var(--tpl-text-muted)]"
|
|
30
|
+
}, N = {
|
|
31
|
+
key: 2,
|
|
32
|
+
class: "tpl:max-h-64 tpl:overflow-y-auto"
|
|
33
|
+
}, P = ["disabled", "onClick"], F = { class: "tpl:flex tpl:flex-col tpl:gap-0.5" }, I = { class: "tpl:flex tpl:items-center tpl:gap-1.5 tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-text)]" }, L = {
|
|
34
|
+
key: 0,
|
|
35
|
+
class: "tpl:rounded tpl:px-1 tpl:py-0.5 tpl:text-[10px] tpl:font-normal tpl:bg-[var(--tpl-bg-active)] tpl:text-[var(--tpl-text-muted)]"
|
|
36
|
+
}, R = ["disabled", "title"], z = /* @__PURE__ */ a({
|
|
37
|
+
__name: "SnapshotHistory",
|
|
38
|
+
props: {
|
|
39
|
+
snapshots: {},
|
|
40
|
+
isLoading: { type: Boolean },
|
|
41
|
+
isRestoring: { type: Boolean }
|
|
42
|
+
},
|
|
43
|
+
emits: ["load", "navigate"],
|
|
44
|
+
setup(a, { emit: y }) {
|
|
45
|
+
let z = a, B = y, { format: V } = v(), { t: H } = C(), U = i(!1), W = i(null), G = i(-1);
|
|
46
|
+
g(() => z.snapshots.length, () => {
|
|
47
|
+
G.value = -1;
|
|
48
|
+
});
|
|
49
|
+
let K = p(() => G.value > 0 && z.snapshots.length > 0 && !z.isRestoring), q = p(() => G.value < z.snapshots.length - 1 && z.snapshots.length > 0 && !z.isRestoring);
|
|
50
|
+
function J() {
|
|
51
|
+
K.value && (G.value--, B("navigate", z.snapshots[G.value]));
|
|
52
|
+
}
|
|
53
|
+
function Y() {
|
|
54
|
+
q.value && (G.value++, B("navigate", z.snapshots[G.value]));
|
|
55
|
+
}
|
|
56
|
+
function X() {
|
|
57
|
+
U.value = !U.value, U.value && z.snapshots.length === 0 && B("load");
|
|
58
|
+
}
|
|
59
|
+
function Z(e) {
|
|
60
|
+
let t = z.snapshots.findIndex((t) => t.id === e);
|
|
61
|
+
t !== -1 && (G.value = t, B("navigate", z.snapshots[t])), U.value = !1;
|
|
62
|
+
}
|
|
63
|
+
function Q(e) {
|
|
64
|
+
let t = w(e, H.snapshotHistory, V, 7);
|
|
65
|
+
return t === null ? new Date(e).toLocaleDateString(void 0, {
|
|
66
|
+
month: "short",
|
|
67
|
+
day: "numeric",
|
|
68
|
+
hour: "2-digit",
|
|
69
|
+
minute: "2-digit"
|
|
70
|
+
}) : t;
|
|
71
|
+
}
|
|
72
|
+
return _(W, () => {
|
|
73
|
+
U.value = !1;
|
|
74
|
+
}), (i, p) => (t(), s("div", {
|
|
75
|
+
ref_key: "dropdownRef",
|
|
76
|
+
ref: W,
|
|
77
|
+
class: "tpl:relative tpl:flex tpl:items-center tpl:gap-0.5"
|
|
78
|
+
}, [
|
|
79
|
+
f("button", {
|
|
80
|
+
class: "tpl:flex tpl:size-7 tpl:shrink-0 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-[var(--tpl-radius-sm)] tpl:border-none tpl:bg-transparent tpl:transition-colors tpl:duration-150 hover:tpl:bg-[var(--tpl-bg-hover)] disabled:tpl:cursor-not-allowed disabled:tpl:opacity-30 disabled:hover:tpl:bg-transparent tpl:text-[var(--tpl-text-muted)]",
|
|
81
|
+
disabled: !q.value,
|
|
82
|
+
title: d(H).snapshotHistory.olderSnapshot,
|
|
83
|
+
onClick: h(Y, ["stop"])
|
|
84
|
+
}, [c(d(T), {
|
|
85
|
+
size: 14,
|
|
86
|
+
"stroke-width": 2
|
|
87
|
+
})], 8, D),
|
|
88
|
+
f("button", {
|
|
89
|
+
class: "tpl:flex tpl:h-7 tpl:shrink-0 tpl:cursor-pointer tpl:items-center tpl:gap-0.5 tpl:rounded-[var(--tpl-radius-sm)] tpl:border-none tpl:bg-transparent tpl:px-1.5 tpl:transition-colors tpl:duration-150 hover:tpl:bg-[var(--tpl-bg-hover)] tpl:text-[var(--tpl-text-muted)]",
|
|
90
|
+
title: d(H).snapshotHistory.tooltip,
|
|
91
|
+
onClick: h(X, ["stop"])
|
|
92
|
+
}, [c(d(x), {
|
|
93
|
+
size: 16,
|
|
94
|
+
"stroke-width": 1.5
|
|
95
|
+
}), c(d(b), {
|
|
96
|
+
class: e(["tpl:transition-transform tpl:duration-150", { "tpl:rotate-180": U.value }]),
|
|
97
|
+
size: 10,
|
|
98
|
+
"stroke-width": 2
|
|
99
|
+
}, null, 8, ["class"])], 8, O),
|
|
100
|
+
c(m, { name: "tpl-dropdown" }, {
|
|
101
|
+
default: o(() => [U.value ? (t(), s("div", k, [f("div", A, n(d(H).snapshotHistory.dropdownTitle), 1), a.isLoading ? (t(), s("div", j, [c(d(S), {
|
|
102
|
+
class: "tpl:animate-spin tpl:text-[var(--tpl-primary)]",
|
|
103
|
+
size: 20,
|
|
104
|
+
"stroke-width": 2
|
|
105
|
+
})])) : a.snapshots.length === 0 ? (t(), s("div", M, n(d(H).snapshotHistory.noSnapshots), 1)) : (t(), s("div", N, [(t(!0), s(l, null, r(a.snapshots, (e) => (t(), s("button", {
|
|
106
|
+
key: e.id,
|
|
107
|
+
class: "tpl:flex tpl:w-full tpl:cursor-pointer tpl:items-center tpl:border-b tpl:border-b-[var(--tpl-border-light)] tpl:border-l-2 tpl:border-l-transparent tpl:px-3 tpl:py-2.5 tpl:text-left tpl:transition-all tpl:duration-150 last:tpl:border-b-0 hover:tpl:border-l-[var(--tpl-primary)] hover:tpl:bg-[var(--tpl-bg-hover)]",
|
|
108
|
+
style: { "background-color": "transparent" },
|
|
109
|
+
disabled: a.isRestoring,
|
|
110
|
+
onClick: (t) => Z(e.id)
|
|
111
|
+
}, [f("div", F, [f("div", I, [f("span", null, n(Q(e.created_at)), 1), e.is_autosave ? (t(), s("span", L, n(d(H).snapshotHistory.auto), 1)) : u("", !0)])])], 8, P))), 128))]))])) : u("", !0)]),
|
|
112
|
+
_: 1
|
|
113
|
+
}),
|
|
114
|
+
f("button", {
|
|
115
|
+
class: "tpl:flex tpl:size-7 tpl:shrink-0 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-[var(--tpl-radius-sm)] tpl:border-none tpl:bg-transparent tpl:transition-colors tpl:duration-150 hover:tpl:bg-[var(--tpl-bg-hover)] disabled:tpl:cursor-not-allowed disabled:tpl:opacity-30 disabled:hover:tpl:bg-transparent tpl:text-[var(--tpl-text-muted)]",
|
|
116
|
+
disabled: !K.value,
|
|
117
|
+
title: d(H).snapshotHistory.newerSnapshot,
|
|
118
|
+
onClick: h(J, ["stop"])
|
|
119
|
+
}, [c(d(E), {
|
|
120
|
+
size: 14,
|
|
121
|
+
"stroke-width": 2
|
|
122
|
+
})], 8, R)
|
|
123
|
+
], 512));
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
//#endregion
|
|
127
|
+
export { z as default };
|
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
import { Dt as e, E as t, L as n, M as r, Mt as i, Ot as a, P as o, Q as s, S as c, V as ee, _ as l, b as u, d, g as f, h as p, it as m, m as h, t as te, y as g, z as ne } from "./vue.runtime.esm-bundler-DpvJL-nX.js";
|
|
2
|
+
import { O as _, m as re, v as ie, w as v } from "./keys-ciNfSSGj.js";
|
|
3
|
+
import { t as y } from "./createLucideIcon-C3pa2siy.js";
|
|
4
|
+
import { t as b } from "./chevron-down-R2uY34iD.js";
|
|
5
|
+
import { t as x } from "./circle-alert-DZuGWPX-.js";
|
|
6
|
+
import { n as S, t as C } from "./refresh-cw-CE_AGtn8.js";
|
|
7
|
+
import { t as ae } from "./info-CJEC7piy.js";
|
|
8
|
+
import { t as w } from "./loader-circle-DsY5Yg33.js";
|
|
9
|
+
import { t as T } from "./shield-check-CfJgs2Hd.js";
|
|
10
|
+
import { t as E } from "./sparkles-CvRXGqFs.js";
|
|
11
|
+
import { t as oe } from "./triangle-alert-aOXceTSe.js";
|
|
12
|
+
import { t as se } from "./x-u2oVmjN_.js";
|
|
13
|
+
import { t as ce } from "./LoadingTrack-B0CWFHXQ.js";
|
|
14
|
+
import { t as D } from "./_plugin-vue_export-helper-B0hnzhyu.js";
|
|
15
|
+
import { n as le } from "./useCloudI18n-BuIwR6OE.js";
|
|
16
|
+
var O = y("shield-x", [
|
|
17
|
+
["path", {
|
|
18
|
+
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",
|
|
19
|
+
key: "oel41y"
|
|
20
|
+
}],
|
|
21
|
+
["path", {
|
|
22
|
+
d: "m14.5 9.5-5 5",
|
|
23
|
+
key: "17q4r4"
|
|
24
|
+
}],
|
|
25
|
+
["path", {
|
|
26
|
+
d: "m9.5 9.5 5 5",
|
|
27
|
+
key: "18nt4w"
|
|
28
|
+
}]
|
|
29
|
+
]), k = y("zap", [["path", {
|
|
30
|
+
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",
|
|
31
|
+
key: "1xq2db"
|
|
32
|
+
}]]);
|
|
33
|
+
//#endregion
|
|
34
|
+
//#region src/cloud/utils/scoringStyles.ts
|
|
35
|
+
function A(e) {
|
|
36
|
+
return e >= 80 ? "var(--tpl-success)" : e >= 60 ? "var(--tpl-warning)" : "var(--tpl-danger)";
|
|
37
|
+
}
|
|
38
|
+
function j(e) {
|
|
39
|
+
return e >= 80 ? "var(--tpl-success-light)" : e >= 60 ? "var(--tpl-warning-light)" : "var(--tpl-danger-light)";
|
|
40
|
+
}
|
|
41
|
+
function M(e) {
|
|
42
|
+
return e === "high" ? "var(--tpl-danger)" : e === "medium" ? "var(--tpl-warning)" : "var(--tpl-text-muted)";
|
|
43
|
+
}
|
|
44
|
+
function N(e) {
|
|
45
|
+
return e === "high" ? "var(--tpl-danger-light)" : e === "medium" ? "var(--tpl-warning-light)" : "var(--tpl-bg-hover)";
|
|
46
|
+
}
|
|
47
|
+
//#endregion
|
|
48
|
+
//#region src/cloud/components/TemplateScoringPanel.vue?vue&type=script&setup=true&lang.ts
|
|
49
|
+
var P = {
|
|
50
|
+
key: 0,
|
|
51
|
+
class: "tpl-scoring-panel tpl:absolute tpl:top-14 tpl:right-0 tpl:bottom-0 tpl:z-panel tpl:flex tpl:w-[360px] tpl:flex-col tpl:border-l tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-elevated)]"
|
|
52
|
+
}, F = { class: "tpl:flex tpl:items-center tpl:justify-between tpl:border-b tpl:border-[var(--tpl-border)] tpl:px-4 tpl:py-3" }, I = { class: "tpl:flex tpl:items-center tpl:gap-1.5 tpl:text-sm tpl:font-medium tpl:text-[var(--tpl-primary)]" }, L = { class: "tpl:flex tpl:items-center tpl:gap-1" }, R = ["title"], z = { class: "tpl:flex-1 tpl:overflow-y-auto tpl:p-4" }, B = {
|
|
53
|
+
key: 0,
|
|
54
|
+
class: "tpl:flex tpl:h-full tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-3 tpl:text-center"
|
|
55
|
+
}, V = { class: "tpl:text-sm tpl:text-[var(--tpl-text-muted)]" }, H = {
|
|
56
|
+
key: 1,
|
|
57
|
+
class: "tpl:flex tpl:h-full tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-3 tpl:text-center"
|
|
58
|
+
}, U = { class: "tpl:max-w-[240px] tpl:text-sm tpl:text-[var(--tpl-text-muted)]" }, W = {
|
|
59
|
+
key: 2,
|
|
60
|
+
class: "tpl:flex tpl:flex-col tpl:gap-4"
|
|
61
|
+
}, ue = { class: "tpl:text-xs tpl:font-medium tpl:uppercase tpl:tracking-wider tpl:text-[var(--tpl-text-muted)]" }, de = {
|
|
62
|
+
key: 0,
|
|
63
|
+
class: "tpl:text-xs tpl:text-[var(--tpl-text-dim)]"
|
|
64
|
+
}, fe = {
|
|
65
|
+
key: 0,
|
|
66
|
+
class: "tpl:flex tpl:items-start tpl:gap-2 tpl:rounded-lg tpl:px-3 tpl:py-2 tpl:text-xs tpl:bg-[var(--tpl-danger-light)] tpl:text-[var(--tpl-danger)]"
|
|
67
|
+
}, pe = ["onClick"], me = { class: "tpl:flex-1 tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-text)]" }, he = {
|
|
68
|
+
key: 0,
|
|
69
|
+
class: "tpl:text-[10px] tpl:text-[var(--tpl-text-dim)]"
|
|
70
|
+
}, ge = {
|
|
71
|
+
key: 0,
|
|
72
|
+
class: "tpl:border-t tpl:border-[var(--tpl-border)]"
|
|
73
|
+
}, _e = {
|
|
74
|
+
key: 0,
|
|
75
|
+
class: "tpl:px-3 tpl:py-3 tpl:text-center tpl:text-xs tpl:text-[var(--tpl-text-dim)]"
|
|
76
|
+
}, ve = { class: "tpl:flex tpl:items-start tpl:gap-2" }, ye = { class: "tpl:flex-1 tpl:min-w-0" }, be = { class: "tpl:flex tpl:items-start tpl:gap-1.5" }, xe = { class: "tpl:text-xs tpl:leading-snug tpl:text-[var(--tpl-text)]" }, Se = {
|
|
77
|
+
key: 0,
|
|
78
|
+
class: "tpl:mt-1 tpl:text-[11px] tpl:leading-snug tpl:text-[var(--tpl-text-dim)]"
|
|
79
|
+
}, Ce = {
|
|
80
|
+
key: 1,
|
|
81
|
+
class: "tpl:mt-2 tpl:flex tpl:justify-center"
|
|
82
|
+
}, we = ["disabled", "onClick"], Te = {
|
|
83
|
+
key: 0,
|
|
84
|
+
class: "tpl:mt-1.5 tpl:text-[11px] tpl:text-[var(--tpl-danger)]"
|
|
85
|
+
}, Ee = {
|
|
86
|
+
key: 3,
|
|
87
|
+
class: "tpl:flex tpl:h-full tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-3 tpl:text-center"
|
|
88
|
+
}, De = { class: "tpl:max-w-[240px] tpl:text-sm tpl:text-[var(--tpl-text-muted)]" }, Oe = { class: "tpl:m-0 tpl:px-4 tpl:pb-2 tpl:pt-2 tpl:text-center tpl:text-[11px] tpl:text-[var(--tpl-text-dim)]" }, G = /* @__PURE__ */ D(/* @__PURE__ */ c({
|
|
89
|
+
__name: "TemplateScoringPanel",
|
|
90
|
+
props: { visible: { type: Boolean } },
|
|
91
|
+
emits: ["close"],
|
|
92
|
+
setup(c, { emit: y }) {
|
|
93
|
+
let D = c, G = y, { t: K } = le(), q = _(re, "TemplateScoringPanel"), J = _(v, "TemplateScoringPanel"), Y = t(ie, []), X = s({
|
|
94
|
+
spam: !0,
|
|
95
|
+
readability: !0,
|
|
96
|
+
accessibility: !0,
|
|
97
|
+
bestPractices: !0
|
|
98
|
+
});
|
|
99
|
+
function ke(e) {
|
|
100
|
+
X.value[e] = !X.value[e];
|
|
101
|
+
}
|
|
102
|
+
let Z = [
|
|
103
|
+
"spam",
|
|
104
|
+
"readability",
|
|
105
|
+
"accessibility",
|
|
106
|
+
"bestPractices"
|
|
107
|
+
], Ae = {
|
|
108
|
+
spam: O,
|
|
109
|
+
readability: S,
|
|
110
|
+
accessibility: E,
|
|
111
|
+
bestPractices: k
|
|
112
|
+
};
|
|
113
|
+
function Q() {
|
|
114
|
+
J.score(q.content.value, Y);
|
|
115
|
+
}
|
|
116
|
+
ne(() => D.visible, (e) => {
|
|
117
|
+
e && !J.scoringResult.value && !J.isScoring.value && Q();
|
|
118
|
+
});
|
|
119
|
+
async function je(e) {
|
|
120
|
+
if (!e.blockId) return;
|
|
121
|
+
let t = q.content.value.blocks.find((t) => t.id === e.blockId);
|
|
122
|
+
if (!t) return;
|
|
123
|
+
let n = t.content;
|
|
124
|
+
if (!n) return;
|
|
125
|
+
let r = await J.fixFinding(n, e, Y);
|
|
126
|
+
r && (q.updateBlock(e.blockId, { content: r }), J.removeFinding(e.category, e.id));
|
|
127
|
+
}
|
|
128
|
+
function $() {
|
|
129
|
+
return J.scoringResult.value ? Z.reduce((e, t) => e + (J.scoringResult.value?.categories[t]?.findings.length ?? 0), 0) : 0;
|
|
130
|
+
}
|
|
131
|
+
return (t, s) => (r(), p(te, {
|
|
132
|
+
"enter-active-class": "tpl-scoring-slide-enter-active",
|
|
133
|
+
"enter-from-class": "tpl:translate-x-full",
|
|
134
|
+
"enter-to-class": "tpl:translate-x-0",
|
|
135
|
+
"leave-active-class": "tpl-scoring-slide-leave-active",
|
|
136
|
+
"leave-from-class": "tpl:translate-x-0",
|
|
137
|
+
"leave-to-class": "tpl:translate-x-full"
|
|
138
|
+
}, {
|
|
139
|
+
default: ee(() => [c.visible ? (r(), l("div", P, [h("div", F, [h("div", I, [u(m(T), {
|
|
140
|
+
size: 13,
|
|
141
|
+
"stroke-width": 2
|
|
142
|
+
}), h("span", null, i(m(K).scoring.title), 1)]), h("div", L, [m(J).scoringResult.value && !m(J).isScoring.value ? (r(), l("button", {
|
|
143
|
+
key: 0,
|
|
144
|
+
class: "tpl:rounded-md tpl:p-0.5 tpl:transition-colors tpl:duration-150 tpl:text-[var(--tpl-text-muted)]",
|
|
145
|
+
title: m(K).scoring.rescore,
|
|
146
|
+
onClick: s[0] ||= (e) => Q()
|
|
147
|
+
}, [u(m(C), {
|
|
148
|
+
size: 14,
|
|
149
|
+
"stroke-width": 2
|
|
150
|
+
})], 8, R)) : f("", !0), h("button", {
|
|
151
|
+
class: "tpl:rounded-md tpl:p-0.5 tpl:transition-colors tpl:duration-150 tpl:text-[var(--tpl-text-muted)]",
|
|
152
|
+
onClick: s[1] ||= (e) => G("close")
|
|
153
|
+
}, [u(m(se), {
|
|
154
|
+
size: 14,
|
|
155
|
+
"stroke-width": 2
|
|
156
|
+
})])])]), h("div", z, [m(J).isScoring.value ? (r(), l("div", B, [h("p", V, i(m(K).scoring.scoring), 1), u(ce, { class: "tpl:w-3/4" })])) : m(J).error.value && !m(J).scoringResult.value ? (r(), l("div", H, [
|
|
157
|
+
u(m(x), {
|
|
158
|
+
size: 32,
|
|
159
|
+
"stroke-width": 1.5,
|
|
160
|
+
class: "tpl:text-[var(--tpl-danger)]"
|
|
161
|
+
}),
|
|
162
|
+
h("p", U, i(m(K).scoring.error), 1),
|
|
163
|
+
h("button", {
|
|
164
|
+
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 tpl:border-[var(--tpl-border)] tpl:text-[var(--tpl-text-muted)]",
|
|
165
|
+
onClick: s[2] ||= (e) => Q()
|
|
166
|
+
}, [u(m(C), {
|
|
167
|
+
size: 12,
|
|
168
|
+
"stroke-width": 2
|
|
169
|
+
}), g(" " + i(m(K).scoring.rescore), 1)])
|
|
170
|
+
])) : m(J).scoringResult.value ? (r(), l("div", W, [
|
|
171
|
+
h("div", {
|
|
172
|
+
class: "tpl:flex tpl:flex-col tpl:items-center tpl:gap-2 tpl:rounded-[var(--tpl-radius)] tpl:p-5",
|
|
173
|
+
style: a({ backgroundColor: m(j)(m(J).scoringResult.value.score) })
|
|
174
|
+
}, [
|
|
175
|
+
h("span", {
|
|
176
|
+
class: "tpl:text-4xl tpl:font-bold tpl:tabular-nums",
|
|
177
|
+
style: a({ color: m(A)(m(J).scoringResult.value.score) })
|
|
178
|
+
}, i(m(J).scoringResult.value.score), 5),
|
|
179
|
+
h("span", ue, i(m(K).scoring.overallScore), 1),
|
|
180
|
+
$() > 0 ? (r(), l("span", de, i($()) + " " + i(m(K).scoring.findings), 1)) : f("", !0)
|
|
181
|
+
], 4),
|
|
182
|
+
m(J).fixError.value ? (r(), l("div", fe, [u(m(x), {
|
|
183
|
+
size: 14,
|
|
184
|
+
"stroke-width": 2,
|
|
185
|
+
class: "tpl:mt-0.5 tpl:shrink-0"
|
|
186
|
+
}), h("span", null, i(m(K).scoring.fixError), 1)])) : f("", !0),
|
|
187
|
+
(r(), l(d, null, o(Z, (t) => h("div", {
|
|
188
|
+
key: t,
|
|
189
|
+
class: "tpl:overflow-hidden tpl:rounded-[var(--tpl-radius)] tpl:border tpl:border-[var(--tpl-border)]"
|
|
190
|
+
}, [h("button", {
|
|
191
|
+
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 tpl:bg-[var(--tpl-bg)]",
|
|
192
|
+
onClick: (e) => ke(t)
|
|
193
|
+
}, [
|
|
194
|
+
(r(), p(n(Ae[t]), {
|
|
195
|
+
size: 14,
|
|
196
|
+
"stroke-width": 2,
|
|
197
|
+
style: a({ color: m(A)(m(J).scoringResult.value.categories[t].score) })
|
|
198
|
+
}, null, 8, ["style"])),
|
|
199
|
+
h("span", me, i(m(K).scoring.categories[t]), 1),
|
|
200
|
+
h("span", {
|
|
201
|
+
class: "tpl:rounded-full tpl:px-2 tpl:py-0.5 tpl:text-xs tpl:font-semibold tpl:tabular-nums",
|
|
202
|
+
style: a({
|
|
203
|
+
color: m(A)(m(J).scoringResult.value.categories[t].score),
|
|
204
|
+
backgroundColor: m(j)(m(J).scoringResult.value.categories[t].score)
|
|
205
|
+
})
|
|
206
|
+
}, i(m(J).scoringResult.value.categories[t].score), 5),
|
|
207
|
+
m(J).scoringResult.value.categories[t].findings.length > 0 ? (r(), l("span", he, i(m(J).scoringResult.value.categories[t].findings.length), 1)) : f("", !0),
|
|
208
|
+
u(m(b), {
|
|
209
|
+
size: 12,
|
|
210
|
+
"stroke-width": 2,
|
|
211
|
+
class: e(["tpl:transition-transform tpl:duration-200 tpl:text-[var(--tpl-text-dim)]", X.value[t] ? "tpl:rotate-0" : "tpl:-rotate-90"])
|
|
212
|
+
}, null, 8, ["class"])
|
|
213
|
+
], 8, pe), X.value[t] ? (r(), l("div", ge, [m(J).scoringResult.value.categories[t].findings.length === 0 ? (r(), l("div", _e, i(m(K).scoring.noFindings), 1)) : f("", !0), (r(!0), l(d, null, o(m(J).scoringResult.value.categories[t].findings, (e) => (r(), l("div", {
|
|
214
|
+
key: e.id,
|
|
215
|
+
class: "tpl:border-t tpl:px-3 tpl:py-2.5 first:tpl:border-t-0 tpl:border-[var(--tpl-border-light)]"
|
|
216
|
+
}, [h("div", ve, [(r(), p(n(e.severity === "high" ? m(x) : e.severity === "medium" ? m(oe) : m(ae)), {
|
|
217
|
+
size: 13,
|
|
218
|
+
"stroke-width": 2,
|
|
219
|
+
class: "tpl:mt-0.5 tpl:shrink-0",
|
|
220
|
+
style: a({ color: m(M)(e.severity) })
|
|
221
|
+
}, null, 8, ["style"])), h("div", ye, [
|
|
222
|
+
h("div", be, [h("span", {
|
|
223
|
+
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",
|
|
224
|
+
style: a({
|
|
225
|
+
color: m(M)(e.severity),
|
|
226
|
+
backgroundColor: m(N)(e.severity)
|
|
227
|
+
})
|
|
228
|
+
}, i(m(K).scoring.severity[e.severity]), 5), h("span", xe, i(e.message), 1)]),
|
|
229
|
+
e.suggestion ? (r(), l("p", Se, i(e.suggestion), 1)) : f("", !0),
|
|
230
|
+
e.blockId ? (r(), l("div", Ce, [h("button", {
|
|
231
|
+
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 tpl:border-[var(--tpl-border)] tpl:text-[var(--tpl-primary)]",
|
|
232
|
+
style: { "background-color": "transparent" },
|
|
233
|
+
disabled: m(J).fixingFindingId.value !== null,
|
|
234
|
+
onClick: (t) => je(e)
|
|
235
|
+
}, [m(J).fixingFindingId.value === e.id ? (r(), p(m(w), {
|
|
236
|
+
key: 0,
|
|
237
|
+
class: "tpl-spinner",
|
|
238
|
+
size: 11,
|
|
239
|
+
"stroke-width": 2
|
|
240
|
+
})) : (r(), p(m(E), {
|
|
241
|
+
key: 1,
|
|
242
|
+
size: 11,
|
|
243
|
+
"stroke-width": 2
|
|
244
|
+
})), g(" " + i(m(J).fixingFindingId.value === e.id ? m(K).scoring.fixing : m(K).scoring.fix), 1)], 8, we), m(J).fixError.value ? (r(), l("p", Te, i(m(J).fixError.value), 1)) : f("", !0)])) : f("", !0)
|
|
245
|
+
])])]))), 128))])) : f("", !0)])), 64))
|
|
246
|
+
])) : (r(), l("div", Ee, [u(m(T), {
|
|
247
|
+
size: 32,
|
|
248
|
+
"stroke-width": 1.5,
|
|
249
|
+
class: "tpl:text-[var(--tpl-text-dim)]"
|
|
250
|
+
}), h("p", De, i(m(K).scoring.emptyState), 1)])), h("p", Oe, i(m(K).aiMenu.disclaimer), 1)])])) : f("", !0)]),
|
|
251
|
+
_: 1
|
|
252
|
+
}));
|
|
253
|
+
}
|
|
254
|
+
}), [["__scopeId", "data-v-3a059e8d"]]);
|
|
255
|
+
//#endregion
|
|
256
|
+
export { G as default };
|