@useinsider/guido 3.17.0-beta.dc7f4d2 → 3.17.0-beta.e6704da
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 +12 -6
- package/dist/components/Guido.vue.js +5 -5
- package/dist/components/Guido.vue2.js +77 -77
- package/dist/components/organisms/AutoSaveController.vue2.js +8 -9
- package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.js +18 -0
- package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue2.js +70 -0
- package/dist/components/organisms/extensions/recommendation/StrategyInfoBox.vue.js +20 -0
- package/dist/components/organisms/extensions/recommendation/StrategyInfoBox.vue2.js +55 -0
- package/dist/components/organisms/header/EditorActions.vue.js +2 -2
- package/dist/components/organisms/header/EditorActions.vue2.js +43 -74
- package/dist/components/organisms/header/LeftSlot.vue.js +5 -5
- package/dist/components/organisms/header/LeftSlot.vue2.js +23 -46
- package/dist/components/wrappers/WpDrawer.vue.js +7 -9
- package/dist/components/wrappers/WpDrawer.vue2.js +1 -1
- package/dist/composables/useCustomInterfaceAppearance.js +19 -16
- package/dist/composables/useHtmlCompiler.js +26 -37
- package/dist/composables/useHtmlValidator.js +0 -2
- package/dist/composables/useRecommendation.js +41 -34
- package/dist/composables/useSave.js +41 -84
- package/dist/composables/validators/useCouponBlockValidator.js +21 -24
- package/dist/composables/validators/useUnsubscribeBlockValidator.js +27 -34
- package/dist/config/migrator/recommendationMigrator.js +6 -4
- package/dist/enums/academy.js +2 -1
- package/dist/enums/date.js +4 -3
- package/dist/enums/extensions/recommendationBlock.js +25 -23
- package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +13 -11
- package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +96 -95
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +156 -154
- package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +141 -0
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +223 -82
- package/dist/extensions/Blocks/common-control.js +22 -19
- package/dist/guido.css +1 -1
- package/dist/services/recommendationApi.js +78 -29
- package/dist/src/@types/config/schemas.d.ts +12 -0
- package/dist/src/components/Guido.vue.d.ts +1 -17
- package/dist/src/components/organisms/{validation/ValidationErrorDrawer.vue.d.ts → extensions/recommendation/AssignStrategyDrawer.vue.d.ts} +1 -0
- package/dist/src/components/organisms/extensions/recommendation/StrategyInfoBox.vue.d.ts +24 -0
- package/dist/src/components/organisms/header/EditorActions.vue.d.ts +1 -17
- package/dist/src/components/organisms/header/HeaderWrapper.vue.d.ts +1 -17
- package/dist/src/components/organisms/header/RightSlot.vue.d.ts +1 -17
- package/dist/src/components/wrappers/WpDrawer.vue.d.ts +3 -4
- package/dist/src/composables/useConfig.d.ts +2 -0
- package/dist/src/composables/useHtmlValidator.d.ts +0 -21
- package/dist/src/composables/useRecommendation.d.ts +1 -0
- package/dist/src/composables/useSave.d.ts +1 -6
- package/dist/src/composables/validators/useCouponBlockValidator.d.ts +0 -3
- package/dist/src/composables/validators/useUnsubscribeBlockValidator.d.ts +0 -10
- package/dist/src/enums/academy.d.ts +1 -0
- package/dist/src/enums/extensions/recommendationBlock.d.ts +2 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +14 -3
- package/dist/src/extensions/Blocks/Recommendation/controls/main/strategy.d.ts +29 -0
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +214 -15
- package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +6 -0
- package/dist/src/extensions/Blocks/common-control.d.ts +4 -1
- package/dist/src/mock/api/recommendation-strategies.d.ts +43 -0
- package/dist/src/services/recommendationApi.d.ts +4 -1
- package/dist/src/stores/config.d.ts +18 -5
- package/dist/src/utils/templatePreparation.d.ts +0 -30
- package/dist/static/styles/components/recommendation-strategy.css.js +171 -0
- package/dist/stores/config.js +6 -13
- package/dist/utils/dateUtil.js +23 -10
- package/dist/utils/templatePreparation.js +50 -50
- package/package.json +2 -1
- package/dist/components/organisms/validation/ValidationErrorDrawer.vue.js +0 -20
- package/dist/components/organisms/validation/ValidationErrorDrawer.vue2.js +0 -48
- package/dist/composables/useSaveValidation.js +0 -279
- package/dist/composables/useSaveValidationRollout.js +0 -9
- package/dist/enums/save-validation.js +0 -4
- package/dist/src/@types/save-validation.d.ts +0 -19
- package/dist/src/composables/useSaveValidation.d.ts +0 -6
- package/dist/src/composables/useSaveValidationRollout.d.ts +0 -3
- package/dist/src/enums/save-validation.d.ts +0 -27
- package/dist/src/stores/save-validation.d.ts +0 -22
- package/dist/stores/save-validation.js +0 -30
package/README.md
CHANGED
|
@@ -162,6 +162,7 @@ const config: GuidoConfigInput = {
|
|
|
162
162
|
liquidSyntax?: boolean, // Default: false - Enable Liquid template syntax
|
|
163
163
|
autosave?: boolean, // Default: false - Show the Auto Save toggle in the header. See wiki/AUTOSAVE.md.
|
|
164
164
|
allowlistEnabled?: boolean, // Default: false - Pre-save domain-allowlist check (opt-in). Guido self-serves the block toaster (role lookup, deep-link, copy from window.trans).
|
|
165
|
+
reusableRecommendationStrategy?: boolean, // Default: false - Assign an RRS strategy to recommendation blocks instead of per-block algorithm/filters/shuffle/product-count settings.
|
|
165
166
|
},
|
|
166
167
|
|
|
167
168
|
// Optional: Callbacks
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ModuleFolderDefaults as f } from "../../enums/defaults.js";
|
|
2
|
-
import { object as a, number as n, optional as e, string as t, picklist as i, pipe as m, minLength as b, custom as
|
|
2
|
+
import { object as a, number as n, optional as e, string as t, picklist as i, pipe as m, minLength as b, custom as y, boolean as o, array as c, transform as C, record as k, fallback as R, literal as u, looseObject as g, variant as T, union as h, unknown as r, lazy as I } from "../../node_modules/valibot/dist/index.js";
|
|
3
3
|
const p = {
|
|
4
4
|
/** Promotional/marketing emails */
|
|
5
5
|
PROMOTIONAL: 1,
|
|
@@ -76,7 +76,7 @@ const p = {
|
|
|
76
76
|
children: e(c(S)),
|
|
77
77
|
// eslint-disable-next-line camelcase -- backend field name
|
|
78
78
|
select_items: e(c(S))
|
|
79
|
-
})), N =
|
|
79
|
+
})), N = k(
|
|
80
80
|
t(),
|
|
81
81
|
R(c(S), [])
|
|
82
82
|
), P = g({
|
|
@@ -132,7 +132,7 @@ const p = {
|
|
|
132
132
|
* strategy, currency, locale, and layout data.
|
|
133
133
|
*/
|
|
134
134
|
recommendationConfigs: e(
|
|
135
|
-
|
|
135
|
+
k(t(), P),
|
|
136
136
|
{}
|
|
137
137
|
)
|
|
138
138
|
}), x = a({
|
|
@@ -219,7 +219,13 @@ const p = {
|
|
|
219
219
|
/** Enable pre-save domain-allowlist validation (opt-in; Guido self-serves the block toaster) */
|
|
220
220
|
allowlistEnabled: e(o(), !1),
|
|
221
221
|
/** Enable persistent link tracking-id assignment for the click heatmap (opt-in) */
|
|
222
|
-
linkTrackingIds: e(o(), !1)
|
|
222
|
+
linkTrackingIds: e(o(), !1),
|
|
223
|
+
/**
|
|
224
|
+
* Assign a Reusable Recommendation Strategy (RRS) to recommendation blocks instead of
|
|
225
|
+
* per-block algorithm settings. Hides Algorithm, Filters, Shuffle and Number of Products
|
|
226
|
+
* (they live on the strategy) and adds the Assign Strategy flow.
|
|
227
|
+
*/
|
|
228
|
+
reusableRecommendationStrategy: e(o(), !1)
|
|
223
229
|
}), B = i([
|
|
224
230
|
"amp-accordion",
|
|
225
231
|
"amp-carousel",
|
|
@@ -287,7 +293,7 @@ const p = {
|
|
|
287
293
|
...d.entries,
|
|
288
294
|
type: u("custom"),
|
|
289
295
|
/** Custom processor function */
|
|
290
|
-
processor:
|
|
296
|
+
processor: y(
|
|
291
297
|
(s) => typeof s == "function",
|
|
292
298
|
"processor must be a function"
|
|
293
299
|
)
|
|
@@ -307,7 +313,7 @@ const p = {
|
|
|
307
313
|
* Return false to cancel the save operation.
|
|
308
314
|
*/
|
|
309
315
|
externalValidation: e(
|
|
310
|
-
|
|
316
|
+
y(
|
|
311
317
|
(s) => typeof s == "function",
|
|
312
318
|
"externalValidation must be a function"
|
|
313
319
|
)
|
|
@@ -3,18 +3,18 @@ import a from "./Guido.vue2.js";
|
|
|
3
3
|
import i from "../_virtual/_plugin-vue2_normalizer.js";
|
|
4
4
|
var t = function() {
|
|
5
5
|
var o = this, r = o._self._c, e = o._self._setupProxy;
|
|
6
|
-
return r("div", { ref: "wrapperRef", staticClass: "guido-editor__wrapper", class: { "guido-editor__no-header": e.noHeader } }, [r(e.HeaderWrapper, { ref: "headerWrapperRef" }), r(e.AutoSaveController), e.editorStore.isPreviewModeOpen ? r(e.PreviewContainer) : o._e(), r("div", { directives: [{ name: "show", rawName: "v-show", value: !e.previewStore.isLoaded, expression: "!previewStore.isLoaded" }], staticClass: "guido-editor__container", class: { "guido-editor__no-header": e.noHeader }, attrs: { id: "guido-editor" } }), r(e.Toaster), r(e.FilterSelectionDrawer),
|
|
6
|
+
return r("div", { ref: "wrapperRef", staticClass: "guido-editor__wrapper", class: { "guido-editor__no-header": e.noHeader } }, [r(e.HeaderWrapper, { ref: "headerWrapperRef" }), r(e.AutoSaveController), e.editorStore.isPreviewModeOpen ? r(e.PreviewContainer) : o._e(), r("div", { directives: [{ name: "show", rawName: "v-show", value: !e.previewStore.isLoaded, expression: "!previewStore.isLoaded" }], staticClass: "guido-editor__container", class: { "guido-editor__no-header": e.noHeader }, attrs: { id: "guido-editor" } }), r(e.Toaster), r(e.FilterSelectionDrawer), e.configStore.isFeatureEnabled("reusableRecommendationStrategy") ? r(e.AssignStrategyDrawer) : o._e(), r(e.SaveAsTemplateDrawer), e.isTestPartner() ? o._e() : r(e.OnboardingWrapper, { on: { "onboarding-finished": function(p) {
|
|
7
7
|
return e.emit("onboarding:finished");
|
|
8
8
|
} } }), r(e.UnsubscribeWrapper), r(e.LoadingWrapper)], 1);
|
|
9
|
-
}, n = [],
|
|
9
|
+
}, n = [], s = /* @__PURE__ */ i(
|
|
10
10
|
a,
|
|
11
11
|
t,
|
|
12
12
|
n,
|
|
13
13
|
!1,
|
|
14
14
|
null,
|
|
15
|
-
"
|
|
15
|
+
"f258bc9e"
|
|
16
16
|
);
|
|
17
|
-
const
|
|
17
|
+
const l = s.exports;
|
|
18
18
|
export {
|
|
19
|
-
|
|
19
|
+
l as default
|
|
20
20
|
};
|
|
@@ -1,32 +1,30 @@
|
|
|
1
|
-
import { defineComponent as J, defineAsyncComponent as
|
|
1
|
+
import { defineComponent as J, defineAsyncComponent as g, ref as B, computed as U, watch as _, onMounted as Q, onUnmounted as X } from "vue";
|
|
2
2
|
import { useCortexBlueprintBridge as Y } from "../composables/useCortexBlueprintBridge.js";
|
|
3
3
|
import { provideGuidoActions as Z } from "../composables/useGuidoActions.js";
|
|
4
4
|
import { useGuidoStateBridge as ee } from "../composables/useGuidoStateBridge.js";
|
|
5
|
-
import { usePartner as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import
|
|
13
|
-
import ie from "./organisms/
|
|
14
|
-
import ce from "./organisms/
|
|
15
|
-
import de from "./organisms/
|
|
16
|
-
import me from "./organisms/
|
|
17
|
-
import le from "./organisms/
|
|
18
|
-
import ue from "./organisms/
|
|
19
|
-
import pe from "
|
|
20
|
-
import fe from "
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
|
|
28
|
-
import { readTrackFloor as A } from "../utils/linkTrackingIds.js";
|
|
29
|
-
const Je = /* @__PURE__ */ J({
|
|
5
|
+
import { usePartner as te } from "../composables/usePartner.js";
|
|
6
|
+
import { useStripo as oe } from "../composables/useStripo.js";
|
|
7
|
+
import { useTimerClone as ne } from "../composables/useTimerClone.js";
|
|
8
|
+
import { migrate as A } from "../config/migrator/index.js";
|
|
9
|
+
import { ModuleFolderDefaults as N } from "../enums/defaults.js";
|
|
10
|
+
import { RIBBON_SELECTOR as re } from "../enums/onboarding.js";
|
|
11
|
+
import { useRecommendationExtensionStore as se } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
12
|
+
import ae from "./organisms/AutoSaveController.vue.js";
|
|
13
|
+
import ie from "./organisms/base/Toaster.vue.js";
|
|
14
|
+
import ce from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
|
|
15
|
+
import de from "./organisms/header/HeaderWrapper.vue.js";
|
|
16
|
+
import me from "./organisms/LoadingWrapper.vue.js";
|
|
17
|
+
import le from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
|
|
18
|
+
import ue from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
|
|
19
|
+
import { useStripoApi as pe } from "../services/stripoApi.js";
|
|
20
|
+
import { useConfigStore as fe } from "../stores/config.js";
|
|
21
|
+
import { useDynamicContentStore as ye } from "../stores/dynamic-content.js";
|
|
22
|
+
import { useEditorStore as O } from "../stores/editor.js";
|
|
23
|
+
import { usePreviewStore as ve } from "../stores/preview.js";
|
|
24
|
+
import { useTemplateStore as ge } from "../stores/template.js";
|
|
25
|
+
import { useUnsubscribeStore as Se } from "../stores/unsubscribe.js";
|
|
26
|
+
import { readTrackFloor as P } from "../utils/linkTrackingIds.js";
|
|
27
|
+
const qe = /* @__PURE__ */ J({
|
|
30
28
|
__name: "Guido",
|
|
31
29
|
props: {
|
|
32
30
|
config: null,
|
|
@@ -34,32 +32,34 @@ const Je = /* @__PURE__ */ J({
|
|
|
34
32
|
},
|
|
35
33
|
emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change", "ready", "onboarding:finished", "test-email:click"],
|
|
36
34
|
setup(W, { expose: x, emit: r }) {
|
|
37
|
-
const a = W, G =
|
|
35
|
+
const a = W, G = g(
|
|
38
36
|
() => import("./organisms/email-preview/PreviewContainer.vue.js")
|
|
39
|
-
), H =
|
|
37
|
+
), H = g(
|
|
40
38
|
() => import("./organisms/onboarding/OnboardingWrapper.vue.js")
|
|
41
|
-
),
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
39
|
+
), $ = g(
|
|
40
|
+
() => import("./organisms/extensions/recommendation/AssignStrategyDrawer.vue.js")
|
|
41
|
+
), S = B(), l = B(), u = ye(), h = Se(), o = fe();
|
|
42
|
+
a.ready && o.init(a.config);
|
|
43
|
+
const c = O(), z = ve(), m = U(() => c.hasChanges), { isTestPartner: q } = te(), b = () => {
|
|
44
|
+
var t;
|
|
45
|
+
return (t = S.value) == null ? void 0 : t.handleSave(!0);
|
|
46
|
+
}, E = (t) => {
|
|
47
|
+
c.loadingStatus = t;
|
|
48
48
|
};
|
|
49
49
|
Y(), ee();
|
|
50
50
|
const p = () => {
|
|
51
|
-
var
|
|
51
|
+
var t, e;
|
|
52
52
|
return {
|
|
53
|
-
emailId:
|
|
54
|
-
userId:
|
|
55
|
-
username:
|
|
56
|
-
partnerName:
|
|
57
|
-
savedModulesFolderName: ((
|
|
58
|
-
defaultModulesFolderName: ((e =
|
|
53
|
+
emailId: o.templateId,
|
|
54
|
+
userId: o.userId,
|
|
55
|
+
username: o.username,
|
|
56
|
+
partnerName: o.partnerName,
|
|
57
|
+
savedModulesFolderName: ((t = o.editor) == null ? void 0 : t.savedModulesFolderName) || N.SAVED_MODULES,
|
|
58
|
+
defaultModulesFolderName: ((e = o.editor) == null ? void 0 : e.defaultModulesFolderName) || N.DEFAULT_MODULES
|
|
59
59
|
};
|
|
60
|
-
}, { initPlugin:
|
|
61
|
-
var
|
|
62
|
-
return !((
|
|
60
|
+
}, { initPlugin: w, preloadRuntime: D } = oe(), { getDefaultTemplate: C } = pe(), { cloneTimersOnSave: k, hasTimerBlocks: T } = ne(), K = U(() => {
|
|
61
|
+
var t;
|
|
62
|
+
return !((t = o.ui) != null && t.showHeader);
|
|
63
63
|
});
|
|
64
64
|
Z({
|
|
65
65
|
onBack: () => {
|
|
@@ -68,65 +68,65 @@ const Je = /* @__PURE__ */ J({
|
|
|
68
68
|
onSaveStart: () => {
|
|
69
69
|
console.debug("guido:save:start"), r("save:start");
|
|
70
70
|
},
|
|
71
|
-
onSaveComplete: (
|
|
72
|
-
const e = { ...
|
|
71
|
+
onSaveComplete: (t) => {
|
|
72
|
+
const e = { ...t, metadata: p() };
|
|
73
73
|
console.debug("guido:save:complete", e), r("save:complete", e);
|
|
74
74
|
},
|
|
75
75
|
onTestEmailClick: () => {
|
|
76
76
|
console.debug("guido:test-email:click"), r("test-email:click");
|
|
77
77
|
}
|
|
78
78
|
});
|
|
79
|
-
const
|
|
80
|
-
console.debug("dynamic-content:close",
|
|
81
|
-
},
|
|
79
|
+
const F = (t) => {
|
|
80
|
+
console.debug("dynamic-content:close", t), u.setSelectedDynamicContent(t), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: t }));
|
|
81
|
+
}, I = () => {
|
|
82
82
|
console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
|
|
83
83
|
};
|
|
84
84
|
_(() => m.value, () => {
|
|
85
85
|
r("on-change", m.value);
|
|
86
86
|
});
|
|
87
|
-
const f = (
|
|
88
|
-
const e =
|
|
87
|
+
const f = (t) => {
|
|
88
|
+
const e = t, { attribute: s, position: d } = e.detail;
|
|
89
89
|
console.debug("dynamic-content:open", e.detail), r("dynamic-content:open", s, d);
|
|
90
90
|
};
|
|
91
91
|
let i = null;
|
|
92
|
-
const
|
|
92
|
+
const y = () => {
|
|
93
93
|
var e;
|
|
94
|
-
const
|
|
95
|
-
(e = l.value) == null || e.style.setProperty("--ribbon-offset", `${(
|
|
96
|
-
},
|
|
97
|
-
var
|
|
94
|
+
const t = document.querySelector(re);
|
|
95
|
+
(e = l.value) == null || e.style.setProperty("--ribbon-offset", `${(t == null ? void 0 : t.offsetHeight) ?? 0}px`);
|
|
96
|
+
}, v = async () => {
|
|
97
|
+
var t;
|
|
98
98
|
try {
|
|
99
|
-
|
|
100
|
-
const e =
|
|
99
|
+
o.initialized || o.init(a.config), c.templateId = o.templateId;
|
|
100
|
+
const e = o.template, s = (e == null ? void 0 : e.html) || "", d = (e == null ? void 0 : e.css) || "", L = (e == null ? void 0 : e.preselectedDynamicContent) || [];
|
|
101
101
|
h.selectedUnsubscribePages = (e == null ? void 0 : e.selectedUnsubscribePages) || [];
|
|
102
|
-
const
|
|
102
|
+
const M = ((t = e == null ? void 0 : e.migration) == null ? void 0 : t.recommendationConfigs) ?? {}, R = o.isFeatureEnabled("linkTrackingIds");
|
|
103
103
|
let n = {
|
|
104
|
-
html: s && await
|
|
104
|
+
html: s && await A(s, M),
|
|
105
105
|
css: d
|
|
106
106
|
};
|
|
107
|
-
n.html || (n = await
|
|
108
|
-
const
|
|
109
|
-
|
|
107
|
+
n.html || (n = await C(), n.html = await A(n.html, M));
|
|
108
|
+
const V = R ? P(n.html, (e == null ? void 0 : e.trackIdCounter) || 0) : 0;
|
|
109
|
+
T(n.html) && (n.html = await k(n.html)), R && (c.trackIdSessionFloor = Math.max(V, P(n.html)));
|
|
110
110
|
const j = {
|
|
111
|
-
preselectedDynamicContentList:
|
|
111
|
+
preselectedDynamicContentList: L,
|
|
112
112
|
onReady: () => {
|
|
113
113
|
console.debug("guido:ready"), r("ready");
|
|
114
114
|
}
|
|
115
115
|
};
|
|
116
|
-
await
|
|
116
|
+
await w(n, p(), j), u.selectedDynamicContentList = L;
|
|
117
117
|
} catch (e) {
|
|
118
118
|
console.error("Failed to initialize Stripo editor:", e);
|
|
119
119
|
}
|
|
120
120
|
};
|
|
121
121
|
return Q(async () => {
|
|
122
122
|
var e;
|
|
123
|
-
console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"),
|
|
124
|
-
const
|
|
125
|
-
if (
|
|
126
|
-
await
|
|
123
|
+
console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), se().$reset(), O().$reset(), ge().$reset(), y();
|
|
124
|
+
const t = (e = l.value) == null ? void 0 : e.parentElement;
|
|
125
|
+
if (t && (i = new ResizeObserver(y), i.observe(t)), D(), a.ready)
|
|
126
|
+
await v();
|
|
127
127
|
else {
|
|
128
128
|
const s = _(() => a.ready, (d) => {
|
|
129
|
-
d && (s(),
|
|
129
|
+
d && (s(), v());
|
|
130
130
|
});
|
|
131
131
|
}
|
|
132
132
|
document.addEventListener("dynamic-content:open", f);
|
|
@@ -137,18 +137,18 @@ const Je = /* @__PURE__ */ J({
|
|
|
137
137
|
} catch {
|
|
138
138
|
console.debug("Failed to remove Stripo editor: No editor found");
|
|
139
139
|
}
|
|
140
|
-
|
|
140
|
+
o.reset();
|
|
141
141
|
}), x({
|
|
142
142
|
dynamicContent: {
|
|
143
|
-
insert:
|
|
144
|
-
close:
|
|
143
|
+
insert: F,
|
|
144
|
+
close: I
|
|
145
145
|
},
|
|
146
146
|
hasChanges: m,
|
|
147
147
|
saveSilent: b,
|
|
148
|
-
setLoading:
|
|
149
|
-
}), { __sfc: !0, PreviewContainer: G, OnboardingWrapper: H, headerWrapperRef: S, wrapperRef: l, dynamicContentStore: u, unsubscribeStore: h, props: a, configStore:
|
|
148
|
+
setLoading: E
|
|
149
|
+
}), { __sfc: !0, PreviewContainer: G, OnboardingWrapper: H, AssignStrategyDrawer: $, headerWrapperRef: S, wrapperRef: l, dynamicContentStore: u, unsubscribeStore: h, props: a, configStore: o, editorStore: c, previewStore: z, hasChanges: m, isTestPartner: q, saveSilent: b, setLoading: E, emit: r, buildMetadata: p, initPlugin: w, preloadRuntime: D, getDefaultTemplate: C, cloneTimersOnSave: k, hasTimerBlocks: T, noHeader: K, insertDynamicContent: F, closeDynamicContent: I, handleDynamicContentOpen: f, ribbonObserver: i, updateRibbonOffset: y, startEditor: v, AutoSaveController: ae, Toaster: ie, FilterSelectionDrawer: ce, HeaderWrapper: de, LoadingWrapper: me, SaveAsTemplateDrawer: le, UnsubscribeWrapper: ue };
|
|
150
150
|
}
|
|
151
151
|
});
|
|
152
152
|
export {
|
|
153
|
-
|
|
153
|
+
qe as default
|
|
154
154
|
};
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useAutoSave as
|
|
3
|
-
import { useSave as
|
|
4
|
-
|
|
5
|
-
const v = /* @__PURE__ */ r({
|
|
1
|
+
import { defineComponent as t } from "vue";
|
|
2
|
+
import { useAutoSave as r } from "../../composables/useAutoSave.js";
|
|
3
|
+
import { useSave as s } from "../../composables/useSave.js";
|
|
4
|
+
const f = /* @__PURE__ */ t({
|
|
6
5
|
__name: "AutoSaveController",
|
|
7
|
-
setup(
|
|
8
|
-
const { save: e
|
|
9
|
-
return
|
|
6
|
+
setup(a) {
|
|
7
|
+
const { save: e } = s(), o = () => e(!1, !0);
|
|
8
|
+
return r(o), { __sfc: !0, save: e, backgroundSave: o };
|
|
10
9
|
}
|
|
11
10
|
});
|
|
12
11
|
export {
|
|
13
|
-
|
|
12
|
+
f as default
|
|
14
13
|
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import a from "./AssignStrategyDrawer.vue2.js";
|
|
2
|
+
/* empty css */
|
|
3
|
+
import r from "../../../../_virtual/_plugin-vue2_normalizer.js";
|
|
4
|
+
var n = function() {
|
|
5
|
+
var s = this, e = s._self._c, t = s._self._setupProxy;
|
|
6
|
+
return e(t.WpDrawer, { attrs: { id: "assign-strategy-drawer", "description-status": "", size: "medium", "description-text": t.drawerDescription, "footer-button-group-options": t.footerButtonGroupOptions, status: t.store.assignStrategyDrawerStatus, "title-text": t.trans("gpt-app-builder.assign-recommendation-strategy") }, on: { cancelOrBackButtonEvent: t.closeDrawer, onCloseEvent: t.closeDrawer, primaryButtonEvent: t.assignStrategy } }, [t.store.assignStrategyDrawerStatus ? e("div", { staticClass: "assign-strategy-drawer-content" }, [e(t.InSelect, { staticClass: "assign-strategy-select", attrs: { id: "assign-strategy-select", "search-status": "", "static-child-position": "bottom right", "button-status": !1, "dynamic-child-position": !1, "label-text": t.trans("ds-steps.recommendation-strategy"), options: t.strategyOptions, "placeholder-text": t.trans("ds-steps.select-strategy"), "skeleton-sizing": { width: 240, height: 42 }, "skeleton-status": t.store.strategiesLoading, value: t.selectValue }, on: { select: t.onSelect } }), t.selectedStrategy ? e("div", { key: String(t.selectedStrategy.strategy_id), staticClass: "assign-strategy-detail" }, [e(t.OrgStrategyDetailModal, { attrs: { show: "", "campaign-details-tab-status": t.campaignTabSupported, "footer-status": !1, strategy: t.selectedStrategy } })], 1) : s._e()], 1) : s._e()]);
|
|
7
|
+
}, o = [], i = /* @__PURE__ */ r(
|
|
8
|
+
a,
|
|
9
|
+
n,
|
|
10
|
+
o,
|
|
11
|
+
!1,
|
|
12
|
+
null,
|
|
13
|
+
"710137fe"
|
|
14
|
+
);
|
|
15
|
+
const p = i.exports;
|
|
16
|
+
export {
|
|
17
|
+
p as default
|
|
18
|
+
};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { defineComponent as v, ref as c, computed as o, watch as _ } from "vue";
|
|
2
|
+
import "@useinsider/design-system-organisms/style";
|
|
3
|
+
import w from "../../../wrappers/WpDrawer.vue.js";
|
|
4
|
+
import { useToaster as D } from "../../../../composables/useToaster.js";
|
|
5
|
+
import { useTranslations as T } from "../../../../composables/useTranslations.js";
|
|
6
|
+
import { ToasterTypeOptions as m } from "../../../../enums/toaster.js";
|
|
7
|
+
import { useRecommendationExtensionStore as b } from "../../../../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
8
|
+
import { OrgStrategyDetailModal as h } from "@useinsider/design-system-organisms";
|
|
9
|
+
import { InSelect as x } from "@useinsider/design-system-vue";
|
|
10
|
+
import B from "./StrategyInfoBox.vue.js";
|
|
11
|
+
const W = /* @__PURE__ */ v({
|
|
12
|
+
__name: "AssignStrategyDrawer",
|
|
13
|
+
setup(A) {
|
|
14
|
+
const g = "/discovery/recommendation-strategies", s = T(), e = b(), { showToaster: n } = D(), r = c(null), a = c(!1), u = c(!1), p = o(() => e.assignStrategyDrawerStatus ? s("email-editor.assign-strategy-description", { url: g }) : "");
|
|
15
|
+
_(() => e.assignStrategyDrawerStatus, (t) => {
|
|
16
|
+
if (!t)
|
|
17
|
+
return;
|
|
18
|
+
const { strategyId: l } = e.recommendationConfigs;
|
|
19
|
+
r.value = l || null, u.value = !!window.l10n, e.fetchStrategies().catch((S) => {
|
|
20
|
+
console.error("fetchStrategies error:", S), n({
|
|
21
|
+
type: m.Error,
|
|
22
|
+
message: s("discovery-strategy.error-description")
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
});
|
|
26
|
+
const d = o(() => e.strategies.map((t) => ({
|
|
27
|
+
text: t.name,
|
|
28
|
+
value: t.strategy_id,
|
|
29
|
+
infoBoxProps: {
|
|
30
|
+
id: `strategy-info-${t.strategy_id}`,
|
|
31
|
+
theme: "light",
|
|
32
|
+
variant: "information",
|
|
33
|
+
className: "assign-strategy-info-box",
|
|
34
|
+
slot: B,
|
|
35
|
+
slotProps: { strategy: t }
|
|
36
|
+
}
|
|
37
|
+
}))), y = o(() => [{ value: r.value }]), i = o(() => {
|
|
38
|
+
const t = e.strategies.find((l) => String(l.strategy_id) === String(r.value ?? ""));
|
|
39
|
+
return t ? { ...t, fallback_config: null } : null;
|
|
40
|
+
}), f = o(() => ({
|
|
41
|
+
primaryButton: {
|
|
42
|
+
styling: "solid",
|
|
43
|
+
type: "primary",
|
|
44
|
+
labelText: s("products.assign-btn"),
|
|
45
|
+
loadingStatus: a.value,
|
|
46
|
+
disabledStatus: !i.value
|
|
47
|
+
},
|
|
48
|
+
cancelOrBackButton: {
|
|
49
|
+
styling: "ghost",
|
|
50
|
+
type: "secondary",
|
|
51
|
+
labelText: s("products.cancel"),
|
|
52
|
+
disabledStatus: a.value
|
|
53
|
+
}
|
|
54
|
+
}));
|
|
55
|
+
return { __sfc: !0, RRS_PANEL_PATH: g, trans: s, store: e, showToaster: n, selectedStrategyId: r, isAssigning: a, campaignTabSupported: u, drawerDescription: p, strategyOptions: d, selectValue: y, selectedStrategy: i, footerButtonGroupOptions: f, closeDrawer: () => {
|
|
56
|
+
e.closeAssignStrategyDrawer();
|
|
57
|
+
}, assignStrategy: () => {
|
|
58
|
+
const t = i.value;
|
|
59
|
+
t && (a.value = !0, e.assignStrategy(t), n({
|
|
60
|
+
type: m.Success,
|
|
61
|
+
message: s("email-editor.strategy-assigned-success", { strategyName: t.name })
|
|
62
|
+
}), e.closeAssignStrategyDrawer(), a.value = !1);
|
|
63
|
+
}, onSelect: (t) => {
|
|
64
|
+
r.value = t.value;
|
|
65
|
+
}, WpDrawer: w, OrgStrategyDetailModal: h, InSelect: x };
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
export {
|
|
69
|
+
W as default
|
|
70
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import _ from "./StrategyInfoBox.vue2.js";
|
|
2
|
+
/* empty css */
|
|
3
|
+
import o from "../../../../_virtual/_plugin-vue2_normalizer.js";
|
|
4
|
+
var r = function() {
|
|
5
|
+
var t = this, s = t._self._c, a = t._self._setupProxy;
|
|
6
|
+
return s("div", { staticClass: "strategy-info-box" }, [s("div", { staticClass: "strategy-info-box__name" }, [t._v(" " + t._s(t.strategy.name) + " ")]), a.lastUpdated ? s("div", { staticClass: "strategy-info-box__updated" }, [t._v(" " + t._s(a.lastUpdated) + " ")]) : t._e(), s("div", { staticClass: "strategy-info-box__rows" }, t._l(a.rows, function(e) {
|
|
7
|
+
return s("div", { key: e.label, staticClass: "strategy-info-box__row" }, [s("div", { staticClass: "strategy-info-box__label" }, [t._v(" " + t._s(e.label) + " ")]), s("div", { staticClass: "strategy-info-box__value" }, [t._v(" " + t._s(e.value) + " ")])]);
|
|
8
|
+
}), 0)]);
|
|
9
|
+
}, i = [], n = /* @__PURE__ */ o(
|
|
10
|
+
_,
|
|
11
|
+
r,
|
|
12
|
+
i,
|
|
13
|
+
!1,
|
|
14
|
+
null,
|
|
15
|
+
"fe4491e6"
|
|
16
|
+
);
|
|
17
|
+
const d = n.exports;
|
|
18
|
+
export {
|
|
19
|
+
d as default
|
|
20
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { defineComponent as v, computed as s } from "vue";
|
|
2
|
+
import { useTranslations as h } from "../../../../composables/useTranslations.js";
|
|
3
|
+
import { formatShortDate as f } from "../../../../utils/dateUtil.js";
|
|
4
|
+
const A = /* @__PURE__ */ v({
|
|
5
|
+
__name: "StrategyInfoBox",
|
|
6
|
+
props: {
|
|
7
|
+
strategy: null
|
|
8
|
+
},
|
|
9
|
+
setup(g) {
|
|
10
|
+
const t = g, r = h(), n = (e) => e == null ? "" : String(e), y = s(() => {
|
|
11
|
+
const e = n(t.strategy.updated_at || t.strategy.created_at);
|
|
12
|
+
return e ? r("recommendation-strategy.last-updated-on", { value: f(e) }) : "";
|
|
13
|
+
}), c = s(() => {
|
|
14
|
+
const e = n(t.strategy.algorithm) === "MIXED" ? r("discovery-strategy.mixed-algorithm") : r("discovery-strategy.single-algorithm"), a = n(t.strategy.algorithm_used).split(",").map((o) => o.trim()).filter(Boolean).map((o) => r(`recommendation-algorithm-names.${o.replaceAll("_", "-").toLowerCase()}`));
|
|
15
|
+
return a.length ? `${e} · ${a.join(", ")}` : e;
|
|
16
|
+
}), u = s(() => [
|
|
17
|
+
[t.strategy.exclude_view, "discovery-strategy.exclude-recently-view-items"],
|
|
18
|
+
[t.strategy.exclude_purchase, "discovery-strategy.exclude-recently-purchased-items"],
|
|
19
|
+
[t.strategy.exclude_cart, "discovery-strategy.exclude-recently-added-cart-items"]
|
|
20
|
+
].filter(([a]) => Number(a) === 1).map(([, a]) => r(a)).join(", ")), d = s(() => n(
|
|
21
|
+
t.strategy.manual_merchandising || t.strategy.manual_merchandising_products
|
|
22
|
+
).trim()), i = s(() => {
|
|
23
|
+
const e = t.strategy.filters;
|
|
24
|
+
if (!e)
|
|
25
|
+
return 0;
|
|
26
|
+
try {
|
|
27
|
+
const a = typeof e == "string" ? JSON.parse(e) : e;
|
|
28
|
+
return Array.isArray(a) ? a.reduce((o, m) => o + (Array.isArray(m) ? m.length : 1), 0) : 0;
|
|
29
|
+
} catch {
|
|
30
|
+
return 0;
|
|
31
|
+
}
|
|
32
|
+
}), l = s(() => r("recommendation-strategy.none")), p = s(() => [
|
|
33
|
+
{
|
|
34
|
+
label: r("gpt-app-builder.algorithms-and-method"),
|
|
35
|
+
value: c.value
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
label: r("gpt-app-builder.exclusions"),
|
|
39
|
+
value: u.value || l.value
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
label: r("discovery-strategy.filters"),
|
|
43
|
+
value: i.value ? String(i.value) : l.value
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
label: r("action-builder.manual-merchandising"),
|
|
47
|
+
value: d.value || l.value
|
|
48
|
+
}
|
|
49
|
+
]);
|
|
50
|
+
return { __sfc: !0, props: t, trans: r, asText: n, lastUpdated: y, algorithmsAndMethod: c, exclusions: u, manualMerchandising: d, filterCount: i, none: l, rows: p };
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
export {
|
|
54
|
+
A as default
|
|
55
|
+
};
|
|
@@ -4,7 +4,7 @@ import d from "../../../_virtual/_plugin-vue2_normalizer.js";
|
|
|
4
4
|
var u = function() {
|
|
5
5
|
var s, i, n, a;
|
|
6
6
|
var o = this, e = o._self._c, t = o._self._setupProxy;
|
|
7
|
-
return e("div", { staticClass: "d-f editor-actions" }, [t.isVersionHistoryButtonVisible ? e(t.InButtonV2, { attrs: { id: "guido__history-button", "left-icon": "line-architect-version-history", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isVersionHistoryButtonDisabled, "label-text-status": !1, "selected-status": t.editorStore.isVersionHistoryOpen, "tooltip-options": t.getTooltipOptions("guido__history-button"), "tooltip-text": t.versionHistoryTooltipText }, on: { click: t.handleVersionHistory } }) : o._e(), e(t.InButtonV2, { attrs: { id: "guido__export-button", "left-icon": "line-export", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isExportButtonDisabled, "label-text-status": !1, "loading-status": t.isExporting, "tooltip-options": t.getTooltipOptions("guido__export-button"), "tooltip-text": t.trans("newsletter.export") }, on: { click: t.handleExport } }), (i = (s = t.config) == null ? void 0 : s.features) != null && i.saveAsTemplate ? e(t.InButtonV2, { attrs: { id: "guido__save-as-button", "left-icon": "line-newsletter-save-as-template", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isSaveAsButtonDisabled, "label-text-status": !1, "tooltip-options": t.getTooltipOptions("guido__save-as-button"), "tooltip-text": t.trans("newsletter.save-templates") }, on: { click: t.handleSaveAs } }) : o._e(), (a = (n = t.config) == null ? void 0 : n.features) != null && a.testMessage ? e(t.InButtonV2, { attrs: { id: "guido__test-button", "left-icon": "line-architect-test-journey", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isTestButtonDisabled, "label-text-status": !1, "tooltip-options": t.getTooltipOptions("guido__test-button", { staticPosition: "bottom right" }), "tooltip-text": t.trans("newsletter.test-email") }, on: { click: t.handleTestEmail } }) : o._e(), t.editorStore.isPreviewModeOpen ? o._e() : e(t.InButtonV2, { staticClass: "ml-3", attrs: { id: "guido__save-button", "disabled-status": !t.isSaving && t.editorStore.isSaveButtonDisabled, "
|
|
7
|
+
return e("div", { staticClass: "d-f editor-actions" }, [t.isVersionHistoryButtonVisible ? e(t.InButtonV2, { attrs: { id: "guido__history-button", "left-icon": "line-architect-version-history", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isVersionHistoryButtonDisabled, "label-text-status": !1, "selected-status": t.editorStore.isVersionHistoryOpen, "tooltip-options": t.getTooltipOptions("guido__history-button"), "tooltip-text": t.versionHistoryTooltipText }, on: { click: t.handleVersionHistory } }) : o._e(), e(t.InButtonV2, { attrs: { id: "guido__export-button", "left-icon": "line-export", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isExportButtonDisabled, "label-text-status": !1, "loading-status": t.isExporting, "tooltip-options": t.getTooltipOptions("guido__export-button"), "tooltip-text": t.trans("newsletter.export") }, on: { click: t.handleExport } }), (i = (s = t.config) == null ? void 0 : s.features) != null && i.saveAsTemplate ? e(t.InButtonV2, { attrs: { id: "guido__save-as-button", "left-icon": "line-newsletter-save-as-template", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isSaveAsButtonDisabled, "label-text-status": !1, "tooltip-options": t.getTooltipOptions("guido__save-as-button"), "tooltip-text": t.trans("newsletter.save-templates") }, on: { click: t.handleSaveAs } }) : o._e(), (a = (n = t.config) == null ? void 0 : n.features) != null && a.testMessage ? e(t.InButtonV2, { attrs: { id: "guido__test-button", "left-icon": "line-architect-test-journey", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isTestButtonDisabled, "label-text-status": !1, "tooltip-options": t.getTooltipOptions("guido__test-button", { staticPosition: "bottom right" }), "tooltip-text": t.trans("newsletter.test-email") }, on: { click: t.handleTestEmail } }) : o._e(), t.editorStore.isPreviewModeOpen ? o._e() : e(t.InButtonV2, { staticClass: "ml-3", attrs: { id: "guido__save-button", "label-text": "Save", "disabled-status": !t.isSaving && t.editorStore.isSaveButtonDisabled, "loading-status": t.isSaving }, on: { click: function(r) {
|
|
8
8
|
return t.handleSave(!1);
|
|
9
9
|
} } }), e(t.MigrationConfirmModal, { ref: "migrationModalRef", on: { confirm: function(r) {
|
|
10
10
|
return t.executeSave(!1);
|
|
@@ -15,7 +15,7 @@ var u = function() {
|
|
|
15
15
|
p,
|
|
16
16
|
!1,
|
|
17
17
|
null,
|
|
18
|
-
"
|
|
18
|
+
"6e711fd7"
|
|
19
19
|
);
|
|
20
20
|
const v = c.exports;
|
|
21
21
|
export {
|