@phis/ui 0.5.2 → 0.5.4

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 (284) hide show
  1. package/README.md +1 -1
  2. package/components/controls/phi-border-control.js +1 -1
  3. package/components/controls/phi-bound-radius-control.js +9 -9
  4. package/components/controls/phi-brand-control.js +1 -1
  5. package/components/controls/phi-cascader-control.d.ts +9 -1
  6. package/components/controls/phi-cascader-control.js +25 -3
  7. package/components/controls/phi-drawer-control-adapter.js +4 -4
  8. package/components/controls/phi-dropdown-control.js +2 -2
  9. package/components/controls/phi-form-control.js +1 -1
  10. package/components/controls/phi-image-control.js +1 -1
  11. package/components/controls/phi-mask-picker-control.js +6 -6
  12. package/components/controls/phi-money-control.d.ts +39 -0
  13. package/components/controls/phi-money-control.js +34 -0
  14. package/components/controls/phi-number-control.d.ts +6 -1
  15. package/components/controls/phi-number-control.js +3 -3
  16. package/components/controls/phi-options-provider.d.ts +7 -0
  17. package/components/controls/phi-options-provider.js +11 -0
  18. package/components/controls/phi-select-control.js +1 -1
  19. package/components/controls/phi-theme-scope-control.js +1 -1
  20. package/components/controls/use-phi-color-control-presets.js +2 -2
  21. package/components/forms/compound-form-controls.js +2 -2
  22. package/components/forms/extended-form-field-controls.d.ts +1 -0
  23. package/components/forms/extended-form-field-controls.js +24 -2
  24. package/components/forms/form-descriptor-runtime-client.js +13 -0
  25. package/components/forms/form-provider-contract.d.ts +43 -0
  26. package/components/forms/form-provider-contract.js +40 -0
  27. package/components/forms/money-field.d.ts +27 -0
  28. package/components/forms/money-field.js +78 -0
  29. package/components/forms/shared-form-provider-registry.js +6 -2
  30. package/components/layouts/clients/phi-flex-layout-client.js +4 -4
  31. package/components/layouts/clients/phi-grid-layout-client.js +3 -3
  32. package/components/layouts/clients/phi-sequence-slot-editor.js +1 -1
  33. package/components/layouts/layout-definitions.d.ts +4 -4
  34. package/components/layouts/phi-page-region-layout.js +1 -1
  35. package/components/layouts/phi-structure-region-layout.js +3 -3
  36. package/components/media/phi-asset-focal-rect-widget.js +4 -4
  37. package/components/media/phi-asset-inspector-section.js +1 -1
  38. package/components/media/phi-media-kind-icon.js +2 -2
  39. package/components/media/phi-media-picker-binding.js +6 -1
  40. package/components/media/phi-media-restricted-icon.js +1 -1
  41. package/components/media/phi-site-font-assets.js +6 -1
  42. package/components/motion/phi-sequence-run.d.ts +14 -1
  43. package/components/motion/phi-sequence-run.js +22 -3
  44. package/components/motion/phi-sequence-viewport.js +3 -1
  45. package/components/overlays/phi-overlay-container-client.js +1 -1
  46. package/components/regions/presets/content-entry-editor-page-tree.js +3 -1
  47. package/components/regions/presets/phi-base-page-column.js +6 -2
  48. package/components/root/phi-config-provider.js +1 -1
  49. package/components/root/phi-root-background.js +1 -1
  50. package/components/root/phi-root-theme-resolver.js +1 -1
  51. package/components/shell/phi-module-icons.js +1 -1
  52. package/components/tables/client/phi-table-binding.js +16 -3
  53. package/components/trees/client/phi-tree-binding.js +6 -2
  54. package/components/widgets/built-in/builder-workspace-preview.js +8 -8
  55. package/components/widgets/client/bullet-list-entries-editor.js +2 -2
  56. package/components/widgets/client/external-document-editor.js +1 -1
  57. package/components/widgets/client/html-editor.js +3 -3
  58. package/components/widgets/client/shared/phi-collection-view-binding.js +10 -2
  59. package/components/widgets/client/shared/phi-rendered-value.d.ts +9 -1
  60. package/components/widgets/client/shared/phi-rendered-value.js +20 -1
  61. package/components/widgets/config/background.d.ts +1 -1
  62. package/components/widgets/config/background.js +1 -1
  63. package/components/widgets/config/choice-shared.d.ts +2 -2
  64. package/components/widgets/inspector-field-row.js +1 -1
  65. package/components/widgets/label-sets/gallery.js +6 -0
  66. package/components/widgets/label-sets/inspector.js +2 -0
  67. package/components/widgets/label-sets/interval.d.ts +4 -0
  68. package/components/widgets/label-sets/interval.js +31 -0
  69. package/components/widgets/label-sets/record.js +6 -1
  70. package/components/widgets/label-sets/slot-upload.d.ts +4 -0
  71. package/components/widgets/label-sets/slot-upload.js +36 -0
  72. package/components/widgets/label-sets/table.js +6 -1
  73. package/components/widgets/label-types/gallery.d.ts +7 -0
  74. package/components/widgets/label-types/gallery.js +6 -0
  75. package/components/widgets/label-types/inspector.d.ts +1 -0
  76. package/components/widgets/label-types/inspector.js +1 -0
  77. package/components/widgets/label-types/interval.d.ts +16 -0
  78. package/components/widgets/label-types/interval.js +21 -0
  79. package/components/widgets/label-types/record.d.ts +3 -0
  80. package/components/widgets/label-types/record.js +2 -0
  81. package/components/widgets/label-types/slot-upload.d.ts +24 -0
  82. package/components/widgets/label-types/slot-upload.js +16 -0
  83. package/components/widgets/label-types/table.d.ts +3 -0
  84. package/components/widgets/label-types/table.js +2 -0
  85. package/components/widgets/shared/card-body-client.js +1 -1
  86. package/components/widgets/shared/result-body-client.js +1 -1
  87. package/constants/media-library-provider-keys.d.ts +8 -1
  88. package/constants/media-library-provider-keys.js +8 -1
  89. package/constants/record-field-kinds.d.ts +6 -0
  90. package/constants/record-field-kinds.js +7 -0
  91. package/constants/runtime-module-ownership.js +2 -1
  92. package/controls.d.ts +7 -0
  93. package/controls.js +4 -0
  94. package/helpers/border-widget-style.d.ts +2 -2
  95. package/helpers/border-widget-style.js +2 -2
  96. package/helpers/cms-dialog.d.ts +43 -7
  97. package/helpers/cms-dialog.js +46 -4
  98. package/helpers/cms-layout-defaults.d.ts +2 -2
  99. package/helpers/cms-page-catalog.d.ts +13 -0
  100. package/helpers/cms-page-catalog.js +18 -2
  101. package/helpers/cms-preset-nodes.d.ts +13 -3
  102. package/helpers/cms-preset-nodes.js +3 -2
  103. package/helpers/cms-preset-page-tree.d.ts +4 -0
  104. package/helpers/cms-preset-page-tree.js +2 -0
  105. package/helpers/layout-style.d.ts +2 -2
  106. package/helpers/money-amount.d.ts +48 -0
  107. package/helpers/money-amount.js +131 -0
  108. package/helpers/page-layout-check.d.ts +4 -1
  109. package/helpers/page-layout-check.js +41 -2
  110. package/helpers/record-fields.d.ts +22 -0
  111. package/helpers/record-fields.js +109 -0
  112. package/helpers/surface-presets.d.ts +6 -6
  113. package/helpers/surface-style.d.ts +1 -1
  114. package/helpers.d.ts +0 -1
  115. package/helpers.js +0 -2
  116. package/module-page-check.d.ts +12 -0
  117. package/module-page-check.js +12 -0
  118. package/module-records.d.ts +7 -2
  119. package/module-records.js +5 -1
  120. package/next/antd-form-context-loader.mjs +31 -0
  121. package/next/config.d.mts +2 -0
  122. package/next/config.mjs +36 -3
  123. package/package.json +11 -2
  124. package/plugins/runtime-modules/accounting/module.d.ts +1 -1
  125. package/plugins/runtime-modules/app/module.d.ts +1 -1
  126. package/plugins/runtime-modules/asset/data-providers.d.ts +0 -65
  127. package/plugins/runtime-modules/asset/data-providers.js +0 -40
  128. package/plugins/runtime-modules/asset/definition.d.ts +0 -60
  129. package/plugins/runtime-modules/asset/ids.d.ts +0 -1
  130. package/plugins/runtime-modules/asset/ids.js +1 -2
  131. package/plugins/runtime-modules/asset/presets.d.ts +1 -0
  132. package/plugins/runtime-modules/asset/server.js +0 -5
  133. package/plugins/runtime-modules/asset/services/collection.js +1 -0
  134. package/plugins/runtime-modules/asset/trees/phi-default-builder-media-page-tree.js +2 -2
  135. package/plugins/runtime-modules/auth/trees/phi-default-admin-auth-settings-page-tree.js +3 -0
  136. package/plugins/runtime-modules/blog/presets.d.ts +1 -0
  137. package/plugins/runtime-modules/builder/clients/inspector-config-field.d.ts +4 -1
  138. package/plugins/runtime-modules/builder/clients/inspector-config-field.js +13 -4
  139. package/plugins/runtime-modules/builder/clients/inspector-link-target-field.js +1 -1
  140. package/plugins/runtime-modules/builder/clients/inspector-section-widget.js +14 -1
  141. package/plugins/runtime-modules/builder/clients/inspector-signal-section.js +2 -2
  142. package/plugins/runtime-modules/builder/clients/layout-inspector.js +1 -1
  143. package/plugins/runtime-modules/builder/clients/layout-scaffold-buttons.js +4 -4
  144. package/plugins/runtime-modules/builder/clients/layout-scaffold-overlays.js +1 -1
  145. package/plugins/runtime-modules/builder/clients/region-inspector.js +1 -1
  146. package/plugins/runtime-modules/builder/clients/region-visibility-fields.js +1 -1
  147. package/plugins/runtime-modules/builder/clients/shells-workspace.js +1 -1
  148. package/plugins/runtime-modules/builder/clients/structure-canvas.js +2 -2
  149. package/plugins/runtime-modules/builder/clients/widget-effects-editor.js +1 -1
  150. package/plugins/runtime-modules/builder/clients/widget-inspector.d.ts +4 -1
  151. package/plugins/runtime-modules/builder/clients/widget-inspector.js +3 -2
  152. package/plugins/runtime-modules/builder/offered-page-catalog.js +3 -3
  153. package/plugins/runtime-modules/builder/options-providers.js +7 -0
  154. package/plugins/runtime-modules/builder/page-presets.server.d.ts +6 -0
  155. package/plugins/runtime-modules/builder/page-presets.server.js +8 -0
  156. package/plugins/runtime-modules/builder/pages-workspace.js +12 -1
  157. package/plugins/runtime-modules/builder/render-root-node-scaffold.js +5 -5
  158. package/plugins/runtime-modules/builder/structure-dnd.js +2 -2
  159. package/plugins/runtime-modules/builder/trees/phi-default-builder-area-preset-tree.js +6 -3
  160. package/plugins/runtime-modules/builder/widgets/test-block/client.js +1 -1
  161. package/plugins/runtime-modules/content-entry-routes.d.ts +1 -0
  162. package/plugins/runtime-modules/contracts.js +41 -1
  163. package/plugins/runtime-modules/core/data-providers.d.ts +60 -0
  164. package/plugins/runtime-modules/core/data-providers.js +41 -0
  165. package/plugins/runtime-modules/core/definition.d.ts +98 -0
  166. package/plugins/runtime-modules/core/form-providers.d.ts +43 -0
  167. package/plugins/runtime-modules/core/server.js +5 -0
  168. package/plugins/runtime-modules/core/widgets/breadcrumb/client.d.ts +6 -3
  169. package/plugins/runtime-modules/core/widgets/breadcrumb/client.js +6 -5
  170. package/plugins/runtime-modules/core/widgets/breadcrumb/plugin.js +1 -1
  171. package/plugins/runtime-modules/core/widgets/breadcrumb/server.d.ts +9 -1
  172. package/plugins/runtime-modules/core/widgets/breadcrumb/server.js +29 -3
  173. package/plugins/runtime-modules/core/widgets/button/config.d.ts +34 -0
  174. package/plugins/runtime-modules/core/widgets/button/config.js +16 -0
  175. package/plugins/runtime-modules/core/widgets/button/plugin.js +37 -6
  176. package/plugins/runtime-modules/core/widgets/card/config.d.ts +13 -2
  177. package/plugins/runtime-modules/core/widgets/cascader/authoring.d.ts +3 -3
  178. package/plugins/runtime-modules/core/widgets/cascader/client.js +1 -1
  179. package/plugins/runtime-modules/core/widgets/cascader/config.d.ts +8 -2
  180. package/plugins/runtime-modules/core/widgets/cascader/config.js +22 -0
  181. package/plugins/runtime-modules/core/widgets/checkbox-group/config.d.ts +1 -1
  182. package/plugins/runtime-modules/core/widgets/description/config.d.ts +13 -2
  183. package/plugins/runtime-modules/core/widgets/description/editor.js +13 -13
  184. package/plugins/runtime-modules/core/widgets/entry-list/config.d.ts +11 -0
  185. package/plugins/runtime-modules/core/widgets/gallery/authoring.js +12 -3
  186. package/plugins/runtime-modules/core/widgets/gallery/client.d.ts +4 -1
  187. package/plugins/runtime-modules/core/widgets/gallery/client.js +38 -21
  188. package/plugins/runtime-modules/core/widgets/gallery/config.d.ts +18 -0
  189. package/plugins/runtime-modules/core/widgets/gallery/config.js +24 -0
  190. package/plugins/runtime-modules/core/widgets/gallery/server.d.ts +1 -1
  191. package/plugins/runtime-modules/core/widgets/gallery/server.js +11 -0
  192. package/plugins/runtime-modules/core/widgets/image/config.d.ts +35 -0
  193. package/plugins/runtime-modules/core/widgets/image/config.js +8 -0
  194. package/plugins/runtime-modules/core/widgets/image/plugin.js +19 -1
  195. package/plugins/runtime-modules/core/widgets/image/server.d.ts +3 -1
  196. package/plugins/runtime-modules/core/widgets/image/server.js +2 -2
  197. package/plugins/runtime-modules/core/widgets/markdown/config.d.ts +13 -0
  198. package/plugins/runtime-modules/core/widgets/markdown/config.js +8 -0
  199. package/plugins/runtime-modules/core/widgets/markdown/editor.js +7 -7
  200. package/plugins/runtime-modules/core/widgets/markdown/plugin.js +20 -7
  201. package/plugins/runtime-modules/core/widgets/multi-select/config.d.ts +1 -1
  202. package/plugins/runtime-modules/core/widgets/record/authoring.js +1 -1
  203. package/plugins/runtime-modules/core/widgets/record/client.js +8 -2
  204. package/plugins/runtime-modules/core/widgets/record/config.js +4 -0
  205. package/plugins/runtime-modules/core/widgets/result/config.d.ts +11 -0
  206. package/plugins/runtime-modules/core/widgets/segmented/config.d.ts +1 -1
  207. package/plugins/runtime-modules/core/widgets/select-box/config.d.ts +1 -1
  208. package/plugins/runtime-modules/core/widgets/simple-text/config.d.ts +13 -0
  209. package/plugins/runtime-modules/core/widgets/simple-text/config.js +9 -0
  210. package/plugins/runtime-modules/core/widgets/simple-text/editor.js +1 -1
  211. package/plugins/runtime-modules/core/widgets/simple-text/plugin.js +14 -1
  212. package/plugins/runtime-modules/core/widgets/slot-upload/authoring.js +2 -1
  213. package/plugins/runtime-modules/core/widgets/slot-upload/client.d.ts +3 -1
  214. package/plugins/runtime-modules/core/widgets/slot-upload/client.js +45 -24
  215. package/plugins/runtime-modules/core/widgets/slot-upload/config.d.ts +12 -4
  216. package/plugins/runtime-modules/core/widgets/slot-upload/config.js +18 -1
  217. package/plugins/runtime-modules/core/widgets/slot-upload/plugin.js +4 -2
  218. package/plugins/runtime-modules/core/widgets/slot-upload/server.d.ts +9 -3
  219. package/plugins/runtime-modules/core/widgets/slot-upload/server.js +17 -3
  220. package/plugins/runtime-modules/core/widgets/spacer/client.js +1 -1
  221. package/plugins/runtime-modules/core/widgets/steps/config.d.ts +1 -1
  222. package/plugins/runtime-modules/core/widgets/table/client.js +4 -4
  223. package/plugins/runtime-modules/core/widgets/table/config.d.ts +37 -0
  224. package/plugins/runtime-modules/core/widgets/table/config.js +3 -0
  225. package/plugins/runtime-modules/descriptor-compiler.d.ts +11 -1
  226. package/plugins/runtime-modules/descriptor-compiler.js +57 -8
  227. package/plugins/runtime-modules/editor/presets.d.ts +1 -0
  228. package/plugins/runtime-modules/groups/definition.d.ts +1 -1
  229. package/plugins/runtime-modules/groups/forms.d.ts +18 -0
  230. package/plugins/runtime-modules/groups/forms.js +2 -2
  231. package/plugins/runtime-modules/groups/trees/phi-default-admin-groups-page-tree.js +6 -4
  232. package/plugins/runtime-modules/localization/presets.d.ts +1 -0
  233. package/plugins/runtime-modules/news/presets.d.ts +1 -0
  234. package/plugins/runtime-modules/public/module.d.ts +1 -1
  235. package/plugins/runtime-modules/resolver.js +7 -0
  236. package/plugins/runtime-modules/revisions/presets.d.ts +1 -0
  237. package/plugins/runtime-modules/revisions/trees/phi-default-builder-revisions-page-tree.js +2 -2
  238. package/plugins/runtime-modules/theme/presets.d.ts +1 -0
  239. package/plugins/runtime-modules/theme/widgets/brand-controls/client.js +25 -2
  240. package/plugins/runtime-modules/threads/trees/phi-default-threads-page-tree.js +4 -2
  241. package/plugins/runtime-modules/user-management/controller/client.js +6 -1
  242. package/plugins/runtime-modules/user-management/trees/phi-default-admin-users-page-tree.js +3 -3
  243. package/runtime-render-client.d.ts +1 -1
  244. package/runtime-render-client.js +2 -1
  245. package/server-helpers/cms-page-record.d.ts +26 -0
  246. package/server-helpers/cms-page-record.js +52 -0
  247. package/server-helpers/cms-request.js +48 -4
  248. package/server-helpers/record-fields.d.ts +62 -0
  249. package/server-helpers/record-fields.js +86 -0
  250. package/server-helpers/record-samples.d.ts +21 -0
  251. package/server-helpers/record-samples.js +49 -0
  252. package/styles/builder-scaffold.css +19 -19
  253. package/styles/controls.css +109 -109
  254. package/styles/gradients.css +23 -23
  255. package/styles/layout-affordances.css +15 -15
  256. package/styles/layout-authoring-scaffold.css +20 -20
  257. package/styles/layout.css +9 -9
  258. package/styles/root.css +4 -4
  259. package/styles/shell.css +48 -17
  260. package/theme/antd-css-var-contract.d.ts +86 -80
  261. package/theme/antd-css-var-contract.js +92 -81
  262. package/theme/phi-control-shape.d.ts +1 -1
  263. package/theme/phi-theme-gradients.d.ts +2 -2
  264. package/theme/phi-theme-gradients.js +14 -14
  265. package/theme/phi-theme-palette.d.ts +1 -1
  266. package/theme/phi-theme-palette.js +2 -2
  267. package/theme/phi-theme-tokens.d.ts +8 -5
  268. package/theme/phi-theme-tokens.js +59 -28
  269. package/theme/phi-theme.d.ts +14 -2
  270. package/theme/phi-theme.js +14 -1
  271. package/theme/phi-tokens.d.ts +5 -0
  272. package/theme/phi-tokens.js +9 -0
  273. package/types/cms-module-descriptors.d.ts +9 -0
  274. package/types/cms-plugins.d.ts +27 -1
  275. package/types/collection-provider.d.ts +7 -0
  276. package/types/core-widget-placements.d.ts +42 -0
  277. package/types/record-provider.d.ts +109 -1
  278. package/types/table-widget.d.ts +33 -1
  279. package/types/table-widget.js +1 -0
  280. package/types/tree-widget.d.ts +7 -0
  281. package/types/widget-runtime.d.ts +5 -0
  282. package/types.d.ts +1 -0
  283. /package/plugins/runtime-modules/{asset/services/folder-images.server.d.ts → core/services/media-folder-images.server.d.ts} +0 -0
  284. /package/plugins/runtime-modules/{asset/services/folder-images.server.js → core/services/media-folder-images.server.js} +0 -0
