@useinsider/guido 3.6.0-beta.859e737 → 3.6.0-beta.94e390d
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/useStripoEventHandler.js +20 -12
- package/dist/enums/toaster.js +1 -1
- package/dist/extensions/Blocks/Recommendation/block.js +35 -16
- package/dist/extensions/Blocks/Recommendation/useRecommendationBlockWarning.js +16 -0
- package/dist/extensions/Blocks/Recommendation/utils/recommendationBlockCount.js +9 -0
- package/dist/src/enums/toaster.d.ts +2 -1
- package/dist/src/extensions/Blocks/Recommendation/block.d.ts +13 -0
- package/dist/src/extensions/Blocks/Recommendation/useRecommendationBlockWarning.d.ts +11 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/recommendationBlockCount.d.ts +28 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/recommendationBlockCount.test.d.ts +1 -0
- package/dist/src/utils/templatePreparation.d.ts +0 -16
- package/dist/utils/templatePreparation.js +57 -58
- package/package.json +1 -1
- /package/dist/src/{utils/templatePreparation.test.d.ts → extensions/Blocks/Recommendation/block.test.d.ts} +0 -0
|
@@ -1,13 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { useActionsApi as m } from "./useActionsApi.js";
|
|
2
|
+
import { useRecommendationBlockWarning as p } from "../extensions/Blocks/Recommendation/useRecommendationBlockWarning.js";
|
|
3
|
+
import { useStripoApi as b } from "../services/stripoApi.js";
|
|
4
|
+
import { useEditorStore as g } from "../stores/editor.js";
|
|
5
|
+
import { useOnboardingStore as f } from "../stores/onboarding.js";
|
|
6
|
+
import { useUnsubscribeStore as S } from "../stores/unsubscribe.js";
|
|
7
|
+
const k = () => {
|
|
8
|
+
const { updateSyncModule: d, getSyncModule: r } = b(), { getTemplateData: a } = m(), { warnIfMultipleBlocks: s } = p(), n = g(), c = S(), i = async () => {
|
|
9
|
+
try {
|
|
10
|
+
const { html: e } = await a();
|
|
11
|
+
s(new DOMParser().parseFromString(e, "text/html"));
|
|
12
|
+
} catch {
|
|
13
|
+
}
|
|
14
|
+
}, l = {
|
|
7
15
|
block_dropped: ({ blockName: e }) => {
|
|
8
16
|
if (e === "BLOCK_TEXT") {
|
|
9
|
-
const o =
|
|
10
|
-
if (t ||
|
|
17
|
+
const o = f(), t = !o.shouldShowOnboarding("textBlockOnboarding"), u = o.isActive("textBlockOnboarding");
|
|
18
|
+
if (t || u)
|
|
11
19
|
return;
|
|
12
20
|
o.start("textBlockOnboarding");
|
|
13
21
|
}
|
|
@@ -16,20 +24,20 @@ const v = () => {
|
|
|
16
24
|
n.syncModulesEnabled && (console.debug("[module_saved] Saved module data:", e), await d(e));
|
|
17
25
|
},
|
|
18
26
|
module_dropped: async (e) => {
|
|
19
|
-
if (!n.syncModulesEnabled)
|
|
27
|
+
if (await i(), !n.syncModulesEnabled)
|
|
20
28
|
return;
|
|
21
29
|
const { moduleId: o } = e, t = await r(o);
|
|
22
|
-
console.debug("[module_dropped] Sync module data:", t), t.unsubscriptionPreferencePages.length && await
|
|
30
|
+
console.debug("[module_dropped] Sync module data:", t), t.unsubscriptionPreferencePages.length && await c.fetchTemplates();
|
|
23
31
|
},
|
|
24
32
|
module_updated: async (e) => {
|
|
25
33
|
n.syncModulesEnabled && (console.debug("[module_updated] Updated module data:", e), await d(e));
|
|
26
34
|
}
|
|
27
35
|
};
|
|
28
36
|
return { handleEvent: async (e, o) => {
|
|
29
|
-
const t =
|
|
37
|
+
const t = l[e];
|
|
30
38
|
console.debug("Stripo Event: ", e, o), t && await t(o);
|
|
31
39
|
} };
|
|
32
40
|
};
|
|
33
41
|
export {
|
|
34
|
-
|
|
42
|
+
k as useStripoEventHandler
|
|
35
43
|
};
|
package/dist/enums/toaster.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var c = /* @__PURE__ */ ((r) => (r.Success = "success", r.Warning = "warning", r.Alert = "alert", r))(c || {});
|
|
1
|
+
var c = /* @__PURE__ */ ((r) => (r.Success = "success", r.Warning = "warning", r.Alert = "alert", r.Dark = "dark", r))(c || {});
|
|
2
2
|
export {
|
|
3
3
|
c as ToasterTypeOptions
|
|
4
4
|
};
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
var k = Object.defineProperty;
|
|
2
|
-
var
|
|
3
|
-
var d = (a, r, t) =>
|
|
4
|
-
import { BlockId as
|
|
5
|
-
import { getMigrationBannerHtml as
|
|
6
|
-
import { Block as
|
|
2
|
+
var B = (a, r, t) => r in a ? k(a, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : a[r] = t;
|
|
3
|
+
var d = (a, r, t) => B(a, typeof r != "symbol" ? r + "" : r, t);
|
|
4
|
+
import { BlockId as R } from "../../../enums/block.js";
|
|
5
|
+
import { getMigrationBannerHtml as y } from "../../../utils/migrationBannerHtml.js";
|
|
6
|
+
import { Block as D, BlockCompositionType as C, ModificationDescription as h } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
7
7
|
import { regenerateMobileProductRows as b } from "./controls/main/utils.js";
|
|
8
8
|
import { ensureMobileCssRulesExist as p, setMobileLayoutOptOut as f, hasMobileLayoutOptOut as A } from "./controls/mobileLayout/cssRules.js";
|
|
9
9
|
import { RecommendationConfigService as c } from "./services/configService.js";
|
|
10
10
|
import { useRecommendationExtensionStore as g } from "./store/recommendation.js";
|
|
11
11
|
import { getDefaultTemplate as E } from "./templates/grid/template.js";
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
import { useRecommendationBlockWarning as M } from "./useRecommendationBlockWarning.js";
|
|
13
|
+
const I = R.Recommendation, m = "recommendation-block-v2", u = "recommendation-id";
|
|
14
|
+
let _ = !1;
|
|
15
|
+
class H extends D {
|
|
15
16
|
constructor() {
|
|
16
17
|
super();
|
|
17
18
|
/**
|
|
@@ -21,7 +22,7 @@ class q extends R {
|
|
|
21
22
|
d(this, "_pendingBlockId", null);
|
|
22
23
|
}
|
|
23
24
|
getId() {
|
|
24
|
-
return
|
|
25
|
+
return I;
|
|
25
26
|
}
|
|
26
27
|
getIcon() {
|
|
27
28
|
return "recommendation-icon";
|
|
@@ -38,8 +39,8 @@ class q extends R {
|
|
|
38
39
|
);
|
|
39
40
|
}
|
|
40
41
|
getSettingsPanelTitleHtml() {
|
|
41
|
-
return
|
|
42
|
-
|
|
42
|
+
return y(
|
|
43
|
+
I,
|
|
43
44
|
this.api.translate("Recommendation Block"),
|
|
44
45
|
this.api.translate("This block is switched from the Old Version to the New Version. We recommend you check the Recommendation block and test your message to ensure it works properly.")
|
|
45
46
|
);
|
|
@@ -95,7 +96,7 @@ class q extends R {
|
|
|
95
96
|
documentModifier: this.api.getDocumentModifier()
|
|
96
97
|
}));
|
|
97
98
|
}
|
|
98
|
-
s.patchCurrentBlockConfig({ language: n.language }, { triggerRefetch: !1 });
|
|
99
|
+
s.patchCurrentBlockConfig({ language: n.language }, { triggerRefetch: !1 }), this._warnIfMultipleBlocks();
|
|
99
100
|
}
|
|
100
101
|
/**
|
|
101
102
|
* Called when the document changes or template is loaded
|
|
@@ -117,7 +118,7 @@ class q extends R {
|
|
|
117
118
|
}
|
|
118
119
|
this._healLingeringDuplicate(t), c.needsMigration(t) && this._migrateFromLegacy(t);
|
|
119
120
|
try {
|
|
120
|
-
|
|
121
|
+
_ || (p(this.api), _ = !0);
|
|
121
122
|
const e = c.getConfig(t), i = this._getBlockElement(t);
|
|
122
123
|
if (i) {
|
|
123
124
|
const n = !e.mobileLayoutEnabled;
|
|
@@ -137,6 +138,24 @@ class q extends R {
|
|
|
137
138
|
const e = this._getRecommendationId(t);
|
|
138
139
|
e && g().removeBlockState(e);
|
|
139
140
|
}
|
|
141
|
+
/**
|
|
142
|
+
* Warns (dark advisory toaster) when the design holds more than one live
|
|
143
|
+
* recommendation block. Triggered from the user-add paths only (fresh drop
|
|
144
|
+
* and duplicate) — never from document-load/migration, so opening a template
|
|
145
|
+
* that already has multiple blocks does not fire it.
|
|
146
|
+
*
|
|
147
|
+
* Counting lives in `useRecommendationBlockWarning` so the same DOM-based
|
|
148
|
+
* logic (which ignores the empty shells deletions leave behind, SD-143028)
|
|
149
|
+
* is shared with the `module_dropped` handler — recommendation blocks can
|
|
150
|
+
* also arrive inside a saved structure. Wrapped in try/catch because the
|
|
151
|
+
* document root may be unavailable during initial load.
|
|
152
|
+
*/
|
|
153
|
+
_warnIfMultipleBlocks() {
|
|
154
|
+
try {
|
|
155
|
+
M().warnIfMultipleBlocks(this.api.getDocumentRootHtmlNode());
|
|
156
|
+
} catch {
|
|
157
|
+
}
|
|
158
|
+
}
|
|
140
159
|
/**
|
|
141
160
|
* Generates the next unique recommendation ID by scanning all existing blocks
|
|
142
161
|
* in the document and finding the maximum existing ID + 1.
|
|
@@ -209,7 +228,7 @@ class q extends R {
|
|
|
209
228
|
/** Assigns a fresh id to a duplicated block and syncs DOM, node config and store. */
|
|
210
229
|
_handleDuplicate(t, e) {
|
|
211
230
|
const i = this._reassignDuplicateId(t, e), n = g();
|
|
212
|
-
n.cloneBlockState(e, i), n.setCurrentBlock(i);
|
|
231
|
+
n.cloneBlockState(e, i), n.setCurrentBlock(i), this._warnIfMultipleBlocks();
|
|
213
232
|
}
|
|
214
233
|
/**
|
|
215
234
|
* Core id-reassignment for a duplicated block: rewrites the DOM
|
|
@@ -291,6 +310,6 @@ class q extends R {
|
|
|
291
310
|
}
|
|
292
311
|
}
|
|
293
312
|
export {
|
|
294
|
-
|
|
295
|
-
|
|
313
|
+
I as BLOCK_ID,
|
|
314
|
+
H as RecommendationBlock
|
|
296
315
|
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { useToaster as r } from "../../../composables/useToaster.js";
|
|
2
|
+
import { useTranslations as s } from "../../../composables/useTranslations.js";
|
|
3
|
+
import { ToasterTypeOptions as n } from "../../../enums/toaster.js";
|
|
4
|
+
import { countLiveRecommendationBlocks as i } from "./utils/recommendationBlockCount.js";
|
|
5
|
+
const a = "newsletter.multiple-reco-blocks-warning", f = () => {
|
|
6
|
+
const { showToaster: o } = r(), t = s();
|
|
7
|
+
return { warnIfMultipleBlocks: (e) => {
|
|
8
|
+
i(e) > 1 && o({
|
|
9
|
+
type: n.Dark,
|
|
10
|
+
message: t(a)
|
|
11
|
+
});
|
|
12
|
+
} };
|
|
13
|
+
};
|
|
14
|
+
export {
|
|
15
|
+
f as useRecommendationBlockWarning
|
|
16
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
const r = ".recommendation-block-v2", t = ".recommendation-product-row";
|
|
2
|
+
function n(o) {
|
|
3
|
+
return Array.from(o.querySelectorAll(r)).filter((e) => e.querySelector(t)).length;
|
|
4
|
+
}
|
|
5
|
+
export {
|
|
6
|
+
r as RECOMMENDATION_BLOCK_SELECTOR,
|
|
7
|
+
t as RECOMMENDATION_PRODUCT_ROW_SELECTOR,
|
|
8
|
+
n as countLiveRecommendationBlocks
|
|
9
|
+
};
|
|
@@ -55,6 +55,19 @@ export declare class RecommendationBlock extends Block {
|
|
|
55
55
|
* @param node - The block node being deleted
|
|
56
56
|
*/
|
|
57
57
|
onDelete(node: ImmutableHtmlNode): void;
|
|
58
|
+
/**
|
|
59
|
+
* Warns (dark advisory toaster) when the design holds more than one live
|
|
60
|
+
* recommendation block. Triggered from the user-add paths only (fresh drop
|
|
61
|
+
* and duplicate) — never from document-load/migration, so opening a template
|
|
62
|
+
* that already has multiple blocks does not fire it.
|
|
63
|
+
*
|
|
64
|
+
* Counting lives in `useRecommendationBlockWarning` so the same DOM-based
|
|
65
|
+
* logic (which ignores the empty shells deletions leave behind, SD-143028)
|
|
66
|
+
* is shared with the `module_dropped` handler — recommendation blocks can
|
|
67
|
+
* also arrive inside a saved structure. Wrapped in try/catch because the
|
|
68
|
+
* document root may be unavailable during initial load.
|
|
69
|
+
*/
|
|
70
|
+
private _warnIfMultipleBlocks;
|
|
58
71
|
/**
|
|
59
72
|
* Generates the next unique recommendation ID by scanning all existing blocks
|
|
60
73
|
* in the document and finding the maximum existing ID + 1.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { QueryableRoot } from './utils/recommendationBlockCount';
|
|
2
|
+
/**
|
|
3
|
+
* Advisory shown when a design ends up with more than one recommendation block,
|
|
4
|
+
* since multiple blocks can slow campaign delivery. Shared by the block
|
|
5
|
+
* lifecycle (direct drop / duplicate, counting the editor's document root) and
|
|
6
|
+
* the `module_dropped` event (counting a parsed `getTemplateData()` document, so
|
|
7
|
+
* recommendation blocks that arrive inside a saved structure are also covered).
|
|
8
|
+
*/
|
|
9
|
+
export declare const useRecommendationBlockWarning: () => {
|
|
10
|
+
warnIfMultipleBlocks: (root: QueryableRoot) => void;
|
|
11
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Counts *live* recommendation blocks in a document.
|
|
3
|
+
*
|
|
4
|
+
* Deleting a recommendation block strips its inner content but leaves an empty
|
|
5
|
+
* `.recommendation-block-v2` container shell behind — present in every document
|
|
6
|
+
* representation the editor exposes (`getDocumentRoot`, `getDocumentRootHtmlNode`
|
|
7
|
+
* and even `getTemplateData`). A raw class count therefore over-reports after a
|
|
8
|
+
* delete→add cycle (SD-143028). The product row (`.recommendation-product-row`)
|
|
9
|
+
* is present on every live block from drop time (the default template ships
|
|
10
|
+
* product rows, both grid and list layouts) and is removed from a deleted
|
|
11
|
+
* block's leftover shell, so filtering by it cleanly separates live blocks from
|
|
12
|
+
* ghosts without reading any store.
|
|
13
|
+
*/
|
|
14
|
+
export declare const RECOMMENDATION_BLOCK_SELECTOR = ".recommendation-block-v2";
|
|
15
|
+
export declare const RECOMMENDATION_PRODUCT_ROW_SELECTOR = ".recommendation-product-row";
|
|
16
|
+
interface QueryableNode {
|
|
17
|
+
querySelector(selector: string): unknown;
|
|
18
|
+
}
|
|
19
|
+
export interface QueryableRoot {
|
|
20
|
+
querySelectorAll(selector: string): Iterable<QueryableNode>;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Counts the live recommendation blocks reachable from `root`. Works on the
|
|
24
|
+
* editor's `ImmutableHtmlNode` document root (drop / duplicate paths) and on a
|
|
25
|
+
* DOM `Document` parsed from `getTemplateData()` HTML (saved-module drop path).
|
|
26
|
+
*/
|
|
27
|
+
export declare function countLiveRecommendationBlocks(root: QueryableRoot): number;
|
|
28
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,20 +1,4 @@
|
|
|
1
1
|
import type { SavedTemplateDetails } from '@@/Types/stripo';
|
|
2
|
-
/**
|
|
3
|
-
* Collects every unsubscribe page id referenced by the unsubscribe blocks
|
|
4
|
-
* present in the email HTML, deduped.
|
|
5
|
-
*
|
|
6
|
-
* The email's unsubscribe link is variation-scoped on the backend, which
|
|
7
|
-
* resolves the page to render from the page ids the FE persists for that
|
|
8
|
-
* variation. Those ids must reflect the blocks actually in the email — not a
|
|
9
|
-
* UI-only selection store — otherwise a block that entered the editor by any
|
|
10
|
-
* path other than the page-selection UI (e.g. a dropped saved module) sends an
|
|
11
|
-
* empty association and the backend falls back to the default page.
|
|
12
|
-
*
|
|
13
|
-
* Read from raw editor HTML: the `data-unsubscribe-page-list` attribute lives
|
|
14
|
-
* on the block node there (the save-time sync-module extractor relies on the
|
|
15
|
-
* same source), so it is reliably present regardless of how the block was added.
|
|
16
|
-
*/
|
|
17
|
-
export declare function getHtmlReferencedUnsubscribePages(html: string): number[];
|
|
18
2
|
export declare const useTemplatePreparation: () => {
|
|
19
3
|
prepareTemplateDetails: () => Promise<Omit<SavedTemplateDetails, "metadata">>;
|
|
20
4
|
};
|
|
@@ -1,58 +1,58 @@
|
|
|
1
|
-
import { useActionsApi as
|
|
2
|
-
import { useHtmlCompiler as
|
|
3
|
-
import { DEFAULT_CURRENCY as
|
|
1
|
+
import { useActionsApi as C } from "../composables/useActionsApi.js";
|
|
2
|
+
import { useHtmlCompiler as T } from "../composables/useHtmlCompiler.js";
|
|
3
|
+
import { DEFAULT_CURRENCY as d, DEFAULT_NODE_CONFIG as s } from "../extensions/Blocks/Recommendation/constants/defaultConfig.js";
|
|
4
4
|
import { useRecommendationExtensionStore as b } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
5
|
-
import { DATA_ATTRIBUTES as
|
|
6
|
-
import { parsePageList as
|
|
7
|
-
import { useDynamicContentStore as
|
|
8
|
-
import { useUnsubscribeStore as
|
|
9
|
-
function
|
|
10
|
-
const
|
|
11
|
-
return
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
}),
|
|
5
|
+
import { DATA_ATTRIBUTES as S } from "../extensions/Blocks/Unsubscribe/utils/constants.js";
|
|
6
|
+
import { parsePageList as D } from "../extensions/Blocks/Unsubscribe/utils/utils.js";
|
|
7
|
+
import { useDynamicContentStore as P } from "../stores/dynamic-content.js";
|
|
8
|
+
import { useUnsubscribeStore as w } from "../stores/unsubscribe.js";
|
|
9
|
+
function E(i, o) {
|
|
10
|
+
const t = new DOMParser().parseFromString(i, "text/html").querySelectorAll(`[${S.PAGE_LIST}]`), c = [];
|
|
11
|
+
return t.forEach((r) => {
|
|
12
|
+
const a = r.getAttribute(S.PAGE_LIST);
|
|
13
|
+
a && c.push(...D(a));
|
|
14
|
+
}), o.filter((r) => c.includes(r));
|
|
15
15
|
}
|
|
16
|
-
async function
|
|
17
|
-
const
|
|
18
|
-
if (
|
|
16
|
+
async function U(i) {
|
|
17
|
+
const m = new DOMParser().parseFromString(i, "text/html").querySelectorAll(".recommendation-block-v2");
|
|
18
|
+
if (m.length === 0)
|
|
19
19
|
return;
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
var
|
|
23
|
-
const
|
|
20
|
+
const l = b();
|
|
21
|
+
m.forEach((t) => {
|
|
22
|
+
var g, f, u, n, y;
|
|
23
|
+
const c = t.getAttribute("recommendation-id"), r = c ? Number(c) : NaN;
|
|
24
24
|
if (!Number.isFinite(r))
|
|
25
25
|
return;
|
|
26
|
-
const
|
|
27
|
-
if (!
|
|
26
|
+
const a = t.getAttribute("esd-ext-config");
|
|
27
|
+
if (!a)
|
|
28
28
|
return;
|
|
29
29
|
let e;
|
|
30
30
|
try {
|
|
31
|
-
e = JSON.parse(
|
|
31
|
+
e = JSON.parse(a);
|
|
32
32
|
} catch {
|
|
33
33
|
return;
|
|
34
34
|
}
|
|
35
35
|
if (!e || typeof e != "object" || Array.isArray(e))
|
|
36
36
|
return;
|
|
37
|
-
const
|
|
38
|
-
strategy: e.strategy ??
|
|
39
|
-
language: e.language ??
|
|
40
|
-
size: e.size ??
|
|
37
|
+
const p = {
|
|
38
|
+
strategy: e.strategy ?? s.strategy,
|
|
39
|
+
language: e.language ?? s.language,
|
|
40
|
+
size: e.size ?? s.size,
|
|
41
41
|
// Spread the default arrays so each block gets a fresh reference
|
|
42
42
|
// instead of sharing the singleton in DEFAULT_NODE_CONFIG.
|
|
43
|
-
productIds: e.productIds ?? [...
|
|
44
|
-
filters: e.filters ?? [...
|
|
45
|
-
shuffleProducts: e.shuffleProducts ??
|
|
46
|
-
currencyCode: ((
|
|
47
|
-
currencyAlignment: ((
|
|
48
|
-
currencyDecimalCount: ((
|
|
49
|
-
currencyDecimalSeparator: ((
|
|
50
|
-
currencyThousandSeparator: ((y = e.currency) == null ? void 0 : y.thousandSeparator) ??
|
|
43
|
+
productIds: e.productIds ?? [...s.productIds],
|
|
44
|
+
filters: e.filters ?? [...s.filters],
|
|
45
|
+
shuffleProducts: e.shuffleProducts ?? s.shuffleProducts,
|
|
46
|
+
currencyCode: ((g = e.currency) == null ? void 0 : g.code) ?? d.code,
|
|
47
|
+
currencyAlignment: ((f = e.currency) == null ? void 0 : f.alignment) ?? d.alignment,
|
|
48
|
+
currencyDecimalCount: ((u = e.currency) == null ? void 0 : u.decimalCount) ?? d.decimalCount,
|
|
49
|
+
currencyDecimalSeparator: ((n = e.currency) == null ? void 0 : n.decimalSeparator) ?? d.decimalSeparator,
|
|
50
|
+
currencyThousandSeparator: ((y = e.currency) == null ? void 0 : y.thousandSeparator) ?? d.thousandSeparator
|
|
51
51
|
};
|
|
52
|
-
|
|
52
|
+
l.seedBlockUrlConfig(r, p);
|
|
53
53
|
});
|
|
54
54
|
try {
|
|
55
|
-
await
|
|
55
|
+
await l.fetchRecommendationCreateData();
|
|
56
56
|
} catch (t) {
|
|
57
57
|
console.warn(
|
|
58
58
|
"Recommendation reference data pre-load failed; validator will skip the availability check.",
|
|
@@ -60,43 +60,42 @@ async function F(c) {
|
|
|
60
60
|
);
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
|
-
const
|
|
64
|
-
const
|
|
63
|
+
const _ = () => {
|
|
64
|
+
const i = P(), o = w(), { getCompiledEmail: m, getTemplateData: l } = C(), { compileHtml: t } = T();
|
|
65
65
|
return {
|
|
66
66
|
prepareTemplateDetails: async () => {
|
|
67
|
-
const { html: r, ampHtml:
|
|
67
|
+
const { html: r, ampHtml: a = "", ampErrors: e = [] } = await m({
|
|
68
68
|
minimize: !0,
|
|
69
69
|
resetDataSavedFlag: !1
|
|
70
|
-
}), { html:
|
|
71
|
-
|
|
72
|
-
const { compiledHtml:
|
|
70
|
+
}), { html: p, css: g, syncModulesIds: f = [] } = await l();
|
|
71
|
+
o.selectedUnsubscribePages.length && await o.fetchTemplates(), await U(p);
|
|
72
|
+
const { compiledHtml: u, stats: n, appliedRules: y } = t(r), h = i.getSelectedDynamicContentList, A = b();
|
|
73
73
|
return console.debug("HTML Compilation Stats:", {
|
|
74
|
-
originalSize:
|
|
75
|
-
compiledSize:
|
|
76
|
-
reduction: `${
|
|
74
|
+
originalSize: n.originalSize,
|
|
75
|
+
compiledSize: n.compiledSize,
|
|
76
|
+
reduction: `${n.reductionPercentage.toFixed(2)}%`,
|
|
77
77
|
appliedRules: y,
|
|
78
|
-
executionTime: `${
|
|
78
|
+
executionTime: `${n.executionTime.toFixed(2)}ms`
|
|
79
79
|
}), {
|
|
80
|
-
dynamicContentList:
|
|
81
|
-
compiledHtml:
|
|
82
|
-
rawHtml:
|
|
83
|
-
css:
|
|
84
|
-
ampHtml:
|
|
80
|
+
dynamicContentList: h,
|
|
81
|
+
compiledHtml: u,
|
|
82
|
+
rawHtml: p,
|
|
83
|
+
css: g,
|
|
84
|
+
ampHtml: a,
|
|
85
85
|
ampErrors: e,
|
|
86
|
-
modules:
|
|
86
|
+
modules: f.map(Number),
|
|
87
87
|
recommendation: {
|
|
88
|
-
campaignUrls:
|
|
88
|
+
campaignUrls: A.recommendationCampaignUrls,
|
|
89
89
|
configs: {}
|
|
90
90
|
},
|
|
91
91
|
unsubscribe: {
|
|
92
|
-
status:
|
|
93
|
-
config:
|
|
92
|
+
status: o.unsubscribePagesStatus,
|
|
93
|
+
config: E(u, o.selectedUnsubscribePages)
|
|
94
94
|
}
|
|
95
95
|
};
|
|
96
96
|
}
|
|
97
97
|
};
|
|
98
98
|
};
|
|
99
99
|
export {
|
|
100
|
-
|
|
101
|
-
k as useTemplatePreparation
|
|
100
|
+
_ as useTemplatePreparation
|
|
102
101
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@useinsider/guido",
|
|
3
|
-
"version": "3.6.0-beta.
|
|
3
|
+
"version": "3.6.0-beta.94e390d",
|
|
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",
|
|
File without changes
|