@wildo-ai/saas-frontend-lib 1.1.16 → 1.1.18

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 (685) hide show
  1. package/LICENSE +114 -26
  2. package/LICENSE.enterprise +129 -0
  3. package/dist/esm/companion-exports.d.ts +5 -2
  4. package/dist/esm/companion-exports.d.ts.map +1 -1
  5. package/dist/esm/companion-exports.js +4 -2
  6. package/dist/esm/companion-exports.js.map +1 -1
  7. package/dist/esm/components/actions/action-bar.d.ts +16 -1
  8. package/dist/esm/components/actions/action-bar.d.ts.map +1 -1
  9. package/dist/esm/components/actions/action-bar.js.map +1 -1
  10. package/dist/esm/components/app/AppLayout_AuthenticatedRoute.d.ts.map +1 -1
  11. package/dist/esm/components/app/AppLayout_AuthenticatedRoute.js +6 -14
  12. package/dist/esm/components/app/AppLayout_AuthenticatedRoute.js.map +1 -1
  13. package/dist/esm/components/app/AppLayout_DecisionInbox.d.ts.map +1 -1
  14. package/dist/esm/components/app/AppLayout_DecisionInbox.js +2 -4
  15. package/dist/esm/components/app/AppLayout_DecisionInbox.js.map +1 -1
  16. package/dist/esm/components/app/AppLayout_Home.d.ts.map +1 -1
  17. package/dist/esm/components/app/AppLayout_Home.js +14 -7
  18. package/dist/esm/components/app/AppLayout_Home.js.map +1 -1
  19. package/dist/esm/components/app/AppLayout_IdentityPortalContainer.d.ts +13 -0
  20. package/dist/esm/components/app/AppLayout_IdentityPortalContainer.d.ts.map +1 -0
  21. package/dist/esm/components/app/AppLayout_IdentityPortalContainer.js +16 -0
  22. package/dist/esm/components/app/AppLayout_IdentityPortalContainer.js.map +1 -0
  23. package/dist/esm/components/app/DecisionInboxSection.d.ts +10 -0
  24. package/dist/esm/components/app/DecisionInboxSection.d.ts.map +1 -0
  25. package/dist/esm/components/app/DecisionInboxSection.js +15 -0
  26. package/dist/esm/components/app/DecisionInboxSection.js.map +1 -0
  27. package/dist/esm/components/app/IdentityPortalLayout_AuthenticatedRoute.d.ts +13 -0
  28. package/dist/esm/components/app/IdentityPortalLayout_AuthenticatedRoute.d.ts.map +1 -0
  29. package/dist/esm/components/app/IdentityPortalLayout_AuthenticatedRoute.js +28 -0
  30. package/dist/esm/components/app/IdentityPortalLayout_AuthenticatedRoute.js.map +1 -0
  31. package/dist/esm/components/app/IdentityPortalPage_Home.d.ts +10 -0
  32. package/dist/esm/components/app/IdentityPortalPage_Home.d.ts.map +1 -0
  33. package/dist/esm/components/app/IdentityPortalPage_Home.js +40 -0
  34. package/dist/esm/components/app/IdentityPortalPage_Home.js.map +1 -0
  35. package/dist/esm/components/app/IdentityPortalPage_SettingsDestination.d.ts +16 -0
  36. package/dist/esm/components/app/IdentityPortalPage_SettingsDestination.d.ts.map +1 -0
  37. package/dist/esm/components/app/IdentityPortalPage_SettingsDestination.js +41 -0
  38. package/dist/esm/components/app/IdentityPortalPage_SettingsDestination.js.map +1 -0
  39. package/dist/esm/components/auth/Auth_DecisionEmailAnswer.d.ts +15 -0
  40. package/dist/esm/components/auth/Auth_DecisionEmailAnswer.d.ts.map +1 -0
  41. package/dist/esm/components/auth/Auth_DecisionEmailAnswer.js +268 -0
  42. package/dist/esm/components/auth/Auth_DecisionEmailAnswer.js.map +1 -0
  43. package/dist/esm/components/auth/Auth_DecisionEmailAnswer.labels.d.ts +3 -0
  44. package/dist/esm/components/auth/Auth_DecisionEmailAnswer.labels.d.ts.map +1 -0
  45. package/dist/esm/components/auth/Auth_DecisionEmailAnswer.labels.js +35 -0
  46. package/dist/esm/components/auth/Auth_DecisionEmailAnswer.labels.js.map +1 -0
  47. package/dist/esm/components/auth/Auth_Main.d.ts.map +1 -1
  48. package/dist/esm/components/auth/Auth_Main.js +5 -0
  49. package/dist/esm/components/auth/Auth_Main.js.map +1 -1
  50. package/dist/esm/components/auth/Auth_OAuthDeviceVerification.d.ts +19 -0
  51. package/dist/esm/components/auth/Auth_OAuthDeviceVerification.d.ts.map +1 -0
  52. package/dist/esm/components/auth/Auth_OAuthDeviceVerification.js +156 -0
  53. package/dist/esm/components/auth/Auth_OAuthDeviceVerification.js.map +1 -0
  54. package/dist/esm/components/auth/Auth_OAuthDeviceVerification.labels.d.ts +3 -0
  55. package/dist/esm/components/auth/Auth_OAuthDeviceVerification.labels.d.ts.map +1 -0
  56. package/dist/esm/components/auth/Auth_OAuthDeviceVerification.labels.js +107 -0
  57. package/dist/esm/components/auth/Auth_OAuthDeviceVerification.labels.js.map +1 -0
  58. package/dist/esm/components/auth/StepUpAuthDialog.d.ts +31 -10
  59. package/dist/esm/components/auth/StepUpAuthDialog.d.ts.map +1 -1
  60. package/dist/esm/components/auth/StepUpAuthDialog.js +81 -17
  61. package/dist/esm/components/auth/StepUpAuthDialog.js.map +1 -1
  62. package/dist/esm/components/auth/admin-config/AppPage_SecuritySettings.labels.d.ts.map +1 -1
  63. package/dist/esm/components/auth/admin-config/AppPage_SecuritySettings.labels.js +19 -0
  64. package/dist/esm/components/auth/admin-config/AppPage_SecuritySettings.labels.js.map +1 -1
  65. package/dist/esm/components/auth/pages/AuthPage_DecisionEmailAnswer.d.ts +11 -0
  66. package/dist/esm/components/auth/pages/AuthPage_DecisionEmailAnswer.d.ts.map +1 -0
  67. package/dist/esm/components/auth/pages/AuthPage_DecisionEmailAnswer.js +25 -0
  68. package/dist/esm/components/auth/pages/AuthPage_DecisionEmailAnswer.js.map +1 -0
  69. package/dist/esm/components/auth/pages/AuthPage_OAuthDeviceVerification.d.ts +11 -0
  70. package/dist/esm/components/auth/pages/AuthPage_OAuthDeviceVerification.d.ts.map +1 -0
  71. package/dist/esm/components/auth/pages/AuthPage_OAuthDeviceVerification.js +25 -0
  72. package/dist/esm/components/auth/pages/AuthPage_OAuthDeviceVerification.js.map +1 -0
  73. package/dist/esm/components/billing/billing-pricing-table.d.ts.map +1 -1
  74. package/dist/esm/components/billing/billing-pricing-table.js +40 -7
  75. package/dist/esm/components/billing/billing-pricing-table.js.map +1 -1
  76. package/dist/esm/components/billing/billing-subscription-status.d.ts.map +1 -1
  77. package/dist/esm/components/billing/billing-subscription-status.js +9 -1
  78. package/dist/esm/components/billing/billing-subscription-status.js.map +1 -1
  79. package/dist/esm/components/billing/billing-usage-dashboard.d.ts.map +1 -1
  80. package/dist/esm/components/billing/billing-usage-dashboard.js +3 -2
  81. package/dist/esm/components/billing/billing-usage-dashboard.js.map +1 -1
  82. package/dist/esm/components/compliance/EmbeddedSigningFrame.d.ts.map +1 -1
  83. package/dist/esm/components/compliance/EmbeddedSigningFrame.js +17 -6
  84. package/dist/esm/components/compliance/EmbeddedSigningFrame.js.map +1 -1
  85. package/dist/esm/components/data-display/AutomaticDisplayer.d.ts.map +1 -1
  86. package/dist/esm/components/data-display/AutomaticDisplayer.js +7 -2
  87. package/dist/esm/components/data-display/AutomaticDisplayer.js.map +1 -1
  88. package/dist/esm/components/data-display/DisplayField.d.ts.map +1 -1
  89. package/dist/esm/components/data-display/DisplayField.js +67 -45
  90. package/dist/esm/components/data-display/DisplayField.js.map +1 -1
  91. package/dist/esm/components/data-display/DisplayFieldEditable.d.ts.map +1 -1
  92. package/dist/esm/components/data-display/DisplayFieldEditable.js +4 -1
  93. package/dist/esm/components/data-display/DisplayFieldEditable.js.map +1 -1
  94. package/dist/esm/components/data-display/DisplayValueDispatcher.d.ts.map +1 -1
  95. package/dist/esm/components/data-display/DisplayValueDispatcher.js +16 -6
  96. package/dist/esm/components/data-display/DisplayValueDispatcher.js.map +1 -1
  97. package/dist/esm/components/data-display/ResourceAutomaticDisplayer.d.ts.map +1 -1
  98. package/dist/esm/components/data-display/ResourceAutomaticDisplayer.js +3 -1
  99. package/dist/esm/components/data-display/ResourceAutomaticDisplayer.js.map +1 -1
  100. package/dist/esm/components/data-display/approval-seal.d.ts +7 -5
  101. package/dist/esm/components/data-display/approval-seal.d.ts.map +1 -1
  102. package/dist/esm/components/data-display/approval-seal.js +10 -4
  103. package/dist/esm/components/data-display/approval-seal.js.map +1 -1
  104. package/dist/esm/components/data-display/signature-requests.d.ts +81 -0
  105. package/dist/esm/components/data-display/signature-requests.d.ts.map +1 -0
  106. package/dist/esm/components/data-display/signature-requests.js +123 -0
  107. package/dist/esm/components/data-display/signature-requests.js.map +1 -0
  108. package/dist/esm/components/feedback/empty-state-marker.d.ts +16 -0
  109. package/dist/esm/components/feedback/empty-state-marker.d.ts.map +1 -0
  110. package/dist/esm/components/feedback/empty-state-marker.js +16 -0
  111. package/dist/esm/components/feedback/empty-state-marker.js.map +1 -0
  112. package/dist/esm/components/feedback/empty-state.d.ts.map +1 -1
  113. package/dist/esm/components/feedback/empty-state.js +2 -1
  114. package/dist/esm/components/feedback/empty-state.js.map +1 -1
  115. package/dist/esm/components/feedback/features/feature-unavailable-prompt.d.ts +7 -1
  116. package/dist/esm/components/feedback/features/feature-unavailable-prompt.d.ts.map +1 -1
  117. package/dist/esm/components/feedback/features/feature-unavailable-prompt.js +8 -2
  118. package/dist/esm/components/feedback/features/feature-unavailable-prompt.js.map +1 -1
  119. package/dist/esm/components/feedback/resource-empty-state.d.ts.map +1 -1
  120. package/dist/esm/components/feedback/resource-empty-state.js +2 -1
  121. package/dist/esm/components/feedback/resource-empty-state.js.map +1 -1
  122. package/dist/esm/components/flows-actors/approval.d.ts +25 -1
  123. package/dist/esm/components/flows-actors/approval.d.ts.map +1 -1
  124. package/dist/esm/components/flows-actors/approval.js +22 -24
  125. package/dist/esm/components/flows-actors/approval.js.map +1 -1
  126. package/dist/esm/components/flows-actors/approval.labels.d.ts.map +1 -1
  127. package/dist/esm/components/flows-actors/approval.labels.js +30 -0
  128. package/dist/esm/components/flows-actors/approval.labels.js.map +1 -1
  129. package/dist/esm/components/flows-actors/flow-node.labels.d.ts.map +1 -1
  130. package/dist/esm/components/flows-actors/flow-node.labels.js +4 -1
  131. package/dist/esm/components/flows-actors/flow-node.labels.js.map +1 -1
  132. package/dist/esm/components/flows-actors/flow-step-visuals.d.ts.map +1 -1
  133. package/dist/esm/components/flows-actors/flow-step-visuals.js +8 -2
  134. package/dist/esm/components/flows-actors/flow-step-visuals.js.map +1 -1
  135. package/dist/esm/components/flows-actors/human-decision-form.d.ts.map +1 -1
  136. package/dist/esm/components/flows-actors/human-decision-form.js +4 -1
  137. package/dist/esm/components/flows-actors/human-decision-form.js.map +1 -1
  138. package/dist/esm/components/form/Form.d.ts +2 -0
  139. package/dist/esm/components/form/Form.d.ts.map +1 -1
  140. package/dist/esm/components/form/Form.js +1 -0
  141. package/dist/esm/components/form/Form.js.map +1 -1
  142. package/dist/esm/components/form/automated/AutomatedArrayField.d.ts.map +1 -1
  143. package/dist/esm/components/form/automated/AutomatedArrayField.js +7 -4
  144. package/dist/esm/components/form/automated/AutomatedArrayField.js.map +1 -1
  145. package/dist/esm/components/form/automated/AutosaveContext.d.ts.map +1 -1
  146. package/dist/esm/components/form/automated/AutosaveContext.js +8 -0
  147. package/dist/esm/components/form/automated/AutosaveContext.js.map +1 -1
  148. package/dist/esm/components/form/automated/FormField.d.ts +5 -3
  149. package/dist/esm/components/form/automated/FormField.d.ts.map +1 -1
  150. package/dist/esm/components/form/automated/FormField.js +38 -13
  151. package/dist/esm/components/form/automated/FormField.js.map +1 -1
  152. package/dist/esm/components/form/automated/ResourceAutomatedForm.d.ts +1 -1
  153. package/dist/esm/components/form/automated/ResourceAutomatedForm.d.ts.map +1 -1
  154. package/dist/esm/components/form/automated/ResourceAutomatedForm.js +75 -47
  155. package/dist/esm/components/form/automated/ResourceAutomatedForm.js.map +1 -1
  156. package/dist/esm/components/form/fields/form-field-file-provider-constraints.frontend.utils.d.ts +1 -1
  157. package/dist/esm/components/form/fields/form-field-file-provider-constraints.frontend.utils.js +1 -1
  158. package/dist/esm/components/form/fields/form-field-file-provider-constraints.frontend.utils.js.map +1 -1
  159. package/dist/esm/components/form/validation-errors/form-validation.d.ts +5 -7
  160. package/dist/esm/components/form/validation-errors/form-validation.d.ts.map +1 -1
  161. package/dist/esm/components/form/validation-errors/form-validation.js +7 -22
  162. package/dist/esm/components/form/validation-errors/form-validation.js.map +1 -1
  163. package/dist/esm/components/form/validation-errors/getFieldError.d.ts +25 -2
  164. package/dist/esm/components/form/validation-errors/getFieldError.d.ts.map +1 -1
  165. package/dist/esm/components/form/validation-errors/getFieldError.js +29 -2
  166. package/dist/esm/components/form/validation-errors/getFieldError.js.map +1 -1
  167. package/dist/esm/components/form/validation-errors/resource-error-notification-context.utils.d.ts +5 -0
  168. package/dist/esm/components/form/validation-errors/resource-error-notification-context.utils.d.ts.map +1 -1
  169. package/dist/esm/components/form/validation-errors/resource-error-notification-context.utils.js +3 -0
  170. package/dist/esm/components/form/validation-errors/resource-error-notification-context.utils.js.map +1 -1
  171. package/dist/esm/components/form/validation-errors/save-attempt.d.ts +9 -0
  172. package/dist/esm/components/form/validation-errors/save-attempt.d.ts.map +1 -0
  173. package/dist/esm/components/form/validation-errors/save-attempt.js +42 -0
  174. package/dist/esm/components/form/validation-errors/save-attempt.js.map +1 -0
  175. package/dist/esm/components/form/validation-errors/unstarted-field-visit.d.ts +3 -1
  176. package/dist/esm/components/form/validation-errors/unstarted-field-visit.d.ts.map +1 -1
  177. package/dist/esm/components/form/validation-errors/unstarted-field-visit.js +3 -1
  178. package/dist/esm/components/form/validation-errors/unstarted-field-visit.js.map +1 -1
  179. package/dist/esm/components/form/validation-errors/validate-fields-and-show-errors.d.ts +2 -2
  180. package/dist/esm/components/form/validation-errors/validate-fields-and-show-errors.d.ts.map +1 -1
  181. package/dist/esm/components/form/validation-errors/validate-fields-and-show-errors.js +3 -0
  182. package/dist/esm/components/form/validation-errors/validate-fields-and-show-errors.js.map +1 -1
  183. package/dist/esm/components/navigation/NavigationItemBadge.d.ts +16 -0
  184. package/dist/esm/components/navigation/NavigationItemBadge.d.ts.map +1 -1
  185. package/dist/esm/components/navigation/NavigationItemBadge.js +14 -2
  186. package/dist/esm/components/navigation/NavigationItemBadge.js.map +1 -1
  187. package/dist/esm/components/navigation/app-level/ApplicationLevel_NavigationBack.d.ts +3 -3
  188. package/dist/esm/components/navigation/app-level/ApplicationLevel_NavigationBack.js +3 -3
  189. package/dist/esm/components/navigation/app-level/ApplicationLevel_NavigationBack.js.map +1 -1
  190. package/dist/esm/components/navigation/app-level/SidebarResourceBrowser.d.ts +5 -13
  191. package/dist/esm/components/navigation/app-level/SidebarResourceBrowser.d.ts.map +1 -1
  192. package/dist/esm/components/navigation/app-level/SidebarResourceBrowser.js +30 -255
  193. package/dist/esm/components/navigation/app-level/SidebarResourceBrowser.js.map +1 -1
  194. package/dist/esm/components/navigation/app-level/useCommandMenuBehavior.d.ts +22 -1
  195. package/dist/esm/components/navigation/app-level/useCommandMenuBehavior.d.ts.map +1 -1
  196. package/dist/esm/components/navigation/app-level/useCommandMenuBehavior.js +57 -26
  197. package/dist/esm/components/navigation/app-level/useCommandMenuBehavior.js.map +1 -1
  198. package/dist/esm/components/navigation/app-level/useMenuBarBehavior.d.ts +1 -1
  199. package/dist/esm/components/navigation/app-level/useMenuBarBehavior.d.ts.map +1 -1
  200. package/dist/esm/components/navigation/app-level/useMenuBarBehavior.js +40 -4
  201. package/dist/esm/components/navigation/app-level/useMenuBarBehavior.js.map +1 -1
  202. package/dist/esm/components/navigation/app-level/useMenuUserOrgBehavior.d.ts +1 -1
  203. package/dist/esm/components/navigation/app-level/useMenuUserOrgBehavior.d.ts.map +1 -1
  204. package/dist/esm/components/navigation/app-level/useMenuUserOrgBehavior.js +26 -4
  205. package/dist/esm/components/navigation/app-level/useMenuUserOrgBehavior.js.map +1 -1
  206. package/dist/esm/components/navigation/app-level/useNavigationBackBehavior.d.ts +31 -0
  207. package/dist/esm/components/navigation/app-level/useNavigationBackBehavior.d.ts.map +1 -0
  208. package/dist/esm/components/navigation/app-level/useNavigationBackBehavior.js +42 -0
  209. package/dist/esm/components/navigation/app-level/useNavigationBackBehavior.js.map +1 -0
  210. package/dist/esm/components/navigation/app-level/useSidebarResourceBrowser.d.ts +76 -0
  211. package/dist/esm/components/navigation/app-level/useSidebarResourceBrowser.d.ts.map +1 -0
  212. package/dist/esm/components/navigation/app-level/useSidebarResourceBrowser.js +268 -0
  213. package/dist/esm/components/navigation/app-level/useSidebarResourceBrowser.js.map +1 -0
  214. package/dist/esm/components/navigation/command.d.ts +5 -0
  215. package/dist/esm/components/navigation/command.d.ts.map +1 -1
  216. package/dist/esm/components/navigation/command.js.map +1 -1
  217. package/dist/esm/components/resources/ResourceLayout_DangerZone.d.ts +19 -0
  218. package/dist/esm/components/resources/ResourceLayout_DangerZone.d.ts.map +1 -1
  219. package/dist/esm/components/resources/ResourceLayout_DangerZone.js +51 -12
  220. package/dist/esm/components/resources/ResourceLayout_DangerZone.js.map +1 -1
  221. package/dist/esm/components/resources/ResourceLayout_InsertedViews.d.ts.map +1 -1
  222. package/dist/esm/components/resources/ResourceLayout_InsertedViews.js +21 -7
  223. package/dist/esm/components/resources/ResourceLayout_InsertedViews.js.map +1 -1
  224. package/dist/esm/components/resources/ResourceLayout_List.d.ts.map +1 -1
  225. package/dist/esm/components/resources/ResourceLayout_List.js +17 -7
  226. package/dist/esm/components/resources/ResourceLayout_List.js.map +1 -1
  227. package/dist/esm/components/resources/ResourceLayout_RecordSharing.d.ts +1 -1
  228. package/dist/esm/components/resources/ResourceLayout_RecordSharing.d.ts.map +1 -1
  229. package/dist/esm/components/resources/ResourceLayout_RecordSharing.js +4 -1
  230. package/dist/esm/components/resources/ResourceLayout_RecordSharing.js.map +1 -1
  231. package/dist/esm/components/resources/ResourceLayout_Search.d.ts.map +1 -1
  232. package/dist/esm/components/resources/ResourceLayout_Search.js +12 -8
  233. package/dist/esm/components/resources/ResourceLayout_Search.js.map +1 -1
  234. package/dist/esm/components/resources/ResourceOwnedViewEmbeds.d.ts +1 -1
  235. package/dist/esm/components/resources/ResourceOwnedViewEmbeds.d.ts.map +1 -1
  236. package/dist/esm/components/resources/ResourceOwnedViewEmbeds.js +11 -4
  237. package/dist/esm/components/resources/ResourceOwnedViewEmbeds.js.map +1 -1
  238. package/dist/esm/components/resources/collection/board/ResourceCollectionBody_Board.d.ts.map +1 -1
  239. package/dist/esm/components/resources/collection/board/ResourceCollectionBody_Board.js +4 -1
  240. package/dist/esm/components/resources/collection/board/ResourceCollectionBody_Board.js.map +1 -1
  241. package/dist/esm/components/resources/collection/calendar/ResourceCollectionBody_Calendar.d.ts.map +1 -1
  242. package/dist/esm/components/resources/collection/calendar/ResourceCollectionBody_Calendar.js +4 -1
  243. package/dist/esm/components/resources/collection/calendar/ResourceCollectionBody_Calendar.js.map +1 -1
  244. package/dist/esm/components/resources/collection/timeline/ResourceCollectionBody_Timeline.d.ts.map +1 -1
  245. package/dist/esm/components/resources/collection/timeline/ResourceCollectionBody_Timeline.js +4 -1
  246. package/dist/esm/components/resources/collection/timeline/ResourceCollectionBody_Timeline.js.map +1 -1
  247. package/dist/esm/components/resources/embeds/RelatedResourceSections.d.ts +1 -1
  248. package/dist/esm/components/resources/embeds/RelatedResourceSections.js.map +1 -1
  249. package/dist/esm/components/resources/embeds/ResourceEmbeds.d.ts +5 -5
  250. package/dist/esm/components/resources/embeds/ResourceEmbeds.d.ts.map +1 -1
  251. package/dist/esm/components/resources/embeds/ResourceEmbeds.js +21 -14
  252. package/dist/esm/components/resources/embeds/ResourceEmbeds.js.map +1 -1
  253. package/dist/esm/components/resources/skeleton/DisplayLayout.d.ts.map +1 -1
  254. package/dist/esm/components/resources/skeleton/DisplayLayout.js +40 -4
  255. package/dist/esm/components/resources/skeleton/DisplayLayout.js.map +1 -1
  256. package/dist/esm/components/resources/skeleton/FormLayout.d.ts.map +1 -1
  257. package/dist/esm/components/resources/skeleton/FormLayout.js +22 -6
  258. package/dist/esm/components/resources/skeleton/FormLayout.js.map +1 -1
  259. package/dist/esm/components/resources/skeleton/Group.d.ts.map +1 -1
  260. package/dist/esm/components/resources/skeleton/Group.js +4 -1
  261. package/dist/esm/components/resources/skeleton/Group.js.map +1 -1
  262. package/dist/esm/components/resources/skeleton/ResourceHeaderTitle.d.ts +1 -1
  263. package/dist/esm/components/resources/skeleton/ResourceHeaderTitle.js +1 -1
  264. package/dist/esm/components/resources/skeleton/ResourceHeaderTitle.js.map +1 -1
  265. package/dist/esm/components/resources/skeleton/SectionFieldsContext.d.ts +21 -1
  266. package/dist/esm/components/resources/skeleton/SectionFieldsContext.d.ts.map +1 -1
  267. package/dist/esm/components/resources/skeleton/SectionFieldsContext.js +53 -9
  268. package/dist/esm/components/resources/skeleton/SectionFieldsContext.js.map +1 -1
  269. package/dist/esm/components/sections/ContentSectionContainer.d.ts.map +1 -1
  270. package/dist/esm/components/sections/ContentSectionContainer.js +11 -7
  271. package/dist/esm/components/sections/ContentSectionContainer.js.map +1 -1
  272. package/dist/esm/components/sections/content-section.d.ts +1 -3
  273. package/dist/esm/components/sections/content-section.d.ts.map +1 -1
  274. package/dist/esm/components/sections/content-section.js.map +1 -1
  275. package/dist/esm/components/settings/AppPage_AgentActivitySettings.d.ts.map +1 -1
  276. package/dist/esm/components/settings/AppPage_AgentActivitySettings.js +2 -1
  277. package/dist/esm/components/settings/AppPage_AgentActivitySettings.js.map +1 -1
  278. package/dist/esm/components/settings/AppPage_ConnectedAccountsSettings.d.ts +12 -0
  279. package/dist/esm/components/settings/AppPage_ConnectedAccountsSettings.d.ts.map +1 -1
  280. package/dist/esm/components/settings/AppPage_ConnectedAccountsSettings.js +28 -6
  281. package/dist/esm/components/settings/AppPage_ConnectedAccountsSettings.js.map +1 -1
  282. package/dist/esm/components/settings/SettingsHub.d.ts +15 -0
  283. package/dist/esm/components/settings/SettingsHub.d.ts.map +1 -1
  284. package/dist/esm/components/settings/SettingsHub.js +14 -4
  285. package/dist/esm/components/settings/SettingsHub.js.map +1 -1
  286. package/dist/esm/components/typography/document-heading-level.d.ts +28 -0
  287. package/dist/esm/components/typography/document-heading-level.d.ts.map +1 -0
  288. package/dist/esm/components/typography/document-heading-level.js +63 -0
  289. package/dist/esm/components/typography/document-heading-level.js.map +1 -0
  290. package/dist/esm/components/views/chart-dashboard/ChartDashboard.d.ts +3 -2
  291. package/dist/esm/components/views/chart-dashboard/ChartDashboard.d.ts.map +1 -1
  292. package/dist/esm/components/views/chart-dashboard/ChartDashboard.js +4 -3
  293. package/dist/esm/components/views/chart-dashboard/ChartDashboard.js.map +1 -1
  294. package/dist/esm/components/views/chart-dashboard/useChartDashboardLayout.d.ts +1 -1
  295. package/dist/esm/components/views/chart-dashboard/useChartDashboardLayout.d.ts.map +1 -1
  296. package/dist/esm/components/views/chart-dashboard/useChartDashboardLayout.js.map +1 -1
  297. package/dist/esm/components/views/chart-view/ChartKpiFigure.d.ts +33 -0
  298. package/dist/esm/components/views/chart-view/ChartKpiFigure.d.ts.map +1 -1
  299. package/dist/esm/components/views/chart-view/ChartKpiFigure.js +63 -4
  300. package/dist/esm/components/views/chart-view/ChartKpiFigure.js.map +1 -1
  301. package/dist/esm/components/views/chart-view/ChartView.d.ts.map +1 -1
  302. package/dist/esm/components/views/chart-view/ChartView.js +52 -22
  303. package/dist/esm/components/views/chart-view/ChartView.js.map +1 -1
  304. package/dist/esm/components/views/chart-view/ChartView.labels.d.ts.map +1 -1
  305. package/dist/esm/components/views/chart-view/ChartView.labels.js +76 -3
  306. package/dist/esm/components/views/chart-view/ChartView.labels.js.map +1 -1
  307. package/dist/esm/components/views/chart-view/ChartView.lazy.d.ts.map +1 -1
  308. package/dist/esm/components/views/chart-view/ChartView.lazy.js +2 -1
  309. package/dist/esm/components/views/chart-view/ChartView.lazy.js.map +1 -1
  310. package/dist/esm/components/views/chart-view/ChartWidget.d.ts.map +1 -1
  311. package/dist/esm/components/views/chart-view/ChartWidget.js +12 -4
  312. package/dist/esm/components/views/chart-view/ChartWidget.js.map +1 -1
  313. package/dist/esm/components/views/chart-view/chart-export.utils.d.ts +8 -0
  314. package/dist/esm/components/views/chart-view/chart-export.utils.d.ts.map +1 -1
  315. package/dist/esm/components/views/chart-view/chart-export.utils.js +15 -25
  316. package/dist/esm/components/views/chart-view/chart-export.utils.js.map +1 -1
  317. package/dist/esm/components/views/chart-view/chart-view-defaults.d.ts +6 -0
  318. package/dist/esm/components/views/chart-view/chart-view-defaults.d.ts.map +1 -0
  319. package/dist/esm/components/views/chart-view/chart-view-defaults.js +6 -0
  320. package/dist/esm/components/views/chart-view/chart-view-defaults.js.map +1 -0
  321. package/dist/esm/components/views/chart-view/option-builder/builder-utils.d.ts +47 -12
  322. package/dist/esm/components/views/chart-view/option-builder/builder-utils.d.ts.map +1 -1
  323. package/dist/esm/components/views/chart-view/option-builder/builder-utils.js +87 -32
  324. package/dist/esm/components/views/chart-view/option-builder/builder-utils.js.map +1 -1
  325. package/dist/esm/components/views/chart-view/option-builder/builders/bar-family.builder.d.ts.map +1 -1
  326. package/dist/esm/components/views/chart-view/option-builder/builders/bar-family.builder.js +8 -8
  327. package/dist/esm/components/views/chart-view/option-builder/builders/bar-family.builder.js.map +1 -1
  328. package/dist/esm/components/views/chart-view/option-builder/builders/composed.builder.js +1 -1
  329. package/dist/esm/components/views/chart-view/option-builder/builders/composed.builder.js.map +1 -1
  330. package/dist/esm/components/views/chart-view/option-builder/builders/funnel.builder.d.ts.map +1 -1
  331. package/dist/esm/components/views/chart-view/option-builder/builders/funnel.builder.js +7 -3
  332. package/dist/esm/components/views/chart-view/option-builder/builders/funnel.builder.js.map +1 -1
  333. package/dist/esm/components/views/chart-view/option-builder/builders/gauge.builder.d.ts.map +1 -1
  334. package/dist/esm/components/views/chart-view/option-builder/builders/gauge.builder.js +6 -2
  335. package/dist/esm/components/views/chart-view/option-builder/builders/gauge.builder.js.map +1 -1
  336. package/dist/esm/components/views/chart-view/option-builder/builders/heatmap.builder.d.ts.map +1 -1
  337. package/dist/esm/components/views/chart-view/option-builder/builders/heatmap.builder.js +8 -2
  338. package/dist/esm/components/views/chart-view/option-builder/builders/heatmap.builder.js.map +1 -1
  339. package/dist/esm/components/views/chart-view/option-builder/builders/hierarchical-family.builder.d.ts.map +1 -1
  340. package/dist/esm/components/views/chart-view/option-builder/builders/hierarchical-family.builder.js +13 -9
  341. package/dist/esm/components/views/chart-view/option-builder/builders/hierarchical-family.builder.js.map +1 -1
  342. package/dist/esm/components/views/chart-view/option-builder/builders/line-family.builder.d.ts +1 -1
  343. package/dist/esm/components/views/chart-view/option-builder/builders/line-family.builder.d.ts.map +1 -1
  344. package/dist/esm/components/views/chart-view/option-builder/builders/line-family.builder.js +9 -8
  345. package/dist/esm/components/views/chart-view/option-builder/builders/line-family.builder.js.map +1 -1
  346. package/dist/esm/components/views/chart-view/option-builder/builders/parallel.builder.d.ts.map +1 -1
  347. package/dist/esm/components/views/chart-view/option-builder/builders/parallel.builder.js +2 -1
  348. package/dist/esm/components/views/chart-view/option-builder/builders/parallel.builder.js.map +1 -1
  349. package/dist/esm/components/views/chart-view/option-builder/builders/pie-family.builder.d.ts +1 -1
  350. package/dist/esm/components/views/chart-view/option-builder/builders/pie-family.builder.d.ts.map +1 -1
  351. package/dist/esm/components/views/chart-view/option-builder/builders/pie-family.builder.js +10 -11
  352. package/dist/esm/components/views/chart-view/option-builder/builders/pie-family.builder.js.map +1 -1
  353. package/dist/esm/components/views/chart-view/option-builder/builders/radar.builder.d.ts.map +1 -1
  354. package/dist/esm/components/views/chart-view/option-builder/builders/radar.builder.js +2 -1
  355. package/dist/esm/components/views/chart-view/option-builder/builders/radar.builder.js.map +1 -1
  356. package/dist/esm/components/views/chart-view/option-builder/builders/sankey.builder.d.ts.map +1 -1
  357. package/dist/esm/components/views/chart-view/option-builder/builders/sankey.builder.js +5 -1
  358. package/dist/esm/components/views/chart-view/option-builder/builders/sankey.builder.js.map +1 -1
  359. package/dist/esm/components/views/chart-view/option-builder/builders/statistical-family.builder.d.ts.map +1 -1
  360. package/dist/esm/components/views/chart-view/option-builder/builders/statistical-family.builder.js +7 -3
  361. package/dist/esm/components/views/chart-view/option-builder/builders/statistical-family.builder.js.map +1 -1
  362. package/dist/esm/components/views/chart-view/option-builder/echarts-option-builder.d.ts.map +1 -1
  363. package/dist/esm/components/views/chart-view/option-builder/echarts-option-builder.js +13 -13
  364. package/dist/esm/components/views/chart-view/option-builder/echarts-option-builder.js.map +1 -1
  365. package/dist/esm/components/views/chart-view/useResourceChartData.d.ts +1 -1
  366. package/dist/esm/components/views/chart-view/useResourceChartData.js +1 -1
  367. package/dist/esm/components/views/chart-view/useResourceChartData.js.map +1 -1
  368. package/dist/esm/components/views/composite-view/CompositeView.d.ts +6 -0
  369. package/dist/esm/components/views/composite-view/CompositeView.d.ts.map +1 -1
  370. package/dist/esm/components/views/composite-view/CompositeView.js +6 -2
  371. package/dist/esm/components/views/composite-view/CompositeView.js.map +1 -1
  372. package/dist/esm/components/views/execution-view/ExecutionView.d.ts +7 -0
  373. package/dist/esm/components/views/execution-view/ExecutionView.d.ts.map +1 -1
  374. package/dist/esm/components/views/execution-view/ExecutionView.js +11 -1
  375. package/dist/esm/components/views/execution-view/ExecutionView.js.map +1 -1
  376. package/dist/esm/components/views/flows-actors-view/FlowsActorsView.d.ts +7 -0
  377. package/dist/esm/components/views/flows-actors-view/FlowsActorsView.d.ts.map +1 -1
  378. package/dist/esm/components/views/flows-actors-view/FlowsActorsView.js +6 -2
  379. package/dist/esm/components/views/flows-actors-view/FlowsActorsView.js.map +1 -1
  380. package/dist/esm/components/views/full-custom-view/FullCustomView.d.ts +7 -0
  381. package/dist/esm/components/views/full-custom-view/FullCustomView.d.ts.map +1 -1
  382. package/dist/esm/components/views/full-custom-view/FullCustomView.js +8 -3
  383. package/dist/esm/components/views/full-custom-view/FullCustomView.js.map +1 -1
  384. package/dist/esm/components/views/onboarding-view/OnboardingView.d.ts +7 -0
  385. package/dist/esm/components/views/onboarding-view/OnboardingView.d.ts.map +1 -1
  386. package/dist/esm/components/views/onboarding-view/OnboardingView.js +11 -1
  387. package/dist/esm/components/views/onboarding-view/OnboardingView.js.map +1 -1
  388. package/dist/esm/core/app-shell/AppShellBuildingBlocks.d.ts +2 -2
  389. package/dist/esm/core/app-shell/AppShellBuildingBlocks.js +2 -2
  390. package/dist/esm/core/app-shell/AppShellBuildingBlocks.js.map +1 -1
  391. package/dist/esm/core/app-shell/app-shell.schemas.d.ts +87 -16
  392. package/dist/esm/core/app-shell/app-shell.schemas.d.ts.map +1 -1
  393. package/dist/esm/core/app-shell/app-shell.schemas.js +16 -0
  394. package/dist/esm/core/app-shell/app-shell.schemas.js.map +1 -1
  395. package/dist/esm/core/app-shell/shell-motion/shell-motion-vocabulary.d.ts +4 -4
  396. package/dist/esm/core/app-shell/shell-motion/shell-motion-vocabulary.js +3 -3
  397. package/dist/esm/core/app-shell/shell-motion/shell-motion-vocabulary.js.map +1 -1
  398. package/dist/esm/core/app-shell/useIdentityPortalShellLayout.d.ts +45 -0
  399. package/dist/esm/core/app-shell/useIdentityPortalShellLayout.d.ts.map +1 -0
  400. package/dist/esm/core/app-shell/useIdentityPortalShellLayout.js +72 -0
  401. package/dist/esm/core/app-shell/useIdentityPortalShellLayout.js.map +1 -0
  402. package/dist/esm/core/automated-layout/automated-layout.frontend.schemas.d.ts +4 -3
  403. package/dist/esm/core/automated-layout/automated-layout.frontend.schemas.d.ts.map +1 -1
  404. package/dist/esm/core/automated-layout/automated-layout.frontend.schemas.js +4 -3
  405. package/dist/esm/core/automated-layout/automated-layout.frontend.schemas.js.map +1 -1
  406. package/dist/esm/core/automated-layout/automated-layout.frontend.utils.d.ts +15 -8
  407. package/dist/esm/core/automated-layout/automated-layout.frontend.utils.d.ts.map +1 -1
  408. package/dist/esm/core/automated-layout/automated-layout.frontend.utils.js +22 -21
  409. package/dist/esm/core/automated-layout/automated-layout.frontend.utils.js.map +1 -1
  410. package/dist/esm/core/billing/BillingContext.d.ts +27 -4
  411. package/dist/esm/core/billing/BillingContext.d.ts.map +1 -1
  412. package/dist/esm/core/billing/BillingContext.js +61 -2
  413. package/dist/esm/core/billing/BillingContext.js.map +1 -1
  414. package/dist/esm/core/billing/useBillingAction.d.ts.map +1 -1
  415. package/dist/esm/core/billing/useBillingAction.js +3 -2
  416. package/dist/esm/core/billing/useBillingAction.js.map +1 -1
  417. package/dist/esm/core/components-registry/RegisteredComponentRoot.d.ts +19 -0
  418. package/dist/esm/core/components-registry/RegisteredComponentRoot.d.ts.map +1 -0
  419. package/dist/esm/core/components-registry/RegisteredComponentRoot.js +23 -0
  420. package/dist/esm/core/components-registry/RegisteredComponentRoot.js.map +1 -0
  421. package/dist/esm/core/components-registry/register-framework-layouts.d.ts.map +1 -1
  422. package/dist/esm/core/components-registry/register-framework-layouts.js +4 -0
  423. package/dist/esm/core/components-registry/register-framework-layouts.js.map +1 -1
  424. package/dist/esm/core/config/app-configuration-frontend.schemas.d.ts +159 -0
  425. package/dist/esm/core/config/app-configuration-frontend.schemas.d.ts.map +1 -1
  426. package/dist/esm/core/config/app-configuration-frontend.schemas.js +68 -3
  427. package/dist/esm/core/config/app-configuration-frontend.schemas.js.map +1 -1
  428. package/dist/esm/core/config/app-level-components.frontend.schemas.d.ts +2 -2
  429. package/dist/esm/core/config/app-level-components.frontend.schemas.js +2 -2
  430. package/dist/esm/core/config/app-level-components.frontend.schemas.js.map +1 -1
  431. package/dist/esm/core/config/chart-view.frontend.schemas.d.ts +59 -18
  432. package/dist/esm/core/config/chart-view.frontend.schemas.d.ts.map +1 -1
  433. package/dist/esm/core/config/chart-view.frontend.schemas.js +42 -7
  434. package/dist/esm/core/config/chart-view.frontend.schemas.js.map +1 -1
  435. package/dist/esm/core/config/composite-view.schemas.d.ts +8 -1
  436. package/dist/esm/core/config/composite-view.schemas.d.ts.map +1 -1
  437. package/dist/esm/core/config/composite-view.schemas.js +1 -0
  438. package/dist/esm/core/config/composite-view.schemas.js.map +1 -1
  439. package/dist/esm/core/config/decision-inbox-capability.frontend.utils.d.ts +1 -1
  440. package/dist/esm/core/config/decision-inbox-capability.frontend.utils.d.ts.map +1 -1
  441. package/dist/esm/core/config/decision-inbox-capability.frontend.utils.js +1 -1
  442. package/dist/esm/core/config/decision-inbox-capability.frontend.utils.js.map +1 -1
  443. package/dist/esm/core/config/engine-settings-destinations.d.ts +6 -0
  444. package/dist/esm/core/config/engine-settings-destinations.d.ts.map +1 -1
  445. package/dist/esm/core/config/engine-settings-destinations.js +12 -0
  446. package/dist/esm/core/config/engine-settings-destinations.js.map +1 -1
  447. package/dist/esm/core/config/execution-view.schemas.d.ts +1 -1
  448. package/dist/esm/core/config/execution-view.schemas.js.map +1 -1
  449. package/dist/esm/core/config/identity-portal-settings.frontend.d.ts +17 -0
  450. package/dist/esm/core/config/identity-portal-settings.frontend.d.ts.map +1 -0
  451. package/dist/esm/core/config/identity-portal-settings.frontend.js +64 -0
  452. package/dist/esm/core/config/identity-portal-settings.frontend.js.map +1 -0
  453. package/dist/esm/core/config/launcher-items.frontend.schemas.d.ts +8 -8
  454. package/dist/esm/core/config/launcher-items.frontend.schemas.d.ts.map +1 -1
  455. package/dist/esm/core/config/launcher-items.frontend.schemas.js.map +1 -1
  456. package/dist/esm/core/config/settings-hub-gating.frontend.utils.d.ts +1 -1
  457. package/dist/esm/core/config/settings-hub-gating.frontend.utils.d.ts.map +1 -1
  458. package/dist/esm/core/config/settings-hub-gating.frontend.utils.js +1 -1
  459. package/dist/esm/core/config/settings-hub-gating.frontend.utils.js.map +1 -1
  460. package/dist/esm/core/config/settings-hub.frontend.schemas.d.ts +17 -6
  461. package/dist/esm/core/config/settings-hub.frontend.schemas.d.ts.map +1 -1
  462. package/dist/esm/core/config/settings-hub.frontend.schemas.js.map +1 -1
  463. package/dist/esm/core/config/useSettingsHubConfig.d.ts.map +1 -1
  464. package/dist/esm/core/config/useSettingsHubConfig.js +1 -0
  465. package/dist/esm/core/config/useSettingsHubConfig.js.map +1 -1
  466. package/dist/esm/core/config/useVisibleSettingsHubConfig.d.ts +7 -0
  467. package/dist/esm/core/config/useVisibleSettingsHubConfig.d.ts.map +1 -1
  468. package/dist/esm/core/config/useVisibleSettingsHubConfig.js +9 -1
  469. package/dist/esm/core/config/useVisibleSettingsHubConfig.js.map +1 -1
  470. package/dist/esm/core/config/verify-launcher-content.d.ts +7 -1
  471. package/dist/esm/core/config/verify-launcher-content.d.ts.map +1 -1
  472. package/dist/esm/core/config/verify-launcher-content.js +31 -0
  473. package/dist/esm/core/config/verify-launcher-content.js.map +1 -1
  474. package/dist/esm/core/errors/GlobalErrorHandler.d.ts.map +1 -1
  475. package/dist/esm/core/errors/GlobalErrorHandler.js +10 -0
  476. package/dist/esm/core/errors/GlobalErrorHandler.js.map +1 -1
  477. package/dist/esm/core/errors/backend-refusal.frontend.d.ts +1 -1
  478. package/dist/esm/core/errors/backend-refusal.frontend.d.ts.map +1 -1
  479. package/dist/esm/core/errors/backend-refusal.frontend.js.map +1 -1
  480. package/dist/esm/core/events/NotificationContext.d.ts.map +1 -1
  481. package/dist/esm/core/events/NotificationContext.js +19 -2
  482. package/dist/esm/core/events/NotificationContext.js.map +1 -1
  483. package/dist/esm/core/events/notification-display-policy.frontend.schemas.d.ts +21 -2
  484. package/dist/esm/core/events/notification-display-policy.frontend.schemas.d.ts.map +1 -1
  485. package/dist/esm/core/events/notification-display-policy.frontend.schemas.js +25 -4
  486. package/dist/esm/core/events/notification-display-policy.frontend.schemas.js.map +1 -1
  487. package/dist/esm/core/execution/useExecution.d.ts +3 -3
  488. package/dist/esm/core/execution/useExecution.js.map +1 -1
  489. package/dist/esm/core/external-providers/ConsentBasedProviderSdks.d.ts +1 -1
  490. package/dist/esm/core/external-providers/ConsentBasedProviderSdks.js +1 -1
  491. package/dist/esm/core/external-providers/ConsentBasedProviderSdks.js.map +1 -1
  492. package/dist/esm/core/features/FeatureGate.d.ts +13 -1
  493. package/dist/esm/core/features/FeatureGate.d.ts.map +1 -1
  494. package/dist/esm/core/features/FeatureGate.js +6 -1
  495. package/dist/esm/core/features/FeatureGate.js.map +1 -1
  496. package/dist/esm/core/features/InPlaceFeatureLock.d.ts +28 -0
  497. package/dist/esm/core/features/InPlaceFeatureLock.d.ts.map +1 -0
  498. package/dist/esm/core/features/InPlaceFeatureLock.js +49 -0
  499. package/dist/esm/core/features/InPlaceFeatureLock.js.map +1 -0
  500. package/dist/esm/core/features/PlanRefusalPrompt.d.ts +12 -0
  501. package/dist/esm/core/features/PlanRefusalPrompt.d.ts.map +1 -0
  502. package/dist/esm/core/features/PlanRefusalPrompt.js +90 -0
  503. package/dist/esm/core/features/PlanRefusalPrompt.js.map +1 -0
  504. package/dist/esm/core/features/RequiredFeaturesGate.d.ts +39 -0
  505. package/dist/esm/core/features/RequiredFeaturesGate.d.ts.map +1 -0
  506. package/dist/esm/core/features/RequiredFeaturesGate.js +51 -0
  507. package/dist/esm/core/features/RequiredFeaturesGate.js.map +1 -0
  508. package/dist/esm/core/features/feature-unavailability.frontend.utils.d.ts +6 -0
  509. package/dist/esm/core/features/feature-unavailability.frontend.utils.d.ts.map +1 -1
  510. package/dist/esm/core/features/feature-unavailability.frontend.utils.js +27 -10
  511. package/dist/esm/core/features/feature-unavailability.frontend.utils.js.map +1 -1
  512. package/dist/esm/core/features/plan-refusal.frontend.d.ts +43 -0
  513. package/dist/esm/core/features/plan-refusal.frontend.d.ts.map +1 -0
  514. package/dist/esm/core/features/plan-refusal.frontend.js +67 -0
  515. package/dist/esm/core/features/plan-refusal.frontend.js.map +1 -0
  516. package/dist/esm/core/features/required-features-gate-presentation.d.ts +21 -0
  517. package/dist/esm/core/features/required-features-gate-presentation.d.ts.map +1 -0
  518. package/dist/esm/core/features/required-features-gate-presentation.js +26 -0
  519. package/dist/esm/core/features/required-features-gate-presentation.js.map +1 -0
  520. package/dist/esm/core/features/useFeatureAvailability.d.ts.map +1 -1
  521. package/dist/esm/core/features/useFeatureAvailability.js +4 -0
  522. package/dist/esm/core/features/useFeatureAvailability.js.map +1 -1
  523. package/dist/esm/core/features/useOperationFeatureAvailability.d.ts +2 -0
  524. package/dist/esm/core/features/useOperationFeatureAvailability.d.ts.map +1 -1
  525. package/dist/esm/core/features/useOperationFeatureAvailability.js +6 -1
  526. package/dist/esm/core/features/useOperationFeatureAvailability.js.map +1 -1
  527. package/dist/esm/core/flows-actors/FlowsActorsContext.d.ts +11 -0
  528. package/dist/esm/core/flows-actors/FlowsActorsContext.d.ts.map +1 -1
  529. package/dist/esm/core/flows-actors/FlowsActorsContext.js +117 -3
  530. package/dist/esm/core/flows-actors/FlowsActorsContext.js.map +1 -1
  531. package/dist/esm/core/guidance/renderers/GuidanceAnnouncement.d.ts.map +1 -1
  532. package/dist/esm/core/guidance/renderers/GuidanceAnnouncement.js +3 -1
  533. package/dist/esm/core/guidance/renderers/GuidanceAnnouncement.js.map +1 -1
  534. package/dist/esm/core/navigation/NavigationContentAreas.d.ts.map +1 -1
  535. package/dist/esm/core/navigation/NavigationContentAreas.js +28 -9
  536. package/dist/esm/core/navigation/NavigationContentAreas.js.map +1 -1
  537. package/dist/esm/{components/views/chart-dashboard/chart-dashboard.utils.d.ts → core/navigation/chart-read-gate.d.ts} +11 -7
  538. package/dist/esm/core/navigation/chart-read-gate.d.ts.map +1 -0
  539. package/dist/esm/{components/views/chart-dashboard/chart-dashboard.utils.js → core/navigation/chart-read-gate.js} +27 -11
  540. package/dist/esm/core/navigation/chart-read-gate.js.map +1 -0
  541. package/dist/esm/core/navigation/home-resolution.d.ts +36 -0
  542. package/dist/esm/core/navigation/home-resolution.d.ts.map +1 -0
  543. package/dist/esm/core/navigation/home-resolution.js +46 -0
  544. package/dist/esm/core/navigation/home-resolution.js.map +1 -0
  545. package/dist/esm/core/navigation/launcher-resolution.d.ts +2 -34
  546. package/dist/esm/core/navigation/launcher-resolution.d.ts.map +1 -1
  547. package/dist/esm/core/navigation/launcher-resolution.js +13 -18
  548. package/dist/esm/core/navigation/launcher-resolution.js.map +1 -1
  549. package/dist/esm/core/navigation/launcher-runtime-availability.d.ts +1 -1
  550. package/dist/esm/core/navigation/launcher-runtime-availability.d.ts.map +1 -1
  551. package/dist/esm/core/navigation/launcher-runtime-availability.js +7 -2
  552. package/dist/esm/core/navigation/launcher-runtime-availability.js.map +1 -1
  553. package/dist/esm/core/navigation/primary-destination-layout.d.ts +2 -2
  554. package/dist/esm/core/navigation/primary-destination-layout.d.ts.map +1 -1
  555. package/dist/esm/core/navigation/primary-destination-layout.js +1 -1
  556. package/dist/esm/core/navigation/primary-destination-layout.js.map +1 -1
  557. package/dist/esm/core/navigation/useChartReadDecision.d.ts +26 -0
  558. package/dist/esm/core/navigation/useChartReadDecision.d.ts.map +1 -0
  559. package/dist/esm/core/navigation/useChartReadDecision.js +58 -0
  560. package/dist/esm/core/navigation/useChartReadDecision.js.map +1 -0
  561. package/dist/esm/core/navigation/useCurrentOrganizationConfigurationPresence.d.ts +1 -1
  562. package/dist/esm/core/navigation/useCurrentOrganizationConfigurationPresence.d.ts.map +1 -1
  563. package/dist/esm/core/navigation/useCurrentOrganizationConfigurationPresence.js.map +1 -1
  564. package/dist/esm/core/navigation/useCurrentOrganizationHoldsUnrevokedScimToken.d.ts +1 -1
  565. package/dist/esm/core/navigation/useCurrentOrganizationHoldsUnrevokedScimToken.d.ts.map +1 -1
  566. package/dist/esm/core/navigation/useCurrentOrganizationHoldsUnrevokedScimToken.js.map +1 -1
  567. package/dist/esm/core/navigation/view-title-resolution.d.ts +21 -0
  568. package/dist/esm/core/navigation/view-title-resolution.d.ts.map +1 -1
  569. package/dist/esm/core/navigation/view-title-resolution.js +25 -0
  570. package/dist/esm/core/navigation/view-title-resolution.js.map +1 -1
  571. package/dist/esm/core/navigation/viewer-field-reader.d.ts +81 -0
  572. package/dist/esm/core/navigation/viewer-field-reader.d.ts.map +1 -0
  573. package/dist/esm/core/navigation/viewer-field-reader.js +113 -0
  574. package/dist/esm/core/navigation/viewer-field-reader.js.map +1 -0
  575. package/dist/esm/core/navigation/viewer-roles.d.ts +40 -0
  576. package/dist/esm/core/navigation/viewer-roles.d.ts.map +1 -0
  577. package/dist/esm/core/navigation/viewer-roles.js +26 -0
  578. package/dist/esm/core/navigation/viewer-roles.js.map +1 -0
  579. package/dist/esm/core/requests/user-interaction-clock.d.ts +32 -0
  580. package/dist/esm/core/requests/user-interaction-clock.d.ts.map +1 -0
  581. package/dist/esm/core/requests/user-interaction-clock.js +47 -0
  582. package/dist/esm/core/requests/user-interaction-clock.js.map +1 -0
  583. package/dist/esm/core/requests/websockets/WebSocketEventBridge.d.ts.map +1 -1
  584. package/dist/esm/core/requests/websockets/WebSocketEventBridge.js +2 -0
  585. package/dist/esm/core/requests/websockets/WebSocketEventBridge.js.map +1 -1
  586. package/dist/esm/core/requests/wildo-http-client-manual-calls.frontend.service.d.ts +66 -10
  587. package/dist/esm/core/requests/wildo-http-client-manual-calls.frontend.service.d.ts.map +1 -1
  588. package/dist/esm/core/requests/wildo-http-client-manual-calls.frontend.service.js +63 -8
  589. package/dist/esm/core/requests/wildo-http-client-manual-calls.frontend.service.js.map +1 -1
  590. package/dist/esm/core/requests/wildo-http-client.frontend.service.d.ts.map +1 -1
  591. package/dist/esm/core/requests/wildo-http-client.frontend.service.js +13 -0
  592. package/dist/esm/core/requests/wildo-http-client.frontend.service.js.map +1 -1
  593. package/dist/esm/core/resources/hooks/useOperationEnabled.d.ts.map +1 -1
  594. package/dist/esm/core/resources/hooks/useOperationEnabled.js +45 -3
  595. package/dist/esm/core/resources/hooks/useOperationEnabled.js.map +1 -1
  596. package/dist/esm/core/resources/resource-addressability.frontend.utils.d.ts +1 -1
  597. package/dist/esm/core/resources/resource-addressability.frontend.utils.d.ts.map +1 -1
  598. package/dist/esm/core/resources/resource-addressability.frontend.utils.js.map +1 -1
  599. package/dist/esm/core/resources/resources-repository.frontend.service.d.ts.map +1 -1
  600. package/dist/esm/core/resources/resources-repository.frontend.service.js +2 -0
  601. package/dist/esm/core/resources/resources-repository.frontend.service.js.map +1 -1
  602. package/dist/esm/core/resources/resources.frontend.schemas.d.ts +29 -23
  603. package/dist/esm/core/resources/resources.frontend.schemas.d.ts.map +1 -1
  604. package/dist/esm/core/resources/resources.frontend.schemas.js +20 -20
  605. package/dist/esm/core/resources/resources.frontend.schemas.js.map +1 -1
  606. package/dist/esm/core/resources/rmm/ResourceMutationManager.d.ts.map +1 -1
  607. package/dist/esm/core/resources/rmm/ResourceMutationManager.js +4 -0
  608. package/dist/esm/core/resources/rmm/ResourceMutationManager.js.map +1 -1
  609. package/dist/esm/core/resources/useResourceOperationActions.d.ts.map +1 -1
  610. package/dist/esm/core/resources/useResourceOperationActions.js +7 -7
  611. package/dist/esm/core/resources/useResourceOperationActions.js.map +1 -1
  612. package/dist/esm/core/runtime/AppRouter.d.ts.map +1 -1
  613. package/dist/esm/core/runtime/AppRouter.js +11 -33
  614. package/dist/esm/core/runtime/AppRouter.js.map +1 -1
  615. package/dist/esm/core/runtime/ApplicationMainContext.d.ts +15 -1
  616. package/dist/esm/core/runtime/ApplicationMainContext.d.ts.map +1 -1
  617. package/dist/esm/core/runtime/ApplicationMainContext.js +41 -23
  618. package/dist/esm/core/runtime/ApplicationMainContext.js.map +1 -1
  619. package/dist/esm/core/runtime/IdentityPortalRouter.d.ts +20 -0
  620. package/dist/esm/core/runtime/IdentityPortalRouter.d.ts.map +1 -0
  621. package/dist/esm/core/runtime/IdentityPortalRouter.js +31 -0
  622. package/dist/esm/core/runtime/IdentityPortalRouter.js.map +1 -0
  623. package/dist/esm/core/runtime/domain-module.frontend.definitions.d.ts +9 -0
  624. package/dist/esm/core/runtime/domain-module.frontend.definitions.d.ts.map +1 -1
  625. package/dist/esm/core/runtime/domain-module.frontend.definitions.js +3 -2
  626. package/dist/esm/core/runtime/domain-module.frontend.definitions.js.map +1 -1
  627. package/dist/esm/core/runtime/frontend-companion-resource-inputs.d.ts +21 -0
  628. package/dist/esm/core/runtime/frontend-companion-resource-inputs.d.ts.map +1 -1
  629. package/dist/esm/core/runtime/frontend-companion-resource-inputs.js +19 -1
  630. package/dist/esm/core/runtime/frontend-companion-resource-inputs.js.map +1 -1
  631. package/dist/esm/core/runtime/identity-routes.d.ts +13 -0
  632. package/dist/esm/core/runtime/identity-routes.d.ts.map +1 -0
  633. package/dist/esm/core/runtime/identity-routes.js +50 -0
  634. package/dist/esm/core/runtime/identity-routes.js.map +1 -0
  635. package/dist/esm/core/runtime/routes.frontend.definitions.d.ts +19 -0
  636. package/dist/esm/core/runtime/routes.frontend.definitions.d.ts.map +1 -1
  637. package/dist/esm/core/runtime/routes.frontend.definitions.js +20 -1
  638. package/dist/esm/core/runtime/routes.frontend.definitions.js.map +1 -1
  639. package/dist/esm/core/runtime/runtime.frontend.schemas.d.ts +3 -1
  640. package/dist/esm/core/runtime/runtime.frontend.schemas.d.ts.map +1 -1
  641. package/dist/esm/core/runtime/runtime.frontend.schemas.js +2 -0
  642. package/dist/esm/core/runtime/runtime.frontend.schemas.js.map +1 -1
  643. package/dist/esm/core/runtime/start-application.frontend.service.d.ts +7 -0
  644. package/dist/esm/core/runtime/start-application.frontend.service.d.ts.map +1 -1
  645. package/dist/esm/core/runtime/start-application.frontend.service.js +4 -2
  646. package/dist/esm/core/runtime/start-application.frontend.service.js.map +1 -1
  647. package/dist/esm/core/search/command-score.d.ts +33 -0
  648. package/dist/esm/core/search/command-score.d.ts.map +1 -0
  649. package/dist/esm/core/search/command-score.js +109 -0
  650. package/dist/esm/core/search/command-score.js.map +1 -0
  651. package/dist/esm/core/security/AuthSessionContext.d.ts.map +1 -1
  652. package/dist/esm/core/security/AuthSessionContext.js +4 -0
  653. package/dist/esm/core/security/AuthSessionContext.js.map +1 -1
  654. package/dist/esm/core/security/StepUpAuthContext.d.ts +3 -2
  655. package/dist/esm/core/security/StepUpAuthContext.d.ts.map +1 -1
  656. package/dist/esm/core/security/StepUpAuthContext.js +7 -2
  657. package/dist/esm/core/security/StepUpAuthContext.js.map +1 -1
  658. package/dist/esm/core/security/federated-reauthentication.frontend.d.ts +13 -2
  659. package/dist/esm/core/security/federated-reauthentication.frontend.d.ts.map +1 -1
  660. package/dist/esm/core/security/federated-reauthentication.frontend.js +21 -1
  661. package/dist/esm/core/security/federated-reauthentication.frontend.js.map +1 -1
  662. package/dist/esm/core/security/useAuthenticatedRouteEntry.d.ts +24 -0
  663. package/dist/esm/core/security/useAuthenticatedRouteEntry.d.ts.map +1 -0
  664. package/dist/esm/core/security/useAuthenticatedRouteEntry.js +37 -0
  665. package/dist/esm/core/security/useAuthenticatedRouteEntry.js.map +1 -0
  666. package/dist/esm/core/ui/design-token.utils.d.ts +9 -0
  667. package/dist/esm/core/ui/design-token.utils.d.ts.map +1 -1
  668. package/dist/esm/core/ui/design-token.utils.js +24 -3
  669. package/dist/esm/core/ui/design-token.utils.js.map +1 -1
  670. package/dist/esm/core/ui/themes/focus-indicator.d.ts +1 -1
  671. package/dist/esm/core/ui/themes/focus-indicator.js +1 -1
  672. package/dist/esm/core/ui/themes/focus-indicator.js.map +1 -1
  673. package/dist/esm/core/ui/ui.frontend.schemas.d.ts.map +1 -1
  674. package/dist/esm/index.d.ts +19 -1
  675. package/dist/esm/index.d.ts.map +1 -1
  676. package/dist/esm/index.js +22 -1
  677. package/dist/esm/index.js.map +1 -1
  678. package/dist/esm/testing/mock-builders.d.ts +1 -1
  679. package/dist/esm/testing/mock-builders.d.ts.map +1 -1
  680. package/dist/esm/testing/mock-builders.js +1 -0
  681. package/dist/esm/testing/mock-builders.js.map +1 -1
  682. package/dist/tsconfig.build.tsbuildinfo +1 -1
  683. package/package.json +9 -6
  684. package/dist/esm/components/views/chart-dashboard/chart-dashboard.utils.d.ts.map +0 -1
  685. package/dist/esm/components/views/chart-dashboard/chart-dashboard.utils.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"DisplayLayout.d.ts","sourceRoot":"","sources":["../../../../../src/components/resources/skeleton/DisplayLayout.tsx"],"names":[],"mappings":"AAEA,OAAc,EAAW,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACvD,OAAO,EAAqB,KAAK,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AAyBjG,kJAAkJ;AAClJ,MAAM,WAAW,kBAAkB;IACjC,qDAAqD;IACrD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;IACxC,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AACD,0EAA0E;AAE1E;;;;;;;;GAQG;AACH,eAAO,MAAM,4BAA4B,4BAA4B,CAAC;AAEtE;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,aAAa,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,kBAAkB,EAAE,EAAE,kBAAkB,GAAG,SAAS,CA2DxG"}
