@useinsider/guido 3.18.1-beta.fefef3c → 3.18.2-beta.32d291d
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/save-as-template/SaveAsTemplateDrawer.vue2.js +34 -34
- package/dist/composables/useHttp.js +24 -22
- package/dist/composables/useLegacyStrategyConversion.js +45 -45
- package/dist/enums/extensions/recommendationBlock.js +42 -36
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +23 -17
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +31 -12
- package/dist/extensions/Blocks/Recommendation/utils/legacyStrategyMigration.js +30 -60
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +29 -28
- package/dist/package.json.js +1 -1
- package/dist/services/recommendationApi.js +92 -92
- package/dist/services/templateLibraryApi.js +17 -14
- package/dist/src/enums/extensions/recommendationBlock.d.ts +4 -3
- package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +5 -1
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +28 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/legacyStrategyMigration.d.ts +4 -16
- package/dist/src/utils/genericUtil.d.ts +6 -0
- package/dist/src/utils/liquidDynamicContent.d.ts +20 -0
- package/dist/utils/genericUtil.js +63 -54
- package/dist/utils/liquidDynamicContent.js +15 -0
- package/dist/utils/templatePreparation.js +54 -52
- package/package.json +3 -3
|
@@ -43,6 +43,16 @@ interface PerBlockState {
|
|
|
43
43
|
isInitialized: boolean;
|
|
44
44
|
/** Snapshot of filters taken when the drawer opens, used to revert on cancel */
|
|
45
45
|
filterSnapshot: Filter[] | null;
|
|
46
|
+
/**
|
|
47
|
+
* Fingerprint of the node config as this block's state last adopted it.
|
|
48
|
+
*
|
|
49
|
+
* Lives here, not on the control, because it is a claim ABOUT this state —
|
|
50
|
+
* "the store already holds that node config". Held on the control it
|
|
51
|
+
* outlived the state it described: `removeBlockState` tore the state down
|
|
52
|
+
* while the fingerprint survived, so re-dropping a saved module under the
|
|
53
|
+
* same id skipped the re-sync and kept the defaults (SD-150347).
|
|
54
|
+
*/
|
|
55
|
+
syncedConfigFingerprint: string | null;
|
|
46
56
|
legacyConversionLoading: boolean;
|
|
47
57
|
}
|
|
48
58
|
/**
|
|
@@ -60,6 +70,8 @@ export interface PerBlockUrlConfig {
|
|
|
60
70
|
filters: Filter[];
|
|
61
71
|
shuffleProducts: boolean;
|
|
62
72
|
currencyCode: string;
|
|
73
|
+
/** The displayed symbol, which is not the code — a TRY block shows `₺`. */
|
|
74
|
+
currencySymbol: string;
|
|
63
75
|
currencyAlignment: 'before' | 'after';
|
|
64
76
|
currencyDecimalCount: number;
|
|
65
77
|
currencyDecimalSeparator: string;
|
|
@@ -488,6 +500,16 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
488
500
|
resolveStrategyUrlTemplate(strategy: RrsStrategy, currency: string): Promise<string>;
|
|
489
501
|
assignStrategy(strategy: RrsStrategy): void;
|
|
490
502
|
convertLegacyStrategy(payload: RrsMigrationPayload, target?: RrsMigrationTarget): Promise<string>;
|
|
503
|
+
/**
|
|
504
|
+
* Undoes the config half of a conversion whose document write never landed, so the
|
|
505
|
+
* panel and the drawer fall back to "Legacy Strategy" instead of showing an assignment
|
|
506
|
+
* the document never received.
|
|
507
|
+
*/
|
|
508
|
+
revertLegacyConversion(blockId: number, previous: {
|
|
509
|
+
strategyId: string;
|
|
510
|
+
size: string;
|
|
511
|
+
nodeConfigVersion: number;
|
|
512
|
+
}): void;
|
|
491
513
|
removeStrategy(): void;
|
|
492
514
|
fetchRecommendationCreateData(): Promise<void>;
|
|
493
515
|
fetchRecommendationFilters(): Promise<void>;
|
|
@@ -505,6 +527,12 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
|
|
|
505
527
|
hasInvalidBlock(): boolean;
|
|
506
528
|
fetchRecommendationProducts(): Promise<void>;
|
|
507
529
|
_doFetchProducts(): Promise<void>;
|
|
530
|
+
/**
|
|
531
|
+
* Block-scoped counterpart of `fetchRecommendationProducts`, which only ever serves the
|
|
532
|
+
* selected block. The legacy conversion must refresh the products of the block that
|
|
533
|
+
* started it even after the user selected another one.
|
|
534
|
+
*/
|
|
535
|
+
fetchStrategyProductsForBlock(blockId: number): Promise<void>;
|
|
508
536
|
_doFetchStrategyProducts(blockId: number): Promise<void>;
|
|
509
537
|
_setBlockProducts(blockId: number, products: RecommendationProduct[], size: number): void;
|
|
510
538
|
}>;
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
type FilterAttribute = {
|
|
3
|
-
value: string;
|
|
4
|
-
type: string;
|
|
5
|
-
};
|
|
1
|
+
import type { RrsMigrationPayload, RrsMigrationTarget } from '@@/Types/recommendation';
|
|
6
2
|
/**
|
|
7
3
|
* A block authored before reusable strategies: it still carries a plain feed
|
|
8
4
|
* configuration (compiled into a feed URL string) instead of a strategy id.
|
|
@@ -17,13 +13,6 @@ export declare function resolveMigrationTarget({ campaignId, templateLibraryId }
|
|
|
17
13
|
campaignId?: string;
|
|
18
14
|
templateLibraryId?: string;
|
|
19
15
|
}): RrsMigrationTarget;
|
|
20
|
-
/**
|
|
21
|
-
* Groups the block's valid filters the way the feed URL groups them, in the
|
|
22
|
-
* shape the migration endpoint validates. The URL's filter DSL states no
|
|
23
|
-
* attribute type and cannot express a mixed-operator group, which is exactly
|
|
24
|
-
* what this override exists to supply.
|
|
25
|
-
*/
|
|
26
|
-
export declare function toMigrationFilterGroups(filters: Filter[], attributes: FilterAttribute[]): RrsMigrationFilterGroup[];
|
|
27
16
|
interface MigrationInputs {
|
|
28
17
|
blockId: number;
|
|
29
18
|
url: string;
|
|
@@ -31,14 +20,13 @@ interface MigrationInputs {
|
|
|
31
20
|
variationId: string;
|
|
32
21
|
strategy: string;
|
|
33
22
|
productIds: string[];
|
|
34
|
-
filters: Filter[];
|
|
35
|
-
attributes: FilterAttribute[];
|
|
36
23
|
target: RrsMigrationTarget;
|
|
37
24
|
}
|
|
38
25
|
/**
|
|
39
|
-
* The server names and de-duplicates the strategy, so nothing here derives a name
|
|
26
|
+
* The server names and de-duplicates the strategy, so nothing here derives a name, and the
|
|
27
|
+
* filters travel inside `url` — the endpoint parses the feed URL's filter DSL itself. The two
|
|
40
28
|
* routes take different identity fields — the campaign one names from `campaignId`/`variationId`
|
|
41
29
|
* (0 for modules, which carry no numeric campaign), the template one from `templateId`.
|
|
42
30
|
*/
|
|
43
|
-
export declare function buildLegacyMigrationPayload({ blockId, url, campaignId, variationId, strategy, productIds,
|
|
31
|
+
export declare function buildLegacyMigrationPayload({ blockId, url, campaignId, variationId, strategy, productIds, target, }: MigrationInputs): RrsMigrationPayload;
|
|
44
32
|
export {};
|
|
@@ -30,3 +30,9 @@ export declare const replaceString: (string?: string, values?: Record<string, st
|
|
|
30
30
|
* a string nor a number becomes ''.
|
|
31
31
|
*/
|
|
32
32
|
export declare const asText: (value: unknown) => string;
|
|
33
|
+
/**
|
|
34
|
+
* Narrows an unknown API value to a plain JSON object. Arrays and exotic
|
|
35
|
+
* objects (Blob, Date, FormData) are rejected, so a response body that useHttp
|
|
36
|
+
* parsed as text or blob can never be read as a JSON payload.
|
|
37
|
+
*/
|
|
38
|
+
export declare const isPlainObject: <T>(value: T) => value is T & Record<string, unknown>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { BaseDynamicContent } from '@@/Types/generic';
|
|
2
|
+
export type DynamicContentFormat = NonNullable<BaseDynamicContent['format']>;
|
|
3
|
+
/** Format key the dynamic-content picker sends for a custom date/time format. */
|
|
4
|
+
export declare const TIME_FORMAT_KEY = "time-format";
|
|
5
|
+
/** Wraps a Liquid filter argument in whichever quote style the value itself does not use. */
|
|
6
|
+
export declare const quoteArgument: (value: string) => string | null;
|
|
7
|
+
/**
|
|
8
|
+
* `{ key: 'time-format', value: '%Y-%m-%d' }` -> `date: "%Y-%m-%d"`.
|
|
9
|
+
*
|
|
10
|
+
* Only a custom date/time strftime pattern has a Liquid equivalent. Anything else returns null so
|
|
11
|
+
* the caller emits a plain tag rather than one that silently lost — or literally printed — its
|
|
12
|
+
* format.
|
|
13
|
+
* @example formatToLiquidFilter({ key: 'time-format', value: '%b %-d, %Y' }) -> date: "%b %-d, %Y"
|
|
14
|
+
*/
|
|
15
|
+
export declare const formatToLiquidFilter: (format: DynamicContentFormat) => string | null;
|
|
16
|
+
/**
|
|
17
|
+
* Inverse of `formatToLiquidFilter` — reads the picker format back out of one filter segment, so a
|
|
18
|
+
* reopened tag restores its selection in the host's format dropdown.
|
|
19
|
+
*/
|
|
20
|
+
export declare const liquidFilterToFormat: (segment: string) => DynamicContentFormat | null;
|
|
@@ -1,69 +1,78 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { formatToLiquidFilter as b, quoteArgument as y, liquidFilterToFormat as h } from "./liquidDynamicContent.js";
|
|
2
|
+
const g = (t) => {
|
|
3
|
+
if (!t.includes("="))
|
|
4
|
+
return null;
|
|
5
|
+
const [r, e] = t.split("=");
|
|
6
|
+
return { key: r.trim(), value: e.trim() };
|
|
7
|
+
}, c = "default:", f = (t) => {
|
|
8
|
+
if (!t.startsWith(c))
|
|
9
|
+
return t;
|
|
10
|
+
const r = t.slice(c.length).trim(), e = (l) => r.length >= 2 && r.startsWith(l) && r.endsWith(l);
|
|
11
|
+
return e('"') || e("'") ? r.slice(1, -1) : r;
|
|
12
|
+
}, k = (t) => {
|
|
13
|
+
const e = t.value.match(/\{\{([^}]+)\}\}/)[1].split("|").map((a) => a.trim()), [l] = e, s = {
|
|
3
14
|
text: t.label,
|
|
4
|
-
value:
|
|
15
|
+
value: l || ""
|
|
5
16
|
};
|
|
6
|
-
if (
|
|
7
|
-
const [,
|
|
8
|
-
if (
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
n ? r.format = n : e || (r.fallback = l), e && (r.fallback = e);
|
|
17
|
+
if (e.length >= 2) {
|
|
18
|
+
const [, a, n] = e;
|
|
19
|
+
if (a.startsWith(c))
|
|
20
|
+
s.fallback = f(a);
|
|
21
|
+
else {
|
|
22
|
+
const o = h(a) ?? g(a);
|
|
23
|
+
o ? s.format = o : n || (s.fallback = a), n && (s.fallback = f(n));
|
|
14
24
|
}
|
|
15
25
|
}
|
|
16
|
-
return
|
|
17
|
-
},
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
};
|
|
23
|
-
if (c) {
|
|
24
|
-
if (!a.fallback)
|
|
25
|
-
return {
|
|
26
|
-
label: a.text,
|
|
27
|
-
value: `{{ ${a.value} }}`
|
|
28
|
-
};
|
|
29
|
-
const r = !Number.isNaN(Number(a.fallback)) && a.fallback.trim() !== "" ? a.fallback : `"${a.fallback}"`;
|
|
30
|
-
return {
|
|
31
|
-
label: `${a.text} | ${a.fallback}`,
|
|
32
|
-
value: `{{ ${a.value} | default: ${r} }}`
|
|
33
|
-
};
|
|
34
|
-
}
|
|
26
|
+
return s;
|
|
27
|
+
}, p = (t) => {
|
|
28
|
+
const e = !Number.isNaN(Number(t)) && t.trim() !== "" ? t : y(t);
|
|
29
|
+
return e === null ? null : `${c} ${e}`;
|
|
30
|
+
}, v = (t) => {
|
|
31
|
+
const r = t.format ? b(t.format) : null, e = t.fallback ? p(t.fallback) : null, l = [t.value, r, e].filter(Boolean);
|
|
35
32
|
return {
|
|
36
|
-
label:
|
|
37
|
-
value:
|
|
33
|
+
label: [t.text, r, e && t.fallback].filter(Boolean).join(" | "),
|
|
34
|
+
value: `{{ ${l.join(" | ")} }}`
|
|
38
35
|
};
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
36
|
+
}, i = (t, r = !1) => t.map((e) => r ? v(e) : e.format ? {
|
|
37
|
+
label: `${e.text} | ${e.format.key}=${e.format.value}`,
|
|
38
|
+
value: `{{${e.value}|${e.format.key}=${e.format.value}}}`
|
|
39
|
+
} : {
|
|
40
|
+
label: e.fallback ? `${e.text} | ${e.fallback}` : e.text,
|
|
41
|
+
value: e.fallback ? `{{${e.value}|${e.fallback}}}` : `{{${e.value}}}`
|
|
42
|
+
}), $ = (t) => {
|
|
43
|
+
const r = [], e = /* @__PURE__ */ new Set(), l = (a) => {
|
|
44
|
+
Array.isArray(a) && a.forEach((n) => {
|
|
45
|
+
const o = [...n.children ?? [], ...n.select_items ?? []];
|
|
46
|
+
if (o.length > 0) {
|
|
47
|
+
l(o);
|
|
45
48
|
return;
|
|
46
49
|
}
|
|
47
|
-
const u =
|
|
48
|
-
u &&
|
|
50
|
+
const u = n.text || n.tag_text;
|
|
51
|
+
u && n.value && !e.has(n.value) && (e.add(n.value), r.push({ text: u, value: n.value }));
|
|
49
52
|
});
|
|
50
|
-
}, [
|
|
51
|
-
return s
|
|
52
|
-
},
|
|
53
|
-
const
|
|
53
|
+
}, [s] = Object.values(t ?? {});
|
|
54
|
+
return l(s), r;
|
|
55
|
+
}, d = (t, r, e = !1) => {
|
|
56
|
+
const l = new Set(t.map((a) => a.value)), s = r.filter((a) => l.has(a.value) ? !1 : (l.add(a.value), !0));
|
|
54
57
|
return [
|
|
55
|
-
...
|
|
56
|
-
...
|
|
58
|
+
...i(t, e),
|
|
59
|
+
...i(s, e)
|
|
57
60
|
];
|
|
58
|
-
},
|
|
61
|
+
}, F = () => {
|
|
59
62
|
var t;
|
|
60
63
|
return ((t = document.head.querySelector('meta[name="csrf-token"]')) == null ? void 0 : t.getAttribute("content")) ?? "";
|
|
61
|
-
},
|
|
64
|
+
}, T = (t) => typeof t == "string" ? t : typeof t == "number" ? String(t) : "", x = (t) => {
|
|
65
|
+
if (t === null || typeof t != "object" || Array.isArray(t))
|
|
66
|
+
return !1;
|
|
67
|
+
const r = Object.getPrototypeOf(t);
|
|
68
|
+
return r === Object.prototype || r === null;
|
|
69
|
+
};
|
|
62
70
|
export {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
71
|
+
T as asText,
|
|
72
|
+
d as buildMergeTagEntries,
|
|
73
|
+
i as dynamicContentToMergeTags,
|
|
74
|
+
$ as flattenDynamicContentList,
|
|
75
|
+
F as getCsrfToken,
|
|
76
|
+
x as isPlainObject,
|
|
77
|
+
k as mergeTagToDynamicContent
|
|
69
78
|
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
const E = "time-format", r = "date", u = new RegExp(`^${r}\\s*:\\s*(?:"([^"]*)"|'([^']*)')$`), s = /%[-_0^#]?\d*[a-zA-Z%]/, c = new RegExp(s, "g"), l = /\b(?:Y{2,4}|M{2,4}|D{1,4}|d{3,4}|H{2}|h{2}|m{2}|s{2}|S{1,3}|A|a)\b/, T = (t) => t.includes('"') ? t.includes("'") ? null : `'${t}'` : `"${t}"`, i = (t) => s.test(t) && !l.test(t.replace(c, "")), R = (t) => {
|
|
2
|
+
if (t.key !== E || !i(t.value ?? ""))
|
|
3
|
+
return null;
|
|
4
|
+
const n = T(t.value);
|
|
5
|
+
return n === null ? null : `${r}: ${n}`;
|
|
6
|
+
}, _ = (t) => {
|
|
7
|
+
const [, n, o] = t.match(u) ?? [], e = n ?? o;
|
|
8
|
+
return e ? { key: E, value: e } : null;
|
|
9
|
+
};
|
|
10
|
+
export {
|
|
11
|
+
E as TIME_FORMAT_KEY,
|
|
12
|
+
R as formatToLiquidFilter,
|
|
13
|
+
_ as liquidFilterToFormat,
|
|
14
|
+
T as quoteArgument
|
|
15
|
+
};
|
|
@@ -1,30 +1,31 @@
|
|
|
1
1
|
import { useActionsApi as k } from "../composables/useActionsApi.js";
|
|
2
2
|
import { useConfig as U } from "../composables/useConfig.js";
|
|
3
3
|
import { useHtmlCompiler as x } from "../composables/useHtmlCompiler.js";
|
|
4
|
-
import { DEFAULT_CURRENCY as
|
|
5
|
-
import { useRecommendationExtensionStore as
|
|
4
|
+
import { DEFAULT_CURRENCY as m, DEFAULT_NODE_CONFIG as n } from "../extensions/Blocks/Recommendation/constants/defaultConfig.js";
|
|
5
|
+
import { useRecommendationExtensionStore as A } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
6
6
|
import { mapLegacyStrategy as L } from "../extensions/Blocks/Recommendation/utils/legacyStrategyMap.js";
|
|
7
|
-
import { DATA_ATTRIBUTES as
|
|
7
|
+
import { DATA_ATTRIBUTES as T } from "../extensions/Blocks/Unsubscribe/utils/constants.js";
|
|
8
8
|
import { parsePageList as R } from "../extensions/Blocks/Unsubscribe/utils/utils.js";
|
|
9
9
|
import { useDynamicContentStore as N } from "../stores/dynamic-content.js";
|
|
10
10
|
import { useEditorStore as z } from "../stores/editor.js";
|
|
11
|
-
import { useUnsubscribeStore as
|
|
11
|
+
import { useUnsubscribeStore as O } from "../stores/unsubscribe.js";
|
|
12
|
+
import { isPlainObject as _ } from "./genericUtil.js";
|
|
12
13
|
import { assignTrackingIds as v } from "./linkTrackingIds.js";
|
|
13
|
-
function
|
|
14
|
-
const i = new DOMParser().parseFromString(
|
|
15
|
-
return i.forEach((
|
|
16
|
-
const o =
|
|
14
|
+
function M(l) {
|
|
15
|
+
const i = new DOMParser().parseFromString(l, "text/html").querySelectorAll(`[${T.PAGE_LIST}]`), t = [];
|
|
16
|
+
return i.forEach((c) => {
|
|
17
|
+
const o = c.getAttribute(T.PAGE_LIST);
|
|
17
18
|
o && t.push(...R(o));
|
|
18
19
|
}), [...new Set(t)];
|
|
19
20
|
}
|
|
20
|
-
async function
|
|
21
|
-
const
|
|
22
|
-
if (
|
|
21
|
+
async function q(l) {
|
|
22
|
+
const a = new DOMParser().parseFromString(l, "text/html").querySelectorAll(".recommendation-block-v2");
|
|
23
|
+
if (a.length === 0)
|
|
23
24
|
return;
|
|
24
|
-
const i =
|
|
25
|
-
|
|
26
|
-
var r,
|
|
27
|
-
const
|
|
25
|
+
const i = A();
|
|
26
|
+
a.forEach((t) => {
|
|
27
|
+
var r, d, g, f, s, y;
|
|
28
|
+
const c = t.getAttribute("recommendation-id"), o = c ? Number(c) : NaN;
|
|
28
29
|
if (!Number.isFinite(o))
|
|
29
30
|
return;
|
|
30
31
|
const p = t.getAttribute("esd-ext-config");
|
|
@@ -36,28 +37,29 @@ async function M(m) {
|
|
|
36
37
|
} catch {
|
|
37
38
|
return;
|
|
38
39
|
}
|
|
39
|
-
if (!
|
|
40
|
+
if (!_(e))
|
|
40
41
|
return;
|
|
41
|
-
const
|
|
42
|
+
const b = {
|
|
42
43
|
// Normalize legacy strategy keys (e.g. `mostViewed` → `mostPopular`) so
|
|
43
44
|
// already-saved blocks that never re-run the migrator don't emit a
|
|
44
45
|
// strategy-less campaign URL. `||` also catches '' / undefined (SD-144882).
|
|
45
|
-
strategy: L(e.strategy) ||
|
|
46
|
-
strategyId: e.strategyId ??
|
|
47
|
-
language: e.language ??
|
|
48
|
-
size: e.size ??
|
|
46
|
+
strategy: L(e.strategy) || n.strategy,
|
|
47
|
+
strategyId: e.strategyId ?? n.strategyId,
|
|
48
|
+
language: e.language ?? n.language,
|
|
49
|
+
size: e.size ?? n.size,
|
|
49
50
|
// Spread the default arrays so each block gets a fresh reference
|
|
50
51
|
// instead of sharing the singleton in DEFAULT_NODE_CONFIG.
|
|
51
|
-
productIds: e.productIds ?? [...
|
|
52
|
-
filters: e.filters ?? [...
|
|
53
|
-
shuffleProducts: e.shuffleProducts ??
|
|
54
|
-
currencyCode: ((r = e.currency) == null ? void 0 : r.code) ??
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
52
|
+
productIds: e.productIds ?? [...n.productIds],
|
|
53
|
+
filters: e.filters ?? [...n.filters],
|
|
54
|
+
shuffleProducts: e.shuffleProducts ?? n.shuffleProducts,
|
|
55
|
+
currencyCode: ((r = e.currency) == null ? void 0 : r.code) ?? m.code,
|
|
56
|
+
currencySymbol: ((d = e.currency) == null ? void 0 : d.symbol) ?? m.symbol,
|
|
57
|
+
currencyAlignment: ((g = e.currency) == null ? void 0 : g.alignment) ?? m.alignment,
|
|
58
|
+
currencyDecimalCount: ((f = e.currency) == null ? void 0 : f.decimalCount) ?? m.decimalCount,
|
|
59
|
+
currencyDecimalSeparator: ((s = e.currency) == null ? void 0 : s.decimalSeparator) ?? m.decimalSeparator,
|
|
60
|
+
currencyThousandSeparator: ((y = e.currency) == null ? void 0 : y.thousandSeparator) ?? m.thousandSeparator
|
|
59
61
|
};
|
|
60
|
-
i.seedBlockUrlConfig(o,
|
|
62
|
+
i.seedBlockUrlConfig(o, b);
|
|
61
63
|
});
|
|
62
64
|
try {
|
|
63
65
|
await i.fetchRecommendationCreateData();
|
|
@@ -68,51 +70,51 @@ async function M(m) {
|
|
|
68
70
|
);
|
|
69
71
|
}
|
|
70
72
|
}
|
|
71
|
-
const
|
|
72
|
-
const
|
|
73
|
+
const te = () => {
|
|
74
|
+
const l = N(), u = z(), a = O(), { getCompiledEmail: i, getTemplateData: t, updateHtmlAndCss: c } = k(), { compileHtml: o, compileAmpHtml: p } = x(), { isFeatureEnabled: e } = U();
|
|
73
75
|
return {
|
|
74
76
|
prepareTemplateDetails: async () => {
|
|
75
|
-
let { html: r, css:
|
|
77
|
+
let { html: r, css: d, syncModulesIds: g = [] } = await t();
|
|
76
78
|
if (e("linkTrackingIds"))
|
|
77
79
|
try {
|
|
78
|
-
const { html:
|
|
79
|
-
u.trackIdSessionFloor = H, F && (r =
|
|
80
|
-
} catch (
|
|
81
|
-
console.error("Tracking-id step failed, saving anyway:",
|
|
80
|
+
const { html: h, changed: F, nextSeq: H } = v(r, u.trackIdSessionFloor);
|
|
81
|
+
u.trackIdSessionFloor = H, F && (r = h, await c(h, d));
|
|
82
|
+
} catch (h) {
|
|
83
|
+
console.error("Tracking-id step failed, saving anyway:", h);
|
|
82
84
|
}
|
|
83
|
-
const { html: f, ampHtml:
|
|
85
|
+
const { html: f, ampHtml: s = "", ampErrors: y = [] } = await i({
|
|
84
86
|
minimize: !0,
|
|
85
87
|
resetDataSavedFlag: !1
|
|
86
88
|
});
|
|
87
|
-
|
|
88
|
-
const { compiledHtml: I, stats:
|
|
89
|
+
a.selectedUnsubscribePages.length && await a.fetchTemplates(), await q(r);
|
|
90
|
+
const { compiledHtml: I, stats: S, appliedRules: w } = o(f), D = s && p(s).compiledHtml, P = l.getSelectedDynamicContentList, E = A(), C = M(r);
|
|
89
91
|
return console.debug("HTML Compilation Stats:", {
|
|
90
|
-
originalSize:
|
|
91
|
-
compiledSize:
|
|
92
|
-
reduction: `${
|
|
92
|
+
originalSize: S.originalSize,
|
|
93
|
+
compiledSize: S.compiledSize,
|
|
94
|
+
reduction: `${S.reductionPercentage.toFixed(2)}%`,
|
|
93
95
|
appliedRules: w,
|
|
94
|
-
executionTime: `${
|
|
96
|
+
executionTime: `${S.executionTime.toFixed(2)}ms`
|
|
95
97
|
}), {
|
|
96
|
-
dynamicContentList:
|
|
98
|
+
dynamicContentList: P,
|
|
97
99
|
compiledHtml: I,
|
|
98
100
|
rawHtml: r,
|
|
99
|
-
css:
|
|
101
|
+
css: d,
|
|
100
102
|
ampHtml: D,
|
|
101
|
-
ampErrors:
|
|
103
|
+
ampErrors: y,
|
|
102
104
|
modules: g.map(Number),
|
|
103
105
|
recommendation: {
|
|
104
|
-
campaignUrls:
|
|
106
|
+
campaignUrls: E.recommendationCampaignUrls,
|
|
105
107
|
configs: {}
|
|
106
108
|
},
|
|
107
109
|
unsubscribe: {
|
|
108
|
-
status:
|
|
109
|
-
config:
|
|
110
|
+
status: C.length > 0,
|
|
111
|
+
config: C
|
|
110
112
|
}
|
|
111
113
|
};
|
|
112
114
|
}
|
|
113
115
|
};
|
|
114
116
|
};
|
|
115
117
|
export {
|
|
116
|
-
|
|
117
|
-
|
|
118
|
+
M as getHtmlReferencedUnsubscribePages,
|
|
119
|
+
te as useTemplatePreparation
|
|
118
120
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@useinsider/guido",
|
|
3
|
-
"version": "3.18.
|
|
3
|
+
"version": "3.18.2-beta.32d291d",
|
|
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",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"author": "",
|
|
48
48
|
"license": "ISC",
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@stripoinc/ui-editor-extensions": "3.
|
|
50
|
+
"@stripoinc/ui-editor-extensions": "3.10.0",
|
|
51
51
|
"@useinsider/design-system-organisms": "0.0.3-beta.d816f06",
|
|
52
52
|
"@useinsider/design-system-vue": "1.5.0",
|
|
53
53
|
"@vueuse/core": "11.3.0",
|
|
@@ -118,7 +118,7 @@
|
|
|
118
118
|
},
|
|
119
119
|
"guido": {
|
|
120
120
|
"stripo": {
|
|
121
|
-
"version": "2.
|
|
121
|
+
"version": "2.76.0"
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
124
|
}
|