@useinsider/guido 3.18.2-beta.c3e75f6 → 3.18.2-beta.dfce34a

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.
Files changed (49) hide show
  1. package/dist/components/Guido.vue.js +3 -3
  2. package/dist/components/Guido.vue2.js +30 -30
  3. package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.js +13 -11
  4. package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue2.js +76 -52
  5. package/dist/components/organisms/extensions/recommendation/RemoveStrategyModal.vue2.js +23 -37
  6. package/dist/components/organisms/header/EditorActions.vue.js +4 -4
  7. package/dist/components/organisms/header/EditorActions.vue2.js +25 -23
  8. package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +20 -18
  9. package/dist/components/organisms/onboarding/RecommendationStrategyOnboarding.vue.js +21 -0
  10. package/dist/components/organisms/onboarding/RecommendationStrategyOnboarding.vue2.js +47 -0
  11. package/dist/composables/useActionsApi.js +47 -52
  12. package/dist/composables/useCodeEditorApi.js +9 -23
  13. package/dist/composables/useCustomInterfaceAppearance.js +56 -46
  14. package/dist/composables/useHtmlValidator.js +87 -82
  15. package/dist/composables/useRecommendation.js +40 -35
  16. package/dist/composables/useStripo.js +30 -30
  17. package/dist/composables/useTranslations.js +2 -3
  18. package/dist/composables/useVersionHistoryApi.js +24 -33
  19. package/dist/enums/extensions/recommendationBlock.js +38 -31
  20. package/dist/extensions/Blocks/Recommendation/block.js +61 -42
  21. package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +21 -20
  22. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +40 -35
  23. package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +84 -52
  24. package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +74 -74
  25. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +254 -140
  26. package/dist/extensions/Blocks/Recommendation/utils/nodeConfigWriter.js +26 -16
  27. package/dist/extensions/Blocks/Recommendation/utils/strategyCommit.js +24 -0
  28. package/dist/extensions/Blocks/Recommendation/validation/requiredFields.js +21 -12
  29. package/dist/guido.css +1 -1
  30. package/dist/src/components/organisms/onboarding/RecommendationStrategyOnboarding.vue.d.ts +2 -0
  31. package/dist/src/enums/extensions/recommendationBlock.d.ts +2 -0
  32. package/dist/src/extensions/Blocks/Recommendation/block.d.ts +10 -0
  33. package/dist/src/extensions/Blocks/Recommendation/constants/defaultConfig.d.ts +1 -0
  34. package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +1 -1
  35. package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +2 -0
  36. package/dist/src/extensions/Blocks/Recommendation/controls/main/strategy.d.ts +9 -0
  37. package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +7 -2
  38. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +86 -0
  39. package/dist/src/extensions/Blocks/Recommendation/utils/strategyCommit.d.ts +14 -0
  40. package/dist/src/extensions/Blocks/Recommendation/validation/requiredFields.d.ts +4 -0
  41. package/dist/src/stores/onboarding.d.ts +377 -0
  42. package/dist/static/styles/components/recommendation-strategy.css.js +34 -4
  43. package/dist/static/styles/components/skeleton.css.js +23 -0
  44. package/dist/stores/onboarding.js +41 -36
  45. package/dist/stores/unsubscribe.js +3 -3
  46. package/dist/utils/templatePreparation.js +55 -55
  47. package/package.json +5 -5
  48. package/dist/src/utils/stripoEditorApi.d.ts +0 -4
  49. package/dist/utils/stripoEditorApi.js +0 -11
