@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 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 table flows are not currently part of the documented surface of this package.
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 titles to hide from slash menu |
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
- #### 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:
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
- hidden-slash-menu-items='["Image", "Video", "Audio", "File", "Table", "Math Formula"]'
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 titles to hide from slash menu |
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-titles) for the list of available item titles.
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