botframework-webchat-fluent-theme 4.18.1-main.20240917.4b9342a → 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 (31) hide show
  1. package/dist/botframework-webchat-fluent-theme.css.map +1 -1
  2. package/dist/botframework-webchat-fluent-theme.d.mts +9 -5
  3. package/dist/botframework-webchat-fluent-theme.d.ts +9 -5
  4. package/dist/botframework-webchat-fluent-theme.development.css.map +1 -1
  5. package/dist/botframework-webchat-fluent-theme.development.js +8 -8
  6. package/dist/botframework-webchat-fluent-theme.development.js.map +1 -1
  7. package/dist/botframework-webchat-fluent-theme.js +1 -1
  8. package/dist/botframework-webchat-fluent-theme.js.map +1 -1
  9. package/dist/botframework-webchat-fluent-theme.mjs +1 -1
  10. package/dist/botframework-webchat-fluent-theme.mjs.map +1 -1
  11. package/dist/botframework-webchat-fluent-theme.production.min.css.map +1 -1
  12. package/dist/botframework-webchat-fluent-theme.production.min.js +8 -8
  13. package/dist/botframework-webchat-fluent-theme.production.min.js.map +1 -1
  14. package/package.json +16 -18
  15. package/src/components/dropZone/DropZone.tsx +1 -1
  16. package/src/components/preChatActivity/PreChatMessageActivity.module.css +2 -0
  17. package/src/env.d.ts +1 -7
  18. package/src/external.umd/botframework-webchat-component/decorator.ts +1 -0
  19. package/src/index.ts +0 -3
  20. package/src/private/FluentThemeProvider.tsx +6 -3
  21. package/src/styles/createStyles.ts +5 -0
  22. package/src/styles/index.ts +2 -2
  23. package/src/styles/useStyles.ts +2 -19
  24. package/src/tsconfig.json +12 -10
  25. package/src/components/decorator/index.ts +0 -1
  26. package/src/components/decorator/private/BorderFlair.module.css +0 -552
  27. package/src/components/decorator/private/BorderFlair.tsx +0 -30
  28. package/src/components/decorator/private/BorderLoader.module.css +0 -49
  29. package/src/components/decorator/private/BorderLoader.tsx +0 -19
  30. package/src/components/decorator/private/Decorator.tsx +0 -20
  31. 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.20240917.4b9342a",
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",
@@ -38,22 +38,24 @@
38
38
  "src/**/*"
39
39
  ],
40
40
  "scripts": {
41
- "auditfix": "npm audit fix --legacy-peer-deps || exit 0",
42
41
  "build": "tsup",
43
- "bump": "npm run bump:prod && npm run bump:dev && npm run bump:auditfix",
44
- "bump:auditfix": "npm audit fix --legacy-peer-deps || exit 0",
45
- "bump:dev": "if [ `cat package.json | jq -r '.devDependencies | length'` -ne 0 ]; then npm install --legacy-peer-deps $(cat package.json | jq -r '(.pinDependencies // {}) as $p | ((.devDependencies // {}) | keys) | map(. + \"@\" + ($p[.] // [\"latest\"])[0]) | .[]'); fi",
46
- "bump:prod": "if [ `cat package.json | jq -r '.dependencies | length'` -ne 0 ]; then npm install --legacy-peer-deps --save-exact $(cat package.json | jq -r '(.pinDependencies // {}) as $p | ((.dependencies // {}) | keys) | map(. + \"@\" + ($p[.] // [\"latest\"])[0]) | .[]'); fi",
42
+ "bump": "npm run bump:prod && npm run bump:dev && (npm audit fix || exit 0)",
43
+ "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",
44
+ "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",
47
45
  "eslint": "npm run precommit",
48
- "postauditfix": "npm run postbump",
49
- "postbump": "cat package.json | jq '. + (.dependencies = ((.dependencies + (.localPeerDependencies // {})) | to_entries | sort_by(.key) | from_entries)) | (.devDependencies = ((.devDependencies + (.localPeerDevDependencies // {})) | to_entries | sort_by(.key) | from_entries))' > package-temp.json && mv package-temp.json package.json",
50
- "preauditfix": "npm run prebump",
51
- "prebump": "cat package.json | jq '(((.localPeerDependencies // {}) | keys | map([\"dependencies\", .])) + ((.localPeerDevDependencies // {}) | keys | map([\"devDependencies\", .]))) as $localPeerPaths | delpaths($localPeerPaths)' > package-temp.json && mv package-temp.json package.json",
46
+ "postversion": "cat package.json | jq '.version as $V | (.localDependencies // {} | with_entries(select(.value == \"production\") | { key: .key, value: $V })) as $L1 | (.localDependencies // {} | with_entries(select(.value == \"development\") | { key: .key, value: $V })) as $L2 | ((.dependencies // {}) + $L1 | to_entries | sort_by(.key) | from_entries) as $D1 | ((.devDependencies // {}) + $L2 | to_entries | sort_by(.key) | from_entries) as $D2 | . + { dependencies: $D1, devDependencies: $D2 }' > package-temp.json && mv package-temp.json package.json",
52
47
  "precommit": "npm run precommit:eslint -- src && npm run precommit:typecheck",
53
48
  "precommit:eslint": "../../node_modules/.bin/eslint --report-unused-disable-directives --max-warnings 0",
54
49
  "precommit:typecheck": "tsc --project ./src --emitDeclarationOnly false --esModuleInterop true --noEmit --pretty false",
50
+ "preversion": "cat package.json | jq '(.localDependencies // {} | to_entries | map([if .value == \"production\" then \"dependencies\" else \"devDependencies\" end, .key])) as $P | delpaths($P)' > package-temp.json && mv package-temp.json package.json",
55
51
  "start": "npm run build -- --watch"
56
52
  },
53
+ "localDependencies": {
54
+ "botframework-webchat-api": "production",
55
+ "botframework-webchat-component": "production",
56
+ "botframework-webchat-core": "production",
57
+ "botframework-webchat-styles": "production"
58
+ },
57
59
  "pinDependencies": {
58
60
  "@types/react": [
59
61
  "16",
@@ -69,9 +71,10 @@
69
71
  "typescript": "^5.4.5"
70
72
  },
71
73
  "dependencies": {
72
- "botframework-webchat-api": "4.18.1-main.20240917.4b9342a",
73
- "botframework-webchat-component": "4.18.1-main.20240917.4b9342a",
74
- "botframework-webchat-core": "4.18.1-main.20240917.4b9342a",
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",
75
78
  "classnames": "2.5.1",
76
79
  "inject-meta-tag": "0.0.1",
77
80
  "math-random": "2.0.1",
@@ -80,10 +83,5 @@
80
83
  },
81
84
  "peerDependencies": {
82
85
  "react": ">= 16.8.6"
83
- },
84
- "localPeerDependencies": {
85
- "botframework-webchat-api": "0.0.0-0",
86
- "botframework-webchat-component": "0.0.0-0",
87
- "botframework-webchat-core": "0.0.0-0"
88
86
  }
89
87
  }
@@ -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';