@inzombieland/nuxt-common 1.19.19 → 1.19.20
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.d.mts +2 -2
- package/dist/module.json +3 -3
- package/dist/module.mjs +3 -3
- package/dist/runtime/SidebarProvider.d.vue.ts +14 -0
- package/dist/runtime/SidebarProvider.vue +91 -102
- package/dist/runtime/SidebarProvider.vue.d.ts +14 -0
- package/dist/runtime/api/index.d.ts +7 -7
- package/dist/runtime/api/{index.mjs → index.js} +1 -1
- package/dist/runtime/api/user-actions.d.ts +1 -1
- package/dist/runtime/api/user-actions.js +2 -0
- package/dist/runtime/composables/index.d.ts +1 -1
- package/dist/runtime/composables/index.js +1 -0
- package/dist/runtime/composables/use-api-fetch.d.ts +1 -1
- package/dist/runtime/composables/{use-api-fetch.mjs → use-api-fetch.js} +1 -1
- package/dist/runtime/composables/use-layer-manager.d.ts +1 -1
- package/dist/runtime/composables/{use-layer-manager.mjs → use-layer-manager.js} +1 -1
- package/dist/runtime/composables/use-user-actions.d.ts +4 -4
- package/dist/runtime/composables/{use-user-actions.mjs → use-user-actions.js} +1 -1
- package/dist/runtime/middleware/{auth.mjs → auth.js} +1 -1
- package/dist/runtime/middleware/{guest.mjs → guest.js} +1 -1
- package/dist/runtime/middleware/index.d.ts +3 -3
- package/dist/runtime/middleware/index.js +4 -0
- package/dist/runtime/middleware/{locale.global.mjs → locale.global.js} +1 -1
- package/dist/runtime/packages/core/AppProvider.d.vue.ts +14 -0
- package/dist/runtime/packages/core/AppProvider.vue +13 -16
- package/dist/runtime/packages/core/AppProvider.vue.d.ts +14 -0
- package/dist/runtime/packages/core/api-client.d.ts +1 -1
- package/dist/runtime/packages/core/{api-client.mjs → api-client.js} +3 -3
- package/dist/runtime/packages/core/comet-client.d.ts +1 -1
- package/dist/runtime/packages/core/{comet-client.mjs → comet-client.js} +4 -4
- package/dist/runtime/packages/core/composables/index.d.ts +10 -10
- package/dist/runtime/packages/core/composables/index.js +10 -0
- package/dist/runtime/packages/core/composables/use-active-sessions.d.ts +1 -1
- package/dist/runtime/packages/core/composables/{use-active-sessions.mjs → use-active-sessions.js} +1 -1
- package/dist/runtime/packages/core/composables/use-app-locale.d.ts +1 -1
- package/dist/runtime/packages/core/composables/{use-subscribe.mjs → use-subscribe.js} +1 -1
- package/dist/runtime/packages/core/composables/use-theme-mode.d.ts +1 -1
- package/dist/runtime/packages/core/composables/use-user.d.ts +1 -1
- package/dist/runtime/packages/core/composables/use-visitor.d.ts +1 -1
- package/dist/runtime/packages/core/{define-vue-plugins.mjs → define-vue-plugins.js} +1 -1
- package/dist/runtime/packages/core/get-user.d.ts +1 -1
- package/dist/runtime/packages/core/{get-user.mjs → get-user.js} +3 -3
- package/dist/runtime/packages/core/get-visitor.d.ts +1 -1
- package/dist/runtime/packages/core/{get-visitor.mjs → get-visitor.js} +2 -2
- package/dist/runtime/packages/core/helpers/composables.d.ts +4 -4
- package/dist/runtime/packages/core/helpers/composables.js +4 -0
- package/dist/runtime/packages/core/helpers/{device-helper.mjs → device-helper.js} +1 -1
- package/dist/runtime/packages/core/helpers/index.d.ts +5 -5
- package/dist/runtime/packages/core/helpers/{index.mjs → index.js} +5 -5
- package/dist/runtime/packages/core/index.d.ts +18 -18
- package/dist/runtime/packages/core/{index.mjs → index.js} +11 -11
- package/dist/runtime/packages/core/{init-application.mjs → init-application.js} +3 -3
- package/dist/runtime/packages/core/plugins/index.d.ts +2 -2
- package/dist/runtime/packages/core/plugins/index.js +2 -0
- package/dist/runtime/packages/core/plugins/{sanitize-url.mjs → sanitize-url.js} +1 -1
- package/dist/runtime/packages/core/refresh-token.d.ts +1 -1
- package/dist/runtime/packages/core/{refresh-token.mjs → refresh-token.js} +2 -2
- package/dist/runtime/packages/core/user-actions.d.ts +1 -1
- package/dist/runtime/packages/core/{user-actions.mjs → user-actions.js} +3 -3
- package/dist/runtime/packages/layer-manager/LayerComponent.d.vue.ts +6 -0
- package/dist/runtime/packages/layer-manager/LayerComponent.vue +23 -28
- package/dist/runtime/packages/layer-manager/LayerComponent.vue.d.ts +6 -0
- package/dist/runtime/packages/layer-manager/LayersProvider.d.vue.ts +10 -0
- package/dist/runtime/packages/layer-manager/LayersProvider.vue +142 -164
- package/dist/runtime/packages/layer-manager/LayersProvider.vue.d.ts +10 -0
- package/dist/runtime/packages/layer-manager/index.d.ts +1 -1
- package/dist/runtime/packages/layer-manager/use-layer-actions.d.ts +1 -1
- package/dist/runtime/{plugin.mjs → plugin.js} +4 -4
- package/dist/runtime/plugins/{device.mjs → device.js} +1 -1
- package/dist/types.d.mts +2 -7
- package/package.json +24 -17
- package/dist/module.cjs +0 -5
- package/dist/module.d.ts +0 -8
- package/dist/runtime/api/user-actions.mjs +0 -2
- package/dist/runtime/composables/index.mjs +0 -1
- package/dist/runtime/middleware/index.mjs +0 -4
- package/dist/runtime/packages/core/composables/index.mjs +0 -10
- package/dist/runtime/packages/core/helpers/composables.mjs +0 -4
- package/dist/runtime/packages/core/plugins/index.mjs +0 -2
- package/dist/types.d.ts +0 -8
- /package/dist/runtime/api/account/{account.get.mjs → account.get.js} +0 -0
- /package/dist/runtime/api/account/{authcheck.get.mjs → authcheck.get.js} +0 -0
- /package/dist/runtime/api/account/{default-handler.mjs → default-handler.js} +0 -0
- /package/dist/runtime/api/account/{middleware.mjs → middleware.js} +0 -0
- /package/dist/runtime/api/account/{token.get.mjs → token.get.js} +0 -0
- /package/dist/runtime/composables/{use-toggle-sidebar.mjs → use-toggle-sidebar.js} +0 -0
- /package/dist/runtime/packages/core/{bus.mjs → bus.js} +0 -0
- /package/dist/runtime/packages/core/composables/{use-api-actions.mjs → use-api-actions.js} +0 -0
- /package/dist/runtime/packages/core/composables/{use-app-locale.mjs → use-app-locale.js} +0 -0
- /package/dist/runtime/packages/core/composables/{use-cookies.mjs → use-cookies.js} +0 -0
- /package/dist/runtime/packages/core/composables/{use-theme-mode.mjs → use-theme-mode.js} +0 -0
- /package/dist/runtime/packages/core/composables/{use-user.mjs → use-user.js} +0 -0
- /package/dist/runtime/packages/core/composables/{use-validators.mjs → use-validators.js} +0 -0
- /package/dist/runtime/packages/core/composables/{use-visitor.mjs → use-visitor.js} +0 -0
- /package/dist/runtime/packages/core/helpers/{api-helper.mjs → api-helper.js} +0 -0
- /package/dist/runtime/packages/core/helpers/{current-device.mjs → current-device.js} +0 -0
- /package/dist/runtime/packages/core/helpers/{phone-helper.mjs → phone-helper.js} +0 -0
- /package/dist/runtime/packages/core/helpers/{string-helper.mjs → string-helper.js} +0 -0
- /package/dist/runtime/packages/core/plugins/{sanitize-html.mjs → sanitize-html.js} +0 -0
- /package/dist/runtime/packages/core/thirdparty/sanitize-url/{index.mjs → index.js} +0 -0
- /package/dist/runtime/packages/core/{types.mjs → types.js} +0 -0
- /package/dist/runtime/packages/layer-manager/{index.mjs → index.js} +0 -0
- /package/dist/runtime/packages/layer-manager/{types.mjs → types.js} +0 -0
- /package/dist/runtime/packages/layer-manager/{use-layer-actions.mjs → use-layer-actions.js} +0 -0
- /package/dist/runtime/server/middleware/{basic-auth.mjs → basic-auth.js} +0 -0
- /package/dist/runtime/thirdparty/helpers/{index.mjs → index.js} +0 -0
|
@@ -1,176 +1,154 @@
|
|
|
1
|
-
<script setup
|
|
2
|
-
import { computed, onMounted, ref, watch } from "vue"
|
|
3
|
-
import { useRoute, useRouter } from "vue-router"
|
|
4
|
-
import LayerComponent from "./LayerComponent.vue"
|
|
5
|
-
import { useLayerActions } from "./use-layer-actions"
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
return a & a
|
|
21
|
-
}, 0)
|
|
22
|
-
return Math.abs(hash).toString()
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
const createLayer = (name: string, params?: { [p: string]: any }): ActiveLayer => {
|
|
26
|
-
return {
|
|
27
|
-
name,
|
|
28
|
-
layerId: getLayerHash(name),
|
|
29
|
-
component: name.charAt(0).toUpperCase() + name.slice(1),
|
|
30
|
-
params: Object.assign({}, history.value.query, params),
|
|
31
|
-
closeLayer: typeof window !== "undefined" ? () => {} : undefined,
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
const resolveLayer = (
|
|
36
|
-
layerName: string,
|
|
37
|
-
options: { isCloseOtherLayers: boolean } = { isCloseOtherLayers: false },
|
|
38
|
-
params?: { [p: string]: any }
|
|
39
|
-
) => {
|
|
40
|
-
const activeLayer = activeLayers.value.find(({ name }) => name === layerName)
|
|
41
|
-
if (activeLayer) {
|
|
42
|
-
// слой с таким именем уже есть
|
|
43
|
-
const layer = activeLayers.value.splice(activeLayers.value.indexOf(activeLayer), 1)[0]
|
|
44
|
-
if (layer) {
|
|
45
|
-
if (params) {
|
|
46
|
-
layer.params = params
|
|
47
|
-
}
|
|
48
|
-
activeLayers.value.push(layer)
|
|
49
|
-
}
|
|
50
|
-
} else {
|
|
51
|
-
if (options.isCloseOtherLayers) {
|
|
52
|
-
activeLayers.value = []
|
|
53
|
-
}
|
|
54
|
-
if (activeLayers.value.length >= layersLimit) {
|
|
55
|
-
activeLayers.value.shift()
|
|
56
|
-
}
|
|
57
|
-
activeLayers.value.push(createLayer(layerName, params))
|
|
58
|
-
}
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed, onMounted, ref, watch } from "vue";
|
|
3
|
+
import { useRoute, useRouter } from "vue-router";
|
|
4
|
+
import LayerComponent from "./LayerComponent.vue";
|
|
5
|
+
import { useLayerActions } from "./use-layer-actions";
|
|
6
|
+
const router = useRouter();
|
|
7
|
+
const route = useRoute();
|
|
8
|
+
const layerActions = useLayerActions();
|
|
9
|
+
const reactiveHistory = computed(() => ({ path: route.path, query: route.query }));
|
|
10
|
+
const history = ref({ path: route.path, query: route.query });
|
|
11
|
+
const activeLayers = ref([]);
|
|
12
|
+
const pageTitle = ref("");
|
|
13
|
+
const layersLimit = 5;
|
|
14
|
+
function getLayerHash(s) {
|
|
15
|
+
const hash = s.split("").reduce((a, b) => {
|
|
16
|
+
a = (a << 5) - a + b.charCodeAt(0);
|
|
17
|
+
return a & a;
|
|
18
|
+
}, 0);
|
|
19
|
+
return Math.abs(hash).toString();
|
|
59
20
|
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
21
|
+
const createLayer = (name, params) => {
|
|
22
|
+
return {
|
|
23
|
+
name,
|
|
24
|
+
layerId: getLayerHash(name),
|
|
25
|
+
component: name.charAt(0).toUpperCase() + name.slice(1),
|
|
26
|
+
params: Object.assign({}, history.value.query, params),
|
|
27
|
+
closeLayer: typeof window !== "undefined" ? () => {
|
|
28
|
+
} : void 0
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
const resolveLayer = (layerName, options = { isCloseOtherLayers: false }, params) => {
|
|
32
|
+
const activeLayer = activeLayers.value.find(({ name }) => name === layerName);
|
|
33
|
+
if (activeLayer) {
|
|
34
|
+
const layer = activeLayers.value.splice(activeLayers.value.indexOf(activeLayer), 1)[0];
|
|
35
|
+
if (layer) {
|
|
36
|
+
if (params) {
|
|
37
|
+
layer.params = params;
|
|
38
|
+
}
|
|
39
|
+
activeLayers.value.push(layer);
|
|
40
|
+
}
|
|
41
|
+
} else {
|
|
42
|
+
if (options.isCloseOtherLayers) {
|
|
43
|
+
activeLayers.value = [];
|
|
44
|
+
}
|
|
45
|
+
if (activeLayers.value.length >= layersLimit) {
|
|
46
|
+
activeLayers.value.shift();
|
|
47
|
+
}
|
|
48
|
+
activeLayers.value.push(createLayer(layerName, params));
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
const closeLayer = (layerId) => {
|
|
52
|
+
if (typeof document !== "undefined") {
|
|
53
|
+
const layerElement = document.getElementById(layerId);
|
|
54
|
+
if (layerElement) {
|
|
55
|
+
layerElement.classList.remove("open");
|
|
56
|
+
layerElement.classList.add("hide");
|
|
57
|
+
}
|
|
58
|
+
const layoutElement = document.querySelector("#layout");
|
|
59
|
+
if (layoutElement) {
|
|
60
|
+
layoutElement.classList.remove("layer-open");
|
|
61
|
+
layoutElement.classList.add("layer-hide");
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
setTimeout(() => {
|
|
65
|
+
if (!activeLayers.value.some((s) => s.layerId === layerId)) {
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
activeLayers.value = activeLayers.value.filter((s) => s.layerId !== layerId);
|
|
69
|
+
const layer = activeLayers.value.at(-1);
|
|
70
|
+
const queryLayer = layer ? { layer: layer.name, ...layer.params } : {};
|
|
71
|
+
const query = { ...history.value.query?.layer ? queryLayer : {} };
|
|
72
|
+
router.push({ path: history.value.path, query });
|
|
73
|
+
if (activeLayers.value.length === 0 && typeof document !== "undefined") {
|
|
74
|
+
document.title = pageTitle.value;
|
|
75
|
+
}
|
|
76
|
+
if (activeLayers.value.length === 0) {
|
|
77
|
+
document.documentElement.style.removeProperty("overflow");
|
|
78
|
+
document.body.style.removeProperty("overflow");
|
|
79
|
+
}
|
|
80
|
+
}, 400);
|
|
81
|
+
};
|
|
99
82
|
const closeAllLayers = () => {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
}
|
|
104
|
-
|
|
83
|
+
activeLayers.value = [];
|
|
84
|
+
router.push(history.value.path);
|
|
85
|
+
document.title = pageTitle.value;
|
|
86
|
+
};
|
|
105
87
|
watch(reactiveHistory, (value, prevValue) => {
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
})
|
|
128
|
-
|
|
88
|
+
history.value = value;
|
|
89
|
+
if (value.path !== prevValue.path) {
|
|
90
|
+
if (value.query.layer) {
|
|
91
|
+
resolveLayer(value.query.layer.toString(), { isCloseOtherLayers: true });
|
|
92
|
+
} else if (activeLayers.value.length > 0) {
|
|
93
|
+
activeLayers.value = [];
|
|
94
|
+
document.title = pageTitle.value;
|
|
95
|
+
}
|
|
96
|
+
} else if (value.query.layer) {
|
|
97
|
+
if (value.query.layer !== prevValue.query.layer) {
|
|
98
|
+
resolveLayer(value.query.layer.toString());
|
|
99
|
+
} else {
|
|
100
|
+
const activeLayer = activeLayers.value.find(({ name }) => name === value.query.layer);
|
|
101
|
+
if (activeLayer) {
|
|
102
|
+
activeLayer.params = value.query;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
} else if (activeLayers.value.length > 0) {
|
|
106
|
+
activeLayers.value = [];
|
|
107
|
+
document.title = pageTitle.value;
|
|
108
|
+
}
|
|
109
|
+
});
|
|
129
110
|
onMounted(() => {
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
})
|
|
158
|
-
})
|
|
159
|
-
|
|
111
|
+
pageTitle.value = document.title;
|
|
112
|
+
layerActions.value = {
|
|
113
|
+
initialized: true,
|
|
114
|
+
open: (layerName, params) => {
|
|
115
|
+
if (params?.mode === "router") {
|
|
116
|
+
const { mode, ...restParams } = params;
|
|
117
|
+
router.push({ path: history.value.path, query: { layer: layerName, ...restParams ?? {} } });
|
|
118
|
+
} else {
|
|
119
|
+
resolveLayer(layerName, void 0, params);
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
getLayer: (layerName) => {
|
|
123
|
+
return activeLayers.value.find(({ name }) => name === layerName);
|
|
124
|
+
},
|
|
125
|
+
closeAllLayers: () => {
|
|
126
|
+
closeAllLayers();
|
|
127
|
+
}
|
|
128
|
+
};
|
|
129
|
+
window.addEventListener("keyup", (event) => {
|
|
130
|
+
if (event.key === "Escape") {
|
|
131
|
+
const lastLayer = activeLayers.value.at(-1);
|
|
132
|
+
if (lastLayer) {
|
|
133
|
+
closeLayer(lastLayer.layerId);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
});
|
|
160
138
|
if (!layerActions.value?.initialized && history.value.query?.layer) {
|
|
161
|
-
|
|
139
|
+
resolveLayer(history.value.query.layer.toString());
|
|
162
140
|
}
|
|
163
141
|
</script>
|
|
164
142
|
|
|
165
|
-
<script
|
|
143
|
+
<script>
|
|
166
144
|
export const useLayerManager = () => {
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
}
|
|
145
|
+
const layerActions = useLayerActions();
|
|
146
|
+
return {
|
|
147
|
+
open: (layerName, params) => layerActions.value?.open?.(layerName, params),
|
|
148
|
+
getLayer: (layerName) => layerActions.value?.getLayer?.(layerName),
|
|
149
|
+
closeAllLayers: () => layerActions.value?.closeAllLayers?.()
|
|
150
|
+
};
|
|
151
|
+
};
|
|
174
152
|
</script>
|
|
175
153
|
|
|
176
154
|
<template>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ActiveLayer } from "./types.js";
|
|
2
|
+
export declare const useLayerManager: () => {
|
|
3
|
+
open: (layerName: string, params?: {
|
|
4
|
+
[p: string]: any;
|
|
5
|
+
}) => void | undefined;
|
|
6
|
+
getLayer: (layerName: string) => ActiveLayer | undefined;
|
|
7
|
+
closeAllLayers: () => void | undefined;
|
|
8
|
+
};
|
|
9
|
+
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
10
|
+
export default _default;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import LayerManager, { useLayerManager } from "./LayersProvider.vue";
|
|
1
|
+
import LayerManager, { useLayerManager } from "./LayersProvider.vue.js";
|
|
2
2
|
export { LayerManager, useLayerManager };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { addRouteMiddleware, defineNuxtPlugin } from "#app";
|
|
2
2
|
import { useNuxtApp, useRequestHeaders, useRuntimeConfig, useState } from "#imports";
|
|
3
3
|
import { watch } from "vue";
|
|
4
|
-
import { fetch, getUser } from "./api/index.
|
|
5
|
-
import { authMiddleware, guestMiddleware, localeMiddleware } from "./middleware/index.
|
|
6
|
-
import { defineVuePlugins, useThemeMode } from "./packages/core/index.
|
|
7
|
-
import { flush, setToken, setUser } from "./packages/core/api-client.
|
|
4
|
+
import { fetch, getUser } from "./api/index.js";
|
|
5
|
+
import { authMiddleware, guestMiddleware, localeMiddleware } from "./middleware/index.js";
|
|
6
|
+
import { defineVuePlugins, useThemeMode } from "./packages/core/index.js";
|
|
7
|
+
import { flush, setToken, setUser } from "./packages/core/api-client.js";
|
|
8
8
|
const useAuth = () => {
|
|
9
9
|
return useState("auth", () => null);
|
|
10
10
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineNuxtPlugin } from "#app";
|
|
2
2
|
import { useNuxtApp } from "#imports";
|
|
3
|
-
import { deviceHelper } from "../packages/core/helpers/index.
|
|
3
|
+
import { deviceHelper } from "../packages/core/helpers/index.js";
|
|
4
4
|
export default defineNuxtPlugin(() => {
|
|
5
5
|
const device = deviceHelper();
|
|
6
6
|
return {
|
package/dist/types.d.mts
CHANGED
package/package.json
CHANGED
|
@@ -1,18 +1,24 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inzombieland/nuxt-common",
|
|
3
|
-
"version": "1.19.
|
|
3
|
+
"version": "1.19.20",
|
|
4
4
|
"license": "ISC",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
7
7
|
".": {
|
|
8
|
-
"
|
|
9
|
-
"
|
|
8
|
+
"types": "./dist/types.d.mts",
|
|
9
|
+
"import": "./dist/module.mjs"
|
|
10
10
|
},
|
|
11
11
|
"./assets/": "./assets/",
|
|
12
|
-
"./helpers": "./dist/runtime/thirdparty/helpers/index.
|
|
12
|
+
"./helpers": "./dist/runtime/thirdparty/helpers/index.js"
|
|
13
|
+
},
|
|
14
|
+
"main": "./dist/module.mjs",
|
|
15
|
+
"typesVersions": {
|
|
16
|
+
"*": {
|
|
17
|
+
".": [
|
|
18
|
+
"./dist/types.d.mts"
|
|
19
|
+
]
|
|
20
|
+
}
|
|
13
21
|
},
|
|
14
|
-
"main": "./dist/module.cjs",
|
|
15
|
-
"types": "./dist/types.d.ts",
|
|
16
22
|
"files": [
|
|
17
23
|
"dist",
|
|
18
24
|
"assets"
|
|
@@ -24,10 +30,10 @@
|
|
|
24
30
|
},
|
|
25
31
|
"scripts": {
|
|
26
32
|
"build": "nuxt-module-build build",
|
|
27
|
-
"dev:prepare": "nuxt-module-build build --stub && nuxt-module-build prepare &&
|
|
28
|
-
"dev": "
|
|
29
|
-
"dev:build:dev": "
|
|
30
|
-
"dev:build:prod": "
|
|
33
|
+
"dev:prepare": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxt prepare playground",
|
|
34
|
+
"dev": "nuxt dev playground --dotenv .env.dev",
|
|
35
|
+
"dev:build:dev": "nuxt build playground --dotenv .env.dev",
|
|
36
|
+
"dev:build:prod": "nuxt build playground --dotenv .env.prod",
|
|
31
37
|
"rollup": "rollup -c",
|
|
32
38
|
"lint": "eslint --config=eslint.config.js ./src",
|
|
33
39
|
"lint:fix": "eslint --config=eslint.config.js --fix ./src",
|
|
@@ -43,15 +49,16 @@
|
|
|
43
49
|
"devDependencies": {
|
|
44
50
|
"@braintree/sanitize-url": "^7.1.1",
|
|
45
51
|
"@fingerprintjs/fingerprintjs": "^4.6.2",
|
|
52
|
+
"@inzombieland/nuxt-common": "^1.19.19",
|
|
46
53
|
"@nuxt/devtools": "latest",
|
|
47
54
|
"@nuxt/icon": "^1.15.0",
|
|
48
|
-
"@nuxt/kit": "^3.
|
|
49
|
-
"@nuxt/module-builder": "0.
|
|
50
|
-
"@nuxt/schema": "^3.
|
|
55
|
+
"@nuxt/kit": "^4.3.0",
|
|
56
|
+
"@nuxt/module-builder": "^1.0.2",
|
|
57
|
+
"@nuxt/schema": "^4.3.0",
|
|
51
58
|
"@nuxtjs/i18n": "^10.1.0",
|
|
52
59
|
"@nuxtjs/tailwindcss": "^6.14.0",
|
|
53
|
-
"@pinia/colada": "^0.
|
|
54
|
-
"@pinia/colada-nuxt": "^0.
|
|
60
|
+
"@pinia/colada": "^0.21.2",
|
|
61
|
+
"@pinia/colada-nuxt": "^0.3.1",
|
|
55
62
|
"@pinia/nuxt": "^0.11.2",
|
|
56
63
|
"@primeuix/themes": "^1.2.3",
|
|
57
64
|
"@primevue/nuxt-module": "^4.3.9",
|
|
@@ -67,11 +74,11 @@
|
|
|
67
74
|
"@vite-pwa/nuxt": "^1.0.4",
|
|
68
75
|
"@vueuse/nuxt": "^13.9.0",
|
|
69
76
|
"autoprefixer": "^10.4.20",
|
|
70
|
-
"changelogen": "^0.
|
|
77
|
+
"changelogen": "^0.6.2",
|
|
71
78
|
"config": "^3.3.12",
|
|
72
79
|
"eslint": "^9.36.0",
|
|
73
80
|
"lerna": "^8.2.2",
|
|
74
|
-
"nuxt": "^3.
|
|
81
|
+
"nuxt": "^4.3.0",
|
|
75
82
|
"ofetch": "^1.4.1",
|
|
76
83
|
"pinia": "^3.0.3",
|
|
77
84
|
"postcss": "^8.5.6",
|
package/dist/module.cjs
DELETED
package/dist/module.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "../packages/core/composables/index.mjs";
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export * from "../helpers/composables.mjs";
|
|
2
|
-
export * from "./use-active-sessions.mjs";
|
|
3
|
-
export { useApiActions } from "./use-api-actions.mjs";
|
|
4
|
-
export { useAppLocale } from "./use-app-locale.mjs";
|
|
5
|
-
export { useCookies } from "./use-cookies.mjs";
|
|
6
|
-
export { useSubscribe } from "./use-subscribe.mjs";
|
|
7
|
-
export { useThemeMode } from "./use-theme-mode.mjs";
|
|
8
|
-
export { useUser } from "./use-user.mjs";
|
|
9
|
-
export { useValidators } from "./use-validators.mjs";
|
|
10
|
-
export { useVisitor } from "./use-visitor.mjs";
|
package/dist/types.d.ts
DELETED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|