@useinsider/guido 3.19.0-beta.cac604e → 3.19.0-beta.cd75ff0

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 (77) hide show
  1. package/README.md +1 -0
  2. package/dist/@types/config/schemas.js +39 -37
  3. package/dist/components/Guido.vue.js +4 -4
  4. package/dist/components/Guido.vue2.js +83 -75
  5. package/dist/components/organisms/AutoSaveController.vue2.js +10 -8
  6. package/dist/components/organisms/base/AuthErrorModal.vue.js +18 -0
  7. package/dist/components/organisms/base/AuthErrorModal.vue2.js +42 -0
  8. package/dist/components/organisms/header/EditorActions.vue.js +5 -5
  9. package/dist/components/organisms/header/EditorActions.vue2.js +83 -46
  10. package/dist/components/organisms/header/LeftSlot.vue.js +5 -5
  11. package/dist/components/organisms/header/LeftSlot.vue2.js +16 -12
  12. package/dist/components/organisms/validation/ValidationErrorDrawer.vue.js +20 -0
  13. package/dist/components/organisms/validation/ValidationErrorDrawer.vue2.js +50 -0
  14. package/dist/components/wrappers/WpDrawer.vue.js +9 -7
  15. package/dist/components/wrappers/WpDrawer.vue2.js +1 -1
  16. package/dist/components/wrappers/WpModal.vue.js +1 -1
  17. package/dist/components/wrappers/WpModal.vue2.js +4 -3
  18. package/dist/composables/useAuthError.js +52 -0
  19. package/dist/composables/useAutoSave.js +44 -42
  20. package/dist/composables/useHtmlCompiler.js +37 -26
  21. package/dist/composables/useHtmlValidator.js +2 -0
  22. package/dist/composables/useHttp.js +64 -54
  23. package/dist/composables/useLegacyStrategyConversion.js +23 -19
  24. package/dist/composables/useSave.js +92 -45
  25. package/dist/composables/useSaveValidation.js +284 -0
  26. package/dist/composables/useSaveValidationRollout.js +20 -0
  27. package/dist/composables/useStripo.js +24 -20
  28. package/dist/composables/useToaster.js +17 -15
  29. package/dist/composables/validators/useCouponBlockValidator.js +24 -21
  30. package/dist/composables/validators/useLiquidValidator.js +15 -15
  31. package/dist/composables/validators/useUnsubscribeBlockValidator.js +34 -27
  32. package/dist/config/migrator/index.js +14 -13
  33. package/dist/config/migrator/recommendationPartnerMigrator.js +50 -0
  34. package/dist/enums/extensions/recommendationBlock.js +30 -29
  35. package/dist/enums/save-validation.js +4 -0
  36. package/dist/extensions/Blocks/Recommendation/block.js +54 -88
  37. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +32 -51
  38. package/dist/extensions/Blocks/Recommendation/utils/partnerScope.js +11 -12
  39. package/dist/guido.css +1 -1
  40. package/dist/services/settingsApi.js +11 -0
  41. package/dist/src/@types/config/schemas.d.ts +4 -0
  42. package/dist/src/@types/save-validation.d.ts +19 -0
  43. package/dist/src/components/Guido.vue.d.ts +17 -1
  44. package/dist/src/components/organisms/base/AuthErrorModal.vue.d.ts +2 -0
  45. package/dist/src/components/organisms/header/EditorActions.vue.d.ts +17 -1
  46. package/dist/src/components/organisms/header/HeaderWrapper.vue.d.ts +17 -1
  47. package/dist/src/components/organisms/header/RightSlot.vue.d.ts +17 -1
  48. package/dist/src/components/organisms/validation/ValidationErrorDrawer.vue.d.ts +2 -0
  49. package/dist/src/components/wrappers/WpDrawer.vue.d.ts +4 -3
  50. package/dist/src/components/wrappers/WpModal.vue.d.ts +5 -1
  51. package/dist/src/composables/useAuthError.d.ts +12 -0
  52. package/dist/src/composables/useAutoSave.d.ts +4 -1
  53. package/dist/src/composables/useConfig.d.ts +2 -0
  54. package/dist/src/composables/useHtmlValidator.d.ts +21 -0
  55. package/dist/src/composables/useHttp.d.ts +2 -0
  56. package/dist/src/composables/useSave.d.ts +6 -1
  57. package/dist/src/composables/useSaveValidation.d.ts +6 -0
  58. package/dist/src/composables/useSaveValidationRollout.d.ts +4 -0
  59. package/dist/src/composables/validators/useCouponBlockValidator.d.ts +3 -0
  60. package/dist/src/composables/validators/useUnsubscribeBlockValidator.d.ts +10 -0
  61. package/dist/src/config/migrator/index.d.ts +2 -1
  62. package/dist/src/config/migrator/recommendationPartnerMigrator.d.ts +19 -0
  63. package/dist/src/enums/extensions/recommendationBlock.d.ts +1 -1
  64. package/dist/src/enums/save-validation.d.ts +27 -0
  65. package/dist/src/extensions/Blocks/Recommendation/block.d.ts +0 -6
  66. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +0 -5
  67. package/dist/src/extensions/Blocks/Recommendation/utils/partnerScope.d.ts +13 -7
  68. package/dist/src/services/settingsApi.d.ts +6 -0
  69. package/dist/src/stores/config.d.ts +32 -0
  70. package/dist/src/stores/save-validation.d.ts +22 -0
  71. package/dist/src/stores/setup-settings.d.ts +4 -0
  72. package/dist/src/utils/templatePreparation.d.ts +30 -0
  73. package/dist/stores/config.js +84 -67
  74. package/dist/stores/save-validation.js +30 -0
  75. package/dist/stores/setup-settings.js +10 -0
  76. package/dist/utils/templatePreparation.js +39 -36
  77. package/package.json +1 -1
