nuxt-hs-ui 2.4.2 → 2.5.2

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/module.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "compatibility": {
5
5
  "nuxt": ">=3.15.0"
6
6
  },
7
- "version": "2.4.2",
7
+ "version": "2.5.2",
8
8
  "builder": {
9
9
  "@nuxt/module-builder": "0.8.4",
10
10
  "unbuild": "2.0.0"
@@ -21,14 +21,11 @@ export const useHsMisc = defineStore("HsMisc", () => {
21
21
  };
22
22
  const IsMobile = () => {
23
23
  const ua = GetUa();
24
- if (/\(iPad.*OS/i.test(ua)) return true;
25
- if (/iP(?:ad|hone|od)/i.test(ua)) return true;
26
- if (/android|ipod|ipad|iphone|mobile/i.test(ua)) return true;
27
- if (/Macintosh/.test(ua) && import.meta.client) {
28
- if (navigator === void 0) return false;
29
- return navigator.maxTouchPoints > 1;
30
- }
31
- return false;
24
+ const isOldIPad = /\(iPad.*OS/.test(ua);
25
+ const isIpad = /Macintosh/.test(ua) && navigator.maxTouchPoints > 1;
26
+ const isiOS = /iP(?:ad|hone|od)/.test(ua);
27
+ const isAndroid = /android|mobile/i.test(ua);
28
+ return isOldIPad || isIpad || isiOS || isAndroid;
32
29
  };
33
30
  const state = reactive({
34
31
  isInit: false,
@@ -32,6 +32,9 @@ export declare const useHsMultiLang: import("pinia").StoreDefinition<"HsMultiLan
32
32
  lang?: string;
33
33
  changeLangFunc?: (lang: string) => Promise<void> | void;
34
34
  }): void;
35
+ /** Text Ref */
35
36
  tx(text: MultiLang, lang?: undefined): import("vue").ComputedRef<string>;
37
+ /** GetText */
38
+ gt(text: MultiLang, lang?: undefined): string;
36
39
  }>;
37
40
  export {};
@@ -48,6 +48,7 @@ export const useHsMultiLang = defineStore("HsMultiLang", {
48
48
  );
49
49
  },
50
50
  // ---------------------
51
+ /** Text Ref */
51
52
  tx(text, lang = void 0) {
52
53
  const state = this.state;
53
54
  return computed(() => {
@@ -61,6 +62,19 @@ export const useHsMultiLang = defineStore("HsMultiLang", {
61
62
  state.showLog
62
63
  );
63
64
  });
65
+ },
66
+ /** GetText */
67
+ gt(text, lang = void 0) {
68
+ const state = this.state;
69
+ if (lang) {
70
+ return GetTextByMultiLang(text, lang, state.fallBack, state.showLog);
71
+ }
72
+ return GetTextByMultiLang(
73
+ text,
74
+ state.lang,
75
+ state.fallBack,
76
+ state.showLog
77
+ );
64
78
  }
65
79
  // ---------------------
66
80
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nuxt-hs-ui",
3
- "version": "2.4.2",
3
+ "version": "2.5.2",
4
4
  "description": "My new Nuxt module",
5
5
  "repository": "https://github.com/hare-systems-ryo/nuxt-hs-ui",
6
6
  "license": "MIT",