@carlonicora/nextjs-jsonapi 0.0.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 (222) hide show
  1. package/README.md +889 -0
  2. package/dist/AbstractService-BKlpJA61.d.mts +109 -0
  3. package/dist/AbstractService-D9eSVKNa.d.ts +109 -0
  4. package/dist/ApiData-DPKNfY-9.d.mts +10 -0
  5. package/dist/ApiData-DPKNfY-9.d.ts +10 -0
  6. package/dist/ApiDataInterface-DPP8s46n.d.mts +21 -0
  7. package/dist/ApiDataInterface-DPP8s46n.d.ts +21 -0
  8. package/dist/ApiRequestDataTypeInterface-CUKFDBx2.d.mts +20 -0
  9. package/dist/ApiRequestDataTypeInterface-CUKFDBx2.d.ts +20 -0
  10. package/dist/ApiResponseInterface-BHN5D9r5.d.mts +16 -0
  11. package/dist/ApiResponseInterface-DDI7QQPR.d.ts +16 -0
  12. package/dist/BlockNoteEditor-UVO3VZZE.mjs +396 -0
  13. package/dist/BlockNoteEditor-UVO3VZZE.mjs.map +1 -0
  14. package/dist/BlockNoteEditor-VFWG6LXI.js +396 -0
  15. package/dist/BlockNoteEditor-VFWG6LXI.js.map +1 -0
  16. package/dist/JsonApiRequest-S3ICLM7B.mjs +20 -0
  17. package/dist/JsonApiRequest-S3ICLM7B.mjs.map +1 -0
  18. package/dist/JsonApiRequest-ZZLSP26T.js +20 -0
  19. package/dist/JsonApiRequest-ZZLSP26T.js.map +1 -0
  20. package/dist/atoms/index.d.mts +12 -0
  21. package/dist/atoms/index.d.ts +12 -0
  22. package/dist/atoms/index.js +9 -0
  23. package/dist/atoms/index.js.map +1 -0
  24. package/dist/atoms/index.mjs +9 -0
  25. package/dist/atoms/index.mjs.map +1 -0
  26. package/dist/breadcrumb.item.data.interface-CgB4_1EE.d.mts +6 -0
  27. package/dist/breadcrumb.item.data.interface-CgB4_1EE.d.ts +6 -0
  28. package/dist/chunk-2K3Q24UF.js +89 -0
  29. package/dist/chunk-2K3Q24UF.js.map +1 -0
  30. package/dist/chunk-2LM6LCJW.mjs +1091 -0
  31. package/dist/chunk-2LM6LCJW.mjs.map +1 -0
  32. package/dist/chunk-366S2JCC.mjs +31 -0
  33. package/dist/chunk-366S2JCC.mjs.map +1 -0
  34. package/dist/chunk-3FBCC4G3.js +8 -0
  35. package/dist/chunk-3FBCC4G3.js.map +1 -0
  36. package/dist/chunk-4HCRAOS5.js +28 -0
  37. package/dist/chunk-4HCRAOS5.js.map +1 -0
  38. package/dist/chunk-5W6AKZE6.mjs +131 -0
  39. package/dist/chunk-5W6AKZE6.mjs.map +1 -0
  40. package/dist/chunk-6GKHCVF6.js +98 -0
  41. package/dist/chunk-6GKHCVF6.js.map +1 -0
  42. package/dist/chunk-7QVYU63E.js +7 -0
  43. package/dist/chunk-7QVYU63E.js.map +1 -0
  44. package/dist/chunk-A3J3AAYM.mjs +97 -0
  45. package/dist/chunk-A3J3AAYM.mjs.map +1 -0
  46. package/dist/chunk-A5DDIABK.js +4209 -0
  47. package/dist/chunk-A5DDIABK.js.map +1 -0
  48. package/dist/chunk-AUXK7QSA.mjs +15 -0
  49. package/dist/chunk-AUXK7QSA.mjs.map +1 -0
  50. package/dist/chunk-AWONBQQP.js +97 -0
  51. package/dist/chunk-AWONBQQP.js.map +1 -0
  52. package/dist/chunk-BLWVZK6J.mjs +28 -0
  53. package/dist/chunk-BLWVZK6J.mjs.map +1 -0
  54. package/dist/chunk-C7C7VY4F.mjs +77 -0
  55. package/dist/chunk-C7C7VY4F.mjs.map +1 -0
  56. package/dist/chunk-CXQOWQSY.js +55 -0
  57. package/dist/chunk-CXQOWQSY.js.map +1 -0
  58. package/dist/chunk-DD3KISNB.mjs +98 -0
  59. package/dist/chunk-DD3KISNB.mjs.map +1 -0
  60. package/dist/chunk-DKKMWBP4.mjs +1 -0
  61. package/dist/chunk-DKKMWBP4.mjs.map +1 -0
  62. package/dist/chunk-DO2HLAZO.js +48 -0
  63. package/dist/chunk-DO2HLAZO.js.map +1 -0
  64. package/dist/chunk-DZXDB3K2.mjs +17 -0
  65. package/dist/chunk-DZXDB3K2.mjs.map +1 -0
  66. package/dist/chunk-ECDTZBYO.mjs +230 -0
  67. package/dist/chunk-ECDTZBYO.mjs.map +1 -0
  68. package/dist/chunk-EFJEWLRL.js +16 -0
  69. package/dist/chunk-EFJEWLRL.js.map +1 -0
  70. package/dist/chunk-FY4SXJGU.js +806 -0
  71. package/dist/chunk-FY4SXJGU.js.map +1 -0
  72. package/dist/chunk-GYWPEPOH.mjs +1354 -0
  73. package/dist/chunk-GYWPEPOH.mjs.map +1 -0
  74. package/dist/chunk-H6FMOA6B.js +1 -0
  75. package/dist/chunk-H6FMOA6B.js.map +1 -0
  76. package/dist/chunk-HR4H2FP7.mjs +89 -0
  77. package/dist/chunk-HR4H2FP7.mjs.map +1 -0
  78. package/dist/chunk-I2REI7OA.js +462 -0
  79. package/dist/chunk-I2REI7OA.js.map +1 -0
  80. package/dist/chunk-IBS6NI7D.js +77 -0
  81. package/dist/chunk-IBS6NI7D.js.map +1 -0
  82. package/dist/chunk-IWFGEPAA.mjs +4209 -0
  83. package/dist/chunk-IWFGEPAA.mjs.map +1 -0
  84. package/dist/chunk-J4Q36PMP.js +31 -0
  85. package/dist/chunk-J4Q36PMP.js.map +1 -0
  86. package/dist/chunk-JC3WJK65.js +1091 -0
  87. package/dist/chunk-JC3WJK65.js.map +1 -0
  88. package/dist/chunk-L6EQEAXU.mjs +462 -0
  89. package/dist/chunk-L6EQEAXU.mjs.map +1 -0
  90. package/dist/chunk-LXKSUWAV.js +15 -0
  91. package/dist/chunk-LXKSUWAV.js.map +1 -0
  92. package/dist/chunk-MFO27OHB.mjs +48 -0
  93. package/dist/chunk-MFO27OHB.mjs.map +1 -0
  94. package/dist/chunk-PAWJFY3S.mjs +7 -0
  95. package/dist/chunk-PAWJFY3S.mjs.map +1 -0
  96. package/dist/chunk-Q2N6SQYW.mjs +8 -0
  97. package/dist/chunk-Q2N6SQYW.mjs.map +1 -0
  98. package/dist/chunk-RAF7PNLG.js +131 -0
  99. package/dist/chunk-RAF7PNLG.js.map +1 -0
  100. package/dist/chunk-RUR22SVM.js +17 -0
  101. package/dist/chunk-RUR22SVM.js.map +1 -0
  102. package/dist/chunk-TEGF6ZWG.js +109 -0
  103. package/dist/chunk-TEGF6ZWG.js.map +1 -0
  104. package/dist/chunk-TMVHSY3Y.js +230 -0
  105. package/dist/chunk-TMVHSY3Y.js.map +1 -0
  106. package/dist/chunk-V2JJPI7N.js +1354 -0
  107. package/dist/chunk-V2JJPI7N.js.map +1 -0
  108. package/dist/chunk-WWWMJZEF.mjs +806 -0
  109. package/dist/chunk-WWWMJZEF.mjs.map +1 -0
  110. package/dist/chunk-X4BIHJ2B.mjs +55 -0
  111. package/dist/chunk-X4BIHJ2B.mjs.map +1 -0
  112. package/dist/chunk-YDVTFM7X.mjs +109 -0
  113. package/dist/chunk-YDVTFM7X.mjs.map +1 -0
  114. package/dist/chunk-YF5XQZDR.mjs +16 -0
  115. package/dist/chunk-YF5XQZDR.mjs.map +1 -0
  116. package/dist/client/index.d.mts +252 -0
  117. package/dist/client/index.d.ts +252 -0
  118. package/dist/client/index.js +275 -0
  119. package/dist/client/index.js.map +1 -0
  120. package/dist/client/index.mjs +274 -0
  121. package/dist/client/index.mjs.map +1 -0
  122. package/dist/components/index.d.mts +441 -0
  123. package/dist/components/index.d.ts +441 -0
  124. package/dist/components/index.js +2474 -0
  125. package/dist/components/index.js.map +1 -0
  126. package/dist/components/index.mjs +2474 -0
  127. package/dist/components/index.mjs.map +1 -0
  128. package/dist/config-hXufftVS.d.mts +34 -0
  129. package/dist/config-hXufftVS.d.ts +34 -0
  130. package/dist/content.interface-BhyAiOFq.d.ts +35 -0
  131. package/dist/content.interface-Dg2lt_An.d.mts +35 -0
  132. package/dist/contexts/index.d.mts +56 -0
  133. package/dist/contexts/index.d.ts +56 -0
  134. package/dist/contexts/index.js +21 -0
  135. package/dist/contexts/index.js.map +1 -0
  136. package/dist/contexts/index.mjs +21 -0
  137. package/dist/contexts/index.mjs.map +1 -0
  138. package/dist/core/index.d.mts +152 -0
  139. package/dist/core/index.d.ts +152 -0
  140. package/dist/core/index.js +47 -0
  141. package/dist/core/index.js.map +1 -0
  142. package/dist/core/index.mjs +47 -0
  143. package/dist/core/index.mjs.map +1 -0
  144. package/dist/d3.link.interface-QMdB22bC.d.mts +20 -0
  145. package/dist/d3.link.interface-QMdB22bC.d.ts +20 -0
  146. package/dist/features/index.d.mts +553 -0
  147. package/dist/features/index.d.ts +553 -0
  148. package/dist/features/index.js +94 -0
  149. package/dist/features/index.js.map +1 -0
  150. package/dist/features/index.mjs +94 -0
  151. package/dist/features/index.mjs.map +1 -0
  152. package/dist/hooks/index.d.mts +94 -0
  153. package/dist/hooks/index.d.ts +94 -0
  154. package/dist/hooks/index.js +43 -0
  155. package/dist/hooks/index.js.map +1 -0
  156. package/dist/hooks/index.mjs +43 -0
  157. package/dist/hooks/index.mjs.map +1 -0
  158. package/dist/index.d.mts +72 -0
  159. package/dist/index.d.ts +72 -0
  160. package/dist/index.js +84 -0
  161. package/dist/index.js.map +1 -0
  162. package/dist/index.mjs +84 -0
  163. package/dist/index.mjs.map +1 -0
  164. package/dist/interfaces/index.d.mts +3 -0
  165. package/dist/interfaces/index.d.ts +3 -0
  166. package/dist/interfaces/index.js +2 -0
  167. package/dist/interfaces/index.js.map +1 -0
  168. package/dist/interfaces/index.mjs +2 -0
  169. package/dist/interfaces/index.mjs.map +1 -0
  170. package/dist/permissions/index.d.mts +41 -0
  171. package/dist/permissions/index.d.ts +41 -0
  172. package/dist/permissions/index.js +14 -0
  173. package/dist/permissions/index.js.map +1 -0
  174. package/dist/permissions/index.mjs +14 -0
  175. package/dist/permissions/index.mjs.map +1 -0
  176. package/dist/request-7FE3LJLV.mjs +9 -0
  177. package/dist/request-7FE3LJLV.mjs.map +1 -0
  178. package/dist/request-FYMQK5CX.mjs +9 -0
  179. package/dist/request-FYMQK5CX.mjs.map +1 -0
  180. package/dist/request-QFS7NEIE.js +9 -0
  181. package/dist/request-QFS7NEIE.js.map +1 -0
  182. package/dist/request-ZYY6RI5X.js +9 -0
  183. package/dist/request-ZYY6RI5X.js.map +1 -0
  184. package/dist/roles/index.d.mts +33 -0
  185. package/dist/roles/index.d.ts +33 -0
  186. package/dist/roles/index.js +12 -0
  187. package/dist/roles/index.js.map +1 -0
  188. package/dist/roles/index.mjs +12 -0
  189. package/dist/roles/index.mjs.map +1 -0
  190. package/dist/server/index.d.mts +44 -0
  191. package/dist/server/index.d.ts +44 -0
  192. package/dist/server/index.js +29 -0
  193. package/dist/server/index.js.map +1 -0
  194. package/dist/server/index.mjs +29 -0
  195. package/dist/server/index.mjs.map +1 -0
  196. package/dist/shadcnui/index.d.mts +698 -0
  197. package/dist/shadcnui/index.d.ts +698 -0
  198. package/dist/shadcnui/index.js +466 -0
  199. package/dist/shadcnui/index.js.map +1 -0
  200. package/dist/shadcnui/index.mjs +465 -0
  201. package/dist/shadcnui/index.mjs.map +1 -0
  202. package/dist/token-IJSPOMW6.mjs +9 -0
  203. package/dist/token-IJSPOMW6.mjs.map +1 -0
  204. package/dist/token-MJMC26ON.js +9 -0
  205. package/dist/token-MJMC26ON.js.map +1 -0
  206. package/dist/token-UADJQ7VC.mjs +9 -0
  207. package/dist/token-UADJQ7VC.mjs.map +1 -0
  208. package/dist/token-UYE7CV6X.js +9 -0
  209. package/dist/token-UYE7CV6X.js.map +1 -0
  210. package/dist/types-DluCaP1I.d.ts +95 -0
  211. package/dist/types-lQVA8d_P.d.mts +95 -0
  212. package/dist/useDataListRetriever-futhx3OP.d.mts +32 -0
  213. package/dist/useDataListRetriever-futhx3OP.d.ts +32 -0
  214. package/dist/user.interface-CAsTIbuQ.d.mts +85 -0
  215. package/dist/user.interface-CbWqMaaU.d.ts +85 -0
  216. package/dist/utils/index.d.mts +201 -0
  217. package/dist/utils/index.d.ts +201 -0
  218. package/dist/utils/index.js +32 -0
  219. package/dist/utils/index.js.map +1 -0
  220. package/dist/utils/index.mjs +32 -0
  221. package/dist/utils/index.mjs.map +1 -0
  222. package/package.json +205 -0
