@meowdown/react 0.29.1 → 0.30.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/dist/index.d.ts +7 -6
- package/dist/index.js +4 -0
- package/dist/style.css +13 -15
- 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/dist/style.css
CHANGED
|
@@ -24,10 +24,10 @@
|
|
|
24
24
|
.meow_Trigger_D3j_9q {
|
|
25
25
|
box-sizing: border-box;
|
|
26
26
|
border: 1px solid var(--meowdown-border);
|
|
27
|
+
background: var(--meowdown-popover-bg);
|
|
27
28
|
height: 1.6rem;
|
|
28
29
|
color: var(--meowdown-muted);
|
|
29
30
|
cursor: pointer;
|
|
30
|
-
background: light-dark(#fff, #27272a);
|
|
31
31
|
border-radius: .35rem;
|
|
32
32
|
align-items: center;
|
|
33
33
|
gap: .25rem;
|
|
@@ -55,11 +55,11 @@
|
|
|
55
55
|
.meow_CopyButton_D3j_9q {
|
|
56
56
|
box-sizing: border-box;
|
|
57
57
|
border: 1px solid var(--meowdown-border);
|
|
58
|
+
background: var(--meowdown-popover-bg);
|
|
58
59
|
width: 1.6rem;
|
|
59
60
|
height: 1.6rem;
|
|
60
61
|
color: var(--meowdown-muted);
|
|
61
62
|
cursor: pointer;
|
|
62
|
-
background: light-dark(#fff, #27272a);
|
|
63
63
|
border-radius: .35rem;
|
|
64
64
|
justify-content: center;
|
|
65
65
|
align-items: center;
|
|
@@ -90,10 +90,10 @@
|
|
|
90
90
|
box-sizing: border-box;
|
|
91
91
|
max-height: min(var(--available-height), 18rem);
|
|
92
92
|
border: 1px solid var(--meowdown-border);
|
|
93
|
+
background: var(--meowdown-popover-bg);
|
|
93
94
|
width: 14rem;
|
|
94
95
|
color: var(--meowdown-text);
|
|
95
96
|
transform-origin: var(--transform-origin);
|
|
96
|
-
background: light-dark(#fff, #27272a);
|
|
97
97
|
border-radius: .5rem;
|
|
98
98
|
flex-direction: column;
|
|
99
99
|
font-family: ui-sans-serif, system-ui, sans-serif;
|
|
@@ -240,7 +240,7 @@
|
|
|
240
240
|
display: flex;
|
|
241
241
|
|
|
242
242
|
&:hover {
|
|
243
|
-
background:
|
|
243
|
+
background: var(--meowdown-popover-hover-bg);
|
|
244
244
|
}
|
|
245
245
|
|
|
246
246
|
& svg {
|
|
@@ -264,7 +264,7 @@
|
|
|
264
264
|
.meow_Popup_IjcqKG {
|
|
265
265
|
box-sizing: border-box;
|
|
266
266
|
border: 1px solid var(--meowdown-border);
|
|
267
|
-
background: var(--meowdown-
|
|
267
|
+
background: var(--meowdown-popover-bg);
|
|
268
268
|
border-radius: .75rem;
|
|
269
269
|
flex-direction: column;
|
|
270
270
|
width: 100%;
|
|
@@ -302,7 +302,7 @@
|
|
|
302
302
|
display: inline-flex;
|
|
303
303
|
|
|
304
304
|
&:hover {
|
|
305
|
-
background: var(--meowdown-
|
|
305
|
+
background: var(--meowdown-popover-hover-bg);
|
|
306
306
|
}
|
|
307
307
|
|
|
308
308
|
& svg {
|
|
@@ -358,8 +358,7 @@
|
|
|
358
358
|
white-space: nowrap;
|
|
359
359
|
user-select: none;
|
|
360
360
|
border: 1px solid var(--meowdown-border);
|
|
361
|
-
background:
|
|
362
|
-
background: var(--meowdown-autocomplete-bg, light-dark(#fff, #18181b));
|
|
361
|
+
background: var(--meowdown-popover-bg);
|
|
363
362
|
border-radius: .75rem;
|
|
364
363
|
flex-direction: column;
|
|
365
364
|
width: 100%;
|
|
@@ -393,8 +392,7 @@
|
|
|
393
392
|
}
|
|
394
393
|
|
|
395
394
|
&[data-highlighted] {
|
|
396
|
-
background:
|
|
397
|
-
background: var(--meowdown-autocomplete-highlight-bg, light-dark(#f4f4f5, #27272a));
|
|
395
|
+
background: var(--meowdown-popover-hover-bg);
|
|
398
396
|
}
|
|
399
397
|
|
|
400
398
|
& kbd {
|
|
@@ -465,9 +463,9 @@
|
|
|
465
463
|
.meow_Trigger_hpZLgq {
|
|
466
464
|
box-sizing: border-box;
|
|
467
465
|
border: 1px solid var(--meowdown-border);
|
|
466
|
+
background: var(--meowdown-popover-bg);
|
|
468
467
|
color: color-mix(in oklab, var(--meowdown-muted) 50%, transparent);
|
|
469
468
|
cursor: grab;
|
|
470
|
-
background: light-dark(#fff, #18181b);
|
|
471
469
|
border-radius: .25rem;
|
|
472
470
|
outline: none;
|
|
473
471
|
justify-content: center;
|
|
@@ -478,7 +476,7 @@
|
|
|
478
476
|
overflow: clip;
|
|
479
477
|
|
|
480
478
|
&:hover {
|
|
481
|
-
background:
|
|
479
|
+
background: var(--meowdown-popover-hover-bg);
|
|
482
480
|
}
|
|
483
481
|
|
|
484
482
|
& svg {
|
|
@@ -494,10 +492,10 @@
|
|
|
494
492
|
white-space: nowrap;
|
|
495
493
|
user-select: none;
|
|
496
494
|
border: 1px solid var(--meowdown-border);
|
|
495
|
+
background: var(--meowdown-popover-bg);
|
|
497
496
|
min-width: 8rem;
|
|
498
497
|
max-height: 25rem;
|
|
499
498
|
transform-origin: var(--transform-origin);
|
|
500
|
-
background: light-dark(#fff, #18181b);
|
|
501
499
|
border-radius: .75rem;
|
|
502
500
|
outline: none;
|
|
503
501
|
flex-direction: column;
|
|
@@ -540,11 +538,11 @@
|
|
|
540
538
|
display: flex;
|
|
541
539
|
|
|
542
540
|
&[data-highlighted] {
|
|
543
|
-
background:
|
|
541
|
+
background: var(--meowdown-popover-hover-bg);
|
|
544
542
|
}
|
|
545
543
|
|
|
546
544
|
&[data-danger] {
|
|
547
|
-
color:
|
|
545
|
+
color: var(--meowdown-danger);
|
|
548
546
|
}
|
|
549
547
|
|
|
550
548
|
&[data-disabled="true"] {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@meowdown/react",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.30.0",
|
|
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.15",
|
|
26
26
|
"clsx": "^2.1.1",
|
|
27
27
|
"lucide-react": "^1.21.0",
|
|
28
|
-
"@meowdown/core": "0.
|
|
28
|
+
"@meowdown/core": "0.30.0"
|
|
29
29
|
},
|
|
30
30
|
"peerDependencies": {
|
|
31
31
|
"react": "^19.0.0",
|