@opositatest/markdown-text-editor 1.2.0 → 1.3.0-canary.6b2b8ea
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 +50 -29
- package/dist/editor.css +1 -1
- package/dist/editor.js +11426 -10366
- package/dist/react/index.js +9226 -8175
- package/dist/react/markdown-text-editor.css +1 -1
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -47,7 +47,7 @@ In the editor UI, the math block is available from the slash menu and can be fou
|
|
|
47
47
|
|
|
48
48
|
### Scope note
|
|
49
49
|
|
|
50
|
-
This package documents and supports the text-oriented authoring experience above, including the custom math block. Advanced upstream BlockNote media and
|
|
50
|
+
This package documents and supports the text-oriented authoring experience above, including the custom math block. Advanced upstream BlockNote media flows (video, audio, and file blocks) are not part of the documented, supported surface of this package, and are **hidden from the slash menu by default**. Enable them explicitly with `enabled-media-blocks` / `enabledMediaBlocks` if a host app needs them — see [Available slash menu item ids](#available-slash-menu-item-ids).
|
|
51
51
|
|
|
52
52
|
## Web Component
|
|
53
53
|
|
|
@@ -91,39 +91,57 @@ Load via CDN (no build step required):
|
|
|
91
91
|
| `disabled` | boolean | Disables the editor |
|
|
92
92
|
| `readonly` | boolean | Makes the editor read-only |
|
|
93
93
|
| `required` | boolean | Participates in native form validation |
|
|
94
|
-
| `hidden-slash-menu-items` | string | JSON array of item
|
|
94
|
+
| `hidden-slash-menu-items` | string | JSON array of item ids to hide from the slash menu |
|
|
95
|
+
| `enabled-media-blocks` | string | JSON array of item ids to re-enable; `video`, `audio`, and `file` are hidden from the slash menu by default (see [Scope note](#scope-note)) |
|
|
95
96
|
| `formatting-toolbar` | boolean | Floating formatting toolbar on text selection (default: enabled, set to `false` to disable) |
|
|
96
97
|
|
|
97
98
|
`width` and `height` accept any valid CSS size, such as `320px`, `40rem`, or `100%`.
|
|
98
99
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
|
113
|
-
|
|
|
114
|
-
| `
|
|
115
|
-
| `
|
|
116
|
-
| `
|
|
117
|
-
| `
|
|
118
|
-
| `
|
|
119
|
-
| `
|
|
120
|
-
| `
|
|
121
|
-
|
|
122
|
-
|
|
100
|
+
### Formatting toolbar
|
|
101
|
+
|
|
102
|
+
Selecting text opens the formatting toolbar. Its **Quitar formato** action converts selected
|
|
103
|
+
text blocks to paragraphs and removes inline styles, colors, code formatting, and links in one
|
|
104
|
+
undoable operation. Non-text blocks such as images, tables, and formulas are left unchanged.
|
|
105
|
+
|
|
106
|
+
The action tooltip also shows the browser shortcut for pasting without source formatting:
|
|
107
|
+
`Ctrl/⌘ + Shift + V`.
|
|
108
|
+
|
|
109
|
+
#### Available slash menu item ids
|
|
110
|
+
|
|
111
|
+
Use these stable, English ids (not the localized, user-facing title) in the `hidden-slash-menu-items` / `enabled-media-blocks` JSON arrays:
|
|
112
|
+
|
|
113
|
+
| Id | Group | Description | Visible by default |
|
|
114
|
+
| ---------------- | ------------ | ------------------------------- | ------------------- |
|
|
115
|
+
| `heading-1` | Headings | Top-level heading | Yes |
|
|
116
|
+
| `heading-2` | Headings | Key section heading | Yes |
|
|
117
|
+
| `heading-3` | Headings | Subsection and group heading | Yes |
|
|
118
|
+
| `paragraph` | Basic blocks | Plain text | Yes |
|
|
119
|
+
| `bullet-list` | Basic blocks | Create a simple bullet list | Yes |
|
|
120
|
+
| `numbered-list` | Basic blocks | Create a list with numbering | Yes |
|
|
121
|
+
| `checklist` | Basic blocks | Track tasks with a checklist | Yes |
|
|
122
|
+
| `blockquote` | Basic blocks | Capture a quote | Yes |
|
|
123
|
+
| `code-block` | Basic blocks | Capture a code snippet | Yes |
|
|
124
|
+
| `divider` | Basic blocks | Visually divide blocks | Yes |
|
|
125
|
+
| `image` | Multimedia | Fullscreen image | Yes |
|
|
126
|
+
| `video` | Multimedia | Resizable video with caption | **No** — opt in via `enabled-media-blocks` |
|
|
127
|
+
| `audio` | Multimedia | Embed audio | **No** — opt in via `enabled-media-blocks` |
|
|
128
|
+
| `file` | Multimedia | Embed a file | **No** — opt in via `enabled-media-blocks` |
|
|
129
|
+
| `table` | Multimedia | Create a table | Yes |
|
|
130
|
+
| `math-formula` | Multimedia | Insert LaTeX formula | Yes |
|
|
131
|
+
|
|
132
|
+
**Example:** Hide the image and table items, on top of the media items that are already hidden by default:
|
|
133
|
+
|
|
134
|
+
```html
|
|
135
|
+
<markdown-text-editor
|
|
136
|
+
hidden-slash-menu-items='["image", "table"]'
|
|
137
|
+
></markdown-text-editor>
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
**Example:** Opt in to the video block while keeping audio and file hidden:
|
|
123
141
|
|
|
124
142
|
```html
|
|
125
143
|
<markdown-text-editor
|
|
126
|
-
|
|
144
|
+
enabled-media-blocks='["video"]'
|
|
127
145
|
></markdown-text-editor>
|
|
128
146
|
```
|
|
129
147
|
|
|
@@ -136,6 +154,8 @@ Use these exact titles in the `hidden-slash-menu-items` JSON array to hide speci
|
|
|
136
154
|
| `element.height` | string | Get or set CSS height |
|
|
137
155
|
| `element.disabled` | boolean | Get or set disabled state |
|
|
138
156
|
| `element.readOnly` | boolean | Get or set read-only state |
|
|
157
|
+
| `element.hiddenSlashMenuItems` | string[] | Get or set the list of hidden slash menu item ids |
|
|
158
|
+
| `element.enabledMediaBlocks` | string[] | Get or set the list of default-hidden media item ids to re-enable |
|
|
139
159
|
| `element.formattingToolbar` | boolean | Get or set the floating formatting toolbar state |
|
|
140
160
|
|
|
141
161
|
### Methods
|
|
@@ -187,12 +207,13 @@ import "@opositatest/markdown-text-editor/style";
|
|
|
187
207
|
| `disabled` | `boolean` | Disables the editor |
|
|
188
208
|
| `readonly` | `boolean` | Makes the editor read-only |
|
|
189
209
|
| `className` | `string` | Additional CSS class on the editor container |
|
|
190
|
-
| `hiddenSlashMenuItems` | `string[]` | Array of item
|
|
210
|
+
| `hiddenSlashMenuItems` | `string[]` | Array of item ids to hide from the slash menu |
|
|
211
|
+
| `enabledMediaBlocks` | `string[]` | Array of item ids to re-enable; `video`, `audio`, and `file` are hidden by default |
|
|
191
212
|
| `formattingToolbar` | `boolean` | Floating formatting toolbar on text selection (default: `true`) |
|
|
192
213
|
|
|
193
214
|
`width` and `height` accept any valid CSS size, such as `320px`, `40rem`, or `100%`.
|
|
194
215
|
|
|
195
|
-
See the [Web Component section](#available-slash-menu-item-
|
|
216
|
+
See the [Web Component section](#available-slash-menu-item-ids) for the list of available item ids.
|
|
196
217
|
|
|
197
218
|
### Imperative handle (via ref)
|
|
198
219
|
|