@ozdao/martyrs 0.2.458 → 0.2.460

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.
Files changed (139) hide show
  1. package/dist/{Media-Df1hO2ZT.mjs → Media-BKlUty0j.mjs} +1 -1
  2. package/dist/{Media-B9V7fmz-.js → Media-ChTgw58S.js} +1 -1
  3. package/dist/chats.server.js +11 -18
  4. package/dist/chats.server.mjs +11 -18
  5. package/dist/globals.server.js +104 -1
  6. package/dist/globals.server.mjs +104 -1
  7. package/dist/{main-DviXUDiB.js → main-DIXWgUWx.js} +2 -2
  8. package/dist/{main-DbrX42CV.mjs → main-Q8Dr1-HT.mjs} +2 -2
  9. package/dist/martyrs/src/components/EditImages/EditImages.vue.cjs +93 -0
  10. package/dist/martyrs/src/components/EditImages/EditImages.vue.cjs.map +1 -1
  11. package/dist/martyrs/src/components/EditImages/EditImages.vue.js +94 -1
  12. package/dist/martyrs/src/components/EditImages/EditImages.vue.js.map +1 -1
  13. package/dist/martyrs/src/components/EditImages/EditImages.vue2.cjs +0 -93
  14. package/dist/martyrs/src/components/EditImages/EditImages.vue2.cjs.map +1 -1
  15. package/dist/martyrs/src/components/EditImages/EditImages.vue2.js +1 -94
  16. package/dist/martyrs/src/components/EditImages/EditImages.vue2.js.map +1 -1
  17. package/dist/martyrs/src/components/Feed/Feed.vue.cjs +1 -1
  18. package/dist/martyrs/src/components/Feed/Feed.vue.cjs.map +1 -1
  19. package/dist/martyrs/src/components/Feed/Feed.vue.js +1 -1
  20. package/dist/martyrs/src/components/Feed/Feed.vue.js.map +1 -1
  21. package/dist/martyrs/src/components/SelectMulti/{SelectMulti.vue2.cjs → SelectMulti.vue.cjs} +2 -2
  22. package/dist/martyrs/src/components/SelectMulti/{SelectMulti.vue2.js.map → SelectMulti.vue.cjs.map} +1 -1
  23. package/dist/martyrs/src/components/SelectMulti/{SelectMulti.vue2.js → SelectMulti.vue.js} +2 -2
  24. package/dist/martyrs/src/components/SelectMulti/SelectMulti.vue.js.map +1 -0
  25. package/dist/martyrs/src/modules/backoffice/components/partials/Sidebar.vue.cjs +1 -1
  26. package/dist/martyrs/src/modules/backoffice/components/partials/Sidebar.vue.js +1 -1
  27. package/dist/martyrs/src/modules/chats/components/sections/ChatWindow.vue.cjs +1 -0
  28. package/dist/martyrs/src/modules/chats/components/sections/ChatWindow.vue.cjs.map +1 -1
  29. package/dist/martyrs/src/modules/chats/components/sections/ChatWindow.vue.js +1 -0
  30. package/dist/martyrs/src/modules/chats/components/sections/ChatWindow.vue.js.map +1 -1
  31. package/dist/martyrs/src/modules/chats/store/chat.store.cjs +1 -1
  32. package/dist/martyrs/src/modules/chats/store/chat.store.cjs.map +1 -1
  33. package/dist/martyrs/src/modules/chats/store/chat.store.js +1 -1
  34. package/dist/martyrs/src/modules/chats/store/chat.store.js.map +1 -1
  35. package/dist/martyrs/src/modules/community/components/layouts/Community.vue.cjs +2 -2
  36. package/dist/martyrs/src/modules/community/components/layouts/Community.vue.cjs.map +1 -1
  37. package/dist/martyrs/src/modules/community/components/layouts/Community.vue.js +2 -2
  38. package/dist/martyrs/src/modules/community/components/layouts/Community.vue.js.map +1 -1
  39. package/dist/martyrs/src/modules/community/components/sections/Comment.vue.cjs +1 -1
  40. package/dist/martyrs/src/modules/community/components/sections/Comment.vue.cjs.map +1 -1
  41. package/dist/martyrs/src/modules/community/components/sections/Comment.vue.js +1 -1
  42. package/dist/martyrs/src/modules/community/components/sections/Comment.vue.js.map +1 -1
  43. package/dist/martyrs/src/modules/events/components/pages/EditEvent.vue.cjs +2 -2
  44. package/dist/martyrs/src/modules/events/components/pages/EditEvent.vue.js +2 -2
  45. package/dist/martyrs/src/modules/gallery/components/sections/BackofficeGallery.vue.cjs +2 -2
  46. package/dist/martyrs/src/modules/gallery/components/sections/BackofficeGallery.vue.js +2 -2
  47. package/dist/martyrs/src/modules/globals/views/components/blocks/CardHeader.vue.cjs +1 -1
  48. package/dist/martyrs/src/modules/globals/views/components/blocks/CardHeader.vue.cjs.map +1 -1
  49. package/dist/martyrs/src/modules/globals/views/components/blocks/CardHeader.vue.js +1 -1
  50. package/dist/martyrs/src/modules/globals/views/components/blocks/CardHeader.vue.js.map +1 -1
  51. package/dist/martyrs/src/modules/globals/views/components/partials/Navigation.vue.cjs +45 -37
  52. package/dist/martyrs/src/modules/globals/views/components/partials/Navigation.vue.cjs.map +1 -1
  53. package/dist/martyrs/src/modules/globals/views/components/partials/Navigation.vue.js +46 -38
  54. package/dist/martyrs/src/modules/globals/views/components/partials/Navigation.vue.js.map +1 -1
  55. package/dist/martyrs/src/modules/globals/views/components/partials/Sidebar.vue.cjs +8 -7
  56. package/dist/martyrs/src/modules/globals/views/components/partials/Sidebar.vue.cjs.map +1 -1
  57. package/dist/martyrs/src/modules/globals/views/components/partials/Sidebar.vue.js +8 -7
  58. package/dist/martyrs/src/modules/globals/views/components/partials/Sidebar.vue.js.map +1 -1
  59. package/dist/martyrs/src/modules/globals/views/plugins/AlertDialog.vue.cjs +1 -1
  60. package/dist/martyrs/src/modules/globals/views/plugins/AlertDialog.vue.cjs.map +1 -1
  61. package/dist/martyrs/src/modules/globals/views/plugins/AlertDialog.vue.js +1 -1
  62. package/dist/martyrs/src/modules/globals/views/plugins/AlertDialog.vue.js.map +1 -1
  63. package/dist/martyrs/src/modules/icons/entities/IconTime.vue.cjs +4 -3
  64. package/dist/martyrs/src/modules/icons/entities/IconTime.vue.cjs.map +1 -1
  65. package/dist/martyrs/src/modules/icons/entities/IconTime.vue.js +5 -4
  66. package/dist/martyrs/src/modules/icons/entities/IconTime.vue.js.map +1 -1
  67. package/dist/martyrs/src/modules/notifications/notifications.client.cjs +2 -61
  68. package/dist/martyrs/src/modules/notifications/notifications.client.cjs.map +1 -1
  69. package/dist/martyrs/src/modules/notifications/notifications.client.js +2 -61
  70. package/dist/martyrs/src/modules/notifications/notifications.client.js.map +1 -1
  71. package/dist/martyrs/src/modules/orders/components/pages/OrderCreate.vue.cjs +1 -0
  72. package/dist/martyrs/src/modules/orders/components/pages/OrderCreate.vue.cjs.map +1 -1
  73. package/dist/martyrs/src/modules/orders/components/pages/OrderCreate.vue.js +2 -1
  74. package/dist/martyrs/src/modules/orders/components/pages/OrderCreate.vue.js.map +1 -1
  75. package/dist/martyrs/src/modules/orders/components/pages/OrderCreateBackoffice.vue.cjs +1 -1
  76. package/dist/martyrs/src/modules/orders/components/pages/OrderCreateBackoffice.vue.js +1 -1
  77. package/dist/martyrs/src/modules/orders/components/partials/ShopCart.vue.cjs +1 -1
  78. package/dist/martyrs/src/modules/orders/components/partials/ShopCart.vue.cjs.map +1 -1
  79. package/dist/martyrs/src/modules/orders/components/partials/ShopCart.vue.js +1 -1
  80. package/dist/martyrs/src/modules/orders/components/partials/ShopCart.vue.js.map +1 -1
  81. package/dist/martyrs/src/modules/orders/components/sections/AskToLogin.vue.cjs +2 -2
  82. package/dist/martyrs/src/modules/orders/components/sections/AskToLogin.vue.cjs.map +1 -1
  83. package/dist/martyrs/src/modules/orders/components/sections/AskToLogin.vue.js +2 -2
  84. package/dist/martyrs/src/modules/orders/components/sections/AskToLogin.vue.js.map +1 -1
  85. package/dist/martyrs/src/modules/organizations/components/blocks/CardOrganization.vue.cjs +12 -16
  86. package/dist/martyrs/src/modules/organizations/components/blocks/CardOrganization.vue.cjs.map +1 -1
  87. package/dist/martyrs/src/modules/organizations/components/blocks/CardOrganization.vue.js +15 -19
  88. package/dist/martyrs/src/modules/organizations/components/blocks/CardOrganization.vue.js.map +1 -1
  89. package/dist/martyrs/src/modules/organizations/components/pages/OrganizationBackoffice.vue.cjs +1 -1
  90. package/dist/martyrs/src/modules/organizations/components/pages/OrganizationBackoffice.vue.js +1 -1
  91. package/dist/martyrs/src/modules/organizations/components/pages/OrganizationEdit.vue.cjs +1 -1
  92. package/dist/martyrs/src/modules/organizations/components/pages/OrganizationEdit.vue.js +1 -1
  93. package/dist/martyrs/src/modules/products/components/blocks/CardPosition.vue.cjs +1 -1
  94. package/dist/martyrs/src/modules/products/components/blocks/CardPosition.vue.js +1 -1
  95. package/dist/martyrs/src/modules/products/components/pages/EditLeftover.vue.cjs +1 -1
  96. package/dist/martyrs/src/modules/products/components/pages/EditLeftover.vue.js +1 -1
  97. package/dist/martyrs/src/modules/products/components/pages/Product.vue.cjs +3 -3
  98. package/dist/martyrs/src/modules/products/components/pages/Product.vue.cjs.map +1 -1
  99. package/dist/martyrs/src/modules/products/components/pages/Product.vue.js +3 -3
  100. package/dist/martyrs/src/modules/products/components/pages/Product.vue.js.map +1 -1
  101. package/dist/martyrs/src/modules/products/components/pages/ProductEdit.vue.cjs +1 -1
  102. package/dist/martyrs/src/modules/products/components/pages/ProductEdit.vue.js +1 -1
  103. package/dist/martyrs/src/modules/rents/views/components/pages/RentsEdit.vue.cjs +1 -1
  104. package/dist/martyrs/src/modules/rents/views/components/pages/RentsEdit.vue.js +1 -1
  105. package/dist/martyrs.cjs.js +1 -1
  106. package/dist/martyrs.css +1 -1
  107. package/dist/martyrs.es.js +1 -1
  108. package/dist/notifications.server.js +2 -2
  109. package/dist/notifications.server.mjs +2 -2
  110. package/dist/orders.server.js +124 -109
  111. package/dist/orders.server.mjs +124 -109
  112. package/dist/style.css +12 -99
  113. package/package.json +1 -1
  114. package/src/components/Feed/Feed.vue +1 -1
  115. package/src/modules/chats/components/sections/ChatWindow.vue +1 -0
  116. package/src/modules/chats/routes/chats.routes.js +10 -20
  117. package/src/modules/chats/store/chat.store.js +1 -1
  118. package/src/modules/community/components/layouts/Community.vue +2 -5
  119. package/src/modules/community/components/sections/Comment.vue +1 -1
  120. package/src/modules/globals/controllers/classes/globals.websocket.js +116 -0
  121. package/src/modules/globals/globals.server.js +3 -0
  122. package/src/modules/globals/views/components/blocks/CardHeader.vue +1 -1
  123. package/src/modules/globals/views/components/partials/Navigation.vue +67 -149
  124. package/src/modules/globals/views/components/partials/Sidebar.vue +7 -37
  125. package/src/modules/globals/views/plugins/AlertDialog.vue +1 -1
  126. package/src/modules/icons/entities/IconTime.vue +1 -1
  127. package/src/modules/notifications/notifications.client.js +2 -79
  128. package/src/modules/notifications/services/notification.service.js +1 -1
  129. package/src/modules/orders/components/pages/OrderCreate.vue +6 -1
  130. package/src/modules/orders/components/partials/ShopCart.vue +1 -1
  131. package/src/modules/orders/components/sections/AskToLogin.vue +2 -1
  132. package/src/modules/orders/controllers/orders.controller.js +49 -35
  133. package/src/modules/organizations/components/blocks/CardOrganization.vue +10 -9
  134. package/src/modules/products/components/pages/Product.vue +3 -3
  135. package/src/styles/base/all.scss +19 -5
  136. package/src/styles/base/shadow_transitions_hover_refactor.scss +0 -30
  137. package/src/styles/base/transitions.scss +109 -0
  138. package/dist/martyrs/src/components/SelectMulti/SelectMulti.vue2.cjs.map +0 -1
  139. package/src/components/AskToLogin/AskToLogin.vue +0 -22
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ozdao/martyrs",
3
- "version": "0.2.458",
3
+ "version": "0.2.460",
4
4
  "description": "Fullstack framework focused on user experience and ease of development.",
