@useinsider/guido 3.6.1-beta.03230b7 → 3.7.0-beta.77d2633
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 +14 -0
- package/dist/components/Guido.vue.js +1 -1
- package/dist/components/Guido.vue2.js +75 -72
- package/dist/components/organisms/header/EditorActions.vue.js +1 -1
- package/dist/components/organisms/header/EditorActions.vue2.js +6 -6
- package/dist/components/organisms/header/LeftSlot.vue.js +5 -5
- package/dist/components/organisms/header/LeftSlot.vue2.js +9 -9
- package/dist/composables/useActionsApi.js +16 -15
- package/dist/composables/useHtmlCompiler.js +40 -22
- package/dist/composables/useRecommendation.js +34 -33
- package/dist/composables/useSave.js +17 -16
- package/dist/composables/validators/useUnsubscribeBlockValidator.js +32 -0
- package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +127 -123
- package/dist/extensions/Blocks/Recommendation/controls/main/layoutOrientation.js +12 -11
- package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +46 -46
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +13 -9
- package/dist/extensions/Blocks/Recommendation/templates/grid/elementRenderer.js +35 -29
- package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +28 -28
- package/dist/extensions/Blocks/Recommendation/templates/list/elementRenderer.js +8 -8
- package/dist/extensions/Blocks/Recommendation/templates/utils.js +56 -49
- package/dist/extensions/Blocks/Recommendation/utils/partnerCustomizations.js +21 -0
- package/dist/extensions/Blocks/Recommendation/utils/priceFormatter.js +17 -17
- package/dist/extensions/Blocks/Unsubscribe/block.js +13 -13
- package/dist/extensions/Blocks/Unsubscribe/utils/constants.js +4 -3
- package/dist/guido.css +1 -1
- package/dist/src/components/Guido.vue.d.ts +1 -0
- package/dist/src/composables/useHtmlCompiler.d.ts +1 -0
- package/dist/src/composables/validators/useUnsubscribeBlockValidator.d.ts +3 -0
- package/dist/src/composables/validators/useUnsubscribeBlockValidator.test.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/templates/grid/elementRenderer.d.ts +7 -0
- package/dist/src/extensions/Blocks/Recommendation/templates/index.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/templates/utils.d.ts +8 -0
- package/dist/src/extensions/Blocks/Recommendation/templates/utils.test.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/partnerCustomizations.d.ts +7 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/priceFormatter.test.d.ts +1 -0
- package/dist/src/extensions/Blocks/Unsubscribe/utils/constants.d.ts +1 -0
- package/dist/src/utils/ampErrorFilter.d.ts +2 -0
- package/dist/src/utils/ampErrorFilter.test.d.ts +1 -0
- package/dist/src/utils/templatePreparation.d.ts +16 -0
- package/dist/src/utils/templatePreparation.test.d.ts +1 -0
- package/dist/utils/ampErrorFilter.js +8 -0
- package/dist/utils/templatePreparation.js +59 -58
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -246,6 +246,20 @@ guidoRef.value?.dynamicContent.close();
|
|
|
246
246
|
|
|
247
247
|
// Silent save (no UI feedback)
|
|
248
248
|
guidoRef.value?.saveSilent();
|
|
249
|
+
|
|
250
|
+
// Control the editor's full-screen loader for flows Guido can't see.
|
|
251
|
+
// Guido shows the loader automatically for manual saves; use setLoading()
|
|
252
|
+
// when your app keeps the editor mounted after a save and needs to drive it:
|
|
253
|
+
|
|
254
|
+
// • Release the loader when a save is blocked/rejected and you stay in the
|
|
255
|
+
// editor (e.g. a post-save domain-allowlist error you surface in place),
|
|
256
|
+
// so the editor isn't left stuck on the spinner:
|
|
257
|
+
guidoRef.value?.setLoading(false);
|
|
258
|
+
|
|
259
|
+
// • Raise the loader to cover a host-initiated navigation (e.g. a
|
|
260
|
+
// save-and-leave flow) so the editor doesn't flash before your route
|
|
261
|
+
// changes — release it again if that save turns out to be blocked:
|
|
262
|
+
guidoRef.value?.setLoading(true);
|
|
249
263
|
```
|
|
250
264
|
|
|
251
265
|
---
|
|
@@ -1,70 +1,72 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useCortexBlueprintBridge as
|
|
3
|
-
import { provideGuidoActions as
|
|
4
|
-
import { useGuidoStateBridge as
|
|
5
|
-
import { usePartner as
|
|
6
|
-
import { useStripo as
|
|
7
|
-
import { useTimerClone as
|
|
8
|
-
import { migrate as
|
|
9
|
-
import { ModuleFolderDefaults as
|
|
1
|
+
import { defineComponent as X, defineAsyncComponent as I, ref as W, computed as x, watch as Y, onMounted as Z, onUnmounted as ee } from "vue";
|
|
2
|
+
import { useCortexBlueprintBridge as oe } from "../composables/useCortexBlueprintBridge.js";
|
|
3
|
+
import { provideGuidoActions as te } from "../composables/useGuidoActions.js";
|
|
4
|
+
import { useGuidoStateBridge as ne } from "../composables/useGuidoStateBridge.js";
|
|
5
|
+
import { usePartner as re } from "../composables/usePartner.js";
|
|
6
|
+
import { useStripo as se } from "../composables/useStripo.js";
|
|
7
|
+
import { useTimerClone as ae } from "../composables/useTimerClone.js";
|
|
8
|
+
import { migrate as G } from "../config/migrator/index.js";
|
|
9
|
+
import { ModuleFolderDefaults as H } from "../enums/defaults.js";
|
|
10
10
|
import { RIBBON_SELECTOR as ce } from "../enums/onboarding.js";
|
|
11
|
-
import { useRecommendationExtensionStore as
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import { useStripoApi as
|
|
11
|
+
import { useRecommendationExtensionStore as ie } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
12
|
+
import me from "./organisms/AutoSaveController.vue.js";
|
|
13
|
+
import de from "./organisms/base/Toaster.vue.js";
|
|
14
|
+
import le from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
|
|
15
|
+
import ue from "./organisms/header/HeaderWrapper.vue.js";
|
|
16
|
+
import pe from "./organisms/LoadingWrapper.vue.js";
|
|
17
|
+
import fe from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
|
|
18
|
+
import ve from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
|
|
19
|
+
import { useStripoApi as Se } from "../services/stripoApi.js";
|
|
20
20
|
import { useConfigStore as ye } from "../stores/config.js";
|
|
21
|
-
import { useDynamicContentStore as
|
|
22
|
-
import { useEditorStore as
|
|
23
|
-
import { usePreviewStore as
|
|
21
|
+
import { useDynamicContentStore as he } from "../stores/dynamic-content.js";
|
|
22
|
+
import { useEditorStore as $ } from "../stores/editor.js";
|
|
23
|
+
import { usePreviewStore as ge } from "../stores/preview.js";
|
|
24
24
|
import { useTemplateStore as be } from "../stores/template.js";
|
|
25
|
-
import { useUnsubscribeStore as
|
|
26
|
-
const
|
|
25
|
+
import { useUnsubscribeStore as Ee } from "../stores/unsubscribe.js";
|
|
26
|
+
const Ve = /* @__PURE__ */ X({
|
|
27
27
|
__name: "Guido",
|
|
28
28
|
props: {
|
|
29
29
|
config: null
|
|
30
30
|
},
|
|
31
31
|
emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change", "ready", "onboarding:finished", "test-email:click"],
|
|
32
|
-
setup(
|
|
33
|
-
const
|
|
32
|
+
setup(z, { expose: q, emit: n }) {
|
|
33
|
+
const b = z, K = I(
|
|
34
34
|
() => import("./organisms/email-preview/PreviewContainer.vue.js")
|
|
35
|
-
),
|
|
35
|
+
), V = I(
|
|
36
36
|
() => import("./organisms/onboarding/OnboardingWrapper.vue.js")
|
|
37
|
-
), E =
|
|
38
|
-
i.init(
|
|
39
|
-
const
|
|
37
|
+
), E = W(), p = W(), f = he(), w = Ee(), i = ye();
|
|
38
|
+
i.init(b.config);
|
|
39
|
+
const m = $(), j = ge(), d = x(() => m.hasChanges), { isTestPartner: J } = re(), D = () => {
|
|
40
40
|
var e;
|
|
41
41
|
return (e = E.value) == null ? void 0 : e.handleSave(!0);
|
|
42
|
+
}, C = (e) => {
|
|
43
|
+
m.loadingStatus = e;
|
|
42
44
|
}, {
|
|
43
45
|
templateId: v,
|
|
44
|
-
userId:
|
|
45
|
-
partnerName:
|
|
46
|
+
userId: T,
|
|
47
|
+
partnerName: L,
|
|
46
48
|
username: k,
|
|
47
49
|
template: o,
|
|
48
50
|
editor: s
|
|
49
|
-
} = i,
|
|
50
|
-
|
|
51
|
-
const
|
|
51
|
+
} = i, l = (o == null ? void 0 : o.html) || "", F = (o == null ? void 0 : o.css) || "", S = (o == null ? void 0 : o.preselectedDynamicContent) || [], U = (s == null ? void 0 : s.savedModulesFolderName) || H.SAVED_MODULES, _ = (s == null ? void 0 : s.defaultModulesFolderName) || H.DEFAULT_MODULES;
|
|
52
|
+
oe(), ne();
|
|
53
|
+
const y = {
|
|
52
54
|
emailId: v,
|
|
53
|
-
userId:
|
|
55
|
+
userId: T,
|
|
54
56
|
username: k,
|
|
55
|
-
partnerName:
|
|
56
|
-
savedModulesFolderName:
|
|
57
|
-
defaultModulesFolderName:
|
|
58
|
-
},
|
|
59
|
-
preselectedDynamicContentList:
|
|
57
|
+
partnerName: L,
|
|
58
|
+
savedModulesFolderName: U,
|
|
59
|
+
defaultModulesFolderName: _
|
|
60
|
+
}, M = {
|
|
61
|
+
preselectedDynamicContentList: S,
|
|
60
62
|
onReady: () => {
|
|
61
63
|
console.debug("guido:ready"), n("ready");
|
|
62
64
|
}
|
|
63
|
-
}, { initPlugin:
|
|
65
|
+
}, { initPlugin: O } = se(y, M), { getDefaultTemplate: P } = Se(), { cloneTimersOnSave: R, hasTimerBlocks: A } = ae(), Q = x(() => {
|
|
64
66
|
var e;
|
|
65
67
|
return !((e = i.ui) != null && e.showHeader);
|
|
66
68
|
});
|
|
67
|
-
|
|
69
|
+
te({
|
|
68
70
|
onBack: () => {
|
|
69
71
|
console.debug("guido:back"), n("back");
|
|
70
72
|
},
|
|
@@ -72,66 +74,67 @@ const Ke = /* @__PURE__ */ Q({
|
|
|
72
74
|
console.debug("guido:save:start"), n("save:start");
|
|
73
75
|
},
|
|
74
76
|
onSaveComplete: (e) => {
|
|
75
|
-
const t = { ...e, metadata:
|
|
77
|
+
const t = { ...e, metadata: y };
|
|
76
78
|
console.debug("guido:save:complete", t), n("save:complete", t);
|
|
77
79
|
},
|
|
78
80
|
onTestEmailClick: () => {
|
|
79
81
|
console.debug("guido:test-email:click"), n("test-email:click");
|
|
80
82
|
}
|
|
81
83
|
});
|
|
82
|
-
const
|
|
83
|
-
console.debug("dynamic-content:close", e),
|
|
84
|
-
},
|
|
84
|
+
const B = (e) => {
|
|
85
|
+
console.debug("dynamic-content:close", e), f.setSelectedDynamicContent(e), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: e }));
|
|
86
|
+
}, N = () => {
|
|
85
87
|
console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
|
|
86
88
|
};
|
|
87
|
-
|
|
88
|
-
n("on-change",
|
|
89
|
+
Y(() => d.value, () => {
|
|
90
|
+
n("on-change", d.value);
|
|
89
91
|
});
|
|
90
92
|
const h = (e) => {
|
|
91
|
-
const t = e, { attribute:
|
|
92
|
-
console.debug("dynamic-content:open", t.detail), n("dynamic-content:open",
|
|
93
|
+
const t = e, { attribute: u, position: c } = t.detail;
|
|
94
|
+
console.debug("dynamic-content:open", t.detail), n("dynamic-content:open", u, c);
|
|
93
95
|
};
|
|
94
|
-
let
|
|
95
|
-
const
|
|
96
|
+
let a = null;
|
|
97
|
+
const g = () => {
|
|
96
98
|
var t;
|
|
97
99
|
const e = document.querySelector(ce);
|
|
98
|
-
(t =
|
|
100
|
+
(t = p.value) == null || t.style.setProperty("--ribbon-offset", `${(e == null ? void 0 : e.offsetHeight) ?? 0}px`);
|
|
99
101
|
};
|
|
100
|
-
return
|
|
101
|
-
var t,
|
|
102
|
-
console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"),
|
|
103
|
-
const e = (t =
|
|
104
|
-
e && (
|
|
102
|
+
return Z(async () => {
|
|
103
|
+
var t, u;
|
|
104
|
+
console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), ie().$reset(), $().$reset(), m.templateId = v, be().$reset(), g();
|
|
105
|
+
const e = (t = p.value) == null ? void 0 : t.parentElement;
|
|
106
|
+
e && (a = new ResizeObserver(g), a.observe(e));
|
|
105
107
|
try {
|
|
106
108
|
w.selectedUnsubscribePages = (o == null ? void 0 : o.selectedUnsubscribePages) || [];
|
|
107
|
-
const
|
|
109
|
+
const c = ((u = o == null ? void 0 : o.migration) == null ? void 0 : u.recommendationConfigs) ?? {};
|
|
108
110
|
let r = {
|
|
109
|
-
html:
|
|
111
|
+
html: l && await G(l, c),
|
|
110
112
|
css: F
|
|
111
113
|
};
|
|
112
|
-
r.html || (r = await
|
|
113
|
-
} catch (
|
|
114
|
-
console.error("Failed to initialize Stripo editor:",
|
|
114
|
+
r.html || (r = await P(), r.html = await G(r.html, c)), A(r.html) && (r.html = await R(r.html)), await O(r), f.selectedDynamicContentList = S;
|
|
115
|
+
} catch (c) {
|
|
116
|
+
console.error("Failed to initialize Stripo editor:", c);
|
|
115
117
|
}
|
|
116
118
|
document.addEventListener("dynamic-content:open", h);
|
|
117
|
-
}),
|
|
118
|
-
|
|
119
|
+
}), ee(() => {
|
|
120
|
+
a == null || a.disconnect(), document.removeEventListener("dynamic-content:open", h);
|
|
119
121
|
try {
|
|
120
122
|
window.UIEditor.removeEditor();
|
|
121
123
|
} catch {
|
|
122
124
|
console.debug("Failed to remove Stripo editor: No editor found");
|
|
123
125
|
}
|
|
124
126
|
i.reset();
|
|
125
|
-
}),
|
|
127
|
+
}), q({
|
|
126
128
|
dynamicContent: {
|
|
127
|
-
insert:
|
|
128
|
-
close:
|
|
129
|
+
insert: B,
|
|
130
|
+
close: N
|
|
129
131
|
},
|
|
130
|
-
hasChanges:
|
|
131
|
-
saveSilent: D
|
|
132
|
-
|
|
132
|
+
hasChanges: d,
|
|
133
|
+
saveSilent: D,
|
|
134
|
+
setLoading: C
|
|
135
|
+
}), { __sfc: !0, PreviewContainer: K, OnboardingWrapper: V, headerWrapperRef: E, wrapperRef: p, dynamicContentStore: f, unsubscribeStore: w, props: b, configStore: i, editorStore: m, previewStore: j, hasChanges: d, isTestPartner: J, saveSilent: D, setLoading: C, templateId: v, userId: T, partnerName: L, username: k, templateConfig: o, editorConfig: s, html: l, css: F, preselectedDynamicContentList: S, savedModulesFolderName: U, defaultModulesFolderName: _, emit: n, metadata: y, options: M, initPlugin: O, getDefaultTemplate: P, cloneTimersOnSave: R, hasTimerBlocks: A, noHeader: Q, insertDynamicContent: B, closeDynamicContent: N, handleDynamicContentOpen: h, ribbonObserver: a, updateRibbonOffset: g, AutoSaveController: me, Toaster: de, FilterSelectionDrawer: le, HeaderWrapper: ue, LoadingWrapper: pe, SaveAsTemplateDrawer: fe, UnsubscribeWrapper: ve };
|
|
133
136
|
}
|
|
134
137
|
});
|
|
135
138
|
export {
|
|
136
|
-
|
|
139
|
+
Ve as default
|
|
137
140
|
};
|
|
@@ -17,7 +17,7 @@ import K from "./MigrationConfirmModal.vue.js";
|
|
|
17
17
|
const ut = /* @__PURE__ */ O({
|
|
18
18
|
__name: "EditorActions",
|
|
19
19
|
setup(N, { expose: x }) {
|
|
20
|
-
const { config: a, isFeatureEnabled: l } = b(), { exportHtml: m } = k(), { save: u } = F(), { openVersionHistory: c, closeVersionHistory: p } = R(), { getCompiledEmail: f } = q(), { compileHtml: d } = D(), { validateLiquidSyntax: v } = z(), e = I(), y = P(), { hasMigrations:
|
|
20
|
+
const { config: a, isFeatureEnabled: l } = b(), { exportHtml: m } = k(), { save: u } = F(), { openVersionHistory: c, closeVersionHistory: p } = R(), { getCompiledEmail: f } = q(), { compileHtml: d } = D(), { validateLiquidSyntax: v } = z(), e = I(), y = P(), { hasMigrations: g } = J(y), s = L(), i = n(!1), r = n(!1), S = n(), H = B(), T = () => {
|
|
21
21
|
if (e.isVersionHistoryOpen) {
|
|
22
22
|
p();
|
|
23
23
|
return;
|
|
@@ -33,13 +33,13 @@ const ut = /* @__PURE__ */ O({
|
|
|
33
33
|
return ((o = (t = a.value) == null ? void 0 : t.features) == null ? void 0 : o.versionHistory) && !e.isPreviewModeOpen;
|
|
34
34
|
}
|
|
35
35
|
), V = async (t) => {
|
|
36
|
-
r.value = !0, e.loadingStatus = !0;
|
|
36
|
+
r.value = !0, t || (e.loadingStatus = !0);
|
|
37
37
|
const o = await u(t);
|
|
38
|
-
return r.value = !1,
|
|
38
|
+
return r.value = !1, !t && !o && (e.loadingStatus = !1), o;
|
|
39
39
|
}, E = (t) => {
|
|
40
40
|
var o;
|
|
41
|
-
if (!t &&
|
|
42
|
-
(o =
|
|
41
|
+
if (!t && g.value) {
|
|
42
|
+
(o = S.value) == null || o.open();
|
|
43
43
|
return;
|
|
44
44
|
}
|
|
45
45
|
return V(t);
|
|
@@ -58,7 +58,7 @@ const ut = /* @__PURE__ */ O({
|
|
|
58
58
|
};
|
|
59
59
|
return x({
|
|
60
60
|
handleSave: E
|
|
61
|
-
}), { __sfc: !0, config: a, isFeatureEnabled: l, exportHtml: m, save: u, openVersionHistory: c, closeVersionHistory: p, getCompiledEmail: f, compileHtml: d, validateLiquidSyntax: v, editorStore: e, templateStore: y, hasMigrations:
|
|
61
|
+
}), { __sfc: !0, config: a, isFeatureEnabled: l, exportHtml: m, save: u, openVersionHistory: c, closeVersionHistory: p, getCompiledEmail: f, compileHtml: d, validateLiquidSyntax: v, editorStore: e, templateStore: y, hasMigrations: g, trans: s, isExporting: i, isSaving: r, migrationModalRef: S, testEmailClick: H, handleVersionHistory: T, handleExport: w, handleSaveAs: _, versionHistoryTooltipText: C, isVersionHistoryButtonVisible: A, executeSave: V, handleSave: E, handleTestEmail: M, getTooltipOptions: j, InButtonV2: G, MigrationConfirmModal: K };
|
|
62
62
|
}
|
|
63
63
|
});
|
|
64
64
|
export {
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import o from "./LeftSlot.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
|
-
import
|
|
4
|
-
var
|
|
3
|
+
import a from "../../../_virtual/_plugin-vue2_normalizer.js";
|
|
4
|
+
var n = function() {
|
|
5
5
|
var e = this, s = e._self._c, t = e._self._setupProxy;
|
|
6
6
|
return s("div", { staticClass: "d-f a-i-c" }, [s(t.InButtonV2, { attrs: { id: "guido__back-button", "left-icon": "line-arrow-left", styling: "ghost", type: "secondary", "disabled-status": t.isBackButtonDisabled, "label-text": t.backButtonLabel, "skeleton-sizing": { width: 150, height: 26 }, "skeleton-status": t.editorStore.loadingStatus }, on: { click: t.handleBackClick } })], 1);
|
|
7
|
-
}, i = [], r = /* @__PURE__ */
|
|
7
|
+
}, i = [], r = /* @__PURE__ */ a(
|
|
8
8
|
o,
|
|
9
|
-
|
|
9
|
+
n,
|
|
10
10
|
i,
|
|
11
11
|
!1,
|
|
12
12
|
null,
|
|
13
|
-
"
|
|
13
|
+
"73199fa4"
|
|
14
14
|
);
|
|
15
15
|
const f = r.exports;
|
|
16
16
|
export {
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { defineComponent as l, computed as
|
|
1
|
+
import { defineComponent as l, computed as p, ref as d } from "vue";
|
|
2
2
|
import { useConfig as k } from "../../../composables/useConfig.js";
|
|
3
3
|
import { useBack as B } from "../../../composables/useGuidoActions.js";
|
|
4
4
|
import { usePreviewMode as b } from "../../../composables/usePreviewMode.js";
|
|
5
5
|
import { useTranslations as v } from "../../../composables/useTranslations.js";
|
|
6
6
|
import { useVersionHistoryApi as _ } from "../../../composables/useVersionHistoryApi.js";
|
|
7
7
|
import { useEditorStore as V } from "../../../stores/editor.js";
|
|
8
|
-
import { InButtonV2 as
|
|
9
|
-
import { useDebounceFn as
|
|
8
|
+
import { InButtonV2 as w } from "@useinsider/design-system-vue";
|
|
9
|
+
import { useDebounceFn as y } from "../../../node_modules/@vueuse/shared/index.js";
|
|
10
10
|
const D = /* @__PURE__ */ l({
|
|
11
11
|
__name: "LeftSlot",
|
|
12
|
-
setup(
|
|
13
|
-
const e = V(), i = B(), { closeVersionHistory: n } = _(), { closePreviewMode: s } = b(), o = v(), { config: t } = k(), f =
|
|
12
|
+
setup(C) {
|
|
13
|
+
const e = V(), i = B(), { closeVersionHistory: n } = _(), { closePreviewMode: s } = b(), o = v(), { config: t } = k(), f = p(() => {
|
|
14
14
|
var u, m;
|
|
15
15
|
return e.isVersionHistoryOpen || e.isPreviewModeOpen ? o("email-editor.back-to-editor") : (m = (u = t.value) == null ? void 0 : u.ui) != null && m.backButtonLabel ? t.value.ui.backButtonLabel : o("email-editor.back-to-design");
|
|
16
|
-
}), r =
|
|
16
|
+
}), r = d(!1), c = () => {
|
|
17
17
|
if (e.isVersionHistoryOpen) {
|
|
18
18
|
n();
|
|
19
19
|
return;
|
|
@@ -22,13 +22,13 @@ const D = /* @__PURE__ */ l({
|
|
|
22
22
|
s();
|
|
23
23
|
return;
|
|
24
24
|
}
|
|
25
|
-
|
|
26
|
-
}, a =
|
|
25
|
+
i();
|
|
26
|
+
}, a = y(() => {
|
|
27
27
|
c(), r.value = !1;
|
|
28
28
|
}, 500);
|
|
29
29
|
return { __sfc: !0, editorStore: e, handleBack: i, closeVersionHistory: n, closePreviewMode: s, trans: o, config: t, backButtonLabel: f, isBackButtonDisabled: r, executeBackAction: c, debouncedBackAction: a, handleBackClick: () => {
|
|
30
30
|
r.value = !0, a();
|
|
31
|
-
}, InButtonV2:
|
|
31
|
+
}, InButtonV2: w };
|
|
32
32
|
}
|
|
33
33
|
});
|
|
34
34
|
export {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { filterAmpErrors as w } from "../utils/ampErrorFilter.js";
|
|
2
|
+
import { useToaster as A } from "./useToaster.js";
|
|
3
|
+
const D = () => {
|
|
4
|
+
const { handleError: n } = A(), s = (t = {}) => new Promise((e, a) => {
|
|
4
5
|
const o = { ...{
|
|
5
6
|
minimize: !0,
|
|
6
7
|
utmEntity: {
|
|
@@ -20,29 +21,29 @@ const v = () => {
|
|
|
20
21
|
forceAmp: !1,
|
|
21
22
|
resetDataSavedFlag: !1,
|
|
22
23
|
disableLineHeightsReplace: !0
|
|
23
|
-
}, ...t },
|
|
24
|
-
callback: (
|
|
25
|
-
|
|
24
|
+
}, ...t }, l = {
|
|
25
|
+
callback: (r, p, d, c, u) => {
|
|
26
|
+
r ? a(r) : e({
|
|
26
27
|
html: p,
|
|
27
28
|
ampHtml: d,
|
|
28
|
-
ampErrors: c,
|
|
29
|
+
ampErrors: w(c ?? []),
|
|
29
30
|
displayConditions: u
|
|
30
31
|
});
|
|
31
32
|
},
|
|
32
33
|
...o
|
|
33
34
|
};
|
|
34
|
-
window.StripoEditorApi.actionsApi.compileEmail(
|
|
35
|
+
window.StripoEditorApi.actionsApi.compileEmail(l);
|
|
35
36
|
});
|
|
36
37
|
return {
|
|
37
|
-
getCompiledEmail:
|
|
38
|
+
getCompiledEmail: s,
|
|
38
39
|
getTemplateData: () => new Promise((t) => {
|
|
39
|
-
const e = ({ html: a, css: i, width: o, height:
|
|
40
|
+
const e = ({ html: a, css: i, width: o, height: m, utmParams: l, syncModulesIds: r }) => t({
|
|
40
41
|
html: a,
|
|
41
42
|
css: i,
|
|
42
43
|
width: o,
|
|
43
|
-
height:
|
|
44
|
-
utmParams:
|
|
45
|
-
syncModulesIds:
|
|
44
|
+
height: m,
|
|
45
|
+
utmParams: l,
|
|
46
|
+
syncModulesIds: r
|
|
46
47
|
});
|
|
47
48
|
window.StripoEditorApi.actionsApi.getTemplateData(e);
|
|
48
49
|
}),
|
|
@@ -56,7 +57,7 @@ const v = () => {
|
|
|
56
57
|
displayConditions: a,
|
|
57
58
|
ampHtml: i = "",
|
|
58
59
|
ampErrors: o = []
|
|
59
|
-
} = await
|
|
60
|
+
} = await s({ minimize: !1, resetDataSavedFlag: !1, ...t });
|
|
60
61
|
return {
|
|
61
62
|
html: e,
|
|
62
63
|
ampHtml: i,
|
|
@@ -101,5 +102,5 @@ const v = () => {
|
|
|
101
102
|
};
|
|
102
103
|
};
|
|
103
104
|
export {
|
|
104
|
-
|
|
105
|
+
D as useActionsApi
|
|
105
106
|
};
|
|
@@ -1,30 +1,48 @@
|
|
|
1
|
-
import { defaultHtmlCompilerRules as
|
|
2
|
-
import { itemsCompilerRules as
|
|
3
|
-
import { liquidCompilerRules as
|
|
4
|
-
import { outlookCompilerRules as
|
|
5
|
-
import { recommendationCompilerRules as
|
|
6
|
-
import { socialCompilerRules as
|
|
7
|
-
import { unsubscribeCompilerRules as
|
|
8
|
-
import { createHtmlCompiler as
|
|
9
|
-
import { useConfig as
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
import { defaultHtmlCompilerRules as R } from "../config/compiler/htmlCompilerRules.js";
|
|
2
|
+
import { itemsCompilerRules as g } from "../config/compiler/itemsCompilerRules.js";
|
|
3
|
+
import { liquidCompilerRules as C } from "../config/compiler/liquidCompilerRules.js";
|
|
4
|
+
import { outlookCompilerRules as b } from "../config/compiler/outlookCompilerRules.js";
|
|
5
|
+
import { recommendationCompilerRules as v } from "../config/compiler/recommendationCompilerRules.js";
|
|
6
|
+
import { socialCompilerRules as H } from "../config/compiler/socialCompilerRules.js";
|
|
7
|
+
import { unsubscribeCompilerRules as x } from "../config/compiler/unsubscribeCompilerRules.js";
|
|
8
|
+
import { createHtmlCompiler as s } from "../utils/htmlCompiler.js";
|
|
9
|
+
import { useConfig as k } from "./useConfig.js";
|
|
10
|
+
const y = /* @__PURE__ */ new Set([
|
|
11
|
+
// URL/tag encoding fixes — keep merge-tag and placeholder integrity intact.
|
|
12
|
+
"fix-url-encoding-start",
|
|
13
|
+
"fix-url-encoding-end",
|
|
14
|
+
"fix-tags-start",
|
|
15
|
+
"fix-tags-end",
|
|
16
|
+
// Image domain corrections — plain string replacement.
|
|
17
|
+
"replace-old-image-domain",
|
|
18
|
+
"replace-old-v2-image-domain",
|
|
19
|
+
// Unsubscribe domain — the actual fix: injects the real unsubscribe href in
|
|
20
|
+
// place of the `{{ins-*-unsubscribe-link}}` placeholders, plus related
|
|
21
|
+
// unsubscribe-only cleanups. All pure regex/text, no AMP-forbidden output.
|
|
22
|
+
"add-unsubscribe-link-values",
|
|
23
|
+
"remove-data-ogsb-button-styles",
|
|
24
|
+
"format-comment-braces",
|
|
25
|
+
"add-universal-link-flags",
|
|
26
|
+
// Coupon placeholder replacement (only present when liquidSyntax is enabled).
|
|
27
|
+
"liquid-coupon-code"
|
|
28
|
+
]), M = () => {
|
|
29
|
+
var m, t, r;
|
|
30
|
+
const { compiler: e, isFeatureEnabled: a, partner: n } = k(), u = ((m = e.value) == null ? void 0 : m.customRules) || [], l = [
|
|
31
|
+
...!!((t = e.value) != null && t.ignoreDefaultRules) ? [] : R,
|
|
32
|
+
...v,
|
|
33
|
+
...x,
|
|
15
34
|
...g,
|
|
16
|
-
...f,
|
|
17
|
-
...C,
|
|
18
35
|
...b,
|
|
19
|
-
...
|
|
20
|
-
...
|
|
36
|
+
...H,
|
|
37
|
+
...a("liquidSyntax") ? C : [],
|
|
38
|
+
...u.map((o, f) => ({
|
|
21
39
|
...o,
|
|
22
|
-
priority: o.priority + 1e3 +
|
|
40
|
+
priority: o.priority + 1e3 + f
|
|
23
41
|
// Ensure additional rules run after default rules
|
|
24
42
|
}))
|
|
25
|
-
], p =
|
|
26
|
-
return { compileHtml: (o) => p.compile(o, void 0,
|
|
43
|
+
], p = s(l), c = l.filter((o) => y.has(o.id)), d = s(c), i = (r = n.value) == null ? void 0 : r.fallbackFont;
|
|
44
|
+
return { compileHtml: (o) => p.compile(o, void 0, i), compileAmpHtml: (o) => d.compile(o, void 0, i) };
|
|
27
45
|
};
|
|
28
46
|
export {
|
|
29
|
-
|
|
47
|
+
M as useHtmlCompiler
|
|
30
48
|
};
|
|
@@ -1,21 +1,22 @@
|
|
|
1
|
-
import { getRecommendationFeedSourceMaps as I, URLS as
|
|
2
|
-
import { MinDeviceViewport as
|
|
3
|
-
import { useRecommendationExtensionStore as
|
|
1
|
+
import { getRecommendationFeedSourceMaps as I, URLS as R } from "../enums/extensions/recommendationBlock.js";
|
|
2
|
+
import { MinDeviceViewport as C, DefaultPadding as b } from "../enums/recommendation.js";
|
|
3
|
+
import { useRecommendationExtensionStore as l } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
4
4
|
import { generateCompleteFilterQuery as h } from "../extensions/Blocks/Recommendation/utils/filterUtil.js";
|
|
5
|
+
import { getPartnerRecommendationParams as y } from "../extensions/Blocks/Recommendation/utils/partnerCustomizations.js";
|
|
5
6
|
import { useConfigStore as x } from "../stores/config.js";
|
|
6
|
-
const
|
|
7
|
+
const k = () => ({
|
|
7
8
|
calculateCardWidth: ({
|
|
8
|
-
mobileLeftPadding:
|
|
9
|
+
mobileLeftPadding: a,
|
|
9
10
|
mobileRightPadding: s,
|
|
10
|
-
cardsInRow:
|
|
11
|
-
unresponsive:
|
|
11
|
+
cardsInRow: c,
|
|
12
|
+
unresponsive: o
|
|
12
13
|
}) => {
|
|
13
|
-
const r =
|
|
14
|
-
return (
|
|
14
|
+
const r = o ? c : 1, e = a + s + (r - 1) * b;
|
|
15
|
+
return (C - e) / r;
|
|
15
16
|
},
|
|
16
|
-
getRecommendationCampaignData: (
|
|
17
|
-
const s =
|
|
18
|
-
if (!
|
|
17
|
+
getRecommendationCampaignData: (a) => {
|
|
18
|
+
const s = l(), c = Number(a), o = s.blockStates[c];
|
|
19
|
+
if (!o)
|
|
19
20
|
return {
|
|
20
21
|
textTrimming: !1,
|
|
21
22
|
orientation: "vertical",
|
|
@@ -28,7 +29,7 @@ const w = () => ({
|
|
|
28
29
|
discountBeforeTextValue: "",
|
|
29
30
|
discountAfterTextValue: ""
|
|
30
31
|
};
|
|
31
|
-
const { recommendationConfigs: r } =
|
|
32
|
+
const { recommendationConfigs: r } = o, e = r.orientation === "grid" ? "vertical" : "horizontal";
|
|
32
33
|
return {
|
|
33
34
|
textTrimming: r.textTrimming,
|
|
34
35
|
orientation: e,
|
|
@@ -42,35 +43,35 @@ const w = () => ({
|
|
|
42
43
|
discountAfterTextValue: ""
|
|
43
44
|
};
|
|
44
45
|
},
|
|
45
|
-
buildCampaignUrl: (
|
|
46
|
-
var
|
|
47
|
-
const
|
|
46
|
+
buildCampaignUrl: (a, s) => {
|
|
47
|
+
var m;
|
|
48
|
+
const c = l(), o = x(), r = Number(a);
|
|
48
49
|
let e;
|
|
49
50
|
if (s)
|
|
50
51
|
e = s;
|
|
51
52
|
else {
|
|
52
|
-
const
|
|
53
|
-
if (!
|
|
53
|
+
const i = c.blockStates[r];
|
|
54
|
+
if (!i)
|
|
54
55
|
return "";
|
|
55
|
-
const { recommendationConfigs:
|
|
56
|
+
const { recommendationConfigs: n } = i;
|
|
56
57
|
e = {
|
|
57
|
-
strategy:
|
|
58
|
-
language:
|
|
59
|
-
currencyCode:
|
|
60
|
-
size:
|
|
61
|
-
productIds:
|
|
62
|
-
filters:
|
|
63
|
-
shuffleProducts:
|
|
58
|
+
strategy: n.strategy,
|
|
59
|
+
language: n.language,
|
|
60
|
+
currencyCode: n.currencySettings.value,
|
|
61
|
+
size: n.size,
|
|
62
|
+
productIds: n.productIds,
|
|
63
|
+
filters: n.filters,
|
|
64
|
+
shuffleProducts: n.shuffleProducts
|
|
64
65
|
};
|
|
65
66
|
}
|
|
66
|
-
const f = ((
|
|
67
|
-
t.set("locale", e.language), t.set("currency", e.currencyCode), t.set("partnerName",
|
|
68
|
-
const g = e.filters.filter((
|
|
69
|
-
d && t.set("filter", d), e.shuffleProducts && t.set("shuffle", "true");
|
|
70
|
-
const p = decodeURIComponent(t.toString()), u = `${
|
|
71
|
-
return
|
|
67
|
+
const f = ((m = I().find((i) => i.key === e.strategy)) == null ? void 0 : m.path) || "", t = new URLSearchParams();
|
|
68
|
+
t.set("locale", e.language), t.set("currency", e.currencyCode), t.set("partnerName", o.partnerName), t.set("size", e.size), t.set("details", "true"), t.set("campaignId", o.variationId), e.strategy === "manualMerchandising" ? t.set("productId", e.productIds.join(",")) : e.strategy === "similarViewed" && t.set("productId", "{itemId}"), e.strategy === "userBased" && t.set("userId", "{user_id}");
|
|
69
|
+
const g = e.filters.filter((i) => i.isValid), d = h(g);
|
|
70
|
+
d && t.set("filter", d), e.shuffleProducts && t.set("shuffle", "true"), Object.entries(y(o.partnerName, e.strategy)).forEach(([i, n]) => t.set(i, n));
|
|
71
|
+
const p = decodeURIComponent(t.toString()), u = `${R.RECOMMENDATION_API_URL}/v2/${f}?${p}`;
|
|
72
|
+
return c.recommendationCampaignUrls[a] = u, u;
|
|
72
73
|
}
|
|
73
74
|
});
|
|
74
75
|
export {
|
|
75
|
-
|
|
76
|
+
k as useRecommendation
|
|
76
77
|
};
|