@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
|
@@ -1,926 +0,0 @@
|
|
|
1
|
-
import { S as e, t } from "./useEditorCore-CjwRMl7K.js";
|
|
2
|
-
import { t as n } from "./timeouts-CmBrLeZA.js";
|
|
3
|
-
import { s as r, t as i } from "./dist-CG-vEqSU.js";
|
|
4
|
-
import { b as a, c as o, r as s, s as c, t as l, v as u, x as d } from "./keys-C0MQRs8d.js";
|
|
5
|
-
import { t as f } from "./useI18n-D6m7ZUgY.js";
|
|
6
|
-
import { n as p, t as m } from "./_plugin-vue_export-helper-B1-bu7yR.js";
|
|
7
|
-
import { t as h } from "./check-B7kDuZmP.js";
|
|
8
|
-
import { t as g } from "./circle-alert-E2vYPs5r.js";
|
|
9
|
-
import { a as ee, i as te, n as ne, o as re, r as ie, s as ae, t as oe } from "./styles-CgLaxDfu.js";
|
|
10
|
-
import { t as se } from "./clock-lWIIQA3C.js";
|
|
11
|
-
import { t as ce } from "./loader-circle-BTQQxC3l.js";
|
|
12
|
-
import { t as le } from "./message-circle-Blgm6V_h.js";
|
|
13
|
-
import { t as ue } from "./send-C0ltAQrv.js";
|
|
14
|
-
import { t as de } from "./sparkles-KhBCGlqB.js";
|
|
15
|
-
import { u as _ } from "./styleConstants-D4SOZGBV.js";
|
|
16
|
-
import { Fragment as fe, Transition as v, computed as y, createBlock as b, createCommentVNode as x, createElementBlock as S, createElementVNode as C, createStaticVNode as w, createTextVNode as T, createVNode as E, defineAsyncComponent as D, defineComponent as O, nextTick as pe, normalizeClass as k, normalizeStyle as me, onMounted as he, onScopeDispose as ge, onUnmounted as _e, openBlock as A, provide as j, ref as M, renderList as ve, shallowRef as ye, toDisplayString as N, unref as P, vShow as be, watch as xe, withCtx as F, withDirectives as Se, withModifiers as Ce } from "vue";
|
|
17
|
-
import { cloneBlock as we, isCustomBlock as Te } from "@templatical/types";
|
|
18
|
-
import { AuthManager as Ee, performHealthCheck as De, resolveWebSocketConfig as Oe, useAiConfig as ke, useCollaboration as Ae, useCollaborationBroadcast as je, useCommentListener as Me, useComments as Ne, useEditor as Pe, useExport as Fe, useMcpListener as Ie, usePlanConfig as Le, useSavedModules as Re, useSnapshotHistory as ze, useTemplateScoring as Be, useTestEmail as Ve, useWebSocket as He } from "@templatical/core/cloud";
|
|
19
|
-
var Ue = p("save", [
|
|
20
|
-
["path", {
|
|
21
|
-
d: "M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",
|
|
22
|
-
key: "1c8476"
|
|
23
|
-
}],
|
|
24
|
-
["path", {
|
|
25
|
-
d: "M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",
|
|
26
|
-
key: "1ydtos"
|
|
27
|
-
}],
|
|
28
|
-
["path", {
|
|
29
|
-
d: "M7 3v4a1 1 0 0 0 1 1h7",
|
|
30
|
-
key: "t51u73"
|
|
31
|
-
}]
|
|
32
|
-
]);
|
|
33
|
-
//#endregion
|
|
34
|
-
//#region src/cloud/composables/useSnapshotPreview.ts
|
|
35
|
-
function We(e) {
|
|
36
|
-
let { authManager: t, editor: n, history: r, conditionPreview: i, autoSave: a, onError: o } = e, s = ye(null), c = M(null), l = M(null), u = y(() => c.value !== null), d = y(() => s.value?.snapshots.value ?? []), f = y(() => s.value?.isLoading.value ?? !1), p = y(() => s.value?.isRestoring.value ?? !1);
|
|
37
|
-
function m() {
|
|
38
|
-
n.state.template?.id && !s.value && (s.value = ze({
|
|
39
|
-
authManager: t,
|
|
40
|
-
templateId: n.state.template.id,
|
|
41
|
-
onRestore: h,
|
|
42
|
-
onError: o
|
|
43
|
-
}), s.value.loadSnapshots());
|
|
44
|
-
}
|
|
45
|
-
function h(e) {
|
|
46
|
-
n.setContent(e.content, !1), r.clear(), i.reset();
|
|
47
|
-
}
|
|
48
|
-
async function g(e) {
|
|
49
|
-
if (c.value) {
|
|
50
|
-
c.value = e, n.setContent(e.content, !1);
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
n.state.isDirty && n.hasTemplate() && await n.createSnapshot(), l.value = structuredClone(n.content.value), a?.pause(), c.value = e, n.setContent(e.content, !1);
|
|
54
|
-
}
|
|
55
|
-
async function ee() {
|
|
56
|
-
if (!(!c.value || !s.value)) try {
|
|
57
|
-
await s.value.restoreSnapshot(c.value.id), await s.value.loadSnapshots();
|
|
58
|
-
} finally {
|
|
59
|
-
c.value = null, l.value = null, a?.resume();
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
function te() {
|
|
63
|
-
!c.value || !l.value || (n.setContent(l.value, !1), c.value = null, l.value = null, a?.resume());
|
|
64
|
-
}
|
|
65
|
-
async function ne() {
|
|
66
|
-
s.value && await s.value.loadSnapshots();
|
|
67
|
-
}
|
|
68
|
-
return {
|
|
69
|
-
snapshotHistoryInstance: s,
|
|
70
|
-
previewingSnapshot: c,
|
|
71
|
-
contentBeforePreview: l,
|
|
72
|
-
isPreviewingSnapshot: u,
|
|
73
|
-
snapshotHistorySnapshots: d,
|
|
74
|
-
snapshotHistoryIsLoading: f,
|
|
75
|
-
snapshotHistoryIsRestoring: p,
|
|
76
|
-
initSnapshotHistory: m,
|
|
77
|
-
handleRestore: h,
|
|
78
|
-
handleSnapshotNavigate: g,
|
|
79
|
-
confirmRestoreSnapshot: ee,
|
|
80
|
-
cancelPreview: te,
|
|
81
|
-
loadSnapshotHistory: ne
|
|
82
|
-
};
|
|
83
|
-
}
|
|
84
|
-
//#endregion
|
|
85
|
-
//#region src/cloud/composables/useCloudPanelState.ts
|
|
86
|
-
function Ge() {
|
|
87
|
-
let e = M(null), t = y({
|
|
88
|
-
get: () => e.value === "ai-chat",
|
|
89
|
-
set: (t) => e.value = t ? "ai-chat" : null
|
|
90
|
-
}), n = y({
|
|
91
|
-
get: () => e.value === "scoring",
|
|
92
|
-
set: (t) => e.value = t ? "scoring" : null
|
|
93
|
-
}), r = y({
|
|
94
|
-
get: () => e.value === "design-reference",
|
|
95
|
-
set: (t) => e.value = t ? "design-reference" : null
|
|
96
|
-
}), a = y({
|
|
97
|
-
get: () => e.value === "comments",
|
|
98
|
-
set: (t) => e.value = t ? "comments" : null
|
|
99
|
-
}), o = M(!1), s = M(!1), c = M(void 0), l = M(!1), u = M(null), d = y(() => e.value !== null), f = y(() => {
|
|
100
|
-
let t = e.value;
|
|
101
|
-
return t === "ai-chat" || t === "design-reference" || t === "scoring" ? t : null;
|
|
102
|
-
}), p = y(() => l.value || e.value === "ai-chat" || e.value === "design-reference" || e.value === "scoring");
|
|
103
|
-
function m() {
|
|
104
|
-
l.value = !l.value;
|
|
105
|
-
}
|
|
106
|
-
function h(t) {
|
|
107
|
-
l.value = !1, e.value = e.value === t ? null : t;
|
|
108
|
-
}
|
|
109
|
-
return i(u, () => {
|
|
110
|
-
l.value = !1;
|
|
111
|
-
}), {
|
|
112
|
-
activePanel: e,
|
|
113
|
-
aiChatOpen: t,
|
|
114
|
-
scoringPanelOpen: n,
|
|
115
|
-
designReferenceOpen: r,
|
|
116
|
-
commentsOpen: a,
|
|
117
|
-
testEmailModalOpen: o,
|
|
118
|
-
mediaLibraryOpen: s,
|
|
119
|
-
mediaLibraryAccept: c,
|
|
120
|
-
aiMenuOpen: l,
|
|
121
|
-
aiMenuRef: u,
|
|
122
|
-
rightPanelOpen: d,
|
|
123
|
-
activeAiFeature: f,
|
|
124
|
-
aiButtonActive: p,
|
|
125
|
-
toggleAiMenu: m,
|
|
126
|
-
handleAiFeatureSelect: h
|
|
127
|
-
};
|
|
128
|
-
}
|
|
129
|
-
//#endregion
|
|
130
|
-
//#region src/cloud/composables/useCollabUndoWarning.ts
|
|
131
|
-
function Ke(e) {
|
|
132
|
-
let { isCollaborationEnabled: t, getCollaboratorCount: i, canUndo: a } = e, o = M(!1), s = M(!1), { start: c } = r(() => {
|
|
133
|
-
s.value = !1;
|
|
134
|
-
}, n, { immediate: !1 });
|
|
135
|
-
function l() {
|
|
136
|
-
o.value || !t.value || i() === 0 || !a.value || (o.value = !0, s.value = !0, c());
|
|
137
|
-
}
|
|
138
|
-
return {
|
|
139
|
-
collabUndoWarningVisible: s,
|
|
140
|
-
showCollabUndoWarning: l
|
|
141
|
-
};
|
|
142
|
-
}
|
|
143
|
-
//#endregion
|
|
144
|
-
//#region src/cloud/composables/useCloudFeatureFlags.ts
|
|
145
|
-
function qe(e) {
|
|
146
|
-
let { planConfigInstance: t, aiConfig: n, editor: i } = e, a = y(() => t.hasFeature("ai_generation") && n.hasAnyMenuFeature.value), o = y(() => t.hasFeature("test_email")), s = y(() => !!i.state.template?.id), c = y(() => t.hasFeature("white_label")), l = y(() => t.config.value?.limits.max_templates ?? null), u = y(() => t.config.value?.template_count ?? 0), d = M(!1), f = M("idle"), p = M(""), { start: m } = r(() => {
|
|
147
|
-
f.value = "idle";
|
|
148
|
-
}, 3e3, { immediate: !1 });
|
|
149
|
-
return {
|
|
150
|
-
canUseAiGeneration: a,
|
|
151
|
-
canSendTestEmail: o,
|
|
152
|
-
hasTemplateSaved: s,
|
|
153
|
-
isWhiteLabeled: c,
|
|
154
|
-
templateLimit: l,
|
|
155
|
-
templateCount: u,
|
|
156
|
-
isSaveExporting: d,
|
|
157
|
-
saveStatus: f,
|
|
158
|
-
saveErrorMessage: p,
|
|
159
|
-
startSaveStatusClear: m
|
|
160
|
-
};
|
|
161
|
-
}
|
|
162
|
-
//#endregion
|
|
163
|
-
//#region src/cloud/composables/useCloudMediaLibrary.ts
|
|
164
|
-
function Je(e) {
|
|
165
|
-
let { onRequestMedia: t, mediaLibraryOpen: n, mediaLibraryAccept: r } = e, i = null;
|
|
166
|
-
async function a() {
|
|
167
|
-
if (t) {
|
|
168
|
-
let e = await t({ accept: ["images"] });
|
|
169
|
-
return e ? {
|
|
170
|
-
url: e.url,
|
|
171
|
-
alt: e.alt_text || void 0
|
|
172
|
-
} : null;
|
|
173
|
-
}
|
|
174
|
-
return r.value = ["images"], n.value = !0, new Promise((e) => {
|
|
175
|
-
i = (t) => {
|
|
176
|
-
e(t);
|
|
177
|
-
};
|
|
178
|
-
});
|
|
179
|
-
}
|
|
180
|
-
function o(e) {
|
|
181
|
-
n.value = !1, i?.({
|
|
182
|
-
url: e.url,
|
|
183
|
-
alt: e.alt_text || void 0
|
|
184
|
-
}), i = null;
|
|
185
|
-
}
|
|
186
|
-
function s() {
|
|
187
|
-
n.value = !1, i?.(null), i = null;
|
|
188
|
-
}
|
|
189
|
-
return ge(() => {
|
|
190
|
-
i &&= (i(null), null);
|
|
191
|
-
}), {
|
|
192
|
-
handleRequestMedia: a,
|
|
193
|
-
handleMediaSelect: o,
|
|
194
|
-
handleMediaLibraryClose: s
|
|
195
|
-
};
|
|
196
|
-
}
|
|
197
|
-
//#endregion
|
|
198
|
-
//#region src/cloud/components/CloudLoadingOverlay.vue?vue&type=script&setup=true&lang.ts
|
|
199
|
-
var Ye = {
|
|
200
|
-
key: 0,
|
|
201
|
-
class: "tpl-loading tpl:absolute tpl:inset-0 tpl:z-overlay tpl:flex tpl:flex-col tpl:bg-[var(--tpl-bg)]"
|
|
202
|
-
}, I = { class: "tpl:flex tpl:flex-1 tpl:overflow-hidden" }, Xe = { class: "tpl:flex tpl:w-12 tpl:shrink-0 tpl:flex-col tpl:items-center tpl:gap-4 tpl:py-5 tpl:border-r tpl:border-[var(--tpl-border)]" }, Ze = /* @__PURE__ */ O({
|
|
203
|
-
__name: "CloudLoadingOverlay",
|
|
204
|
-
props: { visible: { type: Boolean } },
|
|
205
|
-
setup(e) {
|
|
206
|
-
return (t, n) => e.visible ? (A(), S("div", Ye, [n[1] ||= w("<div class=\"tpl:flex tpl:h-14 tpl:shrink-0 tpl:items-center tpl:justify-between tpl:px-4 tpl:border-b tpl:border-[var(--tpl-border)]\"><div class=\"tpl-shimmer tpl:h-5 tpl:w-28 tpl:rounded-[var(--tpl-radius-sm)]\"></div><div class=\"tpl:flex tpl:gap-3\"><div class=\"tpl-shimmer tpl:h-8 tpl:w-20 tpl:rounded-[var(--tpl-radius-sm)]\"></div><div class=\"tpl-shimmer tpl:h-8 tpl:w-20 tpl:rounded-[var(--tpl-radius-sm)]\"></div></div></div>", 1), C("div", I, [C("div", Xe, [(A(), S(fe, null, ve(5, (e) => C("div", {
|
|
207
|
-
key: e,
|
|
208
|
-
class: "tpl-shimmer tpl:size-7 tpl:rounded-[var(--tpl-radius-sm)]"
|
|
209
|
-
})), 64))]), n[0] ||= w("<div class=\"tpl:flex tpl:flex-1 tpl:items-start tpl:justify-center tpl:overflow-auto tpl:p-8 tpl:bg-[var(--tpl-canvas-bg)]\"><div class=\"tpl:w-full tpl:max-w-[600px] tpl:rounded-[var(--tpl-radius)] tpl:p-6 tpl:bg-[var(--tpl-bg)] tpl:shadow-[var(--tpl-shadow-sm)]\"><div class=\"tpl:space-y-2 tpl:py-4\"><div class=\"tpl-shimmer tpl:h-3 tpl:w-3/4 tpl:rounded\"></div><div class=\"tpl-shimmer tpl:h-3 tpl:w-full tpl:rounded\"></div><div class=\"tpl-shimmer tpl:h-3 tpl:w-5/6 tpl:rounded\"></div></div><div class=\"tpl:py-4\"><div class=\"tpl-shimmer tpl:h-44 tpl:w-full tpl:rounded-[var(--tpl-radius-sm)]\"></div></div><div class=\"tpl:space-y-2 tpl:py-4\"><div class=\"tpl-shimmer tpl:h-3 tpl:w-full tpl:rounded\"></div><div class=\"tpl-shimmer tpl:h-3 tpl:w-2/3 tpl:rounded\"></div></div><div class=\"tpl:flex tpl:justify-center tpl:py-4\"><div class=\"tpl-shimmer tpl:h-10 tpl:w-36 tpl:rounded-[var(--tpl-radius-sm)]\"></div></div><div class=\"tpl:space-y-2 tpl:py-4\"><div class=\"tpl-shimmer tpl:mx-auto tpl:h-2.5 tpl:w-1/2 tpl:rounded\"></div><div class=\"tpl-shimmer tpl:mx-auto tpl:h-2.5 tpl:w-1/3 tpl:rounded\"></div></div></div></div><div class=\"tpl:flex tpl:w-[320px] tpl:shrink-0 tpl:flex-col tpl:gap-4 tpl:p-4 tpl:border-l tpl:border-[var(--tpl-border)]\"><div class=\"tpl-shimmer tpl:h-8 tpl:rounded-[var(--tpl-radius-sm)]\"></div><div class=\"tpl-shimmer tpl:h-32 tpl:rounded-[var(--tpl-radius)]\"></div><div class=\"tpl-shimmer tpl:h-32 tpl:rounded-[var(--tpl-radius)]\"></div></div>", 2)])])) : x("", !0);
|
|
210
|
-
}
|
|
211
|
-
}), L = {
|
|
212
|
-
key: 0,
|
|
213
|
-
role: "alert",
|
|
214
|
-
class: "tpl-error tpl:absolute tpl:inset-0 tpl:z-overlay tpl:flex tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-6 tpl:px-8 tpl:bg-[var(--tpl-bg)]"
|
|
215
|
-
}, R = { class: "tpl:flex tpl:size-16 tpl:items-center tpl:justify-center tpl:rounded-full tpl:bg-[var(--tpl-danger-light)]" }, z = { class: "tpl:flex tpl:flex-col tpl:items-center tpl:gap-2 tpl:text-center" }, B = { class: "tpl:text-lg tpl:font-semibold tpl:text-[var(--tpl-text)]" }, V = { class: "tpl:max-w-md tpl:text-sm tpl:text-[var(--tpl-text-muted)]" }, Qe = /* @__PURE__ */ O({
|
|
216
|
-
__name: "CloudErrorOverlay",
|
|
217
|
-
props: {
|
|
218
|
-
error: {},
|
|
219
|
-
visible: { type: Boolean }
|
|
220
|
-
},
|
|
221
|
-
emits: ["retry"],
|
|
222
|
-
setup(e, { emit: t }) {
|
|
223
|
-
let n = t, { t: r } = f();
|
|
224
|
-
function i(e) {
|
|
225
|
-
return "isUnauthorized" in e && e.isUnauthorized ? r.error.authFailed : "isNotFound" in e && e.isNotFound ? r.error.templateNotFound : r.error.defaultMessage;
|
|
226
|
-
}
|
|
227
|
-
function a(e) {
|
|
228
|
-
return "isNotFound" in e && !!e.isNotFound;
|
|
229
|
-
}
|
|
230
|
-
return (t, o) => e.visible && e.error ? (A(), S("div", L, [
|
|
231
|
-
C("div", R, [E(P(g), {
|
|
232
|
-
size: 32,
|
|
233
|
-
"stroke-width": 1.5,
|
|
234
|
-
class: "tpl:text-[var(--tpl-danger)]"
|
|
235
|
-
})]),
|
|
236
|
-
C("div", z, [C("h2", B, N(P(r).error.title), 1), C("p", V, N(i(e.error)), 1)]),
|
|
237
|
-
a(e.error) ? x("", !0) : (A(), S("button", {
|
|
238
|
-
key: 0,
|
|
239
|
-
class: "tpl-btn tpl-btn-primary tpl:inline-flex tpl:items-center tpl:gap-2 tpl:rounded-md tpl:px-4 tpl:py-2.5 tpl:text-sm tpl:font-medium tpl:shadow-xs tpl:transition-all tpl:duration-150 tpl:hover:opacity-90 tpl:bg-[var(--tpl-primary)] tpl:text-[var(--tpl-bg)]",
|
|
240
|
-
onClick: o[0] ||= (e) => n("retry")
|
|
241
|
-
}, N(P(r).error.retry), 1))
|
|
242
|
-
])) : x("", !0);
|
|
243
|
-
}
|
|
244
|
-
}), H = {
|
|
245
|
-
key: 0,
|
|
246
|
-
class: "tpl-preview-banner tpl:absolute tpl:top-14 tpl:right-0 tpl:left-0 tpl:z-40 tpl:flex tpl:items-center tpl:justify-center tpl:gap-4 tpl:px-4 tpl:py-3 tpl:bg-[var(--tpl-primary-light)] tpl:border-b tpl:border-[var(--tpl-primary)]"
|
|
247
|
-
}, $e = { class: "tpl:flex tpl:items-center tpl:gap-2 tpl:text-sm tpl:text-[var(--tpl-text)]" }, U = { class: "tpl:flex tpl:items-center tpl:gap-2" }, et = /* @__PURE__ */ O({
|
|
248
|
-
__name: "SnapshotPreviewBanner",
|
|
249
|
-
props: { visible: { type: Boolean } },
|
|
250
|
-
emits: ["cancel", "confirm"],
|
|
251
|
-
setup(e, { emit: t }) {
|
|
252
|
-
let n = t, { t: r } = f();
|
|
253
|
-
return (t, i) => e.visible ? (A(), S("div", H, [C("div", $e, [E(P(se), {
|
|
254
|
-
size: 18,
|
|
255
|
-
"stroke-width": 2,
|
|
256
|
-
class: "tpl:text-[var(--tpl-primary)]"
|
|
257
|
-
}), C("span", null, N(P(r).snapshotPreview.message), 1)]), C("div", U, [C("button", {
|
|
258
|
-
class: "tpl:rounded-md tpl:px-3 tpl:py-1.5 tpl:text-sm tpl:font-medium tpl:transition-all tpl:duration-150 tpl:text-[var(--tpl-text-muted)] tpl:border tpl:border-[var(--tpl-border)]",
|
|
259
|
-
style: { "background-color": "transparent" },
|
|
260
|
-
onClick: i[0] ||= (e) => n("cancel")
|
|
261
|
-
}, N(P(r).snapshotPreview.cancel), 1), C("button", {
|
|
262
|
-
class: "tpl:rounded-md tpl:px-3 tpl:py-1.5 tpl:text-sm tpl:font-medium tpl:transition-all tpl:duration-150 tpl:hover:opacity-90 tpl:bg-[var(--tpl-primary)] tpl:text-[var(--tpl-bg)]",
|
|
263
|
-
onClick: i[1] ||= (e) => n("confirm")
|
|
264
|
-
}, N(P(r).snapshotPreview.restore), 1)])])) : x("", !0);
|
|
265
|
-
}
|
|
266
|
-
}), W = {
|
|
267
|
-
key: 0,
|
|
268
|
-
role: "status",
|
|
269
|
-
"aria-live": "polite",
|
|
270
|
-
class: "tpl:absolute tpl:top-16 tpl:left-1/2 tpl:z-toast tpl:-translate-x-1/2 tpl:rounded-[var(--tpl-radius)] tpl:px-4 tpl:py-2.5 tpl:text-sm tpl:shadow-lg",
|
|
271
|
-
style: {
|
|
272
|
-
"background-color": "var(--tpl-warning-light)",
|
|
273
|
-
color: "var(--tpl-text)",
|
|
274
|
-
border: "1px solid var(--tpl-warning)"
|
|
275
|
-
}
|
|
276
|
-
}, tt = /* @__PURE__ */ O({
|
|
277
|
-
__name: "CollabUndoToast",
|
|
278
|
-
props: { visible: { type: Boolean } },
|
|
279
|
-
setup(e) {
|
|
280
|
-
let { t } = f();
|
|
281
|
-
return (n, r) => e.visible ? (A(), S("div", W, N(P(t).history.collabWarning), 1)) : x("", !0);
|
|
282
|
-
}
|
|
283
|
-
}), nt = ["data-tpl-theme"], rt = {
|
|
284
|
-
class: "tpl-header tpl:absolute tpl:top-0 tpl:right-0 tpl:left-0 tpl:z-50 tpl:grid tpl:h-14 tpl:grid-cols-[1fr_auto_1fr] tpl:items-center tpl:px-4",
|
|
285
|
-
style: {
|
|
286
|
-
"background-color": "color-mix(in srgb, var(--tpl-bg) 80%, transparent)",
|
|
287
|
-
"backdrop-filter": "blur(12px)",
|
|
288
|
-
"-webkit-backdrop-filter": "blur(12px)",
|
|
289
|
-
"box-shadow": "var(--tpl-shadow-md)",
|
|
290
|
-
"border-bottom": "1px solid var(--tpl-border)"
|
|
291
|
-
}
|
|
292
|
-
}, it = { class: "tpl-header-left tpl:flex tpl:min-w-[200px] tpl:items-center tpl:gap-3" }, at = {
|
|
293
|
-
key: 0,
|
|
294
|
-
class: "tpl-logo tpl:flex tpl:items-center tpl:gap-2.5 tpl:text-sm tpl:font-semibold tpl:text-[var(--tpl-text)]"
|
|
295
|
-
}, ot = ["src"], st = { style: { "letter-spacing": "-0.01em" } }, ct = {
|
|
296
|
-
key: 1,
|
|
297
|
-
class: "tpl:text-xs tpl:opacity-60 tpl:text-[var(--tpl-text-muted)]"
|
|
298
|
-
}, lt = { class: "tpl-header-center tpl:flex tpl:items-center tpl:justify-center tpl:gap-10" }, ut = { class: "tpl-header-right tpl:flex tpl:min-w-[200px] tpl:items-center tpl:justify-end tpl:gap-3" }, dt = ["data-tooltip"], ft = {
|
|
299
|
-
key: 1,
|
|
300
|
-
"aria-live": "polite",
|
|
301
|
-
class: "tpl-status tpl:flex tpl:items-center tpl:gap-1.5 tpl:text-xs tpl:text-[var(--tpl-success)]"
|
|
302
|
-
}, pt = {
|
|
303
|
-
key: 2,
|
|
304
|
-
"aria-live": "polite",
|
|
305
|
-
class: "tpl-status tpl:flex tpl:items-center tpl:gap-1.5 tpl:text-xs tpl:text-[var(--tpl-text-muted)]"
|
|
306
|
-
}, mt = ["aria-label", "aria-expanded"], ht = {
|
|
307
|
-
key: 0,
|
|
308
|
-
class: "tpl:inline-flex tpl:size-4.5 tpl:items-center tpl:justify-center tpl:rounded-full tpl:text-[10px] tpl:font-semibold tpl:bg-[var(--tpl-primary)] tpl:text-[var(--tpl-bg)]"
|
|
309
|
-
}, gt = ["aria-expanded"], _t = {
|
|
310
|
-
key: 0,
|
|
311
|
-
class: "tpl:absolute tpl:right-0 tpl:top-full tpl:z-50 tpl:mt-1 tpl:origin-top-right"
|
|
312
|
-
}, vt = ["disabled"], yt = ["disabled"], bt = { class: "tpl:sticky tpl:top-0 tpl:z-40 tpl:h-0" }, xt = { class: "tpl-main tpl:flex tpl:justify-center tpl:p-8" }, St = {
|
|
313
|
-
class: "tpl:pointer-events-auto tpl:flex tpl:items-center tpl:gap-1.5 tpl:rounded-tl-lg tpl:p-1",
|
|
314
|
-
style: {
|
|
315
|
-
"background-color": "color-mix(\n in srgb,\n var(--tpl-canvas-bg) 85%,\n transparent\n )",
|
|
316
|
-
"backdrop-filter": "blur(8px)",
|
|
317
|
-
"-webkit-backdrop-filter": "blur(8px)"
|
|
318
|
-
}
|
|
319
|
-
}, Ct = {
|
|
320
|
-
href: "https://github.com/templatical/sdk",
|
|
321
|
-
target: "_blank",
|
|
322
|
-
rel: "noopener noreferrer",
|
|
323
|
-
class: "tpl:transition-colors tpl:duration-150 hover:tpl:opacity-80 tpl:text-[var(--tpl-text-dim)]",
|
|
324
|
-
style: { "text-decoration": "none" }
|
|
325
|
-
}, wt = ["aria-label"], G = /* @__PURE__ */ m(/* @__PURE__ */ O({
|
|
326
|
-
__name: "CloudEditor",
|
|
327
|
-
props: {
|
|
328
|
-
config: {},
|
|
329
|
-
translations: {},
|
|
330
|
-
fontsManager: {}
|
|
331
|
-
},
|
|
332
|
-
emits: ["ready"],
|
|
333
|
-
setup(n, { expose: r, emit: i }) {
|
|
334
|
-
let f = D(() => import("./AiChatSidebar-CjfhTZwo.js")), p = D(() => import("./CommentsSidebar-2lcqMfIP.js")), m = D(() => import("./DesignReferenceSidebar-CNMu4Zrx.js")), se = D(() => import("./TemplateScoringPanel-D58A23Vq.js")), w = D(() => import("./TestEmailModal-DIAlB3e_.js")), O = D(() => import("./SaveModuleDialog-BaaeH5Xm.js")), ge = D(() => import("./ModuleBrowserModal-CvQ0xyQf.js")), ve = D(() => import("./SnapshotHistory-BPfjiuu1.js")), ye = D(() => import("./CollaboratorBar-BuCEcdbB.js")), ze = D(() => import("./AiFeatureMenu-K44aZa_P.js")), Ye = D(async () => (await import("@templatical/media-library")).MediaLibraryModal), I = n, Xe = i, L = M(!0), R = M(!1), z = M(null), B = !1, V = new Ee({
|
|
335
|
-
...I.config.auth,
|
|
336
|
-
onError: I.config.onError
|
|
337
|
-
}), H = Le({
|
|
338
|
-
authManager: V,
|
|
339
|
-
onError: I.config.onError
|
|
340
|
-
}), $e = M(/* @__PURE__ */ new Map()), U = Pe({
|
|
341
|
-
authManager: V,
|
|
342
|
-
defaultFontFamily: I.config.fonts?.defaultFont,
|
|
343
|
-
templateDefaults: I.config.templateDefaults,
|
|
344
|
-
onError: I.config.onError,
|
|
345
|
-
lockedBlocks: $e
|
|
346
|
-
}), W = He({
|
|
347
|
-
authManager: V,
|
|
348
|
-
onError: I.config.onError
|
|
349
|
-
});
|
|
350
|
-
I.config.mcp?.enabled && Ie({
|
|
351
|
-
editor: U,
|
|
352
|
-
channel: W.channel,
|
|
353
|
-
onOperation: I.config.mcp.onOperation
|
|
354
|
-
});
|
|
355
|
-
let G = null;
|
|
356
|
-
I.config.collaboration?.enabled && (G = Ae({
|
|
357
|
-
authManager: V,
|
|
358
|
-
editor: U,
|
|
359
|
-
channel: W.channel,
|
|
360
|
-
onError: I.config.onError,
|
|
361
|
-
onCollaboratorJoined: I.config.collaboration.onCollaboratorJoined,
|
|
362
|
-
onCollaboratorLeft: I.config.collaboration.onCollaboratorLeft,
|
|
363
|
-
onBlockLocked: I.config.collaboration.onBlockLocked,
|
|
364
|
-
onBlockUnlocked: I.config.collaboration.onBlockUnlocked
|
|
365
|
-
}), xe(() => G.lockedBlocks.value, (e) => {
|
|
366
|
-
$e.value = e;
|
|
367
|
-
}, { immediate: !0 }), je(U, G));
|
|
368
|
-
let Tt = y(() => !!I.config.collaboration?.enabled && H.hasFeature("collaboration")), Et = null, Dt = null, K = t({
|
|
369
|
-
editor: U,
|
|
370
|
-
config: {
|
|
371
|
-
uiTheme: I.config.uiTheme,
|
|
372
|
-
theme: void 0,
|
|
373
|
-
blockDefaults: I.config.blockDefaults,
|
|
374
|
-
customBlocks: [],
|
|
375
|
-
mergeTags: I.config.mergeTags,
|
|
376
|
-
displayConditions: I.config.displayConditions,
|
|
377
|
-
onRequestMedia: null,
|
|
378
|
-
onSave: () => {
|
|
379
|
-
Kt().catch((e) => {
|
|
380
|
-
I.config.onError?.(e);
|
|
381
|
-
});
|
|
382
|
-
}
|
|
383
|
-
},
|
|
384
|
-
translations: I.translations,
|
|
385
|
-
fontsManager: I.fontsManager,
|
|
386
|
-
historyOptions: G ? { isRemoteOperation: () => G._isProcessingRemoteOperation() } : void 0,
|
|
387
|
-
autoSaveOptions: {
|
|
388
|
-
onChange: async () => {
|
|
389
|
-
U.hasTemplate() && (await U.createSnapshot(), Et?.snapshotHistoryInstance.value?.loadSnapshots());
|
|
390
|
-
},
|
|
391
|
-
debounce: I.config.autoSaveDebounce ?? 5e3,
|
|
392
|
-
enabled: () => I.config.autoSave !== !1 && H.hasFeature("auto_save")
|
|
393
|
-
},
|
|
394
|
-
themeExtraStyles: () => ({ "--tpl-drop-text": `"${I.translations.canvas.dropHere}"` }),
|
|
395
|
-
keyboardOptions: { onBeforeUndo: () => Dt?.showCollabUndoWarning() }
|
|
396
|
-
}), Ot = Ke({
|
|
397
|
-
isCollaborationEnabled: Tt,
|
|
398
|
-
getCollaboratorCount: () => G?.collaborators.value.length ?? 0,
|
|
399
|
-
canUndo: K.history.canUndo
|
|
400
|
-
});
|
|
401
|
-
Dt = Ot;
|
|
402
|
-
let q = We({
|
|
403
|
-
authManager: V,
|
|
404
|
-
editor: U,
|
|
405
|
-
history: K.history,
|
|
406
|
-
conditionPreview: K.conditionPreview,
|
|
407
|
-
autoSave: K.autoSave,
|
|
408
|
-
onError: I.config.onError
|
|
409
|
-
});
|
|
410
|
-
Et = q;
|
|
411
|
-
let J = Ge(), kt = ke(I.config.ai), Y = qe({
|
|
412
|
-
planConfigInstance: H,
|
|
413
|
-
aiConfig: kt,
|
|
414
|
-
editor: U
|
|
415
|
-
}), At = Je({
|
|
416
|
-
onRequestMedia: I.config.onRequestMedia,
|
|
417
|
-
mediaLibraryOpen: J.mediaLibraryOpen,
|
|
418
|
-
mediaLibraryAccept: J.mediaLibraryAccept
|
|
419
|
-
});
|
|
420
|
-
e({
|
|
421
|
-
onBlockMove: U.moveBlock,
|
|
422
|
-
onBlockAdd: U.addBlock
|
|
423
|
-
});
|
|
424
|
-
let jt = Fe({
|
|
425
|
-
authManager: V,
|
|
426
|
-
getFontsConfig: () => I.config.fonts,
|
|
427
|
-
canUseCustomFonts: () => H.hasFeature("custom_fonts")
|
|
428
|
-
}), X = Ve({
|
|
429
|
-
authManager: V,
|
|
430
|
-
getTemplateId: () => U.state.template?.id ?? null,
|
|
431
|
-
save: () => U.save(),
|
|
432
|
-
exportHtml: (e) => jt.exportHtml(e),
|
|
433
|
-
onError: I.config.onError,
|
|
434
|
-
isAuthReady: R,
|
|
435
|
-
onBeforeTestEmail: I.config.onBeforeTestEmail
|
|
436
|
-
}), Z = Ne({
|
|
437
|
-
authManager: V,
|
|
438
|
-
getTemplateId: () => U.state.template?.id ?? null,
|
|
439
|
-
getSocketId: () => W.getSocketId(),
|
|
440
|
-
onComment: I.config.onComment,
|
|
441
|
-
onError: I.config.onError,
|
|
442
|
-
isAuthReady: R,
|
|
443
|
-
hasCommentingFeature: () => I.config.commenting !== !1 && H.hasFeature("commenting")
|
|
444
|
-
});
|
|
445
|
-
Me({
|
|
446
|
-
comments: Z,
|
|
447
|
-
channel: W.channel
|
|
448
|
-
});
|
|
449
|
-
let Q = Re({
|
|
450
|
-
authManager: V,
|
|
451
|
-
onError: I.config.onError
|
|
452
|
-
}), Mt = M(!1), Nt = M(null), $ = M(!1), Pt = Be({
|
|
453
|
-
authManager: V,
|
|
454
|
-
getTemplateId: () => U.state.template?.id ?? null
|
|
455
|
-
});
|
|
456
|
-
j(u, At.handleRequestMedia), j(s, V), j(l, kt), j(o, Z), j(a, Q), j(d, Pt), j(c, {
|
|
457
|
-
plan: H,
|
|
458
|
-
ai: kt,
|
|
459
|
-
comments: {
|
|
460
|
-
getBlockCount: (e) => Z.commentCountByBlock.value.get(e) ?? 0,
|
|
461
|
-
openForBlock: Rt
|
|
462
|
-
},
|
|
463
|
-
savedModules: {
|
|
464
|
-
openSaveDialog: (e) => {
|
|
465
|
-
Nt.value = e ?? null, Mt.value = !0;
|
|
466
|
-
},
|
|
467
|
-
openBrowser: () => {
|
|
468
|
-
$.value = !0;
|
|
469
|
-
},
|
|
470
|
-
moduleCount: y(() => Q.modules.value.length)
|
|
471
|
-
}
|
|
472
|
-
});
|
|
473
|
-
function Ft(e) {
|
|
474
|
-
H.hasFeature("theme_customization") && (K.themeOverrides.value = e);
|
|
475
|
-
}
|
|
476
|
-
function It(e) {
|
|
477
|
-
U.setUiTheme(e);
|
|
478
|
-
}
|
|
479
|
-
let Lt = M(null);
|
|
480
|
-
function Rt(e) {
|
|
481
|
-
J.commentsOpen.value = !0, pe(() => {
|
|
482
|
-
Lt.value?.filterByBlock(e);
|
|
483
|
-
});
|
|
484
|
-
}
|
|
485
|
-
async function zt(e) {
|
|
486
|
-
try {
|
|
487
|
-
await X.sendTestEmail(e), J.testEmailModalOpen.value = !1;
|
|
488
|
-
} catch {}
|
|
489
|
-
}
|
|
490
|
-
function Bt(e, t) {
|
|
491
|
-
for (let n = 0; n < e.content.length; n++) {
|
|
492
|
-
let r = we(e.content[n]), i = t === void 0 ? void 0 : t + n;
|
|
493
|
-
U.addBlock(r, void 0, void 0, i);
|
|
494
|
-
}
|
|
495
|
-
$.value = !1;
|
|
496
|
-
}
|
|
497
|
-
async function Vt(e) {
|
|
498
|
-
let t = async (e) => {
|
|
499
|
-
if (Te(e)) {
|
|
500
|
-
let t = e;
|
|
501
|
-
try {
|
|
502
|
-
t.renderedHtml = await K.registry.renderCustomBlock(t);
|
|
503
|
-
} catch {
|
|
504
|
-
t.renderedHtml = `<!-- Custom block render error: ${t.customType} -->`;
|
|
505
|
-
}
|
|
506
|
-
}
|
|
507
|
-
if (e.type === "section" && "children" in e) {
|
|
508
|
-
let n = e;
|
|
509
|
-
for (let e of n.children) for (let n of e) await t(n);
|
|
510
|
-
}
|
|
511
|
-
};
|
|
512
|
-
for (let n of e.blocks) await t(n);
|
|
513
|
-
}
|
|
514
|
-
async function Ht() {
|
|
515
|
-
L.value = !0, z.value = null;
|
|
516
|
-
try {
|
|
517
|
-
if (await V.initialize(), B) return;
|
|
518
|
-
R.value = !0;
|
|
519
|
-
let e = await De({ authManager: V });
|
|
520
|
-
if (B) return;
|
|
521
|
-
if (!e.api.ok) throw Error("Health check failed: API is not reachable");
|
|
522
|
-
if (!e.auth.ok) throw Error(`Health check failed: authentication error${e.auth.error ? ` - ${e.auth.error}` : ""}`);
|
|
523
|
-
if (e.websocket.ok || console.warn("[Templatical] WebSocket health check failed:", e.websocket.error ?? "unknown error", "-- real-time features will be disabled."), await H.fetchConfig(), B) return;
|
|
524
|
-
I.fontsManager.setCustomFontsEnabled(H.hasFeature("custom_fonts")), I.config.customBlocks?.length && H.hasFeature("custom_blocks") && K.registerCustomBlocks(I.config.customBlocks), I.config.theme && H.hasFeature("theme_customization") && (K.themeOverrides.value = I.config.theme), I.config.modules !== !1 && H.hasFeature("saved_modules") && Q.loadModules(), Xe("ready");
|
|
525
|
-
} catch (e) {
|
|
526
|
-
if (B) return;
|
|
527
|
-
let t = e instanceof Error ? e : Error("Initialization failed", { cause: e });
|
|
528
|
-
z.value = t, I.config.onError?.(t);
|
|
529
|
-
} finally {
|
|
530
|
-
B || (L.value = !1);
|
|
531
|
-
}
|
|
532
|
-
}
|
|
533
|
-
function Ut() {
|
|
534
|
-
return Oe(H.config.value.websocket);
|
|
535
|
-
}
|
|
536
|
-
async function Wt(e) {
|
|
537
|
-
let t = await U.create(e);
|
|
538
|
-
return B ? t : (I.config.onCreate?.(t), q.initSnapshotHistory(), W.connect(t.id, Ut()), t);
|
|
539
|
-
}
|
|
540
|
-
async function Gt(e) {
|
|
541
|
-
let t = await U.load(e);
|
|
542
|
-
return B ? t : (I.config.onLoad?.(t), q.initSnapshotHistory(), W.connect(t.id, Ut()), t);
|
|
543
|
-
}
|
|
544
|
-
async function Kt() {
|
|
545
|
-
Y.isSaveExporting.value = !0, Y.saveStatus.value = "idle";
|
|
546
|
-
try {
|
|
547
|
-
if (await Vt(U.content.value), B) throw Error("Component unmounted during save");
|
|
548
|
-
let e = await U.save();
|
|
549
|
-
if (B) throw Error("Component unmounted during save");
|
|
550
|
-
q.initSnapshotHistory(), q.snapshotHistoryInstance.value && q.snapshotHistoryInstance.value.loadSnapshots();
|
|
551
|
-
let t = await jt.exportHtml(e.id);
|
|
552
|
-
if (B) throw Error("Component unmounted during save");
|
|
553
|
-
let n = {
|
|
554
|
-
templateId: e.id,
|
|
555
|
-
html: t.html,
|
|
556
|
-
mjml: t.mjml,
|
|
557
|
-
content: e.content
|
|
558
|
-
};
|
|
559
|
-
return I.config.onSave?.(n), Y.saveStatus.value = "saved", Y.startSaveStatusClear(), n;
|
|
560
|
-
} catch (e) {
|
|
561
|
-
throw B || (Y.saveStatus.value = "error", Y.saveErrorMessage.value = e instanceof Error ? e.message : "Save failed"), e;
|
|
562
|
-
} finally {
|
|
563
|
-
B || (Y.isSaveExporting.value = !1);
|
|
564
|
-
}
|
|
565
|
-
}
|
|
566
|
-
return he(() => {
|
|
567
|
-
Ht();
|
|
568
|
-
}), _e(() => {
|
|
569
|
-
B = !0, I.fontsManager.cleanupFontLinks(), W.disconnect(), K.destroy(), I.config.onUnmount?.();
|
|
570
|
-
}), r({
|
|
571
|
-
getContent: () => U.content.value,
|
|
572
|
-
setContent: (e) => U.setContent(e),
|
|
573
|
-
setTheme: It,
|
|
574
|
-
setThemeOverrides: Ft,
|
|
575
|
-
create: Wt,
|
|
576
|
-
load: Gt,
|
|
577
|
-
save: Kt,
|
|
578
|
-
sendTestEmail: X.sendTestEmail
|
|
579
|
-
}), (e, t) => (A(), S("div", {
|
|
580
|
-
class: k(["tpl tpl:relative tpl:h-full tpl:overflow-hidden", { "tpl:dark": P(U).state.darkMode }]),
|
|
581
|
-
"data-tpl-theme": P(K).resolvedTheme.value,
|
|
582
|
-
style: me(P(K).themeStyles.value)
|
|
583
|
-
}, [
|
|
584
|
-
E(v, {
|
|
585
|
-
"enter-active-class": "tpl:transition-opacity tpl:duration-200",
|
|
586
|
-
"enter-from-class": "tpl:opacity-100",
|
|
587
|
-
"enter-to-class": "tpl:opacity-100",
|
|
588
|
-
"leave-active-class": "tpl:transition-opacity tpl:duration-300",
|
|
589
|
-
"leave-from-class": "tpl:opacity-100",
|
|
590
|
-
"leave-to-class": "tpl:opacity-0"
|
|
591
|
-
}, {
|
|
592
|
-
default: F(() => [E(Ze, { visible: L.value || P(U).state.isLoading }, null, 8, ["visible"])]),
|
|
593
|
-
_: 1
|
|
594
|
-
}),
|
|
595
|
-
E(v, {
|
|
596
|
-
"enter-active-class": "tpl:transition-opacity tpl:duration-200",
|
|
597
|
-
"enter-from-class": "tpl:opacity-0",
|
|
598
|
-
"enter-to-class": "tpl:opacity-100",
|
|
599
|
-
"leave-active-class": "tpl:transition-opacity tpl:duration-300",
|
|
600
|
-
"leave-from-class": "tpl:opacity-100",
|
|
601
|
-
"leave-to-class": "tpl:opacity-0"
|
|
602
|
-
}, {
|
|
603
|
-
default: F(() => [E(Qe, {
|
|
604
|
-
error: z.value,
|
|
605
|
-
visible: !!z.value && !L.value,
|
|
606
|
-
onRetry: Ht
|
|
607
|
-
}, null, 8, ["error", "visible"])]),
|
|
608
|
-
_: 1
|
|
609
|
-
}),
|
|
610
|
-
C("header", rt, [
|
|
611
|
-
C("div", it, [P(Y).isWhiteLabeled.value ? x("", !0) : (A(), S("div", at, [C("img", {
|
|
612
|
-
src: P(V).resolveUrl("/logo.svg"),
|
|
613
|
-
alt: "Templatical",
|
|
614
|
-
width: "24",
|
|
615
|
-
height: "24",
|
|
616
|
-
class: "tpl:shrink-0"
|
|
617
|
-
}, null, 8, ot), C("span", st, N(P(K).t.header.title), 1)])), P(Y).templateLimit.value === null ? x("", !0) : (A(), S("span", ct, N(P(K).format(P(K).t.header.templatesUsed, {
|
|
618
|
-
used: P(Y).templateCount.value,
|
|
619
|
-
max: P(Y).templateLimit.value
|
|
620
|
-
})), 1))]),
|
|
621
|
-
C("div", lt, [
|
|
622
|
-
E(ie, {
|
|
623
|
-
viewport: P(U).state.viewport,
|
|
624
|
-
onChange: P(U).setViewport
|
|
625
|
-
}, null, 8, ["viewport", "onChange"]),
|
|
626
|
-
E(oe, {
|
|
627
|
-
"dark-mode": P(U).state.darkMode,
|
|
628
|
-
onChange: P(U).setDarkMode
|
|
629
|
-
}, null, 8, ["dark-mode", "onChange"]),
|
|
630
|
-
E(ne, {
|
|
631
|
-
"preview-mode": P(U).state.previewMode,
|
|
632
|
-
onChange: P(U).setPreviewMode
|
|
633
|
-
}, null, 8, ["preview-mode", "onChange"]),
|
|
634
|
-
P(G) && Tt.value ? (A(), b(P(ye), {
|
|
635
|
-
key: 0,
|
|
636
|
-
collaborators: P(G).collaborators.value,
|
|
637
|
-
"is-connected": P(W).isConnected.value
|
|
638
|
-
}, null, 8, ["collaborators", "is-connected"])) : x("", !0),
|
|
639
|
-
P(q).snapshotHistoryInstance.value ? (A(), b(P(ve), {
|
|
640
|
-
key: 1,
|
|
641
|
-
snapshots: P(q).snapshotHistorySnapshots.value,
|
|
642
|
-
"is-loading": P(q).snapshotHistoryIsLoading.value,
|
|
643
|
-
"is-restoring": P(q).snapshotHistoryIsRestoring.value,
|
|
644
|
-
onLoad: P(q).loadSnapshotHistory,
|
|
645
|
-
onNavigate: P(q).handleSnapshotNavigate
|
|
646
|
-
}, null, 8, [
|
|
647
|
-
"snapshots",
|
|
648
|
-
"is-loading",
|
|
649
|
-
"is-restoring",
|
|
650
|
-
"onLoad",
|
|
651
|
-
"onNavigate"
|
|
652
|
-
])) : x("", !0)
|
|
653
|
-
]),
|
|
654
|
-
C("div", ut, [
|
|
655
|
-
P(Y).saveStatus.value === "error" ? (A(), S("div", {
|
|
656
|
-
key: 0,
|
|
657
|
-
"aria-live": "assertive",
|
|
658
|
-
class: "tpl-tooltip tpl-status tpl:flex tpl:items-center tpl:gap-1.5 tpl:text-xs tpl:text-[var(--tpl-danger)]",
|
|
659
|
-
"data-tooltip": P(Y).saveErrorMessage.value
|
|
660
|
-
}, [E(P(g), {
|
|
661
|
-
size: 12,
|
|
662
|
-
"stroke-width": 2.5
|
|
663
|
-
}), T(" " + N(P(K).t.header.saveFailed), 1)], 8, dt)) : P(Y).saveStatus.value === "saved" ? (A(), S("div", ft, [E(P(h), {
|
|
664
|
-
size: 12,
|
|
665
|
-
"stroke-width": 2.5
|
|
666
|
-
}), T(" " + N(P(K).t.header.saved), 1)])) : P(U).state.isDirty ? (A(), S("div", pt, [t[19] ||= C("span", { class: "tpl-pulse tpl:size-1.5 tpl:rounded-full tpl:bg-[var(--tpl-primary)]" }, null, -1), T(" " + N(P(K).t.header.unsaved), 1)])) : x("", !0),
|
|
667
|
-
P(Z).isEnabled.value && P(Y).hasTemplateSaved.value ? (A(), S("button", {
|
|
668
|
-
key: 3,
|
|
669
|
-
"aria-label": P(Z).unresolvedCount.value > 0 ? `${P(K).t.comments.button} (${P(Z).unresolvedCount.value})` : P(K).t.comments.button,
|
|
670
|
-
"aria-expanded": P(J).commentsOpen.value,
|
|
671
|
-
class: k(P(_)),
|
|
672
|
-
style: me({
|
|
673
|
-
backgroundColor: P(J).commentsOpen.value ? "var(--tpl-primary)" : "transparent",
|
|
674
|
-
color: P(J).commentsOpen.value ? "var(--tpl-bg)" : "var(--tpl-primary)",
|
|
675
|
-
borderColor: "var(--tpl-primary)"
|
|
676
|
-
}),
|
|
677
|
-
onClick: t[0] ||= (e) => P(J).commentsOpen.value = !P(J).commentsOpen.value
|
|
678
|
-
}, [
|
|
679
|
-
E(P(le), {
|
|
680
|
-
size: 16,
|
|
681
|
-
"stroke-width": 2
|
|
682
|
-
}),
|
|
683
|
-
T(" " + N(P(K).t.comments.button) + " ", 1),
|
|
684
|
-
P(Z).unresolvedCount.value > 0 && !P(J).commentsOpen.value ? (A(), S("span", ht, N(P(Z).unresolvedCount.value), 1)) : x("", !0)
|
|
685
|
-
], 14, mt)) : x("", !0),
|
|
686
|
-
P(Y).canUseAiGeneration.value && P(Y).hasTemplateSaved.value ? (A(), S("div", {
|
|
687
|
-
key: 4,
|
|
688
|
-
ref: (e) => P(J).aiMenuRef.value = e,
|
|
689
|
-
class: "tpl:relative"
|
|
690
|
-
}, [C("button", {
|
|
691
|
-
"aria-expanded": P(J).aiMenuOpen.value,
|
|
692
|
-
class: k(["tpl-ai-btn tpl:inline-flex tpl:items-center tpl:gap-1.5 tpl:rounded-[var(--tpl-radius-sm)] tpl:border-none tpl:px-4 tpl:py-2 tpl:text-sm tpl:font-semibold tpl:whitespace-nowrap tpl:transition-all tpl:duration-200", P(J).aiButtonActive.value ? "tpl-ai-btn--active" : "tpl-ai-btn--idle"]),
|
|
693
|
-
onClick: t[1] ||= Ce((...e) => P(J).toggleAiMenu && P(J).toggleAiMenu(...e), ["stop"])
|
|
694
|
-
}, [E(P(de), {
|
|
695
|
-
size: 16,
|
|
696
|
-
"stroke-width": 2,
|
|
697
|
-
class: "tpl-ai-btn-icon"
|
|
698
|
-
}), T(" " + N(P(K).t.aiChat.button), 1)], 10, gt), E(v, {
|
|
699
|
-
"enter-active-class": "tpl:transition-all tpl:duration-150 tpl:ease-out",
|
|
700
|
-
"enter-from-class": "tpl:scale-95 tpl:opacity-0",
|
|
701
|
-
"enter-to-class": "tpl:scale-100 tpl:opacity-100",
|
|
702
|
-
"leave-active-class": "tpl:transition-all tpl:duration-100 tpl:ease-in",
|
|
703
|
-
"leave-from-class": "tpl:scale-100 tpl:opacity-100",
|
|
704
|
-
"leave-to-class": "tpl:scale-95 tpl:opacity-0"
|
|
705
|
-
}, {
|
|
706
|
-
default: F(() => [P(J).aiMenuOpen.value ? (A(), S("div", _t, [E(P(ze), {
|
|
707
|
-
"active-feature": P(J).activeAiFeature.value,
|
|
708
|
-
onSelect: P(J).handleAiFeatureSelect
|
|
709
|
-
}, null, 8, ["active-feature", "onSelect"])])) : x("", !0)]),
|
|
710
|
-
_: 1
|
|
711
|
-
})], 512)) : x("", !0),
|
|
712
|
-
P(X).isEnabled.value && P(Y).canSendTestEmail.value ? (A(), S("button", {
|
|
713
|
-
key: 5,
|
|
714
|
-
class: k(P(_)),
|
|
715
|
-
style: {
|
|
716
|
-
"background-color": "transparent",
|
|
717
|
-
color: "var(--tpl-primary)",
|
|
718
|
-
"border-color": "var(--tpl-primary)"
|
|
719
|
-
},
|
|
720
|
-
disabled: P(X).isSending.value || !P(Y).hasTemplateSaved.value,
|
|
721
|
-
onClick: t[2] ||= (e) => P(J).testEmailModalOpen.value = !0
|
|
722
|
-
}, [P(X).isSending.value ? (A(), b(P(ce), {
|
|
723
|
-
key: 1,
|
|
724
|
-
class: "tpl-spinner",
|
|
725
|
-
size: 16,
|
|
726
|
-
"stroke-width": 2
|
|
727
|
-
})) : (A(), b(P(ue), {
|
|
728
|
-
key: 0,
|
|
729
|
-
size: 16,
|
|
730
|
-
"stroke-width": 2
|
|
731
|
-
})), T(" " + N(P(K).t.testEmail.button), 1)], 10, vt)) : x("", !0),
|
|
732
|
-
C("button", {
|
|
733
|
-
class: k(P(_)),
|
|
734
|
-
style: {
|
|
735
|
-
"background-color": "transparent",
|
|
736
|
-
color: "var(--tpl-primary)",
|
|
737
|
-
"border-color": "var(--tpl-primary)"
|
|
738
|
-
},
|
|
739
|
-
disabled: P(U).state.isSaving || P(Y).isSaveExporting.value || !P(U).state.isDirty,
|
|
740
|
-
onClick: t[3] ||= (e) => Kt().catch((e) => I.config.onError?.(e))
|
|
741
|
-
}, [!P(U).state.isSaving && !P(Y).isSaveExporting.value ? (A(), b(P(Ue), {
|
|
742
|
-
key: 0,
|
|
743
|
-
size: 16,
|
|
744
|
-
"stroke-width": 2
|
|
745
|
-
})) : (A(), b(P(ce), {
|
|
746
|
-
key: 1,
|
|
747
|
-
class: "tpl-spinner",
|
|
748
|
-
size: 16,
|
|
749
|
-
"stroke-width": 2
|
|
750
|
-
})), T(" " + N(P(U).state.isSaving || P(Y).isSaveExporting.value ? P(K).t.header.saving : P(K).t.header.save), 1)], 10, yt)
|
|
751
|
-
])
|
|
752
|
-
]),
|
|
753
|
-
E(et, {
|
|
754
|
-
visible: P(q).isPreviewingSnapshot.value,
|
|
755
|
-
onCancel: P(q).cancelPreview,
|
|
756
|
-
onConfirm: P(q).confirmRestoreSnapshot
|
|
757
|
-
}, null, 8, [
|
|
758
|
-
"visible",
|
|
759
|
-
"onCancel",
|
|
760
|
-
"onConfirm"
|
|
761
|
-
]),
|
|
762
|
-
E(v, {
|
|
763
|
-
"enter-active-class": "tpl:transition-all tpl:duration-200 tpl:ease-out",
|
|
764
|
-
"enter-from-class": "tpl:translate-y-[-8px] tpl:opacity-0",
|
|
765
|
-
"enter-to-class": "tpl:translate-y-0 tpl:opacity-100",
|
|
766
|
-
"leave-active-class": "tpl:transition-all tpl:duration-300 tpl:ease-in",
|
|
767
|
-
"leave-from-class": "tpl:translate-y-0 tpl:opacity-100",
|
|
768
|
-
"leave-to-class": "tpl:translate-y-[-8px] tpl:opacity-0"
|
|
769
|
-
}, {
|
|
770
|
-
default: F(() => [E(tt, { visible: P(Ot).collabUndoWarningVisible.value }, null, 8, ["visible"])]),
|
|
771
|
-
_: 1
|
|
772
|
-
}),
|
|
773
|
-
Se(E(ee, null, null, 512), [[be, !P(U).state.previewMode]]),
|
|
774
|
-
C("div", {
|
|
775
|
-
class: k(["tpl-body tpl:absolute tpl:bottom-0 tpl:overflow-auto", [P(U).state.previewMode ? "tpl:left-0 tpl:right-0" : P(J).rightPanelOpen.value ? "tpl:left-12 tpl:right-[680px]" : "tpl:left-12 tpl:right-[320px]", P(q).isPreviewingSnapshot.value ? "tpl:top-[104px]" : "tpl:top-14"]]),
|
|
776
|
-
style: {
|
|
777
|
-
transition: "all 300ms cubic-bezier(0.34, 1.56, 0.64, 1)",
|
|
778
|
-
"background-color": "var(--tpl-canvas-bg)"
|
|
779
|
-
}
|
|
780
|
-
}, [C("div", bt, [E(v, { name: "tpl-restore-btn" }, {
|
|
781
|
-
default: F(() => [P(K).conditionPreview.hasHiddenBlocks.value ? (A(), S("button", {
|
|
782
|
-
key: 0,
|
|
783
|
-
class: "tpl:absolute tpl:left-1/2 tpl:top-2 tpl:-translate-x-1/2 tpl:inline-flex tpl:items-center tpl:gap-1.5 tpl:rounded-full tpl:border tpl:px-3.5 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:whitespace-nowrap tpl:shadow-md tpl:hover:opacity-80",
|
|
784
|
-
style: {
|
|
785
|
-
"background-color": "var(--tpl-warning-light)",
|
|
786
|
-
color: "var(--tpl-warning)",
|
|
787
|
-
"border-color": "var(--tpl-warning)",
|
|
788
|
-
"backdrop-filter": "blur(8px)"
|
|
789
|
-
},
|
|
790
|
-
onClick: t[4] ||= (e) => P(K).conditionPreview.reset()
|
|
791
|
-
}, [E(P(ae), {
|
|
792
|
-
size: 13,
|
|
793
|
-
"stroke-width": 2
|
|
794
|
-
}), T(" " + N(P(K).t.blockSettings.restoreHiddenBlocks), 1)])) : x("", !0)]),
|
|
795
|
-
_: 1
|
|
796
|
-
})]), C("main", xt, [E(re, {
|
|
797
|
-
viewport: P(U).state.viewport,
|
|
798
|
-
content: P(U).content.value,
|
|
799
|
-
"selected-block-id": P(U).state.selectedBlockId,
|
|
800
|
-
"dark-mode": P(U).state.darkMode,
|
|
801
|
-
"preview-mode": P(U).state.previewMode,
|
|
802
|
-
"locked-blocks": P(G)?.lockedBlocks.value ?? void 0,
|
|
803
|
-
onSelectBlock: P(U).selectBlock,
|
|
804
|
-
onOpenAiChat: t[5] ||= (e) => P(J).aiChatOpen.value = !0,
|
|
805
|
-
onOpenDesignReference: t[6] ||= (e) => P(J).designReferenceOpen.value = !0
|
|
806
|
-
}, null, 8, [
|
|
807
|
-
"viewport",
|
|
808
|
-
"content",
|
|
809
|
-
"selected-block-id",
|
|
810
|
-
"dark-mode",
|
|
811
|
-
"preview-mode",
|
|
812
|
-
"locked-blocks",
|
|
813
|
-
"onSelectBlock"
|
|
814
|
-
])])], 2),
|
|
815
|
-
P(Y).isWhiteLabeled.value ? x("", !0) : (A(), S("footer", {
|
|
816
|
-
key: 0,
|
|
817
|
-
class: k(["tpl:pointer-events-none tpl:absolute tpl:bottom-0 tpl:z-50 tpl:flex tpl:h-8 tpl:items-center tpl:justify-end tpl:pr-4 tpl:text-[9px] tpl:opacity-90 tpl:transition-all tpl:duration-300 tpl:text-[var(--tpl-text-dim)]", [P(U).state.previewMode ? "tpl:left-0 tpl:right-0" : P(J).rightPanelOpen.value ? "tpl:left-12 tpl:right-[680px]" : "tpl:left-12 tpl:right-[320px]"]])
|
|
818
|
-
}, [C("div", St, [
|
|
819
|
-
C("span", null, N(P(K).t.footer.poweredBy), 1),
|
|
820
|
-
t[20] ||= C("a", {
|
|
821
|
-
href: "https://templatical.com",
|
|
822
|
-
target: "_blank",
|
|
823
|
-
rel: "noopener noreferrer",
|
|
824
|
-
class: "tpl:inline-flex tpl:items-center tpl:gap-1 tpl:font-medium tpl:transition-colors tpl:duration-150 hover:tpl:opacity-80 tpl:text-[var(--tpl-text-muted)]",
|
|
825
|
-
style: { "text-decoration": "none" }
|
|
826
|
-
}, [C("img", {
|
|
827
|
-
width: "14",
|
|
828
|
-
height: "14",
|
|
829
|
-
src: "https://templatical.com/logo.svg",
|
|
830
|
-
alt: ""
|
|
831
|
-
}), T(" Templatical ")], -1),
|
|
832
|
-
t[21] ||= C("span", { class: "tpl:text-[var(--tpl-border)]" }, "·", -1),
|
|
833
|
-
C("a", Ct, N(P(K).t.footer.openSource), 1)
|
|
834
|
-
])], 2)),
|
|
835
|
-
C("div", {
|
|
836
|
-
class: "tpl-sr-only",
|
|
837
|
-
role: "status",
|
|
838
|
-
"aria-live": "polite",
|
|
839
|
-
"aria-atomic": "true",
|
|
840
|
-
"aria-label": P(K).t.landmarks.reorderAnnouncements
|
|
841
|
-
}, N(P(K).keyboardReorder.announcement.value), 9, wt),
|
|
842
|
-
Se(E(te, {
|
|
843
|
-
"selected-block": P(U).selectedBlock.value,
|
|
844
|
-
settings: P(U).content.value.settings,
|
|
845
|
-
"shifted-left": P(J).rightPanelOpen.value,
|
|
846
|
-
onUpdateBlock: t[7] ||= (e) => P(U).updateBlock(P(U).selectedBlock.value.id, e),
|
|
847
|
-
onDeleteBlock: t[8] ||= (e) => P(K).blockActions.deleteBlock(P(U).selectedBlock.value.id),
|
|
848
|
-
onDuplicateBlock: t[9] ||= (e) => P(K).blockActions.duplicateBlock(P(U).selectedBlock.value),
|
|
849
|
-
onUpdateSettings: P(U).updateSettings
|
|
850
|
-
}, null, 8, [
|
|
851
|
-
"selected-block",
|
|
852
|
-
"settings",
|
|
853
|
-
"shifted-left",
|
|
854
|
-
"onUpdateSettings"
|
|
855
|
-
]), [[be, !P(U).state.previewMode]]),
|
|
856
|
-
!L.value && R.value ? (A(), S(fe, { key: 1 }, [
|
|
857
|
-
E(P(f), {
|
|
858
|
-
visible: P(J).aiChatOpen.value,
|
|
859
|
-
"on-apply": (e) => {
|
|
860
|
-
P(K).history.record(), P(U).setContent(e), P(K).conditionPreview.reset();
|
|
861
|
-
},
|
|
862
|
-
onClose: t[10] ||= (e) => P(J).aiChatOpen.value = !1
|
|
863
|
-
}, null, 8, ["visible", "on-apply"]),
|
|
864
|
-
E(P(se), {
|
|
865
|
-
visible: P(J).scoringPanelOpen.value,
|
|
866
|
-
onClose: t[11] ||= (e) => P(J).scoringPanelOpen.value = !1
|
|
867
|
-
}, null, 8, ["visible"]),
|
|
868
|
-
E(P(m), {
|
|
869
|
-
visible: P(J).designReferenceOpen.value,
|
|
870
|
-
"has-existing-blocks": P(U).content.value.blocks.length > 0,
|
|
871
|
-
onClose: t[12] ||= (e) => P(J).designReferenceOpen.value = !1,
|
|
872
|
-
onApply: t[13] ||= (e) => {
|
|
873
|
-
P(K).history.record(), P(U).setContent(e), P(K).conditionPreview.reset();
|
|
874
|
-
}
|
|
875
|
-
}, null, 8, ["visible", "has-existing-blocks"]),
|
|
876
|
-
E(P(p), {
|
|
877
|
-
ref_key: "commentsSidebarRef",
|
|
878
|
-
ref: Lt,
|
|
879
|
-
visible: P(J).commentsOpen.value,
|
|
880
|
-
onClose: t[14] ||= (e) => P(J).commentsOpen.value = !1
|
|
881
|
-
}, null, 8, ["visible"]),
|
|
882
|
-
E(P(w), {
|
|
883
|
-
visible: P(J).testEmailModalOpen.value,
|
|
884
|
-
"allowed-emails": P(X).allowedEmails.value,
|
|
885
|
-
"is-sending": P(X).isSending.value,
|
|
886
|
-
error: P(X).error.value,
|
|
887
|
-
onSend: zt,
|
|
888
|
-
onClose: t[15] ||= (e) => P(J).testEmailModalOpen.value = !1
|
|
889
|
-
}, null, 8, [
|
|
890
|
-
"visible",
|
|
891
|
-
"allowed-emails",
|
|
892
|
-
"is-sending",
|
|
893
|
-
"error"
|
|
894
|
-
]),
|
|
895
|
-
P(H).hasFeature("saved_modules") && I.config.modules !== !1 ? (A(), b(P(O), {
|
|
896
|
-
key: 0,
|
|
897
|
-
visible: Mt.value,
|
|
898
|
-
"pre-selected-block-id": Nt.value,
|
|
899
|
-
onClose: t[16] ||= (e) => {
|
|
900
|
-
Mt.value = !1, Nt.value = null;
|
|
901
|
-
},
|
|
902
|
-
onSaved: t[17] ||= (e) => P(Q).loadModules()
|
|
903
|
-
}, null, 8, ["visible", "pre-selected-block-id"])) : x("", !0),
|
|
904
|
-
P(H).hasFeature("saved_modules") && I.config.modules !== !1 ? (A(), b(P(ge), {
|
|
905
|
-
key: 1,
|
|
906
|
-
visible: $.value,
|
|
907
|
-
onClose: t[18] ||= (e) => $.value = !1,
|
|
908
|
-
onInsert: Bt
|
|
909
|
-
}, null, 8, ["visible"])) : x("", !0),
|
|
910
|
-
E(P(Ye), {
|
|
911
|
-
visible: P(J).mediaLibraryOpen.value,
|
|
912
|
-
accept: P(J).mediaLibraryAccept.value,
|
|
913
|
-
onSelect: P(At).handleMediaSelect,
|
|
914
|
-
onClose: P(At).handleMediaLibraryClose
|
|
915
|
-
}, null, 8, [
|
|
916
|
-
"visible",
|
|
917
|
-
"accept",
|
|
918
|
-
"onSelect",
|
|
919
|
-
"onClose"
|
|
920
|
-
])
|
|
921
|
-
], 64)) : x("", !0)
|
|
922
|
-
], 14, nt));
|
|
923
|
-
}
|
|
924
|
-
}), [["__scopeId", "data-v-855e7645"]]);
|
|
925
|
-
//#endregion
|
|
926
|
-
export { G as default };
|