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

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 (279) hide show
  1. package/README.md +1 -0
  2. package/dist/@types/config/schemas.js +66 -54
  3. package/dist/@types/config/validator.js +27 -34
  4. package/dist/components/Guido.vue.js +4 -4
  5. package/dist/components/Guido.vue2.js +87 -82
  6. package/dist/components/organisms/base/Toaster.vue2.js +10 -11
  7. package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue2.js +12 -12
  8. package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue.js +7 -7
  9. package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue2.js +12 -20
  10. package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue2.js +6 -6
  11. package/dist/components/organisms/email-preview/mobile-preview/InboxView.vue2.js +9 -15
  12. package/dist/components/organisms/extensions/recommendation/FilterItem.vue2.js +31 -40
  13. package/dist/components/organisms/extensions/recommendation/FilterSelectionDrawer.vue2.js +19 -20
  14. package/dist/components/organisms/extensions/recommendation/Filters.vue2.js +11 -14
  15. package/dist/components/organisms/header/EditorActions.vue.js +12 -13
  16. package/dist/components/organisms/header/EditorActions.vue2.js +51 -40
  17. package/dist/components/organisms/header/HeaderWrapper.vue2.js +12 -15
  18. package/dist/components/organisms/header/LeftSlot.vue2.js +16 -19
  19. package/dist/components/organisms/header/MiddleSlot.vue2.js +14 -11
  20. package/dist/components/organisms/header/RightSlot.vue.js +10 -10
  21. package/dist/components/organisms/header/RightSlot.vue2.js +13 -13
  22. package/dist/components/organisms/onboarding/AMPOnboarding.vue.js +11 -12
  23. package/dist/components/organisms/onboarding/AMPOnboarding.vue2.js +49 -31
  24. package/dist/components/organisms/onboarding/GenericOnboarding.vue.js +12 -13
  25. package/dist/components/organisms/onboarding/GenericOnboarding.vue2.js +36 -38
  26. package/dist/components/organisms/onboarding/ItemsOnboarding.vue.js +12 -13
  27. package/dist/components/organisms/onboarding/ItemsOnboarding.vue2.js +47 -51
  28. package/dist/components/organisms/onboarding/NewVersionPopup.vue2.js +18 -21
  29. package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +27 -31
  30. package/dist/components/organisms/onboarding/TextBlockOnboarding.vue.js +12 -13
  31. package/dist/components/organisms/onboarding/TextBlockOnboarding.vue2.js +33 -46
  32. package/dist/components/organisms/onboarding/VersionHistoryOnboarding.vue.js +11 -12
  33. package/dist/components/organisms/onboarding/VersionHistoryOnboarding.vue2.js +20 -21
  34. package/dist/components/organisms/save-as-template/SaveAsTemplateDrawer.vue2.js +18 -18
  35. package/dist/components/organisms/unsubscribe/UnsubscribeWrapper.vue.js +9 -10
  36. package/dist/composables/useActionsApi.js +37 -38
  37. package/dist/composables/useBlocksConfig.js +26 -26
  38. package/dist/composables/useFullStoryBridge.js +13 -0
  39. package/dist/composables/useHtmlCompiler.js +34 -24
  40. package/dist/composables/useHtmlValidator.js +91 -97
  41. package/dist/composables/useHttp.js +30 -30
  42. package/dist/composables/usePartner.js +1 -1
  43. package/dist/composables/usePreviewMode.js +20 -16
  44. package/dist/composables/useRecommendation.js +14 -15
  45. package/dist/composables/useRibbonOffset.js +21 -0
  46. package/dist/composables/useSave.js +23 -16
  47. package/dist/composables/useStripo.js +55 -47
  48. package/dist/composables/useSyncModuleExtractor.js +31 -29
  49. package/dist/composables/useTimerClone.js +24 -25
  50. package/dist/composables/useTranslations.js +2 -3
  51. package/dist/composables/useValidation.js +7 -8
  52. package/dist/composables/validators/useLiquidValidator.js +42 -0
  53. package/dist/config/compiler/liquidCompilerRules.js +15 -0
  54. package/dist/config/compiler/recommendationCompilerRules.js +162 -43
  55. package/dist/config/compiler/unsubscribeCompilerRules.js +45 -44
  56. package/dist/config/compiler/utils/recommendationCompilerUtils.js +51 -46
  57. package/dist/config/migrator/checkboxMigrator.js +23 -22
  58. package/dist/config/migrator/couponBlockMigrator.js +18 -19
  59. package/dist/config/migrator/itemsBlockMigrator.js +87 -89
  60. package/dist/config/migrator/radioButtonMigrator.js +19 -18
  61. package/dist/config/migrator/recommendationMigrator.js +107 -110
  62. package/dist/config/migrator/unsubscribeMigrator.js +10 -11
  63. package/dist/enums/extensions/recommendationBlock.js +14 -11
  64. package/dist/enums/onboarding.js +7 -2
  65. package/dist/enums/recommendation.js +2 -2
  66. package/dist/enums/unsubscribe.js +33 -27
  67. package/dist/extensions/Blocks/CouponBlock/template.js +24 -13
  68. package/dist/extensions/Blocks/Items/block.js +9 -9
  69. package/dist/extensions/Blocks/Items/controls/button/link.js +14 -14
  70. package/dist/extensions/Blocks/Items/controls/cardComposition.js +89 -97
  71. package/dist/extensions/Blocks/Items/controls/image/link.js +14 -14
  72. package/dist/extensions/Blocks/Items/controls/name/trimming.js +23 -24
  73. package/dist/extensions/Blocks/Items/controls/price/currencyLocation.js +13 -14
  74. package/dist/extensions/Blocks/Items/controls/price/currencySymbol.js +44 -47
  75. package/dist/extensions/Blocks/Items/controls/price/formattedPrice.js +38 -38
  76. package/dist/extensions/Blocks/Items/controls/price/hideDiscount.js +11 -11
  77. package/dist/extensions/Blocks/Items/controls/price/priceOrientation.js +38 -40
  78. package/dist/extensions/Blocks/Items/controls/price/singlePrice.js +35 -35
  79. package/dist/extensions/Blocks/Items/controls/settingsControl.js +155 -162
  80. package/dist/extensions/Blocks/Items/enums/productEnums.js +21 -14
  81. package/dist/extensions/Blocks/Items/template.js +210 -210
  82. package/dist/extensions/Blocks/Recommendation/constants/controlIds.js +1 -1
  83. package/dist/extensions/Blocks/Recommendation/constants/selectors.js +27 -11
  84. package/dist/extensions/Blocks/Recommendation/controls/button/index.js +36 -36
  85. package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +208 -200
  86. package/dist/extensions/Blocks/Recommendation/controls/customAttribute/index.js +23 -20
  87. package/dist/extensions/Blocks/Recommendation/controls/customAttribute/textTrim.js +99 -0
  88. package/dist/extensions/Blocks/Recommendation/controls/image/index.js +9 -9
  89. package/dist/extensions/Blocks/Recommendation/controls/main/algorithm.js +19 -20
  90. package/dist/extensions/Blocks/Recommendation/controls/main/filters.js +4 -6
  91. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +84 -90
  92. package/dist/extensions/Blocks/Recommendation/controls/main/layoutOrientation.js +18 -18
  93. package/dist/extensions/Blocks/Recommendation/controls/main/productCount.js +4 -4
  94. package/dist/extensions/Blocks/Recommendation/controls/main/productLayout.js +35 -36
  95. package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +127 -126
  96. package/dist/extensions/Blocks/Recommendation/controls/name/index.js +24 -24
  97. package/dist/extensions/Blocks/Recommendation/controls/name/textTrim.js +27 -57
  98. package/dist/extensions/Blocks/Recommendation/controls/oldPrice/index.js +24 -24
  99. package/dist/extensions/Blocks/Recommendation/controls/omnibusDiscount/index.js +24 -24
  100. package/dist/extensions/Blocks/Recommendation/controls/omnibusDiscount/textAfter.js +4 -4
  101. package/dist/extensions/Blocks/Recommendation/controls/omnibusDiscount/textBefore.js +4 -4
  102. package/dist/extensions/Blocks/Recommendation/controls/omnibusPrice/index.js +24 -24
  103. package/dist/extensions/Blocks/Recommendation/controls/omnibusPrice/textAfter.js +4 -4
  104. package/dist/extensions/Blocks/Recommendation/controls/omnibusPrice/textBefore.js +4 -4
  105. package/dist/extensions/Blocks/Recommendation/controls/price/index.js +24 -24
  106. package/dist/extensions/Blocks/Recommendation/controls/shared/textTrimCssRules.js +14 -0
  107. package/dist/extensions/Blocks/Recommendation/controls/spacing/index.js +50 -50
  108. package/dist/extensions/Blocks/Recommendation/controls/syncInfoMessage.js +18 -20
  109. package/dist/extensions/Blocks/Recommendation/extension.js +31 -32
  110. package/dist/extensions/Blocks/Recommendation/settingsPanel.js +25 -32
  111. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +72 -69
  112. package/dist/extensions/Blocks/Recommendation/templates/grid/elementRenderer.js +24 -23
  113. package/dist/extensions/Blocks/Recommendation/templates/grid/migration.js +10 -10
  114. package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +28 -27
  115. package/dist/extensions/Blocks/Recommendation/templates/index.js +9 -9
  116. package/dist/extensions/Blocks/Recommendation/templates/list/elementRenderer.js +26 -25
  117. package/dist/extensions/Blocks/Recommendation/templates/list/template.js +21 -21
  118. package/dist/extensions/Blocks/Recommendation/templates/utils.js +53 -48
  119. package/dist/extensions/Blocks/Recommendation/utils/filterUtil.js +17 -14
  120. package/dist/extensions/Blocks/Recommendation/validation/filterSchema.js +13 -16
  121. package/dist/extensions/Blocks/Unsubscribe/block.js +11 -11
  122. package/dist/extensions/Blocks/Unsubscribe/control.js +11 -13
  123. package/dist/extensions/Blocks/Unsubscribe/elements/preview.js +16 -18
  124. package/dist/extensions/Blocks/common-control.js +25 -26
  125. package/dist/extensions/DynamicContent/dynamic-content.js +59 -59
  126. package/dist/guido.css +1 -1
  127. package/dist/library.js +11 -12
  128. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +232 -210
  129. package/dist/node_modules/lodash-es/_getValue.js +1 -1
  130. package/dist/node_modules/valibot/dist/index.js +122 -126
  131. package/dist/package.json.js +1 -1
  132. package/dist/services/recommendationApi.js +12 -15
  133. package/dist/services/stripoApi.js +9 -9
  134. package/dist/services/templateLibraryApi.js +49 -48
  135. package/dist/src/@types/config/index.d.ts +1 -1
  136. package/dist/src/@types/config/schemas.d.ts +28 -0
  137. package/dist/src/@types/config/types.d.ts +3 -1
  138. package/dist/src/@types/generic.d.ts +0 -1
  139. package/dist/src/@types/save-as-template.d.ts +1 -0
  140. package/dist/src/components/wrappers/WpModal.vue.d.ts +1 -1
  141. package/dist/src/composables/useActionsApi.d.ts +1 -1
  142. package/dist/src/composables/useConfig.d.ts +12 -0
  143. package/dist/src/composables/useFullStoryBridge.d.ts +11 -0
  144. package/dist/src/composables/useHtmlCompiler.d.ts +1 -2
  145. package/dist/src/composables/useRibbonOffset.d.ts +4 -0
  146. package/dist/src/composables/validators/useLiquidValidator.d.ts +3 -0
  147. package/dist/src/config/compiler/liquidCompilerRules.d.ts +2 -0
  148. package/dist/src/config/compiler/utils/recommendationCompilerUtils.d.ts +1 -1
  149. package/dist/src/enums/extensions/recommendationBlock.d.ts +3 -0
  150. package/dist/src/enums/onboarding.d.ts +6 -0
  151. package/dist/src/enums/unsubscribe.d.ts +5 -0
  152. package/dist/src/extensions/Blocks/CouponBlock/template.d.ts +2 -0
  153. package/dist/src/extensions/Blocks/Recommendation/constants/controlIds.d.ts +1 -0
  154. package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +1 -1
  155. package/dist/src/extensions/Blocks/Recommendation/constants/selectors.d.ts +5 -0
  156. package/dist/src/extensions/Blocks/Recommendation/controls/cardComposition/index.d.ts +5 -0
  157. package/dist/src/extensions/Blocks/Recommendation/controls/customAttribute/index.d.ts +3 -0
  158. package/dist/src/extensions/Blocks/Recommendation/controls/customAttribute/textTrim.d.ts +35 -0
  159. package/dist/src/extensions/Blocks/Recommendation/controls/name/textTrim.d.ts +3 -20
  160. package/dist/src/extensions/Blocks/Recommendation/controls/shared/textTrimCssRules.d.ts +29 -0
  161. package/dist/src/extensions/Blocks/Recommendation/templates/grid/template.d.ts +4 -4
  162. package/dist/src/extensions/Blocks/Recommendation/templates/list/template.d.ts +3 -3
  163. package/dist/src/extensions/Blocks/Recommendation/templates/utils.d.ts +20 -3
  164. package/dist/src/extensions/Blocks/Recommendation/utils/tagName.d.ts +3 -3
  165. package/dist/src/services/templateLibraryApi.d.ts +1 -1
  166. package/dist/src/stores/config.d.ts +108 -0
  167. package/dist/src/stores/dynamic-content.d.ts +3 -3
  168. package/dist/src/stores/onboarding.d.ts +4 -0
  169. package/dist/src/stores/preview.d.ts +3 -0
  170. package/dist/src/utils/genericUtil.d.ts +1 -1
  171. package/dist/src/utils/htmlCompiler.d.ts +2 -1
  172. package/dist/static/styles/base.css.js +7 -2
  173. package/dist/static/styles/components/button.css.js +3 -2
  174. package/dist/static/styles/components/loader.css.js +4 -0
  175. package/dist/stores/config.js +25 -81
  176. package/dist/stores/dynamic-content.js +6 -11
  177. package/dist/stores/onboarding.js +5 -1
  178. package/dist/stores/preview.js +8 -10
  179. package/dist/stores/unsubscribe.js +1 -4
  180. package/dist/utils/dateUtil.js +7 -10
  181. package/dist/utils/genericUtil.js +39 -20
  182. package/dist/utils/htmlCompiler.js +48 -41
  183. package/dist/utils/pairProductVariables.js +13 -14
  184. package/dist/utils/templatePreparation.js +36 -25
  185. package/dist/utils/tooltipUtils.js +4 -5
  186. package/package.json +9 -4
  187. package/dist/node_modules/lodash-es/_DataView.js +0 -6
  188. package/dist/node_modules/lodash-es/_Promise.js +0 -6
  189. package/dist/node_modules/lodash-es/_Set.js +0 -6
  190. package/dist/node_modules/lodash-es/_SetCache.js +0 -13
  191. package/dist/node_modules/lodash-es/_Stack.js +0 -18
  192. package/dist/node_modules/lodash-es/_Uint8Array.js +0 -5
  193. package/dist/node_modules/lodash-es/_WeakMap.js +0 -6
  194. package/dist/node_modules/lodash-es/_arrayFilter.js +0 -10
  195. package/dist/node_modules/lodash-es/_arrayLikeKeys.js +0 -20
  196. package/dist/node_modules/lodash-es/_arrayMap.js +0 -8
  197. package/dist/node_modules/lodash-es/_arrayPush.js +0 -8
  198. package/dist/node_modules/lodash-es/_arraySome.js +0 -9
  199. package/dist/node_modules/lodash-es/_baseEach.js +0 -6
  200. package/dist/node_modules/lodash-es/_baseFlatten.js +0 -13
  201. package/dist/node_modules/lodash-es/_baseFor.js +0 -5
  202. package/dist/node_modules/lodash-es/_baseForOwn.js +0 -8
  203. package/dist/node_modules/lodash-es/_baseGet.js +0 -11
  204. package/dist/node_modules/lodash-es/_baseGetAllKeys.js +0 -9
  205. package/dist/node_modules/lodash-es/_baseHasIn.js +0 -6
  206. package/dist/node_modules/lodash-es/_baseIsArguments.js +0 -9
  207. package/dist/node_modules/lodash-es/_baseIsEqual.js +0 -8
  208. package/dist/node_modules/lodash-es/_baseIsEqualDeep.js +0 -32
  209. package/dist/node_modules/lodash-es/_baseIsMatch.js +0 -29
  210. package/dist/node_modules/lodash-es/_baseIsTypedArray.js +0 -12
  211. package/dist/node_modules/lodash-es/_baseIteratee.js +0 -11
  212. package/dist/node_modules/lodash-es/_baseKeys.js +0 -14
  213. package/dist/node_modules/lodash-es/_baseMap.js +0 -11
  214. package/dist/node_modules/lodash-es/_baseMatches.js +0 -12
  215. package/dist/node_modules/lodash-es/_baseMatchesProperty.js +0 -17
  216. package/dist/node_modules/lodash-es/_baseProperty.js +0 -8
  217. package/dist/node_modules/lodash-es/_basePropertyDeep.js +0 -9
  218. package/dist/node_modules/lodash-es/_baseRange.js +0 -9
  219. package/dist/node_modules/lodash-es/_baseTimes.js +0 -8
  220. package/dist/node_modules/lodash-es/_baseToString.js +0 -18
  221. package/dist/node_modules/lodash-es/_baseTrim.js +0 -8
  222. package/dist/node_modules/lodash-es/_baseUnary.js +0 -8
  223. package/dist/node_modules/lodash-es/_cacheHas.js +0 -6
  224. package/dist/node_modules/lodash-es/_castPath.js +0 -10
  225. package/dist/node_modules/lodash-es/_createBaseEach.js +0 -15
  226. package/dist/node_modules/lodash-es/_createBaseFor.js +0 -13
  227. package/dist/node_modules/lodash-es/_createRange.js +0 -11
  228. package/dist/node_modules/lodash-es/_equalArrays.js +0 -40
  229. package/dist/node_modules/lodash-es/_equalByTag.js +0 -45
  230. package/dist/node_modules/lodash-es/_equalObjects.js +0 -36
  231. package/dist/node_modules/lodash-es/_getAllKeys.js +0 -9
  232. package/dist/node_modules/lodash-es/_getMatchData.js +0 -12
  233. package/dist/node_modules/lodash-es/_getSymbols.js +0 -10
  234. package/dist/node_modules/lodash-es/_getTag.js +0 -28
  235. package/dist/node_modules/lodash-es/_hasPath.js +0 -19
  236. package/dist/node_modules/lodash-es/_isFlattenable.js +0 -10
  237. package/dist/node_modules/lodash-es/_isIndex.js +0 -8
  238. package/dist/node_modules/lodash-es/_isIterateeCall.js +0 -13
  239. package/dist/node_modules/lodash-es/_isKey.js +0 -12
  240. package/dist/node_modules/lodash-es/_isPrototype.js +0 -8
  241. package/dist/node_modules/lodash-es/_isStrictComparable.js +0 -7
  242. package/dist/node_modules/lodash-es/_mapToArray.js +0 -9
  243. package/dist/node_modules/lodash-es/_matchesStrictComparable.js +0 -8
  244. package/dist/node_modules/lodash-es/_memoizeCapped.js +0 -11
  245. package/dist/node_modules/lodash-es/_nativeKeys.js +0 -5
  246. package/dist/node_modules/lodash-es/_nodeUtil.js +0 -11
  247. package/dist/node_modules/lodash-es/_overArg.js +0 -8
  248. package/dist/node_modules/lodash-es/_setCacheAdd.js +0 -7
  249. package/dist/node_modules/lodash-es/_setCacheHas.js +0 -6
  250. package/dist/node_modules/lodash-es/_setToArray.js +0 -9
  251. package/dist/node_modules/lodash-es/_stackClear.js +0 -7
  252. package/dist/node_modules/lodash-es/_stackDelete.js +0 -7
  253. package/dist/node_modules/lodash-es/_stackGet.js +0 -6
  254. package/dist/node_modules/lodash-es/_stackHas.js +0 -6
  255. package/dist/node_modules/lodash-es/_stackSet.js +0 -17
  256. package/dist/node_modules/lodash-es/_stringToPath.js +0 -10
  257. package/dist/node_modules/lodash-es/_toKey.js +0 -10
  258. package/dist/node_modules/lodash-es/_trimmedEndIndex.js +0 -9
  259. package/dist/node_modules/lodash-es/flatMap.js +0 -8
  260. package/dist/node_modules/lodash-es/get.js +0 -8
  261. package/dist/node_modules/lodash-es/hasIn.js +0 -8
  262. package/dist/node_modules/lodash-es/identity.js +0 -6
  263. package/dist/node_modules/lodash-es/isArguments.js +0 -10
  264. package/dist/node_modules/lodash-es/isArray.js +0 -4
  265. package/dist/node_modules/lodash-es/isArrayLike.js +0 -8
  266. package/dist/node_modules/lodash-es/isBuffer.js +0 -6
  267. package/dist/node_modules/lodash-es/isLength.js +0 -7
  268. package/dist/node_modules/lodash-es/isObjectLike.js +0 -6
  269. package/dist/node_modules/lodash-es/isSymbol.js +0 -9
  270. package/dist/node_modules/lodash-es/isTypedArray.js +0 -7
  271. package/dist/node_modules/lodash-es/keys.js +0 -9
  272. package/dist/node_modules/lodash-es/map.js +0 -11
  273. package/dist/node_modules/lodash-es/property.js +0 -10
  274. package/dist/node_modules/lodash-es/range.js +0 -5
  275. package/dist/node_modules/lodash-es/stubArray.js +0 -6
  276. package/dist/node_modules/lodash-es/stubFalse.js +0 -6
  277. package/dist/node_modules/lodash-es/toFinite.js +0 -14
  278. package/dist/node_modules/lodash-es/toNumber.js +0 -22
  279. package/dist/node_modules/lodash-es/toString.js +0 -7
