@fluentui/react-portal 9.0.0-alpha.8 → 9.0.0-nightly.25435def33.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (119) hide show
  1. package/CHANGELOG.json +1486 -1
  2. package/CHANGELOG.md +568 -2
  3. package/README.md +114 -0
  4. package/Spec.md +100 -6
  5. package/dist/react-portal.d.ts +30 -9
  6. package/lib/Portal.js.map +1 -1
  7. package/lib/common/isConformant.d.ts +4 -2
  8. package/lib/common/isConformant.js.map +1 -1
  9. package/lib/components/Portal/Portal.d.ts +1 -1
  10. package/lib/components/Portal/Portal.js.map +1 -1
  11. package/lib/components/Portal/Portal.types.d.ts +11 -6
  12. package/lib/components/Portal/Portal.types.js.map +1 -1
  13. package/lib/components/Portal/index.js.map +1 -1
  14. package/lib/components/Portal/renderPortal.d.ts +2 -2
  15. package/lib/components/Portal/renderPortal.js +2 -4
  16. package/lib/components/Portal/renderPortal.js.map +1 -1
  17. package/lib/components/Portal/usePortal.d.ts +2 -3
  18. package/lib/components/Portal/usePortal.js +18 -8
  19. package/lib/components/Portal/usePortal.js.map +1 -1
  20. package/lib/components/Portal/usePortalMountNode.js +2 -0
  21. package/lib/components/Portal/usePortalMountNode.js.map +1 -1
  22. package/lib/index.d.ts +1 -0
  23. package/lib/index.js +1 -0
  24. package/lib/index.js.map +1 -1
  25. package/lib/tsdoc-metadata.json +1 -1
  26. package/lib/virtualParent/elementContains.d.ts +7 -0
  27. package/lib/virtualParent/elementContains.js +26 -0
  28. package/lib/virtualParent/elementContains.js.map +1 -0
  29. package/lib/virtualParent/getParent.d.ts +5 -0
  30. package/lib/virtualParent/getParent.js +9 -0
  31. package/lib/virtualParent/getParent.js.map +1 -0
  32. package/lib/virtualParent/getVirtualParent.d.ts +4 -0
  33. package/lib/virtualParent/getVirtualParent.js +12 -0
  34. package/lib/virtualParent/getVirtualParent.js.map +1 -0
  35. package/lib/virtualParent/index.d.ts +5 -0
  36. package/lib/virtualParent/index.js +6 -0
  37. package/lib/virtualParent/index.js.map +1 -0
  38. package/lib/virtualParent/isVirtualElement.d.ts +5 -0
  39. package/lib/virtualParent/isVirtualElement.js +7 -0
  40. package/lib/virtualParent/isVirtualElement.js.map +1 -0
  41. package/lib/virtualParent/setVirtualParent.d.ts +7 -0
  42. package/lib/virtualParent/setVirtualParent.js +17 -0
  43. package/lib/virtualParent/setVirtualParent.js.map +1 -0
  44. package/lib/virtualParent/types.d.ts +5 -0
  45. package/lib/virtualParent/types.js +2 -0
  46. package/lib/virtualParent/types.js.map +1 -0
  47. package/lib-commonjs/Portal.js.map +1 -1
  48. package/lib-commonjs/common/isConformant.d.ts +4 -2
  49. package/lib-commonjs/common/isConformant.js.map +1 -1
  50. package/lib-commonjs/components/Portal/Portal.d.ts +1 -1
  51. package/lib-commonjs/components/Portal/Portal.js.map +1 -1
  52. package/lib-commonjs/components/Portal/Portal.types.d.ts +11 -6
  53. package/lib-commonjs/components/Portal/Portal.types.js.map +1 -1
  54. package/lib-commonjs/components/Portal/index.js.map +1 -1
  55. package/lib-commonjs/components/Portal/renderPortal.d.ts +2 -2
  56. package/lib-commonjs/components/Portal/renderPortal.js +2 -4
  57. package/lib-commonjs/components/Portal/renderPortal.js.map +1 -1
  58. package/lib-commonjs/components/Portal/usePortal.d.ts +2 -3
  59. package/lib-commonjs/components/Portal/usePortal.js +17 -7
  60. package/lib-commonjs/components/Portal/usePortal.js.map +1 -1
  61. package/lib-commonjs/components/Portal/usePortalMountNode.js +2 -0
  62. package/lib-commonjs/components/Portal/usePortalMountNode.js.map +1 -1
  63. package/lib-commonjs/index.d.ts +1 -0
  64. package/lib-commonjs/index.js +4 -0
  65. package/lib-commonjs/index.js.map +1 -1
  66. package/lib-commonjs/virtualParent/elementContains.d.ts +7 -0
  67. package/lib-commonjs/virtualParent/elementContains.js +30 -0
  68. package/lib-commonjs/virtualParent/elementContains.js.map +1 -0
  69. package/lib-commonjs/virtualParent/getParent.d.ts +5 -0
  70. package/lib-commonjs/virtualParent/getParent.js +13 -0
  71. package/lib-commonjs/virtualParent/getParent.js.map +1 -0
  72. package/lib-commonjs/virtualParent/getVirtualParent.d.ts +4 -0
  73. package/lib-commonjs/virtualParent/getVirtualParent.js +16 -0
  74. package/lib-commonjs/virtualParent/getVirtualParent.js.map +1 -0
  75. package/lib-commonjs/virtualParent/index.d.ts +5 -0
  76. package/lib-commonjs/virtualParent/index.js +9 -0
  77. package/lib-commonjs/virtualParent/index.js.map +1 -0
  78. package/lib-commonjs/virtualParent/isVirtualElement.d.ts +5 -0
  79. package/lib-commonjs/virtualParent/isVirtualElement.js +11 -0
  80. package/lib-commonjs/virtualParent/isVirtualElement.js.map +1 -0
  81. package/lib-commonjs/virtualParent/setVirtualParent.d.ts +7 -0
  82. package/lib-commonjs/virtualParent/setVirtualParent.js +21 -0
  83. package/lib-commonjs/virtualParent/setVirtualParent.js.map +1 -0
  84. package/lib-commonjs/virtualParent/types.d.ts +5 -0
  85. package/lib-commonjs/virtualParent/types.js +3 -0
  86. package/lib-commonjs/virtualParent/types.js.map +1 -0
  87. package/package.json +15 -12
  88. package/config/api-extractor.json +0 -3
  89. package/config/tests.js +0 -7
  90. package/etc/react-portal.api.md +0 -32
  91. package/just.config.ts +0 -3
  92. package/lib-amd/Portal.d.ts +0 -1
  93. package/lib-amd/Portal.js +0 -6
  94. package/lib-amd/Portal.js.map +0 -1
  95. package/lib-amd/common/isConformant.d.ts +0 -2
  96. package/lib-amd/common/isConformant.js +0 -14
  97. package/lib-amd/common/isConformant.js.map +0 -1
  98. package/lib-amd/components/Portal/Portal.d.ts +0 -6
  99. package/lib-amd/components/Portal/Portal.js +0 -15
  100. package/lib-amd/components/Portal/Portal.js.map +0 -1
  101. package/lib-amd/components/Portal/Portal.types.d.ts +0 -16
  102. package/lib-amd/components/Portal/Portal.types.js +0 -5
  103. package/lib-amd/components/Portal/Portal.types.js.map +0 -1
  104. package/lib-amd/components/Portal/index.d.ts +0 -4
  105. package/lib-amd/components/Portal/index.js +0 -9
  106. package/lib-amd/components/Portal/index.js.map +0 -1
  107. package/lib-amd/components/Portal/renderPortal.d.ts +0 -6
  108. package/lib-amd/components/Portal/renderPortal.js +0 -16
  109. package/lib-amd/components/Portal/renderPortal.js.map +0 -1
  110. package/lib-amd/components/Portal/usePortal.d.ts +0 -10
  111. package/lib-amd/components/Portal/usePortal.js +0 -23
  112. package/lib-amd/components/Portal/usePortal.js.map +0 -1
  113. package/lib-amd/components/Portal/usePortalMountNode.d.ts +0 -10
  114. package/lib-amd/components/Portal/usePortalMountNode.js +0 -31
  115. package/lib-amd/components/Portal/usePortalMountNode.js.map +0 -1
  116. package/lib-amd/index.d.ts +0 -1
  117. package/lib-amd/index.js +0 -6
  118. package/lib-amd/index.js.map +0 -1
  119. package/src/components/Portal/Portal.types.ts +0 -24
