Skip to content

Commit 61e59fc

Browse files
Add ability to have local-only stories, Add scaffolding for PiPiP component to demonstrate (#1354)
1 parent e22f9ec commit 61e59fc

12 files changed

Lines changed: 245 additions & 2 deletions

File tree

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "none",
3+
"comment": "Create scaffolding for PiPiP component",
4+
"packageName": "@internal/react-components",
5+
"email": "2684369+JamesBurnside@users.noreply.github.com",
6+
"dependentChangeType": "none"
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "none",
3+
"comment": "Add ability to have local-only stories",
4+
"packageName": "@internal/storybook",
5+
"email": "2684369+JamesBurnside@users.noreply.github.com",
6+
"dependentChangeType": "none"
7+
}

packages/communication-react/src/index.ts

Lines changed: 113 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,120 @@ export type {
8686
ErrorBarSelector as ChatErrorBarSelector
8787
} from '../../chat-component-bindings/src';
8888

89+
export {
90+
_IdentifierProvider,
91+
CameraButton,
92+
ControlBar,
93+
ControlBarButton,
94+
DevicesButton,
95+
EndCallButton,
96+
ErrorBar,
97+
GridLayout,
98+
LocalizationProvider,
99+
MessageStatusIndicator,
100+
MessageThread,
101+
MicrophoneButton,
102+
ParticipantItem,
103+
ParticipantList,
104+
ParticipantsButton,
105+
ScreenShareButton,
106+
SendBox,
107+
StreamMedia,
108+
TypingIndicator,
109+
VideoGallery,
110+
VideoTile
111+
} from '../../react-components/src';
112+
113+
export type {
114+
_IdentifierProviderProps,
115+
_Identifiers,
116+
ActiveErrorMessage,
117+
BaseCustomStyles,
118+
CallParticipantListParticipant,
119+
CameraButtonProps,
120+
CameraButtonStrings,
121+
ChatMessage,
122+
CommunicationParticipant,
123+
ComponentLocale,
124+
ComponentStrings,
125+
ContentSystemMessage,
126+
ControlBarButtonProps,
127+
ControlBarButtonStrings,
128+
ControlBarButtonStyles,
129+
ControlBarLayout,
130+
ControlBarProps,
131+
CustomAvatarOptions,
132+
CustomMessage,
133+
DevicesButtonContextualMenuStyles,
134+
DevicesButtonProps,
135+
DevicesButtonStrings,
136+
DevicesButtonStyles,
137+
EndCallButtonProps,
138+
EndCallButtonStrings,
139+
ErrorBarProps,
140+
ErrorBarStrings,
141+
ErrorType,
142+
GridLayoutProps,
143+
GridLayoutStyles,
144+
HorizontalGalleryStyles,
145+
JumpToNewMessageButtonProps,
146+
LocalizationProviderProps,
147+
Message,
148+
MessageAttachedStatus,
149+
MessageCommon,
150+
MessageContentType,
151+
MessageProps,
152+
MessageRenderer,
153+
MessageStatusIndicatorProps,
154+
MessageStatusIndicatorStrings,
155+
MessageThreadProps,
156+
MessageThreadStrings,
157+
MessageThreadStyles,
158+
MicrophoneButtonProps,
159+
MicrophoneButtonStrings,
160+
OnRenderAvatarCallback,
161+
OptionsDevice,
162+
ParticipantAddedSystemMessage,
163+
ParticipantItemProps,
164+
ParticipantItemStrings,
165+
ParticipantItemStyles,
166+
ParticipantListItemStyles,
167+
ParticipantListParticipant,
168+
ParticipantListProps,
169+
ParticipantListStyles,
170+
ParticipantMenuItemsCallback,
171+
ParticipantRemovedSystemMessage,
172+
ParticipantsButtonContextualMenuStyles,
173+
ParticipantsButtonProps,
174+
ParticipantsButtonStrings,
175+
ParticipantsButtonStyles,
176+
ScreenShareButtonProps,
177+
ScreenShareButtonStrings,
178+
SendBoxProps,
179+
SendBoxStrings,
180+
SendBoxStylesProps,
181+
StreamMediaProps,
182+
SystemMessage,
183+
SystemMessageCommon,
184+
TopicUpdatedSystemMessage,
185+
TypingIndicatorProps,
186+
TypingIndicatorStrings,
187+
TypingIndicatorStylesProps,
188+
VideoGalleryLocalParticipant,
189+
VideoGalleryParticipant,
190+
VideoGalleryProps,
191+
VideoGalleryRemoteParticipant,
192+
VideoGalleryStream,
193+
VideoGalleryStrings,
194+
VideoGalleryStyles,
195+
VideoStreamOptions,
196+
VideoTileProps,
197+
VideoTileStylesProps
198+
} from '../../react-components/src';
199+
export * from '../../react-components/src/localization/locales';
200+
export * from '../../react-components/src/theming';
201+
89202
export * from '../../calling-stateful-client/src';
90203
export * from '../../chat-stateful-client/src';
91-
export * from '../../react-components/src';
92204
export * from '../../react-composites/src';
93205
export * from './mergedHooks';

packages/react-components/review/react-components.api.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -723,6 +723,14 @@ export interface ParticipantsButtonStyles extends ControlBarButtonStyles {
723723
menuStyles?: Partial<ParticipantsButtonContextualMenuStyles>;
724724
}
725725