@@ -9,112 +9,123 @@ export const PHI_COLOR = {
9
9
  * The primary colour's ladder, as the Theme derives it per mode -- the same ten the colour picker offers
10
10
  * as the Theme's primary swatches, so a colour picked there is stored as its role and follows the Theme.
11
11
  */
12
- primaryBg: "var(--ant-color-primary-bg)",
13
- primaryBgHover: "var(--ant-color-primary-bg-hover)",
14
- primaryBorder: "var(--ant-color-primary-border)",
15
- primaryBorderHover: "var(--ant-color-primary-border-hover)",
16
- primaryHover: "var(--ant-color-primary-hover)",
17
- primary: "var(--ant-color-primary)",
18
- primaryActive: "var(--ant-color-primary-active)",
19
- primaryTextHover: "var(--ant-color-primary-text-hover)",
20
- primaryText: "var(--ant-color-primary-text)",
21
- primaryTextActive: "var(--ant-color-primary-text-active)",
22
- link: "var(--ant-color-link)",
23
- linkHover: "var(--ant-color-link-hover)",
12
+ primaryBg: "var(--phi-color-primary-bg)",
13
+ primaryBgHover: "var(--phi-color-primary-bg-hover)",
14
+ primaryBorder: "var(--phi-color-primary-border)",
15
+ primaryBorderHover: "var(--phi-color-primary-border-hover)",
16
+ primaryHover: "var(--phi-color-primary-hover)",
17
+ primary: "var(--phi-color-primary)",
18
+ primaryActive: "var(--phi-color-primary-active)",
19
+ primaryTextHover: "var(--phi-color-primary-text-hover)",
20
+ primaryText: "var(--phi-color-primary-text)",
21
+ primaryTextActive: "var(--phi-color-primary-text-active)",
22
+ link: "var(--phi-color-link)",
23
+ linkHover: "var(--phi-color-link-hover)",
24
24
  /* The text ladder, likewise the picker's text swatches. */
25
- textBase: "var(--ant-color-text-base)",
26
- text: "var(--ant-color-text)",
27
- textSecondary: "var(--ant-color-text-secondary)",
28
- textTertiary: "var(--ant-color-text-tertiary)",
29
- textQuaternary: "var(--ant-color-text-quaternary)",
30
- textHeading: "var(--ant-color-text-heading)",
31
- textLabel: "var(--ant-color-text-label)",
32
- textDescription: "var(--ant-color-text-description)",
33
- textPlaceholder: "var(--ant-color-text-placeholder)",
34
- textDisabled: "var(--ant-color-text-disabled)",
35
- textLightSolid: "var(--ant-color-text-light-solid)",
36
- bgContainer: "var(--ant-color-bg-container)",
37
- bgLayout: "var(--ant-color-bg-layout)",
38
- bgElevated: "var(--ant-color-bg-elevated)",
39
- bgSpotlight: "var(--ant-color-bg-spotlight)",
40
- fill: "var(--ant-color-fill)",
41
- fillSecondary: "var(--ant-color-fill-secondary)",
42
- fillTertiary: "var(--ant-color-fill-tertiary)",
43
- fillQuaternary: "var(--ant-color-fill-quaternary)",
44
- border: "var(--ant-color-border)",
45
- borderSecondary: "var(--ant-color-border-secondary)",
46
- linkActive: "var(--ant-color-link-active)",
47
- split: "var(--ant-color-split)",
48
- error: "var(--ant-color-error)",
49
- success: "var(--ant-color-success)",
50
- warning: "var(--ant-color-warning)",
25
+ textBase: "var(--phi-color-text-base)",
26
+ text: "var(--phi-color-text)",
27
+ textSecondary: "var(--phi-color-text-secondary)",
28
+ textTertiary: "var(--phi-color-text-tertiary)",
29
+ textQuaternary: "var(--phi-color-text-quaternary)",
30
+ textHeading: "var(--phi-color-text-heading)",
31
+ textLabel: "var(--phi-color-text-label)",
32
+ textDescription: "var(--phi-color-text-description)",
33
+ textPlaceholder: "var(--phi-color-text-placeholder)",
34
+ textDisabled: "var(--phi-color-text-disabled)",
35
+ textLightSolid: "var(--phi-color-text-light-solid)",
36
+ bgContainer: "var(--phi-color-bg-container)",
37
+ bgLayout: "var(--phi-color-bg-layout)",
38
+ bgElevated: "var(--phi-color-bg-elevated)",
39
+ bgSpotlight: "var(--phi-color-bg-spotlight)",
40
+ fill: "var(--phi-color-fill)",
41
+ fillSecondary: "var(--phi-color-fill-secondary)",
42
+ fillTertiary: "var(--phi-color-fill-tertiary)",
43
+ fillQuaternary: "var(--phi-color-fill-quaternary)",
44
+ border: "var(--phi-color-border)",
45
+ borderSecondary: "var(--phi-color-border-secondary)",
46
+ linkActive: "var(--phi-color-link-active)",
47
+ split: "var(--phi-color-split)",
48
+ error: "var(--phi-color-error)",
49
+ success: "var(--phi-color-success)",
50
+ warning: "var(--phi-color-warning)",
51
51
  /*
52
52
  * The palette's ten custom colours, per mode, written by the Theme as tokens of its own
53
- * (`phiCustom1` ... `phiCustom10`, theme/phi-theme-palette.ts).
53
+ * (`custom1` ... `custom10`, theme/phi-theme-palette.ts).
54
54
  */
55
- custom1: "var(--ant-phi-custom-1)",
56
- custom2: "var(--ant-phi-custom-2)",
57
- custom3: "var(--ant-phi-custom-3)",
58
- custom4: "var(--ant-phi-custom-4)",
59
- custom5: "var(--ant-phi-custom-5)",
60
- custom6: "var(--ant-phi-custom-6)",
61
- custom7: "var(--ant-phi-custom-7)",
62
- custom8: "var(--ant-phi-custom-8)",
63
- custom9: "var(--ant-phi-custom-9)",
64
- custom10: "var(--ant-phi-custom-10)",
55
+ custom1: "var(--phi-custom-1)",
56
+ custom2: "var(--phi-custom-2)",
57
+ custom3: "var(--phi-custom-3)",
58
+ custom4: "var(--phi-custom-4)",
59
+ custom5: "var(--phi-custom-5)",
60
+ custom6: "var(--phi-custom-6)",
61
+ custom7: "var(--phi-custom-7)",
62
+ custom8: "var(--phi-custom-8)",
63
+ custom9: "var(--phi-custom-9)",
64
+ custom10: "var(--phi-custom-10)",
65
65
  };
