Skip to content

Commit

Permalink
Remove public API usage of ComponentSlotStyle and redefine type inter…
Browse files Browse the repository at this point in the history
…nally (#2996)
  • Loading branch information
JamesBurnside authored Apr 28, 2023
1 parent 4cc7fdc commit f3d7805
Show file tree
Hide file tree
Showing 15 changed files with 51 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "minor",
"comment": "Remove public API usage of ComponentSlotStyle and redefine type internally",
"packageName": "@azure/communication-react",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "minor",
"comment": "Remove public API usage of ComponentSlotStyle and redefine type internally",
"packageName": "@azure/communication-react",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ import { CommunicationIdentifierKind } from '@azure/communication-common';
import { CommunicationTokenCredential } from '@azure/communication-common';
import { CommunicationUserIdentifier } from '@azure/communication-common';
import { CommunicationUserKind } from '@azure/communication-common';
import { ComponentSlotStyle } from '@fluentui/react-northstar';
import { CreateViewOptions } from '@azure/communication-calling';
import { DeviceAccess } from '@azure/communication-calling';
import { DeviceManager } from '@azure/communication-calling';
Expand All @@ -50,6 +49,7 @@ import { IMessageBarProps } from '@fluentui/react';
import { IncomingCall } from '@azure/communication-calling';
import { IPersonaStyleProps } from '@fluentui/react';
import { IPersonaStyles } from '@fluentui/react';
import { IRawStyle } from '@fluentui/react';
import { IRenderFunction } from '@fluentui/react';
import { IStyle } from '@fluentui/react';
import { IStyleFunctionOrObject } from '@fluentui/react';
Expand Down Expand Up @@ -1765,6 +1765,9 @@ export interface ComponentLocale {
// @public
export type ComponentProps<Component extends (props: any) => JSX.Element> = ChatReturnProps<Component> extends never ? CallingReturnProps<Component> extends never ? undefined : CallingReturnProps<Component> : ChatReturnProps<Component>;

// @public
export type ComponentSlotStyle = Omit<IRawStyle, 'animation'>;

// @public
export interface ComponentStrings {
BrowserPermissionDenied: BrowserPermissionDeniedStrings;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import { CommunicationIdentifierKind } from '@azure/communication-common';
import { CommunicationTokenCredential } from '@azure/communication-common';
import { CommunicationUserIdentifier } from '@azure/communication-common';
import { CommunicationUserKind } from '@azure/communication-common';
import { ComponentSlotStyle } from '@fluentui/react-northstar';
import { CreateViewOptions } from '@azure/communication-calling';
import { DeviceAccess } from '@azure/communication-calling';
import { DeviceManager } from '@azure/communication-calling';
Expand All @@ -40,6 +39,7 @@ import { IContextualMenuStyles } from '@fluentui/react';
import { IMessageBarProps } from '@fluentui/react';
import { IPersonaStyleProps } from '@fluentui/react';
import { IPersonaStyles } from '@fluentui/react';
import { IRawStyle } from '@fluentui/react';
import { IRenderFunction } from '@fluentui/react';
import { IStyle } from '@fluentui/react';
import { IStyleFunctionOrObject } from '@fluentui/react';
Expand Down Expand Up @@ -1204,6 +1204,9 @@ export interface ComponentLocale {
// @public
export type ComponentProps<Component extends (props: any) => JSX.Element> = ChatReturnProps<Component> extends never ? CallingReturnProps<Component> extends never ? undefined : CallingReturnProps<Component> : ChatReturnProps<Component>;

// @public
export type ComponentSlotStyle = Omit<IRawStyle, 'animation'>;

// @public
export interface ComponentStrings {
cameraButton: CameraButtonStrings;
Expand Down
1 change: 1 addition & 0 deletions packages/communication-react/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ export type {
ChatMessage,
CommunicationParticipant,
ComponentLocale,
ComponentSlotStyle,
ComponentStrings,
ContentSystemMessage,
ControlBarButtonProps,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

/// <reference types="react" />

import { ComponentSlotStyle } from '@fluentui/react-northstar';
import { IButtonProps } from '@fluentui/react';
import { IButtonStyles } from '@fluentui/react';
import { IContextualMenuItem } from '@fluentui/react';
Expand All @@ -21,6 +20,7 @@ import { IMessageBarProps } from '@fluentui/react';
import { IModalProps } from '@fluentui/react';
import { IPersonaStyleProps } from '@fluentui/react';
import { IPersonaStyles } from '@fluentui/react';
import { IRawStyle } from '@fluentui/react';
import { IRenderFunction } from '@fluentui/react';
import { IStyle } from '@fluentui/react';
import { IStyleFunctionOrObject } from '@fluentui/react';
Expand Down Expand Up @@ -585,6 +585,9 @@ export interface ComponentLocale {
strings: ComponentStrings;
}

// @public
export type ComponentSlotStyle = Omit<IRawStyle, 'animation'>;

// @public
export interface ComponentStrings {
BrowserPermissionDenied: BrowserPermissionDeniedStrings;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

/// <reference types="react" />

import { ComponentSlotStyle } from '@fluentui/react-northstar';
import { IButtonProps } from '@fluentui/react';
import { IButtonStyles } from '@fluentui/react';
import { IContextualMenuItem } from '@fluentui/react';
Expand All @@ -19,6 +18,7 @@ import { IMessageBarProps } from '@fluentui/react';
import { IModalProps } from '@fluentui/react';
import { IPersonaStyleProps } from '@fluentui/react';
import { IPersonaStyles } from '@fluentui/react';
import { IRawStyle } from '@fluentui/react';
import { IRenderFunction } from '@fluentui/react';
import { IStyle } from '@fluentui/react';
import { IStyleFunctionOrObject } from '@fluentui/react';
Expand Down Expand Up @@ -254,6 +254,9 @@ export interface ComponentLocale {
strings: ComponentStrings;
}

// @public
export type ComponentSlotStyle = Omit<IRawStyle, 'animation'>;

// @public
export interface ComponentStrings {
cameraButton: CameraButtonStrings;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.

import { ComponentSlotStyle } from '@fluentui/react-northstar';
import { _formatString } from '@internal/acs-ui-common';
import React, { useCallback, useState } from 'react';
import { ChatMessageComponentAsEditBox } from './ChatMessageComponentAsEditBox';
Expand All @@ -13,6 +12,7 @@ import { ChatMessageComponentAsMessageBubble } from './ChatMessageComponentAsMes
import { FileDownloadHandler, FileMetadata } from '../FileDownloadCards';
/* @conditional-compile-remove(at-mention) */
import { AtMentionDisplayOptions } from '../AtMentionFlyout';
import { ComponentSlotStyle } from '../../types/ComponentSlotStyle';

type ChatMessageComponentProps = {
message: ChatMessage | /* @conditional-compile-remove(data-loss-prevention) */ BlockedMessage;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Licensed under the MIT license.

import { IStyle, mergeStyles } from '@fluentui/react';
import { Chat, Text, ComponentSlotStyle } from '@fluentui/react-northstar';
import { Chat, Text } from '@fluentui/react-northstar';
import { _formatString } from '@internal/acs-ui-common';
import React, { useCallback, useRef, useState } from 'react';
import {
Expand All @@ -29,6 +29,7 @@ import { _FileDownloadCards, FileDownloadHandler } from '../FileDownloadCards';
import { ComponentLocale, useLocale } from '../../localization';
/* @conditional-compile-remove(at-mention) */
import { AtMentionDisplayOptions } from '../AtMentionFlyout';
import { ComponentSlotStyle } from '../../types/ComponentSlotStyle';

type ChatMessageComponentAsMessageBubbleProps = {
message: ChatMessage | /* @conditional-compile-remove(data-loss-prevention) */ BlockedMessage;
Expand Down
2 changes: 1 addition & 1 deletion packages/react-components/src/components/MessageThread.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ import {
IPersona,
Theme
} from '@fluentui/react';
import { ComponentSlotStyle } from '@fluentui/react-northstar';
import { LiveAnnouncer } from 'react-aria-live';
import { delay } from './utils/delay';
import {
Expand Down Expand Up @@ -72,6 +71,7 @@ import { AttachmentDownloadResult } from './FileDownloadCards';
import { useTheme } from '../theming';
/* @conditional-compile-remove(at-mention) */
import { AtMentionOptions } from './AtMentionFlyout';
import { ComponentSlotStyle } from '../types/ComponentSlotStyle';

const isMessageSame = (first: ChatMessage, second: ChatMessage): boolean => {
return (
Expand Down
2 changes: 1 addition & 1 deletion packages/react-components/src/components/SystemMessage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
// Licensed under the MIT license.

import { IStyle, FontIcon, mergeStyles, Stack, Text } from '@fluentui/react';
import { ComponentSlotStyle } from '@fluentui/react-northstar';
import React from 'react';
import { systemMessageIconStyle } from './styles/SystemMessage.styles';
import { ComponentSlotStyle } from '../types/ComponentSlotStyle';

/**
* Todo: We need to add more types of system messages that we support.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
// Licensed under the MIT license.

import { IButtonStyles, mergeStyles, Theme } from '@fluentui/react';
import { ComponentSlotStyle } from '@fluentui/react-northstar';
import { CSSProperties } from 'react';
import { MESSAGE_STATUS_INDICATOR_SIZE_REM } from './MessageStatusIndicator.styles';
import { ComponentSlotStyle } from '../../types/ComponentSlotStyle';

// Minimum chat bubble width. This matches the minimum chat bubble width from FluentUI
// that can contain a message and a timestamp.
Expand Down
1 change: 1 addition & 0 deletions packages/react-components/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export type {
CallParticipantListParticipant,
ChatMessage,
CommunicationParticipant,
ComponentSlotStyle,
ContentSystemMessage,
CreateVideoStreamViewResult,
CustomAvatarOptions,
Expand Down
12 changes: 12 additions & 0 deletions packages/react-components/src/types/ComponentSlotStyle.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.

import { IRawStyle } from '@fluentui/react';

/**
* ComponentSlotStyle is a \@fluentui/react-northstar type.
* As we have moved away from this package we have used the more generic IRawStyle type from fluent for interoperability.
*
* @public
*/
export type ComponentSlotStyle = Omit<IRawStyle, 'animation'>;
1 change: 1 addition & 0 deletions packages/react-components/src/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Licensed under the MIT license.

export * from './ChatMessage';
export * from './ComponentSlotStyle';
export * from './CustomStylesProps';
export * from './VideoGalleryParticipant';
export * from './CommunicationParticipant';
Expand Down

0 comments on commit f3d7805

Please sign in to comment.