first commit

This commit is contained in:
Stefan Hacker
2026-04-03 09:38:48 +02:00
commit 37ad745546
47450 changed files with 3120798 additions and 0 deletions
+170
View File
@@ -0,0 +1,170 @@
# Change Log - @fluentui/react-portal-compat-context
This log was last generated on Thu, 02 Oct 2025 15:07:20 GMT and should not be manually modified.
<!-- Start content -->
## [9.0.15](https://github.com/microsoft/fluentui/tree/@fluentui/react-portal-compat-context_v9.0.15)
Thu, 02 Oct 2025 15:07:20 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-portal-compat-context_v9.0.14..@fluentui/react-portal-compat-context_v9.0.15)
### Patches
- feat: enforce usage of use client directive for files with client-only features ([PR #35173](https://github.com/microsoft/fluentui/pull/35173) by dmytrokirpa@microsoft.com)
## [9.0.14](https://github.com/microsoft/fluentui/tree/@fluentui/react-portal-compat-context_v9.0.14)
Mon, 08 Sep 2025 12:51:15 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-portal-compat-context_v9.0.13..@fluentui/react-portal-compat-context_v9.0.14)
### Patches
- chore: extend peer dependencies versions to support React 19 ([PR #35145](https://github.com/microsoft/fluentui/pull/35145) by dmytrokirpa@microsoft.com)
- chore: enforce explicit module boundary types ([PR #35080](https://github.com/microsoft/fluentui/pull/35080) by dmytrokirpa@microsoft.com)
## [9.0.13](https://github.com/microsoft/fluentui/tree/@fluentui/react-portal-compat-context_v9.0.13)
Mon, 11 Nov 2024 10:00:51 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-portal-compat-context_v9.0.12..@fluentui/react-portal-compat-context_v9.0.13)
### Patches
- chore: replace npm-scripts and just-scrtips with nx inferred tasks ([PR #33074](https://github.com/microsoft/fluentui/pull/33074) by martinhochel@microsoft.com)
## [9.0.12](https://github.com/microsoft/fluentui/tree/@fluentui/react-portal-compat-context_v9.0.12)
Mon, 15 Jul 2024 17:25:41 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-portal-compat-context_v9.0.11..@fluentui/react-portal-compat-context_v9.0.12)
### Patches
- fix: revert incorectly set npm versions in all packages ([PR #31937](https://github.com/microsoft/fluentui/pull/31937) by martinhochel@microsoft.com)
## [9.0.11](https://github.com/microsoft/fluentui/tree/@fluentui/react-portal-compat-context_v9.0.11)
Wed, 03 Jan 2024 09:26:43 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-portal-compat-context_v9.0.10..@fluentui/react-portal-compat-context_v9.0.11)
### Patches
- fix: re-introduce ecma transpilation to ES5 to make it work with v8 in ES5 only browsers ([PR #30053](https://github.com/microsoft/fluentui/pull/30053) by wfwf1997@gmail.com)
## [9.0.10](https://github.com/microsoft/fluentui/tree/@fluentui/react-portal-compat-context_v9.0.10)
Thu, 09 Nov 2023 17:29:40 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-portal-compat-context_v9.0.9..@fluentui/react-portal-compat-context_v9.0.10)
### Patches
- chore: use package.json#files setup instead of npmignore for all v9 libraries ([PR #29734](https://github.com/microsoft/fluentui/pull/29734) by martinhochel@microsoft.com)
## [9.0.9](https://github.com/microsoft/fluentui/tree/@fluentui/react-portal-compat-context_v9.0.9)
Tue, 26 Sep 2023 17:49:09 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-portal-compat-context_v9.0.8..@fluentui/react-portal-compat-context_v9.0.9)
### Patches
- chore: trigger manual version bump after broken release ([PR #29303](https://github.com/microsoft/fluentui/pull/29303) by yuanboxue@microsoft.com)
## [9.0.8](https://github.com/microsoft/fluentui/tree/@fluentui/react-portal-compat-context_v9.0.8)
Tue, 26 Sep 2023 15:31:52 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-portal-compat-context_v9.0.7..@fluentui/react-portal-compat-context_v9.0.8)
### Patches
- fix: bump swc core to mitigate transpilation memory leaks ([PR #29253](https://github.com/microsoft/fluentui/pull/29253) by martinhochel@microsoft.com)
## [9.0.7](https://github.com/microsoft/fluentui/tree/@fluentui/react-portal-compat-context_v9.0.7)
Tue, 05 Sep 2023 13:28:59 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-portal-compat-context_v9.0.6..@fluentui/react-portal-compat-context_v9.0.7)
### Patches
- bumps @swc/helpers version to 0.5.1 ([PR #28989](https://github.com/microsoft/fluentui/pull/28989) by bernardo.sunderhus@gmail.com)
- bumps react peer dependencies to v16.14.0 ([PR #28959](https://github.com/microsoft/fluentui/pull/28959) by bernardo.sunderhus@gmail.com)
## [9.0.6](https://github.com/microsoft/fluentui/tree/@fluentui/react-portal-compat-context_v9.0.6)
Fri, 12 May 2023 20:27:35 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-portal-compat-context_v9.0.5..@fluentui/react-portal-compat-context_v9.0.6)
### Patches
- chore: exclude .swcrc from being published ([PR #27740](https://github.com/microsoft/fluentui/pull/27740) by olfedias@microsoft.com)
## [9.0.5](https://github.com/microsoft/fluentui/tree/@fluentui/react-portal-compat-context_v9.0.5)
Tue, 21 Mar 2023 21:23:45 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-portal-compat-context_v9.0.4..@fluentui/react-portal-compat-context_v9.0.5)
### Patches
- fix: add node field to package.json exports map. ([PR #27154](https://github.com/microsoft/fluentui/pull/27154) by tristan.watanabe@gmail.com)
- chore: migrate to swc transpilation approach. ([PR #27250](https://github.com/microsoft/fluentui/pull/27250) by tristan.watanabe@gmail.com)
## [9.0.4](https://github.com/microsoft/fluentui/tree/@fluentui/react-portal-compat-context_v9.0.4)
Fri, 11 Nov 2022 14:57:32 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-portal-compat-context_v9.0.3..@fluentui/react-portal-compat-context_v9.0.4)
### Patches
- chore: Migrate to new package structure. ([PR #25481](https://github.com/microsoft/fluentui/pull/25481) by tristan.watanabe@gmail.com)
- fix: create valid export maps ([PR #25558](https://github.com/microsoft/fluentui/pull/25558) by martinhochel@microsoft.com)
## [9.0.3](https://github.com/microsoft/fluentui/tree/@fluentui/react-portal-compat-context_v9.0.3)
Thu, 20 Oct 2022 08:39:41 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-portal-compat-context_v9.0.2..@fluentui/react-portal-compat-context_v9.0.3)
### Patches
- chore: Bump react peer dependency to react 18. ([PR #25278](https://github.com/microsoft/fluentui/pull/25278) by mgodbolt@microsoft.com)
## [9.0.2](https://github.com/microsoft/fluentui/tree/@fluentui/react-portal-compat-context_v9.0.2)
Thu, 15 Sep 2022 09:49:16 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-portal-compat-context_v9.0.1..@fluentui/react-portal-compat-context_v9.0.2)
### Patches
- chore: fix no-context-default-value lint violations ([PR #24276](https://github.com/microsoft/fluentui/pull/24276) by lingfangao@hotmail.com)
## [9.0.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-portal-compat-context_v9.0.1)
Fri, 15 Jul 2022 18:27:27 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-portal-compat-context_v9.0.0..@fluentui/react-portal-compat-context_v9.0.1)
### Patches
- Added mechanism for marking fluent-compatibility packages ([PR #23923](https://github.com/microsoft/fluentui/pull/23923) by gcox@microsoft.com)
## [9.0.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-portal-compat-context_v9.0.0)
Tue, 28 Jun 2022 15:13:50 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-portal-compat-context_v9.0.0-rc.2..@fluentui/react-portal-compat-context_v9.0.0)
### Patches
- feat: Initial 9.0.0 release ([PR #23733](https://github.com/microsoft/fluentui/pull/23733) by lingfangao@hotmail.com)
## [9.0.0-rc.2](https://github.com/microsoft/fluentui/tree/@fluentui/react-portal-compat-context_v9.0.0-rc.2)
Mon, 23 May 2022 12:13:34 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-portal-compat-context_v9.0.0-rc.1..@fluentui/react-portal-compat-context_v9.0.0-rc.2)
### Changes
- feat: ship rolluped only dts ([PR #22828](https://github.com/microsoft/fluentui/pull/22828) by martinhochel@microsoft.com)
## [9.0.0-rc.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-portal-compat-context_v9.0.0-rc.1)
Wed, 04 May 2022 13:26:46 GMT
### Changes
- initial release ([PR #22510](https://github.com/microsoft/fluentui/pull/22510) by olfedias@microsoft.com)
+15
View File
@@ -0,0 +1,15 @@
@fluentui/react-portal-compat-context
Copyright (c) Microsoft Corporation
All rights reserved.
MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ""Software""), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Note: Usage of the fonts and icons referenced in Fluent UI React is subject to the terms listed at https://aka.ms/fluentui-assets-license
+48
View File
@@ -0,0 +1,48 @@
# @fluentui/react-portal-compat-context
This package contains the React Context for compat layer in `@fluentui/react-portal-compat`.
### Installation
```sh
yarn add @fluentui/react-portal-compat-context
```
### Usage
> **Note:** These APIs are intended to be used by library developers, please use `@fluentui/react-portal-compat` if you need Portal compatibility.
>
> `PortalCompatContextProvider` and `usePortalCompat()` are exported APIs for implementing compat layer.
```tsx
import { PortalCompatContextProvider, usePortalCompat } from '@fluentui/react-portal-compat-context';
function Consumer() {
const registerEl = usePortalCompat();
React.useEffect(() => {
const portalEl = document.createElement('div');
return registerEl(portalEl);
}, [registerEl]);
return null;
}
function App() {
const registerEl = React.useCallback((portalEl: HTMLElement) => {
// do something...
console.log(portalEl);
return () => {
// do something for cleanups...
};
}, []);
return (
<PortalCompatContextProvider value={registerEl}>
<Consumer />
</PortalCompatContextProvider>
);
}
```
+9
View File
@@ -0,0 +1,9 @@
import * as React_2 from 'react';
export declare const PortalCompatContextProvider: React_2.Provider<RegisterPortalFn>;
export declare type RegisterPortalFn = (el: HTMLElement) => () => void;
export declare function usePortalCompat(): RegisterPortalFn;
export { }
@@ -0,0 +1,38 @@
define([
"require",
"exports",
"@swc/helpers/_/_interop_require_wildcard",
"react"
], function(require, exports, _interop_require_wildcard, _react) {
'use client';
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
PortalCompatContextProvider: function() {
return PortalCompatContextProvider;
},
usePortalCompat: function() {
return usePortalCompat;
}
});
_react = /*#__PURE__*/ _interop_require_wildcard._(_react);
var PortalCompatContext = _react.createContext(undefined);
var portalCompatContextDefaultValue = function() {
return function() {
return undefined;
};
};
var PortalCompatContextProvider = PortalCompatContext.Provider;
function usePortalCompat() {
var _React_useContext;
return (_React_useContext = _react.useContext(PortalCompatContext)) !== null && _React_useContext !== void 0 ? _React_useContext : portalCompatContextDefaultValue;
}
});
@@ -0,0 +1 @@
{"version":3,"sources":["../src/PortalCompatContext.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport type { RegisterPortalFn } from './types';\n\nconst PortalCompatContext = React.createContext<RegisterPortalFn | undefined>(\n undefined,\n) as React.Context<RegisterPortalFn>;\n\nconst portalCompatContextDefaultValue = () => () => undefined;\n\nexport const PortalCompatContextProvider = PortalCompatContext.Provider;\n\nexport function usePortalCompat(): RegisterPortalFn {\n return React.useContext(PortalCompatContext) ?? portalCompatContextDefaultValue;\n}\n"],"names":["PortalCompatContextProvider","usePortalCompat","PortalCompatContext","React","createContext","undefined","portalCompatContextDefaultValue","Provider","useContext"],"mappings":";;;;IAEuB;;IAFvB;;;;;;;;;;;;QAWaA,2BAA2B;mBAA3BA;;QAEGC,eAAe;mBAAfA;;;;IARhB,IAAMC,sBAAsBC,OAAMC,aAAa,CAC7CC;IAGF,IAAMC,kCAAkC;eAAM;mBAAMD;;;IAE7C,IAAML,8BAA8BE,oBAAoBK,QAAQ;IAEhE,SAASN;YACPE;QAAP,OAAOA,CAAAA,oBAAAA,OAAMK,UAAU,CAACN,kCAAjBC,+BAAAA,oBAAyCG;IAClD"}
+24
View File
@@ -0,0 +1,24 @@
define([
"require",
"exports",
"./PortalCompatContext"
], function(require, exports, _PortalCompatContext) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
PortalCompatContextProvider: function() {
return _PortalCompatContext.PortalCompatContextProvider;
},
usePortalCompat: function() {
return _PortalCompatContext.usePortalCompat;
}
});
});
@@ -0,0 +1 @@
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export { PortalCompatContextProvider, usePortalCompat } from './PortalCompatContext';\nexport type { RegisterPortalFn } from './types';\n"],"names":["PortalCompatContextProvider","usePortalCompat"],"mappings":";;;IAA6D;;;;;;;;;;;;;QAApDA,2BAA2B;mBAA3BA,gDAA2B;;QAAEC,eAAe;mBAAfA,oCAAe"}
+9
View File
@@ -0,0 +1,9 @@
define([
"require",
"exports"
], function(require, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
});
@@ -0,0 +1 @@
{"version":3,"sources":[],"names":[],"mappings":""}
@@ -0,0 +1,32 @@
'use client';
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
PortalCompatContextProvider: function() {
return PortalCompatContextProvider;
},
usePortalCompat: function() {
return usePortalCompat;
}
});
var _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
var _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
var PortalCompatContext = _react.createContext(undefined);
var portalCompatContextDefaultValue = function() {
return function() {
return undefined;
};
};
var PortalCompatContextProvider = PortalCompatContext.Provider;
function usePortalCompat() {
var _React_useContext;
return (_React_useContext = _react.useContext(PortalCompatContext)) !== null && _React_useContext !== void 0 ? _React_useContext : portalCompatContextDefaultValue;
}
@@ -0,0 +1 @@
{"version":3,"sources":["../src/PortalCompatContext.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport type { RegisterPortalFn } from './types';\n\nconst PortalCompatContext = React.createContext<RegisterPortalFn | undefined>(\n undefined,\n) as React.Context<RegisterPortalFn>;\n\nconst portalCompatContextDefaultValue = () => () => undefined;\n\nexport const PortalCompatContextProvider = PortalCompatContext.Provider;\n\nexport function usePortalCompat(): RegisterPortalFn {\n return React.useContext(PortalCompatContext) ?? portalCompatContextDefaultValue;\n}\n"],"names":["PortalCompatContextProvider","usePortalCompat","PortalCompatContext","React","createContext","undefined","portalCompatContextDefaultValue","Provider","useContext"],"mappings":"AAAA;;;;;;;;;;;;IAWaA,2BAA2B;eAA3BA;;IAEGC,eAAe;eAAfA;;;;+DAXO;AAGvB,IAAMC,sBAAsBC,OAAMC,aAAa,CAC7CC;AAGF,IAAMC,kCAAkC;WAAM;eAAMD;;;AAE7C,IAAML,8BAA8BE,oBAAoBK,QAAQ;AAEhE,SAASN;QACPE;IAAP,OAAOA,CAAAA,oBAAAA,OAAMK,UAAU,CAACN,kCAAjBC,+BAAAA,oBAAyCG;AAClD"}
@@ -0,0 +1,19 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
PortalCompatContextProvider: function() {
return _PortalCompatContext.PortalCompatContextProvider;
},
usePortalCompat: function() {
return _PortalCompatContext.usePortalCompat;
}
});
var _PortalCompatContext = require("./PortalCompatContext");
@@ -0,0 +1 @@
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export { PortalCompatContextProvider, usePortalCompat } from './PortalCompatContext';\nexport type { RegisterPortalFn } from './types';\n"],"names":["PortalCompatContextProvider","usePortalCompat"],"mappings":";;;;;;;;;;;IAASA,2BAA2B;eAA3BA,gDAA2B;;IAAEC,eAAe;eAAfA,oCAAe;;;mCAAQ"}
@@ -0,0 +1,4 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
@@ -0,0 +1 @@
{"version":3,"sources":[],"names":[],"mappings":""}
@@ -0,0 +1,13 @@
'use client';
import * as React from 'react';
var PortalCompatContext = React.createContext(undefined);
var portalCompatContextDefaultValue = function() {
return function() {
return undefined;
};
};
export var PortalCompatContextProvider = PortalCompatContext.Provider;
export function usePortalCompat() {
var _React_useContext;
return (_React_useContext = React.useContext(PortalCompatContext)) !== null && _React_useContext !== void 0 ? _React_useContext : portalCompatContextDefaultValue;
}
@@ -0,0 +1 @@
{"version":3,"sources":["../src/PortalCompatContext.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport type { RegisterPortalFn } from './types';\n\nconst PortalCompatContext = React.createContext<RegisterPortalFn | undefined>(\n undefined,\n) as React.Context<RegisterPortalFn>;\n\nconst portalCompatContextDefaultValue = () => () => undefined;\n\nexport const PortalCompatContextProvider = PortalCompatContext.Provider;\n\nexport function usePortalCompat(): RegisterPortalFn {\n return React.useContext(PortalCompatContext) ?? portalCompatContextDefaultValue;\n}\n"],"names":["React","PortalCompatContext","createContext","undefined","portalCompatContextDefaultValue","PortalCompatContextProvider","Provider","usePortalCompat","useContext"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAG/B,IAAMC,sBAAsBD,MAAME,aAAa,CAC7CC;AAGF,IAAMC,kCAAkC;WAAM;eAAMD;;;AAEpD,OAAO,IAAME,8BAA8BJ,oBAAoBK,QAAQ,CAAC;AAExE,OAAO,SAASC;QACPP;IAAP,OAAOA,CAAAA,oBAAAA,MAAMQ,UAAU,CAACP,kCAAjBD,+BAAAA,oBAAyCI;AAClD"}
+1
View File
@@ -0,0 +1 @@
export { PortalCompatContextProvider, usePortalCompat } from './PortalCompatContext';
+1
View File
@@ -0,0 +1 @@
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export { PortalCompatContextProvider, usePortalCompat } from './PortalCompatContext';\nexport type { RegisterPortalFn } from './types';\n"],"names":["PortalCompatContextProvider","usePortalCompat"],"mappings":"AAAA,SAASA,2BAA2B,EAAEC,eAAe,QAAQ,wBAAwB"}
+1
View File
@@ -0,0 +1 @@
export { };
+1
View File
@@ -0,0 +1 @@
{"version":3,"sources":["../src/types.ts"],"sourcesContent":["export type RegisterPortalFn = (el: HTMLElement) => () => void;\n"],"names":[],"mappings":"AAAA,WAA+D"}
+47
View File
@@ -0,0 +1,47 @@
{
"name": "@fluentui/react-portal-compat-context",
"version": "9.0.15",
"description": "A package that holds React context for compatibility of React Contexts",
"main": "lib-commonjs/index.js",
"module": "lib/index.js",
"typings": "./dist/index.d.ts",
"sideEffects": false,
"repository": {
"type": "git",
"url": "https://github.com/microsoft/fluentui"
},
"license": "MIT",
"devDependencies": {
"@fluentui/eslint-plugin": "*",
"@fluentui/scripts-api-extractor": "*"
},
"dependencies": {
"@swc/helpers": "^0.5.1"
},
"peerDependencies": {
"@types/react": ">=16.14.0 <20.0.0",
"react": ">=16.14.0 <20.0.0"
},
"beachball": {
"disallowedChangeTypes": [
"major",
"prerelease"
]
},
"exports": {
".": {
"types": "./dist/index.d.ts",
"node": "./lib-commonjs/index.js",
"import": "./lib/index.js",
"require": "./lib-commonjs/index.js"
},
"./package.json": "./package.json"
},
"files": [
"*.md",
"dist/*.d.ts",
"lib",
"lib-amd",
"lib-commonjs"
]
}