@phis/ui 0.8.0 → 0.8.2

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 (304) hide show
  1. package/README.md +9 -2
  2. package/components/cms/phi-cms-layout-renderer.js +15 -7
  3. package/components/cms/phi-cms-render-diagnostic-client.d.ts +3 -1
  4. package/components/cms/phi-cms-render-diagnostic-client.js +4 -3
  5. package/components/cms/phi-cms-render-diagnostic.d.ts +8 -2
  6. package/components/cms/phi-cms-render-diagnostic.js +12 -2
  7. package/components/cms/phi-cms-render-error-boundary.d.ts +2 -0
  8. package/components/cms/phi-cms-render-error-boundary.js +1 -1
  9. package/components/cms/phi-cms-root-layout.js +3 -1
  10. package/components/controls/phi-media-picker-control.d.ts +9 -0
  11. package/components/controls/phi-media-picker-control.js +1 -1
  12. package/components/controls/phi-popover-control.js +4 -1
  13. package/components/controls/phi-table-control.d.ts +7 -1
  14. package/components/controls/phi-table-control.js +26 -11
  15. package/components/forms/form-descriptor-field-check.d.ts +18 -0
  16. package/components/forms/form-descriptor-field-check.js +41 -0
  17. package/components/forms/form-descriptor-runtime-client.js +11 -10
  18. package/components/forms/form-record-source.d.ts +38 -0
  19. package/components/forms/form-record-source.js +48 -0
  20. package/components/forms/shared-form-descriptors.d.ts +0 -34
  21. package/components/forms/shared-form-descriptors.js +0 -6
  22. package/components/forms/shared-form-ids.d.ts +1 -1
  23. package/components/forms/shared-form-ids.js +1 -1
  24. package/components/media/media-settings-labels.d.ts +1 -0
  25. package/components/media/media-settings-labels.js +2 -0
  26. package/components/media/media-upload-flow.d.ts +62 -5
  27. package/components/media/media-upload-flow.js +62 -24
  28. package/components/media/phi-area-upload-widget.d.ts +44 -1
  29. package/components/media/phi-area-upload-widget.js +32 -7
  30. package/components/media/phi-media-picker-binding.d.ts +41 -33
  31. package/components/media/phi-media-picker-binding.js +2 -1
  32. package/components/media/phi-media-upload.d.ts +10 -3
  33. package/components/media/phi-media-upload.js +11 -8
  34. package/components/media/use-media-library-add-picker.d.ts +33 -32
  35. package/components/overlays/phi-overlay-container-client.js +11 -9
  36. package/components/regions/presets/phi-settings-page-shell-tree.d.ts +7 -0
  37. package/components/regions/presets/phi-settings-page-shell-tree.js +3 -3
  38. package/components/shell/phi-icon-names.d.ts +3 -0
  39. package/components/shell/phi-icon-names.js +3 -0
  40. package/components/shell/phi-icon.d.ts +5 -7
  41. package/components/shell/phi-icon.js +8 -21
  42. package/components/shell/phi-widget-icon.js +1 -0
  43. package/components/tables/client/phi-table-binding-params.d.ts +24 -0
  44. package/components/tables/client/phi-table-binding-params.js +39 -0
  45. package/components/tables/client/phi-table-binding.d.ts +1 -3
  46. package/components/tables/client/phi-table-binding.js +5 -9
  47. package/components/widgets/client/html-editor-link-node.d.ts +12 -0
  48. package/components/widgets/client/html-editor-link-node.js +60 -0
  49. package/components/widgets/client/html-editor.js +10 -6
  50. package/components/widgets/client/shared/phi-button-icons.d.ts +6 -4
  51. package/components/widgets/client/shared/phi-button-icons.js +8 -12
  52. package/components/widgets/client/shared/phi-collection-binding-params.d.ts +8 -0
  53. package/components/widgets/client/shared/phi-collection-binding-params.js +13 -0
  54. package/components/widgets/client/shared/phi-collection-provider.d.ts +11 -1
  55. package/components/widgets/client/shared/phi-collection-provider.js +5 -0
  56. package/components/widgets/client/shared/phi-collection-view-binding.d.ts +1 -0
  57. package/components/widgets/client/shared/phi-collection-view-binding.js +33 -26
  58. package/components/widgets/client/shared/phi-command-buttons.d.ts +16 -0
  59. package/components/widgets/client/shared/phi-command-buttons.js +9 -1
  60. package/components/widgets/label-sets/admin-users.d.ts +1 -0
  61. package/components/widgets/label-sets/admin-users.js +2 -0
  62. package/components/widgets/label-sets/builder-modules.js +4 -0
  63. package/components/widgets/label-sets/profile.d.ts +0 -16
  64. package/components/widgets/label-sets/profile.js +0 -37
  65. package/components/widgets/label-sets/registration.d.ts +0 -1
  66. package/components/widgets/label-sets/registration.js +0 -2
  67. package/components/widgets/label-sets/revisions.js +2 -0
  68. package/components/widgets/label-sets/signals.js +2 -0
  69. package/components/widgets/label-types/builder-modules.d.ts +4 -0
  70. package/components/widgets/label-types/builder-modules.js +2 -0
  71. package/components/widgets/label-types/revisions.d.ts +2 -0
  72. package/components/widgets/label-types/revisions.js +2 -1
  73. package/components/widgets/label-types/signals.d.ts +2 -0
  74. package/components/widgets/label-types/signals.js +1 -0
  75. package/components/widgets/shared/widget-failure-audience.d.ts +7 -0
  76. package/components/widgets/shared/widget-failure-audience.js +21 -0
  77. package/components/widgets/shared/widget-failure-client.js +5 -2
  78. package/components/widgets/shared/widget-failure-notice-client.d.ts +6 -0
  79. package/components/widgets/shared/widget-failure-notice-client.js +10 -0
  80. package/components/widgets/shared/widget-failure-notice.d.ts +6 -0
  81. package/components/widgets/shared/widget-failure-notice.js +17 -0
  82. package/components/widgets/shared/widget-failure-staff.d.ts +3 -0
  83. package/components/widgets/shared/widget-failure-staff.js +18 -0
  84. package/components/widgets/shared/widget-failure.d.ts +9 -6
  85. package/components/widgets/shared/widget-failure.js +0 -9
  86. package/components/widgets/shared/widget-failure.server.d.ts +4 -2
  87. package/components/widgets/shared/widget-failure.server.js +8 -3
  88. package/constants/cms-widget-types.d.ts +1 -0
  89. package/constants/cms-widget-types.js +3 -0
  90. package/constants/customer-file.d.ts +12 -3
  91. package/constants/customer-file.js +12 -3
  92. package/constants/runtime-module-ownership.js +5 -3
  93. package/constants/site-address.d.ts +9 -0
  94. package/constants/site-address.js +10 -0
  95. package/constants/table-loading.d.ts +14 -0
  96. package/constants/table-loading.js +14 -0
  97. package/constants.d.ts +2 -1
  98. package/constants.js +3 -1
  99. package/gateway/site-cms-write-validation.js +19 -3
  100. package/gateway/site-proxy.d.ts +12 -0
  101. package/gateway/site-proxy.js +20 -0
  102. package/helpers/announced-action.d.ts +17 -0
  103. package/helpers/announced-action.js +29 -0
  104. package/helpers/phi-metadata.d.ts +0 -8
  105. package/helpers/phi-metadata.js +1 -10
  106. package/helpers/phi-site-description.d.ts +11 -0
  107. package/helpers/phi-site-description.js +13 -0
  108. package/helpers/preset-form-check.d.ts +14 -0
  109. package/helpers/preset-form-check.js +12 -0
  110. package/helpers/preset-table-check.d.ts +19 -15
  111. package/helpers/preset-table-check.js +33 -39
  112. package/helpers/record-widget-binding.d.ts +10 -0
  113. package/helpers/record-widget-binding.js +35 -0
  114. package/helpers/record-widget.d.ts +1 -10
  115. package/helpers/record-widget.js +4 -33
  116. package/helpers/table-widget-binding.d.ts +12 -0
  117. package/helpers/table-widget-binding.js +296 -0
  118. package/helpers/tree-widget-binding.d.ts +19 -0
  119. package/helpers/tree-widget-binding.js +72 -0
  120. package/helpers/typed-confirmation.d.ts +9 -0
  121. package/helpers/typed-confirmation.js +13 -0
  122. package/helpers/widget-binding-check.d.ts +22 -0
  123. package/helpers/widget-binding-check.js +91 -0
  124. package/module-page-check.d.ts +2 -0
  125. package/module-page-check.js +2 -0
  126. package/net/phi-next-proxy.d.ts +7 -0
  127. package/net/phi-next-proxy.js +1 -1
  128. package/next/root-route.js +2 -1
  129. package/package.json +27 -14
  130. package/plugins/runtime-modules/accounting/ids.d.ts +7 -4
  131. package/plugins/runtime-modules/accounting/ids.js +14 -3
  132. package/plugins/runtime-modules/accounting/trees/accounting-customer-file-label-set.d.ts +21 -9
  133. package/plugins/runtime-modules/accounting/trees/accounting-customer-file-label-set.js +29 -15
  134. package/plugins/runtime-modules/accounting/trees/phi-default-accounting-customer-file-page-tree.d.ts +11 -8
  135. package/plugins/runtime-modules/accounting/trees/phi-default-accounting-customer-file-page-tree.js +206 -137
  136. package/plugins/runtime-modules/app/client-data-providers.js +1 -1
  137. package/plugins/runtime-modules/app/data-providers.d.ts +14 -69
  138. package/plugins/runtime-modules/app/data-providers.js +19 -54
  139. package/plugins/runtime-modules/app/definition.d.ts +8 -80
  140. package/plugins/runtime-modules/app/forms.d.ts +1 -16
  141. package/plugins/runtime-modules/app/forms.js +0 -59
  142. package/plugins/runtime-modules/app/ids.d.ts +2 -1
  143. package/plugins/runtime-modules/app/ids.js +3 -2
  144. package/plugins/runtime-modules/app/module.d.ts +8 -80
  145. package/plugins/runtime-modules/app/services/addresses-collection.d.ts +59 -0
  146. package/plugins/runtime-modules/app/services/{addresses-table.js → addresses-collection.js} +23 -19
  147. package/plugins/runtime-modules/app/trees/account-addresses-panel.d.ts +10 -6
  148. package/plugins/runtime-modules/app/trees/account-addresses-panel.js +37 -73
  149. package/plugins/runtime-modules/app/trees/addresses-label-set.d.ts +0 -5
  150. package/plugins/runtime-modules/app/trees/addresses-label-set.js +2 -6
  151. package/plugins/runtime-modules/app/trees/phi-default-app-profile-page-tree.d.ts +1 -2
  152. package/plugins/runtime-modules/app/trees/phi-default-app-profile-page-tree.js +1 -17
  153. package/plugins/runtime-modules/app/trees/profile-label-set.d.ts +0 -2
  154. package/plugins/runtime-modules/app/trees/profile-label-set.js +2 -14
  155. package/plugins/runtime-modules/area-contributions/admin.d.ts +1 -1
  156. package/plugins/runtime-modules/area-contributions/admin.js +2 -0
  157. package/plugins/runtime-modules/asset/trees/phi-default-admin-media-settings-page-tree.js +5 -0
  158. package/plugins/runtime-modules/avatar/addresses.d.ts +1 -1
  159. package/plugins/runtime-modules/builder/clients/inspector-config-field.js +16 -6
  160. package/plugins/runtime-modules/builder/clients/inspector-image-field.js +3 -1
  161. package/plugins/runtime-modules/builder/clients/inspector-section-widget.js +3 -1
  162. package/plugins/runtime-modules/builder/controller/signal-wiring-controller.js +5 -1
  163. package/plugins/runtime-modules/builder/signal-wiring-options.js +9 -2
  164. package/plugins/runtime-modules/builder/trees/phi-builder-inspector-area-overlay-tree.server.js +5 -0
  165. package/plugins/runtime-modules/builder/trees/phi-default-builder-area-preset-tree.js +14 -1
  166. package/plugins/runtime-modules/cdn/authoring-widgets.d.ts +3 -0
  167. package/plugins/runtime-modules/cdn/authoring-widgets.js +7 -0
  168. package/plugins/runtime-modules/cdn/authoring.d.ts +1 -0
  169. package/plugins/runtime-modules/cdn/authoring.js +8 -0
  170. package/plugins/runtime-modules/cdn/bytes.d.ts +5 -0
  171. package/plugins/runtime-modules/cdn/bytes.js +17 -0
  172. package/plugins/runtime-modules/cdn/client-data-providers.d.ts +7 -0
  173. package/plugins/runtime-modules/cdn/client-data-providers.js +9 -0
  174. package/plugins/runtime-modules/cdn/data-providers.d.ts +134 -0
  175. package/plugins/runtime-modules/cdn/data-providers.js +117 -0
  176. package/plugins/runtime-modules/cdn/definition.d.ts +140 -0
  177. package/plugins/runtime-modules/cdn/definition.js +23 -0
  178. package/plugins/runtime-modules/cdn/ids.d.ts +18 -0
  179. package/plugins/runtime-modules/cdn/ids.js +20 -0
  180. package/plugins/runtime-modules/cdn/module.d.ts +131 -0
  181. package/plugins/runtime-modules/cdn/module.js +4 -0
  182. package/plugins/runtime-modules/cdn/platform.d.ts +25 -0
  183. package/plugins/runtime-modules/cdn/platform.js +73 -0
  184. package/plugins/runtime-modules/cdn/presets.d.ts +2 -0
  185. package/plugins/runtime-modules/cdn/presets.js +20 -0
  186. package/plugins/runtime-modules/cdn/server.d.ts +1 -0
  187. package/plugins/runtime-modules/cdn/server.js +14 -0
  188. package/plugins/runtime-modules/cdn/services/table.d.ts +11 -0
  189. package/plugins/runtime-modules/cdn/services/table.js +296 -0
  190. package/plugins/runtime-modules/cdn/services/upload.d.ts +20 -0
  191. package/plugins/runtime-modules/cdn/services/upload.js +146 -0
  192. package/plugins/runtime-modules/cdn/table-params.d.ts +10 -0
  193. package/plugins/runtime-modules/cdn/table-params.js +10 -0
  194. package/plugins/runtime-modules/cdn/trees/admin-cdn-label-set.d.ts +95 -0
  195. package/plugins/runtime-modules/cdn/trees/admin-cdn-label-set.js +156 -0
  196. package/plugins/runtime-modules/cdn/trees/phi-default-admin-cdn-page-tree.d.ts +18 -0
  197. package/plugins/runtime-modules/cdn/trees/phi-default-admin-cdn-page-tree.js +479 -0
  198. package/plugins/runtime-modules/cdn/widgets/upload/client.d.ts +12 -0
  199. package/plugins/runtime-modules/cdn/widgets/upload/client.js +138 -0
  200. package/plugins/runtime-modules/cdn/widgets/upload/config.d.ts +29 -0
  201. package/plugins/runtime-modules/cdn/widgets/upload/config.js +43 -0
  202. package/plugins/runtime-modules/cdn/widgets/upload/label-types.d.ts +24 -0
  203. package/plugins/runtime-modules/cdn/widgets/upload/label-types.js +1 -0
  204. package/plugins/runtime-modules/cdn/widgets/upload/labels.d.ts +4 -0
  205. package/plugins/runtime-modules/cdn/widgets/upload/labels.js +72 -0
  206. package/plugins/runtime-modules/cdn/widgets/upload/plugin.d.ts +3 -0
  207. package/plugins/runtime-modules/cdn/widgets/upload/plugin.js +7 -0
  208. package/plugins/runtime-modules/cdn/widgets/upload/server.d.ts +8 -0
  209. package/plugins/runtime-modules/cdn/widgets/upload/server.js +17 -0
  210. package/plugins/runtime-modules/cdn/widgets.d.ts +2 -0
  211. package/plugins/runtime-modules/cdn/widgets.js +13 -0
  212. package/plugins/runtime-modules/client-authoring-providers/admin.d.ts +1 -1
  213. package/plugins/runtime-modules/client-authoring-providers/admin.js +6 -0
  214. package/plugins/runtime-modules/client-manifests/admin.js +11 -1
  215. package/plugins/runtime-modules/client-manifests/common.js +6 -0
  216. package/plugins/runtime-modules/core/widgets/card/config.d.ts +1 -1
  217. package/plugins/runtime-modules/core/widgets/collection-view/asset-binding.js +1 -1
  218. package/plugins/runtime-modules/core/widgets/collection-view/client.js +5 -2
  219. package/plugins/runtime-modules/core/widgets/collection-view/config.js +8 -0
  220. package/plugins/runtime-modules/core/widgets/collection-view/site-address-binding.d.ts +55 -0
  221. package/plugins/runtime-modules/core/widgets/collection-view/site-address-binding.js +175 -0
  222. package/plugins/runtime-modules/core/widgets/collection-view/site-address-tiles.d.ts +48 -0
  223. package/plugins/runtime-modules/core/widgets/collection-view/site-address-tiles.js +67 -0
  224. package/plugins/runtime-modules/core/widgets/command-toolbar/config.d.ts +1 -1
  225. package/plugins/runtime-modules/core/widgets/description/config.d.ts +1 -1
  226. package/plugins/runtime-modules/core/widgets/entry-list/config.d.ts +1 -1
  227. package/plugins/runtime-modules/core/widgets/float-button/config.d.ts +1 -1
  228. package/plugins/runtime-modules/core/widgets/form/config.d.ts +1 -1
  229. package/plugins/runtime-modules/core/widgets/form/config.js +14 -1
  230. package/plugins/runtime-modules/core/widgets/gallery/config.d.ts +1 -1
  231. package/plugins/runtime-modules/core/widgets/markdown/config.d.ts +1 -1
  232. package/plugins/runtime-modules/core/widgets/record/client.js +2 -6
  233. package/plugins/runtime-modules/core/widgets/result/config.d.ts +1 -1
  234. package/plugins/runtime-modules/core/widgets/simple-text/config.d.ts +1 -1
  235. package/plugins/runtime-modules/core/widgets/table/client.js +36 -52
  236. package/plugins/runtime-modules/core/widgets/table/config.d.ts +3 -3
  237. package/plugins/runtime-modules/core/widgets/table/config.js +3 -0
  238. package/plugins/runtime-modules/core/widgets/thread-conversation/client.js +2 -2
  239. package/plugins/runtime-modules/core/widgets/thread-conversation/config.d.ts +6 -2
  240. package/plugins/runtime-modules/core/widgets/thread-conversation/config.js +6 -1
  241. package/plugins/runtime-modules/core/widgets/thread-widget-config.d.ts +10 -0
  242. package/plugins/runtime-modules/core/widgets/thread-widget-config.js +6 -0
  243. package/plugins/runtime-modules/core/widgets/tree/client.js +6 -6
  244. package/plugins/runtime-modules/localization/trees/editor-translations-widget-label-set.d.ts +2 -0
  245. package/plugins/runtime-modules/localization/trees/editor-translations-widget-label-set.js +2 -0
  246. package/plugins/runtime-modules/localization/trees/phi-default-editor-translations-page-tree.js +5 -0
  247. package/plugins/runtime-modules/revisions/controller/binding.d.ts +37 -0
  248. package/plugins/runtime-modules/revisions/controller/binding.js +75 -0
  249. package/plugins/runtime-modules/revisions/controller/client.d.ts +5 -0
  250. package/plugins/runtime-modules/revisions/controller/client.js +74 -50
  251. package/plugins/runtime-modules/revisions/controller/definition.d.ts +5 -0
  252. package/plugins/runtime-modules/revisions/controller/definition.js +10 -0
  253. package/plugins/runtime-modules/revisions/forms.js +1 -1
  254. package/plugins/runtime-modules/revisions/page-ids.d.ts +1 -1
  255. package/plugins/runtime-modules/revisions/page-ids.js +4 -1
  256. package/plugins/runtime-modules/revisions/services/options.js +14 -4
  257. package/plugins/runtime-modules/revisions/services/table.js +41 -21
  258. package/plugins/runtime-modules/revisions/trees/phi-default-builder-revisions-page-tree.js +76 -3
  259. package/plugins/runtime-modules/theme/controller/runtime.js +14 -2
  260. package/plugins/runtime-modules/theme/widgets/brand-controls/client.js +39 -13
  261. package/plugins/runtime-modules/threads/client-data-providers.js +5 -0
  262. package/plugins/runtime-modules/threads/controller/client.js +62 -2
  263. package/plugins/runtime-modules/threads/controller/definition.js +48 -0
  264. package/plugins/runtime-modules/threads/data-providers.d.ts +22 -37
  265. package/plugins/runtime-modules/threads/data-providers.js +35 -24
  266. package/plugins/runtime-modules/threads/definition.d.ts +22 -37
  267. package/plugins/runtime-modules/threads/ids.d.ts +2 -0
  268. package/plugins/runtime-modules/threads/ids.js +2 -0
  269. package/plugins/runtime-modules/threads/services/customer-file-addresses.d.ts +30 -0
  270. package/plugins/runtime-modules/threads/services/customer-file-addresses.js +59 -0
  271. package/plugins/runtime-modules/threads/services/customer-file-read.d.ts +22 -0
  272. package/plugins/runtime-modules/threads/services/customer-file-read.js +101 -0
  273. package/plugins/runtime-modules/threads/services/customer-file-table.d.ts +14 -80
  274. package/plugins/runtime-modules/threads/services/customer-file-table.js +27 -112
  275. package/plugins/runtime-modules/user-management/trees/admin-users-access-label-set.d.ts +4 -0
  276. package/plugins/runtime-modules/user-management/trees/admin-users-access-label-set.js +4 -0
  277. package/plugins/runtime-modules/user-management/trees/phi-default-admin-users-access-page-tree.js +15 -0
  278. package/plugins/runtime-modules/user-management/trees/phi-default-admin-users-page-tree.js +5 -0
  279. package/server-helpers/runtime.js +0 -1
  280. package/styles/controls.css +4 -2
  281. package/styles/layout.css +7 -0
  282. package/theme/phi-antd-token-resolver.d.ts +8 -0
  283. package/theme/phi-antd-token-resolver.js +10 -0
  284. package/theme/phi-theme-color.d.ts +19 -0
  285. package/theme/phi-theme-color.js +42 -0
  286. package/theme/phi-theme-gradients.js +4 -22
  287. package/theme/phi-theme-palette-defaults.d.ts +16 -0
  288. package/theme/phi-theme-palette-defaults.js +103 -0
  289. package/types/cms-plugins.d.ts +6 -1
  290. package/types/collection-provider.d.ts +27 -0
  291. package/types/collection-signal-values.d.ts +2 -0
  292. package/types/collection-signal-values.js +23 -0
  293. package/types/collection-view-widget.d.ts +9 -0
  294. package/types/core-widget-placements.d.ts +6 -0
  295. package/types/signals.d.ts +2 -0
  296. package/types/signals.js +2 -0
  297. package/types/table-widget.d.ts +17 -3
  298. package/types/table-widget.js +0 -282
  299. package/types/tree-widget.d.ts +0 -1
  300. package/types/tree-widget.js +0 -60
  301. package/types/widget-runtime.d.ts +0 -1
  302. package/types.d.ts +1 -1
  303. package/types.js +1 -1
  304. package/plugins/runtime-modules/app/services/addresses-table.d.ts +0 -135
