@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.
Files changed (34) hide show
  1. package/dist/{AssistantMessageInterface-Ca0G0vZw.d.mts → AssistantMessageInterface-DH1QwtC_.d.mts} +1 -0
  2. package/dist/{AssistantMessageInterface-DEZ5AnVl.d.ts → AssistantMessageInterface-giWvsOrX.d.ts} +1 -0
  3. package/dist/{BlockNoteEditor-6UREFUSJ.js → BlockNoteEditor-CEWZCORH.js} +9 -9
  4. package/dist/{BlockNoteEditor-6UREFUSJ.js.map → BlockNoteEditor-CEWZCORH.js.map} +1 -1
  5. package/dist/{BlockNoteEditor-UQOOX3UT.mjs → BlockNoteEditor-K4T6QOJO.mjs} +2 -2
  6. package/dist/billing/index.js +299 -299
  7. package/dist/billing/index.mjs +1 -1
  8. package/dist/{chunk-HXU2HDRN.js → chunk-56QAXZKI.js} +245 -237
  9. package/dist/chunk-56QAXZKI.js.map +1 -0
  10. package/dist/{chunk-SVEPL5J2.mjs → chunk-6D4GJHLK.mjs} +16 -8
  11. package/dist/chunk-6D4GJHLK.mjs.map +1 -0
  12. package/dist/client/index.js +2 -2
  13. package/dist/client/index.mjs +1 -1
  14. package/dist/components/index.d.mts +1 -1
  15. package/dist/components/index.d.ts +1 -1
  16. package/dist/components/index.js +2 -2
  17. package/dist/components/index.mjs +1 -1
  18. package/dist/contexts/index.d.mts +1 -1
  19. package/dist/contexts/index.d.ts +1 -1
  20. package/dist/contexts/index.js +2 -2
  21. package/dist/contexts/index.mjs +1 -1
  22. package/dist/core/index.d.mts +2 -2
  23. package/dist/core/index.d.ts +2 -2
  24. package/dist/features/help/index.js +30 -30
  25. package/dist/features/help/index.mjs +1 -1
  26. package/dist/index.d.mts +1 -1
  27. package/dist/index.d.ts +1 -1
  28. package/package.json +1 -1
  29. package/src/components/navigations/Breadcrumb.tsx +31 -5
  30. package/src/hooks/useSocket.ts +12 -1
  31. package/src/interfaces/breadcrumb.item.data.interface.ts +1 -0
  32. package/dist/chunk-HXU2HDRN.js.map +0 -1
  33. package/dist/chunk-SVEPL5J2.mjs.map +0 -1
  34. /package/dist/{BlockNoteEditor-UQOOX3UT.mjs.map → BlockNoteEditor-K4T6QOJO.mjs.map} +0 -0
@@ -114,7 +114,18 @@ export function useSocket({ token }: UseSocketOptions): UseSocketReturn {
114
114
  };
115
115
 
116
116
  const handleNotification = (data: any) => {
117
- const notification = rehydrate(Modules.Notification, data) as NotificationInterface;
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];
@@ -1,4 +1,5 @@
1
1
  export type BreadcrumbItemData = {
2
2
  name: string;
3
3
  href?: string;
4
+ onClick?: () => void;
4
5
  };