@meowdown/react 0.29.0 → 0.29.2
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/dist/index.d.ts +7 -6
- package/dist/index.js +4 -0
- package/package.json +5 -5
package/dist/index.d.ts
CHANGED
|
@@ -76,8 +76,9 @@ interface WikilinkItem {
|
|
|
76
76
|
}
|
|
77
77
|
/**
|
|
78
78
|
* Searches notes for the wikilink menu. Receives the query typed after
|
|
79
|
-
* `[[` or `@` (
|
|
80
|
-
* spaces) and returns the rows to show, either synchronously or as
|
|
79
|
+
* `[[` or `@` (trimmed, with casing and punctuation preserved; may be empty
|
|
80
|
+
* or contain spaces) and returns the rows to show, either synchronously or as
|
|
81
|
+
* a promise.
|
|
81
82
|
*/
|
|
82
83
|
type WikilinkSearchHandler = (query: string) => WikilinkItem[] | Promise<WikilinkItem[]>;
|
|
83
84
|
//#endregion
|
|
@@ -108,10 +109,10 @@ interface EditorProps {
|
|
|
108
109
|
onTagSearch?: TagSearchHandler;
|
|
109
110
|
/**
|
|
110
111
|
* Searches notes for the wikilink menu, which opens as soon as `[[` or `@`
|
|
111
|
-
* is typed. Receives the query (
|
|
112
|
-
* empty) and returns the note names to show, synchronously
|
|
113
|
-
* Pass a stable function (e.g. from `useCallback`). Omit to
|
|
114
|
-
* wikilink menu.
|
|
112
|
+
* is typed. Receives the query (trimmed, with casing and punctuation
|
|
113
|
+
* preserved, may be empty) and returns the note names to show, synchronously
|
|
114
|
+
* or as a promise. Pass a stable function (e.g. from `useCallback`). Omit to
|
|
115
|
+
* disable the wikilink menu.
|
|
115
116
|
*/
|
|
116
117
|
onWikilinkSearch?: WikilinkSearchHandler;
|
|
117
118
|
/**
|
package/dist/index.js
CHANGED
|
@@ -892,6 +892,9 @@ function TagMenu({ onTagSearch }) {
|
|
|
892
892
|
//#endregion
|
|
893
893
|
//#region src/components/wikilink-menu.tsx
|
|
894
894
|
const regex = canUseRegexLookbehind() ? /(?:\[\[[^[\]]*|(?<!\S)@(?:[^[\]\s][^[\]]*)?)$/u : /(?:\[\[[^[\]]*|@(?:[^[\]\s][^[\]]*)?)$/u;
|
|
895
|
+
function queryFromRegexMatch(match) {
|
|
896
|
+
return match[0].replace(/^(?:\[\[|@)/, "").trim();
|
|
897
|
+
}
|
|
895
898
|
function WikilinkMenu({ onWikilinkSearch }) {
|
|
896
899
|
const editor = useEditor$1();
|
|
897
900
|
const [open, setOpen] = useState(false);
|
|
@@ -923,6 +926,7 @@ function WikilinkMenu({ onWikilinkSearch }) {
|
|
|
923
926
|
return /* @__PURE__ */ jsx(AutocompleteRoot, {
|
|
924
927
|
regex,
|
|
925
928
|
filter: returnsTrue,
|
|
929
|
+
queryBuilder: queryFromRegexMatch,
|
|
926
930
|
onOpenChange: (event) => setOpen(event.detail),
|
|
927
931
|
onQueryChange: (event) => setQuery(event.detail),
|
|
928
932
|
children: /* @__PURE__ */ jsx(AutocompletePositioner, {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@meowdown/react",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.29.
|
|
4
|
+
"version": "0.29.2",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -20,12 +20,12 @@
|
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"@base-ui/react": "^1.6.0",
|
|
22
22
|
"@ocavue/utils": "^1.7.0",
|
|
23
|
-
"@prosekit/core": "^0.13.0-beta.
|
|
24
|
-
"@prosekit/pm": "^0.1.19-beta.
|
|
25
|
-
"@prosekit/react": "^0.8.0-beta.
|
|
23
|
+
"@prosekit/core": "^0.13.0-beta.4",
|
|
24
|
+
"@prosekit/pm": "^0.1.19-beta.1",
|
|
25
|
+
"@prosekit/react": "^0.8.0-beta.14",
|
|
26
26
|
"clsx": "^2.1.1",
|
|
27
27
|
"lucide-react": "^1.21.0",
|
|
28
|
-
"@meowdown/core": "0.29.
|
|
28
|
+
"@meowdown/core": "0.29.2"
|
|
29
29
|
},
|
|
30
30
|
"peerDependencies": {
|
|
31
31
|
"react": "^19.0.0",
|