@useinsider/guido 2.0.0-beta.81f9c55 → 2.0.0-beta.86a694f
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 +45 -33
- package/dist/components/Guido.vue.js +1 -1
- package/dist/components/Guido.vue2.js +57 -59
- package/dist/components/organisms/base/Toaster.vue.js +6 -6
- package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue.js +6 -6
- package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue2.js +2 -2
- package/dist/components/organisms/header/RightSlot.vue2.js +10 -10
- package/dist/composables/useConfig.js +29 -27
- package/dist/composables/useSave.js +13 -11
- package/dist/composables/useStripo.js +50 -51
- package/dist/extensions/Blocks/Unsubscribe/extension.js +9 -9
- package/dist/guido.css +1 -1
- package/dist/src/@types/config/index.d.ts +2 -2
- package/dist/src/@types/config/schemas.d.ts +26 -4
- package/dist/src/@types/config/types.d.ts +7 -1
- package/dist/src/composables/useConfig.d.ts +6 -2
- package/dist/src/stores/config.d.ts +145 -18
- package/dist/static/styles/components/button.css.js +1 -1
- package/dist/static/styles/components/narrow-panel.css.js +10 -0
- package/dist/stores/config.js +7 -0
- package/package.json +1 -1
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { useActionsApi as
|
|
2
|
-
import { useBlocksConfig as
|
|
3
|
-
import { useConfig as
|
|
4
|
-
import { useCustomInterfaceAppearance as
|
|
5
|
-
import { useStripoEventHandler as
|
|
6
|
-
import { useToaster as
|
|
7
|
-
import { displayConditions as
|
|
8
|
-
import { useStripoApi as
|
|
9
|
-
import
|
|
10
|
-
import { useEditorStore as
|
|
11
|
-
import { dynamicContentToMergeTags as
|
|
12
|
-
import
|
|
13
|
-
const
|
|
14
|
-
const { features:
|
|
15
|
-
var
|
|
16
|
-
const
|
|
1
|
+
import { useActionsApi as b } from "./useActionsApi.js";
|
|
2
|
+
import { useBlocksConfig as k } from "./useBlocksConfig.js";
|
|
3
|
+
import { useConfig as T } from "./useConfig.js";
|
|
4
|
+
import { useCustomInterfaceAppearance as V } from "./useCustomInterfaceAppearance.js";
|
|
5
|
+
import { useStripoEventHandler as _ } from "./useStripoEventHandler.js";
|
|
6
|
+
import { useToaster as B } from "./useToaster.js";
|
|
7
|
+
import { displayConditions as A } from "../enums/displayConditions.js";
|
|
8
|
+
import { useStripoApi as v } from "../services/stripoApi.js";
|
|
9
|
+
import F from "../static/styles/customEditorStyle.css.js";
|
|
10
|
+
import { useEditorStore as I } from "../stores/editor.js";
|
|
11
|
+
import { dynamicContentToMergeTags as M } from "../utils/genericUtil.js";
|
|
12
|
+
import U from "../package.json.js";
|
|
13
|
+
const N = (c) => {
|
|
14
|
+
const { features: g } = T(), { handleError: l } = B(), { getToken: f, getCustomFonts: y } = v(), { handleEvent: S } = _(), { getStripoBlocksConfig: C } = k(), E = async (i, r = []) => {
|
|
15
|
+
var m;
|
|
16
|
+
const e = I(), { html: n, css: u, forceRecreate: a } = i, { baseBlocks: t, extensions: d } = await C(), p = ((m = g.value) == null ? void 0 : m.displayConditions) ?? !0;
|
|
17
17
|
window.UIEditor.initEditor(
|
|
18
18
|
document.querySelector("#guido-editor"),
|
|
19
19
|
{
|
|
20
20
|
metadata: c,
|
|
21
|
-
html:
|
|
22
|
-
css:
|
|
21
|
+
html: n,
|
|
22
|
+
css: u,
|
|
23
23
|
forceRecreate: a,
|
|
24
24
|
locale: "en",
|
|
25
25
|
undoButtonSelector: "#guido__undo-button",
|
|
@@ -30,12 +30,11 @@ const K = (c) => {
|
|
|
30
30
|
customAppearanceMergetags: !0,
|
|
31
31
|
customAppearanceMergetagsBorderColor: "#f1f3fe",
|
|
32
32
|
customAppearanceMergetagsBackgroundColor: "#f1f3fe",
|
|
33
|
-
customViewStyles:
|
|
34
|
-
conditionsEnabled:
|
|
35
|
-
customConditionsEnabled:
|
|
36
|
-
conditionCategories:
|
|
33
|
+
customViewStyles: F,
|
|
34
|
+
conditionsEnabled: p,
|
|
35
|
+
customConditionsEnabled: p,
|
|
36
|
+
conditionCategories: A,
|
|
37
37
|
enableXSSSecurity: !0,
|
|
38
|
-
modulesDisabled: b,
|
|
39
38
|
messageSettingsEnabled: !0,
|
|
40
39
|
displayGmailAnnotations: !0,
|
|
41
40
|
displayHiddenPreheader: !1,
|
|
@@ -46,44 +45,44 @@ const K = (c) => {
|
|
|
46
45
|
editorFonts: {
|
|
47
46
|
showDefaultStandardFonts: !0,
|
|
48
47
|
showDefaultNotStandardFonts: !0,
|
|
49
|
-
customFonts:
|
|
48
|
+
customFonts: r
|
|
50
49
|
},
|
|
51
50
|
mergeTags: [
|
|
52
51
|
{
|
|
53
|
-
entries:
|
|
52
|
+
entries: M(c.preselectedDynamicContentList)
|
|
54
53
|
}
|
|
55
54
|
],
|
|
56
|
-
async onTokenRefreshRequest(
|
|
55
|
+
async onTokenRefreshRequest(o) {
|
|
57
56
|
try {
|
|
58
|
-
const s = await
|
|
59
|
-
|
|
57
|
+
const s = await f();
|
|
58
|
+
o(s);
|
|
60
59
|
} catch (s) {
|
|
61
|
-
|
|
60
|
+
l(s, "Failed to refresh token");
|
|
62
61
|
}
|
|
63
62
|
},
|
|
64
63
|
onTemplateLoaded() {
|
|
65
64
|
try {
|
|
66
|
-
const { importCss:
|
|
67
|
-
|
|
68
|
-
|
|
65
|
+
const { importCss: o } = V(), { activateCustomViewStyles: s, updateTimerInClonedTemplate: w } = b();
|
|
66
|
+
o(), s(), w(), c.onReady(), e.isStripoInitialized = !0, e.loadingStatus = !1, setTimeout(() => {
|
|
67
|
+
e.hasChanges = !1;
|
|
69
68
|
}, 1e3);
|
|
70
|
-
} catch (
|
|
71
|
-
|
|
69
|
+
} catch (o) {
|
|
70
|
+
l(o, "Failed to load custom interface appearance");
|
|
72
71
|
}
|
|
73
72
|
},
|
|
74
|
-
onCodeEditorVisibilityChanged(
|
|
75
|
-
|
|
73
|
+
onCodeEditorVisibilityChanged(o) {
|
|
74
|
+
e.isCodeEditorOpen = o;
|
|
76
75
|
},
|
|
77
|
-
onEditorVisualModeChanged(
|
|
78
|
-
|
|
76
|
+
onEditorVisualModeChanged(o) {
|
|
77
|
+
e.editorVisualMode = o.toLowerCase();
|
|
79
78
|
},
|
|
80
|
-
onVersionHistoryVisibilityChanged(
|
|
81
|
-
|
|
79
|
+
onVersionHistoryVisibilityChanged(o) {
|
|
80
|
+
e.isVersionHistoryOpen = o;
|
|
82
81
|
},
|
|
83
82
|
onDataChanged() {
|
|
84
|
-
|
|
83
|
+
e.hasChanges = !0;
|
|
85
84
|
},
|
|
86
|
-
onEvent:
|
|
85
|
+
onEvent: S,
|
|
87
86
|
ignoreClickOutsideSelectors: [
|
|
88
87
|
"#guido-dynamic-content-modal",
|
|
89
88
|
".in-on-board-wrapper",
|
|
@@ -92,26 +91,26 @@ const K = (c) => {
|
|
|
92
91
|
extensions: d
|
|
93
92
|
}
|
|
94
93
|
);
|
|
95
|
-
},
|
|
94
|
+
}, h = (i) => new Promise((r, e) => {
|
|
96
95
|
var d;
|
|
97
96
|
if (document.getElementById("UiEditorScript")) {
|
|
98
|
-
i(),
|
|
97
|
+
i(), r();
|
|
99
98
|
return;
|
|
100
99
|
}
|
|
101
|
-
const
|
|
100
|
+
const n = U.guido, a = `https://email-static.useinsider.com/guido/${(d = n == null ? void 0 : n.stripo) == null ? void 0 : d.version}/UIEditor.js`, t = document.createElement("script");
|
|
102
101
|
t.id = "UiEditorScript", t.type = "module", t.src = a, t.onload = () => {
|
|
103
|
-
i(),
|
|
102
|
+
i(), r();
|
|
104
103
|
}, t.onerror = () => {
|
|
105
|
-
|
|
104
|
+
e(new Error(`Failed to load Stripo UIEditor script from S3: ${a}`));
|
|
106
105
|
}, document.body.appendChild(t);
|
|
107
106
|
});
|
|
108
107
|
return { initPlugin: async (i) => {
|
|
109
|
-
await
|
|
110
|
-
const
|
|
111
|
-
await
|
|
108
|
+
await h(async () => {
|
|
109
|
+
const r = await y();
|
|
110
|
+
await E(i, r);
|
|
112
111
|
});
|
|
113
112
|
} };
|
|
114
113
|
};
|
|
115
114
|
export {
|
|
116
|
-
|
|
115
|
+
N as useStripo
|
|
117
116
|
};
|
|
@@ -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 s } from "./elements/preview.js";
|
|
5
|
+
import { UnsubscribeIconsRegistry as o } from "./iconsRegistry.js";
|
|
6
|
+
import { SettingsPanel as r } from "./settingsPanel.js";
|
|
7
7
|
import n from "./styles.css.js";
|
|
8
|
-
import { UnsubscribeTagRegistry as
|
|
9
|
-
const
|
|
8
|
+
import { UnsubscribeTagRegistry as c } from "./tagRegistry.js";
|
|
9
|
+
const g = new e().addBlock(i).withSettingsPanelRegistry(r).addControl(t).addUiElement(s).addStyles(n).withLocalization({
|
|
10
10
|
en: {
|
|
11
|
-
"Unsubscribe Block": "Unsubscribe
|
|
12
|
-
"Unsubscribe Block Description": "
|
|
11
|
+
"Unsubscribe Block": "Unsubscribe",
|
|
12
|
+
"Unsubscribe Block Description": "Unsubscribe lets you add an Unsubscribe Link to direct users to opt out of receiving your messages.",
|
|
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(c).withIconsRegistry(o).build();
|
|
19
19
|
export {
|
|
20
|
-
|
|
20
|
+
g as default
|
|
21
21
|
};
|
package/dist/guido.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.gap-16[data-v-6562e38c],.gap-16[data-v-1ccb6d4a]{gap:16px}[data-v-06e6f7a7] .in-button-v2__wrapper{line-height:0}[data-v-b5997368] .in-segments-wrapper .in-tooltip-wrapper__box{text-align:left}.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history-wrapper[data-v-52a77eec]{gap:8px}.view-options-wrapper[data-v-d405ca59]{position:relative;display:inline-block}.new-tag[data-v-d405ca59]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-d405ca59] .guido__verion-history-view-option-selection-desktop svg,[data-v-d405ca59] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-d405ca59] .in-segments-wrapper__button_selected,[data-v-d405ca59] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-d405ca59] .in-tooltip-wrapper__icon{cursor:pointer}.view-options-wrapper[data-v-195ab6d4]{position:relative;display:inline-block}.new-tag[data-v-195ab6d4]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-195ab6d4] .guido__view-option-selection-desktop svg,[data-v-195ab6d4] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-195ab6d4] .in-segments-wrapper__button_selected,[data-v-195ab6d4] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-195ab6d4] .in-tooltip-wrapper__icon{cursor:pointer}.guido-loading__wrapper[data-v-07c4b2d8]{height:100%;top:75px!important;bottom:0!important}.guido-editor__wrapper[data-v-
|
|
1
|
+
.gap-16[data-v-6562e38c],.gap-16[data-v-1ccb6d4a]{gap:16px}[data-v-06e6f7a7] .in-button-v2__wrapper{line-height:0}[data-v-b5997368] .in-segments-wrapper .in-tooltip-wrapper__box{text-align:left}.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history-wrapper[data-v-52a77eec]{gap:8px}.view-options-wrapper[data-v-d405ca59]{position:relative;display:inline-block}.new-tag[data-v-d405ca59]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-d405ca59] .guido__verion-history-view-option-selection-desktop svg,[data-v-d405ca59] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-d405ca59] .in-segments-wrapper__button_selected,[data-v-d405ca59] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-d405ca59] .in-tooltip-wrapper__icon{cursor:pointer}.view-options-wrapper[data-v-195ab6d4]{position:relative;display:inline-block}.new-tag[data-v-195ab6d4]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-195ab6d4] .guido__view-option-selection-desktop svg,[data-v-195ab6d4] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-195ab6d4] .in-segments-wrapper__button_selected,[data-v-195ab6d4] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-195ab6d4] .in-tooltip-wrapper__icon{cursor:pointer}.guido-loading__wrapper[data-v-07c4b2d8]{height:100%;top:75px!important;bottom:0!important}.guido-editor__wrapper[data-v-282ca4d1]{position:relative;width:100%;height:calc(100vh - 128px)}.guido-editor__container[data-v-282ca4d1]{width:100%;height:calc(100vh - 128px)}.guido-editor__no-header[data-v-282ca4d1]{height:calc(100vh - 75px)}[data-v-293f1c47] .in-breadcrumb-wrapper__links{cursor:pointer}.templates-wrapper[data-v-a86fc486]{gap:16px;grid-template-columns:repeat(3,1fr)}.templates-wrapper .template-wrapper[data-v-a86fc486]{cursor:pointer}.templates-wrapper .template-wrapper .template-container[data-v-a86fc486]{height:274px;padding:2px;transition:none}.templates-wrapper .template-wrapper .template-container.selected[data-v-a86fc486]{padding:1px}.templates-wrapper .template-wrapper .template-container .thumbnail[data-v-a86fc486]{object-fit:cover;transform:scale(1)}[data-v-bb3bb07c] .guido__verion-history-view-option-selection-desktop svg,[data-v-bb3bb07c] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-bb3bb07c] .in-segments-wrapper__button_selected,[data-v-bb3bb07c] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}.error-list[data-v-7a09985c]{gap:16px}[data-v-c2adc57d] .in-progress-wrapper__progress p span:last-child{display:none!important}.desktop-preview-container[data-v-2dd60b0c],[data-v-2dd60b0c] .desktop-preview-container .in-container{min-height:720px!important;height:100%}.cropped-text[data-v-4b876c1b]{width:220px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}[data-v-d3c52b44] .vueperslides__bullets,[data-v-dd1a237a] .vueperslides__bullets{pointer-events:none!important}[data-v-dd1a237a] .vueperslides__parallax-wrapper{height:110px!important}[data-v-a408dcea] .vueperslides__bullets{pointer-events:none!important}[data-v-a408dcea] .vueperslides__parallax-wrapper{height:110px!important}
|
|
@@ -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, 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';
|
|
10
|
+
export { MessageType, ProductType, GuidoConfigSchema, IdentitySchema, PartnerSchema, TemplateSchema, EditorSchema, UISchema, FeaturesSchema, BlocksSchema, CompilerSchema, CallbacksSchema, 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, CallbacksConfig, CallbacksConfigInput, ExternalValidationHandler, 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,7 +5,14 @@
|
|
|
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';
|
|
8
9
|
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>;
|
|
9
16
|
/**
|
|
10
17
|
* Message type constants for email templates
|
|
11
18
|
*/
|
|
@@ -146,8 +153,6 @@ export declare const FeaturesSchema: v.ObjectSchema<{
|
|
|
146
153
|
readonly displayConditions: v.OptionalSchema<v.BooleanSchema<undefined>, true>;
|
|
147
154
|
/** Enable unsubscribe block */
|
|
148
155
|
readonly unsubscribe: v.OptionalSchema<v.BooleanSchema<undefined>, true>;
|
|
149
|
-
/** Disable modules panel in the editor */
|
|
150
|
-
readonly modulesDisabled: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
151
156
|
}, undefined>;
|
|
152
157
|
/**
|
|
153
158
|
* Default block types available in Stripo
|
|
@@ -344,6 +349,16 @@ export declare const CompilerSchema: v.ObjectSchema<{
|
|
|
344
349
|
/** Skip default compiler rules */
|
|
345
350
|
readonly ignoreDefaultRules: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
346
351
|
}, 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>;
|
|
347
362
|
/**
|
|
348
363
|
* Complete Guido configuration schema
|
|
349
364
|
*
|
|
@@ -356,6 +371,7 @@ export declare const CompilerSchema: v.ObjectSchema<{
|
|
|
356
371
|
* - features: Feature toggles
|
|
357
372
|
* - blocks: Block configuration
|
|
358
373
|
* - compiler: HTML compilation
|
|
374
|
+
* - callbacks: Event handlers and hooks
|
|
359
375
|
*/
|
|
360
376
|
export declare const GuidoConfigSchema: v.ObjectSchema<{
|
|
361
377
|
/** Identity configuration (required) */
|
|
@@ -441,8 +457,6 @@ export declare const GuidoConfigSchema: v.ObjectSchema<{
|
|
|
441
457
|
readonly displayConditions: v.OptionalSchema<v.BooleanSchema<undefined>, true>;
|
|
442
458
|
/** Enable unsubscribe block */
|
|
443
459
|
readonly unsubscribe: v.OptionalSchema<v.BooleanSchema<undefined>, true>;
|
|
444
|
-
/** Disable modules panel in the editor */
|
|
445
|
-
readonly modulesDisabled: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
446
460
|
}, undefined>, {}>;
|
|
447
461
|
/** Block configuration */
|
|
448
462
|
readonly blocks: v.OptionalSchema<v.ObjectSchema<{
|
|
@@ -506,4 +520,12 @@ export declare const GuidoConfigSchema: v.ObjectSchema<{
|
|
|
506
520
|
/** Skip default compiler rules */
|
|
507
521
|
readonly ignoreDefaultRules: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
508
522
|
}, 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>, {}>;
|
|
509
531
|
}, 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, DynamicContentSchema, EmailHeaderSchema, CompilerRuleSchema, ReplaceRuleSchema, RegexRuleSchema, RemoveRuleSchema, CustomRuleSchema, DefaultBlockTypeSchema, CustomBlockTypeSchema } from './schemas';
|
|
8
|
+
import type { GuidoConfigSchema, IdentitySchema, PartnerSchema, TemplateSchema, EditorSchema, UISchema, FeaturesSchema, BlocksSchema, CompilerSchema, CallbacksSchema, DynamicContentSchema, EmailHeaderSchema, CompilerRuleSchema, ReplaceRuleSchema, RegexRuleSchema, RemoveRuleSchema, CustomRuleSchema, DefaultBlockTypeSchema, CustomBlockTypeSchema, ExternalValidationHandler } from './schemas';
|
|
9
9
|
import type * as v from 'valibot';
|
|
10
10
|
/**
|
|
11
11
|
* Complete validated Guido configuration.
|
|
@@ -41,6 +41,10 @@ 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 };
|
|
44
48
|
/** Email header configuration (senderName, subject) */
|
|
45
49
|
export type EmailHeader = v.InferOutput<typeof EmailHeaderSchema>;
|
|
46
50
|
/** Dynamic content item */
|
|
@@ -85,6 +89,8 @@ export type FeaturesConfigInput = v.InferInput<typeof FeaturesSchema>;
|
|
|
85
89
|
export type BlocksConfigInput = v.InferInput<typeof BlocksSchema>;
|
|
86
90
|
/** Input type for compiler configuration */
|
|
87
91
|
export type CompilerConfigInput = v.InferInput<typeof CompilerSchema>;
|
|
92
|
+
/** Input type for callbacks configuration */
|
|
93
|
+
export type CallbacksConfigInput = v.InferInput<typeof CallbacksSchema>;
|
|
88
94
|
/** Default Stripo block types */
|
|
89
95
|
export type DefaultBlockType = v.InferOutput<typeof DefaultBlockTypeSchema>;
|
|
90
96
|
/** Custom Guido block types */
|
|
@@ -52,7 +52,6 @@ export declare const useConfig: () => {
|
|
|
52
52
|
testMessage: boolean;
|
|
53
53
|
displayConditions: boolean;
|
|
54
54
|
unsubscribe: boolean;
|
|
55
|
-
modulesDisabled: boolean;
|
|
56
55
|
};
|
|
57
56
|
blocks: {
|
|
58
57
|
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")[];
|
|
@@ -90,6 +89,9 @@ export declare const useConfig: () => {
|
|
|
90
89
|
})[];
|
|
91
90
|
ignoreDefaultRules: boolean;
|
|
92
91
|
};
|
|
92
|
+
callbacks: {
|
|
93
|
+
externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
|
|
94
|
+
};
|
|
93
95
|
} | null>;
|
|
94
96
|
initialized: import("vue").Ref<boolean>;
|
|
95
97
|
identity: import("vue").ComputedRef<{
|
|
@@ -137,7 +139,6 @@ export declare const useConfig: () => {
|
|
|
137
139
|
testMessage: boolean;
|
|
138
140
|
displayConditions: boolean;
|
|
139
141
|
unsubscribe: boolean;
|
|
140
|
-
modulesDisabled: boolean;
|
|
141
142
|
} | null>;
|
|
142
143
|
blocks: import("vue").ComputedRef<{
|
|
143
144
|
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")[];
|
|
@@ -175,6 +176,9 @@ export declare const useConfig: () => {
|
|
|
175
176
|
})[];
|
|
176
177
|
ignoreDefaultRules: boolean;
|
|
177
178
|
} | null>;
|
|
179
|
+
callbacks: import("vue").ComputedRef<{
|
|
180
|
+
externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
|
|
181
|
+
} | null>;
|
|
178
182
|
templateId: import("vue").ComputedRef<string>;
|
|
179
183
|
userId: import("vue").ComputedRef<string>;
|
|
180
184
|
variationId: import("vue").ComputedRef<string>;
|