@useinsider/guido 2.0.0-beta.a3f32aa → 2.0.0-beta.fb6f753
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/config/schemas.js +29 -43
- package/dist/components/organisms/header/RightSlot.vue2.js +10 -10
- package/dist/composables/useConfig.js +27 -29
- package/dist/composables/useSave.js +11 -13
- package/dist/extensions/Blocks/Unsubscribe/extension.js +9 -9
- package/dist/src/@types/config/index.d.ts +2 -2
- package/dist/src/@types/config/schemas.d.ts +0 -26
- package/dist/src/@types/config/types.d.ts +1 -7
- package/dist/src/composables/useConfig.d.ts +0 -6
- package/dist/src/stores/config.d.ts +1 -145
- package/dist/stores/config.js +0 -7
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { object as o, number as
|
|
2
|
-
const
|
|
1
|
+
import { object as o, number as p, optional as e, string as t, pipe as m, picklist as n, boolean as c, array as a, minLength as u, literal as r, custom as d, variant as S } from "../../node_modules/valibot/dist/index.js";
|
|
2
|
+
const i = {
|
|
3
3
|
/** Promotional/marketing emails */
|
|
4
4
|
PROMOTIONAL: 1,
|
|
5
5
|
/** Transactional/system emails */
|
|
@@ -13,22 +13,22 @@ const m = {
|
|
|
13
13
|
UNSUBSCRIBE_PAGES: 97
|
|
14
14
|
}, h = o({
|
|
15
15
|
/** Unique identifier for the template being edited */
|
|
16
|
-
templateId:
|
|
16
|
+
templateId: m(
|
|
17
17
|
t(),
|
|
18
|
-
|
|
18
|
+
u(1, "templateId is required")
|
|
19
19
|
),
|
|
20
20
|
/** Unique identifier for the user editing the template */
|
|
21
|
-
userId:
|
|
21
|
+
userId: m(
|
|
22
22
|
t(),
|
|
23
|
-
|
|
23
|
+
u(1, "userId is required")
|
|
24
24
|
),
|
|
25
25
|
/** Optional variation ID for A/B testing */
|
|
26
26
|
variationId: e(t())
|
|
27
27
|
}), k = o({
|
|
28
28
|
/** Partner/organization name (required) */
|
|
29
|
-
name:
|
|
29
|
+
name: m(
|
|
30
30
|
t(),
|
|
31
|
-
|
|
31
|
+
u(1, "partner.name is required")
|
|
32
32
|
),
|
|
33
33
|
/** Product type identifier */
|
|
34
34
|
productType: e(
|
|
@@ -41,8 +41,8 @@ const m = {
|
|
|
41
41
|
),
|
|
42
42
|
/** Message type (promotional or transactional) */
|
|
43
43
|
messageType: e(
|
|
44
|
-
n([
|
|
45
|
-
|
|
44
|
+
n([i.PROMOTIONAL, i.TRANSACTIONAL]),
|
|
45
|
+
i.PROMOTIONAL
|
|
46
46
|
),
|
|
47
47
|
/** Display name for the current user */
|
|
48
48
|
username: e(t(), "Guido User")
|
|
@@ -60,7 +60,7 @@ const m = {
|
|
|
60
60
|
value: t()
|
|
61
61
|
})
|
|
62
62
|
)
|
|
63
|
-
}),
|
|
63
|
+
}), R = o({
|
|
64
64
|
/** Initial HTML content */
|
|
65
65
|
html: e(t(), ""),
|
|
66
66
|
/** Initial CSS content */
|
|
@@ -71,8 +71,8 @@ const m = {
|
|
|
71
71
|
[]
|
|
72
72
|
),
|
|
73
73
|
/** Selected unsubscribe page IDs */
|
|
74
|
-
selectedUnsubscribePages: e(a(
|
|
75
|
-
}),
|
|
74
|
+
selectedUnsubscribePages: e(a(p()), [])
|
|
75
|
+
}), C = o({
|
|
76
76
|
/** Sender display name */
|
|
77
77
|
senderName: e(t(), ""),
|
|
78
78
|
/** Email subject line */
|
|
@@ -83,9 +83,9 @@ const m = {
|
|
|
83
83
|
/** Path to translations object */
|
|
84
84
|
translationsPath: e(t(), "window.trans.en"),
|
|
85
85
|
/** Migration date for template compatibility */
|
|
86
|
-
migrationDate: e(
|
|
86
|
+
migrationDate: e(p(), 1759696858),
|
|
87
87
|
/** Email header settings */
|
|
88
|
-
emailHeader: e(
|
|
88
|
+
emailHeader: e(C, { senderName: "", subject: "" })
|
|
89
89
|
}), T = o({
|
|
90
90
|
/** Whether to show the header bar */
|
|
91
91
|
showHeader: e(c(), !0),
|
|
@@ -143,7 +143,7 @@ const m = {
|
|
|
143
143
|
/** Human-readable description */
|
|
144
144
|
description: e(t()),
|
|
145
145
|
/** Priority for rule ordering (lower = earlier) */
|
|
146
|
-
priority:
|
|
146
|
+
priority: p()
|
|
147
147
|
}), N = o({
|
|
148
148
|
...l.entries,
|
|
149
149
|
type: r("replace"),
|
|
@@ -172,31 +172,20 @@ const m = {
|
|
|
172
172
|
type: r("custom"),
|
|
173
173
|
/** Custom processor function */
|
|
174
174
|
processor: d(
|
|
175
|
-
(
|
|
175
|
+
(b) => typeof b == "function",
|
|
176
176
|
"processor must be a function"
|
|
177
177
|
)
|
|
178
|
-
}),
|
|
178
|
+
}), B = S("type", [
|
|
179
179
|
N,
|
|
180
180
|
O,
|
|
181
181
|
L,
|
|
182
182
|
v
|
|
183
|
-
]),
|
|
183
|
+
]), P = o({
|
|
184
184
|
/** Custom compiler rules to apply */
|
|
185
|
-
customRules: e(a(
|
|
185
|
+
customRules: e(a(B), []),
|
|
186
186
|
/** Skip default compiler rules */
|
|
187
187
|
ignoreDefaultRules: e(c(), !1)
|
|
188
|
-
}),
|
|
189
|
-
/**
|
|
190
|
-
* External validation handler called before save completes.
|
|
191
|
-
* Return false to cancel the save operation.
|
|
192
|
-
*/
|
|
193
|
-
externalValidation: e(
|
|
194
|
-
d(
|
|
195
|
-
(i) => typeof i == "function",
|
|
196
|
-
"externalValidation must be a function"
|
|
197
|
-
)
|
|
198
|
-
)
|
|
199
|
-
}), U = o({
|
|
188
|
+
}), x = o({
|
|
200
189
|
// Required sections
|
|
201
190
|
/** Identity configuration (required) */
|
|
202
191
|
identity: h,
|
|
@@ -204,7 +193,7 @@ const m = {
|
|
|
204
193
|
partner: k,
|
|
205
194
|
// Optional sections (with defaults)
|
|
206
195
|
/** Template content and presets */
|
|
207
|
-
template: e(
|
|
196
|
+
template: e(R, {}),
|
|
208
197
|
/** Editor settings */
|
|
209
198
|
editor: e(I, {}),
|
|
210
199
|
/** UI configuration */
|
|
@@ -214,30 +203,27 @@ const m = {
|
|
|
214
203
|
/** Block configuration */
|
|
215
204
|
blocks: e(E, {}),
|
|
216
205
|
/** Compiler configuration */
|
|
217
|
-
compiler: e(
|
|
218
|
-
/** Callbacks and event handlers */
|
|
219
|
-
callbacks: e(P, {})
|
|
206
|
+
compiler: e(P, {})
|
|
220
207
|
});
|
|
221
208
|
export {
|
|
222
209
|
E as BlocksSchema,
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
B as CompilerSchema,
|
|
210
|
+
B as CompilerRuleSchema,
|
|
211
|
+
P as CompilerSchema,
|
|
226
212
|
g as CustomBlockTypeSchema,
|
|
227
213
|
v as CustomRuleSchema,
|
|
228
214
|
f as DefaultBlockTypeSchema,
|
|
229
215
|
y as DynamicContentSchema,
|
|
230
216
|
I as EditorSchema,
|
|
231
|
-
|
|
217
|
+
C as EmailHeaderSchema,
|
|
232
218
|
A as FeaturesSchema,
|
|
233
|
-
|
|
219
|
+
x as GuidoConfigSchema,
|
|
234
220
|
h as IdentitySchema,
|
|
235
|
-
|
|
221
|
+
i as MessageType,
|
|
236
222
|
k as PartnerSchema,
|
|
237
223
|
s as ProductType,
|
|
238
224
|
O as RegexRuleSchema,
|
|
239
225
|
L as RemoveRuleSchema,
|
|
240
226
|
N as ReplaceRuleSchema,
|
|
241
|
-
|
|
227
|
+
R as TemplateSchema,
|
|
242
228
|
T as UISchema
|
|
243
229
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as H, ref as
|
|
1
|
+
import { defineComponent as H, ref as m, computed as _ } from "vue";
|
|
2
2
|
import { useConfig as h } from "../../../composables/useConfig.js";
|
|
3
3
|
import { useExport as V } from "../../../composables/useExport.js";
|
|
4
4
|
import { useTestEmailClick as x } from "../../../composables/useGuidoActions.js";
|
|
@@ -10,25 +10,25 @@ import { getTooltipOptions as O } from "../../../utils/tooltipUtils.js";
|
|
|
10
10
|
import { InButtonV2 as A } from "@useinsider/design-system-vue";
|
|
11
11
|
const J = /* @__PURE__ */ H({
|
|
12
12
|
__name: "RightSlot",
|
|
13
|
-
setup(k, { expose:
|
|
14
|
-
const { config:
|
|
13
|
+
setup(k, { expose: c }) {
|
|
14
|
+
const { config: u } = h(), { exportHtml: r } = V(), { save: n } = E(), { openVersionHistory: i, closeVersionHistory: a } = w(), o = C(), t = T(), e = m(!1), s = m(!1), f = x(), v = () => {
|
|
15
15
|
if (o.isVersionHistoryOpen) {
|
|
16
16
|
a();
|
|
17
17
|
return;
|
|
18
18
|
}
|
|
19
19
|
i();
|
|
20
|
-
},
|
|
20
|
+
}, d = async () => {
|
|
21
21
|
e.value = !0, await r(), e.value = !1;
|
|
22
|
-
},
|
|
22
|
+
}, y = () => {
|
|
23
23
|
o.isSaveAsTemplateDrawerOpen = !0;
|
|
24
|
-
},
|
|
24
|
+
}, S = _(() => o.isVersionHistoryOpen ? t("newsletter.close-version-history") : t("newsletter.version-history")), l = async (p) => {
|
|
25
25
|
s.value = !0, o.loadingStatus = !0;
|
|
26
|
-
const
|
|
27
|
-
return s.value = !1,
|
|
26
|
+
const g = await n(p);
|
|
27
|
+
return s.value = !1, p && (o.loadingStatus = !1), g;
|
|
28
28
|
};
|
|
29
|
-
return
|
|
29
|
+
return c({
|
|
30
30
|
handleSave: l
|
|
31
|
-
}), { __sfc: !0, config:
|
|
31
|
+
}), { __sfc: !0, config: u, exportHtml: r, save: n, openVersionHistory: i, closeVersionHistory: a, editorStore: o, trans: t, isExporting: e, isSaving: s, testEmailClick: f, handleVersionHistory: v, handleExport: d, handleSaveAs: y, versionHistoryTooltipText: S, handleSave: l, getTooltipOptions: O, InButtonV2: A };
|
|
32
32
|
}
|
|
33
33
|
});
|
|
34
34
|
export {
|
|
@@ -1,27 +1,26 @@
|
|
|
1
|
-
import { useConfigStore as
|
|
2
|
-
import { storeToRefs as
|
|
3
|
-
const
|
|
4
|
-
const e =
|
|
1
|
+
import { useConfigStore as F } from "../stores/config.js";
|
|
2
|
+
import { storeToRefs as I } from "pinia";
|
|
3
|
+
const k = () => {
|
|
4
|
+
const e = F(), {
|
|
5
5
|
config: t,
|
|
6
6
|
initialized: o,
|
|
7
7
|
identity: r,
|
|
8
8
|
partner: i,
|
|
9
|
-
template:
|
|
10
|
-
editor:
|
|
9
|
+
template: n,
|
|
10
|
+
editor: a,
|
|
11
11
|
ui: s,
|
|
12
|
-
features:
|
|
13
|
-
blocks:
|
|
14
|
-
compiler:
|
|
15
|
-
|
|
16
|
-
templateId: p,
|
|
12
|
+
features: u,
|
|
13
|
+
blocks: d,
|
|
14
|
+
compiler: p,
|
|
15
|
+
templateId: c,
|
|
17
16
|
userId: f,
|
|
18
17
|
variationId: m,
|
|
19
18
|
partnerName: g,
|
|
20
|
-
productType:
|
|
21
|
-
messageType:
|
|
22
|
-
username:
|
|
23
|
-
showHeader:
|
|
24
|
-
} =
|
|
19
|
+
productType: l,
|
|
20
|
+
messageType: b,
|
|
21
|
+
username: C,
|
|
22
|
+
showHeader: y
|
|
23
|
+
} = I(e);
|
|
25
24
|
return {
|
|
26
25
|
// State refs
|
|
27
26
|
config: t,
|
|
@@ -29,27 +28,26 @@ const w = () => {
|
|
|
29
28
|
// Section refs
|
|
30
29
|
identity: r,
|
|
31
30
|
partner: i,
|
|
32
|
-
template:
|
|
33
|
-
editor:
|
|
31
|
+
template: n,
|
|
32
|
+
editor: a,
|
|
34
33
|
ui: s,
|
|
35
|
-
features:
|
|
36
|
-
blocks:
|
|
37
|
-
compiler:
|
|
38
|
-
callbacks: l,
|
|
34
|
+
features: u,
|
|
35
|
+
blocks: d,
|
|
36
|
+
compiler: p,
|
|
39
37
|
// Convenience refs
|
|
40
|
-
templateId:
|
|
38
|
+
templateId: c,
|
|
41
39
|
userId: f,
|
|
42
40
|
variationId: m,
|
|
43
41
|
partnerName: g,
|
|
44
|
-
productType:
|
|
45
|
-
messageType:
|
|
46
|
-
username:
|
|
47
|
-
showHeader:
|
|
42
|
+
productType: l,
|
|
43
|
+
messageType: b,
|
|
44
|
+
username: C,
|
|
45
|
+
showHeader: y,
|
|
48
46
|
// Methods
|
|
49
47
|
getConfig: () => t.value,
|
|
50
|
-
isFeatureEnabled: (
|
|
48
|
+
isFeatureEnabled: (E) => e.isFeatureEnabled(E)
|
|
51
49
|
};
|
|
52
50
|
};
|
|
53
51
|
export {
|
|
54
|
-
|
|
52
|
+
k as useConfig
|
|
55
53
|
};
|
|
@@ -1,17 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
if (await o(t.compiledHtml, t.dynamicContentList, !0) && !((e = a.value) != null && e.externalValidation && !await a.value.externalValidation(t)))
|
|
12
|
-
return r || s(t), t;
|
|
1
|
+
import { useSaveStart as i, useSaveComplete as m } from "./useGuidoActions.js";
|
|
2
|
+
import { useTemplatePreparation as n } from "../utils/templatePreparation.js";
|
|
3
|
+
import { useHtmlValidator as l } from "./useHtmlValidator.js";
|
|
4
|
+
const f = () => {
|
|
5
|
+
const e = i(), a = m(), { validateHtml: s } = l();
|
|
6
|
+
return { save: async (o = !1) => {
|
|
7
|
+
e();
|
|
8
|
+
const { prepareTemplateDetails: r } = n(), t = await r();
|
|
9
|
+
if (await s(t.compiledHtml, t.dynamicContentList, !0))
|
|
10
|
+
return o || a(t), t;
|
|
13
11
|
} };
|
|
14
12
|
};
|
|
15
13
|
export {
|
|
16
|
-
|
|
14
|
+
f as useSave
|
|
17
15
|
};
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { ExtensionBuilder as e } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
2
|
import { UnsubscribeBlock as i } from "./block.js";
|
|
3
3
|
import { UnsubscribeControl as t } from "./control.js";
|
|
4
|
-
import { PreviewUIElement as
|
|
5
|
-
import { UnsubscribeIconsRegistry as
|
|
6
|
-
import { SettingsPanel as
|
|
4
|
+
import { PreviewUIElement as o } from "./elements/preview.js";
|
|
5
|
+
import { UnsubscribeIconsRegistry as r } from "./iconsRegistry.js";
|
|
6
|
+
import { SettingsPanel as s } from "./settingsPanel.js";
|
|
7
7
|
import n from "./styles.css.js";
|
|
8
|
-
import { UnsubscribeTagRegistry as
|
|
9
|
-
const
|
|
8
|
+
import { UnsubscribeTagRegistry as l } from "./tagRegistry.js";
|
|
9
|
+
const f = new e().addBlock(i).withSettingsPanelRegistry(s).addControl(t).addUiElement(o).addStyles(n).withLocalization({
|
|
10
10
|
en: {
|
|
11
|
-
"Unsubscribe Block": "Unsubscribe",
|
|
12
|
-
"Unsubscribe Block Description": "
|
|
11
|
+
"Unsubscribe Block": "Unsubscribe Block",
|
|
12
|
+
"Unsubscribe Block Description": "Add an unsubscribe link to your email",
|
|
13
13
|
"Select Template": "Select Template",
|
|
14
14
|
"Unsubscribe Template": "Unsubscribe Template",
|
|
15
15
|
Showing: "Showing",
|
|
16
16
|
of: "of"
|
|
17
17
|
}
|
|
18
|
-
}).withUiElementTagRegistry(
|
|
18
|
+
}).withUiElementTagRegistry(l).withIconsRegistry(r).build();
|
|
19
19
|
export {
|
|
20
|
-
|
|
20
|
+
f as default
|
|
21
21
|
};
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
* - Default values for optional configuration
|
|
8
8
|
* - Validation utilities
|
|
9
9
|
*/
|
|
10
|
-
export { MessageType, ProductType, GuidoConfigSchema, IdentitySchema, PartnerSchema, TemplateSchema, EditorSchema, UISchema, FeaturesSchema, BlocksSchema, CompilerSchema,
|
|
11
|
-
export type { GuidoConfig, GuidoConfigInput, IdentityConfig, IdentityConfigInput, PartnerConfig, PartnerConfigInput, TemplateConfig, TemplateConfigInput, EditorConfig, EditorConfigInput, UIConfig, UIConfigInput, FeaturesConfig, FeaturesConfigInput, BlocksConfig, BlocksConfigInput, CompilerConfig, CompilerConfigInput,
|
|
10
|
+
export { MessageType, ProductType, GuidoConfigSchema, IdentitySchema, PartnerSchema, TemplateSchema, EditorSchema, UISchema, FeaturesSchema, BlocksSchema, CompilerSchema, DynamicContentSchema, EmailHeaderSchema, DefaultBlockTypeSchema, CustomBlockTypeSchema, CompilerRuleSchema, CompilerRuleTypeSchema, ReplaceRuleSchema, RegexRuleSchema, RemoveRuleSchema, CustomRuleSchema, } from './schemas';
|
|
11
|
+
export type { GuidoConfig, GuidoConfigInput, IdentityConfig, IdentityConfigInput, PartnerConfig, PartnerConfigInput, TemplateConfig, TemplateConfigInput, EditorConfig, EditorConfigInput, UIConfig, UIConfigInput, FeaturesConfig, FeaturesConfigInput, BlocksConfig, BlocksConfigInput, CompilerConfig, CompilerConfigInput, EmailHeader, DynamicContent, DefaultBlockType, CustomBlockType, BlockType, FeatureName, CompilerRule, ReplaceRule, RegexRule, RemoveRule, CustomRule, DeepPartial, ConfigOverrides, } from './types';
|
|
12
12
|
export { DEFAULT_EMAIL_HEADER, DEFAULT_TEMPLATE, DEFAULT_EDITOR, DEFAULT_UI, DEFAULT_FEATURES, DEFAULT_BLOCKS, DEFAULT_COMPILER, DEFAULT_PRODUCT_TYPE, DEFAULT_MESSAGE_TYPE, DEFAULT_USERNAME, EDITOR_TYPE, TEST_PARTNERS, isTestPartner, } from './defaults';
|
|
13
13
|
export { validateConfig, parseConfig, parseConfigSafe, getValidationErrors, isValidConfig, validateIdentity, validatePartner, } from './validator';
|
|
14
14
|
export type { ValidationResult, ValidationError, } from './validator';
|
|
@@ -5,14 +5,7 @@
|
|
|
5
5
|
* All types are inferred from these schemas to ensure single source of truth.
|
|
6
6
|
* @module @types/config/schemas
|
|
7
7
|
*/
|
|
8
|
-
import type { SavedTemplateDetails } from '../stripo';
|
|
9
8
|
import * as v from 'valibot';
|
|
10
|
-
/**
|
|
11
|
-
* Handler function for external validation before save
|
|
12
|
-
* @param data - The template details to validate
|
|
13
|
-
* @returns Promise<boolean> - true if valid, false to cancel save
|
|
14
|
-
*/
|
|
15
|
-
export type ExternalValidationHandler = (data: SavedTemplateDetails) => Promise<boolean>;
|
|
16
9
|
/**
|
|
17
10
|
* Message type constants for email templates
|
|
18
11
|
*/
|
|
@@ -349,16 +342,6 @@ export declare const CompilerSchema: v.ObjectSchema<{
|
|
|
349
342
|
/** Skip default compiler rules */
|
|
350
343
|
readonly ignoreDefaultRules: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
351
344
|
}, undefined>;
|
|
352
|
-
/**
|
|
353
|
-
* Callbacks configuration - event handlers and hooks
|
|
354
|
-
*/
|
|
355
|
-
export declare const CallbacksSchema: v.ObjectSchema<{
|
|
356
|
-
/**
|
|
357
|
-
* External validation handler called before save completes.
|
|
358
|
-
* Return false to cancel the save operation.
|
|
359
|
-
*/
|
|
360
|
-
readonly externalValidation: v.OptionalSchema<v.CustomSchema<ExternalValidationHandler, v.ErrorMessage<v.CustomIssue> | undefined>, undefined>;
|
|
361
|
-
}, undefined>;
|
|
362
345
|
/**
|
|
363
346
|
* Complete Guido configuration schema
|
|
364
347
|
*
|
|
@@ -371,7 +354,6 @@ export declare const CallbacksSchema: v.ObjectSchema<{
|
|
|
371
354
|
* - features: Feature toggles
|
|
372
355
|
* - blocks: Block configuration
|
|
373
356
|
* - compiler: HTML compilation
|
|
374
|
-
* - callbacks: Event handlers and hooks
|
|
375
357
|
*/
|
|
376
358
|
export declare const GuidoConfigSchema: v.ObjectSchema<{
|
|
377
359
|
/** Identity configuration (required) */
|
|
@@ -520,12 +502,4 @@ export declare const GuidoConfigSchema: v.ObjectSchema<{
|
|
|
520
502
|
/** Skip default compiler rules */
|
|
521
503
|
readonly ignoreDefaultRules: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
522
504
|
}, undefined>, {}>;
|
|
523
|
-
/** Callbacks and event handlers */
|
|
524
|
-
readonly callbacks: v.OptionalSchema<v.ObjectSchema<{
|
|
525
|
-
/**
|
|
526
|
-
* External validation handler called before save completes.
|
|
527
|
-
* Return false to cancel the save operation.
|
|
528
|
-
*/
|
|
529
|
-
readonly externalValidation: v.OptionalSchema<v.CustomSchema<ExternalValidationHandler, v.ErrorMessage<v.CustomIssue> | undefined>, undefined>;
|
|
530
|
-
}, undefined>, {}>;
|
|
531
505
|
}, undefined>;
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* This ensures type definitions are always in sync with validation.
|
|
6
6
|
* @module @types/config/types
|
|
7
7
|
*/
|
|
8
|
-
import type { GuidoConfigSchema, IdentitySchema, PartnerSchema, TemplateSchema, EditorSchema, UISchema, FeaturesSchema, BlocksSchema, CompilerSchema,
|
|
8
|
+
import type { GuidoConfigSchema, IdentitySchema, PartnerSchema, TemplateSchema, EditorSchema, UISchema, FeaturesSchema, BlocksSchema, CompilerSchema, DynamicContentSchema, EmailHeaderSchema, CompilerRuleSchema, ReplaceRuleSchema, RegexRuleSchema, RemoveRuleSchema, CustomRuleSchema, DefaultBlockTypeSchema, CustomBlockTypeSchema } from './schemas';
|
|
9
9
|
import type * as v from 'valibot';
|
|
10
10
|
/**
|
|
11
11
|
* Complete validated Guido configuration.
|
|
@@ -41,10 +41,6 @@ export type FeaturesConfig = v.InferOutput<typeof FeaturesSchema>;
|
|
|
41
41
|
export type BlocksConfig = v.InferOutput<typeof BlocksSchema>;
|
|
42
42
|
/** Compiler configuration (custom rules, ignore defaults) */
|
|
43
43
|
export type CompilerConfig = v.InferOutput<typeof CompilerSchema>;
|
|
44
|
-
/** Callbacks configuration (event handlers and hooks) */
|
|
45
|
-
export type CallbacksConfig = v.InferOutput<typeof CallbacksSchema>;
|
|
46
|
-
/** Re-export ExternalValidationHandler for convenience */
|
|
47
|
-
export type { ExternalValidationHandler };
|
|
48
44
|
/** Email header configuration (senderName, subject) */
|
|
49
45
|
export type EmailHeader = v.InferOutput<typeof EmailHeaderSchema>;
|
|
50
46
|
/** Dynamic content item */
|
|
@@ -89,8 +85,6 @@ export type FeaturesConfigInput = v.InferInput<typeof FeaturesSchema>;
|
|
|
89
85
|
export type BlocksConfigInput = v.InferInput<typeof BlocksSchema>;
|
|
90
86
|
/** Input type for compiler configuration */
|
|
91
87
|
export type CompilerConfigInput = v.InferInput<typeof CompilerSchema>;
|
|
92
|
-
/** Input type for callbacks configuration */
|
|
93
|
-
export type CallbacksConfigInput = v.InferInput<typeof CallbacksSchema>;
|
|
94
88
|
/** Default Stripo block types */
|
|
95
89
|
export type DefaultBlockType = v.InferOutput<typeof DefaultBlockTypeSchema>;
|
|
96
90
|
/** Custom Guido block types */
|
|
@@ -89,9 +89,6 @@ export declare const useConfig: () => {
|
|
|
89
89
|
})[];
|
|
90
90
|
ignoreDefaultRules: boolean;
|
|
91
91
|
};
|
|
92
|
-
callbacks: {
|
|
93
|
-
externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
|
|
94
|
-
};
|
|
95
92
|
} | null>;
|
|
96
93
|
initialized: import("vue").Ref<boolean>;
|
|
97
94
|
identity: import("vue").ComputedRef<{
|
|
@@ -176,9 +173,6 @@ export declare const useConfig: () => {
|
|
|
176
173
|
})[];
|
|
177
174
|
ignoreDefaultRules: boolean;
|
|
178
175
|
} | null>;
|
|
179
|
-
callbacks: import("vue").ComputedRef<{
|
|
180
|
-
externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
|
|
181
|
-
} | null>;
|
|
182
176
|
templateId: import("vue").ComputedRef<string>;
|
|
183
177
|
userId: import("vue").ComputedRef<string>;
|
|
184
178
|
variationId: import("vue").ComputedRef<string>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { GuidoConfig, GuidoConfigInput, IdentityConfig, PartnerConfig, TemplateConfig, EditorConfig, UIConfig, FeaturesConfig, BlocksConfig, CompilerConfig
|
|
1
|
+
import type { GuidoConfig, GuidoConfigInput, IdentityConfig, PartnerConfig, TemplateConfig, EditorConfig, UIConfig, FeaturesConfig, BlocksConfig, CompilerConfig } from '@@/Types/config';
|
|
2
2
|
interface ConfigStoreState {
|
|
3
3
|
/** Whether the config has been initialized */
|
|
4
4
|
initialized: boolean;
|
|
@@ -94,9 +94,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
94
94
|
})[];
|
|
95
95
|
ignoreDefaultRules: boolean;
|
|
96
96
|
};
|
|
97
|
-
callbacks: {
|
|
98
|
-
externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
|
|
99
|
-
};
|
|
100
97
|
} | null;
|
|
101
98
|
} & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => IdentityConfig | null;
|
|
102
99
|
/**
|
|
@@ -187,9 +184,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
187
184
|
})[];
|
|
188
185
|
ignoreDefaultRules: boolean;
|
|
189
186
|
};
|
|
190
|
-
callbacks: {
|
|
191
|
-
externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
|
|
192
|
-
};
|
|
193
187
|
} | null;
|
|
194
188
|
} & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => PartnerConfig | null;
|
|
195
189
|
/**
|
|
@@ -280,9 +274,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
280
274
|
})[];
|
|
281
275
|
ignoreDefaultRules: boolean;
|
|
282
276
|
};
|
|
283
|
-
callbacks: {
|
|
284
|
-
externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
|
|
285
|
-
};
|
|
286
277
|
} | null;
|
|
287
278
|
} & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => TemplateConfig | null;
|
|
288
279
|
/**
|
|
@@ -373,9 +364,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
373
364
|
})[];
|
|
374
365
|
ignoreDefaultRules: boolean;
|
|
375
366
|
};
|
|
376
|
-
callbacks: {
|
|
377
|
-
externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
|
|
378
|
-
};
|
|
379
367
|
} | null;
|
|
380
368
|
} & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => EditorConfig | null;
|
|
381
369
|
/**
|
|
@@ -466,9 +454,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
466
454
|
})[];
|
|
467
455
|
ignoreDefaultRules: boolean;
|
|
468
456
|
};
|
|
469
|
-
callbacks: {
|
|
470
|
-
externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
|
|
471
|
-
};
|
|
472
457
|
} | null;
|
|
473
458
|
} & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => UIConfig | null;
|
|
474
459
|
/**
|
|
@@ -559,9 +544,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
559
544
|
})[];
|
|
560
545
|
ignoreDefaultRules: boolean;
|
|
561
546
|
};
|
|
562
|
-
callbacks: {
|
|
563
|
-
externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
|
|
564
|
-
};
|
|
565
547
|
} | null;
|
|
566
548
|
} & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => FeaturesConfig | null;
|
|
567
549
|
/**
|
|
@@ -652,9 +634,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
652
634
|
})[];
|
|
653
635
|
ignoreDefaultRules: boolean;
|
|
654
636
|
};
|
|
655
|
-
callbacks: {
|
|
656
|
-
externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
|
|
657
|
-
};
|
|
658
637
|
} | null;
|
|
659
638
|
} & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => BlocksConfig | null;
|
|
660
639
|
/**
|
|
@@ -745,104 +724,8 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
745
724
|
})[];
|
|
746
725
|
ignoreDefaultRules: boolean;
|
|
747
726
|
};
|
|
748
|
-
callbacks: {
|
|
749
|
-
externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
|
|
750
|
-
};
|
|
751
727
|
} | null;
|
|
752
728
|
} & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => CompilerConfig | null;
|
|
753
|
-
/**
|
|
754
|
-
* Get the callbacks configuration
|
|
755
|
-
*/
|
|
756
|
-
callbacks: (state: {
|
|
757
|
-
initialized: boolean;
|
|
758
|
-
config: {
|
|
759
|
-
identity: {
|
|
760
|
-
templateId: string;
|
|
761
|
-
userId: string;
|
|
762
|
-
variationId?: string | undefined;
|
|
763
|
-
};
|
|
764
|
-
partner: {
|
|
765
|
-
name: string;
|
|
766
|
-
productType: 60 | 49 | 97;
|
|
767
|
-
messageType: 1 | 2;
|
|
768
|
-
username: string;
|
|
769
|
-
};
|
|
770
|
-
template: {
|
|
771
|
-
html: string;
|
|
772
|
-
css: string;
|
|
773
|
-
preselectedDynamicContent: {
|
|
774
|
-
text: string;
|
|
775
|
-
value: string;
|
|
776
|
-
fallback?: string | undefined;
|
|
777
|
-
format?: {
|
|
778
|
-
key: string;
|
|
779
|
-
value: string;
|
|
780
|
-
} | undefined;
|
|
781
|
-
}[];
|
|
782
|
-
selectedUnsubscribePages: number[];
|
|
783
|
-
};
|
|
784
|
-
editor: {
|
|
785
|
-
locale: string;
|
|
786
|
-
translationsPath: string;
|
|
787
|
-
migrationDate: number;
|
|
788
|
-
emailHeader: {
|
|
789
|
-
senderName: string;
|
|
790
|
-
subject: string;
|
|
791
|
-
};
|
|
792
|
-
};
|
|
793
|
-
ui: {
|
|
794
|
-
showHeader: boolean;
|
|
795
|
-
backButtonLabel?: string | undefined;
|
|
796
|
-
};
|
|
797
|
-
features: {
|
|
798
|
-
dynamicContent: boolean;
|
|
799
|
-
saveAsTemplate: boolean;
|
|
800
|
-
versionHistory: boolean;
|
|
801
|
-
testMessage: boolean;
|
|
802
|
-
displayConditions: boolean;
|
|
803
|
-
unsubscribe: boolean;
|
|
804
|
-
};
|
|
805
|
-
blocks: {
|
|
806
|
-
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|
|
807
|
-
includeCustoms: ("dynamic-content" | "checkbox-block" | "radio-button-block" | "recommendation-block" | "unsubscribe-block" | "coupon-block" | "items-block")[];
|
|
808
|
-
};
|
|
809
|
-
compiler: {
|
|
810
|
-
customRules: ({
|
|
811
|
-
type: "replace";
|
|
812
|
-
search: string;
|
|
813
|
-
replacement: string;
|
|
814
|
-
replaceAll?: boolean | undefined;
|
|
815
|
-
id: string;
|
|
816
|
-
description?: string | undefined;
|
|
817
|
-
priority: number;
|
|
818
|
-
} | {
|
|
819
|
-
type: "regex";
|
|
820
|
-
pattern: string;
|
|
821
|
-
replacement: string;
|
|
822
|
-
flags?: string | undefined;
|
|
823
|
-
id: string;
|
|
824
|
-
description?: string | undefined;
|
|
825
|
-
priority: number;
|
|
826
|
-
} | {
|
|
827
|
-
type: "remove";
|
|
828
|
-
targets: string[];
|
|
829
|
-
id: string;
|
|
830
|
-
description?: string | undefined;
|
|
831
|
-
priority: number;
|
|
832
|
-
} | {
|
|
833
|
-
type: "custom";
|
|
834
|
-
processor: (html: string) => string;
|
|
835
|
-
id: string;
|
|
836
|
-
description?: string | undefined;
|
|
837
|
-
priority: number;
|
|
838
|
-
})[];
|
|
839
|
-
ignoreDefaultRules: boolean;
|
|
840
|
-
};
|
|
841
|
-
callbacks: {
|
|
842
|
-
externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
|
|
843
|
-
};
|
|
844
|
-
} | null;
|
|
845
|
-
} & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => CallbacksConfig | null;
|
|
846
729
|
/**
|
|
847
730
|
* Get the template ID
|
|
848
731
|
*/
|
|
@@ -931,9 +814,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
931
814
|
})[];
|
|
932
815
|
ignoreDefaultRules: boolean;
|
|
933
816
|
};
|
|
934
|
-
callbacks: {
|
|
935
|
-
externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
|
|
936
|
-
};
|
|
937
817
|
} | null;
|
|
938
818
|
} & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => string;
|
|
939
819
|
/**
|
|
@@ -1024,9 +904,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1024
904
|
})[];
|
|
1025
905
|
ignoreDefaultRules: boolean;
|
|
1026
906
|
};
|
|
1027
|
-
callbacks: {
|
|
1028
|
-
externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
|
|
1029
|
-
};
|
|
1030
907
|
} | null;
|
|
1031
908
|
} & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => string;
|
|
1032
909
|
/**
|
|
@@ -1117,9 +994,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1117
994
|
})[];
|
|
1118
995
|
ignoreDefaultRules: boolean;
|
|
1119
996
|
};
|
|
1120
|
-
callbacks: {
|
|
1121
|
-
externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
|
|
1122
|
-
};
|
|
1123
997
|
} | null;
|
|
1124
998
|
} & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => string;
|
|
1125
999
|
/**
|
|
@@ -1210,9 +1084,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1210
1084
|
})[];
|
|
1211
1085
|
ignoreDefaultRules: boolean;
|
|
1212
1086
|
};
|
|
1213
|
-
callbacks: {
|
|
1214
|
-
externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
|
|
1215
|
-
};
|
|
1216
1087
|
} | null;
|
|
1217
1088
|
} & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => string;
|
|
1218
1089
|
/**
|
|
@@ -1303,9 +1174,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1303
1174
|
})[];
|
|
1304
1175
|
ignoreDefaultRules: boolean;
|
|
1305
1176
|
};
|
|
1306
|
-
callbacks: {
|
|
1307
|
-
externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
|
|
1308
|
-
};
|
|
1309
1177
|
} | null;
|
|
1310
1178
|
} & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => number;
|
|
1311
1179
|
/**
|
|
@@ -1396,9 +1264,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1396
1264
|
})[];
|
|
1397
1265
|
ignoreDefaultRules: boolean;
|
|
1398
1266
|
};
|
|
1399
|
-
callbacks: {
|
|
1400
|
-
externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
|
|
1401
|
-
};
|
|
1402
1267
|
} | null;
|
|
1403
1268
|
} & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => number;
|
|
1404
1269
|
/**
|
|
@@ -1489,9 +1354,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1489
1354
|
})[];
|
|
1490
1355
|
ignoreDefaultRules: boolean;
|
|
1491
1356
|
};
|
|
1492
|
-
callbacks: {
|
|
1493
|
-
externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
|
|
1494
|
-
};
|
|
1495
1357
|
} | null;
|
|
1496
1358
|
} & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => string;
|
|
1497
1359
|
/**
|
|
@@ -1582,9 +1444,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1582
1444
|
})[];
|
|
1583
1445
|
ignoreDefaultRules: boolean;
|
|
1584
1446
|
};
|
|
1585
|
-
callbacks: {
|
|
1586
|
-
externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
|
|
1587
|
-
};
|
|
1588
1447
|
} | null;
|
|
1589
1448
|
} & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => boolean;
|
|
1590
1449
|
/**
|
|
@@ -1675,9 +1534,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
|
|
|
1675
1534
|
})[];
|
|
1676
1535
|
ignoreDefaultRules: boolean;
|
|
1677
1536
|
};
|
|
1678
|
-
callbacks: {
|
|
1679
|
-
externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
|
|
1680
|
-
};
|
|
1681
1537
|
} | null;
|
|
1682
1538
|
} & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => (feature: keyof FeaturesConfig) => boolean;
|
|
1683
1539
|
}, {
|
package/dist/stores/config.js
CHANGED
|
@@ -64,13 +64,6 @@ const s = o("guido-config", {
|
|
|
64
64
|
var e;
|
|
65
65
|
return ((e = i.config) == null ? void 0 : e.compiler) ?? null;
|
|
66
66
|
},
|
|
67
|
-
/**
|
|
68
|
-
* Get the callbacks configuration
|
|
69
|
-
*/
|
|
70
|
-
callbacks: (i) => {
|
|
71
|
-
var e;
|
|
72
|
-
return ((e = i.config) == null ? void 0 : e.callbacks) ?? null;
|
|
73
|
-
},
|
|
74
67
|
/**
|
|
75
68
|
* Get the template ID
|
|
76
69
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@useinsider/guido",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.fb6f753",
|
|
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",
|