@useinsider/guido 3.1.1-beta.a1f708b → 3.1.1-beta.a80cc5e
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/@types/config/schemas.js +66 -56
- package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue.js +7 -7
- package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue2.js +12 -20
- package/dist/composables/useHtmlCompiler.js +20 -20
- package/dist/composables/useHtmlValidator.js +40 -38
- package/dist/composables/usePreviewMode.js +20 -16
- package/dist/composables/useSave.js +15 -13
- package/dist/config/compiler/unsubscribeCompilerRules.js +37 -37
- package/dist/config/migrator/checkboxMigrator.js +5 -3
- package/dist/config/migrator/radioButtonMigrator.js +14 -12
- package/dist/extensions/Blocks/Recommendation/constants/selectors.js +27 -11
- package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +185 -172
- package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +94 -92
- package/dist/extensions/Blocks/Recommendation/controls/spacing/index.js +31 -31
- package/dist/extensions/Blocks/Recommendation/templates/grid/elementRenderer.js +7 -5
- package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +30 -29
- package/dist/extensions/Blocks/Recommendation/templates/index.js +7 -7
- package/dist/extensions/Blocks/Recommendation/templates/list/elementRenderer.js +3 -1
- package/dist/extensions/Blocks/Recommendation/templates/list/template.js +20 -20
- package/dist/extensions/Blocks/Recommendation/templates/utils.js +57 -50
- package/dist/guido.css +1 -1
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +218 -324
- package/dist/package.json.js +1 -1
- package/dist/src/@types/config/index.d.ts +1 -1
- package/dist/src/@types/config/schemas.d.ts +24 -0
- package/dist/src/@types/config/types.d.ts +3 -1
- package/dist/src/@types/generic.d.ts +1 -0
- package/dist/src/composables/useConfig.d.ts +10 -0
- package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/constants/selectors.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/cardComposition/index.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/templates/grid/template.d.ts +4 -4
- package/dist/src/extensions/Blocks/Recommendation/templates/list/template.d.ts +3 -3
- package/dist/src/extensions/Blocks/Recommendation/templates/utils.d.ts +20 -3
- package/dist/src/extensions/Blocks/Recommendation/utils/tagName.d.ts +3 -3
- package/dist/src/stores/config.d.ts +90 -0
- package/dist/src/stores/preview.d.ts +3 -0
- package/dist/src/utils/htmlCompiler.d.ts +2 -1
- package/dist/static/styles/components/button.css.js +7 -13
- package/dist/static/styles/components/narrow-panel.css.js +0 -52
- package/dist/stores/preview.js +4 -3
- package/dist/utils/htmlCompiler.js +48 -41
- package/dist/utils/templatePreparation.js +26 -24
- package/dist/utils/tooltipUtils.js +5 -4
- package/package.json +4 -4
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import type { FallbackFont } from '@@/Types/config';
|
|
1
2
|
import type { CompilerRule, CompilationResult, HtmlCompiler } from '@@/Types/html-compiler';
|
|
2
3
|
export declare class HtmlCompilerEngine implements HtmlCompiler {
|
|
3
4
|
private rules;
|
|
4
5
|
constructor(rules?: CompilerRule[]);
|
|
5
|
-
compile(html: string, rules?: CompilerRule[]): CompilationResult;
|
|
6
|
+
compile(html: string, rules?: CompilerRule[], fallbackFont?: FallbackFont): CompilationResult;
|
|
6
7
|
private applyRule;
|
|
7
8
|
private applyReplaceRule;
|
|
8
9
|
private applyRegexRule;
|
|
@@ -99,12 +99,18 @@ ue-check-button.checked:not(.flat-white) input:checked + label .icon-button {
|
|
|
99
99
|
color: var(--guido-color-primary-500);
|
|
100
100
|
}
|
|
101
101
|
|
|
102
|
+
ue-select.full-width .button {
|
|
103
|
+
border: none !important;
|
|
104
|
+
background-color: var(--guido-color-neutral-200) !important;
|
|
105
|
+
color: var(--guido-color-neutral-800) !important;
|
|
106
|
+
}
|
|
107
|
+
|
|
102
108
|
ue-select.full-width .button .icon-button {
|
|
103
109
|
color: var(--guido-color-gray-600) !important;
|
|
104
110
|
}
|
|
105
111
|
|
|
106
112
|
ue-select.full-width .button:hover:not(:disabled,.disabled) {
|
|
107
|
-
background-color: var(--guido-color-
|
|
113
|
+
background-color: var(--guido-color-neutral-100) !important;
|
|
108
114
|
}
|
|
109
115
|
|
|
110
116
|
ue-color {
|
|
@@ -124,18 +130,6 @@ ue-select-text-input .select-text-input-toggle .button {
|
|
|
124
130
|
justify-content: center;
|
|
125
131
|
background-color: transparent !important;
|
|
126
132
|
}
|
|
127
|
-
|
|
128
|
-
.control-shadow-wrapper,
|
|
129
|
-
ue-button:not(.no-shadow,.flat-white),
|
|
130
|
-
ue-toggle:not(.no-shadow,.flat-white),
|
|
131
|
-
:is(ue-popover-toggler,ue-toggle-icon-picker,ue-emoji-toggle),
|
|
132
|
-
.button-group,
|
|
133
|
-
ue-counter:not(.no-shadow),
|
|
134
|
-
:is(ue-select,ue-mergetags,ue-font-family-select):not(.no-shadow),
|
|
135
|
-
ue-check-button:not(.no-shadow,.flat-white) {
|
|
136
|
-
background: none;
|
|
137
|
-
padding: 0;
|
|
138
|
-
}
|
|
139
133
|
`;
|
|
140
134
|
export {
|
|
141
135
|
o as default
|
|
@@ -28,58 +28,6 @@ ue-stripe-thumb:hover:not(.disabled),
|
|
|
28
28
|
border-color: var(--guido-color-primary-500);
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
/* Module search — initial */
|
|
32
|
-
.module-search-container {
|
|
33
|
-
background-color: var(--guido-color-gray-0);
|
|
34
|
-
border: 1px solid var(--guido-color-gray-300);
|
|
35
|
-
border-radius: 4px;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
.module-search-container .service-element {
|
|
39
|
-
background-color: unset;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
.module-filter-toggle {
|
|
43
|
-
top: -1px !important;
|
|
44
|
-
right: -1px !important;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
.module-filter-toggle > .button,
|
|
48
|
-
.module-search-container:hover .module-filter-toggle > .button {
|
|
49
|
-
border: none;
|
|
50
|
-
background: transparent;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
/* Module search — hover */
|
|
54
|
-
.module-search-container:has(.module-search-chip-input:hover) {
|
|
55
|
-
border-color: var(--guido-color-primary-500);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
.module-search-container .module-search-chip-input .service-element:hover {
|
|
59
|
-
background-color: var(--guido-color-gray-0);
|
|
60
|
-
border-radius: 4px;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
.module-search-container .module-filter-toggle:hover > .button {
|
|
64
|
-
background-color: var(--guido-color-gray-1);
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
/* Module search — selected (.on) */
|
|
68
|
-
.module-search-container:has(.module-search-chip-input.on),
|
|
69
|
-
.module-search-container:has(.module-search-chip-input.on):hover {
|
|
70
|
-
border-color: var(--guido-color-primary-500);
|
|
71
|
-
box-shadow: 0 0 0 3px var(--guido-color-primary-200) !important;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
.module-search-container .module-search-chip-input.on .input-section {
|
|
75
|
-
background-color: unset;
|
|
76
|
-
box-shadow: unset;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
.module-categories-list .menu-item {
|
|
80
|
-
padding: 8px 20px !important;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
31
|
.modules-layout-wrapper {
|
|
84
32
|
padding: 0 16px 16px;
|
|
85
33
|
grid-row-gap: 16px;
|
package/dist/stores/preview.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { defineStore as e } from "pinia";
|
|
2
|
-
const
|
|
2
|
+
const i = () => ({
|
|
3
3
|
emailFormat: "html",
|
|
4
4
|
ampHtml: "",
|
|
5
5
|
ampErrors: [],
|
|
6
6
|
templateHtml: "",
|
|
7
7
|
isLoaded: !1,
|
|
8
|
-
isAMPErrorModalVisible: !1
|
|
8
|
+
isAMPErrorModalVisible: !1,
|
|
9
|
+
emailSizeKB: 0
|
|
9
10
|
}), a = e("guidoPreview", {
|
|
10
|
-
state: () =>
|
|
11
|
+
state: () => i(),
|
|
11
12
|
getters: {
|
|
12
13
|
isAMPModeEnabled: (t) => t.emailFormat === "AMP",
|
|
13
14
|
previewHtml() {
|
|
@@ -1,70 +1,77 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { useToaster as
|
|
5
|
-
|
|
1
|
+
var h = Object.defineProperty;
|
|
2
|
+
var f = (o, e, t) => e in o ? h(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t;
|
|
3
|
+
var m = (o, e, t) => f(o, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
import { useToaster as x } from "../composables/useToaster.js";
|
|
5
|
+
const E = /font-family\s*:[^;}"']+/gi;
|
|
6
|
+
class T {
|
|
6
7
|
constructor(e = []) {
|
|
7
|
-
|
|
8
|
+
m(this, "rules");
|
|
8
9
|
this.rules = e;
|
|
9
10
|
}
|
|
10
|
-
compile(e, r) {
|
|
11
|
-
const
|
|
11
|
+
compile(e, t, r) {
|
|
12
|
+
const n = performance.now(), l = e, c = e.length;
|
|
12
13
|
let s = e;
|
|
13
|
-
const
|
|
14
|
-
(
|
|
15
|
-
const
|
|
16
|
-
s = this.applyRule(s,
|
|
14
|
+
const i = [];
|
|
15
|
+
(t || this.rules).sort((p, a) => p.priority - a.priority).forEach((p) => {
|
|
16
|
+
const a = s.length;
|
|
17
|
+
s = this.applyRule(s, p), s.length !== a && i.push(p.id);
|
|
17
18
|
});
|
|
18
|
-
const
|
|
19
|
+
const u = s.length, R = c > 0 ? (c - u) / c * 100 : 0, d = new TextEncoder().encode(s).byteLength;
|
|
20
|
+
let y = 0;
|
|
21
|
+
if (r && r.name && r.family) {
|
|
22
|
+
const p = (s.match(E) || []).length, a = `, ${r.name}, ${r.family}`;
|
|
23
|
+
y = p * new TextEncoder().encode(a).byteLength;
|
|
24
|
+
}
|
|
25
|
+
const g = Math.round((d + y) / 1024);
|
|
19
26
|
return {
|
|
20
|
-
originalHtml:
|
|
27
|
+
originalHtml: l,
|
|
21
28
|
compiledHtml: s,
|
|
22
|
-
appliedRules:
|
|
23
|
-
|
|
29
|
+
appliedRules: i,
|
|
30
|
+
estimatedSizeKB: g,
|
|
24
31
|
stats: {
|
|
25
|
-
originalSize:
|
|
26
|
-
compiledSize:
|
|
32
|
+
originalSize: c,
|
|
33
|
+
compiledSize: u,
|
|
27
34
|
reductionPercentage: R,
|
|
28
|
-
executionTime: performance.now() -
|
|
35
|
+
executionTime: performance.now() - n
|
|
29
36
|
}
|
|
30
37
|
};
|
|
31
38
|
}
|
|
32
|
-
applyRule(e,
|
|
39
|
+
applyRule(e, t) {
|
|
33
40
|
try {
|
|
34
|
-
switch (
|
|
41
|
+
switch (t.type) {
|
|
35
42
|
case "replace":
|
|
36
|
-
return this.applyReplaceRule(e,
|
|
43
|
+
return this.applyReplaceRule(e, t);
|
|
37
44
|
case "regex":
|
|
38
|
-
return this.applyRegexRule(e,
|
|
45
|
+
return this.applyRegexRule(e, t);
|
|
39
46
|
case "remove":
|
|
40
|
-
return this.applyRemoveRule(e,
|
|
47
|
+
return this.applyRemoveRule(e, t);
|
|
41
48
|
case "custom":
|
|
42
|
-
return this.applyCustomRule(e,
|
|
49
|
+
return this.applyCustomRule(e, t);
|
|
43
50
|
default:
|
|
44
51
|
return e;
|
|
45
52
|
}
|
|
46
|
-
} catch (
|
|
47
|
-
const { handleError:
|
|
48
|
-
return
|
|
53
|
+
} catch (r) {
|
|
54
|
+
const { handleError: n } = x();
|
|
55
|
+
return n(r, `Failed to apply rule ${t.id}:`), e;
|
|
49
56
|
}
|
|
50
57
|
}
|
|
51
|
-
applyReplaceRule(e,
|
|
52
|
-
const { search:
|
|
53
|
-
return
|
|
58
|
+
applyReplaceRule(e, t) {
|
|
59
|
+
const { search: r, replacement: n, replaceAll: l = !0 } = t;
|
|
60
|
+
return l ? e.replaceAll(r, n) : e.replace(r, n);
|
|
54
61
|
}
|
|
55
|
-
applyRegexRule(e,
|
|
56
|
-
const { pattern:
|
|
57
|
-
return e.replace(
|
|
62
|
+
applyRegexRule(e, t) {
|
|
63
|
+
const { pattern: r, replacement: n, flags: l = "g" } = t, c = new RegExp(r, l);
|
|
64
|
+
return e.replace(c, n);
|
|
58
65
|
}
|
|
59
|
-
applyRemoveRule(e,
|
|
60
|
-
return
|
|
66
|
+
applyRemoveRule(e, t) {
|
|
67
|
+
return t.targets.reduce((r, n) => n instanceof RegExp ? r.replace(n, "") : r.replaceAll(n, ""), e);
|
|
61
68
|
}
|
|
62
|
-
applyCustomRule(e,
|
|
63
|
-
return
|
|
69
|
+
applyCustomRule(e, t) {
|
|
70
|
+
return t.processor(e);
|
|
64
71
|
}
|
|
65
72
|
}
|
|
66
|
-
const
|
|
73
|
+
const H = (o = []) => new T(o);
|
|
67
74
|
export {
|
|
68
|
-
|
|
69
|
-
|
|
75
|
+
T as HtmlCompilerEngine,
|
|
76
|
+
H as createHtmlCompiler
|
|
70
77
|
};
|
|
@@ -1,42 +1,44 @@
|
|
|
1
|
-
import { useActionsApi as
|
|
2
|
-
import { useHtmlCompiler as
|
|
3
|
-
import { useRecommendationExtensionStore as
|
|
4
|
-
import { useDynamicContentStore as
|
|
5
|
-
import { useUnsubscribeStore as
|
|
6
|
-
const
|
|
7
|
-
const o =
|
|
1
|
+
import { useActionsApi as S } from "../composables/useActionsApi.js";
|
|
2
|
+
import { useHtmlCompiler as f } from "../composables/useHtmlCompiler.js";
|
|
3
|
+
import { useRecommendationExtensionStore as C } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
4
|
+
import { useDynamicContentStore as T } from "../stores/dynamic-content.js";
|
|
5
|
+
import { useUnsubscribeStore as x } from "../stores/unsubscribe.js";
|
|
6
|
+
const h = () => {
|
|
7
|
+
const o = T(), e = x(), { getCompiledEmail: i, getTemplateData: s } = S(), { compileHtml: n } = f();
|
|
8
8
|
return {
|
|
9
9
|
prepareTemplateDetails: async () => {
|
|
10
|
-
const { html: a, ampHtml:
|
|
10
|
+
const { html: a, ampHtml: m = "", ampErrors: r = [] } = await i({
|
|
11
11
|
minimize: !0,
|
|
12
12
|
resetDataSavedFlag: !1
|
|
13
|
-
}), { html:
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
13
|
+
}), { html: c, css: l, syncModulesIds: p = [] } = await s();
|
|
14
|
+
e.selectedUnsubscribePages.length && await e.fetchTemplates();
|
|
15
|
+
const { compiledHtml: u, stats: t, appliedRules: d } = n(a), g = o.getSelectedDynamicContentList, b = C();
|
|
16
|
+
return console.debug("HTML Compilation Stats:", {
|
|
17
|
+
originalSize: t.originalSize,
|
|
18
|
+
compiledSize: t.compiledSize,
|
|
19
|
+
reduction: `${t.reductionPercentage.toFixed(2)}%`,
|
|
20
|
+
appliedRules: d,
|
|
21
|
+
executionTime: `${t.executionTime.toFixed(2)}ms`
|
|
20
22
|
}), {
|
|
21
23
|
dynamicContentList: g,
|
|
22
|
-
compiledHtml:
|
|
23
|
-
rawHtml:
|
|
24
|
-
css:
|
|
25
|
-
ampHtml:
|
|
26
|
-
ampErrors:
|
|
27
|
-
modules:
|
|
24
|
+
compiledHtml: u,
|
|
25
|
+
rawHtml: c,
|
|
26
|
+
css: l,
|
|
27
|
+
ampHtml: m,
|
|
28
|
+
ampErrors: r,
|
|
29
|
+
modules: p.map(Number),
|
|
28
30
|
recommendation: {
|
|
29
31
|
campaignUrls: b.recommendationCampaignUrls,
|
|
30
32
|
configs: {}
|
|
31
33
|
},
|
|
32
34
|
unsubscribe: {
|
|
33
|
-
status:
|
|
34
|
-
config:
|
|
35
|
+
status: e.unsubscribePagesStatus,
|
|
36
|
+
config: e.selectedUnsubscribePages
|
|
35
37
|
}
|
|
36
38
|
};
|
|
37
39
|
}
|
|
38
40
|
};
|
|
39
41
|
};
|
|
40
42
|
export {
|
|
41
|
-
|
|
43
|
+
h as useTemplatePreparation
|
|
42
44
|
};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
const
|
|
2
|
-
id:
|
|
1
|
+
const e = (s, t = {}) => ({
|
|
2
|
+
id: s,
|
|
3
3
|
dynamicPosition: t.dynamicPosition ?? !1,
|
|
4
4
|
staticPosition: t.staticPosition ?? "bottom center",
|
|
5
5
|
iconStatus: t.iconStatus ?? !1,
|
|
6
|
-
offset: t.offset
|
|
6
|
+
offset: t.offset,
|
|
7
|
+
preventXss: t.preventXss
|
|
7
8
|
});
|
|
8
9
|
export {
|
|
9
|
-
|
|
10
|
+
e as getTooltipOptions
|
|
10
11
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@useinsider/guido",
|
|
3
|
-
"version": "3.1.1-beta.
|
|
3
|
+
"version": "3.1.1-beta.a80cc5e",
|
|
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",
|
|
@@ -32,8 +32,8 @@
|
|
|
32
32
|
"author": "",
|
|
33
33
|
"license": "ISC",
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@stripoinc/ui-editor-extensions": "3.
|
|
36
|
-
"@useinsider/design-system-vue": "
|
|
35
|
+
"@stripoinc/ui-editor-extensions": "3.5.0",
|
|
36
|
+
"@useinsider/design-system-vue": "0.14.28",
|
|
37
37
|
"@vueuse/core": "11.3.0",
|
|
38
38
|
"lodash-es": "4.17.21",
|
|
39
39
|
"pinia": "2.3.1",
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
},
|
|
87
87
|
"guido": {
|
|
88
88
|
"stripo": {
|
|
89
|
-
"version": "2.
|
|
89
|
+
"version": "2.54.0"
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
92
|
}
|