@useinsider/guido 1.0.3-beta.367d151 → 1.0.3-beta.3757462

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 (111) hide show
  1. package/dist/@types/generic.d.ts +0 -14
  2. package/dist/components/Guido.vue.d.ts +2 -3
  3. package/dist/components/Guido.vue.js +9 -11
  4. package/dist/components/Guido.vue2.js +69 -75
  5. package/dist/components/organisms/onboarding/NewVersionPopup.vue.d.ts +1 -3
  6. package/dist/components/organisms/onboarding/NewVersionPopup.vue.js +9 -9
  7. package/dist/components/organisms/onboarding/NewVersionPopup.vue2.js +17 -30
  8. package/dist/components/organisms/onboarding/OnboardingWrapper.vue.d.ts +1 -3
  9. package/dist/components/organisms/onboarding/OnboardingWrapper.vue.js +10 -12
  10. package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +18 -19
  11. package/dist/components/wrappers/WpDrawer.vue.d.ts +4 -6
  12. package/dist/components/wrappers/WpDrawer.vue.js +4 -6
  13. package/dist/composables/useStripo.js +18 -26
  14. package/dist/config/compiler/unsubscribeCompilerRules.js +29 -42
  15. package/dist/config/migrator/index.d.ts +1 -1
  16. package/dist/config/migrator/index.js +6 -7
  17. package/dist/enums/defaults.js +0 -4
  18. package/dist/enums/unsubscribe.d.ts +0 -23
  19. package/dist/enums/unsubscribe.js +6 -43
  20. package/dist/extensions/Blocks/Checkbox/control.js +54 -53
  21. package/dist/extensions/Blocks/RadioButton/control.js +45 -44
  22. package/dist/extensions/Blocks/RadioButton/template.js +6 -6
  23. package/dist/guido.css +1 -1
  24. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +71 -83
  25. package/dist/stores/editor.d.ts +0 -21
  26. package/dist/stores/editor.js +1 -2
  27. package/dist/stores/unsubscribe.d.ts +5 -253
  28. package/dist/stores/unsubscribe.js +6 -126
  29. package/dist/utils/dateUtil.d.ts +0 -4
  30. package/dist/utils/dateUtil.js +12 -8
  31. package/dist/utils/genericUtil.d.ts +0 -1
  32. package/dist/utils/genericUtil.js +7 -8
  33. package/dist/utils/templatePreparation.js +16 -17
  34. package/package.json +2 -2
  35. package/dist/components/organisms/extensions/recommendation/FilterItem.vue.d.ts +0 -19
  36. package/dist/components/organisms/extensions/recommendation/FilterItem.vue.js +0 -28
  37. package/dist/components/organisms/extensions/recommendation/FilterItem.vue2.js +0 -38
  38. package/dist/components/organisms/extensions/recommendation/FilterSelectionDrawer.vue.d.ts +0 -2
  39. package/dist/components/organisms/extensions/recommendation/FilterSelectionDrawer.vue.js +0 -17
  40. package/dist/components/organisms/extensions/recommendation/FilterSelectionDrawer.vue2.js +0 -37
  41. package/dist/components/organisms/extensions/recommendation/Filters.vue.d.ts +0 -2
  42. package/dist/components/organisms/extensions/recommendation/Filters.vue.js +0 -20
  43. package/dist/components/organisms/extensions/recommendation/Filters.vue2.js +0 -44
  44. package/dist/components/organisms/extensions/recommendation/LogicAdapter.vue.d.ts +0 -16
  45. package/dist/components/organisms/extensions/recommendation/LogicAdapter.vue.js +0 -17
  46. package/dist/components/organisms/extensions/recommendation/LogicAdapter.vue2.js +0 -27
  47. package/dist/components/organisms/unsubscribe/UnsubscribeBreadcrumb.vue.d.ts +0 -2
  48. package/dist/components/organisms/unsubscribe/UnsubscribeBreadcrumb.vue.js +0 -18
  49. package/dist/components/organisms/unsubscribe/UnsubscribeBreadcrumb.vue2.js +0 -16
  50. package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue.d.ts +0 -2
  51. package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue.js +0 -24
  52. package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue2.js +0 -64
  53. package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue.d.ts +0 -2
  54. package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue.js +0 -18
  55. package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue2.js +0 -107
  56. package/dist/components/organisms/unsubscribe/UnsubscribeWrapper.vue.d.ts +0 -2
  57. package/dist/components/organisms/unsubscribe/UnsubscribeWrapper.vue.js +0 -18
  58. package/dist/components/organisms/unsubscribe/UnsubscribeWrapper.vue2.js +0 -12
  59. package/dist/config/migrator/unsubscribeMigrator.d.ts +0 -1
  60. package/dist/config/migrator/unsubscribeMigrator.js +0 -124
  61. package/dist/enums/date.d.ts +0 -13
  62. package/dist/enums/date.js +0 -16
  63. package/dist/enums/extensions/recommendationBlock.d.ts +0 -16
  64. package/dist/enums/extensions/recommendationBlock.js +0 -80
  65. package/dist/extensions/Blocks/Recommendation/block.d.ts +0 -10
  66. package/dist/extensions/Blocks/Recommendation/block.js +0 -27
  67. package/dist/extensions/Blocks/Recommendation/control.d.ts +0 -29
  68. package/dist/extensions/Blocks/Recommendation/control.js +0 -277
  69. package/dist/extensions/Blocks/Recommendation/extension.d.ts +0 -2
  70. package/dist/extensions/Blocks/Recommendation/extension.js +0 -10
  71. package/dist/extensions/Blocks/Recommendation/iconsRegistry.d.ts +0 -4
  72. package/dist/extensions/Blocks/Recommendation/iconsRegistry.js +0 -51
  73. package/dist/extensions/Blocks/Recommendation/recommendation.css.js +0 -19
  74. package/dist/extensions/Blocks/Recommendation/settingsPanel.d.ts +0 -4
  75. package/dist/extensions/Blocks/Recommendation/settingsPanel.js +0 -32
  76. package/dist/extensions/Blocks/Recommendation/store/recommendation.d.ts +0 -555
  77. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +0 -266
  78. package/dist/extensions/Blocks/Recommendation/template.d.ts +0 -6
  79. package/dist/extensions/Blocks/Recommendation/template.js +0 -200
  80. package/dist/extensions/Blocks/Recommendation/utils/filterUtil.d.ts +0 -7
  81. package/dist/extensions/Blocks/Recommendation/utils/filterUtil.js +0 -28
  82. package/dist/extensions/Blocks/Unsubscribe/block.d.ts +0 -32
  83. package/dist/extensions/Blocks/Unsubscribe/block.js +0 -131
  84. package/dist/extensions/Blocks/Unsubscribe/control.d.ts +0 -29
  85. package/dist/extensions/Blocks/Unsubscribe/control.js +0 -167
  86. package/dist/extensions/Blocks/Unsubscribe/elements/preview.d.ts +0 -11
  87. package/dist/extensions/Blocks/Unsubscribe/elements/preview.js +0 -42
  88. package/dist/extensions/Blocks/Unsubscribe/extension.d.ts +0 -2
  89. package/dist/extensions/Blocks/Unsubscribe/extension.js +0 -21
  90. package/dist/extensions/Blocks/Unsubscribe/iconsRegistry.d.ts +0 -4
  91. package/dist/extensions/Blocks/Unsubscribe/iconsRegistry.js +0 -21
  92. package/dist/extensions/Blocks/Unsubscribe/settingsPanel.d.ts +0 -4
  93. package/dist/extensions/Blocks/Unsubscribe/settingsPanel.js +0 -35
  94. package/dist/extensions/Blocks/Unsubscribe/styles.css.js +0 -42
  95. package/dist/extensions/Blocks/Unsubscribe/tagRegistry.d.ts +0 -4
  96. package/dist/extensions/Blocks/Unsubscribe/tagRegistry.js +0 -10
  97. package/dist/extensions/Blocks/Unsubscribe/template.d.ts +0 -12
  98. package/dist/extensions/Blocks/Unsubscribe/template.js +0 -22
  99. package/dist/extensions/Blocks/Unsubscribe/utils/constants.d.ts +0 -9
  100. package/dist/extensions/Blocks/Unsubscribe/utils/constants.js +0 -11
  101. package/dist/extensions/Blocks/Unsubscribe/utils/utils.d.ts +0 -7
  102. package/dist/extensions/Blocks/Unsubscribe/utils/utils.js +0 -6
  103. package/dist/extensions/Blocks/common-control.d.ts +0 -66
  104. package/dist/extensions/Blocks/common-control.js +0 -102
  105. package/dist/mock/api/recommendation.d.ts +0 -2
  106. package/dist/services/recommendationApi.d.ts +0 -6
  107. package/dist/services/recommendationApi.js +0 -43
  108. package/dist/services/unsubscribeApi.d.ts +0 -4
  109. package/dist/services/unsubscribeApi.js +0 -16
  110. package/dist/stores/config.d.ts +0 -97
  111. package/dist/stores/config.js +0 -17
