@tramvai/module-client-hints 2.33.1 → 2.33.3

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.
Files changed (2) hide show
  1. package/README.md +15 -1
  2. package/package.json +9 -9
package/README.md CHANGED
@@ -33,12 +33,26 @@ Client Hints modules provides the way to solve this problem in some way. It stor
33
33
 
34
34
  #### First page loading
35
35
 
36
- When user enters the app for the first time module tries to determine type of the user device using user-agent string. Then it saves this **assumptive** data to `media` store. E.g. when user loads page from the desktop, then content of the `media` store will be following:
36
+ :::warn
37
+
38
+ When user enters the app for the first time, information about **real** device screen size and type **not available** in server-side code.
39
+
40
+ :::
41
+
42
+ This module tries to determine type of the user device using user-agent string, and separates the devices into three groups:
43
+ - `mobile`
44
+ - `tablet`
45
+ - `desktop`
46
+
47
+ Then it saves this **assumptive** information about device screen to `media` store. E.g. when user loads page from the desktop, then content of the `media` store will be following:
37
48
 
38
49
  ```tsx
39
50
  const state = {
51
+ // desktop - 1024px, tablet - 600px, mobile - 300px
40
52
  width: 1024,
53
+ // desktop - 768px, tablet - 800px, mobile - 500px
41
54
  height: 768,
55
+ // desktop - false, tablet - true, mobile - true
42
56
  isTouch: false,
43
57
  retina: false,
44
58
  supposed: true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tramvai/module-client-hints",
3
- "version": "2.33.1",
3
+ "version": "2.33.3",
4
4
  "description": "",
5
5
  "main": "lib/server.js",
6
6
  "module": "lib/server.es.js",
@@ -20,17 +20,17 @@
20
20
  "build-for-publish": "true"
21
21
  },
22
22
  "dependencies": {
23
- "@tinkoff/user-agent": "0.4.74",
23
+ "@tinkoff/user-agent": "0.4.76",
24
24
  "@tinkoff/utils": "^2.1.2",
25
- "@tramvai/safe-strings": "0.5.4",
26
- "@tramvai/tokens-common": "2.33.1",
27
- "@tramvai/tokens-cookie": "2.33.1",
28
- "@tramvai/tokens-child-app": "2.33.1"
25
+ "@tramvai/safe-strings": "0.5.5",
26
+ "@tramvai/tokens-common": "2.33.3",
27
+ "@tramvai/tokens-cookie": "2.33.3",
28
+ "@tramvai/tokens-child-app": "2.33.3"
29
29
  },
30
30
  "peerDependencies": {
31
- "@tramvai/core": "2.33.1",
32
- "@tramvai/state": "2.33.1",
33
- "@tinkoff/dippy": "0.8.7",
31
+ "@tramvai/core": "2.33.3",
32
+ "@tramvai/state": "2.33.3",
33
+ "@tinkoff/dippy": "0.8.8",
34
34
  "react": ">=16.14.0",
35
35
  "react-dom": ">=16.14.0",
36
36
  "tslib": "^2.4.0"