@atlaskit/portal 4.2.10 → 4.2.11
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/CHANGELOG.md +6 -0
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types-ts4.0/constants.d.ts +2 -0
- package/dist/types-ts4.0/entry-points/types.d.ts +1 -0
- package/dist/types-ts4.0/index.d.ts +3 -0
- package/dist/types-ts4.0/internal/components/internal-portal.d.ts +7 -0
- package/dist/types-ts4.0/internal/constants.d.ts +3 -0
- package/dist/types-ts4.0/internal/hooks/use-is-subsequent-render.d.ts +2 -0
- package/dist/types-ts4.0/internal/hooks/use-portal-event.d.ts +2 -0
- package/dist/types-ts4.0/internal/types.d.ts +24 -0
- package/dist/types-ts4.0/internal/utils/portal-custom-event.d.ts +6 -0
- package/dist/types-ts4.0/internal/utils/portal-dom-utils.d.ts +17 -0
- package/dist/types-ts4.0/portal.d.ts +3 -0
- package/dist/types-ts4.0/types.d.ts +13 -0
- package/package.json +14 -7
- package/types/package.json +8 -1
package/CHANGELOG.md
CHANGED
package/dist/cjs/version.json
CHANGED
package/dist/es2019/version.json
CHANGED
package/dist/esm/version.json
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type { PortalEvent, PortalProps } from '../types';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { Layers } from '@atlaskit/theme/types';
|
|
2
|
+
/**
|
|
3
|
+
* Named layers of all z-index used in the Atlassian Design System.
|
|
4
|
+
*/
|
|
5
|
+
export declare type LayerName = keyof Layers;
|
|
6
|
+
/**
|
|
7
|
+
* Creates a new type by reversing the key and values of the passed type
|
|
8
|
+
* @param {T} T - the generic type to be reversed. Each members of it should be a Record in key-value form
|
|
9
|
+
* @returns - The reversed type
|
|
10
|
+
*/
|
|
11
|
+
declare type ReverseMap<T extends Record<keyof T, T[keyof T]>> = {
|
|
12
|
+
[P in T[keyof T]]: {
|
|
13
|
+
[K in keyof T]: T[K] extends P ? K : never;
|
|
14
|
+
}[keyof T];
|
|
15
|
+
};
|
|
16
|
+
export declare type ReversedLayers = ReverseMap<Layers>;
|
|
17
|
+
/**
|
|
18
|
+
* Interface for event to be fired on Atlassian Portal component mount and unmount
|
|
19
|
+
*/
|
|
20
|
+
export interface PortalEventDetail {
|
|
21
|
+
layer: LayerName | null;
|
|
22
|
+
zIndex: number;
|
|
23
|
+
}
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Dispatches a custom event on window with given eventName, given zIndex and corresponding layer
|
|
3
|
+
* @param {string} eventName - either of Mount or Unmount event name
|
|
4
|
+
* @param {number} zIndex - z-index value which will be included in the event to be dispatched
|
|
5
|
+
*/
|
|
6
|
+
export default function firePortalEvent(eventName: string, zIndex: number): void;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Creates a new portal container element with provided z-index and class name 'atlaskit-portal',
|
|
3
|
+
* it is not be attached to any DOM node at this stage.
|
|
4
|
+
* @param {number | string} zIndex - the z-index value of the newly created portal container element
|
|
5
|
+
* @return {number} - The newly created container element
|
|
6
|
+
*/
|
|
7
|
+
export declare const createContainer: (zIndex: number | string) => HTMLDivElement;
|
|
8
|
+
/**
|
|
9
|
+
* Removes portal container from portal parent container
|
|
10
|
+
* @param {HTMLDivElement | undefined} container - portal container to be removed from portal parent container
|
|
11
|
+
*/
|
|
12
|
+
export declare const removePortalContainer: (container: HTMLDivElement) => void;
|
|
13
|
+
/**
|
|
14
|
+
* Appends portal container to portal parent container if it hasn't already been done
|
|
15
|
+
* @param {HTMLDivElement | undefined} container - portal container to be added to portal parent container
|
|
16
|
+
*/
|
|
17
|
+
export declare const appendPortalContainerIfNotAppended: (container: HTMLDivElement) => void;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { PortalEventDetail } from './internal/types';
|
|
3
|
+
/**
|
|
4
|
+
* Interface for props to be passed in Atlassian Portal component
|
|
5
|
+
*/
|
|
6
|
+
export interface PortalProps {
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
zIndex?: number | string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Custom event object that will be fired when Atlassian Portal component is mounted and unmounted
|
|
12
|
+
*/
|
|
13
|
+
export declare type PortalEvent = CustomEvent<PortalEventDetail>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/portal",
|
|
3
|
-
"version": "4.2.
|
|
3
|
+
"version": "4.2.11",
|
|
4
4
|
"description": "Atlaskit wrapper for rendering components in React portals",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -12,6 +12,13 @@
|
|
|
12
12
|
"module": "dist/esm/index.js",
|
|
13
13
|
"module:es2019": "dist/es2019/index.js",
|
|
14
14
|
"types": "dist/types/index.d.ts",
|
|
15
|
+
"typesVersions": {
|
|
16
|
+
">=4.0 <4.5": {
|
|
17
|
+
"*": [
|
|
18
|
+
"dist/types-ts4.0/*"
|
|
19
|
+
]
|
|
20
|
+
}
|
|
21
|
+
},
|
|
15
22
|
"sideEffects": false,
|
|
16
23
|
"atlaskit:src": "src/index.tsx",
|
|
17
24
|
"atlassian": {
|
|
@@ -27,7 +34,7 @@
|
|
|
27
34
|
".": "./src/index.tsx"
|
|
28
35
|
},
|
|
29
36
|
"dependencies": {
|
|
30
|
-
"@atlaskit/theme": "^12.
|
|
37
|
+
"@atlaskit/theme": "^12.2.0",
|
|
31
38
|
"@babel/runtime": "^7.0.0"
|
|
32
39
|
},
|
|
33
40
|
"peerDependencies": {
|
|
@@ -37,22 +44,22 @@
|
|
|
37
44
|
"devDependencies": {
|
|
38
45
|
"@atlaskit/button": "^16.3.0",
|
|
39
46
|
"@atlaskit/docs": "*",
|
|
40
|
-
"@atlaskit/flag": "^14.
|
|
47
|
+
"@atlaskit/flag": "^14.7.0",
|
|
41
48
|
"@atlaskit/icon": "^21.10.0",
|
|
42
|
-
"@atlaskit/inline-dialog": "^13.
|
|
43
|
-
"@atlaskit/modal-dialog": "^12.
|
|
49
|
+
"@atlaskit/inline-dialog": "^13.4.0",
|
|
50
|
+
"@atlaskit/modal-dialog": "^12.3.0",
|
|
44
51
|
"@atlaskit/onboarding": "^10.5.0",
|
|
45
52
|
"@atlaskit/ssr": "*",
|
|
46
53
|
"@atlaskit/tooltip": "^17.5.0",
|
|
47
54
|
"@atlaskit/visual-regression": "*",
|
|
48
55
|
"@atlaskit/webdriver-runner": "*",
|
|
49
56
|
"@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
|
|
50
|
-
"@testing-library/react": "^
|
|
57
|
+
"@testing-library/react": "^12.1.5",
|
|
51
58
|
"bind-event-listener": "^2.1.1",
|
|
52
59
|
"enzyme": "^3.10.0",
|
|
53
60
|
"raf-stub": "^2.0.1",
|
|
54
61
|
"storybook-addon-performance": "^0.16.0",
|
|
55
|
-
"typescript": "4.
|
|
62
|
+
"typescript": "4.5.5"
|
|
56
63
|
},
|
|
57
64
|
"keywords": [
|
|
58
65
|
"atlaskit",
|
package/types/package.json
CHANGED
|
@@ -4,5 +4,12 @@
|
|
|
4
4
|
"module": "../dist/esm/entry-points/types.js",
|
|
5
5
|
"module:es2019": "../dist/es2019/entry-points/types.js",
|
|
6
6
|
"sideEffects": false,
|
|
7
|
-
"types": "../dist/types/entry-points/types.d.ts"
|
|
7
|
+
"types": "../dist/types/entry-points/types.d.ts",
|
|
8
|
+
"typesVersions": {
|
|
9
|
+
">=4.0 <4.5": {
|
|
10
|
+
"*": [
|
|
11
|
+
"../dist/types-ts4.0/entry-points/types.d.ts"
|
|
12
|
+
]
|
|
13
|
+
}
|
|
14
|
+
}
|
|
8
15
|
}
|