@delali/web-editor 0.4.1 → 0.4.5
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/CHANGELOG.md +17 -0
- package/README.md +3 -1
- package/dist/components/editor/collaboration/collaboration-starter.d.ts +5 -1
- package/dist/components/editor/create-editor-plugins.js +183 -124
- package/dist/components/editor/editor-base-kit.js +9 -18
- package/dist/components/editor/editor-kit.js +152 -93
- package/dist/components/editor/version-history/index.js +131 -72
- package/dist/components/editor/web-editor.d.ts +1 -1
- package/dist/components/editor/web-editor.js +2497 -2344
- package/dist/context/inspector-text-fields.d.ts +3 -0
- package/dist/context/text-field-attributes.d.ts +5 -0
- package/dist/hooks/use-return-focus-to-editor-on-input-removal.d.ts +3 -0
- package/dist/lib/markdown-utils.js +183 -124
- package/dist/styles.css +54 -20
- package/dist/types/editor.d.ts +2 -0
- package/dist/ui/icon-picker.d.ts +1 -1
- package/dist/ui/input.d.ts +1 -0
- package/dist/ui/media-file-display.d.ts +1 -0
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.4.5 (2026-12-04)
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
- Pass `textFieldAttributes={{ 'data-dictation-field': '' }}` to `WebEditor` so that your app can find its text inputs and textareas, including media captions and settings fields.
|
|
8
|
+
|
|
9
|
+
### Fixes
|
|
10
|
+
|
|
11
|
+
- Smart links and file URLs use a lighter blue in the editor's dark mode. With `theme="inherit"`, they use the host's `--primary` colour.
|
|
12
|
+
|
|
13
|
+
## 0.4.3 (2026-11-26)
|
|
14
|
+
|
|
15
|
+
### Fixes
|
|
16
|
+
|
|
17
|
+
- Import `lucide-react/dynamic.mjs` by its full file name, so Next.js with Turbopack, webpack, and Node resolve the icon picker's dynamic icons.
|
|
18
|
+
- Return focus to the editor when a writer picks a block from the slash menu, so the next words go into that block every time.
|
|
19
|
+
|
|
3
20
|
## 0.4.1 (2026-11-26)
|
|
4
21
|
|
|
5
22
|
### Breaking changes
|
package/README.md
CHANGED
|
@@ -35,6 +35,8 @@ export const ProductDescriptionEditor = () => {
|
|
|
35
35
|
|
|
36
36
|
`WebEditor` also takes `readOnly`, `features` to switch individual blocks and menus on or off, `toolbar`, `showToc`, `variant`, and the class name props `className`, `containerClassName`, and `editorClassName`. `WebEditorProps` in `@delali/web-editor/types` lists every prop.
|
|
37
37
|
|
|
38
|
+
Pass `textFieldAttributes={{ 'data-dictation-field': '' }}` to mark the text inputs and textareas that your app supports for dictation. You can choose any `data-*` attribute for your integration. The attributes also apply to fields in menus and inspector panels.
|
|
39
|
+
|
|
38
40
|
Set `plainLinks: true` in `features` when you want every link in the text to look the way it does on a published page. The editor then shows the link's own text, underlined in the editor's primary color, on the same line as the words around it. When `plainLinks` is left out, the editor shows each link as a smart link chip, and an author can switch it to its URL or to a card. In both views, a click on a link in the editor opens a toolbar where the author can open, copy, edit, or remove it.
|
|
39
41
|
|
|
40
42
|
Set `todoLists: false` in `features` when writers should get bulleted and numbered lists but no to-do lists, the checklists with a checkbox on each item. The slash menu, the turn-into menus, and the `[] ` and `[x] ` shortcuts then offer no to-do list. A to-do item that arrives through a paste, loaded HTML, loaded markdown, or a saved value becomes a bulleted item with the same text, and its checked state drops. `todoLists` defaults to `true`, and it has no effect when `lists` is off.
|
|
@@ -161,7 +163,7 @@ To try the editor in an app while you change it, run `pnpm dev` here and link th
|
|
|
161
163
|
|
|
162
164
|
## Releases
|
|
163
165
|
|
|
164
|
-
The version in `package.json` is the version that the next release publishes, and [CHANGELOG.md](CHANGELOG.md) records each release. To release, update both in a commit on `main`, then push a tag that matches the version, such as `v0.4.0`. The publish workflow checks that the tag matches `package.json`, then lints, type-checks, builds, tests,
|
|
166
|
+
The version in `package.json` is the version that the next release publishes, and [CHANGELOG.md](CHANGELOG.md) records each release. To release, update both in a commit on `main`, then push a tag that matches the version, such as `v0.4.0`. The publish workflow checks that the tag matches `package.json`, then lints, type-checks, builds, and tests it. Finally, it stages the version on npm through trusted publishing, so the repository holds no npm token. A maintainer then approves the staged version in the Staged Packages tab on npmjs.com, or with `npm stage approve <stage-id>`, and the version goes live.
|
|
165
167
|
|
|
166
168
|
## License
|
|
167
169
|
|
|
@@ -1,9 +1,13 @@
|
|
|
1
|
+
import { type PlateEditor } from 'platejs/react';
|
|
2
|
+
import { type ReactNode } from 'react';
|
|
1
3
|
import type { EditorCollabAdapter } from '../../../context/editor-adapter';
|
|
2
4
|
import type { Value } from '../../../types/editor';
|
|
3
5
|
interface CollaborationStarterProps {
|
|
6
|
+
children: ReactNode;
|
|
4
7
|
collab: EditorCollabAdapter;
|
|
5
8
|
initialValue: Value;
|
|
6
9
|
onInitialized: (isInitialized: boolean) => void;
|
|
10
|
+
onEditorReady?: (editor: PlateEditor) => void;
|
|
7
11
|
}
|
|
8
|
-
export declare const CollaborationStarter: ({ collab, initialValue, onInitialized }: CollaborationStarterProps) =>
|
|
12
|
+
export declare const CollaborationStarter: ({ children, collab, initialValue, onInitialized, onEditorReady, }: CollaborationStarterProps) => ReactNode;
|
|
9
13
|
export {};
|