@phis/ui 0.5.2 → 0.5.3

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 (182) 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-drawer-control-adapter.js +4 -4
  6. package/components/controls/phi-dropdown-control.js +2 -2
  7. package/components/controls/phi-form-control.js +1 -1
  8. package/components/controls/phi-image-control.js +1 -1
  9. package/components/controls/phi-mask-picker-control.js +6 -6
  10. package/components/controls/phi-select-control.js +1 -1
  11. package/components/controls/phi-theme-scope-control.js +1 -1
  12. package/components/controls/use-phi-color-control-presets.js +2 -2
  13. package/components/forms/compound-form-controls.js +2 -2
  14. package/components/forms/extended-form-field-controls.js +1 -1
  15. package/components/forms/shared-form-provider-registry.js +2 -2
  16. package/components/layouts/clients/phi-flex-layout-client.js +4 -4
  17. package/components/layouts/clients/phi-grid-layout-client.js +3 -3
  18. package/components/layouts/clients/phi-sequence-slot-editor.js +1 -1
  19. package/components/layouts/layout-definitions.d.ts +4 -4
  20. package/components/layouts/phi-page-region-layout.js +1 -1
  21. package/components/layouts/phi-structure-region-layout.js +3 -3
  22. package/components/media/phi-asset-focal-rect-widget.js +4 -4
  23. package/components/media/phi-asset-inspector-section.js +1 -1
  24. package/components/media/phi-media-kind-icon.js +2 -2
  25. package/components/media/phi-media-restricted-icon.js +1 -1
  26. package/components/overlays/phi-overlay-container-client.js +1 -1
  27. package/components/regions/presets/phi-base-page-column.js +6 -2
  28. package/components/root/phi-config-provider.js +1 -1
  29. package/components/root/phi-root-background.js +1 -1
  30. package/components/root/phi-root-theme-resolver.js +1 -1
  31. package/components/shell/phi-module-icons.js +1 -1
  32. package/components/widgets/built-in/builder-workspace-preview.js +8 -8
  33. package/components/widgets/client/bullet-list-entries-editor.js +2 -2
  34. package/components/widgets/client/external-document-editor.js +1 -1
  35. package/components/widgets/client/html-editor.js +3 -3
  36. package/components/widgets/config/background.d.ts +1 -1
  37. package/components/widgets/config/background.js +1 -1
  38. package/components/widgets/inspector-field-row.js +1 -1
  39. package/components/widgets/label-sets/inspector.js +2 -0
  40. package/components/widgets/label-types/inspector.d.ts +1 -0
  41. package/components/widgets/label-types/inspector.js +1 -0
  42. package/components/widgets/shared/card-body-client.js +1 -1
  43. package/components/widgets/shared/result-body-client.js +1 -1
  44. package/constants/media-library-provider-keys.d.ts +8 -1
  45. package/constants/media-library-provider-keys.js +8 -1
  46. package/constants/record-field-kinds.d.ts +6 -0
  47. package/constants/record-field-kinds.js +7 -0
  48. package/constants/runtime-module-ownership.js +1 -1
  49. package/helpers/border-widget-style.d.ts +2 -2
  50. package/helpers/border-widget-style.js +2 -2
  51. package/helpers/cms-dialog.d.ts +4 -4
  52. package/helpers/cms-layout-defaults.d.ts +2 -2
  53. package/helpers/cms-page-catalog.d.ts +5 -0
  54. package/helpers/cms-preset-page-tree.d.ts +4 -0
  55. package/helpers/cms-preset-page-tree.js +2 -0
  56. package/helpers/layout-style.d.ts +2 -2
  57. package/helpers/page-layout-check.d.ts +4 -1
  58. package/helpers/page-layout-check.js +26 -0
  59. package/helpers/record-fields.d.ts +9 -0
  60. package/helpers/record-fields.js +84 -0
  61. package/helpers/surface-presets.d.ts +6 -6
  62. package/helpers/surface-style.d.ts +1 -1
  63. package/helpers.d.ts +0 -1
  64. package/helpers.js +0 -2
  65. package/module-page-check.d.ts +12 -0
  66. package/module-page-check.js +12 -0
  67. package/module-records.d.ts +4 -2
  68. package/module-records.js +3 -1
  69. package/next/antd-form-context-loader.mjs +31 -0
  70. package/next/config.d.mts +2 -0
  71. package/next/config.mjs +36 -3
  72. package/package.json +10 -1
  73. package/plugins/runtime-modules/asset/data-providers.d.ts +0 -65
  74. package/plugins/runtime-modules/asset/data-providers.js +0 -40
  75. package/plugins/runtime-modules/asset/definition.d.ts +0 -60
  76. package/plugins/runtime-modules/asset/ids.d.ts +0 -1
  77. package/plugins/runtime-modules/asset/ids.js +1 -2
  78. package/plugins/runtime-modules/asset/presets.d.ts +1 -0
  79. package/plugins/runtime-modules/asset/server.js +0 -5
  80. package/plugins/runtime-modules/blog/presets.d.ts +1 -0
  81. package/plugins/runtime-modules/builder/clients/inspector-config-field.d.ts +4 -1
  82. package/plugins/runtime-modules/builder/clients/inspector-config-field.js +13 -4
  83. package/plugins/runtime-modules/builder/clients/inspector-link-target-field.js +1 -1
  84. package/plugins/runtime-modules/builder/clients/inspector-section-widget.js +14 -1
  85. package/plugins/runtime-modules/builder/clients/inspector-signal-section.js +2 -2
  86. package/plugins/runtime-modules/builder/clients/layout-inspector.js +1 -1
  87. package/plugins/runtime-modules/builder/clients/layout-scaffold-buttons.js +4 -4
  88. package/plugins/runtime-modules/builder/clients/layout-scaffold-overlays.js +1 -1
  89. package/plugins/runtime-modules/builder/clients/region-inspector.js +1 -1
  90. package/plugins/runtime-modules/builder/clients/region-visibility-fields.js +1 -1
  91. package/plugins/runtime-modules/builder/clients/shells-workspace.js +1 -1
  92. package/plugins/runtime-modules/builder/clients/structure-canvas.js +2 -2
  93. package/plugins/runtime-modules/builder/clients/widget-effects-editor.js +1 -1
  94. package/plugins/runtime-modules/builder/clients/widget-inspector.d.ts +4 -1
  95. package/plugins/runtime-modules/builder/clients/widget-inspector.js +3 -2
  96. package/plugins/runtime-modules/builder/page-presets.server.d.ts +6 -0
  97. package/plugins/runtime-modules/builder/page-presets.server.js +8 -0
  98. package/plugins/runtime-modules/builder/pages-workspace.js +12 -1
  99. package/plugins/runtime-modules/builder/render-root-node-scaffold.js +5 -5
  100. package/plugins/runtime-modules/builder/structure-dnd.js +2 -2
  101. package/plugins/runtime-modules/builder/widgets/test-block/client.js +1 -1
  102. package/plugins/runtime-modules/content-entry-routes.d.ts +1 -0
  103. package/plugins/runtime-modules/contracts.d.ts +1 -1
  104. package/plugins/runtime-modules/contracts.js +41 -1
  105. package/plugins/runtime-modules/core/data-providers.d.ts +60 -0
  106. package/plugins/runtime-modules/core/data-providers.js +41 -0
  107. package/plugins/runtime-modules/core/definition.d.ts +55 -0
  108. package/plugins/runtime-modules/core/server.js +5 -0
  109. package/plugins/runtime-modules/core/widgets/button/config.d.ts +34 -0
  110. package/plugins/runtime-modules/core/widgets/button/config.js +16 -0
  111. package/plugins/runtime-modules/core/widgets/button/plugin.js +37 -6
  112. package/plugins/runtime-modules/core/widgets/card/config.d.ts +13 -2
  113. package/plugins/runtime-modules/core/widgets/description/config.d.ts +13 -2
  114. package/plugins/runtime-modules/core/widgets/description/editor.js +13 -13
  115. package/plugins/runtime-modules/core/widgets/entry-list/config.d.ts +11 -0
  116. package/plugins/runtime-modules/core/widgets/gallery/client.d.ts +4 -1
  117. package/plugins/runtime-modules/core/widgets/gallery/client.js +29 -21
  118. package/plugins/runtime-modules/core/widgets/gallery/config.d.ts +16 -0
  119. package/plugins/runtime-modules/core/widgets/gallery/config.js +16 -0
  120. package/plugins/runtime-modules/core/widgets/gallery/server.d.ts +1 -1
  121. package/plugins/runtime-modules/core/widgets/gallery/server.js +11 -0
  122. package/plugins/runtime-modules/core/widgets/image/config.d.ts +35 -0
  123. package/plugins/runtime-modules/core/widgets/image/config.js +8 -0
  124. package/plugins/runtime-modules/core/widgets/image/plugin.js +19 -1
  125. package/plugins/runtime-modules/core/widgets/image/server.d.ts +3 -1
  126. package/plugins/runtime-modules/core/widgets/image/server.js +2 -2
  127. package/plugins/runtime-modules/core/widgets/markdown/config.d.ts +13 -0
  128. package/plugins/runtime-modules/core/widgets/markdown/config.js +8 -0
  129. package/plugins/runtime-modules/core/widgets/markdown/editor.js +7 -7
  130. package/plugins/runtime-modules/core/widgets/markdown/plugin.js +20 -7
  131. package/plugins/runtime-modules/core/widgets/record/authoring.js +1 -1
  132. package/plugins/runtime-modules/core/widgets/result/config.d.ts +11 -0
  133. package/plugins/runtime-modules/core/widgets/simple-text/config.d.ts +13 -0
  134. package/plugins/runtime-modules/core/widgets/simple-text/config.js +9 -0
  135. package/plugins/runtime-modules/core/widgets/simple-text/editor.js +1 -1
  136. package/plugins/runtime-modules/core/widgets/simple-text/plugin.js +14 -1
  137. package/plugins/runtime-modules/core/widgets/spacer/client.js +1 -1
  138. package/plugins/runtime-modules/core/widgets/table/config.d.ts +37 -0
  139. package/plugins/runtime-modules/descriptor-compiler.js +8 -0
  140. package/plugins/runtime-modules/editor/presets.d.ts +1 -0
  141. package/plugins/runtime-modules/groups/definition.d.ts +1 -1
  142. package/plugins/runtime-modules/localization/presets.d.ts +1 -0
  143. package/plugins/runtime-modules/news/presets.d.ts +1 -0
  144. package/plugins/runtime-modules/resolver.js +2 -0
  145. package/plugins/runtime-modules/revisions/presets.d.ts +1 -0
  146. package/plugins/runtime-modules/theme/presets.d.ts +1 -0
  147. package/plugins/runtime-modules/theme/widgets/brand-controls/client.js +25 -2
  148. package/server-helpers/cms-page-record.d.ts +26 -0
  149. package/server-helpers/cms-page-record.js +42 -0
  150. package/server-helpers/cms-request.js +48 -4
  151. package/server-helpers/record-fields.d.ts +62 -0
  152. package/server-helpers/record-fields.js +87 -0
  153. package/server-helpers/record-samples.d.ts +21 -0
  154. package/server-helpers/record-samples.js +41 -0
  155. package/styles/builder-scaffold.css +19 -19
  156. package/styles/controls.css +109 -109
  157. package/styles/gradients.css +23 -23
  158. package/styles/layout-affordances.css +15 -15
  159. package/styles/layout-authoring-scaffold.css +20 -20
  160. package/styles/layout.css +9 -9
  161. package/styles/root.css +4 -4
  162. package/styles/shell.css +48 -17
  163. package/theme/antd-css-var-contract.d.ts +86 -80
  164. package/theme/antd-css-var-contract.js +92 -81
  165. package/theme/phi-control-shape.d.ts +1 -1
  166. package/theme/phi-theme-gradients.d.ts +2 -2
  167. package/theme/phi-theme-gradients.js +14 -14
  168. package/theme/phi-theme-palette.d.ts +1 -1
  169. package/theme/phi-theme-palette.js +2 -2
  170. package/theme/phi-theme-tokens.d.ts +8 -5
  171. package/theme/phi-theme-tokens.js +59 -28
  172. package/theme/phi-theme.d.ts +14 -2
  173. package/theme/phi-theme.js +14 -1
  174. package/theme/phi-tokens.d.ts +5 -0
  175. package/theme/phi-tokens.js +9 -0
  176. package/types/cms-module-descriptors.d.ts +6 -0
  177. package/types/cms-plugins.d.ts +19 -1
  178. package/types/core-widget-placements.d.ts +10 -0
  179. package/types/record-provider.d.ts +92 -0
  180. package/types/widget-runtime.d.ts +5 -0
  181. /package/plugins/runtime-modules/{asset/services/folder-images.server.d.ts → core/services/media-folder-images.server.d.ts} +0 -0
  182. /package/plugins/runtime-modules/{asset/services/folder-images.server.js → core/services/media-folder-images.server.js} +0 -0