@@ -0,0 +1,13 @@
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)
4
+ return;
5
+ const r = document.querySelector("ui-editor")?.shadowRoot?.querySelector("iframe")?.contentDocument;
6
+ if (!r || r.querySelector('script[data-fullstory-bridge="true"]'))
7
+ 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);
10
+ } });
11
+ export {
12
+ c as useFullStoryBridge
13
+ };
@@ -1,27 +1,37 @@
1
- import { defaultHtmlCompilerRules as p } from "../config/compiler/htmlCompilerRules.js";
2
- import { itemsCompilerRules as u } from "../config/compiler/itemsCompilerRules.js";
3
- import { outlookCompilerRules as c } from "../config/compiler/outlookCompilerRules.js";
4
- import { recommendationCompilerRules as n } from "../config/compiler/recommendationCompilerRules.js";
5
- import { socialCompilerRules as f } from "../config/compiler/socialCompilerRules.js";
6
- import { unsubscribeCompilerRules as R } from "../config/compiler/unsubscribeCompilerRules.js";
7
- import { createHtmlCompiler as a } from "../utils/htmlCompiler.js";
8
- import { useConfig as C } from "./useConfig.js";
9
- const B = () => {
10
- var m, l;
11
- const { compiler: e } = C(), r = ((m = e.value) == null ? void 0 : m.customRules) || [], t = [
12
- ...!!((l = e.value) != null && l.ignoreDefaultRules) ? [] : p,
13
- ...n,
14
- ...R,
15
- ...u,
16
- ...c,
17
- ...f,
18
- ...r.map((o, s) => ({
19
- ...o,
20
- priority: o.priority + 1e3 + s
21
- // Ensure additional rules run after default rules
22
- }))
23
- ], i = a(t);
24
- return { compileHtml: (o) => i.compile(o) };
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";
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) };
25
35
  };
