@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 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
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/portal",
3
- "version": "4.3.1",
3
+ "version": "4.3.3",
4
4
  "sideEffects": false
5
5
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/portal",
3
- "version": "4.3.1",
3
+ "version": "4.3.3",
4
4
  "sideEffects": false
5
5
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/portal",
3
- "version": "4.3.1",
3
+ "version": "4.3.3",
4
4
  "sideEffects": false
5
5
  }
@@ -0,0 +1,2 @@
1
+ export declare const PORTAL_MOUNT_EVENT = "akPortalMount";
2
+ export declare const PORTAL_UNMOUNT_EVENT = "akPortalUnmount";
@@ -0,0 +1 @@
1
+ export type { PortalEvent, PortalProps } from '../types';
@@ -0,0 +1,3 @@
1
+ export { default } from './portal';
2
+ export type { PortalEvent, PortalProps } from './types';
3
+ export { PORTAL_MOUNT_EVENT, PORTAL_UNMOUNT_EVENT } from './constants';
@@ -0,0 +1,7 @@
1
+ import { ReactPortal } from 'react';
2
+ interface InternalPortalProps {
3
+ children: React.ReactNode;
4
+ zIndex: number | string;
5
+ }
6
+ export default function InternalPortal(props: InternalPortalProps): ReactPortal;
7
+ export {};
@@ -0,0 +1,3 @@
1
+ export declare const portalParentClassName = "atlaskit-portal-container";
2
+ export declare const portalParentSelector = "body > .atlaskit-portal-container";
3
+ export declare const portalClassName = "atlaskit-portal";
@@ -0,0 +1,2 @@
1
+ declare const useIsSubsequentRender: () => boolean;
2
+ export default useIsSubsequentRender;
@@ -0,0 +1,2 @@
1
+ declare const useFirePortalEvent: (zIndex: number | string) => void;
2
+ export default useFirePortalEvent;
@@ -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,3 @@
1
+ /// <reference types="react" />
2
+ import type { PortalProps } from './types';
3
+ export default function Portal(props: PortalProps): JSX.Element | null;
@@ -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.1",
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": "scheduled",
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
+ ```