@@ -43,5 +43,5 @@ export function PhiExternalDocumentEditor({ format, sourceUrl, sourceLocale, onS
43
43
  });
44
44
  return () => controller.abort();
45
45
  }, [canReport, format, sourceLocale, sourceUrl]);
46
- return (_jsx("div", { style: { width: 520, height: 260, maxWidth: "100%", minWidth: 0, minHeight: 0, display: "flex" }, children: _jsx(PhiAlertControl, { level: "info", showIcon: true, title: `External ${format} source`, description: _jsxs(PhiFlexControl, { vertical: true, gap: "var(--ant-padding-xs)", style: { width: "100%", minWidth: 0 }, children: [_jsx(PhiTypographyControl, { children: "This widget renders the configured external document. Edit its URL and source locale in the widget settings." }), _jsx(PhiTypographyControl, { code: true, copyable: { text: sourceUrl }, style: { wordBreak: "break-all" }, children: sourceUrl || "No Source URL configured." })] }) }) }));
46
+ return (_jsx("div", { style: { width: 520, height: 260, maxWidth: "100%", minWidth: 0, minHeight: 0, display: "flex" }, children: _jsx(PhiAlertControl, { level: "info", showIcon: true, title: `External ${format} source`, description: _jsxs(PhiFlexControl, { vertical: true, gap: "var(--phi-padding-xs)", style: { width: "100%", minWidth: 0 }, children: [_jsx(PhiTypographyControl, { children: "This widget renders the configured external document. Edit its URL and source locale in the widget settings." }), _jsx(PhiTypographyControl, { code: true, copyable: { text: sourceUrl }, style: { wordBreak: "break-all" }, children: sourceUrl || "No Source URL configured." })] }) }) }));
47
47
  }
