@useinsider/guido 1.0.3-beta.6080fe3 → 1.0.3-beta.618f482

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 (46) hide show
  1. package/README.md +0 -3
  2. package/dist/components/Guido.vue.js +1 -1
  3. package/dist/components/Guido.vue2.js +73 -79
  4. package/dist/components/organisms/header/RightSlot.vue.js +1 -1
  5. package/dist/components/organisms/header/RightSlot.vue2.js +22 -23
  6. package/dist/composables/useGuidoActions.js +9 -19
  7. package/dist/composables/useStripo.js +35 -37
  8. package/dist/config/compiler/unsubscribeCompilerRules.js +28 -33
  9. package/dist/enums/defaults.js +1 -2
  10. package/dist/enums/unsubscribe.js +25 -27
  11. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +1 -1
  12. package/dist/extensions/DynamicContent/dynamic-content-modal.js +19 -25
  13. package/dist/extensions/DynamicContent/dynamic-content.js +33 -128
  14. package/dist/guido.css +1 -1
  15. package/dist/package.json.js +1 -1
  16. package/dist/src/@types/generic.d.ts +6 -27
  17. package/dist/src/components/Guido.vue.d.ts +2 -3
  18. package/dist/src/composables/useGuidoActions.d.ts +0 -9
  19. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +1 -1
  20. package/dist/src/extensions/DynamicContent/dynamic-content-modal.d.ts +2 -9
  21. package/dist/src/extensions/DynamicContent/dynamic-content.d.ts +2 -52
  22. package/dist/src/stores/config.d.ts +2 -3
  23. package/dist/src/stores/dynamic-content.d.ts +3 -3
  24. package/dist/src/stores/editor.d.ts +1 -1
  25. package/dist/src/stores/onboarding.d.ts +1 -1
  26. package/dist/src/stores/preview.d.ts +1 -1
  27. package/dist/src/stores/recommendation.d.ts +1 -1
  28. package/dist/src/stores/save-as-template.d.ts +1 -1
  29. package/dist/src/stores/toaster.d.ts +1 -1
  30. package/dist/src/stores/unsubscribe.d.ts +1 -1
  31. package/dist/src/stores/version-history.d.ts +1 -1
  32. package/dist/src/utils/genericUtil.d.ts +0 -1
  33. package/dist/stores/config.js +5 -5
  34. package/dist/stores/dynamic-content.js +2 -2
  35. package/dist/stores/editor.js +1 -1
  36. package/dist/stores/onboarding.js +27 -27
  37. package/dist/stores/preview.js +1 -1
  38. package/dist/stores/recommendation.js +3 -3
  39. package/dist/stores/save-as-template.js +2 -2
  40. package/dist/stores/toaster.js +1 -1
  41. package/dist/stores/unsubscribe.js +1 -1
  42. package/dist/stores/version-history.js +4 -4
  43. package/dist/utils/genericUtil.js +9 -20
  44. package/package.json +3 -3
  45. package/dist/src/utils/environmentUtil.d.ts +0 -5
  46. package/dist/utils/environmentUtil.js +0 -4
@@ -1,5 +1,5 @@
1
1
  import type { PreviewState, EmailFormat } from '@@/Types/preview';
