@templatical/editor 0.0.4 → 0.0.6
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-CNhSl_ty.js +228 -0
- package/dist/{AiFeatureMenu-K44aZa_P.js → AiFeatureMenu-BFVsjUJY.js} +23 -23
- package/dist/CloudEditor-Bz5Xkxej.js +1082 -0
- package/dist/{CollaboratorBar-BuCEcdbB.js → CollaboratorBar-D2Gu5Xj2.js} +3 -3
- package/dist/{CommentsSidebar-2lcqMfIP.js → CommentsSidebar-CTeEAZTj.js} +131 -131
- package/dist/{DesignReferenceSidebar-CNMu4Zrx.js → DesignReferenceSidebar-u2tKSQK0.js} +52 -52
- package/dist/{LoadingTrack-vK8W2PJf.js → LoadingTrack--aUassFH.js} +1 -1
- package/dist/{ModuleBrowserModal-CvQ0xyQf.js → ModuleBrowserModal-DNxODPlX.js} +58 -58
- package/dist/{ModulePreviewCanvas-Be2B3Y07.js → ModulePreviewCanvas-DnGe1Y-2.js} +32 -32
- package/dist/ParagraphEditor-CYrzYJO5.js +688 -0
- package/dist/{RichTextEditorContent-CHJlh7HJ.js → RichTextEditorContent-BeqlWlWB.js} +2 -2
- package/dist/{SaveModuleDialog-BaaeH5Xm.js → SaveModuleDialog-Kde6X13X.js} +25 -25
- package/dist/{SnapshotHistory-BPfjiuu1.js → SnapshotHistory-B3EfIcLW.js} +7 -7
- package/dist/TemplateScoringPanel-D2vCRGgx.js +254 -0
- package/dist/{TestEmailModal-DIAlB3e_.js → TestEmailModal-Egk0DFDf.js} +3 -3
- package/dist/{TitleEditor-D9DPjQkX.js → TitleEditor-DwUpo4gF.js} +11 -11
- package/dist/{TplModal-CmTSvCY-.js → TplModal-BCruYWks.js} +4 -4
- package/dist/{_plugin-vue_export-helper-B1-bu7yR.js → _plugin-vue_export-helper-5TQrnOhO.js} +2 -2
- package/dist/{blockTypeIcons-D1RTWOkx.js → blockTypeIcons-rW4BUUNC.js} +2 -2
- package/dist/cdn/chunks/{AiFeatureMenu-lxVm1RjH.js → AiFeatureMenu-Dcbshcfu.js} +16 -16
- package/dist/cdn/chunks/AiFeatureMenu-Dcbshcfu.js.map +1 -0
- package/dist/cdn/chunks/CloudEditor-Bca3RyBW.js +1056 -0
- package/dist/cdn/chunks/CloudEditor-Bca3RyBW.js.map +1 -0
- package/dist/cdn/chunks/{CollaboratorBar-D2PKtlOw.js → CollaboratorBar-sToKJfHi.js} +4 -4
- package/dist/cdn/chunks/{CollaboratorBar-D2PKtlOw.js.map → CollaboratorBar-sToKJfHi.js.map} +1 -1
- package/dist/cdn/chunks/{ModuleBrowserModal-CxDXzkKS.js → ModuleBrowserModal-BNhwXbWw.js} +52 -52
- package/dist/cdn/chunks/ModuleBrowserModal-BNhwXbWw.js.map +1 -0
- package/dist/cdn/chunks/{ModulePreviewCanvas-DEfHampA.js → ModulePreviewCanvas-DylUylPU.js} +3 -3
- package/dist/cdn/chunks/{ModulePreviewCanvas-DEfHampA.js.map → ModulePreviewCanvas-DylUylPU.js.map} +1 -1
- package/dist/cdn/chunks/ParagraphEditor-BBw90y_p.js +539 -0
- package/dist/cdn/chunks/ParagraphEditor-BBw90y_p.js.map +1 -0
- package/dist/cdn/chunks/{RichTextEditorContent-DWUzizsC.js → RichTextEditorContent-DvyIO3nR.js} +5 -5
- package/dist/cdn/chunks/{RichTextEditorContent-DWUzizsC.js.map → RichTextEditorContent-DvyIO3nR.js.map} +1 -1
- package/dist/cdn/chunks/{SaveModuleDialog-DVna2xUl.js → SaveModuleDialog-DvbSHvhF.js} +24 -24
- package/dist/cdn/chunks/SaveModuleDialog-DvbSHvhF.js.map +1 -0
- package/dist/cdn/chunks/{TitleEditor-DDf_OcHS.js → TitleEditor-tS3mgoVr.js} +10 -10
- package/dist/cdn/chunks/{TitleEditor-DDf_OcHS.js.map → TitleEditor-tS3mgoVr.js.map} +1 -1
- package/dist/cdn/chunks/{blockTypeIcons-BnobReQm.js → blockTypeIcons-DbnbyEQE.js} +3 -3
- package/dist/cdn/chunks/{blockTypeIcons-BnobReQm.js.map → blockTypeIcons-DbnbyEQE.js.map} +1 -1
- package/dist/cdn/chunks/{de-BvYD17KT.js → de-CgUR_S5I.js} +1 -1
- package/dist/cdn/chunks/{de-BvYD17KT.js.map → de-CgUR_S5I.js.map} +1 -1
- package/dist/cdn/chunks/{de-BB3dgVOc.js → de-D8oDPhBD.js} +1 -1
- package/dist/cdn/chunks/de-D8oDPhBD.js.map +1 -0
- package/dist/cdn/chunks/{dist-B878xb_62.js → dist-BUmN5e4r.js} +15 -12
- package/dist/cdn/chunks/dist-BUmN5e4r.js.map +1 -0
- package/dist/cdn/chunks/{draggable-BQNU47zu.js → draggable-m78lz0gI.js} +1591 -1563
- package/dist/cdn/chunks/draggable-m78lz0gI.js.map +1 -0
- package/dist/cdn/chunks/{emojiData-BVEJHcNH.js → emojiData-CNNgvDqx.js} +1 -1
- package/dist/cdn/chunks/{emojiData-BVEJHcNH.js.map → emojiData-CNNgvDqx.js.map} +1 -1
- package/dist/cdn/chunks/{en-CpotcOPr.js → en-BBmfBDqY.js} +1 -1
- package/dist/cdn/chunks/{en-CpotcOPr.js.map → en-BBmfBDqY.js.map} +1 -1
- package/dist/cdn/chunks/{en-DeDcpnoS.js → en-HseRPPeK.js} +1 -1
- package/dist/cdn/chunks/en-HseRPPeK.js.map +1 -0
- package/dist/cdn/chunks/{extensions-B_kcV0tK.js → extensions-ClpY3m0W.js} +31 -31
- package/dist/cdn/chunks/{extensions-B_kcV0tK.js.map → extensions-ClpY3m0W.js.map} +1 -1
- package/dist/cdn/chunks/{features-ofOGnSC0.js → features-B5dGxWLi.js} +1645 -1608
- package/dist/cdn/chunks/features-B5dGxWLi.js.map +1 -0
- package/dist/cdn/chunks/{icons-bIb7PBOE.js → icons-hflTyPmb.js} +8 -8
- package/dist/cdn/chunks/icons-hflTyPmb.js.map +1 -0
- package/dist/cdn/chunks/{liquid.browser-C1VIYISn.js → liquid.browser-BxyRVCKv.js} +24 -17
- package/dist/cdn/chunks/liquid.browser-BxyRVCKv.js.map +1 -0
- package/dist/cdn/chunks/{media-library-BIYzV2Y2.js → media-library-Dgy-V-JA.js} +547 -543
- package/dist/cdn/chunks/{media-library-BIYzV2Y2.js.map → media-library-Dgy-V-JA.js.map} +1 -1
- package/dist/cdn/chunks/{pusher-DJPhQnE8.js → pusher-D-m2WSdL.js} +10 -7
- package/dist/cdn/chunks/pusher-D-m2WSdL.js.map +1 -0
- package/dist/cdn/chunks/readableTextColor-Cd_cgWO_.js.map +1 -1
- package/dist/cdn/chunks/{rolldown-runtime-DPITmOBR.js → rolldown-runtime-BNuo_Jkg.js} +1 -1
- package/dist/cdn/chunks/{src-BuW9oYtm.js → src-TDwMmqm0.js} +7 -7
- package/dist/cdn/chunks/{src-BuW9oYtm.js.map → src-TDwMmqm0.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-hCOCOR6K.js} +1229 -1101
- package/dist/cdn/chunks/styles-hCOCOR6K.js.map +1 -0
- package/dist/cdn/chunks/{tiptap-DplY-S-k.js → tiptap-C28NLMX8.js} +1531 -1309
- package/dist/cdn/chunks/tiptap-C28NLMX8.js.map +1 -0
- package/dist/cdn/editor.css +1 -1
- package/dist/cdn/editor.js +112 -141
- package/dist/cdn/editor.js.map +1 -1
- package/dist/{check-B7kDuZmP.js → check-B5S-C0bz.js} +1 -1
- package/dist/{chevron-down-DJLW2Q9Z.js → chevron-down-CjsV1T0W.js} +1 -1
- package/dist/{circle-alert-E2vYPs5r.js → circle-alert-CVTmJHKW.js} +1 -1
- package/dist/{clock-lWIIQA3C.js → clock-CAjdSHBy.js} +1 -1
- package/dist/{dist-CG-vEqSU.js → dist-Ac4o1O4a.js} +2 -2
- package/dist/{dist-BkIys9zn.js → dist-B4LTlrAn.js} +6 -6
- package/dist/{dist-ChAGLpWo.js → dist-BTtKPcd2.js} +2 -2
- package/dist/{dist-C1BIRHCQ.js → dist-CBr-qhie.js} +2 -2
- package/dist/{dist-DmOE-Ubp.js → dist-COOFiBFV.js} +2 -2
- package/dist/{dist-4LiM9FDd.js → dist-COguaIvm.js} +2 -2
- package/dist/{dist-Bu7veieH.js → dist-Crqkuf-w.js} +2 -2
- package/dist/{dist-DkypH7qG.js → dist-DEJZ9iAU.js} +2 -2
- package/dist/{dist-D_HQYSY-.js → dist-DHYuVJ_7.js} +2 -2
- package/dist/{dist-C_ymrGFi.js → dist-DJrDTuRr.js} +973 -958
- package/dist/{dist-DysAFIPy.js → dist-DPM-DFvh.js} +142 -114
- package/dist/{dist-DrvKRSU6.js → dist-DfqLGwSF.js} +2 -2
- package/dist/dist-DmVOCJjI.js +5 -0
- package/dist/{extensions-DEjfEFhD.js → extensions-C6xp_B7K.js} +3 -3
- package/dist/{image-up-X4xIq4ea.js → image-up-vZa1Txr-.js} +1 -1
- package/dist/index.d.ts +223 -0
- package/dist/{liquid.browser-BemTg3sZ.js → liquid.browser-C02owkex.js} +20 -15
- package/dist/{loader-circle-BTQQxC3l.js → loader-circle-DilFjHSk.js} +1 -1
- package/dist/{message-circle-Blgm6V_h.js → message-circle-Dpcnc2oa.js} +1 -1
- package/dist/{refresh-cw-Bb4PEeW1.js → refresh-cw-4r7rkHHX.js} +1 -1
- package/dist/rolldown-runtime-gEudmnaM.js +23 -0
- package/dist/{scan-line-7lZPfOdm.js → scan-line-684IxPQ0.js} +1 -1
- package/dist/{send-C0ltAQrv.js → send-ChDw64yL.js} +1 -1
- package/dist/{shield-check-f-qv4RKs.js → shield-check-9dhLdyST.js} +1 -1
- package/dist/{sparkles-KhBCGlqB.js → sparkles-Co9fkDcv.js} +1 -1
- package/dist/{styleConstants-D4SOZGBV.js → styleConstants-RV3eYwkD.js} +6 -6
- package/dist/styles-nvxFh6L6.js +3557 -0
- package/dist/templatical-editor.css +1 -1
- package/dist/templatical-editor.js +111 -141
- package/dist/templatical-editor.umd.cjs +63 -73
- package/dist/{trash-2-OwjZ-guZ.js → trash-2-CZkMtjeC.js} +1 -1
- package/dist/{triangle-alert-DOSRIUYZ.js → triangle-alert-Dvt51agD.js} +1 -1
- package/dist/{useEditorCore-CjwRMl7K.js → useEditorCore-ColJh1ST.js} +1183 -1182
- package/dist/{x-CGlq2XQe.js → x-CU2XZOkQ.js} +1 -1
- package/package.json +52 -49
- package/dist/AiChatSidebar-CjfhTZwo.js +0 -214
- 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/de-BB3dgVOc.js.map +0 -1
- package/dist/cdn/chunks/dist-B6AUkMyh.js +0 -2
- package/dist/cdn/chunks/dist-B878xb_62.js.map +0 -1
- package/dist/cdn/chunks/dist-Bf1Op9A1.js +0 -2
- package/dist/cdn/chunks/dist-BkETaOfw.js +0 -2
- package/dist/cdn/chunks/dist-CJcMnY7o.js +0 -2
- package/dist/cdn/chunks/dist-CWsl6S1K.js +0 -2
- package/dist/cdn/chunks/dist-CllLxIMQ.js +0 -2
- package/dist/cdn/chunks/dist-Cs0wFwdw.js +0 -2
- package/dist/cdn/chunks/dist-DLWHlekl.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/draggable-BQNU47zu.js.map +0 -1
- package/dist/cdn/chunks/en-DeDcpnoS.js.map +0 -1
- package/dist/cdn/chunks/features-ofOGnSC0.js.map +0 -1
- package/dist/cdn/chunks/icons-bIb7PBOE.js.map +0 -1
- package/dist/cdn/chunks/liquid.browser-C1VIYISn.js.map +0 -1
- package/dist/cdn/chunks/pusher-DJPhQnE8.js.map +0 -1
- package/dist/cdn/chunks/styles-DQFExz-T.js.map +0 -1
- package/dist/cdn/chunks/tiptap-DplY-S-k.js.map +0 -1
- package/dist/dist-Dxnd0GRf.js +0 -5
- package/dist/styles-CgLaxDfu.js +0 -3428
- /package/dist/{de-D7TLGIPA.js → de-Dh8ON-dm.js} +0 -0
- /package/dist/{emojiData-BfWQS72m.js → emojiData-Qc8mH_zW.js} +0 -0
- /package/dist/{en-DvtiEMwP.js → en-C7IShRSD.js} +0 -0
- /package/dist/{formatRelativeTime-DX3FgqN9.js → formatRelativeTime-D8f6NR7i.js} +0 -0
- /package/dist/{readableTextColor-LDlmVEUv.js → readableTextColor-B809bF5J.js} +0 -0
- /package/dist/{useMergeTag-BZ3X0bNr.js → useMergeTag-CSXcnFBc.js} +0 -0
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
import { o as e, s as t } from "./dist-Ac4o1O4a.js";
|
|
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-5TQrnOhO.js";
|
|
4
|
+
import { t as re } from "./circle-alert-CVTmJHKW.js";
|
|
5
|
+
import { t as ie } from "./loader-circle-DilFjHSk.js";
|
|
6
|
+
import { t as ae } from "./send-ChDw64yL.js";
|
|
7
|
+
import { t as o } from "./sparkles-Co9fkDcv.js";
|
|
8
|
+
import { t as oe } from "./trash-2-CZkMtjeC.js";
|
|
9
|
+
import { t as s } from "./x-CU2XZOkQ.js";
|
|
10
|
+
import { t as se } from "./LoadingTrack--aUassFH.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
|
+
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
|
+
}]]), E = i("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
|
+
}]]);
|
|
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 = {
|
|
37
|
+
key: 0,
|
|
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)]"
|
|
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 = {
|
|
40
|
+
key: 0,
|
|
41
|
+
class: "tpl:flex tpl:h-full tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-3 tpl:text-center"
|
|
42
|
+
}, F = { class: "tpl:text-sm tpl:text-[var(--tpl-text-muted)]" }, I = {
|
|
43
|
+
key: 1,
|
|
44
|
+
class: "tpl:flex tpl:h-full tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-3 tpl:text-center"
|
|
45
|
+
}, L = { class: "tpl:max-w-[240px] tpl:text-sm tpl:text-[var(--tpl-text-muted)]" }, R = {
|
|
46
|
+
key: 2,
|
|
47
|
+
class: "tpl:flex tpl:flex-col tpl:gap-4"
|
|
48
|
+
}, z = {
|
|
49
|
+
key: 0,
|
|
50
|
+
class: "tpl:self-end tpl:rounded-[var(--tpl-radius-sm)] tpl:px-3.5 tpl:py-2.5 tpl:text-sm",
|
|
51
|
+
style: {
|
|
52
|
+
"background-color": "var(--tpl-primary-light)",
|
|
53
|
+
color: "var(--tpl-text)",
|
|
54
|
+
"max-width": "85%",
|
|
55
|
+
"box-shadow": "var(--tpl-shadow)"
|
|
56
|
+
}
|
|
57
|
+
}, B = {
|
|
58
|
+
key: 1,
|
|
59
|
+
class: "tpl:flex tpl:flex-col tpl:gap-2"
|
|
60
|
+
}, me = {
|
|
61
|
+
key: 1,
|
|
62
|
+
class: "tpl:rounded-[var(--tpl-radius-sm)] tpl:px-3.5 tpl:py-2.5 tpl:text-sm tpl:whitespace-pre-wrap",
|
|
63
|
+
style: {
|
|
64
|
+
"max-width": "85%",
|
|
65
|
+
"background-color": "var(--tpl-bg)",
|
|
66
|
+
color: "var(--tpl-text)",
|
|
67
|
+
"box-shadow": "var(--tpl-shadow)"
|
|
68
|
+
}
|
|
69
|
+
}, he = {
|
|
70
|
+
key: 0,
|
|
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",
|
|
72
|
+
style: {
|
|
73
|
+
"background-color": "var(--tpl-danger-light)",
|
|
74
|
+
color: "var(--tpl-danger)"
|
|
75
|
+
}
|
|
76
|
+
}, ge = {
|
|
77
|
+
key: 1,
|
|
78
|
+
class: "tpl:absolute tpl:right-0 tpl:bottom-0 tpl:left-0 tpl:z-10 tpl:px-3 tpl:pb-3",
|
|
79
|
+
style: {
|
|
80
|
+
"background-color": "color-mix(\n in srgb,\n var(--tpl-bg) 50%,\n transparent\n )",
|
|
81
|
+
"backdrop-filter": "blur(2px)"
|
|
82
|
+
}
|
|
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({
|
|
84
|
+
__name: "AiChatSidebar",
|
|
85
|
+
props: {
|
|
86
|
+
visible: { type: Boolean },
|
|
87
|
+
onApply: { type: Function }
|
|
88
|
+
},
|
|
89
|
+
emits: ["close"],
|
|
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,
|
|
95
|
+
onError: void 0
|
|
96
|
+
}), K = v(""), q = v(null), J = v(!1), Y = v(0), { pause: X, resume: Te } = e(() => {
|
|
97
|
+
let e = G.suggestions.value?.length ?? 0;
|
|
98
|
+
Y.value < e ? Y.value++ : X();
|
|
99
|
+
}, 150, { immediate: !1 }), { start: Ee } = t(() => Te(), 100, { immediate: !1 });
|
|
100
|
+
S(() => G.suggestions.value?.length ?? 0, (e) => {
|
|
101
|
+
if (X(), e === 0) {
|
|
102
|
+
Y.value = 0;
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
Y.value = 0, Ee();
|
|
106
|
+
});
|
|
107
|
+
function Z() {
|
|
108
|
+
ue(() => {
|
|
109
|
+
q.value && (q.value.scrollTop = q.value.scrollHeight);
|
|
110
|
+
});
|
|
111
|
+
}
|
|
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
|
+
}
|
|
117
|
+
});
|
|
118
|
+
async function Q() {
|
|
119
|
+
let e = K.value.trim();
|
|
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()));
|
|
121
|
+
}
|
|
122
|
+
function $(e) {
|
|
123
|
+
return e.replace(/```json[\s\S]*?```/g, "").replace(/```json[\s\S]*/g, "").trim();
|
|
124
|
+
}
|
|
125
|
+
function De(e) {
|
|
126
|
+
X(), K.value = e, Q();
|
|
127
|
+
}
|
|
128
|
+
function Oe(e) {
|
|
129
|
+
e.key === "Enter" && !e.shiftKey && (e.preventDefault(), Q());
|
|
130
|
+
}
|
|
131
|
+
return (e, t) => (_(), l(ce, {
|
|
132
|
+
"enter-active-class": "tpl-ai-slide-enter-active",
|
|
133
|
+
"enter-from-class": "tpl:translate-x-full",
|
|
134
|
+
"enter-to-class": "tpl:translate-x-0",
|
|
135
|
+
"leave-active-class": "tpl-ai-slide-leave-active",
|
|
136
|
+
"leave-from-class": "tpl:translate-x-0",
|
|
137
|
+
"leave-to-class": "tpl:translate-x-full"
|
|
138
|
+
}, {
|
|
139
|
+
default: pe(() => [i.visible ? (_(), d("div", O, [
|
|
140
|
+
f("div", k, [f("div", A, [m(x(o), {
|
|
141
|
+
size: 13,
|
|
142
|
+
"stroke-width": 2
|
|
143
|
+
}), f("span", null, b(x(V).aiChat.title), 1)]), f("div", j, [(x(G).messages.value?.length ?? 0) > 0 ? (_(), d("button", {
|
|
144
|
+
key: 0,
|
|
145
|
+
class: "tpl:rounded-md tpl:p-0.5 tpl:transition-colors tpl:duration-150 tpl:text-[var(--tpl-text-muted)]",
|
|
146
|
+
title: x(V).aiChat.clear,
|
|
147
|
+
onClick: t[0] ||= (e) => x(G).clearChat()
|
|
148
|
+
}, [m(x(oe), {
|
|
149
|
+
size: 14,
|
|
150
|
+
"stroke-width": 2
|
|
151
|
+
})], 8, M)) : u("", !0), f("button", {
|
|
152
|
+
class: "tpl:rounded-md tpl:p-0.5 tpl:transition-colors tpl:duration-150 tpl:text-[var(--tpl-text-muted)]",
|
|
153
|
+
onClick: t[1] ||= (e) => g("close")
|
|
154
|
+
}, [m(x(s), {
|
|
155
|
+
size: 14,
|
|
156
|
+
"stroke-width": 2
|
|
157
|
+
})])])]),
|
|
158
|
+
f("div", N, [
|
|
159
|
+
f("div", {
|
|
160
|
+
ref_key: "messagesContainer",
|
|
161
|
+
ref: q,
|
|
162
|
+
class: "tpl:flex-1 tpl:overflow-y-auto tpl:p-4"
|
|
163
|
+
}, [x(G).isLoadingHistory.value ? (_(), d("div", P, [m(x(ie), {
|
|
164
|
+
class: "tpl-spinner tpl:text-[var(--tpl-text-muted)]",
|
|
165
|
+
size: 24,
|
|
166
|
+
"stroke-width": 2
|
|
167
|
+
}), f("p", F, b(x(V).aiChat.loadingHistory), 1)])) : (x(G).messages.value?.length ?? 0) === 0 ? (_(), d("div", I, [m(x(o), {
|
|
168
|
+
size: 32,
|
|
169
|
+
"stroke-width": 1.5,
|
|
170
|
+
class: "tpl:text-[var(--tpl-text-dim)]"
|
|
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", {
|
|
172
|
+
key: e.id,
|
|
173
|
+
class: "tpl:flex tpl:flex-col tpl:gap-2"
|
|
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", {
|
|
175
|
+
key: 2,
|
|
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",
|
|
177
|
+
style: {
|
|
178
|
+
"border-color": "var(--tpl-border)",
|
|
179
|
+
color: "var(--tpl-text-muted)",
|
|
180
|
+
"background-color": "transparent"
|
|
181
|
+
},
|
|
182
|
+
onClick: t[2] ||= (e) => x(G).toggleLastRevert()
|
|
183
|
+
}, [x(G).isLastChangeReverted.value ? (_(), d(c, { key: 0 }, [m(x(T), {
|
|
184
|
+
size: 12,
|
|
185
|
+
"stroke-width": 2
|
|
186
|
+
}), p(" " + b(x(V).aiChat.reapply), 1)], 64)) : (_(), d(c, { key: 1 }, [m(x(E), {
|
|
187
|
+
size: 12,
|
|
188
|
+
"stroke-width": 2
|
|
189
|
+
}), p(" " + b(x(V).aiChat.revert), 1)], 64))])) : u("", !0)]))]))), 128))]))], 512),
|
|
190
|
+
x(G).error.value ? (_(), d("div", he, [m(x(re), {
|
|
191
|
+
size: 14,
|
|
192
|
+
"stroke-width": 2,
|
|
193
|
+
class: "tpl:mt-0.5 tpl:shrink-0"
|
|
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", {
|
|
196
|
+
key: t,
|
|
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"]),
|
|
198
|
+
style: {
|
|
199
|
+
"border-color": "var(--tpl-border)",
|
|
200
|
+
color: "var(--tpl-primary)",
|
|
201
|
+
"background-color": "var(--tpl-bg)",
|
|
202
|
+
"box-shadow": "var(--tpl-shadow)"
|
|
203
|
+
},
|
|
204
|
+
onClick: (t) => De(e)
|
|
205
|
+
}, b(e), 11, ve))), 128))])])) : u("", !0)
|
|
206
|
+
]),
|
|
207
|
+
f("div", ye, [f("div", be, [C(f("textarea", {
|
|
208
|
+
"onUpdate:modelValue": t[3] ||= (e) => K.value = e,
|
|
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)]",
|
|
210
|
+
placeholder: x(V).aiChat.inputPlaceholder,
|
|
211
|
+
disabled: x(G).isGenerating.value,
|
|
212
|
+
rows: "3",
|
|
213
|
+
onKeydown: Oe
|
|
214
|
+
}, null, 40, xe), [[fe, K.value]]), f("button", {
|
|
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)]",
|
|
216
|
+
disabled: !K.value.trim() || x(G).isGenerating.value,
|
|
217
|
+
onClick: Q
|
|
218
|
+
}, [m(x(ae), {
|
|
219
|
+
size: 16,
|
|
220
|
+
"stroke-width": 2
|
|
221
|
+
})], 8, Se)]), f("p", Ce, b(x(V).aiMenu.disclaimer), 1)])
|
|
222
|
+
])) : u("", !0)]),
|
|
223
|
+
_: 1
|
|
224
|
+
}));
|
|
225
|
+
}
|
|
226
|
+
}), [["__scopeId", "data-v-da2a9f9a"]]);
|
|
227
|
+
//#endregion
|
|
228
|
+
export { V as default };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import { t as
|
|
3
|
-
import
|
|
4
|
-
import { t as
|
|
5
|
-
import { t as
|
|
6
|
-
import { t as
|
|
7
|
-
import { t as
|
|
8
|
-
import { Fragment as
|
|
1
|
+
import { T as e, t } from "./keys-C0MQRs8d.js";
|
|
2
|
+
import { t as n } from "./useI18n-D6m7ZUgY.js";
|
|
3
|
+
import "./useEditorCore-ColJh1ST.js";
|
|
4
|
+
import { t as r } from "./_plugin-vue_export-helper-5TQrnOhO.js";
|
|
5
|
+
import { t as i } from "./image-up-vZa1Txr-.js";
|
|
6
|
+
import { t as a } from "./shield-check-9dhLdyST.js";
|
|
7
|
+
import { t as o } from "./sparkles-Co9fkDcv.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 };
|