@react-hive/honey-layout 2.4.0 → 2.6.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/dist/components/HoneyOverlay.d.ts +28 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/contexts/HoneyLayoutContext.d.ts +4 -4
- package/dist/helpers/dom.helpers.d.ts +1 -0
- package/dist/{helpers.d.ts → helpers/helpers.d.ts} +1 -1
- package/dist/helpers/index.d.ts +3 -0
- package/dist/helpers/react.helpers.d.ts +2 -0
- package/dist/hooks/use-honey-overlay.d.ts +20 -1
- package/dist/hooks/use-register-honey-overlay.d.ts +10 -2
- package/dist/index.js +1263 -1204
- package/dist/providers/hooks/use-honey-overlays.d.ts +3 -3
- package/dist/types/types.d.ts +20 -7
- package/package.json +6 -5
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { HoneyActiveOverlay } from '../../types';
|
|
2
2
|
import { HoneyRegisterOverlay, HoneyUnregisterOverlay } from '../../contexts';
|
|
3
3
|
/**
|
|
4
4
|
* Hook to manage a stack of overlays, allowing registration and unregistration of overlays,
|
|
5
|
-
* as well as handling keyboard events.
|
|
5
|
+
* as well as handling keyboard events for the topmost overlay.
|
|
6
6
|
*/
|
|
7
7
|
export declare const useHoneyOverlays: () => {
|
|
8
|
-
overlays:
|
|
8
|
+
overlays: HoneyActiveOverlay[];
|
|
9
9
|
registerOverlay: HoneyRegisterOverlay;
|
|
10
10
|
unregisterOverlay: HoneyUnregisterOverlay;
|
|
11
11
|
};
|
package/dist/types/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ElementType } from 'react';
|
|
1
|
+
import { ElementType, MutableRefObject } from 'react';
|
|
2
2
|
import { ExecutionContext, Interpolation } from 'styled-components';
|
|
3
3
|
import { DataType } from 'csstype';
|
|
4
4
|
import { HoneyCSSColorProperty, HoneyCSSDimensionNumericValue, HoneyCSSDimensionValue } from './css.types';
|
|
@@ -188,7 +188,7 @@ interface BaseHoneyColors {
|
|
|
188
188
|
* Example of augmenting the colors interface.
|
|
189
189
|
*
|
|
190
190
|
* @example
|
|
191
|
-
* ```
|
|
191
|
+
* ```ts
|
|
192
192
|
* declare module '@react-hive/honey-layout' {
|
|
193
193
|
* export interface HoneyColors {
|
|
194
194
|
* neutral: Record<'charcoalDark' | 'charcoalGray' | 'crimsonRed', HoneyCSSColor>;
|
|
@@ -207,7 +207,7 @@ export interface HoneyColors extends BaseHoneyColors {
|
|
|
207
207
|
* @example
|
|
208
208
|
*
|
|
209
209
|
* Given the `HoneyColors` interface:
|
|
210
|
-
* ```
|
|
210
|
+
* ```ts
|
|
211
211
|
* interface HoneyColors {
|
|
212
212
|
* primary: Record<'blue' | 'green', HoneyCSSColor>;
|
|
213
213
|
* neutral: Record<'charcoalDark' | 'charcoalGray' | 'crimsonRed', HoneyCSSColor>;
|
|
@@ -215,7 +215,7 @@ export interface HoneyColors extends BaseHoneyColors {
|
|
|
215
215
|
* ```
|
|
216
216
|
*
|
|
217
217
|
* The resulting `HoneyColorKey` type will be:
|
|
218
|
-
* ```
|
|
218
|
+
* ```ts
|
|
219
219
|
* type HoneyColorKey = 'neutral.charcoalDark' | 'neutral.charcoalGray' | 'neutral.crimsonRed' | 'primary.blue' | 'primary.green';
|
|
220
220
|
* ```
|
|
221
221
|
*/
|
|
@@ -233,7 +233,7 @@ export type HoneyFont = {
|
|
|
233
233
|
* Example of augmenting the fonts interface.
|
|
234
234
|
*
|
|
235
235
|
* @example
|
|
236
|
-
* ```
|
|
236
|
+
* ```ts
|
|
237
237
|
* declare module '@react-hive/honey-layout' {
|
|
238
238
|
* export interface HoneyFonts {
|
|
239
239
|
* body: HoneyFont;
|
|
@@ -264,9 +264,10 @@ export type HoneyOverlayEventListenerType = 'keyup';
|
|
|
264
264
|
* Handler function for an overlay event listener.
|
|
265
265
|
*
|
|
266
266
|
* @param keyCode - The code of the key that triggered the event.
|
|
267
|
+
* @param overlay - The overlay.
|
|
267
268
|
* @param e - The original keyboard event.
|
|
268
269
|
*/
|
|
269
|
-
export type HoneyOverlayEventListenerHandler = (keyCode: HoneyKeyboardEventCode, e: KeyboardEvent) => void;
|
|
270
|
+
export type HoneyOverlayEventListenerHandler = (keyCode: HoneyKeyboardEventCode, overlay: HoneyActiveOverlay, e: KeyboardEvent) => void;
|
|
270
271
|
/**
|
|
271
272
|
* A tuple representing an event listener, including the event type and the handler function.
|
|
272
273
|
*/
|
|
@@ -280,6 +281,8 @@ export type HoneyOverlayEventListener = [
|
|
|
280
281
|
export type HoneyOverlayConfig = {
|
|
281
282
|
/**
|
|
282
283
|
* Custom overlay ID. Automatically generated if not passed.
|
|
284
|
+
*
|
|
285
|
+
* @default generates
|
|
283
286
|
*/
|
|
284
287
|
id?: HoneyOverlayId;
|
|
285
288
|
/**
|
|
@@ -298,11 +301,21 @@ export type HoneyOverlayConfig = {
|
|
|
298
301
|
/**
|
|
299
302
|
* Represents an overlay in the layout, allowing the registration of event listeners and notifying them when events occur.
|
|
300
303
|
*/
|
|
301
|
-
export type
|
|
304
|
+
export type HoneyActiveOverlay = {
|
|
302
305
|
/**
|
|
303
306
|
* Unique identifier for the overlay.
|
|
304
307
|
*/
|
|
305
308
|
id: HoneyOverlayId;
|
|
309
|
+
/**
|
|
310
|
+
* Reference to the container element of the overlay.
|
|
311
|
+
*/
|
|
312
|
+
containerRef: MutableRefObject<Nullable<HTMLDivElement>>;
|
|
313
|
+
/**
|
|
314
|
+
* Sets the container reference for the overlay.
|
|
315
|
+
*
|
|
316
|
+
* @param element - The HTMLDivElement to set as the container.
|
|
317
|
+
*/
|
|
318
|
+
setContainerRef: (element: HTMLDivElement) => void;
|
|
306
319
|
/**
|
|
307
320
|
* Adds an event listener to the overlay.
|
|
308
321
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-hive/honey-layout",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.6.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -39,6 +39,7 @@
|
|
|
39
39
|
"highlight.js": "11.10.0"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
+
"@emotion/is-prop-valid": "1.3.1",
|
|
42
43
|
"lodash.merge": "4.6.2",
|
|
43
44
|
"lodash.debounce": "4.0.8",
|
|
44
45
|
"csstype": "3.1.3"
|
|
@@ -53,7 +54,7 @@
|
|
|
53
54
|
"@types/mdx": "2.0.13",
|
|
54
55
|
"@types/lodash.merge": "4.6.9",
|
|
55
56
|
"@types/lodash.debounce": "4.0.9",
|
|
56
|
-
"@vitejs/plugin-react": "4.3.
|
|
57
|
+
"@vitejs/plugin-react": "4.3.4",
|
|
57
58
|
"@mdx-js/rollup": "3.1.0",
|
|
58
59
|
"eslint": "8.57.0",
|
|
59
60
|
"eslint-config-airbnb": "19.0.4",
|
|
@@ -63,10 +64,10 @@
|
|
|
63
64
|
"eslint-plugin-prettier": "5.2.1",
|
|
64
65
|
"jest": "29.7.0",
|
|
65
66
|
"jest-environment-jsdom": "29.7.0",
|
|
66
|
-
"prettier": "3.
|
|
67
|
+
"prettier": "3.4.1",
|
|
67
68
|
"ts-jest": "29.2.5",
|
|
68
|
-
"typescript": "5.
|
|
69
|
-
"vite": "
|
|
69
|
+
"typescript": "5.7.2",
|
|
70
|
+
"vite": "6.0.1",
|
|
70
71
|
"vite-plugin-dts": "4.3.0",
|
|
71
72
|
"vite-plugin-checker": "0.8.0"
|
|
72
73
|
},
|