@uniweb/press 0.4.17 → 1.0.1
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/package.json +1 -1
- package/src/typst/Sequence.jsx +17 -0
package/package.json
CHANGED
package/src/typst/Sequence.jsx
CHANGED
|
@@ -107,6 +107,23 @@ function renderElement(element, key) {
|
|
|
107
107
|
/>
|
|
108
108
|
)
|
|
109
109
|
|
|
110
|
+
case 'document':
|
|
111
|
+
// A file, not a picture. In print it can only be shown, not opened:
|
|
112
|
+
// its preview when it has one, captioned with its name — and
|
|
113
|
+
// nothing when it has none, as a video is skipped. Until 2026-09-29
|
|
114
|
+
// the parser delivered a document as an image, and this printed
|
|
115
|
+
// the file itself as one.
|
|
116
|
+
if (!element.attrs?.preview) return null
|
|
117
|
+
return (
|
|
118
|
+
<Image
|
|
119
|
+
key={key}
|
|
120
|
+
src={element.attrs.preview}
|
|
121
|
+
alt=""
|
|
122
|
+
caption={element.attrs.caption || element.attrs.alt}
|
|
123
|
+
id={element.attrs.id || undefined}
|
|
124
|
+
/>
|
|
125
|
+
)
|
|
126
|
+
|
|
110
127
|
// Skipped: dataBlock (not prose), video (not in print), inset (Phase 3).
|
|
111
128
|
default:
|
|
112
129
|
return null
|