@templatical/editor 0.0.1 → 0.0.2
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-XBj5Rw2l.js +214 -0
- package/dist/AiFeatureMenu-my1mZ9DL.js +63 -0
- package/dist/CloudEditor-BVjgKwq3.js +940 -0
- package/dist/CollaboratorBar-BZq_Gv38.js +91 -0
- package/dist/CommentsSidebar-D9oxqO6l.js +439 -0
- package/dist/DesignReferenceSidebar-CyHq4SWt.js +272 -0
- package/dist/LoadingTrack-vK8W2PJf.js +10 -0
- package/dist/ModuleBrowserModal-Cus2Hdwl.js +205 -0
- package/dist/ModulePreviewCanvas-DaByXKY_.js +106 -0
- package/dist/ParagraphEditor-BSyk5B6S.js +670 -0
- package/dist/RichTextEditorContent-BRpjJ6SV.js +133 -0
- package/dist/SaveModuleDialog-BIZBQrd8.js +122 -0
- package/dist/SnapshotHistory-Ds1-QNbx.js +126 -0
- package/dist/TemplateScoringPanel-C8XSk_Ys.js +249 -0
- package/dist/TestEmailModal-CCVfaFgV.js +94 -0
- package/dist/TitleEditor-V4qaEULF.js +167 -0
- package/dist/TplModal-LT3FXlgs.js +44 -0
- package/dist/_plugin-vue_export-helper-B1-bu7yR.js +47 -0
- package/dist/blockTypeIcons-BujoY5Dl.js +126 -0
- package/dist/cdn/chunks/ParagraphEditor-BkJQO-ZW.js +3 -0
- package/dist/cdn/chunks/ParagraphEditor-BkJQO-ZW.js.map +1 -0
- package/dist/cdn/chunks/RichTextEditorContent-UGQorJm_.js +2 -0
- package/dist/cdn/chunks/RichTextEditorContent-UGQorJm_.js.map +1 -0
- package/dist/cdn/chunks/TitleEditor-CC3Adjai.js +3 -0
- package/dist/cdn/chunks/TitleEditor-CC3Adjai.js.map +1 -0
- package/dist/cdn/chunks/dist-0UheN8rK.js +1 -0
- package/dist/cdn/chunks/dist-55mmbGQ9.js +1 -0
- package/dist/cdn/chunks/dist-B31mxKyP.js +1 -0
- package/dist/cdn/chunks/dist-B5JI9nIg.js +1 -0
- package/dist/cdn/chunks/dist-B93vLKhU.js +1 -0
- package/dist/cdn/chunks/dist-BDt3FJvj.js +1 -0
- package/dist/cdn/chunks/dist-BJRuFHmi.js +1 -0
- package/dist/cdn/chunks/dist-BKSzrf0L.js +1 -0
- package/dist/cdn/chunks/dist-BL8c5gYQ.js +1 -0
- package/dist/cdn/chunks/dist-CYThWMP5.js +1 -0
- package/dist/cdn/chunks/dist-DxZbPJYt.js +1 -0
- package/dist/cdn/chunks/draggable-ClUwYCFL.js +17 -0
- package/dist/cdn/chunks/draggable-ClUwYCFL.js.map +1 -0
- package/dist/cdn/chunks/emojiData-6fVLNqeH.js +2 -0
- package/dist/cdn/chunks/emojiData-6fVLNqeH.js.map +1 -0
- package/dist/cdn/chunks/extensions-BfjbWqOx.js +2 -0
- package/dist/cdn/chunks/extensions-BfjbWqOx.js.map +1 -0
- package/dist/cdn/chunks/icons-vmLJTaJk.js +2 -0
- package/dist/cdn/chunks/icons-vmLJTaJk.js.map +1 -0
- package/dist/cdn/chunks/rolldown-runtime-BakkzWXw.js +1 -0
- package/dist/cdn/chunks/styleConstants-UTJ94gco.js +2 -0
- package/dist/cdn/chunks/styleConstants-UTJ94gco.js.map +1 -0
- package/dist/cdn/chunks/tiptap-Cya4P9CN.js +145 -0
- package/dist/cdn/chunks/tiptap-Cya4P9CN.js.map +1 -0
- package/dist/cdn/chunks/useEditorCore-DRhPKq_z.js +2 -0
- package/dist/cdn/chunks/useEditorCore-DRhPKq_z.js.map +1 -0
- package/dist/cdn/chunks/useMergeTag-CBSlcqnk.js +2 -0
- package/dist/cdn/chunks/useMergeTag-CBSlcqnk.js.map +1 -0
- package/dist/cdn/editor.css +1 -0
- package/dist/cdn/editor.js +2 -0
- package/dist/cdn/editor.js.map +1 -0
- package/dist/check-B7kDuZmP.js +7 -0
- package/dist/chevron-down-DJLW2Q9Z.js +7 -0
- package/dist/circle-alert-E2vYPs5r.js +25 -0
- package/dist/clock-lWIIQA3C.js +12 -0
- package/dist/de-B4Ob4vCo.js +682 -0
- package/dist/dist-4LiM9FDd.js +35 -0
- package/dist/dist-Bu7veieH.js +776 -0
- package/dist/dist-C1BIRHCQ.js +61 -0
- package/dist/dist-CG-vEqSU.js +314 -0
- package/dist/dist-C_ymrGFi.js +10625 -0
- package/dist/dist-ChAGLpWo.js +35 -0
- package/dist/dist-DNjZKe2Z.js +513 -0
- package/dist/dist-D_HQYSY-.js +189 -0
- package/dist/dist-DkypH7qG.js +5 -0
- package/dist/dist-DmOE-Ubp.js +74 -0
- package/dist/dist-DrvKRSU6.js +47 -0
- package/dist/dist-Dxnd0GRf.js +5 -0
- package/dist/dist-DysAFIPy.js +2054 -0
- package/dist/emojiData-BfWQS72m.js +17 -0
- package/dist/en-YXsspZJG.js +682 -0
- package/dist/extensions-BA4NshZQ.js +420 -0
- package/dist/formatRelativeTime-DX3FgqN9.js +8 -0
- package/dist/i18n-ikyi28RU.js +23 -0
- package/dist/image-up-X4xIq4ea.js +23 -0
- package/dist/keys-8B5MFafK.js +4 -0
- package/dist/liquid.browser-BemTg3sZ.js +3272 -0
- package/dist/loader-circle-BTQQxC3l.js +7 -0
- package/dist/message-circle-Blgm6V_h.js +7 -0
- package/dist/refresh-cw-Bb4PEeW1.js +44 -0
- package/dist/scan-line-7lZPfOdm.js +25 -0
- package/dist/send-C0ltAQrv.js +10 -0
- package/dist/shield-check-f-qv4RKs.js +10 -0
- package/dist/sparkles-KhBCGlqB.js +23 -0
- package/dist/styleConstants-CgtFM9hQ.js +43 -0
- package/dist/styles-hQgJKM4i.js +3406 -0
- package/dist/templatical-editor.css +2 -1
- package/dist/templatical-editor.js +242 -9
- package/dist/templatical-editor.umd.cjs +112 -524
- package/dist/timeouts-CmBrLeZA.js +4 -0
- package/dist/trash-2-OwjZ-guZ.js +25 -0
- package/dist/triangle-alert-DOSRIUYZ.js +17 -0
- package/dist/useEditorCore-DVp5qmtC.js +5552 -0
- package/dist/useI18n-DzH4KXDk.js +17 -0
- package/dist/useMergeTag-D9zQVE-e.js +33 -0
- package/dist/x-CGlq2XQe.js +10 -0
- package/package.json +30 -20
- package/dist/AiChatSidebar-0vx9TP5B.js +0 -305
- package/dist/AiFeatureMenu-CI-v74ND.js +0 -69
- package/dist/CloudEditor-Wdfv_9xn.js +0 -1132
- package/dist/CollaboratorBar-B3uV4Wtw.js +0 -89
- package/dist/CommentsSidebar-PVUlloyB.js +0 -655
- package/dist/DesignReferenceSidebar-DAlAWrxU.js +0 -351
- package/dist/ModuleBrowserModal-1JEcChd8.js +0 -323
- package/dist/ModulePreviewCanvas-Cdp484Ae.js +0 -169
- package/dist/SaveModuleDialog-eNyr3XKn.js +0 -168
- package/dist/SnapshotHistory-D-ZiIj1v.js +0 -169
- package/dist/TemplateScoringPanel-DSZPo15C.js +0 -385
- package/dist/TestEmailModal-Cwre5elw.js +0 -128
- package/dist/TextEditor-BuUOIByX.js +0 -780
- package/dist/de-BWIAblxs.js +0 -685
- package/dist/en-cYyUzNV1.js +0 -685
- package/dist/index-0tWUczNu.js +0 -47
- package/dist/index-4okvXjqk.js +0 -41
- package/dist/index-BSc6h5zo.js +0 -967
- package/dist/index-CrvwWlhN.js +0 -41
- package/dist/index-D-iD-7lO.js +0 -10961
- package/dist/index-D-ygXbc8.js +0 -2452
- package/dist/index-DbrWKz-e.js +0 -1415
- package/dist/index-DeUeHy6g.js +0 -422
- package/dist/index-Ude6e9RU.js +0 -41
- package/dist/index-ZQzHBwkr.js +0 -12767
- package/dist/liquid.browser-CeNxS2GL.js +0 -3493
- package/dist/loader-circle-tM9j2mRh.js +0 -13
- package/dist/shield-check-Ngi9jAQc.js +0 -20
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
import { o as e, s as t } from "./dist-CG-vEqSU.js";
|
|
2
|
+
import { S as n, f as ee, h as te, r as ne } from "./keys-8B5MFafK.js";
|
|
3
|
+
import { n as r, t as i } from "./_plugin-vue_export-helper-B1-bu7yR.js";
|
|
4
|
+
import { t as re } from "./circle-alert-E2vYPs5r.js";
|
|
5
|
+
import { t as ie } from "./loader-circle-BTQQxC3l.js";
|
|
6
|
+
import { t as ae } from "./send-C0ltAQrv.js";
|
|
7
|
+
import { t as a } from "./sparkles-KhBCGlqB.js";
|
|
8
|
+
import { t as oe } from "./trash-2-OwjZ-guZ.js";
|
|
9
|
+
import { t as se } from "./x-CGlq2XQe.js";
|
|
10
|
+
import { t as ce } from "./LoadingTrack-vK8W2PJf.js";
|
|
11
|
+
import { Fragment as o, Transition as le, createBlock as s, createCommentVNode as c, createElementBlock as l, createElementVNode as u, createTextVNode as d, createVNode as f, defineComponent as p, inject as m, nextTick as h, normalizeClass as ue, openBlock as g, ref as _, renderList as v, toDisplayString as y, unref as b, vModelText as de, watch as x, withCtx as fe, withDirectives as pe } from "vue";
|
|
12
|
+
import { useAiChat as S } from "@templatical/core/cloud";
|
|
13
|
+
var C = r("redo-2", [["path", {
|
|
14
|
+
d: "m15 14 5-5-5-5",
|
|
15
|
+
key: "12vg1m"
|
|
16
|
+
}], ["path", {
|
|
17
|
+
d: "M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13",
|
|
18
|
+
key: "6uklza"
|
|
19
|
+
}]]), w = r("undo-2", [["path", {
|
|
20
|
+
d: "M9 14 4 9l5-5",
|
|
21
|
+
key: "102s5s"
|
|
22
|
+
}], ["path", {
|
|
23
|
+
d: "M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",
|
|
24
|
+
key: "f3b9sd"
|
|
25
|
+
}]]), T = {
|
|
26
|
+
key: 0,
|
|
27
|
+
class: "tpl-ai-sidebar 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)]"
|
|
28
|
+
}, E = { class: "tpl:flex tpl:items-center tpl:justify-between tpl:border-b tpl:border-[var(--tpl-border)] tpl:px-4 tpl:py-3" }, D = { class: "tpl:flex tpl:items-center tpl:gap-1.5 tpl:text-sm tpl:font-medium tpl:text-[var(--tpl-primary)]" }, O = { class: "tpl:flex tpl:items-center tpl:gap-1" }, k = ["title"], A = { class: "tpl:relative tpl:flex tpl:min-h-0 tpl:flex-1 tpl:flex-col" }, j = {
|
|
29
|
+
key: 0,
|
|
30
|
+
class: "tpl:flex tpl:h-full tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-3 tpl:text-center"
|
|
31
|
+
}, M = { class: "tpl:text-sm tpl:text-[var(--tpl-text-muted)]" }, N = {
|
|
32
|
+
key: 1,
|
|
33
|
+
class: "tpl:flex tpl:h-full tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-3 tpl:text-center"
|
|
34
|
+
}, P = { class: "tpl:max-w-[240px] tpl:text-sm tpl:text-[var(--tpl-text-muted)]" }, F = {
|
|
35
|
+
key: 2,
|
|
36
|
+
class: "tpl:flex tpl:flex-col tpl:gap-4"
|
|
37
|
+
}, I = {
|
|
38
|
+
key: 0,
|
|
39
|
+
class: "tpl:self-end tpl:rounded-[var(--tpl-radius-sm)] tpl:px-3.5 tpl:py-2.5 tpl:text-sm",
|
|
40
|
+
style: {
|
|
41
|
+
"background-color": "var(--tpl-primary-light)",
|
|
42
|
+
color: "var(--tpl-text)",
|
|
43
|
+
"max-width": "85%",
|
|
44
|
+
"box-shadow": "var(--tpl-shadow)"
|
|
45
|
+
}
|
|
46
|
+
}, L = {
|
|
47
|
+
key: 1,
|
|
48
|
+
class: "tpl:flex tpl:flex-col tpl:gap-2"
|
|
49
|
+
}, R = {
|
|
50
|
+
key: 1,
|
|
51
|
+
class: "tpl:rounded-[var(--tpl-radius-sm)] tpl:px-3.5 tpl:py-2.5 tpl:text-sm tpl:whitespace-pre-wrap",
|
|
52
|
+
style: {
|
|
53
|
+
"max-width": "85%",
|
|
54
|
+
"background-color": "var(--tpl-bg)",
|
|
55
|
+
color: "var(--tpl-text)",
|
|
56
|
+
"box-shadow": "var(--tpl-shadow)"
|
|
57
|
+
}
|
|
58
|
+
}, z = {
|
|
59
|
+
key: 0,
|
|
60
|
+
class: "tpl:mx-3 tpl:mb-2 tpl:flex tpl:items-start tpl:gap-2 tpl:rounded-lg tpl:px-3 tpl:py-2 tpl:text-xs",
|
|
61
|
+
style: {
|
|
62
|
+
"background-color": "var(--tpl-danger-light)",
|
|
63
|
+
color: "var(--tpl-danger)"
|
|
64
|
+
}
|
|
65
|
+
}, B = {
|
|
66
|
+
key: 1,
|
|
67
|
+
class: "tpl:absolute tpl:right-0 tpl:bottom-0 tpl:left-0 tpl:z-10 tpl:px-3 tpl:pb-3",
|
|
68
|
+
style: {
|
|
69
|
+
"background-color": "color-mix(\n in srgb,\n var(--tpl-bg) 50%,\n transparent\n )",
|
|
70
|
+
"backdrop-filter": "blur(2px)"
|
|
71
|
+
}
|
|
72
|
+
}, me = { class: "tpl:flex tpl:flex-col tpl:gap-1.5" }, he = ["onClick"], ge = { class: "tpl:border-t tpl:p-3 tpl:border-[var(--tpl-border)]" }, _e = { class: "tpl-ai-input-wrapper tpl:flex tpl:items-end tpl:gap-2 tpl:rounded-[var(--tpl-radius)] tpl:border tpl:px-3 tpl:py-2 tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)]" }, ve = ["placeholder", "disabled"], ye = ["disabled"], be = { class: "tpl:m-0 tpl:px-1 tpl:pt-2 tpl:text-center tpl:text-[11px] tpl:text-[var(--tpl-text-dim)]" }, V = /* @__PURE__ */ i(/* @__PURE__ */ p({
|
|
73
|
+
__name: "AiChatSidebar",
|
|
74
|
+
props: {
|
|
75
|
+
visible: { type: Boolean },
|
|
76
|
+
onApply: { type: Function }
|
|
77
|
+
},
|
|
78
|
+
emits: ["close"],
|
|
79
|
+
setup(r, { emit: i }) {
|
|
80
|
+
let p = r, V = i, H = m(n), U = m(ee), xe = m(ne), W = m(te, []), G = S({
|
|
81
|
+
authManager: xe,
|
|
82
|
+
getTemplateId: () => U.state.template?.id ?? null,
|
|
83
|
+
onApply: p.onApply,
|
|
84
|
+
onError: void 0
|
|
85
|
+
}), K = _(""), q = _(null), J = _(!1), Y = _(0), { pause: X, resume: Se } = e(() => {
|
|
86
|
+
let e = G.suggestions.value?.length ?? 0;
|
|
87
|
+
Y.value < e ? Y.value++ : X();
|
|
88
|
+
}, 150, { immediate: !1 }), { start: Ce } = t(() => Se(), 100, { immediate: !1 });
|
|
89
|
+
x(() => G.suggestions.value?.length ?? 0, (e) => {
|
|
90
|
+
if (X(), e === 0) {
|
|
91
|
+
Y.value = 0;
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
Y.value = 0, Ce();
|
|
95
|
+
});
|
|
96
|
+
function Z() {
|
|
97
|
+
h(() => {
|
|
98
|
+
q.value && (q.value.scrollTop = q.value.scrollHeight);
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
x(() => G.messages.value?.length ?? 0, () => Z()), x(() => p.visible, async (e) => {
|
|
102
|
+
e && !J.value && (J.value = !0, await G.loadConversation(), (G.messages.value?.length ?? 0) === 0 && U.content.value.blocks.length === 0 && G.loadSuggestions(U.content.value, W));
|
|
103
|
+
});
|
|
104
|
+
async function Q() {
|
|
105
|
+
let e = K.value.trim();
|
|
106
|
+
!e || G.isGenerating.value || (K.value = "", G.error.value = null, G.failedPrompt.value = null, Z(), await G.sendPrompt(e, U.content.value, W), G.failedPrompt.value && (K.value = G.failedPrompt.value), Z());
|
|
107
|
+
}
|
|
108
|
+
function $(e) {
|
|
109
|
+
return e.replace(/```json[\s\S]*?```/g, "").replace(/```json[\s\S]*/g, "").trim();
|
|
110
|
+
}
|
|
111
|
+
function we(e) {
|
|
112
|
+
X(), K.value = e, Q();
|
|
113
|
+
}
|
|
114
|
+
function Te(e) {
|
|
115
|
+
e.key === "Enter" && !e.shiftKey && (e.preventDefault(), Q());
|
|
116
|
+
}
|
|
117
|
+
return (e, t) => (g(), s(le, {
|
|
118
|
+
"enter-active-class": "tpl-ai-slide-enter-active",
|
|
119
|
+
"enter-from-class": "tpl:translate-x-full",
|
|
120
|
+
"enter-to-class": "tpl:translate-x-0",
|
|
121
|
+
"leave-active-class": "tpl-ai-slide-leave-active",
|
|
122
|
+
"leave-from-class": "tpl:translate-x-0",
|
|
123
|
+
"leave-to-class": "tpl:translate-x-full"
|
|
124
|
+
}, {
|
|
125
|
+
default: fe(() => [r.visible ? (g(), l("div", T, [
|
|
126
|
+
u("div", E, [u("div", D, [f(b(a), {
|
|
127
|
+
size: 13,
|
|
128
|
+
"stroke-width": 2
|
|
129
|
+
}), u("span", null, y(b(H).aiChat.title), 1)]), u("div", O, [(b(G).messages.value?.length ?? 0) > 0 ? (g(), l("button", {
|
|
130
|
+
key: 0,
|
|
131
|
+
class: "tpl:rounded-md tpl:p-0.5 tpl:transition-colors tpl:duration-150 tpl:text-[var(--tpl-text-muted)]",
|
|
132
|
+
title: b(H).aiChat.clear,
|
|
133
|
+
onClick: t[0] ||= (e) => b(G).clearChat()
|
|
134
|
+
}, [f(b(oe), {
|
|
135
|
+
size: 14,
|
|
136
|
+
"stroke-width": 2
|
|
137
|
+
})], 8, k)) : c("", !0), u("button", {
|
|
138
|
+
class: "tpl:rounded-md tpl:p-0.5 tpl:transition-colors tpl:duration-150 tpl:text-[var(--tpl-text-muted)]",
|
|
139
|
+
onClick: t[1] ||= (e) => V("close")
|
|
140
|
+
}, [f(b(se), {
|
|
141
|
+
size: 14,
|
|
142
|
+
"stroke-width": 2
|
|
143
|
+
})])])]),
|
|
144
|
+
u("div", A, [
|
|
145
|
+
u("div", {
|
|
146
|
+
ref_key: "messagesContainer",
|
|
147
|
+
ref: q,
|
|
148
|
+
class: "tpl:flex-1 tpl:overflow-y-auto tpl:p-4"
|
|
149
|
+
}, [b(G).isLoadingHistory.value ? (g(), l("div", j, [f(b(ie), {
|
|
150
|
+
class: "tpl-spinner tpl:text-[var(--tpl-text-muted)]",
|
|
151
|
+
size: 24,
|
|
152
|
+
"stroke-width": 2
|
|
153
|
+
}), u("p", M, y(b(H).aiChat.loadingHistory), 1)])) : (b(G).messages.value?.length ?? 0) === 0 ? (g(), l("div", N, [f(b(a), {
|
|
154
|
+
size: 32,
|
|
155
|
+
"stroke-width": 1.5,
|
|
156
|
+
class: "tpl:text-[var(--tpl-text-dim)]"
|
|
157
|
+
}), u("p", P, y(b(H).aiChat.placeholder), 1)])) : (g(), l("div", F, [(g(!0), l(o, null, v(b(G).messages.value, (e, n) => (g(), l("div", {
|
|
158
|
+
key: e.id,
|
|
159
|
+
class: "tpl:flex tpl:flex-col tpl:gap-2"
|
|
160
|
+
}, [e.role === "user" ? (g(), l("div", I, y(e.content), 1)) : (g(), l("div", L, [!$(e.content) && b(G).isGenerating.value && n === (b(G).messages.value?.length ?? 0) - 1 ? (g(), s(ce, { key: 0 })) : (g(), l("div", R, y($(e.content) || b(H).aiChat.applied), 1)), e.id === b(G).lastApplyMessageId.value && !b(G).isGenerating.value ? (g(), l("button", {
|
|
161
|
+
key: 2,
|
|
162
|
+
class: "tpl:inline-flex tpl:items-center tpl:gap-1.5 tpl:self-start tpl:rounded-md tpl:border tpl:px-2.5 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150",
|
|
163
|
+
style: {
|
|
164
|
+
"border-color": "var(--tpl-border)",
|
|
165
|
+
color: "var(--tpl-text-muted)",
|
|
166
|
+
"background-color": "transparent"
|
|
167
|
+
},
|
|
168
|
+
onClick: t[2] ||= (e) => b(G).toggleLastRevert()
|
|
169
|
+
}, [b(G).isLastChangeReverted.value ? (g(), l(o, { key: 0 }, [f(b(C), {
|
|
170
|
+
size: 12,
|
|
171
|
+
"stroke-width": 2
|
|
172
|
+
}), d(" " + y(b(H).aiChat.reapply), 1)], 64)) : (g(), l(o, { key: 1 }, [f(b(w), {
|
|
173
|
+
size: 12,
|
|
174
|
+
"stroke-width": 2
|
|
175
|
+
}), d(" " + y(b(H).aiChat.revert), 1)], 64))])) : c("", !0)]))]))), 128))]))], 512),
|
|
176
|
+
b(G).error.value ? (g(), l("div", z, [f(b(re), {
|
|
177
|
+
size: 14,
|
|
178
|
+
"stroke-width": 2,
|
|
179
|
+
class: "tpl:mt-0.5 tpl:shrink-0"
|
|
180
|
+
}), u("span", null, y(b(G).error.value === "ai_apply_failed" ? b(H).aiChat.applyFailed : b(H).aiChat.error), 1)])) : c("", !0),
|
|
181
|
+
(b(G).suggestions.value?.length ?? 0) > 0 ? (g(), l("div", B, [u("div", me, [(g(!0), l(o, null, v(b(G).suggestions.value ?? [], (e, t) => (g(), l("button", {
|
|
182
|
+
key: t,
|
|
183
|
+
class: ue(["tpl-suggestion-btn tpl:cursor-pointer tpl:rounded-[var(--tpl-radius-sm)] tpl:border tpl:px-3 tpl:py-2 tpl:text-left tpl:text-xs tpl:leading-snug tpl:transition-all tpl:duration-300 tpl:ease-out", (b(G).suggestions.value?.length ?? 0) - 1 - t < Y.value ? "tpl:translate-y-0 tpl:opacity-100" : "tpl:pointer-events-none tpl:-translate-y-2 tpl:opacity-0"]),
|
|
184
|
+
style: {
|
|
185
|
+
"border-color": "var(--tpl-border)",
|
|
186
|
+
color: "var(--tpl-primary)",
|
|
187
|
+
"background-color": "var(--tpl-bg)",
|
|
188
|
+
"box-shadow": "var(--tpl-shadow)"
|
|
189
|
+
},
|
|
190
|
+
onClick: (t) => we(e)
|
|
191
|
+
}, y(e), 11, he))), 128))])])) : c("", !0)
|
|
192
|
+
]),
|
|
193
|
+
u("div", ge, [u("div", _e, [pe(u("textarea", {
|
|
194
|
+
"onUpdate:modelValue": t[3] ||= (e) => K.value = e,
|
|
195
|
+
class: "tpl:max-h-32 tpl:min-h-[64px] tpl:flex-1 tpl:resize-none tpl:border-none tpl:bg-transparent tpl:font-sans tpl:text-sm tpl:outline-none tpl:text-[var(--tpl-text)]",
|
|
196
|
+
placeholder: b(H).aiChat.inputPlaceholder,
|
|
197
|
+
disabled: b(G).isGenerating.value,
|
|
198
|
+
rows: "3",
|
|
199
|
+
onKeydown: Te
|
|
200
|
+
}, null, 40, ve), [[de, K.value]]), u("button", {
|
|
201
|
+
class: "tpl-ai-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 tpl:text-[var(--tpl-primary)]",
|
|
202
|
+
disabled: !K.value.trim() || b(G).isGenerating.value,
|
|
203
|
+
onClick: Q
|
|
204
|
+
}, [f(b(ae), {
|
|
205
|
+
size: 16,
|
|
206
|
+
"stroke-width": 2
|
|
207
|
+
})], 8, ye)]), u("p", be, y(b(H).aiMenu.disclaimer), 1)])
|
|
208
|
+
])) : c("", !0)]),
|
|
209
|
+
_: 1
|
|
210
|
+
}));
|
|
211
|
+
}
|
|
212
|
+
}), [["__scopeId", "data-v-2735cdb5"]]);
|
|
213
|
+
//#endregion
|
|
214
|
+
export { V as default };
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import "./useEditorCore-DVp5qmtC.js";
|
|
2
|
+
import { t as e } from "./keys-8B5MFafK.js";
|
|
3
|
+
import { t } from "./useI18n-DzH4KXDk.js";
|
|
4
|
+
import { t as n } from "./_plugin-vue_export-helper-B1-bu7yR.js";
|
|
5
|
+
import { t as r } from "./image-up-X4xIq4ea.js";
|
|
6
|
+
import { t as i } from "./shield-check-f-qv4RKs.js";
|
|
7
|
+
import { t as a } from "./sparkles-KhBCGlqB.js";
|
|
8
|
+
import { Fragment as o, computed as s, createBlock as c, createElementBlock as l, createElementVNode as u, defineComponent as d, inject as f, normalizeStyle as p, openBlock as m, renderList as h, resolveDynamicComponent as g, toDisplayString as _ } from "vue";
|
|
9
|
+
//#region src/cloud/components/AiFeatureMenu.vue?vue&type=script&setup=true&lang.ts
|
|
10
|
+
var v = {
|
|
11
|
+
class: "tpl-ai-feature-menu tpl:w-[280px] tpl:overflow-hidden tpl:rounded-[var(--tpl-radius)] tpl:py-1 tpl:bg-[var(--tpl-bg-elevated)] tpl:border tpl:border-[var(--tpl-border)] tpl:shadow-[var(--tpl-shadow-lg)]",
|
|
12
|
+
style: {
|
|
13
|
+
"backdrop-filter": "blur(8px)",
|
|
14
|
+
"-webkit-backdrop-filter": "blur(8px)"
|
|
15
|
+
}
|
|
16
|
+
}, y = ["onClick"], b = { class: "tpl:flex tpl:min-w-0 tpl:flex-col tpl:gap-0.5" }, x = { class: "tpl:text-sm tpl:font-medium tpl:text-[var(--tpl-text)]" }, S = { class: "tpl:text-xs tpl:leading-snug tpl:text-[var(--tpl-text-muted)]" }, C = /* @__PURE__ */ n(/* @__PURE__ */ d({
|
|
17
|
+
__name: "AiFeatureMenu",
|
|
18
|
+
props: { activeFeature: {} },
|
|
19
|
+
emits: ["select"],
|
|
20
|
+
setup(n, { emit: d }) {
|
|
21
|
+
let C = d, { t: w } = t(), T = f(e), E = {
|
|
22
|
+
"ai-chat": "chat",
|
|
23
|
+
"design-reference": "designToTemplate",
|
|
24
|
+
scoring: "scoring"
|
|
25
|
+
}, D = [
|
|
26
|
+
{
|
|
27
|
+
key: "ai-chat",
|
|
28
|
+
icon: a
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
key: "design-reference",
|
|
32
|
+
icon: r
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
key: "scoring",
|
|
36
|
+
icon: i
|
|
37
|
+
}
|
|
38
|
+
], O = s(() => D.filter((e) => T.isFeatureEnabled(E[e.key])));
|
|
39
|
+
function k(e) {
|
|
40
|
+
return e === "ai-chat" ? w.aiMenu.aiAssistant : e === "design-reference" ? w.aiMenu.designToTemplate : w.aiMenu.templateScore;
|
|
41
|
+
}
|
|
42
|
+
function A(e) {
|
|
43
|
+
return e === "ai-chat" ? w.aiMenu.aiAssistantDesc : e === "design-reference" ? w.aiMenu.designToTemplateDesc : w.aiMenu.templateScoreDesc;
|
|
44
|
+
}
|
|
45
|
+
return (e, t) => (m(), l("div", v, [(m(!0), l(o, null, h(O.value, (e) => (m(), l("button", {
|
|
46
|
+
key: e.key,
|
|
47
|
+
class: "tpl-ai-feature-menu-item tpl:flex tpl:w-full tpl:cursor-pointer tpl:items-start tpl:gap-3 tpl:border-none tpl:px-3 tpl:py-2.5 tpl:text-left tpl:transition-colors tpl:duration-100",
|
|
48
|
+
style: p({ backgroundColor: n.activeFeature === e.key ? "var(--tpl-primary-light)" : "transparent" }),
|
|
49
|
+
onClick: (t) => C("select", e.key)
|
|
50
|
+
}, [u("div", {
|
|
51
|
+
class: "tpl:mt-0.5 tpl:flex tpl:size-7 tpl:shrink-0 tpl:items-center tpl:justify-center tpl:rounded-[var(--tpl-radius-sm)]",
|
|
52
|
+
style: p({
|
|
53
|
+
backgroundColor: n.activeFeature === e.key ? "var(--tpl-primary)" : "var(--tpl-bg-active)",
|
|
54
|
+
color: n.activeFeature === e.key ? "var(--tpl-bg)" : "var(--tpl-text-muted)"
|
|
55
|
+
})
|
|
56
|
+
}, [(m(), c(g(e.icon), {
|
|
57
|
+
size: 15,
|
|
58
|
+
"stroke-width": 2
|
|
59
|
+
}))], 4), u("div", b, [u("span", x, _(k(e.key)), 1), u("span", S, _(A(e.key)), 1)])], 12, y))), 128))]));
|
|
60
|
+
}
|
|
61
|
+
}), [["__scopeId", "data-v-7980235a"]]);
|
|
62
|
+
//#endregion
|
|
63
|
+
export { C as default };
|