@templatical/editor 0.0.1 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (130) hide show
  1. package/dist/AiChatSidebar-busJk9hm.js +214 -0
  2. package/dist/AiFeatureMenu-DLGv_-pj.js +63 -0
  3. package/dist/CloudEditor-BDnHd6Um.js +919 -0
  4. package/dist/CollaboratorBar-Dv3l52vC.js +91 -0
  5. package/dist/CommentsSidebar-4tjp0VU5.js +439 -0
  6. package/dist/DesignReferenceSidebar-CmwXvltV.js +273 -0
  7. package/dist/LoadingTrack-vK8W2PJf.js +10 -0
  8. package/dist/ModuleBrowserModal-lrk3Fr0H.js +205 -0
  9. package/dist/ModulePreviewCanvas-BcBJLnwL.js +106 -0
  10. package/dist/ParagraphEditor-DH8cSC6m.js +625 -0
  11. package/dist/RichTextEditorContent-CQqodi7p.js +133 -0
  12. package/dist/SaveModuleDialog-Bmzi72td.js +122 -0
  13. package/dist/SnapshotHistory-AEgi9Xsn.js +126 -0
  14. package/dist/TemplateScoringPanel-CTgMtc0-.js +249 -0
  15. package/dist/TestEmailModal-Dpq1is9S.js +94 -0
  16. package/dist/TitleEditor-CLcDdcWI.js +167 -0
  17. package/dist/TplModal-CGzRjR96.js +44 -0
  18. package/dist/_plugin-vue_export-helper-B1-bu7yR.js +47 -0
  19. package/dist/blockTypeIcons-BpPTqcok.js +126 -0
  20. package/dist/cdn/chunks/ParagraphEditor-CCtWbGDv.js +3 -0
  21. package/dist/cdn/chunks/ParagraphEditor-CCtWbGDv.js.map +1 -0
  22. package/dist/cdn/chunks/RichTextEditorContent-BUD9veXd.js +2 -0
  23. package/dist/cdn/chunks/RichTextEditorContent-BUD9veXd.js.map +1 -0
  24. package/dist/cdn/chunks/TitleEditor-e_UTyxjd.js +3 -0
  25. package/dist/cdn/chunks/TitleEditor-e_UTyxjd.js.map +1 -0
  26. package/dist/cdn/chunks/dist-0UheN8rK.js +1 -0
  27. package/dist/cdn/chunks/dist-55mmbGQ9.js +1 -0
  28. package/dist/cdn/chunks/dist-B31mxKyP.js +1 -0
  29. package/dist/cdn/chunks/dist-B5JI9nIg.js +1 -0
  30. package/dist/cdn/chunks/dist-B93vLKhU.js +1 -0
  31. package/dist/cdn/chunks/dist-BDt3FJvj.js +1 -0
  32. package/dist/cdn/chunks/dist-BJRuFHmi.js +1 -0
  33. package/dist/cdn/chunks/dist-BKSzrf0L.js +1 -0
  34. package/dist/cdn/chunks/dist-BL8c5gYQ.js +1 -0
  35. package/dist/cdn/chunks/dist-CYThWMP5.js +1 -0
  36. package/dist/cdn/chunks/dist-DxZbPJYt.js +1 -0
  37. package/dist/cdn/chunks/draggable-ClUwYCFL.js +17 -0
  38. package/dist/cdn/chunks/draggable-ClUwYCFL.js.map +1 -0
  39. package/dist/cdn/chunks/emojiData-6fVLNqeH.js +2 -0
  40. package/dist/cdn/chunks/emojiData-6fVLNqeH.js.map +1 -0
  41. package/dist/cdn/chunks/extensions-ea_ewKUl.js +2 -0
  42. package/dist/cdn/chunks/extensions-ea_ewKUl.js.map +1 -0
  43. package/dist/cdn/chunks/icons-vmLJTaJk.js +2 -0
  44. package/dist/cdn/chunks/icons-vmLJTaJk.js.map +1 -0
  45. package/dist/cdn/chunks/rolldown-runtime-BakkzWXw.js +1 -0
  46. package/dist/cdn/chunks/styleConstants-CNejCb-L.js +2 -0
  47. package/dist/cdn/chunks/styleConstants-CNejCb-L.js.map +1 -0
  48. package/dist/cdn/chunks/tiptap-Cya4P9CN.js +145 -0
  49. package/dist/cdn/chunks/tiptap-Cya4P9CN.js.map +1 -0
  50. package/dist/cdn/chunks/useEditorCore-CwuxQuvh.js +2 -0
  51. package/dist/cdn/chunks/useEditorCore-CwuxQuvh.js.map +1 -0
  52. package/dist/cdn/chunks/useMergeTag-DVOz1v9p.js +2 -0
  53. package/dist/cdn/chunks/useMergeTag-DVOz1v9p.js.map +1 -0
  54. package/dist/cdn/editor.css +1 -0
  55. package/dist/cdn/editor.js +2 -0
  56. package/dist/cdn/editor.js.map +1 -0
  57. package/dist/check-B7kDuZmP.js +7 -0
  58. package/dist/chevron-down-DJLW2Q9Z.js +7 -0
  59. package/dist/circle-alert-E2vYPs5r.js +25 -0
  60. package/dist/clock-lWIIQA3C.js +12 -0
  61. package/dist/de-B4Ob4vCo.js +682 -0
  62. package/dist/dist-4LiM9FDd.js +35 -0
  63. package/dist/dist-Bu7veieH.js +776 -0
  64. package/dist/dist-C1BIRHCQ.js +61 -0
  65. package/dist/dist-CG-vEqSU.js +314 -0
  66. package/dist/dist-C_ymrGFi.js +10625 -0
  67. package/dist/dist-ChAGLpWo.js +35 -0
  68. package/dist/dist-D_HQYSY-.js +189 -0
  69. package/dist/dist-DkypH7qG.js +5 -0
  70. package/dist/dist-DmOE-Ubp.js +74 -0
  71. package/dist/dist-DmpMJbmZ.js +513 -0
  72. package/dist/dist-DrvKRSU6.js +47 -0
  73. package/dist/dist-Dxnd0GRf.js +5 -0
  74. package/dist/dist-DysAFIPy.js +2054 -0
  75. package/dist/emojiData-BfWQS72m.js +17 -0
  76. package/dist/en-YXsspZJG.js +682 -0
  77. package/dist/extensions-CKM99njP.js +420 -0
  78. package/dist/formatRelativeTime-DX3FgqN9.js +8 -0
  79. package/dist/i18n-CJsFtdbZ.js +23 -0
  80. package/dist/image-up-X4xIq4ea.js +23 -0
  81. package/dist/keys-Dwa2PmdD.js +10 -0
  82. package/dist/liquid.browser-BemTg3sZ.js +3272 -0
  83. package/dist/loader-circle-BTQQxC3l.js +7 -0
  84. package/dist/message-circle-Blgm6V_h.js +7 -0
  85. package/dist/refresh-cw-Bb4PEeW1.js +44 -0
  86. package/dist/scan-line-7lZPfOdm.js +25 -0
  87. package/dist/send-C0ltAQrv.js +10 -0
  88. package/dist/shield-check-f-qv4RKs.js +10 -0
  89. package/dist/sparkles-KhBCGlqB.js +23 -0
  90. package/dist/styleConstants-D4SOZGBV.js +94 -0
  91. package/dist/styles-DSw1VNU3.js +3406 -0
  92. package/dist/templatical-editor.css +2 -1
  93. package/dist/templatical-editor.js +242 -9
  94. package/dist/templatical-editor.umd.cjs +112 -524
  95. package/dist/timeouts-CmBrLeZA.js +4 -0
  96. package/dist/trash-2-OwjZ-guZ.js +25 -0
  97. package/dist/triangle-alert-DOSRIUYZ.js +17 -0
  98. package/dist/useEditorCore-Cc4RCwWq.js +5556 -0
  99. package/dist/useI18n-DUirdXEX.js +17 -0
  100. package/dist/useMergeTag-DVnlvPYJ.js +33 -0
  101. package/dist/x-CGlq2XQe.js +10 -0
  102. package/package.json +30 -20
  103. package/dist/AiChatSidebar-0vx9TP5B.js +0 -305
  104. package/dist/AiFeatureMenu-CI-v74ND.js +0 -69
  105. package/dist/CloudEditor-Wdfv_9xn.js +0 -1132
  106. package/dist/CollaboratorBar-B3uV4Wtw.js +0 -89
  107. package/dist/CommentsSidebar-PVUlloyB.js +0 -655
  108. package/dist/DesignReferenceSidebar-DAlAWrxU.js +0 -351
  109. package/dist/ModuleBrowserModal-1JEcChd8.js +0 -323
  110. package/dist/ModulePreviewCanvas-Cdp484Ae.js +0 -169
  111. package/dist/SaveModuleDialog-eNyr3XKn.js +0 -168
  112. package/dist/SnapshotHistory-D-ZiIj1v.js +0 -169
  113. package/dist/TemplateScoringPanel-DSZPo15C.js +0 -385
  114. package/dist/TestEmailModal-Cwre5elw.js +0 -128
  115. package/dist/TextEditor-BuUOIByX.js +0 -780
  116. package/dist/de-BWIAblxs.js +0 -685
  117. package/dist/en-cYyUzNV1.js +0 -685
  118. package/dist/index-0tWUczNu.js +0 -47
  119. package/dist/index-4okvXjqk.js +0 -41
  120. package/dist/index-BSc6h5zo.js +0 -967
  121. package/dist/index-CrvwWlhN.js +0 -41
  122. package/dist/index-D-iD-7lO.js +0 -10961
  123. package/dist/index-D-ygXbc8.js +0 -2452
  124. package/dist/index-DbrWKz-e.js +0 -1415
  125. package/dist/index-DeUeHy6g.js +0 -422
  126. package/dist/index-Ude6e9RU.js +0 -41
  127. package/dist/index-ZQzHBwkr.js +0 -12767
  128. package/dist/liquid.browser-CeNxS2GL.js +0 -3493
  129. package/dist/loader-circle-tM9j2mRh.js +0 -13
  130. package/dist/shield-check-Ngi9jAQc.js +0 -20
@@ -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-Dwa2PmdD.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-Cc4RCwWq.js";
2
+ import { t as e } from "./keys-Dwa2PmdD.js";
3
+ import { t } from "./useI18n-DUirdXEX.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 };