@@ -0,0 +1,21 @@
1
+ import d from "./RecommendationStrategyOnboarding.vue2.js";
2
+ /* empty css */
3
+ import g from "../../../_virtual/_plugin-vue2_normalizer.js";
4
+ var m = function() {
5
+ var e, n, r, i, a;
6
+ var t = this, s = t._self._c, o = t._self._setupProxy;
7
+ return o.isVisible ? s(o.InOnboard, { key: "guido__recommendation-strategy-onboard", staticClass: "w-21-s p-a z-11", class: (e = o.onboardingStore.getRecommendationStrategyCurrentCard) == null ? void 0 : e.classes, attrs: { id: "guido__recommendation-strategy-onboard", "is-multiple-page": "", visible: "", "image-source": "", title: "", "left-position": (n = o.onboardingStore.getRecommendationStrategyCurrentCard) == null ? void 0 : n.left, "pages-config": o.onboardingStore.onboardings.recommendationStrategyOnboarding.config, "pointer-position": (r = o.onboardingStore.getRecommendationStrategyCurrentCard) == null ? void 0 : r.position, "right-position": (i = o.onboardingStore.getRecommendationStrategyCurrentCard) == null ? void 0 : i.right, "top-position": (a = o.onboardingStore.getRecommendationStrategyCurrentCard) == null ? void 0 : a.top }, on: { close: function(p) {
8
+ return o.onboardingStore.close(o.ONBOARDING_TYPE);
9
+ }, nextButtonClick: o.handleNext } }) : t._e();
10
+ }, c = [], _ = /* @__PURE__ */ g(
11
+ d,
12
+ m,
13
+ c,
14
+ !1,
15
+ null,
16
+ "ec2027ff"
17
+ );
18
+ const S = _.exports;
19
+ export {
20
+ S as default
21
+ };
@@ -0,0 +1,47 @@
1
+ import { defineComponent as g, computed as p, watch as b } from "vue";
2
+ import { useRibbonOffset as u } from "../../../composables/useRibbonOffset.js";
3
+ import { useTranslations as l } from "../../../composables/useTranslations.js";
4
+ import { ACADEMY_LINKS as f } from "../../../enums/academy.js";
5
+ import { useRecommendationExtensionStore as O } from "../../../extensions/Blocks/Recommendation/store/recommendation.js";
6
+ import { useOnboardingStore as _ } from "../../../stores/onboarding.js";
7
+ import { InOnboard as y } from "@useinsider/design-system-vue";
8
+ const h = /* @__PURE__ */ g({
9
+ __name: "RecommendationStrategyOnboarding",
10
+ setup(C) {
11
+ const n = "recommendationStrategyOnboarding", e = l(), t = _(), i = O(), { getTopPosition: r } = u(), a = `<a href="${f.EMAIL_RECOMMENDATION_BLOCK}" target="_blank" rel="noopener noreferrer">${e("action-builder.visit-academy")}</a>`, m = () => [
12
+ {
13
+ classes: "guido-recommendation-strategy-onboarding",
14
+ // Sits in the gap left of the settings panel and points at the strategy section, which
15
+ // starts 208px down: the panel header and its tab row are fixed chrome above it.
16
+ right: "426px",
17
+ top: r(208),
18
+ position: "Right Top",
19
+ title: e("email-editor.onboarding-recommendation-strategy-title"),
20
+ description: e("email-editor.onboarding-recommendation-strategy-description", {
21
+ academyLink: a
22
+ }),
23
+ imageSource: "",
24
+ backButtonClick: () => {
25
+ },
26
+ nextButtonType: "text",
27
+ nextButtonText: e("action-builder.ok"),
28
+ nextButtonClick: () => {
29
+ t.close(n);
30
+ }
31
+ }
32
+ ], c = p(() => i.strategyPanelOpen && t.onboardings.recommendationStrategyOnboarding.config.length > 0 && t.onboardings.recommendationStrategyOnboarding.isActive), d = () => {
33
+ var o, s;
34
+ (s = (o = t.getRecommendationStrategyCurrentCard) == null ? void 0 : o.nextButtonClick) == null || s.call(o);
35
+ };
36
+ return b(
37
+ () => t.isActive(n),
38
+ (o) => {
39
+ o && t.setConfig(n, m());
40
+ },
41
+ { immediate: !0 }
42
+ ), { __sfc: !0, ONBOARDING_TYPE: n, trans: e, onboardingStore: t, recommendationStore: i, getTopPosition: r, academyLink: a, buildOnboardingCards: m, isVisible: c, handleNext: d, InOnboard: y };
43
+ }
44
+ });
45
+ export {
46
+ h as default
47
+ };
@@ -1,23 +1,18 @@
1
- import { filterAmpErrors as y } from "../utils/ampErrorFilter.js";
2
- import { getEditorApi as s } from "../utils/stripoEditorApi.js";
3
- import { useToaster as D } from "./useToaster.js";
4
- const h = 1e4, T = 3e4, r = (n, l, A) => new Promise((C, p) => {
5
- const f = setTimeout(
6
- () => p(new Error(`${n} did not report completion within ${l}ms`)),
1
+ import { filterAmpErrors as v } from "../utils/ampErrorFilter.js";
2
+ import { useToaster as y } from "./useToaster.js";
3
+ const D = 1e4, d = 3e4, s = (n, l, u) => new Promise((T, m) => {
4
+ const w = setTimeout(
5
+ () => m(new Error(`${n} did not report completion within ${l}ms`)),
7
6
  l
8
- ), c = (t) => (e) => {
9
- clearTimeout(f), t(e);
10
- }, d = c(p);
11
- try {
12
- A(c(C), d);
13
- } catch (t) {
14
- d(t);
15
- }
16
- }), P = () => {
17
- const { handleError: n } = D(), l = (t = {}) => r(
7
+ ), p = (A) => (t) => {
8
+ clearTimeout(w), A(t);
9
+ };
10
+ u(p(T), p(m));
11
+ }), I = () => {
12
+ const { handleError: n } = y(), l = (t = {}) => s(
18
13
  "compileEmail",
19
- T,
20
- (e, i) => {
14
+ d,
15
+ (e, a) => {
21
16
  const o = { ...{
22
17
  minimize: !0,
23
18
  utmEntity: {
@@ -37,53 +32,53 @@ const h = 1e4, T = 3e4, r = (n, l, A) => new Promise((C, p) => {
37
32
  forceAmp: !1,
38
33
  resetDataSavedFlag: !1,
39
34
  disableLineHeightsReplace: !0
40
- }, ...t }, u = {
41
- callback: (m, g, w, S, v) => {
42
- m ? i(m) : e({
43
- html: g,
44
- ampHtml: w,
45
- ampErrors: y(S ?? []),
46
- displayConditions: v
35
+ }, ...t }, c = {
36
+ callback: (r, C, f, S, g) => {
37
+ r ? a(r) : e({
38
+ html: C,
39
+ ampHtml: f,
40
+ ampErrors: v(S ?? []),
41
+ displayConditions: g
47
42
  });
48
43
  },
49
44
  ...o
50
45
  };
51
- s().actionsApi.compileEmail(u);
46
+ window.StripoEditorApi.actionsApi.compileEmail(c);
52
47
  }
53
48
  );
54
49
  return {
55
50
  getCompiledEmail: l,
56
- getTemplateData: () => r(
51
+ getTemplateData: () => s(
57
52
  "getTemplateData",
58
- T,
53
+ d,
59
54
  (t) => {
60
- const e = ({ html: i, css: a, width: o, height: E, utmParams: u, syncModulesIds: m }) => t({
61
- html: i,
62
- css: a,
55
+ const e = ({ html: a, css: i, width: o, height: E, utmParams: c, syncModulesIds: r }) => t({
56
+ html: a,
57
+ css: i,
63
58
  width: o,
64
59
  height: E,
65
- utmParams: u,
66
- syncModulesIds: m
60
+ utmParams: c,
61
+ syncModulesIds: r
67
62
  });
68
- s().actionsApi.getTemplateData(e);
63
+ window.StripoEditorApi.actionsApi.getTemplateData(e);
69
64
  }
70
65
  ),
71
66
  activateCustomViewStyles: (t = !0) => {
72
- s().actionsApi.activateCustomViewStyles(t);
67
+ window.StripoEditorApi.actionsApi.activateCustomViewStyles(t);
73
68
  },
74
69
  getPreviewData: async (t) => {
75
70
  try {
76
71
  const {
77
72
  html: e,
78
- displayConditions: i,
79
- ampHtml: a = "",
73
+ displayConditions: a,
74
+ ampHtml: i = "",
80
75
  ampErrors: o = []
81
76
  } = await l({ minimize: !1, resetDataSavedFlag: !1, ...t });
82
77
  return {
83
78
  html: e,
84
- ampHtml: a,
79
+ ampHtml: i,
85
80
  ampErrors: o,
86
- displayConditions: i
81
+ displayConditions: a
87
82
  };
88
83
  } catch (e) {
89
84
  return n(e, "Error loading preview"), {
@@ -95,30 +90,30 @@ const h = 1e4, T = 3e4, r = (n, l, A) => new Promise((C, p) => {
95
90
  }
96
91
  },
97
92
  updateTimerInClonedTemplate: () => new Promise((t) => {
98
- var e, i;
99
- if (typeof ((i = (e = window.StripoEditorApi) == null ? void 0 : e.actionsApi) == null ? void 0 : i.updateTimerInClonedTemplate) != "function") {
93
+ var e, a;
94
+ if (typeof ((a = (e = window.StripoEditorApi) == null ? void 0 : e.actionsApi) == null ? void 0 : a.updateTimerInClonedTemplate) != "function") {
100
95
  t(null);
101
96
  return;
102
97
  }
103
98
  try {
104
- window.StripoEditorApi.actionsApi.updateTimerInClonedTemplate((a, o) => {
105
- a ? (n(a, "Failed to update timer in cloned template"), t(null)) : t(o || null);
99
+ window.StripoEditorApi.actionsApi.updateTimerInClonedTemplate((i, o) => {
100
+ i ? (n(i, "Failed to update timer in cloned template"), t(null)) : t(o || null);
106
101
  });
107
- } catch (a) {
108
- n(a, "Failed to call updateTimerInClonedTemplate"), t(null);
102
+ } catch (i) {
103
+ n(i, "Failed to call updateTimerInClonedTemplate"), t(null);
109
104
  }
110
105
  }),
111
106
  updateHtmlAndCss: (t, e) => {
112
- const { actionsApi: i } = s();
113
- return r("updateHtmlAndCss", h, (a) => {
114
- i.updateHtmlAndCss(t, e, () => a());
107
+ const { actionsApi: a } = window.StripoEditorApi;
108
+ return s("updateHtmlAndCss", D, (i) => {
109
+ a.updateHtmlAndCss(t, e, () => i());
115
110
  });
116
111
  },
117
- editorSave: () => r(
112
+ editorSave: () => s(
118
113
  "save",
119
- T,
114
+ d,
120
115
  (t) => {
121
- s().actionsApi.save((e) => {
116
+ window.StripoEditorApi.actionsApi.save((e) => {
122
117
  if (e) {
123
118
  n(e, "Failed to save template"), t(!1);
124
119
  return;
@@ -130,5 +125,5 @@ const h = 1e4, T = 3e4, r = (n, l, A) => new Promise((C, p) => {
130
125
  };
131
126
  };
132
127
  export {
133
- P as useActionsApi
128
+ I as useActionsApi
134
129
  };
@@ -1,25 +1,11 @@
1
- import { ToasterTypeOptions as d } from "../enums/toaster.js";
2
- import { findEditorApi as s, EDITOR_NOT_READY_MESSAGE as p } from "../utils/stripoEditorApi.js";
3
- import { useToaster as E } from "./useToaster.js";
4
- const T = () => {
5
- const { showToaster: i } = E(), t = (o) => {
6
- var r;
7
- const e = (r = s()) == null ? void 0 : r.codeEditorApi;
8
- if (!e) {
9
- i({ type: d.Error, message: p });
10
- return;
11
- }
12
- o(e);
13
- };
14
- return {
15
- openCodeEditor: () => {
16
- t((o) => o.openCodeEditor());
17
- },
18
- closeCodeEditor: () => {
19
- t((o) => o.closeCodeEditor());
20
- }
21
- };
22
- };
1
+ const i = () => ({
2
+ openCodeEditor: () => {
3
+ window.StripoEditorApi.codeEditorApi.openCodeEditor();
4
+ },
5
+ closeCodeEditor: () => {
6
+ window.StripoEditorApi.codeEditorApi.closeCodeEditor();
7
+ }
8
+ });
23
9
  export {
24
- T as useCodeEditorApi
10
+ i as useCodeEditorApi
25
11
  };
@@ -1,67 +1,77 @@
1
- import S from "../static/assets/icons/line-change.svg.js";
2
- import i from "../static/assets/icons/line-delete.svg.js";
3
- import n from "../static/assets/icons/line-plus.svg.js";
4
- import p from "../static/styles/base.css.js";
5
- import s from "../static/styles/components/alert-message.css.js";
6
- import C from "../static/styles/components/amp-block.css.js";
7
- import a from "../static/styles/components/base-input.css.js";
8
- import f from "../static/styles/components/button-group.css.js";
9
- import c from "../static/styles/components/button.css.js";
10
- import u from "../static/styles/components/combobox.css.js";
11
- import l from "../static/styles/components/counter.css.js";
12
- import d from "../static/styles/components/dropdown-menu.css.js";
13
- import h from "../static/styles/components/loader.css.js";
14
- import g from "../static/styles/components/narrow-panel.css.js";
15
- import I from "../static/styles/components/popup.css.js";
16
- import w from "../static/styles/components/recommendation-strategy.css.js";
17
- import y from "../static/styles/components/switcher.css.js";
18
- import b from "../static/styles/components/tabs.css.js";
19
- import B from "../static/styles/components/tools.css.js";
20
- import $ from "../static/styles/components/version-history.css.js";
21
- import P from "../static/styles/components/wide-panel.css.js";
1
+ import p from "../static/assets/icons/line-change.svg.js";
2
+ import s from "../static/assets/icons/line-delete.svg.js";
3
+ import a from "../static/assets/icons/line-plus.svg.js";
4
+ import f from "../static/styles/base.css.js";
5
+ import C from "../static/styles/components/alert-message.css.js";
6
+ import c from "../static/styles/components/amp-block.css.js";
7
+ import l from "../static/styles/components/base-input.css.js";
8
+ import d from "../static/styles/components/button-group.css.js";
9
+ import u from "../static/styles/components/button.css.js";
10
+ import h from "../static/styles/components/combobox.css.js";
11
+ import g from "../static/styles/components/counter.css.js";
12
+ import w from "../static/styles/components/dropdown-menu.css.js";
13
+ import y from "../static/styles/components/loader.css.js";
14
+ import I from "../static/styles/components/narrow-panel.css.js";
15
+ import A from "../static/styles/components/popup.css.js";
16
+ import b from "../static/styles/components/recommendation-strategy.css.js";
17
+ import B from "../static/styles/components/skeleton.css.js";
18
+ import D from "../static/styles/components/switcher.css.js";
19
+ import $ from "../static/styles/components/tabs.css.js";
20
+ import P from "../static/styles/components/tools.css.js";
21
+ import R from "../static/styles/components/version-history.css.js";
22
+ import T from "../static/styles/components/wide-panel.css.js";
22
23
  import x from "../static/styles/variables.css.js";
23
- function r(t, o) {
24
- return `--guido-icon-${t}: url("data:image/svg+xml,${encodeURIComponent(o.trim())}");`;
24
+ function r(S, o) {
25
+ return `--guido-icon-${S}: url("data:image/svg+xml,${encodeURIComponent(o.trim())}");`;
25
26
  }
26
- const A = `:host {
27
- ${r("line-change", S)}
28
- ${r("line-delete", i)}
29
- ${r("line-plus", n)}
30
- }`, R = [
27
+ const M = `:host {
28
+ ${r("line-change", p)}
29
+ ${r("line-delete", s)}
30
+ ${r("line-plus", a)}
31
+ }`, O = [
31
32
  x,
32
33
  // Must be on top
33
- A,
34
- p,
34
+ M,
35
+ f,
35
36
  // Must be on top
36
- s,
37
37
  C,
38
- a,
39
- f,
40
38
  c,
41
- u,
42
39
  l,
43
40
  d,
41
+ u,
44
42
  h,
45
43
  g,
46
- I,
44
+ w,
47
45
  y,
48
- b,
46
+ I,
47
+ A,
49
48
  B,
49
+ D,
50
50
  $,
51
51
  P,
52
- w
52
+ R,
53
+ T,
54
+ b
53
55
  // Last: overrides button.css / wide-panel.css defaults
54
56
  ].join(`
55
57
 
56
- `), Y = () => ({ importCss: () => {
57
- const o = new CSSStyleSheet();
58
- o.replaceSync(R);
59
- const e = document.querySelector("ui-editor");
60
- if (!e)
61
- return;
62
- const m = e.shadowRoot;
63
- m && (m.adoptedStyleSheets = [o]);
58
+ `), V = 3e4;
59
+ let e = null;
60
+ function W() {
61
+ return e || (e = new CSSStyleSheet(), e.replaceSync(O)), e;
62
+ }
63
+ const So = () => ({ importCss: () => {
64
+ const o = W(), i = Date.now() + V, m = () => {
65
+ var n;
66
+ const t = (n = document.querySelector("ui-editor")) == null ? void 0 : n.shadowRoot;
67
+ if (t) {
68
+ t.adoptedStyleSheets.includes(o) || (t.adoptedStyleSheets = [...t.adoptedStyleSheets, o]);
69
+ return;
70
+ }
71
+ Date.now() < i && requestAnimationFrame(m);
72
+ };
73
+ m();
64
74
  } });
65
75
  export {
66
- Y as useCustomInterfaceAppearance
76
+ So as useCustomInterfaceAppearance
67
77
  };