@useinsider/guido 1.0.3-beta.a6893cb → 1.0.3-beta.a6a2da8
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.
- package/dist/@types/generic.d.ts +9 -0
- package/dist/components/Guido.vue.d.ts +2 -2
- package/dist/components/Guido.vue.js +8 -8
- package/dist/components/Guido.vue2.js +74 -69
- package/dist/components/organisms/unsubscribe/UnsubscribeBreadcrumb.vue.d.ts +2 -0
- package/dist/components/organisms/unsubscribe/UnsubscribeBreadcrumb.vue.js +18 -0
- package/dist/components/organisms/unsubscribe/UnsubscribeBreadcrumb.vue2.js +16 -0
- package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue.d.ts +2 -0
- package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue.js +24 -0
- package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue2.js +64 -0
- package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue.d.ts +2 -0
- package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue.js +18 -0
- package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue2.js +107 -0
- package/dist/components/organisms/unsubscribe/UnsubscribeWrapper.vue.d.ts +2 -0
- package/dist/components/organisms/unsubscribe/UnsubscribeWrapper.vue.js +18 -0
- package/dist/components/organisms/unsubscribe/UnsubscribeWrapper.vue2.js +12 -0
- package/dist/components/wrappers/WpDrawer.vue.d.ts +6 -4
- package/dist/components/wrappers/WpDrawer.vue.js +6 -4
- package/dist/composables/useStripo.js +40 -32
- package/dist/config/compiler/unsubscribeCompilerRules.js +42 -29
- package/dist/config/migrator/couponBlockMigrator.d.ts +1 -0
- package/dist/config/migrator/couponBlockMigrator.js +67 -0
- package/dist/config/migrator/index.d.ts +1 -1
- package/dist/config/migrator/index.js +7 -5
- package/dist/config/migrator/unsubscribeMigrator.d.ts +1 -0
- package/dist/config/migrator/unsubscribeMigrator.js +124 -0
- package/dist/enums/defaults.js +6 -3
- package/dist/enums/unsubscribe.d.ts +19 -0
- package/dist/enums/unsubscribe.js +39 -6
- package/dist/extensions/Blocks/Checkbox/block.d.ts +1 -0
- package/dist/extensions/Blocks/Checkbox/block.js +15 -24
- package/dist/extensions/Blocks/Checkbox/control.js +24 -38
- package/dist/extensions/Blocks/Checkbox/extension.js +5 -16
- package/dist/extensions/Blocks/Checkbox/iconsRegistry.d.ts +4 -0
- package/dist/extensions/Blocks/Checkbox/iconsRegistry.js +18 -0
- package/dist/extensions/Blocks/Checkbox/settingsPanel.js +12 -25
- package/dist/extensions/Blocks/Checkbox/template.js +5 -16
- package/dist/extensions/Blocks/CouponBlock/block.d.ts +12 -0
- package/dist/extensions/Blocks/CouponBlock/block.js +33 -0
- package/dist/extensions/Blocks/CouponBlock/extension.d.ts +2 -0
- package/dist/extensions/Blocks/CouponBlock/extension.js +8 -0
- package/dist/extensions/Blocks/CouponBlock/iconsRegistry.d.ts +4 -0
- package/dist/extensions/Blocks/CouponBlock/iconsRegistry.js +33 -0
- package/dist/extensions/Blocks/CouponBlock/settingsPanel.d.ts +4 -0
- package/dist/extensions/Blocks/CouponBlock/settingsPanel.js +24 -0
- package/dist/extensions/Blocks/CouponBlock/template.d.ts +3 -0
- package/dist/extensions/Blocks/CouponBlock/template.js +18 -0
- package/dist/extensions/Blocks/RadioButton/block.d.ts +1 -0
- package/dist/extensions/Blocks/RadioButton/block.js +13 -22
- package/dist/extensions/Blocks/RadioButton/control.js +32 -46
- package/dist/extensions/Blocks/RadioButton/extension.js +4 -15
- package/dist/extensions/Blocks/RadioButton/iconsRegistry.d.ts +4 -0
- package/dist/extensions/Blocks/RadioButton/iconsRegistry.js +14 -0
- package/dist/extensions/Blocks/RadioButton/settingsPanel.js +13 -26
- package/dist/extensions/Blocks/RadioButton/template.js +7 -18
- package/dist/extensions/Blocks/Unsubscribe/block.d.ts +32 -0
- package/dist/extensions/Blocks/Unsubscribe/block.js +131 -0
- package/dist/extensions/Blocks/Unsubscribe/control.d.ts +29 -0
- package/dist/extensions/Blocks/Unsubscribe/control.js +167 -0
- package/dist/extensions/Blocks/Unsubscribe/elements/preview.d.ts +11 -0
- package/dist/extensions/Blocks/Unsubscribe/elements/preview.js +42 -0
- package/dist/extensions/Blocks/Unsubscribe/extension.d.ts +2 -0
- package/dist/extensions/Blocks/Unsubscribe/extension.js +21 -0
- package/dist/extensions/Blocks/Unsubscribe/iconsRegistry.d.ts +4 -0
- package/dist/extensions/Blocks/Unsubscribe/iconsRegistry.js +21 -0
- package/dist/extensions/Blocks/Unsubscribe/settingsPanel.d.ts +4 -0
- package/dist/extensions/Blocks/Unsubscribe/settingsPanel.js +35 -0
- package/dist/extensions/Blocks/Unsubscribe/styles.css.js +42 -0
- package/dist/extensions/Blocks/Unsubscribe/tagRegistry.d.ts +4 -0
- package/dist/extensions/Blocks/Unsubscribe/tagRegistry.js +10 -0
- package/dist/extensions/Blocks/Unsubscribe/template.d.ts +12 -0
- package/dist/extensions/Blocks/Unsubscribe/template.js +22 -0
- package/dist/extensions/Blocks/Unsubscribe/utils/constants.d.ts +9 -0
- package/dist/extensions/Blocks/Unsubscribe/utils/constants.js +11 -0
- package/dist/extensions/Blocks/Unsubscribe/utils/utils.d.ts +7 -0
- package/dist/extensions/Blocks/Unsubscribe/utils/utils.js +6 -0
- package/dist/extensions/Blocks/_Boilerplate/block.d.ts +1 -0
- package/dist/extensions/Blocks/_Boilerplate/iconsRegistry.d.ts +4 -0
- package/dist/extensions/DynamicContent/dynamic-content.js +31 -45
- package/dist/extensions/DynamicContent/extension.js +6 -18
- package/dist/guido.css +1 -1
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +648 -0
- package/dist/services/unsubscribeApi.d.ts +4 -0
- package/dist/services/unsubscribeApi.js +16 -0
- package/dist/stores/config.d.ts +96 -0
- package/dist/stores/config.js +17 -0
- package/dist/stores/unsubscribe.d.ts +253 -5
- package/dist/stores/unsubscribe.js +126 -6
- package/dist/utils/templatePreparation.js +17 -16
- package/package.json +2 -2
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/Extension.js +0 -75
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/ExtensionBuilder.js +0 -77
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/blocks/Block.js +0 -123
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/AiAssistantValueType.js +0 -7
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockCompositionType.js +0 -7
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockName.js +0 -12
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockType.js +0 -7
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/BuiltInControlTypes.js +0 -119
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/ContextActionType.js +0 -7
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/EditorStatePropertyType.js +0 -7
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/PanelPosition.js +0 -7
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/Popover.js +0 -12
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/PreviewDeviceMode.js +0 -7
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/SettingsTab.js +0 -7
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/UIElementType.js +0 -7
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/UIElementsAttributes.js +0 -24
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/Control.js +0 -24
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/SettingsPanelRegistry.js +0 -11
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/SettingsPanelTab.js +0 -33
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/modifications/ModificationDescription.js +0 -22
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/ui-elements/UIElement.js +0 -40
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/ui-elements/UIElementTagRegistry.js +0 -5
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import type { GuidoConfig, TemplateConfig } from '@@/Types/generic';
|
|
2
|
+
interface StoreState {
|
|
3
|
+
guidoConfig: GuidoConfig;
|
|
4
|
+
templateConfig?: TemplateConfig;
|
|
5
|
+
}
|
|
6
|
+
export declare const useConfigStore: import("pinia").StoreDefinition<"config", StoreState, {
|
|
7
|
+
getVariationId: (state: {
|
|
8
|
+
guidoConfig: {
|
|
9
|
+
translationsPath: string;
|
|
10
|
+
htmlCompilerRules?: ({
|
|
11
|
+
type: "replace";
|
|
12
|
+
search: string;
|
|
13
|
+
replacement: string;
|
|
14
|
+
replaceAll?: boolean | undefined;
|
|
15
|
+
id: string;
|
|
16
|
+
description?: string | undefined;
|
|
17
|
+
priority: number;
|
|
18
|
+
} | {
|
|
19
|
+
type: "regex";
|
|
20
|
+
pattern: string;
|
|
21
|
+
replacement: string;
|
|
22
|
+
flags?: string | undefined;
|
|
23
|
+
id: string;
|
|
24
|
+
description?: string | undefined;
|
|
25
|
+
priority: number;
|
|
26
|
+
} | {
|
|
27
|
+
type: "remove";
|
|
28
|
+
targets: string[] | {
|
|
29
|
+
exec: (string: string) => RegExpExecArray | null;
|
|
30
|
+
test: (string: string) => boolean;
|
|
31
|
+
readonly source: string;
|
|
32
|
+
readonly global: boolean;
|
|
33
|
+
readonly ignoreCase: boolean;
|
|
34
|
+
readonly multiline: boolean;
|
|
35
|
+
lastIndex: number;
|
|
36
|
+
compile: (pattern: string, flags?: string) => RegExp;
|
|
37
|
+
readonly flags: string;
|
|
38
|
+
readonly sticky: boolean;
|
|
39
|
+
readonly unicode: boolean;
|
|
40
|
+
readonly dotAll: boolean;
|
|
41
|
+
readonly hasIndices: boolean;
|
|
42
|
+
[Symbol.match]: (string: string) => RegExpMatchArray | null;
|
|
43
|
+
[Symbol.replace]: {
|
|
44
|
+
(string: string, replaceValue: string): string;
|
|
45
|
+
(string: string, replacer: (substring: string, ...args: any[]) => string): string;
|
|
46
|
+
};
|
|
47
|
+
[Symbol.search]: (string: string) => number;
|
|
48
|
+
[Symbol.split]: (string: string, limit?: number) => string[];
|
|
49
|
+
[Symbol.matchAll]: (str: string) => IterableIterator<RegExpMatchArray>;
|
|
50
|
+
}[];
|
|
51
|
+
id: string;
|
|
52
|
+
description?: string | undefined;
|
|
53
|
+
priority: number;
|
|
54
|
+
} | {
|
|
55
|
+
type: "custom";
|
|
56
|
+
processor: (html: string) => string;
|
|
57
|
+
id: string;
|
|
58
|
+
description?: string | undefined;
|
|
59
|
+
priority: number;
|
|
60
|
+
})[] | undefined;
|
|
61
|
+
ignoreDefaultHtmlCompilerRules?: boolean | undefined;
|
|
62
|
+
useHeader?: boolean | undefined;
|
|
63
|
+
emailHeader: {
|
|
64
|
+
senderName: string;
|
|
65
|
+
subject: string;
|
|
66
|
+
};
|
|
67
|
+
partner?: {
|
|
68
|
+
partnerName: string;
|
|
69
|
+
productType: number;
|
|
70
|
+
messageType: number;
|
|
71
|
+
} | undefined;
|
|
72
|
+
extensions?: {
|
|
73
|
+
unsubscribe?: boolean | undefined;
|
|
74
|
+
} | undefined;
|
|
75
|
+
features?: {
|
|
76
|
+
dynamicContent?: boolean | undefined;
|
|
77
|
+
saveAsTemplate?: boolean | undefined;
|
|
78
|
+
versionHistory?: boolean | undefined;
|
|
79
|
+
} | undefined;
|
|
80
|
+
};
|
|
81
|
+
templateConfig?: {
|
|
82
|
+
preselectedDynamicContentList?: {
|
|
83
|
+
value: string;
|
|
84
|
+
text: string;
|
|
85
|
+
fallback?: string | undefined;
|
|
86
|
+
format?: {
|
|
87
|
+
key: string;
|
|
88
|
+
value: string;
|
|
89
|
+
} | undefined;
|
|
90
|
+
}[] | undefined;
|
|
91
|
+
selectedUnsubscribePages?: number[] | undefined;
|
|
92
|
+
variationId?: string | undefined;
|
|
93
|
+
} | undefined;
|
|
94
|
+
} & import("pinia").PiniaCustomStateProperties<StoreState>) => string;
|
|
95
|
+
}, {}>;
|
|
96
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { DefaultGuidoConfig as e } from "../enums/defaults.js";
|
|
2
|
+
import { defineStore as i } from "pinia";
|
|
3
|
+
const r = i("config", {
|
|
4
|
+
state: () => ({
|
|
5
|
+
guidoConfig: e,
|
|
6
|
+
templateConfig: {}
|
|
7
|
+
}),
|
|
8
|
+
getters: {
|
|
9
|
+
getVariationId: (t) => {
|
|
10
|
+
var o;
|
|
11
|
+
return ((o = t.templateConfig) == null ? void 0 : o.variationId) ?? "";
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
export {
|
|
16
|
+
r as useConfigStore
|
|
17
|
+
};
|
|
@@ -1,8 +1,256 @@
|
|
|
1
|
-
type UnsubscribePage
|
|
2
|
-
type: number;
|
|
3
|
-
};
|
|
1
|
+
import type { UnsubscribePage } from '@@/Types/unsubscribe';
|
|
4
2
|
interface StoreState {
|
|
5
|
-
|
|
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;
|
|
6
13
|
}
|
|
7
|
-
export declare const useUnsubscribeStore: import("pinia").StoreDefinition<"unsubscribe", StoreState, {
|
|
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
|
+
}>;
|
|
8
256
|
export {};
|
|
@@ -1,9 +1,129 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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
|
+
}
|
|
6
126
|
});
|
|
7
127
|
export {
|
|
8
|
-
|
|
128
|
+
g as useUnsubscribeStore
|
|
9
129
|
};
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { useActionsApi as
|
|
2
|
-
import { useHtmlCompiler as
|
|
1
|
+
import { useActionsApi as S } from "../composables/useActionsApi.js";
|
|
2
|
+
import { useHtmlCompiler as b } from "../composables/useHtmlCompiler.js";
|
|
3
3
|
import { useDynamicContentStore as f } from "../stores/dynamic-content.js";
|
|
4
|
-
|
|
5
|
-
|
|
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();
|
|
6
7
|
return {
|
|
7
8
|
prepareTemplateDetails: async () => {
|
|
8
|
-
const { html: a, ampHtml:
|
|
9
|
+
const { html: a, ampHtml: m = "", ampErrors: r = [] } = await o({
|
|
9
10
|
minimize: !0,
|
|
10
11
|
resetDataSavedFlag: !1
|
|
11
|
-
}), { html:
|
|
12
|
+
}), { html: c, css: l, syncModulesIds: p = [] } = await s(), { compiledHtml: u, stats: e, appliedRules: d } = n(a), g = i.getSelectedDynamicContentList;
|
|
12
13
|
return console.debug("HTML Compilation Stats:", {
|
|
13
14
|
originalSize: e.originalSize,
|
|
14
15
|
compiledSize: e.compiledSize,
|
|
@@ -16,25 +17,25 @@ const H = () => {
|
|
|
16
17
|
appliedRules: d,
|
|
17
18
|
executionTime: `${e.executionTime.toFixed(2)}ms`
|
|
18
19
|
}), {
|
|
19
|
-
dynamicContentList:
|
|
20
|
-
compiledHtml:
|
|
21
|
-
rawHtml:
|
|
22
|
-
css:
|
|
23
|
-
ampHtml:
|
|
24
|
-
ampErrors:
|
|
25
|
-
modules:
|
|
20
|
+
dynamicContentList: g,
|
|
21
|
+
compiledHtml: u,
|
|
22
|
+
rawHtml: c,
|
|
23
|
+
css: l,
|
|
24
|
+
ampHtml: m,
|
|
25
|
+
ampErrors: r,
|
|
26
|
+
modules: p,
|
|
26
27
|
recommendation: {
|
|
27
28
|
campaignUrls: {},
|
|
28
29
|
configs: {}
|
|
29
30
|
},
|
|
30
31
|
unsubscribe: {
|
|
31
|
-
status:
|
|
32
|
-
config:
|
|
32
|
+
status: t.unsubscribePagesStatus,
|
|
33
|
+
config: t.selectedUnsubscribePages
|
|
33
34
|
}
|
|
34
35
|
};
|
|
35
36
|
}
|
|
36
37
|
};
|
|
37
38
|
};
|
|
38
39
|
export {
|
|
39
|
-
|
|
40
|
+
z as useTemplatePreparation
|
|
40
41
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@useinsider/guido",
|
|
3
|
-
"version": "1.0.3-beta.
|
|
3
|
+
"version": "1.0.3-beta.a6a2da8",
|
|
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": "
|
|
34
|
+
"@stripoinc/ui-editor-extensions": "3.0.0",
|
|
35
35
|
"@useinsider/design-system-vue": "0.14.8",
|
|
36
36
|
"@vueuse/core": "11.3.0",
|
|
37
37
|
"lodash-es": "4.17.21",
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
var E = Object.defineProperty;
|
|
2
|
-
var L = (r, e, i) => e in r ? E(r, e, { enumerable: !0, configurable: !0, writable: !0, value: i }) : r[e] = i;
|
|
3
|
-
var t = (r, e, i) => L(r, typeof e != "symbol" ? e + "" : e, i);
|
|
4
|
-
class A {
|
|
5
|
-
constructor(e, i, s = [], n, a = [], l, o = [], g = [], y, h, x, u, b, c, m) {
|
|
6
|
-
t(this, "i18n");
|
|
7
|
-
t(this, "styles");
|
|
8
|
-
t(this, "previewStyles");
|
|
9
|
-
t(this, "uiElements", []);
|
|
10
|
-
t(this, "uiElementTagRegistry");
|
|
11
|
-
t(this, "controls", []);
|
|
12
|
-
t(this, "settingsPanelRegistry");
|
|
13
|
-
t(this, "contextActions", []);
|
|
14
|
-
t(this, "blocks", []);
|
|
15
|
-
t(this, "id");
|
|
16
|
-
t(this, "externalSmartElementsLibrary");
|
|
17
|
-
t(this, "externalImageLibrary");
|
|
18
|
-
t(this, "externalAiAssistant");
|
|
19
|
-
t(this, "externalDisplayConditionsLibrary");
|
|
20
|
-
t(this, "externalVideoLibrary");
|
|
21
|
-
t(this, "blocksPanel");
|
|
22
|
-
this.i18n = e, this.styles = i, this.previewStyles = x, this.uiElements = s, this.uiElementTagRegistry = n, this.controls = a, this.settingsPanelRegistry = l, this.contextActions = o, this.blocks = g, this.externalSmartElementsLibrary = y, this.externalImageLibrary = h, this.externalAiAssistant = u, this.externalDisplayConditionsLibrary = b, this.externalVideoLibrary = c, this.blocksPanel = m, this.id = Math.random().toString(36).substring(2);
|
|
23
|
-
}
|
|
24
|
-
getI18n() {
|
|
25
|
-
return this.i18n;
|
|
26
|
-
}
|
|
27
|
-
getStyles() {
|
|
28
|
-
return this.styles;
|
|
29
|
-
}
|
|
30
|
-
getPreviewStyles() {
|
|
31
|
-
return this.previewStyles;
|
|
32
|
-
}
|
|
33
|
-
getUiElements() {
|
|
34
|
-
return this.uiElements;
|
|
35
|
-
}
|
|
36
|
-
getUiElementTagRegistry() {
|
|
37
|
-
return this.uiElementTagRegistry;
|
|
38
|
-
}
|
|
39
|
-
getControls() {
|
|
40
|
-
return this.controls;
|
|
41
|
-
}
|
|
42
|
-
getSettingsPanelRegistry() {
|
|
43
|
-
return this.settingsPanelRegistry;
|
|
44
|
-
}
|
|
45
|
-
getContextActions() {
|
|
46
|
-
return this.contextActions;
|
|
47
|
-
}
|
|
48
|
-
getBlocks() {
|
|
49
|
-
return this.blocks;
|
|
50
|
-
}
|
|
51
|
-
getId() {
|
|
52
|
-
return this.id;
|
|
53
|
-
}
|
|
54
|
-
getExternalSmartElementsLibrary() {
|
|
55
|
-
return this.externalSmartElementsLibrary;
|
|
56
|
-
}
|
|
57
|
-
getExternalImageLibrary() {
|
|
58
|
-
return this.externalImageLibrary;
|
|
59
|
-
}
|
|
60
|
-
getExternalAiAssistant() {
|
|
61
|
-
return this.externalAiAssistant;
|
|
62
|
-
}
|
|
63
|
-
getExternalDisplayConditionsLibrary() {
|
|
64
|
-
return this.externalDisplayConditionsLibrary;
|
|
65
|
-
}
|
|
66
|
-
getExternalVideoLibrary() {
|
|
67
|
-
return this.externalVideoLibrary;
|
|
68
|
-
}
|
|
69
|
-
getBlocksPanel() {
|
|
70
|
-
return this.blocksPanel;
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
export {
|
|
74
|
-
A as Extension
|
|
75
|
-
};
|