1
+ {"version":3,"file":"DisplayLayout.d.ts","sourceRoot":"","sources":["../../../../../src/components/resources/skeleton/DisplayLayout.tsx"],"names":[],"mappings":"AAEA,OAAc,EAAW,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACvD,OAAO,EAAqB,KAAK,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AA6BjG,kJAAkJ;AAClJ,MAAM,WAAW,kBAAkB;IACjC,qDAAqD;IACrD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;IACxC,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AACD,0EAA0E;AAE1E;;;;;;;;GAQG;AACH,eAAO,MAAM,4BAA4B,4BAA4B,CAAC;AAEtE;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,aAAa,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,kBAAkB,EAAE,EAAE,kBAAkB,GAAG,SAAS,CA6DxG"}
@@ -11,7 +11,9 @@ import { ContentSectionContainer } from '../../sections/ContentSectionContainer.
11
11
  import { groupSectionsByAppearance, buildSectionConfigFromGroup, } from './section-consolidation.utils.js';
12
12
  import { GroupedSectionBody } from './Section.js';
13
13
  import { GroupedSectionHostKind } from './Section.shared.js';
14
- import { SectionMode, getEnumValues } from '@wildo-ai/zod-decorators';
14
+ import { SectionMode, getEnumValues, isHiddenForDisplay } from '@wildo-ai/zod-decorators';
15
+ import { useViewerFieldReader, viewerMaySeeFieldOnPath } from '../../../core/navigation/viewer-field-reader.js';
16
+ import { listDisplayedFieldSlots } from './SectionFieldsContext.js';
15
17
  import { getFieldSchema, getNestedValue } from '../../data-display/display-field-resolution.utils.js';