66
66
  /**
67
67
  * Every distance a Phi surface states, inside a frame (`padding`) and between two things (`gap`), on the
68
- * one scale (`theme/phi-tokens.ts`, `PHI_PADDING`). Ant Design's `--ant-margin-*` family carries the
68
+ * one scale (`theme/phi-tokens.ts`, `PHI_PADDING`). Ant Design's `--phi-margin-*` family carries the
69
69
  * same values and stays Ant Design's own.
70
70
  */
71
71
  export const PHI_SPACE = {
72
- xxs: "var(--ant-padding-xxs)",
73
- xs: "var(--ant-padding-xs)",
74
- sm: "var(--ant-padding-sm)",
75
- base: "var(--ant-padding)",
76
- md: "var(--ant-padding-md)",
77
- lg: "var(--ant-padding-lg)",
78
- xl: "var(--ant-padding-xl)",
79
- xxl: "var(--ant-padding-xxl)",
72
+ xxs: "var(--phi-padding-xxs)",
73
+ xs: "var(--phi-padding-xs)",
74
+ sm: "var(--phi-padding-sm)",
75
+ base: "var(--phi-padding)",
76
+ md: "var(--phi-padding-md)",
77
+ lg: "var(--phi-padding-lg)",
78
+ xl: "var(--phi-padding-xl)",
79
+ xxl: "var(--phi-padding-xxl)",
80
80
  };
