@ruya.sa/next 3.71.3

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 (406) hide show
  1. package/LICENSE.md +22 -0
  2. package/dist/auth/login.js +67 -0
  3. package/dist/auth/login.js.map +1 -0
  4. package/dist/auth/logout.js +52 -0
  5. package/dist/auth/logout.js.map +1 -0
  6. package/dist/auth/refresh.js +56 -0
  7. package/dist/auth/refresh.js.map +1 -0
  8. package/dist/config.js +2 -0
  9. package/dist/config.js.map +1 -0
  10. package/dist/dummy.css +0 -0
  11. package/dist/elements/DocumentHeader/Tabs/ShouldRenderTabs.js +19 -0
  12. package/dist/elements/DocumentHeader/Tabs/ShouldRenderTabs.js.map +1 -0
  13. package/dist/elements/DocumentHeader/Tabs/Tab/TabLink.js +81 -0
  14. package/dist/elements/DocumentHeader/Tabs/Tab/TabLink.js.map +1 -0
  15. package/dist/elements/DocumentHeader/Tabs/Tab/index.js +66 -0
  16. package/dist/elements/DocumentHeader/Tabs/Tab/index.js.map +1 -0
  17. package/dist/elements/DocumentHeader/Tabs/index.js +78 -0
  18. package/dist/elements/DocumentHeader/Tabs/index.js.map +1 -0
  19. package/dist/elements/DocumentHeader/Tabs/tabs/VersionsPill/index.js +29 -0
  20. package/dist/elements/DocumentHeader/Tabs/tabs/VersionsPill/index.js.map +1 -0
  21. package/dist/elements/DocumentHeader/Tabs/tabs/index.js +72 -0
  22. package/dist/elements/DocumentHeader/Tabs/tabs/index.js.map +1 -0
  23. package/dist/elements/DocumentHeader/index.js +36 -0
  24. package/dist/elements/DocumentHeader/index.js.map +1 -0
  25. package/dist/elements/FormHeader/index.js +20 -0
  26. package/dist/elements/FormHeader/index.js.map +1 -0
  27. package/dist/elements/Logo/index.js +39 -0
  28. package/dist/elements/Logo/index.js.map +1 -0
  29. package/dist/elements/Nav/NavHamburger/index.js +51 -0
  30. package/dist/elements/Nav/NavHamburger/index.js.map +1 -0
  31. package/dist/elements/Nav/NavWrapper/index.js +61 -0
  32. package/dist/elements/Nav/NavWrapper/index.js.map +1 -0
  33. package/dist/elements/Nav/SettingsMenuButton/index.js +45 -0
  34. package/dist/elements/Nav/SettingsMenuButton/index.js.map +1 -0
  35. package/dist/elements/Nav/getNavPrefs.js +26 -0
  36. package/dist/elements/Nav/getNavPrefs.js.map +1 -0
  37. package/dist/elements/Nav/index.client.js +133 -0
  38. package/dist/elements/Nav/index.client.js.map +1 -0
  39. package/dist/elements/Nav/index.js +145 -0
  40. package/dist/elements/Nav/index.js.map +1 -0
  41. package/dist/esbuildEntry.js +5 -0
  42. package/dist/esbuildEntry.js.map +1 -0
  43. package/dist/exports/auth.js +4 -0
  44. package/dist/exports/auth.js.map +1 -0
  45. package/dist/exports/client.js +6 -0
  46. package/dist/exports/client.js.map +1 -0
  47. package/dist/exports/layouts.js +3 -0
  48. package/dist/exports/layouts.js.map +1 -0
  49. package/dist/exports/routes.js +3 -0
  50. package/dist/exports/routes.js.map +1 -0
  51. package/dist/exports/rsc.js +4 -0
  52. package/dist/exports/rsc.js.map +1 -0
  53. package/dist/exports/templates.js +3 -0
  54. package/dist/exports/templates.js.map +1 -0
  55. package/dist/exports/utilities.js +53 -0
  56. package/dist/exports/utilities.js.map +1 -0
  57. package/dist/exports/views.js +10 -0
  58. package/dist/exports/views.js.map +1 -0
  59. package/dist/index.js +2 -0
  60. package/dist/index.js.map +1 -0
  61. package/dist/layouts/Root/NestProviders.js +24 -0
  62. package/dist/layouts/Root/NestProviders.js.map +1 -0
  63. package/dist/layouts/Root/checkDependencies.js +49 -0
  64. package/dist/layouts/Root/checkDependencies.js.map +1 -0
  65. package/dist/layouts/Root/index.js +120 -0
  66. package/dist/layouts/Root/index.js.map +1 -0
  67. package/dist/routes/graphql/handler.js +137 -0
  68. package/dist/routes/graphql/handler.js.map +1 -0
  69. package/dist/routes/graphql/index.js +3 -0
  70. package/dist/routes/graphql/index.js.map +1 -0
  71. package/dist/routes/graphql/playground.js +31 -0
  72. package/dist/routes/graphql/playground.js.map +1 -0
  73. package/dist/routes/index.js +3 -0
  74. package/dist/routes/index.js.map +1 -0
  75. package/dist/routes/rest/index.js +33 -0
  76. package/dist/routes/rest/index.js.map +1 -0
  77. package/dist/routes/rest/og/image.js +86 -0
  78. package/dist/routes/rest/og/image.js.map +1 -0
  79. package/dist/routes/rest/og/index.js +70 -0
  80. package/dist/routes/rest/og/index.js.map +1 -0
  81. package/dist/routes/rest/og/roboto-regular.woff +0 -0
  82. package/dist/templates/Default/NavHamburger/index.js +25 -0
  83. package/dist/templates/Default/NavHamburger/index.js.map +1 -0
  84. package/dist/templates/Default/Wrapper/index.js +49 -0
  85. package/dist/templates/Default/Wrapper/index.js.map +1 -0
  86. package/dist/templates/Default/index.js +129 -0
  87. package/dist/templates/Default/index.js.map +1 -0
  88. package/dist/templates/Minimal/index.js +21 -0
  89. package/dist/templates/Minimal/index.js.map +1 -0
  90. package/dist/utilities/getExistingAuthToken.js +6 -0
  91. package/dist/utilities/getExistingAuthToken.js.map +1 -0
  92. package/dist/utilities/getNextRequestI18n.js +22 -0
  93. package/dist/utilities/getNextRequestI18n.js.map +1 -0
  94. package/dist/utilities/getPayloadHMR.js +15 -0
  95. package/dist/utilities/getPayloadHMR.js.map +1 -0
  96. package/dist/utilities/getPreferences.js +26 -0
  97. package/dist/utilities/getPreferences.js.map +1 -0
  98. package/dist/utilities/getRequestLocale.js +20 -0
  99. package/dist/utilities/getRequestLocale.js.map +1 -0
  100. package/dist/utilities/getRequestTheme.js +22 -0
  101. package/dist/utilities/getRequestTheme.js.map +1 -0
  102. package/dist/utilities/getRouteWithoutAdmin.js +7 -0
  103. package/dist/utilities/getRouteWithoutAdmin.js.map +1 -0
  104. package/dist/utilities/handleAuthRedirect.js +41 -0
  105. package/dist/utilities/handleAuthRedirect.js.map +1 -0
  106. package/dist/utilities/handleServerFunctions.js +57 -0
  107. package/dist/utilities/handleServerFunctions.js.map +1 -0
  108. package/dist/utilities/initReq.js +110 -0
  109. package/dist/utilities/initReq.js.map +1 -0
  110. package/dist/utilities/isCustomAdminView.js +31 -0
  111. package/dist/utilities/isCustomAdminView.js.map +1 -0
  112. package/dist/utilities/isPublicAdminRoute.js +25 -0
  113. package/dist/utilities/isPublicAdminRoute.js.map +1 -0
  114. package/dist/utilities/meta.js +69 -0
  115. package/dist/utilities/meta.js.map +1 -0
  116. package/dist/utilities/selectiveCache.js +38 -0
  117. package/dist/utilities/selectiveCache.js.map +1 -0
  118. package/dist/utilities/setPayloadAuthCookie.js +27 -0
  119. package/dist/utilities/setPayloadAuthCookie.js.map +1 -0
  120. package/dist/utilities/slugify.js +47 -0
  121. package/dist/utilities/slugify.js.map +1 -0
  122. package/dist/utilities/timestamp.js +8 -0
  123. package/dist/utilities/timestamp.js.map +1 -0
  124. package/dist/views/API/LocaleSelector/index.js +44 -0
  125. package/dist/views/API/LocaleSelector/index.js.map +1 -0
  126. package/dist/views/API/RenderJSON/index.js +135 -0
  127. package/dist/views/API/RenderJSON/index.js.map +1 -0
  128. package/dist/views/API/index.client.js +209 -0
  129. package/dist/views/API/index.client.js.map +1 -0
  130. package/dist/views/API/index.js +7 -0
  131. package/dist/views/API/index.js.map +1 -0
  132. package/dist/views/API/metadata.js +29 -0
  133. package/dist/views/API/metadata.js.map +1 -0
  134. package/dist/views/Account/ResetPreferences/index.js +112 -0
  135. package/dist/views/Account/ResetPreferences/index.js.map +1 -0
  136. package/dist/views/Account/Settings/LanguageSelector.js +52 -0
  137. package/dist/views/Account/Settings/LanguageSelector.js.map +1 -0
  138. package/dist/views/Account/Settings/index.js +33 -0
  139. package/dist/views/Account/Settings/index.js.map +1 -0
  140. package/dist/views/Account/ToggleTheme/index.js +60 -0
  141. package/dist/views/Account/ToggleTheme/index.js.map +1 -0
  142. package/dist/views/Account/index.client.js +37 -0
  143. package/dist/views/Account/index.client.js.map +1 -0
  144. package/dist/views/Account/index.js +178 -0
  145. package/dist/views/Account/index.js.map +1 -0
  146. package/dist/views/Account/metadata.js +14 -0
  147. package/dist/views/Account/metadata.js.map +1 -0
  148. package/dist/views/BrowseByFolder/buildView.js +169 -0
  149. package/dist/views/BrowseByFolder/buildView.js.map +1 -0
  150. package/dist/views/BrowseByFolder/index.js +20 -0
  151. package/dist/views/BrowseByFolder/index.js.map +1 -0
  152. package/dist/views/BrowseByFolder/metadata.js +18 -0
  153. package/dist/views/BrowseByFolder/metadata.js.map +1 -0
  154. package/dist/views/CollectionFolders/buildView.js +156 -0
  155. package/dist/views/CollectionFolders/buildView.js.map +1 -0
  156. package/dist/views/CollectionFolders/index.js +20 -0
  157. package/dist/views/CollectionFolders/index.js.map +1 -0
  158. package/dist/views/CollectionFolders/metadata.js +25 -0
  159. package/dist/views/CollectionFolders/metadata.js.map +1 -0
  160. package/dist/views/CollectionFolders/renderFolderViewSlots.js +64 -0
  161. package/dist/views/CollectionFolders/renderFolderViewSlots.js.map +1 -0
  162. package/dist/views/CollectionTrash/index.js +21 -0
  163. package/dist/views/CollectionTrash/index.js.map +1 -0
  164. package/dist/views/CollectionTrash/metadata.js +25 -0
  165. package/dist/views/CollectionTrash/metadata.js.map +1 -0
  166. package/dist/views/CreateFirstUser/index.client.js +112 -0
  167. package/dist/views/CreateFirstUser/index.client.js.map +1 -0
  168. package/dist/views/CreateFirstUser/index.js +88 -0
  169. package/dist/views/CreateFirstUser/index.js.map +1 -0
  170. package/dist/views/CreateFirstUser/metadata.js +14 -0
  171. package/dist/views/CreateFirstUser/metadata.js.map +1 -0
  172. package/dist/views/Dashboard/Default/ModularDashboard/DashboardStepNav.js +147 -0
  173. package/dist/views/Dashboard/Default/ModularDashboard/DashboardStepNav.js.map +1 -0
  174. package/dist/views/Dashboard/Default/ModularDashboard/index.client.js +431 -0
  175. package/dist/views/Dashboard/Default/ModularDashboard/index.client.js.map +1 -0
  176. package/dist/views/Dashboard/Default/ModularDashboard/index.js +87 -0
  177. package/dist/views/Dashboard/Default/ModularDashboard/index.js.map +1 -0
  178. package/dist/views/Dashboard/Default/ModularDashboard/renderWidget/RenderWidget.js +99 -0
  179. package/dist/views/Dashboard/Default/ModularDashboard/renderWidget/RenderWidget.js.map +1 -0
  180. package/dist/views/Dashboard/Default/ModularDashboard/renderWidget/getDefaultLayoutServerFn.js +58 -0
  181. package/dist/views/Dashboard/Default/ModularDashboard/renderWidget/getDefaultLayoutServerFn.js.map +1 -0
  182. package/dist/views/Dashboard/Default/ModularDashboard/renderWidget/renderWidgetServerFn.js +72 -0
  183. package/dist/views/Dashboard/Default/ModularDashboard/renderWidget/renderWidgetServerFn.js.map +1 -0
  184. package/dist/views/Dashboard/Default/ModularDashboard/useDashboardLayout.js +158 -0
  185. package/dist/views/Dashboard/Default/ModularDashboard/useDashboardLayout.js.map +1 -0
  186. package/dist/views/Dashboard/Default/ModularDashboard/utils/collisionDetection.js +38 -0
  187. package/dist/views/Dashboard/Default/ModularDashboard/utils/collisionDetection.js.map +1 -0
  188. package/dist/views/Dashboard/Default/ModularDashboard/utils/sensors.js +264 -0
  189. package/dist/views/Dashboard/Default/ModularDashboard/utils/sensors.js.map +1 -0
  190. package/dist/views/Dashboard/Default/index.js +52 -0
  191. package/dist/views/Dashboard/Default/index.js.map +1 -0
  192. package/dist/views/Dashboard/index.js +50 -0
  193. package/dist/views/Dashboard/index.js.map +1 -0
  194. package/dist/views/Dashboard/metadata.js +16 -0
  195. package/dist/views/Dashboard/metadata.js.map +1 -0
  196. package/dist/views/Document/getCustomDocumentViewByKey.js +4 -0
  197. package/dist/views/Document/getCustomDocumentViewByKey.js.map +1 -0
  198. package/dist/views/Document/getCustomViewByRoute.js +35 -0
  199. package/dist/views/Document/getCustomViewByRoute.js.map +1 -0
  200. package/dist/views/Document/getDocPreferences.js +45 -0
  201. package/dist/views/Document/getDocPreferences.js.map +1 -0
  202. package/dist/views/Document/getDocumentData.js +60 -0
  203. package/dist/views/Document/getDocumentData.js.map +1 -0
  204. package/dist/views/Document/getDocumentPermissions.js +87 -0
  205. package/dist/views/Document/getDocumentPermissions.js.map +1 -0
  206. package/dist/views/Document/getDocumentView.js +310 -0
  207. package/dist/views/Document/getDocumentView.js.map +1 -0
  208. package/dist/views/Document/getIsLocked.js +79 -0
  209. package/dist/views/Document/getIsLocked.js.map +1 -0
  210. package/dist/views/Document/getMetaBySegment.js +150 -0
  211. package/dist/views/Document/getMetaBySegment.js.map +1 -0
  212. package/dist/views/Document/getVersions.js +210 -0
  213. package/dist/views/Document/getVersions.js.map +1 -0
  214. package/dist/views/Document/handleServerFunction.js +135 -0
  215. package/dist/views/Document/handleServerFunction.js.map +1 -0
  216. package/dist/views/Document/index.js +390 -0
  217. package/dist/views/Document/index.js.map +1 -0
  218. package/dist/views/Document/metadata.js +3 -0
  219. package/dist/views/Document/metadata.js.map +1 -0
  220. package/dist/views/Document/renderDocumentSlots.js +154 -0
  221. package/dist/views/Document/renderDocumentSlots.js.map +1 -0
  222. package/dist/views/Edit/index.js +11 -0
  223. package/dist/views/Edit/index.js.map +1 -0
  224. package/dist/views/Edit/metadata.js +52 -0
  225. package/dist/views/Edit/metadata.js.map +1 -0
  226. package/dist/views/ForgotPassword/ForgotPasswordForm/index.js +179 -0
  227. package/dist/views/ForgotPassword/ForgotPasswordForm/index.js.map +1 -0
  228. package/dist/views/ForgotPassword/index.js +72 -0
  229. package/dist/views/ForgotPassword/index.js.map +1 -0
  230. package/dist/views/ForgotPassword/metadata.js +14 -0
  231. package/dist/views/ForgotPassword/metadata.js.map +1 -0
  232. package/dist/views/List/createSerializableValue.js +14 -0
  233. package/dist/views/List/createSerializableValue.js.map +1 -0
  234. package/dist/views/List/enrichDocsWithVersionStatus.js +96 -0
  235. package/dist/views/List/enrichDocsWithVersionStatus.js.map +1 -0
  236. package/dist/views/List/extractRelationshipDisplayValue.js +17 -0
  237. package/dist/views/List/extractRelationshipDisplayValue.js.map +1 -0
  238. package/dist/views/List/extractValueOrRelationshipID.js +19 -0
  239. package/dist/views/List/extractValueOrRelationshipID.js.map +1 -0
  240. package/dist/views/List/handleGroupBy.js +160 -0
  241. package/dist/views/List/handleGroupBy.js.map +1 -0
  242. package/dist/views/List/handleServerFunction.js +130 -0
  243. package/dist/views/List/handleServerFunction.js.map +1 -0
  244. package/dist/views/List/index.js +356 -0
  245. package/dist/views/List/index.js.map +1 -0
  246. package/dist/views/List/metadata.js +24 -0
  247. package/dist/views/List/metadata.js.map +1 -0
  248. package/dist/views/List/renderListViewSlots.js +80 -0
  249. package/dist/views/List/renderListViewSlots.js.map +1 -0
  250. package/dist/views/List/resolveAllFilterOptions.js +49 -0
  251. package/dist/views/List/resolveAllFilterOptions.js.map +1 -0
  252. package/dist/views/List/transformColumnsToSelect.js +11 -0
  253. package/dist/views/List/transformColumnsToSelect.js.map +1 -0
  254. package/dist/views/Login/LoginField/index.js +98 -0
  255. package/dist/views/Login/LoginField/index.js.map +1 -0
  256. package/dist/views/Login/LoginForm/index.js +177 -0
  257. package/dist/views/Login/LoginForm/index.js.map +1 -0
  258. package/dist/views/Login/index.js +95 -0
  259. package/dist/views/Login/index.js.map +1 -0
  260. package/dist/views/Login/metadata.js +14 -0
  261. package/dist/views/Login/metadata.js.map +1 -0
  262. package/dist/views/Logout/LogoutClient.js +140 -0
  263. package/dist/views/Logout/LogoutClient.js.map +1 -0
  264. package/dist/views/Logout/index.js +36 -0
  265. package/dist/views/Logout/index.js.map +1 -0
  266. package/dist/views/Logout/metadata.js +13 -0
  267. package/dist/views/Logout/metadata.js.map +1 -0
  268. package/dist/views/NotFound/index.client.js +88 -0
  269. package/dist/views/NotFound/index.client.js.map +1 -0
  270. package/dist/views/NotFound/index.js +87 -0
  271. package/dist/views/NotFound/index.js.map +1 -0
  272. package/dist/views/NotFound/metadata.js +11 -0
  273. package/dist/views/NotFound/metadata.js.map +1 -0
  274. package/dist/views/ResetPassword/ResetPasswordForm/index.js +117 -0
  275. package/dist/views/ResetPassword/ResetPasswordForm/index.js.map +1 -0
  276. package/dist/views/ResetPassword/index.js +83 -0
  277. package/dist/views/ResetPassword/index.js.map +1 -0
  278. package/dist/views/ResetPassword/metadata.js +14 -0
  279. package/dist/views/ResetPassword/metadata.js.map +1 -0
  280. package/dist/views/Root/attachViewActions.js +27 -0
  281. package/dist/views/Root/attachViewActions.js.map +1 -0
  282. package/dist/views/Root/generateCustomViewMetadata.js +25 -0
  283. package/dist/views/Root/generateCustomViewMetadata.js.map +1 -0
  284. package/dist/views/Root/getCustomViewByKey.js +16 -0
  285. package/dist/views/Root/getCustomViewByKey.js.map +1 -0
  286. package/dist/views/Root/getCustomViewByRoute.js +48 -0
  287. package/dist/views/Root/getCustomViewByRoute.js.map +1 -0
  288. package/dist/views/Root/getDocumentViewInfo.js +28 -0
  289. package/dist/views/Root/getDocumentViewInfo.js.map +1 -0
  290. package/dist/views/Root/getRouteData.js +359 -0
  291. package/dist/views/Root/getRouteData.js.map +1 -0
  292. package/dist/views/Root/index.js +300 -0
  293. package/dist/views/Root/index.js.map +1 -0
  294. package/dist/views/Root/isPathMatchingRoute.js +29 -0
  295. package/dist/views/Root/isPathMatchingRoute.js.map +1 -0
  296. package/dist/views/Root/metadata.js +209 -0
  297. package/dist/views/Root/metadata.js.map +1 -0
  298. package/dist/views/Unauthorized/index.js +54 -0
  299. package/dist/views/Unauthorized/index.js.map +1 -0
  300. package/dist/views/Unauthorized/metadata.js +14 -0
  301. package/dist/views/Unauthorized/metadata.js.map +1 -0
  302. package/dist/views/Verify/index.client.js +50 -0
  303. package/dist/views/Verify/index.client.js.map +1 -0
  304. package/dist/views/Verify/index.js +71 -0
  305. package/dist/views/Verify/index.js.map +1 -0
  306. package/dist/views/Verify/metadata.js +14 -0
  307. package/dist/views/Verify/metadata.js.map +1 -0
  308. package/dist/views/Version/Default/SelectedLocalesContext.js +8 -0
  309. package/dist/views/Version/Default/SelectedLocalesContext.js.map +1 -0
  310. package/dist/views/Version/Default/SetStepNav.js +135 -0
  311. package/dist/views/Version/Default/SetStepNav.js.map +1 -0
  312. package/dist/views/Version/Default/index.js +253 -0
  313. package/dist/views/Version/Default/index.js.map +1 -0
  314. package/dist/views/Version/Default/types.js +2 -0
  315. package/dist/views/Version/Default/types.js.map +1 -0
  316. package/dist/views/Version/RenderFieldsToDiff/DiffCollapser/index.js +130 -0
  317. package/dist/views/Version/RenderFieldsToDiff/DiffCollapser/index.js.map +1 -0
  318. package/dist/views/Version/RenderFieldsToDiff/RenderVersionFieldsToDiff.js +80 -0
  319. package/dist/views/Version/RenderFieldsToDiff/RenderVersionFieldsToDiff.js.map +1 -0
  320. package/dist/views/Version/RenderFieldsToDiff/buildVersionFields.js +439 -0
  321. package/dist/views/Version/RenderFieldsToDiff/buildVersionFields.js.map +1 -0
  322. package/dist/views/Version/RenderFieldsToDiff/fields/Collapsible/index.js +61 -0
  323. package/dist/views/Version/RenderFieldsToDiff/fields/Collapsible/index.js.map +1 -0
  324. package/dist/views/Version/RenderFieldsToDiff/fields/Date/index.js +75 -0
  325. package/dist/views/Version/RenderFieldsToDiff/fields/Date/index.js.map +1 -0
  326. package/dist/views/Version/RenderFieldsToDiff/fields/Group/index.js +66 -0
  327. package/dist/views/Version/RenderFieldsToDiff/fields/Group/index.js.map +1 -0
  328. package/dist/views/Version/RenderFieldsToDiff/fields/Iterable/index.js +129 -0
  329. package/dist/views/Version/RenderFieldsToDiff/fields/Iterable/index.js.map +1 -0
  330. package/dist/views/Version/RenderFieldsToDiff/fields/Relationship/generateLabelFromValue.js +45 -0
  331. package/dist/views/Version/RenderFieldsToDiff/fields/Relationship/generateLabelFromValue.js.map +1 -0
  332. package/dist/views/Version/RenderFieldsToDiff/fields/Relationship/index.js +188 -0
  333. package/dist/views/Version/RenderFieldsToDiff/fields/Relationship/index.js.map +1 -0
  334. package/dist/views/Version/RenderFieldsToDiff/fields/Row/index.js +17 -0
  335. package/dist/views/Version/RenderFieldsToDiff/fields/Row/index.js.map +1 -0
  336. package/dist/views/Version/RenderFieldsToDiff/fields/Select/index.js +87 -0
  337. package/dist/views/Version/RenderFieldsToDiff/fields/Select/index.js.map +1 -0
  338. package/dist/views/Version/RenderFieldsToDiff/fields/Tabs/index.js +155 -0
  339. package/dist/views/Version/RenderFieldsToDiff/fields/Tabs/index.js.map +1 -0
  340. package/dist/views/Version/RenderFieldsToDiff/fields/Text/index.js +100 -0
  341. package/dist/views/Version/RenderFieldsToDiff/fields/Text/index.js.map +1 -0
  342. package/dist/views/Version/RenderFieldsToDiff/fields/Upload/index.js +222 -0
  343. package/dist/views/Version/RenderFieldsToDiff/fields/Upload/index.js.map +1 -0
  344. package/dist/views/Version/RenderFieldsToDiff/fields/index.js +35 -0
  345. package/dist/views/Version/RenderFieldsToDiff/fields/index.js.map +1 -0
  346. package/dist/views/Version/RenderFieldsToDiff/index.js +13 -0
  347. package/dist/views/Version/RenderFieldsToDiff/index.js.map +1 -0
  348. package/dist/views/Version/RenderFieldsToDiff/utilities/countChangedFields.js +242 -0
  349. package/dist/views/Version/RenderFieldsToDiff/utilities/countChangedFields.js.map +1 -0
  350. package/dist/views/Version/RenderFieldsToDiff/utilities/countChangedFields.spec.js +861 -0
  351. package/dist/views/Version/RenderFieldsToDiff/utilities/countChangedFields.spec.js.map +1 -0
  352. package/dist/views/Version/RenderFieldsToDiff/utilities/fieldHasChanges.js +4 -0
  353. package/dist/views/Version/RenderFieldsToDiff/utilities/fieldHasChanges.js.map +1 -0
  354. package/dist/views/Version/RenderFieldsToDiff/utilities/fieldHasChanges.spec.js +47 -0
  355. package/dist/views/Version/RenderFieldsToDiff/utilities/fieldHasChanges.spec.js.map +1 -0
  356. package/dist/views/Version/RenderFieldsToDiff/utilities/getFieldsForRowComparison.js +45 -0
  357. package/dist/views/Version/RenderFieldsToDiff/utilities/getFieldsForRowComparison.js.map +1 -0
  358. package/dist/views/Version/RenderFieldsToDiff/utilities/getFieldsForRowComparison.spec.js +135 -0
  359. package/dist/views/Version/RenderFieldsToDiff/utilities/getFieldsForRowComparison.spec.js.map +1 -0
  360. package/dist/views/Version/Restore/index.js +106 -0
  361. package/dist/views/Version/Restore/index.js.map +1 -0
  362. package/dist/views/Version/SelectComparison/VersionDrawer/CreatedAtCell.js +56 -0
  363. package/dist/views/Version/SelectComparison/VersionDrawer/CreatedAtCell.js.map +1 -0
  364. package/dist/views/Version/SelectComparison/VersionDrawer/index.js +240 -0
  365. package/dist/views/Version/SelectComparison/VersionDrawer/index.js.map +1 -0
  366. package/dist/views/Version/SelectComparison/index.js +57 -0
  367. package/dist/views/Version/SelectComparison/index.js.map +1 -0
  368. package/dist/views/Version/SelectComparison/types.js +2 -0
  369. package/dist/views/Version/SelectComparison/types.js.map +1 -0
  370. package/dist/views/Version/SelectLocales/index.js +39 -0
  371. package/dist/views/Version/SelectLocales/index.js.map +1 -0
  372. package/dist/views/Version/VersionPillLabel/VersionPillLabel.js +110 -0
  373. package/dist/views/Version/VersionPillLabel/VersionPillLabel.js.map +1 -0
  374. package/dist/views/Version/VersionPillLabel/getVersionLabel.js +34 -0
  375. package/dist/views/Version/VersionPillLabel/getVersionLabel.js.map +1 -0
  376. package/dist/views/Version/fetchVersions.js +151 -0
  377. package/dist/views/Version/fetchVersions.js.map +1 -0
  378. package/dist/views/Version/index.js +349 -0
  379. package/dist/views/Version/index.js.map +1 -0
  380. package/dist/views/Version/metadata.js +58 -0
  381. package/dist/views/Version/metadata.js.map +1 -0
  382. package/dist/views/Versions/buildColumns.js +88 -0
  383. package/dist/views/Versions/buildColumns.js.map +1 -0
  384. package/dist/views/Versions/cells/AutosaveCell/index.js +45 -0
  385. package/dist/views/Versions/cells/AutosaveCell/index.js.map +1 -0
  386. package/dist/views/Versions/cells/CreatedAt/index.js +60 -0
  387. package/dist/views/Versions/cells/CreatedAt/index.js.map +1 -0
  388. package/dist/views/Versions/cells/ID/index.js +12 -0
  389. package/dist/views/Versions/cells/ID/index.js.map +1 -0
  390. package/dist/views/Versions/index.client.js +89 -0
  391. package/dist/views/Versions/index.client.js.map +1 -0
  392. package/dist/views/Versions/index.js +157 -0
  393. package/dist/views/Versions/index.js.map +1 -0
  394. package/dist/views/Versions/metadata.js +51 -0
  395. package/dist/views/Versions/metadata.js.map +1 -0
  396. package/dist/views/Versions/types.js +2 -0
  397. package/dist/views/Versions/types.js.map +1 -0
  398. package/dist/withPayload/withPayload.js +162 -0
  399. package/dist/withPayload/withPayload.js.map +1 -0
  400. package/dist/withPayload/withPayload.spec.js +40 -0
  401. package/dist/withPayload/withPayload.spec.js.map +1 -0
  402. package/dist/withPayload/withPayload.utils.js +133 -0
  403. package/dist/withPayload/withPayload.utils.js.map +1 -0
  404. package/dist/withPayload/withPayloadLegacy.js +47 -0
  405. package/dist/withPayload/withPayloadLegacy.js.map +1 -0
  406. package/package.json +153 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","names":[],"sources":["../../../../src/views/Version/Default/types.ts"],"sourcesContent":["export type CompareOption = {\n label: React.ReactNode | string\n value: string\n}\n\nexport type VersionPill = {\n id: string\n Label: React.ReactNode\n}\n\nexport type DefaultVersionsViewProps = {\n canUpdate: boolean\n modifiedOnly: boolean\n RenderedDiff: React.ReactNode\n selectedLocales: string[]\n versionFromCreatedAt?: string\n versionFromID?: string\n versionFromOptions: CompareOption[]\n versionToCreatedAt?: string\n versionToCreatedAtFormatted: string\n VersionToCreatedAtLabel: React.ReactNode\n versionToID?: string\n versionToStatus?: string\n}\n"],"mappings":"AAUA","ignoreList":[]}
