@ozdao/martyrs 0.2.430 → 0.2.431
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/chats.server.js +0 -19
- package/dist/chats.server.mjs +0 -19
- package/dist/martyrs/src/components/Button/{Button.vue.cjs → Button.vue2.cjs} +2 -2
- package/dist/martyrs/src/components/Button/Button.vue2.cjs.map +1 -0
- package/dist/martyrs/src/components/Button/{Button.vue.js → Button.vue2.js} +2 -2
- package/dist/martyrs/src/components/Button/{Button.vue.cjs.map → Button.vue2.js.map} +1 -1
- package/dist/martyrs/src/components/Chips/{Chips.vue.cjs → Chips.vue2.cjs} +2 -2
- package/dist/martyrs/src/components/Chips/Chips.vue2.cjs.map +1 -0
- package/dist/martyrs/src/components/Chips/{Chips.vue.js → Chips.vue2.js} +2 -2
- package/dist/martyrs/src/components/Chips/Chips.vue2.js.map +1 -0
- package/dist/martyrs/src/components/Menu/{Menu.vue2.cjs → Menu.vue.cjs} +2 -2
- package/dist/martyrs/src/components/Menu/Menu.vue.cjs.map +1 -0
- package/dist/martyrs/src/components/Menu/{Menu.vue2.js → Menu.vue.js} +2 -2
- package/dist/martyrs/src/components/Menu/Menu.vue.js.map +1 -0
- package/dist/martyrs/src/components/Popup/{Popup.vue2.cjs → Popup.vue.cjs} +2 -2
- package/dist/martyrs/src/components/Popup/{Popup.vue2.js.map → Popup.vue.cjs.map} +1 -1
- package/dist/martyrs/src/components/Popup/{Popup.vue2.js → Popup.vue.js} +2 -2
- package/dist/martyrs/src/components/Popup/Popup.vue.js.map +1 -0
- package/dist/martyrs/src/components/Tab/{Tab.vue.cjs → Tab.vue2.cjs} +2 -2
- package/dist/martyrs/src/components/Tab/Tab.vue2.cjs.map +1 -0
- package/dist/martyrs/src/components/Tab/{Tab.vue.js → Tab.vue2.js} +2 -2
- package/dist/martyrs/src/components/Tab/{Tab.vue.cjs.map → Tab.vue2.js.map} +1 -1
- package/dist/martyrs/src/modules/auth/views/components/layouts/Auth.vue.cjs +2 -2
- package/dist/martyrs/src/modules/auth/views/components/layouts/Auth.vue.js +2 -2
- package/dist/martyrs/src/modules/auth/views/components/pages/EnterPassword.vue.cjs +2 -2
- package/dist/martyrs/src/modules/auth/views/components/pages/EnterPassword.vue.js +2 -2
- package/dist/martyrs/src/modules/auth/views/components/pages/Invite.vue.cjs +2 -2
- package/dist/martyrs/src/modules/auth/views/components/pages/Invite.vue.js +2 -2
- package/dist/martyrs/src/modules/auth/views/components/pages/Profile.vue.cjs +2 -2
- package/dist/martyrs/src/modules/auth/views/components/pages/Profile.vue.js +2 -2
- package/dist/martyrs/src/modules/auth/views/components/pages/ProfileBlogposts.vue.cjs +1 -1
- package/dist/martyrs/src/modules/auth/views/components/pages/ProfileBlogposts.vue.js +1 -1
- package/dist/martyrs/src/modules/auth/views/components/pages/ProfileEdit.vue.cjs +2 -2
- package/dist/martyrs/src/modules/auth/views/components/pages/ProfileEdit.vue.js +2 -2
- package/dist/martyrs/src/modules/auth/views/components/pages/ResetPassword.vue.cjs +2 -2
- package/dist/martyrs/src/modules/auth/views/components/pages/ResetPassword.vue.js +2 -2
- package/dist/martyrs/src/modules/auth/views/components/pages/SignIn.vue.cjs +2 -2
- package/dist/martyrs/src/modules/auth/views/components/pages/SignIn.vue.js +2 -2
- package/dist/martyrs/src/modules/auth/views/components/pages/SignUp.vue.cjs +2 -2
- package/dist/martyrs/src/modules/auth/views/components/pages/SignUp.vue.js +2 -2
- package/dist/martyrs/src/modules/auth/views/components/sections/ProfileEditCredentials.vue.cjs +1 -1
- package/dist/martyrs/src/modules/auth/views/components/sections/ProfileEditCredentials.vue.js +1 -1
- package/dist/martyrs/src/modules/community/components/blocks/CardBlogpost.vue.cjs +1 -1
- package/dist/martyrs/src/modules/community/components/blocks/CardBlogpost.vue.js +1 -1
- package/dist/martyrs/src/modules/community/components/pages/BlogPost.vue.cjs +3 -3
- package/dist/martyrs/src/modules/community/components/pages/BlogPost.vue.js +3 -3
- package/dist/martyrs/src/modules/community/components/pages/CreateBlogPost.vue.cjs +2 -2
- package/dist/martyrs/src/modules/community/components/pages/CreateBlogPost.vue.js +2 -2
- package/dist/martyrs/src/modules/events/components/blocks/CardEvent.vue.cjs +1 -1
- package/dist/martyrs/src/modules/events/components/blocks/CardEvent.vue.js +1 -1
- package/dist/martyrs/src/modules/events/components/elements/ButtonCheck.vue.cjs +1 -1
- package/dist/martyrs/src/modules/events/components/elements/ButtonCheck.vue.js +1 -1
- package/dist/martyrs/src/modules/events/components/elements/ButtonJoin.vue.cjs +1 -1
- package/dist/martyrs/src/modules/events/components/elements/ButtonJoin.vue.js +1 -1
- package/dist/martyrs/src/modules/events/components/pages/EditEvent.vue.cjs +2 -2
- package/dist/martyrs/src/modules/events/components/pages/EditEvent.vue.js +2 -2
- package/dist/martyrs/src/modules/events/components/pages/EditEventTickets.vue.cjs +2 -2
- package/dist/martyrs/src/modules/events/components/pages/EditEventTickets.vue.js +2 -2
- package/dist/martyrs/src/modules/events/components/pages/Event.vue.cjs +1 -1
- package/dist/martyrs/src/modules/events/components/pages/Event.vue.js +1 -1
- package/dist/martyrs/src/modules/events/components/pages/Events.vue.cjs +1 -1
- package/dist/martyrs/src/modules/events/components/pages/Events.vue.js +1 -1
- package/dist/martyrs/src/modules/events/components/pages/EventsBackoffice.vue.cjs +1 -1
- package/dist/martyrs/src/modules/events/components/pages/EventsBackoffice.vue.js +1 -1
- package/dist/martyrs/src/modules/gallery/components/pages/Gallery.vue.cjs +1 -1
- package/dist/martyrs/src/modules/gallery/components/pages/Gallery.vue.js +1 -1
- package/dist/martyrs/src/modules/gallery/components/sections/BackofficeGallery.vue.cjs +3 -3
- package/dist/martyrs/src/modules/gallery/components/sections/BackofficeGallery.vue.js +3 -3
- package/dist/martyrs/src/modules/globals/views/components/blocks/CardHeader.vue.cjs +1 -1
- package/dist/martyrs/src/modules/globals/views/components/blocks/CardHeader.vue.js +1 -1
- package/dist/martyrs/src/modules/globals/views/components/blocks/PopupDateSelector.vue.cjs +2 -2
- package/dist/martyrs/src/modules/globals/views/components/blocks/PopupDateSelector.vue.js +2 -2
- package/dist/martyrs/src/modules/globals/views/components/layouts/Client.vue.cjs +5 -4
- package/dist/martyrs/src/modules/globals/views/components/layouts/Client.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/globals/views/components/layouts/Client.vue.js +5 -4
- package/dist/martyrs/src/modules/globals/views/components/layouts/Client.vue.js.map +1 -1
- package/dist/martyrs/src/modules/globals/views/components/partials/Header.vue.cjs +1 -1
- package/dist/martyrs/src/modules/globals/views/components/partials/Header.vue.js +1 -1
- package/dist/martyrs/src/modules/globals/views/components/partials/NavigationBar.vue.cjs +1 -1
- package/dist/martyrs/src/modules/globals/views/components/partials/NavigationBar.vue.js +1 -1
- package/dist/martyrs/src/modules/globals/views/components/sections/SectionPageTitle.vue.cjs +1 -1
- package/dist/martyrs/src/modules/globals/views/components/sections/SectionPageTitle.vue.js +1 -1
- package/dist/martyrs/src/modules/landing/components/sections/SectionFeaturesImages.vue.cjs +101 -0
- package/dist/martyrs/src/modules/landing/components/sections/SectionFeaturesImages.vue.cjs.map +1 -0
- package/dist/martyrs/src/modules/landing/components/sections/SectionFeaturesImages.vue.js +101 -0
- package/dist/martyrs/src/modules/landing/components/sections/SectionFeaturesImages.vue.js.map +1 -0
- package/dist/martyrs/src/modules/landing/components/sections/SectionHeroToken.vue.cjs +85 -0
- package/dist/martyrs/src/modules/landing/components/sections/SectionHeroToken.vue.cjs.map +1 -0
- package/dist/martyrs/src/modules/landing/components/sections/SectionHeroToken.vue.js +85 -0
- package/dist/martyrs/src/modules/landing/components/sections/SectionHeroToken.vue.js.map +1 -0
- package/dist/martyrs/src/modules/landing/components/sections/SectionRoadmap.vue.cjs +97 -0
- package/dist/martyrs/src/modules/landing/components/sections/SectionRoadmap.vue.cjs.map +1 -0
- package/dist/martyrs/src/modules/landing/components/sections/SectionRoadmap.vue.js +97 -0
- package/dist/martyrs/src/modules/landing/components/sections/SectionRoadmap.vue.js.map +1 -0
- package/dist/martyrs/src/modules/landing/landing.client.cjs +6 -0
- package/dist/martyrs/src/modules/landing/landing.client.cjs.map +1 -1
- package/dist/martyrs/src/modules/landing/landing.client.js +6 -0
- package/dist/martyrs/src/modules/landing/landing.client.js.map +1 -1
- package/dist/martyrs/src/modules/notifications/components/elements/NotificationBadge.vue.cjs +4 -12
- package/dist/martyrs/src/modules/notifications/components/elements/NotificationBadge.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/notifications/components/elements/NotificationBadge.vue.js +4 -12
- package/dist/martyrs/src/modules/notifications/components/elements/NotificationBadge.vue.js.map +1 -1
- package/dist/martyrs/src/modules/notifications/notifications.client.cjs +135 -248
- package/dist/martyrs/src/modules/notifications/notifications.client.cjs.map +1 -1
- package/dist/martyrs/src/modules/notifications/notifications.client.js +135 -248
- package/dist/martyrs/src/modules/notifications/notifications.client.js.map +1 -1
- package/dist/martyrs/src/modules/orders/components/pages/OrderBackoffice.vue.cjs +2 -2
- package/dist/martyrs/src/modules/orders/components/pages/OrderBackoffice.vue.js +2 -2
- package/dist/martyrs/src/modules/orders/components/pages/OrderCreate.vue.cjs +1 -1
- package/dist/martyrs/src/modules/orders/components/pages/OrderCreate.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/orders/components/pages/OrderCreate.vue.js +1 -1
- package/dist/martyrs/src/modules/orders/components/pages/OrderCreate.vue.js.map +1 -1
- package/dist/martyrs/src/modules/orders/components/pages/OrderCreateBackoffice.vue.cjs +3 -3
- package/dist/martyrs/src/modules/orders/components/pages/OrderCreateBackoffice.vue.js +3 -3
- package/dist/martyrs/src/modules/orders/components/pages/Orders.vue.cjs +1 -1
- package/dist/martyrs/src/modules/orders/components/pages/Orders.vue.js +1 -1
- package/dist/martyrs/src/modules/orders/components/sections/FormAddCustomer.vue.cjs +1 -1
- package/dist/martyrs/src/modules/orders/components/sections/FormAddCustomer.vue.js +1 -1
- package/dist/martyrs/src/modules/organizations/components/blocks/CardOrganization.vue.cjs +1 -1
- package/dist/martyrs/src/modules/organizations/components/blocks/CardOrganization.vue.js +1 -1
- package/dist/martyrs/src/modules/organizations/components/elements/ButtonToggleMembership.vue.cjs +1 -1
- package/dist/martyrs/src/modules/organizations/components/elements/ButtonToggleMembership.vue.js +1 -1
- package/dist/martyrs/src/modules/organizations/components/pages/DepartmentEdit.vue.cjs +3 -3
- package/dist/martyrs/src/modules/organizations/components/pages/DepartmentEdit.vue.js +3 -3
- package/dist/martyrs/src/modules/organizations/components/pages/Members.vue.cjs +3 -3
- package/dist/martyrs/src/modules/organizations/components/pages/Members.vue.js +3 -3
- package/dist/martyrs/src/modules/organizations/components/pages/Organization.vue.cjs +5 -5
- package/dist/martyrs/src/modules/organizations/components/pages/Organization.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/organizations/components/pages/Organization.vue.js +5 -5
- package/dist/martyrs/src/modules/organizations/components/pages/Organization.vue.js.map +1 -1
- package/dist/martyrs/src/modules/organizations/components/pages/OrganizationBackoffice.vue.cjs +1 -1
- package/dist/martyrs/src/modules/organizations/components/pages/OrganizationBackoffice.vue.js +1 -1
- package/dist/martyrs/src/modules/organizations/components/pages/OrganizationEdit.vue.cjs +3 -3
- package/dist/martyrs/src/modules/organizations/components/pages/OrganizationEdit.vue.js +3 -3
- package/dist/martyrs/src/modules/organizations/components/pages/Organizations.vue.cjs +1 -1
- package/dist/martyrs/src/modules/organizations/components/pages/Organizations.vue.js +1 -1
- package/dist/martyrs/src/modules/organizations/components/sections/DetailsTabSection.vue.cjs +1 -1
- package/dist/martyrs/src/modules/organizations/components/sections/DetailsTabSection.vue.js +1 -1
- package/dist/martyrs/src/modules/organizations/components/sections/Documents.vue.cjs +2 -2
- package/dist/martyrs/src/modules/organizations/components/sections/Documents.vue.js +2 -2
- package/dist/martyrs/src/modules/organizations/components/sections/MembersAdd.vue.cjs +1 -1
- package/dist/martyrs/src/modules/organizations/components/sections/MembersAdd.vue.js +1 -1
- package/dist/martyrs/src/modules/organizations/components/sections/Organizations.vue.cjs +2 -2
- package/dist/martyrs/src/modules/organizations/components/sections/Organizations.vue.js +2 -2
- package/dist/martyrs/src/modules/pages/views/components/blocks/CardPage.vue.cjs +1 -1
- package/dist/martyrs/src/modules/pages/views/components/blocks/CardPage.vue.js +1 -1
- package/dist/martyrs/src/modules/pages/views/components/pages/PageEdit.vue.cjs +1 -1
- package/dist/martyrs/src/modules/pages/views/components/pages/PageEdit.vue.js +1 -1
- package/dist/martyrs/src/modules/pages/views/components/partials/SidebarPages.vue.cjs +2 -2
- package/dist/martyrs/src/modules/pages/views/components/partials/SidebarPages.vue.js +2 -2
- package/dist/martyrs/src/modules/products/components/blocks/ImagesThumbnails.vue.cjs +1 -1
- package/dist/martyrs/src/modules/products/components/blocks/ImagesThumbnails.vue.js +1 -1
- package/dist/martyrs/src/modules/products/components/pages/Categories.vue.cjs +1 -1
- package/dist/martyrs/src/modules/products/components/pages/Categories.vue.js +1 -1
- package/dist/martyrs/src/modules/products/components/pages/CategoryEdit.vue.cjs +1 -1
- package/dist/martyrs/src/modules/products/components/pages/CategoryEdit.vue.js +1 -1
- package/dist/martyrs/src/modules/products/components/pages/EditLeftover.vue.cjs +1 -1
- package/dist/martyrs/src/modules/products/components/pages/EditLeftover.vue.js +1 -1
- package/dist/martyrs/src/modules/products/components/pages/Leftovers.vue.cjs +1 -1
- package/dist/martyrs/src/modules/products/components/pages/Leftovers.vue.js +1 -1
- package/dist/martyrs/src/modules/products/components/pages/Product.vue.cjs +12 -10
- package/dist/martyrs/src/modules/products/components/pages/Product.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/products/components/pages/Product.vue.js +12 -10
- package/dist/martyrs/src/modules/products/components/pages/Product.vue.js.map +1 -1
- package/dist/martyrs/src/modules/products/components/pages/ProductEdit.vue.cjs +3 -3
- package/dist/martyrs/src/modules/products/components/pages/ProductEdit.vue.js +3 -3
- package/dist/martyrs/src/modules/products/components/pages/Products.vue.cjs +1 -1
- package/dist/martyrs/src/modules/products/components/pages/Products.vue.js +1 -1
- package/dist/martyrs/src/modules/products/components/sections/EditProductInfo.vue.cjs +1 -1
- package/dist/martyrs/src/modules/products/components/sections/EditProductInfo.vue.js +1 -1
- package/dist/martyrs/src/modules/products/components/sections/SectionProduct.vue.cjs +2 -2
- package/dist/martyrs/src/modules/products/components/sections/SectionProduct.vue.js +2 -2
- package/dist/martyrs/src/modules/rents/views/components/pages/GanttChart.vue.cjs +1 -1
- package/dist/martyrs/src/modules/rents/views/components/pages/GanttChart.vue.js +1 -1
- package/dist/martyrs/src/modules/rents/views/components/pages/Rents.vue.cjs +1 -1
- package/dist/martyrs/src/modules/rents/views/components/pages/Rents.vue.js +1 -1
- package/dist/martyrs/src/modules/rents/views/components/pages/RentsEdit.vue.cjs +1 -1
- package/dist/martyrs/src/modules/rents/views/components/pages/RentsEdit.vue.js +1 -1
- package/dist/martyrs/src/modules/reports/components/sections/FormReport.vue.cjs +2 -2
- package/dist/martyrs/src/modules/reports/components/sections/FormReport.vue.js +2 -2
- package/dist/martyrs/src/modules/spots/components/blocks/CardSpot.vue.cjs +1 -1
- package/dist/martyrs/src/modules/spots/components/blocks/CardSpot.vue.js +1 -1
- package/dist/martyrs/src/modules/spots/components/pages/Map.vue.cjs +1 -1
- package/dist/martyrs/src/modules/spots/components/pages/Map.vue.js +1 -1
- package/dist/martyrs/src/modules/spots/components/pages/SpotEdit.vue.cjs +3 -3
- package/dist/martyrs/src/modules/spots/components/pages/SpotEdit.vue.js +3 -3
- package/dist/notifications.server.js +85 -1
- package/dist/notifications.server.mjs +85 -1
- package/dist/orders.server.js +0 -27
- package/dist/orders.server.mjs +0 -27
- package/dist/style.css +101 -18
- package/package.json +1 -1
- package/src/builder/modes/ssr.dev.js +0 -20
- package/src/modules/chats/routes/chats.routes.js +19 -19
- package/src/modules/globals/controllers/utils/queryProcessor.js +1 -1
- package/src/modules/globals/views/components/layouts/Client.vue +6 -6
- package/src/modules/landing/components/sections/SectionHeroToken.vue +1 -1
- package/src/modules/landing/landing.client.js +7 -0
- package/src/modules/notifications/components/elements/NotificationBadge.vue +4 -13
- package/src/modules/notifications/notifications.client.js +166 -350
- package/src/modules/notifications/services/notification.service.js +4 -3
- package/src/modules/notifications/services/websocket.service.js +54 -56
- package/src/modules/orders/components/pages/OrderCreate.vue +1 -1
- package/src/modules/orders/controllers/orders.controller.js +1 -2
- package/src/modules/organizations/components/pages/Organization.vue +3 -3
- package/src/modules/products/components/pages/Product.vue +10 -9
- package/dist/martyrs/src/components/Button/Button.vue.js.map +0 -1
- package/dist/martyrs/src/components/Chips/Chips.vue.cjs.map +0 -1
- package/dist/martyrs/src/components/Chips/Chips.vue.js.map +0 -1
- package/dist/martyrs/src/components/Menu/Menu.vue2.cjs.map +0 -1
- package/dist/martyrs/src/components/Menu/Menu.vue2.js.map +0 -1
- package/dist/martyrs/src/components/Popup/Popup.vue2.cjs.map +0 -1
- package/dist/martyrs/src/components/Tab/Tab.vue.js.map +0 -1
|
@@ -9,230 +9,125 @@ import NotificationPreferences from "./components/sections/NotificationPreferenc
|
|
|
9
9
|
import Notifications from "./components/pages/Notifications.vue.js";
|
|
10
10
|
import NotificationBadge from "./components/elements/NotificationBadge.vue.js";
|
|
11
11
|
import NotificationItem from "./components/blocks/NotificationItem.vue.js";
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
this.options = options;
|
|
16
|
-
this.moduleName = "notifications";
|
|
17
|
-
this.listeners = [];
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Connect to notifications channel
|
|
21
|
-
*/
|
|
22
|
-
connect(userId) {
|
|
23
|
-
if (typeof window === "undefined" || !userId) {
|
|
24
|
-
return Promise.resolve(false);
|
|
25
|
-
}
|
|
12
|
+
const wsNotificationHandlers = {
|
|
13
|
+
connect: (store, userId, options = {}) => {
|
|
14
|
+
if (typeof window === "undefined" || !userId) return Promise.resolve(false);
|
|
26
15
|
return globalWebSocket.connect(userId).then(() => {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
);
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* Process incoming notification
|
|
54
|
-
*/
|
|
55
|
-
_processNotification(data) {
|
|
56
|
-
if (!data || !data.data) return;
|
|
57
|
-
const notification = data.data;
|
|
58
|
-
this.store.notifications.actions.addLocalNotification({
|
|
59
|
-
_id: notification._id,
|
|
60
|
-
title: notification.title,
|
|
61
|
-
body: notification.body,
|
|
62
|
-
type: notification.type || "info",
|
|
63
|
-
metadata: notification.metadata || {},
|
|
64
|
-
status: "unread",
|
|
65
|
-
createdAt: notification.createdAt || (/* @__PURE__ */ new Date()).toISOString(),
|
|
66
|
-
updatedAt: notification.updatedAt || (/* @__PURE__ */ new Date()).toISOString()
|
|
16
|
+
const moduleName = "notifications";
|
|
17
|
+
const listeners = [];
|
|
18
|
+
const addListener = (event, handler) => {
|
|
19
|
+
listeners.push(globalWebSocket.addEventListener(event, handler, { module: moduleName }));
|
|
20
|
+
};
|
|
21
|
+
addListener("notification", (data) => {
|
|
22
|
+
if (!data || !data.data) return;
|
|
23
|
+
const notification = data.data;
|
|
24
|
+
store.notifications.actions.addLocalNotification({
|
|
25
|
+
_id: notification._id,
|
|
26
|
+
title: notification.title,
|
|
27
|
+
body: notification.body,
|
|
28
|
+
type: notification.type || "info",
|
|
29
|
+
metadata: notification.metadata || {},
|
|
30
|
+
status: "unread",
|
|
31
|
+
createdAt: notification.createdAt || (/* @__PURE__ */ new Date()).toISOString(),
|
|
32
|
+
updatedAt: notification.updatedAt || (/* @__PURE__ */ new Date()).toISOString()
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
addListener("notification_read", (data) => {
|
|
36
|
+
store.notifications.actions.syncNotificationStatus(data.notificationId, "read");
|
|
37
|
+
});
|
|
38
|
+
return { listeners, moduleName };
|
|
67
39
|
});
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
this.store = store;
|
|
73
|
-
this.pushNotifications = null;
|
|
74
|
-
this.device = null;
|
|
75
|
-
this.isInitialized = false;
|
|
76
|
-
}
|
|
77
|
-
/**
|
|
78
|
-
* Initialize Capacitor plugins
|
|
79
|
-
*/
|
|
80
|
-
async initialize() {
|
|
81
|
-
if (typeof window === "undefined") {
|
|
82
|
-
return false;
|
|
40
|
+
},
|
|
41
|
+
disconnect: (moduleName, listeners) => {
|
|
42
|
+
if (listeners) {
|
|
43
|
+
globalWebSocket.removeModuleListeners(moduleName);
|
|
83
44
|
}
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
const pushNotificationHandlers = {
|
|
48
|
+
initialize: async () => {
|
|
49
|
+
if (typeof window === "undefined") return false;
|
|
84
50
|
try {
|
|
85
51
|
const { Capacitor } = await import("../../../node_modules/@capacitor/core/dist/index.js");
|
|
86
52
|
const { PushNotifications } = await import("../../../../node_modules/@capacitor/push-notifications/dist/esm/index.js");
|
|
87
53
|
const { Device } = await import("../../../../node_modules/@capacitor/device/dist/esm/index.js");
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
this.device = Device;
|
|
91
|
-
if (!this.capacitor.isNativePlatform()) {
|
|
92
|
-
return false;
|
|
93
|
-
}
|
|
94
|
-
this.isInitialized = true;
|
|
95
|
-
return true;
|
|
54
|
+
if (!Capacitor.isNativePlatform()) return false;
|
|
55
|
+
return { pushNotifications: PushNotifications, device: Device };
|
|
96
56
|
} catch (error) {
|
|
97
57
|
console.error("Error importing Capacitor plugins:", error);
|
|
98
58
|
return false;
|
|
99
59
|
}
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
const initialized = await this.initialize();
|
|
110
|
-
if (!initialized) return false;
|
|
111
|
-
}
|
|
112
|
-
try {
|
|
113
|
-
const permissionResult = await this.pushNotifications.requestPermissions();
|
|
114
|
-
if (permissionResult.receive !== "granted") {
|
|
115
|
-
console.log("Push notification permission denied");
|
|
116
|
-
return false;
|
|
117
|
-
}
|
|
118
|
-
this._setupListeners();
|
|
119
|
-
await this.pushNotifications.register();
|
|
120
|
-
return true;
|
|
121
|
-
} catch (error) {
|
|
122
|
-
console.error("Error requesting push notification permissions:", error);
|
|
60
|
+
},
|
|
61
|
+
requestPermissions: async (store) => {
|
|
62
|
+
if (typeof window === "undefined") return false;
|
|
63
|
+
const plugins = await pushNotificationHandlers.initialize();
|
|
64
|
+
if (!plugins) return false;
|
|
65
|
+
const { pushNotifications, device } = plugins;
|
|
66
|
+
const permissionResult = await pushNotifications.requestPermissions();
|
|
67
|
+
if (permissionResult.receive !== "granted") {
|
|
68
|
+
console.log("Push notification permission denied");
|
|
123
69
|
return false;
|
|
124
70
|
}
|
|
71
|
+
const setupListeners = () => {
|
|
72
|
+
pushNotifications.addListener("registration", async (token) => {
|
|
73
|
+
try {
|
|
74
|
+
const deviceInfo = await device.getInfo();
|
|
75
|
+
const deviceId = await device.getId();
|
|
76
|
+
const deviceData = {
|
|
77
|
+
deviceId: deviceId.uuid,
|
|
78
|
+
deviceType: deviceInfo.platform.toLowerCase(),
|
|
79
|
+
deviceToken: token.value
|
|
80
|
+
};
|
|
81
|
+
await store.notifications.actions.registerDevice(deviceData);
|
|
82
|
+
} catch (error) {
|
|
83
|
+
console.error("Error handling push registration:", error);
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
pushNotifications.addListener("pushNotificationReceived", (notification) => {
|
|
87
|
+
store.notifications.actions.addLocalNotification({
|
|
88
|
+
title: notification.title,
|
|
89
|
+
body: notification.body,
|
|
90
|
+
data: notification.data || {}
|
|
91
|
+
});
|
|
92
|
+
});
|
|
93
|
+
pushNotifications.addListener("pushNotificationActionPerformed", (actionData) => {
|
|
94
|
+
if (actionData.notification && actionData.notification.data) {
|
|
95
|
+
store.notifications.actions.handleNotificationAction(actionData.notification.data);
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
};
|
|
99
|
+
setupListeners();
|
|
100
|
+
await pushNotifications.register();
|
|
101
|
+
return true;
|
|
102
|
+
},
|
|
103
|
+
removeListeners: (pushNotifications) => {
|
|
104
|
+
if (typeof window === "undefined" || !pushNotifications) return;
|
|
105
|
+
pushNotifications.removeAllListeners();
|
|
125
106
|
}
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
_setupListeners() {
|
|
130
|
-
this.pushNotifications.addListener(
|
|
131
|
-
"registration",
|
|
132
|
-
this._handleRegistration.bind(this)
|
|
133
|
-
);
|
|
134
|
-
this.pushNotifications.addListener(
|
|
135
|
-
"pushNotificationReceived",
|
|
136
|
-
this._handleNotificationReceived.bind(this)
|
|
137
|
-
);
|
|
138
|
-
this.pushNotifications.addListener(
|
|
139
|
-
"pushNotificationActionPerformed",
|
|
140
|
-
this._handleNotificationAction.bind(this)
|
|
141
|
-
);
|
|
142
|
-
}
|
|
143
|
-
/**
|
|
144
|
-
* Handle registration token received
|
|
145
|
-
*/
|
|
146
|
-
async _handleRegistration(token) {
|
|
147
|
-
try {
|
|
148
|
-
const deviceInfo = await this.device.getInfo();
|
|
149
|
-
const deviceId = await this.device.getId();
|
|
150
|
-
const deviceData = {
|
|
151
|
-
deviceId: deviceId.uuid,
|
|
152
|
-
deviceType: deviceInfo.platform.toLowerCase(),
|
|
153
|
-
deviceToken: token.value
|
|
154
|
-
};
|
|
155
|
-
await this.store.notifications.actions.registerDevice(deviceData);
|
|
156
|
-
} catch (error) {
|
|
157
|
-
console.error("Error handling push registration:", error);
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
/**
|
|
161
|
-
* Handle received notification
|
|
162
|
-
*/
|
|
163
|
-
_handleNotificationReceived(notification) {
|
|
164
|
-
this.store.notifications.actions.addLocalNotification({
|
|
165
|
-
title: notification.title,
|
|
166
|
-
body: notification.body,
|
|
167
|
-
data: notification.data || {}
|
|
168
|
-
});
|
|
169
|
-
}
|
|
170
|
-
/**
|
|
171
|
-
* Handle notification action (when user taps on notification)
|
|
172
|
-
*/
|
|
173
|
-
_handleNotificationAction(actionData) {
|
|
174
|
-
if (actionData.notification && actionData.notification.data) {
|
|
175
|
-
this.store.notifications.actions.handleNotificationAction(
|
|
176
|
-
actionData.notification.data
|
|
177
|
-
);
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
/**
|
|
181
|
-
* Remove push notification listeners
|
|
182
|
-
*/
|
|
183
|
-
removeListeners() {
|
|
184
|
-
if (typeof window === "undefined") {
|
|
185
|
-
return;
|
|
186
|
-
}
|
|
187
|
-
if (this.pushNotifications) {
|
|
188
|
-
this.pushNotifications.removeAllListeners();
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
class NotificationManager {
|
|
193
|
-
constructor(store, options = {}) {
|
|
194
|
-
this.store = store;
|
|
195
|
-
this.options = options;
|
|
196
|
-
this.wsHandler = new WebSocketNotificationHandler(store, options);
|
|
197
|
-
this.pushHandler = new CapacitorPushHandler(store);
|
|
198
|
-
this.initialized = false;
|
|
199
|
-
this.isServer = typeof window === "undefined";
|
|
200
|
-
}
|
|
201
|
-
/**
|
|
202
|
-
* Initialize notifications
|
|
203
|
-
*/
|
|
204
|
-
async initialize() {
|
|
107
|
+
};
|
|
108
|
+
const notificationUtils = {
|
|
109
|
+
initialize: async (store, options = {}) => {
|
|
205
110
|
var _a;
|
|
206
|
-
if (
|
|
207
|
-
const userId = (_a =
|
|
111
|
+
if (typeof window === "undefined") return;
|
|
112
|
+
const userId = (_a = store.auth.state.user) == null ? void 0 : _a._id;
|
|
208
113
|
if (!userId) {
|
|
209
114
|
console.warn("Cannot initialize notifications: No user ID found in auth store");
|
|
210
115
|
return;
|
|
211
116
|
}
|
|
212
|
-
|
|
213
|
-
if (
|
|
214
|
-
await
|
|
117
|
+
let wsListeners = null;
|
|
118
|
+
if (options.enablePush !== false) {
|
|
119
|
+
await pushNotificationHandlers.requestPermissions(store);
|
|
215
120
|
}
|
|
216
|
-
|
|
217
|
-
await
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
this.initialized = false;
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
const SSRUtils = {
|
|
230
|
-
/**
|
|
231
|
-
* Pre-fetch notifications for SSR
|
|
232
|
-
* @param {Object} store - Store instance
|
|
233
|
-
* @param {Object} context - SSR context
|
|
234
|
-
*/
|
|
235
|
-
async prefetchNotifications(store, context) {
|
|
121
|
+
wsListeners = await wsNotificationHandlers.connect(store, userId, options);
|
|
122
|
+
await store.notifications.actions.getNotifications(userId);
|
|
123
|
+
return {
|
|
124
|
+
disconnect: () => {
|
|
125
|
+
wsNotificationHandlers.disconnect(wsListeners == null ? void 0 : wsListeners.moduleName, wsListeners == null ? void 0 : wsListeners.listeners);
|
|
126
|
+
pushNotificationHandlers.removeListeners(globalThis.pushNotifications);
|
|
127
|
+
}
|
|
128
|
+
};
|
|
129
|
+
},
|
|
130
|
+
prefetchForSSR: async (store, context) => {
|
|
236
131
|
var _a;
|
|
237
132
|
try {
|
|
238
133
|
const userId = (_a = store.auth.state.user) == null ? void 0 : _a._id;
|
|
@@ -244,72 +139,64 @@ const SSRUtils = {
|
|
|
244
139
|
}
|
|
245
140
|
}
|
|
246
141
|
};
|
|
247
|
-
|
|
248
|
-
var _a;
|
|
142
|
+
const initializeNotifications = (app, store, router, options = {}) => {
|
|
249
143
|
const route = options.route || "User Profile Root";
|
|
250
144
|
router.addRoute(route, nofitications);
|
|
251
145
|
store.addStore("notifications", notifications_store);
|
|
252
146
|
if (options.wsUrl) {
|
|
253
147
|
globalWebSocket.initialize({ wsUrl: options.wsUrl });
|
|
254
148
|
}
|
|
255
|
-
const notificationManager = new NotificationManager(store, {
|
|
256
|
-
enablePush: options.enablePush !== false,
|
|
257
|
-
maxReconnectAttempts: options.maxReconnectAttempts || 5,
|
|
258
|
-
reconnectDelay: options.reconnectDelay || 3e3,
|
|
259
|
-
pingInterval: options.pingInterval || 3e4
|
|
260
|
-
});
|
|
261
|
-
store.notificationManager = notificationManager;
|
|
262
149
|
const isServer = typeof window === "undefined";
|
|
263
150
|
const autoInit = !isServer && options.autoInit !== false;
|
|
151
|
+
let notificationManager = null;
|
|
264
152
|
if (autoInit) {
|
|
265
|
-
const
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
153
|
+
const initNotifications = async () => {
|
|
154
|
+
var _a;
|
|
155
|
+
if (store.auth.state.isAuthenticated && ((_a = store.auth.state.user) == null ? void 0 : _a._id)) {
|
|
156
|
+
notificationManager = await notificationUtils.initialize(store, {
|
|
157
|
+
enablePush: options.enablePush !== false,
|
|
158
|
+
maxReconnectAttempts: options.maxReconnectAttempts || 5,
|
|
159
|
+
reconnectDelay: options.reconnectDelay || 3e3,
|
|
160
|
+
pingInterval: options.pingInterval || 3e4
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
};
|
|
164
|
+
watch(() => store.auth.state.isAuthenticated, (isAuthenticated) => {
|
|
165
|
+
if (isAuthenticated) {
|
|
166
|
+
initNotifications();
|
|
167
|
+
} else if (notificationManager) {
|
|
274
168
|
notificationManager.disconnect();
|
|
275
169
|
store.notifications.mutations.resetNotifications();
|
|
170
|
+
notificationManager = null;
|
|
276
171
|
}
|
|
277
172
|
});
|
|
173
|
+
if (store.auth.state.isAuthenticated) {
|
|
174
|
+
initNotifications();
|
|
175
|
+
}
|
|
278
176
|
}
|
|
279
|
-
app.provide("useNotifications", () => {
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
}
|
|
177
|
+
app.provide("useNotifications", () => ({
|
|
178
|
+
...toRefs(store.notifications.state),
|
|
179
|
+
...store.notifications.actions,
|
|
180
|
+
...store.notifications.mutations,
|
|
181
|
+
init: () => notificationUtils.initialize(store, options),
|
|
182
|
+
disconnect: () => notificationManager == null ? void 0 : notificationManager.disconnect(),
|
|
183
|
+
isServer
|
|
184
|
+
}));
|
|
185
|
+
return {
|
|
186
|
+
SSR: { prefetchNotifications: notificationUtils.prefetchForSSR }
|
|
187
|
+
};
|
|
188
|
+
};
|
|
291
189
|
const ModuleNotifications = {
|
|
292
190
|
initialize: initializeNotifications,
|
|
293
|
-
SSR: SSRUtils,
|
|
294
|
-
// Export SSR utilities
|
|
295
191
|
views: {
|
|
296
|
-
store: {
|
|
297
|
-
|
|
298
|
-
},
|
|
299
|
-
router: {
|
|
300
|
-
routerNotifications: nofitications
|
|
301
|
-
},
|
|
192
|
+
store: { storeNotifications: notifications_store },
|
|
193
|
+
router: { routerNotifications: nofitications },
|
|
302
194
|
components: {
|
|
303
|
-
// Elements
|
|
304
195
|
NotificationBadge,
|
|
305
|
-
// Blocks
|
|
306
196
|
NotificationItem,
|
|
307
|
-
// Sections
|
|
308
197
|
NotificationsList,
|
|
309
198
|
NotificationPreferences,
|
|
310
|
-
// Pages
|
|
311
199
|
Notifications,
|
|
312
|
-
// Layouts
|
|
313
200
|
NotificationsLayout
|
|
314
201
|
}
|
|
315
202
|
}
|
|
@@ -321,7 +208,7 @@ export {
|
|
|
321
208
|
Notifications,
|
|
322
209
|
NotificationsLayout,
|
|
323
210
|
NotificationsList,
|
|
324
|
-
SSRUtils,
|
|
211
|
+
notificationUtils as SSRUtils,
|
|
325
212
|
ModuleNotifications as default
|
|
326
213
|
};
|
|
327
214
|
//# sourceMappingURL=notifications.client.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notifications.client.js","sources":["../../../../../src/modules/notifications/notifications.client.js"],"sourcesContent":["import { watch, toRefs } from \"vue\";\n// Router import \nimport routerNotifications from './router/notifications.router.js'; \n// Store \nimport * as storeNotifications from './store/notifications.store.js'; \n// Auth store import\nimport * as auth from '@martyrs/src/modules/auth/views/store/auth';\n// Global WebSocket import\nimport globalWebSocket from '@martyrs/src/modules/globals/views/classes/globals.websocket.js';\n// Layouts \nimport NotificationsLayout from './components/layouts/NotificationsLayout.vue'; \n// Sections \nimport NotificationsList from './components/sections/NotificationsList.vue'; \nimport NotificationPreferences from './components/sections/NotificationPreferences.vue'; \n// Pages \nimport Notifications from './components/pages/Notifications.vue'; \n// Components \nimport NotificationBadge from './components/elements/NotificationBadge.vue'; \nimport NotificationItem from './components/blocks/NotificationItem.vue'; \n\n/**\n * WebSocket notification handler that uses the global WebSocket connection\n */\nclass WebSocketNotificationHandler {\n constructor(store, options = {}) {\n this.store = store;\n this.options = options;\n this.moduleName = 'notifications';\n this.listeners = [];\n }\n\n /**\n * Connect to notifications channel\n */\n connect(userId) {\n // Skip if running in SSR\n if (typeof window === 'undefined' || !userId) {\n return Promise.resolve(false);\n }\n\n // First ensure the global WebSocket is connected\n return globalWebSocket.connect(userId).then(() => {\n // Register event listeners\n this._registerListeners();\n return true;\n });\n }\n\n /**\n * Disconnect notification listeners\n */\n disconnect() {\n globalWebSocket.removeModuleListeners(this.moduleName);\n }\n\n /**\n * Register notification event listeners\n */\n _registerListeners() {\n // Listen for notification events\n this.listeners.push(\n globalWebSocket.addEventListener('notification', this._processNotification.bind(this), {\n module: this.moduleName\n })\n );\n \n // Listen for notification read status changes\n this.listeners.push(\n globalWebSocket.addEventListener('notification_read', (data) => {\n this.store.notifications.actions.syncNotificationStatus(data.notificationId, 'read');\n }, { module: this.moduleName })\n );\n }\n\n /**\n * Process incoming notification\n */\n _processNotification(data) {\n if (!data || !data.data) return;\n \n const notification = data.data;\n \n // Add notification to store\n this.store.notifications.actions.addLocalNotification({\n _id: notification._id,\n title: notification.title,\n body: notification.body,\n type: notification.type || 'info',\n metadata: notification.metadata || {},\n status: 'unread',\n createdAt: notification.createdAt || new Date().toISOString(),\n updatedAt: notification.updatedAt || new Date().toISOString()\n });\n }\n}\n\n/**\n * Capacitor Push Notification handler\n */\nclass CapacitorPushHandler {\n constructor(store) {\n this.store = store;\n this.pushNotifications = null;\n this.device = null;\n this.isInitialized = false;\n }\n\n /**\n * Initialize Capacitor plugins\n */\n async initialize() {\n // Skip if running in SSR\n if (typeof window === 'undefined') {\n return false;\n }\n\n try {\n // Dynamic imports to prevent errors in web environment\n const { Capacitor } = await import('@capacitor/core');\n const { PushNotifications } = await import('@capacitor/push-notifications');\n const { Device } = await import('@capacitor/device');\n \n this.capacitor = Capacitor;\n this.pushNotifications = PushNotifications;\n this.device = Device;\n \n // Only proceed if running on a native platform\n if (!this.capacitor.isNativePlatform()) {\n return false;\n }\n \n this.isInitialized = true;\n return true;\n } catch (error) {\n console.error('Error importing Capacitor plugins:', error);\n return false;\n }\n }\n\n /**\n * Request permission and register for push notifications\n */\n async requestPermissions() {\n // Skip if running in SSR\n if (typeof window === 'undefined') {\n return false;\n }\n\n if (!this.isInitialized) {\n const initialized = await this.initialize();\n if (!initialized) return false;\n }\n\n try {\n // Request permission\n const permissionResult = await this.pushNotifications.requestPermissions();\n if (permissionResult.receive !== 'granted') {\n console.log('Push notification permission denied');\n return false;\n }\n \n // Set up event listeners\n this._setupListeners();\n \n // Register with Apple/Google\n await this.pushNotifications.register();\n return true;\n } catch (error) {\n console.error('Error requesting push notification permissions:', error);\n return false;\n }\n }\n\n /**\n * Setup push notification event listeners\n */\n _setupListeners() {\n // Registration event\n this.pushNotifications.addListener('registration', \n this._handleRegistration.bind(this)\n );\n \n // Notification received event\n this.pushNotifications.addListener('pushNotificationReceived',\n this._handleNotificationReceived.bind(this)\n );\n \n // Notification action performed event\n this.pushNotifications.addListener('pushNotificationActionPerformed',\n this._handleNotificationAction.bind(this)\n );\n }\n\n /**\n * Handle registration token received\n */\n async _handleRegistration(token) {\n try {\n // Get device info\n const deviceInfo = await this.device.getInfo();\n const deviceId = await this.device.getId();\n \n // Prepare device data\n const deviceData = {\n deviceId: deviceId.uuid,\n deviceType: deviceInfo.platform.toLowerCase(),\n deviceToken: token.value\n };\n \n // Register device with backend\n await this.store.notifications.actions.registerDevice(deviceData);\n } catch (error) {\n console.error('Error handling push registration:', error);\n }\n }\n\n /**\n * Handle received notification\n */\n _handleNotificationReceived(notification) {\n // Add notification to store\n this.store.notifications.actions.addLocalNotification({\n title: notification.title,\n body: notification.body,\n data: notification.data || {}\n });\n }\n\n /**\n * Handle notification action (when user taps on notification)\n */\n _handleNotificationAction(actionData) {\n if (actionData.notification && actionData.notification.data) {\n this.store.notifications.actions.handleNotificationAction(\n actionData.notification.data\n );\n }\n }\n\n /**\n * Remove push notification listeners\n */\n removeListeners() {\n if (typeof window === 'undefined') {\n return;\n }\n \n if (this.pushNotifications) {\n this.pushNotifications.removeAllListeners();\n }\n }\n}\n\n/**\n * Notification Manager for coordinating WebSocket and Push notifications\n */\nclass NotificationManager {\n constructor(store, options = {}) {\n this.store = store;\n this.options = options;\n this.wsHandler = new WebSocketNotificationHandler(store, options);\n this.pushHandler = new CapacitorPushHandler(store);\n this.initialized = false;\n this.isServer = typeof window === 'undefined';\n }\n\n /**\n * Initialize notifications\n */\n async initialize() {\n if (this.initialized || this.isServer) return;\n \n // Get current user ID from auth store instead of localStorage\n const userId = this.store.auth.state.user?._id;\n if (!userId) {\n console.warn('Cannot initialize notifications: No user ID found in auth store');\n return;\n }\n \n // Initialize WebSocket for realtime notifications\n await this.wsHandler.connect(userId);\n \n // Initialize push notifications for mobile if enabled\n if (this.options.enablePush !== false) {\n await this.pushHandler.requestPermissions();\n }\n \n this.initialized = true;\n \n // Fetch existing notifications\n await this.store.notifications.actions.getNotifications(userId);\n }\n\n /**\n * Disconnect and clean up\n */\n disconnect() {\n if (this.isServer) return;\n \n this.wsHandler.disconnect();\n this.pushHandler.removeListeners();\n this.initialized = false;\n }\n}\n\n/**\n * Server-side utility for pre-fetching notification data\n */\nconst SSRUtils = {\n /**\n * Pre-fetch notifications for SSR\n * @param {Object} store - Store instance\n * @param {Object} context - SSR context\n */\n async prefetchNotifications(store, context) {\n try {\n const userId = store.auth.state.user?._id;\n if (userId) {\n // Fetch notifications without WebSocket or push setup\n await store.notifications.actions.getNotifications(userId);\n }\n } catch (error) {\n console.error('Error pre-fetching notifications for SSR:', error);\n }\n }\n};\n\n/**\n * Function to initialize the notifications module\n * @param {Object} app - Vue app instance\n * @param {Object} store - Vuex/Pinia store\n * @param {Object} router - Vue Router instance\n * @param {Object} options - Configuration options\n */\nfunction initializeNotifications(app, store, router, options = {}) {\n // Add routes and store\n const route = options.route || 'User Profile Root';\n router.addRoute(route, routerNotifications);\n store.addStore('notifications', storeNotifications);\n \n // Initialize global WebSocket if needed\n if (options.wsUrl) {\n globalWebSocket.initialize({ wsUrl: options.wsUrl });\n }\n \n // Create notification manager\n const notificationManager = new NotificationManager(store, {\n enablePush: options.enablePush !== false,\n maxReconnectAttempts: options.maxReconnectAttempts || 5,\n reconnectDelay: options.reconnectDelay || 3000,\n pingInterval: options.pingInterval || 30000\n });\n \n // Attach notification manager to store for access in components\n store.notificationManager = notificationManager;\n \n // Don't auto-initialize on server\n const isServer = typeof window === 'undefined';\n const autoInit = !isServer && options.autoInit !== false;\n \n if (autoInit) {\n // Initialize after auth is confirmed\n const isAuthenticated = store.auth.state.isAuthenticated;\n const userId = store.auth.state.user?._id;\n \n if (isAuthenticated && userId) {\n notificationManager.initialize();\n }\n \n // Watch for user login/logout using auth store\n watch(() => store.auth.state.isAuthenticated, (isAuthenticated) => {\n if (isAuthenticated) {\n notificationManager.initialize();\n } else {\n notificationManager.disconnect();\n store.notifications.mutations.resetNotifications();\n }\n });\n }\n \n // Provide composable for components to access notification functionality\n app.provide('useNotifications', () => {\n return {\n ...toRefs(store.notifications.state),\n ...store.notifications.actions,\n ...store.notifications.mutations,\n init: notificationManager.initialize.bind(notificationManager),\n disconnect: notificationManager.disconnect.bind(notificationManager),\n isServer\n };\n });\n \n return notificationManager;\n}\n\n// Module export\nconst ModuleNotifications = {\n initialize: initializeNotifications,\n SSR: SSRUtils, // Export SSR utilities\n views: {\n store: {\n storeNotifications,\n },\n router: {\n routerNotifications\n },\n components: {\n // Elements\n NotificationBadge,\n // Blocks\n NotificationItem,\n // Sections\n NotificationsList,\n NotificationPreferences,\n // Pages\n Notifications,\n // Layouts\n NotificationsLayout\n }\n }\n};\n\n// Component exports\nexport {\n // Elements\n NotificationBadge,\n // Blocks\n NotificationItem,\n // Sections\n NotificationsList,\n NotificationPreferences,\n // Pages\n Notifications,\n // Layouts\n NotificationsLayout,\n // SSR Utilities\n SSRUtils\n};\n\nexport default ModuleNotifications;"],"names":["routerNotifications","storeNotifications","isAuthenticated"],"mappings":";;;;;;;;;;;AAuBA,MAAM,6BAA6B;AAAA,EACjC,YAAY,OAAO,UAAU,IAAI;AAC/B,SAAK,QAAQ;AACb,SAAK,UAAU;AACf,SAAK,aAAa;AAClB,SAAK,YAAY,CAAE;AAAA,EACvB;AAAA;AAAA;AAAA;AAAA,EAKE,QAAQ,QAAQ;AAEd,QAAI,OAAO,WAAW,eAAe,CAAC,QAAQ;AAC5C,aAAO,QAAQ,QAAQ,KAAK;AAAA,IAClC;AAGI,WAAO,gBAAgB,QAAQ,MAAM,EAAE,KAAK,MAAM;AAEhD,WAAK,mBAAoB;AACzB,aAAO;AAAA,IACb,CAAK;AAAA,EACL;AAAA;AAAA;AAAA;AAAA,EAKE,aAAa;AACX,oBAAgB,sBAAsB,KAAK,UAAU;AAAA,EACzD;AAAA;AAAA;AAAA;AAAA,EAKE,qBAAqB;AAEnB,SAAK,UAAU;AAAA,MACb,gBAAgB,iBAAiB,gBAAgB,KAAK,qBAAqB,KAAK,IAAI,GAAG;AAAA,QACrF,QAAQ,KAAK;AAAA,MACd,C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AK,MAAM,iBAAiB,CAACC,qBAAoB;AACjE,UAAIA,kBAAiB;AACnB,4BAAoB,WAAY;AAAA,MACxC,OAAa;AACL,4BAAoB,WAAY;AAChC,cAAM,cAAc,UAAU,mBAAoB;AAAA,MAC1D;AAAA,IACA,CAAK;AAAA,EACL;AAGE,MAAI,QAAQ,oBAAoB,MAAM;AACpC,WAAO;AAAA,MACL,GAAG,OAAO,MAAM,cAAc,KAAK;AAAA,MACnC,GAAG,MAAM,cAAc;AAAA,MACvB,GAAG,MAAM,cAAc;AAAA,MACvB,MAAM,oBAAoB,WAAW,KAAK,mBAAmB;AAAA,MAC7D,YAAY,oBAAoB,WAAW,KAAK,mBAAmB;AAAA,MACnE;AAAA,IACD;AAAA,EACL,CAAG;AAED,SAAO;AACT;AAGK,MAAC,sBAAsB;AAAA,EAC1B,YAAY;AAAA,EACZ,KAAK;AAAA;AAAA,EACL,OAAO;AAAA,IACL,OAAO;AAAA,MACX,oBAAMD;AAAAA,IACD;AAAA,IACD,QAAQ;AAAA,MACND,qBAAAA;AAAAA,IACD;AAAA,IACD,YAAY;AAAA;AAAA,MAEV;AAAA;AAAA,MAEA;AAAA;AAAA,MAEA;AAAA,MACA;AAAA;AAAA,MAEA;AAAA;AAAA,MAEA;AAAA,IACN;AAAA,EACA;AACA;"}
|
|
1
|
+
{"version":3,"file":"notifications.client.js","sources":["../../../../../src/modules/notifications/notifications.client.js"],"sourcesContent":["import { watch, toRefs } from \"vue\";\nimport routerNotifications from './router/notifications.router.js';\nimport * as storeNotifications from './store/notifications.store.js';\nimport * as auth from '@martyrs/src/modules/auth/views/store/auth';\nimport globalWebSocket from '@martyrs/src/modules/globals/views/classes/globals.websocket.js';\nimport NotificationsLayout from './components/layouts/NotificationsLayout.vue';\nimport NotificationsList from './components/sections/NotificationsList.vue';\nimport NotificationPreferences from './components/sections/NotificationPreferences.vue';\nimport Notifications from './components/pages/Notifications.vue';\nimport NotificationBadge from './components/elements/NotificationBadge.vue';\nimport NotificationItem from './components/blocks/NotificationItem.vue';\n\n// WebSocket notification handlers\nconst wsNotificationHandlers = {\n connect: (store, userId, options = {}) => {\n if (typeof window === 'undefined' || !userId) return Promise.resolve(false);\n \n return globalWebSocket.connect(userId).then(() => {\n const moduleName = 'notifications';\n const listeners = [];\n\n const addListener = (event, handler) => {\n listeners.push(globalWebSocket.addEventListener(event, handler, { module: moduleName }));\n };\n\n addListener('notification', (data) => {\n if (!data || !data.data) return;\n const notification = data.data;\n \n store.notifications.actions.addLocalNotification({\n _id: notification._id,\n title: notification.title,\n body: notification.body,\n type: notification.type || 'info',\n metadata: notification.metadata || {},\n status: 'unread',\n createdAt: notification.createdAt || new Date().toISOString(),\n updatedAt: notification.updatedAt || new Date().toISOString()\n });\n });\n\n addListener('notification_read', (data) => {\n store.notifications.actions.syncNotificationStatus(data.notificationId, 'read');\n });\n\n return { listeners, moduleName };\n });\n },\n\n disconnect: (moduleName, listeners) => {\n if (listeners) {\n globalWebSocket.removeModuleListeners(moduleName);\n }\n }\n};\n\n// Capacitor Push Notification handlers\nconst pushNotificationHandlers = {\n initialize: async () => {\n if (typeof window === 'undefined') return false;\n\n try {\n const { Capacitor } = await import('@capacitor/core');\n const { PushNotifications } = await import('@capacitor/push-notifications');\n const { Device } = await import('@capacitor/device');\n\n if (!Capacitor.isNativePlatform()) return false;\n\n return { pushNotifications: PushNotifications, device: Device };\n } catch (error) {\n console.error('Error importing Capacitor plugins:', error);\n return false;\n }\n },\n\n requestPermissions: async (store) => {\n if (typeof window === 'undefined') return false;\n\n const plugins = await pushNotificationHandlers.initialize();\n if (!plugins) return false;\n\n const { pushNotifications, device } = plugins;\n\n const permissionResult = await pushNotifications.requestPermissions();\n if (permissionResult.receive !== 'granted') {\n console.log('Push notification permission denied');\n return false;\n }\n\n const setupListeners = () => {\n pushNotifications.addListener('registration', async (token) => {\n try {\n const deviceInfo = await device.getInfo();\n const deviceId = await device.getId();\n\n const deviceData = {\n deviceId: deviceId.uuid,\n deviceType: deviceInfo.platform.toLowerCase(),\n deviceToken: token.value\n };\n\n await store.notifications.actions.registerDevice(deviceData);\n } catch (error) {\n console.error('Error handling push registration:', error);\n }\n });\n\n pushNotifications.addListener('pushNotificationReceived', (notification) => {\n store.notifications.actions.addLocalNotification({\n title: notification.title,\n body: notification.body,\n data: notification.data || {}\n });\n });\n\n pushNotifications.addListener('pushNotificationActionPerformed', (actionData) => {\n if (actionData.notification && actionData.notification.data) {\n store.notifications.actions.handleNotificationAction(actionData.notification.data);\n }\n });\n };\n\n setupListeners();\n await pushNotifications.register();\n return true;\n },\n\n removeListeners: (pushNotifications) => {\n if (typeof window === 'undefined' || !pushNotifications) return;\n pushNotifications.removeAllListeners();\n }\n};\n\n// Notification utilities\nconst notificationUtils = {\n initialize: async (store, options = {}) => {\n if (typeof window === 'undefined') return;\n\n const userId = store.auth.state.user?._id;\n if (!userId) {\n console.warn('Cannot initialize notifications: No user ID found in auth store');\n return;\n }\n\n let wsListeners = null;\n if (options.enablePush !== false) {\n await pushNotificationHandlers.requestPermissions(store);\n }\n\n wsListeners = await wsNotificationHandlers.connect(store, userId, options);\n\n await store.notifications.actions.getNotifications(userId);\n\n return {\n disconnect: () => {\n wsNotificationHandlers.disconnect(wsListeners?.moduleName, wsListeners?.listeners);\n pushNotificationHandlers.removeListeners(globalThis.pushNotifications);\n }\n };\n },\n\n prefetchForSSR: async (store, context) => {\n try {\n const userId = store.auth.state.user?._id;\n if (userId) {\n await store.notifications.actions.getNotifications(userId);\n }\n } catch (error) {\n console.error('Error pre-fetching notifications for SSR:', error);\n }\n }\n};\n\n// Main initialization function\nconst initializeNotifications = (app, store, router, options = {}) => {\n const route = options.route || 'User Profile Root';\n router.addRoute(route, routerNotifications);\n store.addStore('notifications', storeNotifications);\n\n if (options.wsUrl) {\n globalWebSocket.initialize({ wsUrl: options.wsUrl });\n }\n\n const isServer = typeof window === 'undefined';\n const autoInit = !isServer && options.autoInit !== false;\n\n let notificationManager = null;\n\n if (autoInit) {\n const initNotifications = async () => {\n if (store.auth.state.isAuthenticated && store.auth.state.user?._id) {\n notificationManager = await notificationUtils.initialize(store, {\n enablePush: options.enablePush !== false,\n maxReconnectAttempts: options.maxReconnectAttempts || 5,\n reconnectDelay: options.reconnectDelay || 3000,\n pingInterval: options.pingInterval || 30000\n });\n }\n };\n\n watch(() => store.auth.state.isAuthenticated, (isAuthenticated) => {\n if (isAuthenticated) {\n initNotifications();\n } else if (notificationManager) {\n notificationManager.disconnect();\n store.notifications.mutations.resetNotifications();\n notificationManager = null;\n }\n });\n\n if (store.auth.state.isAuthenticated) {\n initNotifications();\n }\n }\n\n app.provide('useNotifications', () => ({\n ...toRefs(store.notifications.state),\n ...store.notifications.actions,\n ...store.notifications.mutations,\n init: () => notificationUtils.initialize(store, options),\n disconnect: () => notificationManager?.disconnect(),\n isServer\n }));\n\n return {\n SSR: { prefetchNotifications: notificationUtils.prefetchForSSR }\n };\n};\n\nconst ModuleNotifications = {\n initialize: initializeNotifications,\n views: {\n store: { storeNotifications },\n router: { routerNotifications },\n components: {\n NotificationBadge,\n NotificationItem,\n NotificationsList,\n NotificationPreferences,\n Notifications,\n NotificationsLayout\n }\n }\n};\n\nexport {\n NotificationBadge,\n NotificationItem,\n NotificationsList,\n NotificationPreferences,\n Notifications,\n NotificationsLayout,\n notificationUtils as SSRUtils\n};\n\nexport default ModuleNotifications;"],"names":["routerNotifications","storeNotifications"],"mappings":";;;;;;;;;;;AAaA,MAAM,yBAAyB;AAAA,EAC7B,SAAS,CAAC,OAAO,QAAQ,UAAU,CAAA,MAAO;AACxC,QAAI,OAAO,WAAW,eAAe,CAAC,OAAQ,QAAO,QAAQ,QAAQ,KAAK;AAE1E,WAAO,gBAAgB,QAAQ,MAAM,EAAE,KAAK,MAAM;AAChD,YAAM,aAAa;AACnB,YAAM,YAAY,CAAE;AAEpB,YAAM,cAAc,CAAC,OAAO,YAAY;AACtC,kBAAU,KAAK,gBAAgB,iBAAiB,OAAO,SAAS,EAAE,QAAQ,WAAU,CAAE,CAA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
|
|
3
3
|
const vue = require("vue");
|
|
4
4
|
const vueRouter = require("vue-router");
|
|
5
|
-
const Button = require("../../../../components/Button/Button.
|
|
5
|
+
const Button = require("../../../../components/Button/Button.vue2.cjs");
|
|
6
6
|
const Select = require("../../../../components/Select/Select.vue.cjs");
|
|
7
|
-
const Popup = require("../../../../components/Popup/Popup.
|
|
7
|
+
const Popup = require("../../../../components/Popup/Popup.vue.cjs");
|
|
8
8
|
const IconTime = require("../../../icons/entities/IconTime.vue.cjs");
|
|
9
9
|
const CardOrderItem = require("../blocks/CardOrderItem.vue.cjs");
|
|
10
10
|
const CardOrganization = require("../../../organizations/components/blocks/CardOrganization.vue.cjs");
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ref, onMounted, computed, createElementBlock, createCommentVNode, openBlock, createVNode, createElementVNode, createTextVNode, toDisplayString, Fragment, renderList, normalizeClass, withCtx, createBlock, unref } from "vue";
|
|
2
2
|
import { useRouter, useRoute } from "vue-router";
|
|
3
|
-
import _sfc_main$2 from "../../../../components/Button/Button.
|
|
3
|
+
import _sfc_main$2 from "../../../../components/Button/Button.vue2.js";
|
|
4
4
|
import Select from "../../../../components/Select/Select.vue.js";
|
|
5
|
-
import _sfc_main$1 from "../../../../components/Popup/Popup.
|
|
5
|
+
import _sfc_main$1 from "../../../../components/Popup/Popup.vue.js";
|
|
6
6
|
import IconTime from "../../../icons/entities/IconTime.vue.js";
|
|
7
7
|
import _sfc_main$3 from "../blocks/CardOrderItem.vue.js";
|
|
8
8
|
import _sfc_main$5 from "../../../organizations/components/blocks/CardOrganization.vue.js";
|