@useinsider/guido 3.2.0-beta.e69fb3b → 3.2.0-beta.ecc7c6c

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 (231) hide show
  1. package/dist/@types/config/schemas.js +1 -1
  2. package/dist/@types/config/validator.js +34 -27
  3. package/dist/components/Guido.vue.js +1 -1
  4. package/dist/components/Guido.vue2.js +81 -76
  5. package/dist/components/organisms/base/Toaster.vue2.js +11 -10
  6. package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue2.js +12 -12
  7. package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue2.js +6 -6
  8. package/dist/components/organisms/email-preview/mobile-preview/InboxView.vue2.js +15 -9
  9. package/dist/components/organisms/extensions/recommendation/FilterItem.vue2.js +40 -31
  10. package/dist/components/organisms/extensions/recommendation/FilterSelectionDrawer.vue2.js +20 -19
  11. package/dist/components/organisms/extensions/recommendation/Filters.vue2.js +14 -11
  12. package/dist/components/organisms/header/EditorActions.vue.js +12 -11
  13. package/dist/components/organisms/header/EditorActions.vue2.js +22 -18
  14. package/dist/components/organisms/header/HeaderWrapper.vue2.js +15 -12
  15. package/dist/components/organisms/header/LeftSlot.vue2.js +19 -16
  16. package/dist/components/organisms/header/MiddleSlot.vue2.js +11 -14
  17. package/dist/components/organisms/header/RightSlot.vue2.js +17 -14
  18. package/dist/components/organisms/onboarding/AMPOnboarding.vue.js +12 -11
  19. package/dist/components/organisms/onboarding/AMPOnboarding.vue2.js +26 -24
  20. package/dist/components/organisms/onboarding/GenericOnboarding.vue.js +12 -11
  21. package/dist/components/organisms/onboarding/GenericOnboarding.vue2.js +44 -41
  22. package/dist/components/organisms/onboarding/ItemsOnboarding.vue.js +12 -11
  23. package/dist/components/organisms/onboarding/ItemsOnboarding.vue2.js +38 -36
  24. package/dist/components/organisms/onboarding/NewVersionPopup.vue2.js +21 -18
  25. package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +31 -27
  26. package/dist/components/organisms/onboarding/TextBlockOnboarding.vue.js +12 -11
  27. package/dist/components/organisms/onboarding/TextBlockOnboarding.vue2.js +32 -30
  28. package/dist/components/organisms/onboarding/VersionHistoryOnboarding.vue.js +12 -11
  29. package/dist/components/organisms/onboarding/VersionHistoryOnboarding.vue2.js +23 -21
  30. package/dist/components/organisms/save-as-template/SaveAsTemplateDrawer.vue2.js +9 -8
  31. package/dist/components/organisms/unsubscribe/UnsubscribeWrapper.vue.js +10 -9
  32. package/dist/composables/useActionsApi.js +38 -37
  33. package/dist/composables/useBlocksConfig.js +26 -26
  34. package/dist/composables/useFullStoryBridge.js +9 -8
  35. package/dist/composables/useHtmlCompiler.js +26 -34
  36. package/dist/composables/useHtmlValidator.js +114 -101
  37. package/dist/composables/useHttp.js +30 -30
  38. package/dist/composables/usePartner.js +1 -1
  39. package/dist/composables/useRecommendation.js +15 -14
  40. package/dist/composables/useRibbonOffset.js +15 -15
  41. package/dist/composables/useSave.js +23 -19
  42. package/dist/composables/useStripo.js +48 -53
  43. package/dist/composables/useSyncModuleExtractor.js +29 -31
  44. package/dist/composables/useTimerClone.js +25 -24
  45. package/dist/composables/useTranslations.js +3 -2
  46. package/dist/composables/useValidation.js +8 -7
  47. package/dist/composables/validators/useCouponBlockValidator.js +24 -0
  48. package/dist/composables/validators/useLiquidValidator.js +13 -13
  49. package/dist/config/compiler/recommendationCompilerRules.js +27 -27
  50. package/dist/config/compiler/unsubscribeCompilerRules.js +19 -17
  51. package/dist/config/compiler/utils/recommendationCompilerUtils.js +11 -10
  52. package/dist/config/migrator/checkboxMigrator.js +21 -20
  53. package/dist/config/migrator/couponBlockMigrator.js +19 -18
  54. package/dist/config/migrator/itemsBlockMigrator.js +89 -87
  55. package/dist/config/migrator/radioButtonMigrator.js +63 -42
  56. package/dist/config/migrator/recommendationMigrator.js +109 -106
  57. package/dist/config/migrator/unsubscribeMigrator.js +11 -10
  58. package/dist/enums/unsubscribe.js +19 -18
  59. package/dist/extensions/Blocks/Items/block.js +9 -9
  60. package/dist/extensions/Blocks/Items/controls/button/link.js +14 -14
  61. package/dist/extensions/Blocks/Items/controls/cardComposition.js +97 -89
  62. package/dist/extensions/Blocks/Items/controls/image/link.js +14 -14
  63. package/dist/extensions/Blocks/Items/controls/name/trimming.js +24 -23
  64. package/dist/extensions/Blocks/Items/controls/price/currencyLocation.js +14 -13
  65. package/dist/extensions/Blocks/Items/controls/price/currencySymbol.js +47 -44
  66. package/dist/extensions/Blocks/Items/controls/price/formattedPrice.js +38 -38
  67. package/dist/extensions/Blocks/Items/controls/price/hideDiscount.js +11 -11
  68. package/dist/extensions/Blocks/Items/controls/price/priceOrientation.js +40 -38
  69. package/dist/extensions/Blocks/Items/controls/price/singlePrice.js +35 -35
  70. package/dist/extensions/Blocks/Items/controls/settingsControl.js +162 -155
  71. package/dist/extensions/Blocks/Items/enums/productEnums.js +14 -9
  72. package/dist/extensions/Blocks/Items/template.js +210 -210
  73. package/dist/extensions/Blocks/RadioButton/template.js +1 -1
  74. package/dist/extensions/Blocks/Recommendation/controls/button/index.js +36 -36
  75. package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +133 -128
  76. package/dist/extensions/Blocks/Recommendation/controls/customAttribute/index.js +9 -9
  77. package/dist/extensions/Blocks/Recommendation/controls/customAttribute/textTrim.js +10 -10
  78. package/dist/extensions/Blocks/Recommendation/controls/image/index.js +9 -9
  79. package/dist/extensions/Blocks/Recommendation/controls/main/algorithm.js +18 -17
  80. package/dist/extensions/Blocks/Recommendation/controls/main/filters.js +6 -4
  81. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +90 -82
  82. package/dist/extensions/Blocks/Recommendation/controls/main/layoutOrientation.js +18 -18
  83. package/dist/extensions/Blocks/Recommendation/controls/main/productCount.js +4 -4
  84. package/dist/extensions/Blocks/Recommendation/controls/main/productLayout.js +36 -35
  85. package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +135 -134
  86. package/dist/extensions/Blocks/Recommendation/controls/name/index.js +24 -24
  87. package/dist/extensions/Blocks/Recommendation/controls/name/textTrim.js +10 -10
  88. package/dist/extensions/Blocks/Recommendation/controls/oldPrice/index.js +24 -24
  89. package/dist/extensions/Blocks/Recommendation/controls/omnibusDiscount/index.js +24 -24
  90. package/dist/extensions/Blocks/Recommendation/controls/omnibusDiscount/textAfter.js +4 -4
  91. package/dist/extensions/Blocks/Recommendation/controls/omnibusDiscount/textBefore.js +4 -4
  92. package/dist/extensions/Blocks/Recommendation/controls/omnibusPrice/index.js +24 -24
  93. package/dist/extensions/Blocks/Recommendation/controls/omnibusPrice/textAfter.js +4 -4
  94. package/dist/extensions/Blocks/Recommendation/controls/omnibusPrice/textBefore.js +4 -4
  95. package/dist/extensions/Blocks/Recommendation/controls/price/index.js +24 -24
  96. package/dist/extensions/Blocks/Recommendation/controls/spacing/index.js +32 -32
  97. package/dist/extensions/Blocks/Recommendation/controls/syncInfoMessage.js +20 -18
  98. package/dist/extensions/Blocks/Recommendation/extension.js +32 -31
  99. package/dist/extensions/Blocks/Recommendation/settingsPanel.js +16 -8
  100. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +64 -54
  101. package/dist/extensions/Blocks/Recommendation/templates/grid/elementRenderer.js +23 -22
  102. package/dist/extensions/Blocks/Recommendation/templates/grid/migration.js +10 -10
  103. package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +10 -10
  104. package/dist/extensions/Blocks/Recommendation/templates/index.js +6 -6
  105. package/dist/extensions/Blocks/Recommendation/templates/list/elementRenderer.js +25 -24
  106. package/dist/extensions/Blocks/Recommendation/templates/list/template.js +1 -1
  107. package/dist/extensions/Blocks/Recommendation/templates/utils.js +47 -45
  108. package/dist/extensions/Blocks/Recommendation/validation/filterSchema.js +16 -13
  109. package/dist/extensions/Blocks/Recommendation/validation/requiredFields.js +33 -0
  110. package/dist/extensions/Blocks/Unsubscribe/control.js +13 -11
  111. package/dist/extensions/Blocks/Unsubscribe/elements/preview.js +18 -16
  112. package/dist/extensions/Blocks/common-control.js +26 -25
  113. package/dist/extensions/DynamicContent/dynamic-content.js +58 -53
  114. package/dist/guido.css +1 -1
  115. package/dist/library.js +12 -11
  116. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +234 -233
  117. package/dist/node_modules/lodash-es/_DataView.js +6 -0
  118. package/dist/node_modules/lodash-es/_Promise.js +6 -0
  119. package/dist/node_modules/lodash-es/_Set.js +6 -0
  120. package/dist/node_modules/lodash-es/_SetCache.js +13 -0
  121. package/dist/node_modules/lodash-es/_Stack.js +18 -0
  122. package/dist/node_modules/lodash-es/_Uint8Array.js +5 -0
  123. package/dist/node_modules/lodash-es/_WeakMap.js +6 -0
  124. package/dist/node_modules/lodash-es/_arrayFilter.js +10 -0
  125. package/dist/node_modules/lodash-es/_arrayLikeKeys.js +20 -0
  126. package/dist/node_modules/lodash-es/_arrayMap.js +8 -0
  127. package/dist/node_modules/lodash-es/_arrayPush.js +8 -0
  128. package/dist/node_modules/lodash-es/_arraySome.js +9 -0
  129. package/dist/node_modules/lodash-es/_baseEach.js +6 -0
  130. package/dist/node_modules/lodash-es/_baseFlatten.js +13 -0
  131. package/dist/node_modules/lodash-es/_baseFor.js +5 -0
  132. package/dist/node_modules/lodash-es/_baseForOwn.js +8 -0
  133. package/dist/node_modules/lodash-es/_baseGet.js +11 -0
  134. package/dist/node_modules/lodash-es/_baseGetAllKeys.js +9 -0
  135. package/dist/node_modules/lodash-es/_baseHasIn.js +6 -0
  136. package/dist/node_modules/lodash-es/_baseIsArguments.js +9 -0
  137. package/dist/node_modules/lodash-es/_baseIsEqual.js +8 -0
  138. package/dist/node_modules/lodash-es/_baseIsEqualDeep.js +32 -0
  139. package/dist/node_modules/lodash-es/_baseIsMatch.js +29 -0
  140. package/dist/node_modules/lodash-es/_baseIsTypedArray.js +12 -0
  141. package/dist/node_modules/lodash-es/_baseIteratee.js +11 -0
  142. package/dist/node_modules/lodash-es/_baseKeys.js +14 -0
  143. package/dist/node_modules/lodash-es/_baseMap.js +11 -0
  144. package/dist/node_modules/lodash-es/_baseMatches.js +12 -0
  145. package/dist/node_modules/lodash-es/_baseMatchesProperty.js +17 -0
  146. package/dist/node_modules/lodash-es/_baseProperty.js +8 -0
  147. package/dist/node_modules/lodash-es/_basePropertyDeep.js +9 -0
  148. package/dist/node_modules/lodash-es/_baseRange.js +9 -0
  149. package/dist/node_modules/lodash-es/_baseTimes.js +8 -0
  150. package/dist/node_modules/lodash-es/_baseToString.js +18 -0
  151. package/dist/node_modules/lodash-es/_baseTrim.js +8 -0
  152. package/dist/node_modules/lodash-es/_baseUnary.js +8 -0
  153. package/dist/node_modules/lodash-es/_cacheHas.js +6 -0
  154. package/dist/node_modules/lodash-es/_castPath.js +10 -0
  155. package/dist/node_modules/lodash-es/_createBaseEach.js +15 -0
  156. package/dist/node_modules/lodash-es/_createBaseFor.js +13 -0
  157. package/dist/node_modules/lodash-es/_createRange.js +11 -0
  158. package/dist/node_modules/lodash-es/_equalArrays.js +40 -0
  159. package/dist/node_modules/lodash-es/_equalByTag.js +45 -0
  160. package/dist/node_modules/lodash-es/_equalObjects.js +36 -0
  161. package/dist/node_modules/lodash-es/_getAllKeys.js +9 -0
  162. package/dist/node_modules/lodash-es/_getMatchData.js +12 -0
  163. package/dist/node_modules/lodash-es/_getSymbols.js +10 -0
  164. package/dist/node_modules/lodash-es/_getTag.js +28 -0
  165. package/dist/node_modules/lodash-es/_getValue.js +1 -1
  166. package/dist/node_modules/lodash-es/_hasPath.js +19 -0
  167. package/dist/node_modules/lodash-es/_isFlattenable.js +10 -0
  168. package/dist/node_modules/lodash-es/_isIndex.js +8 -0
  169. package/dist/node_modules/lodash-es/_isIterateeCall.js +13 -0
  170. package/dist/node_modules/lodash-es/_isKey.js +12 -0
  171. package/dist/node_modules/lodash-es/_isPrototype.js +8 -0
  172. package/dist/node_modules/lodash-es/_isStrictComparable.js +7 -0
  173. package/dist/node_modules/lodash-es/_mapToArray.js +9 -0
  174. package/dist/node_modules/lodash-es/_matchesStrictComparable.js +8 -0
  175. package/dist/node_modules/lodash-es/_memoizeCapped.js +11 -0
  176. package/dist/node_modules/lodash-es/_nativeKeys.js +5 -0
  177. package/dist/node_modules/lodash-es/_nodeUtil.js +11 -0
  178. package/dist/node_modules/lodash-es/_overArg.js +8 -0
  179. package/dist/node_modules/lodash-es/_setCacheAdd.js +7 -0
  180. package/dist/node_modules/lodash-es/_setCacheHas.js +6 -0
  181. package/dist/node_modules/lodash-es/_setToArray.js +9 -0
  182. package/dist/node_modules/lodash-es/_stackClear.js +7 -0
  183. package/dist/node_modules/lodash-es/_stackDelete.js +7 -0
  184. package/dist/node_modules/lodash-es/_stackGet.js +6 -0
  185. package/dist/node_modules/lodash-es/_stackHas.js +6 -0
  186. package/dist/node_modules/lodash-es/_stackSet.js +17 -0
  187. package/dist/node_modules/lodash-es/_stringToPath.js +10 -0
  188. package/dist/node_modules/lodash-es/_toKey.js +10 -0
  189. package/dist/node_modules/lodash-es/_trimmedEndIndex.js +9 -0
  190. package/dist/node_modules/lodash-es/flatMap.js +8 -0
  191. package/dist/node_modules/lodash-es/get.js +8 -0
  192. package/dist/node_modules/lodash-es/hasIn.js +8 -0
  193. package/dist/node_modules/lodash-es/identity.js +6 -0
  194. package/dist/node_modules/lodash-es/isArguments.js +10 -0
  195. package/dist/node_modules/lodash-es/isArray.js +4 -0
  196. package/dist/node_modules/lodash-es/isArrayLike.js +8 -0
  197. package/dist/node_modules/lodash-es/isBuffer.js +6 -0
  198. package/dist/node_modules/lodash-es/isLength.js +7 -0
  199. package/dist/node_modules/lodash-es/isObjectLike.js +6 -0
  200. package/dist/node_modules/lodash-es/isSymbol.js +9 -0
  201. package/dist/node_modules/lodash-es/isTypedArray.js +7 -0
  202. package/dist/node_modules/lodash-es/keys.js +9 -0
  203. package/dist/node_modules/lodash-es/map.js +11 -0
  204. package/dist/node_modules/lodash-es/property.js +10 -0
  205. package/dist/node_modules/lodash-es/range.js +5 -0
  206. package/dist/node_modules/lodash-es/stubArray.js +6 -0
  207. package/dist/node_modules/lodash-es/stubFalse.js +6 -0
  208. package/dist/node_modules/lodash-es/toFinite.js +14 -0
  209. package/dist/node_modules/lodash-es/toNumber.js +22 -0
  210. package/dist/node_modules/lodash-es/toString.js +7 -0
  211. package/dist/node_modules/valibot/dist/index.js +126 -122
  212. package/dist/services/recommendationApi.js +17 -14
  213. package/dist/services/templateLibraryApi.js +40 -38
  214. package/dist/src/components/wrappers/WpModal.vue.d.ts +1 -1
  215. package/dist/src/composables/useHtmlCompiler.d.ts +2 -1
  216. package/dist/src/composables/validators/useCouponBlockValidator.d.ts +3 -0
  217. package/dist/src/extensions/Blocks/RadioButton/template.d.ts +1 -1
  218. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +7 -1
  219. package/dist/src/extensions/Blocks/Recommendation/validation/requiredFields.d.ts +21 -0
  220. package/dist/src/stores/dynamic-content.d.ts +3 -3
  221. package/dist/stores/config.js +81 -25
  222. package/dist/stores/dynamic-content.js +11 -6
  223. package/dist/stores/onboarding.js +1 -1
  224. package/dist/stores/preview.js +9 -6
  225. package/dist/stores/unsubscribe.js +4 -1
  226. package/dist/utils/dateUtil.js +10 -7
  227. package/dist/utils/genericUtil.js +13 -10
  228. package/dist/utils/pairProductVariables.js +89 -87
  229. package/package.json +1 -6
  230. package/dist/enums/displayConditions.js +0 -80
  231. package/dist/src/enums/displayConditions.d.ts +0 -2