2
- export declare const usePreviewStore: import("pinia").StoreDefinition<"guidoPreview", PreviewState, {
2
+ export declare const usePreviewStore: import("pinia").StoreDefinition<"preview", PreviewState, {
3
3
  isAMPModeEnabled: (state: {
4
4
  emailFormat: EmailFormat;
5
5
  ampHtml: string;
@@ -6,5 +6,5 @@ type RecommendationConfig = {
6
6
  interface StoreState {
7
7
  recommendationConfigs: RecommendationConfig[];
8
8
  }
9
- export declare const useRecommendationStore: import("pinia").StoreDefinition<"guidoRecommendation", StoreState, {}, {}>;
9
+ export declare const useRecommendationStore: import("pinia").StoreDefinition<"recommendation", StoreState, {}, {}>;
10
10
  export {};
@@ -17,7 +17,7 @@ interface StoreState {
17
17
  message: number;
18
18
  };
19
19
  }
20
- export declare const useSaveAsTemplateStore: import("pinia").StoreDefinition<"guidoSaveAsTemplate", StoreState, {
20
+ export declare const useSaveAsTemplateStore: import("pinia").StoreDefinition<"saveAsTemplate", StoreState, {
21
21
  getTemplateName: (state: {
22
22
  templateName: string;
23
23
  categories: {
@@ -1,5 +1,5 @@
1
1
  import type { ToasterState, ToasterOptions } from '@@/Types/toaster';
2
- export declare const useToasterStore: import("pinia").StoreDefinition<"guidoToaster", ToasterState, {
2
+ export declare const useToasterStore: import("pinia").StoreDefinition<"toaster", ToasterState, {
3
3
  shouldAutoHide: (s: {
4
4
  status: boolean;
5
5
  type: import("@@/Types/toaster").ToasterType;
@@ -11,7 +11,7 @@ interface StoreState {
11
11
  isGlobalUnsubscribeDisabled: boolean;
12
12
  isSubscriptionPreferencesCenterDisabled: boolean;
13
13
  }
14
- export declare const useUnsubscribeStore: import("pinia").StoreDefinition<"guidoUnsubscribe", StoreState, {
14
+ export declare const useUnsubscribeStore: import("pinia").StoreDefinition<"unsubscribe", StoreState, {
15
15
  getSelectedCollection: (state: {
16
16
  templates: {
17
17
  id: number;
@@ -2,7 +2,7 @@ import type { VersionHistoryState } from '@@/Types/version-history-api';
2
2
  export interface StoreState extends VersionHistoryState {
3
3
  editorVisualMode: 'desktop' | 'mobile';
4
4
  }
5
- export declare const useVersionHistoryStore: import("pinia").StoreDefinition<"guidoVersionHistory", StoreState, {
5
+ export declare const useVersionHistoryStore: import("pinia").StoreDefinition<"versionHistory", StoreState, {
6
6
  hasPreviousPatch: (state: {
7
7
  editorVisualMode: "desktop" | "mobile";
8
8
  previousPatch: {
@@ -1,5 +1,4 @@
1
1
  import type { DynamicContent, MergeTag } from '@@/Types/generic';
2
- export declare const mergeTagToDynamicContent: (mergeTag: MergeTag) => DynamicContent;
3
2
  export declare const dynamicContentToMergeTags: (dynamicContentList: DynamicContent[]) => MergeTag[];
4
3
  export declare const getCsrfToken: () => string;
5
4
  /**
@@ -1,8 +1,8 @@
1
- import { DefaultGuidoConfig as i } from "../enums/defaults.js";
2
- import { defineStore as e } from "pinia";
3
- const n = e("guidoConfig", {
1
+ import { DefaultGuidoConfig as e } from "../enums/defaults.js";
2
+ import { defineStore as i } from "pinia";
3
+ const r = i("config", {
4
4
  state: () => ({
5
- guidoConfig: i,
5
+ guidoConfig: e,
6
6
  templateConfig: {}
7
7
  }),
8
8
  getters: {
@@ -13,5 +13,5 @@ const n = e("guidoConfig", {
13
13
  }
14
14
  });
15
15
  export {
16
- n as useConfigStore
16
+ r as useConfigStore
17
17
  };
@@ -1,8 +1,8 @@
1
1
  import { removeDuplicatesFromArray as n } from "../utils/arrayUtil.js";
2
2
  import { defineStore as a } from "pinia";
3
- const s = a("guidoDynamicContent", {
3
+ const s = a("dynamicContent", {
4
4
  state: () => ({
5
- selectedDynamicContent: { text: "", value: "" },
5
+ selectedDynamicContent: { text: "", value: "", fallback: "" },
6
6
  selectedDynamicContentList: []
7
7
  }),
8
8
  actions: {
@@ -1,5 +1,5 @@
1
1
  import { defineStore as e } from "pinia";
2
- const o = e("guidoEditor", {
2
+ const o = e("editor", {
3
3
  state: () => ({
4
4
  loadingStatus: !0,
5
5
  isCodeEditorOpen: !1,
@@ -14,41 +14,41 @@ const e = () => ({
14
14
  },
15
15
  userModalState: {},
16
16
  isFetched: !1
17
- }), c = s("guidoOnboarding", {
17
+ }), g = s("onboarding", {
18
18
  state: () => a(),
19
19
  getters: {
20
- getOnboarding: (n) => (i) => n.onboardings[i],
21
- isActive: (n) => (i) => n.onboardings[i].isActive,
22
- getCurrentCard: (n) => (i) => {
23
- const o = n.onboardings[i];
24
- return o.config[o.cardIndex];
20
+ getOnboarding: (n) => (o) => n.onboardings[o],
21
+ isActive: (n) => (o) => n.onboardings[o].isActive,
22
+ getCurrentCard: (n) => (o) => {
23
+ const i = n.onboardings[o];
24
+ return i.config[i.cardIndex];
25
25
  },
26
26
  getGenericCurrentCard: (n) => {
27
- const { genericOnboarding: i } = n.onboardings;
28
- return i.config[i.cardIndex];
27
+ const { genericOnboarding: o } = n.onboardings;
28
+ return o.config[o.cardIndex];
29
29
  },
30
30
  getTextBlockCurrentCard: (n) => {
31
- const { textBlockOnboarding: i } = n.onboardings;
32
- return i.config[i.cardIndex];
31
+ const { textBlockOnboarding: o } = n.onboardings;
32
+ return o.config[o.cardIndex];
33
33
  },
34
34
  getVersionHistoryCurrentCard: (n) => {
35
- const { versionHistoryOnboarding: i } = n.onboardings;
36
- return i.config[i.cardIndex];
35
+ const { versionHistoryOnboarding: o } = n.onboardings;
36
+ return o.config[o.cardIndex];
37
37
  },
38
38
  getAmpCurrentCard: (n) => {
39
- const { ampOnboarding: i } = n.onboardings;
40
- return i.config[i.cardIndex];
39
+ const { ampOnboarding: o } = n.onboardings;
40
+ return o.config[o.cardIndex];
41
41
  },
42
- shouldShowOnboarding: (n) => (i) => {
43
- const o = n.userModalState.Guido;
44
- return i === "newVersionPopup" && (o != null && o.genericOnboarding) ? !1 : o ? !o[i] : !0;
42
+ shouldShowOnboarding: (n) => (o) => {
43
+ const i = n.userModalState.Guido;
44
+ return o === "newVersionPopup" && (i != null && i.genericOnboarding) ? !1 : i ? !i[o] : !0;
45
45
  }
46
46
  },
47
47
  actions: {
48
48
  closeOtherOnboardings(n) {
49
- Object.keys(this.onboardings).forEach((i) => {
50
- const o = i;
51
- o !== n && this.onboardings[o].isActive && (this.onboardings[o].isActive = !1, this.onboardings[o].cardIndex = 0, this.onboardings[o].config = []);
49
+ Object.keys(this.onboardings).forEach((o) => {
50
+ const i = o;
51
+ i !== n && this.onboardings[i].isActive && (this.onboardings[i].isActive = !1, this.onboardings[i].cardIndex = 0, this.onboardings[i].config = []);
52
52
  });
53
53
  },
54
54
  start(n) {
@@ -63,8 +63,8 @@ const e = () => ({
63
63
  previous(n) {
64
64
  this.onboardings[n].cardIndex > 0 && this.onboardings[n].cardIndex--;
65
65
  },
66
- setConfig(n, i) {
67
- this.onboardings[n].config = i ?? [], this.onboardings[n].cardIndex >= this.onboardings[n].config.length && (this.onboardings[n].cardIndex = 0);
66
+ setConfig(n, o) {
67
+ this.onboardings[n].config = o ?? [], this.onboardings[n].cardIndex >= this.onboardings[n].config.length && (this.onboardings[n].cardIndex = 0);
68
68
  },
69
69
  async onDiscoverNowClicked() {
70
70
  await this.setUserModalState("newVersionPopup", "true", "Guido"), await this.setUserModalState("genericOnboarding", "true", "Guido"), this.start("genericOnboarding");
@@ -81,15 +81,15 @@ const e = () => ({
81
81
  async fetchUserModalState() {
82
82
  if (this.isFetched)
83
83
  return;
84
- const { fetchUserModalState: n } = t(), i = await n();
85
- this.userModalState = i, this.isFetched = !0;
84
+ const { fetchUserModalState: n } = t(), o = await n();
85
+ this.userModalState = o, this.isFetched = !0;
86
86
  },
87
- async setUserModalState(n, i, o) {
87
+ async setUserModalState(n, o, i) {
88
88
  const { setUserModalState: r } = t();
89
- await r(n, i, o), this.isFetched = !1, await this.fetchUserModalState();
89
+ await r(n, o, i), this.isFetched = !1, await this.fetchUserModalState();
90
90
  }
91
91
  }
92
92
  });
93
93
  export {
94
- c as useOnboardingStore
94
+ g as useOnboardingStore
95
95
  };
@@ -6,7 +6,7 @@ const s = () => ({
6
6
  templateHtml: "",
7
7
  isLoaded: !1,
8
8
  isAMPErrorModalVisible: !1
9
- }), a = e("guidoPreview", {
9
+ }), a = e("preview", {
10
10
  state: () => s(),
11
11
  getters: {
12
12
  isAMPModeEnabled: (t) => t.emailFormat === "AMP",
@@ -1,8 +1,8 @@
1
1
  import { defineStore as e } from "pinia";
2
- const o = () => ({
2
+ const t = () => ({
3
3
  recommendationConfigs: []
4
- }), n = e("guidoRecommendation", {
5
- state: () => o()
4
+ }), n = e("recommendation", {
5
+ state: () => t()
6
6
  });
7
7
  export {
8
8
  n as useRecommendationStore
@@ -17,7 +17,7 @@ const r = () => ({
17
17
  editor: 2,
18
18
  message: 1
19
19
  }
20
- }), g = i("guidoSaveAsTemplate", {
20
+ }), n = i("saveAsTemplate", {
21
21
  state: () => r(),
22
22
  getters: {
23
23
  getTemplateName: (e) => e.templateName.trim(),
@@ -44,5 +44,5 @@ const r = () => ({
44
44
  }
45
45
  });
46
46
  export {
47
- g as useSaveAsTemplateStore
47
+ n as useSaveAsTemplateStore
48
48
  };
@@ -8,7 +8,7 @@ const a = () => ({
8
8
  withIcon: !0,
9
9
  withoutLeftMargin: !1,
10
10
  actionButton: void 0
11
- }), u = i("guidoToaster", {
11
+ }), u = i("toaster", {
12
12
  state: () => a(),
13
13
  getters: {
14
14
  shouldAutoHide: (t) => t.status && !!t.text
@@ -12,7 +12,7 @@ const p = () => ({
12
12
  typeSelectionDrawerStatus: !1,
13
13
  isGlobalUnsubscribeDisabled: !1,
14
14
  isSubscriptionPreferencesCenterDisabled: !1
15
- }), g = d("guidoUnsubscribe", {
15
+ }), g = d("unsubscribe", {
16
16
  state: () => p(),
17
17
  getters: {
18
18
  getSelectedCollection: (e) => i[e.selectedCollectionType],
@@ -5,13 +5,13 @@ const e = () => ({
5
5
  description: "",
6
6
  authorId: "",
7
7
  authorName: ""
8
- }), i = () => ({
8
+ }), r = () => ({
9
9
  previousPatch: e(),
10
10
  currentPatch: e(),
11
11
  nextPatch: e(),
12
12
  editorVisualMode: "desktop"
13
- }), r = a("guidoVersionHistory", {
14
- state: () => i(),
13
+ }), o = a("versionHistory", {
14
+ state: () => r(),
15
15
  getters: {
16
16
  hasPreviousPatch: (t) => !!t.previousPatch.id,
17
17
  hasCurrentPatch: (t) => !!t.currentPatch.id,
@@ -24,5 +24,5 @@ const e = () => ({
24
24
  }
25
25
  });
26
26
  export {
27
- r as useVersionHistoryStore
27
+ o as useVersionHistoryStore
28
28
  };
@@ -1,26 +1,15 @@
1
- const s = (e) => {
2
- const n = e.value.match(/\{\{([^}]+)\}\}/)[1].split("|").map((a) => a.trim()), [r] = n, l = {
3
- text: e.label,
4
- value: r || ""
5
- };
6
- if (n.length >= 2) {
7
- const [, a, c] = n, o = a.includes("=") ? { key: a.split("=")[0].trim(), value: a.split("=")[1].trim() } : null;
8
- o ? l.format = o : c || (l.fallback = a), c && (l.fallback = c);
9
- }
10
- return l;
11
- }, f = (e) => e.map((t) => t.format ? {
12
- label: `${t.text} | ${t.format.key}=${t.format.value}`,
13
- value: `{{${t.value}|${t.format.key}=${t.format.value}}}`
1
+ const o = (e) => e.map((a) => a.format ? {
2
+ label: `${a.text} | ${a.format.key}=${a.format.value}`,
3
+ value: `{{${a.value}|${a.format.key}=${a.format.value}}}`
14
4
  } : {
15
- label: t.fallback ? `${t.text} | ${t.fallback}` : t.text,
16
- value: t.fallback ? `{{${t.value}|${t.fallback}}}` : `{{${t.value}}}`
17
- }), u = () => {
5
+ label: a.fallback ? `${a.text} | ${a.fallback}` : a.text,
6
+ value: a.fallback ? `{{${a.value}|${a.fallback}}}` : `{{${a.value}}}`
7
+ }), f = () => {
18
8
  var e;
19
9
  return ((e = document.head.querySelector('meta[name="csrf-token"]')) == null ? void 0 : e.getAttribute("content")) ?? "";
20
- }, $ = (e = "", t = {}, n = !1) => Object.entries(t).reduce((r, [l, a]) => n && (a === "" || a === null || a === void 0) ? r.replace(`&${l}={${l}}`, "") : r.replace(`{${l}}`, String(a)), e);
10
+ }, $ = (e = "", a = {}, n = !1) => Object.entries(a).reduce((l, [t, r]) => n && (r === "" || r === null || r === void 0) ? l.replace(`&${t}={${t}}`, "") : l.replace(`{${t}}`, String(r)), e);
21
11
  export {
22
- f as dynamicContentToMergeTags,
23
- u as getCsrfToken,
24
- s as mergeTagToDynamicContent,
12
+ o as dynamicContentToMergeTags,
13
+ f as getCsrfToken,
25
14
  $ as replaceString
26
15
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@useinsider/guido",
3
- "version": "1.0.3-beta.6080fe3",
3
+ "version": "1.0.3-beta.618f482",
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",
@@ -44,7 +44,7 @@
44
44
  "@cspell/eslint-plugin": "8.17.5",
45
45
  "@eslint/eslintrc": "3.3.0",
46
46
  "@eslint/js": "8.57.1",
47
- "@playwright/test": "1.57.0",
47
+ "@playwright/test": "1.55.0",
48
48
  "@stylistic/eslint-plugin": "3.1.0",
49
49
  "@stylistic/eslint-plugin-migrate": "3.1.0",
50
50
  "@types/eslint": "8.56.12",
@@ -83,7 +83,7 @@
83
83
  },
84
84
  "guido": {
85
85
  "stripo": {
86
- "version": "2.46.0"
86
+ "version": "2.42.0"
87
87
  }
88
88
  }
89
89
  }
@@ -1,5 +0,0 @@
1
- /**
2
- * Gets the appropriate environment prefix by parsing from current hostname
3
- * Extracts environment prefix from domains by splitting hostname
4
- */
5
- export declare const getEnvironmentPrefix: () => string;
@@ -1,4 +0,0 @@
1
- const n = () => window.location.hostname.split(".")[2];
2
- export {
3
- n as getEnvironmentPrefix
4
- };