@fluentui/react-portal 9.0.0-rc.7 → 9.0.0

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 (60) hide show
  1. package/CHANGELOG.json +265 -1
  2. package/CHANGELOG.md +170 -74
  3. package/dist/{react-portal.d.ts → index.d.ts} +6 -7
  4. package/{lib → dist}/tsdoc-metadata.json +0 -0
  5. package/lib/components/Portal/Portal.js.map +1 -1
  6. package/lib/components/Portal/Portal.types.js.map +1 -1
  7. package/lib/components/Portal/renderPortal.js.map +1 -1
  8. package/lib/components/Portal/usePortal.js.map +1 -1
  9. package/lib/components/Portal/usePortalMountNode.js +28 -6
  10. package/lib/components/Portal/usePortalMountNode.js.map +1 -1
  11. package/lib/index.js +1 -1
  12. package/lib/index.js.map +1 -1
  13. package/lib/virtualParent/elementContains.js.map +1 -1
  14. package/lib/virtualParent/getParent.js.map +1 -1
  15. package/lib/virtualParent/getVirtualParent.js.map +1 -1
  16. package/lib/virtualParent/isVirtualElement.js.map +1 -1
  17. package/lib/virtualParent/setVirtualParent.js.map +1 -1
  18. package/lib-commonjs/components/Portal/Portal.js.map +1 -1
  19. package/lib-commonjs/components/Portal/renderPortal.js.map +1 -1
  20. package/lib-commonjs/components/Portal/usePortal.js.map +1 -1
  21. package/lib-commonjs/components/Portal/usePortalMountNode.js +28 -6
  22. package/lib-commonjs/components/Portal/usePortalMountNode.js.map +1 -1
  23. package/lib-commonjs/index.js +23 -6
  24. package/lib-commonjs/index.js.map +1 -1
  25. package/lib-commonjs/virtualParent/elementContains.js.map +1 -1
  26. package/lib-commonjs/virtualParent/getParent.js.map +1 -1
  27. package/lib-commonjs/virtualParent/getVirtualParent.js.map +1 -1
  28. package/lib-commonjs/virtualParent/isVirtualElement.js.map +1 -1
  29. package/lib-commonjs/virtualParent/setVirtualParent.js.map +1 -1
  30. package/package.json +9 -10
  31. package/lib/Portal.d.ts +0 -1
  32. package/lib/components/Portal/Portal.d.ts +0 -7
  33. package/lib/components/Portal/Portal.types.d.ts +0 -22
  34. package/lib/components/Portal/index.d.ts +0 -4
  35. package/lib/components/Portal/renderPortal.d.ts +0 -6
  36. package/lib/components/Portal/usePortal.d.ts +0 -9
  37. package/lib/components/Portal/usePortalMountNode.d.ts +0 -10
  38. package/lib/index.d.ts +0 -2
  39. package/lib/virtualParent/elementContains.d.ts +0 -7
  40. package/lib/virtualParent/getParent.d.ts +0 -5
  41. package/lib/virtualParent/getVirtualParent.d.ts +0 -4
  42. package/lib/virtualParent/index.d.ts +0 -5
  43. package/lib/virtualParent/isVirtualElement.d.ts +0 -5
  44. package/lib/virtualParent/setVirtualParent.d.ts +0 -7
  45. package/lib/virtualParent/types.d.ts +0 -5
  46. package/lib-commonjs/Portal.d.ts +0 -1
  47. package/lib-commonjs/components/Portal/Portal.d.ts +0 -7
  48. package/lib-commonjs/components/Portal/Portal.types.d.ts +0 -22
  49. package/lib-commonjs/components/Portal/index.d.ts +0 -4
  50. package/lib-commonjs/components/Portal/renderPortal.d.ts +0 -6
  51. package/lib-commonjs/components/Portal/usePortal.d.ts +0 -9
  52. package/lib-commonjs/components/Portal/usePortalMountNode.d.ts +0 -10
  53. package/lib-commonjs/index.d.ts +0 -2
  54. package/lib-commonjs/virtualParent/elementContains.d.ts +0 -7
  55. package/lib-commonjs/virtualParent/getParent.d.ts +0 -5
  56. package/lib-commonjs/virtualParent/getVirtualParent.d.ts +0 -4
  57. package/lib-commonjs/virtualParent/index.d.ts +0 -5
  58. package/lib-commonjs/virtualParent/isVirtualElement.d.ts +0 -5
  59. package/lib-commonjs/virtualParent/setVirtualParent.d.ts +0 -7
  60. package/lib-commonjs/virtualParent/types.d.ts +0 -5
@@ -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
- }