@templatical/import-beefree 0.52.1 → 0.54.0
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/index.d.ts +63 -4
- package/dist/index.js +544 -47
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,18 +1,37 @@
|
|
|
1
|
+
type BeeFreeTranslations = Record<string, Record<string, unknown>>;
|
|
1
2
|
/**
|
|
2
3
|
* BeeFree JSON type definitions.
|
|
3
4
|
* Based on the BeeFree export format used by the BEE Plugin / BEE Pro editor.
|
|
4
5
|
*/
|
|
5
6
|
interface BeeFreeTemplate {
|
|
7
|
+
head?: {
|
|
8
|
+
meta?: {
|
|
9
|
+
preheader?: string;
|
|
10
|
+
translations?: BeeFreeTranslations;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
language?: {
|
|
14
|
+
label?: string;
|
|
15
|
+
value: string;
|
|
16
|
+
};
|
|
6
17
|
page: BeeFreeePage;
|
|
7
18
|
comments?: Record<string, unknown>;
|
|
8
19
|
}
|
|
9
20
|
interface BeeFreeePage {
|
|
21
|
+
language?: {
|
|
22
|
+
label?: string;
|
|
23
|
+
value: string;
|
|
24
|
+
};
|
|
10
25
|
title?: string;
|
|
11
26
|
description?: string;
|
|
12
27
|
rows: BeeFreeeRow[];
|
|
13
28
|
body?: BeeFreeeBody;
|
|
14
29
|
}
|
|
15
30
|
interface BeeFreeeBody {
|
|
31
|
+
language?: {
|
|
32
|
+
label?: string;
|
|
33
|
+
value: string;
|
|
34
|
+
};
|
|
16
35
|
type?: string;
|
|
17
36
|
webFonts?: BeeFreeeWebFont[];
|
|
18
37
|
content?: {
|
|
@@ -50,6 +69,7 @@ interface BeeFreeeColumn {
|
|
|
50
69
|
modules: BeeFreeeModule[];
|
|
51
70
|
}
|
|
52
71
|
interface BeeFreeeModule {
|
|
72
|
+
translations?: BeeFreeTranslations;
|
|
53
73
|
type: string;
|
|
54
74
|
locked?: boolean;
|
|
55
75
|
uuid?: string;
|
|
@@ -57,7 +77,12 @@ interface BeeFreeeModule {
|
|
|
57
77
|
}
|
|
58
78
|
interface BeeFreeeModuleDescriptor {
|
|
59
79
|
style?: Record<string, string>;
|
|
60
|
-
|
|
80
|
+
/**
|
|
81
|
+
* Values BeeFree computed for the module. Numbers appear in older exports
|
|
82
|
+
* (`width: 187.5`), and the Icons module nests objects (`iconSpacing`), so
|
|
83
|
+
* every reader checks the type it needs.
|
|
84
|
+
*/
|
|
85
|
+
computedStyle?: Record<string, unknown>;
|
|
61
86
|
text?: BeeFreeeTextContent;
|
|
62
87
|
paragraph?: BeeFreeeTextContent;
|
|
63
88
|
heading?: BeeFreeeHeadingContent;
|
|
@@ -67,24 +92,33 @@ interface BeeFreeeModuleDescriptor {
|
|
|
67
92
|
divider?: BeeFreeeeDividerContent;
|
|
68
93
|
spacer?: BeeFreeeSpacerContent;
|
|
69
94
|
html?: BeeFreeeHtmlContent;
|
|
70
|
-
|
|
95
|
+
/** Social icons for the Social module, icon items for the Icons module. */
|
|
96
|
+
iconsList?: BeeFreeeSocialContent | BeeFreeeIconsContent;
|
|
71
97
|
video?: BeeFreeeVideoContent;
|
|
72
98
|
menu?: BeeFreeeMenuContent;
|
|
73
99
|
table?: BeeFreeeTableContent;
|
|
74
100
|
}
|
|
75
101
|
interface BeeFreeeTextContent {
|
|
102
|
+
translations?: BeeFreeTranslations;
|
|
76
103
|
style?: Record<string, string>;
|
|
77
104
|
computedStyle?: Record<string, string>;
|
|
78
105
|
html: string;
|
|
79
106
|
}
|
|
80
107
|
interface BeeFreeeHeadingContent {
|
|
108
|
+
translations?: BeeFreeTranslations;
|
|
81
109
|
title?: string;
|
|
82
110
|
text?: string;
|
|
83
111
|
style?: Record<string, string>;
|
|
84
112
|
}
|
|
85
113
|
interface BeeFreeeImageContent {
|
|
114
|
+
translations?: BeeFreeTranslations;
|
|
86
115
|
src: string;
|
|
87
116
|
href?: string;
|
|
117
|
+
/**
|
|
118
|
+
* Written by the GIPHY addon: the GIF's page on giphy.com, not a link the
|
|
119
|
+
* author set. The importer links an image from `href` only.
|
|
120
|
+
*/
|
|
121
|
+
url?: string;
|
|
88
122
|
alt?: string;
|
|
89
123
|
width?: string;
|
|
90
124
|
height?: string;
|
|
@@ -92,6 +126,7 @@ interface BeeFreeeImageContent {
|
|
|
92
126
|
style?: Record<string, string>;
|
|
93
127
|
}
|
|
94
128
|
interface BeeFreeeButtonContent {
|
|
129
|
+
translations?: BeeFreeTranslations;
|
|
95
130
|
label: string;
|
|
96
131
|
href?: string;
|
|
97
132
|
style?: Record<string, string>;
|
|
@@ -108,6 +143,23 @@ interface BeeFreeeHtmlContent {
|
|
|
108
143
|
interface BeeFreeeSocialContent {
|
|
109
144
|
icons: BeeFreeeSocialIcon[];
|
|
110
145
|
}
|
|
146
|
+
interface BeeFreeeIconsContent {
|
|
147
|
+
icons: BeeFreeeIconItem[];
|
|
148
|
+
}
|
|
149
|
+
/** An item of the Icons module (`mailup-bee-newsletter-modules-icons`). */
|
|
150
|
+
interface BeeFreeeIconItem {
|
|
151
|
+
/** The icon's image URL. */
|
|
152
|
+
image?: string;
|
|
153
|
+
alt?: string;
|
|
154
|
+
title?: string;
|
|
155
|
+
href?: string;
|
|
156
|
+
target?: string;
|
|
157
|
+
text?: string;
|
|
158
|
+
textPosition?: string;
|
|
159
|
+
/** The image file's own size, e.g. `"48px"`. */
|
|
160
|
+
width?: string;
|
|
161
|
+
height?: string;
|
|
162
|
+
}
|
|
111
163
|
interface BeeFreeeSocialIcon {
|
|
112
164
|
image?: {
|
|
113
165
|
title?: string;
|
|
@@ -121,12 +173,15 @@ interface BeeFreeeSocialIcon {
|
|
|
121
173
|
id?: string;
|
|
122
174
|
}
|
|
123
175
|
interface BeeFreeeVideoContent {
|
|
176
|
+
thumbAlt?: string;
|
|
177
|
+
translations?: BeeFreeTranslations;
|
|
124
178
|
src: string;
|
|
125
179
|
thumbnail?: string;
|
|
126
180
|
alt?: string;
|
|
127
181
|
style?: Record<string, string>;
|
|
128
182
|
}
|
|
129
183
|
interface BeeFreeeMenuContent {
|
|
184
|
+
translations?: BeeFreeTranslations;
|
|
130
185
|
items: BeeFreeeMenuItem[];
|
|
131
186
|
separator?: string;
|
|
132
187
|
separatorColor?: string;
|
|
@@ -186,6 +241,10 @@ interface ImportResult {
|
|
|
186
241
|
content: import("@templatical/types").TemplateContent;
|
|
187
242
|
report: ImportReport;
|
|
188
243
|
}
|
|
244
|
+
interface ConvertBeeFreeOptions {
|
|
245
|
+
/** Used when the source declares no default language. */
|
|
246
|
+
defaultLocale?: string;
|
|
247
|
+
}
|
|
189
248
|
/**
|
|
190
249
|
* Converts a BeeFree template JSON to Templatical TemplateContent.
|
|
191
250
|
*
|
|
@@ -207,6 +266,6 @@ interface ImportResult {
|
|
|
207
266
|
* console.log(report.warnings);
|
|
208
267
|
* ```
|
|
209
268
|
*/
|
|
210
|
-
export declare function convertBeeFreeTemplate(template: BeeFreeTemplate): ImportResult;
|
|
211
|
-
export type { BeeFreeTemplate, ConversionStatus, ImportReport, ImportReportEntry, ImportResult };
|
|
269
|
+
export declare function convertBeeFreeTemplate(template: BeeFreeTemplate, options?: ConvertBeeFreeOptions): ImportResult;
|
|
270
|
+
export type { BeeFreeTemplate, ConversionStatus, ConvertBeeFreeOptions, ImportReport, ImportReportEntry, ImportResult };
|
|
212
271
|
//# sourceMappingURL=index.d.ts.map
|