@useinsider/guido 3.6.1-beta.03230b7 → 3.7.0-beta.2037cb1

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 (52) hide show
  1. package/README.md +14 -0
  2. package/dist/components/Guido.vue.js +1 -1
  3. package/dist/components/Guido.vue2.js +75 -72
  4. package/dist/components/organisms/header/EditorActions.vue.js +1 -1
  5. package/dist/components/organisms/header/EditorActions.vue2.js +6 -6
  6. package/dist/components/organisms/header/LeftSlot.vue.js +5 -5
  7. package/dist/components/organisms/header/LeftSlot.vue2.js +9 -9
  8. package/dist/composables/useActionsApi.js +16 -15
  9. package/dist/composables/useHtmlCompiler.js +40 -22
  10. package/dist/composables/useRecommendation.js +34 -33
  11. package/dist/composables/useStripo.js +44 -39
  12. package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +127 -123
  13. package/dist/extensions/Blocks/Recommendation/controls/main/layoutOrientation.js +12 -11
  14. package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +46 -46
  15. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +13 -9
  16. package/dist/extensions/Blocks/Recommendation/templates/grid/elementRenderer.js +35 -29
  17. package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +28 -28
  18. package/dist/extensions/Blocks/Recommendation/templates/list/elementRenderer.js +8 -8
  19. package/dist/extensions/Blocks/Recommendation/templates/utils.js +56 -49
  20. package/dist/extensions/Blocks/Recommendation/utils/partnerCustomizations.js +21 -0
  21. package/dist/extensions/Blocks/Recommendation/utils/priceFormatter.js +17 -17
  22. package/dist/extensions/Blocks/Recommendation/validation/requiredFields.js +9 -9
  23. package/dist/guido.css +1 -1
  24. package/dist/src/components/Guido.vue.d.ts +1 -0
  25. package/dist/src/composables/useHtmlCompiler.d.ts +1 -0
  26. package/dist/src/extensions/Blocks/Recommendation/templates/grid/elementRenderer.d.ts +7 -0
  27. package/dist/src/extensions/Blocks/Recommendation/templates/index.d.ts +1 -1
  28. package/dist/src/extensions/Blocks/Recommendation/templates/utils.d.ts +8 -0
  29. package/dist/src/extensions/Blocks/Recommendation/utils/partnerCustomizations.d.ts +7 -0
  30. package/dist/src/extensions/Blocks/Recommendation/validation/requiredFields.d.ts +2 -3
  31. package/dist/src/utils/ampErrorFilter.d.ts +2 -0
  32. package/dist/src/utils/templatePreparation.d.ts +16 -0
  33. package/dist/stores/dynamic-content.js +1 -1
  34. package/dist/utils/ampErrorFilter.js +8 -0
  35. package/dist/utils/templatePreparation.js +59 -58
  36. package/package.json +1 -1
  37. package/dist/src/composables/useApiExample.d.ts +0 -63
  38. package/dist/src/composables/useRecommendation.test.d.ts +0 -1
  39. package/dist/src/config/migrator/recommendation/compositionMapper.test.d.ts +0 -1
  40. package/dist/src/config/migrator/recommendation/extractors.test.d.ts +0 -1
  41. package/dist/src/config/migrator/recommendation/parseLegacyConfig.test.d.ts +0 -1
  42. package/dist/src/config/migrator/recommendation/settingsMapper.test.d.ts +0 -1
  43. package/dist/src/config/migrator/recommendation/themeMapper.test.d.ts +0 -1
  44. package/dist/src/config/migrator/recommendationMigrator.test.d.ts +0 -1
  45. package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.test.d.ts +0 -1
  46. package/dist/src/extensions/Blocks/Recommendation/services/configService.test.d.ts +0 -1
  47. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.test.d.ts +0 -1
  48. package/dist/src/extensions/Blocks/Recommendation/utils/filterUtil.test.d.ts +0 -1
  49. package/dist/src/extensions/Blocks/Recommendation/utils/legacyStrategyMap.test.d.ts +0 -1
  50. package/dist/src/stores/config.test.d.ts +0 -1
  51. package/dist/src/utils/htmlEscape.test.d.ts +0 -1
  52. package/dist/src/vitest.setup.d.ts +0 -0
@@ -1,42 +1,42 @@
1
1
  import { useActionsApi as D } from "./useActionsApi.js";
