botframework-webchat-fluent-theme 4.18.1-main.20240924.f09c8c5 → 4.18.1-main.20240927.ea7a875

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. package/dist/botframework-webchat-fluent-theme.css.map +1 -1
  2. package/dist/botframework-webchat-fluent-theme.development.css.map +1 -1
  3. package/dist/botframework-webchat-fluent-theme.development.js +8 -8
  4. package/dist/botframework-webchat-fluent-theme.development.js.map +1 -1
  5. package/dist/botframework-webchat-fluent-theme.js +1 -1
  6. package/dist/botframework-webchat-fluent-theme.js.map +1 -1
  7. package/dist/botframework-webchat-fluent-theme.mjs +1 -1
  8. package/dist/botframework-webchat-fluent-theme.mjs.map +1 -1
  9. package/dist/botframework-webchat-fluent-theme.production.min.css.map +1 -1
  10. package/dist/botframework-webchat-fluent-theme.production.min.js +8 -8
  11. package/dist/botframework-webchat-fluent-theme.production.min.js.map +1 -1
  12. package/package.json +7 -5
  13. package/src/components/dropZone/DropZone.tsx +1 -1
  14. package/src/components/preChatActivity/PreChatMessageActivity.module.css +2 -0
  15. package/src/env.d.ts +1 -7
  16. package/src/external.umd/botframework-webchat-component/decorator.ts +1 -0
  17. package/src/index.ts +0 -3
  18. package/src/private/FluentThemeProvider.tsx +6 -3
  19. package/src/styles/createStyles.ts +5 -0
  20. package/src/styles/index.ts +2 -2
  21. package/src/styles/useStyles.ts +2 -19
  22. package/src/tsconfig.json +12 -10
  23. package/src/components/decorator/index.ts +0 -1
  24. package/src/components/decorator/private/BorderFlair.module.css +0 -552
  25. package/src/components/decorator/private/BorderFlair.tsx +0 -30
  26. package/src/components/decorator/private/BorderLoader.module.css +0 -49
  27. package/src/components/decorator/private/BorderLoader.tsx +0 -19
  28. package/src/components/decorator/private/Decorator.tsx +0 -20
  29. package/src/styles/injectStyle.ts +0 -9
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "botframework-webchat-fluent-theme",
3
- "version": "4.18.1-main.20240924.f09c8c5",
3
+ "version": "4.18.1-main.20240927.ea7a875",
4
4
  "description": "Fluent theme for Bot Framework Web Chat",
5
5
  "main": "./dist/botframework-webchat-fluent-theme.js",
6
6
  "types": "./dist/botframework-webchat-fluent-theme.d.ts",
@@ -53,7 +53,8 @@
53
53
  "localDependencies": {
54
54
  "botframework-webchat-api": "production",
55
55
  "botframework-webchat-component": "production",
56
- "botframework-webchat-core": "production"
56
+ "botframework-webchat-core": "production",
57
+ "botframework-webchat-styles": "production"
57
58
  },
