@tramvai/module-client-hints 1.72.1 → 1.74.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.
- package/lib/browser.d.ts +1 -0
- package/lib/browser.js +16 -1
- package/lib/child-app/module.d.ts +2 -0
- package/lib/server.d.ts +1 -0
- package/lib/server.es.js +16 -1
- package/lib/server.js +15 -0
- package/package.json +7 -6
package/lib/browser.d.ts
CHANGED
|
@@ -3,5 +3,6 @@ export * from './shared/stores/mediaCheckers';
|
|
|
3
3
|
export * from './shared/stores/mediaSelectors';
|
|
4
4
|
export * from './shared/stores/media';
|
|
5
5
|
export * from './shared/stores/userAgent';
|
|
6
|
+
export { ClientHintsChildAppModule } from './child-app/module';
|
|
6
7
|
export declare class ClientHintsModule {
|
|
7
8
|
}
|
package/lib/browser.js
CHANGED
|
@@ -4,6 +4,7 @@ import { COMBINE_REDUCERS, STORE_TOKEN, CONTEXT_TOKEN, COOKIE_MANAGER_TOKEN } fr
|
|
|
4
4
|
import { createToken } from '@tinkoff/dippy';
|
|
5
5
|
import debounce from '@tinkoff/utils/function/debounce';
|
|
6
6
|
import { createEvent, createReducer, useSelector } from '@tramvai/state';
|
|
7
|
+
import { CHILD_APP_INTERNAL_ROOT_STATE_ALLOWED_STORE_TOKEN } from '@tramvai/tokens-child-app';
|
|
7
8
|
|
|
8
9
|
const USER_AGENT_TOKEN = createToken('userAgent');
|
|
9
10
|
|
|
@@ -88,6 +89,20 @@ function useIsRetina() {
|
|
|
88
89
|
return isRetina(useMedia());
|
|
89
90
|
}
|
|
90
91
|
|
|
92
|
+
let ClientHintsChildAppModule = class ClientHintsChildAppModule {
|
|
93
|
+
};
|
|
94
|
+
ClientHintsChildAppModule = __decorate([
|
|
95
|
+
Module({
|
|
96
|
+
providers: [
|
|
97
|
+
{
|
|
98
|
+
provide: CHILD_APP_INTERNAL_ROOT_STATE_ALLOWED_STORE_TOKEN,
|
|
99
|
+
multi: true,
|
|
100
|
+
useValue: MediaStore,
|
|
101
|
+
},
|
|
102
|
+
],
|
|
103
|
+
})
|
|
104
|
+
], ClientHintsChildAppModule);
|
|
105
|
+
|
|
91
106
|
let ClientHintsModule = class ClientHintsModule {
|
|
92
107
|
};
|
|
93
108
|
ClientHintsModule = __decorate([
|
|
@@ -116,4 +131,4 @@ ClientHintsModule = __decorate([
|
|
|
116
131
|
})
|
|
117
132
|
], ClientHintsModule);
|
|
118
133
|
|
|
119
|
-
export { ClientHintsModule, MediaStore, USER_AGENT_TOKEN, UserAgentStore, fromClientHints, isRetina, isSupposed, setMedia, setUserAgent, useFromClientHints, useIsRetina, useIsSupposed, useMedia };
|
|
134
|
+
export { ClientHintsChildAppModule, ClientHintsModule, MediaStore, USER_AGENT_TOKEN, UserAgentStore, fromClientHints, isRetina, isSupposed, setMedia, setUserAgent, useFromClientHints, useIsRetina, useIsSupposed, useMedia };
|
package/lib/server.d.ts
CHANGED
|
@@ -3,5 +3,6 @@ export * from './shared/stores/mediaCheckers';
|
|
|
3
3
|
export * from './shared/stores/mediaSelectors';
|
|
4
4
|
export * from './shared/stores/media';
|
|
5
5
|
export * from './shared/stores/userAgent';
|
|
6
|
+
export { ClientHintsChildAppModule } from './child-app/module';
|
|
6
7
|
export declare class ClientHintsModule {
|
|
7
8
|
}
|
package/lib/server.es.js
CHANGED
|
@@ -6,6 +6,7 @@ import { createEvent, createReducer, useSelector } from '@tramvai/state';
|
|
|
6
6
|
import pathOr from '@tinkoff/utils/object/pathOr';
|
|
7
7
|
import { safeParseJSON } from '@tramvai/safe-strings';
|
|
8
8
|
import { createToken } from '@tinkoff/dippy';
|
|
9
|
+
import { CHILD_APP_INTERNAL_ROOT_STATE_ALLOWED_STORE_TOKEN } from '@tramvai/tokens-child-app';
|
|
9
10
|
|
|
10
11
|
const setUserAgent = createEvent('setUserAgent');
|
|
11
12
|
const UserAgentStore = createReducer('userAgent', null).on(setUserAgent, (state, userAgent) => {
|
|
@@ -98,6 +99,20 @@ function useIsRetina() {
|
|
|
98
99
|
return isRetina(useMedia());
|
|
99
100
|
}
|
|
100
101
|
|
|
102
|
+
let ClientHintsChildAppModule = class ClientHintsChildAppModule {
|
|
103
|
+
};
|
|
104
|
+
ClientHintsChildAppModule = __decorate([
|
|
105
|
+
Module({
|
|
106
|
+
providers: [
|
|
107
|
+
{
|
|
108
|
+
provide: CHILD_APP_INTERNAL_ROOT_STATE_ALLOWED_STORE_TOKEN,
|
|
109
|
+
multi: true,
|
|
110
|
+
useValue: MediaStore,
|
|
111
|
+
},
|
|
112
|
+
],
|
|
113
|
+
})
|
|
114
|
+
], ClientHintsChildAppModule);
|
|
115
|
+
|
|
101
116
|
let ClientHintsModule = class ClientHintsModule {
|
|
102
117
|
};
|
|
103
118
|
ClientHintsModule = __decorate([
|
|
@@ -156,4 +171,4 @@ ClientHintsModule = __decorate([
|
|
|
156
171
|
})
|
|
157
172
|
], ClientHintsModule);
|
|
158
173
|
|
|
159
|
-
export { ClientHintsModule, MediaStore, USER_AGENT_TOKEN, UserAgentStore, fromClientHints, isRetina, isSupposed, setMedia, setUserAgent, useFromClientHints, useIsRetina, useIsSupposed, useMedia };
|
|
174
|
+
export { ClientHintsChildAppModule, ClientHintsModule, MediaStore, USER_AGENT_TOKEN, UserAgentStore, fromClientHints, isRetina, isSupposed, setMedia, setUserAgent, useFromClientHints, useIsRetina, useIsSupposed, useMedia };
|
package/lib/server.js
CHANGED
|
@@ -10,6 +10,7 @@ var state = require('@tramvai/state');
|
|
|
10
10
|
var pathOr = require('@tinkoff/utils/object/pathOr');
|
|
11
11
|
var safeStrings = require('@tramvai/safe-strings');
|
|
12
12
|
var dippy = require('@tinkoff/dippy');
|
|
13
|
+
var tokensChildApp = require('@tramvai/tokens-child-app');
|
|
13
14
|
|
|
14
15
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
15
16
|
|
|
@@ -106,6 +107,20 @@ function useIsRetina() {
|
|
|
106
107
|
return isRetina(useMedia());
|
|
107
108
|
}
|
|
108
109
|
|
|
110
|
+
exports.ClientHintsChildAppModule = class ClientHintsChildAppModule {
|
|
111
|
+
};
|
|
112
|
+
exports.ClientHintsChildAppModule = tslib.__decorate([
|
|
113
|
+
core.Module({
|
|
114
|
+
providers: [
|
|
115
|
+
{
|
|
116
|
+
provide: tokensChildApp.CHILD_APP_INTERNAL_ROOT_STATE_ALLOWED_STORE_TOKEN,
|
|
117
|
+
multi: true,
|
|
118
|
+
useValue: MediaStore,
|
|
119
|
+
},
|
|
120
|
+
],
|
|
121
|
+
})
|
|
122
|
+
], exports.ClientHintsChildAppModule);
|
|
123
|
+
|
|
109
124
|
exports.ClientHintsModule = class ClientHintsModule {
|
|
110
125
|
};
|
|
111
126
|
exports.ClientHintsModule = tslib.__decorate([
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tramvai/module-client-hints",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.74.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib/server.js",
|
|
6
6
|
"module": "lib/server.es.js",
|
|
@@ -20,14 +20,15 @@
|
|
|
20
20
|
"build-for-publish": "true"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@tinkoff/user-agent": "0.3.
|
|
23
|
+
"@tinkoff/user-agent": "0.3.268",
|
|
24
24
|
"@tinkoff/utils": "^2.1.2",
|
|
25
|
-
"@tramvai/safe-strings": "0.4.3"
|
|
25
|
+
"@tramvai/safe-strings": "0.4.3",
|
|
26
|
+
"@tramvai/tokens-child-app": "1.74.0"
|
|
26
27
|
},
|
|
27
28
|
"peerDependencies": {
|
|
28
|
-
"@tramvai/core": "1.
|
|
29
|
-
"@tramvai/module-common": "1.
|
|
30
|
-
"@tramvai/state": "1.
|
|
29
|
+
"@tramvai/core": "1.74.0",
|
|
30
|
+
"@tramvai/module-common": "1.74.0",
|
|
31
|
+
"@tramvai/state": "1.74.0",
|
|
31
32
|
"@tinkoff/dippy": "0.7.38",
|
|
32
33
|
"react": ">=16.8.0",
|
|
33
34
|
"react-dom": ">=16.8.0",
|