@asteby/metacore-runtime-react 53.25.0 → 53.26.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 (363) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/dist/action-modal-dispatcher.d.ts +3 -3
  3. package/dist/action-modal-dispatcher.js +31 -31
  4. package/dist/action-priority.d.ts +1 -1
  5. package/dist/activity-diff.d.ts +1 -1
  6. package/dist/activity-diff.js +1 -1
  7. package/dist/activity-timeline.d.ts +2 -2
  8. package/dist/activity-timeline.js +3 -3
  9. package/dist/activity-value-renderer.d.ts +1 -1
  10. package/dist/activity-value-renderer.js +3 -3
  11. package/dist/addon-loader.d.ts +1 -1
  12. package/dist/addon-loader.js +3 -3
  13. package/dist/addon-page-host.js +1 -1
  14. package/dist/addon-page-loader.d.ts +2 -2
  15. package/dist/addon-page-loader.js +3 -3
  16. package/dist/api-context.js +4 -4
  17. package/dist/approval-gate.d.ts +1 -1
  18. package/dist/approval-gate.js +5 -5
  19. package/dist/assist-interview.d.ts +1 -1
  20. package/dist/assist-interview.js +1 -1
  21. package/dist/attention/index.d.ts +3 -3
  22. package/dist/attention/index.js +3 -3
  23. package/dist/attention/use-nav-badges.js +2 -2
  24. package/dist/attribute-classes.d.ts +1 -1
  25. package/dist/audit-info.d.ts +1 -1
  26. package/dist/audit-info.js +5 -5
  27. package/dist/bulk-image-dialog.d.ts +1 -1
  28. package/dist/bulk-image-dialog.js +5 -5
  29. package/dist/bulk-image-import.d.ts +2 -2
  30. package/dist/bulk-image-import.js +1 -1
  31. package/dist/bulk-image-target.d.ts +1 -1
  32. package/dist/bulk-image-target.js +1 -1
  33. package/dist/bulk-image-wizard.d.ts +1 -1
  34. package/dist/bulk-image-wizard.js +5 -5
  35. package/dist/business/catalog-product-search.d.ts +1 -1
  36. package/dist/business/customer-picker.js +4 -4
  37. package/dist/business/document-editor-model.d.ts +3 -3
  38. package/dist/business/document-editor-model.js +4 -4
  39. package/dist/business/document-editor-panels.d.ts +3 -3
  40. package/dist/business/document-editor-panels.js +1 -1
  41. package/dist/business/document-editor.d.ts +2 -2
  42. package/dist/business/document-editor.js +22 -22
  43. package/dist/business/document-lines.d.ts +2 -2
  44. package/dist/business/document-lines.js +3 -3
  45. package/dist/business/field-errors.d.ts +1 -1
  46. package/dist/business/field-errors.js +1 -1
  47. package/dist/business/format.js +1 -1
  48. package/dist/business/index.d.ts +29 -29
  49. package/dist/business/index.js +29 -29
  50. package/dist/business/inspection-checklist.d.ts +1 -1
  51. package/dist/business/inspection-checklist.js +2 -2
  52. package/dist/business/inspection.d.ts +1 -1
  53. package/dist/business/inspection.js +2 -2
  54. package/dist/business/line-items-editor.d.ts +3 -3
  55. package/dist/business/line-items-editor.js +5 -5
  56. package/dist/business/line-items.d.ts +1 -1
  57. package/dist/business/line-items.js +2 -2
  58. package/dist/business/line-product-cell.d.ts +2 -2
  59. package/dist/business/line-product-cell.js +2 -2
  60. package/dist/business/payment-allocator.d.ts +1 -1
  61. package/dist/business/payment-allocator.js +2 -2
  62. package/dist/business/payment-capture.d.ts +1 -1
  63. package/dist/business/payment-capture.js +3 -3
  64. package/dist/business/payment.js +1 -1
  65. package/dist/business/print-send-dialog.js +1 -1
  66. package/dist/business/product-display.d.ts +1 -1
  67. package/dist/business/product-options.d.ts +1 -1
  68. package/dist/business/product-options.js +4 -4
  69. package/dist/business/product-picker.d.ts +1 -1
  70. package/dist/business/product-picker.js +3 -3
  71. package/dist/business/product-search.d.ts +2 -2
  72. package/dist/business/product-search.js +1 -1
  73. package/dist/business/refund-destination.d.ts +1 -1
  74. package/dist/business/refund-destination.js +2 -2
  75. package/dist/business/refund.js +1 -1
  76. package/dist/business/relate-documents.js +1 -1
  77. package/dist/business/return-wizard.d.ts +2 -2
  78. package/dist/business/return-wizard.js +4 -4
  79. package/dist/business/return.d.ts +2 -2
  80. package/dist/business/return.js +2 -2
  81. package/dist/business/vehicle-picker.js +3 -3
  82. package/dist/cache-coherence.js +3 -3
  83. package/dist/capability-providers/index.d.ts +3 -3
  84. package/dist/capability-providers/index.js +3 -3
  85. package/dist/capability-providers/provider-sortable-list.d.ts +1 -1
  86. package/dist/capability-providers/provider-sortable-list.js +1 -1
  87. package/dist/collection-cell.js +1 -1
  88. package/dist/column-filter-field.d.ts +1 -1
  89. package/dist/column-visibility.d.ts +1 -1
  90. package/dist/custom-stages.d.ts +2 -2
  91. package/dist/custom-stages.js +1 -1
  92. package/dist/dashboard-grid.d.ts +1 -1
  93. package/dist/dashboard-grid.js +3 -3
  94. package/dist/dialogs/create-record-dialog.d.ts +1 -1
  95. package/dist/dialogs/create-record-dialog.js +1 -1
  96. package/dist/dialogs/dynamic-record.d.ts +5 -5
  97. package/dist/dialogs/dynamic-record.js +41 -41
  98. package/dist/dialogs/export.d.ts +1 -1
  99. package/dist/dialogs/export.js +2 -2
  100. package/dist/dialogs/import.d.ts +1 -1
  101. package/dist/dialogs/import.js +3 -3
  102. package/dist/dialogs/inline-relation-rows.d.ts +3 -3
  103. package/dist/dialogs/inline-relation-rows.js +3 -3
  104. package/dist/dialogs/inline-relations.d.ts +3 -3
  105. package/dist/dialogs/inline-relations.js +3 -3
  106. package/dist/dialogs/normalize-submit.d.ts +1 -1
  107. package/dist/dialogs/normalize-submit.js +3 -3
  108. package/dist/dialogs/use-inline-relations.d.ts +1 -1
  109. package/dist/dialogs/use-inline-relations.js +3 -3
  110. package/dist/dialogs/view-record-dialog.d.ts +1 -1
  111. package/dist/dialogs/view-record-dialog.js +1 -1
  112. package/dist/display-value.js +1 -1
  113. package/dist/document/action-bar.d.ts +1 -1
  114. package/dist/document/action-bar.js +1 -1
  115. package/dist/document/document-header.d.ts +2 -2
  116. package/dist/document/document-header.js +2 -2
  117. package/dist/document/document-page.d.ts +3 -3
  118. package/dist/document/document-page.js +9 -9
  119. package/dist/document/document-timeline.d.ts +2 -2
  120. package/dist/document/document-timeline.js +2 -2
  121. package/dist/document/evaluate.d.ts +1 -1
  122. package/dist/document/evaluate.js +1 -1
  123. package/dist/document/format.d.ts +1 -1
  124. package/dist/document/index.d.ts +13 -13
  125. package/dist/document/index.js +13 -13
  126. package/dist/document/registry.d.ts +1 -1
  127. package/dist/document/secondary-bar.js +2 -2
  128. package/dist/document/smart-buttons.js +1 -1
  129. package/dist/document/status-badge.d.ts +1 -1
  130. package/dist/document/use-document-sources.d.ts +1 -1
  131. package/dist/document/use-document-sources.js +2 -2
  132. package/dist/document-form-dialog.d.ts +2 -2
  133. package/dist/document-form-dialog.js +16 -16
  134. package/dist/document-template-editor.js +1 -1
  135. package/dist/dynamic-columns-shim.d.ts +1 -1
  136. package/dist/dynamic-columns.d.ts +3 -3
  137. package/dist/dynamic-columns.js +19 -19
  138. package/dist/dynamic-crud-page.d.ts +2 -2
  139. package/dist/dynamic-crud-page.js +13 -13
  140. package/dist/dynamic-date-field.d.ts +1 -1
  141. package/dist/dynamic-date-field.js +1 -1
  142. package/dist/dynamic-form-schema.d.ts +2 -2
  143. package/dist/dynamic-form-schema.js +4 -4
  144. package/dist/dynamic-form.d.ts +10 -10
  145. package/dist/dynamic-form.js +24 -24
  146. package/dist/dynamic-icon.js +1 -1
  147. package/dist/dynamic-kanban.d.ts +3 -3
  148. package/dist/dynamic-kanban.js +25 -25
  149. package/dist/dynamic-line-items.d.ts +1 -1
  150. package/dist/dynamic-line-items.js +6 -6
  151. package/dist/dynamic-multi-select-field.d.ts +1 -1
  152. package/dist/dynamic-multi-select-field.js +7 -7
  153. package/dist/dynamic-relation-helpers.d.ts +1 -1
  154. package/dist/dynamic-relation-helpers.js +2 -2
  155. package/dist/dynamic-relation.d.ts +2 -2
  156. package/dist/dynamic-relation.js +15 -15
  157. package/dist/dynamic-relations.d.ts +2 -2
  158. package/dist/dynamic-relations.js +1 -1
  159. package/dist/dynamic-row-actions.d.ts +1 -1
  160. package/dist/dynamic-row-actions.js +5 -5
  161. package/dist/dynamic-select-field.d.ts +3 -3
  162. package/dist/dynamic-select-field.js +11 -11
  163. package/dist/dynamic-table.d.ts +2 -2
  164. package/dist/dynamic-table.js +24 -24
  165. package/dist/dynamic-view.d.ts +4 -4
  166. package/dist/dynamic-view.js +7 -7
  167. package/dist/entity-select.js +4 -4
  168. package/dist/field-validation-ui.d.ts +2 -2
  169. package/dist/field-widget-registry.d.ts +1 -1
  170. package/dist/form-layout-ui.d.ts +1 -1
  171. package/dist/form-layout.d.ts +1 -1
  172. package/dist/form-layout.js +1 -1
  173. package/dist/genui/index.d.ts +1 -1
  174. package/dist/genui/index.js +1 -1
  175. package/dist/genui/settings-block.d.ts +1 -1
  176. package/dist/genui/settings-block.js +3 -3
  177. package/dist/host-api-client.d.ts +11 -1
  178. package/dist/host-api-client.d.ts.map +1 -1
  179. package/dist/host-api-client.js +21 -14
  180. package/dist/host-api.d.ts +9 -1
  181. package/dist/host-api.d.ts.map +1 -1
  182. package/dist/host-api.js +57 -2
  183. package/dist/hotswap-reload-policy.d.ts +1 -1
  184. package/dist/hotswap-reload-policy.js +1 -1
  185. package/dist/icon-picker-field.d.ts +1 -1
  186. package/dist/icon-picker-field.js +3 -3
  187. package/dist/icon-resolvers.d.ts +1 -1
  188. package/dist/icon-resolvers.js +1 -1
  189. package/dist/icon-spec.js +1 -1
  190. package/dist/index.d.ts +165 -165
  191. package/dist/index.d.ts.map +1 -1
  192. package/dist/index.js +148 -148
  193. package/dist/license/index.d.ts +6 -6
  194. package/dist/license/index.js +6 -6
  195. package/dist/license/license-expiry-banner.d.ts +1 -1
  196. package/dist/license/license-expiry-banner.js +3 -3
  197. package/dist/license/license-gate.d.ts +1 -1
  198. package/dist/license/license-gate.js +5 -5
  199. package/dist/license/license-status-badge.d.ts +1 -1
  200. package/dist/license/license-status-badge.js +1 -1
  201. package/dist/license/use-license-t.d.ts +1 -1
  202. package/dist/license/use-license-t.js +1 -1
  203. package/dist/license/view.d.ts +1 -1
  204. package/dist/license/view.js +1 -1
  205. package/dist/list-include.d.ts +1 -1
  206. package/dist/manifest-hotswap-subscriber.d.ts +1 -1
  207. package/dist/manifest-hotswap-subscriber.js +1 -1
  208. package/dist/metadata-cache.d.ts +1 -1
  209. package/dist/metadata-cache.js +1 -1
  210. package/dist/model-action-toolbar.d.ts +1 -1
  211. package/dist/model-action-toolbar.js +7 -7
  212. package/dist/nav-permissions.d.ts +1 -1
  213. package/dist/nav-permissions.js +1 -1
  214. package/dist/navigation-builder.d.ts +1 -1
  215. package/dist/navigation-builder.js +1 -1
  216. package/dist/option-display.d.ts +1 -1
  217. package/dist/option-display.js +2 -2
  218. package/dist/option-filter.d.ts +1 -1
  219. package/dist/option-when.d.ts +1 -1
  220. package/dist/org-runtime-provider.d.ts +2 -2
  221. package/dist/org-runtime-provider.js +2 -2
  222. package/dist/permissions-context.d.ts +1 -1
  223. package/dist/permissions-manager.js +4 -4
  224. package/dist/primitives/aging.js +1 -1
  225. package/dist/primitives/allocation.js +1 -1
  226. package/dist/primitives/approvals.d.ts +1 -1
  227. package/dist/primitives/contributions.js +1 -1
  228. package/dist/primitives/document-kinds.d.ts +1 -1
  229. package/dist/primitives/index.d.ts +7 -7
  230. package/dist/primitives/index.js +7 -7
  231. package/dist/primitives/panels.d.ts +1 -1
  232. package/dist/primitives/use-contributions.d.ts +2 -2
  233. package/dist/primitives/use-contributions.js +2 -2
  234. package/dist/print-document-button.d.ts +1 -1
  235. package/dist/print-document-button.js +1 -1
  236. package/dist/provenance.js +3 -3
  237. package/dist/query-batch.d.ts +1 -1
  238. package/dist/query-batch.js +1 -1
  239. package/dist/record-actions.d.ts +2 -2
  240. package/dist/record-actions.js +2 -2
  241. package/dist/record-history.d.ts +2 -2
  242. package/dist/record-history.js +3 -3
  243. package/dist/record-picker-dialog.js +3 -3
  244. package/dist/record-picker-option.d.ts +1 -1
  245. package/dist/record-picker-option.js +1 -1
  246. package/dist/record-picker.js +2 -2
  247. package/dist/record-prefill-bar.js +1 -1
  248. package/dist/relation-gallery.js +1 -1
  249. package/dist/requires-addon.d.ts +1 -1
  250. package/dist/rich-cells.js +2 -2
  251. package/dist/rich-url.js +1 -1
  252. package/dist/row-actions-menu.js +5 -5
  253. package/dist/server-error.js +2 -2
  254. package/dist/setup/addon-config-surface.d.ts +3 -3
  255. package/dist/setup/addon-config-surface.js +10 -10
  256. package/dist/setup/connector-blocks-model.d.ts +1 -1
  257. package/dist/setup/connector-blocks.d.ts +1 -1
  258. package/dist/setup/connector-blocks.js +6 -6
  259. package/dist/setup/flow-model.d.ts +1 -1
  260. package/dist/setup/health-card.d.ts +1 -1
  261. package/dist/setup/health-card.js +2 -2
  262. package/dist/setup/index.d.ts +12 -12
  263. package/dist/setup/index.js +12 -12
  264. package/dist/setup/records-table.d.ts +1 -1
  265. package/dist/setup/records-table.js +2 -2
  266. package/dist/setup/setup-flow.d.ts +1 -1
  267. package/dist/setup/setup-flow.js +7 -7
  268. package/dist/setup/setup-form-step.d.ts +1 -1
  269. package/dist/setup/setup-form-step.js +4 -4
  270. package/dist/setup/step-status-badge.d.ts +1 -1
  271. package/dist/setup/step-status-badge.js +2 -2
  272. package/dist/setup/tone.d.ts +1 -1
  273. package/dist/setup/types.d.ts +2 -2
  274. package/dist/sidebar-layout-manager.d.ts +1 -1
  275. package/dist/sidebar-layout-manager.js +2 -2
  276. package/dist/slot.js +1 -1
  277. package/dist/slots/addon-slot.js +4 -4
  278. package/dist/slots/index.d.ts +2 -2
  279. package/dist/slots/index.js +2 -2
  280. package/dist/stage-automations.d.ts +2 -2
  281. package/dist/stage-automations.js +1 -1
  282. package/dist/stage-layout.js +1 -1
  283. package/dist/stage-overrides.d.ts +1 -1
  284. package/dist/stage-overrides.js +1 -1
  285. package/dist/supervised-action.js +1 -1
  286. package/dist/testing.d.ts +1 -1
  287. package/dist/testing.js +1 -1
  288. package/dist/tri-state-boolean.d.ts +2 -2
  289. package/dist/tri-state-boolean.js +1 -1
  290. package/dist/types.d.ts +1 -1
  291. package/dist/upload-field.d.ts +1 -1
  292. package/dist/upload-field.js +4 -4
  293. package/dist/use-addon-installed-probe.js +3 -3
  294. package/dist/use-addon-settings.d.ts +1 -1
  295. package/dist/use-addon-settings.js +1 -1
  296. package/dist/use-dynamic-filters.d.ts +2 -2
  297. package/dist/use-dynamic-filters.js +6 -6
  298. package/dist/use-edge-device.d.ts +1 -1
  299. package/dist/use-edge-device.js +2 -2
  300. package/dist/use-facet-loaders.d.ts +1 -1
  301. package/dist/use-facet-loaders.js +1 -1
  302. package/dist/use-flip-animation.d.ts +1 -1
  303. package/dist/use-flip-animation.js +1 -1
  304. package/dist/use-host-api-client.d.ts +2 -2
  305. package/dist/use-host-api-client.d.ts.map +1 -1
  306. package/dist/use-host-api-client.js +6 -4
  307. package/dist/use-option-ids.d.ts +1 -1
  308. package/dist/use-option-ids.js +2 -2
  309. package/dist/use-options-resolver.d.ts +2 -2
  310. package/dist/use-options-resolver.js +4 -4
  311. package/dist/use-org-document-templates.js +1 -1
  312. package/dist/use-print-document.js +1 -1
  313. package/dist/use-record-mutation-tick.js +1 -1
  314. package/dist/validator.d.ts +2 -2
  315. package/dist/validator.js +1 -1
  316. package/dist/view-system/card-spec.d.ts +1 -1
  317. package/dist/view-system/cards-view.d.ts +1 -1
  318. package/dist/view-system/cards-view.js +2 -2
  319. package/dist/view-system/index.d.ts +9 -9
  320. package/dist/view-system/index.js +9 -9
  321. package/dist/view-system/model-view.d.ts +3 -3
  322. package/dist/view-system/model-view.js +7 -7
  323. package/dist/view-system/saved-views.d.ts +1 -1
  324. package/dist/view-system/use-view-mode.d.ts +1 -1
  325. package/dist/view-system/view-state.d.ts +1 -1
  326. package/dist/view-system/view-switcher.d.ts +1 -1
  327. package/dist/view-system/view-toolbar.d.ts +1 -1
  328. package/dist/view-system/view-toolbar.js +2 -2
  329. package/dist/views/calendar-view.d.ts +1 -1
  330. package/dist/views/calendar-view.js +2 -2
  331. package/dist/views/chart-view.d.ts +2 -2
  332. package/dist/views/chart-view.js +2 -2
  333. package/dist/views/data-source.d.ts +2 -2
  334. package/dist/views/index.d.ts +3 -3
  335. package/dist/views/index.js +2 -2
  336. package/dist/views/map-view.d.ts +1 -1
  337. package/dist/views/map-view.js +3 -3
  338. package/dist/views/panels.d.ts +1 -1
  339. package/dist/views/panels.js +3 -3
  340. package/dist/views/registry.d.ts +2 -2
  341. package/dist/views/registry.js +12 -12
  342. package/dist/views/split-view.d.ts +1 -1
  343. package/dist/views/split-view.js +4 -4
  344. package/dist/views/timeline-view.d.ts +1 -1
  345. package/dist/views/timeline-view.js +3 -3
  346. package/dist/views/types.d.ts +2 -2
  347. package/dist/widgets/charts.d.ts +1 -1
  348. package/dist/widgets/charts.js +2 -2
  349. package/dist/widgets/lazy-charts.d.ts +1 -1
  350. package/dist/widgets/lazy-charts.js +2 -2
  351. package/dist/widgets/renderers.d.ts +2 -2
  352. package/dist/widgets/renderers.js +2 -2
  353. package/dist/widgets/widget-card.d.ts +1 -1
  354. package/dist/widgets/widget-card.js +2 -2
  355. package/dist/widgets/widget-renderer.d.ts +1 -1
  356. package/dist/widgets/widget-renderer.js +4 -4
  357. package/package.json +9 -9
  358. package/src/__tests__/host-api-client.test.tsx +16 -0
  359. package/src/__tests__/host-api.test.ts +50 -0
  360. package/src/host-api-client.ts +31 -14
  361. package/src/host-api.ts +54 -1
  362. package/src/index.ts +2 -1
  363. package/src/use-host-api-client.ts +5 -3
