@reef-knot/core-react 1.4.3 → 1.5.1

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.
@@ -0,0 +1,2 @@
1
+ export * from './localStorage';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/constants/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const LS_KEY_TERMS_ACCEPTANCE = "reef-knot_accept-terms_n2";
2
+ //# sourceMappingURL=localStorage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"localStorage.d.ts","sourceRoot":"","sources":["../../src/constants/localStorage.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,uBAAuB,8BAA8B,CAAC"}
@@ -0,0 +1,5 @@
1
+ // This key can be changed to enforce all users to accept the Terms again,
2
+ // for example if the Terms were significantly updated
3
+ const LS_KEY_TERMS_ACCEPTANCE = 'reef-knot_accept-terms_n2';
4
+
5
+ export { LS_KEY_TERMS_ACCEPTANCE };
@@ -0,0 +1,12 @@
1
+ import React, { FC } from 'react';
2
+ export type AcceptTermsModalContextValue = {
3
+ acceptTermsModal: {
4
+ isVisible: boolean;
5
+ setVisible: React.Dispatch<React.SetStateAction<boolean>>;
6
+ onContinue: () => void;
7
+ setOnContinue: React.Dispatch<React.SetStateAction<() => void>>;
8
+ };
9
+ };
10
+ export declare const AcceptTermsModalContext: React.Context<AcceptTermsModalContextValue>;
11
+ export declare const AcceptTermsModalContextProvider: FC;
12
+ //# sourceMappingURL=acceptTermsModal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acceptTermsModal.d.ts","sourceRoot":"","sources":["../../src/context/acceptTermsModal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAiB,EAAE,EAAqB,MAAM,OAAO,CAAC;AAEpE,MAAM,MAAM,4BAA4B,GAAG;IACzC,gBAAgB,EAAE;QAChB,SAAS,EAAE,OAAO,CAAC;QACnB,UAAU,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC;QAC1D,UAAU,EAAE,MAAM,IAAI,CAAC;QACvB,aAAa,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,MAAM,IAAI,CAAC,CAAC,CAAC;KACjE,CAAC;CACH,CAAC;AAKF,eAAO,MAAM,uBAAuB,6CAKF,CAAC;AAEnC,eAAO,MAAM,+BAA+B,EAAE,EA0B7C,CAAC"}
@@ -0,0 +1,29 @@
1
+ import React, { createContext, useState, useMemo } from 'react';
2
+
3
+ const isVisibleDefaultValue = false;
4
+ const onContinueDefaultValue = () => void 0;
5
+ const AcceptTermsModalContext = createContext({
6
+ acceptTermsModal: {
7
+ isVisible: isVisibleDefaultValue,
8
+ onContinue: onContinueDefaultValue
9
+ }
10
+ });
11
+ const AcceptTermsModalContextProvider = ({
12
+ children
13
+ }) => {
14
+ const [isAcceptTermsModalVisible, setIsAcceptTermsModalVisible] = useState(isVisibleDefaultValue);
15
+ const [onAcceptTermsModalContinue, setOnAcceptTermsModalContinue] = useState(() => onContinueDefaultValue);
16
+ const contextValue = useMemo(() => ({
17
+ acceptTermsModal: {
18
+ isVisible: isAcceptTermsModalVisible,
19
+ setVisible: setIsAcceptTermsModalVisible,
20
+ onContinue: onAcceptTermsModalContinue,
21
+ setOnContinue: setOnAcceptTermsModalContinue
22
+ }
23
+ }), [isAcceptTermsModalVisible, onAcceptTermsModalContinue]);
24
+ return React.createElement(AcceptTermsModalContext.Provider, {
25
+ value: contextValue
26
+ }, children);
27
+ };
28
+
29
+ export { AcceptTermsModalContext, AcceptTermsModalContextProvider };
@@ -1,16 +1,3 @@
1
- import React, { FC } from 'react';
2
- import { WalletAdapterData } from '@reef-knot/types';
3
- import { Chain } from 'wagmi/chains';
4
- export interface ReefKnotContextProps {
5
- rpc: Record<number, string>;
6
- walletconnectProjectId?: string;
7
- chains: Chain[];
8
- defaultChain?: Chain;
9
- }
10
- export type ReefKnotContextValue = {
11
- rpc: Record<number, string>;
12
- walletDataList: WalletAdapterData[];
13
- };
14
- export declare const ReefKnotContext: React.Context<ReefKnotContextValue>;
15
- export declare const ReefKnot: FC<ReefKnotContextProps>;
1
+ export * from './reefKnot';
2
+ export * from './acceptTermsModal';
16
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/context/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAiB,EAAE,EAAW,MAAM,OAAO,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAIrC,MAAM,WAAW,oBAAoB;IACnC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC5B,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,MAAM,EAAE,KAAK,EAAE,CAAC;IAChB,YAAY,CAAC,EAAE,KAAK,CAAC;CACtB;AAED,MAAM,MAAM,oBAAoB,GAAG;IACjC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC5B,cAAc,EAAE,iBAAiB,EAAE,CAAC;CACrC,CAAC;AAEF,eAAO,MAAM,eAAe,qCAA4C,CAAC;AAEzE,eAAO,MAAM,QAAQ,EAAE,EAAE,CAAC,oBAAoB,CAwB7C,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/context/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA;AAC1B,cAAc,oBAAoB,CAAA"}
@@ -0,0 +1,16 @@
1
+ import React, { FC } from 'react';
2
+ import { WalletAdapterData } from '@reef-knot/types';
3
+ import { Chain } from 'wagmi/chains';
4
+ export interface ReefKnotContextProps {
5
+ rpc: Record<number, string>;
6
+ walletconnectProjectId?: string;
7
+ chains: Chain[];
8
+ defaultChain?: Chain;
9
+ }
10
+ export type ReefKnotContextValue = {
11
+ rpc: Record<number, string>;
12
+ walletDataList: WalletAdapterData[];
13
+ };
14
+ export declare const ReefKnotContext: React.Context<ReefKnotContextValue>;
15
+ export declare const ReefKnot: FC<ReefKnotContextProps>;
16
+ //# sourceMappingURL=reefKnot.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reefKnot.d.ts","sourceRoot":"","sources":["../../src/context/reefKnot.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAiB,EAAE,EAAW,MAAM,OAAO,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAKrC,MAAM,WAAW,oBAAoB;IACnC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC5B,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,MAAM,EAAE,KAAK,EAAE,CAAC;IAChB,YAAY,CAAC,EAAE,KAAK,CAAC;CACtB;AAED,MAAM,MAAM,oBAAoB,GAAG;IACjC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC5B,cAAc,EAAE,iBAAiB,EAAE,CAAC;CACrC,CAAC;AAEF,eAAO,MAAM,eAAe,qCAA4C,CAAC;AAEzE,eAAO,MAAM,QAAQ,EAAE,EAAE,CAAC,oBAAoB,CA6B7C,CAAC"}
@@ -1,6 +1,7 @@
1
1
  import React, { createContext, useMemo } from 'react';
