@templatical/editor 0.6.5 → 0.6.7
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/{AiFeatureMenu-uXTxJh06.js → AiFeatureMenu-ChlAWywJ.js} +1 -1
- package/dist/{CloudEditor-_GaYluN7.js → CloudEditor-DYYaScFe.js} +4 -4
- package/dist/{CollaboratorBar-C4eXJkXW.js → CollaboratorBar-Bo8vtPId.js} +1 -1
- package/dist/{ModuleBrowserModal-EDKHLJtb.js → ModuleBrowserModal-CKhsaPnA.js} +4 -4
- package/dist/{ModulePreviewCanvas-MQxat34K.js → ModulePreviewCanvas-Cw9GeGus.js} +1 -1
- package/dist/{ParagraphEditor-C8IP9HOZ.js → ParagraphEditor-DjDiUzmv.js} +1 -1
- package/dist/{SaveModuleDialog-Bgu0FVr6.js → SaveModuleDialog-CSUPmfRP.js} +2 -2
- package/dist/{SnapshotHistory-aSULEKUJ.js → SnapshotHistory-DwX2fj6N.js} +1 -1
- package/dist/{TestEmailModal-wcbmmWCs.js → TestEmailModal-CIlBvWWn.js} +2 -2
- package/dist/{TitleEditor-21D8_OUQ.js → TitleEditor-BCV5k6wj.js} +1 -1
- package/dist/{TplModal-CINtyB6Y.js → TplModal-C3Hq9b58.js} +1 -1
- package/dist/{blockTypeIcons-DKetBdJx.js → blockTypeIcons-iUurP50H.js} +1 -1
- package/dist/bundle-stats.json +7 -7
- package/dist/cdn/chunks/{AccessibilityPanel-BMSGhaNU.js → AccessibilityPanel-DnNB30b0.js} +3 -3
- package/dist/cdn/chunks/{AccessibilityPanel-BMSGhaNU.js.map → AccessibilityPanel-DnNB30b0.js.map} +1 -1
- package/dist/cdn/chunks/{AiFeatureMenu-hNba-JqQ.js → AiFeatureMenu-BKBh_ueF.js} +2 -2
- package/dist/cdn/chunks/{AiFeatureMenu-hNba-JqQ.js.map → AiFeatureMenu-BKBh_ueF.js.map} +1 -1
- package/dist/cdn/chunks/{BlockA11yBadge-BIR88CvN.js → BlockA11yBadge-CnBu14Fj.js} +2 -2
- package/dist/cdn/chunks/{BlockA11yBadge-BIR88CvN.js.map → BlockA11yBadge-CnBu14Fj.js.map} +1 -1
- package/dist/cdn/chunks/{CloudEditor-D2G2nNpQ.js → CloudEditor-CmR17piA.js} +7 -7
- package/dist/cdn/chunks/{CloudEditor-D2G2nNpQ.js.map → CloudEditor-CmR17piA.js.map} +1 -1
- package/dist/cdn/chunks/{CollaboratorBar-Btzom8dY.js → CollaboratorBar-BejZaFtY.js} +3 -3
- package/dist/cdn/chunks/{CollaboratorBar-Btzom8dY.js.map → CollaboratorBar-BejZaFtY.js.map} +1 -1
- package/dist/cdn/chunks/{CountdownBlock-BJSAJlJ1.js → CountdownBlock-CjvUEHhE.js} +2 -2
- package/dist/cdn/chunks/{CountdownBlock-BJSAJlJ1.js.map → CountdownBlock-CjvUEHhE.js.map} +1 -1
- package/dist/cdn/chunks/{CountdownToolbar-DbknNrIi.js → CountdownToolbar-Caokkqsg.js} +3 -3
- package/dist/cdn/chunks/{CountdownToolbar-DbknNrIi.js.map → CountdownToolbar-Caokkqsg.js.map} +1 -1
- package/dist/cdn/chunks/{ModuleBrowserModal-BvAuW8O5.js → ModuleBrowserModal-Tb9a7L-K.js} +5 -5
- package/dist/cdn/chunks/{ModuleBrowserModal-BvAuW8O5.js.map → ModuleBrowserModal-Tb9a7L-K.js.map} +1 -1
- package/dist/cdn/chunks/{ModulePreviewCanvas-CYtt0boo.js → ModulePreviewCanvas-JWIEv5oS.js} +2 -2
- package/dist/cdn/chunks/{ModulePreviewCanvas-CYtt0boo.js.map → ModulePreviewCanvas-JWIEv5oS.js.map} +1 -1
- package/dist/cdn/chunks/{NumberWithSuffix-CVfo9ztG.js → NumberWithSuffix-DrV8eumz.js} +2 -2
- package/dist/cdn/chunks/{NumberWithSuffix-CVfo9ztG.js.map → NumberWithSuffix-DrV8eumz.js.map} +1 -1
- package/dist/cdn/chunks/{ParagraphEditor-DCo58JP8.js → ParagraphEditor-CSfShBAO.js} +5 -5
- package/dist/cdn/chunks/{ParagraphEditor-DCo58JP8.js.map → ParagraphEditor-CSfShBAO.js.map} +1 -1
- package/dist/cdn/chunks/{RichTextEditorContent-BzCThv84.js → RichTextEditorContent-DgqZzl8n.js} +2 -2
- package/dist/cdn/chunks/{RichTextEditorContent-BzCThv84.js.map → RichTextEditorContent-DgqZzl8n.js.map} +1 -1
- package/dist/cdn/chunks/{SaveModuleDialog-S2Lix1LD.js → SaveModuleDialog-CxTwrIgx.js} +2 -2
- package/dist/cdn/chunks/{SaveModuleDialog-S2Lix1LD.js.map → SaveModuleDialog-CxTwrIgx.js.map} +1 -1
- package/dist/cdn/chunks/{TitleEditor-CYzAMuUW.js → TitleEditor-DlqV7ODD.js} +5 -5
- package/dist/cdn/chunks/{TitleEditor-CYzAMuUW.js.map → TitleEditor-DlqV7ODD.js.map} +1 -1
- package/dist/cdn/chunks/{blockTypeIcons-DOzUHoor.js → blockTypeIcons-DMt-2qR6.js} +3 -3
- package/dist/cdn/chunks/{blockTypeIcons-DOzUHoor.js.map → blockTypeIcons-DMt-2qR6.js.map} +1 -1
- package/dist/cdn/chunks/{de-D8CnZxV9.js → de-B_6zGPbx.js} +1 -1
- package/dist/cdn/chunks/{de-D8CnZxV9.js.map → de-B_6zGPbx.js.map} +1 -1
- package/dist/cdn/chunks/{de-Ce-LbJ2J.js → de-DG1WWVXM.js} +1 -1
- package/dist/cdn/chunks/{de-Ce-LbJ2J.js.map → de-DG1WWVXM.js.map} +1 -1
- package/dist/cdn/chunks/{en-DiCWK5fG.js → en-BE6OV83-.js} +1 -1
- package/dist/cdn/chunks/{en-DiCWK5fG.js.map → en-BE6OV83-.js.map} +1 -1
- package/dist/cdn/chunks/{en-8FHaQv4V.js → en-pYt1-lm4.js} +1 -1
- package/dist/cdn/chunks/{en-8FHaQv4V.js.map → en-pYt1-lm4.js.map} +1 -1
- package/dist/cdn/chunks/{extensions-wafZZ0-_.js → extensions-CUvwrffu.js} +2 -2
- package/dist/cdn/chunks/{extensions-wafZZ0-_.js.map → extensions-CUvwrffu.js.map} +1 -1
- package/dist/cdn/chunks/{features-B4tNvoi4.js → features-U3nzKc-R.js} +24 -14
- package/dist/cdn/chunks/features-U3nzKc-R.js.map +1 -0
- package/dist/cdn/chunks/{icons-B5nBFtvb.js → icons-QcjADKIW.js} +2 -2
- package/dist/cdn/chunks/{icons-B5nBFtvb.js.map → icons-QcjADKIW.js.map} +1 -1
- package/dist/cdn/chunks/{media-library-BLaoBxHe.js → media-library-Zcd_GInj.js} +3 -3
- package/dist/cdn/chunks/{media-library-BLaoBxHe.js.map → media-library-Zcd_GInj.js.map} +1 -1
- package/dist/cdn/chunks/pt-BR-BYRTP5Ww.js +89 -0
- package/dist/cdn/chunks/pt-BR-BYRTP5Ww.js.map +1 -0
- package/dist/cdn/chunks/pt-BR-CQl2JxRp.js +209 -0
- package/dist/cdn/chunks/pt-BR-CQl2JxRp.js.map +1 -0
- package/dist/cdn/chunks/pt-BR-CtDwVsN-.js +523 -0
- package/dist/cdn/chunks/pt-BR-CtDwVsN-.js.map +1 -0
- package/dist/cdn/chunks/{quality-D920ZxXf.js → quality-8eo6DM3p.js} +2 -2
- package/dist/cdn/chunks/{quality-D920ZxXf.js.map → quality-8eo6DM3p.js.map} +1 -1
- package/dist/cdn/chunks/{renderer-Yk30CckU.js → renderer-eHJyPiJH.js} +2 -2
- package/dist/cdn/chunks/{renderer-Yk30CckU.js.map → renderer-eHJyPiJH.js.map} +1 -1
- package/dist/cdn/chunks/{src-kLJg7Y0m.js → src-CthVYW_o.js} +178 -163
- package/dist/cdn/chunks/{src-kLJg7Y0m.js.map → src-CthVYW_o.js.map} +1 -1
- package/dist/cdn/chunks/{styles-DrVLif14.js → styles-CV5w3kjq.js} +8 -8
- package/dist/cdn/chunks/{styles-DrVLif14.js.map → styles-CV5w3kjq.js.map} +1 -1
- package/dist/cdn/editor.css +1 -1
- package/dist/cdn/editor.js +102 -79
- package/dist/cdn/editor.js.map +1 -1
- package/dist/index.d.ts +18 -0
- package/dist/pt-BR-BMGasLBa.js +521 -0
- package/dist/pt-BR-Vq7D7c11.js +207 -0
- package/dist/style.css +1 -1
- package/dist/{styles-CwJQsnSp.js → styles-BgmKdc2x.js} +2 -2
- package/dist/templatical-editor.js +105 -82
- package/dist/{useEditorCore-DLd-5qMg.js → useEditorCore-CnXrv71D.js} +25 -15
- package/package.json +7 -7
- package/dist/cdn/chunks/features-B4tNvoi4.js.map +0 -1
- /package/dist/{de-Brqvgr43.js → de-DcVOh9Fp.js} +0 -0
- /package/dist/{en-WDVp87TE.js → en-TZVJ_f6v.js} +0 -0
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { A as e, B as t, O as n, S as r, X as i, _ as a, at as o, b as s, f as c, h as l, k as
|
|
2
|
-
import { r as
|
|
3
|
-
import { L as
|
|
4
|
-
import { a as
|
|
5
|
-
import { t as
|
|
1
|
+
import { A as e, B as t, O as n, S as r, X as i, _ as a, at as o, b as s, f as c, h as l, k as u, m as d, n as f, o as p, ot as m, p as h, rt as g, st as _, t as v, v as y, z as b } from "./vue.runtime.esm-bundler-Bxqkjqhc.js";
|
|
2
|
+
import { r as x } from "./timeouts-BSGxjuUF.js";
|
|
3
|
+
import { L as S, t as C, x as w } from "./useEditorCore-CnXrv71D.js";
|
|
4
|
+
import { a as T, c as E, i as D, l as O, n as k, o as ee, r as te, s as ne, t as re } from "./styles-BgmKdc2x.js";
|
|
5
|
+
import { t as ie } from "./_plugin-vue_export-helper-B0hnzhyu.js";
|
|
6
6
|
//#region src/Editor.vue?vue&type=script&setup=true&lang.ts
|
|
7
|
-
var
|
|
7
|
+
var ae = ["data-tpl-theme"], oe = {
|
|
8
8
|
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)]",
|
|
9
9
|
style: {
|
|
10
10
|
"background-color": "color-mix(in srgb, var(--tpl-bg) 80%, transparent)",
|
|
11
11
|
"backdrop-filter": "blur(12px)",
|
|
12
12
|
"-webkit-backdrop-filter": "blur(12px)"
|
|
13
13
|
}
|
|
14
|
-
},
|
|
14
|
+
}, A = { class: "tpl:flex tpl:items-center tpl:justify-center tpl:gap-10" }, j = { class: "tpl:sticky tpl:top-0 tpl:z-40 tpl:h-0" }, M = { class: "tpl:flex tpl:justify-center tpl:p-8" }, N = ["aria-label"], P = /* @__PURE__ */ ie(/* @__PURE__ */ s({
|
|
15
15
|
__name: "Editor",
|
|
16
16
|
props: {
|
|
17
17
|
config: {},
|
|
@@ -19,11 +19,11 @@ var j = ["data-tpl-theme"], M = {
|
|
|
19
19
|
fontsManager: {}
|
|
20
20
|
},
|
|
21
21
|
setup(r, { expose: i }) {
|
|
22
|
-
let s = r,
|
|
22
|
+
let s = r, f = S({
|
|
23
23
|
content: s.config.content,
|
|
24
24
|
templateDefaults: s.config.templateDefaults
|
|
25
|
-
}),
|
|
26
|
-
editor:
|
|
25
|
+
}), x = C({
|
|
26
|
+
editor: f,
|
|
27
27
|
config: {
|
|
28
28
|
uiTheme: s.config.uiTheme,
|
|
29
29
|
theme: s.config.theme,
|
|
@@ -32,67 +32,67 @@ var j = ["data-tpl-theme"], M = {
|
|
|
32
32
|
mergeTags: s.config.mergeTags,
|
|
33
33
|
displayConditions: s.config.displayConditions,
|
|
34
34
|
onRequestMedia: s.config.onRequestMedia,
|
|
35
|
-
accessibility:
|
|
36
|
-
onSave: s.config.onSave ? () => s.config.onSave(JSON.parse(JSON.stringify(
|
|
35
|
+
accessibility: E(s.config),
|
|
36
|
+
onSave: s.config.onSave ? () => s.config.onSave(JSON.parse(JSON.stringify(f.state.content))) : void 0
|
|
37
37
|
},
|
|
38
38
|
translations: s.translations,
|
|
39
39
|
fontsManager: s.fontsManager,
|
|
40
|
-
autoSaveOptions: s.config.onChange ? { onChange: () => s.config.onChange(JSON.parse(JSON.stringify(
|
|
40
|
+
autoSaveOptions: s.config.onChange ? { onChange: () => s.config.onChange(JSON.parse(JSON.stringify(f.state.content))) } : null
|
|
41
41
|
});
|
|
42
42
|
return n(async () => {
|
|
43
43
|
await s.fontsManager.loadCustomFonts();
|
|
44
|
-
}),
|
|
45
|
-
s.fontsManager.cleanupFontLinks(),
|
|
44
|
+
}), u(() => {
|
|
45
|
+
s.fontsManager.cleanupFontLinks(), x.destroy();
|
|
46
46
|
}), i({
|
|
47
|
-
getContent: () =>
|
|
48
|
-
setContent: (e) =>
|
|
49
|
-
setTheme: (e) =>
|
|
50
|
-
renderCustomBlock:
|
|
47
|
+
getContent: () => f.content.value,
|
|
48
|
+
setContent: (e) => f.setContent(e),
|
|
49
|
+
setTheme: (e) => f.setUiTheme(e),
|
|
50
|
+
renderCustomBlock: x.registry.renderCustomBlock
|
|
51
51
|
}), (n, i) => (e(), l("div", {
|
|
52
|
-
class: o(["tpl tpl:relative tpl:h-full tpl:overflow-hidden", { "tpl:dark":
|
|
53
|
-
"data-tpl-theme":
|
|
54
|
-
style:
|
|
52
|
+
class: o(["tpl tpl:relative tpl:h-full tpl:overflow-hidden", { "tpl:dark": g(f).state.darkMode }]),
|
|
53
|
+
"data-tpl-theme": g(x).resolvedTheme.value,
|
|
54
|
+
style: m(g(x).themeStyles.value)
|
|
55
55
|
}, [
|
|
56
|
-
c("header",
|
|
56
|
+
c("header", oe, [
|
|
57
57
|
i[5] ||= c("div", { class: "tpl:flex tpl:items-center tpl:gap-2.5" }, null, -1),
|
|
58
|
-
c("div",
|
|
59
|
-
|
|
60
|
-
viewport:
|
|
61
|
-
onChange:
|
|
58
|
+
c("div", A, [
|
|
59
|
+
y(D, {
|
|
60
|
+
viewport: g(f).state.viewport,
|
|
61
|
+
onChange: g(f).setViewport
|
|
62
62
|
}, null, 8, ["viewport", "onChange"]),
|
|
63
|
-
|
|
64
|
-
"dark-mode":
|
|
65
|
-
onChange:
|
|
63
|
+
y(k, {
|
|
64
|
+
"dark-mode": g(f).state.darkMode,
|
|
65
|
+
onChange: g(f).setDarkMode
|
|
66
66
|
}, null, 8, ["dark-mode", "onChange"]),
|
|
67
|
-
|
|
68
|
-
"preview-mode":
|
|
69
|
-
onChange:
|
|
67
|
+
y(te, {
|
|
68
|
+
"preview-mode": g(f).state.previewMode,
|
|
69
|
+
onChange: g(f).setPreviewMode
|
|
70
70
|
}, null, 8, ["preview-mode", "onChange"])
|
|
71
71
|
]),
|
|
72
72
|
i[6] ||= c("div", { class: "tpl:flex tpl:min-w-[200px] tpl:items-center tpl:justify-end tpl:gap-3" }, null, -1)
|
|
73
73
|
]),
|
|
74
|
-
t(
|
|
74
|
+
t(y(ee, null, null, 512), [[p, !g(f).state.previewMode]]),
|
|
75
75
|
c("div", {
|
|
76
|
-
class: o(["tpl-body tpl:absolute tpl:bottom-0 tpl:overflow-auto tpl:bg-[var(--tpl-canvas-bg)]", [
|
|
76
|
+
class: o(["tpl-body tpl:absolute tpl:bottom-0 tpl:overflow-auto tpl:bg-[var(--tpl-canvas-bg)]", [g(f).state.previewMode ? "tpl:left-0 tpl:right-0" : "tpl:left-12 tpl:right-[320px]", "tpl:top-14"]]),
|
|
77
77
|
style: { transition: "all 300ms cubic-bezier(0.34, 1.56, 0.64, 1)" }
|
|
78
|
-
}, [c("div",
|
|
79
|
-
default:
|
|
78
|
+
}, [c("div", j, [y(v, { name: "tpl-restore-btn" }, {
|
|
79
|
+
default: b(() => [g(x).conditionPreview.hasHiddenBlocks.value ? (e(), l("button", {
|
|
80
80
|
key: 0,
|
|
81
81
|
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)]",
|
|
82
82
|
style: { "backdrop-filter": "blur(8px)" },
|
|
83
|
-
onClick: i[0] ||= (e) =>
|
|
84
|
-
}, [
|
|
83
|
+
onClick: i[0] ||= (e) => g(x).conditionPreview.reset()
|
|
84
|
+
}, [y(g(O), {
|
|
85
85
|
size: 13,
|
|
86
86
|
"stroke-width": 2
|
|
87
|
-
}), a(" " + g(
|
|
87
|
+
}), a(" " + _(g(x).t.blockSettings.restoreHiddenBlocks), 1)])) : d("", !0)]),
|
|
88
88
|
_: 1
|
|
89
|
-
})]), c("div",
|
|
90
|
-
viewport:
|
|
91
|
-
content:
|
|
92
|
-
"selected-block-id":
|
|
93
|
-
"dark-mode":
|
|
94
|
-
"preview-mode":
|
|
95
|
-
onSelectBlock:
|
|
89
|
+
})]), c("div", M, [y(ne, {
|
|
90
|
+
viewport: g(f).state.viewport,
|
|
91
|
+
content: g(f).content.value,
|
|
92
|
+
"selected-block-id": g(f).state.selectedBlockId,
|
|
93
|
+
"dark-mode": g(f).state.darkMode,
|
|
94
|
+
"preview-mode": g(f).state.previewMode,
|
|
95
|
+
onSelectBlock: g(f).selectBlock
|
|
96
96
|
}, null, 8, [
|
|
97
97
|
"viewport",
|
|
98
98
|
"content",
|
|
@@ -101,57 +101,80 @@ var j = ["data-tpl-theme"], M = {
|
|
|
101
101
|
"preview-mode",
|
|
102
102
|
"onSelectBlock"
|
|
103
103
|
])])], 2),
|
|
104
|
-
r.config.branding === !1 ?
|
|
104
|
+
r.config.branding === !1 ? d("", !0) : (e(), h(re, {
|
|
105
105
|
key: 0,
|
|
106
|
-
"position-class": [
|
|
106
|
+
"position-class": [g(f).state.previewMode ? "tpl:left-0 tpl:right-0" : "tpl:left-12 tpl:right-[320px]"]
|
|
107
107
|
}, null, 8, ["position-class"])),
|
|
108
108
|
c("div", {
|
|
109
109
|
class: "tpl-sr-only",
|
|
110
110
|
role: "status",
|
|
111
111
|
"aria-live": "polite",
|
|
112
112
|
"aria-atomic": "true",
|
|
113
|
-
"aria-label":
|
|
114
|
-
}, g(
|
|
115
|
-
t(
|
|
116
|
-
"selected-block":
|
|
117
|
-
settings:
|
|
118
|
-
onUpdateBlock: i[1] ||= (e) =>
|
|
113
|
+
"aria-label": g(x).t.landmarks.reorderAnnouncements
|
|
114
|
+
}, _(g(x).keyboardReorder.announcement.value), 9, N),
|
|
115
|
+
t(y(T, {
|
|
116
|
+
"selected-block": g(f).selectedBlock.value,
|
|
117
|
+
settings: g(f).content.value.settings,
|
|
118
|
+
onUpdateBlock: i[1] ||= (e) => g(f).updateBlock(g(f).state.selectedBlockId, e),
|
|
119
119
|
onDeleteBlock: i[2] ||= () => {
|
|
120
|
-
|
|
120
|
+
g(f).state.selectedBlockId && g(x).blockActions.deleteBlock(g(f).state.selectedBlockId);
|
|
121
121
|
},
|
|
122
122
|
onDuplicateBlock: i[3] ||= () => {
|
|
123
|
-
|
|
123
|
+
g(f).selectedBlock.value && g(x).blockActions.duplicateBlock(g(f).selectedBlock.value);
|
|
124
124
|
},
|
|
125
|
-
onUpdateSettings: i[4] ||= (e) =>
|
|
126
|
-
}, null, 8, ["selected-block", "settings"]), [[
|
|
127
|
-
], 14,
|
|
125
|
+
onUpdateSettings: i[4] ||= (e) => g(f).updateSettings(e)
|
|
126
|
+
}, null, 8, ["selected-block", "settings"]), [[p, !g(f).state.previewMode]])
|
|
127
|
+
], 14, ae));
|
|
128
128
|
}
|
|
129
|
-
}), [["__scopeId", "data-v-9ffdcb5e"]]),
|
|
130
|
-
"./locales/de.ts": () => import("./de-
|
|
131
|
-
"./locales/en.ts": () => import("./en-
|
|
132
|
-
|
|
129
|
+
}), [["__scopeId", "data-v-9ffdcb5e"]]), F = /* @__PURE__ */ Object.assign({
|
|
130
|
+
"./locales/de.ts": () => import("./de-DcVOh9Fp.js"),
|
|
131
|
+
"./locales/en.ts": () => import("./en-TZVJ_f6v.js"),
|
|
132
|
+
"./locales/pt-BR.ts": () => import("./pt-BR-BMGasLBa.js")
|
|
133
|
+
}), I = /* @__PURE__ */ Object.assign({
|
|
133
134
|
"./locales/cloud/de.ts": () => import("./de-DCaaCE5s.js"),
|
|
134
|
-
"./locales/cloud/en.ts": () => import("./en-DXCyK4-X.js")
|
|
135
|
+
"./locales/cloud/en.ts": () => import("./en-DXCyK4-X.js"),
|
|
136
|
+
"./locales/cloud/pt-BR.ts": () => import("./pt-BR-Vq7D7c11.js")
|
|
135
137
|
});
|
|
136
|
-
function
|
|
138
|
+
function L(e) {
|
|
137
139
|
return Object.keys(e).map((e) => e.match(/\/([^/]+)\.ts$/)?.[1]).filter((e) => !!e);
|
|
138
140
|
}
|
|
139
|
-
var
|
|
140
|
-
function
|
|
141
|
-
return e.
|
|
141
|
+
var R = L(F), z = L(I);
|
|
142
|
+
function B(e) {
|
|
143
|
+
return e.trim().replace(/_/g, "-").toLowerCase();
|
|
144
|
+
}
|
|
145
|
+
function V(e, t) {
|
|
146
|
+
let n = B(e);
|
|
147
|
+
return t.find((e) => B(e) === n);
|
|
148
|
+
}
|
|
149
|
+
function H(e) {
|
|
150
|
+
return B(e).split("-")[0];
|
|
151
|
+
}
|
|
152
|
+
function U(e, t) {
|
|
153
|
+
return V(e, t) ?? V(H(e), t);
|
|
142
154
|
}
|
|
143
155
|
function W(e, t) {
|
|
144
|
-
|
|
145
|
-
return t.includes(n) ? n : "en";
|
|
156
|
+
return U(e, t) ?? "en";
|
|
146
157
|
}
|
|
147
158
|
async function G(e) {
|
|
148
|
-
let t =
|
|
159
|
+
let t = F[`./locales/${W(e, R)}.ts`];
|
|
149
160
|
return (await t()).default;
|
|
150
161
|
}
|
|
151
162
|
async function K(e) {
|
|
152
|
-
let t =
|
|
163
|
+
let t = I[`./locales/cloud/${W(e, z)}.ts`];
|
|
153
164
|
return (await t()).default;
|
|
154
165
|
}
|
|
166
|
+
function se(e) {
|
|
167
|
+
return U(e, R) !== void 0;
|
|
168
|
+
}
|
|
169
|
+
function ce(e) {
|
|
170
|
+
return U(e, z) !== void 0;
|
|
171
|
+
}
|
|
172
|
+
function le() {
|
|
173
|
+
return [...R];
|
|
174
|
+
}
|
|
175
|
+
function ue() {
|
|
176
|
+
return [...z];
|
|
177
|
+
}
|
|
155
178
|
//#endregion
|
|
156
179
|
//#region src/utils/toMjml.ts
|
|
157
180
|
async function q(e) {
|
|
@@ -166,12 +189,12 @@ async function q(e) {
|
|
|
166
189
|
//#endregion
|
|
167
190
|
//#region src/index.ts
|
|
168
191
|
var J = null, Y = i(null);
|
|
169
|
-
async function
|
|
192
|
+
async function de(e) {
|
|
170
193
|
let t = typeof e.container == "string" ? document.querySelector(e.container) : e.container;
|
|
171
194
|
if (!t) throw Error(`[Templatical] Container element not found: ${e.container}`);
|
|
172
|
-
let n = await G(e.locale ?? "en"), i =
|
|
173
|
-
J && Q(), J =
|
|
174
|
-
return () => r(
|
|
195
|
+
let n = await G(e.locale ?? "en"), i = w(e.fonts);
|
|
196
|
+
J && Q(), J = f({ setup() {
|
|
197
|
+
return () => r(P, {
|
|
175
198
|
config: e,
|
|
176
199
|
translations: n,
|
|
177
200
|
fontsManager: i,
|
|
@@ -197,15 +220,15 @@ async function ie(e) {
|
|
|
197
220
|
return a;
|
|
198
221
|
}
|
|
199
222
|
var X = null, Z = i(null);
|
|
200
|
-
async function
|
|
223
|
+
async function fe(e) {
|
|
201
224
|
let t = typeof e.container == "string" ? document.querySelector(e.container) : e.container;
|
|
202
225
|
if (!t) throw Error(`[Templatical] Container element not found: ${e.container}`);
|
|
203
|
-
let { default: n } = await import("./CloudEditor-
|
|
226
|
+
let { default: n } = await import("./CloudEditor-DYYaScFe.js"), [i, a] = await Promise.all([G(e.locale ?? "en"), K(e.locale ?? "en")]), o = w(e.fonts);
|
|
204
227
|
return X && $(), await new Promise((s, c) => {
|
|
205
228
|
let l = setTimeout(() => {
|
|
206
229
|
c(/* @__PURE__ */ Error("[Templatical] Cloud editor initialization timed out"));
|
|
207
|
-
},
|
|
208
|
-
X =
|
|
230
|
+
}, x);
|
|
231
|
+
X = f({ setup() {
|
|
209
232
|
return () => r(n, {
|
|
210
233
|
config: e,
|
|
211
234
|
translations: i,
|
|
@@ -246,4 +269,4 @@ function $() {
|
|
|
246
269
|
X && (X.unmount(), X = null, Z.value = null);
|
|
247
270
|
}
|
|
248
271
|
//#endregion
|
|
249
|
-
export {
|
|
272
|
+
export { H as getBaseLocale, ue as getSupportedCloudLocales, le as getSupportedLocales, de as init, fe as initCloud, ce as isCloudLocaleSupported, se as isLocaleSupported, Q as unmount, w as useFonts };
|
|
@@ -1564,7 +1564,7 @@ var Kn = ["innerHTML"], qn = /* @__PURE__ */ y({
|
|
|
1564
1564
|
viewport: {}
|
|
1565
1565
|
},
|
|
1566
1566
|
setup(t) {
|
|
1567
|
-
let n = t, r = se(() => import("./ParagraphEditor-
|
|
1567
|
+
let n = t, r = se(() => import("./ParagraphEditor-DjDiUzmv.js")), { isEditing: i, blockRef: a, toolbarPosition: o, resolvedContent: s, handleDoubleClick: c, handleEditorDone: l } = Gn(() => n.block.content);
|
|
1568
1568
|
return (n, u) => (e(), w("div", {
|
|
1569
1569
|
ref_key: "blockRef",
|
|
1570
1570
|
ref: a,
|
|
@@ -1756,41 +1756,51 @@ var Xn = ["data-block-id", "data-block-type"], Zn = ["aria-label"], Qn = [
|
|
|
1756
1756
|
l(n.$slots, "default", {}, void 0, !0)
|
|
1757
1757
|
], 14, Xn));
|
|
1758
1758
|
}
|
|
1759
|
-
}), [["__scopeId", "data-v-850614e7"]])
|
|
1759
|
+
}), [["__scopeId", "data-v-850614e7"]]);
|
|
1760
|
+
//#endregion
|
|
1761
|
+
//#region src/utils/unwrapParagraph.ts
|
|
1762
|
+
function lr(e) {
|
|
1763
|
+
let t = e.match(/^\s*<p\b[^>]*>([\s\S]*)<\/p>\s*$/);
|
|
1764
|
+
return !t || /<\/p>\s*<p\b/i.test(t[1]) ? e : t[1];
|
|
1765
|
+
}
|
|
1766
|
+
//#endregion
|
|
1767
|
+
//#region src/components/blocks/TitleBlock.vue
|
|
1768
|
+
var ur = /* @__PURE__ */ y({
|
|
1760
1769
|
__name: "TitleBlock",
|
|
1761
1770
|
props: {
|
|
1762
1771
|
block: {},
|
|
1763
1772
|
viewport: {}
|
|
1764
1773
|
},
|
|
1765
1774
|
setup(t) {
|
|
1766
|
-
let n = t, r = se(() => import("./TitleEditor-
|
|
1775
|
+
let n = t, r = se(() => import("./TitleEditor-BCV5k6wj.js")), { isEditing: a, blockRef: o, toolbarPosition: s, resolvedContent: c, handleDoubleClick: l, handleEditorDone: u } = Gn(() => n.block.content), d = x(() => {
|
|
1767
1776
|
let e = {
|
|
1768
1777
|
fontSize: `${De[n.block.level]}px`,
|
|
1769
1778
|
color: n.block.color,
|
|
1770
1779
|
textAlign: n.block.textAlign
|
|
1771
1780
|
};
|
|
1772
1781
|
return n.block.fontFamily && (e.fontFamily = n.block.fontFamily), e;
|
|
1773
|
-
});
|
|
1774
|
-
return (n,
|
|
1782
|
+
}), f = x(() => `h${n.block.level}`), p = x(() => lr(c.value));
|
|
1783
|
+
return (n, c) => (e(), w("div", {
|
|
1775
1784
|
ref_key: "blockRef",
|
|
1776
|
-
ref:
|
|
1785
|
+
ref: o,
|
|
1777
1786
|
class: "tpl:min-h-[1em] tpl:w-full",
|
|
1778
|
-
style: A(
|
|
1779
|
-
onDblclick:
|
|
1780
|
-
}, [j(
|
|
1787
|
+
style: A(d.value),
|
|
1788
|
+
onDblclick: c[0] ||= (...e) => j(l) && j(l)(...e)
|
|
1789
|
+
}, [j(a) ? (e(), ne(j(r), {
|
|
1781
1790
|
key: 0,
|
|
1782
1791
|
block: t.block,
|
|
1783
|
-
"toolbar-position": j(
|
|
1784
|
-
onDone: j(
|
|
1792
|
+
"toolbar-position": j(s),
|
|
1793
|
+
onDone: j(u)
|
|
1785
1794
|
}, null, 8, [
|
|
1786
1795
|
"block",
|
|
1787
1796
|
"toolbar-position",
|
|
1788
1797
|
"onDone"
|
|
1789
|
-
])) : (e(),
|
|
1798
|
+
])) : (e(), ne(i(f.value), {
|
|
1790
1799
|
key: 1,
|
|
1791
|
-
class: "tpl-text-content tpl:outline-none [&_a]:tpl:underline [&_p]:tpl:m-0 [&_p]:tpl:mb-2 [&_p:last-child]:tpl:mb-0",
|
|
1792
|
-
|
|
1793
|
-
|
|
1800
|
+
class: "tpl-text-content tpl:m-0 tpl:font-[inherit] tpl:text-[length:inherit] tpl:leading-tight tpl:outline-none [&_a]:tpl:underline [&_p]:tpl:m-0 [&_p]:tpl:mb-2 [&_p:last-child]:tpl:mb-0",
|
|
1801
|
+
style: { color: "inherit" },
|
|
1802
|
+
innerHTML: p.value
|
|
1803
|
+
}, null, 8, ["innerHTML"]))], 36));
|
|
1794
1804
|
}
|
|
1795
1805
|
}), dr = Object.defineProperty, fr = Object.getOwnPropertySymbols, pr = Object.prototype.hasOwnProperty, mr = Object.prototype.propertyIsEnumerable, hr = (e, t, n) => t in e ? dr(e, t, {
|
|
1796
1806
|
enumerable: !0,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@templatical/editor",
|
|
3
3
|
"description": "Vue 3 visual drag-and-drop email editor powered by Templatical",
|
|
4
|
-
"version": "0.6.
|
|
4
|
+
"version": "0.6.7",
|
|
5
5
|
"bugs": "https://github.com/templatical/sdk/issues",
|
|
6
6
|
"devDependencies": {
|
|
7
7
|
"@lucide/vue": "^1.11.0",
|
|
@@ -33,9 +33,9 @@
|
|
|
33
33
|
"vue": "^3.5.33",
|
|
34
34
|
"vue-draggable-plus": "^0.6.0",
|
|
35
35
|
"vue-tsc": "^3.2.7",
|
|
36
|
-
"@templatical/core": "0.6.
|
|
37
|
-
"@templatical/quality": "0.6.
|
|
38
|
-
"@templatical/types": "0.6.
|
|
36
|
+
"@templatical/core": "0.6.7",
|
|
37
|
+
"@templatical/quality": "0.6.7",
|
|
38
|
+
"@templatical/types": "0.6.7"
|
|
39
39
|
},
|
|
40
40
|
"exports": {
|
|
41
41
|
".": {
|
|
@@ -63,9 +63,9 @@
|
|
|
63
63
|
"license": "SEE LICENSE IN LICENSE",
|
|
64
64
|
"module": "./dist/templatical-editor.js",
|
|
65
65
|
"peerDependencies": {
|
|
66
|
-
"@templatical/media-library": "0.6.
|
|
67
|
-
"@templatical/quality": "0.6.
|
|
68
|
-
"@templatical/renderer": "0.6.
|
|
66
|
+
"@templatical/media-library": "0.6.7",
|
|
67
|
+
"@templatical/quality": "0.6.7",
|
|
68
|
+
"@templatical/renderer": "0.6.7"
|
|
69
69
|
},
|
|
70
70
|
"peerDependenciesMeta": {
|
|
71
71
|
"@templatical/renderer": {
|