math-rich-editor-pack 0.1.3 → 0.1.4

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 CHANGED
@@ -64,6 +64,10 @@ export default function QuestionForm() {
64
64
  - `result.success`: `boolean`
65
65
  - `result.warnings`: `string[]`
66
66
  - `result.error`: `string | null`
67
+ - `onDocxUnsupported(payload)`
68
+ - `payload.items`: unsupported DOCX object summary (`chart`, `smartArt`, `shape`, `vmlShape`)
69
+ - `payload.extractedMediaCount`: number
70
+ - `payload.extractedMediaNames`: string[]
67
71
 
68
72
  ## Ref Methods (Imperative API)
69
73
 
@@ -76,7 +80,7 @@ const editorRef = useRef(null)
76
80
  Available methods:
77
81
 
78
82
  - `loadFromHtml(html: string): boolean`
79
- - `loadFromDocx(fileOrBuffer: File | Blob | ArrayBuffer): Promise<{ source, success, warnings, error }>`
83
+ - `loadFromDocx(fileOrBuffer: File | Blob | ArrayBuffer): Promise<{ source, success, warnings, error, html, unsupported }>`
80
84
  - `getContent(): { html, json, text, latexList } | null`
81
85
 
82
86
  Example:
@@ -93,6 +97,16 @@ if (file) {
93
97
  const current = editorRef.current?.getContent()
94
98
  ```
95
99
 
100
+ ## DOCX Support Notes
101
+
102
+ - Fully supported: regular text, formatting, lists, tables, OMML equations.
103
+ - Partially supported: charts, SmartArt, geometry/shapes.
104
+ - For unsupported objects:
105
+ - editor inserts readable fallback text markers (so users know content was present)
106
+ - warnings are returned in `onLoadResult`
107
+ - `onDocxUnsupported` returns structured unsupported details
108
+ - media from `word/media` is extracted and attached as fallback preview when unsupported objects are detected
109
+
96
110
  ## Props
97
111
 
98
112
  - `initialContent`: HTML string or Tiptap JSON doc
@@ -124,4 +138,3 @@ npm run build
124
138
  npm pack
125
139
  npm publish --access public
126
140
  ```
127
-