@inzombieland/nuxt-common 1.18.4 → 1.18.7
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 +1 -1
- package/dist/module.mjs +1 -2
- package/dist/runtime/SidebarProvider.vue +1 -1
- package/dist/runtime/api/index.mjs +3 -4
- package/dist/runtime/composables/index.d.ts +1 -0
- package/dist/runtime/composables/index.mjs +1 -0
- package/dist/runtime/packages/core/composables/index.d.ts +1 -0
- package/dist/runtime/packages/core/composables/index.mjs +1 -0
- package/dist/runtime/packages/core/define-vue-plugins.d.ts +4 -0
- package/dist/runtime/packages/core/define-vue-plugins.mjs +4 -0
- package/dist/runtime/packages/core/helpers/api-helper.d.ts +4 -0
- package/dist/runtime/packages/core/helpers/api-helper.mjs +3 -0
- package/dist/runtime/packages/core/helpers/composables.d.ts +5 -0
- package/dist/runtime/packages/core/helpers/composables.mjs +5 -0
- package/dist/runtime/packages/core/helpers/date-helper.d.ts +4 -0
- package/dist/runtime/packages/core/helpers/date-helper.mjs +3 -0
- package/dist/runtime/packages/core/helpers/device-helper.d.ts +1 -0
- package/dist/runtime/packages/core/helpers/device-helper.mjs +3 -0
- package/dist/runtime/packages/core/helpers/index.d.ts +2 -1
- package/dist/runtime/packages/core/helpers/index.mjs +2 -1
- package/dist/runtime/packages/core/helpers/phone-helper.d.ts +5 -0
- package/dist/runtime/packages/core/helpers/phone-helper.mjs +3 -0
- package/dist/runtime/packages/core/helpers/string-helper.d.ts +3 -0
- package/dist/runtime/packages/core/helpers/string-helper.mjs +3 -0
- package/dist/runtime/packages/core/index.d.ts +1 -0
- package/dist/runtime/packages/core/index.mjs +1 -0
- package/dist/runtime/packages/core/package.json +1 -1
- package/dist/runtime/packages/core/plugins/index.d.ts +1 -0
- package/dist/runtime/packages/core/plugins/index.mjs +1 -0
- package/dist/runtime/{ui/varlet.d.ts → packages/core/plugins/varlet-ui.d.ts} +4 -2
- package/dist/runtime/{ui/varlet.mjs → packages/core/plugins/varlet-ui.mjs} +6 -7
- package/dist/runtime/plugin.mjs +2 -1
- package/dist/runtime/plugins/device.d.ts +1 -76
- package/dist/runtime/plugins/device.mjs +0 -1
- package/package.json +1 -1
- package/dist/runtime/composables/use-active-sessions.d.ts +0 -3
- package/dist/runtime/composables/use-active-sessions.mjs +0 -3
- package/dist/runtime/composables/use-app-locale.d.ts +0 -3
- package/dist/runtime/composables/use-app-locale.mjs +0 -3
- package/dist/runtime/composables/use-device.d.ts +0 -3
- package/dist/runtime/composables/use-device.mjs +0 -5
- package/dist/runtime/composables/use-helpers.d.ts +0 -16
- package/dist/runtime/composables/use-helpers.mjs +0 -4
- package/dist/runtime/composables/use-subscribe.d.ts +0 -3
- package/dist/runtime/composables/use-subscribe.mjs +0 -3
- package/dist/runtime/composables/use-theme-mode.d.ts +0 -3
- package/dist/runtime/composables/use-theme-mode.mjs +0 -3
- package/dist/runtime/composables/use-user.d.ts +0 -3
- package/dist/runtime/composables/use-user.mjs +0 -3
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import { fileURLToPath } from 'node:url';
|
|
|
2
2
|
import { defineNuxtModule, createResolver, addServerHandler, addImportsDir, addPlugin, addComponent } from '@nuxt/kit';
|
|
3
3
|
|
|
4
4
|
const name = "@inzombieland/nuxt-common";
|
|
5
|
-
const version = "1.18.
|
|
5
|
+
const version = "1.18.7";
|
|
6
6
|
|
|
7
7
|
const module = defineNuxtModule({
|
|
8
8
|
meta: {
|
|
@@ -47,7 +47,6 @@ const module = defineNuxtModule({
|
|
|
47
47
|
});
|
|
48
48
|
addImportsDir(resolve(runtimeDir, "composables"));
|
|
49
49
|
addPlugin(resolve(runtimeDir, "plugin"));
|
|
50
|
-
addPlugin(resolve(runtimeDir, "ui/varlet"));
|
|
51
50
|
addPlugin(resolve(runtimeDir, "plugins/device"));
|
|
52
51
|
addPlugin(resolve(runtimeDir, "plugins/otp-input"));
|
|
53
52
|
addPlugin(resolve(runtimeDir, "plugins/sanitize-html"));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { useSwipe, type UseSwipeDirection } from "@vueuse/core"
|
|
3
3
|
import { onMounted, ref, watch } from "vue"
|
|
4
|
-
import { useDevice } from "./composables
|
|
4
|
+
import { useDevice } from "./composables"
|
|
5
5
|
import { useToggleSidebar } from "./composables/use-toggle-sidebar"
|
|
6
6
|
|
|
7
7
|
const sidebarRef = ref<HTMLElement | null>(null)
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { useRequestHeaders, useRequestURL } from "#imports";
|
|
2
|
-
import { useDevice } from "../composables/use-device.mjs";
|
|
1
|
+
import { useNuxtApp, useRequestHeaders, useRequestURL } from "#imports";
|
|
3
2
|
import { initApiFetch } from "../packages/core/index.mjs";
|
|
4
3
|
export const config = {
|
|
5
4
|
apiBaseURL: import.meta.env.VITE_API_BASE_URL,
|
|
@@ -11,8 +10,8 @@ export const config = {
|
|
|
11
10
|
appName: import.meta.env.VITE_APP_NAME,
|
|
12
11
|
getHostname: () => useRequestURL().hostname,
|
|
13
12
|
getDevice: async () => {
|
|
14
|
-
const device =
|
|
15
|
-
return await device.getInfo();
|
|
13
|
+
const { $device } = useNuxtApp();
|
|
14
|
+
return await $device.getInfo();
|
|
16
15
|
},
|
|
17
16
|
useRequestHeaders: (include = []) => {
|
|
18
17
|
return {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../packages/core/composables";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../packages/core/composables/index.mjs";
|
|
@@ -41,3 +41,4 @@ export type DeviceType = "mobile" | "tablet" | "desktop" | "unknown";
|
|
|
41
41
|
export type DeviceOrientation = "landscape" | "portrait" | "unknown";
|
|
42
42
|
export type DeviceOs = "ios" | "macos" | "iphone" | "ipad" | "ipod" | "android" | "blackberry" | "windows" | "fxos" | "meego" | "television" | "unknown";
|
|
43
43
|
export declare const deviceHelper: () => Device;
|
|
44
|
+
export declare const useDevice: () => Device;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
export { apiHelper } from "./api-helper";
|
|
2
2
|
export { dateHelper } from "./date-helper";
|
|
3
|
+
export { deviceHelper, type Device } from "./device-helper";
|
|
3
4
|
export { phoneHelper } from "./phone-helper";
|
|
4
5
|
export { stringHelper } from "./string-helper";
|
|
5
|
-
export
|
|
6
|
+
export * from "./composables";
|
|
6
7
|
export declare function once<T extends (...args: any[]) => any>(fn: T): T;
|
|
7
8
|
export declare function createSingletonAsync<T, Args extends unknown[]>(fn: (...args: Args) => Promise<T>): (...args: Args) => Promise<T>;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
export { apiHelper } from "./api-helper.mjs";
|
|
2
2
|
export { dateHelper } from "./date-helper.mjs";
|
|
3
|
+
export { deviceHelper } from "./device-helper.mjs";
|
|
3
4
|
export { phoneHelper } from "./phone-helper.mjs";
|
|
4
5
|
export { stringHelper } from "./string-helper.mjs";
|
|
5
|
-
export
|
|
6
|
+
export * from "./composables.mjs";
|
|
6
7
|
export function once(fn) {
|
|
7
8
|
let executed = false;
|
|
8
9
|
let result;
|
|
@@ -11,3 +11,8 @@ export declare const phoneHelper: {
|
|
|
11
11
|
convertToPhone: typeof convertToPhone;
|
|
12
12
|
maskPhone: typeof maskPhone;
|
|
13
13
|
};
|
|
14
|
+
export declare const usePhoneHelper: () => {
|
|
15
|
+
getPlainPhoneNumber: typeof getPlainPhoneNumber;
|
|
16
|
+
convertToPhone: typeof convertToPhone;
|
|
17
|
+
maskPhone: typeof maskPhone;
|
|
18
|
+
};
|
|
@@ -9,6 +9,7 @@ import { createApiGetVisitorIdentifier } from "./get-visitor.mjs";
|
|
|
9
9
|
import { createInitApplication } from "./init-application.mjs";
|
|
10
10
|
import { createApiRefreshToken } from "./refresh-token.mjs";
|
|
11
11
|
import { createApiUserActions } from "./user-actions.mjs";
|
|
12
|
+
export { defineVuePlugins } from "./define-vue-plugins.mjs";
|
|
12
13
|
export { default as AppProvider } from "./AppProvider.vue";
|
|
13
14
|
export * from "./composables/index.mjs";
|
|
14
15
|
export * from "./types.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./varlet-ui";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./varlet-ui.mjs";
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import type { createApp } from "vue";
|
|
1
2
|
import "@varlet/ui/es/button/style/index";
|
|
2
3
|
import "@varlet/ui/es/chip/style/index";
|
|
3
4
|
import "@varlet/ui/es/icon/style/index";
|
|
4
5
|
import "@varlet/ui/es/link/style/index";
|
|
5
6
|
import "@varlet/ui/es/styles/elevation.css";
|
|
6
|
-
|
|
7
|
-
export
|
|
7
|
+
type App = ReturnType<typeof createApp>;
|
|
8
|
+
export declare function defineVarletPlugin(app: App): void;
|
|
9
|
+
export {};
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { Button, Chip, Icon, Link } from "@varlet/ui";
|
|
2
|
-
import { defineNuxtPlugin } from "#app";
|
|
3
2
|
import "@varlet/ui/es/button/style/index";
|
|
4
3
|
import "@varlet/ui/es/chip/style/index";
|
|
5
4
|
import "@varlet/ui/es/icon/style/index";
|
|
6
5
|
import "@varlet/ui/es/link/style/index";
|
|
7
6
|
import "@varlet/ui/es/styles/elevation.css";
|
|
8
|
-
export
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
7
|
+
export function defineVarletPlugin(app) {
|
|
8
|
+
app.use(Button);
|
|
9
|
+
app.use(Chip);
|
|
10
|
+
app.use(Icon);
|
|
11
|
+
app.use(Link);
|
|
12
|
+
}
|
package/dist/runtime/plugin.mjs
CHANGED
|
@@ -3,12 +3,13 @@ import { useNuxtApp, useRequestHeaders, useRuntimeConfig, useState } from "#impo
|
|
|
3
3
|
import { watch } from "vue";
|
|
4
4
|
import { fetch, getUser } from "./api/index.mjs";
|
|
5
5
|
import { authMiddleware, guestMiddleware, localeMiddleware } from "./middleware/index.mjs";
|
|
6
|
-
import { useThemeMode } from "./packages/core/index.mjs";
|
|
6
|
+
import { defineVuePlugins, useThemeMode } from "./packages/core/index.mjs";
|
|
7
7
|
import { flush, setToken, setUser } from "./packages/core/api-client.mjs";
|
|
8
8
|
const useAuth = () => {
|
|
9
9
|
return useState("auth", () => null);
|
|
10
10
|
};
|
|
11
11
|
export default defineNuxtPlugin(async (nuxtApp) => {
|
|
12
|
+
defineVuePlugins(nuxtApp.vueApp);
|
|
12
13
|
const auth = useAuth();
|
|
13
14
|
const runtimeConfig = useRuntimeConfig();
|
|
14
15
|
const { $mobileApp } = useNuxtApp();
|
|
@@ -1,91 +1,16 @@
|
|
|
1
|
-
import { deviceHelper } from "../packages/core/helpers";
|
|
2
1
|
declare const _default: import("#app").Plugin<{
|
|
3
2
|
device: {
|
|
4
3
|
getInfo: () => Promise<string>;
|
|
5
|
-
mobile: () => boolean;
|
|
6
|
-
tablet: () => boolean;
|
|
7
|
-
desktop: () => boolean;
|
|
8
|
-
ios: () => boolean;
|
|
9
|
-
macos: () => boolean;
|
|
10
|
-
ipad: () => boolean;
|
|
11
|
-
iphone: () => boolean;
|
|
12
|
-
ipod: () => boolean;
|
|
13
|
-
android: () => boolean;
|
|
14
|
-
androidPhone: () => boolean;
|
|
15
|
-
androidTablet: () => boolean;
|
|
16
|
-
blackberry: () => boolean;
|
|
17
|
-
blackberryPhone: () => boolean;
|
|
18
|
-
blackberryTablet: () => boolean;
|
|
19
|
-
windows: () => boolean;
|
|
20
|
-
windowsPhone: () => boolean;
|
|
21
|
-
windowsTablet: () => boolean;
|
|
22
|
-
fxos: () => boolean;
|
|
23
|
-
fxosPhone: () => boolean;
|
|
24
|
-
fxosTablet: () => boolean;
|
|
25
|
-
meego: () => boolean;
|
|
26
|
-
television: () => boolean;
|
|
27
|
-
isMobileApp: boolean;
|
|
28
|
-
mobileApp: () => boolean;
|
|
29
|
-
iosMobileApp: () => boolean;
|
|
30
|
-
androidMobileApp: () => boolean;
|
|
31
|
-
tabletApp: () => boolean;
|
|
32
|
-
iosTabletApp: () => boolean;
|
|
33
|
-
androidTabletApp: () => boolean;
|
|
34
|
-
landscape: () => boolean;
|
|
35
|
-
portrait: () => boolean;
|
|
36
|
-
onChangeOrientation: (cb: (newOrientation: import("src/runtime/packages/core/helpers/device-helper").DeviceOrientation) => void) => void;
|
|
37
|
-
noConflict: (currentDevice: import("src/runtime/packages/core/helpers/device-helper").Device) => void;
|
|
38
|
-
type: import("src/runtime/packages/core/helpers/device-helper").DeviceType;
|
|
39
|
-
orientation: import("src/runtime/packages/core/helpers/device-helper").DeviceOrientation;
|
|
40
|
-
os: import("src/runtime/packages/core/helpers/device-helper").DeviceOs;
|
|
41
|
-
osName: () => string;
|
|
42
4
|
};
|
|
43
5
|
}> & import("#app").ObjectPlugin<{
|
|
44
6
|
device: {
|
|
45
7
|
getInfo: () => Promise<string>;
|
|
46
|
-
mobile: () => boolean;
|
|
47
|
-
tablet: () => boolean;
|
|
48
|
-
desktop: () => boolean;
|
|
49
|
-
ios: () => boolean;
|
|
50
|
-
macos: () => boolean;
|
|
51
|
-
ipad: () => boolean;
|
|
52
|
-
iphone: () => boolean;
|
|
53
|
-
ipod: () => boolean;
|
|
54
|
-
android: () => boolean;
|
|
55
|
-
androidPhone: () => boolean;
|
|
56
|
-
androidTablet: () => boolean;
|
|
57
|
-
blackberry: () => boolean;
|
|
58
|
-
blackberryPhone: () => boolean;
|
|
59
|
-
blackberryTablet: () => boolean;
|
|
60
|
-
windows: () => boolean;
|
|
61
|
-
windowsPhone: () => boolean;
|
|
62
|
-
windowsTablet: () => boolean;
|
|
63
|
-
fxos: () => boolean;
|
|
64
|
-
fxosPhone: () => boolean;
|
|
65
|
-
fxosTablet: () => boolean;
|
|
66
|
-
meego: () => boolean;
|
|
67
|
-
television: () => boolean;
|
|
68
|
-
isMobileApp: boolean;
|
|
69
|
-
mobileApp: () => boolean;
|
|
70
|
-
iosMobileApp: () => boolean;
|
|
71
|
-
androidMobileApp: () => boolean;
|
|
72
|
-
tabletApp: () => boolean;
|
|
73
|
-
iosTabletApp: () => boolean;
|
|
74
|
-
androidTabletApp: () => boolean;
|
|
75
|
-
landscape: () => boolean;
|
|
76
|
-
portrait: () => boolean;
|
|
77
|
-
onChangeOrientation: (cb: (newOrientation: import("src/runtime/packages/core/helpers/device-helper").DeviceOrientation) => void) => void;
|
|
78
|
-
noConflict: (currentDevice: import("src/runtime/packages/core/helpers/device-helper").Device) => void;
|
|
79
|
-
type: import("src/runtime/packages/core/helpers/device-helper").DeviceType;
|
|
80
|
-
orientation: import("src/runtime/packages/core/helpers/device-helper").DeviceOrientation;
|
|
81
|
-
os: import("src/runtime/packages/core/helpers/device-helper").DeviceOs;
|
|
82
|
-
osName: () => string;
|
|
83
8
|
};
|
|
84
9
|
}>;
|
|
85
10
|
export default _default;
|
|
86
11
|
declare module "#app" {
|
|
87
12
|
interface NuxtApp {
|
|
88
|
-
$device:
|
|
13
|
+
$device: {
|
|
89
14
|
getInfo: () => Promise<string> | string;
|
|
90
15
|
};
|
|
91
16
|
$mobileApp: {
|
|
@@ -6,7 +6,6 @@ export default defineNuxtPlugin(() => {
|
|
|
6
6
|
return {
|
|
7
7
|
provide: {
|
|
8
8
|
device: {
|
|
9
|
-
...device,
|
|
10
9
|
getInfo: async () => {
|
|
11
10
|
const { $mobileApp } = useNuxtApp();
|
|
12
11
|
if (device.isMobileApp && $mobileApp && "getInfo" in $mobileApp && typeof $mobileApp.getInfo === "function") {
|
package/package.json
CHANGED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { once } from "../packages/core/helpers";
|
|
2
|
-
export declare const useHelpers: () => {
|
|
3
|
-
dateHelper: {
|
|
4
|
-
stringToDate: typeof import("src/runtime/packages/core/helpers/date-helper").stringToDate;
|
|
5
|
-
dateFormat: typeof import("src/runtime/packages/core/helpers/date-helper").dateFormat;
|
|
6
|
-
};
|
|
7
|
-
once: typeof once;
|
|
8
|
-
phoneHelper: {
|
|
9
|
-
getPlainPhoneNumber: typeof import("src/runtime/packages/core/helpers/phone-helper").getPlainPhoneNumber;
|
|
10
|
-
convertToPhone: typeof import("src/runtime/packages/core/helpers/phone-helper").convertToPhone;
|
|
11
|
-
maskPhone: typeof import("src/runtime/packages/core/helpers/phone-helper").maskPhone;
|
|
12
|
-
};
|
|
13
|
-
stringHelper: {
|
|
14
|
-
maskEmail: typeof import("src/runtime/packages/core/helpers/string-helper").maskEmail;
|
|
15
|
-
};
|
|
16
|
-
};
|