@useinsider/guido 2.1.0-beta.7ffef92 → 2.1.0-beta.84a7014

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 (64) hide show
  1. package/README.md +41 -2
  2. package/dist/@types/config/schemas.js +1 -1
  3. package/dist/components/Guido.vue.js +1 -1
  4. package/dist/components/Guido.vue2.js +66 -66
  5. package/dist/components/organisms/extensions/recommendation/FilterItem.vue.js +13 -11
  6. package/dist/components/organisms/extensions/recommendation/FilterItem.vue2.js +24 -55
  7. package/dist/components/organisms/extensions/recommendation/FilterSelectionDrawer.vue.js +3 -3
  8. package/dist/components/organisms/extensions/recommendation/FilterSelectionDrawer.vue2.js +21 -34
  9. package/dist/components/organisms/extensions/recommendation/Filters.vue.js +9 -9
  10. package/dist/components/organisms/extensions/recommendation/Filters.vue2.js +35 -44
  11. package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue.js +1 -1
  12. package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue2.js +19 -19
  13. package/dist/composables/useSave.js +16 -12
  14. package/dist/composables/useStripo.js +63 -57
  15. package/dist/composables/useStripoEventHandler.js +27 -12
  16. package/dist/composables/useSyncModuleExtractor.js +45 -0
  17. package/dist/composables/useVersionHistoryApi.js +1 -1
  18. package/dist/config/i18n/en/index.js +11 -0
  19. package/dist/config/i18n/en/labels.json.js +7 -0
  20. package/dist/config/i18n/en/toasters.json.js +56 -0
  21. package/dist/config/i18n/en/tooltips.json.js +82 -0
  22. package/dist/config/i18n/index.js +7 -0
  23. package/dist/config/migrator/itemsBlockMigrator.js +65 -64
  24. package/dist/enums/unsubscribe.js +25 -21
  25. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +39 -58
  26. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +57 -93
  27. package/dist/extensions/Blocks/Recommendation/utils/filterUtil.js +8 -8
  28. package/dist/extensions/Blocks/Unsubscribe/block.js +29 -29
  29. package/dist/extensions/Blocks/Unsubscribe/control.js +12 -9
  30. package/dist/extensions/Blocks/Unsubscribe/elements/preview.js +13 -11
  31. package/dist/extensions/Blocks/Unsubscribe/styles.css.js +31 -1
  32. package/dist/guido.css +1 -1
  33. package/dist/services/stripoApi.js +55 -19
  34. package/dist/src/@types/config/schemas.d.ts +1 -1
  35. package/dist/src/@types/events.d.ts +38 -2
  36. package/dist/src/components/Guido.vue.d.ts +2 -2
  37. package/dist/src/components/organisms/extensions/recommendation/FilterItem.vue.d.ts +0 -1
  38. package/dist/src/components/organisms/extensions/recommendation/Filters.vue.d.ts +1 -15
  39. package/dist/src/components/organisms/header/EditorActions.vue.d.ts +1 -1
  40. package/dist/src/components/organisms/header/HeaderWrapper.vue.d.ts +1 -1
  41. package/dist/src/components/organisms/header/RightSlot.vue.d.ts +1 -1
  42. package/dist/src/composables/useGuidoActions.d.ts +1 -1
  43. package/dist/src/composables/useSave.d.ts +2 -2
  44. package/dist/src/composables/useStripo.d.ts +2 -2
  45. package/dist/src/composables/useSyncModuleExtractor.d.ts +4 -0
  46. package/dist/src/config/i18n/en/index.d.ts +1 -0
  47. package/dist/src/config/i18n/index.d.ts +16 -0
  48. package/dist/src/enums/unsubscribe.d.ts +3 -0
  49. package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +0 -5
  50. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +2 -18
  51. package/dist/src/extensions/Blocks/Unsubscribe/control.d.ts +1 -0
  52. package/dist/src/mock/api/settings.d.ts +2 -0
  53. package/dist/src/services/stripoApi.d.ts +5 -0
  54. package/dist/src/stores/editor.d.ts +23 -0
  55. package/dist/src/utils/templatePreparation.d.ts +1 -1
  56. package/dist/static/styles/components/notification.css.js +18 -0
  57. package/dist/static/styles/components/tools.css.js +6 -2
  58. package/dist/static/styles/variables.css.js +2 -0
  59. package/dist/stores/editor.js +2 -1
  60. package/dist/stores/unsubscribe.js +37 -34
  61. package/dist/utils/templatePreparation.js +1 -1
  62. package/package.json +1 -1
  63. package/dist/extensions/Blocks/Recommendation/validation/filterSchema.js +0 -29
  64. package/dist/src/extensions/Blocks/Recommendation/validation/filterSchema.d.ts +0 -15
