@meowdown/react 0.59.0 → 0.59.1
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 +3 -2
- package/dist/index.js +10 -5
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -105,8 +105,9 @@ file embeds; return `false` to keep it as a normal link.
|
|
|
105
105
|
|
|
106
106
|
`searchQuery` highlights every match and selects the first one at or after the
|
|
107
107
|
caret; changing it re-anchors from wherever the selection is, so refining a
|
|
108
|
-
query keeps the match the user is looking at.
|
|
109
|
-
|
|
108
|
+
query keeps the match the user is looking at. A query that matches nothing
|
|
109
|
+
collapses the previous match selection to a caret, and an empty string (the
|
|
110
|
+
default) clears the highlights and leaves the selection alone. `onSearchChange` reports
|
|
110
111
|
`{ total, active }` for a match counter (`active` is one-based; `0` means the
|
|
111
112
|
selection is not on a match), and `EditorHandle.findNext()` /
|
|
112
113
|
`EditorHandle.findPrevious()` walk the matches and wrap at the document edges.
|
package/dist/index.js
CHANGED
|
@@ -393,12 +393,20 @@ function DropIndicator$1() {
|
|
|
393
393
|
//#region src/components/editor-extensions.tsx
|
|
394
394
|
function EditorExtensions({ markMode, onDocChange, onWikilinkClick, onLinkClick, onTagClick, onExitBoundary, resolveImageUrl, resolveFileInfo, onFileClick, onFilePaste, onFileSaveError, onImageClick, embedPaste, linkPaste, bulletAfterHeading, substitution, placeholder, readOnly, wikilinkEnabled, spellCheck, searchQuery, onSearchChange, editorClassName }) {
|
|
395
395
|
const editor = useEditor$1();
|
|
396
|
-
|
|
396
|
+
useLayoutEffect(() => {
|
|
397
397
|
editor.commands.setMarkMode(markMode);
|
|
398
398
|
}, [editor, markMode]);
|
|
399
|
+
useLayoutEffect(() => {
|
|
400
|
+
if (!editorClassName) return;
|
|
401
|
+
const extension = defineViewAttributes({ class: editorClassName });
|
|
402
|
+
return editor.use(extension);
|
|
403
|
+
}, [editor, editorClassName]);
|
|
399
404
|
const deferredSearchQuery = useDeferredValue(searchQuery);
|
|
400
405
|
useEffect(() => {
|
|
401
|
-
editor.commands.setSearchQuery(
|
|
406
|
+
editor.commands.setSearchQuery({
|
|
407
|
+
search: deferredSearchQuery,
|
|
408
|
+
literal: true
|
|
409
|
+
});
|
|
402
410
|
}, [editor, deferredSearchQuery]);
|
|
403
411
|
useExtension$1(useMemo(() => onSearchChange ? defineSearchStatusHandler(onSearchChange) : null, [onSearchChange]));
|
|
404
412
|
useExtension$1(useMemo(() => {
|
|
@@ -474,9 +482,6 @@ function EditorExtensions({ markMode, onDocChange, onWikilinkClick, onLinkClick,
|
|
|
474
482
|
useExtension$1(useMemo(() => {
|
|
475
483
|
return spellCheck == null ? null : defineSpellCheckPlugin(spellCheck);
|
|
476
484
|
}, [spellCheck]));
|
|
477
|
-
useExtension$1(useMemo(() => {
|
|
478
|
-
return editorClassName ? defineViewAttributes({ class: editorClassName }) : null;
|
|
479
|
-
}, [editorClassName]));
|
|
480
485
|
return null;
|
|
481
486
|
}
|
|
482
487
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@meowdown/react",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.59.
|
|
4
|
+
"version": "0.59.1",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -25,13 +25,13 @@
|
|
|
25
25
|
"@ocavue/utils": "^1.7.0",
|
|
26
26
|
"@prosekit/core": "^0.13.0-beta.7",
|
|
27
27
|
"@prosekit/pm": "^0.1.19-beta.4",
|
|
28
|
-
"@prosekit/react": "^0.8.0-beta.
|
|
28
|
+
"@prosekit/react": "^0.8.0-beta.24",
|
|
29
29
|
"beautiful-mermaid": "^1.1.3",
|
|
30
30
|
"clsx": "^2.1.1",
|
|
31
31
|
"github-slugger": "^2.0.0",
|
|
32
|
-
"lucide-react": "^1.
|
|
32
|
+
"lucide-react": "^1.27.0",
|
|
33
33
|
"react-property": "^2.0.2",
|
|
34
|
-
"@meowdown/core": "0.59.
|
|
34
|
+
"@meowdown/core": "0.59.1"
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {
|
|
37
37
|
"react": "^19.0.0",
|
|
@@ -48,14 +48,14 @@
|
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"@css-modules-kit/codegen": "^1.4.0",
|
|
50
50
|
"@ocavue/tsconfig": "^0.7.1",
|
|
51
|
-
"@tsdown/css": "^0.22.
|
|
51
|
+
"@tsdown/css": "^0.22.14",
|
|
52
52
|
"@types/react": "^19.2.17",
|
|
53
53
|
"@types/react-dom": "^19.2.3",
|
|
54
54
|
"@vitest/browser-playwright": "^4.1.10",
|
|
55
55
|
"dedent": "^1.7.2",
|
|
56
56
|
"react": "^19.2.8",
|
|
57
57
|
"react-dom": "^19.2.8",
|
|
58
|
-
"tsdown": "^0.22.
|
|
58
|
+
"tsdown": "^0.22.14",
|
|
59
59
|
"vitest": "^4.1.10",
|
|
60
60
|
"vitest-browser-commands": "^0.2.1",
|
|
61
61
|
"vitest-browser-react": "^2.2.0",
|