@useinsider/guido 3.9.1-beta.1714525 → 3.9.1-beta.23867f9
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.
|
@@ -122,10 +122,10 @@ const d = [
|
|
|
122
122
|
], i = /<head>([\S\s]*)<\/head>/, o = new RegExp(i);
|
|
123
123
|
if (!e.match(o))
|
|
124
124
|
return e;
|
|
125
|
-
let
|
|
126
|
-
return t.forEach((
|
|
127
|
-
|
|
128
|
-
}),
|
|
125
|
+
let r = e;
|
|
126
|
+
return t.forEach((s) => {
|
|
127
|
+
r = r.replace("</head>", `${s}</head>`);
|
|
128
|
+
}), r;
|
|
129
129
|
},
|
|
130
130
|
priority: 30
|
|
131
131
|
},
|
|
@@ -156,9 +156,9 @@ const d = [
|
|
|
156
156
|
type: "custom",
|
|
157
157
|
processor: (e) => {
|
|
158
158
|
const t = (i) => i.toString(16).padStart(2, "0");
|
|
159
|
-
return e.replace(/rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)/gi, (i, o, n,
|
|
160
|
-
const [
|
|
161
|
-
return
|
|
159
|
+
return e.replace(/rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)/gi, (i, o, n, r) => {
|
|
160
|
+
const [s, a, c] = [Number(o), Number(n), Number(r)];
|
|
161
|
+
return s > 255 || a > 255 || c > 255 ? i : `#${t(s)}${t(a)}${t(c)}`;
|
|
162
162
|
}).replace(/#([0-9a-f])\1([0-9a-f])\2([0-9a-f])\3\b/gi, "#$1$2$3");
|
|
163
163
|
},
|
|
164
164
|
priority: 44
|
|
@@ -174,6 +174,29 @@ const d = [
|
|
|
174
174
|
replacement: "",
|
|
175
175
|
flags: "g",
|
|
176
176
|
priority: 45
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
id: "remove-script-tags",
|
|
180
|
+
// SD-145051: parity with HB HtmlCleaner.removeUnsafeHtmlTags — strip <script> from
|
|
181
|
+
// compiled email. Priority 50 runs after the </> unescape rules (13/14) so
|
|
182
|
+
// post-unescape tags are still caught. Do NOT add to AMP_SAFE_RULE_IDS (AMP needs <script>).
|
|
183
|
+
description: "Strip <script>…<\/script> tags from compiled email",
|
|
184
|
+
type: "regex",
|
|
185
|
+
pattern: "<script[^>]*>.*?<\/script>",
|
|
186
|
+
replacement: "",
|
|
187
|
+
flags: "gis",
|
|
188
|
+
priority: 50
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
id: "remove-iframe-tags",
|
|
192
|
+
// SD-145051: parity with HB HtmlCleaner.removeUnsafeHtmlTags — strip <iframe>.
|
|
193
|
+
// Do NOT add this id to AMP_SAFE_RULE_IDS.
|
|
194
|
+
description: "Strip <iframe>…</iframe> tags from compiled email",
|
|
195
|
+
type: "regex",
|
|
196
|
+
pattern: "<iframe[^>]*>.*?</iframe>",
|
|
197
|
+
replacement: "",
|
|
198
|
+
flags: "gis",
|
|
199
|
+
priority: 51
|
|
177
200
|
}
|
|
178
201
|
];
|
|
179
202
|
export {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
const u = [
|
|
2
2
|
{
|
|
3
3
|
key: "locale",
|
|
4
4
|
getValue: (e) => e.language,
|
|
@@ -7,28 +7,27 @@ const l = [
|
|
|
7
7
|
{
|
|
8
8
|
key: "currency",
|
|
9
9
|
getValue: (e) => e.currencySettings.value,
|
|
10
|
-
getAvailableOptions: (e) => e.currencyList.map((n) => n.text)
|
|
11
|
-
canBeEmpty: !0
|
|
10
|
+
getAvailableOptions: (e) => e.currencyList.map((n) => n.text)
|
|
12
11
|
}
|
|
13
|
-
],
|
|
14
|
-
function
|
|
15
|
-
return
|
|
16
|
-
var
|
|
12
|
+
], s = "newsletter.recommendation-fill-required-fields";
|
|
13
|
+
function l(e, n, o = u) {
|
|
14
|
+
return o.filter((t) => {
|
|
15
|
+
var a;
|
|
17
16
|
if (t.condition && !t.condition(e))
|
|
18
17
|
return !1;
|
|
19
|
-
const
|
|
20
|
-
if (
|
|
21
|
-
return !
|
|
22
|
-
const a = t.
|
|
23
|
-
return
|
|
18
|
+
const i = t.getValue(e);
|
|
19
|
+
if (!i)
|
|
20
|
+
return !0;
|
|
21
|
+
const r = (a = t.getAvailableOptions) == null ? void 0 : a.call(t, n);
|
|
22
|
+
return r !== void 0 && !r.includes(i);
|
|
24
23
|
}).map((t) => t.key);
|
|
25
24
|
}
|
|
26
|
-
function
|
|
27
|
-
return
|
|
25
|
+
function c(e, n) {
|
|
26
|
+
return l(e, n).length === 0;
|
|
28
27
|
}
|
|
29
28
|
export {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
29
|
+
u as REQUIRED_RECOMMENDATION_FIELDS,
|
|
30
|
+
s as RecommendationRequiredFieldsKey,
|
|
31
|
+
l as getInvalidFields,
|
|
32
|
+
c as isConfigValid
|
|
34
33
|
};
|
|
@@ -10,7 +10,6 @@ export interface ExtensionStoreSlice {
|
|
|
10
10
|
}
|
|
11
11
|
export interface RequiredField {
|
|
12
12
|
key: string;
|
|
13
|
-
canBeEmpty?: boolean;
|
|
14
13
|
getValue: (config: PerBlockConfigs) => string;
|
|
15
14
|
getAvailableOptions?: (store: ExtensionStoreSlice) => string[];
|
|
16
15
|
condition?: (config: PerBlockConfigs) => boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@useinsider/guido",
|
|
3
|
-
"version": "3.9.1-beta.
|
|
3
|
+
"version": "3.9.1-beta.23867f9",
|
|
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",
|