@opositatest/markdown-text-editor 1.1.1 → 1.2.0
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 +60 -22
- package/dist/editor.css +1 -1
- package/dist/editor.js +13267 -13041
- package/dist/react/index.js +14961 -14772
- package/dist/react/markdown-text-editor.css +1 -1
- package/dist/react/{module-BNH92kHQ.js → module-CTSMhL_P.js} +98 -98
- package/dist/react/native-B_0ZyPxP.js +107 -0
- package/package.json +11 -2
- package/dist/react/native-PBRRnxaU.js +0 -107
package/README.md
CHANGED
|
@@ -81,19 +81,52 @@ Load via CDN (no build step required):
|
|
|
81
81
|
|
|
82
82
|
### Attributes
|
|
83
83
|
|
|
84
|
-
| Attribute
|
|
85
|
-
|
|
|
86
|
-
| `name`
|
|
87
|
-
| `value`
|
|
88
|
-
| `placeholder`
|
|
89
|
-
| `width`
|
|
90
|
-
| `height`
|
|
91
|
-
| `disabled`
|
|
92
|
-
| `readonly`
|
|
93
|
-
| `required`
|
|
84
|
+
| Attribute | Type | Description |
|
|
85
|
+
| --------------------------- | ------- | ------------------------------------------------ |
|
|
86
|
+
| `name` | string | Field name for form submission |
|
|
87
|
+
| `value` | string | Initial Markdown value |
|
|
88
|
+
| `placeholder` | string | Placeholder text shown when empty |
|
|
89
|
+
| `width` | string | CSS width for the editor container |
|
|
90
|
+
| `height` | string | CSS height for the editor container |
|
|
91
|
+
| `disabled` | boolean | Disables the editor |
|
|
92
|
+
| `readonly` | boolean | Makes the editor read-only |
|
|
93
|
+
| `required` | boolean | Participates in native form validation |
|
|
94
|
+
| `hidden-slash-menu-items` | string | JSON array of item titles to hide from slash menu |
|
|
95
|
+
| `formatting-toolbar` | boolean | Floating formatting toolbar on text selection (default: enabled, set to `false` to disable) |
|
|
94
96
|
|
|
95
97
|
`width` and `height` accept any valid CSS size, such as `320px`, `40rem`, or `100%`.
|
|
96
98
|
|
|
99
|
+
#### Available slash menu item titles
|
|
100
|
+
|
|
101
|
+
Use these exact titles in the `hidden-slash-menu-items` JSON array to hide specific items:
|
|
102
|
+
|
|
103
|
+
| Title | Group | Description |
|
|
104
|
+
| ---------------- | ------------ | ------------------------------ |
|
|
105
|
+
| `Heading 1` | Headings | Top-level heading |
|
|
106
|
+
| `Heading 2` | Headings | Key section heading |
|
|
107
|
+
| `Heading 3` | Headings | Subsection and group heading |
|
|
108
|
+
| `Paragraph` | Basic blocks | Plain text |
|
|
109
|
+
| `Bullet List` | Basic blocks | Create a simple bullet list |
|
|
110
|
+
| `Numbered List` | Basic blocks | Create a list with numbering |
|
|
111
|
+
| `Checklist` | Basic blocks | Track tasks with a checklist |
|
|
112
|
+
| `Blockquote` | Basic blocks | Capture a quote |
|
|
113
|
+
| `Code Block` | Basic blocks | Capture a code snippet |
|
|
114
|
+
| `Divider` | Basic blocks | Visually divide blocks |
|
|
115
|
+
| `Image` | Media | Fullscreen image |
|
|
116
|
+
| `Video` | Media | Resizable video with caption |
|
|
117
|
+
| `Audio` | Media | Embed audio |
|
|
118
|
+
| `File` | Media | Embed a file |
|
|
119
|
+
| `Table` | Media | Create a table |
|
|
120
|
+
| `Math Formula` | Media | Insert LaTeX formula |
|
|
121
|
+
|
|
122
|
+
**Example:** Hide Image, Video, Audio, File, Table, and Math Formula:
|
|
123
|
+
|
|
124
|
+
```html
|
|
125
|
+
<markdown-text-editor
|
|
126
|
+
hidden-slash-menu-items='["Image", "Video", "Audio", "File", "Table", "Math Formula"]'
|
|
127
|
+
></markdown-text-editor>
|
|
128
|
+
```
|
|
129
|
+
|
|
97
130
|
### Properties
|
|
98
131
|
|
|
99
132
|
| Property | Type | Description |
|
|
@@ -103,6 +136,7 @@ Load via CDN (no build step required):
|
|
|
103
136
|
| `element.height` | string | Get or set CSS height |
|
|
104
137
|
| `element.disabled` | boolean | Get or set disabled state |
|
|
105
138
|
| `element.readOnly` | boolean | Get or set read-only state |
|
|
139
|
+
| `element.formattingToolbar` | boolean | Get or set the floating formatting toolbar state |
|
|
106
140
|
|
|
107
141
|
### Methods
|
|
108
142
|
|
|
@@ -141,21 +175,25 @@ import "@opositatest/markdown-text-editor/style";
|
|
|
141
175
|
|
|
142
176
|
### Props
|
|
143
177
|
|
|
144
|
-
| Prop
|
|
145
|
-
|
|
|
146
|
-
| `value`
|
|
147
|
-
| `defaultValue`
|
|
148
|
-
| `onChange`
|
|
149
|
-
| `onReady`
|
|
150
|
-
| `placeholder`
|
|
151
|
-
| `width`
|
|
152
|
-
| `height`
|
|
153
|
-
| `disabled`
|
|
154
|
-
| `readonly`
|
|
155
|
-
| `className`
|
|
178
|
+
| Prop | Type | Description |
|
|
179
|
+
| ----------------------- | -------------------------------------------- | -------------------------------------------- |
|
|
180
|
+
| `value` | `string` | Controlled Markdown value |
|
|
181
|
+
| `defaultValue` | `string` | Uncontrolled initial value |
|
|
182
|
+
| `onChange` | `(value: string) => void` | Called on every content change |
|
|
183
|
+
| `onReady` | `(handle: MarkdownTextEditorHandle) => void` | Called once editor has initialized |
|
|
184
|
+
| `placeholder` | `string` | Placeholder text shown when empty |
|
|
185
|
+
| `width` | `string` | CSS width for the editor container |
|
|
186
|
+
| `height` | `string` | CSS height for the editor container |
|
|
187
|
+
| `disabled` | `boolean` | Disables the editor |
|
|
188
|
+
| `readonly` | `boolean` | Makes the editor read-only |
|
|
189
|
+
| `className` | `string` | Additional CSS class on the editor container |
|
|
190
|
+
| `hiddenSlashMenuItems` | `string[]` | Array of item titles to hide from slash menu |
|
|
191
|
+
| `formattingToolbar` | `boolean` | Floating formatting toolbar on text selection (default: `true`) |
|
|
156
192
|
|
|
157
193
|
`width` and `height` accept any valid CSS size, such as `320px`, `40rem`, or `100%`.
|
|
158
194
|
|
|
195
|
+
See the [Web Component section](#available-slash-menu-item-titles) for the list of available item titles.
|
|
196
|
+
|
|
159
197
|
### Imperative handle (via ref)
|
|
160
198
|
|
|
161
199
|
```tsx
|