erl-mathtextx-editor 0.1.6 → 0.1.7
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 +253 -251
- package/dist/{CellPropertiesDialogImpl-CHemDwqM.js → CellPropertiesDialogImpl-HPT77uxM.js} +1 -1
- package/dist/{ContentViewer-CsFSAN_B.js → ContentViewer-CWZ30KYR.js} +15 -15
- package/dist/ImageInsertDialog-DzLFhSDK.js +217 -0
- package/dist/{InsertTableDialogImpl-65qn7ajF.js → InsertTableDialogImpl-DZrLgDKN.js} +1 -1
- package/dist/{LinkDialogImpl-BXNEtesu.js → LinkDialogImpl-DTHugWZM.js} +45 -60
- package/dist/{TableTemplatesDialogImpl-Djt0R6Hh.js → TableTemplatesDialogImpl-D0sFSAKl.js} +1 -1
- package/dist/assets/erl-mathtextx-editor.css +1 -1
- package/dist/assets/viewer.css +1 -1
- package/dist/erl-mathtextx-editor.js +2 -2
- package/dist/erl-mathtextx-editor.umd.cjs +131 -131
- package/dist/{index-wMMXFiRr.js → index-Ci20X1Rj.js} +454 -478
- package/dist/viewer.js +1 -1
- package/package.json +133 -133
- package/dist/ImageInsertDialog-CJPVdXtW.js +0 -238
- package/dist/math/MathFieldView.d.ts +0 -5
- package/dist/utils/logger.d.ts +0 -46
package/README.md
CHANGED
|
@@ -1,251 +1,253 @@
|
|
|
1
|
-
# erl-mathtextx-editor
|
|
2
|
-
|
|
3
|
-
**Visual Math Editor Component — Zero LaTeX Required**
|
|
4
|
-
|
|
5
|
-
[](https://www.npmjs.com/package/erl-mathtextx-editor)
|
|
6
|
-
[](https://opensource.org/licenses/MIT)
|
|
7
|
-
|
|
8
|
-
Embeddable visual math editor widget untuk CMS dan platform edukasi. User tidak perlu tahu LaTeX — semua input matematika dilakukan secara visual.
|
|
9
|
-
|
|
10
|
-
---
|
|
11
|
-
|
|
12
|
-
## ✨ Fitur Utama
|
|
13
|
-
|
|
14
|
-
- 🎯 **Visual Math Keyboard** — Klik simbol, operator, template formula
|
|
15
|
-
- 📝 **Rich Text Editor** — Bold, italic, tables, lists, links, images
|
|
16
|
-
- 🧮 **100+ Formula Templates** — Algebra, calculus, trigonometry, chemistry
|
|
17
|
-
- 👁️ **Content Viewer** — Read-only renderer dengan KaTeX
|
|
18
|
-
- 🎨 **Table Editor** — 6 professional table templates
|
|
19
|
-
- ⌨️ **Keyboard Shortcuts** — Ctrl+K (link), Ctrl+Shift+T (table), Ctrl+S (save)
|
|
20
|
-
|
|
21
|
-
---
|
|
22
|
-
|
|
23
|
-
## 📦 Installation
|
|
24
|
-
|
|
25
|
-
```bash
|
|
26
|
-
npm install erl-mathtextx-editor
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
---
|
|
30
|
-
|
|
31
|
-
## 🚀 Quick Start
|
|
32
|
-
|
|
33
|
-
### Basic Usage
|
|
34
|
-
|
|
35
|
-
```tsx
|
|
36
|
-
import { MathTextXEditor } from 'erl-mathtextx-editor'
|
|
37
|
-
import 'erl-mathtextx-editor/styles'
|
|
38
|
-
|
|
39
|
-
function App() {
|
|
40
|
-
return (
|
|
41
|
-
<MathTextXEditor
|
|
42
|
-
onChange={(html) => console.log(html)}
|
|
43
|
-
placeholder="Tulis soal di sini..."
|
|
44
|
-
/>
|
|
45
|
-
)
|
|
46
|
-
}
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
### With Save Handler
|
|
50
|
-
|
|
51
|
-
```tsx
|
|
52
|
-
import { MathTextXEditor, getHTML } from 'erl-mathtextx-editor'
|
|
53
|
-
import 'erl-mathtextx-editor/styles'
|
|
54
|
-
|
|
55
|
-
function QuestionForm() {
|
|
56
|
-
const handleSave = (html) => {
|
|
57
|
-
// Send to your API
|
|
58
|
-
fetch('/api/questions', {
|
|
59
|
-
method: 'POST',
|
|
60
|
-
headers: { 'Content-Type': 'application/json' },
|
|
61
|
-
body: JSON.stringify({ content: html }),
|
|
62
|
-
})
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
return (
|
|
66
|
-
<MathTextXEditor
|
|
67
|
-
onChange={(html) => console.log(html)}
|
|
68
|
-
onSave={handleSave}
|
|
69
|
-
placeholder="Tulis pertanyaan..."
|
|
70
|
-
/>
|
|
71
|
-
)
|
|
72
|
-
}
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
### Content Viewer (Read-Only)
|
|
76
|
-
|
|
77
|
-
```tsx
|
|
78
|
-
import { ContentViewer } from 'erl-mathtextx-editor/viewer'
|
|
79
|
-
import 'erl-mathtextx-editor/styles'
|
|
80
|
-
|
|
81
|
-
function QuestionCard({ questionHtml }) {
|
|
82
|
-
return (
|
|
83
|
-
<div className="question-card">
|
|
84
|
-
<h3>Soal 1</h3>
|
|
85
|
-
<ContentViewer content={questionHtml} />
|
|
86
|
-
</div>
|
|
87
|
-
)
|
|
88
|
-
}
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
- **
|
|
105
|
-
- **
|
|
106
|
-
- **
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
|
117
|
-
|
|
118
|
-
| `
|
|
119
|
-
| `
|
|
120
|
-
| `
|
|
121
|
-
| `
|
|
122
|
-
| `
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
|
138
|
-
|
|
139
|
-
| `Ctrl+
|
|
140
|
-
| `Ctrl+
|
|
141
|
-
| `Ctrl+
|
|
142
|
-
| `Ctrl+
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
import '
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
{ id: '
|
|
159
|
-
{ id: '
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
- **
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
```
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
1
|
+
# erl-mathtextx-editor
|
|
2
|
+
|
|
3
|
+
**Visual Math Editor Component — Zero LaTeX Required**
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/erl-mathtextx-editor)
|
|
6
|
+
[](https://opensource.org/licenses/MIT)
|
|
7
|
+
|
|
8
|
+
Embeddable visual math editor widget untuk CMS dan platform edukasi. User tidak perlu tahu LaTeX — semua input matematika dilakukan secara visual.
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## ✨ Fitur Utama
|
|
13
|
+
|
|
14
|
+
- 🎯 **Visual Math Keyboard** — Klik simbol, operator, template formula
|
|
15
|
+
- 📝 **Rich Text Editor** — Bold, italic, tables, lists, links, images
|
|
16
|
+
- 🧮 **100+ Formula Templates** — Algebra, calculus, trigonometry, chemistry
|
|
17
|
+
- 👁️ **Content Viewer** — Read-only renderer dengan KaTeX
|
|
18
|
+
- 🎨 **Table Editor** — 6 professional table templates
|
|
19
|
+
- ⌨️ **Keyboard Shortcuts** — Ctrl+K (link), Ctrl+Shift+T (table), Ctrl+S (save)
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## 📦 Installation
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
npm install erl-mathtextx-editor
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## 🚀 Quick Start
|
|
32
|
+
|
|
33
|
+
### Basic Usage
|
|
34
|
+
|
|
35
|
+
```tsx
|
|
36
|
+
import { MathTextXEditor } from 'erl-mathtextx-editor'
|
|
37
|
+
import 'erl-mathtextx-editor/styles'
|
|
38
|
+
|
|
39
|
+
function App() {
|
|
40
|
+
return (
|
|
41
|
+
<MathTextXEditor
|
|
42
|
+
onChange={(html) => console.log(html)}
|
|
43
|
+
placeholder="Tulis soal di sini..."
|
|
44
|
+
/>
|
|
45
|
+
)
|
|
46
|
+
}
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### With Save Handler
|
|
50
|
+
|
|
51
|
+
```tsx
|
|
52
|
+
import { MathTextXEditor, getHTML } from 'erl-mathtextx-editor'
|
|
53
|
+
import 'erl-mathtextx-editor/styles'
|
|
54
|
+
|
|
55
|
+
function QuestionForm() {
|
|
56
|
+
const handleSave = (html) => {
|
|
57
|
+
// Send to your API
|
|
58
|
+
fetch('/api/questions', {
|
|
59
|
+
method: 'POST',
|
|
60
|
+
headers: { 'Content-Type': 'application/json' },
|
|
61
|
+
body: JSON.stringify({ content: html }),
|
|
62
|
+
})
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
return (
|
|
66
|
+
<MathTextXEditor
|
|
67
|
+
onChange={(html) => console.log(html)}
|
|
68
|
+
onSave={handleSave}
|
|
69
|
+
placeholder="Tulis pertanyaan..."
|
|
70
|
+
/>
|
|
71
|
+
)
|
|
72
|
+
}
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### Content Viewer (Read-Only)
|
|
76
|
+
|
|
77
|
+
```tsx
|
|
78
|
+
import { ContentViewer } from 'erl-mathtextx-editor/viewer'
|
|
79
|
+
import 'erl-mathtextx-editor/viewer/styles'
|
|
80
|
+
|
|
81
|
+
function QuestionCard({ questionHtml }) {
|
|
82
|
+
return (
|
|
83
|
+
<div className="question-card">
|
|
84
|
+
<h3>Soal 1</h3>
|
|
85
|
+
<ContentViewer content={questionHtml} />
|
|
86
|
+
</div>
|
|
87
|
+
)
|
|
88
|
+
}
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
**Catatan:** Viewer memerlukan import CSS terpisah: `import 'erl-mathtextx-editor/viewer/styles'`
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
## 📖 Documentation
|
|
96
|
+
|
|
97
|
+
- [Quick Start Guide](https://github.com/erlangga/richtext-editor-research/blob/main/QUICK_START.md)
|
|
98
|
+
- [Integration Tutorial](https://github.com/erlangga/richtext-editor-research/blob/main/INTEGRATION_TUTORIAL.md)
|
|
99
|
+
|
|
100
|
+
---
|
|
101
|
+
|
|
102
|
+
## 🛠️ Tech Stack
|
|
103
|
+
|
|
104
|
+
- **UI Framework:** React 18+
|
|
105
|
+
- **Editor Engine:** TipTap / ProseMirror
|
|
106
|
+
- **Math Input:** MathLive (WYSIWYG math)
|
|
107
|
+
- **Math Rendering:** KaTeX
|
|
108
|
+
- **XSS Protection:** DOMPurify
|
|
109
|
+
|
|
110
|
+
---
|
|
111
|
+
|
|
112
|
+
## 📋 Props API
|
|
113
|
+
|
|
114
|
+
### MathTextXEditor
|
|
115
|
+
|
|
116
|
+
| Prop | Type | Default | Description |
|
|
117
|
+
|------|------|---------|-------------|
|
|
118
|
+
| `content` | `string` | `''` | Initial HTML content |
|
|
119
|
+
| `onChange` | `(html: string) => void` | — | Callback on content change |
|
|
120
|
+
| `onSave` | `(html: string) => void` | — | Callback on Ctrl+S |
|
|
121
|
+
| `placeholder` | `string` | `'Tulis soal...'` | Placeholder text |
|
|
122
|
+
| `minHeight` | `string` | `'200px'` | Minimum editor height |
|
|
123
|
+
| `maxHeight` | `string` | — | Maximum editor height |
|
|
124
|
+
| `onImageUpload` | `(file: File) => Promise<string>` | — | Custom image upload handler |
|
|
125
|
+
|
|
126
|
+
### ContentViewer
|
|
127
|
+
|
|
128
|
+
| Prop | Type | Default | Description |
|
|
129
|
+
|------|------|---------|-------------|
|
|
130
|
+
| `content` | `string` | — | HTML content to render (required) |
|
|
131
|
+
| `className` | `string` | — | Additional CSS class |
|
|
132
|
+
|
|
133
|
+
---
|
|
134
|
+
|
|
135
|
+
## ⌨️ Keyboard Shortcuts
|
|
136
|
+
|
|
137
|
+
| Shortcut | Action |
|
|
138
|
+
|----------|--------|
|
|
139
|
+
| `Ctrl+K` | Insert/edit link |
|
|
140
|
+
| `Ctrl+Shift+T` | Insert table |
|
|
141
|
+
| `Ctrl+S` | Save document |
|
|
142
|
+
| `Ctrl+B` | Bold |
|
|
143
|
+
| `Ctrl+I` | Italic |
|
|
144
|
+
| `Ctrl+U` | Underline |
|
|
145
|
+
|
|
146
|
+
---
|
|
147
|
+
|
|
148
|
+
## 🎯 Example: Multiple Choice Question Form
|
|
149
|
+
|
|
150
|
+
```tsx
|
|
151
|
+
import { useState } from 'react'
|
|
152
|
+
import { MathTextXEditor } from 'erl-mathtextx-editor'
|
|
153
|
+
import 'erl-mathtextx-editor/styles'
|
|
154
|
+
|
|
155
|
+
export default function QuestionForm() {
|
|
156
|
+
const [question, setQuestion] = useState('')
|
|
157
|
+
const [options, setOptions] = useState([
|
|
158
|
+
{ id: 'A', content: '', isCorrect: false },
|
|
159
|
+
{ id: 'B', content: '', isCorrect: false },
|
|
160
|
+
{ id: 'C', content: '', isCorrect: false },
|
|
161
|
+
{ id: 'D', content: '', isCorrect: false },
|
|
162
|
+
])
|
|
163
|
+
|
|
164
|
+
const handleSubmit = async () => {
|
|
165
|
+
await fetch('/api/questions', {
|
|
166
|
+
method: 'POST',
|
|
167
|
+
headers: { 'Content-Type': 'application/json' },
|
|
168
|
+
body: JSON.stringify({ question, options }),
|
|
169
|
+
})
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
return (
|
|
173
|
+
<div>
|
|
174
|
+
<h2>Buat Soal Pilihan Ganda</h2>
|
|
175
|
+
|
|
176
|
+
{/* Question */}
|
|
177
|
+
<MathTextXEditor
|
|
178
|
+
content={question}
|
|
179
|
+
onChange={setQuestion}
|
|
180
|
+
placeholder="Tulis pertanyaan..."
|
|
181
|
+
minHeight="150px"
|
|
182
|
+
/>
|
|
183
|
+
|
|
184
|
+
{/* Options */}
|
|
185
|
+
{options.map((option) => (
|
|
186
|
+
<div key={option.id}>
|
|
187
|
+
<label>
|
|
188
|
+
<input
|
|
189
|
+
type="radio"
|
|
190
|
+
name="correct"
|
|
191
|
+
checked={option.isCorrect}
|
|
192
|
+
onChange={() => {
|
|
193
|
+
setOptions(prev =>
|
|
194
|
+
prev.map(o => ({
|
|
195
|
+
...o,
|
|
196
|
+
isCorrect: o.id === option.id
|
|
197
|
+
}))
|
|
198
|
+
)
|
|
199
|
+
}}
|
|
200
|
+
/>
|
|
201
|
+
Opsi {option.id}
|
|
202
|
+
</label>
|
|
203
|
+
<MathTextXEditor
|
|
204
|
+
content={option.content}
|
|
205
|
+
onChange={(html) => {
|
|
206
|
+
setOptions(prev =>
|
|
207
|
+
prev.map(o =>
|
|
208
|
+
o.id === option.id ? { ...o, content: html } : o
|
|
209
|
+
)
|
|
210
|
+
)
|
|
211
|
+
}}
|
|
212
|
+
placeholder={`Jawaban ${option.id}...`}
|
|
213
|
+
minHeight="80px"
|
|
214
|
+
/>
|
|
215
|
+
</div>
|
|
216
|
+
))}
|
|
217
|
+
|
|
218
|
+
<button onClick={handleSubmit}>Simpan Soal</button>
|
|
219
|
+
</div>
|
|
220
|
+
)
|
|
221
|
+
}
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
---
|
|
225
|
+
|
|
226
|
+
## 🔗 Links
|
|
227
|
+
|
|
228
|
+
- **Website:** [erl-mathtextx-editor](https://github.com/erlangga/richtext-editor-research)
|
|
229
|
+
- **NPM:** [erl-mathtextx-editor](https://www.npmjs.com/package/erl-mathtextx-editor)
|
|
230
|
+
- **Issues:** [Report Bug](https://github.com/erlangga/richtext-editor-research/issues)
|
|
231
|
+
|
|
232
|
+
---
|
|
233
|
+
|
|
234
|
+
## 📄 License
|
|
235
|
+
|
|
236
|
+
[MIT](https://github.com/erlangga/richtext-editor-research/blob/main/LICENSE) © Erlangga Team
|
|
237
|
+
|
|
238
|
+
---
|
|
239
|
+
|
|
240
|
+
## 🎉 Ready to Use?
|
|
241
|
+
|
|
242
|
+
```bash
|
|
243
|
+
npm install erl-mathtextx-editor
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
Then import and use:
|
|
247
|
+
|
|
248
|
+
```tsx
|
|
249
|
+
import { MathTextXEditor } from 'erl-mathtextx-editor'
|
|
250
|
+
import 'erl-mathtextx-editor/styles'
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
Happy coding! 🚀
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as t, jsxs as l } from "react/jsx-runtime";
|
|
2
2
|
import z, { useId as H, useRef as A, useCallback as b, useState as d, useEffect as V } from "react";
|
|
3
|
-
import { u as B } from "./index-
|
|
3
|
+
import { u as B } from "./index-Ci20X1Rj.js";
|
|
4
4
|
const M = z.memo(({
|
|
5
5
|
isOpen: s,
|
|
6
6
|
initialData: i = {},
|
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useRef as
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as o, useMemo as i, useEffect as m } from "react";
|
|
3
3
|
import { p as s, k as l } from "./viewer-deps-CjbAqdti.js";
|
|
4
|
+
import "./viewer-styles.js";
|
|
4
5
|
function c(t) {
|
|
5
6
|
const e = t.getAttribute("data-latex") || t.getAttribute("latex");
|
|
6
7
|
if (!e) return;
|
|
7
|
-
const
|
|
8
|
+
const a = t.classList.contains("mtx-math-block");
|
|
8
9
|
try {
|
|
9
10
|
l.render(e, t, {
|
|
10
11
|
throwOnError: !1,
|
|
11
|
-
displayMode:
|
|
12
|
+
displayMode: a,
|
|
12
13
|
output: "htmlAndMathml"
|
|
13
14
|
});
|
|
14
15
|
} catch {
|
|
15
|
-
t.textContent =
|
|
16
|
+
t.textContent = a ? `$$${e}$$` : `$${e}$`;
|
|
16
17
|
}
|
|
17
18
|
}
|
|
18
|
-
function
|
|
19
|
-
const
|
|
19
|
+
function x({ content: t, className: e }) {
|
|
20
|
+
const a = o(null), r = i(
|
|
20
21
|
() => s.sanitize(t, {
|
|
21
22
|
ADD_TAGS: ["math-field", "span", "div"],
|
|
22
23
|
ADD_ATTR: ["data-latex", "latex", "data-type", "data-mathml"],
|
|
23
|
-
FORBID_TAGS: ["script", "style", "iframe", "object", "embed"]
|
|
24
|
-
FORBID_ATTR: ["onerror", "onload", "onclick", "onmouseover", "onmouseout", "onfocus", "onblur"]
|
|
24
|
+
FORBID_TAGS: ["script", "style", "iframe", "object", "embed"]
|
|
25
25
|
}),
|
|
26
26
|
[t]
|
|
27
27
|
);
|
|
28
28
|
return m(() => {
|
|
29
|
-
if (!
|
|
30
|
-
|
|
29
|
+
if (!a.current) return;
|
|
30
|
+
a.current.querySelectorAll(
|
|
31
31
|
'.mtx-math-inline, .mtx-math-block, [data-type="math-inline"], [data-type="math-block"]'
|
|
32
32
|
).forEach(c);
|
|
33
|
-
}, [
|
|
33
|
+
}, [r]), /* @__PURE__ */ n(
|
|
34
34
|
"div",
|
|
35
35
|
{
|
|
36
|
-
ref:
|
|
36
|
+
ref: a,
|
|
37
37
|
className: `mtx-content-viewer${e ? ` ${e}` : ""}`,
|
|
38
|
-
dangerouslySetInnerHTML: { __html:
|
|
38
|
+
dangerouslySetInnerHTML: { __html: r }
|
|
39
39
|
}
|
|
40
40
|
);
|
|
41
41
|
}
|
|
42
42
|
export {
|
|
43
|
-
|
|
43
|
+
x as C
|
|
44
44
|
};
|