@bendyline/squisq-formats 2.8.8 → 2.8.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.
Files changed (40) hide show
  1. package/README.md +15 -13
  2. package/dist/chunk-4LIFEQKX.js +358 -0
  3. package/dist/{chunk-UXEANVBI.js → chunk-5HUHSLGA.js} +1 -84
  4. package/dist/{chunk-BXWNU4T5.js → chunk-DTJQK7U7.js} +43 -0
  5. package/dist/{chunk-GDUZJ75A.js → chunk-MJTPWLVV.js} +59 -21
  6. package/dist/{chunk-6ALSRHD7.js → chunk-NCDY3EOL.js} +66 -9
  7. package/dist/{chunk-TMOXUUTG.js → chunk-NQNIFIDP.js} +6 -4
  8. package/dist/{chunk-LK4KCVN6.js → chunk-QPJHAMOW.js} +70 -28
  9. package/dist/{chunk-QU4EVC62.js → chunk-S5VXWSRR.js} +1 -1
  10. package/dist/{chunk-KROH7FNT.js → chunk-VKLJUHC2.js} +6 -4
  11. package/dist/chunk-YRFBWYAD.js +128 -0
  12. package/dist/{chunk-SVYTUYZM.js → chunk-ZJERBWTB.js} +6 -4
  13. package/dist/data/index.d.ts +27 -5
  14. package/dist/data/index.js +6 -2
  15. package/dist/diagrams/index.d.ts +19 -8
  16. package/dist/diagrams/index.js +7 -242
  17. package/dist/docx/index.d.ts +1 -1
  18. package/dist/docx/index.js +3 -3
  19. package/dist/epub/index.d.ts +1 -1
  20. package/dist/epub/index.js +3 -3
  21. package/dist/fontAwesome-C6FRDYTY.js +14 -0
  22. package/dist/html/icons.d.ts +29 -0
  23. package/dist/html/icons.js +62 -0
  24. package/dist/html/index.d.ts +3 -130
  25. package/dist/html/index.js +2 -2
  26. package/dist/html/prepare.d.ts +97 -0
  27. package/dist/html/prepare.js +85 -0
  28. package/dist/index.d.ts +2 -0
  29. package/dist/index.js +16 -16
  30. package/dist/{materialize-G4WC5UG3.js → materialize-ICXNO4S4.js} +4 -1
  31. package/dist/outside-in/index.d.ts +12 -0
  32. package/dist/outside-in/index.js +3 -3
  33. package/dist/pdf/index.d.ts +1 -1
  34. package/dist/pdf/index.js +3 -3
  35. package/dist/plainHtml-B6IXcSet.d.ts +148 -0
  36. package/dist/pptx/index.js +2 -2
  37. package/dist/readers-3P5A6A2A.js +17 -0
  38. package/dist/registry/index.js +1 -1
  39. package/package.json +12 -2
  40. /package/dist/{chunk-LBXBRFBZ.js → chunk-DDMPZZJF.js} +0 -0
