@aswin.dev/editor 0.7.0 → 0.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +56 -0
- package/README.md +3 -3
- package/dist/{AccessibilityPanel-CvQGLdu6.js → AccessibilityPanel-EmQ19wiS.js} +37 -37
- package/dist/{AiChatSidebar-B3SJIKG_.js → AiChatSidebar-DeB0w_32.js} +67 -81
- package/dist/{AiFeatureMenu-BLLKoOos.js → AiFeatureMenu-DoLD5Cde.js} +22 -22
- package/dist/{BlockA11yBadge-CXDLqkcJ.js → BlockA11yBadge-DkNbDvJA.js} +12 -12
- package/dist/CloudEditor-zo9PjjvY.js +1214 -0
- package/dist/{CollaboratorBar-DuPYW5iF.js → CollaboratorBar-BsXMY-8e.js} +21 -21
- package/dist/CommentsSidebar-DIWIa4rS.js +436 -0
- package/dist/CountdownBlock-BCi7-DAM.js +92 -0
- package/dist/CountdownToolbar-BuS8p5ju.js +210 -0
- package/dist/{DesignReferenceSidebar-B8V_F2yF.js → DesignReferenceSidebar-RDlnhL-6.js} +58 -58
- package/dist/{LoadingTrack-B0CWFHXQ.js → LoadingTrack-BJ59h9ok.js} +2 -2
- package/dist/ModuleBrowserModal-b7HbpByz.js +206 -0
- package/dist/ModulePreviewCanvas-D__YlOLS.js +108 -0
- package/dist/{NumberWithSuffix-DkXUez9t.js → NumberWithSuffix-Ca3vNY84.js} +87 -87
- package/dist/{ParagraphEditor-D75wl3BX.js → ParagraphEditor-B1aYPO-6.js} +182 -182
- package/dist/{RichTextEditorContent-DYkIauIk.js → RichTextEditorContent-BmEVMrkJ.js} +38 -38
- package/dist/{SaveModuleDialog-FZ9lxY7_.js → SaveModuleDialog-ClovqI6h.js} +28 -28
- package/dist/{SnapshotHistory-BR3eV120.js → SnapshotHistory-DoqtH0cw.js} +45 -50
- package/dist/{TemplateScoringPanel-4GTNHej5.js → TemplateScoringPanel-DQv2ZAiL.js} +75 -75
- package/dist/{TestEmailModal--ue5w9fT.js → TestEmailModal-iIeYJYsj.js} +28 -28
- package/dist/{TitleEditor-fStSADI-.js → TitleEditor-CTDIwRF_.js} +68 -68
- package/dist/{TplModal-BwSfxIHf.js → TplModal-CBq1J1pG.js} +14 -14
- package/dist/{accessibility-e8JYu_zd.js → accessibility-BU09xZrQ.js} +1 -1
- package/dist/{blockTypeIcons-BcTrDjmH.js → blockTypeIcons-QkC6f5UE.js} +19 -5
- package/dist/bundle-stats.json +7 -7
- package/dist/cdn/chunks/{AccessibilityPanel-B6DOjojm.js → AccessibilityPanel-BeU8nz7A.js} +28 -28
- package/dist/cdn/chunks/{AccessibilityPanel-B6DOjojm.js.map → AccessibilityPanel-BeU8nz7A.js.map} +1 -1
- package/dist/cdn/chunks/{AiFeatureMenu-qEdB2fZJ.js → AiFeatureMenu-B2mhscyP.js} +21 -21
- package/dist/cdn/chunks/AiFeatureMenu-B2mhscyP.js.map +1 -0
- package/dist/cdn/chunks/{BlockA11yBadge-DcEZftf6.js → BlockA11yBadge-C4g77gF0.js} +11 -11
- package/dist/cdn/chunks/{BlockA11yBadge-DcEZftf6.js.map → BlockA11yBadge-C4g77gF0.js.map} +1 -1
- package/dist/{CloudEditor-BCz1ZTYC.js → cdn/chunks/CloudEditor-Btyr0b0_.js} +486 -475
- package/dist/cdn/chunks/CloudEditor-Btyr0b0_.js.map +1 -0
- package/dist/cdn/chunks/{CollaboratorBar--nO7TX6b.js → CollaboratorBar-YBiIjiRh.js} +15 -15
- package/dist/cdn/chunks/CollaboratorBar-YBiIjiRh.js.map +1 -0
- package/dist/cdn/chunks/CountdownBlock-B06UZoWe.js +93 -0
- package/dist/cdn/chunks/CountdownBlock-B06UZoWe.js.map +1 -0
- package/dist/cdn/chunks/CountdownToolbar-C9XZr33O.js +212 -0
- package/dist/cdn/chunks/CountdownToolbar-C9XZr33O.js.map +1 -0
- package/dist/{ModuleBrowserModal-DrUFMTDx.js → cdn/chunks/ModuleBrowserModal-C2CDWKW6.js} +51 -62
- package/dist/cdn/chunks/ModuleBrowserModal-C2CDWKW6.js.map +1 -0
- package/dist/cdn/chunks/ModulePreviewCanvas-Drt8Evai.js +109 -0
- package/dist/cdn/chunks/ModulePreviewCanvas-Drt8Evai.js.map +1 -0
- package/dist/cdn/chunks/{NumberWithSuffix-CE3NrZhH.js → NumberWithSuffix-Ty1bp9vB.js} +64 -64
- package/dist/cdn/chunks/{NumberWithSuffix-CE3NrZhH.js.map → NumberWithSuffix-Ty1bp9vB.js.map} +1 -1
- package/dist/cdn/chunks/{ParagraphEditor-B6Ygu-Mq.js → ParagraphEditor-BA1WbHI7.js} +188 -188
- package/dist/cdn/chunks/{ParagraphEditor-B6Ygu-Mq.js.map → ParagraphEditor-BA1WbHI7.js.map} +1 -1
- package/dist/cdn/chunks/{RichTextEditorContent-DL_y2SrR.js → RichTextEditorContent-BtWCA_Oc.js} +30 -30
- package/dist/cdn/chunks/{RichTextEditorContent-DL_y2SrR.js.map → RichTextEditorContent-BtWCA_Oc.js.map} +1 -1
- package/dist/cdn/chunks/{SaveModuleDialog-B0TnO_o9.js → SaveModuleDialog-AwL0tkCV.js} +21 -21
- package/dist/cdn/chunks/SaveModuleDialog-AwL0tkCV.js.map +1 -0
- package/dist/cdn/chunks/{TitleEditor-BHpfxvwy.js → TitleEditor-DbSyeixS.js} +65 -65
- package/dist/cdn/chunks/TitleEditor-DbSyeixS.js.map +1 -0
- package/dist/cdn/chunks/blockTypeIcons-pQIkxJzc.js +23 -0
- package/dist/cdn/chunks/blockTypeIcons-pQIkxJzc.js.map +1 -0
- package/dist/cdn/chunks/{de-D8CnZxV9.js → de-_tooy3Q8.js} +250 -2
- package/dist/cdn/chunks/de-_tooy3Q8.js.map +1 -0
- package/dist/cdn/chunks/{draggable-Bcb86AsV.js → draggable-C-1_gch3.js} +2 -2
- package/dist/cdn/chunks/{draggable-Bcb86AsV.js.map → draggable-C-1_gch3.js.map} +1 -1
- package/dist/cdn/chunks/{en-8FHaQv4V.js → en-CNqLoIm9.js} +250 -2
- package/dist/cdn/chunks/en-CNqLoIm9.js.map +1 -0
- package/dist/cdn/chunks/{extensions-DIxF31tA.js → extensions-BVKQw_sp.js} +107 -107
- package/dist/cdn/chunks/extensions-BVKQw_sp.js.map +1 -0
- package/dist/cdn/chunks/{features-DEMb13KS.js → features-DIBEo4xl.js} +3388 -2289
- package/dist/cdn/chunks/features-DIBEo4xl.js.map +1 -0
- package/dist/cdn/chunks/{icons-CsLTcirh.js → icons-C1Gg-ov-.js} +346 -54
- package/dist/cdn/chunks/icons-C1Gg-ov-.js.map +1 -0
- package/dist/cdn/chunks/{media-library-CVaNvhpM.js → media-library-BTF_Ko70.js} +985 -985
- package/dist/cdn/chunks/media-library-BTF_Ko70.js.map +1 -0
- package/dist/cdn/chunks/{quality-BaBfc54_.js → quality-C5AmotmP.js} +312 -312
- package/dist/cdn/chunks/quality-C5AmotmP.js.map +1 -0
- package/dist/cdn/chunks/{renderer-CUxvx7ro.js → renderer-D0L44Vlp.js} +236 -142
- package/dist/cdn/chunks/renderer-D0L44Vlp.js.map +1 -0
- package/dist/cdn/chunks/{src-CRaqN-p8.js → src-RKexlYjA.js} +161 -161
- package/dist/cdn/chunks/src-RKexlYjA.js.map +1 -0
- package/dist/cdn/chunks/styleConstants-PgmvNBzQ.js +57 -0
- package/dist/cdn/chunks/styleConstants-PgmvNBzQ.js.map +1 -0
- package/dist/cdn/chunks/styles-CQR6ed13.js +4976 -0
- package/dist/cdn/chunks/styles-CQR6ed13.js.map +1 -0
- package/dist/cdn/chunks/{tiptap-ZhwKyFp7.js → tiptap-CDzAbF2j.js} +43 -43
- package/dist/cdn/chunks/{tiptap-ZhwKyFp7.js.map → tiptap-CDzAbF2j.js.map} +1 -1
- package/dist/cdn/editor.css +1 -1
- package/dist/cdn/editor.js +211 -123
- package/dist/cdn/editor.js.map +1 -1
- package/dist/{check-Da05j8yl.js → check-DJrpDKO_.js} +1 -1
- package/dist/{chevron-down-R2uY34iD.js → chevron-down-C5oBUhT8.js} +1 -1
- package/dist/chevron-right-BqCptpdp.js +10 -0
- package/dist/{circle-alert-DZuGWPX-.js → circle-alert-ZQQc98HC.js} +1 -1
- package/dist/{clock-CRp2sIub.js → clock-ik2pRJKG.js} +1 -1
- package/dist/{cloud-DEk_b4CR.js → cloud-DJG4tb4_.js} +485 -427
- package/dist/{createLucideIcon-C3pa2siy.js → createLucideIcon-ClREiSx3.js} +6 -6
- package/dist/{de-Brqvgr43.js → de-2LEvILeZ.js} +249 -1
- package/dist/{dist-Cp0zXPAD.js → dist-BHAeXaUY.js} +1 -1
- package/dist/{dist-BaQIYPsn.js → dist-BSJvAvH3.js} +1 -1
- package/dist/{dist-wzMIGj-D.js → dist-BeFnymxK.js} +1 -1
- package/dist/dist-Bmir0gYb.js +1167 -0
- package/dist/{dist-DDJIWTRY.js → dist-BvPgo-UK.js} +1 -1
- package/dist/{dist-BFawx6IS.js → dist-CPVBKMmd.js} +51 -51
- package/dist/dist-CivF9P8b.js +382 -0
- package/dist/{dist-D6uC2xhi.js → dist-Df4ie7vZ.js} +1 -1
- package/dist/{dist-us-RpCWN.js → dist-DxOoemkW.js} +1 -1
- package/dist/{dist-KoBJjK1G.js → dist-HEQ52gTJ.js} +1 -1
- package/dist/{dist-DjviJBCi.js → dist-b-XUqAoF.js} +1 -1
- package/dist/{dist-D90y8dvT.js → dist-kZfaVUpW.js} +3 -3
- package/dist/{dist-aRzjfSRN.js → dist-wfAedlzi.js} +1 -1
- package/dist/{en-WDVp87TE.js → en-D2RU2Poj.js} +249 -1
- package/dist/{extensions-CUcl9Ok4.js → extensions-BQ1xXx3d.js} +103 -103
- package/dist/{image-up-MBZKKg9p.js → image-up-DT7gcJLN.js} +1 -1
- package/dist/index.d.ts +102 -14
- package/dist/{info-CJEC7piy.js → info-BSPGcsSM.js} +1 -1
- package/dist/keys-CvX8D-8C.js +10 -0
- package/dist/{loader-circle-DsY5Yg33.js → loader-circle-Balo8p3d.js} +1 -1
- package/dist/{message-circle-yElBbR2C.js → message-circle-B39qAHxs.js} +1 -1
- package/dist/pencil-BZJPNYWR.js +10 -0
- package/dist/{refresh-cw-CE_AGtn8.js → refresh-cw-DwDqGUM0.js} +1 -1
- package/dist/{scan-line-D0vcUekt.js → scan-line-DlghmhNf.js} +1 -1
- package/dist/{send-DH4oDQqC.js → send-DDdhIRj8.js} +1 -1
- package/dist/{shield-check-CfJgs2Hd.js → shield-check-OSQ-JVTX.js} +1 -1
- package/dist/{sparkles-CvRXGqFs.js → sparkles-BN4a-CoF.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/styleConstants-wWRbcuEK.js +55 -0
- package/dist/styles-CavWjvol.js +5487 -0
- package/dist/templatical-editor.js +211 -119
- package/dist/{text-align-start-BT9VUDxK.js → text-align-start-D1weisjS.js} +1 -1
- package/dist/{trash-2-DbP2Y6t2.js → trash-2-CMWvQ5KX.js} +1 -1
- package/dist/{triangle-alert-aOXceTSe.js → triangle-alert-DyidRNX_.js} +1 -1
- package/dist/undo-2-Cg8I7obC.js +16 -0
- package/dist/{useCloudI18n-BuIwR6OE.js → useCloudI18n-BTTNBk5i.js} +2 -2
- package/dist/{useEditorCore-C6ost42Q.js → useEditorCore-BGnzcT7p.js} +2424 -2249
- package/dist/{useI18n-lb2DHDiu.js → useI18n-C2xQZ6K9.js} +2 -2
- package/dist/{useMergeTag-CBwKnnNB.js → useMergeTag-CfuZq2fF.js} +4 -4
- package/dist/{vue.runtime.esm-bundler-DpvJL-nX.js → vue.runtime.esm-bundler-CjauPXjj.js} +1 -1
- package/dist/{x-u2oVmjN_.js → x-CgIhNcT9.js} +1 -1
- package/package.json +15 -15
- package/dist/CommentsSidebar-B1pvJdqF.js +0 -441
- package/dist/CountdownBlock-BNSj1jvJ.js +0 -92
- package/dist/CountdownToolbar-ClJr2GzL.js +0 -210
- package/dist/ModulePreviewCanvas-CHdOwV_4.js +0 -106
- package/dist/cdn/chunks/AiFeatureMenu-qEdB2fZJ.js.map +0 -1
- package/dist/cdn/chunks/CloudEditor-D2GsEC_n.js +0 -1143
- package/dist/cdn/chunks/CloudEditor-D2GsEC_n.js.map +0 -1
- package/dist/cdn/chunks/CollaboratorBar--nO7TX6b.js.map +0 -1
- package/dist/cdn/chunks/CountdownBlock-5YdT1uUu.js +0 -93
- package/dist/cdn/chunks/CountdownBlock-5YdT1uUu.js.map +0 -1
- package/dist/cdn/chunks/CountdownToolbar-DXPXrbAA.js +0 -212
- package/dist/cdn/chunks/CountdownToolbar-DXPXrbAA.js.map +0 -1
- package/dist/cdn/chunks/ModuleBrowserModal-DxoPp81s.js +0 -195
- package/dist/cdn/chunks/ModuleBrowserModal-DxoPp81s.js.map +0 -1
- package/dist/cdn/chunks/ModulePreviewCanvas-CoLdb4ar.js +0 -107
- package/dist/cdn/chunks/ModulePreviewCanvas-CoLdb4ar.js.map +0 -1
- package/dist/cdn/chunks/SaveModuleDialog-B0TnO_o9.js.map +0 -1
- package/dist/cdn/chunks/TitleEditor-BHpfxvwy.js.map +0 -1
- package/dist/cdn/chunks/blockTypeIcons-BzzY9_kA.js +0 -22
- package/dist/cdn/chunks/blockTypeIcons-BzzY9_kA.js.map +0 -1
- package/dist/cdn/chunks/de-D8CnZxV9.js.map +0 -1
- package/dist/cdn/chunks/en-8FHaQv4V.js.map +0 -1
- package/dist/cdn/chunks/extensions-DIxF31tA.js.map +0 -1
- package/dist/cdn/chunks/features-DEMb13KS.js.map +0 -1
- package/dist/cdn/chunks/icons-CsLTcirh.js.map +0 -1
- package/dist/cdn/chunks/media-library-CVaNvhpM.js.map +0 -1
- package/dist/cdn/chunks/quality-BaBfc54_.js.map +0 -1
- package/dist/cdn/chunks/renderer-CUxvx7ro.js.map +0 -1
- package/dist/cdn/chunks/src-CRaqN-p8.js.map +0 -1
- package/dist/cdn/chunks/styleConstants-DP1VOca8.js +0 -57
- package/dist/cdn/chunks/styleConstants-DP1VOca8.js.map +0 -1
- package/dist/cdn/chunks/styles-BHJULjNR.js +0 -2947
- package/dist/cdn/chunks/styles-BHJULjNR.js.map +0 -1
- package/dist/dist-B1IR0bpH.js +0 -326
- package/dist/dist-DJmnUmW9.js +0 -362
- package/dist/keys-ciNfSSGj.js +0 -10
- package/dist/styleConstants-fWzlIIwN.js +0 -55
- package/dist/styles-DEXEkBvg.js +0 -3176
- /package/dist/{_plugin-vue_export-helper-B0hnzhyu.js → _plugin-vue_export-helper-Bwh4ceeO.js} +0 -0
- /package/dist/{de-DCaaCE5s.js → de-D2npYjrZ.js} +0 -0
- /package/dist/{dist-iLBdeBDR.js → dist-DvHLtWVP.js} +0 -0
- /package/dist/{emojiData-PQyVa4bU.js → emojiData-DvQBBzmO.js} +0 -0
- /package/dist/{en-DXCyK4-X.js → en-ib-4h3_o.js} +0 -0
- /package/dist/{formatRelativeTime-BOEf47hq.js → formatRelativeTime-CFDZnEIs.js} +0 -0
- /package/dist/{liquid.browser-CdMv1BTn.js → liquid.browser-7Rv0QDiO.js} +0 -0
- /package/dist/{readableTextColor-CY3SiRnt.js → readableTextColor-C_9OpzBw.js} +0 -0
package/dist/cdn/editor.js
CHANGED
|
@@ -1,218 +1,282 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { a as
|
|
1
|
+
import { C as e, F as t, G as n, M as r, N as i, P as a, T as o, W as s, _ as c, b as l, ct as u, dt as d, f, ft as p, g as m, h, l as g, m as _, n as ee, r as v, tt as y, ut as b, v as x, x as S } from "./chunks/draggable-C-1_gch3.js";
|
|
2
|
+
import { Nn as te, Pn as ne, Sn as re, Y as C, cn as w, k as ie, nn as ae, nt as T, rr as E } from "./chunks/features-DIBEo4xl.js";
|
|
3
|
+
import { T as D } from "./chunks/icons-C1Gg-ov-.js";
|
|
4
|
+
import { a as oe, c as se, d as ce, f as le, h as ue, i as de, l as fe, m as pe, n as me, o as O, p as k, r as A, s as j, t as M, u as N } from "./chunks/styles-CQR6ed13.js";
|
|
5
5
|
//#region src/Editor.vue?vue&type=script&setup=true&lang.ts
|
|
6
|
-
var
|
|
6
|
+
var P = ["data-tpl-theme"], F = {
|
|
7
7
|
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 tpl:shadow-[var(--tpl-shadow-md)] tpl:border-b tpl:border-[var(--tpl-border)]",
|
|
8
8
|
style: {
|
|
9
9
|
"background-color": "color-mix(in srgb, var(--tpl-bg) 80%, transparent)",
|
|
10
10
|
"backdrop-filter": "blur(12px)",
|
|
11
11
|
"-webkit-backdrop-filter": "blur(12px)"
|
|
12
12
|
}
|
|
13
|
-
},
|
|
13
|
+
}, I = { class: "tpl:flex tpl:items-center tpl:justify-center tpl:gap-10" }, L = { class: "tpl:sticky tpl:top-0 tpl:z-40 tpl:h-0" }, R = { class: "tpl:flex tpl:justify-center tpl:p-8" }, he = ["aria-label"], z = /* @__PURE__ */ T(/* @__PURE__ */ e({
|
|
14
14
|
__name: "Editor",
|
|
15
15
|
props: {
|
|
16
16
|
config: {},
|
|
17
17
|
translations: {},
|
|
18
18
|
fontsManager: {}
|
|
19
19
|
},
|
|
20
|
-
setup(e, { expose:
|
|
21
|
-
let
|
|
22
|
-
content:
|
|
23
|
-
templateDefaults:
|
|
24
|
-
}),
|
|
25
|
-
editor:
|
|
20
|
+
setup(e, { expose: o }) {
|
|
21
|
+
let v = y(null), C = e, T = re({
|
|
22
|
+
content: C.config.content,
|
|
23
|
+
templateDefaults: C.config.templateDefaults
|
|
24
|
+
}), E = ie({
|
|
25
|
+
editor: T,
|
|
26
26
|
config: {
|
|
27
|
-
uiTheme:
|
|
28
|
-
theme:
|
|
29
|
-
blockDefaults:
|
|
30
|
-
customBlocks:
|
|
31
|
-
mergeTags:
|
|
32
|
-
displayConditions:
|
|
33
|
-
onRequestMedia:
|
|
34
|
-
|
|
35
|
-
|
|
27
|
+
uiTheme: C.config.uiTheme,
|
|
28
|
+
theme: C.config.theme,
|
|
29
|
+
blockDefaults: C.config.blockDefaults,
|
|
30
|
+
customBlocks: C.config.customBlocks,
|
|
31
|
+
mergeTags: C.config.mergeTags,
|
|
32
|
+
displayConditions: C.config.displayConditions,
|
|
33
|
+
onRequestMedia: C.config.onRequestMedia,
|
|
34
|
+
editorType: C.config.editorType,
|
|
35
|
+
accessibility: ue(C.config),
|
|
36
|
+
onSave: C.config.onSave ? () => C.config.onSave(JSON.parse(JSON.stringify(T.state.content))) : void 0
|
|
36
37
|
},
|
|
37
|
-
translations:
|
|
38
|
-
fontsManager:
|
|
39
|
-
autoSaveOptions:
|
|
38
|
+
translations: C.translations,
|
|
39
|
+
fontsManager: C.fontsManager,
|
|
40
|
+
autoSaveOptions: C.config.onChange ? { onChange: () => C.config.onChange(JSON.parse(JSON.stringify(T.state.content))) } : null
|
|
40
41
|
});
|
|
41
|
-
|
|
42
|
-
await
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
42
|
+
r(async () => {
|
|
43
|
+
if (await C.fontsManager.loadCustomFonts(), w(C.config.editorType) === "popup" && !T.content.value.settings.popup) {
|
|
44
|
+
let e = ne();
|
|
45
|
+
T.updateSettings({
|
|
46
|
+
popup: e,
|
|
47
|
+
width: te[e.design.sizePreset]
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
}), i(() => {
|
|
51
|
+
C.fontsManager.cleanupFontLinks(), E.destroy();
|
|
52
|
+
});
|
|
53
|
+
let O = y("blocks");
|
|
54
|
+
t(ae, O);
|
|
55
|
+
let z = _(() => w(C.config.editorType) === "popup"), B = _(() => z.value && O.value === "displayRules"), V = _(() => z.value && O.value === "schedule"), H = _(() => O.value === "design"), U = _(() => z.value && (B.value || V.value || H.value)), W = _(() => {
|
|
56
|
+
if (T.state.previewMode) return ["tpl:left-0", "tpl:right-0"];
|
|
57
|
+
if (!z.value) return ["tpl:left-12", "tpl:right-[320px]"];
|
|
58
|
+
let e;
|
|
59
|
+
return e = O.value === "blocks" ? "tpl:left-[272px]" : H.value ? "tpl:left-[392px]" : "tpl:left-[72px]", [e, U.value ? "tpl:right-0" : "tpl:right-[320px]"];
|
|
60
|
+
}), G = _(() => B.value || V.value);
|
|
61
|
+
return o({
|
|
62
|
+
getContent: () => T.content.value,
|
|
63
|
+
setContent: (e) => T.setContent(e),
|
|
64
|
+
setTheme: (e) => T.setUiTheme(e),
|
|
65
|
+
undo: () => E.history.undo(),
|
|
66
|
+
redo: () => E.history.redo(),
|
|
67
|
+
canUndo: () => E.history.canUndo.value,
|
|
68
|
+
canRedo: () => E.history.canRedo.value,
|
|
69
|
+
renderCustomBlock: E.registry.renderCustomBlock,
|
|
70
|
+
startTour: (e) => v.value?.start(e),
|
|
71
|
+
dismissTour: () => v.value?.dismiss(),
|
|
72
|
+
resetTourDismissed: () => de(C.config.tour),
|
|
73
|
+
isTourDismissed: () => C.config.tour ? oe(C.config.tour) : !0
|
|
74
|
+
}), (t, r) => (a(), x("div", {
|
|
75
|
+
class: b(["tpl tpl:relative tpl:h-full tpl:overflow-hidden", { "tpl:dark": u(T).state.darkMode }]),
|
|
76
|
+
"data-tpl-theme": u(E).resolvedTheme.value,
|
|
77
|
+
style: d(u(E).themeStyles.value)
|
|
54
78
|
}, [
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
79
|
+
h("header", F, [
|
|
80
|
+
r[5] ||= h("div", { class: "tpl:flex tpl:items-center tpl:gap-2.5" }, null, -1),
|
|
81
|
+
h("div", I, [
|
|
82
|
+
S(ce),
|
|
83
|
+
S(N, {
|
|
84
|
+
viewport: u(T).state.viewport,
|
|
85
|
+
onChange: u(T).setViewport
|
|
61
86
|
}, null, 8, ["viewport", "onChange"]),
|
|
62
|
-
|
|
63
|
-
"dark-mode":
|
|
64
|
-
onChange:
|
|
87
|
+
S(se, {
|
|
88
|
+
"dark-mode": u(T).state.darkMode,
|
|
89
|
+
onChange: u(T).setDarkMode
|
|
65
90
|
}, null, 8, ["dark-mode", "onChange"]),
|
|
66
|
-
|
|
67
|
-
"preview-mode":
|
|
68
|
-
onChange:
|
|
91
|
+
S(fe, {
|
|
92
|
+
"preview-mode": u(T).state.previewMode,
|
|
93
|
+
onChange: u(T).setPreviewMode
|
|
69
94
|
}, null, 8, ["preview-mode", "onChange"])
|
|
70
95
|
]),
|
|
71
|
-
|
|
96
|
+
r[6] ||= h("div", { class: "tpl:flex tpl:min-w-[200px] tpl:items-center tpl:justify-end tpl:gap-3" }, null, -1)
|
|
72
97
|
]),
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
class:
|
|
76
|
-
style: {
|
|
77
|
-
|
|
78
|
-
|
|
98
|
+
n(S(k, null, null, 512), [[g, !u(T).state.previewMode]]),
|
|
99
|
+
h("div", {
|
|
100
|
+
class: b(["tpl-body tpl:absolute tpl:bottom-0 tpl:overflow-auto", [...W.value, "tpl:top-14"]]),
|
|
101
|
+
style: d({
|
|
102
|
+
transition: "all 300ms cubic-bezier(0.34, 1.56, 0.64, 1)",
|
|
103
|
+
backgroundColor: G.value ? "var(--tpl-bg)" : "var(--tpl-canvas-bg)"
|
|
104
|
+
})
|
|
105
|
+
}, [z.value && O.value === "displayRules" ? (a(), m(me, { key: 0 })) : z.value && O.value === "schedule" ? (a(), m(M, {
|
|
106
|
+
key: 1,
|
|
107
|
+
layout: "standalone"
|
|
108
|
+
})) : (a(), x(f, { key: 2 }, [h("div", L, [S(ee, { name: "tpl-restore-btn" }, {
|
|
109
|
+
default: s(() => [u(E).conditionPreview.hasHiddenBlocks.value ? (a(), x("button", {
|
|
79
110
|
key: 0,
|
|
80
111
|
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 tpl:bg-[var(--tpl-warning-light)] tpl:text-[var(--tpl-warning)] tpl:border-[var(--tpl-warning)]",
|
|
81
112
|
style: { "backdrop-filter": "blur(8px)" },
|
|
82
|
-
onClick:
|
|
83
|
-
}, [
|
|
113
|
+
onClick: r[0] ||= (e) => u(E).conditionPreview.reset()
|
|
114
|
+
}, [S(u(D), {
|
|
84
115
|
size: 13,
|
|
85
116
|
"stroke-width": 2
|
|
86
|
-
}),
|
|
117
|
+
}), l(" " + p(u(E).t.blockSettings.restoreHiddenBlocks), 1)])) : c("", !0)]),
|
|
87
118
|
_: 1
|
|
88
|
-
})]),
|
|
89
|
-
viewport:
|
|
90
|
-
content:
|
|
91
|
-
"selected-block-id":
|
|
92
|
-
"dark-mode":
|
|
93
|
-
"preview-mode":
|
|
94
|
-
|
|
119
|
+
})]), h("div", R, [S(pe, {
|
|
120
|
+
viewport: u(T).state.viewport,
|
|
121
|
+
content: u(T).content.value,
|
|
122
|
+
"selected-block-id": u(T).state.selectedBlockId,
|
|
123
|
+
"dark-mode": u(T).state.darkMode,
|
|
124
|
+
"preview-mode": u(T).state.previewMode,
|
|
125
|
+
"multi-page-canvas": e.config.multiPageCanvas ?? !1,
|
|
126
|
+
onSelectBlock: u(T).selectBlock
|
|
95
127
|
}, null, 8, [
|
|
96
128
|
"viewport",
|
|
97
129
|
"content",
|
|
98
130
|
"selected-block-id",
|
|
99
131
|
"dark-mode",
|
|
100
132
|
"preview-mode",
|
|
133
|
+
"multi-page-canvas",
|
|
101
134
|
"onSelectBlock"
|
|
102
|
-
])])],
|
|
103
|
-
e.config.branding === !1 ?
|
|
135
|
+
])])], 64))], 6),
|
|
136
|
+
e.config.branding === !1 ? c("", !0) : (a(), m(j, {
|
|
104
137
|
key: 0,
|
|
105
|
-
"position-class":
|
|
138
|
+
"position-class": W.value
|
|
106
139
|
}, null, 8, ["position-class"])),
|
|
107
|
-
|
|
140
|
+
h("div", {
|
|
108
141
|
class: "tpl-sr-only",
|
|
109
142
|
role: "status",
|
|
110
143
|
"aria-live": "polite",
|
|
111
144
|
"aria-atomic": "true",
|
|
112
|
-
"aria-label":
|
|
113
|
-
}, p(
|
|
114
|
-
|
|
115
|
-
"selected-block":
|
|
116
|
-
settings:
|
|
117
|
-
onUpdateBlock:
|
|
118
|
-
onDeleteBlock:
|
|
119
|
-
|
|
145
|
+
"aria-label": u(E).t.landmarks.reorderAnnouncements
|
|
146
|
+
}, p(u(E).keyboardReorder.announcement.value), 9, he),
|
|
147
|
+
n(S(le, {
|
|
148
|
+
"selected-block": u(T).selectedBlock.value,
|
|
149
|
+
settings: u(T).content.value.settings,
|
|
150
|
+
onUpdateBlock: r[1] ||= (e) => u(T).updateBlock(u(T).state.selectedBlockId, e),
|
|
151
|
+
onDeleteBlock: r[2] ||= () => {
|
|
152
|
+
u(T).state.selectedBlockId && u(E).blockActions.deleteBlock(u(T).state.selectedBlockId);
|
|
120
153
|
},
|
|
121
|
-
onDuplicateBlock:
|
|
122
|
-
|
|
154
|
+
onDuplicateBlock: r[3] ||= () => {
|
|
155
|
+
u(T).selectedBlock.value && u(E).blockActions.duplicateBlock(u(T).selectedBlock.value);
|
|
123
156
|
},
|
|
124
|
-
onUpdateSettings:
|
|
125
|
-
}, null, 8, ["selected-block", "settings"]), [[
|
|
126
|
-
|
|
157
|
+
onUpdateSettings: r[4] ||= (e) => u(T).updateSettings(e)
|
|
158
|
+
}, null, 8, ["selected-block", "settings"]), [[g, !u(T).state.previewMode && !U.value]]),
|
|
159
|
+
e.config.tour ? (a(), m(A, {
|
|
160
|
+
key: 1,
|
|
161
|
+
ref_key: "editorTourRef",
|
|
162
|
+
ref: v,
|
|
163
|
+
"tour-config": e.config.tour,
|
|
164
|
+
"dark-mode": u(T).state.darkMode
|
|
165
|
+
}, null, 8, ["tour-config", "dark-mode"])) : c("", !0)
|
|
166
|
+
], 14, P));
|
|
127
167
|
}
|
|
128
|
-
}), [["__scopeId", "data-v-
|
|
129
|
-
"./locales/de.ts": () => import("./chunks/de-
|
|
130
|
-
"./locales/en.ts": () => import("./chunks/en-
|
|
131
|
-
}),
|
|
168
|
+
}), [["__scopeId", "data-v-040fed1e"]]), B = /* @__PURE__ */ Object.assign({
|
|
169
|
+
"./locales/de.ts": () => import("./chunks/de-_tooy3Q8.js"),
|
|
170
|
+
"./locales/en.ts": () => import("./chunks/en-CNqLoIm9.js")
|
|
171
|
+
}), V = /* @__PURE__ */ Object.assign({
|
|
132
172
|
"./locales/cloud/de.ts": () => import("./chunks/de-RQrZR56a.js"),
|
|
133
173
|
"./locales/cloud/en.ts": () => import("./chunks/en-Bl1ecfRF.js")
|
|
134
174
|
});
|
|
135
|
-
function
|
|
175
|
+
function H(e) {
|
|
136
176
|
return Object.keys(e).map((e) => e.match(/\/([^/]+)\.ts$/)?.[1]).filter((e) => !!e);
|
|
137
177
|
}
|
|
138
|
-
var
|
|
139
|
-
function
|
|
178
|
+
var U = H(B), W = H(V);
|
|
179
|
+
function G(e) {
|
|
140
180
|
return e.split("-")[0].toLowerCase();
|
|
141
181
|
}
|
|
142
|
-
function
|
|
143
|
-
let n =
|
|
182
|
+
function K(e, t) {
|
|
183
|
+
let n = G(e);
|
|
144
184
|
return t.includes(n) ? n : "en";
|
|
145
185
|
}
|
|
146
|
-
async function
|
|
147
|
-
let t =
|
|
186
|
+
async function q(e) {
|
|
187
|
+
let t = B[`./locales/${K(e, U)}.ts`];
|
|
148
188
|
return (await t()).default;
|
|
149
189
|
}
|
|
150
|
-
async function
|
|
151
|
-
let t =
|
|
190
|
+
async function ge(e) {
|
|
191
|
+
let t = V[`./locales/cloud/${K(e, W)}.ts`];
|
|
152
192
|
return (await t()).default;
|
|
153
193
|
}
|
|
154
194
|
//#endregion
|
|
155
195
|
//#region src/utils/toMjml.ts
|
|
156
|
-
async function
|
|
196
|
+
async function _e(e) {
|
|
157
197
|
let t;
|
|
158
198
|
try {
|
|
159
|
-
t = await import("./chunks/renderer-
|
|
199
|
+
t = await import("./chunks/renderer-D0L44Vlp.js").then((e) => e.t);
|
|
160
200
|
} catch {
|
|
161
|
-
throw Error("[Templatical] toMjml() requires the @
|
|
201
|
+
throw Error("[Templatical] toMjml() requires the @aswin.dev/renderer package. Please install it.");
|
|
162
202
|
}
|
|
163
203
|
return t.renderToMjml(e.getContent(), { renderCustomBlock: e.renderCustomBlock });
|
|
164
204
|
}
|
|
165
205
|
//#endregion
|
|
166
206
|
//#region src/index.ts
|
|
167
|
-
var
|
|
168
|
-
async function
|
|
207
|
+
var J = null, Y = y(null);
|
|
208
|
+
async function ve(e) {
|
|
169
209
|
let t = typeof e.container == "string" ? document.querySelector(e.container) : e.container;
|
|
170
210
|
if (!t) throw Error(`[Templatical] Container element not found: ${e.container}`);
|
|
171
|
-
let n = await
|
|
172
|
-
|
|
173
|
-
return () =>
|
|
211
|
+
let n = await q(e.locale ?? "en"), r = C(e.fonts);
|
|
212
|
+
J && Q(), J = v({ setup() {
|
|
213
|
+
return () => o(z, {
|
|
174
214
|
config: e,
|
|
175
215
|
translations: n,
|
|
176
216
|
fontsManager: r,
|
|
177
|
-
ref:
|
|
217
|
+
ref: Y
|
|
178
218
|
});
|
|
179
|
-
} }),
|
|
219
|
+
} }), J.mount(t);
|
|
180
220
|
let i = {
|
|
181
221
|
getContent() {
|
|
182
|
-
return JSON.parse(JSON.stringify(
|
|
222
|
+
return JSON.parse(JSON.stringify(Y.value ? Y.value.getContent() : e.content));
|
|
183
223
|
},
|
|
184
224
|
setContent(t) {
|
|
185
|
-
|
|
225
|
+
Y.value && Y.value.setContent(t), e.content = t;
|
|
186
226
|
},
|
|
187
227
|
setTheme(e) {
|
|
188
|
-
|
|
228
|
+
Y.value && Y.value.setTheme(e);
|
|
189
229
|
},
|
|
190
230
|
unmount: Q,
|
|
231
|
+
startTour(e) {
|
|
232
|
+
Y.value?.startTour?.(e);
|
|
233
|
+
},
|
|
234
|
+
dismissTour() {
|
|
235
|
+
Y.value?.dismissTour?.();
|
|
236
|
+
},
|
|
237
|
+
resetTourDismissed() {
|
|
238
|
+
Y.value?.resetTourDismissed?.();
|
|
239
|
+
},
|
|
240
|
+
isTourDismissed() {
|
|
241
|
+
return Y.value?.isTourDismissed?.() ?? !0;
|
|
242
|
+
},
|
|
243
|
+
undo() {
|
|
244
|
+
Y.value?.undo?.();
|
|
245
|
+
},
|
|
246
|
+
redo() {
|
|
247
|
+
Y.value?.redo?.();
|
|
248
|
+
},
|
|
249
|
+
canUndo() {
|
|
250
|
+
return Y.value?.canUndo?.() ?? !1;
|
|
251
|
+
},
|
|
252
|
+
canRedo() {
|
|
253
|
+
return Y.value?.canRedo?.() ?? !1;
|
|
254
|
+
},
|
|
191
255
|
renderCustomBlock(e) {
|
|
192
|
-
return
|
|
256
|
+
return Y.value ? Y.value.renderCustomBlock(e) : Promise.reject(/* @__PURE__ */ Error("[Templatical] Editor not ready"));
|
|
193
257
|
},
|
|
194
|
-
toMjml: () =>
|
|
258
|
+
toMjml: () => _e(i)
|
|
195
259
|
};
|
|
196
260
|
return i;
|
|
197
261
|
}
|
|
198
|
-
var X = null, Z =
|
|
199
|
-
async function
|
|
262
|
+
var X = null, Z = y(null);
|
|
263
|
+
async function ye(e) {
|
|
200
264
|
let t = typeof e.container == "string" ? document.querySelector(e.container) : e.container;
|
|
201
265
|
if (!t) throw Error(`[Templatical] Container element not found: ${e.container}`);
|
|
202
|
-
let { default: n } = await import("./chunks/CloudEditor-
|
|
203
|
-
return X && $(), await new Promise((
|
|
204
|
-
let
|
|
205
|
-
|
|
206
|
-
},
|
|
207
|
-
X =
|
|
208
|
-
return () =>
|
|
266
|
+
let { default: n } = await import("./chunks/CloudEditor-Btyr0b0_.js"), [r, i] = await Promise.all([q(e.locale ?? "en"), ge(e.locale ?? "en")]), a = C(e.fonts);
|
|
267
|
+
return X && $(), await new Promise((s, c) => {
|
|
268
|
+
let l = setTimeout(() => {
|
|
269
|
+
c(/* @__PURE__ */ Error("[Templatical] Cloud editor initialization timed out"));
|
|
270
|
+
}, E);
|
|
271
|
+
X = v({ setup() {
|
|
272
|
+
return () => o(n, {
|
|
209
273
|
config: e,
|
|
210
274
|
translations: r,
|
|
211
275
|
cloudTranslations: i,
|
|
212
276
|
fontsManager: a,
|
|
213
277
|
ref: Z,
|
|
214
278
|
onReady: () => {
|
|
215
|
-
clearTimeout(
|
|
279
|
+
clearTimeout(l), s();
|
|
216
280
|
}
|
|
217
281
|
});
|
|
218
282
|
} }), X.mount(t);
|
|
@@ -227,6 +291,30 @@ async function ae(e) {
|
|
|
227
291
|
Z.value && Z.value.setTheme(e);
|
|
228
292
|
},
|
|
229
293
|
unmount: $,
|
|
294
|
+
startTour(e) {
|
|
295
|
+
Z.value?.startTour?.(e);
|
|
296
|
+
},
|
|
297
|
+
dismissTour() {
|
|
298
|
+
Z.value?.dismissTour?.();
|
|
299
|
+
},
|
|
300
|
+
resetTourDismissed() {
|
|
301
|
+
Z.value?.resetTourDismissed?.();
|
|
302
|
+
},
|
|
303
|
+
isTourDismissed() {
|
|
304
|
+
return Z.value?.isTourDismissed?.() ?? !0;
|
|
305
|
+
},
|
|
306
|
+
undo() {
|
|
307
|
+
Z.value?.undo?.();
|
|
308
|
+
},
|
|
309
|
+
redo() {
|
|
310
|
+
Z.value?.redo?.();
|
|
311
|
+
},
|
|
312
|
+
canUndo() {
|
|
313
|
+
return Z.value?.canUndo?.() ?? !1;
|
|
314
|
+
},
|
|
315
|
+
canRedo() {
|
|
316
|
+
return Z.value?.canRedo?.() ?? !1;
|
|
317
|
+
},
|
|
230
318
|
create(e) {
|
|
231
319
|
return Z.value ? Z.value.create(e) : Promise.reject(/* @__PURE__ */ Error("[Templatical] Cloud editor not ready"));
|
|
232
320
|
},
|
|
@@ -239,12 +327,12 @@ async function ae(e) {
|
|
|
239
327
|
};
|
|
240
328
|
}
|
|
241
329
|
function Q() {
|
|
242
|
-
|
|
330
|
+
J && (J.unmount(), J = null, Y.value = null);
|
|
243
331
|
}
|
|
244
332
|
function $() {
|
|
245
333
|
X && (X.unmount(), X = null, Z.value = null);
|
|
246
334
|
}
|
|
247
335
|
//#endregion
|
|
248
|
-
export {
|
|
336
|
+
export { O as DEFAULT_EDITOR_TOUR_STORAGE_KEY, ve as init, ye as initCloud, Q as unmount, C as useFonts };
|
|
249
337
|
|
|
250
338
|
//# sourceMappingURL=editor.js.map
|