81
81
  /**
82
- * How wide a Page may get: the Theme's `phiPageMax` (theme/phi-tokens.ts, `PHI_LAYOUT.pageMax`).
82
+ * How wide a Page may get: the Theme's `pageMax` (theme/phi-tokens.ts, `PHI_LAYOUT.pageMax`).
83
83
  *
84
84
  * A Page states this reference and not the number, so the Theme's answer reaches every Page, an edited
85
85
  * copy included -- a number written into a preset tree stays what it was the day the copy was made.
86
86
  */
87
87
  export const PHI_PAGE = {
88
- max: "var(--ant-phi-page-max)",
88
+ max: "var(--phi-page-max)",
89
+ /*
90
+ * How far a Page's content stands in, per side: the Theme's `pagePadding<Side><Band>` for the band the
91
+ * screen is in, chosen by styles/shell.css ("Page inset"). Outside a Shell, where no band is chosen,
92
+ * the desktop answer.
93
+ */
94
+ padding: {
95
+ top: "var(--phi-page-inset-top, var(--phi-page-padding-top-desktop))",
96
+ right: "var(--phi-page-inset-right, var(--phi-page-padding-right-desktop))",
97
+ bottom: "var(--phi-page-inset-bottom, var(--phi-page-padding-bottom-desktop))",
98
+ left: "var(--phi-page-inset-left, var(--phi-page-padding-left-desktop))",
99
+ },
89
100
  };
90
101
  export const PHI_RADIUS = {
91
- xxs: "var(--ant-border-radius-xs)",
92
- xs: "var(--ant-border-radius-sm)",
93
- sm: "var(--ant-border-radius)",
94
- base: "var(--ant-border-radius-lg)",
95
- md: "var(--ant-border-radius-lg)",
96
- lg: "var(--ant-border-radius-lg)",
97
- xl: "var(--ant-border-radius-outer)",
98
- xxl: "var(--ant-border-radius-outer)",
102
+ xxs: "var(--phi-border-radius-xs)",
103
+ xs: "var(--phi-border-radius-sm)",
104
+ sm: "var(--phi-border-radius)",
105
+ base: "var(--phi-border-radius-lg)",
106
+ md: "var(--phi-border-radius-lg)",
107
+ lg: "var(--phi-border-radius-lg)",
108
+ xl: "var(--phi-border-radius-outer)",
109
+ xxl: "var(--phi-border-radius-outer)",
99
110
  };
100
111
  export const PHI_CONTROL = {
101
- sm: "var(--ant-control-height-sm)",
102
- md: "var(--ant-control-height)",
103
- lg: "var(--ant-control-height-lg)",
112
+ sm: "var(--phi-control-height-sm)",
113
+ md: "var(--phi-control-height)",
114
+ lg: "var(--phi-control-height-lg)",
104
115
  };
