@multiplatform.one/frappe-ui 7.23.1 → 7.24.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 (698) hide show
  1. package/dist/cjs/FrappeCalendar.cjs +1 -1
  2. package/dist/cjs/FrappeCalendar.native.js +1 -1
  3. package/dist/cjs/FrappeCalendar.native.js.map +1 -1
  4. package/dist/cjs/FrappeDashboard.cjs +1 -1
  5. package/dist/cjs/FrappeDashboard.native.js +1 -1
  6. package/dist/cjs/FrappeDashboard.native.js.map +1 -1
  7. package/dist/cjs/FrappeForm.cjs +8 -0
  8. package/dist/cjs/FrappeForm.native.js +9 -0
  9. package/dist/cjs/FrappeForm.native.js.map +1 -1
  10. package/dist/cjs/FrappeImageView.cjs +1 -1
  11. package/dist/cjs/FrappeImageView.native.js +1 -1
  12. package/dist/cjs/FrappeImageView.native.js.map +1 -1
  13. package/dist/cjs/FrappeInsights.cjs +380 -0
  14. package/dist/cjs/FrappeInsights.native.js +447 -0
  15. package/dist/cjs/FrappeInsights.native.js.map +1 -0
  16. package/dist/cjs/FrappeLikedBy.cjs +5 -2
  17. package/dist/cjs/FrappeLikedBy.native.js +5 -2
  18. package/dist/cjs/FrappeLikedBy.native.js.map +1 -1
  19. package/dist/cjs/FrappeListView.cjs +406 -39
  20. package/dist/cjs/FrappeListView.native.js +469 -42
  21. package/dist/cjs/FrappeListView.native.js.map +1 -1
  22. package/dist/cjs/FrappeNotConfigured.cjs +54 -0
  23. package/dist/cjs/FrappeNotConfigured.native.js +58 -0
  24. package/dist/cjs/FrappeNotConfigured.native.js.map +1 -0
  25. package/dist/cjs/FrappeRecordView.cjs +199 -0
  26. package/dist/cjs/FrappeRecordView.native.js +218 -0
  27. package/dist/cjs/FrappeRecordView.native.js.map +1 -0
  28. package/dist/cjs/FrappeReportBuilder.cjs +2 -2
  29. package/dist/cjs/FrappeReportBuilder.native.js +2 -2
  30. package/dist/cjs/FrappeReportBuilder.native.js.map +1 -1
  31. package/dist/cjs/FrappeReportView.cjs +1 -1
  32. package/dist/cjs/FrappeReportView.native.js +2 -2
  33. package/dist/cjs/FrappeReportView.native.js.map +1 -1
  34. package/dist/cjs/FrappeTreeView.cjs +1 -1
  35. package/dist/cjs/FrappeTreeView.native.js +1 -1
  36. package/dist/cjs/desk/awesomebar.cjs +1 -1
  37. package/dist/cjs/desk/awesomebar.native.js +3 -3
  38. package/dist/cjs/desk/awesomebar.native.js.map +1 -1
  39. package/dist/cjs/fields/CodeEditor/index.cjs +1 -1
  40. package/dist/cjs/fields/CodeEditor/index.native.js +1 -1
  41. package/dist/cjs/fields/CodeEditor/index.native.js.map +1 -1
  42. package/dist/cjs/fields/Color/index.cjs +1 -0
  43. package/dist/cjs/fields/Color/index.native.js +1 -0
  44. package/dist/cjs/fields/Color/index.native.js.map +1 -1
  45. package/dist/cjs/fields/FileUpload.cjs +1 -1
  46. package/dist/cjs/fields/FileUpload.native.js +1 -1
  47. package/dist/cjs/fields/FileUpload.native.js.map +1 -1
  48. package/dist/cjs/fields/Heading/index.cjs +19 -12
  49. package/dist/cjs/fields/Heading/index.native.js +22 -13
  50. package/dist/cjs/fields/Heading/index.native.js.map +1 -1
  51. package/dist/cjs/fields/MarkdownEditor/index.cjs +2 -1
  52. package/dist/cjs/fields/MarkdownEditor/index.native.js +1 -1
  53. package/dist/cjs/fields/MarkdownEditor/index.native.js.map +1 -1
  54. package/dist/cjs/frappeNavigation.cjs +12 -2
  55. package/dist/cjs/frappeNavigation.native.js +13 -2
  56. package/dist/cjs/frappeNavigation.native.js.map +1 -1
  57. package/dist/cjs/index.cjs +34 -0
  58. package/dist/cjs/index.native.js +34 -0
  59. package/dist/cjs/index.native.js.map +1 -1
  60. package/dist/cjs/insights/InsightsFacetTags.cjs +147 -0
  61. package/dist/cjs/insights/InsightsFacetTags.native.js +165 -0
  62. package/dist/cjs/insights/InsightsFacetTags.native.js.map +1 -0
  63. package/dist/cjs/insights/InsightsKpiBand.cjs +124 -0
  64. package/dist/cjs/insights/InsightsKpiBand.native.js +133 -0
  65. package/dist/cjs/insights/InsightsKpiBand.native.js.map +1 -0
  66. package/dist/cjs/insights/InsightsLeaders.cjs +150 -0
  67. package/dist/cjs/insights/InsightsLeaders.native.js +178 -0
  68. package/dist/cjs/insights/InsightsLeaders.native.js.map +1 -0
  69. package/dist/cjs/insights/InsightsRecords.cjs +105 -0
  70. package/dist/cjs/insights/InsightsRecords.native.js +109 -0
  71. package/dist/cjs/insights/InsightsRecords.native.js.map +1 -0
  72. package/dist/cjs/insights/InsightsTable.cjs +157 -0
  73. package/dist/cjs/insights/InsightsTable.native.js +194 -0
  74. package/dist/cjs/insights/InsightsTable.native.js.map +1 -0
  75. package/dist/cjs/insights/insightsData.cjs +114 -0
  76. package/dist/cjs/insights/insightsData.native.js +220 -0
  77. package/dist/cjs/insights/insightsData.native.js.map +1 -0
  78. package/dist/cjs/insights/insightsRecord.cjs +35 -0
  79. package/dist/cjs/insights/insightsRecord.native.js +38 -0
  80. package/dist/cjs/insights/insightsRecord.native.js.map +1 -0
  81. package/dist/cjs/list/FacetBadge.cjs +62 -0
  82. package/dist/cjs/list/FacetBadge.native.js +66 -0
  83. package/dist/cjs/list/FacetBadge.native.js.map +1 -0
  84. package/dist/cjs/list/FacetRail.cjs +199 -0
  85. package/dist/cjs/list/FacetRail.native.js +223 -0
  86. package/dist/cjs/list/FacetRail.native.js.map +1 -0
  87. package/dist/cjs/list/ImageWell.cjs +111 -0
  88. package/dist/cjs/list/ImageWell.native.js +126 -0
  89. package/dist/cjs/list/ImageWell.native.js.map +1 -0
  90. package/dist/cjs/list/ListControls.cjs +226 -0
  91. package/dist/cjs/list/ListControls.native.js +252 -0
  92. package/dist/cjs/list/ListControls.native.js.map +1 -0
  93. package/dist/cjs/list/ListToastHost.cjs +54 -0
  94. package/dist/cjs/list/ListToastHost.native.js +59 -0
  95. package/dist/cjs/list/ListToastHost.native.js.map +1 -0
  96. package/dist/cjs/list/RangeFilter.cjs +122 -0
  97. package/dist/cjs/list/RangeFilter.native.js +135 -0
  98. package/dist/cjs/list/RangeFilter.native.js.map +1 -0
  99. package/dist/cjs/list/RecordCard.cjs +233 -0
  100. package/dist/cjs/list/RecordCard.native.js +173 -0
  101. package/dist/cjs/list/RecordCard.native.js.map +1 -0
  102. package/dist/cjs/list/ShufflePanel.cjs +112 -0
  103. package/dist/cjs/list/ShufflePanel.native.js +139 -0
  104. package/dist/cjs/list/ShufflePanel.native.js.map +1 -0
  105. package/dist/cjs/list/facetReading.cjs +71 -0
  106. package/dist/cjs/list/facetReading.native.js +163 -0
  107. package/dist/cjs/list/facetReading.native.js.map +1 -0
  108. package/dist/cjs/list/favorites.cjs +79 -0
  109. package/dist/cjs/list/favorites.native.js +91 -0
  110. package/dist/cjs/list/favorites.native.js.map +1 -0
  111. package/dist/cjs/list/listState.cjs +100 -0
  112. package/dist/cjs/list/listState.native.js +234 -0
  113. package/dist/cjs/list/listState.native.js.map +1 -0
  114. package/dist/cjs/list/recordLook.cjs +35 -0
  115. package/dist/cjs/list/recordLook.native.js +39 -0
  116. package/dist/cjs/list/recordLook.native.js.map +1 -0
  117. package/dist/cjs/list/useListControls.cjs +189 -0
  118. package/dist/cjs/list/useListControls.native.js +272 -0
  119. package/dist/cjs/list/useListControls.native.js.map +1 -0
  120. package/dist/cjs/record/RecordBars.cjs +200 -0
  121. package/dist/cjs/record/RecordBars.native.js +225 -0
  122. package/dist/cjs/record/RecordBars.native.js.map +1 -0
  123. package/dist/cjs/record/RecordGallery.cjs +67 -0
  124. package/dist/cjs/record/RecordGallery.native.js +75 -0
  125. package/dist/cjs/record/RecordGallery.native.js.map +1 -0
  126. package/dist/cjs/record/RecordHero.cjs +239 -0
  127. package/dist/cjs/record/RecordHero.native.js +250 -0
  128. package/dist/cjs/record/RecordHero.native.js.map +1 -0
  129. package/dist/cjs/record/RecordPage.cjs +330 -0
  130. package/dist/cjs/record/RecordPage.native.js +364 -0
  131. package/dist/cjs/record/RecordPage.native.js.map +1 -0
  132. package/dist/cjs/record/RecordPager.cjs +125 -0
  133. package/dist/cjs/record/RecordPager.native.js +130 -0
  134. package/dist/cjs/record/RecordPager.native.js.map +1 -0
  135. package/dist/cjs/record/RecordRows.cjs +126 -0
  136. package/dist/cjs/record/RecordRows.native.js +140 -0
  137. package/dist/cjs/record/RecordRows.native.js.map +1 -0
  138. package/dist/cjs/record/recordData.cjs +122 -0
  139. package/dist/cjs/record/recordData.native.js +189 -0
  140. package/dist/cjs/record/recordData.native.js.map +1 -0
  141. package/dist/cjs/record/recordSections.cjs +30 -0
  142. package/dist/cjs/record/recordSections.native.js +33 -0
  143. package/dist/cjs/record/recordSections.native.js.map +1 -0
  144. package/dist/cjs/useFrappeFacets.cjs +1 -1
  145. package/dist/cjs/useFrappeFacets.native.js +1 -1
  146. package/dist/cjs/useFrappeFacets.native.js.map +1 -1
  147. package/dist/esm/FrappeCalendar.mjs +1 -1
  148. package/dist/esm/FrappeCalendar.mjs.map +1 -1
  149. package/dist/esm/FrappeCalendar.native.js +1 -1
  150. package/dist/esm/FrappeCalendar.native.js.map +1 -1
  151. package/dist/esm/FrappeDashboard.mjs +1 -1
  152. package/dist/esm/FrappeDashboard.mjs.map +1 -1
  153. package/dist/esm/FrappeDashboard.native.js +1 -1
  154. package/dist/esm/FrappeDashboard.native.js.map +1 -1
  155. package/dist/esm/FrappeForm.mjs +8 -0
  156. package/dist/esm/FrappeForm.mjs.map +1 -1
  157. package/dist/esm/FrappeForm.native.js +9 -0
  158. package/dist/esm/FrappeForm.native.js.map +1 -1
  159. package/dist/esm/FrappeImageView.mjs +1 -1
  160. package/dist/esm/FrappeImageView.mjs.map +1 -1
  161. package/dist/esm/FrappeImageView.native.js +1 -1
  162. package/dist/esm/FrappeImageView.native.js.map +1 -1
  163. package/dist/esm/FrappeInsights.mjs +355 -0
  164. package/dist/esm/FrappeInsights.mjs.map +1 -0
  165. package/dist/esm/FrappeInsights.native.js +419 -0
  166. package/dist/esm/FrappeInsights.native.js.map +1 -0
  167. package/dist/esm/FrappeLikedBy.mjs +6 -3
  168. package/dist/esm/FrappeLikedBy.mjs.map +1 -1
  169. package/dist/esm/FrappeLikedBy.native.js +6 -3
  170. package/dist/esm/FrappeLikedBy.native.js.map +1 -1
  171. package/dist/esm/FrappeListView.mjs +410 -43
  172. package/dist/esm/FrappeListView.mjs.map +1 -1
  173. package/dist/esm/FrappeListView.native.js +473 -46
  174. package/dist/esm/FrappeListView.native.js.map +1 -1
  175. package/dist/esm/FrappeNotConfigured.mjs +29 -0
  176. package/dist/esm/FrappeNotConfigured.mjs.map +1 -0
  177. package/dist/esm/FrappeNotConfigured.native.js +30 -0
  178. package/dist/esm/FrappeNotConfigured.native.js.map +1 -0
  179. package/dist/esm/FrappeRecordView.mjs +174 -0
  180. package/dist/esm/FrappeRecordView.mjs.map +1 -0
  181. package/dist/esm/FrappeRecordView.native.js +190 -0
  182. package/dist/esm/FrappeRecordView.native.js.map +1 -0
  183. package/dist/esm/FrappeReportBuilder.mjs +2 -2
  184. package/dist/esm/FrappeReportBuilder.mjs.map +1 -1
  185. package/dist/esm/FrappeReportBuilder.native.js +2 -2
  186. package/dist/esm/FrappeReportBuilder.native.js.map +1 -1
  187. package/dist/esm/FrappeReportView.mjs +1 -1
  188. package/dist/esm/FrappeReportView.mjs.map +1 -1
  189. package/dist/esm/FrappeReportView.native.js +2 -2
  190. package/dist/esm/FrappeReportView.native.js.map +1 -1
  191. package/dist/esm/FrappeTreeView.mjs +1 -1
  192. package/dist/esm/FrappeTreeView.mjs.map +1 -1
  193. package/dist/esm/FrappeTreeView.native.js +1 -1
  194. package/dist/esm/desk/awesomebar.mjs +1 -1
  195. package/dist/esm/desk/awesomebar.mjs.map +1 -1
  196. package/dist/esm/desk/awesomebar.native.js +3 -3
  197. package/dist/esm/desk/awesomebar.native.js.map +1 -1
  198. package/dist/esm/fields/CodeEditor/index.mjs +2 -2
  199. package/dist/esm/fields/CodeEditor/index.mjs.map +1 -1
  200. package/dist/esm/fields/CodeEditor/index.native.js +2 -2
  201. package/dist/esm/fields/CodeEditor/index.native.js.map +1 -1
  202. package/dist/esm/fields/Color/index.mjs +1 -0
  203. package/dist/esm/fields/Color/index.mjs.map +1 -1
  204. package/dist/esm/fields/Color/index.native.js +1 -0
  205. package/dist/esm/fields/Color/index.native.js.map +1 -1
  206. package/dist/esm/fields/FileUpload.mjs +2 -2
  207. package/dist/esm/fields/FileUpload.mjs.map +1 -1
  208. package/dist/esm/fields/FileUpload.native.js +2 -2
  209. package/dist/esm/fields/FileUpload.native.js.map +1 -1
  210. package/dist/esm/fields/Heading/index.mjs +21 -14
  211. package/dist/esm/fields/Heading/index.mjs.map +1 -1
  212. package/dist/esm/fields/Heading/index.native.js +24 -15
  213. package/dist/esm/fields/Heading/index.native.js.map +1 -1
  214. package/dist/esm/fields/MarkdownEditor/index.mjs +2 -1
  215. package/dist/esm/fields/MarkdownEditor/index.mjs.map +1 -1
  216. package/dist/esm/fields/MarkdownEditor/index.native.js +2 -2
  217. package/dist/esm/fields/MarkdownEditor/index.native.js.map +1 -1
  218. package/dist/esm/frappeNavigation.mjs +11 -2
  219. package/dist/esm/frappeNavigation.mjs.map +1 -1
  220. package/dist/esm/frappeNavigation.native.js +12 -2
  221. package/dist/esm/frappeNavigation.native.js.map +1 -1
  222. package/dist/esm/index.mjs +14 -2
  223. package/dist/esm/index.mjs.map +1 -1
  224. package/dist/esm/index.native.js +14 -2
  225. package/dist/esm/index.native.js.map +1 -1
  226. package/dist/esm/insights/InsightsFacetTags.mjs +122 -0
  227. package/dist/esm/insights/InsightsFacetTags.mjs.map +1 -0
  228. package/dist/esm/insights/InsightsFacetTags.native.js +137 -0
  229. package/dist/esm/insights/InsightsFacetTags.native.js.map +1 -0
  230. package/dist/esm/insights/InsightsKpiBand.mjs +99 -0
  231. package/dist/esm/insights/InsightsKpiBand.mjs.map +1 -0
  232. package/dist/esm/insights/InsightsKpiBand.native.js +105 -0
  233. package/dist/esm/insights/InsightsKpiBand.native.js.map +1 -0
  234. package/dist/esm/insights/InsightsLeaders.mjs +125 -0
  235. package/dist/esm/insights/InsightsLeaders.mjs.map +1 -0
  236. package/dist/esm/insights/InsightsLeaders.native.js +150 -0
  237. package/dist/esm/insights/InsightsLeaders.native.js.map +1 -0
  238. package/dist/esm/insights/InsightsRecords.mjs +80 -0
  239. package/dist/esm/insights/InsightsRecords.mjs.map +1 -0
  240. package/dist/esm/insights/InsightsRecords.native.js +81 -0
  241. package/dist/esm/insights/InsightsRecords.native.js.map +1 -0
  242. package/dist/esm/insights/InsightsTable.mjs +132 -0
  243. package/dist/esm/insights/InsightsTable.mjs.map +1 -0
  244. package/dist/esm/insights/InsightsTable.native.js +166 -0
  245. package/dist/esm/insights/InsightsTable.native.js.map +1 -0
  246. package/dist/esm/insights/insightsData.mjs +82 -0
  247. package/dist/esm/insights/insightsData.mjs.map +1 -0
  248. package/dist/esm/insights/insightsData.native.js +185 -0
  249. package/dist/esm/insights/insightsData.native.js.map +1 -0
  250. package/dist/esm/insights/insightsRecord.mjs +9 -0
  251. package/dist/esm/insights/insightsRecord.mjs.map +1 -0
  252. package/dist/esm/insights/insightsRecord.native.js +9 -0
  253. package/dist/esm/insights/insightsRecord.native.js.map +1 -0
  254. package/dist/esm/list/FacetBadge.mjs +37 -0
  255. package/dist/esm/list/FacetBadge.mjs.map +1 -0
  256. package/dist/esm/list/FacetBadge.native.js +38 -0
  257. package/dist/esm/list/FacetBadge.native.js.map +1 -0
  258. package/dist/esm/list/FacetRail.mjs +174 -0
  259. package/dist/esm/list/FacetRail.mjs.map +1 -0
  260. package/dist/esm/list/FacetRail.native.js +195 -0
  261. package/dist/esm/list/FacetRail.native.js.map +1 -0
  262. package/dist/esm/list/ImageWell.mjs +86 -0
  263. package/dist/esm/list/ImageWell.mjs.map +1 -0
  264. package/dist/esm/list/ImageWell.native.js +98 -0
  265. package/dist/esm/list/ImageWell.native.js.map +1 -0
  266. package/dist/esm/list/ListControls.mjs +201 -0
  267. package/dist/esm/list/ListControls.mjs.map +1 -0
  268. package/dist/esm/list/ListControls.native.js +224 -0
  269. package/dist/esm/list/ListControls.native.js.map +1 -0
  270. package/dist/esm/list/ListToastHost.mjs +18 -0
  271. package/dist/esm/list/ListToastHost.mjs.map +1 -0
  272. package/dist/esm/list/ListToastHost.native.js +20 -0
  273. package/dist/esm/list/ListToastHost.native.js.map +1 -0
  274. package/dist/esm/list/RangeFilter.mjs +85 -0
  275. package/dist/esm/list/RangeFilter.mjs.map +1 -0
  276. package/dist/esm/list/RangeFilter.native.js +95 -0
  277. package/dist/esm/list/RangeFilter.native.js.map +1 -0
  278. package/dist/esm/list/RecordCard.mjs +208 -0
  279. package/dist/esm/list/RecordCard.mjs.map +1 -0
  280. package/dist/esm/list/RecordCard.native.js +145 -0
  281. package/dist/esm/list/RecordCard.native.js.map +1 -0
  282. package/dist/esm/list/ShufflePanel.mjs +87 -0
  283. package/dist/esm/list/ShufflePanel.mjs.map +1 -0
  284. package/dist/esm/list/ShufflePanel.native.js +111 -0
  285. package/dist/esm/list/ShufflePanel.native.js.map +1 -0
  286. package/dist/esm/list/facetReading.mjs +45 -0
  287. package/dist/esm/list/facetReading.mjs.map +1 -0
  288. package/dist/esm/list/facetReading.native.js +134 -0
  289. package/dist/esm/list/facetReading.native.js.map +1 -0
  290. package/dist/esm/list/favorites.mjs +50 -0
  291. package/dist/esm/list/favorites.mjs.map +1 -0
  292. package/dist/esm/list/favorites.native.js +59 -0
  293. package/dist/esm/list/favorites.native.js.map +1 -0
  294. package/dist/esm/list/listState.mjs +71 -0
  295. package/dist/esm/list/listState.mjs.map +1 -0
  296. package/dist/esm/list/listState.native.js +202 -0
  297. package/dist/esm/list/listState.native.js.map +1 -0
  298. package/dist/esm/list/recordLook.mjs +10 -0
  299. package/dist/esm/list/recordLook.mjs.map +1 -0
  300. package/dist/esm/list/recordLook.native.js +11 -0
  301. package/dist/esm/list/recordLook.native.js.map +1 -0
  302. package/dist/esm/list/useListControls.mjs +164 -0
  303. package/dist/esm/list/useListControls.mjs.map +1 -0
  304. package/dist/esm/list/useListControls.native.js +244 -0
  305. package/dist/esm/list/useListControls.native.js.map +1 -0
  306. package/dist/esm/record/RecordBars.mjs +175 -0
  307. package/dist/esm/record/RecordBars.mjs.map +1 -0
  308. package/dist/esm/record/RecordBars.native.js +197 -0
  309. package/dist/esm/record/RecordBars.native.js.map +1 -0
  310. package/dist/esm/record/RecordGallery.mjs +42 -0
  311. package/dist/esm/record/RecordGallery.mjs.map +1 -0
  312. package/dist/esm/record/RecordGallery.native.js +47 -0
  313. package/dist/esm/record/RecordGallery.native.js.map +1 -0
  314. package/dist/esm/record/RecordHero.mjs +205 -0
  315. package/dist/esm/record/RecordHero.mjs.map +1 -0
  316. package/dist/esm/record/RecordHero.native.js +213 -0
  317. package/dist/esm/record/RecordHero.native.js.map +1 -0
  318. package/dist/esm/record/RecordPage.mjs +305 -0
  319. package/dist/esm/record/RecordPage.mjs.map +1 -0
  320. package/dist/esm/record/RecordPage.native.js +336 -0
  321. package/dist/esm/record/RecordPage.native.js.map +1 -0
  322. package/dist/esm/record/RecordPager.mjs +100 -0
  323. package/dist/esm/record/RecordPager.mjs.map +1 -0
  324. package/dist/esm/record/RecordPager.native.js +102 -0
  325. package/dist/esm/record/RecordPager.native.js.map +1 -0
  326. package/dist/esm/record/RecordRows.mjs +101 -0
  327. package/dist/esm/record/RecordRows.mjs.map +1 -0
  328. package/dist/esm/record/RecordRows.native.js +112 -0
  329. package/dist/esm/record/RecordRows.native.js.map +1 -0
  330. package/dist/esm/record/recordData.mjs +92 -0
  331. package/dist/esm/record/recordData.mjs.map +1 -0
  332. package/dist/esm/record/recordData.native.js +156 -0
  333. package/dist/esm/record/recordData.native.js.map +1 -0
  334. package/dist/esm/record/recordSections.mjs +5 -0
  335. package/dist/esm/record/recordSections.mjs.map +1 -0
  336. package/dist/esm/record/recordSections.native.js +5 -0
  337. package/dist/esm/record/recordSections.native.js.map +1 -0
  338. package/dist/esm/useFrappeFacets.mjs +1 -1
  339. package/dist/esm/useFrappeFacets.mjs.map +1 -1
  340. package/dist/esm/useFrappeFacets.native.js +1 -1
  341. package/dist/esm/useFrappeFacets.native.js.map +1 -1
  342. package/dist/jsx/FrappeCalendar.mjs +1 -1
  343. package/dist/jsx/FrappeCalendar.mjs.map +1 -1
  344. package/dist/jsx/FrappeCalendar.native.js +1 -1
  345. package/dist/jsx/FrappeCalendar.native.js.map +1 -1
  346. package/dist/jsx/FrappeDashboard.mjs +1 -1
  347. package/dist/jsx/FrappeDashboard.mjs.map +1 -1
  348. package/dist/jsx/FrappeDashboard.native.js +1 -1
  349. package/dist/jsx/FrappeDashboard.native.js.map +1 -1
  350. package/dist/jsx/FrappeForm.mjs +8 -0
  351. package/dist/jsx/FrappeForm.mjs.map +1 -1
  352. package/dist/jsx/FrappeForm.native.js +9 -0
  353. package/dist/jsx/FrappeForm.native.js.map +1 -1
  354. package/dist/jsx/FrappeImageView.mjs +1 -1
  355. package/dist/jsx/FrappeImageView.mjs.map +1 -1
  356. package/dist/jsx/FrappeImageView.native.js +1 -1
  357. package/dist/jsx/FrappeImageView.native.js.map +1 -1
  358. package/dist/jsx/FrappeInsights.mjs +355 -0
  359. package/dist/jsx/FrappeInsights.mjs.map +1 -0
  360. package/dist/jsx/FrappeInsights.native.js +447 -0
  361. package/dist/jsx/FrappeInsights.native.js.map +1 -0
  362. package/dist/jsx/FrappeLikedBy.mjs +6 -3
  363. package/dist/jsx/FrappeLikedBy.mjs.map +1 -1
  364. package/dist/jsx/FrappeLikedBy.native.js +5 -2
  365. package/dist/jsx/FrappeLikedBy.native.js.map +1 -1
  366. package/dist/jsx/FrappeListView.mjs +410 -43
  367. package/dist/jsx/FrappeListView.mjs.map +1 -1
  368. package/dist/jsx/FrappeListView.native.js +469 -42
  369. package/dist/jsx/FrappeListView.native.js.map +1 -1
  370. package/dist/jsx/FrappeNotConfigured.mjs +29 -0
  371. package/dist/jsx/FrappeNotConfigured.mjs.map +1 -0
  372. package/dist/jsx/FrappeNotConfigured.native.js +58 -0
  373. package/dist/jsx/FrappeNotConfigured.native.js.map +1 -0
  374. package/dist/jsx/FrappeRecordView.mjs +174 -0
  375. package/dist/jsx/FrappeRecordView.mjs.map +1 -0
  376. package/dist/jsx/FrappeRecordView.native.js +218 -0
  377. package/dist/jsx/FrappeRecordView.native.js.map +1 -0
  378. package/dist/jsx/FrappeReportBuilder.mjs +2 -2
  379. package/dist/jsx/FrappeReportBuilder.mjs.map +1 -1
  380. package/dist/jsx/FrappeReportBuilder.native.js +2 -2
  381. package/dist/jsx/FrappeReportBuilder.native.js.map +1 -1
  382. package/dist/jsx/FrappeReportView.mjs +1 -1
  383. package/dist/jsx/FrappeReportView.mjs.map +1 -1
  384. package/dist/jsx/FrappeReportView.native.js +2 -2
  385. package/dist/jsx/FrappeReportView.native.js.map +1 -1
  386. package/dist/jsx/FrappeTreeView.mjs +1 -1
  387. package/dist/jsx/FrappeTreeView.mjs.map +1 -1
  388. package/dist/jsx/FrappeTreeView.native.js +1 -1
  389. package/dist/jsx/desk/awesomebar.mjs +1 -1
  390. package/dist/jsx/desk/awesomebar.mjs.map +1 -1
  391. package/dist/jsx/desk/awesomebar.native.js +3 -3
  392. package/dist/jsx/desk/awesomebar.native.js.map +1 -1
  393. package/dist/jsx/fields/CodeEditor/index.mjs +2 -2
  394. package/dist/jsx/fields/CodeEditor/index.mjs.map +1 -1
  395. package/dist/jsx/fields/CodeEditor/index.native.js +1 -1
  396. package/dist/jsx/fields/CodeEditor/index.native.js.map +1 -1
  397. package/dist/jsx/fields/Color/index.mjs +1 -0
  398. package/dist/jsx/fields/Color/index.mjs.map +1 -1
  399. package/dist/jsx/fields/Color/index.native.js +1 -0
  400. package/dist/jsx/fields/Color/index.native.js.map +1 -1
  401. package/dist/jsx/fields/FileUpload.mjs +2 -2
  402. package/dist/jsx/fields/FileUpload.mjs.map +1 -1
  403. package/dist/jsx/fields/FileUpload.native.js +1 -1
  404. package/dist/jsx/fields/FileUpload.native.js.map +1 -1
  405. package/dist/jsx/fields/Heading/index.mjs +21 -14
  406. package/dist/jsx/fields/Heading/index.mjs.map +1 -1
  407. package/dist/jsx/fields/Heading/index.native.js +22 -13
  408. package/dist/jsx/fields/Heading/index.native.js.map +1 -1
  409. package/dist/jsx/fields/MarkdownEditor/index.mjs +2 -1
  410. package/dist/jsx/fields/MarkdownEditor/index.mjs.map +1 -1
  411. package/dist/jsx/fields/MarkdownEditor/index.native.js +1 -1
  412. package/dist/jsx/fields/MarkdownEditor/index.native.js.map +1 -1
  413. package/dist/jsx/frappeNavigation.mjs +11 -2
  414. package/dist/jsx/frappeNavigation.mjs.map +1 -1
  415. package/dist/jsx/frappeNavigation.native.js +13 -2
  416. package/dist/jsx/frappeNavigation.native.js.map +1 -1
  417. package/dist/jsx/index.js +14 -2
  418. package/dist/jsx/index.js.map +1 -1
  419. package/dist/jsx/index.mjs +14 -2
  420. package/dist/jsx/index.mjs.map +1 -1
  421. package/dist/jsx/index.native.js +34 -0
  422. package/dist/jsx/index.native.js.map +1 -1
  423. package/dist/jsx/insights/InsightsFacetTags.mjs +122 -0
  424. package/dist/jsx/insights/InsightsFacetTags.mjs.map +1 -0
  425. package/dist/jsx/insights/InsightsFacetTags.native.js +165 -0
  426. package/dist/jsx/insights/InsightsFacetTags.native.js.map +1 -0
  427. package/dist/jsx/insights/InsightsKpiBand.mjs +99 -0
  428. package/dist/jsx/insights/InsightsKpiBand.mjs.map +1 -0
  429. package/dist/jsx/insights/InsightsKpiBand.native.js +133 -0
  430. package/dist/jsx/insights/InsightsKpiBand.native.js.map +1 -0
  431. package/dist/jsx/insights/InsightsLeaders.mjs +125 -0
  432. package/dist/jsx/insights/InsightsLeaders.mjs.map +1 -0
  433. package/dist/jsx/insights/InsightsLeaders.native.js +178 -0
  434. package/dist/jsx/insights/InsightsLeaders.native.js.map +1 -0
  435. package/dist/jsx/insights/InsightsRecords.mjs +80 -0
  436. package/dist/jsx/insights/InsightsRecords.mjs.map +1 -0
  437. package/dist/jsx/insights/InsightsRecords.native.js +109 -0
  438. package/dist/jsx/insights/InsightsRecords.native.js.map +1 -0
  439. package/dist/jsx/insights/InsightsTable.mjs +132 -0
  440. package/dist/jsx/insights/InsightsTable.mjs.map +1 -0
  441. package/dist/jsx/insights/InsightsTable.native.js +194 -0
  442. package/dist/jsx/insights/InsightsTable.native.js.map +1 -0
  443. package/dist/jsx/insights/insightsData.mjs +82 -0
  444. package/dist/jsx/insights/insightsData.mjs.map +1 -0
  445. package/dist/jsx/insights/insightsData.native.js +220 -0
  446. package/dist/jsx/insights/insightsData.native.js.map +1 -0
  447. package/dist/jsx/insights/insightsRecord.mjs +9 -0
  448. package/dist/jsx/insights/insightsRecord.mjs.map +1 -0
  449. package/dist/jsx/insights/insightsRecord.native.js +38 -0
  450. package/dist/jsx/insights/insightsRecord.native.js.map +1 -0
  451. package/dist/jsx/list/FacetBadge.mjs +37 -0
  452. package/dist/jsx/list/FacetBadge.mjs.map +1 -0
  453. package/dist/jsx/list/FacetBadge.native.js +66 -0
  454. package/dist/jsx/list/FacetBadge.native.js.map +1 -0
  455. package/dist/jsx/list/FacetRail.mjs +174 -0
  456. package/dist/jsx/list/FacetRail.mjs.map +1 -0
  457. package/dist/jsx/list/FacetRail.native.js +223 -0
  458. package/dist/jsx/list/FacetRail.native.js.map +1 -0
  459. package/dist/jsx/list/ImageWell.mjs +86 -0
  460. package/dist/jsx/list/ImageWell.mjs.map +1 -0
  461. package/dist/jsx/list/ImageWell.native.js +126 -0
  462. package/dist/jsx/list/ImageWell.native.js.map +1 -0
  463. package/dist/jsx/list/ListControls.mjs +201 -0
  464. package/dist/jsx/list/ListControls.mjs.map +1 -0
  465. package/dist/jsx/list/ListControls.native.js +252 -0
  466. package/dist/jsx/list/ListControls.native.js.map +1 -0
  467. package/dist/jsx/list/ListToastHost.mjs +18 -0
  468. package/dist/jsx/list/ListToastHost.mjs.map +1 -0
  469. package/dist/jsx/list/ListToastHost.native.js +59 -0
  470. package/dist/jsx/list/ListToastHost.native.js.map +1 -0
  471. package/dist/jsx/list/RangeFilter.mjs +85 -0
  472. package/dist/jsx/list/RangeFilter.mjs.map +1 -0
  473. package/dist/jsx/list/RangeFilter.native.js +135 -0
  474. package/dist/jsx/list/RangeFilter.native.js.map +1 -0
  475. package/dist/jsx/list/RecordCard.mjs +208 -0
  476. package/dist/jsx/list/RecordCard.mjs.map +1 -0
  477. package/dist/jsx/list/RecordCard.native.js +173 -0
  478. package/dist/jsx/list/RecordCard.native.js.map +1 -0
  479. package/dist/jsx/list/ShufflePanel.mjs +87 -0
  480. package/dist/jsx/list/ShufflePanel.mjs.map +1 -0
  481. package/dist/jsx/list/ShufflePanel.native.js +139 -0
  482. package/dist/jsx/list/ShufflePanel.native.js.map +1 -0
  483. package/dist/jsx/list/facetReading.mjs +45 -0
  484. package/dist/jsx/list/facetReading.mjs.map +1 -0
  485. package/dist/jsx/list/facetReading.native.js +163 -0
  486. package/dist/jsx/list/facetReading.native.js.map +1 -0
  487. package/dist/jsx/list/favorites.mjs +50 -0
  488. package/dist/jsx/list/favorites.mjs.map +1 -0
  489. package/dist/jsx/list/favorites.native.js +91 -0
  490. package/dist/jsx/list/favorites.native.js.map +1 -0
  491. package/dist/jsx/list/listState.mjs +71 -0
  492. package/dist/jsx/list/listState.mjs.map +1 -0
  493. package/dist/jsx/list/listState.native.js +234 -0
  494. package/dist/jsx/list/listState.native.js.map +1 -0
  495. package/dist/jsx/list/recordLook.mjs +10 -0
  496. package/dist/jsx/list/recordLook.mjs.map +1 -0
  497. package/dist/jsx/list/recordLook.native.js +39 -0
  498. package/dist/jsx/list/recordLook.native.js.map +1 -0
  499. package/dist/jsx/list/useListControls.mjs +164 -0
  500. package/dist/jsx/list/useListControls.mjs.map +1 -0
  501. package/dist/jsx/list/useListControls.native.js +272 -0
  502. package/dist/jsx/list/useListControls.native.js.map +1 -0
  503. package/dist/jsx/record/RecordBars.mjs +175 -0
  504. package/dist/jsx/record/RecordBars.mjs.map +1 -0
  505. package/dist/jsx/record/RecordBars.native.js +225 -0
  506. package/dist/jsx/record/RecordBars.native.js.map +1 -0
  507. package/dist/jsx/record/RecordGallery.mjs +42 -0
  508. package/dist/jsx/record/RecordGallery.mjs.map +1 -0
  509. package/dist/jsx/record/RecordGallery.native.js +75 -0
  510. package/dist/jsx/record/RecordGallery.native.js.map +1 -0
  511. package/dist/jsx/record/RecordHero.mjs +205 -0
  512. package/dist/jsx/record/RecordHero.mjs.map +1 -0
  513. package/dist/jsx/record/RecordHero.native.js +250 -0
  514. package/dist/jsx/record/RecordHero.native.js.map +1 -0
  515. package/dist/jsx/record/RecordPage.mjs +305 -0
  516. package/dist/jsx/record/RecordPage.mjs.map +1 -0
  517. package/dist/jsx/record/RecordPage.native.js +364 -0
  518. package/dist/jsx/record/RecordPage.native.js.map +1 -0
  519. package/dist/jsx/record/RecordPager.mjs +100 -0
  520. package/dist/jsx/record/RecordPager.mjs.map +1 -0
  521. package/dist/jsx/record/RecordPager.native.js +130 -0
  522. package/dist/jsx/record/RecordPager.native.js.map +1 -0
  523. package/dist/jsx/record/RecordRows.mjs +101 -0
  524. package/dist/jsx/record/RecordRows.mjs.map +1 -0
  525. package/dist/jsx/record/RecordRows.native.js +140 -0
  526. package/dist/jsx/record/RecordRows.native.js.map +1 -0
  527. package/dist/jsx/record/recordData.mjs +92 -0
  528. package/dist/jsx/record/recordData.mjs.map +1 -0
  529. package/dist/jsx/record/recordData.native.js +189 -0
  530. package/dist/jsx/record/recordData.native.js.map +1 -0
  531. package/dist/jsx/record/recordSections.mjs +5 -0
  532. package/dist/jsx/record/recordSections.mjs.map +1 -0
  533. package/dist/jsx/record/recordSections.native.js +33 -0
  534. package/dist/jsx/record/recordSections.native.js.map +1 -0
  535. package/dist/jsx/useFrappeFacets.mjs +1 -1
  536. package/dist/jsx/useFrappeFacets.mjs.map +1 -1
  537. package/dist/jsx/useFrappeFacets.native.js +1 -1
  538. package/dist/jsx/useFrappeFacets.native.js.map +1 -1
  539. package/package.json +16 -16
  540. package/src/FormSidebar.stories.tsx +2 -0
  541. package/src/FrappeCalendar.stories.tsx +2 -0
  542. package/src/FrappeCalendar.tsx +2 -2
  543. package/src/FrappeChartCard.stories.tsx +2 -0
  544. package/src/FrappeDashboard.stories.tsx +2 -0
  545. package/src/FrappeDashboard.tsx +2 -2
  546. package/src/FrappeForm.tsx +7 -1
  547. package/src/FrappeImageView.stories.tsx +2 -0
  548. package/src/FrappeImageView.tsx +2 -1
  549. package/src/FrappeInsights.spec.tsx +171 -0
  550. package/src/FrappeInsights.tsx +422 -0
  551. package/src/FrappeKPICard.stories.tsx +3 -3
  552. package/src/FrappeKanban.stories.tsx +4 -8
  553. package/src/FrappeLikedBy.tsx +7 -5
  554. package/src/FrappeListView.card.spec.tsx +157 -0
  555. package/src/FrappeListView.controls.spec.tsx +225 -0
  556. package/src/FrappeListView.seed.spec.tsx +30 -0
  557. package/src/FrappeListView.stories.tsx +2 -0
  558. package/src/FrappeListView.tsx +589 -45
  559. package/src/FrappeNotConfigured.tsx +29 -0
  560. package/src/FrappeRecordView.spec.tsx +276 -0
  561. package/src/FrappeRecordView.tsx +231 -0
  562. package/src/FrappeReportBuilder.tsx +4 -5
  563. package/src/FrappeReportView.tsx +1 -1
  564. package/src/FrappeTreeView.tsx +1 -1
  565. package/src/clientCache.auth.spec.tsx +94 -0
  566. package/src/desk/DeskFormSidebar.stories.tsx +2 -0
  567. package/src/desk/DeskShell.stories.tsx +12 -6
  568. package/src/desk/awesomebar.auth.spec.tsx +77 -0
  569. package/src/desk/awesomebar.tsx +1 -1
  570. package/src/fields/CodeEditor/index.tsx +8 -2
  571. package/src/fields/Color/Color.stories.tsx +2 -0
  572. package/src/fields/Color/index.tsx +1 -0
  573. package/src/fields/FileUpload.tsx +8 -2
  574. package/src/fields/Heading/index.tsx +41 -17
  575. package/src/fields/MarkdownEditor/index.native.tsx +8 -2
  576. package/src/fields/MarkdownEditor/index.tsx +8 -1
  577. package/src/fields/ReadOnly/ReadOnly.stories.tsx +2 -0
  578. package/src/frappeNavigation.loader.spec.tsx +45 -0
  579. package/src/frappeNavigation.tsx +32 -1
  580. package/src/frappeRoutes.notConfigured.spec.tsx +77 -0
  581. package/src/index.ts +53 -1
  582. package/src/insights/InsightsFacetTags.tsx +131 -0
  583. package/src/insights/InsightsKpiBand.tsx +114 -0
  584. package/src/insights/InsightsLeaders.tsx +146 -0
  585. package/src/insights/InsightsRecords.tsx +71 -0
  586. package/src/insights/InsightsTable.tsx +169 -0
  587. package/src/insights/insightsData.spec.ts +143 -0
  588. package/src/insights/insightsData.ts +122 -0
  589. package/src/insights/insightsRecord.ts +36 -0
  590. package/src/list/FacetBadge.tsx +41 -0
  591. package/src/list/FacetRail.tsx +235 -0
  592. package/src/list/ImageWell.tsx +110 -0
  593. package/src/list/ListControls.tsx +208 -0
  594. package/src/list/ListToastHost.tsx +27 -0
  595. package/src/list/RangeFilter.tsx +83 -0
  596. package/src/list/RecordCard.native.tsx +126 -0
  597. package/src/list/RecordCard.tsx +260 -0
  598. package/src/list/ShufflePanel.tsx +107 -0
  599. package/src/list/facetReading.ts +79 -0
  600. package/src/list/favorites.spec.ts +80 -0
  601. package/src/list/favorites.ts +79 -0
  602. package/src/list/listState.spec.ts +156 -0
  603. package/src/list/listState.ts +184 -0
  604. package/src/list/recordLook.ts +37 -0
  605. package/src/list/useListControls.tsx +223 -0
  606. package/src/record/RecordBars.tsx +187 -0
  607. package/src/record/RecordGallery.tsx +47 -0
  608. package/src/record/RecordHero.tsx +186 -0
  609. package/src/record/RecordPage.tsx +358 -0
  610. package/src/record/RecordPager.tsx +97 -0
  611. package/src/record/RecordRows.tsx +90 -0
  612. package/src/record/recordData.spec.ts +148 -0
  613. package/src/record/recordData.ts +124 -0
  614. package/src/record/recordSections.ts +62 -0
  615. package/src/schemaForm/SchemaForm.stories.tsx +2 -2
  616. package/src/useFrappeFacets.ts +14 -7
  617. package/types/FrappeForm.d.ts +2 -1
  618. package/types/FrappeForm.d.ts.map +1 -1
  619. package/types/FrappeImageView.d.ts.map +1 -1
  620. package/types/FrappeInsights.d.ts +55 -0
  621. package/types/FrappeInsights.d.ts.map +1 -0
  622. package/types/FrappeLikedBy.d.ts.map +1 -1
  623. package/types/FrappeListView.d.ts +85 -3
  624. package/types/FrappeListView.d.ts.map +1 -1
  625. package/types/FrappeNotConfigured.d.ts +11 -0
  626. package/types/FrappeNotConfigured.d.ts.map +1 -0
  627. package/types/FrappeRecordView.d.ts +69 -0
  628. package/types/FrappeRecordView.d.ts.map +1 -0
  629. package/types/FrappeReportBuilder.d.ts.map +1 -1
  630. package/types/fields/CodeEditor/index.d.ts.map +1 -1
  631. package/types/fields/Color/index.d.ts.map +1 -1
  632. package/types/fields/FileUpload.d.ts.map +1 -1
  633. package/types/fields/Heading/index.d.ts.map +1 -1
  634. package/types/fields/MarkdownEditor/index.d.ts.map +1 -1
  635. package/types/fields/MarkdownEditor/index.native.d.ts.map +1 -1
  636. package/types/frappeNavigation.d.ts +21 -0
  637. package/types/frappeNavigation.d.ts.map +1 -1
  638. package/types/index.d.ts +14 -2
  639. package/types/index.d.ts.map +1 -1
  640. package/types/insights/InsightsFacetTags.d.ts +11 -0
  641. package/types/insights/InsightsFacetTags.d.ts.map +1 -0
  642. package/types/insights/InsightsKpiBand.d.ts +22 -0
  643. package/types/insights/InsightsKpiBand.d.ts.map +1 -0
  644. package/types/insights/InsightsLeaders.d.ts +16 -0
  645. package/types/insights/InsightsLeaders.d.ts.map +1 -0
  646. package/types/insights/InsightsRecords.d.ts +19 -0
  647. package/types/insights/InsightsRecords.d.ts.map +1 -0
  648. package/types/insights/InsightsTable.d.ts +17 -0
  649. package/types/insights/InsightsTable.d.ts.map +1 -0
  650. package/types/insights/insightsData.d.ts +45 -0
  651. package/types/insights/insightsData.d.ts.map +1 -0
  652. package/types/insights/insightsRecord.d.ts +29 -0
  653. package/types/insights/insightsRecord.d.ts.map +1 -0
  654. package/types/list/FacetBadge.d.ts +13 -0
  655. package/types/list/FacetBadge.d.ts.map +1 -0
  656. package/types/list/FacetRail.d.ts +26 -0
  657. package/types/list/FacetRail.d.ts.map +1 -0
  658. package/types/list/ImageWell.d.ts +24 -0
  659. package/types/list/ImageWell.d.ts.map +1 -0
  660. package/types/list/ListControls.d.ts +30 -0
  661. package/types/list/ListControls.d.ts.map +1 -0
  662. package/types/list/ListToastHost.d.ts +7 -0
  663. package/types/list/ListToastHost.d.ts.map +1 -0
  664. package/types/list/RangeFilter.d.ts +14 -0
  665. package/types/list/RangeFilter.d.ts.map +1 -0
  666. package/types/list/RecordCard.d.ts +38 -0
  667. package/types/list/RecordCard.d.ts.map +1 -0
  668. package/types/list/RecordCard.native.d.ts +9 -0
  669. package/types/list/RecordCard.native.d.ts.map +1 -0
  670. package/types/list/ShufflePanel.d.ts +24 -0
  671. package/types/list/ShufflePanel.d.ts.map +1 -0
  672. package/types/list/facetReading.d.ts +33 -0
  673. package/types/list/facetReading.d.ts.map +1 -0
  674. package/types/list/favorites.d.ts +26 -0
  675. package/types/list/favorites.d.ts.map +1 -0
  676. package/types/list/listState.d.ts +94 -0
  677. package/types/list/listState.d.ts.map +1 -0
  678. package/types/list/recordLook.d.ts +25 -0
  679. package/types/list/recordLook.d.ts.map +1 -0
  680. package/types/list/useListControls.d.ts +48 -0
  681. package/types/list/useListControls.d.ts.map +1 -0
  682. package/types/record/RecordBars.d.ts +11 -0
  683. package/types/record/RecordBars.d.ts.map +1 -0
  684. package/types/record/RecordGallery.d.ts +17 -0
  685. package/types/record/RecordGallery.d.ts.map +1 -0
  686. package/types/record/RecordHero.d.ts +42 -0
  687. package/types/record/RecordHero.d.ts.map +1 -0
  688. package/types/record/RecordPage.d.ts +54 -0
  689. package/types/record/RecordPage.d.ts.map +1 -0
  690. package/types/record/RecordPager.d.ts +13 -0
  691. package/types/record/RecordPager.d.ts.map +1 -0
  692. package/types/record/RecordRows.d.ts +13 -0
  693. package/types/record/RecordRows.d.ts.map +1 -0
  694. package/types/record/recordData.d.ts +46 -0
  695. package/types/record/recordData.d.ts.map +1 -0
  696. package/types/record/recordSections.d.ts +67 -0
  697. package/types/record/recordSections.d.ts.map +1 -0
  698. package/types/useFrappeFacets.d.ts.map +1 -1