58
59
  "pinDependencies": {
59
60
  "@types/react": [
@@ -70,9 +71,10 @@
70
71
  "typescript": "^5.4.5"
71
72
  },
72
73
  "dependencies": {
73
- "botframework-webchat-api": "4.18.1-main.20240924.f09c8c5",
74
- "botframework-webchat-component": "4.18.1-main.20240924.f09c8c5",
75
- "botframework-webchat-core": "4.18.1-main.20240924.f09c8c5",
74
+ "botframework-webchat-api": "4.18.1-main.20240927.ea7a875",
75
+ "botframework-webchat-component": "4.18.1-main.20240927.ea7a875",
76
+ "botframework-webchat-core": "4.18.1-main.20240927.ea7a875",
77
+ "botframework-webchat-styles": "4.18.1-main.20240927.ea7a875",
76
78
  "classnames": "2.5.1",
77
79
  "inject-meta-tag": "0.0.1",
78
80
  "math-random": "2.0.1",
@@ -17,7 +17,7 @@ const handleDragOver: DragEventHandler<HTMLDivElement> = event => {
17
17
 
18
18
  // Notes: For files dragging from outside of browser, it only tell us if it is a "File" instead of "text/plain" or "text/uri-list".
19
19
  // For images dragging inside of browser, it only tell us that it is "text/plain", "text/uri-list" and "text/html". But not "image/*".
20
- // So we cannot whitelist what is droppable.
20
+ // So we cannot allowlist what is droppable.
21
21
  // We are using case-insensitive of type "files" so we can drag in WebDriver.
22
22
  const isFilesTransferEvent = (event: DragEvent) =>
23
23
  !!event.dataTransfer?.types?.some(type => type.toLowerCase() === 'files');
@@ -42,11 +42,13 @@
42
42
  font-weight: var(--webchat-fontWeightSemibold);
43
43
  line-height: var(--webchat-lineHeightHero700);
44
44
  margin: 0;
45
+ overflow-wrap: anywhere;
45
46
  }
46
47
 
47
48
  :global(.webchat-fluent) .pre-chat-message-activity__body-subtitle {
48
49
  font-size: var(--webchat-fontSizeBase300);
49
50
  line-height: var(--webchat-lineHeightBase300);
51
+ overflow-wrap: anywhere;
50
52
  }
51
53
 
52
54
  :global(.webchat-fluent) .pre-chat-message-activity__toolbar {
package/src/env.d.ts CHANGED
@@ -1,7 +1 @@
1
- // CSS modules
2
- type CSSModuleClasses = { readonly [key: string]: any };
3
-
4
- declare module '*.module.css' {
5
- const classes: CSSModuleClasses;
6
- export default classes;
7
- }
1
+ /// <reference types="botframework-webchat-styles/env" />
@@ -0,0 +1 @@
1
+ module.exports = (globalThis as any).WebChat.decorator;
package/src/index.ts CHANGED
@@ -1,7 +1,6 @@
1
1
  import { injectMetaTag } from 'inject-meta-tag';
2
2
 
3
3
  import FluentThemeProvider from './private/FluentThemeProvider';
4
- import { injectStyle } from './styles';
5
4
  import testIds from './testIds';
6
5
 
7
6
  const buildTool = process.env['build_tool'];
@@ -15,6 +14,4 @@ injectMetaTag(
15
14
  `version=${process.env['npm_package_version']}; build-tool=${process.env['build_tool']}; module-format=${process.env['module_format']}`
16
15
  );
17
16
 
18
- injectStyle();
19
-
20
17
  export { FluentThemeProvider, buildInfo, testIds };
@@ -1,5 +1,6 @@
1
1
  import type { ActivityMiddleware } from 'botframework-webchat-api';
2
2
  import { Components } from 'botframework-webchat-component';
3
+ import { WebChatDecorator } from 'botframework-webchat-component/decorator';
3
4
  import React, { memo, type ReactNode } from 'react';
4
5
 
5
6
  import { ActivityDecorator } from '../components/activity';
@@ -7,8 +8,8 @@ import { isPreChatMessageActivity, PreChatMessageActivity } from '../components/
7
8
  import { PrimarySendBox } from '../components/sendBox';
8
9
  import { TelephoneKeypadProvider } from '../components/telephoneKeypad';
9
10
  import { WebChatTheme } from '../components/theme';
11
+ import { createStyles } from '../styles';
10
12
  import VariantComposer, { VariantList } from './VariantComposer';
11
- import { FluentThemeDecorator } from '../components/decorator';
12
13
  import { isLinerMessageActivity, LinerMessageActivity } from '../components/linerActivity';
13
14
 
14
15
  const { ThemeProvider } = Components;
@@ -40,12 +41,14 @@ const activityMiddleware: readonly ActivityMiddleware[] = Object.freeze([
40
41
 
41
42
  const sendBoxMiddleware = [() => () => () => PrimarySendBox];
42
43
 
44
+ const styles = createStyles();
45
+
43
46
  const FluentThemeProvider = ({ children, variant = 'fluent' }: Props) => (
44
47
  <VariantComposer variant={variant}>
45
48
  <WebChatTheme>
46
49
  <TelephoneKeypadProvider>
47
- <ThemeProvider activityMiddleware={activityMiddleware} sendBoxMiddleware={sendBoxMiddleware}>
48
- <FluentThemeDecorator>{children}</FluentThemeDecorator>
50
+ <ThemeProvider activityMiddleware={activityMiddleware} sendBoxMiddleware={sendBoxMiddleware} styles={styles}>
51
+ <WebChatDecorator>{children}</WebChatDecorator>
49
52
  </ThemeProvider>
50
53
  </TelephoneKeypadProvider>
51
54
  </WebChatTheme>
@@ -0,0 +1,5 @@
1
+ import { makeCreateStyles } from 'botframework-webchat-styles';
2
+
3
+ export const fluentStyleContent = '@--FLUENT-STYLES-CONTENT--@';
4
+
5
+ export default makeCreateStyles(fluentStyleContent);
@@ -1,5 +1,5 @@
1
- import injectStyle from './injectStyle';
1
+ import createStyles from './createStyles';
2
2
  import useStyles from './useStyles';
3
3
  import useVariantClassName from './useVariantClassName';
4
4
 
5
- export { injectStyle, useStyles, useVariantClassName };
5
+ export { createStyles, useStyles, useVariantClassName };
@@ -1,19 +1,2 @@
1
- import { useMemo } from 'react';
2
-
3
- function useStyles<T extends CSSModuleClasses>(styles: T): T {
4
- // @ts-expect-error: entries/fromEntries don't allow to specify keys type
5
- return useMemo(
6
- () =>
7
- Object.freeze(
8
- Object.fromEntries(
9
- Object.entries(styles).map(([baseClassName, resultClassName]) => [
10
- baseClassName,
11
- `${baseClassName} ${resultClassName}`
12
- ])
13
- )
14
- ),
15
- [styles]
16
- );
17
- }
18
-
19
- export default useStyles;
1
+ // TODO: refactor after initial approval gained
2
+ export { useStyles as default } from 'botframework-webchat-styles/react';
package/src/tsconfig.json CHANGED
@@ -1,12 +1,14 @@
1
1
  {
2
- "compilerOptions": {
3
- "allowSyntheticDefaultImports": true,
4
- "checkJs": false,
5
- "jsx": "react",
6
- "moduleResolution": "Bundler",
7
- "skipLibCheck": true,
8
- "target": "ESNext",
9
- "plugins": [{ "name": "typescript-plugin-css-modules" }]
10
- },
11
- "extends": "@tsconfig/strictest/tsconfig.json"
2
+ "compilerOptions": {
3
+ "allowSyntheticDefaultImports": true,
4
+ "checkJs": false,
5
+ "jsx": "react",
6
+ "moduleResolution": "Bundler",
7
+ "skipLibCheck": true,
8
+ "target": "ESNext"
9
+ },
10
+ "extends": [
11
+ "@tsconfig/strictest/tsconfig.json",
12
+ "botframework-webchat-styles/tsconfig.json"
13
+ ]
12
14
  }
@@ -1 +0,0 @@
1
- export { default as FluentThemeDecorator } from './private/Decorator';