@uxf/wysiwyg 11.125.0 → 11.126.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 +39 -42
- package/package.json +7 -7
package/README.md
CHANGED
|
@@ -80,10 +80,7 @@ To enable only some plugins, compose them yourself with `createPluginsWithUi`:
|
|
|
80
80
|
```tsx
|
|
81
81
|
import { createBoldPluginWithUi, createHeadingsPluginWithUi, createPluginsWithUi } from "@uxf/wysiwyg";
|
|
82
82
|
|
|
83
|
-
const plugins = createPluginsWithUi([
|
|
84
|
-
createHeadingsPluginWithUi({ disabledLevels: [1] }),
|
|
85
|
-
createBoldPluginWithUi(),
|
|
86
|
-
]);
|
|
83
|
+
const plugins = createPluginsWithUi([createHeadingsPluginWithUi({ disabledLevels: [1] }), createBoldPluginWithUi()]);
|
|
87
84
|
```
|
|
88
85
|
|
|
89
86
|
## Content model
|
|
@@ -113,55 +110,55 @@ Everything below is exported from the package root (`@uxf/wysiwyg`) unless a dee
|
|
|
113
110
|
|
|
114
111
|
`import { WysiwygEditor } from "@uxf/wysiwyg";`
|
|
115
112
|
|
|
116
|
-
| Prop
|
|
117
|
-
|
|
|
118
|
-
| `id`
|
|
119
|
-
| `initialValue`
|
|
120
|
-
| `onChange`
|
|
121
|
-
| `plugins`
|
|
122
|
-
| `className`
|
|
123
|
-
| `editableProps`
|
|
124
|
-
| `customPluginsToolbarButtons` | `ReactNode`
|
|
125
|
-
| `toolbarLeftElement`
|
|
126
|
-
| `toolbarRightElement`
|
|
113
|
+
| Prop | Type | Required | Description |
|
|
114
|
+
| ----------------------------- | --------------------------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
115
|
+
| `id` | `string` | yes | Unique Plate instance id. Must be unique per editor on the page. |
|
|
116
|
+
| `initialValue` | `WysiwygContent \| undefined` | yes | Document the editor is seeded with on mount. |
|
|
117
|
+
| `onChange` | `(value: WysiwygContent) => void` | yes | Called on every edit with the full document. |
|
|
118
|
+
| `plugins` | `UxfPlatePlugin[]` | yes | Build with `createAllPluginsWithUi` / `createPluginsWithUi`. |
|
|
119
|
+
| `className` | `string` | no | Class on the editor root wrapper. |
|
|
120
|
+
| `editableProps` | `TEditableProps<WysiwygContent>` | no | Passed to Plate's editable area (`placeholder`, `readOnly`, `autoFocus`, `spellCheck`, `className`, …). Defaults: `autoFocus: false`, `readOnly: false`, `spellCheck: false`, localized placeholder. |
|
|
121
|
+
| `customPluginsToolbarButtons` | `ReactNode` | no | Extra toolbar buttons appended to the built-in ones. |
|
|
122
|
+
| `toolbarLeftElement` | `ReactNode` | no | Node rendered at the toolbar's left edge. |
|
|
123
|
+
| `toolbarRightElement` | `ReactNode` | no | Node rendered at the toolbar's right edge. |
|
|
127
124
|
|
|
128
125
|
### Plugin builders
|
|
129
126
|
|
|
130
127
|
`createPluginsWithUi` / `createAllPluginsWithUi` return the `UxfPlatePlugin[]` you pass to `WysiwygEditor`. Both inject the base plugins automatically (paragraph, exit-break, reset-node, soft-break, node-id, select-on-backspace, trailing-block), so pass only the feature builders below — not raw Plate plugins.
|
|
131
128
|
|
|
132
|
-
| Export
|
|
133
|
-
|
|
|
134
|
-
| `createPluginsWithUi`
|
|
135
|
-
| `createAllPluginsWithUi`
|
|
136
|
-
| `createHeadingsPluginWithUi`
|
|
137
|
-
| `createBoldPluginWithUi`
|
|
138
|
-
| `createItalicPluginWithUi`
|
|
139
|
-
| `createUnderlinePluginWithUi`
|
|
140
|
-
| `createCodePluginWithUi`
|
|
141
|
-
| `createHighlightPluginWithUi`
|
|
142
|
-
| `createBlockquotePluginWithUi` | `() => WysiwygPlugin`
|
|
143
|
-
| `createListPluginWithUi`
|
|
144
|
-
| `createLinkPluginWithUi`
|
|
145
|
-
| `createImagePluginWithUi`
|
|
146
|
-
| `createVideoPluginWithUi`
|
|
147
|
-
| `createButtonPluginWithUi`
|
|
129
|
+
| Export | Signature | Notes |
|
|
130
|
+
| ------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------- |
|
|
131
|
+
| `createPluginsWithUi` | `(plugins: Array<WysiwygPlugin \| WysiwygRecursivePlugin<string>>, options?: { overrideByKey?: MyOverrideByKey }) => UxfPlatePlugin[]` | Compose a custom subset. |
|
|
132
|
+
| `createAllPluginsWithUi` | `(options: CreateAllPluginsOptions) => UxfPlatePlugin[]` | Enable every plugin. |
|
|
133
|
+
| `createHeadingsPluginWithUi` | `(options?: HeadingsPluginOptions) => WysiwygRecursivePlugin` | `disabledLevels?: (1..6)[]`. |
|
|
134
|
+
| `createBoldPluginWithUi` | `() => WysiwygPlugin` | |
|
|
135
|
+
| `createItalicPluginWithUi` | `() => WysiwygPlugin` | |
|
|
136
|
+
| `createUnderlinePluginWithUi` | `() => WysiwygPlugin` | |
|
|
137
|
+
| `createCodePluginWithUi` | `() => WysiwygPlugin` | |
|
|
138
|
+
| `createHighlightPluginWithUi` | `(color?: CSSProperties["color"]) => WysiwygPlugin` | Defaults to `twColors.yellow[300]`. |
|
|
139
|
+
| `createBlockquotePluginWithUi` | `() => WysiwygPlugin` | |
|
|
140
|
+
| `createListPluginWithUi` | `() => WysiwygRecursivePlugin` | Renders `ul` / `ol` / `li`. |
|
|
141
|
+
| `createLinkPluginWithUi` | `() => WysiwygPlugin` | |
|
|
142
|
+
| `createImagePluginWithUi` | `(options: UxfImagePluginOptions) => WysiwygPlugin` | See options below. |
|
|
143
|
+
| `createVideoPluginWithUi` | `() => WysiwygPlugin` | |
|
|
144
|
+
| `createButtonPluginWithUi` | `() => WysiwygPlugin` | |
|
|
148
145
|
|
|
149
146
|
`CreateAllPluginsOptions`:
|
|
150
147
|
|
|
151
|
-
| Key
|
|
152
|
-
|
|
|
153
|
-
| `image`
|
|
154
|
-
| `headings`
|
|
155
|
-
| `highlightColor` | `CSSProperties["color"]` | no
|
|
148
|
+
| Key | Type | Required | Description |
|
|
149
|
+
| ---------------- | ------------------------ | -------- | ------------------------------------------------------------------- |
|
|
150
|
+
| `image` | `UxfImagePluginOptions` | yes | Image plugin options (pass `{}` to enable without upload handlers). |
|
|
151
|
+
| `headings` | `HeadingsPluginOptions` | no | e.g. `{ disabledLevels: [1] }`. |
|
|
152
|
+
| `highlightColor` | `CSSProperties["color"]` | no | Highlight mark color. |
|
|
156
153
|
|
|
157
154
|
`UxfImagePluginOptions` (extends Plate's `MediaPlugin`):
|
|
158
155
|
|
|
159
|
-
| Key
|
|
160
|
-
|
|
|
161
|
-
| `uploadImage`
|
|
162
|
-
| `getImageUrl`
|
|
163
|
-
| `disableUploadOnPasteImageUrl` | `boolean`
|
|
164
|
-
| `disableUploadOnPasteImage`
|
|
156
|
+
| Key | Type | Description |
|
|
157
|
+
| ------------------------------ | --------------------------------------- | ------------------------------------------------------------- |
|
|
158
|
+
| `uploadImage` | `(file: File) => Promise<FileResponse>` | Upload handler; returns a `FileResponse` (`@uxf/core/types`). |
|
|
159
|
+
| `getImageUrl` | `(file: FileResponse) => string` | Resolves the display URL for an uploaded file. |
|
|
160
|
+
| `disableUploadOnPasteImageUrl` | `boolean` | Disable auto-upload when an image URL is pasted. |
|
|
161
|
+
| `disableUploadOnPasteImage` | `boolean` | Disable auto-upload when an image blob is pasted. |
|
|
165
162
|
|
|
166
163
|
### Hooks
|
|
167
164
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uxf/wysiwyg",
|
|
3
|
-
"version": "11.
|
|
3
|
+
"version": "11.126.0",
|
|
4
4
|
"description": "UXF Wysiwyg editor",
|
|
5
5
|
"author": "Robin Dvorak <dvorak@uxf.cz>",
|
|
6
6
|
"homepage": "https://gitlab.com/uxf-npm/wysiwyg",
|
|
@@ -31,9 +31,9 @@
|
|
|
31
31
|
"@udecode/slate": "19.8.0",
|
|
32
32
|
"@udecode/slate-react": "19.7.1",
|
|
33
33
|
"@udecode/slate-utils": "19.7.1",
|
|
34
|
-
"@uxf/core": "11.
|
|
35
|
-
"@uxf/core-react": "11.
|
|
36
|
-
"@uxf/ui": "11.
|
|
34
|
+
"@uxf/core": "11.126.0",
|
|
35
|
+
"@uxf/core-react": "11.126.0",
|
|
36
|
+
"@uxf/ui": "11.126.0",
|
|
37
37
|
"react": ">=18.2.0",
|
|
38
38
|
"react-dom": ">=18.2.0",
|
|
39
39
|
"slate": "0.90.0",
|
|
@@ -62,9 +62,9 @@
|
|
|
62
62
|
"@udecode/slate": "19.8.0",
|
|
63
63
|
"@udecode/slate-react": "19.7.1",
|
|
64
64
|
"@udecode/slate-utils": "19.7.1",
|
|
65
|
-
"@uxf/core": "11.
|
|
66
|
-
"@uxf/core-react": "11.
|
|
67
|
-
"@uxf/ui": "11.
|
|
65
|
+
"@uxf/core": "11.126.0",
|
|
66
|
+
"@uxf/core-react": "11.126.0",
|
|
67
|
+
"@uxf/ui": "11.126.0",
|
|
68
68
|
"react": "18.3.1",
|
|
69
69
|
"react-dom": "18.3.1",
|
|
70
70
|
"slate": "0.90.0",
|