@@ -1,9 +1,9 @@
1
- export * from './types';
2
- export { parseViewState, serializeViewState, viewStateToParams, isViewStateEmpty, EMPTY_VIEW_STATE } from './view-state';
3
- export { useViewMode, resolveViewMode, viewPrefKey, DEFAULT_MODES } from './use-view-mode';
4
- export { ViewSwitcher } from './view-switcher';
5
- export { ViewToolbar } from './view-toolbar';
6
- export { useSavedViews, localSavedViewsAdapter, upsertSavedView, removeSavedView, MAX_SAVED_VIEWS } from './saved-views';
7
- export { ConfigurableCard, resolveCard } from './card-spec';
8
- export { CardsView } from './cards-view';
9
- export { ModelView } from './model-view';
1
+ export * from './types.js';
2
+ export { parseViewState, serializeViewState, viewStateToParams, isViewStateEmpty, EMPTY_VIEW_STATE } from './view-state.js';
3
+ export { useViewMode, resolveViewMode, viewPrefKey, DEFAULT_MODES } from './use-view-mode.js';
4
+ export { ViewSwitcher } from './view-switcher.js';
5
+ export { ViewToolbar } from './view-toolbar.js';
6
+ export { useSavedViews, localSavedViewsAdapter, upsertSavedView, removeSavedView, MAX_SAVED_VIEWS } from './saved-views.js';
7
+ export { ConfigurableCard, resolveCard } from './card-spec.js';
8
+ export { CardsView } from './cards-view.js';
9
+ export { ModelView } from './model-view.js';
@@ -1,7 +1,7 @@
1
1
  import { type ComponentType } from 'react';
