dom-to-pptx 1.0.5 → 1.0.6
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/CHANGELOG.md +22 -18
- package/Readme.md +288 -249
- package/SUPPORTED.md +50 -50
- package/dist/dom-to-pptx.bundle.js +30193 -31091
- package/dist/dom-to-pptx.cjs +1200 -1167
- package/dist/dom-to-pptx.min.js +1198 -1167
- package/dist/dom-to-pptx.mjs +1194 -1164
- package/package.json +73 -73
- package/rollup.config.js +56 -53
- package/src/image-processor.js +79 -76
- package/src/index.js +657 -657
- package/src/utils.js +479 -452
package/SUPPORTED.md
CHANGED
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
# Supported CSS & HTML
|
|
2
|
-
|
|
3
|
-
This document lists the common CSS features, Tailwind-like utility classes, and HTML elements that dom-to-pptx understands and maps to PowerPoint shapes/text.
|
|
4
|
-
|
|
5
|
-
Note: The library measures computed layout from the browser (getBoundingClientRect) and maps positions/sizes precisely to PPTX inches. If a CSS feature is not listed below it may still work because the browser computes layout and visual styles — the mapping focuses on visual fidelity.
|
|
6
|
-
|
|
7
|
-
## Supported HTML elements
|
|
8
|
-
|
|
9
|
-
- div, span, p, h1-h6
|
|
10
|
-
- img, svg
|
|
11
|
-
- ul, ol, li
|
|
12
|
-
- a
|
|
13
|
-
- button
|
|
14
|
-
- section, article, header, footer
|
|
15
|
-
- input (text), textarea (simple text extraction)
|
|
16
|
-
- figure, figcaption
|
|
17
|
-
|
|
18
|
-
## Supported CSS properties (rendered visually)
|
|
19
|
-
|
|
20
|
-
- background-color, background-image (linear-gradient)
|
|
21
|
-
- background-position, background-size (basic handling in gradients)
|
|
22
|
-
- color, opacity
|
|
23
|
-
- border, border
|
|
24
|
-
- box-shadow (outer shadows mapped to PPTX outer shadows)
|
|
25
|
-
- filter: blur() (soft-edge rendering via SVG)
|
|
26
|
-
- backdrop-filter: blur() (simulated via html2canvas snapshot)
|
|
27
|
-
- transform: rotate() (extraction of rotation angle)
|
|
28
|
-
- display, position, width, height, padding, margin
|
|
29
|
-
- text-align, vertical-align, white-space, text-transform
|
|
30
|
-
- font-family, font-size, font-weight, font-style, line-height
|
|
31
|
-
|
|
32
|
-
## Common utility/Tailwind-like classes (recognized by visual result)
|
|
33
|
-
|
|
34
|
-
These classes are examples; dom-to-pptx reads computed styles, so any combination that results in the same computed value will be supported.
|
|
35
|
-
|
|
36
|
-
- `rounded`, `rounded-sm`, `rounded-md`, `rounded-lg`, `rounded-xl`, `rounded-full`, `rounded-tr-*`, `rounded-bl-full`, etc.
|
|
37
|
-
- `bg-white`, `bg-slate-50`, `bg-indigo-50`, `bg-gradient-to-r`, `from-indigo-400`, `to-cyan-400`, etc. (linear-gradients are parsed)
|
|
38
|
-
- `shadow`, `shadow-md`, `shadow-lg`, `shadow-2xl` (box-shadow)
|
|
39
|
-
- `flex`, `grid`, `items-center`, `justify-center`, `gap-*`
|
|
40
|
-
- `p-4`, `px-6`, `py-2`, `m-4`
|
|
41
|
-
- `w-*`, `h-*` (fixed pixel/percentage/wrappers — computed width/height are used)
|
|
42
|
-
- `text-xs`, `text-sm`, `text-lg`, `font-bold`, `uppercase`, `italic`, `tracking-wide`
|
|
43
|
-
|
|
44
|
-
## Limitations
|
|
45
|
-
|
|
46
|
-
- Complex CSS animations/transitions are not exported — only the current computed visual state is captured.
|
|
47
|
-
- Some advanced CSS features (CSS variables used as colors, filters beyond blur) may not map 1:1.
|
|
48
|
-
- For images to be processed via canvas (rounded images), the source must be CORS-accessible (`Access-Control-Allow-Origin` header) or the image will be skipped or rendered as-is.
|
|
49
|
-
|
|
50
|
-
If a style or element is critical and you find it not behaving as expected, open an issue with a minimal repro and I'll add support or provide a workaround.
|
|
1
|
+
# Supported CSS & HTML
|
|
2
|
+
|
|
3
|
+
This document lists the common CSS features, Tailwind-like utility classes, and HTML elements that dom-to-pptx understands and maps to PowerPoint shapes/text.
|
|
4
|
+
|
|
5
|
+
Note: The library measures computed layout from the browser (getBoundingClientRect) and maps positions/sizes precisely to PPTX inches. If a CSS feature is not listed below it may still work because the browser computes layout and visual styles — the mapping focuses on visual fidelity.
|
|
6
|
+
|
|
7
|
+
## Supported HTML elements
|
|
8
|
+
|
|
9
|
+
- div, span, p, h1-h6
|
|
10
|
+
- img, svg
|
|
11
|
+
- ul, ol, li
|
|
12
|
+
- a
|
|
13
|
+
- button
|
|
14
|
+
- section, article, header, footer
|
|
15
|
+
- input (text), textarea (simple text extraction)
|
|
16
|
+
- figure, figcaption
|
|
17
|
+
|
|
18
|
+
## Supported CSS properties (rendered visually)
|
|
19
|
+
|
|
20
|
+
- background-color, background-image (linear-gradient)
|
|
21
|
+
- background-position, background-size (basic handling in gradients)
|
|
22
|
+
- color, opacity
|
|
23
|
+
- border, border-_-color, border-_-width, border-radius (per-corner)
|
|
24
|
+
- box-shadow (outer shadows mapped to PPTX outer shadows)
|
|
25
|
+
- filter: blur() (soft-edge rendering via SVG)
|
|
26
|
+
- backdrop-filter: blur() (simulated via html2canvas snapshot)
|
|
27
|
+
- transform: rotate() (extraction of rotation angle)
|
|
28
|
+
- display, position, width, height, padding, margin
|
|
29
|
+
- text-align, vertical-align, white-space, text-transform
|
|
30
|
+
- font-family, font-size, font-weight, font-style, line-height
|
|
31
|
+
|
|
32
|
+
## Common utility/Tailwind-like classes (recognized by visual result)
|
|
33
|
+
|
|
34
|
+
These classes are examples; dom-to-pptx reads computed styles, so any combination that results in the same computed value will be supported.
|
|
35
|
+
|
|
36
|
+
- `rounded`, `rounded-sm`, `rounded-md`, `rounded-lg`, `rounded-xl`, `rounded-full`, `rounded-tr-*`, `rounded-bl-full`, etc.
|
|
37
|
+
- `bg-white`, `bg-slate-50`, `bg-indigo-50`, `bg-gradient-to-r`, `from-indigo-400`, `to-cyan-400`, etc. (linear-gradients are parsed)
|
|
38
|
+
- `shadow`, `shadow-md`, `shadow-lg`, `shadow-2xl` (box-shadow)
|
|
39
|
+
- `flex`, `grid`, `items-center`, `justify-center`, `gap-*`
|
|
40
|
+
- `p-4`, `px-6`, `py-2`, `m-4`
|
|
41
|
+
- `w-*`, `h-*` (fixed pixel/percentage/wrappers — computed width/height are used)
|
|
42
|
+
- `text-xs`, `text-sm`, `text-lg`, `font-bold`, `uppercase`, `italic`, `tracking-wide`
|
|
43
|
+
|
|
44
|
+
## Limitations
|
|
45
|
+
|
|
46
|
+
- Complex CSS animations/transitions are not exported — only the current computed visual state is captured.
|
|
47
|
+
- Some advanced CSS features (CSS variables used as colors, filters beyond blur) may not map 1:1.
|
|
48
|
+
- For images to be processed via canvas (rounded images), the source must be CORS-accessible (`Access-Control-Allow-Origin` header) or the image will be skipped or rendered as-is.
|
|
49
|
+
|
|
50
|
+
If a style or element is critical and you find it not behaving as expected, open an issue with a minimal repro and I'll add support or provide a workaround.
|