@coorpacademy/components 10.22.26 → 10.22.27-alpha.0
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.
|
@@ -6,9 +6,14 @@ const Context = createContext({
|
|
|
6
6
|
});
|
|
7
7
|
|
|
8
8
|
const WebContext = ({
|
|
9
|
-
|
|
9
|
+
skin,
|
|
10
|
+
translate,
|
|
10
11
|
children
|
|
11
12
|
}) => {
|
|
13
|
+
const values = {
|
|
14
|
+
skin,
|
|
15
|
+
translate
|
|
16
|
+
};
|
|
12
17
|
return /*#__PURE__*/React.createElement(Context.Provider, {
|
|
13
18
|
value: _extends({}, values)
|
|
14
19
|
}, children);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/atom/provider/web-context.tsx"],"names":["React","createContext","useContext","Context","translate","key","WebContext","
|
|
1
|
+
{"version":3,"sources":["../../../src/atom/provider/web-context.tsx"],"names":["React","createContext","useContext","Context","translate","key","WebContext","skin","children","values","useWebContext","context","Error"],"mappings":";;AAAA,OAAOA,KAAP,IAAeC,aAAf,EAA8BC,UAA9B,QAA+C,OAA/C;AAaA,MAAMC,OAAO,GAAGF,aAAa,CAAC;AAC5BG,EAAAA,SAAS,EAAGC,GAAD,IAAiBA;AADA,CAAD,CAA7B;;AAQA,MAAMC,UAAU,GAAG,CAAC;AAACC,EAAAA,IAAD;AAAOH,EAAAA,SAAP;AAAkBI,EAAAA;AAAlB,CAAD,KAAwC;AACzD,QAAMC,MAAM,GAAG;AAACF,IAAAA,IAAD;AAAOH,IAAAA;AAAP,GAAf;AACA,sBAAO,oBAAC,OAAD,CAAS,QAAT;AAAkB,IAAA,KAAK,eAAMK,MAAN;AAAvB,KAAuCD,QAAvC,CAAP;AACD,CAHD;;AAKA,OAAO,MAAME,aAAa,GAAG,MAAwB;AACnD,QAAMC,OAAO,GAAGT,UAAU,CAACC,OAAD,CAA1B;;AAEA,MAAI,CAACQ,OAAL,EAAc;AACZ,UAAM,IAAIC,KAAJ,CAAU,0EAAV,CAAN;AACD;;AAED,SAAOD,OAAP;AACD,CARM;AAUP,eAAeL,UAAf","sourcesContent":["import React, {createContext, useContext} from 'react';\n\ntype Skin = {\n common: {\n primary: string;\n };\n};\n\ntype WebContextValues = {\n skin?: Skin;\n translate: (key: string) => string;\n};\n\nconst Context = createContext({\n translate: (key: string) => key\n});\n\ntype Props = WebContextValues & {\n children: any;\n};\n\nconst WebContext = ({skin, translate, children}: Props) => {\n const values = {skin, translate};\n return <Context.Provider value={{...values}}>{children}</Context.Provider>;\n};\n\nexport const useWebContext = (): WebContextValues => {\n const context = useContext(Context);\n\n if (!context) {\n throw new Error('❌ [WebContext] useWebContext must be used within a provider <WebContext>');\n }\n\n return context;\n};\n\nexport default WebContext;\n"],"file":"web-context.js"}
|
|
@@ -16,9 +16,14 @@ const Context = (0, _react.createContext)({
|
|
|
16
16
|
});
|
|
17
17
|
|
|
18
18
|
const WebContext = ({
|
|
19
|
-
|
|
19
|
+
skin,
|
|
20
|
+
translate,
|
|
20
21
|
children
|
|
21
22
|
}) => {
|
|
23
|
+
const values = {
|
|
24
|
+
skin,
|
|
25
|
+
translate
|
|
26
|
+
};
|
|
22
27
|
return /*#__PURE__*/_react.default.createElement(Context.Provider, {
|
|
23
28
|
value: _extends({}, values)
|
|
24
29
|
}, children);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/atom/provider/web-context.tsx"],"names":["Context","translate","key","WebContext","
|
|
1
|
+
{"version":3,"sources":["../../../src/atom/provider/web-context.tsx"],"names":["Context","translate","key","WebContext","skin","children","values","useWebContext","context","Error"],"mappings":";;;;;AAAA;;;;;;;;AAaA,MAAMA,OAAO,GAAG,0BAAc;AAC5BC,EAAAA,SAAS,EAAGC,GAAD,IAAiBA;AADA,CAAd,CAAhB;;AAQA,MAAMC,UAAU,GAAG,CAAC;AAACC,EAAAA,IAAD;AAAOH,EAAAA,SAAP;AAAkBI,EAAAA;AAAlB,CAAD,KAAwC;AACzD,QAAMC,MAAM,GAAG;AAACF,IAAAA,IAAD;AAAOH,IAAAA;AAAP,GAAf;AACA,sBAAO,6BAAC,OAAD,CAAS,QAAT;AAAkB,IAAA,KAAK,eAAMK,MAAN;AAAvB,KAAuCD,QAAvC,CAAP;AACD,CAHD;;AAKO,MAAME,aAAa,GAAG,MAAwB;AACnD,QAAMC,OAAO,GAAG,uBAAWR,OAAX,CAAhB;;AAEA,MAAI,CAACQ,OAAL,EAAc;AACZ,UAAM,IAAIC,KAAJ,CAAU,0EAAV,CAAN;AACD;;AAED,SAAOD,OAAP;AACD,CARM;;;eAUQL,U","sourcesContent":["import React, {createContext, useContext} from 'react';\n\ntype Skin = {\n common: {\n primary: string;\n };\n};\n\ntype WebContextValues = {\n skin?: Skin;\n translate: (key: string) => string;\n};\n\nconst Context = createContext({\n translate: (key: string) => key\n});\n\ntype Props = WebContextValues & {\n children: any;\n};\n\nconst WebContext = ({skin, translate, children}: Props) => {\n const values = {skin, translate};\n return <Context.Provider value={{...values}}>{children}</Context.Provider>;\n};\n\nexport const useWebContext = (): WebContextValues => {\n const context = useContext(Context);\n\n if (!context) {\n throw new Error('❌ [WebContext] useWebContext must be used within a provider <WebContext>');\n }\n\n return context;\n};\n\nexport default WebContext;\n"],"file":"web-context.js"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coorpacademy/components",
|
|
3
|
-
"version": "10.22.
|
|
3
|
+
"version": "10.22.27-alpha.0+03d592dab",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -140,5 +140,5 @@
|
|
|
140
140
|
"webpack": "^4.43.0"
|
|
141
141
|
},
|
|
142
142
|
"author": "CoorpAcademy",
|
|
143
|
-
"gitHead": "
|
|
143
|
+
"gitHead": "03d592dab8bfc42e86357300c4c066d2a288f6d4"
|
|
144
144
|
}
|