@templatical/editor 0.54.2 → 0.55.0
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/{AiAltTextPopover-BBKVJ6HA.js → AiAltTextPopover-D5QosKvB.js} +1 -1
- package/dist/{AiAltTextReview-BuVbeQh-.js → AiAltTextReview-D1W_lrI_.js} +1 -1
- package/dist/{AiRewriteMenu-ZpYJfm-O.js → AiRewriteMenu-BwztoMov.js} +4 -4
- package/dist/{BlockPreviewCanvas-DtOo5y3U.js → BlockPreviewCanvas-C23A6FRm.js} +4 -4
- package/dist/{CloudPanels-DQRWMc59.js → CloudPanels-Baoaj6Xf.js} +1 -1
- package/dist/{CountdownToolbar-DTpMEDyh.js → CountdownToolbar-CA_gDIdZ.js} +4 -4
- package/dist/{IssuesPanel-BZn7-p9e.js → IssuesPanel-nmFhWG1p.js} +1 -1
- package/dist/{LanguageMenu-OOmQWVzO.js → LanguageMenu-DcABUYop.js} +3 -3
- package/dist/{LogicTagInsertButton-XESwnJia.js → LogicTagInsertButton-qZ82VMFx.js} +284 -279
- package/dist/{MergeTagInput-CAsBRoSm.js → MergeTagInput-JJeZbFkD.js} +1 -1
- package/dist/{MergeTagModeToggle-bOf27Hg1.js → MergeTagModeToggle-DDucd1eC.js} +1 -1
- package/dist/{MergeTagTextarea-DH_6JFui.js → MergeTagTextarea-dQ2LRrNB.js} +2 -2
- package/dist/{ParagraphEditor-XGUkV5Uw.js → ParagraphEditor-VXYwGoz_.js} +8 -8
- package/dist/{RestoreVersionDialog-C72kWccI.js → RestoreVersionDialog-BibNvAaJ.js} +1 -1
- package/dist/{RichTextEditorContent-BZN8KRvR.js → RichTextEditorContent-CU5EOlM_.js} +2 -2
- package/dist/{SaveBlockDialog-CKOnTMTU.js → SaveBlockDialog-S9aFi0cy.js} +4 -4
- package/dist/{SavedBlocksBrowserModal-BrlNxqDH.js → SavedBlocksBrowserModal-DIdn6B0J.js} +4 -4
- package/dist/{SavedBlocksPanels--lPR6gdh.js → SavedBlocksPanels-Cme2M6u8.js} +1 -1
- package/dist/{SavedBlocksPickBar-4ON4_KKl.js → SavedBlocksPickBar-BDmA7r3m.js} +1 -1
- package/dist/{TemplateSettings-BE0jZmRJ.js → TemplateSettings-C_LHLm5M.js} +4 -4
- package/dist/{TestEmailModal-BKmNGrZN.js → TestEmailModal-CLIRn7eL.js} +5 -5
- package/dist/{TestEmailPanel-DT1wllX3.js → TestEmailPanel-frdtjC8h.js} +1 -1
- package/dist/{TitleEditor-HjVZuUTB.js → TitleEditor-D5kC56Jl.js} +4 -4
- package/dist/{Toolbar-BppchV2k.js → Toolbar-D904Yw_R.js} +551 -503
- package/dist/{TplModal-BFWOoK8l.js → TplModal-BBdotDf1.js} +1 -1
- package/dist/{VersionHistoryPanels-D4yNVLvq.js → VersionHistoryPanels-DhagEgOk.js} +1 -1
- package/dist/{WrapperBlock-BUzQTZuu.js → WrapperBlock-BAT3T0Cz.js} +3 -3
- package/dist/{blockTypeIcons-D91v9k0x.js → blockTypeIcons-CoRQV_hP.js} +1 -1
- package/dist/bundle-stats.json +6 -6
- package/dist/{cdn/chunks/ca-DOuIxWRv.js → ca-DIkMxYCN.js} +10 -3
- package/dist/cdn/chunks/{AiAltTextPopover-CAI18sdv.js → AiAltTextPopover-CUGOPuRo.js} +2 -2
- package/dist/cdn/chunks/{AiAltTextPopover-CAI18sdv.js.map → AiAltTextPopover-CUGOPuRo.js.map} +1 -1
- package/dist/cdn/chunks/{AiAltTextReview-CWEyMOF-.js → AiAltTextReview-B9vm_L-8.js} +2 -2
- package/dist/cdn/chunks/{AiAltTextReview-CWEyMOF-.js.map → AiAltTextReview-B9vm_L-8.js.map} +1 -1
- package/dist/cdn/chunks/{AiRewriteMenu-BEepu1vo.js → AiRewriteMenu-BvV_7tNZ.js} +7 -7
- package/dist/cdn/chunks/{AiRewriteMenu-BEepu1vo.js.map → AiRewriteMenu-BvV_7tNZ.js.map} +1 -1
- package/dist/cdn/chunks/{BlockPreviewCanvas-B6ndvof2.js → BlockPreviewCanvas-Dr-xGq6v.js} +7 -7
- package/dist/cdn/chunks/{BlockPreviewCanvas-B6ndvof2.js.map → BlockPreviewCanvas-Dr-xGq6v.js.map} +1 -1
- package/dist/cdn/chunks/{CloudPanels-BGwDb0jB.js → CloudPanels-CQ0vNgsH.js} +2 -2
- package/dist/cdn/chunks/{CloudPanels-BGwDb0jB.js.map → CloudPanels-CQ0vNgsH.js.map} +1 -1
- package/dist/cdn/chunks/{CountdownToolbar-B-0FsTj-.js → CountdownToolbar-BxW-J7DX.js} +5 -5
- package/dist/cdn/chunks/{CountdownToolbar-B-0FsTj-.js.map → CountdownToolbar-BxW-J7DX.js.map} +1 -1
- package/dist/cdn/chunks/{IssuesPanel-LyjMBDok.js → IssuesPanel-BoHeIjvw.js} +3 -3
- package/dist/cdn/chunks/{IssuesPanel-LyjMBDok.js.map → IssuesPanel-BoHeIjvw.js.map} +1 -1
- package/dist/cdn/chunks/{LanguageMenu-CGwMCOQ5.js → LanguageMenu-BnYN5N1h.js} +7 -7
- package/dist/cdn/chunks/{LanguageMenu-CGwMCOQ5.js.map → LanguageMenu-BnYN5N1h.js.map} +1 -1
- package/dist/cdn/chunks/{LogicTagInsertButton-PDKuo2J3.js → LogicTagInsertButton-Bt2PXbQ0.js} +255 -250
- package/dist/cdn/chunks/LogicTagInsertButton-Bt2PXbQ0.js.map +1 -0
- package/dist/cdn/chunks/{MergeTagInput-DoQHBJk2.js → MergeTagInput-BELdMRni.js} +2 -2
- package/dist/cdn/chunks/{MergeTagInput-DoQHBJk2.js.map → MergeTagInput-BELdMRni.js.map} +1 -1
- package/dist/cdn/chunks/{MergeTagModeToggle-Ct5IG4VW.js → MergeTagModeToggle-DKfMDIEF.js} +2 -2
- package/dist/cdn/chunks/{MergeTagModeToggle-Ct5IG4VW.js.map → MergeTagModeToggle-DKfMDIEF.js.map} +1 -1
- package/dist/cdn/chunks/{MergeTagTextarea-BMsnjphR.js → MergeTagTextarea-w6xen3Xh.js} +5 -5
- package/dist/cdn/chunks/{MergeTagTextarea-BMsnjphR.js.map → MergeTagTextarea-w6xen3Xh.js.map} +1 -1
- package/dist/cdn/chunks/{ParagraphEditor-CVW-kuHW.js → ParagraphEditor-Cal9hY3U.js} +9 -9
- package/dist/cdn/chunks/{ParagraphEditor-CVW-kuHW.js.map → ParagraphEditor-Cal9hY3U.js.map} +1 -1
- package/dist/cdn/chunks/{RestoreVersionDialog-7MFZz-Sb.js → RestoreVersionDialog-f_ulmASY.js} +2 -2
- package/dist/cdn/chunks/{RestoreVersionDialog-7MFZz-Sb.js.map → RestoreVersionDialog-f_ulmASY.js.map} +1 -1
- package/dist/cdn/chunks/{RichTextEditorContent-CiL-SkZg.js → RichTextEditorContent-C_v0kS4A.js} +3 -3
- package/dist/cdn/chunks/{RichTextEditorContent-CiL-SkZg.js.map → RichTextEditorContent-C_v0kS4A.js.map} +1 -1
- package/dist/cdn/chunks/{SaveBlockDialog-CxdekCYy.js → SaveBlockDialog-C6N9RFls.js} +5 -5
- package/dist/cdn/chunks/{SaveBlockDialog-CxdekCYy.js.map → SaveBlockDialog-C6N9RFls.js.map} +1 -1
- package/dist/cdn/chunks/{SavedBlocksBrowserModal-D9CAa2U3.js → SavedBlocksBrowserModal-Bl2sl09D.js} +4 -4
- package/dist/cdn/chunks/{SavedBlocksBrowserModal-D9CAa2U3.js.map → SavedBlocksBrowserModal-Bl2sl09D.js.map} +1 -1
- package/dist/cdn/chunks/{SavedBlocksPanels-jfkYWtss.js → SavedBlocksPanels-DqVcmEUK.js} +2 -2
- package/dist/cdn/chunks/{SavedBlocksPanels-jfkYWtss.js.map → SavedBlocksPanels-DqVcmEUK.js.map} +1 -1
- package/dist/cdn/chunks/{SavedBlocksPickBar-yaCumC4j.js → SavedBlocksPickBar-DE-J1JVL.js} +2 -2
- package/dist/cdn/chunks/{SavedBlocksPickBar-yaCumC4j.js.map → SavedBlocksPickBar-DE-J1JVL.js.map} +1 -1
- package/dist/cdn/chunks/{TemplateSettings-SaV2UVh_.js → TemplateSettings-CpoKZ8oV.js} +5 -5
- package/dist/cdn/chunks/{TemplateSettings-SaV2UVh_.js.map → TemplateSettings-CpoKZ8oV.js.map} +1 -1
- package/dist/cdn/chunks/{TestEmailModal-ByfhP_sm.js → TestEmailModal-DI3z__Bd.js} +8 -8
- package/dist/cdn/chunks/{TestEmailModal-ByfhP_sm.js.map → TestEmailModal-DI3z__Bd.js.map} +1 -1
- package/dist/cdn/chunks/{TestEmailPanel-CfzpqpDs.js → TestEmailPanel-Cp5d2YGn.js} +2 -2
- package/dist/cdn/chunks/{TestEmailPanel-CfzpqpDs.js.map → TestEmailPanel-Cp5d2YGn.js.map} +1 -1
- package/dist/cdn/chunks/{TitleEditor-Ceb0YfWv.js → TitleEditor-C2syRLdZ.js} +4 -4
- package/dist/cdn/chunks/{TitleEditor-Ceb0YfWv.js.map → TitleEditor-C2syRLdZ.js.map} +1 -1
- package/dist/cdn/chunks/{Toolbar-Cv6Rv1S-.js → Toolbar-NEE8qxYh.js} +754 -706
- package/dist/cdn/chunks/Toolbar-NEE8qxYh.js.map +1 -0
- package/dist/cdn/chunks/{TplModal-DGpGdwgf.js → TplModal-B1MgvtX8.js} +2 -2
- package/dist/cdn/chunks/{TplModal-DGpGdwgf.js.map → TplModal-B1MgvtX8.js.map} +1 -1
- package/dist/cdn/chunks/{VersionHistoryPanels-BJnHCMAH.js → VersionHistoryPanels-Cefd8i_e.js} +2 -2
- package/dist/cdn/chunks/{VersionHistoryPanels-BJnHCMAH.js.map → VersionHistoryPanels-Cefd8i_e.js.map} +1 -1
- package/dist/cdn/chunks/{WrapperBlock-C_uE5rPJ.js → WrapperBlock-DFY-7YSs.js} +4 -4
- package/dist/cdn/chunks/{WrapperBlock-C_uE5rPJ.js.map → WrapperBlock-DFY-7YSs.js.map} +1 -1
- package/dist/{ca-DOuIxWRv.js → cdn/chunks/ca-DIkMxYCN.js} +12 -1
- package/dist/cdn/chunks/{ca-DOuIxWRv.js.map → ca-DIkMxYCN.js.map} +1 -1
- package/dist/cdn/chunks/{composables-BxikPuC1.js → composables-nyxwrM27.js} +610 -594
- package/dist/cdn/chunks/composables-nyxwrM27.js.map +1 -0
- package/dist/cdn/chunks/{createCloudRuntime-D2DUaudp.js → createCloudRuntime-DJkDGKQ_.js} +3 -3
- package/dist/cdn/chunks/{createCloudRuntime-D2DUaudp.js.map → createCloudRuntime-DJkDGKQ_.js.map} +1 -1
- package/dist/{de-DaOUfYBX.js → cdn/chunks/de-Cc6Ue0UD.js} +12 -1
- package/dist/cdn/chunks/de-Cc6Ue0UD.js.map +1 -0
- package/dist/cdn/chunks/{en-C0pHHMiR.js → en-BX4FujAQ.js} +11 -2
- package/dist/cdn/chunks/en-BX4FujAQ.js.map +1 -0
- package/dist/{es-CxyEKr6n.js → cdn/chunks/es-Do5b-MKU.js} +12 -1
- package/dist/cdn/chunks/es-Do5b-MKU.js.map +1 -0
- package/dist/cdn/chunks/{extensions-DuDWpKo7.js → extensions-BcwkOjVq.js} +76 -70
- package/dist/cdn/chunks/extensions-BcwkOjVq.js.map +1 -0
- package/dist/{fr-CYbamiI6.js → cdn/chunks/fr-S1n2Ebzp.js} +12 -1
- package/dist/cdn/chunks/fr-S1n2Ebzp.js.map +1 -0
- package/dist/cdn/chunks/{ja-DfaIAoGI.js → ja-DLwcq4bA.js} +11 -2
- package/dist/cdn/chunks/ja-DLwcq4bA.js.map +1 -0
- package/dist/{nl-DkrB-VKZ.js → cdn/chunks/nl-0JSWaZpT.js} +12 -1
- package/dist/cdn/chunks/nl-0JSWaZpT.js.map +1 -0
- package/dist/cdn/chunks/{normalizeMergeTagMarkup-Bn_hl4jd.js → normalizeMergeTagMarkup-BrGw5jxk.js} +99 -89
- package/dist/cdn/chunks/normalizeMergeTagMarkup-BrGw5jxk.js.map +1 -0
- package/dist/cdn/chunks/{preRenderCustomBlocks-C9oavydG.js → preRenderCustomBlocks-Cj0XYwuh.js} +4 -4
- package/dist/cdn/chunks/{preRenderCustomBlocks-C9oavydG.js.map → preRenderCustomBlocks-Cj0XYwuh.js.map} +1 -1
- package/dist/{pt-BR-CY5Ye7eP.js → cdn/chunks/pt-BR-D3VlIMDZ.js} +12 -1
- package/dist/cdn/chunks/pt-BR-D3VlIMDZ.js.map +1 -0
- package/dist/cdn/chunks/{sanitizeHtml-DfXoetOm.js → sanitizeHtml-GxJCxKcP.js} +3 -3
- package/dist/cdn/chunks/{sanitizeHtml-DfXoetOm.js.map → sanitizeHtml-GxJCxKcP.js.map} +1 -1
- package/dist/cdn/chunks/{socialIcons-DPwkrn5v.js → socialIcons-B5zrrV8-.js} +387 -386
- package/dist/cdn/chunks/{socialIcons-DPwkrn5v.js.map → socialIcons-B5zrrV8-.js.map} +1 -1
- package/dist/cdn/chunks/{src-712f3ofG.js → src-Diw9SLIe.js} +673 -554
- package/dist/cdn/chunks/src-Diw9SLIe.js.map +1 -0
- package/dist/cdn/chunks/{src-B2tQbzf6.js → src-UR3AQocX.js} +221 -215
- package/dist/cdn/chunks/src-UR3AQocX.js.map +1 -0
- package/dist/cdn/chunks/{src-ZFw5fg_z.js → src-v47QHNmB.js} +809 -659
- package/dist/cdn/chunks/src-v47QHNmB.js.map +1 -0
- package/dist/cdn/chunks/useLocalizedDisplay-DekV8qar.js +33 -0
- package/dist/cdn/chunks/{useLocalizedDisplay-DiNjT22M.js.map → useLocalizedDisplay-DekV8qar.js.map} +1 -1
- package/dist/cdn/chunks/{useLogicTag-SvMW4g00.js → useLogicTag-Cbp3I7UN.js} +2 -2
- package/dist/cdn/chunks/{useLogicTag-SvMW4g00.js.map → useLogicTag-Cbp3I7UN.js.map} +1 -1
- package/dist/cdn/chunks/{useMergeTag-JLz3Pqcw.js → useMergeTag-1lrpNyR5.js} +4 -4
- package/dist/cdn/chunks/{useMergeTag-JLz3Pqcw.js.map → useMergeTag-1lrpNyR5.js.map} +1 -1
- package/dist/cdn/chunks/{withCurrentFont-BcoPpkDS.js → withCurrentFont-DZfmiv8V.js} +2 -2
- package/dist/cdn/chunks/{withCurrentFont-BcoPpkDS.js.map → withCurrentFont-DZfmiv8V.js.map} +1 -1
- package/dist/cdn/editor.js +284 -284
- package/dist/cdn/editor.js.map +1 -1
- package/dist/{composables-BbPFRlBf.js → composables-DPgNn9GZ.js} +929 -913
- package/dist/{createCloudRuntime-Dlrg88gS.js → createCloudRuntime-Bw8TLmQ8.js} +2 -2
- package/dist/{cdn/chunks/de-DaOUfYBX.js → de-Cc6Ue0UD.js} +10 -3
- package/dist/{dist-C34cYI5S.js → dist-CBdk1Vcb.js} +963 -813
- package/dist/{en-C0pHHMiR.js → en-BX4FujAQ.js} +10 -1
- package/dist/{cdn/chunks/es-CxyEKr6n.js → es-Do5b-MKU.js} +10 -3
- package/dist/{extensions-xCiyqSg7.js → extensions-QFAARrjF.js} +338 -332
- package/dist/{cdn/chunks/fr-CYbamiI6.js → fr-S1n2Ebzp.js} +10 -3
- package/dist/index.d.ts +14 -1
- package/dist/{ja-DfaIAoGI.js → ja-DLwcq4bA.js} +10 -1
- package/dist/{cdn/chunks/nl-DkrB-VKZ.js → nl-0JSWaZpT.js} +10 -3
- package/dist/{normalizeMergeTagMarkup-C7FGNURu.js → normalizeMergeTagMarkup-BS0nRvhq.js} +89 -79
- package/dist/{preRenderCustomBlocks-DvbRa3L3.js → preRenderCustomBlocks-CiKvKd8V.js} +1 -1
- package/dist/{cdn/chunks/pt-BR-CY5Ye7eP.js → pt-BR-D3VlIMDZ.js} +10 -3
- package/dist/{sanitizeHtml-D_ab7dD6.js → sanitizeHtml-USjTyALR.js} +1 -1
- package/dist/{socialIcons-DhAolBjt.js → socialIcons-NvIg5ahU.js} +338 -337
- package/dist/templatical-editor.js +41 -41
- package/dist/{useLocalizedDisplay-C9MBFUr4.js → useLocalizedDisplay-LdjosX4w.js} +1 -1
- package/dist/{useLogicTag-BmuakZBd.js → useLogicTag-D8zgkXfb.js} +1 -1
- package/dist/{useMergeTag-DC4a8b_v.js → useMergeTag-k7Kr0nMd.js} +1 -1
- package/dist/{withCurrentFont-BSxJai99.js → withCurrentFont-Bzeg_gfH.js} +1 -1
- package/package.json +7 -7
- package/dist/cdn/chunks/LogicTagInsertButton-PDKuo2J3.js.map +0 -1
- package/dist/cdn/chunks/Toolbar-Cv6Rv1S-.js.map +0 -1
- package/dist/cdn/chunks/composables-BxikPuC1.js.map +0 -1
- package/dist/cdn/chunks/de-DaOUfYBX.js.map +0 -1
- package/dist/cdn/chunks/en-C0pHHMiR.js.map +0 -1
- package/dist/cdn/chunks/es-CxyEKr6n.js.map +0 -1
- package/dist/cdn/chunks/extensions-DuDWpKo7.js.map +0 -1
- package/dist/cdn/chunks/fr-CYbamiI6.js.map +0 -1
- package/dist/cdn/chunks/ja-DfaIAoGI.js.map +0 -1
- package/dist/cdn/chunks/nl-DkrB-VKZ.js.map +0 -1
- package/dist/cdn/chunks/normalizeMergeTagMarkup-Bn_hl4jd.js.map +0 -1
- package/dist/cdn/chunks/pt-BR-CY5Ye7eP.js.map +0 -1
- package/dist/cdn/chunks/src-712f3ofG.js.map +0 -1
- package/dist/cdn/chunks/src-B2tQbzf6.js.map +0 -1
- package/dist/cdn/chunks/src-ZFw5fg_z.js.map +0 -1
- package/dist/cdn/chunks/useLocalizedDisplay-DiNjT22M.js +0 -33
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { n as e } from "./rolldown-runtime-QGRDbDUS.js";
|
|
2
|
-
import { $ as t,
|
|
3
|
-
import { t as
|
|
2
|
+
import { $t as t, At as n, Bt as r, Ct as i, Dt as a, Gt as o, Ot as s, R as c, Rt as l, St as u, Tt as d, Xt as f, Zt as ee, _n as p, bt as m, d as te, et as ne, gt as re, ht as h, kt as ie, ln as ae, mn as g, nt as oe, ot as se, s as ce, st as _, xt as v, yt as le } from "./src-v47QHNmB.js";
|
|
3
|
+
import { t as y } from "./htmlparser-hu3YnNQU.js";
|
|
4
4
|
// ../quality/src/types.ts
|
|
5
|
-
var
|
|
5
|
+
var ue = { minTextLength: 200 }, de = { maxHtmlBytes: 92160 }, fe = {
|
|
6
6
|
altMaxLength: 125,
|
|
7
7
|
minFontSize: 14,
|
|
8
8
|
allCapsMinLength: 20,
|
|
9
9
|
minTouchTargetPx: 44
|
|
10
|
-
},
|
|
10
|
+
}, pe = [
|
|
11
11
|
"localhost",
|
|
12
12
|
"127.0.0.1",
|
|
13
13
|
"0.0.0.0",
|
|
14
14
|
"*.local",
|
|
15
15
|
"*.staging.*",
|
|
16
16
|
"*.dev.*"
|
|
17
|
-
],
|
|
17
|
+
], me = [
|
|
18
18
|
"bit.ly",
|
|
19
19
|
"buff.ly",
|
|
20
20
|
"cutt.ly",
|
|
@@ -34,82 +34,82 @@ var se = { minTextLength: 200 }, ce = { maxHtmlBytes: 92160 }, le = {
|
|
|
34
34
|
"v.gd"
|
|
35
35
|
];
|
|
36
36
|
// ../quality/src/contrast.ts
|
|
37
|
-
function
|
|
38
|
-
let n =
|
|
37
|
+
function he(e, t) {
|
|
38
|
+
let n = b(e), r = b(t);
|
|
39
39
|
if (!n || !r) return NaN;
|
|
40
|
-
let i =
|
|
40
|
+
let i = ye(n), a = ye(r), o = Math.max(i, a), s = Math.min(i, a);
|
|
41
41
|
return (o + .05) / (s + .05);
|
|
42
42
|
}
|
|
43
|
-
var
|
|
44
|
-
function
|
|
43
|
+
var ge = /^#?([0-9a-f])([0-9a-f])([0-9a-f])$/i, _e = /^#?([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i, ve = /^#?([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i;
|
|
44
|
+
function b(e) {
|
|
45
45
|
if (typeof e != "string") return null;
|
|
46
|
-
let t = e.trim(), n =
|
|
46
|
+
let t = e.trim(), n = ve.exec(t);
|
|
47
47
|
if (n) return n[4].toLowerCase() === "ff" ? {
|
|
48
48
|
r: parseInt(n[1], 16),
|
|
49
49
|
g: parseInt(n[2], 16),
|
|
50
50
|
b: parseInt(n[3], 16)
|
|
51
51
|
} : null;
|
|
52
|
-
let r =
|
|
52
|
+
let r = _e.exec(t);
|
|
53
53
|
if (r) return {
|
|
54
54
|
r: parseInt(r[1], 16),
|
|
55
55
|
g: parseInt(r[2], 16),
|
|
56
56
|
b: parseInt(r[3], 16)
|
|
57
57
|
};
|
|
58
|
-
let i =
|
|
58
|
+
let i = ge.exec(t);
|
|
59
59
|
return i ? {
|
|
60
60
|
r: parseInt(i[1] + i[1], 16),
|
|
61
61
|
g: parseInt(i[2] + i[2], 16),
|
|
62
62
|
b: parseInt(i[3] + i[3], 16)
|
|
63
63
|
} : null;
|
|
64
64
|
}
|
|
65
|
-
function
|
|
66
|
-
return
|
|
65
|
+
function x(e) {
|
|
66
|
+
return b(e ?? "") !== null;
|
|
67
67
|
}
|
|
68
|
-
function
|
|
69
|
-
let r =
|
|
68
|
+
function ye({ r: e, g: t, b: n }) {
|
|
69
|
+
let r = S(e / 255), i = S(t / 255), a = S(n / 255);
|
|
70
70
|
return .2126 * r + .7152 * i + .0722 * a;
|
|
71
71
|
}
|
|
72
|
-
function
|
|
72
|
+
function S(e) {
|
|
73
73
|
return e <= .03928 ? e / 12.92 : ((e + .055) / 1.055) ** 2.4;
|
|
74
74
|
}
|
|
75
75
|
// ../quality/src/walk.ts
|
|
76
|
-
var
|
|
77
|
-
function
|
|
78
|
-
let
|
|
79
|
-
let
|
|
80
|
-
if (t(e,
|
|
81
|
-
...
|
|
82
|
-
resolvedBackgroundColor:
|
|
83
|
-
}),
|
|
76
|
+
var be = "#ffffff", xe = "#1a1a1a";
|
|
77
|
+
function C(e, t) {
|
|
78
|
+
let r = x(e.settings.backgroundColor) ? e.settings.backgroundColor.toLowerCase() : be, a = x(e.settings.textColor) ? e.settings.textColor.toLowerCase() : xe, o = (e, r) => {
|
|
79
|
+
let a = e.styles?.backgroundColor, s = x(a) ? a.toLowerCase() : r.resolvedBackgroundColor;
|
|
80
|
+
if (t(e, s === r.resolvedBackgroundColor ? r : {
|
|
81
|
+
...r,
|
|
82
|
+
resolvedBackgroundColor: s
|
|
83
|
+
}), n(e)) for (let t of e.children) o(t, {
|
|
84
84
|
parent: e,
|
|
85
|
-
section:
|
|
85
|
+
section: r.section,
|
|
86
86
|
columnIndex: null,
|
|
87
|
-
depth:
|
|
88
|
-
resolvedBackgroundColor:
|
|
89
|
-
resolvedTextColor:
|
|
87
|
+
depth: r.depth + 1,
|
|
88
|
+
resolvedBackgroundColor: s,
|
|
89
|
+
resolvedTextColor: r.resolvedTextColor
|
|
90
90
|
});
|
|
91
|
-
else
|
|
92
|
-
t.forEach((t) =>
|
|
91
|
+
else i(e) && e.children.forEach((t, n) => {
|
|
92
|
+
t.forEach((t) => o(t, {
|
|
93
93
|
parent: e,
|
|
94
94
|
section: e,
|
|
95
|
-
columnIndex:
|
|
96
|
-
depth:
|
|
97
|
-
resolvedBackgroundColor:
|
|
98
|
-
resolvedTextColor:
|
|
95
|
+
columnIndex: n,
|
|
96
|
+
depth: r.depth + 1,
|
|
97
|
+
resolvedBackgroundColor: s,
|
|
98
|
+
resolvedTextColor: r.resolvedTextColor
|
|
99
99
|
}));
|
|
100
100
|
});
|
|
101
101
|
};
|
|
102
|
-
for (let t of e.blocks)
|
|
102
|
+
for (let t of e.blocks) o(t, {
|
|
103
103
|
parent: null,
|
|
104
104
|
section: null,
|
|
105
105
|
columnIndex: null,
|
|
106
106
|
depth: 0,
|
|
107
|
-
resolvedBackgroundColor:
|
|
108
|
-
resolvedTextColor:
|
|
107
|
+
resolvedBackgroundColor: r,
|
|
108
|
+
resolvedTextColor: a
|
|
109
109
|
});
|
|
110
110
|
}
|
|
111
111
|
// ../quality/src/run-rules.ts
|
|
112
|
-
function
|
|
112
|
+
function w(e, t, n, r) {
|
|
113
113
|
let i = [];
|
|
114
114
|
function a(e, i, a) {
|
|
115
115
|
let o = a.messageVariant ? `${e}.${a.messageVariant}` : e, s = r(n.locale, o, a.params);
|
|
@@ -124,7 +124,7 @@ function E(e, t, n, r) {
|
|
|
124
124
|
fix: a.fix
|
|
125
125
|
};
|
|
126
126
|
}
|
|
127
|
-
|
|
127
|
+
C(e, (e, r) => {
|
|
128
128
|
for (let o of t) {
|
|
129
129
|
let t = n.severity(o.meta.id);
|
|
130
130
|
if (t === "off" || !o.block) continue;
|
|
@@ -140,14 +140,14 @@ function E(e, t, n, r) {
|
|
|
140
140
|
}
|
|
141
141
|
return i;
|
|
142
142
|
}
|
|
143
|
-
function
|
|
143
|
+
function T(e) {
|
|
144
144
|
let t = e.overrides ?? {}, n = {
|
|
145
|
-
...
|
|
145
|
+
...fe,
|
|
146
146
|
...e.thresholds ?? {}
|
|
147
|
-
}, r = { nonProductionHosts: e.nonProductionHosts ??
|
|
148
|
-
minTextLength: e.deliverabilityThresholds?.minTextLength ??
|
|
149
|
-
shortenerHosts: e.shortenerHosts ??
|
|
150
|
-
}, a = { maxHtmlBytes: e.compatibilityThresholds?.maxHtmlBytes ??
|
|
147
|
+
}, r = { nonProductionHosts: e.nonProductionHosts ?? pe }, i = {
|
|
148
|
+
minTextLength: e.deliverabilityThresholds?.minTextLength ?? ue.minTextLength,
|
|
149
|
+
shortenerHosts: e.shortenerHosts ?? me
|
|
150
|
+
}, a = { maxHtmlBytes: e.compatibilityThresholds?.maxHtmlBytes ?? de.maxHtmlBytes }, o = e.locale ?? "en", s = e.rules;
|
|
151
151
|
return {
|
|
152
152
|
locale: o,
|
|
153
153
|
rules: t,
|
|
@@ -161,8 +161,8 @@ function D(e) {
|
|
|
161
161
|
}
|
|
162
162
|
};
|
|
163
163
|
}
|
|
164
|
-
function
|
|
165
|
-
return
|
|
164
|
+
function Se(e, t, n) {
|
|
165
|
+
return T({
|
|
166
166
|
locale: e,
|
|
167
167
|
rules: n,
|
|
168
168
|
overrides: t.rules,
|
|
@@ -172,8 +172,8 @@ function ye(e, t, n) {
|
|
|
172
172
|
shortenerHosts: t.shortenerHosts
|
|
173
173
|
});
|
|
174
174
|
}
|
|
175
|
-
function
|
|
176
|
-
return
|
|
175
|
+
function Ce(e, t, n) {
|
|
176
|
+
return T({
|
|
177
177
|
locale: e,
|
|
178
178
|
rules: n,
|
|
179
179
|
overrides: t.rules,
|
|
@@ -182,8 +182,8 @@ function be(e, t, n) {
|
|
|
182
182
|
compatibilityThresholds: t.thresholds
|
|
183
183
|
});
|
|
184
184
|
}
|
|
185
|
-
function
|
|
186
|
-
return
|
|
185
|
+
function we(e, t, n) {
|
|
186
|
+
return T({
|
|
187
187
|
locale: e,
|
|
188
188
|
rules: n,
|
|
189
189
|
overrides: t.rules,
|
|
@@ -191,8 +191,8 @@ function xe(e, t, n) {
|
|
|
191
191
|
nonProductionHosts: void 0
|
|
192
192
|
});
|
|
193
193
|
}
|
|
194
|
-
function
|
|
195
|
-
return
|
|
194
|
+
function Te(e, t, n) {
|
|
195
|
+
return T({
|
|
196
196
|
locale: e,
|
|
197
197
|
rules: n,
|
|
198
198
|
overrides: t.rules,
|
|
@@ -200,8 +200,8 @@ function Se(e, t, n) {
|
|
|
200
200
|
nonProductionHosts: void 0
|
|
201
201
|
});
|
|
202
202
|
}
|
|
203
|
-
function
|
|
204
|
-
return
|
|
203
|
+
function Ee(e, t, n) {
|
|
204
|
+
return T({
|
|
205
205
|
locale: e,
|
|
206
206
|
rules: n,
|
|
207
207
|
overrides: t.rules,
|
|
@@ -210,7 +210,7 @@ function Ce(e, t, n) {
|
|
|
210
210
|
});
|
|
211
211
|
}
|
|
212
212
|
// ../quality/src/accessibility/messages/de.ts
|
|
213
|
-
var
|
|
213
|
+
var De = /* @__PURE__ */ e({ default: () => Oe }), Oe = {
|
|
214
214
|
"a11y.img-missing-alt": {
|
|
215
215
|
message: "Bild ohne Alt-Text.",
|
|
216
216
|
suggestion: "Füge eine kurze Beschreibung hinzu oder markiere das Bild als dekorativ."
|
|
@@ -295,7 +295,7 @@ var we = /* @__PURE__ */ e({ default: () => Te }), Te = {
|
|
|
295
295
|
message: "Kein Preheader-Text gesetzt, daher zeigen Postfächer Bruchstücke des ersten Blocks.",
|
|
296
296
|
suggestion: "Ergänze einen Preheader-Text als Vorschau auf die E-Mail."
|
|
297
297
|
}
|
|
298
|
-
},
|
|
298
|
+
}, ke = /* @__PURE__ */ e({ default: () => E }), E = {
|
|
299
299
|
"a11y.img-missing-alt": {
|
|
300
300
|
message: "Image is missing alt text.",
|
|
301
301
|
suggestion: "Add a short description, or mark the image as decorative."
|
|
@@ -382,7 +382,7 @@ var we = /* @__PURE__ */ e({ default: () => Te }), Te = {
|
|
|
382
382
|
}
|
|
383
383
|
};
|
|
384
384
|
// ../quality/src/format-message.ts
|
|
385
|
-
function
|
|
385
|
+
function D(e, t) {
|
|
386
386
|
if (!t) return e;
|
|
387
387
|
let n = (e) => e.replace(/\{(\w+)\}/g, (e, n) => {
|
|
388
388
|
let r = t[n];
|
|
@@ -394,59 +394,59 @@ function k(e, t) {
|
|
|
394
394
|
};
|
|
395
395
|
}
|
|
396
396
|
// ../quality/src/accessibility/messages/index.ts
|
|
397
|
-
var
|
|
398
|
-
"./de.ts":
|
|
399
|
-
"./en.ts":
|
|
400
|
-
}),
|
|
401
|
-
for (let e in
|
|
397
|
+
var Ae = /* #__PURE__ */ Object.assign({
|
|
398
|
+
"./de.ts": De,
|
|
399
|
+
"./en.ts": ke
|
|
400
|
+
}), O = {};
|
|
401
|
+
for (let e in Ae) {
|
|
402
402
|
let t = /\.\/([^/]+)\.ts$/.exec(e);
|
|
403
403
|
if (!t) continue;
|
|
404
404
|
let n = t[1];
|
|
405
|
-
n !== "index" && (
|
|
405
|
+
n !== "index" && (O[n] = Ae[e].default);
|
|
406
406
|
}
|
|
407
|
-
function
|
|
408
|
-
return
|
|
407
|
+
function je(e) {
|
|
408
|
+
return O[e.split("-")[0]?.toLowerCase() ?? "en"] ?? O.en ?? E;
|
|
409
409
|
}
|
|
410
|
-
function
|
|
411
|
-
return
|
|
410
|
+
function Me(e, t, n) {
|
|
411
|
+
return D(je(e)[t] ?? E[t], n);
|
|
412
412
|
}
|
|
413
|
-
var
|
|
413
|
+
var Ne = {
|
|
414
414
|
meta: {
|
|
415
415
|
id: "a11y.img-missing-alt",
|
|
416
416
|
reference: "https://www.w3.org/WAI/tutorials/images/",
|
|
417
417
|
severity: "error"
|
|
418
418
|
},
|
|
419
419
|
block(e) {
|
|
420
|
-
return !
|
|
420
|
+
return !m(e) || e.decorative === !0 || (e.alt?.trim() ?? "") !== "" || (e.src ?? "").trim() === "" ? null : { blockId: e.id };
|
|
421
421
|
}
|
|
422
|
-
},
|
|
422
|
+
}, Pe = {
|
|
423
423
|
id: "a11y.img-alt-is-filename",
|
|
424
424
|
reference: "https://docs.templatical.com/quality/accessibility/rule-catalog#images",
|
|
425
425
|
severity: "warning"
|
|
426
|
-
},
|
|
426
|
+
}, Fe = [
|
|
427
427
|
/\.(jpe?g|png|gif|webp|svg)$/i,
|
|
428
428
|
/^IMG[_-]?\d+/i,
|
|
429
429
|
/^Untitled/i,
|
|
430
430
|
/^Screen[\s_-]?Shot/i,
|
|
431
431
|
/^DSC[_-]?\d+/i
|
|
432
|
-
],
|
|
433
|
-
meta:
|
|
432
|
+
], Ie = {
|
|
433
|
+
meta: Pe,
|
|
434
434
|
block(e) {
|
|
435
|
-
if (!
|
|
435
|
+
if (!m(e) || e.decorative === !0) return null;
|
|
436
436
|
let t = e.alt?.trim() ?? "";
|
|
437
|
-
return t === "" || !
|
|
437
|
+
return t === "" || !Fe.some((e) => e.test(t)) ? null : {
|
|
438
438
|
blockId: e.id,
|
|
439
439
|
params: { alt: t }
|
|
440
440
|
};
|
|
441
441
|
}
|
|
442
|
-
},
|
|
442
|
+
}, Le = {
|
|
443
443
|
meta: {
|
|
444
444
|
id: "a11y.img-alt-too-long",
|
|
445
445
|
reference: "https://docs.templatical.com/quality/accessibility/rule-catalog#images",
|
|
446
446
|
severity: "warning"
|
|
447
447
|
},
|
|
448
448
|
block(e, t, n) {
|
|
449
|
-
if (!
|
|
449
|
+
if (!m(e) || e.decorative === !0) return null;
|
|
450
450
|
let r = e.alt ?? "";
|
|
451
451
|
return r.length <= n.thresholds.altMaxLength ? null : {
|
|
452
452
|
blockId: e.id,
|
|
@@ -456,14 +456,14 @@ var Ae = {
|
|
|
456
456
|
}
|
|
457
457
|
};
|
|
458
458
|
}
|
|
459
|
-
},
|
|
459
|
+
}, Re = {
|
|
460
460
|
meta: {
|
|
461
461
|
id: "a11y.img-decorative-needs-empty-alt",
|
|
462
462
|
reference: "https://docs.templatical.com/quality/accessibility/rule-catalog#images",
|
|
463
463
|
severity: "info"
|
|
464
464
|
},
|
|
465
465
|
block(e) {
|
|
466
|
-
return !
|
|
466
|
+
return !m(e) || e.decorative !== !0 || (e.alt ?? "").trim() === "" ? null : {
|
|
467
467
|
blockId: e.id,
|
|
468
468
|
fix: {
|
|
469
469
|
description: "Clear alt text",
|
|
@@ -471,7 +471,7 @@ var Ae = {
|
|
|
471
471
|
}
|
|
472
472
|
};
|
|
473
473
|
}
|
|
474
|
-
},
|
|
474
|
+
}, ze = /* @__PURE__ */ e({ default: () => Be }), Be = {
|
|
475
475
|
vagueLinkText: [
|
|
476
476
|
"hier klicken",
|
|
477
477
|
"hier",
|
|
@@ -514,7 +514,7 @@ var Ae = {
|
|
|
514
514
|
"anschauen",
|
|
515
515
|
"jetzt"
|
|
516
516
|
]
|
|
517
|
-
},
|
|
517
|
+
}, Ve = /* @__PURE__ */ e({ default: () => He }), He = {
|
|
518
518
|
vagueLinkText: [
|
|
519
519
|
"click here",
|
|
520
520
|
"here",
|
|
@@ -555,51 +555,51 @@ var Ae = {
|
|
|
555
555
|
"redeem",
|
|
556
556
|
"watch"
|
|
557
557
|
]
|
|
558
|
-
},
|
|
559
|
-
"./de.ts":
|
|
560
|
-
"./en.ts":
|
|
561
|
-
}),
|
|
562
|
-
for (let e in
|
|
558
|
+
}, Ue = /* #__PURE__ */ Object.assign({
|
|
559
|
+
"./de.ts": ze,
|
|
560
|
+
"./en.ts": Ve
|
|
561
|
+
}), We = {};
|
|
562
|
+
for (let e in Ue) {
|
|
563
563
|
let t = /\.\/([^/]+)\.ts$/.exec(e);
|
|
564
564
|
if (!t) continue;
|
|
565
565
|
let n = t[1];
|
|
566
|
-
n !== "index" && (
|
|
566
|
+
n !== "index" && (We[n] = Ue[e].default);
|
|
567
567
|
}
|
|
568
|
-
function
|
|
569
|
-
return
|
|
568
|
+
function k(e) {
|
|
569
|
+
return Ge;
|
|
570
570
|
}
|
|
571
|
-
function
|
|
571
|
+
function A(e) {
|
|
572
572
|
let t = /* @__PURE__ */ new Set();
|
|
573
|
-
for (let n of Object.values(
|
|
573
|
+
for (let n of Object.values(We)) for (let r of e(n)) t.add(r);
|
|
574
574
|
return Array.from(t);
|
|
575
575
|
}
|
|
576
|
-
var
|
|
577
|
-
vagueLinkText:
|
|
578
|
-
vagueButtonLabels:
|
|
579
|
-
linkedImageActionHints:
|
|
576
|
+
var Ge = {
|
|
577
|
+
vagueLinkText: A((e) => e.vagueLinkText),
|
|
578
|
+
vagueButtonLabels: A((e) => e.vagueButtonLabels),
|
|
579
|
+
linkedImageActionHints: A((e) => e.linkedImageActionHints)
|
|
580
580
|
};
|
|
581
|
-
function
|
|
581
|
+
function Ke(e) {
|
|
582
582
|
return e.toLowerCase().replace(/\s+/g, " ").replace(/^[^\p{L}\p{N}]+|[^\p{L}\p{N}]+$/gu, "").trim();
|
|
583
583
|
}
|
|
584
|
-
var
|
|
584
|
+
var qe = {
|
|
585
585
|
meta: {
|
|
586
586
|
id: "a11y.img-linked-no-context",
|
|
587
587
|
reference: "https://docs.templatical.com/quality/accessibility/rule-catalog#images",
|
|
588
588
|
severity: "warning"
|
|
589
589
|
},
|
|
590
590
|
block(e, t, n) {
|
|
591
|
-
if (!
|
|
591
|
+
if (!m(e) || e.decorative === !0 || !e.linkUrl || e.linkUrl.trim() === "") return null;
|
|
592
592
|
let r = (e.alt ?? "").trim();
|
|
593
593
|
if (r === "") return null;
|
|
594
|
-
let i = r.toLocaleLowerCase().split(/[^\p{L}\p{N}]+/u).filter(Boolean), a =
|
|
594
|
+
let i = r.toLocaleLowerCase().split(/[^\p{L}\p{N}]+/u).filter(Boolean), a = k(n.locale).linkedImageActionHints;
|
|
595
595
|
return i.some((e) => a.includes(e)) ? null : { blockId: e.id };
|
|
596
596
|
}
|
|
597
597
|
};
|
|
598
598
|
// ../quality/src/html-utils.ts
|
|
599
|
-
function
|
|
599
|
+
function j(e) {
|
|
600
600
|
let t = [], n = null, r = "", i = () => {
|
|
601
601
|
n !== null && (n.text = r.trim(), t.push(n), n = null, r = "");
|
|
602
|
-
}, a = new
|
|
602
|
+
}, a = new y({
|
|
603
603
|
onopentag(e, t) {
|
|
604
604
|
e === "a" ? (i(), n = {
|
|
605
605
|
href: t.href ?? "",
|
|
@@ -618,8 +618,8 @@ function N(e) {
|
|
|
618
618
|
});
|
|
619
619
|
return a.write(e), a.end(), i(), t;
|
|
620
620
|
}
|
|
621
|
-
function
|
|
622
|
-
let t =
|
|
621
|
+
function Je(e) {
|
|
622
|
+
let t = Ye(e).matchAll(/<\/?a\b[^<>]*>/gi), n = 0;
|
|
623
623
|
for (let e of t) if (e[0].startsWith("</")) n > 0 && n--;
|
|
624
624
|
else {
|
|
625
625
|
if (n > 0) return !0;
|
|
@@ -627,7 +627,7 @@ function Ge(e) {
|
|
|
627
627
|
}
|
|
628
628
|
return !1;
|
|
629
629
|
}
|
|
630
|
-
function
|
|
630
|
+
function Ye(e) {
|
|
631
631
|
let t = "", n = 0;
|
|
632
632
|
for (; n < e.length;) {
|
|
633
633
|
let r = e.indexOf("<!--", n);
|
|
@@ -642,35 +642,125 @@ function Ke(e) {
|
|
|
642
642
|
}
|
|
643
643
|
return t;
|
|
644
644
|
}
|
|
645
|
-
function
|
|
646
|
-
let t = "", n = new
|
|
645
|
+
function M(e) {
|
|
646
|
+
let t = "", n = new y({ ontext(e) {
|
|
647
647
|
t += e;
|
|
648
648
|
} });
|
|
649
649
|
return n.write(e), n.end(), t.trim();
|
|
650
650
|
}
|
|
651
|
-
|
|
651
|
+
function N(e) {
|
|
652
|
+
return e === " " || e === " " || e === "\n" || e === "\r" || e === "\f";
|
|
653
|
+
}
|
|
654
|
+
function Xe(e) {
|
|
655
|
+
return e !== " " && e !== " " && e !== "\n" && e !== "\r" && e !== "\f" && e !== "=" && e !== ">" && e !== "/";
|
|
656
|
+
}
|
|
657
|
+
function Ze(e) {
|
|
658
|
+
return e >= "A" && e <= "Z" || e >= "a" && e <= "z";
|
|
659
|
+
}
|
|
660
|
+
function Qe(e) {
|
|
661
|
+
return Ze(e) || e >= "0" && e <= "9" || e === ":" || e === "-" || e === "_";
|
|
662
|
+
}
|
|
663
|
+
function P(e, t) {
|
|
664
|
+
return `${e}="${t.replace(/"/g, """)}"`;
|
|
665
|
+
}
|
|
666
|
+
function F(e) {
|
|
667
|
+
let t = 0;
|
|
668
|
+
for (; t < e.length && Xe(e[t]);) t++;
|
|
669
|
+
for (; t < e.length && N(e[t]);) t++;
|
|
670
|
+
if (t >= e.length || e[t] !== "=") return null;
|
|
671
|
+
for (t++; t < e.length && N(e[t]);) t++;
|
|
672
|
+
if (t >= e.length) return null;
|
|
673
|
+
let n = e[t];
|
|
674
|
+
if (n === "\"" || n === "'") {
|
|
675
|
+
let r = e.indexOf(n, t + 1);
|
|
676
|
+
return r === -1 ? null : e.slice(t + 1, r);
|
|
677
|
+
}
|
|
678
|
+
return e.slice(t);
|
|
679
|
+
}
|
|
680
|
+
function I(e, t) {
|
|
681
|
+
let n = t.toLowerCase(), r = [], i = 0;
|
|
682
|
+
for (; i < e.length;) {
|
|
683
|
+
for (; i < e.length && (N(e[i]) || e[i] === "/");) i++;
|
|
684
|
+
if (i >= e.length) break;
|
|
685
|
+
let t = i;
|
|
686
|
+
for (; i < e.length && Xe(e[i]);) i++;
|
|
687
|
+
let a = e.slice(t, i);
|
|
688
|
+
if (a === "") {
|
|
689
|
+
i++;
|
|
690
|
+
continue;
|
|
691
|
+
}
|
|
692
|
+
let o = i;
|
|
693
|
+
for (; i < e.length && N(e[i]);) i++;
|
|
694
|
+
if (i >= e.length || e[i] !== "=") {
|
|
695
|
+
a.toLowerCase() === n && r.push({
|
|
696
|
+
start: t,
|
|
697
|
+
end: o
|
|
698
|
+
});
|
|
699
|
+
continue;
|
|
700
|
+
}
|
|
701
|
+
for (i++; i < e.length && N(e[i]);) i++;
|
|
702
|
+
let s = e[i];
|
|
703
|
+
if (s === "\"" || s === "'") {
|
|
704
|
+
let o = e.indexOf(s, i + 1);
|
|
705
|
+
if (o === -1) return null;
|
|
706
|
+
let c = o + 1;
|
|
707
|
+
a.toLowerCase() === n && r.push({
|
|
708
|
+
start: t,
|
|
709
|
+
end: c
|
|
710
|
+
}), i = c;
|
|
711
|
+
} else {
|
|
712
|
+
for (; i < e.length && !N(e[i]) && e[i] !== ">";) i++;
|
|
713
|
+
a.toLowerCase() === n && r.push({
|
|
714
|
+
start: t,
|
|
715
|
+
end: i
|
|
716
|
+
});
|
|
717
|
+
}
|
|
718
|
+
}
|
|
719
|
+
return r;
|
|
720
|
+
}
|
|
721
|
+
function $e(e, t) {
|
|
722
|
+
let n = t.start > 0 && N(e[t.start - 1]) ? t.start - 1 : t.start;
|
|
723
|
+
return e.slice(0, n) + e.slice(t.end);
|
|
724
|
+
}
|
|
725
|
+
function L(e, t) {
|
|
726
|
+
let n = "", r = 0, i = new y({ onopentag(a, o) {
|
|
727
|
+
let s = i.startIndex, c = i.endIndex;
|
|
728
|
+
if (!Ze(e[s + 1])) return;
|
|
729
|
+
let l = s + 1;
|
|
730
|
+
for (; l < c && Qe(e[l]);) l++;
|
|
731
|
+
let u = t({
|
|
732
|
+
name: a,
|
|
733
|
+
rawName: e.slice(s + 1, l),
|
|
734
|
+
attrs: e.slice(l, c),
|
|
735
|
+
decodedAttrs: o
|
|
736
|
+
});
|
|
737
|
+
u !== null && (n += e.slice(r, s), n += u, r = c + 1);
|
|
738
|
+
} });
|
|
739
|
+
return i.end(e), n + e.slice(r);
|
|
740
|
+
}
|
|
741
|
+
var et = {
|
|
652
742
|
meta: {
|
|
653
743
|
id: "a11y.heading-empty",
|
|
654
744
|
reference: "https://docs.templatical.com/quality/accessibility/rule-catalog#headings",
|
|
655
745
|
severity: "error"
|
|
656
746
|
},
|
|
657
747
|
block(e) {
|
|
658
|
-
return !
|
|
748
|
+
return !s(e) || M(e.content ?? "") !== "" ? null : { blockId: e.id };
|
|
659
749
|
}
|
|
660
|
-
},
|
|
750
|
+
}, tt = {
|
|
661
751
|
id: "a11y.heading-skip-level",
|
|
662
752
|
reference: "https://docs.templatical.com/quality/accessibility/rule-catalog#headings",
|
|
663
753
|
severity: "error"
|
|
664
754
|
};
|
|
665
|
-
function
|
|
666
|
-
for (let n of e) if (
|
|
667
|
-
else if (
|
|
755
|
+
function nt(e, t) {
|
|
756
|
+
for (let n of e) if (s(n)) t.push(n);
|
|
757
|
+
else if (i(n)) for (let e of n.children) nt(e, t);
|
|
668
758
|
}
|
|
669
|
-
var
|
|
670
|
-
meta:
|
|
759
|
+
var rt = {
|
|
760
|
+
meta: tt,
|
|
671
761
|
template(e) {
|
|
672
762
|
let t = [];
|
|
673
|
-
|
|
763
|
+
nt(e.blocks, t);
|
|
674
764
|
let n = [], r = 0;
|
|
675
765
|
for (let e of t) r !== 0 && e.level > r + 1 && n.push({
|
|
676
766
|
blockId: e.id,
|
|
@@ -681,52 +771,52 @@ var Xe = {
|
|
|
681
771
|
}), r = e.level;
|
|
682
772
|
return n;
|
|
683
773
|
}
|
|
684
|
-
},
|
|
774
|
+
}, it = {
|
|
685
775
|
id: "a11y.heading-multiple-h1",
|
|
686
776
|
reference: "https://docs.templatical.com/quality/accessibility/rule-catalog#headings",
|
|
687
777
|
severity: "warning"
|
|
688
778
|
};
|
|
689
|
-
function
|
|
690
|
-
for (let n of e) if (
|
|
691
|
-
else if (
|
|
779
|
+
function at(e, t) {
|
|
780
|
+
for (let n of e) if (s(n)) t.push(n);
|
|
781
|
+
else if (i(n)) for (let e of n.children) at(e, t);
|
|
692
782
|
}
|
|
693
|
-
var
|
|
694
|
-
meta:
|
|
783
|
+
var ot = {
|
|
784
|
+
meta: it,
|
|
695
785
|
template(e) {
|
|
696
786
|
let t = [];
|
|
697
|
-
|
|
787
|
+
at(e.blocks, t);
|
|
698
788
|
let n = t.filter((e) => e.level === 1);
|
|
699
789
|
return n.length <= 1 ? [] : n.slice(1).map((e) => ({ blockId: e.id }));
|
|
700
790
|
}
|
|
701
|
-
},
|
|
791
|
+
}, st = {
|
|
702
792
|
id: "a11y.link-empty",
|
|
703
793
|
reference: "https://docs.templatical.com/quality/accessibility/rule-catalog#links",
|
|
704
794
|
severity: "error"
|
|
705
795
|
};
|
|
706
|
-
function
|
|
707
|
-
return
|
|
796
|
+
function ct(e) {
|
|
797
|
+
return u(e) || s(e) ? e.content : null;
|
|
708
798
|
}
|
|
709
|
-
var
|
|
710
|
-
meta:
|
|
799
|
+
var lt = {
|
|
800
|
+
meta: st,
|
|
711
801
|
block(e) {
|
|
712
|
-
let t =
|
|
713
|
-
return t === null || !
|
|
802
|
+
let t = ct(e);
|
|
803
|
+
return t === null || !j(t).find((e) => e.text === "" && !e.hasImageWithAlt) ? null : { blockId: e.id };
|
|
714
804
|
}
|
|
715
|
-
},
|
|
805
|
+
}, ut = {
|
|
716
806
|
id: "a11y.link-vague-text",
|
|
717
807
|
reference: "https://docs.templatical.com/quality/accessibility/rule-catalog#links",
|
|
718
808
|
severity: "warning"
|
|
719
809
|
};
|
|
720
|
-
function
|
|
721
|
-
return
|
|
810
|
+
function dt(e) {
|
|
811
|
+
return u(e) || s(e) ? e.content : null;
|
|
722
812
|
}
|
|
723
|
-
var
|
|
724
|
-
meta:
|
|
813
|
+
var ft = {
|
|
814
|
+
meta: ut,
|
|
725
815
|
block(e, t, n) {
|
|
726
|
-
let r =
|
|
816
|
+
let r = dt(e);
|
|
727
817
|
if (r === null) return null;
|
|
728
|
-
let i =
|
|
729
|
-
let t =
|
|
818
|
+
let i = k(n.locale).vagueLinkText, a = j(r).find((e) => {
|
|
819
|
+
let t = Ke(e.text);
|
|
730
820
|
return t !== "" && i.includes(t);
|
|
731
821
|
});
|
|
732
822
|
return a ? {
|
|
@@ -734,155 +824,172 @@ var at = {
|
|
|
734
824
|
params: { text: a.text }
|
|
735
825
|
} : null;
|
|
736
826
|
}
|
|
737
|
-
},
|
|
827
|
+
}, pt = {
|
|
738
828
|
id: "a11y.link-href-empty",
|
|
739
829
|
reference: "https://docs.templatical.com/quality/accessibility/rule-catalog#links",
|
|
740
830
|
severity: "error"
|
|
741
831
|
};
|
|
742
|
-
function
|
|
743
|
-
return
|
|
832
|
+
function mt(e) {
|
|
833
|
+
return u(e) || s(e) ? e.content : null;
|
|
744
834
|
}
|
|
745
|
-
var
|
|
746
|
-
meta:
|
|
835
|
+
var ht = {
|
|
836
|
+
meta: pt,
|
|
747
837
|
block(e) {
|
|
748
|
-
let t =
|
|
749
|
-
return t === null || !
|
|
838
|
+
let t = mt(e);
|
|
839
|
+
return t === null || !j(t).find((e) => {
|
|
750
840
|
let t = e.href.trim();
|
|
751
841
|
return t === "" || t === "#";
|
|
752
842
|
}) ? null : { blockId: e.id };
|
|
753
843
|
}
|
|
754
|
-
},
|
|
844
|
+
}, gt = {
|
|
755
845
|
id: "a11y.link-target-blank-no-rel",
|
|
756
846
|
reference: "https://docs.templatical.com/quality/accessibility/rule-catalog#links",
|
|
757
847
|
severity: "warning"
|
|
758
848
|
};
|
|
759
|
-
function
|
|
760
|
-
return
|
|
849
|
+
function _t(e) {
|
|
850
|
+
return u(e) || s(e) ? e.content : null;
|
|
761
851
|
}
|
|
762
|
-
function
|
|
852
|
+
function vt(e) {
|
|
763
853
|
if (e === null) return !1;
|
|
764
|
-
let t = e.toLowerCase().split(
|
|
854
|
+
let t = e.toLowerCase().split(/[ \t\n\f\r]+/);
|
|
765
855
|
return t.includes("noopener") || t.includes("noreferrer");
|
|
766
856
|
}
|
|
767
|
-
var
|
|
768
|
-
meta:
|
|
857
|
+
var yt = {
|
|
858
|
+
meta: gt,
|
|
769
859
|
block(e) {
|
|
770
|
-
let t =
|
|
771
|
-
return t === null || !
|
|
860
|
+
let t = _t(e);
|
|
861
|
+
return t === null || !j(t).find((e) => e.target === "_blank" && !vt(e.rel)) ? null : {
|
|
772
862
|
blockId: e.id,
|
|
773
863
|
fix: {
|
|
774
864
|
description: "Add rel=\"noopener\"",
|
|
775
865
|
apply: (t) => {
|
|
776
|
-
if (!
|
|
777
|
-
let n =
|
|
866
|
+
if (!u(e) && !s(e)) return;
|
|
867
|
+
let n = bt(e.content ?? "");
|
|
778
868
|
t.updateBlock(e.id, { content: n });
|
|
779
869
|
}
|
|
780
870
|
}
|
|
781
871
|
};
|
|
782
872
|
}
|
|
783
|
-
}
|
|
784
|
-
function
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
}
|
|
794
|
-
|
|
795
|
-
return e.some((e) => e.name.toLowerCase() === "target" && e.value !== null && e.value.toLowerCase() === "_blank");
|
|
796
|
-
}
|
|
797
|
-
function gt(e) {
|
|
798
|
-
return e.replace(/<a\b([^>]*)>/gi, (e, t) => {
|
|
799
|
-
let n = mt(t);
|
|
800
|
-
if (!ht(n)) return e;
|
|
801
|
-
let r = n.find((e) => e.name.toLowerCase() === "rel");
|
|
802
|
-
if (r) {
|
|
803
|
-
let n = (r.value ?? "").toLowerCase().split(/\s+/);
|
|
804
|
-
if (n.includes("noopener") || n.includes("noreferrer")) return e;
|
|
805
|
-
let i = `${r.value ?? ""} noopener`.trim();
|
|
806
|
-
return `<a${t.slice(0, r.start)}rel="${i}"${t.slice(r.start + r.raw.length)}>`;
|
|
807
|
-
}
|
|
808
|
-
return `<a${t} rel="noopener">`;
|
|
873
|
+
};
|
|
874
|
+
function bt(e) {
|
|
875
|
+
return L(e, ({ name: e, attrs: t, decodedAttrs: n }) => {
|
|
876
|
+
if (e !== "a" || n.target !== "_blank") return null;
|
|
877
|
+
let r = I(t, "rel");
|
|
878
|
+
if (r === null) return null;
|
|
879
|
+
let i = r[0];
|
|
880
|
+
if (i === void 0) return `<a${t} ${P("rel", "noopener")}>`;
|
|
881
|
+
let a = F(t.slice(i.start, i.end));
|
|
882
|
+
if (vt(n.rel ?? null)) return null;
|
|
883
|
+
let o = `${a ?? ""} noopener`.replace(/^[ \t\n\f\r]+/, "");
|
|
884
|
+
return `<a${t.slice(0, i.start) + P("rel", o) + t.slice(i.end)}>`;
|
|
809
885
|
});
|
|
810
886
|
}
|
|
811
887
|
// ../quality/src/accessibility/rules/link-nested-anchor.ts
|
|
812
|
-
var
|
|
888
|
+
var xt = {
|
|
813
889
|
id: "a11y.link-nested-anchor",
|
|
814
890
|
reference: "https://docs.templatical.com/quality/accessibility/rule-catalog#links",
|
|
815
891
|
severity: "error"
|
|
816
892
|
};
|
|
817
|
-
function
|
|
818
|
-
return
|
|
893
|
+
function St(e) {
|
|
894
|
+
return u(e) || s(e) ? e.content : null;
|
|
819
895
|
}
|
|
820
|
-
var
|
|
821
|
-
meta:
|
|
896
|
+
var Ct = {
|
|
897
|
+
meta: xt,
|
|
822
898
|
block(e) {
|
|
823
|
-
let t =
|
|
824
|
-
return t === null || !
|
|
899
|
+
let t = St(e);
|
|
900
|
+
return t === null || !Je(t) ? null : { blockId: e.id };
|
|
825
901
|
}
|
|
826
|
-
},
|
|
902
|
+
}, wt = {
|
|
827
903
|
meta: {
|
|
828
904
|
id: "a11y.text-all-caps",
|
|
829
905
|
reference: "https://docs.templatical.com/quality/accessibility/rule-catalog#text",
|
|
830
906
|
severity: "warning"
|
|
831
907
|
},
|
|
832
908
|
block(e, t, n) {
|
|
833
|
-
if (!
|
|
834
|
-
let r =
|
|
909
|
+
if (!u(e) && !s(e)) return null;
|
|
910
|
+
let r = M(e.content ?? "").replace(/[^\p{L}]/gu, "");
|
|
835
911
|
return r.length < n.thresholds.allCapsMinLength || ![...r].some((e) => e.toLocaleLowerCase() !== e.toLocaleUpperCase()) || r !== r.toLocaleUpperCase() ? null : { blockId: e.id };
|
|
836
912
|
}
|
|
837
|
-
},
|
|
913
|
+
}, Tt = {
|
|
838
914
|
id: "a11y.text-justified",
|
|
839
915
|
reference: "https://www.w3.org/WAI/WCAG21/Understanding/visual-presentation",
|
|
840
916
|
severity: "warning"
|
|
841
|
-
},
|
|
842
|
-
function
|
|
843
|
-
let t = [], n =
|
|
844
|
-
for (
|
|
845
|
-
|
|
917
|
+
}, Et = /^\s*text-align\s*:\s*([^;]*)/i, Dt = /^&(?:[A-Za-z][A-Za-z0-9]*|#[0-9]+|#[xX][0-9a-fA-F]+);/;
|
|
918
|
+
function Ot(e) {
|
|
919
|
+
let t = [], n = 0, r = 0, i = null, a = !1;
|
|
920
|
+
for (let o = 0; o < e.length;) {
|
|
921
|
+
let s = e[o], c = o + 1;
|
|
922
|
+
if (s === "&") {
|
|
923
|
+
let t = Dt.exec(e.slice(o));
|
|
924
|
+
if (t !== null) {
|
|
925
|
+
let e = _(t[0]);
|
|
926
|
+
e !== t[0] && (s = e, c = o + t[0].length);
|
|
927
|
+
}
|
|
928
|
+
}
|
|
929
|
+
for (let l of s) a ? a = !1 : l === "\\" ? a = !0 : i === null ? l === "\"" || l === "'" ? i = l : l === "(" ? r++ : l === ")" && r > 0 ? r-- : l === ";" && r === 0 && (t.push(e.slice(n, o)), n = c) : l === i && (i = null);
|
|
930
|
+
o = c;
|
|
931
|
+
}
|
|
932
|
+
return t.push(e.slice(n)), t;
|
|
846
933
|
}
|
|
847
|
-
function
|
|
848
|
-
let t =
|
|
849
|
-
return
|
|
934
|
+
function kt(e) {
|
|
935
|
+
let t = [];
|
|
936
|
+
return L(e, ({ attrs: e }) => {
|
|
937
|
+
let n = I(e, "style");
|
|
938
|
+
if (n === null) return null;
|
|
939
|
+
for (let r of n) {
|
|
940
|
+
let n = F(e.slice(r.start, r.end));
|
|
941
|
+
n !== null && t.push(n);
|
|
942
|
+
}
|
|
943
|
+
return null;
|
|
944
|
+
}), t;
|
|
850
945
|
}
|
|
851
|
-
function
|
|
852
|
-
return
|
|
946
|
+
function At(e) {
|
|
947
|
+
return Ot(e).some((e) => {
|
|
948
|
+
let t = Et.exec(_(e));
|
|
949
|
+
return t !== null && t[1].trim().toLowerCase() === "justify";
|
|
950
|
+
});
|
|
853
951
|
}
|
|
854
|
-
function
|
|
855
|
-
return e.
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
952
|
+
function jt(e) {
|
|
953
|
+
return Ot(e).filter((e) => !/^\s*text-align\s*:/i.test(_(e))).map((e) => e.trim()).filter((e) => e !== "").join("; ");
|
|
954
|
+
}
|
|
955
|
+
function Mt(e) {
|
|
956
|
+
return L(e, ({ rawName: e, attrs: t }) => {
|
|
957
|
+
let n = I(t, "style");
|
|
958
|
+
if (n === null || n.length === 0) return null;
|
|
959
|
+
let r = t, i = !1;
|
|
960
|
+
for (let e = n.length - 1; e >= 0; e--) {
|
|
961
|
+
let a = n[e], o = F(t.slice(a.start, a.end));
|
|
962
|
+
if (o === null || !At(o)) continue;
|
|
963
|
+
let s = jt(o);
|
|
964
|
+
r = s === "" ? $e(r, a) : r.slice(0, a.start) + P("style", s) + r.slice(a.end), i = !0;
|
|
965
|
+
}
|
|
966
|
+
return i ? `<${e}${r}>` : null;
|
|
860
967
|
});
|
|
861
968
|
}
|
|
862
|
-
var
|
|
863
|
-
meta:
|
|
969
|
+
var Nt = {
|
|
970
|
+
meta: Tt,
|
|
864
971
|
block(e) {
|
|
865
|
-
return !
|
|
972
|
+
return !u(e) || !kt(e.content ?? "").some(At) ? null : {
|
|
866
973
|
blockId: e.id,
|
|
867
974
|
fix: {
|
|
868
975
|
description: "Remove justified alignment",
|
|
869
976
|
apply: (t) => {
|
|
870
|
-
|
|
977
|
+
u(e) && t.updateBlock(e.id, { content: Mt(e.content ?? "") });
|
|
871
978
|
}
|
|
872
979
|
}
|
|
873
980
|
};
|
|
874
981
|
}
|
|
875
|
-
},
|
|
982
|
+
}, Pt = {
|
|
876
983
|
meta: {
|
|
877
984
|
id: "a11y.text-low-contrast",
|
|
878
985
|
reference: "https://www.w3.org/WAI/WCAG21/Understanding/contrast-minimum",
|
|
879
986
|
severity: "error"
|
|
880
987
|
},
|
|
881
988
|
block(e, t) {
|
|
882
|
-
if (!
|
|
989
|
+
if (!s(e)) return null;
|
|
883
990
|
let n = e.color ?? t.resolvedTextColor;
|
|
884
|
-
if (!
|
|
885
|
-
let r =
|
|
991
|
+
if (!x(n) || !x(t.resolvedBackgroundColor)) return null;
|
|
992
|
+
let r = p[e.level] >= 24 ? 3 : 4.5, i = he(n, t.resolvedBackgroundColor);
|
|
886
993
|
return Number.isNaN(i) || i >= r ? null : {
|
|
887
994
|
blockId: e.id,
|
|
888
995
|
params: {
|
|
@@ -891,36 +998,36 @@ var Ot = {
|
|
|
891
998
|
}
|
|
892
999
|
};
|
|
893
1000
|
}
|
|
894
|
-
},
|
|
1001
|
+
}, Ft = {
|
|
895
1002
|
id: "a11y.text-too-small",
|
|
896
1003
|
reference: "https://docs.templatical.com/quality/accessibility/rule-catalog#text",
|
|
897
1004
|
severity: "warning"
|
|
898
1005
|
};
|
|
899
|
-
function
|
|
900
|
-
return
|
|
1006
|
+
function It(e) {
|
|
1007
|
+
return v(e) || a(e) ? e.fontSize : null;
|
|
901
1008
|
}
|
|
902
1009
|
// ../quality/src/accessibility/index.ts
|
|
903
|
-
var
|
|
904
|
-
Ae,
|
|
1010
|
+
var Lt = [
|
|
905
1011
|
Ne,
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
1012
|
+
Ie,
|
|
1013
|
+
Le,
|
|
1014
|
+
Re,
|
|
909
1015
|
qe,
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
ct,
|
|
1016
|
+
et,
|
|
1017
|
+
rt,
|
|
1018
|
+
ot,
|
|
1019
|
+
lt,
|
|
915
1020
|
ft,
|
|
1021
|
+
ht,
|
|
916
1022
|
yt,
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
1023
|
+
Ct,
|
|
1024
|
+
wt,
|
|
1025
|
+
Nt,
|
|
1026
|
+
Pt,
|
|
920
1027
|
{
|
|
921
|
-
meta:
|
|
1028
|
+
meta: Ft,
|
|
922
1029
|
block(e, t, n) {
|
|
923
|
-
let r =
|
|
1030
|
+
let r = It(e);
|
|
924
1031
|
return r === null || r >= n.thresholds.minFontSize ? null : {
|
|
925
1032
|
blockId: e.id,
|
|
926
1033
|
params: {
|
|
@@ -937,9 +1044,9 @@ var Mt = [
|
|
|
937
1044
|
severity: "warning"
|
|
938
1045
|
},
|
|
939
1046
|
block(e, t, n) {
|
|
940
|
-
if (!
|
|
941
|
-
let r =
|
|
942
|
-
return r === "" || !
|
|
1047
|
+
if (!h(e)) return null;
|
|
1048
|
+
let r = Ke(e.text ?? "");
|
|
1049
|
+
return r === "" || !k(n.locale).vagueButtonLabels.includes(r) ? null : {
|
|
943
1050
|
blockId: e.id,
|
|
944
1051
|
params: { text: e.text }
|
|
945
1052
|
};
|
|
@@ -952,7 +1059,7 @@ var Mt = [
|
|
|
952
1059
|
severity: "warning"
|
|
953
1060
|
},
|
|
954
1061
|
block(e, t, n) {
|
|
955
|
-
if (!
|
|
1062
|
+
if (!h(e)) return null;
|
|
956
1063
|
let r = e.buttonPadding;
|
|
957
1064
|
if (!r) return null;
|
|
958
1065
|
let i = e.fontSize * 1.4 + r.top + r.bottom;
|
|
@@ -972,8 +1079,8 @@ var Mt = [
|
|
|
972
1079
|
severity: "error"
|
|
973
1080
|
},
|
|
974
1081
|
block(e) {
|
|
975
|
-
if (!
|
|
976
|
-
let t =
|
|
1082
|
+
if (!h(e)) return null;
|
|
1083
|
+
let t = he(e.textColor, e.backgroundColor);
|
|
977
1084
|
if (Number.isNaN(t)) return null;
|
|
978
1085
|
let n = e.fontSize >= 24 ? 3 : 4.5;
|
|
979
1086
|
return t >= n ? null : {
|
|
@@ -996,11 +1103,11 @@ var Mt = [
|
|
|
996
1103
|
}
|
|
997
1104
|
}
|
|
998
1105
|
];
|
|
999
|
-
function
|
|
1000
|
-
return t.disabled === !0 || t.accessibility === !1 ? [] :
|
|
1106
|
+
function Rt(e, t = {}) {
|
|
1107
|
+
return t.disabled === !0 || t.accessibility === !1 ? [] : w(e, Lt, we(t.locale, t.accessibility ?? {}, Lt), (e, t, n) => Me(e, t, n));
|
|
1001
1108
|
}
|
|
1002
1109
|
// ../quality/src/structure/messages/de.ts
|
|
1003
|
-
var
|
|
1110
|
+
var zt = /* @__PURE__ */ e({ default: () => Bt }), Bt = {
|
|
1004
1111
|
"structure.duplicate-block-id": {
|
|
1005
1112
|
message: "Block-ID erscheint {count}-mal im Baum.",
|
|
1006
1113
|
suggestion: "Gib jedem Block eine eindeutige ID."
|
|
@@ -1041,7 +1148,7 @@ var Pt = /* @__PURE__ */ e({ default: () => Ft }), Ft = {
|
|
|
1041
1148
|
message: "Der Hero-Modus kann die Form dieses Hintergrundbilds nicht übernehmen, weil seine Größe unbekannt ist (eine Merge-Tag-URL oder ein Bild, das der Editor nicht vermessen hat), deshalb wird die Sektion als normale Sektion dargestellt.",
|
|
1042
1149
|
suggestion: "Gib ihr eine feste Höhe oder trage die Größe der Bilddatei ein."
|
|
1043
1150
|
}
|
|
1044
|
-
},
|
|
1151
|
+
}, Vt = /* @__PURE__ */ e({ default: () => R }), R = {
|
|
1045
1152
|
"structure.duplicate-block-id": {
|
|
1046
1153
|
message: "Block id appears {count} times in the tree.",
|
|
1047
1154
|
suggestion: "Give each block a unique id."
|
|
@@ -1082,36 +1189,36 @@ var Pt = /* @__PURE__ */ e({ default: () => Ft }), Ft = {
|
|
|
1082
1189
|
message: "Hero mode can't match this background image's shape because its size is unknown (a merge-tag URL, or an image the editor didn't measure), so the section renders as a regular one.",
|
|
1083
1190
|
suggestion: "Give it a fixed height, or set the image file's size."
|
|
1084
1191
|
}
|
|
1085
|
-
},
|
|
1086
|
-
"./de.ts":
|
|
1087
|
-
"./en.ts":
|
|
1088
|
-
}),
|
|
1089
|
-
for (let e in
|
|
1192
|
+
}, Ht = /* #__PURE__ */ Object.assign({
|
|
1193
|
+
"./de.ts": zt,
|
|
1194
|
+
"./en.ts": Vt
|
|
1195
|
+
}), z = {};
|
|
1196
|
+
for (let e in Ht) {
|
|
1090
1197
|
let t = /\.\/([^/]+)\.ts$/.exec(e);
|
|
1091
1198
|
if (!t) continue;
|
|
1092
1199
|
let n = t[1];
|
|
1093
|
-
n !== "index" && (
|
|
1200
|
+
n !== "index" && (z[n] = Ht[e].default);
|
|
1094
1201
|
}
|
|
1095
|
-
function
|
|
1096
|
-
return
|
|
1202
|
+
function Ut(e) {
|
|
1203
|
+
return z[e.split("-")[0]?.toLowerCase() ?? "en"] ?? z.en ?? R;
|
|
1097
1204
|
}
|
|
1098
|
-
function
|
|
1099
|
-
return
|
|
1205
|
+
function Wt(e, t, n) {
|
|
1206
|
+
return D(Ut(e)[t] ?? R[t], n);
|
|
1100
1207
|
}
|
|
1101
1208
|
// ../quality/src/structure/rules/duplicate-block-id.ts
|
|
1102
|
-
var
|
|
1209
|
+
var Gt = {
|
|
1103
1210
|
id: "structure.duplicate-block-id",
|
|
1104
1211
|
reference: "https://docs.templatical.com/quality/structure/rule-catalog#tree-integrity",
|
|
1105
1212
|
severity: "error"
|
|
1106
1213
|
};
|
|
1107
|
-
function
|
|
1108
|
-
for (let n of e) if (t.set(n.id, (t.get(n.id) ?? 0) + 1),
|
|
1214
|
+
function Kt(e, t) {
|
|
1215
|
+
for (let n of e) if (t.set(n.id, (t.get(n.id) ?? 0) + 1), i(n)) for (let e of n.children) Kt(e, t);
|
|
1109
1216
|
}
|
|
1110
|
-
var
|
|
1111
|
-
meta:
|
|
1217
|
+
var qt = {
|
|
1218
|
+
meta: Gt,
|
|
1112
1219
|
template(e) {
|
|
1113
1220
|
let t = /* @__PURE__ */ new Map();
|
|
1114
|
-
|
|
1221
|
+
Kt(e.blocks, t);
|
|
1115
1222
|
let n = [];
|
|
1116
1223
|
for (let [e, r] of t) r > 1 && n.push({
|
|
1117
1224
|
blockId: e,
|
|
@@ -1119,14 +1226,14 @@ var Ht = {
|
|
|
1119
1226
|
});
|
|
1120
1227
|
return n;
|
|
1121
1228
|
}
|
|
1122
|
-
},
|
|
1229
|
+
}, Jt = {
|
|
1123
1230
|
id: "structure.empty-column",
|
|
1124
1231
|
reference: "https://docs.templatical.com/quality/structure/rule-catalog#content-presence",
|
|
1125
1232
|
severity: "warning"
|
|
1126
1233
|
};
|
|
1127
|
-
function
|
|
1234
|
+
function Yt(e, t) {
|
|
1128
1235
|
for (let n of e) {
|
|
1129
|
-
if (!
|
|
1236
|
+
if (!i(n)) continue;
|
|
1130
1237
|
let e = n;
|
|
1131
1238
|
e.children.length > 1 && e.children.forEach((n, r) => {
|
|
1132
1239
|
n.length === 0 && t.push({
|
|
@@ -1134,29 +1241,29 @@ function Wt(e, t) {
|
|
|
1134
1241
|
params: { columnIndex: r + 1 }
|
|
1135
1242
|
});
|
|
1136
1243
|
});
|
|
1137
|
-
for (let n of e.children)
|
|
1244
|
+
for (let n of e.children) Yt(n, t);
|
|
1138
1245
|
}
|
|
1139
1246
|
}
|
|
1140
|
-
var
|
|
1141
|
-
meta:
|
|
1247
|
+
var Xt = {
|
|
1248
|
+
meta: Jt,
|
|
1142
1249
|
template(e) {
|
|
1143
1250
|
let t = [];
|
|
1144
|
-
return
|
|
1251
|
+
return Yt(e.blocks, t), t;
|
|
1145
1252
|
}
|
|
1146
|
-
},
|
|
1253
|
+
}, Zt = {
|
|
1147
1254
|
id: "structure.empty-section",
|
|
1148
1255
|
reference: "https://docs.templatical.com/quality/structure/rule-catalog#content-presence",
|
|
1149
1256
|
severity: "warning"
|
|
1150
1257
|
};
|
|
1151
|
-
function
|
|
1258
|
+
function Qt(e) {
|
|
1152
1259
|
return e.children.length === 0 || e.children.every((e) => e.length === 0);
|
|
1153
1260
|
}
|
|
1154
|
-
var
|
|
1155
|
-
meta:
|
|
1261
|
+
var $t = {
|
|
1262
|
+
meta: Zt,
|
|
1156
1263
|
block(e) {
|
|
1157
|
-
if (!
|
|
1264
|
+
if (!i(e)) return null;
|
|
1158
1265
|
let t = e;
|
|
1159
|
-
return
|
|
1266
|
+
return Qt(t) ? {
|
|
1160
1267
|
blockId: t.id,
|
|
1161
1268
|
fix: {
|
|
1162
1269
|
description: "Remove the empty section",
|
|
@@ -1167,7 +1274,7 @@ var Jt = {
|
|
|
1167
1274
|
}
|
|
1168
1275
|
} : null;
|
|
1169
1276
|
}
|
|
1170
|
-
},
|
|
1277
|
+
}, en = {
|
|
1171
1278
|
meta: {
|
|
1172
1279
|
id: "structure.hero-not-applied",
|
|
1173
1280
|
reference: "https://docs.templatical.com/quality/structure/rule-catalog#content-presence",
|
|
@@ -1179,7 +1286,7 @@ var Jt = {
|
|
|
1179
1286
|
]
|
|
1180
1287
|
},
|
|
1181
1288
|
block(e) {
|
|
1182
|
-
if (!
|
|
1289
|
+
if (!i(e)) return null;
|
|
1183
1290
|
let t = ae(e);
|
|
1184
1291
|
return t === null || t.applied ? null : {
|
|
1185
1292
|
blockId: e.id,
|
|
@@ -1188,59 +1295,59 @@ var Jt = {
|
|
|
1188
1295
|
}
|
|
1189
1296
|
};
|
|
1190
1297
|
// ../quality/src/structure/band.ts
|
|
1191
|
-
function
|
|
1192
|
-
return e.wrapper ? e.wrapper : t.parent &&
|
|
1298
|
+
function tn(e, t) {
|
|
1299
|
+
return e.wrapper ? e.wrapper : t.parent && n(t.parent) ? {
|
|
1193
1300
|
backgroundColor: t.parent.styles?.backgroundColor,
|
|
1194
1301
|
backgroundImage: t.parent.backgroundImage
|
|
1195
1302
|
} : null;
|
|
1196
1303
|
}
|
|
1197
|
-
function
|
|
1304
|
+
function nn(e) {
|
|
1198
1305
|
if (typeof e != "string") return !1;
|
|
1199
1306
|
let t = e.trim().toLowerCase();
|
|
1200
1307
|
return t !== "" && t !== "transparent";
|
|
1201
1308
|
}
|
|
1202
|
-
var
|
|
1309
|
+
var rn = {
|
|
1203
1310
|
meta: {
|
|
1204
1311
|
id: "structure.nested-background-image",
|
|
1205
1312
|
reference: "https://docs.templatical.com/quality/structure/rule-catalog#email-client-compatibility",
|
|
1206
1313
|
severity: "warning"
|
|
1207
1314
|
},
|
|
1208
1315
|
block(e, t) {
|
|
1209
|
-
if (!
|
|
1210
|
-
let n =
|
|
1211
|
-
return n === null ||
|
|
1316
|
+
if (!i(e) || g(e.backgroundImage) === null) return null;
|
|
1317
|
+
let n = tn(e, t);
|
|
1318
|
+
return n === null || g(n.backgroundImage) === null ? null : { blockId: e.id };
|
|
1212
1319
|
}
|
|
1213
|
-
},
|
|
1320
|
+
}, an = {
|
|
1214
1321
|
meta: {
|
|
1215
1322
|
id: "structure.nested-section",
|
|
1216
1323
|
reference: "https://docs.templatical.com/quality/structure/rule-catalog#tree-integrity",
|
|
1217
1324
|
severity: "error"
|
|
1218
1325
|
},
|
|
1219
1326
|
block(e, t) {
|
|
1220
|
-
return !
|
|
1327
|
+
return !i(e) || t.section === null ? null : {
|
|
1221
1328
|
blockId: e.id,
|
|
1222
1329
|
params: { parentId: t.section.id }
|
|
1223
1330
|
};
|
|
1224
1331
|
}
|
|
1225
|
-
},
|
|
1332
|
+
}, on = {
|
|
1226
1333
|
id: "structure.section-column-mismatch",
|
|
1227
1334
|
reference: "https://docs.templatical.com/quality/structure/rule-catalog#section-layout",
|
|
1228
1335
|
severity: "error"
|
|
1229
1336
|
};
|
|
1230
|
-
function
|
|
1337
|
+
function sn(e) {
|
|
1231
1338
|
return e === "1" ? 1 : e === "3" ? 3 : 2;
|
|
1232
1339
|
}
|
|
1233
1340
|
// ../quality/src/structure/index.ts
|
|
1234
|
-
var
|
|
1235
|
-
|
|
1236
|
-
Jt,
|
|
1237
|
-
Gt,
|
|
1341
|
+
var cn = [
|
|
1342
|
+
qt,
|
|
1238
1343
|
$t,
|
|
1344
|
+
Xt,
|
|
1345
|
+
an,
|
|
1239
1346
|
{
|
|
1240
|
-
meta:
|
|
1347
|
+
meta: on,
|
|
1241
1348
|
block(e) {
|
|
1242
|
-
if (!
|
|
1243
|
-
let t = e, n =
|
|
1349
|
+
if (!i(e)) return null;
|
|
1350
|
+
let t = e, n = sn(t.columns), r = t.children.length;
|
|
1244
1351
|
return r === n ? null : {
|
|
1245
1352
|
blockId: t.id,
|
|
1246
1353
|
params: {
|
|
@@ -1258,19 +1365,19 @@ var nn = [
|
|
|
1258
1365
|
severity: "warning"
|
|
1259
1366
|
},
|
|
1260
1367
|
block(e, t) {
|
|
1261
|
-
if (!
|
|
1262
|
-
let n =
|
|
1263
|
-
return n === null || !
|
|
1368
|
+
if (!i(e) || g(e.backgroundImage) === null) return null;
|
|
1369
|
+
let n = tn(e, t);
|
|
1370
|
+
return n === null || !nn(n.backgroundColor) ? null : { blockId: e.id };
|
|
1264
1371
|
}
|
|
1265
1372
|
},
|
|
1266
|
-
|
|
1267
|
-
|
|
1373
|
+
rn,
|
|
1374
|
+
en
|
|
1268
1375
|
];
|
|
1269
|
-
function
|
|
1270
|
-
return t.disabled === !0 || t.structure === !1 ? [] :
|
|
1376
|
+
function ln(e, t = {}) {
|
|
1377
|
+
return t.disabled === !0 || t.structure === !1 ? [] : w(e, cn, Te(t.locale, t.structure ?? {}, cn), (e, t, n) => Wt(e, t, n));
|
|
1271
1378
|
}
|
|
1272
1379
|
// ../quality/src/links/messages/de.ts
|
|
1273
|
-
var
|
|
1380
|
+
var un = /* @__PURE__ */ e({ default: () => dn }), dn = {
|
|
1274
1381
|
"link.javascript-protocol": {
|
|
1275
1382
|
message: "Die URL verwendet das Protokoll „{protocol}:\", das beliebigen Skriptcode ausführen kann und aus Sicherheitsgründen beim Rendern entfernt wird.",
|
|
1276
1383
|
suggestion: "Ersetze sie durch eine echte URL oder entferne sie."
|
|
@@ -1295,7 +1402,7 @@ var an = /* @__PURE__ */ e({ default: () => on }), on = {
|
|
|
1295
1402
|
message: "Die URL „{url}\" ist relativ. Eine versendete E-Mail hat keine Seitenadresse, gegen die sie aufgelöst werden kann, daher funktioniert der Link nicht.",
|
|
1296
1403
|
suggestion: "Verwende eine absolute URL (https://…)."
|
|
1297
1404
|
}
|
|
1298
|
-
},
|
|
1405
|
+
}, fn = /* @__PURE__ */ e({ default: () => B }), B = {
|
|
1299
1406
|
"link.javascript-protocol": {
|
|
1300
1407
|
message: "URL uses the \"{protocol}:\" protocol, which can execute arbitrary script and is stripped at render time for safety.",
|
|
1301
1408
|
suggestion: "Replace it with a real link or remove the URL."
|
|
@@ -1320,57 +1427,57 @@ var an = /* @__PURE__ */ e({ default: () => on }), on = {
|
|
|
1320
1427
|
message: "URL \"{url}\" is relative. A sent email has no page address to resolve it against, so the link breaks.",
|
|
1321
1428
|
suggestion: "Use an absolute URL (https://…)."
|
|
1322
1429
|
}
|
|
1323
|
-
},
|
|
1324
|
-
"./de.ts":
|
|
1325
|
-
"./en.ts":
|
|
1326
|
-
}),
|
|
1327
|
-
for (let e in
|
|
1430
|
+
}, pn = /* #__PURE__ */ Object.assign({
|
|
1431
|
+
"./de.ts": un,
|
|
1432
|
+
"./en.ts": fn
|
|
1433
|
+
}), V = {};
|
|
1434
|
+
for (let e in pn) {
|
|
1328
1435
|
let t = /\.\/([^/]+)\.ts$/.exec(e);
|
|
1329
1436
|
if (!t) continue;
|
|
1330
1437
|
let n = t[1];
|
|
1331
|
-
n !== "index" && (
|
|
1438
|
+
n !== "index" && (V[n] = pn[e].default);
|
|
1332
1439
|
}
|
|
1333
|
-
function
|
|
1334
|
-
return
|
|
1440
|
+
function mn(e) {
|
|
1441
|
+
return V[e.split("-")[0]?.toLowerCase() ?? "en"] ?? V.en ?? B;
|
|
1335
1442
|
}
|
|
1336
|
-
function
|
|
1337
|
-
return
|
|
1443
|
+
function hn(e, t, n) {
|
|
1444
|
+
return D(mn(e)[t] ?? B[t], n);
|
|
1338
1445
|
}
|
|
1339
1446
|
// ../quality/src/url-walker.ts
|
|
1340
|
-
function
|
|
1447
|
+
function H(e) {
|
|
1341
1448
|
let t = [];
|
|
1342
|
-
return
|
|
1343
|
-
if (
|
|
1449
|
+
return C(e, (e) => {
|
|
1450
|
+
if (s(e) || u(e) || le(e)) for (let n of j(e.content)) t.push({
|
|
1344
1451
|
url: n.href,
|
|
1345
1452
|
blockId: e.id,
|
|
1346
1453
|
source: "anchor",
|
|
1347
1454
|
label: n.text
|
|
1348
1455
|
});
|
|
1349
|
-
else if (
|
|
1456
|
+
else if (h(e)) t.push({
|
|
1350
1457
|
url: e.url,
|
|
1351
1458
|
blockId: e.id,
|
|
1352
1459
|
source: "button",
|
|
1353
1460
|
label: e.text
|
|
1354
1461
|
});
|
|
1355
|
-
else if (
|
|
1462
|
+
else if (m(e)) e.linkUrl && e.linkUrl !== "" && t.push({
|
|
1356
1463
|
url: e.linkUrl,
|
|
1357
1464
|
blockId: e.id,
|
|
1358
1465
|
source: "image-link",
|
|
1359
1466
|
label: e.alt || void 0
|
|
1360
1467
|
});
|
|
1361
|
-
else if (
|
|
1468
|
+
else if (ie(e)) t.push({
|
|
1362
1469
|
url: e.url,
|
|
1363
1470
|
blockId: e.id,
|
|
1364
1471
|
source: "video",
|
|
1365
1472
|
label: e.alt || void 0
|
|
1366
1473
|
});
|
|
1367
|
-
else if (
|
|
1474
|
+
else if (v(e)) for (let n of e.items) t.push({
|
|
1368
1475
|
url: n.url,
|
|
1369
1476
|
blockId: e.id,
|
|
1370
1477
|
source: "menu-item",
|
|
1371
1478
|
label: n.text
|
|
1372
1479
|
});
|
|
1373
|
-
else if (
|
|
1480
|
+
else if (d(e)) for (let n of e.icons) t.push({
|
|
1374
1481
|
url: n.url,
|
|
1375
1482
|
blockId: e.id,
|
|
1376
1483
|
source: "social-icon",
|
|
@@ -1379,21 +1486,21 @@ function z(e) {
|
|
|
1379
1486
|
}), t;
|
|
1380
1487
|
}
|
|
1381
1488
|
// ../quality/src/links/rules/javascript-protocol.ts
|
|
1382
|
-
var
|
|
1489
|
+
var gn = {
|
|
1383
1490
|
id: "link.javascript-protocol",
|
|
1384
1491
|
reference: "https://docs.templatical.com/quality/links/rule-catalog#dangerous-protocols",
|
|
1385
1492
|
severity: "error"
|
|
1386
|
-
},
|
|
1387
|
-
function
|
|
1388
|
-
let t =
|
|
1389
|
-
return
|
|
1493
|
+
}, _n = ce;
|
|
1494
|
+
function vn(e) {
|
|
1495
|
+
let t = te(e), n = te(e.replace(/\s+/g, ""));
|
|
1496
|
+
return _n.find((e) => e === t || e === n) ?? null;
|
|
1390
1497
|
}
|
|
1391
|
-
var
|
|
1392
|
-
meta:
|
|
1498
|
+
var yn = {
|
|
1499
|
+
meta: gn,
|
|
1393
1500
|
template(e) {
|
|
1394
1501
|
let t = [];
|
|
1395
|
-
for (let n of
|
|
1396
|
-
let e =
|
|
1502
|
+
for (let n of H(e)) {
|
|
1503
|
+
let e = vn(n.url);
|
|
1397
1504
|
e !== null && t.push({
|
|
1398
1505
|
blockId: n.blockId,
|
|
1399
1506
|
params: { protocol: e }
|
|
@@ -1401,41 +1508,41 @@ var mn = {
|
|
|
1401
1508
|
}
|
|
1402
1509
|
return t;
|
|
1403
1510
|
}
|
|
1404
|
-
},
|
|
1511
|
+
}, bn = {
|
|
1405
1512
|
id: "link.unsupported-protocol",
|
|
1406
1513
|
reference: "https://docs.templatical.com/quality/links/rule-catalog#unsupported-protocols",
|
|
1407
1514
|
severity: "warning"
|
|
1408
|
-
},
|
|
1515
|
+
}, xn = /* @__PURE__ */ new Set([
|
|
1409
1516
|
"http",
|
|
1410
1517
|
"https",
|
|
1411
1518
|
"mailto",
|
|
1412
1519
|
"tel",
|
|
1413
1520
|
"sms"
|
|
1414
|
-
]),
|
|
1415
|
-
function
|
|
1521
|
+
]), Sn = new Set(_n);
|
|
1522
|
+
function Cn(e) {
|
|
1416
1523
|
if (!e) return null;
|
|
1417
1524
|
let t = e.trim(), n = /^([a-z][a-z0-9+\-.]*):/i.exec(t);
|
|
1418
1525
|
return n ? n[1].toLowerCase() : null;
|
|
1419
1526
|
}
|
|
1420
|
-
var
|
|
1421
|
-
meta:
|
|
1527
|
+
var wn = {
|
|
1528
|
+
meta: bn,
|
|
1422
1529
|
template(e) {
|
|
1423
1530
|
let t = [];
|
|
1424
|
-
for (let n of
|
|
1425
|
-
let e =
|
|
1426
|
-
e !== null && (
|
|
1531
|
+
for (let n of H(e)) {
|
|
1532
|
+
let e = Cn(n.url);
|
|
1533
|
+
e !== null && (Sn.has(e) || xn.has(e) || t.push({
|
|
1427
1534
|
blockId: n.blockId,
|
|
1428
1535
|
params: { protocol: e }
|
|
1429
1536
|
}));
|
|
1430
1537
|
}
|
|
1431
1538
|
return t;
|
|
1432
1539
|
}
|
|
1433
|
-
},
|
|
1540
|
+
}, Tn = {
|
|
1434
1541
|
id: "link.malformed-mailto",
|
|
1435
1542
|
reference: "https://docs.templatical.com/quality/links/rule-catalog#malformed-uris",
|
|
1436
1543
|
severity: "warning"
|
|
1437
1544
|
};
|
|
1438
|
-
function
|
|
1545
|
+
function En(e) {
|
|
1439
1546
|
let t = e.trim();
|
|
1440
1547
|
if (!/^mailto:/i.test(t)) return !1;
|
|
1441
1548
|
let [n] = t.slice(7).split("?", 2);
|
|
@@ -1450,43 +1557,43 @@ function xn(e) {
|
|
|
1450
1557
|
}
|
|
1451
1558
|
return !1;
|
|
1452
1559
|
}
|
|
1453
|
-
var
|
|
1454
|
-
meta:
|
|
1560
|
+
var Dn = {
|
|
1561
|
+
meta: Tn,
|
|
1455
1562
|
template(e) {
|
|
1456
1563
|
let t = [];
|
|
1457
|
-
for (let n of
|
|
1564
|
+
for (let n of H(e)) En(n.url) && t.push({ blockId: n.blockId });
|
|
1458
1565
|
return t;
|
|
1459
1566
|
}
|
|
1460
|
-
},
|
|
1567
|
+
}, On = {
|
|
1461
1568
|
id: "link.malformed-tel",
|
|
1462
1569
|
reference: "https://docs.templatical.com/quality/links/rule-catalog#malformed-uris",
|
|
1463
1570
|
severity: "warning"
|
|
1464
|
-
},
|
|
1465
|
-
function
|
|
1571
|
+
}, kn = /^[+0-9\s().\-]+$/, An = /^[A-Za-z0-9-]+(=[^;]+)?$/;
|
|
1572
|
+
function jn(e) {
|
|
1466
1573
|
let t = e.trim();
|
|
1467
1574
|
if (!/^tel:/i.test(t)) return !1;
|
|
1468
1575
|
let n = t.slice(4).trim();
|
|
1469
1576
|
if (n === "") return !0;
|
|
1470
1577
|
let [r, ...i] = n.split(";");
|
|
1471
|
-
return !
|
|
1578
|
+
return !kn.test(r) || i.some((e) => !An.test(e));
|
|
1472
1579
|
}
|
|
1473
|
-
var
|
|
1474
|
-
meta:
|
|
1580
|
+
var Mn = {
|
|
1581
|
+
meta: On,
|
|
1475
1582
|
template(e) {
|
|
1476
1583
|
let t = [];
|
|
1477
|
-
for (let n of
|
|
1584
|
+
for (let n of H(e)) jn(n.url) && t.push({ blockId: n.blockId });
|
|
1478
1585
|
return t;
|
|
1479
1586
|
}
|
|
1480
|
-
},
|
|
1587
|
+
}, Nn = {
|
|
1481
1588
|
id: "link.localhost-or-staging",
|
|
1482
1589
|
reference: "https://docs.templatical.com/quality/links/rule-catalog#environment-leaks",
|
|
1483
1590
|
severity: "warning"
|
|
1484
1591
|
};
|
|
1485
|
-
function
|
|
1592
|
+
function Pn(e) {
|
|
1486
1593
|
let t = e.replace(/[.+?^${}()|[\]\\]/g, "\\$&").replace(/\*/g, ".*");
|
|
1487
1594
|
return RegExp(`^${t}$`, "i");
|
|
1488
1595
|
}
|
|
1489
|
-
function
|
|
1596
|
+
function Fn(e) {
|
|
1490
1597
|
if (!e) return null;
|
|
1491
1598
|
let t = e.trim();
|
|
1492
1599
|
if (!/^(https?|ftps?):\/\//i.test(t)) return null;
|
|
@@ -1496,14 +1603,14 @@ function An(e) {
|
|
|
1496
1603
|
return null;
|
|
1497
1604
|
}
|
|
1498
1605
|
}
|
|
1499
|
-
var
|
|
1500
|
-
meta:
|
|
1606
|
+
var In = {
|
|
1607
|
+
meta: Nn,
|
|
1501
1608
|
template(e, t) {
|
|
1502
1609
|
let n = t.links.nonProductionHosts;
|
|
1503
1610
|
if (n.length === 0) return [];
|
|
1504
|
-
let r = n.map(
|
|
1505
|
-
for (let t of
|
|
1506
|
-
let e =
|
|
1611
|
+
let r = n.map(Pn), i = [];
|
|
1612
|
+
for (let t of H(e)) {
|
|
1613
|
+
let e = Fn(t.url);
|
|
1507
1614
|
e !== null && r.some((t) => t.test(e)) && i.push({
|
|
1508
1615
|
blockId: t.blockId,
|
|
1509
1616
|
params: { host: e }
|
|
@@ -1511,23 +1618,23 @@ var jn = {
|
|
|
1511
1618
|
}
|
|
1512
1619
|
return i;
|
|
1513
1620
|
}
|
|
1514
|
-
},
|
|
1621
|
+
}, Ln = {
|
|
1515
1622
|
id: "link.relative-url",
|
|
1516
1623
|
reference: "https://docs.templatical.com/quality/links/rule-catalog#unsupported-protocols",
|
|
1517
1624
|
severity: "warning"
|
|
1518
|
-
},
|
|
1519
|
-
mn,
|
|
1625
|
+
}, Rn = /^(?:\/|\.{1,2}\/|\?)/, zn = [
|
|
1520
1626
|
yn,
|
|
1521
|
-
|
|
1627
|
+
wn,
|
|
1522
1628
|
Dn,
|
|
1523
|
-
|
|
1629
|
+
Mn,
|
|
1630
|
+
In,
|
|
1524
1631
|
{
|
|
1525
|
-
meta:
|
|
1632
|
+
meta: Ln,
|
|
1526
1633
|
template(e) {
|
|
1527
1634
|
let t = [];
|
|
1528
|
-
for (let n of
|
|
1635
|
+
for (let n of H(e)) {
|
|
1529
1636
|
let e = n.url?.trim();
|
|
1530
|
-
e &&
|
|
1637
|
+
e && Rn.test(e) && t.push({
|
|
1531
1638
|
blockId: n.blockId,
|
|
1532
1639
|
params: { url: e }
|
|
1533
1640
|
});
|
|
@@ -1536,11 +1643,11 @@ var jn = {
|
|
|
1536
1643
|
}
|
|
1537
1644
|
}
|
|
1538
1645
|
];
|
|
1539
|
-
function
|
|
1540
|
-
return t.disabled === !0 || t.links === !1 ? [] :
|
|
1646
|
+
function Bn(e, t = {}) {
|
|
1647
|
+
return t.disabled === !0 || t.links === !1 ? [] : w(e, zn, Ee(t.locale, t.links ?? {}, zn), (e, t, n) => hn(e, t, n));
|
|
1541
1648
|
}
|
|
1542
1649
|
// ../quality/src/deliverability/messages/de.ts
|
|
1543
|
-
var
|
|
1650
|
+
var Vn = /* @__PURE__ */ e({ default: () => Hn }), Hn = {
|
|
1544
1651
|
"deliverability.link-text-domain-mismatch": {
|
|
1545
1652
|
message: "Der Linktext zeigt {textHost}, der Link führt aber zu {linkHost}. Spamfilter werten solche Links als Phishing.",
|
|
1546
1653
|
suggestion: "Lass den Text zum Ziel passen oder verwende Wörter statt einer Adresse."
|
|
@@ -1557,7 +1664,7 @@ var In = /* @__PURE__ */ e({ default: () => Ln }), Ln = {
|
|
|
1557
1664
|
message: "Diese E-Mail enthält Bilder, aber nur {count} Zeichen Text (weniger als {min}). Manche Spamfilter bewerten bildlastige E-Mails mit wenig Text negativ, und wer Bilder blockiert, sieht fast nichts.",
|
|
1558
1665
|
suggestion: "Ergänze Text, der die Botschaft trägt."
|
|
1559
1666
|
}
|
|
1560
|
-
},
|
|
1667
|
+
}, Un = /* @__PURE__ */ e({ default: () => U }), U = {
|
|
1561
1668
|
"deliverability.link-text-domain-mismatch": {
|
|
1562
1669
|
message: "The link text shows {textHost}, but the link goes to {linkHost}. Spam filters flag links like this as phishing.",
|
|
1563
1670
|
suggestion: "Make the text match the destination, or use words instead of an address."
|
|
@@ -1574,25 +1681,25 @@ var In = /* @__PURE__ */ e({ default: () => Ln }), Ln = {
|
|
|
1574
1681
|
message: "This email has images but only {count} characters of text (under {min}). Some spam filters score image-heavy emails with little text, and readers who block images see almost nothing.",
|
|
1575
1682
|
suggestion: "Add text that carries the message."
|
|
1576
1683
|
}
|
|
1577
|
-
},
|
|
1578
|
-
"./de.ts":
|
|
1579
|
-
"./en.ts":
|
|
1580
|
-
}),
|
|
1581
|
-
for (let e in
|
|
1684
|
+
}, Wn = /* #__PURE__ */ Object.assign({
|
|
1685
|
+
"./de.ts": Vn,
|
|
1686
|
+
"./en.ts": Un
|
|
1687
|
+
}), W = {};
|
|
1688
|
+
for (let e in Wn) {
|
|
1582
1689
|
let t = /\.\/([^/]+)\.ts$/.exec(e);
|
|
1583
1690
|
if (!t) continue;
|
|
1584
1691
|
let n = t[1];
|
|
1585
|
-
n !== "index" && (
|
|
1692
|
+
n !== "index" && (W[n] = Wn[e].default);
|
|
1586
1693
|
}
|
|
1587
|
-
function
|
|
1588
|
-
return
|
|
1694
|
+
function Gn(e) {
|
|
1695
|
+
return W[e.split("-")[0]?.toLowerCase() ?? "en"] ?? W.en ?? U;
|
|
1589
1696
|
}
|
|
1590
|
-
function
|
|
1591
|
-
return
|
|
1697
|
+
function Kn(e, t, n) {
|
|
1698
|
+
return D(Gn(e)[t] ?? U[t], n);
|
|
1592
1699
|
}
|
|
1593
1700
|
// ../quality/src/deliverability/same-site.ts
|
|
1594
|
-
var
|
|
1595
|
-
function
|
|
1701
|
+
var qn = "ac.jp ac.uk co.at co.id co.il co.in co.jp co.kr co.nz co.uk co.za com.ar com.au com.br com.cn com.co com.hk com.mx com.my com.ph com.pl com.sg com.tr com.tw com.ua edu.au go.jp gov.au gov.uk ltd.uk me.uk ne.jp net.au net.br net.cn net.in net.nz or.at or.jp or.kr org.au org.br org.cn org.in org.nz org.uk plc.uk".split(" "), Jn = new Set(qn);
|
|
1702
|
+
function G(e) {
|
|
1596
1703
|
try {
|
|
1597
1704
|
let t = new URL(e);
|
|
1598
1705
|
return (t.protocol === "http:" || t.protocol === "https:") && !/[{}]/.test(t.hostname) ? t : null;
|
|
@@ -1600,41 +1707,41 @@ function H(e) {
|
|
|
1600
1707
|
return null;
|
|
1601
1708
|
}
|
|
1602
1709
|
}
|
|
1603
|
-
function
|
|
1710
|
+
function K(e) {
|
|
1604
1711
|
return e.hostname.toLowerCase().replace(/\.$/, "").replace(/^www\./, "");
|
|
1605
1712
|
}
|
|
1606
|
-
function
|
|
1713
|
+
function Yn(e) {
|
|
1607
1714
|
if (/^\d+\.\d+\.\d+\.\d+$/.test(e) || e.startsWith("[")) return e;
|
|
1608
1715
|
let t = e.split("."), n = t.slice(-2).join(".");
|
|
1609
|
-
return t.slice(-(
|
|
1716
|
+
return t.slice(-(Jn.has(n) ? 3 : 2)).join(".");
|
|
1610
1717
|
}
|
|
1611
|
-
function
|
|
1612
|
-
let n =
|
|
1613
|
-
return !n || !r ? !1 :
|
|
1718
|
+
function Xn(e, t) {
|
|
1719
|
+
let n = G(`http://${e}`), r = G(`http://${t}`);
|
|
1720
|
+
return !n || !r ? !1 : Yn(K(n)) === Yn(K(r));
|
|
1614
1721
|
}
|
|
1615
1722
|
// ../quality/src/deliverability/rules/link-text-domain-mismatch.ts
|
|
1616
|
-
var
|
|
1723
|
+
var Zn = {
|
|
1617
1724
|
id: "deliverability.link-text-domain-mismatch",
|
|
1618
1725
|
reference: "https://docs.rspamd.com/modules/phishing/",
|
|
1619
1726
|
severity: "warning"
|
|
1620
|
-
},
|
|
1621
|
-
function
|
|
1727
|
+
}, Qn = /^(?:https?:\/\/)?(?:[\p{L}\p{N}](?:[\p{L}\p{N}-]*[\p{L}\p{N}])?\.)+(?:\p{L}{2,}|xn--[a-z0-9-]+)(?::\d+)?(?:[/?#][^\s]*)?$/iu;
|
|
1728
|
+
function $n(e) {
|
|
1622
1729
|
if (!e) return null;
|
|
1623
1730
|
let t = e.trim();
|
|
1624
|
-
return t.startsWith("<") && t.endsWith(">") && (t = t.slice(1, -1)), t = t.replace(/[.,;:!?)]+$/, ""),
|
|
1731
|
+
return t.startsWith("<") && t.endsWith(">") && (t = t.slice(1, -1)), t = t.replace(/[.,;:!?)]+$/, ""), Qn.test(t) ? G(/^https?:\/\//i.test(t) ? t : `http://${t}`) : null;
|
|
1625
1732
|
}
|
|
1626
1733
|
// ../quality/src/deliverability/index.ts
|
|
1627
|
-
var
|
|
1734
|
+
var er = [
|
|
1628
1735
|
{
|
|
1629
|
-
meta:
|
|
1736
|
+
meta: Zn,
|
|
1630
1737
|
template(e) {
|
|
1631
1738
|
let t = [];
|
|
1632
|
-
for (let n of
|
|
1739
|
+
for (let n of H(e)) {
|
|
1633
1740
|
if (n.source !== "anchor" && n.source !== "button" && n.source !== "menu-item") continue;
|
|
1634
|
-
let e =
|
|
1741
|
+
let e = $n(n.label), r = G(n.url);
|
|
1635
1742
|
if (!e || !r) continue;
|
|
1636
|
-
let i =
|
|
1637
|
-
|
|
1743
|
+
let i = K(e), a = K(r);
|
|
1744
|
+
Xn(i, a) || t.push({
|
|
1638
1745
|
blockId: n.blockId,
|
|
1639
1746
|
params: {
|
|
1640
1747
|
textHost: i,
|
|
@@ -1653,10 +1760,10 @@ var Yn = [
|
|
|
1653
1760
|
},
|
|
1654
1761
|
template(e, t) {
|
|
1655
1762
|
let n = [];
|
|
1656
|
-
for (let r of
|
|
1657
|
-
let e =
|
|
1763
|
+
for (let r of H(e)) {
|
|
1764
|
+
let e = G(r.url);
|
|
1658
1765
|
if (!e) continue;
|
|
1659
|
-
let i =
|
|
1766
|
+
let i = K(e);
|
|
1660
1767
|
t.deliverability.shortenerHosts.some((e) => i === e || i.endsWith(`.${e}`)) && n.push({
|
|
1661
1768
|
blockId: r.blockId,
|
|
1662
1769
|
params: { host: i }
|
|
@@ -1673,10 +1780,10 @@ var Yn = [
|
|
|
1673
1780
|
},
|
|
1674
1781
|
template(e) {
|
|
1675
1782
|
let t = [];
|
|
1676
|
-
for (let n of
|
|
1677
|
-
let e =
|
|
1783
|
+
for (let n of H(e)) {
|
|
1784
|
+
let e = G(n.url);
|
|
1678
1785
|
if (!e) continue;
|
|
1679
|
-
let r =
|
|
1786
|
+
let r = K(e), i = /^(?:\d{1,3}\.){3}\d{1,3}$/.test(r), a = r.startsWith("[") && r.endsWith("]");
|
|
1680
1787
|
(i || a) && (r.startsWith("127.") || r === "0.0.0.0" || r === "[::1]" || t.push({
|
|
1681
1788
|
blockId: n.blockId,
|
|
1682
1789
|
params: { host: r }
|
|
@@ -1692,27 +1799,27 @@ var Yn = [
|
|
|
1692
1799
|
severity: "info"
|
|
1693
1800
|
},
|
|
1694
1801
|
template(e, t) {
|
|
1695
|
-
let n = !1,
|
|
1696
|
-
if (
|
|
1697
|
-
if (e.type === "custom" && (n = !0), (
|
|
1698
|
-
if (
|
|
1699
|
-
}), n || !
|
|
1700
|
-
let
|
|
1701
|
-
return
|
|
1802
|
+
let n = !1, r = !1, i = [];
|
|
1803
|
+
if (C(e, (e) => {
|
|
1804
|
+
if (e.type === "custom" && (n = !0), (m(e) && e.src.trim() !== "" || ie(e) || re(e)) && (r = !0), (s(e) || u(e) || le(e)) && i.push(M(e.content)), a(e)) for (let t of e.rows) for (let e of t.cells) i.push(M(e.content));
|
|
1805
|
+
if (h(e) && i.push(e.text), v(e)) for (let t of e.items) i.push(t.text);
|
|
1806
|
+
}), n || !r) return [];
|
|
1807
|
+
let o = i.join(" ").replace(/\s+/g, " ").trim().length, c = t.deliverability.minTextLength;
|
|
1808
|
+
return o < c ? [{
|
|
1702
1809
|
blockId: null,
|
|
1703
1810
|
params: {
|
|
1704
|
-
count:
|
|
1811
|
+
count: o,
|
|
1705
1812
|
min: c
|
|
1706
1813
|
}
|
|
1707
1814
|
}] : [];
|
|
1708
1815
|
}
|
|
1709
1816
|
}
|
|
1710
1817
|
];
|
|
1711
|
-
function
|
|
1712
|
-
return t.disabled === !0 || t.deliverability === !1 ? [] :
|
|
1818
|
+
function tr(e, t = {}) {
|
|
1819
|
+
return t.disabled === !0 || t.deliverability === !1 ? [] : w(e, er, Se(t.locale, t.deliverability ?? {}, er), (e, t, n) => Kn(e, t, n));
|
|
1713
1820
|
}
|
|
1714
1821
|
// ../quality/src/compatibility/data/caniemail.generated.ts
|
|
1715
|
-
var
|
|
1822
|
+
var nr = {
|
|
1716
1823
|
family: {
|
|
1717
1824
|
gmail: "Gmail",
|
|
1718
1825
|
outlook: "Outlook",
|
|
@@ -1749,7 +1856,7 @@ var Zn = {
|
|
|
1749
1856
|
"windows-mail": "Windows Mail",
|
|
1750
1857
|
"outlook-com": "Outlook.com"
|
|
1751
1858
|
}
|
|
1752
|
-
},
|
|
1859
|
+
}, rr = {
|
|
1753
1860
|
"css-display-flex": {
|
|
1754
1861
|
title: "display:flex",
|
|
1755
1862
|
url: "https://www.caniemail.com/features/css-display-flex/",
|
|
@@ -3780,7 +3887,7 @@ var Zn = {
|
|
|
3780
3887
|
}
|
|
3781
3888
|
}
|
|
3782
3889
|
}
|
|
3783
|
-
},
|
|
3890
|
+
}, ir = [
|
|
3784
3891
|
"css-display-flex",
|
|
3785
3892
|
"css-display-grid",
|
|
3786
3893
|
"css-position",
|
|
@@ -3800,7 +3907,7 @@ var Zn = {
|
|
|
3800
3907
|
"image-base64"
|
|
3801
3908
|
];
|
|
3802
3909
|
// ../quality/src/compatibility/scan.ts
|
|
3803
|
-
function
|
|
3910
|
+
function ar(e) {
|
|
3804
3911
|
let t = "", n = 0;
|
|
3805
3912
|
for (;;) {
|
|
3806
3913
|
let r = e.indexOf("/*", n);
|
|
@@ -3811,7 +3918,7 @@ function er(e) {
|
|
|
3811
3918
|
n = i + 2;
|
|
3812
3919
|
}
|
|
3813
3920
|
}
|
|
3814
|
-
function
|
|
3921
|
+
function q(e) {
|
|
3815
3922
|
let t = e.toLowerCase(), n = (e, n) => {
|
|
3816
3923
|
let r = t.indexOf(e, n);
|
|
3817
3924
|
return r === -1 ? Infinity : r;
|
|
@@ -3845,8 +3952,8 @@ function W(e) {
|
|
|
3845
3952
|
o = l + 1;
|
|
3846
3953
|
}
|
|
3847
3954
|
}
|
|
3848
|
-
function
|
|
3849
|
-
let a = [], o =
|
|
3955
|
+
function or(e, t, n, r, i) {
|
|
3956
|
+
let a = [], o = ar(e).replace(/data:([\w.+-]+\/[\w.+-]+)[^)"']*/gi, "data:$1");
|
|
3850
3957
|
for (let e of o.matchAll(/(?:^|[;{])\s*([\w-]+)\s*:\s*([^;}]+)/g)) a.push({
|
|
3851
3958
|
prop: e[1].toLowerCase(),
|
|
3852
3959
|
value: e[2].trim(),
|
|
@@ -3857,19 +3964,19 @@ function tr(e, t, n, r, i) {
|
|
|
3857
3964
|
});
|
|
3858
3965
|
return a;
|
|
3859
3966
|
}
|
|
3860
|
-
function
|
|
3967
|
+
function sr(e, t = "", n = []) {
|
|
3861
3968
|
let r = {
|
|
3862
3969
|
tags: [],
|
|
3863
3970
|
css: [],
|
|
3864
3971
|
cssTexts: [],
|
|
3865
3972
|
urls: [...n]
|
|
3866
3973
|
}, i = !1, a = "", o = 0, s = (e, t, n, i) => {
|
|
3867
|
-
r.cssTexts.push(
|
|
3974
|
+
r.cssTexts.push(ar(e));
|
|
3868
3975
|
let a = o++;
|
|
3869
|
-
if (i) r.css.push(...
|
|
3870
|
-
else for (let [i, o] of e.split("}").entries()) r.css.push(...
|
|
3976
|
+
if (i) r.css.push(...or(e, t, n, !0, `${a}`));
|
|
3977
|
+
else for (let [i, o] of e.split("}").entries()) r.css.push(...or(o, t, n, !1, `${a}:${i}`));
|
|
3871
3978
|
};
|
|
3872
|
-
return new
|
|
3979
|
+
return new y({
|
|
3873
3980
|
onopentag(e, t) {
|
|
3874
3981
|
r.tags.push({
|
|
3875
3982
|
tag: e,
|
|
@@ -3884,7 +3991,7 @@ function nr(e, t = "", n = []) {
|
|
|
3884
3991
|
}
|
|
3885
3992
|
}, { decodeEntities: !0 }).end(e), t && s(t, "stylesheet", {}, !1), r;
|
|
3886
3993
|
}
|
|
3887
|
-
function
|
|
3994
|
+
function cr(e) {
|
|
3888
3995
|
let t = [], n = [], r = [];
|
|
3889
3996
|
switch (e.type) {
|
|
3890
3997
|
case "html":
|
|
@@ -3909,15 +4016,15 @@ function rr(e) {
|
|
|
3909
4016
|
break;
|
|
3910
4017
|
case "wrapper": e.backgroundImage && r.push(e.backgroundImage.url);
|
|
3911
4018
|
}
|
|
3912
|
-
return
|
|
4019
|
+
return sr(t.join("\n"), n.join("\n"), r);
|
|
3913
4020
|
}
|
|
3914
4021
|
// ../quality/src/compatibility/detect.ts
|
|
3915
|
-
var
|
|
3916
|
-
function
|
|
4022
|
+
var lr = (e) => e.replace(/\s+/g, " ").trim().slice(0, 80), J = ({ prop: e, value: t }) => lr(`${e}: ${t}`), ur = (e) => `<${e}>`, dr = /#[0-9a-f]{3,8}\b|\b(?:rgba?|hsla?)\(/i;
|
|
4023
|
+
function fr(e) {
|
|
3917
4024
|
let t = /^\s*data:(image\/[\w.+-]+)/i.exec(e);
|
|
3918
4025
|
return t ? t[1].toLowerCase() : null;
|
|
3919
4026
|
}
|
|
3920
|
-
function
|
|
4027
|
+
function pr(e) {
|
|
3921
4028
|
let t = /* @__PURE__ */ new Map();
|
|
3922
4029
|
for (let n of e.css) {
|
|
3923
4030
|
let e = n.group;
|
|
@@ -3925,27 +4032,27 @@ function cr(e) {
|
|
|
3925
4032
|
}
|
|
3926
4033
|
for (let e of t.values()) {
|
|
3927
4034
|
let t = e.find((e) => (e.prop === "background" || e.prop === "background-image") && /url\(/i.test(e.value));
|
|
3928
|
-
if (!(!t || "bgcolor" in t.attrs) && !e.some((e) => e.prop === "background-color" || e.prop === "background" &&
|
|
4035
|
+
if (!(!t || "bgcolor" in t.attrs) && !e.some((e) => e.prop === "background-color" || e.prop === "background" && dr.test(q(e.value)))) return t;
|
|
3929
4036
|
}
|
|
3930
4037
|
}
|
|
3931
|
-
function
|
|
4038
|
+
function mr(e, t) {
|
|
3932
4039
|
let n = e.css, r = e.tags, i, a;
|
|
3933
4040
|
switch (t) {
|
|
3934
4041
|
case "compat.css-display-flex":
|
|
3935
4042
|
case "compat.css-display-grid": {
|
|
3936
4043
|
let e = t.endsWith("flex") ? "flex" : "grid";
|
|
3937
4044
|
return i = n.find((t) => t.prop === "display" && RegExp(`^(?:inline-)?${e}\\b`, "i").test(t.value)), i ? {
|
|
3938
|
-
excerpt:
|
|
4045
|
+
excerpt: J(i),
|
|
3939
4046
|
usage: i.value.match(/^(?:inline-)?(?:flex|grid)/i)?.[0].toLowerCase()
|
|
3940
4047
|
} : null;
|
|
3941
4048
|
}
|
|
3942
4049
|
case "compat.css-position": return i = n.find((e) => e.prop === "position" && /^(absolute|fixed|sticky)\b/i.test(e.value)), i ? {
|
|
3943
|
-
excerpt:
|
|
4050
|
+
excerpt: J(i),
|
|
3944
4051
|
usage: i.value.match(/^\w+/)?.[0].toLowerCase(),
|
|
3945
4052
|
value: i.value.match(/^\w+/)?.[0].toLowerCase()
|
|
3946
4053
|
} : null;
|
|
3947
|
-
case "compat.css-variables": return i = n.find((e) => /\bvar\(\s*--/i.test(
|
|
3948
|
-
case "compat.css-at-import": return e.cssTexts.some((e) => /@import\b/i.test(
|
|
4054
|
+
case "compat.css-variables": return i = n.find((e) => /\bvar\(\s*--/i.test(q(e.value))), i ? { excerpt: J(i) } : null;
|
|
4055
|
+
case "compat.css-at-import": return e.cssTexts.some((e) => /@import\b/i.test(q(e))) ? { excerpt: "@import" } : null;
|
|
3949
4056
|
case "compat.html-link": return r.some((e) => e.tag === "link" && /(?:^|\s)stylesheet(?:\s|$)/i.test(e.attrs.rel ?? "")) ? { excerpt: "<link rel=\"stylesheet\">" } : null;
|
|
3950
4057
|
case "compat.html-style":
|
|
3951
4058
|
case "compat.html-svg":
|
|
@@ -3953,33 +4060,33 @@ function lr(e, t) {
|
|
|
3953
4060
|
case "compat.html-video":
|
|
3954
4061
|
case "compat.html-audio":
|
|
3955
4062
|
case "compat.html-script":
|
|
3956
|
-
case "compat.html-iframe": return a = t.slice(12), r.some((e) => e.tag === a) ? { excerpt:
|
|
4063
|
+
case "compat.html-iframe": return a = t.slice(12), r.some((e) => e.tag === a) ? { excerpt: ur(a) } : null;
|
|
3957
4064
|
case "compat.html-form": return a = r.find((e) => [
|
|
3958
4065
|
"form",
|
|
3959
4066
|
"input",
|
|
3960
4067
|
"select",
|
|
3961
4068
|
"textarea"
|
|
3962
|
-
].includes(e.tag))?.tag, a ? { excerpt:
|
|
4069
|
+
].includes(e.tag))?.tag, a ? { excerpt: ur(a) } : null;
|
|
3963
4070
|
case "compat.css-width": return i = n.find((e) => e.inline && e.prop === "width" && ([
|
|
3964
4071
|
"div",
|
|
3965
4072
|
"p",
|
|
3966
4073
|
"span",
|
|
3967
4074
|
"body"
|
|
3968
4075
|
].includes(e.tag) || e.tag === "img" && !("width" in e.attrs))), i ? {
|
|
3969
|
-
excerpt:
|
|
4076
|
+
excerpt: J(i),
|
|
3970
4077
|
tag: i.tag
|
|
3971
4078
|
} : null;
|
|
3972
4079
|
case "compat.css-max-width": return i = n.find((e) => e.inline && e.prop === "max-width" && e.tag !== "table"), i ? {
|
|
3973
|
-
excerpt:
|
|
4080
|
+
excerpt: J(i),
|
|
3974
4081
|
tag: i.tag
|
|
3975
4082
|
} : null;
|
|
3976
4083
|
case "compat.css-float": return i = n.find((e) => e.prop === "float"), i ? {
|
|
3977
|
-
excerpt:
|
|
4084
|
+
excerpt: J(i),
|
|
3978
4085
|
tag: i.tag
|
|
3979
4086
|
} : null;
|
|
3980
|
-
case "compat.css-background-image": return i =
|
|
4087
|
+
case "compat.css-background-image": return i = pr(e), i ? { excerpt: J(i) } : null;
|
|
3981
4088
|
case "compat.image-base64": {
|
|
3982
|
-
let t = e.cssTexts.flatMap((e) => [...e.matchAll(/url\(\s*['"]?\s*(data:image\/[\w.+-]+)/gi)].map((e) => e[1])), n = [...e.urls, ...t].map(
|
|
4089
|
+
let t = e.cssTexts.flatMap((e) => [...e.matchAll(/url\(\s*['"]?\s*(data:image\/[\w.+-]+)/gi)].map((e) => e[1])), n = [...e.urls, ...t].map(fr).find((e) => e !== null);
|
|
3983
4090
|
return n ? {
|
|
3984
4091
|
excerpt: `data:${n}`,
|
|
3985
4092
|
usage: n
|
|
@@ -3989,14 +4096,14 @@ function lr(e, t) {
|
|
|
3989
4096
|
}
|
|
3990
4097
|
}
|
|
3991
4098
|
// ../quality/src/compatibility/support.ts
|
|
3992
|
-
var
|
|
4099
|
+
var hr = rr, gr = [
|
|
3993
4100
|
"gmail",
|
|
3994
4101
|
"outlook",
|
|
3995
4102
|
"apple-mail",
|
|
3996
4103
|
"yahoo",
|
|
3997
4104
|
"samsung-email"
|
|
3998
|
-
],
|
|
3999
|
-
function
|
|
4105
|
+
], Y = nr.family, _r = nr.platform;
|
|
4106
|
+
function vr(e, t, n) {
|
|
4000
4107
|
switch (e) {
|
|
4001
4108
|
case "css-display-flex": return t === 2 && n === "inline-flex";
|
|
4002
4109
|
case "css-position": {
|
|
@@ -4015,14 +4122,14 @@ function pr(e, t, n) {
|
|
|
4015
4122
|
default: return !1;
|
|
4016
4123
|
}
|
|
4017
4124
|
}
|
|
4018
|
-
function
|
|
4019
|
-
let n =
|
|
4125
|
+
function yr(e, t = "") {
|
|
4126
|
+
let n = hr[e];
|
|
4020
4127
|
if (!n) return [];
|
|
4021
4128
|
let r = [];
|
|
4022
4129
|
for (let [i, a] of Object.entries(n.cells)) {
|
|
4023
|
-
let o = i.indexOf("."), s = i.slice(0, o), c = i.slice(o + 1), l = a.notes.some((n) =>
|
|
4130
|
+
let o = i.indexOf("."), s = i.slice(0, o), c = i.slice(o + 1), l = a.notes.some((n) => vr(e, n, t)) || a.value === "n" ? "unsupported" : a.value === "a" ? "partial" : null;
|
|
4024
4131
|
if (!l) continue;
|
|
4025
|
-
let u =
|
|
4132
|
+
let u = Y[s] ?? s, d = _r[c] ?? c;
|
|
4026
4133
|
r.push({
|
|
4027
4134
|
id: i,
|
|
4028
4135
|
name: d.toLowerCase().includes(u.toLowerCase()) ? d : `${u} ${d}`,
|
|
@@ -4033,23 +4140,23 @@ function mr(e, t = "") {
|
|
|
4033
4140
|
}
|
|
4034
4141
|
return r;
|
|
4035
4142
|
}
|
|
4036
|
-
function
|
|
4143
|
+
function br(e, t, n) {
|
|
4037
4144
|
let r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map();
|
|
4038
4145
|
for (let n of e) {
|
|
4039
4146
|
let e = n.id.split(".")[0];
|
|
4040
4147
|
r.set(e, [...r.get(e) ?? [], n]), n.support === t && i.set(e, [...i.get(e) ?? [], n]);
|
|
4041
4148
|
}
|
|
4042
4149
|
let a = [...i.keys()].sort((e, t) => {
|
|
4043
|
-
let n =
|
|
4044
|
-
return n === r ? (
|
|
4150
|
+
let n = gr.indexOf(e), r = gr.indexOf(t);
|
|
4151
|
+
return n === r ? (Y[e] ?? e).localeCompare(Y[t] ?? t) : (n < 0 ? Infinity : n) - (r < 0 ? Infinity : r);
|
|
4045
4152
|
}).map((e) => {
|
|
4046
|
-
let t =
|
|
4047
|
-
return n.length === r.get(e).length ? t : `${t} (${n.map((e) =>
|
|
4153
|
+
let t = Y[e] ?? e, n = i.get(e);
|
|
4154
|
+
return n.length === r.get(e).length ? t : `${t} (${n.map((e) => _r[e.id.split(".")[1]] ?? e.name).join(", ")})`;
|
|
4048
4155
|
}), o = a.slice(0, 4);
|
|
4049
4156
|
return a.length > 4 && o.push(`${a.length - 4} ${n.startsWith("de") ? "weitere" : "more"}`), new Intl.ListFormat(n.startsWith("de") ? "de" : "en", { type: "conjunction" }).format(o);
|
|
4050
4157
|
}
|
|
4051
4158
|
// ../quality/src/compatibility/messages/de.ts
|
|
4052
|
-
var
|
|
4159
|
+
var xr = /* @__PURE__ */ e({ default: () => Sr }), Sr = {
|
|
4053
4160
|
templates: {
|
|
4054
4161
|
unsupported: "{feature} funktioniert in {unsupported} nicht.",
|
|
4055
4162
|
partial: "{feature} funktioniert in {partial} nur teilweise.",
|
|
@@ -4140,7 +4247,7 @@ var gr = /* @__PURE__ */ e({ default: () => _r }), _r = {
|
|
|
4140
4247
|
suggestion: "Bleibe unter {max} KB: Kürze den Inhalt, verschiebe lange Abschnitte auf eine Webseite oder ersetze Base64-Bilder durch gehostete Bilder."
|
|
4141
4248
|
}
|
|
4142
4249
|
}
|
|
4143
|
-
},
|
|
4250
|
+
}, Cr = /* @__PURE__ */ e({ default: () => wr }), wr = {
|
|
4144
4251
|
templates: {
|
|
4145
4252
|
unsupported: "{feature} doesn't work in {unsupported}.",
|
|
4146
4253
|
partial: "{feature} only partly works in {partial}.",
|
|
@@ -4231,24 +4338,24 @@ var gr = /* @__PURE__ */ e({ default: () => _r }), _r = {
|
|
|
4231
4338
|
suggestion: "Bring it under {max} KB: shorten the content, move long sections to a web page, or replace base64 images with hosted ones."
|
|
4232
4339
|
}
|
|
4233
4340
|
}
|
|
4234
|
-
},
|
|
4235
|
-
"./de.ts":
|
|
4236
|
-
"./en.ts":
|
|
4237
|
-
}),
|
|
4238
|
-
for (let e in
|
|
4239
|
-
function
|
|
4240
|
-
return
|
|
4341
|
+
}, Tr = /* #__PURE__ */ Object.assign({
|
|
4342
|
+
"./de.ts": xr,
|
|
4343
|
+
"./en.ts": Cr
|
|
4344
|
+
}), X = {};
|
|
4345
|
+
for (let e in Tr) X[e.slice(2, -3)] = Tr[e].default;
|
|
4346
|
+
function Er(e) {
|
|
4347
|
+
return X[e.split("-")[0]?.toLowerCase() ?? "en"] ?? X.en ?? wr;
|
|
4241
4348
|
}
|
|
4242
|
-
function
|
|
4243
|
-
let r =
|
|
4244
|
-
if (i) return
|
|
4349
|
+
function Dr(e, t, n = {}) {
|
|
4350
|
+
let r = Er(e), i = r.hand[t];
|
|
4351
|
+
if (i) return D(i, n);
|
|
4245
4352
|
let a = t.slice(7), o = r.features[a];
|
|
4246
4353
|
if (!o) throw Error(`Missing compatibility message: ${t}`);
|
|
4247
|
-
let s = n.unsupported && n.partial ? "mixed" : n.unsupported ? "unsupported" : "partial", c =
|
|
4354
|
+
let s = n.unsupported && n.partial ? "mixed" : n.unsupported ? "unsupported" : "partial", c = D({
|
|
4248
4355
|
message: o.feature,
|
|
4249
4356
|
suggestion: o.suggestion
|
|
4250
4357
|
}, n);
|
|
4251
|
-
return
|
|
4358
|
+
return D({
|
|
4252
4359
|
message: r.templates[s],
|
|
4253
4360
|
suggestion: c.suggestion
|
|
4254
4361
|
}, {
|
|
@@ -4257,22 +4364,22 @@ function Sr(e, t, n = {}) {
|
|
|
4257
4364
|
});
|
|
4258
4365
|
}
|
|
4259
4366
|
// ../quality/src/compatibility/index.ts
|
|
4260
|
-
var
|
|
4261
|
-
|
|
4367
|
+
var Or = "https://docs.templatical.com/quality/compatibility/rule-catalog", kr = ["html-script", "html-iframe"], Z = [
|
|
4368
|
+
...ir.map((e) => ({ meta: {
|
|
4262
4369
|
id: `compat.${e}`,
|
|
4263
4370
|
severity: "warning",
|
|
4264
|
-
reference:
|
|
4371
|
+
reference: rr[e].url
|
|
4265
4372
|
} })),
|
|
4266
|
-
...
|
|
4373
|
+
...kr.map((e) => ({ meta: {
|
|
4267
4374
|
id: `compat.${e}`,
|
|
4268
4375
|
severity: "warning",
|
|
4269
|
-
reference: `${
|
|
4376
|
+
reference: `${Or}#compat-${e}`
|
|
4270
4377
|
} })),
|
|
4271
4378
|
{
|
|
4272
4379
|
meta: {
|
|
4273
4380
|
id: "compat.gmail-clipping",
|
|
4274
4381
|
severity: "warning",
|
|
4275
|
-
reference: `${
|
|
4382
|
+
reference: `${Or}#compat-gmail-clipping`
|
|
4276
4383
|
},
|
|
4277
4384
|
compiledHtml(e, t) {
|
|
4278
4385
|
let n = new TextEncoder().encode(e).byteLength;
|
|
@@ -4292,27 +4399,27 @@ var Cr = "https://docs.templatical.com/quality/compatibility/rule-catalog", wr =
|
|
|
4292
4399
|
}
|
|
4293
4400
|
}
|
|
4294
4401
|
];
|
|
4295
|
-
function
|
|
4296
|
-
let r = n.compatibility || {}, i =
|
|
4297
|
-
for (let n of
|
|
4402
|
+
function Ar(e, t, n) {
|
|
4403
|
+
let r = n.compatibility || {}, i = Ce(n.locale, r, Z), a = [];
|
|
4404
|
+
for (let n of Z) {
|
|
4298
4405
|
let o = n.meta.id;
|
|
4299
4406
|
if (o === "compat.gmail-clipping" || i.severity(o) === "off") continue;
|
|
4300
|
-
let s =
|
|
4407
|
+
let s = mr(e, o);
|
|
4301
4408
|
if (!s) continue;
|
|
4302
|
-
let c = o === "compat.html-script" || o === "compat.html-iframe", l = c ? void 0 :
|
|
4409
|
+
let c = o === "compat.html-script" || o === "compat.html-iframe", l = c ? void 0 : yr(o.slice(7), s.usage);
|
|
4303
4410
|
if (!c && l?.length === 0) continue;
|
|
4304
|
-
let u = l?.some((e) => e.support === "unsupported") ?? !0, d = u ? "warning" : "info", f = r.rules?.[o],
|
|
4411
|
+
let u = l?.some((e) => e.support === "unsupported") ?? !0, d = u ? "warning" : "info", f = r.rules?.[o], ee = f && f !== "off" ? f : d, p = {
|
|
4305
4412
|
excerpt: s.excerpt,
|
|
4306
4413
|
value: s.value ?? "",
|
|
4307
4414
|
tag: s.tag ?? ""
|
|
4308
4415
|
};
|
|
4309
|
-
l && (u && (
|
|
4310
|
-
let
|
|
4416
|
+
l && (u && (p.unsupported = br(l, "unsupported", i.locale)), l.some((e) => e.support === "partial") && (p.partial = br(l, "partial", i.locale)));
|
|
4417
|
+
let m = Dr(i.locale, o, p);
|
|
4311
4418
|
a.push({
|
|
4312
4419
|
blockId: t,
|
|
4313
4420
|
ruleId: o,
|
|
4314
|
-
severity:
|
|
4315
|
-
...
|
|
4421
|
+
severity: ee,
|
|
4422
|
+
...m,
|
|
4316
4423
|
reference: n.meta.reference,
|
|
4317
4424
|
...l ? { clients: l } : {},
|
|
4318
4425
|
excerpt: s.excerpt
|
|
@@ -4320,27 +4427,27 @@ function Tr(e, t, n) {
|
|
|
4320
4427
|
}
|
|
4321
4428
|
return a;
|
|
4322
4429
|
}
|
|
4323
|
-
function
|
|
4430
|
+
function jr(e, t = {}) {
|
|
4324
4431
|
if (t.disabled === !0 || t.compatibility === !1) return [];
|
|
4325
4432
|
let n = [], r = /* @__PURE__ */ new WeakMap();
|
|
4326
|
-
return
|
|
4433
|
+
return C(e, (e) => {
|
|
4327
4434
|
let i = r.get(e);
|
|
4328
|
-
i || (i =
|
|
4435
|
+
i || (i = cr(e), r.set(e, i)), n.push(...Ar(i, e.id, t));
|
|
4329
4436
|
}), n;
|
|
4330
4437
|
}
|
|
4331
|
-
function
|
|
4438
|
+
function Mr(e, t = {}) {
|
|
4332
4439
|
if (t.disabled === !0 || t.compatibility === !1) return [];
|
|
4333
|
-
let n =
|
|
4440
|
+
let n = Ce(t.locale, t.compatibility || {}, Z), r = Z.find((e) => e.meta.id === "compat.gmail-clipping"), i = n.severity(r.meta.id);
|
|
4334
4441
|
return i === "off" ? [] : r.compiledHtml(e, n).map((e) => ({
|
|
4335
4442
|
blockId: null,
|
|
4336
4443
|
ruleId: r.meta.id,
|
|
4337
4444
|
severity: i,
|
|
4338
|
-
...
|
|
4445
|
+
...Dr(n.locale, r.meta.id, e.params),
|
|
4339
4446
|
reference: r.meta.reference
|
|
4340
4447
|
}));
|
|
4341
4448
|
}
|
|
4342
4449
|
// ../quality/src/localization/messages/de.ts
|
|
4343
|
-
var
|
|
4450
|
+
var Nr = /* @__PURE__ */ e({ default: () => Pr }), Pr = {
|
|
4344
4451
|
"localization.untranslated": {
|
|
4345
4452
|
message: "Das Feld {field} hat keine Übersetzung.",
|
|
4346
4453
|
suggestion: "Übersetze {field} oder verwende die Standardsprache als Fallback."
|
|
@@ -4353,7 +4460,7 @@ var Or = /* @__PURE__ */ e({ default: () => kr }), kr = {
|
|
|
4353
4460
|
message: "Die Merge-Tags in {field} weichen von der Standardsprache ab.",
|
|
4354
4461
|
suggestion: "Verwende in {field} dieselben Merge-Tags mit derselben Anzahl an Vorkommen."
|
|
4355
4462
|
}
|
|
4356
|
-
},
|
|
4463
|
+
}, Fr = /* @__PURE__ */ e({ default: () => Q }), Q = {
|
|
4357
4464
|
"localization.untranslated": {
|
|
4358
4465
|
message: "The field {field} has no translation.",
|
|
4359
4466
|
suggestion: "Translate {field}, or keep the default language as a fallback."
|
|
@@ -4366,34 +4473,34 @@ var Or = /* @__PURE__ */ e({ default: () => kr }), kr = {
|
|
|
4366
4473
|
message: "The merge tags in {field} differ from the default language.",
|
|
4367
4474
|
suggestion: "Keep the same merge tags and occurrence counts in {field}."
|
|
4368
4475
|
}
|
|
4369
|
-
},
|
|
4370
|
-
"./de.ts":
|
|
4371
|
-
"./en.ts":
|
|
4372
|
-
}),
|
|
4373
|
-
for (let e in
|
|
4476
|
+
}, Ir = /* #__PURE__ */ Object.assign({
|
|
4477
|
+
"./de.ts": Nr,
|
|
4478
|
+
"./en.ts": Fr
|
|
4479
|
+
}), $ = {};
|
|
4480
|
+
for (let e in Ir) {
|
|
4374
4481
|
let t = /\.\/([^/]+)\.ts$/.exec(e);
|
|
4375
4482
|
if (!t) continue;
|
|
4376
4483
|
let n = t[1];
|
|
4377
|
-
n !== "index" && (
|
|
4484
|
+
n !== "index" && ($[n] = Ir[e].default);
|
|
4378
4485
|
}
|
|
4379
|
-
function
|
|
4380
|
-
return
|
|
4486
|
+
function Lr(e) {
|
|
4487
|
+
return $[e.split("-")[0]?.toLowerCase() ?? "en"] ?? $.en ?? Q;
|
|
4381
4488
|
}
|
|
4382
|
-
function
|
|
4383
|
-
return
|
|
4489
|
+
function Rr(e, t, n) {
|
|
4490
|
+
return D(Lr(e)[t] ?? Q[t], n);
|
|
4384
4491
|
}
|
|
4385
4492
|
// ../quality/src/localization/rules.ts
|
|
4386
|
-
function
|
|
4493
|
+
function zr(e, n) {
|
|
4387
4494
|
let r = /* @__PURE__ */ new Map();
|
|
4388
|
-
|
|
4389
|
-
for (let i of
|
|
4495
|
+
C(e, (e) => {
|
|
4496
|
+
for (let i of t(e, n.customBlocks)) r.set(`${e.id}/${i}`, {
|
|
4390
4497
|
blockId: e.id,
|
|
4391
4498
|
field: i,
|
|
4392
4499
|
target: e,
|
|
4393
|
-
format: e.type === "html" ||
|
|
4500
|
+
format: e.type === "html" || c[e.type]?.includes(i) ? "html" : "text"
|
|
4394
4501
|
});
|
|
4395
4502
|
});
|
|
4396
|
-
for (let t of
|
|
4503
|
+
for (let t of l) r.set(`settings/${t}`, {
|
|
4397
4504
|
blockId: null,
|
|
4398
4505
|
field: t,
|
|
4399
4506
|
target: e.settings,
|
|
@@ -4401,39 +4508,51 @@ function Z(e, n) {
|
|
|
4401
4508
|
});
|
|
4402
4509
|
return r;
|
|
4403
4510
|
}
|
|
4404
|
-
function
|
|
4511
|
+
function Br({ blockId: e, field: t }) {
|
|
4405
4512
|
return {
|
|
4406
4513
|
blockId: e,
|
|
4407
4514
|
params: { field: t }
|
|
4408
4515
|
};
|
|
4409
4516
|
}
|
|
4410
|
-
function
|
|
4411
|
-
return
|
|
4517
|
+
function Vr(e, t) {
|
|
4518
|
+
return o(e, t.contentLocale, t.customBlocks);
|
|
4412
4519
|
}
|
|
4413
|
-
function
|
|
4520
|
+
function Hr(e, t, n) {
|
|
4414
4521
|
let r = [], i = "\0MT";
|
|
4415
4522
|
for (; e.includes(i);) i += "_";
|
|
4416
|
-
let a = n === "html" ?
|
|
4523
|
+
let a = n === "html" ? se(e, (e) => {
|
|
4417
4524
|
let t = r.push(e) - 1;
|
|
4418
4525
|
return `${i}${t}\u0000`;
|
|
4419
4526
|
}) : e, o = Array.from(a.matchAll(RegExp(`${i}\\d+\u0000`, "g")), (e) => ({
|
|
4420
4527
|
start: e.index,
|
|
4421
4528
|
end: e.index + e[0].length
|
|
4422
|
-
})), s = [];
|
|
4423
|
-
for (let e of [
|
|
4424
|
-
let
|
|
4425
|
-
for (let
|
|
4426
|
-
let t =
|
|
4427
|
-
|
|
4428
|
-
|
|
4429
|
-
|
|
4430
|
-
|
|
4431
|
-
|
|
4529
|
+
})), s = [], c = oe(a, t, "logic"), l = [], u = 0;
|
|
4530
|
+
for (let e of ["logic", "value"]) {
|
|
4531
|
+
let r = 0;
|
|
4532
|
+
for (let i of e === "logic" ? c : oe(a, t, "value")) {
|
|
4533
|
+
let t = i.index, a = t + i.value.length;
|
|
4534
|
+
for (; o[r]?.end <= t;) r++;
|
|
4535
|
+
let c = o[r];
|
|
4536
|
+
if (!(c && t < c.end && a > c.start)) {
|
|
4537
|
+
if (e === "value") {
|
|
4538
|
+
for (; l[u]?.end <= t;) u++;
|
|
4539
|
+
let e = l[u];
|
|
4540
|
+
if (e && t < e.end && a > e.start) continue;
|
|
4541
|
+
}
|
|
4542
|
+
e === "logic" && l.push({
|
|
4543
|
+
start: t,
|
|
4544
|
+
end: a
|
|
4545
|
+
}), s.push({
|
|
4546
|
+
start: t,
|
|
4547
|
+
end: a,
|
|
4548
|
+
value: n === "html" ? _(i.value) : i.value
|
|
4549
|
+
});
|
|
4550
|
+
}
|
|
4432
4551
|
}
|
|
4433
4552
|
}
|
|
4434
4553
|
return [...r, ...s.map((e) => e.value)].sort();
|
|
4435
4554
|
}
|
|
4436
|
-
var
|
|
4555
|
+
var Ur = [
|
|
4437
4556
|
{
|
|
4438
4557
|
meta: {
|
|
4439
4558
|
id: "localization.untranslated",
|
|
@@ -4441,8 +4560,8 @@ var Fr = [
|
|
|
4441
4560
|
reference: "https://docs.templatical.com/guide/localized-templates#missing-values"
|
|
4442
4561
|
},
|
|
4443
4562
|
template: (e, t) => {
|
|
4444
|
-
let n =
|
|
4445
|
-
return
|
|
4563
|
+
let n = zr(e, t);
|
|
4564
|
+
return Vr(e, t).missing.map((e) => Br(n.get(e)));
|
|
4446
4565
|
}
|
|
4447
4566
|
},
|
|
4448
4567
|
{
|
|
@@ -4452,8 +4571,8 @@ var Fr = [
|
|
|
4452
4571
|
reference: "https://docs.templatical.com/guide/localized-templates#out-of-date-values"
|
|
4453
4572
|
},
|
|
4454
4573
|
template: (e, t) => {
|
|
4455
|
-
let n =
|
|
4456
|
-
return
|
|
4574
|
+
let n = zr(e, t);
|
|
4575
|
+
return Vr(e, t).stale.map((e) => Br(n.get(e)));
|
|
4457
4576
|
}
|
|
4458
4577
|
},
|
|
4459
4578
|
{
|
|
@@ -4463,22 +4582,22 @@ var Fr = [
|
|
|
4463
4582
|
reference: "https://docs.templatical.com/guide/localized-templates#merge-tags"
|
|
4464
4583
|
},
|
|
4465
4584
|
template: (e, t) => {
|
|
4466
|
-
let n =
|
|
4585
|
+
let n = zr(e, t), r = Vr(e, t), i = ne(t.mergeTagSyntax);
|
|
4467
4586
|
return [...r.translated, ...r.stale].flatMap((e) => {
|
|
4468
|
-
let r = n.get(e), { target: a, field: o, format:
|
|
4469
|
-
return typeof
|
|
4587
|
+
let r = n.get(e), { target: a, field: o, format: s } = r, c = f(a, o), l = a?.l10n?.[t.contentLocale]?.text?.[o]?.value;
|
|
4588
|
+
return typeof c != "string" || l === void 0 || JSON.stringify(Hr(c, i, s)) === JSON.stringify(Hr(l, i, s)) ? [] : [Br(r)];
|
|
4470
4589
|
});
|
|
4471
4590
|
}
|
|
4472
4591
|
}
|
|
4473
4592
|
];
|
|
4474
4593
|
// ../quality/src/localization/index.ts
|
|
4475
|
-
function
|
|
4594
|
+
function Wr(e, t = {}) {
|
|
4476
4595
|
if (t.disabled === !0 || t.localization === !1) return [];
|
|
4477
|
-
let n = t.contentLocale ??
|
|
4478
|
-
return n ===
|
|
4479
|
-
...
|
|
4596
|
+
let n = t.contentLocale ?? r(e);
|
|
4597
|
+
return n === r(e) ? [] : (e.settings.locales?.includes(n) || ee(e, n), w(e, Ur, {
|
|
4598
|
+
...T({
|
|
4480
4599
|
locale: t.locale,
|
|
4481
|
-
rules:
|
|
4600
|
+
rules: Ur,
|
|
4482
4601
|
overrides: t.localization?.rules,
|
|
4483
4602
|
thresholds: void 0,
|
|
4484
4603
|
nonProductionHosts: void 0
|
|
@@ -4486,29 +4605,29 @@ function Ir(e, t = {}) {
|
|
|
4486
4605
|
contentLocale: n,
|
|
4487
4606
|
customBlocks: t.customBlocks,
|
|
4488
4607
|
mergeTagSyntax: t.mergeTagSyntax
|
|
4489
|
-
}, (e, t, n) =>
|
|
4608
|
+
}, (e, t, n) => Rr(e, t, n)));
|
|
4490
4609
|
}
|
|
4491
4610
|
// ../quality/src/util.ts
|
|
4492
|
-
function
|
|
4611
|
+
function Gr(e) {
|
|
4493
4612
|
return e ? e.disabled === !0 || e.accessibility === !1 && e.structure === !1 && e.links === !1 && e.deliverability === !1 && e.compatibility === !1 && e.localization === !1 : !1;
|
|
4494
4613
|
}
|
|
4495
4614
|
// ../quality/src/lint-template.ts
|
|
4496
|
-
function
|
|
4497
|
-
if (
|
|
4498
|
-
let n =
|
|
4499
|
-
...
|
|
4500
|
-
...
|
|
4501
|
-
...
|
|
4502
|
-
...
|
|
4503
|
-
...
|
|
4504
|
-
...
|
|
4615
|
+
function Kr(e, t = {}) {
|
|
4616
|
+
if (Gr(t)) return [];
|
|
4617
|
+
let n = r(e), i = t.contentLocale ?? n, a = ee(e, i), o = [
|
|
4618
|
+
...Rt(a, t),
|
|
4619
|
+
...ln(a, t),
|
|
4620
|
+
...Bn(a, t),
|
|
4621
|
+
...tr(a, t),
|
|
4622
|
+
...jr(a, t),
|
|
4623
|
+
...Wr(e, t)
|
|
4505
4624
|
];
|
|
4506
|
-
return
|
|
4625
|
+
return i === n ? o : o.map((e) => {
|
|
4507
4626
|
if (!e.fix?.removesBlock) return e;
|
|
4508
4627
|
let t = { ...e };
|
|
4509
4628
|
return delete t.fix, t;
|
|
4510
4629
|
});
|
|
4511
4630
|
}
|
|
4512
|
-
export {
|
|
4631
|
+
export { Mr as lintCompiledHtml, Kr as lintTemplate };
|
|
4513
4632
|
|
|
4514
|
-
//# sourceMappingURL=src-
|
|
4633
|
+
//# sourceMappingURL=src-Diw9SLIe.js.map
|