@fluentui/react-portal 0.0.0-nightly-20220502-0420.1 → 0.0.0-nightly-20220505-0419.1

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.
Files changed (38) hide show
  1. package/CHANGELOG.json +48 -9
  2. package/CHANGELOG.md +20 -7
  3. package/{lib → dist}/tsdoc-metadata.json +0 -0
  4. package/lib/index.js +1 -1
  5. package/lib/index.js.map +1 -1
  6. package/lib-commonjs/index.js +23 -6
  7. package/lib-commonjs/index.js.map +1 -1
  8. package/package.json +5 -5
  9. package/lib/Portal.d.ts +0 -1
  10. package/lib/components/Portal/Portal.d.ts +0 -7
  11. package/lib/components/Portal/Portal.types.d.ts +0 -22
  12. package/lib/components/Portal/index.d.ts +0 -4
  13. package/lib/components/Portal/renderPortal.d.ts +0 -6
  14. package/lib/components/Portal/usePortal.d.ts +0 -9
  15. package/lib/components/Portal/usePortalMountNode.d.ts +0 -10
  16. package/lib/index.d.ts +0 -2
  17. package/lib/virtualParent/elementContains.d.ts +0 -7
  18. package/lib/virtualParent/getParent.d.ts +0 -5
  19. package/lib/virtualParent/getVirtualParent.d.ts +0 -4
  20. package/lib/virtualParent/index.d.ts +0 -5
  21. package/lib/virtualParent/isVirtualElement.d.ts +0 -5
  22. package/lib/virtualParent/setVirtualParent.d.ts +0 -7
  23. package/lib/virtualParent/types.d.ts +0 -5
  24. package/lib-commonjs/Portal.d.ts +0 -1
  25. package/lib-commonjs/components/Portal/Portal.d.ts +0 -7
  26. package/lib-commonjs/components/Portal/Portal.types.d.ts +0 -22
  27. package/lib-commonjs/components/Portal/index.d.ts +0 -4
  28. package/lib-commonjs/components/Portal/renderPortal.d.ts +0 -6
  29. package/lib-commonjs/components/Portal/usePortal.d.ts +0 -9
  30. package/lib-commonjs/components/Portal/usePortalMountNode.d.ts +0 -10
  31. package/lib-commonjs/index.d.ts +0 -2
  32. package/lib-commonjs/virtualParent/elementContains.d.ts +0 -7
  33. package/lib-commonjs/virtualParent/getParent.d.ts +0 -5
  34. package/lib-commonjs/virtualParent/getVirtualParent.d.ts +0 -4
  35. package/lib-commonjs/virtualParent/index.d.ts +0 -5
  36. package/lib-commonjs/virtualParent/isVirtualElement.d.ts +0 -5
  37. package/lib-commonjs/virtualParent/setVirtualParent.d.ts +0 -7
  38. package/lib-commonjs/virtualParent/types.d.ts +0 -5
package/CHANGELOG.json CHANGED
@@ -2,9 +2,9 @@
2
2
  "name": "@fluentui/react-portal",