726+
// @internal
727+
export const _PictureInPictureInPicture: (props: _PictureInPictureInPictureProps) => JSX.Element;
728+
729+
// @internal
730+
export interface _PictureInPictureInPictureProps {
731+
onClick?: () => void;
732+
}
733+
726734
// @public
727735
export const ScreenShareButton: (props: ScreenShareButtonProps) => JSX.Element;
728736

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// Copyright (c) Microsoft Corporation.
2+
// Licensed under the MIT license.
3+
4+
import React from 'react';
5+
6+
/**
7+
* Props for {@link _PictureInPictureInPicture} component.
8+
*
9+
* @internal
10+
*/
11+
export interface _PictureInPictureInPictureProps {
12+
/**
13+
* Callback when the {@link _PictureInPictureInPicture} is clicked.
14+
*/
15+
onClick?: () => void;
16+
}
17+
18+
/* eslint-disable @typescript-eslint/no-unused-vars */ // REMOVE WHEN PROPS USED (BELOW)
19+
/**
20+
* Component that displays a video feed for use as a Picture-in-Picture style component.
21+
* It contains a secondary video feed resulting in an inner Picture-in-Picture style feed.
22+
*
23+
* @remarks
24+
* The double nature of the Picture-in-Picture styles is where this component gets its name; Picture-in-Picture-in-Picture.
25+
*
26+
* @internal
27+
*/
28+
export const _PictureInPictureInPicture = (props: _PictureInPictureInPictureProps): JSX.Element => {
29+
return <></>;
30+
};

packages/react-components/src/components/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,3 +81,6 @@ export type { ScreenShareButtonProps, ScreenShareButtonStrings } from './ScreenS
8181

8282
export { VideoTile } from './VideoTile';
8383
export type { VideoTileProps, VideoTileStylesProps } from './VideoTile';
84+
85+
export { _PictureInPictureInPicture } from './PictureInPictureInPicture/PictureInPictureInPicture';
86+
export type { _PictureInPictureInPictureProps } from './PictureInPictureInPicture/PictureInPictureInPicture';

packages/react-components/stable-review/react-components.api.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -723,6 +723,14 @@ export interface ParticipantsButtonStyles extends ControlBarButtonStyles {
723723
menuStyles?: Partial<ParticipantsButtonContextualMenuStyles>;
724724
}
725725

726+
// @internal
727+
export const _PictureInPictureInPicture: (props: _PictureInPictureInPictureProps) => JSX.Element;
728+
729+
// @internal
730+
export interface _PictureInPictureInPictureProps {
731+
onClick?: () => void;
732+
}
733+
726734
// @public
727735
export const ScreenShareButton: (props: ScreenShareButtonProps) => JSX.Element;
728736

packages/storybook/.eslintrc.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,12 @@ module.exports = {
104104
rules: {
105105
'header/header': 'off'
106106
}
107+
},
108+
{
109+
files: 'stories/INTERNAL/**/*',
110+
rules: {
111+
'no-restricted-imports': 'off'
112+
}
107113
}
108114
]
109115
};

packages/storybook/.storybook/main.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,12 @@
44
const path = require('path');
55
const webpack = require('webpack4');
66

7+
const PRODUCTION_BUILD = !!process.env.PRODUCTION;
8+
79
module.exports = {
8-
stories: ['../stories/**/*.stories.mdx', '../stories/**/*.stories.@(ts|tsx)'],
10+
// Include all stories that have .ts, .tsx or .mdx extensions. When in production do not
11+
// include the INTERNAL/ folder.
12+
stories: [`../stories/${PRODUCTION_BUILD ? '!(INTERNAL)/' : ''}**/*.stories.@(ts|tsx|mdx)`],
913
// Speeds up webpack build time after every code change. Improvements of up
1014
// to 4-5 seconds can be seen. Comment if components don't render properly.
1115
typescript: { reactDocgen: 'react-docgen' },
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// Copyright (c) Microsoft Corporation.
2+
// Licensed under the MIT license.
3+
4+
import { _PictureInPictureInPicture as PictureInPictureInPictureComponent } from '@internal/react-components';
5+
import { Meta } from '@storybook/react/types-6-0';
6+
import React from 'react';
7+
8+
import { COMPONENT_FOLDER_PREFIX } from '../../constants';
9+
import { hiddenControl } from '../../controlsUtils';
10+
11+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
12+
const PictureInPictureInPictureStory = (args): JSX.Element => {
13+
return <PictureInPictureInPictureComponent />;
14+
};
15+
16+
// This must be the only named export from this module, and must be named to match the storybook path suffix.
17+
// This ensures that storybook hoists the story instead of creating a folder with a single entry.
18+
export const PictureInPictureInPicture = PictureInPictureInPictureStory.bind({});
19+
20+
export default {
21+
id: `${COMPONENT_FOLDER_PREFIX}-internal-pictureinpictureinpicture`,
22+
title: `${COMPONENT_FOLDER_PREFIX}/Internal/Picture In Picture In Picture`,
23+
component: PictureInPictureInPictureComponent,
24+
argTypes: {
25+
// Hiding auto-generated controls
26+
onClick: hiddenControl
27+
}
28+
} as Meta;

0 commit comments

Comments
 (0)