@useinsider/guido 3.12.0-beta.3450e5f → 3.12.0-beta.3aef680
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/README.md +29 -0
- package/dist/@types/config/schemas.js +104 -84
- package/dist/components/Guido.vue.js +1 -1
- package/dist/components/Guido.vue2.js +110 -101
- package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue.js +1 -1
- package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue2.js +8 -8
- package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue.js +5 -5
- package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue2.js +10 -10
- package/dist/components/organisms/onboarding/AMPOnboarding.vue.js +11 -10
- package/dist/components/organisms/onboarding/GenericOnboarding.vue.js +1 -1
- package/dist/components/organisms/onboarding/ItemsOnboarding.vue.js +6 -6
- package/dist/components/organisms/onboarding/NewVersionPopup.vue2.js +20 -23
- package/dist/components/organisms/onboarding/TextBlockOnboarding.vue.js +3 -3
- package/dist/components/organisms/onboarding/VersionHistoryOnboarding.vue.js +8 -7
- package/dist/composables/useModuleDynamicContentRepair.js +37 -0
- package/dist/composables/usePreviewInteractionGuard.js +36 -11
- package/dist/composables/useRecommendationPreview.js +61 -60
- package/dist/composables/useStripo.js +81 -75
- package/dist/config/migrator/index.js +7 -6
- package/dist/config/migrator/socialIconMigrator.js +29 -0
- package/dist/enums/academy.js +1 -1
- package/dist/enums/date.js +3 -4
- package/dist/extensions/Blocks/Items/controls/price/formattedPrice.js +43 -41
- package/dist/extensions/Blocks/Recommendation/constants/controlIds.js +1 -1
- package/dist/extensions/Blocks/Recommendation/controls/blockBackground/index.js +10 -0
- package/dist/extensions/Blocks/Recommendation/extension.js +23 -21
- package/dist/extensions/Blocks/Recommendation/settingsPanel.js +41 -40
- package/dist/extensions/Blocks/Unsubscribe/utils/constants.js +3 -2
- package/dist/extensions/Blocks/controlFactories.js +125 -75
- package/dist/guido.css +1 -1
- package/dist/node_modules/valibot/dist/index.js +148 -112
- package/dist/src/@types/config/schemas.d.ts +30 -0
- package/dist/src/@types/generic.d.ts +18 -0
- package/dist/src/components/Guido.vue.d.ts +18 -2
- package/dist/src/composables/useConfig.d.ts +6 -0
- package/dist/src/composables/useModuleDynamicContentRepair.d.ts +18 -0
- package/dist/src/composables/usePreviewInteractionGuard.d.ts +1 -1
- package/dist/src/composables/useStripo.d.ts +3 -2
- package/dist/src/config/migrator/socialIconMigrator.d.ts +1 -0
- package/dist/src/enums/academy.d.ts +3 -3
- package/dist/src/extensions/Blocks/Recommendation/constants/controlIds.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/blockBackground/index.d.ts +14 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/index.d.ts +1 -0
- package/dist/src/extensions/Blocks/Unsubscribe/utils/constants.d.ts +1 -0
- package/dist/src/extensions/Blocks/controlFactories.d.ts +36 -0
- package/dist/src/library.d.ts +1 -1
- package/dist/src/stores/config.d.ts +54 -0
- package/dist/src/utils/dynamicContentConverter.d.ts +27 -0
- package/dist/src/utils/environmentUtil.d.ts +5 -2
- package/dist/src/utils/genericUtil.d.ts +18 -1
- package/dist/src/utils/urlSchemes.d.ts +6 -0
- package/dist/utils/dateUtil.js +10 -23
- package/dist/utils/dynamicContentConverter.js +31 -0
- package/dist/utils/environmentUtil.js +3 -2
- package/dist/utils/genericUtil.js +42 -21
- package/dist/utils/urlSchemes.js +4 -0
- package/package.json +1 -1
|
@@ -1,47 +1,68 @@
|
|
|
1
|
-
const
|
|
2
|
-
const a =
|
|
3
|
-
text:
|
|
4
|
-
value:
|
|
1
|
+
const o = (l) => {
|
|
2
|
+
const a = l.value.match(/\{\{([^}]+)\}\}/)[1].split("|").map((t) => t.trim()), [c] = a, r = {
|
|
3
|
+
text: l.label,
|
|
4
|
+
value: c || ""
|
|
5
5
|
};
|
|
6
6
|
if (a.length >= 2) {
|
|
7
|
-
const [,
|
|
8
|
-
if (
|
|
9
|
-
let
|
|
10
|
-
|
|
7
|
+
const [, t, e] = a;
|
|
8
|
+
if (t.startsWith("default:")) {
|
|
9
|
+
let n = t.slice(8).trim();
|
|
10
|
+
n.startsWith('"') && n.endsWith('"') && (n = n.slice(1, -1)), r.fallback = n;
|
|
11
11
|
} else {
|
|
12
|
-
const
|
|
13
|
-
|
|
12
|
+
const n = t.includes("=") ? { key: t.split("=")[0].trim(), value: t.split("=")[1].trim() } : null;
|
|
13
|
+
n ? r.format = n : e || (r.fallback = t), e && (r.fallback = e);
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
|
-
return
|
|
17
|
-
},
|
|
16
|
+
return r;
|
|
17
|
+
}, f = (l, s = !1) => l.map((a) => {
|
|
18
18
|
if (a.format)
|
|
19
19
|
return {
|
|
20
20
|
label: `${a.text} | ${a.format.key}=${a.format.value}`,
|
|
21
21
|
value: `{{${a.value}|${a.format.key}=${a.format.value}}}`
|
|
22
22
|
};
|
|
23
|
-
if (
|
|
23
|
+
if (s) {
|
|
24
24
|
if (!a.fallback)
|
|
25
25
|
return {
|
|
26
26
|
label: a.text,
|
|
27
27
|
value: `{{ ${a.value} }}`
|
|
28
28
|
};
|
|
29
|
-
const
|
|
29
|
+
const r = !Number.isNaN(Number(a.fallback)) && a.fallback.trim() !== "" ? a.fallback : `"${a.fallback}"`;
|
|
30
30
|
return {
|
|
31
31
|
label: `${a.text} | ${a.fallback}`,
|
|
32
|
-
value: `{{ ${a.value} | default: ${
|
|
32
|
+
value: `{{ ${a.value} | default: ${r} }}`
|
|
33
33
|
};
|
|
34
34
|
}
|
|
35
35
|
return {
|
|
36
36
|
label: a.fallback ? `${a.text} | ${a.fallback}` : a.text,
|
|
37
37
|
value: a.fallback ? `{{${a.value}|${a.fallback}}}` : `{{${a.value}}}`
|
|
38
38
|
};
|
|
39
|
-
}),
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
}), b = (l) => {
|
|
40
|
+
const s = [], a = /* @__PURE__ */ new Set(), c = (t) => {
|
|
41
|
+
Array.isArray(t) && t.forEach((e) => {
|
|
42
|
+
const n = [...e.children ?? [], ...e.select_items ?? []];
|
|
43
|
+
if (n.length > 0) {
|
|
44
|
+
c(n);
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
const u = e.text || e.tag_text;
|
|
48
|
+
u && e.value && !a.has(e.value) && (a.add(e.value), s.push({ text: u, value: e.value }));
|
|
49
|
+
});
|
|
50
|
+
}, [r] = Object.values(l ?? {});
|
|
51
|
+
return c(r), s;
|
|
52
|
+
}, v = (l, s, a = !1) => {
|
|
53
|
+
const c = new Set(l.map((t) => t.value)), r = s.filter((t) => c.has(t.value) ? !1 : (c.add(t.value), !0));
|
|
54
|
+
return [
|
|
55
|
+
...f(l, a),
|
|
56
|
+
...f(r, a)
|
|
57
|
+
];
|
|
58
|
+
}, i = () => {
|
|
59
|
+
var l;
|
|
60
|
+
return ((l = document.head.querySelector('meta[name="csrf-token"]')) == null ? void 0 : l.getAttribute("content")) ?? "";
|
|
42
61
|
};
|
|
43
62
|
export {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
63
|
+
v as buildMergeTagEntries,
|
|
64
|
+
f as dynamicContentToMergeTags,
|
|
65
|
+
b as flattenDynamicContentList,
|
|
66
|
+
i as getCsrfToken,
|
|
67
|
+
o as mergeTagToDynamicContent
|
|
47
68
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@useinsider/guido",
|
|
3
|
-
"version": "3.12.0-beta.
|
|
3
|
+
"version": "3.12.0-beta.3aef680",
|
|
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",
|