2
- import { type DynamicTableProps } from '../dynamic-table';
3
- import { type SavedViewsAdapter } from './saved-views';
4
- import type { CardSpec, QuickFilterDef, SortSpec, ViewModeDef, ViewState } from './types';
2
+ import { type DynamicTableProps } from '../dynamic-table.js';
3
+ import { type SavedViewsAdapter } from './saved-views.js';
4
+ import type { CardSpec, QuickFilterDef, SortSpec, ViewModeDef, ViewState } from './types.js';
5
5
  export interface ModelViewRendererProps {
6
6
  model: string;
7
7
  /** Server params for the active filters — identical across modes. */
@@ -1,12 +1,12 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useCallback, useEffect, useState } from 'react';
3
- import { DynamicTable } from '../dynamic-table';
4
- import { CardsView } from './cards-view';
5
- import { parseViewState, serializeViewState, viewStateToParams } from './view-state';
6
- import { DEFAULT_MODES, useViewMode } from './use-view-mode';
7
- import { useSavedViews } from './saved-views';
8
- import { ViewSwitcher } from './view-switcher';
9
- import { ViewToolbar } from './view-toolbar';
3
+ import { DynamicTable } from '../dynamic-table.js';
4
+ import { CardsView } from './cards-view.js';
5
+ import { parseViewState, serializeViewState, viewStateToParams } from './view-state.js';
6
+ import { DEFAULT_MODES, useViewMode } from './use-view-mode.js';
7
+ import { useSavedViews } from './saved-views.js';
8
+ import { ViewSwitcher } from './view-switcher.js';
9
+ import { ViewToolbar } from './view-toolbar.js';
10
10
  function currentSearch() {
11
11
  return typeof window === 'undefined' ? '' : window.location.search;
12
12
  }
