Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ Notes: web developers are advised to use [`~` (tilde range)](https://github.com/
- The `position` property takes precedence over existing sequence ID
- Unified build info and injection of `<meta>` tag, in PR [#5571](https://github.com/microsoft/BotFramework-WebChat/pull/5571), by [@compulim](https://github.com/compulim)
- Added documentation for `isPartOf` property, in PR [#5573](https://github.com/microsoft/BotFramework-WebChat/pull/5573), by [@compulim](https://github.com/compulim)
- `fluent-theme`: Changed dependencies to import solely from the "bundle" package, in PR [#5584](https://github.com/microsoft/BotFramework-WebChat/pull/5584), by [@compulim](https://github.com/compulim)

### Changed

Expand Down
7 changes: 6 additions & 1 deletion jest.legacy.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,12 @@ const TRANSFORM_IGNORE_PACKAGES = [
'micromark',
'mime',
'unist-util-stringify-position',
'uuid'
'uuid',

// Related to Adaptive Cards.
'dom7',
'ssr-window',
'swiper'
];

module.exports = {
Expand Down
5,347 changes: 845 additions & 4,502 deletions package-lock.json

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions packages/bundle/internal.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// This is required for Webpack 4 which does not support named exports.
// eslint-disable-next-line no-undef
module.exports = require('./dist/botframework-webchat.internal.js');
10 changes: 10 additions & 0 deletions packages/bundle/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,16 @@
"default": "./dist/botframework-webchat.js"
}
},
"./internal": {
"import": {
"types": "./dist/botframework-webchat.internal.d.mts",
"default": "./dist/botframework-webchat.internal.mjs"
},
"require": {
"types": "./dist/botframework-webchat.internal.d.ts",
"default": "./dist/botframework-webchat.internal.js"
}
},
"./middleware": {
"import": {
"types": "./dist/botframework-webchat.middleware.d.mts",
Expand Down
11 changes: 11 additions & 0 deletions packages/bundle/src/boot/exports/internal.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// We should review exports in this file to make sure 1P = 3P.
Comment thread
compulim marked this conversation as resolved.
export { type ActivityMiddleware, type TypingIndicatorMiddleware } from 'botframework-webchat-api';
export {
createActivityBorderMiddleware,
createActivityGroupingMiddleware,
DecoratorComposer,
type DecoratorMiddleware
} from 'botframework-webchat-api/decorator';
export { WebChatDecorator } from 'botframework-webchat-component/decorator';
export { createIconComponent, PartGrouping, useLiveRegion } from 'botframework-webchat-component/internal';
export { getOrgSchemaMessage, type DirectLineCardAction, type WebChatActivity } from 'botframework-webchat-core';
6 changes: 3 additions & 3 deletions packages/bundle/tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ const commonConfig = applyConfig(config => ({
entry: {
'botframework-webchat': './src/boot/exports/full.ts',
'botframework-webchat.es5': './src/boot/exports/full-es5.ts',
'botframework-webchat.internal': './src/boot/exports/internal.ts',
'botframework-webchat.middleware': './src/boot/exports/middleware.ts',
'botframework-webchat.minimal': './src/boot/exports/minimal.ts'
},
Expand All @@ -43,8 +44,7 @@ const commonConfig = applyConfig(config => ({
SPEECH_CONDUCT_OCSP_CHECK: '',
SPEECH_OCSP_CACHE_ROOT: ''
},
// Intentionally overriding existing esbuild plugins.
esbuildPlugins: [resolveCognitiveServicesToES2015],
esbuildPlugins: [...(config.esbuildPlugins ?? []), resolveCognitiveServicesToES2015],
noExternal: [
...(config.noExternal ?? []),
'@babel/runtime',
Expand Down Expand Up @@ -75,7 +75,7 @@ export default defineConfig([
'webchat-es5': './src/boot/bundle/full-es5.ts',
'webchat-minimal': './src/boot/bundle/minimal.ts'
},
esbuildPlugins: [...commonConfig.esbuildPlugins, resolveReact],
esbuildPlugins: [...(commonConfig.esbuildPlugins ?? []), resolveReact],
format: 'iife',
outExtension() {
return { js: '.js' };
Expand Down
4 changes: 3 additions & 1 deletion packages/component/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@
],
"homepage": "https://github.com/microsoft/BotFramework-WebChat/tree/main/packages/component#readme",
"scripts": {
"build": "tsup",
"build": "npm run build:tsup && npm run build:validate",
"build:tsup": "tsup",
"build:validate": "grep -L '.webchat .w' dist/*.css 2>/dev/null || { echo \"Error: dist/*.css is not compiled by Lightning CSS\" >&2; exit 1; }",
"bump": "npm run bump:prod && npm run bump:dev && (npm audit fix || exit 0)",
"bump:dev": "PACKAGES_TO_BUMP=$(cat package.json | jq -r '(.pinDependencies // {}) as $P | (.localDependencies // {} | keys) as $L | (.devDependencies // {}) | to_entries | map(select(.key as $K | $L | contains([$K]) | not)) | map(.key + \"@\" + ($P[.key] // [\"latest\"])[0]) | join(\" \")') && [ ! -z \"$PACKAGES_TO_BUMP\" ] && npm install $PACKAGES_TO_BUMP || true",
"bump:prod": "PACKAGES_TO_BUMP=$(cat package.json | jq -r '(.pinDependencies // {}) as $P | (.localDependencies // {} | keys) as $L | (.dependencies // {}) | to_entries | map(select(.key as $K | $L | contains([$K]) | not)) | map(.key + \"@\" + ($P[.key] // [\"latest\"])[0]) | join(\" \")') && [ ! -z \"$PACKAGES_TO_BUMP\" ] && npm install --save-exact $PACKAGES_TO_BUMP || true",
Expand Down
3 changes: 1 addition & 2 deletions packages/directlinespeech/tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ const config = applyConfig(config => ({
SPEECH_CONDUCT_OCSP_CHECK: '',
SPEECH_OCSP_CACHE_ROOT: ''
},
// Intentionally overriding existing esbuild plugins.
esbuildPlugins: [resolveCognitiveServicesToES2015],
esbuildPlugins: [...(config.esbuildPlugins ?? []), resolveCognitiveServicesToES2015],
// We need to internalize event-target-shim because it appear as transient packages with a different version.
noExternal: [...(config.noExternal ?? []), 'event-target-shim']
}));
Expand Down
16 changes: 5 additions & 11 deletions packages/fluent-theme/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@
"src/**/*"
],
"scripts": {
"build": "tsup",
"build": "npm run build:tsup && npm run build:validate",
"build:tsup": "tsup",
"build:validate": "grep -L '.webchat-fluent .w' dist/*.css 2>/dev/null || { echo \"Error: dist/*.css is not compiled by Lightning CSS\" >&2; exit 1; }",
"bump": "npm run bump:prod && npm run bump:dev && (npm audit fix || exit 0)",
"bump:dev": "PACKAGES_TO_BUMP=$(cat package.json | jq -r '(.pinDependencies // {}) as $P | (.localDependencies // {} | keys) as $L | (.devDependencies // {}) | to_entries | map(select(.key as $K | $L | contains([$K]) | not)) | map(.key + \"@\" + ($P[.key] // [\"latest\"])[0]) | join(\" \")') && [ ! -z \"$PACKAGES_TO_BUMP\" ] && npm install $PACKAGES_TO_BUMP || true",
"bump:prod": "PACKAGES_TO_BUMP=$(cat package.json | jq -r '(.pinDependencies // {}) as $P | (.localDependencies // {} | keys) as $L | (.dependencies // {}) | to_entries | map(select(.key as $K | $L | contains([$K]) | not)) | map(.key + \"@\" + ($P[.key] // [\"latest\"])[0]) | join(\" \")') && [ ! -z \"$PACKAGES_TO_BUMP\" ] && npm install --save-exact $PACKAGES_TO_BUMP || true",
Expand All @@ -51,12 +53,8 @@
"start": "npm run build -- --watch"
},
"localDependencies": {
"@msinternal/botframework-webchat-base": "development",
"@msinternal/botframework-webchat-styles": "development",
"@msinternal/botframework-webchat-tsconfig": "development",
"botframework-webchat-api": "production",
"botframework-webchat-component": "production",
"botframework-webchat-core": "production"
"botframework-webchat": "production"
},
"pinDependencies": {
"@types/react": [
Expand All @@ -69,8 +67,6 @@
]
},
"devDependencies": {
"@msinternal/botframework-webchat-base": "0.0.0-0",
"@msinternal/botframework-webchat-styles": "0.0.0-0",
"@msinternal/botframework-webchat-tsconfig": "^0.0.0-0",
"@types/math-random": "^1.0.2",
"@types/node": "^24.1.0",
Expand All @@ -79,9 +75,7 @@
"typescript": "~5.8.3"
},
"dependencies": {
"botframework-webchat-api": "0.0.0-0",
"botframework-webchat-component": "0.0.0-0",
"botframework-webchat-core": "0.0.0-0",
"botframework-webchat": "0.0.0-0",
"classnames": "2.5.1",
"inject-meta-tag": "0.0.1",
"math-random": "2.0.1",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { reactNode, validateProps } from '@msinternal/botframework-webchat-react-valibot';
import { WebChatActivity } from 'botframework-webchat-component';
import { type WebChatActivity } from 'botframework-webchat/internal';
import cx from 'classnames';
import React, { ReactNode, memo } from 'react';
import { object, optional, pipe, readonly, type InferInput } from 'valibot';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import { validateProps } from '@msinternal/botframework-webchat-react-valibot';
import { WebChatActivity, hooks } from 'botframework-webchat-component';
import { hooks } from 'botframework-webchat';
import { type WebChatActivity } from 'botframework-webchat/internal';
import cx from 'classnames';
import React, { memo, useMemo, type CSSProperties } from 'react';
import { custom, object, optional, pipe, readonly, safeParse, string, type InferInput } from 'valibot';

import { useStyles } from '../../styles';
import styles from './CopilotMessageHeader.module.css';
import isAIGeneratedActivity from './private/isAIGeneratedActivity';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { reactNode, validateProps } from '@msinternal/botframework-webchat-react-valibot';
import { PartGrouping } from 'botframework-webchat-component/internal';
import { getOrgSchemaMessage, type WebChatActivity } from 'botframework-webchat-core';
import { getOrgSchemaMessage, PartGrouping, type WebChatActivity } from 'botframework-webchat/internal';
import cx from 'classnames';
import React, { memo, useMemo, type ReactNode } from 'react';
import { array, custom, object, optional, pipe, readonly, safeParse } from 'valibot';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { getOrgSchemaMessage, type WebChatActivity } from 'botframework-webchat-core';
import { getOrgSchemaMessage, type WebChatActivity } from 'botframework-webchat/internal';

export default function isAIGeneratedActivity(activity: undefined | WebChatActivity) {
return !!(activity && getOrgSchemaMessage(activity?.entities || [])?.keywords?.includes('AIGeneratedContent'));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { getOrgSchemaMessage, type WebChatActivity } from 'botframework-webchat/internal';
import { useMemo } from 'react';
import { getOrgSchemaMessage, type WebChatActivity } from 'botframework-webchat-core';

export default function useActivityAuthor(activity?: WebChatActivity | undefined) {
return useMemo(() => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { type StrictStyleOptions, hooks } from 'botframework-webchat';
import { type WebChatActivity } from 'botframework-webchat/internal';
import { useMemo } from 'react';
import { hooks, type WebChatActivity } from 'botframework-webchat-component';
import { type StrictStyleOptions } from 'botframework-webchat-api';

const { useStyleOptions } = hooks;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
import { type ContextOf } from 'botframework-webchat-api';
import React, { memo, useEffect, useMemo, type ReactNode } from 'react';

import { type AssetName } from './AssetName';
import Context from './private/Context';

type ContextType = ContextOf<typeof Context>;
import Context, { type ContextType } from './private/Context';

type AssetComposerProps = Readonly<{
children?: ReactNode | undefined;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { hooks } from 'botframework-webchat-component';
import { hooks } from 'botframework-webchat';
import React, { memo, useCallback, useEffect, useRef } from 'react';
import { useRefFrom } from 'use-ref-from';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ const Context = createContext<ContextType>(Object.create({}, defaultContextValue
Context.displayName = 'AssetComposerContext';

export default Context;
export { type ContextType };
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { type ContextOf } from 'botframework-webchat-api';
import { useContext as useReactContext } from 'react';

import Context from './Context';
import Context, { ContextType } from './Context';

export default function useContext(): ContextOf<typeof Context> {
export default function useContext(): ContextType {
return useReactContext(Context);
}
10 changes: 5 additions & 5 deletions packages/fluent-theme/src/components/dropZone/DropZone.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
import { hooks } from 'botframework-webchat-component';
import { hooks } from 'botframework-webchat';
import cx from 'classnames';
import React, {
memo,
useCallback,
useEffect,
useRef,
useState,
type DragEvent as ReactDragEvent,
type DragEventHandler
type DragEventHandler,
type DragEvent as ReactDragEvent
} from 'react';
import { useRefFrom } from 'use-ref-from';

import { FluentIcon } from '../icon';
import { useStyles } from '../../styles';
import testIds from '../../testIds';
import { FluentIcon } from '../icon';
import styles from './DropZone.module.css';
import { useStyles } from '../../styles';

const { useLocalizer } = hooks;

Expand Down
2 changes: 1 addition & 1 deletion packages/fluent-theme/src/components/icon/FluentIcon.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { createIconComponent } from 'botframework-webchat-component/internal';
import { validateProps } from '@msinternal/botframework-webchat-react-valibot';
import { useStyles } from '@msinternal/botframework-webchat-styles/react';
import { createIconComponent } from 'botframework-webchat/internal';
import cx from 'classnames';
import React, { memo, useMemo, type CSSProperties } from 'react';
import { object, optional, pipe, readonly, string, type InferInput } from 'valibot';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { type WebChatActivity } from 'botframework-webchat-core';
import { type WebChatActivity } from 'botframework-webchat/internal';
import React, { memo } from 'react';

import { useStyles } from '../../../styles/index.js';
import styles from './LinerMessageActivity.module.css';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type WebChatActivity } from 'botframework-webchat-core';
import { type WebChatActivity } from 'botframework-webchat/internal';

export default function isLinerMessageActivity(
activity: undefined | WebChatActivity
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { hooks } from 'botframework-webchat-component';
import { type WebChatActivity } from 'botframework-webchat-core';
import { hooks } from 'botframework-webchat';
import { type WebChatActivity } from 'botframework-webchat/internal';
import cx from 'classnames';
import React, { memo, useMemo } from 'react';

import { useStyles } from '../../styles/index.js';
import { useActivityAuthor } from '../activity/index.js';
import styles from './PreChatMessageActivity.module.css';
import StarterPromptsToolbar from './StarterPromptsToolbar.js';
import { useActivityAuthor } from '../activity/index.js';

type Props = Readonly<{ activity: WebChatActivity & { type: 'message' } }>;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { hooks } from 'botframework-webchat-component';
import { type DirectLineCardAction } from 'botframework-webchat-core';
import { hooks } from 'botframework-webchat';
import { type DirectLineCardAction } from 'botframework-webchat/internal';
import cx from 'classnames';
import React, { memo, useCallback, useMemo } from 'react';
import { useRefFrom } from 'use-ref-from';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { hooks } from 'botframework-webchat-api';
import { type DirectLineCardAction } from 'botframework-webchat-core';
import { hooks } from 'botframework-webchat';
import { type DirectLineCardAction } from 'botframework-webchat/internal';
import cx from 'classnames';
import React, { memo } from 'react';

import { useStyles } from '../../styles/index.js';
import StarterPromptsCardAction from './StarterPromptsCardAction.js';
import styles from './StarterPromptsToolbar.module.css';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { getOrgSchemaMessage, type WebChatActivity } from 'botframework-webchat-core';
import { getOrgSchemaMessage, type WebChatActivity } from 'botframework-webchat/internal';

export default function isPreChatMessageActivity(
activity: undefined | WebChatActivity
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { hooks } from 'botframework-webchat-component';
import React, { useCallback, useRef, type ChangeEventHandler, memo } from 'react';
import { hooks } from 'botframework-webchat';
import React, { memo, useCallback, useRef, type ChangeEventHandler } from 'react';
import { useRefFrom } from 'use-ref-from';

import { FluentIcon } from '../icon';
import { useStyles } from '../../styles';
import testIds from '../../testIds';
import { ToolbarButton } from './Toolbar';
import { FluentIcon } from '../icon';
import styles from './AddAttachmentButton.module.css';
import { useStyles } from '../../styles';
import { ToolbarButton } from './Toolbar';

const { useLocalizer, useStyleOptions } = hooks;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { useLiveRegion } from 'botframework-webchat-component/internal';
import { useLiveRegion } from 'botframework-webchat/internal';
import React, { memo } from 'react';

import { useStyles } from '../../styles';
import styles from './ErrorMessage.module.css';

Expand Down
6 changes: 3 additions & 3 deletions packages/fluent-theme/src/components/sendBox/SendBox.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { hooks, Components, type SendBoxFocusOptions } from 'botframework-webchat-component';
import { Components, hooks } from 'botframework-webchat';
import cx from 'classnames';
import React, {
memo,
Expand All @@ -11,10 +11,10 @@ import React, {
} from 'react';
import { useRefFrom } from 'use-ref-from';

import { FluentIcon } from '../icon';
import { useStyles, useVariantClassName } from '../../styles';
import testIds from '../../testIds';
import { DropZone } from '../dropZone';
import { FluentIcon } from '../icon';
import { SuggestedActions } from '../suggestedActions';
import { TelephoneKeypadSurrogate, useTelephoneKeypadShown, type DTMF } from '../telephoneKeypad';
import AddAttachmentButton from './AddAttachmentButton';
Expand Down Expand Up @@ -75,7 +75,7 @@ function SendBox(props: Props) {

useRegisterFocusSendBox(
useCallback(
({ noKeyboard, waitUntil }: SendBoxFocusOptions) => {
({ noKeyboard, waitUntil }) => {
if (!inputRef.current) {
return;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { hooks } from 'botframework-webchat';
import React, { memo, useCallback } from 'react';

import { hooks } from 'botframework-webchat-component';
import { FluentIcon } from '../icon';
import testIds from '../../testIds';
import { FluentIcon } from '../icon';
import { useTelephoneKeypadShown } from '../telephoneKeypad';
import { ToolbarButton } from './Toolbar';

Expand Down
3 changes: 2 additions & 1 deletion packages/fluent-theme/src/components/sendBox/Toolbar.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { hooks } from 'botframework-webchat-api';
import { hooks } from 'botframework-webchat';
import cx from 'classnames';
import React, { memo, type MouseEventHandler, type ReactNode } from 'react';

import { useStyles } from '../../styles';
import styles from './Toolbar.module.css';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { hooks } from 'botframework-webchat-component';
import { hooks } from 'botframework-webchat';
import { useCallback, useMemo, useState } from 'react';
import { useRefFrom } from 'use-ref-from';

Expand Down
Loading
Loading