@carlonicora/nextjs-jsonapi 1.71.0 → 1.73.0

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 (45) hide show
  1. package/dist/{BlockNoteEditor-NFMUHBKE.js → BlockNoteEditor-ETTYTXDX.js} +14 -14
  2. package/dist/{BlockNoteEditor-NFMUHBKE.js.map → BlockNoteEditor-ETTYTXDX.js.map} +1 -1
  3. package/dist/{BlockNoteEditor-JWTEY33V.mjs → BlockNoteEditor-MZ6G4XN4.mjs} +4 -4
  4. package/dist/billing/index.js +346 -346
  5. package/dist/billing/index.mjs +3 -3
  6. package/dist/{chunk-6ROMPIIP.js → chunk-5QTDS6V7.js} +11 -11
  7. package/dist/{chunk-6ROMPIIP.js.map → chunk-5QTDS6V7.js.map} +1 -1
  8. package/dist/{chunk-RSMG3K44.mjs → chunk-6O3YOOQM.mjs} +9 -7
  9. package/dist/chunk-6O3YOOQM.mjs.map +1 -0
  10. package/dist/{chunk-GZNHBAZF.mjs → chunk-73ANSE3J.mjs} +14 -1
  11. package/dist/chunk-73ANSE3J.mjs.map +1 -0
  12. package/dist/{chunk-WJYWWOTG.mjs → chunk-HP6AJBWE.mjs} +2 -2
  13. package/dist/{chunk-WBYS53RC.js → chunk-OPUWDWFH.js} +654 -652
  14. package/dist/chunk-OPUWDWFH.js.map +1 -0
  15. package/dist/{chunk-56VU7A4I.js → chunk-QLICTZL7.js} +14 -1
  16. package/dist/chunk-QLICTZL7.js.map +1 -0
  17. package/dist/client/index.js +4 -4
  18. package/dist/client/index.mjs +3 -3
  19. package/dist/components/index.d.mts +3 -1
  20. package/dist/components/index.d.ts +3 -1
  21. package/dist/components/index.js +4 -4
  22. package/dist/components/index.mjs +3 -3
  23. package/dist/contexts/index.d.mts +2 -0
  24. package/dist/contexts/index.d.ts +2 -0
  25. package/dist/contexts/index.js +4 -4
  26. package/dist/contexts/index.mjs +3 -3
  27. package/dist/core/index.d.mts +2 -0
  28. package/dist/core/index.d.ts +2 -0
  29. package/dist/core/index.js +2 -2
  30. package/dist/core/index.mjs +1 -1
  31. package/dist/index.js +3 -3
  32. package/dist/index.mjs +2 -2
  33. package/dist/server/index.js +3 -3
  34. package/dist/server/index.mjs +1 -1
  35. package/package.json +1 -1
  36. package/src/components/containers/RoundPageContainerTitle.tsx +1 -1
  37. package/src/components/forms/EditorSheet.tsx +12 -6
  38. package/src/contexts/SharedContext.tsx +2 -0
  39. package/src/core/registry/ModuleRegistry.ts +17 -0
  40. package/dist/chunk-56VU7A4I.js.map +0 -1
  41. package/dist/chunk-GZNHBAZF.mjs.map +0 -1
  42. package/dist/chunk-RSMG3K44.mjs.map +0 -1
  43. package/dist/chunk-WBYS53RC.js.map +0 -1
  44. /package/dist/{BlockNoteEditor-JWTEY33V.mjs.map → BlockNoteEditor-MZ6G4XN4.mjs.map} +0 -0
  45. /package/dist/{chunk-WJYWWOTG.mjs.map → chunk-HP6AJBWE.mjs.map} +0 -0
@@ -39,6 +39,8 @@ export type EditorSheetProps<T extends FieldValues> = {
39
39
 
40
40
  entityType: string;
41
41
  entityName?: string;
42
+ title?: string;
43
+ description?: string;
42
44
 
43
45
  isEdit: boolean;
44
46
  module: ModuleWithPermissions;
@@ -66,6 +68,8 @@ export function EditorSheet<T extends FieldValues>({
66
68
  isFormDirty: isFormDirtyProp,
67
69
  entityType,
68
70
  entityName,
71
+ title: titleOverride,
72
+ description: descriptionOverride,
69
73
  isEdit,
70
74
  module,
71
75
  propagateChanges,
@@ -153,14 +157,16 @@ export function EditorSheet<T extends FieldValues>({
153
157
  <SheetContent side="right" className={sizeClasses[size]}>
154
158
  <SheetHeader className="border-b px-6 py-4">
155
159
  <SheetTitle>
156
- {isEdit
157
- ? t("common.edit.update.title", { type: entityType })
158
- : t("common.edit.create.title", { type: entityType })}
160
+ {titleOverride ??
161
+ (isEdit
162
+ ? t("common.edit.update.title", { type: entityType })
163
+ : t("common.edit.create.title", { type: entityType }))}
159
164
  </SheetTitle>
160
165
  <SheetDescription>
161
- {isEdit
162
- ? t("common.edit.update.description", { type: entityType, name: entityName ?? "" })
163
- : t("common.edit.create.description", { type: entityType })}
166
+ {descriptionOverride ??
167
+ (isEdit
168
+ ? t("common.edit.update.description", { type: entityType, name: entityName ?? "" })
169
+ : t("common.edit.create.description", { type: entityType }))}
164
170
  </SheetDescription>
165
171
  </SheetHeader>
166
172
  <Form {...form}>
@@ -10,6 +10,7 @@ const SharedContext = createContext<{
10
10
  element?: string;
11
11
  functions?: ReactNode;
12
12
  prioritizeFunctions?: boolean;
13
+ icon?: ReactNode;
13
14
  };
14
15
  } | null>(null);
15
16
 
@@ -22,6 +23,7 @@ interface SharedProviderProps {
22
23
  element?: string;
23
24
  functions?: ReactNode;
24
25
  prioritizeFunctions?: boolean;
26
+ icon?: ReactNode;
25
27
  };
26
28
  };
27
29
  }
@@ -158,6 +158,19 @@ class ModuleRegistryClass {
158
158
  }
159
159
  return module as ModuleWithPermissions;
160
160
  }
161
+
162
+ findByFeature(feature: string): ModuleWithPermissions[] {
163
+ const response: ModuleWithPermissions[] = [];
164
+
165
+ for (const module of this._modules.values()) {
166
+ const m = module as ModuleWithPermissions;
167
+ if (m.feature === feature) {
168
+ response.push(m);
169
+ }
170
+ }
171
+
172
+ return response;
173
+ }
161
174
  }
162
175
 
163
176
  export const ModuleRegistry = new ModuleRegistryClass();
@@ -171,9 +184,13 @@ export const Modules = new Proxy({} as ModuleDefinitions, {
171
184
  if (prop === "findByModelName") {
172
185
  return (name: string) => ModuleRegistry.findByModelName(name);
173
186
  }
187
+ if (prop === "findByFeature") {
188
+ return (feature: string) => ModuleRegistry.findByFeature(feature);
189
+ }
174
190
  return ModuleRegistry.get(prop as keyof ModuleDefinitions);
175
191
  },
176
192
  }) as ModuleDefinitions & {
177
193
  findByName: (name: string) => ModuleWithPermissions;
178
194
  findByModelName: (name: string) => ModuleWithPermissions;
195
+ findByFeature: (feature: string) => ModuleWithPermissions[];
179
196
  };