@endora-commerce/admin-kit 0.0.0-stage → 0.100.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (449) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +212 -2
  3. package/dist/components/FileDropzone.d.ts +13 -0
  4. package/dist/components/FileDropzone.d.ts.map +1 -0
  5. package/dist/components/FileDropzone.js +39 -0
  6. package/dist/components/FileDropzone.js.map +1 -0
  7. package/dist/components/PaginationFooter.d.ts +25 -0
  8. package/dist/components/PaginationFooter.d.ts.map +1 -0
  9. package/dist/components/PaginationFooter.js +33 -0
  10. package/dist/components/PaginationFooter.js.map +1 -0
  11. package/dist/components/ResponsiveTable.d.ts +26 -0
  12. package/dist/components/ResponsiveTable.d.ts.map +1 -0
  13. package/dist/components/ResponsiveTable.js +34 -0
  14. package/dist/components/ResponsiveTable.js.map +1 -0
  15. package/dist/components/RowActionMenu.d.ts +40 -0
  16. package/dist/components/RowActionMenu.d.ts.map +1 -0
  17. package/dist/components/RowActionMenu.js +15 -0
  18. package/dist/components/RowActionMenu.js.map +1 -0
  19. package/dist/components/StickyFormActions.d.ts +10 -0
  20. package/dist/components/StickyFormActions.d.ts.map +1 -0
  21. package/dist/components/StickyFormActions.js +10 -0
  22. package/dist/components/StickyFormActions.js.map +1 -0
  23. package/dist/components/TouchReorderButtons.d.ts +13 -0
  24. package/dist/components/TouchReorderButtons.d.ts.map +1 -0
  25. package/dist/components/TouchReorderButtons.js +12 -0
  26. package/dist/components/TouchReorderButtons.js.map +1 -0
  27. package/dist/components/admin-user-picker/AdminUserPicker.d.ts +14 -0
  28. package/dist/components/admin-user-picker/AdminUserPicker.d.ts.map +1 -0
  29. package/dist/components/admin-user-picker/AdminUserPicker.js +68 -0
  30. package/dist/components/admin-user-picker/AdminUserPicker.js.map +1 -0
  31. package/dist/components/asset-picker/AssetFieldPicker.d.ts +32 -0
  32. package/dist/components/asset-picker/AssetFieldPicker.d.ts.map +1 -0
  33. package/dist/components/asset-picker/AssetFieldPicker.js +42 -0
  34. package/dist/components/asset-picker/AssetFieldPicker.js.map +1 -0
  35. package/dist/components/asset-picker/AssetPicker.d.ts +31 -0
  36. package/dist/components/asset-picker/AssetPicker.d.ts.map +1 -0
  37. package/dist/components/asset-picker/AssetPicker.js +68 -0
  38. package/dist/components/asset-picker/AssetPicker.js.map +1 -0
  39. package/dist/components/asset-picker/AssetUploader.d.ts +15 -0
  40. package/dist/components/asset-picker/AssetUploader.d.ts.map +1 -0
  41. package/dist/components/asset-picker/AssetUploader.js +61 -0
  42. package/dist/components/asset-picker/AssetUploader.js.map +1 -0
  43. package/dist/components/asset-picker/assets-api.d.ts +49 -0
  44. package/dist/components/asset-picker/assets-api.d.ts.map +1 -0
  45. package/dist/components/asset-picker/assets-api.js +67 -0
  46. package/dist/components/asset-picker/assets-api.js.map +1 -0
  47. package/dist/components/category-picker/CategorySelect.d.ts +14 -0
  48. package/dist/components/category-picker/CategorySelect.d.ts.map +1 -0
  49. package/dist/components/category-picker/CategorySelect.js +41 -0
  50. package/dist/components/category-picker/CategorySelect.js.map +1 -0
  51. package/dist/components/category-tree-picker/CategoryTreeNodeRow.d.ts +18 -0
  52. package/dist/components/category-tree-picker/CategoryTreeNodeRow.d.ts.map +1 -0
  53. package/dist/components/category-tree-picker/CategoryTreeNodeRow.js +19 -0
  54. package/dist/components/category-tree-picker/CategoryTreeNodeRow.js.map +1 -0
  55. package/dist/components/category-tree-picker/CategoryTreePicker.d.ts +23 -0
  56. package/dist/components/category-tree-picker/CategoryTreePicker.d.ts.map +1 -0
  57. package/dist/components/category-tree-picker/CategoryTreePicker.js +82 -0
  58. package/dist/components/category-tree-picker/CategoryTreePicker.js.map +1 -0
  59. package/dist/components/category-tree-picker/category-tree-utils.d.ts +35 -0
  60. package/dist/components/category-tree-picker/category-tree-utils.d.ts.map +1 -0
  61. package/dist/components/category-tree-picker/category-tree-utils.js +140 -0
  62. package/dist/components/category-tree-picker/category-tree-utils.js.map +1 -0
  63. package/dist/components/category-tree-picker/index.d.ts +4 -0
  64. package/dist/components/category-tree-picker/index.d.ts.map +1 -0
  65. package/dist/components/category-tree-picker/index.js +2 -0
  66. package/dist/components/category-tree-picker/index.js.map +1 -0
  67. package/dist/components/charts/echart.d.ts +17 -0
  68. package/dist/components/charts/echart.d.ts.map +1 -0
  69. package/dist/components/charts/echart.js +61 -0
  70. package/dist/components/charts/echart.js.map +1 -0
  71. package/dist/components/cms-picker/CmsBlockPicker.d.ts +14 -0
  72. package/dist/components/cms-picker/CmsBlockPicker.d.ts.map +1 -0
  73. package/dist/components/cms-picker/CmsBlockPicker.js +40 -0
  74. package/dist/components/cms-picker/CmsBlockPicker.js.map +1 -0
  75. package/dist/components/cms-picker/CmsPagePicker.d.ts +15 -0
  76. package/dist/components/cms-picker/CmsPagePicker.d.ts.map +1 -0
  77. package/dist/components/cms-picker/CmsPagePicker.js +80 -0
  78. package/dist/components/cms-picker/CmsPagePicker.js.map +1 -0
  79. package/dist/components/content-language-tabs/ContentLanguageTabs.d.ts +30 -0
  80. package/dist/components/content-language-tabs/ContentLanguageTabs.d.ts.map +1 -0
  81. package/dist/components/content-language-tabs/ContentLanguageTabs.js +14 -0
  82. package/dist/components/content-language-tabs/ContentLanguageTabs.js.map +1 -0
  83. package/dist/components/country-select/CountrySelect.d.ts +29 -0
  84. package/dist/components/country-select/CountrySelect.d.ts.map +1 -0
  85. package/dist/components/country-select/CountrySelect.js +40 -0
  86. package/dist/components/country-select/CountrySelect.js.map +1 -0
  87. package/dist/components/country-select/index.d.ts +3 -0
  88. package/dist/components/country-select/index.d.ts.map +1 -0
  89. package/dist/components/country-select/index.js +3 -0
  90. package/dist/components/country-select/index.js.map +1 -0
  91. package/dist/components/country-select/useCountriesQuery.d.ts +12 -0
  92. package/dist/components/country-select/useCountriesQuery.d.ts.map +1 -0
  93. package/dist/components/country-select/useCountriesQuery.js +69 -0
  94. package/dist/components/country-select/useCountriesQuery.js.map +1 -0
  95. package/dist/components/custom-field-values/CustomFieldValuesPanel.d.ts +48 -0
  96. package/dist/components/custom-field-values/CustomFieldValuesPanel.d.ts.map +1 -0
  97. package/dist/components/custom-field-values/CustomFieldValuesPanel.js +122 -0
  98. package/dist/components/custom-field-values/CustomFieldValuesPanel.js.map +1 -0
  99. package/dist/components/customer-group-picker/CustomerGroupPicker.d.ts +14 -0
  100. package/dist/components/customer-group-picker/CustomerGroupPicker.d.ts.map +1 -0
  101. package/dist/components/customer-group-picker/CustomerGroupPicker.js +36 -0
  102. package/dist/components/customer-group-picker/CustomerGroupPicker.js.map +1 -0
  103. package/dist/components/customer-picker/CustomerPicker.d.ts +18 -0
  104. package/dist/components/customer-picker/CustomerPicker.d.ts.map +1 -0
  105. package/dist/components/customer-picker/CustomerPicker.js +85 -0
  106. package/dist/components/customer-picker/CustomerPicker.js.map +1 -0
  107. package/dist/components/dictionary-picker/CountryPicker.d.ts +26 -0
  108. package/dist/components/dictionary-picker/CountryPicker.d.ts.map +1 -0
  109. package/dist/components/dictionary-picker/CountryPicker.js +29 -0
  110. package/dist/components/dictionary-picker/CountryPicker.js.map +1 -0
  111. package/dist/components/dictionary-picker/CurrencyPicker.d.ts +17 -0
  112. package/dist/components/dictionary-picker/CurrencyPicker.d.ts.map +1 -0
  113. package/dist/components/dictionary-picker/CurrencyPicker.js +29 -0
  114. package/dist/components/dictionary-picker/CurrencyPicker.js.map +1 -0
  115. package/dist/components/dictionary-picker/dictionary-api.d.ts +21 -0
  116. package/dist/components/dictionary-picker/dictionary-api.d.ts.map +1 -0
  117. package/dist/components/dictionary-picker/dictionary-api.js +26 -0
  118. package/dist/components/dictionary-picker/dictionary-api.js.map +1 -0
  119. package/dist/components/dictionary-picker/index.d.ts +4 -0
  120. package/dist/components/dictionary-picker/index.d.ts.map +1 -0
  121. package/dist/components/dictionary-picker/index.js +4 -0
  122. package/dist/components/dictionary-picker/index.js.map +1 -0
  123. package/dist/components/fulfilment-strategy-picker/FulfilmentStrategyPicker.d.ts +49 -0
  124. package/dist/components/fulfilment-strategy-picker/FulfilmentStrategyPicker.d.ts.map +1 -0
  125. package/dist/components/fulfilment-strategy-picker/FulfilmentStrategyPicker.js +43 -0
  126. package/dist/components/fulfilment-strategy-picker/FulfilmentStrategyPicker.js.map +1 -0
  127. package/dist/components/hooks/useFocusTrap.d.ts +6 -0
  128. package/dist/components/hooks/useFocusTrap.d.ts.map +1 -0
  129. package/dist/components/hooks/useFocusTrap.js +41 -0
  130. package/dist/components/hooks/useFocusTrap.js.map +1 -0
  131. package/dist/components/hooks/useViewportTier.d.ts +7 -0
  132. package/dist/components/hooks/useViewportTier.d.ts.map +1 -0
  133. package/dist/components/hooks/useViewportTier.js +23 -0
  134. package/dist/components/hooks/useViewportTier.js.map +1 -0
  135. package/dist/components/index.d.ts +101 -0
  136. package/dist/components/index.d.ts.map +1 -0
  137. package/dist/components/index.js +63 -0
  138. package/dist/components/index.js.map +1 -0
  139. package/dist/components/organization-picker/OrganizationPicker.d.ts +28 -0
  140. package/dist/components/organization-picker/OrganizationPicker.d.ts.map +1 -0
  141. package/dist/components/organization-picker/OrganizationPicker.js +35 -0
  142. package/dist/components/organization-picker/OrganizationPicker.js.map +1 -0
  143. package/dist/components/organization-picker/OrganizationPickerMulti.d.ts +32 -0
  144. package/dist/components/organization-picker/OrganizationPickerMulti.d.ts.map +1 -0
  145. package/dist/components/organization-picker/OrganizationPickerMulti.js +55 -0
  146. package/dist/components/organization-picker/OrganizationPickerMulti.js.map +1 -0
  147. package/dist/components/organization-picker/OrganizationStatusBadge.d.ts +7 -0
  148. package/dist/components/organization-picker/OrganizationStatusBadge.d.ts.map +1 -0
  149. package/dist/components/organization-picker/OrganizationStatusBadge.js +33 -0
  150. package/dist/components/organization-picker/OrganizationStatusBadge.js.map +1 -0
  151. package/dist/components/organization-picker/useOrganizationsQuery.d.ts +33 -0
  152. package/dist/components/organization-picker/useOrganizationsQuery.d.ts.map +1 -0
  153. package/dist/components/organization-picker/useOrganizationsQuery.js +92 -0
  154. package/dist/components/organization-picker/useOrganizationsQuery.js.map +1 -0
  155. package/dist/components/payment-method-availability/MethodAvailabilityCell.d.ts +38 -0
  156. package/dist/components/payment-method-availability/MethodAvailabilityCell.d.ts.map +1 -0
  157. package/dist/components/payment-method-availability/MethodAvailabilityCell.js +50 -0
  158. package/dist/components/payment-method-availability/MethodAvailabilityCell.js.map +1 -0
  159. package/dist/components/product-picker/ProductPicker.d.ts +22 -0
  160. package/dist/components/product-picker/ProductPicker.d.ts.map +1 -0
  161. package/dist/components/product-picker/ProductPicker.js +143 -0
  162. package/dist/components/product-picker/ProductPicker.js.map +1 -0
  163. package/dist/components/reorder/ReorderAnnouncer.d.ts +29 -0
  164. package/dist/components/reorder/ReorderAnnouncer.d.ts.map +1 -0
  165. package/dist/components/reorder/ReorderAnnouncer.js +6 -0
  166. package/dist/components/reorder/ReorderAnnouncer.js.map +1 -0
  167. package/dist/components/reorder/useReorderList.d.ts +121 -0
  168. package/dist/components/reorder/useReorderList.d.ts.map +1 -0
  169. package/dist/components/reorder/useReorderList.js +241 -0
  170. package/dist/components/reorder/useReorderList.js.map +1 -0
  171. package/dist/components/rule-builder/RuleBuilder.d.ts +105 -0
  172. package/dist/components/rule-builder/RuleBuilder.d.ts.map +1 -0
  173. package/dist/components/rule-builder/RuleBuilder.js +138 -0
  174. package/dist/components/rule-builder/RuleBuilder.js.map +1 -0
  175. package/dist/components/sales-channel-picker/SalesChannelPicker.d.ts +15 -0
  176. package/dist/components/sales-channel-picker/SalesChannelPicker.d.ts.map +1 -0
  177. package/dist/components/sales-channel-picker/SalesChannelPicker.js +79 -0
  178. package/dist/components/sales-channel-picker/SalesChannelPicker.js.map +1 -0
  179. package/dist/components/scope-notice/ScopeNotice.d.ts +33 -0
  180. package/dist/components/scope-notice/ScopeNotice.d.ts.map +1 -0
  181. package/dist/components/scope-notice/ScopeNotice.js +11 -0
  182. package/dist/components/scope-notice/ScopeNotice.js.map +1 -0
  183. package/dist/components/scope-picker/ScopePicker.d.ts +28 -0
  184. package/dist/components/scope-picker/ScopePicker.d.ts.map +1 -0
  185. package/dist/components/scope-picker/ScopePicker.js +114 -0
  186. package/dist/components/scope-picker/ScopePicker.js.map +1 -0
  187. package/dist/components/scope-picker/sales-channels-api.d.ts +19 -0
  188. package/dist/components/scope-picker/sales-channels-api.d.ts.map +1 -0
  189. package/dist/components/scope-picker/sales-channels-api.js +30 -0
  190. package/dist/components/scope-picker/sales-channels-api.js.map +1 -0
  191. package/dist/components/status-transition-graph/StatusTransitionGraph.d.ts +26 -0
  192. package/dist/components/status-transition-graph/StatusTransitionGraph.d.ts.map +1 -0
  193. package/dist/components/status-transition-graph/StatusTransitionGraph.js +241 -0
  194. package/dist/components/status-transition-graph/StatusTransitionGraph.js.map +1 -0
  195. package/dist/components/status-transition-graph/index.d.ts +3 -0
  196. package/dist/components/status-transition-graph/index.d.ts.map +1 -0
  197. package/dist/components/status-transition-graph/index.js +2 -0
  198. package/dist/components/status-transition-graph/index.js.map +1 -0
  199. package/dist/contributions/index.d.ts +44 -0
  200. package/dist/contributions/index.d.ts.map +1 -0
  201. package/dist/contributions/index.js +42 -0
  202. package/dist/contributions/index.js.map +1 -0
  203. package/dist/contributions/zone-component.d.ts +70 -0
  204. package/dist/contributions/zone-component.d.ts.map +1 -0
  205. package/dist/contributions/zone-component.js +26 -0
  206. package/dist/contributions/zone-component.js.map +1 -0
  207. package/dist/field-protection/FieldProtectionPricePanel.d.ts +26 -0
  208. package/dist/field-protection/FieldProtectionPricePanel.d.ts.map +1 -0
  209. package/dist/field-protection/FieldProtectionPricePanel.js +14 -0
  210. package/dist/field-protection/FieldProtectionPricePanel.js.map +1 -0
  211. package/dist/field-protection/FieldProtectionSummary.d.ts +18 -0
  212. package/dist/field-protection/FieldProtectionSummary.d.ts.map +1 -0
  213. package/dist/field-protection/FieldProtectionSummary.js +18 -0
  214. package/dist/field-protection/FieldProtectionSummary.js.map +1 -0
  215. package/dist/field-protection/FieldProtectionToggle.d.ts +36 -0
  216. package/dist/field-protection/FieldProtectionToggle.d.ts.map +1 -0
  217. package/dist/field-protection/FieldProtectionToggle.js +30 -0
  218. package/dist/field-protection/FieldProtectionToggle.js.map +1 -0
  219. package/dist/field-protection/describe-path.d.ts +27 -0
  220. package/dist/field-protection/describe-path.d.ts.map +1 -0
  221. package/dist/field-protection/describe-path.js +28 -0
  222. package/dist/field-protection/describe-path.js.map +1 -0
  223. package/dist/field-protection/index.d.ts +46 -0
  224. package/dist/field-protection/index.d.ts.map +1 -0
  225. package/dist/field-protection/index.js +41 -0
  226. package/dist/field-protection/index.js.map +1 -0
  227. package/dist/field-protection/types.d.ts +93 -0
  228. package/dist/field-protection/types.d.ts.map +1 -0
  229. package/dist/field-protection/types.js +2 -0
  230. package/dist/field-protection/types.js.map +1 -0
  231. package/dist/field-protection/use-field-protection.d.ts +27 -0
  232. package/dist/field-protection/use-field-protection.d.ts.map +1 -0
  233. package/dist/field-protection/use-field-protection.js +149 -0
  234. package/dist/field-protection/use-field-protection.js.map +1 -0
  235. package/dist/i18n/TranslationProvider.d.ts +27 -0
  236. package/dist/i18n/TranslationProvider.d.ts.map +1 -0
  237. package/dist/i18n/TranslationProvider.js +130 -0
  238. package/dist/i18n/TranslationProvider.js.map +1 -0
  239. package/dist/i18n/app-language-context.d.ts +8 -0
  240. package/dist/i18n/app-language-context.d.ts.map +1 -0
  241. package/dist/i18n/app-language-context.js +13 -0
  242. package/dist/i18n/app-language-context.js.map +1 -0
  243. package/dist/i18n/index.d.ts +29 -0
  244. package/dist/i18n/index.d.ts.map +1 -0
  245. package/dist/i18n/index.js +25 -0
  246. package/dist/i18n/index.js.map +1 -0
  247. package/dist/i18n/interpolate.d.ts +2 -0
  248. package/dist/i18n/interpolate.d.ts.map +1 -0
  249. package/dist/i18n/interpolate.js +10 -0
  250. package/dist/i18n/interpolate.js.map +1 -0
  251. package/dist/i18n/language-storage.d.ts +16 -0
  252. package/dist/i18n/language-storage.d.ts.map +1 -0
  253. package/dist/i18n/language-storage.js +26 -0
  254. package/dist/i18n/language-storage.js.map +1 -0
  255. package/dist/i18n/resolver.d.ts +19 -0
  256. package/dist/i18n/resolver.d.ts.map +1 -0
  257. package/dist/i18n/resolver.js +23 -0
  258. package/dist/i18n/resolver.js.map +1 -0
  259. package/dist/i18n/types.d.ts +12 -0
  260. package/dist/i18n/types.d.ts.map +1 -0
  261. package/dist/i18n/types.js +7 -0
  262. package/dist/i18n/types.js.map +1 -0
  263. package/dist/i18n/useTranslation.d.ts +2 -0
  264. package/dist/i18n/useTranslation.d.ts.map +1 -0
  265. package/dist/i18n/useTranslation.js +16 -0
  266. package/dist/i18n/useTranslation.js.map +1 -0
  267. package/dist/lib/admin-actions/icon-map.d.ts +3 -0
  268. package/dist/lib/admin-actions/icon-map.d.ts.map +1 -0
  269. package/dist/lib/admin-actions/icon-map.js +115 -0
  270. package/dist/lib/admin-actions/icon-map.js.map +1 -0
  271. package/dist/lib/api-client.d.ts +55 -0
  272. package/dist/lib/api-client.d.ts.map +1 -0
  273. package/dist/lib/api-client.js +89 -0
  274. package/dist/lib/api-client.js.map +1 -0
  275. package/dist/lib/asset-url.d.ts +32 -0
  276. package/dist/lib/asset-url.d.ts.map +1 -0
  277. package/dist/lib/asset-url.js +42 -0
  278. package/dist/lib/asset-url.js.map +1 -0
  279. package/dist/lib/auth.d.ts +92 -0
  280. package/dist/lib/auth.d.ts.map +1 -0
  281. package/dist/lib/auth.js +133 -0
  282. package/dist/lib/auth.js.map +1 -0
  283. package/dist/lib/format.d.ts +2 -0
  284. package/dist/lib/format.d.ts.map +1 -0
  285. package/dist/lib/format.js +9 -0
  286. package/dist/lib/format.js.map +1 -0
  287. package/dist/lib/index.d.ts +46 -0
  288. package/dist/lib/index.d.ts.map +1 -0
  289. package/dist/lib/index.js +41 -0
  290. package/dist/lib/index.js.map +1 -0
  291. package/dist/lib/invoice-email-outcome.d.ts +53 -0
  292. package/dist/lib/invoice-email-outcome.d.ts.map +1 -0
  293. package/dist/lib/invoice-email-outcome.js +43 -0
  294. package/dist/lib/invoice-email-outcome.js.map +1 -0
  295. package/dist/lib/module-presence/ModulePresenceProvider.d.ts +49 -0
  296. package/dist/lib/module-presence/ModulePresenceProvider.d.ts.map +1 -0
  297. package/dist/lib/module-presence/ModulePresenceProvider.js +73 -0
  298. package/dist/lib/module-presence/ModulePresenceProvider.js.map +1 -0
  299. package/dist/lib/module-presence/api.d.ts +15 -0
  300. package/dist/lib/module-presence/api.d.ts.map +1 -0
  301. package/dist/lib/module-presence/api.js +25 -0
  302. package/dist/lib/module-presence/api.js.map +1 -0
  303. package/dist/lib/module-presence/index.d.ts +3 -0
  304. package/dist/lib/module-presence/index.d.ts.map +1 -0
  305. package/dist/lib/module-presence/index.js +3 -0
  306. package/dist/lib/module-presence/index.js.map +1 -0
  307. package/dist/lib/money.d.ts +22 -0
  308. package/dist/lib/money.d.ts.map +1 -0
  309. package/dist/lib/money.js +51 -0
  310. package/dist/lib/money.js.map +1 -0
  311. package/dist/lib/page-size-options.d.ts +15 -0
  312. package/dist/lib/page-size-options.d.ts.map +1 -0
  313. package/dist/lib/page-size-options.js +14 -0
  314. package/dist/lib/page-size-options.js.map +1 -0
  315. package/dist/lib/status-color.d.ts +32 -0
  316. package/dist/lib/status-color.d.ts.map +1 -0
  317. package/dist/lib/status-color.js +24 -0
  318. package/dist/lib/status-color.js.map +1 -0
  319. package/dist/lib/surface-visibility.d.ts +70 -0
  320. package/dist/lib/surface-visibility.d.ts.map +1 -0
  321. package/dist/lib/surface-visibility.js +37 -0
  322. package/dist/lib/surface-visibility.js.map +1 -0
  323. package/dist/lib/text-normalization.d.ts +56 -0
  324. package/dist/lib/text-normalization.d.ts.map +1 -0
  325. package/dist/lib/text-normalization.js +59 -0
  326. package/dist/lib/text-normalization.js.map +1 -0
  327. package/dist/lib/use-page-size-preference.d.ts +29 -0
  328. package/dist/lib/use-page-size-preference.d.ts.map +1 -0
  329. package/dist/lib/use-page-size-preference.js +61 -0
  330. package/dist/lib/use-page-size-preference.js.map +1 -0
  331. package/dist/lib/use-unsaved-changes-prompt.d.ts +23 -0
  332. package/dist/lib/use-unsaved-changes-prompt.d.ts.map +1 -0
  333. package/dist/lib/use-unsaved-changes-prompt.js +75 -0
  334. package/dist/lib/use-unsaved-changes-prompt.js.map +1 -0
  335. package/dist/lib/utils.d.ts +9 -0
  336. package/dist/lib/utils.d.ts.map +1 -0
  337. package/dist/lib/utils.js +12 -0
  338. package/dist/lib/utils.js.map +1 -0
  339. package/dist/lib/uuid.d.ts +8 -0
  340. package/dist/lib/uuid.d.ts.map +1 -0
  341. package/dist/lib/uuid.js +18 -0
  342. package/dist/lib/uuid.js.map +1 -0
  343. package/dist/ui/alert.d.ts +12 -0
  344. package/dist/ui/alert.d.ts.map +1 -0
  345. package/dist/ui/alert.js +22 -0
  346. package/dist/ui/alert.js.map +1 -0
  347. package/dist/ui/badge.d.ts +10 -0
  348. package/dist/ui/badge.d.ts.map +1 -0
  349. package/dist/ui/badge.js +21 -0
  350. package/dist/ui/badge.js.map +1 -0
  351. package/dist/ui/button.d.ts +12 -0
  352. package/dist/ui/button.d.ts.map +1 -0
  353. package/dist/ui/button.js +31 -0
  354. package/dist/ui/button.js.map +1 -0
  355. package/dist/ui/card.d.ts +8 -0
  356. package/dist/ui/card.d.ts.map +1 -0
  357. package/dist/ui/card.js +16 -0
  358. package/dist/ui/card.js.map +1 -0
  359. package/dist/ui/checkbox.d.ts +8 -0
  360. package/dist/ui/checkbox.d.ts.map +1 -0
  361. package/dist/ui/checkbox.js +11 -0
  362. package/dist/ui/checkbox.js.map +1 -0
  363. package/dist/ui/color-picker.d.ts +23 -0
  364. package/dist/ui/color-picker.d.ts.map +1 -0
  365. package/dist/ui/color-picker.js +76 -0
  366. package/dist/ui/color-picker.js.map +1 -0
  367. package/dist/ui/combobox.d.ts +68 -0
  368. package/dist/ui/combobox.d.ts.map +1 -0
  369. package/dist/ui/combobox.js +182 -0
  370. package/dist/ui/combobox.js.map +1 -0
  371. package/dist/ui/dropdown-menu.d.ts +26 -0
  372. package/dist/ui/dropdown-menu.d.ts.map +1 -0
  373. package/dist/ui/dropdown-menu.js +38 -0
  374. package/dist/ui/dropdown-menu.js.map +1 -0
  375. package/dist/ui/index.d.ts +47 -0
  376. package/dist/ui/index.d.ts.map +1 -0
  377. package/dist/ui/index.js +38 -0
  378. package/dist/ui/index.js.map +1 -0
  379. package/dist/ui/input.d.ts +3 -0
  380. package/dist/ui/input.d.ts.map +1 -0
  381. package/dist/ui/input.js +8 -0
  382. package/dist/ui/input.js.map +1 -0
  383. package/dist/ui/label.d.ts +4 -0
  384. package/dist/ui/label.d.ts.map +1 -0
  385. package/dist/ui/label.js +9 -0
  386. package/dist/ui/label.js.map +1 -0
  387. package/dist/ui/multi-select.d.ts +32 -0
  388. package/dist/ui/multi-select.d.ts.map +1 -0
  389. package/dist/ui/multi-select.js +63 -0
  390. package/dist/ui/multi-select.js.map +1 -0
  391. package/dist/ui/page-header.d.ts +21 -0
  392. package/dist/ui/page-header.d.ts.map +1 -0
  393. package/dist/ui/page-header.js +9 -0
  394. package/dist/ui/page-header.js.map +1 -0
  395. package/dist/ui/route-tabs.d.ts +58 -0
  396. package/dist/ui/route-tabs.d.ts.map +1 -0
  397. package/dist/ui/route-tabs.js +34 -0
  398. package/dist/ui/route-tabs.js.map +1 -0
  399. package/dist/ui/save-button-group.d.ts +27 -0
  400. package/dist/ui/save-button-group.d.ts.map +1 -0
  401. package/dist/ui/save-button-group.js +44 -0
  402. package/dist/ui/save-button-group.js.map +1 -0
  403. package/dist/ui/section.d.ts +20 -0
  404. package/dist/ui/section.d.ts.map +1 -0
  405. package/dist/ui/section.js +7 -0
  406. package/dist/ui/section.js.map +1 -0
  407. package/dist/ui/select.d.ts +10 -0
  408. package/dist/ui/select.d.ts.map +1 -0
  409. package/dist/ui/select.js +15 -0
  410. package/dist/ui/select.js.map +1 -0
  411. package/dist/ui/separator.d.ts +3 -0
  412. package/dist/ui/separator.d.ts.map +1 -0
  413. package/dist/ui/separator.js +7 -0
  414. package/dist/ui/separator.js.map +1 -0
  415. package/dist/ui/table.d.ts +10 -0
  416. package/dist/ui/table.d.ts.map +1 -0
  417. package/dist/ui/table.js +20 -0
  418. package/dist/ui/table.js.map +1 -0
  419. package/dist/ui/textarea.d.ts +3 -0
  420. package/dist/ui/textarea.d.ts.map +1 -0
  421. package/dist/ui/textarea.js +8 -0
  422. package/dist/ui/textarea.js.map +1 -0
  423. package/dist/zones/AdminContributionsProvider.d.ts +72 -0
  424. package/dist/zones/AdminContributionsProvider.d.ts.map +1 -0
  425. package/dist/zones/AdminContributionsProvider.js +63 -0
  426. package/dist/zones/AdminContributionsProvider.js.map +1 -0
  427. package/dist/zones/AdminZone.d.ts +30 -0
  428. package/dist/zones/AdminZone.d.ts.map +1 -0
  429. package/dist/zones/AdminZone.js +59 -0
  430. package/dist/zones/AdminZone.js.map +1 -0
  431. package/dist/zones/RouteTabsZone.d.ts +62 -0
  432. package/dist/zones/RouteTabsZone.d.ts.map +1 -0
  433. package/dist/zones/RouteTabsZone.js +25 -0
  434. package/dist/zones/RouteTabsZone.js.map +1 -0
  435. package/dist/zones/ZoneErrorBoundary.d.ts +36 -0
  436. package/dist/zones/ZoneErrorBoundary.d.ts.map +1 -0
  437. package/dist/zones/ZoneErrorBoundary.js +44 -0
  438. package/dist/zones/ZoneErrorBoundary.js.map +1 -0
  439. package/dist/zones/index.d.ts +31 -0
  440. package/dist/zones/index.d.ts.map +1 -0
  441. package/dist/zones/index.js +27 -0
  442. package/dist/zones/index.js.map +1 -0
  443. package/dist/zones/use-admin-zone.d.ts +32 -0
  444. package/dist/zones/use-admin-zone.d.ts.map +1 -0
  445. package/dist/zones/use-admin-zone.js +96 -0
  446. package/dist/zones/use-admin-zone.js.map +1 -0
  447. package/package.json +94 -3
  448. package/tailwind.css +14 -0
  449. package/theme.css +2056 -0
