@templatical/import-beefree 0.54.1 → 0.55.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/README.md CHANGED
@@ -22,8 +22,9 @@ const beefreeJson = await fetch('/path/to/beefree-template.json').then(r => r.js
22
22
 
23
23
  const result = convertBeeFreeTemplate(beefreeJson);
24
24
 
25
- console.log(result.content); // → Templatical TemplateContent
26
- console.log(result.report); // → conversion report (per-module status, warnings, summary)
25
+ console.log(result.content); // → Templatical TemplateContent
26
+ console.log(result.report); // → conversion report (per-module status, warnings, summary)
27
+ console.log(result.customFonts); // → { name, url }[] for fonts.customFonts and render
27
28
 
28
29
  // Inspect modules that didn't convert cleanly
29
30
  for (const entry of result.report.entries) {
@@ -59,11 +60,11 @@ Unknown or partially-supported modules are flagged in `result.report` so you can
59
60
 
60
61
  ## API
61
62
 
62
- - `convertBeeFreeTemplate(template)` — converts a BeeFree JSON template, returns `{ content, report }`
63
+ - `convertBeeFreeTemplate(template)` — converts a BeeFree JSON template, returns `{ content, report, customFonts }`
63
64
 
64
65
  Types:
65
66
  - `BeeFreeTemplate` — input shape (see source for full structure)
66
- - `ImportResult` — `{ content: TemplateContent, report: ImportReport }`
67
+ - `ImportResult` — `{ content: TemplateContent, report: ImportReport, customFonts: CustomFont[] }`
67
68
  - `ImportReport` — `{ entries: ImportReportEntry[], warnings: string[], summary: { total, converted, approximated, htmlFallback, skipped } }`
68
69
  - `ImportReportEntry` — `{ beeFreeModuleType, templaticalBlockType, status, note? }`
69
70
  - `ConversionStatus` — `'converted' | 'approximated' | 'html-fallback' | 'skipped'`
package/dist/index.d.ts CHANGED
@@ -166,6 +166,10 @@ interface BeeFreeeSocialIcon {
166
166
  src?: string;
167
167
  href?: string;
168
168
  alt?: string;
169
+ target?: string;
170
+ /** The icon file's size. A number of px, or a px length. */
171
+ width?: string | number;
172
+ height?: string | number;
169
173
  };
170
174
  name?: string;
171
175
  text?: string;
@@ -240,6 +244,12 @@ interface ImportReport {
240
244
  interface ImportResult {
241
245
  content: import("@templatical/types").TemplateContent;
242
246
  report: ImportReport;
247
+ /**
248
+ * Web fonts to load, taken from `page.body.webFonts` entries that carry a
249
+ * URL. A host passes them to the editor's `fonts.customFonts` and to
250
+ * `render`. System stacks and `inherit` are left out.
251
+ */
252
+ customFonts: import("@templatical/types").CustomFont[];
243
253
  }
244
254
  interface ConvertBeeFreeOptions {
245
255
  /** Used when the source declares no default language. */