@phis/ui 0.7.7 → 0.8.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 (344) hide show
  1. package/components/controls/phi-address-control.d.ts +23 -0
  2. package/components/controls/phi-address-control.js +43 -0
  3. package/components/controls/phi-color-control.d.ts +3 -1
  4. package/components/controls/phi-color-control.js +2 -2
  5. package/components/controls/phi-country-select-control.d.ts +22 -0
  6. package/components/controls/phi-country-select-control.js +16 -0
  7. package/components/controls/phi-dialog-control.d.ts +1 -1
  8. package/components/controls/phi-drawer-control-adapter.d.ts +1 -1
  9. package/components/controls/phi-drawer-control-adapter.js +5 -3
  10. package/components/controls/phi-drawer-control.d.ts +7 -5
  11. package/components/controls/phi-float-button-control.d.ts +8 -1
  12. package/components/controls/phi-float-button-control.js +19 -3
  13. package/components/controls/phi-form-control.js +64 -9
  14. package/components/controls/phi-modal-control-adapter.d.ts +1 -1
  15. package/components/controls/phi-modal-control-adapter.js +14 -37
  16. package/components/controls/phi-modal-control.d.ts +5 -5
  17. package/components/controls/phi-options-provider.d.ts +1 -0
  18. package/components/controls/phi-options-provider.js +1 -0
  19. package/components/controls/phi-overlay-control-contract.d.ts +52 -17
  20. package/components/controls/phi-overlay-control-contract.js +55 -30
  21. package/components/controls/phi-reveal-once-dialog-control.d.ts +21 -0
  22. package/components/controls/phi-reveal-once-dialog-control.js +52 -0
  23. package/components/controls/phi-reveal-once-dialog-labels.d.ts +10 -0
  24. package/components/controls/phi-reveal-once-dialog-labels.js +5 -0
  25. package/components/forms/extended-form-field-controls.d.ts +1 -1
  26. package/components/forms/extended-form-field-controls.js +23 -7
  27. package/components/forms/flags-field.d.ts +22 -0
  28. package/components/forms/flags-field.js +58 -0
  29. package/components/forms/form-option-flags.d.ts +20 -0
  30. package/components/forms/form-option-flags.js +38 -0
  31. package/components/forms/form-provider-contract.d.ts +28 -0
  32. package/components/forms/form-provider-contract.js +45 -2
  33. package/components/forms/form-provider-registry.d.ts +11 -1
  34. package/components/forms/money-field-currency-key.d.ts +6 -0
  35. package/components/forms/money-field-currency-key.js +14 -0
  36. package/components/forms/money-field.d.ts +26 -3
  37. package/components/forms/money-field.js +54 -4
  38. package/components/forms/shared-form-provider-registry.js +13 -0
  39. package/components/forms/structured-field-labels.d.ts +24 -0
  40. package/components/forms/structured-field-labels.js +43 -0
  41. package/components/forms/structured-form-field-controls.d.ts +12 -0
  42. package/components/forms/structured-form-field-controls.js +65 -0
  43. package/components/overlays/phi-overlay-container-client.js +2 -2
  44. package/components/regions/phi-cms-region-shell.js +2 -2
  45. package/components/regions/presets/content-entry-editor-page-tree.js +12 -3
  46. package/components/regions/presets/navigation-redirect.d.ts +4 -1
  47. package/components/regions/presets/navigation-redirect.js +6 -3
  48. package/components/regions/presets/phi-settings-page-shell-tree.d.ts +6 -2
  49. package/components/regions/presets/phi-settings-page-shell-tree.js +1 -1
  50. package/components/root/phi-root-theme-resolver.js +3 -0
  51. package/components/shell/phi-antd-icon.d.ts +1 -8
  52. package/components/shell/phi-antd-icon.js +1 -227
  53. package/components/shell/phi-icon-names.d.ts +19 -0
  54. package/components/shell/phi-icon-names.js +264 -0
  55. package/components/shell/phi-icon.d.ts +2 -11
  56. package/components/shell/phi-icon.js +4 -32
  57. package/components/widgets/client/shared/phi-command-buttons.d.ts +13 -2
  58. package/components/widgets/client/shared/phi-command-buttons.js +10 -4
  59. package/components/widgets/client/shared/phi-rendered-value.js +32 -6
  60. package/components/widgets/client/shared/phi-table-provider-refusal.d.ts +13 -0
  61. package/components/widgets/client/shared/phi-table-provider-refusal.js +13 -0
  62. package/components/widgets/config/background.d.ts +3 -2
  63. package/components/widgets/config/choice-shared.d.ts +10 -1
  64. package/components/widgets/config/choice-shared.js +8 -2
  65. package/components/widgets/label-sets/admin-locales.js +1 -1
  66. package/components/widgets/label-sets/admin-users.d.ts +2 -5
  67. package/components/widgets/label-sets/admin-users.js +4 -10
  68. package/components/widgets/label-sets/effects.js +2 -4
  69. package/components/widgets/label-sets/profile.d.ts +13 -0
  70. package/components/widgets/label-sets/profile.js +28 -0
  71. package/components/widgets/label-sets/search-results.js +2 -4
  72. package/components/widgets/label-sets/table.js +9 -0
  73. package/components/widgets/label-types/effects.d.ts +3 -2
  74. package/components/widgets/label-types/effects.js +1 -2
  75. package/components/widgets/label-types/search-results.d.ts +2 -2
  76. package/components/widgets/label-types/search-results.js +1 -2
  77. package/components/widgets/label-types/table.d.ts +3 -0
  78. package/components/widgets/label-types/table.js +2 -0
  79. package/components/widgets/server/builder-chrome.d.ts +4 -1
  80. package/components/widgets/server/builder-chrome.js +2 -2
  81. package/components/widgets/shared/markdown-body-client.d.ts +26 -0
  82. package/components/widgets/shared/markdown-body-client.js +31 -1
  83. package/components/widgets/shared/markdown-render.d.ts +10 -2
  84. package/components/widgets/shared/markdown-render.js +35 -13
  85. package/constants/countries.d.ts +9 -0
  86. package/constants/countries.js +28 -0
  87. package/constants/customer-file.d.ts +25 -0
  88. package/constants/customer-file.js +26 -0
  89. package/constants/record-field-kinds.d.ts +15 -0
  90. package/constants/record-field-kinds.js +13 -0
  91. package/constants/runtime-module-ownership.js +12 -0
  92. package/constants/runtime-render-client-types.d.ts +5 -0
  93. package/constants/runtime-render-client-types.js +5 -0
  94. package/{plugins/runtime-modules/threads/controller/address.js → constants/threads-controller-address.js} +1 -1
  95. package/constants.d.ts +1 -0
  96. package/constants.js +2 -0
  97. package/gateway/form-handler-request.d.ts +22 -0
  98. package/gateway/form-handler-request.js +40 -0
  99. package/gateway/label-set.d.ts +15 -2
  100. package/gateway/label-set.js +60 -22
  101. package/gateway/site-form-route.js +11 -2
  102. package/helpers/address-field.d.ts +43 -0
  103. package/helpers/address-field.js +68 -0
  104. package/helpers/cms-dialog.d.ts +5 -20
  105. package/helpers/cms-dialog.js +8 -13
  106. package/helpers/cms-page-catalog.d.ts +10 -0
  107. package/helpers/cms-page-catalog.js +19 -0
  108. package/helpers/cms-preset-nodes.d.ts +4 -4
  109. package/helpers/cms-preset-nodes.js +1 -1
  110. package/helpers/cms-region-keys.d.ts +1 -1
  111. package/helpers/country-names.d.ts +12 -0
  112. package/helpers/country-names.js +14 -0
  113. package/helpers/money-amount.d.ts +7 -0
  114. package/helpers/money-amount.js +15 -0
  115. package/helpers/phi-metadata.d.ts +33 -1
  116. package/helpers/phi-metadata.js +62 -1
  117. package/helpers/preset-table-check.d.ts +34 -0
  118. package/helpers/preset-table-check.js +124 -0
  119. package/helpers/preset-text-source-check.d.ts +4 -1
  120. package/helpers/preset-text-source-check.js +6 -1
  121. package/helpers/preset-tree-contract-check.d.ts +3 -2
  122. package/helpers/preset-tree-contract-check.js +30 -5
  123. package/helpers/public-route-claims.d.ts +9 -1
  124. package/helpers/public-route-claims.js +23 -3
  125. package/helpers/record-fields.d.ts +1 -5
  126. package/helpers/record-fields.js +15 -6
  127. package/helpers/route-address-check.d.ts +22 -2
  128. package/helpers/route-address-check.js +29 -8
  129. package/helpers/site-address-row.d.ts +23 -0
  130. package/helpers/site-address-row.js +36 -0
  131. package/helpers/surface-style.d.ts +8 -1
  132. package/helpers/surface-style.js +12 -2
  133. package/helpers/thread-inbox-row.d.ts +20 -0
  134. package/helpers/thread-inbox-row.js +26 -0
  135. package/helpers/translation-format.d.ts +26 -0
  136. package/helpers/translation-format.js +31 -0
  137. package/module-labels.d.ts +1 -1
  138. package/module-labels.js +1 -1
  139. package/module-page-check.d.ts +1 -0
  140. package/module-page-check.js +1 -0
  141. package/module-records.d.ts +2 -2
  142. package/module-records.js +1 -0
  143. package/next/area-route.js +34 -1
  144. package/next/root-route.js +4 -5
  145. package/package.json +2 -2
  146. package/plugins/runtime-modules/accounting/customer-file-access.d.ts +11 -0
  147. package/plugins/runtime-modules/accounting/customer-file-access.js +12 -0
  148. package/plugins/runtime-modules/accounting/data-providers.js +1 -1
  149. package/plugins/runtime-modules/accounting/ids.d.ts +11 -0
  150. package/plugins/runtime-modules/accounting/ids.js +23 -0
  151. package/plugins/runtime-modules/accounting/presets.js +32 -5
  152. package/plugins/runtime-modules/accounting/trees/accounting-customer-file-label-set.d.ts +66 -0
  153. package/plugins/runtime-modules/accounting/trees/accounting-customer-file-label-set.js +122 -0
  154. package/plugins/runtime-modules/accounting/trees/accounting-products-label-set.js +2 -2
  155. package/plugins/runtime-modules/accounting/trees/phi-default-accounting-customer-file-page-tree.d.ts +26 -0
  156. package/plugins/runtime-modules/accounting/trees/phi-default-accounting-customer-file-page-tree.js +381 -0
  157. package/plugins/runtime-modules/accounting/trees/phi-default-accounting-products-page-tree.js +4 -0
  158. package/plugins/runtime-modules/app/client-data-providers.d.ts +7 -0
  159. package/plugins/runtime-modules/app/client-data-providers.js +9 -0
  160. package/plugins/runtime-modules/app/data-providers.d.ts +98 -0
  161. package/plugins/runtime-modules/app/data-providers.js +80 -0
  162. package/plugins/runtime-modules/app/definition.d.ts +131 -0
  163. package/plugins/runtime-modules/app/definition.js +2 -0
  164. package/plugins/runtime-modules/app/forms.d.ts +46 -1
  165. package/plugins/runtime-modules/app/forms.js +195 -1
  166. package/plugins/runtime-modules/app/ids.d.ts +7 -0
  167. package/plugins/runtime-modules/app/ids.js +8 -0
  168. package/plugins/runtime-modules/app/module.d.ts +131 -0
  169. package/plugins/runtime-modules/app/presets.js +3 -6
  170. package/plugins/runtime-modules/app/services/addresses-table.d.ts +135 -0
  171. package/plugins/runtime-modules/app/services/addresses-table.js +101 -0
  172. package/plugins/runtime-modules/app/trees/account-addresses-panel.d.ts +17 -0
  173. package/plugins/runtime-modules/app/trees/account-addresses-panel.js +179 -0
  174. package/plugins/runtime-modules/app/trees/addresses-label-set.d.ts +62 -0
  175. package/plugins/runtime-modules/app/trees/addresses-label-set.js +108 -0
  176. package/plugins/runtime-modules/app/trees/phi-default-app-area-preset-tree.d.ts +3 -6
  177. package/plugins/runtime-modules/app/trees/phi-default-app-area-preset-tree.js +4 -7
  178. package/plugins/runtime-modules/app/trees/phi-default-app-profile-page-tree.js +27 -2
  179. package/plugins/runtime-modules/app/trees/profile-label-set.d.ts +1 -0
  180. package/plugins/runtime-modules/app/trees/profile-label-set.js +3 -0
  181. package/plugins/runtime-modules/asset/presets.d.ts +4 -0
  182. package/plugins/runtime-modules/asset/trees/phi-default-builder-media-page-tree.js +4 -2
  183. package/plugins/runtime-modules/auth/trees/phi-auth-area-overlay-tree.server.js +4 -2
  184. package/plugins/runtime-modules/auth/trees/phi-default-admin-auth-settings-page-tree.js +2 -2
  185. package/plugins/runtime-modules/auth/widgets/logout/client.d.ts +1 -1
  186. package/plugins/runtime-modules/auth/widgets/logout/client.js +2 -2
  187. package/plugins/runtime-modules/auth/widgets/security/client.d.ts +5 -1
  188. package/plugins/runtime-modules/auth/widgets/security/client.js +12 -10
  189. package/plugins/runtime-modules/avatar/overlay-tree.server.js +1 -1
  190. package/plugins/runtime-modules/blog/presets.d.ts +4 -0
  191. package/plugins/runtime-modules/builder/clients/inspector-image-field.d.ts +2 -1
  192. package/plugins/runtime-modules/builder/clients/inspector-image-field.js +3 -2
  193. package/plugins/runtime-modules/builder/clients/metadata-table-provider-stand-ins.d.ts +23 -0
  194. package/plugins/runtime-modules/builder/clients/metadata-table-provider-stand-ins.js +38 -0
  195. package/plugins/runtime-modules/builder/clients/mode-switch.d.ts +4 -1
  196. package/plugins/runtime-modules/builder/clients/mode-switch.js +2 -15
  197. package/plugins/runtime-modules/builder/clients/pages-workspace.js +2 -0
  198. package/plugins/runtime-modules/builder/clients/runtime-module-authoring-boundary.js +2 -1
  199. package/plugins/runtime-modules/builder/controller/client.d.ts +5 -5
  200. package/plugins/runtime-modules/builder/controller/client.js +2 -1
  201. package/plugins/runtime-modules/builder/controller/definition.d.ts +4 -4
  202. package/plugins/runtime-modules/builder/controller/definition.js +7 -0
  203. package/plugins/runtime-modules/builder/controller/draft-command-controller.d.ts +3 -1
  204. package/plugins/runtime-modules/builder/controller/draft-command-controller.js +2 -1
  205. package/plugins/runtime-modules/builder/controller/draft-status-controller.js +72 -18
  206. package/plugins/runtime-modules/builder/controller/server-definition.d.ts +4 -4
  207. package/plugins/runtime-modules/builder/controller/workspace-controller.d.ts +3 -1
  208. package/plugins/runtime-modules/builder/controller/workspace-controller.js +8 -10
  209. package/plugins/runtime-modules/builder/developer-workspace-store.d.ts +10 -0
  210. package/plugins/runtime-modules/builder/developer-workspace-store.js +35 -1
  211. package/plugins/runtime-modules/builder/developer-workspace-types.d.ts +5 -0
  212. package/plugins/runtime-modules/builder/offered-page-catalog.d.ts +6 -0
  213. package/plugins/runtime-modules/builder/offered-page-catalog.js +35 -6
  214. package/plugins/runtime-modules/builder/page-presets.server.d.ts +7 -0
  215. package/plugins/runtime-modules/builder/page-presets.server.js +10 -1
  216. package/plugins/runtime-modules/builder/persistence.d.ts +4 -1
  217. package/plugins/runtime-modules/builder/persistence.js +14 -3
  218. package/plugins/runtime-modules/builder/public-route-collisions.js +8 -3
  219. package/plugins/runtime-modules/builder/trees/phi-builder-inspector-area-overlay-tree.server.js +3 -1
  220. package/plugins/runtime-modules/builder/trees/phi-default-builder-area-preset-tree.js +33 -6
  221. package/plugins/runtime-modules/builder/widgets/chrome/config.d.ts +6 -4
  222. package/plugins/runtime-modules/builder/widgets/chrome/config.js +11 -1
  223. package/plugins/runtime-modules/builder/widgets/inspector-header/authoring.d.ts +2 -2
  224. package/plugins/runtime-modules/builder/widgets/inspector-header/plugin.d.ts +2 -2
  225. package/plugins/runtime-modules/builder/widgets/mode-switch/plugin.js +1 -1
  226. package/plugins/runtime-modules/builder/widgets/structure-region/built-in.js +2 -2
  227. package/plugins/runtime-modules/client-manifests/app.js +3 -0
  228. package/plugins/runtime-modules/client-manifests/builder.js +10 -0
  229. package/plugins/runtime-modules/content-entry-routes.d.ts +4 -0
  230. package/plugins/runtime-modules/contracts.js +31 -1
  231. package/plugins/runtime-modules/core/definition.d.ts +28 -0
  232. package/plugins/runtime-modules/core/form-providers.d.ts +28 -0
  233. package/plugins/runtime-modules/core/messaging/thread-inbox-table.d.ts +0 -17
  234. package/plugins/runtime-modules/core/messaging/thread-inbox-table.js +2 -23
  235. package/plugins/runtime-modules/core/widgets/card/config.d.ts +0 -1
  236. package/plugins/runtime-modules/core/widgets/card/config.js +0 -1
  237. package/plugins/runtime-modules/core/widgets/card/editor.js +1 -1
  238. package/plugins/runtime-modules/core/widgets/command-toolbar/client.js +3 -0
  239. package/plugins/runtime-modules/core/widgets/command-toolbar/config.d.ts +316 -1
  240. package/plugins/runtime-modules/core/widgets/command-toolbar/config.js +4 -4
  241. package/plugins/runtime-modules/core/widgets/dimension/config.d.ts +1 -1
  242. package/plugins/runtime-modules/core/widgets/float-button/client.js +4 -1
  243. package/plugins/runtime-modules/core/widgets/float-button/config.d.ts +326 -3
  244. package/plugins/runtime-modules/core/widgets/float-button/config.js +5 -2
  245. package/plugins/runtime-modules/core/widgets/header-navigation/client.js +1 -1
  246. package/plugins/runtime-modules/core/widgets/length/config.d.ts +1 -1
  247. package/plugins/runtime-modules/core/widgets/markdown/plugin.js +20 -7
  248. package/plugins/runtime-modules/core/widgets/markdown/server.d.ts +6 -2
  249. package/plugins/runtime-modules/core/widgets/markdown/server.js +2 -2
  250. package/plugins/runtime-modules/core/widgets/markdown/table-embeds.server.d.ts +12 -0
  251. package/plugins/runtime-modules/core/widgets/markdown/table-embeds.server.js +68 -0
  252. package/plugins/runtime-modules/core/widgets/number-input/config.d.ts +1 -1
  253. package/plugins/runtime-modules/core/widgets/simple-text/config.js +1 -1
  254. package/plugins/runtime-modules/core/widgets/simple-text/plugin.js +2 -1
  255. package/plugins/runtime-modules/core/widgets/spacer/client.js +3 -3
  256. package/plugins/runtime-modules/core/widgets/table/client.js +20 -5
  257. package/plugins/runtime-modules/core/widgets/table/config.js +6 -0
  258. package/plugins/runtime-modules/core/widgets/table/reader-query.d.ts +17 -0
  259. package/plugins/runtime-modules/core/widgets/table/reader-query.js +33 -0
  260. package/plugins/runtime-modules/dashboard/trees/dashboard-cards-page-tree.js +3 -1
  261. package/plugins/runtime-modules/descriptor-compiler.d.ts +19 -3
  262. package/plugins/runtime-modules/descriptor-compiler.js +44 -16
  263. package/plugins/runtime-modules/editor/presets.d.ts +4 -0
  264. package/plugins/runtime-modules/editor/trees/phi-default-editor-releases-page-tree.js +3 -1
  265. package/plugins/runtime-modules/groups/trees/phi-default-admin-groups-page-tree.js +5 -1
  266. package/plugins/runtime-modules/groups/trees/phi-default-app-groups-page-tree.js +5 -1
  267. package/plugins/runtime-modules/localization/presets.d.ts +4 -0
  268. package/plugins/runtime-modules/localization/trees/phi-default-admin-locales-page-tree.js +3 -1
  269. package/plugins/runtime-modules/localization/trees/phi-default-editor-translations-page-tree.js +4 -2
  270. package/plugins/runtime-modules/news/presets.d.ts +4 -0
  271. package/plugins/runtime-modules/observability/trees/phi-default-admin-logs-page-tree.js +6 -2
  272. package/plugins/runtime-modules/phi-default-site-area-preset-tree.js +46 -39
  273. package/plugins/runtime-modules/preset-contracts/pub-area.d.ts +1 -1
  274. package/plugins/runtime-modules/preset-contracts/pub-area.js +1 -0
  275. package/plugins/runtime-modules/resolver.js +17 -0
  276. package/plugins/runtime-modules/revisions/controller/client.js +50 -46
  277. package/plugins/runtime-modules/revisions/controller/draft-context-target.d.ts +25 -0
  278. package/plugins/runtime-modules/revisions/controller/draft-context-target.js +33 -0
  279. package/plugins/runtime-modules/revisions/presets.d.ts +4 -0
  280. package/plugins/runtime-modules/revisions/services/table.js +16 -5
  281. package/plugins/runtime-modules/revisions/trees/phi-default-builder-revisions-page-tree.js +3 -1
  282. package/plugins/runtime-modules/search/widgets/search-results/client.js +4 -2
  283. package/plugins/runtime-modules/theme/presets.d.ts +4 -0
  284. package/plugins/runtime-modules/theme/widgets/brand-controls/client.js +76 -4
  285. package/plugins/runtime-modules/theme/widgets/brand-controls/config.d.ts +3 -2
  286. package/plugins/runtime-modules/theme/widgets/brand-controls/config.js +2 -2
  287. package/plugins/runtime-modules/theme/widgets/brand-controls/plugin.js +19 -7
  288. package/plugins/runtime-modules/threads/client-data-providers.js +5 -0
  289. package/plugins/runtime-modules/threads/controller/definition.js +1 -1
  290. package/plugins/runtime-modules/threads/data-providers.d.ts +115 -2
  291. package/plugins/runtime-modules/threads/data-providers.js +85 -0
  292. package/plugins/runtime-modules/threads/definition.d.ts +115 -2
  293. package/plugins/runtime-modules/threads/definition.js +1 -1
  294. package/plugins/runtime-modules/threads/ids.d.ts +2 -0
  295. package/plugins/runtime-modules/threads/ids.js +3 -0
  296. package/plugins/runtime-modules/threads/services/customer-file-table.d.ts +192 -0
  297. package/plugins/runtime-modules/threads/services/customer-file-table.js +164 -0
  298. package/plugins/runtime-modules/threads/trees/phi-default-threads-page-tree.js +5 -3
  299. package/plugins/runtime-modules/user-management/client-data-providers.js +5 -0
  300. package/plugins/runtime-modules/user-management/data-providers.d.ts +159 -0
  301. package/plugins/runtime-modules/user-management/data-providers.js +101 -3
  302. package/plugins/runtime-modules/user-management/definition.d.ts +159 -0
  303. package/plugins/runtime-modules/user-management/ids.d.ts +9 -0
  304. package/plugins/runtime-modules/user-management/ids.js +9 -0
  305. package/plugins/runtime-modules/user-management/presets.js +17 -1
  306. package/plugins/runtime-modules/user-management/services/users-access-table.d.ts +378 -0
  307. package/plugins/runtime-modules/user-management/services/users-access-table.js +132 -0
  308. package/plugins/runtime-modules/user-management/trees/admin-users-access-label-set.d.ts +86 -0
  309. package/plugins/runtime-modules/user-management/trees/admin-users-access-label-set.js +118 -0
  310. package/plugins/runtime-modules/user-management/trees/phi-default-admin-users-access-page-tree.d.ts +20 -0
  311. package/plugins/runtime-modules/user-management/trees/phi-default-admin-users-access-page-tree.js +166 -0
  312. package/plugins/runtime-modules/user-management/trees/phi-default-admin-users-page-tree.js +19 -18
  313. package/server-helpers/cms-page-record.d.ts +9 -1
  314. package/server-helpers/cms-page-record.js +11 -1
  315. package/server-helpers/cms-request.js +8 -5
  316. package/server-helpers/link-preview-image.d.ts +30 -0
  317. package/server-helpers/link-preview-image.js +57 -0
  318. package/server-helpers/search-text.js +3 -0
  319. package/server-helpers.d.ts +1 -1
  320. package/server-helpers.js +1 -1
  321. package/styles/builder-scaffold.css +7 -1
  322. package/styles/layout-authoring-scaffold.css +27 -0
  323. package/styles/shell.css +30 -6
  324. package/theme/phi-theme-composition.js +9 -0
  325. package/theme/phi-theme-inverse-ground.d.ts +39 -0
  326. package/theme/phi-theme-inverse-ground.js +103 -0
  327. package/theme/phi-theme-tokens.d.ts +2 -1
  328. package/theme/phi-theme-tokens.js +2 -0
  329. package/types/cms-module-descriptors.d.ts +14 -0
  330. package/types/cms-overlay.d.ts +13 -6
  331. package/types/cms-overlay.js +6 -22
  332. package/types/cms-plugins.d.ts +14 -2
  333. package/types/cms.d.ts +10 -0
  334. package/types/core-widget-placements.d.ts +3 -3
  335. package/types/link-preview.d.ts +19 -0
  336. package/types/link-preview.js +19 -0
  337. package/types/record-provider.d.ts +22 -1
  338. package/types/site-theme.d.ts +27 -0
  339. package/types/table-embed.d.ts +48 -0
  340. package/types/table-embed.js +1 -0
  341. package/types/table-widget.d.ts +14 -0
  342. package/types/widget-runtime.d.ts +3 -0
  343. package/types.d.ts +1 -0
  344. /package/{plugins/runtime-modules/threads/controller/address.d.ts → constants/threads-controller-address.d.ts} +0 -0
