@fluentui/react-portal 0.0.0-nightlyfc5cfdc52420220215.1 → 0.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (69) hide show
  1. package/CHANGELOG.json +392 -12
  2. package/CHANGELOG.md +215 -76
  3. package/dist/{react-portal.d.ts → index.d.ts} +6 -7
  4. package/{lib → dist}/tsdoc-metadata.json +0 -0
  5. package/lib/Portal.js.map +1 -1
  6. package/lib/components/Portal/Portal.js.map +1 -1
  7. package/lib/components/Portal/Portal.types.js.map +1 -1
  8. package/lib/components/Portal/index.js.map +1 -1
  9. package/lib/components/Portal/renderPortal.js.map +1 -1
  10. package/lib/components/Portal/usePortal.js.map +1 -1
  11. package/lib/components/Portal/usePortalMountNode.js +29 -7
  12. package/lib/components/Portal/usePortalMountNode.js.map +1 -1
  13. package/lib/index.js +1 -1
  14. package/lib/index.js.map +1 -1
  15. package/lib/virtualParent/elementContains.js.map +1 -1
  16. package/lib/virtualParent/getParent.js.map +1 -1
  17. package/lib/virtualParent/getVirtualParent.js.map +1 -1
  18. package/lib/virtualParent/index.js.map +1 -1
  19. package/lib/virtualParent/isVirtualElement.js.map +1 -1
  20. package/lib/virtualParent/setVirtualParent.js.map +1 -1
  21. package/lib/virtualParent/types.js.map +1 -1
  22. package/lib-commonjs/Portal.js.map +1 -1
  23. package/lib-commonjs/components/Portal/Portal.js.map +1 -1
  24. package/lib-commonjs/components/Portal/Portal.types.js.map +1 -1
  25. package/lib-commonjs/components/Portal/index.js.map +1 -1
  26. package/lib-commonjs/components/Portal/renderPortal.js.map +1 -1
  27. package/lib-commonjs/components/Portal/usePortal.js.map +1 -1
  28. package/lib-commonjs/components/Portal/usePortalMountNode.js +29 -7
  29. package/lib-commonjs/components/Portal/usePortalMountNode.js.map +1 -1
  30. package/lib-commonjs/index.js +23 -6
  31. package/lib-commonjs/index.js.map +1 -1
  32. package/lib-commonjs/virtualParent/elementContains.js.map +1 -1
  33. package/lib-commonjs/virtualParent/getParent.js.map +1 -1
  34. package/lib-commonjs/virtualParent/getVirtualParent.js.map +1 -1
  35. package/lib-commonjs/virtualParent/index.js.map +1 -1
  36. package/lib-commonjs/virtualParent/isVirtualElement.js.map +1 -1
  37. package/lib-commonjs/virtualParent/setVirtualParent.js.map +1 -1
  38. package/lib-commonjs/virtualParent/types.js.map +1 -1
  39. package/package.json +17 -21
  40. package/lib/Portal.d.ts +0 -1
  41. package/lib/components/Portal/Portal.d.ts +0 -7
  42. package/lib/components/Portal/Portal.types.d.ts +0 -22
  43. package/lib/components/Portal/index.d.ts +0 -4
  44. package/lib/components/Portal/renderPortal.d.ts +0 -6
  45. package/lib/components/Portal/usePortal.d.ts +0 -9
  46. package/lib/components/Portal/usePortalMountNode.d.ts +0 -10
  47. package/lib/index.d.ts +0 -2
  48. package/lib/virtualParent/elementContains.d.ts +0 -7
  49. package/lib/virtualParent/getParent.d.ts +0 -5
  50. package/lib/virtualParent/getVirtualParent.d.ts +0 -4
  51. package/lib/virtualParent/index.d.ts +0 -5
  52. package/lib/virtualParent/isVirtualElement.d.ts +0 -5
  53. package/lib/virtualParent/setVirtualParent.d.ts +0 -7
  54. package/lib/virtualParent/types.d.ts +0 -5
  55. package/lib-commonjs/Portal.d.ts +0 -1
  56. package/lib-commonjs/components/Portal/Portal.d.ts +0 -7
  57. package/lib-commonjs/components/Portal/Portal.types.d.ts +0 -22
  58. package/lib-commonjs/components/Portal/index.d.ts +0 -4
  59. package/lib-commonjs/components/Portal/renderPortal.d.ts +0 -6
  60. package/lib-commonjs/components/Portal/usePortal.d.ts +0 -9
  61. package/lib-commonjs/components/Portal/usePortalMountNode.d.ts +0 -10
  62. package/lib-commonjs/index.d.ts +0 -2
  63. package/lib-commonjs/virtualParent/elementContains.d.ts +0 -7
  64. package/lib-commonjs/virtualParent/getParent.d.ts +0 -5
  65. package/lib-commonjs/virtualParent/getVirtualParent.d.ts +0 -4
  66. package/lib-commonjs/virtualParent/index.d.ts +0 -5
  67. package/lib-commonjs/virtualParent/isVirtualElement.d.ts +0 -5
  68. package/lib-commonjs/virtualParent/setVirtualParent.d.ts +0 -7
  69. package/lib-commonjs/virtualParent/types.d.ts +0 -5
@@ -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: HTMLDivElement | undefined;
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) => HTMLDivElement | undefined;
@@ -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
- }