@topol.io/editor 1.0.0-alpha.9 → 2.0.0-alpha.2
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/README.md +111 -106
- package/dist/topol-plugin.es.js +126 -246
- package/dist/topol-plugin.umd.cjs +1 -0
- package/dist/types/src/email-editor/constants.d.ts +3 -3
- package/dist/types/src/email-editor/index.d.ts +15 -101
- package/dist/types/src/landing-page-editor/schemas/contentBlock/contentBlockScheme.d.ts +1 -1
- package/dist/types/src/landing-page-editor/schemas/openAI/openAISchema.d.ts +1 -2
- package/dist/types/src/landing-page-editor/schemas/premadeBlock/premadeBlockSchema.d.ts +816 -816
- package/dist/types/src/landing-page-editor/schemas/savedBlock/savedBlockApiSchema.d.ts +612 -612
- package/dist/types/src/landing-page-editor/schemas/savedBlock/savedBlockSchema.d.ts +816 -816
- package/dist/types/src/landing-page-editor/schemas/template/blocks/buttonBlockSchema.d.ts +2 -2
- package/dist/types/src/landing-page-editor/schemas/template/blocks/dividerBlockSchema.d.ts +2 -2
- package/dist/types/src/landing-page-editor/schemas/template/blocks/imageAnGifBlockSchema.d.ts +6 -6
- package/dist/types/src/landing-page-editor/schemas/template/blocks/socialBlockSchema.d.ts +2 -2
- package/dist/types/src/landing-page-editor/schemas/template/blocks/spacerBlockSchema.d.ts +2 -2
- package/dist/types/src/landing-page-editor/schemas/template/structure/blockSchema.d.ts +92 -92
- package/dist/types/src/landing-page-editor/schemas/template/structure/columnSchema.d.ts +94 -94
- package/dist/types/src/landing-page-editor/schemas/template/structure/sectionSchema.d.ts +204 -204
- package/dist/types/src/landing-page-editor/schemas/templateSchema.d.ts +804 -804
- package/dist/types/src/main.d.ts +10 -72
- package/dist/types/types/API/API.d.ts +8 -7
- package/dist/types/types/Auth/INonceAuthCallbacks.d.ts +9 -0
- package/dist/types/types/Callbacks/ICallbackPayloads.d.ts +19 -22
- package/dist/types/types/Callbacks/IEmailCallbacks.d.ts +65 -155
- package/dist/types/types/Cloud/ICloudOptions.d.ts +32 -0
- package/dist/types/types/ContentBlock/IContentBlockOptions.d.ts +1 -1
- package/dist/types/types/IEmailConfig.d.ts +190 -0
- package/dist/types/types/IEmailEditorInstance.d.ts +54 -0
- package/dist/types/types/ITopolOptions.d.ts +4 -153
- package/dist/types/types/ITopolPlugin.d.ts +2 -44
- package/dist/types/types/Language/Language.d.ts +1 -1
- package/dist/types/types/SavedBlock/ISavedBlock.d.ts +2 -6
- package/dist/types/types/Sections/ISections.d.ts +30 -0
- package/package.json +7 -10
- package/dist/topol-plugin.umd.js +0 -1
package/dist/types/src/main.d.ts
CHANGED
|
@@ -1,81 +1,12 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @topol.io/editor - Official Topol Editor Integration Package
|
|
3
|
-
*
|
|
4
|
-
* This package provides integrations for Topol's email and landing page editors.
|
|
5
|
-
*
|
|
6
|
-
* @example Email Editor (default export - backwards compatible)
|
|
7
|
-
* ```typescript
|
|
8
|
-
* import TopolPlugin from '@topol.io/editor';
|
|
9
|
-
*
|
|
10
|
-
* await TopolPlugin.init({
|
|
11
|
-
* id: '#editor',
|
|
12
|
-
* authorize: { apiKey: 'your-key', userId: 'user-123' },
|
|
13
|
-
* callbacks: { onSave({ json, html }) { console.log('Saved'); } }
|
|
14
|
-
* });
|
|
15
|
-
* ```
|
|
16
|
-
*
|
|
17
|
-
* @example Email Editor (explicit named export)
|
|
18
|
-
* ```typescript
|
|
19
|
-
* import { EmailEditor } from '@topol.io/editor';
|
|
20
|
-
*
|
|
21
|
-
* await EmailEditor.init({ ... });
|
|
22
|
-
* ```
|
|
23
|
-
*
|
|
24
|
-
* @example Landing Page Editor
|
|
25
|
-
* ```typescript
|
|
26
|
-
* import { LandingPageEditor } from '@topol.io/editor';
|
|
27
|
-
*
|
|
28
|
-
* const editor = await LandingPageEditor.init({
|
|
29
|
-
* authorize: { apiKey: 'your-key', userId: 'user-123' },
|
|
30
|
-
* callbacks: { onSave(data) { console.log('Saved'); } }
|
|
31
|
-
* });
|
|
32
|
-
* editor.render('#landing-page-editor');
|
|
33
|
-
* ```
|
|
34
|
-
*/
|
|
35
1
|
import { EmailEditor } from "./email-editor";
|
|
36
2
|
/**
|
|
37
|
-
* @deprecated Use `EmailEditor` instead. `TopolPlugin` is an alias
|
|
3
|
+
* @deprecated Use `EmailEditor` instead. `TopolPlugin` is an alias as a naming alias.
|
|
38
4
|
*
|
|
39
5
|
* TopolPlugin is the original name for the Email Editor integration.
|
|
40
6
|
* New code should use `EmailEditor` for clarity.
|
|
41
7
|
*/
|
|
42
8
|
declare const TopolPlugin: {
|
|
43
|
-
init
|
|
44
|
-
save: (lang?: string | undefined) => void;
|
|
45
|
-
load: (json: unknown) => void;
|
|
46
|
-
togglePreview: () => void;
|
|
47
|
-
togglePreviewSize: () => void;
|
|
48
|
-
chooseFile: (url: string) => void;
|
|
49
|
-
undo: () => void;
|
|
50
|
-
redo: () => void;
|
|
51
|
-
destroy: () => void;
|
|
52
|
-
setSavedBlocks: (savedBlocks: ISavedBlock[]) => void;
|
|
53
|
-
setPreviewHTML: (html: unknown) => void;
|
|
54
|
-
createNotification: (notification: INotification) => void;
|
|
55
|
-
setActiveMembers: (activeMembers: string[]) => void;
|
|
56
|
-
changeEmailToMobile: () => void;
|
|
57
|
-
changeEmailToDesktop: () => void;
|
|
58
|
-
toggleBlocksAndStructuresVisibility: () => void;
|
|
59
|
-
updateCustomBlockContent: (content: string) => void;
|
|
60
|
-
refreshComments: (key: string) => void;
|
|
61
|
-
refreshSyncedRows: () => void;
|
|
62
|
-
openPremadeTemplatesSelection: () => void;
|
|
63
|
-
updateApiAuthorizationHeader: (newHeader: string | Record<string, string>) => void;
|
|
64
|
-
setTemplateName: (name: string) => void;
|
|
65
|
-
updateOptions: (options: Partial<ITopolOptions>) => void;
|
|
66
|
-
toggleChatAI: () => void;
|
|
67
|
-
toggleAutosaves: () => void;
|
|
68
|
-
toggleComments: () => void;
|
|
69
|
-
createLanguage: (lang: string) => void;
|
|
70
|
-
setPrimaryLanguage: (lang: string) => void;
|
|
71
|
-
deleteLanguage: (lang: string) => void;
|
|
72
|
-
selectLanguage: (lang: string) => void;
|
|
73
|
-
getMutations: () => void;
|
|
74
|
-
toggleControlPanel: () => void;
|
|
75
|
-
updateTemplate: (json: unknown, options?: {
|
|
76
|
-
skipSnapshot?: boolean | undefined;
|
|
77
|
-
} | undefined) => void;
|
|
78
|
-
toggleDarkMode: () => void;
|
|
9
|
+
init(options: ITopolOptions, pluginOptions?: import("./email-editor").IEmailEditorPluginOptions | undefined): Promise<import("../types/IEmailEditorInstance").default>;
|
|
79
10
|
};
|
|
80
11
|
import { LandingPageEditor } from "./landing-page-editor";
|
|
81
12
|
import type ITopolOptions from "../types/ITopolOptions";
|
|
@@ -98,7 +29,7 @@ import type ILandingPageEditorInstance from "../types/landing-page/ILandingPageE
|
|
|
98
29
|
import type { TopolSection } from "./landing-page-editor/schemas/template/structure/sectionSchema";
|
|
99
30
|
export default TopolPlugin;
|
|
100
31
|
/**
|
|
101
|
-
* @deprecated Use `EmailEditor` instead. `TopolPlugin` is an alias
|
|
32
|
+
* @deprecated Use `EmailEditor` instead. `TopolPlugin` is an alias as a naming alias.
|
|
102
33
|
*/
|
|
103
34
|
export { TopolPlugin };
|
|
104
35
|
export { EmailEditor };
|
|
@@ -106,3 +37,10 @@ export { LandingPageEditor };
|
|
|
106
37
|
export type { ITopolOptions, IEmailCallbacks, INotification, ISavedBlock, IMergeTagGroup, IMergeTag, IContentBlockOptions, ITheme, IAuthHeaderConfig, IFont, IAPI, ICustomBlockData, Stage as IStage };
|
|
107
38
|
export type { ISaveData, IErrorData, ISendTestData };
|
|
108
39
|
export type { ILandingPageOptions, ILandingPageCallbacks, ILandingPageEditorInstance, TopolSection, ILandingPageSavePayload, ILandingPageDeletedItem, ILandingPageErrorPayload };
|
|
40
|
+
export type { default as IEmailConfig } from "../types/IEmailConfig";
|
|
41
|
+
export type { default as IEmailEditorInstance, IUpdateTemplateOptions } from "../types/IEmailEditorInstance";
|
|
42
|
+
export type { IEmailEditorPluginOptions } from "./email-editor";
|
|
43
|
+
export type { INonceAuthCallbacks } from "../types/Auth/INonceAuthCallbacks";
|
|
44
|
+
export type { ICloudFeatures, ICloudOptions, ICloudCallbacks, ICloudSavePayload, ICloudTemplateChangePayload } from "../types/Cloud/ICloudOptions";
|
|
45
|
+
export type { ISavedSection, IPremadeSection, IPremadeSections, ILegacyPremadeSections, IPremadeSectionsOptions } from "../types/Sections/ISections";
|
|
46
|
+
export type { ILanguageMutation, ILanguageChangePayload, IEmailDeletedItem } from "../types/Callbacks/ICallbackPayloads";
|
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
export default interface IAPI {
|
|
2
|
-
AUTOSAVE?: string;
|
|
3
2
|
AUTOSAVES?: string;
|
|
4
|
-
GET_AUTOSAVE?: string;
|
|
5
3
|
CONVERSATIONS?: string;
|
|
6
4
|
COMMENTS?: string;
|
|
7
5
|
IMAGE_UPLOAD?: string;
|
|
8
6
|
IMAGE_EDITOR_UPLOAD?: string;
|
|
9
7
|
FOLDERS?: string;
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
GENERATE_TEXT?: string;
|
|
9
|
+
GENERATE_PREHEADER?: string;
|
|
10
|
+
GENERATE_TRANSLATION?: string;
|
|
12
11
|
PRODUCTS?: string;
|
|
13
12
|
FEEDS?: string;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
SAVED_BLOCKS?: string;
|
|
13
|
+
PRODUCT_CATEGORIES?: string;
|
|
14
|
+
SAVED_SECTIONS?: string;
|
|
17
15
|
TEST_EMAIL?: string;
|
|
16
|
+
PREMADE_TEMPLATES?: string;
|
|
17
|
+
PREMADE_TEMPLATE_CATEGORIES?: string;
|
|
18
|
+
PREMADE_TEMPLATES_KEYWORDS?: string;
|
|
18
19
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Nonce authentication. Passing `getNonce` switches the editor from the legacy
|
|
3
|
+
* public-key authorize call to short-lived `nc_` nonces minted on your backend.
|
|
4
|
+
* Works on its own (every feature stays external) and is required by Topol Cloud.
|
|
5
|
+
*/
|
|
6
|
+
export interface INonceAuthCallbacks {
|
|
7
|
+
/** Fetch a fresh nc_ nonce from your authenticated backend. Never expose an sk_ secret in the browser. */
|
|
8
|
+
getNonce?(): Promise<string>;
|
|
9
|
+
}
|
|
@@ -1,35 +1,32 @@
|
|
|
1
|
-
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
* Payload for onSave and onSaveAndClose callbacks.
|
|
7
|
-
* Used when transforming (json, html) arguments into a single object.
|
|
8
|
-
*/
|
|
1
|
+
/** Language identifiers use code in editor v4. */
|
|
2
|
+
export interface ILanguageMutation {
|
|
3
|
+
code: string;
|
|
4
|
+
primary: boolean;
|
|
5
|
+
}
|
|
9
6
|
export interface ISaveData {
|
|
10
7
|
json: unknown;
|
|
11
8
|
html: unknown;
|
|
12
|
-
mutations?:
|
|
13
|
-
key: string;
|
|
14
|
-
primary: boolean;
|
|
15
|
-
}[];
|
|
9
|
+
mutations?: ILanguageMutation[];
|
|
16
10
|
syncedSections?: number[];
|
|
17
11
|
}
|
|
18
|
-
/**
|
|
19
|
-
* Payload for onError callback.
|
|
20
|
-
* Used when transforming (type, message, responseBody) arguments into a single object.
|
|
21
|
-
*/
|
|
22
12
|
export interface IErrorData {
|
|
23
|
-
|
|
13
|
+
source: string;
|
|
24
14
|
message: string;
|
|
25
|
-
|
|
15
|
+
detail?: unknown;
|
|
26
16
|
}
|
|
27
|
-
/**
|
|
28
|
-
* Payload for onTestSend callback (Email Editor only).
|
|
29
|
-
* Used when transforming (email, json, html) arguments into a single object.
|
|
30
|
-
*/
|
|
31
17
|
export interface ISendTestData {
|
|
32
18
|
email: string | string[];
|
|
33
19
|
json: unknown;
|
|
34
20
|
html: unknown;
|
|
35
21
|
}
|
|
22
|
+
export interface ILanguageChangePayload {
|
|
23
|
+
code: string;
|
|
24
|
+
mutations: ILanguageMutation[];
|
|
25
|
+
}
|
|
26
|
+
export interface IEmailDeletedItem {
|
|
27
|
+
name: string;
|
|
28
|
+
type: "file" | "folder";
|
|
29
|
+
path: string;
|
|
30
|
+
url?: string;
|
|
31
|
+
key: string | null;
|
|
32
|
+
}
|
|
@@ -1,160 +1,70 @@
|
|
|
1
|
-
import type ISavedBlock from "../SavedBlock/ISavedBlock";
|
|
2
1
|
import type INotification from "../Notification/INotification";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
primary: boolean;
|
|
17
|
-
}[], syncedSections: number[]): void;
|
|
18
|
-
/**
|
|
19
|
-
* Called when the user clicks "Save and Close".
|
|
20
|
-
* @param json - The email template JSON structure
|
|
21
|
-
* @param html - The generated HTML output
|
|
22
|
-
* @param mutations - The mutations applied to the email template
|
|
23
|
-
* @param syncedSections - The synced sections id that were in the email template at the time of saving
|
|
24
|
-
*/
|
|
25
|
-
onSaveAndClose?(json: unknown, html: unknown, mutations: {
|
|
26
|
-
key: string;
|
|
27
|
-
primary: boolean;
|
|
28
|
-
}[], syncedSections: number[]): void;
|
|
29
|
-
/**
|
|
30
|
-
* Called when the user sends a test email.
|
|
31
|
-
* @param email - The email address(es) to send to
|
|
32
|
-
* @param json - The email template JSON structure
|
|
33
|
-
* @param html - The generated HTML output
|
|
34
|
-
*/
|
|
35
|
-
onTestSend?(email: string | string[], json: unknown, html: unknown): void;
|
|
36
|
-
/**
|
|
37
|
-
* Called when the user clicks the banner (free version only).
|
|
38
|
-
* @param json - The email template JSON structure
|
|
39
|
-
* @param html - The generated HTML output
|
|
40
|
-
*/
|
|
41
|
-
onBannerClick?(json: unknown, html: unknown): void;
|
|
42
|
-
/**
|
|
43
|
-
* Called when the custom file manager should be opened.
|
|
44
|
-
*/
|
|
2
|
+
import type { ISavedSection } from "../Sections/ISections";
|
|
3
|
+
import type { ICloudCallbacks } from "../Cloud/ICloudOptions";
|
|
4
|
+
import type { INonceAuthCallbacks } from "../Auth/INonceAuthCallbacks";
|
|
5
|
+
import type { ISaveData, ISendTestData, IErrorData, ILanguageChangePayload, ILanguageMutation, IEmailDeletedItem } from "./ICallbackPayloads";
|
|
6
|
+
/** v4 host callbacks. Return save promises so the editor can await persistence. */
|
|
7
|
+
export default interface IEmailCallbacks extends INonceAuthCallbacks, ICloudCallbacks {
|
|
8
|
+
onSave?(payload: ISaveData): void | Promise<void>;
|
|
9
|
+
onSaveAndClose?(payload: ISaveData): void | Promise<void>;
|
|
10
|
+
onTestSend?(payload: ISendTestData): void;
|
|
11
|
+
onBannerClick?(payload: {
|
|
12
|
+
json: unknown;
|
|
13
|
+
html: unknown;
|
|
14
|
+
}): void;
|
|
45
15
|
onOpenFileManager?(): void;
|
|
46
|
-
/**
|
|
47
|
-
* Called when the editor has finished loading.
|
|
48
|
-
*/
|
|
49
16
|
onLoaded?(): void;
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
* @param blockId - The ID of the block being edited
|
|
63
|
-
*/
|
|
64
|
-
onBlockEdit?(blockId: number): void;
|
|
65
|
-
/**
|
|
66
|
-
* Called when the editor is initialized.
|
|
67
|
-
*/
|
|
17
|
+
onSavedSectionSave?(payload: {
|
|
18
|
+
section: ISavedSection;
|
|
19
|
+
}): void;
|
|
20
|
+
onSavedSectionRemove?(payload: {
|
|
21
|
+
id: number | string;
|
|
22
|
+
}): void;
|
|
23
|
+
onSavedSectionEdit?(payload: {
|
|
24
|
+
id: number | string;
|
|
25
|
+
}): void;
|
|
26
|
+
onImageDelete?(payload: {
|
|
27
|
+
items: IEmailDeletedItem[];
|
|
28
|
+
}): void;
|
|
68
29
|
onInit?(): void;
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
* Called when testing email addresses are updated.
|
|
110
|
-
* @param emails - The updated email addresses
|
|
111
|
-
*/
|
|
112
|
-
updateTestingEmailAddresses?(emails: string[]): void;
|
|
113
|
-
/**
|
|
114
|
-
* Called when an error occurs.
|
|
115
|
-
* @param type - The error type
|
|
116
|
-
* @param message - The error message
|
|
117
|
-
* @param responseBody - The response body (optional)
|
|
118
|
-
*/
|
|
119
|
-
onError?(type: string, message: string, responseBody?: unknown): void;
|
|
120
|
-
/**
|
|
121
|
-
* Called when a new language variant is created.
|
|
122
|
-
* @param lang - The language code that was created
|
|
123
|
-
* @param mutations - The mutations applied to the email template at the time of language creation
|
|
124
|
-
*/
|
|
125
|
-
onLanguageCreated?(lang: string, mutations: {
|
|
126
|
-
key: string;
|
|
127
|
-
primary: boolean;
|
|
128
|
-
}[]): void;
|
|
129
|
-
/**
|
|
130
|
-
* Called when a language variant is deleted.
|
|
131
|
-
* @param lang - The language code that was deleted
|
|
132
|
-
* @param mutations - The mutations applied to the email template at the time of language deletion
|
|
133
|
-
*/
|
|
134
|
-
onLanguageDeleted?(lang: string, mutations: {
|
|
135
|
-
key: string;
|
|
136
|
-
primary: boolean;
|
|
137
|
-
}[]): void;
|
|
138
|
-
/**
|
|
139
|
-
* Called when a language variant is selected/switched to.
|
|
140
|
-
* @param lang - The language code that was selected
|
|
141
|
-
*/
|
|
142
|
-
onLanguageSelected?(lang: string): void;
|
|
143
|
-
/**
|
|
144
|
-
* Called when the primary language is changed.
|
|
145
|
-
* @param lang - The language code that was set as primary
|
|
146
|
-
* @param mutations - The mutations applied to the email template at the time of primary language change
|
|
147
|
-
*/
|
|
148
|
-
onPrimaryLanguageChanged?(lang: string, mutations: {
|
|
149
|
-
key: string;
|
|
150
|
-
primary: boolean;
|
|
151
|
-
}[]): void;
|
|
152
|
-
/**
|
|
153
|
-
* Called when mutations are requested via `getMutations`.
|
|
154
|
-
* @param mutations - The mutations currently applied to the email template
|
|
155
|
-
*/
|
|
156
|
-
onGetMutations?(mutations: {
|
|
157
|
-
key: string;
|
|
158
|
-
primary: boolean;
|
|
159
|
-
}[]): void;
|
|
30
|
+
onUndoChange?(payload: {
|
|
31
|
+
count: number;
|
|
32
|
+
}): void;
|
|
33
|
+
onRedoChange?(payload: {
|
|
34
|
+
count: number;
|
|
35
|
+
}): void;
|
|
36
|
+
onPreview?(payload: {
|
|
37
|
+
html: unknown;
|
|
38
|
+
}): void;
|
|
39
|
+
onPreviewClose?(): void;
|
|
40
|
+
onAlert?(payload: {
|
|
41
|
+
notification: INotification;
|
|
42
|
+
}): void;
|
|
43
|
+
onEditorClose?(): void;
|
|
44
|
+
onEdittedWithoutSaveChanged?(payload: {
|
|
45
|
+
value: boolean;
|
|
46
|
+
}): void;
|
|
47
|
+
onBlocksAndStructuresVisibilityChange?(payload: {
|
|
48
|
+
value: boolean;
|
|
49
|
+
}): void;
|
|
50
|
+
onOpenCustomBlockDialog?(payload: {
|
|
51
|
+
block: unknown;
|
|
52
|
+
}): void;
|
|
53
|
+
onTemplateRename?(payload: {
|
|
54
|
+
name: string;
|
|
55
|
+
}): void;
|
|
56
|
+
onTemplateUpdated?(): void;
|
|
57
|
+
updateTestingEmailAddresses?(payload: {
|
|
58
|
+
emails: string[];
|
|
59
|
+
}): void;
|
|
60
|
+
onEditorError?(payload: IErrorData): void;
|
|
61
|
+
onLanguageCreated?(payload: ILanguageChangePayload): void;
|
|
62
|
+
onLanguageDeleted?(payload: ILanguageChangePayload): void;
|
|
63
|
+
onLanguageSelected?(payload: {
|
|
64
|
+
code: string;
|
|
65
|
+
}): void;
|
|
66
|
+
onPrimaryLanguageChanged?(payload: ILanguageChangePayload): void;
|
|
67
|
+
onGetMutations?(payload: {
|
|
68
|
+
mutations: ILanguageMutation[];
|
|
69
|
+
}): void;
|
|
160
70
|
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/** Enabling Cloud opts in to all features; set individual features to false to use your own backend. */
|
|
2
|
+
export interface ICloudFeatures {
|
|
3
|
+
templates?: boolean;
|
|
4
|
+
autosaves?: boolean;
|
|
5
|
+
images?: boolean;
|
|
6
|
+
comments?: boolean;
|
|
7
|
+
sections?: boolean;
|
|
8
|
+
multilanguage?: boolean;
|
|
9
|
+
testSend?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export interface ICloudOptions {
|
|
12
|
+
enabled: boolean;
|
|
13
|
+
/** Cloud template to open. Top-level config.templateId is ignored in Cloud mode. */
|
|
14
|
+
templateId?: number | string;
|
|
15
|
+
features?: ICloudFeatures;
|
|
16
|
+
}
|
|
17
|
+
export interface ICloudSavePayload {
|
|
18
|
+
templateId: number | string;
|
|
19
|
+
name?: string;
|
|
20
|
+
langCode?: string;
|
|
21
|
+
}
|
|
22
|
+
export interface ICloudTemplateChangePayload {
|
|
23
|
+
type: "rename" | "delete" | "duplicate" | "move";
|
|
24
|
+
templateId: number | string;
|
|
25
|
+
name?: string;
|
|
26
|
+
folderId?: number | null;
|
|
27
|
+
}
|
|
28
|
+
/** Cloud-scoped callbacks. Cloud also requires `getNonce` from INonceAuthCallbacks. */
|
|
29
|
+
export interface ICloudCallbacks {
|
|
30
|
+
onCloudSave?(payload: ICloudSavePayload): void;
|
|
31
|
+
onCloudTemplateChange?(payload: ICloudTemplateChangePayload): void;
|
|
32
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
type BlockType = "text" | "image" | "gif" | "button" | "divider" | "spacer" | "social" | "video" | "html" | "product" | "dynamic" | "article" | "carousel" | "raw" | "custom-raw" | "apiBlock";
|
|
1
|
+
type BlockType = "text" | "image" | "gif" | "button" | "divider" | "spacer" | "social" | "video" | "html" | "product" | "dynamic" | "article" | "carousel" | "raw" | "custom-raw" | "apiBlock" | "countdown" | "loop" | "rating";
|
|
2
2
|
export type IContentBlockOption = {
|
|
3
3
|
disabled?: boolean;
|
|
4
4
|
disabledText?: string;
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
import type IAPI from "./API/API";
|
|
2
|
+
import type IAPIBlockProperties from "./APIBlocks/APIBlocks";
|
|
3
|
+
import type { ISavedSection, IPremadeSectionsOptions } from "./Sections/ISections";
|
|
4
|
+
import type { ICloudOptions } from "./Cloud/ICloudOptions";
|
|
5
|
+
import type IMergeTagGroup from "./MergeTag/IMergeTagGroup";
|
|
6
|
+
import type { IContentBlockOptions } from "./ContentBlock/IContentBlockOptions";
|
|
7
|
+
import type ITheme from "./Theme/ITheme";
|
|
8
|
+
import type IAuthHeaderConfig from "./AuthHeaderConfig/IAuthHeaderConfig";
|
|
9
|
+
import type IFont from "./Font/IFont";
|
|
10
|
+
import type ICustomBlockData from "./CustomBlocks/CustomBlocks";
|
|
11
|
+
import type { Language, IMultilingualLanguage } from "./Language/Language";
|
|
12
|
+
import type IMergeTag from "./MergeTag/IMergeTag";
|
|
13
|
+
import type SmartMergeTagPattern from "./MergeTag/SmartMergeTagPattern";
|
|
14
|
+
import type IUser from "./User/User";
|
|
15
|
+
import type IHelpdesk from "./Helpdesk/Helpdesk";
|
|
16
|
+
type TopolTagAttribute = "font-family" | "font-size" | "font-weight" | "font-style" | "letter-spacing" | "text-transform" | "text-decoration" | "background-color" | "color" | "border-collapse";
|
|
17
|
+
type DefaultTemplateLangsSchema = {
|
|
18
|
+
code: string;
|
|
19
|
+
primary: boolean;
|
|
20
|
+
}[];
|
|
21
|
+
/**
|
|
22
|
+
* Configuration options for the Email Editor (TopolPlugin).
|
|
23
|
+
*/
|
|
24
|
+
export default interface IEmailConfig {
|
|
25
|
+
authorize: {
|
|
26
|
+
apiKey: string;
|
|
27
|
+
/** URL-safe [A-Za-z0-9_-]+ string or a non-negative integer. */
|
|
28
|
+
userId: string | number;
|
|
29
|
+
};
|
|
30
|
+
aiLabeledElements?: boolean;
|
|
31
|
+
api?: IAPI;
|
|
32
|
+
apiAuthorizationHeader?: IAuthHeaderConfig | string;
|
|
33
|
+
apiBlocks?: Record<string, IAPIBlockProperties>;
|
|
34
|
+
autosaveInterval?: number;
|
|
35
|
+
betaFeatures?: {
|
|
36
|
+
carousel?: boolean;
|
|
37
|
+
loop?: boolean;
|
|
38
|
+
rating?: boolean;
|
|
39
|
+
};
|
|
40
|
+
chatAI?: boolean;
|
|
41
|
+
chatAIOnSegment?: boolean;
|
|
42
|
+
cloud?: ICloudOptions;
|
|
43
|
+
colors?: Array<string>;
|
|
44
|
+
contentBlocks?: IContentBlockOptions;
|
|
45
|
+
currentUser?: IUser;
|
|
46
|
+
customBlocks?: ICustomBlockData[];
|
|
47
|
+
customFileManager?: boolean;
|
|
48
|
+
customFonts?: {
|
|
49
|
+
override?: boolean;
|
|
50
|
+
fonts: Array<IFont>;
|
|
51
|
+
};
|
|
52
|
+
customLanguagePreset?: {
|
|
53
|
+
langs: IMultilingualLanguage;
|
|
54
|
+
override?: boolean;
|
|
55
|
+
};
|
|
56
|
+
defaultTemplateSettings?: {
|
|
57
|
+
emailWidth?: number;
|
|
58
|
+
emailBackgroundColor?: string;
|
|
59
|
+
blockBackgroundColor?: string;
|
|
60
|
+
buttonsBackgroundColor?: string;
|
|
61
|
+
hyperlinkColor?: string;
|
|
62
|
+
h1?: {
|
|
63
|
+
[key in TopolTagAttribute]?: string;
|
|
64
|
+
};
|
|
65
|
+
h2?: {
|
|
66
|
+
[key in TopolTagAttribute]?: string;
|
|
67
|
+
};
|
|
68
|
+
h3?: {
|
|
69
|
+
[key in TopolTagAttribute]?: string;
|
|
70
|
+
};
|
|
71
|
+
p?: {
|
|
72
|
+
[key in TopolTagAttribute]?: string;
|
|
73
|
+
};
|
|
74
|
+
button?: Record<string, unknown>;
|
|
75
|
+
carousel?: Record<string, unknown>;
|
|
76
|
+
divider?: Record<string, unknown>;
|
|
77
|
+
gif?: Record<string, unknown>;
|
|
78
|
+
image?: Record<string, unknown>;
|
|
79
|
+
loop?: Record<string, unknown>;
|
|
80
|
+
social?: Record<string, unknown>;
|
|
81
|
+
text?: Record<string, unknown>;
|
|
82
|
+
column?: Record<string, unknown>;
|
|
83
|
+
section?: Record<string, unknown>;
|
|
84
|
+
"line-height"?: number;
|
|
85
|
+
"structure-margin"?: string;
|
|
86
|
+
"stack-columns"?: boolean;
|
|
87
|
+
langs?: DefaultTemplateLangsSchema;
|
|
88
|
+
};
|
|
89
|
+
disableAiAssistant?: boolean;
|
|
90
|
+
disableAlerts?: boolean;
|
|
91
|
+
disableExtendedComparators?: boolean;
|
|
92
|
+
emailServiceProvider?: "mailchimp" | "sparkpost";
|
|
93
|
+
enableAutosaves?: boolean;
|
|
94
|
+
enableComments?: boolean;
|
|
95
|
+
enableDarkMode?: boolean;
|
|
96
|
+
enableFileManagerInGif?: boolean;
|
|
97
|
+
enableSubjectLine?: boolean;
|
|
98
|
+
enableImageToTextRatio?: boolean;
|
|
99
|
+
enableMergeTagPreview?: boolean;
|
|
100
|
+
enableSectionVariants?: boolean;
|
|
101
|
+
enableTemplateSizeInfo?: boolean;
|
|
102
|
+
fileManagerPreferences?: {
|
|
103
|
+
defaultTilesView?: boolean;
|
|
104
|
+
hidePexelsIntegration?: boolean;
|
|
105
|
+
maxUploadingFiles?: number;
|
|
106
|
+
};
|
|
107
|
+
fontSizes?: Array<number>;
|
|
108
|
+
googleApiKey?: string;
|
|
109
|
+
googlePromotionalAnnotation?: boolean;
|
|
110
|
+
helpdesk?: IHelpdesk;
|
|
111
|
+
hideSettingsTab?: boolean;
|
|
112
|
+
hideControlPanel?: boolean;
|
|
113
|
+
htmlDesktopFirst?: boolean;
|
|
114
|
+
htmlMinified?: boolean;
|
|
115
|
+
imageCompressionOptions?: {
|
|
116
|
+
qualityJpeg?: number;
|
|
117
|
+
qualityPng?: number;
|
|
118
|
+
enableAutoResize?: boolean;
|
|
119
|
+
enableCompression?: boolean;
|
|
120
|
+
};
|
|
121
|
+
imageEditor?: boolean;
|
|
122
|
+
imageEditorV2?: boolean;
|
|
123
|
+
imageEditorOptions?: {
|
|
124
|
+
hideControls?: Array<string>;
|
|
125
|
+
};
|
|
126
|
+
imageMaxSize?: number;
|
|
127
|
+
lambdaStage?: "local" | "production" | "stage1" | "stage2" | "stage3" | "v4";
|
|
128
|
+
language?: Language;
|
|
129
|
+
languageMergeTag?: string;
|
|
130
|
+
light?: boolean;
|
|
131
|
+
logicalOperatorsInsideVariant?: boolean;
|
|
132
|
+
mainMenuAlign?: "left" | "right";
|
|
133
|
+
mergeTags?: Array<IMergeTagGroup | IMergeTag>;
|
|
134
|
+
mobileFirstEnabled?: boolean;
|
|
135
|
+
multilingual?: boolean;
|
|
136
|
+
premadeSections?: IPremadeSectionsOptions;
|
|
137
|
+
premadeTemplates?: boolean;
|
|
138
|
+
premadeTemplatesOptions?: {
|
|
139
|
+
hideSearch?: boolean;
|
|
140
|
+
showDelete?: boolean;
|
|
141
|
+
};
|
|
142
|
+
productMergetagTags?: {
|
|
143
|
+
label: string;
|
|
144
|
+
value: string;
|
|
145
|
+
}[];
|
|
146
|
+
permissions?: {
|
|
147
|
+
canLockBlocks?: boolean;
|
|
148
|
+
canLockSections?: boolean;
|
|
149
|
+
canEditLockedSections?: boolean;
|
|
150
|
+
canEditLockedBlocks?: boolean;
|
|
151
|
+
canRemoveFiles?: boolean;
|
|
152
|
+
};
|
|
153
|
+
ecm?: {
|
|
154
|
+
articleFeeds?: string;
|
|
155
|
+
articles?: string;
|
|
156
|
+
dataFeeds?: string;
|
|
157
|
+
showArticleBlock?: boolean;
|
|
158
|
+
};
|
|
159
|
+
removeTopBar?: boolean;
|
|
160
|
+
renameTemplate?: boolean;
|
|
161
|
+
role?: "manager" | "editor" | "reader";
|
|
162
|
+
savedSections?: ISavedSection[] | boolean | null;
|
|
163
|
+
showControlPanelExpand?: boolean;
|
|
164
|
+
showUnsavedDialogBeforeExit?: boolean;
|
|
165
|
+
smartMergeTags?: {
|
|
166
|
+
enabled: boolean;
|
|
167
|
+
patterns?: Record<string, SmartMergeTagPattern>;
|
|
168
|
+
syntax?: {
|
|
169
|
+
start: string;
|
|
170
|
+
end: string;
|
|
171
|
+
};
|
|
172
|
+
};
|
|
173
|
+
syncedSectionsEnabled?: boolean;
|
|
174
|
+
teamUsers?: IUser[];
|
|
175
|
+
templateId?: number | string;
|
|
176
|
+
testingEmails?: boolean | string[];
|
|
177
|
+
textEditor?: "tinymce" | "tiptap";
|
|
178
|
+
textEditorToolbarBottomPosition?: "left" | "center" | "right";
|
|
179
|
+
textOverride?: Record<string, string>;
|
|
180
|
+
theme?: ITheme;
|
|
181
|
+
tinyConfig?: unknown;
|
|
182
|
+
tiptapConfig?: {
|
|
183
|
+
light?: boolean;
|
|
184
|
+
showMergeTagText?: boolean;
|
|
185
|
+
};
|
|
186
|
+
title?: string;
|
|
187
|
+
hideTopbarControls?: string[];
|
|
188
|
+
windowBar?: Array<string>;
|
|
189
|
+
}
|
|
190
|
+
export {};
|