3
3
  "entries": [
4
4
  {
5
- "date": "Mon, 02 May 2022 04:31:12 GMT",
6
- "tag": "@fluentui/react-portal_v0.0.0-nightly-20220502-0420.1",
7
- "version": "0.0.0-nightly-20220502-0420.1",
5
+ "date": "Thu, 05 May 2022 04:32:02 GMT",
6
+ "tag": "@fluentui/react-portal_v0.0.0-nightly-20220505-0419.1",
7
+ "version": "0.0.0-nightly-20220505-0419.1",
8
8
  "comments": {
9
9
  "prerelease": [
10
10
  {
@@ -13,23 +13,62 @@
13
13
  "commit": "not available",
14
14
  "comment": "Release nightly v9"
15
15
  },
16
+ {
17
+ "author": "humberto_makoto@hotmail.com",
18
+ "package": "@fluentui/react-portal",
19
+ "commit": "5524a739358b616484c838819a5e89531aca1c1f",
20
+ "comment": "Removing star exports."
21
+ },
22
+ {
23
+ "author": "beachball",
24
+ "package": "@fluentui/react-portal",
25
+ "comment": "Bump @fluentui/react-shared-contexts to v0.0.0-nightly-20220505-0419.1",
26
+ "commit": "6bbaced7ad19cd9172d1869027f73f1aa967547f"
27
+ },
28
+ {
29
+ "author": "beachball",
30
+ "package": "@fluentui/react-portal",
31
+ "comment": "Bump @fluentui/react-tabster to v0.0.0-nightly-20220505-0419.1",
32
+ "commit": "6bbaced7ad19cd9172d1869027f73f1aa967547f"
33
+ },
34
+ {
35
+ "author": "beachball",
36
+ "package": "@fluentui/react-portal",
37
+ "comment": "Bump @fluentui/react-utilities to v0.0.0-nightly-20220505-0419.1",
38
+ "commit": "6bbaced7ad19cd9172d1869027f73f1aa967547f"
39
+ }
40
+ ]
41
+ }
42
+ },
43
+ {
44
+ "date": "Wed, 04 May 2022 13:26:47 GMT",
45
+ "tag": "@fluentui/react-portal_v9.0.0-rc.8",
46
+ "version": "9.0.0-rc.8",
47
+ "comments": {
48
+ "prerelease": [
49
+ {
50
+ "author": "martinhochel@microsoft.com",
51
+ "package": "@fluentui/react-portal",
52
+ "commit": "773b889cd09d46934feeabdbbc389c678b80f7a0",
53
+ "comment": "feat: ship rolluped only dts"
54
+ },
16
55
  {
17
56
  "author": "beachball",
18
57
  "package": "@fluentui/react-portal",
19
- "comment": "Bump @fluentui/react-shared-contexts to v0.0.0-nightly-20220502-0420.1",
20
- "commit": "07bac225f1b18ce4fad5464b46f9cb4f09fcd702"
58
+ "comment": "Bump @fluentui/react-shared-contexts to v9.0.0-rc.6",
59
+ "commit": "65f94192ed3b2cde7e52b9c7e12d6f38b81965dd"
21
60
  },
22
61
  {
23
62
  "author": "beachball",
24
63
  "package": "@fluentui/react-portal",
25
- "comment": "Bump @fluentui/react-tabster to v0.0.0-nightly-20220502-0420.1",
26
- "commit": "07bac225f1b18ce4fad5464b46f9cb4f09fcd702"
64
+ "comment": "Bump @fluentui/react-tabster to v9.0.0-rc.8",
65
+ "commit": "65f94192ed3b2cde7e52b9c7e12d6f38b81965dd"
27
66
  },
28
67
  {
29
68
  "author": "beachball",
30
69
  "package": "@fluentui/react-portal",
31
- "comment": "Bump @fluentui/react-utilities to v0.0.0-nightly-20220502-0420.1",
32
- "commit": "07bac225f1b18ce4fad5464b46f9cb4f09fcd702"
70
+ "comment": "Bump @fluentui/react-utilities to v9.0.0-rc.7",
71
+ "commit": "65f94192ed3b2cde7e52b9c7e12d6f38b81965dd"
33
72
  }
34
73
  ],
35
74
  "none": [
package/CHANGELOG.md CHANGED
@@ -1,20 +1,33 @@
1
1
  # Change Log - @fluentui/react-portal
2
2
 
3
- This log was last generated on Mon, 02 May 2022 04:31:12 GMT and should not be manually modified.
3
+ This log was last generated on Thu, 05 May 2022 04:32:02 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
- ## [0.0.0-nightly-20220502-0420.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-portal_v0.0.0-nightly-20220502-0420.1)
7
+ ## [0.0.0-nightly-20220505-0419.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-portal_v0.0.0-nightly-20220505-0419.1)
8
8
 
9
- Mon, 02 May 2022 04:31:12 GMT
10
- [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-portal_v9.0.0-rc.7..@fluentui/react-portal_v0.0.0-nightly-20220502-0420.1)
9
+ Thu, 05 May 2022 04:32:02 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-portal_v9.0.0-rc.8..@fluentui/react-portal_v0.0.0-nightly-20220505-0419.1)
11
11
 
12
12
  ### Changes
13
13
 
14
14
  - Release nightly v9 ([commit](https://github.com/microsoft/fluentui/commit/not available) by email not defined)
15
- - Bump @fluentui/react-shared-contexts to v0.0.0-nightly-20220502-0420.1 ([commit](https://github.com/microsoft/fluentui/commit/07bac225f1b18ce4fad5464b46f9cb4f09fcd702) by beachball)
16
- - Bump @fluentui/react-tabster to v0.0.0-nightly-20220502-0420.1 ([commit](https://github.com/microsoft/fluentui/commit/07bac225f1b18ce4fad5464b46f9cb4f09fcd702) by beachball)
17
- - Bump @fluentui/react-utilities to v0.0.0-nightly-20220502-0420.1 ([commit](https://github.com/microsoft/fluentui/commit/07bac225f1b18ce4fad5464b46f9cb4f09fcd702) by beachball)
15
+ - Removing star exports. ([PR #22806](https://github.com/microsoft/fluentui/pull/22806) by humberto_makoto@hotmail.com)
16
+ - Bump @fluentui/react-shared-contexts to v0.0.0-nightly-20220505-0419.1 ([commit](https://github.com/microsoft/fluentui/commit/6bbaced7ad19cd9172d1869027f73f1aa967547f) by beachball)
17
+ - Bump @fluentui/react-tabster to v0.0.0-nightly-20220505-0419.1 ([commit](https://github.com/microsoft/fluentui/commit/6bbaced7ad19cd9172d1869027f73f1aa967547f) by beachball)
18
+ - Bump @fluentui/react-utilities to v0.0.0-nightly-20220505-0419.1 ([commit](https://github.com/microsoft/fluentui/commit/6bbaced7ad19cd9172d1869027f73f1aa967547f) by beachball)
19
+
20
+ ## [9.0.0-rc.8](https://github.com/microsoft/fluentui/tree/@fluentui/react-portal_v9.0.0-rc.8)
21
+
22
+ Wed, 04 May 2022 13:26:47 GMT
23
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-portal_v9.0.0-rc.7..@fluentui/react-portal_v9.0.0-rc.8)
24
+
25
+ ### Changes
26
+
27
+ - feat: ship rolluped only dts ([PR #22791](https://github.com/microsoft/fluentui/pull/22791) by martinhochel@microsoft.com)
28
+ - Bump @fluentui/react-shared-contexts to v9.0.0-rc.6 ([PR #22786](https://github.com/microsoft/fluentui/pull/22786) by beachball)
29
+ - Bump @fluentui/react-tabster to v9.0.0-rc.8 ([PR #22786](https://github.com/microsoft/fluentui/pull/22786) by beachball)
30
+ - Bump @fluentui/react-utilities to v9.0.0-rc.7 ([PR #22786](https://github.com/microsoft/fluentui/pull/22786) by beachball)
18
31
 
19
32
  ## [9.0.0-rc.7](https://github.com/microsoft/fluentui/tree/@fluentui/react-portal_v9.0.0-rc.7)
20
33
 
File without changes
package/lib/index.js CHANGED
@@ -1,3 +1,3 @@
1
- export * from './components/Portal/index';
1
+ export { Portal, renderPortal_unstable, usePortal_unstable } from './components/Portal/index';
2
2
  export { elementContains, setVirtualParent } from './virtualParent/index';
3
3
  //# sourceMappingURL=index.js.map
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"../src/","sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC","sourcesContent":["export * from './components/Portal/index';\nexport { elementContains, setVirtualParent } from './virtualParent/index';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"../src/","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAE9F,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC","sourcesContent":["export { Portal, renderPortal_unstable, usePortal_unstable } from './components/Portal/index';\nexport type { PortalProps, PortalState } from './components/Portal/index';\nexport { elementContains, setVirtualParent } from './virtualParent/index';\n"]}
@@ -3,24 +3,41 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.setVirtualParent = exports.elementContains = void 0;
6
+ exports.setVirtualParent = exports.elementContains = exports.usePortal_unstable = exports.renderPortal_unstable = exports.Portal = void 0;
7
7
 
8
- const tslib_1 = /*#__PURE__*/require("tslib");
8
+ var index_1 = /*#__PURE__*/require("./components/Portal/index");
9
9
 
10
- tslib_1.__exportStar(require("./components/Portal/index"), exports);
10
+ Object.defineProperty(exports, "Portal", {
11
+ enumerable: true,
12
+ get: function () {
13
+ return index_1.Portal;
14
+ }
15
+ });
16
+ Object.defineProperty(exports, "renderPortal_unstable", {
17
+ enumerable: true,
18
+ get: function () {
19
+ return index_1.renderPortal_unstable;
20
+ }
21
+ });
22
+ Object.defineProperty(exports, "usePortal_unstable", {
23
+ enumerable: true,
24
+ get: function () {
25
+ return index_1.usePortal_unstable;
26
+ }
27
+ });
11
28
 
12
- var index_1 = /*#__PURE__*/require("./virtualParent/index");
29
+ var index_2 = /*#__PURE__*/require("./virtualParent/index");
13
30
 
14
31
  Object.defineProperty(exports, "elementContains", {
15
32
  enumerable: true,
16
33
  get: function () {
17
- return index_1.elementContains;
34
+ return index_2.elementContains;
18
35
  }
19
36
  });
20
37
  Object.defineProperty(exports, "setVirtualParent", {
21
38
  enumerable: true,
22
39
  get: function () {
23
- return index_1.setVirtualParent;
40
+ return index_2.setVirtualParent;
24
41
  }
25
42
  });
26
43
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["index.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,2BAAA,CAAA,EAAA,OAAA;;AACA,IAAA,OAAA,gBAAA,OAAA,CAAA,uBAAA,CAAA;;AAAS,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,iBAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,OAAA,CAAA,eAAA;AAAe;AAAf,CAAA;AAAiB,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,kBAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,OAAA,CAAA,gBAAA;AAAgB;AAAhB,CAAA","sourcesContent":["export * from './components/Portal/index';\nexport { elementContains, setVirtualParent } from './virtualParent/index';\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"sources":["index.ts"],"names":[],"mappings":";;;;;;;AAAA,IAAA,OAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AAAS,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,QAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,OAAA,CAAA,MAAA;AAAM;AAAN,CAAA;AAAQ,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,uBAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,OAAA,CAAA,qBAAA;AAAqB;AAArB,CAAA;AAAuB,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,oBAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,OAAA,CAAA,kBAAA;AAAkB;AAAlB,CAAA;;AAExC,IAAA,OAAA,gBAAA,OAAA,CAAA,uBAAA,CAAA;;AAAS,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,iBAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,OAAA,CAAA,eAAA;AAAe;AAAf,CAAA;AAAiB,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,kBAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,OAAA,CAAA,gBAAA;AAAgB;AAAhB,CAAA","sourcesContent":["export { Portal, renderPortal_unstable, usePortal_unstable } from './components/Portal/index';\nexport type { PortalProps, PortalState } from './components/Portal/index';\nexport { elementContains, setVirtualParent } from './virtualParent/index';\n"],"sourceRoot":"../src/"}
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@fluentui/react-portal",
3
- "version": "0.0.0-nightly-20220502-0420.1",
3
+ "version": "0.0.0-nightly-20220505-0419.1",
4
4
  "description": "A utility component that creates portals compatible with Fluent UI",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "module": "lib/index.js",
7
- "typings": "lib/index.d.ts",
7
+ "typings": "dist/index.d.ts",
8
8
  "sideEffects": false,
9
9
  "repository": {
10
10
  "type": "git",
@@ -31,9 +31,9 @@
31
31
  "@fluentui/scripts": "^1.0.0"
32
32
  },
33
33
  "dependencies": {
34
- "@fluentui/react-shared-contexts": "0.0.0-nightly-20220502-0420.1",
35
- "@fluentui/react-tabster": "0.0.0-nightly-20220502-0420.1",
36
- "@fluentui/react-utilities": "0.0.0-nightly-20220502-0420.1",
34
+ "@fluentui/react-shared-contexts": "0.0.0-nightly-20220505-0419.1",
35
+ "@fluentui/react-tabster": "0.0.0-nightly-20220505-0419.1",
36
+ "@fluentui/react-utilities": "0.0.0-nightly-20220505-0419.1",
37
37
  "tslib": "^2.1.0"
38
38
  },
39
39
  "peerDependencies": {
package/lib/Portal.d.ts DELETED
@@ -1 +0,0 @@
1
- export * from './components/Portal/index';
@@ -1,7 +0,0 @@
1
- import * as React from 'react';
2
- import type { PortalProps } from './Portal.types';
3
- /**
4
- * A portal provides a way to render children into a DOM node
5
- * that exists outside the DOM hierarchy of the parent component.
6
- */
7
- export declare const Portal: React.FC<PortalProps>;
@@ -1,22 +0,0 @@
1
- import * as React from 'react';
2
- declare type PortalCommons = {
3
- /**
4
- * React children
5
- */
6
- children: React.ReactNode;
7
- /**
8
- * Where the portal children are mounted on DOM
9
- * @defaultValue a new element on document.body without any styling
10
- */
11
- mountNode: HTMLElement | null;
12
- };
13
- export declare type PortalProps = Partial<PortalCommons>;
14
- export declare type PortalState = PortalCommons & {
15
- /** Indicates if a Portal should be rendered. */
16
- shouldRender: boolean;
17
- /**
18
- * Ref to the root span element as virtual parent
19
- */
20
- virtualParentRootRef: React.MutableRefObject<HTMLSpanElement | null>;
21
- };
22
- export {};
@@ -1,4 +0,0 @@
1
- export * from './Portal';
2
- export * from './Portal.types';
3
- export * from './renderPortal';
4
- export * from './usePortal';
@@ -1,6 +0,0 @@
1
- import * as React from 'react';
2
- import type { PortalState } from './Portal.types';
3
- /**
4
- * Render the final JSX of Portal
5
- */
6
- export declare const renderPortal_unstable: (state: PortalState) => React.ReactElement;
@@ -1,9 +0,0 @@
1
- import type { PortalProps, PortalState } from './Portal.types';
2
- /**
3
- * Create the state required to render Portal.
4
- *
5
- * The returned state can be modified with hooks such as usePortalStyles, before being passed to renderPortal_unstable.
6
- *
7
- * @param props - props from this instance of Portal
8
- */
9
- export declare const usePortal_unstable: (props: PortalProps) => PortalState;
@@ -1,10 +0,0 @@
1
- export declare type UsePortalMountNodeOptions = {
2
- /**
3
- * Since hooks cannot be called conditionally use this flag to disable creating the node
4
- */
5
- disabled?: boolean;
6
- };
7
- /**
8
- * Creates a new element on a document.body to mount portals
9
- */
10
- export declare const usePortalMountNode: (options: UsePortalMountNodeOptions) => HTMLElement | null;
package/lib/index.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export * from './components/Portal/index';
2
- export { elementContains, setVirtualParent } from './virtualParent/index';
@@ -1,7 +0,0 @@
1
- /**
2
- * Similar functionality to `element.contains` DOM API for use with out of order DOM elements that
3
- * checks the virtual parent hierarchy. If a virtual parents exists, it is chosen over the actual parent
4
- *
5
- * @returns true if the child can find the parent in its virtual hierarchy
6
- */
7
- export declare function elementContains(parent: HTMLElement | null, child: HTMLElement | null): boolean;
@@ -1,5 +0,0 @@
1
- /**
2
- * Gets the element which is the parent of a given element.
3
- * This method prefers the virtual parent over real DOM parent when present.
4
- */
5
- export declare function getParent(child: HTMLElement | null): HTMLElement | null;
@@ -1,4 +0,0 @@
1
- /**
2
- * Gets the virtual parent given the child element, if it exists.
3
- */
4
- export declare function getVirtualParent(child: HTMLElement): HTMLElement | undefined;
@@ -1,5 +0,0 @@
1
- export * from './elementContains';
2
- export * from './getParent';
3
- export * from './getVirtualParent';
4
- export * from './isVirtualElement';
5
- export * from './setVirtualParent';
@@ -1,5 +0,0 @@
1
- import type { VirtualElement } from './types';
2
- /**
3
- * Determines whether or not an element has the virtual hierarchy extension.
4
- */
5
- export declare function isVirtualElement(element: HTMLElement | VirtualElement): element is VirtualElement;
@@ -1,7 +0,0 @@
1
- /**
2
- * Sets the virtual parent of an element.
3
- *
4
- * @param child - Theme element to set the virtual parent
5
- * @param parent - The virtual parent, use `undefined` to remove a virtual parent relationship
6
- */
7
- export declare function setVirtualParent(child: HTMLElement, parent?: HTMLElement): void;
@@ -1,5 +0,0 @@
1
- export interface VirtualElement extends HTMLElement {
2
- _virtual: {
3
- parent?: HTMLElement;
4
- };
5
- }
@@ -1 +0,0 @@
1
- export * from './components/Portal/index';
@@ -1,7 +0,0 @@
1
- import * as React from 'react';
2
- import type { PortalProps } from './Portal.types';
3
- /**
4
- * A portal provides a way to render children into a DOM node
5
- * that exists outside the DOM hierarchy of the parent component.
6
- */
7
- export declare const Portal: React.FC<PortalProps>;
@@ -1,22 +0,0 @@
1
- import * as React from 'react';
2
- declare type PortalCommons = {
3
- /**
4
- * React children
5
- */
6
- children: React.ReactNode;
7
- /**
8
- * Where the portal children are mounted on DOM
9
- * @defaultValue a new element on document.body without any styling
10
- */
11
- mountNode: HTMLElement | null;
12
- };
13
- export declare type PortalProps = Partial<PortalCommons>;
14
- export declare type PortalState = PortalCommons & {
15
- /** Indicates if a Portal should be rendered. */
16
- shouldRender: boolean;
17
- /**
18
- * Ref to the root span element as virtual parent
19
- */
20
- virtualParentRootRef: React.MutableRefObject<HTMLSpanElement | null>;
21
- };
22
- export {};
@@ -1,4 +0,0 @@
1
- export * from './Portal';
2
- export * from './Portal.types';
3
- export * from './renderPortal';
4
- export * from './usePortal';
@@ -1,6 +0,0 @@
1
- import * as React from 'react';
2
- import type { PortalState } from './Portal.types';
3
- /**
4
- * Render the final JSX of Portal
5
- */
6
- export declare const renderPortal_unstable: (state: PortalState) => React.ReactElement;
@@ -1,9 +0,0 @@
1
- import type { PortalProps, PortalState } from './Portal.types';
2
- /**
3
- * Create the state required to render Portal.
4
- *
5
- * The returned state can be modified with hooks such as usePortalStyles, before being passed to renderPortal_unstable.
6
- *
7
- * @param props - props from this instance of Portal
8
- */
9
- export declare const usePortal_unstable: (props: PortalProps) => PortalState;
@@ -1,10 +0,0 @@
1
- export declare type UsePortalMountNodeOptions = {
2
- /**
3
- * Since hooks cannot be called conditionally use this flag to disable creating the node
4
- */
5
- disabled?: boolean;
6
- };
7
- /**
8
- * Creates a new element on a document.body to mount portals
9
- */
10
- export declare const usePortalMountNode: (options: UsePortalMountNodeOptions) => HTMLElement | null;
@@ -1,2 +0,0 @@
1
- export * from './components/Portal/index';
2
- export { elementContains, setVirtualParent } from './virtualParent/index';
@@ -1,7 +0,0 @@
1
- /**
2
- * Similar functionality to `element.contains` DOM API for use with out of order DOM elements that
3
- * checks the virtual parent hierarchy. If a virtual parents exists, it is chosen over the actual parent
4
- *
5
- * @returns true if the child can find the parent in its virtual hierarchy
6
- */
7
- export declare function elementContains(parent: HTMLElement | null, child: HTMLElement | null): boolean;
@@ -1,5 +0,0 @@
1
- /**
2
- * Gets the element which is the parent of a given element.
3
- * This method prefers the virtual parent over real DOM parent when present.
4
- */
5
- export declare function getParent(child: HTMLElement | null): HTMLElement | null;
@@ -1,4 +0,0 @@
1
- /**
2
- * Gets the virtual parent given the child element, if it exists.
3
- */
4
- export declare function getVirtualParent(child: HTMLElement): HTMLElement | undefined;
@@ -1,5 +0,0 @@
1
- export * from './elementContains';
2
- export * from './getParent';
3
- export * from './getVirtualParent';
4
- export * from './isVirtualElement';
5
- export * from './setVirtualParent';
@@ -1,5 +0,0 @@
1
- import type { VirtualElement } from './types';
2
- /**
3
- * Determines whether or not an element has the virtual hierarchy extension.
4
- */
5
- export declare function isVirtualElement(element: HTMLElement | VirtualElement): element is VirtualElement;
@@ -1,7 +0,0 @@
1
- /**
2
- * Sets the virtual parent of an element.
3
- *
4
- * @param child - Theme element to set the virtual parent
5
- * @param parent - The virtual parent, use `undefined` to remove a virtual parent relationship
6
- */
7
- export declare function setVirtualParent(child: HTMLElement, parent?: HTMLElement): void;
@@ -1,5 +0,0 @@
1
- export interface VirtualElement extends HTMLElement {
2
- _virtual: {
3
- parent?: HTMLElement;
4
- };
5
- }