@useinsider/guido 1.4.3 → 1.4.4-beta.b4adc85

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 (80) hide show
  1. package/README.md +295 -664
  2. package/dist/@types/config/defaults.js +44 -0
  3. package/dist/@types/config/schemas.js +229 -0
  4. package/dist/@types/config/validator.js +56 -0
  5. package/dist/components/Guido.vue.js +1 -1
  6. package/dist/components/Guido.vue2.js +63 -89
  7. package/dist/components/organisms/email-preview/desktop-preview/EmailHeaderInfo.vue2.js +13 -13
  8. package/dist/components/organisms/email-preview/mobile-preview/InboxView.vue.js +5 -5
  9. package/dist/components/organisms/email-preview/mobile-preview/InboxView.vue2.js +13 -13
  10. package/dist/components/organisms/header/LeftSlot.vue.js +1 -1
  11. package/dist/components/organisms/header/LeftSlot.vue2.js +18 -15
  12. package/dist/components/organisms/header/RightSlot.vue.js +10 -10
  13. package/dist/components/organisms/onboarding/NewVersionPopup.vue2.js +22 -19
  14. package/dist/components/organisms/unsubscribe/UnsubscribeBreadcrumb.vue.js +4 -4
  15. package/dist/components/organisms/unsubscribe/UnsubscribeBreadcrumb.vue2.js +8 -8
  16. package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue.js +3 -3
  17. package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue2.js +17 -17
  18. package/dist/components/organisms/unsubscribe/UnsubscribeWrapper.vue.js +10 -10
  19. package/dist/composables/useBlocksConfig.js +23 -20
  20. package/dist/composables/useConfig.js +51 -5
  21. package/dist/composables/useHtmlCompiler.js +20 -19
  22. package/dist/composables/useHtmlValidator.js +41 -41
  23. package/dist/composables/usePartner.js +19 -9
  24. package/dist/composables/useStripo.js +11 -11
  25. package/dist/composables/useTranslations.js +3 -2
  26. package/dist/config/compiler/unsubscribeCompilerRules.js +1 -1
  27. package/dist/enums/defaults.js +3 -67
  28. package/dist/enums/unsubscribe.js +23 -20
  29. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +12 -11
  30. package/dist/guido.css +1 -1
  31. package/dist/library.js +12 -2
  32. package/dist/node_modules/lodash-es/_arrayLikeKeys.js +10 -10
  33. package/dist/node_modules/valibot/dist/index.js +476 -103
  34. package/dist/services/templateLibraryApi.js +18 -18
  35. package/dist/src/@types/config/defaults.d.ts +68 -0
  36. package/dist/src/@types/config/index.d.ts +14 -0
  37. package/dist/src/@types/config/schemas.d.ts +505 -0
  38. package/dist/src/@types/config/types.d.ts +142 -0
  39. package/dist/src/@types/config/validator.d.ts +119 -0
  40. package/dist/src/@types/generic.d.ts +4 -45
  41. package/dist/src/components/Guido.vue.d.ts +13 -12
  42. package/dist/src/components/wrappers/WpModal.vue.d.ts +1 -1
  43. package/dist/src/composables/useConfig.d.ts +184 -2
  44. package/dist/src/composables/usePartner.d.ts +8 -0
  45. package/dist/src/enums/defaults.d.ts +4 -6
  46. package/dist/src/enums/unsubscribe.d.ts +5 -1
  47. package/dist/src/library.d.ts +3 -1
  48. package/dist/src/stores/config.d.ts +1547 -102
  49. package/dist/stores/config.js +141 -9
  50. package/package.json +1 -1
  51. package/dist/node_modules/lodash-es/_apply.js +0 -16
  52. package/dist/node_modules/lodash-es/_assignMergeValue.js +0 -8
  53. package/dist/node_modules/lodash-es/_assignValue.js +0 -10
  54. package/dist/node_modules/lodash-es/_baseAssignValue.js +0 -12
  55. package/dist/node_modules/lodash-es/_baseCreate.js +0 -17
  56. package/dist/node_modules/lodash-es/_baseKeysIn.js +0 -15
  57. package/dist/node_modules/lodash-es/_baseMerge.js +0 -20
  58. package/dist/node_modules/lodash-es/_baseMergeDeep.js +0 -31
  59. package/dist/node_modules/lodash-es/_baseRest.js +0 -9
  60. package/dist/node_modules/lodash-es/_baseSetToString.js +0 -14
  61. package/dist/node_modules/lodash-es/_cloneArrayBuffer.js +0 -8
  62. package/dist/node_modules/lodash-es/_cloneBuffer.js +0 -9
  63. package/dist/node_modules/lodash-es/_cloneTypedArray.js +0 -8
  64. package/dist/node_modules/lodash-es/_copyArray.js +0 -9
  65. package/dist/node_modules/lodash-es/_copyObject.js +0 -14
  66. package/dist/node_modules/lodash-es/_createAssigner.js +0 -15
  67. package/dist/node_modules/lodash-es/_defineProperty.js +0 -11
  68. package/dist/node_modules/lodash-es/_getPrototype.js +0 -5
  69. package/dist/node_modules/lodash-es/_initCloneObject.js +0 -9
  70. package/dist/node_modules/lodash-es/_nativeKeysIn.js +0 -10
  71. package/dist/node_modules/lodash-es/_overRest.js +0 -15
  72. package/dist/node_modules/lodash-es/_safeGet.js +0 -7
  73. package/dist/node_modules/lodash-es/_setToString.js +0 -6
  74. package/dist/node_modules/lodash-es/_shortOut.js +0 -16
  75. package/dist/node_modules/lodash-es/constant.js +0 -8
  76. package/dist/node_modules/lodash-es/isArrayLikeObject.js +0 -8
  77. package/dist/node_modules/lodash-es/isPlainObject.js +0 -16
  78. package/dist/node_modules/lodash-es/keysIn.js +0 -9
  79. package/dist/node_modules/lodash-es/merge.js +0 -8
  80. package/dist/node_modules/lodash-es/toPlainObject.js +0 -8