2
2
  import { WCWarnBannerContextProvider } from '@reef-knot/ui-react';
3
3
  import { getWalletDataList } from '../walletData/index.js';
4
+ import { AcceptTermsModalContextProvider } from './acceptTermsModal.js';
4
5
 
5
6
  const ReefKnotContext = createContext({});
6
7
  const ReefKnot = ({
@@ -22,7 +23,7 @@ const ReefKnot = ({
22
23
  }), [rpc, walletDataList]);
23
24
  return React.createElement(ReefKnotContext.Provider, {
24
25
  value: contextValue
25
- }, React.createElement(WCWarnBannerContextProvider, null, children));
26
+ }, React.createElement(AcceptTermsModalContextProvider, null, React.createElement(WCWarnBannerContextProvider, null, children)));
26
27
  };
27
28
 
28
29
  export { ReefKnot, ReefKnotContext };
@@ -1,3 +1,3 @@
1
- import { ReefKnotContextValue } from '../context';
1
+ import { ReefKnotContextValue } from '../context/reefKnot';
2
2
  export declare const useReefKnotContext: () => ReefKnotContextValue;
3
3
  //# sourceMappingURL=useReefKnotContext.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useReefKnotContext.d.ts","sourceRoot":"","sources":["../../src/hooks/useReefKnotContext.ts"],"names":[],"mappings":"AACA,OAAO,EAAmB,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAEnE,eAAO,MAAM,kBAAkB,QAAO,oBACT,CAAC"}
1
+ {"version":3,"file":"useReefKnotContext.d.ts","sourceRoot":"","sources":["../../src/hooks/useReefKnotContext.ts"],"names":[],"mappings":"AACA,OAAO,EAAmB,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAE5E,eAAO,MAAM,kBAAkB,QAAO,oBACT,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { useContext } from 'react';
2
- import { ReefKnotContext } from '../context/index.js';
2
+ import { ReefKnotContext } from '../context/reefKnot.js';
3
3
 
4
4
  const useReefKnotContext = () => useContext(ReefKnotContext);
5
5
 
package/dist/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  export * from './walletData';
2
- export * from './context';
3
2
  export * from './hooks';
3
+ export * from './context';
4
+ export * from './constants';
4
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC"}
package/dist/index.js CHANGED
@@ -1,3 +1,5 @@
1
1
  export { getConnectors, getWalletDataList } from './walletData/index.js';
2
- export { ReefKnot, ReefKnotContext } from './context/index.js';
3
2
  export { useReefKnotContext } from './hooks/useReefKnotContext.js';
3
+ export { ReefKnot, ReefKnotContext } from './context/reefKnot.js';
4
+ export { AcceptTermsModalContext, AcceptTermsModalContextProvider } from './context/acceptTermsModal.js';
5
+ export { LS_KEY_TERMS_ACCEPTANCE } from './constants/localStorage.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reef-knot/core-react",
3
- "version": "1.4.3",
3
+ "version": "1.5.1",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "exports": {
@@ -38,14 +38,14 @@
38
38
  },
39
39
  "devDependencies": {
40
40
  "react": "17.0.2",
41
- "wagmi": "^0.12.18",
42
- "@reef-knot/wallets-list": "^1.4.3",
43
- "@reef-knot/types": "^1.2.2",
44
- "@reef-knot/ui-react": "^1.0.6"
41
+ "wagmi": "^0.12.19",
42
+ "@reef-knot/wallets-list": "^1.4.4",
43
+ "@reef-knot/types": "^1.3.0",
44
+ "@reef-knot/ui-react": "^1.0.7"
45
45
  },
46
46
  "peerDependencies": {
47
47
  "react": ">=17",
48
- "wagmi": "^0.12.18",
48
+ "wagmi": "^0.12.19",
49
49
  "@reef-knot/wallets-list": "^1.4.1",
50
50
  "@reef-knot/types": "^1.2.1",
51
51
  "@reef-knot/ui-react": "^1.0.4"