@fluentui/react-portal 9.0.0-nightly.f81b28ceb3.1 → 9.0.0-rc.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (96) hide show
  1. package/CHANGELOG.json +494 -16
  2. package/CHANGELOG.md +219 -73
  3. package/dist/{react-portal.d.ts → index.d.ts} +11 -11
  4. package/{lib → dist}/tsdoc-metadata.json +0 -0
  5. package/lib/Portal.js.map +1 -1
  6. package/lib/components/Portal/Portal.js +8 -6
  7. package/lib/components/Portal/Portal.js.map +1 -1
  8. package/lib/components/Portal/Portal.types.js.map +1 -1
  9. package/lib/components/Portal/index.js.map +1 -1
  10. package/lib/components/Portal/renderPortal.js +6 -2
  11. package/lib/components/Portal/renderPortal.js.map +1 -1
  12. package/lib/components/Portal/usePortal.js +23 -17
  13. package/lib/components/Portal/usePortal.js.map +1 -1
  14. package/lib/components/Portal/usePortalMountNode.js +27 -21
  15. package/lib/components/Portal/usePortalMountNode.js.map +1 -1
  16. package/lib/index.js +1 -1
  17. package/lib/index.js.map +1 -1
  18. package/lib/virtualParent/elementContains.js +18 -14
  19. package/lib/virtualParent/elementContains.js.map +1 -1
  20. package/lib/virtualParent/getParent.js +2 -1
  21. package/lib/virtualParent/getParent.js.map +1 -1
  22. package/lib/virtualParent/getVirtualParent.js +8 -5
  23. package/lib/virtualParent/getVirtualParent.js.map +1 -1
  24. package/lib/virtualParent/index.js.map +1 -1
  25. package/lib/virtualParent/isVirtualElement.js +1 -1
  26. package/lib/virtualParent/isVirtualElement.js.map +1 -1
  27. package/lib/virtualParent/setVirtualParent.js +11 -8
  28. package/lib/virtualParent/setVirtualParent.js.map +1 -1
  29. package/lib/virtualParent/types.js.map +1 -1
  30. package/lib-commonjs/Portal.js +7 -2
  31. package/lib-commonjs/Portal.js.map +1 -1
  32. package/lib-commonjs/components/Portal/Portal.js +16 -7
  33. package/lib-commonjs/components/Portal/Portal.js.map +1 -1
  34. package/lib-commonjs/components/Portal/Portal.types.js +4 -1
  35. package/lib-commonjs/components/Portal/Portal.types.js.map +1 -1
  36. package/lib-commonjs/components/Portal/index.js +10 -2
  37. package/lib-commonjs/components/Portal/index.js.map +1 -1
  38. package/lib-commonjs/components/Portal/renderPortal.js +18 -7
  39. package/lib-commonjs/components/Portal/renderPortal.js.map +1 -1
  40. package/lib-commonjs/components/Portal/usePortal.js +39 -24
  41. package/lib-commonjs/components/Portal/usePortal.js.map +1 -1
  42. package/lib-commonjs/components/Portal/usePortalMountNode.js +41 -26
  43. package/lib-commonjs/components/Portal/usePortalMountNode.js.map +1 -1
  44. package/lib-commonjs/index.js +41 -7
  45. package/lib-commonjs/index.js.map +1 -1
  46. package/lib-commonjs/virtualParent/elementContains.js +26 -16
  47. package/lib-commonjs/virtualParent/elementContains.js.map +1 -1
  48. package/lib-commonjs/virtualParent/getParent.js +10 -3
  49. package/lib-commonjs/virtualParent/getParent.js.map +1 -1
  50. package/lib-commonjs/virtualParent/getVirtualParent.js +16 -7
  51. package/lib-commonjs/virtualParent/getVirtualParent.js.map +1 -1
  52. package/lib-commonjs/virtualParent/index.js +11 -2
  53. package/lib-commonjs/virtualParent/index.js.map +1 -1
  54. package/lib-commonjs/virtualParent/isVirtualElement.js +7 -2
  55. package/lib-commonjs/virtualParent/isVirtualElement.js.map +1 -1
  56. package/lib-commonjs/virtualParent/setVirtualParent.js +17 -9
  57. package/lib-commonjs/virtualParent/setVirtualParent.js.map +1 -1
  58. package/lib-commonjs/virtualParent/types.js +4 -1
  59. package/lib-commonjs/virtualParent/types.js.map +1 -1
  60. package/package.json +17 -22
  61. package/lib/Portal.d.ts +0 -1
  62. package/lib/common/isConformant.d.ts +0 -4
  63. package/lib/common/isConformant.js +0 -9
  64. package/lib/common/isConformant.js.map +0 -1
  65. package/lib/components/Portal/Portal.d.ts +0 -6
  66. package/lib/components/Portal/Portal.types.d.ts +0 -21
  67. package/lib/components/Portal/index.d.ts +0 -4
  68. package/lib/components/Portal/renderPortal.d.ts +0 -6
  69. package/lib/components/Portal/usePortal.d.ts +0 -9
  70. package/lib/components/Portal/usePortalMountNode.d.ts +0 -10
  71. package/lib/index.d.ts +0 -2
  72. package/lib/virtualParent/elementContains.d.ts +0 -7
  73. package/lib/virtualParent/getParent.d.ts +0 -5
  74. package/lib/virtualParent/getVirtualParent.d.ts +0 -4
  75. package/lib/virtualParent/index.d.ts +0 -5
  76. package/lib/virtualParent/isVirtualElement.d.ts +0 -5
  77. package/lib/virtualParent/setVirtualParent.d.ts +0 -7
  78. package/lib/virtualParent/types.d.ts +0 -5
  79. package/lib-commonjs/Portal.d.ts +0 -1
  80. package/lib-commonjs/common/isConformant.d.ts +0 -4
  81. package/lib-commonjs/common/isConformant.js +0 -13
  82. package/lib-commonjs/common/isConformant.js.map +0 -1
  83. package/lib-commonjs/components/Portal/Portal.d.ts +0 -6
  84. package/lib-commonjs/components/Portal/Portal.types.d.ts +0 -21
  85. package/lib-commonjs/components/Portal/index.d.ts +0 -4
  86. package/lib-commonjs/components/Portal/renderPortal.d.ts +0 -6
  87. package/lib-commonjs/components/Portal/usePortal.d.ts +0 -9
  88. package/lib-commonjs/components/Portal/usePortalMountNode.d.ts +0 -10
  89. package/lib-commonjs/index.d.ts +0 -2
  90. package/lib-commonjs/virtualParent/elementContains.d.ts +0 -7
  91. package/lib-commonjs/virtualParent/getParent.d.ts +0 -5
  92. package/lib-commonjs/virtualParent/getVirtualParent.d.ts +0 -4
  93. package/lib-commonjs/virtualParent/index.d.ts +0 -5
  94. package/lib-commonjs/virtualParent/isVirtualElement.d.ts +0 -5
  95. package/lib-commonjs/virtualParent/setVirtualParent.d.ts +0 -7
  96. package/lib-commonjs/virtualParent/types.d.ts +0 -5