@@ -64,8 +64,8 @@ const PHI_HTML_WIDGET_EDITOR_LIVE_STYLE = `
64
64
  }
65
65
 
66
66
  .phi-html-widget-editor__text--code {
67
- font-family: var(--ant-font-family-code, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, monospace);
68
- background: var(--ant-color-fill-secondary, rgba(0, 0, 0, 0.04));
67
+ font-family: var(--phi-font-family-code, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, monospace);
68
+ background: var(--phi-color-fill-secondary, rgba(0, 0, 0, 0.04));
69
69
  border-radius: 4px;
70
70
  padding: 0 0.2em;
71
71
  }
@@ -436,7 +436,7 @@ export function PhiHtmlWidgetEditor({ blockId, html, fontFamily, fontSize, onCha
436
436
  width: "100%",
437
437
  minWidth: 0,
438
438
  maxWidth: "100%",
439
- border: "1px solid var(--ant-color-border, rgba(0, 0, 0, 0.12))",
439
+ border: "1px solid var(--phi-color-border, rgba(0, 0, 0, 0.12))",
440
440
  borderRadius: 0,
441
441
  overflow: "hidden",
442
442
  backgroundColor: "rgba(255,255,255,0.84)",
@@ -88,7 +88,7 @@ export declare const PHI_BACKGROUND_BASE_KINDS: readonly PhiCmsBackgroundWidgetC
88
88
  * ground (`PHI_SURFACE_TONE_GROUND`), and what a `theme` ground falls back to where the Theme's Overlay
89
89
  * is not published.
90
90
  */
91
- export declare const PHI_BACKGROUND_CONTAINER_GROUND = "var(--ant-color-bg-container)";
91
+ export declare const PHI_BACKGROUND_CONTAINER_GROUND = "var(--phi-color-bg-container)";
92
92
  /**
93
93
  * What a `theme` Base paints: the Shell Chrome Overlay's custom properties, the same ones the Shell's
94
94
  * chrome panes paint from (components/shell/phi-cms-shell.tsx).
@@ -37,7 +37,7 @@ export const PHI_BACKGROUND_BASE_KINDS = [
37
37
  * ground (`PHI_SURFACE_TONE_GROUND`), and what a `theme` ground falls back to where the Theme's Overlay
38
38
  * is not published.
39
39
  */
40
- export const PHI_BACKGROUND_CONTAINER_GROUND = "var(--ant-color-bg-container)";
40
+ export const PHI_BACKGROUND_CONTAINER_GROUND = "var(--phi-color-bg-container)";
41
41
  /**
42
42
  * What a `theme` Base paints: the Shell Chrome Overlay's custom properties, the same ones the Shell's
43
43
  * chrome panes paint from (components/shell/phi-cms-shell.tsx).
@@ -5,5 +5,5 @@ import { PhiTypographyControl } from "../controls/phi-typography-control";
5
5
  /** The label column every Inspector row shares, so a control that draws its own header lines up with the rest. */
6
6
  export const PHI_INSPECTOR_FIELD_LABEL_WIDTH = 140;
7
7
  export function PhiInspectorFieldRow({ label, children, labelWidth = PHI_INSPECTOR_FIELD_LABEL_WIDTH, }) {
8
- return (_jsxs(PhiFlexControl, { align: "flex-start", gap: 12, wrap: false, style: { width: "100%" }, children: [_jsx(PhiTypographyControl, { style: { flex: `0 0 ${labelWidth}px`, minWidth: 0, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap", lineHeight: "var(--ant-control-height)" }, children: label }), _jsx("div", { style: { flex: "1 1 auto", minWidth: 0 }, children: children })] }));
8
+ return (_jsxs(PhiFlexControl, { align: "flex-start", gap: 12, wrap: false, style: { width: "100%" }, children: [_jsx(PhiTypographyControl, { style: { flex: `0 0 ${labelWidth}px`, minWidth: 0, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap", lineHeight: "var(--phi-control-height)" }, children: label }), _jsx("div", { style: { flex: "1 1 auto", minWidth: 0 }, children: children })] }));
9
9
  }
@@ -69,6 +69,7 @@ const PHI_INSPECTOR_WIDGET_LABEL_SET = definePhiLabelSet({
69
69
  field_select_table_resource: PHI_INSPECTOR_WIDGET_DEFAULT_LABELS.fields.selectTableResource,
70
70
  field_select_calendar: PHI_INSPECTOR_WIDGET_DEFAULT_LABELS.fields.selectCalendar,
71
71
  field_select_video_provider: PHI_INSPECTOR_WIDGET_DEFAULT_LABELS.fields.selectVideoProvider,
72
+ field_select_record_field: PHI_INSPECTOR_WIDGET_DEFAULT_LABELS.fields.selectRecordField,
72
73
  link_none: PHI_INSPECTOR_WIDGET_DEFAULT_LABELS.fields.linkTarget.none,
73
74
  link_page: PHI_INSPECTOR_WIDGET_DEFAULT_LABELS.fields.linkTarget.page,
74
75
  link_external: PHI_INSPECTOR_WIDGET_DEFAULT_LABELS.fields.linkTarget.external,
@@ -158,6 +159,7 @@ export async function getPhiInspectorWidgetLabels(options) {
158
159
  selectTableResource: labels.field_select_table_resource,
159
160
  selectCalendar: labels.field_select_calendar,
160
161
  selectVideoProvider: labels.field_select_video_provider,
162
+ selectRecordField: labels.field_select_record_field,
161
163
  linkTarget: {
162
164
  none: labels.link_none,
163
165
  page: labels.link_page,
@@ -103,6 +103,7 @@ export type PhiInspectorFieldLabels = {
103
103
  selectTableResource: string;
104
104
  selectCalendar: string;
105
105
  selectVideoProvider: string;
106
+ selectRecordField: string;
106
107
  linkTarget: PhiInspectorLinkTargetLabels;
107
108
  };
108
109
  export declare const PHI_INSPECTOR_WIDGET_DEFAULT_LABELS: PhiInspectorWidgetLabels;
@@ -72,6 +72,7 @@ export const PHI_INSPECTOR_WIDGET_DEFAULT_LABELS = {
72
72
  selectTableResource: "Select a Table resource",
73
73
  selectCalendar: "Select a calendar",
74
74
  selectVideoProvider: "Select a video provider",
75
+ selectRecordField: "Select a field of the page's record",
75
76
  linkTarget: {
76
77
  none: "None",
77
78
  page: "Page",
@@ -24,7 +24,7 @@ import { PHI_THEME_HEADING_FONT_VARIABLE } from "../../../theme/phi-theme-typogr
24
24
  import { PHI_CARD_IMAGE_SIZES, PHI_CARD_TEXT_SLOTS, readPhiCardBillingPeriod } from "./card-vocabulary";
25
25
  /**
26
26
  * The layer over a card's picture. A colour or a gradient is drawn as CSS, each colour mixed down to the
27
- * Overlay's opacity, so a Theme variable (`var(--ant-color-bg-container)`) resolves and the picture fades
27
+ * Overlay's opacity, so a Theme variable (`var(--phi-color-bg-container)`) resolves and the picture fades
28
28
  * into the card's own ground in either mode; a Background draws the same Overlay into an SVG picture,
29
29
  * where no variable reaches. A pattern or noise is drawn as a Background draws it.
30
30
  */
@@ -4,7 +4,7 @@ import { PhiButtonControl } from "../../controls/phi-button-control";
4
4
  import { PhiResultControl } from "../../controls/phi-result-control";
5
5
  export function PhiResultWidgetBody({ config, code, title, subTitle, homeHref, homeLinkLabel, }) {
6
6
  const renderedTitle = code && title && code !== title
7
- ? (_jsxs("span", { style: { display: "inline-flex", flexDirection: "column", gap: "var(--ant-padding-xxs)" }, children: [_jsx("span", { children: code }), _jsx("span", { style: { fontSize: "var(--ant-font-size-lg)", fontWeight: 400 }, children: title })] }))
7
+ ? (_jsxs("span", { style: { display: "inline-flex", flexDirection: "column", gap: "var(--phi-padding-xxs)" }, children: [_jsx("span", { children: code }), _jsx("span", { style: { fontSize: "var(--phi-font-size-lg)", fontWeight: 400 }, children: title })] }))
8
8
  : (title || code || "Information");
9
9
  return (_jsx(PhiResultControl, { status: config?.status ?? "info", title: renderedTitle, subTitle: subTitle, extra: config?.homeLink
10
10
  ? _jsx(PhiButtonControl, { href: homeHref, label: homeLinkLabel, type: "primary" })
@@ -19,9 +19,16 @@
19
19
  export declare const PHI_MEDIA_LIBRARY_DATA_PROVIDER_KEYS: {
20
20
  readonly collection: `${string}/${string}`;
21
21
  readonly folders: `${string}/${string}`;
22
+ /**
23
+ * Every Folder of the Site Space as a choice, loaded by the choice itself. The Asset Module answers it,
24
+ * and the Builder reads it in any Area (`availableToAuthoringChrome`); the folder pictures Provider
25
+ * names it for its Folder setting.
26
+ */
27
+ readonly folderChoices: `${string}/${string}`;
22
28
  /**
23
29
  * The public pictures of one Folder, read on the server while the page is drawn (a `record`
24
- * Provider). The Gallery Widget starts bound to it, which is why Core cites the key.
30
+ * Provider). Served by Core, not by the Asset Module: showing what is public needs no Media
31
+ * management in the Area, as an Image Widget does not. The Gallery Widget starts bound to it.
25
32
  */
26
33
  readonly folderImages: `${string}/${string}`;
27
34
  };
@@ -20,9 +20,16 @@ import { createPhiSharedRuntimeDataProviderKey, createPhiSharedRuntimeItemRender
20
20
  export const PHI_MEDIA_LIBRARY_DATA_PROVIDER_KEYS = {
21
21
  collection: createPhiSharedRuntimeDataProviderKey("collections", "media"),
22
22
  folders: createPhiSharedRuntimeDataProviderKey("options", "media-folders"),
23
+ /**
24
+ * Every Folder of the Site Space as a choice, loaded by the choice itself. The Asset Module answers it,
25
+ * and the Builder reads it in any Area (`availableToAuthoringChrome`); the folder pictures Provider
26
+ * names it for its Folder setting.
27
+ */
28
+ folderChoices: createPhiSharedRuntimeDataProviderKey("options", "media-folder-choices"),
23
29
  /**
24
30
  * The public pictures of one Folder, read on the server while the page is drawn (a `record`
25
- * Provider). The Gallery Widget starts bound to it, which is why Core cites the key.
31
+ * Provider). Served by Core, not by the Asset Module: showing what is public needs no Media
32
+ * management in the Area, as an Image Widget does not. The Gallery Widget starts bound to it.
26
33
  */
27
34
  folderImages: createPhiSharedRuntimeDataProviderKey("records", "media-folder-images"),
28
35
  };
@@ -0,0 +1,6 @@
1
+ /**
2
+ * The kinds a field of a record can be. Closed: a Widget says which of them it draws, and the Builder offers
3
+ * only those. Here rather than beside the record types, so that reading the list at runtime does not load them.
4
+ */
5
+ export declare const PHI_RECORD_FIELD_KINDS: readonly ["text", "markdown", "picture", "pictures", "list", "tag", "date", "number", "link"];
6
+ export type PhiRecordFieldKind = (typeof PHI_RECORD_FIELD_KINDS)[number];
@@ -0,0 +1,7 @@
1
+ /**
2
+ * The kinds a field of a record can be. Closed: a Widget says which of them it draws, and the Builder offers
3
+ * only those. Here rather than beside the record types, so that reading the list at runtime does not load them.
4
+ */
5
+ export const PHI_RECORD_FIELD_KINDS = [
6
+ "text", "markdown", "picture", "pictures", "list", "tag", "date", "number", "link",
7
+ ];
@@ -244,7 +244,7 @@ const PHI_RUNTIME_MODULE_OWNERSHIP = {
244
244
  // One published entry with its relatives, read on the server (`types/record-provider.ts`).
245
245
  "records/content-entry": ["core", "content-entry"],
246
246
  // The public pictures of a Media Folder, for a Gallery that shows a Folder.
247
- "records/media-folder-images": ["asset", "media-folder-images"],
247
+ "records/media-folder-images": ["core", "media-folder-images"],
248
248
  "signals/tour-availability": ["tour", "availability"],
249
249
  "signals/tour-progress": ["tour", "progress"],
250
250
  "signals/tree-action": ["core", "tree-action"],
@@ -13,9 +13,9 @@ type PhiBorderWidgetStyleFallback = {
13
13
  * has to add this to the sum, and a `1px` typed into that calculation is the same second answer as one
14
14
  * typed into a border.
15
15
  */
16
- export declare const PHI_THEME_BORDER_WIDTH = "var(--ant-line-width, 1px)";
16
+ export declare const PHI_THEME_BORDER_WIDTH = "var(--phi-line-width, 1px)";
17
17
  /** The Site's own line: its border colour at its line width. One string, so nobody types a second. */
18
- export declare const PHI_THEME_BORDER_LINE = "var(--ant-line-width, 1px) solid var(--ant-color-border)";
18
+ export declare const PHI_THEME_BORDER_LINE = "var(--phi-line-width, 1px) solid var(--phi-color-border)";
19
19
  /**
20
20
  * The same line at a colour the caller names.
21
21
  *
@@ -5,9 +5,9 @@
5
5
  * has to add this to the sum, and a `1px` typed into that calculation is the same second answer as one
6
6
  * typed into a border.
7
7
  */
8
- export const PHI_THEME_BORDER_WIDTH = "var(--ant-line-width, 1px)";
8
+ export const PHI_THEME_BORDER_WIDTH = "var(--phi-line-width, 1px)";
9
9
  /** The Site's own line: its border colour at its line width. One string, so nobody types a second. */
10
- export const PHI_THEME_BORDER_LINE = `${PHI_THEME_BORDER_WIDTH} solid var(--ant-color-border)`;
10
+ export const PHI_THEME_BORDER_LINE = `${PHI_THEME_BORDER_WIDTH} solid var(--phi-color-border)`;
11
11
  /**
12
12
  * The same line at a colour the caller names.
13
13
  *
@@ -1,13 +1,13 @@
1
1
  /** The body Layout's config: a vertical Flex with the `panel` creation preset under it. */
2
2
  export declare const PHI_DIALOG_BODY_CONFIG: {
3
- readonly gap: "var(--ant-padding-sm)";
3
+ readonly gap: "var(--phi-padding-sm)";
4
4
  readonly margin: 0;
5
- readonly padding: "var(--ant-padding)";
5
+ readonly padding: "var(--phi-padding)";
6
6
  readonly surface: {
7
7
  readonly background: {
8
8
  readonly base: {
9
9
  readonly kind: "color";
10
- readonly color: "var(--ant-color-fill-quaternary)";
10
+ readonly color: "var(--phi-color-fill-quaternary)";
11
11
  };
12
12
  readonly overlay: null;
13
13
  readonly filter: null;
@@ -24,7 +24,7 @@ export declare const PHI_DIALOG_BLEED_BODY_CONFIG: {
24
24
  readonly background: {
25
25
  readonly base: {
26
26
  readonly kind: "color";
27
- readonly color: "var(--ant-color-fill-quaternary)";
27
+ readonly color: "var(--phi-color-fill-quaternary)";
28
28
  };
29
29
  readonly overlay: null;
30
30
  readonly filter: null;
@@ -8,7 +8,7 @@ export declare const PHI_SPLIT_CARD_LAYOUT_CREATION_CONFIG: {
8
8
  readonly background: {
9
9
  readonly base: {
10
10
  readonly kind: "color";
11
- readonly color: "var(--ant-color-bg-container)";
11
+ readonly color: "var(--phi-color-bg-container)";
12
12
  };
13
13
  readonly overlay: null;
14
14
  readonly filter: null;
@@ -17,7 +17,7 @@ export declare const PHI_SPLIT_CARD_LAYOUT_CREATION_CONFIG: {
17
17
  readonly border: {
18
18
  readonly borderWidth: 1;
19
19
  readonly borderStyle: "solid";
20
- readonly borderColor: "var(--ant-color-border-secondary)";
20
+ readonly borderColor: "var(--phi-color-border-secondary)";
21
21
  };
22
22
  readonly shadow: "soft";
23
23
  };
@@ -1,9 +1,14 @@
1
1
  import { type PhiBuilderAreaKey } from "../constants/cms-areas";
2
2
  import type { PhiCmsPresetSource } from "../types/cms-module-descriptors";
3
+ import type { PhiRuntimeDataProviderKey } from "../types/runtime-data-provider";
3
4
  import { type PhiPageReference } from "../types/references";
4
5
  export type PhiPresetPageNode = {
5
6
  key: string;
6
7
  title: string;
8
+ /** The record Provider of the record this Page is about, where its route names one. */
9
+ pageRecord?: {
10
+ providerKey: PhiRuntimeDataProviderKey;
11
+ };
7
12
  /** The address the Page answers on, including the package namespace outside Public. */
8
13
  storagePath?: string;
9
14
  /**
@@ -1,6 +1,7 @@
1
1
  import type { PhiPresetPageNode } from "./cms-page-catalog";
2
2
  import type { PhiCmsActiveRouteTable } from "../types/cms-module-descriptors";
3
3
  import type { PhiRuntimeModuleId } from "../types";
4
+ import type { PhiRuntimeDataProviderKey } from "../types/runtime-data-provider";
4
5
  /**
5
6
  * Puts one Module route into a Page tree, under the folders its path names.
6
7
  *
@@ -16,6 +17,9 @@ export declare function insertPhiPresetPageTarget(roots: PhiPresetPageNode[], ta
16
17
  presetVersion: number;
17
18
  defaultPageFlags?: number;
18
19
  landingPage?: true;
20
+ pageRecord?: {
21
+ providerKey: PhiRuntimeDataProviderKey;
22
+ };
19
23
  }): void;
20
24
  /**
21
25
  * The Module Pages one Area answers on today, as catalog nodes.
@@ -43,6 +43,7 @@ export function insertPhiPresetPageTarget(roots, target) {
43
43
  sourcePreset,
44
44
  ...(target.defaultPageFlags ? { defaultPageFlags: target.defaultPageFlags } : {}),
45
45
  ...(target.landingPage ? { landingPage: true } : {}),
46
+ ...(target.pageRecord ? { pageRecord: { providerKey: target.pageRecord.providerKey } } : {}),
46
47
  });
47
48
  return;
48
49
  }
@@ -64,6 +65,7 @@ export function insertPhiPresetPageTarget(roots, target) {
64
65
  sourcePreset,
65
66
  ...(target.defaultPageFlags ? { defaultPageFlags: target.defaultPageFlags } : {}),
66
67
  ...(target.landingPage ? { landingPage: true } : {}),
68
+ ...(target.pageRecord ? { pageRecord: { providerKey: target.pageRecord.providerKey } } : {}),
67
69
  });
68
70
  }
69
71
  /**
@@ -23,8 +23,8 @@ export declare const PHI_GLASS_LAYOUT_EFFECT_DEFINITIONS: {
23
23
  };
24
24
  export declare const PHI_SHADOW_DEFINITIONS: {
25
25
  readonly none: "none";
26
- readonly soft: "var(--ant-box-shadow-tertiary)";
27
- readonly strong: "var(--ant-box-shadow)";
26
+ readonly soft: "var(--phi-box-shadow-tertiary)";
27
+ readonly strong: "var(--phi-box-shadow)";
28
28
  };
29
29
  export declare function resolvePhiShadow(value: PhiShadow | null | undefined): CSSProperties["boxShadow"] | undefined;
30
30
  export declare function resolvePhiLayoutEffectStyle({ effect, background, }: {
@@ -7,7 +7,10 @@ import type { PhiResolvedCmsPageTree } from "../types/cms";
7
7
  * on what an author saves in the Builder: there the scale is what the Inspector offers, and a value off it
8
8
  * is the author's to choose.
9
9
  *
10
- * It reads the stated config only and resolves nothing: a distance is a step of `PHI_SPACE` or nothing.
10
+ * It reads the stated config only and resolves nothing: a distance is a step of `PHI_SPACE` or nothing, and
11
+ * a Layout's config is one its own parser takes -- a Grid of five columns is refused, for the Grid takes 1,
12
+ * 2, 3, 4 or 6, and on a live page a Layout whose config is refused is left out without a message. Widget
13
+ * configs are not parsed here; their parsers live with the Widgets.
11
14
  */
12
15
  export type PhiPageLayoutFinding = {
13
16
  /** The node's label, or its id where it has none. */
@@ -1,5 +1,6 @@
1
1
  import { PhiCmsRegionType } from "../constants/phi-cms";
2
2
  import { PHI_SPACE } from "../theme/antd-css-var-contract";
3
+ import { parsePhiCmsCarouselLayoutConfig, parsePhiCmsCollapsibleLayoutConfig, parsePhiCmsContentLayoutConfig, parsePhiCmsFlexLayoutConfig, parsePhiCmsFlexVerticalLayoutConfig, parsePhiCmsGridLayoutConfig, parsePhiCmsMasonryLayoutConfig, parsePhiCmsSplitCardLayoutConfig, parsePhiCmsStackLayoutConfig, parsePhiCmsThreeColumnLayoutConfig, } from "../types/cms-config";
3
4
  import { readPhiSurface } from "../types/surface";
4
5
  const SPACING_KEYS = ["padding", "paddingTop", "paddingRight", "paddingBottom", "paddingLeft", "gap"];
5
6
  const PADDING_KEYS = SPACING_KEYS.filter((key) => key !== "gap");
@@ -8,6 +9,19 @@ const PRESET_STEPS = ["xxs", "xs", "sm", "base", "md"];
8
9
  const EMPHASIS_STEPS = ["lg", "xl", "xxl"];
9
10
  /** Layouts that bring a padding of their own by default (LAYOUTING.md): stated, or they keep it. */
10
11
  const DEFAULT_PADDED_LAYOUTS = new Set(["grid", "masonry", "three-column"]);
12
+ /** The strict parser of each Layout type that has one in the contract layer (the plugins' `parseConfig`). */
13
+ const LAYOUT_CONFIG_PARSERS = {
14
+ content: parsePhiCmsContentLayoutConfig,
15
+ flex: parsePhiCmsFlexLayoutConfig,
16
+ "flex-vertical": parsePhiCmsFlexVerticalLayoutConfig,
17
+ masonry: parsePhiCmsMasonryLayoutConfig,
18
+ stack: parsePhiCmsStackLayoutConfig,
19
+ carousel: parsePhiCmsCarouselLayoutConfig,
20
+ collapsible: parsePhiCmsCollapsibleLayoutConfig,
21
+ grid: parsePhiCmsGridLayoutConfig,
22
+ "three-column": parsePhiCmsThreeColumnLayoutConfig,
23
+ "split-card": parsePhiCmsSplitCardLayoutConfig,
24
+ };
11
25
  function stepOf(value) {
12
26
  if (value === 0 || value === "0")
13
27
  return "none";
@@ -68,6 +82,18 @@ export function checkPhiPagePresetLayout(tree) {
68
82
  const config = (node.config ?? {});
69
83
  const typeKey = typeKeyOf(node);
70
84
  const surface = readPhiSurface(config.surface);
85
+ const parse = Object.hasOwn(LAYOUT_CONFIG_PARSERS, typeKey) ? LAYOUT_CONFIG_PARSERS[typeKey] : undefined;
86
+ if (parse) {
87
+ try {
88
+ parse(config);
89
+ }
90
+ catch (error) {
91
+ findings.push({
92
+ node: nameOf(node),
93
+ message: `its config is refused: ${error instanceof Error ? error.message : String(error)}`,
94
+ });
95
+ }
96
+ }
71
97
  for (const key of SPACING_KEYS) {
72
98
  const value = config[key];
73
99
  if (value == null)
@@ -0,0 +1,9 @@
1
+ import type { PhiRecordField, PhiRecordFieldKind, PhiRecordFieldValueByKind } from "../types/record-provider";
2
+ /** `value` as a field of `kind`, or `undefined` where it is not one. */
3
+ export declare function readPhiRecordFieldValue<K extends PhiRecordFieldKind>(kind: K, value: unknown): PhiRecordFieldValueByKind[K] | undefined;
4
+ /** The kinds a line of text can show: a text as it is, a number and a date in the page's language. */
5
+ export declare const PHI_RECORD_TEXT_FIELD_KINDS: readonly ["text", "number", "date"];
6
+ /** A text, number or date field as the words a page shows, written for `locale`. */
7
+ export declare function formatPhiRecordFieldText(field: Extract<PhiRecordField, {
8
+ kind: (typeof PHI_RECORD_TEXT_FIELD_KINDS)[number];
9
+ }>, locale: string): string;
@@ -0,0 +1,84 @@
1
+ /*
2
+ * A record field's value, checked against its declared kind (`types/record-provider.ts`).
3
+ *
4
+ * A Module hands these over and a Core Widget draws them unseen, so the kind is the whole agreement: a
5
+ * value that is not of its kind answers `undefined` and is not drawn.
6
+ */
7
+ function isRecord(value) {
8
+ return typeof value === "object" && value !== null && !Array.isArray(value);
9
+ }
10
+ /** An address a record may name: absolute over http(s), or Site-relative. Never a scheme of its own. */
11
+ function readAddress(value) {
12
+ if (typeof value !== "string")
13
+ return undefined;
14
+ const address = value.trim();
15
+ return /^https?:\/\//iu.test(address) || (address.startsWith("/") && !address.startsWith("//")) ? address : undefined;
16
+ }
17
+ function readPicture(value) {
18
+ if (!isRecord(value))
19
+ return undefined;
20
+ const src = readAddress(value.src);
21
+ if (!src)
22
+ return undefined;
23
+ return typeof value.alt === "string" && value.alt ? { src, alt: value.alt } : { src };
24
+ }
25
+ const TAG_TONES = ["default", "success", "warning", "error"];
26
+ function readTag(value) {
27
+ if (!isRecord(value) || typeof value.label !== "string" || !value.label.trim())
28
+ return undefined;
29
+ if (value.tone === undefined)
30
+ return { label: value.label };
31
+ return typeof value.tone === "string" && TAG_TONES.includes(value.tone)
32
+ ? { label: value.label, tone: value.tone }
33
+ : undefined;
34
+ }
35
+ function readLink(value) {
36
+ if (!isRecord(value))
37
+ return undefined;
38
+ const href = readAddress(value.href);
39
+ if (!href)
40
+ return undefined;
41
+ return typeof value.label === "string" && value.label ? { href, label: value.label } : { href };
42
+ }
43
+ function readAll(value, read) {
44
+ if (!Array.isArray(value))
45
+ return undefined;
46
+ const entries = value.map(read);
47
+ return entries.every((entry) => entry !== undefined) ? entries : undefined;
48
+ }
49
+ export function readPhiRecordFieldValue(kind, value) {
50
+ switch (kind) {
51
+ case "text":
52
+ case "markdown":
53
+ return typeof value === "string" ? value : undefined;
54
+ case "picture":
55
+ return readPicture(value);
56
+ case "pictures":
57
+ return readAll(value, readPicture);
58
+ case "list":
59
+ return readAll(value, (entry) => (typeof entry === "string" ? entry : undefined));
60
+ case "tag":
61
+ return readTag(value);
62
+ case "date":
63
+ return typeof value === "string" && !Number.isNaN(Date.parse(value)) ? value : undefined;
64
+ case "number":
65
+ return typeof value === "number" && Number.isFinite(value) ? value : undefined;
66
+ case "link":
67
+ return readLink(value);
68
+ }
69
+ }
70
+ /** The kinds a line of text can show: a text as it is, a number and a date in the page's language. */
71
+ export const PHI_RECORD_TEXT_FIELD_KINDS = ["text", "number", "date"];
72
+ /** A text, number or date field as the words a page shows, written for `locale`. */
73
+ export function formatPhiRecordFieldText(field, locale) {
74
+ if (field.kind === "text")
75
+ return field.value;
76
+ try {
77
+ return field.kind === "number"
78
+ ? new Intl.NumberFormat(locale).format(field.value)
79
+ : new Intl.DateTimeFormat(locale, { dateStyle: "medium" }).format(new Date(field.value));
80
+ }
81
+ catch {
82
+ return String(field.value);
83
+ }
84
+ }
@@ -11,7 +11,7 @@ export declare const PHI_SURFACE_CARD: {
11
11
  readonly background: {
12
12
  readonly base: {
13
13
  readonly kind: "color";
14
- readonly color: "var(--ant-color-bg-container)";
14
+ readonly color: "var(--phi-color-bg-container)";
15
15
  };
16
16
  readonly overlay: null;
17
17
  readonly filter: null;
@@ -20,7 +20,7 @@ export declare const PHI_SURFACE_CARD: {
20
20
  readonly border: {
21
21
  readonly borderWidth: 1;
22
22
  readonly borderStyle: "solid";
23
- readonly borderColor: "var(--ant-color-border-secondary)";
23
+ readonly borderColor: "var(--phi-color-border-secondary)";
24
24
  };
25
25
  readonly shadow: "soft";
26
26
  };
@@ -33,7 +33,7 @@ export declare const PHI_SURFACE_WASH: {
33
33
  readonly background: {
34
34
  readonly base: {
35
35
  readonly kind: "color";
36
- readonly color: "var(--ant-color-fill-quaternary)";
36
+ readonly color: "var(--phi-color-fill-quaternary)";
37
37
  };
38
38
  readonly overlay: null;
39
39
  readonly filter: null;
@@ -46,7 +46,7 @@ export declare const PHI_SURFACE_PRESETS: {
46
46
  readonly background: {
47
47
  readonly base: {
48
48
  readonly kind: "color";
49
- readonly color: "var(--ant-color-bg-container)";
49
+ readonly color: "var(--phi-color-bg-container)";
50
50
  };
51
51
  readonly overlay: null;
52
52
  readonly filter: null;
@@ -55,7 +55,7 @@ export declare const PHI_SURFACE_PRESETS: {
55
55
  readonly border: {
56
56
  readonly borderWidth: 1;
57
57
  readonly borderStyle: "solid";
58
- readonly borderColor: "var(--ant-color-border-secondary)";
58
+ readonly borderColor: "var(--phi-color-border-secondary)";
59
59
  };
60
60
  readonly shadow: "soft";
61
61
  };
@@ -63,7 +63,7 @@ export declare const PHI_SURFACE_PRESETS: {
63
63
  readonly background: {
64
64
  readonly base: {
65
65
  readonly kind: "color";
66
- readonly color: "var(--ant-color-fill-quaternary)";
66
+ readonly color: "var(--phi-color-fill-quaternary)";
67
67
  };
68
68
  readonly overlay: null;
69
69
  readonly filter: null;
@@ -51,7 +51,7 @@ export type PhiSurfaceStyleOptions = {
51
51
  groundLayer?: boolean;
52
52
  };
53
53
  /** The ground a toned Surface paints where it states none: the container ground of the tone's mode. */
54
- export declare const PHI_SURFACE_TONE_GROUND = "var(--ant-color-bg-container)";
54
+ export declare const PHI_SURFACE_TONE_GROUND = "var(--phi-color-bg-container)";
55
55
  /**
56
56
  * Whether a Surface takes its tone's ground (`PHI_SURFACE_TONE_GROUND`): it asks for a mode of its own and
57
57
  * its Background paints nothing. A stated ground wins, and the Theme's Overlay (`base.kind: "theme"`) is
package/helpers.d.ts CHANGED
@@ -10,7 +10,6 @@ export * from "./helpers/widget-dimension-plugin-fields";
10
10
  export * from "./helpers/translation-format";
11
11
  export { buildPhiCmsLayoutNode, buildPhiCmsWidgetNode, } from "./helpers/cms-node-factories";
12
12
  export * from "./helpers/cms-preset-nodes";
13
- export { checkPhiPagePresetLayout, type PhiPageLayoutFinding } from "./helpers/page-layout-check";
14
13
  export * from "./helpers/cms-dialog";
15
14
  export { buildPhiSettingsPageShellTree, type PhiSettingsPageShellFormSection, type PhiSettingsPageShellOverlay, type PhiSettingsPageShellPanel, type PhiSettingsPageShellSection, type PhiSettingsPageShellWidgetSection, } from "./components/regions/presets/phi-settings-page-shell-tree";
16
15
  export * from "./helpers/format-date-time";
package/helpers.js CHANGED
@@ -10,8 +10,6 @@ export * from "./helpers/widget-dimension-plugin-fields";
10
10
  export * from "./helpers/translation-format";
11
11
  export { buildPhiCmsLayoutNode, buildPhiCmsWidgetNode, } from "./helpers/cms-node-factories";
12
12
  export * from "./helpers/cms-preset-nodes";
13
- /* The Page rule as a check, for a package to run over the trees its presets build (THIRD_PARTY_MODULES.md 6b). */
14
- export { checkPhiPagePresetLayout } from "./helpers/page-layout-check";
15
13
  export * from "./helpers/cms-dialog";
16
14
  /*
17
15
  * The one Settings page shell (SETTINGS.md section 4). Public because the contract holds for every
@@ -0,0 +1,12 @@
1
+ /**
2
+ * What a Module package needs to check its own preset Pages in its own verify step, and nothing else
3
+ * (THIRD_PARTY_MODULES.md, "Checking a Page preset").
4
+ *
5
+ * Narrow because it is verify-time tooling: it carries the Layout config parsers, which a Site's runtime
6
+ * must not load for this. A package runs the check in its own tests over the trees its route presets
7
+ * build, and treats a finding as an error; it is never called while a Site serves a request, and so it is
8
+ * never part of `@phis/ui/helpers`.
9
+ *
10
+ * No `server-only` here, on purpose: a test in a package loads this door without a mock.
11
+ */
12
+ export { checkPhiPagePresetLayout, type PhiPageLayoutFinding } from "./helpers/page-layout-check";
@@ -0,0 +1,12 @@
1
+ /**
2
+ * What a Module package needs to check its own preset Pages in its own verify step, and nothing else
3
+ * (THIRD_PARTY_MODULES.md, "Checking a Page preset").
4
+ *
5
+ * Narrow because it is verify-time tooling: it carries the Layout config parsers, which a Site's runtime
6
+ * must not load for this. A package runs the check in its own tests over the trees its route presets
7
+ * build, and treats a finding as an error; it is never called while a Site serves a request, and so it is
8
+ * never part of `@phis/ui/helpers`.
9
+ *
10
+ * No `server-only` here, on purpose: a test in a package loads this door without a mock.
11
+ */
12
+ export { checkPhiPagePresetLayout } from "./helpers/page-layout-check";
@@ -6,7 +6,8 @@
6
6
  * Server half every route of the Site imports. A Provider's resolver is the package's own function; the
7
7
  * types say what it is asked with, `fetchPhiSiteApi` asks Core with the credentials the context carries,
8
8
  * and `resolvePhiRecordSource` is how one of the package's Server Widgets reads the record its binding
9
- * names -- once per request, however many Widgets are bound to it.
9
+ * names -- once per request, however many Widgets are bound to it. `resolvePhiPageRecordFields` reads the
10
+ * declared fields of the record the Page is about, through the same read.
10
11
  *
11
12
  * `PhiWidgetFailureServer` is what such a Widget renders when that read, or its binding, fails: the error
12
13
  * card in the Builder, nothing on a live page, and the `cms.widget.unavailable` warning either way. It is
@@ -14,8 +15,9 @@
14
15
  * in `@phis/ui/runtime/data-provider-client`.
15
16
  */
16
17
  import "server-only";
17
- export type { PhiRuntimeModuleRecordProviderServerDefinition, PhiRuntimeRecordProviderContext, PhiRuntimeRecordProviderResolver, } from "./types/record-provider";
18
+ export type { PhiRecordField, PhiRecordLink, PhiRecordPicture, PhiRecordSample, PhiRecordTag, PhiRuntimeModuleRecordProviderServerDefinition, PhiRuntimeRecordFieldsReader, PhiRuntimeRecordProviderContext, PhiRuntimeRecordProviderResolver, PhiRuntimeRecordSamplesReader, } from "./types/record-provider";
18
19
  export { resolvePhiRecordSource, type PhiRecordSourceResult } from "./server-helpers/record-source";
20
+ export { resolvePhiPageRecordFields, type PhiPageRecordFieldsResult } from "./server-helpers/record-fields";
19
21
  export { fetchPhiSiteApi, type PhiSiteApiRequest } from "./gateway/site-api-request";
20
22
  export { PhiWidgetFailureServer } from "./components/widgets/shared/widget-failure.server";
21
23
  export type { PhiWidgetFailureProps } from "./components/widgets/shared/widget-failure";
package/module-records.js CHANGED
@@ -6,7 +6,8 @@
6
6
  * Server half every route of the Site imports. A Provider's resolver is the package's own function; the
7
7
  * types say what it is asked with, `fetchPhiSiteApi` asks Core with the credentials the context carries,
8
8
  * and `resolvePhiRecordSource` is how one of the package's Server Widgets reads the record its binding
9
- * names -- once per request, however many Widgets are bound to it.
9
+ * names -- once per request, however many Widgets are bound to it. `resolvePhiPageRecordFields` reads the
10
+ * declared fields of the record the Page is about, through the same read.
10
11
  *
11
12
  * `PhiWidgetFailureServer` is what such a Widget renders when that read, or its binding, fails: the error
12
13
  * card in the Builder, nothing on a live page, and the `cms.widget.unavailable` warning either way. It is
@@ -15,5 +16,6 @@
15
16
  */
16
17
  import "server-only";
17
18
  export { resolvePhiRecordSource } from "./server-helpers/record-source";
19
+ export { resolvePhiPageRecordFields } from "./server-helpers/record-fields";
18
20
  export { fetchPhiSiteApi } from "./gateway/site-api-request";
19
21
  export { PhiWidgetFailureServer } from "./components/widgets/shared/widget-failure.server";