@@ -1,47 +1,47 @@
1
- import { useConfig as V } from "./useConfig.js";
2
- import { TemplateTypes as D } from "../enums/defaults.js";
3
- import { DISPLAY_CONDITIONS_REGEX as H, DISPLAY_CONDITIONS_EXCEPTIONS_REGEX as P, CampaignCouldNotBeSavedKey as R, CanNotMakeAnyChangesForRunningKey as _ } from "../enums/html-validator.js";
1
+ import { useConfig as D } from "./useConfig.js";
2
+ import { TemplateTypes as H } from "../enums/defaults.js";
3
+ import { DISPLAY_CONDITIONS_REGEX as P, DISPLAY_CONDITIONS_EXCEPTIONS_REGEX as R, CampaignCouldNotBeSavedKey as _, CanNotMakeAnyChangesForRunningKey as G } from "../enums/html-validator.js";
4
4
  import { ToasterTypeOptions as l } from "../enums/toaster.js";
5
- import { itemsBlockDynamicVariables as G } from "../extensions/Blocks/Items/enums/productEnums.js";
6
- import { useRecommendationStore as $ } from "../stores/recommendation.js";
7
- import { base64EncodeWithSpecialChars as j } from "../utils/base64.js";
8
- import { useHttp as q } from "./useHttp.js";
9
- import { useToaster as M } from "./useToaster.js";
10
- import { useTranslations as X } from "./useTranslations.js";
11
- const ie = () => {
12
- var d;
13
- const { showToaster: c } = M(), { post: y } = q(), { config: h } = V(), a = X(), m = $(), u = ((d = h.partner) == null ? void 0 : d.messageType) === D.transactional, v = async (e) => {
14
- const t = await y(
5
+ import { itemsBlockDynamicVariables as $ } from "../extensions/Blocks/Items/enums/productEnums.js";
6
+ import { useRecommendationStore as j } from "../stores/recommendation.js";
7
+ import { base64EncodeWithSpecialChars as q } from "../utils/base64.js";
8
+ import { useHttp as M } from "./useHttp.js";
9
+ import { useToaster as X } from "./useToaster.js";
10
+ import { useTranslations as z } from "./useTranslations.js";
11
+ const oe = () => {
12
+ var d, f;
13
+ const { showToaster: c } = X(), { post: h } = M(), { config: v } = D(), a = z(), m = j(), u = ((f = (d = v.value) == null ? void 0 : d.partner) == null ? void 0 : f.messageType) === H.transactional, C = async (e) => {
14
+ const t = await h(
15
15
  "/newsletter/template-library/check-template-html-body",
16
- { html: j(e) }
16
+ { html: q(e) }
17
17
  ), { status: n, message: r } = t.data;
18
18
  return n || c({
19
19
  type: l.Alert,
20
20
  message: n === void 0 ? r : a("newsletter.invalid-url-link-for-toaster")
21
- }), a(R), r === a(_) && c({
21
+ }), a(_), r === a(G) && c({
22
22
  type: l.Alert,
23
23
  message: a("newsletter.already-in-progress")
24
24
  }), n;
25
- }, C = (e) => !["if", "endif", "else", "elif", "now"].includes(e.toLowerCase()), w = (e) => ["if", "endif"].includes(e.toLowerCase()), S = (e, s) => {
25
+ }, w = (e) => !["if", "endif", "else", "elif", "now"].includes(e.toLowerCase()), S = (e) => ["if", "endif"].includes(e.toLowerCase()), b = (e, s) => {
26
26
  const t = e.match(/({%(.*?)%})/g);
27
27
  let n = !0;
28
28
  return t !== null && !u && t.forEach((r) => {
29
29
  const i = r.slice(2, -2).trim().match(/(".*?"|[^"\s]+)(?=\s*|\s*$)/g);
30
30
  if (i && i.length > 0) {
31
31
  const [o] = i;
32
- C(o) && !s.includes(o) && (c({
32
+ w(o) && !s.includes(o) && (c({
33
33
  type: l.Warning,
34
34
  message: a("custom-fields.invalid-custom-fields")
35
35
  }), n = !1);
36
36
  }
37
37
  }), n;
38
- }, b = async (e, s, t) => {
39
- const n = t ? await v(e) : !0;
40
- return S(e, s) && n;
41
- }, E = (e) => e.length > 0 ? !0 : (c({
38
+ }, E = async (e, s, t) => {
39
+ const n = t ? await C(e) : !0;
40
+ return b(e, s) && n;
41
+ }, A = (e) => e.length > 0 ? !0 : (c({
42
42
  type: l.Warning,
43
43
  message: a("newsletter.html-content-is-empty")
44
- }), !1), A = (e) => {
44
+ }), !1), x = (e) => {
45
45
  const s = (e.match(/{/gm) || []).length, t = (e.match(/}/gm) || []).length;
46
46
  return s > t && c({
47
47
  type: l.Warning,
@@ -50,13 +50,13 @@ const ie = () => {
50
50
  type: l.Warning,
51
51
  message: a("custom-fields.missing-opening-braces")
52
52
  }), s === t;
53
- }, x = (e) => {
53
+ }, k = (e) => {
54
54
  const s = e.match(/{{\s*(\w+\s+((\w+\|\w+)|(\w+)))\s*}}/gm) === null;
55
55
  return s || c({
56
56
  type: l.Warning,
57
57
  message: a("custom-fields.invalid-custom-fields")
58
58
  }), s;
59
- }, k = (e, s) => {
59
+ }, T = (e, s) => {
60
60
  const t = e.match(/{{([a-zA-Z0-9_\s]*)}}/gm);
61
61
  if (t && !u) {
62
62
  const n = new Set(s.map((i) => i.toLowerCase())), r = [];
@@ -76,22 +76,22 @@ const ie = () => {
76
76
  }
77
77
  }
78
78
  return !0;
79
- }, T = (e) => {
79
+ }, F = (e) => {
80
80
  const s = e.match(/{%(.*?)%}/g), t = [];
81
81
  let n = !0;
82
82
  if (s && s.forEach((r) => {
83
- const i = r.match(H), o = r.match(P), B = (i == null ? void 0 : i.join("")) || "";
84
- (!i || r !== B) && !o && (c({
83
+ const i = r.match(P), o = r.match(R), V = (i == null ? void 0 : i.join("")) || "";
84
+ (!i || r !== V) && !o && (c({
85
85
  type: l.Alert,
86
86
  message: a("newsletter.display-conditions-invalid-syntax")
87
- }), n = !1), i && i.forEach((f) => {
88
- f.trim() === "=" && (c({
87
+ }), n = !1), i && i.forEach((g) => {
88
+ g.trim() === "=" && (c({
89
89
  type: l.Alert,
90
90
  message: a("custom-conditions.wrong-equality-operators")
91
91
  }), n = !1);
92
- const g = f.match(/^[a-zA-Z]*$/g);
93
- g && g.forEach((p) => {
94
- w(p) && t.push(p);
92
+ const p = g.match(/^[a-zA-Z]*$/g);
93
+ p && p.forEach((y) => {
94
+ S(y) && t.push(y);
95
95
  });
96
96
  });
97
97
  }), t.length) {
@@ -102,25 +102,25 @@ const ie = () => {
102
102
  }), n = !1);
103
103
  }
104
104
  return n;
105
- }, F = (e) => {
105
+ }, I = (e) => {
106
106
  const s = (e.match(/{% /gm) || []).length, t = (e.match(/ %}/gm) || []).length, n = s === t;
107
107
  return n || c({
108
108
  type: l.Warning,
109
109
  message: a("custom-conditions.no-space-after-braces")
110
110
  }), n;
111
- }, I = (e) => (e.match(/({%(.*?)%})/g) || []).filter((t) => t.includes("if")).map((t) => (t.match(/{{.*}}/gm) || []).length).reduce((t, n) => t + n, 0) > 0 ? (c({
111
+ }, W = (e) => (e.match(/({%(.*?)%})/g) || []).filter((t) => t.includes("if")).map((t) => (t.match(/{{.*}}/gm) || []).length).reduce((t, n) => t + n, 0) > 0 ? (c({
112
112
  type: l.Warning,
113
113
  message: a("custom-conditions.no-braces-inside-if-tag")
114
- }), !1) : !0, W = () => m.recommendationConfigs && Object.values(m.recommendationConfigs).find((s) => s.filters.find((t) => t.value === "")) !== void 0 ? (c({
114
+ }), !1) : !0, L = () => m.recommendationConfigs && Object.values(m.recommendationConfigs).find((s) => s.filters.find((t) => t.value === "")) !== void 0 ? (c({
115
115
  type: l.Alert,
116
116
  message: a("newsletter.fill-all-necessary-fields")
117
- }), !1) : !0, L = (e) => {
117
+ }), !1) : !0, N = (e) => {
118
118
  const s = /src="[^"]*\.(svg|pst)"/gm;
119
119
  return e.match(s) === null ? !0 : (c({
120
120
  type: l.Alert,
121
121
  message: a("newsletter.invalid-image-type")
122
122
  }), !1);
123
- }, N = (e) => {
123
+ }, O = (e) => {
124
124
  const n = new DOMParser().parseFromString(e, "text/html").querySelectorAll(".checkbox-block-v2");
125
125
  return Array.from(n).find((i) => {
126
126
  var o;
@@ -129,7 +129,7 @@ const ie = () => {
129
129
  type: l.Alert,
130
130
  message: a("unsubscribe-templates.select-checkbox-groups")
131
131
  }), !1) : !0;
132
- }, O = (e) => {
132
+ }, B = (e) => {
133
133
  const n = new DOMParser().parseFromString(e, "text/html").querySelectorAll(".radio-button-v2");
134
134
  return Array.from(n).find((i) => {
135
135
  var o;
@@ -140,10 +140,10 @@ const ie = () => {
140
140
  }), !1) : !0;
141
141
  };
142
142
  return { validateHtml: async (e, s, t = !1) => {
143
- const n = [...s.map((i) => i.value), ...G];
144
- return await b(e, n, t) && E(e) && A(e) && x(e) && k(e, n) && T(e) && F(e) && I(e) && W() && L(e) && N(e) && O(e);
143
+ const n = [...s.map((i) => i.value), ...$];
144
+ return await E(e, n, t) && A(e) && x(e) && k(e) && T(e, n) && F(e) && I(e) && W(e) && L() && N(e) && O(e) && B(e);
145
145
  } };
146
146
  };
147
147
  export {
148
- ie as useHtmlValidator
148
+ oe as useHtmlValidator
149
149
  };
@@ -1,18 +1,28 @@
1
- import { TEST_PARTNER_LIST as r, DefaultProductType as o, ProductIds as n } from "../enums/defaults.js";
2
- const i = () => {
3
- const e = () => window.location.hostname.split(".")[0] || "";
1
+ import { useConfigStore as i } from "../stores/config.js";
2
+ import { ProductType as t } from "../@types/config/schemas.js";
3
+ import { isTestPartner as o } from "../@types/config/defaults.js";
4
+ const T = () => {
5
+ const e = i(), n = () => e.initialized && e.partnerName ? e.partnerName : window.location.hostname.split(".")[0] || "";
4
6
  return {
5
- getPartnerName: e,
7
+ getPartnerName: n,
6
8
  getProductType: () => {
7
- const t = window.location.pathname.split("/").filter(Boolean)[0] || o;
8
- return n[t] || 0;
9
+ if (e.initialized)
10
+ return e.productType;
11
+ const r = window.location.pathname.split("/").filter(Boolean)[0] || "email";
12
+ return {
13
+ email: t.EMAIL,
14
+ architect: t.ARCHITECT,
15
+ unsubscribePages: t.UNSUBSCRIBE_PAGES
16
+ }[r] || t.EMAIL;
9
17
  },
18
+ getMessageType: () => e.initialized ? e.messageType : 1,
19
+ getUsername: () => e.initialized ? e.username : "Guido User",
10
20
  isTestPartner: () => {
11
- const t = e();
12
- return r.includes(t);
21
+ const r = n();
22
+ return o(r);
13
23
  }
14
24
  };
15
25
  };
16
26
  export {
17
- i as usePartner
27
+ T as usePartner
18
28
  };
@@ -7,19 +7,19 @@ import { useToaster as B } from "./useToaster.js";
7
7
  import { displayConditions as T } from "../enums/displayConditions.js";
8
8
  import { useStripoApi as A } from "../services/stripoApi.js";
9
9
  import F from "../static/styles/customEditorStyle.css.js";
10
- import { useEditorStore as M } from "../stores/editor.js";
11
- import { dynamicContentToMergeTags as U } from "../utils/genericUtil.js";
12
- import v from "../package.json.js";
10
+ import { useEditorStore as v } from "../stores/editor.js";
11
+ import { dynamicContentToMergeTags as M } from "../utils/genericUtil.js";
12
+ import U from "../package.json.js";
13
13
  const J = (c) => {
14
- const { config: u } = k(), { handleError: l } = B(), { getToken: f, getCustomFonts: y } = A(), { handleEvent: S } = _(), { getStripoBlocksConfig: C } = b(), E = async (i, r = []) => {
15
- var m, g;
16
- const t = M(), { html: n, css: p, forceRecreate: a } = i, { baseBlocks: e, extensions: d } = await C();
14
+ const { features: g } = k(), { handleError: l } = B(), { getToken: f, getCustomFonts: y } = A(), { handleEvent: S } = _(), { getStripoBlocksConfig: C } = b(), E = async (i, r = []) => {
15
+ var m;
16
+ const t = v(), { html: n, css: u, forceRecreate: a } = i, { baseBlocks: e, extensions: d } = await C(), p = ((m = g.value) == null ? void 0 : m.displayConditions) ?? !0;
17
17
  window.UIEditor.initEditor(
18
18
  document.querySelector("#guido-editor"),
19
19
  {
20
20
  metadata: c,
21
21
  html: n,
22
- css: p,
22
+ css: u,
23
23
  forceRecreate: a,
24
24
  locale: "en",
25
25
  undoButtonSelector: "#guido__undo-button",
@@ -31,8 +31,8 @@ const J = (c) => {
31
31
  customAppearanceMergetagsBorderColor: "#f1f3fe",
32
32
  customAppearanceMergetagsBackgroundColor: "#f1f3fe",
33
33
  customViewStyles: F,
34
- conditionsEnabled: ((m = u.features) == null ? void 0 : m.displayConditions) ?? !0,
35
- customConditionsEnabled: ((g = u.features) == null ? void 0 : g.displayConditions) ?? !0,
34
+ conditionsEnabled: p,
35
+ customConditionsEnabled: p,
36
36
  conditionCategories: T,
37
37
  enableXSSSecurity: !0,
38
38
  messageSettingsEnabled: !0,
@@ -49,7 +49,7 @@ const J = (c) => {
49
49
  },
50
50
  mergeTags: [
51
51
  {
52
- entries: U(c.preselectedDynamicContentList)
52
+ entries: M(c.preselectedDynamicContentList)
53
53
  }
54
54
  ],
55
55
  async onTokenRefreshRequest(o) {
@@ -97,7 +97,7 @@ const J = (c) => {
97
97
  i(), r();
98
98
  return;
99
99
  }
100
- const n = v.guido, a = `https://email-static.useinsider.com/guido/${(d = n == null ? void 0 : n.stripo) == null ? void 0 : d.version}/UIEditor.js`, e = document.createElement("script");
100
+ const n = U.guido, a = `https://email-static.useinsider.com/guido/${(d = n == null ? void 0 : n.stripo) == null ? void 0 : d.version}/UIEditor.js`, e = document.createElement("script");
101
101
  e.id = "UiEditorScript", e.type = "module", e.src = a, e.onload = () => {
102
102
  i(), r();
103
103
  }, e.onerror = () => {
@@ -2,10 +2,11 @@ import memoize from "../node_modules/lodash-es/memoize.js";
2
2
  import { ref } from "vue";
3
3
  import { useConfig } from "./useConfig.js";
4
4
  const useTranslations = () => {
5
- const { config } = useConfig(), translations = ref(eval(config.translationsPath)), trans = (n, t) => {
5
+ var o, e;
6
+ const { config } = useConfig(), translationsPath = ((e = (o = config.value) == null ? void 0 : o.editor) == null ? void 0 : e.translationsPath) || "window.trans.en", translations = ref(eval(translationsPath)), trans = (n, t) => {
6
7
  const r = translations.value[n];
7
8
  return r ? t ? Object.entries(t).reduce(
8
- (e, [o, s]) => e.replace(new RegExp(`{${o}}`, "g"), String(s)),
9
+ (s, [i, a]) => s.replace(new RegExp(`{${i}}`, "g"), String(a)),
9
10
  r
10
11
  ) : r : (console.warn(`Translation key not found: ${n}`), n);
11
12
  };
@@ -10,7 +10,7 @@ const D = [
10
10
  description: "Adding unsubscribe link values",
11
11
  type: "custom",
12
12
  processor: (t) => {
13
- const { getPartnerName: i } = N(), c = B(), n = y(), u = L(), a = c.getVariationId;
13
+ const { getPartnerName: i } = N(), c = B(), n = y(), u = L(), a = c.variationId;
14
14
  if (!a)
15
15
  return t;
16
16
  let e = t;
@@ -1,71 +1,7 @@
1
- const e = {
2
- translationsPath: "window.trans.en",
3
- migrationDate: 1759696858,
4
- emailHeader: {
5
- senderName: "",
6
- subject: ""
7
- },
8
- extensions: {
9
- unsubscribe: !0
10
- },
11
- blocks: {
12
- excludeDefaults: [],
13
- includeCustoms: []
14
- },
15
- features: {
16
- dynamicContent: !0,
17
- saveAsTemplate: !0,
18
- versionHistory: !0,
19
- testMessage: !0,
20
- displayConditions: !0
21
- },
22
- useHeader: !0
23
- }, t = {
24
- promotional: 1,
1
+ const t = {
25
2
  transactional: 2
26
- }, a = "email", o = "Guido User", s = t.promotional, n = 2, i = {
27
- email: 60,
28
- architect: 49,
29
- unsubscribePages: 97
30
- }, u = [
31
- "alfredtesting",
32
- "electio",
33
- "eurekatest",
34
- "gachapontestpart",
35
- "gluautomation1",
36
- "gluautomation2",
37
- "gluautomation3",
38
- "gluautomation4",
39
- "inone",
40
- "inshoppingcart",
41
- "krakentest",
42
- "leeroy",
43
- "newsletteruat",
44
- "ozaspava",
45
- "piratesquad",
46
- "qaautomation1",
47
- "qaautomation2",
48
- "qaautomation3",
49
- "qaautomation4",
50
- "roiautomation",
51
- "seleniumautomation",
52
- "seleniumautomation1",
53
- "seleniumautomation2",
54
- "seleniumautomation3",
55
- "shopbagg",
56
- "shopifytest",
57
- "singlepageqa",
58
- "testqa",
59
- "vikingsankara",
60
- "stripoeditorlivetest"
61
- ];
3
+ }, e = 2;
62
4
  export {
63
- e as DefaultGuidoConfig,
64
- s as DefaultMessageType,
65
- a as DefaultProductType,
66
- o as DefaultUsername,
67
- n as EditorType,
68
- i as ProductIds,
69
- u as TEST_PARTNER_LIST,
5
+ e as EditorType,
70
6
  t as TemplateTypes
71
7
  };
@@ -1,26 +1,26 @@
1
1
  import { useTranslations as n } from "../composables/useTranslations.js";
2
2
  import { getEnvironmentPrefix as R } from "../utils/environmentUtil.js";
3
- const e = n(), I = {
3
+ const N = {
4
4
  UNSUBSCRIBE_LINK_TYPE: 1,
5
5
  PREFERENCES_LINK_TYPE: 3
6
- }, r = {
6
+ }, I = {
7
7
  UNSUBSCRIBE_LINK_REGEX: /{{ins-unsubscribe-link}}/g,
8
8
  DATA_OGSB_BUTTON_CSS_REGEX: "\\[data-ogsb\\]\\s*\\.es-button\\.es-button-[0-9]+\\s*\\{(?:[^\\}]*)\\}",
9
9
  GLOBAL_UNSUBSCRIBE_LINK_REGEX: /{{ins-global-unsubscribe-link}}/g,
10
10
  PREFERENCES_UNSUBSCRIBE_LINK_REGEX: /{{ins-preferences-unsubscribe-link}}/g
11
- }, s = R(), _ = {
11
+ }, s = R(), i = {
12
12
  UNSUBSCRIBE_URL: `https://mail.${s}.com/user/v1/unsub`,
13
13
  PREFERENCES_URL: `https://mail.${s}.com/user/v1/prefs`
14
- }, i = "iid", B = {
14
+ }, _ = "iid", B = {
15
15
  name: "Global Unsubscribe",
16
16
  sendGridId: "G"
17
- }, C = "https://academy.useinsider.com/docs/global-unsubscribe-preference-center", c = "/email/unsubscribe-pages", E = {
17
+ }, t = "https://academy.useinsider.com/docs/global-unsubscribe-preference-center", C = "/email/unsubscribe-pages", E = {
18
18
  GLOBAL_UNSUBSCRIBE: 1,
19
19
  GLOBAL_UNSUBSCRIBE_CONFIRMATION_PAGE: 2,
20
20
  SUBSCRIPTION_PREFERENCE_CENTER: 3,
21
21
  SUBSCRIPTION_PREFERENCE_CONFIRMATION: 4,
22
22
  RESUBSCRIBE: 5
23
- }, t = {
23
+ }, c = {
24
24
  [E.GLOBAL_UNSUBSCRIBE]: [
25
25
  E.GLOBAL_UNSUBSCRIBE,
26
26
  E.GLOBAL_UNSUBSCRIBE_CONFIRMATION_PAGE,
@@ -30,27 +30,30 @@ const e = n(), I = {
30
30
  E.SUBSCRIPTION_PREFERENCE_CENTER,
31
31
  E.SUBSCRIPTION_PREFERENCE_CONFIRMATION
32
32
  ]
33
- }, U = {
34
- [E.GLOBAL_UNSUBSCRIBE]: e("unsubscription-preference.type-global-unsubscribe"),
35
- [E.GLOBAL_UNSUBSCRIBE_CONFIRMATION_PAGE]: e("unsubscription-preference.type-global-unsubscription-confirmation"),
36
- [E.RESUBSCRIBE]: e("unsubscription-preference.type-resubscribe"),
37
- [E.SUBSCRIPTION_PREFERENCE_CENTER]: e("unsubscription-preference.type-subscription-preferences-center"),
38
- [E.SUBSCRIPTION_PREFERENCE_CONFIRMATION]: e("unsubscription-preference.type-subscription-preferences-confirmation")
33
+ }, U = () => {
34
+ const e = n();
35
+ return {
36
+ [E.GLOBAL_UNSUBSCRIBE]: e("unsubscription-preference.type-global-unsubscribe"),
37
+ [E.GLOBAL_UNSUBSCRIBE_CONFIRMATION_PAGE]: e("unsubscription-preference.type-global-unsubscription-confirmation"),
38
+ [E.RESUBSCRIBE]: e("unsubscription-preference.type-resubscribe"),
39
+ [E.SUBSCRIPTION_PREFERENCE_CENTER]: e("unsubscription-preference.type-subscription-preferences-center"),
40
+ [E.SUBSCRIPTION_PREFERENCE_CONFIRMATION]: e("unsubscription-preference.type-subscription-preferences-confirmation")
41
+ };
39
42
  }, o = {
40
43
  default: "{{ins-unsubscribe-link}}",
41
44
  [E.GLOBAL_UNSUBSCRIBE]: "{{ins-global-unsubscribe-link}}",
42
45
  [E.SUBSCRIPTION_PREFERENCE_CENTER]: "{{ins-preferences-unsubscribe-link}}"
43
46
  };
44
47
  export {
45
- C as ACADEMY_LINK,
48
+ t as ACADEMY_LINK,
46
49
  B as DEFAULT_UNSUBSCRIBE_GROUP,
47
- i as INSIDER_ID,
48
- r as LINK_REGEXES,
49
- I as LINK_TYPES,
50
+ _ as INSIDER_ID,
51
+ I as LINK_REGEXES,
52
+ N as LINK_TYPES,
50
53
  o as MERGE_TAGS,
51
54
  E as PAGE_TYPES,
52
- t as TYPE_COLLECTIONS,
53
- U as TYPE_TRANSLATIONS,
54
- c as UNSUBSCRIBE_PAGES_LINK,
55
- _ as URLS
55
+ c as TYPE_COLLECTIONS,
56
+ C as UNSUBSCRIBE_PAGES_LINK,
57
+ i as URLS,
58
+ U as getTypeTranslations
56
59
  };
@@ -1,8 +1,9 @@
1
- import { RecommendationFeedSourceMaps as s, PriceAttributes as l } from "../../../../enums/extensions/recommendationBlock.js";
2
- import { useRecommendationApi as c } from "../../../../services/recommendationApi.js";
1
+ import { RecommendationFeedSourceMaps as n, PriceAttributes as u } from "../../../../enums/extensions/recommendationBlock.js";
2
+ import { useRecommendationApi as l } from "../../../../services/recommendationApi.js";
3
+ import { useConfigStore as c } from "../../../../stores/config.js";
3
4
  import { defineStore as p } from "pinia";
4
5
  import { generateCompleteFilterQuery as m } from "../utils/filterUtil.js";
5
- const a = c(), d = () => ({
6
+ const a = l(), d = () => ({
6
7
  recommendationCampaignUrls: {},
7
8
  recommendationProducts: [],
8
9
  recommendationConfigs: {
@@ -133,7 +134,7 @@ const a = c(), d = () => ({
133
134
  filterSelectionDrawerStatus: !1,
134
135
  filterList: {},
135
136
  filterGroup: 1
136
- }), G = p("guidoRecommendationExtension", {
137
+ }), y = p("guidoRecommendationExtension", {
137
138
  state: () => d(),
138
139
  getters: {
139
140
  hasFilters: (e) => !!e.recommendationConfigs.filters.length,
@@ -144,7 +145,7 @@ const a = c(), d = () => ({
144
145
  getActivePredictiveAlgorithms: (e) => {
145
146
  const t = [];
146
147
  return e.activePredictiveAlgorithms.forEach((r) => {
147
- t.push(...s.filter((i) => i.id === r));
148
+ t.push(...n.filter((i) => i.id === r));
148
149
  }), t.map((r) => ({
149
150
  text: r.name,
150
151
  value: r.key
@@ -159,7 +160,7 @@ const a = c(), d = () => ({
159
160
  value: t.text
160
161
  })),
161
162
  getFilterList: (e) => Object.values(e.filterList).map((t) => {
162
- const r = t.type === "defaultAttribute", i = l.includes(t.attributeName);
163
+ const r = t.type === "defaultAttribute", i = u.includes(t.attributeName);
163
164
  let o = r ? t.attributeName : `product_attributes.${t.attributeName}`;
164
165
  return o = i ? `${o}.${e.recommendationConfigs.currencySettings.value}` : o, {
165
166
  text: t.displayName,
@@ -240,14 +241,14 @@ const a = c(), d = () => ({
240
241
  return m(this.recommendationConfigs.filters);
241
242
  },
242
243
  async fetchRecommendationProducts() {
243
- var i, o, n;
244
- const e = this.generateFilterQuery(), t = ((i = s.find((u) => u.key === this.recommendationConfigs.strategy)) == null ? void 0 : i.path) || "", r = await a.fetchRecommendationProducts(
244
+ var o;
245
+ const e = this.generateFilterQuery(), t = ((o = n.find((s) => s.key === this.recommendationConfigs.strategy)) == null ? void 0 : o.path) || "", r = c(), i = await a.fetchRecommendationProducts(
245
246
  t,
246
247
  {
247
248
  // TODO: Here will be optimized and filled carefully
248
249
  locale: this.recommendationConfigs.language,
249
250
  currency: this.recommendationConfigs.currencySettings.value,
250
- partnerName: ((n = (o = window.GuidoConfig) == null ? void 0 : o.partner) == null ? void 0 : n.partnerName) || "",
251
+ partnerName: r.partnerName,
251
252
  productId: this.recommendationConfigs.strategy === "manualMerchandising" ? this.recommendationConfigs.productIds.join(",") : "{itemId}",
252
253
  size: this.recommendationConfigs.size,
253
254
  details: !0,
@@ -256,11 +257,11 @@ const a = c(), d = () => ({
256
257
  }
257
258
  );
258
259
  this.$patch({
259
- recommendationProducts: r
260
+ recommendationProducts: i
260
261
  });
261
262
  }
262
263
  }
263
264
  });
264
265
  export {
265
- G as useRecommendationExtensionStore
266
+ y as useRecommendationExtensionStore
266
267
  };
package/dist/guido.css CHANGED
@@ -1 +1 @@
1
- .gap-16[data-v-6562e38c],.gap-16[data-v-1ccb6d4a]{gap:16px}[data-v-0502bceb] .in-button-v2__wrapper{line-height:0}[data-v-b5997368] .in-segments-wrapper .in-tooltip-wrapper__box{text-align:left}.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history-wrapper[data-v-52a77eec]{gap:8px}.view-options-wrapper[data-v-d405ca59]{position:relative;display:inline-block}.new-tag[data-v-d405ca59]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-d405ca59] .guido__verion-history-view-option-selection-desktop svg,[data-v-d405ca59] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-d405ca59] .in-segments-wrapper__button_selected,[data-v-d405ca59] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-d405ca59] .in-tooltip-wrapper__icon{cursor:pointer}.view-options-wrapper[data-v-195ab6d4]{position:relative;display:inline-block}.new-tag[data-v-195ab6d4]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-195ab6d4] .guido__view-option-selection-desktop svg,[data-v-195ab6d4] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-195ab6d4] .in-segments-wrapper__button_selected,[data-v-195ab6d4] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-195ab6d4] .in-tooltip-wrapper__icon{cursor:pointer}.guido-loading__wrapper[data-v-07c4b2d8]{height:100%;top:75px!important;bottom:0!important}.guido-editor__wrapper[data-v-98181b5a]{position:relative;width:100%;height:calc(100vh - 128px)}.guido-editor__container[data-v-98181b5a]{width:100%;height:calc(100vh - 128px)}.guido-editor__no-header[data-v-98181b5a]{height:calc(100vh - 75px)}[data-v-70835920] .in-breadcrumb-wrapper__links{cursor:pointer}.templates-wrapper[data-v-a86fc486]{gap:16px;grid-template-columns:repeat(3,1fr)}.templates-wrapper .template-wrapper[data-v-a86fc486]{cursor:pointer}.templates-wrapper .template-wrapper .template-container[data-v-a86fc486]{height:274px;padding:2px;transition:none}.templates-wrapper .template-wrapper .template-container.selected[data-v-a86fc486]{padding:1px}.templates-wrapper .template-wrapper .template-container .thumbnail[data-v-a86fc486]{object-fit:cover;transform:scale(1)}[data-v-dd57102d] .guido__verion-history-view-option-selection-desktop svg,[data-v-dd57102d] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-dd57102d] .in-segments-wrapper__button_selected,[data-v-dd57102d] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}.error-list[data-v-7a09985c]{gap:16px}[data-v-c2adc57d] .in-progress-wrapper__progress p span:last-child{display:none!important}.desktop-preview-container[data-v-2dd60b0c],[data-v-2dd60b0c] .desktop-preview-container .in-container{min-height:720px!important;height:100%}.cropped-text[data-v-f20b3a9b]{width:220px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}[data-v-d3c52b44] .vueperslides__bullets,[data-v-dd1a237a] .vueperslides__bullets{pointer-events:none!important}[data-v-dd1a237a] .vueperslides__parallax-wrapper{height:110px!important}[data-v-a408dcea] .vueperslides__bullets{pointer-events:none!important}[data-v-a408dcea] .vueperslides__parallax-wrapper{height:110px!important}
1
+ .gap-16[data-v-6562e38c],.gap-16[data-v-1ccb6d4a]{gap:16px}[data-v-06e6f7a7] .in-button-v2__wrapper{line-height:0}[data-v-b5997368] .in-segments-wrapper .in-tooltip-wrapper__box{text-align:left}.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history-wrapper[data-v-52a77eec]{gap:8px}.view-options-wrapper[data-v-d405ca59]{position:relative;display:inline-block}.new-tag[data-v-d405ca59]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-d405ca59] .guido__verion-history-view-option-selection-desktop svg,[data-v-d405ca59] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-d405ca59] .in-segments-wrapper__button_selected,[data-v-d405ca59] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-d405ca59] .in-tooltip-wrapper__icon{cursor:pointer}.view-options-wrapper[data-v-195ab6d4]{position:relative;display:inline-block}.new-tag[data-v-195ab6d4]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-195ab6d4] .guido__view-option-selection-desktop svg,[data-v-195ab6d4] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-195ab6d4] .in-segments-wrapper__button_selected,[data-v-195ab6d4] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-195ab6d4] .in-tooltip-wrapper__icon{cursor:pointer}.guido-loading__wrapper[data-v-07c4b2d8]{height:100%;top:75px!important;bottom:0!important}.guido-editor__wrapper[data-v-86b0275b]{position:relative;width:100%;height:calc(100vh - 128px)}.guido-editor__container[data-v-86b0275b]{width:100%;height:calc(100vh - 128px)}.guido-editor__no-header[data-v-86b0275b]{height:calc(100vh - 75px)}[data-v-293f1c47] .in-breadcrumb-wrapper__links{cursor:pointer}.templates-wrapper[data-v-a86fc486]{gap:16px;grid-template-columns:repeat(3,1fr)}.templates-wrapper .template-wrapper[data-v-a86fc486]{cursor:pointer}.templates-wrapper .template-wrapper .template-container[data-v-a86fc486]{height:274px;padding:2px;transition:none}.templates-wrapper .template-wrapper .template-container.selected[data-v-a86fc486]{padding:1px}.templates-wrapper .template-wrapper .template-container .thumbnail[data-v-a86fc486]{object-fit:cover;transform:scale(1)}[data-v-bb3bb07c] .guido__verion-history-view-option-selection-desktop svg,[data-v-bb3bb07c] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-bb3bb07c] .in-segments-wrapper__button_selected,[data-v-bb3bb07c] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}.error-list[data-v-7a09985c]{gap:16px}[data-v-c2adc57d] .in-progress-wrapper__progress p span:last-child{display:none!important}.desktop-preview-container[data-v-2dd60b0c],[data-v-2dd60b0c] .desktop-preview-container .in-container{min-height:720px!important;height:100%}.cropped-text[data-v-4b876c1b]{width:220px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}[data-v-d3c52b44] .vueperslides__bullets,[data-v-dd1a237a] .vueperslides__bullets{pointer-events:none!important}[data-v-dd1a237a] .vueperslides__parallax-wrapper{height:110px!important}[data-v-a408dcea] .vueperslides__bullets{pointer-events:none!important}[data-v-a408dcea] .vueperslides__parallax-wrapper{height:110px!important}
package/dist/library.js CHANGED
@@ -1,4 +1,14 @@
1
- import { default as d } from "./components/Guido.vue.js";
1
+ import { default as a } from "./components/Guido.vue.js";
2
+ import { MessageType as f, ProductType as t } from "./@types/config/schemas.js";
3
+ import "./@types/config/defaults.js";
4
+ import { getValidationErrors as s, isValidConfig as d, parseConfig as g, parseConfigSafe as n, validateConfig as l } from "./@types/config/validator.js";
2
5
  export {
3
- d as Guido
6
+ a as Guido,
7
+ f as MessageType,
8
+ t as ProductType,
9
+ s as getValidationErrors,
10
+ d as isValidConfig,
11
+ g as parseConfig,
12
+ n as parseConfigSafe,
13
+ l as validateConfig
4
14
  };
@@ -1,18 +1,18 @@
1
- import a from "./_baseTimes.js";
2
- import g from "./isArguments.js";
1
+ import m from "./_baseTimes.js";
2
+ import a from "./isArguments.js";
3
3
  import h from "./isArray.js";
4
- import b from "./isBuffer.js";
5
- import A from "./_isIndex.js";
6
- import c from "./isTypedArray.js";
7
- var d = Object.prototype, O = d.hasOwnProperty;
8
- function l(t, p) {
9
- var o = h(t), i = !o && g(t), s = !o && !i && b(t), e = !o && !i && !s && c(t), n = o || i || s || e, f = n ? a(t.length, String) : [], m = f.length;
4
+ import g from "./isBuffer.js";
5
+ import b from "./_isIndex.js";
6
+ import d from "./isTypedArray.js";
7
+ var A = Object.prototype, c = A.hasOwnProperty;
8
+ function l(t, O) {
9
+ var i = h(t), o = !i && a(t), s = !i && !o && g(t), e = !i && !o && !s && d(t), n = i || o || s || e, f = n ? m(t.length, String) : [], p = f.length;
10
10
  for (var r in t)
11
- (p || O.call(t, r)) && !(n && // Safari 9 has enumerable `arguments.length` in strict mode.
11
+ c.call(t, r) && !(n && // Safari 9 has enumerable `arguments.length` in strict mode.
12
12
  (r == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
13
13
  s && (r == "offset" || r == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
14
14
  e && (r == "buffer" || r == "byteLength" || r == "byteOffset") || // Skip index properties.
15
- A(r, m))) && f.push(r);
15
+ b(r, p))) && f.push(r);
16
16
  return f;
17
17
  }
18
18
  export {