@@ -1,256 +1,8 @@
1
- import type { UnsubscribePage } from '@@/Types/unsubscribe';
1
+ type UnsubscribePage = {
2
+ type: number;
3
+ };
2
4
  interface StoreState {
3
- templates: UnsubscribePage[];
4
- selectedTemplates: Record<number, number>;
5
- selectedUnsubscribePages: number[];
6
- selectedCollectionType: number;
7
- activeType: number;
8
- pageSelectionUpdateStatus: boolean;
9
- pageSelectionDrawerStatus: boolean;
10
- typeSelectionDrawerStatus: boolean;
11
- isGlobalUnsubscribeDisabled: boolean;
12
- isSubscriptionPreferencesCenterDisabled: boolean;
5
+ selectedUnsubscribePages: UnsubscribePage[];
13
6
  }
14
- export declare const useUnsubscribeStore: import("pinia").StoreDefinition<"unsubscribe", StoreState, {
15
- getSelectedCollection: (state: {
16
- templates: {
17
- id: number;
18
- name: string;
19
- type: number;
20
- isVisible: number;
21
- html: string;
22
- originalHtml: string;
23
- css: string;
24
- thumbnail: string;
25
- createdAt: string;
26
- updatedAt: string;
27
- status: number;
28
- }[];
29
- selectedTemplates: Record<number, number>;
30
- selectedUnsubscribePages: number[];
31
- selectedCollectionType: number;
32
- activeType: number;
33
- pageSelectionUpdateStatus: boolean;
34
- pageSelectionDrawerStatus: boolean;
35
- typeSelectionDrawerStatus: boolean;
36
- isGlobalUnsubscribeDisabled: boolean;
37
- isSubscriptionPreferencesCenterDisabled: boolean;
38
- } & import("pinia").PiniaCustomStateProperties<StoreState>) => number[];
39
- getSelectedTemplateByActiveType: (state: {
40
- templates: {
41
- id: number;
42
- name: string;
43
- type: number;
44
- isVisible: number;
45
- html: string;
46
- originalHtml: string;
47
- css: string;
48
- thumbnail: string;
49
- createdAt: string;
50
- updatedAt: string;
51
- status: number;
52
- }[];
53
- selectedTemplates: Record<number, number>;
54
- selectedUnsubscribePages: number[];
55
- selectedCollectionType: number;
56
- activeType: number;
57
- pageSelectionUpdateStatus: boolean;
58
- pageSelectionDrawerStatus: boolean;
59
- typeSelectionDrawerStatus: boolean;
60
- isGlobalUnsubscribeDisabled: boolean;
61
- isSubscriptionPreferencesCenterDisabled: boolean;
62
- } & import("pinia").PiniaCustomStateProperties<StoreState>) => number;
63
- getTemplatesByActiveType: (state: {
64
- templates: {
65
- id: number;
66
- name: string;
67
- type: number;
68
- isVisible: number;
69
- html: string;
70
- originalHtml: string;
71
- css: string;
72
- thumbnail: string;
73
- createdAt: string;
74
- updatedAt: string;
75
- status: number;
76
- }[];
77
- selectedTemplates: Record<number, number>;
78
- selectedUnsubscribePages: number[];
79
- selectedCollectionType: number;
80
- activeType: number;
81
- pageSelectionUpdateStatus: boolean;
82
- pageSelectionDrawerStatus: boolean;
83
- typeSelectionDrawerStatus: boolean;
84
- isGlobalUnsubscribeDisabled: boolean;
85
- isSubscriptionPreferencesCenterDisabled: boolean;
86
- } & import("pinia").PiniaCustomStateProperties<StoreState>) => {
87
- id: number;
88
- name: string;
89
- type: number;
90
- isVisible: number;
91
- html: string;
92
- originalHtml: string;
93
- css: string;
94
- thumbnail: string;
95
- createdAt: string;
96
- updatedAt: string;
97
- status: number;
98
- }[];
99
- getThumbnailByTemplateId: (state: {
100
- templates: {
101
- id: number;
102
- name: string;
103
- type: number;
104
- isVisible: number;
105
- html: string;
106
- originalHtml: string;
107
- css: string;
108
- thumbnail: string;
109
- createdAt: string;
110
- updatedAt: string;
111
- status: number;
112
- }[];
113
- selectedTemplates: Record<number, number>;
114
- selectedUnsubscribePages: number[];
115
- selectedCollectionType: number;
116
- activeType: number;
117
- pageSelectionUpdateStatus: boolean;
118
- pageSelectionDrawerStatus: boolean;
119
- typeSelectionDrawerStatus: boolean;
120
- isGlobalUnsubscribeDisabled: boolean;
121
- isSubscriptionPreferencesCenterDisabled: boolean;
122
- } & import("pinia").PiniaCustomStateProperties<StoreState>) => (id: number) => string;
123
- getSelectedUnsubscribePagesByCollection: (state: {
124
- templates: {
125
- id: number;
126
- name: string;
127
- type: number;
128
- isVisible: number;
129
- html: string;
130
- originalHtml: string;
131
- css: string;
132
- thumbnail: string;
133
- createdAt: string;
134
- updatedAt: string;
135
- status: number;
136
- }[];
137
- selectedTemplates: Record<number, number>;
138
- selectedUnsubscribePages: number[];
139
- selectedCollectionType: number;
140
- activeType: number;
141
- pageSelectionUpdateStatus: boolean;
142
- pageSelectionDrawerStatus: boolean;
143
- typeSelectionDrawerStatus: boolean;
144
- isGlobalUnsubscribeDisabled: boolean;
145
- isSubscriptionPreferencesCenterDisabled: boolean;
146
- } & import("pinia").PiniaCustomStateProperties<StoreState>) => (collectionType: number) => number[];
147
- isActiveTypeFirstInCollection: (state: {
148
- templates: {
149
- id: number;
150
- name: string;
151
- type: number;
152
- isVisible: number;
153
- html: string;
154
- originalHtml: string;
155
- css: string;
156
- thumbnail: string;
157
- createdAt: string;
158
- updatedAt: string;
159
- status: number;
160
- }[];
161
- selectedTemplates: Record<number, number>;
162
- selectedUnsubscribePages: number[];
163
- selectedCollectionType: number;
164
- activeType: number;
165
- pageSelectionUpdateStatus: boolean;
166
- pageSelectionDrawerStatus: boolean;
167
- typeSelectionDrawerStatus: boolean;
168
- isGlobalUnsubscribeDisabled: boolean;
169
- isSubscriptionPreferencesCenterDisabled: boolean;
170
- } & import("pinia").PiniaCustomStateProperties<StoreState>) => boolean;
171
- isActiveTypeLastInCollection: (state: {
172
- templates: {
173
- id: number;
174
- name: string;
175
- type: number;
176
- isVisible: number;
177
- html: string;
178
- originalHtml: string;
179
- css: string;
180
- thumbnail: string;
181
- createdAt: string;
182
- updatedAt: string;
183
- status: number;
184
- }[];
185
- selectedTemplates: Record<number, number>;
186
- selectedUnsubscribePages: number[];
187
- selectedCollectionType: number;
188
- activeType: number;
189
- pageSelectionUpdateStatus: boolean;
190
- pageSelectionDrawerStatus: boolean;
191
- typeSelectionDrawerStatus: boolean;
192
- isGlobalUnsubscribeDisabled: boolean;
193
- isSubscriptionPreferencesCenterDisabled: boolean;
194
- } & import("pinia").PiniaCustomStateProperties<StoreState>) => boolean;
195
- hasTemplatesByCollectionType: (state: {
196
- templates: {
197
- id: number;
198
- name: string;
199
- type: number;
200
- isVisible: number;
201
- html: string;
202
- originalHtml: string;
203
- css: string;
204
- thumbnail: string;
205
- createdAt: string;
206
- updatedAt: string;
207
- status: number;
208
- }[];
209
- selectedTemplates: Record<number, number>;
210
- selectedUnsubscribePages: number[];
211
- selectedCollectionType: number;
212
- activeType: number;
213
- pageSelectionUpdateStatus: boolean;
214
- pageSelectionDrawerStatus: boolean;
215
- typeSelectionDrawerStatus: boolean;
216
- isGlobalUnsubscribeDisabled: boolean;
217
- isSubscriptionPreferencesCenterDisabled: boolean;
218
- } & import("pinia").PiniaCustomStateProperties<StoreState>) => Record<number, boolean>;
219
- unsubscribePagesStatus: (state: {
220
- templates: {
221
- id: number;
222
- name: string;
223
- type: number;
224
- isVisible: number;
225
- html: string;
226
- originalHtml: string;
227
- css: string;
228
- thumbnail: string;
229
- createdAt: string;
230
- updatedAt: string;
231
- status: number;
232
- }[];
233
- selectedTemplates: Record<number, number>;
234
- selectedUnsubscribePages: number[];
235
- selectedCollectionType: number;
236
- activeType: number;
237
- pageSelectionUpdateStatus: boolean;
238
- pageSelectionDrawerStatus: boolean;
239
- typeSelectionDrawerStatus: boolean;
240
- isGlobalUnsubscribeDisabled: boolean;
241
- isSubscriptionPreferencesCenterDisabled: boolean;
242
- } & import("pinia").PiniaCustomStateProperties<StoreState>) => boolean;
243
- }, {
244
- $reset(): void;
245
- fetchTemplates(): Promise<void>;
246
- setCollection(collectionType: number): void;
247
- setCollectionWithoutAutoSelection(collectionType: number): void;
248
- setSelectedTemplate(template: number): void;
249
- setNextType(): void;
250
- setPreviousType(): void;
251
- loadSelectedTemplates(templates: number[]): void;
252
- getSelectedTemplatesByCollection(type: number): number[];
253
- addUnsubscribePages(pageIds: number[]): void;
254
- removeUnsubscribePages(pageIds: number[]): void;
255
- }>;
7
+ export declare const useUnsubscribeStore: import("pinia").StoreDefinition<"unsubscribe", StoreState, {}, {}>;
256
8
  export {};