@@ -1,4 +1,4 @@
1
- import type { SavedView } from './types';
1
+ import type { SavedView } from './types.js';
2
2
  /** Pluggable persistence; default is per-user localStorage. A host can back it by the server so views follow the user across devices. */
3
3
  export interface SavedViewsAdapter {
4
4
  load(model: string): Promise<SavedView[]> | SavedView[];
@@ -1,4 +1,4 @@
1
- import type { ViewModeDef, ViewModeKey } from './types';
1
+ import type { ViewModeDef, ViewModeKey } from './types.js';
2
2
  export declare const DEFAULT_MODES: ViewModeDef[];
3
3
  /**
4
4
  * Pure precedence: URL `?view=` > preference for (model, scope) > preference for
@@ -1,4 +1,4 @@
1
- import type { QuickFilterDef, ViewState } from './types';
1
+ import type { QuickFilterDef, ViewState } from './types.js';
2
2
  export declare const EMPTY_VIEW_STATE: ViewState;
3
3
  /**
4
4
  * URL <-> ViewState. Same param names DynamicTable already reads/writes
@@ -1,4 +1,4 @@
1
- import type { ViewModeDef, ViewModeKey } from './types';
1
+ import type { ViewModeDef, ViewModeKey } from './types.js';
2
2
  export interface ViewSwitcherProps {
3
3
  modes: ViewModeDef[];
4
4
  active: ViewModeKey;
@@ -1,4 +1,4 @@
1
- import type { QuickFilterDef, SavedView, SortSpec, ViewState } from './types';
1
+ import type { QuickFilterDef, SavedView, SortSpec, ViewState } from './types.js';
2
2
  export interface ViewToolbarProps {
3
3
  state: ViewState;
4
4
  onChange: (next: ViewState) => void;
@@ -4,8 +4,8 @@ import { Bookmark, Search, X } from 'lucide-react';
4
4
  import { useTranslation } from 'react-i18next';
5
5
  import { Button, Input } from '@asteby/metacore-ui/primitives';
6
6
  import { cn } from '@asteby/metacore-ui/lib';
7
- import { useDebouncedValue } from '../use-debounced-value';
8
- import { isViewStateEmpty } from './view-state';
7
+ import { useDebouncedValue } from '../use-debounced-value.js';
8
+ import { isViewStateEmpty } from './view-state.js';
9
9
  /** Search + quick chips + counter/sort + saved views. Pure view over `state`; the shell owns it so every mode shares it. */
10
10
  export function ViewToolbar(p) {
11
11
  const { state, onChange, quickFilters = [], total, noun, sort, savedViews = [] } = p;
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import type { CalendarView } from '@asteby/metacore-sdk';
3
- import type { ViewRendererProps } from './types';
3
+ import type { ViewRendererProps } from './types.js';
4
4
  export interface CalendarEntry {
5
5
  key: string;
6
6
  title: string;
@@ -7,8 +7,8 @@ import * as React from 'react';
7
7
  import { useTranslation } from 'react-i18next';
8
8
  import { ChevronLeft, ChevronRight } from 'lucide-react';
9
9
  import { Badge, Button } from '@asteby/metacore-ui/primitives';
10
- import { dayKey, displayValue, toDate } from './data-source';
11
- import { ViewSkeleton } from './skeleton';
10
+ import { dayKey, displayValue, toDate } from './data-source.js';
11
+ import { ViewSkeleton } from './skeleton.js';
12
12
  const MAX_ROWS = 500;
13
13
  /** First and last calendar day of the month containing `d` (`YYYY-MM-DD`). */
14
14
  export function monthRange(d) {
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
- import type { WidgetData } from '../dashboard-types';
3
- import type { ChartRequest, PanelRendererProps, ViewDataSource, ViewRendererProps } from './types';
2
+ import type { WidgetData } from '../dashboard-types.js';
3
+ import type { ChartRequest, PanelRendererProps, ViewDataSource, ViewRendererProps } from './types.js';
4
4
  /** Load one declared chart; exposes loading/error so tests and hosts can assert. */
5
5
  export declare function useChartData(data: ViewDataSource, req: ChartRequest | null): {
6
6
  loading: boolean;
@@ -5,8 +5,8 @@ import { jsx as _jsx } from "react/jsx-runtime";
5
5
  // the only place views reach recharts (through ../widgets/charts).
6
6
  import * as React from 'react';
7
7
  import { useTranslation } from 'react-i18next';
8
- import { AreaWidget, BarWidget, DonutWidget, LineWidget, PieWidget } from '../widgets/charts';
9
- import { ViewSkeleton } from './skeleton';
8
+ import { AreaWidget, BarWidget, DonutWidget, LineWidget, PieWidget } from '../widgets/charts.js';
9
+ import { ViewSkeleton } from './skeleton.js';
10
10
  const BY_KIND = {
11
11
  bar: BarWidget,
12
12
  line: LineWidget,
@@ -1,5 +1,5 @@
1
- import type { ApiClient } from '../api-context';
2
- import type { ViewDataSource } from './types';
1
+ import type { ApiClient } from '../api-context.js';
2
+ import type { ViewDataSource } from './types.js';
3
3
  export interface ApiViewDataSourceOptions {
4
4
  /**
5
5
  * Endpoint the host serves declared view/panel charts on (`POST`, body
@@ -1,4 +1,4 @@
1
- export type { DeclarativeViewType, DeclarativeViewConfig, ViewDataSource, ViewRows, ViewListParams, ChartRequest, ViewRendererProps, PanelRendererProps, ViewRendererComponent, PanelRendererComponent, ViewRendererLoader, PanelRendererLoader, } from './types';
2
- export { DECLARATIVE_VIEW_TYPES, isDeclarativeViewType, registerViewRenderer, registerPanelRenderer, hasViewRenderer, hasPanelRenderer, preloadViewRenderer, DeclarativeView, DetailPanels, ViewSkeleton, type DeclarativeViewProps, type DetailPanelsProps, } from './registry';
3
- export { createApiViewDataSource, resolveCapabilityInput, pickItems, type ApiViewDataSourceOptions, } from './data-source';
1
+ export type { DeclarativeViewType, DeclarativeViewConfig, ViewDataSource, ViewRows, ViewListParams, ChartRequest, ViewRendererProps, PanelRendererProps, ViewRendererComponent, PanelRendererComponent, ViewRendererLoader, PanelRendererLoader, } from './types.js';
2
+ export { DECLARATIVE_VIEW_TYPES, isDeclarativeViewType, registerViewRenderer, registerPanelRenderer, hasViewRenderer, hasPanelRenderer, preloadViewRenderer, DeclarativeView, DetailPanels, ViewSkeleton, type DeclarativeViewProps, type DetailPanelsProps, } from './registry.js';
3
+ export { createApiViewDataSource, resolveCapabilityInput, pickItems, type ApiViewDataSourceOptions, } from './data-source.js';
4
4
  //# sourceMappingURL=index.d.ts.map
@@ -1,2 +1,2 @@
1
- export { DECLARATIVE_VIEW_TYPES, isDeclarativeViewType, registerViewRenderer, registerPanelRenderer, hasViewRenderer, hasPanelRenderer, preloadViewRenderer, DeclarativeView, DetailPanels, ViewSkeleton, } from './registry';
2
- export { createApiViewDataSource, resolveCapabilityInput, pickItems, } from './data-source';
1
+ export { DECLARATIVE_VIEW_TYPES, isDeclarativeViewType, registerViewRenderer, registerPanelRenderer, hasViewRenderer, hasPanelRenderer, preloadViewRenderer, DeclarativeView, DetailPanels, ViewSkeleton, } from './registry.js';
2
+ export { createApiViewDataSource, resolveCapabilityInput, pickItems, } from './data-source.js';
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import type { MapPoint, MapView } from '@asteby/metacore-sdk';
3
- import type { PanelRendererProps, ViewRendererProps } from './types';
3
+ import type { PanelRendererProps, ViewRendererProps } from './types.js';
4
4
  export interface MapFeature {
5
5
  key: string;
6
6
  lat: number;
@@ -10,9 +10,9 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
10
10
  import * as React from 'react';
11
11
  import { useTranslation } from 'react-i18next';
12
12
  import { MapPin } from 'lucide-react';
13
- import { buildRelationFilterParams } from '../dynamic-relation-helpers';
14
- import { displayValue } from './data-source';
15
- import { ViewSkeleton } from './skeleton';
13
+ import { buildRelationFilterParams } from '../dynamic-relation-helpers.js';
14
+ import { displayValue } from './data-source.js';
15
+ import { ViewSkeleton } from './skeleton.js';
16
16
  const MAX_FEATURES = 500;
17
17
  function num(v) {
18
18
  const n = typeof v === 'number' ? v : typeof v === 'string' && v.trim() !== '' ? Number(v) : NaN;
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import type { PanelRendererProps } from './types';
2
+ import type { PanelRendererProps } from './types.js';
3
3
  export type StatFormat = 'number' | 'currency' | 'percent' | 'compact' | 'date' | 'datetime' | 'relative_date';
4
4
  /** Pure: format one stat value for display. `now` is injectable for tests. */
5
5
  export declare function formatStat(value: unknown, format: string | undefined, opts?: {
@@ -4,10 +4,10 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
4
4
  // `limit` rows), a stats panel formats a few of the record's own fields.
5
5
  import * as React from 'react';
6
6
  import { useTranslation } from 'react-i18next';
7
- import { buildRelationFilterParams } from '../dynamic-relation-helpers';
8
- import { displayValue, toDate } from './data-source';
7
+ import { buildRelationFilterParams } from '../dynamic-relation-helpers.js';
8
+ import { displayValue, toDate } from './data-source.js';
9
9
  import { formatAmount } from '@asteby/metacore-lib';
10
- import { ViewSkeleton } from './skeleton';
10
+ import { ViewSkeleton } from './skeleton.js';
11
11
  /** Pure: format one stat value for display. `now` is injectable for tests. */
12
12
  export function formatStat(value, format, opts = {}) {
13
13
  if (value === null || value === undefined || value === '')
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import type { DetailPanel, NavView } from '@asteby/metacore-sdk';
3
- import type { DeclarativeViewType, PanelRendererLoader, PanelRendererProps, ViewRendererLoader, ViewRendererProps } from './types';
4
- import { ViewSkeleton } from './skeleton';
3
+ import type { DeclarativeViewType, PanelRendererLoader, PanelRendererProps, ViewRendererLoader, ViewRendererProps } from './types.js';
4
+ import { ViewSkeleton } from './skeleton.js';
5
5
  export { ViewSkeleton };
6
6
  export declare const DECLARATIVE_VIEW_TYPES: readonly DeclarativeViewType[];
7
7
  export declare function isDeclarativeViewType(t: string | undefined | null): t is DeclarativeViewType;
@@ -16,8 +16,8 @@ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-run
16
16
  // `custom` panels (level C, a federated component) have no built-in: the host
17
17
  // registers one that mounts the addon's expose.
18
18
  import * as React from 'react';
19
- import { FederatedErrorBoundary } from '../federated-error-boundary';
20
- import { ViewSkeleton } from './skeleton';
19
+ import { FederatedErrorBoundary } from '../federated-error-boundary.js';
20
+ import { ViewSkeleton } from './skeleton.js';
21
21
  export { ViewSkeleton };
22
22
  export const DECLARATIVE_VIEW_TYPES = [
23
23
  'map',
@@ -30,18 +30,18 @@ export function isDeclarativeViewType(t) {
30
30
  return !!t && DECLARATIVE_VIEW_TYPES.includes(t);
31
31
  }
32
32
  const viewLoaders = new Map([
33
- ['chart', () => import('./chart-view')],
34
- ['timeline', () => import('./timeline-view')],
35
- ['calendar', () => import('./calendar-view')],
36
- ['split', () => import('./split-view')],
37
- ['map', () => import('./map-view')],
33
+ ['chart', () => import('./chart-view.js')],
34
+ ['timeline', () => import('./timeline-view.js')],
35
+ ['calendar', () => import('./calendar-view.js')],
36
+ ['split', () => import('./split-view.js')],
37
+ ['map', () => import('./map-view.js')],
38
38
  ]);
39
39
  const panelLoaders = new Map([
40
- ['chart', () => import('./chart-view').then((m) => ({ default: m.ChartPanel }))],
41
- ['timeline', () => import('./timeline-view').then((m) => ({ default: m.TimelinePanel }))],
42
- ['map', () => import('./map-view').then((m) => ({ default: m.MapPanel }))],
43
- ['relation', () => import('./panels').then((m) => ({ default: m.RelationPanelView }))],
44
- ['stats', () => import('./panels').then((m) => ({ default: m.StatsPanelView }))],
40
+ ['chart', () => import('./chart-view.js').then((m) => ({ default: m.ChartPanel }))],
41
+ ['timeline', () => import('./timeline-view.js').then((m) => ({ default: m.TimelinePanel }))],
42
+ ['map', () => import('./map-view.js').then((m) => ({ default: m.MapPanel }))],
43
+ ['relation', () => import('./panels.js').then((m) => ({ default: m.RelationPanelView }))],
44
+ ['stats', () => import('./panels.js').then((m) => ({ default: m.StatsPanelView }))],
45
45
  ]);
46
46
  const lazyViews = new Map();
47
47
  const lazyPanels = new Map();
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import type { ViewRendererProps } from './types';
2
+ import type { ViewRendererProps } from './types.js';
3
3
  /** Pure: which metadata columns to hide so the list shows only `columns`. */
4
4
  export declare function hiddenColumnsFor(allColumns: string[], columns: string[] | undefined): string[];
5
5
  export default function SplitViewRenderer(props: ViewRendererProps<'split'>): React.JSX.Element;
@@ -7,10 +7,10 @@ import * as React from 'react';
7
7
  import { useTranslation } from 'react-i18next';
8
8
  import { X } from 'lucide-react';
9
9
  import { Button } from '@asteby/metacore-ui/primitives';
10
- import { DynamicTable } from '../dynamic-table';
11
- import { DetailPanels } from './registry';
12
- import { displayValue } from './data-source';
13
- import { ViewSkeleton } from './skeleton';
10
+ import { DynamicTable } from '../dynamic-table.js';
11
+ import { DetailPanels } from './registry.js';
12
+ import { displayValue } from './data-source.js';
13
+ import { ViewSkeleton } from './skeleton.js';
14
14
  /** Pure: which metadata columns to hide so the list shows only `columns`. */
15
15
  export function hiddenColumnsFor(allColumns, columns) {
16
16
  if (!columns || columns.length === 0)
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import type { TimelineView } from '@asteby/metacore-sdk';
3
- import type { PanelRendererProps, ViewRendererProps } from './types';
3
+ import type { PanelRendererProps, ViewRendererProps } from './types.js';
4
4
  export interface TimelineEntry {
5
5
  key: string;
6
6
  at: Date | null;
@@ -6,9 +6,9 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
6
6
  import * as React from 'react';
7
7
  import { useTranslation } from 'react-i18next';
8
8
  import { Badge, Button } from '@asteby/metacore-ui/primitives';
9
- import { buildRelationFilterParams } from '../dynamic-relation-helpers';
10
- import { displayValue, pickItems, resolveCapabilityInput, sortByDate, toDate, } from './data-source';
11
- import { ViewSkeleton } from './skeleton';
9
+ import { buildRelationFilterParams } from '../dynamic-relation-helpers.js';
10
+ import { displayValue, pickItems, resolveCapabilityInput, sortByDate, toDate, } from './data-source.js';
11
+ import { ViewSkeleton } from './skeleton.js';
12
12
  const PAGE = 50;
13
13
  /** Pure: rows → ordered entries (newest first), grouped when `group_by` is set. */
14
14
  export function toTimelineEntries(rows, view) {
@@ -1,7 +1,7 @@
1
1
  import type { ComponentType } from 'react';
2
2
  import type { CalendarView, ChartView, DetailPanel, MapView, SplitView, TimelineView, WidgetQuery } from '@asteby/metacore-sdk';
3
- import type { TableMetadata } from '../types';
4
- import type { WidgetData } from '../dashboard-types';
3
+ import type { TableMetadata } from '../types.js';
4
+ import type { WidgetData } from '../dashboard-types.js';
5
5
  /** `view_type` values rendered by a declarative renderer (table/kanban excluded). */
6
6
  export type DeclarativeViewType = 'map' | 'timeline' | 'calendar' | 'chart' | 'split';
7
7
  /** Block of `NavView` each type reads. */
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { type WidgetRenderProps } from './renderers';
2
+ import { type WidgetRenderProps } from './renderers.js';
3
3
  export type { WidgetRenderProps };
4
4
  export declare function BarWidget(p: WidgetRenderProps): React.JSX.Element;
5
5
  export declare function LineWidget(p: WidgetRenderProps): React.JSX.Element;
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { AreaChartBody, BarChartBody, DonutChartBody, LineChartBody, PieChartBody, } from '@asteby/metacore-charts/recharts';
3
- import { WidgetCard, WidgetEmpty } from './widget-card';
4
- import { hasSeries } from './renderers';
3
+ import { WidgetCard, WidgetEmpty } from './widget-card.js';
4
+ import { hasSeries } from './renderers.js';
5
5
  function ChartWidget(p) {
6
6
  const { Body } = p;
7
7
  return (_jsx(WidgetCard, { "data-testid": `widget-${p.spec.key}`, title: p.spec.title, subtitle: p.spec.subtitle, icon: p.spec.icon, accent: p.spec.accent, children: hasSeries(p.data) ? (_jsx(Body, { series: p.data.series, accent: p.spec.accent, format: p.spec.format, locale: p.locale, currency: p.currency, id: p.spec.key })) : (_jsx(WidgetEmpty, { message: p.emptyText })) }));
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import type { WidgetRenderProps } from './renderers';
2
+ import type { WidgetRenderProps } from './renderers.js';
3
3
  /** Warm the charts chunk (e.g. on hover of a dashboard link). Idempotent. */
4
4
  export declare function preloadWidgetCharts(): Promise<unknown>;
5
5
  export declare const BarWidget: (p: WidgetRenderProps) => React.JSX.Element;
@@ -4,8 +4,8 @@ import { jsx as _jsx } from "react/jsx-runtime";
4
4
  // async chunk: it downloads only when a dashboard actually renders a
5
5
  // bar/line/area/pie/donut widget. Public names stay the same as before.
6
6
  import * as React from 'react';
7
- import { WidgetCard } from './widget-card';
8
- const loadCharts = () => import('./charts');
7
+ import { WidgetCard } from './widget-card.js';
8
+ const loadCharts = () => import('./charts.js');
9
9
  /** Warm the charts chunk (e.g. on hover of a dashboard link). Idempotent. */
10
10
  export function preloadWidgetCharts() {
11
11
  return loadCharts();
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
- import type { DashboardWidgetSpec, WidgetData } from '../dashboard-types';
3
- import { type WidgetFormatCtx } from './widget-format';
2
+ import type { DashboardWidgetSpec, WidgetData } from '../dashboard-types.js';
3
+ import { type WidgetFormatCtx } from './widget-format.js';
4
4
  export interface WidgetRenderProps {
5
5
  spec: DashboardWidgetSpec;
6
6
  data?: WidgetData;
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { cn } from '@asteby/metacore-ui/lib';
3
- import { WidgetCard, DeltaChip, WidgetEmpty } from './widget-card';
4
- import { accentClasses, formatWidgetValue, formatDelta, } from './widget-format';
3
+ import { WidgetCard, DeltaChip, WidgetEmpty } from './widget-card.js';
4
+ import { accentClasses, formatWidgetValue, formatDelta, } from './widget-format.js';
5
5
  export const fmtCtx = (spec, locale, currency) => ({ format: spec.format, locale, currency });
6
6
  export const hasSeries = (d) => Array.isArray(d?.series) && d.series.length > 0;
7
7
  // --- stat -----------------------------------------------------------------
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import type { WidgetAccent } from '../dashboard-types';
2
+ import type { WidgetAccent } from '../dashboard-types.js';
3
3
  export interface WidgetCardProps {
4
4
  title: string;
5
5
  subtitle?: string;
@@ -1,8 +1,8 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Card, CardContent, CardHeader } from '@asteby/metacore-ui';
3
3
  import { cn } from '@asteby/metacore-ui/lib';
4
- import { DynamicIcon, isLucideIconName } from '../dynamic-icon';
5
- import { accentClasses } from './widget-format';
4
+ import { DynamicIcon, isLucideIconName } from '../dynamic-icon.js';
5
+ import { accentClasses } from './widget-format.js';
6
6
  /**
7
7
  * The card frame shared by all widgets. Keep the chrome here so a single style
8
8
  * change propagates to every kind (and to federated custom widgets).
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import type { DashboardWidgetSpec, WidgetData, WidgetSize } from '../dashboard-types';
2
+ import type { DashboardWidgetSpec, WidgetData, WidgetSize } from '../dashboard-types.js';
3
3
  /** Maps a widget size to its column span in the 4-col grid. */
4
4
  export declare const SIZE_SPAN: Record<WidgetSize, number>;
5
5
  /** Tailwind col-span class per size (static → scanned in this package build).
@@ -3,10 +3,10 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  // federated <Slot> for kind:"custom"), wrapped in an error boundary so a single
4
4
  // broken widget renders its own error card instead of tumbling the grid.
5
5
  import * as React from 'react';
6
- import { Slot } from '../slot';
7
- import { WidgetCard, WidgetError } from './widget-card';
8
- import { StatWidget, ListWidget, ProgressWidget, } from './renderers';
9
- import { BarWidget, LineWidget, AreaWidget, PieWidget, DonutWidget, } from './lazy-charts';
6
+ import { Slot } from '../slot.js';
7
+ import { WidgetCard, WidgetError } from './widget-card.js';
8
+ import { StatWidget, ListWidget, ProgressWidget, } from './renderers.js';
9
+ import { BarWidget, LineWidget, AreaWidget, PieWidget, DonutWidget, } from './lazy-charts.js';
10
10
  /** Maps a widget size to its column span in the 4-col grid. */
11
11
  export const SIZE_SPAN = {
12
12
  sm: 1,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@asteby/metacore-runtime-react",
3
- "version": "53.25.0",
3
+ "version": "53.26.0",
4
4
  "description": "React runtime for metacore hosts — renders addon contributions dynamically",
5
5
  "repository": {
6
6
  "type": "git",
@@ -38,7 +38,7 @@
38
38
  },
39
39
  "dependencies": {
40
40
  "@asteby/metacore-charts": "^0.1.2",
41
- "@asteby/metacore-lib": "^0.12.0",
41
+ "@asteby/metacore-lib": "^0.12.1",
42
42
  "@dnd-kit/core": "^6.3.0",
43
43
  "@dnd-kit/sortable": "^10.0.0",
44
44
  "@dnd-kit/utilities": "^3.2.2",
@@ -47,8 +47,8 @@
47
47
  "zod": "^4.3.0"
48
48
  },
49
49
  "peerDependencies": {
50
- "@asteby/metacore-sdk": "^3.21.0",
51
- "@asteby/metacore-ui": "^2.37.0",
50
+ "@asteby/metacore-sdk": "^3.22.0",
51
+ "@asteby/metacore-ui": "^2.37.1",
52
52
  "@tanstack/react-query": ">=5",
53
53
  "@tanstack/react-router": ">=1.100",
54
54
  "@tanstack/react-table": ">=8",
@@ -63,7 +63,7 @@
63
63
  "zustand": ">=5",
64
64
  "@module-federation/runtime": ">=2.5",
65
65
  "@testing-library/react": ">=14",
66
- "@asteby/metacore-genui": "^2.9.2"
66
+ "@asteby/metacore-genui": "^2.9.3"
67
67
  },
68
68
  "peerDependenciesMeta": {
69
69
  "@tanstack/react-router": {
@@ -83,8 +83,8 @@
83
83
  }
84
84
  },
85
85
  "devDependencies": {
86
- "@asteby/metacore-sdk": "3.21.0",
87
- "@asteby/metacore-ui": "2.37.0",
86
+ "@asteby/metacore-sdk": "3.22.0",
87
+ "@asteby/metacore-ui": "2.37.1",
88
88
  "@tanstack/react-query": "^5.95.0",
89
89
  "@tanstack/react-router": "^1.168.0",
90
90
  "@tanstack/react-table": "^8.20.0",
@@ -105,10 +105,10 @@
105
105
  "vitest": "^4.0.0",
106
106
  "zustand": "^5.0.0",
107
107
  "@module-federation/runtime": "^2.5.0",
108
- "@asteby/metacore-genui": "2.9.2"
108
+ "@asteby/metacore-genui": "2.9.3"
109
109
  },
110
110
  "scripts": {
111
- "build": "tsc -p tsconfig.json",
111
+ "build": "tsc -p tsconfig.json && node ../../scripts/fix-dist-esm-imports.mjs",
112
112
  "dev": "tsc -w -p tsconfig.json",
113
113
  "typecheck": "tsc -p tsconfig.json --noEmit",
114
114
  "test": "vitest run",
@@ -117,3 +117,19 @@ describe('useHostApiClient', () => {
117
117
  spy.mockRestore()
118
118
  })
119
119
  })
120
+
121
+ describe('request headers', () => {
122
+ it('merges defaultHeaders with per-call headers (per-call wins) and passes them to the HostApi', async () => {
123
+ const get = vi.fn(async () => ({ ok: 1 }))
124
+ const c = createHostApiClient(stub({ get: get as never }), { defaultHeaders: { 'X-A': '1', 'X-B': '1' } })
125
+ await c.get('/x', { headers: { 'X-B': '2', 'X-Correlation-ID': 'cid' } })
126
+ expect(get).toHaveBeenCalledWith('/x', { headers: { 'X-A': '1', 'X-B': '2', 'X-Correlation-ID': 'cid' } })
127
+ })
128
+
129
+ it('is additive: no headers means the config is untouched', async () => {
130
+ const post = vi.fn(async () => ({}))
131
+ const c = createHostApiClient(stub({ post: post as never }))
132
+ await c.post('/x', { a: 1 })
133
+ expect(post).toHaveBeenCalledWith('/x', { a: 1 }, undefined)
134
+ })
135
+ })
@@ -151,3 +151,53 @@ describe('createHostApi', () => {
151
151
  expect(e.message).toBe('Network error')
152
152
  })
153
153
  })
154
+
155
+ describe('createHostApi remote headers', () => {
156
+ it('forwards extra headers but never lets a remote override host-owned ones', async () => {
157
+ const client = axiosLike()
158
+ const api = createHostApi(client)
159
+ await api.post('/data/sales', { a: 1 }, {
160
+ headers: {
161
+ 'X-Correlation-ID': 'cid-1',
162
+ Authorization: 'Bearer evil',
163
+ authorization: 'Bearer evil',
164
+ 'X-Organization-ID': 'other-org',
165
+ 'x-organization-id': 'other-org',
166
+ 'X-Branch-ID': '9',
167
+ 'Accept-Language': 'xx',
168
+ Cookie: 'a=b',
169
+ 'X-Bad': 'a\r\nInjected: 1',
170
+ },
171
+ })
172
+ expect(client.post).toHaveBeenCalledWith('/data/sales', { a: 1 }, { headers: { 'X-Correlation-ID': 'cid-1' } })
173
+ await api.get('/x', { headers: { Authorization: 'Bearer evil' } })
174
+ expect(client.get).toHaveBeenLastCalledWith('/x', {})
175
+ })
176
+
177
+ it('also protects forwarding/identity headers and Proxy-*', async () => {
178
+ const client = axiosLike()
179
+ await createHostApi(client).get('/x', {
180
+ headers: {
181
+ 'X-Forwarded-Host': 'evil.example',
182
+ 'X-Forwarded-Proto': 'http',
183
+ 'X-Forwarded-For': '1.1.1.1',
184
+ Forwarded: 'for=1.1.1.1',
185
+ 'X-Real-IP': '1.1.1.1',
186
+ 'X-Storefront-Domain': 'evil.example',
187
+ 'X-API-Key': 'k',
188
+ 'X-HTTP-Method-Override': 'DELETE',
189
+ 'Proxy-Foo': 'x',
190
+ 'X-Correlation-ID': 'ok',
191
+ },
192
+ })
193
+ expect(client.get).toHaveBeenLastCalledWith('/x', { headers: { 'X-Correlation-ID': 'ok' } })
194
+ })
195
+
196
+ it('batchGets: a GET with per-call headers is not grouped into POST /q', async () => {
197
+ const client = axiosLike()
198
+ const api = createHostApi(client, { batchGets: true })
199
+ await api.get('/data/Shipment', { headers: { 'X-Correlation-ID': 'c1' } })
200
+ expect(client.get).toHaveBeenCalledWith('/data/Shipment', { headers: { 'X-Correlation-ID': 'c1' } })
201
+ expect(client.post).not.toHaveBeenCalled()
202
+ })
203
+ })