@@ -1,7 +1,7 @@
1
1
  import type { PhiMediaKindValue } from "../../types/media";
2
2
  import type { PhiAreaUploadWidgetLabels } from "./media-widget-labels";
3
3
  import type { PhiMediaUploadLabels } from "./media-upload-labels";
4
- import { type PhiMediaUploadSessionRunner, type PhiMediaUploadInitOptions } from "./media-upload-flow";
4
+ import { type PhiMediaUploadSessionRunner, type PhiMediaUploadInitOptions, type PhiUploadPhase } from "./media-upload-flow";
5
5
  /**
6
6
  * What a surface accepts, stated by the Module that offers it.
7
7
  *
@@ -42,6 +42,8 @@ type PhiMediaUploadItem = {
42
42
  localId: string;
43
43
  file: File;
44
44
  progress: number;
45
+ /** Where a file on its way stands (`PhiUploadPhase`); null before the session says. */
46
+ phase: PhiUploadPhase | null;
45
47
  status: "uploading" | "done" | "error";
46
48
  error: string | null;
47
49
  assetId: number | null;
@@ -69,7 +71,7 @@ type PhiMediaUploadItem = {
69
71
  * whatever would act on the incomplete value.
70
72
  */
71
73
  export declare function usePhiMediaUpload<TAsset extends {
72
- id: number;
74
+ id?: unknown;
73
75
  } = {
74
76
  id: number;
75
77
  }>(input: {
@@ -92,13 +94,18 @@ export declare function usePhiMediaUpload<TAsset extends {
92
94
  */
93
95
  onUploaded?: (asset: TAsset, file: File) => void | Promise<void>;
94
96
  onRejected?: (message: string, file: File) => void;
97
+ /**
98
+ * The sentence a failure is shown with, for a runner whose target words its own refusals -- Core's CDN
99
+ * routes answer `{ error, message }` in a person's words. Null falls back to the Media refusals.
100
+ */
101
+ readError?: (error: unknown) => string | null;
95
102
  }): {
96
103
  accept: string;
97
104
  items: readonly PhiMediaUploadItem[];
98
105
  uploading: boolean;
99
106
  upload: (file: File, fileInitOptions?: PhiMediaUploadInitOptions) => Promise<TAsset | null>;
100
107
  retry: (localId: string) => Promise<TAsset | null>;
101
- cancel: () => void;
108
+ cancel: (reason?: unknown) => void;
102
109
  reset: () => void;
103
110
  };
104
111
  export {};
@@ -104,7 +104,8 @@ export function readPhiMediaUploadErrorMessage(error, labels) {
104
104
  * whatever would act on the incomplete value.
105
105
  */
106
106
  export function usePhiMediaUpload(input) {
107
- const { labels, acceptance, initOptions, onUploaded, onRejected } = input;
107
+ const { labels, acceptance, initOptions, onUploaded, onRejected, readError } = input;
108
+ const readFailure = useCallback((error) => readError?.(error) ?? readPhiMediaUploadErrorMessage(error, labels), [labels, readError]);
108
109
  const runSession = input.runSession
109
110
  ?? runPhiMediaUploadSession;
110
111
  const [items, setItems] = useState([]);
@@ -138,6 +139,7 @@ export function usePhiMediaUpload(input) {
138
139
  localId,
139
140
  file,
140
141
  progress: 0,
142
+ phase: null,
141
143
  status: "uploading",
142
144
  error: null,
143
145
  assetId: null,
@@ -148,14 +150,14 @@ export function usePhiMediaUpload(input) {
148
150
  running.current.add(controller);
149
151
  let asset;
150
152
  try {
151
- ({ asset } = await runSession(file, (progress) => patch(localId, { progress }), fileInitOptions ?? initOptions, controller.signal));
153
+ ({ asset } = await runSession(file, (progress) => patch(localId, { progress }), fileInitOptions ?? initOptions, controller.signal, (phase) => patch(localId, { phase })));
152
154
  }
153
155
  catch (error) {
154
156
  if (controller.signal.aborted || isPhiMediaUploadCancelled(error)) {
155
157
  setItems((current) => current.filter((item) => item.localId !== localId));
156
158
  return null;
157
159
  }
158
- const message = readPhiMediaUploadErrorMessage(error, labels);
160
+ const message = readFailure(error);
159
161
  patch(localId, { progress: 100, status: "error", error: message });
160
162
  onRejected?.(message, file);
161
163
  return null;
@@ -166,27 +168,28 @@ export function usePhiMediaUpload(input) {
166
168
  // Stopped while finalize was answering: the Asset exists, but nobody is waiting to enter it.
167
169
  if (controller.signal.aborted)
168
170
  return null;
169
- patch(localId, { progress: 100, status: "done", assetId: asset.id });
171
+ patch(localId, { progress: 100, status: "done", assetId: typeof asset.id === "number" ? asset.id : null });
170
172
  try {
171
173
  await onUploaded?.(asset, file);
172
174
  }
173
175
  catch (error) {
174
- const message = readPhiMediaUploadErrorMessage(error, labels);
176
+ const message = readFailure(error);
175
177
  patch(localId, { status: "error", error: message });
176
178
  onRejected?.(message, file);
177
179
  return null;
178
180
  }
179
181
  return asset;
180
- }, [acceptance, initOptions, labels, onRejected, onUploaded, patch, runSession]);
182
+ }, [acceptance, initOptions, labels, onRejected, onUploaded, patch, readFailure, runSession]);
181
183
  const upload = useCallback((file, fileInitOptions) => run(file, undefined, fileInitOptions), [run]);
182
184
  /** Starts a failed item's file again, in the place it had. */
183
185
  const retry = useCallback((localId) => {
184
186
  const failed = items.find((item) => item.localId === localId && item.status === "error");
185
187
  return failed ? run(failed.file, localId, failed.initOptions) : Promise.resolve(null);
186
188
  }, [items, run]);
187
- const cancel = useCallback(() => {
189
+ /** Stops what is on its way; `reason` reaches the runner as the signal's (a target may read it). */
190
+ const cancel = useCallback((reason) => {
188
191
  for (const controller of running.current)
189
- controller.abort();
192
+ controller.abort(reason);
190
193
  }, []);
191
194
  const reset = useCallback(() => setItems([]), []);
192
195
  const uploading = items.some((item) => item.status === "uploading");
@@ -20,6 +20,39 @@ export declare function usePhiMediaLibraryAddPicker({ mediaType, labels, folderP
20
20
  isAssetSelectable?: (asset: PhiMediaAssetTile) => boolean;
21
21
  onAssetSelect: (asset: PhiMediaAssetTile) => void;
22
22
  }): {
23
+ labels: {
24
+ trigger: string;
25
+ title: string;
26
+ search: string;
27
+ folder: string;
28
+ space: string;
29
+ empty: string;
30
+ sourceEmpty: string;
31
+ clear: string;
32
+ reload: string;
33
+ tileSize: string;
34
+ source: string;
35
+ importing: string;
36
+ loadMore: string;
37
+ upload: string;
38
+ };
39
+ getPopupContainer: ((triggerNode: HTMLElement) => HTMLElement) | undefined;
40
+ popupRootClassName: string | undefined;
41
+ isAssetSelectable: ((asset: PhiMediaAssetTile) => boolean) | undefined;
42
+ onOpenChange: (next: boolean) => void;
43
+ onCommit: ((assetId: number | null, originalAssetId: number | null) => void) | undefined;
44
+ onDiscard: ((originalAssetId: number | null) => void) | undefined;
45
+ onQueryChange: (nextQuery: string) => void;
46
+ onSpaceChange: (nextSpace: string) => void;
47
+ onSourceChange: (nextSource: string) => void;
48
+ onSourceItemSelect: (item: import("@phis/contracts/media-source").PhisMediaSourceItem) => Promise<PhiMediaAssetTile | null>;
49
+ onSourceLoadMore: () => void;
50
+ onFolderChange: (nextFolder: string) => void;
51
+ onPageChange: (nextPage: number, nextPageSize: number) => void;
52
+ onMinColumnWidthChange: import("react").Dispatch<import("react").SetStateAction<number>>;
53
+ onReload: () => void;
54
+ onChange: (assetId: number | null) => void;
55
+ placement?: "top" | "right" | "bottom" | "left" | "topLeft" | "topRight" | "bottomRight" | "bottomLeft" | "auto" | "leftTop" | "leftBottom" | "rightTop" | "rightBottom" | undefined;
23
56
  open: boolean;
24
57
  value: number | null;
25
58
  assets: PhiMediaAssetTile[];
@@ -59,36 +92,4 @@ export declare function usePhiMediaLibraryAddPicker({ mediaType, labels, folderP
59
92
  showFolderFilter: boolean;
60
93
  showPagination: boolean;
61
94
  trigger: import("react").ReactNode;
62
- labels: {
63
- trigger: string;
64
- title: string;
65
- search: string;
66
- folder: string;
67
- space: string;
68
- empty: string;
69
- sourceEmpty: string;
70
- clear: string;
71
- reload: string;
72
- tileSize: string;
73
- source: string;
74
- importing: string;
75
- loadMore: string;
76
- upload: string;
77
- };
78
- getPopupContainer: ((triggerNode: HTMLElement) => HTMLElement) | undefined;
79
- popupRootClassName: string | undefined;
80
- isAssetSelectable: ((asset: PhiMediaAssetTile) => boolean) | undefined;
81
- onOpenChange: (next: boolean) => void;
82
- onCommit: ((assetId: number | null, originalAssetId: number | null) => void) | undefined;
83
- onDiscard: ((originalAssetId: number | null) => void) | undefined;
84
- onQueryChange: (nextQuery: string) => void;
85
- onSpaceChange: (nextSpace: string) => void;
86
- onSourceChange: (nextSource: string) => void;
87
- onSourceItemSelect: (item: import("@phis/contracts/media-source").PhisMediaSourceItem) => Promise<PhiMediaAssetTile | null>;
88
- onSourceLoadMore: () => void;
89
- onFolderChange: (nextFolder: string) => void;
90
- onPageChange: (nextPage: number, nextPageSize: number) => void;
91
- onMinColumnWidthChange: import("react").Dispatch<import("react").SetStateAction<number>>;
92
- onReload: () => void;
93
- onChange: (assetId: number | null) => void;
94
95
  };
@@ -6,8 +6,8 @@ import { parsePhiCmsOverlayConfig, resolvePhiCmsOverlayBehaviour, } from "../../
6
6
  import { readPhiControlSize } from "../../types/control";
7
7
  import { readPhiDimensionValue } from "../../types/dimension";
8
8
  import { resolvePhiCmsContainerSurface } from "../../helpers/cms-container-chrome";
9
- import { PHI_SIGNAL_VALUE_SCHEMAS, createPhiSignalAddress, findPhiSignalRoutesByCapabilityId, } from "../../types/signals";
10
- import { readPhiTableActionSignalValue } from "../../types/table-signal-values";
9
+ import { createPhiSignalAddress, findPhiSignalRoutesByCapabilityId, } from "../../types/signals";
10
+ import { readPhiAnnouncedAction } from "../../helpers/announced-action";
11
11
  import { emitPhiSignalCapability, usePhiSignalEmitter, PhiSignalIdentityProvider, } from "../runtime/runtime-signal-identity";
12
12
  import { usePhiSignalListener } from "../runtime/runtime-signal-bus";
13
13
  import { registerPhiSignalInstance } from "../runtime/runtime-signal-registry";
@@ -26,22 +26,24 @@ function renderOverlayZonesFailure(failure) {
26
26
  /** Stands where the body will be while the zones are on their way, so the shell opens at once. */
27
27
  const PHI_OVERLAY_ZONES_PENDING = (_jsx("div", { "aria-busy": "true", style: { minBlockSize: "calc(var(--phi-control-height) * 3)" } }));
28
28
  /**
29
- * Whether an `open` carried on a Table's action channel is meant for this Overlay.
29
+ * Whether an `open` carried on an action channel is meant for this Overlay.
30
30
  *
31
- * A Table announces every action on one channel and names the action in the message, so an Overlay
32
- * subscribed to it hears `test` and `delete` as loudly as the one it is for. `openActionKey` is the
33
- * filter, and it is the same field the Form and Record Widgets read for the same reason.
31
+ * A Table announces every action on one channel and names the action in the message, and so does a
32
+ * Collection View (`collection-action`), so an Overlay subscribed to either hears `test` and `delete` as
33
+ * loudly as the one it is for. `openActionKey` is the filter, and it is the same field the Form and
34
+ * Record Widgets read for the same reason.
34
35
  *
35
36
  * Every other `open` passes untouched: a `dialog` route carries no value and has nothing to match on.
36
- * A Table-shaped `open` without a key opens for nothing rather than for everything -- the quiet failure
37
+ * An action-shaped `open` without a key opens for nothing rather than for everything -- the quiet failure
37
38
  * is a dialog that will not come up, not one that comes up whenever a row is deleted.
38
39
  */
39
40
  function matchesOpenAction(signal, route, openActionKey) {
40
- if (route.valueSchema !== PHI_SIGNAL_VALUE_SCHEMAS.tableAction)
41
+ const announced = readPhiAnnouncedAction(route.valueSchema, signal.value);
42
+ if (announced === undefined)
41
43
  return true;
42
44
  if (!openActionKey)
43
45
  return false;
44
- return readPhiTableActionSignalValue(signal.value)?.actionKey === openActionKey;
46
+ return announced?.actionKey === openActionKey;
45
47
  }
46
48
  function matchesRoute(signal, route) {
47
49
  return route.receiver === signal.receiver &&
@@ -3,6 +3,7 @@ import type { PhiRuntimeModuleId } from "../../../types/cms-module-descriptors";
3
3
  import type { PhiRenderableBlockSize } from "../../../types/renderable-block";
4
4
  import type { PhiFormWidgetPlacement, PhiWidgetPlacementSignalRoutes } from "../../../types/core-widget-placements";
5
5
  import type { PhiFormId } from "../../../types/form-id";
6
+ import { PHI_SIGNAL_VALUE_SCHEMAS } from "../../../types/signals";
6
7
  export type PhiSettingsPageShellWidgetSection = {
7
8
  kind?: "widget";
8
9
  /** Preset-locally unique node key for the section's Widget instance id. */
@@ -104,6 +105,12 @@ export type PhiSettingsPageShellOverlay = {
104
105
  * derives from `nodeKey`, which the caller derives the same way -- the preset identity is shared.
105
106
  */
106
107
  openActionKey: string;
108
+ /**
109
+ * Who announces that action: a Table (`tableAction`, the default) or a Collection View
110
+ * (`collectionAction`, an item's or the toolbar's action). The Overlay listens under that schema and
111
+ * filters by `openActionKey` either way.
112
+ */
113
+ openValueSchema?: typeof PHI_SIGNAL_VALUE_SCHEMAS.tableAction | typeof PHI_SIGNAL_VALUE_SCHEMAS.collectionAction;
107
114
  formId: PhiFormId;
108
115
  label: string;
109
116
  formConfig?: Record<string, unknown>;
@@ -385,8 +385,8 @@ export function buildPhiSettingsPageShellTree({ page, ownerModuleId, presetKey,
385
385
  signalRoutes: {
386
386
  listens: [
387
387
  /*
388
- * The Table's own action channel, filtered by `openActionKey`. Without the filter this
389
- * Overlay would open for every action the Table announces, delete included.
388
+ * The Table's own action channel, or the Collection View's, filtered by `openActionKey`.
389
+ * Without the filter this Overlay would open for every action announced, delete included.
390
390
  */
391
391
  {
392
392
  routeKey: `${overlay.nodeKey}-open`,
@@ -395,7 +395,7 @@ export function buildPhiSettingsPageShellTree({ page, ownerModuleId, presetKey,
395
395
  channel: "action",
396
396
  action: "activate",
397
397
  valueType: "json",
398
- valueSchema: PHI_SIGNAL_VALUE_SCHEMAS.tableAction,
398
+ valueSchema: overlay.openValueSchema ?? PHI_SIGNAL_VALUE_SCHEMAS.tableAction,
399
399
  receiver: createPhiSignalAddress("cms", overlayIds[overlay.nodeKey]),
400
400
  },
401
401
  {
@@ -15,5 +15,8 @@ export declare function isPhiBuilderIconNamespace(namespace: string): boolean;
15
15
  * preset: there are no aliases (`add`, `cancel`, `trash`) beside it, and case counts. `module:`,
16
16
  * `iconify:`, `asset:` and the Builder's motif namespaces are drawn by their own owners, which say for
17
17
  * themselves whether the name exists, so here they count as known.
18
+ *
19
+ * Asked where a name is chosen -- a preset's checks, the Builder's save (`helpers/widget-binding-check.ts`)
20
+ * -- and not by `PhiIcon` on a live page, which draws what it was handed (owner, 2026-11-24).
18
21
  */
19
22
  export declare function isPhiIconNameKnown(name: string): boolean;
@@ -243,6 +243,9 @@ export function isPhiBuilderIconNamespace(namespace) {
243
243
  * preset: there are no aliases (`add`, `cancel`, `trash`) beside it, and case counts. `module:`,
244
244
  * `iconify:`, `asset:` and the Builder's motif namespaces are drawn by their own owners, which say for
245
245
  * themselves whether the name exists, so here they count as known.
246
+ *
247
+ * Asked where a name is chosen -- a preset's checks, the Builder's save (`helpers/widget-binding-check.ts`)
248
+ * -- and not by `PhiIcon` on a live page, which draws what it was handed (owner, 2026-11-24).
246
249
  */
247
250
  export function isPhiIconNameKnown(name) {
248
251
  const [namespace, ...rest] = name.split(":");
@@ -1,6 +1,4 @@
1
1
  import { type PhiAntdIconPresentation } from "./phi-antd-icon";
2
- import { isPhiIconNameKnown } from "./phi-icon-names";
3
- export { isPhiIconNameKnown };
4
2
  /**
5
3
  * `style`, `className`, `title`, `ariaLabel` and `twoToneColor` reach the Ant Design icons, which is
6
4
  * where the house draws its interface icons, and all but `twoToneColor` a Module's own icon
@@ -11,11 +9,11 @@ type PhiIconProps = {
11
9
  size?: number | string;
12
10
  } & PhiAntdIconPresentation;
13
11
  /**
14
- * Says once per name that it names no icon, where somebody reads it.
12
+ * The icon a name names, or nothing.
15
13
  *
16
- * An unknown name draws nothing -- no word, no placeholder -- so without this a typo is a blank nobody
17
- * notices. Rendered on the server the warning lands in the Site service's journal, in the browser in its
18
- * console. `validate-preset-icon-vocabulary` catches the same mistake in a preset before it ships.
14
+ * A name is not looked up against the vocabulary first: where it is chosen -- a preset, a Builder save
15
+ * -- it is checked (`isPhiIconNameKnown`, owner 2026-11-24), and a live page trusts it. A name that names
16
+ * nothing still draws nothing, because each namespace below answers only what it has.
19
17
  */
20
- export declare function reportPhiUnknownIconName(name: string): void;
21
18
  export declare function PhiIcon({ name, size, ...presentation }: PhiIconProps): import("react").JSX.Element | null;
19
+ export {};
@@ -3,8 +3,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
3
3
  import { lazy, Suspense, useEffect, useState, } from "react";
4
4
  import { PHI_MODULE_ICON_NAMESPACE } from "../../constants/module-identity";
5
5
  import { PhiAntdIcon } from "./phi-antd-icon";
6
- import { isPhiBuilderIconNamespace, isPhiIconNameKnown, PHI_ANTD_ICON_NAMES } from "./phi-icon-names";
7
- export { isPhiIconNameKnown };
6
+ import { isPhiBuilderIconNamespace, PHI_ANTD_ICON_NAMES } from "./phi-icon-names";
8
7
  import { PhiModuleIcon } from "./phi-module-icons";
9
8
  let iconifyComponentLoader = null;
10
9
  function loadIconifyComponent() {
@@ -30,21 +29,6 @@ function renderIconFallback(size) {
30
29
  height: size,
31
30
  } }));
32
31
  }
33
- const reportedUnknownIconNames = new Set();
34
- /**
35
- * Says once per name that it names no icon, where somebody reads it.
36
- *
37
- * An unknown name draws nothing -- no word, no placeholder -- so without this a typo is a blank nobody
38
- * notices. Rendered on the server the warning lands in the Site service's journal, in the browser in its
39
- * console. `validate-preset-icon-vocabulary` catches the same mistake in a preset before it ships.
40
- */
41
- export function reportPhiUnknownIconName(name) {
42
- if (reportedUnknownIconNames.has(name))
43
- return;
44
- reportedUnknownIconNames.add(name);
45
- console.warn(`[phi-icon] "${name}" names no icon and draws nothing. Use a name from PHI_ANTD_ICON_NAMES `
46
- + "(components/shell/phi-icon-names.ts), with or without `antd:`, or a `module:`, `iconify:` or `asset:` name.");
47
- }
48
32
  function renderAntdIcon(key, size, presentation) {
49
33
  const icon = PHI_ANTD_ICON_NAMES[key];
50
34
  return icon ? _jsx(PhiAntdIcon, { icon: icon, size: size, ...presentation }) : null;
@@ -85,14 +69,17 @@ function PhiIconifyIcon({ icon, size }) {
85
69
  }
86
70
  return _jsx(IconifyIcon, { icon: icon, width: size, height: size, inline: true });
87
71
  }
72
+ /**
73
+ * The icon a name names, or nothing.
74
+ *
75
+ * A name is not looked up against the vocabulary first: where it is chosen -- a preset, a Builder save
76
+ * -- it is checked (`isPhiIconNameKnown`, owner 2026-11-24), and a live page trusts it. A name that names
77
+ * nothing still draws nothing, because each namespace below answers only what it has.
78
+ */
88
79
  export function PhiIcon({ name, size = 16, ...presentation }) {
89
80
  if (!name) {
90
81
  return null;
91
82
  }
92
- if (!isPhiIconNameKnown(name)) {
93
- reportPhiUnknownIconName(name);
94
- return null;
95
- }
96
83
  const resolvedSize = size === "inherit" ? "1em" : size;
97
84
  const [namespace, ...rest] = name.split(":");
98
85
  const value = rest.join(":");
@@ -12,6 +12,7 @@ const WIDGET_ICON_REGISTRY = {
12
12
  auth: "user",
13
13
  admin: "setting",
14
14
  builder: "branches",
15
+ cdn: "cloud-upload",
15
16
  dashboard: "dashboard",
16
17
  developer: "code",
17
18
  editor: "edit",
@@ -0,0 +1,24 @@
1
+ /**
2
+ * A Table's binding params: what its source was configured with, and what its reader, its binding tools
3
+ * or a signal set since.
4
+ *
5
+ * What was set is tagged with the configuration it was set against. A Builder edit of the configured
6
+ * params is a new starting point; the reader's earlier choice belonged to the old one and would
7
+ * otherwise outlive it.
8
+ *
9
+ * `changeBindingParams` merges a change into the params as they stand after the last change -- ahead of
10
+ * the render that shows them -- and answers the params it made, or null where nothing changed. Both
11
+ * matter to a Table read by a Controller:
12
+ * - two binding tools that answer in the same commit each wrote their value over the params of that
13
+ * render, so the second put back what the first had changed, and the first answered again on the next
14
+ * render -- each answer a new source, a new read and a `bindingParamsChange` handed on;
15
+ * - the same params again were a new object, so a new source and a new read, and handed on again: a
16
+ * Controller that hands its scope on every change of what it reads from read the same history up to
17
+ * six times on opening the Builder's Revisions. The same params are no change at all now.
18
+ */
19
+ export declare function usePhiTableBindingParams(configured: Record<string, unknown>): {
20
+ bindingParams: Record<string, unknown>;
21
+ changeBindingParams: (patch: Record<string, unknown>) => {
22
+ [x: string]: unknown;
23
+ } | null;
24
+ };
@@ -0,0 +1,39 @@
1
+ "use client";
2
+ import { useCallback, useLayoutEffect, useRef, useState } from "react";
3
+ /**
4
+ * A Table's binding params: what its source was configured with, and what its reader, its binding tools
5
+ * or a signal set since.
6
+ *
7
+ * What was set is tagged with the configuration it was set against. A Builder edit of the configured
8
+ * params is a new starting point; the reader's earlier choice belonged to the old one and would
9
+ * otherwise outlive it.
10
+ *
11
+ * `changeBindingParams` merges a change into the params as they stand after the last change -- ahead of
12
+ * the render that shows them -- and answers the params it made, or null where nothing changed. Both
13
+ * matter to a Table read by a Controller:
14
+ * - two binding tools that answer in the same commit each wrote their value over the params of that
15
+ * render, so the second put back what the first had changed, and the first answered again on the next
16
+ * render -- each answer a new source, a new read and a `bindingParamsChange` handed on;
17
+ * - the same params again were a new object, so a new source and a new read, and handed on again: a
18
+ * Controller that hands its scope on every change of what it reads from read the same history up to
19
+ * six times on opening the Builder's Revisions. The same params are no change at all now.
20
+ */
21
+ export function usePhiTableBindingParams(configured) {
22
+ const seed = JSON.stringify(configured);
23
+ const [chosen, setChosen] = useState(null);
24
+ const bindingParams = chosen?.seed === seed ? chosen.params : configured;
25
+ const latest = useRef(bindingParams);
26
+ useLayoutEffect(() => {
27
+ latest.current = bindingParams;
28
+ }, [bindingParams]);
29
+ const changeBindingParams = useCallback((patch) => {
30
+ const current = latest.current;
31
+ const next = { ...current, ...patch };
32
+ if (JSON.stringify(next) === JSON.stringify(current))
33
+ return null;
34
+ latest.current = next;
35
+ setChosen({ seed, params: next });
36
+ return next;
37
+ }, [seed]);
38
+ return { bindingParams, changeBindingParams };
39
+ }
@@ -17,16 +17,14 @@ export type PhiTableBindingInput = {
17
17
  initialExpandedRowIdentities?: readonly PhiTableRowIdentity[];
18
18
  onData?: (data: PhiTableProviderQueryResult) => void;
19
19
  onMutation?: (result: PhiTableProviderMutationResult) => void;
20
- validateResource?: (resource: PhiTableProviderResourceDescriptor) => string | null;
21
20
  };
22
- export declare function usePhiTableBinding({ source, initialQuery, externalQuery, fixedFilters, externalSearch, defaultPageSize, refreshKey, preserveSelectedRowIdentities, initialExpandedRowIdentities, onData, onMutation, validateResource, }: PhiTableBindingInput): {
21
+ export declare function usePhiTableBinding({ source, initialQuery, externalQuery, fixedFilters, externalSearch, defaultPageSize, refreshKey, preserveSelectedRowIdentities, initialExpandedRowIdentities, onData, onMutation, }: PhiTableBindingInput): {
23
22
  resource: PhiTableProviderResourceDescriptor | null;
24
23
  bindingError: string | null;
25
24
  rows: readonly TableRow[];
26
25
  total: number | null;
27
26
  hasMore: boolean;
28
27
  summary: Readonly<Record<string, PhiTableSummaryValue>>;
29
- contractError: string | null;
30
28
  loading: boolean;
31
29
  error: PhiTableProviderError | null;
32
30
  queryError: PhiTableProviderError | null;
@@ -94,7 +94,7 @@ function resolvePhiTableQuery(query, externalQuery, externalSearch, expandedRowI
94
94
  expandedRowIdentities,
95
95
  };
96
96
  }
97
- export function usePhiTableBinding({ source, initialQuery = {}, externalQuery, fixedFilters, externalSearch, defaultPageSize = 20, refreshKey, preserveSelectedRowIdentities = false, initialExpandedRowIdentities = [], onData, onMutation, validateResource, }) {
97
+ export function usePhiTableBinding({ source, initialQuery = {}, externalQuery, fixedFilters, externalSearch, defaultPageSize = 20, refreshKey, preserveSelectedRowIdentities = false, initialExpandedRowIdentities = [], onData, onMutation, }) {
98
98
  const { provider, resource, bindingError } = usePhiTableProvider(source);
99
99
  /*
100
100
  * The reader's language and the Site's zone go with every query, and into what decides that a query
@@ -102,7 +102,6 @@ export function usePhiTableBinding({ source, initialQuery = {}, externalQuery, f
102
102
  */
103
103
  const locale = usePhiIntlLocale();
104
104
  const timeZone = usePhiIntlTimeZone();
105
- const resourceError = resource ? validateResource?.(resource) ?? null : null;
106
105
  const [query, setQuery] = useState(() => ({
107
106
  page: initialQuery.page ?? 1,
108
107
  pageSize: initialQuery.pageSize ?? defaultPageSize,
@@ -284,7 +283,7 @@ export function usePhiTableBinding({ source, initialQuery = {}, externalQuery, f
284
283
  onDataRef.current?.(data);
285
284
  }, [preserveSelectedRowIdentities, resolvedQuery.pageSize, resource, sourceKey]);
286
285
  useEffect(() => {
287
- if (!source || !provider || !resource || resourceError)
286
+ if (!source || !provider || !resource)
288
287
  return;
289
288
  if (acceptedResolvedQuery.current?.queryKey === resolvedQueryKey &&
290
289
  acceptedResolvedQuery.current.refreshRevision === refreshRequest.revision) {
@@ -293,7 +292,6 @@ export function usePhiTableBinding({ source, initialQuery = {}, externalQuery, f
293
292
  provider,
294
293
  resource,
295
294
  source,
296
- resourceError,
297
295
  resolvedQueryKey,
298
296
  refreshKey,
299
297
  locale,
@@ -306,13 +304,12 @@ export function usePhiTableBinding({ source, initialQuery = {}, externalQuery, f
306
304
  previous.provider === provider &&
307
305
  previous.resource === resource &&
308
306
  previous.source === source &&
309
- previous.resourceError === resourceError &&
310
307
  previous.resolvedQueryKey === resolvedQueryKey &&
311
308
  previous.refreshKey === refreshKey &&
312
309
  previous.locale === locale &&
313
310
  previous.timeZone === timeZone;
314
311
  const background = refreshRequest.background && sameQueryInputs && rowsRef.current.length > 0;
315
- previousQueryInputs.current = { provider, resource, source, resourceError, resolvedQueryKey, refreshKey, locale, timeZone };
312
+ previousQueryInputs.current = { provider, resource, source, resolvedQueryKey, refreshKey, locale, timeZone };
316
313
  const abortController = new AbortController();
317
314
  queueMicrotask(() => {
318
315
  if (!abortController.signal.aborted) {
@@ -368,7 +365,7 @@ export function usePhiTableBinding({ source, initialQuery = {}, externalQuery, f
368
365
  }
369
366
  });
370
367
  return () => abortController.abort();
371
- }, [applyData, expandedRowIdentities, externalQuery, externalSearch, locale, provider, query, refreshKey, refreshRequest, resolvedQuery, resolvedQueryKey, resource, resourceError, source, stableFixedFilters, timeZone]);
368
+ }, [applyData, expandedRowIdentities, externalQuery, externalSearch, locale, provider, query, refreshKey, refreshRequest, resolvedQuery, resolvedQueryKey, resource, source, stableFixedFilters, timeZone]);
372
369
  const reload = useCallback(() => setRefreshRequest((current) => ({
373
370
  revision: current.revision + 1,
374
371
  background: false,
@@ -601,8 +598,7 @@ export function usePhiTableBinding({ source, initialQuery = {}, externalQuery, f
601
598
  total,
602
599
  hasMore,
603
600
  summary,
604
- contractError: resourceError,
605
- loading: queryLoading && !bindingError && !resourceError,
601
+ loading: queryLoading && !bindingError,
606
602
  error,
607
603
  queryError: queryFailure,
608
604
  query,
@@ -0,0 +1,12 @@
1
+ import { LinkNode, type SerializedLinkNode } from "@lexical/link";
2
+ import { type DOMConversionMap, type LexicalNodeReplacement } from "lexical";
3
+ /** Keeps Page identity in authoring HTML; only the server render resolves it to an address. */
4
+ export declare class PhiHtmlLinkNode extends LinkNode {
5
+ static getType(): string;
6
+ static clone(node: PhiHtmlLinkNode): PhiHtmlLinkNode;
7
+ static importJSON(serializedNode: SerializedLinkNode): PhiHtmlLinkNode;
8
+ static importDOM(): DOMConversionMap;
9
+ sanitizeUrl(url: string): string;
10
+ }
11
+ /** Factories, commands and imports must all create the same node, including LinkNode transforms. */
12
+ export declare const PHI_HTML_LINK_NODE_REPLACEMENT: LexicalNodeReplacement;
@@ -0,0 +1,60 @@
1
+ import { LinkNode } from "@lexical/link";
2
+ import { $applyNodeReplacement } from "lexical";
3
+ import { createPhiPageUri, readPhiInternalReference } from "../../../types/references";
4
+ /** Keeps Page identity in authoring HTML; only the server render resolves it to an address. */
5
+ export class PhiHtmlLinkNode extends LinkNode {
6
+ static getType() {
7
+ return "phi-html-link";
8
+ }
9
+ static clone(node) {
10
+ return new PhiHtmlLinkNode(node.__url, {
11
+ rel: node.__rel,
12
+ target: node.__target,
13
+ title: node.__title,
14
+ }, node.__key);
15
+ }
16
+ static importJSON(serializedNode) {
17
+ return $applyNodeReplacement(new PhiHtmlLinkNode()).updateFromJSON(serializedNode);
18
+ }
19
+ static importDOM() {
20
+ return {
21
+ a: () => ({
22
+ priority: 2,
23
+ conversion: (element) => {
24
+ if (!(element instanceof HTMLAnchorElement))
25
+ return null;
26
+ return {
27
+ node: $applyNodeReplacement(new PhiHtmlLinkNode(element.getAttribute("href") ?? "", {
28
+ rel: element.getAttribute("rel"),
29
+ target: element.getAttribute("target"),
30
+ title: element.getAttribute("title"),
31
+ })),
32
+ };
33
+ },
34
+ }),
35
+ };
36
+ }
37
+ sanitizeUrl(url) {
38
+ const reference = readPhiInternalReference(url);
39
+ if (reference?.kind === "page") {
40
+ try {
41
+ if (createPhiPageUri(reference.reference, reference.fragment) === url)
42
+ return url;
43
+ }
44
+ catch {
45
+ // A malformed Unicode fragment cannot be emitted by the canonical factory.
46
+ }
47
+ }
48
+ return super.sanitizeUrl(url);
49
+ }
50
+ }
51
+ /** Factories, commands and imports must all create the same node, including LinkNode transforms. */
52
+ export const PHI_HTML_LINK_NODE_REPLACEMENT = {
53
+ replace: LinkNode,
54
+ with: (node) => new PhiHtmlLinkNode(node.getURL(), {
55
+ rel: node.getRel(),
56
+ target: node.getTarget(),
57
+ title: node.getTitle(),
58
+ }),
59
+ withKlass: PhiHtmlLinkNode,
60
+ };