@mailwoman/react 10.4.0 → 10.6.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 +4 -0
- package/lib/search/SearchModal.tsx +136 -82
- package/lib/search/search.css +0 -44
- package/lib/search/tokens.ts +19 -0
- package/lib/search.ts +1 -0
- package/out/search/SearchModal.d.ts +4 -4
- package/out/search/SearchModal.d.ts.map +1 -1
- package/out/search/SearchModal.js +58 -20
- package/out/search/SearchModal.js.map +1 -1
- package/out/search/tokens.d.ts +17 -0
- package/out/search/tokens.d.ts.map +1 -0
- package/out/search/tokens.js +19 -0
- package/out/search/tokens.js.map +1 -0
- package/out/search.d.ts +1 -0
- package/out/search.d.ts.map +1 -1
- package/out/search.js +1 -0
- package/out/search.js.map +1 -1
- package/package.json +6 -26
package/README.md
CHANGED
|
@@ -39,6 +39,10 @@ component imports CSS, so the bare package import stays safe to load in Node.
|
|
|
39
39
|
- `yarn workspace @mailwoman/react test:browser` runs the Vitest browser-mode component and hook tests
|
|
40
40
|
(Playwright / headless Chromium).
|
|
41
41
|
|
|
42
|
+
New React code uses hooks and current idioms: derive values during render, and use refs and reducers
|
|
43
|
+
where they are idiomatic. Legacy context is out. A lint finding is answered by restructuring the
|
|
44
|
+
component, never by a disable comment.
|
|
45
|
+
|
|
42
46
|
## License
|
|
43
47
|
|
|
44
48
|
AGPL-3.0-only OR LicenseRef-Commercial. See the [mailwoman repository](https://github.com/sister-software/mailwoman).
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
* background, the backdrop, the close on Escape and the return of focus to the opener. The query field is an
|
|
8
8
|
* `<input type="search">` with the ARIA combobox role. DOM focus stays on the input, and
|
|
9
9
|
* `aria-activedescendant` identifies the selected hit. The component owns no data access: `search` is
|
|
10
|
-
* passed in.
|
|
11
|
-
* without them.
|
|
10
|
+
* passed in. The hits a reader opened are kept as recent hits, a per-viewer convenience in
|
|
11
|
+
* `localStorage`; the modal renders the same without them.
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
14
|
import { stringifyJSON, tryParsingJSON } from "@mailwoman/core/json"
|
|
@@ -16,6 +16,7 @@ import { type KeyboardEvent, type MouseEvent, type ReactNode, useEffect, useId,
|
|
|
16
16
|
|
|
17
17
|
import { useDebouncedValue } from "#common/useDebouncedValue"
|
|
18
18
|
|
|
19
|
+
import { queryTokens } from "./tokens.ts"
|
|
19
20
|
import type { SearchHit, SearchResponse } from "./types.ts"
|
|
20
21
|
|
|
21
22
|
export interface SearchModalProps {
|
|
@@ -34,12 +35,17 @@ export interface SearchModalProps {
|
|
|
34
35
|
*/
|
|
35
36
|
search: (q: string, signal: AbortSignal) => Promise<SearchResponse>
|
|
36
37
|
/**
|
|
37
|
-
* The `localStorage` key under which
|
|
38
|
-
* Absent, recent
|
|
38
|
+
* The `localStorage` key under which recently opened hits are kept.
|
|
39
|
+
* Absent, recent hits are not kept.
|
|
39
40
|
*/
|
|
40
41
|
recentKey?: string
|
|
41
42
|
}
|
|
42
43
|
|
|
44
|
+
/**
|
|
45
|
+
* A hit the reader opened earlier, kept without its snippet.
|
|
46
|
+
*/
|
|
47
|
+
type RecentHit = Pick<SearchHit, "url" | "anchor" | "hierarchy">
|
|
48
|
+
|
|
43
49
|
type Status =
|
|
44
50
|
| { kind: "idle" }
|
|
45
51
|
| { kind: "loading" }
|
|
@@ -79,17 +85,14 @@ function statusText(status: Status): string {
|
|
|
79
85
|
|
|
80
86
|
/**
|
|
81
87
|
* The ranges of `text` that match a query token, case-insensitively, for emphasis in a title.
|
|
88
|
+
*
|
|
89
|
+
* The tokens are the ones the index matched on, so `tier-1 locale` emphasizes `tier` and `locale`.
|
|
82
90
|
*/
|
|
83
91
|
function tokenRanges(text: string, query: string): [number, number][] {
|
|
84
92
|
const lower = text.toLowerCase()
|
|
85
93
|
const ranges: [number, number][] = []
|
|
86
94
|
|
|
87
|
-
for (const token of new Set(
|
|
88
|
-
query
|
|
89
|
-
.toLowerCase()
|
|
90
|
-
.split(/\s+/)
|
|
91
|
-
.filter((part) => part.length >= 2)
|
|
92
|
-
)) {
|
|
95
|
+
for (const token of new Set(queryTokens(query.toLowerCase()).filter((part) => part.length >= 2))) {
|
|
93
96
|
for (let index = lower.indexOf(token); index >= 0; index = lower.indexOf(token, index + token.length)) {
|
|
94
97
|
ranges.push([index, index + token.length])
|
|
95
98
|
}
|
|
@@ -118,26 +121,43 @@ function emphasized(text: string, ranges: readonly [number, number][]): ReactNod
|
|
|
118
121
|
* The deepest heading of a hit is its title.
|
|
119
122
|
* The headings between the category and it are its path.
|
|
120
123
|
*/
|
|
121
|
-
function headings(hit:
|
|
124
|
+
function headings(hit: RecentHit): { title: string; path: string[] } {
|
|
122
125
|
const named = hit.hierarchy.slice(1).filter((entry): entry is string => entry !== null)
|
|
123
126
|
const title = named.at(-1) ?? hit.url
|
|
124
127
|
|
|
125
128
|
return { title, path: named.slice(0, -1) }
|
|
126
129
|
}
|
|
127
130
|
|
|
128
|
-
function
|
|
131
|
+
function isRecentHit(value: unknown): value is RecentHit {
|
|
132
|
+
if (typeof value !== "object" || value === null) return false
|
|
133
|
+
|
|
134
|
+
const entry = value as Record<string, unknown>
|
|
135
|
+
|
|
136
|
+
return typeof entry.url === "string" && typeof entry.anchor === "string" && Array.isArray(entry.hierarchy)
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* The stored recent hits.
|
|
141
|
+
*
|
|
142
|
+
* An entry of another shape, such as a query string an earlier version kept, is dropped.
|
|
143
|
+
*/
|
|
144
|
+
function readRecent(key: string | undefined): RecentHit[] {
|
|
129
145
|
if (!key) return []
|
|
130
146
|
|
|
131
147
|
try {
|
|
132
148
|
const stored = tryParsingJSON<unknown>(globalThis.localStorage.getItem(key))
|
|
133
149
|
|
|
134
|
-
return Array.isArray(stored) ? stored.filter(
|
|
150
|
+
return Array.isArray(stored) ? stored.filter(isRecentHit) : []
|
|
135
151
|
} catch {
|
|
136
152
|
return []
|
|
137
153
|
}
|
|
138
154
|
}
|
|
139
155
|
|
|
140
|
-
function
|
|
156
|
+
function sameHit(a: RecentHit, b: RecentHit): boolean {
|
|
157
|
+
return a.url === b.url && a.anchor === b.anchor
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
function writeRecent(key: string | undefined, entries: readonly RecentHit[]): void {
|
|
141
161
|
if (!key) return
|
|
142
162
|
|
|
143
163
|
try {
|
|
@@ -179,7 +199,7 @@ export function SearchModal({ open, onClose, onNavigate, search, recentKey }: Se
|
|
|
179
199
|
const [settled, setSettled] = useState<Status>({ kind: "idle" })
|
|
180
200
|
const [selected, setSelected] = useState(0)
|
|
181
201
|
const [loading, setLoading] = useState(false)
|
|
182
|
-
const [recent, setRecent] = useState<
|
|
202
|
+
const [recent, setRecent] = useState<RecentHit[]>([])
|
|
183
203
|
const trimmed = query.trim().slice(0, MAX_QUERY_LENGTH)
|
|
184
204
|
const debounced = useDebouncedValue(trimmed, DEBOUNCE_MS)
|
|
185
205
|
|
|
@@ -254,31 +274,36 @@ export function SearchModal({ open, onClose, onNavigate, search, recentKey }: Se
|
|
|
254
274
|
}))
|
|
255
275
|
}, [response])
|
|
256
276
|
|
|
257
|
-
|
|
277
|
+
// An empty field lists the recent hits as the options, so the arrow keys and Enter reach them.
|
|
278
|
+
const showRecent = trimmed === "" && recent.length > 0
|
|
279
|
+
|
|
280
|
+
const ordered: { hit: RecentHit; order: number }[] = showRecent
|
|
281
|
+
? recent.map((hit, order) => ({ hit, order }))
|
|
282
|
+
: groups.flatMap((group) => group.entries)
|
|
283
|
+
|
|
258
284
|
const optionID = (order: number) => `${baseID}-option-${order}`
|
|
259
285
|
const emphasis = response?.corrected ?? debounced
|
|
260
286
|
|
|
261
|
-
function remember(
|
|
262
|
-
const
|
|
287
|
+
function remember(hit: RecentHit) {
|
|
288
|
+
const entry: RecentHit = { url: hit.url, anchor: hit.anchor, hierarchy: hit.hierarchy }
|
|
289
|
+
const entries = [entry, ...recent.filter((other) => !sameHit(other, entry))].slice(0, RECENT_LIMIT)
|
|
263
290
|
|
|
264
291
|
setRecent(entries)
|
|
265
292
|
writeRecent(recentKey, entries)
|
|
266
293
|
}
|
|
267
294
|
|
|
268
|
-
function forget(
|
|
269
|
-
const entries = recent.filter((
|
|
295
|
+
function forget(hit: RecentHit) {
|
|
296
|
+
const entries = recent.filter((other) => !sameHit(other, hit))
|
|
270
297
|
|
|
271
298
|
setRecent(entries)
|
|
272
299
|
writeRecent(recentKey, entries)
|
|
300
|
+
setSelected((current) => Math.min(current, Math.max(0, entries.length - 1)))
|
|
273
301
|
}
|
|
274
302
|
|
|
275
|
-
function go(hit:
|
|
303
|
+
function go(hit: RecentHit) {
|
|
276
304
|
const href = hitHref(hit)
|
|
277
305
|
|
|
278
|
-
|
|
279
|
-
remember(trimmed)
|
|
280
|
-
}
|
|
281
|
-
|
|
306
|
+
remember(hit)
|
|
282
307
|
onClose()
|
|
283
308
|
|
|
284
309
|
if (onNavigate) {
|
|
@@ -294,6 +319,19 @@ export function SearchModal({ open, onClose, onNavigate, search, recentKey }: Se
|
|
|
294
319
|
|
|
295
320
|
if (!ordered.length) return
|
|
296
321
|
|
|
322
|
+
// Delete removes the selected recent hit.
|
|
323
|
+
// An option may not contain a button of its own.
|
|
324
|
+
if (showRecent && event.key === "Delete") {
|
|
325
|
+
const entry = ordered[selected]
|
|
326
|
+
|
|
327
|
+
if (entry) {
|
|
328
|
+
event.preventDefault()
|
|
329
|
+
forget(entry.hit)
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
return
|
|
333
|
+
}
|
|
334
|
+
|
|
297
335
|
const last = ordered.length - 1
|
|
298
336
|
|
|
299
337
|
const next =
|
|
@@ -336,14 +374,33 @@ export function SearchModal({ open, onClose, onNavigate, search, recentKey }: Se
|
|
|
336
374
|
}
|
|
337
375
|
}
|
|
338
376
|
|
|
339
|
-
function onLinkClick(event: MouseEvent<HTMLAnchorElement>, hit:
|
|
377
|
+
function onLinkClick(event: MouseEvent<HTMLAnchorElement>, hit: RecentHit) {
|
|
340
378
|
if (event.metaKey || event.ctrlKey || event.shiftKey || event.altKey || event.button !== 0) return
|
|
341
379
|
|
|
342
380
|
event.preventDefault()
|
|
343
381
|
go(hit)
|
|
344
382
|
}
|
|
345
383
|
|
|
346
|
-
|
|
384
|
+
function renderOption(hit: RecentHit, order: number, children: ReactNode) {
|
|
385
|
+
return (
|
|
386
|
+
// The option is the link itself: an option may not contain an interactive element, and
|
|
387
|
+
// `option` is an allowed role on `a[href]`, which keeps the URL for open-in-new-tab.
|
|
388
|
+
<a
|
|
389
|
+
key={order}
|
|
390
|
+
id={optionID(order)}
|
|
391
|
+
role="option"
|
|
392
|
+
aria-selected={order === selected}
|
|
393
|
+
href={hitHref(hit)}
|
|
394
|
+
tabIndex={-1}
|
|
395
|
+
className={`mw-search__option ${hit.anchor === "" ? "mw-search__option--page" : "mw-search__option--section"}`}
|
|
396
|
+
onPointerMove={() => setSelected(order)}
|
|
397
|
+
onClick={(event) => onLinkClick(event, hit)}
|
|
398
|
+
>
|
|
399
|
+
{children}
|
|
400
|
+
</a>
|
|
401
|
+
)
|
|
402
|
+
}
|
|
403
|
+
|
|
347
404
|
const noResults = response !== undefined && response.hits.length === 0
|
|
348
405
|
|
|
349
406
|
return (
|
|
@@ -351,7 +408,12 @@ export function SearchModal({ open, onClose, onNavigate, search, recentKey }: Se
|
|
|
351
408
|
ref={dialogRef}
|
|
352
409
|
className="mw-search"
|
|
353
410
|
aria-label="Search the documentation"
|
|
354
|
-
onClose={
|
|
411
|
+
onClose={() => {
|
|
412
|
+
// The next open starts on the recent hits rather than the last query.
|
|
413
|
+
setQuery("")
|
|
414
|
+
setSelected(0)
|
|
415
|
+
onClose()
|
|
416
|
+
}}
|
|
355
417
|
onClick={onDialogClick}
|
|
356
418
|
>
|
|
357
419
|
<form role="search" className="mw-search__form" onSubmit={(event) => event.preventDefault()}>
|
|
@@ -365,7 +427,7 @@ export function SearchModal({ open, onClose, onNavigate, search, recentKey }: Se
|
|
|
365
427
|
aria-label="Search the documentation"
|
|
366
428
|
aria-autocomplete="list"
|
|
367
429
|
aria-expanded={ordered.length > 0}
|
|
368
|
-
aria-controls={listboxID}
|
|
430
|
+
aria-controls={ordered.length ? listboxID : undefined}
|
|
369
431
|
aria-activedescendant={ordered.length ? optionID(selected) : undefined}
|
|
370
432
|
autoComplete="off"
|
|
371
433
|
spellCheck={false}
|
|
@@ -386,29 +448,6 @@ export function SearchModal({ open, onClose, onNavigate, search, recentKey }: Se
|
|
|
386
448
|
)}
|
|
387
449
|
|
|
388
450
|
<div className="mw-search__body">
|
|
389
|
-
{showRecent && (
|
|
390
|
-
<section className="mw-search__recent" aria-label="Recent searches">
|
|
391
|
-
<div className="mw-search__category">Recent</div>
|
|
392
|
-
<ul className="mw-search__recent-list">
|
|
393
|
-
{recent.map((entry) => (
|
|
394
|
-
<li key={entry} className="mw-search__recent-item">
|
|
395
|
-
<button type="button" className="mw-search__recent-query" onClick={() => setQuery(entry)}>
|
|
396
|
-
{entry}
|
|
397
|
-
</button>
|
|
398
|
-
<button
|
|
399
|
-
type="button"
|
|
400
|
-
className="mw-search__recent-remove"
|
|
401
|
-
aria-label={`Remove “${entry}” from recent searches`}
|
|
402
|
-
onClick={() => forget(entry)}
|
|
403
|
-
>
|
|
404
|
-
×
|
|
405
|
-
</button>
|
|
406
|
-
</li>
|
|
407
|
-
))}
|
|
408
|
-
</ul>
|
|
409
|
-
</section>
|
|
410
|
-
)}
|
|
411
|
-
|
|
412
451
|
{noResults && (
|
|
413
452
|
<p className="mw-search__empty">
|
|
414
453
|
No results for “{response.query}”. Try a different spelling or a shorter query.
|
|
@@ -416,43 +455,53 @@ export function SearchModal({ open, onClose, onNavigate, search, recentKey }: Se
|
|
|
416
455
|
)}
|
|
417
456
|
|
|
418
457
|
<div id={listboxID} role="listbox" aria-label="Search results" className="mw-search__results">
|
|
419
|
-
{
|
|
420
|
-
<div
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
aria-labelledby={`${baseID}-group-${groupIndex}`}
|
|
424
|
-
className="mw-search__group"
|
|
425
|
-
>
|
|
426
|
-
<div id={`${baseID}-group-${groupIndex}`} className="mw-search__category">
|
|
427
|
-
{group.category}
|
|
458
|
+
{showRecent ? (
|
|
459
|
+
<div role="group" aria-labelledby={`${baseID}-recent`} className="mw-search__group">
|
|
460
|
+
<div id={`${baseID}-recent`} className="mw-search__category">
|
|
461
|
+
Recent
|
|
428
462
|
</div>
|
|
429
|
-
{
|
|
463
|
+
{recent.map((hit, order) => {
|
|
430
464
|
const { title, path } = headings(hit)
|
|
431
465
|
|
|
432
|
-
return (
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
key={order}
|
|
437
|
-
id={optionID(order)}
|
|
438
|
-
role="option"
|
|
439
|
-
aria-selected={order === selected}
|
|
440
|
-
href={hitHref(hit)}
|
|
441
|
-
tabIndex={-1}
|
|
442
|
-
className={`mw-search__option ${hit.anchor === "" ? "mw-search__option--page" : "mw-search__option--section"}`}
|
|
443
|
-
onPointerMove={() => setSelected(order)}
|
|
444
|
-
onClick={(event) => onLinkClick(event, hit)}
|
|
445
|
-
>
|
|
466
|
+
return renderOption(
|
|
467
|
+
hit,
|
|
468
|
+
order,
|
|
469
|
+
<>
|
|
446
470
|
{path.length > 0 && <span className="mw-search__path">{path.join(" › ")}</span>}
|
|
447
|
-
<span className="mw-search__title">{
|
|
448
|
-
|
|
449
|
-
<span className="mw-search__snippet">{emphasized(hit.snippet, hit.highlights)}</span>
|
|
450
|
-
)}
|
|
451
|
-
</a>
|
|
471
|
+
<span className="mw-search__title">{title}</span>
|
|
472
|
+
</>
|
|
452
473
|
)
|
|
453
474
|
})}
|
|
454
475
|
</div>
|
|
455
|
-
)
|
|
476
|
+
) : (
|
|
477
|
+
groups.map((group, groupIndex) => (
|
|
478
|
+
<div
|
|
479
|
+
key={group.category}
|
|
480
|
+
role="group"
|
|
481
|
+
aria-labelledby={`${baseID}-group-${groupIndex}`}
|
|
482
|
+
className="mw-search__group"
|
|
483
|
+
>
|
|
484
|
+
<div id={`${baseID}-group-${groupIndex}`} className="mw-search__category">
|
|
485
|
+
{group.category}
|
|
486
|
+
</div>
|
|
487
|
+
{group.entries.map(({ hit, order }) => {
|
|
488
|
+
const { title, path } = headings(hit)
|
|
489
|
+
|
|
490
|
+
return renderOption(
|
|
491
|
+
hit,
|
|
492
|
+
order,
|
|
493
|
+
<>
|
|
494
|
+
{path.length > 0 && <span className="mw-search__path">{path.join(" › ")}</span>}
|
|
495
|
+
<span className="mw-search__title">{emphasized(title, tokenRanges(title, emphasis))}</span>
|
|
496
|
+
{hit.snippet !== "" && (
|
|
497
|
+
<span className="mw-search__snippet">{emphasized(hit.snippet, hit.highlights)}</span>
|
|
498
|
+
)}
|
|
499
|
+
</>
|
|
500
|
+
)
|
|
501
|
+
})}
|
|
502
|
+
</div>
|
|
503
|
+
))
|
|
504
|
+
)}
|
|
456
505
|
</div>
|
|
457
506
|
</div>
|
|
458
507
|
|
|
@@ -468,6 +517,11 @@ export function SearchModal({ open, onClose, onNavigate, search, recentKey }: Se
|
|
|
468
517
|
<kbd>↑</kbd>
|
|
469
518
|
<kbd>↓</kbd> move
|
|
470
519
|
</li>
|
|
520
|
+
{showRecent && (
|
|
521
|
+
<li>
|
|
522
|
+
<kbd>del</kbd> remove
|
|
523
|
+
</li>
|
|
524
|
+
)}
|
|
471
525
|
<li>
|
|
472
526
|
<kbd>esc</kbd> close
|
|
473
527
|
</li>
|
package/lib/search/search.css
CHANGED
|
@@ -115,50 +115,6 @@
|
|
|
115
115
|
font-weight: var(--font-weight-semibold);
|
|
116
116
|
}
|
|
117
117
|
|
|
118
|
-
.mw-search__recent-list {
|
|
119
|
-
margin: 0;
|
|
120
|
-
padding: 0;
|
|
121
|
-
list-style: none;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
.mw-search__recent-item {
|
|
125
|
-
display: flex;
|
|
126
|
-
align-items: center;
|
|
127
|
-
border-radius: var(--radius-control);
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
.mw-search__recent-item:hover {
|
|
131
|
-
background: var(--color-background-sunken);
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
.mw-search__recent-query {
|
|
135
|
-
flex: 1 1 auto;
|
|
136
|
-
padding: var(--space-3) var(--space-4);
|
|
137
|
-
color: inherit;
|
|
138
|
-
font: inherit;
|
|
139
|
-
text-align: left;
|
|
140
|
-
background: transparent;
|
|
141
|
-
border: 0;
|
|
142
|
-
cursor: pointer;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
.mw-search__recent-remove {
|
|
146
|
-
flex: 0 0 auto;
|
|
147
|
-
width: 44px;
|
|
148
|
-
height: 44px;
|
|
149
|
-
color: var(--color-text-secondary);
|
|
150
|
-
font: inherit;
|
|
151
|
-
font-size: var(--font-size-body);
|
|
152
|
-
background: transparent;
|
|
153
|
-
border: 0;
|
|
154
|
-
cursor: pointer;
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
.mw-search__recent-remove:hover,
|
|
158
|
-
.mw-search__recent-remove:focus-visible {
|
|
159
|
-
color: var(--color-text-primary);
|
|
160
|
-
}
|
|
161
|
-
|
|
162
118
|
.mw-search__empty {
|
|
163
119
|
margin: 0;
|
|
164
120
|
padding: var(--space-5) var(--space-4);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Sister Software
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @author Teffen Ellis, et al.
|
|
5
|
+
*
|
|
6
|
+
* How a docs search query divides into terms. The query code matches these terms against the index,
|
|
7
|
+
* and the modal emphasizes the same terms in a hit's title, so the two agree on what matched.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* The parts of the text that the index tokenizer can index: its runs of letters and digits.
|
|
12
|
+
*
|
|
13
|
+
* The index drops term positions, so a quoted FTS5 string must hold one token.
|
|
14
|
+
* The text is split where the `unicode61` tokenizer splits it, at any character
|
|
15
|
+
* that is neither a letter nor a digit.
|
|
16
|
+
*/
|
|
17
|
+
export function queryTokens(text: string): string[] {
|
|
18
|
+
return text.split(/[^\p{L}\p{N}]+/u).filter((token) => token !== "")
|
|
19
|
+
}
|
package/lib/search.ts
CHANGED
|
@@ -7,5 +7,6 @@
|
|
|
7
7
|
|
|
8
8
|
export { hitHref, SearchModal } from "./search/SearchModal.tsx"
|
|
9
9
|
export type { SearchModalProps } from "./search/SearchModal.tsx"
|
|
10
|
+
export { queryTokens } from "./search/tokens.ts"
|
|
10
11
|
export { HIERARCHY_DEPTH } from "./search/types.ts"
|
|
11
12
|
export type { SearchHit, SearchRecord, SearchResponse } from "./search/types.ts"
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
* background, the backdrop, the close on Escape and the return of focus to the opener. The query field is an
|
|
8
8
|
* `<input type="search">` with the ARIA combobox role. DOM focus stays on the input, and
|
|
9
9
|
* `aria-activedescendant` identifies the selected hit. The component owns no data access: `search` is
|
|
10
|
-
* passed in.
|
|
11
|
-
* without them.
|
|
10
|
+
* passed in. The hits a reader opened are kept as recent hits, a per-viewer convenience in
|
|
11
|
+
* `localStorage`; the modal renders the same without them.
|
|
12
12
|
*/
|
|
13
13
|
import type { SearchHit, SearchResponse } from "./types.ts";
|
|
14
14
|
export interface SearchModalProps {
|
|
@@ -27,8 +27,8 @@ export interface SearchModalProps {
|
|
|
27
27
|
*/
|
|
28
28
|
search: (q: string, signal: AbortSignal) => Promise<SearchResponse>;
|
|
29
29
|
/**
|
|
30
|
-
* The `localStorage` key under which
|
|
31
|
-
* Absent, recent
|
|
30
|
+
* The `localStorage` key under which recently opened hits are kept.
|
|
31
|
+
* Absent, recent hits are not kept.
|
|
32
32
|
*/
|
|
33
33
|
recentKey?: string;
|
|
34
34
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchModal.d.ts","sourceRoot":"","sources":["../../lib/search/SearchModal.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;
|
|
1
|
+
{"version":3,"file":"SearchModal.d.ts","sourceRoot":"","sources":["../../lib/search/SearchModal.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAQH,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAE3D,MAAM,WAAW,gBAAgB;IAChC,IAAI,EAAE,OAAO,CAAA;IACb,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB;;;OAGG;IACH,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;IACnC;;;;;OAKG;IACH,MAAM,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,KAAK,OAAO,CAAC,cAAc,CAAC,CAAA;IACnE;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;CAClB;AAuBD;;GAEG;AACH,wBAAgB,OAAO,CAAC,GAAG,EAAE,IAAI,CAAC,SAAS,EAAE,KAAK,GAAG,QAAQ,CAAC,GAAG,MAAM,CAEtE;AA2HD,wBAAgB,WAAW,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,EAAE,gBAAgB,+BAmV7F"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
/**
|
|
3
3
|
* @copyright Sister Software
|
|
4
4
|
* @license AGPL-3.0
|
|
@@ -8,12 +8,13 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
8
8
|
* background, the backdrop, the close on Escape and the return of focus to the opener. The query field is an
|
|
9
9
|
* `<input type="search">` with the ARIA combobox role. DOM focus stays on the input, and
|
|
10
10
|
* `aria-activedescendant` identifies the selected hit. The component owns no data access: `search` is
|
|
11
|
-
* passed in.
|
|
12
|
-
* without them.
|
|
11
|
+
* passed in. The hits a reader opened are kept as recent hits, a per-viewer convenience in
|
|
12
|
+
* `localStorage`; the modal renders the same without them.
|
|
13
13
|
*/
|
|
14
14
|
import { stringifyJSON, tryParsingJSON } from "@mailwoman/core/json";
|
|
15
15
|
import { useEffect, useId, useMemo, useRef, useState } from "react";
|
|
16
16
|
import { useDebouncedValue } from "#common/useDebouncedValue";
|
|
17
|
+
import { queryTokens } from "./tokens.js";
|
|
17
18
|
const DEBOUNCE_MS = 150;
|
|
18
19
|
/**
|
|
19
20
|
* How long a request runs before the live region announces that the index is loading.
|
|
@@ -42,14 +43,13 @@ function statusText(status) {
|
|
|
42
43
|
}
|
|
43
44
|
/**
|
|
44
45
|
* The ranges of `text` that match a query token, case-insensitively, for emphasis in a title.
|
|
46
|
+
*
|
|
47
|
+
* The tokens are the ones the index matched on, so `tier-1 locale` emphasizes `tier` and `locale`.
|
|
45
48
|
*/
|
|
46
49
|
function tokenRanges(text, query) {
|
|
47
50
|
const lower = text.toLowerCase();
|
|
48
51
|
const ranges = [];
|
|
49
|
-
for (const token of new Set(query
|
|
50
|
-
.toLowerCase()
|
|
51
|
-
.split(/\s+/)
|
|
52
|
-
.filter((part) => part.length >= 2))) {
|
|
52
|
+
for (const token of new Set(queryTokens(query.toLowerCase()).filter((part) => part.length >= 2))) {
|
|
53
53
|
for (let index = lower.indexOf(token); index >= 0; index = lower.indexOf(token, index + token.length)) {
|
|
54
54
|
ranges.push([index, index + token.length]);
|
|
55
55
|
}
|
|
@@ -77,17 +77,31 @@ function headings(hit) {
|
|
|
77
77
|
const title = named.at(-1) ?? hit.url;
|
|
78
78
|
return { title, path: named.slice(0, -1) };
|
|
79
79
|
}
|
|
80
|
+
function isRecentHit(value) {
|
|
81
|
+
if (typeof value !== "object" || value === null)
|
|
82
|
+
return false;
|
|
83
|
+
const entry = value;
|
|
84
|
+
return typeof entry.url === "string" && typeof entry.anchor === "string" && Array.isArray(entry.hierarchy);
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* The stored recent hits.
|
|
88
|
+
*
|
|
89
|
+
* An entry of another shape, such as a query string an earlier version kept, is dropped.
|
|
90
|
+
*/
|
|
80
91
|
function readRecent(key) {
|
|
81
92
|
if (!key)
|
|
82
93
|
return [];
|
|
83
94
|
try {
|
|
84
95
|
const stored = tryParsingJSON(globalThis.localStorage.getItem(key));
|
|
85
|
-
return Array.isArray(stored) ? stored.filter(
|
|
96
|
+
return Array.isArray(stored) ? stored.filter(isRecentHit) : [];
|
|
86
97
|
}
|
|
87
98
|
catch {
|
|
88
99
|
return [];
|
|
89
100
|
}
|
|
90
101
|
}
|
|
102
|
+
function sameHit(a, b) {
|
|
103
|
+
return a.url === b.url && a.anchor === b.anchor;
|
|
104
|
+
}
|
|
91
105
|
function writeRecent(key, entries) {
|
|
92
106
|
if (!key)
|
|
93
107
|
return;
|
|
@@ -171,24 +185,28 @@ export function SearchModal({ open, onClose, onNavigate, search, recentKey }) {
|
|
|
171
185
|
entries: entries.map((hit) => ({ hit, order: order++ })),
|
|
172
186
|
}));
|
|
173
187
|
}, [response]);
|
|
174
|
-
|
|
188
|
+
// An empty field lists the recent hits as the options, so the arrow keys and Enter reach them.
|
|
189
|
+
const showRecent = trimmed === "" && recent.length > 0;
|
|
190
|
+
const ordered = showRecent
|
|
191
|
+
? recent.map((hit, order) => ({ hit, order }))
|
|
192
|
+
: groups.flatMap((group) => group.entries);
|
|
175
193
|
const optionID = (order) => `${baseID}-option-${order}`;
|
|
176
194
|
const emphasis = response?.corrected ?? debounced;
|
|
177
|
-
function remember(
|
|
178
|
-
const
|
|
195
|
+
function remember(hit) {
|
|
196
|
+
const entry = { url: hit.url, anchor: hit.anchor, hierarchy: hit.hierarchy };
|
|
197
|
+
const entries = [entry, ...recent.filter((other) => !sameHit(other, entry))].slice(0, RECENT_LIMIT);
|
|
179
198
|
setRecent(entries);
|
|
180
199
|
writeRecent(recentKey, entries);
|
|
181
200
|
}
|
|
182
|
-
function forget(
|
|
183
|
-
const entries = recent.filter((
|
|
201
|
+
function forget(hit) {
|
|
202
|
+
const entries = recent.filter((other) => !sameHit(other, hit));
|
|
184
203
|
setRecent(entries);
|
|
185
204
|
writeRecent(recentKey, entries);
|
|
205
|
+
setSelected((current) => Math.min(current, Math.max(0, entries.length - 1)));
|
|
186
206
|
}
|
|
187
207
|
function go(hit) {
|
|
188
208
|
const href = hitHref(hit);
|
|
189
|
-
|
|
190
|
-
remember(trimmed);
|
|
191
|
-
}
|
|
209
|
+
remember(hit);
|
|
192
210
|
onClose();
|
|
193
211
|
if (onNavigate) {
|
|
194
212
|
onNavigate(href);
|
|
@@ -203,6 +221,16 @@ export function SearchModal({ open, onClose, onNavigate, search, recentKey }) {
|
|
|
203
221
|
return;
|
|
204
222
|
if (!ordered.length)
|
|
205
223
|
return;
|
|
224
|
+
// Delete removes the selected recent hit.
|
|
225
|
+
// An option may not contain a button of its own.
|
|
226
|
+
if (showRecent && event.key === "Delete") {
|
|
227
|
+
const entry = ordered[selected];
|
|
228
|
+
if (entry) {
|
|
229
|
+
event.preventDefault();
|
|
230
|
+
forget(entry.hit);
|
|
231
|
+
}
|
|
232
|
+
return;
|
|
233
|
+
}
|
|
206
234
|
const last = ordered.length - 1;
|
|
207
235
|
const next = event.key === "ArrowDown"
|
|
208
236
|
? selected === last
|
|
@@ -245,11 +273,21 @@ export function SearchModal({ open, onClose, onNavigate, search, recentKey }) {
|
|
|
245
273
|
event.preventDefault();
|
|
246
274
|
go(hit);
|
|
247
275
|
}
|
|
248
|
-
|
|
276
|
+
function renderOption(hit, order, children) {
|
|
277
|
+
return (_jsx("a", { id: optionID(order), role: "option", "aria-selected": order === selected, href: hitHref(hit), tabIndex: -1, className: `mw-search__option ${hit.anchor === "" ? "mw-search__option--page" : "mw-search__option--section"}`, onPointerMove: () => setSelected(order), onClick: (event) => onLinkClick(event, hit), children: children }, order));
|
|
278
|
+
}
|
|
249
279
|
const noResults = response !== undefined && response.hits.length === 0;
|
|
250
|
-
return (_jsxs("dialog", { ref: dialogRef, className: "mw-search", "aria-label": "Search the documentation", onClose:
|
|
280
|
+
return (_jsxs("dialog", { ref: dialogRef, className: "mw-search", "aria-label": "Search the documentation", onClose: () => {
|
|
281
|
+
// The next open starts on the recent hits rather than the last query.
|
|
282
|
+
setQuery("");
|
|
283
|
+
setSelected(0);
|
|
284
|
+
onClose();
|
|
285
|
+
}, onClick: onDialogClick, children: [_jsxs("form", { role: "search", className: "mw-search__form", onSubmit: (event) => event.preventDefault(), children: [_jsxs("label", { className: "mw-search__field", children: [loading ? _jsx(Spinner, {}) : _jsx(SearchIcon, {}), _jsx("input", { ref: inputRef, type: "search", className: "mw-search__input", role: "combobox", "aria-label": "Search the documentation", "aria-autocomplete": "list", "aria-expanded": ordered.length > 0, "aria-controls": ordered.length ? listboxID : undefined, "aria-activedescendant": ordered.length ? optionID(selected) : undefined, autoComplete: "off", spellCheck: false, maxLength: MAX_QUERY_LENGTH, placeholder: "Search the documentation", value: query, onChange: (event) => setQuery(event.target.value), onKeyDown: onKeyDown })] }), _jsx("button", { type: "button", className: "mw-search__cancel", onClick: () => dialogRef.current?.close(), children: "Cancel" })] }), response?.corrected != null && (_jsxs("p", { className: "mw-search__corrected", children: ["Showing results for \u201C", response.corrected, "\u201D"] })), _jsxs("div", { className: "mw-search__body", children: [noResults && (_jsxs("p", { className: "mw-search__empty", children: ["No results for \u201C", response.query, "\u201D. Try a different spelling or a shorter query."] })), _jsx("div", { id: listboxID, role: "listbox", "aria-label": "Search results", className: "mw-search__results", children: showRecent ? (_jsxs("div", { role: "group", "aria-labelledby": `${baseID}-recent`, className: "mw-search__group", children: [_jsx("div", { id: `${baseID}-recent`, className: "mw-search__category", children: "Recent" }), recent.map((hit, order) => {
|
|
286
|
+
const { title, path } = headings(hit);
|
|
287
|
+
return renderOption(hit, order, _jsxs(_Fragment, { children: [path.length > 0 && _jsx("span", { className: "mw-search__path", children: path.join(" › ") }), _jsx("span", { className: "mw-search__title", children: title })] }));
|
|
288
|
+
})] })) : (groups.map((group, groupIndex) => (_jsxs("div", { role: "group", "aria-labelledby": `${baseID}-group-${groupIndex}`, className: "mw-search__group", children: [_jsx("div", { id: `${baseID}-group-${groupIndex}`, className: "mw-search__category", children: group.category }), group.entries.map(({ hit, order }) => {
|
|
251
289
|
const { title, path } = headings(hit);
|
|
252
|
-
return (
|
|
253
|
-
})] }, group.category))) })] }), _jsxs("footer", { className: "mw-search__footer", children: [_jsx("p", { "aria-live": "polite", className: "mw-search__status", children: statusText(announced) }), _jsxs("ul", { className: "mw-search__hints", "aria-label": "Keyboard shortcuts", children: [_jsxs("li", { children: [_jsx("kbd", { children: "\u21B5" }), " open"] }), _jsxs("li", { children: [_jsx("kbd", { children: "\u2191" }), _jsx("kbd", { children: "\u2193" }), " move"] }), _jsxs("li", { children: [_jsx("kbd", { children: "esc" }), " close"] })] })] })] }));
|
|
290
|
+
return renderOption(hit, order, _jsxs(_Fragment, { children: [path.length > 0 && _jsx("span", { className: "mw-search__path", children: path.join(" › ") }), _jsx("span", { className: "mw-search__title", children: emphasized(title, tokenRanges(title, emphasis)) }), hit.snippet !== "" && (_jsx("span", { className: "mw-search__snippet", children: emphasized(hit.snippet, hit.highlights) }))] }));
|
|
291
|
+
})] }, group.category)))) })] }), _jsxs("footer", { className: "mw-search__footer", children: [_jsx("p", { "aria-live": "polite", className: "mw-search__status", children: statusText(announced) }), _jsxs("ul", { className: "mw-search__hints", "aria-label": "Keyboard shortcuts", children: [_jsxs("li", { children: [_jsx("kbd", { children: "\u21B5" }), " open"] }), _jsxs("li", { children: [_jsx("kbd", { children: "\u2191" }), _jsx("kbd", { children: "\u2193" }), " move"] }), showRecent && (_jsxs("li", { children: [_jsx("kbd", { children: "del" }), " remove"] })), _jsxs("li", { children: [_jsx("kbd", { children: "esc" }), " close"] })] })] })] }));
|
|
254
292
|
}
|
|
255
293
|
//# sourceMappingURL=SearchModal.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchModal.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oCAErC,OAAO,YAAY,CAClB,GAAG,EACH,KAAK,EACL,8BACE,IAAI,CAAC,MAAM,GAAG,CAAC,IAAI,eAAM,SAAS,EAAC,iBAAiB,YAAE,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,GAAQ,EAC/E,eAAM,SAAS,EAAC,kBAAkB,YAAE,UAAU,CAAC,KAAK,EAAE,WAAW,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,GAAQ,EAC1F,GAAG,CAAC,OAAO,KAAK,EAAE,IAAI,CACtB,eAAM,SAAS,EAAC,oBAAoB,YAAE,UAAU,CAAC,GAAG,CAAC,OAAO,EAAE,GAAG,CAAC,UAAU,CAAC,GAAQ,CACrF,IACC,CACH,CAAA;gCACF,CAAC,CAAC,KAtBG,KAAK,CAAC,QAAQ,CAuBd,CACN,CAAC,CACF,GACI,IACD,EAEN,kBAAQ,SAAS,EAAC,mBAAmB,aACpC,yBAAa,QAAQ,EAAC,SAAS,EAAC,mBAAmB,YACjD,UAAU,CAAC,SAAS,CAAC,GACnB,EACJ,cAAI,SAAS,EAAC,kBAAkB,gBAAY,oBAAoB,aAC/D,yBACC,mCAAY,aACR,EACL,yBACC,mCAAY,EACZ,mCAAY,aACR,EACJ,UAAU,IAAI,CACd,yBACC,gCAAc,eACV,CACL,EACD,yBACC,gCAAc,cACV,IACD,IACG,IACD,CACT,CAAA;AACF,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Sister Software
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @author Teffen Ellis, et al.
|
|
5
|
+
*
|
|
6
|
+
* How a docs search query divides into terms. The query code matches these terms against the index,
|
|
7
|
+
* and the modal emphasizes the same terms in a hit's title, so the two agree on what matched.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* The parts of the text that the index tokenizer can index: its runs of letters and digits.
|
|
11
|
+
*
|
|
12
|
+
* The index drops term positions, so a quoted FTS5 string must hold one token.
|
|
13
|
+
* The text is split where the `unicode61` tokenizer splits it, at any character
|
|
14
|
+
* that is neither a letter nor a digit.
|
|
15
|
+
*/
|
|
16
|
+
export declare function queryTokens(text: string): string[];
|
|
17
|
+
//# sourceMappingURL=tokens.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tokens.d.ts","sourceRoot":"","sources":["../../lib/search/tokens.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAElD"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Sister Software
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @author Teffen Ellis, et al.
|
|
5
|
+
*
|
|
6
|
+
* How a docs search query divides into terms. The query code matches these terms against the index,
|
|
7
|
+
* and the modal emphasizes the same terms in a hit's title, so the two agree on what matched.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* The parts of the text that the index tokenizer can index: its runs of letters and digits.
|
|
11
|
+
*
|
|
12
|
+
* The index drops term positions, so a quoted FTS5 string must hold one token.
|
|
13
|
+
* The text is split where the `unicode61` tokenizer splits it, at any character
|
|
14
|
+
* that is neither a letter nor a digit.
|
|
15
|
+
*/
|
|
16
|
+
export function queryTokens(text) {
|
|
17
|
+
return text.split(/[^\p{L}\p{N}]+/u).filter((token) => token !== "");
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=tokens.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tokens.js","sourceRoot":"","sources":["../../lib/search/tokens.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;;;;;GAMG;AACH,MAAM,UAAU,WAAW,CAAC,IAAY;IACvC,OAAO,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,EAAE,CAAC,CAAA;AACrE,CAAC"}
|
package/out/search.d.ts
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
export { hitHref, SearchModal } from "./search/SearchModal.tsx";
|
|
8
8
|
export type { SearchModalProps } from "./search/SearchModal.tsx";
|
|
9
|
+
export { queryTokens } from "./search/tokens.ts";
|
|
9
10
|
export { HIERARCHY_DEPTH } from "./search/types.ts";
|
|
10
11
|
export type { SearchHit, SearchRecord, SearchResponse } from "./search/types.ts";
|
|
11
12
|
//# sourceMappingURL=search.d.ts.map
|
package/out/search.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../lib/search.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AAC/D,YAAY,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnD,YAAY,EAAE,SAAS,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA"}
|
|
1
|
+
{"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../lib/search.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AAC/D,YAAY,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnD,YAAY,EAAE,SAAS,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA"}
|
package/out/search.js
CHANGED
package/out/search.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search.js","sourceRoot":"","sources":["../lib/search.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,yBAA0B,CAAA;AAE/D,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA"}
|
|
1
|
+
{"version":3,"file":"search.js","sourceRoot":"","sources":["../lib/search.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,yBAA0B,CAAA;AAE/D,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mailwoman/react",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.6.0",
|
|
4
4
|
"description": "React components + headless hooks for mailwoman — parse/geocode/POI explorers, Storybook-tested, Docusaurus-independent.",
|
|
5
5
|
"license": "AGPL-3.0-only OR LicenseRef-Commercial",
|
|
6
6
|
"repository": {
|
|
@@ -76,21 +76,11 @@
|
|
|
76
76
|
"node": "./out/common/KindBadge.js",
|
|
77
77
|
"default": "./out/common/KindBadge.js"
|
|
78
78
|
},
|
|
79
|
-
"./search": {
|
|
80
|
-
"types": "./out/search.d.ts",
|
|
81
|
-
"node": "./out/search.js",
|
|
82
|
-
"default": "./out/search.js"
|
|
83
|
-
},
|
|
84
79
|
"./search/SearchModal": {
|
|
85
80
|
"types": "./out/search/SearchModal.d.ts",
|
|
86
81
|
"node": "./out/search/SearchModal.js",
|
|
87
82
|
"default": "./out/search/SearchModal.js"
|
|
88
83
|
},
|
|
89
|
-
"./search/types": {
|
|
90
|
-
"types": "./out/search/types.d.ts",
|
|
91
|
-
"node": "./out/search/types.js",
|
|
92
|
-
"default": "./out/search/types.js"
|
|
93
|
-
},
|
|
94
84
|
"./map/AppIdentity": {
|
|
95
85
|
"types": "./out/map/AppIdentity.d.ts",
|
|
96
86
|
"node": "./out/map/AppIdentity.js",
|
|
@@ -275,21 +265,11 @@
|
|
|
275
265
|
"node": "./out/common/KindBadge.js",
|
|
276
266
|
"default": "./out/common/KindBadge.js"
|
|
277
267
|
},
|
|
278
|
-
"./search": {
|
|
279
|
-
"types": "./out/search.d.ts",
|
|
280
|
-
"node": "./out/search.js",
|
|
281
|
-
"default": "./out/search.js"
|
|
282
|
-
},
|
|
283
268
|
"./search/SearchModal": {
|
|
284
269
|
"types": "./out/search/SearchModal.d.ts",
|
|
285
270
|
"node": "./out/search/SearchModal.js",
|
|
286
271
|
"default": "./out/search/SearchModal.js"
|
|
287
272
|
},
|
|
288
|
-
"./search/types": {
|
|
289
|
-
"types": "./out/search/types.d.ts",
|
|
290
|
-
"node": "./out/search/types.js",
|
|
291
|
-
"default": "./out/search/types.js"
|
|
292
|
-
},
|
|
293
273
|
"./map/AppIdentity": {
|
|
294
274
|
"types": "./out/map/AppIdentity.d.ts",
|
|
295
275
|
"node": "./out/map/AppIdentity.js",
|
|
@@ -477,11 +457,11 @@
|
|
|
477
457
|
"test:node": "vitest run --config vitest.node.config.ts"
|
|
478
458
|
},
|
|
479
459
|
"dependencies": {
|
|
480
|
-
"@mailwoman/core": "10.
|
|
481
|
-
"@mailwoman/kind-classifier": "10.
|
|
482
|
-
"@mailwoman/poi-taxonomy": "10.
|
|
483
|
-
"@mailwoman/query-shape": "10.
|
|
484
|
-
"@mailwoman/spatial": "10.
|
|
460
|
+
"@mailwoman/core": "10.6.0",
|
|
461
|
+
"@mailwoman/kind-classifier": "10.6.0",
|
|
462
|
+
"@mailwoman/poi-taxonomy": "10.6.0",
|
|
463
|
+
"@mailwoman/query-shape": "10.6.0",
|
|
464
|
+
"@mailwoman/spatial": "10.6.0",
|
|
485
465
|
"@types/geojson": "^7946.0.16"
|
|
486
466
|
},
|
|
487
467
|
"devDependencies": {
|