@templatical/editor 0.0.4 → 0.0.5
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-CjfhTZwo.js → AiChatSidebar-DwME3f-a.js} +84 -70
- package/dist/{AiFeatureMenu-K44aZa_P.js → AiFeatureMenu-DJvWL1GZ.js} +23 -23
- package/dist/CloudEditor-Fe0ssRgi.js +1082 -0
- package/dist/{CollaboratorBar-BuCEcdbB.js → CollaboratorBar-DTT0EkZn.js} +1 -1
- package/dist/{CommentsSidebar-2lcqMfIP.js → CommentsSidebar-DrJhQRXK.js} +131 -131
- package/dist/{DesignReferenceSidebar-CNMu4Zrx.js → DesignReferenceSidebar-DdOht5zn.js} +49 -49
- package/dist/{ModuleBrowserModal-CvQ0xyQf.js → ModuleBrowserModal-CiV_jOEM.js} +58 -58
- package/dist/{ModulePreviewCanvas-Be2B3Y07.js → ModulePreviewCanvas-Bmy6Y1WE.js} +1 -1
- package/dist/ParagraphEditor-CoQ3NlS7.js +688 -0
- package/dist/{SaveModuleDialog-BaaeH5Xm.js → SaveModuleDialog-CD2ZYq1o.js} +25 -25
- package/dist/{SnapshotHistory-BPfjiuu1.js → SnapshotHistory-DltsKvhP.js} +1 -1
- package/dist/TemplateScoringPanel-DmnmUE3y.js +254 -0
- package/dist/{TestEmailModal-DIAlB3e_.js → TestEmailModal-Dl633j9o.js} +2 -2
- package/dist/{TitleEditor-D9DPjQkX.js → TitleEditor-C7fds2Nc.js} +3 -3
- package/dist/{TplModal-CmTSvCY-.js → TplModal-C5_CF-qn.js} +1 -1
- package/dist/{blockTypeIcons-D1RTWOkx.js → blockTypeIcons-BrKZB10B.js} +1 -1
- package/dist/cdn/chunks/AiChatSidebar-X_Bv3Qys.js +2 -0
- package/dist/cdn/chunks/{AiFeatureMenu-lxVm1RjH.js → AiFeatureMenu-C5UQmEgV.js} +16 -16
- package/dist/cdn/chunks/AiFeatureMenu-C5UQmEgV.js.map +1 -0
- package/dist/cdn/chunks/CloudEditor-DeTolKnf.js +1056 -0
- package/dist/cdn/chunks/CloudEditor-DeTolKnf.js.map +1 -0
- package/dist/cdn/chunks/{CollaboratorBar-D2PKtlOw.js → CollaboratorBar-DO1nxSrr.js} +3 -3
- package/dist/cdn/chunks/{CollaboratorBar-D2PKtlOw.js.map → CollaboratorBar-DO1nxSrr.js.map} +1 -1
- package/dist/cdn/chunks/CommentsSidebar-4MTw_hue.js +2 -0
- package/dist/cdn/chunks/DesignReferenceSidebar-Bswh4Yx4.js +2 -0
- package/dist/cdn/chunks/{ModuleBrowserModal-CxDXzkKS.js → ModuleBrowserModal-ChBr3aXj.js} +52 -52
- package/dist/cdn/chunks/ModuleBrowserModal-ChBr3aXj.js.map +1 -0
- package/dist/cdn/chunks/{ModulePreviewCanvas-DEfHampA.js → ModulePreviewCanvas-DkSvri9H.js} +2 -2
- package/dist/cdn/chunks/{ModulePreviewCanvas-DEfHampA.js.map → ModulePreviewCanvas-DkSvri9H.js.map} +1 -1
- package/dist/cdn/chunks/ParagraphEditor-DU3oUKA7.js +539 -0
- package/dist/cdn/chunks/ParagraphEditor-DU3oUKA7.js.map +1 -0
- package/dist/cdn/chunks/{RichTextEditorContent-DWUzizsC.js → RichTextEditorContent-BrsW1p9s.js} +4 -4
- package/dist/cdn/chunks/{RichTextEditorContent-DWUzizsC.js.map → RichTextEditorContent-BrsW1p9s.js.map} +1 -1
- package/dist/cdn/chunks/{SaveModuleDialog-DVna2xUl.js → SaveModuleDialog-CjqKkTEc.js} +24 -24
- package/dist/cdn/chunks/SaveModuleDialog-CjqKkTEc.js.map +1 -0
- package/dist/cdn/chunks/SnapshotHistory-KME4xmn_.js +2 -0
- package/dist/cdn/chunks/TemplateScoringPanel-DgB3xDN6.js +2 -0
- package/dist/cdn/chunks/TestEmailModal-DdpvRbYf.js +2 -0
- package/dist/cdn/chunks/{TitleEditor-DDf_OcHS.js → TitleEditor-C8FYbadT.js} +9 -9
- package/dist/cdn/chunks/{TitleEditor-DDf_OcHS.js.map → TitleEditor-C8FYbadT.js.map} +1 -1
- package/dist/cdn/chunks/{blockTypeIcons-BnobReQm.js → blockTypeIcons-5QwYklNq.js} +3 -3
- package/dist/cdn/chunks/{blockTypeIcons-BnobReQm.js.map → blockTypeIcons-5QwYklNq.js.map} +1 -1
- package/dist/cdn/chunks/{dist-CJcMnY7o.js → dist-BF5c3Dr-.js} +1 -1
- package/dist/cdn/chunks/dist-BGzvIxcJ.js +2 -0
- package/dist/cdn/chunks/dist-CFemF8rI.js +2 -0
- package/dist/cdn/chunks/dist-Co6uFhFK.js +2 -0
- package/dist/cdn/chunks/{dist-BkETaOfw.js → dist-DCikBY9K.js} +1 -1
- package/dist/cdn/chunks/dist-DUILafAC.js +2 -0
- package/dist/cdn/chunks/dist-DghiKH0A.js +2 -0
- package/dist/cdn/chunks/dist-Dw8ckvfK.js +2 -0
- package/dist/cdn/chunks/dist-H07p0KAw.js +2 -0
- package/dist/cdn/chunks/{dist-B878xb_62.js → dist-KYv9v_1z2.js} +11 -11
- package/dist/cdn/chunks/{dist-B878xb_62.js.map → dist-KYv9v_1z2.js.map} +1 -1
- package/dist/cdn/chunks/{dist-DLWHlekl.js → dist-MjnKIc0W.js} +1 -1
- package/dist/cdn/chunks/{dist-CllLxIMQ.js → dist-odp0vGRv.js} +1 -1
- package/dist/cdn/chunks/{extensions-B_kcV0tK.js → extensions-Bj7USRLr.js} +20 -20
- package/dist/cdn/chunks/{extensions-B_kcV0tK.js.map → extensions-Bj7USRLr.js.map} +1 -1
- package/dist/cdn/chunks/{features-ofOGnSC0.js → features-Ds0XUfte.js} +1235 -1198
- package/dist/cdn/chunks/features-Ds0XUfte.js.map +1 -0
- package/dist/cdn/chunks/{icons-bIb7PBOE.js → icons-fWsuSvgd.js} +2 -2
- package/dist/cdn/chunks/{icons-bIb7PBOE.js.map → icons-fWsuSvgd.js.map} +1 -1
- package/dist/cdn/chunks/{media-library-BIYzV2Y2.js → media-library-BGQm_OyC.js} +528 -528
- package/dist/cdn/chunks/{media-library-BIYzV2Y2.js.map → media-library-BGQm_OyC.js.map} +1 -1
- package/dist/cdn/chunks/{src-BuW9oYtm.js → src-3i8rPuqd.js} +4 -4
- package/dist/cdn/chunks/{src-BuW9oYtm.js.map → src-3i8rPuqd.js.map} +1 -1
- package/dist/cdn/chunks/{styleConstants-1KwsBMxJ.js → styleConstants-DFe3I4Op.js} +6 -6
- package/dist/cdn/chunks/{styleConstants-1KwsBMxJ.js.map → styleConstants-DFe3I4Op.js.map} +1 -1
- package/dist/cdn/chunks/{styles-DQFExz-T.js → styles-Dgijy53u.js} +1224 -1096
- package/dist/cdn/chunks/styles-Dgijy53u.js.map +1 -0
- package/dist/cdn/chunks/{tiptap-DplY-S-k.js → tiptap-BhxaWR8R.js} +2 -2
- package/dist/cdn/chunks/{tiptap-DplY-S-k.js.map → tiptap-BhxaWR8R.js.map} +1 -1
- package/dist/cdn/editor.css +1 -1
- package/dist/cdn/editor.js +110 -139
- package/dist/cdn/editor.js.map +1 -1
- package/dist/{dist-BkIys9zn.js → dist-Ci5lFuUy.js} +1 -1
- package/dist/{extensions-DEjfEFhD.js → extensions-DWx_jj8v.js} +1 -1
- package/dist/{styleConstants-D4SOZGBV.js → styleConstants-Cxw88naD.js} +5 -5
- package/dist/{styles-CgLaxDfu.js → styles-fdXNRqI3.js} +1341 -1213
- package/dist/templatical-editor.css +1 -1
- package/dist/templatical-editor.js +99 -129
- package/dist/templatical-editor.umd.cjs +55 -64
- package/dist/{useEditorCore-CjwRMl7K.js → useEditorCore-DUGD6pq_.js} +1054 -1033
- package/package.json +4 -2
- package/dist/CloudEditor-DFyuRxUV.js +0 -926
- package/dist/ParagraphEditor-CcMPnbDr.js +0 -652
- package/dist/TemplateScoringPanel-D58A23Vq.js +0 -249
- package/dist/cdn/chunks/AiChatSidebar-CmPTbTFG.js +0 -2
- package/dist/cdn/chunks/AiFeatureMenu-lxVm1RjH.js.map +0 -1
- package/dist/cdn/chunks/CloudEditor-Bmp5IlWi.js +0 -900
- package/dist/cdn/chunks/CloudEditor-Bmp5IlWi.js.map +0 -1
- package/dist/cdn/chunks/CommentsSidebar-BOelj4Ca.js +0 -2
- package/dist/cdn/chunks/DesignReferenceSidebar-Bf6rg0A7.js +0 -2
- package/dist/cdn/chunks/ModuleBrowserModal-CxDXzkKS.js.map +0 -1
- package/dist/cdn/chunks/ParagraphEditor-DHdu6lb3.js +0 -503
- package/dist/cdn/chunks/ParagraphEditor-DHdu6lb3.js.map +0 -1
- package/dist/cdn/chunks/SaveModuleDialog-DVna2xUl.js.map +0 -1
- package/dist/cdn/chunks/SnapshotHistory-BFF2SsTN.js +0 -2
- package/dist/cdn/chunks/TemplateScoringPanel-gi8wc_m7.js +0 -2
- package/dist/cdn/chunks/TestEmailModal-Qtd6aC-6.js +0 -2
- package/dist/cdn/chunks/dist-B6AUkMyh.js +0 -2
- package/dist/cdn/chunks/dist-Bf1Op9A1.js +0 -2
- package/dist/cdn/chunks/dist-CWsl6S1K.js +0 -2
- package/dist/cdn/chunks/dist-Cs0wFwdw.js +0 -2
- package/dist/cdn/chunks/dist-DS3_HVpX.js +0 -2
- package/dist/cdn/chunks/dist-DTXopj1a.js +0 -2
- package/dist/cdn/chunks/dist-DnwLoNLm.js +0 -2
- package/dist/cdn/chunks/features-ofOGnSC0.js.map +0 -1
- package/dist/cdn/chunks/styles-DQFExz-T.js.map +0 -1
|
@@ -1,40 +1,51 @@
|
|
|
1
1
|
import { o as e, s as t } from "./dist-CG-vEqSU.js";
|
|
2
|
-
import { C as n, f as ee, g as te, r as ne } from "./keys-C0MQRs8d.js";
|
|
3
|
-
import { n as
|
|
2
|
+
import { C as n, T as r, f as ee, g as te, r as ne } from "./keys-C0MQRs8d.js";
|
|
3
|
+
import { n as i, t as a } from "./_plugin-vue_export-helper-B1-bu7yR.js";
|
|
4
4
|
import { t as re } from "./circle-alert-E2vYPs5r.js";
|
|
5
5
|
import { t as ie } from "./loader-circle-BTQQxC3l.js";
|
|
6
6
|
import { t as ae } from "./send-C0ltAQrv.js";
|
|
7
|
-
import { t as
|
|
7
|
+
import { t as o } from "./sparkles-KhBCGlqB.js";
|
|
8
8
|
import { t as oe } from "./trash-2-OwjZ-guZ.js";
|
|
9
|
-
import { t as
|
|
10
|
-
import { t as
|
|
11
|
-
import { Fragment as
|
|
12
|
-
import { useAiChat as
|
|
13
|
-
var
|
|
9
|
+
import { t as s } from "./x-CGlq2XQe.js";
|
|
10
|
+
import { t as se } from "./LoadingTrack-vK8W2PJf.js";
|
|
11
|
+
import { Fragment as c, Transition as ce, createBlock as l, createCommentVNode as u, createElementBlock as d, createElementVNode as f, createTextVNode as p, createVNode as m, defineComponent as h, inject as le, nextTick as ue, normalizeClass as de, onBeforeUnmount as g, openBlock as _, ref as v, renderList as y, toDisplayString as b, unref as x, vModelText as fe, watch as S, withCtx as pe, withDirectives as C } from "vue";
|
|
12
|
+
import { useAiChat as w } from "@templatical/core/cloud";
|
|
13
|
+
var T = i("redo-2", [["path", {
|
|
14
14
|
d: "m15 14 5-5-5-5",
|
|
15
15
|
key: "12vg1m"
|
|
16
16
|
}], ["path", {
|
|
17
17
|
d: "M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13",
|
|
18
18
|
key: "6uklza"
|
|
19
|
-
}]]),
|
|
19
|
+
}]]), E = i("undo-2", [["path", {
|
|
20
20
|
d: "M9 14 4 9l5-5",
|
|
21
21
|
key: "102s5s"
|
|
22
22
|
}], ["path", {
|
|
23
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
24
|
key: "f3b9sd"
|
|
25
|
-
}]])
|
|
25
|
+
}]]);
|
|
26
|
+
//#endregion
|
|
27
|
+
//#region src/composables/useAliveFlag.ts
|
|
28
|
+
function D() {
|
|
29
|
+
let e = { alive: !0 };
|
|
30
|
+
return g(() => {
|
|
31
|
+
e.alive = !1;
|
|
32
|
+
}), e;
|
|
33
|
+
}
|
|
34
|
+
//#endregion
|
|
35
|
+
//#region src/cloud/components/AiChatSidebar.vue?vue&type=script&setup=true&lang.ts
|
|
36
|
+
var O = {
|
|
26
37
|
key: 0,
|
|
27
38
|
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
|
-
},
|
|
39
|
+
}, k = { class: "tpl:flex tpl:items-center tpl:justify-between tpl:border-b tpl:border-[var(--tpl-border)] tpl:px-4 tpl:py-3" }, A = { class: "tpl:flex tpl:items-center tpl:gap-1.5 tpl:text-sm tpl:font-medium tpl:text-[var(--tpl-primary)]" }, j = { class: "tpl:flex tpl:items-center tpl:gap-1" }, M = ["title"], N = { class: "tpl:relative tpl:flex tpl:min-h-0 tpl:flex-1 tpl:flex-col" }, P = {
|
|
29
40
|
key: 0,
|
|
30
41
|
class: "tpl:flex tpl:h-full tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-3 tpl:text-center"
|
|
31
|
-
},
|
|
42
|
+
}, F = { class: "tpl:text-sm tpl:text-[var(--tpl-text-muted)]" }, I = {
|
|
32
43
|
key: 1,
|
|
33
44
|
class: "tpl:flex tpl:h-full tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-3 tpl:text-center"
|
|
34
|
-
},
|
|
45
|
+
}, L = { class: "tpl:max-w-[240px] tpl:text-sm tpl:text-[var(--tpl-text-muted)]" }, R = {
|
|
35
46
|
key: 2,
|
|
36
47
|
class: "tpl:flex tpl:flex-col tpl:gap-4"
|
|
37
|
-
},
|
|
48
|
+
}, z = {
|
|
38
49
|
key: 0,
|
|
39
50
|
class: "tpl:self-end tpl:rounded-[var(--tpl-radius-sm)] tpl:px-3.5 tpl:py-2.5 tpl:text-sm",
|
|
40
51
|
style: {
|
|
@@ -43,10 +54,10 @@ var C = r("redo-2", [["path", {
|
|
|
43
54
|
"max-width": "85%",
|
|
44
55
|
"box-shadow": "var(--tpl-shadow)"
|
|
45
56
|
}
|
|
46
|
-
},
|
|
57
|
+
}, B = {
|
|
47
58
|
key: 1,
|
|
48
59
|
class: "tpl:flex tpl:flex-col tpl:gap-2"
|
|
49
|
-
},
|
|
60
|
+
}, me = {
|
|
50
61
|
key: 1,
|
|
51
62
|
class: "tpl:rounded-[var(--tpl-radius-sm)] tpl:px-3.5 tpl:py-2.5 tpl:text-sm tpl:whitespace-pre-wrap",
|
|
52
63
|
style: {
|
|
@@ -55,66 +66,69 @@ var C = r("redo-2", [["path", {
|
|
|
55
66
|
color: "var(--tpl-text)",
|
|
56
67
|
"box-shadow": "var(--tpl-shadow)"
|
|
57
68
|
}
|
|
58
|
-
},
|
|
69
|
+
}, he = {
|
|
59
70
|
key: 0,
|
|
60
71
|
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
72
|
style: {
|
|
62
73
|
"background-color": "var(--tpl-danger-light)",
|
|
63
74
|
color: "var(--tpl-danger)"
|
|
64
75
|
}
|
|
65
|
-
},
|
|
76
|
+
}, ge = {
|
|
66
77
|
key: 1,
|
|
67
78
|
class: "tpl:absolute tpl:right-0 tpl:bottom-0 tpl:left-0 tpl:z-10 tpl:px-3 tpl:pb-3",
|
|
68
79
|
style: {
|
|
69
80
|
"background-color": "color-mix(\n in srgb,\n var(--tpl-bg) 50%,\n transparent\n )",
|
|
70
81
|
"backdrop-filter": "blur(2px)"
|
|
71
82
|
}
|
|
72
|
-
},
|
|
83
|
+
}, _e = { class: "tpl:flex tpl:flex-col tpl:gap-1.5" }, ve = ["onClick"], ye = { class: "tpl:border-t tpl:p-3 tpl:border-[var(--tpl-border)]" }, be = { 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)]" }, xe = ["placeholder", "disabled"], Se = ["disabled"], Ce = { class: "tpl:m-0 tpl:px-1 tpl:pt-2 tpl:text-center tpl:text-[11px] tpl:text-[var(--tpl-text-dim)]" }, V = /* @__PURE__ */ a(/* @__PURE__ */ h({
|
|
73
84
|
__name: "AiChatSidebar",
|
|
74
85
|
props: {
|
|
75
86
|
visible: { type: Boolean },
|
|
76
87
|
onApply: { type: Function }
|
|
77
88
|
},
|
|
78
89
|
emits: ["close"],
|
|
79
|
-
setup(
|
|
80
|
-
let
|
|
81
|
-
authManager:
|
|
82
|
-
getTemplateId: () =>
|
|
83
|
-
onApply:
|
|
90
|
+
setup(i, { emit: a }) {
|
|
91
|
+
let h = i, g = a, V = r(n, "AiChatSidebar"), H = r(ee, "AiChatSidebar"), we = r(ne, "AiChatSidebar"), U = le(te, []), W = D(), G = w({
|
|
92
|
+
authManager: we,
|
|
93
|
+
getTemplateId: () => H.state.template?.id ?? null,
|
|
94
|
+
onApply: h.onApply,
|
|
84
95
|
onError: void 0
|
|
85
|
-
}), K =
|
|
96
|
+
}), K = v(""), q = v(null), J = v(!1), Y = v(0), { pause: X, resume: Te } = e(() => {
|
|
86
97
|
let e = G.suggestions.value?.length ?? 0;
|
|
87
98
|
Y.value < e ? Y.value++ : X();
|
|
88
|
-
}, 150, { immediate: !1 }), { start:
|
|
89
|
-
|
|
99
|
+
}, 150, { immediate: !1 }), { start: Ee } = t(() => Te(), 100, { immediate: !1 });
|
|
100
|
+
S(() => G.suggestions.value?.length ?? 0, (e) => {
|
|
90
101
|
if (X(), e === 0) {
|
|
91
102
|
Y.value = 0;
|
|
92
103
|
return;
|
|
93
104
|
}
|
|
94
|
-
Y.value = 0,
|
|
105
|
+
Y.value = 0, Ee();
|
|
95
106
|
});
|
|
96
107
|
function Z() {
|
|
97
|
-
|
|
108
|
+
ue(() => {
|
|
98
109
|
q.value && (q.value.scrollTop = q.value.scrollHeight);
|
|
99
110
|
});
|
|
100
111
|
}
|
|
101
|
-
|
|
102
|
-
e && !J.value
|
|
112
|
+
S(() => G.messages.value?.length ?? 0, () => Z()), S(() => h.visible, async (e) => {
|
|
113
|
+
if (e && !J.value) {
|
|
114
|
+
if (J.value = !0, await G.loadConversation(), !W.alive) return;
|
|
115
|
+
(G.messages.value?.length ?? 0) === 0 && H.content.value.blocks.length === 0 && G.loadSuggestions(H.content.value, U);
|
|
116
|
+
}
|
|
103
117
|
});
|
|
104
118
|
async function Q() {
|
|
105
119
|
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,
|
|
120
|
+
!e || G.isGenerating.value || (K.value = "", G.error.value = null, G.failedPrompt.value = null, Z(), await G.sendPrompt(e, H.content.value, U), W.alive && (G.failedPrompt.value && (K.value = G.failedPrompt.value), Z()));
|
|
107
121
|
}
|
|
108
122
|
function $(e) {
|
|
109
123
|
return e.replace(/```json[\s\S]*?```/g, "").replace(/```json[\s\S]*/g, "").trim();
|
|
110
124
|
}
|
|
111
|
-
function
|
|
125
|
+
function De(e) {
|
|
112
126
|
X(), K.value = e, Q();
|
|
113
127
|
}
|
|
114
|
-
function
|
|
128
|
+
function Oe(e) {
|
|
115
129
|
e.key === "Enter" && !e.shiftKey && (e.preventDefault(), Q());
|
|
116
130
|
}
|
|
117
|
-
return (e, t) => (
|
|
131
|
+
return (e, t) => (_(), l(ce, {
|
|
118
132
|
"enter-active-class": "tpl-ai-slide-enter-active",
|
|
119
133
|
"enter-from-class": "tpl:translate-x-full",
|
|
120
134
|
"enter-to-class": "tpl:translate-x-0",
|
|
@@ -122,42 +136,42 @@ var C = r("redo-2", [["path", {
|
|
|
122
136
|
"leave-from-class": "tpl:translate-x-0",
|
|
123
137
|
"leave-to-class": "tpl:translate-x-full"
|
|
124
138
|
}, {
|
|
125
|
-
default:
|
|
126
|
-
|
|
139
|
+
default: pe(() => [i.visible ? (_(), d("div", O, [
|
|
140
|
+
f("div", k, [f("div", A, [m(x(o), {
|
|
127
141
|
size: 13,
|
|
128
142
|
"stroke-width": 2
|
|
129
|
-
}),
|
|
143
|
+
}), f("span", null, b(x(V).aiChat.title), 1)]), f("div", j, [(x(G).messages.value?.length ?? 0) > 0 ? (_(), d("button", {
|
|
130
144
|
key: 0,
|
|
131
145
|
class: "tpl:rounded-md tpl:p-0.5 tpl:transition-colors tpl:duration-150 tpl:text-[var(--tpl-text-muted)]",
|
|
132
|
-
title:
|
|
133
|
-
onClick: t[0] ||= (e) =>
|
|
134
|
-
}, [
|
|
146
|
+
title: x(V).aiChat.clear,
|
|
147
|
+
onClick: t[0] ||= (e) => x(G).clearChat()
|
|
148
|
+
}, [m(x(oe), {
|
|
135
149
|
size: 14,
|
|
136
150
|
"stroke-width": 2
|
|
137
|
-
})], 8,
|
|
151
|
+
})], 8, M)) : u("", !0), f("button", {
|
|
138
152
|
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) =>
|
|
140
|
-
}, [
|
|
153
|
+
onClick: t[1] ||= (e) => g("close")
|
|
154
|
+
}, [m(x(s), {
|
|
141
155
|
size: 14,
|
|
142
156
|
"stroke-width": 2
|
|
143
157
|
})])])]),
|
|
144
|
-
|
|
145
|
-
|
|
158
|
+
f("div", N, [
|
|
159
|
+
f("div", {
|
|
146
160
|
ref_key: "messagesContainer",
|
|
147
161
|
ref: q,
|
|
148
162
|
class: "tpl:flex-1 tpl:overflow-y-auto tpl:p-4"
|
|
149
|
-
}, [
|
|
163
|
+
}, [x(G).isLoadingHistory.value ? (_(), d("div", P, [m(x(ie), {
|
|
150
164
|
class: "tpl-spinner tpl:text-[var(--tpl-text-muted)]",
|
|
151
165
|
size: 24,
|
|
152
166
|
"stroke-width": 2
|
|
153
|
-
}),
|
|
167
|
+
}), f("p", F, b(x(V).aiChat.loadingHistory), 1)])) : (x(G).messages.value?.length ?? 0) === 0 ? (_(), d("div", I, [m(x(o), {
|
|
154
168
|
size: 32,
|
|
155
169
|
"stroke-width": 1.5,
|
|
156
170
|
class: "tpl:text-[var(--tpl-text-dim)]"
|
|
157
|
-
}),
|
|
171
|
+
}), f("p", L, b(x(V).aiChat.placeholder), 1)])) : (_(), d("div", R, [(_(!0), d(c, null, y(x(G).messages.value, (e, n) => (_(), d("div", {
|
|
158
172
|
key: e.id,
|
|
159
173
|
class: "tpl:flex tpl:flex-col tpl:gap-2"
|
|
160
|
-
}, [e.role === "user" ? (
|
|
174
|
+
}, [e.role === "user" ? (_(), d("div", z, b(e.content), 1)) : (_(), d("div", B, [!$(e.content) && x(G).isGenerating.value && n === (x(G).messages.value?.length ?? 0) - 1 ? (_(), l(se, { key: 0 })) : (_(), d("div", me, b($(e.content) || x(V).aiChat.applied), 1)), e.id === x(G).lastApplyMessageId.value && !x(G).isGenerating.value ? (_(), d("button", {
|
|
161
175
|
key: 2,
|
|
162
176
|
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
177
|
style: {
|
|
@@ -165,50 +179,50 @@ var C = r("redo-2", [["path", {
|
|
|
165
179
|
color: "var(--tpl-text-muted)",
|
|
166
180
|
"background-color": "transparent"
|
|
167
181
|
},
|
|
168
|
-
onClick: t[2] ||= (e) =>
|
|
169
|
-
}, [
|
|
182
|
+
onClick: t[2] ||= (e) => x(G).toggleLastRevert()
|
|
183
|
+
}, [x(G).isLastChangeReverted.value ? (_(), d(c, { key: 0 }, [m(x(T), {
|
|
170
184
|
size: 12,
|
|
171
185
|
"stroke-width": 2
|
|
172
|
-
}),
|
|
186
|
+
}), p(" " + b(x(V).aiChat.reapply), 1)], 64)) : (_(), d(c, { key: 1 }, [m(x(E), {
|
|
173
187
|
size: 12,
|
|
174
188
|
"stroke-width": 2
|
|
175
|
-
}),
|
|
176
|
-
|
|
189
|
+
}), p(" " + b(x(V).aiChat.revert), 1)], 64))])) : u("", !0)]))]))), 128))]))], 512),
|
|
190
|
+
x(G).error.value ? (_(), d("div", he, [m(x(re), {
|
|
177
191
|
size: 14,
|
|
178
192
|
"stroke-width": 2,
|
|
179
193
|
class: "tpl:mt-0.5 tpl:shrink-0"
|
|
180
|
-
}),
|
|
181
|
-
(
|
|
194
|
+
}), f("span", null, b(x(G).error.value === "ai_apply_failed" ? x(V).aiChat.applyFailed : x(V).aiChat.error), 1)])) : u("", !0),
|
|
195
|
+
(x(G).suggestions.value?.length ?? 0) > 0 ? (_(), d("div", ge, [f("div", _e, [(_(!0), d(c, null, y(x(G).suggestions.value ?? [], (e, t) => (_(), d("button", {
|
|
182
196
|
key: t,
|
|
183
|
-
class:
|
|
197
|
+
class: de(["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", (x(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
198
|
style: {
|
|
185
199
|
"border-color": "var(--tpl-border)",
|
|
186
200
|
color: "var(--tpl-primary)",
|
|
187
201
|
"background-color": "var(--tpl-bg)",
|
|
188
202
|
"box-shadow": "var(--tpl-shadow)"
|
|
189
203
|
},
|
|
190
|
-
onClick: (t) =>
|
|
191
|
-
},
|
|
204
|
+
onClick: (t) => De(e)
|
|
205
|
+
}, b(e), 11, ve))), 128))])])) : u("", !0)
|
|
192
206
|
]),
|
|
193
|
-
|
|
207
|
+
f("div", ye, [f("div", be, [C(f("textarea", {
|
|
194
208
|
"onUpdate:modelValue": t[3] ||= (e) => K.value = e,
|
|
195
209
|
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:
|
|
197
|
-
disabled:
|
|
210
|
+
placeholder: x(V).aiChat.inputPlaceholder,
|
|
211
|
+
disabled: x(G).isGenerating.value,
|
|
198
212
|
rows: "3",
|
|
199
|
-
onKeydown:
|
|
200
|
-
}, null, 40,
|
|
213
|
+
onKeydown: Oe
|
|
214
|
+
}, null, 40, xe), [[fe, K.value]]), f("button", {
|
|
201
215
|
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() ||
|
|
216
|
+
disabled: !K.value.trim() || x(G).isGenerating.value,
|
|
203
217
|
onClick: Q
|
|
204
|
-
}, [
|
|
218
|
+
}, [m(x(ae), {
|
|
205
219
|
size: 16,
|
|
206
220
|
"stroke-width": 2
|
|
207
|
-
})], 8,
|
|
208
|
-
])) :
|
|
221
|
+
})], 8, Se)]), f("p", Ce, b(x(V).aiMenu.disclaimer), 1)])
|
|
222
|
+
])) : u("", !0)]),
|
|
209
223
|
_: 1
|
|
210
224
|
}));
|
|
211
225
|
}
|
|
212
|
-
}), [["__scopeId", "data-v-
|
|
226
|
+
}), [["__scopeId", "data-v-da2a9f9a"]]);
|
|
213
227
|
//#endregion
|
|
214
228
|
export { V as default };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import "./useEditorCore-
|
|
2
|
-
import {
|
|
3
|
-
import { t } from "./useI18n-D6m7ZUgY.js";
|
|
4
|
-
import { t as
|
|
5
|
-
import { t as
|
|
6
|
-
import { t as
|
|
7
|
-
import { t as
|
|
8
|
-
import { Fragment as
|
|
1
|
+
import "./useEditorCore-DUGD6pq_.js";
|
|
2
|
+
import { T as e, t } from "./keys-C0MQRs8d.js";
|
|
3
|
+
import { t as n } from "./useI18n-D6m7ZUgY.js";
|
|
4
|
+
import { t as r } from "./_plugin-vue_export-helper-B1-bu7yR.js";
|
|
5
|
+
import { t as i } from "./image-up-X4xIq4ea.js";
|
|
6
|
+
import { t as a } from "./shield-check-f-qv4RKs.js";
|
|
7
|
+
import { t as o } from "./sparkles-KhBCGlqB.js";
|
|
8
|
+
import { Fragment as s, computed as c, createBlock as l, createElementBlock as u, createElementVNode as d, defineComponent as f, normalizeStyle as p, openBlock as m, renderList as h, resolveDynamicComponent as g, toDisplayString as _ } from "vue";
|
|
9
9
|
//#region src/cloud/components/AiFeatureMenu.vue?vue&type=script&setup=true&lang.ts
|
|
10
10
|
var v = {
|
|
11
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)]",
|
|
@@ -13,51 +13,51 @@ var v = {
|
|
|
13
13
|
"backdrop-filter": "blur(8px)",
|
|
14
14
|
"-webkit-backdrop-filter": "blur(8px)"
|
|
15
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__ */
|
|
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__ */ r(/* @__PURE__ */ f({
|
|
17
17
|
__name: "AiFeatureMenu",
|
|
18
18
|
props: { activeFeature: {} },
|
|
19
19
|
emits: ["select"],
|
|
20
|
-
setup(
|
|
21
|
-
let C =
|
|
20
|
+
setup(r, { emit: f }) {
|
|
21
|
+
let C = f, { t: w } = n(), T = e(t, "AiFeatureMenu"), E = {
|
|
22
22
|
"ai-chat": "chat",
|
|
23
23
|
"design-reference": "designToTemplate",
|
|
24
24
|
scoring: "scoring"
|
|
25
25
|
}, D = [
|
|
26
26
|
{
|
|
27
27
|
key: "ai-chat",
|
|
28
|
-
icon:
|
|
28
|
+
icon: o
|
|
29
29
|
},
|
|
30
30
|
{
|
|
31
31
|
key: "design-reference",
|
|
32
|
-
icon:
|
|
32
|
+
icon: i
|
|
33
33
|
},
|
|
34
34
|
{
|
|
35
35
|
key: "scoring",
|
|
36
|
-
icon:
|
|
36
|
+
icon: a
|
|
37
37
|
}
|
|
38
|
-
], O =
|
|
38
|
+
], O = c(() => D.filter((e) => T.isFeatureEnabled(E[e.key])));
|
|
39
39
|
function k(e) {
|
|
40
40
|
return e === "ai-chat" ? w.aiMenu.aiAssistant : e === "design-reference" ? w.aiMenu.designToTemplate : w.aiMenu.templateScore;
|
|
41
41
|
}
|
|
42
42
|
function A(e) {
|
|
43
43
|
return e === "ai-chat" ? w.aiMenu.aiAssistantDesc : e === "design-reference" ? w.aiMenu.designToTemplateDesc : w.aiMenu.templateScoreDesc;
|
|
44
44
|
}
|
|
45
|
-
return (e, t) => (m(),
|
|
45
|
+
return (e, t) => (m(), u("div", v, [(m(!0), u(s, null, h(O.value, (e) => (m(), u("button", {
|
|
46
46
|
key: e.key,
|
|
47
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:
|
|
48
|
+
style: p({ backgroundColor: r.activeFeature === e.key ? "var(--tpl-primary-light)" : "transparent" }),
|
|
49
49
|
onClick: (t) => C("select", e.key)
|
|
50
|
-
}, [
|
|
50
|
+
}, [d("div", {
|
|
51
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
52
|
style: p({
|
|
53
|
-
backgroundColor:
|
|
54
|
-
color:
|
|
53
|
+
backgroundColor: r.activeFeature === e.key ? "var(--tpl-primary)" : "var(--tpl-bg-active)",
|
|
54
|
+
color: r.activeFeature === e.key ? "var(--tpl-bg)" : "var(--tpl-text-muted)"
|
|
55
55
|
})
|
|
56
|
-
}, [(m(),
|
|
56
|
+
}, [(m(), l(g(e.icon), {
|
|
57
57
|
size: 15,
|
|
58
58
|
"stroke-width": 2
|
|
59
|
-
}))], 4),
|
|
59
|
+
}))], 4), d("div", b, [d("span", x, _(k(e.key)), 1), d("span", S, _(A(e.key)), 1)])], 12, y))), 128))]));
|
|
60
60
|
}
|
|
61
|
-
}), [["__scopeId", "data-v-
|
|
61
|
+
}), [["__scopeId", "data-v-638e1be2"]]);
|
|
62
62
|
//#endregion
|
|
63
63
|
export { C as default };
|