@@ -0,0 +1,63 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ /**
3
+ * The seam that carries the admin's module registry into the kit (feature 091,
4
+ * P4a; Z6).
5
+ *
6
+ * The renderer is the kit's and not the admin application's, because a **host**
7
+ * screen becomes a package: `catalog` hosts three zones and moves into
8
+ * `packages/modules/catalog`, at which point `admin/src/lib/module-registry` is
9
+ * unreachable to it. Routes and nav have no such problem — their one consumer
10
+ * each is the application itself, for ever — which is why `registryRoutes()`
11
+ * and `registryNavFor()` stay where they are and there is no
12
+ * `registryZonesFor()` beside them.
13
+ *
14
+ * The registry itself stays the application's: it *is* module knowledge, and
15
+ * `admin-kit-surface.md` R6 refuses module knowledge in the kit. So the kit
16
+ * publishes a provider and holds no list — the entries arrive as a prop, from
17
+ * the one place that has them.
18
+ *
19
+ * **Nothing here filters.** An operator's activation flip must take effect
20
+ * without a rebuild (Principle XVII item 5, D-67/D-68 pointed at the frontend),
21
+ * so presence is decided at enumeration in {@link useAdminZone} and never in
22
+ * the registry or in this provider. The provider answers *"what could be
23
+ * here"*.
24
+ */
25
+ import { createContext, useContext, useMemo } from 'react';
26
+ /**
27
+ * Flattened contributions, in declaration order.
28
+ *
29
+ * `null` is the "no provider mounted" state and is distinct from "the provider
30
+ * is mounted and every module contributes nothing": {@link useAdminZone} refuses
31
+ * the first and returns an empty list for the second, because a host screen
32
+ * rendering a zone outside the provider is a wiring defect and reporting it as
33
+ * *"nobody contributed"* is the silent answer this estate refuses everywhere
34
+ * else.
35
+ */
36
+ const AdminContributionsContext = createContext(null);
37
+ /** Raised when a zone is rendered outside {@link AdminContributionsProvider}. */
38
+ export class AdminContributionsUnavailableError extends Error {
39
+ name = 'AdminContributionsUnavailableError';
40
+ }
41
+ /** Mounted once by the admin application, with its generated registry. */
42
+ export function AdminContributionsProvider({ entries, children, }) {
43
+ const flattened = useMemo(() => entries.flatMap((entry) => (entry.contributions.zones ?? []).map((zone) => ({ ...zone, module: entry.moduleId }))), [entries]);
44
+ return (_jsx(AdminContributionsContext.Provider, { value: flattened, children: children }));
45
+ }
46
+ /**
47
+ * Every contribution the provider carries, unfiltered and unordered.
48
+ *
49
+ * Internal to the `./zones` subpath: the filtering and the ordering are
50
+ * {@link useAdminZone}'s, and a second consumer of the raw list is a second
51
+ * place the presence rule could be forgotten.
52
+ */
53
+ export function useAdminContributions() {
54
+ const value = useContext(AdminContributionsContext);
55
+ if (value === null) {
56
+ throw new AdminContributionsUnavailableError('A zone was rendered outside <AdminContributionsProvider>. The admin application ' +
57
+ 'mounts it once, with MODULE_ADMIN_CONTRIBUTIONS; a test rendering a host screen ' +
58
+ 'mounts it with the contributions under assertion. Reporting "nobody contributed" ' +
59
+ 'here would make a wiring defect indistinguishable from an empty registry.');
60
+ }
61
+ return value;
62
+ }
63
+ //# sourceMappingURL=AdminContributionsProvider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AdminContributionsProvider.js","sourceRoot":"","sources":["../../src/zones/AdminContributionsProvider.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,OAAO,EAAkB,MAAM,OAAO,CAAC;AAqB3E;;;;;;;;;GASG;AACH,MAAM,yBAAyB,GAAG,aAAa,CAA0C,IAAI,CAAC,CAAC;AAE/F,iFAAiF;AACjF,MAAM,OAAO,kCAAmC,SAAQ,KAAK;IACzC,IAAI,GAAG,oCAAoC,CAAC;CAC/D;AAiBD,0EAA0E;AAC1E,MAAM,UAAU,0BAA0B,CAAC,EACzC,OAAO,EACP,QAAQ,GACwB;IAChC,MAAM,SAAS,GAAG,OAAO,CACvB,GAAqC,EAAE,CACrC,OAAO,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE,CACxB,CAAC,KAAK,CAAC,aAAa,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,GAAG,CACnC,CAAC,IAAI,EAAyB,EAAE,CAAC,CAAC,EAAE,GAAG,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,QAAQ,EAAE,CAAC,CACvE,CACF,EACH,CAAC,OAAO,CAAC,CACV,CAAC;IACF,OAAO,CACL,KAAC,yBAAyB,CAAC,QAAQ,IAAC,KAAK,EAAE,SAAS,YACjD,QAAQ,GAC0B,CACtC,CAAC;AACJ,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,qBAAqB;IACnC,MAAM,KAAK,GAAG,UAAU,CAAC,yBAAyB,CAAC,CAAC;IACpD,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;QACnB,MAAM,IAAI,kCAAkC,CAC1C,kFAAkF;YAChF,kFAAkF;YAClF,mFAAmF;YACnF,2EAA2E,CAC9E,CAAC;IACJ,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
@@ -0,0 +1,30 @@
1
+ /**
2
+ * The common case: render every contribution to this mount, in order (feature
3
+ * 091, P4a; Z6/Z8).
4
+ *
5
+ * `useAdminZone` is the primitive and stays exported, because a host whose zone
6
+ * is not a stack of components needs the list rather than the rendering — a tab
7
+ * strip counts its contributions, and `<RouteTabsZone>` is built on the hook,
8
+ * not on this.
9
+ *
10
+ * Generic on the literal zone name, so `props` is checked against
11
+ * `AdminZonePropsMap` at the host's end (Z3). That is one of the two ends the
12
+ * map holds; the contributor's is `zoneComponent()` on `./contributions`.
13
+ */
14
+ import { type ReactNode } from 'react';
15
+ import type { AdminZoneName, AdminZoneProps } from '@endora-commerce/contracts';
16
+ export interface AdminZoneRenderProps<Z extends AdminZoneName> {
17
+ readonly name: Z;
18
+ readonly props: AdminZoneProps<Z>;
19
+ }
20
+ /**
21
+ * Render the zone `name` at this mount.
22
+ *
23
+ * ```tsx
24
+ * <AdminZone name="product.editor.field.after" props={{ productId, fieldPath: 'name', languageCodes: LOCALES }} />
25
+ * ```
26
+ *
27
+ * The name is a **string literal**, always (Z7).
28
+ */
29
+ export declare function AdminZone<Z extends AdminZoneName>({ name, props, }: AdminZoneRenderProps<Z>): ReactNode;
30
+ //# sourceMappingURL=AdminZone.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AdminZone.d.ts","sourceRoot":"","sources":["../../src/zones/AdminZone.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAA+C,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACpF,OAAO,KAAK,EAEV,aAAa,EACb,cAAc,EACf,MAAM,4BAA4B,CAAC;AAmCpC,MAAM,WAAW,oBAAoB,CAAC,CAAC,SAAS,aAAa;IAC3D,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC;IACjB,QAAQ,CAAC,KAAK,EAAE,cAAc,CAAC,CAAC,CAAC,CAAC;CACnC;AAED;;;;;;;;GAQG;AACH,wBAAgB,SAAS,CAAC,CAAC,SAAS,aAAa,EAAE,EACjD,IAAI,EACJ,KAAK,GACN,EAAE,oBAAoB,CAAC,CAAC,CAAC,GAAG,SAAS,CA+BrC"}
@@ -0,0 +1,59 @@
1
+ import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
2
+ /**
3
+ * The common case: render every contribution to this mount, in order (feature
4
+ * 091, P4a; Z6/Z8).
5
+ *
6
+ * `useAdminZone` is the primitive and stays exported, because a host whose zone
7
+ * is not a stack of components needs the list rather than the rendering — a tab
8
+ * strip counts its contributions, and `<RouteTabsZone>` is built on the hook,
9
+ * not on this.
10
+ *
11
+ * Generic on the literal zone name, so `props` is checked against
12
+ * `AdminZonePropsMap` at the host's end (Z3). That is one of the two ends the
13
+ * map holds; the contributor's is `zoneComponent()` on `./contributions`.
14
+ */
15
+ import { Suspense, lazy, useMemo } from 'react';
16
+ import { useAdminZone } from './use-admin-zone.js';
17
+ import { ZoneErrorBoundary } from './ZoneErrorBoundary.js';
18
+ const lazyByFactory = new WeakMap();
19
+ function lazyComponentFor(load) {
20
+ const known = lazyByFactory.get(load);
21
+ if (known !== undefined)
22
+ return known;
23
+ // The registry's factory is `{ default: unknown }` by construction — see the
24
+ // note on `AdminComponentFactory` — and the assertion here is the courier's
25
+ // end of the map, not a hole: `zoneComponent()` constrained the contributor's
26
+ // export and this component's generic constrains the host's props against the
27
+ // same `AdminZonePropsMap`.
28
+ const built = lazy(async () => ({
29
+ default: (await load()).default,
30
+ }));
31
+ lazyByFactory.set(load, built);
32
+ return built;
33
+ }
34
+ /**
35
+ * Render the zone `name` at this mount.
36
+ *
37
+ * ```tsx
38
+ * <AdminZone name="product.editor.field.after" props={{ productId, fieldPath: 'name', languageCodes: LOCALES }} />
39
+ * ```
40
+ *
41
+ * The name is a **string literal**, always (Z7).
42
+ */
43
+ export function AdminZone({ name, props, }) {
44
+ const contributions = useAdminZone(name, props);
45
+ // One entry per contribution, so a contributor added or removed by a presence
46
+ // flip does not rebuild the others' component types.
47
+ const rendered = useMemo(() => contributions.map((contribution, index) => ({
48
+ // A module may declare two contributions to one zone, so the key is
49
+ // the module **and** its position in the ordered list, never the module
50
+ // alone: two children under one key is a silent remount in React.
51
+ key: `${contribution.module}:${index}`,
52
+ module: contribution.module,
53
+ Component: lazyComponentFor(contribution.component),
54
+ })), [contributions]);
55
+ if (rendered.length === 0)
56
+ return null;
57
+ return (_jsx(_Fragment, { children: rendered.map((entry) => (_jsx(ZoneErrorBoundary, { module: entry.module, zone: name, children: _jsx(Suspense, { fallback: null, children: _jsx(entry.Component, { ...props }) }) }, entry.key))) }));
58
+ }
59
+ //# sourceMappingURL=AdminZone.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AdminZone.js","sourceRoot":"","sources":["../../src/zones/AdminZone.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAsC,MAAM,OAAO,CAAC;AAOpF,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAe3D,MAAM,aAAa,GAAG,IAAI,OAAO,EAA4C,CAAC;AAE9E,SAAS,gBAAgB,CAAC,IAA2B;IACnD,MAAM,KAAK,GAAG,aAAa,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACtC,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,KAAK,CAAC;IACtC,6EAA6E;IAC7E,4EAA4E;IAC5E,8EAA8E;IAC9E,8EAA8E;IAC9E,4BAA4B;IAC5B,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC;QAC9B,OAAO,EAAE,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC,OAA4B;KACrD,CAAC,CAAC,CAAC;IACJ,aAAa,CAAC,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAC/B,OAAO,KAAK,CAAC;AACf,CAAC;AAOD;;;;;;;;GAQG;AACH,MAAM,UAAU,SAAS,CAA0B,EACjD,IAAI,EACJ,KAAK,GACmB;IACxB,MAAM,aAAa,GAAG,YAAY,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAChD,8EAA8E;IAC9E,qDAAqD;IACrD,MAAM,QAAQ,GAAG,OAAO,CACtB,GAAG,EAAE,CACH,aAAa,CAAC,GAAG,CAAC,CAAC,YAAY,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC;QAC1C,oEAAoE;QACpE,wEAAwE;QACxE,kEAAkE;QAClE,GAAG,EAAE,GAAG,YAAY,CAAC,MAAM,IAAI,KAAK,EAAE;QACtC,MAAM,EAAE,YAAY,CAAC,MAAM;QAC3B,SAAS,EAAE,gBAAgB,CAAC,YAAY,CAAC,SAAS,CAAC;KACpD,CAAC,CAAC,EACL,CAAC,aAAa,CAAC,CAChB,CAAC;IACF,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IACvC,OAAO,CACL,4BACG,QAAQ,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CACvB,KAAC,iBAAiB,IAAiB,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,YAIjE,KAAC,QAAQ,IAAC,QAAQ,EAAE,IAAI,YACtB,KAAC,KAAK,CAAC,SAAS,OAAM,KAA4C,GAAI,GAC7D,IANW,KAAK,CAAC,GAAG,CAOb,CACrB,CAAC,GACD,CACJ,CAAC;AACJ,CAAC"}
@@ -0,0 +1,62 @@
1
+ /**
2
+ * A zone rendered as a **tab strip** (feature 091, P4d; Z15's mechanism half).
3
+ *
4
+ * `<AdminZone>` renders a zone's contributions as a stack, which is the common
5
+ * case and covers every member but this one. A strip is different in exactly
6
+ * one way, and it is the way that made `OrderEntryTabs` a host component nobody
7
+ * could publish: **the strip decides whether it exists from how many
8
+ * contributions there are.** One tab is not a choice, so a strip with one tab
9
+ * is worse than no strip — it tells the operator there is somewhere else to go
10
+ * and then does not offer it.
11
+ *
12
+ * `useAdminZone` has already applied both presence axes and each contributor's
13
+ * permission (§4), so counting what it returns is counting the tabs the
14
+ * operator would actually see. That is the whole of *"fewer than two tabs is
15
+ * not a choice"*, expressed as arithmetic over the hook rather than as a module
16
+ * id a host has to know: `admin/src/components/OrderEntryTabs.tsx` used to
17
+ * write the same rule with `orders` and `quick_order` spelled into it.
18
+ *
19
+ * ## Why the minimum is a constant and not a prop
20
+ *
21
+ * Two is a property of *tab strips*, not of this zone: a strip offers a choice
22
+ * between siblings, and a choice needs two. A `minimum` prop would let a host
23
+ * ask for a one-tab strip, which is the thing the rule refuses. If a strip ever
24
+ * genuinely needs a different floor, the answer is a second renderer with its
25
+ * own reason, not a number the caller picks.
26
+ *
27
+ * ## What it delegates, and why that matters
28
+ *
29
+ * The contributions themselves go through `<AdminZone>` — same lazy-component
30
+ * cache, same `ZoneErrorBoundary` per contributor, same `Suspense`, same order.
31
+ * The strip supplies only the chrome. So a contributed tab that throws takes
32
+ * itself out of the strip and leaves the others (Z8), and a strip whose chunks
33
+ * are still in flight renders an empty `tablist` for a moment rather than
34
+ * pushing the host's content around. The **count** is known before any chunk is
35
+ * requested, which is what keeps the "is there a choice at all" decision
36
+ * immediate.
37
+ *
38
+ * A contributed tab renders `RouteTabLink` from `@endora-commerce/admin-kit/ui`;
39
+ * its own doc block records the one thing a contributed tab cannot do that
40
+ * `RouteTabs` can.
41
+ */
42
+ import type { ReactNode } from 'react';
43
+ import type { AdminZoneName, AdminZoneProps } from '@endora-commerce/contracts';
44
+ export interface RouteTabsZoneProps<Z extends AdminZoneName> {
45
+ readonly name: Z;
46
+ readonly props: AdminZoneProps<Z>;
47
+ readonly className?: string;
48
+ }
49
+ /**
50
+ * Render the zone `name` as a tab strip, or nothing at all when fewer than two
51
+ * contributions survive presence and permission.
52
+ *
53
+ * ```tsx
54
+ * <RouteTabsZone name="order.entry.tabs" props={{}} className="mb-4" />
55
+ * ```
56
+ *
57
+ * The name is a **string literal**, always (Z7) — `check:admin-zones` reads
58
+ * this tag beside `<AdminZone>` and reports a computed one rather than skipping
59
+ * it.
60
+ */
61
+ export declare function RouteTabsZone<Z extends AdminZoneName>({ name, props, className, }: RouteTabsZoneProps<Z>): ReactNode;
62
+ //# sourceMappingURL=RouteTabsZone.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RouteTabsZone.d.ts","sourceRoot":"","sources":["../../src/zones/RouteTabsZone.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAShF,MAAM,WAAW,kBAAkB,CAAC,CAAC,SAAS,aAAa;IACzD,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC;IACjB,QAAQ,CAAC,KAAK,EAAE,cAAc,CAAC,CAAC,CAAC,CAAC;IAClC,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,aAAa,CAAC,CAAC,SAAS,aAAa,EAAE,EACrD,IAAI,EACJ,KAAK,EACL,SAAS,GACV,EAAE,kBAAkB,CAAC,CAAC,CAAC,GAAG,SAAS,CAUnC"}
@@ -0,0 +1,25 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { cn } from '../lib/utils.js';
3
+ import { AdminZone } from './AdminZone.js';
4
+ import { useAdminZone } from './use-admin-zone.js';
5
+ /** A strip needs a choice, and a choice needs two. */
6
+ const MINIMUM_TABS = 2;
7
+ /**
8
+ * Render the zone `name` as a tab strip, or nothing at all when fewer than two
9
+ * contributions survive presence and permission.
10
+ *
11
+ * ```tsx
12
+ * <RouteTabsZone name="order.entry.tabs" props={{}} className="mb-4" />
13
+ * ```
14
+ *
15
+ * The name is a **string literal**, always (Z7) — `check:admin-zones` reads
16
+ * this tag beside `<AdminZone>` and reports a computed one rather than skipping
17
+ * it.
18
+ */
19
+ export function RouteTabsZone({ name, props, className, }) {
20
+ const tabs = useAdminZone(name, props);
21
+ if (tabs.length < MINIMUM_TABS)
22
+ return null;
23
+ return (_jsx("div", { className: cn('b2b-tabs-scroll', className), children: _jsx("div", { className: "b2b-tabs", role: "tablist", children: _jsx(AdminZone, { name: name, props: props }) }) }));
24
+ }
25
+ //# sourceMappingURL=RouteTabsZone.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RouteTabsZone.js","sourceRoot":"","sources":["../../src/zones/RouteTabsZone.tsx"],"names":[],"mappings":";AA4CA,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEnD,sDAAsD;AACtD,MAAM,YAAY,GAAG,CAAC,CAAC;AAQvB;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,aAAa,CAA0B,EACrD,IAAI,EACJ,KAAK,EACL,SAAS,GACa;IACtB,MAAM,IAAI,GAAG,YAAY,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IACvC,IAAI,IAAI,CAAC,MAAM,GAAG,YAAY;QAAE,OAAO,IAAI,CAAC;IAC5C,OAAO,CACL,cAAK,SAAS,EAAE,EAAE,CAAC,iBAAiB,EAAE,SAAS,CAAC,YAC9C,cAAK,SAAS,EAAC,UAAU,EAAC,IAAI,EAAC,SAAS,YACtC,KAAC,SAAS,IAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,GAAI,GACnC,GACF,CACP,CAAC;AACJ,CAAC"}
@@ -0,0 +1,36 @@
1
+ /**
2
+ * One contributed component's blast radius (feature 091, P4a; Z8).
3
+ *
4
+ * A zone contribution is an **addition**. A third-party module's exception must
5
+ * not white-screen the product editor, so each contribution is wrapped
6
+ * separately: one contributor throwing leaves the others, and the host, alone.
7
+ *
8
+ * **This is not the defensive `catch` `check:port-catches` refuses.** That rule
9
+ * is about swallowing a `ModuleDisabledError` at a seam, where the swallow
10
+ * turns fail-closed into fail-open. Here there is no presence question inside
11
+ * the boundary at all: presence was decided at enumeration, before the factory
12
+ * was called (`use-admin-zone.ts` step 3), so there is nothing about presence
13
+ * for this boundary to hide.
14
+ *
15
+ * It logs once — naming the module and the zone, because a stack trace from a
16
+ * lazily loaded chunk names neither — renders nothing in production, and
17
+ * renders an inline marker under `import.meta.env.DEV` so a contributor
18
+ * developing against a host screen sees the failure rather than a gap.
19
+ */
20
+ import { Component, type ErrorInfo, type ReactNode } from 'react';
21
+ export interface ZoneErrorBoundaryProps {
22
+ readonly module: string;
23
+ readonly zone: string;
24
+ readonly children: ReactNode;
25
+ }
26
+ interface ZoneErrorBoundaryState {
27
+ readonly failed: boolean;
28
+ }
29
+ export declare class ZoneErrorBoundary extends Component<ZoneErrorBoundaryProps, ZoneErrorBoundaryState> {
30
+ state: ZoneErrorBoundaryState;
31
+ static getDerivedStateFromError(): ZoneErrorBoundaryState;
32
+ componentDidCatch(error: unknown, info: ErrorInfo): void;
33
+ render(): ReactNode;
34
+ }
35
+ export {};
36
+ //# sourceMappingURL=ZoneErrorBoundary.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ZoneErrorBoundary.d.ts","sourceRoot":"","sources":["../../src/zones/ZoneErrorBoundary.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,EAAE,SAAS,EAAE,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAElE,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC;CAC9B;AAED,UAAU,sBAAsB;IAC9B,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;CAC1B;AAED,qBAAa,iBAAkB,SAAQ,SAAS,CAAC,sBAAsB,EAAE,sBAAsB,CAAC;IACrF,KAAK,EAAE,sBAAsB,CAAqB;IAE3D,MAAM,CAAC,wBAAwB,IAAI,sBAAsB;IAIhD,iBAAiB,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,GAAG,IAAI;IAaxD,MAAM,IAAI,SAAS;CAe7B"}
@@ -0,0 +1,44 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ /**
3
+ * One contributed component's blast radius (feature 091, P4a; Z8).
4
+ *
5
+ * A zone contribution is an **addition**. A third-party module's exception must
6
+ * not white-screen the product editor, so each contribution is wrapped
7
+ * separately: one contributor throwing leaves the others, and the host, alone.
8
+ *
9
+ * **This is not the defensive `catch` `check:port-catches` refuses.** That rule
10
+ * is about swallowing a `ModuleDisabledError` at a seam, where the swallow
11
+ * turns fail-closed into fail-open. Here there is no presence question inside
12
+ * the boundary at all: presence was decided at enumeration, before the factory
13
+ * was called (`use-admin-zone.ts` step 3), so there is nothing about presence
14
+ * for this boundary to hide.
15
+ *
16
+ * It logs once — naming the module and the zone, because a stack trace from a
17
+ * lazily loaded chunk names neither — renders nothing in production, and
18
+ * renders an inline marker under `import.meta.env.DEV` so a contributor
19
+ * developing against a host screen sees the failure rather than a gap.
20
+ */
21
+ import { Component } from 'react';
22
+ export class ZoneErrorBoundary extends Component {
23
+ state = { failed: false };
24
+ static getDerivedStateFromError() {
25
+ return { failed: true };
26
+ }
27
+ componentDidCatch(error, info) {
28
+ // Once, and naming both ends of the contribution: `error.stack` points into
29
+ // a split chunk, which tells a reader neither which module shipped it nor
30
+ // which of that module's contributions was rendering.
31
+ console.error(`[admin-zone] '${this.props.module}' threw while rendering the ` +
32
+ `'${this.props.zone}' zone. The host screen is unaffected; this contribution ` +
33
+ 'renders nothing.', error, info.componentStack);
34
+ }
35
+ render() {
36
+ if (!this.state.failed)
37
+ return this.props.children;
38
+ if (import.meta.env.DEV) {
39
+ return (_jsx("span", { role: "status", className: "text-xs text-destructive", "data-admin-zone-error": this.props.zone, children: `${this.props.module} failed to render here — see the console.` }));
40
+ }
41
+ return null;
42
+ }
43
+ }
44
+ //# sourceMappingURL=ZoneErrorBoundary.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ZoneErrorBoundary.js","sourceRoot":"","sources":["../../src/zones/ZoneErrorBoundary.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,EAAE,SAAS,EAAkC,MAAM,OAAO,CAAC;AAYlE,MAAM,OAAO,iBAAkB,SAAQ,SAAyD;IACrF,KAAK,GAA2B,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;IAE3D,MAAM,CAAC,wBAAwB;QAC7B,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IAC1B,CAAC;IAEQ,iBAAiB,CAAC,KAAc,EAAE,IAAe;QACxD,4EAA4E;QAC5E,0EAA0E;QAC1E,sDAAsD;QACtD,OAAO,CAAC,KAAK,CACX,iBAAiB,IAAI,CAAC,KAAK,CAAC,MAAM,8BAA8B;YAC9D,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,2DAA2D;YAC9E,kBAAkB,EACpB,KAAK,EACL,IAAI,CAAC,cAAc,CACpB,CAAC;IACJ,CAAC;IAEQ,MAAM;QACb,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM;YAAE,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC;QACnD,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC;YACxB,OAAO,CACL,eACE,IAAI,EAAC,QAAQ,EACb,SAAS,EAAC,0BAA0B,2BACb,IAAI,CAAC,KAAK,CAAC,IAAI,YAErC,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,2CAA2C,GAC3D,CACR,CAAC;QACJ,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;CACF"}
@@ -0,0 +1,31 @@
1
+ /**
2
+ * `@endora-commerce/admin-kit/zones` — the **host's** side of a zone (feature
3
+ * 091, P4a; Z6).
4
+ *
5
+ * `AdminContributionsProvider` is mounted once by
6
+ * the admin application with its generated registry; `useAdminZone(name, props)`
7
+ * is the primitive — the visible, matched, ordered contributions for one mount;
8
+ * `<AdminZone name props />` is the common case, rendering them all with an
9
+ * error boundary and a `Suspense` each; `<RouteTabsZone name props />` is the
10
+ * one place a zone is a **tab strip**, where the count decides whether the
11
+ * strip exists at all (feature 091, P4d).
12
+ *
13
+ * **A separate subpath from `./contributions`, and the split is deliberate.**
14
+ * `./contributions` is the contributor's side and is data-only — a module's
15
+ * `src/admin/index.ts` imports it — while this subpath renders React. One
16
+ * subpath would let a declaration file import a component, which R2 of
17
+ * `admin-contribution.md` exists to prevent.
18
+ *
19
+ * The barrel is **explicit and holds no `export *`**, per
20
+ * `admin-kit-surface.md` R2.
21
+ */
22
+ export { AdminZone } from './AdminZone.js';
23
+ export type { AdminZoneRenderProps } from './AdminZone.js';
24
+ export { RouteTabsZone } from './RouteTabsZone.js';
25
+ export type { RouteTabsZoneProps } from './RouteTabsZone.js';
26
+ export { AdminContributionsProvider, AdminContributionsUnavailableError, useAdminContributions, } from './AdminContributionsProvider.js';
27
+ export type { AdminContributionsProviderProps, AdminZoneRegistryEntry, OwnedZoneContribution, } from './AdminContributionsProvider.js';
28
+ export { matchesZoneProps, selectZoneContributions, useAdminZone } from './use-admin-zone.js';
29
+ export { ZoneErrorBoundary } from './ZoneErrorBoundary.js';
30
+ export type { ZoneErrorBoundaryProps } from './ZoneErrorBoundary.js';
31
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/zones/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,YAAY,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,YAAY,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,EACL,0BAA0B,EAC1B,kCAAkC,EAClC,qBAAqB,GACtB,MAAM,iCAAiC,CAAC;AACzC,YAAY,EACV,+BAA+B,EAC/B,sBAAsB,EACtB,qBAAqB,GACtB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAC9F,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,YAAY,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC"}
@@ -0,0 +1,27 @@
1
+ /**
2
+ * `@endora-commerce/admin-kit/zones` — the **host's** side of a zone (feature
3
+ * 091, P4a; Z6).
4
+ *
5
+ * `AdminContributionsProvider` is mounted once by
6
+ * the admin application with its generated registry; `useAdminZone(name, props)`
7
+ * is the primitive — the visible, matched, ordered contributions for one mount;
8
+ * `<AdminZone name props />` is the common case, rendering them all with an
9
+ * error boundary and a `Suspense` each; `<RouteTabsZone name props />` is the
10
+ * one place a zone is a **tab strip**, where the count decides whether the
11
+ * strip exists at all (feature 091, P4d).
12
+ *
13
+ * **A separate subpath from `./contributions`, and the split is deliberate.**
14
+ * `./contributions` is the contributor's side and is data-only — a module's
15
+ * `src/admin/index.ts` imports it — while this subpath renders React. One
16
+ * subpath would let a declaration file import a component, which R2 of
17
+ * `admin-contribution.md` exists to prevent.
18
+ *
19
+ * The barrel is **explicit and holds no `export *`**, per
20
+ * `admin-kit-surface.md` R2.
21
+ */
22
+ export { AdminZone } from './AdminZone.js';
23
+ export { RouteTabsZone } from './RouteTabsZone.js';
24
+ export { AdminContributionsProvider, AdminContributionsUnavailableError, useAdminContributions, } from './AdminContributionsProvider.js';
25
+ export { matchesZoneProps, selectZoneContributions, useAdminZone } from './use-admin-zone.js';
26
+ export { ZoneErrorBoundary } from './ZoneErrorBoundary.js';
27
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/zones/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD,OAAO,EACL,0BAA0B,EAC1B,kCAAkC,EAClC,qBAAqB,GACtB,MAAM,iCAAiC,CAAC;AAMzC,OAAO,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAC9F,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC"}
@@ -0,0 +1,32 @@
1
+ import type { AdminZoneName, AdminZoneProps } from '@endora-commerce/contracts';
2
+ import { type GatedSurface } from '../lib/surface-visibility.js';
3
+ import { type OwnedZoneContribution } from './AdminContributionsProvider.js';
4
+ /**
5
+ * Whether every key of `match` agrees with the mount's props.
6
+ *
7
+ * A contribution with no `match` matches every mount. A key the props do not
8
+ * carry never agrees — the fail-closed direction: a `match` naming a prop that
9
+ * does not exist hides the contribution, where the other answer would widen it
10
+ * silently.
11
+ *
12
+ * Comparison is by string value, so a non-string prop (`languageCodes`, an
13
+ * array) is not matchable and a `match` naming it hides the contribution. That
14
+ * is deliberate rather than a limit worked around: `match` is declarative data
15
+ * a check has to be able to read, and a structural comparison is not.
16
+ *
17
+ * Exported so a test can drive the predicate directly — the classification is
18
+ * what `match` is, and a test that reached it only through a rendered React
19
+ * tree would be asserting the renderer instead.
20
+ */
21
+ export declare function matchesZoneProps(match: Readonly<Record<string, string | readonly string[]>> | undefined, props: Readonly<Record<string, unknown>>): boolean;
22
+ /** The four steps, as a pure function of the registry, the props and the predicate. */
23
+ export declare function selectZoneContributions(contributions: readonly OwnedZoneContribution[], zone: string, props: Readonly<Record<string, unknown>>, isVisible: (surface: GatedSurface) => boolean): readonly OwnedZoneContribution[];
24
+ /**
25
+ * The contributions to render at this mount of `zone`, in order.
26
+ *
27
+ * The zone name is a **string literal** at every call site (Z7): the two-way
28
+ * refusal in `check:admin-zones` compares rendered names to declared ones, and
29
+ * a name it cannot read is a zone it would report as rendered by nobody.
30
+ */
31
+ export declare function useAdminZone<Z extends AdminZoneName>(zone: Z, props: AdminZoneProps<Z>): readonly OwnedZoneContribution[];
32
+ //# sourceMappingURL=use-admin-zone.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-admin-zone.d.ts","sourceRoot":"","sources":["../../src/zones/use-admin-zone.ts"],"names":[],"mappings":"AAgCA,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAEhF,OAAO,EAAwB,KAAK,YAAY,EAAE,MAAM,8BAA8B,CAAC;AACvF,OAAO,EAAyB,KAAK,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAEpG;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,CAAC,CAAC,GAAG,SAAS,EACvE,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GACvC,OAAO,CAYT;AAED,uFAAuF;AACvF,wBAAgB,uBAAuB,CACrC,aAAa,EAAE,SAAS,qBAAqB,EAAE,EAC/C,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EACxC,SAAS,EAAE,CAAC,OAAO,EAAE,YAAY,KAAK,OAAO,GAC5C,SAAS,qBAAqB,EAAE,CAkBlC;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,CAAC,SAAS,aAAa,EAClD,IAAI,EAAE,CAAC,EACP,KAAK,EAAE,cAAc,CAAC,CAAC,CAAC,GACvB,SAAS,qBAAqB,EAAE,CAalC"}
@@ -0,0 +1,96 @@
1
+ /**
2
+ * The zone primitive — the visible, matched, ordered contributions for one
3
+ * place (feature 091, P4a; Z4/Z5, §4).
4
+ *
5
+ * ## Where the presence filter goes, and why it is here
6
+ *
7
+ * **The registry does not filter. This does, at enumeration.** That is
8
+ * D-67/D-68's boot-hook rule pointed at the frontend and the rule
9
+ * `admin/src/lib/module-registry/index.ts` already states for routes and nav:
10
+ * an operator's activation flip must take effect without a rebuild, so the
11
+ * registry answers *"what could be here"* and the enumeration answers *"what is
12
+ * here for this operator right now"*.
13
+ *
14
+ * ## The order the four steps run in is the design
15
+ *
16
+ * 1. the contributions whose `zone` is this one;
17
+ * 2. minus those whose `match` disagrees with the mount's props;
18
+ * 3. minus those `isSurfaceVisible({ module, requiredPermission })` rejects —
19
+ * the one predicate (FR-012), now with a fourth caller and still no second
20
+ * copy;
21
+ * 4. sorted by `weight`, then module id.
22
+ *
23
+ * Steps 2 and 3 are decided **before** `React.lazy` is touched, which is FR-013
24
+ * and not tidiness: a contributor that narrowed itself by returning `null`
25
+ * would have its chunk fetched and evaluated on every screen the zone is
26
+ * mounted on, and FR-013 says a module's admin page code must not be downloaded
27
+ * by a browser that cannot reach it.
28
+ *
29
+ * `module` is the registry entry's key and never a declared field (D-142), so a
30
+ * module cannot contribute under another module's presence.
31
+ */
32
+ import { useMemo } from 'react';
33
+ import { useSurfaceVisibility } from '../lib/surface-visibility.js';
34
+ import { useAdminContributions } from './AdminContributionsProvider.js';
35
+ /**
36
+ * Whether every key of `match` agrees with the mount's props.
37
+ *
38
+ * A contribution with no `match` matches every mount. A key the props do not
39
+ * carry never agrees — the fail-closed direction: a `match` naming a prop that
40
+ * does not exist hides the contribution, where the other answer would widen it
41
+ * silently.
42
+ *
43
+ * Comparison is by string value, so a non-string prop (`languageCodes`, an
44
+ * array) is not matchable and a `match` naming it hides the contribution. That
45
+ * is deliberate rather than a limit worked around: `match` is declarative data
46
+ * a check has to be able to read, and a structural comparison is not.
47
+ *
48
+ * Exported so a test can drive the predicate directly — the classification is
49
+ * what `match` is, and a test that reached it only through a rendered React
50
+ * tree would be asserting the renderer instead.
51
+ */
52
+ export function matchesZoneProps(match, props) {
53
+ if (match === undefined)
54
+ return true;
55
+ for (const [key, wanted] of Object.entries(match)) {
56
+ const value = props[key];
57
+ if (typeof value !== 'string')
58
+ return false;
59
+ if (typeof wanted === 'string') {
60
+ if (wanted !== value)
61
+ return false;
62
+ continue;
63
+ }
64
+ if (!wanted.includes(value))
65
+ return false;
66
+ }
67
+ return true;
68
+ }
69
+ /** The four steps, as a pure function of the registry, the props and the predicate. */
70
+ export function selectZoneContributions(contributions, zone, props, isVisible) {
71
+ return contributions
72
+ .filter((contribution) => contribution.zone === zone)
73
+ .filter((contribution) => matchesZoneProps(contribution.match, props))
74
+ .filter((contribution) => isVisible({
75
+ module: contribution.module,
76
+ // `exactOptionalPropertyTypes` is on: an absent requirement is an
77
+ // absent property, not an explicit `undefined`.
78
+ ...(contribution.requiredPermission === undefined
79
+ ? {}
80
+ : { requiredPermission: contribution.requiredPermission }),
81
+ }))
82
+ .sort((left, right) => left.weight - right.weight || left.module.localeCompare(right.module));
83
+ }
84
+ /**
85
+ * The contributions to render at this mount of `zone`, in order.
86
+ *
87
+ * The zone name is a **string literal** at every call site (Z7): the two-way
88
+ * refusal in `check:admin-zones` compares rendered names to declared ones, and
89
+ * a name it cannot read is a zone it would report as rendered by nobody.
90
+ */
91
+ export function useAdminZone(zone, props) {
92
+ const contributions = useAdminContributions();
93
+ const isVisible = useSurfaceVisibility();
94
+ return useMemo(() => selectZoneContributions(contributions, zone, props, isVisible), [contributions, zone, props, isVisible]);
95
+ }
96
+ //# sourceMappingURL=use-admin-zone.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-admin-zone.js","sourceRoot":"","sources":["../../src/zones/use-admin-zone.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAGhC,OAAO,EAAE,oBAAoB,EAAqB,MAAM,8BAA8B,CAAC;AACvF,OAAO,EAAE,qBAAqB,EAA8B,MAAM,iCAAiC,CAAC;AAEpG;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,gBAAgB,CAC9B,KAAuE,EACvE,KAAwC;IAExC,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,IAAI,CAAC;IACrC,KAAK,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QAClD,MAAM,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC;QACzB,IAAI,OAAO,KAAK,KAAK,QAAQ;YAAE,OAAO,KAAK,CAAC;QAC5C,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;YAC/B,IAAI,MAAM,KAAK,KAAK;gBAAE,OAAO,KAAK,CAAC;YACnC,SAAS;QACX,CAAC;QACD,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC;YAAE,OAAO,KAAK,CAAC;IAC5C,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,uFAAuF;AACvF,MAAM,UAAU,uBAAuB,CACrC,aAA+C,EAC/C,IAAY,EACZ,KAAwC,EACxC,SAA6C;IAE7C,OAAO,aAAa;SACjB,MAAM,CAAC,CAAC,YAAY,EAAE,EAAE,CAAC,YAAY,CAAC,IAAI,KAAK,IAAI,CAAC;SACpD,MAAM,CAAC,CAAC,YAAY,EAAE,EAAE,CAAC,gBAAgB,CAAC,YAAY,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;SACrE,MAAM,CAAC,CAAC,YAAY,EAAE,EAAE,CACvB,SAAS,CAAC;QACR,MAAM,EAAE,YAAY,CAAC,MAAM;QAC3B,kEAAkE;QAClE,gDAAgD;QAChD,GAAG,CAAC,YAAY,CAAC,kBAAkB,KAAK,SAAS;YAC/C,CAAC,CAAC,EAAE;YACJ,CAAC,CAAC,EAAE,kBAAkB,EAAE,YAAY,CAAC,kBAAkB,EAAE,CAAC;KAC7D,CAAC,CACH;SACA,IAAI,CACH,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CACd,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,MAAM,CAAC,CACxE,CAAC;AACN,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,YAAY,CAC1B,IAAO,EACP,KAAwB;IAExB,MAAM,aAAa,GAAG,qBAAqB,EAAE,CAAC;IAC9C,MAAM,SAAS,GAAG,oBAAoB,EAAE,CAAC;IACzC,OAAO,OAAO,CACZ,GAAG,EAAE,CACH,uBAAuB,CACrB,aAAa,EACb,IAAI,EACJ,KAAqD,EACrD,SAAS,CACV,EACH,CAAC,aAAa,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,CAAC,CACxC,CAAC;AACJ,CAAC"}