@atlaskit/portal 4.3.1 → 4.3.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/CHANGELOG.md +12 -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.5/constants.d.ts +2 -0
- package/dist/types-ts4.5/entry-points/types.d.ts +1 -0
- package/dist/types-ts4.5/index.d.ts +3 -0
- package/dist/types-ts4.5/internal/components/internal-portal.d.ts +7 -0
- package/dist/types-ts4.5/internal/constants.d.ts +3 -0
- package/dist/types-ts4.5/internal/hooks/use-is-subsequent-render.d.ts +2 -0
- package/dist/types-ts4.5/internal/hooks/use-portal-event.d.ts +2 -0
- package/dist/types-ts4.5/internal/types.d.ts +24 -0
- package/dist/types-ts4.5/internal/utils/portal-custom-event.d.ts +6 -0
- package/dist/types-ts4.5/internal/utils/portal-dom-utils.d.ts +17 -0
- package/dist/types-ts4.5/portal.d.ts +3 -0
- package/dist/types-ts4.5/types.d.ts +13 -0
- package/package.json +5 -2
- package/report.api.md +14 -0
- package/tmp/api-report-tmp.d.ts +46 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/portal
|
|
2
2
|
|
|
3
|
+
## 4.3.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`77766ad157d`](https://bitbucket.org/atlassian/atlassian-frontend/commits/77766ad157d) - Enrol packages to push-model consumption in Jira.
|
|
8
|
+
|
|
9
|
+
## 4.3.2
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`9d00501a414`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9d00501a414) - Ensure legacy types are published for TS 4.5-4.8
|
|
14
|
+
|
|
3
15
|
## 4.3.1
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
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 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
|
+
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 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 type PortalEvent = CustomEvent<PortalEventDetail>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/portal",
|
|
3
|
-
"version": "4.3.
|
|
3
|
+
"version": "4.3.3",
|
|
4
4
|
"description": "A wrapper for rendering components in React portals.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -24,7 +24,10 @@
|
|
|
24
24
|
"atlaskit:src": "src/index.tsx",
|
|
25
25
|
"atlassian": {
|
|
26
26
|
"team": "Design System Team",
|
|
27
|
-
"releaseModel": "
|
|
27
|
+
"releaseModel": "continuous",
|
|
28
|
+
"productPushConsumption": [
|
|
29
|
+
"jira"
|
|
30
|
+
],
|
|
28
31
|
"website": {
|
|
29
32
|
"name": "Portal",
|
|
30
33
|
"category": "Libraries"
|
package/report.api.md
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
### Table of contents
|
|
9
9
|
|
|
10
10
|
- [Main Entry Types](#main-entry-types)
|
|
11
|
+
- [Peer Dependencies](#peer-dependencies)
|
|
11
12
|
|
|
12
13
|
### Main Entry Types
|
|
13
14
|
|
|
@@ -55,3 +56,16 @@ export interface PortalProps {
|
|
|
55
56
|
```
|
|
56
57
|
|
|
57
58
|
<!--SECTION END: Main Entry Types-->
|
|
59
|
+
|
|
60
|
+
### Peer Dependencies
|
|
61
|
+
|
|
62
|
+
<!--SECTION START: Peer Dependencies-->
|
|
63
|
+
|
|
64
|
+
```json
|
|
65
|
+
{
|
|
66
|
+
"react": "^16.8.0",
|
|
67
|
+
"react-dom": "^16.8.0"
|
|
68
|
+
}
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
<!--SECTION END: Peer Dependencies-->
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
## API Report File for "@atlaskit/portal"
|
|
2
|
+
|
|
3
|
+
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
|
|
7
|
+
/// <reference types="react" />
|
|
8
|
+
|
|
9
|
+
import type { Layers } from '@atlaskit/theme/types';
|
|
10
|
+
import { default as React_2 } from 'react';
|
|
11
|
+
|
|
12
|
+
// @public
|
|
13
|
+
type LayerName = keyof Layers;
|
|
14
|
+
|
|
15
|
+
// @public (undocumented)
|
|
16
|
+
function Portal(props: PortalProps): JSX.Element | null;
|
|
17
|
+
export default Portal;
|
|
18
|
+
|
|
19
|
+
// @public (undocumented)
|
|
20
|
+
export const PORTAL_MOUNT_EVENT = "akPortalMount";
|
|
21
|
+
|
|
22
|
+
// @public (undocumented)
|
|
23
|
+
export const PORTAL_UNMOUNT_EVENT = "akPortalUnmount";
|
|
24
|
+
|
|
25
|
+
// @public
|
|
26
|
+
export type PortalEvent = CustomEvent<PortalEventDetail>;
|
|
27
|
+
|
|
28
|
+
// @public
|
|
29
|
+
interface PortalEventDetail {
|
|
30
|
+
// (undocumented)
|
|
31
|
+
layer: LayerName | null;
|
|
32
|
+
// (undocumented)
|
|
33
|
+
zIndex: number;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// @public
|
|
37
|
+
export interface PortalProps {
|
|
38
|
+
// (undocumented)
|
|
39
|
+
children: React_2.ReactNode;
|
|
40
|
+
// (undocumented)
|
|
41
|
+
zIndex?: number | string;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// (No @packageDocumentation comment for this package)
|
|
45
|
+
|
|
46
|
+
```
|