@glimstone/react 4.2.4 → 4.2.6
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/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/useDragArmed.d.ts +7 -0
- package/dist/useDragArmed.js +12 -0
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -46,6 +46,7 @@ export * from "./WindowBar.tsx";
|
|
|
46
46
|
export * from "./glyphs.tsx";
|
|
47
47
|
export * from "./portalHue.ts";
|
|
48
48
|
export * from "./useConfirm.tsx";
|
|
49
|
+
export * from "./useDragArmed.ts";
|
|
49
50
|
export * from "./useLabelMode.ts";
|
|
50
51
|
export * from "./usePaypalButtons.ts";
|
|
51
52
|
export * from "./useTipBubble.tsx";
|
package/dist/index.js
CHANGED
|
@@ -46,6 +46,7 @@ export * from "./WindowBar.js";
|
|
|
46
46
|
export * from "./glyphs.js";
|
|
47
47
|
export * from "./portalHue.js";
|
|
48
48
|
export * from "./useConfirm.js";
|
|
49
|
+
export * from "./useDragArmed.js";
|
|
49
50
|
export * from "./useLabelMode.js";
|
|
50
51
|
export * from "./usePaypalButtons.js";
|
|
51
52
|
export * from "./useTipBubble.js";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type RefObject } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* useDragArmed makes the other items of a reorderable list tremble while one
|
|
4
|
+
* is held, by keeping `glim-drag-armed` on the list. Call it from the drag
|
|
5
|
+
* gesture, so no list can forget the class.
|
|
6
|
+
*/
|
|
7
|
+
export declare function useDragArmed(list: RefObject<HTMLElement | null>, held: boolean): void;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { useLayoutEffect } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* useDragArmed makes the other items of a reorderable list tremble while one
|
|
4
|
+
* is held, by keeping `glim-drag-armed` on the list. Call it from the drag
|
|
5
|
+
* gesture, so no list can forget the class.
|
|
6
|
+
*/
|
|
7
|
+
export function useDragArmed(list, held) {
|
|
8
|
+
// After every render, since a list that rewrites its own className drops the class.
|
|
9
|
+
useLayoutEffect(() => {
|
|
10
|
+
list.current?.classList.toggle("glim-drag-armed", held);
|
|
11
|
+
});
|
|
12
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@glimstone/react",
|
|
3
|
-
"version": "4.2.
|
|
3
|
+
"version": "4.2.6",
|
|
4
4
|
"description": "GlimStone's components for React",
|
|
5
5
|
"license": "AGPL-3.0-only",
|
|
6
6
|
"repository": { "type": "git", "url": "git+https://github.com/junkerderprovinz/glimstone.git", "directory": "packages/react" },
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"build": "tsc -p tsconfig.build.json"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@glimstone/core": "4.2.
|
|
19
|
+
"@glimstone/core": "4.2.6"
|
|
20
20
|
},
|
|
21
21
|
"peerDependencies": {
|
|
22
22
|
"@zag-js/combobox": "^1.46.0",
|