@atlaskit/portal 4.2.10 → 4.2.12

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.2.12
4
+
5
+ ### Patch Changes
6
+
7
+ - [`9827dcb82b8`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9827dcb82b8) - No-op change to introduce spacing tokens to design system components.
8
+
9
+ ## 4.2.11
10
+
11
+ ### Patch Changes
12
+
13
+ - [`8cc2f888c83`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8cc2f888c83) - Upgrade Typescript from `4.3.5` to `4.5.5`
14
+
3
15
  ## 4.2.10
4
16
 
5
17
  ### Patch Changes
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/portal",
3
- "version": "4.2.10",
3
+ "version": "4.2.12",
4
4
  "sideEffects": false
5
5
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/portal",
3
- "version": "4.2.10",
3
+ "version": "4.2.12",
4
4
  "sideEffects": false
5
5
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/portal",
3
- "version": "4.2.10",
3
+ "version": "4.2.12",
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 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,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 declare type PortalEvent = CustomEvent<PortalEventDetail>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/portal",
3
- "version": "4.2.10",
3
+ "version": "4.2.12",
4
4
  "description": "Atlaskit wrapper for rendering components in React portals",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -12,9 +12,18 @@
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
+ "dist/types-ts4.0/index.d.ts"
20
+ ]
21
+ }
22
+ },
15
23
  "sideEffects": false,
16
24
  "atlaskit:src": "src/index.tsx",
17
25
  "atlassian": {
26
+ "disableProductCI": true,
18
27
  "team": "Design System Team",
19
28
  "releaseModel": "scheduled",
20
29
  "website": {
@@ -27,7 +36,7 @@
27
36
  ".": "./src/index.tsx"
28
37
  },
29
38
  "dependencies": {
30
- "@atlaskit/theme": "^12.1.0",
39
+ "@atlaskit/theme": "^12.2.0",
31
40
  "@babel/runtime": "^7.0.0"
32
41
  },
33
42
  "peerDependencies": {
@@ -37,22 +46,22 @@
37
46
  "devDependencies": {
38
47
  "@atlaskit/button": "^16.3.0",
39
48
  "@atlaskit/docs": "*",
40
- "@atlaskit/flag": "^14.6.0",
41
- "@atlaskit/icon": "^21.10.0",
42
- "@atlaskit/inline-dialog": "^13.3.0",
43
- "@atlaskit/modal-dialog": "^12.2.0",
44
- "@atlaskit/onboarding": "^10.5.0",
49
+ "@atlaskit/flag": "^14.7.0",
50
+ "@atlaskit/icon": "^21.11.0",
51
+ "@atlaskit/inline-dialog": "^13.4.0",
52
+ "@atlaskit/modal-dialog": "^12.4.0",
53
+ "@atlaskit/onboarding": "^10.6.0",
45
54
  "@atlaskit/ssr": "*",
46
- "@atlaskit/tooltip": "^17.5.0",
55
+ "@atlaskit/tooltip": "^17.6.0",
47
56
  "@atlaskit/visual-regression": "*",
48
57
  "@atlaskit/webdriver-runner": "*",
49
58
  "@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
50
- "@testing-library/react": "^8.0.1",
59
+ "@testing-library/react": "^12.1.5",
51
60
  "bind-event-listener": "^2.1.1",
52
61
  "enzyme": "^3.10.0",
53
62
  "raf-stub": "^2.0.1",
54
63
  "storybook-addon-performance": "^0.16.0",
55
- "typescript": "4.3.5"
64
+ "typescript": "4.5.5"
56
65
  },
57
66
  "keywords": [
58
67
  "atlaskit",
@@ -68,6 +77,7 @@
68
77
  "design-system": "v1",
69
78
  "ui-components": "lite-mode",
70
79
  "analytics": "analytics-next",
80
+ "design-tokens": "spacing",
71
81
  "theming": "tokens",
72
82
  "deprecation": "no-deprecated-imports",
73
83
  "styling": [
package/report.api.md CHANGED
@@ -1,6 +1,8 @@
1
- ## API Report File for "@atlaskit/portal"
1
+ ## API Report File for "@atlaskit/portal".
2
2
 
3
- > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
3
+ > Do not edit this file. This report is auto-generated by [API Extractor](https://api-extractor.com/).
4
+
5
+ [Learn more about API reports](https://hello.atlassian.net/wiki/spaces/UR/pages/1825484529/Package+API+Reports)
4
6
 
5
7
  ```ts
6
8
  /// <reference types="react" />
@@ -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
  }