@useinsider/guido 1.0.3-beta.391f32c → 1.0.3-beta.3cb36f8

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 (95) hide show
  1. package/dist/@types/generic.d.ts +0 -8
  2. package/dist/components/Guido.vue.d.ts +2 -2
  3. package/dist/components/Guido.vue.js +8 -8
  4. package/dist/components/Guido.vue2.js +64 -68
  5. package/dist/components/wrappers/WpDrawer.vue.d.ts +4 -6
  6. package/dist/components/wrappers/WpDrawer.vue.js +4 -6
  7. package/dist/composables/useStripo.js +25 -31
  8. package/dist/config/compiler/unsubscribeCompilerRules.js +19 -19
  9. package/dist/config/migrator/index.d.ts +1 -1
  10. package/dist/config/migrator/index.js +5 -6
  11. package/dist/enums/defaults.js +3 -6
  12. package/dist/enums/unsubscribe.d.ts +0 -19
  13. package/dist/enums/unsubscribe.js +6 -39
  14. package/dist/extensions/Blocks/Checkbox/block.d.ts +0 -1
  15. package/dist/extensions/Blocks/Checkbox/block.js +24 -15
  16. package/dist/extensions/Blocks/Checkbox/control.js +38 -24
  17. package/dist/extensions/Blocks/Checkbox/extension.js +16 -5
  18. package/dist/extensions/Blocks/Checkbox/settingsPanel.js +25 -12
  19. package/dist/extensions/Blocks/Checkbox/template.js +16 -5
  20. package/dist/extensions/Blocks/RadioButton/block.d.ts +0 -1
  21. package/dist/extensions/Blocks/RadioButton/block.js +22 -13
  22. package/dist/extensions/Blocks/RadioButton/control.js +46 -32
  23. package/dist/extensions/Blocks/RadioButton/extension.js +15 -4
  24. package/dist/extensions/Blocks/RadioButton/settingsPanel.js +26 -13
  25. package/dist/extensions/Blocks/RadioButton/template.js +18 -7
  26. package/dist/extensions/Blocks/_Boilerplate/block.d.ts +0 -1
  27. package/dist/extensions/DynamicContent/dynamic-content.js +45 -31
  28. package/dist/extensions/DynamicContent/extension.js +18 -6
  29. package/dist/guido.css +1 -1
  30. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/Extension.js +75 -0
  31. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/ExtensionBuilder.js +77 -0
  32. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/blocks/Block.js +123 -0
  33. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/AiAssistantValueType.js +7 -0
  34. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockCompositionType.js +7 -0
  35. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockName.js +12 -0
  36. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockType.js +7 -0
  37. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/BuiltInControlTypes.js +119 -0
  38. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/ContextActionType.js +7 -0
  39. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/EditorStatePropertyType.js +7 -0
  40. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/PanelPosition.js +7 -0
  41. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/Popover.js +12 -0
  42. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/PreviewDeviceMode.js +7 -0
  43. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/SettingsTab.js +7 -0
  44. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/UIElementType.js +7 -0
  45. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/UIElementsAttributes.js +24 -0
  46. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/Control.js +24 -0
  47. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/SettingsPanelRegistry.js +11 -0
  48. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/SettingsPanelTab.js +33 -0
  49. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/modifications/ModificationDescription.js +22 -0
  50. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/ui-elements/UIElement.js +40 -0
  51. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/ui-elements/UIElementTagRegistry.js +5 -0
  52. package/dist/stores/unsubscribe.d.ts +5 -183
  53. package/dist/stores/unsubscribe.js +6 -125
  54. package/package.json +2 -2
  55. package/dist/components/organisms/unsubscribe/UnsubscribeBreadcrumb.vue.d.ts +0 -2
  56. package/dist/components/organisms/unsubscribe/UnsubscribeBreadcrumb.vue.js +0 -18
  57. package/dist/components/organisms/unsubscribe/UnsubscribeBreadcrumb.vue2.js +0 -16
  58. package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue.d.ts +0 -2
  59. package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue.js +0 -24
  60. package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue2.js +0 -64
  61. package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue.d.ts +0 -2
  62. package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue.js +0 -18
  63. package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue2.js +0 -108
  64. package/dist/components/organisms/unsubscribe/UnsubscribeWrapper.vue.d.ts +0 -2
  65. package/dist/components/organisms/unsubscribe/UnsubscribeWrapper.vue.js +0 -18
  66. package/dist/components/organisms/unsubscribe/UnsubscribeWrapper.vue2.js +0 -12
  67. package/dist/config/migrator/unsubscribeMigrator.d.ts +0 -1
  68. package/dist/config/migrator/unsubscribeMigrator.js +0 -112
  69. package/dist/extensions/Blocks/Checkbox/iconsRegistry.d.ts +0 -4
  70. package/dist/extensions/Blocks/Checkbox/iconsRegistry.js +0 -18
  71. package/dist/extensions/Blocks/RadioButton/iconsRegistry.d.ts +0 -4
  72. package/dist/extensions/Blocks/RadioButton/iconsRegistry.js +0 -14
  73. package/dist/extensions/Blocks/Unsubscribe/block.d.ts +0 -31
  74. package/dist/extensions/Blocks/Unsubscribe/block.js +0 -131
  75. package/dist/extensions/Blocks/Unsubscribe/control.d.ts +0 -29
  76. package/dist/extensions/Blocks/Unsubscribe/control.js +0 -167
  77. package/dist/extensions/Blocks/Unsubscribe/elements/preview.d.ts +0 -11
  78. package/dist/extensions/Blocks/Unsubscribe/elements/preview.js +0 -42
  79. package/dist/extensions/Blocks/Unsubscribe/extension.d.ts +0 -2
  80. package/dist/extensions/Blocks/Unsubscribe/extension.js +0 -20
  81. package/dist/extensions/Blocks/Unsubscribe/settingsPanel.d.ts +0 -4
  82. package/dist/extensions/Blocks/Unsubscribe/settingsPanel.js +0 -19
  83. package/dist/extensions/Blocks/Unsubscribe/styles.css.js +0 -42
  84. package/dist/extensions/Blocks/Unsubscribe/tagRegistry.d.ts +0 -4
  85. package/dist/extensions/Blocks/Unsubscribe/tagRegistry.js +0 -10
  86. package/dist/extensions/Blocks/Unsubscribe/template.d.ts +0 -12
  87. package/dist/extensions/Blocks/Unsubscribe/template.js +0 -22
  88. package/dist/extensions/Blocks/Unsubscribe/utils/constants.d.ts +0 -9
  89. package/dist/extensions/Blocks/Unsubscribe/utils/constants.js +0 -11
  90. package/dist/extensions/Blocks/Unsubscribe/utils/utils.d.ts +0 -7
  91. package/dist/extensions/Blocks/Unsubscribe/utils/utils.js +0 -6
  92. package/dist/extensions/Blocks/_Boilerplate/iconsRegistry.d.ts +0 -4
  93. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +0 -648
  94. package/dist/services/unsubscribeApi.d.ts +0 -4
  95. package/dist/services/unsubscribeApi.js +0 -16
