@fluentui/global-context 9.0.0-beta.21 → 9.0.0-beta.23

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/.swcrc ADDED
@@ -0,0 +1,30 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/swcrc",
3
+ "exclude": [
4
+ "/testing",
5
+ "/**/*.cy.ts",
6
+ "/**/*.cy.tsx",
7
+ "/**/*.spec.ts",
8
+ "/**/*.spec.tsx",
9
+ "/**/*.test.ts",
10
+ "/**/*.test.tsx"
11
+ ],
12
+ "jsc": {
13
+ "parser": {
14
+ "syntax": "typescript",
15
+ "tsx": true,
16
+ "decorators": false,
17
+ "dynamicImport": false
18
+ },
19
+ "externalHelpers": true,
20
+ "transform": {
21
+ "react": {
22
+ "runtime": "classic",
23
+ "useSpread": true
24
+ }
25
+ },
26
+ "target": "es2019"
27
+ },
28
+ "minify": false,
29
+ "sourceMaps": true
30
+ }
package/CHANGELOG.json CHANGED
@@ -2,7 +2,61 @@
2
2
  "name": "@fluentui/global-context",
3
3
  "entries": [
4
4
  {
5
- "date": "Thu, 16 Mar 2023 14:33:33 GMT",
5
+ "date": "Tue, 04 Apr 2023 18:42:19 GMT",
6
+ "tag": "@fluentui/global-context_v9.0.0-beta.23",
7
+ "version": "9.0.0-beta.23",
8
+ "comments": {
9
+ "prerelease": [
10
+ {
11
+ "author": "beachball",
12
+ "package": "@fluentui/global-context",
13
+ "comment": "Bump @fluentui/react-context-selector to v9.1.16",
14
+ "commit": "37a3a6eda1fd41086edd99a0b1560a8740f8c6c5"
15
+ },
16
+ {
17
+ "author": "beachball",
18
+ "package": "@fluentui/global-context",
19
+ "comment": "Bump @fluentui/react-utilities to v9.7.3",
20
+ "commit": "37a3a6eda1fd41086edd99a0b1560a8740f8c6c5"
21
+ }
22
+ ]
23
+ }
24
+ },
25
+ {
26
+ "date": "Tue, 21 Mar 2023 21:23:18 GMT",
27
+ "tag": "@fluentui/global-context_v9.0.0-beta.22",
28
+ "version": "9.0.0-beta.22",
29
+ "comments": {
30
+ "prerelease": [
31
+ {
32
+ "author": "tristan.watanabe@gmail.com",
33
+ "package": "@fluentui/global-context",
34
+ "commit": "2fac1a139149bd13b76b1306207bc988dca9c72c",
35
+ "comment": "chore: migrate to swc transpilation approach."
36
+ },
37
+ {
38
+ "author": "tristan.watanabe@gmail.com",
39
+ "package": "@fluentui/global-context",
40
+ "commit": "ead1c6d4c2ac3f3596b62b8cbc07b0a03041f11f",
41
+ "comment": "fix: add node field to package.json exports map."
42
+ },
43
+ {
44
+ "author": "beachball",
45
+ "package": "@fluentui/global-context",
46
+ "comment": "Bump @fluentui/react-context-selector to v9.1.15",
47
+ "commit": "b7a26f6263c80e3253c6b8338c33b73bae33e2b5"
48
+ },
49
+ {
50
+ "author": "beachball",
51
+ "package": "@fluentui/global-context",
52
+ "comment": "Bump @fluentui/react-utilities to v9.7.2",
53
+ "commit": "b7a26f6263c80e3253c6b8338c33b73bae33e2b5"
54
+ }
55
+ ]
56
+ }
57
+ },
58
+ {
59
+ "date": "Thu, 16 Mar 2023 14:36:59 GMT",
6
60
  "tag": "@fluentui/global-context_v9.0.0-beta.21",
7
61
  "version": "9.0.0-beta.21",
8
62
  "comments": {
package/CHANGELOG.md CHANGED
@@ -1,12 +1,34 @@
1
1
  # Change Log - @fluentui/global-context
2
2
 
3
- This log was last generated on Thu, 16 Mar 2023 14:33:33 GMT and should not be manually modified.
3
+ This log was last generated on Tue, 04 Apr 2023 18:42:19 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## [9.0.0-beta.23](https://github.com/microsoft/fluentui/tree/@fluentui/global-context_v9.0.0-beta.23)
8
+
9
+ Tue, 04 Apr 2023 18:42:19 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/global-context_v9.0.0-beta.22..@fluentui/global-context_v9.0.0-beta.23)
11
+
12
+ ### Changes
13
+
14
+ - Bump @fluentui/react-context-selector to v9.1.16 ([PR #27430](https://github.com/microsoft/fluentui/pull/27430) by beachball)
15
+ - Bump @fluentui/react-utilities to v9.7.3 ([PR #27430](https://github.com/microsoft/fluentui/pull/27430) by beachball)
16
+
17
+ ## [9.0.0-beta.22](https://github.com/microsoft/fluentui/tree/@fluentui/global-context_v9.0.0-beta.22)
18
+
19
+ Tue, 21 Mar 2023 21:23:18 GMT
20
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/global-context_v9.0.0-beta.21..@fluentui/global-context_v9.0.0-beta.22)
21
+
22
+ ### Changes
23
+
24
+ - chore: migrate to swc transpilation approach. ([PR #27250](https://github.com/microsoft/fluentui/pull/27250) by tristan.watanabe@gmail.com)
25
+ - fix: add node field to package.json exports map. ([PR #27154](https://github.com/microsoft/fluentui/pull/27154) by tristan.watanabe@gmail.com)
26
+ - Bump @fluentui/react-context-selector to v9.1.15 ([PR #27271](https://github.com/microsoft/fluentui/pull/27271) by beachball)
27
+ - Bump @fluentui/react-utilities to v9.7.2 ([PR #27271](https://github.com/microsoft/fluentui/pull/27271) by beachball)
28
+
7
29
  ## [9.0.0-beta.21](https://github.com/microsoft/fluentui/tree/@fluentui/global-context_v9.0.0-beta.21)
8
30
 
9
- Thu, 16 Mar 2023 14:33:33 GMT
31
+ Thu, 16 Mar 2023 14:36:59 GMT
10
32
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/global-context_v9.0.0-beta.20..@fluentui/global-context_v9.0.0-beta.21)
11
33
 
12
34
  ### Changes
@@ -1,3 +1,4 @@
1
+ import * as React from 'react';
1
2
  import { createContext as baseCreateContext } from '@fluentui/react-context-selector';
2
3
  import { canUseDOM } from '@fluentui/react-utilities';
3
4
  import { getMajorVersion } from './utils';
@@ -11,8 +12,8 @@ export const SYMBOL_NAMESPACE = 'global-context-selector:';
11
12
  if (!isBrowser && process.env.NODE_ENV !== 'production') {
12
13
  const globalSymbols = /*#__PURE__*/Object.getOwnPropertySymbols(globalObject);
13
14
  globalSymbols.forEach(sym => {
14
- var _a;
15
- if ((_a = Symbol.keyFor(sym)) === null || _a === void 0 ? void 0 : _a.startsWith(SYMBOL_NAMESPACE)) {
15
+ var _Symbol_keyFor;
16
+ if ((_Symbol_keyFor = Symbol.keyFor(sym)) === null || _Symbol_keyFor === void 0 ? void 0 : _Symbol_keyFor.startsWith(SYMBOL_NAMESPACE)) {
16
17
  // @ts-expect-error - Indexing object with symbols not supported until TS 4.4
17
18
  delete globalObject[sym];
18
19
  }
@@ -1 +1 @@
1
- {"version":3,"names":["createContext","baseCreateContext","canUseDOM","getMajorVersion","isBrowser","globalObject","window","global","SYMBOL_NAMESPACE","process","env","NODE_ENV","globalSymbols","Object","getOwnPropertySymbols","forEach","sym","_a","Symbol","keyFor","startsWith","defaultValue","name","packageName","packageVersion","for","includes"],"sources":["../src/packages/react-components/global-context/src/global-context-selector.ts"],"sourcesContent":["import * as React from 'react';\nimport { createContext as baseCreateContext } from '@fluentui/react-context-selector';\nimport { canUseDOM } from '@fluentui/react-utilities';\nimport { getMajorVersion } from './utils';\nimport { GlobalObject } from './types';\n\nconst isBrowser = canUseDOM();\nconst globalObject: GlobalObject = isBrowser ? window : global;\n\n// Identifier for the symbol, for easy idenfitifaction of symbols created by this util\n// Useful for clearning global object during SSR reloads\nexport const SYMBOL_NAMESPACE = 'global-context-selector:';\n\n// During SSR the global object persists with the server process\n// Clean out the global object during server reload during development\nif (!isBrowser && process.env.NODE_ENV !== 'production') {\n const globalSymbols = Object.getOwnPropertySymbols(globalObject);\n globalSymbols.forEach(sym => {\n if (Symbol.keyFor(sym)?.startsWith(SYMBOL_NAMESPACE)) {\n // @ts-expect-error - Indexing object with symbols not supported until TS 4.4\n delete globalObject[sym];\n }\n });\n}\n\n/**\n * Wrapper around @see createContext from \\@fluentui/react-context-selector that implements context registration\n * in the globalThis object to avoid duplicate contexts. Contexts are keyed with\n * a unique sybmol for the package name, version and name of the context.\n *\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol}\n *\n * @param defaultValue - @see React.createContext\n * @param name - name of the context\n * @param packageName - name of the npm package where the module is used\n * @param packageVersion - version of the npm package where the module is used\n * @returns @see React.createContext\n */\nexport const createContext = <T>(defaultValue: T, name: string, packageName: string, packageVersion: string) => {\n // Symbol guaranteed to be unique for the entire runtime\n const sym = Symbol.for(`${SYMBOL_NAMESPACE}${packageName}/${name}/@${getMajorVersion(packageVersion)}`);\n\n // Objects keyed with symbols are not visible with console.log\n // Object symbol properties can't be iterated with `for` or `Object.keys`\n const globalSymbols = Object.getOwnPropertySymbols(globalObject);\n if (!globalSymbols.includes(sym)) {\n // @ts-expect-error - Indexing object with symbols not supported until TS 4.4\n // eslint-disable-next-line @fluentui/no-context-default-value\n globalObject[sym] = baseCreateContext(defaultValue);\n }\n\n // @ts-expect-error - Indexing object with symbols not supported until TS 4.4\n return globalObject[sym] as React.Context<T>;\n};\n"],"mappings":"AACA,SAASA,aAAa,IAAIC,iBAAiB,QAAQ,kCAAkC;AACrF,SAASC,SAAS,QAAQ,2BAA2B;AACrD,SAASC,eAAe,QAAQ,SAAS;AAGzC,MAAMC,SAAS,gBAAGF,SAAS,EAAE;AAC7B,MAAMG,YAAY,GAAiBD,SAAS,GAAGE,MAAM,GAAGC,MAAM;AAE9D;AACA;AACA,OAAO,MAAMC,gBAAgB,GAAG,0BAA0B;AAE1D;AACA;AACA,IAAI,CAACJ,SAAS,IAAIK,OAAO,CAACC,GAAG,CAACC,QAAQ,KAAK,YAAY,EAAE;EACvD,MAAMC,aAAa,gBAAGC,MAAM,CAACC,qBAAqB,CAACT,YAAY,CAAC;EAChEO,aAAa,CAACG,OAAO,CAACC,GAAG,IAAG;;IAC1B,IAAI,CAAAC,EAAA,GAAAC,MAAM,CAACC,MAAM,CAACH,GAAG,CAAC,cAAAC,EAAA,uBAAAA,EAAA,CAAEG,UAAU,CAACZ,gBAAgB,CAAC,EAAE;MACpD;MACA,OAAOH,YAAY,CAACW,GAAG,CAAC;;EAE5B,CAAC,CAAC;;AAGJ;;;;;;;;;;;;;AAaA,OAAO,MAAMhB,aAAa,GAAGA,CAAIqB,YAAe,EAAEC,IAAY,EAAEC,WAAmB,EAAEC,cAAsB,KAAI;EAC7G;EACA,MAAMR,GAAG,GAAGE,MAAM,CAACO,GAAG,CAAC,GAAGjB,gBAAgB,GAAGe,WAAW,IAAID,IAAI,KAAKnB,eAAe,CAACqB,cAAc,CAAC,EAAE,CAAC;EAEvG;EACA;EACA,MAAMZ,aAAa,GAAGC,MAAM,CAACC,qBAAqB,CAACT,YAAY,CAAC;EAChE,IAAI,CAACO,aAAa,CAACc,QAAQ,CAACV,GAAG,CAAC,EAAE;IAChC;IACA;IACAX,YAAY,CAACW,GAAG,CAAC,GAAGf,iBAAiB,CAACoB,YAAY,CAAC;;EAGrD;EACA,OAAOhB,YAAY,CAACW,GAAG,CAAqB;AAC9C,CAAC"}
1
+ {"version":3,"names":["React","createContext","baseCreateContext","canUseDOM","getMajorVersion","isBrowser","globalObject","window","global","SYMBOL_NAMESPACE","process","env","NODE_ENV","globalSymbols","Object","getOwnPropertySymbols","forEach","sym","_Symbol_keyFor","Symbol","keyFor","startsWith","defaultValue","name","packageName","packageVersion","for","includes"],"sources":["../src/global-context-selector.ts"],"sourcesContent":["import * as React from 'react';\nimport { createContext as baseCreateContext } from '@fluentui/react-context-selector';\nimport { canUseDOM } from '@fluentui/react-utilities';\nimport { getMajorVersion } from './utils';\nimport { GlobalObject } from './types';\n\nconst isBrowser = canUseDOM();\nconst globalObject: GlobalObject = isBrowser ? window : global;\n\n// Identifier for the symbol, for easy idenfitifaction of symbols created by this util\n// Useful for clearning global object during SSR reloads\nexport const SYMBOL_NAMESPACE = 'global-context-selector:';\n\n// During SSR the global object persists with the server process\n// Clean out the global object during server reload during development\nif (!isBrowser && process.env.NODE_ENV !== 'production') {\n const globalSymbols = Object.getOwnPropertySymbols(globalObject);\n globalSymbols.forEach(sym => {\n if (Symbol.keyFor(sym)?.startsWith(SYMBOL_NAMESPACE)) {\n // @ts-expect-error - Indexing object with symbols not supported until TS 4.4\n delete globalObject[sym];\n }\n });\n}\n\n/**\n * Wrapper around @see createContext from \\@fluentui/react-context-selector that implements context registration\n * in the globalThis object to avoid duplicate contexts. Contexts are keyed with\n * a unique sybmol for the package name, version and name of the context.\n *\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol}\n *\n * @param defaultValue - @see React.createContext\n * @param name - name of the context\n * @param packageName - name of the npm package where the module is used\n * @param packageVersion - version of the npm package where the module is used\n * @returns @see React.createContext\n */\nexport const createContext = <T>(defaultValue: T, name: string, packageName: string, packageVersion: string) => {\n // Symbol guaranteed to be unique for the entire runtime\n const sym = Symbol.for(`${SYMBOL_NAMESPACE}${packageName}/${name}/@${getMajorVersion(packageVersion)}`);\n\n // Objects keyed with symbols are not visible with console.log\n // Object symbol properties can't be iterated with `for` or `Object.keys`\n const globalSymbols = Object.getOwnPropertySymbols(globalObject);\n if (!globalSymbols.includes(sym)) {\n // @ts-expect-error - Indexing object with symbols not supported until TS 4.4\n // eslint-disable-next-line @fluentui/no-context-default-value\n globalObject[sym] = baseCreateContext(defaultValue);\n }\n\n // @ts-expect-error - Indexing object with symbols not supported until TS 4.4\n return globalObject[sym] as React.Context<T>;\n};\n"],"mappings":"AAAA,YAAYA,KAAA,MAAW;AACvB,SAASC,aAAA,IAAiBC,iBAAiB,QAAQ;AACnD,SAASC,SAAS,QAAQ;AAC1B,SAASC,eAAe,QAAQ;AAGhC,MAAMC,SAAA,gBAAYF,SAAA;AAClB,MAAMG,YAAA,GAA6BD,SAAA,GAAYE,MAAA,GAASC,MAAM;AAE9D;AACA;AACA,OAAO,MAAMC,gBAAA,GAAmB;AAEhC;AACA;AACA,IAAI,CAACJ,SAAA,IAAaK,OAAA,CAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;EACvD,MAAMC,aAAA,gBAAgBC,MAAA,CAAOC,qBAAqB,CAACT,YAAA;EACnDO,aAAA,CAAcG,OAAO,CAACC,GAAA,IAAO;QACvBC,cAAA;IAAJ,IAAI,CAAAA,cAAA,GAAAC,MAAA,CAAOC,MAAM,CAACH,GAAA,eAAdC,cAAA,uBAAAA,cAAA,CAAoBG,UAAA,CAAWZ,gBAAA,GAAmB;MACpD;MACA,OAAOH,YAAY,CAACW,GAAA,CAAI;IAC1B;EACF;AACF;AAEA;;;;;;;;;;;;;AAaA,OAAO,MAAMhB,aAAA,GAAgBA,CAAIqB,YAAA,EAAiBC,IAAA,EAAcC,WAAA,EAAqBC,cAAA,KAA2B;EAC9G;EACA,MAAMR,GAAA,GAAME,MAAA,CAAOO,GAAG,CAAE,GAAEjB,gBAAiB,GAAEe,WAAY,IAAGD,IAAK,KAAInB,eAAA,CAAgBqB,cAAA,CAAgB,EAAC;EAEtG;EACA;EACA,MAAMZ,aAAA,GAAgBC,MAAA,CAAOC,qBAAqB,CAACT,YAAA;EACnD,IAAI,CAACO,aAAA,CAAcc,QAAQ,CAACV,GAAA,GAAM;IAChC;IACA;IACAX,YAAY,CAACW,GAAA,CAAI,GAAGf,iBAAA,CAAkBoB,YAAA;EACxC;EAEA;EACA,OAAOhB,YAAY,CAACW,GAAA,CAAI;AAC1B"}
@@ -11,8 +11,8 @@ export const SYMBOL_NAMESPACE = 'global-context:';
11
11
  if (!isBrowser && process.env.NODE_ENV !== 'production') {
12
12
  const globalSymbols = /*#__PURE__*/Object.getOwnPropertySymbols(globalObject);
13
13
  globalSymbols.forEach(sym => {
14
- var _a;
15
- if ((_a = Symbol.keyFor(sym)) === null || _a === void 0 ? void 0 : _a.startsWith(SYMBOL_NAMESPACE)) {
14
+ var _Symbol_keyFor;
15
+ if ((_Symbol_keyFor = Symbol.keyFor(sym)) === null || _Symbol_keyFor === void 0 ? void 0 : _Symbol_keyFor.startsWith(SYMBOL_NAMESPACE)) {
16
16
  // @ts-expect-error - Indexing object with symbols not supported until TS 4.4
17
17
  delete globalObject[sym];
18
18
  }
@@ -1 +1 @@
1
- {"version":3,"names":["React","canUseDOM","getMajorVersion","isBrowser","globalObject","window","global","SYMBOL_NAMESPACE","process","env","NODE_ENV","globalSymbols","Object","getOwnPropertySymbols","forEach","sym","_a","Symbol","keyFor","startsWith","createContext","defaultValue","name","packageName","packageVersion","for","includes"],"sources":["../src/packages/react-components/global-context/src/global-context.ts"],"sourcesContent":["import * as React from 'react';\nimport { canUseDOM } from '@fluentui/react-utilities';\nimport { GlobalObject } from './types';\nimport { getMajorVersion } from './utils';\n\nconst isBrowser = canUseDOM();\nconst globalObject: GlobalObject = isBrowser ? window : global;\n\n// Identifier for the symbol, for easy idenfitifaction of symbols created by this util\n// Useful for clearning global object during SSR reloads\nexport const SYMBOL_NAMESPACE = 'global-context:';\n\n// During SSR the global object persists with the server process\n// Clean out the global object during server reload during development\nif (!isBrowser && process.env.NODE_ENV !== 'production') {\n const globalSymbols = Object.getOwnPropertySymbols(globalObject);\n globalSymbols.forEach(sym => {\n if (Symbol.keyFor(sym)?.startsWith(SYMBOL_NAMESPACE)) {\n // @ts-expect-error - Indexing object with symbols not supported until TS 4.4\n delete globalObject[sym];\n }\n });\n}\n\n/**\n * Wrapper around @see React.createContext that implements context registration\n * in the globalThis object to avoid duplicate contexts. Contexts are keyed with\n * a unique sybmol for the package name, version and name of the context.\n *\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol}\n *\n * @param defaultValue - @see React.createContext\n * @param name - name of the context\n * @param packageName - name of the npm package where the module is used\n * @param packageVersion - version of the npm package where the module is used\n * @returns @see React.createContext\n */\nexport const createContext = <T>(defaultValue: T, name: string, packageName: string, packageVersion: string) => {\n // Symbol guaranteed to be unique for the entire runtime\n const sym = Symbol.for(`${SYMBOL_NAMESPACE}${packageName}/${name}/@${getMajorVersion(packageVersion)}`);\n\n // Objects keyed with symbols are not visible with console.log\n // Object symbol properties can't be iterated with `for` or `Object.keys`\n const globalSymbols = Object.getOwnPropertySymbols(globalObject);\n if (!globalSymbols.includes(sym)) {\n // @ts-expect-error - Indexing object with symbols not supported until TS 4.4\n // eslint-disable-next-line @fluentui/no-context-default-value\n globalObject[sym] = React.createContext(defaultValue);\n }\n\n // @ts-expect-error - Indexing object with symbols not supported until TS 4.4\n return globalObject[sym] as React.Context<T>;\n};\n"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,SAAS,QAAQ,2BAA2B;AAErD,SAASC,eAAe,QAAQ,SAAS;AAEzC,MAAMC,SAAS,gBAAGF,SAAS,EAAE;AAC7B,MAAMG,YAAY,GAAiBD,SAAS,GAAGE,MAAM,GAAGC,MAAM;AAE9D;AACA;AACA,OAAO,MAAMC,gBAAgB,GAAG,iBAAiB;AAEjD;AACA;AACA,IAAI,CAACJ,SAAS,IAAIK,OAAO,CAACC,GAAG,CAACC,QAAQ,KAAK,YAAY,EAAE;EACvD,MAAMC,aAAa,gBAAGC,MAAM,CAACC,qBAAqB,CAACT,YAAY,CAAC;EAChEO,aAAa,CAACG,OAAO,CAACC,GAAG,IAAG;;IAC1B,IAAI,CAAAC,EAAA,GAAAC,MAAM,CAACC,MAAM,CAACH,GAAG,CAAC,cAAAC,EAAA,uBAAAA,EAAA,CAAEG,UAAU,CAACZ,gBAAgB,CAAC,EAAE;MACpD;MACA,OAAOH,YAAY,CAACW,GAAG,CAAC;;EAE5B,CAAC,CAAC;;AAGJ;;;;;;;;;;;;;AAaA,OAAO,MAAMK,aAAa,GAAGA,CAAIC,YAAe,EAAEC,IAAY,EAAEC,WAAmB,EAAEC,cAAsB,KAAI;EAC7G;EACA,MAAMT,GAAG,GAAGE,MAAM,CAACQ,GAAG,CAAC,GAAGlB,gBAAgB,GAAGgB,WAAW,IAAID,IAAI,KAAKpB,eAAe,CAACsB,cAAc,CAAC,EAAE,CAAC;EAEvG;EACA;EACA,MAAMb,aAAa,GAAGC,MAAM,CAACC,qBAAqB,CAACT,YAAY,CAAC;EAChE,IAAI,CAACO,aAAa,CAACe,QAAQ,CAACX,GAAG,CAAC,EAAE;IAChC;IACA;IACAX,YAAY,CAACW,GAAG,CAAC,gBAAGf,KAAK,CAACoB,aAAa,CAACC,YAAY,CAAC;;EAGvD;EACA,OAAOjB,YAAY,CAACW,GAAG,CAAqB;AAC9C,CAAC"}
1
+ {"version":3,"names":["React","canUseDOM","getMajorVersion","isBrowser","globalObject","window","global","SYMBOL_NAMESPACE","process","env","NODE_ENV","globalSymbols","Object","getOwnPropertySymbols","forEach","sym","_Symbol_keyFor","Symbol","keyFor","startsWith","createContext","defaultValue","name","packageName","packageVersion","for","includes"],"sources":["../src/global-context.ts"],"sourcesContent":["import * as React from 'react';\nimport { canUseDOM } from '@fluentui/react-utilities';\nimport { GlobalObject } from './types';\nimport { getMajorVersion } from './utils';\n\nconst isBrowser = canUseDOM();\nconst globalObject: GlobalObject = isBrowser ? window : global;\n\n// Identifier for the symbol, for easy idenfitifaction of symbols created by this util\n// Useful for clearning global object during SSR reloads\nexport const SYMBOL_NAMESPACE = 'global-context:';\n\n// During SSR the global object persists with the server process\n// Clean out the global object during server reload during development\nif (!isBrowser && process.env.NODE_ENV !== 'production') {\n const globalSymbols = Object.getOwnPropertySymbols(globalObject);\n globalSymbols.forEach(sym => {\n if (Symbol.keyFor(sym)?.startsWith(SYMBOL_NAMESPACE)) {\n // @ts-expect-error - Indexing object with symbols not supported until TS 4.4\n delete globalObject[sym];\n }\n });\n}\n\n/**\n * Wrapper around @see React.createContext that implements context registration\n * in the globalThis object to avoid duplicate contexts. Contexts are keyed with\n * a unique sybmol for the package name, version and name of the context.\n *\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol}\n *\n * @param defaultValue - @see React.createContext\n * @param name - name of the context\n * @param packageName - name of the npm package where the module is used\n * @param packageVersion - version of the npm package where the module is used\n * @returns @see React.createContext\n */\nexport const createContext = <T>(defaultValue: T, name: string, packageName: string, packageVersion: string) => {\n // Symbol guaranteed to be unique for the entire runtime\n const sym = Symbol.for(`${SYMBOL_NAMESPACE}${packageName}/${name}/@${getMajorVersion(packageVersion)}`);\n\n // Objects keyed with symbols are not visible with console.log\n // Object symbol properties can't be iterated with `for` or `Object.keys`\n const globalSymbols = Object.getOwnPropertySymbols(globalObject);\n if (!globalSymbols.includes(sym)) {\n // @ts-expect-error - Indexing object with symbols not supported until TS 4.4\n // eslint-disable-next-line @fluentui/no-context-default-value\n globalObject[sym] = React.createContext(defaultValue);\n }\n\n // @ts-expect-error - Indexing object with symbols not supported until TS 4.4\n return globalObject[sym] as React.Context<T>;\n};\n"],"mappings":"AAAA,YAAYA,KAAA,MAAW;AACvB,SAASC,SAAS,QAAQ;AAE1B,SAASC,eAAe,QAAQ;AAEhC,MAAMC,SAAA,gBAAYF,SAAA;AAClB,MAAMG,YAAA,GAA6BD,SAAA,GAAYE,MAAA,GAASC,MAAM;AAE9D;AACA;AACA,OAAO,MAAMC,gBAAA,GAAmB;AAEhC;AACA;AACA,IAAI,CAACJ,SAAA,IAAaK,OAAA,CAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;EACvD,MAAMC,aAAA,gBAAgBC,MAAA,CAAOC,qBAAqB,CAACT,YAAA;EACnDO,aAAA,CAAcG,OAAO,CAACC,GAAA,IAAO;QACvBC,cAAA;IAAJ,IAAI,CAAAA,cAAA,GAAAC,MAAA,CAAOC,MAAM,CAACH,GAAA,eAAdC,cAAA,uBAAAA,cAAA,CAAoBG,UAAA,CAAWZ,gBAAA,GAAmB;MACpD;MACA,OAAOH,YAAY,CAACW,GAAA,CAAI;IAC1B;EACF;AACF;AAEA;;;;;;;;;;;;;AAaA,OAAO,MAAMK,aAAA,GAAgBA,CAAIC,YAAA,EAAiBC,IAAA,EAAcC,WAAA,EAAqBC,cAAA,KAA2B;EAC9G;EACA,MAAMT,GAAA,GAAME,MAAA,CAAOQ,GAAG,CAAE,GAAElB,gBAAiB,GAAEgB,WAAY,IAAGD,IAAK,KAAIpB,eAAA,CAAgBsB,cAAA,CAAgB,EAAC;EAEtG;EACA;EACA,MAAMb,aAAA,GAAgBC,MAAA,CAAOC,qBAAqB,CAACT,YAAA;EACnD,IAAI,CAACO,aAAA,CAAce,QAAQ,CAACX,GAAA,GAAM;IAChC;IACA;IACAX,YAAY,CAACW,GAAA,CAAI,gBAAGf,KAAA,CAAMoB,aAAa,CAACC,YAAA;EAC1C;EAEA;EACA,OAAOjB,YAAY,CAACW,GAAA,CAAI;AAC1B"}
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"../src/","sources":["packages/react-components/global-context/src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,aAAa,IAAI,qBAAqB,EAAE,MAAM,2BAA2B,CAAC","sourcesContent":["export { createContext } from './global-context';\nexport { createContext as createContextSelector } from './global-context-selector';\n"]}
1
+ {"version":3,"names":["createContext","createContextSelector"],"sources":["../src/index.ts"],"sourcesContent":["export { createContext } from './global-context';\nexport { createContext as createContextSelector } from './global-context-selector';\n"],"mappings":"AAAA,SAASA,aAAa,QAAQ;AAC9B,SAASA,aAAA,IAAiBC,qBAAqB,QAAQ"}
package/lib/types.js CHANGED
@@ -1,2 +1,2 @@
1
- export {};
1
+ import * as React from 'react';
2
2
  //# sourceMappingURL=types.js.map
package/lib/types.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"../src/","sources":["packages/react-components/global-context/src/types.ts"],"names":[],"mappings":"","sourcesContent":["import * as React from 'react';\n\nexport type GlobalObject = (typeof globalThis | NodeJS.Global) & Record<symbol, React.Context<unknown>>;\n"]}
1
+ {"version":3,"names":["React"],"sources":["../src/types.ts"],"sourcesContent":["import * as React from 'react';\n\nexport type GlobalObject = (typeof globalThis | NodeJS.Global) & Record<symbol, React.Context<unknown>>;\n"],"mappings":"AAAA,YAAYA,KAAA,MAAW"}
package/lib/utils.js CHANGED
@@ -1,8 +1,7 @@
1
1
  /**
2
2
  * @param version - semver version string
3
3
  * @returns The major version number
4
- */
5
- export function getMajorVersion(version) {
4
+ */export function getMajorVersion(version) {
6
5
  return Number(version.split('.')[0]);
7
6
  }
8
7
  //# sourceMappingURL=utils.js.map
package/lib/utils.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"names":["getMajorVersion","version","Number","split"],"sources":["../src/packages/react-components/global-context/src/utils.ts"],"sourcesContent":["/**\n * @param version - semver version string\n * @returns The major version number\n */\nexport function getMajorVersion(version: string) {\n return Number(version.split('.')[0]);\n}\n"],"mappings":"AAAA;;;;AAIA,OAAM,SAAUA,eAAeA,CAACC,OAAe;EAC7C,OAAOC,MAAM,CAACD,OAAO,CAACE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;AACtC"}
1
+ {"version":3,"names":["getMajorVersion","version","Number","split"],"sources":["../src/utils.ts"],"sourcesContent":["/**\n * @param version - semver version string\n * @returns The major version number\n */\nexport function getMajorVersion(version: string) {\n return Number(version.split('.')[0]);\n}\n"],"mappings":"AAAA;;;GAIA,OAAO,SAASA,gBAAgBC,OAAe,EAAE;EAC/C,OAAOC,MAAA,CAAOD,OAAA,CAAQE,KAAK,CAAC,IAAI,CAAC,EAAE;AACrC"}
@@ -1,55 +1,50 @@
1
1
  "use strict";
2
-
3
2
  Object.defineProperty(exports, "__esModule", {
4
- value: true
3
+ value: true
4
+ });
5
+ function _export(target, all) {
6
+ for(var name in all)Object.defineProperty(target, name, {
7
+ enumerable: true,
8
+ get: all[name]
9
+ });
10
+ }
11
+ _export(exports, {
12
+ SYMBOL_NAMESPACE: ()=>SYMBOL_NAMESPACE,
13
+ createContext: ()=>createContext
5
14
  });
6
- exports.createContext = exports.SYMBOL_NAMESPACE = void 0;
7
- const react_context_selector_1 = /*#__PURE__*/require("@fluentui/react-context-selector");
8
- const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
9
- const utils_1 = /*#__PURE__*/require("./utils");
10
- const isBrowser = /*#__PURE__*/react_utilities_1.canUseDOM();
15
+ const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
16
+ const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
17
+ const _reactContextSelector = require("@fluentui/react-context-selector");
18
+ const _reactUtilities = require("@fluentui/react-utilities");
19
+ const _utils = require("./utils");
20
+ const isBrowser = /*#__PURE__*/ (0, _reactUtilities.canUseDOM)();
11
21
  const globalObject = isBrowser ? window : global;
12
- // Identifier for the symbol, for easy idenfitifaction of symbols created by this util
13
- // Useful for clearning global object during SSR reloads
14
- exports.SYMBOL_NAMESPACE = 'global-context-selector:';
22
+ const SYMBOL_NAMESPACE = 'global-context-selector:';
15
23
  // During SSR the global object persists with the server process
16
24
  // Clean out the global object during server reload during development
17
25
  if (!isBrowser && process.env.NODE_ENV !== 'production') {
18
- const globalSymbols = /*#__PURE__*/Object.getOwnPropertySymbols(globalObject);
19
- globalSymbols.forEach(sym => {
20
- var _a;
21
- if ((_a = Symbol.keyFor(sym)) === null || _a === void 0 ? void 0 : _a.startsWith(exports.SYMBOL_NAMESPACE)) {
22
- // @ts-expect-error - Indexing object with symbols not supported until TS 4.4
23
- delete globalObject[sym];
24
- }
25
- });
26
+ const globalSymbols = /*#__PURE__*/ Object.getOwnPropertySymbols(globalObject);
27
+ globalSymbols.forEach((sym)=>{
28
+ var _Symbol_keyFor;
29
+ if ((_Symbol_keyFor = Symbol.keyFor(sym)) === null || _Symbol_keyFor === void 0 ? void 0 : _Symbol_keyFor.startsWith(SYMBOL_NAMESPACE)) {
30
+ // @ts-expect-error - Indexing object with symbols not supported until TS 4.4
31
+ delete globalObject[sym];
32
+ }
33
+ });
26
34
  }
27
- /**
28
- * Wrapper around @see createContext from \@fluentui/react-context-selector that implements context registration
29
- * in the globalThis object to avoid duplicate contexts. Contexts are keyed with
30
- * a unique sybmol for the package name, version and name of the context.
31
- *
32
- * @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol}
33
- *
34
- * @param defaultValue - @see React.createContext
35
- * @param name - name of the context
36
- * @param packageName - name of the npm package where the module is used
37
- * @param packageVersion - version of the npm package where the module is used
38
- * @returns @see React.createContext
39
- */
40
- const createContext = (defaultValue, name, packageName, packageVersion) => {
41
- // Symbol guaranteed to be unique for the entire runtime
42
- const sym = Symbol.for(`${exports.SYMBOL_NAMESPACE}${packageName}/${name}/@${utils_1.getMajorVersion(packageVersion)}`);
43
- // Objects keyed with symbols are not visible with console.log
44
- // Object symbol properties can't be iterated with `for` or `Object.keys`
45
- const globalSymbols = Object.getOwnPropertySymbols(globalObject);
46
- if (!globalSymbols.includes(sym)) {
35
+ const createContext = (defaultValue, name, packageName, packageVersion)=>{
36
+ // Symbol guaranteed to be unique for the entire runtime
37
+ const sym = Symbol.for(`${SYMBOL_NAMESPACE}${packageName}/${name}/@${(0, _utils.getMajorVersion)(packageVersion)}`);
38
+ // Objects keyed with symbols are not visible with console.log
39
+ // Object symbol properties can't be iterated with `for` or `Object.keys`
40
+ const globalSymbols = Object.getOwnPropertySymbols(globalObject);
41
+ if (!globalSymbols.includes(sym)) {
42
+ // @ts-expect-error - Indexing object with symbols not supported until TS 4.4
43
+ // eslint-disable-next-line @fluentui/no-context-default-value
44
+ globalObject[sym] = (0, _reactContextSelector.createContext)(defaultValue);
45
+ }
47
46
  // @ts-expect-error - Indexing object with symbols not supported until TS 4.4
48
- // eslint-disable-next-line @fluentui/no-context-default-value
49
- globalObject[sym] = react_context_selector_1.createContext(defaultValue);
50
- }
51
- // @ts-expect-error - Indexing object with symbols not supported until TS 4.4
52
- return globalObject[sym];
53
- };
54
- exports.createContext = createContext;
47
+ return globalObject[sym];
48
+ }; //# sourceMappingURL=global-context-selector.js.map
49
+
55
50
  //# sourceMappingURL=global-context-selector.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["react_context_selector_1","require","react_utilities_1","utils_1","isBrowser","canUseDOM","globalObject","window","global","exports","SYMBOL_NAMESPACE","process","env","NODE_ENV","globalSymbols","Object","getOwnPropertySymbols","forEach","sym","_a","Symbol","keyFor","startsWith","createContext","defaultValue","name","packageName","packageVersion","for","getMajorVersion","includes"],"sources":["../src/packages/react-components/global-context/src/global-context-selector.ts"],"sourcesContent":["import * as React from 'react';\nimport { createContext as baseCreateContext } from '@fluentui/react-context-selector';\nimport { canUseDOM } from '@fluentui/react-utilities';\nimport { getMajorVersion } from './utils';\nimport { GlobalObject } from './types';\n\nconst isBrowser = canUseDOM();\nconst globalObject: GlobalObject = isBrowser ? window : global;\n\n// Identifier for the symbol, for easy idenfitifaction of symbols created by this util\n// Useful for clearning global object during SSR reloads\nexport const SYMBOL_NAMESPACE = 'global-context-selector:';\n\n// During SSR the global object persists with the server process\n// Clean out the global object during server reload during development\nif (!isBrowser && process.env.NODE_ENV !== 'production') {\n const globalSymbols = Object.getOwnPropertySymbols(globalObject);\n globalSymbols.forEach(sym => {\n if (Symbol.keyFor(sym)?.startsWith(SYMBOL_NAMESPACE)) {\n // @ts-expect-error - Indexing object with symbols not supported until TS 4.4\n delete globalObject[sym];\n }\n });\n}\n\n/**\n * Wrapper around @see createContext from \\@fluentui/react-context-selector that implements context registration\n * in the globalThis object to avoid duplicate contexts. Contexts are keyed with\n * a unique sybmol for the package name, version and name of the context.\n *\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol}\n *\n * @param defaultValue - @see React.createContext\n * @param name - name of the context\n * @param packageName - name of the npm package where the module is used\n * @param packageVersion - version of the npm package where the module is used\n * @returns @see React.createContext\n */\nexport const createContext = <T>(defaultValue: T, name: string, packageName: string, packageVersion: string) => {\n // Symbol guaranteed to be unique for the entire runtime\n const sym = Symbol.for(`${SYMBOL_NAMESPACE}${packageName}/${name}/@${getMajorVersion(packageVersion)}`);\n\n // Objects keyed with symbols are not visible with console.log\n // Object symbol properties can't be iterated with `for` or `Object.keys`\n const globalSymbols = Object.getOwnPropertySymbols(globalObject);\n if (!globalSymbols.includes(sym)) {\n // @ts-expect-error - Indexing object with symbols not supported until TS 4.4\n // eslint-disable-next-line @fluentui/no-context-default-value\n globalObject[sym] = baseCreateContext(defaultValue);\n }\n\n // @ts-expect-error - Indexing object with symbols not supported until TS 4.4\n return globalObject[sym] as React.Context<T>;\n};\n"],"mappings":";;;;;;AACA,MAAAA,wBAAA,gBAAAC,OAAA;AACA,MAAAC,iBAAA,gBAAAD,OAAA;AACA,MAAAE,OAAA,gBAAAF,OAAA;AAGA,MAAMG,SAAS,gBAAGF,iBAAA,CAAAG,SAAS,EAAE;AAC7B,MAAMC,YAAY,GAAiBF,SAAS,GAAGG,MAAM,GAAGC,MAAM;AAE9D;AACA;AACaC,OAAA,CAAAC,gBAAgB,GAAG,0BAA0B;AAE1D;AACA;AACA,IAAI,CAACN,SAAS,IAAIO,OAAO,CAACC,GAAG,CAACC,QAAQ,KAAK,YAAY,EAAE;EACvD,MAAMC,aAAa,gBAAGC,MAAM,CAACC,qBAAqB,CAACV,YAAY,CAAC;EAChEQ,aAAa,CAACG,OAAO,CAACC,GAAG,IAAG;;IAC1B,IAAI,CAAAC,EAAA,GAAAC,MAAM,CAACC,MAAM,CAACH,GAAG,CAAC,cAAAC,EAAA,uBAAAA,EAAA,CAAEG,UAAU,CAACb,OAAA,CAAAC,gBAAgB,CAAC,EAAE;MACpD;MACA,OAAOJ,YAAY,CAACY,GAAG,CAAC;;EAE5B,CAAC,CAAC;;AAGJ;;;;;;;;;;;;;AAaO,MAAMK,aAAa,GAAGA,CAAIC,YAAe,EAAEC,IAAY,EAAEC,WAAmB,EAAEC,cAAsB,KAAI;EAC7G;EACA,MAAMT,GAAG,GAAGE,MAAM,CAACQ,GAAG,CAAC,GAAGnB,OAAA,CAAAC,gBAAgB,GAAGgB,WAAW,IAAID,IAAI,KAAKtB,OAAA,CAAA0B,eAAe,CAACF,cAAc,CAAC,EAAE,CAAC;EAEvG;EACA;EACA,MAAMb,aAAa,GAAGC,MAAM,CAACC,qBAAqB,CAACV,YAAY,CAAC;EAChE,IAAI,CAACQ,aAAa,CAACgB,QAAQ,CAACZ,GAAG,CAAC,EAAE;IAChC;IACA;IACAZ,YAAY,CAACY,GAAG,CAAC,GAAGlB,wBAAA,CAAAuB,aAAiB,CAACC,YAAY,CAAC;;EAGrD;EACA,OAAOlB,YAAY,CAACY,GAAG,CAAqB;AAC9C,CAAC;AAfYT,OAAA,CAAAc,aAAa,GAAAA,aAAA"}
1
+ {"version":3,"sources":["../lib/global-context-selector.js"],"sourcesContent":["import * as React from 'react';\nimport { createContext as baseCreateContext } from '@fluentui/react-context-selector';\nimport { canUseDOM } from '@fluentui/react-utilities';\nimport { getMajorVersion } from './utils';\nconst isBrowser = /*#__PURE__*/canUseDOM();\nconst globalObject = isBrowser ? window : global;\n// Identifier for the symbol, for easy idenfitifaction of symbols created by this util\n// Useful for clearning global object during SSR reloads\nexport const SYMBOL_NAMESPACE = 'global-context-selector:';\n// During SSR the global object persists with the server process\n// Clean out the global object during server reload during development\nif (!isBrowser && process.env.NODE_ENV !== 'production') {\n const globalSymbols = /*#__PURE__*/Object.getOwnPropertySymbols(globalObject);\n globalSymbols.forEach(sym => {\n var _Symbol_keyFor;\n if ((_Symbol_keyFor = Symbol.keyFor(sym)) === null || _Symbol_keyFor === void 0 ? void 0 : _Symbol_keyFor.startsWith(SYMBOL_NAMESPACE)) {\n // @ts-expect-error - Indexing object with symbols not supported until TS 4.4\n delete globalObject[sym];\n }\n });\n}\n/**\n * Wrapper around @see createContext from \\@fluentui/react-context-selector that implements context registration\n * in the globalThis object to avoid duplicate contexts. Contexts are keyed with\n * a unique sybmol for the package name, version and name of the context.\n *\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol}\n *\n * @param defaultValue - @see React.createContext\n * @param name - name of the context\n * @param packageName - name of the npm package where the module is used\n * @param packageVersion - version of the npm package where the module is used\n * @returns @see React.createContext\n */\nexport const createContext = (defaultValue, name, packageName, packageVersion) => {\n // Symbol guaranteed to be unique for the entire runtime\n const sym = Symbol.for(`${SYMBOL_NAMESPACE}${packageName}/${name}/@${getMajorVersion(packageVersion)}`);\n // Objects keyed with symbols are not visible with console.log\n // Object symbol properties can't be iterated with `for` or `Object.keys`\n const globalSymbols = Object.getOwnPropertySymbols(globalObject);\n if (!globalSymbols.includes(sym)) {\n // @ts-expect-error - Indexing object with symbols not supported until TS 4.4\n // eslint-disable-next-line @fluentui/no-context-default-value\n globalObject[sym] = baseCreateContext(defaultValue);\n }\n // @ts-expect-error - Indexing object with symbols not supported until TS 4.4\n return globalObject[sym];\n};\n//# sourceMappingURL=global-context-selector.js.map"],"names":["SYMBOL_NAMESPACE","createContext","isBrowser","canUseDOM","globalObject","window","global","process","env","NODE_ENV","globalSymbols","Object","getOwnPropertySymbols","forEach","sym","_Symbol_keyFor","Symbol","keyFor","startsWith","defaultValue","name","packageName","packageVersion","for","getMajorVersion","includes","baseCreateContext"],"mappings":";;;;;;;;;;;IAQaA,gBAAgB,MAAhBA;IA0BAC,aAAa,MAAbA;;;6DAlCU;sCAC4B;gCACzB;uBACM;AAChC,MAAMC,YAAY,WAAW,GAAEC,IAAAA,yBAAS;AACxC,MAAMC,eAAeF,YAAYG,SAASC,MAAM;AAGzC,MAAMN,mBAAmB;AAChC,gEAAgE;AAChE,sEAAsE;AACtE,IAAI,CAACE,aAAaK,QAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;IACvD,MAAMC,gBAAgB,WAAW,GAAEC,OAAOC,qBAAqB,CAACR;IAChEM,cAAcG,OAAO,CAACC,CAAAA,MAAO;QAC3B,IAAIC;QACJ,IAAI,AAACA,CAAAA,iBAAiBC,OAAOC,MAAM,CAACH,IAAG,MAAO,IAAI,IAAIC,mBAAmB,KAAK,IAAI,KAAK,IAAIA,eAAeG,UAAU,CAAClB,iBAAiB,EAAE;YACtI,6EAA6E;YAC7E,OAAOI,YAAY,CAACU,IAAI;QAC1B,CAAC;IACH;AACF,CAAC;AAcM,MAAMb,gBAAgB,CAACkB,cAAcC,MAAMC,aAAaC,iBAAmB;IAChF,wDAAwD;IACxD,MAAMR,MAAME,OAAOO,GAAG,CAAC,CAAC,EAAEvB,iBAAiB,EAAEqB,YAAY,CAAC,EAAED,KAAK,EAAE,EAAEI,IAAAA,sBAAe,EAACF,gBAAgB,CAAC;IACtG,8DAA8D;IAC9D,yEAAyE;IACzE,MAAMZ,gBAAgBC,OAAOC,qBAAqB,CAACR;IACnD,IAAI,CAACM,cAAce,QAAQ,CAACX,MAAM;QAChC,6EAA6E;QAC7E,8DAA8D;QAC9DV,YAAY,CAACU,IAAI,GAAGY,IAAAA,mCAAiB,EAACP;IACxC,CAAC;IACD,6EAA6E;IAC7E,OAAOf,YAAY,CAACU,IAAI;AAC1B,GACA,mDAAmD"}
@@ -1,55 +1,49 @@
1
1
  "use strict";
2
-
3
2
  Object.defineProperty(exports, "__esModule", {
4
- value: true
3
+ value: true
4
+ });
5
+ function _export(target, all) {
6
+ for(var name in all)Object.defineProperty(target, name, {
7
+ enumerable: true,
8
+ get: all[name]
9
+ });
10
+ }
11
+ _export(exports, {
12
+ SYMBOL_NAMESPACE: ()=>SYMBOL_NAMESPACE,
13
+ createContext: ()=>createContext
5
14
  });
6
- exports.createContext = exports.SYMBOL_NAMESPACE = void 0;
7
- const React = /*#__PURE__*/require("react");
8
- const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
9
- const utils_1 = /*#__PURE__*/require("./utils");
10
- const isBrowser = /*#__PURE__*/react_utilities_1.canUseDOM();
15
+ const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
16
+ const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
17
+ const _reactUtilities = require("@fluentui/react-utilities");
18
+ const _utils = require("./utils");
19
+ const isBrowser = /*#__PURE__*/ (0, _reactUtilities.canUseDOM)();
11
20
  const globalObject = isBrowser ? window : global;
12
- // Identifier for the symbol, for easy idenfitifaction of symbols created by this util
13
- // Useful for clearning global object during SSR reloads
14
- exports.SYMBOL_NAMESPACE = 'global-context:';
21
+ const SYMBOL_NAMESPACE = 'global-context:';
15
22
  // During SSR the global object persists with the server process
16
23
  // Clean out the global object during server reload during development
17
24
  if (!isBrowser && process.env.NODE_ENV !== 'production') {
18
- const globalSymbols = /*#__PURE__*/Object.getOwnPropertySymbols(globalObject);
19
- globalSymbols.forEach(sym => {
20
- var _a;
21
- if ((_a = Symbol.keyFor(sym)) === null || _a === void 0 ? void 0 : _a.startsWith(exports.SYMBOL_NAMESPACE)) {
22
- // @ts-expect-error - Indexing object with symbols not supported until TS 4.4
23
- delete globalObject[sym];
24
- }
25
- });
25
+ const globalSymbols = /*#__PURE__*/ Object.getOwnPropertySymbols(globalObject);
26
+ globalSymbols.forEach((sym)=>{
27
+ var _Symbol_keyFor;
28
+ if ((_Symbol_keyFor = Symbol.keyFor(sym)) === null || _Symbol_keyFor === void 0 ? void 0 : _Symbol_keyFor.startsWith(SYMBOL_NAMESPACE)) {
29
+ // @ts-expect-error - Indexing object with symbols not supported until TS 4.4
30
+ delete globalObject[sym];
31
+ }
32
+ });
26
33
  }
27
- /**
28
- * Wrapper around @see React.createContext that implements context registration
29
- * in the globalThis object to avoid duplicate contexts. Contexts are keyed with
30
- * a unique sybmol for the package name, version and name of the context.
31
- *
32
- * @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol}
33
- *
34
- * @param defaultValue - @see React.createContext
35
- * @param name - name of the context
36
- * @param packageName - name of the npm package where the module is used
37
- * @param packageVersion - version of the npm package where the module is used
38
- * @returns @see React.createContext
39
- */
40
- const createContext = (defaultValue, name, packageName, packageVersion) => {
41
- // Symbol guaranteed to be unique for the entire runtime
42
- const sym = Symbol.for(`${exports.SYMBOL_NAMESPACE}${packageName}/${name}/@${utils_1.getMajorVersion(packageVersion)}`);
43
- // Objects keyed with symbols are not visible with console.log
44
- // Object symbol properties can't be iterated with `for` or `Object.keys`
45
- const globalSymbols = Object.getOwnPropertySymbols(globalObject);
46
- if (!globalSymbols.includes(sym)) {
34
+ const createContext = (defaultValue, name, packageName, packageVersion)=>{
35
+ // Symbol guaranteed to be unique for the entire runtime
36
+ const sym = Symbol.for(`${SYMBOL_NAMESPACE}${packageName}/${name}/@${(0, _utils.getMajorVersion)(packageVersion)}`);
37
+ // Objects keyed with symbols are not visible with console.log
38
+ // Object symbol properties can't be iterated with `for` or `Object.keys`
39
+ const globalSymbols = Object.getOwnPropertySymbols(globalObject);
40
+ if (!globalSymbols.includes(sym)) {
41
+ // @ts-expect-error - Indexing object with symbols not supported until TS 4.4
42
+ // eslint-disable-next-line @fluentui/no-context-default-value
43
+ globalObject[sym] = /*#__PURE__*/ _react.createContext(defaultValue);
44
+ }
47
45
  // @ts-expect-error - Indexing object with symbols not supported until TS 4.4
48
- // eslint-disable-next-line @fluentui/no-context-default-value
49
- globalObject[sym] = React.createContext(defaultValue);
50
- }
51
- // @ts-expect-error - Indexing object with symbols not supported until TS 4.4
52
- return globalObject[sym];
53
- };
54
- exports.createContext = createContext;
46
+ return globalObject[sym];
47
+ }; //# sourceMappingURL=global-context.js.map
48
+
55
49
  //# sourceMappingURL=global-context.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","require","react_utilities_1","utils_1","isBrowser","canUseDOM","globalObject","window","global","exports","SYMBOL_NAMESPACE","process","env","NODE_ENV","globalSymbols","Object","getOwnPropertySymbols","forEach","sym","_a","Symbol","keyFor","startsWith","createContext","defaultValue","name","packageName","packageVersion","for","getMajorVersion","includes"],"sources":["../src/packages/react-components/global-context/src/global-context.ts"],"sourcesContent":["import * as React from 'react';\nimport { canUseDOM } from '@fluentui/react-utilities';\nimport { GlobalObject } from './types';\nimport { getMajorVersion } from './utils';\n\nconst isBrowser = canUseDOM();\nconst globalObject: GlobalObject = isBrowser ? window : global;\n\n// Identifier for the symbol, for easy idenfitifaction of symbols created by this util\n// Useful for clearning global object during SSR reloads\nexport const SYMBOL_NAMESPACE = 'global-context:';\n\n// During SSR the global object persists with the server process\n// Clean out the global object during server reload during development\nif (!isBrowser && process.env.NODE_ENV !== 'production') {\n const globalSymbols = Object.getOwnPropertySymbols(globalObject);\n globalSymbols.forEach(sym => {\n if (Symbol.keyFor(sym)?.startsWith(SYMBOL_NAMESPACE)) {\n // @ts-expect-error - Indexing object with symbols not supported until TS 4.4\n delete globalObject[sym];\n }\n });\n}\n\n/**\n * Wrapper around @see React.createContext that implements context registration\n * in the globalThis object to avoid duplicate contexts. Contexts are keyed with\n * a unique sybmol for the package name, version and name of the context.\n *\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol}\n *\n * @param defaultValue - @see React.createContext\n * @param name - name of the context\n * @param packageName - name of the npm package where the module is used\n * @param packageVersion - version of the npm package where the module is used\n * @returns @see React.createContext\n */\nexport const createContext = <T>(defaultValue: T, name: string, packageName: string, packageVersion: string) => {\n // Symbol guaranteed to be unique for the entire runtime\n const sym = Symbol.for(`${SYMBOL_NAMESPACE}${packageName}/${name}/@${getMajorVersion(packageVersion)}`);\n\n // Objects keyed with symbols are not visible with console.log\n // Object symbol properties can't be iterated with `for` or `Object.keys`\n const globalSymbols = Object.getOwnPropertySymbols(globalObject);\n if (!globalSymbols.includes(sym)) {\n // @ts-expect-error - Indexing object with symbols not supported until TS 4.4\n // eslint-disable-next-line @fluentui/no-context-default-value\n globalObject[sym] = React.createContext(defaultValue);\n }\n\n // @ts-expect-error - Indexing object with symbols not supported until TS 4.4\n return globalObject[sym] as React.Context<T>;\n};\n"],"mappings":";;;;;;AAAA,MAAAA,KAAA,gBAAAC,OAAA;AACA,MAAAC,iBAAA,gBAAAD,OAAA;AAEA,MAAAE,OAAA,gBAAAF,OAAA;AAEA,MAAMG,SAAS,gBAAGF,iBAAA,CAAAG,SAAS,EAAE;AAC7B,MAAMC,YAAY,GAAiBF,SAAS,GAAGG,MAAM,GAAGC,MAAM;AAE9D;AACA;AACaC,OAAA,CAAAC,gBAAgB,GAAG,iBAAiB;AAEjD;AACA;AACA,IAAI,CAACN,SAAS,IAAIO,OAAO,CAACC,GAAG,CAACC,QAAQ,KAAK,YAAY,EAAE;EACvD,MAAMC,aAAa,gBAAGC,MAAM,CAACC,qBAAqB,CAACV,YAAY,CAAC;EAChEQ,aAAa,CAACG,OAAO,CAACC,GAAG,IAAG;;IAC1B,IAAI,CAAAC,EAAA,GAAAC,MAAM,CAACC,MAAM,CAACH,GAAG,CAAC,cAAAC,EAAA,uBAAAA,EAAA,CAAEG,UAAU,CAACb,OAAA,CAAAC,gBAAgB,CAAC,EAAE;MACpD;MACA,OAAOJ,YAAY,CAACY,GAAG,CAAC;;EAE5B,CAAC,CAAC;;AAGJ;;;;;;;;;;;;;AAaO,MAAMK,aAAa,GAAGA,CAAIC,YAAe,EAAEC,IAAY,EAAEC,WAAmB,EAAEC,cAAsB,KAAI;EAC7G;EACA,MAAMT,GAAG,GAAGE,MAAM,CAACQ,GAAG,CAAC,GAAGnB,OAAA,CAAAC,gBAAgB,GAAGgB,WAAW,IAAID,IAAI,KAAKtB,OAAA,CAAA0B,eAAe,CAACF,cAAc,CAAC,EAAE,CAAC;EAEvG;EACA;EACA,MAAMb,aAAa,GAAGC,MAAM,CAACC,qBAAqB,CAACV,YAAY,CAAC;EAChE,IAAI,CAACQ,aAAa,CAACgB,QAAQ,CAACZ,GAAG,CAAC,EAAE;IAChC;IACA;IACAZ,YAAY,CAACY,GAAG,CAAC,GAAGlB,KAAK,CAACuB,aAAa,CAACC,YAAY,CAAC;;EAGvD;EACA,OAAOlB,YAAY,CAACY,GAAG,CAAqB;AAC9C,CAAC;AAfYT,OAAA,CAAAc,aAAa,GAAAA,aAAA"}
1
+ {"version":3,"sources":["../lib/global-context.js"],"sourcesContent":["import * as React from 'react';\nimport { canUseDOM } from '@fluentui/react-utilities';\nimport { getMajorVersion } from './utils';\nconst isBrowser = /*#__PURE__*/canUseDOM();\nconst globalObject = isBrowser ? window : global;\n// Identifier for the symbol, for easy idenfitifaction of symbols created by this util\n// Useful for clearning global object during SSR reloads\nexport const SYMBOL_NAMESPACE = 'global-context:';\n// During SSR the global object persists with the server process\n// Clean out the global object during server reload during development\nif (!isBrowser && process.env.NODE_ENV !== 'production') {\n const globalSymbols = /*#__PURE__*/Object.getOwnPropertySymbols(globalObject);\n globalSymbols.forEach(sym => {\n var _Symbol_keyFor;\n if ((_Symbol_keyFor = Symbol.keyFor(sym)) === null || _Symbol_keyFor === void 0 ? void 0 : _Symbol_keyFor.startsWith(SYMBOL_NAMESPACE)) {\n // @ts-expect-error - Indexing object with symbols not supported until TS 4.4\n delete globalObject[sym];\n }\n });\n}\n/**\n * Wrapper around @see React.createContext that implements context registration\n * in the globalThis object to avoid duplicate contexts. Contexts are keyed with\n * a unique sybmol for the package name, version and name of the context.\n *\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol}\n *\n * @param defaultValue - @see React.createContext\n * @param name - name of the context\n * @param packageName - name of the npm package where the module is used\n * @param packageVersion - version of the npm package where the module is used\n * @returns @see React.createContext\n */\nexport const createContext = (defaultValue, name, packageName, packageVersion) => {\n // Symbol guaranteed to be unique for the entire runtime\n const sym = Symbol.for(`${SYMBOL_NAMESPACE}${packageName}/${name}/@${getMajorVersion(packageVersion)}`);\n // Objects keyed with symbols are not visible with console.log\n // Object symbol properties can't be iterated with `for` or `Object.keys`\n const globalSymbols = Object.getOwnPropertySymbols(globalObject);\n if (!globalSymbols.includes(sym)) {\n // @ts-expect-error - Indexing object with symbols not supported until TS 4.4\n // eslint-disable-next-line @fluentui/no-context-default-value\n globalObject[sym] = /*#__PURE__*/React.createContext(defaultValue);\n }\n // @ts-expect-error - Indexing object with symbols not supported until TS 4.4\n return globalObject[sym];\n};\n//# sourceMappingURL=global-context.js.map"],"names":["SYMBOL_NAMESPACE","createContext","isBrowser","canUseDOM","globalObject","window","global","process","env","NODE_ENV","globalSymbols","Object","getOwnPropertySymbols","forEach","sym","_Symbol_keyFor","Symbol","keyFor","startsWith","defaultValue","name","packageName","packageVersion","for","getMajorVersion","includes","React"],"mappings":";;;;;;;;;;;IAOaA,gBAAgB,MAAhBA;IA0BAC,aAAa,MAAbA;;;6DAjCU;gCACG;uBACM;AAChC,MAAMC,YAAY,WAAW,GAAEC,IAAAA,yBAAS;AACxC,MAAMC,eAAeF,YAAYG,SAASC,MAAM;AAGzC,MAAMN,mBAAmB;AAChC,gEAAgE;AAChE,sEAAsE;AACtE,IAAI,CAACE,aAAaK,QAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;IACvD,MAAMC,gBAAgB,WAAW,GAAEC,OAAOC,qBAAqB,CAACR;IAChEM,cAAcG,OAAO,CAACC,CAAAA,MAAO;QAC3B,IAAIC;QACJ,IAAI,AAACA,CAAAA,iBAAiBC,OAAOC,MAAM,CAACH,IAAG,MAAO,IAAI,IAAIC,mBAAmB,KAAK,IAAI,KAAK,IAAIA,eAAeG,UAAU,CAAClB,iBAAiB,EAAE;YACtI,6EAA6E;YAC7E,OAAOI,YAAY,CAACU,IAAI;QAC1B,CAAC;IACH;AACF,CAAC;AAcM,MAAMb,gBAAgB,CAACkB,cAAcC,MAAMC,aAAaC,iBAAmB;IAChF,wDAAwD;IACxD,MAAMR,MAAME,OAAOO,GAAG,CAAC,CAAC,EAAEvB,iBAAiB,EAAEqB,YAAY,CAAC,EAAED,KAAK,EAAE,EAAEI,IAAAA,sBAAe,EAACF,gBAAgB,CAAC;IACtG,8DAA8D;IAC9D,yEAAyE;IACzE,MAAMZ,gBAAgBC,OAAOC,qBAAqB,CAACR;IACnD,IAAI,CAACM,cAAce,QAAQ,CAACX,MAAM;QAChC,6EAA6E;QAC7E,8DAA8D;QAC9DV,YAAY,CAACU,IAAI,GAAG,WAAW,GAAEY,OAAMzB,aAAa,CAACkB;IACvD,CAAC;IACD,6EAA6E;IAC7E,OAAOf,YAAY,CAACU,IAAI;AAC1B,GACA,0CAA0C"}
@@ -1,21 +1,19 @@
1
1
  "use strict";
2
-
3
2
  Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.createContextSelector = exports.createContext = void 0;
7
- var global_context_1 = /*#__PURE__*/require("./global-context");
8
- Object.defineProperty(exports, "createContext", {
9
- enumerable: true,
10
- get: function () {
11
- return global_context_1.createContext;
12
- }
3
+ value: true
13
4
  });
14
- var global_context_selector_1 = /*#__PURE__*/require("./global-context-selector");
15
- Object.defineProperty(exports, "createContextSelector", {
16
- enumerable: true,
17
- get: function () {
18
- return global_context_selector_1.createContext;
19
- }
5
+ function _export(target, all) {
6
+ for(var name in all)Object.defineProperty(target, name, {
7
+ enumerable: true,
8
+ get: all[name]
9
+ });
10
+ }
11
+ _export(exports, {
12
+ createContext: ()=>_globalContext.createContext,
13
+ createContextSelector: ()=>_globalContextSelector.createContext
20
14
  });
15
+ const _globalContext = require("./global-context");
16
+ const _globalContextSelector = require("./global-context-selector");
17
+ //# sourceMappingURL=index.js.map
18
+
21
19
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["global_context_1","require","Object","defineProperty","exports","enumerable","get","createContext","global_context_selector_1"],"sources":["../src/packages/react-components/global-context/src/index.ts"],"sourcesContent":["export { createContext } from './global-context';\nexport { createContext as createContextSelector } from './global-context-selector';\n"],"mappings":";;;;;;AAAA,IAAAA,gBAAA,gBAAAC,OAAA;AAASC,MAAA,CAAAC,cAAA,CAAAC,OAAA;EAAAC,UAAA;EAAAC,GAAA,WAAAA,CAAA;IAAA,OAAAN,gBAAA,CAAAO,aAAa;EAAA;AAAA;AACtB,IAAAC,yBAAA,gBAAAP,OAAA;AAASC,MAAA,CAAAC,cAAA,CAAAC,OAAA;EAAAC,UAAA;EAAAC,GAAA,WAAAA,CAAA;IAAA,OAAAE,yBAAA,CAAAD,aAAa;EAAA;AAAA"}
1
+ {"version":3,"sources":["../lib/index.js"],"sourcesContent":["export { createContext } from './global-context';\nexport { createContext as createContextSelector } from './global-context-selector';\n//# sourceMappingURL=index.js.map"],"names":["createContext","createContextSelector"],"mappings":";;;;;;;;;;;IAASA,aAAa,MAAbA,4BAAa;IACIC,qBAAqB,MAAtCD,oCAAa;;+BADQ;uCACyB;CACvD,iCAAiC"}
@@ -1,6 +1,9 @@
1
1
  "use strict";
2
-
3
2
  Object.defineProperty(exports, "__esModule", {
4
- value: true
3
+ value: true
5
4
  });
5
+ const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
6
+ const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
7
+ //# sourceMappingURL=types.js.map
8
+
6
9
  //# sourceMappingURL=types.js.map
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["../src/packages/react-components/global-context/src/types.ts"],"sourcesContent":["import * as React from 'react';\n\nexport type GlobalObject = (typeof globalThis | NodeJS.Global) & Record<symbol, React.Context<unknown>>;\n"],"mappings":""}
1
+ {"version":3,"sources":["../lib/types.js"],"sourcesContent":["import * as React from 'react';\n//# sourceMappingURL=types.js.map"],"names":[],"mappings":";;;;;6DAAuB;CACvB,iCAAiC"}
@@ -1,15 +1,16 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.getMajorVersion = void 0;
7
1
  /**
8
2
  * @param version - semver version string
9
3
  * @returns The major version number
10
- */
4
+ */ "use strict";
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ Object.defineProperty(exports, "getMajorVersion", {
9
+ enumerable: true,
10
+ get: ()=>getMajorVersion
11
+ });
11
12
  function getMajorVersion(version) {
12
- return Number(version.split('.')[0]);
13
- }
14
- exports.getMajorVersion = getMajorVersion;
13
+ return Number(version.split('.')[0]);
14
+ } //# sourceMappingURL=utils.js.map
15
+
15
16
  //# sourceMappingURL=utils.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["getMajorVersion","version","Number","split","exports"],"sources":["../src/packages/react-components/global-context/src/utils.ts"],"sourcesContent":["/**\n * @param version - semver version string\n * @returns The major version number\n */\nexport function getMajorVersion(version: string) {\n return Number(version.split('.')[0]);\n}\n"],"mappings":";;;;;;AAAA;;;;AAIA,SAAgBA,eAAeA,CAACC,OAAe;EAC7C,OAAOC,MAAM,CAACD,OAAO,CAACE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;AACtC;AAFAC,OAAA,CAAAJ,eAAA,GAAAA,eAAA"}
1
+ {"version":3,"sources":["../lib/utils.js"],"sourcesContent":["/**\n * @param version - semver version string\n * @returns The major version number\n */export function getMajorVersion(version) {\n return Number(version.split('.')[0]);\n}\n//# sourceMappingURL=utils.js.map"],"names":["getMajorVersion","version","Number","split"],"mappings":"AAAA;;;CAGC;;;;+BAAkBA;;aAAAA;;AAAT,SAASA,gBAAgBC,OAAO,EAAE;IAC1C,OAAOC,OAAOD,QAAQE,KAAK,CAAC,IAAI,CAAC,EAAE;AACrC,EACA,iCAAiC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui/global-context",
3
- "version": "9.0.0-beta.21",
3
+ "version": "9.0.0-beta.23",
4
4
  "description": "Extension of React createContext to be a true singleton on the global scope",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "module": "lib/index.js",
@@ -22,7 +22,7 @@
22
22
  "lint": "just-scripts lint",
23
23
  "test": "jest --passWithNoTests",
24
24
  "type-check": "tsc -b tsconfig.json",
25
- "generate-api": "tsc -p ./tsconfig.lib.json --emitDeclarationOnly && just-scripts api-extractor"
25
+ "generate-api": "just-scripts generate-api"
26
26
  },
27
27
  "devDependencies": {
28
28
  "@fluentui/eslint-plugin": "*",
@@ -31,9 +31,9 @@
31
31
  "@fluentui/scripts-tasks": "*"
32
32
  },
33
33
  "dependencies": {
34
- "@fluentui/react-context-selector": "^9.1.14",
35
- "@fluentui/react-utilities": "^9.7.1",
36
- "tslib": "^2.1.0"
34
+ "@fluentui/react-context-selector": "^9.1.16",
35
+ "@fluentui/react-utilities": "^9.7.3",
36
+ "@swc/helpers": "^0.4.14"
37
37
  },
38
38
  "peerDependencies": {
39
39
  "@types/react": ">=16.8.0 <19.0.0",
@@ -52,6 +52,7 @@
52
52
  "exports": {
53
53
  ".": {
54
54
  "types": "./dist/index.d.ts",
55
+ "node": "./lib-commonjs/index.js",
55
56
  "import": "./lib/index.js",
56
57
  "require": "./lib-commonjs/index.js"
57
58
  },