@@ -0,0 +1,10 @@
1
+ import { defineStore as e } from "pinia";
2
+ const o = e("guidoSetupSettings", {
3
+ state: () => ({
4
+ isEmailAutoSaveEnabled: !1,
5
+ isLoaded: !1
6
+ })
7
+ });
8
+ export {
9
+ o as useSetupSettingsStore
10
+ };
@@ -1,31 +1,31 @@
1
- import { useActionsApi as R } from "../composables/useActionsApi.js";
2
- import { useConfig as k } from "../composables/useConfig.js";
3
- import { useHtmlCompiler as N } from "../composables/useHtmlCompiler.js";
4
- import { RRS_CONFIG_VERSION as U, DEFAULT_CURRENCY as m, DEFAULT_NODE_CONFIG as n } from "../extensions/Blocks/Recommendation/constants/defaultConfig.js";
5
- import { useRecommendationExtensionStore as I } from "../extensions/Blocks/Recommendation/store/recommendation.js";
6
- import { mapLegacyStrategy as x } from "../extensions/Blocks/Recommendation/utils/legacyStrategyMap.js";
1
+ import { useActionsApi as k } from "../composables/useActionsApi.js";
2
+ import { useConfig as N } from "../composables/useConfig.js";
3
+ import { useHtmlCompiler as U } from "../composables/useHtmlCompiler.js";
4
+ import { RRS_CONFIG_VERSION as x, DEFAULT_CURRENCY as m, DEFAULT_NODE_CONFIG as n } from "../extensions/Blocks/Recommendation/constants/defaultConfig.js";
5
+ import { useRecommendationExtensionStore as w } from "../extensions/Blocks/Recommendation/store/recommendation.js";
6
+ import { mapLegacyStrategy as L } from "../extensions/Blocks/Recommendation/utils/legacyStrategyMap.js";
7
7
  import { DATA_ATTRIBUTES as A } from "../extensions/Blocks/Unsubscribe/utils/constants.js";
