@extend-ai/react-docx 0.7.0-alpha.6 → 0.7.0-alpha.8
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 +11 -8
- package/dist/index.cjs +1330 -123
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +27 -1
- package/dist/index.d.ts +27 -1
- package/dist/index.js +1330 -123
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -158,7 +158,7 @@ export function EditorExample() {
|
|
|
158
158
|
|
|
159
159
|
## Thumbnail Hook
|
|
160
160
|
|
|
161
|
-
The library can expose page thumbnails
|
|
161
|
+
The library can expose page thumbnails so you can build your own page strip, mini-map, or navigation UI. Thumbnail painting can render from the live page surface when it is mounted, or from an offscreen one-page surface when viewer virtualization has unmounted that page.
|
|
162
162
|
|
|
163
163
|
```tsx
|
|
164
164
|
import * as React from "react";
|
|
@@ -174,6 +174,11 @@ export function ThumbnailExample() {
|
|
|
174
174
|
maxWidthPx: 160,
|
|
175
175
|
maxHeightPx: 220,
|
|
176
176
|
pixelRatio: 2,
|
|
177
|
+
minRasterIntervalMs: 40,
|
|
178
|
+
renderWindow: {
|
|
179
|
+
visiblePageIndexes: [0, 1, 2],
|
|
180
|
+
prefetchPageIndexes: [3, 4, 5],
|
|
181
|
+
},
|
|
177
182
|
});
|
|
178
183
|
|
|
179
184
|
return (
|
|
@@ -194,10 +199,7 @@ export function ThumbnailExample() {
|
|
|
194
199
|
))}
|
|
195
200
|
</div>
|
|
196
201
|
|
|
197
|
-
<DocxEditorViewer
|
|
198
|
-
editor={editor}
|
|
199
|
-
pageVirtualization={{ enabled: false }}
|
|
200
|
-
/>
|
|
202
|
+
<DocxEditorViewer editor={editor} />
|
|
201
203
|
</div>
|
|
202
204
|
);
|
|
203
205
|
}
|
|
@@ -205,10 +207,11 @@ export function ThumbnailExample() {
|
|
|
205
207
|
|
|
206
208
|
Notes:
|
|
207
209
|
|
|
208
|
-
-
|
|
210
|
+
- Thumbnail canvases can stay attached in a virtualized sidebar; only canvases you mount request paint work.
|
|
211
|
+
- Use `renderWindow.visiblePageIndexes` for thumbnails currently visible in your sidebar, and `renderWindow.prefetchPageIndexes` to warm nearby pages after visible work.
|
|
212
|
+
- `minRasterIntervalMs` controls repeat renders for the same canvas. Lower values are useful when the consumer already limits thumbnail work to a small visible window.
|
|
209
213
|
- Thumbnail sizing is bounded by `maxWidthPx` and `maxHeightPx`, so downstream UIs can bias toward portrait thumbnail rails.
|
|
210
|
-
-
|
|
211
|
-
- For a full thumbnail rail, disable virtualization or manage the visible page range yourself.
|
|
214
|
+
- Thumbnails use a direct layout/model canvas renderer first; if a page has no usable snapshot, the hook falls back to an isolated offscreen page surface.
|
|
212
215
|
|
|
213
216
|
## Useful Hooks
|
|
214
217
|
|