@useinsider/guido 3.21.2-beta.b6f3ef8 → 3.21.2-beta.eea8885
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 +4 -34
- package/dist/components/Guido.vue.js +3 -3
- package/dist/components/Guido.vue2.js +108 -118
- package/dist/composables/useStripo.js +82 -94
- package/dist/guido.css +1 -1
- package/dist/library.js +10 -12
- package/dist/package.json.js +4 -6
- package/dist/src/library.d.ts +0 -1
- package/dist/utils/pairProductVariables.js +98 -90
- package/package.json +1 -6
- package/dist/composables/useEditorOpenMetrics.js +0 -164
- package/dist/public/prefetchRuntime.js +0 -4
- package/dist/src/composables/useEditorOpenMetrics.d.ts +0 -27
- package/dist/src/public/prefetchRuntime.d.ts +0 -1
- package/dist/src/utils/runtimePrefetch.d.ts +0 -4
- package/dist/src/utils/stripoRuntime.d.ts +0 -2
- package/dist/static/stripo-runtime-manifest.json.js +0 -9
- package/dist/utils/runtimePrefetch.js +0 -26
- package/dist/utils/stripoRuntime.js +0 -9
package/dist/guido.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@charset "UTF-8";.auth-error-modal[data-v-b4d7ae51]{position:relative;z-index:145}.gap-16[data-v-5553d071],.gap-16[data-v-0e1b0c54]{gap:16px}[data-v-b8f24f34] .in-button-v2__wrapper{line-height:0}[data-v-22226124] .in-segments-wrapper__button_selected,[data-v-22226124] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb;color:#0010ac;border-color:#0010ac}[data-v-2cb418af] .in-progress-wrapper__progress p span:last-child{display:none!important}[data-v-2cb418af] .in-progress-description-status{display:none!important}.view-options-wrapper[data-v-87033101]{position:relative;display:inline-block}.new-tag[data-v-87033101]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-87033101] .guido__view-option-selection-desktop svg,[data-v-87033101] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-87033101] .in-segments-wrapper__button_selected,[data-v-87033101] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-87033101] .in-tooltip-wrapper-v2__icon{cursor:pointer}.editor-toolbar[data-v-173c3a40]{gap:4px}.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history[data-v-fad98586]{gap:8px}.version-history__toolbar[data-v-fad98586]{gap:4px}.view-options-wrapper[data-v-6ebabfe4]{position:relative;display:inline-block}.new-tag[data-v-6ebabfe4]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-6ebabfe4] .guido__verion-history-view-option-selection-desktop svg,[data-v-6ebabfe4] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-6ebabfe4] .in-segments-wrapper__button_selected,[data-v-6ebabfe4] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-6ebabfe4] .in-tooltip-wrapper-v2__icon{cursor:pointer}.auto-save-toggle[data-v-2c964af4]{position:relative}.auto-save-toggle__info-box[data-v-2c964af4]{position:absolute;top:100%;left:0;z-index:10;width:280px}.editor-actions[data-v-baf7a5dd]{gap:4px}.header-wrapper[data-v-d11dd577]{min-width:1000px}.guido-loading__wrapper[data-v-07c4b2d8]{height:100%;top:75px!important;bottom:0!important}.validation-error-list[data-v-e48cebe9]{gap:16px}.validation-error-row[data-v-e48cebe9]{gap:8px;padding:24px;border:1px solid #E1E1E1;border-radius:8px}.validation-error-row__icon[data-v-e48cebe9]{flex-shrink:0;font-size:24px;line-height:0}.validation-error-row__text[data-v-e48cebe9]{font-size:13px;line-height:16px;color:#292929;word-break:break-word}.guido-editor__wrapper[data-v-
|
|
1
|
+
@charset "UTF-8";.auth-error-modal[data-v-b4d7ae51]{position:relative;z-index:145}.gap-16[data-v-5553d071],.gap-16[data-v-0e1b0c54]{gap:16px}[data-v-b8f24f34] .in-button-v2__wrapper{line-height:0}[data-v-22226124] .in-segments-wrapper__button_selected,[data-v-22226124] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb;color:#0010ac;border-color:#0010ac}[data-v-2cb418af] .in-progress-wrapper__progress p span:last-child{display:none!important}[data-v-2cb418af] .in-progress-description-status{display:none!important}.view-options-wrapper[data-v-87033101]{position:relative;display:inline-block}.new-tag[data-v-87033101]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-87033101] .guido__view-option-selection-desktop svg,[data-v-87033101] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-87033101] .in-segments-wrapper__button_selected,[data-v-87033101] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-87033101] .in-tooltip-wrapper-v2__icon{cursor:pointer}.editor-toolbar[data-v-173c3a40]{gap:4px}.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history[data-v-fad98586]{gap:8px}.version-history__toolbar[data-v-fad98586]{gap:4px}.view-options-wrapper[data-v-6ebabfe4]{position:relative;display:inline-block}.new-tag[data-v-6ebabfe4]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-6ebabfe4] .guido__verion-history-view-option-selection-desktop svg,[data-v-6ebabfe4] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-6ebabfe4] .in-segments-wrapper__button_selected,[data-v-6ebabfe4] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-6ebabfe4] .in-tooltip-wrapper-v2__icon{cursor:pointer}.auto-save-toggle[data-v-2c964af4]{position:relative}.auto-save-toggle__info-box[data-v-2c964af4]{position:absolute;top:100%;left:0;z-index:10;width:280px}.editor-actions[data-v-baf7a5dd]{gap:4px}.header-wrapper[data-v-d11dd577]{min-width:1000px}.guido-loading__wrapper[data-v-07c4b2d8]{height:100%;top:75px!important;bottom:0!important}.validation-error-list[data-v-e48cebe9]{gap:16px}.validation-error-row[data-v-e48cebe9]{gap:8px;padding:24px;border:1px solid #E1E1E1;border-radius:8px}.validation-error-row__icon[data-v-e48cebe9]{flex-shrink:0;font-size:24px;line-height:0}.validation-error-row__text[data-v-e48cebe9]{font-size:13px;line-height:16px;color:#292929;word-break:break-word}.guido-editor__wrapper[data-v-c5146fc5]{--ribbon-offset: 0px;position:relative;width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__container[data-v-c5146fc5]{width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__no-header[data-v-c5146fc5]{height:calc(100vh - 75px - var(--ribbon-offset))}[data-v-293f1c47] .in-breadcrumb-wrapper__links{cursor:pointer}.templates-wrapper[data-v-91a26acd]{gap:16px;grid-template-columns:repeat(3,1fr)}.templates-wrapper .template-wrapper[data-v-91a26acd]{cursor:pointer}.templates-wrapper .template-wrapper .template-container[data-v-91a26acd]{height:274px;padding:2px;transition:none}.templates-wrapper .template-wrapper .template-container.selected[data-v-91a26acd]{padding:1px}.templates-wrapper .template-wrapper .template-container .thumbnail[data-v-91a26acd]{object-fit:cover;transform:scale(1)}[data-v-b9a93c6e] .guido__verion-history-view-option-selection-desktop svg,[data-v-b9a93c6e] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-b9a93c6e] .in-segments-wrapper__button_selected,[data-v-b9a93c6e] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}.error-list[data-v-c3fd5d4b]{gap:16px}.desktop-browser-header[data-v-d86c5af5]{height:79px;min-height:79px}.desktop-browser-header__left[data-v-d86c5af5]{-webkit-user-drag:none;height:79px;width:378px}.desktop-browser-header__center[data-v-d86c5af5]{height:79px;background-repeat:repeat-x;background-size:auto 100%;background-position:left top}.desktop-browser-header__right[data-v-d86c5af5]{-webkit-user-drag:none;height:79px;width:112px}.desktop-preview[data-v-cf946232]{min-width:602px;height:70vh;min-height:583px;border-radius:10px}.desktop-preview iframe[data-v-cf946232]{min-height:504px}.iframe-wrapper[data-v-f255b2bb]{width:258px}.iframe-scaled[data-v-f255b2bb]{width:320px;height:124.0310077519%;transform:scale(.80625);transform-origin:top left}.cropped-text[data-v-eb3d05d7]{width:220px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mobile-preview-wrapper__phone[data-v-3f472f96]{width:282px}.mobile-preview-wrapper__phone img[data-v-3f472f96]{object-fit:cover;border-radius:44px}.mobile-preview-wrapper__content[data-v-3f472f96]{width:258px;height:450px;left:12px}[data-v-6bcaca8a] .vueperslides__parallax-wrapper{padding-bottom:110px!important}[data-v-f16f20f8] .vueperslides__bullets{pointer-events:none!important}[data-v-f16f20f8] .vueperslides__parallax-wrapper{padding-bottom:110px!important}[data-v-bb3cca55] .vueperslides__bullets{pointer-events:none!important}[data-v-bb3cca55] .vueperslides__parallax-wrapper{height:110px!important;padding-bottom:110px!important}[data-v-19d8cb42] .vueperslides__bullets,[data-v-ec2027ff] .vueperslides__bullets,[data-v-b09e80c4] .vueperslides__bullets{pointer-events:none!important}[data-v-b09e80c4] .vueperslides__parallax-wrapper{height:110px!important;padding-bottom:110px!important}[data-v-9bdef600] .vueperslides__parallax-wrapper{padding-bottom:110px!important}.assign-strategy-drawer-content .assign-strategy-select[data-v-6ce48dfd]{width:100%;max-width:none}.assign-strategy-drawer-content .assign-strategy-select[data-v-6ce48dfd] .in-skeleton{width:100%!important}.assign-strategy-drawer-content .assign-strategy-select[data-v-6ce48dfd] .in-dropdown-box__container{width:413px}.assign-strategy-drawer .spaced-dot-sep{background-image:linear-gradient(90deg,#91949f 20%,#fff0 0);background-position:center bottom;background-repeat:repeat-x;background-size:5px 1px}.assign-strategy-drawer .spaced-dot-sep--top{background-position:center top}.assign-strategy-drawer .spaced-dot-sep--fc-n:first-child{background:none}.legacy-strategy-updated-modal[data-v-da2225a1]{position:relative;z-index:145}
|
package/dist/library.js
CHANGED
|
@@ -1,22 +1,20 @@
|
|
|
1
1
|
import { default as a } from "./components/Guido.vue.js";
|
|
2
|
-
import { MessageType as t, ProductType as
|
|
2
|
+
import { MessageType as t, ProductType as d } from "./@types/config/schemas.js";
|
|
3
3
|
import "./@types/config/defaults.js";
|
|
4
|
-
import { getValidationErrors as
|
|
5
|
-
import { assignTrackingIds as
|
|
4
|
+
import { getValidationErrors as s, isValidConfig as p, parseConfig as g, parseConfigSafe as m, validateConfig as n } from "./@types/config/validator.js";
|
|
5
|
+
import { assignTrackingIds as u, readTrackFloor as x, readTrackSeq as T } from "./utils/linkTrackingIds.js";
|
|
6
6
|
import { useGuidoEmailEditorStore as C } from "./stores/guido-email-editor.js";
|
|
7
|
-
import { prefetchGuidoRuntime as E } from "./utils/runtimePrefetch.js";
|
|
8
7
|
export {
|
|
9
8
|
a as Guido,
|
|
10
9
|
t as MessageType,
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
E as prefetchGuidoRuntime,
|
|
10
|
+
d as ProductType,
|
|
11
|
+
u as assignTrackingIds,
|
|
12
|
+
s as getValidationErrors,
|
|
13
|
+
p as isValidConfig,
|
|
14
|
+
g as parseConfig,
|
|
15
|
+
m as parseConfigSafe,
|
|
18
16
|
x as readTrackFloor,
|
|
19
|
-
|
|
17
|
+
T as readTrackSeq,
|
|
20
18
|
C as useGuidoEmailEditorStore,
|
|
21
19
|
n as validateConfig
|
|
22
20
|
};
|
package/dist/package.json.js
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
const o =
|
|
2
|
-
|
|
3
|
-
guido: s
|
|
1
|
+
const o = { stripo: { version: "2.81.1" } }, s = {
|
|
2
|
+
guido: o
|
|
4
3
|
};
|
|
5
4
|
export {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
o as version
|
|
5
|
+
s as default,
|
|
6
|
+
o as guido
|
|
9
7
|
};
|
package/dist/src/library.d.ts
CHANGED
|
@@ -4,6 +4,5 @@ export { validateConfig, parseConfig, parseConfigSafe, isValidConfig, getValidat
|
|
|
4
4
|
export { assignTrackingIds, readTrackFloor, readTrackSeq } from './public/trackingIds';
|
|
5
5
|
export { useGuidoEmailEditorStore } from './public/editorState';
|
|
6
6
|
export type { GuidoEmailEditorState } from './public/editorState';
|
|
7
|
-
export { prefetchGuidoRuntime } from './public/prefetchRuntime';
|
|
8
7
|
export type { StripoEventType } from './@types/events';
|
|
9
8
|
export type { PositionData, DynamicContentEvent, MergeTagClickEvent, MergeTag, BaseDynamicContent, DynamicContentNode, DynamicContentList, TooltipOptions, TextValueObject, L10n, } from './@types/generic';
|
|
@@ -1,100 +1,108 @@
|
|
|
1
|
-
import { ITEMS_CURRENCY_ATTR as
|
|
2
|
-
import { productPairs as
|
|
3
|
-
import { escapeReplacement as
|
|
4
|
-
import { preserveTextStyles as
|
|
5
|
-
import { unwrapProductNameLinks as
|
|
6
|
-
const
|
|
1
|
+
import { ITEMS_CURRENCY_ATTR as U, isCustomCurrencySymbol as Y } from "../extensions/Blocks/Items/constants/currency.js";
|
|
2
|
+
import { productPairs as M } from "../extensions/Blocks/Items/enums/productEnums.js";
|
|
3
|
+
import { escapeReplacement as B } from "../extensions/Blocks/Items/utils/nodeConfigUtils.js";
|
|
4
|
+
import { preserveTextStyles as L } from "./preserveTextStyles.js";
|
|
5
|
+
import { unwrapProductNameLinks as X } from "./unwrapProductNameLink.js";
|
|
6
|
+
const q = {
|
|
7
7
|
CART_ITEMS: "ins_apr",
|
|
8
8
|
BROWSED_ITEMS: "browsed_item",
|
|
9
9
|
PURCHASED_ITEMS: "purchased_item"
|
|
10
|
-
},
|
|
11
|
-
function
|
|
12
|
-
let
|
|
13
|
-
for (;
|
|
14
|
-
|
|
15
|
-
return
|
|
10
|
+
}, W = ($) => $.replaceAll("{%", "<!--{%").replaceAll("%}", "%}-->");
|
|
11
|
+
function v($, C, A) {
|
|
12
|
+
let d = C;
|
|
13
|
+
for (; d > 0 && /\s/.test($[d - 1]); )
|
|
14
|
+
d -= 1;
|
|
15
|
+
return A.some((E) => $.endsWith(E, d));
|
|
16
16
|
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
17
|
+
const j = /(\s)href=(["'])(?:[^"']*#!|#)?\2/gi;
|
|
18
|
+
function Q($, C) {
|
|
19
|
+
var d;
|
|
20
|
+
const A = $.ownerDocument.createTreeWalker($, NodeFilter.SHOW_COMMENT);
|
|
21
|
+
for (let E = A.nextNode(); E; E = A.nextNode())
|
|
22
|
+
(d = E.nodeValue) != null && d.includes("[if mso]") && (E.nodeValue = E.nodeValue.replace(j, (k, P) => `${P}href="${C}"`));
|
|
23
|
+
}
|
|
24
|
+
function et($) {
|
|
25
|
+
const C = W($), A = new DOMParser().parseFromString(C, "text/html");
|
|
26
|
+
X(A);
|
|
27
|
+
const d = M.PAIRS_FOR_EXTENSION;
|
|
28
|
+
Object.entries(d).forEach(([o, p]) => {
|
|
29
|
+
A.querySelectorAll(".ins-product-td").forEach((r) => {
|
|
30
|
+
const _ = r.getAttribute("data-number") || "1", y = r.getAttribute("data-type") || "CART_ITEMS";
|
|
31
|
+
r.querySelectorAll(`[product-attr="${o}"]`).forEach((t) => {
|
|
32
|
+
var S, I, O, x;
|
|
33
|
+
const m = t.getAttribute("data-type") || y, n = t.getAttribute("data-number") || _, f = p[m];
|
|
27
34
|
if (f)
|
|
28
|
-
switch (
|
|
35
|
+
switch (o) {
|
|
29
36
|
case "imageSrc": {
|
|
30
|
-
let e = null,
|
|
31
|
-
if (t.tagName === "IMG" ? (e = t,
|
|
37
|
+
let e = null, s = null;
|
|
38
|
+
if (t.tagName === "IMG" ? (e = t, s = e.closest("a")) : (e = t.querySelector("img"), s = t.querySelector("a") || t.closest("a")), !e)
|
|
32
39
|
break;
|
|
33
40
|
const l = f.DEFAULT, c = f.ATTR;
|
|
34
41
|
if (l && e.src) {
|
|
35
|
-
const
|
|
36
|
-
l.some((
|
|
37
|
-
const u =
|
|
38
|
-
return
|
|
39
|
-
}) && (e.src = `{{${c}_${
|
|
42
|
+
const a = e.src;
|
|
43
|
+
l.some((g) => {
|
|
44
|
+
const u = g.split("/").pop() || "", H = a.split("/").pop() || "";
|
|
45
|
+
return a.includes(g) || a.includes(u) || H === u;
|
|
46
|
+
}) && (e.src = `{{${c}_${n}}}`);
|
|
40
47
|
}
|
|
41
|
-
const i = (
|
|
42
|
-
if (i && e.setAttribute("alt", `{{${i}_${
|
|
43
|
-
const
|
|
44
|
-
if (
|
|
45
|
-
const
|
|
46
|
-
(u === "#" || u === "" || u.endsWith("#!") || u.endsWith(
|
|
48
|
+
const i = (I = (S = d.name) == null ? void 0 : S[m]) == null ? void 0 : I.ATTR;
|
|
49
|
+
if (i && e.setAttribute("alt", `{{${i}_${n}}}`), s) {
|
|
50
|
+
const a = (O = d.itemLink) == null ? void 0 : O[m];
|
|
51
|
+
if (a) {
|
|
52
|
+
const b = a.HREF, g = a.DEFAULT_HREF || "#!", u = s.href;
|
|
53
|
+
(u === "#" || u === "" || u.endsWith("#!") || u.endsWith(g) || u === `${window.location.href}${g}` || !u || u === window.location.href) && (s.href = `{{${b}_${n}}}`);
|
|
47
54
|
}
|
|
48
55
|
}
|
|
49
56
|
break;
|
|
50
57
|
}
|
|
51
58
|
case "name": {
|
|
52
|
-
const e = f,
|
|
53
|
-
t.textContent && (t.innerHTML =
|
|
59
|
+
const e = f, s = e.ATTR, l = e.DEFAULT_HREF || "#!", c = e.HREF;
|
|
60
|
+
t.textContent && (t.innerHTML = L(t, `{{${s}_${n}}}`));
|
|
54
61
|
const i = t.closest("a") || (t.tagName === "A" ? t : null);
|
|
55
62
|
if (i && c) {
|
|
56
|
-
const
|
|
57
|
-
(
|
|
63
|
+
const a = i.href, b = `${window.location.href}${l}`;
|
|
64
|
+
(a === b || a.endsWith(l)) && (i.href = `{{${c}_${n}}}`);
|
|
58
65
|
}
|
|
59
66
|
break;
|
|
60
67
|
}
|
|
61
68
|
case "price":
|
|
62
69
|
case "originalPrice": {
|
|
63
|
-
const e = f,
|
|
64
|
-
let
|
|
65
|
-
i ?
|
|
66
|
-
const
|
|
67
|
-
let u = `{{${
|
|
68
|
-
const H = (t.getAttribute(
|
|
69
|
-
let
|
|
70
|
-
G ?
|
|
70
|
+
const e = f, s = t.getAttribute("data-formated"), l = t.getAttribute("data-single_price"), c = s === "true", i = l === "true", a = t.getAttribute(U.POSITION) || "before";
|
|
71
|
+
let b;
|
|
72
|
+
i ? b = c ? e.SINGLE_PRICE_FORMATTED : e.SINGLE_PRICE : b = c ? e.PRICE_FORMATTED : e.PRICE;
|
|
73
|
+
const g = e.CURRENCY;
|
|
74
|
+
let u = `{{${b}_${n}}}`;
|
|
75
|
+
const H = (t.getAttribute(U.SYMBOL) || "").trim(), G = Y(H);
|
|
76
|
+
let F = "";
|
|
77
|
+
G ? F = H : g && (F = `{{${g}_${n}}}`), F && (u = a === "after" ? `${u} ${F}` : `${F} ${u}`), t.innerHTML = L(t, u);
|
|
71
78
|
break;
|
|
72
79
|
}
|
|
73
80
|
case "quantity": {
|
|
74
|
-
const e = f,
|
|
75
|
-
c && l.includes(c) && (t.innerHTML =
|
|
81
|
+
const e = f, s = e.ATTR, l = [e.DEFAULT, ...e.LEGACY_DEFAULTS], c = (x = t.textContent) == null ? void 0 : x.trim();
|
|
82
|
+
c && l.includes(c) && (t.innerHTML = L(t, `{{${s}_${n}}}`));
|
|
76
83
|
break;
|
|
77
84
|
}
|
|
78
85
|
case "button": {
|
|
79
|
-
const e = f,
|
|
86
|
+
const e = f, s = e.HREF, l = e.DEFAULT_HREF || "#!", c = t.tagName === "A" ? t : t.querySelector("a");
|
|
80
87
|
if (c) {
|
|
81
|
-
const i = c.href || "",
|
|
82
|
-
(i === "" || i === "#" || i ===
|
|
88
|
+
const i = c.href || "", a = `${window.location.href}${l}`;
|
|
89
|
+
(i === "" || i === "#" || i === a || i.endsWith(l) || i.endsWith("#!") || i === window.location.href) && (c.href = `{{${s}_${n}}}`);
|
|
83
90
|
}
|
|
91
|
+
Q(t, `{{${s}_${n}}}`);
|
|
84
92
|
break;
|
|
85
93
|
}
|
|
86
94
|
case "itemLink": {
|
|
87
|
-
const e = f,
|
|
95
|
+
const e = f, s = e.HREF, l = e.DEFAULT_HREF || "#!", c = t;
|
|
88
96
|
if (c.href) {
|
|
89
|
-
const i = c.href,
|
|
90
|
-
(i ===
|
|
97
|
+
const i = c.href, a = `${window.location.href}${l}`;
|
|
98
|
+
(i === a || i.endsWith(l)) && (c.href = `{{${s}_${n}}}`);
|
|
91
99
|
}
|
|
92
100
|
break;
|
|
93
101
|
}
|
|
94
102
|
default: {
|
|
95
103
|
if ("ATTR" in f) {
|
|
96
104
|
const e = f.ATTR;
|
|
97
|
-
t.textContent && (t.innerHTML =
|
|
105
|
+
t.textContent && (t.innerHTML = L(t, `{{${e}_${n}}}`));
|
|
98
106
|
}
|
|
99
107
|
break;
|
|
100
108
|
}
|
|
@@ -102,49 +110,49 @@ function Z(S) {
|
|
|
102
110
|
});
|
|
103
111
|
});
|
|
104
112
|
});
|
|
105
|
-
const
|
|
106
|
-
` : "",
|
|
107
|
-
|
|
108
|
-
const
|
|
109
|
-
|
|
110
|
-
element:
|
|
113
|
+
const E = C.match(/<!DOCTYPE[^>]*>/i), k = E ? `${E[0]}
|
|
114
|
+
` : "", P = A.querySelectorAll(".ins-product-td"), N = [];
|
|
115
|
+
P.forEach((o) => {
|
|
116
|
+
const p = o.getAttribute("data-type") || "CART_ITEMS", T = o.getAttribute("data-number") || "1", r = o.outerHTML;
|
|
117
|
+
N.push({
|
|
118
|
+
element: o,
|
|
111
119
|
outerHtml: r,
|
|
112
|
-
type:
|
|
113
|
-
number:
|
|
120
|
+
type: p,
|
|
121
|
+
number: T
|
|
114
122
|
});
|
|
115
123
|
});
|
|
116
|
-
let
|
|
117
|
-
|
|
118
|
-
const r =
|
|
119
|
-
if (
|
|
120
|
-
const
|
|
121
|
-
|
|
124
|
+
let h = k + A.documentElement.outerHTML;
|
|
125
|
+
N.reverse().forEach(({ outerHtml: o, type: p, number: T }) => {
|
|
126
|
+
const r = q[p], _ = r ? `${r}_total_product_kind` : "";
|
|
127
|
+
if (_) {
|
|
128
|
+
const R = parseInt(T) - 1, n = `${`{% if ${_} > ${R} %}`}${o}{% endif %}`;
|
|
129
|
+
h = h.replace(o, B(n));
|
|
122
130
|
}
|
|
123
131
|
});
|
|
124
|
-
const V =
|
|
125
|
-
return V.forEach((
|
|
132
|
+
const V = A.querySelectorAll('[product-attr="originalPrice"][data-type]'), w = /* @__PURE__ */ new Map(), D = /* @__PURE__ */ new Set();
|
|
133
|
+
return V.forEach((o) => {
|
|
126
134
|
var t;
|
|
127
|
-
const
|
|
128
|
-
if (!
|
|
135
|
+
const p = o.getAttribute("data-number"), T = o.getAttribute("data-type");
|
|
136
|
+
if (!p || !q[T])
|
|
129
137
|
return;
|
|
130
|
-
const r =
|
|
131
|
-
if (!r ||
|
|
138
|
+
const r = o.closest(".product-original-price-class");
|
|
139
|
+
if (!r || D.has(r))
|
|
132
140
|
return;
|
|
133
|
-
|
|
134
|
-
const
|
|
135
|
-
|
|
136
|
-
}),
|
|
137
|
-
if (r.includes("{% if") || !
|
|
141
|
+
D.add(r);
|
|
142
|
+
const _ = r.outerHTML, y = (t = o.closest(".ins-product-td")) == null ? void 0 : t.getAttribute("data-nodup"), R = w.get(_) ?? { number: p, type: T, wrap: [] };
|
|
143
|
+
R.wrap.push(y !== "false"), w.set(_, R);
|
|
144
|
+
}), w.forEach(({ number: o, type: p, wrap: T }, r) => {
|
|
145
|
+
if (r.includes("{% if") || !T.some(Boolean))
|
|
138
146
|
return;
|
|
139
|
-
const
|
|
140
|
-
let
|
|
141
|
-
for (;
|
|
142
|
-
const
|
|
143
|
-
|
|
147
|
+
const _ = M.PAIRS_FOR_EXTENSION.price[p].PRICE, y = M.PAIRS_FOR_EXTENSION.originalPrice[p].PRICE, R = `{% if ${_}_${o} != ${y}_${o} %}`, t = [R, W(R)];
|
|
148
|
+
let m = "", n = 0, f = 0, S = h.indexOf(r);
|
|
149
|
+
for (; S !== -1; ) {
|
|
150
|
+
const I = T[f] === !0 && !v(h, S, t);
|
|
151
|
+
m += h.slice(n, S) + (I ? `${R}${r}{% endif %}` : r), n = S + r.length, f += 1, S = h.indexOf(r, n);
|
|
144
152
|
}
|
|
145
|
-
|
|
146
|
-
}),
|
|
153
|
+
h = m + h.slice(n);
|
|
154
|
+
}), h.replaceAll("<!--{%", "{%").replaceAll("%}-->", "%}").replaceAll("<!--{%", "{%").replaceAll("%}-->", "%}");
|
|
147
155
|
}
|
|
148
156
|
export {
|
|
149
|
-
|
|
157
|
+
et as pairProductVariables
|
|
150
158
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@useinsider/guido",
|
|
3
|
-
"version": "3.21.2-beta.
|
|
3
|
+
"version": "3.21.2-beta.eea8885",
|
|
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",
|
|
@@ -22,10 +22,6 @@
|
|
|
22
22
|
"types": "./dist/src/public/editorState.d.ts",
|
|
23
23
|
"import": "./dist/public/editorState.js"
|
|
24
24
|
},
|
|
25
|
-
"./prefetch": {
|
|
26
|
-
"types": "./dist/src/public/prefetchRuntime.d.ts",
|
|
27
|
-
"import": "./dist/public/prefetchRuntime.js"
|
|
28
|
-
},
|
|
29
25
|
"./style": "./dist/guido.css"
|
|
30
26
|
},
|
|
31
27
|
"scripts": {
|
|
@@ -49,7 +45,6 @@
|
|
|
49
45
|
"coverage:e2e:report": "nyc report --reporter=lcov --reporter=text-summary --report-dir=coverage/e2e",
|
|
50
46
|
"test:mutation": "stryker run",
|
|
51
47
|
"test:mutation:since": "CHANGED=$(git diff --name-only --diff-filter=AMR origin/develop...HEAD -- 'src/**/*.ts' ':(glob)src/components/organisms/onboarding/**/*.vue' ':(glob)src/components/organisms/header/**/*.vue' ':(glob)src/components/organisms/unsubscribe/**/*.vue' ':(glob)src/components/organisms/save-as-template/**/*.vue' ':(glob)src/components/organisms/email-preview/**/*.vue' ':(glob)src/components/wrappers/**/*.vue' 'src/components/Guido.vue' ':(exclude)src/**/*.test.ts' ':(exclude)src/**/index.ts' ':(exclude)src/@types/**' ':(exclude)src/enums/**' ':(exclude)src/mock/**' ':(exclude)src/**/_Boilerplate/**' | paste -sd, -); if [ -n \"$CHANGED\" ]; then stryker run --incremental --mutate \"$CHANGED\"; else echo \"No changed mutatable src files vs origin/develop\"; fi",
|
|
52
|
-
"stripo:manifest": "node scripts/stripo-runtime-manifest.mjs",
|
|
53
48
|
"prepare": "husky",
|
|
54
49
|
"preinstall": "rm -rf ./node_modules/.vite"
|
|
55
50
|
},
|
|
@@ -1,164 +0,0 @@
|
|
|
1
|
-
import { SYNC_MODULE_CLASS as w } from "./useSyncModuleExtractor.js";
|
|
2
|
-
import { readRuntimePrefetchState as M } from "../utils/runtimePrefetch.js";
|
|
3
|
-
import f from "../package.json.js";
|
|
4
|
-
const s = "guido:open:", k = "total", A = [
|
|
5
|
-
"setup",
|
|
6
|
-
"host_ready",
|
|
7
|
-
"migration_start",
|
|
8
|
-
"migration_end",
|
|
9
|
-
"default_template_start",
|
|
10
|
-
"default_template_end",
|
|
11
|
-
"timer_clone_start",
|
|
12
|
-
"timer_clone_end",
|
|
13
|
-
"plugin_start",
|
|
14
|
-
"script_ready",
|
|
15
|
-
"fonts_sync_ready",
|
|
16
|
-
"blocks_config_ready",
|
|
17
|
-
"init_editor",
|
|
18
|
-
"token_start",
|
|
19
|
-
"token_end",
|
|
20
|
-
"ready"
|
|
21
|
-
], p = [
|
|
22
|
-
["host_wait", "setup", "host_ready"],
|
|
23
|
-
["migration", "migration_start", "migration_end"],
|
|
24
|
-
["default_template", "default_template_start", "default_template_end"],
|
|
25
|
-
["timer_clone", "timer_clone_start", "timer_clone_end"],
|
|
26
|
-
["script", "plugin_start", "script_ready"],
|
|
27
|
-
["fonts_sync", "script_ready", "fonts_sync_ready"],
|
|
28
|
-
["blocks_config", "fonts_sync_ready", "blocks_config_ready"],
|
|
29
|
-
["editor_config", "blocks_config_ready", "init_editor"],
|
|
30
|
-
["stripo_load", "init_editor", "ready"],
|
|
31
|
-
["token", "token_start", "token_end"]
|
|
32
|
-
], b = (e) => new RegExp(`(?:^|[\\s"'])(?:${e})(?=[\\s"'])`, "g"), N = /<img\b/gi, $ = b(w), C = /\srecommendation-id=/g, O = b("items-block-v2|esd-(?:cart|browsed|purchased)-items-block"), I = "esd-timer-id", g = {
|
|
33
|
-
html_bytes: null,
|
|
34
|
-
css_bytes: null,
|
|
35
|
-
image_count: null,
|
|
36
|
-
synced_module_count: null,
|
|
37
|
-
recommendation_block_count: null,
|
|
38
|
-
items_block_count: null,
|
|
39
|
-
has_timers: null,
|
|
40
|
-
force_recreate: null
|
|
41
|
-
};
|
|
42
|
-
let d = null;
|
|
43
|
-
const i = (e) => {
|
|
44
|
-
try {
|
|
45
|
-
e();
|
|
46
|
-
} catch (t) {
|
|
47
|
-
console.debug("guido:open: metrics step failed", t);
|
|
48
|
-
}
|
|
49
|
-
}, E = () => window.DD_RUM, y = (e, t) => e === void 0 || t === void 0 ? null : Math.round(t - e), _ = (e, t) => {
|
|
50
|
-
var r;
|
|
51
|
-
return ((r = e.match(t)) == null ? void 0 : r.length) ?? 0;
|
|
52
|
-
}, h = (e) => new TextEncoder().encode(e).length, L = (e) => {
|
|
53
|
-
if (!e)
|
|
54
|
-
return g;
|
|
55
|
-
try {
|
|
56
|
-
const { html: t, css: r, forceRecreate: o } = e;
|
|
57
|
-
return {
|
|
58
|
-
html_bytes: h(t),
|
|
59
|
-
css_bytes: h(r),
|
|
60
|
-
image_count: _(t, N),
|
|
61
|
-
synced_module_count: _(t, $),
|
|
62
|
-
recommendation_block_count: _(t, C),
|
|
63
|
-
items_block_count: _(t, O),
|
|
64
|
-
has_timers: t.includes(I),
|
|
65
|
-
force_recreate: o
|
|
66
|
-
};
|
|
67
|
-
} catch (t) {
|
|
68
|
-
return console.debug("guido:open: template weight failed", t), g;
|
|
69
|
-
}
|
|
70
|
-
}, T = () => {
|
|
71
|
-
i(() => {
|
|
72
|
-
A.forEach((e) => performance.clearMarks(`${s}${e}`)), [...p.map(([e]) => e), k].forEach((e) => performance.clearMeasures(`${s}${e}`));
|
|
73
|
-
});
|
|
74
|
-
}, v = (e) => {
|
|
75
|
-
const t = {
|
|
76
|
-
marks: {},
|
|
77
|
-
context: null,
|
|
78
|
-
template: null,
|
|
79
|
-
scriptPreloaded: null,
|
|
80
|
-
runtimePrefetch: null,
|
|
81
|
-
wasBackgrounded: document.visibilityState === "hidden",
|
|
82
|
-
finished: e,
|
|
83
|
-
onVisibilityChange: () => {
|
|
84
|
-
document.visibilityState === "hidden" && (t.wasBackgrounded = !0);
|
|
85
|
-
}
|
|
86
|
-
};
|
|
87
|
-
return t;
|
|
88
|
-
}, l = (e, t) => {
|
|
89
|
-
if (e.finished || e.marks[t] !== void 0)
|
|
90
|
-
return;
|
|
91
|
-
const r = performance.now();
|
|
92
|
-
e.marks[t] = r, e === d && i(() => performance.mark(`${s}${t}`, { startTime: r }));
|
|
93
|
-
}, u = (e) => {
|
|
94
|
-
e.finished = !0, document.removeEventListener("visibilitychange", e.onVisibilityChange);
|
|
95
|
-
}, B = (e, t) => {
|
|
96
|
-
const { marks: r } = e, o = p.map(([n, a, c]) => [n, r[a], r[c]]);
|
|
97
|
-
o.push([k, r.setup, t]), o.forEach(([n, a, c]) => {
|
|
98
|
-
a !== void 0 && c !== void 0 && i(() => performance.measure(`${s}${n}`, { start: a, end: c }));
|
|
99
|
-
});
|
|
100
|
-
}, D = (e, t, r) => {
|
|
101
|
-
const { marks: o, context: n } = e, a = Object.fromEntries(
|
|
102
|
-
p.map(([c, R, S]) => [`${c}_ms`, y(o[R], o[S])])
|
|
103
|
-
);
|
|
104
|
-
return {
|
|
105
|
-
outcome: t,
|
|
106
|
-
open_ms: y(o.setup, r),
|
|
107
|
-
...a,
|
|
108
|
-
script_preloaded: e.scriptPreloaded,
|
|
109
|
-
runtime_prefetch: e.runtimePrefetch,
|
|
110
|
-
...L(e.template),
|
|
111
|
-
partner_name: (n == null ? void 0 : n.partnerName) ?? null,
|
|
112
|
-
product_type: (n == null ? void 0 : n.productType) ?? null,
|
|
113
|
-
template_id: (n == null ? void 0 : n.templateId) ?? null,
|
|
114
|
-
variation_id: (n == null ? void 0 : n.variationId) ?? null,
|
|
115
|
-
guido_version: f.version,
|
|
116
|
-
stripo_version: f.guido.stripo.version,
|
|
117
|
-
was_backgrounded: e.wasBackgrounded
|
|
118
|
-
};
|
|
119
|
-
}, m = (e, t) => {
|
|
120
|
-
i(() => {
|
|
121
|
-
const r = e.marks.ready ?? performance.now(), o = D(e, t, r);
|
|
122
|
-
e.template = null, e === d && B(e, r), console.debug("guido:open", o), i(() => {
|
|
123
|
-
var n, a;
|
|
124
|
-
return (a = (n = E()) == null ? void 0 : n.addAction) == null ? void 0 : a.call(n, "guido_editor_open", o);
|
|
125
|
-
});
|
|
126
|
-
});
|
|
127
|
-
}, P = (e) => ({
|
|
128
|
-
mark: (t) => l(e, t),
|
|
129
|
-
timed: async (t, r) => {
|
|
130
|
-
l(e, `${t}_start`);
|
|
131
|
-
const o = await r();
|
|
132
|
-
return l(e, `${t}_end`), o;
|
|
133
|
-
},
|
|
134
|
-
setContext: (t) => {
|
|
135
|
-
e.context = t;
|
|
136
|
-
},
|
|
137
|
-
setTemplate: (t) => {
|
|
138
|
-
e.template = t;
|
|
139
|
-
},
|
|
140
|
-
setScriptPreloaded: (t) => {
|
|
141
|
-
e.scriptPreloaded = t;
|
|
142
|
-
},
|
|
143
|
-
markReady: () => {
|
|
144
|
-
e.finished || (l(e, "ready"), u(e), i(() => {
|
|
145
|
-
var t, r;
|
|
146
|
-
return (r = (t = E()) == null ? void 0 : t.addTiming) == null ? void 0 : r.call(t, "guido_editor_ready");
|
|
147
|
-
}), setTimeout(() => m(e, "ready"), 0));
|
|
148
|
-
},
|
|
149
|
-
markFailed: () => {
|
|
150
|
-
e.finished || (u(e), m(e, "error"));
|
|
151
|
-
},
|
|
152
|
-
dispose: () => {
|
|
153
|
-
e.finished || (u(e), m(e, "abandoned")), e === d && (T(), d = null);
|
|
154
|
-
}
|
|
155
|
-
}), F = () => {
|
|
156
|
-
const e = v(!1);
|
|
157
|
-
return T(), d = e, i(() => {
|
|
158
|
-
e.runtimePrefetch = M();
|
|
159
|
-
}), document.addEventListener("visibilitychange", e.onVisibilityChange), l(e, "setup"), P(e);
|
|
160
|
-
}, G = () => P(d ?? v(!0));
|
|
161
|
-
export {
|
|
162
|
-
F as startEditorOpenMetrics,
|
|
163
|
-
G as useEditorOpenMetrics
|
|
164
|
-
};
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
export type TimedOpenPhase = 'migration' | 'default_template' | 'timer_clone';
|
|
2
|
-
export type OpenPhase = 'setup' | 'host_ready' | `${TimedOpenPhase}_start` | `${TimedOpenPhase}_end` | 'plugin_start' | 'script_ready' | 'fonts_sync_ready' | 'blocks_config_ready' | 'init_editor' | 'token_start' | 'token_end' | 'ready';
|
|
3
|
-
export type OpenOutcome = 'ready' | 'error' | 'abandoned';
|
|
4
|
-
export interface OpenContext {
|
|
5
|
-
partnerName: string;
|
|
6
|
-
productType: number;
|
|
7
|
-
templateId: string;
|
|
8
|
-
variationId: string;
|
|
9
|
-
}
|
|
10
|
-
export interface OpenTemplate {
|
|
11
|
-
html: string;
|
|
12
|
-
css: string;
|
|
13
|
-
forceRecreate: boolean;
|
|
14
|
-
}
|
|
15
|
-
export interface EditorOpenMetrics {
|
|
16
|
-
mark: (phase: OpenPhase) => void;
|
|
17
|
-
timed: <T>(phase: TimedOpenPhase, task: () => Promise<T>) => Promise<T>;
|
|
18
|
-
setContext: (context: OpenContext) => void;
|
|
19
|
-
setTemplate: (template: OpenTemplate) => void;
|
|
20
|
-
setScriptPreloaded: (preloaded: boolean) => void;
|
|
21
|
-
markReady: () => void;
|
|
22
|
-
markFailed: () => void;
|
|
23
|
-
dispose: () => void;
|
|
24
|
-
}
|
|
25
|
-
export declare const startEditorOpenMetrics: () => EditorOpenMetrics;
|
|
26
|
-
/** Binds to the session open at call time, so a remounted editor never writes into its replacement's session. */
|
|
27
|
-
export declare const useEditorOpenMetrics: () => EditorOpenMetrics;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { prefetchGuidoRuntime } from '../utils/runtimePrefetch';
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
const s = "2.81.1", n = ["UIEditor.js", "zone.js", "styles-BWH3PMR4.css", "polyfills-FF3RLU5F.js", "main-5LCHF56A.js", "chunk-2HYLRI4G.js", "chunk-4SN7BSQN.js", "chunk-5IY7ZG3R.js", "chunk-62K3AMOD.js", "chunk-GK543IRH.js", "chunk-L2EPGQ76.js", "chunk-LXS5IGCQ.js", "chunk-PNWIGF4L.js", "chunk-S2TYCIH3.js", "chunk-S5UZ4LUK.js", "chunk-V2AGQPVL.js", "chunk-XZ6MUAN5.js", "chunk-ZPL4VL4O.js", "assets/css/uiEditor.css", "assets/i18n/en.json", "assets/icons/ui-editor-icons.sprite.svg", "assets/icons/ui-editor-icons.map.json", "assets/imageeditor/scripts.min.js", "assets/imageeditor/assets/icons/merged.svg"], i = {
|
|
2
|
-
version: s,
|
|
3
|
-
files: n
|
|
4
|
-
};
|
|
5
|
-
export {
|
|
6
|
-
i as default,
|
|
7
|
-
n as files,
|
|
8
|
-
s as version
|
|
9
|
-
};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import s from "../static/stripo-runtime-manifest.json.js";
|
|
2
|
-
import { getStripoRuntimeBaseUrl as c } from "./stripoRuntime.js";
|
|
3
|
-
const r = "data-guido-prefetch", d = "pending", o = "settled", i = `link[${r}]`, u = ["slow-2g", "2g"], l = /\.(?:js|json)$/, a = () => document.getElementById("UiEditorScript") !== null || window.UIEditor !== void 0, E = () => {
|
|
4
|
-
const { connection: e } = navigator;
|
|
5
|
-
return (e == null ? void 0 : e.saveData) === !0 || u.includes((e == null ? void 0 : e.effectiveType) ?? "");
|
|
6
|
-
}, m = (e) => {
|
|
7
|
-
const t = document.createElement("link"), n = () => t.setAttribute(r, o);
|
|
8
|
-
t.rel = "prefetch", t.href = e, l.test(e) && t.setAttribute("crossorigin", "anonymous"), t.setAttribute(r, d), t.addEventListener("load", n, { once: !0 }), t.addEventListener("error", n, { once: !0 }), document.head.appendChild(t);
|
|
9
|
-
}, T = () => {
|
|
10
|
-
try {
|
|
11
|
-
const e = c(), t = document.querySelector(i) !== null;
|
|
12
|
-
if (!e || t || a() || E())
|
|
13
|
-
return;
|
|
14
|
-
s.files.forEach((n) => m(`${e}${n}`));
|
|
15
|
-
} catch (e) {
|
|
16
|
-
console.debug("guido: runtime prefetch skipped", e);
|
|
17
|
-
}
|
|
18
|
-
}, g = () => {
|
|
19
|
-
const e = Array.from(document.querySelectorAll(i));
|
|
20
|
-
return e.length ? e.every((t) => t.getAttribute(r) === o) ? "done" : "pending" : "none";
|
|
21
|
-
};
|
|
22
|
-
export {
|
|
23
|
-
r as RUNTIME_PREFETCH_ATTRIBUTE,
|
|
24
|
-
T as prefetchGuidoRuntime,
|
|
25
|
-
g as readRuntimePrefetchState
|
|
26
|
-
};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import r from "../package.json.js";
|
|
2
|
-
const e = "https://email-static.useinsider.com/guido/", n = () => {
|
|
3
|
-
var s;
|
|
4
|
-
const t = r.guido, o = (s = t == null ? void 0 : t.stripo) == null ? void 0 : s.version;
|
|
5
|
-
return o ? `${e}${o}/` : null;
|
|
6
|
-
};
|
|
7
|
-
export {
|
|
8
|
-
n as getStripoRuntimeBaseUrl
|
|
9
|
-
};
|