@carlonicora/nextjs-jsonapi 1.117.0 → 1.117.1
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/{AssistantMessageInterface-Ca0G0vZw.d.mts → AssistantMessageInterface-DH1QwtC_.d.mts} +1 -0
- package/dist/{AssistantMessageInterface-DEZ5AnVl.d.ts → AssistantMessageInterface-giWvsOrX.d.ts} +1 -0
- package/dist/{BlockNoteEditor-6UREFUSJ.js → BlockNoteEditor-CEWZCORH.js} +9 -9
- package/dist/{BlockNoteEditor-6UREFUSJ.js.map → BlockNoteEditor-CEWZCORH.js.map} +1 -1
- package/dist/{BlockNoteEditor-UQOOX3UT.mjs → BlockNoteEditor-K4T6QOJO.mjs} +2 -2
- package/dist/billing/index.js +299 -299
- package/dist/billing/index.mjs +1 -1
- package/dist/{chunk-HXU2HDRN.js → chunk-56QAXZKI.js} +245 -237
- package/dist/chunk-56QAXZKI.js.map +1 -0
- package/dist/{chunk-SVEPL5J2.mjs → chunk-6D4GJHLK.mjs} +16 -8
- package/dist/chunk-6D4GJHLK.mjs.map +1 -0
- package/dist/client/index.js +2 -2
- package/dist/client/index.mjs +1 -1
- package/dist/components/index.d.mts +1 -1
- package/dist/components/index.d.ts +1 -1
- package/dist/components/index.js +2 -2
- package/dist/components/index.mjs +1 -1
- package/dist/contexts/index.d.mts +1 -1
- package/dist/contexts/index.d.ts +1 -1
- package/dist/contexts/index.js +2 -2
- package/dist/contexts/index.mjs +1 -1
- package/dist/core/index.d.mts +2 -2
- package/dist/core/index.d.ts +2 -2
- package/dist/features/help/index.js +30 -30
- package/dist/features/help/index.mjs +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/package.json +1 -1
- package/src/components/navigations/Breadcrumb.tsx +31 -5
- package/src/hooks/useSocket.ts +12 -1
- package/src/interfaces/breadcrumb.item.data.interface.ts +1 -0
- package/dist/chunk-HXU2HDRN.js.map +0 -1
- package/dist/chunk-SVEPL5J2.mjs.map +0 -1
- /package/dist/{BlockNoteEditor-UQOOX3UT.mjs.map → BlockNoteEditor-K4T6QOJO.mjs.map} +0 -0
package/src/hooks/useSocket.ts
CHANGED
|
@@ -114,7 +114,18 @@ export function useSocket({ token }: UseSocketOptions): UseSocketReturn {
|
|
|
114
114
|
};
|
|
115
115
|
|
|
116
116
|
const handleNotification = (data: any) => {
|
|
117
|
-
|
|
117
|
+
// The socket sends a JSON:API document { data, included }; rehydrate expects
|
|
118
|
+
// { jsonApi, included }. Map it (and guard against an unexpected shape so a
|
|
119
|
+
// malformed payload never throws an uncaught error that breaks the socket).
|
|
120
|
+
const resource = data?.data ?? data?.jsonApi;
|
|
121
|
+
if (!resource?.type) {
|
|
122
|
+
console.warn("[useSocket] ignoring notification with unexpected payload shape", data);
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
const notification = rehydrate(Modules.Notification, {
|
|
126
|
+
jsonApi: resource,
|
|
127
|
+
included: data?.included || [],
|
|
128
|
+
}) as NotificationInterface;
|
|
118
129
|
if (notification) {
|
|
119
130
|
setSocketNotifications((prev) => {
|
|
120
131
|
const newNotifications = [...prev, notification];
|