@fluentui/web-components 2.5.13 → 2.5.14

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.
package/CHANGELOG.json CHANGED
@@ -2,7 +2,22 @@
2
2
  "name": "@fluentui/web-components",
3
3
  "entries": [
4
4
  {
5
- "date": "Tue, 11 Apr 2023 07:42:59 GMT",
5
+ "date": "Mon, 17 Apr 2023 07:38:52 GMT",
6
+ "tag": "@fluentui/web-components_v2.5.14",
7
+ "version": "2.5.14",
8
+ "comments": {
9
+ "patch": [
10
+ {
11
+ "author": "chhol@microsoft.com",
12
+ "package": "@fluentui/web-components",
13
+ "commit": "2e1cf8928df3e4f0b64b7390408374db94ae9e2c",
14
+ "comment": "update FAST dependencies to mitigate Safari 16.4 AdoptedStyleSheets bug"
15
+ }
16
+ ]
17
+ }
18
+ },
19
+ {
20
+ "date": "Tue, 11 Apr 2023 07:43:45 GMT",
6
21
  "tag": "@fluentui/web-components_v2.5.13",
7
22
  "version": "2.5.13",
8
23
  "comments": {
package/CHANGELOG.md CHANGED
@@ -1,12 +1,21 @@
1
1
  # Change Log - @fluentui/web-components
2
2
 
3
- This log was last generated on Tue, 11 Apr 2023 07:42:59 GMT and should not be manually modified.
3
+ This log was last generated on Mon, 17 Apr 2023 07:38:52 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## [2.5.14](https://github.com/microsoft/fluentui/tree/@fluentui/web-components_v2.5.14)
8
+
9
+ Mon, 17 Apr 2023 07:38:52 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/web-components_v2.5.13..@fluentui/web-components_v2.5.14)
11
+
12
+ ### Patches
13
+
14
+ - update FAST dependencies to mitigate Safari 16.4 AdoptedStyleSheets bug ([PR #27578](https://github.com/microsoft/fluentui/pull/27578) by chhol@microsoft.com)
15
+
7
16
  ## [2.5.13](https://github.com/microsoft/fluentui/tree/@fluentui/web-components_v2.5.13)
8
17
 
9
- Tue, 11 Apr 2023 07:42:59 GMT
18
+ Tue, 11 Apr 2023 07:43:45 GMT
10
19
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/web-components_v2.5.12..@fluentui/web-components_v2.5.13)
11
20
 
12
21
  ### Patches
@@ -1656,6 +1656,37 @@ function reduceBehaviors(styles) {
1656
1656
  return prev.concat(curr);
1657
1657
  }, null);
1658
1658
  }
1659
+ let addAdoptedStyleSheets = (target, sheets) => {
1660
+ target.adoptedStyleSheets = [...target.adoptedStyleSheets, ...sheets];
1661
+ };
1662
+ let removeAdoptedStyleSheets = (target, sheets) => {
1663
+ target.adoptedStyleSheets = target.adoptedStyleSheets.filter(x => sheets.indexOf(x) === -1);
1664
+ };
1665
+ if (DOM.supportsAdoptedStyleSheets) {
1666
+ try {
1667
+ // Test if browser implementation uses FrozenArray.
1668
+ // If not, use push / splice to alter the stylesheets
1669
+ // in place. This circumvents a bug in Safari 16.4 where
1670
+ // periodically, assigning the array would previously
1671
+ // cause sheets to be removed.
1672
+ document.adoptedStyleSheets.push();
1673
+ document.adoptedStyleSheets.splice();
1674
+ addAdoptedStyleSheets = (target, sheets) => {
1675
+ target.adoptedStyleSheets.push(...sheets);
1676
+ };
1677
+ removeAdoptedStyleSheets = (target, sheets) => {
1678
+ for (const sheet of sheets) {
1679
+ const index = target.adoptedStyleSheets.indexOf(sheet);
1680
+ if (index !== -1) {
1681
+ target.adoptedStyleSheets.splice(index, 1);
1682
+ }
1683
+ }
1684
+ };
1685
+ } catch (e) {
1686
+ // Do nothing if an error is thrown, the default
1687
+ // case handles FrozenArray.
1688
+ }
1689
+ }
1659
1690
  /**
1660
1691
  * https://wicg.github.io/construct-stylesheets/
1661
1692
  * https://developers.google.com/web/updates/2019/02/constructable-stylesheets
@@ -1690,12 +1721,11 @@ class AdoptedStyleSheetsStyles extends ElementStyles {
1690
1721
  return this._styleSheets;
1691
1722
  }
1692
1723
  addStylesTo(target) {
1693
- target.adoptedStyleSheets = [...target.adoptedStyleSheets, ...this.styleSheets];
1724
+ addAdoptedStyleSheets(target, this.styleSheets);
1694
1725
  super.addStylesTo(target);
1695
1726
  }
1696
1727
  removeStylesFrom(target) {
1697
- const sourceSheets = this.styleSheets;
1698
- target.adoptedStyleSheets = target.adoptedStyleSheets.filter(x => sourceSheets.indexOf(x) === -1);
1728
+ removeAdoptedStyleSheets(target, this.styleSheets);
1699
1729
  super.removeStylesFrom(target);
1700
1730
  }
1701
1731
  }