@extend-ai/react-docx 0.9.1 → 0.9.2
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 +19 -0
- package/dist/index.cjs +970 -636
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +28 -3
- package/dist/index.d.ts +28 -3
- package/dist/index.js +969 -636
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -190,6 +190,25 @@ function FullEditor() {
|
|
|
190
190
|
}
|
|
191
191
|
```
|
|
192
192
|
|
|
193
|
+
## Responsive zoom
|
|
194
|
+
|
|
195
|
+
Both viewer components accept numeric percentages and responsive zoom modes.
|
|
196
|
+
Responsive modes remain selected while the viewer recalculates their resolved
|
|
197
|
+
percentage as its viewport or page layout changes.
|
|
198
|
+
|
|
199
|
+
```tsx
|
|
200
|
+
const Viewer = ReactDocxViewer;
|
|
201
|
+
|
|
202
|
+
<Viewer defaultZoom="fit-width" />
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
Use `zoom` with `onZoomChange` for a controlled viewer, or `defaultZoom` for an
|
|
206
|
+
uncontrolled viewer. The available modes are `"automatic"`, `"fit-page"`, and
|
|
207
|
+
`"fit-width"`. Custom editor toolbars can use `editor.setZoom(level)`,
|
|
208
|
+
`editor.getZoom()`, and `editor.getResolvedZoom()`. When zooming in or out from
|
|
209
|
+
a responsive mode, calculate the next numeric percentage from
|
|
210
|
+
`editor.getResolvedZoom()` and pass it to `editor.setZoom()`.
|
|
211
|
+
|
|
193
212
|
`renderPage` supports `canvas`, `blob`, and `imageBitmap` output. Pass `canvas`
|
|
194
213
|
to draw into a caller-owned canvas without an encoding round trip. Its timings
|
|
195
214
|
separate pagination, page mounting, rasterization, and encoding; the parsed
|