@teambit/user-agent 0.0.486 → 0.0.489
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/user-agent.ui.runtime.js +1 -3
- package/dist/user-agent.ui.runtime.js.map +1 -1
- package/package-tar/teambit-user-agent-0.0.489.tgz +0 -0
- package/package.json +4 -4
- package/{preview-1658978882481.js → preview-1659271062546.js} +2 -2
- package/user-agent.ui.runtime.tsx +1 -1
- package/package-tar/teambit-user-agent-0.0.486.tgz +0 -0
|
@@ -81,9 +81,7 @@ class UserAgentUI {
|
|
|
81
81
|
serverInit: ({
|
|
82
82
|
browser
|
|
83
83
|
}) => {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
const userAgent = new (_uaParserJs().default)(browser === null || browser === void 0 ? void 0 : (_browser$connection$h = browser.connection.headers) === null || _browser$connection$h === void 0 ? void 0 : _browser$connection$h['user-agent']);
|
|
84
|
+
const userAgent = new (_uaParserJs().default)(browser.headers['user-agent']);
|
|
87
85
|
return {
|
|
88
86
|
userAgent
|
|
89
87
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["UserAgentUI","provider","uiUi","userAgentUi","registerRenderHooks","serverInit","browser","userAgent","UAParser","
|
|
1
|
+
{"version":3,"names":["UserAgentUI","provider","uiUi","userAgentUi","registerRenderHooks","serverInit","browser","userAgent","UAParser","headers","browserInit","window","navigator","reactContext","UserAgentReactContext","UIAspect","UIRuntime","children","renderCtx","UserAgentAspect","addRuntime"],"sources":["user-agent.ui.runtime.tsx"],"sourcesContent":["import { UIAspect, UIRuntime, UiUI } from '@teambit/ui';\nimport React, { ReactNode } from 'react';\nimport UAParser from 'ua-parser-js';\nimport { UserAgentProvider } from '@teambit/ui-foundation.ui.hooks.use-user-agent';\nimport { UserAgentAspect } from './user-agent.aspect';\n\ntype UserAgentRenderCtx = {\n userAgent?: UAParser;\n};\n\n/**\n * user agent aspect\n */\nexport class UserAgentUI {\n static slots = [];\n\n static dependencies = [UIAspect];\n\n static runtime = UIRuntime;\n\n static async provider([uiUi]: [UiUI]) {\n const userAgentUi = new UserAgentUI();\n\n uiUi.registerRenderHooks<UserAgentRenderCtx, undefined>({\n serverInit: ({ browser }) => {\n const userAgent = new UAParser(browser.headers['user-agent']);\n return {\n userAgent,\n };\n },\n browserInit: () => {\n return {\n userAgent: new UAParser(window.navigator.userAgent),\n };\n },\n reactContext: UserAgentReactContext,\n });\n\n return userAgentUi;\n }\n}\n\nfunction UserAgentReactContext({ children, renderCtx }: { children: ReactNode; renderCtx?: UserAgentRenderCtx }) {\n return <UserAgentProvider value={renderCtx?.userAgent}>{children}</UserAgentProvider>;\n}\n\nUserAgentAspect.addRuntime(UserAgentUI);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAMA;AACA;AACA;AACO,MAAMA,WAAN,CAAkB;EAOF,aAARC,QAAQ,CAAC,CAACC,IAAD,CAAD,EAAiB;IACpC,MAAMC,WAAW,GAAG,IAAIH,WAAJ,EAApB;IAEAE,IAAI,CAACE,mBAAL,CAAwD;MACtDC,UAAU,EAAE,CAAC;QAAEC;MAAF,CAAD,KAAiB;QAC3B,MAAMC,SAAS,GAAG,KAAIC,qBAAJ,EAAaF,OAAO,CAACG,OAAR,CAAgB,YAAhB,CAAb,CAAlB;QACA,OAAO;UACLF;QADK,CAAP;MAGD,CANqD;MAOtDG,WAAW,EAAE,MAAM;QACjB,OAAO;UACLH,SAAS,EAAE,KAAIC,qBAAJ,EAAaG,MAAM,CAACC,SAAP,CAAiBL,SAA9B;QADN,CAAP;MAGD,CAXqD;MAYtDM,YAAY,EAAEC;IAZwC,CAAxD;IAeA,OAAOX,WAAP;EACD;;AA1BsB;;;gCAAZH,W,WACI,E;gCADJA,W,kBAGW,CAACe,cAAD,C;gCAHXf,W,aAKMgB,e;;AAwBnB,SAASF,qBAAT,CAA+B;EAAEG,QAAF;EAAYC;AAAZ,CAA/B,EAAiH;EAC/G,oBAAO,+BAAC,wCAAD;IAAmB,KAAK,EAAEA,SAAF,aAAEA,SAAF,uBAAEA,SAAS,CAAEX;EAArC,GAAiDU,QAAjD,CAAP;AACD;;AAEDE,4BAAA,CAAgBC,UAAhB,CAA2BpB,WAA3B"}
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/user-agent",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.489",
|
|
4
4
|
"homepage": "https://bit.dev/teambit/ui-foundation/user-agent",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"componentId": {
|
|
7
7
|
"scope": "teambit.ui-foundation",
|
|
8
8
|
"name": "user-agent",
|
|
9
|
-
"version": "0.0.
|
|
9
|
+
"version": "0.0.489"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"ua-parser-js": "0.7.24",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"core-js": "^3.0.0",
|
|
15
15
|
"@teambit/harmony": "0.3.3",
|
|
16
16
|
"@teambit/ui-foundation.ui.hooks.use-user-agent": "0.0.179",
|
|
17
|
-
"@teambit/ui": "0.0.
|
|
17
|
+
"@teambit/ui": "0.0.803"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
20
|
"@types/react": "^17.0.8",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"@types/node": "12.20.4"
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {
|
|
29
|
-
"@teambit/legacy": "1.0.
|
|
29
|
+
"@teambit/legacy": "1.0.317",
|
|
30
30
|
"react-dom": "^16.8.0 || ^17.0.0",
|
|
31
31
|
"react": "^16.8.0 || ^17.0.0"
|
|
32
32
|
},
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.ui-foundation_user-agent@0.0.
|
|
2
|
-
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.ui-foundation_user-agent@0.0.
|
|
1
|
+
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.ui-foundation_user-agent@0.0.489/dist/user-agent.composition.js';
|
|
2
|
+
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.ui-foundation_user-agent@0.0.489/dist/user-agent.docs.mdx';
|
|
3
3
|
|
|
4
4
|
export const compositions = [compositions_0];
|
|
5
5
|
export const overview = [overview_0];
|
|
@@ -23,7 +23,7 @@ export class UserAgentUI {
|
|
|
23
23
|
|
|
24
24
|
uiUi.registerRenderHooks<UserAgentRenderCtx, undefined>({
|
|
25
25
|
serverInit: ({ browser }) => {
|
|
26
|
-
const userAgent = new UAParser(browser
|
|
26
|
+
const userAgent = new UAParser(browser.headers['user-agent']);
|
|
27
27
|
return {
|
|
28
28
|
userAgent,
|
|
29
29
|
};
|
|
Binary file
|