105
116
  export const PHI_SHADOW = {
106
- primary: "var(--ant-box-shadow)",
107
- secondary: "var(--ant-box-shadow-secondary)",
108
- tertiary: "var(--ant-box-shadow-tertiary)",
117
+ primary: "var(--phi-box-shadow)",
118
+ secondary: "var(--phi-box-shadow-secondary)",
119
+ tertiary: "var(--phi-box-shadow-tertiary)",
109
120
  };
110
121
  export const PHI_FONT_SIZE = {
111
- base: "var(--ant-font-size)",
112
- sm: "var(--ant-font-size-sm)",
113
- lg: "var(--ant-font-size-lg)",
114
- xl: "var(--ant-font-size-xl)",
115
- heading2: "var(--ant-font-size-heading-2)",
116
- heading4: "var(--ant-font-size-heading-4)",
117
- heading3: "var(--ant-font-size-heading-3)",
122
+ base: "var(--phi-font-size)",
123
+ sm: "var(--phi-font-size-sm)",
124
+ lg: "var(--phi-font-size-lg)",
125
+ xl: "var(--phi-font-size-xl)",
126
+ heading2: "var(--phi-font-size-heading-2)",
127
+ heading4: "var(--phi-font-size-heading-4)",
128
+ heading3: "var(--phi-font-size-heading-3)",
118
129
  };
