@useinsider/guido 3.9.1 → 3.10.0-beta.076d56a
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/composables/useCortexBlueprintBridge.js +36 -32
- package/dist/composables/useCustomInterfaceAppearance.js +16 -18
- package/dist/composables/useEmailTemplateApplier.js +17 -15
- package/dist/composables/useExport.js +18 -18
- package/dist/composables/useHtmlValidator.js +90 -90
- package/dist/composables/useStripo.js +53 -51
- package/dist/composables/useStripoNotifications.js +26 -0
- package/dist/composables/useToaster.js +11 -11
- package/dist/composables/useVersionHistoryApi.js +2 -2
- package/dist/composables/validators/useLiquidValidator.js +1 -1
- package/dist/composables/validators/useUnsubscribeBlockValidator.js +10 -10
- package/dist/config/compiler/htmlCompilerRules.js +30 -7
- package/dist/config/compiler/utils/recommendationCompilerUtils.js +137 -119
- package/dist/config/i18n/en/labels.json.js +4 -1
- package/dist/enums/defaults.js +7 -4
- package/dist/enums/toaster.js +2 -2
- package/dist/enums/unsubscribe.js +41 -36
- package/dist/extensions/Blocks/Checkbox/block.js +5 -3
- package/dist/extensions/Blocks/Checkbox/control.js +42 -28
- package/dist/extensions/Blocks/Items/controls/price/currencySymbol.js +1 -1
- package/dist/extensions/Blocks/RadioButton/block.js +9 -7
- package/dist/extensions/Blocks/RadioButton/control.js +64 -50
- package/dist/extensions/Blocks/Recommendation/useRecommendationBlockWarning.js +7 -7
- package/dist/extensions/Blocks/Recommendation/utils/captureStyleTemplates.js +75 -69
- package/dist/extensions/Blocks/Recommendation/validation/requiredFields.js +18 -17
- package/dist/services/blankTemplate.js +34 -0
- package/dist/services/stripoApi.js +13 -18
- package/dist/services/templateLibraryApi.js +8 -7
- package/dist/src/composables/useCortexBlueprintBridge.d.ts +5 -2
- package/dist/src/composables/useEmailTemplateApplier.d.ts +8 -3
- package/dist/src/composables/useStripoNotifications.d.ts +10 -0
- package/dist/src/enums/defaults.d.ts +3 -0
- package/dist/src/enums/toaster.d.ts +2 -2
- package/dist/src/enums/unsubscribe.d.ts +2 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/captureStyleTemplates.d.ts +6 -0
- package/dist/src/extensions/Blocks/Recommendation/validation/requiredFields.d.ts +1 -0
- package/dist/src/services/blankTemplate.d.ts +11 -0
- package/dist/src/stores/toaster.d.ts +2 -3
- package/dist/static/styles/components/dropdown-menu.css.js +12 -0
- package/dist/stores/toaster.js +10 -10
- package/dist/utils/pairProductVariables.js +64 -65
- package/package.json +2 -2
- package/dist/static/styles/components/notification.css.js +0 -74
- package/dist/static/templates/empty/index.html.js +0 -74
- package/dist/static/templates/empty/style.css.js +0 -779
|
@@ -4,11 +4,12 @@ import { useToaster as C } from "../composables/useToaster.js";
|
|
|
4
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
|
-
import {
|
|
8
|
-
import {
|
|
7
|
+
import { ToasterTypeOptions as N } from "../enums/toaster.js";
|
|
8
|
+
import { useRecommendationExtensionStore as x } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
9
|
+
import { useSaveAsTemplateStore as E } from "../stores/save-as-template.js";
|
|
9
10
|
import { base64EncodeWithSpecialChars as r } from "../utils/base64.js";
|
|
10
11
|
import { useTemplatePreparation as A } from "../utils/templatePreparation.js";
|
|
11
|
-
const
|
|
12
|
+
const j = () => {
|
|
12
13
|
const { get: n, post: m } = b(), { handleError: o, showToaster: l } = C(), { config: c, isFeatureEnabled: p } = w(), { validateLiquidSyntax: g } = S(), u = h();
|
|
13
14
|
return {
|
|
14
15
|
getCategories: async () => {
|
|
@@ -39,7 +40,7 @@ const $ = () => {
|
|
|
39
40
|
createTemplate: async () => {
|
|
40
41
|
var e, t, d, y;
|
|
41
42
|
try {
|
|
42
|
-
const { prepareTemplateDetails: i } = A(), s =
|
|
43
|
+
const { prepareTemplateDetails: i } = A(), s = E(), a = await i();
|
|
43
44
|
if (p("liquidSyntax") && !await g(a.compiledHtml))
|
|
44
45
|
return !1;
|
|
45
46
|
const f = {
|
|
@@ -53,7 +54,7 @@ const $ = () => {
|
|
|
53
54
|
unsubscriptionPreferencePageStatus: !1,
|
|
54
55
|
unsubscriptionPreferencePages: [],
|
|
55
56
|
recommendationCampaignUrls: r(
|
|
56
|
-
|
|
57
|
+
x().recommendationCampaignUrls
|
|
57
58
|
),
|
|
58
59
|
recommendationConfigs: r({}),
|
|
59
60
|
isGuido: !0,
|
|
@@ -74,7 +75,7 @@ const $ = () => {
|
|
|
74
75
|
"newsletter.template-library-save-alert",
|
|
75
76
|
{ templateName: s.getTemplateName }
|
|
76
77
|
),
|
|
77
|
-
type:
|
|
78
|
+
type: N.Error
|
|
78
79
|
}), !1) : (l({
|
|
79
80
|
message: u(
|
|
80
81
|
"newsletter.template-library-save-success",
|
|
@@ -89,5 +90,5 @@ const $ = () => {
|
|
|
89
90
|
};
|
|
90
91
|
};
|
|
91
92
|
export {
|
|
92
|
-
|
|
93
|
+
j as useTemplateLibraryApi
|
|
93
94
|
};
|
|
@@ -9,8 +9,11 @@
|
|
|
9
9
|
* The bridge handles two segment shapes:
|
|
10
10
|
*
|
|
11
11
|
* - `blueprint` segments with `blueprintType === 'email_template'` are
|
|
12
|
-
* applied to the Stripo editor
|
|
13
|
-
*
|
|
12
|
+
* applied to the Stripo editor, but ONLY after the user clicks
|
|
13
|
+
* "Apply to editor" in cortex-fe (which sets `applyRequested` on the
|
|
14
|
+
* segment). Before that the template is marked `pending` and nothing is
|
|
15
|
+
* written to Stripo. Once applied, refines flow through debounced;
|
|
16
|
+
* identical-html no-ops.
|
|
14
17
|
* - `error` segments (and message-level `isError` / `isCancelled`) trigger
|
|
15
18
|
* a localized toaster.
|
|
16
19
|
*
|
|
@@ -2,12 +2,17 @@ type ApplyStatus = 'pending' | 'applying' | 'applied' | 'failed';
|
|
|
2
2
|
/**
|
|
3
3
|
* Applies email_template blueprints from the chat agent to the Stripo editor.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
5
|
+
* The first apply is gated behind the user's "Apply to editor" click — until
|
|
6
|
+
* then a blueprint is only marked `pending` (see `markPending`) and nothing is
|
|
7
|
+
* written to the editor.
|
|
8
|
+
*
|
|
9
|
+
* - manual Apply click (first apply): immediate.
|
|
10
|
+
* - blueprint_update after the user has applied once: debounced 250 ms trailing
|
|
11
|
+
* so rapid mid-stream updates don't thrash updateHtmlAndCss.
|
|
8
12
|
*/
|
|
9
13
|
export declare const useEmailTemplateApplier: () => {
|
|
10
14
|
applyStatus: import("vue").Ref<Record<string, ApplyStatus>>;
|
|
15
|
+
markPending: (blueprintId: string) => void;
|
|
11
16
|
applyTemplate: (blueprintId: string, data: {
|
|
12
17
|
html?: string;
|
|
13
18
|
css?: string;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { StripoNotifications } from '@@/Types/stripo';
|
|
2
|
+
/**
|
|
3
|
+
* Adapter that routes Stripo's in-editor notifications through Guido's own
|
|
4
|
+
* InToasts-based toaster, so the editor only ever shows one toaster style.
|
|
5
|
+
* Passed to `initEditor` as the `notifications` config (Stripo then delegates
|
|
6
|
+
* rendering to us instead of drawing its native <ue-notifications-container>).
|
|
7
|
+
*/
|
|
8
|
+
export declare const useStripoNotifications: () => {
|
|
9
|
+
getStripoNotifications: () => StripoNotifications;
|
|
10
|
+
};
|
|
@@ -8,6 +8,9 @@ export declare const TemplateTypes: {
|
|
|
8
8
|
};
|
|
9
9
|
export declare const EditorType: number;
|
|
10
10
|
export declare const MAX_DEFAULT_TEMPLATE_ID = 13;
|
|
11
|
+
export declare const EMAIL_STATIC_BASE_URL = "https://email-static.useinsider.com";
|
|
12
|
+
export declare const BLANK_TEMPLATE_HTML_URL = "https://email-static.useinsider.com/templates/campaign/default.html";
|
|
13
|
+
export declare const BLANK_TEMPLATE_CSS_URL = "https://email-static.useinsider.com/templates/campaign/default.css";
|
|
11
14
|
export declare const ProductIds: Record<string, number>;
|
|
12
15
|
export declare const ModuleFolderDefaults: {
|
|
13
16
|
readonly SAVED_MODULES: "savedModules";
|
|
@@ -19,6 +19,8 @@ export declare const PRODUCT_TYPE_URL_SEGMENTS: {
|
|
|
19
19
|
};
|
|
20
20
|
export declare const INSIDER_ID = "iid";
|
|
21
21
|
export declare const DEFAULT_UNSUBSCRIBE_GROUP_SEND_GRID_ID = "G";
|
|
22
|
+
export declare const PIXEL_TRACKING_SEND_GRID_ID = "P";
|
|
23
|
+
export declare const UNSUBSCRIBE_SENTINEL_SEND_GRID_IDS: string[];
|
|
22
24
|
/**
|
|
23
25
|
* Get the default unsubscribe group lazily so the translated name resolves at access time.
|
|
24
26
|
* Must be called within a Vue component context or after Pinia is initialized.
|
|
@@ -51,6 +51,12 @@ export declare function captureCellAlignments(node: ImmutableHtmlNode | null | u
|
|
|
51
51
|
* text-trim) keyed by composition key, so a regeneration can re-bake them
|
|
52
52
|
* instead of resetting to the renderer's hardcoded spacing classes. Stripo stores padding
|
|
53
53
|
* and margin as these classes (NOT inline style), so an inline-style capture misses them.
|
|
54
|
+
*
|
|
55
|
+
* Inline price mode: the merged columns carry POSITIONAL spacing classes
|
|
56
|
+
* (`es-p15l es-p5r` / `es-p5l es-p15r`) that build the side-by-side gap — layout
|
|
57
|
+
* mechanics, not user padding. Skip the price cells then, so toggling back to
|
|
58
|
+
* stacked resets them to the renderer defaults instead of baking the lopsided
|
|
59
|
+
* inline paddings (SD-145161).
|
|
54
60
|
*/
|
|
55
61
|
export declare function captureCellClasses(node: ImmutableHtmlNode | null | undefined): Record<string, string>;
|
|
56
62
|
/**
|
|
@@ -10,6 +10,7 @@ export interface ExtensionStoreSlice {
|
|
|
10
10
|
}
|
|
11
11
|
export interface RequiredField {
|
|
12
12
|
key: string;
|
|
13
|
+
canBeEmpty?: boolean;
|
|
13
14
|
getValue: (config: PerBlockConfigs) => string;
|
|
14
15
|
getAvailableOptions?: (store: ExtensionStoreSlice) => string[];
|
|
15
16
|
condition?: (config: PerBlockConfigs) => boolean;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Template } from '@@/Types/stripo';
|
|
2
|
+
/**
|
|
3
|
+
* Fetches the blank starter template (html + css) from the email CDN — the single
|
|
4
|
+
* source of truth shared with email-fe. Retries a few times, caches the result for
|
|
5
|
+
* the session, and on persistent failure returns an empty template (the editor still
|
|
6
|
+
* opens) plus a toaster. Kept separate from stripoApi: this is a CDN asset fetch, not
|
|
7
|
+
* a Stripo backend call.
|
|
8
|
+
*/
|
|
9
|
+
export declare const useBlankTemplate: () => {
|
|
10
|
+
getBlankTemplate: () => Promise<Template>;
|
|
11
|
+
};
|
|
@@ -4,15 +4,14 @@ export declare const useToasterStore: import("pinia").StoreDefinition<"guidoToas
|
|
|
4
4
|
status: boolean;
|
|
5
5
|
type: import("@@/Types/toaster").ToasterType;
|
|
6
6
|
text: string;
|
|
7
|
-
icon: string;
|
|
8
|
-
withIcon: boolean;
|
|
9
7
|
withoutLeftMargin: boolean;
|
|
8
|
+
autoHide: boolean;
|
|
10
9
|
actionButton?: {
|
|
11
10
|
text: string;
|
|
12
11
|
onClick: () => void;
|
|
13
12
|
} | undefined;
|
|
14
13
|
} & import("pinia").PiniaCustomStateProperties<ToasterState>) => boolean;
|
|
15
14
|
}, {
|
|
16
|
-
showToaster(this: ToasterState, { type, message, actionButton }: ToasterOptions): void;
|
|
15
|
+
showToaster(this: ToasterState, { type, message, actionButton, autoHide }: ToasterOptions): void;
|
|
17
16
|
hideToaster(this: ToasterState): void;
|
|
18
17
|
}>;
|
|
@@ -39,6 +39,18 @@ ue-dropdown .service-element.padding-t-3 {
|
|
|
39
39
|
color: var(--guido-color-primary-500);
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
+
/*
|
|
43
|
+
* SD-145233: the pixel-tracking preference dropdown has no native option groups,
|
|
44
|
+
* so its section titles are rendered as disabled items. Present them as
|
|
45
|
+
* non-interactive group headers instead of options: no hover/cursor affordance
|
|
46
|
+
* and a little extra vertical spacing.
|
|
47
|
+
*/
|
|
48
|
+
.dropdown__menu .dropdown__item.disabled {
|
|
49
|
+
padding-top: 14px;
|
|
50
|
+
padding-bottom: 8px;
|
|
51
|
+
pointer-events: none;
|
|
52
|
+
}
|
|
53
|
+
|
|
42
54
|
.menu {
|
|
43
55
|
padding: 8px 0px;
|
|
44
56
|
}
|
package/dist/stores/toaster.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { ToasterTypeOptions as e } from "../enums/toaster.js";
|
|
2
|
-
import { defineStore as
|
|
3
|
-
const
|
|
2
|
+
import { defineStore as a } from "pinia";
|
|
3
|
+
const u = () => ({
|
|
4
4
|
status: !1,
|
|
5
5
|
type: e.Success,
|
|
6
6
|
text: "",
|
|
7
|
-
icon: "",
|
|
8
|
-
withIcon: !0,
|
|
9
7
|
withoutLeftMargin: !1,
|
|
8
|
+
autoHide: !0,
|
|
10
9
|
actionButton: void 0
|
|
11
|
-
}),
|
|
12
|
-
state: () =>
|
|
10
|
+
}), h = a("guidoToaster", {
|
|
11
|
+
state: () => u(),
|
|
13
12
|
getters: {
|
|
14
|
-
|
|
13
|
+
// A toast without auto-hide (e.g. Stripo `loader`) stays until hideToaster.
|
|
14
|
+
shouldAutoHide: (t) => t.status && !!t.text && t.autoHide
|
|
15
15
|
},
|
|
16
16
|
actions: {
|
|
17
|
-
showToaster({ type: t = e.Success, message: s, actionButton: o }) {
|
|
18
|
-
this.status = !0, this.text = s, this.type = t, this.actionButton = o;
|
|
17
|
+
showToaster({ type: t = e.Success, message: s, actionButton: o, autoHide: i = !0 }) {
|
|
18
|
+
this.status = !0, this.text = s, this.type = t, this.actionButton = o, this.autoHide = i;
|
|
19
19
|
},
|
|
20
20
|
hideToaster() {
|
|
21
21
|
this.status = !1;
|
|
@@ -23,5 +23,5 @@ const a = () => ({
|
|
|
23
23
|
}
|
|
24
24
|
});
|
|
25
25
|
export {
|
|
26
|
-
|
|
26
|
+
h as useToasterStore
|
|
27
27
|
};
|
|
@@ -1,85 +1,84 @@
|
|
|
1
|
-
import { productPairs as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { productPairs as q } from "../extensions/Blocks/Items/enums/productEnums.js";
|
|
2
|
+
import { DefaultConfigValues as N } from "../extensions/Blocks/Items/enums/settingsEnums.js";
|
|
3
|
+
function W(M) {
|
|
4
|
+
const S = M.replaceAll("{%", "<!--{%").replaceAll("%}", "%}-->"), g = new DOMParser().parseFromString(S, "text/html"), m = q.PAIRS_FOR_EXTENSION;
|
|
5
|
+
Object.entries(m).forEach(([r, f]) => {
|
|
6
|
+
g.querySelectorAll(".ins-product-td").forEach((c) => {
|
|
7
|
+
const A = c.getAttribute("data-number") || "1", C = c.getAttribute("data-type") || "CART_ITEMS";
|
|
8
|
+
c.querySelectorAll(`[product-attr="${r}"]`).forEach((e) => {
|
|
9
|
+
var F, I, w;
|
|
10
|
+
const $ = e.getAttribute("data-type") || C, u = e.getAttribute("data-number") || A, d = f[$];
|
|
11
|
+
if (d)
|
|
11
12
|
switch (r) {
|
|
12
13
|
case "imageSrc": {
|
|
13
14
|
let t = null, i = null;
|
|
14
15
|
if (e.tagName === "IMG" ? (t = e, i = t.closest("a")) : (t = e.querySelector("img"), i = e.querySelector("a") || e.closest("a")), !t)
|
|
15
16
|
break;
|
|
16
|
-
const a =
|
|
17
|
+
const a = d.DEFAULT, s = d.ATTR;
|
|
17
18
|
if (a && t.src) {
|
|
18
|
-
const
|
|
19
|
+
const o = t.src;
|
|
19
20
|
a.some((h) => {
|
|
20
|
-
const l = h.split("/").pop() || "",
|
|
21
|
-
return
|
|
22
|
-
}) && (t.src = `{{${s}_${
|
|
21
|
+
const l = h.split("/").pop() || "", b = o.split("/").pop() || "";
|
|
22
|
+
return o.includes(h) || o.includes(l) || b === l;
|
|
23
|
+
}) && (t.src = `{{${s}_${u}}}`);
|
|
23
24
|
}
|
|
24
|
-
const n = (
|
|
25
|
-
if (n && t.setAttribute("alt", `{{${n}_${
|
|
26
|
-
const
|
|
27
|
-
if (
|
|
28
|
-
const E =
|
|
29
|
-
(l === "#" || l === "" || l.endsWith("#!") || l.endsWith(h) || l === `${window.location.href}${h}` || !l || l === window.location.href) && (i.href = `{{${E}_${
|
|
25
|
+
const n = (I = (F = m.name) == null ? void 0 : F[$]) == null ? void 0 : I.ATTR;
|
|
26
|
+
if (n && t.setAttribute("alt", `{{${n}_${u}}}`), i) {
|
|
27
|
+
const o = (w = m.itemLink) == null ? void 0 : w[$];
|
|
28
|
+
if (o) {
|
|
29
|
+
const E = o.HREF, h = o.DEFAULT_HREF || "#!", l = i.href;
|
|
30
|
+
(l === "#" || l === "" || l.endsWith("#!") || l.endsWith(h) || l === `${window.location.href}${h}` || !l || l === window.location.href) && (i.href = `{{${E}_${u}}}`);
|
|
30
31
|
}
|
|
31
32
|
}
|
|
32
33
|
break;
|
|
33
34
|
}
|
|
34
35
|
case "name": {
|
|
35
|
-
const t =
|
|
36
|
-
e.textContent && (e.textContent = `{{${i}_${
|
|
36
|
+
const t = d, i = t.ATTR, a = t.DEFAULT_HREF || "#!", s = t.HREF;
|
|
37
|
+
e.textContent && (e.textContent = `{{${i}_${u}}}`);
|
|
37
38
|
const n = e.closest("a") || (e.tagName === "A" ? e : null);
|
|
38
39
|
if (n && s) {
|
|
39
|
-
const
|
|
40
|
-
(
|
|
40
|
+
const o = n.href, E = `${window.location.href}${a}`;
|
|
41
|
+
(o === E || o.endsWith(a)) && (n.href = `{{${s}_${u}}}`);
|
|
41
42
|
}
|
|
42
43
|
break;
|
|
43
44
|
}
|
|
44
45
|
case "price":
|
|
45
46
|
case "originalPrice": {
|
|
46
|
-
const t =
|
|
47
|
+
const t = d, i = e.getAttribute("data-formated"), a = e.getAttribute("data-single_price"), s = i === "true", n = a === "true", o = e.getAttribute("data-curency") || "before";
|
|
47
48
|
let E;
|
|
48
49
|
n ? E = s ? t.SINGLE_PRICE_FORMATTED : t.SINGLE_PRICE : E = s ? t.PRICE_FORMATTED : t.PRICE;
|
|
49
50
|
const h = t.CURRENCY;
|
|
50
|
-
let l = `{{${E}_${
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}
|
|
55
|
-
e.textContent = l;
|
|
51
|
+
let l = `{{${E}_${u}}}`;
|
|
52
|
+
const b = (e.getAttribute("data-currency_symbol") || "").trim(), x = b !== "" && b !== N.productPriceCurrencySymbolControlValue;
|
|
53
|
+
let T = "";
|
|
54
|
+
x ? T = b : h && (T = `{{${h}_${u}}}`), T && (l = o === "after" ? `${l} ${T}` : `${T} ${l}`), e.textContent = l;
|
|
56
55
|
break;
|
|
57
56
|
}
|
|
58
57
|
case "quantity": {
|
|
59
|
-
const t =
|
|
60
|
-
e.textContent && e.textContent.trim() === a && (e.textContent = `{{${i}_${
|
|
58
|
+
const t = d, i = t.ATTR, a = t.DEFAULT;
|
|
59
|
+
e.textContent && e.textContent.trim() === a && (e.textContent = `{{${i}_${u}}}`);
|
|
61
60
|
break;
|
|
62
61
|
}
|
|
63
62
|
case "button": {
|
|
64
|
-
const t =
|
|
63
|
+
const t = d, i = t.HREF, a = t.DEFAULT_HREF || "#!", s = e.tagName === "A" ? e : e.querySelector("a");
|
|
65
64
|
if (s) {
|
|
66
|
-
const n = s.href || "",
|
|
67
|
-
(n === "" || n === "#" || n ===
|
|
65
|
+
const n = s.href || "", o = `${window.location.href}${a}`;
|
|
66
|
+
(n === "" || n === "#" || n === o || n.endsWith(a) || n.endsWith("#!") || n === window.location.href) && (s.href = `{{${i}_${u}}}`);
|
|
68
67
|
}
|
|
69
68
|
break;
|
|
70
69
|
}
|
|
71
70
|
case "itemLink": {
|
|
72
|
-
const t =
|
|
71
|
+
const t = d, i = t.HREF, a = t.DEFAULT_HREF || "#!", s = e;
|
|
73
72
|
if (s.href) {
|
|
74
|
-
const n = s.href,
|
|
75
|
-
(n ===
|
|
73
|
+
const n = s.href, o = `${window.location.href}${a}`;
|
|
74
|
+
(n === o || n.endsWith(a)) && (s.href = `{{${i}_${u}}}`);
|
|
76
75
|
}
|
|
77
76
|
break;
|
|
78
77
|
}
|
|
79
78
|
default: {
|
|
80
|
-
if ("ATTR" in
|
|
81
|
-
const t =
|
|
82
|
-
e.textContent && (e.textContent = `{{${t}_${
|
|
79
|
+
if ("ATTR" in d) {
|
|
80
|
+
const t = d.ATTR;
|
|
81
|
+
e.textContent && (e.textContent = `{{${t}_${u}}}`);
|
|
83
82
|
}
|
|
84
83
|
break;
|
|
85
84
|
}
|
|
@@ -87,48 +86,48 @@ function q(w) {
|
|
|
87
86
|
});
|
|
88
87
|
});
|
|
89
88
|
});
|
|
90
|
-
const
|
|
91
|
-
` : "",
|
|
92
|
-
|
|
93
|
-
const f = r.getAttribute("data-type") || "CART_ITEMS", p = r.getAttribute("data-number") || "1",
|
|
94
|
-
|
|
89
|
+
const H = S.match(/<!DOCTYPE[^>]*>/i), P = H ? `${H[0]}
|
|
90
|
+
` : "", D = g.querySelectorAll(".ins-product-td"), k = [];
|
|
91
|
+
D.forEach((r) => {
|
|
92
|
+
const f = r.getAttribute("data-type") || "CART_ITEMS", p = r.getAttribute("data-number") || "1", c = r.getAttribute("data-nodup"), A = r.outerHTML;
|
|
93
|
+
k.push({
|
|
95
94
|
element: r,
|
|
96
95
|
outerHtml: A,
|
|
97
96
|
type: f,
|
|
98
97
|
number: p,
|
|
99
|
-
nodup:
|
|
98
|
+
nodup: c || void 0
|
|
100
99
|
});
|
|
101
100
|
});
|
|
102
|
-
let _ =
|
|
103
|
-
|
|
104
|
-
let
|
|
101
|
+
let _ = P + g.documentElement.outerHTML;
|
|
102
|
+
k.reverse().forEach(({ outerHtml: r, type: f, number: p }) => {
|
|
103
|
+
let c = "";
|
|
105
104
|
switch (f) {
|
|
106
105
|
case "CART_ITEMS":
|
|
107
|
-
|
|
106
|
+
c = "ins_apr_total_product_kind";
|
|
108
107
|
break;
|
|
109
108
|
case "BROWSED_ITEMS":
|
|
110
|
-
|
|
109
|
+
c = "browsed_item_total_product_kind";
|
|
111
110
|
break;
|
|
112
111
|
case "PURCHASED_ITEMS":
|
|
113
|
-
|
|
112
|
+
c = "purchased_item_total_product_kind";
|
|
114
113
|
break;
|
|
115
114
|
}
|
|
116
|
-
if (
|
|
117
|
-
const
|
|
115
|
+
if (c) {
|
|
116
|
+
const C = parseInt(p) - 1, $ = `${`{% if ${c} > ${C} %}`}${r}{% endif %}`;
|
|
118
117
|
_ = _.replace(r, $);
|
|
119
118
|
}
|
|
120
119
|
});
|
|
121
|
-
const
|
|
122
|
-
return
|
|
120
|
+
const L = g.querySelectorAll('[product-attr="originalPrice"][data-type="CART_ITEMS"]'), y = [];
|
|
121
|
+
return L.forEach((r) => {
|
|
123
122
|
const f = r.getAttribute("data-number"), p = r.getAttribute("data-type");
|
|
124
123
|
if (!f || p !== "CART_ITEMS")
|
|
125
124
|
return;
|
|
126
|
-
const
|
|
127
|
-
if (
|
|
128
|
-
const A =
|
|
129
|
-
|
|
125
|
+
const c = r.closest(".product-original-price-class");
|
|
126
|
+
if (c) {
|
|
127
|
+
const A = c.outerHTML;
|
|
128
|
+
y.some((R) => R.tdOuterHtml === A) || y.push({ tdOuterHtml: A, number: f });
|
|
130
129
|
}
|
|
131
|
-
}),
|
|
130
|
+
}), y.reverse().forEach(({ tdOuterHtml: r, number: f }) => {
|
|
132
131
|
const p = `{% if ins_apr_price_${f} != ins_apr_originalprice_${f} %}`;
|
|
133
132
|
if (!_.includes(p) && !r.includes("{% if")) {
|
|
134
133
|
const A = `${p}${r}{% endif %}`;
|
|
@@ -137,5 +136,5 @@ function q(w) {
|
|
|
137
136
|
}), _.replaceAll("<!--{%", "{%").replaceAll("%}-->", "%}").replaceAll("<!--{%", "{%").replaceAll("%}-->", "%}");
|
|
138
137
|
}
|
|
139
138
|
export {
|
|
140
|
-
|
|
139
|
+
W as pairProductVariables
|
|
141
140
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@useinsider/guido",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.10.0-beta.076d56a",
|
|
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",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"license": "ISC",
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@stripoinc/ui-editor-extensions": "3.8.0",
|
|
40
|
-
"@useinsider/design-system-vue": "1.
|
|
40
|
+
"@useinsider/design-system-vue": "1.3.0",
|
|
41
41
|
"@vueuse/core": "11.3.0",
|
|
42
42
|
"lodash-es": "4.17.21",
|
|
43
43
|
"pinia": "2.3.1",
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
const n = `ue-notifications-container {
|
|
2
|
-
left: 96px;
|
|
3
|
-
margin: 0;
|
|
4
|
-
bottom: 32px;
|
|
5
|
-
top: unset;
|
|
6
|
-
width: unset;
|
|
7
|
-
position: fixed;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
ue-notifications-container ue-message + ue-message {
|
|
11
|
-
margin-bottom: 24px;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
ue-notifications-container .alert-message-wrapper {
|
|
15
|
-
box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.07);
|
|
16
|
-
border: none;
|
|
17
|
-
padding: 16px 24px;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
ue-notifications-container .alert-message-wrapper.info,
|
|
21
|
-
ue-notifications-container .alert-message-wrapper.loader {
|
|
22
|
-
background-color: var(--guido-color-background-toaster-info) !important;
|
|
23
|
-
color: inherit;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
.alert-message-wrapper .alert-message-main {
|
|
27
|
-
align-items: center;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
ue-notifications-container ue-caption .caption {
|
|
31
|
-
color: var(--guido-color-white) !important;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
ue-block-thumb-hint {
|
|
35
|
-
text-align: left;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
ue-notifications-container .alert-message-wrapper .alert-message-main .alert-message-content {
|
|
39
|
-
width: calc(100% - 64px);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
ue-notifications-container .alert-message-wrapper .alert-message-main .alert-message-text {
|
|
43
|
-
font-size: 15px;
|
|
44
|
-
font-weight: 600;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
ue-notifications-container .alert-message-text,
|
|
48
|
-
ue-notifications-container .alert-message-wrapper ue-icon-component.icon,
|
|
49
|
-
ue-notifications-container .alert-message-wrapper ue-icon-component.icon-button {
|
|
50
|
-
color: var(--guido-color-white);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
ue-notifications-container ue-message ue-button.close {
|
|
54
|
-
margin: 0 0 0 16px;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
ue-notifications-container .alert-message-wrapper.success {
|
|
58
|
-
background: var(--guido-color-background-toaster-success);
|
|
59
|
-
color: inherit;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
ue-notifications-container .alert-message-wrapper.error {
|
|
63
|
-
background: var(--guido-color-background-toaster-error);
|
|
64
|
-
color: inherit;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
ue-notifications-container .alert-message-wrapper.warn {
|
|
68
|
-
background: var(--guido-color-background-toaster-warn);
|
|
69
|
-
color: inherit;
|
|
70
|
-
}
|
|
71
|
-
`;
|
|
72
|
-
export {
|
|
73
|
-
n as default
|
|
74
|
-
};
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
const t = `<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
2
|
-
<html>
|
|
3
|
-
|
|
4
|
-
<head>
|
|
5
|
-
<meta charset="UTF-8">
|
|
6
|
-
<meta content="width=device-width, initial-scale=1" name="viewport">
|
|
7
|
-
<meta name="x-apple-disable-message-reformatting">
|
|
8
|
-
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
9
|
-
<meta content="telephone=no" name="format-detection">
|
|
10
|
-
<title></title>
|
|
11
|
-
<!--[if (mso 16)]><style type="text/css">a{text-decoration:none}</style><![endif]-->
|
|
12
|
-
<!--[if gte mso 9]><style>sup{font-size:100% !important}</style><![endif]-->
|
|
13
|
-
<!--[if gte mso 9]><style>sup{font-size:100% !important}</style><![endif]-->
|
|
14
|
-
<!--[if gte mso 9]><style>sup{font-size:100% !important}</style><![endif]-->
|
|
15
|
-
<!--[if gte mso 9]><style>sup{font-size:100% !important}</style><![endif]-->
|
|
16
|
-
<!--[if gte mso 9]><style>sup { font-size: 100% !important; }</style><![endif]-->
|
|
17
|
-
</head>
|
|
18
|
-
|
|
19
|
-
<body>
|
|
20
|
-
<div class="es-wrapper-color">
|
|
21
|
-
<!--[if gte mso 9]>
|
|
22
|
-
<v:background xmlns:v="urn:schemas-microsoft-com:vml" fill="t">
|
|
23
|
-
<v:fill type="tile" color="#f6f6f6"></v:fill>
|
|
24
|
-
</v:background>
|
|
25
|
-
<![endif]-->
|
|
26
|
-
<table class="es-wrapper" width="100%" cellspacing="0" cellpadding="0">
|
|
27
|
-
<tbody>
|
|
28
|
-
<tr>
|
|
29
|
-
<td class="esd-email-paddings" valign="top">
|
|
30
|
-
<table class="es-content esd-footer-popover" cellspacing="0" cellpadding="0" align="center">
|
|
31
|
-
<tbody>
|
|
32
|
-
<tr>
|
|
33
|
-
<td class="esd-stripe" align="center">
|
|
34
|
-
<table class="es-content-body" width="600" cellspacing="0" cellpadding="0" bgcolor="#ffffff" align="center">
|
|
35
|
-
<tbody>
|
|
36
|
-
<tr>
|
|
37
|
-
<td class="esd-structure es-p20" align="left">
|
|
38
|
-
<table cellpadding="0" cellspacing="0" width="100%">
|
|
39
|
-
<tbody>
|
|
40
|
-
<tr>
|
|
41
|
-
<td width="560" class="esd-container-frame" align="center" valign="top">
|
|
42
|
-
<table cellpadding="0" cellspacing="0" width="100%">
|
|
43
|
-
<tbody>
|
|
44
|
-
<tr>
|
|
45
|
-
<td align="center" class="esd-empty-container" style="display: none;"></td>
|
|
46
|
-
</tr>
|
|
47
|
-
</tbody>
|
|
48
|
-
</table>
|
|
49
|
-
</td>
|
|
50
|
-
</tr>
|
|
51
|
-
</tbody>
|
|
52
|
-
</table>
|
|
53
|
-
</td>
|
|
54
|
-
</tr>
|
|
55
|
-
</tbody>
|
|
56
|
-
</table>
|
|
57
|
-
</td>
|
|
58
|
-
</tr>
|
|
59
|
-
</tbody>
|
|
60
|
-
</table>
|
|
61
|
-
</td>
|
|
62
|
-
</tr>
|
|
63
|
-
</tbody>
|
|
64
|
-
</table>
|
|
65
|
-
</div>
|
|
66
|
-
<div style="position: absolute; left: -9999px; top: -9999px; margin: 0px;"></div>
|
|
67
|
-
<div style="position: absolute; left: -9999px; top: -9999px; margin: 0px; padding: 0px; border: 0px none; width: 1px;"></div>
|
|
68
|
-
</body>
|
|
69
|
-
|
|
70
|
-
</html>
|
|
71
|
-
`;
|
|
72
|
-
export {
|
|
73
|
-
t as default
|
|
74
|
-
};
|