@opositatest/markdown-text-editor 1.1.0 → 1.1.1-canary.bc9b3d0
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 +57 -22
- package/dist/editor.css +1 -1
- package/dist/editor.js +13271 -12810
- package/dist/react/index.js +15265 -14829
- 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,51 @@ 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 |
|
|
94
95
|
|
|
95
96
|
`width` and `height` accept any valid CSS size, such as `320px`, `40rem`, or `100%`.
|
|
96
97
|
|
|
98
|
+
#### Available slash menu item titles
|
|
99
|
+
|
|
100
|
+
Use these exact titles in the `hidden-slash-menu-items` JSON array to hide specific items:
|
|
101
|
+
|
|
102
|
+
| Title | Group | Description |
|
|
103
|
+
| ---------------- | ------------ | ------------------------------ |
|
|
104
|
+
| `Heading 1` | Headings | Top-level heading |
|
|
105
|
+
| `Heading 2` | Headings | Key section heading |
|
|
106
|
+
| `Heading 3` | Headings | Subsection and group heading |
|
|
107
|
+
| `Paragraph` | Basic blocks | Plain text |
|
|
108
|
+
| `Bullet List` | Basic blocks | Create a simple bullet list |
|
|
109
|
+
| `Numbered List` | Basic blocks | Create a list with numbering |
|
|
110
|
+
| `Checklist` | Basic blocks | Track tasks with a checklist |
|
|
111
|
+
| `Blockquote` | Basic blocks | Capture a quote |
|
|
112
|
+
| `Code Block` | Basic blocks | Capture a code snippet |
|
|
113
|
+
| `Divider` | Basic blocks | Visually divide blocks |
|
|
114
|
+
| `Image` | Media | Fullscreen image |
|
|
115
|
+
| `Video` | Media | Resizable video with caption |
|
|
116
|
+
| `Audio` | Media | Embed audio |
|
|
117
|
+
| `File` | Media | Embed a file |
|
|
118
|
+
| `Table` | Media | Create a table |
|
|
119
|
+
| `Math Formula` | Media | Insert LaTeX formula |
|
|
120
|
+
|
|
121
|
+
**Example:** Hide Image, Video, Audio, File, Table, and Math Formula:
|
|
122
|
+
|
|
123
|
+
```html
|
|
124
|
+
<markdown-text-editor
|
|
125
|
+
hidden-slash-menu-items='["Image", "Video", "Audio", "File", "Table", "Math Formula"]'
|
|
126
|
+
></markdown-text-editor>
|
|
127
|
+
```
|
|
128
|
+
|
|
97
129
|
### Properties
|
|
98
130
|
|
|
99
131
|
| Property | Type | Description |
|
|
@@ -141,21 +173,24 @@ import "@opositatest/markdown-text-editor/style";
|
|
|
141
173
|
|
|
142
174
|
### Props
|
|
143
175
|
|
|
144
|
-
| Prop
|
|
145
|
-
|
|
|
146
|
-
| `value`
|
|
147
|
-
| `defaultValue`
|
|
148
|
-
| `onChange`
|
|
149
|
-
| `onReady`
|
|
150
|
-
| `placeholder`
|
|
151
|
-
| `width`
|
|
152
|
-
| `height`
|
|
153
|
-
| `disabled`
|
|
154
|
-
| `readonly`
|
|
155
|
-
| `className`
|
|
176
|
+
| Prop | Type | Description |
|
|
177
|
+
| ----------------------- | -------------------------------------------- | -------------------------------------------- |
|
|
178
|
+
| `value` | `string` | Controlled Markdown value |
|
|
179
|
+
| `defaultValue` | `string` | Uncontrolled initial value |
|
|
180
|
+
| `onChange` | `(value: string) => void` | Called on every content change |
|
|
181
|
+
| `onReady` | `(handle: MarkdownTextEditorHandle) => void` | Called once editor has initialized |
|
|
182
|
+
| `placeholder` | `string` | Placeholder text shown when empty |
|
|
183
|
+
| `width` | `string` | CSS width for the editor container |
|
|
184
|
+
| `height` | `string` | CSS height for the editor container |
|
|
185
|
+
| `disabled` | `boolean` | Disables the editor |
|
|
186
|
+
| `readonly` | `boolean` | Makes the editor read-only |
|
|
187
|
+
| `className` | `string` | Additional CSS class on the editor container |
|
|
188
|
+
| `hiddenSlashMenuItems` | `string[]` | Array of item titles to hide from slash menu |
|
|
156
189
|
|
|
157
190
|
`width` and `height` accept any valid CSS size, such as `320px`, `40rem`, or `100%`.
|
|
158
191
|
|
|
192
|
+
See the [Web Component section](#available-slash-menu-item-titles) for the list of available item titles.
|
|
193
|
+
|
|
159
194
|
### Imperative handle (via ref)
|
|
160
195
|
|
|
161
196
|
```tsx
|