@@ -1,39 +1,40 @@
1
- import { TYPE_COLLECTIONS as i, PAGE_TYPES as a } from "../enums/unsubscribe.js";
2
- import { useUnsubscribeApi as r } from "../services/unsubscribeApi.js";
3
- import { defineStore as d } from "pinia";
4
- const p = () => ({
1
+ import { TYPE_COLLECTIONS as i, PAGE_TYPES as p } from "../enums/unsubscribe.js";
2
+ import { useUnsubscribeApi as d } from "../services/unsubscribeApi.js";
3
+ import { defineStore as h } from "pinia";
4
+ let o = null;
5
+ const r = () => ({
5
6
  templates: [],
6
7
  selectedTemplates: {},
7
8
  selectedUnsubscribePages: [],
8
- selectedCollectionType: a.GLOBAL_UNSUBSCRIBE,
9
- activeType: a.GLOBAL_UNSUBSCRIBE,
9
+ selectedCollectionType: p.GLOBAL_UNSUBSCRIBE,
10
+ activeType: p.GLOBAL_UNSUBSCRIBE,
10
11
  pageSelectionUpdateStatus: !1,
11
12
  pageSelectionDrawerStatus: !1,
12
13
  typeSelectionDrawerStatus: !1,
13
14
  isGlobalUnsubscribeDisabled: !1,
14
15
  isSubscriptionPreferencesCenterDisabled: !1
15
- }), g = d("guidoUnsubscribe", {
16
- state: () => p(),
16
+ }), b = h("guidoUnsubscribe", {
17
+ state: () => r(),
17
18
  getters: {
18
19
  getSelectedCollection: (e) => i[e.selectedCollectionType],
19
20
  getSelectedTemplateByActiveType: (e) => e.selectedTemplates[e.activeType],
20
21
  getTemplatesByActiveType: (e) => e.templates.filter((t) => t.type === e.activeType),
21
22
  getThumbnailByTemplateId: (e) => (t) => {
22
- var c;
23
- return ((c = e.templates.find((s) => s.id === t)) == null ? void 0 : c.thumbnail) ?? "";
23
+ var l;
24
+ return ((l = e.templates.find((s) => s.id === t)) == null ? void 0 : l.thumbnail) ?? "";
24
25
  },
25
26
  getSelectedUnsubscribePagesByCollection: (e) => (t) => {
26
- const c = i[t];
27
- if (!c)
27
+ const l = i[t];
28
+ if (!l)
28
29
  return [];
29
30
  const s = /* @__PURE__ */ new Map();
30
31
  e.templates.forEach((n) => {
31
32
  s.set(n.id, n.type);
32
33
  });
33
- const l = new Set(c);
34
+ const c = new Set(l);
34
35
  return e.selectedUnsubscribePages.filter((n) => {
35
- const o = s.get(n);
36
- return o !== void 0 && l.has(o);
36
+ const a = s.get(n);
37
+ return a !== void 0 && c.has(a);
37
38
  });
38
39
  },
39
40
  isActiveTypeFirstInCollection: (e) => {
@@ -47,7 +48,7 @@ const p = () => ({
47
48
  hasTemplatesByCollectionType: (e) => {
48
49
  const t = {};
49
50
  return i[e.selectedCollectionType].forEach((s) => {
50
- t[s] = e.templates.some((l) => l.type === s);
51
+ t[s] = e.templates.some((c) => c.type === s);
51
52
  }), t;
52
53
  },
53
54
  unsubscribePagesStatus: (e) => e.selectedUnsubscribePages.length > 0
@@ -56,29 +57,31 @@ const p = () => ({
56
57
  $reset() {
57
58
  const { templates: e, selectedUnsubscribePages: t } = this;
58
59
  Object.assign(this, {
59
- ...p(),
60
+ ...r(),
60
61
  templates: e,
61
62
  selectedUnsubscribePages: t
62
63
  });
63
64
  },
64
65
  async fetchTemplates() {
65
- if (this.templates.length)
66
- return;
67
- const { getUnsubscribePages: e } = r(), t = await e();
68
- this.templates = t;
66
+ this.templates.length || (o || (o = (async () => {
67
+ const { getUnsubscribePages: e } = d();
68
+ this.templates = await e();
69
+ })().finally(() => {
70
+ o = null;
71
+ })), await o);
69
72
  },
70
73
  setCollection(e) {
71
74
  this.selectedCollectionType = e;
72
75
  const t = i[e];
73
76
  if (t && t.length > 0) {
74
77
  [this.activeType] = t;
75
- const c = { ...this.selectedTemplates };
78
+ const l = { ...this.selectedTemplates };
76
79
  t.forEach((s) => {
77
- if (!c[s]) {
78
- const l = this.templates.find((n) => n.type === s);
79
- l && (c[s] = l.id);
80
+ if (!l[s]) {
81
+ const c = this.templates.find((n) => n.type === s);
82
+ c && (l[s] = c.id);
80
83
  }
81
- }), this.selectedTemplates = c;
84
+ }), this.selectedTemplates = l;
82
85
  }
83
86
  },
84
87
  setCollectionWithoutAutoSelection(e) {
@@ -101,17 +104,17 @@ const p = () => ({
101
104
  t >= 0 && (this.activeType = this.getSelectedCollection[t]);
102
105
  },
103
106
  loadSelectedTemplates(e) {
104
- const t = new Map(this.templates.map((s) => [s.id, s.type])), c = { ...this.selectedTemplates };
107
+ const t = new Map(this.templates.map((s) => [s.id, s.type])), l = { ...this.selectedTemplates };
105
108
  e.forEach((s) => {
106
- const l = t.get(s);
107
- l !== void 0 && (c[l] = s);
108
- }), this.selectedTemplates = c;
109
+ const c = t.get(s);
110
+ c !== void 0 && (l[c] = s);
111
+ }), this.selectedTemplates = l;
109
112
  },
110
113
  getSelectedTemplatesByCollection(e) {
111
- const t = i[e], c = [];
114
+ const t = i[e], l = [];
112
115
  return t.forEach((s) => {
113
- this.selectedTemplates[s] && c.push(this.selectedTemplates[s]);
114
- }), c;
116
+ this.selectedTemplates[s] && l.push(this.selectedTemplates[s]);
117
+ }), l;
115
118
  },
116
119
  addUnsubscribePages(e) {
117
120
  const t = /* @__PURE__ */ new Set([...this.selectedUnsubscribePages, ...e]);
@@ -125,5 +128,5 @@ const p = () => ({
125
128
  }
126
129
  });
127
130
  export {
128
- g as useUnsubscribeStore
131
+ b as useUnsubscribeStore
129
132
  };
@@ -24,7 +24,7 @@ const E = () => {
24
24
  css: p,
25
25
  ampHtml: r,
26
26
  ampErrors: c,
27
- modules: u,
27
+ modules: u.map(Number),
28
28
  recommendation: {
29
29
  campaignUrls: b.recommendationCampaignUrls,
30
30
  configs: {}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@useinsider/guido",
3
- "version": "2.1.0-beta.7ffef92",
3
+ "version": "2.1.0-beta.84a7014",
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",
@@ -1,29 +0,0 @@
1
- import { safeParse as o, object as p, boolean as l, number as i, pipe as c, minLength as f, string as m } from "../../../../node_modules/valibot/dist/index.js";
2
- const e = c(m(), f(1)), s = p({
3
- type: e,
4
- attribute: e,
5
- operator: e,
6
- innerGroupOperator: e,
7
- outerGroupOperator: e,
8
- value: e,
9
- filterGroup: i(),
10
- filterNumber: i(),
11
- isValid: l()
12
- });
13
- function g(t) {
14
- return o(s, t).success;
15
- }
16
- function S(t) {
17
- const r = o(s, t);
18
- return r.success ? /* @__PURE__ */ new Set() : new Set(
19
- r.issues.flatMap((u) => {
20
- var n;
21
- return ((n = u.path) == null ? void 0 : n.map((a) => String(a.key))) ?? [];
22
- })
23
- );
24
- }
25
- export {
26
- s as FilterSchema,
27
- S as getInvalidFilterFields,
28
- g as isFilterValid
29
- };
@@ -1,15 +0,0 @@
1
- import type { Filter } from '@@/Types/recommendation';
2
- import * as v from 'valibot';
3
- export declare const FilterSchema: v.ObjectSchema<{
4
- readonly type: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
5
- readonly attribute: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
6
- readonly operator: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
7
- readonly innerGroupOperator: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
8
- readonly outerGroupOperator: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
9
- readonly value: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
10
- readonly filterGroup: v.NumberSchema<undefined>;
11
- readonly filterNumber: v.NumberSchema<undefined>;
12
- readonly isValid: v.BooleanSchema<undefined>;
13
- }, undefined>;
14
- export declare function isFilterValid(filter: Filter): boolean;
15
- export declare function getInvalidFilterFields(filter: Filter): Set<string>;