@@ -0,0 +1,148 @@
1
+ import { HtmlPolicy, MarkdownDocument } from '@bendyline/squisq/markdown';
2
+ import { Theme, ThemeRegistry } from '@bendyline/squisq/schemas';
3
+
4
+ /**
5
+ * Plain HTML Export — semantic, player-free
6
+ *
7
+ * Renders a MarkdownDocument to a self-contained HTML string. Unlike
8
+ * `docToHtml` (which bundles the SquisqPlayer IIFE and renders SVG block
9
+ * cards), this output is what a reader-mode tool would produce: semantic
10
+ * `<h1>`/`<p>`/`<ul>`/etc. with a small embedded stylesheet, no JS, no
11
+ * runtime path-rewriting. Drives both the "Page" preview tab in the
12
+ * editor and the plain-style branch of the export dialog so what users
13
+ * see live matches the file they download.
14
+ *
15
+ * Image URLs default to the markdown's own paths. Pass `images` to
16
+ * substitute a different value per source URL — typically pre-resolved
17
+ * blob URLs (live preview) or data URIs (single-file export).
18
+ */
19
+
20
+ interface PlainHtmlExportOptions {
21
+ /** Document title — populates `<title>` and is HTML-escaped. */
22
+ title?: string;
23
+ /**
24
+ * Substitution map for image `src` URLs. Keys are the URL exactly as
25
+ * it appears in the markdown source; values are the URL to emit in
26
+ * the rendered `<img src>`. URLs not present in the map fall through
27
+ * unchanged (so external `https://…` references still work).
28
+ */
29
+ images?: Map<string, string>;
30
+ /**
31
+ * Substitution map for anchor `href` URLs. Keys are the URL exactly
32
+ * as it appears in the markdown source (e.g. `'resume.md'`,
33
+ * `'resume.md#experience'`); values are the URL to emit. URLs not in
34
+ * the map pass through unchanged. Used by the recursive bundle
35
+ * exporter to rewrite `.md` references to `.html` so a static export
36
+ * of a linked document tree is internally browsable.
37
+ */
38
+ links?: Map<string, string>;
39
+ /**
40
+ * Optional Squisq theme. When provided, the rendered page uses the
41
+ * theme's colors and typography, and any Google-hosted fonts the
42
+ * theme references are loaded via a `<link>` to fonts.googleapis.com
43
+ * so the face renders correctly without host preloads.
44
+ *
45
+ * When omitted, the function falls back (in order) to {@link themeId}
46
+ * and then to `doc.frontmatter.themeId` — so an authored
47
+ * `themeId: warm-earth` in the doc's frontmatter styles the export
48
+ * automatically, without the caller having to wire theme resolution
49
+ * themselves.
50
+ */
51
+ theme?: Theme;
52
+ /**
53
+ * Optional theme id (e.g. `'warm-earth'`, `'gezellig'`). Convenient
54
+ * for hosts whose export dialog tracks themes by id — they can pass
55
+ * the id straight through instead of resolving to a `Theme` object.
56
+ * When both `theme` and `themeId` are provided, `theme` wins.
57
+ */
58
+ themeId?: string;
59
+ /** Explicit caller-owned registry for non-document custom themes. */
60
+ themeRegistry?: ThemeRegistry;
61
+ /**
62
+ * Optional FontAwesome CSS text to inline into the rendered page,
63
+ * replacing the default cross-origin `<link>` to cdnjs. Required for
64
+ * sandboxed iframe previews where tracking prevention or stricter
65
+ * origin policies can silently drop cross-origin font fetches —
66
+ * inlining keeps the icons resolvable purely from same-origin
67
+ * resources. Hosts typically gather this string by scraping
68
+ * `document.styleSheets` for `@font-face` rules whose family starts
69
+ * with `"Font Awesome"`. A CDN `<link>` is emitted only when this option
70
+ * is absent and {@link externalResources} is explicitly `allow`.
71
+ */
72
+ iconsCss?: string;
73
+ /**
74
+ * Whether this exporter may add remote font/icon stylesheets. Defaults to
75
+ * `deny`, keeping the generated file self-contained. Authored links and
76
+ * images are unaffected; bundle exporters are responsible for inlining or
77
+ * rewriting those document resources.
78
+ */
79
+ externalResources?: 'deny' | 'allow';
80
+ /**
81
+ * Raw HTML policy. Defaults to `sanitize`, which removes unsafe tags,
82
+ * event handlers, and executable URL schemes before emitting HTML.
83
+ */
84
+ htmlPolicy?: HtmlPolicy;
85
+ /**
86
+ * How a hosted video (a paragraph that is only a link to a YouTube, Vimeo,
87
+ * Loom or Wistia page, or that provider's `<iframe>` embed
88
+ * code) renders:
89
+ *
90
+ * - `player` (default) — the provider's player iframe;
91
+ * - `poster` — a static card linking to the video's page (the provider's
92
+ * thumbnail where it serves one). For contexts where a player cannot run:
93
+ * a preview iframe sandboxed without `allow-scripts` (nested frames
94
+ * inherit the sandbox, so the player would load broken), or print.
95
+ */
96
+ videoEmbeds?: 'player' | 'poster';
97
+ /**
98
+ * Inline icons as SVG, keyed `family:name` (`solid:star`) — the `icons` that
99
+ * `prepareMarkdownDocForPlainHtml` (`@bendyline/squisq-formats/html-prepare`)
100
+ * returns when given `outlineIcons`, or `plainHtmlIcons` from
101
+ * `@bendyline/squisq-formats/html-icons` called directly. An icon found here
102
+ * is drawn as an inline `<svg>` in the text color and needs no Font Awesome
103
+ * stylesheet; any other icon keeps its Font Awesome markup (see
104
+ * {@link iconsCss}).
105
+ */
106
+ icons?: ReadonlyMap<string, PlainHtmlIcon>;
107
+ }
108
+ /** One icon's outline: an SVG path in a `0 0 width height` box whose height is 1em. */
109
+ interface PlainHtmlIcon {
110
+ width: number;
111
+ height: number;
112
+ path: string;
113
+ }
114
+ /**
115
+ * Render a parsed markdown document as a complete, semantic HTML page.
116
+ *
117
+ * When `options.theme` is provided, the output adopts the theme's
118
+ * colors and typography. Google-hosted fonts referenced by the theme
119
+ * are loaded via a single `<link>` to fonts.googleapis.com so the page
120
+ * renders consistently when opened standalone.
121
+ */
122
+ declare function markdownDocToPlainHtml(doc: MarkdownDocument, options?: PlainHtmlExportOptions): string;
123
+ /**
124
+ * The pieces of a plain HTML page that belong to the document itself, for a
125
+ * host that places the document inside a page of its own (see
126
+ * `applyHtmlPageTemplate`).
127
+ */
128
+ interface PlainHtmlParts {
129
+ /** The `title` option, unescaped. */
130
+ title: string;
131
+ /** The rendered document body, footnotes included. */
132
+ bodyHtml: string;
133
+ /**
134
+ * `<head>` markup for the CSS the body's own constructs need — feature
135
+ * sections, video embeds, SVG islands, icons — and nothing that styles the
136
+ * page around them: no theme typography, colors, fonts, or `body` rules.
137
+ */
138
+ featureHeadHtml: string;
139
+ }
140
+ /**
141
+ * Render a document's body and the functional CSS it depends on, without the
142
+ * page shell or theme stylesheet `markdownDocToPlainHtml` wraps around them.
143
+ * The theme (when one resolves) still informs body rendering, such as the
144
+ * color an SVG island's `currentColor` follows.
145
+ */
146
+ declare function markdownDocToPlainHtmlParts(doc: MarkdownDocument, options?: PlainHtmlExportOptions): PlainHtmlParts;
147
+
148
+ export { type PlainHtmlIcon as P, type PlainHtmlExportOptions as a, type PlainHtmlParts as b, markdownDocToPlainHtmlParts as c, markdownDocToPlainHtml as m };
@@ -4,7 +4,7 @@ import {
4
4
  pptxToContainer,
5
5
  pptxToDoc,
6
6
  pptxToMarkdownDoc
7
- } from "../chunk-QU4EVC62.js";
7
+ } from "../chunk-S5VXWSRR.js";
8
8
  import {
9
9
  analyzePptxLayouts,
10
10
  inspectPptxLayouts
@@ -18,7 +18,7 @@ import "../chunk-JU2RHXUB.js";
18
18
  import "../chunk-S5PCVMKU.js";
19
19
  import "../chunk-7AWFHP5U.js";
20
20
  import "../chunk-IIQYS2YH.js";
21
- import "../chunk-LBXBRFBZ.js";
21
+ import "../chunk-DDMPZZJF.js";
22
22
  import "../chunk-JZR32FON.js";
23
23
  export {
24
24
  analyzePptxLayouts,
@@ -0,0 +1,17 @@
1
+ import {
2
+ csvDataReader,
3
+ defaultDataReaders,
4
+ parquetDataReader,
5
+ xlsxDataReader
6
+ } from "./chunk-5HUHSLGA.js";
7
+ import "./chunk-ATWVNF7D.js";
8
+ import "./chunk-Q77KNJIN.js";
9
+ import "./chunk-DXYWKZ52.js";
10
+ import "./chunk-S5PCVMKU.js";
11
+ import "./chunk-7AWFHP5U.js";
12
+ export {
13
+ csvDataReader,
14
+ defaultDataReaders,
15
+ parquetDataReader,
16
+ xlsxDataReader
17
+ };
@@ -9,7 +9,7 @@ import {
9
9
  defaultRegistry,
10
10
  prepareConversion,
11
11
  resolveConversionLimits
12
- } from "../chunk-GDUZJ75A.js";
12
+ } from "../chunk-MJTPWLVV.js";
13
13
  import {
14
14
  ConversionError
15
15
  } from "../chunk-KXOZMWBS.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bendyline/squisq-formats",
3
- "version": "2.8.8",
3
+ "version": "2.8.10",
4
4
  "description": "Document format converters — DOCX, PDF, OOXML import/export",
5
5
  "license": "MIT",
6
6
  "author": "Bendyline",
@@ -83,6 +83,16 @@
83
83
  "import": "./dist/html/index.js",
84
84
  "default": "./dist/html/index.js"
85
85
  },
86
+ "./html-icons": {
87
+ "types": "./dist/html/icons.d.ts",
88
+ "import": "./dist/html/icons.js",
89
+ "default": "./dist/html/icons.js"
90
+ },
91
+ "./html-prepare": {
92
+ "types": "./dist/html/prepare.d.ts",
93
+ "import": "./dist/html/prepare.js",
94
+ "default": "./dist/html/prepare.js"
95
+ },
86
96
  "./epub": {
87
97
  "types": "./dist/epub/index.d.ts",
88
98
  "import": "./dist/epub/index.js",
@@ -125,7 +135,7 @@
125
135
  "typecheck": "tsc --noEmit"
126
136
  },
127
137
  "dependencies": {
128
- "@bendyline/squisq": "2.13.7",
138
+ "@bendyline/squisq": "2.13.8",
129
139
  "@pdf-lib/fontkit": "1.1.1",
130
140
  "@pdf-lib/upng": "1.0.1",
131
141
  "@xmldom/xmldom": "0.9.12",
File without changes