5
5
  "author": "OZ DAO <hello@ozdao.dev>",
6
6
  "license": "GPL-3.0-or-later",
@@ -92,7 +92,7 @@
92
92
  :horizontal="skeleton.horizontal"
93
93
  :loading="isLoading"
94
94
  :key="'skeleton-' + i"
95
- class="mn-b-small radius-medium o-hidden d-block"
95
+ class="radius-medium o-hidden d-block"
96
96
  />
97
97
  <Loader v-if="isLoading && skeleton?.hide"/>
98
98
  </TransitionGroup>
@@ -54,6 +54,7 @@ const sendMessage = async () => {
54
54
  if (newMessage.value) {
55
55
  const message = {
56
56
  text: newMessage.value,
57
+ module: 'chat',
57
58
  username: chatStore.state.username,
58
59
  chatId: chatStore.state.currentChatId
59
60
  };
@@ -8,27 +8,17 @@ module.exports = function(app, db, wss) {
8
8
 
9
9
  const { verifySignUp, verifyUser } = middlewareFactory(db);
10
10
 
11
- wss.on('connection', (ws) => {
12
- ws.type = 'chat'; // Помечаем соединение как чат
13
- console.log('ws connecting to chat...');
14
-
15
- ws.on('message', async (message) => {
16
- const msg = JSON.parse(message);
17
- if (msg.type === 'joinChat') {
18
- ws.chatId = msg.chatId;
19
- console.log(`Client joined chat: ${msg.chatId}`);
20
- } else {
11
+ wss.registerModule('chat', async (ws, msg) => {
12
+ if (msg.type === 'joinChat') {
13
+ ws.chatId = msg.chatId;
14
+ } else {
15
+ const savedMessage = await controller.saveMessage(msg);
21
16
 
22
- console.log(msg)
23
- const savedMessage = await controller.saveMessage(msg);
24
-
25
- wss.clients.forEach((client) => {
26
- if (client.type === 'chat' && client.chatId && client.chatId.toString() === msg.chatId) {
27
- client.send(JSON.stringify(savedMessage));
28
- }
29
- });
30
- }
31
- });
17
+ wss.broadcastToModuleWithFilter('chat', (client) =>
18
+ client.chatId === msg.chatId,
19
+ savedMessage
20
+ );
21
+ }
32
22
  });
33
23
 
34
24
 
@@ -45,7 +45,7 @@ const methods = {
45
45
  state.messages = []; // Clear current messages when changing chat
46
46
 
47
47
  // Send join chat message through the WebSocket
48
- globalWebSocket.send({ type: 'joinChat', chatId });
48
+ globalWebSocket.send({ type: 'joinChat', module: 'chat', chatId });
49
49
 
50
50
  // Fetch chat history
51
51
  const response = await fetch(`/messages/${chatId}`);
@@ -1,9 +1,9 @@
1
1
  <template>
2
2
  <div class="bg-white">
3
- <section class="w-100 h-100 o-hidden flex-nowrap flex gap-thin pd-thin pos-relative">
3
+ <section class="w-100 h-100 o-hidden flex-nowrap flex gap-thin mobile:pd-zero pd-thin pos-relative">
4
4
 
5
5
  <div style="flex: 1 1 auto" class="w-100 o-y-scroll h-100 pos-relative">
6
- <header v-if="!route.params.url && route.name !== 'Create BlogPost'" class="bg-light pd-medium radius-medium mobile:radius-zero t-black pos-relative mn-b-thin flex-v-center t-left flex-nowrap flex">
6
+ <header v-if="!route.params.url && route.name !== 'Create BlogPost'" class="bg-light pd-medium radius-medium mobile:radius-zero o-x-scroll scroll-hide o-y-visible t-black pos-relative mn-b-thin flex-v-center t-left flex-nowrap flex">
7
7
  <h2 class="pos-relative t-nowrap flex-v-center flex-nowrap flex">
8
8
  <span class="mn-r-thin">Posts for </span>
9
9
 
@@ -116,9 +116,6 @@
116
116
  +
117
117
  </router-link>
118
118
  </div>
119
-
120
-
121
-
122
119
 
123
120
  <transition name="slide-fade">
124
121
  <Feed
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <div>
3
3
  <CardHeader
4
- class="mn-b-thin"
4
+ class="mn-b-thin w-100"
5
5
  :entity="comment"
6
6
  :entityType="'comment'"
7
7
  :user="owner"
@@ -0,0 +1,116 @@
1
+ const { WebSocketServer } = require('ws');
2
+ const jwt = require('jsonwebtoken');
3
+
4
+ class WebSocketManager {
5
+ constructor(server) {
6
+ this.wss = new WebSocketServer({
7
+ server,
8
+ verifyClient: this.verifyClient.bind(this)
9
+ });
10
+
11
+ this.modules = new Map(); // moduleName => handler
12
+ this.userConnections = new Map(); // userId => Set(ws)
13
+
14
+ this.wss.on('connection', (ws, req) => {
15
+ ws.moduleName = null;
16
+ ws.userId = req.userId || null;
17
+
18
+ if (ws.userId) {
19
+ this._trackUserConnection(ws.userId, ws);
20
+ }
21
+
22
+ ws.on('message', async (rawMessage) => {
23
+ try {
24
+ const msg = JSON.parse(rawMessage);
25
+ console.log(msg)
26
+ const moduleName = ws.moduleName || msg.module;
27
+
28
+ console.log('module name is,', moduleName)
29
+ console.log('modules is,', this.modules)
30
+
31
+ if (moduleName && this.modules.has(moduleName)) {
32
+ ws.moduleName = moduleName;
33
+ const handler = this.modules.get(moduleName);
34
+ await handler(ws, msg);
35
+ }
36
+ } catch (err) {
37
+ console.error('Invalid message or handler error:', err);
38
+ }
39
+ });
40
+
41
+ ws.on('close', () => {
42
+ if (ws.userId && this.userConnections.has(ws.userId)) {
43
+ this.userConnections.get(ws.userId).delete(ws);
44
+ if (this.userConnections.get(ws.userId).size === 0) {
45
+ this.userConnections.delete(ws.userId);
46
+ }
47
+ }
48
+ });
49
+ });
50
+ }
51
+
52
+ verifyClient(info, done) {
53
+ try {
54
+ const userCookie = info.req.headers.cookie
55
+ ?.split('; ')
56
+ .find((cookie) => cookie.startsWith('user='));
57
+
58
+ if (!userCookie) return done(true);
59
+
60
+ const token = JSON.parse(decodeURIComponent(userCookie.replace('user=', '')));
61
+ const decoded = jwt.verify(token.accessToken, process.env.SECRET_KEY);
62
+
63
+ info.req.userId = decoded._id;
64
+ } catch (err) {
65
+ console.error('Invalid token:', err);
66
+ }
67
+
68
+ done(true); // Разрешаем в любом случае
69
+ }
70
+
71
+ _trackUserConnection(userId, ws) {
72
+ if (!this.userConnections.has(userId)) {
73
+ this.userConnections.set(userId, new Set());
74
+ }
75
+ this.userConnections.get(userId).add(ws);
76
+ }
77
+
78
+ registerModule(moduleName, handler) {
79
+ this.modules.set(moduleName, handler);
80
+ }
81
+
82
+ sendToUserInModule(moduleName, userId, data) {
83
+ const sockets = this.userConnections.get(userId);
84
+ if (!sockets) return;
85
+
86
+ for (const ws of sockets) {
87
+ if (ws.readyState === 1 && ws.moduleName === moduleName) {
88
+ ws.send(JSON.stringify(data));
89
+ }
90
+ }
91
+ }
92
+
93
+ broadcastToModule(moduleName, data) {
94
+ for (const ws of this.wss.clients) {
95
+ if (ws.readyState === 1 && ws.moduleName === moduleName) {
96
+ ws.send(JSON.stringify(data));
97
+ }
98
+ }
99
+ }
100
+
101
+ broadcastToModuleWithFilter(moduleName, filterFn, data) {
102
+ for (const ws of this.wss.clients) {
103
+ if (ws.readyState !== 1) continue;
104
+ if (ws.moduleName !== moduleName) continue;
105
+ if (!filterFn(ws)) continue;
106
+
107
+ ws.send(JSON.stringify(data));
108
+ }
109
+ }
110
+
111
+ getServer() {
112
+ return this.wss;
113
+ }
114
+ }
115
+
116
+ module.exports = WebSocketManager;
@@ -2,6 +2,8 @@
2
2
  const { getInstance } = require('@martyrs/src/modules/globals/controllers/classes/globals.abac.js')
3
3
  const initGlobalsPolicies = require('./controllers/policies/globals.policies.js');
4
4
 
5
+ const Websocket = require('@martyrs/src/modules/globals/controllers/classes/globals.websocket.js');
6
+
5
7
  function initializeGlobals(app, db, origins, publicPath) {
6
8
  // Определяем модель Log только здесь
7
9
  db.log = db.mongoose.models.Log || db.mongoose.model('Log', new db.mongoose.Schema({
@@ -16,4 +18,5 @@ function initializeGlobals(app, db, origins, publicPath) {
16
18
 
17
19
  module.exports = {
18
20
  initialize: initializeGlobals,
21
+ Websocket
19
22
  };
@@ -8,7 +8,7 @@
8
8
  >
9
9
 
10
10
  <div
11
- class="w-100 p-medium flex-nowrap flex-v-center flex"
11
+ class="w-100 p-medium t-nowrap flex-nowrap flex-v-center flex"
12
12
  >
13
13
  <img loading="lazy"
14
14
  v-if="owner.target?.profile?.photo?.length > 0 && type !== 'short'"
@@ -2,6 +2,8 @@
2
2
  import { ref, watch, computed } from 'vue'
3
3
  import { useRouter } from 'vue-router'
4
4
 
5
+ import IconChevronBottom from '@martyrs/src/modules/icons/navigation/IconChevronBottom.vue'
6
+
5
7
  import * as globals from '@martyrs/src/modules/globals/views/store/globals'
6
8
  import * as auth from '@martyrs/src/modules/auth/views/store/auth'
7
9
 
@@ -75,7 +77,7 @@ const processRoute = (route) => {
75
77
 
76
78
  <template>
77
79
  <nav
78
- class="o-x-hidden h-100"
80
+ class="transition-quint-out o-x-hidden h-100"
79
81
  :class="[
80
82
  stateSidebar ? 'pd-small' : 'pd-micro',
81
83
  horizontal ? 'w-100 desktop-only flex flex-center flex-nowrap o-y-hidden' : 'o-y-scroll rows-1',
@@ -85,6 +87,7 @@ const processRoute = (route) => {
85
87
  v-for="section in props.navigationItems"
86
88
  v-show="!section.visible || (typeof section.visible === 'function' ? section.visible(auth.state) : true)"
87
89
  :key="section.category"
90
+ class="transition-quint-out"
88
91
  :class="[
89
92
  horizontal ? 'w-max flex-child-default flex flex-nowrap' : '',
90
93
  stateSidebar && !horizontal ? 'mn-t-medium' : '',
@@ -110,87 +113,85 @@ const processRoute = (route) => {
110
113
  <li
111
114
  v-for="item in section.items"
112
115
  v-show="!item.visible || (typeof item.visible === 'function' ? item.visible(auth.state) : true)"
113
- class="flex-center"
114
- :class="[
115
- horizontal ? 'w-100 flex flex-nowrap' : '',
116
- stateSidebar && !horizontal ? '' : 'aspect-1x1'
117
- ]"
116
+ class="w-100 pos-relative"
118
117
  :key="item.title"
118
+
119
119
  >
120
- <button
121
- @click="item.route ? (isPhone ? (stateSidebar = false) : null, $route.path !== processRoute(item.route) ? router.push(processRoute(item.route)) : stateSidebar = false) : null"
122
- class="flex-child-default flex-center gap-thin flex sidebar-item-btn"
123
- :class="[
124
- stateSidebar || horizontal ? 'expanded-item pd-thin' : 'w-100 h-100 justify-center',
125
- horizontal ? 'w-max flex flex-nowrap' : '',
120
+ <button
121
+ class="transition-quint-out w-100 flex radius-small flex-nowrap cursor-pointer flex-v-center"
122
+ @click="item.route ? (isPhone ? (stateSidebar = false) : null, $route.path !== processRoute(item.route) ? router.push(processRoute(item.route)) : stateSidebar = false) : null"
123
+ :class="[
124
+ horizontal ? 'pd-thin' : '',
126
125
  item.route && $route.path === processRoute(item.route) ? theme === 'light' ? 'bg-light' : 'bg-dark' : '',
127
126
  theme === 'light' ? 'hover-bg-light' : 'hover-bg-dark'
128
127
  ]"
129
- >
128
+ >
129
+ <div v-if="!horizontal" class="w-100 flex-child-default w-max-big flex flex-center aspect-1x1">
130
130
  <component
131
- v-if="item.iconComponent && !horizontal"
131
+ v-if="item.iconComponent"
132
132
  :is="item.iconComponent"
133
133
  class="i-medium flex-child-default"
134
134
  :fill="globals.state.theme.darkmode || theme === 'dark' ? 'rgba(255,255,255,0.7)' : 'rgba(0,0,0,0.25)'"
135
135
  />
136
136
  <span
137
- v-if="!item.iconComponent && !horizontal"
137
+ v-if="!item.iconComponent "
138
138
  class="i-medium sidebar-item-icon t-lh-1 flex-child-default"
139
139
  >
140
140
  {{ item.icon }}
141
141
  </span>
142
-
143
- <span
144
- class="w-100 t-left sidebar-item-title"
145
- :class="{ 'hidden': !stateSidebar && !horizontal, 'visible': stateSidebar || horizontal }"
146
- >
147
- {{ item.title }}
148
- </span>
149
-
150
- <span
151
- v-if="item.subItems && stateSidebar && !horizontal"
152
- class="mn-l-auto sidebar-dropdown-icon"
153
- :class="{ 'rotate-180': isSectionExpanded(item.title) }"
154
- @click.stop="toggleSection(item.title)"
155
- >
156
-
157
- </span>
158
- </button>
159
-
160
- <transition
161
- enter-active-class="dropdown-enter"
162
- leave-active-class="dropdown-leave"
163
- enter-from-class="dropdown-enter-from"
164
- enter-to-class="dropdown-enter-to"
165
- leave-from-class="dropdown-leave-from"
166
- leave-to-class="dropdown-leave-to"
142
+ </div>
143
+
144
+ <span
145
+ class="transition-quint-out w-100 t-left t-medium"
146
+ :class="{ 'hidden': !stateSidebar && !horizontal, 'visible': stateSidebar || horizontal }"
167
147
  >
168
- <ul
169
- v-if="item.subItems && isSectionExpanded(item.title) && stateSidebar && !horizontal"
170
- class="sidebar-submenu"
171
- >
172
- <li v-for="subItem in item.subItems" :key="subItem.title">
173
- <a
174
- @click="subItem.route && (this.$route.path !== subItem.route ? router.push(subItem.route) : (isPhone ? stateSidebar = false : null))"
175
- href="#"
176
- class="sidebar-subitem-link flex flex-nowrap gap-thin pd-thin radius-small"
177
- :class="[
178
- subItem.route && $route.path === processRoute(subItem.route) ? theme === 'light' ? 'bg-light' : 'bg-dark' : '',
179
- theme === 'light' ? 'hover-bg-light' : 'hover-bg-dark'
180
- ]"
181
- >
182
- <component
183
- v-if="subItem.iconComponent"
184
- :is="subItem.iconComponent"
185
- class="sidebar-subitem-icon i-medium"
186
- :fill="globals.state.theme.darkmode || theme === 'dark' ? 'rgba(255,255,255,0.7)' : 'rgba(0,0,0,0.25)'"
187
- />
188
- <span v-else class="sidebar-subitem-icon">{{ subItem.icon }}</span>
189
- <span class="sidebar-subitem-title">{{ subItem.title }}</span>
190
- </a>
191
- </li>
192
- </ul>
193
- </transition>
148
+ {{ item.title }}
149
+ </span>
150
+
151
+ <span
152
+ v-if="item.subItems && stateSidebar && !horizontal"
153
+ class="mn-l-auto mn-r-small sidebar-dropdown-icon"
154
+ :class="{ 'rotate-180': isSectionExpanded(item.title) }"
155
+ @click.stop="toggleSection(item.title)"
156
+ >
157
+ <IconChevronBottom :class="{ 'rotate-180 mn-t-micro-negative': isOpen }" :fill=" theme === 'dark' ? 'rgb(var(--white))': 'rgb(var(--black))'" class="i-small"/>
158
+ </span>
159
+ </button>
160
+ <transition
161
+ enter-active-class="dropdown-enter"
162
+ leave-active-class="dropdown-leave"
163
+ enter-from-class="dropdown-enter-from"
164
+ enter-to-class="dropdown-enter-to"
165
+ leave-from-class="dropdown-leave-from"
166
+ leave-to-class="dropdown-leave-to"
167
+ >
168
+ <ul
169
+ v-if="item.subItems && isSectionExpanded(item.title) && stateSidebar && !horizontal"
170
+ class="mn-l-small mn-t-thin"
171
+ >
172
+ <li v-for="subItem in item.subItems" :key="subItem.title">
173
+
174
+ <a
175
+ @click="subItem.route && (this.$route.path !== subItem.route ? router.push(subItem.route) : (isPhone ? stateSidebar = false : null))"
176
+ href="#"
177
+ class="transition-quint-out flex flex-v-center flex-nowrap gap-thin pd-thin radius-small"
178
+ :class="[
179
+ subItem.route && $route.path === processRoute(subItem.route) ? theme === 'light' ? 'bg-light' : 'bg-dark' : '',
180
+ theme === 'light' ? 'hover-bg-light' : 'hover-bg-dark'
181
+ ]"
182
+ >
183
+ <component
184
+ v-if="subItem.iconComponent"
185
+ :is="subItem.iconComponent"
186
+ class="i-medium"
187
+ :fill="globals.state.theme.darkmode || theme === 'dark' ? 'rgba(255,255,255,0.7)' : 'rgba(0,0,0,0.25)'"
188
+ />
189
+ <span v-else class="">{{ subItem.icon }}</span>
190
+ <span class="w-100">{{ subItem.title }}</span>
191
+ </a>
192
+ </li>
193
+ </ul>
194
+ </transition>
194
195
  </li>
195
196
  </ul>
196
197
  </div>
@@ -198,94 +199,11 @@ const processRoute = (route) => {
198
199
  </template>
199
200
 
200
201
  <style scoped>
201
- .sidebar-item-btn:hover .sidebar-item-icon,
202
- .sidebar-subitem-link:hover .sidebar-subitem-icon {
203
- transform: scale(1.1);
204
- }
205
-
206
- .sidebar-item-btn:hover .sidebar-item-icon {
207
- transform: scale(1.1);
208
- }
209
-
210
-
211
- .sidebar-subitem-link:hover .sidebar-subitem-icon {
212
- transform: scale(1.1);
213
- }
214
-
215
-
216
-
217
- .expanded-item {
218
- display: flex;
219
- align-items: center;
220
- width: 100%;
221
- border-radius: var(--small);
222
- }
223
-
224
- .sidebar-item-btn {
225
- align-items: center;
226
- border-radius: var(--small);
227
- transition: all 0.2s;
228
- position: relative;
229
- border: none;
230
- cursor: pointer;
231
- }
232
-
233
-
234
- .sidebar-item-title {
235
- font-weight: 500;
236
- transition: opacity 0.2s, width 0.2s;
237
- white-space: nowrap;
238
- }
239
-
240
- .sidebar-item-icon {
241
- font-size: 1.25rem;
242
- transition: transform 0.2s;
243
- }
244
-
245
-
246
-
247
-
248
- .sidebar-highlight-indicator {
249
- position: absolute;
250
- left: 0;
251
- width: 4px;
252
- height: 100%;
253
- border-radius: 0 var(--micro) var(--micro) 0;
254
- background: linear-gradient(to bottom, var(--second-regular), var(--second-small));
255
- transition: opacity 0.2s;
256
- }
257
-
258
-
259
-
260
- .sidebar-dropdown-icon {
261
- color: var(--grey-medium);
262
- transition: transform 0.2s;
263
- }
264
202
 
265
203
  .rotate-180 {
266
204
  transform: rotate(180deg);
267
205
  }
268
206
 
269
- .sidebar-submenu {
270
- margin-top: var(--micro);
271
- margin-left: var(--semi);
272
- display: flex;
273
- flex-direction: column;
274
- gap: var(--micro);
275
- }
276
-
277
- .sidebar-subitem-link {
278
- display: flex;
279
- align-items: center;
280
- text-decoration: none;
281
- transition: all 0.2s;
282
- }
283
-
284
-
285
- .sidebar-subitem-title {
286
- font-size: 0.875rem;
287
- }
288
-
289
207
  .hidden {
290
208
  /* opacity: 0;*/
291
209
  width: 0;
@@ -46,7 +46,7 @@ router.beforeEach((to, from) => {
46
46
 
47
47
  <template>
48
48
  <aside
49
- class="transition-linear w-min-0 o-hidden flex-child-default z-index-2 br-r br-solid flex flex-column h-100"
49
+ class="transition-quint-out w-min-0 o-hidden flex-child-default z-index-2 br-r br-solid flex flex-column h-100"
50
50
  :class="[
51
51
  stateSidebar
52
52
  ? `${width} w-min-10 tablet:w-min-100 tablet:w-100 mobile:w-min-100 mobile:w-100`
@@ -62,7 +62,7 @@ router.beforeEach((to, from) => {
62
62
  <slot></slot>
63
63
 
64
64
  <div
65
- class="br-solid br-t"
65
+ class="br-solid w-100 br-t"
66
66
  :class="{
67
67
  'pd-micro': !stateSidebar,
68
68
  'pd-small': stateSidebar,
@@ -72,18 +72,19 @@ router.beforeEach((to, from) => {
72
72
  >
73
73
  <button
74
74
  @click="() => globals.actions.toggleTheme()"
75
- class="flex flex-center flex-nowrap dark-mode-toggle"
75
+ class="transition-quint-out flex w-100 flex-center radius-small cursor-pointer flex-nowrap"
76
76
  :class="[
77
- stateSidebar ? 'pd-thin justify-between' : 'h-100 aspect-1x1 justify-center'
77
+ stateSidebar ? 'pd-thin justify-between' : 'w-100 justify-center',
78
+ theme === 'light' ? 'hover-bg-light' : 'hover-bg-dark'
78
79
  ]"
79
80
  >
80
81
  <span
81
- class="dark-mode-label w-100 t-left mn-r-thin"
82
+ class="w-100 t-nowrap transition-quint-out t-left t-medium mn-r-thin"
82
83
  :class="{ 'hidden': !stateSidebar, 'visible': stateSidebar }"
83
84
  >
84
85
  Dark Mode
85
86
  </span>
86
- <span class="dark-mode-icon">
87
+ <span class="aspect-1x1 flex-child-default w-max-big w-100 flex flex-center ">
87
88
  {{ globals.state.theme.darkmode ? '🌙' : '☀️' }}
88
89
  </span>
89
90
  </button>
@@ -92,37 +93,6 @@ router.beforeEach((to, from) => {
92
93
  </template>
93
94
 
94
95
  <style scoped>
95
- .dark-mode-toggle {
96
- align-items: center;
97
- width: 100%;
98
- border-radius: var(--small);
99
- transition: all 0.2s;
100
- position: relative;
101
- border: none;
102
- background: transparent;
103
- cursor: pointer;
104
- }
105
-
106
- .dark-mode-toggle:hover {
107
- background: var(--light-regular);
108
- }
109
-
110
- .dark-mode-label {
111
- font-weight: 500;
112
- transition: opacity 0.2s, width 0.2s;
113
- white-space: nowrap;
114
- }
115
-
116
- .dark-mode-icon {
117
- font-size: 1.25rem;
118
- transition: transform 0.2s;
119
- }
120
-
121
- .dark-mode-toggle:hover .dark-mode-icon {
122
- transform: scale(1.1);
123
- }
124
-
125
-
126
96
  .hidden {
127
97
  opacity: 0;
128
98
  width: 0;
@@ -3,7 +3,7 @@
3
3
  :title="alertState.title"
4
4
  :isPopupOpen="alertState.visible"
5
5
  @close-popup="closeAlert"
6
- class="bg-white w-min-30r w-max-30r radius-medium pd-medium"
6
+ class="bg-white w-min-20r w-max-30r w-max-100 radius-medium pd-medium"
7
7
  >
8
8
  <p class="mn-b-medium">{{ alertState.message }}</p>
9
9
 
@@ -1,5 +1,5 @@
1
1
  <template>
2
2
  <svg width="50" height="49" viewBox="0 0 50 49" fill="none" xmlns="http://www.w3.org/2000/svg">
3
- <path d="M24.7274 45.2266C13.2178 45.2266 3.85356 35.8624 3.85356 24.3528C3.85356 12.8432 13.2178 3.47897 24.7274 3.47897C36.237 3.47897 45.6012 12.8432 45.6012 24.3528C45.6012 35.8624 36.237 45.2266 24.7274 45.2266ZM24.7274 0C11.2777 0 0.374592 10.9031 0.374592 24.3528C0.374592 37.8025 11.2777 48.7056 24.7274 48.7056C38.1771 48.7056 49.0802 37.8025 49.0802 24.3528C49.0802 10.9031 38.1771 0 24.7274 0ZM34.0047 23.773H26.4669V11.5966C26.4669 11.1352 26.2836 10.6928 25.9574 10.3666C25.6312 10.0404 25.1887 9.85709 24.7274 9.85709C24.2661 9.85709 23.8236 10.0404 23.4974 10.3666C23.1712 10.6928 22.9879 11.1352 22.9879 11.5966V25.5125C22.9879 25.9738 23.1712 26.4162 23.4974 26.7425C23.8236 27.0687 24.2661 27.2519 24.7274 27.2519H34.0047C34.2331 27.2519 34.4593 27.207 34.6703 27.1195C34.8814 27.0321 35.0731 26.904 35.2347 26.7425C35.3962 26.5809 35.5243 26.3892 35.6117 26.1781C35.6991 25.9671 35.7441 25.7409 35.7441 25.5125C35.7441 25.284 35.6991 25.0578 35.6117 24.8468C35.5243 24.6357 35.3962 24.444 35.2347 24.2825C35.0731 24.1209 34.8814 23.9928 34.6703 23.9054C34.4593 23.818 34.2331 23.773 34.0047 23.773Z" fill="rgb(var(--black))"/>
3
+ <path d="M24.7274 45.2266C13.2178 45.2266 3.85356 35.8624 3.85356 24.3528C3.85356 12.8432 13.2178 3.47897 24.7274 3.47897C36.237 3.47897 45.6012 12.8432 45.6012 24.3528C45.6012 35.8624 36.237 45.2266 24.7274 45.2266ZM24.7274 0C11.2777 0 0.374592 10.9031 0.374592 24.3528C0.374592 37.8025 11.2777 48.7056 24.7274 48.7056C38.1771 48.7056 49.0802 37.8025 49.0802 24.3528C49.0802 10.9031 38.1771 0 24.7274 0ZM34.0047 23.773H26.4669V11.5966C26.4669 11.1352 26.2836 10.6928 25.9574 10.3666C25.6312 10.0404 25.1887 9.85709 24.7274 9.85709C24.2661 9.85709 23.8236 10.0404 23.4974 10.3666C23.1712 10.6928 22.9879 11.1352 22.9879 11.5966V25.5125C22.9879 25.9738 23.1712 26.4162 23.4974 26.7425C23.8236 27.0687 24.2661 27.2519 24.7274 27.2519H34.0047C34.2331 27.2519 34.4593 27.207 34.6703 27.1195C34.8814 27.0321 35.0731 26.904 35.2347 26.7425C35.3962 26.5809 35.5243 26.3892 35.6117 26.1781C35.6991 25.9671 35.7441 25.7409 35.7441 25.5125C35.7441 25.284 35.6991 25.0578 35.6117 24.8468C35.5243 24.6357 35.3962 24.444 35.2347 24.2825C35.0731 24.1209 34.8814 23.9928 34.6703 23.9054C34.4593 23.818 34.2331 23.773 34.0047 23.773Z" :class="$attrs.class" fill="rgb(var(--black))"/>
4
4
  </svg>
5
5
  </template>