@kolkrabbi/kol-workshop 0.41.1 → 0.41.3

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.41.1",
3
+ "version": "0.41.3",
4
4
  "private": false,
5
5
  "description": "Docs viewer, shell and tag system",
6
6
  "license": "MIT",
@@ -28,10 +28,10 @@
28
28
  "react-router-dom": "^6.0.0 || ^7.0.0"
29
29
  },
30
30
  "devDependencies": {
31
- "@kolkrabbi/kol-component": "^0.311.1",
32
- "@kolkrabbi/kol-framework": "^0.62.1",
31
+ "@kolkrabbi/kol-component": "^0.314.0",
33
32
  "@kolkrabbi/kol-icons": "^0.52.0",
34
- "@kolkrabbi/kol-theme": "^0.196.0"
33
+ "@kolkrabbi/kol-framework": "^0.62.5",
34
+ "@kolkrabbi/kol-theme": "^0.197.0"
35
35
  },
36
36
  "files": [
37
37
  "src",
@@ -2,7 +2,7 @@ import { createContext, useContext, useMemo, useRef, useState, useEffect, Suspen
2
2
  import { Outlet, Link, useLocation, useNavigate, useNavigationType } from 'react-router-dom'
3
3
  import { ShellHeader } from '@kolkrabbi/kol-framework'
4
4
  import ShellSidebar, { RAIL_FOLD_EVENT, ShellRailModeContext } from './ShellSidebar.jsx'
5
- import { FullscreenOverlay, IconFrame, Rail, CommandOverlay, ShortcutsOverlay, SettingsPanel, SettingsSections, SettingsSwitch, Tooltip, useDragResize } from '@kolkrabbi/kol-component'
5
+ import { FullscreenOverlay, IconFrame, Rail, CommandOverlay, ShortcutsOverlay, SettingsPanel, SettingsSections, SettingsSwitch, Tooltip, useDragResize, useScrollFade } from '@kolkrabbi/kol-component'
6
6
  import { createIndex, search } from '@kolkrabbi/kol-search'
7
7
  import { useTagMode } from '../tags/TagModeContext.jsx'
8
8
  import TagModeOverlay from '../tags/TagModeOverlay.jsx'
@@ -11,12 +11,12 @@ import { Asset } from '@kolkrabbi/kol-brand/svg'
11
11
  // Pages can register right-rail TOC content via this context.
12
12
  // Usage: const setTocContent = useContext(ShellTocContext)
13
13
  // useLayoutEffect(() => { setTocContent(<MyToc />) ; return () => setTocContent(null) }, [])
14
- export const ShellTocContext = createContext(null)
14
+ export const ShellTocContext = (globalThis[Symbol.for('@kolkrabbi/kol-workshop/ShellTocContext')] ??= createContext(null))
15
15
 
16
16
  // Pages that need to fill the viewport (e.g. iframe embeds) can opt into full-height mode.
17
17
  // Usage: const setFullHeight = useContext(ShellFullHeightContext)
18
18
  // useLayoutEffect(() => { setFullHeight(true) ; return () => setFullHeight(false) }, [setFullHeight])
19
- export const ShellFullHeightContext = createContext(null)
19
+ export const ShellFullHeightContext = (globalThis[Symbol.for('@kolkrabbi/kol-workshop/ShellFullHeightContext')] ??= createContext(null))
20
20
 
21
21
  // WIDTH IS THE PAGE'S DECISION (user, 2026-08-26 — "there isnt one size fits
22
22
  // all … what I want is consistency, sometimes that is done by left align …
@@ -29,12 +29,12 @@ export const ShellFullHeightContext = createContext(null)
29
29
  // hero, a wall that should use the room it is given
30
30
  // Usage: const setContentWidth = useContext(ShellContentWidthContext)
31
31
  // useLayoutEffect(() => { setContentWidth('none') ; return () => setContentWidth('canvas') }, [setContentWidth])
32
- export const ShellContentWidthContext = createContext(null)
32
+ export const ShellContentWidthContext = (globalThis[Symbol.for('@kolkrabbi/kol-workshop/ShellContentWidthContext')] ??= createContext(null))
33
33
 
34
34
  // Pages can request the right sidebar to start collapsed.
35
35
  // Usage: const setTocCollapsed = useContext(ShellTocCollapsedContext)
36
36
  // useLayoutEffect(() => { setTocCollapsed(true) ; return () => setTocCollapsed(false) }, [setTocCollapsed])
37
- export const ShellTocCollapsedContext = createContext(null)
37
+ export const ShellTocCollapsedContext = (globalThis[Symbol.for('@kolkrabbi/kol-workshop/ShellTocCollapsedContext')] ??= createContext(null))
38
38
 
39
39
  // THE LEFT RAIL IS THE PAGE'S CALL TOO (2026-09-01). The TOC had this seam and
40
40
  // the nav did not, so a landing page could shed one rail and not the other —
@@ -43,7 +43,7 @@ export const ShellTocCollapsedContext = createContext(null)
43
43
  // the header's own toggles keep working on top of it.
44
44
  // Usage: const setNavCollapsed = useContext(ShellNavCollapsedContext)
45
45
  // useLayoutEffect(() => { setNavCollapsed(true) ; return () => setNavCollapsed(false) }, [setNavCollapsed])
46
- export const ShellNavCollapsedContext = createContext(null)
46
+ export const ShellNavCollapsedContext = (globalThis[Symbol.for('@kolkrabbi/kol-workshop/ShellNavCollapsedContext')] ??= createContext(null))
47
47
 
48
48
  /* THE PAGE TELLS THE RAIL WHAT IT IS ABOUT (2026-09-28, user: "the purpose of
49
49
  * the right sidebar is to list that pages content and context"). The right
@@ -54,7 +54,7 @@ export const ShellNavCollapsedContext = createContext(null)
54
54
  * const meta = usePageMetaValue() — in a rail
55
55
  * Cleared on unmount, so a page that says nothing gets an empty context, never
56
56
  * the previous page's. */
57
- const ShellPageMetaContext = createContext({ meta: null, setMeta: null })
57
+ const ShellPageMetaContext = (globalThis[Symbol.for('@kolkrabbi/kol-workshop/ShellPageMetaContext')] ??= createContext({ meta: null, setMeta: null }))
58
58
 
59
59
  export function usePageMeta(meta) {
60
60
  const { setMeta } = useContext(ShellPageMetaContext)
@@ -123,7 +123,7 @@ export function ShellNavColumn({ mode = 'open', children, grip, railRef }) {
123
123
  <aside
124
124
  ref={railRef}
125
125
  aria-label="Navigation"
126
- className={`shell-rail shell-rail--nav shell-sidebar-sticky hidden lg:block pt-6 md:pt-6 lg:pt-8 pb-14 ${icons ? `shell-rail--icons ${peek ? 'is-peek' : ''}` : ''}`.trim()}
126
+ className={`shell-rail shell-rail--nav kol-scroll-fade shell-sidebar-sticky hidden lg:block pt-6 md:pt-6 lg:pt-8 pb-14 ${icons ? `shell-rail--icons ${peek ? 'is-peek' : ''}` : ''}`.trim()}
127
127
  onMouseEnter={icons ? () => setPeek(true) : undefined}
128
128
  onMouseLeave={icons ? () => setPeek(false) : undefined}
129
129
  >
@@ -169,7 +169,7 @@ const MainColumn = ({ children, fullHeight, width = 'canvas', padStart, padEnd }
169
169
  * below). The breakpoint here and the one in gridCols are one decision and
170
170
  * must not be stated twice differently. */
171
171
  const TocColumn = ({ children, grip, railRef }) => (
172
- <aside ref={railRef} aria-label="Table of contents" className="shell-rail shell-rail--toc shell-sidebar-sticky hidden xl:block pt-6 md:pt-6 lg:pt-8 pb-14">
172
+ <aside ref={railRef} aria-label="Table of contents" className="shell-rail shell-rail--toc kol-scroll-fade shell-sidebar-sticky hidden xl:block pt-6 md:pt-6 lg:pt-8 pb-14">
173
173
  {grip}
174
174
  {/* The width is the grid track (--kol-shell-toc-w). An empty rail still
175
175
  * holds its column (user ruling 2026-08-01): a rail that disappears
@@ -225,6 +225,9 @@ const ShellLayout = ({ routes = [], basePath = '/', brand: brandProp, brandLogoS
225
225
  const [tocCollapsed, setTocCollapsed] = useState(() => readSettings().tocHidden === true)
226
226
  const navGrab = useRailGrab('kol-shell-nav', 'left', () => { setNavCollapsed(true); writeSettings({ ...readSettings(), navHidden: true }) })
227
227
  const tocGrab = useRailGrab('kol-shell-toc', 'right', () => { setTocCollapsed(true); writeSettings({ ...readSettings(), tocHidden: true }) })
228
+ /* both rails fade where they clip — the head once scrolled, the foot while more lies below (kol-theme `.kol-scroll-fade`) */
229
+ useScrollFade(navGrab.ref)
230
+ useScrollFade(tocGrab.ref)
228
231
  const [isSettingsOpen, setIsSettingsOpen] = useState(false)
229
232
  /* ONE QUERY (user ruling 2026-08-01). The search modal's text used to live here
230
233
  * while tags lived in TagModeContext — two states, and therefore two
@@ -32,7 +32,7 @@ export const RAIL_FOLD_EVENT = 'kol-rail-fold'
32
32
  * provides the state; every ShellSidebar inside it reads it, so a consumer's rail takes the state
33
33
  * without passing a prop. Outside a provider a rail is `open`, as it always was. A third value,
34
34
  * `full`, is the whole-tree sheet's: an open rail with every fold open. */
35
- export const ShellRailModeContext = createContext('open')
35
+ export const ShellRailModeContext = (globalThis[Symbol.for('@kolkrabbi/kol-workshop/ShellRailModeContext')] ??= createContext('open'))
36
36
 
37
37
  const ShellSidebar = ({ routes = [], basePath = '/', onNavigate, label = 'Navigation', labelTo, collapsed, onToggle, defaultCollapsed = false }) => {
38
38
  const location = useLocation()