@useinsider/guido 3.17.0 → 3.18.0-beta.41e529d
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 +6 -5
- package/dist/@types/config/schemas.js +10 -7
- package/dist/components/Guido.vue.js +10 -10
- package/dist/components/Guido.vue2.js +86 -78
- package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.js +21 -0
- package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue2.js +131 -0
- package/dist/components/organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue.js +18 -0
- package/dist/components/organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue2.js +25 -0
- package/dist/components/organisms/extensions/recommendation/RemoveStrategyModal.vue.js +17 -0
- package/dist/components/organisms/extensions/recommendation/RemoveStrategyModal.vue2.js +57 -0
- package/dist/components/organisms/extensions/recommendation/StrategyInfoBoxContent.vue.js +19 -0
- package/dist/components/organisms/extensions/recommendation/StrategyInfoBoxContent.vue2.js +63 -0
- package/dist/composables/useCustomInterfaceAppearance.js +56 -38
- package/dist/composables/useLegacyStrategyConversion.js +52 -0
- package/dist/composables/useModuleRepair.js +33 -0
- package/dist/composables/useRecommendation.js +41 -34
- package/dist/composables/useSave.js +30 -29
- package/dist/composables/useStripo.js +15 -15
- package/dist/composables/useSyncModuleExtractor.js +15 -13
- package/dist/composables/validators/useSyncModuleBlockValidator.js +24 -0
- package/dist/config/i18n/en/labels.json.js +1 -1
- package/dist/config/migrator/index.js +9 -8
- package/dist/config/migrator/recommendation/compositionMapper.js +20 -20
- package/dist/config/migrator/recommendation/extractors.js +29 -24
- package/dist/config/migrator/recommendation/htmlBuilder.js +116 -130
- package/dist/config/migrator/recommendation/settingsMapper.js +17 -17
- package/dist/config/migrator/recommendationMigrator.js +31 -25
- package/dist/config/migrator/recommendationTitleMigrator.js +119 -0
- package/dist/enums/academy.js +2 -1
- package/dist/enums/date.js +5 -3
- package/dist/enums/extensions/recommendationBlock.js +4 -1
- package/dist/extensions/Blocks/Items/block.js +118 -49
- package/dist/extensions/Blocks/Items/constants/currency.js +25 -0
- package/dist/extensions/Blocks/Items/controls/price/currencyLocation.js +25 -24
- package/dist/extensions/Blocks/Items/controls/price/currencySymbol.js +12 -11
- package/dist/extensions/Blocks/Items/template.js +153 -152
- package/dist/extensions/Blocks/Items/utils/constants.js +4 -0
- package/dist/extensions/Blocks/Recommendation/block.js +35 -29
- package/dist/extensions/Blocks/Recommendation/constants/blockIds.js +1 -1
- package/dist/extensions/Blocks/Recommendation/constants/controlIds.js +1 -1
- package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +29 -27
- package/dist/extensions/Blocks/Recommendation/constants/selectors.js +35 -28
- package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +309 -236
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +242 -180
- package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +159 -0
- package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +1 -0
- package/dist/extensions/Blocks/Recommendation/controls/title/index.js +44 -0
- package/dist/extensions/Blocks/Recommendation/extension.js +31 -29
- package/dist/extensions/Blocks/Recommendation/services/configService.js +54 -36
- package/dist/extensions/Blocks/Recommendation/settingsPanel.js +23 -4
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +217 -80
- package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +3 -3
- package/dist/extensions/Blocks/Recommendation/templates/titleRows.js +33 -0
- package/dist/extensions/Blocks/Recommendation/templates/utils.js +85 -107
- package/dist/extensions/Blocks/Recommendation/utils/legacyStrategyMigration.js +58 -0
- package/dist/extensions/Blocks/Recommendation/utils/nodeConfigWriter.js +22 -0
- package/dist/extensions/Blocks/Recommendation/utils/recommendationBlockCount.js +10 -6
- package/dist/extensions/Blocks/common-control.js +22 -19
- package/dist/guido.css +1 -1
- package/dist/services/recommendationApi.js +81 -33
- package/dist/src/@types/config/schemas.d.ts +6 -0
- package/dist/src/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.d.ts +3 -0
- package/dist/src/components/organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue.d.ts +2 -0
- package/dist/src/components/organisms/extensions/recommendation/RemoveStrategyModal.vue.d.ts +2 -0
- package/dist/src/components/organisms/extensions/recommendation/StrategyInfoBoxContent.vue.d.ts +15 -0
- package/dist/src/composables/useConfig.d.ts +4 -0
- package/dist/src/composables/useLegacyStrategyConversion.d.ts +3 -0
- package/dist/src/composables/useModuleRepair.d.ts +18 -0
- package/dist/src/composables/useRecommendation.d.ts +1 -0
- package/dist/src/composables/useSyncModuleExtractor.d.ts +2 -0
- package/dist/src/composables/validators/useSyncModuleBlockValidator.d.ts +3 -0
- package/dist/src/config/migrator/recommendation/extractors.d.ts +8 -0
- package/dist/src/config/migrator/recommendationTitleMigrator.d.ts +5 -0
- package/dist/src/enums/academy.d.ts +1 -0
- package/dist/src/enums/date.d.ts +1 -0
- package/dist/src/enums/extensions/recommendationBlock.d.ts +3 -0
- package/dist/src/extensions/Blocks/Items/block.d.ts +35 -0
- package/dist/src/extensions/Blocks/Items/constants/currency.d.ts +43 -0
- package/dist/src/extensions/Blocks/Items/utils/constants.d.ts +6 -0
- package/dist/src/extensions/Blocks/Recommendation/constants/blockIds.d.ts +2 -1
- package/dist/src/extensions/Blocks/Recommendation/constants/controlIds.d.ts +7 -0
- package/dist/src/extensions/Blocks/Recommendation/constants/defaultConfig.d.ts +3 -6
- package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +2 -2
- package/dist/src/extensions/Blocks/Recommendation/constants/selectors.d.ts +12 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/cardComposition/index.d.ts +11 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/index.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +44 -8
- package/dist/src/extensions/Blocks/Recommendation/controls/main/strategy.d.ts +17 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/title/index.d.ts +86 -0
- package/dist/src/extensions/Blocks/Recommendation/services/configService.d.ts +12 -1
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +229 -10
- package/dist/src/extensions/Blocks/Recommendation/templates/titleRows.d.ts +13 -0
- package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +7 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/legacyStrategyMigration.d.ts +39 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/nodeConfigWriter.d.ts +31 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/recommendationBlockCount.d.ts +6 -2
- package/dist/src/extensions/Blocks/common-control.d.ts +4 -1
- package/dist/src/mock/api/recommendation-strategies.d.ts +2 -0
- package/dist/src/services/recommendationApi.d.ts +5 -1
- package/dist/src/stores/config.d.ts +178 -0
- package/dist/src/stores/save-as-template.d.ts +4 -3
- package/dist/src/utils/genericUtil.d.ts +5 -0
- package/dist/src/utils/itemsCurrencyRepair.d.ts +17 -0
- package/dist/static/assets/icons/filled-arrow-rising.svg.js +5 -0
- package/dist/static/assets/icons/line-change.svg.js +5 -0
- package/dist/static/assets/icons/line-delete.svg.js +5 -0
- package/dist/static/assets/icons/line-info.svg.js +5 -0
- package/dist/static/assets/icons/line-plus.svg.js +5 -0
- package/dist/static/styles/components/recommendation-strategy.css.js +220 -0
- package/dist/static/styles/customEditorStyle.css.js +3 -1
- package/dist/stores/config.js +66 -59
- package/dist/utils/dateUtil.js +23 -10
- package/dist/utils/genericUtil.js +28 -27
- package/dist/utils/itemsCurrencyRepair.js +39 -0
- package/dist/utils/pairProductVariables.js +58 -58
- package/dist/utils/templatePreparation.js +35 -34
- package/package.json +3 -2
- package/dist/composables/useModuleDynamicContentRepair.js +0 -37
- package/dist/src/composables/useModuleDynamicContentRepair.d.ts +0 -13
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
|
|
@@ -633,16 +634,16 @@ toaster fires (useful before the host has wired the catalog).
|
|
|
633
634
|
|
|
634
635
|
```bash
|
|
635
636
|
# Install
|
|
636
|
-
|
|
637
|
+
npm install
|
|
637
638
|
|
|
638
639
|
# Start dev server
|
|
639
|
-
|
|
640
|
+
npm start
|
|
640
641
|
|
|
641
642
|
# Build
|
|
642
|
-
|
|
643
|
+
npm run build
|
|
643
644
|
|
|
644
645
|
# Lint & type-check
|
|
645
|
-
|
|
646
|
+
npm run lint
|
|
646
647
|
```
|
|
647
648
|
|
|
648
649
|
### Environment Variables
|
|
@@ -660,7 +661,7 @@ VITE_STRIPO_USER=your_user
|
|
|
660
661
|
|
|
661
662
|
```bash
|
|
662
663
|
# Build the package
|
|
663
|
-
|
|
664
|
+
npm run build
|
|
664
665
|
|
|
665
666
|
# Create tarball
|
|
666
667
|
npm pack
|
|
@@ -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,
|
|
@@ -24,7 +24,9 @@ const p = {
|
|
|
24
24
|
b(1, "userId is required")
|
|
25
25
|
),
|
|
26
26
|
/** Optional variation ID for A/B testing */
|
|
27
|
-
variationId: e(t())
|
|
27
|
+
variationId: e(t()),
|
|
28
|
+
/** Optional numeric campaign ID of the host campaign; absent for templates and modules */
|
|
29
|
+
campaignId: e(t())
|
|
28
30
|
}), L = a({
|
|
29
31
|
/** Fallback font name (e.g., "Georgia") */
|
|
30
32
|
name: t(),
|
|
@@ -76,7 +78,7 @@ const p = {
|
|
|
76
78
|
children: e(c(S)),
|
|
77
79
|
// eslint-disable-next-line camelcase -- backend field name
|
|
78
80
|
select_items: e(c(S))
|
|
79
|
-
})), N =
|
|
81
|
+
})), N = k(
|
|
80
82
|
t(),
|
|
81
83
|
R(c(S), [])
|
|
82
84
|
), P = g({
|
|
@@ -132,7 +134,7 @@ const p = {
|
|
|
132
134
|
* strategy, currency, locale, and layout data.
|
|
133
135
|
*/
|
|
134
136
|
recommendationConfigs: e(
|
|
135
|
-
|
|
137
|
+
k(t(), P),
|
|
136
138
|
{}
|
|
137
139
|
)
|
|
138
140
|
}), x = a({
|
|
@@ -219,7 +221,8 @@ const p = {
|
|
|
219
221
|
/** Enable pre-save domain-allowlist validation (opt-in; Guido self-serves the block toaster) */
|
|
220
222
|
allowlistEnabled: e(o(), !1),
|
|
221
223
|
/** Enable persistent link tracking-id assignment for the click heatmap (opt-in) */
|
|
222
|
-
linkTrackingIds: e(o(), !1)
|
|
224
|
+
linkTrackingIds: e(o(), !1),
|
|
225
|
+
reusableRecommendationStrategy: e(o(), !1)
|
|
223
226
|
}), B = i([
|
|
224
227
|
"amp-accordion",
|
|
225
228
|
"amp-carousel",
|
|
@@ -287,7 +290,7 @@ const p = {
|
|
|
287
290
|
...d.entries,
|
|
288
291
|
type: u("custom"),
|
|
289
292
|
/** Custom processor function */
|
|
290
|
-
processor:
|
|
293
|
+
processor: y(
|
|
291
294
|
(s) => typeof s == "function",
|
|
292
295
|
"processor must be a function"
|
|
293
296
|
)
|
|
@@ -307,7 +310,7 @@ const p = {
|
|
|
307
310
|
* Return false to cancel the save operation.
|
|
308
311
|
*/
|
|
309
312
|
externalValidation: e(
|
|
310
|
-
|
|
313
|
+
y(
|
|
311
314
|
(s) => typeof s == "function",
|
|
312
315
|
"externalValidation must be a function"
|
|
313
316
|
)
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import
|
|
1
|
+
import o from "./Guido.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
|
-
import
|
|
3
|
+
import i from "../_virtual/_plugin-vue2_normalizer.js";
|
|
4
4
|
var t = function() {
|
|
5
|
-
var
|
|
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) :
|
|
5
|
+
var a = this, r = a._self._c, e = a._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) : a._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.isRrsEnabled || e.hasAssignedStrategy ? r(e.AssignStrategyDrawer) : a._e(), e.isRrsEnabled || e.hasAssignedStrategy ? r(e.RemoveStrategyModal) : a._e(), e.isRrsEnabled ? r(e.LegacyStrategyUpdatedModal) : a._e(), r(e.SaveAsTemplateDrawer), e.isTestPartner() ? a._e() : r(e.OnboardingWrapper, { on: { "onboarding-finished": function(_) {
|
|
7
7
|
return e.emit("onboarding:finished");
|
|
8
8
|
} } }), r(e.UnsubscribeWrapper), r(e.LoadingWrapper)], 1);
|
|
9
|
-
},
|
|
10
|
-
|
|
9
|
+
}, s = [], n = /* @__PURE__ */ i(
|
|
10
|
+
o,
|
|
11
11
|
t,
|
|
12
|
-
|
|
12
|
+
s,
|
|
13
13
|
!1,
|
|
14
14
|
null,
|
|
15
|
-
"
|
|
15
|
+
"d1f80922"
|
|
16
16
|
);
|
|
17
|
-
const
|
|
17
|
+
const f = n.exports;
|
|
18
18
|
export {
|
|
19
|
-
|
|
19
|
+
f as default
|
|
20
20
|
};
|
|
@@ -1,65 +1,73 @@
|
|
|
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
|
|
10
|
-
import { RIBBON_SELECTOR as
|
|
11
|
-
import { useRecommendationExtensionStore as
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import { useStripoApi as
|
|
20
|
-
import { useConfigStore as
|
|
21
|
-
import { useDynamicContentStore as
|
|
1
|
+
import { defineComponent as ee, defineAsyncComponent as m, ref as U, computed as u, watch as A, onMounted as te, onUnmounted as oe } from "vue";
|
|
2
|
+
import { useCortexBlueprintBridge as ne } from "../composables/useCortexBlueprintBridge.js";
|
|
3
|
+
import { provideGuidoActions as re } from "../composables/useGuidoActions.js";
|
|
4
|
+
import { useGuidoStateBridge as se } from "../composables/useGuidoStateBridge.js";
|
|
5
|
+
import { usePartner as ae } from "../composables/usePartner.js";
|
|
6
|
+
import { useStripo as ie } from "../composables/useStripo.js";
|
|
7
|
+
import { useTimerClone as ce } from "../composables/useTimerClone.js";
|
|
8
|
+
import { migrate as _ } from "../config/migrator/index.js";
|
|
9
|
+
import { ModuleFolderDefaults as N } from "../enums/defaults.js";
|
|
10
|
+
import { RIBBON_SELECTOR as de } from "../enums/onboarding.js";
|
|
11
|
+
import { useRecommendationExtensionStore as O } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
12
|
+
import me from "./organisms/AutoSaveController.vue.js";
|
|
13
|
+
import le from "./organisms/base/Toaster.vue.js";
|
|
14
|
+
import ue from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
|
|
15
|
+
import pe from "./organisms/header/HeaderWrapper.vue.js";
|
|
16
|
+
import fe from "./organisms/LoadingWrapper.vue.js";
|
|
17
|
+
import ye from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
|
|
18
|
+
import ge from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
|
|
19
|
+
import { useStripoApi as ve } from "../services/stripoApi.js";
|
|
20
|
+
import { useConfigStore as Se } from "../stores/config.js";
|
|
21
|
+
import { useDynamicContentStore as he } from "../stores/dynamic-content.js";
|
|
22
22
|
import { useEditorStore as P } from "../stores/editor.js";
|
|
23
|
-
import { usePreviewStore as
|
|
24
|
-
import { useTemplateStore as
|
|
25
|
-
import { useUnsubscribeStore as
|
|
26
|
-
import { readTrackFloor as
|
|
27
|
-
const
|
|
23
|
+
import { usePreviewStore as be } from "../stores/preview.js";
|
|
24
|
+
import { useTemplateStore as Ee } from "../stores/template.js";
|
|
25
|
+
import { useUnsubscribeStore as we } from "../stores/unsubscribe.js";
|
|
26
|
+
import { readTrackFloor as W } from "../utils/linkTrackingIds.js";
|
|
27
|
+
const Je = /* @__PURE__ */ ee({
|
|
28
28
|
__name: "Guido",
|
|
29
29
|
props: {
|
|
30
30
|
config: null,
|
|
31
31
|
ready: { type: Boolean, default: !0 }
|
|
32
32
|
},
|
|
33
33
|
emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change", "ready", "onboarding:finished", "test-email:click"],
|
|
34
|
-
setup(
|
|
35
|
-
const a =
|
|
34
|
+
setup(x, { expose: G, emit: r }) {
|
|
35
|
+
const a = x, H = m(
|
|
36
36
|
() => import("./organisms/email-preview/PreviewContainer.vue.js")
|
|
37
|
-
),
|
|
37
|
+
), $ = m(
|
|
38
38
|
() => import("./organisms/onboarding/OnboardingWrapper.vue.js")
|
|
39
|
-
),
|
|
39
|
+
), z = m(
|
|
40
|
+
() => import("./organisms/extensions/recommendation/AssignStrategyDrawer.vue.js")
|
|
41
|
+
), q = m(
|
|
42
|
+
() => import("./organisms/extensions/recommendation/RemoveStrategyModal.vue.js")
|
|
43
|
+
), K = m(
|
|
44
|
+
() => import("./organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue.js")
|
|
45
|
+
), h = U(), p = U(), f = he(), b = we(), o = Se();
|
|
40
46
|
a.ready && o.init(a.config);
|
|
41
|
-
const c = P(),
|
|
47
|
+
const c = P(), V = be(), l = u(() => c.hasChanges), { isTestPartner: j } = ae(), E = () => {
|
|
42
48
|
var t;
|
|
43
49
|
return (t = h.value) == null ? void 0 : t.handleSave(!0);
|
|
44
|
-
},
|
|
50
|
+
}, w = (t) => {
|
|
45
51
|
c.loadingStatus = t;
|
|
46
52
|
};
|
|
47
|
-
|
|
48
|
-
const
|
|
53
|
+
ne(), se();
|
|
54
|
+
const y = () => {
|
|
49
55
|
var t, e;
|
|
50
56
|
return {
|
|
51
57
|
emailId: o.templateId,
|
|
52
58
|
userId: o.userId,
|
|
53
59
|
username: o.username,
|
|
54
60
|
partnerName: o.partnerName,
|
|
55
|
-
savedModulesFolderName: ((t = o.editor) == null ? void 0 : t.savedModulesFolderName) ||
|
|
56
|
-
defaultModulesFolderName: ((e = o.editor) == null ? void 0 : e.defaultModulesFolderName) ||
|
|
61
|
+
savedModulesFolderName: ((t = o.editor) == null ? void 0 : t.savedModulesFolderName) || N.SAVED_MODULES,
|
|
62
|
+
defaultModulesFolderName: ((e = o.editor) == null ? void 0 : e.defaultModulesFolderName) || N.DEFAULT_MODULES
|
|
57
63
|
};
|
|
58
|
-
}, { initPlugin:
|
|
64
|
+
}, { initPlugin: C, preloadRuntime: D } = ie(), { getDefaultTemplate: k } = ve(), { cloneTimersOnSave: T, hasTimerBlocks: F } = ce(), J = u(() => {
|
|
59
65
|
var t;
|
|
60
66
|
return !((t = o.ui) != null && t.showHeader);
|
|
61
|
-
})
|
|
62
|
-
|
|
67
|
+
}), Q = u(() => o.isFeatureEnabled("reusableRecommendationStrategy")), X = u(
|
|
68
|
+
() => !!O().recommendationConfigs.strategyId
|
|
69
|
+
);
|
|
70
|
+
re({
|
|
63
71
|
onBack: () => {
|
|
64
72
|
console.debug("guido:back"), r("back");
|
|
65
73
|
},
|
|
@@ -67,86 +75,86 @@ const ze = /* @__PURE__ */ j({
|
|
|
67
75
|
console.debug("guido:save:start"), r("save:start");
|
|
68
76
|
},
|
|
69
77
|
onSaveComplete: (t) => {
|
|
70
|
-
const e = { ...t, metadata:
|
|
78
|
+
const e = { ...t, metadata: y() };
|
|
71
79
|
console.debug("guido:save:complete", e), r("save:complete", e);
|
|
72
80
|
},
|
|
73
81
|
onTestEmailClick: () => {
|
|
74
82
|
console.debug("guido:test-email:click"), r("test-email:click");
|
|
75
83
|
}
|
|
76
84
|
});
|
|
77
|
-
const
|
|
78
|
-
console.debug("dynamic-content:close", t),
|
|
79
|
-
},
|
|
85
|
+
const I = (t) => {
|
|
86
|
+
console.debug("dynamic-content:close", t), f.setSelectedDynamicContent(t), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: t }));
|
|
87
|
+
}, R = () => {
|
|
80
88
|
console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
|
|
81
89
|
};
|
|
82
|
-
|
|
83
|
-
r("on-change",
|
|
90
|
+
A(() => l.value, () => {
|
|
91
|
+
r("on-change", l.value);
|
|
84
92
|
});
|
|
85
|
-
const
|
|
93
|
+
const g = (t) => {
|
|
86
94
|
const e = t, { attribute: s, position: d } = e.detail;
|
|
87
95
|
console.debug("dynamic-content:open", e.detail), r("dynamic-content:open", s, d);
|
|
88
96
|
};
|
|
89
97
|
let i = null;
|
|
90
|
-
const
|
|
98
|
+
const v = () => {
|
|
91
99
|
var e;
|
|
92
|
-
const t = document.querySelector(
|
|
93
|
-
(e =
|
|
94
|
-
},
|
|
100
|
+
const t = document.querySelector(de);
|
|
101
|
+
(e = p.value) == null || e.style.setProperty("--ribbon-offset", `${(t == null ? void 0 : t.offsetHeight) ?? 0}px`);
|
|
102
|
+
}, S = async () => {
|
|
95
103
|
var t;
|
|
96
104
|
try {
|
|
97
105
|
o.initialized || o.init(a.config), c.templateId = o.templateId;
|
|
98
|
-
const e = o.template, s = (e == null ? void 0 : e.html) || "", d = (e == null ? void 0 : e.css) || "",
|
|
99
|
-
|
|
100
|
-
const
|
|
106
|
+
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) || [];
|
|
107
|
+
b.selectedUnsubscribePages = (e == null ? void 0 : e.selectedUnsubscribePages) || [];
|
|
108
|
+
const M = ((t = e == null ? void 0 : e.migration) == null ? void 0 : t.recommendationConfigs) ?? {}, B = o.isFeatureEnabled("linkTrackingIds");
|
|
101
109
|
let n = {
|
|
102
|
-
html: s && await
|
|
110
|
+
html: s && await _(s, M),
|
|
103
111
|
css: d
|
|
104
112
|
};
|
|
105
|
-
n.html || (n = await
|
|
106
|
-
const
|
|
107
|
-
|
|
108
|
-
const
|
|
109
|
-
preselectedDynamicContentList:
|
|
113
|
+
n.html || (n = await k(), n.html = await _(n.html, M));
|
|
114
|
+
const Y = B ? W(n.html, (e == null ? void 0 : e.trackIdCounter) || 0) : 0;
|
|
115
|
+
F(n.html) && (n.html = await T(n.html)), B && (c.trackIdSessionFloor = Math.max(Y, W(n.html)));
|
|
116
|
+
const Z = {
|
|
117
|
+
preselectedDynamicContentList: L,
|
|
110
118
|
onReady: () => {
|
|
111
119
|
console.debug("guido:ready"), r("ready");
|
|
112
120
|
}
|
|
113
121
|
};
|
|
114
|
-
await
|
|
122
|
+
await C(n, y(), Z), f.selectedDynamicContentList = L;
|
|
115
123
|
} catch (e) {
|
|
116
124
|
console.error("Failed to initialize Stripo editor:", e);
|
|
117
125
|
}
|
|
118
126
|
};
|
|
119
|
-
return
|
|
127
|
+
return te(async () => {
|
|
120
128
|
var e;
|
|
121
|
-
console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"),
|
|
122
|
-
const t = (e =
|
|
123
|
-
if (t && (i = new ResizeObserver(
|
|
124
|
-
await
|
|
129
|
+
console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), O().$reset(), P().$reset(), Ee().$reset(), v();
|
|
130
|
+
const t = (e = p.value) == null ? void 0 : e.parentElement;
|
|
131
|
+
if (t && (i = new ResizeObserver(v), i.observe(t)), D(), a.ready)
|
|
132
|
+
await S();
|
|
125
133
|
else {
|
|
126
|
-
const s =
|
|
127
|
-
d && (s(),
|
|
134
|
+
const s = A(() => a.ready, (d) => {
|
|
135
|
+
d && (s(), S());
|
|
128
136
|
});
|
|
129
137
|
}
|
|
130
|
-
document.addEventListener("dynamic-content:open",
|
|
131
|
-
}),
|
|
132
|
-
i == null || i.disconnect(), document.removeEventListener("dynamic-content:open",
|
|
138
|
+
document.addEventListener("dynamic-content:open", g);
|
|
139
|
+
}), oe(() => {
|
|
140
|
+
i == null || i.disconnect(), document.removeEventListener("dynamic-content:open", g);
|
|
133
141
|
try {
|
|
134
142
|
window.UIEditor.removeEditor();
|
|
135
143
|
} catch {
|
|
136
144
|
console.debug("Failed to remove Stripo editor: No editor found");
|
|
137
145
|
}
|
|
138
146
|
o.reset();
|
|
139
|
-
}),
|
|
147
|
+
}), G({
|
|
140
148
|
dynamicContent: {
|
|
141
|
-
insert:
|
|
142
|
-
close:
|
|
149
|
+
insert: I,
|
|
150
|
+
close: R
|
|
143
151
|
},
|
|
144
|
-
hasChanges:
|
|
145
|
-
saveSilent:
|
|
146
|
-
setLoading:
|
|
147
|
-
}), { __sfc: !0, PreviewContainer:
|
|
152
|
+
hasChanges: l,
|
|
153
|
+
saveSilent: E,
|
|
154
|
+
setLoading: w
|
|
155
|
+
}), { __sfc: !0, PreviewContainer: H, OnboardingWrapper: $, AssignStrategyDrawer: z, RemoveStrategyModal: q, LegacyStrategyUpdatedModal: K, headerWrapperRef: h, wrapperRef: p, dynamicContentStore: f, unsubscribeStore: b, props: a, configStore: o, editorStore: c, previewStore: V, hasChanges: l, isTestPartner: j, saveSilent: E, setLoading: w, emit: r, buildMetadata: y, initPlugin: C, preloadRuntime: D, getDefaultTemplate: k, cloneTimersOnSave: T, hasTimerBlocks: F, noHeader: J, isRrsEnabled: Q, hasAssignedStrategy: X, insertDynamicContent: I, closeDynamicContent: R, handleDynamicContentOpen: g, ribbonObserver: i, updateRibbonOffset: v, startEditor: S, AutoSaveController: me, Toaster: le, FilterSelectionDrawer: ue, HeaderWrapper: pe, LoadingWrapper: fe, SaveAsTemplateDrawer: ye, UnsubscribeWrapper: ge };
|
|
148
156
|
}
|
|
149
157
|
});
|
|
150
158
|
export {
|
|
151
|
-
|
|
159
|
+
Je as default
|
|
152
160
|
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import r from "./AssignStrategyDrawer.vue2.js";
|
|
2
|
+
/* empty css */
|
|
3
|
+
/* empty css */
|
|
4
|
+
import o from "../../../../_virtual/_plugin-vue2_normalizer.js";
|
|
5
|
+
var a = function() {
|
|
6
|
+
var e = this, s = e._self._c, t = e._self._setupProxy;
|
|
7
|
+
return t.store.assignStrategyDrawerStatus ? s(t.OrgStrategyDetailModal, { staticClass: "assign-strategy-drawer", attrs: { "description-status": "", show: "", "description-text": t.drawerDescription, "footer-button-group-options": t.footerButtonGroupOptions, strategy: t.selectedStrategy ?? {}, "title-text": t.trans("gpt-app-builder.assign-recommendation-strategy") }, on: { close: t.closeDrawer, primaryClick: t.assignStrategy }, scopedSlots: e._u([{ key: "contentTop", fn: function() {
|
|
8
|
+
return [s("div", { staticClass: "assign-strategy-drawer-content px-5 py-5" }, [s(t.OrgStrategyDropdown, { staticClass: "assign-strategy-select", attrs: { id: "assign-strategy-select", "info-box-position": "bottom right", "create-button-visible": !1, loading: t.store.strategiesLoading || t.store.legacyConversionLoading, "placeholder-text": t.trans("smart-recommender.select-recommendation-strategy"), "selected-strategy-id": t.selectedStrategyId, state: t.showSelectionError ? "error" : "default", "state-message": t.showSelectionError ? t.trans("ds-steps.select-strategy-tooltip") : "", strategies: t.strategyOptions }, on: { infoBoxButtonClick: t.onInfoBoxButtonClick, select: t.onSelect } })], 1)];
|
|
9
|
+
}, proxy: !0 }], null, !1, 239334473) }) : e._e();
|
|
10
|
+
}, n = [], i = /* @__PURE__ */ o(
|
|
11
|
+
r,
|
|
12
|
+
a,
|
|
13
|
+
n,
|
|
14
|
+
!1,
|
|
15
|
+
null,
|
|
16
|
+
"4019dc4d"
|
|
17
|
+
);
|
|
18
|
+
const y = i.exports;
|
|
19
|
+
export {
|
|
20
|
+
y as default
|
|
21
|
+
};
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { defineComponent as h, defineAsyncComponent as T, ref as _, computed as s, watch as B } from "vue";
|
|
2
|
+
import "@useinsider/design-system-organisms/style";
|
|
3
|
+
import { useLegacyStrategyConversion as I } from "../../../../composables/useLegacyStrategyConversion.js";
|
|
4
|
+
import { useToaster as N } from "../../../../composables/useToaster.js";
|
|
5
|
+
import { useTranslations as k } from "../../../../composables/useTranslations.js";
|
|
6
|
+
import { DOTTED_DATE_LOCALE as P } from "../../../../enums/date.js";
|
|
7
|
+
import { URLS as U } from "../../../../enums/extensions/recommendationBlock.js";
|
|
8
|
+
import { ToasterTypeOptions as p } from "../../../../enums/toaster.js";
|
|
9
|
+
import { useRecommendationExtensionStore as b } from "../../../../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
10
|
+
import G from "./StrategyInfoBoxContent.vue.js";
|
|
11
|
+
import { formatShortDate as M } from "../../../../utils/dateUtil.js";
|
|
12
|
+
import { asText as D } from "../../../../utils/genericUtil.js";
|
|
13
|
+
import { escapeHtml as x } from "../../../../utils/htmlEscape.js";
|
|
14
|
+
import { InSkeleton as R } from "@useinsider/design-system-vue";
|
|
15
|
+
const st = /* @__PURE__ */ h({
|
|
16
|
+
__name: "AssignStrategyDrawer",
|
|
17
|
+
setup(H) {
|
|
18
|
+
const l = () => import("@useinsider/design-system-organisms"), g = (t, a) => ({
|
|
19
|
+
render: (n) => n(R, { props: { sizing: { width: t, height: a } } })
|
|
20
|
+
}), O = T({
|
|
21
|
+
loader: async () => (await l()).OrgStrategyDetailModal,
|
|
22
|
+
loadingComponent: g(480, 240),
|
|
23
|
+
delay: 0
|
|
24
|
+
}), w = T({
|
|
25
|
+
loader: async () => (await l()).OrgStrategyDropdown,
|
|
26
|
+
loadingComponent: g(240, 42),
|
|
27
|
+
delay: 0
|
|
28
|
+
}), r = k(), e = b(), { showToaster: i } = N(), { convertLegacyStrategy: u } = I(), o = _(null), y = "legacy", d = "guido__btn-update-legacy-strategy", c = _(!1), A = s(() => e.assignStrategyDrawerStatus ? r("email-editor.assign-strategy-description", { url: U.RECOMMENDATION_STRATEGIES_PANEL_PATH }) : "");
|
|
29
|
+
B(() => e.assignStrategyDrawerStatus, (t) => {
|
|
30
|
+
if (!t)
|
|
31
|
+
return;
|
|
32
|
+
const { strategyId: a } = e.recommendationConfigs;
|
|
33
|
+
o.value = a || (e.isLegacyStrategyBlock ? y : null), c.value = !1, e.fetchStrategies().catch(() => {
|
|
34
|
+
i({
|
|
35
|
+
type: p.Error,
|
|
36
|
+
message: r("discovery-strategy.error-description")
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
const f = (t) => {
|
|
41
|
+
const a = D(t.updated_at || t.created_at);
|
|
42
|
+
if (!a)
|
|
43
|
+
return "";
|
|
44
|
+
const n = M(a, P);
|
|
45
|
+
return r("recommendation-strategy.last-updated-on", { value: n });
|
|
46
|
+
}, S = s(() => ({
|
|
47
|
+
text: r("ds-steps.legacy-strategy"),
|
|
48
|
+
value: y,
|
|
49
|
+
infoBoxProps: {
|
|
50
|
+
id: "strategy-info-legacy",
|
|
51
|
+
theme: "light",
|
|
52
|
+
variant: "information",
|
|
53
|
+
className: "assign-strategy-info-box",
|
|
54
|
+
titleText: x(r("ds-steps.legacy-strategy")),
|
|
55
|
+
descriptionStatus: !0,
|
|
56
|
+
descriptionText: r("statistics.legacy-strategy-description"),
|
|
57
|
+
buttonOptions: [{
|
|
58
|
+
id: d,
|
|
59
|
+
type: "primary",
|
|
60
|
+
text: r("ds-steps.update"),
|
|
61
|
+
loadingStatus: e.legacyConversionLoading,
|
|
62
|
+
disabledStatus: e.legacyConversionLoading
|
|
63
|
+
}]
|
|
64
|
+
}
|
|
65
|
+
})), E = async (t) => {
|
|
66
|
+
if ((t == null ? void 0 : t.id) !== d)
|
|
67
|
+
return;
|
|
68
|
+
const a = await u();
|
|
69
|
+
a && (o.value = a);
|
|
70
|
+
}, m = s(() => e.strategies.map((t) => ({
|
|
71
|
+
text: t.name,
|
|
72
|
+
value: t.strategy_id,
|
|
73
|
+
infoBoxProps: {
|
|
74
|
+
id: `strategy-info-${t.strategy_id}`,
|
|
75
|
+
theme: "light",
|
|
76
|
+
variant: "information",
|
|
77
|
+
className: "assign-strategy-info-box",
|
|
78
|
+
titleText: x(D(t.name)),
|
|
79
|
+
descriptionStatus: !0,
|
|
80
|
+
descriptionText: f(t),
|
|
81
|
+
slot: G,
|
|
82
|
+
slotProps: { strategy: t }
|
|
83
|
+
}
|
|
84
|
+
}))), C = s(() => e.isLegacyStrategyBlock ? [S.value, ...m.value] : m.value), v = s(() => {
|
|
85
|
+
const t = e.strategies.find((a) => String(a.strategy_id) === String(o.value ?? ""));
|
|
86
|
+
return t ? { ...t, fallback_config: null } : null;
|
|
87
|
+
}), L = s(() => ({
|
|
88
|
+
primaryButton: {
|
|
89
|
+
styling: "solid",
|
|
90
|
+
type: "primary",
|
|
91
|
+
labelText: r("products.assign-btn")
|
|
92
|
+
},
|
|
93
|
+
cancelOrBackButton: {
|
|
94
|
+
styling: "ghost",
|
|
95
|
+
type: "secondary",
|
|
96
|
+
labelText: r("products.cancel")
|
|
97
|
+
}
|
|
98
|
+
}));
|
|
99
|
+
return { __sfc: !0, loadOrganisms: l, skeleton: g, OrgStrategyDetailModal: O, OrgStrategyDropdown: w, trans: r, store: e, showToaster: i, convertLegacyStrategy: u, selectedStrategyId: o, LEGACY_OPTION_VALUE: y, LEGACY_UPDATE_BUTTON_ID: d, showSelectionError: c, drawerDescription: A, lastUpdatedText: f, legacyStrategyOption: S, onInfoBoxButtonClick: E, remoteStrategyOptions: m, strategyOptions: C, selectedStrategy: v, footerButtonGroupOptions: L, closeDrawer: () => {
|
|
100
|
+
e.closeAssignStrategyDrawer();
|
|
101
|
+
}, assignStrategy: async () => {
|
|
102
|
+
const t = v.value;
|
|
103
|
+
if (!t) {
|
|
104
|
+
c.value = !0;
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
let a = "";
|
|
108
|
+
try {
|
|
109
|
+
a = await e.resolveStrategyUrlTemplate(t, e.recommendationConfigs.currencySettings.value);
|
|
110
|
+
} catch (n) {
|
|
111
|
+
console.error("[AssignStrategyDrawer] resolveStrategyUrlTemplate failed", n);
|
|
112
|
+
}
|
|
113
|
+
if (!a) {
|
|
114
|
+
i({
|
|
115
|
+
type: p.Error,
|
|
116
|
+
message: r("email-editor.strategy-assign-failed", { strategyName: t.name })
|
|
117
|
+
});
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
e.assignStrategy(t), i({
|
|
121
|
+
type: p.Success,
|
|
122
|
+
message: r("email-editor.strategy-assigned-success", { strategyName: t.name })
|
|
123
|
+
}), e.closeAssignStrategyDrawer();
|
|
124
|
+
}, onSelect: (t) => {
|
|
125
|
+
o.value = t.value, c.value = !1;
|
|
126
|
+
} };
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
export {
|
|
130
|
+
st as default
|
|
131
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import s from "./LegacyStrategyUpdatedModal.vue2.js";
|
|
2
|
+
/* empty css */
|
|
3
|
+
import o from "../../../../_virtual/_plugin-vue2_normalizer.js";
|
|
4
|
+
var r = function() {
|
|
5
|
+
var t = this, a = t._self._c, e = t._self._setupProxy;
|
|
6
|
+
return e.store.legacyStrategyUpdatedModalStatus ? a("div", { staticClass: "legacy-strategy-updated-modal" }, [a(e.WpModal, { attrs: { id: "guido__legacy-strategy-updated-modal", size: "small", "close-on-outside-click": !1, "footer-button-options": e.footerButtonOptions, title: e.trans("ds-steps.recommendation-strategy-migration-modal-title") }, on: { close: e.close, "primary-action": e.close } }, [a("p", [t._v(t._s(e.messageParts[0])), a("b", [t._v(t._s(e.strategyName))]), t._v(t._s(e.messageParts[1]))])])], 1) : t._e();
|
|
7
|
+
}, l = [], n = /* @__PURE__ */ o(
|
|
8
|
+
s,
|
|
9
|
+
r,
|
|
10
|
+
l,
|
|
11
|
+
!1,
|
|
12
|
+
null,
|
|
13
|
+
"da2225a1"
|
|
14
|
+
);
|
|
15
|
+
const m = n.exports;
|
|
16
|
+
export {
|
|
17
|
+
m as default
|
|
18
|
+
};
|
package/dist/components/organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue2.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { defineComponent as i, computed as s } from "vue";
|
|
2
|
+
import p from "../../../wrappers/WpModal.vue.js";
|
|
3
|
+
import { useTranslations as d } from "../../../../composables/useTranslations.js";
|
|
4
|
+
import { useRecommendationExtensionStore as g } from "../../../../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
5
|
+
const M = /* @__PURE__ */ i({
|
|
6
|
+
__name: "LegacyStrategyUpdatedModal",
|
|
7
|
+
setup(l) {
|
|
8
|
+
const e = d(), t = g(), n = s(() => ({
|
|
9
|
+
primaryButton: {
|
|
10
|
+
type: "primary",
|
|
11
|
+
labelText: e("action-builder.ok")
|
|
12
|
+
}
|
|
13
|
+
})), m = s(() => {
|
|
14
|
+
var r;
|
|
15
|
+
const { strategyId: a } = t.recommendationConfigs;
|
|
16
|
+
return ((r = t.assignedStrategy) == null ? void 0 : r.name) || `#${a}`;
|
|
17
|
+
}), o = "__STRATEGY_NAME__", c = s(() => e("email-editor.legacy-strategy-updated-message", { strategyName: o }).split(o));
|
|
18
|
+
return { __sfc: !0, trans: e, store: t, footerButtonOptions: n, strategyName: m, NAME_TOKEN: o, messageParts: c, close: () => {
|
|
19
|
+
t.closeLegacyStrategyUpdatedModal();
|
|
20
|
+
}, WpModal: p };
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
export {
|
|
24
|
+
M as default
|
|
25
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import s from "./RemoveStrategyModal.vue2.js";
|
|
2
|
+
import r from "../../../../_virtual/_plugin-vue2_normalizer.js";
|
|
3
|
+
var a = function() {
|
|
4
|
+
var t = this, o = t._self._c, e = t._self._setupProxy;
|
|
5
|
+
return e.store.removeStrategyModalStatus ? o(e.WpModal, { attrs: { id: "guido__remove-strategy-modal", size: "small", "close-on-outside-click": !1, "footer-button-options": e.footerButtonOptions, title: e.trans("email-editor.remove-strategy-confirm-title") }, on: { close: e.close, "primary-action": e.handleConfirm, "secondary-action": e.close } }, [o("p", [t._v(t._s(e.messageParts[0])), o("b", [t._v(t._s(e.strategyName))]), t._v(t._s(e.messageParts[1]))])]) : t._e();
|
|
6
|
+
}, n = [], _ = /* @__PURE__ */ r(
|
|
7
|
+
s,
|
|
8
|
+
a,
|
|
9
|
+
n,
|
|
10
|
+
!1,
|
|
11
|
+
null,
|
|
12
|
+
null
|
|
13
|
+
);
|
|
14
|
+
const c = _.exports;
|
|
15
|
+
export {
|
|
16
|
+
c as default
|
|
17
|
+
};
|