@@ -1,129 +1,9 @@
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 = () => ({
5
- templates: [],
6
- selectedTemplates: {},
7
- selectedUnsubscribePages: [],
8
- selectedCollectionType: a.GLOBAL_UNSUBSCRIBE,
9
- activeType: a.GLOBAL_UNSUBSCRIBE,
10
- pageSelectionUpdateStatus: !1,
11
- pageSelectionDrawerStatus: !1,
12
- typeSelectionDrawerStatus: !1,
13
- isGlobalUnsubscribeDisabled: !1,
14
- isSubscriptionPreferencesCenterDisabled: !1
15
- }), g = d("unsubscribe", {
16
- state: () => p(),
17
- getters: {
18
- getSelectedCollection: (e) => i[e.selectedCollectionType],
19
- getSelectedTemplateByActiveType: (e) => e.selectedTemplates[e.activeType],
20
- getTemplatesByActiveType: (e) => e.templates.filter((t) => t.type === e.activeType),
21
- getThumbnailByTemplateId: (e) => (t) => {
22
- var c;
23
- return ((c = e.templates.find((s) => s.id === t)) == null ? void 0 : c.thumbnail) ?? "";
24
- },
25
- getSelectedUnsubscribePagesByCollection: (e) => (t) => {
26
- const c = i[t];
27
- if (!c)
28
- return [];
29
- const s = /* @__PURE__ */ new Map();
30
- e.templates.forEach((n) => {
31
- s.set(n.id, n.type);
32
- });
33
- const l = new Set(c);
34
- return e.selectedUnsubscribePages.filter((n) => {
35
- const o = s.get(n);
36
- return o !== void 0 && l.has(o);
37
- });
38
- },
39
- isActiveTypeFirstInCollection: (e) => {
40
- const t = i[e.selectedCollectionType];
41
- return e.activeType === t[0];
42
- },
43
- isActiveTypeLastInCollection: (e) => {
44
- const t = i[e.selectedCollectionType];
45
- return e.activeType === t[t.length - 1];
46
- },
47
- hasTemplatesByCollectionType: (e) => {
48
- const t = {};
49
- return i[e.selectedCollectionType].forEach((s) => {
50
- t[s] = e.templates.some((l) => l.type === s);
51
- }), t;
52
- },
53
- unsubscribePagesStatus: (e) => e.selectedUnsubscribePages.length > 0
54
- },
55
- actions: {
56
- $reset() {
57
- const { templates: e, selectedUnsubscribePages: t } = this;
58
- Object.assign(this, {
59
- ...p(),
60
- templates: e,
61
- selectedUnsubscribePages: t
62
- });
63
- },
64
- async fetchTemplates() {
65
- if (this.templates.length)
66
- return;
67
- const { getUnsubscribePages: e } = r(), t = await e();
68
- this.templates = t;
69
- },
70
- setCollection(e) {
71
- this.selectedCollectionType = e;
72
- const t = i[e];
73
- if (t && t.length > 0) {
74
- [this.activeType] = t;
75
- const c = { ...this.selectedTemplates };
76
- t.forEach((s) => {
77
- if (!c[s]) {
78
- const l = this.templates.find((n) => n.type === s);
79
- l && (c[s] = l.id);
80
- }
81
- }), this.selectedTemplates = c;
82
- }
83
- },
84
- setCollectionWithoutAutoSelection(e) {
85
- this.selectedCollectionType = e;
86
- const t = i[e];
87
- t && t.length > 0 && ([this.activeType] = t);
88
- },
89
- setSelectedTemplate(e) {
90
- this.selectedTemplates = {
91
- ...this.selectedTemplates,
92
- [this.activeType]: e
93
- };
94
- },
95
- setNextType() {
96
- const t = this.getSelectedCollection.indexOf(this.activeType) + 1;
97
- t < this.getSelectedCollection.length && (this.activeType = this.getSelectedCollection[t]);
98
- },
99
- setPreviousType() {
100
- const t = this.getSelectedCollection.indexOf(this.activeType) - 1;
101
- t >= 0 && (this.activeType = this.getSelectedCollection[t]);
102
- },
103
- loadSelectedTemplates(e) {
104
- const t = new Map(this.templates.map((s) => [s.id, s.type])), c = { ...this.selectedTemplates };
105
- e.forEach((s) => {
106
- const l = t.get(s);
107
- l !== void 0 && (c[l] = s);
108
- }), this.selectedTemplates = c;
109
- },
110
- getSelectedTemplatesByCollection(e) {
111
- const t = i[e], c = [];
112
- return t.forEach((s) => {
113
- this.selectedTemplates[s] && c.push(this.selectedTemplates[s]);
114
- }), c;
115
- },
116
- addUnsubscribePages(e) {
117
- const t = /* @__PURE__ */ new Set([...this.selectedUnsubscribePages, ...e]);
118
- this.selectedUnsubscribePages = Array.from(t);
119
- },
120
- removeUnsubscribePages(e) {
121
- this.selectedUnsubscribePages = this.selectedUnsubscribePages.filter(
122
- (t) => !e.includes(t)
123
- );
124
- }
125
- }
1
+ import { defineStore as e } from "pinia";
2
+ const t = () => ({
3
+ selectedUnsubscribePages: []
4
+ }), r = e("unsubscribe", {
5
+ state: () => t()
126
6
  });
127
7
  export {
128
- g as useUnsubscribeStore
8
+ r as useUnsubscribeStore
129
9
  };
@@ -1,5 +1 @@
1
- type TimestampUnit = 'seconds' | 'milliseconds';
2
- export declare const formatDate: (timestamp: number, formatOptions?: Intl.DateTimeFormatOptions, unit?: TimestampUnit, locale?: string) => string;
3
1
  export declare const formatPatchDate: (timestamp: number) => string;
4
- export declare const isAfterDate: (timestamp: number) => boolean;
5
- export {};
@@ -1,12 +1,16 @@
1
- import { DEFAULT_DATE_FORMAT_OPTIONS as a } from "../enums/date.js";
2
- const c = (t, e = a, r = "milliseconds", n = "en-US") => {
1
+ const o = (t) => {
3
2
  if (!t)
4
3
  return "";
5
- const o = r === "seconds" ? new Date(t * 1e3) : new Date(t);
6
- return new Intl.DateTimeFormat(n, e).format(o);
7
- }, D = (t) => c(t), m = (t) => t ? Math.floor(Date.now() / 1e3) >= t : !1;
4
+ const e = new Date(t);
5
+ return new Intl.DateTimeFormat("en-US", {
6
+ month: "short",
7
+ day: "numeric",
8
+ hour: "2-digit",
9
+ minute: "2-digit",
10
+ second: "2-digit",
11
+ hour12: !1
12
+ }).format(e);
13
+ };
8
14
  export {
9
- c as formatDate,
10
- D as formatPatchDate,
11
- m as isAfterDate
15
+ o as formatPatchDate
12
16
  };
@@ -6,4 +6,3 @@ export declare const getCsrfToken: () => string;
6
6
  */
7
7
  export declare const getUrlParams: () => URLSearchParams;
8
8
  export declare const getUrlParam: (paramName: string, defaultValue?: string) => string;
9
- export declare const replaceString: (string?: string, values?: Record<string, string | number>, isRemoveEmptyValues?: boolean) => string;
@@ -1,15 +1,14 @@
1
- const o = (e) => e.map((a) => a.format ? {
1
+ const e = (l) => l.map((a) => a.format ? {
2
2
  label: `${a.text} | ${a.format.key}=${a.format.value}`,
3
3
  value: `{{${a.value}|${a.format.key}=${a.format.value}}}`
4
4
  } : {
5
5
  label: a.fallback ? `${a.text} | ${a.fallback}` : a.text,
6
6
  value: a.fallback ? `{{${a.value}|${a.fallback}}}` : `{{${a.value}}}`
7
- }), f = () => {
8
- var e;
9
- return ((e = document.head.querySelector('meta[name="csrf-token"]')) == null ? void 0 : e.getAttribute("content")) ?? "";
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);
7
+ }), r = () => {
8
+ var l;
9
+ return ((l = document.head.querySelector('meta[name="csrf-token"]')) == null ? void 0 : l.getAttribute("content")) ?? "";
10
+ };
11
11
  export {
12
- o as dynamicContentToMergeTags,
13
- f as getCsrfToken,
14
- $ as replaceString
12
+ e as dynamicContentToMergeTags,
13
+ r as getCsrfToken
15
14
  };
@@ -1,15 +1,14 @@
1
- import { useActionsApi as S } from "../composables/useActionsApi.js";
2
- import { useHtmlCompiler as b } from "../composables/useHtmlCompiler.js";
1
+ import { useActionsApi as g } from "../composables/useActionsApi.js";
2
+ import { useHtmlCompiler as S } from "../composables/useHtmlCompiler.js";
3
3
  import { useDynamicContentStore as f } from "../stores/dynamic-content.js";
4
- import { useUnsubscribeStore as C } from "../stores/unsubscribe.js";
5
- const z = () => {
6
- const i = f(), t = C(), { getCompiledEmail: o, getTemplateData: s } = S(), { compileHtml: n } = b();
4
+ const H = () => {
5
+ const t = f(), { getCompiledEmail: i, getTemplateData: o } = g(), { compileHtml: n } = S();
7
6
  return {
8
7
  prepareTemplateDetails: async () => {
9
- const { html: a, ampHtml: m = "", ampErrors: r = [] } = await o({
8
+ const { html: a, ampHtml: s = "", ampErrors: m = [] } = await i({
10
9
  minimize: !0,
11
10
  resetDataSavedFlag: !1
12
- }), { html: c, css: l, syncModulesIds: p = [] } = await s(), { compiledHtml: u, stats: e, appliedRules: d } = n(a), g = i.getSelectedDynamicContentList;
11
+ }), { html: r, css: c, syncModulesIds: l = [] } = await o(), { compiledHtml: p, stats: e, appliedRules: d } = n(a), u = t.getSelectedDynamicContentList;
13
12
  return console.debug("HTML Compilation Stats:", {
14
13
  originalSize: e.originalSize,
15
14
  compiledSize: e.compiledSize,
@@ -17,25 +16,25 @@ const z = () => {
17
16
  appliedRules: d,
18
17
  executionTime: `${e.executionTime.toFixed(2)}ms`
19
18
  }), {
20
- dynamicContentList: g,
21
- compiledHtml: u,
22
- rawHtml: c,
23
- css: l,
24
- ampHtml: m,
25
- ampErrors: r,
26
- modules: p,
19
+ dynamicContentList: u,
20
+ compiledHtml: p,
21
+ rawHtml: r,
22
+ css: c,
23
+ ampHtml: s,
24
+ ampErrors: m,
25
+ modules: l,
27
26
  recommendation: {
28
27
  campaignUrls: {},
29
28
  configs: {}
30
29
  },
31
30
  unsubscribe: {
32
- status: t.unsubscribePagesStatus,
33
- config: t.selectedUnsubscribePages
31
+ status: !1,
32
+ config: []
34
33
  }
35
34
  };
36
35
  }
37
36
  };
38
37
  };
39
38
  export {
40
- z as useTemplatePreparation
39
+ H as useTemplatePreparation
41
40
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@useinsider/guido",
3
- "version": "1.0.3-beta.367d151",
3
+ "version": "1.0.3-beta.3757462",
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",
@@ -32,7 +32,7 @@
32
32
  "license": "ISC",
33
33
  "dependencies": {
34
34
  "@stripoinc/ui-editor-extensions": "3.0.0",
35
- "@useinsider/design-system-vue": "0.14.20",
35
+ "@useinsider/design-system-vue": "0.14.8",
36
36
  "@vueuse/core": "11.3.0",
37
37
  "lodash-es": "4.17.21",
38
38
  "pinia": "2.3.1",
@@ -1,19 +0,0 @@
1
- import type { Filter } from '@@/Types/recommendation';
2
- type __VLS_Props = {
3
- filter: Filter;
4
- index: number;
5
- hasLogicAdapter?: boolean;
6
- };
7
- declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<__VLS_Props>, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {
8
- "delete-filter": (filter: Filter) => void;
9
- }, string, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<__VLS_Props>>>, {}>;
10
- export default _default;
11
- type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
12
- type __VLS_TypePropsToOption<T> = {
13
- [K in keyof T]-?: {} extends Pick<T, K> ? {
14
- type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
15
- } : {
16
- type: import('vue').PropType<T[K]>;
17
- required: true;
18
- };
19
- };
@@ -1,28 +0,0 @@
1
- import r from "./FilterItem.vue2.js";
2
- /* empty css */
3
- import i from "../../../../_virtual/_plugin-vue2_normalizer.js";
4
- var l = function() {
5
- var a = this, e = a._self._c, t = a._self._setupProxy;
6
- return e("div", { staticClass: "d-f f-d-c w-1 gap-16" }, [e("div", { staticClass: "d-f a-i-c j-c-s-b pt-4", class: { "bor-t-s-s bor-t-w-1 bor-t-c-50": a.index === 0 } }, [e("p", [a._v(" " + a._s(t.trans("newsletter.filter")) + " " + a._s(a.index + 1) + " ")]), e(t.InButtonV2, { attrs: { id: "guido__delete-filter-group-button", "left-icon": "line-delete", styling: "text", type: "danger", "label-text-status": !1 }, on: { click: function(s) {
7
- return t.emit("delete-filter", t.props.filter);
8
- } } })], 1), e("div", { staticClass: "w-1 d-f a-i-s j-c-s-b gap-16" }, [e(t.InSelect, { staticClass: "w-2", attrs: { "disabled-status": "", "search-status": "", "button-status": !1, "label-text": t.trans("action-builder.filter-type"), options: t.filterTypeOptions, value: [t.filterTypeOptions[0]] } }), e(t.InSelect, { staticClass: "w-2", attrs: { id: "filter-item-input--attribute-type", "search-status": "", "static-position": "bottom right", "button-status": !1, "label-text": t.trans("condition.attribute"), options: t.store.getFilterList, value: [t.selectedAttributeType] }, on: { select: function(s) {
9
- return t.updateFilter({ text: "attribute", value: s.value });
10
- } } })], 1), e("div", { staticClass: "w-1 d-f a-i-s j-c-s-b gap-16" }, [e(t.InSelect, { staticClass: "w-2", attrs: { "button-status": !1, "label-text": t.trans("condition.operator"), options: t.getOperatorOptions(t.selectedAttributeType.type), value: [t.selectedOperatorType] }, on: { select: function(s) {
11
- return t.updateFilter({ text: "operator", value: s.value });
12
- } } }), e(t.InBasicTextInput, { staticClass: "w-2", attrs: { id: "filter-item-input--value", name: "imageUrl", type: "text", "character-counter-status": !1, "label-text": t.trans("condition.value"), "max-character-length": 25, "placeholder-text": t.trans("condition.enter-value-placeholder"), "tooltip-status": !1, value: decodeURIComponent(t.props.filter.value) }, on: { input: function(s) {
13
- t.updateFilter({ text: "value", value: encodeURIComponent(s) });
14
- } } })], 1), t.props.hasLogicAdapter ? e("div", { staticClass: "w-1 d-f a-i-c j-c-c p-r bor-b-s-s bor-b-w-1 bor-b-c-50 mt-4" }, [e(t.LogicAdapter, { staticClass: "p-a", attrs: { logic: t.props.filter.innerGroupOperator }, on: { change: function(s) {
15
- return t.updateFilter({ text: "innerGroupOperator", value: s });
16
- } } })], 1) : a._e()]);
17
- }, n = [], o = /* @__PURE__ */ i(
18
- r,
19
- l,
20
- n,
21
- !1,
22
- null,
23
- "6562e38c"
24
- );
25
- const f = o.exports;
26
- export {
27
- f as default
28
- };
@@ -1,38 +0,0 @@
1
- import { defineComponent as f, computed as i } from "vue";
2
- import { useTranslations as v } from "../../../../composables/useTranslations.js";
3
- import { getOperatorOptions as a } from "../../../../enums/extensions/recommendationBlock.js";
4
- import { useRecommendationExtensionStore as x } from "../../../../extensions/Blocks/Recommendation/store/recommendation.js";
5
- import { InButtonV2 as y, InSelect as F, InBasicTextInput as T } from "@useinsider/design-system-vue";
6
- import _ from "./LogicAdapter.vue.js";
7
- import { useDebounceFn as b } from "../../../../node_modules/@vueuse/shared/index.js";
8
- const h = /* @__PURE__ */ f({
9
- __name: "FilterItem",
10
- props: {
11
- filter: null,
12
- index: null,
13
- hasLogicAdapter: { type: Boolean }
14
- },
15
- emits: ["delete-filter"],
16
- setup(p, { emit: u }) {
17
- const e = p, n = v(), r = x(), m = [
18
- {
19
- text: n("email-editor.standard-filter"),
20
- value: "standardFilter"
21
- }
22
- ], s = i(() => e.filter.attribute || ""), l = i(() => r.getFilterList.find((t) => t.value === s.value) || { text: "", value: "", type: "" }), c = i(() => {
23
- var t;
24
- return a((t = l.value) == null ? void 0 : t.type).find((o) => o.value === e.filter.operator);
25
- }), d = b((t) => {
26
- console.debug("updateFilter: ", t);
27
- const o = {
28
- ...e.filter,
29
- [t.text]: t.value
30
- };
31
- r.updateFilter(o);
32
- }, 500);
33
- return { __sfc: !0, trans: n, store: r, props: e, filterTypeOptions: m, attributeType: s, selectedAttributeType: l, selectedOperatorType: c, emit: u, updateFilter: d, getOperatorOptions: a, InBasicTextInput: T, InSelect: F, InButtonV2: y, LogicAdapter: _ };
34
- }
35
- });
36
- export {
37
- h as default
38
- };
@@ -1,2 +0,0 @@
1
- declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
2
- export default _default;
@@ -1,17 +0,0 @@
1
- import o from "./FilterSelectionDrawer.vue2.js";
2
- import n from "../../../../_virtual/_plugin-vue2_normalizer.js";
3
- var l = function() {
4
- var e = this, r = e._self._c, t = e._self._setupProxy;
5
- return r(t.WpDrawer, { attrs: { id: "recommendation-filter-drawer", "title-text": "Filter Selection", "footer-button-group-options": t.footerButtonGroupOptions, status: t.store.filterSelectionDrawerStatus }, on: { cancelOrBackButtonEvent: t.closeModal, onCloseEvent: t.closeModal, primaryButtonEvent: t.applyFilter } }, [r(t.Filters)], 1);
6
- }, s = [], a = /* @__PURE__ */ n(
7
- o,
8
- l,
9
- s,
10
- !1,
11
- null,
12
- null
13
- );
14
- const p = a.exports;
15
- export {
16
- p as default
17
- };