@react-aria/ssr 3.1.1-nightly.3100 → 3.1.2

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/dist/main.js CHANGED
@@ -1,5 +1,4 @@
1
- var $9PnAB$react = require("react");
2
- var $9PnAB$reactariautils = require("@react-aria/utils");
1
+ var $8EJgg$react = require("react");
3
2
 
4
3
  function $parcel$exportWildcard(dest, source) {
5
4
  Object.keys(source).forEach(function(key) {
@@ -23,66 +22,65 @@ function $parcel$interopDefault(a) {
23
22
  function $parcel$export(e, n, v, s) {
24
23
  Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
25
24
  }
26
- var $4475f5901e532904$exports = {};
27
-
28
- $parcel$export($4475f5901e532904$exports, "SSRProvider", () => $4475f5901e532904$export$9f8ac96af4b1b2ae);
29
- $parcel$export($4475f5901e532904$exports, "useSSRSafeId", () => $4475f5901e532904$export$619500959fc48b26);
30
- $parcel$export($4475f5901e532904$exports, "useIsSSR", () => $4475f5901e532904$export$535bd6ca7f90a273);
25
+ var $dac019021ac61f1f$exports = {};
31
26
 
27
+ $parcel$export($dac019021ac61f1f$exports, "SSRProvider", () => $dac019021ac61f1f$export$9f8ac96af4b1b2ae);
28
+ $parcel$export($dac019021ac61f1f$exports, "useSSRSafeId", () => $dac019021ac61f1f$export$619500959fc48b26);
29
+ $parcel$export($dac019021ac61f1f$exports, "useIsSSR", () => $dac019021ac61f1f$export$535bd6ca7f90a273);
32
30
 
33
31
  // Default context value to use in case there is no SSRProvider. This is fine for
34
32
  // client-only apps. In order to support multiple copies of React Aria potentially
35
33
  // being on the page at once, the prefix is set to a random number. SSRProvider
36
34
  // will reset this to zero for consistency between server and client, so in the
37
35
  // SSR case multiple copies of React Aria is not supported.
38
- const $4475f5901e532904$var$defaultContext = {
36
+ const $dac019021ac61f1f$var$defaultContext = {
39
37
  prefix: String(Math.round(Math.random() * 10000000000)),
40
38
  current: 0
41
39
  };
42
- const $4475f5901e532904$var$SSRContext = /*#__PURE__*/ ($parcel$interopDefault($9PnAB$react)).createContext($4475f5901e532904$var$defaultContext);
43
- function $4475f5901e532904$export$9f8ac96af4b1b2ae(props) {
44
- let cur = $9PnAB$react.useContext($4475f5901e532904$var$SSRContext);
45
- let value = $9PnAB$react.useMemo(()=>({
40
+ const $dac019021ac61f1f$var$SSRContext = /*#__PURE__*/ ($parcel$interopDefault($8EJgg$react)).createContext($dac019021ac61f1f$var$defaultContext);
41
+ function $dac019021ac61f1f$export$9f8ac96af4b1b2ae(props) {
42
+ let cur = $8EJgg$react.useContext($dac019021ac61f1f$var$SSRContext);
43
+ let value = $8EJgg$react.useMemo(()=>({
46
44
  // If this is the first SSRProvider, start with an empty string prefix, otherwise
47
45
  // append and increment the counter.
48
- prefix: cur === $4475f5901e532904$var$defaultContext ? '' : `${cur.prefix}-${++cur.current}`,
46
+ prefix: cur === $dac019021ac61f1f$var$defaultContext ? '' : `${cur.prefix}-${++cur.current}`,
49
47
  current: 0
50
48
  })
51
49
  , [
52
50
  cur
53
51
  ]);
54
- return(/*#__PURE__*/ ($parcel$interopDefault($9PnAB$react)).createElement($4475f5901e532904$var$SSRContext.Provider, {
52
+ return(/*#__PURE__*/ ($parcel$interopDefault($8EJgg$react)).createElement($dac019021ac61f1f$var$SSRContext.Provider, {
55
53
  value: value
56
54
  }, props.children));
57
55
  }
58
- let $4475f5901e532904$var$canUseDOM = Boolean(typeof window !== 'undefined' && window.document && window.document.createElement);
59
- function $4475f5901e532904$export$619500959fc48b26(defaultId) {
60
- let ctx = $9PnAB$react.useContext($4475f5901e532904$var$SSRContext);
56
+ let $dac019021ac61f1f$var$canUseDOM = Boolean(typeof window !== 'undefined' && window.document && window.document.createElement);
57
+ function $dac019021ac61f1f$export$619500959fc48b26(defaultId) {
58
+ let ctx = $8EJgg$react.useContext($dac019021ac61f1f$var$SSRContext);
61
59
  // If we are rendering in a non-DOM environment, and there's no SSRProvider,
62
60
  // provide a warning to hint to the developer to add one.
63
- if (ctx === $4475f5901e532904$var$defaultContext && !$4475f5901e532904$var$canUseDOM) console.warn('When server rendering, you must wrap your application in an <SSRProvider> to ensure consistent ids are generated between the client and server.');
64
- return $9PnAB$react.useMemo(()=>defaultId || `react-aria${ctx.prefix}-${++ctx.current}`
61
+ if (ctx === $dac019021ac61f1f$var$defaultContext && !$dac019021ac61f1f$var$canUseDOM) console.warn('When server rendering, you must wrap your application in an <SSRProvider> to ensure consistent ids are generated between the client and server.');
62
+ return $8EJgg$react.useMemo(()=>defaultId || `react-aria${ctx.prefix}-${++ctx.current}`
65
63
  , [
66
64
  defaultId
67
65
  ]);
68
66
  }
69
- function $4475f5901e532904$export$535bd6ca7f90a273() {
70
- let cur = $9PnAB$react.useContext($4475f5901e532904$var$SSRContext);
71
- let isInSSRContext = cur !== $4475f5901e532904$var$defaultContext;
72
- let [isSSR, setIsSSR] = $9PnAB$react.useState(isInSSRContext);
67
+ function $dac019021ac61f1f$export$535bd6ca7f90a273() {
68
+ let cur = $8EJgg$react.useContext($dac019021ac61f1f$var$SSRContext);
69
+ let isInSSRContext = cur !== $dac019021ac61f1f$var$defaultContext;
70
+ let [isSSR, setIsSSR] = $8EJgg$react.useState(isInSSRContext);
73
71
  // If on the client, and the component was initially server rendered,
74
72
  // then schedule a layout effect to update the component after hydration.
75
73
  if (typeof window !== 'undefined' && isInSSRContext) // This if statement technically breaks the rules of hooks, but is safe
76
74
  // because the condition never changes after mounting.
77
75
  // eslint-disable-next-line react-hooks/rules-of-hooks
78
- $9PnAB$reactariautils.useLayoutEffect(()=>{
76
+ $8EJgg$react.useLayoutEffect(()=>{
79
77
  setIsSSR(false);
80
78
  }, []);
81
79
  return isSSR;
82
80
  }
83
81
 
84
82
 
85
- $parcel$exportWildcard(module.exports, $4475f5901e532904$exports);
83
+ $parcel$exportWildcard(module.exports, $dac019021ac61f1f$exports);
86
84
 
87
85
 
88
86
  //# sourceMappingURL=main.js.map
package/dist/main.js.map CHANGED
@@ -1 +1 @@
1
- {"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S,EACtC,OAAO,CAAC,IAAI,CAAC,CAAiJ;IAGhK,MAAM,CAAC,oBAAO,KAAO,SAAS,KAAK,UAAU,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,IAAI,GAAG,CAAC,OAAO;MAAI,CAAC;QAAA,SAAS;IAAA,CAAC;AAC3F,CAAC;SAOe,yCAAQ,GAAY,CAAC;IACnC,GAAG,CAAC,GAAG,GAAG,uBAAU,CAAC,gCAAU;IAC/B,GAAG,CAAC,cAAc,GAAG,GAAG,KAAK,oCAAc;IAC3C,GAAG,EAAE,KAAK,EAAE,QAAQ,IAAI,qBAAQ,CAAC,cAAc;IAE/C,EAAqE,AAArE,mEAAqE;IACrE,EAAyE,AAAzE,uEAAyE;IACzE,EAAE,EAAE,MAAM,CAAC,MAAM,KAAK,CAAW,cAAI,cAAc,EACjD,EAAuE,AAAvE,qEAAuE;IACvE,EAAsD,AAAtD,oDAAsD;IACtD,EAAsD,AAAtD,oDAAsD;IACtD,qCAAe,KAAO,CAAC;QACrB,QAAQ,CAAC,KAAK;IAChB,CAAC,EAAE,CAAC,CAAC;IAGP,MAAM,CAAC,KAAK;AACd,CAAC","sources":["packages/@react-aria/ssr/src/index.ts","packages/@react-aria/ssr/src/SSRProvider.tsx"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nexport * from './SSRProvider';\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport React, {ReactNode, useContext, useMemo, useState} from 'react';\nimport {useLayoutEffect} from '@react-aria/utils';\n\n// To support SSR, the auto incrementing id counter is stored in a context. This allows\n// it to be reset on every request to ensure the client and server are consistent.\n// There is also a prefix string that is used to support async loading components\n// Each async boundary must be wrapped in an SSR provider, which appends to the prefix\n// and resets the current id counter. This ensures that async loaded components have\n// consistent ids regardless of the loading order.\ninterface SSRContextValue {\n prefix: string,\n current: number\n}\n\n// Default context value to use in case there is no SSRProvider. This is fine for\n// client-only apps. In order to support multiple copies of React Aria potentially\n// being on the page at once, the prefix is set to a random number. SSRProvider\n// will reset this to zero for consistency between server and client, so in the\n// SSR case multiple copies of React Aria is not supported.\nconst defaultContext: SSRContextValue = {\n prefix: String(Math.round(Math.random() * 10000000000)),\n current: 0\n};\n\nconst SSRContext = React.createContext<SSRContextValue>(defaultContext);\n\ninterface SSRProviderProps {\n /** Your application here. */\n children: ReactNode\n}\n\n/**\n * When using SSR with React Aria, applications must be wrapped in an SSRProvider.\n * This ensures that auto generated ids are consistent between the client and server.\n */\nexport function SSRProvider(props: SSRProviderProps): JSX.Element {\n let cur = useContext(SSRContext);\n let value: SSRContextValue = useMemo(() => ({\n // If this is the first SSRProvider, start with an empty string prefix, otherwise\n // append and increment the counter.\n prefix: cur === defaultContext ? '' : `${cur.prefix}-${++cur.current}`,\n current: 0\n }), [cur]);\n\n return (\n <SSRContext.Provider value={value}>\n {props.children}\n </SSRContext.Provider>\n );\n}\n\nlet canUseDOM = Boolean(\n typeof window !== 'undefined' &&\n window.document &&\n window.document.createElement\n);\n\n/** @private */\nexport function useSSRSafeId(defaultId?: string): string {\n let ctx = useContext(SSRContext);\n\n // If we are rendering in a non-DOM environment, and there's no SSRProvider,\n // provide a warning to hint to the developer to add one.\n if (ctx === defaultContext && !canUseDOM) {\n console.warn('When server rendering, you must wrap your application in an <SSRProvider> to ensure consistent ids are generated between the client and server.');\n }\n\n return useMemo(() => defaultId || `react-aria${ctx.prefix}-${++ctx.current}`, [defaultId]);\n}\n\n/**\n * Returns whether the component is currently being server side rendered or\n * hydrated on the client. Can be used to delay browser-specific rendering\n * until after hydration.\n */\nexport function useIsSSR(): boolean {\n let cur = useContext(SSRContext);\n let isInSSRContext = cur !== defaultContext;\n let [isSSR, setIsSSR] = useState(isInSSRContext);\n\n // If on the client, and the component was initially server rendered,\n // then schedule a layout effect to update the component after hydration.\n if (typeof window !== 'undefined' && isInSSRContext) {\n // This if statement technically breaks the rules of hooks, but is safe\n // because the condition never changes after mounting.\n // eslint-disable-next-line react-hooks/rules-of-hooks\n useLayoutEffect(() => {\n setIsSSR(false);\n }, []);\n }\n\n return isSSR;\n}\n"],"names":[],"version":3,"file":"main.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC4BA,EAAiF,AAAjF,+EAAiF;AACjF,EAAkF,AAAlF,gFAAkF;AAClF,EAA+E,AAA/E,6EAA+E;AAC/E,EAA+E,AAA/E,6EAA+E;AAC/E,EAA2D,AAA3D,yDAA2D;AAC3D,KAAK,CAAC,oCAAc,GAAoB,CAAC;IACvC,MAAM,EAAE,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,KAAK,WAAW;IACrD,OAAO,EAAE,CAAC;AACZ,CAAC;AAED,KAAK,CAAC,gCAAU,iBAAG,sCAAK,CAAC,aAAa,CAAkB,oCAAc;SAWtD,yCAAW,CAAC,KAAuB,EAAe,CAAC;IACjE,GAAG,CAAC,GAAG,GAAG,uBAAU,CAAC,gCAAU;IAC/B,GAAG,CAAC,KAAK,GAAoB,oBAAO,MAAQ,CAAC;YAC3C,EAAiF,AAAjF,+EAAiF;YACjF,EAAoC,AAApC,kCAAoC;YACpC,MAAM,EAAE,GAAG,KAA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AK;IAChB,CAAC,EAAE,CAAC,CAAC;IAGP,MAAM,CAAC,KAAK;AACd,CAAC","sources":["packages/@react-aria/ssr/src/index.ts","packages/@react-aria/ssr/src/SSRProvider.tsx"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nexport * from './SSRProvider';\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n// We must avoid a circular dependency with @react-aria/utils, and this useLayoutEffect is\n// guarded by a check that it only runs on the client side.\n// eslint-disable-next-line rulesdir/useLayoutEffectRule\nimport React, {ReactNode, useContext, useLayoutEffect, useMemo, useState} from 'react';\n\n// To support SSR, the auto incrementing id counter is stored in a context. This allows\n// it to be reset on every request to ensure the client and server are consistent.\n// There is also a prefix string that is used to support async loading components\n// Each async boundary must be wrapped in an SSR provider, which appends to the prefix\n// and resets the current id counter. This ensures that async loaded components have\n// consistent ids regardless of the loading order.\ninterface SSRContextValue {\n prefix: string,\n current: number\n}\n\n// Default context value to use in case there is no SSRProvider. This is fine for\n// client-only apps. In order to support multiple copies of React Aria potentially\n// being on the page at once, the prefix is set to a random number. SSRProvider\n// will reset this to zero for consistency between server and client, so in the\n// SSR case multiple copies of React Aria is not supported.\nconst defaultContext: SSRContextValue = {\n prefix: String(Math.round(Math.random() * 10000000000)),\n current: 0\n};\n\nconst SSRContext = React.createContext<SSRContextValue>(defaultContext);\n\ninterface SSRProviderProps {\n /** Your application here. */\n children: ReactNode\n}\n\n/**\n * When using SSR with React Aria, applications must be wrapped in an SSRProvider.\n * This ensures that auto generated ids are consistent between the client and server.\n */\nexport function SSRProvider(props: SSRProviderProps): JSX.Element {\n let cur = useContext(SSRContext);\n let value: SSRContextValue = useMemo(() => ({\n // If this is the first SSRProvider, start with an empty string prefix, otherwise\n // append and increment the counter.\n prefix: cur === defaultContext ? '' : `${cur.prefix}-${++cur.current}`,\n current: 0\n }), [cur]);\n\n return (\n <SSRContext.Provider value={value}>\n {props.children}\n </SSRContext.Provider>\n );\n}\n\nlet canUseDOM = Boolean(\n typeof window !== 'undefined' &&\n window.document &&\n window.document.createElement\n);\n\n/** @private */\nexport function useSSRSafeId(defaultId?: string): string {\n let ctx = useContext(SSRContext);\n\n // If we are rendering in a non-DOM environment, and there's no SSRProvider,\n // provide a warning to hint to the developer to add one.\n if (ctx === defaultContext && !canUseDOM) {\n console.warn('When server rendering, you must wrap your application in an <SSRProvider> to ensure consistent ids are generated between the client and server.');\n }\n\n return useMemo(() => defaultId || `react-aria${ctx.prefix}-${++ctx.current}`, [defaultId]);\n}\n\n/**\n * Returns whether the component is currently being server side rendered or\n * hydrated on the client. Can be used to delay browser-specific rendering\n * until after hydration.\n */\nexport function useIsSSR(): boolean {\n let cur = useContext(SSRContext);\n let isInSSRContext = cur !== defaultContext;\n let [isSSR, setIsSSR] = useState(isInSSRContext);\n\n // If on the client, and the component was initially server rendered,\n // then schedule a layout effect to update the component after hydration.\n if (typeof window !== 'undefined' && isInSSRContext) {\n // This if statement technically breaks the rules of hooks, but is safe\n // because the condition never changes after mounting.\n // eslint-disable-next-line react-hooks/rules-of-hooks\n useLayoutEffect(() => {\n setIsSSR(false);\n }, []);\n }\n\n return isSSR;\n}\n"],"names":[],"version":3,"file":"main.js.map"}
package/dist/module.js CHANGED
@@ -1,62 +1,60 @@
1
- import $fZ9Rb$react, {useContext as $fZ9Rb$useContext, useMemo as $fZ9Rb$useMemo, useState as $fZ9Rb$useState} from "react";
2
- import {useLayoutEffect as $fZ9Rb$useLayoutEffect} from "@react-aria/utils";
1
+ import $cgWTI$react, {useContext as $cgWTI$useContext, useMemo as $cgWTI$useMemo, useState as $cgWTI$useState, useLayoutEffect as $cgWTI$useLayoutEffect} from "react";
3
2
 
4
3
  function $parcel$export(e, n, v, s) {
5
4
  Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
6
5
  }
7
- var $6f523efd7517f7a2$exports = {};
8
-
9
- $parcel$export($6f523efd7517f7a2$exports, "SSRProvider", () => $6f523efd7517f7a2$export$9f8ac96af4b1b2ae);
10
- $parcel$export($6f523efd7517f7a2$exports, "useSSRSafeId", () => $6f523efd7517f7a2$export$619500959fc48b26);
11
- $parcel$export($6f523efd7517f7a2$exports, "useIsSSR", () => $6f523efd7517f7a2$export$535bd6ca7f90a273);
6
+ var $9d939cbc98267846$exports = {};
12
7
 
8
+ $parcel$export($9d939cbc98267846$exports, "SSRProvider", () => $9d939cbc98267846$export$9f8ac96af4b1b2ae);
9
+ $parcel$export($9d939cbc98267846$exports, "useSSRSafeId", () => $9d939cbc98267846$export$619500959fc48b26);
10
+ $parcel$export($9d939cbc98267846$exports, "useIsSSR", () => $9d939cbc98267846$export$535bd6ca7f90a273);
13
11
 
14
12
  // Default context value to use in case there is no SSRProvider. This is fine for
15
13
  // client-only apps. In order to support multiple copies of React Aria potentially
16
14
  // being on the page at once, the prefix is set to a random number. SSRProvider
17
15
  // will reset this to zero for consistency between server and client, so in the
18
16
  // SSR case multiple copies of React Aria is not supported.
19
- const $6f523efd7517f7a2$var$defaultContext = {
17
+ const $9d939cbc98267846$var$defaultContext = {
20
18
  prefix: String(Math.round(Math.random() * 10000000000)),
21
19
  current: 0
22
20
  };
23
- const $6f523efd7517f7a2$var$SSRContext = /*#__PURE__*/ $fZ9Rb$react.createContext($6f523efd7517f7a2$var$defaultContext);
24
- function $6f523efd7517f7a2$export$9f8ac96af4b1b2ae(props) {
25
- let cur = $fZ9Rb$useContext($6f523efd7517f7a2$var$SSRContext);
26
- let value = $fZ9Rb$useMemo(()=>({
21
+ const $9d939cbc98267846$var$SSRContext = /*#__PURE__*/ $cgWTI$react.createContext($9d939cbc98267846$var$defaultContext);
22
+ function $9d939cbc98267846$export$9f8ac96af4b1b2ae(props) {
23
+ let cur = $cgWTI$useContext($9d939cbc98267846$var$SSRContext);
24
+ let value = $cgWTI$useMemo(()=>({
27
25
  // If this is the first SSRProvider, start with an empty string prefix, otherwise
28
26
  // append and increment the counter.
29
- prefix: cur === $6f523efd7517f7a2$var$defaultContext ? '' : `${cur.prefix}-${++cur.current}`,
27
+ prefix: cur === $9d939cbc98267846$var$defaultContext ? '' : `${cur.prefix}-${++cur.current}`,
30
28
  current: 0
31
29
  })
32
30
  , [
33
31
  cur
34
32
  ]);
35
- return(/*#__PURE__*/ $fZ9Rb$react.createElement($6f523efd7517f7a2$var$SSRContext.Provider, {
33
+ return(/*#__PURE__*/ $cgWTI$react.createElement($9d939cbc98267846$var$SSRContext.Provider, {
36
34
  value: value
37
35
  }, props.children));
38
36
  }
39
- let $6f523efd7517f7a2$var$canUseDOM = Boolean(typeof window !== 'undefined' && window.document && window.document.createElement);
40
- function $6f523efd7517f7a2$export$619500959fc48b26(defaultId) {
41
- let ctx = $fZ9Rb$useContext($6f523efd7517f7a2$var$SSRContext);
37
+ let $9d939cbc98267846$var$canUseDOM = Boolean(typeof window !== 'undefined' && window.document && window.document.createElement);
38
+ function $9d939cbc98267846$export$619500959fc48b26(defaultId) {
39
+ let ctx = $cgWTI$useContext($9d939cbc98267846$var$SSRContext);
42
40
  // If we are rendering in a non-DOM environment, and there's no SSRProvider,
43
41
  // provide a warning to hint to the developer to add one.
44
- if (ctx === $6f523efd7517f7a2$var$defaultContext && !$6f523efd7517f7a2$var$canUseDOM) console.warn('When server rendering, you must wrap your application in an <SSRProvider> to ensure consistent ids are generated between the client and server.');
45
- return $fZ9Rb$useMemo(()=>defaultId || `react-aria${ctx.prefix}-${++ctx.current}`
42
+ if (ctx === $9d939cbc98267846$var$defaultContext && !$9d939cbc98267846$var$canUseDOM) console.warn('When server rendering, you must wrap your application in an <SSRProvider> to ensure consistent ids are generated between the client and server.');
43
+ return $cgWTI$useMemo(()=>defaultId || `react-aria${ctx.prefix}-${++ctx.current}`
46
44
  , [
47
45
  defaultId
48
46
  ]);
49
47
  }
50
- function $6f523efd7517f7a2$export$535bd6ca7f90a273() {
51
- let cur = $fZ9Rb$useContext($6f523efd7517f7a2$var$SSRContext);
52
- let isInSSRContext = cur !== $6f523efd7517f7a2$var$defaultContext;
53
- let [isSSR, setIsSSR] = $fZ9Rb$useState(isInSSRContext);
48
+ function $9d939cbc98267846$export$535bd6ca7f90a273() {
49
+ let cur = $cgWTI$useContext($9d939cbc98267846$var$SSRContext);
50
+ let isInSSRContext = cur !== $9d939cbc98267846$var$defaultContext;
51
+ let [isSSR, setIsSSR] = $cgWTI$useState(isInSSRContext);
54
52
  // If on the client, and the component was initially server rendered,
55
53
  // then schedule a layout effect to update the component after hydration.
56
54
  if (typeof window !== 'undefined' && isInSSRContext) // This if statement technically breaks the rules of hooks, but is safe
57
55
  // because the condition never changes after mounting.
58
56
  // eslint-disable-next-line react-hooks/rules-of-hooks
59
- $fZ9Rb$useLayoutEffect(()=>{
57
+ $cgWTI$useLayoutEffect(()=>{
60
58
  setIsSSR(false);
61
59
  }, []);
62
60
  return isSSR;
@@ -65,5 +63,5 @@ function $6f523efd7517f7a2$export$535bd6ca7f90a273() {
65
63
 
66
64
 
67
65
 
68
- export {$6f523efd7517f7a2$export$9f8ac96af4b1b2ae as SSRProvider, $6f523efd7517f7a2$export$619500959fc48b26 as useSSRSafeId, $6f523efd7517f7a2$export$535bd6ca7f90a273 as useIsSSR};
66
+ export {$9d939cbc98267846$export$9f8ac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CAAC,gCAAU;IAE/B,EAA4E,AAA5E,0EAA4E;IAC5E,EAAyD,AAAzD,uDAAyD;IACzD,EAAE,EAAE,GAAG,KAAK,oCAAc,KAAK,+BAAS,EACtC,OAAO,CAAC,IAAI,CAAC,CAAiJ;IAGhK,MAAM,CAAC,cAAO,KAAO,SAAS,KAAK,UAAU,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,IAAI,GAAG,CAAC,OAAO;MAAI,CAAC;QAAA,SAAS;IAAA,CAAC;AAC3F,CAAC;SAOe,yCAAQ,GAAY,CAAC;IACnC,GAAG,CAAC,GAAG,GAAG,iBAAU,CAAC,gCAAU;IAC/B,GAAG,CAAC,cAAc,GAAG,GAAG,KAAK,oCAAc;IAC3C,GAAG,EAAE,KAAK,EAAE,QAAQ,IAAI,eAAQ,CAAC,cAAc;IAE/C,EAAqE,AAArE,mEAAqE;IACrE,EAAyE,AAAzE,uEAAyE;IACzE,EAAE,EAAE,MAAM,CAAC,MAAM,KAAK,CAAW,cAAI,cAAc,EACjD,EAAuE,AAAvE,qEAAuE;IACvE,EAAsD,AAAtD,oDAAsD;IACtD,EAAsD,AAAtD,oDAAsD;IACtD,sBAAe,KAAO,CAAC;QACrB,QAAQ,CAAC,KAAK;IAChB,CAAC,EAAE,CAAC,CAAC;IAGP,MAAM,CAAC,KAAK;AACd,CAAC","sources":["packages/@react-aria/ssr/src/index.ts","packages/@react-aria/ssr/src/SSRProvider.tsx"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nexport * from './SSRProvider';\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport React, {ReactNode, useContext, useMemo, useState} from 'react';\nimport {useLayoutEffect} from '@react-aria/utils';\n\n// To support SSR, the auto incrementing id counter is stored in a context. This allows\n// it to be reset on every request to ensure the client and server are consistent.\n// There is also a prefix string that is used to support async loading components\n// Each async boundary must be wrapped in an SSR provider, which appends to the prefix\n// and resets the current id counter. This ensures that async loaded components have\n// consistent ids regardless of the loading order.\ninterface SSRContextValue {\n prefix: string,\n current: number\n}\n\n// Default context value to use in case there is no SSRProvider. This is fine for\n// client-only apps. In order to support multiple copies of React Aria potentially\n// being on the page at once, the prefix is set to a random number. SSRProvider\n// will reset this to zero for consistency between server and client, so in the\n// SSR case multiple copies of React Aria is not supported.\nconst defaultContext: SSRContextValue = {\n prefix: String(Math.round(Math.random() * 10000000000)),\n current: 0\n};\n\nconst SSRContext = React.createContext<SSRContextValue>(defaultContext);\n\ninterface SSRProviderProps {\n /** Your application here. */\n children: ReactNode\n}\n\n/**\n * When using SSR with React Aria, applications must be wrapped in an SSRProvider.\n * This ensures that auto generated ids are consistent between the client and server.\n */\nexport function SSRProvider(props: SSRProviderProps): JSX.Element {\n let cur = useContext(SSRContext);\n let value: SSRContextValue = useMemo(() => ({\n // If this is the first SSRProvider, start with an empty string prefix, otherwise\n // append and increment the counter.\n prefix: cur === defaultContext ? '' : `${cur.prefix}-${++cur.current}`,\n current: 0\n }), [cur]);\n\n return (\n <SSRContext.Provider value={value}>\n {props.children}\n </SSRContext.Provider>\n );\n}\n\nlet canUseDOM = Boolean(\n typeof window !== 'undefined' &&\n window.document &&\n window.document.createElement\n);\n\n/** @private */\nexport function useSSRSafeId(defaultId?: string): string {\n let ctx = useContext(SSRContext);\n\n // If we are rendering in a non-DOM environment, and there's no SSRProvider,\n // provide a warning to hint to the developer to add one.\n if (ctx === defaultContext && !canUseDOM) {\n console.warn('When server rendering, you must wrap your application in an <SSRProvider> to ensure consistent ids are generated between the client and server.');\n }\n\n return useMemo(() => defaultId || `react-aria${ctx.prefix}-${++ctx.current}`, [defaultId]);\n}\n\n/**\n * Returns whether the component is currently being server side rendered or\n * hydrated on the client. Can be used to delay browser-specific rendering\n * until after hydration.\n */\nexport function useIsSSR(): boolean {\n let cur = useContext(SSRContext);\n let isInSSRContext = cur !== defaultContext;\n let [isSSR, setIsSSR] = useState(isInSSRContext);\n\n // If on the client, and the component was initially server rendered,\n // then schedule a layout effect to update the component after hydration.\n if (typeof window !== 'undefined' && isInSSRContext) {\n // This if statement technically breaks the rules of hooks, but is safe\n // because the condition never changes after mounting.\n // eslint-disable-next-line react-hooks/rules-of-hooks\n useLayoutEffect(() => {\n setIsSSR(false);\n }, []);\n }\n\n return isSSR;\n}\n"],"names":[],"version":3,"file":"module.js.map"}
1
+ {"mappings":";;;;;;;;;;;AC4BA,EAAiF,AAAjF,+EAAiF;AACjF,EAAkF,AAAlF,gFAAkF;AAClF,EAA+E,AAA/E,6EAA+E;AAC/E,EAA+E,AAA/E,6EAA+E;AAC/E,EAA2D,AAA3D,yDAA2D;AAC3D,KAAK,CAAC,oCAAc,GAAoB,CAAC;IACvC,MAAM,EAAE,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,KAAK,WAAW;IACrD,OAAO,EAAE,CAAC;AACZ,CAAC;AAED,KAAK,CAAC,gCAAU,iBAAG,YAAK,CAAC,aAAa,CAAkB,oCAAc;SAWtD,yCAAW,CAAC,KAAuB,EAAe,CAAC;IACjE,GAAG,CAAC,GAAG,GAAG,iBAAU,CAAC,gCAAU;IAC/B,GAAG,CAAC,KAAK,GAAoB,cAAO,MAAQ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AAAtD,oDAAsD;IACtD,EAAsD,AAAtD,oDAAsD;IACtD,sBAAe,KAAO,CAAC;QACrB,QAAQ,CAAC,KAAK;IAChB,CAAC,EAAE,CAAC,CAAC;IAGP,MAAM,CAAC,KAAK;AACd,CAAC","sources":["packages/@react-aria/ssr/src/index.ts","packages/@react-aria/ssr/src/SSRProvider.tsx"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nexport * from './SSRProvider';\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n// We must avoid a circular dependency with @react-aria/utils, and this useLayoutEffect is\n// guarded by a check that it only runs on the client side.\n// eslint-disable-next-line rulesdir/useLayoutEffectRule\nimport React, {ReactNode, useContext, useLayoutEffect, useMemo, useState} from 'react';\n\n// To support SSR, the auto incrementing id counter is stored in a context. This allows\n// it to be reset on every request to ensure the client and server are consistent.\n// There is also a prefix string that is used to support async loading components\n// Each async boundary must be wrapped in an SSR provider, which appends to the prefix\n// and resets the current id counter. This ensures that async loaded components have\n// consistent ids regardless of the loading order.\ninterface SSRContextValue {\n prefix: string,\n current: number\n}\n\n// Default context value to use in case there is no SSRProvider. This is fine for\n// client-only apps. In order to support multiple copies of React Aria potentially\n// being on the page at once, the prefix is set to a random number. SSRProvider\n// will reset this to zero for consistency between server and client, so in the\n// SSR case multiple copies of React Aria is not supported.\nconst defaultContext: SSRContextValue = {\n prefix: String(Math.round(Math.random() * 10000000000)),\n current: 0\n};\n\nconst SSRContext = React.createContext<SSRContextValue>(defaultContext);\n\ninterface SSRProviderProps {\n /** Your application here. */\n children: ReactNode\n}\n\n/**\n * When using SSR with React Aria, applications must be wrapped in an SSRProvider.\n * This ensures that auto generated ids are consistent between the client and server.\n */\nexport function SSRProvider(props: SSRProviderProps): JSX.Element {\n let cur = useContext(SSRContext);\n let value: SSRContextValue = useMemo(() => ({\n // If this is the first SSRProvider, start with an empty string prefix, otherwise\n // append and increment the counter.\n prefix: cur === defaultContext ? '' : `${cur.prefix}-${++cur.current}`,\n current: 0\n }), [cur]);\n\n return (\n <SSRContext.Provider value={value}>\n {props.children}\n </SSRContext.Provider>\n );\n}\n\nlet canUseDOM = Boolean(\n typeof window !== 'undefined' &&\n window.document &&\n window.document.createElement\n);\n\n/** @private */\nexport function useSSRSafeId(defaultId?: string): string {\n let ctx = useContext(SSRContext);\n\n // If we are rendering in a non-DOM environment, and there's no SSRProvider,\n // provide a warning to hint to the developer to add one.\n if (ctx === defaultContext && !canUseDOM) {\n console.warn('When server rendering, you must wrap your application in an <SSRProvider> to ensure consistent ids are generated between the client and server.');\n }\n\n return useMemo(() => defaultId || `react-aria${ctx.prefix}-${++ctx.current}`, [defaultId]);\n}\n\n/**\n * Returns whether the component is currently being server side rendered or\n * hydrated on the client. Can be used to delay browser-specific rendering\n * until after hydration.\n */\nexport function useIsSSR(): boolean {\n let cur = useContext(SSRContext);\n let isInSSRContext = cur !== defaultContext;\n let [isSSR, setIsSSR] = useState(isInSSRContext);\n\n // If on the client, and the component was initially server rendered,\n // then schedule a layout effect to update the component after hydration.\n if (typeof window !== 'undefined' && isInSSRContext) {\n // This if statement technically breaks the rules of hooks, but is safe\n // because the condition never changes after mounting.\n // eslint-disable-next-line react-hooks/rules-of-hooks\n useLayoutEffect(() => {\n setIsSSR(false);\n }, []);\n }\n\n return isSSR;\n}\n"],"names":[],"version":3,"file":"module.js.map"}
@@ -1 +1 @@
1
- {"mappings":";AAsCA;IACE,6BAA6B;IAC7B,QAAQ,EAAE,SAAS,CAAA;CACpB;AAED;;;GAGG;AACH,4BAA4B,KAAK,EAAE,gBAAgB,GAAG,IAAI,OAAO,CAchE;AAQD,eAAe;AACf,6BAA6B,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAUvD;AAED;;;;GAIG;AACH,4BAA4B,OAAO,CAiBlC","sources":["packages/@react-aria/ssr/src/packages/@react-aria/ssr/src/SSRProvider.tsx","packages/@react-aria/ssr/src/packages/@react-aria/ssr/src/index.ts","packages/@react-aria/ssr/src/index.ts"],"sourcesContent":[null,null,"/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nexport * from './SSRProvider';\n"],"names":[],"version":3,"file":"types.d.ts.map"}
1
+ {"mappings":";AAwCA;IACE,6BAA6B;IAC7B,QAAQ,EAAE,SAAS,CAAA;CACpB;AAED;;;GAGG;AACH,4BAA4B,KAAK,EAAE,gBAAgB,GAAG,IAAI,OAAO,CAchE;AAQD,eAAe;AACf,6BAA6B,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAUvD;AAED;;;;GAIG;AACH,4BAA4B,OAAO,CAiBlC","sources":["packages/@react-aria/ssr/src/packages/@react-aria/ssr/src/SSRProvider.tsx","packages/@react-aria/ssr/src/packages/@react-aria/ssr/src/index.ts","packages/@react-aria/ssr/src/index.ts"],"sourcesContent":[null,null,"/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nexport * from './SSRProvider';\n"],"names":[],"version":3,"file":"types.d.ts.map"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-aria/ssr",
3
- "version": "3.1.1-nightly.3100+da2aa7467",
3
+ "version": "3.1.2",
4
4
  "description": "Spectrum UI components in React",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/main.js",
@@ -17,8 +17,7 @@
17
17
  "url": "https://github.com/adobe/react-spectrum"
18
18
  },
19
19
  "dependencies": {
20
- "@babel/runtime": "^7.6.2",
21
- "@react-aria/utils": "3.0.0-nightly.1409+da2aa7467"
20
+ "@babel/runtime": "^7.6.2"
22
21
  },
23
22
  "peerDependencies": {
24
23
  "react": "^16.8.0 || ^17.0.0-rc.1"
@@ -26,5 +25,5 @@
26
25
  "publishConfig": {
27
26
  "access": "public"
28
27
  },
29
- "gitHead": "da2aa74670fbd93335ff01401ca53826b3602777"
28
+ "gitHead": "404d41859b7d6f56201d7fc01bd9f22ae3512937"
30
29
  }
@@ -10,8 +10,10 @@
10
10
  * governing permissions and limitations under the License.
11
11
  */
12
12
 
13
- import React, {ReactNode, useContext, useMemo, useState} from 'react';
14
- import {useLayoutEffect} from '@react-aria/utils';
13
+ // We must avoid a circular dependency with @react-aria/utils, and this useLayoutEffect is
14
+ // guarded by a check that it only runs on the client side.
15
+ // eslint-disable-next-line rulesdir/useLayoutEffectRule
16
+ import React, {ReactNode, useContext, useLayoutEffect, useMemo, useState} from 'react';
15
17
 
16
18
  // To support SSR, the auto incrementing id counter is stored in a context. This allows
17
19
  // it to be reset on every request to ensure the client and server are consistent.