@@ -0,0 +1,130 @@
1
+ 'use client';
2
+
3
+ import { c as _c } from "react/compiler-runtime";
4
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
5
+ import { ChevronIcon, FieldDiffLabel, useConfig, useTranslation } from '@ruya.sa/ui';
6
+ import { fieldIsArrayType, fieldIsBlockType } from '@ruya.sa/payload/shared';
7
+ import React, { useState } from 'react';
8
+ import { countChangedFields, countChangedFieldsInRows } from '../utilities/countChangedFields.js';
9
+ const baseClass = 'diff-collapser';
10
+ export const DiffCollapser = t0 => {
11
+ const $ = _c(19);
12
+ const {
13
+ children,
14
+ field,
15
+ fields,
16
+ hideGutter: t1,
17
+ initCollapsed: t2,
18
+ isIterable: t3,
19
+ Label,
20
+ locales,
21
+ parentIsLocalized,
22
+ valueFrom,
23
+ valueTo
24
+ } = t0;
25
+ const hideGutter = t1 === undefined ? false : t1;
26
+ const initCollapsed = t2 === undefined ? false : t2;
27
+ const isIterable = t3 === undefined ? false : t3;
28
+ const {
29
+ t
30
+ } = useTranslation();
31
+ const [isCollapsed, setIsCollapsed] = useState(initCollapsed);
32
+ const {
33
+ config
34
+ } = useConfig();
35
+ let t4;
36
+ if ($[0] !== Label || $[1] !== children || $[2] !== config || $[3] !== field || $[4] !== fields || $[5] !== hideGutter || $[6] !== isCollapsed || $[7] !== isIterable || $[8] !== locales || $[9] !== parentIsLocalized || $[10] !== t || $[11] !== valueFrom || $[12] !== valueTo) {
37
+ let changeCount;
38
+ if (isIterable) {
39
+ if (!fieldIsArrayType(field) && !fieldIsBlockType(field)) {
40
+ throw new Error("DiffCollapser: field must be an array or blocks field when isIterable is true");
41
+ }
42
+ const valueFromRows = valueFrom ?? [];
43
+ const valueToRows = valueTo ?? [];
44
+ if (!Array.isArray(valueFromRows) || !Array.isArray(valueToRows)) {
45
+ throw new Error("DiffCollapser: valueFrom and valueTro must be arrays when isIterable is true");
46
+ }
47
+ changeCount = countChangedFieldsInRows({
48
+ config,
49
+ field,
50
+ locales,
51
+ parentIsLocalized,
52
+ valueFromRows,
53
+ valueToRows
54
+ });
55
+ } else {
56
+ changeCount = countChangedFields({
57
+ config,
58
+ fields,
59
+ locales,
60
+ parentIsLocalized,
61
+ valueFrom,
62
+ valueTo
63
+ });
64
+ }
65
+ const t5 = isCollapsed && `${baseClass}__content--is-collapsed`;
66
+ const t6 = hideGutter && `${baseClass}__content--hide-gutter`;
67
+ let t7;
68
+ if ($[14] !== t5 || $[15] !== t6) {
69
+ t7 = [`${baseClass}__content`, t5, t6].filter(Boolean);
70
+ $[14] = t5;
71
+ $[15] = t6;
72
+ $[16] = t7;
73
+ } else {
74
+ t7 = $[16];
75
+ }
76
+ const contentClassNames = t7.join(" ");
77
+ let t8;
78
+ if ($[17] !== isCollapsed) {
79
+ t8 = () => setIsCollapsed(!isCollapsed);
80
+ $[17] = isCollapsed;
81
+ $[18] = t8;
82
+ } else {
83
+ t8 = $[18];
84
+ }
85
+ t4 = _jsxs("div", {
86
+ className: baseClass,
87
+ children: [_jsxs(FieldDiffLabel, {
88
+ children: [_jsxs("button", {
89
+ "aria-label": isCollapsed ? "Expand" : "Collapse",
90
+ className: `${baseClass}__toggle-button`,
91
+ onClick: t8,
92
+ type: "button",
93
+ children: [_jsx("div", {
94
+ className: `${baseClass}__label`,
95
+ children: Label
96
+ }), _jsx(ChevronIcon, {
97
+ direction: isCollapsed ? "right" : "down",
98
+ size: "small"
99
+ })]
100
+ }), changeCount > 0 && isCollapsed && _jsx("span", {
101
+ className: `${baseClass}__field-change-count`,
102
+ children: t("version:changedFieldsCount", {
103
+ count: changeCount
104
+ })
105
+ })]
106
+ }), _jsx("div", {
107
+ className: contentClassNames,
108
+ children
109
+ })]
110
+ });
111
+ $[0] = Label;
112
+ $[1] = children;
113
+ $[2] = config;
114
+ $[3] = field;
115
+ $[4] = fields;
116
+ $[5] = hideGutter;
117
+ $[6] = isCollapsed;
118
+ $[7] = isIterable;
119
+ $[8] = locales;
120
+ $[9] = parentIsLocalized;
121
+ $[10] = t;
122
+ $[11] = valueFrom;
123
+ $[12] = valueTo;
124
+ $[13] = t4;
125
+ } else {
126
+ t4 = $[13];
127
+ }
128
+ return t4;
129
+ };
130
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["c","_c","ChevronIcon","FieldDiffLabel","useConfig","useTranslation","fieldIsArrayType","fieldIsBlockType","React","useState","countChangedFields","countChangedFieldsInRows","baseClass","DiffCollapser","t0","$","children","field","fields","hideGutter","t1","initCollapsed","t2","isIterable","t3","Label","locales","parentIsLocalized","valueFrom","valueTo","undefined","t","isCollapsed","setIsCollapsed","config","t4","changeCount","Error","valueFromRows","valueToRows","Array","isArray","t5","t6","t7","filter","Boolean","contentClassNames","join","t8","_jsxs","className","onClick","type","_jsx","direction","size","count"],"sources":["../../../../../src/views/Version/RenderFieldsToDiff/DiffCollapser/index.tsx"],"sourcesContent":["'use client'\nimport type { ClientField } from '@ruya.sa/payload'\n\nimport { ChevronIcon, FieldDiffLabel, useConfig, useTranslation } from '@ruya.sa/ui'\nimport { fieldIsArrayType, fieldIsBlockType } from '@ruya.sa/payload/shared'\nimport React, { useState } from 'react'\n\nimport './index.scss'\nimport { countChangedFields, countChangedFieldsInRows } from '../utilities/countChangedFields.js'\n\nconst baseClass = 'diff-collapser'\n\ntype Props = {\n hideGutter?: boolean\n initCollapsed?: boolean\n Label: React.ReactNode\n locales: string[] | undefined\n parentIsLocalized: boolean\n valueTo: unknown\n} & (\n | {\n // fields collapser\n children: React.ReactNode\n field?: never\n fields: ClientField[]\n isIterable?: false\n valueFrom: unknown\n }\n | {\n // iterable collapser\n children: React.ReactNode\n field: ClientField\n fields?: never\n isIterable: true\n valueFrom?: unknown\n }\n)\n\nexport const DiffCollapser: React.FC<Props> = ({\n children,\n field,\n fields,\n hideGutter = false,\n initCollapsed = false,\n isIterable = false,\n Label,\n locales,\n parentIsLocalized,\n valueFrom,\n valueTo,\n}) => {\n const { t } = useTranslation()\n const [isCollapsed, setIsCollapsed] = useState(initCollapsed)\n const { config } = useConfig()\n\n let changeCount = 0\n\n if (isIterable) {\n if (!fieldIsArrayType(field) && !fieldIsBlockType(field)) {\n throw new Error(\n 'DiffCollapser: field must be an array or blocks field when isIterable is true',\n )\n }\n const valueFromRows = valueFrom ?? []\n const valueToRows = valueTo ?? []\n\n if (!Array.isArray(valueFromRows) || !Array.isArray(valueToRows)) {\n throw new Error(\n 'DiffCollapser: valueFrom and valueTro must be arrays when isIterable is true',\n )\n }\n\n changeCount = countChangedFieldsInRows({\n config,\n field,\n locales,\n parentIsLocalized,\n valueFromRows,\n valueToRows,\n })\n } else {\n changeCount = countChangedFields({\n config,\n fields,\n locales,\n parentIsLocalized,\n valueFrom,\n valueTo,\n })\n }\n\n const contentClassNames = [\n `${baseClass}__content`,\n isCollapsed && `${baseClass}__content--is-collapsed`,\n hideGutter && `${baseClass}__content--hide-gutter`,\n ]\n .filter(Boolean)\n .join(' ')\n\n return (\n <div className={baseClass}>\n <FieldDiffLabel>\n <button\n aria-label={isCollapsed ? 'Expand' : 'Collapse'}\n className={`${baseClass}__toggle-button`}\n onClick={() => setIsCollapsed(!isCollapsed)}\n type=\"button\"\n >\n <div className={`${baseClass}__label`}>{Label}</div>\n\n <ChevronIcon direction={isCollapsed ? 'right' : 'down'} size={'small'} />\n </button>\n {changeCount > 0 && isCollapsed && (\n <span className={`${baseClass}__field-change-count`}>\n {t('version:changedFieldsCount', { count: changeCount })}\n </span>\n )}\n </FieldDiffLabel>\n <div className={contentClassNames}>{children}</div>\n </div>\n )\n}\n"],"mappings":"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","ignoreList":[]}
@@ -0,0 +1,80 @@
1
+ 'use client';
2
+
3
+ import { c as _c } from "react/compiler-runtime";
4
+ import { jsx as _jsx } from "react/jsx-runtime";
5
+ const baseClass = 'render-field-diffs';
6
+ import { ShimmerEffect } from '@ruya.sa/ui';
7
+ import React, { Fragment, useEffect } from 'react';
8
+ export const RenderVersionFieldsToDiff = t0 => {
9
+ const $ = _c(6);
10
+ const {
11
+ parent: t1,
12
+ versionFields
13
+ } = t0;
14
+ const parent = t1 === undefined ? false : t1;
15
+ const [hasMounted, setHasMounted] = React.useState(false);
16
+ let t2;
17
+ let t3;
18
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
19
+ t2 = () => {
20
+ setHasMounted(true);
21
+ };
22
+ t3 = [];
23
+ $[0] = t2;
24
+ $[1] = t3;
25
+ } else {
26
+ t2 = $[0];
27
+ t3 = $[1];
28
+ }
29
+ useEffect(t2, t3);
30
+ const t4 = `${baseClass}${parent ? ` ${baseClass}--parent` : ""}`;
31
+ let t5;
32
+ if ($[2] !== hasMounted || $[3] !== t4 || $[4] !== versionFields) {
33
+ t5 = _jsx("div", {
34
+ className: t4,
35
+ children: !hasMounted ? _jsx(Fragment, {
36
+ children: _jsx(ShimmerEffect, {
37
+ height: "8rem",
38
+ width: "100%"
39
+ })
40
+ }) : versionFields?.map(_temp)
41
+ });
42
+ $[2] = hasMounted;
43
+ $[3] = t4;
44
+ $[4] = versionFields;
45
+ $[5] = t5;
46
+ } else {
47
+ t5 = $[5];
48
+ }
49
+ return t5;
50
+ };
51
+ function _temp(field, fieldIndex) {
52
+ if (field.fieldByLocale) {
53
+ const LocaleComponents = [];
54
+ for (const [locale, baseField] of Object.entries(field.fieldByLocale)) {
55
+ LocaleComponents.push(_jsx("div", {
56
+ className: `${baseClass}__locale`,
57
+ "data-field-path": baseField.path,
58
+ "data-locale": locale,
59
+ children: _jsx("div", {
60
+ className: `${baseClass}__locale-value`,
61
+ children: baseField.CustomComponent
62
+ })
63
+ }, [locale, fieldIndex].join("-")));
64
+ }
65
+ return _jsx("div", {
66
+ className: `${baseClass}__field`,
67
+ children: LocaleComponents
68
+ }, fieldIndex);
69
+ } else {
70
+ if (field.field) {
71
+ return _jsx("div", {
72
+ className: `${baseClass}__field field__${field.field.type}`,
73
+ "data-field-path": field.field.path,
74
+ children: field.field.CustomComponent
75
+ }, fieldIndex);
76
+ }
77
+ }
78
+ return null;
79
+ }
80
+ //# sourceMappingURL=RenderVersionFieldsToDiff.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RenderVersionFieldsToDiff.js","names":["c","_c","baseClass","ShimmerEffect","React","Fragment","useEffect","RenderVersionFieldsToDiff","t0","$","parent","t1","versionFields","undefined","hasMounted","setHasMounted","useState","t2","t3","Symbol","for","t4","t5","_jsx","className","children","height","width","map","_temp","field","fieldIndex","fieldByLocale","LocaleComponents","locale","baseField","Object","entries","push","path","CustomComponent","join","type"],"sources":["../../../../src/views/Version/RenderFieldsToDiff/RenderVersionFieldsToDiff.tsx"],"sourcesContent":["'use client'\nconst baseClass = 'render-field-diffs'\nimport type { VersionField } from '@ruya.sa/payload'\n\nimport './index.scss'\n\nimport { ShimmerEffect } from '@ruya.sa/ui'\nimport React, { Fragment, useEffect } from 'react'\n\nexport const RenderVersionFieldsToDiff = ({\n parent = false,\n versionFields,\n}: {\n /**\n * If true, this is the parent render version fields component, not one nested in\n * a field with children (e.g. group)\n */\n parent?: boolean\n versionFields: VersionField[]\n}): React.ReactNode => {\n const [hasMounted, setHasMounted] = React.useState(false)\n\n // defer rendering until after the first mount as the CSS is loaded with Emotion\n // this will ensure that the CSS is loaded before rendering the diffs and prevent CLS\n useEffect(() => {\n setHasMounted(true)\n }, [])\n\n return (\n <div className={`${baseClass}${parent ? ` ${baseClass}--parent` : ''}`}>\n {!hasMounted ? (\n <Fragment>\n <ShimmerEffect height=\"8rem\" width=\"100%\" />\n </Fragment>\n ) : (\n versionFields?.map((field, fieldIndex) => {\n if (field.fieldByLocale) {\n const LocaleComponents: React.ReactNode[] = []\n for (const [locale, baseField] of Object.entries(field.fieldByLocale)) {\n LocaleComponents.push(\n <div\n className={`${baseClass}__locale`}\n data-field-path={baseField.path}\n data-locale={locale}\n key={[locale, fieldIndex].join('-')}\n >\n <div className={`${baseClass}__locale-value`}>{baseField.CustomComponent}</div>\n </div>,\n )\n }\n return (\n <div className={`${baseClass}__field`} key={fieldIndex}>\n {LocaleComponents}\n </div>\n )\n } else if (field.field) {\n return (\n <div\n className={`${baseClass}__field field__${field.field.type}`}\n data-field-path={field.field.path}\n key={fieldIndex}\n >\n {field.field.CustomComponent}\n </div>\n )\n }\n\n return null\n })\n )}\n </div>\n )\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AACA,MAAMC,SAAA,GAAY;AAKlB,SAASC,aAAa,QAAQ;AAC9B,OAAOC,KAAA,IAASC,QAAQ,EAAEC,SAAS,QAAQ;AAE3C,OAAO,MAAMC,yBAAA,GAA4BC,EAAA;EAAA,MAAAC,CAAA,GAAAR,EAAA;EAAC;IAAAS,MAAA,EAAAC,EAAA;IAAAC;EAAA,IAAAJ,EAUzC;EATC,MAAAE,MAAA,GAAAC,EAAc,KAAAE,SAAA,WAAdF,EAAc;EAUd,OAAAG,UAAA,EAAAC,aAAA,IAAoCX,KAAA,CAAAY,QAAA,MAAe;EAAA,IAAAC,EAAA;EAAA,IAAAC,EAAA;EAAA,IAAAT,CAAA,QAAAU,MAAA,CAAAC,GAAA;IAIzCH,EAAA,GAAAA,CAAA;MACRF,aAAA,KAAc;IAAA;IACbG,EAAA;IAAET,CAAA,MAAAQ,EAAA;IAAAR,CAAA,MAAAS,EAAA;EAAA;IAAAD,EAAA,GAAAR,CAAA;IAAAS,EAAA,GAAAT,CAAA;EAAA;EAFLH,SAAA,CAAUW,EAEV,EAAGC,EAAE;EAGa,MAAAG,EAAA,MAAAnB,SAAA,GAAeQ,MAAA,GAAS,IAAAR,SAAA,UAAuB,GAAG,IAAI;EAAA,IAAAoB,EAAA;EAAA,IAAAb,CAAA,QAAAK,UAAA,IAAAL,CAAA,QAAAY,EAAA,IAAAZ,CAAA,QAAAG,aAAA;IAAtEU,EAAA,GAAAC,IAAA,CAAC;MAAAC,SAAA,EAAeH,EAAsD;MAAAI,QAAA,EACnE,CAACX,UAAA,GACAS,IAAA,CAAAlB,QAAA;QAAAoB,QAAA,EACEF,IAAA,CAAApB,aAAA;UAAAuB,MAAA,EAAsB;UAAAC,KAAA,EAAa;QAAA,C;WAGrCf,aAAA,EAAAgB,GAAA,CAAAC,KAAA;IAiCA,C;;;;;;;;SAvCJP,E;CA2CJ;AA/DyC,SAAAO,MAAAC,KAAA,EAAAC,UAAA;EAAA,IA2B3BD,KAAA,CAAAE,aAAA;IACF,MAAAC,gBAAA;IAA8C,KACzC,OAAAC,MAAA,EAAAC,SAAA,CAAyB,IAAIC,MAAA,CAAAC,OAAA,CAAeP,KAAA,CAAAE,aAAmB;MAClEC,gBAAA,CAAAK,IAAA,CACEf,IAAA,CAAC;QAAAC,SAAA,EACY,GAAAtB,SAAA,UAAsB;QAAA,mBAChBiC,SAAA,CAAAI,IAAA;QAAA,eACJL,MAAA;QAAAT,QAAA,EAGbF,IAAA,CAAC;UAAAC,SAAA,EAAe,GAAAtB,SAAA,gBAA4B;UAAAuB,QAAA,EAAGU,SAAA,CAAAK;QAAA,C;SAF1C,CAACN,MAAA,EAAQH,UAAA,EAAAU,IAAA,CAAiB;IAAA;IAAA,OAOnClB,IAAA,CAAC;MAAAC,SAAA,EAAe,GAAAtB,SAAA,SAAqB;MAAAuB,QAAA,EAClCQ;IAAA,GADyCF,UAAA;EAAA;IAAA,IAIrCD,KAAA,CAAAA,KAAA;MAAA,OAEPP,IAAA,CAAC;QAAAC,SAAA,EACY,GAAAtB,SAAA,kBAA8B4B,KAAA,CAAAA,KAAA,CAAAY,IAAA,EAAkB;QAAA,mBAC1CZ,KAAA,CAAAA,KAAA,CAAAS,IAAA;QAAAd,QAAA,EAGhBK,KAAA,CAAAA,KAAA,CAAAU;MAAA,GAFIT,UAAA;IAAA;EAAA;EAAA;AAAA","ignoreList":[]}
@@ -0,0 +1,439 @@
1
+ import { RenderServerComponent } from '@ruya.sa/ui/elements/RenderServerComponent';
2
+ import { dequal } from 'dequal/lite';
3
+ import { MissingEditorProp } from '@ruya.sa/payload';
4
+ import { fieldIsID, fieldShouldBeLocalized, getFieldPaths, getUniqueListBy, tabHasName } from '@ruya.sa/payload/shared';
5
+ import { diffComponents } from './fields/index.js';
6
+ /**
7
+ * Build up an object that contains rendered diff components for each field.
8
+ * This is then sent to the client to be rendered.
9
+ *
10
+ * Here, the server is responsible for traversing through the document data and building up this
11
+ * version state object.
12
+ */
13
+ export const buildVersionFields = ({
14
+ clientSchemaMap,
15
+ customDiffComponents,
16
+ entitySlug,
17
+ fields,
18
+ fieldsPermissions,
19
+ i18n,
20
+ modifiedOnly,
21
+ nestingLevel = 0,
22
+ parentIndexPath,
23
+ parentIsLocalized,
24
+ parentPath,
25
+ parentSchemaPath,
26
+ req,
27
+ selectedLocales,
28
+ versionFromSiblingData,
29
+ versionToSiblingData
30
+ }) => {
31
+ const versionFields = [];
32
+ let fieldIndex = -1;
33
+ for (const field of fields) {
34
+ fieldIndex++;
35
+ if (fieldIsID(field)) {
36
+ continue;
37
+ }
38
+ const {
39
+ indexPath,
40
+ path,
41
+ schemaPath
42
+ } = getFieldPaths({
43
+ field,
44
+ index: fieldIndex,
45
+ parentIndexPath,
46
+ parentPath,
47
+ parentSchemaPath
48
+ });
49
+ const clientField = clientSchemaMap.get(entitySlug + '.' + schemaPath);
50
+ if (!clientField) {
51
+ req.payload.logger.error({
52
+ clientFieldKey: entitySlug + '.' + schemaPath,
53
+ clientSchemaMapKeys: Array.from(clientSchemaMap.keys()),
54
+ msg: 'No client field found for ' + entitySlug + '.' + schemaPath,
55
+ parentPath,
56
+ parentSchemaPath,
57
+ path,
58
+ schemaPath
59
+ });
60
+ throw new Error('No client field found for ' + entitySlug + '.' + schemaPath);
61
+ }
62
+ const versionField = {};
63
+ const isLocalized = fieldShouldBeLocalized({
64
+ field,
65
+ parentIsLocalized
66
+ });
67
+ const fieldName = 'name' in field ? field.name : null;
68
+ const valueFrom = fieldName ? versionFromSiblingData?.[fieldName] : versionFromSiblingData;
69
+ const valueTo = fieldName ? versionToSiblingData?.[fieldName] : versionToSiblingData;
70
+ if (isLocalized) {
71
+ versionField.fieldByLocale = {};
72
+ for (const locale of selectedLocales) {
73
+ const localizedVersionField = buildVersionField({
74
+ clientField: clientField,
75
+ clientSchemaMap,
76
+ customDiffComponents,
77
+ entitySlug,
78
+ field,
79
+ i18n,
80
+ indexPath,
81
+ locale,
82
+ modifiedOnly,
83
+ nestingLevel,
84
+ parentFieldsPermissions: fieldsPermissions,
85
+ parentIsLocalized: true,
86
+ parentPath,
87
+ parentSchemaPath,
88
+ path,
89
+ req,
90
+ schemaPath,
91
+ selectedLocales,
92
+ valueFrom: valueFrom?.[locale],
93
+ valueTo: valueTo?.[locale]
94
+ });
95
+ if (localizedVersionField) {
96
+ versionField.fieldByLocale[locale] = localizedVersionField;
97
+ }
98
+ }
99
+ } else {
100
+ const baseVersionField = buildVersionField({
101
+ clientField: clientField,
102
+ clientSchemaMap,
103
+ customDiffComponents,
104
+ entitySlug,
105
+ field,
106
+ i18n,
107
+ indexPath,
108
+ modifiedOnly,
109
+ nestingLevel,
110
+ parentFieldsPermissions: fieldsPermissions,
111
+ parentIsLocalized: parentIsLocalized || 'localized' in field && field.localized,
112
+ parentPath,
113
+ parentSchemaPath,
114
+ path,
115
+ req,
116
+ schemaPath,
117
+ selectedLocales,
118
+ valueFrom,
119
+ valueTo
120
+ });
121
+ if (baseVersionField) {
122
+ versionField.field = baseVersionField;
123
+ }
124
+ }
125
+ if (versionField.field || versionField.fieldByLocale && Object.keys(versionField.fieldByLocale).length) {
126
+ versionFields.push(versionField);
127
+ }
128
+ }
129
+ return {
130
+ versionFields
131
+ };
132
+ };
133
+ const buildVersionField = ({
134
+ clientField,
135
+ clientSchemaMap,
136
+ customDiffComponents,
137
+ entitySlug,
138
+ field,
139
+ i18n,
140
+ indexPath,
141
+ locale,
142
+ modifiedOnly,
143
+ nestingLevel,
144
+ parentFieldsPermissions,
145
+ parentIsLocalized,
146
+ parentPath,
147
+ parentSchemaPath,
148
+ path,
149
+ req,
150
+ schemaPath,
151
+ selectedLocales,
152
+ valueFrom,
153
+ valueTo
154
+ }) => {
155
+ let hasReadPermission = false;
156
+ let fieldPermissions = undefined;
157
+ if (typeof parentFieldsPermissions === 'boolean') {
158
+ hasReadPermission = parentFieldsPermissions;
159
+ fieldPermissions = parentFieldsPermissions;
160
+ } else {
161
+ if ('name' in field) {
162
+ fieldPermissions = parentFieldsPermissions?.[field.name];
163
+ if (typeof fieldPermissions === 'boolean') {
164
+ hasReadPermission = fieldPermissions;
165
+ } else if (typeof fieldPermissions?.read === 'boolean') {
166
+ hasReadPermission = fieldPermissions.read;
167
+ }
168
+ } else {
169
+ // If the field is unnamed and parentFieldsPermissions is an object, its sub-fields will decide their read permissions state.
170
+ // As far as this field is concerned, we are allowed to read it, as we need to reach its sub-fields to determine their read permissions.
171
+ hasReadPermission = true;
172
+ }
173
+ }
174
+ if (!hasReadPermission) {
175
+ // HasReadPermission is only valid if the field has a name. E.g. for a tabs field it would incorrectly return `false`.
176
+ return null;
177
+ }
178
+ if (modifiedOnly && dequal(valueFrom, valueTo)) {
179
+ return null;
180
+ }
181
+ let CustomComponent = customDiffComponents?.[field.type];
182
+ if (field?.type === 'richText') {
183
+ if (!field?.editor) {
184
+ throw new MissingEditorProp(field) // while we allow disabling editor functionality, you should not have any richText fields defined if you do not have an editor
185
+ ;
186
+ }
187
+ if (typeof field?.editor === 'function') {
188
+ throw new Error('Attempted to access unsanitized rich text editor.');
189
+ }
190
+ if (field.editor.CellComponent) {
191
+ CustomComponent = field.editor.DiffComponent;
192
+ }
193
+ }
194
+ if (field?.admin?.components?.Diff) {
195
+ CustomComponent = field.admin.components.Diff;
196
+ }
197
+ const DefaultComponent = diffComponents?.[field.type];
198
+ const baseVersionField = {
199
+ type: field.type,
200
+ fields: [],
201
+ path,
202
+ schemaPath
203
+ };
204
+ if (field.type === 'tabs' && 'tabs' in field) {
205
+ baseVersionField.tabs = [];
206
+ let tabIndex = -1;
207
+ for (const tab of field.tabs) {
208
+ tabIndex++;
209
+ const isNamedTab = tabHasName(tab);
210
+ const tabAsField = {
211
+ ...tab,
212
+ type: 'tab'
213
+ };
214
+ const {
215
+ indexPath: tabIndexPath,
216
+ path: tabPath,
217
+ schemaPath: tabSchemaPath
218
+ } = getFieldPaths({
219
+ field: tabAsField,
220
+ index: tabIndex,
221
+ parentIndexPath: indexPath,
222
+ parentPath: path,
223
+ parentSchemaPath: schemaPath
224
+ });
225
+ let tabFieldsPermissions = undefined;
226
+ // The tabs field does not have its own permissions as it's unnamed => use parentFieldsPermissions
227
+ if (typeof parentFieldsPermissions === 'boolean') {
228
+ tabFieldsPermissions = parentFieldsPermissions;
229
+ } else {
230
+ if ('name' in tab) {
231
+ const tabPermissions = parentFieldsPermissions?.[tab.name];
232
+ if (typeof tabPermissions === 'boolean') {
233
+ tabFieldsPermissions = tabPermissions;
234
+ } else {
235
+ tabFieldsPermissions = tabPermissions?.fields;
236
+ }
237
+ } else {
238
+ tabFieldsPermissions = parentFieldsPermissions;
239
+ }
240
+ }
241
+ const tabVersion = {
242
+ name: 'name' in tab ? tab.name : null,
243
+ fields: buildVersionFields({
244
+ clientSchemaMap,
245
+ customDiffComponents,
246
+ entitySlug,
247
+ fields: tab.fields,
248
+ fieldsPermissions: tabFieldsPermissions,
249
+ i18n,
250
+ modifiedOnly,
251
+ nestingLevel: nestingLevel + 1,
252
+ parentIndexPath: isNamedTab ? '' : tabIndexPath,
253
+ parentIsLocalized: parentIsLocalized || tab.localized,
254
+ parentPath: isNamedTab ? tabPath : 'name' in field ? path : parentPath,
255
+ parentSchemaPath: tabSchemaPath,
256
+ req,
257
+ selectedLocales,
258
+ versionFromSiblingData: 'name' in tab ? valueFrom?.[tab.name] : valueFrom,
259
+ versionToSiblingData: 'name' in tab ? valueTo?.[tab.name] : valueTo
260
+ }).versionFields,
261
+ label: typeof tab.label === 'function' ? tab.label({
262
+ i18n,
263
+ t: i18n.t
264
+ }) : tab.label
265
+ };
266
+ if (tabVersion?.fields?.length) {
267
+ baseVersionField.tabs.push(tabVersion);
268
+ }
269
+ }
270
+ if (modifiedOnly && !baseVersionField.tabs.length) {
271
+ return null;
272
+ }
273
+ } else if ('fields' in field) {
274
+ let subFieldsPermissions = undefined;
275
+ if ('name' in field && typeof fieldPermissions !== 'undefined') {
276
+ // Named fields like arrays
277
+ subFieldsPermissions = typeof fieldPermissions === 'boolean' ? fieldPermissions : fieldPermissions.fields;
278
+ } else {
279
+ // Unnamed fields like collapsible and row inherit directly from parent permissions
280
+ subFieldsPermissions = parentFieldsPermissions;
281
+ }
282
+ if (field.type === 'array' && (valueTo || valueFrom)) {
283
+ const maxLength = Math.max(Array.isArray(valueTo) ? valueTo.length : 0, Array.isArray(valueFrom) ? valueFrom.length : 0);
284
+ baseVersionField.rows = [];
285
+ for (let i = 0; i < maxLength; i++) {
286
+ const fromRow = Array.isArray(valueFrom) && valueFrom?.[i] || {};
287
+ const toRow = Array.isArray(valueTo) && valueTo?.[i] || {};
288
+ const versionFields = buildVersionFields({
289
+ clientSchemaMap,
290
+ customDiffComponents,
291
+ entitySlug,
292
+ fields: field.fields,
293
+ fieldsPermissions: subFieldsPermissions,
294
+ i18n,
295
+ modifiedOnly,
296
+ nestingLevel: nestingLevel + 1,
297
+ parentIndexPath: 'name' in field ? '' : indexPath,
298
+ parentIsLocalized: parentIsLocalized || field.localized,
299
+ parentPath: ('name' in field ? path : parentPath) + '.' + i,
300
+ parentSchemaPath: schemaPath,
301
+ req,
302
+ selectedLocales,
303
+ versionFromSiblingData: fromRow,
304
+ versionToSiblingData: toRow
305
+ }).versionFields;
306
+ if (versionFields?.length) {
307
+ baseVersionField.rows[i] = versionFields;
308
+ }
309
+ }
310
+ if (!baseVersionField.rows?.length && modifiedOnly) {
311
+ return null;
312
+ }
313
+ } else {
314
+ baseVersionField.fields = buildVersionFields({
315
+ clientSchemaMap,
316
+ customDiffComponents,
317
+ entitySlug,
318
+ fields: field.fields,
319
+ fieldsPermissions: subFieldsPermissions,
320
+ i18n,
321
+ modifiedOnly,
322
+ nestingLevel: field.type !== 'row' ? nestingLevel + 1 : nestingLevel,
323
+ parentIndexPath: 'name' in field ? '' : indexPath,
324
+ parentIsLocalized: parentIsLocalized || 'localized' in field && field.localized,
325
+ parentPath: 'name' in field ? path : parentPath,
326
+ parentSchemaPath: schemaPath,
327
+ req,
328
+ selectedLocales,
329
+ versionFromSiblingData: valueFrom,
330
+ versionToSiblingData: valueTo
331
+ }).versionFields;
332
+ if (modifiedOnly && !baseVersionField.fields?.length) {
333
+ return null;
334
+ }
335
+ }
336
+ } else if (field.type === 'blocks') {
337
+ baseVersionField.rows = [];
338
+ const maxLength = Math.max(Array.isArray(valueTo) ? valueTo.length : 0, Array.isArray(valueFrom) ? valueFrom.length : 0);
339
+ for (let i = 0; i < maxLength; i++) {
340
+ const fromRow = Array.isArray(valueFrom) && valueFrom?.[i] || {};
341
+ const toRow = Array.isArray(valueTo) && valueTo?.[i] || {};
342
+ const blockSlugToMatch = toRow?.blockType ?? fromRow?.blockType;
343
+ const toBlock = req.payload.blocks[blockSlugToMatch] ?? (field.blockReferences ?? field.blocks).find(block => typeof block !== 'string' && block.slug === blockSlugToMatch);
344
+ let fields = [];
345
+ if (toRow.blockType === fromRow.blockType) {
346
+ fields = toBlock.fields;
347
+ } else {
348
+ const fromBlockSlugToMatch = toRow?.blockType ?? fromRow?.blockType;
349
+ const fromBlock = req.payload.blocks[fromBlockSlugToMatch] ?? (field.blockReferences ?? field.blocks).find(block => typeof block !== 'string' && block.slug === fromBlockSlugToMatch);
350
+ if (fromBlock) {
351
+ fields = getUniqueListBy([...toBlock.fields, ...fromBlock.fields], 'name');
352
+ } else {
353
+ fields = toBlock.fields;
354
+ }
355
+ }
356
+ let blockFieldsPermissions = undefined;
357
+ // fieldPermissions will be set here, as the blocks field has a name
358
+ if (typeof fieldPermissions === 'boolean') {
359
+ blockFieldsPermissions = fieldPermissions;
360
+ } else if (typeof fieldPermissions?.blocks === 'boolean') {
361
+ blockFieldsPermissions = fieldPermissions.blocks;
362
+ } else {
363
+ const permissionsBlockSpecific = fieldPermissions?.blocks?.[blockSlugToMatch];
364
+ if (typeof permissionsBlockSpecific === 'boolean') {
365
+ blockFieldsPermissions = permissionsBlockSpecific;
366
+ } else {
367
+ blockFieldsPermissions = permissionsBlockSpecific?.fields;
368
+ }
369
+ }
370
+ const versionFields = buildVersionFields({
371
+ clientSchemaMap,
372
+ customDiffComponents,
373
+ entitySlug,
374
+ fields,
375
+ fieldsPermissions: blockFieldsPermissions,
376
+ i18n,
377
+ modifiedOnly,
378
+ nestingLevel: nestingLevel + 1,
379
+ parentIndexPath: 'name' in field ? '' : indexPath,
380
+ parentIsLocalized: parentIsLocalized || 'localized' in field && field.localized,
381
+ parentPath: ('name' in field ? path : parentPath) + '.' + i,
382
+ parentSchemaPath: schemaPath + '.' + toBlock.slug,
383
+ req,
384
+ selectedLocales,
385
+ versionFromSiblingData: fromRow,
386
+ versionToSiblingData: toRow
387
+ }).versionFields;
388
+ if (versionFields?.length) {
389
+ baseVersionField.rows[i] = versionFields;
390
+ }
391
+ }
392
+ if (!baseVersionField.rows?.length && modifiedOnly) {
393
+ return null;
394
+ }
395
+ }
396
+ const clientDiffProps = {
397
+ baseVersionField: {
398
+ ...baseVersionField,
399
+ CustomComponent: undefined
400
+ },
401
+ /**
402
+ * TODO: Change to valueFrom in 4.0
403
+ */
404
+ comparisonValue: valueFrom,
405
+ /**
406
+ * @deprecated remove in 4.0. Each field should handle its own diffing logic
407
+ */
408
+ diffMethod: 'diffWordsWithSpace',
409
+ field: clientField,
410
+ fieldPermissions: typeof fieldPermissions === 'undefined' ? parentFieldsPermissions : fieldPermissions,
411
+ parentIsLocalized,
412
+ nestingLevel: nestingLevel ? nestingLevel : undefined,
413
+ /**
414
+ * TODO: Change to valueTo in 4.0
415
+ */
416
+ versionValue: valueTo
417
+ };
418
+ if (locale) {
419
+ clientDiffProps.locale = locale;
420
+ }
421
+ const serverDiffProps = {
422
+ ...clientDiffProps,
423
+ clientField,
424
+ field,
425
+ i18n,
426
+ req,
427
+ selectedLocales
428
+ };
429
+ baseVersionField.CustomComponent = RenderServerComponent({
430
+ clientProps: clientDiffProps,
431
+ Component: CustomComponent,
432
+ Fallback: DefaultComponent,
433
+ importMap: req.payload.importMap,
434
+ key: 'diff component',
435
+ serverProps: serverDiffProps
436
+ });
437
+ return baseVersionField;
438
+ };
439
+ //# sourceMappingURL=buildVersionFields.js.map