@@ -74,7 +74,8 @@ function colorPhiCommandButtonIcon(icon, color) {
74
74
  return icon;
75
75
  return createElement("span", { style: { display: "inline-flex", color } }, icon);
76
76
  }
77
- export function usePhiCommandButtons({ buttons, signalRoutes, blockId, labels, disabled, signalsEnabled = true, }) {
77
+ export function usePhiCommandButtons({ buttons, key, signalRoutes, blockId, labels, disabled, initialDisabled = false, initialReadOnly = false, signalsEnabled = true, }) {
78
+ const resolvedKey = key?.trim() || "command";
78
79
  const signalIdentity = usePhiSignalIdentity();
79
80
  const signalPartition = usePhiSignalRuntimePartition();
80
81
  const emitSignal = usePhiSignalEmitter(null);
@@ -82,7 +83,12 @@ export function usePhiCommandButtons({ buttons, signalRoutes, blockId, labels, d
82
83
  const listenRoutes = useMemo(() => signalRoutes?.listens ?? [], [signalRoutes?.listens]);
83
84
  const [commandDisabled, setCommandDisabled] = useState(null);
84
85
  const [buttonStateByKey, setButtonStateByKey] = useState({});
85
- const resolvedDisabled = disabled === true || commandDisabled === true;
86
+ /*
87
+ * A signal's `enabled/change` overrides the stated Disabled, as `usePhiControlSignalController` does.
88
+ * Read only is drawn as disabled, as on the Button Widget: a button that shows alive and does nothing
89
+ * when pressed cannot be told from one that has nothing wired.
90
+ */
91
+ const resolvedDisabled = disabled === true || (commandDisabled ?? initialDisabled) || initialReadOnly;
86
92
  const widgetReceiver = signalIdentity.sender;
87
93
  const buttonAddresses = useMemo(() => new Map(buttons.map((button) => [button.key, resolveButtonSubcontrolAddress(blockId, button.key)])), [blockId, buttons]);
88
94
  useEffect(() => {
@@ -126,7 +132,7 @@ export function usePhiCommandButtons({ buttons, signalRoutes, blockId, labels, d
126
132
  return null;
127
133
  }, [buttonAddresses]);
128
134
  function activate(buttonKey) {
129
- if (!signalsEnabled) {
135
+ if (!signalsEnabled || initialReadOnly) {
130
136
  return;
131
137
  }
132
138
  const button = buttons.find((candidate) => candidate.key === buttonKey);
@@ -306,5 +312,5 @@ export function usePhiCommandButtons({ buttons, signalRoutes, blockId, labels, d
306
312
  badge: resolveButtonBadge(button, buttonState.badge),
307
313
  };
308
314
  });
309
- return { items, disabled: resolvedDisabled, activate };
315
+ return { key: resolvedKey, items, disabled: resolvedDisabled, activate };
310
316
  }
@@ -3,11 +3,12 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { formatPhisMoney } from "@phis/contracts/payments";
4
4
  import { formatPhiDate, formatPhiDateTime } from "../../../../helpers/format-date-time";
5
5
  import { readPhiInternalPath } from "../../../../helpers/internal-path";
6
- import { readPhiMoneyValue } from "../../../../helpers/money-amount";
6
+ import { readPhiMoneyValues } from "../../../../helpers/money-amount";
7
7
  import { formatPhiInterval, readPhiIntervalValue } from "../../label-types/interval";
8
8
  import { usePhiIntlLocale, usePhiIntlTimeZone } from "../../../root/phi-intl-locale";
9
9
  import { PhiFlexControl } from "../../../controls/phi-flex-control";
10
10
  import { PhiTagControl } from "../../../controls/phi-tag-control";
11
+ import { PhiTruncatedHoverText } from "../../../controls/phi-truncated-hover-text";
11
12
  import { PhiTypographyControl } from "../../../controls/phi-typography-control";
12
13
  import { PhiLink } from "../../../navigation/phi-link";
13
14
  import { PhiIcon } from "../../../shell/phi-icon";
@@ -38,6 +39,29 @@ function normalizePhiRenderedText(value) {
38
39
  function resolveTagColor(color) {
39
40
  return typeof color === "object" ? color.value : color;
40
41
  }
42
+ const PHI_RENDERED_TAG_STYLE = { maxWidth: "100%", minWidth: 0 };
43
+ const PHI_RENDERED_TAG_TEXT_STYLE = {
44
+ display: "inline-block",
45
+ maxWidth: "100%",
46
+ overflow: "hidden",
47
+ textOverflow: "ellipsis",
48
+ whiteSpace: "nowrap",
49
+ // Top, not baseline: a box that hides its overflow sits on its bottom edge and would make the row taller.
50
+ verticalAlign: "top",
51
+ };
52
+ /**
53
+ * One Tag of a `badge` or `tags` value, never wider than the place it stands in.
54
+ *
55
+ * A Tag does not wrap: it is one unbreakable box as wide as its word. Where the place is narrower -- a
56
+ * `fixed` column, a `maxWidth`, a cell with `ellipsis`, a narrow record -- the box ran past it: over the
57
+ * next cell, or clipped mid-letter by a cell that hides its overflow. The box now ends at the place's edge
58
+ * and the word ends in an ellipsis, said whole in the house tooltip when pointed at. Where nothing narrows
59
+ * it, as in a `content` column, the Tag is exactly as wide as before: a percentage cap adds nothing to the
60
+ * width a column measures.
61
+ */
62
+ function PhiRenderedTag({ text, color, variant }) {
63
+ return (_jsx(PhiTagControl, { color: color, variant: variant, style: PHI_RENDERED_TAG_STYLE, children: _jsx(PhiTruncatedHoverText, { title: text, children: _jsx("span", { style: PHI_RENDERED_TAG_TEXT_STYLE, children: text }) }) }));
64
+ }
41
65
  /** A component rather than a call, because the page's locale and the Site's zone are read from context. */
42
66
  function PhiRenderedDate({ value, withTime }) {
43
67
  const locale = usePhiIntlLocale();
@@ -45,8 +69,10 @@ function PhiRenderedDate({ value, withTime }) {
45
69
  return withTime ? formatPhiDateTime(value, locale, timeZone) : formatPhiDate(value, locale, timeZone);
46
70
  }
47
71
  /** The reader's locale, not the server's or the browser's, and the currency's own places. */
72
+ /** One amount, or a price list's amounts in its order, side by side. */
48
73
  function PhiRenderedMoney({ value }) {
49
- return formatPhisMoney(value, usePhiIntlLocale());
74
+ const locale = usePhiIntlLocale();
75
+ return value.map((amount) => formatPhisMoney(amount, locale)).join(" · ");
50
76
  }
51
77
  /**
52
78
  * The square a picture is drawn in, in a cell and in a record alike: a line of a list. The server's `icon`
@@ -100,7 +126,7 @@ export function renderPhiValueContent(value, definition, labels, presentation =
100
126
  * nothing rather than its JSON -- a cell that says `{"currency":"CHF"}` is no amount of money.
101
127
  */
102
128
  if (definition.renderer === "money") {
103
- const money = readPhiMoneyValue(value);
129
+ const money = readPhiMoneyValues(value);
104
130
  return money ? _jsx(PhiRenderedMoney, { value: money }) : null;
105
131
  }
106
132
  if (definition.renderer === "interval") {
@@ -117,9 +143,9 @@ export function renderPhiValueContent(value, definition, labels, presentation =
117
143
  }
118
144
  if (definition.renderer === "tags") {
119
145
  const values = Array.isArray(value) ? value : [value];
120
- return (_jsx(PhiFlexControl, { align: "center", gap: 4, wrap: true, style: { display: "inline-flex" }, children: values.map((entry, index) => {
146
+ return (_jsx(PhiFlexControl, { align: "center", gap: 4, wrap: true, style: { display: "inline-flex", maxWidth: "100%" }, children: values.map((entry, index) => {
121
147
  const normalizedEntry = normalizePhiRenderedText(entry);
122
- return (_jsx(PhiTagControl, { color: resolveTagColor(definition.tagColorMap?.[normalizedEntry]), variant: definition.tagVariant ?? "outlined", children: definition.valueMap?.[normalizedEntry] ?? normalizedEntry }, `${normalizedEntry}:${index}`));
148
+ return (_jsx(PhiRenderedTag, { color: resolveTagColor(definition.tagColorMap?.[normalizedEntry]), variant: definition.tagVariant ?? "outlined", text: definition.valueMap?.[normalizedEntry] ?? normalizedEntry }, `${normalizedEntry}:${index}`));
123
149
  }) }));
124
150
  }
125
151
  if (definition.renderer === "date" || definition.renderer === "datetime") {
@@ -132,7 +158,7 @@ export function renderPhiValueContent(value, definition, labels, presentation =
132
158
  return _jsx(PhiTypographyControl, { code: true, children: displayValue });
133
159
  }
134
160
  if (definition.renderer === "badge") {
135
- return (_jsx(PhiTagControl, { color: resolveTagColor(definition.tagColorMap?.[normalizedValue]), variant: definition.tagVariant ?? "outlined", children: displayValue }));
161
+ return (_jsx(PhiRenderedTag, { color: resolveTagColor(definition.tagColorMap?.[normalizedValue]), variant: definition.tagVariant ?? "outlined", text: displayValue }));
136
162
  }
137
163
  if (definition.renderer === "switch" || definition.renderer === "checkbox") {
138
164
  return _jsx(PhiIcon, { name: value === true ? "check" : "close" });
@@ -0,0 +1,13 @@
1
+ /**
2
+ * The code of a read the Provider refuses for this reader, on purpose and for a reason the reader may be
3
+ * told -- their own customer file, which nobody opens. A Provider throws `PhiTableProviderError` with it
4
+ * and the sentence; the Table draws itself with the sentence where its rows would be, live as in the
5
+ * Builder, and keeps its tools, so the reader can ask for something else. Any other failed read is the
6
+ * source's fault and ends the Table (TABLES.md, "A refused read").
7
+ *
8
+ * Nothing is imported here: the Markdown body reads the code in every Area's Public chunk.
9
+ */
10
+ export declare const PHI_TABLE_PROVIDER_REFUSED_CODE = "refused";
11
+ export declare function isPhiTableProviderRefusal(error: {
12
+ code: string;
13
+ } | null | undefined): boolean;
@@ -0,0 +1,13 @@
1
+ /**
2
+ * The code of a read the Provider refuses for this reader, on purpose and for a reason the reader may be
3
+ * told -- their own customer file, which nobody opens. A Provider throws `PhiTableProviderError` with it
4
+ * and the sentence; the Table draws itself with the sentence where its rows would be, live as in the
5
+ * Builder, and keeps its tools, so the reader can ask for something else. Any other failed read is the
6
+ * source's fault and ends the Table (TABLES.md, "A refused read").
7
+ *
8
+ * Nothing is imported here: the Markdown body reads the code in every Area's Public chunk.
9
+ */
10
+ export const PHI_TABLE_PROVIDER_REFUSED_CODE = "refused";
11
+ export function isPhiTableProviderRefusal(error) {
12
+ return error?.code === PHI_TABLE_PROVIDER_REFUSED_CODE;
13
+ }
@@ -24,8 +24,9 @@ export type PhiBackgroundBaseNone = {
24
24
  *
25
25
  * The box paints what the Theme workspace calls the Chrome Overlay -- its colour or picture and its glass
26
26
  * pane -- instead of a ground of its own. It carries nothing else: the Overlay is the Theme's, per mode
27
- * (`root.chrome[mode]`), and the box reads the mode it stands in. A Surface `tone` is that mode, so an
28
- * `inverse` Footer is the dark Overlay on a light page and the light one on a dark page. It is a stated
27
+ * (`root.chrome[mode]`), and the box reads the mode it stands in. A Surface `tone` is that mode; an
28
+ * `inverse` Footer stands on the Theme's opaque Inverse Ground (`root.inverse[mode]`) with the other mode's
29
+ * Chrome picture over it, since that mode's Chrome colour may be glass. It is a stated
29
30
  * ground: a tone does not paint its own container ground beneath it.
30
31
  */
31
32
  export type PhiBackgroundBaseTheme = {
@@ -13,7 +13,16 @@ export type PhiChoiceControlConfig = PhiControlConfig & PhiChoiceOptionsConfig &
13
13
  presentation?: "select" | "autocomplete";
14
14
  allowCustom?: boolean;
15
15
  };
16
- export type PhiStackChoiceControlConfig = PhiChoiceControlConfig & {
16
+ /**
17
+ * The choice Controls that switch a stack -- Segmented, Steps, Tab Bar: options, a value and the Control's
18
+ * state, and none of the select's text entry. `label`, `description` and `presentation` are prepared for
19
+ * presentation variants of their own and drawn by none of them yet.
20
+ */
21
+ export type PhiStackChoiceControlConfig = PhiControlConfig & PhiChoiceOptionsConfig & {
22
+ label?: string;
23
+ description?: string;
24
+ value?: string;
25
+ presentation?: "select" | "autocomplete";
17
26
  valueMode?: PhiChoiceValueMode;
18
27
  };
19
28
  export declare function buildPhiChoiceControlOptionFields(editorPlacement?: "inspector" | "toolbar"): ({
@@ -63,8 +63,14 @@ export function parsePhiChoiceControlConfig(config) {
63
63
  };
64
64
  }
65
65
  export function parsePhiStackChoiceControlConfig(config) {
66
+ const reader = createPhiConfigReader(config);
66
67
  return {
67
- ...parsePhiChoiceControlConfig(config),
68
- valueMode: createPhiConfigReader(config).oneOf("valueMode", ["raw", "stack-slot-index"]) ?? "raw",
68
+ ...parsePhiControlConfig(config, { key: "choice" }),
69
+ label: reader.string("label"),
70
+ description: reader.string("description"),
71
+ value: reader.string("value"),
72
+ presentation: reader.oneOf("presentation", ["select", "autocomplete"]) ?? "select",
73
+ ...parsePhiChoiceOptionsConfig(config),
74
+ valueMode: reader.oneOf("valueMode", ["raw", "stack-slot-index"]) ?? "raw",
69
75
  };
70
76
  }
@@ -40,7 +40,7 @@ const PHI_ADMIN_LOCALES_WIDGET_LABEL_SET = definePhiLabelSet({
40
40
  delete_selected_title: definePhiMessageLabel("Delete %1 selected translations?"),
41
41
  delete_selected_description: definePhiMessageLabel("The selected translated variants will be deleted permanently."),
42
42
  empty_title: definePhiMessageLabel("No translations found."),
43
- empty_text: definePhiMessageLabel("No site translations exist for this language yet."),
43
+ empty_text: definePhiMessageLabel("No site translations exist for this language yet. New translations are entered in Editor > Translations."),
44
44
  load_error: definePhiMessageLabel("Failed to load locale data."),
45
45
  save_error: definePhiMessageLabel("Failed to save locale data."),
46
46
  required_available_locales: definePhiMessageLabel("Select at least one language."),
@@ -9,9 +9,8 @@ export declare function getPhiAdminUsersTableWidgetLabels(options: PhiGlobalTran
9
9
  footer: string;
10
10
  accountTypes: {
11
11
  all: string;
12
- external: string;
13
- roles: string;
14
- auth: string;
12
+ staff: string;
13
+ customer: string;
15
14
  };
16
15
  addonRoles: {
17
16
  all: string;
@@ -100,14 +99,12 @@ export declare function getPhiAdminUsersTableWidgetLabels(options: PhiGlobalTran
100
99
  };
101
100
  actions: {
102
101
  edit: string;
103
- editDisabled: string;
104
102
  history: string;
105
103
  delete: string;
106
104
  };
107
105
  confirm: {
108
106
  deleteTitle: string;
109
107
  deleteSelf: string;
110
- deleteMedusa: string;
111
108
  deleteShared: string;
112
109
  deleteIrreversible: string;
113
110
  ok: string;
@@ -12,9 +12,8 @@ const PHI_ADMIN_USERS_TABLE_WIDGET_LABEL_SET = definePhiLabelSet({
12
12
  add_label: "Add user",
13
13
  footer_count: "%1 users of %2 total",
14
14
  account_type_all: "All",
15
- account_type_external: "External",
16
- account_type_roles: "Local roles",
17
- account_type_auth: "Auth",
15
+ account_type_staff: "Staff",
16
+ account_type_customer: "Customer",
18
17
  enabled_all: "All",
19
18
  enabled_enabled: "Enabled",
20
19
  enabled_disabled: "Disabled",
@@ -84,13 +83,11 @@ const PHI_ADMIN_USERS_TABLE_WIDGET_LABEL_SET = definePhiLabelSet({
84
83
  history_error_title: "Login history failed",
85
84
  delete_confirm_title: definePhiMessageLabel("Delete user?"),
86
85
  delete_confirm_self: definePhiMessageLabel("You cannot delete your own account here."),
87
- delete_confirm_medusa: definePhiMessageLabel("Medusa-managed accounts cannot be deleted here."),
88
86
  delete_confirm_shared: definePhiMessageLabel("This removes the user from the current site. Other site memberships stay intact."),
89
87
  delete_confirm_irreversible: definePhiMessageLabel("Without a backup, this action cannot be undone."),
90
88
  delete_ok_label: "Delete",
91
89
  delete_cancel_label: "Cancel",
92
90
  action_edit_label: "Edit user",
93
- action_edit_disabled_label: definePhiMessageLabel("Medusa-managed accounts cannot be edited here."),
94
91
  action_history_label: "Show login history",
95
92
  action_delete_label: "Delete user",
96
93
  feedback_load_users: definePhiMessageLabel("Failed to load users."),
@@ -114,9 +111,8 @@ export async function getPhiAdminUsersTableWidgetLabels(options) {
114
111
  footer: labels.footer_count,
115
112
  accountTypes: {
116
113
  all: labels.account_type_all,
117
- external: labels.account_type_external,
118
- roles: labels.account_type_roles,
119
- auth: labels.account_type_auth,
114
+ staff: labels.account_type_staff,
115
+ customer: labels.account_type_customer,
120
116
  },
121
117
  addonRoles: {
122
118
  all: labels.addon_roles_all,
@@ -210,14 +206,12 @@ export async function getPhiAdminUsersTableWidgetLabels(options) {
210
206
  },
211
207
  actions: {
212
208
  edit: labels.action_edit_label,
213
- editDisabled: labels.action_edit_disabled_label,
214
209
  history: labels.action_history_label,
215
210
  delete: labels.action_delete_label,
216
211
  },
217
212
  confirm: {
218
213
  deleteTitle: labels.delete_confirm_title,
219
214
  deleteSelf: labels.delete_confirm_self,
220
- deleteMedusa: labels.delete_confirm_medusa,
221
215
  deleteShared: labels.delete_confirm_shared,
222
216
  deleteIrreversible: labels.delete_confirm_irreversible,
223
217
  ok: labels.delete_ok_label,
@@ -1,6 +1,6 @@
1
1
  import "server-only";
2
2
  import { PHI_TR_CTX_WEB_UI_LABEL } from "../../../gateway/tr";
3
- import { definePhiLabelSet, definePhiMessageLabel, getPhiLabelSet } from "../../../gateway/label-set";
3
+ import { definePhiCountLabel, definePhiLabelSet, definePhiMessageLabel, getPhiLabelSet } from "../../../gateway/label-set";
4
4
  import { PHI_EFFECTS_WIDGET_DEFAULT_LABELS, } from "../label-types/effects";
5
5
  const PHI_EFFECTS_WIDGET_LABEL_SET = definePhiLabelSet({
6
6
  key: "widget:effects",
@@ -19,8 +19,7 @@ const PHI_EFFECTS_WIDGET_LABEL_SET = definePhiLabelSet({
19
19
  description_transitions: definePhiMessageLabel(PHI_EFFECTS_WIDGET_DEFAULT_LABELS.descriptions.transitions),
20
20
  description_viewport_effects: definePhiMessageLabel(PHI_EFFECTS_WIDGET_DEFAULT_LABELS.descriptions.viewportEffects),
21
21
  status_off: PHI_EFFECTS_WIDGET_DEFAULT_LABELS.status.off,
22
- status_configured: PHI_EFFECTS_WIDGET_DEFAULT_LABELS.status.configured,
23
- status_configured_plural: PHI_EFFECTS_WIDGET_DEFAULT_LABELS.status.configuredPlural,
22
+ status_configured: definePhiCountLabel(PHI_EFFECTS_WIDGET_DEFAULT_LABELS.status.configured),
24
23
  field_amount: PHI_EFFECTS_WIDGET_DEFAULT_LABELS.fields.amount,
25
24
  field_trigger: PHI_EFFECTS_WIDGET_DEFAULT_LABELS.fields.trigger,
26
25
  field_once: PHI_EFFECTS_WIDGET_DEFAULT_LABELS.fields.once,
@@ -123,7 +122,6 @@ export async function getPhiEffectsWidgetLabels(options) {
123
122
  status: {
124
123
  off: labels.status_off,
125
124
  configured: labels.status_configured,
126
- configuredPlural: labels.status_configured_plural,
127
125
  },
128
126
  fields: {
129
127
  amount: labels.field_amount,
@@ -127,3 +127,16 @@ export declare function getPhiProfilePasswordFormLabels(options: PhiGlobalTransl
127
127
  successText: string;
128
128
  };
129
129
  }>;
130
+ export declare function getPhiProfilePhoneWidgetLabels(options: PhiGlobalTranslatorOptions): Promise<{
131
+ fields: {
132
+ phone: string;
133
+ mobile: string;
134
+ };
135
+ phoneInvalid: string;
136
+ tooLong: string;
137
+ submitLabel: string;
138
+ feedback: {
139
+ successTitle: string;
140
+ successText: string;
141
+ };
142
+ }>;
@@ -44,6 +44,24 @@ const PHI_PROFILE_NAME_WIDGET_LABEL_SET = definePhiLabelSet({
44
44
  success_text: definePhiMessageLabel("Your profile details have been saved."),
45
45
  },
46
46
  });
47
+ /*
48
+ * The two numbers beside the name: a business telephone and a mobile, each as the person writes it. Core
49
+ * keeps them on the profile, so they are the same on every Site, and a person without a name yet is
50
+ * asked for one first (409), which is why they stand in the name's panel.
51
+ */
52
+ const PHI_PROFILE_PHONE_WIDGET_LABEL_SET = definePhiLabelSet({
53
+ key: "widget:profile-phone",
54
+ ctx: PHI_TR_CTX_WEB_UI_LABEL,
55
+ labels: {
56
+ phone_label: "Business phone",
57
+ mobile_label: "Mobile",
58
+ phone_invalid: "Enter a telephone number.",
59
+ too_long: "At most 64 characters.",
60
+ submit_label: "Save",
61
+ success_title: "Numbers updated",
62
+ success_text: definePhiMessageLabel("Your telephone numbers have been saved."),
63
+ },
64
+ });
47
65
  const PHI_PROFILE_OVERVIEW_WIDGET_LABEL_SET = definePhiLabelSet({
48
66
  key: "widget:profile-overview",
49
67
  ctx: PHI_TR_CTX_WEB_UI_LABEL,
@@ -244,3 +262,13 @@ export async function getPhiProfilePasswordFormLabels(options) {
244
262
  feedback: labels.feedback,
245
263
  };
246
264
  }
265
+ export async function getPhiProfilePhoneWidgetLabels(options) {
266
+ const labels = await getPhiLabelSet(options, PHI_PROFILE_PHONE_WIDGET_LABEL_SET);
267
+ return {
268
+ fields: { phone: labels.phone_label, mobile: labels.mobile_label },
269
+ phoneInvalid: labels.phone_invalid,
270
+ tooLong: labels.too_long,
271
+ submitLabel: labels.submit_label,
272
+ feedback: { successTitle: labels.success_title, successText: labels.success_text },
273
+ };
274
+ }
@@ -1,5 +1,5 @@
1
1
  import "server-only";
2
- import { definePhiLabelSet, definePhiMessageLabel, getPhiLabelSet } from "../../../gateway/label-set";
2
+ import { definePhiCountLabel, definePhiLabelSet, definePhiMessageLabel, getPhiLabelSet } from "../../../gateway/label-set";
3
3
  import { PHI_TR_CTX_WEB_UI_LABEL, } from "../../../gateway/tr";
4
4
  import { PHI_SEARCH_RESULTS_WIDGET_DEFAULT_LABELS, } from "../label-types/search-results";
5
5
  /**
@@ -11,8 +11,7 @@ const PHI_SEARCH_RESULTS_WIDGET_LABEL_SET = definePhiLabelSet({
11
11
  ctx: PHI_TR_CTX_WEB_UI_LABEL,
12
12
  labels: {
13
13
  heading: PHI_SEARCH_RESULTS_WIDGET_DEFAULT_LABELS.heading,
14
- count: PHI_SEARCH_RESULTS_WIDGET_DEFAULT_LABELS.count,
15
- count_one: PHI_SEARCH_RESULTS_WIDGET_DEFAULT_LABELS.countOne,
14
+ count: definePhiCountLabel(PHI_SEARCH_RESULTS_WIDGET_DEFAULT_LABELS.count),
16
15
  empty: definePhiMessageLabel(PHI_SEARCH_RESULTS_WIDGET_DEFAULT_LABELS.empty),
17
16
  short: definePhiMessageLabel(PHI_SEARCH_RESULTS_WIDGET_DEFAULT_LABELS.short),
18
17
  idle: definePhiMessageLabel(PHI_SEARCH_RESULTS_WIDGET_DEFAULT_LABELS.idle),
@@ -25,7 +24,6 @@ export async function getPhiSearchResultsWidgetLabels(options) {
25
24
  return {
26
25
  heading: labels.heading,
27
26
  count: labels.count,
28
- countOne: labels.count_one,
29
27
  empty: labels.empty,
30
28
  short: labels.short,
31
29
  idle: labels.idle,
@@ -26,6 +26,10 @@ const PHI_TABLE_WIDGET_LABEL_SET = definePhiLabelSet({
26
26
  drag_row: "Drag row",
27
27
  move_row_up: "Move row up",
28
28
  move_row_down: "Move row down",
29
+ // The Dialog that shows an action's value once.
30
+ reveal_copy_and_close: "Copy and close",
31
+ reveal_close: "Close",
32
+ reveal_copy_failed: definePhiMessageLabel("The value could not be copied. Select it and copy it by hand before closing."),
29
33
  // The Core `table` form field's words where its config names none (`table-field-labels.ts`).
30
34
  form_add: PHI_FORM_TABLE_DEFAULT_LABELS.add,
31
35
  form_remove: PHI_FORM_TABLE_DEFAULT_LABELS.remove,
@@ -57,6 +61,11 @@ export async function getPhiTableWidgetLabels(options) {
57
61
  moveRowUp: labels.move_row_up,
58
62
  moveRowDown: labels.move_row_down,
59
63
  interval,
64
+ reveal: {
65
+ copyAndClose: labels.reveal_copy_and_close,
66
+ close: labels.reveal_close,
67
+ copyFailed: labels.reveal_copy_failed,
68
+ },
60
69
  };
61
70
  }
62
71
  /** The Core `table` form field's add, remove and empty words, which the Form Widget hands to the field. */
@@ -1,3 +1,4 @@
1
+ import type { PhiCountLabel } from "../../../helpers/translation-format";
1
2
  export type PhiEffectsWidgetLabels = {
2
3
  modalTitle: string;
3
4
  openEditor: string;
@@ -18,8 +19,8 @@ export type PhiEffectsWidgetLabels = {
18
19
  };
19
20
  status: {
20
21
  off: string;
21
- configured: string;
22
- configuredPlural: string;
22
+ /** `%1` is how many are configured. */
23
+ configured: PhiCountLabel;
23
24
  };
24
25
  fields: {
25
26
  amount: string;
@@ -17,8 +17,7 @@ export const PHI_EFFECTS_WIDGET_DEFAULT_LABELS = {
17
17
  },
18
18
  status: {
19
19
  off: "Off",
20
- configured: "1 configured",
21
- configuredPlural: "{count} configured",
20
+ configured: { one: "%1 configured", other: "%1 configured" },
22
21
  },
23
22
  fields: {
24
23
  amount: "Amount",
@@ -1,9 +1,9 @@
1
+ import type { PhiCountLabel } from "../../../helpers/translation-format";
1
2
  export type PhiSearchResultsWidgetLabels = {
2
3
  /** `%1` is the query. */
3
4
  heading: string;
4
5
  /** `%1` is how many Pages matched in all. */
5
- count: string;
6
- countOne: string;
6
+ count: PhiCountLabel;
7
7
  /** `%1` is the query. */
8
8
  empty: string;
9
9
  /** `%1` is how many characters a query needs. */
@@ -1,7 +1,6 @@
1
1
  export const PHI_SEARCH_RESULTS_WIDGET_DEFAULT_LABELS = {
2
2
  heading: "Results for “%1”",
3
- count: "%1 pages",
4
- countOne: "1 page",
3
+ count: { one: "%1 page", other: "%1 pages" },
5
4
  empty: "Nothing found for “%1”.",
6
5
  short: "Type at least %1 characters.",
7
6
  idle: "Enter what you are looking for.",
@@ -1,4 +1,5 @@
1
1
  import { type PhiIntervalLabels } from "./interval";
2
+ import { type PhiRevealOnceDialogLabels } from "../../controls/phi-reveal-once-dialog-labels";
2
3
  export type PhiTableWidgetLabels = {
3
4
  search: string;
4
5
  reset: string;
@@ -20,6 +21,8 @@ export type PhiTableWidgetLabels = {
20
21
  moveRowDown: string;
21
22
  /** The words of the `interval` renderer, from their own Label Set. */
22
23
  interval: PhiIntervalLabels;
24
+ /** The buttons of the Dialog that shows an action's value once (`reveal`). */
25
+ reveal: PhiRevealOnceDialogLabels;
23
26
  };
24
27
  export declare const PHI_TABLE_WIDGET_DEFAULT_LABELS: PhiTableWidgetLabels;
25
28
  export declare function formatPhiTableWidgetLabel(template: string, value: string | number): string;
@@ -1,4 +1,5 @@
1
1
  import { PHI_INTERVAL_DEFAULT_LABELS } from "./interval";
2
+ import { PHI_REVEAL_ONCE_DIALOG_DEFAULT_LABELS, } from "../../controls/phi-reveal-once-dialog-labels";
2
3
  export const PHI_TABLE_WIDGET_DEFAULT_LABELS = {
3
4
  search: "Search",
4
5
  reset: "Reset",
@@ -19,6 +20,7 @@ export const PHI_TABLE_WIDGET_DEFAULT_LABELS = {
19
20
  moveRowUp: "Move row up",
20
21
  moveRowDown: "Move row down",
21
22
  interval: PHI_INTERVAL_DEFAULT_LABELS,
23
+ reveal: PHI_REVEAL_ONCE_DIALOG_DEFAULT_LABELS,
22
24
  };
23
25
  export function formatPhiTableWidgetLabel(template, value) {
24
26
  return template.replace("%1", String(value));
@@ -1,6 +1,9 @@
1
1
  import type { PhiBlockRuntime } from "../../../types";
2
+ import type { PhiSignalRouteSet } from "../../../types/signals";
2
3
  export type PhiBuilderChromeWidgetProps = {
3
4
  runtime: Pick<PhiBlockRuntime, "locale">;
4
5
  disabled?: boolean;
5
6
  };
6
- export declare function PhiBuilderModeSwitchWidget({ runtime, disabled, }: PhiBuilderChromeWidgetProps): Promise<import("react").JSX.Element>;
7
+ export declare function PhiBuilderModeSwitchWidget({ runtime, disabled, signalRoutes, }: PhiBuilderChromeWidgetProps & {
8
+ signalRoutes?: PhiSignalRouteSet | null;
9
+ }): Promise<import("react").JSX.Element>;
@@ -6,7 +6,7 @@ import { buildPhiWidgetLabelTranslatorOptions } from "../label-sets/runtime-opti
6
6
  async function getLabels(runtime) {
7
7
  return getPhiBuilderChromeWidgetLabels(buildPhiWidgetLabelTranslatorOptions(runtime));
8
8
  }
9
- export async function PhiBuilderModeSwitchWidget({ runtime, disabled, }) {
9
+ export async function PhiBuilderModeSwitchWidget({ runtime, disabled, signalRoutes, }) {
10
10
  const labels = await getLabels(runtime);
11
- return (_jsx(PhiRuntimeModuleRenderClientHost, { type: PhiRuntimeRenderClientType.BuilderModeSwitch, componentProps: { disabled, labels } }));
11
+ return (_jsx(PhiRuntimeModuleRenderClientHost, { type: PhiRuntimeRenderClientType.BuilderModeSwitch, componentProps: { disabled, labels, signalRoutes: signalRoutes ?? null } }));
12
12
  }
@@ -1,8 +1,12 @@
1
+ import { type CSSProperties } from "react";
1
2
  import type { PhiClientBlockBaseProps } from "../../../types";
2
3
  import type { PhiCodeToken } from "./markdown-code-tokens";
3
4
  import type { PhiMarkdownImageFloat, PhiMarkdownTextAlign } from "../../../types/core-widget-placements";
4
5
  import { type PhiSpacingScaleKey } from "../config/spacing-options";
5
6
  import type { PhiMarkdownTocHeading } from "../../../types/markdown";
7
+ import type { PhiTableWidgetConfig } from "../../../types/table-widget";
8
+ import type { PhiTableWidgetLabels } from "../label-types/table";
9
+ import type { PhiRenderableBlockRenderMode } from "../../../types/renderable-block";
6
10
  import { type PhiMarkdownFoldSections } from "./markdown-sections";
7
11
  import type { PhiImagePresentation } from "../../media/image-presentation";
8
12
  import { type PhiMarkdownFigureFloat, type PhiMarkdownImageFloatWidth } from "./markdown-image-vocabulary";
@@ -101,6 +105,24 @@ export type PhiMarkdownBlock = {
101
105
  } | {
102
106
  kind: "image";
103
107
  image: PhiMarkdownFigure;
108
+ } | ({
109
+ kind: "table_embed";
110
+ } & PhiMarkdownTableEmbed);
111
+ /**
112
+ * A Table a Module offers, standing on its own in the text (`![Caption](phis:table/<key>?...)`), resolved on
113
+ * the server (TABLES.md, "Tables in Markdown"): the Table Widget's config and words, or nothing where the
114
+ * embed was refused.
115
+ */
116
+ export type PhiMarkdownTableEmbed = {
117
+ /** The picture's alt text, translated as the text is: the Table's title when it is drawn. */
118
+ caption: string;
119
+ table: {
120
+ config: PhiTableWidgetConfig;
121
+ labels: PhiTableWidgetLabels;
122
+ renderMode: PhiRenderableBlockRenderMode;
123
+ } | null;
124
+ /** Why it was refused, for the author; set only where the text is authored, never live. */
125
+ notice: string | null;
104
126
  };
105
127
  export type PhiMarkdownWidgetClientProps = PhiClientBlockBaseProps<
106
128
  /** The label above the text, translated on the server. */
@@ -127,3 +149,7 @@ export type PhiMarkdownWidgetClientProps = PhiClientBlockBaseProps<
127
149
  headingOffset?: number;
128
150
  }>;
129
151
  export declare function PhiMarkdownWidgetClient({ config, labels }: PhiMarkdownWidgetClientProps): import("react").JSX.Element | null;
152
+ export declare function PhiMarkdownTableEmbedBlock({ embed, spacing, }: {
153
+ embed: PhiMarkdownTableEmbed;
154
+ spacing: Pick<CSSProperties, "marginBlockStart" | "marginBlockEnd">;
155
+ }): import("react").JSX.Element;
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
3
  import { Fragment, useEffect, useMemo, useState } from "react";
4
4
  import dynamic from "next/dynamic";
5
5
  import { PhiProtectedMailText } from "../../navigation/use-phi-protected-mail";
@@ -14,6 +14,9 @@ import { PhiPlainTable } from "../../tables/phi-plain-table";
14
14
  import { PhiTypographyControl } from "../../controls/phi-typography-control";
15
15
  import { PhiDividerControl } from "../../controls/phi-divider-control";
16
16
  import { PhiBulletListControl } from "../../controls/phi-bullet-list-control";
17
+ import { PhiRuntimeModuleRenderClientHost } from "../../runtime/runtime-module-render-client-manifest";
18
+ import { PhiCmsWidgetType } from "../../../constants/cms-widget-types";
19
+ import { PHI_TABLE_PROVIDER_REFUSED_CODE } from "../client/shared/phi-table-provider-refusal";
17
20
  import { resolvePhiMarkdownFoldLevel, splitPhiMarkdownSegments, } from "./markdown-sections";
18
21
  import { resolvePhiMarkdownFigureSizes, } from "./markdown-image-vocabulary";
19
22
  import { resolvePhiBulletListStyle, } from "./bullet-list-vocabulary";
@@ -144,6 +147,8 @@ function renderBlocks(blocks, token, paragraphStyle, headingStyle, lists, atStar
144
147
  }) }) }, key));
145
148
  case "divider":
146
149
  return _jsx(PhiDividerControl, { style: { margin: 0 } }, key);
150
+ case "table_embed":
151
+ return (_jsx(PhiMarkdownTableEmbedBlock, { embed: block, spacing: { marginBlockStart: paragraphBlockStyle.marginBlockStart, marginBlockEnd: paragraphBlockStyle.marginBlockEnd } }, key));
147
152
  case "table":
148
153
  /*
149
154
  * A plain table, not the Table Control: Markdown only shows rows, and the Control's editors,
@@ -275,3 +280,28 @@ function PhiMarkdownFigureBlock({ figure }) {
275
280
  const ownRatio = presentation.width && presentation.height ? `${presentation.width} / ${presentation.height}` : undefined;
276
281
  return (_jsx("figure", { className: `phi-markdown-figure phi-markdown-figure--float-${figure.float} phi-markdown-figure--width-${figure.floatWidth}`, children: _jsx("div", { className: "phi-markdown-figure__frame", style: { aspectRatio: figure.aspectRatio ?? ownRatio }, children: _jsx(PhiImageControl, { presentation: presentation, source: "asset", alt: figure.alt, title: figure.title, blurDataUrl: figure.blurDataUrl, optimizable: figure.optimizable, sizes: resolvePhiMarkdownFigureSizes(figure.float, figure.floatWidth), style: { width: "100%", height: "100%" }, imageStyle: { width: "100%", height: "100%" } }) }) }));
277
282
  }
283
+ /*
284
+ * An embedded Table: the Table Widget's own Render Client, by its type in the Area's manifest, which loads it
285
+ * with `next/dynamic` where one is drawn -- the Table's code is in no chunk of the Markdown Widget, and a
286
+ * text without an embed never asks for it. Refused, the caption stands as a paragraph, with the reason
287
+ * beneath it where the text is authored.
288
+ */
289
+ export function PhiMarkdownTableEmbedBlock({ embed, spacing, }) {
290
+ /*
291
+ * The caption is the Table's title, so a Table that cannot draw takes it along: live, a failed read --
292
+ * a viewer the Provider refuses -- draws nothing at all. The Table says so in its state, and the caption
293
+ * then stands as the paragraph it is everywhere else. A refused read the Provider explains is no such
294
+ * failure: that Table draws itself, title and all.
295
+ */
296
+ const [tableFailed, setTableFailed] = useState(false);
297
+ const componentProps = useMemo(() => embed.table
298
+ ? {
299
+ ...embed.table,
300
+ onStateChange: (state) => setTableFailed(state.errorCode != null && state.errorCode !== PHI_TABLE_PROVIDER_REFUSED_CODE),
301
+ }
302
+ : null, [embed.table]);
303
+ if (componentProps) {
304
+ return (_jsxs("figure", { className: "phi-markdown-table-embed", style: { margin: 0, minWidth: 0, ...spacing }, children: [tableFailed && embed.caption ? (_jsx(PhiTypographyControl, { presentation: "paragraph", style: { margin: 0 }, children: embed.caption })) : null, _jsx(PhiRuntimeModuleRenderClientHost, { type: PhiCmsWidgetType.Table, componentProps: componentProps })] }));
305
+ }
306
+ return (_jsxs(_Fragment, { children: [embed.caption ? (_jsx(PhiTypographyControl, { presentation: "paragraph", style: { margin: 0, ...spacing }, children: embed.caption })) : null, embed.notice ? (_jsx(PhiTypographyControl, { presentation: "paragraph", type: "warning", style: { margin: 0, ...spacing }, children: embed.notice })) : null] }));
307
+ }