@@ -0,0 +1,12 @@
1
+ var T;
2
+ (function(t) {
3
+ t.TOP = "top", t.RIGHT = "right", t.BOTTOM = "bottom", t.LEFT = "left";
4
+ })(T || (T = {}));
5
+ var a;
6
+ (function(t) {
7
+ t.AI_HIDDEN_PREHEADER = "aiHiddenPreheader", t.AI_SUBJECT = "aiSubject", t.AI_TEXT = "aiText";
8
+ })(a || (a = {}));
9
+ export {
10
+ a as ExtensionPopoverType,
11
+ T as PopoverSide
12
+ };
@@ -0,0 +1,7 @@
1
+ var O;
2
+ (function(E) {
3
+ E.DESKTOP = "DESKTOP", E.MOBILE = "MOBILE";
4
+ })(O || (O = {}));
5
+ export {
6
+ O as PreviewDeviceMode
7
+ };
@@ -0,0 +1,7 @@
1
+ var s;
2
+ (function(t) {
3
+ t.SETTINGS = "settings", t.STYLES = "styles", t.DATA = "data";
4
+ })(s || (s = {}));
5
+ export {
6
+ s as SettingsTab
7
+ };
@@ -0,0 +1,7 @@
1
+ var C;
2
+ (function(E) {
3
+ E.BUTTON = "UE-BUTTON", E.CHECKBOX = "UE-CHECKBOX", E.CHECK_BUTTONS = "UE-CHECK-BUTTONS", E.COLOR = "UE-COLOR", E.COUNTER = "UE-COUNTER", E.DATEPICKER = "UE-DATEPICKER", E.LABEL = "UE-LABEL", E.MESSAGE = "UE-MESSAGE", E.RADIO_BUTTONS = "UE-RADIO-BUTTONS", E.SELECTPICKER = "UE-SELECT", E.SWITCHER = "UE-SWITCHER", E.TEXT = "UE-TEXT", E.TEXTAREA = "UE-TEXTAREA", E.CHECK_ITEM = "UE-CHECK-ITEM", E.RADIO_ITEM = "UE-RADIO-ITEM", E.SELECT_ITEM = "UE-SELECT-ITEM", E.ICON = "UE-ICON", E.MERGETAGS = "UE-MERGETAGS", E.FONT_FAMILY_SELECT = "UE-FONT-FAMILY-SELECT", E.NESTED_CONTROL = "UE-NESTED-CONTROL";
4
+ })(C || (C = {}));
5
+ export {
6
+ C as UIElementType
7
+ };
@@ -0,0 +1,24 @@
1
+ const t = {
2
+ name: "name",
3
+ disabled: "disabled"
4
+ }, e = {
5
+ ...t
6
+ }, s = {
7
+ ...t,
8
+ text: "text"
9
+ }, l = {
10
+ ...t,
11
+ placeholder: "placeholder",
12
+ items: "items"
13
+ }, c = {
14
+ text: "text",
15
+ value: "value"
16
+ }, n = {
17
+ BUTTON: e,
18
+ LABEL: s,
19
+ SELECTPICKER: l,
20
+ SELECT_ITEM: c
21
+ };
22
+ export {
23
+ n as UEAttr
24
+ };
@@ -0,0 +1,24 @@
1
+ var s = Object.defineProperty;
2
+ var t = (e, o, n) => o in e ? s(e, o, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[o] = n;
3
+ var r = (e, o, n) => t(e, typeof o != "symbol" ? o + "" : o, n);
4
+ class l {
5
+ constructor() {
6
+ /** Provides access to editor functionalities specific to this UI control instance. */
7
+ r(this, "api");
8
+ }
9
+ /**
10
+ * Optional hook called when the control is initially rendered.
11
+ * Use this for setup tasks like attaching event listeners to the control's template elements.
12
+ */
13
+ onRender() {
14
+ }
15
+ /**
16
+ * Optional cleanup hook called when the control is being destroyed.
17
+ * Use this to remove event listeners or perform other cleanup tasks.
18
+ */
19
+ onDestroy() {
20
+ }
21
+ }
22
+ export {
23
+ l as Control
24
+ };
@@ -0,0 +1,11 @@
1
+ var i = Object.defineProperty;
2
+ var g = (s, e, t) => e in s ? i(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t;
3
+ var a = (s, e, t) => g(s, typeof e != "symbol" ? e + "" : e, t);
4
+ class n {
5
+ constructor() {
6
+ a(this, "api");
7
+ }
8
+ }
9
+ export {
10
+ n as SettingsPanelRegistry
11
+ };
@@ -0,0 +1,33 @@
1
+ var r = Object.defineProperty;
2
+ var n = (e, s, t) => s in e ? r(e, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[s] = t;
3
+ var l = (e, s, t) => n(e, typeof s != "symbol" ? s + "" : s, t);
4
+ class o {
5
+ constructor(s, t) {
6
+ l(this, "tabId");
7
+ l(this, "label");
8
+ l(this, "controlsIds");
9
+ this.tabId = s, this.controlsIds = t;
10
+ }
11
+ getTabId() {
12
+ return this.tabId;
13
+ }
14
+ getLabel() {
15
+ return this.label;
16
+ }
17
+ getControlsIds() {
18
+ return this.controlsIds;
19
+ }
20
+ withLabel(s) {
21
+ return this.label = s, this;
22
+ }
23
+ addControl(s, t) {
24
+ return t < 0 ? this.controlsIds.unshift(s) : t > this.controlsIds.length ? this.controlsIds.push(s) : this.controlsIds.splice(t, 0, s), this;
25
+ }
26
+ deleteControl(s) {
27
+ const t = this.controlsIds.indexOf(s);
28
+ t !== -1 && this.controlsIds.splice(t, 1);
29
+ }
30
+ }
31
+ export {
32
+ o as SettingsPanelTab
33
+ };
@@ -0,0 +1,22 @@
1
+ var i = Object.defineProperty;
2
+ var e = (t, s, a) => s in t ? i(t, s, { enumerable: !0, configurable: !0, writable: !0, value: a }) : t[s] = a;
3
+ var r = (t, s, a) => e(t, typeof s != "symbol" ? s + "" : s, a);
4
+ class o {
5
+ constructor(s) {
6
+ r(this, "key");
7
+ r(this, "params");
8
+ this.key = s;
9
+ }
10
+ withParams(s) {
11
+ return this.params = s, this;
12
+ }
13
+ getValue() {
14
+ return {
15
+ key: this.key,
16
+ params: this.params
17
+ };
18
+ }
19
+ }
20
+ export {
21
+ o as ModificationDescription
22
+ };
@@ -0,0 +1,40 @@
1
+ var u = Object.defineProperty;
2
+ var n = (t, e, a) => e in t ? u(t, e, { enumerable: !0, configurable: !0, writable: !0, value: a }) : t[e] = a;
3
+ var l = (t, e, a) => n(t, typeof e != "symbol" ? e + "" : e, a);
4
+ class s {
5
+ constructor() {
6
+ /** Provides access to editor functionalities specific to this UI element instance. */
7
+ l(this, "api");
8
+ }
9
+ /**
10
+ * Optional cleanup hook called when the UI element is being destroyed.
11
+ * Use this to remove event listeners or perform other cleanup tasks.
12
+ */
13
+ onDestroy() {
14
+ }
15
+ /**
16
+ * Optional method to get the current value of the UI element.
17
+ * Implement this if the element manages a state or value (e.g., input fields).
18
+ * @returns The current value of the element.
19
+ */
20
+ getValue() {
21
+ }
22
+ /**
23
+ * Optional method to set the value of the UI element.
24
+ * Implement this if the element manages a state or value and needs to be updated externally.
25
+ * @param value - The new value to set.
26
+ */
27
+ setValue(e) {
28
+ }
29
+ /**
30
+ * @description Optional hook called when one of the element's supported attributes ({@link UEAttr}) gets updated externally.
31
+ * Implement this to react to attribute changes (e.g., visibility, disabled state).
32
+ * @param name - The name of the attribute that was updated.
33
+ * @param value - The new value of the attribute.
34
+ */
35
+ onAttributeUpdated(e, a) {
36
+ }
37
+ }
38
+ export {
39
+ s as UIElement
40
+ };
@@ -0,0 +1,5 @@
1
+ class s {
2
+ }
3
+ export {
4
+ s as UIElementTagRegistry
5
+ };
@@ -1,186 +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
- isActiveTypeFirstInCollection: (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>) => boolean;
123
- isActiveTypeLastInCollection: (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>) => boolean;
147
- hasTemplatesByCollectionType: (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>) => Record<number, boolean>;
171
- }, {
172
- $reset(): void;
173
- fetchTemplates(): Promise<void>;
174
- setCollection(collectionType: number): void;
175
- setCollectionWithoutAutoSelection(collectionType: number): void;
176
- setSelectedTemplate(template: number): void;
177
- setNextType(): void;
178
- setPreviousType(): void;
179
- loadSelectedTemplates(templates: number[]): void;
180
- getThumbnailByTemplateId(id: number): string;
181
- getSelectedTemplatesByCollection(type: number): number[];
182
- addUnsubscribePages(pageIds: number[]): void;
183
- removeUnsubscribePages(pageIds: number[]): void;
184
- getSelectedUnsubscribePagesByCollection(collectionType: number): number[];
185
- }>;
7
+ export declare const useUnsubscribeStore: import("pinia").StoreDefinition<"unsubscribe", StoreState, {}, {}>;
186
8
  export {};
@@ -1,128 +1,9 @@
1
- import { TYPE_COLLECTIONS as l, PAGE_TYPES as o } from "../enums/unsubscribe.js";
2
- import { useUnsubscribeApi as p } from "../services/unsubscribeApi.js";
3
- import { defineStore as r } from "pinia";
4
- const a = () => ({
5
- templates: [],
6
- selectedTemplates: {},
7
- selectedUnsubscribePages: [],
8
- selectedCollectionType: o.GLOBAL_UNSUBSCRIBE,
9
- activeType: o.GLOBAL_UNSUBSCRIBE,
10
- pageSelectionUpdateStatus: !1,
11
- pageSelectionDrawerStatus: !1,
12
- typeSelectionDrawerStatus: !1,
13
- isGlobalUnsubscribeDisabled: !1,
14
- isSubscriptionPreferencesCenterDisabled: !1
15
- }), u = r("unsubscribe", {
16
- state: () => a(),
17
- getters: {
18
- getSelectedCollection: (e) => l[e.selectedCollectionType],
19
- getSelectedTemplateByActiveType: (e) => e.selectedTemplates[e.activeType],
20
- getTemplatesByActiveType: (e) => e.templates.filter((t) => t.type === e.activeType),
21
- isActiveTypeFirstInCollection: (e) => {
22
- const t = l[e.selectedCollectionType];
23
- return e.activeType === t[0];
24
- },
25
- isActiveTypeLastInCollection: (e) => {
26
- const t = l[e.selectedCollectionType];
27
- return e.activeType === t[t.length - 1];
28
- },
29
- hasTemplatesByCollectionType: (e) => {
30
- const t = {};
31
- return l[e.selectedCollectionType].forEach((s) => {
32
- t[s] = e.templates.some((i) => i.type === s);
33
- }), t;
34
- }
35
- },
36
- actions: {
37
- $reset() {
38
- const { templates: e, selectedUnsubscribePages: t } = this;
39
- Object.assign(this, {
40
- ...a(),
41
- templates: e,
42
- selectedUnsubscribePages: t
43
- });
44
- },
45
- async fetchTemplates() {
46
- if (this.templates.length)
47
- return;
48
- const { getUnsubscribePages: e } = p(), t = await e();
49
- this.templates = t;
50
- },
51
- setCollection(e) {
52
- this.selectedCollectionType = e;
53
- const t = l[e];
54
- if (t && t.length > 0) {
55
- [this.activeType] = t;
56
- const c = { ...this.selectedTemplates };
57
- t.forEach((s) => {
58
- if (!c[s]) {
59
- const i = this.templates.find((n) => n.type === s);
60
- i && (c[s] = i.id);
61
- }
62
- }), this.selectedTemplates = c;
63
- }
64
- },
65
- setCollectionWithoutAutoSelection(e) {
66
- this.selectedCollectionType = e;
67
- const t = l[e];
68
- t && t.length > 0 && ([this.activeType] = t);
69
- },
70
- setSelectedTemplate(e) {
71
- this.selectedTemplates = {
72
- ...this.selectedTemplates,
73
- [this.activeType]: e
74
- };
75
- },
76
- setNextType() {
77
- const t = this.getSelectedCollection.indexOf(this.activeType) + 1;
78
- t < this.getSelectedCollection.length && (this.activeType = this.getSelectedCollection[t]);
79
- },
80
- setPreviousType() {
81
- const t = this.getSelectedCollection.indexOf(this.activeType) - 1;
82
- t >= 0 && (this.activeType = this.getSelectedCollection[t]);
83
- },
84
- loadSelectedTemplates(e) {
85
- const t = new Map(this.templates.map((s) => [s.id, s.type])), c = { ...this.selectedTemplates };
86
- e.forEach((s) => {
87
- const i = t.get(s);
88
- i !== void 0 && (c[i] = s);
89
- }), this.selectedTemplates = c;
90
- },
91
- getThumbnailByTemplateId(e) {
92
- var t;
93
- return ((t = this.templates.find((c) => c.id === e)) == null ? void 0 : t.thumbnail) ?? "";
94
- },
95
- getSelectedTemplatesByCollection(e) {
96
- const t = l[e], c = [];
97
- return t.forEach((s) => {
98
- this.selectedTemplates[s] && c.push(this.selectedTemplates[s]);
99
- }), c;
100
- },
101
- addUnsubscribePages(e) {
102
- const t = /* @__PURE__ */ new Set([...this.selectedUnsubscribePages, ...e]);
103
- this.selectedUnsubscribePages = Array.from(t);
104
- },
105
- removeUnsubscribePages(e) {
106
- this.selectedUnsubscribePages = this.selectedUnsubscribePages.filter(
107
- (t) => !e.includes(t)
108
- );
109
- },
110
- getSelectedUnsubscribePagesByCollection(e) {
111
- const t = l[e];
112
- if (!t)
113
- return [];
114
- const c = /* @__PURE__ */ new Map();
115
- this.templates.forEach((i) => {
116
- c.set(i.id, i.type);
117
- });
118
- const s = new Set(t);
119
- return this.selectedUnsubscribePages.filter((i) => {
120
- const n = c.get(i);
121
- return n !== void 0 && s.has(n);
122
- });
123
- }
124
- }
1
+ import { defineStore as e } from "pinia";
2
+ const t = () => ({
3
+ selectedUnsubscribePages: []
4
+ }), r = e("unsubscribe", {
5
+ state: () => t()
125
6
  });
126
7
  export {
127
- u as useUnsubscribeStore
8
+ r as useUnsubscribeStore
128
9
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@useinsider/guido",
3
- "version": "1.0.3-beta.391f32c",
3
+ "version": "1.0.3-beta.3cb36f8",
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",
@@ -31,7 +31,7 @@
31
31
  "author": "",
32
32
  "license": "ISC",
33
33
  "dependencies": {
34
- "@stripoinc/ui-editor-extensions": "3.0.0",
34
+ "@stripoinc/ui-editor-extensions": "2.0.2",
35
35
  "@useinsider/design-system-vue": "0.14.8",
36
36
  "@vueuse/core": "11.3.0",
37
37
  "lodash-es": "4.17.21",
@@ -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,18 +0,0 @@
1
- import s from "./UnsubscribeBreadcrumb.vue2.js";
2
- /* empty css */
3
- import a from "../../../_virtual/_plugin-vue2_normalizer.js";
4
- var o = function() {
5
- var e = this, t = e._self._c, r = e._self._setupProxy;
6
- return t(r.InBreadcrumb, { staticClass: "c-p", attrs: { "without-router": "", "active-tab": r.unsubscribeStore.activeType, "home-icon": !1, list: r.breadcrumbs, routes: [] }, on: { click: r.navigate } });
7
- }, c = [], n = /* @__PURE__ */ a(
8
- s,
9
- o,
10
- c,
11
- !1,
12
- null,
13
- "70835920"
14
- );
15
- const f = n.exports;
16
- export {
17
- f as default
18
- };
@@ -1,16 +0,0 @@
1
- import { defineComponent as o, computed as n } from "vue";
2
- import { TYPE_TRANSLATIONS as s } from "../../../enums/unsubscribe.js";
3
- import { useUnsubscribeStore as c } from "../../../stores/unsubscribe.js";
4
- import { InBreadcrumb as m } from "@useinsider/design-system-vue";
5
- const f = /* @__PURE__ */ o({
6
- __name: "UnsubscribeBreadcrumb",
7
- setup(a) {
8
- const r = c(), t = n(() => r.getSelectedCollection.map((e) => ({ value: e, text: s[e] })));
9
- return { __sfc: !0, unsubscribeStore: r, breadcrumbs: t, navigate: (e) => {
10
- r.activeType = e.value;
11
- }, InBreadcrumb: m };
12
- }
13
- });
14
- export {
15
- f as default
16
- };
@@ -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,24 +0,0 @@
1
- import a from "./UnsubscribePageSelection.vue2.js";
2
- /* empty css */
3
- import n from "../../../_virtual/_plugin-vue2_normalizer.js";
4
- var o = function() {
5
- var r = this, e = r._self._c, t = r._self._setupProxy;
6
- return e(t.WpDrawer, { attrs: { id: "unsubscribe-modal", "description-status": "", size: "large", "footer-button-group-options": t.footerButtonGroupOptions, status: t.unsubscribeStore.pageSelectionDrawerStatus, "title-text": t.trans("newsletter.select-a-template") }, on: { cancelOrBackButtonEvent: t.handleBack, onCloseEvent: t.closeModal, primaryButtonEvent: t.handleSave }, scopedSlots: r._u([{ key: "headerBottomSlot", fn: function() {
7
- return [e(t.UnsubscribeBreadcrumb, { staticClass: "px-5 py-3" })];
8
- }, proxy: !0 }]) }, [e("div", { staticClass: "d-g templates-wrapper" }, r._l(t.unsubscribeStore.getTemplatesByActiveType, function(s) {
9
- return e("div", { key: s.id, staticClass: "template-wrapper", on: { click: function(u) {
10
- return t.selectTemplate(s.id);
11
- } } }, [e(t.InContainer, { staticClass: "template-container o-h", class: { selected: t.unsubscribeStore.getSelectedTemplateByActiveType === s.id }, attrs: { border: t.getBorderClass(s.id) } }, [e("div", { staticClass: "w-1 h-1 d-f j-c-c a-i-c" }, [e("img", { staticClass: "w-1 h-1 thumbnail o-h", attrs: { alt: s.name, src: s.thumbnail } })])]), e("div", { staticClass: "mt-1 f-s-1" }, [r._v(" " + r._s(s.name) + " ")])], 1);
12
- }), 0)]);
13
- }, i = [], c = /* @__PURE__ */ n(
14
- a,
15
- o,
16
- i,
17
- !1,
18
- null,
19
- "a86fc486"
20
- );
21
- const _ = c.exports;
22
- export {
23
- _ as default
24
- };