@useinsider/guido 3.7.0-beta.7f74830 → 3.7.0-beta.960d9c8
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/composables/useHtmlCompiler.js +8 -6
- package/dist/config/compiler/htmlCompilerRules.js +15 -7
- package/dist/config/migrator/fontTagMigrator.js +7 -0
- package/dist/config/migrator/index.js +8 -7
- package/dist/package.json.js +1 -1
- package/dist/src/config/migrator/fontTagMigrator.d.ts +7 -0
- package/dist/src/utils/stripFontTags.d.ts +12 -0
- package/dist/utils/stripFontTags.js +7 -0
- package/package.json +2 -2
|
@@ -13,6 +13,8 @@ const y = /* @__PURE__ */ new Set([
|
|
|
13
13
|
"fix-url-encoding-end",
|
|
14
14
|
"fix-tags-start",
|
|
15
15
|
"fix-tags-end",
|
|
16
|
+
// Remove translate-injected <font> tags — pure removal, never emits AMP-forbidden output.
|
|
17
|
+
"strip-font-tags",
|
|
16
18
|
// Image domain corrections — plain string replacement.
|
|
17
19
|
"replace-old-image-domain",
|
|
18
20
|
"replace-old-v2-image-domain",
|
|
@@ -26,22 +28,22 @@ const y = /* @__PURE__ */ new Set([
|
|
|
26
28
|
// Coupon placeholder replacement (only present when liquidSyntax is enabled).
|
|
27
29
|
"liquid-coupon-code"
|
|
28
30
|
]), M = () => {
|
|
29
|
-
var
|
|
30
|
-
const { compiler: e, isFeatureEnabled: a, partner: n } = k(),
|
|
31
|
-
...!!((
|
|
31
|
+
var t, m, r;
|
|
32
|
+
const { compiler: e, isFeatureEnabled: a, partner: n } = k(), p = ((t = e.value) == null ? void 0 : t.customRules) || [], l = [
|
|
33
|
+
...!!((m = e.value) != null && m.ignoreDefaultRules) ? [] : R,
|
|
32
34
|
...v,
|
|
33
35
|
...x,
|
|
34
36
|
...g,
|
|
35
37
|
...b,
|
|
36
38
|
...H,
|
|
37
39
|
...a("liquidSyntax") ? C : [],
|
|
38
|
-
...
|
|
40
|
+
...p.map((o, f) => ({
|
|
39
41
|
...o,
|
|
40
42
|
priority: o.priority + 1e3 + f
|
|
41
43
|
// Ensure additional rules run after default rules
|
|
42
44
|
}))
|
|
43
|
-
],
|
|
44
|
-
return { compileHtml: (o) =>
|
|
45
|
+
], u = s(l), c = l.filter((o) => y.has(o.id)), d = s(c), i = (r = n.value) == null ? void 0 : r.fallbackFont;
|
|
46
|
+
return { compileHtml: (o) => u.compile(o, void 0, i), compileAmpHtml: (o) => d.compile(o, void 0, i) };
|
|
45
47
|
};
|
|
46
48
|
export {
|
|
47
49
|
M as useHtmlCompiler
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import { stripFontTags as n } from "../../utils/stripFontTags.js";
|
|
2
|
+
const l = [
|
|
2
3
|
{
|
|
3
4
|
id: "fix-url-encoding-start",
|
|
4
5
|
description: "Replace {%22 with %7B%22 to fix URL encoding",
|
|
@@ -53,6 +54,13 @@ const a = [
|
|
|
53
54
|
replaceAll: !0,
|
|
54
55
|
priority: 14
|
|
55
56
|
},
|
|
57
|
+
{
|
|
58
|
+
id: "strip-font-tags",
|
|
59
|
+
description: 'Unwrap <font> tags injected by browser translate extensions (e.g. Google Translate), keeping inner content — prevents Chrome DOM-depth overflow ("512 nodes")',
|
|
60
|
+
type: "custom",
|
|
61
|
+
processor: (e) => n(e),
|
|
62
|
+
priority: 15
|
|
63
|
+
},
|
|
56
64
|
{
|
|
57
65
|
id: "remove-apty-iframe",
|
|
58
66
|
description: "Cleanup Apty Iframe Code",
|
|
@@ -91,7 +99,7 @@ const a = [
|
|
|
91
99
|
description: "Adding MSO Conditions",
|
|
92
100
|
type: "custom",
|
|
93
101
|
processor: (e) => {
|
|
94
|
-
const
|
|
102
|
+
const i = [
|
|
95
103
|
`<!--[if gte mso 9]>
|
|
96
104
|
<style>sup {
|
|
97
105
|
font-size: 100% !important;
|
|
@@ -114,10 +122,10 @@ const a = [
|
|
|
114
122
|
], s = /<head>([\S\s]*)<\/head>/, o = new RegExp(s);
|
|
115
123
|
if (!e.match(o))
|
|
116
124
|
return e;
|
|
117
|
-
let
|
|
118
|
-
return
|
|
119
|
-
|
|
120
|
-
}),
|
|
125
|
+
let t = e;
|
|
126
|
+
return i.forEach((r) => {
|
|
127
|
+
t = t.replace("</head>", `${r}</head>`);
|
|
128
|
+
}), t;
|
|
121
129
|
},
|
|
122
130
|
priority: 30
|
|
123
131
|
},
|
|
@@ -141,5 +149,5 @@ const a = [
|
|
|
141
149
|
}
|
|
142
150
|
];
|
|
143
151
|
export {
|
|
144
|
-
|
|
152
|
+
l as defaultHtmlCompilerRules
|
|
145
153
|
};
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { migrateCheckbox as o } from "./checkboxMigrator.js";
|
|
2
2
|
import { migrateCouponBlock as i } from "./couponBlockMigrator.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
3
|
+
import { migrateFontTags as e } from "./fontTagMigrator.js";
|
|
4
|
+
import { migrateItemsBlock as a } from "./itemsBlockMigrator.js";
|
|
5
|
+
import { migrateRadioButton as g } from "./radioButtonMigrator.js";
|
|
6
|
+
import { migrateRecommendation as n } from "./recommendationMigrator.js";
|
|
7
|
+
import { migrateUnsubscribe as p } from "./unsubscribeMigrator.js";
|
|
8
|
+
const k = async (r, t = {}) => {
|
|
8
9
|
let m = r;
|
|
9
|
-
return m = o(m), m =
|
|
10
|
+
return m = e(m), m = o(m), m = g(m), m = await p(m), m = i(m), m = n(m, t), m = a(m), m;
|
|
10
11
|
};
|
|
11
12
|
export {
|
|
12
|
-
|
|
13
|
+
k as migrate
|
|
13
14
|
};
|
package/dist/package.json.js
CHANGED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Heals templates already saved with browser-translate-injected `<font>` tags
|
|
3
|
+
* (see {@link stripFontTags}). Runs on load before the block migrators so they
|
|
4
|
+
* operate on clean HTML, and stops the accumulated nesting from re-triggering
|
|
5
|
+
* Chrome's DOM-depth limit when the template is reopened in the editor.
|
|
6
|
+
*/
|
|
7
|
+
export declare function migrateFontTags(html: string): string;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Browser translation extensions (e.g. Google Translate) wrap translated text in
|
|
3
|
+
* nested `<font style="vertical-align:inherit">` tags. These get persisted into
|
|
4
|
+
* the template and accumulate over edit/translate cycles until Chrome exceeds its
|
|
5
|
+
* DOM-depth limit (the "512 nodes" error). Stripo never emits `<font>` tags, so
|
|
6
|
+
* any present are foreign — unwrap them (drop the tag, keep the inner content).
|
|
7
|
+
*
|
|
8
|
+
* Removing each open/close tag independently handles any nesting depth without a
|
|
9
|
+
* DOMParser round-trip, so surrounding markup (incl. `esd-*` attributes) is left
|
|
10
|
+
* byte-for-byte intact.
|
|
11
|
+
*/
|
|
12
|
+
export declare function stripFontTags(html: string): string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@useinsider/guido",
|
|
3
|
-
"version": "3.7.0-beta.
|
|
3
|
+
"version": "3.7.0-beta.960d9c8",
|
|
4
4
|
"description": "Guido is a Vue + TypeScript wrapper for Email Plugin. Easily embed the email editor in your Vue applications.",
|
|
5
5
|
"main": "./dist/guido.umd.cjs",
|
|
6
6
|
"module": "./dist/library.js",
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
},
|
|
93
93
|
"guido": {
|
|
94
94
|
"stripo": {
|
|
95
|
-
"version": "2.
|
|
95
|
+
"version": "2.65.0"
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
98
|
}
|