2
- import { useBlocksConfig as I } from "./useBlocksConfig.js";
3
- import { useConfig as P } from "./useConfig.js";
2
+ import { useBlocksConfig as P } from "./useBlocksConfig.js";
3
+ import { useConfig as I } from "./useConfig.js";
4
4
  import { useCustomInterfaceAppearance as U } from "./useCustomInterfaceAppearance.js";
5
5
  import { useFullStoryBridge as R } from "./useFullStoryBridge.js";
6
6
  import { useStripoEventHandler as q } from "./useStripoEventHandler.js";
7
7
  import { useToaster as x } from "./useToaster.js";
8
8
  import { localePatch as H } from "../config/i18n/index.js";
9
9
  import { useStripoApi as O } from "../services/stripoApi.js";
10
- import j from "../static/styles/customEditorStyle.css.js";
11
- import { useEditorStore as E } from "../stores/editor.js";
12
- import { dynamicContentToMergeTags as z } from "../utils/genericUtil.js";
13
- import L from "../package.json.js";
14
- const se = (C, l) => {
15
- const { features: c, template: h, isFeatureEnabled: u } = P(), { handleError: m } = x(), { getToken: w, getCustomFonts: b, getSyncModulesStatus: k } = O(), { handleEvent: F } = q(), { getStripoBlocksConfig: B } = I(), T = async (i, r = [], s = !1) => {
10
+ import z from "../static/styles/customEditorStyle.css.js";
11
+ import { useEditorStore as h } from "../stores/editor.js";
12
+ import { dynamicContentToMergeTags as L } from "../utils/genericUtil.js";
13
+ import $ from "../package.json.js";
14
+ const se = (E, c) => {
15
+ const { features: u, template: C, isFeatureEnabled: m } = I(), { handleError: l } = x(), { getToken: w, getCustomFonts: b, getSyncModulesStatus: F } = O(), { handleEvent: k } = q(), { getStripoBlocksConfig: v } = P(), B = async (s, r = [], o = !1) => {
16
16
  var g, S, y;
17
- const e = E(), { html: p, css: a } = i, { baseBlocks: o, extensions: d } = await B(), f = ((g = c.value) == null ? void 0 : g.displayConditions) ?? !0, _ = ((S = c.value) == null ? void 0 : S.modulesDisabled) ?? !1, v = ((y = h.value) == null ? void 0 : y.forceRecreate) ?? !1;
17
+ const e = h(), { html: p, css: a } = s, { baseBlocks: i, extensions: d } = await v(), f = ((g = u.value) == null ? void 0 : g.displayConditions) ?? !0, V = ((S = u.value) == null ? void 0 : S.modulesDisabled) ?? !1, _ = ((y = C.value) == null ? void 0 : y.forceRecreate) ?? !1;
18
18
  window.UIEditor.initEditor(
19
19
  document.querySelector("#guido-editor"),
20
20
  {
21
- metadata: C,
21
+ metadata: E,
22
22
  html: p,
23
23
  css: a,
24
- forceRecreate: v,
24
+ forceRecreate: _,
25
25
  locale: "en",
26
26
  undoButtonSelector: "#guido__undo-button",
27
27
  redoButtonSelector: "#guido__redo-button",
28
28
  mobileViewButtonSelector: ".guido__view-option-selection-mobile",
29
29
  desktopViewButtonSelector: ".guido__view-option-selection-desktop",
30
30
  codeEditorButtonSelector: "#guido__code-button",
31
- customAppearanceMergetags: !u("liquidSyntax"),
31
+ customAppearanceMergetags: !m("liquidSyntax"),
32
32
  customAppearanceMergetagsBorderColor: "#f1f3fe",
33
33
  customAppearanceMergetagsBackgroundColor: "#f1f3fe",
34
- customViewStyles: j,
34
+ customViewStyles: z,
35
35
  conditionsEnabled: f,
36
36
  customConditionsEnabled: f,
37
37
  enableXSSSecurity: !0,
38
- modulesDisabled: _,
39
- syncModulesEnabled: s,
38
+ modulesDisabled: V,
39
+ syncModulesEnabled: o,
40
40
  messageSettingsEnabled: !0,
41
41
  displayGmailAnnotations: !0,
42
42
  displayHiddenPreheader: !1,
@@ -45,7 +45,7 @@ const se = (C, l) => {
45
45
  selectElementAfterDrop: !0,
46
46
  sameFontSizeForOutlook: !0,
47
47
  allowedScriptSourceDomains: "https://email-static.useinsider.com https://edge.fullstory.com https://rs.fullstory.com",
48
- ...o ? { baseBlocks: o } : {},
48
+ ...i ? { baseBlocks: i } : {},
49
49
  editorFonts: {
50
50
  showDefaultStandardFonts: !0,
51
51
  showDefaultNotStandardFonts: !0,
@@ -53,9 +53,9 @@ const se = (C, l) => {
53
53
  },
54
54
  mergeTags: [
55
55
  {
56
- entries: z(
57
- l.preselectedDynamicContentList,
58
- u("liquidSyntax")
56
+ entries: L(
57
+ c.preselectedDynamicContentList,
58
+ m("liquidSyntax")
59
59
  )
60
60
  }
61
61
  ],
@@ -64,17 +64,17 @@ const se = (C, l) => {
64
64
  const n = await w();
65
65
  t(n);
66
66
  } catch (n) {
67
- m(n, "Failed to refresh token");
67
+ l(n, "Failed to refresh token");
68
68
  }
69
69
  },
70
70
  onTemplateLoaded() {
71
71
  try {
72
72
  const { importCss: t } = U(), { activateCustomViewStyles: n, updateTimerInClonedTemplate: M } = D(), { injectFullStory: A } = R();
73
- t(), n(), A(), M(), l.onReady(), e.isStripoInitialized = !0, e.loadingStatus = !1, setTimeout(() => {
73
+ t(), n(), A(), M(), c.onReady(), e.isStripoInitialized = !0, e.loadingStatus = !1, setTimeout(() => {
74
74
  e.hasChanges = !1;
75
75
  }, 1e3);
76
76
  } catch (t) {
77
- m(t, "Failed to load custom interface appearance");
77
+ l(t, "Failed to load custom interface appearance");
78
78
  }
79
79
  },
80
80
  onCodeEditorVisibilityChanged(t) {
@@ -89,7 +89,7 @@ const se = (C, l) => {
89
89
  onDataChanged() {
90
90
  e.hasChanges = !0;
91
91
  },
92
- onEvent: F,
92
+ onEvent: k,
93
93
  ignoreClickOutsideSelectors: [
94
94
  "#guido-dynamic-content-modal",
95
95
  ".in-on-board-wrapper",
@@ -99,27 +99,32 @@ const se = (C, l) => {
99
99
  localePatch: H
100
100
  }
101
101
  );
102
- }, V = (i) => new Promise((r, s) => {
102
+ }, T = (s) => new Promise((r, o) => {
103
103
  var d;
104
104
  if (document.getElementById("UiEditorScript")) {
105
- i(), r();
105
+ Promise.resolve(s()).then(r, o);
106
106
  return;
107
107
  }
108
- const e = L.guido, a = `https://email-static.useinsider.com/guido/${(d = e == null ? void 0 : e.stripo) == null ? void 0 : d.version}/UIEditor.js`, o = document.createElement("script");
109
- o.id = "UiEditorScript", o.type = "module", o.src = a, o.onload = () => {
110
- i(), r();
111
- }, o.onerror = () => {
112
- s(new Error(`Failed to load Stripo UIEditor script from S3: ${a}`));
113
- }, document.body.appendChild(o);
108
+ const e = $.guido, a = `https://email-static.useinsider.com/guido/${(d = e == null ? void 0 : e.stripo) == null ? void 0 : d.version}/UIEditor.js`, i = document.createElement("script");
109
+ i.id = "UiEditorScript", i.type = "module", i.src = a, i.onload = () => {
110
+ Promise.resolve(s()).then(r, o);
111
+ }, i.onerror = () => {
112
+ o(new Error(`Failed to load Stripo UIEditor script from S3: ${a}`));
113
+ }, document.body.appendChild(i);
114
114
  });
115
- return { initPlugin: async (i) => {
116
- await V(async () => {
117
- const r = E(), [s, e] = await Promise.all([
118
- b(),
119
- k()
120
- ]);
121
- r.syncModulesEnabled = e, await T(i, s, e);
122
- });
115
+ return { initPlugin: async (s) => {
116
+ const r = h();
117
+ try {
118
+ await T(async () => {
119
+ const [o, e] = await Promise.all([
120
+ b(),
121
+ F()
122
+ ]);
123
+ r.syncModulesEnabled = e, await B(s, o, e);
124
+ });
125
+ } catch (o) {
126
+ r.loadingStatus = !1, l(o, "Failed to load the editor");
127
+ }
123
128
  } };
124
129
  };
125
130
  export {