@@ -0,0 +1,32 @@
1
+ type PageInfo = {
2
+ startItem: number;
3
+ endItem: number;
4
+ pageSize: number;
5
+ };
6
+ type DataListRetriever<T> = {
7
+ ready?: boolean;
8
+ setReady: (state: boolean) => void;
9
+ isLoaded: boolean;
10
+ data: T[] | undefined;
11
+ next?: (onlyNewRecords?: boolean) => Promise<void>;
12
+ previous?: (onlyNewRecords?: boolean) => Promise<void>;
13
+ search: (search: string) => Promise<void>;
14
+ refresh: () => Promise<void>;
15
+ addAdditionalParameter: (key: string, value: any | null) => void;
16
+ removeAdditionalParameter: (key: string) => void;
17
+ setRefreshedElement: (element: T) => void;
18
+ removeElement: (element: T) => void;
19
+ isSearch: boolean;
20
+ pageInfo?: PageInfo;
21
+ };
22
+ declare function useDataListRetriever<T>(params: {
23
+ ready?: boolean;
24
+ retriever: (params: any) => Promise<T[]>;
25
+ retrieverParams?: any;
26
+ search?: string;
27
+ addAdditionalParameter?: (key: string, value: any | null) => void;
28
+ requiresSearch?: boolean;
29
+ module: any;
30
+ }): DataListRetriever<T>;
31
+
32
+ export { type DataListRetriever as D, useDataListRetriever as u };
@@ -0,0 +1,32 @@
1
+ type PageInfo = {
2
+ startItem: number;
3
+ endItem: number;
4
+ pageSize: number;
5
+ };
6
+ type DataListRetriever<T> = {
7
+ ready?: boolean;
8
+ setReady: (state: boolean) => void;
9
+ isLoaded: boolean;
10
+ data: T[] | undefined;
11
+ next?: (onlyNewRecords?: boolean) => Promise<void>;
12
+ previous?: (onlyNewRecords?: boolean) => Promise<void>;
13
+ search: (search: string) => Promise<void>;
14
+ refresh: () => Promise<void>;
15
+ addAdditionalParameter: (key: string, value: any | null) => void;
16
+ removeAdditionalParameter: (key: string) => void;
17
+ setRefreshedElement: (element: T) => void;
18
+ removeElement: (element: T) => void;
19
+ isSearch: boolean;
20
+ pageInfo?: PageInfo;
21
+ };
22
+ declare function useDataListRetriever<T>(params: {
23
+ ready?: boolean;
24
+ retriever: (params: any) => Promise<T[]>;
25
+ retrieverParams?: any;
26
+ search?: string;
27
+ addAdditionalParameter?: (key: string, value: any | null) => void;
28
+ requiresSearch?: boolean;
29
+ module: any;
30
+ }): DataListRetriever<T>;
31
+
32
+ export { type DataListRetriever as D, useDataListRetriever as u };
@@ -0,0 +1,85 @@
1
+ import { A as ApiDataInterface } from './ApiDataInterface-DPP8s46n.mjs';
2
+
3
+ interface ModuleInterface extends ApiDataInterface {
4
+ get name(): string;
5
+ get isCore(): boolean;
6
+ get permissions(): {
7
+ create: boolean | string;
8
+ read: boolean | string;
9
+ update: boolean | string;
10
+ delete: boolean | string;
11
+ };
12
+ }
13
+
14
+ interface FeatureInterface extends ApiDataInterface {
15
+ get name(): string;
16
+ get isProduction(): boolean;
17
+ get modules(): ModuleInterface[];
18
+ }
19
+
20
+ type CompanyInput = {
21
+ id: string;
22
+ name?: string;
23
+ logo?: string;
24
+ configurations?: any;
25
+ license?: string;
26
+ privateKey?: string;
27
+ featureIds?: string[];
28
+ moduleIds?: string[];
29
+ };
30
+ interface CompanyInterface extends ApiDataInterface {
31
+ get name(): string;
32
+ get configurations(): any;
33
+ get logo(): string | undefined;
34
+ get logoUrl(): string | undefined;
35
+ get licenseExpirationDate(): Date | undefined;
36
+ get features(): FeatureInterface[];
37
+ get modules(): ModuleInterface[];
38
+ }
39
+
40
+ type RoleInput = {
41
+ id: string;
42
+ name: string;
43
+ description?: string;
44
+ };
45
+ interface RoleInterface extends ApiDataInterface {
46
+ get name(): string;
47
+ get description(): string;
48
+ get isSelectable(): boolean;
49
+ get requiredFeature(): FeatureInterface | undefined;
50
+ }
51
+
52
+ type UserInput = {
53
+ id: string;
54
+ email?: string | undefined | null;
55
+ name?: string;
56
+ title?: string;
57
+ bio?: string;
58
+ password?: string | undefined;
59
+ roleIds?: string[];
60
+ sendInvitationEmail?: boolean;
61
+ companyId?: string;
62
+ adminCreated?: boolean;
63
+ avatar?: string;
64
+ phone?: string;
65
+ rate?: number;
66
+ };
67
+ interface UserInterface extends ApiDataInterface {
68
+ get email(): string;
69
+ get name(): string;
70
+ get title(): string;
71
+ get bio(): string;
72
+ get avatar(): string | undefined;
73
+ get avatarUrl(): string | undefined;
74
+ get phone(): string | undefined;
75
+ get rate(): number | undefined;
76
+ get isActivated(): boolean;
77
+ get isDeleted(): boolean;
78
+ get lastLogin(): Date | undefined;
79
+ get relevance(): number | undefined;
80
+ get roles(): RoleInterface[];
81
+ get company(): CompanyInterface | undefined;
82
+ get modules(): ModuleInterface[];
83
+ }
84
+
85
+ export type { CompanyInterface as C, FeatureInterface as F, ModuleInterface as M, RoleInterface as R, UserInterface as U, CompanyInput as a, RoleInput as b, UserInput as c };
@@ -0,0 +1,85 @@
1
+ import { A as ApiDataInterface } from './ApiDataInterface-DPP8s46n.js';
2
+
3
+ interface ModuleInterface extends ApiDataInterface {
4
+ get name(): string;
5
+ get isCore(): boolean;
6
+ get permissions(): {
7
+ create: boolean | string;
8
+ read: boolean | string;
9
+ update: boolean | string;
10
+ delete: boolean | string;
11
+ };
12
+ }
13
+
14
+ interface FeatureInterface extends ApiDataInterface {
15
+ get name(): string;
16
+ get isProduction(): boolean;
17
+ get modules(): ModuleInterface[];
18
+ }
19
+
20
+ type CompanyInput = {
21
+ id: string;
22
+ name?: string;
23
+ logo?: string;
24
+ configurations?: any;
25
+ license?: string;
26
+ privateKey?: string;
27
+ featureIds?: string[];
28
+ moduleIds?: string[];
29
+ };
30
+ interface CompanyInterface extends ApiDataInterface {
31
+ get name(): string;
32
+ get configurations(): any;
33
+ get logo(): string | undefined;
34
+ get logoUrl(): string | undefined;
35
+ get licenseExpirationDate(): Date | undefined;
36
+ get features(): FeatureInterface[];
37
+ get modules(): ModuleInterface[];
38
+ }
39
+
40
+ type RoleInput = {
41
+ id: string;
42
+ name: string;
43
+ description?: string;
44
+ };
45
+ interface RoleInterface extends ApiDataInterface {
46
+ get name(): string;
47
+ get description(): string;
48
+ get isSelectable(): boolean;
49
+ get requiredFeature(): FeatureInterface | undefined;
50
+ }
51
+
52
+ type UserInput = {
53
+ id: string;
54
+ email?: string | undefined | null;
55
+ name?: string;
56
+ title?: string;
57
+ bio?: string;
58
+ password?: string | undefined;
59
+ roleIds?: string[];
60
+ sendInvitationEmail?: boolean;
61
+ companyId?: string;
62
+ adminCreated?: boolean;
63
+ avatar?: string;
64
+ phone?: string;
65
+ rate?: number;
66
+ };
67
+ interface UserInterface extends ApiDataInterface {
68
+ get email(): string;
69
+ get name(): string;
70
+ get title(): string;
71
+ get bio(): string;
72
+ get avatar(): string | undefined;
73
+ get avatarUrl(): string | undefined;
74
+ get phone(): string | undefined;
75
+ get rate(): number | undefined;
76
+ get isActivated(): boolean;
77
+ get isDeleted(): boolean;
78
+ get lastLogin(): Date | undefined;
79
+ get relevance(): number | undefined;
80
+ get roles(): RoleInterface[];
81
+ get company(): CompanyInterface | undefined;
82
+ get modules(): ModuleInterface[];
83
+ }
84
+
85
+ export type { CompanyInterface as C, FeatureInterface as F, ModuleInterface as M, RoleInterface as R, UserInterface as U, CompanyInput as a, RoleInput as b, UserInput as c };
@@ -0,0 +1,201 @@
1
+ import { ClassValue } from 'clsx';
2
+ export { ClassValue } from 'clsx';
3
+ import * as React from 'react';
4
+ import { ReactElement } from 'react';
5
+ import { f as ModuleWithPermissions, A as Action } from '../types-lQVA8d_P.mjs';
6
+ import { z } from 'zod';
7
+ import { PartialBlock } from '@blocknote/core';
8
+ import '../ApiRequestDataTypeInterface-CUKFDBx2.mjs';
9
+
10
+ declare function cn(...inputs: ClassValue[]): string;
11
+
12
+ type PossibleRef<T> = React.Ref<T> | undefined;
13
+ /**
14
+ * A utility to compose multiple refs together
15
+ * Accepts callback refs and RefObject(s)
16
+ */
17
+ declare function composeRefs<T>(...refs: PossibleRef<T>[]): React.RefCallback<T>;
18
+ /**
19
+ * A custom hook that composes multiple refs
20
+ * Accepts callback refs and RefObject(s)
21
+ */
22
+ declare function useComposedRefs<T>(...refs: PossibleRef<T>[]): React.RefCallback<T>;
23
+
24
+ declare function useIsMobile(): boolean;
25
+
26
+ type FormatOption = "date" | "time" | "dateTime" | "timeSince" | "default";
27
+ declare const formatDate: (eventDate: Date, formatOption: FormatOption) => string;
28
+
29
+ declare const exists: <T>(itemOrArray: T | T[] | null | undefined) => boolean;
30
+
31
+ declare class TableOptions {
32
+ private _components;
33
+ private _hasPermissionToModule;
34
+ constructor(hasPermissionToModule: <M extends ModuleWithPermissions>(params: {
35
+ module: M;
36
+ action: Action;
37
+ data?: any;
38
+ }) => boolean);
39
+ addOption<M extends ModuleWithPermissions>(component: ReactElement<any> | null, module?: M, action?: Action): void;
40
+ getComponents(): ReactElement<any>[];
41
+ getOptions(): ReactElement<any> | null;
42
+ }
43
+ declare function getTableOptions(params: {
44
+ hasPermissionToModule: <M extends ModuleWithPermissions>(params: {
45
+ module: M;
46
+ action: Action;
47
+ data?: any;
48
+ }) => boolean;
49
+ options: {
50
+ component: ReactElement<any> | null;
51
+ module?: ModuleWithPermissions;
52
+ action?: Action;
53
+ }[];
54
+ }): ReactElement<any> | null;
55
+ declare function getTableComponents(params: {
56
+ hasPermissionToModule: <M extends ModuleWithPermissions>(params: {
57
+ module: M;
58
+ action: Action;
59
+ data?: any;
60
+ }) => boolean;
61
+ options: {
62
+ component: ReactElement<any> | null;
63
+ module?: ModuleWithPermissions;
64
+ action?: Action;
65
+ }[];
66
+ }): ReactElement<any>[];
67
+
68
+ declare const userObjectSchema: z.ZodObject<{
69
+ id: z.ZodString;
70
+ name: z.ZodString;
71
+ avatar: z.ZodOptional<z.ZodString>;
72
+ }, z.core.$strip>;
73
+ type UserObject = z.infer<typeof userObjectSchema>;
74
+
75
+ declare const entityObjectSchema: z.ZodObject<{
76
+ id: z.ZodUUID;
77
+ name: z.ZodString;
78
+ }, z.core.$strip>;
79
+ type EntityObject = z.infer<typeof entityObjectSchema>;
80
+
81
+ interface WordDiff {
82
+ type: "added" | "removed" | "unchanged";
83
+ text: string;
84
+ diffId: string;
85
+ accepted?: boolean;
86
+ rejected?: boolean;
87
+ }
88
+ interface DiffBlock {
89
+ id?: string;
90
+ type?: string;
91
+ props?: any;
92
+ content?: any;
93
+ children?: DiffBlock[];
94
+ diffType?: "added" | "removed" | "modified" | "unchanged";
95
+ originalContent?: any;
96
+ diffId?: string;
97
+ wordDiffs?: WordDiff[];
98
+ accepted?: boolean;
99
+ rejected?: boolean;
100
+ }
101
+ interface DiffResult {
102
+ blocks: DiffBlock[];
103
+ hasChanges: boolean;
104
+ }
105
+ interface BlockDiffOptions {
106
+ ignoreIds?: boolean;
107
+ compareContent?: boolean;
108
+ similarityThreshold?: number;
109
+ }
110
+ /**
111
+ * BlockNote Diff Utility
112
+ * Implements a sophisticated diff algorithm for BlockNote document structures
113
+ */
114
+ declare class BlockNoteDiffUtil {
115
+ private static readonly DEFAULT_OPTIONS;
116
+ /**
117
+ * Compare two BlockNote documents and return diff result
118
+ */
119
+ static diff(originalBlocks?: PartialBlock[], newBlocks?: PartialBlock[], options?: BlockDiffOptions): DiffResult;
120
+ /**
121
+ * Compare two blocks for equality
122
+ */
123
+ private static areBlocksEqual;
124
+ /**
125
+ * Deep equality comparison for objects
126
+ */
127
+ private static deepEqual;
128
+ /**
129
+ * Sort diff blocks to maintain logical order
130
+ */
131
+ private static sortDiffBlocks;
132
+ /**
133
+ * Calculate similarity between two text contents
134
+ */
135
+ private static calculateSimilarity;
136
+ /**
137
+ * Extract plain text from BlockNote content array
138
+ */
139
+ private static extractTextFromContent;
140
+ /**
141
+ * Calculate Levenshtein distance between two strings
142
+ */
143
+ private static levenshteinDistance;
144
+ /**
145
+ * Generate word-level diffs between two content arrays
146
+ */
147
+ static generateWordDiffs(originalContent: any, newContent: any, blockId: string): WordDiff[];
148
+ /**
149
+ * Perform word-level diff using word-only approach (no space tokenization)
150
+ */
151
+ private static diffWords; /**
152
+ * Improved diff algorithm that better handles word insertions
153
+ * Uses a combination of LCS and heuristics to minimize false changes
154
+ */
155
+ private static myersDiff;
156
+ /**
157
+ * Compute edit script using dynamic programming
158
+ */
159
+ private static computeEditScript;
160
+ /**
161
+ * Reconstruct the actual diff from the DP table
162
+ */
163
+ private static reconstructDiff;
164
+ /**
165
+ * Consolidate adjacent changes to reduce fragmentation
166
+ * e.g., if we have: delete "Key", insert "Key!", delete "Challenges"
167
+ * We can consolidate this into: replace ["Key", "Challenges"] with ["Key!"]
168
+ */
169
+ private static consolidateAdjacentChanges;
170
+ /**
171
+ * Determine if a sequence of changes should be consolidated
172
+ */
173
+ private static shouldConsolidateChanges;
174
+ /**
175
+ * Check if two words are similar enough to be considered a replacement
176
+ */
177
+ private static areWordsSimilar;
178
+ }
179
+
180
+ declare class BlockNoteWordDiffRendererUtil {
181
+ static renderWordDiffs(diffBlocks: DiffBlock[], onAcceptChange?: (diffId: string) => void, onRejectChange?: (diffId: string) => void, acceptedChanges?: Set<string>, rejectedChanges?: Set<string>): PartialBlock[];
182
+ private static updateWordDiffStates;
183
+ private static renderDiffBlock;
184
+ private static renderBlockLevelDiff;
185
+ private static renderWordLevelDiff;
186
+ private static groupAndRenderWordDiffs;
187
+ private static cleanupSpaces;
188
+ private static isLastDiffInGroup;
189
+ private static createTextContent;
190
+ private static getBlockProps;
191
+ static generateChangeSummary(diffBlocks: DiffBlock[]): {
192
+ totalWords: number;
193
+ addedWords: number;
194
+ removedWords: number;
195
+ acceptedChanges: number;
196
+ rejectedChanges: number;
197
+ pendingChanges: number;
198
+ };
199
+ }
200
+
201
+ export { type BlockDiffOptions, BlockNoteDiffUtil, BlockNoteWordDiffRendererUtil, type DiffBlock, type DiffResult, type EntityObject, type FormatOption, TableOptions, type UserObject, type WordDiff, cn, composeRefs, entityObjectSchema, exists, formatDate, getTableComponents, getTableOptions, useComposedRefs, useIsMobile, userObjectSchema };
@@ -0,0 +1,201 @@
1
+ import { ClassValue } from 'clsx';
2
+ export { ClassValue } from 'clsx';
3
+ import * as React from 'react';
4
+ import { ReactElement } from 'react';
5
+ import { f as ModuleWithPermissions, A as Action } from '../types-DluCaP1I.js';
6
+ import { z } from 'zod';
7
+ import { PartialBlock } from '@blocknote/core';
8
+ import '../ApiRequestDataTypeInterface-CUKFDBx2.js';
9
+
10
+ declare function cn(...inputs: ClassValue[]): string;
11
+
12
+ type PossibleRef<T> = React.Ref<T> | undefined;
13
+ /**
14
+ * A utility to compose multiple refs together
15
+ * Accepts callback refs and RefObject(s)
16
+ */
17
+ declare function composeRefs<T>(...refs: PossibleRef<T>[]): React.RefCallback<T>;
18
+ /**
19
+ * A custom hook that composes multiple refs
20
+ * Accepts callback refs and RefObject(s)
21
+ */
22
+ declare function useComposedRefs<T>(...refs: PossibleRef<T>[]): React.RefCallback<T>;
23
+
24
+ declare function useIsMobile(): boolean;
25
+
26
+ type FormatOption = "date" | "time" | "dateTime" | "timeSince" | "default";
27
+ declare const formatDate: (eventDate: Date, formatOption: FormatOption) => string;
28
+
29
+ declare const exists: <T>(itemOrArray: T | T[] | null | undefined) => boolean;
30
+
31
+ declare class TableOptions {
32
+ private _components;
33
+ private _hasPermissionToModule;
34
+ constructor(hasPermissionToModule: <M extends ModuleWithPermissions>(params: {
35
+ module: M;
36
+ action: Action;
37
+ data?: any;
38
+ }) => boolean);
39
+ addOption<M extends ModuleWithPermissions>(component: ReactElement<any> | null, module?: M, action?: Action): void;
40
+ getComponents(): ReactElement<any>[];
41
+ getOptions(): ReactElement<any> | null;
42
+ }
43
+ declare function getTableOptions(params: {
44
+ hasPermissionToModule: <M extends ModuleWithPermissions>(params: {
45
+ module: M;
46
+ action: Action;
47
+ data?: any;
48
+ }) => boolean;
49
+ options: {
50
+ component: ReactElement<any> | null;
51
+ module?: ModuleWithPermissions;
52
+ action?: Action;
53
+ }[];
54
+ }): ReactElement<any> | null;
55
+ declare function getTableComponents(params: {
56
+ hasPermissionToModule: <M extends ModuleWithPermissions>(params: {
57
+ module: M;
58
+ action: Action;
59
+ data?: any;
60
+ }) => boolean;
61
+ options: {
62
+ component: ReactElement<any> | null;
63
+ module?: ModuleWithPermissions;
64
+ action?: Action;
65
+ }[];
66
+ }): ReactElement<any>[];
67
+
68
+ declare const userObjectSchema: z.ZodObject<{
69
+ id: z.ZodString;
70
+ name: z.ZodString;
71
+ avatar: z.ZodOptional<z.ZodString>;
72
+ }, z.core.$strip>;
73
+ type UserObject = z.infer<typeof userObjectSchema>;
74
+
75
+ declare const entityObjectSchema: z.ZodObject<{
76
+ id: z.ZodUUID;
77
+ name: z.ZodString;
78
+ }, z.core.$strip>;
79
+ type EntityObject = z.infer<typeof entityObjectSchema>;
80
+
81
+ interface WordDiff {
82
+ type: "added" | "removed" | "unchanged";
83
+ text: string;
84
+ diffId: string;
85
+ accepted?: boolean;
86
+ rejected?: boolean;
87
+ }
88
+ interface DiffBlock {
89
+ id?: string;
90
+ type?: string;
91
+ props?: any;
92
+ content?: any;
93
+ children?: DiffBlock[];
94
+ diffType?: "added" | "removed" | "modified" | "unchanged";
95
+ originalContent?: any;
96
+ diffId?: string;
97
+ wordDiffs?: WordDiff[];
98
+ accepted?: boolean;
99
+ rejected?: boolean;
100
+ }
101
+ interface DiffResult {
102
+ blocks: DiffBlock[];
103
+ hasChanges: boolean;
104
+ }
105
+ interface BlockDiffOptions {
106
+ ignoreIds?: boolean;
107
+ compareContent?: boolean;
108
+ similarityThreshold?: number;
109
+ }
110
+ /**
111
+ * BlockNote Diff Utility
112
+ * Implements a sophisticated diff algorithm for BlockNote document structures
113
+ */
114
+ declare class BlockNoteDiffUtil {
115
+ private static readonly DEFAULT_OPTIONS;
116
+ /**
117
+ * Compare two BlockNote documents and return diff result
118
+ */
119
+ static diff(originalBlocks?: PartialBlock[], newBlocks?: PartialBlock[], options?: BlockDiffOptions): DiffResult;
120
+ /**
121
+ * Compare two blocks for equality
122
+ */
123
+ private static areBlocksEqual;
124
+ /**
125
+ * Deep equality comparison for objects
126
+ */
127
+ private static deepEqual;
128
+ /**
129
+ * Sort diff blocks to maintain logical order
130
+ */
131
+ private static sortDiffBlocks;
132
+ /**
133
+ * Calculate similarity between two text contents
134
+ */
135
+ private static calculateSimilarity;
136
+ /**
137
+ * Extract plain text from BlockNote content array
138
+ */
139
+ private static extractTextFromContent;
140
+ /**
141
+ * Calculate Levenshtein distance between two strings
142
+ */
143
+ private static levenshteinDistance;
144
+ /**
145
+ * Generate word-level diffs between two content arrays
146
+ */
147
+ static generateWordDiffs(originalContent: any, newContent: any, blockId: string): WordDiff[];
148
+ /**
149
+ * Perform word-level diff using word-only approach (no space tokenization)
150
+ */
151
+ private static diffWords; /**
152
+ * Improved diff algorithm that better handles word insertions
153
+ * Uses a combination of LCS and heuristics to minimize false changes
154
+ */
155
+ private static myersDiff;
156
+ /**
157
+ * Compute edit script using dynamic programming
158
+ */
159
+ private static computeEditScript;
160
+ /**
161
+ * Reconstruct the actual diff from the DP table
162
+ */
163
+ private static reconstructDiff;
164
+ /**
165
+ * Consolidate adjacent changes to reduce fragmentation
166
+ * e.g., if we have: delete "Key", insert "Key!", delete "Challenges"
167
+ * We can consolidate this into: replace ["Key", "Challenges"] with ["Key!"]
168
+ */
169
+ private static consolidateAdjacentChanges;
170
+ /**
171
+ * Determine if a sequence of changes should be consolidated
172
+ */
173
+ private static shouldConsolidateChanges;
174
+ /**
175
+ * Check if two words are similar enough to be considered a replacement
176
+ */
177
+ private static areWordsSimilar;
178
+ }
179
+
180
+ declare class BlockNoteWordDiffRendererUtil {
181
+ static renderWordDiffs(diffBlocks: DiffBlock[], onAcceptChange?: (diffId: string) => void, onRejectChange?: (diffId: string) => void, acceptedChanges?: Set<string>, rejectedChanges?: Set<string>): PartialBlock[];
182
+ private static updateWordDiffStates;
183
+ private static renderDiffBlock;
184
+ private static renderBlockLevelDiff;
185
+ private static renderWordLevelDiff;
186
+ private static groupAndRenderWordDiffs;
187
+ private static cleanupSpaces;
188
+ private static isLastDiffInGroup;
189
+ private static createTextContent;
190
+ private static getBlockProps;
191
+ static generateChangeSummary(diffBlocks: DiffBlock[]): {
192
+ totalWords: number;
193
+ addedWords: number;
194
+ removedWords: number;
195
+ acceptedChanges: number;
196
+ rejectedChanges: number;
197
+ pendingChanges: number;
198
+ };
199
+ }
200
+
201
+ export { type BlockDiffOptions, BlockNoteDiffUtil, BlockNoteWordDiffRendererUtil, type DiffBlock, type DiffResult, type EntityObject, type FormatOption, TableOptions, type UserObject, type WordDiff, cn, composeRefs, entityObjectSchema, exists, formatDate, getTableComponents, getTableOptions, useComposedRefs, useIsMobile, userObjectSchema };
@@ -0,0 +1,32 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+
4
+
5
+
6
+
7
+
8
+
9
+
10
+
11
+
12
+
13
+
14
+
15
+ var _chunkJC3WJK65js = require('../chunk-JC3WJK65.js');
16
+ require('../chunk-7QVYU63E.js');
17
+
18
+
19
+
20
+
21
+
22
+
23
+
24
+
25
+
26
+
27
+
28
+
29
+
30
+
31
+ exports.BlockNoteDiffUtil = _chunkJC3WJK65js.BlockNoteDiffUtil; exports.BlockNoteWordDiffRendererUtil = _chunkJC3WJK65js.BlockNoteWordDiffRendererUtil; exports.TableOptions = _chunkJC3WJK65js.TableOptions; exports.cn = _chunkJC3WJK65js.cn; exports.composeRefs = _chunkJC3WJK65js.composeRefs; exports.entityObjectSchema = _chunkJC3WJK65js.entityObjectSchema; exports.exists = _chunkJC3WJK65js.exists; exports.formatDate = _chunkJC3WJK65js.formatDate; exports.getTableComponents = _chunkJC3WJK65js.getTableComponents; exports.getTableOptions = _chunkJC3WJK65js.getTableOptions; exports.useComposedRefs = _chunkJC3WJK65js.useComposedRefs; exports.useIsMobile = _chunkJC3WJK65js.useIsMobile; exports.userObjectSchema = _chunkJC3WJK65js.userObjectSchema;
32
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["/Users/carlo/Development/phlow2/packages/nextjs-jsonapi/dist/utils/index.js"],"names":[],"mappings":"AAAA;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,uDAA6B;AAC7B,gCAA6B;AAC7B;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,6uBAAC","file":"/Users/carlo/Development/phlow2/packages/nextjs-jsonapi/dist/utils/index.js"}