@fluentui/react-portal-compat 9.0.4 → 9.0.5

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,36 @@
2
2
  "name": "@fluentui/react-portal-compat",
3
3
  "entries": [
4
4
  {
5
- "date": "Fri, 15 Jul 2022 18:27:18 GMT",
5
+ "date": "Wed, 03 Aug 2022 16:00:21 GMT",
6
+ "tag": "@fluentui/react-portal-compat_v9.0.5",
7
+ "version": "9.0.5",
8
+ "comments": {
9
+ "none": [
10
+ {
11
+ "author": "lingfangao@hotmail.com",
12
+ "package": "@fluentui/react-portal-compat",
13
+ "commit": "99cc385631d04a76ee10ebc143cb9fecd99640b6",
14
+ "comment": "chore: Add `prerelease` as disallowed changetype for 9.0.0 packages"
15
+ }
16
+ ],
17
+ "patch": [
18
+ {
19
+ "author": "lingfangao@hotmail.com",
20
+ "package": "@fluentui/react-portal-compat",
21
+ "commit": "6731ada047afe1d79d2765d1464cfa9acb90bee8",
22
+ "comment": "chore: enable AMD compatible build"
23
+ },
24
+ {
25
+ "author": "beachball",
26
+ "package": "@fluentui/react-portal-compat",
27
+ "comment": "Bump @fluentui/react-components to v9.2.0",
28
+ "commit": "54bc6105c5c9c9023da35d4670239e44117ed4a5"
29
+ }
30
+ ]
31
+ }
32
+ },
33
+ {
34
+ "date": "Fri, 15 Jul 2022 18:27:27 GMT",
6
35
  "tag": "@fluentui/react-portal-compat_v9.0.4",
7
36
  "version": "9.0.4",
8
37
  "comments": {
@@ -11,7 +40,7 @@
11
40
  "author": "beachball",
12
41
  "package": "@fluentui/react-portal-compat",
13
42
  "comment": "Bump @fluentui/react-portal-compat-context to v9.0.1",
14
- "commit": "9252601953bb2462fec25d22748149665868fb89"
43
+ "commit": "2856f2716508b8175803fca54523b70b6d9c8a66"
15
44
  }
16
45
  ]
17
46
  }
package/CHANGELOG.md CHANGED
@@ -1,17 +1,27 @@
1
1
  # Change Log - @fluentui/react-portal-compat
2
2
 
