@kolkrabbi/kol-workshop 0.25.0 → 0.26.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/package.json +4 -4
- package/src/shell/ShellLayout.jsx +18 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kolkrabbi/kol-workshop",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.26.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "KOL workshop/docs system — a handrolled markdown engine, search, tag system (incl. a d3 tag graph), docs viewer, and docs shell. Sits above @kolkrabbi/kol-{theme,icons,component,framework}; content is consumer-injected (the package never globs docs).",
|
|
6
6
|
"license": "MIT",
|
|
@@ -25,10 +25,10 @@
|
|
|
25
25
|
"react-router-dom": "^6.0.0 || ^7.0.0"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"@kolkrabbi/kol-component": "^0.
|
|
28
|
+
"@kolkrabbi/kol-component": "^0.150.1",
|
|
29
29
|
"@kolkrabbi/kol-icons": "^0.25.0",
|
|
30
|
-
"@kolkrabbi/kol-
|
|
31
|
-
"@kolkrabbi/kol-
|
|
30
|
+
"@kolkrabbi/kol-theme": "^0.118.0",
|
|
31
|
+
"@kolkrabbi/kol-framework": "^0.36.0"
|
|
32
32
|
},
|
|
33
33
|
"files": [
|
|
34
34
|
"src",
|
|
@@ -117,6 +117,22 @@ const ShellLayout = ({ routes = [], basePath = '/', brand: brandProp, brandLogoS
|
|
|
117
117
|
const setIsSearchOpen = tagMode.isProvided
|
|
118
118
|
? (v) => (v ? tagMode.openTagMode() : tagMode.closeTagMode())
|
|
119
119
|
: setLocalOpen
|
|
120
|
+
/* CLOSE IS ONE CALL (WorkshopSearchCloseUndoneBySetText, kol-website
|
|
121
|
+
* 2026-09-01). Close-and-clear was two: `setIsSearchOpen(false)` then
|
|
122
|
+
* `setSearchQuery('')` — and on the provided path the second is
|
|
123
|
+
* `tagMode.setText`, which force-opens, so both landed in one React batch
|
|
124
|
+
* and the final state was OPEN. The scrim tap (and desktop click) was
|
|
125
|
+
* undone in its own event; Escape only worked because the context's window
|
|
126
|
+
* listener runs after and wins. `closeTagMode()` already resets `text`; the
|
|
127
|
+
* trailing clear is only the local path's job. */
|
|
128
|
+
const closeSearch = () => {
|
|
129
|
+
if (tagMode.isProvided) {
|
|
130
|
+
tagMode.closeTagMode()
|
|
131
|
+
} else {
|
|
132
|
+
setLocalOpen(false)
|
|
133
|
+
setLocalQuery('')
|
|
134
|
+
}
|
|
135
|
+
}
|
|
120
136
|
const [tocContent, setTocContent] = useState(null)
|
|
121
137
|
const [isFullHeight, setIsFullHeight] = useState(false)
|
|
122
138
|
const [contentWidth, setContentWidth] = useState('canvas')
|
|
@@ -362,7 +378,7 @@ const ShellLayout = ({ routes = [], basePath = '/', brand: brandProp, brandLogoS
|
|
|
362
378
|
* Selecting routes to item.href; matchSearchItems is the engine's. */}
|
|
363
379
|
<ShellSearchOverlay
|
|
364
380
|
open={isSearchOpen}
|
|
365
|
-
onClose={
|
|
381
|
+
onClose={closeSearch}
|
|
366
382
|
query={searchQuery}
|
|
367
383
|
onQueryChange={setSearchQuery}
|
|
368
384
|
results={searchResults}
|
|
@@ -385,8 +401,7 @@ const ShellLayout = ({ routes = [], basePath = '/', brand: brandProp, brandLogoS
|
|
|
385
401
|
setSearchQuery('')
|
|
386
402
|
return
|
|
387
403
|
}
|
|
388
|
-
|
|
389
|
-
setSearchQuery('')
|
|
404
|
+
closeSearch()
|
|
390
405
|
if (item?.href) navigate(item.href)
|
|
391
406
|
}}
|
|
392
407
|
>
|