@churchapps/apphelper 0.7.4 → 0.7.6
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/components/conversations/Conversations.d.ts +21 -0
- package/dist/components/conversations/Conversations.d.ts.map +1 -0
- package/dist/components/conversations/Conversations.js +92 -0
- package/dist/components/conversations/Conversations.js.map +1 -0
- package/dist/components/conversations/index.d.ts +2 -0
- package/dist/components/conversations/index.d.ts.map +1 -0
- package/dist/components/conversations/index.js +2 -0
- package/dist/components/conversations/index.js.map +1 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +1 -0
- package/dist/components/index.js.map +1 -1
- package/dist/components/notes/AddNote.d.ts.map +1 -1
- package/dist/components/notes/AddNote.js +19 -1
- package/dist/components/notes/AddNote.js.map +1 -1
- package/dist/components/notes/Notes.d.ts.map +1 -1
- package/dist/components/notes/Notes.js +62 -47
- package/dist/components/notes/Notes.js.map +1 -1
- package/dist/components/notes/SubscriptionToggle.d.ts +38 -0
- package/dist/components/notes/SubscriptionToggle.d.ts.map +1 -0
- package/dist/components/notes/SubscriptionToggle.js +76 -0
- package/dist/components/notes/SubscriptionToggle.js.map +1 -0
- package/dist/components/notes/index.d.ts +1 -0
- package/dist/components/notes/index.d.ts.map +1 -1
- package/dist/components/notes/index.js +1 -0
- package/dist/components/notes/index.js.map +1 -1
- package/dist/components/wrapper/PrivateMessages.d.ts.map +1 -1
- package/dist/components/wrapper/PrivateMessages.js +12 -0
- package/dist/components/wrapper/PrivateMessages.js.map +1 -1
- package/dist/helpers/ConversationStore.d.ts +36 -0
- package/dist/helpers/ConversationStore.d.ts.map +1 -0
- package/dist/helpers/ConversationStore.js +238 -0
- package/dist/helpers/ConversationStore.js.map +1 -0
- package/dist/helpers/NotificationService.d.ts +3 -0
- package/dist/helpers/NotificationService.d.ts.map +1 -1
- package/dist/helpers/NotificationService.js +52 -13
- package/dist/helpers/NotificationService.js.map +1 -1
- package/dist/helpers/PresenceStore.d.ts +34 -0
- package/dist/helpers/PresenceStore.d.ts.map +1 -0
- package/dist/helpers/PresenceStore.js +93 -0
- package/dist/helpers/PresenceStore.js.map +1 -0
- package/dist/helpers/SocketHelper.d.ts +17 -0
- package/dist/helpers/SocketHelper.d.ts.map +1 -1
- package/dist/helpers/SocketHelper.js +70 -3
- package/dist/helpers/SocketHelper.js.map +1 -1
- package/dist/helpers/SubscriptionManager.d.ts +23 -0
- package/dist/helpers/SubscriptionManager.d.ts.map +1 -0
- package/dist/helpers/SubscriptionManager.js +118 -0
- package/dist/helpers/SubscriptionManager.js.map +1 -0
- package/dist/helpers/WebPushHelper.d.ts +36 -0
- package/dist/helpers/WebPushHelper.d.ts.map +1 -0
- package/dist/helpers/WebPushHelper.js +180 -0
- package/dist/helpers/WebPushHelper.js.map +1 -0
- package/dist/helpers/__tests__/WebPushHelper.test.d.ts +13 -0
- package/dist/helpers/__tests__/WebPushHelper.test.d.ts.map +1 -0
- package/dist/helpers/__tests__/WebPushHelper.test.js +99 -0
- package/dist/helpers/__tests__/WebPushHelper.test.js.map +1 -0
- package/dist/helpers/index.d.ts +5 -0
- package/dist/helpers/index.d.ts.map +1 -1
- package/dist/helpers/index.js +4 -0
- package/dist/helpers/index.js.map +1 -1
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +1 -0
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/useConversation.d.ts +36 -0
- package/dist/hooks/useConversation.d.ts.map +1 -0
- package/dist/hooks/useConversation.js +152 -0
- package/dist/hooks/useConversation.js.map +1 -0
- package/dist/website/components/elementTypes/CarouselElement.js +1 -1
- package/dist/website/components/elementTypes/CarouselElement.js.map +1 -1
- package/dist/website/styles/animations.css +11 -0
- package/package.json +18 -10
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @vitest-environment jsdom
|
|
3
|
+
*
|
|
4
|
+
* Unit test for the consolidated apphelper WebPushHelper.subscribe() flow.
|
|
5
|
+
* Stubs the browser push APIs + the underlying ApiHelper, then runs subscribe()
|
|
6
|
+
* end-to-end and asserts:
|
|
7
|
+
* - the right VAPID public key is fetched from the server
|
|
8
|
+
* - pushManager.subscribe is called with userVisibleOnly + the decoded VAPID key
|
|
9
|
+
* - POST /webpush/subscribe is called with the right body shape (the same shape
|
|
10
|
+
* the server's `webpush:` token decoder expects)
|
|
11
|
+
*/
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=WebPushHelper.test.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WebPushHelper.test.d.ts","sourceRoot":"","sources":["../../../src/helpers/__tests__/WebPushHelper.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @vitest-environment jsdom
|
|
3
|
+
*
|
|
4
|
+
* Unit test for the consolidated apphelper WebPushHelper.subscribe() flow.
|
|
5
|
+
* Stubs the browser push APIs + the underlying ApiHelper, then runs subscribe()
|
|
6
|
+
* end-to-end and asserts:
|
|
7
|
+
* - the right VAPID public key is fetched from the server
|
|
8
|
+
* - pushManager.subscribe is called with userVisibleOnly + the decoded VAPID key
|
|
9
|
+
* - POST /webpush/subscribe is called with the right body shape (the same shape
|
|
10
|
+
* the server's `webpush:` token decoder expects)
|
|
11
|
+
*/
|
|
12
|
+
import { describe, it, expect, vi, beforeEach } from "vitest";
|
|
13
|
+
// Mock @churchapps/helpers — WebPushHelper imports ApiHelper + UserHelper from there.
|
|
14
|
+
const apiPostMock = vi.fn().mockResolvedValue(undefined);
|
|
15
|
+
const apiGetMock = vi.fn().mockResolvedValue({ publicKey: "BNcRdreALRFXTkOOUHK1EtK2wtaz5Ry4YfYCA_0QTpQtUbVlUls0VJXg7A8u-Ts1XbjhazAkj7I99e8QcYP7DkM", enabled: true });
|
|
16
|
+
vi.mock("@churchapps/helpers", () => ({
|
|
17
|
+
ApiHelper: { get: apiGetMock, post: apiPostMock },
|
|
18
|
+
UserHelper: { user: { id: "USR00000001" } },
|
|
19
|
+
}));
|
|
20
|
+
const { WebPushHelper } = await import("../WebPushHelper");
|
|
21
|
+
describe("WebPushHelper.subscribe", () => {
|
|
22
|
+
let fakeSubscription;
|
|
23
|
+
let pushManagerSubscribeMock;
|
|
24
|
+
let pushManagerGetSubscriptionMock;
|
|
25
|
+
beforeEach(() => {
|
|
26
|
+
apiPostMock.mockClear();
|
|
27
|
+
apiGetMock.mockClear();
|
|
28
|
+
fakeSubscription = {
|
|
29
|
+
endpoint: `https://example-push.test/endpoint/${Date.now()}`,
|
|
30
|
+
toJSON() {
|
|
31
|
+
return {
|
|
32
|
+
endpoint: this.endpoint,
|
|
33
|
+
keys: { p256dh: "p256dh-fake", auth: "auth-fake" },
|
|
34
|
+
};
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
pushManagerSubscribeMock = vi.fn().mockResolvedValue(fakeSubscription);
|
|
38
|
+
pushManagerGetSubscriptionMock = vi.fn().mockResolvedValue(null);
|
|
39
|
+
const fakeRegistration = {
|
|
40
|
+
scope: "/mobile",
|
|
41
|
+
pushManager: {
|
|
42
|
+
subscribe: pushManagerSubscribeMock,
|
|
43
|
+
getSubscription: pushManagerGetSubscriptionMock,
|
|
44
|
+
},
|
|
45
|
+
};
|
|
46
|
+
Object.defineProperty(navigator, "serviceWorker", {
|
|
47
|
+
configurable: true,
|
|
48
|
+
value: {
|
|
49
|
+
getRegistration: vi.fn().mockResolvedValue(fakeRegistration),
|
|
50
|
+
register: vi.fn().mockResolvedValue(fakeRegistration),
|
|
51
|
+
ready: Promise.resolve(fakeRegistration),
|
|
52
|
+
},
|
|
53
|
+
});
|
|
54
|
+
// PushManager presence is what isSupported() checks for
|
|
55
|
+
window.PushManager = function () { };
|
|
56
|
+
// Notification API
|
|
57
|
+
window.Notification = function () { };
|
|
58
|
+
window.Notification.permission = "default";
|
|
59
|
+
window.Notification.requestPermission = vi.fn().mockResolvedValue("granted");
|
|
60
|
+
// Clear any prior opt-out / cooldown state in the jsdom localStorage
|
|
61
|
+
window.localStorage.clear();
|
|
62
|
+
});
|
|
63
|
+
it("posts a webpush subscription to the server when the user grants permission", async () => {
|
|
64
|
+
WebPushHelper.configure({ scope: "/mobile", appName: "B1AppPwa" });
|
|
65
|
+
const sub = await WebPushHelper.subscribe();
|
|
66
|
+
expect(sub).toBeTruthy();
|
|
67
|
+
expect(sub?.endpoint).toBe(fakeSubscription.endpoint);
|
|
68
|
+
// VAPID public key request to the server
|
|
69
|
+
expect(apiGetMock).toHaveBeenCalledWith("/webpush/publicKey", "MessagingApi");
|
|
70
|
+
// pushManager.subscribe was called with userVisibleOnly + the decoded key bytes
|
|
71
|
+
expect(pushManagerSubscribeMock).toHaveBeenCalledTimes(1);
|
|
72
|
+
const args = pushManagerSubscribeMock.mock.calls[0][0];
|
|
73
|
+
expect(args.userVisibleOnly).toBe(true);
|
|
74
|
+
expect(args.applicationServerKey).toBeInstanceOf(Uint8Array);
|
|
75
|
+
// The subscription POST carries the right body shape
|
|
76
|
+
expect(apiPostMock).toHaveBeenCalledWith("/webpush/subscribe", expect.objectContaining({
|
|
77
|
+
appName: "B1AppPwa",
|
|
78
|
+
subscription: expect.objectContaining({
|
|
79
|
+
endpoint: fakeSubscription.endpoint,
|
|
80
|
+
keys: expect.objectContaining({ p256dh: "p256dh-fake", auth: "auth-fake" }),
|
|
81
|
+
}),
|
|
82
|
+
}), "MessagingApi");
|
|
83
|
+
});
|
|
84
|
+
it("returns null and does not POST if permission is denied", async () => {
|
|
85
|
+
window.Notification.requestPermission = vi.fn().mockResolvedValue("denied");
|
|
86
|
+
const sub = await WebPushHelper.subscribe();
|
|
87
|
+
expect(sub).toBeNull();
|
|
88
|
+
expect(apiPostMock).not.toHaveBeenCalled();
|
|
89
|
+
expect(pushManagerSubscribeMock).not.toHaveBeenCalled();
|
|
90
|
+
});
|
|
91
|
+
it("re-posts an existing subscription instead of subscribing again", async () => {
|
|
92
|
+
pushManagerGetSubscriptionMock.mockResolvedValue(fakeSubscription);
|
|
93
|
+
const sub = await WebPushHelper.subscribe();
|
|
94
|
+
expect(sub).toBeTruthy();
|
|
95
|
+
expect(pushManagerSubscribeMock).not.toHaveBeenCalled();
|
|
96
|
+
expect(apiPostMock).toHaveBeenCalledTimes(1);
|
|
97
|
+
});
|
|
98
|
+
});
|
|
99
|
+
//# sourceMappingURL=WebPushHelper.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WebPushHelper.test.js","sourceRoot":"","sources":["../../../src/helpers/__tests__/WebPushHelper.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAE9D,sFAAsF;AACtF,MAAM,WAAW,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,iBAAiB,CAAC,SAAS,CAAC,CAAC;AACzD,MAAM,UAAU,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,iBAAiB,CAAC,EAAE,SAAS,EAAE,yFAAyF,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;AAEtK,EAAE,CAAC,IAAI,CAAC,qBAAqB,EAAE,GAAG,EAAE,CAAC,CAAC;IACpC,SAAS,EAAE,EAAE,GAAG,EAAE,UAAU,EAAE,IAAI,EAAE,WAAW,EAAE;IACjD,UAAU,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,EAAE,aAAa,EAAE,EAAE;CAC5C,CAAC,CAAC,CAAC;AAEJ,MAAM,EAAE,aAAa,EAAE,GAAG,MAAM,MAAM,CAAC,kBAAkB,CAAC,CAAC;AAE3D,QAAQ,CAAC,yBAAyB,EAAE,GAAG,EAAE;IACvC,IAAI,gBAAqB,CAAC;IAC1B,IAAI,wBAAkD,CAAC;IACvD,IAAI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AM,EAAE,aAAa,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC;aAC5E,CAAC;SACH,CAAC,EACF,cAAc,CACf,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,wDAAwD,EAAE,KAAK,IAAI,EAAE;QACrE,MAAc,CAAC,YAAY,CAAC,iBAAiB,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAC;QAErF,MAAM,GAAG,GAAG,MAAM,aAAa,CAAC,SAAS,EAAE,CAAC;QAE5C,MAAM,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,CAAC;QACvB,MAAM,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,gBAAgB,EAAE,CAAC;QAC3C,MAAM,CAAC,wBAAwB,CAAC,CAAC,GAAG,CAAC,gBAAgB,EAAE,CAAC;IAC1D,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,gEAAgE,EAAE,KAAK,IAAI,EAAE;QAC9E,8BAA8B,CAAC,iBAAiB,CAAC,gBAAgB,CAAC,CAAC;QAEnE,MAAM,GAAG,GAAG,MAAM,aAAa,CAAC,SAAS,EAAE,CAAC;QAE5C,MAAM,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,CAAC;QACzB,MAAM,CAAC,wBAAwB,CAAC,CAAC,GAAG,CAAC,gBAAgB,EAAE,CAAC;QACxD,MAAM,CAAC,WAAW,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC;IAC/C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
package/dist/helpers/index.d.ts
CHANGED
|
@@ -7,6 +7,11 @@ export { createEmotionCache } from "./createEmotionCache";
|
|
|
7
7
|
export { Locale } from "./Locale";
|
|
8
8
|
export { SlugHelper } from "./SlugHelper";
|
|
9
9
|
export { SocketHelper } from "./SocketHelper";
|
|
10
|
+
export { SubscriptionManager } from "./SubscriptionManager";
|
|
11
|
+
export { ConversationStore } from "./ConversationStore";
|
|
12
|
+
export { PresenceStore } from "./PresenceStore";
|
|
13
|
+
export type { PresenceSnapshot, PresenceViewer } from "./PresenceStore";
|
|
10
14
|
export { NotificationService } from "./NotificationService";
|
|
11
15
|
export type { NotificationCounts } from "./NotificationService";
|
|
16
|
+
export { WebPushHelper } from "./WebPushHelper";
|
|
12
17
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/helpers/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,SAAS,EACT,gBAAgB,IAAI,oBAAoB,EACxC,WAAW,EACX,uBAAuB,EACvB,cAAc,EACd,UAAU,EACV,WAAW,EACX,WAAW,EACX,UAAU,EACV,YAAY,EACZ,UAAU,EACV,cAAc,EACd,WAAW,EACZ,MAAM,qBAAqB,CAAC;AAG7B,YAAY,EACV,iBAAiB,EACjB,oBAAoB,EACpB,mBAAmB,EACnB,eAAe,EACf,eAAe,EACf,aAAa,EACb,wBAAwB,EACxB,oBAAoB,EACpB,iBAAiB,EACjB,aAAa,EACb,sBAAsB,EACtB,uBAAuB,EACvB,qBAAqB,EACrB,6BAA6B,EAC7B,8BAA8B,EAC9B,mBAAmB,EACnB,4BAA4B,EAC5B,sBAAsB,EACtB,mBAAmB,EACnB,iBAAiB,EACjB,eAAe,EACf,uBAAuB,EACvB,gBAAgB,EAChB,qBAAqB,EACrB,uBAAuB,EACvB,cAAc,EACd,qBAAqB,EACtB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,YAAY,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,UAAU,E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AC;AAC9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,YAAY,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACxE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,YAAY,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC"}
|
package/dist/helpers/index.js
CHANGED
|
@@ -7,5 +7,9 @@ export { createEmotionCache } from "./createEmotionCache";
|
|
|
7
7
|
export { Locale } from "./Locale";
|
|
8
8
|
export { SlugHelper } from "./SlugHelper";
|
|
9
9
|
export { SocketHelper } from "./SocketHelper";
|
|
10
|
+
export { SubscriptionManager } from "./SubscriptionManager";
|
|
11
|
+
export { ConversationStore } from "./ConversationStore";
|
|
12
|
+
export { PresenceStore } from "./PresenceStore";
|
|
10
13
|
export { NotificationService } from "./NotificationService";
|
|
14
|
+
export { WebPushHelper } from "./WebPushHelper";
|
|
11
15
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/helpers/index.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,OAAO,EACL,SAAS,EACT,gBAAgB,IAAI,oBAAoB,EACxC,WAAW,EACX,uBAAuB,EACvB,cAAc,EACd,UAAU,EACV,WAAW,EACX,WAAW,EACX,UAAU,EACV,YAAY,EACZ,UAAU,EACV,cAAc,EACd,WAAW,EACZ,MAAM,qBAAqB,CAAC;AAiC7B,uBAAuB;AACvB,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/helpers/index.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,OAAO,EACL,SAAS,EACT,gBAAgB,IAAI,oBAAoB,EACxC,WAAW,EACX,uBAAuB,EACvB,cAAc,EACd,UAAU,EACV,WAAW,EACX,WAAW,EACX,UAAU,EACV,YAAY,EACZ,UAAU,EACV,cAAc,EACd,WAAW,EACZ,MAAM,qBAAqB,CAAC;AAiC7B,uBAAuB;AACvB,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC"}
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export { useMountedState } from "./useMountedState";
|
|
2
2
|
export { useNotifications } from "./useNotifications";
|
|
3
3
|
export type { UseNotificationsResult } from "./useNotifications";
|
|
4
|
+
export { useConversation } from "./useConversation";
|
|
5
|
+
export type { UseConversationOptions, UseConversationResult } from "./useConversation";
|
|
4
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,YAAY,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,YAAY,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,YAAY,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC"}
|
package/dist/hooks/index.js
CHANGED
package/dist/hooks/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { ConversationInterface, MessageInterface, UserContextInterface } from "@churchapps/helpers";
|
|
2
|
+
export interface UseConversationOptions {
|
|
3
|
+
/** content-keyed lookup (e.g. group, person, sermon, contentBlock). If contentId is empty, the hook is idle. */
|
|
4
|
+
contentType?: string;
|
|
5
|
+
contentId?: string;
|
|
6
|
+
/** direct conversation id lookup (used by private messages where the conversation already exists). */
|
|
7
|
+
conversationId?: string;
|
|
8
|
+
/** required for join/leave room calls. */
|
|
9
|
+
context?: UserContextInterface;
|
|
10
|
+
/** if no conversation exists for this content yet, create one with this groupId/visibility on first post. */
|
|
11
|
+
groupId?: string;
|
|
12
|
+
visibility?: string;
|
|
13
|
+
/** if true, the hook does not auto-join the realtime room. Used for transient previews. */
|
|
14
|
+
skipSubscribe?: boolean;
|
|
15
|
+
}
|
|
16
|
+
export interface UseConversationResult {
|
|
17
|
+
conversation: ConversationInterface | null;
|
|
18
|
+
messages: MessageInterface[];
|
|
19
|
+
isLoading: boolean;
|
|
20
|
+
error: string | null;
|
|
21
|
+
refresh: () => Promise<void>;
|
|
22
|
+
post: (content: string, messageType?: string) => Promise<MessageInterface | null>;
|
|
23
|
+
edit: (messageId: string, content: string) => Promise<void>;
|
|
24
|
+
remove: (messageId: string) => Promise<void>;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Subscribe to a conversation, get a live message list, and post/edit/delete.
|
|
28
|
+
*
|
|
29
|
+
* - On mount: hydrates via REST (by contentType/contentId or by conversationId) and joins the
|
|
30
|
+
* server room via SubscriptionManager so socket events update the store automatically.
|
|
31
|
+
* - On unmount: leaves the room (ref-counted, so multiple consumers of the same conversation share one join).
|
|
32
|
+
* - Mutations write to /messages and rely on the server's broadcast to fan out — including
|
|
33
|
+
* to this same tab, so we do not optimistically apply.
|
|
34
|
+
*/
|
|
35
|
+
export declare function useConversation(opts: UseConversationOptions): UseConversationResult;
|
|
36
|
+
//# sourceMappingURL=useConversation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useConversation.d.ts","sourceRoot":"","sources":["../../src/hooks/useConversation.ts"],"names":[],"mappings":"AAEA,OAAO,EAAa,qBAAqB,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAI/G,MAAM,WAAW,sBAAsB;IACrC,gHAAgH;IAChH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sGAAsG;IACtG,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,0CAA0C;IAC1C,OAAO,CAAC,EAAE,oBAAoB,CAAC;IAC/B,6GAA6G;IAC7G,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,2FAA2F;IAC3F,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED,MAAM,WAAW,qBAAqB;IACpC,YAAY,EAAE,qBAAqB,GAAG,IAAI,CAAC;IAC3C,QAAQ,EAAE,gBAAgB,EAAE,CAAC;IAC7B,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7B,IAAI,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAAC;IAClF,IAAI,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5D,MAAM,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CAC9C;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,sBAAsB,GAAG,qBAAqB,CAqInF"}
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useCallback, useEffect, useState } from "react";
|
|
3
|
+
import { ApiHelper } from "@churchapps/helpers";
|
|
4
|
+
import { ConversationStore } from "../helpers/ConversationStore";
|
|
5
|
+
import { SubscriptionManager } from "../helpers/SubscriptionManager";
|
|
6
|
+
/**
|
|
7
|
+
* Subscribe to a conversation, get a live message list, and post/edit/delete.
|
|
8
|
+
*
|
|
9
|
+
* - On mount: hydrates via REST (by contentType/contentId or by conversationId) and joins the
|
|
10
|
+
* server room via SubscriptionManager so socket events update the store automatically.
|
|
11
|
+
* - On unmount: leaves the room (ref-counted, so multiple consumers of the same conversation share one join).
|
|
12
|
+
* - Mutations write to /messages and rely on the server's broadcast to fan out — including
|
|
13
|
+
* to this same tab, so we do not optimistically apply.
|
|
14
|
+
*/
|
|
15
|
+
export function useConversation(opts) {
|
|
16
|
+
const [conversation, setConversation] = useState(null);
|
|
17
|
+
const [isLoading, setIsLoading] = useState(false);
|
|
18
|
+
const [error, setError] = useState(null);
|
|
19
|
+
const churchId = opts.context?.userChurch?.church?.id;
|
|
20
|
+
const personId = opts.context?.person?.id;
|
|
21
|
+
const displayName = opts.context?.person ? `${opts.context.person.name?.first ?? ""} ${opts.context.person.name?.last ?? ""}`.trim() : "";
|
|
22
|
+
const hydrate = useCallback(async () => {
|
|
23
|
+
setError(null);
|
|
24
|
+
try {
|
|
25
|
+
if (opts.conversationId) {
|
|
26
|
+
return await ConversationStore.loadByConversationId(opts.conversationId);
|
|
27
|
+
}
|
|
28
|
+
if (opts.contentType && opts.contentId) {
|
|
29
|
+
return await ConversationStore.loadByContent(opts.contentType, opts.contentId);
|
|
30
|
+
}
|
|
31
|
+
return null;
|
|
32
|
+
}
|
|
33
|
+
catch (err) {
|
|
34
|
+
setError(err?.message || "Failed to load conversation");
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
}, [opts.contentType, opts.contentId, opts.conversationId]);
|
|
38
|
+
// Initial hydration + subscribe
|
|
39
|
+
useEffect(() => {
|
|
40
|
+
let cancelled = false;
|
|
41
|
+
let unsubscribe = null;
|
|
42
|
+
let joinedConversationId = null;
|
|
43
|
+
(async () => {
|
|
44
|
+
setIsLoading(true);
|
|
45
|
+
const conv = await hydrate();
|
|
46
|
+
if (cancelled)
|
|
47
|
+
return;
|
|
48
|
+
if (conv?.id) {
|
|
49
|
+
unsubscribe = ConversationStore.subscribe(conv.id, (updated) => {
|
|
50
|
+
if (!cancelled)
|
|
51
|
+
setConversation(updated);
|
|
52
|
+
});
|
|
53
|
+
if (!opts.skipSubscribe && churchId) {
|
|
54
|
+
joinedConversationId = conv.id;
|
|
55
|
+
await SubscriptionManager.joinRoom(conv.id, churchId, personId, displayName);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
// also subscribe by direct conversationId even if REST returned nothing yet
|
|
59
|
+
else if (opts.conversationId) {
|
|
60
|
+
unsubscribe = ConversationStore.subscribe(opts.conversationId, (updated) => {
|
|
61
|
+
if (!cancelled)
|
|
62
|
+
setConversation(updated);
|
|
63
|
+
});
|
|
64
|
+
if (!opts.skipSubscribe && churchId) {
|
|
65
|
+
joinedConversationId = opts.conversationId;
|
|
66
|
+
await SubscriptionManager.joinRoom(opts.conversationId, churchId, personId, displayName);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
if (!cancelled)
|
|
70
|
+
setIsLoading(false);
|
|
71
|
+
})();
|
|
72
|
+
return () => {
|
|
73
|
+
cancelled = true;
|
|
74
|
+
if (unsubscribe)
|
|
75
|
+
unsubscribe();
|
|
76
|
+
if (joinedConversationId && churchId) {
|
|
77
|
+
SubscriptionManager.leaveRoom(joinedConversationId, churchId).catch(() => { });
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
}, [hydrate, churchId, personId, displayName, opts.skipSubscribe, opts.conversationId]);
|
|
81
|
+
const refresh = useCallback(async () => {
|
|
82
|
+
setIsLoading(true);
|
|
83
|
+
await hydrate();
|
|
84
|
+
setIsLoading(false);
|
|
85
|
+
}, [hydrate]);
|
|
86
|
+
const ensureConversationId = useCallback(async () => {
|
|
87
|
+
if (conversation?.id)
|
|
88
|
+
return conversation.id;
|
|
89
|
+
if (opts.conversationId)
|
|
90
|
+
return opts.conversationId;
|
|
91
|
+
if (!opts.contentType || !opts.contentId)
|
|
92
|
+
return null;
|
|
93
|
+
const newConv = {
|
|
94
|
+
contentType: opts.contentType,
|
|
95
|
+
contentId: opts.contentId,
|
|
96
|
+
groupId: opts.groupId,
|
|
97
|
+
visibility: opts.visibility ?? "public",
|
|
98
|
+
title: `${opts.contentType}-${opts.contentId} Conversation`,
|
|
99
|
+
allowAnonymousPosts: false
|
|
100
|
+
};
|
|
101
|
+
const result = await ApiHelper.post("/conversations", [newConv], "MessagingApi");
|
|
102
|
+
const created = Array.isArray(result) ? result[0] : result;
|
|
103
|
+
if (!created?.id)
|
|
104
|
+
return null;
|
|
105
|
+
ConversationStore.setConversation({ ...created, messages: [] });
|
|
106
|
+
if (churchId)
|
|
107
|
+
await SubscriptionManager.joinRoom(created.id, churchId, personId, displayName);
|
|
108
|
+
return created.id;
|
|
109
|
+
}, [conversation?.id, opts.conversationId, opts.contentType, opts.contentId, opts.groupId, opts.visibility, churchId, personId, displayName]);
|
|
110
|
+
const post = useCallback(async (content, messageType = "comment") => {
|
|
111
|
+
const trimmed = content?.trim();
|
|
112
|
+
if (!trimmed)
|
|
113
|
+
return null;
|
|
114
|
+
const targetConversationId = await ensureConversationId();
|
|
115
|
+
if (!targetConversationId) {
|
|
116
|
+
setError("Cannot post: missing conversation context");
|
|
117
|
+
return null;
|
|
118
|
+
}
|
|
119
|
+
const message = {
|
|
120
|
+
conversationId: targetConversationId,
|
|
121
|
+
messageType,
|
|
122
|
+
content: trimmed,
|
|
123
|
+
personId
|
|
124
|
+
};
|
|
125
|
+
const result = await ApiHelper.post("/messages", [message], "MessagingApi");
|
|
126
|
+
return Array.isArray(result) ? result[0] : result;
|
|
127
|
+
}, [ensureConversationId, personId]);
|
|
128
|
+
const edit = useCallback(async (messageId, content) => {
|
|
129
|
+
const trimmed = content?.trim();
|
|
130
|
+
if (!trimmed)
|
|
131
|
+
return;
|
|
132
|
+
const targetConversationId = conversation?.id || opts.conversationId;
|
|
133
|
+
if (!targetConversationId)
|
|
134
|
+
return;
|
|
135
|
+
const message = { id: messageId, conversationId: targetConversationId, content: trimmed };
|
|
136
|
+
await ApiHelper.post("/messages", [message], "MessagingApi");
|
|
137
|
+
}, [conversation?.id, opts.conversationId]);
|
|
138
|
+
const remove = useCallback(async (messageId) => {
|
|
139
|
+
await ApiHelper.delete(`/messages/${messageId}`, "MessagingApi");
|
|
140
|
+
}, []);
|
|
141
|
+
return {
|
|
142
|
+
conversation,
|
|
143
|
+
messages: conversation?.messages ?? [],
|
|
144
|
+
isLoading,
|
|
145
|
+
error,
|
|
146
|
+
refresh,
|
|
147
|
+
post,
|
|
148
|
+
edit,
|
|
149
|
+
remove
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
//# sourceMappingURL=useConversation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useConversation.js","sourceRoot":"","sources":["../../src/hooks/useConversation.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AACb,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACzD,OAAO,EAAE,SAAS,EAAiE,MAAM,qBAAqB,CAAC;AAC/G,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AA4BrE;;;;;;;;GAQG;AACH,MAAM,UAAU,eAAe,CAAC,IAA4B;IAC1D,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,QAAQ,CAA+B,IAAI,CAAC,CAAC;IACrF,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAU,KAAK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S;QACT,KAAK;QACL,OAAO;QACP,IAAI;QACJ,IAAI;QACJ,MAAM;KACP,CAAC;AACJ,CAAC"}
|
|
@@ -16,7 +16,7 @@ export const CarouselElement = ({ element, churchSettings, textColor, onEdit, on
|
|
|
16
16
|
}, [element.id, current]);
|
|
17
17
|
const interval = (parseInt(element.answers.interval) || 4) * 1000;
|
|
18
18
|
const timerRef = useRef(null);
|
|
19
|
-
const fade = element.answers.animationOptions === "fade";
|
|
19
|
+
const fade = (element.answers.animationOptions || "fade") === "fade";
|
|
20
20
|
const autoPlay = element.answers.autoplay === "true" && !onEdit;
|
|
21
21
|
const length = element.elements?.length || 0;
|
|
22
22
|
const goTo = (idx) => setCurrent(idx);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CarouselElement.js","sourceRoot":"","sources":["../../../../src/website/components/elementTypes/CarouselElement.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAc,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAE3D,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAUrC,yEAAyE;AACzE,MAAM,iBAAiB,GAAG,IAAI,GAAG,EAAkB,CAAC;AAEpD,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,EAAE,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAS,EAAE,EAAE;IAC/F,kDAAkD;IAClD,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC,GAAG,EAAE,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,iBAAiB,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;IAE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O,CAAC,MAAM,CAAC,IAAI,GAAG;YAC/C,QAAQ,EAAE,UAAU;YACpB,QAAQ,EAAE,QAAQ;SACnB,aAEA,IAAI,CAAC,CAAC,CAAC,aAAa,EAAE,CAAC,CAAC,CAAC,iBAAiB,EAAE,EAC5C,MAAM,GAAG,CAAC,IAAI,aAAa,EAAE,IAC1B,CACP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -3,6 +3,17 @@
|
|
|
3
3
|
.animate.normal { animation-duration: 1.5s; }
|
|
4
4
|
.animate.slow { animation-duration: 4.5s; }
|
|
5
5
|
|
|
6
|
+
.animated.fadeIn,
|
|
7
|
+
.animated.slideRight,
|
|
8
|
+
.animated.slideLeft,
|
|
9
|
+
.animated.slideDown,
|
|
10
|
+
.animated.slideUp { opacity: 0; }
|
|
11
|
+
.animated.slideRight { transform: translateX(-100%); }
|
|
12
|
+
.animated.slideLeft { transform: translateX(100%); }
|
|
13
|
+
.animated.slideDown { transform: translateY(-100%); }
|
|
14
|
+
.animated.slideUp { transform: translateY(-100%); }
|
|
15
|
+
.animated.grow { transform: scale(0); }
|
|
16
|
+
|
|
6
17
|
@keyframes slideRight {
|
|
7
18
|
from { transform:translateX(-100%); opacity:0; }
|
|
8
19
|
to { transform:translateX(0); opacity:1; }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@churchapps/apphelper",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.6",
|
|
4
4
|
"description": "Library of helper functions, components, and feature modules (donations/forms/login/markdown/website) for React and NextJS ChurchApps",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"dist"
|
|
41
41
|
],
|
|
42
42
|
"scripts": {
|
|
43
|
-
"test": "
|
|
43
|
+
"test": "vitest run --config vitest.config.ts",
|
|
44
44
|
"clean": "rimraf dist",
|
|
45
45
|
"tsc": "tsc",
|
|
46
46
|
"copy-locales": "copyfiles -a public/** dist",
|
|
@@ -69,17 +69,23 @@
|
|
|
69
69
|
},
|
|
70
70
|
"homepage": "https://github.com/ChurchApps/Packages#readme",
|
|
71
71
|
"peerDependencies": {
|
|
72
|
-
"react": "^18.0.0 || ^19.0.0",
|
|
73
|
-
"react-dom": "^18.0.0 || ^19.0.0",
|
|
74
|
-
"react-router-dom": "^7.6.3",
|
|
75
72
|
"@stripe/react-stripe-js": "^3.5.2",
|
|
76
73
|
"@stripe/stripe-js": "^7.4.0",
|
|
77
|
-
"react
|
|
74
|
+
"react": "^18.0.0 || ^19.0.0",
|
|
75
|
+
"react-dom": "^18.0.0 || ^19.0.0",
|
|
76
|
+
"react-google-recaptcha": "^3.1.0",
|
|
77
|
+
"react-router-dom": "^7.6.3"
|
|
78
78
|
},
|
|
79
79
|
"peerDependenciesMeta": {
|
|
80
|
-
"@stripe/react-stripe-js": {
|
|
81
|
-
|
|
82
|
-
|
|
80
|
+
"@stripe/react-stripe-js": {
|
|
81
|
+
"optional": true
|
|
82
|
+
},
|
|
83
|
+
"@stripe/stripe-js": {
|
|
84
|
+
"optional": true
|
|
85
|
+
},
|
|
86
|
+
"react-google-recaptcha": {
|
|
87
|
+
"optional": true
|
|
88
|
+
}
|
|
83
89
|
},
|
|
84
90
|
"dependencies": {
|
|
85
91
|
"@churchapps/helpers": "^1.3.0",
|
|
@@ -144,6 +150,7 @@
|
|
|
144
150
|
"eslint": "^9.28.0",
|
|
145
151
|
"eslint-plugin-unused-imports": "^4.4.1",
|
|
146
152
|
"globals": "^16.2.0",
|
|
153
|
+
"jsdom": "^25.0.1",
|
|
147
154
|
"npm-run-all2": "^8.0.4",
|
|
148
155
|
"react": "^19.1.0",
|
|
149
156
|
"react-dom": "^19.1.0",
|
|
@@ -152,6 +159,7 @@
|
|
|
152
159
|
"rimraf": "^6.0.1",
|
|
153
160
|
"typescript": "^5.9.2",
|
|
154
161
|
"typescript-eslint": "^8.35.0",
|
|
155
|
-
"vite": "^7.0.6"
|
|
162
|
+
"vite": "^7.0.6",
|
|
163
|
+
"vitest": "^2.1.9"
|
|
156
164
|
}
|
|
157
165
|
}
|