@kolkrabbi/kol-workshop 0.2.0 → 0.2.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kolkrabbi/kol-workshop",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
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",
@@ -13,11 +13,11 @@
13
13
  },
14
14
  "dependencies": {
15
15
  "d3": "^7.9.0",
16
- "@kolkrabbi/kol-component": "0.12.19",
17
16
  "@kolkrabbi/kol-brand": "^0.1.2",
18
17
  "@kolkrabbi/kol-icons": "0.8.10",
19
18
  "@kolkrabbi/kol-framework": "0.6.2",
20
- "@kolkrabbi/kol-theme": "0.12.0"
19
+ "@kolkrabbi/kol-theme": "0.12.0",
20
+ "@kolkrabbi/kol-component": "0.12.19"
21
21
  },
22
22
  "peerDependencies": {
23
23
  "react": "^18.3.0 || ^19.0.0",
@@ -46,7 +46,7 @@ const TocColumn = ({ children }) => (
46
46
  </aside>
47
47
  )
48
48
 
49
- const ShellLayout = ({ routes = [], basePath = '/', brandLogoSrc, brandLogoAlt = '', renderSidebar, searchItems, defaultTocContent }) => {
49
+ const ShellLayout = ({ routes = [], basePath = '/', brandLogoSrc, brandLogoAlt = '', renderSidebar, searchItems, defaultTocContent, isActive: isActiveProp }) => {
50
50
  const [isNavDrawerOpen, setIsNavDrawerOpen] = useState(false)
51
51
  const [navCollapsed, setNavCollapsed] = useState(false)
52
52
  const [tocCollapsed, setTocCollapsed] = useState(false)
@@ -94,7 +94,10 @@ const ShellLayout = ({ routes = [], basePath = '/', brandLogoSrc, brandLogoAlt =
94
94
  href: r.path ? joinPath(r.path) : basePath,
95
95
  icon: r.icon,
96
96
  }))
97
- const isActive = (href) => location.pathname === href || location.pathname.startsWith(`${href}/`)
97
+ /* Prefix matching is the default, but a consumer can override it: a tab whose
98
+ * href targets a CHILD page (Docs → /docs/shell-and-layout) must still light
99
+ * up across the whole /docs prefix, which self-matching can't express. */
100
+ const isActive = isActiveProp ?? ((href) => location.pathname === href || location.pathname.startsWith(`${href}/`))
98
101
  const handleNavigate = (event, item) => {
99
102
  if (item.href) {
100
103
  event.preventDefault()