@@ -0,0 +1,29 @@
1
+ import { EmptyState, ListPageLayout, PageHeader } from "@multiplatform.one/components";
2
+ import { useTranslation } from "react-i18next";
3
+
4
+ export interface FrappeNotConfiguredProps {
5
+ doctype: string;
6
+ /** A routed page keeps the page template, the doctype as its title. */
7
+ page?: boolean;
8
+ }
9
+
10
+ /**
11
+ * What a doctype's list or form shows when neither a bench URL nor a fixture
12
+ * corpus is configured (a host built with Frappe off), in place of the view.
13
+ */
14
+ export function FrappeNotConfigured({ doctype, page = false }: FrappeNotConfiguredProps) {
15
+ const { t } = useTranslation();
16
+ const state = (
17
+ <EmptyState
18
+ testID="frappe-not-configured"
19
+ title={t("Frappe is not configured")}
20
+ description={t("{{doctype}} can't load without a Frappe bench URL.", { doctype })}
21
+ />
22
+ );
23
+ if (!page) return state;
24
+ return (
25
+ <ListPageLayout scroll={false} header={<PageHeader title={doctype} divider={false} />}>
26
+ {state}
27
+ </ListPageLayout>
28
+ );
29
+ }
@@ -0,0 +1,276 @@
1
+ // FrappeRecordView (MPO-411): a doctype's record page declared from its look,
2
+ // facet, metrics and tabs, the way pokemon's detail page drew itself by hand.
3
+ import { renderWithProviders } from "@multiplatform.one/test-utils";
4
+ import { ArrowSquareOutIcon } from "@phosphor-icons/react";
5
+ import { cleanup, fireEvent, screen, waitFor, within } from "@testing-library/react";
6
+ import i18next from "i18next";
7
+ import { initReactI18next } from "react-i18next";
8
+ import { afterAll, afterEach, beforeAll, describe, expect, it, vi } from "vitest";
9
+ import { Order } from "@multiplatform.one/frappe";
10
+ import {
11
+ createRosterFixtures,
12
+ rosterPokemon,
13
+ rosterPokemonFields,
14
+ rosterPokemonMeta,
15
+ type RosterPokemon,
16
+ } from "../tests/fixtures/pokemonRoster";
17
+ import type { FrappeNavigation } from "./frappeNavigation";
18
+ import { FrappeProvider } from "./FrappeProvider";
19
+ import { FrappeRecordView, type FrappeRecordViewProps } from "./FrappeRecordView";
20
+ import { favoritesStore } from "./list/favorites";
21
+
22
+ const host = "https://record-view.spec.test";
23
+ const realFetch = globalThis.fetch;
24
+ const favoritesKey = "record-spec-favorites";
25
+
26
+ beforeAll(async () => {
27
+ await i18next.use(initReactI18next).init({
28
+ lng: "en",
29
+ interpolation: { escapeValue: false },
30
+ resources: { en: { translation: {} } },
31
+ });
32
+ globalThis.fetch = (async (input: RequestInfo | URL, init?: RequestInit) => {
33
+ const url = typeof input === "string" ? input : input instanceof URL ? input.href : input.url;
34
+ if (url.startsWith(host)) {
35
+ const body = /\/api\/resource\/DocType\//.test(url)
36
+ ? { data: rosterPokemonMeta }
37
+ : { data: [] };
38
+ return new Response(JSON.stringify(body), {
39
+ status: 200,
40
+ headers: { "Content-Type": "application/json" },
41
+ });
42
+ }
43
+ return realFetch(input as RequestInfo, init);
44
+ }) as typeof fetch;
45
+ });
46
+
47
+ afterAll(() => {
48
+ globalThis.fetch = realFetch;
49
+ });
50
+
51
+ afterEach(() => {
52
+ cleanup();
53
+ vi.restoreAllMocks();
54
+ favoritesStore(favoritesKey).setState(() => ({ names: [] }));
55
+ });
56
+
57
+ const pokemon = rosterPokemon.map((doc) =>
58
+ doc.name === "pikachu"
59
+ ? {
60
+ ...doc,
61
+ owner: "ash@example.com",
62
+ creation: "2026-08-01 10:00:00",
63
+ modified_by: "misty@example.com",
64
+ stats: [
65
+ { stat_name: "speed", base_stat: 90 },
66
+ { stat_name: "hp", base_stat: 35 },
67
+ ],
68
+ }
69
+ : { ...doc },
70
+ );
71
+
72
+ const declaration: Partial<FrappeRecordViewProps<RosterPokemon>> = {
73
+ listTitle: "Roster",
74
+ fields: rosterPokemonFields,
75
+ orderBy: [{ field: "poke_id", order: Order.Asc }],
76
+ connections: [
77
+ { doctype: "Pokemon Poke Type", fieldname: "pokemon", fields: ["poke_type", "slot"] },
78
+ {
79
+ doctype: "Pokemon Poke Ability",
80
+ fieldname: "pokemon",
81
+ fields: ["poke_ability", "is_hidden", "slot"],
82
+ },
83
+ {
84
+ doctype: "Pokemon Poke Move",
85
+ fieldname: "pokemon",
86
+ fields: ["poke_move", "level_learned_at", "move_learn_method"],
87
+ },
88
+ ],
89
+ look: {
90
+ title: (doc) => (doc.pokemon_name ?? "").toUpperCase(),
91
+ code: (doc) => `#${String(doc.poke_id ?? 0).padStart(3, "0")}`,
92
+ subtitle: (doc) => doc.species,
93
+ images: (doc) => [`https://art.spec.test/${doc.poke_id}.png`],
94
+ },
95
+ facet: {
96
+ param: "type",
97
+ doctype: "Pokemon Poke Type",
98
+ field: "poke_type",
99
+ orderBy: "slot",
100
+ options: [],
101
+ label: "Type",
102
+ optionLabel: (value) => `type:${value}`,
103
+ tint: (value) => (value === "grass" ? "grass" : "purple"),
104
+ },
105
+ metrics: [{ field: "base_experience", label: "Base XP", max: 608 }],
106
+ summary: (doc) => ({ text: `${doc.pokemon_name}, the ${doc.species}.`, cite: "The dex" }),
107
+ favorites: favoritesKey,
108
+ actions: [
109
+ {
110
+ label: "Open in backoffice",
111
+ icon: ArrowSquareOutIcon,
112
+ href: (doc) => `/backoffice/pokemon/${doc.name}`,
113
+ testID: "hop",
114
+ },
115
+ ],
116
+ tabs: [
117
+ {
118
+ value: "overview",
119
+ label: "Overview",
120
+ sections: [
121
+ {
122
+ kind: "rows",
123
+ doctype: "Pokemon Poke Ability",
124
+ field: "poke_ability",
125
+ title: "Abilities",
126
+ orderBy: ["slot"],
127
+ flag: { field: "is_hidden", label: "Hidden" },
128
+ },
129
+ {
130
+ kind: "bars",
131
+ id: "stats",
132
+ table: "stats",
133
+ label: "stat_name",
134
+ value: "base_stat",
135
+ max: 255,
136
+ order: ["hp", "speed"],
137
+ title: "Stats",
138
+ totalLabel: "Stat total",
139
+ },
140
+ ],
141
+ },
142
+ {
143
+ value: "moves",
144
+ label: "Moves",
145
+ count: "Pokemon Poke Move",
146
+ sections: [
147
+ {
148
+ kind: "rows",
149
+ doctype: "Pokemon Poke Move",
150
+ field: "poke_move",
151
+ orderBy: ["move_learn_method", "level_learned_at", "poke_move"],
152
+ detail: { field: "level_learned_at", label: (level) => `Lv ${level}` },
153
+ groupBy: { field: "move_learn_method", label: (method) => method.toUpperCase() },
154
+ },
155
+ ],
156
+ },
157
+ ],
158
+ };
159
+
160
+ function renderRecord(name: string, navigate = vi.fn()) {
161
+ const navigation: FrappeNavigation = {
162
+ usePathname: () => `/pokemon/${name}`,
163
+ useNavigate: () => navigate,
164
+ };
165
+ return renderWithProviders(
166
+ <FrappeProvider
167
+ baseURL={host}
168
+ fixtures={createRosterFixtures({ Pokemon: pokemon })}
169
+ navigation={navigation}
170
+ >
171
+ <FrappeRecordView<RosterPokemon> doctype="Pokemon" route="/pokemon" {...declaration} />
172
+ </FrappeProvider>,
173
+ );
174
+ }
175
+
176
+ async function identity(): Promise<HTMLElement> {
177
+ return screen.findByTestId("pokemon-hero-identity", {}, { timeout: 5000 });
178
+ }
179
+
180
+ describe("FrappeRecordView heads the record from its look and facet", () => {
181
+ it("names the record by code, title and subtitle under the list's breadcrumb", async () => {
182
+ renderRecord("bulbasaur");
183
+ const hero = await identity();
184
+ expect(hero.textContent).toContain("#001");
185
+ expect(hero.textContent).toContain("BULBASAUR");
186
+ expect(hero.textContent).toContain("Seed Pokémon");
187
+ expect(screen.getByText("Roster")).toBeTruthy();
188
+ expect(screen.getByText("#001 BULBASAUR")).toBeTruthy();
189
+ });
190
+
191
+ it("badges the facet's values in slot order and draws the first image", async () => {
192
+ renderRecord("bulbasaur");
193
+ const hero = await identity();
194
+ await waitFor(() => expect(hero.textContent).toContain("type:poison"));
195
+ const text = hero.textContent ?? "";
196
+ expect(text.indexOf("type:grass")).toBeLessThan(text.indexOf("type:poison"));
197
+ const art = screen.getByTestId("pokemon-hero-art");
198
+ expect(art.querySelector("img")?.getAttribute("src")).toBe("https://art.spec.test/1.png");
199
+ });
200
+
201
+ it("tiles each metric, a max adding a bar", async () => {
202
+ renderRecord("bulbasaur");
203
+ const hero = await identity();
204
+ expect(hero.textContent).toContain("Base XP");
205
+ expect(hero.textContent).toContain("64");
206
+ expect(within(hero).getByLabelText("Base XP")).toBeTruthy();
207
+ });
208
+ });
209
+
210
+ describe("FrappeRecordView tabs the record's rows", () => {
211
+ it("opens with the summary, the linked rows in order with their flags, and the audit trail", async () => {
212
+ renderRecord("pikachu");
213
+ await identity();
214
+ expect(await screen.findByText("pikachu, the Mouse Pokémon.")).toBeTruthy();
215
+ await waitFor(() => expect(screen.getByText("lightning rod")).toBeTruthy());
216
+ expect(screen.getAllByText("Hidden")).toHaveLength(1);
217
+ expect(screen.getByText("Record history")).toBeTruthy();
218
+ });
219
+
220
+ it("draws a child table as bars on a fixed scale with their total", async () => {
221
+ renderRecord("pikachu");
222
+ await identity();
223
+ expect(await screen.findByTestId("pokemon-stats-chart")).toBeTruthy();
224
+ expect(screen.getByText("Stat total")).toBeTruthy();
225
+ expect(screen.getByText("125")).toBeTruthy();
226
+ });
227
+
228
+ it("badges a tab with its rows' count and groups them, detailed", async () => {
229
+ renderRecord("pikachu");
230
+ await identity();
231
+ const movesTab = await waitFor(() => {
232
+ const tab = screen.getAllByRole("tab").find((node) => node.textContent?.includes("Moves"));
233
+ expect(tab?.textContent).toContain("3");
234
+ return tab as HTMLElement;
235
+ });
236
+ fireEvent.click(movesTab);
237
+ expect(await screen.findByText("LEVEL-UP")).toBeTruthy();
238
+ expect(screen.getByText("MACHINE")).toBeTruthy();
239
+ expect(screen.getByText("Lv 16")).toBeTruthy();
240
+ });
241
+ });
242
+
243
+ describe("FrappeRecordView's controls", () => {
244
+ it("opens the neighbors in the list's order and the edit form", async () => {
245
+ const navigate = vi.fn();
246
+ renderRecord("pikachu", navigate);
247
+ await identity();
248
+ fireEvent.click(await screen.findByTestId("pokemon-next", {}, { timeout: 5000 }));
249
+ expect(navigate).toHaveBeenCalledWith("/pokemon/gengar");
250
+ fireEvent.click(screen.getByTestId("pokemon-prev"));
251
+ expect(navigate).toHaveBeenCalledWith("/pokemon/squirtle");
252
+ fireEvent.click(screen.getByTestId("pokemon-detail-edit"));
253
+ expect(navigate).toHaveBeenCalledWith("/pokemon/pikachu/edit");
254
+ });
255
+
256
+ it("toggles the favorite from a real button and hops through a declared action", async () => {
257
+ const navigate = vi.fn();
258
+ renderRecord("pikachu", navigate);
259
+ const heart = await screen.findByTestId("pokemon-detail-favorite", {}, { timeout: 5000 });
260
+ expect(heart.tagName).toBe("BUTTON");
261
+ expect(heart.getAttribute("type")).toBe("button");
262
+ expect(heart.getAttribute("aria-pressed")).toBe("false");
263
+ fireEvent.click(heart);
264
+ await waitFor(() => expect(favoritesStore(favoritesKey).state.names).toEqual(["pikachu"]));
265
+ fireEvent.click(screen.getByTestId("hop"));
266
+ expect(navigate).toHaveBeenCalledWith("/backoffice/pokemon/pikachu");
267
+ });
268
+
269
+ it("names a missing record and offers the way back", async () => {
270
+ const navigate = vi.fn();
271
+ renderRecord("missingno", navigate);
272
+ expect(await screen.findByText("Pokemon not found", {}, { timeout: 5000 })).toBeTruthy();
273
+ fireEvent.click(screen.getByText("Back to Roster"));
274
+ expect(navigate).toHaveBeenCalledWith("/pokemon");
275
+ });
276
+ });
@@ -0,0 +1,231 @@
1
+ import { EmptyState, Screen, ScreenToolbar, YStack } from "@multiplatform.one/components";
2
+ import { Button } from "@multiplatform.one/forms";
3
+ import type { Order } from "@multiplatform.one/frappe";
4
+ import { useResolvedKnobs } from "@multiplatform.one/theme";
5
+ import { ArrowLeftIcon } from "@phosphor-icons/react";
6
+ import { useMemo } from "react";
7
+ import { useTranslation } from "react-i18next";
8
+ import type { FrappeConnection } from "./frappeConnections";
9
+ import { FrappeForm } from "./FrappeForm";
10
+ import { frappeRouteTarget, useFrappeRouter, useRouteLoaderData } from "./frappeNavigation";
11
+ import { FrappeNotConfigured } from "./FrappeNotConfigured";
12
+ import { useFrappeConfig } from "./FrappeProvider";
13
+ import { useDocRights } from "./formEngine/useDocRights";
14
+ import { orderRows } from "./insights/insightsData";
15
+ import type { FrappeInsightsMetric } from "./insights/insightsRecord";
16
+ import type { FrappeListFacet } from "./list/listState";
17
+ import type { FrappeRecordLook } from "./list/recordLook";
18
+ import { RecordBreadcrumbBone, RecordSkeleton } from "./record/RecordHero";
19
+ import { RecordPage, type FrappeRecordAction, type RecordPageProps } from "./record/RecordPage";
20
+ import type { FrappeRecordTab } from "./record/recordSections";
21
+ import { useFrappeConnection, useFrappeRows } from "./useFrappeRows";
22
+
23
+ export type {
24
+ FrappeRecordBarsSection,
25
+ FrappeRecordRowsSection,
26
+ FrappeRecordSection,
27
+ FrappeRecordTab,
28
+ } from "./record/recordSections";
29
+
30
+ export type { FrappeRecordAction } from "./record/RecordPage";
31
+
32
+ type Row = Record<string, unknown>;
33
+
34
+ export interface FrappeRecordViewProps<TDoc extends { name: string; doctype: string }> {
35
+ doctype: string;
36
+ /** The doctype's list route: breadcrumb, Back, Edit and the neighbors hang off it. */
37
+ route: string;
38
+ /** Defaults to the record the route names. */
39
+ name?: string;
40
+ /** The list's title; defaults to the doctype. */
41
+ listTitle?: string;
42
+ /** The record a route loader rendered on the server. */
43
+ initialDoc?: Partial<TDoc>;
44
+ /** The route's loader (`frappeDocLoader`), read through the host's navigation. */
45
+ loader?: (...args: never[]) => Promise<{ doc: Partial<TDoc> | null }>;
46
+ /** The list's read, so the neighbors follow the list's order. */
47
+ fields?: readonly (keyof TDoc & string)[];
48
+ limit?: number;
49
+ orderBy?: Array<{ field: keyof TDoc & string; order: Order }>;
50
+ /** Declared connections; defaults to the meta's (a Guest cannot read meta). */
51
+ connections?: readonly FrappeConnection[];
52
+ look?: FrappeRecordLook<TDoc>;
53
+ titleField?: string;
54
+ /** Its values badge the hero and tint it. */
55
+ facet?: FrappeListFacet;
56
+ /** Numeric fields as fact tiles in the hero; `max` adds a bar. */
57
+ metrics?: readonly FrappeInsightsMetric[];
58
+ /** A quote opening the first tab. */
59
+ summary?: (doc: Partial<TDoc>) => { text: string; cite?: string } | undefined;
60
+ tabs?: readonly FrappeRecordTab[];
61
+ /** Star the record: true keys the stars by doctype, a string names the key. */
62
+ favorites?: boolean | string;
63
+ actions?: readonly FrappeRecordAction<TDoc>[];
64
+ /** False leaves the audit trail off the first tab. */
65
+ history?: boolean;
66
+ /** Prefix of the page's test ids; defaults to the doctype's slug. */
67
+ testID?: string;
68
+ }
69
+
70
+ const noTabs: readonly FrappeRecordTab[] = [];
71
+
72
+ /**
73
+ * A doctype's record page, read first: the list's breadcrumb and Back, the
74
+ * favorite heart, the record's hops and Edit under the write right; a hero
75
+ * with the record's images, code, title, subtitle, facet badges and metric
76
+ * tiles, tinted by the facet; tabs of linked rows and child-table bars with
77
+ * the audit trail; and the records either side of it in the list's order.
78
+ * FrappeForm reads the record and its connections live; loading, not found
79
+ * and error keep the page's wayfinding.
80
+ */
81
+ export function FrappeRecordView<TDoc extends { name: string; doctype: string }>({
82
+ doctype,
83
+ route,
84
+ name: nameProp,
85
+ listTitle,
86
+ initialDoc,
87
+ loader,
88
+ fields,
89
+ limit,
90
+ orderBy,
91
+ connections,
92
+ look,
93
+ titleField,
94
+ facet,
95
+ metrics = [],
96
+ summary,
97
+ tabs = noTabs,
98
+ favorites,
99
+ actions = [],
100
+ history = true,
101
+ testID,
102
+ }: FrappeRecordViewProps<TDoc>) {
103
+ const { t } = useTranslation();
104
+ const { knobProps } = useResolvedKnobs();
105
+ const config = useFrappeConfig();
106
+ const connection = useFrappeConnection();
107
+ const router = useFrappeRouter();
108
+ const target = router ? frappeRouteTarget(route, router.pathname) : undefined;
109
+ const name = nameProp ?? (target?.mode === "view" ? target.name : "");
110
+ const slug = testID ?? doctype.toLowerCase().replace(/\s+/g, "-");
111
+ const loaded = useRouteLoaderData(loader) as { doc?: Partial<TDoc> | null } | undefined;
112
+ const listName = listTitle ?? doctype;
113
+ const navigate = (href: string) => router?.navigate(href);
114
+
115
+ const orderKey = JSON.stringify(orderBy ?? null);
116
+ const readOptions = useMemo(
117
+ () => ({ fields, limit, orderBy: JSON.parse(orderKey) }),
118
+ [fields, limit, orderKey],
119
+ );
120
+ const { rows: readRows } = useFrappeRows<TDoc>(connection, doctype, readOptions);
121
+ const listRows = useMemo(
122
+ () => orderRows(readRows as never[], JSON.parse(orderKey)) as Partial<TDoc>[],
123
+ [readRows, orderKey],
124
+ );
125
+
126
+ if (!config?.baseURL && !config?.fixtures) return <FrappeNotConfigured doctype={doctype} page />;
127
+
128
+ const backButton = (
129
+ <ScreenToolbar
130
+ leading={
131
+ <Button
132
+ outlined
133
+ minHeight={knobProps.sizeToken}
134
+ onPress={() => navigate(route)}
135
+ icon={<ArrowLeftIcon size={16} />}
136
+ testID={`${slug}-detail-back`}
137
+ >
138
+ {t("Back")}
139
+ </Button>
140
+ }
141
+ />
142
+ );
143
+
144
+ return (
145
+ <FrappeForm<TDoc>
146
+ doctype={doctype}
147
+ name={name}
148
+ initialDoc={initialDoc ?? loaded?.doc ?? undefined}
149
+ connections={connections}
150
+ showToolbar={false}
151
+ showSidebar={false}
152
+ showTimeline={false}
153
+ loadingFallback={
154
+ <Screen>
155
+ <YStack gap="$2">
156
+ <RecordBreadcrumbBone />
157
+ {backButton}
158
+ </YStack>
159
+ <RecordSkeleton testID={`${slug}-detail-skeleton`} />
160
+ </Screen>
161
+ }
162
+ notFoundFallback={
163
+ <Screen scroll={false}>
164
+ {backButton}
165
+ <EmptyState
166
+ title={t("{{doctype}} not found", { doctype })}
167
+ description={t("No {{doctype}} is named {{name}}.", { doctype, name })}
168
+ action={
169
+ <Button theme="accent" onPress={() => navigate(route)}>
170
+ {t("Back to {{title}}", { title: listName })}
171
+ </Button>
172
+ }
173
+ />
174
+ </Screen>
175
+ }
176
+ errorFallback={
177
+ <Screen scroll={false}>
178
+ {backButton}
179
+ <EmptyState
180
+ intent="error"
181
+ title={t("Couldn't load this {{doctype}}", { doctype })}
182
+ description={t("Check the connection and try again.")}
183
+ />
184
+ </Screen>
185
+ }
186
+ >
187
+ {({ doc, connections: linked, meta }) => (
188
+ <RecordWithRights
189
+ doc={doc}
190
+ meta={meta}
191
+ page={{
192
+ linked: linked as Record<string, Row[]>,
193
+ doctype,
194
+ route,
195
+ listName,
196
+ listRows,
197
+ look,
198
+ titleField: titleField ?? meta?.title_field,
199
+ facet,
200
+ metrics,
201
+ summary,
202
+ tabs,
203
+ favorites,
204
+ actions,
205
+ history,
206
+ slug,
207
+ baseURL: config?.baseURL,
208
+ navigate,
209
+ }}
210
+ />
211
+ )}
212
+ </FrappeForm>
213
+ );
214
+ }
215
+
216
+ function RecordWithRights<TDoc extends { name: string; doctype: string }>({
217
+ doc,
218
+ meta,
219
+ page,
220
+ }: {
221
+ doc: Partial<TDoc>;
222
+ meta: Parameters<typeof useDocRights>[1];
223
+ page: Omit<RecordPageProps<TDoc>, "doc" | "canEdit">;
224
+ }) {
225
+ const connection = useFrappeConnection();
226
+ const owner = (doc as Row).owner;
227
+ const { rights } = useDocRights(connection, meta, {
228
+ owner: typeof owner === "string" ? owner : undefined,
229
+ });
230
+ return <RecordPage<TDoc> {...page} doc={doc} canEdit={Boolean(rights.write)} />;
231
+ }
@@ -331,12 +331,11 @@ export function FrappeReportBuilder({
331
331
  {...knobProps.panelPadding}
332
332
  alignItems="center"
333
333
  justifyContent="center"
334
+ gap="$2"
334
335
  {...stackProps}
335
336
  >
336
337
  <Spinner size="large" />
337
- <Text color="$color10" marginTop="$2">
338
- {t("Loading {{doctype}} schema...", { doctype })}
339
- </Text>
338
+ <Text color="$color10">{t("Loading {{doctype}} schema...", { doctype })}</Text>
340
339
  </YStack>
341
340
  );
342
341
  }
