@unsource/ui 2.8.6 → 2.8.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 +2 -0
- package/dist/runtime/components/UnMap.d.vue.ts +1 -1
- package/dist/runtime/components/UnMap.vue +4 -2
- package/dist/runtime/components/UnMap.vue.d.ts +1 -1
- package/dist/runtime/composables/fetch.js +3 -2
- package/dist/runtime/composables/global.js +3 -2
- package/dist/runtime/composables/reuseable.d.ts +1 -0
- package/dist/runtime/composables/reuseable.js +4 -0
- package/package.json +3 -2
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { createResolver, defineNuxtModule, addComponentsDir, addImportsDir, addPlugin } from '@nuxt/kit';
|
|
2
|
+
import defu from 'defu';
|
|
2
3
|
|
|
3
4
|
const resolver = createResolver(import.meta.url);
|
|
4
5
|
const module = defineNuxtModule({
|
|
@@ -86,6 +87,7 @@ const module = defineNuxtModule({
|
|
|
86
87
|
});
|
|
87
88
|
addImportsDir(resolver2.resolve("runtime/composables"));
|
|
88
89
|
addPlugin(resolver2.resolve("runtime/plugins/toast.client"));
|
|
90
|
+
_nuxt.options.runtimeConfig.public.unsourceUi = defu(_nuxt.options.runtimeConfig.public.unsourceUi, _options);
|
|
89
91
|
}
|
|
90
92
|
});
|
|
91
93
|
|
|
@@ -61,8 +61,10 @@ import { Point, Circle as GeomCircle } from "ol/geom";
|
|
|
61
61
|
import { fromLonLat, transform } from "ol/proj";
|
|
62
62
|
import Big from "big.js";
|
|
63
63
|
import { computed, ref, useDevice, useGeolocation, watch } from "#imports";
|
|
64
|
-
|
|
65
|
-
const
|
|
64
|
+
import { useModuleConfig } from "../composables/reuseable";
|
|
65
|
+
const moduleConfig = useModuleConfig();
|
|
66
|
+
const NESHAN_API_KEY = window.NESHAN_API_KEY || moduleConfig?.NESHAN_API_KEY;
|
|
67
|
+
const NESHAN_WEB_KEY = window.NESHAN_WEB_KEY || moduleConfig?.NESHAN_WEB_KEY;
|
|
66
68
|
const emit = defineEmits(["select-point"]);
|
|
67
69
|
const { points = [], readonly, marker } = defineProps({
|
|
68
70
|
points: { type: Array, required: false },
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useToken } from "./reuseable.js";
|
|
1
|
+
import { useModuleConfig, useToken } from "./reuseable.js";
|
|
2
2
|
import { _get, _set, useNuxtApp, _takeRight } from "#imports";
|
|
3
3
|
const domain = location.hostname.split(".");
|
|
4
4
|
const tld = _takeRight(domain, 2).join(".");
|
|
@@ -17,12 +17,13 @@ const errorHandler = (error, config) => {
|
|
|
17
17
|
return { error };
|
|
18
18
|
};
|
|
19
19
|
export const fetch = async ({ body = void 0, config = {}, controller = void 0, URL = "", method = "GET" }) => {
|
|
20
|
+
const moduleConfig = useModuleConfig();
|
|
20
21
|
controller = new AbortController();
|
|
21
22
|
const signal = controller.signal;
|
|
22
23
|
config = setHeaders(config);
|
|
23
24
|
try {
|
|
24
25
|
const result = await $fetch(URL, {
|
|
25
|
-
baseURL: window.BASE_URL,
|
|
26
|
+
baseURL: window.BASE_URL || moduleConfig?.BASE_URL,
|
|
26
27
|
method,
|
|
27
28
|
signal,
|
|
28
29
|
body,
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
} from "#imports";
|
|
20
20
|
import { io } from "socket.io-client";
|
|
21
21
|
import { digitsFaToEn, digitsArToEn } from "@persian-tools/persian-tools";
|
|
22
|
-
import { useToken, useUserId } from "./reuseable.js";
|
|
22
|
+
import { useModuleConfig, useToken, useUserId } from "./reuseable.js";
|
|
23
23
|
import Moment from "jalali-moment";
|
|
24
24
|
import Handlebars from "handlebars";
|
|
25
25
|
import Ajv from "ajv";
|
|
@@ -156,7 +156,8 @@ export const minutesToTime = (m = 0) => {
|
|
|
156
156
|
return `${hour.padStart(2, 0)}:${minute.padStart(2, 0)}`;
|
|
157
157
|
};
|
|
158
158
|
export const useSocketIo = () => {
|
|
159
|
-
const
|
|
159
|
+
const moduleConfig = useModuleConfig();
|
|
160
|
+
const socket = io(window.BASE_URL || moduleConfig?.BASE_URL, {
|
|
160
161
|
extraHeaders: {
|
|
161
162
|
authorization: useToken().value || ""
|
|
162
163
|
// 'app-code': APP_CODE
|
|
@@ -48,6 +48,7 @@ export declare const BookingPrice: (booking: Booking) => number;
|
|
|
48
48
|
export declare const authenticate: () => Promise<void>;
|
|
49
49
|
export declare const authenticateProvider: () => Promise<void>;
|
|
50
50
|
export declare const useConfig: () => import("@nuxt/schema").PublicRuntimeConfig;
|
|
51
|
+
export declare const useModuleConfig: () => unknown;
|
|
51
52
|
export declare const isProviderSide: (config: {
|
|
52
53
|
userType: string;
|
|
53
54
|
}) => boolean;
|
|
@@ -67,6 +67,10 @@ export const useConfig = () => {
|
|
|
67
67
|
const { public: config } = useRuntimeConfig();
|
|
68
68
|
return config;
|
|
69
69
|
};
|
|
70
|
+
export const useModuleConfig = () => {
|
|
71
|
+
const config = useConfig();
|
|
72
|
+
return config.unsourceUi;
|
|
73
|
+
};
|
|
70
74
|
export const isProviderSide = (config) => {
|
|
71
75
|
return config?.userType === "PROVIDER";
|
|
72
76
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unsource/ui",
|
|
3
|
-
"version": "2.8.
|
|
3
|
+
"version": "2.8.7",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "nuxt ui kit for unsource env",
|
|
6
6
|
"repository": "https://github.com/alisa2142/unsource-ui",
|
|
@@ -61,7 +61,8 @@
|
|
|
61
61
|
"vue-json-pretty": "^2.6.0",
|
|
62
62
|
"vue3-otp-input": "^0.5.40",
|
|
63
63
|
"vue3-persian-datetime-picker": "^1.2.2",
|
|
64
|
-
"vue3-toastify": "^0.2.8"
|
|
64
|
+
"vue3-toastify": "^0.2.8",
|
|
65
|
+
"defu": "^6.1.4"
|
|
65
66
|
},
|
|
66
67
|
"peerDependencies": {
|
|
67
68
|
"ajv": "^8.17.1",
|