@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
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { t as E } from "./useI18n-
|
|
4
|
-
import { t as D } from "./useMergeTag-
|
|
5
|
-
import { F as O, Gt as k, _n as A, bn as j, i as M, o as N, p as P, u as F, vn as ee, xn as I } from "./dist-
|
|
6
|
-
import { n as L, t as R } from "./dist-
|
|
1
|
+
import { At as e, C as t, F as n, Ft as r, N as i, T as a, U as o, W as s, _ as c, c as l, d as u, et as d, f, g as p, h as m, jt as h, k as g, m as _, n as v, st as y, u as b, v as x } from "./vue.runtime.esm-bundler-CjauPXjj.js";
|
|
2
|
+
import { M as S, O as C, i as w, k as T } from "./dist-Bmir0gYb.js";
|
|
3
|
+
import { t as E } from "./useI18n-C2xQZ6K9.js";
|
|
4
|
+
import { t as D } from "./useMergeTag-CfuZq2fF.js";
|
|
5
|
+
import { F as O, Gt as k, _n as A, bn as j, i as M, o as N, p as P, u as F, vn as ee, xn as I } from "./dist-DvHLtWVP.js";
|
|
6
|
+
import { n as L, t as R } from "./dist-CPVBKMmd.js";
|
|
7
7
|
//#region src/extensions/FontSize.ts
|
|
8
8
|
var te = M.create({
|
|
9
9
|
name: "fontSize",
|
|
@@ -75,7 +75,7 @@ var te = M.create({
|
|
|
75
75
|
"aria-label",
|
|
76
76
|
"data-tooltip",
|
|
77
77
|
"onKeydown"
|
|
78
|
-
], B = ["aria-label", "onKeydown"], V = ["aria-label"], H = /* @__PURE__ */
|
|
78
|
+
], B = ["aria-label", "onKeydown"], V = ["aria-label"], H = /* @__PURE__ */ t({
|
|
79
79
|
__name: "LogicMergeTagNodeView",
|
|
80
80
|
props: {
|
|
81
81
|
node: {},
|
|
@@ -84,10 +84,10 @@ var te = M.create({
|
|
|
84
84
|
deleteNode: { type: Function },
|
|
85
85
|
updateAttributes: { type: Function }
|
|
86
86
|
},
|
|
87
|
-
setup(
|
|
88
|
-
let
|
|
87
|
+
setup(t) {
|
|
88
|
+
let n = t, { syntax: a } = D(), { t: f } = E(), v = _(() => S(n.node.attrs.value, a)), w = _(() => C(n.node.attrs.value, a)), T = d(!1), O = d(""), k = d(null), A = !1;
|
|
89
89
|
function j() {
|
|
90
|
-
O.value =
|
|
90
|
+
O.value = n.node.attrs.value, A = !1, T.value = !0, g(() => {
|
|
91
91
|
k.value?.focus(), k.value?.select();
|
|
92
92
|
});
|
|
93
93
|
}
|
|
@@ -99,53 +99,53 @@ var te = M.create({
|
|
|
99
99
|
T.value = !1;
|
|
100
100
|
return;
|
|
101
101
|
}
|
|
102
|
-
e !==
|
|
102
|
+
e !== n.node.attrs.value && n.updateAttributes({
|
|
103
103
|
value: e,
|
|
104
|
-
keyword:
|
|
104
|
+
keyword: S(e, a) ? C(e, a) : ""
|
|
105
105
|
}), T.value = !1;
|
|
106
106
|
}
|
|
107
107
|
function N(e) {
|
|
108
108
|
e.key === "Enter" ? (e.preventDefault(), M()) : e.key === "Escape" && (T.value = !1);
|
|
109
109
|
}
|
|
110
|
-
return (
|
|
110
|
+
return (n, a) => (i(), p(y(R), {
|
|
111
111
|
as: "span",
|
|
112
|
-
class: e(
|
|
113
|
-
style:
|
|
112
|
+
class: e(v.value ? "tpl-logic-merge-tag-node tpl:group tpl:mx-0.5 tpl:inline-flex tpl:items-center tpl:gap-1 tpl:rounded tpl:px-1.5 tpl:py-0.5 tpl:text-[0.8em] tpl:font-bold tpl:tracking-wide tpl:uppercase tpl:select-none" : ""),
|
|
113
|
+
style: h(v.value ? "background-color: transparent; border: 1.5px solid color-mix(in srgb, var(--tpl-primary) 50%, transparent); color: var(--tpl-primary);" : ""),
|
|
114
114
|
contenteditable: "false"
|
|
115
115
|
}, {
|
|
116
|
-
default:
|
|
116
|
+
default: o(() => [T.value ? s((i(), x("input", {
|
|
117
117
|
key: 0,
|
|
118
118
|
ref_key: "inputRef",
|
|
119
119
|
ref: k,
|
|
120
|
-
"onUpdate:modelValue":
|
|
120
|
+
"onUpdate:modelValue": a[0] ||= (e) => O.value = e,
|
|
121
121
|
type: "text",
|
|
122
122
|
class: "tpl:w-40 tpl:rounded tpl:border-none tpl:bg-transparent tpl:px-0.5 tpl:py-0 tpl:text-[1em] tpl:font-medium tpl:normal-case tpl:outline-none tpl:text-[var(--tpl-primary)]",
|
|
123
123
|
onBlur: M,
|
|
124
124
|
onKeydown: N
|
|
125
|
-
}, null, 544)), [[
|
|
125
|
+
}, null, 544)), [[l, O.value]]) : v.value ? (i(), x("span", {
|
|
126
126
|
key: 1,
|
|
127
127
|
role: "button",
|
|
128
128
|
tabindex: "0",
|
|
129
|
-
"aria-label":
|
|
129
|
+
"aria-label": y(f).mergeTag.editValue,
|
|
130
130
|
class: "tpl-tooltip tpl:cursor-pointer",
|
|
131
|
-
"data-tooltip":
|
|
132
|
-
onClick:
|
|
133
|
-
onKeydown: [
|
|
134
|
-
}, r(w.value), 41, z)) : (
|
|
131
|
+
"data-tooltip": t.node.attrs.value,
|
|
132
|
+
onClick: u(j, ["stop"]),
|
|
133
|
+
onKeydown: [b(u(j, ["stop"]), ["enter"]), b(u(j, ["prevent", "stop"]), ["space"])]
|
|
134
|
+
}, r(w.value), 41, z)) : (i(), x("span", {
|
|
135
135
|
key: 2,
|
|
136
136
|
role: "button",
|
|
137
137
|
tabindex: "0",
|
|
138
|
-
"aria-label":
|
|
139
|
-
onClick:
|
|
140
|
-
onKeydown: [
|
|
141
|
-
}, r(
|
|
138
|
+
"aria-label": y(f).mergeTag.editValue,
|
|
139
|
+
onClick: u(j, ["stop"]),
|
|
140
|
+
onKeydown: [b(u(j, ["stop"]), ["enter"]), b(u(j, ["prevent", "stop"]), ["space"])]
|
|
141
|
+
}, r(t.node.attrs.value), 41, B)), v.value ? (i(), x("button", {
|
|
142
142
|
key: 3,
|
|
143
143
|
type: "button",
|
|
144
|
-
"aria-label":
|
|
144
|
+
"aria-label": y(f).mergeTag.deleteMergeTag,
|
|
145
145
|
class: "tpl-merge-tag-delete tpl:flex tpl:size-5 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-full tpl:border-none tpl:bg-transparent tpl:p-0 tpl:opacity-60 tpl:transition-all hover:tpl:opacity-100 tpl:text-[var(--tpl-primary)]",
|
|
146
146
|
contenteditable: "false",
|
|
147
|
-
onClick:
|
|
148
|
-
}, [...
|
|
147
|
+
onClick: a[1] ||= u((...e) => t.deleteNode && t.deleteNode(...e), ["stop", "prevent"])
|
|
148
|
+
}, [...a[2] ||= [m("svg", {
|
|
149
149
|
width: "10",
|
|
150
150
|
height: "10",
|
|
151
151
|
viewBox: "0 0 24 24",
|
|
@@ -153,17 +153,17 @@ var te = M.create({
|
|
|
153
153
|
stroke: "currentColor",
|
|
154
154
|
"stroke-width": "3",
|
|
155
155
|
"aria-hidden": "true"
|
|
156
|
-
}, [
|
|
156
|
+
}, [m("line", {
|
|
157
157
|
x1: "18",
|
|
158
158
|
y1: "6",
|
|
159
159
|
x2: "6",
|
|
160
160
|
y2: "18"
|
|
161
|
-
}),
|
|
161
|
+
}), m("line", {
|
|
162
162
|
x1: "6",
|
|
163
163
|
y1: "6",
|
|
164
164
|
x2: "18",
|
|
165
165
|
y2: "18"
|
|
166
|
-
})], -1)]], 8, V)) :
|
|
166
|
+
})], -1)]], 8, V)) : c("", !0)]),
|
|
167
167
|
_: 1
|
|
168
168
|
}, 8, ["class", "style"]));
|
|
169
169
|
}
|
|
@@ -207,12 +207,12 @@ var G = F.create({
|
|
|
207
207
|
return [{ tag: "span[data-logic-merge-tag]" }];
|
|
208
208
|
},
|
|
209
209
|
renderHTML({ node: e, HTMLAttributes: t }) {
|
|
210
|
-
if (!
|
|
210
|
+
if (!S(e.attrs.value, this.options.syntax)) return [
|
|
211
211
|
"span",
|
|
212
212
|
{},
|
|
213
213
|
e.attrs.value
|
|
214
214
|
];
|
|
215
|
-
let n =
|
|
215
|
+
let n = C(e.attrs.value, this.options.syntax);
|
|
216
216
|
return [
|
|
217
217
|
"span",
|
|
218
218
|
k(t, {
|
|
@@ -236,8 +236,8 @@ var G = F.create({
|
|
|
236
236
|
find: RegExp(this.options.syntax.logic.source + "$", ""),
|
|
237
237
|
handler: ({ state: e, range: t, match: n }) => {
|
|
238
238
|
let r = n[0];
|
|
239
|
-
if (!
|
|
240
|
-
let i =
|
|
239
|
+
if (!S(r, this.options.syntax)) return;
|
|
240
|
+
let i = C(r, this.options.syntax), a = this.type.create({
|
|
241
241
|
value: r,
|
|
242
242
|
keyword: i
|
|
243
243
|
});
|
|
@@ -250,8 +250,8 @@ var G = F.create({
|
|
|
250
250
|
find: new RegExp(this.options.syntax.logic.source, "g"),
|
|
251
251
|
handler: ({ state: e, range: t, match: n }) => {
|
|
252
252
|
let r = n[0];
|
|
253
|
-
if (!
|
|
254
|
-
let i =
|
|
253
|
+
if (!S(r, this.options.syntax)) return;
|
|
254
|
+
let i = C(r, this.options.syntax), a = this.type.create({
|
|
255
255
|
value: r,
|
|
256
256
|
keyword: i
|
|
257
257
|
});
|
|
@@ -263,7 +263,7 @@ var G = F.create({
|
|
|
263
263
|
"aria-label",
|
|
264
264
|
"data-tooltip",
|
|
265
265
|
"onKeydown"
|
|
266
|
-
], q = ["aria-label"], J = /* @__PURE__ */
|
|
266
|
+
], q = ["aria-label"], J = /* @__PURE__ */ t({
|
|
267
267
|
__name: "MergeTagNodeView",
|
|
268
268
|
props: {
|
|
269
269
|
node: {},
|
|
@@ -271,53 +271,53 @@ var G = F.create({
|
|
|
271
271
|
updateAttributes: { type: Function }
|
|
272
272
|
},
|
|
273
273
|
setup(e) {
|
|
274
|
-
let
|
|
274
|
+
let t = e, { getMergeTagLabel: n } = D(), { t: a } = E(), c = _(() => n(t.node.attrs.value)), f = d(!1), h = d(""), v = d(null);
|
|
275
275
|
function S() {
|
|
276
|
-
|
|
277
|
-
|
|
276
|
+
h.value = t.node.attrs.value, f.value = !0, g(() => {
|
|
277
|
+
v.value?.focus(), v.value?.select();
|
|
278
278
|
});
|
|
279
279
|
}
|
|
280
280
|
function C() {
|
|
281
|
-
let e =
|
|
282
|
-
e && e !==
|
|
281
|
+
let e = h.value.trim();
|
|
282
|
+
e && e !== t.node.attrs.value && t.updateAttributes({
|
|
283
283
|
value: e,
|
|
284
|
-
label:
|
|
284
|
+
label: n(e)
|
|
285
285
|
}), f.value = !1;
|
|
286
286
|
}
|
|
287
287
|
function w(e) {
|
|
288
288
|
e.key === "Enter" ? (e.preventDefault(), C()) : e.key === "Escape" && (f.value = !1);
|
|
289
289
|
}
|
|
290
|
-
return (
|
|
290
|
+
return (t, n) => (i(), p(y(R), {
|
|
291
291
|
as: "span",
|
|
292
292
|
class: "tpl-merge-tag-node tpl:group tpl:mx-0.5 tpl:inline-flex tpl:items-center tpl:gap-1 tpl:rounded tpl:px-1.5 tpl:py-0.5 tpl:text-[0.9em] tpl:font-medium tpl:select-none tpl:text-[var(--tpl-primary)]",
|
|
293
293
|
style: { "background-color": "color-mix(in srgb, var(--tpl-primary) 20%, transparent)" },
|
|
294
294
|
contenteditable: "false"
|
|
295
295
|
}, {
|
|
296
|
-
default:
|
|
296
|
+
default: o(() => [f.value ? s((i(), x("input", {
|
|
297
297
|
key: 0,
|
|
298
298
|
ref_key: "inputRef",
|
|
299
|
-
ref:
|
|
300
|
-
"onUpdate:modelValue":
|
|
299
|
+
ref: v,
|
|
300
|
+
"onUpdate:modelValue": n[0] ||= (e) => h.value = e,
|
|
301
301
|
type: "text",
|
|
302
302
|
class: "tpl:w-32 tpl:rounded tpl:border-none tpl:bg-transparent tpl:px-0.5 tpl:py-0 tpl:text-[1em] tpl:font-medium tpl:outline-none tpl:text-[var(--tpl-primary)]",
|
|
303
303
|
onBlur: C,
|
|
304
304
|
onKeydown: w
|
|
305
|
-
}, null, 544)), [[
|
|
305
|
+
}, null, 544)), [[l, h.value]]) : (i(), x("span", {
|
|
306
306
|
key: 1,
|
|
307
307
|
role: "button",
|
|
308
308
|
tabindex: "0",
|
|
309
|
-
"aria-label":
|
|
309
|
+
"aria-label": y(a).mergeTag.editValue,
|
|
310
310
|
class: "tpl-tooltip tpl:cursor-pointer",
|
|
311
311
|
"data-tooltip": e.node.attrs.value,
|
|
312
|
-
onClick:
|
|
313
|
-
onKeydown: [
|
|
314
|
-
}, r(
|
|
312
|
+
onClick: u(S, ["stop"]),
|
|
313
|
+
onKeydown: [b(u(S, ["stop"]), ["enter"]), b(u(S, ["prevent", "stop"]), ["space"])]
|
|
314
|
+
}, r(c.value), 41, K)), m("button", {
|
|
315
315
|
type: "button",
|
|
316
|
-
"aria-label":
|
|
316
|
+
"aria-label": y(a).mergeTag.deleteMergeTag,
|
|
317
317
|
class: "tpl-merge-tag-delete tpl:flex tpl:size-5 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-full tpl:border-none tpl:bg-transparent tpl:p-0 tpl:opacity-60 tpl:transition-all hover:tpl:opacity-100 tpl:text-[var(--tpl-primary)]",
|
|
318
318
|
contenteditable: "false",
|
|
319
|
-
onClick:
|
|
320
|
-
}, [...
|
|
319
|
+
onClick: n[1] ||= u((...t) => e.deleteNode && e.deleteNode(...t), ["stop", "prevent"])
|
|
320
|
+
}, [...n[2] ||= [m("svg", {
|
|
321
321
|
width: "10",
|
|
322
322
|
height: "10",
|
|
323
323
|
viewBox: "0 0 24 24",
|
|
@@ -325,12 +325,12 @@ var G = F.create({
|
|
|
325
325
|
stroke: "currentColor",
|
|
326
326
|
"stroke-width": "3",
|
|
327
327
|
"aria-hidden": "true"
|
|
328
|
-
}, [
|
|
328
|
+
}, [m("line", {
|
|
329
329
|
x1: "18",
|
|
330
330
|
y1: "6",
|
|
331
331
|
x2: "6",
|
|
332
332
|
y2: "18"
|
|
333
|
-
}),
|
|
333
|
+
}), m("line", {
|
|
334
334
|
x1: "6",
|
|
335
335
|
y1: "6",
|
|
336
336
|
x2: "18",
|
|
@@ -626,7 +626,7 @@ var ce = se, le = ["id"], ue = {
|
|
|
626
626
|
"data-merge-tag-value",
|
|
627
627
|
"onMousedown",
|
|
628
628
|
"onMousemove"
|
|
629
|
-
], X = { class: "tpl:font-medium" }, fe = { class: "tpl:text-[var(--tpl-text-dim)] tpl:font-mono" }, pe = /* @__PURE__ */
|
|
629
|
+
], X = { class: "tpl:font-medium" }, fe = { class: "tpl:text-[var(--tpl-text-dim)] tpl:font-mono" }, pe = /* @__PURE__ */ t({
|
|
630
630
|
__name: "MergeTagSuggestionList",
|
|
631
631
|
props: {
|
|
632
632
|
items: {},
|
|
@@ -636,27 +636,27 @@ var ce = se, le = ["id"], ue = {
|
|
|
636
636
|
},
|
|
637
637
|
emits: ["select", "hover"],
|
|
638
638
|
setup(t) {
|
|
639
|
-
let
|
|
640
|
-
function
|
|
641
|
-
return
|
|
639
|
+
let a = t;
|
|
640
|
+
function o(e) {
|
|
641
|
+
return a.listId ? `${a.listId}-opt-${e}` : void 0;
|
|
642
642
|
}
|
|
643
|
-
return (
|
|
643
|
+
return (a, s) => (i(), x("div", {
|
|
644
644
|
id: t.listId,
|
|
645
645
|
class: "tpl:min-w-[200px] tpl:max-w-[320px] tpl:max-h-[50vh] tpl:overflow-y-auto tpl:rounded-[var(--tpl-radius)] tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-elevated)] tpl:py-1 tpl:shadow-lg",
|
|
646
646
|
role: "listbox",
|
|
647
647
|
"data-testid": "merge-tag-suggestion-list"
|
|
648
|
-
}, [t.items.length === 0 ? (
|
|
649
|
-
key:
|
|
650
|
-
id:
|
|
648
|
+
}, [t.items.length === 0 ? (i(), x("div", ue, r(t.emptyText), 1)) : c("", !0), (i(!0), x(f, null, n(t.items, (n, s) => (i(), x("button", {
|
|
649
|
+
key: n.value,
|
|
650
|
+
id: o(s),
|
|
651
651
|
type: "button",
|
|
652
652
|
role: "option",
|
|
653
653
|
"aria-selected": s === t.selectedIndex,
|
|
654
654
|
"data-selected": s === t.selectedIndex ? "true" : "false",
|
|
655
|
-
"data-merge-tag-value":
|
|
655
|
+
"data-merge-tag-value": n.value,
|
|
656
656
|
class: e(["tpl:flex tpl:w-full tpl:flex-col tpl:items-start tpl:gap-0.5 tpl:px-3 tpl:py-1.5 tpl:text-left tpl:text-xs tpl:transition-colors", s === t.selectedIndex ? "tpl:bg-[var(--tpl-primary-light)] tpl:text-[var(--tpl-primary)]" : "tpl:text-[var(--tpl-text)] hover:tpl:bg-[var(--tpl-bg-hover)]"]),
|
|
657
|
-
onMousedown:
|
|
658
|
-
onMousemove: (e) => s !== t.selectedIndex &&
|
|
659
|
-
}, [
|
|
657
|
+
onMousedown: u((e) => a.$emit("select", n), ["prevent", "stop"]),
|
|
658
|
+
onMousemove: (e) => s !== t.selectedIndex && a.$emit("hover", s)
|
|
659
|
+
}, [m("span", X, r(n.label), 1), m("span", fe, r(n.value), 1)], 42, de))), 128))], 8, le));
|
|
660
660
|
}
|
|
661
661
|
}), Z = 10, me = 0;
|
|
662
662
|
function Q(e, t) {
|
|
@@ -695,14 +695,14 @@ var he = M.create({
|
|
|
695
695
|
}).run();
|
|
696
696
|
},
|
|
697
697
|
render: () => {
|
|
698
|
-
let e = null, n = null, r = null, i =
|
|
699
|
-
function d() {
|
|
700
|
-
g(l?.() ?? null);
|
|
701
|
-
}
|
|
698
|
+
let e = null, n = null, r = null, i = d([]), o = d(0), s = null, c = `tpl-merge-tag-suggestion-${++me}`, l = null, u = [];
|
|
702
699
|
function f() {
|
|
703
|
-
|
|
700
|
+
_(l?.() ?? null);
|
|
701
|
+
}
|
|
702
|
+
function p() {
|
|
703
|
+
f(), requestAnimationFrame(f);
|
|
704
704
|
}
|
|
705
|
-
function
|
|
705
|
+
function m(e) {
|
|
706
706
|
let t = [], n = e?.parentElement ?? null;
|
|
707
707
|
for (; n && n !== document.body && n !== document.documentElement;) {
|
|
708
708
|
let e = window.getComputedStyle(n), r = e.overflow + e.overflowX + e.overflowY;
|
|
@@ -710,19 +710,19 @@ var he = M.create({
|
|
|
710
710
|
}
|
|
711
711
|
return t;
|
|
712
712
|
}
|
|
713
|
-
function
|
|
714
|
-
u = [window, ...
|
|
715
|
-
for (let e of u) e.addEventListener("scroll",
|
|
713
|
+
function h(e) {
|
|
714
|
+
u = [window, ...m(e)];
|
|
715
|
+
for (let e of u) e.addEventListener("scroll", f, {
|
|
716
716
|
passive: !0,
|
|
717
717
|
capture: !0
|
|
718
718
|
});
|
|
719
|
-
window.addEventListener("resize",
|
|
719
|
+
window.addEventListener("resize", f, { passive: !0 });
|
|
720
720
|
}
|
|
721
|
-
function
|
|
722
|
-
for (let e of u) e.removeEventListener("scroll",
|
|
723
|
-
window.removeEventListener("resize",
|
|
721
|
+
function g() {
|
|
722
|
+
for (let e of u) e.removeEventListener("scroll", f, { capture: !0 });
|
|
723
|
+
window.removeEventListener("resize", f), u = [];
|
|
724
724
|
}
|
|
725
|
-
function
|
|
725
|
+
function _(e) {
|
|
726
726
|
if (!n || !e || e.bottom < 0 || e.top > window.innerHeight) return;
|
|
727
727
|
n.style.position = "fixed", n.style.left = `${e.left}px`, n.style.zIndex = "9999", n.style.top = `${e.bottom}px`;
|
|
728
728
|
let t = n.offsetHeight;
|
|
@@ -731,7 +731,7 @@ var he = M.create({
|
|
|
731
731
|
n.style.top = `${r}px`;
|
|
732
732
|
}
|
|
733
733
|
}
|
|
734
|
-
function
|
|
734
|
+
function y(e, t) {
|
|
735
735
|
let n = t?.closest("[data-tpl-theme]");
|
|
736
736
|
if (!n) return;
|
|
737
737
|
let r = n.getAttribute("data-tpl-theme");
|
|
@@ -743,48 +743,48 @@ var he = M.create({
|
|
|
743
743
|
}
|
|
744
744
|
e.style.fontFamily = i.fontFamily, e.style.fontSize = i.fontSize, e.style.lineHeight = i.lineHeight;
|
|
745
745
|
}
|
|
746
|
-
function
|
|
746
|
+
function b(e) {
|
|
747
747
|
r && (e ? (r.setAttribute("role", "combobox"), r.setAttribute("aria-haspopup", "listbox"), r.setAttribute("aria-expanded", "true"), r.setAttribute("aria-controls", c)) : (r.removeAttribute("aria-expanded"), r.removeAttribute("aria-controls"), r.removeAttribute("aria-activedescendant"), r.removeAttribute("aria-haspopup"), r.removeAttribute("role")));
|
|
748
748
|
}
|
|
749
|
-
function
|
|
749
|
+
function x() {
|
|
750
750
|
if (r) {
|
|
751
751
|
if (i.value.length === 0) {
|
|
752
752
|
r.removeAttribute("aria-activedescendant");
|
|
753
753
|
return;
|
|
754
754
|
}
|
|
755
|
-
r.setAttribute("aria-activedescendant", `${c}-opt-${
|
|
755
|
+
r.setAttribute("aria-activedescendant", `${c}-opt-${o.value}`);
|
|
756
756
|
}
|
|
757
757
|
}
|
|
758
758
|
function S(e) {
|
|
759
|
-
|
|
759
|
+
s?.(e);
|
|
760
760
|
}
|
|
761
761
|
return {
|
|
762
|
-
onStart: (
|
|
763
|
-
i.value =
|
|
764
|
-
let
|
|
765
|
-
r =
|
|
766
|
-
return
|
|
762
|
+
onStart: (u) => {
|
|
763
|
+
i.value = u.items, o.value = 0, s = (e) => u.command(e), n = document.createElement("div"), n.setAttribute("data-testid", "merge-tag-suggestion-popup");
|
|
764
|
+
let d = u.editor.view?.dom;
|
|
765
|
+
r = d ?? null, y(n, d ?? null), document.body.appendChild(n), e = v({ render() {
|
|
766
|
+
return a(pe, {
|
|
767
767
|
items: i.value,
|
|
768
|
-
selectedIndex:
|
|
768
|
+
selectedIndex: o.value,
|
|
769
769
|
emptyText: t,
|
|
770
770
|
listId: c,
|
|
771
771
|
onSelect: (e) => S(e),
|
|
772
772
|
onHover: (e) => {
|
|
773
|
-
|
|
773
|
+
o.value = e, x();
|
|
774
774
|
}
|
|
775
775
|
});
|
|
776
|
-
} }), e.mount(n),
|
|
776
|
+
} }), e.mount(n), b(!0), x(), l = u.clientRect ?? null, p(), h(d ?? null);
|
|
777
777
|
},
|
|
778
778
|
onUpdate: (e) => {
|
|
779
|
-
i.value = e.items,
|
|
779
|
+
i.value = e.items, o.value >= e.items.length && (o.value = 0), s = (t) => e.command(t), x(), l = e.clientRect ?? null, p();
|
|
780
780
|
},
|
|
781
781
|
onKeyDown: (e) => {
|
|
782
782
|
if (e.event.key === "Escape") return !0;
|
|
783
|
-
let t = $(e.event, i.value,
|
|
784
|
-
return t &&
|
|
783
|
+
let t = $(e.event, i.value, o, S);
|
|
784
|
+
return t && x(), t;
|
|
785
785
|
},
|
|
786
786
|
onExit: () => {
|
|
787
|
-
|
|
787
|
+
g(), b(!1), e?.unmount(), n?.remove(), e = null, n = null, r = null, s = null, l = null;
|
|
788
788
|
}
|
|
789
789
|
};
|
|
790
790
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -43,6 +43,8 @@ export { CustomBlockDefinition }
|
|
|
43
43
|
|
|
44
44
|
export { CustomFont }
|
|
45
45
|
|
|
46
|
+
export declare const DEFAULT_EDITOR_TOUR_STORAGE_KEY = "templatical-editor-tour-dismissed";
|
|
47
|
+
|
|
46
48
|
export { DisplayConditionsConfig }
|
|
47
49
|
|
|
48
50
|
export declare interface EditorCapabilities {
|
|
@@ -63,6 +65,48 @@ export declare interface EditorCapabilities {
|
|
|
63
65
|
};
|
|
64
66
|
}
|
|
65
67
|
|
|
68
|
+
export declare interface EditorTourConfig {
|
|
69
|
+
/**
|
|
70
|
+
* Steps to show in order. Omit to use built-in defaults (canvas, block rail, right sidebar).
|
|
71
|
+
*/
|
|
72
|
+
steps?: EditorTourStep[];
|
|
73
|
+
/** Start automatically after mount when the tour has not been dismissed. Default `false`. */
|
|
74
|
+
autoStart?: boolean;
|
|
75
|
+
/**
|
|
76
|
+
* `localStorage` key for dismissal persistence.
|
|
77
|
+
* Set to `false` to disable persistence (tour can restart every load).
|
|
78
|
+
* Default key is `DEFAULT_EDITOR_TOUR_STORAGE_KEY` when omitted.
|
|
79
|
+
*/
|
|
80
|
+
storageKey?: string | false;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export declare interface EditorTourStartOptions {
|
|
84
|
+
/** Zero-based index into the active (filtered) step list */
|
|
85
|
+
stepIndex?: number;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export declare interface EditorTourStep {
|
|
89
|
+
/** Any valid `document.querySelector` selector (editor internals or host DOM). */
|
|
90
|
+
target: string;
|
|
91
|
+
title: string;
|
|
92
|
+
text: string;
|
|
93
|
+
placement?: EditorTourStepPlacement;
|
|
94
|
+
/**
|
|
95
|
+
* When the target is absent, skip this step. Default `true`.
|
|
96
|
+
* Set `false` to keep the step even if the node is missing (rect will be null — avoided).
|
|
97
|
+
*/
|
|
98
|
+
skipIfMissing?: boolean;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Guided tour types for Templatical Editor `init()` / `initCloud()`.
|
|
103
|
+
*/
|
|
104
|
+
/** Reserved tooltip placement hints for layout inside the viewport. */
|
|
105
|
+
export declare type EditorTourStepPlacement = "canvas" | "sidebar" | "rightSidebar" | "below";
|
|
106
|
+
|
|
107
|
+
/** Email vs popup builder chrome (sidebar layout). */
|
|
108
|
+
export declare type EditorType = "email" | "popup";
|
|
109
|
+
|
|
66
110
|
export declare interface FontOption {
|
|
67
111
|
value: string;
|
|
68
112
|
label: string;
|
|
@@ -123,6 +167,14 @@ export declare interface TemplaticalCloudEditorConfig {
|
|
|
123
167
|
* Cloud white-label plans hide the footer regardless of this setting.
|
|
124
168
|
*/
|
|
125
169
|
branding?: boolean;
|
|
170
|
+
/**
|
|
171
|
+
* Multi-step canvas for popup-style flows. See {@link TemplaticalEditorConfig.multiPageCanvas}.
|
|
172
|
+
*/
|
|
173
|
+
multiPageCanvas?: boolean;
|
|
174
|
+
/**
|
|
175
|
+
* Same semantics as {@link TemplaticalEditorConfig.editorType} (popup adds icon rail).
|
|
176
|
+
*/
|
|
177
|
+
editorType?: EditorType | string;
|
|
126
178
|
ai?: AiConfig | false;
|
|
127
179
|
commenting?: boolean;
|
|
128
180
|
collaboration?: CollaborationConfig;
|
|
@@ -146,25 +198,27 @@ export declare interface TemplaticalCloudEditorConfig {
|
|
|
146
198
|
onRequestMedia?: (context: MediaRequestContext_2) => Promise<MediaItem | null>;
|
|
147
199
|
onBeforeTestEmail?: (html: string) => string | Promise<string>;
|
|
148
200
|
/**
|
|
149
|
-
* Accessibility linter (`@
|
|
201
|
+
* Accessibility linter (`@aswin.dev/quality`) configuration. Cloud
|
|
150
202
|
* additionally merges `planConfig.accessibility` from the server (server
|
|
151
203
|
* policy wins on conflict) — this option sets the consumer-supplied baseline.
|
|
152
204
|
*/
|
|
153
205
|
accessibility?: A11yOptions_2;
|
|
206
|
+
/** Optional guided tour (same shape as the OSS editor `tour` option). */
|
|
207
|
+
tour?: EditorTourConfig;
|
|
154
208
|
}
|
|
155
209
|
|
|
156
210
|
export declare interface TemplaticalEditor extends TemplaticalEditorBase {
|
|
157
211
|
/**
|
|
158
212
|
* Render the current template to an MJML string. Resolves custom blocks
|
|
159
213
|
* via the editor's internal block registry. Throws if the optional
|
|
160
|
-
* `@
|
|
214
|
+
* `@aswin.dev/renderer` package is not installed.
|
|
161
215
|
*/
|
|
162
216
|
toMjml(): Promise<string>;
|
|
163
217
|
/**
|
|
164
218
|
* Render a single custom block to its HTML representation, using the
|
|
165
219
|
* registered custom block definition's template and the block's current
|
|
166
220
|
* field values. Exposed for headless callers that want to reuse the
|
|
167
|
-
* editor's renderer (e.g., to drive `@
|
|
221
|
+
* editor's renderer (e.g., to drive `@aswin.dev/renderer`'s
|
|
168
222
|
* `renderCustomBlock` option from outside the editor instance).
|
|
169
223
|
*/
|
|
170
224
|
renderCustomBlock(block: CustomBlock): Promise<string>;
|
|
@@ -175,6 +229,23 @@ declare interface TemplaticalEditorBase {
|
|
|
175
229
|
setContent(content: TemplateContent): void;
|
|
176
230
|
setTheme(theme: UiTheme): void;
|
|
177
231
|
unmount(): void;
|
|
232
|
+
/** Requires `tour` in editor config; otherwise no-ops. */
|
|
233
|
+
startTour(options?: EditorTourStartOptions): void;
|
|
234
|
+
dismissTour(): void;
|
|
235
|
+
resetTourDismissed(): void;
|
|
236
|
+
/** `true` when no tour is configured or the user dismissed a persisted tour. */
|
|
237
|
+
isTourDismissed(): boolean;
|
|
238
|
+
/**
|
|
239
|
+
* Undo the last canvas/template change (same stack as toolbar and Cmd/Ctrl+Z).
|
|
240
|
+
* Rich text fields use TipTap’s own undo while focused.
|
|
241
|
+
*/
|
|
242
|
+
undo(): void;
|
|
243
|
+
/** Redo (same stack as toolbar and Cmd/Ctrl+Shift+Z). */
|
|
244
|
+
redo(): void;
|
|
245
|
+
/** Whether a canvas/template undo is available. */
|
|
246
|
+
canUndo(): boolean;
|
|
247
|
+
/** Whether redo is available. */
|
|
248
|
+
canRedo(): boolean;
|
|
178
249
|
}
|
|
179
250
|
|
|
180
251
|
export declare interface TemplaticalEditorConfig {
|
|
@@ -199,14 +270,31 @@ export declare interface TemplaticalEditorConfig {
|
|
|
199
270
|
*/
|
|
200
271
|
branding?: boolean;
|
|
201
272
|
/**
|
|
202
|
-
*
|
|
273
|
+
* Multi-step canvas (popup flows): step strip above the canvas; content exposes
|
|
274
|
+
* {@link TemplateContent.canvasPages} and {@link TemplateContent.activeCanvasPageId}.
|
|
275
|
+
*/
|
|
276
|
+
multiPageCanvas?: boolean;
|
|
277
|
+
/**
|
|
278
|
+
* `'email'` (default): single hover-expand block rail. `'popup'`: adds a left icon rail
|
|
279
|
+
* (Design, Blocks, Tab, …) beside the same block palette when Blocks is selected.
|
|
280
|
+
* The value is provided through `EDITOR_TYPE_KEY`. Case-insensitive strings such as
|
|
281
|
+
* `'POPUP'` are accepted.
|
|
282
|
+
*/
|
|
283
|
+
editorType?: EditorType | string;
|
|
284
|
+
/**
|
|
285
|
+
* Accessibility linter (`@aswin.dev/quality`) configuration.
|
|
203
286
|
*
|
|
204
287
|
* - When unset, the linter loads on demand once the user opens the panel.
|
|
205
288
|
* - When `disabled: true`, the optional peer is never imported (saves the
|
|
206
289
|
* chunk download) and the sidebar tab + inline badges are suppressed.
|
|
207
|
-
* - `rules`/`thresholds` follow the shape exported by `@
|
|
290
|
+
* - `rules`/`thresholds` follow the shape exported by `@aswin.dev/quality`.
|
|
208
291
|
*/
|
|
209
292
|
accessibility?: A11yOptions;
|
|
293
|
+
/**
|
|
294
|
+
* Optional spotlight tour (inside or outside the editor DOM via selectors).
|
|
295
|
+
* Use `startTour` / `isTourDismissed` on the instance; default copy lives under locale `tour.defaults`.
|
|
296
|
+
*/
|
|
297
|
+
tour?: EditorTourConfig;
|
|
210
298
|
}
|
|
211
299
|
|
|
212
300
|
export { ThemeOverrides }
|
|
@@ -238,9 +326,9 @@ export { }
|
|
|
238
326
|
|
|
239
327
|
declare module "@tiptap/core" {
|
|
240
328
|
interface Commands<ReturnType> {
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
329
|
+
fontSize: {
|
|
330
|
+
setFontSize: (size: string) => ReturnType;
|
|
331
|
+
unsetFontSize: () => ReturnType;
|
|
244
332
|
};
|
|
245
333
|
}
|
|
246
334
|
}
|
|
@@ -248,9 +336,9 @@ declare module "@tiptap/core" {
|
|
|
248
336
|
|
|
249
337
|
declare module "@tiptap/core" {
|
|
250
338
|
interface Commands<ReturnType> {
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
339
|
+
letterSpacing: {
|
|
340
|
+
setLetterSpacing: (spacing: string) => ReturnType;
|
|
341
|
+
unsetLetterSpacing: () => ReturnType;
|
|
254
342
|
};
|
|
255
343
|
}
|
|
256
344
|
}
|
|
@@ -267,9 +355,9 @@ declare module "@tiptap/core" {
|
|
|
267
355
|
|
|
268
356
|
declare module "@tiptap/core" {
|
|
269
357
|
interface Commands<ReturnType> {
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
358
|
+
lineHeight: {
|
|
359
|
+
setLineHeight: (lineHeight: string) => ReturnType;
|
|
360
|
+
unsetLineHeight: () => ReturnType;
|
|
273
361
|
};
|
|
274
362
|
}
|
|
275
363
|
}
|