Skip to content

Commit

Permalink
Export window provider from @fluentui/react package (#15738)
Browse files Browse the repository at this point in the history
* export react-window-provider from react package

* Change files

* update paths
  • Loading branch information
xugao authored Oct 28, 2020
1 parent 10e4128 commit 1b963c6
Show file tree
Hide file tree
Showing 12 changed files with 27 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"type": "prerelease",
"comment": "Export all from react-window-provider.",
"packageName": "@fluentui/react",
"email": "[email protected]",
"dependentChangeType": "patch",
"date": "2020-10-28T00:18:03.634Z"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"type": "prerelease",
"comment": "Export all from react-window-provider.",
"packageName": "@fluentui/react-internal",
"email": "[email protected]",
"dependentChangeType": "patch",
"date": "2020-10-28T00:17:50.703Z"
}
1 change: 1 addition & 0 deletions packages/react-internal/etc/react-internal.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -6776,6 +6776,7 @@ export const VerticalDivider: React.FunctionComponent<IVerticalDividerProps>;
export * from "@fluentui/font-icons-mdl2";
export * from "@fluentui/react-focus";
export * from "@fluentui/react-theme-provider";
export * from "@fluentui/react-window-provider";
export * from "@fluentui/style-utilities";
export * from "@fluentui/theme";
export * from "@fluentui/utilities";
Expand Down
2 changes: 2 additions & 0 deletions packages/react-internal/src/WindowProvider.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import './version';
export * from '@fluentui/react-window-provider';
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
} from '../../Utilities';
import { IFocusTrapZoneProps, IFocusTrapZone } from './FocusTrapZone.types';
import { useId, useConst, useMergedRefs } from '@fluentui/react-hooks';
import { useDocument } from '@fluentui/react-window-provider';
import { useDocument } from '../../WindowProvider';

interface IFocusTrapZoneInternalState {
disposeFocusHandler: (() => void) | undefined;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { ILayerProps, ILayerStyleProps, ILayerStyles } from './Layer.types';
import { classNamesFunction, setPortalAttribute, setVirtualParent } from '../../Utilities';
import { registerLayer, getDefaultTarget, unregisterLayer } from './Layer.notification';
import { useMergedRefs, useWarnings } from '@fluentui/react-hooks';
import { useDocument } from '@fluentui/react-window-provider';
import { useDocument } from '../../WindowProvider';

const getClassNames = classNamesFunction<ILayerStyleProps, ILayerStyles>();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as React from 'react';
import { Async, divProperties, getNativeProps } from '../../Utilities';
import { IResizeGroupProps, ResizeGroupDirection } from './ResizeGroup.types';
import { useConst, useMergedRefs, useAsync, useOnEvent, useWarnings } from '@fluentui/react-hooks';
import { useWindow } from '@fluentui/react-window-provider';
import { useWindow } from '../../WindowProvider';

const RESIZE_DELAY = 16;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { Stack } from '../../Stack';
import { FocusTrapZone } from '../../FocusTrapZone';
import { Image } from '../../Image';
import { useOnEvent, useMergedRefs } from '@fluentui/react-hooks';
import { useDocument } from '@fluentui/react-window-provider';
import { useDocument } from '../../WindowProvider';

const getClassNames = classNamesFunction<ITeachingBubbleStyleProps, ITeachingBubbleStyles>();

Expand Down
1 change: 1 addition & 0 deletions packages/react-internal/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,5 +69,6 @@ export * from './Theme';
export * from './ThemeGenerator';
export * from './Tooltip';
export * from './Utilities';
export * from './WindowProvider';

import './version';
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from 'react';
import { BaseDecorator } from './BaseDecorator';
import { getWindow, hoistStatics, EventGroup } from '../../Utilities';
import { WindowContext } from '@fluentui/react-window-provider';
import { WindowContext } from '../../WindowProvider';

export interface IWithResponsiveModeState {
responsiveMode?: ResponsiveMode;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as React from 'react';
import { getWindow } from '@fluentui/utilities';
import { useOnEvent } from '@fluentui/react-hooks';
import { ResponsiveMode, getResponsiveMode, getInitialResponsiveMode } from '../decorators/withResponsiveMode';
import { useWindow } from '@fluentui/react-window-provider';
import { useWindow } from '../../WindowProvider';

export const useResponsiveMode = (elementRef: React.RefObject<HTMLElement | null>) => {
const [lastResponsiveMode, setLastResponsiveMode] = React.useState<ResponsiveMode>(getInitialResponsiveMode);
Expand Down
1 change: 1 addition & 0 deletions packages/react/src/WindowProvider.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from '@fluentui/react-internal/lib/WindowProvider';

0 comments on commit 1b963c6

Please sign in to comment.