@@ -0,0 +1,5 @@
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;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Determines whether or not an element has the virtual hierarchy extension.
3
+ */
4
+ export function isVirtualElement(element) {
5
+ return element && !!element._virtual;
6
+ }
7
+ //# sourceMappingURL=isVirtualElement.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isVirtualElement.js","sourceRoot":"","sources":["../../src/virtualParent/isVirtualElement.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAAC,OAAqC;IACpE,OAAO,OAAO,IAAI,CAAC,CAAkB,OAAQ,CAAC,QAAQ,CAAC;AACzD,CAAC"}
@@ -0,0 +1,7 @@
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;
@@ -0,0 +1,17 @@
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 function setVirtualParent(child, parent) {
8
+ if (!child) {
9
+ return;
10
+ }
11
+ var virtualChild = child;
12
+ if (!virtualChild._virtual) {
13
+ virtualChild._virtual = {};
14
+ }
15
+ virtualChild._virtual.parent = parent || undefined;
16
+ }
17
+ //# sourceMappingURL=setVirtualParent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setVirtualParent.js","sourceRoot":"","sources":["../../src/virtualParent/setVirtualParent.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAAkB,EAAE,MAAoB;IACvE,IAAI,CAAC,KAAK,EAAE;QACV,OAAO;KACR;IAED,IAAM,YAAY,GAAmB,KAAK,CAAC;IAE3C,IAAI,CAAC,YAAY,CAAC,QAAQ,EAAE;QAC1B,YAAY,CAAC,QAAQ,GAAG,EAAE,CAAC;KAC5B;IAED,YAAY,CAAC,QAAQ,CAAC,MAAM,GAAG,MAAM,IAAI,SAAS,CAAC;AACrD,CAAC"}
@@ -0,0 +1,5 @@
1
+ export interface VirtualElement extends HTMLElement {
2
+ _virtual: {
3
+ parent?: HTMLElement;
4
+ };
5
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/virtualParent/types.ts"],"names":[],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"Portal.js","sourceRoot":"../src/","sources":["Portal.ts"],"names":[],"mappings":";;;AAAA,oEAA0C","sourcesContent":["export * from './components/Portal/index';\n"]}
1
+ {"version":3,"file":"Portal.js","sourceRoot":"","sources":["../src/Portal.ts"],"names":[],"mappings":";;;AAAA,oEAA0C"}
@@ -1,2 +1,4 @@
1
- import { IsConformantOptions } from '@fluentui/react-conformance';
2
- export declare function isConformant(testInfo: Omit<IsConformantOptions, 'componentPath'>): void;
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 +1 @@
1
- {"version":3,"file":"isConformant.js","sourceRoot":"../src/","sources":["common/isConformant.ts"],"names":[],"mappings":";;;AAAA,iEAAoG;AAEpG,SAAgB,YAAY,CAAC,QAAoD;IAC/E,IAAM,cAAc,GAAG;QACrB,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;AAPD,oCAOC","sourcesContent":["import { isConformant as baseIsConformant, IsConformantOptions } from '@fluentui/react-conformance';\n\nexport function isConformant(testInfo: Omit<IsConformantOptions, 'componentPath'>) {\n const defaultOptions = {\n asPropHandlesRef: true,\n componentPath: module!.parent!.filename.replace('.test', ''),\n };\n\n baseIsConformant(defaultOptions, testInfo);\n}\n"]}
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,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { PortalProps } from './Portal.types';
2
+ import type { PortalProps } from './Portal.types';
3
3
  /**
4
4
  * Component that renders children in a React portal
5
5
  */
@@ -1 +1 @@
1
- {"version":3,"file":"Portal.js","sourceRoot":"../src/","sources":["components/Portal/Portal.tsx"],"names":[],"mappings":";;;AAEA,yCAAwC;AAExC,+CAA8C;AAE9C;;GAEG;AACI,IAAM,MAAM,GAA0B,UAAA,KAAK;IAChD,IAAM,KAAK,GAAG,qBAAS,CAAC,KAAK,CAAC,CAAC;IAE/B,OAAO,2BAAY,CAAC,KAAK,CAAC,CAAC;AAC7B,CAAC,CAAC;AAJW,QAAA,MAAM,UAIjB;AAEF,cAAM,CAAC,WAAW,GAAG,QAAQ,CAAC","sourcesContent":["import * as React from 'react';\n\nimport { usePortal } from './usePortal';\nimport { PortalProps } from './Portal.types';\nimport { renderPortal } from './renderPortal';\n\n/**\n * Component that renders children in a React portal\n */\nexport const Portal: React.FC<PortalProps> = props => {\n const state = usePortal(props);\n\n return renderPortal(state);\n};\n\nPortal.displayName = 'Portal';\n"]}
1
+ {"version":3,"file":"Portal.js","sourceRoot":"","sources":["../../../src/components/Portal/Portal.tsx"],"names":[],"mappings":";;;AAEA,yCAAwC;AACxC,+CAA8C;AAG9C;;GAEG;AACI,IAAM,MAAM,GAA0B,UAAA,KAAK;IAChD,IAAM,KAAK,GAAG,qBAAS,CAAC,KAAK,CAAC,CAAC;IAE/B,OAAO,2BAAY,CAAC,KAAK,CAAC,CAAC;AAC7B,CAAC,CAAC;AAJW,QAAA,MAAM,UAIjB;AAEF,cAAM,CAAC,WAAW,GAAG,QAAQ,CAAC"}
@@ -1,16 +1,21 @@
1
1
  import * as React from 'react';
2
- export interface PortalProps {
2
+ export declare type PortalCommons = {
3
3
  /**
4
4
  * React children
5
5
  */
6
- children?: React.ReactNode;
6
+ children: React.ReactNode;
7
7
  /**
8
8
  * Where the portal children are mounted on DOM
9
9
  * @defaultValue a new element on document.body without any styling
10
10
  */
11
- mountNode?: HTMLDivElement | null;
12
- }
13
- export interface PortalState extends PortalProps {
11
+ mountNode: HTMLDivElement | undefined;
12
+ };
13
+ export declare type PortalProps = Partial<PortalCommons>;
14
+ export declare type PortalState = PortalCommons & {
14
15
  /** Indicates if a Portal should be rendered. */
15
16
  shouldRender: boolean;
16
- }
17
+ /**
18
+ * Ref to the root span element as virtual parent
19
+ */
20
+ virtualParentRootRef: React.MutableRefObject<HTMLSpanElement | null>;
21
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"Portal.types.js","sourceRoot":"../src/","sources":["components/Portal/Portal.types.ts"],"names":[],"mappings":"","sourcesContent":["import * as React from 'react';\n\nexport interface PortalProps {\n /**\n * React children\n */\n children?: React.ReactNode;\n /**\n * Where the portal children are mounted on DOM\n * @defaultValue a new element on document.body without any styling\n */\n mountNode?: HTMLDivElement | null;\n\n /**\n * React events should not bubble up the portal\n */\n // TODO clarify if this is still needed\n // disableEventBubbling?: 'first' | 'last';\n}\n\nexport interface PortalState extends PortalProps {\n /** Indicates if a Portal should be rendered. */\n shouldRender: boolean;\n}\n"]}
1
+ {"version":3,"file":"Portal.types.js","sourceRoot":"","sources":["../../../src/components/Portal/Portal.types.ts"],"names":[],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"../src/","sources":["components/Portal/index.ts"],"names":[],"mappings":";;;AAAA,mDAAyB;AACzB,yDAA+B;AAC/B,yDAA+B;AAC/B,sDAA4B","sourcesContent":["export * from './Portal';\nexport * from './Portal.types';\nexport * from './renderPortal';\nexport * from './usePortal';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Portal/index.ts"],"names":[],"mappings":";;;AAAA,mDAAyB;AACzB,yDAA+B;AAC/B,yDAA+B;AAC/B,sDAA4B"}
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
- import { PortalState } from './Portal.types';
2
+ import type { PortalState } from './Portal.types';
3
3
  /**
4
4
  * Render the final JSX of Portal
5
5
  */
6
- export declare const renderPortal: (state: PortalState) => React.ReactPortal | null;
6
+ export declare const renderPortal: (state: PortalState) => React.ReactElement;
@@ -2,14 +2,12 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.renderPortal = void 0;
4
4
  var ReactDOM = require("react-dom");
5
+ var React = require("react");
5
6
  /**
6
7
  * Render the final JSX of Portal
7
8
  */
8
9
  var renderPortal = function (state) {
9
- if (state.shouldRender && state.mountNode) {
10
- return ReactDOM.createPortal(state.children, state.mountNode);
11
- }
12
- return null;
10
+ return (React.createElement("span", { hidden: true, ref: state.virtualParentRootRef }, state.shouldRender && state.mountNode && ReactDOM.createPortal(state.children, state.mountNode)));
13
11
  };
14
12
  exports.renderPortal = renderPortal;
15
13
  //# sourceMappingURL=renderPortal.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"renderPortal.js","sourceRoot":"../src/","sources":["components/Portal/renderPortal.tsx"],"names":[],"mappings":";;;AAAA,oCAAsC;AAItC;;GAEG;AACI,IAAM,YAAY,GAAG,UAAC,KAAkB;IAC7C,IAAI,KAAK,CAAC,YAAY,IAAI,KAAK,CAAC,SAAS,EAAE;QACzC,OAAO,QAAQ,CAAC,YAAY,CAAC,KAAK,CAAC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;KAC/D;IAED,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AANW,QAAA,YAAY,gBAMvB","sourcesContent":["import * as ReactDOM from 'react-dom';\nimport * as React from 'react';\nimport { PortalState } from './Portal.types';\n\n/**\n * Render the final JSX of Portal\n */\nexport const renderPortal = (state: PortalState): React.ReactPortal | null => {\n if (state.shouldRender && state.mountNode) {\n return ReactDOM.createPortal(state.children, state.mountNode);\n }\n\n return null;\n};\n"]}
1
+ {"version":3,"file":"renderPortal.js","sourceRoot":"","sources":["../../../src/components/Portal/renderPortal.tsx"],"names":[],"mappings":";;;AAAA,oCAAsC;AACtC,6BAA+B;AAG/B;;GAEG;AACI,IAAM,YAAY,GAAG,UAAC,KAAkB;IAC7C,OAAO,CACL,8BAAM,MAAM,QAAC,GAAG,EAAE,KAAK,CAAC,oBAAoB,IACzC,KAAK,CAAC,YAAY,IAAI,KAAK,CAAC,SAAS,IAAI,QAAQ,CAAC,YAAY,CAAC,KAAK,CAAC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC,CAC3F,CACR,CAAC;AACJ,CAAC,CAAC;AANW,QAAA,YAAY,gBAMvB"}
@@ -1,10 +1,9 @@
1
- import { PortalProps, PortalState } from './Portal.types';
1
+ import type { PortalProps, PortalState } from './Portal.types';
2
2
  /**
3
3
  * Create the state required to render Portal.
4
4
  *
5
5
  * The returned state can be modified with hooks such as usePortalStyles, before being passed to renderPortal.
6
6
  *
7
7
  * @param props - props from this instance of Portal
8
- * @param defaultProps - (optional) default prop values provided by the implementing type
9
8
  */
10
- export declare const usePortal: (props: PortalProps, defaultProps?: PortalProps | undefined) => PortalState;
9
+ export declare const usePortal: (props: PortalProps) => PortalState;
@@ -1,22 +1,32 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.usePortal = void 0;
4
+ var React = require("react");
4
5
  var react_utilities_1 = require("@fluentui/react-utilities");
5
6
  var usePortalMountNode_1 = require("./usePortalMountNode");
6
- var mergeProps = react_utilities_1.makeMergeProps();
7
+ var index_1 = require("../../virtualParent/index");
7
8
  /**
8
9
  * Create the state required to render Portal.
9
10
  *
10
11
  * The returned state can be modified with hooks such as usePortalStyles, before being passed to renderPortal.
11
12
  *
12
13
  * @param props - props from this instance of Portal
13
- * @param defaultProps - (optional) default prop values provided by the implementing type
14
14
  */
15
- var usePortal = function (props, defaultProps) {
16
- var _a;
17
- var state = mergeProps({ shouldRender: !react_utilities_1.useIsSSR() }, defaultProps, props);
18
- var fallbackMountNode = usePortalMountNode_1.usePortalMountNode({ disabled: !!state.mountNode });
19
- state.mountNode = (_a = state.mountNode) !== null && _a !== void 0 ? _a : fallbackMountNode;
15
+ var usePortal = function (props) {
16
+ var children = props.children, mountNode = props.mountNode;
17
+ var virtualParentRootRef = React.useRef(null);
18
+ var fallbackMountNode = usePortalMountNode_1.usePortalMountNode({ disabled: !!mountNode });
19
+ var state = {
20
+ children: children,
21
+ mountNode: mountNode !== null && mountNode !== void 0 ? mountNode : fallbackMountNode,
22
+ shouldRender: !react_utilities_1.useIsSSR(),
23
+ virtualParentRootRef: virtualParentRootRef,
24
+ };
25
+ React.useEffect(function () {
26
+ if (state.virtualParentRootRef.current && state.mountNode) {
27
+ index_1.setVirtualParent(state.mountNode, state.virtualParentRootRef.current);
28
+ }
29
+ }, [state.virtualParentRootRef, state.mountNode]);
20
30
  return state;
21
31
  };
22
32
  exports.usePortal = usePortal;
@@ -1 +1 @@
1
- {"version":3,"file":"usePortal.js","sourceRoot":"../src/","sources":["components/Portal/usePortal.ts"],"names":[],"mappings":";;;AAAA,6DAAqE;AAGrE,2DAA0D;AAE1D,IAAM,UAAU,GAAG,gCAAc,EAAe,CAAC;AAEjD;;;;;;;GAOG;AACI,IAAM,SAAS,GAAG,UAAC,KAAkB,EAAE,YAA0B;;IACtE,IAAM,KAAK,GAAG,UAAU,CAAC,EAAE,YAAY,EAAE,CAAC,0BAAQ,EAAE,EAAE,EAAE,YAAY,EAAE,KAAK,CAAC,CAAC;IAC7E,IAAM,iBAAiB,GAAG,uCAAkB,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,SAAS,EAAE,CAAC,CAAC;IAE9E,KAAK,CAAC,SAAS,SAAG,KAAK,CAAC,SAAS,mCAAI,iBAAiB,CAAC;IAEvD,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AAPW,QAAA,SAAS,aAOpB","sourcesContent":["import { makeMergeProps, useIsSSR } from '@fluentui/react-utilities';\n\nimport { PortalProps, PortalState } from './Portal.types';\nimport { usePortalMountNode } from './usePortalMountNode';\n\nconst mergeProps = makeMergeProps<PortalState>();\n\n/**\n * Create the state required to render Portal.\n *\n * The returned state can be modified with hooks such as usePortalStyles, before being passed to renderPortal.\n *\n * @param props - props from this instance of Portal\n * @param defaultProps - (optional) default prop values provided by the implementing type\n */\nexport const usePortal = (props: PortalProps, defaultProps?: PortalProps): PortalState => {\n const state = mergeProps({ shouldRender: !useIsSSR() }, defaultProps, props);\n const fallbackMountNode = usePortalMountNode({ disabled: !!state.mountNode });\n\n state.mountNode = state.mountNode ?? fallbackMountNode;\n\n return state;\n};\n"]}
1
+ {"version":3,"file":"usePortal.js","sourceRoot":"","sources":["../../../src/components/Portal/usePortal.ts"],"names":[],"mappings":";;;AAAA,6BAA+B;AAC/B,6DAAqD;AACrD,2DAA0D;AAC1D,mDAA6D;AAG7D;;;;;;GAMG;AACI,IAAM,SAAS,GAAG,UAAC,KAAkB;IAClC,IAAA,QAAQ,GAAgB,KAAK,SAArB,EAAE,SAAS,GAAK,KAAK,UAAV,CAAW;IAEtC,IAAM,oBAAoB,GAAG,KAAK,CAAC,MAAM,CAAkB,IAAI,CAAC,CAAC;IACjE,IAAM,iBAAiB,GAAG,uCAAkB,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC;IAExE,IAAM,KAAK,GAAgB;QACzB,QAAQ,UAAA;QACR,SAAS,EAAE,SAAS,aAAT,SAAS,cAAT,SAAS,GAAI,iBAAiB;QACzC,YAAY,EAAE,CAAC,0BAAQ,EAAE;QACzB,oBAAoB,sBAAA;KACrB,CAAC;IAEF,KAAK,CAAC,SAAS,CAAC;QACd,IAAI,KAAK,CAAC,oBAAoB,CAAC,OAAO,IAAI,KAAK,CAAC,SAAS,EAAE;YACzD,wBAAgB,CAAC,KAAK,CAAC,SAAS,EAAE,KAAK,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC;SACvE;IACH,CAAC,EAAE,CAAC,KAAK,CAAC,oBAAoB,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC;IAElD,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AApBW,QAAA,SAAS,aAoBpB"}
@@ -4,6 +4,7 @@ exports.usePortalMountNode = void 0;
4
4
  var React = require("react");
5
5
  var react_utilities_1 = require("@fluentui/react-utilities");
6
6
  var react_shared_contexts_1 = require("@fluentui/react-shared-contexts");
7
+ var react_tabster_1 = require("@fluentui/react-tabster");
7
8
  /**
8
9
  * Creates a new element on a document.body to mount portals
9
10
  */
@@ -20,6 +21,7 @@ var usePortalMountNode = function (options) {
20
21
  targetDocument.body.appendChild(newElement);
21
22
  return newElement;
22
23
  }, [targetDocument, themeClassName, dir, options.disabled]);
24
+ react_tabster_1.useKeyboardNavAttribute().current = element;
23
25
  react_utilities_1.useIsomorphicLayoutEffect(function () {
24
26
  return function () {
25
27
  var _a;
@@ -1 +1 @@
1
- {"version":3,"file":"usePortalMountNode.js","sourceRoot":"../src/","sources":["components/Portal/usePortalMountNode.ts"],"names":[],"mappings":";;;AAAA,6BAA+B;AAC/B,6DAAsE;AACtE,yEAA+E;AAS/E;;GAEG;AACI,IAAM,kBAAkB,GAAG,UAAC,OAAkC;IACnE,IAAM,cAAc,GAAG,yCAAiB,EAAE,CAAC;IACrC,IAAA,KAA0B,iCAAS,EAAE,EAAnC,cAAc,oBAAA,EAAE,GAAG,SAAgB,CAAC;IAE5C,IAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC;QAC5B,IAAI,cAAc,KAAK,SAAS,IAAI,OAAO,CAAC,QAAQ,EAAE;YACpD,OAAO,SAAS,CAAC;SAClB;QAED,IAAM,UAAU,GAAG,cAAc,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QACvD,UAAU,CAAC,YAAY,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC;QACjD,UAAU,CAAC,YAAY,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;QACpC,cAAc,CAAC,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;QAE5C,OAAO,UAAU,CAAC;IACpB,CAAC,EAAE,CAAC,cAAc,EAAE,cAAc,EAAE,GAAG,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC;IAE5D,2CAAyB,CAAC;QACxB,OAAO;;YACL,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,aAAa,0CAAE,WAAW,CAAC,OAAO,EAAE;QAC/C,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;IAEd,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AAxBW,QAAA,kBAAkB,sBAwB7B","sourcesContent":["import * as React from 'react';\nimport { useIsomorphicLayoutEffect } from '@fluentui/react-utilities';\nimport { useThemeClassName, useFluent } from '@fluentui/react-shared-contexts';\n\nexport type UsePortalMountNodeOptions = {\n /**\n * Since hooks cannot be called conditionally use this flag to disable creating the node\n */\n disabled?: boolean;\n};\n\n/**\n * Creates a new element on a document.body to mount portals\n */\nexport const usePortalMountNode = (options: UsePortalMountNodeOptions) => {\n const themeClassName = useThemeClassName();\n const { targetDocument, dir } = useFluent();\n\n const element = React.useMemo(() => {\n if (targetDocument === undefined || options.disabled) {\n return undefined;\n }\n\n const newElement = targetDocument.createElement('div');\n newElement.setAttribute('class', themeClassName);\n newElement.setAttribute('dir', dir);\n targetDocument.body.appendChild(newElement);\n\n return newElement;\n }, [targetDocument, themeClassName, dir, options.disabled]);\n\n useIsomorphicLayoutEffect(() => {\n return () => {\n element?.parentElement?.removeChild(element);\n };\n }, [element]);\n\n return element;\n};\n"]}
1
+ {"version":3,"file":"usePortalMountNode.js","sourceRoot":"","sources":["../../../src/components/Portal/usePortalMountNode.ts"],"names":[],"mappings":";;;AAAA,6BAA+B;AAC/B,6DAAsE;AACtE,yEAA+E;AAC/E,yDAAkE;AASlE;;GAEG;AACI,IAAM,kBAAkB,GAAG,UAAC,OAAkC;IACnE,IAAM,cAAc,GAAG,yCAAiB,EAAE,CAAC;IACrC,IAAA,KAA0B,iCAAS,EAAE,EAAnC,cAAc,oBAAA,EAAE,GAAG,SAAgB,CAAC;IAE5C,IAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC;QAC5B,IAAI,cAAc,KAAK,SAAS,IAAI,OAAO,CAAC,QAAQ,EAAE;YACpD,OAAO,SAAS,CAAC;SAClB;QAED,IAAM,UAAU,GAAG,cAAc,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QACvD,UAAU,CAAC,YAAY,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC;QACjD,UAAU,CAAC,YAAY,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;QACpC,cAAc,CAAC,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;QAE5C,OAAO,UAAU,CAAC;IACpB,CAAC,EAAE,CAAC,cAAc,EAAE,cAAc,EAAE,GAAG,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC;IAE3D,uCAAuB,EAA0C,CAAC,OAAO,GAAG,OAAQ,CAAC;IAEtF,2CAAyB,CAAC;QACxB,OAAO;;YACL,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,aAAa,0CAAE,WAAW,CAAC,OAAO,EAAE;QAC/C,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;IAEd,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AA1BW,QAAA,kBAAkB,sBA0B7B"}
@@ -1 +1,2 @@
1
1
  export * from './components/Portal/index';
2
+ export { elementContains, setVirtualParent } from './virtualParent/index';
@@ -1,5 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.setVirtualParent = exports.elementContains = void 0;
3
4
  var tslib_1 = require("tslib");
4
5
  tslib_1.__exportStar(require("./components/Portal/index"), exports);
6
+ var index_1 = require("./virtualParent/index");
7
+ Object.defineProperty(exports, "elementContains", { enumerable: true, get: function () { return index_1.elementContains; } });
8
+ Object.defineProperty(exports, "setVirtualParent", { enumerable: true, get: function () { return index_1.setVirtualParent; } });
5
9
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"../src/","sources":["index.ts"],"names":[],"mappings":";;;AAAA,oEAA0C","sourcesContent":["export * from './components/Portal/index';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;AAAA,oEAA0C;AAC1C,+CAA0E;AAAjE,wGAAA,eAAe,OAAA;AAAE,yGAAA,gBAAgB,OAAA"}
@@ -0,0 +1,7 @@
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;
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.elementContains = void 0;
4
+ var getParent_1 = require("./getParent");
5
+ /**
6
+ * Similar functionality to `element.contains` DOM API for use with out of order DOM elements that
7
+ * checks the virtual parent hierarchy. If a virtual parents exists, it is chosen over the actual parent
8
+ *
9
+ * @returns true if the child can find the parent in its virtual hierarchy
10
+ */
11
+ function elementContains(parent, child) {
12
+ if (!parent || !child) {
13
+ return false;
14
+ }
15
+ if (parent === child) {
16
+ return true;
17
+ }
18
+ else {
19
+ while (child) {
20
+ var nextParent = getParent_1.getParent(child);
21
+ if (nextParent === parent) {
22
+ return true;
23
+ }
24
+ child = nextParent;
25
+ }
26
+ }
27
+ return false;
28
+ }
29
+ exports.elementContains = elementContains;
30
+ //# sourceMappingURL=elementContains.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"elementContains.js","sourceRoot":"","sources":["../../src/virtualParent/elementContains.ts"],"names":[],"mappings":";;;AAAA,yCAAwC;AACxC;;;;;GAKG;AACH,SAAgB,eAAe,CAAC,MAA0B,EAAE,KAAyB;IACnF,IAAI,CAAC,MAAM,IAAI,CAAC,KAAK,EAAE;QACrB,OAAO,KAAK,CAAC;KACd;IAED,IAAI,MAAM,KAAK,KAAK,EAAE;QACpB,OAAO,IAAI,CAAC;KACb;SAAM;QACL,OAAO,KAAK,EAAE;YACZ,IAAM,UAAU,GAAuB,qBAAS,CAAC,KAAK,CAAC,CAAC;YAExD,IAAI,UAAU,KAAK,MAAM,EAAE;gBACzB,OAAO,IAAI,CAAC;aACb;YAED,KAAK,GAAG,UAAU,CAAC;SACpB;KACF;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AApBD,0CAoBC"}
@@ -0,0 +1,5 @@
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;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getParent = void 0;
4
+ var getVirtualParent_1 = require("./getVirtualParent");
5
+ /**
6
+ * Gets the element which is the parent of a given element.
7
+ * This method prefers the virtual parent over real DOM parent when present.
8
+ */
9
+ function getParent(child) {
10
+ return (child && getVirtualParent_1.getVirtualParent(child)) || (child === null || child === void 0 ? void 0 : child.parentNode);
11
+ }
12
+ exports.getParent = getParent;
13
+ //# sourceMappingURL=getParent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getParent.js","sourceRoot":"","sources":["../../src/virtualParent/getParent.ts"],"names":[],"mappings":";;;AAAA,uDAAsD;AAEtD;;;GAGG;AACH,SAAgB,SAAS,CAAC,KAAyB;IACjD,OAAO,CAAC,KAAK,IAAI,mCAAgB,CAAC,KAAK,CAAC,CAAC,KAAK,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,UAAiC,CAAA,CAAC;AACzF,CAAC;AAFD,8BAEC"}
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Gets the virtual parent given the child element, if it exists.
3
+ */
4
+ export declare function getVirtualParent(child: HTMLElement): HTMLElement | undefined;
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getVirtualParent = void 0;
4
+ var isVirtualElement_1 = require("./isVirtualElement");
5
+ /**
6
+ * Gets the virtual parent given the child element, if it exists.
7
+ */
8
+ function getVirtualParent(child) {
9
+ var parent;
10
+ if (isVirtualElement_1.isVirtualElement(child)) {
11
+ parent = child._virtual.parent;
12
+ }
13
+ return parent;
14
+ }
15
+ exports.getVirtualParent = getVirtualParent;
16
+ //# sourceMappingURL=getVirtualParent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getVirtualParent.js","sourceRoot":"","sources":["../../src/virtualParent/getVirtualParent.ts"],"names":[],"mappings":";;;AAAA,uDAAsD;AACtD;;GAEG;AACH,SAAgB,gBAAgB,CAAC,KAAkB;IACjD,IAAI,MAA+B,CAAC;IACpC,IAAI,mCAAgB,CAAC,KAAK,CAAC,EAAE;QAC3B,MAAM,GAAG,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC;KAChC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAND,4CAMC"}
@@ -0,0 +1,5 @@
1
+ export * from './elementContains';
2
+ export * from './getParent';
3
+ export * from './getVirtualParent';
4
+ export * from './isVirtualElement';
5
+ export * from './setVirtualParent';
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./elementContains"), exports);
5
+ tslib_1.__exportStar(require("./getParent"), exports);
6
+ tslib_1.__exportStar(require("./getVirtualParent"), exports);
7
+ tslib_1.__exportStar(require("./isVirtualElement"), exports);
8
+ tslib_1.__exportStar(require("./setVirtualParent"), exports);
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/virtualParent/index.ts"],"names":[],"mappings":";;;AAAA,4DAAkC;AAClC,sDAA4B;AAC5B,6DAAmC;AACnC,6DAAmC;AACnC,6DAAmC"}
@@ -0,0 +1,5 @@
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;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isVirtualElement = void 0;
4
+ /**
5
+ * Determines whether or not an element has the virtual hierarchy extension.
6
+ */
7
+ function isVirtualElement(element) {
8
+ return element && !!element._virtual;
9
+ }
10
+ exports.isVirtualElement = isVirtualElement;
11
+ //# sourceMappingURL=isVirtualElement.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isVirtualElement.js","sourceRoot":"","sources":["../../src/virtualParent/isVirtualElement.ts"],"names":[],"mappings":";;;AAEA;;GAEG;AACH,SAAgB,gBAAgB,CAAC,OAAqC;IACpE,OAAO,OAAO,IAAI,CAAC,CAAkB,OAAQ,CAAC,QAAQ,CAAC;AACzD,CAAC;AAFD,4CAEC"}
@@ -0,0 +1,7 @@
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;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.setVirtualParent = void 0;
4
+ /**
5
+ * Sets the virtual parent of an element.
6
+ *
7
+ * @param child - Theme element to set the virtual parent
8
+ * @param parent - The virtual parent, use `undefined` to remove a virtual parent relationship
9
+ */
10
+ function setVirtualParent(child, parent) {
11
+ if (!child) {
12
+ return;
13
+ }
14
+ var virtualChild = child;
15
+ if (!virtualChild._virtual) {
16
+ virtualChild._virtual = {};
17
+ }
18
+ virtualChild._virtual.parent = parent || undefined;
19
+ }
20
+ exports.setVirtualParent = setVirtualParent;
21
+ //# sourceMappingURL=setVirtualParent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setVirtualParent.js","sourceRoot":"","sources":["../../src/virtualParent/setVirtualParent.ts"],"names":[],"mappings":";;;AAEA;;;;;GAKG;AACH,SAAgB,gBAAgB,CAAC,KAAkB,EAAE,MAAoB;IACvE,IAAI,CAAC,KAAK,EAAE;QACV,OAAO;KACR;IAED,IAAM,YAAY,GAAmB,KAAK,CAAC;IAE3C,IAAI,CAAC,YAAY,CAAC,QAAQ,EAAE;QAC1B,YAAY,CAAC,QAAQ,GAAG,EAAE,CAAC;KAC5B;IAED,YAAY,CAAC,QAAQ,CAAC,MAAM,GAAG,MAAM,IAAI,SAAS,CAAC;AACrD,CAAC;AAZD,4CAYC"}
@@ -0,0 +1,5 @@
1
+ export interface VirtualElement extends HTMLElement {
2
+ _virtual: {
3
+ parent?: HTMLElement;
4
+ };
5
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/virtualParent/types.ts"],"names":[],"mappings":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui/react-portal",
3
- "version": "9.0.0-alpha.8",
3
+ "version": "9.0.0-nightly.25435def33.0",
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",
@@ -13,19 +13,21 @@
13
13
  "license": "MIT",
14
14
  "scripts": {
15
15
  "build": "just-scripts build",
16
+ "bundle-size": "bundle-size measure",
16
17
  "clean": "just-scripts clean",
17
18
  "code-style": "just-scripts code-style",
18
19
  "just": "just-scripts",
19
20
  "lint": "just-scripts lint",
20
- "start": "just-scripts dev:storybook",
21
- "start-test": "just-scripts jest-watch",
22
- "test": "just-scripts test",
23
- "update-snapshots": "just-scripts jest -u"
21
+ "start": "yarn storybook",
22
+ "test": "jest",
23
+ "docs": "api-extractor run --config=config/api-extractor.local.json --local",
24
+ "build:local": "tsc -p . --module esnext --emitDeclarationOnly && node ../../scripts/typescript/normalize-import --output dist/react-portal/src && yarn docs",
25
+ "storybook": "start-storybook"
24
26
  },
25
27
  "devDependencies": {
26
- "@fluentui/eslint-plugin": "^1.2.0",
27
- "@fluentui/jest-serializer-make-styles": "^9.0.0-alpha.7",
28
- "@fluentui/react-conformance": "^0.3.0",
28
+ "@fluentui/eslint-plugin": "*",
29
+ "@fluentui/jest-serializer-make-styles": "9.0.0-nightly.25435def33.0",
30
+ "@fluentui/react-conformance": "*",
29
31
  "@fluentui/scripts": "^1.0.0",
30
32
  "@types/enzyme": "3.10.3",
31
33
  "@types/enzyme-adapter-react-16": "1.0.3",
@@ -39,9 +41,10 @@
39
41
  "react-test-renderer": "^16.3.0"
40
42
  },
41
43
  "dependencies": {
42
- "@fluentui/react-make-styles": "^9.0.0-alpha.30",
43
- "@fluentui/react-shared-contexts": "^9.0.0-alpha.8",
44
- "@fluentui/react-utilities": "^9.0.0-alpha.21",
44
+ "@fluentui/react-make-styles": "9.0.0-nightly.25435def33.0",
45
+ "@fluentui/react-shared-contexts": "9.0.0-nightly.25435def33.0",
46
+ "@fluentui/react-tabster": "9.0.0-nightly.25435def33.0",
47
+ "@fluentui/react-utilities": "9.0.0-nightly.25435def33.0",
45
48
  "tslib": "^2.1.0"
46
49
  },
47
50
  "peerDependencies": {
@@ -51,7 +54,7 @@
51
54
  "react-dom": ">=16.8.0 <18.0.0"
52
55
  },
53
56
  "beachball": {
54
- "tag": "alpha",
57
+ "tag": "beta",
55
58
  "disallowedChangeTypes": [
56
59
  "major",
57
60
  "minor",
@@ -1,3 +0,0 @@
1
- {
2
- "extends": "@fluentui/scripts/api-extractor/api-extractor.common.json"
3
- }
package/config/tests.js DELETED
@@ -1,7 +0,0 @@
1
- /** Jest test setup file. */
2
-
3
- const { configure } = require('enzyme');
4
- const Adapter = require('enzyme-adapter-react-16');
5
-
6
- // Configure enzyme.
7
- configure({ adapter: new Adapter() });
@@ -1,32 +0,0 @@
1
- ## API Report File for "@fluentui/react-portal"
2
-
3
- > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
4
-
5
- ```ts
6
-
7
- import * as React_2 from 'react';
8
-
9
- // @public
10
- export const Portal: React_2.FC<PortalProps>;
11
-
12
- // @public (undocumented)
13
- export interface PortalProps {
14
- children?: React_2.ReactNode;
15
- mountNode?: HTMLDivElement | null;
16
- }
17
-
18
- // @public (undocumented)
19
- export interface PortalState extends PortalProps {
20
- shouldRender: boolean;
21
- }
22
-
23
- // @public
24
- export const renderPortal: (state: PortalState) => React_2.ReactPortal | null;
25
-
26
- // @public
27
- export const usePortal: (props: PortalProps, defaultProps?: PortalProps | undefined) => PortalState;
28
-
29
-
30
- // (No @packageDocumentation comment for this package)
31
-
32
- ```
package/just.config.ts DELETED
@@ -1,3 +0,0 @@
1
- import { preset } from '@fluentui/scripts';
2
-
3
- preset();
@@ -1 +0,0 @@
1
- export * from './components/Portal/index';
package/lib-amd/Portal.js DELETED
@@ -1,6 +0,0 @@
1
- define(["require", "exports", "tslib", "./components/Portal/index"], function (require, exports, tslib_1, index_1) {
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- tslib_1.__exportStar(index_1, exports);
5
- });
6
- //# sourceMappingURL=Portal.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Portal.js","sourceRoot":"../src/","sources":["Portal.ts"],"names":[],"mappings":";;;IAAA,uCAA0C","sourcesContent":["export * from './components/Portal/index';\n"]}