@kolkrabbi/kol-framework 0.35.0 → 0.36.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 +3 -3
- package/src/useDragResize.js +18 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kolkrabbi/kol-framework",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.36.0",
|
|
4
4
|
"description": "KOL app shell — sidenav, layout, theme toggle, footer, heroes + brand color layer. SideNav takes nav data as props so the tree stays app-local.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
"react-router-dom": "^6.0.0 || ^7.0.0"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
|
-
"@kolkrabbi/kol-component": "^0.
|
|
24
|
-
"@kolkrabbi/kol-icons": "^0.
|
|
23
|
+
"@kolkrabbi/kol-component": "^0.142.0",
|
|
24
|
+
"@kolkrabbi/kol-icons": "^0.25.0"
|
|
25
25
|
},
|
|
26
26
|
"files": [
|
|
27
27
|
"src",
|
package/src/useDragResize.js
CHANGED
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
import { useEffect, useMemo, useRef, useState } from 'react'
|
|
2
|
+
/* THE SAME GRAB AS THE SHELL RAIL (OneGrabGestureBothRails, kol-fxr 2026-08-30 —
|
|
3
|
+
* user: *"why dont we use the grab animation and other sidenav settings to be
|
|
4
|
+
* consistent?"*). fxr's /labs shows both rails at once and only the left one
|
|
5
|
+
* woke as the cursor neared it, because each package had built the gesture
|
|
6
|
+
* itself. The hook lives in kol-component, the one package both can reach —
|
|
7
|
+
* kol-shell dropped its framework peer in 0.16.0, so neither could import the
|
|
8
|
+
* other's. */
|
|
9
|
+
import { useGrabEdge } from '@kolkrabbi/kol-component'
|
|
2
10
|
|
|
3
11
|
/* Grab-edge resize + collapse for SideNav — THE single control since 0.17.0
|
|
4
12
|
* (user build order 2026-08-09, completing the SideNavGrabResize brief: the
|
|
@@ -102,6 +110,11 @@ export default function useDragResize(ref, options = {}) {
|
|
|
102
110
|
const dir = side === 'right' ? -1 : 1
|
|
103
111
|
const names = useMemo(() => buildNames(token), [token])
|
|
104
112
|
|
|
113
|
+
/* the handle's own ref, so the shared gesture can find it. Returned in
|
|
114
|
+
* `grabProps`, so a consumer already spreading those gets the wake, the
|
|
115
|
+
* travel and the dwell with no change. */
|
|
116
|
+
const grabRef = useRef(null)
|
|
117
|
+
useGrabEdge(grabRef)
|
|
105
118
|
const drag = useRef(null) // { startX, startW, snapPx, maxPx, moved } during a drag
|
|
106
119
|
const defaultPx = useRef(null)
|
|
107
120
|
const collapsedPx = useRef(null)
|
|
@@ -249,6 +262,11 @@ export default function useDragResize(ref, options = {}) {
|
|
|
249
262
|
collapsed,
|
|
250
263
|
toggleCollapsed,
|
|
251
264
|
grabProps: {
|
|
265
|
+
ref: grabRef,
|
|
266
|
+
/* the pill is drawn by `.kol-rail-grab` (kol-animation.css) — the hook
|
|
267
|
+
* only supplies `is-near` and `--kol-rail-grab-y`. A consumer's own
|
|
268
|
+
* className, spread after this, still wins. */
|
|
269
|
+
className: 'kol-rail-grab',
|
|
252
270
|
role: 'separator',
|
|
253
271
|
'aria-orientation': 'vertical',
|
|
254
272
|
'aria-label': 'Resize navigation',
|