@vesperjs/shared 0.9.6 → 0.9.8

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/index.d.mts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { Ref, WritableComputedRef } from "@vue/reactivity";
2
+ import Bowser from "bowser";
2
3
 
3
4
  //#region src/types/error/backend-error-info.d.ts
4
5
  interface BackendErrorInfo<BER extends object> {
@@ -40,6 +41,16 @@ declare const useExternalErrors: <P extends string>(flash: Ref<Flash>) => {
40
41
  isSuccess: () => boolean;
41
42
  };
42
43
  //#endregion
44
+ //#region src/composables/user-agent/use-browser-info.d.ts
45
+ declare const useBrowserInfo: () => {
46
+ browserInfo: Bowser.Parser.Parser;
47
+ };
48
+ //#endregion
49
+ //#region src/composables/user-agent/use-user-agent.d.ts
50
+ declare const useUserAgent: () => {
51
+ userAgent: Bowser.Parser.ParsedResult;
52
+ };
53
+ //#endregion
43
54
  //#region src/composables/util/use-date.d.ts
44
55
  declare const useDate: (fmtDate?: string, locale?: string) => {
45
56
  isValidDate: (value: string) => boolean;
@@ -67,4 +78,4 @@ declare const useFlash: () => {
67
78
  clearFlash: () => void;
68
79
  };
69
80
  //#endregion
70
- export { type BackendErrorInfo, type BackendErrorResource, type ErrorMessages, type ErrorsResource, type Flash, useBackendErrorInfo, useDate, useEntity, useExternalErrors, useFlash };
81
+ export { type BackendErrorInfo, type BackendErrorResource, type ErrorMessages, type ErrorsResource, type Flash, useBackendErrorInfo, useBrowserInfo, useDate, useEntity, useExternalErrors, useFlash, useUserAgent };
package/dist/index.mjs CHANGED
@@ -1,4 +1,5 @@
1
1
  import { computed, ref } from "@vue/reactivity";
2
+ import Bowser from "bowser";
2
3
  import { parse } from "@formkit/tempo";
3
4
  //#region src/composables/backend/error/use-backend-error-info.ts
4
5
  const useBackendErrorInfo = function() {
@@ -39,6 +40,16 @@ const useExternalErrors = function(flash) {
39
40
  };
40
41
  };
41
42
  //#endregion
43
+ //#region src/composables/user-agent/use-browser-info.ts
44
+ const useBrowserInfo = function() {
45
+ return { browserInfo: Bowser.getParser(globalThis.navigator.userAgent) };
46
+ };
47
+ //#endregion
48
+ //#region src/composables/user-agent/use-user-agent.ts
49
+ const useUserAgent = function() {
50
+ return { userAgent: Bowser.parse(globalThis.navigator.userAgent) };
51
+ };
52
+ //#endregion
42
53
  //#region src/composables/util/use-date.ts
43
54
  const useDate = function(fmtDate = "YYYY/MM/DD", locale) {
44
55
  const isValidDate = (value) => {
@@ -80,4 +91,4 @@ const useFlash = function() {
80
91
  };
81
92
  };
82
93
  //#endregion
83
- export { useBackendErrorInfo, useDate, useEntity, useExternalErrors, useFlash };
94
+ export { useBackendErrorInfo, useBrowserInfo, useDate, useEntity, useExternalErrors, useFlash, useUserAgent };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vesperjs/shared",
3
- "version": "0.9.6",
3
+ "version": "0.9.8",
4
4
  "keywords": [
5
5
  "Nuxt",
6
6
  "vue.js"
@@ -20,7 +20,8 @@
20
20
  "./package.json": "./package.json"
21
21
  },
22
22
  "dependencies": {
23
- "@formkit/tempo": "^1.1.0"
23
+ "@formkit/tempo": "^1.1.0",
24
+ "bowser": "^2.14.1"
24
25
  },
25
26
  "devDependencies": {
26
27
  "@eslint/js": "^10.0.1",