@@ -354,9 +353,9 @@ export function FrappeReportBuilder({
354
353
 
355
354
  if (isLoading) {
356
355
  return (
357
- <YStack {...knobProps.panelPadding} alignItems="center" {...stackProps}>
356
+ <YStack {...knobProps.panelPadding} alignItems="center" gap="$1" {...stackProps}>
358
357
  <Spinner size="small" />
359
- <Text color="$color10" fontSize="$2" marginTop="$1">
358
+ <Text color="$color10" fontSize="$2">
360
359
  {t("Loading data...")}
361
360
  </Text>
362
361
  </YStack>
@@ -349,7 +349,7 @@ export interface FrappeReportConnection {
349
349
  const callCache = new Map<string, CallModule>();
350
350
 
351
351
  function getCall(connection: FrappeReportConnection): CallModule {
352
- const key = `${connection.baseURL}:${connection.auth?.token ?? ""}:${connection.auth?.type ?? ""}`;
352
+ const key = `${connection.baseURL}:${connection.auth?.useToken ? "t" : ""}:${connection.auth?.token ?? ""}:${connection.auth?.type ?? ""}`;
353
353
  let call = callCache.get(key);
354
354
  if (!call) {
355
355
  const authConfig: AuthConfig | undefined = connection.auth
@@ -398,7 +398,7 @@ export function FrappeTreeView<TDoc extends { name: string; doctype: string }>({
398
398
  {valueField &&
399
399
  node.data &&
400
400
  (node.data as Record<string, unknown>)[valueField] != null && (
401
- <Text color={formCommonColors.muted} {...knobProps.label} marginInlineStart="$2">
401
+ <Text color={formCommonColors.muted} {...knobProps.label} paddingInlineStart="$2">
402
402
  {String((node.data as Record<string, unknown>)[valueField])}
403
403
  </Text>
404
404
  )}
@@ -0,0 +1,94 @@
1
+ // Each hook here caches its REST client per connection. Two connections to
2
+ // one bench that differ only in useToken must not share a client, or the
3
+ // first one built decides whether the other sends its token (MPO-399,
4
+ // MPO-406). The bench answers a tokenless call as Guest.
5
+ import { renderHook, waitFor } from "@testing-library/react";
6
+ import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
7
+ import { useFrappeReport } from "./FrappeReportView";
8
+ import { useFrappeAggregate } from "./useFrappeAggregate";
9
+ import { useFrappeFacets } from "./useFrappeFacets";
10
+
11
+ const token = "token key:secret";
12
+ let sent: (string | null)[] = [];
13
+
14
+ function reply(url: URL): unknown {
15
+ const method = url.pathname.replace(/^\/api\/method\//, "");
16
+ if (method === "frappe.client.get_count") return { message: 3 };
17
+ if (method === "frappe.desk.reportview.get_sidebar_stats") return { message: { stats: {} } };
18
+ if (method === "frappe.desk.query_report.run") return { message: { columns: [], result: [] } };
19
+ return { message: [] };
20
+ }
21
+
22
+ beforeEach(() => {
23
+ sent = [];
24
+ vi.stubGlobal("fetch", async (input: string | URL | Request, init?: RequestInit) => {
25
+ sent.push(new Headers(init?.headers).get("Authorization"));
26
+ return new Response(JSON.stringify(reply(new URL(String(input)))), {
27
+ headers: { "content-type": "application/json" },
28
+ });
29
+ });
30
+ });
31
+
32
+ afterEach(() => vi.unstubAllGlobals());
33
+
34
+ function connection(baseURL: string, useToken: boolean) {
35
+ return { baseURL, realtime: false, auth: { useToken, token: "key:secret", type: "token" } };
36
+ }
37
+
38
+ async function authorizationPerConnection(
39
+ mount: (useToken: boolean) => () => boolean,
40
+ ): Promise<{ off: (string | null)[]; on: (string | null)[] }> {
41
+ const offSettled = mount(false);
42
+ await waitFor(() => expect(offSettled()).toBe(true));
43
+ const off = sent.splice(0);
44
+ const onSettled = mount(true);
45
+ await waitFor(() => expect(onSettled()).toBe(true));
46
+ return { off, on: sent.splice(0) };
47
+ }
48
+
49
+ describe("cached REST clients never drop a connection's token", () => {
50
+ it("useFrappeAggregate", async () => {
51
+ const { off, on } = await authorizationPerConnection((useToken) => {
52
+ const { result } = renderHook(() =>
53
+ useFrappeAggregate(connection("http://aggregate-auth.test", useToken), {
54
+ doctype: "ToDo",
55
+ }),
56
+ );
57
+ return () => !result.current.isLoading;
58
+ });
59
+ expect(off).toEqual([null]);
60
+ expect(on).toEqual([token]);
61
+ });
62
+
63
+ it("useFrappeFacets", async () => {
64
+ const { off, on } = await authorizationPerConnection((useToken) => {
65
+ const { result } = renderHook(() =>
66
+ useFrappeFacets("ToDo", [], {
67
+ connection: connection("http://facets-auth.test", useToken),
68
+ }),
69
+ );
70
+ return () =>
71
+ !result.current.assigned.isLoading &&
72
+ !result.current.owner.isLoading &&
73
+ !result.current.tags.isLoading;
74
+ });
75
+ expect(off.length).toBeGreaterThan(0);
76
+ expect(new Set(off)).toEqual(new Set([null]));
77
+ expect(on.length).toBe(off.length);
78
+ expect(new Set(on)).toEqual(new Set([token]));
79
+ });
80
+
81
+ it("useFrappeReport (FrappeReportView)", async () => {
82
+ const { off, on } = await authorizationPerConnection((useToken) => {
83
+ const { result } = renderHook(() =>
84
+ useFrappeReport(connection("http://report-auth.test", useToken), {
85
+ reportName: "ToDo Summary",
86
+ debounceMs: 0,
87
+ }),
88
+ );
89
+ return () => !result.current.isLoading;
90
+ });
91
+ expect(off).toEqual([null]);
92
+ expect(on).toEqual([token]);
93
+ });
94
+ });
@@ -3,6 +3,8 @@ import { YStack } from "tamagui";
3
3
  import { FrappeProvider } from "../FrappeProvider";
4
4
  import { DeskFormSidebar } from "./DeskFormSidebar";
5
5
 
6
+ // hex-escape: generated image fixtures are data, not paint
7
+
6
8
  export default {
7
9
  title: "FrappeUI/Desk/DeskFormSidebar",
8
10
  component: DeskFormSidebar,