@xyo-network/react-storybook 2.33.7 → 2.33.8
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/cjs/authDecorator.d.ts.map +1 -1
- package/dist/cjs/authDecorator.js +1 -3
- package/dist/cjs/authDecorator.js.map +1 -1
- package/dist/docs.json +133 -133
- package/dist/esm/authDecorator.d.ts.map +1 -1
- package/dist/esm/authDecorator.js +2 -4
- package/dist/esm/authDecorator.js.map +1 -1
- package/package.json +6 -6
- package/src/authDecorator.tsx +2 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authDecorator.d.ts","sourceRoot":"","sources":["../../src/authDecorator.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"authDecorator.d.ts","sourceRoot":"","sources":["../../src/authDecorator.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAuB9C,eAAO,MAAM,aAAa,EAAE,WAmB3B,CAAA"}
|
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { useTheme } from '@mui/material';
|
|
3
2
|
import { FlexGrowCol } from '@xylabs/react-flexbox';
|
|
4
3
|
import { ArchivistApiProvider, useArchivistApi } from '@xyo-network/react-archivist-api';
|
|
5
|
-
import { AuthProvider, AuthServiceProvider,
|
|
4
|
+
import { AuthProvider, AuthServiceProvider, defaultState, useAuthState } from '@xyo-network/react-auth';
|
|
6
5
|
import { WalletServiceProvider } from '@xyo-network/react-wallet-service';
|
|
7
6
|
import { BrowserRouter } from 'react-router-dom';
|
|
8
7
|
const WithArchivistApi = ({ children }) => {
|
|
9
8
|
const { state } = useAuthState();
|
|
10
9
|
const { api } = useArchivistApi();
|
|
11
|
-
const theme = useTheme();
|
|
12
10
|
if (state) {
|
|
13
|
-
return (_jsx(ArchivistApiProvider, { apiDomain: api?.config.apiDomain ?? 'https://beta.api.archivist.xyo.network', jwtToken: state.jwtToken, required: true, children:
|
|
11
|
+
return (_jsx(ArchivistApiProvider, { apiDomain: api?.config.apiDomain ?? 'https://beta.api.archivist.xyo.network', jwtToken: state.jwtToken, required: true, children: children }));
|
|
14
12
|
}
|
|
15
13
|
else {
|
|
16
14
|
return _jsx(_Fragment, {});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authDecorator.js","sourceRoot":"","sources":["../../src/authDecorator.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"authDecorator.js","sourceRoot":"","sources":["../../src/authDecorator.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAEnD,OAAO,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAA;AACxF,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AACvG,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAA;AACzE,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAEhD,MAAM,gBAAgB,GAA2B,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE;IAChE,MAAM,EAAE,KAAK,EAAE,GAAG,YAAY,EAAE,CAAA;IAChC,MAAM,EAAE,GAAG,EAAE,GAAG,eAAe,EAAE,CAAA;IAEjC,IAAI,KAAK,EAAE;QACT,OAAO,CACL,KAAC,oBAAoB,IAAC,SAAS,EAAE,GAAG,EAAE,MAAM,CAAC,SAAS,IAAI,wCAAwC,EAAE,QAAQ,EAAE,KAAK,CAAC,QAAQ,EAAE,QAAQ,kBACnI,QAAQ,GACY,CACxB,CAAA;KACF;SAAM;QACL,OAAO,mBAAK,CAAA;KACb;AACH,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,aAAa,GAAgB,CAAC,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;IAC5D,MAAM,EAAE,SAAS,EAAE,GAAG,IAAI,CAAA;IAC1B,MAAM,eAAe,GAAG,EAAE,GAAG,YAAY,EAAE,EAAE,GAAG,SAAS,EAAE,CAAA;IAE3D,OAAO,CACL,KAAC,WAAW,IAAC,OAAO,EAAE,CAAC,EAAE,cAAc,EAAC,YAAY,EAAC,UAAU,EAAC,QAAQ,YACtE,KAAC,aAAa,cACZ,KAAC,YAAY,IAAC,SAAS,EAAE,eAAe,YACtC,KAAC,mBAAmB,cAClB,KAAC,qBAAqB,cACpB,KAAC,gBAAgB,cACf,KAAC,KAAK,OAAK,IAAI,GAAI,GACF,GACG,GACJ,GACT,GACD,GACJ,CACf,CAAA;AACH,CAAC,CAAA"}
|
package/package.json
CHANGED
|
@@ -23,11 +23,11 @@
|
|
|
23
23
|
"@xyo-network/boundwitness": "^2.31.5",
|
|
24
24
|
"@xyo-network/core": "^2.31.5",
|
|
25
25
|
"@xyo-network/payload": "^2.31.5",
|
|
26
|
-
"@xyo-network/react-archivist-api": "^2.33.
|
|
27
|
-
"@xyo-network/react-auth": "^2.33.
|
|
28
|
-
"@xyo-network/react-map": "^2.33.
|
|
29
|
-
"@xyo-network/react-theme": "^2.33.
|
|
30
|
-
"@xyo-network/react-wallet-service": "^2.33.
|
|
26
|
+
"@xyo-network/react-archivist-api": "^2.33.8",
|
|
27
|
+
"@xyo-network/react-auth": "^2.33.8",
|
|
28
|
+
"@xyo-network/react-map": "^2.33.8",
|
|
29
|
+
"@xyo-network/react-theme": "^2.33.8",
|
|
30
|
+
"@xyo-network/react-wallet-service": "^2.33.8",
|
|
31
31
|
"lodash": "^4.17.21",
|
|
32
32
|
"require-from-string": "^2.0.2",
|
|
33
33
|
"storybook-dark-mode": "^1.1.0",
|
|
@@ -88,5 +88,5 @@
|
|
|
88
88
|
},
|
|
89
89
|
"sideEffects": false,
|
|
90
90
|
"types": "dist/esm/index.d.ts",
|
|
91
|
-
"version": "2.33.
|
|
91
|
+
"version": "2.33.8"
|
|
92
92
|
}
|
package/src/authDecorator.tsx
CHANGED
|
@@ -1,21 +1,19 @@
|
|
|
1
|
-
import { useTheme } from '@mui/material'
|
|
2
1
|
import { DecoratorFn } from '@storybook/react'
|
|
3
2
|
import { FlexGrowCol } from '@xylabs/react-flexbox'
|
|
4
3
|
import { WithChildren } from '@xylabs/react-shared'
|
|
5
4
|
import { ArchivistApiProvider, useArchivistApi } from '@xyo-network/react-archivist-api'
|
|
6
|
-
import { AuthProvider, AuthServiceProvider,
|
|
5
|
+
import { AuthProvider, AuthServiceProvider, defaultState, useAuthState } from '@xyo-network/react-auth'
|
|
7
6
|
import { WalletServiceProvider } from '@xyo-network/react-wallet-service'
|
|
8
7
|
import { BrowserRouter } from 'react-router-dom'
|
|
9
8
|
|
|
10
9
|
const WithArchivistApi: React.FC<WithChildren> = ({ children }) => {
|
|
11
10
|
const { state } = useAuthState()
|
|
12
11
|
const { api } = useArchivistApi()
|
|
13
|
-
const theme = useTheme()
|
|
14
12
|
|
|
15
13
|
if (state) {
|
|
16
14
|
return (
|
|
17
15
|
<ArchivistApiProvider apiDomain={api?.config.apiDomain ?? 'https://beta.api.archivist.xyo.network'} jwtToken={state.jwtToken} required>
|
|
18
|
-
|
|
16
|
+
{children}
|
|
19
17
|
</ArchivistApiProvider>
|
|
20
18
|
)
|
|
21
19
|
} else {
|