@topol.io/editor 1.0.0-alpha.0 → 1.0.0-alpha.10
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 +150 -101
- package/dist/topol-plugin.es.js +131 -190
- package/dist/topol-plugin.umd.cjs +1 -0
- package/dist/types/src/core/script-loader.d.ts +15 -0
- package/dist/types/src/email-editor/constants.d.ts +3 -3
- package/dist/types/src/email-editor/index.d.ts +15 -90
- package/dist/types/src/landing-page-editor/index.d.ts +18 -6
- 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/pluginOptions/pluginOptionsSchema.d.ts +89 -0
- 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 +14 -68
- 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 +20 -17
- package/dist/types/types/Callbacks/IEmailCallbacks.d.ts +65 -104
- package/dist/types/types/Cloud/ICloudOptions.d.ts +32 -0
- package/dist/types/types/ContentBlock/IContentBlockOptions.d.ts +1 -1
- package/dist/types/types/Countdown/ICountdownOptions.d.ts +48 -0
- package/dist/types/types/IEmailConfig.d.ts +199 -0
- package/dist/types/types/IEmailEditorInstance.d.ts +54 -0
- package/dist/types/types/ITopolOptions.d.ts +4 -120
- package/dist/types/types/ITopolPlugin.d.ts +2 -37
- package/dist/types/types/Language/Language.d.ts +6 -1
- package/dist/types/types/SavedBlock/ISavedBlock.d.ts +2 -6
- package/dist/types/types/Sections/ISections.d.ts +30 -0
- package/dist/types/types/landing-page/ILandingPageEditorInstance.d.ts +12 -4
- package/dist/types/types/landing-page/ILandingPageOptions.d.ts +96 -58
- package/package.json +10 -13
- package/dist/topol-plugin.umd.js +0 -1
package/dist/types/src/main.d.ts
CHANGED
|
@@ -1,74 +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: () => 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
|
-
toggleChatAI: () => void;
|
|
66
|
-
toggleAutosaves: () => void;
|
|
67
|
-
toggleComments: () => void;
|
|
68
|
-
createLanguage: (lang: string) => void;
|
|
69
|
-
setPrimaryLanguage: (lang: string) => void;
|
|
70
|
-
deleteLanguage: (lang: string) => void;
|
|
71
|
-
selectLanguage: (lang: string) => void;
|
|
9
|
+
init(options: ITopolOptions, pluginOptions?: import("./email-editor").IEmailEditorPluginOptions | undefined): Promise<import("../types/IEmailEditorInstance").default>;
|
|
72
10
|
};
|
|
73
11
|
import { LandingPageEditor } from "./landing-page-editor";
|
|
74
12
|
import type ITopolOptions from "../types/ITopolOptions";
|
|
@@ -78,6 +16,7 @@ import type ISavedBlock from "../types/SavedBlock/ISavedBlock";
|
|
|
78
16
|
import type IMergeTagGroup from "../types/MergeTag/IMergeTagGroup";
|
|
79
17
|
import type IMergeTag from "../types/MergeTag/IMergeTag";
|
|
80
18
|
import type { IContentBlockOptions } from "../types/ContentBlock/IContentBlockOptions";
|
|
19
|
+
import type { ICountdownOptions, ICountdownDefaultColors, ICountdownDateMergeTag } from "../types/Countdown/ICountdownOptions";
|
|
81
20
|
import type ITheme from "../types/Theme/ITheme";
|
|
82
21
|
import type IAuthHeaderConfig from "../types/AuthHeaderConfig/IAuthHeaderConfig";
|
|
83
22
|
import type IFont from "../types/Font/IFont";
|
|
@@ -86,16 +25,23 @@ import type ICustomBlockData from "../types/CustomBlocks/CustomBlocks";
|
|
|
86
25
|
import { Stage } from "../types/Stage";
|
|
87
26
|
import type { ISaveData, IErrorData, ISendTestData } from "../types/Callbacks/ICallbackPayloads";
|
|
88
27
|
import type ILandingPageOptions from "../types/landing-page/ILandingPageOptions";
|
|
89
|
-
import type { ILandingPageCallbacks } from "../types/landing-page/ILandingPageOptions";
|
|
28
|
+
import type { ILandingPageCallbacks, ILandingPageSavePayload, ILandingPageDeletedItem, ILandingPageErrorPayload } from "../types/landing-page/ILandingPageOptions";
|
|
90
29
|
import type ILandingPageEditorInstance from "../types/landing-page/ILandingPageEditorInstance";
|
|
91
30
|
import type { TopolSection } from "./landing-page-editor/schemas/template/structure/sectionSchema";
|
|
92
31
|
export default TopolPlugin;
|
|
93
32
|
/**
|
|
94
|
-
* @deprecated Use `EmailEditor` instead. `TopolPlugin` is an alias
|
|
33
|
+
* @deprecated Use `EmailEditor` instead. `TopolPlugin` is an alias as a naming alias.
|
|
95
34
|
*/
|
|
96
35
|
export { TopolPlugin };
|
|
97
36
|
export { EmailEditor };
|
|
98
37
|
export { LandingPageEditor };
|
|
99
|
-
export type { ITopolOptions, IEmailCallbacks, INotification, ISavedBlock, IMergeTagGroup, IMergeTag, IContentBlockOptions, ITheme, IAuthHeaderConfig, IFont, IAPI, ICustomBlockData, Stage as IStage };
|
|
38
|
+
export type { ITopolOptions, IEmailCallbacks, INotification, ISavedBlock, IMergeTagGroup, IMergeTag, IContentBlockOptions, ICountdownOptions, ICountdownDefaultColors, ICountdownDateMergeTag, ITheme, IAuthHeaderConfig, IFont, IAPI, ICustomBlockData, Stage as IStage, };
|
|
100
39
|
export type { ISaveData, IErrorData, ISendTestData };
|
|
101
|
-
export type { ILandingPageOptions, ILandingPageCallbacks, ILandingPageEditorInstance, TopolSection };
|
|
40
|
+
export type { ILandingPageOptions, ILandingPageCallbacks, ILandingPageEditorInstance, TopolSection, ILandingPageSavePayload, ILandingPageDeletedItem, ILandingPageErrorPayload };
|
|
41
|
+
export type { default as IEmailConfig } from "../types/IEmailConfig";
|
|
42
|
+
export type { default as IEmailEditorInstance, IUpdateTemplateOptions } from "../types/IEmailEditorInstance";
|
|
43
|
+
export type { IEmailEditorPluginOptions } from "./email-editor";
|
|
44
|
+
export type { INonceAuthCallbacks } from "../types/Auth/INonceAuthCallbacks";
|
|
45
|
+
export type { ICloudFeatures, ICloudOptions, ICloudCallbacks, ICloudSavePayload, ICloudTemplateChangePayload } from "../types/Cloud/ICloudOptions";
|
|
46
|
+
export type { ISavedSection, IPremadeSection, IPremadeSections, ILegacyPremadeSections, IPremadeSectionsOptions } from "../types/Sections/ISections";
|
|
47
|
+
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,29 +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;
|
|
9
|
+
mutations?: ILanguageMutation[];
|
|
10
|
+
syncedSections?: number[];
|
|
12
11
|
}
|
|
13
|
-
/**
|
|
14
|
-
* Payload for onError callback.
|
|
15
|
-
* Used when transforming (type, message) arguments into a single object.
|
|
16
|
-
*/
|
|
17
12
|
export interface IErrorData {
|
|
18
|
-
|
|
13
|
+
source: string;
|
|
19
14
|
message: string;
|
|
15
|
+
detail?: unknown;
|
|
20
16
|
}
|
|
21
|
-
/**
|
|
22
|
-
* Payload for onTestSend callback (Email Editor only).
|
|
23
|
-
* Used when transforming (email, json, html) arguments into a single object.
|
|
24
|
-
*/
|
|
25
17
|
export interface ISendTestData {
|
|
26
18
|
email: string | string[];
|
|
27
19
|
json: unknown;
|
|
28
20
|
html: unknown;
|
|
29
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,109 +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
|
-
* @param html - The generated HTML output
|
|
17
|
-
*/
|
|
18
|
-
onSaveAndClose?(json: unknown, html: unknown): void;
|
|
19
|
-
/**
|
|
20
|
-
* Called when the user sends a test email.
|
|
21
|
-
* @param email - The email address(es) to send to
|
|
22
|
-
* @param json - The email template JSON structure
|
|
23
|
-
* @param html - The generated HTML output
|
|
24
|
-
*/
|
|
25
|
-
onTestSend?(email: string | string[], json: unknown, html: unknown): void;
|
|
26
|
-
/**
|
|
27
|
-
* Called when the user clicks the banner (free version only).
|
|
28
|
-
* @param json - The email template JSON structure
|
|
29
|
-
* @param html - The generated HTML output
|
|
30
|
-
*/
|
|
31
|
-
onBannerClick?(json: unknown, html: unknown): void;
|
|
32
|
-
/**
|
|
33
|
-
* Called when the custom file manager should be opened.
|
|
34
|
-
*/
|
|
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;
|
|
35
15
|
onOpenFileManager?(): void;
|
|
36
|
-
/**
|
|
37
|
-
* Called when the editor has finished loading.
|
|
38
|
-
*/
|
|
39
16
|
onLoaded?(): void;
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
* @param blockId - The ID of the block being edited
|
|
53
|
-
*/
|
|
54
|
-
onBlockEdit?(blockId: number): void;
|
|
55
|
-
/**
|
|
56
|
-
* Called when the editor is initialized.
|
|
57
|
-
*/
|
|
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;
|
|
58
29
|
onInit?(): void;
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
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
|
-
* Called when testing email addresses are updated.
|
|
100
|
-
* @param emails - The updated email addresses
|
|
101
|
-
*/
|
|
102
|
-
updateTestingEmailAddresses?(emails: string[]): void;
|
|
103
|
-
/**
|
|
104
|
-
* Called when an error occurs.
|
|
105
|
-
* @param type - The error type
|
|
106
|
-
* @param message - The error message
|
|
107
|
-
*/
|
|
108
|
-
onError?(type: string, message: string): 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;
|
|
109
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,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Palette of newly created countdowns. Any subset of `background`, `digits`, `labels`
|
|
3
|
+
* and `accent` as hex colors (`#RGB`, `#RRGGBB` or `#RRGGBBAA`); unset colors keep the
|
|
4
|
+
* editor defaults (white background, black text, purple accent).
|
|
5
|
+
*/
|
|
6
|
+
export interface ICountdownDefaultColors {
|
|
7
|
+
background?: string;
|
|
8
|
+
digits?: string;
|
|
9
|
+
labels?: string;
|
|
10
|
+
accent?: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* A merge tag of your ESP that can supply the end date of a dynamic countdown.
|
|
14
|
+
* The `value` goes into the countdown image URL verbatim (`?end_date_time={tag}`)
|
|
15
|
+
* and must produce an RFC 3339 date once the ESP substitutes it.
|
|
16
|
+
*/
|
|
17
|
+
export interface ICountdownDateMergeTag {
|
|
18
|
+
/** Name shown to the user when picking the tag. */
|
|
19
|
+
label: string;
|
|
20
|
+
/**
|
|
21
|
+
* The tag itself. `{seconds}` in it is replaced with the countdown length the user
|
|
22
|
+
* sets (e.g. `*|SEND_DATE+{seconds}|*`); without it the tag is inserted as is
|
|
23
|
+
* (e.g. `*|RESERVATION_UNTIL|*`). At most 200 characters, no quotes, `<`, `>` or `&`.
|
|
24
|
+
*/
|
|
25
|
+
value: string;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Countdown block settings of the host. The block itself is switched on with
|
|
29
|
+
* `enableCountdown`. See https://docs.topol.io/email-editor/reference/topol-options#countdown
|
|
30
|
+
*/
|
|
31
|
+
export interface ICountdownOptions {
|
|
32
|
+
/** Palette of newly created countdowns (any subset); unset colors keep the package defaults. */
|
|
33
|
+
defaultColors?: ICountdownDefaultColors;
|
|
34
|
+
/** Base URL of a custom style thumbnail set: the editor loads `{base}/{style}.gif` for every countdown style. */
|
|
35
|
+
styleThumbnailBase?: string;
|
|
36
|
+
/**
|
|
37
|
+
* Merge tag the evergreen countdowns' recipient key is rendered with (verbatim, no quotes).
|
|
38
|
+
* Use a value that is stable and unique per recipient, ideally a contact ID
|
|
39
|
+
* (e.g. `*|CONTACT_ID|*`). Unset = the recipient's email address in the syntax of
|
|
40
|
+
* `emailServiceProvider`. At most 100 characters.
|
|
41
|
+
*/
|
|
42
|
+
mergeTag?: string;
|
|
43
|
+
/**
|
|
44
|
+
* Merge tags a dynamic countdown's deadline (`end_date_time`) can come from;
|
|
45
|
+
* `{seconds}` in a value = the countdown length the user sets. Unset = no dynamic mode.
|
|
46
|
+
*/
|
|
47
|
+
dateMergeTags?: ICountdownDateMergeTag[];
|
|
48
|
+
}
|
|
@@ -0,0 +1,199 @@
|
|
|
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 { ICountdownOptions } from "./Countdown/ICountdownOptions";
|
|
8
|
+
import type ITheme from "./Theme/ITheme";
|
|
9
|
+
import type IAuthHeaderConfig from "./AuthHeaderConfig/IAuthHeaderConfig";
|
|
10
|
+
import type IFont from "./Font/IFont";
|
|
11
|
+
import type ICustomBlockData from "./CustomBlocks/CustomBlocks";
|
|
12
|
+
import type { Language, IMultilingualLanguage } from "./Language/Language";
|
|
13
|
+
import type IMergeTag from "./MergeTag/IMergeTag";
|
|
14
|
+
import type SmartMergeTagPattern from "./MergeTag/SmartMergeTagPattern";
|
|
15
|
+
import type IUser from "./User/User";
|
|
16
|
+
import type IHelpdesk from "./Helpdesk/Helpdesk";
|
|
17
|
+
type TopolTagAttribute = "font-family" | "font-size" | "font-weight" | "font-style" | "letter-spacing" | "text-transform" | "text-decoration" | "background-color" | "color" | "border-collapse";
|
|
18
|
+
type DefaultTemplateLangsSchema = {
|
|
19
|
+
code: string;
|
|
20
|
+
primary: boolean;
|
|
21
|
+
}[];
|
|
22
|
+
/**
|
|
23
|
+
* Configuration options for the Email Editor (TopolPlugin).
|
|
24
|
+
*/
|
|
25
|
+
export default interface IEmailConfig {
|
|
26
|
+
authorize: {
|
|
27
|
+
apiKey: string;
|
|
28
|
+
/** URL-safe [A-Za-z0-9_-]+ string or a non-negative integer. */
|
|
29
|
+
userId: string | number;
|
|
30
|
+
};
|
|
31
|
+
aiLabeledElements?: boolean;
|
|
32
|
+
api?: IAPI;
|
|
33
|
+
apiAuthorizationHeader?: IAuthHeaderConfig | string;
|
|
34
|
+
apiBlocks?: Record<string, IAPIBlockProperties>;
|
|
35
|
+
autosaveInterval?: number;
|
|
36
|
+
betaFeatures?: {
|
|
37
|
+
carousel?: boolean;
|
|
38
|
+
loop?: boolean;
|
|
39
|
+
rating?: boolean;
|
|
40
|
+
};
|
|
41
|
+
chatAI?: boolean;
|
|
42
|
+
chatAIOnSegment?: boolean;
|
|
43
|
+
cloud?: ICloudOptions;
|
|
44
|
+
colors?: Array<string>;
|
|
45
|
+
contentBlocks?: IContentBlockOptions;
|
|
46
|
+
/** Countdown block settings of the host (the block itself is gated by `enableCountdown`). */
|
|
47
|
+
countdown?: ICountdownOptions;
|
|
48
|
+
currentUser?: IUser;
|
|
49
|
+
customBlocks?: ICustomBlockData[];
|
|
50
|
+
customFileManager?: boolean;
|
|
51
|
+
customFonts?: {
|
|
52
|
+
override?: boolean;
|
|
53
|
+
fonts: Array<IFont>;
|
|
54
|
+
};
|
|
55
|
+
customLanguagePreset?: {
|
|
56
|
+
langs: IMultilingualLanguage;
|
|
57
|
+
override?: boolean;
|
|
58
|
+
};
|
|
59
|
+
defaultTemplateSettings?: {
|
|
60
|
+
emailWidth?: number;
|
|
61
|
+
emailBackgroundColor?: string;
|
|
62
|
+
blockBackgroundColor?: string;
|
|
63
|
+
buttonsBackgroundColor?: string;
|
|
64
|
+
hyperlinkColor?: string;
|
|
65
|
+
h1?: {
|
|
66
|
+
[key in TopolTagAttribute]?: string;
|
|
67
|
+
};
|
|
68
|
+
h2?: {
|
|
69
|
+
[key in TopolTagAttribute]?: string;
|
|
70
|
+
};
|
|
71
|
+
h3?: {
|
|
72
|
+
[key in TopolTagAttribute]?: string;
|
|
73
|
+
};
|
|
74
|
+
p?: {
|
|
75
|
+
[key in TopolTagAttribute]?: string;
|
|
76
|
+
};
|
|
77
|
+
button?: Record<string, unknown>;
|
|
78
|
+
carousel?: Record<string, unknown>;
|
|
79
|
+
divider?: Record<string, unknown>;
|
|
80
|
+
gif?: Record<string, unknown>;
|
|
81
|
+
image?: Record<string, unknown>;
|
|
82
|
+
loop?: Record<string, unknown>;
|
|
83
|
+
social?: Record<string, unknown>;
|
|
84
|
+
text?: Record<string, unknown>;
|
|
85
|
+
column?: Record<string, unknown>;
|
|
86
|
+
section?: Record<string, unknown>;
|
|
87
|
+
"line-height"?: number;
|
|
88
|
+
"structure-margin"?: string;
|
|
89
|
+
"stack-columns"?: boolean;
|
|
90
|
+
langs?: DefaultTemplateLangsSchema;
|
|
91
|
+
};
|
|
92
|
+
disableAiAssistant?: boolean;
|
|
93
|
+
disableAlerts?: boolean;
|
|
94
|
+
disableExtendedComparators?: boolean;
|
|
95
|
+
emailServiceProvider?: "mailchimp" | "sparkpost";
|
|
96
|
+
enableAutosaves?: boolean;
|
|
97
|
+
enableComments?: boolean;
|
|
98
|
+
/**
|
|
99
|
+
* Opt-in for the Countdown block, a paid add-on rolled out per user: the block only appears
|
|
100
|
+
* when the add-on flag your backend put into the editor nonce is set **and** this option is
|
|
101
|
+
* `true`, and it also needs `templateId`.
|
|
102
|
+
*/
|
|
103
|
+
enableCountdown?: boolean;
|
|
104
|
+
enableDarkMode?: boolean;
|
|
105
|
+
enableFileManagerInGif?: boolean;
|
|
106
|
+
enableSubjectLine?: boolean;
|
|
107
|
+
enableImageToTextRatio?: boolean;
|
|
108
|
+
enableMergeTagPreview?: boolean;
|
|
109
|
+
enableSectionVariants?: boolean;
|
|
110
|
+
enableTemplateSizeInfo?: boolean;
|
|
111
|
+
fileManagerPreferences?: {
|
|
112
|
+
defaultTilesView?: boolean;
|
|
113
|
+
hidePexelsIntegration?: boolean;
|
|
114
|
+
maxUploadingFiles?: number;
|
|
115
|
+
};
|
|
116
|
+
fontSizes?: Array<number>;
|
|
117
|
+
googleApiKey?: string;
|
|
118
|
+
googlePromotionalAnnotation?: boolean;
|
|
119
|
+
helpdesk?: IHelpdesk;
|
|
120
|
+
hideSettingsTab?: boolean;
|
|
121
|
+
hideControlPanel?: boolean;
|
|
122
|
+
htmlDesktopFirst?: boolean;
|
|
123
|
+
htmlMinified?: boolean;
|
|
124
|
+
imageCompressionOptions?: {
|
|
125
|
+
qualityJpeg?: number;
|
|
126
|
+
qualityPng?: number;
|
|
127
|
+
enableAutoResize?: boolean;
|
|
128
|
+
enableCompression?: boolean;
|
|
129
|
+
};
|
|
130
|
+
imageEditor?: boolean;
|
|
131
|
+
imageEditorV2?: boolean;
|
|
132
|
+
imageEditorOptions?: {
|
|
133
|
+
hideControls?: Array<string>;
|
|
134
|
+
};
|
|
135
|
+
imageMaxSize?: number;
|
|
136
|
+
lambdaStage?: "local" | "production" | "stage1" | "stage2" | "stage3" | "v4";
|
|
137
|
+
language?: Language;
|
|
138
|
+
languageMergeTag?: string;
|
|
139
|
+
light?: boolean;
|
|
140
|
+
logicalOperatorsInsideVariant?: boolean;
|
|
141
|
+
mainMenuAlign?: "left" | "right";
|
|
142
|
+
mergeTags?: Array<IMergeTagGroup | IMergeTag>;
|
|
143
|
+
mobileFirstEnabled?: boolean;
|
|
144
|
+
multilingual?: boolean;
|
|
145
|
+
premadeSections?: IPremadeSectionsOptions;
|
|
146
|
+
premadeTemplates?: boolean;
|
|
147
|
+
premadeTemplatesOptions?: {
|
|
148
|
+
hideSearch?: boolean;
|
|
149
|
+
showDelete?: boolean;
|
|
150
|
+
};
|
|
151
|
+
productMergetagTags?: {
|
|
152
|
+
label: string;
|
|
153
|
+
value: string;
|
|
154
|
+
}[];
|
|
155
|
+
permissions?: {
|
|
156
|
+
canLockBlocks?: boolean;
|
|
157
|
+
canLockSections?: boolean;
|
|
158
|
+
canEditLockedSections?: boolean;
|
|
159
|
+
canEditLockedBlocks?: boolean;
|
|
160
|
+
canRemoveFiles?: boolean;
|
|
161
|
+
};
|
|
162
|
+
ecm?: {
|
|
163
|
+
articleFeeds?: string;
|
|
164
|
+
articles?: string;
|
|
165
|
+
dataFeeds?: string;
|
|
166
|
+
showArticleBlock?: boolean;
|
|
167
|
+
};
|
|
168
|
+
removeTopBar?: boolean;
|
|
169
|
+
renameTemplate?: boolean;
|
|
170
|
+
role?: "manager" | "editor" | "reader";
|
|
171
|
+
savedSections?: ISavedSection[] | boolean | null;
|
|
172
|
+
showControlPanelExpand?: boolean;
|
|
173
|
+
showUnsavedDialogBeforeExit?: boolean;
|
|
174
|
+
smartMergeTags?: {
|
|
175
|
+
enabled: boolean;
|
|
176
|
+
patterns?: Record<string, SmartMergeTagPattern>;
|
|
177
|
+
syntax?: {
|
|
178
|
+
start: string;
|
|
179
|
+
end: string;
|
|
180
|
+
};
|
|
181
|
+
};
|
|
182
|
+
syncedSectionsEnabled?: boolean;
|
|
183
|
+
teamUsers?: IUser[];
|
|
184
|
+
templateId?: number | string;
|
|
185
|
+
testingEmails?: boolean | string[];
|
|
186
|
+
textEditor?: "tinymce" | "tiptap";
|
|
187
|
+
textEditorToolbarBottomPosition?: "left" | "center" | "right";
|
|
188
|
+
textOverride?: Record<string, string>;
|
|
189
|
+
theme?: ITheme;
|
|
190
|
+
tinyConfig?: unknown;
|
|
191
|
+
tiptapConfig?: {
|
|
192
|
+
light?: boolean;
|
|
193
|
+
showMergeTagText?: boolean;
|
|
194
|
+
};
|
|
195
|
+
title?: string;
|
|
196
|
+
hideTopbarControls?: string[];
|
|
197
|
+
windowBar?: Array<string>;
|
|
198
|
+
}
|
|
199
|
+
export {};
|