@@ -1,7 +1,7 @@
1
1
  import { useToaster as w } from "./useToaster.js";
2
2
  const v = () => {
3
- const { handleError: o } = w(), m = (e = {}) => new Promise((t, i) => {
4
- const a = { ...{
3
+ const { handleError: n } = w(), m = (t = {}) => new Promise((e, a) => {
4
+ const o = { ...{
5
5
  minimize: !0,
6
6
  utmEntity: {
7
7
  utmSource: "",
@@ -20,51 +20,51 @@ const v = () => {
20
20
  forceAmp: !1,
21
21
  resetDataSavedFlag: !1,
22
22
  disableLineHeightsReplace: !0
23
- }, ...e }, s = {
23
+ }, ...t }, s = {
24
24
  callback: (l, r, d, c, u) => {
25
- l ? i(l) : t({
25
+ l ? a(l) : e({
26
26
  html: r,
27
27
  ampHtml: d,
28
28
  ampErrors: c,
29
29
  displayConditions: u
30
30
  });
31
31
  },
32
- ...a
32
+ ...o
33
33
  };
34
34
  window.StripoEditorApi.actionsApi.compileEmail(s);
35
35
  });
36
36
  return {
37
37
  getCompiledEmail: m,
38
- getTemplateData: () => new Promise((e) => {
39
- const t = ({ html: i, css: n, width: a, height: p, utmParams: s, syncModulesIds: l }) => e({
40
- html: i,
41
- css: n,
42
- width: a,
38
+ getTemplateData: () => new Promise((t) => {
39
+ const e = ({ html: a, css: i, width: o, height: p, utmParams: s, syncModulesIds: l }) => t({
40
+ html: a,
41
+ css: i,
42
+ width: o,
43
43
  height: p,
44
44
  utmParams: s,
45
45
  syncModulesIds: l
46
46
  });
47
- window.StripoEditorApi.actionsApi.getTemplateData(t);
47
+ window.StripoEditorApi.actionsApi.getTemplateData(e);
48
48
  }),
49
- activateCustomViewStyles: (e = !0) => {
50
- window.StripoEditorApi.actionsApi.activateCustomViewStyles(e);
49
+ activateCustomViewStyles: (t = !0) => {
50
+ window.StripoEditorApi.actionsApi.activateCustomViewStyles(t);
51
51
  },
52
- getPreviewData: async (e) => {
52
+ getPreviewData: async (t) => {
53
53
  try {
54
54
  const {
55
- html: t,
56
- displayConditions: i,
57
- ampHtml: n = "",
58
- ampErrors: a = []
59
- } = await m({ minimize: !1, resetDataSavedFlag: !1, ...e });
55
+ html: e,
56
+ displayConditions: a,
57
+ ampHtml: i = "",
58
+ ampErrors: o = []
59
+ } = await m({ minimize: !1, resetDataSavedFlag: !1, ...t });
60
60
  return {
61
- html: t,
62
- ampHtml: n,
63
- ampErrors: a,
64
- displayConditions: i
61
+ html: e,
62
+ ampHtml: i,
63
+ ampErrors: o,
64
+ displayConditions: a
65
65
  };
66
- } catch (t) {
67
- return o(t, "Error loading preview"), {
66
+ } catch (e) {
67
+ return n(e, "Error loading preview"), {
68
68
  html: "",
69
69
  ampHtml: "",
70
70
  ampErrors: [],
@@ -72,25 +72,26 @@ const v = () => {
72
72
  };
73
73
  }
74
74
  },
75
- updateTimerInClonedTemplate: () => new Promise((e) => {
76
- if (typeof window.StripoEditorApi?.actionsApi?.updateTimerInClonedTemplate != "function") {
77
- e(null);
75
+ updateTimerInClonedTemplate: () => new Promise((t) => {
76
+ var e, a;
77
+ if (typeof ((a = (e = window.StripoEditorApi) == null ? void 0 : e.actionsApi) == null ? void 0 : a.updateTimerInClonedTemplate) != "function") {
78
+ t(null);
78
79
  return;
79
80
  }
80
81
  try {
81
- window.StripoEditorApi.actionsApi.updateTimerInClonedTemplate((t, i) => {
82
- t ? (o(t, "Failed to update timer in cloned template"), e(null)) : e(i || null);
82
+ window.StripoEditorApi.actionsApi.updateTimerInClonedTemplate((i, o) => {
83
+ i ? (n(i, "Failed to update timer in cloned template"), t(null)) : t(o || null);
83
84
  });
84
- } catch (t) {
85
- o(t, "Failed to call updateTimerInClonedTemplate"), e(null);
85
+ } catch (i) {
86
+ n(i, "Failed to call updateTimerInClonedTemplate"), t(null);
86
87
  }
87
88
  }),
88
- updateHtmlAndCss: (e, t) => {
89
- window.StripoEditorApi.actionsApi.updateHtmlAndCss(e, t);
89
+ updateHtmlAndCss: (t, e) => {
90
+ window.StripoEditorApi.actionsApi.updateHtmlAndCss(t, e);
90
91
  },
91
- editorSave: () => new Promise((e) => {
92
- window.StripoEditorApi.actionsApi.save((t) => {
93
- t && o(t, "Failed to save template"), e();
92
+ editorSave: () => new Promise((t) => {
93
+ window.StripoEditorApi.actionsApi.save((e) => {
94
+ e && n(e, "Failed to save template"), t();
94
95
  });
95
96
  })
96
97
  };
@@ -1,6 +1,6 @@
1
- import l from "../extensions/ModulesTabIcons/extension.js";
2
- import { useConfigStore as r } from "../stores/config.js";
3
- const s = {
1
+ import r from "../extensions/ModulesTabIcons/extension.js";
2
+ import { useConfigStore as l } from "../stores/config.js";
3
+ const a = {
4
4
  "amp-accordion": "ampAccordionEnabled",
5
5
  "amp-carousel": "ampCarouselEnabled",
6
6
  "amp-form-controls": "ampFormControlsEnabled",
@@ -14,7 +14,7 @@ const s = {
14
14
  "text-block": "textEnabled",
15
15
  "timer-block": "timerEnabled",
16
16
  "video-block": "videoEnabled"
17
- }, a = {
17
+ }, s = {
18
18
  "dynamic-content": () => import("../extensions/DynamicContent/extension.js"),
19
19
  "checkbox-block": () => import("../extensions/Blocks/Checkbox/extension.js"),
20
20
  "radio-button-block": () => import("../extensions/Blocks/RadioButton/extension.js"),
@@ -22,40 +22,40 @@ const s = {
22
22
  "unsubscribe-block": () => import("../extensions/Blocks/Unsubscribe/extension.js"),
23
23
  "coupon-block": () => import("../extensions/Blocks/CouponBlock/extension.js"),
24
24
  "items-block": () => import("../extensions/Blocks/Items/extension.js")
25
- }, i = (o) => {
26
- if (!o || !o.length)
25
+ }, i = (n) => {
26
+ if (!n || !n.length)
27
27
  return {};
28
- const n = {};
29
- return o.forEach((t) => {
30
- const e = s[t];
31
- e && (n[e] = !1);
32
- }), n;
33
- }, b = () => [l], m = async (o) => {
34
- const n = b();
35
- if (!o || !o.length)
36
- return n;
37
- const t = await Promise.all(
38
- o.map(async (e) => {
39
- const c = a[e];
28
+ const t = {};
29
+ return n.forEach((o) => {
30
+ const e = a[o];
31
+ e && (t[e] = !1);
32
+ }), t;
33
+ }, b = () => [r], m = async (n) => {
34
+ const t = b();
35
+ if (!n || !n.length)
36
+ return t;
37
+ const o = await Promise.all(
38
+ n.map(async (e) => {
39
+ const c = s[e];
40
40
  return c ? (await c()).default : null;
41
41
  })
42
42
  );
43
43
  return [
44
- ...n,
45
- ...t.filter((e) => e !== null)
44
+ ...t,
45
+ ...o.filter((e) => e !== null)
46
46
  ];
47
- }, p = () => {
48
- const o = r();
47
+ }, E = () => {
48
+ const n = l();
49
49
  return {
50
50
  getStripoBlocksConfig: async () => {
51
- const t = o.blocks;
51
+ const o = n.blocks;
52
52
  return {
53
- baseBlocks: i(t?.excludeDefaults),
54
- extensions: await m(t?.includeCustoms)
53
+ baseBlocks: i(o == null ? void 0 : o.excludeDefaults),
54
+ extensions: await m(o == null ? void 0 : o.includeCustoms)
55
55
  };
56
56
  }
57
57
  };
58
58
  };
59
59
  export {
60
- p as useBlocksConfig
60
+ E as useBlocksConfig
61
61
  };
@@ -1,13 +1,14 @@
1
- const o = "https://email-static.useinsider.com/guido/guido-fs.js", c = () => ({ injectFullStory: () => {
2
- const e = window;
3
- if (typeof e._fs_org != "string" || !e._fs_org)
1
+ const c = "https://email-static.useinsider.com/guido/guido-fs.js", u = () => ({ injectFullStory: () => {
2
+ var n;
3
+ const s = window;
4
+ if (typeof s._fs_org != "string" || !s._fs_org)
4
5
  return;
5
- const r = document.querySelector("ui-editor")?.shadowRoot?.querySelector("iframe")?.contentDocument;
6
- if (!r || r.querySelector('script[data-fullstory-bridge="true"]'))
6
+ const r = document.querySelector("ui-editor"), o = (n = r == null ? void 0 : r.shadowRoot) == null ? void 0 : n.querySelector("iframe"), e = o == null ? void 0 : o.contentDocument;
7
+ if (!e || e.querySelector('script[data-fullstory-bridge="true"]'))
7
8
  return;
8
- const t = r.createElement("script");
9
- t.src = o, t.async = !0, t.crossOrigin = "anonymous", t.dataset.fullstoryBridge = "true", r.head.appendChild(t);
9
+ const t = e.createElement("script");
10
+ t.src = c, t.async = !0, t.crossOrigin = "anonymous", t.dataset.fullstoryBridge = "true", e.head.appendChild(t);
10
11
  } });
11
12
  export {
12
- c as useFullStoryBridge
13
+ u as useFullStoryBridge
13
14
  };
@@ -1,38 +1,30 @@
1
- import { defaultHtmlCompilerRules as n } from "../config/compiler/htmlCompilerRules.js";
2
- import { itemsCompilerRules as c } from "../config/compiler/itemsCompilerRules.js";
3
- import { liquidCompilerRules as p } from "../config/compiler/liquidCompilerRules.js";
4
- import { outlookCompilerRules as f } from "../config/compiler/outlookCompilerRules.js";
1
+ import { defaultHtmlCompilerRules as c } from "../config/compiler/htmlCompilerRules.js";
2
+ import { itemsCompilerRules as f } from "../config/compiler/itemsCompilerRules.js";
3
+ import { liquidCompilerRules as R } from "../config/compiler/liquidCompilerRules.js";
4
+ import { outlookCompilerRules as C } from "../config/compiler/outlookCompilerRules.js";
5
5
  import { recommendationCompilerRules as d } from "../config/compiler/recommendationCompilerRules.js";
6
- import { socialCompilerRules as R } from "../config/compiler/socialCompilerRules.js";
7
- import { unsubscribeCompilerRules as b } from "../config/compiler/unsubscribeCompilerRules.js";
8
- import { createHtmlCompiler as C } from "../utils/htmlCompiler.js";
9
- import { useConfig as F } from "./useConfig.js";
10
- let i = null, u, o = null;
11
- const g = (l) => !i || !o ? !0 : o.ignoreDefaultRules !== l.ignoreDefaultRules || o.liquidEnabled !== l.liquidEnabled || o.customRules !== l.customRules || o.fallbackFont !== l.fallbackFont, B = () => {
12
- const { compiler: l, isFeatureEnabled: m, partner: a } = F(), e = {
13
- ignoreDefaultRules: !!l.value?.ignoreDefaultRules,
14
- liquidEnabled: m("liquidSyntax"),
15
- customRules: l.value?.customRules,
16
- fallbackFont: a.value?.fallbackFont
17
- };
18
- if (g(e)) {
19
- const t = [
20
- ...e.ignoreDefaultRules ? [] : n,
21
- ...d,
22
- ...b,
23
- ...c,
24
- ...f,
25
- ...R,
26
- ...e.liquidEnabled ? p : [],
27
- ...(e.customRules ?? []).map((r, s) => ({
28
- ...r,
29
- priority: r.priority + 1e3 + s
30
- }))
31
- ];
32
- i = C(t), u = e.fallbackFont, o = e;
33
- }
34
- return { compileHtml: (t) => i.compile(t, void 0, u) };
6
+ import { socialCompilerRules as b } from "../config/compiler/socialCompilerRules.js";
7
+ import { unsubscribeCompilerRules as g } from "../config/compiler/unsubscribeCompilerRules.js";
8
+ import { createHtmlCompiler as H } from "../utils/htmlCompiler.js";
9
+ import { useConfig as v } from "./useConfig.js";
10
+ const w = () => {
11
+ var l, m, r;
12
+ const { compiler: e, isFeatureEnabled: t, partner: i } = v(), s = ((l = e.value) == null ? void 0 : l.customRules) || [], u = [
13
+ ...!!((m = e.value) != null && m.ignoreDefaultRules) ? [] : c,
14
+ ...d,
15
+ ...g,
16
+ ...f,
17
+ ...C,
18
+ ...b,
19
+ ...t("liquidSyntax") ? R : [],
20
+ ...s.map((o, a) => ({
21
+ ...o,
22
+ priority: o.priority + 1e3 + a
23
+ // Ensure additional rules run after default rules
24
+ }))
25
+ ], p = H(u), n = (r = i.value) == null ? void 0 : r.fallbackFont;
26
+ return { compileHtml: (o) => p.compile(o, void 0, n) };
35
27
  };
36
28
  export {
37
- B as useHtmlCompiler
29
+ w as useHtmlCompiler
38
30
  };
@@ -1,153 +1,166 @@
1
- import { useConfig as R } from "./useConfig.js";
2
- import { TemplateTypes as D } from "../enums/defaults.js";
3
- import { DISPLAY_CONDITIONS_REGEX as L, DISPLAY_CONDITIONS_EXCEPTIONS_REGEX as V, CampaignCouldNotBeSavedKey as _, CanNotMakeAnyChangesForRunningKey as H } from "../enums/html-validator.js";
4
- import { ToasterTypeOptions as r } from "../enums/toaster.js";
5
- import { itemsBlockDynamicVariables as P } from "../extensions/Blocks/Items/enums/productEnums.js";
6
- import { useRecommendationStore as G } from "../stores/recommendation.js";
7
- import { base64EncodeWithSpecialChars as M } from "../utils/base64.js";
8
- import { useHttp as $ } from "./useHttp.js";
9
- import { useToaster as X } from "./useToaster.js";
10
- import { useTranslations as j } from "./useTranslations.js";
11
- const q = /recommendation-id="(\d+)"/g;
12
- function z(i) {
13
- return [...i.matchAll(q)].map((u) => u[1]);
1
+ import { useConfig as _ } from "./useConfig.js";
2
+ import { TemplateTypes as H } from "../enums/defaults.js";
3
+ import { DISPLAY_CONDITIONS_REGEX as P, DISPLAY_CONDITIONS_EXCEPTIONS_REGEX as G, CampaignCouldNotBeSavedKey as M, CanNotMakeAnyChangesForRunningKey as $ } from "../enums/html-validator.js";
4
+ import { ToasterTypeOptions as c } from "../enums/toaster.js";
5
+ import { itemsBlockDynamicVariables as q } from "../extensions/Blocks/Items/enums/productEnums.js";
6
+ import { useRecommendationExtensionStore as X } from "../extensions/Blocks/Recommendation/store/recommendation.js";
7
+ import { RecommendationRequiredFieldsKey as j } from "../extensions/Blocks/Recommendation/validation/requiredFields.js";
8
+ import { useRecommendationStore as K } from "../stores/recommendation.js";
9
+ import { base64EncodeWithSpecialChars as z } from "../utils/base64.js";
10
+ import { useHttp as U } from "./useHttp.js";
11
+ import { useToaster as Y } from "./useToaster.js";
12
+ import { useTranslations as Z } from "./useTranslations.js";
13
+ const J = /recommendation-id="(\d+)"/g;
14
+ function Q(a) {
15
+ return [...a.matchAll(J)].map((u) => u[1]);
14
16
  }
15
- function K(i, u) {
16
- return u.some((d) => i.startsWith(`${d}_`));
17
+ function ee(a, u) {
18
+ return u.some((d) => a.startsWith(`${d}_`));
17
19
  }
18
- const ae = () => {
19
- const { showToaster: i } = X(), { post: u } = $(), { config: d } = R(), a = j(), g = G(), p = d.value?.partner?.messageType === D.transactional, v = async (e) => {
20
+ const ge = () => {
21
+ var y, h;
22
+ const { showToaster: a } = Y(), { post: u } = U(), { config: d } = _(), r = Z(), g = K(), S = X(), p = ((h = (y = d.value) == null ? void 0 : y.partner) == null ? void 0 : h.messageType) === H.transactional, b = async (e) => {
20
23
  const t = await u(
21
24
  "/newsletter/template-library/check-template-html-body",
22
- { html: M(e) }
23
- ), { status: n, message: c } = t.data;
24
- return n || i({
25
- type: r.Alert,
26
- message: n === void 0 ? c : a("newsletter.invalid-url-link-for-toaster")
27
- }), a(_), c === a(H) && i({
28
- type: r.Alert,
29
- message: a("newsletter.already-in-progress")
25
+ { html: z(e) }
26
+ ), { status: n, message: l } = t.data;
27
+ return n || a({
28
+ type: c.Alert,
29
+ message: n === void 0 ? l : r("newsletter.invalid-url-link-for-toaster")
30
+ }), r(M), l === r($) && a({
31
+ type: c.Alert,
32
+ message: r("newsletter.already-in-progress")
30
33
  }), n;
31
- }, C = (e) => !["if", "endif", "else", "elif", "now"].includes(e.toLowerCase()), b = (e) => ["if", "endif"].includes(e.toLowerCase()), w = (e, s) => {
34
+ }, w = (e) => !["if", "endif", "else", "elif", "now"].includes(e.toLowerCase()), E = (e) => ["if", "endif"].includes(e.toLowerCase()), A = (e, s) => {
32
35
  const t = e.match(/({%(.*?)%})/g);
33
36
  let n = !0;
34
- return t !== null && !p && t.forEach((c) => {
35
- const o = c.slice(2, -2).trim().match(/(".*?"|[^"\s]+)(?=\s*|\s*$)/g);
37
+ return t !== null && !p && t.forEach((l) => {
38
+ const o = l.slice(2, -2).trim().match(/(".*?"|[^"\s]+)(?=\s*|\s*$)/g);
36
39
  if (o && o.length > 0) {
37
- const [l] = o;
38
- C(l) && !s.includes(l) && (i({
39
- type: r.Warning,
40
- message: a("custom-fields.invalid-custom-fields")
40
+ const [i] = o;
41
+ w(i) && !s.includes(i) && (a({
42
+ type: c.Warning,
43
+ message: r("custom-fields.invalid-custom-fields")
41
44
  }), n = !1);
42
45
  }
43
46
  }), n;
44
- }, S = async (e, s, t) => {
45
- const n = t ? await v(e) : !0;
46
- return w(e, s) && n;
47
- }, E = (e) => e.length > 0 ? !0 : (i({
48
- type: r.Warning,
49
- message: a("newsletter.html-content-is-empty")
50
- }), !1), A = (e) => {
47
+ }, k = async (e, s, t) => {
48
+ const n = t ? await b(e) : !0;
49
+ return A(e, s) && n;
50
+ }, x = (e) => e.length > 0 ? !0 : (a({
51
+ type: c.Warning,
52
+ message: r("newsletter.html-content-is-empty")
53
+ }), !1), I = (e) => {
51
54
  const s = (e.match(/{/gm) || []).length, t = (e.match(/}/gm) || []).length;
52
- return s > t && i({
53
- type: r.Warning,
54
- message: a("custom-fields.missing-closing-braces")
55
- }), s < t && i({
56
- type: r.Warning,
57
- message: a("custom-fields.missing-opening-braces")
55
+ return s > t && a({
56
+ type: c.Warning,
57
+ message: r("custom-fields.missing-closing-braces")
58
+ }), s < t && a({
59
+ type: c.Warning,
60
+ message: r("custom-fields.missing-opening-braces")
58
61
  }), s === t;
59
- }, I = (e) => {
62
+ }, F = (e) => {
60
63
  const s = e.match(/{{\s*(\w+\s+((\w+\|\w+)|(\w+)))\s*}}/gm) === null;
61
- return s || i({
62
- type: r.Warning,
63
- message: a("custom-fields.invalid-custom-fields")
64
+ return s || a({
65
+ type: c.Warning,
66
+ message: r("custom-fields.invalid-custom-fields")
64
67
  }), s;
65
- }, k = (e, s) => {
68
+ }, T = (e, s) => {
66
69
  const t = e.match(/{{([a-zA-Z0-9_\s]*)}}/gm);
67
70
  if (t && !p) {
68
- const n = new Set(s.map((l) => l.toLowerCase())), c = z(e), o = [];
69
- if (t.forEach((l) => {
70
- const m = l.slice(2, -2).trim().toLowerCase();
71
- (!n.has(m) || m === "") && !K(m, c) && o.push(m);
71
+ const n = new Set(s.map((i) => i.toLowerCase())), l = Q(e), o = [];
72
+ if (t.forEach((i) => {
73
+ const m = i.slice(2, -2).trim().toLowerCase();
74
+ (!n.has(m) || m === "") && !ee(m, l) && o.push(m);
72
75
  }), o.length > 0) {
73
- const l = `
76
+ const i = `
74
77
  <ul>
75
78
  ${o.map((m) => `<li>${m}</li>`).join("")}
76
79
  </ul>
77
80
  `;
78
- return i({
79
- type: r.Alert,
80
- message: a("custom-fields.invalid-custom-fields") + l
81
+ return a({
82
+ type: c.Alert,
83
+ message: r("custom-fields.invalid-custom-fields") + i
81
84
  }), !1;
82
85
  }
83
86
  }
84
87
  return !0;
85
- }, x = (e) => {
88
+ }, R = (e) => {
86
89
  const s = e.match(/{%(.*?)%}/g), t = [];
87
90
  let n = !0;
88
- if (s && s.forEach((c) => {
89
- const o = c.match(L), l = c.match(V), m = o?.join("") || "";
90
- (!o || c !== m) && !l && (i({
91
- type: r.Alert,
92
- message: a("newsletter.display-conditions-invalid-syntax")
91
+ if (s && s.forEach((l) => {
92
+ const o = l.match(P), i = l.match(G), m = (o == null ? void 0 : o.join("")) || "";
93
+ (!o || l !== m) && !i && (a({
94
+ type: c.Alert,
95
+ message: r("newsletter.display-conditions-invalid-syntax")
93
96
  }), n = !1), o && o.forEach((f) => {
94
- f.trim() === "=" && (i({
95
- type: r.Alert,
96
- message: a("custom-conditions.wrong-equality-operators")
97
+ f.trim() === "=" && (a({
98
+ type: c.Alert,
99
+ message: r("custom-conditions.wrong-equality-operators")
97
100
  }), n = !1);
98
- const y = f.match(/^[a-zA-Z]*$/g);
99
- y && y.forEach((h) => {
100
- b(h) && t.push(h);
101
+ const v = f.match(/^[a-zA-Z]*$/g);
102
+ v && v.forEach((C) => {
103
+ E(C) && t.push(C);
101
104
  });
102
105
  });
103
106
  }), t.length) {
104
- const c = t.filter((l) => l === "if"), o = t.filter((l) => l === "endif");
105
- c.length !== o.length && (i({
106
- type: r.Alert,
107
- message: a("custom-conditions.missing-if-endif-tag")
107
+ const l = t.filter((i) => i === "if"), o = t.filter((i) => i === "endif");
108
+ l.length !== o.length && (a({
109
+ type: c.Alert,
110
+ message: r("custom-conditions.missing-if-endif-tag")
108
111
  }), n = !1);
109
112
  }
110
113
  return n;
111
- }, T = (e) => {
114
+ }, B = (e) => {
112
115
  const s = (e.match(/{% /gm) || []).length, t = (e.match(/ %}/gm) || []).length, n = s === t;
113
- return n || i({
114
- type: r.Warning,
115
- message: a("custom-conditions.no-space-after-braces")
116
+ return n || a({
117
+ type: c.Warning,
118
+ message: r("custom-conditions.no-space-after-braces")
116
119
  }), n;
117
- }, F = (e) => (e.match(/({%(.*?)%})/g) || []).filter((t) => t.includes("if")).map((t) => (t.match(/{{.*}}/gm) || []).length).reduce((t, n) => t + n, 0) > 0 ? (i({
118
- type: r.Warning,
119
- message: a("custom-conditions.no-braces-inside-if-tag")
120
- }), !1) : !0, W = () => g.recommendationConfigs && Object.values(g.recommendationConfigs).find((s) => s.filters.find((t) => t.value === "")) !== void 0 ? (i({
121
- type: r.Alert,
122
- message: a("newsletter.fill-all-necessary-fields")
123
- }), !1) : !0, N = (e) => {
120
+ }, W = (e) => (e.match(/({%(.*?)%})/g) || []).filter((t) => t.includes("if")).map((t) => (t.match(/{{.*}}/gm) || []).length).reduce((t, n) => t + n, 0) > 0 ? (a({
121
+ type: c.Warning,
122
+ message: r("custom-conditions.no-braces-inside-if-tag")
123
+ }), !1) : !0, N = () => S.hasInvalidBlock() ? (a({
124
+ type: c.Alert,
125
+ message: r(j)
126
+ }), !1) : !0, O = () => g.recommendationConfigs && Object.values(g.recommendationConfigs).find((s) => s.filters.find((t) => t.value === "")) !== void 0 ? (a({
127
+ type: c.Alert,
128
+ message: r("newsletter.fill-all-necessary-fields")
129
+ }), !1) : !0, D = (e) => {
124
130
  const s = /src="[^"]*\.(svg|pst)"/gm;
125
- return e.match(s) === null ? !0 : (i({
126
- type: r.Alert,
127
- message: a("newsletter.invalid-image-type")
131
+ return e.match(s) === null ? !0 : (a({
132
+ type: c.Alert,
133
+ message: r("newsletter.invalid-image-type")
128
134
  }), !1);
129
- }, O = (e) => {
135
+ }, L = (e) => {
130
136
  const n = new DOMParser().parseFromString(e, "text/html").querySelectorAll(".checkbox-block-v2");
131
- return Array.from(n).find((o) => !o.id?.trim()) ? (i({
132
- type: r.Alert,
133
- message: a("unsubscribe-templates.select-checkbox-groups")
137
+ return Array.from(n).find((o) => {
138
+ var i;
139
+ return !((i = o.id) != null && i.trim());
140
+ }) ? (a({
141
+ type: c.Alert,
142
+ message: r("unsubscribe-templates.select-checkbox-groups")
134
143
  }), !1) : !0;
135
- }, B = (e) => {
144
+ }, V = (e) => {
136
145
  const n = new DOMParser().parseFromString(e, "text/html").querySelectorAll(".radio-button-v2");
137
- return Array.from(n).find((o) => !o.id?.trim()) ? (i({
138
- type: r.Alert,
139
- message: a("unsubscribe-templates.select-radio-button-groups")
146
+ return Array.from(n).find((o) => {
147
+ var i;
148
+ return !((i = o.id) != null && i.trim());
149
+ }) ? (a({
150
+ type: c.Alert,
151
+ message: r("unsubscribe-templates.select-radio-button-groups")
140
152
  }), !1) : !0;
141
153
  };
142
154
  return { validateHtml: async (e, s, t = !1) => {
155
+ var o, i;
143
156
  const n = [
144
- ...s.map((o) => o.value),
145
- ...P,
146
- ...d.value?.template?.customFieldAttributes ?? []
157
+ ...s.map((m) => m.value),
158
+ ...q,
159
+ ...((i = (o = d.value) == null ? void 0 : o.template) == null ? void 0 : i.customFieldAttributes) ?? []
147
160
  ];
148
- return await S(e, n, t) && E(e) && A(e) && I(e) && k(e, n) && x(e) && T(e) && F(e) && W() && N(e) && O(e) && B(e);
161
+ return await k(e, n, t) && x(e) && I(e) && F(e) && T(e, n) && R(e) && B(e) && W(e) && N() && O() && D(e) && L(e) && V(e);
149
162
  } };
150
163
  };
151
164
  export {
152
- ae as useHtmlValidator
165
+ ge as useHtmlValidator
153
166
  };