@superdoc-dev/react 1.10.0-next.24 → 1.10.0-next.25
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 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -49,6 +49,25 @@ function App() {
|
|
|
49
49
|
}
|
|
50
50
|
```
|
|
51
51
|
|
|
52
|
+
## File prop component
|
|
53
|
+
|
|
54
|
+
When an agent needs to create a React wrapper around a DOCX `File`, use this shape:
|
|
55
|
+
|
|
56
|
+
```tsx
|
|
57
|
+
import { SuperDocEditor } from '@superdoc-dev/react';
|
|
58
|
+
import '@superdoc-dev/react/style.css';
|
|
59
|
+
|
|
60
|
+
export function ContractEditor({ file }: { file: File }) {
|
|
61
|
+
return (
|
|
62
|
+
<SuperDocEditor
|
|
63
|
+
document={file}
|
|
64
|
+
documentMode="editing"
|
|
65
|
+
onReady={({ superdoc }) => console.log('Ready', superdoc)}
|
|
66
|
+
/>
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
```
|
|
70
|
+
|
|
52
71
|
## Changing Mode
|
|
53
72
|
|
|
54
73
|
Just update the `documentMode` prop - the component handles it efficiently (no rebuild):
|
|
@@ -209,4 +228,3 @@ Types are extracted from the `superdoc` package, ensuring they stay in sync.
|
|
|
209
228
|
## License
|
|
210
229
|
|
|
211
230
|
AGPL-3.0
|
|
212
|
-
|