26
36
  export {
27
37
  B as useHtmlCompiler
@@ -1,159 +1,153 @@
1
- import { useConfig as L } from "./useConfig.js";
2
- import { TemplateTypes as V } from "../enums/defaults.js";
3
- import { DISPLAY_CONDITIONS_REGEX as _, DISPLAY_CONDITIONS_EXCEPTIONS_REGEX as H, CampaignCouldNotBeSavedKey as P, CanNotMakeAnyChangesForRunningKey as G } from "../enums/html-validator.js";
4
- import { ToasterTypeOptions as c } from "../enums/toaster.js";
5
- import { itemsBlockDynamicVariables as M } from "../extensions/Blocks/Items/enums/productEnums.js";
6
- import { useRecommendationStore as $ } from "../stores/recommendation.js";
7
- import { base64EncodeWithSpecialChars as X } from "../utils/base64.js";
8
- import { useHttp as j } from "./useHttp.js";
9
- import { useToaster as q } from "./useToaster.js";
10
- import { useTranslations as z } from "./useTranslations.js";
11
- const K = /recommendation-id="(\d+)"/g;
12
- function U(i) {
13
- return [...i.matchAll(K)].map((u) => u[1]);
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]);
14
14
  }
15
- function Y(i, u) {
15
+ function K(i, u) {
16
16
  return u.some((d) => i.startsWith(`${d}_`));
17
17
  }
18
- const ce = () => {
19
- var y, h;
20
- const { showToaster: i } = q(), { post: u } = j(), { config: d } = L(), r = z(), g = $(), p = ((h = (y = d.value) == null ? void 0 : y.partner) == null ? void 0 : h.messageType) === V.transactional, w = async (e) => {
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) => {
21
20
  const t = await u(
22
21
  "/newsletter/template-library/check-template-html-body",
23
- { html: X(e) }
24
- ), { status: n, message: l } = t.data;
22
+ { html: M(e) }
23
+ ), { status: n, message: c } = t.data;
25
24
  return n || i({
26
- type: c.Alert,
27
- message: n === void 0 ? l : r("newsletter.invalid-url-link-for-toaster")
28
- }), r(P), l === r(G) && i({
29
- type: c.Alert,
30
- message: r("newsletter.already-in-progress")
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")
31
30
  }), n;
32
- }, b = (e) => !["if", "endif", "else", "elif", "now"].includes(e.toLowerCase()), S = (e) => ["if", "endif"].includes(e.toLowerCase()), E = (e, s) => {
31
+ }, C = (e) => !["if", "endif", "else", "elif", "now"].includes(e.toLowerCase()), b = (e) => ["if", "endif"].includes(e.toLowerCase()), w = (e, s) => {
33
32
  const t = e.match(/({%(.*?)%})/g);
34
33
  let n = !0;
35
- return t !== null && !p && t.forEach((l) => {
36
- const o = l.slice(2, -2).trim().match(/(".*?"|[^"\s]+)(?=\s*|\s*$)/g);
34
+ return t !== null && !p && t.forEach((c) => {
35
+ const o = c.slice(2, -2).trim().match(/(".*?"|[^"\s]+)(?=\s*|\s*$)/g);
37
36
  if (o && o.length > 0) {
38
- const [a] = o;
39
- b(a) && !s.includes(a) && (i({
40
- type: c.Warning,
41
- message: r("custom-fields.invalid-custom-fields")
37
+ const [l] = o;
38
+ C(l) && !s.includes(l) && (i({
39
+ type: r.Warning,
40
+ message: a("custom-fields.invalid-custom-fields")
42
41
  }), n = !1);
43
42
  }
44
43
  }), n;
45
- }, A = async (e, s, t) => {
46
- const n = t ? await w(e) : !0;
47
- return E(e, s) && n;
48
- }, I = (e) => e.length > 0 ? !0 : (i({
49
- type: c.Warning,
50
- message: r("newsletter.html-content-is-empty")
51
- }), !1), k = (e) => {
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) => {
52
51
  const s = (e.match(/{/gm) || []).length, t = (e.match(/}/gm) || []).length;
53
52
  return s > t && i({
54
- type: c.Warning,
55
- message: r("custom-fields.missing-closing-braces")
53
+ type: r.Warning,
54
+ message: a("custom-fields.missing-closing-braces")
56
55
  }), s < t && i({
57
- type: c.Warning,
58
- message: r("custom-fields.missing-opening-braces")
56
+ type: r.Warning,
57
+ message: a("custom-fields.missing-opening-braces")
59
58
  }), s === t;
60
- }, x = (e) => {
59
+ }, I = (e) => {
61
60
  const s = e.match(/{{\s*(\w+\s+((\w+\|\w+)|(\w+)))\s*}}/gm) === null;
62
61
  return s || i({
63
- type: c.Warning,
64
- message: r("custom-fields.invalid-custom-fields")
62
+ type: r.Warning,
63
+ message: a("custom-fields.invalid-custom-fields")
65
64
  }), s;
66
- }, T = (e, s) => {
65
+ }, k = (e, s) => {
67
66
  const t = e.match(/{{([a-zA-Z0-9_\s]*)}}/gm);
68
67
  if (t && !p) {
69
- const n = new Set(s.map((a) => a.toLowerCase())), l = U(e), o = [];
70
- if (t.forEach((a) => {
71
- const m = a.slice(2, -2).trim().toLowerCase();
72
- (!n.has(m) || m === "") && !Y(m, l) && o.push(m);
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);
73
72
  }), o.length > 0) {
74
- const a = `
73
+ const l = `
75
74
  <ul>
76
75
  ${o.map((m) => `<li>${m}</li>`).join("")}
77
76
  </ul>
78
77
  `;
79
78
  return i({
80
- type: c.Alert,
81
- message: r("custom-fields.invalid-custom-fields") + a
79
+ type: r.Alert,
80
+ message: a("custom-fields.invalid-custom-fields") + l
82
81
  }), !1;
83
82
  }
84
83
  }
85
84
  return !0;
86
- }, F = (e) => {
85
+ }, x = (e) => {
87
86
  const s = e.match(/{%(.*?)%}/g), t = [];
88
87
  let n = !0;
89
- if (s && s.forEach((l) => {
90
- const o = l.match(_), a = l.match(H), m = (o == null ? void 0 : o.join("")) || "";
91
- (!o || l !== m) && !a && (i({
92
- type: c.Alert,
93
- message: r("newsletter.display-conditions-invalid-syntax")
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")
94
93
  }), n = !1), o && o.forEach((f) => {
95
94
  f.trim() === "=" && (i({
96
- type: c.Alert,
97
- message: r("custom-conditions.wrong-equality-operators")
95
+ type: r.Alert,
96
+ message: a("custom-conditions.wrong-equality-operators")
98
97
  }), n = !1);
99
- const v = f.match(/^[a-zA-Z]*$/g);
100
- v && v.forEach((C) => {
101
- S(C) && t.push(C);
98
+ const y = f.match(/^[a-zA-Z]*$/g);
99
+ y && y.forEach((h) => {
100
+ b(h) && t.push(h);
102
101
  });
103
102
  });
104
103
  }), t.length) {
105
- const l = t.filter((a) => a === "if"), o = t.filter((a) => a === "endif");
106
- l.length !== o.length && (i({
107
- type: c.Alert,
108
- message: r("custom-conditions.missing-if-endif-tag")
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")
109
108
  }), n = !1);
110
109
  }
111
110
  return n;
112
- }, W = (e) => {
111
+ }, T = (e) => {
113
112
  const s = (e.match(/{% /gm) || []).length, t = (e.match(/ %}/gm) || []).length, n = s === t;
114
113
  return n || i({
115
- type: c.Warning,
116
- message: r("custom-conditions.no-space-after-braces")
114
+ type: r.Warning,
115
+ message: a("custom-conditions.no-space-after-braces")
117
116
  }), n;
118
- }, N = (e) => (e.match(/({%(.*?)%})/g) || []).filter((t) => t.includes("if")).map((t) => (t.match(/{{.*}}/gm) || []).length).reduce((t, n) => t + n, 0) > 0 ? (i({
119
- type: c.Warning,
120
- message: r("custom-conditions.no-braces-inside-if-tag")
121
- }), !1) : !0, O = () => g.recommendationConfigs && Object.values(g.recommendationConfigs).find((s) => s.filters.find((t) => t.value === "")) !== void 0 ? (i({
122
- type: c.Alert,
123
- message: r("newsletter.fill-all-necessary-fields")
124
- }), !1) : !0, B = (e) => {
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) => {
125
124
  const s = /src="[^"]*\.(svg|pst)"/gm;
126
125
  return e.match(s) === null ? !0 : (i({
127
- type: c.Alert,
128
- message: r("newsletter.invalid-image-type")
126
+ type: r.Alert,
127
+ message: a("newsletter.invalid-image-type")
129
128
  }), !1);
130
- }, R = (e) => {
129
+ }, O = (e) => {
131
130
  const n = new DOMParser().parseFromString(e, "text/html").querySelectorAll(".checkbox-block-v2");
132
- return Array.from(n).find((o) => {
133
- var a;
134
- return !((a = o.id) != null && a.trim());
135
- }) ? (i({
136
- type: c.Alert,
137
- message: r("unsubscribe-templates.select-checkbox-groups")
131
+ return Array.from(n).find((o) => !o.id?.trim()) ? (i({
132
+ type: r.Alert,
133
+ message: a("unsubscribe-templates.select-checkbox-groups")
138
134
  }), !1) : !0;
139
- }, D = (e) => {
135
+ }, B = (e) => {
140
136
  const n = new DOMParser().parseFromString(e, "text/html").querySelectorAll(".radio-button-v2");
141
- return Array.from(n).find((o) => {
142
- var a;
143
- return !((a = o.id) != null && a.trim());
144
- }) ? (i({
145
- type: c.Alert,
146
- message: r("unsubscribe-templates.select-radio-button-groups")
137
+ return Array.from(n).find((o) => !o.id?.trim()) ? (i({
138
+ type: r.Alert,
139
+ message: a("unsubscribe-templates.select-radio-button-groups")
147
140
  }), !1) : !0;
148
141
  };
149
142
  return { validateHtml: async (e, s, t = !1) => {
150
143
  const n = [
151
144
  ...s.map((o) => o.value),
152
- ...M
145
+ ...P,
146
+ ...d.value?.template?.customFieldAttributes ?? []
153
147
  ];
154
- return await A(e, n, t) && I(e) && k(e) && x(e) && T(e, n) && F(e) && W(e) && N(e) && O() && B(e) && R(e) && D(e);
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);
155
149
  } };
156
150
  };
157
151
  export {
158
- ce as useHtmlValidator
152
+ ae as useHtmlValidator
159
153
  };
@@ -1,7 +1,7 @@
1
1
  import { getCsrfToken as H } from "../utils/genericUtil.js";
2
- import { ref as p, computed as T } from "vue";
3
- const k = (b = {}) => {
4
- const h = p(!1), a = p(null), u = p(null), g = T(() => h.value), y = T(() => a.value !== null), v = {
2
+ import { ref as T, computed as h } from "vue";
3
+ const k = (E = {}) => {
4
+ const d = T(!1), n = T(null), l = T(null), b = h(() => d.value), g = h(() => n.value !== null), m = {
5
5
  baseURL: "",
6
6
  timeout: 1e4,
7
7
  retry: 0,
@@ -10,11 +10,11 @@ const k = (b = {}) => {
10
10
  "Content-Type": "application/json",
11
11
  "X-CSRF-TOKEN": H()
12
12
  },
13
- ...b
13
+ ...E
14
14
  }, w = (e, s) => {
15
15
  if (e.startsWith("http://") || e.startsWith("https://"))
16
16
  return e;
17
- const t = s || v.baseURL || "";
17
+ const t = s || m.baseURL || "";
18
18
  return t.endsWith("/") && e.startsWith("/") ? `${t}${e.slice(1)}` : t.endsWith("/") || e.startsWith("/") ? `${t}${e}` : `${t}/${e}`;
19
19
  }, P = (e) => new Promise((s, t) => {
20
20
  setTimeout(() => {
@@ -23,53 +23,53 @@ const k = (b = {}) => {
23
23
  }), x = (e) => new Promise((s) => {
24
24
  setTimeout(s, e);
25
25
  }), i = async (e, s, t, D = {}) => {
26
- a.value = null, h.value = !0, u.value = new AbortController();
27
- const n = { ...v, ...D }, L = w(s, n.baseURL), c = {
26
+ n.value = null, d.value = !0, l.value = new AbortController();
27
+ const a = { ...m, ...D }, L = w(s, a.baseURL), u = {
28
28
  method: e,
29
- headers: { ...n.headers },
30
- signal: u.value.signal,
31
- ...n
29
+ headers: { ...a.headers },
30
+ signal: l.value.signal,
31
+ ...a
32
32
  };
33
- t && ["POST", "PUT", "PATCH"].includes(e) && (t instanceof FormData ? (delete c.headers["Content-Type"], c.body = t) : c.body = JSON.stringify(t));
34
- const E = async (m = 0) => {
33
+ t && ["POST", "PUT", "PATCH"].includes(e) && (t instanceof FormData ? (delete u.headers["Content-Type"], u.body = t) : u.body = JSON.stringify(t));
34
+ const y = async (p = 0) => {
35
35
  try {
36
- const o = [fetch(L, c)];
37
- n.timeout && o.push(P(n.timeout));
36
+ const o = [fetch(L, u)];
37
+ a.timeout && o.push(P(a.timeout));
38
38
  const r = await Promise.race(o);
39
39
  if (!r.ok) {
40
- const O = `HTTP Error: ${r.status} ${r.statusText}`, d = new Error(O);
41
- throw d.status = r.status, d.statusText = r.statusText, d.response = r, d;
40
+ const O = `HTTP Error: ${r.status} ${r.statusText}`, f = new Error(O);
41
+ throw f.status = r.status, f.statusText = r.statusText, f.response = r, f;
42
42
  }
43
- let f;
44
- const l = r.headers.get("content-type");
45
- return l != null && l.includes("application/json") ? f = await r.json() : l != null && l.includes("text/") ? f = await r.text() : f = await r.blob(), {
46
- data: f,
43
+ let c;
44
+ const v = r.headers.get("content-type");
45
+ return v?.includes("application/json") ? c = await r.json() : v?.includes("text/") ? c = await r.text() : c = await r.blob(), {
46
+ data: c,
47
47
  status: r.status,
48
48
  statusText: r.statusText,
49
49
  headers: r.headers
50
50
  };
51
51
  } catch (o) {
52
52
  const r = o instanceof Error && o.name === "AbortError";
53
- if (m < (n.retry || 0) && !r)
54
- return await x(n.retryDelay || 1e3), E(m + 1);
55
- throw o instanceof Error ? o.name === "AbortError" ? a.value = { message: "Request was cancelled" } : a.value = { message: o.message } : a.value = o, o;
53
+ if (p < (a.retry || 0) && !r)
54
+ return await x(a.retryDelay || 1e3), y(p + 1);
55
+ throw o instanceof Error ? o.name === "AbortError" ? n.value = { message: "Request was cancelled" } : n.value = { message: o.message } : n.value = o, o;
56
56
  }
57
57
  };
58
58
  try {
59
- return await E();
59
+ return await y();
60
60
  } finally {
61
- h.value = !1, u.value = null;
61
+ d.value = !1, l.value = null;
62
62
  }
63
63
  }, C = (e, s) => i("GET", e, void 0, s), $ = (e, s, t) => i("POST", e, s, t), R = (e, s, t) => i("PUT", e, s, t), U = (e, s, t) => i("PATCH", e, s, t), A = (e, s) => i("DELETE", e, void 0, s), W = (e) => {
64
- u.value && u.value.abort(e);
64
+ l.value && l.value.abort(e);
65
65
  }, q = () => {
66
- a.value = null;
66
+ n.value = null;
67
67
  };
68
68
  return {
69
69
  // State
70
- loading: g,
71
- error: T(() => a.value),
72
- hasError: y,
70
+ loading: b,
71
+ error: h(() => n.value),
72
+ hasError: g,
73
73
  // Methods
74
74
  request: i,
75
75
  get: C,
@@ -1,6 +1,6 @@
1
1
  import { useConfigStore as i } from "../stores/config.js";
2
- import { ProductType as t } from "../@types/config/schemas.js";
3
2
  import { isTestPartner as o } from "../@types/config/defaults.js";
3
+ import { ProductType as t } from "../@types/config/schemas.js";
4
4
  const T = () => {
5
5
  const e = i(), n = () => e.initialized && e.partnerName ? e.partnerName : window.location.hostname.split(".")[0] || "";
6
6
  return {
@@ -1,31 +1,35 @@
1
- import { useEditorStore as n } from "../stores/editor.js";
2
- import { usePreviewStore as l } from "../stores/preview.js";
3
- import { useActionsApi as m } from "./useActionsApi.js";
4
- import { useCodeEditorApi as p } from "./useCodeEditorApi.js";
5
- const E = () => {
6
- const o = n(), e = l(), { closeCodeEditor: a } = p(), { getPreviewData: s } = m(), r = () => {
7
- o.isPreviewModeOpen = !1, e.$reset();
1
+ import { useEditorStore as d } from "../stores/editor.js";
2
+ import { usePreviewStore as n } from "../stores/preview.js";
3
+ import { useActionsApi as p } from "./useActionsApi.js";
4
+ import { useCodeEditorApi as c } from "./useCodeEditorApi.js";
5
+ import { useHtmlCompiler as u } from "./useHtmlCompiler.js";
6
+ const g = () => {
7
+ const t = d(), e = n(), { closeCodeEditor: i } = c(), { getPreviewData: a, getCompiledEmail: s } = p(), { compileHtml: m } = u(), r = () => {
8
+ t.isPreviewModeOpen = !1, e.$reset();
8
9
  };
9
10
  return {
10
11
  closePreviewMode: r,
11
12
  openPreviewMode: () => {
12
- o.isCodeEditorOpen && a(), o.isPreviewModeOpen = !0;
13
+ t.isCodeEditorOpen && i(), t.isPreviewModeOpen = !0;
13
14
  },
14
15
  loadPreviewData: async () => {
15
- if (!(o.loadingStatus || e.isLoaded)) {
16
- o.loadingStatus = !0;
16
+ if (!(t.loadingStatus || e.isLoaded)) {
17
+ t.loadingStatus = !0;
17
18
  try {
18
- const { html: t, ampHtml: i, ampErrors: d } = await s();
19
- e.templateHtml = t || "", e.ampHtml = i || "", e.ampErrors = d || [], e.setEmailFormat(i ? "AMP" : "html"), e.isLoaded = !0;
20
- } catch (t) {
21
- console.error("Failed to load preview data:", t), r();
19
+ const [o, l] = await Promise.all([
20
+ a(),
21
+ s({ minimize: !0, resetDataSavedFlag: !1 })
22
+ ]);
23
+ e.templateHtml = o.html || "", e.ampHtml = o.ampHtml || "", e.ampErrors = o.ampErrors || [], e.setEmailFormat(o.ampHtml ? "AMP" : "html"), e.emailSizeKB = m(l.html).estimatedSizeKB, e.isLoaded = !0;
24
+ } catch (o) {
25
+ console.error("Failed to load preview data:", o), r();
22
26
  } finally {
23
- o.loadingStatus = !1;
27
+ t.loadingStatus = !1;
24
28
  }
25
29
  }
26
30
  }
27
31
  };
28
32
  };
29
33
  export {
30
- E as usePreviewMode
34
+ g as usePreviewMode
31
35
  };
@@ -1,20 +1,20 @@
1
- import { RecommendationFeedSourceMaps as g, URLS as p } from "../enums/extensions/recommendationBlock.js";
2
- import { MinDeviceViewport as R, DefaultPadding as b } from "../enums/recommendation.js";
3
- import { useRecommendationExtensionStore as u } from "../extensions/Blocks/Recommendation/store/recommendation.js";
4
- import { generateCompleteFilterQuery as x } from "../extensions/Blocks/Recommendation/utils/filterUtil.js";
5
- import { useConfigStore as I } from "../stores/config.js";
6
- const N = () => ({
1
+ import { RecommendationFeedSourceMaps as f, URLS as g } from "../enums/extensions/recommendationBlock.js";
2
+ import { MinDeviceViewport as p, DefaultPadding as R } from "../enums/recommendation.js";
3
+ import { useRecommendationExtensionStore as m } from "../extensions/Blocks/Recommendation/store/recommendation.js";
4
+ import { generateCompleteFilterQuery as b } from "../extensions/Blocks/Recommendation/utils/filterUtil.js";
5
+ import { useConfigStore as x } from "../stores/config.js";
6
+ const P = () => ({
7
7
  calculateCardWidth: ({
8
8
  mobileLeftPadding: i,
9
9
  mobileRightPadding: n,
10
10
  cardsInRow: o,
11
11
  unresponsive: a
12
12
  }) => {
13
- const r = a ? o : 1, e = i + n + (r - 1) * b;
14
- return (R - e) / r;
13
+ const r = a ? o : 1, e = i + n + (r - 1) * R;
14
+ return (p - e) / r;
15
15
  },
16
16
  getRecommendationCampaignData: (i) => {
17
- const n = u(), o = Number(i), a = n.blockStates[o];
17
+ const n = m(), o = Number(i), a = n.blockStates[o];
18
18
  if (!a)
19
19
  return {
20
20
  textTrimming: !1,
@@ -43,18 +43,17 @@ const N = () => ({
43
43
  };
44
44
  },
45
45
  buildCampaignUrl: (i) => {
46
- var m;
47
- const n = u(), o = I(), a = Number(i), r = n.blockStates[a];
46
+ const n = m(), o = x(), a = Number(i), r = n.blockStates[a];
48
47
  if (!r)
49
48
  return "";
50
- const { recommendationConfigs: e } = r, l = ((m = g.find((s) => s.key === e.strategy)) == null ? void 0 : m.path) || "", t = new URLSearchParams();
49
+ const { recommendationConfigs: e } = r, u = f.find((s) => s.key === e.strategy)?.path || "", t = new URLSearchParams();
51
50
  t.set("locale", e.language), t.set("currency", e.currencySettings.value), t.set("partnerName", o.partnerName), t.set("size", e.size), t.set("details", "true"), t.set("campaignId", o.variationId), e.strategy === "manualMerchandising" ? t.set("productId", e.productIds.join(",")) : e.strategy === "similarViewed" && t.set("productId", "{itemId}"), e.strategy === "userBased" && t.set("userId", "{user_id}");
52
- const f = e.filters.filter((s) => s.isValid), c = x(f);
51
+ const l = e.filters.filter((s) => s.isValid), c = b(l);
53
52
  c && t.set("filter", c), e.shuffleProducts && t.set("shuffle", "true");
54
- const d = `${p.RECOMMENDATION_API_URL}/v2/${l}?${t.toString()}`;
53
+ const d = `${g.RECOMMENDATION_API_URL}/v2/${u}?${t.toString()}`;
55
54
  return n.recommendationCampaignUrls[i] = d, d;
56
55
  }
57
56
  });
58
57
  export {
59
- N as useRecommendation
58
+ P as useRecommendation
60
59
  };
@@ -0,0 +1,21 @@
1
+ import { RIBBON_SELECTOR as u } from "../enums/onboarding.js";
2
+ import { ref as i, onMounted as b, onBeforeUnmount as f } from "vue";
3
+ const d = () => {
4
+ const e = i(0);
5
+ let o = null;
6
+ const t = () => {
7
+ const r = document.querySelector(u)?.offsetHeight ?? 0;
8
+ e.value !== r && (e.value = r);
9
+ }, s = (n) => `${n + e.value}px`;
10
+ return b(() => {
11
+ t(), o = new MutationObserver(t), o.observe(document.body, {
12
+ childList: !0,
13
+ subtree: !0
14
+ });
15
+ }), f(() => {
16
+ o?.disconnect();
17
+ }), { ribbonOffset: e, getTopPosition: s };
18
+ };
19
+ export {
20
+ d as useRibbonOffset
21
+ };
@@ -1,21 +1,28 @@
1
- import { useConfig as d } from "./useConfig.js";
2
- import { useSaveStart as p, useSaveComplete as f } from "./useGuidoActions.js";
3
- import { useSyncModuleExtractor as v } from "./useSyncModuleExtractor.js";
4
- import { useStripoApi as S } from "../services/stripoApi.js";
5
- import { useTemplatePreparation as x } from "../utils/templatePreparation.js";
6
- import { useHtmlValidator as V } from "./useHtmlValidator.js";
7
- const g = () => {
8
- const o = p(), s = f(), { validateHtml: i } = V(), { callbacks: a } = d(), { extractSyncModuleData: r } = v(), { setSyncModuleUnsubscriptionPages: n } = S();
9
- return { save: async (l = !1) => {
10
- var e;
11
- o();
12
- const { prepareTemplateDetails: c } = x(), t = await c();
13
- if (!await i(t.compiledHtml, t.dynamicContentList, !0) || (e = a.value) != null && e.externalValidation && !await a.value.externalValidation(t))
1
+ import { useActionsApi as v } from "./useActionsApi.js";
2
+ import { useConfig as S } from "./useConfig.js";
3
+ import { useSaveStart as V, useSaveComplete as x } from "./useGuidoActions.js";
4
+ import { useSyncModuleExtractor as y } from "./useSyncModuleExtractor.js";
5
+ import { useStripoApi as w } from "../services/stripoApi.js";
6
+ import { useTemplatePreparation as b } from "../utils/templatePreparation.js";
7
+ import { useHtmlValidator as q } from "./useHtmlValidator.js";
8
+ import { useLiquidValidator as H } from "./validators/useLiquidValidator.js";
9
+ const k = () => {
10
+ const e = V(), o = x(), { validateHtml: s } = q(), { validateLiquidSyntax: r } = H(), { callbacks: a, isFeatureEnabled: n } = S(), { extractSyncModuleData: l } = y(), { setSyncModuleUnsubscriptionPages: d } = w(), { editorSave: u } = v();
11
+ return { save: async (c = !1) => {
12
+ e();
13
+ const { prepareTemplateDetails: m } = b(), t = await m();
14
+ if (n("liquidSyntax")) {
15
+ if (!await r(t.compiledHtml))
16
+ return;
17
+ } else if (!await s(t.compiledHtml, t.dynamicContentList, !0))
14
18
  return;
15
- const { unsubscribePayload: m, stripoModules: u } = r(t.rawHtml);
16
- return await n(m), t.modules = u, l || s(t), t;
19
+ if (a.value?.externalValidation && !await a.value.externalValidation(t))
20
+ return;
21
+ await u();
22
+ const { unsubscribePayload: p, stripoModules: f } = l(t.rawHtml);
23
+ return await d(p), t.modules = f, c || o(t), t;
17
24
  } };
18
25
  };
19
26
  export {
20
- g as useSave
27
+ k as useSave
21
28
  };