@useinsider/guido 3.2.0-beta.066130b → 3.2.0-beta.080341b
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 +117 -1
- package/dist/@types/config/schemas.js +153 -95
- package/dist/components/Guido.vue.js +4 -4
- package/dist/components/Guido.vue2.js +90 -88
- package/dist/components/organisms/AutoSaveController.vue.js +17 -0
- package/dist/components/organisms/AutoSaveController.vue2.js +13 -0
- package/dist/components/organisms/header/AutoSaveToggle.vue.js +22 -0
- package/dist/components/organisms/header/AutoSaveToggle.vue2.js +19 -0
- package/dist/components/organisms/header/RightSlot.vue.js +8 -8
- package/dist/components/organisms/header/RightSlot.vue2.js +9 -8
- package/dist/composables/useAutoSave.js +71 -0
- package/dist/composables/useRecommendation.js +46 -26
- package/dist/composables/useSave.js +19 -16
- package/dist/composables/useStripo.js +14 -16
- package/dist/composables/validators/useCouponBlockValidator.js +24 -0
- package/dist/config/compiler/recommendationCompilerRules.js +25 -25
- package/dist/config/compiler/unsubscribeCompilerRules.js +40 -37
- package/dist/config/compiler/utils/recommendationCompilerUtils.js +107 -71
- package/dist/config/migrator/index.js +9 -9
- package/dist/config/migrator/radioButtonMigrator.js +64 -44
- package/dist/config/migrator/recommendation/compositionMapper.js +98 -0
- package/dist/config/migrator/recommendation/extractors.js +27 -0
- package/dist/config/migrator/recommendation/htmlBuilder.js +496 -0
- package/dist/config/migrator/recommendation/parseLegacyConfig.js +33 -0
- package/dist/config/migrator/recommendation/settingsMapper.js +70 -0
- package/dist/config/migrator/recommendation/themeMapper.js +93 -0
- package/dist/config/migrator/recommendationMigrator.js +74 -290
- package/dist/enums/extensions/recommendationBlock.js +2 -1
- package/dist/enums/unsubscribe.js +34 -27
- package/dist/extensions/Blocks/RadioButton/template.js +1 -1
- package/dist/extensions/Blocks/Recommendation/block.js +60 -50
- package/dist/extensions/Blocks/Recommendation/constants/controlIds.js +1 -1
- package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +5 -5
- package/dist/extensions/Blocks/Recommendation/controls/customAttribute/index.js +21 -18
- package/dist/extensions/Blocks/Recommendation/controls/customAttribute/textTrim.js +99 -0
- package/dist/extensions/Blocks/Recommendation/controls/main/algorithm.js +27 -26
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +3 -1
- package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +228 -181
- package/dist/extensions/Blocks/Recommendation/controls/name/textTrim.js +27 -57
- package/dist/extensions/Blocks/Recommendation/controls/shared/textTrimCssRules.js +14 -0
- package/dist/extensions/Blocks/Recommendation/services/configService.js +76 -33
- package/dist/extensions/Blocks/Recommendation/settingsPanel.js +18 -17
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +123 -79
- package/dist/extensions/Blocks/Recommendation/templates/grid/elementRenderer.js +19 -10
- package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +8 -8
- package/dist/extensions/Blocks/Recommendation/templates/list/elementRenderer.js +25 -15
- package/dist/extensions/Blocks/Recommendation/templates/list/template.js +11 -11
- package/dist/extensions/Blocks/Recommendation/templates/utils.js +1 -1
- package/dist/extensions/Blocks/Recommendation/utils/filterUtil.js +17 -14
- package/dist/extensions/Blocks/Recommendation/utils/legacyStrategyMap.js +21 -0
- package/dist/extensions/Blocks/Recommendation/utils/preserveTextStyles.js +13 -22
- package/dist/guido.css +1 -1
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +393 -264
- package/dist/node_modules/valibot/dist/index.js +450 -235
- package/dist/package.json.js +1 -1
- package/dist/services/templateLibraryApi.js +5 -4
- package/dist/src/@types/config/defaults.d.ts +5 -1
- package/dist/src/@types/config/index.d.ts +3 -3
- package/dist/src/@types/config/schemas.d.ts +217 -0
- package/dist/src/@types/config/types.d.ts +9 -1
- package/dist/src/components/Guido.vue.d.ts +1 -1
- package/dist/src/components/organisms/AutoSaveController.vue.d.ts +2 -0
- package/dist/src/components/organisms/header/AutoSaveToggle.vue.d.ts +2 -0
- 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/components/wrappers/WpModal.vue.d.ts +1 -1
- package/dist/src/composables/useAutoSave.d.ts +3 -0
- package/dist/src/composables/useConfig.d.ts +58 -0
- package/dist/src/composables/useRecommendation.d.ts +10 -1
- package/dist/src/composables/useRecommendation.test.d.ts +1 -0
- package/dist/src/composables/useSave.d.ts +1 -1
- package/dist/src/composables/validators/useCouponBlockValidator.d.ts +3 -0
- package/dist/src/config/migrator/index.d.ts +2 -1
- package/dist/src/config/migrator/recommendation/compositionMapper.d.ts +2 -0
- package/dist/src/config/migrator/recommendation/compositionMapper.test.d.ts +1 -0
- package/dist/src/config/migrator/recommendation/extractors.d.ts +7 -0
- package/dist/src/config/migrator/recommendation/extractors.test.d.ts +1 -0
- package/dist/src/config/migrator/recommendation/htmlBuilder.d.ts +11 -0
- package/dist/src/config/migrator/recommendation/parseLegacyConfig.d.ts +15 -0
- package/dist/src/config/migrator/recommendation/parseLegacyConfig.test.d.ts +1 -0
- package/dist/src/config/migrator/recommendation/settingsMapper.d.ts +7 -0
- package/dist/src/config/migrator/recommendation/settingsMapper.test.d.ts +1 -0
- package/dist/src/config/migrator/recommendation/themeMapper.d.ts +5 -0
- package/dist/src/config/migrator/recommendation/themeMapper.test.d.ts +1 -0
- package/dist/src/config/migrator/recommendation/types.d.ts +205 -0
- package/dist/src/config/migrator/recommendationMigrator.d.ts +13 -1
- package/dist/src/config/migrator/recommendationMigrator.test.d.ts +1 -0
- package/dist/src/enums/unsubscribe.d.ts +5 -0
- package/dist/src/extensions/Blocks/RadioButton/template.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/constants/controlIds.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/customAttribute/index.d.ts +3 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/customAttribute/textTrim.d.ts +35 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.test.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/name/textTrim.d.ts +3 -20
- package/dist/src/extensions/Blocks/Recommendation/controls/shared/textTrimCssRules.d.ts +29 -0
- package/dist/src/extensions/Blocks/Recommendation/services/configService.d.ts +21 -3
- package/dist/src/extensions/Blocks/Recommendation/services/configService.test.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +34 -0
- package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/utils/legacyStrategyMap.d.ts +21 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/legacyStrategyMap.test.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/preserveTextStyles.d.ts +0 -3
- package/dist/src/library.d.ts +1 -1
- package/dist/src/stores/autosave.d.ts +12 -0
- package/dist/src/stores/config.d.ts +522 -0
- package/dist/src/stores/editor.d.ts +23 -0
- package/dist/src/utils/htmlEscape.d.ts +5 -0
- package/dist/src/utils/htmlEscape.test.d.ts +1 -0
- package/dist/src/utils/timeUtil.d.ts +8 -0
- package/dist/static/styles/components/button.css.js +16 -9
- package/dist/static/styles/components/loader.css.js +4 -0
- package/dist/static/styles/components/narrow-panel.css.js +52 -0
- package/dist/stores/autosave.js +17 -0
- package/dist/stores/editor.js +3 -1
- package/dist/utils/htmlEscape.js +13 -0
- package/dist/utils/pairProductVariables.js +89 -88
- package/dist/utils/templatePreparation.js +72 -32
- package/dist/utils/timeUtil.js +19 -0
- package/package.json +7 -3
- package/dist/enums/displayConditions.js +0 -80
- package/dist/extensions/Blocks/Recommendation/templates/grid/migration.js +0 -251
- package/dist/src/enums/displayConditions.d.ts +0 -2
|
@@ -1,131 +1,133 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { provideGuidoActions as
|
|
3
|
-
import { usePartner as
|
|
4
|
-
import { useStripo as
|
|
1
|
+
import { defineComponent as J, defineAsyncComponent as I, ref as W, computed as B, watch as Q, onMounted as X, onUnmounted as Y } from "vue";
|
|
2
|
+
import { provideGuidoActions as Z } from "../composables/useGuidoActions.js";
|
|
3
|
+
import { usePartner as ee } from "../composables/usePartner.js";
|
|
4
|
+
import { useStripo as oe } from "../composables/useStripo.js";
|
|
5
5
|
import { useTimerClone as te } from "../composables/useTimerClone.js";
|
|
6
|
-
import { migrate as
|
|
7
|
-
import { ModuleFolderDefaults as
|
|
8
|
-
import { RIBBON_SELECTOR as
|
|
9
|
-
import
|
|
10
|
-
import se from "./organisms/
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
|
|
6
|
+
import { migrate as H } from "../config/migrator/index.js";
|
|
7
|
+
import { ModuleFolderDefaults as x } from "../enums/defaults.js";
|
|
8
|
+
import { RIBBON_SELECTOR as ne } from "../enums/onboarding.js";
|
|
9
|
+
import re from "./organisms/AutoSaveController.vue.js";
|
|
10
|
+
import se from "./organisms/base/Toaster.vue.js";
|
|
11
|
+
import ce from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
|
|
12
|
+
import ae from "./organisms/header/HeaderWrapper.vue.js";
|
|
13
|
+
import ie from "./organisms/LoadingWrapper.vue.js";
|
|
14
|
+
import me from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
|
|
15
|
+
import de from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
|
|
16
|
+
import { useStripoApi as le } from "../services/stripoApi.js";
|
|
17
|
+
import { useConfigStore as ue } from "../stores/config.js";
|
|
18
|
+
import { useDynamicContentStore as pe } from "../stores/dynamic-content.js";
|
|
19
|
+
import { useEditorStore as fe } from "../stores/editor.js";
|
|
20
|
+
import { usePreviewStore as ve } from "../stores/preview.js";
|
|
21
|
+
import { useUnsubscribeStore as ye } from "../stores/unsubscribe.js";
|
|
22
|
+
const We = /* @__PURE__ */ J({
|
|
22
23
|
__name: "Guido",
|
|
23
24
|
props: {
|
|
24
25
|
config: null
|
|
25
26
|
},
|
|
26
27
|
emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change", "ready", "onboarding:finished", "test-email:click"],
|
|
27
|
-
setup(
|
|
28
|
-
const
|
|
28
|
+
setup(G, { expose: z, emit: n }) {
|
|
29
|
+
const g = G, q = I(
|
|
29
30
|
() => import("./organisms/email-preview/PreviewContainer.vue.js")
|
|
30
|
-
),
|
|
31
|
+
), K = I(
|
|
31
32
|
() => import("./organisms/onboarding/OnboardingWrapper.vue.js")
|
|
32
|
-
),
|
|
33
|
-
|
|
34
|
-
const
|
|
33
|
+
), w = W(), u = W(), p = pe(), E = ye(), i = ue();
|
|
34
|
+
i.init(g.config);
|
|
35
|
+
const f = fe(), V = ve(), m = B(() => f.hasChanges), { isTestPartner: $ } = ee(), D = () => {
|
|
35
36
|
var e;
|
|
36
|
-
return (e =
|
|
37
|
+
return (e = w.value) == null ? void 0 : e.handleSave(!0);
|
|
37
38
|
}, {
|
|
38
|
-
templateId:
|
|
39
|
-
userId:
|
|
40
|
-
partnerName:
|
|
41
|
-
username:
|
|
42
|
-
template:
|
|
43
|
-
editor:
|
|
44
|
-
} =
|
|
45
|
-
|
|
46
|
-
const
|
|
47
|
-
emailId:
|
|
48
|
-
userId:
|
|
49
|
-
username:
|
|
50
|
-
partnerName:
|
|
51
|
-
savedModulesFolderName:
|
|
52
|
-
defaultModulesFolderName:
|
|
53
|
-
},
|
|
54
|
-
preselectedDynamicContentList:
|
|
39
|
+
templateId: v,
|
|
40
|
+
userId: C,
|
|
41
|
+
partnerName: T,
|
|
42
|
+
username: k,
|
|
43
|
+
template: o,
|
|
44
|
+
editor: s
|
|
45
|
+
} = i, d = (o == null ? void 0 : o.html) || "", F = (o == null ? void 0 : o.css) || "", y = (o == null ? void 0 : o.preselectedDynamicContent) || [], L = (s == null ? void 0 : s.savedModulesFolderName) || x.SAVED_MODULES, U = (s == null ? void 0 : s.defaultModulesFolderName) || x.DEFAULT_MODULES;
|
|
46
|
+
f.templateId = v;
|
|
47
|
+
const h = {
|
|
48
|
+
emailId: v,
|
|
49
|
+
userId: C,
|
|
50
|
+
username: k,
|
|
51
|
+
partnerName: T,
|
|
52
|
+
savedModulesFolderName: L,
|
|
53
|
+
defaultModulesFolderName: U
|
|
54
|
+
}, _ = {
|
|
55
|
+
preselectedDynamicContentList: y,
|
|
55
56
|
onReady: () => {
|
|
56
|
-
console.debug("guido:ready"),
|
|
57
|
+
console.debug("guido:ready"), n("ready");
|
|
57
58
|
}
|
|
58
|
-
}, { initPlugin:
|
|
59
|
+
}, { initPlugin: M } = oe(h, _), { getDefaultTemplate: O } = le(), { cloneTimersOnSave: P, hasTimerBlocks: A } = te(), j = B(() => {
|
|
59
60
|
var e;
|
|
60
|
-
return !((e =
|
|
61
|
+
return !((e = i.ui) != null && e.showHeader);
|
|
61
62
|
});
|
|
62
|
-
|
|
63
|
+
Z({
|
|
63
64
|
onBack: () => {
|
|
64
|
-
console.debug("guido:back"),
|
|
65
|
+
console.debug("guido:back"), n("back");
|
|
65
66
|
},
|
|
66
67
|
onSaveStart: () => {
|
|
67
|
-
console.debug("guido:save:start"),
|
|
68
|
+
console.debug("guido:save:start"), n("save:start");
|
|
68
69
|
},
|
|
69
70
|
onSaveComplete: (e) => {
|
|
70
|
-
const
|
|
71
|
-
console.debug("guido:save:complete",
|
|
71
|
+
const t = { ...e, metadata: h };
|
|
72
|
+
console.debug("guido:save:complete", t), n("save:complete", t);
|
|
72
73
|
},
|
|
73
74
|
onTestEmailClick: () => {
|
|
74
|
-
console.debug("guido:test-email:click"),
|
|
75
|
+
console.debug("guido:test-email:click"), n("test-email:click");
|
|
75
76
|
}
|
|
76
77
|
});
|
|
77
|
-
const
|
|
78
|
-
console.debug("dynamic-content:close", e),
|
|
79
|
-
},
|
|
78
|
+
const N = (e) => {
|
|
79
|
+
console.debug("dynamic-content:close", e), p.setSelectedDynamicContent(e), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: e }));
|
|
80
|
+
}, R = () => {
|
|
80
81
|
console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
|
|
81
82
|
};
|
|
82
|
-
|
|
83
|
-
|
|
83
|
+
Q(() => m.value, () => {
|
|
84
|
+
n("on-change", m.value);
|
|
84
85
|
});
|
|
85
|
-
const
|
|
86
|
-
const
|
|
87
|
-
console.debug("dynamic-content:open",
|
|
86
|
+
const S = (e) => {
|
|
87
|
+
const t = e, { attribute: l, position: a } = t.detail;
|
|
88
|
+
console.debug("dynamic-content:open", t.detail), n("dynamic-content:open", l, a);
|
|
88
89
|
};
|
|
89
90
|
let c = null;
|
|
90
|
-
const
|
|
91
|
-
var
|
|
92
|
-
const e = document.querySelector(
|
|
93
|
-
(
|
|
91
|
+
const b = () => {
|
|
92
|
+
var t;
|
|
93
|
+
const e = document.querySelector(ne);
|
|
94
|
+
(t = u.value) == null || t.style.setProperty("--ribbon-offset", `${(e == null ? void 0 : e.offsetHeight) ?? 0}px`);
|
|
94
95
|
};
|
|
95
|
-
return
|
|
96
|
-
var
|
|
97
|
-
console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"),
|
|
98
|
-
const e = (
|
|
99
|
-
e && (c = new ResizeObserver(
|
|
96
|
+
return X(async () => {
|
|
97
|
+
var t, l;
|
|
98
|
+
console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), b();
|
|
99
|
+
const e = (t = u.value) == null ? void 0 : t.parentElement;
|
|
100
|
+
e && (c = new ResizeObserver(b), c.observe(e));
|
|
100
101
|
try {
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
102
|
+
E.selectedUnsubscribePages = (o == null ? void 0 : o.selectedUnsubscribePages) || [];
|
|
103
|
+
const a = ((l = o == null ? void 0 : o.migration) == null ? void 0 : l.recommendationConfigs) ?? {};
|
|
104
|
+
let r = {
|
|
105
|
+
html: d && await H(d, a),
|
|
106
|
+
css: F
|
|
105
107
|
};
|
|
106
|
-
|
|
107
|
-
} catch (
|
|
108
|
-
console.error("Failed to initialize Stripo editor:",
|
|
108
|
+
r.html || (r = await O(), r.html = await H(r.html, a)), A(r.html) && (r.html = await P(r.html)), await M(r), p.selectedDynamicContentList = y;
|
|
109
|
+
} catch (a) {
|
|
110
|
+
console.error("Failed to initialize Stripo editor:", a);
|
|
109
111
|
}
|
|
110
|
-
document.addEventListener("dynamic-content:open",
|
|
111
|
-
}),
|
|
112
|
-
c == null || c.disconnect(), document.removeEventListener("dynamic-content:open",
|
|
112
|
+
document.addEventListener("dynamic-content:open", S);
|
|
113
|
+
}), Y(() => {
|
|
114
|
+
c == null || c.disconnect(), document.removeEventListener("dynamic-content:open", S);
|
|
113
115
|
try {
|
|
114
116
|
window.UIEditor.removeEditor();
|
|
115
117
|
} catch {
|
|
116
118
|
console.debug("Failed to remove Stripo editor: No editor found");
|
|
117
119
|
}
|
|
118
|
-
|
|
119
|
-
}),
|
|
120
|
+
i.reset();
|
|
121
|
+
}), z({
|
|
120
122
|
dynamicContent: {
|
|
121
|
-
insert:
|
|
122
|
-
close:
|
|
123
|
+
insert: N,
|
|
124
|
+
close: R
|
|
123
125
|
},
|
|
124
|
-
hasChanges:
|
|
125
|
-
saveSilent:
|
|
126
|
-
}), { __sfc: !0, PreviewContainer:
|
|
126
|
+
hasChanges: m,
|
|
127
|
+
saveSilent: D
|
|
128
|
+
}), { __sfc: !0, PreviewContainer: q, OnboardingWrapper: K, headerWrapperRef: w, wrapperRef: u, dynamicContentStore: p, unsubscribeStore: E, props: g, configStore: i, editorStore: f, previewStore: V, hasChanges: m, isTestPartner: $, saveSilent: D, templateId: v, userId: C, partnerName: T, username: k, templateConfig: o, editorConfig: s, html: d, css: F, preselectedDynamicContentList: y, savedModulesFolderName: L, defaultModulesFolderName: U, emit: n, metadata: h, options: _, initPlugin: M, getDefaultTemplate: O, cloneTimersOnSave: P, hasTimerBlocks: A, noHeader: j, insertDynamicContent: N, closeDynamicContent: R, handleDynamicContentOpen: S, ribbonObserver: c, updateRibbonOffset: b, AutoSaveController: re, Toaster: se, FilterSelectionDrawer: ce, HeaderWrapper: ae, LoadingWrapper: ie, SaveAsTemplateDrawer: me, UnsubscribeWrapper: de };
|
|
127
129
|
}
|
|
128
130
|
});
|
|
129
131
|
export {
|
|
130
|
-
|
|
132
|
+
We as default
|
|
131
133
|
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import n from "./AutoSaveController.vue2.js";
|
|
2
|
+
import t from "../../_virtual/_plugin-vue2_normalizer.js";
|
|
3
|
+
var o = function() {
|
|
4
|
+
var r = this, e = r._self._c;
|
|
5
|
+
return r._self._setupProxy, e("div", { staticClass: "d-n" });
|
|
6
|
+
}, s = [], _ = /* @__PURE__ */ t(
|
|
7
|
+
n,
|
|
8
|
+
o,
|
|
9
|
+
s,
|
|
10
|
+
!1,
|
|
11
|
+
null,
|
|
12
|
+
null
|
|
13
|
+
);
|
|
14
|
+
const f = _.exports;
|
|
15
|
+
export {
|
|
16
|
+
f as default
|
|
17
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
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({
|
|
5
|
+
__name: "AutoSaveController",
|
|
6
|
+
setup(a) {
|
|
7
|
+
const { save: e } = s(), o = () => e(!1, !0);
|
|
8
|
+
return r(o), { __sfc: !0, save: e, backgroundSave: o };
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
export {
|
|
12
|
+
f as default
|
|
13
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import o from "./AutoSaveToggle.vue2.js";
|
|
2
|
+
/* empty css */
|
|
3
|
+
import i from "../../../_virtual/_plugin-vue2_normalizer.js";
|
|
4
|
+
var n = function() {
|
|
5
|
+
var e = this, a = e._self._c, t = e._self._setupProxy;
|
|
6
|
+
return t.isFeatureEnabled("autosave") ? a("div", { staticClass: "d-f a-i-c mr-3 auto-save-toggle", on: { mouseenter: function(s) {
|
|
7
|
+
t.isHovered = !0;
|
|
8
|
+
}, mouseleave: function(s) {
|
|
9
|
+
t.isHovered = !1;
|
|
10
|
+
} } }, [a(t.InToggle, { attrs: { id: "guido__autosave-toggle", name: "guido-autosave-toggle", checked: t.autosaveStore.isOn, disable: t.editorStore.loadingStatus }, on: { click: t.toggle } }), a("span", { staticClass: "ml-2 auto-save-toggle__label t-c-55" }, [e._v(" " + e._s(t.trans("email-editor.auto-save")) + " ")]), t.autosaveStore.status === t.AUTOSAVE_STATUS.SAVING ? a("span", { staticClass: "ml-2 d-f a-i-c f-s-1" }, [a(t.InLoading, { attrs: { "color-class": "i-c-53", size: "16" } }), a("span", { staticClass: "ml-1 t-c-53" }, [e._v(" " + e._s(t.trans("newsletter.saving")) + " ")])], 1) : t.lastSavedLabel ? a("span", { staticClass: "ml-2 f-s-1 t-c-53" }, [e._v(" " + e._s(t.lastSavedLabel) + " ")]) : e._e(), t.isHovered ? a(t.InInfoBox, { staticClass: "auto-save-toggle__info-box", attrs: { id: "guido__autosave-info-box", size: "small", variant: "information", "description-text": t.trans("email-editor.auto-save-description"), "title-text": t.trans("email-editor.auto-save-title") } }) : e._e()], 1) : e._e();
|
|
11
|
+
}, l = [], r = /* @__PURE__ */ i(
|
|
12
|
+
o,
|
|
13
|
+
n,
|
|
14
|
+
l,
|
|
15
|
+
!1,
|
|
16
|
+
null,
|
|
17
|
+
"2c964af4"
|
|
18
|
+
);
|
|
19
|
+
const d = r.exports;
|
|
20
|
+
export {
|
|
21
|
+
d as default
|
|
22
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { defineComponent as i, ref as f, computed as u } from "vue";
|
|
2
|
+
import { useConfig as l } from "../../../composables/useConfig.js";
|
|
3
|
+
import { useTranslations as p } from "../../../composables/useTranslations.js";
|
|
4
|
+
import { useAutosaveStore as c, AUTOSAVE_STATUS as t } from "../../../stores/autosave.js";
|
|
5
|
+
import { useEditorStore as S } from "../../../stores/editor.js";
|
|
6
|
+
import { formatLocalTime as d } from "../../../utils/timeUtil.js";
|
|
7
|
+
import { InToggle as g, InLoading as _, InInfoBox as A } from "@useinsider/design-system-vue";
|
|
8
|
+
const U = /* @__PURE__ */ i({
|
|
9
|
+
__name: "AutoSaveToggle",
|
|
10
|
+
setup(v) {
|
|
11
|
+
const { isFeatureEnabled: e } = l(), r = S(), o = c(), s = p(), n = f(!1), a = u(() => o.status !== t.SAVED || !o.lastSavedAt ? "" : d(o.lastSavedAt));
|
|
12
|
+
return { __sfc: !0, isFeatureEnabled: e, editorStore: r, autosaveStore: o, trans: s, isHovered: n, lastSavedLabel: a, toggle: (m) => {
|
|
13
|
+
o.isOn = m;
|
|
14
|
+
}, AUTOSAVE_STATUS: t, InInfoBox: A, InLoading: _, InToggle: g };
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
export {
|
|
18
|
+
U as default
|
|
19
|
+
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
return e("div", { staticClass: "d-f a-i-c" }, [t.isLiquidEnabled && !t.editorStore.isVersionHistoryOpen ? e(t.InChips, { staticClass: "mr-
|
|
6
|
-
}, a = [], n = /* @__PURE__ */
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import s from "./RightSlot.vue2.js";
|
|
2
|
+
import o from "../../../_virtual/_plugin-vue2_normalizer.js";
|
|
3
|
+
var r = function() {
|
|
4
|
+
var i = this, e = i._self._c, t = i._self._setupProxy;
|
|
5
|
+
return e("div", { staticClass: "d-f a-i-c" }, [t.editorStore.isVersionHistoryOpen ? i._e() : e(t.AutoSaveToggle), t.isLiquidEnabled && !t.editorStore.isVersionHistoryOpen ? e(t.InChips, { staticClass: "mr-1", attrs: { id: "guido__liquid-tag-chip", styles: "stroke", type: "default", value: "liquid-tags", "close-button": !1, "disabled-status": t.editorStore.loadingStatus, interactive: !1, text: t.trans("email-editor.liquid-tags-enabled") } }) : i._e(), t.editorStore.isVersionHistoryOpen ? e(t.RestoreButton) : e(t.EditorActions, { ref: "editorActionsRef" })], 1);
|
|
6
|
+
}, a = [], n = /* @__PURE__ */ o(
|
|
7
|
+
s,
|
|
8
|
+
r,
|
|
9
9
|
a,
|
|
10
10
|
!1,
|
|
11
11
|
null,
|
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
import { defineComponent as a, ref as f, computed as p } from "vue";
|
|
2
2
|
import { useConfig as u } from "../../../composables/useConfig.js";
|
|
3
3
|
import { useTranslations as d } from "../../../composables/useTranslations.js";
|
|
4
|
-
import { useEditorStore as
|
|
5
|
-
import { InChips as
|
|
6
|
-
import _ from "./
|
|
7
|
-
import S from "./
|
|
8
|
-
|
|
4
|
+
import { useEditorStore as l } from "../../../stores/editor.js";
|
|
5
|
+
import { InChips as c } from "@useinsider/design-system-vue";
|
|
6
|
+
import _ from "./AutoSaveToggle.vue.js";
|
|
7
|
+
import S from "./EditorActions.vue.js";
|
|
8
|
+
import g from "./version-history/RestoreButton.vue.js";
|
|
9
|
+
const T = /* @__PURE__ */ a({
|
|
9
10
|
__name: "RightSlot",
|
|
10
11
|
setup(h, { expose: r }) {
|
|
11
|
-
const { isFeatureEnabled: o } = u(),
|
|
12
|
+
const { isFeatureEnabled: o } = u(), i = d(), n = l(), t = f(null), s = p(() => o("liquidSyntax"));
|
|
12
13
|
return r({
|
|
13
14
|
handleSave: (m) => {
|
|
14
15
|
var e;
|
|
15
16
|
return (e = t.value) == null ? void 0 : e.handleSave(m);
|
|
16
17
|
}
|
|
17
|
-
}), { __sfc: !0, isFeatureEnabled: o, trans:
|
|
18
|
+
}), { __sfc: !0, isFeatureEnabled: o, trans: i, editorStore: n, editorActionsRef: t, isLiquidEnabled: s, InChips: c, AutoSaveToggle: _, EditorActions: S, RestoreButton: g };
|
|
18
19
|
}
|
|
19
20
|
});
|
|
20
21
|
export {
|
|
21
|
-
|
|
22
|
+
T as default
|
|
22
23
|
};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { useConfig as m } from "./useConfig.js";
|
|
2
|
+
import { useAutosaveStore as A, AUTOSAVE_STATUS as s } from "../stores/autosave.js";
|
|
3
|
+
import { useEditorStore as E } from "../stores/editor.js";
|
|
4
|
+
import { computed as f, watch as p, onUnmounted as y } from "vue";
|
|
5
|
+
const I = 18e4, r = 6e4, T = (b) => {
|
|
6
|
+
const { isFeatureEnabled: S } = m(), a = E(), t = A();
|
|
7
|
+
let i = null, c = 0;
|
|
8
|
+
const u = f(
|
|
9
|
+
() => S("autosave") && t.isOn
|
|
10
|
+
), g = () => a.hasChanges && a.isInSaveableState, h = () => ({
|
|
11
|
+
hasChanges: a.hasChanges,
|
|
12
|
+
isInSaveableState: a.isInSaveableState
|
|
13
|
+
}), l = async (e) => {
|
|
14
|
+
if (!u.value) {
|
|
15
|
+
console.debug("guido:autosave:skipped", { trigger: e, reason: "not-active" });
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
if (!g()) {
|
|
19
|
+
console.debug("guido:autosave:skipped", { trigger: e, reason: "gates-blocked", gates: h() });
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
if (t.status === s.SAVING) {
|
|
23
|
+
console.debug("guido:autosave:skipped", { trigger: e, reason: "already-saving" });
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
console.debug("guido:autosave:save-start", { trigger: e }), t.status = s.SAVING;
|
|
27
|
+
try {
|
|
28
|
+
if (await b() === void 0) {
|
|
29
|
+
console.debug("guido:autosave:blocked", { trigger: e, reason: "save-returned-undefined" }), t.status = s.ERROR;
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
a.hasChanges = !1, t.status = s.SAVED, t.lastSavedAt = /* @__PURE__ */ new Date(), console.debug("guido:autosave:save-complete", { trigger: e, at: t.lastSavedAt });
|
|
33
|
+
} catch (o) {
|
|
34
|
+
console.debug("guido:autosave:error", { trigger: e, error: o }), t.status = s.ERROR;
|
|
35
|
+
}
|
|
36
|
+
}, n = () => {
|
|
37
|
+
const { visibilityState: e } = document;
|
|
38
|
+
if (console.debug("guido:autosave:visibility-change", {
|
|
39
|
+
visibilityState: e,
|
|
40
|
+
isActive: u.value
|
|
41
|
+
}), e !== "hidden")
|
|
42
|
+
return;
|
|
43
|
+
const o = Date.now() - c;
|
|
44
|
+
if (o < r) {
|
|
45
|
+
console.debug("guido:autosave:visibility-debounced", {
|
|
46
|
+
sinceLastMs: o,
|
|
47
|
+
debounceMs: r
|
|
48
|
+
});
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
c = Date.now(), l("visibility");
|
|
52
|
+
}, d = () => {
|
|
53
|
+
i && (clearInterval(i), i = null);
|
|
54
|
+
}, v = () => {
|
|
55
|
+
document.removeEventListener("visibilitychange", n), window.removeEventListener("pagehide", n);
|
|
56
|
+
};
|
|
57
|
+
p(
|
|
58
|
+
u,
|
|
59
|
+
(e) => {
|
|
60
|
+
console.debug("guido:autosave:active-changed", { active: e }), e ? (d(), i = setInterval(() => {
|
|
61
|
+
console.debug("guido:autosave:interval-tick"), l("interval");
|
|
62
|
+
}, I), document.addEventListener("visibilitychange", n), window.addEventListener("pagehide", n)) : (d(), v(), t.status = s.IDLE);
|
|
63
|
+
},
|
|
64
|
+
{ immediate: !0 }
|
|
65
|
+
), y(() => {
|
|
66
|
+
d(), v(), t.status = s.IDLE, t.lastSavedAt = null;
|
|
67
|
+
});
|
|
68
|
+
};
|
|
69
|
+
export {
|
|
70
|
+
T as useAutoSave
|
|
71
|
+
};
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { RecommendationFeedSourceMaps as
|
|
1
|
+
import { RecommendationFeedSourceMaps as I, URLS as C } from "../enums/extensions/recommendationBlock.js";
|
|
2
2
|
import { MinDeviceViewport as R, DefaultPadding as b } from "../enums/recommendation.js";
|
|
3
|
-
import { useRecommendationExtensionStore as
|
|
4
|
-
import { generateCompleteFilterQuery as
|
|
5
|
-
import { useConfigStore as
|
|
6
|
-
const
|
|
3
|
+
import { useRecommendationExtensionStore as m } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
4
|
+
import { generateCompleteFilterQuery as h } from "../extensions/Blocks/Recommendation/utils/filterUtil.js";
|
|
5
|
+
import { useConfigStore as x } from "../stores/config.js";
|
|
6
|
+
const w = () => ({
|
|
7
7
|
calculateCardWidth: ({
|
|
8
|
-
mobileLeftPadding:
|
|
9
|
-
mobileRightPadding:
|
|
10
|
-
cardsInRow:
|
|
11
|
-
unresponsive:
|
|
8
|
+
mobileLeftPadding: s,
|
|
9
|
+
mobileRightPadding: a,
|
|
10
|
+
cardsInRow: c,
|
|
11
|
+
unresponsive: n
|
|
12
12
|
}) => {
|
|
13
|
-
const r =
|
|
13
|
+
const r = n ? c : 1, e = s + a + (r - 1) * b;
|
|
14
14
|
return (R - e) / r;
|
|
15
15
|
},
|
|
16
|
-
getRecommendationCampaignData: (
|
|
17
|
-
const
|
|
18
|
-
if (!
|
|
16
|
+
getRecommendationCampaignData: (s) => {
|
|
17
|
+
const a = m(), c = Number(s), n = a.blockStates[c];
|
|
18
|
+
if (!n)
|
|
19
19
|
return {
|
|
20
20
|
textTrimming: !1,
|
|
21
21
|
orientation: "vertical",
|
|
@@ -28,7 +28,7 @@ const N = () => ({
|
|
|
28
28
|
discountBeforeTextValue: "",
|
|
29
29
|
discountAfterTextValue: ""
|
|
30
30
|
};
|
|
31
|
-
const { recommendationConfigs: r } =
|
|
31
|
+
const { recommendationConfigs: r } = n, e = r.orientation === "grid" ? "vertical" : "horizontal";
|
|
32
32
|
return {
|
|
33
33
|
textTrimming: r.textTrimming,
|
|
34
34
|
orientation: e,
|
|
@@ -42,19 +42,39 @@ const N = () => ({
|
|
|
42
42
|
discountAfterTextValue: ""
|
|
43
43
|
};
|
|
44
44
|
},
|
|
45
|
-
buildCampaignUrl: (
|
|
46
|
-
var
|
|
47
|
-
const
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
45
|
+
buildCampaignUrl: (s, a) => {
|
|
46
|
+
var l;
|
|
47
|
+
const c = m(), n = x(), r = Number(s);
|
|
48
|
+
let e;
|
|
49
|
+
if (a)
|
|
50
|
+
e = a;
|
|
51
|
+
else {
|
|
52
|
+
const i = c.blockStates[r];
|
|
53
|
+
if (!i)
|
|
54
|
+
return "";
|
|
55
|
+
const { recommendationConfigs: o } = i;
|
|
56
|
+
e = {
|
|
57
|
+
strategy: o.strategy,
|
|
58
|
+
language: o.language,
|
|
59
|
+
currencyCode: o.currencySettings.value,
|
|
60
|
+
size: o.size,
|
|
61
|
+
productIds: o.productIds,
|
|
62
|
+
filters: o.filters,
|
|
63
|
+
shuffleProducts: o.shuffleProducts
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
const f = ((l = I.find((i) => i.key === e.strategy)) == null ? void 0 : l.path) || "", t = new URLSearchParams();
|
|
67
|
+
if (t.set("locale", e.language), t.set("currency", e.currencyCode), t.set("partnerName", n.partnerName), t.set("size", e.size), t.set("details", "true"), t.set("campaignId", n.variationId), e.strategy === "manualMerchandising") {
|
|
68
|
+
const i = parseInt(e.size) || 6;
|
|
69
|
+
t.set("productId", e.productIds.slice(0, i).join(","));
|
|
70
|
+
} else e.strategy === "similarViewed" && t.set("productId", "{itemId}");
|
|
71
|
+
e.strategy === "userBased" && t.set("userId", "{user_id}");
|
|
72
|
+
const g = e.filters.filter((i) => i.isValid), d = h(g);
|
|
73
|
+
d && t.set("filter", d), e.shuffleProducts && t.set("shuffle", "true");
|
|
74
|
+
const p = decodeURIComponent(t.toString()), u = `${C.RECOMMENDATION_API_URL}/v2/${f}?${p}`;
|
|
75
|
+
return c.recommendationCampaignUrls[s] = u, u;
|
|
56
76
|
}
|
|
57
77
|
});
|
|
58
78
|
export {
|
|
59
|
-
|
|
79
|
+
w as useRecommendation
|
|
60
80
|
};
|
|
@@ -1,29 +1,32 @@
|
|
|
1
|
-
import { useActionsApi as
|
|
2
|
-
import { useConfig as
|
|
3
|
-
import { useSaveStart as
|
|
4
|
-
import { useSyncModuleExtractor as
|
|
1
|
+
import { useActionsApi as x } from "./useActionsApi.js";
|
|
2
|
+
import { useConfig as y } from "./useConfig.js";
|
|
3
|
+
import { useSaveStart as w, useSaveComplete as C } from "./useGuidoActions.js";
|
|
4
|
+
import { useSyncModuleExtractor as H } from "./useSyncModuleExtractor.js";
|
|
5
5
|
import { useStripoApi as b } from "../services/stripoApi.js";
|
|
6
6
|
import { useTemplatePreparation as q } from "../utils/templatePreparation.js";
|
|
7
|
-
import { useHtmlValidator as
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
import { useHtmlValidator as L } from "./useHtmlValidator.js";
|
|
8
|
+
import { useCouponBlockValidator as P } from "./validators/useCouponBlockValidator.js";
|
|
9
|
+
import { useLiquidValidator as E } from "./validators/useLiquidValidator.js";
|
|
10
|
+
const j = () => {
|
|
11
|
+
const o = w(), s = C(), { validateHtml: r } = L(), { validateLiquidSyntax: l } = E(), { validateCouponBlockTags: n } = P(), { callbacks: a, isFeatureEnabled: d } = y(), { extractSyncModuleData: u } = H(), { setSyncModuleUnsubscriptionPages: c } = b(), { editorSave: m } = x();
|
|
12
|
+
return { save: async (p = !1, f = !1) => {
|
|
12
13
|
var i;
|
|
13
14
|
o();
|
|
14
|
-
const { prepareTemplateDetails:
|
|
15
|
-
if (
|
|
16
|
-
|
|
15
|
+
const { prepareTemplateDetails: v } = q(), t = await v();
|
|
16
|
+
if (!n(t.compiledHtml))
|
|
17
|
+
return;
|
|
18
|
+
if (d("liquidSyntax")) {
|
|
19
|
+
if (!await l(t.compiledHtml))
|
|
17
20
|
return;
|
|
18
21
|
} else if (!await r(t.compiledHtml, t.dynamicContentList, !0))
|
|
19
22
|
return;
|
|
20
23
|
if ((i = a.value) != null && i.externalValidation && !await a.value.externalValidation(t))
|
|
21
24
|
return;
|
|
22
|
-
await
|
|
23
|
-
const { unsubscribePayload:
|
|
24
|
-
return await
|
|
25
|
+
await m();
|
|
26
|
+
const { unsubscribePayload: S, stripoModules: V } = u(t.rawHtml);
|
|
27
|
+
return await c(S), t.modules = V, p || s({ ...t, silent: f }), t;
|
|
25
28
|
} };
|
|
26
29
|
};
|
|
27
30
|
export {
|
|
28
|
-
|
|
31
|
+
j as useSave
|
|
29
32
|
};
|