@react-aria/ssr 3.1.2 → 3.1.3-nightly.3113

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,4 +1,4 @@
1
- var $8EJgg$react = require("react");
1
+ var $4hxXn$react = require("react");
2
2
 
3
3
  function $parcel$exportWildcard(dest, source) {
4
4
  Object.keys(source).forEach(function(key) {
@@ -22,65 +22,65 @@ function $parcel$interopDefault(a) {
22
22
  function $parcel$export(e, n, v, s) {
23
23
  Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
24
24
  }
25
- var $dac019021ac61f1f$exports = {};
25
+ var $29383e587d62412a$exports = {};
26
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);
27
+ $parcel$export($29383e587d62412a$exports, "SSRProvider", () => $29383e587d62412a$export$9f8ac96af4b1b2ae);
28
+ $parcel$export($29383e587d62412a$exports, "useSSRSafeId", () => $29383e587d62412a$export$619500959fc48b26);
29
+ $parcel$export($29383e587d62412a$exports, "useIsSSR", () => $29383e587d62412a$export$535bd6ca7f90a273);
30
30
 
31
31
  // Default context value to use in case there is no SSRProvider. This is fine for
32
32
  // client-only apps. In order to support multiple copies of React Aria potentially
33
33
  // being on the page at once, the prefix is set to a random number. SSRProvider
34
34
  // will reset this to zero for consistency between server and client, so in the
35
35
  // SSR case multiple copies of React Aria is not supported.
36
- const $dac019021ac61f1f$var$defaultContext = {
36
+ const $29383e587d62412a$var$defaultContext = {
37
37
  prefix: String(Math.round(Math.random() * 10000000000)),
38
38
  current: 0
39
39
  };
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(()=>({
40
+ const $29383e587d62412a$var$SSRContext = /*#__PURE__*/ ($parcel$interopDefault($4hxXn$react)).createContext($29383e587d62412a$var$defaultContext);
41
+ function $29383e587d62412a$export$9f8ac96af4b1b2ae(props) {
42
+ let cur = $4hxXn$react.useContext($29383e587d62412a$var$SSRContext);
43
+ let value = $4hxXn$react.useMemo(()=>({
44
44
  // If this is the first SSRProvider, start with an empty string prefix, otherwise
45
45
  // append and increment the counter.
46
- prefix: cur === $dac019021ac61f1f$var$defaultContext ? '' : `${cur.prefix}-${++cur.current}`,
46
+ prefix: cur === $29383e587d62412a$var$defaultContext ? '' : `${cur.prefix}-${++cur.current}`,
47
47
  current: 0
48
48
  })
49
49
  , [
50
50
  cur
51
51
  ]);
52
- return(/*#__PURE__*/ ($parcel$interopDefault($8EJgg$react)).createElement($dac019021ac61f1f$var$SSRContext.Provider, {
52
+ return(/*#__PURE__*/ ($parcel$interopDefault($4hxXn$react)).createElement($29383e587d62412a$var$SSRContext.Provider, {
53
53
  value: value
54
54
  }, props.children));
55
55
  }
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);
56
+ let $29383e587d62412a$var$canUseDOM = Boolean(typeof window !== 'undefined' && window.document && window.document.createElement);
57
+ function $29383e587d62412a$export$619500959fc48b26(defaultId) {
58
+ let ctx = $4hxXn$react.useContext($29383e587d62412a$var$SSRContext);
59
59
  // If we are rendering in a non-DOM environment, and there's no SSRProvider,
60
60
  // provide a warning to hint to the developer to add one.
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}`
61
+ if (ctx === $29383e587d62412a$var$defaultContext && !$29383e587d62412a$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 $4hxXn$react.useMemo(()=>defaultId || `react-aria${ctx.prefix}-${++ctx.current}`
63
63
  , [
64
64
  defaultId
65
65
  ]);
66
66
  }
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);
67
+ function $29383e587d62412a$export$535bd6ca7f90a273() {
68
+ let cur = $4hxXn$react.useContext($29383e587d62412a$var$SSRContext);
69
+ let isInSSRContext = cur !== $29383e587d62412a$var$defaultContext;
70
+ let [isSSR, setIsSSR] = $4hxXn$react.useState(isInSSRContext);
71
71
  // If on the client, and the component was initially server rendered,
72
72
  // then schedule a layout effect to update the component after hydration.
73
73
  if (typeof window !== 'undefined' && isInSSRContext) // This if statement technically breaks the rules of hooks, but is safe
74
74
  // because the condition never changes after mounting.
75
75
  // eslint-disable-next-line react-hooks/rules-of-hooks
76
- $8EJgg$react.useLayoutEffect(()=>{
76
+ $4hxXn$react.useLayoutEffect(()=>{
77
77
  setIsSSR(false);
78
78
  }, []);
79
79
  return isSSR;
80
80
  }
81
81
 
82
82
 
83
- $parcel$exportWildcard(module.exports, $dac019021ac61f1f$exports);
83
+ $parcel$exportWildcard(module.exports, $29383e587d62412a$exports);
84
84
 
85
85
 
86
86
  //# sourceMappingURL=main.js.map
package/dist/module.js CHANGED
@@ -1,60 +1,60 @@
1
- import $cgWTI$react, {useContext as $cgWTI$useContext, useMemo as $cgWTI$useMemo, useState as $cgWTI$useState, useLayoutEffect as $cgWTI$useLayoutEffect} from "react";
1
+ import $89yE2$react, {useContext as $89yE2$useContext, useMemo as $89yE2$useMemo, useState as $89yE2$useState, useLayoutEffect as $89yE2$useLayoutEffect} from "react";
2
2
 
3
3
  function $parcel$export(e, n, v, s) {
4
4
  Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
5
5
  }
6
- var $9d939cbc98267846$exports = {};
6
+ var $704cf1d3b684cc5c$exports = {};
7
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);
8
+ $parcel$export($704cf1d3b684cc5c$exports, "SSRProvider", () => $704cf1d3b684cc5c$export$9f8ac96af4b1b2ae);
9
+ $parcel$export($704cf1d3b684cc5c$exports, "useSSRSafeId", () => $704cf1d3b684cc5c$export$619500959fc48b26);
10
+ $parcel$export($704cf1d3b684cc5c$exports, "useIsSSR", () => $704cf1d3b684cc5c$export$535bd6ca7f90a273);
11
11
 
12
12
  // Default context value to use in case there is no SSRProvider. This is fine for
13
13
  // client-only apps. In order to support multiple copies of React Aria potentially
14
14
  // being on the page at once, the prefix is set to a random number. SSRProvider
15
15
  // will reset this to zero for consistency between server and client, so in the
16
16
  // SSR case multiple copies of React Aria is not supported.
17
- const $9d939cbc98267846$var$defaultContext = {
17
+ const $704cf1d3b684cc5c$var$defaultContext = {
18
18
  prefix: String(Math.round(Math.random() * 10000000000)),
19
19
  current: 0
20
20
  };
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(()=>({
21
+ const $704cf1d3b684cc5c$var$SSRContext = /*#__PURE__*/ $89yE2$react.createContext($704cf1d3b684cc5c$var$defaultContext);
22
+ function $704cf1d3b684cc5c$export$9f8ac96af4b1b2ae(props) {
23
+ let cur = $89yE2$useContext($704cf1d3b684cc5c$var$SSRContext);
24
+ let value = $89yE2$useMemo(()=>({
25
25
  // If this is the first SSRProvider, start with an empty string prefix, otherwise
26
26
  // append and increment the counter.
27
- prefix: cur === $9d939cbc98267846$var$defaultContext ? '' : `${cur.prefix}-${++cur.current}`,
27
+ prefix: cur === $704cf1d3b684cc5c$var$defaultContext ? '' : `${cur.prefix}-${++cur.current}`,
28
28
  current: 0
29
29
  })
30
30
  , [
31
31
  cur
32
32
  ]);
33
- return(/*#__PURE__*/ $cgWTI$react.createElement($9d939cbc98267846$var$SSRContext.Provider, {
33
+ return(/*#__PURE__*/ $89yE2$react.createElement($704cf1d3b684cc5c$var$SSRContext.Provider, {
34
34
  value: value
35
35
  }, props.children));
36
36
  }
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);
37
+ let $704cf1d3b684cc5c$var$canUseDOM = Boolean(typeof window !== 'undefined' && window.document && window.document.createElement);
38
+ function $704cf1d3b684cc5c$export$619500959fc48b26(defaultId) {
39
+ let ctx = $89yE2$useContext($704cf1d3b684cc5c$var$SSRContext);
40
40
  // If we are rendering in a non-DOM environment, and there's no SSRProvider,
41
41
  // provide a warning to hint to the developer to add one.
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}`
42
+ if (ctx === $704cf1d3b684cc5c$var$defaultContext && !$704cf1d3b684cc5c$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 $89yE2$useMemo(()=>defaultId || `react-aria${ctx.prefix}-${++ctx.current}`
44
44
  , [
45
45
  defaultId
46
46
  ]);
47
47
  }
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);
48
+ function $704cf1d3b684cc5c$export$535bd6ca7f90a273() {
49
+ let cur = $89yE2$useContext($704cf1d3b684cc5c$var$SSRContext);
50
+ let isInSSRContext = cur !== $704cf1d3b684cc5c$var$defaultContext;
51
+ let [isSSR, setIsSSR] = $89yE2$useState(isInSSRContext);
52
52
  // If on the client, and the component was initially server rendered,
53
53
  // then schedule a layout effect to update the component after hydration.
54
54
  if (typeof window !== 'undefined' && isInSSRContext) // This if statement technically breaks the rules of hooks, but is safe
55
55
  // because the condition never changes after mounting.
56
56
  // eslint-disable-next-line react-hooks/rules-of-hooks
57
- $cgWTI$useLayoutEffect(()=>{
57
+ $89yE2$useLayoutEffect(()=>{
58
58
  setIsSSR(false);
59
59
  }, []);
60
60
  return isSSR;
@@ -63,5 +63,5 @@ function $9d939cbc98267846$export$535bd6ca7f90a273() {
63
63
 
64
64
 
65
65
 
66
- export {$9d939cbc98267846$export$9f8ac96af4b1b2ae as SSRProvider, $9d939cbc98267846$export$619500959fc48b26 as useSSRSafeId, $9d939cbc98267846$export$535bd6ca7f90a273 as useIsSSR};
66
+ export {$704cf1d3b684cc5c$export$9f8ac96af4b1b2ae as SSRProvider, $704cf1d3b684cc5c$export$619500959fc48b26 as useSSRSafeId, $704cf1d3b684cc5c$export$535bd6ca7f90a273 as useIsSSR};
67
67
  //# sourceMappingURL=module.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-aria/ssr",
3
- "version": "3.1.2",
3
+ "version": "3.1.3-nightly.3113+404d41859",
4
4
  "description": "Spectrum UI components in React",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/main.js",