8
- import { parsePageList as L } from "../extensions/Blocks/Unsubscribe/utils/utils.js";
9
- import { useDynamicContentStore as z } from "../stores/dynamic-content.js";
10
- import { useEditorStore as O } from "../stores/editor.js";
11
- import { useUnsubscribeStore as _ } from "../stores/unsubscribe.js";
12
- import { isPlainObject as v } from "./genericUtil.js";
13
- import { assignTrackingIds as B } from "./linkTrackingIds.js";
14
- function G(l) {
8
+ import { parsePageList as z } from "../extensions/Blocks/Unsubscribe/utils/utils.js";
9
+ import { useDynamicContentStore as O } from "../stores/dynamic-content.js";
10
+ import { useEditorStore as _ } from "../stores/editor.js";
11
+ import { useUnsubscribeStore as v } from "../stores/unsubscribe.js";
12
+ import { isPlainObject as B } from "./genericUtil.js";
13
+ import { assignTrackingIds as G } from "./linkTrackingIds.js";
14
+ function M(l) {
15
15
  const i = new DOMParser().parseFromString(l, "text/html").querySelectorAll(`[${A.PAGE_LIST}]`), t = [];
16
- return i.forEach((s) => {
17
- const r = s.getAttribute(A.PAGE_LIST);
18
- r && t.push(...L(r));
16
+ return i.forEach((c) => {
17
+ const r = c.getAttribute(A.PAGE_LIST);
18
+ r && t.push(...z(r));
19
19
  }), [...new Set(t)];
20
20
  }
21
- async function M(l) {
21
+ async function I(l) {
22
22
  const a = new DOMParser().parseFromString(l, "text/html").querySelectorAll(".recommendation-block-v2");
23
23
  if (a.length === 0)
24
24
  return;
25
- const i = I();
25
+ const i = w();
26
26
  a.forEach((t) => {
27
- var d, g, f, c, y, S;
28
- const s = t.getAttribute("recommendation-id"), r = s ? Number(s) : NaN;
27
+ var d, g, f, s, y, S;
28
+ const c = t.getAttribute("recommendation-id"), r = c ? Number(c) : NaN;
29
29
  if (!Number.isFinite(r))
30
30
  return;
31
31
  const p = t.getAttribute("esd-ext-config");
@@ -37,13 +37,13 @@ async function M(l) {
37
37
  } catch {
38
38
  return;
39
39
  }
40
- if (!v(e))
40
+ if (!B(e))
41
41
  return;
42
- const C = !!e.strategyId || (e.configVersion ?? 0) >= U, o = {
42
+ const C = !!e.strategyId || (e.configVersion ?? 0) >= x, o = {
43
43
  // Normalize legacy strategy keys (e.g. `mostViewed` → `mostPopular`) so
44
44
  // already-saved blocks that never re-run the migrator don't emit a
45
45
  // strategy-less campaign URL. `||` also catches '' / undefined (SD-144882).
46
- strategy: x(e.strategy) || (C ? "" : n.strategy),
46
+ strategy: L(e.strategy) || (C ? "" : n.strategy),
47
47
  strategyId: e.strategyId ?? n.strategyId,
48
48
  language: e.language ?? n.language,
49
49
  size: e.size ?? n.size,
@@ -55,7 +55,7 @@ async function M(l) {
55
55
  currencyCode: ((d = e.currency) == null ? void 0 : d.code) ?? m.code,
56
56
  currencySymbol: ((g = e.currency) == null ? void 0 : g.symbol) ?? m.symbol,
57
57
  currencyAlignment: ((f = e.currency) == null ? void 0 : f.alignment) ?? m.alignment,
58
- currencyDecimalCount: ((c = e.currency) == null ? void 0 : c.decimalCount) ?? m.decimalCount,
58
+ currencyDecimalCount: ((s = e.currency) == null ? void 0 : s.decimalCount) ?? m.decimalCount,
59
59
  currencyDecimalSeparator: ((y = e.currency) == null ? void 0 : y.decimalSeparator) ?? m.decimalSeparator,
60
60
  currencyThousandSeparator: ((S = e.currency) == null ? void 0 : S.thousandSeparator) ?? m.thousandSeparator
61
61
  };
@@ -71,39 +71,39 @@ async function M(l) {
71
71
  }
72
72
  }
73
73
  const re = () => {
74
- const l = z(), u = O(), a = _(), { getCompiledEmail: i, getTemplateData: t, updateHtmlAndCss: s } = R(), { compileHtml: r, compileAmpHtml: p } = N(), { isFeatureEnabled: e } = k();
74
+ const l = O(), u = _(), a = v(), { getCompiledEmail: i, getTemplateData: t, updateHtmlAndCss: c } = k(), { compileHtml: r, compileAmpHtml: p } = U(), { isFeatureEnabled: e } = N();
75
75
  return {
76
76
  prepareTemplateDetails: async () => {
77
77
  let { html: o, css: d, syncModulesIds: g = [] } = await t();
78
78
  if (e("linkTrackingIds"))
79
79
  try {
80
- const { html: b, changed: F, nextSeq: H } = B(o, u.trackIdSessionFloor);
81
- u.trackIdSessionFloor = H, F && (o = b, await s(b, d));
80
+ const { html: b, changed: R, nextSeq: H } = G(o, u.trackIdSessionFloor);
81
+ u.trackIdSessionFloor = H, R && (o = b, await c(b, d));
82
82
  } catch (b) {
83
83
  console.error("Tracking-id step failed, saving anyway:", b);
84
84
  }
85
- const { html: f, ampHtml: c = "", ampErrors: y = [] } = await i({
85
+ const { html: f, ampHtml: s = "", ampErrors: y = [] } = await i({
86
86
  minimize: !0,
87
87
  resetDataSavedFlag: !1
88
88
  });
89
- a.selectedUnsubscribePages.length && await a.fetchTemplates(), await M(o);
90
- const { compiledHtml: S, stats: h, appliedRules: w } = r(f), D = c && p(c).compiledHtml, E = l.getSelectedDynamicContentList, P = I(), T = G(o);
89
+ a.selectedUnsubscribePages.length && await a.fetchTemplates(), await I(o);
90
+ const { compiledHtml: S, stats: h, appliedRules: D } = r(f), E = s && p(s).compiledHtml, P = l.getSelectedDynamicContentList, F = w(), T = M(o);
91
91
  return console.debug("HTML Compilation Stats:", {
92
92
  originalSize: h.originalSize,
93
93
  compiledSize: h.compiledSize,
94
94
  reduction: `${h.reductionPercentage.toFixed(2)}%`,
95
- appliedRules: w,
95
+ appliedRules: D,
96
96
  executionTime: `${h.executionTime.toFixed(2)}ms`
97
97
  }), {
98
- dynamicContentList: E,
98
+ dynamicContentList: P,
99
99
  compiledHtml: S,
100
100
  rawHtml: o,
101
101
  css: d,
102
- ampHtml: D,
102
+ ampHtml: E,
103
103
  ampErrors: y,
104
104
  modules: g.map(Number),
105
105
  recommendation: {
106
- campaignUrls: P.recommendationCampaignUrls,
106
+ campaignUrls: F.recommendationCampaignUrls,
107
107
  configs: {}
108
108
  },
109
109
  unsubscribe: {
@@ -111,10 +111,13 @@ const re = () => {
111
111
  config: T
112
112
  }
113
113
  };
114
- }
114
+ },
115
+ // Exposed so the back/test validate-only path can seed the reco store the
116
+ // same way a full save does (required-field findings depend on it).
117
+ hydrateRecommendationStore: I
115
118
  };
116
119
  };
117
120
  export {
118
- G as getHtmlReferencedUnsubscribePages,
121
+ M as getHtmlReferencedUnsubscribePages,
119
122
  re as useTemplatePreparation
120
123
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@useinsider/guido",
3
- "version": "3.19.0-beta.cac604e",
3
+ "version": "3.19.0-beta.cd75ff0",
4
4
  "description": "Guido is a Vue + TypeScript wrapper for Email Plugin. Easily embed the email editor in your Vue applications.",
5
5
  "main": "./dist/guido.umd.cjs",
6
6
  "module": "./dist/library.js",