@useinsider/guido 1.0.3-beta.ce4cdcb → 1.0.3-beta.cedc8cb
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 +13 -0
- package/dist/components/Guido.vue.d.ts +3 -2
- package/dist/components/Guido.vue.js +4 -4
- package/dist/components/Guido.vue2.js +99 -70
- package/dist/components/organisms/extensions/recommendation/FilterItem.vue.d.ts +19 -0
- package/dist/components/organisms/extensions/recommendation/FilterItem.vue.js +28 -0
- package/dist/components/organisms/extensions/recommendation/FilterItem.vue2.js +38 -0
- package/dist/components/organisms/extensions/recommendation/FilterSelectionDrawer.vue.d.ts +2 -0
- package/dist/components/organisms/extensions/recommendation/FilterSelectionDrawer.vue.js +17 -0
- package/dist/components/organisms/extensions/recommendation/FilterSelectionDrawer.vue2.js +37 -0
- package/dist/components/organisms/extensions/recommendation/Filters.vue.d.ts +2 -0
- package/dist/components/organisms/extensions/recommendation/Filters.vue.js +20 -0
- package/dist/components/organisms/extensions/recommendation/Filters.vue2.js +44 -0
- package/dist/components/organisms/extensions/recommendation/LogicAdapter.vue.d.ts +16 -0
- package/dist/components/organisms/extensions/recommendation/LogicAdapter.vue.js +17 -0
- package/dist/components/organisms/extensions/recommendation/LogicAdapter.vue2.js +27 -0
- 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/useApiErrorTracking.d.ts +26 -0
- package/dist/composables/useApiErrorTracking.js +120 -0
- package/dist/composables/useErrorTracking.d.ts +30 -0
- package/dist/composables/useErrorTracking.js +98 -0
- package/dist/composables/useHttp.js +89 -52
- package/dist/composables/useStripo.js +160 -61
- package/dist/composables/useStripoErrorCategory.d.ts +26 -0
- package/dist/composables/useStripoErrorCategory.js +86 -0
- package/dist/composables/useStripoSlackNotifier.d.ts +8 -0
- package/dist/composables/useStripoSlackNotifier.js +47 -0
- package/dist/config/compiler/unsubscribeCompilerRules.js +42 -29
- package/dist/config/migrator/index.d.ts +1 -1
- package/dist/config/migrator/index.js +7 -6
- 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/extensions/recommendationBlock.d.ts +16 -0
- package/dist/enums/extensions/recommendationBlock.js +80 -0
- package/dist/enums/unsubscribe.d.ts +19 -0
- package/dist/enums/unsubscribe.js +39 -6
- package/dist/extensions/Blocks/Checkbox/control.js +35 -39
- package/dist/extensions/Blocks/RadioButton/control.js +33 -37
- package/dist/extensions/Blocks/RadioButton/template.js +6 -6
- package/dist/extensions/Blocks/Recommendation/block.d.ts +10 -0
- package/dist/extensions/Blocks/Recommendation/block.js +27 -0
- package/dist/extensions/Blocks/Recommendation/control.d.ts +29 -0
- package/dist/extensions/Blocks/Recommendation/control.js +277 -0
- package/dist/extensions/Blocks/Recommendation/extension.d.ts +2 -0
- package/dist/extensions/Blocks/Recommendation/extension.js +10 -0
- package/dist/extensions/Blocks/Recommendation/iconsRegistry.d.ts +4 -0
- package/dist/extensions/Blocks/Recommendation/iconsRegistry.js +51 -0
- package/dist/extensions/Blocks/Recommendation/recommendation.css.js +19 -0
- package/dist/extensions/Blocks/Recommendation/settingsPanel.d.ts +4 -0
- package/dist/extensions/Blocks/Recommendation/settingsPanel.js +32 -0
- package/dist/extensions/Blocks/Recommendation/store/recommendation.d.ts +555 -0
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +266 -0
- package/dist/extensions/Blocks/Recommendation/template.d.ts +6 -0
- package/dist/extensions/Blocks/Recommendation/template.js +200 -0
- package/dist/extensions/Blocks/Recommendation/utils/filterUtil.d.ts +7 -0
- package/dist/extensions/Blocks/Recommendation/utils/filterUtil.js +28 -0
- 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/common-control.d.ts +66 -0
- package/dist/extensions/Blocks/common-control.js +102 -0
- package/dist/guido.css +1 -1
- package/dist/mock/api/recommendation.d.ts +2 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +83 -71
- package/dist/services/recommendationApi.d.ts +6 -0
- package/dist/services/recommendationApi.js +43 -0
- package/dist/services/slackNotificationService.d.ts +110 -0
- package/dist/services/slackNotificationService.js +167 -0
- package/dist/services/stripoApi.js +49 -19
- package/dist/services/stripoErrorDeduplicationService.d.ts +75 -0
- package/dist/services/stripoErrorDeduplicationService.js +91 -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/editor.d.ts +21 -0
- package/dist/stores/editor.js +2 -1
- package/dist/stores/unsubscribe.d.ts +253 -5
- package/dist/stores/unsubscribe.js +126 -6
- package/dist/utils/genericUtil.d.ts +1 -0
- package/dist/utils/genericUtil.js +8 -7
- package/dist/utils/templatePreparation.js +17 -16
- package/package.json +2 -2
|
@@ -1,25 +1,45 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { useApiErrorTracking as i } from "../composables/useApiErrorTracking.js";
|
|
2
|
+
import { useHttp as c } from "../composables/useHttp.js";
|
|
3
|
+
import { useToaster as p } from "../composables/useToaster.js";
|
|
4
|
+
const h = () => {
|
|
5
|
+
const { get: s } = c(), { handleError: n } = p(), { withParsingErrorTracking: a } = i();
|
|
5
6
|
return {
|
|
6
7
|
getToken: async () => {
|
|
7
8
|
try {
|
|
8
|
-
const t = Number(localStorage.getItem("ins-guido-test-instance")), { data: e } = await
|
|
9
|
-
return
|
|
9
|
+
const t = Number(localStorage.getItem("ins-guido-test-instance")), { data: e } = await s(`/stripo/get-user-token?test=${t}`);
|
|
10
|
+
return a(
|
|
11
|
+
() => {
|
|
12
|
+
var o;
|
|
13
|
+
if (!((o = e == null ? void 0 : e.body) != null && o.token))
|
|
14
|
+
throw new Error("Invalid token response: missing token in response body");
|
|
15
|
+
return e.body.token;
|
|
16
|
+
},
|
|
17
|
+
"/stripo/get-user-token",
|
|
18
|
+
e,
|
|
19
|
+
{ endpoint: "/stripo/get-user-token", operation: "getToken" }
|
|
20
|
+
);
|
|
10
21
|
} catch (t) {
|
|
11
|
-
return
|
|
22
|
+
return n(t, "Failed to fetch token"), "";
|
|
12
23
|
}
|
|
13
24
|
},
|
|
14
25
|
getCustomFonts: async () => {
|
|
15
26
|
try {
|
|
16
|
-
const { data: t = [] } = await
|
|
17
|
-
return
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
27
|
+
const { data: t = [] } = await s("/stripo/get-partner-custom-fonts");
|
|
28
|
+
return a(
|
|
29
|
+
() => {
|
|
30
|
+
if (!Array.isArray(t))
|
|
31
|
+
throw new Error("Invalid fonts response: expected array");
|
|
32
|
+
return t.map((r) => ({
|
|
33
|
+
...r,
|
|
34
|
+
active: !0
|
|
35
|
+
}));
|
|
36
|
+
},
|
|
37
|
+
"/stripo/get-partner-custom-fonts",
|
|
38
|
+
t,
|
|
39
|
+
{ endpoint: "/stripo/get-partner-custom-fonts", operation: "getCustomFonts" }
|
|
40
|
+
);
|
|
21
41
|
} catch (t) {
|
|
22
|
-
return
|
|
42
|
+
return n(t, "Failed to fetch custom fonts"), [];
|
|
23
43
|
}
|
|
24
44
|
},
|
|
25
45
|
getDefaultTemplate: async () => {
|
|
@@ -29,21 +49,31 @@ const m = () => {
|
|
|
29
49
|
forceRecreate: !0
|
|
30
50
|
};
|
|
31
51
|
try {
|
|
32
|
-
const { data: e } = await
|
|
52
|
+
const { data: e } = await s("/stripo/default-template");
|
|
33
53
|
try {
|
|
34
54
|
return {
|
|
35
|
-
...
|
|
55
|
+
...a(
|
|
56
|
+
() => {
|
|
57
|
+
const o = JSON.parse(e);
|
|
58
|
+
if (!o.html)
|
|
59
|
+
throw new Error("Invalid template response: missing html field");
|
|
60
|
+
return o;
|
|
61
|
+
},
|
|
62
|
+
"/stripo/default-template",
|
|
63
|
+
e,
|
|
64
|
+
{ endpoint: "/stripo/default-template", operation: "getDefaultTemplate" }
|
|
65
|
+
),
|
|
36
66
|
forceRecreate: !0
|
|
37
67
|
};
|
|
38
|
-
} catch {
|
|
39
|
-
return t;
|
|
68
|
+
} catch (r) {
|
|
69
|
+
return r instanceof Error && !r.message.includes("Invalid template") && n(r, "Failed to parse template as JSON"), t;
|
|
40
70
|
}
|
|
41
71
|
} catch (e) {
|
|
42
|
-
return
|
|
72
|
+
return n(e, "Failed to fetch default template"), t;
|
|
43
73
|
}
|
|
44
74
|
}
|
|
45
75
|
};
|
|
46
76
|
};
|
|
47
77
|
export {
|
|
48
|
-
|
|
78
|
+
h as useStripoApi
|
|
49
79
|
};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Service for handling Stripo error deduplication locally in Guido
|
|
3
|
+
*
|
|
4
|
+
* IMPORTANT: These errors are Guido's responsibility, not consuming teams'
|
|
5
|
+
* - Errors are caught and handled within Guido
|
|
6
|
+
* - Slack alerts notify Guido team to take action
|
|
7
|
+
* - Do NOT propagate errors to consuming teams' error tracking
|
|
8
|
+
* - Do NOT require backend involvement (errors are client-side)
|
|
9
|
+
*
|
|
10
|
+
* This keeps Stripo integration issues isolated to Guido's systems
|
|
11
|
+
*/
|
|
12
|
+
export interface StripoErrorDuplication {
|
|
13
|
+
errorType: string;
|
|
14
|
+
errorMessage: string;
|
|
15
|
+
errorCategory: string;
|
|
16
|
+
context: {
|
|
17
|
+
emailId?: string;
|
|
18
|
+
userId?: string;
|
|
19
|
+
environment?: string;
|
|
20
|
+
timestamp: string;
|
|
21
|
+
[key: string]: unknown;
|
|
22
|
+
};
|
|
23
|
+
reportedAt: string;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Service for deduplicating Stripo error alerts locally in Guido
|
|
27
|
+
* Prevents duplicate Slack notifications for the same error within a session
|
|
28
|
+
*
|
|
29
|
+
* Errors are handled entirely on the FE:
|
|
30
|
+
* - Slack notification alerts Guido team immediately (first occurrence)
|
|
31
|
+
* - Duplicate alerts suppressed within same session
|
|
32
|
+
* - Sentry/FullStory logs for analysis
|
|
33
|
+
* - No backend endpoint required
|
|
34
|
+
* - No propagation to consuming teams
|
|
35
|
+
*/
|
|
36
|
+
export declare class StripoErrorDeduplicationService {
|
|
37
|
+
private reportedErrors;
|
|
38
|
+
constructor();
|
|
39
|
+
/**
|
|
40
|
+
* Track an error locally to prevent duplicate Slack alerts
|
|
41
|
+
* Only sends Slack alert once per unique error within the same session
|
|
42
|
+
*/
|
|
43
|
+
trackError(errorData: StripoErrorDuplication): boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Track plugin load error locally (CORS, script failure, timeout)
|
|
46
|
+
*/
|
|
47
|
+
trackPluginLoadError(errorMessage: string, context?: Record<string, unknown>): boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Track CORS error locally
|
|
50
|
+
*/
|
|
51
|
+
trackCorsError(errorMessage: string, context?: Record<string, unknown>): boolean;
|
|
52
|
+
/**
|
|
53
|
+
* Track authentication error locally (token refresh failure)
|
|
54
|
+
* Tracks it, but Slack notifier decides whether to alert based on token expiration
|
|
55
|
+
*/
|
|
56
|
+
trackAuthenticationError(errorMessage: string, context?: Record<string, unknown>): boolean;
|
|
57
|
+
/**
|
|
58
|
+
* Generate unique deduplication key for error
|
|
59
|
+
* Format: "errorType:emailId:userId" to allow same error on different emails
|
|
60
|
+
*/
|
|
61
|
+
private getDeduplicationKey;
|
|
62
|
+
/**
|
|
63
|
+
* Clear tracked errors (for testing or session reset)
|
|
64
|
+
*/
|
|
65
|
+
clearTrackedErrors(): void;
|
|
66
|
+
/**
|
|
67
|
+
* Get count of errors tracked in this session
|
|
68
|
+
*/
|
|
69
|
+
getTrackedErrorCount(): number;
|
|
70
|
+
}
|
|
71
|
+
export declare const getStripoErrorDeduplicationService: () => StripoErrorDeduplicationService;
|
|
72
|
+
/**
|
|
73
|
+
* Reset tracked errors (useful for testing or session reset)
|
|
74
|
+
*/
|
|
75
|
+
export declare const resetStripoErrorDeduplicationService: () => void;
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
var c = Object.defineProperty;
|
|
2
|
+
var a = (e, r, t) => r in e ? c(e, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[r] = t;
|
|
3
|
+
var n = (e, r, t) => a(e, typeof r != "symbol" ? r + "" : r, t);
|
|
4
|
+
class s {
|
|
5
|
+
constructor() {
|
|
6
|
+
n(this, "reportedErrors", /* @__PURE__ */ new Set());
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Track an error locally to prevent duplicate Slack alerts
|
|
10
|
+
* Only sends Slack alert once per unique error within the same session
|
|
11
|
+
*/
|
|
12
|
+
trackError(r) {
|
|
13
|
+
const t = this.getDeduplicationKey(r);
|
|
14
|
+
return this.reportedErrors.has(t) ? !1 : (this.reportedErrors.add(t), !0);
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Track plugin load error locally (CORS, script failure, timeout)
|
|
18
|
+
*/
|
|
19
|
+
trackPluginLoadError(r, t) {
|
|
20
|
+
return this.trackError({
|
|
21
|
+
errorType: "plugin_load_error",
|
|
22
|
+
errorMessage: r,
|
|
23
|
+
errorCategory: "critical",
|
|
24
|
+
context: {
|
|
25
|
+
...t,
|
|
26
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
27
|
+
environment: "production"
|
|
28
|
+
},
|
|
29
|
+
reportedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Track CORS error locally
|
|
34
|
+
*/
|
|
35
|
+
trackCorsError(r, t) {
|
|
36
|
+
return this.trackError({
|
|
37
|
+
errorType: "cors_error",
|
|
38
|
+
errorMessage: r,
|
|
39
|
+
errorCategory: "handled",
|
|
40
|
+
context: {
|
|
41
|
+
...t,
|
|
42
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
43
|
+
environment: "production"
|
|
44
|
+
},
|
|
45
|
+
reportedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Track authentication error locally (token refresh failure)
|
|
50
|
+
* Tracks it, but Slack notifier decides whether to alert based on token expiration
|
|
51
|
+
*/
|
|
52
|
+
trackAuthenticationError(r, t) {
|
|
53
|
+
return this.trackError({
|
|
54
|
+
errorType: "authentication_error",
|
|
55
|
+
errorMessage: r,
|
|
56
|
+
errorCategory: "critical",
|
|
57
|
+
context: {
|
|
58
|
+
...t,
|
|
59
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
60
|
+
environment: "production"
|
|
61
|
+
},
|
|
62
|
+
reportedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Generate unique deduplication key for error
|
|
67
|
+
* Format: "errorType:emailId:userId" to allow same error on different emails
|
|
68
|
+
*/
|
|
69
|
+
getDeduplicationKey(r) {
|
|
70
|
+
const t = r.context.emailId || "unknown", i = r.context.userId || "unknown";
|
|
71
|
+
return `${r.errorType}:${t}:${i}`;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Clear tracked errors (for testing or session reset)
|
|
75
|
+
*/
|
|
76
|
+
clearTrackedErrors() {
|
|
77
|
+
this.reportedErrors.clear();
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Get count of errors tracked in this session
|
|
81
|
+
*/
|
|
82
|
+
getTrackedErrorCount() {
|
|
83
|
+
return this.reportedErrors.size;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
let o = null;
|
|
87
|
+
const u = () => (o || (o = new s()), o);
|
|
88
|
+
export {
|
|
89
|
+
s as StripoErrorDeduplicationService,
|
|
90
|
+
u as getStripoErrorDeduplicationService
|
|
91
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { useHttp as t } from "../composables/useHttp.js";
|
|
2
|
+
import { useToaster as n } from "../composables/useToaster.js";
|
|
3
|
+
const u = () => {
|
|
4
|
+
const { get: r } = t(), { handleError: s } = n();
|
|
5
|
+
return { getUnsubscribePages: async () => {
|
|
6
|
+
try {
|
|
7
|
+
const { data: e = [] } = await r("/unsubscribe-pages/get-all");
|
|
8
|
+
return e;
|
|
9
|
+
} catch (e) {
|
|
10
|
+
return s(e, "Failed to fetch unsubscribe pages"), [];
|
|
11
|
+
}
|
|
12
|
+
} };
|
|
13
|
+
};
|
|
14
|
+
export {
|
|
15
|
+
u as useUnsubscribeApi
|
|
16
|
+
};
|
|
@@ -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
|
+
};
|
package/dist/stores/editor.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"editor", {
|
|
|
7
7
|
editorVisualMode: string;
|
|
8
8
|
hasChanges: boolean;
|
|
9
9
|
isStripoInitialized: boolean;
|
|
10
|
+
templateId: string;
|
|
10
11
|
}, {
|
|
11
12
|
isUndoButtonDisabled: (state: {
|
|
12
13
|
loadingStatus: boolean;
|
|
@@ -17,6 +18,7 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"editor", {
|
|
|
17
18
|
editorVisualMode: string;
|
|
18
19
|
hasChanges: boolean;
|
|
19
20
|
isStripoInitialized: boolean;
|
|
21
|
+
templateId: string;
|
|
20
22
|
} & import("pinia").PiniaCustomStateProperties<{
|
|
21
23
|
loadingStatus: boolean;
|
|
22
24
|
isCodeEditorOpen: boolean;
|
|
@@ -26,6 +28,7 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"editor", {
|
|
|
26
28
|
editorVisualMode: string;
|
|
27
29
|
hasChanges: boolean;
|
|
28
30
|
isStripoInitialized: boolean;
|
|
31
|
+
templateId: string;
|
|
29
32
|
}>) => boolean;
|
|
30
33
|
isRedoButtonDisabled: (state: {
|
|
31
34
|
loadingStatus: boolean;
|
|
@@ -36,6 +39,7 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"editor", {
|
|
|
36
39
|
editorVisualMode: string;
|
|
37
40
|
hasChanges: boolean;
|
|
38
41
|
isStripoInitialized: boolean;
|
|
42
|
+
templateId: string;
|
|
39
43
|
} & import("pinia").PiniaCustomStateProperties<{
|
|
40
44
|
loadingStatus: boolean;
|
|
41
45
|
isCodeEditorOpen: boolean;
|
|
@@ -45,6 +49,7 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"editor", {
|
|
|
45
49
|
editorVisualMode: string;
|
|
46
50
|
hasChanges: boolean;
|
|
47
51
|
isStripoInitialized: boolean;
|
|
52
|
+
templateId: string;
|
|
48
53
|
}>) => boolean;
|
|
49
54
|
isCodeEditorButtonDisabled: (state: {
|
|
50
55
|
loadingStatus: boolean;
|
|
@@ -55,6 +60,7 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"editor", {
|
|
|
55
60
|
editorVisualMode: string;
|
|
56
61
|
hasChanges: boolean;
|
|
57
62
|
isStripoInitialized: boolean;
|
|
63
|
+
templateId: string;
|
|
58
64
|
} & import("pinia").PiniaCustomStateProperties<{
|
|
59
65
|
loadingStatus: boolean;
|
|
60
66
|
isCodeEditorOpen: boolean;
|
|
@@ -64,6 +70,7 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"editor", {
|
|
|
64
70
|
editorVisualMode: string;
|
|
65
71
|
hasChanges: boolean;
|
|
66
72
|
isStripoInitialized: boolean;
|
|
73
|
+
templateId: string;
|
|
67
74
|
}>) => boolean;
|
|
68
75
|
isPreviewButtonDisabled: (state: {
|
|
69
76
|
loadingStatus: boolean;
|
|
@@ -74,6 +81,7 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"editor", {
|
|
|
74
81
|
editorVisualMode: string;
|
|
75
82
|
hasChanges: boolean;
|
|
76
83
|
isStripoInitialized: boolean;
|
|
84
|
+
templateId: string;
|
|
77
85
|
} & import("pinia").PiniaCustomStateProperties<{
|
|
78
86
|
loadingStatus: boolean;
|
|
79
87
|
isCodeEditorOpen: boolean;
|
|
@@ -83,6 +91,7 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"editor", {
|
|
|
83
91
|
editorVisualMode: string;
|
|
84
92
|
hasChanges: boolean;
|
|
85
93
|
isStripoInitialized: boolean;
|
|
94
|
+
templateId: string;
|
|
86
95
|
}>) => boolean;
|
|
87
96
|
isViewOptionsDisabled: (state: {
|
|
88
97
|
loadingStatus: boolean;
|
|
@@ -93,6 +102,7 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"editor", {
|
|
|
93
102
|
editorVisualMode: string;
|
|
94
103
|
hasChanges: boolean;
|
|
95
104
|
isStripoInitialized: boolean;
|
|
105
|
+
templateId: string;
|
|
96
106
|
} & import("pinia").PiniaCustomStateProperties<{
|
|
97
107
|
loadingStatus: boolean;
|
|
98
108
|
isCodeEditorOpen: boolean;
|
|
@@ -102,6 +112,7 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"editor", {
|
|
|
102
112
|
editorVisualMode: string;
|
|
103
113
|
hasChanges: boolean;
|
|
104
114
|
isStripoInitialized: boolean;
|
|
115
|
+
templateId: string;
|
|
105
116
|
}>) => boolean;
|
|
106
117
|
isVersionHistoryButtonDisabled: (state: {
|
|
107
118
|
loadingStatus: boolean;
|
|
@@ -112,6 +123,7 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"editor", {
|
|
|
112
123
|
editorVisualMode: string;
|
|
113
124
|
hasChanges: boolean;
|
|
114
125
|
isStripoInitialized: boolean;
|
|
126
|
+
templateId: string;
|
|
115
127
|
} & import("pinia").PiniaCustomStateProperties<{
|
|
116
128
|
loadingStatus: boolean;
|
|
117
129
|
isCodeEditorOpen: boolean;
|
|
@@ -121,6 +133,7 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"editor", {
|
|
|
121
133
|
editorVisualMode: string;
|
|
122
134
|
hasChanges: boolean;
|
|
123
135
|
isStripoInitialized: boolean;
|
|
136
|
+
templateId: string;
|
|
124
137
|
}>) => boolean;
|
|
125
138
|
isExportButtonDisabled: (state: {
|
|
126
139
|
loadingStatus: boolean;
|
|
@@ -131,6 +144,7 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"editor", {
|
|
|
131
144
|
editorVisualMode: string;
|
|
132
145
|
hasChanges: boolean;
|
|
133
146
|
isStripoInitialized: boolean;
|
|
147
|
+
templateId: string;
|
|
134
148
|
} & import("pinia").PiniaCustomStateProperties<{
|
|
135
149
|
loadingStatus: boolean;
|
|
136
150
|
isCodeEditorOpen: boolean;
|
|
@@ -140,6 +154,7 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"editor", {
|
|
|
140
154
|
editorVisualMode: string;
|
|
141
155
|
hasChanges: boolean;
|
|
142
156
|
isStripoInitialized: boolean;
|
|
157
|
+
templateId: string;
|
|
143
158
|
}>) => boolean;
|
|
144
159
|
isSaveAsButtonDisabled: (state: {
|
|
145
160
|
loadingStatus: boolean;
|
|
@@ -150,6 +165,7 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"editor", {
|
|
|
150
165
|
editorVisualMode: string;
|
|
151
166
|
hasChanges: boolean;
|
|
152
167
|
isStripoInitialized: boolean;
|
|
168
|
+
templateId: string;
|
|
153
169
|
} & import("pinia").PiniaCustomStateProperties<{
|
|
154
170
|
loadingStatus: boolean;
|
|
155
171
|
isCodeEditorOpen: boolean;
|
|
@@ -159,6 +175,7 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"editor", {
|
|
|
159
175
|
editorVisualMode: string;
|
|
160
176
|
hasChanges: boolean;
|
|
161
177
|
isStripoInitialized: boolean;
|
|
178
|
+
templateId: string;
|
|
162
179
|
}>) => boolean;
|
|
163
180
|
isTestButtonDisabled: (state: {
|
|
164
181
|
loadingStatus: boolean;
|
|
@@ -169,6 +186,7 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"editor", {
|
|
|
169
186
|
editorVisualMode: string;
|
|
170
187
|
hasChanges: boolean;
|
|
171
188
|
isStripoInitialized: boolean;
|
|
189
|
+
templateId: string;
|
|
172
190
|
} & import("pinia").PiniaCustomStateProperties<{
|
|
173
191
|
loadingStatus: boolean;
|
|
174
192
|
isCodeEditorOpen: boolean;
|
|
@@ -178,6 +196,7 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"editor", {
|
|
|
178
196
|
editorVisualMode: string;
|
|
179
197
|
hasChanges: boolean;
|
|
180
198
|
isStripoInitialized: boolean;
|
|
199
|
+
templateId: string;
|
|
181
200
|
}>) => boolean;
|
|
182
201
|
isSaveButtonDisabled: (state: {
|
|
183
202
|
loadingStatus: boolean;
|
|
@@ -188,6 +207,7 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"editor", {
|
|
|
188
207
|
editorVisualMode: string;
|
|
189
208
|
hasChanges: boolean;
|
|
190
209
|
isStripoInitialized: boolean;
|
|
210
|
+
templateId: string;
|
|
191
211
|
} & import("pinia").PiniaCustomStateProperties<{
|
|
192
212
|
loadingStatus: boolean;
|
|
193
213
|
isCodeEditorOpen: boolean;
|
|
@@ -197,5 +217,6 @@ export declare const useEditorStore: import("pinia").StoreDefinition<"editor", {
|
|
|
197
217
|
editorVisualMode: string;
|
|
198
218
|
hasChanges: boolean;
|
|
199
219
|
isStripoInitialized: boolean;
|
|
220
|
+
templateId: string;
|
|
200
221
|
}>) => boolean;
|
|
201
222
|
}, {}>;
|