@@ -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: (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.
6
- *
7
- * @param props - props from this instance of Portal
8
- */
9
- export declare const usePortal: (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;
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,4 +0,0 @@
1
- import type { IsConformantOptions } from '@fluentui/react-conformance';
2
- export declare function isConformant<TProps = {}>(testInfo: Omit<IsConformantOptions<TProps>, 'componentPath'> & {
3
- componentPath?: string;
4
- }): void;
@@ -1,13 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isConformant = void 0;
4
- var react_conformance_1 = require("@fluentui/react-conformance");
5
- function isConformant(testInfo) {
6
- var defaultOptions = {
7
- asPropHandlesRef: true,
8
- componentPath: module.parent.filename.replace('.test', ''),
9
- };
10
- react_conformance_1.isConformant(defaultOptions, testInfo);
11
- }
12
- exports.isConformant = isConformant;
13
- //# sourceMappingURL=isConformant.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"isConformant.js","sourceRoot":"","sources":["../../src/common/isConformant.ts"],"names":[],"mappings":";;;AAAA,iEAA+E;AAG/E,SAAgB,YAAY,CAC1B,QAAyF;IAEzF,IAAM,cAAc,GAAyC;QAC3D,gBAAgB,EAAE,IAAI;QACtB,aAAa,EAAE,MAAO,CAAC,MAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC;KAC7D,CAAC;IAEF,gCAAgB,CAAC,cAAc,EAAE,QAAQ,CAAC,CAAC;AAC7C,CAAC;AATD,oCASC"}
@@ -1,6 +0,0 @@
1
- import * as React from 'react';
2
- import type { PortalProps } from './Portal.types';
3
- /**
4
- * Component that renders children in a React portal
5
- */
6
- export declare const Portal: React.FC<PortalProps>;
@@ -1,21 +0,0 @@
1
- import * as React from 'react';
2
- export 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
- };
@@ -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: (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.
6
- *
7
- * @param props - props from this instance of Portal
8
- */
9
- export declare const usePortal: (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
- }