3
- This log was last generated on Fri, 15 Jul 2022 18:27:18 GMT and should not be manually modified.
3
+ This log was last generated on Wed, 03 Aug 2022 16:00:21 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## [9.0.5](https://github.com/microsoft/fluentui/tree/@fluentui/react-portal-compat_v9.0.5)
8
+
9
+ Wed, 03 Aug 2022 16:00:21 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-portal-compat_v9.0.4..@fluentui/react-portal-compat_v9.0.5)
11
+
12
+ ### Patches
13
+
14
+ - chore: enable AMD compatible build ([PR #24052](https://github.com/microsoft/fluentui/pull/24052) by lingfangao@hotmail.com)
15
+ - Bump @fluentui/react-components to v9.2.0 ([PR #24201](https://github.com/microsoft/fluentui/pull/24201) by beachball)
16
+
7
17
  ## [9.0.4](https://github.com/microsoft/fluentui/tree/@fluentui/react-portal-compat_v9.0.4)
8
18
 
9
- Fri, 15 Jul 2022 18:27:18 GMT
19
+ Fri, 15 Jul 2022 18:27:27 GMT
10
20
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-portal-compat_v9.0.3..@fluentui/react-portal-compat_v9.0.4)
11
21
 
12
22
  ### Patches
13
23
 
14
- - Bump @fluentui/react-portal-compat-context to v9.0.1 ([PR #23923](https://github.com/microsoft/fluentui/pull/23923) by beachball)
24
+ - Bump @fluentui/react-portal-compat-context to v9.0.1 ([PR #23936](https://github.com/microsoft/fluentui/pull/23936) by beachball)
15
25
 
16
26
  ## [9.0.3](https://github.com/microsoft/fluentui/tree/@fluentui/react-portal-compat_v9.0.3)
17
27
 
@@ -0,0 +1,28 @@
1
+ define(["require", "exports", "react", "@fluentui/react-components", "@fluentui/react-portal-compat-context"], function (require, exports, React, react_components_1, react_portal_compat_context_1) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.PortalCompatProvider = void 0;
5
+ var CLASS_NAME_REGEX = new RegExp("(" + react_components_1.fluentProviderClassNames.root + "\\d+)");
6
+ var PortalCompatProvider = function (props) {
7
+ var children = props.children;
8
+ var themeClassName = react_components_1.useThemeClassName();
9
+ var cssVariablesClassName = React.useMemo(
10
+ // "themeClassName" may contain multiple classes while we want to add only a class that hosts CSS variables
11
+ // Keep in sync with "packages/react-provider/src/components/FluentProvider/useFluentProviderThemeStyleTag.ts"
12
+ function () { var _a; return (_a = themeClassName.match(CLASS_NAME_REGEX)) === null || _a === void 0 ? void 0 : _a[1]; }, [themeClassName]);
13
+ var registerPortalEl = React.useCallback(function (element) {
14
+ if (cssVariablesClassName) {
15
+ element.classList.add(cssVariablesClassName);
16
+ }
17
+ return function () {
18
+ if (cssVariablesClassName) {
19
+ element.classList.remove(cssVariablesClassName);
20
+ }
21
+ };
22
+ }, [cssVariablesClassName]);
23
+
24
+ return React.createElement(react_portal_compat_context_1.PortalCompatContextProvider, { value: registerPortalEl }, children);
25
+ };
26
+ exports.PortalCompatProvider = PortalCompatProvider;
27
+ });
28
+ //# sourceMappingURL=PortalCompatProvider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PortalCompatProvider.js","sourceRoot":"../src/","sources":["PortalCompatProvider.tsx"],"names":[],"mappings":";;;;IAMA,IAAM,gBAAgB,GAAG,IAAI,MAAM,CAAC,MAAI,2CAAwB,CAAC,IAAI,UAAO,CAAC,CAAC;IAEvE,IAAM,oBAAoB,GAAa,UAAA,KAAK;QACzC,IAAA,QAAQ,GAAK,KAAK,SAAV,CAAW;QAE3B,IAAM,cAAc,GAAG,oCAAiB,EAAE,CAAC;QAC3C,IAAM,qBAAqB,GAAG,KAAK,CAAC,OAAO;QACzC,2GAA2G;QAC3G,8GAA8G;QAC9G,sBAAM,OAAA,MAAA,cAAc,CAAC,KAAK,CAAC,gBAAgB,CAAC,0CAAG,CAAC,CAAC,CAAA,EAAA,EACjD,CAAC,cAAc,CAAC,CACjB,CAAC;QAEF,IAAM,gBAAgB,GAAG,KAAK,CAAC,WAAW,CACxC,UAAA,OAAO;YACL,IAAI,qBAAqB,EAAE;gBACzB,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAC;aAC9C;YAED,OAAO;gBACL,IAAI,qBAAqB,EAAE;oBACzB,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC,qBAAqB,CAAC,CAAC;iBACjD;YACH,CAAC,CAAC;QACJ,CAAC,EACD,CAAC,qBAAqB,CAAC,CACxB,CAAC;QAEF,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,EAAE;YACzC,+GAA+G;YAC/G,sDAAsD;YACtD,KAAK,CAAC,SAAS,CAAC;gBACd,IAAI,cAAc,KAAK,EAAE,EAAE;oBACzB,sCAAsC;oBACtC,OAAO,CAAC,IAAI,CAAC,uPAId,CAAC,CAAC;iBACF;gBACD,uDAAuD;YACzD,CAAC,EAAE,EAAE,CAAC,CAAC;SACR;QAED,OAAO,oBAAC,yDAA2B,IAAC,KAAK,EAAE,gBAAgB,IAAG,QAAQ,CAA+B,CAAC;IACxG,CAAC,CAAC;IA3CW,QAAA,oBAAoB,wBA2C/B","sourcesContent":["import * as React from 'react';\nimport { fluentProviderClassNames, useThemeClassName } from '@fluentui/react-components';\nimport { PortalCompatContextProvider } from '@fluentui/react-portal-compat-context';\n\nimport type { RegisterPortalFn } from '@fluentui/react-portal-compat-context';\n\nconst CLASS_NAME_REGEX = new RegExp(`(${fluentProviderClassNames.root}\\\\d+)`);\n\nexport const PortalCompatProvider: React.FC = props => {\n const { children } = props;\n\n const themeClassName = useThemeClassName();\n const cssVariablesClassName = React.useMemo<string | undefined>(\n // \"themeClassName\" may contain multiple classes while we want to add only a class that hosts CSS variables\n // Keep in sync with \"packages/react-provider/src/components/FluentProvider/useFluentProviderThemeStyleTag.ts\"\n () => themeClassName.match(CLASS_NAME_REGEX)?.[1],\n [themeClassName],\n );\n\n const registerPortalEl = React.useCallback<RegisterPortalFn>(\n element => {\n if (cssVariablesClassName) {\n element.classList.add(cssVariablesClassName);\n }\n\n return () => {\n if (cssVariablesClassName) {\n element.classList.remove(cssVariablesClassName);\n }\n };\n },\n [cssVariablesClassName],\n );\n\n if (process.env.NODE_ENV !== 'production') {\n // This if statement technically breaks the rules of hooks, but ENV variables never change during app lifecycle\n // eslint-disable-next-line react-hooks/rules-of-hooks\n React.useEffect(() => {\n if (themeClassName === '') {\n // eslint-disable-next-line no-console\n console.warn(`\n PortalCompatProvider: \"useThemeClassName()\" hook returned an empty string\n =============================================\n Make sure that PortalCompatProvider is rendered inside FluentProvider as a child.\n `);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n }\n\n return <PortalCompatContextProvider value={registerPortalEl}>{children}</PortalCompatContextProvider>;\n};\n"]}
@@ -0,0 +1,7 @@
1
+ define(["require", "exports", "./PortalCompatProvider"], function (require, exports, PortalCompatProvider_1) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.PortalCompatProvider = void 0;
5
+ Object.defineProperty(exports, "PortalCompatProvider", { enumerable: true, get: function () { return PortalCompatProvider_1.PortalCompatProvider; } });
6
+ });
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"../src/","sources":["index.ts"],"names":[],"mappings":";;;;IAAS,4HAAA,oBAAoB,OAAA","sourcesContent":["export { PortalCompatProvider } from './PortalCompatProvider';\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui/react-portal-compat",
3
- "version": "9.0.4",
3
+ "version": "9.0.5",
4
4
  "description": "A package that contains compatibility layer for React Portals",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "module": "lib/index.js",
@@ -12,11 +12,11 @@
12
12
  },
13
13
  "license": "MIT",
14
14
  "scripts": {
15
- "build": "just-scripts build",
15
+ "build": "just-scripts build --module esm,cjs,amd",
16
16
  "clean": "just-scripts clean",
17
17
  "code-style": "just-scripts code-style",
18
18
  "just": "just-scripts",
19
- "lint": "just-scripts lint",
19
+ "lint": "just-scripts lint && just-scripts lint-imports",
20
20
  "start": "yarn storybook",
21
21
  "test": "jest --passWithNoTests",
22
22
  "docs": "api-extractor run --config=config/api-extractor.local.json --local",
@@ -26,7 +26,7 @@
26
26
  },
27
27
  "devDependencies": {
28
28
  "@fluentui/eslint-plugin": "*",
29
- "@fluentui/react-components": "^9.1.1",
29
+ "@fluentui/react-components": "^9.2.0",
30
30
  "@fluentui/react-shared-contexts": "^9.0.0",
31
31
  "@fluentui/scripts": "^1.0.0"
32
32
  },
@@ -35,13 +35,14 @@
35
35
  "tslib": "^2.1.0"
36
36
  },
37
37
  "peerDependencies": {
38
- "@fluentui/react-components": "^9.1.1",
38
+ "@fluentui/react-components": "^9.2.0",
39
39
  "@types/react": ">=16.8.0 <18.0.0",
40
40
  "react": ">=16.8.0 <18.0.0"
41
41
  },
42
42
  "beachball": {
43
43
  "disallowedChangeTypes": [
44
- "major"
44
+ "major",
45
+ "prerelease"
45
46
  ]
46
47
  }
47
48
  }