@useinsider/guido 3.23.0-beta.31d0f5f → 3.23.0-beta.534d03d
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 +1 -0
- package/dist/@types/config/schemas.js +41 -39
- package/dist/@types/display-condition.js +25 -0
- package/dist/components/Guido.vue.js +8 -8
- package/dist/components/Guido.vue2.js +89 -83
- package/dist/components/organisms/display-conditions/CodeEditorField.vue.js +18 -0
- package/dist/components/organisms/display-conditions/CodeEditorField.vue2.js +41 -0
- package/dist/components/organisms/display-conditions/DisplayConditionCreateDrawer.vue.js +30 -0
- package/dist/components/organisms/display-conditions/DisplayConditionCreateDrawer.vue2.js +81 -0
- package/dist/components/organisms/display-conditions/DisplayConditionSelectDrawer.vue.js +34 -0
- package/dist/components/organisms/display-conditions/DisplayConditionSelectDrawer.vue2.js +63 -0
- package/dist/components/organisms/display-conditions/DisplayConditionsHost.vue.js +17 -0
- package/dist/components/organisms/display-conditions/DisplayConditionsHost.vue2.js +22 -0
- package/dist/composables/useBlocksConfig.js +31 -20
- package/dist/composables/useDisplayConditions.js +116 -0
- package/dist/config/compiler/utils/itemsCompilerUtils.js +43 -42
- package/dist/config/compiler/utils/recommendationCompilerUtils.js +67 -64
- package/dist/enums/academy.js +1 -0
- package/dist/enums/display-condition.js +12 -0
- package/dist/extensions/DisplayConditions/bridge.js +25 -0
- package/dist/extensions/DisplayConditions/constants.js +17 -0
- package/dist/extensions/DisplayConditions/control.js +189 -0
- package/dist/extensions/DisplayConditions/display-conditions.css.js +201 -0
- package/dist/extensions/DisplayConditions/extension.js +28 -0
- package/dist/extensions/DisplayConditions/iconsRegistry.js +20 -0
- package/dist/extensions/DisplayConditions/library.js +28 -0
- package/dist/extensions/DisplayConditions/settingsPanel.js +17 -0
- package/dist/extensions/LinkTracking/extension.js +17 -0
- package/dist/extensions/LinkTracking/writer.js +35 -0
- package/dist/guido.css +1 -1
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +93 -92
- package/dist/node_modules/valibot/dist/index.js +297 -261
- package/dist/package.json.js +1 -1
- package/dist/services/displayConditionApi.js +39 -0
- package/dist/src/@types/config/schemas.d.ts +4 -0
- package/dist/src/@types/display-condition.d.ts +59 -0
- package/dist/src/components/organisms/display-conditions/CodeEditorField.vue.d.ts +43 -0
- package/dist/src/components/organisms/display-conditions/DisplayConditionCreateDrawer.vue.d.ts +2 -0
- package/dist/src/components/organisms/display-conditions/DisplayConditionSelectDrawer.vue.d.ts +2 -0
- package/dist/src/components/organisms/display-conditions/DisplayConditionsHost.vue.d.ts +2 -0
- package/dist/src/composables/useConfig.d.ts +2 -0
- package/dist/src/composables/useDisplayConditions.d.ts +17 -0
- package/dist/src/enums/academy.d.ts +1 -0
- package/dist/src/enums/display-condition.d.ts +15 -0
- package/dist/src/extensions/DisplayConditions/bridge.d.ts +7 -0
- package/dist/src/extensions/DisplayConditions/constants.d.ts +14 -0
- package/dist/src/extensions/DisplayConditions/control.d.ts +24 -0
- package/dist/src/extensions/DisplayConditions/extension.d.ts +2 -0
- package/dist/src/extensions/DisplayConditions/iconsRegistry.d.ts +4 -0
- package/dist/src/extensions/DisplayConditions/library.d.ts +8 -0
- package/dist/src/extensions/DisplayConditions/settingsPanel.d.ts +5 -0
- package/dist/src/extensions/LinkTracking/extension.d.ts +2 -0
- package/dist/src/extensions/LinkTracking/writer.d.ts +13 -0
- package/dist/src/mock/api/display-conditions.d.ts +2 -0
- package/dist/src/services/displayConditionApi.d.ts +8 -0
- package/dist/src/stores/config.d.ts +166 -0
- package/dist/src/stores/display-condition.d.ts +84 -0
- package/dist/src/utils/displayCondition.d.ts +11 -0
- package/dist/src/utils/linkTrackingIds.d.ts +20 -5
- package/dist/src/utils/protectTableText.d.ts +2 -0
- package/dist/stores/config.js +13 -6
- package/dist/stores/display-condition.js +29 -0
- package/dist/utils/displayCondition.js +26 -0
- package/dist/utils/linkTrackingIds.js +80 -47
- package/dist/utils/pairProductVariables.js +30 -29
- package/dist/utils/protectTableText.js +22 -0
- package/dist/utils/templatePreparation.js +57 -56
- package/package.json +1 -1
|
@@ -1,44 +1,45 @@
|
|
|
1
|
-
import { useActionsApi as
|
|
2
|
-
import { useConfig as
|
|
3
|
-
import { useHtmlCompiler as
|
|
4
|
-
import { useRecommendationExtensionStore as
|
|
5
|
-
import { toBlockUrlConfig as
|
|
6
|
-
import { DATA_ATTRIBUTES as
|
|
7
|
-
import { parsePageList as
|
|
1
|
+
import { useActionsApi as F } from "../composables/useActionsApi.js";
|
|
2
|
+
import { useConfig as x } from "../composables/useConfig.js";
|
|
3
|
+
import { useHtmlCompiler as D } from "../composables/useHtmlCompiler.js";
|
|
4
|
+
import { useRecommendationExtensionStore as T } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
5
|
+
import { toBlockUrlConfig as E } from "../extensions/Blocks/Recommendation/utils/blockUrlConfig.js";
|
|
6
|
+
import { DATA_ATTRIBUTES as S } from "../extensions/Blocks/Unsubscribe/utils/constants.js";
|
|
7
|
+
import { parsePageList as R } from "../extensions/Blocks/Unsubscribe/utils/utils.js";
|
|
8
|
+
import { writeTrackingIdsInPlace as U } from "../extensions/LinkTracking/writer.js";
|
|
8
9
|
import { useDynamicContentStore as L } from "../stores/dynamic-content.js";
|
|
9
10
|
import { useEditorStore as N } from "../stores/editor.js";
|
|
10
11
|
import { useUnsubscribeStore as v } from "../stores/unsubscribe.js";
|
|
11
12
|
import { isPlainObject as z } from "./genericUtil.js";
|
|
12
|
-
import {
|
|
13
|
-
function
|
|
14
|
-
const
|
|
15
|
-
return
|
|
16
|
-
const
|
|
17
|
-
|
|
13
|
+
import { planDocumentTrackingIds as b, renderTrackingIdPlan as q } from "./linkTrackingIds.js";
|
|
14
|
+
function M(c) {
|
|
15
|
+
const a = new DOMParser().parseFromString(c, "text/html").querySelectorAll(`[${S.PAGE_LIST}]`), e = [];
|
|
16
|
+
return a.forEach((s) => {
|
|
17
|
+
const r = s.getAttribute(S.PAGE_LIST);
|
|
18
|
+
r && e.push(...R(r));
|
|
18
19
|
}), [...new Set(e)];
|
|
19
20
|
}
|
|
20
|
-
async function
|
|
21
|
-
const
|
|
22
|
-
if (
|
|
21
|
+
async function h(c) {
|
|
22
|
+
const i = new DOMParser().parseFromString(c, "text/html").querySelectorAll(".recommendation-block-v2");
|
|
23
|
+
if (i.length === 0)
|
|
23
24
|
return;
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
const
|
|
27
|
-
if (!Number.isFinite(
|
|
25
|
+
const a = T();
|
|
26
|
+
i.forEach((e) => {
|
|
27
|
+
const s = e.getAttribute("recommendation-id"), r = s ? Number(s) : NaN;
|
|
28
|
+
if (!Number.isFinite(r))
|
|
28
29
|
return;
|
|
29
|
-
const
|
|
30
|
-
if (!
|
|
30
|
+
const l = e.getAttribute("esd-ext-config");
|
|
31
|
+
if (!l)
|
|
31
32
|
return;
|
|
32
|
-
let
|
|
33
|
+
let m;
|
|
33
34
|
try {
|
|
34
|
-
|
|
35
|
+
m = JSON.parse(l);
|
|
35
36
|
} catch {
|
|
36
37
|
return;
|
|
37
38
|
}
|
|
38
|
-
z(
|
|
39
|
+
z(m) && a.seedBlockUrlConfig(r, E(m));
|
|
39
40
|
});
|
|
40
41
|
try {
|
|
41
|
-
await
|
|
42
|
+
await a.fetchRecommendationCreateData();
|
|
42
43
|
} catch (e) {
|
|
43
44
|
console.warn(
|
|
44
45
|
"Recommendation reference data pre-load failed; validator will skip the availability check.",
|
|
@@ -46,54 +47,54 @@ async function S(n) {
|
|
|
46
47
|
);
|
|
47
48
|
}
|
|
48
49
|
}
|
|
49
|
-
const
|
|
50
|
-
const
|
|
50
|
+
const ee = () => {
|
|
51
|
+
const c = L(), n = N(), i = v(), { getCompiledEmail: a, getTemplateData: e, updateHtmlAndCss: s } = F(), { compileHtml: r, compileAmpHtml: l } = D(), { isFeatureEnabled: m } = x();
|
|
51
52
|
return {
|
|
52
|
-
prepareTemplateDetails: async (
|
|
53
|
-
let { html:
|
|
54
|
-
if (
|
|
53
|
+
prepareTemplateDetails: async (w) => {
|
|
54
|
+
let { html: t, css: p, syncModulesIds: f = [] } = w ?? await e();
|
|
55
|
+
if (m("linkTrackingIds"))
|
|
55
56
|
try {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
} catch (
|
|
59
|
-
console.error("Tracking-id step failed, saving anyway:",
|
|
57
|
+
let o = b(t, n.trackIdSessionFloor);
|
|
58
|
+
n.trackIdSessionFloor = o.plan.nextSeq, o.plan.changed && U(o) && ({ html: t, css: p, syncModulesIds: f = [] } = await e(), o = b(t, n.trackIdSessionFloor), n.trackIdSessionFloor = o.plan.nextSeq), o.plan.changed && (t = q(t, o), await s(t, p));
|
|
59
|
+
} catch (o) {
|
|
60
|
+
console.error("Tracking-id step failed, saving anyway:", o);
|
|
60
61
|
}
|
|
61
|
-
const { html:
|
|
62
|
+
const { html: y, ampHtml: u = "", ampErrors: k = [] } = await a({
|
|
62
63
|
minimize: !0,
|
|
63
64
|
resetDataSavedFlag: !1
|
|
64
65
|
});
|
|
65
|
-
|
|
66
|
-
const { compiledHtml:
|
|
66
|
+
i.selectedUnsubscribePages.length && await i.fetchTemplates(), await h(t);
|
|
67
|
+
const { compiledHtml: A, stats: d, appliedRules: P } = r(y), C = u && l(u).compiledHtml, I = c.getSelectedDynamicContentList, H = T(), g = M(t);
|
|
67
68
|
return console.debug("HTML Compilation Stats:", {
|
|
68
|
-
originalSize:
|
|
69
|
-
compiledSize:
|
|
70
|
-
reduction: `${
|
|
71
|
-
appliedRules:
|
|
72
|
-
executionTime: `${
|
|
69
|
+
originalSize: d.originalSize,
|
|
70
|
+
compiledSize: d.compiledSize,
|
|
71
|
+
reduction: `${d.reductionPercentage.toFixed(2)}%`,
|
|
72
|
+
appliedRules: P,
|
|
73
|
+
executionTime: `${d.executionTime.toFixed(2)}ms`
|
|
73
74
|
}), {
|
|
74
|
-
dynamicContentList:
|
|
75
|
-
compiledHtml:
|
|
76
|
-
rawHtml:
|
|
77
|
-
css:
|
|
78
|
-
ampHtml:
|
|
79
|
-
ampErrors:
|
|
80
|
-
modules:
|
|
75
|
+
dynamicContentList: I,
|
|
76
|
+
compiledHtml: A,
|
|
77
|
+
rawHtml: t,
|
|
78
|
+
css: p,
|
|
79
|
+
ampHtml: C,
|
|
80
|
+
ampErrors: k,
|
|
81
|
+
modules: f.map(Number),
|
|
81
82
|
recommendation: {
|
|
82
|
-
campaignUrls:
|
|
83
|
+
campaignUrls: H.recommendationCampaignUrls,
|
|
83
84
|
configs: {}
|
|
84
85
|
},
|
|
85
86
|
unsubscribe: {
|
|
86
|
-
status:
|
|
87
|
-
config:
|
|
87
|
+
status: g.length > 0,
|
|
88
|
+
config: g
|
|
88
89
|
}
|
|
89
90
|
};
|
|
90
91
|
},
|
|
91
92
|
// Exposed so the back/test validate-only path can seed the reco store the
|
|
92
93
|
// same way a full save does (required-field findings depend on it).
|
|
93
|
-
hydrateRecommendationStore:
|
|
94
|
+
hydrateRecommendationStore: h
|
|
94
95
|
};
|
|
95
96
|
};
|
|
96
97
|
export {
|
|
97
|
-
|
|
98
|
-
|
|
98
|
+
M as getHtmlReferencedUnsubscribePages,
|
|
99
|
+
ee as useTemplatePreparation
|
|
99
100
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@useinsider/guido",
|
|
3
|
-
"version": "3.23.0-beta.
|
|
3
|
+
"version": "3.23.0-beta.534d03d",
|
|
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",
|