16
18
  import { SectionStageBindingError, assertSectionStageBinding, resolveCurrentSectionStage, } from '../../sections/section-stages.js';
17
19
  /** @wildo_source:part:end saas.frontend.display-layout.reading-measure */
@@ -46,7 +48,9 @@ export const COLLECTION_SURFACE_ATTRIBUTE = 'data-collection-surface';
46
48
  */
47
49
  export function DisplayLayout({ className, children, responsiveMaxWidth }) {
48
50
  const displayCtx = useOptionalDisplayTemplateContext();
49
- const renderedChildren = useMemo(() => renderGroupedChildren(children, displayCtx), [children, displayCtx]);
51
+ // The viewer, for the grouped sections none of whose fields it is shown (#4459 review D1).
52
+ const fieldReader = useViewerFieldReader();
53
+ const renderedChildren = useMemo(() => renderGroupedChildren(children, displayCtx, fieldReader), [children, displayCtx, fieldReader]);
50
54
  return (_jsx(FieldScopeProvider, { pathPrefix: "", children: _jsx(SectionLegendVoiceHost, { voice: TypographyVariant.EYEBROW, children: _jsx("div", { className: cn('mr-auto w-full space-y-section', '[&>[data-chrome-mode^=settings]:has(+[data-chrome-mode^=settings])]:mb-0',
51
55
  // Derived width (no declaration): the reading measure, lifted when the layout holds a collection.
52
56
  // The selector spells the attribute literally because Tailwind reads class names statically;
@@ -59,13 +63,18 @@ export function DisplayLayout({ className, children, responsiveMaxWidth }) {
59
63
  * Groups sections sharing the same container mode into a `ContentSectionContainer`.
60
64
  * Solo-mode sections and non-Section children render in place.
61
65
  */
62
- function renderGroupedChildren(children, displayCtx) {
66
+ function renderGroupedChildren(children, displayCtx, fieldReader) {
63
67
  const grouped = groupSectionsByAppearance(children, displayCtx?.defaultSectionAppearance);
64
68
  return (_jsx(_Fragment, { children: grouped.items.map((item, idx) => {
65
69
  if (item.type === 'node') {
66
70
  return _jsx(React.Fragment, { children: item.node }, idx);
67
71
  }
68
- const { group } = item;
72
+ // A grouped section none of whose fields this viewer is shown is dropped from its container, and a container
73
+ // left with no section renders nothing (see `groupedSectionShowsNoField`).
74
+ const shownSections = item.group.sections.filter((el) => !groupedSectionShowsNoField(item.group.mode, el.props.children, displayCtx?.schema, fieldReader));
75
+ if (shownSections.length === 0)
76
+ return null;
77
+ const group = { ...item.group, sections: shownSections };
69
78
  const config = withRecordStage(buildSectionConfigFromGroup(group), group, displayCtx);
70
79
  const sectionLabels = displayCtx?.sectionLabels ?? {};
71
80
  const sectionDescriptions = displayCtx?.sectionDescriptions ?? {};
@@ -78,6 +87,33 @@ function renderGroupedChildren(children, displayCtx) {
78
87
  return (_jsx(ContentSectionContainer, { sections: contentSections, config: config }, `group-${group.mode}-${idx}`));
79
88
  }) }));
80
89
  }
90
+ /**
91
+ * Whether a GROUPED display section (grid, tabs, …) shows no field to this viewer (#4459 review D1).
92
+ *
93
+ * A solo `Section` hides its heading from what its `DisplayField`s report once mounted. A grouped section cannot: its
94
+ * container draws the title or the tab, and an unchosen tab's panel is not mounted. So the host decides from the
95
+ * section's elements, as `FormLayout` does for a form. The section is dropped when it holds only display slots
96
+ * (`listDisplayedFieldSlots`) and each one statically draws nothing: its path resolves to no field, the field is
97
+ * `.isHidden()`, or the viewer may not read it or an ancestor on its path (`.readableBy`).
98
+ *
99
+ * Only what the schema and the viewer decide is read. A condition (`showWhen`) or an empty value can change while the
100
+ * record is shown, and dropping a section on them would move it in and out of its container; such a section stays.
101
+ * A STAGES group keeps every section: each is a step of the record's lifecycle, and its title names the step, not a
102
+ * heading over fields, so dropping one would misstate where the record stands.
103
+ */
104
+ function groupedSectionShowsNoField(mode, children, schema, fieldReader) {
105
+ if (!schema || mode === SectionMode.STAGES)
106
+ return false;
107
+ const displayed = listDisplayedFieldSlots(children);
108
+ return displayed !== null
109
+ && displayed.length > 0
110
+ && displayed.every((slot) => {
111
+ const fieldSchema = slot.ownSchema ?? getFieldSchema(schema, slot.path);
112
+ return fieldSchema === undefined
113
+ || isHiddenForDisplay(fieldSchema)
114
+ || !viewerMaySeeFieldOnPath(fieldSchema, slot.path, (prefix) => getFieldSchema(schema, prefix), fieldReader);
115
+ });
116
+ }
81
117
  /**
82
118
  * A STAGES group's current stage, read from the record this layout displays (#1786). This host is the one that
83
119
  * holds the record, so it is where the bound field is read; the container only draws the result. Every other
@@ -1 +1 @@
1
- {"version":3,"file":"DisplayLayout.js","sourceRoot":"","sources":["../../../../../src/components/resources/skeleton/DisplayLayout.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,EAAE,EAAE,OAAO,EAAkB,MAAM,OAAO,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAA2B,MAAM,qCAAqC,CAAC;AACjG,OAAO,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAC;AAC7E,OAAO,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AACpD,OAAO,EAAE,0BAA0B,EAAE,MAAM,wBAAwB,CAAC;AACpE,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,iCAAiC,EAAE,MAAM,2CAA2C,CAAC;AAC9F,OAAO,EAAE,uBAAuB,EAAE,MAAM,wCAAwC,CAAC;AAEjF,OAAO,EACL,yBAAyB,EACzB,2BAA2B,GAC5B,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,kBAAkB,EAAqB,MAAM,WAAW,CAAC;AAClE,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAE1D,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACtE,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,mDAAmD,CAAC;AACnG,OAAO,EACL,wBAAwB,EACxB,yBAAyB,EACzB,0BAA0B,GAE3B,MAAM,+BAA+B,CAAC;AAgCvC,0EAA0E;AAE1E;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,yBAAyB,CAAC;AAEtE;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU,aAAa,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,kBAAkB,EAAs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ypographyVariant, type ResponsiveMaxWidth } from '@wildo-ai/presets-components-models';\nimport { SectionLegendVoiceHost } from '../../sections/section-legend-voice';\nimport { cn } from '~wildo-frontend-lib/core/ui/cn';\nimport { optionalMaxInlineSizeStyle } from '../../sections/surface';\nimport { FieldScopeProvider } from './FieldScopeContext';\nimport { useOptionalDisplayTemplateContext } from '../../data-display/DisplayTemplateContext';\nimport { ContentSectionContainer } from '../../sections/ContentSectionContainer';\nimport type { ContentSectionDescriptor } from '../../sections/ContentSectionContainer';\nimport {\n groupSectionsByAppearance,\n buildSectionConfigFromGroup,\n} from './section-consolidation.utils';\nimport { GroupedSectionBody, type SectionProps } from './Section';\nimport { GroupedSectionHostKind } from './Section.shared';\nimport type { SectionConfig } from '@wildo-ai/presets-components-models';\nimport { SectionMode, getEnumValues } from '@wildo-ai/zod-decorators';\nimport { getFieldSchema, getNestedValue } from '../../data-display/display-field-resolution.utils';\nimport {\n SectionStageBindingError,\n assertSectionStageBinding,\n resolveCurrentSectionStage,\n type SectionStageBinding,\n} from '../../sections/section-stages';\nimport type { SectionGroup } from './section-consolidation.utils';\n\n/** @wildo_source:part:start saas.frontend.display-layout.reading-measure facet:layer:frontend facet:family:layout facet:audience:app-developer */\nexport interface DisplayLayoutProps {\n /** Additional CSS classes for the root container. */\n className?: string;\n /**\n * How wide the layout root lets its content grow, named in the framework's own vocabulary.\n *\n * Left unset, the width is DERIVED from what the layout renders: the reading-measure cap (~42rem, themeable\n * via `--measure-max-width`) that keeps a single-column stack of label/value pairs readable instead of\n * stretched edge to edge — lifted as soon as the layout holds a collection (see the last paragraph).\n *\n * It is WRONG for a composed document. A template that renders tabs, quote blocks, tables or regions\n * is not a field stack: those set their own measure internally, and a 42rem cap around them squeezes\n * the whole composition into a column with dead space beside it. Such a template declares `'none'`.\n *\n * `'none'` is not \"uncapped\" in practice — the zone content boundary above has already capped the\n * area at the page-content width (`'content'`, ~80rem) and an adjacent pane is narrower still. This\n * prop decides only whether a SECOND, tighter cap applies inside that, and the answer depends on what\n * the template renders, which is why the template is the one asked.\n *\n * Left UNSET, the cap is derived from what the layout actually renders: the reading measure for fields,\n * lifted as soon as the layout holds a COLLECTION (a related list, an embedded collection — any surface\n * marked {@link COLLECTION_SURFACE_ATTRIBUTE}). A list squeezed into a 42rem column, under a header that\n * spans the page, is what a field-only cap does to a record whose page is mostly its list. Declared, the\n * value is the template's statement and is applied as given.\n */\n responsiveMaxWidth?: ResponsiveMaxWidth;\n children?: ReactNode;\n}\n/** @wildo_source:part:end saas.frontend.display-layout.reading-measure */\n\n/**\n * The attribute that marks a COLLECTION in the rendered page, so a layout around it can tell it holds a list.\n *\n * Carried by the `ResourceLayout_List` / `ResourceLayout_Search` wrappers (around any preset or custom view, from\n * the first paint) and by a `RelatedResourceSections` block that holds a list (before its labels load, whichever\n * tab is open). Read by CSS `:has()`: by `DisplayLayout`, to lift its reading measure, and by the READ page, to give\n * the danger zone the same width as the record body (`--record-body-max-inline-size`). Being CSS, the decision\n * follows the DOM and never needs a second render.\n */\nexport const COLLECTION_SURFACE_ATTRIBUTE = 'data-collection-surface';\n\n/**\n * Root wrapper for display (read-only) layout templates.\n *\n * Provides a root `FieldScopeContext` with empty prefix so nested\n * `<DisplayField name=\"...\">` components resolve field names correctly.\n *\n * `ResourceDisplayContext` (inline editing, RMM, file upload) is provided\n * by the parent `ResourceAutomaticDisplayer`, not by this layout component.\n *\n * @example\n * ```tsx\n * <DisplayLayout>\n * <Section name=\"general\">\n * <DisplayField name=\"title\" />\n * <DisplayField name=\"status\" />\n * </Section>\n * </DisplayLayout>\n * ```\n */\nexport function DisplayLayout({ className, children, responsiveMaxWidth }: DisplayLayoutProps): ReactNode {\n const displayCtx = useOptionalDisplayTemplateContext();\n const renderedChildren = useMemo(\n () => renderGroupedChildren(children, displayCtx),\n [children, displayCtx],\n );\n\n return (\n <FieldScopeProvider pathPrefix=\"\">\n {/* A read body names its section groups in the EYEBROW voice — see `SectionLegendVoiceHost`. */}\n <SectionLegendVoiceHost voice={TypographyVariant.EYEBROW}>\n {/*\n T4c — reading-measure cap (mirrors FormLayout). A single-column\n read/detail stack caps at `--measure-max-width` (~42rem) and aligns to\n the LEFT of the content zone, so detail views stop stretching\n edge-to-edge yet stay flush with the left-aligned resource header and\n danger-zone siblings (no centred gutter between them). `max-w` only\n engages above the measure, so a detail rendered inside a narrow\n dialog/panel is unaffected. Retune/opt-out via the CSS var or `className`.\n */}\n {/*\n `space-y-section` separates stacked SECTIONS (each titled CARD group /\n container) with a clear gap so consecutive cards read as distinct groups\n rather than one continuous stack. Sectionless templates whose direct\n children are bare SETTINGS_ROW field rows must NOT inherit that section\n gap: the row chrome is a self-delimiting list item (`py-card-sm` rhythm +\n `border-b` hairline), so consecutive rows stack FLUSH — the same\n content-aware rule the `ContentSection` body applies to settings rows.\n The pairwise `:has(+ …)` selector zeroes only the margin BETWEEN two\n adjacent settings rows, so a row followed by a real section (mixed\n template) keeps the section gap.\n\n ⚠ The attribute match is `^=settings` (prefix), NOT `=settings_row`:\n Tailwind converts an unescaped `_` inside an arbitrary variant to a\n SPACE, emitting the invalid selector `[data-chrome-mode=settings row]`\n which the browser silently drops (this killed ContentSection's original\n `…=settings_row]]:gap-0` spelling — verified against the served CSS).\n Only `settings_row` starts with `settings`, so the prefix is exact.\n */}\n <div\n className={cn(\n 'mr-auto w-full space-y-section',\n '[&>[data-chrome-mode^=settings]:has(+[data-chrome-mode^=settings])]:mb-0',\n // Derived width (no declaration): the reading measure, lifted when the layout holds a collection.\n // The selector spells the attribute literally because Tailwind reads class names statically;\n // `display-layout-derived-width.test.tsx` holds it equal to `COLLECTION_SURFACE_ATTRIBUTE`.\n responsiveMaxWidth === undefined\n && '[max-inline-size:var(--measure-max-width,42rem)] has-[[data-collection-surface]]:[max-inline-size:none]',\n className,\n )}\n style={optionalMaxInlineSizeStyle(responsiveMaxWidth)}\n data-inline-size-tier={responsiveMaxWidth ?? 'derived'}\n data-guidance-display\n >\n {renderedChildren}\n </div>\n </SectionLegendVoiceHost>\n </FieldScopeProvider>\n );\n}\n\n/**\n * Introspects children for `<Section>` elements with container-mode `appearance`.\n * Groups sections sharing the same container mode into a `ContentSectionContainer`.\n * Solo-mode sections and non-Section children render in place.\n */\nfunction renderGroupedChildren(\n children: ReactNode,\n displayCtx: ReturnType<typeof useOptionalDisplayTemplateContext>,\n): ReactNode {\n const grouped = groupSectionsByAppearance(children, displayCtx?.defaultSectionAppearance);\n\n return (\n <>\n {grouped.items.map((item, idx) => {\n if (item.type === 'node') {\n return <React.Fragment key={idx}>{item.node}</React.Fragment>;\n }\n\n const { group } = item;\n const config = withRecordStage(buildSectionConfigFromGroup(group), group, displayCtx);\n const sectionLabels = displayCtx?.sectionLabels ?? {};\n const sectionDescriptions = displayCtx?.sectionDescriptions ?? {};\n\n const contentSections: ContentSectionDescriptor[] = group.sections.map((el) => ({\n id: el.props.name,\n title: sectionLabels[el.props.name],\n description: sectionDescriptions[el.props.name],\n content: (\n <GroupedSectionContent\n sectionProps={el.props}\n providesHeading={!!sectionLabels[el.props.name]}\n />\n ),\n }));\n\n return (\n <ContentSectionContainer\n key={`group-${group.mode}-${idx}`}\n sections={contentSections}\n config={config}\n />\n );\n })}\n </>\n );\n}\n\n/**\n * A STAGES group's current stage, read from the record this layout displays (#1786). This host is the one that\n * holds the record, so it is where the bound field is read; the container only draws the result. Every other\n * mode's config is returned as built.\n *\n * The binding is checked against the field's schema on every render that groups it, and a binding that could\n * misstate a record's stage throws (`assertSectionStageBinding`). Outside a display template there is no record:\n * the config is returned without a stage and the container stacks the sections instead of guessing.\n */\nfunction withRecordStage(\n config: SectionConfig,\n group: SectionGroup,\n displayCtx: ReturnType<typeof useOptionalDisplayTemplateContext>,\n): SectionConfig {\n if (config.mode !== SectionMode.STAGES || displayCtx === null) return config;\n const [first, ...rest] = group.sections;\n const stageNames = group.sections.map((section) => section.props.name);\n // `stageBinding` exists only on the STAGES member of the `SectionProps` union; grouping already put only STAGES\n // sections here, but the element type does not know it.\n const stageBindingOf = (props: SectionProps): SectionStageBinding | undefined =>\n 'stageBinding' in props ? props.stageBinding : undefined;\n const stray = rest.find((section) => stageBindingOf(section.props) !== undefined);\n if (stray !== undefined) {\n throw new SectionStageBindingError(\n `section \"${stray.props.name}\" declares a stageBinding, but a group's binding is read from its FIRST section (\"${first.props.name}\"). Declare it there, once.`,\n );\n }\n const binding = stageBindingOf(first.props);\n const fieldSchema = binding ? getFieldSchema(displayCtx.schema, binding.field) : undefined;\n assertSectionStageBinding(binding, stageNames, fieldSchema ? getEnumValues(fieldSchema) : undefined);\n const currentStage = displayCtx.isLoading ? null : resolveCurrentSectionStage(binding, getNestedValue(displayCtx.data, binding.field));\n return { ...config, currentStage };\n}\n\n/**\n * Wraps an individual grouped section's content with section-level behaviors\n * (displayChromeMode) when rendered inside a container.\n */\nfunction GroupedSectionContent({\n sectionProps,\n providesHeading,\n}: {\n sectionProps: Pick<SectionProps, 'name' | 'children' | 'chromeMode' | 'className' | 'disabled'>;\n providesHeading?: boolean;\n}): ReactNode {\n return (\n <GroupedSectionBody\n hostKind={GroupedSectionHostKind.DISPLAY}\n sectionProps={sectionProps}\n providesHeading={providesHeading}\n />\n );\n}\n"]}
1
+ {"version":3,"file":"DisplayLayout.js","sourceRoot":"","sources":["../../../../../src/components/resources/skeleton/DisplayLayout.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,EAAE,EAAE,OAAO,EAAkB,MAAM,OAAO,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAA2B,MAAM,qCAAqC,CAAC;AACjG,OAAO,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAC;AAC7E,OAAO,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AACpD,OAAO,EAAE,0BAA0B,EAAE,MAAM,wBAAwB,CAAC;AACpE,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,iCAAiC,EAAE,MAAM,2CAA2C,CAAC;AAC9F,OAAO,EA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UAAU,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAC3F,yBAAyB,CAAC,OAAO,EAAE,UAAU,EAAE,WAAW,CAAC,CAAC,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;IACrG,MAAM,YAAY,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,0BAA0B,CAAC,OAAO,EAAE,cAAc,CAAC,UAAU,CAAC,IAAI,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;IACvI,OAAO,EAAE,GAAG,MAAM,EAAE,YAAY,EAAE,CAAC;AACrC,CAAC;AAED;;;GAGG;AACH,SAAS,qBAAqB,CAAC,EAC7B,YAAY,EACZ,eAAe,GAIhB;IACC,OAAO,CACL,KAAC,kBAAkB,IACjB,QAAQ,EAAE,sBAAsB,CAAC,OAAO,EACxC,YAAY,EAAE,YAAY,EAC1B,eAAe,EAAE,eAAe,GAChC,CACH,CAAC;AACJ,CAAC","sourcesContent":["'use client';\n\nimport React, { useMemo, type ReactNode } from 'react';\nimport { TypographyVariant, type ResponsiveMaxWidth } from '@wildo-ai/presets-components-models';\nimport { SectionLegendVoiceHost } from '../../sections/section-legend-voice';\nimport { cn } from '~wildo-frontend-lib/core/ui/cn';\nimport { optionalMaxInlineSizeStyle } from '../../sections/surface';\nimport { FieldScopeProvider } from './FieldScopeContext';\nimport { useOptionalDisplayTemplateContext } from '../../data-display/DisplayTemplateContext';\nimport { ContentSectionContainer } from '../../sections/ContentSectionContainer';\nimport type { ContentSectionDescriptor } from '../../sections/ContentSectionContainer';\nimport {\n groupSectionsByAppearance,\n buildSectionConfigFromGroup,\n} from './section-consolidation.utils';\nimport { GroupedSectionBody, type SectionProps } from './Section';\nimport { GroupedSectionHostKind } from './Section.shared';\nimport type { SectionConfig } from '@wildo-ai/presets-components-models';\nimport type { FieldReader } from '@wildo-ai/saas-models';\nimport { SectionMode, getEnumValues, isHiddenForDisplay } from '@wildo-ai/zod-decorators';\nimport type { z } from 'zod';\nimport { useViewerFieldReader, viewerMaySeeFieldOnPath } from '~wildo-frontend-lib/core/navigation/viewer-field-reader';\nimport { listDisplayedFieldSlots } from './SectionFieldsContext';\nimport { getFieldSchema, getNestedValue } from '../../data-display/display-field-resolution.utils';\nimport {\n SectionStageBindingError,\n assertSectionStageBinding,\n resolveCurrentSectionStage,\n type SectionStageBinding,\n} from '../../sections/section-stages';\nimport type { SectionGroup } from './section-consolidation.utils';\n\n/** @wildo_source:part:start saas.frontend.display-layout.reading-measure facet:layer:frontend facet:family:layout facet:audience:app-developer */\nexport interface DisplayLayoutProps {\n /** Additional CSS classes for the root container. */\n className?: string;\n /**\n * How wide the layout root lets its content grow, named in the framework's own vocabulary.\n *\n * Left unset, the width is DERIVED from what the layout renders: the reading-measure cap (~42rem, themeable\n * via `--measure-max-width`) that keeps a single-column stack of label/value pairs readable instead of\n * stretched edge to edge — lifted as soon as the layout holds a collection (see the last paragraph).\n *\n * It is WRONG for a composed document. A template that renders tabs, quote blocks, tables or regions\n * is not a field stack: those set their own measure internally, and a 42rem cap around them squeezes\n * the whole composition into a column with dead space beside it. Such a template declares `'none'`.\n *\n * `'none'` is not \"uncapped\" in practice — the zone content boundary above has already capped the\n * area at the page-content width (`'content'`, ~80rem) and an adjacent pane is narrower still. This\n * prop decides only whether a SECOND, tighter cap applies inside that, and the answer depends on what\n * the template renders, which is why the template is the one asked.\n *\n * Left UNSET, the cap is derived from what the layout actually renders: the reading measure for fields,\n * lifted as soon as the layout holds a COLLECTION (a related list, an embedded collection — any surface\n * marked {@link COLLECTION_SURFACE_ATTRIBUTE}). A list squeezed into a 42rem column, under a header that\n * spans the page, is what a field-only cap does to a record whose page is mostly its list. Declared, the\n * value is the template's statement and is applied as given.\n */\n responsiveMaxWidth?: ResponsiveMaxWidth;\n children?: ReactNode;\n}\n/** @wildo_source:part:end saas.frontend.display-layout.reading-measure */\n\n/**\n * The attribute that marks a COLLECTION in the rendered page, so a layout around it can tell it holds a list.\n *\n * Carried by the `ResourceLayout_List` / `ResourceLayout_Search` wrappers (around any preset or custom view, from\n * the first paint) and by a `RelatedResourceSections` block that holds a list (before its labels load, whichever\n * tab is open). Read by CSS `:has()`: by `DisplayLayout`, to lift its reading measure, and by the READ page, to give\n * the danger zone the same width as the record body (`--record-body-max-inline-size`). Being CSS, the decision\n * follows the DOM and never needs a second render.\n */\nexport const COLLECTION_SURFACE_ATTRIBUTE = 'data-collection-surface';\n\n/**\n * Root wrapper for display (read-only) layout templates.\n *\n * Provides a root `FieldScopeContext` with empty prefix so nested\n * `<DisplayField name=\"...\">` components resolve field names correctly.\n *\n * `ResourceDisplayContext` (inline editing, RMM, file upload) is provided\n * by the parent `ResourceAutomaticDisplayer`, not by this layout component.\n *\n * @example\n * ```tsx\n * <DisplayLayout>\n * <Section name=\"general\">\n * <DisplayField name=\"title\" />\n * <DisplayField name=\"status\" />\n * </Section>\n * </DisplayLayout>\n * ```\n */\nexport function DisplayLayout({ className, children, responsiveMaxWidth }: DisplayLayoutProps): ReactNode {\n const displayCtx = useOptionalDisplayTemplateContext();\n // The viewer, for the grouped sections none of whose fields it is shown (#4459 review D1).\n const fieldReader = useViewerFieldReader();\n const renderedChildren = useMemo(\n () => renderGroupedChildren(children, displayCtx, fieldReader),\n [children, displayCtx, fieldReader],\n );\n\n return (\n <FieldScopeProvider pathPrefix=\"\">\n {/* A read body names its section groups in the EYEBROW voice — see `SectionLegendVoiceHost`. */}\n <SectionLegendVoiceHost voice={TypographyVariant.EYEBROW}>\n {/*\n T4c — reading-measure cap (mirrors FormLayout). A single-column\n read/detail stack caps at `--measure-max-width` (~42rem) and aligns to\n the LEFT of the content zone, so detail views stop stretching\n edge-to-edge yet stay flush with the left-aligned resource header and\n danger-zone siblings (no centred gutter between them). `max-w` only\n engages above the measure, so a detail rendered inside a narrow\n dialog/panel is unaffected. Retune/opt-out via the CSS var or `className`.\n */}\n {/*\n `space-y-section` separates stacked SECTIONS (each titled CARD group /\n container) with a clear gap so consecutive cards read as distinct groups\n rather than one continuous stack. Sectionless templates whose direct\n children are bare SETTINGS_ROW field rows must NOT inherit that section\n gap: the row chrome is a self-delimiting list item (`py-card-sm` rhythm +\n `border-b` hairline), so consecutive rows stack FLUSH — the same\n content-aware rule the `ContentSection` body applies to settings rows.\n The pairwise `:has(+ …)` selector zeroes only the margin BETWEEN two\n adjacent settings rows, so a row followed by a real section (mixed\n template) keeps the section gap.\n\n ⚠ The attribute match is `^=settings` (prefix), NOT `=settings_row`:\n Tailwind converts an unescaped `_` inside an arbitrary variant to a\n SPACE, emitting the invalid selector `[data-chrome-mode=settings row]`\n which the browser silently drops (this killed ContentSection's original\n `…=settings_row]]:gap-0` spelling — verified against the served CSS).\n Only `settings_row` starts with `settings`, so the prefix is exact.\n */}\n <div\n className={cn(\n 'mr-auto w-full space-y-section',\n '[&>[data-chrome-mode^=settings]:has(+[data-chrome-mode^=settings])]:mb-0',\n // Derived width (no declaration): the reading measure, lifted when the layout holds a collection.\n // The selector spells the attribute literally because Tailwind reads class names statically;\n // `display-layout-derived-width.test.tsx` holds it equal to `COLLECTION_SURFACE_ATTRIBUTE`.\n responsiveMaxWidth === undefined\n && '[max-inline-size:var(--measure-max-width,42rem)] has-[[data-collection-surface]]:[max-inline-size:none]',\n className,\n )}\n style={optionalMaxInlineSizeStyle(responsiveMaxWidth)}\n data-inline-size-tier={responsiveMaxWidth ?? 'derived'}\n data-guidance-display\n >\n {renderedChildren}\n </div>\n </SectionLegendVoiceHost>\n </FieldScopeProvider>\n );\n}\n\n/**\n * Introspects children for `<Section>` elements with container-mode `appearance`.\n * Groups sections sharing the same container mode into a `ContentSectionContainer`.\n * Solo-mode sections and non-Section children render in place.\n */\nfunction renderGroupedChildren(\n children: ReactNode,\n displayCtx: ReturnType<typeof useOptionalDisplayTemplateContext>,\n fieldReader: FieldReader,\n): ReactNode {\n const grouped = groupSectionsByAppearance(children, displayCtx?.defaultSectionAppearance);\n\n return (\n <>\n {grouped.items.map((item, idx) => {\n if (item.type === 'node') {\n return <React.Fragment key={idx}>{item.node}</React.Fragment>;\n }\n\n // A grouped section none of whose fields this viewer is shown is dropped from its container, and a container\n // left with no section renders nothing (see `groupedSectionShowsNoField`).\n const shownSections = item.group.sections.filter((el) => !groupedSectionShowsNoField(item.group.mode, el.props.children, displayCtx?.schema, fieldReader));\n if (shownSections.length === 0) return null;\n const group = { ...item.group, sections: shownSections };\n const config = withRecordStage(buildSectionConfigFromGroup(group), group, displayCtx);\n const sectionLabels = displayCtx?.sectionLabels ?? {};\n const sectionDescriptions = displayCtx?.sectionDescriptions ?? {};\n\n const contentSections: ContentSectionDescriptor[] = group.sections.map((el) => ({\n id: el.props.name,\n title: sectionLabels[el.props.name],\n description: sectionDescriptions[el.props.name],\n content: (\n <GroupedSectionContent\n sectionProps={el.props}\n providesHeading={!!sectionLabels[el.props.name]}\n />\n ),\n }));\n\n return (\n <ContentSectionContainer\n key={`group-${group.mode}-${idx}`}\n sections={contentSections}\n config={config}\n />\n );\n })}\n </>\n );\n}\n\n/**\n * Whether a GROUPED display section (grid, tabs, …) shows no field to this viewer (#4459 review D1).\n *\n * A solo `Section` hides its heading from what its `DisplayField`s report once mounted. A grouped section cannot: its\n * container draws the title or the tab, and an unchosen tab's panel is not mounted. So the host decides from the\n * section's elements, as `FormLayout` does for a form. The section is dropped when it holds only display slots\n * (`listDisplayedFieldSlots`) and each one statically draws nothing: its path resolves to no field, the field is\n * `.isHidden()`, or the viewer may not read it or an ancestor on its path (`.readableBy`).\n *\n * Only what the schema and the viewer decide is read. A condition (`showWhen`) or an empty value can change while the\n * record is shown, and dropping a section on them would move it in and out of its container; such a section stays.\n * A STAGES group keeps every section: each is a step of the record's lifecycle, and its title names the step, not a\n * heading over fields, so dropping one would misstate where the record stands.\n */\nfunction groupedSectionShowsNoField(\n mode: SectionMode,\n children: ReactNode,\n schema: z.ZodTypeAny | undefined,\n fieldReader: FieldReader,\n): boolean {\n if (!schema || mode === SectionMode.STAGES) return false;\n const displayed = listDisplayedFieldSlots(children);\n return displayed !== null\n && displayed.length > 0\n && displayed.every((slot) => {\n const fieldSchema = slot.ownSchema ?? getFieldSchema(schema, slot.path);\n return fieldSchema === undefined\n || isHiddenForDisplay(fieldSchema)\n || !viewerMaySeeFieldOnPath(fieldSchema, slot.path, (prefix) => getFieldSchema(schema, prefix), fieldReader);\n });\n}\n\n/**\n * A STAGES group's current stage, read from the record this layout displays (#1786). This host is the one that\n * holds the record, so it is where the bound field is read; the container only draws the result. Every other\n * mode's config is returned as built.\n *\n * The binding is checked against the field's schema on every render that groups it, and a binding that could\n * misstate a record's stage throws (`assertSectionStageBinding`). Outside a display template there is no record:\n * the config is returned without a stage and the container stacks the sections instead of guessing.\n */\nfunction withRecordStage(\n config: SectionConfig,\n group: SectionGroup,\n displayCtx: ReturnType<typeof useOptionalDisplayTemplateContext>,\n): SectionConfig {\n if (config.mode !== SectionMode.STAGES || displayCtx === null) return config;\n const [first, ...rest] = group.sections;\n const stageNames = group.sections.map((section) => section.props.name);\n // `stageBinding` exists only on the STAGES member of the `SectionProps` union; grouping already put only STAGES\n // sections here, but the element type does not know it.\n const stageBindingOf = (props: SectionProps): SectionStageBinding | undefined =>\n 'stageBinding' in props ? props.stageBinding : undefined;\n const stray = rest.find((section) => stageBindingOf(section.props) !== undefined);\n if (stray !== undefined) {\n throw new SectionStageBindingError(\n `section \"${stray.props.name}\" declares a stageBinding, but a group's binding is read from its FIRST section (\"${first.props.name}\"). Declare it there, once.`,\n );\n }\n const binding = stageBindingOf(first.props);\n const fieldSchema = binding ? getFieldSchema(displayCtx.schema, binding.field) : undefined;\n assertSectionStageBinding(binding, stageNames, fieldSchema ? getEnumValues(fieldSchema) : undefined);\n const currentStage = displayCtx.isLoading ? null : resolveCurrentSectionStage(binding, getNestedValue(displayCtx.data, binding.field));\n return { ...config, currentStage };\n}\n\n/**\n * Wraps an individual grouped section's content with section-level behaviors\n * (displayChromeMode) when rendered inside a container.\n */\nfunction GroupedSectionContent({\n sectionProps,\n providesHeading,\n}: {\n sectionProps: Pick<SectionProps, 'name' | 'children' | 'chromeMode' | 'className' | 'disabled'>;\n providesHeading?: boolean;\n}): ReactNode {\n return (\n <GroupedSectionBody\n hostKind={GroupedSectionHostKind.DISPLAY}\n sectionProps={sectionProps}\n providesHeading={providesHeading}\n />\n );\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"FormLayout.d.ts","sourceRoot":"","sources":["../../../../../src/components/resources/skeleton/FormLayout.tsx"],"names":[],"mappings":"AAGA,OAAc,EAA2D,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACvG,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AA0B9E,MAAM,WAAW,eAAe;IAC9B,qDAAqD;IACrD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;;;;;;;OAWG;IACH,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;IACxC;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC7C;;;;;;;;;;;;OAYG;IACH,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAOD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,UAAU,CAAC,EACzB,SAAS,EACT,QAAQ,EACR,kBAAkB,EAAE,mBAAmB,EACvC,sBAA6B,EAC7B,kBAA8B,GAC/B,EAAE,eAAe,GAAG,SAAS,CAiG7B"}
1
+ {"version":3,"file":"FormLayout.d.ts","sourceRoot":"","sources":["../../../../../src/components/resources/skeleton/FormLayout.tsx"],"names":[],"mappings":"AAGA,OAAc,EAA2D,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACvG,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AA6B9E,MAAM,WAAW,eAAe;IAC9B,qDAAqD;IACrD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;;;;;;;OAWG;IACH,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;IACxC;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC7C;;;;;;;;;;;;OAYG;IACH,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAOD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,UAAU,CAAC,EACzB,SAAS,EACT,QAAQ,EACR,kBAAkB,EAAE,mBAAmB,EACvC,sBAA6B,EAC7B,kBAA8B,GAC/B,EAAE,eAAe,GAAG,SAAS,CAoG7B"}
@@ -15,6 +15,9 @@ import { ContentSectionContainer } from '../../sections/ContentSectionContainer.
15
15
  import { groupSectionsByAppearance, buildSectionConfigFromGroup, } from './section-consolidation.utils.js';
16
16
  import { GroupedSectionBody } from './Section.js';
17
17
  import { listPlacedFieldSlots } from './SectionFieldsContext.js';
18
+ import { CoreResourceOperation } from '@wildo-ai/saas-models';
19
+ import { useViewerFieldReader, viewerMaySeeFieldOnPath } from '../../../core/navigation/viewer-field-reader.js';
20
+ import { useOptionalFormSchemaContext } from '../../../components/form/useFormSchemaContext.js';
18
21
  import { useTemplatePlacedFieldsOf } from '../../form/automated/TemplatePlacedFieldsContext.js';
19
22
  import { AutomatedLayoutFrontendUtils } from '../../../core/automated-layout/automated-layout.frontend.utils.js';
20
23
  import { GroupedSectionHostKind } from './Section.shared.js';
@@ -84,7 +87,10 @@ export function FormLayout({ className, children, contextFieldValues: _contextFi
84
87
  // or an unchosen variant is not mounted, so its fields cannot report themselves (see
85
88
  // `TemplatePlacedFieldsContext`). From an empty prefix: this layout resets its children's scope to "".
86
89
  useTemplatePlacedFieldsOf(children, '');
87
- const renderedChildren = useMemo(() => renderGroupedChildren(children, formCtx), [children, formCtx]);
90
+ // The viewer and the operation, for the grouped sections none of whose fields it is offered (#4459 review D1).
91
+ const fieldReader = useViewerFieldReader();
92
+ const operationType = useOptionalFormSchemaContext()?.operationType;
93
+ const renderedChildren = useMemo(() => renderGroupedChildren(children, formCtx, { fieldReader, operationType }), [children, formCtx, fieldReader, operationType]);
88
94
  return (_jsx(FormLayoutSlotContext.Provider, { value: slotContextValue, children: _jsx(SectionLegendVoiceHost, { voice: undefined, children: _jsx(FieldScopeProvider, { pathPrefix: "", children: _jsx("div", { className: cn('mr-auto w-full', className), style: { maxInlineSize: responsiveMaxWidthToCssValue(responsiveMaxWidth) }, "data-inline-size-tier": responsiveMaxWidth, "data-guidance-form": "", "data-slot": "form-layout", children: _jsxs(ErrorBoundary, { children: [autoSlots.errorSummary ? _jsx(FormErrorSummarySlot, { className: "mb-4" }) : null, _jsx("div", { className: "space-y-section [&>[data-chrome-mode^=settings]:has(+[data-chrome-mode^=settings])]:mb-0", children: renderedChildren }), autoSlots.submitButton ? _jsx(SubmitButton, { className: "mt-6" }) : null] }) }) }) }) }));
89
95
  }
90
96
  /**
@@ -96,23 +102,33 @@ export function FormLayout({ className, children, contextFieldValues: _contextFi
96
102
  * until it is chosen. So the host decides from the section's elements: when they are only field slots
97
103
  * (`listPlacedFieldSlots`) and none of their paths resolves in the form's schema, the section is dropped.
98
104
  *
99
- * This reads the SCHEMA, not visibility: a field hidden by a condition is still in the schema, so its
105
+ * A field the viewer may not read (`.readableBy`, or under such an ancestor) is not offered either, outside a CREATE
106
+ * form, exactly as `FormField` decides it (#4459 review D1); so a section of only such fields is dropped too.
107
+ *
108
+ * This reads the SCHEMA and the VIEWER, not visibility: a field hidden by a condition is still in the schema, so its
100
109
  * section stays. Dropping a section there would take it out of its container on a value change.
101
110
  */
102
- function groupedSectionShowsNoField(children, schema) {
111
+ function groupedSectionShowsNoField(children, schema, viewer) {
103
112
  if (!schema)
104
113
  return false;
105
114
  const placed = listPlacedFieldSlots(children);
106
115
  return placed !== null
107
116
  && placed.length > 0
108
- && placed.every((slot) => !slot.hasOwnSchema && AutomatedLayoutFrontendUtils.resolveFieldSchemaPath(schema, slot.path) === undefined);
117
+ && placed.every((slot) => {
118
+ if (slot.hasOwnSchema)
119
+ return false;
120
+ const fieldSchema = AutomatedLayoutFrontendUtils.resolveFieldSchemaPath(schema, slot.path);
121
+ return fieldSchema === undefined
122
+ || (viewer.operationType !== CoreResourceOperation.CREATE
123
+ && !viewerMaySeeFieldOnPath(fieldSchema, slot.path, (prefix) => AutomatedLayoutFrontendUtils.resolveFieldSchemaPath(schema, prefix), viewer.fieldReader));
124
+ });
109
125
  }
110
126
  /**
111
127
  * Introspects children for `<Section>` elements with container-mode `appearance`.
112
128
  * Groups sections sharing the same container mode into a `ContentSectionContainer`.
113
129
  * Solo-mode sections and non-Section children render in place.
114
130
  */
115
- function renderGroupedChildren(children, formCtx) {
131
+ function renderGroupedChildren(children, formCtx, viewer) {
116
132
  const grouped = groupSectionsByAppearance(children);
117
133
  return (_jsx(_Fragment, { children: grouped.items.map((item, idx) => {
118
134
  if (item.type === 'node') {
@@ -120,7 +136,7 @@ function renderGroupedChildren(children, formCtx) {
120
136
  }
121
137
  // A grouped section none of whose fields this operation has is dropped from its container, and a
122
138
  // container left with no section renders nothing (see `groupedSectionShowsNoField`).
123
- const shownSections = item.group.sections.filter((el) => !groupedSectionShowsNoField(el.props.children, formCtx?.schema));
139
+ const shownSections = item.group.sections.filter((el) => !groupedSectionShowsNoField(el.props.children, formCtx?.schema, viewer));
124
140
  if (shownSections.length === 0)
125
141
  return null;
126
142
  const group = { ...item.group, sections: shownSections };
@@ -1 +1 @@
1
- {"version":3,"file":"FormLayout.js","sourceRoot":"","sources":["../../../../../src/components/resources/skeleton/FormLayout.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAGb,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAkB,MAAM,OAAO,CAAC;AAEvG,O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AQ,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;gBAC9E,EAAE,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI;gBACjB,KAAK,EAAE,aAAa,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC;gBACnC,WAAW,EAAE,mBAAmB,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC;gBAC/C,OAAO,EAAE,CACP,KAAC,qBAAqB,IACpB,YAAY,EAAE,EAAE,CAAC,KAAK,EACtB,eAAe,EAAE,CAAC,CAAC,aAAa,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,GAC/C,CACH;aACF,CAAC,CAAC,CAAC;YAEJ,OAAO,CACL,KAAC,uBAAuB,IAEtB,QAAQ,EAAE,eAAe,EACzB,MAAM,EAAE,MAAM,IAFT,SAAS,KAAK,CAAC,IAAI,IAAI,GAAG,EAAE,CAGjC,CACH,CAAC;QACJ,CAAC,CAAC,GACD,CACJ,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,SAAS,qBAAqB,CAAC,EAC7B,YAAY,EACZ,eAAe,GAIhB;IACC,OAAO,CACL,KAAC,kBAAkB,IACjB,QAAQ,EAAE,sBAAsB,CAAC,IAAI,EACrC,YAAY,EAAE,YAAY,EAC1B,eAAe,EAAE,eAAe,GAChC,CACH,CAAC;AACJ,CAAC","sourcesContent":["'use client';\n\nimport type { z } from 'zod';\nimport React, { useCallback, useLayoutEffect, useMemo, useRef, useState, type ReactNode } from 'react';\nimport type { ResponsiveMaxWidth } from '@wildo-ai/presets-components-models';\nimport { responsiveMaxWidthToCssValue } from '../../sections/surface';\nimport { SectionLegendVoiceHost } from '../../sections/section-legend-voice';\nimport { cn } from '~wildo-frontend-lib/core/ui/cn';\nimport { ErrorBoundary } from '~wildo-frontend-lib/core/errors/ErrorBoundary';\nimport { FieldScopeProvider } from './FieldScopeContext';\nimport {\n FormLayoutSlotContext,\n type FormLayoutSlotType,\n} from './FormLayoutSlotContext';\nimport { FormErrorSummarySlot } from './FormErrorSummarySlot';\nimport { SubmitButton } from './SubmitButton';\nimport { useOptionalFormTemplateContext } from '../../form/automated/FormTemplateContext';\nimport { useOptionalResourceFormActions } from '../../form/automated/ResourceFormActionsContext';\nimport { ContentSectionContainer } from '../../sections/ContentSectionContainer';\nimport type { ContentSectionDescriptor } from '../../sections/ContentSectionContainer';\nimport {\n groupSectionsByAppearance,\n buildSectionConfigFromGroup,\n} from './section-consolidation.utils';\nimport { GroupedSectionBody, type SectionProps } from './Section';\nimport { listPlacedFieldSlots } from './SectionFieldsContext';\nimport { useTemplatePlacedFieldsOf } from '../../form/automated/TemplatePlacedFieldsContext';\nimport { AutomatedLayoutFrontendUtils } from '~wildo-frontend-lib/core/automated-layout/automated-layout.frontend.utils';\nimport { GroupedSectionHostKind } from './Section.shared';\n\nexport interface FormLayoutProps {\n /** Additional CSS classes for the root container. */\n className?: string;\n /**\n * How wide the form column lets its content grow, named in the framework's own vocabulary.\n *\n * Defaults to `'measure'` — the reading-measure cap (~42rem, themeable via `--measure-max-width`)\n * that keeps a single-column form readable rather than stretched edge to edge. That default is the\n * long-standing behaviour and is what almost every form wants.\n *\n * The prop exists so the tier is REACHABLE. It was previously a literal Tailwind class spelling the\n * same value the `'measure'` tier already names, which meant a host could not select a different one\n * — see {@link DisplayLayout}'s twin, where a composed template needed `'none'` and had no way to\n * ask for it.\n */\n responsiveMaxWidth?: ResponsiveMaxWidth;\n /**\n * Context field values to inject into form state.\n * Fields present here are hidden from rendering but populate\n * the form state for validation and submission (e.g., parent IDs).\n */\n contextFieldValues?: Record<string, unknown>;\n /**\n * When `false`, suppresses automatic `<SubmitButton>` injection even if no\n * submit slot is registered by children. The generated-template path sets\n * this via `generateDefaultFormTemplate({ includeSubmitButton: false })`.\n *\n * Note: under `ResourceAutomatedForm`, suppression is automatic regardless\n * of this prop — the host provides `ResourceFormActionsContext` and renders\n * its own operation-aware submit row after the template, so developer-\n * authored templates can use a bare `<FormLayout>` without ending up with\n * two submit buttons. This prop only matters for standalone usage\n * (direct `AutomatedForm` callers outside a resource form host).\n * @default true\n */\n autoInjectSubmitButton?: boolean;\n children?: ReactNode;\n}\n\ninterface AutoSlotsState {\n errorSummary: boolean;\n submitButton: boolean;\n}\n\n/**\n * Root wrapper for edit layout templates.\n *\n * Renders inside `<Form>` (RHF provider). Handles:\n * - Root `FieldScopeContext` with empty prefix\n * - Slot auto-detection: default error summary / submit when omitted (DT-6); no default submit under wizard,\n * nor when a resource-form host owns the submit row (`ResourceFormActionsContext` present —\n * `ResourceAutomatedForm` appends its operation-aware buttons after the template)\n * - Guidance marker for automated testing (DT-9)\n *\n * TODO(F-10): AutoFocus resolution — scan children for first focusable FormField and call focus().\n * Note: `contextFieldValues` are injected upstream by `AutomatedForm`; generated\n * templates hide those fields before rendering, while handwritten templates can\n * still opt into custom treatment when needed.\n *\n * @example\n * ```tsx\n * <FormLayout>\n * <Section name=\"general\">\n * <FormField name=\"title\" />\n * </Section>\n * <SubmitButton />\n * </FormLayout>\n * ```\n */\nexport function FormLayout({\n className,\n children,\n contextFieldValues: _contextFieldValues,\n autoInjectSubmitButton = true,\n responsiveMaxWidth = 'measure',\n}: FormLayoutProps): ReactNode {\n const registeredSlots = useRef(new Set<FormLayoutSlotType>());\n const wizardRootRegistered = useRef(false);\n const [autoSlots, setAutoSlots] = useState<AutoSlotsState>({\n errorSummary: false,\n submitButton: false,\n });\n\n // A non-null ResourceFormActionsContext means a resource-form host\n // (ResourceAutomatedForm) renders its own operation-aware submit row after\n // the template — auto-injecting a generic SubmitButton here would produce a\n // second submit button. Explicit templates authored app-side use a bare\n // <FormLayout>, so this suppression cannot be a prop on the call site.\n const hostOwnsSubmitRow = useOptionalResourceFormActions() !== null;\n\n const registerSlot = useCallback((slot: FormLayoutSlotType) => {\n registeredSlots.current.add(slot);\n }, []);\n\n const registerWizardRoot = useCallback(() => {\n wizardRootRegistered.current = true;\n }, []);\n\n const slotContextValue = useMemo(\n () => ({ registerSlot, registerWizardRoot }),\n [registerSlot, registerWizardRoot],\n );\n\n // After children mount and register their slots, detect missing ones (next frame so layout effects have run).\n useLayoutEffect(() => {\n const frame = requestAnimationFrame(() => {\n const missing: AutoSlotsState = {\n errorSummary: !registeredSlots.current.has('errorSummary'),\n submitButton:\n autoInjectSubmitButton &&\n !hostOwnsSubmitRow &&\n !wizardRootRegistered.current &&\n !registeredSlots.current.has('submitButton'),\n };\n if (missing.errorSummary || missing.submitButton) {\n setAutoSlots(missing);\n }\n });\n return () => cancelAnimationFrame(frame);\n }, [autoInjectSubmitButton, hostOwnsSubmitRow]);\n\n const formCtx = useOptionalFormTemplateContext();\n // Every slot among this layout's children, read from the elements: a tab's panel, a later wizard step\n // or an unchosen variant is not mounted, so its fields cannot report themselves (see\n // `TemplatePlacedFieldsContext`). From an empty prefix: this layout resets its children's scope to \"\".\n useTemplatePlacedFieldsOf(children, '');\n const renderedChildren = useMemo(\n () => renderGroupedChildren(children, formCtx),\n [children, formCtx],\n );\n\n return (\n <FormLayoutSlotContext.Provider value={slotContextValue}>\n {/* A form keeps the heading voice for its sections even inside a read body (an inline editor) — see `SectionLegendVoiceHost`. */}\n <SectionLegendVoiceHost voice={undefined}>\n <FieldScopeProvider pathPrefix=\"\">\n {/*\n T4c — reading-measure cap. A single-column form column caps at\n `--measure-max-width` (~42rem) and aligns to the LEFT of the content\n zone, so detail/settings forms stop stretching edge-to-edge while\n staying flush with the left-aligned resource header (no centred\n gutter). `max-w` only engages when the container is wider than the\n measure, so a form inside a narrow dialog / panel is unaffected.\n Retune/opt-out via the CSS var or by overriding `className`.\n */}\n <div\n className={cn('mr-auto w-full', className)}\n style={{ maxInlineSize: responsiveMaxWidthToCssValue(responsiveMaxWidth) }}\n data-inline-size-tier={responsiveMaxWidth}\n data-guidance-form=\"\"\n // A RESOURCE form, as opposed to any other form on the page (a listing's search box, a chat\n // composer): what automation waits on when it opens a record for editing.\n data-slot=\"form-layout\"\n >\n <ErrorBoundary>\n {autoSlots.errorSummary ? <FormErrorSummarySlot className=\"mb-4\" /> : null}\n {/* `space-y-section` separates stacked SECTIONS with a clear gap (see\n DisplayLayout for the rationale). Wrapped separately from the\n error-summary / submit slots so it never compounds their own\n margins. Bare SETTINGS_ROW field rows are self-delimiting list\n items (`py-card-sm` + `border-b`), so consecutive rows stack\n FLUSH — same pairwise rule as DisplayLayout (see its comment for\n why the attribute match must be `^=settings`, never the\n underscore-carrying `=settings_row`). */}\n <div className=\"space-y-section [&>[data-chrome-mode^=settings]:has(+[data-chrome-mode^=settings])]:mb-0\">{renderedChildren}</div>\n {autoSlots.submitButton ? <SubmitButton className=\"mt-6\" /> : null}\n </ErrorBoundary>\n </div>\n </FieldScopeProvider>\n </SectionLegendVoiceHost>\n </FormLayoutSlotContext.Provider>\n );\n}\n\n/**\n * Whether a GROUPED section (grid, tabs, accordion, …) has nothing to show for this form's operation.\n *\n * One template serves several operations, and a `FormField` whose field the operation's schema lacks\n * renders nothing. A solo `Section` hides itself from what its fields report once mounted; a grouped\n * section cannot, because its container draws its title and panel and a tab's panel is not even mounted\n * until it is chosen. So the host decides from the section's elements: when they are only field slots\n * (`listPlacedFieldSlots`) and none of their paths resolves in the form's schema, the section is dropped.\n *\n * This reads the SCHEMA, not visibility: a field hidden by a condition is still in the schema, so its\n * section stays. Dropping a section there would take it out of its container on a value change.\n */\nfunction groupedSectionShowsNoField(children: ReactNode, schema: z.ZodTypeAny | undefined): boolean {\n if (!schema) return false;\n const placed = listPlacedFieldSlots(children);\n return placed !== null\n && placed.length > 0\n && placed.every((slot) => !slot.hasOwnSchema && AutomatedLayoutFrontendUtils.resolveFieldSchemaPath(schema, slot.path) === undefined);\n}\n\n/**\n * Introspects children for `<Section>` elements with container-mode `appearance`.\n * Groups sections sharing the same container mode into a `ContentSectionContainer`.\n * Solo-mode sections and non-Section children render in place.\n */\nfunction renderGroupedChildren(\n children: ReactNode,\n formCtx: ReturnType<typeof useOptionalFormTemplateContext>,\n): ReactNode {\n const grouped = groupSectionsByAppearance(children);\n\n return (\n <>\n {grouped.items.map((item, idx) => {\n if (item.type === 'node') {\n return <React.Fragment key={idx}>{item.node}</React.Fragment>;\n }\n\n // A grouped section none of whose fields this operation has is dropped from its container, and a\n // container left with no section renders nothing (see `groupedSectionShowsNoField`).\n const shownSections = item.group.sections.filter((el) => !groupedSectionShowsNoField(el.props.children, formCtx?.schema));\n if (shownSections.length === 0) return null;\n const group = { ...item.group, sections: shownSections };\n const config = buildSectionConfigFromGroup(group);\n const sectionLabels = formCtx?.sectionLabels ?? {};\n const sectionDescriptions = formCtx?.sectionDescriptions ?? {};\n\n const contentSections: ContentSectionDescriptor[] = group.sections.map((el) => ({\n id: el.props.name,\n title: sectionLabels[el.props.name],\n description: sectionDescriptions[el.props.name],\n content: (\n <GroupedSectionContent\n sectionProps={el.props}\n providesHeading={!!sectionLabels[el.props.name]}\n />\n ),\n }));\n\n return (\n <ContentSectionContainer\n key={`group-${group.mode}-${idx}`}\n sections={contentSections}\n config={config}\n />\n );\n })}\n </>\n );\n}\n\n/**\n * Wraps an individual grouped section's content with section-level behaviors\n * (chromeMode, saveable) when rendered inside a container.\n */\nfunction GroupedSectionContent({\n sectionProps,\n providesHeading,\n}: {\n sectionProps: Pick<SectionProps, 'name' | 'children' | 'chromeMode' | 'saveable' | 'className' | 'disabled'>;\n providesHeading?: boolean;\n}): ReactNode {\n return (\n <GroupedSectionBody\n hostKind={GroupedSectionHostKind.FORM}\n sectionProps={sectionProps}\n providesHeading={providesHeading}\n />\n );\n}\n"]}
1
+ {"version":3,"file":"FormLayout.js","sourceRoot":"","sources":["../../../../../src/components/resources/skeleton/FormLayout.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAGb,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAkB,MAAM,OAAO,CAAC;AAEvG,OAAO,EAAE,4BAA4B,EAAE,MAAM,wBAAwB,CAAC;AACtE,OAAO,EAAE,sB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H,CAAC;QACJ,CAAC,CAAC,GACD,CACJ,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,SAAS,qBAAqB,CAAC,EAC7B,YAAY,EACZ,eAAe,GAIhB;IACC,OAAO,CACL,KAAC,kBAAkB,IACjB,QAAQ,EAAE,sBAAsB,CAAC,IAAI,EACrC,YAAY,EAAE,YAAY,EAC1B,eAAe,EAAE,eAAe,GAChC,CACH,CAAC;AACJ,CAAC","sourcesContent":["'use client';\n\nimport type { z } from 'zod';\nimport React, { useCallback, useLayoutEffect, useMemo, useRef, useState, type ReactNode } from 'react';\nimport type { ResponsiveMaxWidth } from '@wildo-ai/presets-components-models';\nimport { responsiveMaxWidthToCssValue } from '../../sections/surface';\nimport { SectionLegendVoiceHost } from '../../sections/section-legend-voice';\nimport { cn } from '~wildo-frontend-lib/core/ui/cn';\nimport { ErrorBoundary } from '~wildo-frontend-lib/core/errors/ErrorBoundary';\nimport { FieldScopeProvider } from './FieldScopeContext';\nimport {\n FormLayoutSlotContext,\n type FormLayoutSlotType,\n} from './FormLayoutSlotContext';\nimport { FormErrorSummarySlot } from './FormErrorSummarySlot';\nimport { SubmitButton } from './SubmitButton';\nimport { useOptionalFormTemplateContext } from '../../form/automated/FormTemplateContext';\nimport { useOptionalResourceFormActions } from '../../form/automated/ResourceFormActionsContext';\nimport { ContentSectionContainer } from '../../sections/ContentSectionContainer';\nimport type { ContentSectionDescriptor } from '../../sections/ContentSectionContainer';\nimport {\n groupSectionsByAppearance,\n buildSectionConfigFromGroup,\n} from './section-consolidation.utils';\nimport { GroupedSectionBody, type SectionProps } from './Section';\nimport { listPlacedFieldSlots } from './SectionFieldsContext';\nimport { CoreResourceOperation, type FieldReader } from '@wildo-ai/saas-models';\nimport { useViewerFieldReader, viewerMaySeeFieldOnPath } from '~wildo-frontend-lib/core/navigation/viewer-field-reader';\nimport { useOptionalFormSchemaContext } from '~wildo-frontend-lib/components/form/useFormSchemaContext';\nimport { useTemplatePlacedFieldsOf } from '../../form/automated/TemplatePlacedFieldsContext';\nimport { AutomatedLayoutFrontendUtils } from '~wildo-frontend-lib/core/automated-layout/automated-layout.frontend.utils';\nimport { GroupedSectionHostKind } from './Section.shared';\n\nexport interface FormLayoutProps {\n /** Additional CSS classes for the root container. */\n className?: string;\n /**\n * How wide the form column lets its content grow, named in the framework's own vocabulary.\n *\n * Defaults to `'measure'` — the reading-measure cap (~42rem, themeable via `--measure-max-width`)\n * that keeps a single-column form readable rather than stretched edge to edge. That default is the\n * long-standing behaviour and is what almost every form wants.\n *\n * The prop exists so the tier is REACHABLE. It was previously a literal Tailwind class spelling the\n * same value the `'measure'` tier already names, which meant a host could not select a different one\n * — see {@link DisplayLayout}'s twin, where a composed template needed `'none'` and had no way to\n * ask for it.\n */\n responsiveMaxWidth?: ResponsiveMaxWidth;\n /**\n * Context field values to inject into form state.\n * Fields present here are hidden from rendering but populate\n * the form state for validation and submission (e.g., parent IDs).\n */\n contextFieldValues?: Record<string, unknown>;\n /**\n * When `false`, suppresses automatic `<SubmitButton>` injection even if no\n * submit slot is registered by children. The generated-template path sets\n * this via `generateDefaultFormTemplate({ includeSubmitButton: false })`.\n *\n * Note: under `ResourceAutomatedForm`, suppression is automatic regardless\n * of this prop — the host provides `ResourceFormActionsContext` and renders\n * its own operation-aware submit row after the template, so developer-\n * authored templates can use a bare `<FormLayout>` without ending up with\n * two submit buttons. This prop only matters for standalone usage\n * (direct `AutomatedForm` callers outside a resource form host).\n * @default true\n */\n autoInjectSubmitButton?: boolean;\n children?: ReactNode;\n}\n\ninterface AutoSlotsState {\n errorSummary: boolean;\n submitButton: boolean;\n}\n\n/**\n * Root wrapper for edit layout templates.\n *\n * Renders inside `<Form>` (RHF provider). Handles:\n * - Root `FieldScopeContext` with empty prefix\n * - Slot auto-detection: default error summary / submit when omitted (DT-6); no default submit under wizard,\n * nor when a resource-form host owns the submit row (`ResourceFormActionsContext` present —\n * `ResourceAutomatedForm` appends its operation-aware buttons after the template)\n * - Guidance marker for automated testing (DT-9)\n *\n * TODO(F-10): AutoFocus resolution — scan children for first focusable FormField and call focus().\n * Note: `contextFieldValues` are injected upstream by `AutomatedForm`; generated\n * templates hide those fields before rendering, while handwritten templates can\n * still opt into custom treatment when needed.\n *\n * @example\n * ```tsx\n * <FormLayout>\n * <Section name=\"general\">\n * <FormField name=\"title\" />\n * </Section>\n * <SubmitButton />\n * </FormLayout>\n * ```\n */\nexport function FormLayout({\n className,\n children,\n contextFieldValues: _contextFieldValues,\n autoInjectSubmitButton = true,\n responsiveMaxWidth = 'measure',\n}: FormLayoutProps): ReactNode {\n const registeredSlots = useRef(new Set<FormLayoutSlotType>());\n const wizardRootRegistered = useRef(false);\n const [autoSlots, setAutoSlots] = useState<AutoSlotsState>({\n errorSummary: false,\n submitButton: false,\n });\n\n // A non-null ResourceFormActionsContext means a resource-form host\n // (ResourceAutomatedForm) renders its own operation-aware submit row after\n // the template — auto-injecting a generic SubmitButton here would produce a\n // second submit button. Explicit templates authored app-side use a bare\n // <FormLayout>, so this suppression cannot be a prop on the call site.\n const hostOwnsSubmitRow = useOptionalResourceFormActions() !== null;\n\n const registerSlot = useCallback((slot: FormLayoutSlotType) => {\n registeredSlots.current.add(slot);\n }, []);\n\n const registerWizardRoot = useCallback(() => {\n wizardRootRegistered.current = true;\n }, []);\n\n const slotContextValue = useMemo(\n () => ({ registerSlot, registerWizardRoot }),\n [registerSlot, registerWizardRoot],\n );\n\n // After children mount and register their slots, detect missing ones (next frame so layout effects have run).\n useLayoutEffect(() => {\n const frame = requestAnimationFrame(() => {\n const missing: AutoSlotsState = {\n errorSummary: !registeredSlots.current.has('errorSummary'),\n submitButton:\n autoInjectSubmitButton &&\n !hostOwnsSubmitRow &&\n !wizardRootRegistered.current &&\n !registeredSlots.current.has('submitButton'),\n };\n if (missing.errorSummary || missing.submitButton) {\n setAutoSlots(missing);\n }\n });\n return () => cancelAnimationFrame(frame);\n }, [autoInjectSubmitButton, hostOwnsSubmitRow]);\n\n const formCtx = useOptionalFormTemplateContext();\n // Every slot among this layout's children, read from the elements: a tab's panel, a later wizard step\n // or an unchosen variant is not mounted, so its fields cannot report themselves (see\n // `TemplatePlacedFieldsContext`). From an empty prefix: this layout resets its children's scope to \"\".\n useTemplatePlacedFieldsOf(children, '');\n // The viewer and the operation, for the grouped sections none of whose fields it is offered (#4459 review D1).\n const fieldReader = useViewerFieldReader();\n const operationType = useOptionalFormSchemaContext()?.operationType;\n const renderedChildren = useMemo(\n () => renderGroupedChildren(children, formCtx, { fieldReader, operationType }),\n [children, formCtx, fieldReader, operationType],\n );\n\n return (\n <FormLayoutSlotContext.Provider value={slotContextValue}>\n {/* A form keeps the heading voice for its sections even inside a read body (an inline editor) — see `SectionLegendVoiceHost`. */}\n <SectionLegendVoiceHost voice={undefined}>\n <FieldScopeProvider pathPrefix=\"\">\n {/*\n T4c — reading-measure cap. A single-column form column caps at\n `--measure-max-width` (~42rem) and aligns to the LEFT of the content\n zone, so detail/settings forms stop stretching edge-to-edge while\n staying flush with the left-aligned resource header (no centred\n gutter). `max-w` only engages when the container is wider than the\n measure, so a form inside a narrow dialog / panel is unaffected.\n Retune/opt-out via the CSS var or by overriding `className`.\n */}\n <div\n className={cn('mr-auto w-full', className)}\n style={{ maxInlineSize: responsiveMaxWidthToCssValue(responsiveMaxWidth) }}\n data-inline-size-tier={responsiveMaxWidth}\n data-guidance-form=\"\"\n // A RESOURCE form, as opposed to any other form on the page (a listing's search box, a chat\n // composer): what automation waits on when it opens a record for editing.\n data-slot=\"form-layout\"\n >\n <ErrorBoundary>\n {autoSlots.errorSummary ? <FormErrorSummarySlot className=\"mb-4\" /> : null}\n {/* `space-y-section` separates stacked SECTIONS with a clear gap (see\n DisplayLayout for the rationale). Wrapped separately from the\n error-summary / submit slots so it never compounds their own\n margins. Bare SETTINGS_ROW field rows are self-delimiting list\n items (`py-card-sm` + `border-b`), so consecutive rows stack\n FLUSH — same pairwise rule as DisplayLayout (see its comment for\n why the attribute match must be `^=settings`, never the\n underscore-carrying `=settings_row`). */}\n <div className=\"space-y-section [&>[data-chrome-mode^=settings]:has(+[data-chrome-mode^=settings])]:mb-0\">{renderedChildren}</div>\n {autoSlots.submitButton ? <SubmitButton className=\"mt-6\" /> : null}\n </ErrorBoundary>\n </div>\n </FieldScopeProvider>\n </SectionLegendVoiceHost>\n </FormLayoutSlotContext.Provider>\n );\n}\n\n/**\n * Whether a GROUPED section (grid, tabs, accordion, …) has nothing to show for this form's operation.\n *\n * One template serves several operations, and a `FormField` whose field the operation's schema lacks\n * renders nothing. A solo `Section` hides itself from what its fields report once mounted; a grouped\n * section cannot, because its container draws its title and panel and a tab's panel is not even mounted\n * until it is chosen. So the host decides from the section's elements: when they are only field slots\n * (`listPlacedFieldSlots`) and none of their paths resolves in the form's schema, the section is dropped.\n *\n * A field the viewer may not read (`.readableBy`, or under such an ancestor) is not offered either, outside a CREATE\n * form, exactly as `FormField` decides it (#4459 review D1); so a section of only such fields is dropped too.\n *\n * This reads the SCHEMA and the VIEWER, not visibility: a field hidden by a condition is still in the schema, so its\n * section stays. Dropping a section there would take it out of its container on a value change.\n */\nfunction groupedSectionShowsNoField(children: ReactNode, schema: z.ZodTypeAny | undefined, viewer: GroupedSectionViewer): boolean {\n if (!schema) return false;\n const placed = listPlacedFieldSlots(children);\n return placed !== null\n && placed.length > 0\n && placed.every((slot) => {\n if (slot.hasOwnSchema) return false;\n const fieldSchema = AutomatedLayoutFrontendUtils.resolveFieldSchemaPath(schema, slot.path);\n return fieldSchema === undefined\n || (viewer.operationType !== CoreResourceOperation.CREATE\n && !viewerMaySeeFieldOnPath(fieldSchema, slot.path, (prefix) => AutomatedLayoutFrontendUtils.resolveFieldSchemaPath(schema, prefix), viewer.fieldReader));\n });\n}\n\n/** Who the form is shown to, and for which operation: what decides whether a field the viewer may not read is offered. */\ninterface GroupedSectionViewer {\n readonly fieldReader: FieldReader;\n readonly operationType: string | undefined;\n}\n\n/**\n * Introspects children for `<Section>` elements with container-mode `appearance`.\n * Groups sections sharing the same container mode into a `ContentSectionContainer`.\n * Solo-mode sections and non-Section children render in place.\n */\nfunction renderGroupedChildren(\n children: ReactNode,\n formCtx: ReturnType<typeof useOptionalFormTemplateContext>,\n viewer: GroupedSectionViewer,\n): ReactNode {\n const grouped = groupSectionsByAppearance(children);\n\n return (\n <>\n {grouped.items.map((item, idx) => {\n if (item.type === 'node') {\n return <React.Fragment key={idx}>{item.node}</React.Fragment>;\n }\n\n // A grouped section none of whose fields this operation has is dropped from its container, and a\n // container left with no section renders nothing (see `groupedSectionShowsNoField`).\n const shownSections = item.group.sections.filter((el) => !groupedSectionShowsNoField(el.props.children, formCtx?.schema, viewer));\n if (shownSections.length === 0) return null;\n const group = { ...item.group, sections: shownSections };\n const config = buildSectionConfigFromGroup(group);\n const sectionLabels = formCtx?.sectionLabels ?? {};\n const sectionDescriptions = formCtx?.sectionDescriptions ?? {};\n\n const contentSections: ContentSectionDescriptor[] = group.sections.map((el) => ({\n id: el.props.name,\n title: sectionLabels[el.props.name],\n description: sectionDescriptions[el.props.name],\n content: (\n <GroupedSectionContent\n sectionProps={el.props}\n providesHeading={!!sectionLabels[el.props.name]}\n />\n ),\n }));\n\n return (\n <ContentSectionContainer\n key={`group-${group.mode}-${idx}`}\n sections={contentSections}\n config={config}\n />\n );\n })}\n </>\n );\n}\n\n/**\n * Wraps an individual grouped section's content with section-level behaviors\n * (chromeMode, saveable) when rendered inside a container.\n */\nfunction GroupedSectionContent({\n sectionProps,\n providesHeading,\n}: {\n sectionProps: Pick<SectionProps, 'name' | 'children' | 'chromeMode' | 'saveable' | 'className' | 'disabled'>;\n providesHeading?: boolean;\n}): ReactNode {\n return (\n <GroupedSectionBody\n hostKind={GroupedSectionHostKind.FORM}\n sectionProps={sectionProps}\n providesHeading={providesHeading}\n />\n );\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"Group.d.ts","sourceRoot":"","sources":["../../../../../src/components/resources/skeleton/Group.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAOvC,MAAM,WAAW,UAAU;IACzB;;;;;OAKG;IACH,IAAI,EAAE,MAAM,CAAC;IACb,sDAAsD;IACtD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,KAAK,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,UAAU,GAAG,SAAS,CAiC1E;yBAjCe,KAAK"}
1
+ {"version":3,"file":"Group.d.ts","sourceRoot":"","sources":["../../../../../src/components/resources/skeleton/Group.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAQvC,MAAM,WAAW,UAAU;IACzB;;;;;OAKG;IACH,IAAI,EAAE,MAAM,CAAC;IACb,sDAAsD;IACtD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,KAAK,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,UAAU,GAAG,SAAS,CAsC1E;yBAtCe,KAAK"}
@@ -5,6 +5,7 @@ import { useOptionalDisplayTemplateContext } from '../../data-display/DisplayTem
5
5
  import { TypographyVariant, UIBehavior } from '@wildo-ai/presets-components-models';
6
6
  import { cn } from '../../../core/ui/cn.js';
7
7
  import { useUI } from '../../../core/ui/useUI.js';
8
+ import { documentHeadingTag, NestedDocumentHeadingLevel, useDocumentHeadingLevel } from '../../../components/typography/document-heading-level.js';
8
9
  /**
9
10
  * Visual grouping for form and display templates.
10
11
  *
@@ -29,9 +30,11 @@ export function Group({ name, className, children }) {
29
30
  const formCtx = useOptionalFormTemplateContext();
30
31
  const displayCtx = useOptionalDisplayTemplateContext();
31
32
  const { getRecipe } = useUI();
33
+ const headingLevel = useDocumentHeadingLevel();
34
+ const HeadingTag = documentHeadingTag(headingLevel);
32
35
  const title = formCtx?.groupLabels?.[name] ??
33
36
  displayCtx?.groupLabels?.[name];
34
- return (_jsxs("div", { className: className, "data-guidance-group": name, children: [title && _jsx("h3", { className: cn('col-span-full mb-element', getRecipe(UIBehavior.TYPOGRAPHY, TypographyVariant.EYEBROW).base), children: title }), children] }));
37
+ return (_jsxs("div", { className: className, "data-guidance-group": name, children: [title && _jsx(HeadingTag, { className: cn('col-span-full mb-element', getRecipe(UIBehavior.TYPOGRAPHY, TypographyVariant.EYEBROW).base), children: title }), title ? _jsx(NestedDocumentHeadingLevel, { children: children }) : children] }));
35
38
  }
36
39
  Group.displayName = 'Group';
37
40
  //# sourceMappingURL=Group.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Group.js","sourceRoot":"","sources":["../../../../../src/components/resources/skeleton/Group.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAGb,OAAO,EAAE,8BAA8B,EAAE,MAAM,0CAA0C,CAAC;AAC1F,OAAO,EAAE,iCAAiC,EAAE,MAAM,2CAA2C,CAAC;AAC9F,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAC;AACpF,OAAO,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AACpD,OAAO,EAAE,KAAK,EAAE,MAAM,mCAAmC,CAAC;AAe1D;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,UAAU,KAAK,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAc;IAC7D,MAAM,OAAO,GAAG,8BAA8B,EAAE,CAAC;IACjD,MAAM,UAAU,GAAG,iCAAiC,EAAE,CAAC;IACvD,MAAM,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,CAAC;IAE9B,MAAM,KAAK,GACT,OAAO,EAAE,WAAW,EAAE,CAAC,IAAI,CAAC;QAC5B,UAAU,EAAE,WAAW,EAAE,CAAC,IAAI,CAAC,CAAC;IAElC,OAAO,CACL,eAAK,SAAS,EAAE,SAAS,yBAAuB,IAAI,aAmBjD,KAAK,IAAI,aAAI,SAAS,EAAE,EAAE,CAAC,0BAA0B,EAAE,SAAS,CAAC,UAAU,CAAC,UAAU,EAAE,iBAAiB,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,YAAG,KAAK,GAAM,EACtI,QAAQ,IACL,CACP,CAAC;AACJ,CAAC;AAED,KAAK,CAAC,WAAW,GAAG,OAAO,CAAC","sourcesContent":["'use client';\n\nimport type { ReactNode } from 'react';\nimport { useOptionalFormTemplateContext } from '../../form/automated/FormTemplateContext';\nimport { useOptionalDisplayTemplateContext } from '../../data-display/DisplayTemplateContext';\nimport { TypographyVariant, UIBehavior } from '@wildo-ai/presets-components-models';\nimport { cn } from '~wildo-frontend-lib/core/ui/cn';\nimport { useUI } from '~wildo-frontend-lib/core/ui/useUI';\n\nexport interface GroupProps {\n /**\n * Structural ref — maps to i18n keys for title:\n * - `resources.{type}.groups.{name}.title`\n *\n * Must match an entry in `layout.refs.groups`.\n */\n name: string;\n /** Additional CSS classes for the group container. */\n className?: string;\n children: ReactNode;\n}\n\n/**\n * Visual grouping for form and display templates.\n *\n * Groups fields with an optional i18n title resolved from:\n * formCtx.groupLabels → displayCtx.groupLabels\n *\n * Groups and sections are distinct concepts with separate i18n namespaces\n * (`resources.{type}.groups.{ref}.title` vs `resources.{type}.sections.{ref}.title`).\n * No cross-pollination between the two.\n *\n * @example\n * ```tsx\n * <DisplayLayout>\n * <Group name=\"contact\" className=\"hidden md:block\">\n * <DisplayField name=\"email\" />\n * <DisplayField name=\"phone\" />\n * </Group>\n * </DisplayLayout>\n * ```\n */\nexport function Group({ name, className, children }: GroupProps): ReactNode {\n const formCtx = useOptionalFormTemplateContext();\n const displayCtx = useOptionalDisplayTemplateContext();\n const { getRecipe } = useUI();\n\n const title =\n formCtx?.groupLabels?.[name] ??\n displayCtx?.groupLabels?.[name];\n\n return (\n <div className={className} data-guidance-group={name}>\n {/*\n * `col-span-full` because `className` is where callers put the group's LAYOUT, and the heading\n * shares that element with the fields. Under `grid grid-cols-2` the heading took the first\n * cell and pushed every field one cell over — measured on the Wonder Todos edit template,\n * where \"Workflow\" sat BESIDE Status instead of above it, and each field after it landed in\n * the other column from the one its neighbours implied. Spanning the full row gives the\n * heading its own line in any grid and does nothing at all in a flex or block layout.\n *\n * Not solved by moving `className` onto an inner wrapper around the fields: the documented\n * use `className=\"hidden md:block\"` means \"hide this GROUP\", heading included, and that\n * would start hiding the fields while leaving an orphaned heading on screen.\n */}\n {/*\n * The EYEBROW voice, in forms and read bodies alike: a group names a handful of fields that belong\n * together (\"Workflow\"), which is a label for the cluster, not a heading that orders the page. As a\n * `Subheading` it was 16px/500 in the foreground, as loud as the inputs it introduced (measured on the\n * Wonder Todos todo edit form, 2026-09-30). Still a real `h3` for the document outline.\n */}\n {title && <h3 className={cn('col-span-full mb-element', getRecipe(UIBehavior.TYPOGRAPHY, TypographyVariant.EYEBROW).base)}>{title}</h3>}\n {children}\n </div>\n );\n}\n\nGroup.displayName = 'Group';\n"]}
1
+ {"version":3,"file":"Group.js","sourceRoot":"","sources":["../../../../../src/components/resources/skeleton/Group.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAGb,OAAO,EAAE,8BAA8B,EAAE,MAAM,0CAA0C,CAAC;AAC1F,OAAO,EAAE,iCAAiC,EAAE,MAAM,2CAA2C,CAAC;AAC9F,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAC;AACpF,OAAO,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AACpD,OAAO,EAAE,KAAK,EAAE,MAAM,mCAAmC,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,0BAA0B,EAAE,uBAAuB,EAAE,MAAM,kEAAkE,CAAC;AAe3J;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,UAAU,KAAK,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAc;IAC7D,MAAM,OAAO,GAAG,8BAA8B,EAAE,CAAC;IACjD,MAAM,UAAU,GAAG,iCAAiC,EAAE,CAAC;IACvD,MAAM,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,CAAC;IAC9B,MAAM,YAAY,GAAG,uBAAuB,EAAE,CAAC;IAC/C,MAAM,UAAU,GAAG,kBAAkB,CAAC,YAAY,CAAC,CAAC;IAEpD,MAAM,KAAK,GACT,OAAO,EAAE,WAAW,EAAE,CAAC,IAAI,CAAC;QAC5B,UAAU,EAAE,WAAW,EAAE,CAAC,IAAI,CAAC,CAAC;IAElC,OAAO,CACL,eAAK,SAAS,EAAE,SAAS,yBAAuB,IAAI,aAsBjD,KAAK,IAAI,KAAC,UAAU,IAAC,SAAS,EAAE,EAAE,CAAC,0BAA0B,EAAE,SAAS,CAAC,UAAU,CAAC,UAAU,EAAE,iBAAiB,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,YAAG,KAAK,GAAc,EACtJ,KAAK,CAAC,CAAC,CAAC,KAAC,0BAA0B,cAAE,QAAQ,GAA8B,CAAC,CAAC,CAAC,QAAQ,IACnF,CACP,CAAC;AACJ,CAAC;AAED,KAAK,CAAC,WAAW,GAAG,OAAO,CAAC","sourcesContent":["'use client';\n\nimport type { ReactNode } from 'react';\nimport { useOptionalFormTemplateContext } from '../../form/automated/FormTemplateContext';\nimport { useOptionalDisplayTemplateContext } from '../../data-display/DisplayTemplateContext';\nimport { TypographyVariant, UIBehavior } from '@wildo-ai/presets-components-models';\nimport { cn } from '~wildo-frontend-lib/core/ui/cn';\nimport { useUI } from '~wildo-frontend-lib/core/ui/useUI';\nimport { documentHeadingTag, NestedDocumentHeadingLevel, useDocumentHeadingLevel } from '~wildo-frontend-lib/components/typography/document-heading-level';\n\nexport interface GroupProps {\n /**\n * Structural ref — maps to i18n keys for title:\n * - `resources.{type}.groups.{name}.title`\n *\n * Must match an entry in `layout.refs.groups`.\n */\n name: string;\n /** Additional CSS classes for the group container. */\n className?: string;\n children: ReactNode;\n}\n\n/**\n * Visual grouping for form and display templates.\n *\n * Groups fields with an optional i18n title resolved from:\n * formCtx.groupLabels → displayCtx.groupLabels\n *\n * Groups and sections are distinct concepts with separate i18n namespaces\n * (`resources.{type}.groups.{ref}.title` vs `resources.{type}.sections.{ref}.title`).\n * No cross-pollination between the two.\n *\n * @example\n * ```tsx\n * <DisplayLayout>\n * <Group name=\"contact\" className=\"hidden md:block\">\n * <DisplayField name=\"email\" />\n * <DisplayField name=\"phone\" />\n * </Group>\n * </DisplayLayout>\n * ```\n */\nexport function Group({ name, className, children }: GroupProps): ReactNode {\n const formCtx = useOptionalFormTemplateContext();\n const displayCtx = useOptionalDisplayTemplateContext();\n const { getRecipe } = useUI();\n const headingLevel = useDocumentHeadingLevel();\n const HeadingTag = documentHeadingTag(headingLevel);\n\n const title =\n formCtx?.groupLabels?.[name] ??\n displayCtx?.groupLabels?.[name];\n\n return (\n <div className={className} data-guidance-group={name}>\n {/*\n * `col-span-full` because `className` is where callers put the group's LAYOUT, and the heading\n * shares that element with the fields. Under `grid grid-cols-2` the heading took the first\n * cell and pushed every field one cell over — measured on the Wonder Todos edit template,\n * where \"Workflow\" sat BESIDE Status instead of above it, and each field after it landed in\n * the other column from the one its neighbours implied. Spanning the full row gives the\n * heading its own line in any grid and does nothing at all in a flex or block layout.\n *\n * Not solved by moving `className` onto an inner wrapper around the fields: the documented\n * use `className=\"hidden md:block\"` means \"hide this GROUP\", heading included, and that\n * would start hiding the fields while leaving an orphaned heading on screen.\n */}\n {/*\n * The EYEBROW voice, in forms and read bodies alike: a group names a handful of fields that belong\n * together (\"Workflow\"), which is a label for the cluster, not a heading that orders the page. As a\n * `Subheading` it was 16px/500 in the foreground, as loud as the inputs it introduced (measured on the\n * Wonder Todos todo edit form, 2026-09-30). Still a real heading for the document outline, at the level its\n * place in the outline gives it (`useDocumentHeadingLevel`): a hard-coded `h3` straight under the record\n * title's `h1` skipped a level on every create form (#3867). With a title, the fields it owns nest one level\n * deeper, so a heading inside one of them sits under this one.\n */}\n {title && <HeadingTag className={cn('col-span-full mb-element', getRecipe(UIBehavior.TYPOGRAPHY, TypographyVariant.EYEBROW).base)}>{title}</HeadingTag>}\n {title ? <NestedDocumentHeadingLevel>{children}</NestedDocumentHeadingLevel> : children}\n </div>\n );\n}\n\nGroup.displayName = 'Group';\n"]}
@@ -118,7 +118,7 @@ export interface ResourceHeaderTitleProps {
118
118
  *
119
119
  * `h1` on a page: this IS the page's title — the record's name on a record page, the collection's on a
120
120
  * listing — and there is exactly one, so it owns the top of the document outline (an `h2` there once
121
- * left generated screens with no level-one heading at all, #533). `h2` under a host section that owns
121
+ * left generated screens with no level-one heading at all). `h2` under a host section that owns
122
122
  * the heading. The level is structure; the recipe is appearance, and the two are decoupled.
123
123
  */
124
124
  export declare function ResourceHeaderTitleHeading({ title, hostProvidesHeading, className, }: {
@@ -71,7 +71,7 @@ export function useOptionalResourceHeaderContext() {
71
71
  *
72
72
  * `h1` on a page: this IS the page's title — the record's name on a record page, the collection's on a
73
73
  * listing — and there is exactly one, so it owns the top of the document outline (an `h2` there once
74
- * left generated screens with no level-one heading at all, #533). `h2` under a host section that owns
74
+ * left generated screens with no level-one heading at all). `h2` under a host section that owns
75
75
  * the heading. The level is structure; the recipe is appearance, and the two are decoupled.
76
76
  */
77
77
  export function ResourceHeaderTitleHeading({ title, hostProvidesHeading, className, }) {
@@ -1 +1 @@
1
- {"version":3,"file":"ResourceHeaderTitle.js","sourceRoot":"","sources":["../../../../../src/components/resources/skeleton/ResourceHeaderTitle.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AAEH,OAAc,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAC;AAEpF,OAAO,EAAE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C;IAC/E,MAAM,MAAM,GAAG,gCAAgC,EAAE,CAAC;IAClD,IAAI,MAAM,EAAE,aAAa,KAAK,SAAS,EAAE,CAAC;QACxC,OAAO,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,YAAY,CAAC,QAAQ,EAAE,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IACpF,CAAC;IACD,OAAO,4BAAG,QAAQ,GAAI,CAAC;AACzB,CAAC","sourcesContent":["'use client';\n\n/**\n * ResourceHeaderTitle — the record's page TITLE as a first-class, composable\n * element of an authored `layout.header` template.\n *\n * ## Why the header needs a template flow at all\n *\n * The READ page header owns a fixed band: back button, breadcrumb, resource\n * icon, the record's name, and the operation action cluster. Everything a\n * resource wanted to show ABOUT the record (a status badge, a visibility\n * marker, an accent colour) could previously only render in the `layout.display`\n * body BELOW that band — so the identity line said the record's name and nothing\n * else, while \"is this archived? is it public?\" sat in a separate labelled strip\n * underneath.\n *\n * `layout.header` closes that by letting the resource compose the middle of the\n * band itself. It is the same shape the SUMMARY surface already uses\n * (`SummaryLayout` / `SummaryTitle`), for the same reason recorded there: a\n * host-owned title plus a bolt-on accessory slot cannot express \"badge AFTER the\n * name\" or \"swatch BEFORE it\", whereas a template that places the title element\n * itself can express any of them with no extra config axis.\n *\n * ## Contract\n *\n * The header cedes the record's identity to the template the moment `layout.header`\n * exists, so a template that never mounts `<ResourceHeaderTitle />` renders a\n * page with NO record name. That is loud in development (see the diagnostic in\n * `ResourceLayout_Header`) rather than silent.\n *\n * ## Where the title lands (2026-09-30)\n *\n * The header is three lines: a bar (back, breadcrumb, a pane's own controls), the TITLE LINE (the\n * name and the record's actions), and the FACTS line (the rest of the template: status, priority,\n * the parent chip). A template places `<ResourceHeaderTitle />` among its facts as it always did; the\n * header renders the title on the title line and the rest of the template on the facts line. So the\n * name always sits beside the actions it is the subject of, and the facts never push the actions off\n * the name's line, which is what a single wrapping row did: measured on Wonder Todos, a todo in the\n * split pane had its title 41px above its own back arrow and actions.\n *\n * Renders nothing when the host resolved no label (a surface that shows a\n * generic operation title rather than one record's name) — the presence of a\n * label is the single data-driven signal that there is a title to place.\n */\n\nimport React, { createContext, useContext } from 'react';\nimport { createPortal } from 'react-dom';\nimport { TypographyVariant, UIBehavior } from '@wildo-ai/presets-components-models';\n\nimport { Skeleton } from '~wildo-frontend-lib/components/feedback/skeleton';\nimport { cn } from '~wildo-frontend-lib/core/ui/cn';\nimport { UIContext } from '~wildo-frontend-lib/core/ui/UIContext';\nimport { defaultTheme } from '~wildo-frontend-lib/core/ui/themes/default.theme';\n\n// =============================================================================\n// CONTEXT\n// =============================================================================\n\nexport interface ResourceHeaderContextValue {\n /** Resource type key of the record whose header is rendering. */\n resourceType: string;\n\n /**\n * Resolved record title (the `getFrontendResourceLabel` result, or the\n * operation/resource title fallback), or `null` when this surface has no\n * record-specific name to show — `<ResourceHeaderTitle />` then renders nothing.\n */\n title: string | null;\n\n /**\n * `true` while the record's name is still being fetched and nothing else stands in for it.\n * `<ResourceHeaderTitle />` then RESERVES the title's line with a skeleton instead of rendering\n * nothing.\n *\n * An empty band is a defect, not a flicker. The header withholds the label during the first fetch\n * on purpose (it would otherwise flash `#id` and then the real name), and the title element used to\n * render nothing meanwhile — so the band had no height and the name's arrival pushed everything\n * beneath it down by a line. Measured 2026-09-21 in the creation workbench's actor-task modal:\n * `mousedown` landed on a tab, the record arrived, `mouseup` one millisecond later landed on the\n * heading, and the browser dispatched the click to their common ancestor. The tab never changed\n * and nothing reported why.\n */\n titlePending?: boolean;\n\n /**\n * Dev-diagnostic seam: `<ResourceHeaderTitle />` flips `titleMounted` when it\n * renders, letting the header detect an authored template that never places\n * the title. Mutable-ref shape (not state) on purpose — the flag is read only\n * after render and must never schedule a re-render.\n */\n titleMountTracker?: { titleMounted: boolean };\n\n /**\n * `true` when an enclosing section already renders the heading for this region (an embedded READ inside\n * a host section). The record's name is then not the PAGE title, so `<ResourceHeaderTitle />` renders an\n * `h2` beneath the host's heading instead of a second `h1` — the same rule the default header applies.\n */\n hostProvidesHeading?: boolean;\n\n /**\n * The header's TITLE LINE, when the header has one: `<ResourceHeaderTitle />` renders the name THERE,\n * beside the record's actions, instead of in the template's own flow (the facts line). `undefined`\n * means the template's own flow (a template previewed outside a header); `null` means the line is\n * not attached yet — the title then renders nothing for the one layout pass it takes to attach.\n */\n titleTarget?: HTMLElement | null;\n\n /**\n * The header's LEADING slot on the title line, just before the name: `<ResourceHeaderLeading>` renders\n * there. Same `undefined` / `null` reading as {@link titleTarget}.\n */\n leadingTarget?: HTMLElement | null;\n}\n\nconst ResourceHeaderContext = createContext<ResourceHeaderContextValue | null>(null);\n\nexport interface ResourceHeaderContextProviderProps {\n value: ResourceHeaderContextValue;\n children: React.ReactNode;\n}\n\n/** Provides the resolved record title to an authored header template tree. */\nexport function ResourceHeaderContextProvider({\n value,\n children,\n}: ResourceHeaderContextProviderProps): React.JSX.Element {\n return <ResourceHeaderContext.Provider value={value}>{children}</ResourceHeaderContext.Provider>;\n}\n\n/**\n * Read the header context, or `null` when a header template is rendered outside\n * `ResourceLayout_Header` (e.g. previewed in isolation).\n */\nexport function useOptionalResourceHeaderContext(): ResourceHeaderContextValue | null {\n return useContext(ResourceHeaderContext);\n}\n\n// =============================================================================\n// TITLE ELEMENT\n// =============================================================================\n\n/** @wildo_source:part:start saas.frontend.resource-header-title facet:layer:frontend facet:family:resource-ui */\nexport interface ResourceHeaderTitleProps {\n /** Extra classes merged over the theme's resource-title typography. */\n className?: string;\n}\n\n/**\n * The name a resource page is about, set in the theme's `TypographyVariant.RESOURCE_TITLE` voice —\n * quieter than a document heading, because it shares its line with the record's actions. Used by the\n * header's default title and by `<ResourceHeaderTitle />`, so authoring a header template never\n * changes how the title looks.\n *\n * ## It is a real heading, and the level is not cosmetic\n *\n * `h1` on a page: this IS the page's title — the record's name on a record page, the collection's on a\n * listing — and there is exactly one, so it owns the top of the document outline (an `h2` there once\n * left generated screens with no level-one heading at all, #533). `h2` under a host section that owns\n * the heading. The level is structure; the recipe is appearance, and the two are decoupled.\n */\nexport function ResourceHeaderTitleHeading({\n title,\n hostProvidesHeading,\n className,\n}: {\n title: string;\n hostProvidesHeading?: boolean;\n className?: string;\n}): React.JSX.Element {\n // `min-w-0` + truncate so a long record name shrinks rather than pushing the actions off its line.\n const classes = cn('min-w-0 truncate', useResourceTitleVoice(), className);\n return hostProvidesHeading\n ? <h2 className={classes}>{title}</h2>\n : <h1 className={classes}>{title}</h1>;\n}\n\n/**\n * The line a resource title holds while the name is on its way: one skeleton exactly one line box of\n * the theme's `RESOURCE_TITLE` voice tall. It is set in that voice and sized in `lh`, so it matches the\n * real title's line in every theme (text-lg by default, text-xl in cozy and editorial, text-base in\n * dense) and the name's arrival moves nothing beneath it. A fixed height could match only one theme.\n *\n * For a custom header preset: render it where the title will land while the name is on its way.\n * `<ResourceHeaderTitle />` already uses it, so a header TEMPLATE never needs to.\n */\nexport function ResourceHeaderTitlePlaceholder({ className }: { className?: string }): React.JSX.Element {\n return (\n <div className={cn('min-w-0', useResourceTitleVoice(), className)} aria-hidden=\"true\" data-resource-header-title-pending=\"true\">\n <Skeleton className=\"h-[1lh] w-48 max-w-full\" />\n </div>\n );\n}\n\n/**\n * The theme's resource-title typography classes. Read defensively: a header template can be previewed\n * outside the app's `UIProvider`, and a title must not throw there. Without a theme it takes the default\n * theme's voice.\n */\nfunction useResourceTitleVoice(): string | undefined {\n const ui = useContext(UIContext);\n const recipe = ui\n ? ui.getRecipe(UIBehavior.TYPOGRAPHY, TypographyVariant.RESOURCE_TITLE)\n : defaultTheme.typography?.[TypographyVariant.RESOURCE_TITLE];\n return recipe?.base;\n}\n\n/**\n * The record's name, placed by an authored `layout.header` template. Inside a resource header it\n * renders on the header's title line, beside the record's actions (see \"Where the title lands\"\n * above); the rest of the template stays on the facts line below.\n */\nexport function ResourceHeaderTitle({ className }: ResourceHeaderTitleProps): React.JSX.Element | null {\n const header = useOptionalResourceHeaderContext();\n // Register with the missing-title diagnostic BEFORE the empty-title early\n // return: mounting the element discharges the template's contract even when\n // this particular record resolves no label (data-driven, not an authoring bug).\n if (header?.titleMountTracker) header.titleMountTracker.titleMounted = true;\n\n const title = header?.title;\n const element = title\n ? <ResourceHeaderTitleHeading title={title} hostProvidesHeading={header?.hostProvidesHeading} className={className} />\n // A name that is on its way reserves its line, so its arrival moves nothing beneath the header;\n // a surface with no name at all still renders nothing.\n : header?.titlePending\n ? <ResourceHeaderTitlePlaceholder />\n : null;\n if (!element) return null;\n\n // Inside a header: onto its title line. `null` = the line is attaching; render nothing for that pass.\n if (header?.titleTarget !== undefined) {\n return header.titleTarget ? createPortal(element, header.titleTarget) : null;\n }\n return element;\n}\n/**\n * Something that belongs BEFORE the record's name on the title line — an accent swatch, a family glyph —\n * placed by an authored `layout.header` template:\n *\n * ```tsx\n * header: () => (\n * <div className=\"flex min-w-0 flex-wrap items-center gap-field\">\n * <ResourceHeaderLeading><span className=\"size-3 rounded-full\" style={{ background: color }} /></ResourceHeaderLeading>\n * <ResourceHeaderTitle />\n * <DisplayField name=\"status\" labelPlacement=\"hidden\" hideDescription className=\"w-auto\" />\n * </div>\n * ),\n * ```\n *\n * The header lifts the title onto its title line and leaves the rest of the template on the facts line\n * below, so an element a template puts before the title stays with the facts unless it says it leads the\n * name. That is this: inside a header it renders just before the name; outside one (a template previewed\n * in isolation) it renders where it is written. A resource whose glyph replaces the resource icon\n * (`HeaderIconPlacement.TEMPLATE_OWNED`) places it here, so the title line keeps a glyph.\n */\nexport function ResourceHeaderLeading({ children }: { children: React.ReactNode }): React.JSX.Element | null {\n const header = useOptionalResourceHeaderContext();\n if (header?.leadingTarget !== undefined) {\n return header.leadingTarget ? createPortal(children, header.leadingTarget) : null;\n }\n return <>{children}</>;\n}\n/** @wildo_source:part:end saas.frontend.resource-header-title */\n"]}
1
+ {"version":3,"file":"ResourceHeaderTitle.js","sourceRoot":"","sources":["../../../../../src/components/resources/skeleton/ResourceHeaderTitle.tsx"],"names":[],"mappings":"AAAA,YAAY,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C;QACtC,OAAO,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,YAAY,CAAC,OAAO,EAAE,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IAC/E,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC;AACD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,UAAU,qBAAqB,CAAC,EAAE,QAAQ,EAAiC;IAC/E,MAAM,MAAM,GAAG,gCAAgC,EAAE,CAAC;IAClD,IAAI,MAAM,EAAE,aAAa,KAAK,SAAS,EAAE,CAAC;QACxC,OAAO,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,YAAY,CAAC,QAAQ,EAAE,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IACpF,CAAC;IACD,OAAO,4BAAG,QAAQ,GAAI,CAAC;AACzB,CAAC","sourcesContent":["'use client';\n\n/**\n * ResourceHeaderTitle — the record's page TITLE as a first-class, composable\n * element of an authored `layout.header` template.\n *\n * ## Why the header needs a template flow at all\n *\n * The READ page header owns a fixed band: back button, breadcrumb, resource\n * icon, the record's name, and the operation action cluster. Everything a\n * resource wanted to show ABOUT the record (a status badge, a visibility\n * marker, an accent colour) could previously only render in the `layout.display`\n * body BELOW that band — so the identity line said the record's name and nothing\n * else, while \"is this archived? is it public?\" sat in a separate labelled strip\n * underneath.\n *\n * `layout.header` closes that by letting the resource compose the middle of the\n * band itself. It is the same shape the SUMMARY surface already uses\n * (`SummaryLayout` / `SummaryTitle`), for the same reason recorded there: a\n * host-owned title plus a bolt-on accessory slot cannot express \"badge AFTER the\n * name\" or \"swatch BEFORE it\", whereas a template that places the title element\n * itself can express any of them with no extra config axis.\n *\n * ## Contract\n *\n * The header cedes the record's identity to the template the moment `layout.header`\n * exists, so a template that never mounts `<ResourceHeaderTitle />` renders a\n * page with NO record name. That is loud in development (see the diagnostic in\n * `ResourceLayout_Header`) rather than silent.\n *\n * ## Where the title lands (2026-09-30)\n *\n * The header is three lines: a bar (back, breadcrumb, a pane's own controls), the TITLE LINE (the\n * name and the record's actions), and the FACTS line (the rest of the template: status, priority,\n * the parent chip). A template places `<ResourceHeaderTitle />` among its facts as it always did; the\n * header renders the title on the title line and the rest of the template on the facts line. So the\n * name always sits beside the actions it is the subject of, and the facts never push the actions off\n * the name's line, which is what a single wrapping row did: measured on Wonder Todos, a todo in the\n * split pane had its title 41px above its own back arrow and actions.\n *\n * Renders nothing when the host resolved no label (a surface that shows a\n * generic operation title rather than one record's name) — the presence of a\n * label is the single data-driven signal that there is a title to place.\n */\n\nimport React, { createContext, useContext } from 'react';\nimport { createPortal } from 'react-dom';\nimport { TypographyVariant, UIBehavior } from '@wildo-ai/presets-components-models';\n\nimport { Skeleton } from '~wildo-frontend-lib/components/feedback/skeleton';\nimport { cn } from '~wildo-frontend-lib/core/ui/cn';\nimport { UIContext } from '~wildo-frontend-lib/core/ui/UIContext';\nimport { defaultTheme } from '~wildo-frontend-lib/core/ui/themes/default.theme';\n\n// =============================================================================\n// CONTEXT\n// =============================================================================\n\nexport interface ResourceHeaderContextValue {\n /** Resource type key of the record whose header is rendering. */\n resourceType: string;\n\n /**\n * Resolved record title (the `getFrontendResourceLabel` result, or the\n * operation/resource title fallback), or `null` when this surface has no\n * record-specific name to show — `<ResourceHeaderTitle />` then renders nothing.\n */\n title: string | null;\n\n /**\n * `true` while the record's name is still being fetched and nothing else stands in for it.\n * `<ResourceHeaderTitle />` then RESERVES the title's line with a skeleton instead of rendering\n * nothing.\n *\n * An empty band is a defect, not a flicker. The header withholds the label during the first fetch\n * on purpose (it would otherwise flash `#id` and then the real name), and the title element used to\n * render nothing meanwhile — so the band had no height and the name's arrival pushed everything\n * beneath it down by a line. Measured 2026-09-21 in the creation workbench's actor-task modal:\n * `mousedown` landed on a tab, the record arrived, `mouseup` one millisecond later landed on the\n * heading, and the browser dispatched the click to their common ancestor. The tab never changed\n * and nothing reported why.\n */\n titlePending?: boolean;\n\n /**\n * Dev-diagnostic seam: `<ResourceHeaderTitle />` flips `titleMounted` when it\n * renders, letting the header detect an authored template that never places\n * the title. Mutable-ref shape (not state) on purpose — the flag is read only\n * after render and must never schedule a re-render.\n */\n titleMountTracker?: { titleMounted: boolean };\n\n /**\n * `true` when an enclosing section already renders the heading for this region (an embedded READ inside\n * a host section). The record's name is then not the PAGE title, so `<ResourceHeaderTitle />` renders an\n * `h2` beneath the host's heading instead of a second `h1` — the same rule the default header applies.\n */\n hostProvidesHeading?: boolean;\n\n /**\n * The header's TITLE LINE, when the header has one: `<ResourceHeaderTitle />` renders the name THERE,\n * beside the record's actions, instead of in the template's own flow (the facts line). `undefined`\n * means the template's own flow (a template previewed outside a header); `null` means the line is\n * not attached yet — the title then renders nothing for the one layout pass it takes to attach.\n */\n titleTarget?: HTMLElement | null;\n\n /**\n * The header's LEADING slot on the title line, just before the name: `<ResourceHeaderLeading>` renders\n * there. Same `undefined` / `null` reading as {@link titleTarget}.\n */\n leadingTarget?: HTMLElement | null;\n}\n\nconst ResourceHeaderContext = createContext<ResourceHeaderContextValue | null>(null);\n\nexport interface ResourceHeaderContextProviderProps {\n value: ResourceHeaderContextValue;\n children: React.ReactNode;\n}\n\n/** Provides the resolved record title to an authored header template tree. */\nexport function ResourceHeaderContextProvider({\n value,\n children,\n}: ResourceHeaderContextProviderProps): React.JSX.Element {\n return <ResourceHeaderContext.Provider value={value}>{children}</ResourceHeaderContext.Provider>;\n}\n\n/**\n * Read the header context, or `null` when a header template is rendered outside\n * `ResourceLayout_Header` (e.g. previewed in isolation).\n */\nexport function useOptionalResourceHeaderContext(): ResourceHeaderContextValue | null {\n return useContext(ResourceHeaderContext);\n}\n\n// =============================================================================\n// TITLE ELEMENT\n// =============================================================================\n\n/** @wildo_source:part:start saas.frontend.resource-header-title facet:layer:frontend facet:family:resource-ui */\nexport interface ResourceHeaderTitleProps {\n /** Extra classes merged over the theme's resource-title typography. */\n className?: string;\n}\n\n/**\n * The name a resource page is about, set in the theme's `TypographyVariant.RESOURCE_TITLE` voice —\n * quieter than a document heading, because it shares its line with the record's actions. Used by the\n * header's default title and by `<ResourceHeaderTitle />`, so authoring a header template never\n * changes how the title looks.\n *\n * ## It is a real heading, and the level is not cosmetic\n *\n * `h1` on a page: this IS the page's title — the record's name on a record page, the collection's on a\n * listing — and there is exactly one, so it owns the top of the document outline (an `h2` there once\n * left generated screens with no level-one heading at all). `h2` under a host section that owns\n * the heading. The level is structure; the recipe is appearance, and the two are decoupled.\n */\nexport function ResourceHeaderTitleHeading({\n title,\n hostProvidesHeading,\n className,\n}: {\n title: string;\n hostProvidesHeading?: boolean;\n className?: string;\n}): React.JSX.Element {\n // `min-w-0` + truncate so a long record name shrinks rather than pushing the actions off its line.\n const classes = cn('min-w-0 truncate', useResourceTitleVoice(), className);\n return hostProvidesHeading\n ? <h2 className={classes}>{title}</h2>\n : <h1 className={classes}>{title}</h1>;\n}\n\n/**\n * The line a resource title holds while the name is on its way: one skeleton exactly one line box of\n * the theme's `RESOURCE_TITLE` voice tall. It is set in that voice and sized in `lh`, so it matches the\n * real title's line in every theme (text-lg by default, text-xl in cozy and editorial, text-base in\n * dense) and the name's arrival moves nothing beneath it. A fixed height could match only one theme.\n *\n * For a custom header preset: render it where the title will land while the name is on its way.\n * `<ResourceHeaderTitle />` already uses it, so a header TEMPLATE never needs to.\n */\nexport function ResourceHeaderTitlePlaceholder({ className }: { className?: string }): React.JSX.Element {\n return (\n <div className={cn('min-w-0', useResourceTitleVoice(), className)} aria-hidden=\"true\" data-resource-header-title-pending=\"true\">\n <Skeleton className=\"h-[1lh] w-48 max-w-full\" />\n </div>\n );\n}\n\n/**\n * The theme's resource-title typography classes. Read defensively: a header template can be previewed\n * outside the app's `UIProvider`, and a title must not throw there. Without a theme it takes the default\n * theme's voice.\n */\nfunction useResourceTitleVoice(): string | undefined {\n const ui = useContext(UIContext);\n const recipe = ui\n ? ui.getRecipe(UIBehavior.TYPOGRAPHY, TypographyVariant.RESOURCE_TITLE)\n : defaultTheme.typography?.[TypographyVariant.RESOURCE_TITLE];\n return recipe?.base;\n}\n\n/**\n * The record's name, placed by an authored `layout.header` template. Inside a resource header it\n * renders on the header's title line, beside the record's actions (see \"Where the title lands\"\n * above); the rest of the template stays on the facts line below.\n */\nexport function ResourceHeaderTitle({ className }: ResourceHeaderTitleProps): React.JSX.Element | null {\n const header = useOptionalResourceHeaderContext();\n // Register with the missing-title diagnostic BEFORE the empty-title early\n // return: mounting the element discharges the template's contract even when\n // this particular record resolves no label (data-driven, not an authoring bug).\n if (header?.titleMountTracker) header.titleMountTracker.titleMounted = true;\n\n const title = header?.title;\n const element = title\n ? <ResourceHeaderTitleHeading title={title} hostProvidesHeading={header?.hostProvidesHeading} className={className} />\n // A name that is on its way reserves its line, so its arrival moves nothing beneath the header;\n // a surface with no name at all still renders nothing.\n : header?.titlePending\n ? <ResourceHeaderTitlePlaceholder />\n : null;\n if (!element) return null;\n\n // Inside a header: onto its title line. `null` = the line is attaching; render nothing for that pass.\n if (header?.titleTarget !== undefined) {\n return header.titleTarget ? createPortal(element, header.titleTarget) : null;\n }\n return element;\n}\n/**\n * Something that belongs BEFORE the record's name on the title line — an accent swatch, a family glyph —\n * placed by an authored `layout.header` template:\n *\n * ```tsx\n * header: () => (\n * <div className=\"flex min-w-0 flex-wrap items-center gap-field\">\n * <ResourceHeaderLeading><span className=\"size-3 rounded-full\" style={{ background: color }} /></ResourceHeaderLeading>\n * <ResourceHeaderTitle />\n * <DisplayField name=\"status\" labelPlacement=\"hidden\" hideDescription className=\"w-auto\" />\n * </div>\n * ),\n * ```\n *\n * The header lifts the title onto its title line and leaves the rest of the template on the facts line\n * below, so an element a template puts before the title stays with the facts unless it says it leads the\n * name. That is this: inside a header it renders just before the name; outside one (a template previewed\n * in isolation) it renders where it is written. A resource whose glyph replaces the resource icon\n * (`HeaderIconPlacement.TEMPLATE_OWNED`) places it here, so the title line keeps a glyph.\n */\nexport function ResourceHeaderLeading({ children }: { children: React.ReactNode }): React.JSX.Element | null {\n const header = useOptionalResourceHeaderContext();\n if (header?.leadingTarget !== undefined) {\n return header.leadingTarget ? createPortal(children, header.leadingTarget) : null;\n }\n return <>{children}</>;\n}\n/** @wildo_source:part:end saas.frontend.resource-header-title */\n"]}
@@ -1,4 +1,5 @@
1
1
  import { type ReactNode } from 'react';
2
+ import type { z } from 'zod';
2
3
  /**
3
4
  * Registry contract a form-hosted section exposes to its descendants.
4
5
  *
@@ -114,7 +115,14 @@ export declare enum SectionContentRole {
114
115
  /** A slot that renders one field's control, or nothing when the operation's schema lacks it. */
115
116
  FIELD_SLOT = "field_slot",
116
117
  /** A wrapper whose children are judged in its place (it scopes field names and adds no content). */
117
- FIELD_SLOT_CONTAINER = "field_slot_container"
118
+ FIELD_SLOT_CONTAINER = "field_slot_container",
119
+ /**
120
+ * A slot that DISPLAYS one field, or nothing when the viewer is not shown it (#4459 F6): it reports its presence like a
121
+ * field slot, so a display section of nothing but such slots hides when none renders. It writes nothing, so it is never
122
+ * a PLACED slot, and the static grouped-form decision (`listPlacedFieldSlots`) reads it as content of its own. A
123
+ * grouped DISPLAY host reads it statically instead (`listDisplayedFieldSlots`).
124
+ */
125
+ DISPLAY_FIELD_SLOT = "display_field_slot"
118
126
  }
119
127
  /** The role a component declared, if any (read by the placement report as well as the hide decision). */
120
128
  export declare function sectionContentRoleOf(type: unknown): SectionContentRole | undefined;
@@ -126,6 +134,12 @@ export interface PlacedFieldSlot {
126
134
  /** The slot was handed its own schema, so the form's schema does not decide whether it renders. */
127
135
  hasOwnSchema: boolean;
128
136
  }
137
+ /** Which field a display slot shows, as `DisplayField` resolves it: the enclosing scopes' names joined to its own. */
138
+ export interface DisplayedFieldSlot {
139
+ path: string;
140
+ /** The schema the slot was handed, if any: `DisplayField` judges that one rather than the record's. */
141
+ ownSchema: z.ZodTypeAny | undefined;
142
+ }
129
143
  /**
130
144
  * True when `children` holds at least one field slot and nothing else. Fragments and declared containers
131
145
  * are looked through, and so is a plain element that wraps field slots.
@@ -138,4 +152,10 @@ export declare function holdsOnlyFieldSlots(children: ReactNode): boolean;
138
152
  * is not mounted — an inactive tab's panel is not.
139
153
  */
140
154
  export declare function listPlacedFieldSlots(children: ReactNode, pathPrefix?: string): PlacedFieldSlot[] | null;
155
+ /**
156
+ * The display slots `children` places, or `null` when it holds anything besides display slots (a form slot included).
157
+ * Paths are resolved the way `DisplayField` resolves them, starting from `pathPrefix`. Read STATICALLY, for a grouped
158
+ * display host deciding about a section whose content is not mounted (#4459 review D1).
159
+ */
160
+ export declare function listDisplayedFieldSlots(children: ReactNode, pathPrefix?: string): DisplayedFieldSlot[] | null;
141
161
  //# sourceMappingURL=SectionFieldsContext.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SectionFieldsContext.d.ts","sourceRoot":"","sources":["../../../../../src/components/resources/skeleton/SectionFieldsContext.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA6H,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAElK;;;;;;;;;;GAUG;AACH,MAAM,WAAW,yBAAyB;IACxC,aAAa,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,eAAe,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC;;;;;OAKG;IACH,mBAAmB,EAAE,MAAM,MAAM,EAAE,CAAC;IACpC;;;;OAIG;IACH,2BAA2B,EAAE,CAAC,QAAQ,EAAE,MAAM,IAAI,KAAK,MAAM,IAAI,CAAC;IAClE;;;;;OAKG;IACH,kBAAkB,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAC7D,iBAAiB,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C;;;;;;OAMG;IACH,YAAY,EAAE,MAAM,OAAO,CAAC;CAC7B;AAED,eAAO,MAAM,oBAAoB,oDAAwD,CAAC;AAE1F;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,wBAAwB,IAAI,yBAAyB,CAiDpE;AAED;;;;;;;;;GASG;AACH,wBAAgB,2BAA2B,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAQnE;AAKD;;;;;GAKG;AACH,wBAAgB,0BAA0B,IAAI,MAAM,EAAE,CAMrD;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAa9D;AAED;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,yBAAyB,GAAG,OAAO,CAQnF;AAED;;;;;;;;;;GAUG;AACH,oBAAY,kBAAkB;IAC5B,gGAAgG;IAChG,UAAU,eAAe;IACzB,oGAAoG;IACpG,oBAAoB,yBAAyB;CAC9C;AAID,yGAAyG;AACzG,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,OAAO,GAAG,kBAAkB,GAAG,SAAS,CAIlF;AAED,6DAA6D;AAC7D,wBAAgB,yBAAyB,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,kBAAkB,GAAG,IAAI,CAE3F;AAYD,4GAA4G;AAC5G,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,mGAAmG;IACnG,YAAY,EAAE,OAAO,CAAC;CACvB;AAuCD;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,SAAS,GAAG,OAAO,CAEhE;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,SAAS,EAAE,UAAU,SAAK,GAAG,eAAe,EAAE,GAAG,IAAI,CAGnG"}
1
+ {"version":3,"file":"SectionFieldsContext.d.ts","sourceRoot":"","sources":["../../../../../src/components/resources/skeleton/SectionFieldsContext.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA6H,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAClK,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAE7B;;;;;;;;;;GAUG;AACH,MAAM,WAAW,yBAAyB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