119
130
  export const PHI_LINE_HEIGHT = {
120
131
  base: 1.5,
@@ -75,7 +75,7 @@ export declare function resolvePhiControlShapeRadius(shape: PhiControlShape, tok
75
75
  /**
76
76
  * Custom properties `styles/control-shape.css` reads. They carry the resolved numbers rather than a
77
77
  * reference to an adapter token so a nested preview -- which runs its own draft scale through a plain
78
- * `ConfigProvider` and therefore never redefines the ambient `--ant-border-radius-*` -- still resolves
78
+ * `ConfigProvider` and therefore never redefines the ambient `--phi-border-radius-*` -- still resolves
79
79
  * its OWN shape. Inheritance is also what makes nesting work at all: two rules that both match a
80
80
  * Control tie on specificity and source order decides, while an inherited custom property is always
81
81
  * taken from the nearest ancestor that declares it.
@@ -7,8 +7,8 @@
7
7
  * palette states each slot per mode (`modes[mode].gradients`), and a slot it leaves out is derived from
8
8
  * the mode's own colours, which is what lets every Theme offer all three without anybody drawing them.
9
9
  *
10
- * They reach the page as Ant Design tokens -- `phiGradient1` and its `phiGradient1Text` -- and Ant Design
11
- * writes every token as a custom property under the Theme's class (`--ant-phi-gradient-1`). That is the
10
+ * They reach the page as Ant Design tokens -- `gradient1` and its `gradient1Text` -- and Ant Design
11
+ * writes every token as a custom property under the Theme's class (`--phi-gradient-1`). That is the
12
12
  * whole transport: the root writes both modes, a Surface tone writes its own mode on its box, and the
13
13
  * Theme workspace's preview writes the draft's, so a control that reads the property is in the right mode
14
14
  * wherever it stands without asking which one that is.
@@ -7,8 +7,8 @@
7
7
  * palette states each slot per mode (`modes[mode].gradients`), and a slot it leaves out is derived from
8
8
  * the mode's own colours, which is what lets every Theme offer all three without anybody drawing them.
9
9
  *
10
- * They reach the page as Ant Design tokens -- `phiGradient1` and its `phiGradient1Text` -- and Ant Design
11
- * writes every token as a custom property under the Theme's class (`--ant-phi-gradient-1`). That is the
10
+ * They reach the page as Ant Design tokens -- `gradient1` and its `gradient1Text` -- and Ant Design
11
+ * writes every token as a custom property under the Theme's class (`--phi-gradient-1`). That is the
12
12
  * whole transport: the root writes both modes, a Surface tone writes its own mode on its box, and the
13
13
  * Theme workspace's preview writes the draft's, so a control that reads the property is in the right mode
14
14
  * wherever it stands without asking which one that is.
@@ -55,18 +55,18 @@ function serializePhiThemeGradientCss(gradient) {
55
55
  return `linear-gradient(${gradient.direction}, ${gradient.stops.map((stop) => `${stop.color} ${stop.percent}%`).join(", ")})`;
56
56
  }
57
57
  /*
58
- * The custom properties, named the way Ant Design names a token's (`token2CSSVar`): `phiGradient1Text`
59
- * becomes `--ant-phi-gradient-1-text`. Stated once so CSS and controls never spell them differently.
58
+ * The custom properties, named the way Ant Design names a token's (`token2CSSVar`): `gradient1Text`
59
+ * becomes `--phi-gradient-1-text`. Stated once so CSS and controls never spell them differently.
60
60
  */
61
61
  const PHI_THEME_GRADIENT_TOKEN_NAMES = {
62
- gradient1: { paint: "phiGradient1", text: "phiGradient1Text" },
63
- gradient2: { paint: "phiGradient2", text: "phiGradient2Text" },
64
- gradient3: { paint: "phiGradient3", text: "phiGradient3Text" },
62
+ gradient1: { paint: "gradient1", text: "gradient1Text" },
63
+ gradient2: { paint: "gradient2", text: "gradient2Text" },
64
+ gradient3: { paint: "gradient3", text: "gradient3Text" },
65
65
  };
66
66
  export const PHI_THEME_GRADIENT_CSS_VARS = {
67
- gradient1: { paint: "--ant-phi-gradient-1", text: "--ant-phi-gradient-1-text" },
68
- gradient2: { paint: "--ant-phi-gradient-2", text: "--ant-phi-gradient-2-text" },
69
- gradient3: { paint: "--ant-phi-gradient-3", text: "--ant-phi-gradient-3-text" },
67
+ gradient1: { paint: "--phi-gradient-1", text: "--phi-gradient-1-text" },
68
+ gradient2: { paint: "--phi-gradient-2", text: "--phi-gradient-2-text" },
69
+ gradient3: { paint: "--phi-gradient-3", text: "--phi-gradient-3-text" },
70
70
  };
71
71
  /*
72
72
  * The primary Buttons' run when the Theme gives them one, with the filter each pressed state lays over
@@ -76,10 +76,10 @@ export const PHI_THEME_GRADIENT_CSS_VARS = {
76
76
  * flickered as the pointer left -- where a filter eases.
77
77
  */
78
78
  const PHI_PRIMARY_BUTTON_GRADIENT_TOKENS = {
79
- paint: "phiPrimaryButtonGradient",
80
- hover: "phiPrimaryButtonGradientHover",
81
- active: "phiPrimaryButtonGradientActive",
82
- text: "phiPrimaryButtonGradientText",
79
+ paint: "primaryButtonGradient",
80
+ hover: "primaryButtonGradientHover",
81
+ active: "primaryButtonGradientActive",
82
+ text: "primaryButtonGradientText",
83
83
  };
84
84
  /** A run a little lighter under the pointer, a little darker while it is pressed. */
85
85
  export const PHI_GRADIENT_HOVER_FILTER = "brightness(1.18) saturate(1.15)";
@@ -15,7 +15,7 @@ export declare function resolvePhiThemePaletteCustomColors(palette: PhiThemePale
15
15
  export declare function resolvePhiPublishedThemeCustomColors(siteTheme: PhiThemeCustomColorSource, mode: PhiThemeMode, presets: readonly PhiThemePresetPlugin[]): PhiThemeCustomColorPalette;
16
16
  /**
17
17
  * The custom colours of one mode as tokens of the Theme's own, laid over the resolved ones like the
18
- * gradient slots, so Ant Design writes them per mode and per Surface tone (`--ant-phi-custom-1` ...) and a
18
+ * gradient slots, so Ant Design writes them per mode and per Surface tone (`--phi-custom-1` ...) and a
19
19
  * config can name one by its role (`PHI_COLOR.custom1`) instead of copying its value.
20
20
  */
21
21
  export declare function buildPhiThemeCustomColorTokens(palette: PhiThemePalette | null | undefined, mode: PhiThemeMode): Record<string, string>;
@@ -32,11 +32,11 @@ export function resolvePhiPublishedThemeCustomColors(siteTheme, mode, presets) {
32
32
  }
33
33
  /** The token a custom colour rides as, and so the custom property Ant Design writes for it. */
34
34
  function resolvePhiThemeCustomColorTokenName(key) {
35
- return `phiCustom${key.slice("custom".length)}`;
35
+ return `custom${key.slice("custom".length)}`;
36
36
  }
37
37
  /**
38
38
  * The custom colours of one mode as tokens of the Theme's own, laid over the resolved ones like the
39
- * gradient slots, so Ant Design writes them per mode and per Surface tone (`--ant-phi-custom-1` ...) and a
39
+ * gradient slots, so Ant Design writes them per mode and per Surface tone (`--phi-custom-1` ...) and a
40
40
  * config can name one by its role (`PHI_COLOR.custom1`) instead of copying its value.
41
41
  */
42
42
  export function buildPhiThemeCustomColorTokens(palette, mode) {
@@ -27,7 +27,7 @@ export declare const PHI_THEME_TOKEN_KEYS: readonly ["colorBgContainer", "colorB
27
27
  * The names this house adds to Ant Design's set.
28
28
  *
29
29
  * `buildPhiThemeTokens` hands Ant Design the whole structural scale, `paddingXXL` included, and the
30
- * cssVar pass emits a variable for every token it is given -- so `--ant-padding-xxl` is on the page
30
+ * cssVar pass emits a variable for every token it is given -- so `--phi-padding-xxl` is on the page
31
31
  * even though `AliasToken` has no such field. The name is therefore real, usable from CSS, and
32
32
  * invisible to the type, which is exactly why it has to be stated somewhere.
33
33
  *
@@ -35,15 +35,18 @@ export declare const PHI_THEME_TOKEN_KEYS: readonly ["colorBgContainer", "colorB
35
35
  * Design's type and a name Ant Design does not know cannot be cut from it. A Client Component that
36
36
  * needs one of these reads it as a CSS variable, the way a Server Component does.
37
37
  *
38
- * `phiPageMax` is how wide a Page may get (theme/phi-tokens.ts, `PHI_LAYOUT.pageMax`); a Page reads it
38
+ * `pageMax` is how wide a Page may get (theme/phi-tokens.ts, `PHI_LAYOUT.pageMax`); a Page reads it
39
39
  * as `PHI_PAGE.max`.
40
40
  *
41
- * The `phiGradient*` names are the Theme's gradient slots and the primary Buttons' run
41
+ * The `gradient*` names are the Theme's gradient slots and the primary Buttons' run
42
42
  * (theme/phi-theme-gradients.ts): tokens of this package's own, laid over the resolved ones so Ant
43
- * Design writes them per mode and per Surface tone like every other. The `phiCustom*` names are the
43
+ * Design writes them per mode and per Surface tone like every other. The `custom*` names are the
44
44
  * palette's custom colours, laid over the same way (theme/phi-theme-palette.ts).
45
45
  */
46
- export declare const PHI_THEME_OWN_TOKEN_KEYS: readonly ["paddingXXL", "phiPageMax", "phiGradient1", "phiGradient1Text", "phiGradient2", "phiGradient2Text", "phiGradient3", "phiGradient3Text", "phiPrimaryButtonGradient", "phiPrimaryButtonGradientHover", "phiPrimaryButtonGradientActive", "phiPrimaryButtonGradientText", "phiCustom1", "phiCustom2", "phiCustom3", "phiCustom4", "phiCustom5", "phiCustom6", "phiCustom7", "phiCustom8", "phiCustom9", "phiCustom10"];
46
+ export declare const PHI_THEME_OWN_TOKEN_KEYS: readonly ["paddingXXL", "pageMax", "pagePaddingTopPhone", "pagePaddingRightPhone", "pagePaddingBottomPhone", "pagePaddingLeftPhone", "pagePaddingTopTablet", "pagePaddingRightTablet", "pagePaddingBottomTablet", "pagePaddingLeftTablet", "pagePaddingTopDesktop", "pagePaddingRightDesktop", "pagePaddingBottomDesktop", "pagePaddingLeftDesktop", "gradient1", "gradient1Text", "gradient2", "gradient2Text", "gradient3", "gradient3Text", "primaryButtonGradient", "primaryButtonGradientHover", "primaryButtonGradientActive", "primaryButtonGradientText", "custom1", "custom2", "custom3", "custom4", "custom5", "custom6", "custom7", "custom8", "custom9", "custom10"];
47
+ /** The Page inset's names, per band and side (`PHI_LAYOUT.pagePadding`, `PHI_PAGE.padding`). */
48
+ export declare const PHI_THEME_PAGE_PADDING_BANDS: readonly ["Phone", "Tablet", "Desktop"];
49
+ export declare const PHI_THEME_PAGE_PADDING_SIDES: readonly ["Top", "Right", "Bottom", "Left"];
47
50
  export type PhiThemeTokenKey = (typeof PHI_THEME_TOKEN_KEYS)[number];
48
51
  /**
49
52
  * The resolved Theme, in the names above and their Ant Design value types.
@@ -1,3 +1,4 @@
1
+ import { PHI_SPACE } from "./antd-css-var-contract";
1
2
  import { PHI_CONTAINER_BREAKPOINT_REGION } from "./phi-container-breakpoints";
2
3
  /**
3
4
  * The token vocabulary of this house, stated once.
@@ -158,7 +159,7 @@ export const PHI_THEME_TOKEN_KEYS = [
158
159
  * The names this house adds to Ant Design's set.
159
160
  *
160
161
  * `buildPhiThemeTokens` hands Ant Design the whole structural scale, `paddingXXL` included, and the
161
- * cssVar pass emits a variable for every token it is given -- so `--ant-padding-xxl` is on the page
162
+ * cssVar pass emits a variable for every token it is given -- so `--phi-padding-xxl` is on the page
162
163
  * even though `AliasToken` has no such field. The name is therefore real, usable from CSS, and
163
164
  * invisible to the type, which is exactly why it has to be stated somewhere.
164
165
  *
@@ -166,38 +167,54 @@ export const PHI_THEME_TOKEN_KEYS = [
166
167
  * Design's type and a name Ant Design does not know cannot be cut from it. A Client Component that
167
168
  * needs one of these reads it as a CSS variable, the way a Server Component does.
168
169
  *
169
- * `phiPageMax` is how wide a Page may get (theme/phi-tokens.ts, `PHI_LAYOUT.pageMax`); a Page reads it
170
+ * `pageMax` is how wide a Page may get (theme/phi-tokens.ts, `PHI_LAYOUT.pageMax`); a Page reads it
170
171
  * as `PHI_PAGE.max`.
171
172
  *
172
- * The `phiGradient*` names are the Theme's gradient slots and the primary Buttons' run
173
+ * The `gradient*` names are the Theme's gradient slots and the primary Buttons' run
173
174
  * (theme/phi-theme-gradients.ts): tokens of this package's own, laid over the resolved ones so Ant
174
- * Design writes them per mode and per Surface tone like every other. The `phiCustom*` names are the
175
+ * Design writes them per mode and per Surface tone like every other. The `custom*` names are the
175
176
  * palette's custom colours, laid over the same way (theme/phi-theme-palette.ts).
176
177
  */
177
178
  export const PHI_THEME_OWN_TOKEN_KEYS = [
178
179
  "paddingXXL",
179
- "phiPageMax",
180
- "phiGradient1",
181
- "phiGradient1Text",
182
- "phiGradient2",
183
- "phiGradient2Text",
184
- "phiGradient3",
185
- "phiGradient3Text",
186
- "phiPrimaryButtonGradient",
187
- "phiPrimaryButtonGradientHover",
188
- "phiPrimaryButtonGradientActive",
189
- "phiPrimaryButtonGradientText",
190
- "phiCustom1",
191
- "phiCustom2",
192
- "phiCustom3",
193
- "phiCustom4",
194
- "phiCustom5",
195
- "phiCustom6",
196
- "phiCustom7",
197
- "phiCustom8",
198
- "phiCustom9",
199
- "phiCustom10",
180
+ "pageMax",
181
+ "pagePaddingTopPhone",
182
+ "pagePaddingRightPhone",
183
+ "pagePaddingBottomPhone",
184
+ "pagePaddingLeftPhone",
185
+ "pagePaddingTopTablet",
186
+ "pagePaddingRightTablet",
187
+ "pagePaddingBottomTablet",
188
+ "pagePaddingLeftTablet",
189
+ "pagePaddingTopDesktop",
190
+ "pagePaddingRightDesktop",
191
+ "pagePaddingBottomDesktop",
192
+ "pagePaddingLeftDesktop",
193
+ "gradient1",
194
+ "gradient1Text",
195
+ "gradient2",
196
+ "gradient2Text",
197
+ "gradient3",
198
+ "gradient3Text",
199
+ "primaryButtonGradient",
200
+ "primaryButtonGradientHover",
201
+ "primaryButtonGradientActive",
202
+ "primaryButtonGradientText",
203
+ "custom1",
204
+ "custom2",
205
+ "custom3",
206
+ "custom4",
207
+ "custom5",
208
+ "custom6",
209
+ "custom7",
210
+ "custom8",
211
+ "custom9",
212
+ "custom10",
200
213
  ];
214
+ /** The Page inset's names, per band and side (`PHI_LAYOUT.pagePadding`, `PHI_PAGE.padding`). */
215
+ export const PHI_THEME_PAGE_PADDING_BANDS = ["Phone", "Tablet", "Desktop"];
216
+ export const PHI_THEME_PAGE_PADDING_SIDES = ["Top", "Right", "Bottom", "Left"];
217
+ const PHI_THEME_PAGE_PADDING_TOKEN_KEYS = PHI_THEME_PAGE_PADDING_BANDS.flatMap((band) => PHI_THEME_PAGE_PADDING_SIDES.map((side) => `pagePadding${side}${band}`));
201
218
  /**
202
219
  * The colours a palette seeds, shared by both modes.
203
220
  *
@@ -258,6 +275,7 @@ export function assertPhiThemeVocabulary({ palette, styleToken, modeSeedKeys, so
258
275
  violations.push(...readPhiThemeVocabularyViolations(modeConfig?.seed, modeSeedNames, source, `the ${mode} seed`), ...readPhiThemeVocabularyViolations(modeConfig?.overrides, PHI_THEME_TOKEN_NAMES, source, `the ${mode} override`));
259
276
  }
260
277
  violations.push(...readPhiThemePageMaxViolations(styleToken, source));
278
+ violations.push(...readPhiThemePagePaddingViolations(styleToken, source));
261
279
  if (violations.length > 0) {
262
280
  throw new Error(violations.join(" "));
263
281
  }
@@ -268,15 +286,28 @@ export function assertPhiThemeVocabulary({ palette, styleToken, modeSeedKeys, so
268
286
  * Narrower, no Page could ever be wide: a Grid of four columns or anything else that answers to the
269
287
  * Region threshold would never draw its wide form, and nothing would say why.
270
288
  */
289
+ /**
290
+ * A Page's inset is a step of the spacing scale on each side and band, or none: the Page column reads it
291
+ * as a length, and a word it cannot resolve would leave the side at no padding with nothing to say why.
292
+ */
293
+ function readPhiThemePagePaddingViolations(styleToken, source) {
294
+ const steps = new Set([...Object.values(PHI_SPACE), 0, "0"]);
295
+ return PHI_THEME_PAGE_PADDING_TOKEN_KEYS.flatMap((key) => {
296
+ const value = styleToken?.[key];
297
+ if (value == null || steps.has(value))
298
+ return [];
299
+ return [`${source}: the style token states ${key} as ${JSON.stringify(value)}, which is not a step of the spacing scale.`];
300
+ });
301
+ }
271
302
  function readPhiThemePageMaxViolations(styleToken, source) {
272
- const value = styleToken?.phiPageMax;
303
+ const value = styleToken?.pageMax;
273
304
  if (value == null)
274
305
  return [];
275
306
  if (typeof value !== "number" || !Number.isFinite(value)) {
276
- return [`${source}: the style token states phiPageMax as ${JSON.stringify(value)}, which is not a number of pixels.`];
307
+ return [`${source}: the style token states pageMax as ${JSON.stringify(value)}, which is not a number of pixels.`];
277
308
  }
278
309
  if (value < PHI_CONTAINER_BREAKPOINT_REGION) {
279
- return [`${source}: the style token states phiPageMax ${value}, narrower than ${PHI_CONTAINER_BREAKPOINT_REGION}, from which a Region counts as wide.`];
310
+ return [`${source}: the style token states pageMax ${value}, narrower than ${PHI_CONTAINER_BREAKPOINT_REGION}, from which a Region counts as wide.`];
280
311
  }
281
312
  return [];
282
313
  }
@@ -32,8 +32,20 @@ export type PhiThemeTokens = {
32
32
  paddingLG: number;
33
33
  paddingXL: number;
34
34
  paddingXXL: number;
35
- /** How wide a Page may get (`PHI_LAYOUT.pageMax`), published as `--ant-phi-page-max`. */
36
- phiPageMax: number;
35
+ /** How wide a Page may get (`PHI_LAYOUT.pageMax`), published as `--phi-page-max`. */
36
+ pageMax: number;
37
+ pagePaddingTopPhone: string;
38
+ pagePaddingRightPhone: string;
39
+ pagePaddingBottomPhone: string;
40
+ pagePaddingLeftPhone: string;
41
+ pagePaddingTopTablet: string;
42
+ pagePaddingRightTablet: string;
43
+ pagePaddingBottomTablet: string;
44
+ pagePaddingLeftTablet: string;
45
+ pagePaddingTopDesktop: string;
46
+ pagePaddingRightDesktop: string;
47
+ pagePaddingBottomDesktop: string;
48
+ pagePaddingLeftDesktop: string;
37
49
  marginXXS: number;
38
50
  marginXS: number;
39
51
  marginSM: number;
@@ -17,7 +17,20 @@ function buildPhiThemeTokens(options = {}) {
17
17
  paddingLG: PHI_PADDING_VALUES.lg,
18
18
  paddingXL: PHI_PADDING_VALUES.xl,
19
19
  paddingXXL: PHI_PADDING_VALUES.xxl,
20
- phiPageMax: PHI_LAYOUT.pageMax,
20
+ pageMax: PHI_LAYOUT.pageMax,
21
+ // A Page's inset per side and screen width, as steps of the spacing scale (`PHI_LAYOUT.pagePadding`).
22
+ pagePaddingTopPhone: PHI_SPACE[PHI_LAYOUT.pagePadding.phone],
23
+ pagePaddingRightPhone: PHI_SPACE[PHI_LAYOUT.pagePadding.phone],
24
+ pagePaddingBottomPhone: PHI_SPACE[PHI_LAYOUT.pagePadding.phone],
25
+ pagePaddingLeftPhone: PHI_SPACE[PHI_LAYOUT.pagePadding.phone],
26
+ pagePaddingTopTablet: PHI_SPACE[PHI_LAYOUT.pagePadding.tablet],
27
+ pagePaddingRightTablet: PHI_SPACE[PHI_LAYOUT.pagePadding.tablet],
28
+ pagePaddingBottomTablet: PHI_SPACE[PHI_LAYOUT.pagePadding.tablet],
29
+ pagePaddingLeftTablet: PHI_SPACE[PHI_LAYOUT.pagePadding.tablet],
30
+ pagePaddingTopDesktop: PHI_SPACE[PHI_LAYOUT.pagePadding.desktop],
31
+ pagePaddingRightDesktop: PHI_SPACE[PHI_LAYOUT.pagePadding.desktop],
32
+ pagePaddingBottomDesktop: PHI_SPACE[PHI_LAYOUT.pagePadding.desktop],
33
+ pagePaddingLeftDesktop: PHI_SPACE[PHI_LAYOUT.pagePadding.desktop],
21
34
  // Ant Design's second family, on the same scale: its own components read it (phi-tokens.ts).
22
35
  marginXXS: PHI_PADDING_VALUES.xxs,
23
36
  marginXS: PHI_PADDING_VALUES.xs,
@@ -89,6 +89,11 @@ export declare const PHI_LAYOUT: {
89
89
  readonly contentMaxNarrow: 377;
90
90
  readonly contentMax: 610;
91
91
  readonly pageMax: 1220;
92
+ readonly pagePadding: {
93
+ readonly phone: "base";
94
+ readonly tablet: "md";
95
+ readonly desktop: "md";
96
+ };
92
97
  readonly readingMax: 754;
93
98
  readonly heroHeight: 377;
94
99
  };
@@ -136,6 +136,15 @@ export const PHI_LAYOUT = {
136
136
  * be able to get past it, which is why a Theme may not state less (`assertPhiThemeVocabulary`).
137
137
  */
138
138
  pageMax: 1220,
139
+ /*
140
+ * How far a Page's content stands in from the room it is given, by the screen it is drawn on: the
141
+ * Shell's device bands on `phi-render-viewport` (styles/shell.css), a phone below 768, a tablet below
142
+ * 1200, a desktop from there -- not the block profiles' 377 and 610, which measure room and would put
143
+ * two phones of one class on opposite sides. Steps of the spacing scale, the same on all four sides; a
144
+ * phone one step below the rest. The Theme's to decide, as `pageMax` is: a Page reads it as
145
+ * `PHI_PAGE.padding`, and a Layout that states its own padding keeps it.
146
+ */
147
+ pagePadding: { phone: "base", tablet: "md", desktop: "md" },
139
148
  /*
140
149
  * How wide a column of prose is allowed to get: an article, an entry and what stands around it.
141
150
  *
@@ -7,6 +7,7 @@ import type { PhiThemeFontsBlock, PhiThemeGroundBlock, PhiThemeSetBlock, PhiThem
7
7
  import type { PhiViewerAccessPolicy } from "./access";
8
8
  import type { PhiSignalRoute } from "./signals";
9
9
  import type { PhiCmsInstanceId } from "./cms-instance-id";
10
+ import type { PhiRuntimeModuleFormDefinition } from "../components/forms/form-registry";
10
11
  export type PhiRuntimeModuleId = `${string}/${string}`;
11
12
  export type PhiCmsPresetIdentity = {
12
13
  ownerModuleId: PhiRuntimeModuleId;
@@ -75,6 +76,12 @@ export type PhiCmsRoutePresetDescriptor = PhiCmsPresetIdentity & {
75
76
  activeModuleIds: ReadonlySet<PhiRuntimeModuleId>;
76
77
  params: Readonly<Record<string, string>>;
77
78
  }) => PhiResolvedCmsPageTree | Promise<PhiResolvedCmsPageTree>;
79
+ /**
80
+ * The record this route's Page is about (MODULES.md, "The fields of a record, and the record a Page is
81
+ * about"). Only on a route with a parameter. Core reads it before anything is drawn -- no record is a
82
+ * 404 -- and the Page's Widgets bind to its fields, in the Module's tree and in a stored override alike.
83
+ */
84
+ pageRecord?: import("./record-provider").PhiCmsPageRecordDescriptor;
78
85
  navigation?: readonly PhiCmsNavigationInjectionDescriptor[];
79
86
  /**
80
87
  * The Page's guided Tour, in the owning Module's language (design/TOURS.md). Read with the route, not
@@ -466,6 +473,8 @@ export type PhiCmsCompiledDescriptorCatalog = {
466
473
  themeBlockByKey: ReadonlyMap<string, PhiCmsThemeBlockBinding>;
467
474
  /** Each Module's source language: the one the text its descriptors ship is written in. */
468
475
  sourceLocaleByModuleId: ReadonlyMap<PhiRuntimeModuleId, string>;
476
+ /** The Forms the Modules ship, by id: what the tree contract reads a dialog's Form from. */
477
+ formDefinitionsById: ReadonlyMap<string, PhiRuntimeModuleFormDefinition>;
469
478
  };
470
479
  export type PhiCmsActiveRouteTable = {
471
480
  area: PhiCmsAreaKey;
@@ -158,6 +158,15 @@ export type PhiCmsConfigField = (PhiCmsConfigFieldBase & {
158
158
  * what gets stored is a provider key the render path looks up in the same registry.
159
159
  */
160
160
  type: "video-provider";
161
+ }) | (PhiCmsConfigFieldBase & {
162
+ /**
163
+ * A field of the record the Page is about (MODULES.md, "The fields of a record, and the record a
164
+ * Page is about"). The Inspector offers the fields the Page's record Provider declares, of the
165
+ * kinds the Widget draws; on a Page that is about no record the row is not shown. What is stored
166
+ * is the field's key.
167
+ */
168
+ type: "record-field";
169
+ kinds: readonly import("./record-provider").PhiRecordFieldKind[];
161
170
  }) | (PhiCmsConfigFieldBase & {
162
171
  type: "dimension";
163
172
  widthKey?: string;
@@ -583,6 +592,18 @@ export type PhiCmsRuntimeRenderRegistry = {
583
592
  * a page that binds none loads none.
584
593
  */
585
594
  recordProviderLoadersByKey: ReadonlyMap<PhiRuntimeDataProviderKey, () => Promise<import("./record-provider").PhiRuntimeRecordProviderResolver>>;
595
+ /** The field readers of the `record` Providers that declare fields, by key. */
596
+ recordFieldsLoadersByKey: ReadonlyMap<PhiRuntimeDataProviderKey, () => Promise<import("./record-provider").PhiRuntimeRecordFieldsReader>>;
597
+ /** The sample readers of the `record` Providers that offer samples, by key: what the Builder previews a template with. */
598
+ recordSamplesLoadersByKey: ReadonlyMap<PhiRuntimeDataProviderKey, () => Promise<import("./record-provider").PhiRuntimeRecordSamplesReader>>;
599
+ /**
600
+ * What each active Module's `record` Providers that declare fields consist of, by key: whose the record
601
+ * is and its declared fields. Keyed off the active set like the loaders, and apart from
602
+ * `dataProviderDescriptorsByKey`, which holds only what the trees make the browser mount and so never a
603
+ * `record` Provider.
604
+ */
605
+ recordDeclarationsByKey: ReadonlyMap<PhiRuntimeDataProviderKey, import("./record-provider").PhiRecordDeclaration>;
606
+ /** The Providers the trees make the browser mount, by key; a `record` Provider is never one of them. */
586
607
  dataProviderDescriptorsByKey: ReadonlyMap<PhiRuntimeDataProviderKey, PhiRuntimeModuleDataProviderDescriptor>;
587
608
  formDefinitionsById: ReadonlyMap<string, PhiRuntimeModuleFormDefinition>;
588
609
  };
@@ -957,7 +978,12 @@ export type PhiRuntimeModuleDataProviderDescriptor = PhiRuntimeModuleDataProvide
957
978
  kind: "collection";
958
979
  resources: readonly import("./collection-provider").PhiCollectionProviderResourceDescriptor[];
959
980
  } | {
960
- kind: Exclude<PhiRuntimeDataProviderKind, "table" | "tree" | "collection">;
981
+ kind: "record";
982
+ resources?: never;
983
+ /** Whose the record is and what it consists of; what a Widget binds to as a field of it. */
984
+ record?: import("./record-provider").PhiRecordDeclaration;
985
+ } | {
986
+ kind: Exclude<PhiRuntimeDataProviderKind, "table" | "tree" | "collection" | "record">;
961
987
  resources?: never;
962
988
  });
963
989
  export type PhiRuntimeModuleDataProviderClientProps = {