@wix/site-service-device-info 1.0.2 → 1.0.4

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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/definition/index.ts"],"names":[],"mappings":";;;AAAA,oEAAyD;AAiB5C,QAAA,oBAAoB,GAAG,IAAA,oCAAa,EAC7C,+BAA+B,CAClC,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/definition/index.ts"],"names":[],"mappings":";;;AAAA,oEAAyD;AAiB5C,QAAA,oBAAoB,GAAG,IAAA,oCAAa,EAChD,+BAA+B,CAC/B,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"deviceInfoService.js","sourceRoot":"","sources":["../../../src/implementations/deviceInfoService.ts"],"names":[],"mappings":";;;AAAA,oEAA4D;AAE5D,6EAA0F;AAE1F,8CAAoD;AAGpD,MAAM,mBAAmB,GAAe,SAAS,CAAA;AACjD,MAAM,sBAAsB,GAAG,KAAK,CAAA;AAEvB,QAAA,iBAAiB,GAAG,IAAA,uCAAgB,EAC7C,iCAAoB,EACpB,CAAC,EAAE,MAAM,EAAE,UAAU,EAAgD,EAAsB,EAAE;IACzF,MAAM,EAAE,MAAM,EAAE,GAAG,UAAU,CAAC,kCAAwB,CAAC,CAAA;IACvD,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,CAAC,UAAU,IAAI,mBAAmB,CAAC,CAAA;IACpE,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,CAAC,aAAa,IAAI,sBAAsB,CAAC,CAAA;IAE7E,OAAO;QACH,IAAI,UAAU;YACV,OAAO,WAAW,CAAC,GAAG,EAAE,CAAA;QAC5B,CAAC;QACD,IAAI,aAAa;YACb,OAAO,cAAc,CAAC,GAAG,EAAE,CAAA;QAC/B,CAAC;QACD,aAAa,CAAC,EAAE,UAAU,EAAE,aAAa,EAAqC;YAC1E,IAAI,OAAO,UAAU,KAAK,WAAW,EAAE,CAAC;gBACpC,WAAW,CAAC,GAAG,CAAC,UAAU,CAAC,CAAA;YAC/B,CAAC;YACD,IAAI,OAAO,aAAa,KAAK,WAAW,EAAE,CAAC;gBACvC,cAAc,CAAC,GAAG,CAAC,aAAa,CAAC,CAAA;YACrC,CAAC;QACL,CAAC;KACJ,CAAA;AACL,CAAC,CACJ,CAAA"}
1
+ {"version":3,"file":"deviceInfoService.js","sourceRoot":"","sources":["../../../src/implementations/deviceInfoService.ts"],"names":[],"mappings":";;;AAAA,oEAA4D;AAE5D,6EAA0F;AAE1F,8CAAoD;AAGpD,MAAM,mBAAmB,GAAe,SAAS,CAAA;AACjD,MAAM,sBAAsB,GAAG,KAAK,CAAA;AAEvB,QAAA,iBAAiB,GAAG,IAAA,uCAAgB,EAChD,iCAAoB,EACpB,CAAC,EAAE,MAAM,EAAE,UAAU,EAAgD,EAAsB,EAAE;IAC5F,MAAM,EAAE,MAAM,EAAE,GAAG,UAAU,CAAC,kCAAwB,CAAC,CAAA;IACvD,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,CAAC,UAAU,IAAI,mBAAmB,CAAC,CAAA;IACpE,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,CAAC,aAAa,IAAI,sBAAsB,CAAC,CAAA;IAE7E,OAAO;QACN,IAAI,UAAU;YACb,OAAO,WAAW,CAAC,GAAG,EAAE,CAAA;QACzB,CAAC;QACD,IAAI,aAAa;YAChB,OAAO,cAAc,CAAC,GAAG,EAAE,CAAA;QAC5B,CAAC;QACD,aAAa,CAAC,EAAE,UAAU,EAAE,aAAa,EAAqC;YAC7E,IAAI,OAAO,UAAU,KAAK,WAAW,EAAE,CAAC;gBACvC,WAAW,CAAC,GAAG,CAAC,UAAU,CAAC,CAAA;YAC5B,CAAC;YACD,IAAI,OAAO,aAAa,KAAK,WAAW,EAAE,CAAC;gBAC1C,cAAc,CAAC,GAAG,CAAC,aAAa,CAAC,CAAA;YAClC,CAAC;QACF,CAAC;KACD,CAAA;AACF,CAAC,CACD,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"service.js","sourceRoot":"","sources":["../../src/service.ts"],"names":[],"mappings":";;;AAAA,6CAAmD;AACnD,2EAAuE;AAE1D,QAAA,UAAU,GAAG,iCAAoB,CAAA;AAC9C,kBAAe,qCAAiB,CAAA"}
1
+ {"version":3,"file":"service.js","sourceRoot":"","sources":["../../src/service.ts"],"names":[],"mappings":";;;AAAA,6CAAmD;AACnD,2EAAuE;AAE1D,QAAA,UAAU,GAAG,iCAAoB,CAAA;kBAC/B,qCAAiB"}
package/cjs/package.json CHANGED
@@ -1,3 +1,3 @@
1
1
  {
2
- "type": "commonjs"
2
+ "type": "commonjs"
3
3
  }
@@ -1,3 +1,3 @@
1
1
  {
2
- "main": "../cjs/build/definition/index.js"
2
+ "main": "../cjs/build/definition/index.js"
3
3
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/definition/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAA;AAiBzD,MAAM,CAAC,MAAM,oBAAoB,GAAG,aAAa,CAC7C,+BAA+B,CAClC,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/definition/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAA;AAiBzD,MAAM,CAAC,MAAM,oBAAoB,GAAG,aAAa,CAChD,+BAA+B,CAC/B,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"deviceInfoService.js","sourceRoot":"","sources":["../../src/implementations/deviceInfoService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAA;AAE5D,OAAO,EAAE,wBAAwB,EAAE,MAAM,iDAAiD,CAAA;AAE1F,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAA;AAGpD,MAAM,mBAAmB,GAAe,SAA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gB,CAChD,oBAAoB,EACpB,CAAC,EAAE,MAAM,EAAE,UAAU,EAAgD,EAAsB,EAAE;IAC5F,MAAM,EAAE,MAAM,EAAE,GAAG,UAAU,CAAC,wBAAwB,CAAC,CAAA;IACvD,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,CAAC,UAAU,IAAI,mBAAmB,CAAC,CAAA;IACpE,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,CAAC,aAAa,IAAI,sBAAsB,CAAC,CAAA;IAE7E,OAAO;QACN,IAAI,UAAU;YACb,OAAO,WAAW,CAAC,GAAG,EAAE,CAAA;QACzB,CAAC;QACD,IAAI,aAAa;YAChB,OAAO,cAAc,CAAC,GAAG,EAAE,CAAA;QAC5B,CAAC;QACD,aAAa,CAAC,EAAE,UAAU,EAAE,aAAa,EAAqC;YAC7E,IAAI,OAAO,UAAU,KAAK,WAAW,EAAE,CAAC;gBACvC,WAAW,CAAC,GAAG,CAAC,UAAU,CAAC,CAAA;YAC5B,CAAC;YACD,IAAI,OAAO,aAAa,KAAK,WAAW,EAAE,CAAC;gBAC1C,cAAc,CAAC,GAAG,CAAC,aAAa,CAAC,CAAA;YAClC,CAAC;QACF,CAAC;KACD,CAAA;AACF,CAAC,CACD,CAAA"}
@@ -1,3 +1,3 @@
1
1
  {
2
- "main": "../cjs/build/implementations/index.js"
2
+ "main": "../cjs/build/implementations/index.js"
3
3
  }
package/package.json CHANGED
@@ -1,9 +1,6 @@
1
1
  {
2
2
  "name": "@wix/site-service-device-info",
3
- "version": "1.0.2",
4
- "main": "cjs/build/index.js",
5
- "module": "dist/index.js",
6
- "types": "dist/index.d.ts",
3
+ "version": "1.0.4",
7
4
  "license": "UNLICENSED",
8
5
  "files": [
9
6
  "dist",
@@ -14,6 +11,10 @@
14
11
  "types",
15
12
  "!**/*.tsbuildinfo"
16
13
  ],
14
+ "sideEffects": false,
15
+ "main": "cjs/build/index.js",
16
+ "module": "dist/index.js",
17
+ "types": "dist/index.d.ts",
17
18
  "exports": {
18
19
  ".": {
19
20
  "types": "./dist/index.d.ts",
@@ -41,13 +42,9 @@
41
42
  "require": "./cjs/build/service.js"
42
43
  }
43
44
  },
44
- "dependencies": {
45
- "@wix/services-definitions": "^0.1.4",
46
- "@wix/services-manager": "^0.2.20"
47
- },
48
- "devDependencies": {
49
- "typescript": "^5.3.3",
50
- "vitest": "4.1.0"
45
+ "publishConfig": {
46
+ "registry": "https://registry.npmjs.org/",
47
+ "access": "public"
51
48
  },
52
49
  "scripts": {
53
50
  "build": "tsc -b . --force && tsc --project tsconfig.cjs.json",
@@ -55,12 +52,15 @@
55
52
  "test": "vitest --run && yarn test-type-check",
56
53
  "test-type-check": "echo 'validating typescript in test files' && tsc --project tsconfig.test.json && echo 'Finished validating typescript in test files successfully'"
57
54
  },
58
- "publishUnscoped": false,
59
- "publishConfig": {
60
- "registry": "https://registry.npmjs.org/",
61
- "access": "public"
55
+ "dependencies": {
56
+ "@wix/services-definitions": "^0.1.4",
57
+ "@wix/services-manager": "^0.2.20"
62
58
  },
63
- "sideEffects": false,
59
+ "devDependencies": {
60
+ "typescript": "~7.0.2",
61
+ "vitest": "4.1.11"
62
+ },
63
+ "publishUnscoped": false,
64
64
  "wix": {
65
65
  "artifact": {
66
66
  "groupId": "com.wixpress.npm",
@@ -77,5 +77,5 @@
77
77
  ]
78
78
  }
79
79
  },
80
- "falconPackageHash": "f50afe63b4773794f8348ccf6b0020cf16f859b5046fcee215b675f3"
80
+ "falconPackageHash": "1124fab4cb78f8564fe6d7b04aaad7ec06c737b4c0380364579a367c"
81
81
  }
@@ -3,18 +3,18 @@ import type { ServiceDefinition } from '@wix/services-definitions'
3
3
  import type { DeviceType } from '../types'
4
4
 
5
5
  export type IDeviceInfoServiceConfig = {
6
- deviceType?: DeviceType
7
- reducedMotion?: boolean
6
+ deviceType?: DeviceType
7
+ reducedMotion?: boolean
8
8
  }
9
9
 
10
10
  export interface IDeviceInfoService {
11
- readonly deviceType: DeviceType
12
- readonly reducedMotion: boolean
13
- _updateConfig: (config: Partial<IDeviceInfoServiceConfig>) => void
11
+ readonly deviceType: DeviceType
12
+ readonly reducedMotion: boolean
13
+ _updateConfig: (config: Partial<IDeviceInfoServiceConfig>) => void
14
14
  }
15
15
 
16
16
  export type IDeviceInfoDefinition = ServiceDefinition<IDeviceInfoService, IDeviceInfoServiceConfig>
17
17
 
18
18
  export const DeviceInfoDefinition = defineService<IDeviceInfoService, IDeviceInfoServiceConfig>(
19
- '@wix/site-service-device-info'
19
+ '@wix/site-service-device-info'
20
20
  )
@@ -9,27 +9,27 @@ const DEFAULT_DEVICE_TYPE: DeviceType = 'Desktop'
9
9
  const DEFAULT_REDUCED_MOTION = false
10
10
 
11
11
  export const DeviceInfoService = implementService(
12
- DeviceInfoDefinition,
13
- ({ config, getService }: ServiceFactoryOpts<IDeviceInfoServiceConfig>): IDeviceInfoService => {
14
- const { signal } = getService(SignalsServiceDefinition)
15
- const _deviceType = signal(config.deviceType ?? DEFAULT_DEVICE_TYPE)
16
- const _reducedMotion = signal(config.reducedMotion ?? DEFAULT_REDUCED_MOTION)
12
+ DeviceInfoDefinition,
13
+ ({ config, getService }: ServiceFactoryOpts<IDeviceInfoServiceConfig>): IDeviceInfoService => {
14
+ const { signal } = getService(SignalsServiceDefinition)
15
+ const _deviceType = signal(config.deviceType ?? DEFAULT_DEVICE_TYPE)
16
+ const _reducedMotion = signal(config.reducedMotion ?? DEFAULT_REDUCED_MOTION)
17
17
 
18
- return {
19
- get deviceType() {
20
- return _deviceType.get()
21
- },
22
- get reducedMotion() {
23
- return _reducedMotion.get()
24
- },
25
- _updateConfig({ deviceType, reducedMotion }: Partial<IDeviceInfoServiceConfig>) {
26
- if (typeof deviceType !== 'undefined') {
27
- _deviceType.set(deviceType)
28
- }
29
- if (typeof reducedMotion !== 'undefined') {
30
- _reducedMotion.set(reducedMotion)
31
- }
32
- },
33
- }
34
- }
18
+ return {
19
+ get deviceType() {
20
+ return _deviceType.get()
21
+ },
22
+ get reducedMotion() {
23
+ return _reducedMotion.get()
24
+ },
25
+ _updateConfig({ deviceType, reducedMotion }: Partial<IDeviceInfoServiceConfig>) {
26
+ if (typeof deviceType !== 'undefined') {
27
+ _deviceType.set(deviceType)
28
+ }
29
+ if (typeof reducedMotion !== 'undefined') {
30
+ _reducedMotion.set(reducedMotion)
31
+ }
32
+ },
33
+ }
34
+ }
35
35
  )
@@ -1,3 +1,3 @@
1
1
  {
2
- "main": "../cjs/build/types/index.js"
2
+ "main": "../cjs/build/types/index.js"
3
3
  }