@useinsider/guido 2.2.0-beta.fa4cec8 → 3.0.0-beta.129ad33
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 +41 -2
- package/dist/@types/config/schemas.js +1 -1
- package/dist/components/Guido.vue.js +4 -4
- package/dist/components/Guido.vue2.js +91 -81
- package/dist/components/organisms/base/Toaster.vue.js +4 -4
- package/dist/components/organisms/base/Toaster.vue2.js +12 -9
- package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue.js +5 -5
- package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue2.js +2 -2
- package/dist/components/organisms/extensions/recommendation/FilterItem.vue.js +11 -13
- package/dist/components/organisms/extensions/recommendation/FilterItem.vue2.js +54 -23
- package/dist/components/organisms/extensions/recommendation/FilterSelectionDrawer.vue.js +7 -5
- package/dist/components/organisms/extensions/recommendation/FilterSelectionDrawer.vue2.js +34 -21
- package/dist/components/organisms/extensions/recommendation/Filters.vue.js +11 -11
- package/dist/components/organisms/extensions/recommendation/Filters.vue2.js +48 -36
- package/dist/components/organisms/extensions/recommendation/LogicAdapter.vue2.js +11 -9
- package/dist/composables/useRecommendation.js +9 -9
- package/dist/composables/useSave.js +16 -12
- package/dist/composables/useStripo.js +66 -62
- package/dist/composables/useStripoEventHandler.js +27 -12
- package/dist/composables/useSyncModuleExtractor.js +45 -0
- package/dist/config/compiler/utils/recommendationCompilerUtils.js +1 -1
- package/dist/config/migrator/recommendationMigrator.js +1 -1
- package/dist/enums/unsubscribe.js +25 -21
- package/dist/extensions/Blocks/Recommendation/block.js +1 -1
- package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +36 -33
- package/dist/extensions/Blocks/Recommendation/constants/layout.js +16 -14
- package/dist/extensions/Blocks/Recommendation/constants/selectors.js +15 -13
- package/dist/extensions/Blocks/Recommendation/controls/button/index.js +9 -9
- package/dist/extensions/Blocks/Recommendation/controls/image/index.js +1 -1
- package/dist/extensions/Blocks/Recommendation/controls/layout/index.js +41 -29
- package/dist/extensions/Blocks/Recommendation/controls/main/algorithm.js +16 -16
- package/dist/extensions/Blocks/Recommendation/controls/main/currency.js +30 -32
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +194 -104
- package/dist/extensions/Blocks/Recommendation/controls/main/locale.js +9 -9
- package/dist/extensions/Blocks/Recommendation/controls/main/productLayout.js +46 -38
- package/dist/extensions/Blocks/Recommendation/controls/main/shuffle.js +16 -16
- package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +291 -217
- package/dist/extensions/Blocks/Recommendation/controls/mobileLayout/cssRules.js +14 -14
- package/dist/extensions/Blocks/Recommendation/controls/name/index.js +10 -10
- package/dist/extensions/Blocks/Recommendation/controls/name/textTrim.js +5 -5
- package/dist/extensions/Blocks/Recommendation/controls/oldPrice/index.js +14 -14
- package/dist/extensions/Blocks/Recommendation/controls/omnibusDiscount/index.js +9 -9
- package/dist/extensions/Blocks/Recommendation/controls/omnibusDiscount/textAfter.js +3 -3
- package/dist/extensions/Blocks/Recommendation/controls/omnibusDiscount/textBefore.js +1 -1
- package/dist/extensions/Blocks/Recommendation/controls/omnibusPrice/index.js +9 -9
- package/dist/extensions/Blocks/Recommendation/controls/omnibusPrice/textAfter.js +3 -3
- package/dist/extensions/Blocks/Recommendation/controls/omnibusPrice/textBefore.js +13 -13
- package/dist/extensions/Blocks/Recommendation/controls/price/index.js +3 -3
- package/dist/extensions/Blocks/Recommendation/controls/spacing/index.js +223 -99
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +172 -85
- package/dist/extensions/Blocks/Recommendation/templates/grid/elementRenderer.js +2 -2
- package/dist/extensions/Blocks/Recommendation/templates/grid/migration.js +1 -1
- package/dist/extensions/Blocks/Recommendation/templates/list/elementRenderer.js +2 -2
- package/dist/extensions/Blocks/Recommendation/templates/utils.js +32 -32
- package/dist/extensions/Blocks/Recommendation/utils/filterUtil.js +8 -8
- package/dist/extensions/Blocks/Recommendation/validation/filterSchema.js +29 -0
- package/dist/guido.css +1 -1
- package/dist/services/stripoApi.js +55 -19
- package/dist/src/@types/config/schemas.d.ts +1 -1
- package/dist/src/@types/events.d.ts +38 -2
- package/dist/src/App.vue.d.ts +3 -1
- package/dist/src/components/Guido.vue.d.ts +2 -2
- package/dist/src/components/organisms/extensions/recommendation/FilterItem.vue.d.ts +1 -0
- package/dist/src/components/organisms/extensions/recommendation/Filters.vue.d.ts +17 -1
- package/dist/src/components/organisms/header/EditorActions.vue.d.ts +1 -1
- package/dist/src/components/organisms/header/HeaderWrapper.vue.d.ts +1 -1
- package/dist/src/components/organisms/header/RightSlot.vue.d.ts +1 -1
- package/dist/src/composables/useGuidoActions.d.ts +1 -1
- package/dist/src/composables/useSave.d.ts +2 -2
- package/dist/src/composables/useStripo.d.ts +2 -2
- package/dist/src/composables/useSyncModuleExtractor.d.ts +4 -0
- package/dist/src/enums/unsubscribe.d.ts +3 -0
- package/dist/src/extensions/Blocks/Recommendation/constants/defaultConfig.d.ts +6 -0
- package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +3 -3
- package/dist/src/extensions/Blocks/Recommendation/constants/layout.d.ts +6 -2
- package/dist/src/extensions/Blocks/Recommendation/constants/selectors.d.ts +8 -1
- package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +38 -10
- package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +27 -14
- package/dist/src/extensions/Blocks/Recommendation/controls/spacing/index.d.ts +50 -17
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +19 -2
- package/dist/src/extensions/Blocks/Recommendation/templates/grid/migration.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/templates/index.d.ts +4 -2
- package/dist/src/extensions/Blocks/Recommendation/templates/list/migration.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/templates/utils.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +8 -0
- package/dist/src/extensions/Blocks/Recommendation/validation/filterSchema.d.ts +15 -0
- package/dist/src/mock/api/settings.d.ts +2 -0
- package/dist/src/services/stripoApi.d.ts +5 -0
- package/dist/src/stores/editor.d.ts +23 -0
- package/dist/src/utils/templatePreparation.d.ts +1 -1
- package/dist/static/styles/customEditorStyle.css.js +50 -23
- package/dist/stores/editor.js +2 -1
- package/dist/utils/templatePreparation.js +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
<p align="center">
|
|
2
2
|
<a href="https://www.youtube.com/shorts/Y0RwBeMezL4" target="_blank" rel="noopener noreferrer">
|
|
3
|
-
<img width="180"
|
|
3
|
+
<img width="180"
|
|
4
|
+
src="https://web-image.useinsider.com/guido/defaultImageLibrary/iUH0liTK0d2YDsVB5LDN1770169173.jpg"
|
|
5
|
+
alt="Guido logo">
|
|
4
6
|
</a>
|
|
5
7
|
</p>
|
|
6
8
|
|
|
@@ -172,11 +174,48 @@ const config: GuidoConfigInput = {
|
|
|
172
174
|
| `dynamic-content:open` | `DynamicContent \| null` | User wants to insert dynamic content |
|
|
173
175
|
| `back` | - | Back button clicked |
|
|
174
176
|
| `save:start` | - | Save process started |
|
|
175
|
-
| `save:complete` | `
|
|
177
|
+
| `save:complete` | `SavedTemplateDetails` | Save completed successfully (includes `metadata`) |
|
|
176
178
|
| `on-change` | - | Template was modified |
|
|
177
179
|
| `test-email:click` | - | Test email button clicked |
|
|
178
180
|
| `onboarding-finished` | - | Onboarding popup dismissed |
|
|
179
181
|
|
|
182
|
+
### `save:complete` Payload
|
|
183
|
+
|
|
184
|
+
The `save:complete` event emits a `SavedTemplateDetails` object containing the compiled template data along with editor `metadata`:
|
|
185
|
+
|
|
186
|
+
```typescript
|
|
187
|
+
interface SavedTemplateDetails {
|
|
188
|
+
dynamicContentList: DynamicContent[];
|
|
189
|
+
compiledHtml: string;
|
|
190
|
+
rawHtml: string;
|
|
191
|
+
css: string;
|
|
192
|
+
ampHtml: string;
|
|
193
|
+
ampErrors: string[];
|
|
194
|
+
modules: number[];
|
|
195
|
+
recommendation: {
|
|
196
|
+
campaignUrls: Record<string, string>;
|
|
197
|
+
configs: Record<string, string>;
|
|
198
|
+
};
|
|
199
|
+
unsubscribe: {
|
|
200
|
+
status: boolean;
|
|
201
|
+
config: number[];
|
|
202
|
+
};
|
|
203
|
+
metadata: Metadata;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
interface Metadata {
|
|
207
|
+
emailId: string;
|
|
208
|
+
partnerName?: string;
|
|
209
|
+
productType?: number;
|
|
210
|
+
userId: string;
|
|
211
|
+
username?: string;
|
|
212
|
+
savedModulesFolderName?: string;
|
|
213
|
+
defaultModulesFolderName?: string;
|
|
214
|
+
}
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
> ⚠️ **Important:** The `metadata` object in the `save:complete` payload must be passed directly into your `templateConfig` / `stripoConfig` object while saving. This ensures the email-service receives the correct version of sync modules features
|
|
218
|
+
|
|
180
219
|
---
|
|
181
220
|
|
|
182
221
|
## Exposed Methods
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ModuleFolderDefaults as b } from "../../enums/defaults.js";
|
|
2
|
-
import { object as o, number as p, optional as e, string as t, pipe as u, picklist as n, custom as S, boolean as a, array as c,
|
|
2
|
+
import { object as o, number as p, optional as e, string as t, pipe as u, picklist as n, minLength as d, custom as S, boolean as a, array as c, literal as r, variant as k } from "../../node_modules/valibot/dist/index.js";
|
|
3
3
|
const m = {
|
|
4
4
|
/** Promotional/marketing emails */
|
|
5
5
|
PROMOTIONAL: 1,
|
|
@@ -3,7 +3,7 @@ import i from "./Guido.vue2.js";
|
|
|
3
3
|
import a 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", { staticClass: "guido-editor__wrapper", class: { "guido-editor__no-header": e.noHeader } }, [r(e.HeaderWrapper, { ref: "headerWrapperRef" }), 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), r(e.SaveAsTemplateDrawer), e.isTestPartner() ? o._e() : r(e.OnboardingWrapper, { on: { "onboarding-finished": function(
|
|
6
|
+
return r("div", { ref: "wrapperRef", staticClass: "guido-editor__wrapper", class: { "guido-editor__no-header": e.noHeader } }, [r(e.HeaderWrapper, { ref: "headerWrapperRef" }), 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), 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
9
|
}, n = [], s = /* @__PURE__ */ a(
|
|
@@ -12,9 +12,9 @@ var t = function() {
|
|
|
12
12
|
n,
|
|
13
13
|
!1,
|
|
14
14
|
null,
|
|
15
|
-
"
|
|
15
|
+
"25780af6"
|
|
16
16
|
);
|
|
17
|
-
const
|
|
17
|
+
const u = s.exports;
|
|
18
18
|
export {
|
|
19
|
-
|
|
19
|
+
u as default
|
|
20
20
|
};
|
|
@@ -1,121 +1,131 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { provideGuidoActions as
|
|
3
|
-
import { usePartner as
|
|
4
|
-
import { useStripo as
|
|
5
|
-
import { useTimerClone as
|
|
6
|
-
import { migrate as
|
|
7
|
-
import { ModuleFolderDefaults as
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
|
|
1
|
+
import { defineComponent as j, defineAsyncComponent as R, ref as A, computed as I, watch as J, onMounted as Q, onUnmounted as X } from "vue";
|
|
2
|
+
import { provideGuidoActions as Y } from "../composables/useGuidoActions.js";
|
|
3
|
+
import { usePartner as Z } from "../composables/usePartner.js";
|
|
4
|
+
import { useStripo as ee } from "../composables/useStripo.js";
|
|
5
|
+
import { useTimerClone as te } from "../composables/useTimerClone.js";
|
|
6
|
+
import { migrate as W } from "../config/migrator/index.js";
|
|
7
|
+
import { ModuleFolderDefaults as B } from "../enums/defaults.js";
|
|
8
|
+
import { RIBBON_SELECTOR as oe } from "../enums/onboarding.js";
|
|
9
|
+
import ne from "./organisms/base/Toaster.vue.js";
|
|
10
|
+
import se from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
|
|
11
|
+
import re from "./organisms/header/HeaderWrapper.vue.js";
|
|
12
|
+
import ce from "./organisms/LoadingWrapper.vue.js";
|
|
13
|
+
import ae from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
|
|
14
|
+
import ie from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
|
|
15
|
+
import { useStripoApi as me } from "../services/stripoApi.js";
|
|
16
|
+
import { useConfigStore as de } from "../stores/config.js";
|
|
17
|
+
import { useDynamicContentStore as le } from "../stores/dynamic-content.js";
|
|
18
|
+
import { useEditorStore as ue } from "../stores/editor.js";
|
|
19
|
+
import { usePreviewStore as pe } from "../stores/preview.js";
|
|
20
|
+
import { useUnsubscribeStore as fe } from "../stores/unsubscribe.js";
|
|
21
|
+
const Re = /* @__PURE__ */ j({
|
|
21
22
|
__name: "Guido",
|
|
22
23
|
props: {
|
|
23
24
|
config: null
|
|
24
25
|
},
|
|
25
26
|
emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change", "ready", "onboarding:finished", "test-email:click"],
|
|
26
|
-
setup(
|
|
27
|
-
const
|
|
27
|
+
setup(H, { expose: x, emit: s }) {
|
|
28
|
+
const b = H, G = R(
|
|
28
29
|
() => import("./organisms/email-preview/PreviewContainer.vue.js")
|
|
29
|
-
),
|
|
30
|
+
), z = R(
|
|
30
31
|
() => import("./organisms/onboarding/OnboardingWrapper.vue.js")
|
|
31
|
-
),
|
|
32
|
-
|
|
33
|
-
const
|
|
32
|
+
), S = A(), d = A(), l = le(), g = fe(), a = de();
|
|
33
|
+
a.init(b.config);
|
|
34
|
+
const u = ue(), q = pe(), i = I(() => u.hasChanges), { isTestPartner: K } = Z(), w = () => {
|
|
34
35
|
var e;
|
|
35
|
-
return (e =
|
|
36
|
+
return (e = S.value) == null ? void 0 : e.handleSave(!0);
|
|
36
37
|
}, {
|
|
37
|
-
templateId:
|
|
38
|
-
userId:
|
|
39
|
-
partnerName:
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
defaultModulesFolderName: D,
|
|
38
|
+
templateId: p,
|
|
39
|
+
userId: E,
|
|
40
|
+
partnerName: D,
|
|
41
|
+
username: C,
|
|
42
|
+
template: t,
|
|
43
|
+
editor: r
|
|
44
|
+
} = a, m = (t == null ? void 0 : t.html) || "", T = (t == null ? void 0 : t.css) || "", f = (t == null ? void 0 : t.preselectedDynamicContent) || [], k = (r == null ? void 0 : r.savedModulesFolderName) || B.SAVED_MODULES, F = (r == null ? void 0 : r.defaultModulesFolderName) || B.DEFAULT_MODULES;
|
|
45
|
+
u.templateId = p;
|
|
46
|
+
const v = {
|
|
47
|
+
emailId: p,
|
|
48
|
+
userId: E,
|
|
49
|
+
username: C,
|
|
50
|
+
partnerName: D,
|
|
51
|
+
savedModulesFolderName: k,
|
|
52
|
+
defaultModulesFolderName: F
|
|
53
|
+
}, L = {
|
|
54
|
+
preselectedDynamicContentList: f,
|
|
55
55
|
onReady: () => {
|
|
56
|
-
console.debug("guido:ready"),
|
|
56
|
+
console.debug("guido:ready"), s("ready");
|
|
57
57
|
}
|
|
58
|
-
}), { getDefaultTemplate:
|
|
58
|
+
}, { initPlugin: U } = ee(v, L), { getDefaultTemplate: _ } = me(), { cloneTimersOnSave: M, hasTimerBlocks: O } = te(), V = I(() => {
|
|
59
59
|
var e;
|
|
60
|
-
return !((e =
|
|
60
|
+
return !((e = a.ui) != null && e.showHeader);
|
|
61
61
|
});
|
|
62
|
-
|
|
62
|
+
Y({
|
|
63
63
|
onBack: () => {
|
|
64
|
-
console.debug("guido:back"),
|
|
64
|
+
console.debug("guido:back"), s("back");
|
|
65
65
|
},
|
|
66
66
|
onSaveStart: () => {
|
|
67
|
-
console.debug("guido:save:start"),
|
|
67
|
+
console.debug("guido:save:start"), s("save:start");
|
|
68
68
|
},
|
|
69
69
|
onSaveComplete: (e) => {
|
|
70
|
-
|
|
70
|
+
const n = { ...e, metadata: v };
|
|
71
|
+
console.debug("guido:save:complete", n), s("save:complete", n);
|
|
71
72
|
},
|
|
72
73
|
onTestEmailClick: () => {
|
|
73
|
-
console.debug("guido:test-email:click"),
|
|
74
|
+
console.debug("guido:test-email:click"), s("test-email:click");
|
|
74
75
|
}
|
|
75
76
|
});
|
|
76
|
-
const
|
|
77
|
-
console.debug("dynamic-content:close", e),
|
|
78
|
-
},
|
|
77
|
+
const P = (e) => {
|
|
78
|
+
console.debug("dynamic-content:close", e), l.setSelectedDynamicContent(e), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: e }));
|
|
79
|
+
}, N = () => {
|
|
79
80
|
console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
|
|
80
81
|
};
|
|
81
|
-
|
|
82
|
-
|
|
82
|
+
J(() => i.value, () => {
|
|
83
|
+
s("on-change", i.value);
|
|
83
84
|
});
|
|
84
|
-
const
|
|
85
|
-
const
|
|
86
|
-
console.debug("dynamic-content:open",
|
|
85
|
+
const y = (e) => {
|
|
86
|
+
const n = e, { attribute: o, position: $ } = n.detail;
|
|
87
|
+
console.debug("dynamic-content:open", n.detail), s("dynamic-content:open", o, $);
|
|
87
88
|
};
|
|
88
|
-
|
|
89
|
-
|
|
89
|
+
let c = null;
|
|
90
|
+
const h = () => {
|
|
91
|
+
var n;
|
|
92
|
+
const e = document.querySelector(oe);
|
|
93
|
+
(n = d.value) == null || n.style.setProperty("--ribbon-offset", `${(e == null ? void 0 : e.offsetHeight) ?? 0}px`);
|
|
94
|
+
};
|
|
95
|
+
return Q(async () => {
|
|
96
|
+
var n;
|
|
97
|
+
console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), h();
|
|
98
|
+
const e = (n = d.value) == null ? void 0 : n.parentElement;
|
|
99
|
+
e && (c = new ResizeObserver(h), c.observe(e));
|
|
90
100
|
try {
|
|
91
|
-
|
|
92
|
-
let
|
|
93
|
-
html:
|
|
94
|
-
css:
|
|
101
|
+
g.selectedUnsubscribePages = (t == null ? void 0 : t.selectedUnsubscribePages) || [];
|
|
102
|
+
let o = {
|
|
103
|
+
html: m && await W(m),
|
|
104
|
+
css: T
|
|
95
105
|
};
|
|
96
|
-
|
|
97
|
-
} catch (
|
|
98
|
-
console.error("Failed to initialize Stripo editor:",
|
|
106
|
+
o.html || (o = await _(), o.html = await W(o.html)), O(o.html) && (o.html = await M(o.html)), await U(o), l.selectedDynamicContentList = f;
|
|
107
|
+
} catch (o) {
|
|
108
|
+
console.error("Failed to initialize Stripo editor:", o);
|
|
99
109
|
}
|
|
100
|
-
document.addEventListener("dynamic-content:open",
|
|
101
|
-
}),
|
|
102
|
-
document.removeEventListener("dynamic-content:open",
|
|
110
|
+
document.addEventListener("dynamic-content:open", y);
|
|
111
|
+
}), X(() => {
|
|
112
|
+
c == null || c.disconnect(), document.removeEventListener("dynamic-content:open", y);
|
|
103
113
|
try {
|
|
104
114
|
window.UIEditor.removeEditor();
|
|
105
115
|
} catch {
|
|
106
116
|
console.debug("Failed to remove Stripo editor: No editor found");
|
|
107
117
|
}
|
|
108
|
-
|
|
109
|
-
}),
|
|
118
|
+
a.reset();
|
|
119
|
+
}), x({
|
|
110
120
|
dynamicContent: {
|
|
111
|
-
insert:
|
|
112
|
-
close:
|
|
121
|
+
insert: P,
|
|
122
|
+
close: N
|
|
113
123
|
},
|
|
114
|
-
hasChanges:
|
|
115
|
-
saveSilent:
|
|
116
|
-
}), { __sfc: !0, PreviewContainer:
|
|
124
|
+
hasChanges: i,
|
|
125
|
+
saveSilent: w
|
|
126
|
+
}), { __sfc: !0, PreviewContainer: G, OnboardingWrapper: z, headerWrapperRef: S, wrapperRef: d, dynamicContentStore: l, unsubscribeStore: g, props: b, configStore: a, editorStore: u, previewStore: q, hasChanges: i, isTestPartner: K, saveSilent: w, templateId: p, userId: E, partnerName: D, username: C, templateConfig: t, editorConfig: r, html: m, css: T, preselectedDynamicContentList: f, savedModulesFolderName: k, defaultModulesFolderName: F, emit: s, metadata: v, options: L, initPlugin: U, getDefaultTemplate: _, cloneTimersOnSave: M, hasTimerBlocks: O, noHeader: V, insertDynamicContent: P, closeDynamicContent: N, handleDynamicContentOpen: y, ribbonObserver: c, updateRibbonOffset: h, Toaster: ne, FilterSelectionDrawer: se, HeaderWrapper: re, LoadingWrapper: ce, SaveAsTemplateDrawer: ae, UnsubscribeWrapper: ie };
|
|
117
127
|
}
|
|
118
128
|
});
|
|
119
129
|
export {
|
|
120
|
-
|
|
130
|
+
Re as default
|
|
121
131
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import n from "./Toaster.vue2.js";
|
|
2
2
|
import s from "../../../_virtual/_plugin-vue2_normalizer.js";
|
|
3
3
|
var r = function() {
|
|
4
|
-
var o = this,
|
|
5
|
-
return
|
|
4
|
+
var o = this, e = o._self._c, t = o._self._setupProxy;
|
|
5
|
+
return e(t.InToasts, { ref: "toastRef", attrs: { "action-buttons-config": t.actionButtonsConfig, status: t.store.status, text: t.store.text, type: t.store.type }, on: { actionButtonClick0: t.handleActionClick } });
|
|
6
6
|
}, a = [], _ = /* @__PURE__ */ s(
|
|
7
|
-
|
|
7
|
+
n,
|
|
8
8
|
r,
|
|
9
9
|
a,
|
|
10
10
|
!1,
|
|
@@ -1,15 +1,18 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useToasterStore as
|
|
3
|
-
import { InToasts as
|
|
4
|
-
const
|
|
1
|
+
import { defineComponent as a, ref as c, computed as i, onBeforeUnmount as u } from "vue";
|
|
2
|
+
import { useToasterStore as f } from "../../../stores/toaster.js";
|
|
3
|
+
import { InToasts as m } from "@useinsider/design-system-vue";
|
|
4
|
+
const d = /* @__PURE__ */ a({
|
|
5
5
|
__name: "Toaster",
|
|
6
|
-
setup(
|
|
7
|
-
const t =
|
|
8
|
-
return { __sfc: !0, store: t, actionButtonsConfig: o, handleActionClick: () => {
|
|
6
|
+
setup(p) {
|
|
7
|
+
const t = f(), o = c(null), r = i(() => t.actionButton ? [{ text: t.actionButton.text }] : []), s = () => {
|
|
9
8
|
t.actionButton && t.actionButton.onClick(), t.hideToaster();
|
|
10
|
-
}
|
|
9
|
+
};
|
|
10
|
+
return u(() => {
|
|
11
|
+
var e, n;
|
|
12
|
+
t.$reset(), (n = (e = o.value) == null ? void 0 : e.$el) == null || n.remove();
|
|
13
|
+
}), { __sfc: !0, store: t, toastRef: o, actionButtonsConfig: r, handleActionClick: s, InToasts: m };
|
|
11
14
|
}
|
|
12
15
|
});
|
|
13
16
|
export {
|
|
14
|
-
|
|
17
|
+
d as default
|
|
15
18
|
};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import
|
|
1
|
+
import s from "./EmailSizeIndicator.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import r from "../../../../_virtual/_plugin-vue2_normalizer.js";
|
|
4
4
|
var o = function() {
|
|
5
|
-
var
|
|
6
|
-
return
|
|
5
|
+
var e = this, i = e._self._c, t = e._self._setupProxy;
|
|
6
|
+
return t.previewStore.previewHtml ? i("div", { staticClass: "d-f a-i-c j-c-c" }, [i(t.InProgress, { staticClass: "min-w-15-s", attrs: { id: "email-size-progress", "description-status": "", "description-position": "left", description: t.htmlSize, "max-value": t.MAX_EMAIL_SIZE_IN_KB, type: t.progress.type, value: t.progress.value } }), i(t.InTooltipV2, { attrs: { id: "email-size-tooltip", "icon-status": "", "static-position": "bottom center", "dynamic-position": !1, text: t.trans("email-editor.preview-design-size-tooltip") } })], 1) : e._e();
|
|
7
7
|
}, a = [], n = /* @__PURE__ */ r(
|
|
8
|
-
|
|
8
|
+
s,
|
|
9
9
|
o,
|
|
10
10
|
a,
|
|
11
11
|
!1,
|
|
12
12
|
null,
|
|
13
|
-
"
|
|
13
|
+
"079d2bf7"
|
|
14
14
|
);
|
|
15
15
|
const m = n.exports;
|
|
16
16
|
export {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent as c, ref as n, computed as l, watch as u } from "vue";
|
|
2
2
|
import { useTranslations as p } from "../../../../composables/useTranslations.js";
|
|
3
3
|
import { usePreviewStore as _ } from "../../../../stores/preview.js";
|
|
4
|
-
import {
|
|
4
|
+
import { InTooltipV2 as v, InProgress as f } from "@useinsider/design-system-vue";
|
|
5
5
|
const S = /* @__PURE__ */ c({
|
|
6
6
|
__name: "EmailSizeIndicator",
|
|
7
7
|
setup(w) {
|
|
@@ -17,7 +17,7 @@ const S = /* @__PURE__ */ c({
|
|
|
17
17
|
}, i = p();
|
|
18
18
|
return u(() => t.previewHtml, () => {
|
|
19
19
|
r();
|
|
20
|
-
}, { immediate: !0 }), { __sfc: !0, previewStore: t, MAX_EMAIL_SIZE_IN_KB: o, htmlKB: e, progress: s, htmlSize: a, calculateProgress: r, trans: i, InProgress: f,
|
|
20
|
+
}, { immediate: !0 }), { __sfc: !0, previewStore: t, MAX_EMAIL_SIZE_IN_KB: o, htmlKB: e, progress: s, htmlSize: a, calculateProgress: r, trans: i, InProgress: f, InTooltipV2: v };
|
|
21
21
|
}
|
|
22
22
|
});
|
|
23
23
|
export {
|
|
@@ -1,28 +1,26 @@
|
|
|
1
1
|
import r from "./FilterItem.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
|
-
import
|
|
4
|
-
var
|
|
3
|
+
import l from "../../../../_virtual/_plugin-vue2_normalizer.js";
|
|
4
|
+
var i = function() {
|
|
5
5
|
var a = this, e = a._self._c, t = a._self._setupProxy;
|
|
6
|
-
return e("div", { staticClass: "d-f f-d-c w-1 gap-16" }, [e("div", { staticClass: "d-f a-i-c j-c-s-b pt-4", class: { "bor-t-s-s bor-t-w-1 bor-t-c-50": a.index === 0 } }, [e("p", [a._v(" " + a._s(t.trans("newsletter.filter")) + " " + a._s(a.index + 1) + " ")]), e(t.InButtonV2, { attrs: { id: "guido__delete-filter-group-button", "left-icon": "line-delete", styling: "text", type: "danger", "label-text-status": !1 }, on: { click: function(s) {
|
|
6
|
+
return e("div", { staticClass: "d-f f-d-c w-1 gap-16", attrs: { "data-filter-group": a.filter.filterGroup, "data-filter-number": a.filter.filterNumber } }, [e("div", { staticClass: "d-f a-i-c j-c-s-b pt-4", class: { "bor-t-s-s bor-t-w-1 bor-t-c-50": a.index === 0 } }, [e("p", [a._v(" " + a._s(t.trans("newsletter.filter")) + " " + a._s(a.index + 1) + " ")]), e(t.InButtonV2, { attrs: { id: "guido__delete-filter-group-button", "left-icon": "line-delete", styling: "text", type: "danger", "label-text-status": !1 }, on: { click: function(s) {
|
|
7
7
|
return t.emit("delete-filter", t.props.filter);
|
|
8
|
-
} } })], 1), e("div", { staticClass: "w-1 d-f a-i-s j-c-s-b gap-16" }, [e(t.InSelect, { staticClass: "w-2", attrs: { "disabled-status": "", "search-status": "", "button-status": !1, "label-text": t.trans("action-builder.filter-type"), options: t.filterTypeOptions, value: [t.filterTypeOptions[0]] } }), e(t.InSelect, { staticClass: "w-2", attrs: { id: "filter-item-input--attribute-type", "search-status": "", "static-position": "bottom right", "button-status": !1, "label-text": t.trans("condition.attribute"), options: t.store.getFilterList, value: [t.selectedAttributeType] }, on: { select: function(s) {
|
|
9
|
-
return t.updateFilter({ text: "attribute", value: s.value });
|
|
10
|
-
} } })], 1), e("div", { staticClass: "w-1 d-f a-i-s j-c-s-b gap-16" }, [e(t.InSelect, { staticClass: "w-2", attrs: { "button-status": !1, "label-text": t.trans("condition.operator"), options: t.getOperatorOptions(t.selectedAttributeType.type), value: [t.selectedOperatorType] }, on: { select: function(s) {
|
|
8
|
+
} } })], 1), e("div", { staticClass: "w-1 d-f a-i-s j-c-s-b gap-16" }, [e(t.InSelect, { staticClass: "w-2", attrs: { "disabled-status": "", "search-status": "", "button-status": !1, "label-text": t.trans("action-builder.filter-type"), options: t.filterTypeOptions, value: [t.filterTypeOptions[0]] } }), e(t.InSelect, { staticClass: "w-2", attrs: { id: "filter-item-input--attribute-type", "search-status": "", "static-position": "bottom right", "button-status": !1, "label-text": t.trans("condition.attribute"), options: t.store.getFilterList, state: t.getFieldState("attribute"), value: [t.selectedAttributeType] }, on: { select: t.handleAttributeChange } })], 1), e("div", { staticClass: "w-1 d-f a-i-s j-c-s-b gap-16" }, [t.isBooleanAttribute ? e(t.InSelect, { staticClass: "w-2", attrs: { "button-status": !1, "label-text": t.trans("condition.operator"), options: t.booleanValueOptions, state: t.getFieldState("value"), value: [t.selectedBooleanValue] }, on: { select: t.handleBooleanValueChange } }) : [e(t.InSelect, { staticClass: "w-2", attrs: { "button-status": !1, "label-text": t.trans("condition.operator"), options: t.getOperatorOptions(t.selectedAttributeType.type), state: t.getFieldState("operator"), value: [t.selectedOperatorType] }, on: { select: function(s) {
|
|
11
9
|
return t.updateFilter({ text: "operator", value: s.value });
|
|
12
|
-
} } }), e(t.InBasicTextInput, { staticClass: "w-2", attrs: { id: "filter-item-input--value", name: "imageUrl",
|
|
10
|
+
} } }), e(t.InBasicTextInput, { staticClass: "w-2", attrs: { id: "filter-item-input--value", name: "imageUrl", "character-counter-status": !1, "label-text": t.trans("condition.value"), "max-character-length": 25, "placeholder-text": t.trans("condition.enter-value-placeholder"), "state-message": t.valueErrorMessage, states: t.getFieldState("value"), "tooltip-status": !1, type: t.valueInputType, value: decodeURIComponent(t.props.filter.value) }, on: { input: function(s) {
|
|
13
11
|
t.updateFilter({ text: "value", value: encodeURIComponent(s) });
|
|
14
|
-
} } })],
|
|
12
|
+
} } })]], 2), t.props.hasLogicAdapter ? e("div", { staticClass: "w-1 d-f a-i-c j-c-c p-r bor-b-s-s bor-b-w-1 bor-b-c-50 mt-4" }, [e(t.LogicAdapter, { staticClass: "p-a", attrs: { logic: t.props.filter.innerGroupOperator }, on: { change: function(s) {
|
|
15
13
|
return t.updateFilter({ text: "innerGroupOperator", value: s });
|
|
16
14
|
} } })], 1) : a._e()]);
|
|
17
|
-
},
|
|
15
|
+
}, o = [], n = /* @__PURE__ */ l(
|
|
18
16
|
r,
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
i,
|
|
18
|
+
o,
|
|
21
19
|
!1,
|
|
22
20
|
null,
|
|
23
|
-
"
|
|
21
|
+
"3b53a736"
|
|
24
22
|
);
|
|
25
|
-
const f =
|
|
23
|
+
const f = n.exports;
|
|
26
24
|
export {
|
|
27
25
|
f as default
|
|
28
26
|
};
|
|
@@ -1,38 +1,69 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useTranslations as
|
|
3
|
-
import { getOperatorOptions as
|
|
4
|
-
import { useRecommendationExtensionStore as
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
|
|
1
|
+
import { defineComponent as _, computed as l } from "vue";
|
|
2
|
+
import { useTranslations as C } from "../../../../composables/useTranslations.js";
|
|
3
|
+
import { getOperatorOptions as p } from "../../../../enums/extensions/recommendationBlock.js";
|
|
4
|
+
import { useRecommendationExtensionStore as V } from "../../../../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
5
|
+
import { getInvalidFilterFields as A } from "../../../../extensions/Blocks/Recommendation/validation/filterSchema.js";
|
|
6
|
+
import { InButtonV2 as L, InSelect as O, InBasicTextInput as S } from "@useinsider/design-system-vue";
|
|
7
|
+
import E from "./LogicAdapter.vue.js";
|
|
8
|
+
import { useDebounceFn as N } from "../../../../node_modules/@vueuse/shared/index.js";
|
|
9
|
+
const K = /* @__PURE__ */ _({
|
|
9
10
|
__name: "FilterItem",
|
|
10
11
|
props: {
|
|
11
12
|
filter: null,
|
|
12
13
|
index: null,
|
|
13
|
-
hasLogicAdapter: { type: Boolean }
|
|
14
|
+
hasLogicAdapter: { type: Boolean },
|
|
15
|
+
submitted: { type: Boolean }
|
|
14
16
|
},
|
|
15
17
|
emits: ["delete-filter"],
|
|
16
|
-
setup(
|
|
17
|
-
const
|
|
18
|
+
setup(f, { emit: v }) {
|
|
19
|
+
const t = f, n = C(), a = V(), y = [
|
|
18
20
|
{
|
|
19
21
|
text: n("email-editor.standard-filter"),
|
|
20
22
|
value: "standardFilter"
|
|
21
23
|
}
|
|
22
|
-
],
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
24
|
+
], i = [
|
|
25
|
+
{ text: "True", value: "true" },
|
|
26
|
+
{ text: "False", value: "false" }
|
|
27
|
+
], d = l(() => t.filter.attribute || ""), r = l(() => a.getFilterList.find((e) => e.value === d.value) || { text: "", value: "", type: "" }), F = l(
|
|
28
|
+
() => {
|
|
29
|
+
var e;
|
|
30
|
+
return ((e = r.value) == null ? void 0 : e.type) === "Boolean";
|
|
31
|
+
}
|
|
32
|
+
), b = l(() => {
|
|
33
|
+
var e;
|
|
34
|
+
return p((e = r.value) == null ? void 0 : e.type).find((o) => o.value === t.filter.operator);
|
|
35
|
+
}), g = l(
|
|
36
|
+
() => i.find((e) => e.value === t.filter.value) || i[0]
|
|
37
|
+
), u = l(() => t.submitted ? A(t.filter) : /* @__PURE__ */ new Set()), h = (e) => u.value.has(e) ? "error" : "default", B = l(
|
|
38
|
+
() => u.value.has("value") ? n("action-builder.filter-empty-value-error") : ""
|
|
39
|
+
), c = l(
|
|
40
|
+
() => {
|
|
41
|
+
var e;
|
|
42
|
+
return ((e = r.value) == null ? void 0 : e.type) === "Number";
|
|
43
|
+
}
|
|
44
|
+
), x = l(() => c.value ? "number" : "text"), T = N((e) => {
|
|
45
|
+
a.updateFilter({
|
|
46
|
+
...t.filter,
|
|
47
|
+
[e.text]: e.value
|
|
48
|
+
});
|
|
32
49
|
}, 500);
|
|
33
|
-
return { __sfc: !0, trans: n, store:
|
|
50
|
+
return { __sfc: !0, trans: n, store: a, props: t, filterTypeOptions: y, booleanValueOptions: i, attributeType: d, selectedAttributeType: r, isBooleanAttribute: F, selectedOperatorType: b, selectedBooleanValue: g, emit: v, invalidFields: u, getFieldState: h, valueErrorMessage: B, isNumericAttribute: c, valueInputType: x, updateFilter: T, handleAttributeChange: (e) => {
|
|
51
|
+
const o = a.getFilterList.find((I) => I.value === e.value), m = (o == null ? void 0 : o.type) === "Boolean", [s] = p(o == null ? void 0 : o.type);
|
|
52
|
+
a.updateFilter({
|
|
53
|
+
...t.filter,
|
|
54
|
+
attribute: e.value,
|
|
55
|
+
operator: m ? "=" : (s == null ? void 0 : s.value) ?? "",
|
|
56
|
+
value: m ? "true" : ""
|
|
57
|
+
});
|
|
58
|
+
}, handleBooleanValueChange: (e) => {
|
|
59
|
+
a.updateFilter({
|
|
60
|
+
...t.filter,
|
|
61
|
+
operator: "=",
|
|
62
|
+
value: e.value
|
|
63
|
+
});
|
|
64
|
+
}, getOperatorOptions: p, InBasicTextInput: S, InSelect: O, InButtonV2: L, LogicAdapter: E };
|
|
34
65
|
}
|
|
35
66
|
});
|
|
36
67
|
export {
|
|
37
|
-
|
|
68
|
+
K as default
|
|
38
69
|
};
|
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
import o from "./FilterSelectionDrawer.vue2.js";
|
|
2
2
|
import n from "../../../../_virtual/_plugin-vue2_normalizer.js";
|
|
3
|
-
var
|
|
3
|
+
var i = function() {
|
|
4
4
|
var e = this, r = e._self._c, t = e._self._setupProxy;
|
|
5
|
-
return r(t.WpDrawer, { attrs: { id: "recommendation-filter-drawer", "
|
|
5
|
+
return r(t.WpDrawer, { attrs: { id: "recommendation-filter-drawer", "description-status": "", "description-text": t.trans("email-editor.filter-description"), "footer-button-group-options": t.footerButtonGroupOptions, status: t.store.filterSelectionDrawerStatus, "title-text": t.trans("email-editor.add-filters") }, on: { cancelOrBackButtonEvent: t.cancelModal, onCloseEvent: t.cancelModal, primaryButtonEvent: t.applyFilter } }, [t.store.filterSelectionDrawerStatus ? r(t.Filters, { ref: "filtersRef", attrs: { submitted: t.submitted }, on: { "reset-validation": function(c) {
|
|
6
|
+
t.submitted = !1;
|
|
7
|
+
} } }) : e._e()], 1);
|
|
6
8
|
}, s = [], a = /* @__PURE__ */ n(
|
|
7
9
|
o,
|
|
8
|
-
|
|
10
|
+
i,
|
|
9
11
|
s,
|
|
10
12
|
!1,
|
|
11
13
|
null,
|
|
12
14
|
null
|
|
13
15
|
);
|
|
14
|
-
const
|
|
16
|
+
const d = a.exports;
|
|
15
17
|
export {
|
|
16
|
-
|
|
18
|
+
d as default
|
|
17
19
|
};
|