From ea7a87551304d2c55ce85a9cc566bc0bd6b64929 Mon Sep 17 00:00:00 2001
From: Eugene
Date: Fri, 27 Sep 2024 20:06:12 +0000
Subject: [PATCH] feat: Add white-label CSS decorator (#5312)
* Firefox implementation
* Simplify layout
* Cleanup
* Styles package
* Fix component build:types step
* Fix source maps
* Use quoted placeholder
* Add injected styles check
* Add built-in decorator tests
* Add component decorator to external fluent
* Configure fluent decorator
* Handle loader overflow
* Lower Chrome required version
* Move decorator to component
* Add missing env
* Add styles to workspaces
* Bail if unable to create styles
* Sort
* Readability
---------
Co-authored-by: William Wong
---
.eslintrc.production.yml | 1 +
CHANGELOG.md | 3 +
...lt-in-decorator-with-decorators-1-snap.png | Bin 0 -> 9409 bytes
...lt-in-decorator-with-decorators-2-snap.png | Bin 0 -> 13798 bytes
...-theme-applied-with-decorators-1-snap.png} | Bin
...-theme-applied-with-decorators-2-snap.png} | Bin
...ustomization.basicWebChat.restructure.html | 2 +-
...ecorator.html => withCustomDecorator.html} | 0
...ithDecorator.js => withCustomDecorator.js} | 2 +-
.../hooks.useInjectStyles.changeNonce.html | 4 +-
.../hooks.useInjectStyles.changeRoot.html | 8 +-
.../hooks.useInjectStyles.dupeElement.html | 4 +-
__tests__/html/hooks.useInjectStyles.html | 6 +-
__tests__/html/withBuiltinDecorator.html | 114 ++++++++++++++++++
__tests__/html/withBuiltinDecorator.js | 5 +
package-lock.json | 34 ++++++
package.json | 1 +
packages/api/src/StyleOptions.ts | 29 +++++
packages/api/src/defaultStyleOptions.ts | 7 +-
.../AdaptiveCardHacks/private/closest.ts | 1 -
.../Attachment/private/renderAdaptiveCard.ts | 1 -
packages/bundle/src/index-es5.ts | 3 -
packages/bundle/src/index-minimal.ts | 9 +-
packages/bundle/src/index.ts | 3 -
.../bundle/src/speech/createAudioContext.ts | 2 -
packages/component/decorator.js | 3 +
packages/component/package.json | 14 ++-
packages/component/src/Composer.tsx | 6 +-
.../src/Styles/CustomPropertyNames.ts | 3 +
.../Styles/StyleSet/CSSCustomProperties.ts | 51 --------
.../component/src/Styles/createStyleSet.ts | 2 -
packages/component/src/Styles/createStyles.ts | 5 +
packages/component/src/Styles/index.ts | 3 +
.../Styles/useCustomPropertiesClassName.ts | 67 ++++++++++
.../src/Utils/firstTabbableDescendant.js | 1 -
packages/component/src/decorator/index.ts | 1 +
.../decorator/private/BorderFlair.module.css | 6 +-
.../src}/decorator/private/BorderFlair.tsx | 2 +-
.../decorator/private/BorderLoader.module.css | 8 +-
.../src}/decorator/private/BorderLoader.tsx | 2 +-
.../src}/decorator/private/Decorator.tsx | 14 ++-
.../src/decorator/private/createStyles.ts | 5 +
packages/component/src/env.d.ts | 1 +
.../hooks/internal/useObserveFocusVisible.ts | 1 -
packages/component/src/tsconfig.json | 5 +-
packages/component/tsup.config.ts | 14 ++-
packages/fluent-theme/.eslintrc.yml | 1 -
packages/fluent-theme/package.json | 4 +-
.../src/components/decorator/index.ts | 1 -
packages/fluent-theme/src/env.d.ts | 8 +-
.../decorator.ts | 1 +
.../src/private/FluentThemeProvider.tsx | 4 +-
.../fluent-theme/src/styles/createStyles.ts | 12 +-
packages/fluent-theme/src/styles/useStyles.ts | 21 +---
packages/fluent-theme/src/tsconfig.json | 22 ++--
packages/fluent-theme/tsup.config.ts | 28 ++---
packages/styles/.eslintrc.yml | 6 +
packages/styles/.gitignore | 4 +
packages/styles/README.md | 0
packages/styles/build.js | 3 +
packages/styles/package.json | 87 +++++++++++++
packages/styles/react.js | 3 +
packages/styles/src/build/index.ts | 1 +
.../src/build/private/injectCSSPlugin.ts | 76 ++++++++++++
packages/styles/src/env.d.ts | 7 ++
packages/styles/src/index.ts | 1 +
.../styles/src/private/makeCreateStyles.ts | 17 +++
packages/styles/src/react/index.ts | 1 +
.../styles/src/react/private/useStyles.ts | 19 +++
packages/styles/src/ts-config/config.json | 5 +
packages/styles/src/tsconfig.json | 12 ++
packages/styles/tsup.config.ts | 12 ++
72 files changed, 640 insertions(+), 169 deletions(-)
create mode 100644 __tests__/__image_snapshots__/html/with-builtin-decorator-js-built-in-decorator-with-decorators-1-snap.png
create mode 100644 __tests__/__image_snapshots__/html/with-builtin-decorator-js-built-in-decorator-with-decorators-2-snap.png
rename __tests__/__image_snapshots__/html/{with-decorator-js-fluent-theme-applied-with-decorators-1-snap.png => with-custom-decorator-js-fluent-theme-applied-with-decorators-1-snap.png} (100%)
rename __tests__/__image_snapshots__/html/{with-decorator-js-fluent-theme-applied-with-decorators-2-snap.png => with-custom-decorator-js-fluent-theme-applied-with-decorators-2-snap.png} (100%)
rename __tests__/html/fluentTheme/{withDecorator.html => withCustomDecorator.html} (100%)
rename __tests__/html/fluentTheme/{withDecorator.js => withCustomDecorator.js} (63%)
create mode 100644 __tests__/html/withBuiltinDecorator.html
create mode 100644 __tests__/html/withBuiltinDecorator.js
create mode 100644 packages/component/decorator.js
delete mode 100644 packages/component/src/Styles/StyleSet/CSSCustomProperties.ts
create mode 100644 packages/component/src/Styles/createStyles.ts
create mode 100644 packages/component/src/Styles/index.ts
create mode 100644 packages/component/src/Styles/useCustomPropertiesClassName.ts
create mode 100644 packages/component/src/decorator/index.ts
rename packages/{fluent-theme/src/components => component/src}/decorator/private/BorderFlair.module.css (98%)
rename packages/{fluent-theme/src/components => component/src}/decorator/private/BorderFlair.tsx (93%)
rename packages/{fluent-theme/src/components => component/src}/decorator/private/BorderLoader.module.css (87%)
rename packages/{fluent-theme/src/components => component/src}/decorator/private/BorderLoader.tsx (88%)
rename packages/{fluent-theme/src/components => component/src}/decorator/private/Decorator.tsx (57%)
create mode 100644 packages/component/src/decorator/private/createStyles.ts
create mode 100644 packages/component/src/env.d.ts
delete mode 100644 packages/fluent-theme/src/components/decorator/index.ts
create mode 100644 packages/fluent-theme/src/external.umd/botframework-webchat-component/decorator.ts
create mode 100644 packages/styles/.eslintrc.yml
create mode 100644 packages/styles/.gitignore
create mode 100644 packages/styles/README.md
create mode 100644 packages/styles/build.js
create mode 100644 packages/styles/package.json
create mode 100644 packages/styles/react.js
create mode 100644 packages/styles/src/build/index.ts
create mode 100644 packages/styles/src/build/private/injectCSSPlugin.ts
create mode 100644 packages/styles/src/env.d.ts
create mode 100644 packages/styles/src/index.ts
create mode 100644 packages/styles/src/private/makeCreateStyles.ts
create mode 100644 packages/styles/src/react/index.ts
create mode 100644 packages/styles/src/react/private/useStyles.ts
create mode 100644 packages/styles/src/ts-config/config.json
create mode 100644 packages/styles/src/tsconfig.json
create mode 100644 packages/styles/tsup.config.ts
diff --git a/.eslintrc.production.yml b/.eslintrc.production.yml
index 288e26d8c4..80d8870da2 100644
--- a/.eslintrc.production.yml
+++ b/.eslintrc.production.yml
@@ -8,6 +8,7 @@ overrides:
no-restricted-globals: off
rules:
+ dot-notation: off
no-restricted-globals:
- error
- name: cancelAnimationFrame
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 1e67b87464..13722a8a27 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -52,6 +52,9 @@ Notes: web developers are advised to use [`~` (tilde range)](https://github.com/
- Added `nonce` for Fluent and `react-scroll-to-bottom` injected styles, in PR [#5196](https://github.com/microsoft/BotFramework-WebChat/pull/5196), by [@OEvgeny](https://github.com/OEvgeny)
- Updated `react-scroll-to-bottom` to version `4.2.1-main.53844f5`, in PR [#5196](https://github.com/microsoft/BotFramework-WebChat/pull/5196), by [@OEvgeny](https://github.com/OEvgeny)
- Updated `react-film` to version `3.1.1-main.f623bf6`, in PR [#5196](https://github.com/microsoft/BotFramework-WebChat/pull/5196), by [@OEvgeny](https://github.com/OEvgeny)
+- (Experimental) Added CSS decorator support into Web Chat white-label experience, in PR [#5312](https://github.com/microsoft/BotFramework-WebChat/pull/5312), by [@OEvgeny](https://github.com/OEvgeny)
+ - Introduced `WebChatDecorator` component for adding animated borders to activities, in PR [#5312](https://github.com/microsoft/BotFramework-WebChat/pull/5312)
+ - Added new style options `borderAnimationColor1`, `borderAnimationColor2`, and `borderAnimationColor3` for customizing decorator colors, in PR [#5312](https://github.com/microsoft/BotFramework-WebChat/pull/5312)
### Changed
diff --git a/__tests__/__image_snapshots__/html/with-builtin-decorator-js-built-in-decorator-with-decorators-1-snap.png b/__tests__/__image_snapshots__/html/with-builtin-decorator-js-built-in-decorator-with-decorators-1-snap.png
new file mode 100644
index 0000000000000000000000000000000000000000..1c7cc325d7c39721b0a8c26fee6eef587fcf2aca
GIT binary patch
literal 9409
zcmeHtX*iUN-~XU!L!B(yTaXB+qOwz#Gb#HZ#yHg}TUo}wPAW%PYa(Ue$3Br=mQx`L
zV;MqYmwg-iGCbe=_y50sp6hzvJ=b--!MNvMzRPDbFAVf_*bng^LZMLX=sz@#P$(u_
z6pH!r0akdWkbi^(-UG;PgX-r7jYL+jR1wjh6nkBOF47o>O!x)DPxX=*vt!~Oq^8ESpi)Sxhq~kdcW>E!I
zliEB_T{$l+8`D2$>g81~$e}YNQqtL^x7mjA_V%U_ig9GKaDI8>=i&07*IDc{4j*!J
zaVh-iSjK<(Vb=5K&tp&U9+8ldG1brrS@gft4|66^@768qVEO>PX4d|z#WM|Id}*1t;!GW?3JVK;hJ$!zHhg9R=119_1MEd9c6N3ag?EEOLPDOr
zk+mrPgCqEQD37$_+~rVSSyKxOi(5y|4rRpPIw&dE9oz)ury57wzJKrPcdGU0)7h6S
zPBl-~y>TNdE>57>uRT?(a=vn=_^&2nav8f*Z;_Ug=X~ChdL-W^ZCa&!Zu_IIbdg9x
zORRj1iyX?{B79$^=fXgaF)4ya27AKXWA?{|{M#S2Yxfun?u$bjkAA#A^i1vTr}-KS-KLDRG&OBI
z($T~xqyyr5@mb=xVr|Epqo;d6kW$mqqTjyFx-#f@X;KwlPk$qA**uQ78>$QJ`{?~a
zkRv!#KPjNQanE>kZ)=7;?tHb_Yw0e{t@Bn$csK@&jTa8sxDy>6ov<1p6*)NUETN`m
zeXlVB^OTjn)kgrOW-b5Q_9>P(NU1ZCHpgYTlI8P5AYMXoVbD>N!TKJVGHebG@-
z64KJQ2K|=9AGE|~gbQ4;AN%^MlCjn=@4Gfz$I$I4c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~1bE`y=LT!7$sg$7OQvJsIglui
zh{(g@;^Mj{2NY^zAr(HO;Jma{WA;COXosPe`tVnWdNe-;K9ht(Yw2kgT>JCMe*yIH
BfQSG9
literal 0
HcmV?d00001
diff --git a/__tests__/__image_snapshots__/html/with-builtin-decorator-js-built-in-decorator-with-decorators-2-snap.png b/__tests__/__image_snapshots__/html/with-builtin-decorator-js-built-in-decorator-with-decorators-2-snap.png
new file mode 100644
index 0000000000000000000000000000000000000000..53308298253006815b2c92b704886360600b587a
GIT binary patch
literal 13798
zcmeHuXH=8!fsz%R}SH}IG8O?ocrA%tw
z9A+zf`{DNe&-|(?bgFb0uGd_M!=<0J!0z;pm;^YDr;>LF)hn68JEb)jeZLC+swz>&
zAa+)2SapZ*#+Bn&PA6#H+&$3fxT_U{x;3TVm`2>ZDZbDlyQ?+T{$0^thogm^2NB|(
zynsd^LU3ms5FgGzr$=c1`@_G3@b66c_b&MNF8KE@`2TPh7`fX@f2jU&KZ!Ng(YR4V
zwoY+mzWDWz*AZ_xSWxPi+b!&}IyIe}TmF6rk9C+`Idj7MKE!@5jyKfdNgR8n^SnWwOkCp2lagO$9whMC#g44*I3?9tnk9u*?x-XrzLX`+3KNl%kU%Ixortg`hsmrQuH2SzWhvRaWxCLVa+DZR8ORUM_+a&Y0uT5hrnRw?<
z>(ox!blX@Rs{}5!WPQ!nXK}?^(FXc2Z+HLrsXX|ZuFIc}0k?iXUun`FFV1IFZFfg{
zF5aE1PMF6$FE0++xw<=PqEWR@jdm%b-GgQKqg
zek~V^yET(cj}7;F+oc~yxiUFY?oKYYmYyeME2i&$t>t3;*VnS4d>XF}i!v`$hA$p|
ztBhj7h=0p3VG`^n>4j{WH&>2Z&But}5AzgjdTtob`V=mOkD6sB|8hQL?F7eS`X9M_
z#8)b^FH$^Z0vFKi&3?jDD)N7FOa>OR$tY^PzTNeQ(hjqPdUNoLWK|v6V~10!O+ge1
zuf-noU3+``_G$M;8!Fkf$ZobZ+H`Ba^EjtY%Gq=0NZ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ojb+1
I{`m7h0Avo^8UO$Q
literal 0
HcmV?d00001
diff --git a/__tests__/__image_snapshots__/html/with-decorator-js-fluent-theme-applied-with-decorators-1-snap.png b/__tests__/__image_snapshots__/html/with-custom-decorator-js-fluent-theme-applied-with-decorators-1-snap.png
similarity index 100%
rename from __tests__/__image_snapshots__/html/with-decorator-js-fluent-theme-applied-with-decorators-1-snap.png
rename to __tests__/__image_snapshots__/html/with-custom-decorator-js-fluent-theme-applied-with-decorators-1-snap.png
diff --git a/__tests__/__image_snapshots__/html/with-decorator-js-fluent-theme-applied-with-decorators-2-snap.png b/__tests__/__image_snapshots__/html/with-custom-decorator-js-fluent-theme-applied-with-decorators-2-snap.png
similarity index 100%
rename from __tests__/__image_snapshots__/html/with-decorator-js-fluent-theme-applied-with-decorators-2-snap.png
rename to __tests__/__image_snapshots__/html/with-custom-decorator-js-fluent-theme-applied-with-decorators-2-snap.png
diff --git a/__tests__/html/customization.basicWebChat.restructure.html b/__tests__/html/customization.basicWebChat.restructure.html
index 014db57fda..736e906f0d 100644
--- a/__tests__/html/customization.basicWebChat.restructure.html
+++ b/__tests__/html/customization.basicWebChat.restructure.html
@@ -59,7 +59,7 @@
expect(container?.firstChild).not.toBeUndefined();
const composer = container.firstChild;
- expect(getComputedStyle(composer).getPropertyValue('--webchat__color--accent')).toBe('#0063B1');
+ expect(getComputedStyle(composer).getPropertyValue('--webchat__color--accent').trim()).toBe('#0063B1');
const surface = composer.children[1];
expect(surface.className).toContain(classes.surface);
diff --git a/__tests__/html/fluentTheme/withDecorator.html b/__tests__/html/fluentTheme/withCustomDecorator.html
similarity index 100%
rename from __tests__/html/fluentTheme/withDecorator.html
rename to __tests__/html/fluentTheme/withCustomDecorator.html
diff --git a/__tests__/html/fluentTheme/withDecorator.js b/__tests__/html/fluentTheme/withCustomDecorator.js
similarity index 63%
rename from __tests__/html/fluentTheme/withDecorator.js
rename to __tests__/html/fluentTheme/withCustomDecorator.js
index 77832ec842..6911922f89 100644
--- a/__tests__/html/fluentTheme/withDecorator.js
+++ b/__tests__/html/fluentTheme/withCustomDecorator.js
@@ -1,5 +1,5 @@
/** @jest-environment ./packages/test/harness/src/host/jest/WebDriverEnvironment.js */
describe('Fluent theme applied', () => {
- test('with decorators', () => runHTML('fluentTheme/withDecorator'));
+ test('with decorators', () => runHTML('fluentTheme/withCustomDecorator'));
});
diff --git a/__tests__/html/hooks.useInjectStyles.changeNonce.html b/__tests__/html/hooks.useInjectStyles.changeNonce.html
index fb7a214575..ad66007d72 100644
--- a/__tests__/html/hooks.useInjectStyles.changeNonce.html
+++ b/__tests__/html/hooks.useInjectStyles.changeNonce.html
@@ -54,7 +54,7 @@
await renderWithFunction(() => useInjectStyles([styleElement], '1'));
await host.snapshot();
- const allInjectedStyles1 = document.head.querySelectorAll('style:not([data-emotion])');
+ const allInjectedStyles1 = document.head.querySelectorAll('style:not([data-emotion]):not([data-webchat-injected])');
expect(allInjectedStyles1).toHaveLength(1);
expect(allInjectedStyles1[0]).toBe(styleElement);
@@ -64,7 +64,7 @@
// No color should be applied as nonce don't match.
await host.snapshot();
- const allInjectedStyles2 = document.head.querySelectorAll('style:not([data-emotion])');
+ const allInjectedStyles2 = document.head.querySelectorAll('style:not([data-emotion]):not([data-webchat-injected])');
expect(allInjectedStyles2).toHaveLength(1);
expect(allInjectedStyles2[0]).toBe(styleElement);
diff --git a/__tests__/html/hooks.useInjectStyles.changeRoot.html b/__tests__/html/hooks.useInjectStyles.changeRoot.html
index a14ecbaad4..25e88e30c2 100644
--- a/__tests__/html/hooks.useInjectStyles.changeRoot.html
+++ b/__tests__/html/hooks.useInjectStyles.changeRoot.html
@@ -52,16 +52,16 @@
await renderWithFunction(() => useInjectStyles([styleElement]));
await host.snapshot();
- expect([...document.head.querySelectorAll('style:not([data-emotion])')]).toEqual([styleElement]);
- expect([...document.body.querySelectorAll('style:not([data-emotion])')]).toEqual([]);
+ expect([...document.head.querySelectorAll('style:not([data-emotion]):not([data-webchat-injected])')]).toEqual([styleElement]);
+ expect([...document.body.querySelectorAll('style:not([data-emotion]):not([data-webchat-injected])')]).toEqual([]);
await renderWithFunction(() => useInjectStyles([styleElement]), {
styleOptions: { stylesRoot: document.body }
});
await host.snapshot();
- expect([...document.head.querySelectorAll('style:not([data-emotion])')]).toEqual([]);
- expect([...document.body.querySelectorAll('style:not([data-emotion])')]).toEqual([styleElement]);
+ expect([...document.head.querySelectorAll('style:not([data-emotion]):not([data-webchat-injected])')]).toEqual([]);
+ expect([...document.body.querySelectorAll('style:not([data-emotion]):not([data-webchat-injected])')]).toEqual([styleElement]);
});
+
+
+
diff --git a/__tests__/html/hooks.useInjectStyles.dupeElement.html b/__tests__/html/hooks.useInjectStyles.dupeElement.html
index ba8663bb40..ebf4fd35fc 100644
--- a/__tests__/html/hooks.useInjectStyles.dupeElement.html
+++ b/__tests__/html/hooks.useInjectStyles.dupeElement.html
@@ -52,7 +52,7 @@
await renderWithFunction(() => useInjectStyles([styleElement, styleElement]));
await host.snapshot();
- const allInjectedStyles1 = document.head.querySelectorAll('style:not([data-emotion])');
+ const allInjectedStyles1 = document.head.querySelectorAll('style:not([data-emotion]):not([data-webchat-injected])');
expect(allInjectedStyles1).toHaveLength(1);
expect(allInjectedStyles1[0]).toBe(styleElement);
@@ -60,7 +60,7 @@
await renderWithFunction(() => useInjectStyles([styleElement, styleElement]));
await host.snapshot();
- const allInjectedStyles2 = document.head.querySelectorAll('style:not([data-emotion])');
+ const allInjectedStyles2 = document.head.querySelectorAll('style:not([data-emotion]):not([data-webchat-injected])');
expect(allInjectedStyles2).toHaveLength(1);
expect(allInjectedStyles2[0]).toBe(styleElement);
diff --git a/__tests__/html/hooks.useInjectStyles.html b/__tests__/html/hooks.useInjectStyles.html
index 4169135f62..ca9b43dc9c 100644
--- a/__tests__/html/hooks.useInjectStyles.html
+++ b/__tests__/html/hooks.useInjectStyles.html
@@ -56,7 +56,7 @@
await renderWithFunction(() => useInjectStyles([styleElement1]));
await host.snapshot();
- const allInjectedStyles1 = document.head.querySelectorAll('style:not([data-emotion])');
+ const allInjectedStyles1 = document.head.querySelectorAll('style:not([data-emotion]):not([data-webchat-injected])');
expect(allInjectedStyles1).toHaveLength(1);
expect(allInjectedStyles1[0]).toBe(styleElement1);
@@ -64,7 +64,7 @@
await renderWithFunction(() => useInjectStyles([styleElement1, styleElement2]));
await host.snapshot();
- const allInjectedStyles2 = document.head.querySelectorAll('style:not([data-emotion])');
+ const allInjectedStyles2 = document.head.querySelectorAll('style:not([data-emotion]):not([data-webchat-injected])');
expect(allInjectedStyles2).toHaveLength(2);
expect(allInjectedStyles2[0]).toBe(styleElement1);
@@ -73,7 +73,7 @@
await renderWithFunction(() => useInjectStyles([styleElement1, styleElement2, styleElement3]));
await host.snapshot();
- const allInjectedStyles3 = document.head.querySelectorAll('style:not([data-emotion])');
+ const allInjectedStyles3 = document.head.querySelectorAll('style:not([data-emotion]):not([data-webchat-injected])');
expect(allInjectedStyles3).toHaveLength(3);
expect(allInjectedStyles3[0]).toBe(styleElement1);
diff --git a/__tests__/html/withBuiltinDecorator.html b/__tests__/html/withBuiltinDecorator.html
new file mode 100644
index 0000000000..fcd7d71f3e
--- /dev/null
+++ b/__tests__/html/withBuiltinDecorator.html
@@ -0,0 +1,114 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+