@useinsider/guido 3.2.0-beta.572bfc6 → 3.2.0-beta.5cea610
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/components/organisms/onboarding/AMPOnboarding.vue2.js +51 -31
- package/dist/components/organisms/onboarding/GenericOnboarding.vue.js +1 -1
- package/dist/components/organisms/onboarding/GenericOnboarding.vue2.js +23 -22
- package/dist/components/organisms/onboarding/ItemsOnboarding.vue.js +1 -1
- package/dist/components/organisms/onboarding/ItemsOnboarding.vue2.js +37 -39
- package/dist/components/organisms/onboarding/TextBlockOnboarding.vue.js +3 -3
- package/dist/components/organisms/onboarding/TextBlockOnboarding.vue2.js +30 -41
- package/dist/components/organisms/onboarding/VersionHistoryOnboarding.vue2.js +15 -14
- package/dist/composables/useRecommendation.js +2 -2
- package/dist/composables/useRibbonOffset.js +21 -0
- package/dist/composables/useStripo.js +5 -5
- package/dist/config/compiler/unsubscribeCompilerRules.js +40 -37
- package/dist/config/migrator/itemsBlockMigrator.js +28 -18
- package/dist/enums/displayConditions.js +78 -82
- package/dist/enums/extensions/recommendationBlock.js +41 -95
- package/dist/enums/onboarding.js +7 -2
- package/dist/enums/unsubscribe.js +36 -30
- package/dist/extensions/Blocks/Checkbox/control.js +23 -23
- package/dist/extensions/Blocks/RadioButton/control.js +15 -15
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +3 -3
- package/dist/guido.css +1 -1
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +258 -235
- package/dist/package.json.js +1 -1
- package/dist/services/templateLibraryApi.js +5 -4
- package/dist/src/composables/useRibbonOffset.d.ts +4 -0
- package/dist/src/enums/displayConditions.d.ts +1 -5
- package/dist/src/enums/extensions/recommendationBlock.d.ts +1 -5
- package/dist/src/enums/onboarding.d.ts +6 -0
- package/dist/src/enums/unsubscribe.d.ts +8 -8
- package/dist/src/stores/onboarding.d.ts +4 -0
- package/dist/stores/onboarding.js +4 -0
- package/dist/utils/pairProductVariables.js +89 -88
- package/package.json +3 -3
package/dist/package.json.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useConfig as w } from "../composables/useConfig.js";
|
|
2
2
|
import { useHttp as b } from "../composables/useHttp.js";
|
|
3
|
-
import { useToaster as
|
|
4
|
-
import { useTranslations as
|
|
3
|
+
import { useToaster as C } from "../composables/useToaster.js";
|
|
4
|
+
import { useTranslations as h } from "../composables/useTranslations.js";
|
|
5
5
|
import { useLiquidValidator as S } from "../composables/validators/useLiquidValidator.js";
|
|
6
6
|
import { EditorType as v } from "../enums/defaults.js";
|
|
7
7
|
import { useRecommendationExtensionStore as N } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
@@ -9,7 +9,7 @@ import { useSaveAsTemplateStore as x } from "../stores/save-as-template.js";
|
|
|
9
9
|
import { base64EncodeWithSpecialChars as r } from "../utils/base64.js";
|
|
10
10
|
import { useTemplatePreparation as A } from "../utils/templatePreparation.js";
|
|
11
11
|
const $ = () => {
|
|
12
|
-
const { get: n, post: m } = b(), { handleError: o, showToaster: l } =
|
|
12
|
+
const { get: n, post: m } = b(), { handleError: o, showToaster: l } = C(), { config: c, isFeatureEnabled: p } = w(), { validateLiquidSyntax: g } = S(), u = h();
|
|
13
13
|
return {
|
|
14
14
|
getCategories: async () => {
|
|
15
15
|
try {
|
|
@@ -62,7 +62,8 @@ const $ = () => {
|
|
|
62
62
|
stripoConfig: r({
|
|
63
63
|
editor: "stripo",
|
|
64
64
|
html: a.rawHtml,
|
|
65
|
-
css: a.css
|
|
65
|
+
css: a.css,
|
|
66
|
+
dynamicContentList: a.dynamicContentList
|
|
66
67
|
})
|
|
67
68
|
}, { data: { type: T } } = await m(
|
|
68
69
|
"/newsletter/template-library/create-template",
|
|
@@ -1,6 +1,2 @@
|
|
|
1
1
|
import type { ConditionCategories } from '@@/Types/condition-categories';
|
|
2
|
-
|
|
3
|
-
* Get display conditions lazily so translations resolve at access time.
|
|
4
|
-
* Must be called within a Vue component context or after Pinia is initialized.
|
|
5
|
-
*/
|
|
6
|
-
export declare const getDisplayConditions: () => ConditionCategories;
|
|
2
|
+
export declare const displayConditions: ConditionCategories;
|
|
@@ -6,11 +6,7 @@ export declare const URLS: {
|
|
|
6
6
|
export declare const QUERY_PARAMS: {
|
|
7
7
|
CLIENT_ID: string;
|
|
8
8
|
};
|
|
9
|
-
|
|
10
|
-
* Get recommendation feed source maps lazily so translated names resolve at access time.
|
|
11
|
-
* Must be called within a Vue component context or after Pinia is initialized.
|
|
12
|
-
*/
|
|
13
|
-
export declare const getRecommendationFeedSourceMaps: () => RecommendationFeedItem[];
|
|
9
|
+
export declare const RecommendationFeedSourceMaps: RecommendationFeedItem[];
|
|
14
10
|
export declare const PriceAttributes: string[];
|
|
15
11
|
export declare const currencyLocationMaps: TextValueObject[];
|
|
16
12
|
export declare const currencyOperators: TextValueObject[];
|
|
@@ -3,3 +3,9 @@ export declare const UI_EDITOR_SELECTOR = "ui-editor";
|
|
|
3
3
|
export declare const CARD_COMPOSITION_TAB_SELECTOR = "button[role=\"tab\"][aria-label=\"Card Composition\"]";
|
|
4
4
|
export declare const SETTINGS_TAB_SELECTOR = "button[role=\"tab\"][aria-label=\"Settings\"]";
|
|
5
5
|
export declare const RIBBON_SELECTOR = ".in-ribbons-wrapper";
|
|
6
|
+
export declare const DYNAMIC_CONTENT_BUTTON_SELECTOR = "#guido__btn-add-dynamic-content";
|
|
7
|
+
export declare const AMP_TOGGLE_BUTTON_SELECTOR = ".guido__amp-toggle-html";
|
|
8
|
+
export declare const AMP_TOGGLE_WRAPPER_SELECTOR = ".in-segments-wrapper";
|
|
9
|
+
export declare const HEADER_SELECTOR = "[data-testid=\"guido-header\"]";
|
|
10
|
+
export declare const POPOVER_LEFT_OFFSET = 158;
|
|
11
|
+
export declare const POPOVER_TOP_GAP = 10;
|
|
@@ -12,15 +12,15 @@ export declare const URLS: {
|
|
|
12
12
|
UNSUBSCRIBE_URL: string;
|
|
13
13
|
PREFERENCES_URL: string;
|
|
14
14
|
};
|
|
15
|
+
export declare const PRODUCT_TYPE_URL_SEGMENTS: {
|
|
16
|
+
readonly 60: "email";
|
|
17
|
+
readonly 49: "journey";
|
|
18
|
+
readonly 97: "email";
|
|
19
|
+
};
|
|
15
20
|
export declare const INSIDER_ID = "iid";
|
|
16
|
-
export declare const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
* Must be called within a Vue component context or after Pinia is initialized.
|
|
20
|
-
*/
|
|
21
|
-
export declare const getDefaultUnsubscribeGroup: () => {
|
|
22
|
-
name: string;
|
|
23
|
-
sendGridId: string;
|
|
21
|
+
export declare const DEFAULT_UNSUBSCRIBE_GROUP: {
|
|
22
|
+
readonly name: "Global Unsubscribe";
|
|
23
|
+
readonly sendGridId: "G";
|
|
24
24
|
};
|
|
25
25
|
export declare const UNSUBSCRIBE_PAGES_LINK = "/email/unsubscribe-pages";
|
|
26
26
|
export declare const PAGE_TYPES: {
|
|
@@ -1392,6 +1392,10 @@ export declare const useOnboardingStore: import("pinia").StoreDefinition<"guidoO
|
|
|
1392
1392
|
close(type: OnboardingType): Promise<void>;
|
|
1393
1393
|
next(type: OnboardingType): void;
|
|
1394
1394
|
previous(type: OnboardingType): void;
|
|
1395
|
+
updateCardPosition(type: OnboardingType, cardIndex: number, position: {
|
|
1396
|
+
top: string;
|
|
1397
|
+
position: string;
|
|
1398
|
+
}): void;
|
|
1395
1399
|
setConfig(type: OnboardingType, config: OnboardingCardConfig[]): void;
|
|
1396
1400
|
onDiscoverNowClicked(): Promise<void>;
|
|
1397
1401
|
onRemindMeLater(): void;
|
|
@@ -71,6 +71,10 @@ const t = () => ({
|
|
|
71
71
|
previous(n) {
|
|
72
72
|
this.onboardings[n].cardIndex > 0 && this.onboardings[n].cardIndex--;
|
|
73
73
|
},
|
|
74
|
+
updateCardPosition(n, i, o) {
|
|
75
|
+
const s = this.onboardings[n].config[i];
|
|
76
|
+
s && (s.top = o.top, s.position = o.position);
|
|
77
|
+
},
|
|
74
78
|
setConfig(n, i) {
|
|
75
79
|
this.onboardings[n].config = i ?? [], this.onboardings[n].cardIndex >= this.onboardings[n].config.length && (this.onboardings[n].cardIndex = 0);
|
|
76
80
|
},
|
|
@@ -1,84 +1,85 @@
|
|
|
1
|
-
import { productPairs as
|
|
2
|
-
function
|
|
3
|
-
const
|
|
4
|
-
Object.entries(
|
|
5
|
-
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
var
|
|
9
|
-
const
|
|
10
|
-
if (
|
|
11
|
-
switch (
|
|
1
|
+
import { productPairs as L } from "../extensions/Blocks/Items/enums/productEnums.js";
|
|
2
|
+
function q(w) {
|
|
3
|
+
const y = w.replaceAll("{%", "<!--{%").replaceAll("%}", "%}-->"), T = new DOMParser().parseFromString(y, "text/html"), C = L.PAIRS_FOR_EXTENSION;
|
|
4
|
+
Object.entries(C).forEach(([r, f]) => {
|
|
5
|
+
T.querySelectorAll(".ins-product-td").forEach((o) => {
|
|
6
|
+
const A = o.getAttribute("data-number") || "1", b = o.getAttribute("data-type") || "CART_ITEMS";
|
|
7
|
+
o.querySelectorAll(`[product-attr="${r}"]`).forEach((e) => {
|
|
8
|
+
var k, F, I;
|
|
9
|
+
const $ = e.getAttribute("data-type") || b, d = e.getAttribute("data-number") || A, u = f[$];
|
|
10
|
+
if (u)
|
|
11
|
+
switch (r) {
|
|
12
12
|
case "imageSrc": {
|
|
13
|
-
let t = null,
|
|
14
|
-
if (e.tagName === "IMG" ? (t = e,
|
|
13
|
+
let t = null, i = null;
|
|
14
|
+
if (e.tagName === "IMG" ? (t = e, i = t.closest("a")) : (t = e.querySelector("img"), i = e.querySelector("a") || e.closest("a")), !t)
|
|
15
15
|
break;
|
|
16
|
-
const
|
|
17
|
-
if (
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
const
|
|
21
|
-
return
|
|
22
|
-
}) && (t.src = `{{${
|
|
16
|
+
const a = u.DEFAULT, s = u.ATTR;
|
|
17
|
+
if (a && t.src) {
|
|
18
|
+
const c = t.src;
|
|
19
|
+
a.some((h) => {
|
|
20
|
+
const l = h.split("/").pop() || "", g = c.split("/").pop() || "";
|
|
21
|
+
return c.includes(h) || c.includes(l) || g === l;
|
|
22
|
+
}) && (t.src = `{{${s}_${d}}}`);
|
|
23
23
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
24
|
+
const n = (F = (k = C.name) == null ? void 0 : k[$]) == null ? void 0 : F.ATTR;
|
|
25
|
+
if (n && t.setAttribute("alt", `{{${n}_${d}}}`), i) {
|
|
26
|
+
const c = (I = C.itemLink) == null ? void 0 : I[$];
|
|
27
|
+
if (c) {
|
|
28
|
+
const E = c.HREF, h = c.DEFAULT_HREF || "#!", l = i.href;
|
|
29
|
+
(l === "#" || l === "" || l.endsWith("#!") || l.endsWith(h) || l === `${window.location.href}${h}` || !l || l === window.location.href) && (i.href = `{{${E}_${d}}}`);
|
|
29
30
|
}
|
|
30
31
|
}
|
|
31
32
|
break;
|
|
32
33
|
}
|
|
33
34
|
case "name": {
|
|
34
|
-
const t =
|
|
35
|
-
e.textContent && (e.textContent = `{{${
|
|
36
|
-
const
|
|
37
|
-
if (
|
|
38
|
-
const
|
|
39
|
-
(
|
|
35
|
+
const t = u, i = t.ATTR, a = t.DEFAULT_HREF || "#!", s = t.HREF;
|
|
36
|
+
e.textContent && (e.textContent = `{{${i}_${d}}}`);
|
|
37
|
+
const n = e.closest("a") || (e.tagName === "A" ? e : null);
|
|
38
|
+
if (n && s) {
|
|
39
|
+
const c = n.href, E = `${window.location.href}${a}`;
|
|
40
|
+
(c === E || c.endsWith(a)) && (n.href = `{{${s}_${d}}}`);
|
|
40
41
|
}
|
|
41
42
|
break;
|
|
42
43
|
}
|
|
43
44
|
case "price":
|
|
44
45
|
case "originalPrice": {
|
|
45
|
-
const t =
|
|
46
|
-
let
|
|
47
|
-
|
|
48
|
-
const
|
|
49
|
-
let
|
|
50
|
-
if (
|
|
51
|
-
const
|
|
52
|
-
|
|
46
|
+
const t = u, i = e.getAttribute("data-formated"), a = e.getAttribute("data-single_price"), s = i === "true", n = a === "true", c = e.getAttribute("data-curency") || "before";
|
|
47
|
+
let E;
|
|
48
|
+
n ? E = s ? t.SINGLE_PRICE_FORMATTED : t.SINGLE_PRICE : E = s ? t.PRICE_FORMATTED : t.PRICE;
|
|
49
|
+
const h = t.CURRENCY;
|
|
50
|
+
let l = `{{${E}_${d}}}`;
|
|
51
|
+
if (h) {
|
|
52
|
+
const g = `{{${h}_${d}}}`;
|
|
53
|
+
l = c === "after" ? `${l} ${g}` : `${g} ${l}`;
|
|
53
54
|
}
|
|
54
|
-
e.textContent =
|
|
55
|
+
e.textContent = l;
|
|
55
56
|
break;
|
|
56
57
|
}
|
|
57
58
|
case "quantity": {
|
|
58
|
-
const t =
|
|
59
|
-
e.textContent && e.textContent.trim() ===
|
|
59
|
+
const t = u, i = t.ATTR, a = t.DEFAULT;
|
|
60
|
+
e.textContent && e.textContent.trim() === a && (e.textContent = `{{${i}_${d}}}`);
|
|
60
61
|
break;
|
|
61
62
|
}
|
|
62
63
|
case "button": {
|
|
63
|
-
const t =
|
|
64
|
-
if (
|
|
65
|
-
const
|
|
66
|
-
(
|
|
64
|
+
const t = u, i = t.HREF, a = t.DEFAULT_HREF || "#!", s = e.tagName === "A" ? e : e.querySelector("a");
|
|
65
|
+
if (s) {
|
|
66
|
+
const n = s.href || "", c = `${window.location.href}${a}`;
|
|
67
|
+
(n === "" || n === "#" || n === c || n.endsWith(a) || n.endsWith("#!") || n === window.location.href) && (s.href = `{{${i}_${d}}}`);
|
|
67
68
|
}
|
|
68
69
|
break;
|
|
69
70
|
}
|
|
70
71
|
case "itemLink": {
|
|
71
|
-
const t =
|
|
72
|
-
if (
|
|
73
|
-
const
|
|
74
|
-
(
|
|
72
|
+
const t = u, i = t.HREF, a = t.DEFAULT_HREF || "#!", s = e;
|
|
73
|
+
if (s.href) {
|
|
74
|
+
const n = s.href, c = `${window.location.href}${a}`;
|
|
75
|
+
(n === c || n.endsWith(a)) && (s.href = `{{${i}_${d}}}`);
|
|
75
76
|
}
|
|
76
77
|
break;
|
|
77
78
|
}
|
|
78
79
|
default: {
|
|
79
|
-
if ("ATTR" in
|
|
80
|
-
const t =
|
|
81
|
-
e.textContent && (e.textContent = `{{${t}_${
|
|
80
|
+
if ("ATTR" in u) {
|
|
81
|
+
const t = u.ATTR;
|
|
82
|
+
e.textContent && (e.textContent = `{{${t}_${d}}}`);
|
|
82
83
|
}
|
|
83
84
|
break;
|
|
84
85
|
}
|
|
@@ -86,55 +87,55 @@ function L(F) {
|
|
|
86
87
|
});
|
|
87
88
|
});
|
|
88
89
|
});
|
|
89
|
-
const S =
|
|
90
|
-
` : "",
|
|
91
|
-
|
|
92
|
-
const
|
|
93
|
-
|
|
94
|
-
element:
|
|
95
|
-
outerHtml:
|
|
96
|
-
type:
|
|
97
|
-
number:
|
|
98
|
-
nodup:
|
|
90
|
+
const S = y.match(/<!DOCTYPE[^>]*>/i), M = S ? `${S[0]}
|
|
91
|
+
` : "", P = T.querySelectorAll(".ins-product-td"), H = [];
|
|
92
|
+
P.forEach((r) => {
|
|
93
|
+
const f = r.getAttribute("data-type") || "CART_ITEMS", p = r.getAttribute("data-number") || "1", o = r.getAttribute("data-nodup"), A = r.outerHTML;
|
|
94
|
+
H.push({
|
|
95
|
+
element: r,
|
|
96
|
+
outerHtml: A,
|
|
97
|
+
type: f,
|
|
98
|
+
number: p,
|
|
99
|
+
nodup: o || void 0
|
|
99
100
|
});
|
|
100
101
|
});
|
|
101
|
-
let
|
|
102
|
-
|
|
103
|
-
let
|
|
104
|
-
switch (
|
|
102
|
+
let _ = M + T.documentElement.outerHTML;
|
|
103
|
+
H.reverse().forEach(({ outerHtml: r, type: f, number: p }) => {
|
|
104
|
+
let o = "";
|
|
105
|
+
switch (f) {
|
|
105
106
|
case "CART_ITEMS":
|
|
106
|
-
|
|
107
|
+
o = "ins_apr_total_product_kind";
|
|
107
108
|
break;
|
|
108
109
|
case "BROWSED_ITEMS":
|
|
109
|
-
|
|
110
|
+
o = "browsed_item_total_product_kind";
|
|
110
111
|
break;
|
|
111
112
|
case "PURCHASED_ITEMS":
|
|
112
|
-
|
|
113
|
+
o = "purchased_item_total_product_kind";
|
|
113
114
|
break;
|
|
114
115
|
}
|
|
115
|
-
if (
|
|
116
|
-
const
|
|
117
|
-
|
|
116
|
+
if (o) {
|
|
117
|
+
const b = parseInt(p) - 1, $ = `${`{% if ${o} > ${b} %}`}${r}{% endif %}`;
|
|
118
|
+
_ = _.replace(r, $);
|
|
118
119
|
}
|
|
119
120
|
});
|
|
120
|
-
const
|
|
121
|
-
return
|
|
122
|
-
const
|
|
123
|
-
if (!
|
|
121
|
+
const D = T.querySelectorAll('[product-attr="originalPrice"][data-type="CART_ITEMS"]'), R = [];
|
|
122
|
+
return D.forEach((r) => {
|
|
123
|
+
const f = r.getAttribute("data-number"), p = r.getAttribute("data-type");
|
|
124
|
+
if (!f || p !== "CART_ITEMS")
|
|
124
125
|
return;
|
|
125
|
-
const
|
|
126
|
-
if (
|
|
127
|
-
const
|
|
128
|
-
|
|
126
|
+
const o = r.closest(".product-original-price-class");
|
|
127
|
+
if (o) {
|
|
128
|
+
const A = o.outerHTML;
|
|
129
|
+
R.some((m) => m.tdOuterHtml === A) || R.push({ tdOuterHtml: A, number: f });
|
|
129
130
|
}
|
|
130
|
-
}),
|
|
131
|
-
const
|
|
132
|
-
if (!
|
|
133
|
-
const
|
|
134
|
-
|
|
131
|
+
}), R.reverse().forEach(({ tdOuterHtml: r, number: f }) => {
|
|
132
|
+
const p = `{% if ins_apr_price_${f} != ins_apr_originalprice_${f} %}`;
|
|
133
|
+
if (!_.includes(p) && !r.includes("{% if")) {
|
|
134
|
+
const A = `${p}${r}{% endif %}`;
|
|
135
|
+
_ = _.replace(r, A);
|
|
135
136
|
}
|
|
136
|
-
}),
|
|
137
|
+
}), _.replaceAll("<!--{%", "{%").replaceAll("%}-->", "%}").replaceAll("<!--{%", "{%").replaceAll("%}-->", "%}");
|
|
137
138
|
}
|
|
138
139
|
export {
|
|
139
|
-
|
|
140
|
+
q as pairProductVariables
|
|
140
141
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@useinsider/guido",
|
|
3
|
-
"version": "3.2.0-beta.
|
|
3
|
+
"version": "3.2.0-beta.5cea610",
|
|
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,7 +32,7 @@
|
|
|
32
32
|
"author": "",
|
|
33
33
|
"license": "ISC",
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@stripoinc/ui-editor-extensions": "3.
|
|
35
|
+
"@stripoinc/ui-editor-extensions": "3.8.0",
|
|
36
36
|
"@useinsider/design-system-vue": "1.1.0-beta.73ec2fa",
|
|
37
37
|
"@vueuse/core": "11.3.0",
|
|
38
38
|
"lodash-es": "4.17.21",
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
},
|
|
87
87
|
"guido": {
|
|
88
88
|
"stripo": {
|
|
89
|
-
"version": "2.
|
|
89
|
+
"version": "2.62.0"
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
92
|
}
|