@phis/ui 0.6.4 → 0.6.6

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 (192) hide show
  1. package/components/cms/phi-cms-layout-renderer.js +11 -2
  2. package/components/controls/phi-image-control.js +9 -1
  3. package/components/controls/phi-multi-select-control.js +4 -2
  4. package/components/controls/phi-options-provider.d.ts +1 -0
  5. package/components/controls/phi-options-provider.js +1 -0
  6. package/components/controls/phi-select-control.d.ts +21 -0
  7. package/components/controls/phi-select-control.js +2 -2
  8. package/components/controls/phi-status-dot-control.d.ts +15 -0
  9. package/components/controls/phi-status-dot-control.js +25 -0
  10. package/components/controls/phi-table-control.js +8 -1
  11. package/components/controls/phi-tree-control.js +5 -4
  12. package/components/controls/phi-tree-select-control.js +1 -0
  13. package/components/forms/auth-admin-settings-labels.d.ts +4 -0
  14. package/components/forms/auth-admin-settings-labels.js +11 -3
  15. package/components/forms/form-provider-contract.d.ts +1 -1
  16. package/components/forms/form-provider-contract.js +1 -1
  17. package/components/layouts/clients/phi-split-card-half.d.ts +4 -1
  18. package/components/layouts/clients/phi-split-card-half.js +2 -2
  19. package/components/layouts/clients/phi-split-card-layout-client.d.ts +6 -3
  20. package/components/layouts/clients/phi-split-card-layout-client.js +5 -3
  21. package/components/layouts/clients/phi-three-column-layout-client.d.ts +20 -1
  22. package/components/layouts/clients/phi-three-column-layout-client.js +31 -15
  23. package/components/layouts/layout-definitions.d.ts +96 -0
  24. package/components/layouts/layout-definitions.js +40 -2
  25. package/components/layouts/plugins/split-card-layout-plugin.js +1 -1
  26. package/components/layouts/plugins/three-column-layout-plugin.js +1 -1
  27. package/components/layouts/split-card-geometry.d.ts +9 -4
  28. package/components/layouts/split-card-geometry.js +29 -13
  29. package/components/media/media-folder-options.d.ts +10 -0
  30. package/components/media/media-folder-options.js +14 -0
  31. package/components/navigation/phi-link.d.ts +7 -1
  32. package/components/navigation/phi-link.js +6 -2
  33. package/components/root/phi-root-theme-resolver.js +2 -0
  34. package/components/shell/phi-antd-icon.d.ts +1 -0
  35. package/components/shell/phi-antd-icon.js +3 -0
  36. package/components/widgets/client/shared/phi-rendered-value.js +1 -1
  37. package/components/widgets/inspector-field-row.js +4 -1
  38. package/components/widgets/label-sets/account.js +6 -2
  39. package/components/widgets/label-sets/admin-users.d.ts +3 -0
  40. package/components/widgets/label-sets/admin-users.js +8 -2
  41. package/components/widgets/label-sets/effects.js +5 -1
  42. package/components/widgets/label-sets/gallery.js +2 -2
  43. package/components/widgets/label-sets/inspector.js +4 -0
  44. package/components/widgets/label-sets/observability-logs.js +2 -2
  45. package/components/widgets/label-sets/profile.js +2 -1
  46. package/components/widgets/label-types/gallery.d.ts +2 -3
  47. package/components/widgets/label-types/gallery.js +1 -4
  48. package/components/widgets/label-types/inspector.d.ts +4 -0
  49. package/components/widgets/label-types/inspector.js +2 -0
  50. package/components/widgets/shared/markdown-body-client.js +1 -1
  51. package/components/widgets/shared/markdown-image-vocabulary.js +1 -1
  52. package/constants/cms-layout-proportions.d.ts +6 -0
  53. package/constants/cms-layout-proportions.js +17 -0
  54. package/constants/runtime-module-ownership.js +1 -0
  55. package/helpers/page-reference-tree.js +8 -0
  56. package/helpers/table-action-links.d.ts +11 -0
  57. package/helpers/table-action-links.js +14 -0
  58. package/helpers/table-action-row-link.d.ts +8 -0
  59. package/helpers/table-action-row-link.js +14 -0
  60. package/package.json +2 -2
  61. package/plugins/factories/widget-renderers.d.ts +7 -1
  62. package/plugins/factories/widget-renderers.js +12 -2
  63. package/plugins/runtime-modules/asset/authoring-widgets.js +2 -2
  64. package/plugins/runtime-modules/asset/data-providers.js +1 -1
  65. package/plugins/runtime-modules/asset/services/options.js +7 -11
  66. package/plugins/runtime-modules/asset/widgets/area-upload/plugin.js +0 -2
  67. package/plugins/runtime-modules/asset/widgets/asset-focal-rect/plugin.js +0 -2
  68. package/plugins/runtime-modules/asset/widgets/image-inspector/plugin.js +0 -2
  69. package/plugins/runtime-modules/asset/widgets/media-picker/plugin.js +0 -2
  70. package/plugins/runtime-modules/asset/widgets.js +4 -4
  71. package/plugins/runtime-modules/auth/admin-settings-forms.js +47 -1
  72. package/plugins/runtime-modules/auth/authoring-widgets.js +4 -8
  73. package/plugins/runtime-modules/auth/data-providers.js +2 -0
  74. package/plugins/runtime-modules/auth/widgets/auth-workflow/plugin.js +0 -6
  75. package/plugins/runtime-modules/auth/widgets/logout/plugin.js +0 -2
  76. package/plugins/runtime-modules/auth/widgets/security/plugin.js +0 -2
  77. package/plugins/runtime-modules/auth/widgets.js +5 -3
  78. package/plugins/runtime-modules/avatar/authoring-widgets.js +2 -2
  79. package/plugins/runtime-modules/avatar/widgets/account-avatar/plugin.js +0 -2
  80. package/plugins/runtime-modules/avatar/widgets/account-avatar-picker/plugin.js +0 -2
  81. package/plugins/runtime-modules/avatar/widgets.js +2 -2
  82. package/plugins/runtime-modules/builder/authoring-widgets.js +1 -1
  83. package/plugins/runtime-modules/builder/clients/inspector-choice-cascader.d.ts +28 -0
  84. package/plugins/runtime-modules/builder/clients/inspector-choice-cascader.js +98 -0
  85. package/plugins/runtime-modules/builder/clients/inspector-config-field.js +27 -3
  86. package/plugins/runtime-modules/builder/clients/inspector-record-field-options.d.ts +17 -0
  87. package/plugins/runtime-modules/builder/clients/inspector-record-field-options.js +21 -0
  88. package/plugins/runtime-modules/builder/clients/inspector-translate-switch.d.ts +24 -0
  89. package/plugins/runtime-modules/builder/clients/inspector-translate-switch.js +29 -0
  90. package/plugins/runtime-modules/builder/clients/layout-inspector.d.ts +1 -1
  91. package/plugins/runtime-modules/builder/clients/layout-inspector.js +4 -2
  92. package/plugins/runtime-modules/builder/clients/widget-inspector.d.ts +1 -1
  93. package/plugins/runtime-modules/builder/clients/widget-inspector.js +6 -6
  94. package/plugins/runtime-modules/builder/plugin-meta-labels.js +17 -0
  95. package/plugins/runtime-modules/builder/render-root-node-scaffold.js +12 -2
  96. package/plugins/runtime-modules/builder/widgets/structure-region/plugin.js +0 -2
  97. package/plugins/runtime-modules/builder/widgets.js +3 -3
  98. package/plugins/runtime-modules/contracts.js +8 -4
  99. package/plugins/runtime-modules/core/authoring-widgets.js +2 -2
  100. package/plugins/runtime-modules/core/data-providers.d.ts +7 -3
  101. package/plugins/runtime-modules/core/data-providers.js +11 -1
  102. package/plugins/runtime-modules/core/definition.d.ts +8 -4
  103. package/plugins/runtime-modules/core/form-providers.d.ts +1 -1
  104. package/plugins/runtime-modules/core/widgets/breadcrumb/config.js +1 -1
  105. package/plugins/runtime-modules/core/widgets/cascader/authoring.d.ts +1 -1
  106. package/plugins/runtime-modules/core/widgets/cascader/config.js +1 -1
  107. package/plugins/runtime-modules/core/widgets/draft-status/client.d.ts +2 -1
  108. package/plugins/runtime-modules/core/widgets/draft-status/client.js +4 -3
  109. package/plugins/runtime-modules/core/widgets/gallery/authoring.js +6 -8
  110. package/plugins/runtime-modules/core/widgets/gallery/client.js +4 -0
  111. package/plugins/runtime-modules/core/widgets/gallery/config.js +1 -1
  112. package/plugins/runtime-modules/core/widgets/gallery/server.d.ts +5 -1
  113. package/plugins/runtime-modules/core/widgets/gallery/server.js +8 -4
  114. package/plugins/runtime-modules/core/widgets/image/config.js +1 -1
  115. package/plugins/runtime-modules/core/widgets/markdown/config.d.ts +11 -0
  116. package/plugins/runtime-modules/core/widgets/markdown/config.js +24 -22
  117. package/plugins/runtime-modules/core/widgets/record/config.js +1 -1
  118. package/plugins/runtime-modules/core/widgets/simple-text/client.d.ts +9 -5
  119. package/plugins/runtime-modules/core/widgets/simple-text/client.js +5 -7
  120. package/plugins/runtime-modules/core/widgets/simple-text/config.d.ts +63 -4
  121. package/plugins/runtime-modules/core/widgets/simple-text/config.js +45 -11
  122. package/plugins/runtime-modules/core/widgets/simple-text/editor.js +2 -2
  123. package/plugins/runtime-modules/core/widgets/simple-text/plugin.d.ts +13 -0
  124. package/plugins/runtime-modules/core/widgets/simple-text/plugin.js +23 -4
  125. package/plugins/runtime-modules/core/widgets/simple-text/server.d.ts +4 -2
  126. package/plugins/runtime-modules/core/widgets/simple-text/server.js +7 -6
  127. package/plugins/runtime-modules/core/widgets/table/client.js +4 -4
  128. package/plugins/runtime-modules/core/widgets/table/config.js +12 -4
  129. package/plugins/runtime-modules/core/widgets/table/plugin.js +21 -1
  130. package/plugins/runtime-modules/core/widgets/thread-conversation/plugin.js +0 -2
  131. package/plugins/runtime-modules/core/widgets/tree/config.js +2 -1
  132. package/plugins/runtime-modules/core/widgets/tree/plugin.js +16 -1
  133. package/plugins/runtime-modules/core/widgets.js +1 -1
  134. package/plugins/runtime-modules/observability/data-providers.js +1 -1
  135. package/plugins/runtime-modules/theme/authoring-widgets.js +5 -5
  136. package/plugins/runtime-modules/theme/brand-theme-model.d.ts +4 -1
  137. package/plugins/runtime-modules/theme/brand-theme-model.js +6 -2
  138. package/plugins/runtime-modules/theme/widgets/brand-controls/client.js +17 -0
  139. package/plugins/runtime-modules/theme/widgets/brand-controls/plugin.js +0 -5
  140. package/plugins/runtime-modules/theme/widgets.js +4 -4
  141. package/plugins/runtime-modules/threads/labels.js +6 -2
  142. package/plugins/runtime-modules/user-management/addon-roles.d.ts +28 -7
  143. package/plugins/runtime-modules/user-management/addon-roles.js +42 -17
  144. package/plugins/runtime-modules/user-management/client-data-providers.js +6 -0
  145. package/plugins/runtime-modules/user-management/data-providers.js +11 -2
  146. package/plugins/runtime-modules/user-management/forms.js +40 -1
  147. package/plugins/runtime-modules/user-management/ids.d.ts +1 -0
  148. package/plugins/runtime-modules/user-management/ids.js +1 -0
  149. package/plugins/runtime-modules/user-management/services/options.d.ts +14 -3
  150. package/plugins/runtime-modules/user-management/services/options.js +52 -16
  151. package/plugins/runtime-modules/user-management/services/table.js +8 -24
  152. package/plugins/runtime-modules/user-management/services/users-query.d.ts +9 -0
  153. package/plugins/runtime-modules/user-management/services/users-query.js +29 -0
  154. package/plugins/runtime-modules/video/widgets/embed/plugin.js +0 -2
  155. package/plugins/runtime-modules/video/widgets.js +1 -1
  156. package/styles/controls.css +20 -0
  157. package/styles/layout.css +4 -4
  158. package/theme/phi-link-mark.d.ts +26 -0
  159. package/theme/phi-link-mark.js +26 -0
  160. package/theme/phi-theme-tokens.d.ts +3 -2
  161. package/theme/phi-theme-tokens.js +3 -1
  162. package/types/cms-config.d.ts +12 -4
  163. package/types/cms-config.js +3 -0
  164. package/types/cms-plugins.d.ts +26 -4
  165. package/types/core-widget-placements.d.ts +4 -4
  166. package/types/site-config.d.ts +3 -0
  167. package/types/table-widget.d.ts +17 -1
  168. package/types/tree.d.ts +2 -0
  169. package/plugins/runtime-modules/asset/widgets/asset-focal-rect/authoring.d.ts +0 -2
  170. package/plugins/runtime-modules/asset/widgets/asset-focal-rect/authoring.js +0 -6
  171. package/plugins/runtime-modules/asset/widgets/image-inspector/authoring.d.ts +0 -2
  172. package/plugins/runtime-modules/asset/widgets/image-inspector/authoring.js +0 -6
  173. package/plugins/runtime-modules/auth/widgets/auth-methods/authoring.d.ts +0 -7
  174. package/plugins/runtime-modules/auth/widgets/auth-methods/authoring.js +0 -12
  175. package/plugins/runtime-modules/auth/widgets/auth-workflow/authoring.d.ts +0 -7
  176. package/plugins/runtime-modules/auth/widgets/auth-workflow/authoring.js +0 -12
  177. package/plugins/runtime-modules/auth/widgets/logout/authoring.d.ts +0 -3
  178. package/plugins/runtime-modules/auth/widgets/logout/authoring.js +0 -8
  179. package/plugins/runtime-modules/auth/widgets/security/authoring.d.ts +0 -3
  180. package/plugins/runtime-modules/auth/widgets/security/authoring.js +0 -8
  181. package/plugins/runtime-modules/avatar/widgets/account-avatar/authoring.d.ts +0 -2
  182. package/plugins/runtime-modules/avatar/widgets/account-avatar/authoring.js +0 -6
  183. package/plugins/runtime-modules/avatar/widgets/account-avatar-picker/authoring.d.ts +0 -2
  184. package/plugins/runtime-modules/avatar/widgets/account-avatar-picker/authoring.js +0 -6
  185. package/plugins/runtime-modules/builder/widgets/structure-region/internal-builder.d.ts +0 -22
  186. package/plugins/runtime-modules/builder/widgets/structure-region/internal-builder.js +0 -8
  187. package/plugins/runtime-modules/core/widgets/form-preview/authoring.d.ts +0 -10
  188. package/plugins/runtime-modules/core/widgets/form-preview/authoring.js +0 -15
  189. package/plugins/runtime-modules/core/widgets/thread-conversation/authoring.d.ts +0 -3
  190. package/plugins/runtime-modules/core/widgets/thread-conversation/authoring.js +0 -9
  191. package/plugins/runtime-modules/theme/widgets/brand-controls/authoring.d.ts +0 -76
  192. package/plugins/runtime-modules/theme/widgets/brand-controls/authoring.js +0 -30
@@ -71,11 +71,20 @@ async function resolvePhiCmsTreeLinkTargets(...args) {
71
71
  const { resolvePhiCmsTreeLinkTargets: resolve } = await import("../../server-helpers/cms-link-targets");
72
72
  return resolve(...args);
73
73
  }
74
- function resolvePhiRuntimeWidgetRenderer(runtimePlugin, previewPlugin, implementationMode) {
74
+ function resolvePhiRuntimeWidgetRenderer(runtimePlugin, previewPlugin, implementationMode, previewPolicy) {
75
75
  if (implementationMode === "runtime") {
76
76
  return runtimePlugin?.render ?? null;
77
77
  }
78
78
  if (implementationMode === "preview") {
79
+ // Declared, not inferred: only `visualPlaceholder` draws the house placeholder, and a `custom`
80
+ // policy without `renderPreview` stays a missing renderer. Imported where it is drawn, because this
81
+ // renderer is on every route and the placeholder only ever stands in a Preview.
82
+ if (previewPolicy === "visualPlaceholder") {
83
+ return previewPlugin
84
+ ? async ({ widget }) => (await import("../../plugins/factories/widget-renderers"))
85
+ .renderPhiWidgetPreviewPlaceholder(widget, previewPlugin.title)
86
+ : null;
87
+ }
79
88
  return previewPlugin?.renderPreview ?? null;
80
89
  }
81
90
  return null;
@@ -414,7 +423,7 @@ function renderContentWidget(widget, context) {
414
423
  }
415
424
  if (widgetPlugin) {
416
425
  try {
417
- const renderWidget = resolvePhiRuntimeWidgetRenderer(runtimePlugin, previewPlugin, implementationMode);
426
+ const renderWidget = resolvePhiRuntimeWidgetRenderer(runtimePlugin, previewPlugin, implementationMode, policies?.preview ?? null);
418
427
  const moduleId = context.runtimeRegistry.ownerModuleIdByWidgetType.get(widget.widgetType) ?? null;
419
428
  if (!renderWidget) {
420
429
  return renderCmsDiagnostic({
@@ -34,10 +34,18 @@ export function PhiImageControl({ presentation, source, alt, title, width, heigh
34
34
  const drawnHeight = height ?? presentation.height;
35
35
  const blur = source === "asset" ? blurDataUrl ?? null : null;
36
36
  const loaded = loadedUrl === url;
37
+ /*
38
+ * A box of two numbers keeps their proportion rather than their height: where its column is narrower
39
+ * than the width and `maxWidth` takes it in, the height comes down with it. A fixed height would stay
40
+ * and leave the picture a tall strip, with air above and below what stands beside it.
41
+ */
42
+ const proportion = typeof drawnWidth === "number" && typeof drawnHeight === "number" && drawnWidth > 0 && drawnHeight > 0
43
+ ? `${drawnWidth} / ${drawnHeight}`
44
+ : undefined;
37
45
  const boxStyle = {
38
46
  position: presentation.simulatedCropStyle ? "relative" : undefined,
39
47
  width: toCssSize(drawnWidth) ?? "100%",
40
- height: toCssSize(drawnHeight),
48
+ ...(proportion ? { height: "auto", aspectRatio: proportion } : { height: toCssSize(drawnHeight) }),
41
49
  maxWidth: "100%",
42
50
  lineHeight: 0,
43
51
  overflow: presentation.simulatedCropStyle ? "hidden" : undefined,
@@ -4,16 +4,18 @@ import { useMemo } from "react";
4
4
  import { Select } from "antd";
5
5
  import { PhiControlOptionContent } from "./phi-control-option-content";
6
6
  import { PhiLabeledControl, usePhiControlLabel } from "./phi-labeled-control";
7
+ import { groupPhiSelectOptions } from "./phi-select-control";
7
8
  export function PhiMultiSelectControl({ id, value, label, description, placeholder, disabled, readOnly, allowCustom, allowClear, options, maxTagCount, size, variant, popupMatchSelectWidth = false, style, onFocus, onBlur, onChange, }) {
8
9
  const { labelId, labelledBy } = usePhiControlLabel(label);
9
- const selectOptions = useMemo(() => options.map((option) => ({
10
+ // Options that name a group are listed under its heading, as the Select lists them.
11
+ const selectOptions = useMemo(() => groupPhiSelectOptions(options.map((option) => ({
10
12
  value: option.value,
11
13
  // Keep labels non-primitive so rc-select cannot add native HTML titles.
12
14
  label: _jsx(_Fragment, { children: option.label }),
13
15
  searchLabel: option.label,
14
16
  option,
15
17
  disabled: option.disabled,
16
- })), [options]);
18
+ }))), [options]);
17
19
  const control = (_jsx(Select, { id: id, "aria-labelledby": labelledBy, mode: allowCustom ? "tags" : "multiple", allowClear: allowClear, value: [...(value ?? [])], placeholder: placeholder, disabled: disabled || readOnly || !onChange, options: selectOptions, optionFilterProp: ["searchLabel", "value"], optionRender: (option) => {
18
20
  /*
19
21
  * With `allowCustom` the Select offers what is being typed as an option of its own, and that one
@@ -116,6 +116,7 @@ export declare function usePhiControlOptionsProvider<TValue extends string | num
116
116
  disabled?: boolean;
117
117
  description?: string;
118
118
  icon?: string;
119
+ parentValue?: TValue;
119
120
  }[] | null;
120
121
  optionsProvider?: PhiControlOptionsProviderConfig | null;
121
122
  sourceConfig?: Record<string, unknown> | null;
@@ -42,6 +42,7 @@ function normalizeStaticOptions(options) {
42
42
  disabled: option.disabled,
43
43
  description: option.description,
44
44
  icon: option.icon,
45
+ parentValue: option.parentValue,
45
46
  }));
46
47
  }
47
48
  export function readPhiControlOptionsProviderParam(provider, key) {
@@ -37,4 +37,25 @@ export type PhiSelectControlProps<TValue extends string | number = string> = {
37
37
  filterOptionsLocally?: boolean;
38
38
  onChange: (value: TValue) => void;
39
39
  };
40
+ type PhiResolvedSelectOption<TValue extends string | number> = {
41
+ value: TValue;
42
+ label: ReactNode;
43
+ searchLabel: string;
44
+ disabled?: boolean;
45
+ option: PhiControlOption<TValue>;
46
+ };
47
+ type PhiSelectSeparatorEntry = {
48
+ value: string;
49
+ label: ReactNode;
50
+ searchLabel: "";
51
+ disabled: true;
52
+ style: CSSProperties;
53
+ separator: true;
54
+ };
55
+ export declare function groupPhiSelectOptions<TValue extends string | number>(resolved: Array<PhiResolvedSelectOption<TValue> | PhiSelectSeparatorEntry>): (PhiSelectSeparatorEntry | PhiResolvedSelectOption<TValue> | {
56
+ label: ReactNode;
57
+ title: string;
58
+ options: PhiResolvedSelectOption<TValue>[];
59
+ })[];
40
60
  export declare function PhiSelectControl<TValue extends string | number = string>({ id, value, label, description, ariaLabel, placeholder, disabled, readOnly, presentation, allowCustom, allowClear, options, size, variant, popupMatchSelectWidth, getPopupContainer, popupRootClassName, popupZIndex, style, onFocus, onBlur, onOpenChange, onSearch, filterOptionsLocally, onChange, }: PhiSelectControlProps<TValue>): import("react").JSX.Element;
61
+ export {};
@@ -32,9 +32,9 @@ function separatePhiSelectOptions(resolved) {
32
32
  }
33
33
  /*
34
34
  * Consecutive options that name the same group, under one heading. Options without a group stay at the
35
- * top level, and a list that names no group at all comes back unchanged.
35
+ * top level, and a list that names no group at all comes back unchanged. The Multi Select groups with it.
36
36
  */
37
- function groupPhiSelectOptions(resolved) {
37
+ export function groupPhiSelectOptions(resolved) {
38
38
  if (!resolved.some((entry) => !isPhiSelectSeparatorEntry(entry) && entry.option.group)) {
39
39
  return resolved;
40
40
  }
@@ -0,0 +1,15 @@
1
+ import type { ReactNode } from "react";
2
+ /**
3
+ * A state shown as a small coloured dot, its word in the house tooltip.
4
+ *
5
+ * For a state somebody glances at rather than reads -- saved, a draft, published -- where a tag would
6
+ * take a line's worth of room for one word. The word is still there: pointed at, the tooltip says it,
7
+ * and assistive technology reads it as the dot's label. `children` widens what the pointer may rest on,
8
+ * so a row (a path and its state) can carry one tooltip for both.
9
+ */
10
+ export declare function PhiStatusDotControl({ color, label, children, }: {
11
+ /** A Theme token colour, or nothing for a neutral state. */
12
+ color?: string;
13
+ label: string;
14
+ children?: ReactNode;
15
+ }): import("react").JSX.Element;
@@ -0,0 +1,25 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { PhiHoverText } from "./phi-hover-text";
4
+ /** How large the dot is drawn: small enough to stand beside a line of text without taking its place. */
5
+ const PHI_STATUS_DOT_SIZE = 8;
6
+ /**
7
+ * A state shown as a small coloured dot, its word in the house tooltip.
8
+ *
9
+ * For a state somebody glances at rather than reads -- saved, a draft, published -- where a tag would
10
+ * take a line's worth of room for one word. The word is still there: pointed at, the tooltip says it,
11
+ * and assistive technology reads it as the dot's label. `children` widens what the pointer may rest on,
12
+ * so a row (a path and its state) can carry one tooltip for both.
13
+ */
14
+ export function PhiStatusDotControl({ color, label, children, }) {
15
+ const dot = (_jsx("span", { role: "img", "aria-label": label, style: {
16
+ display: "inline-block",
17
+ flex: "0 0 auto",
18
+ width: PHI_STATUS_DOT_SIZE,
19
+ height: PHI_STATUS_DOT_SIZE,
20
+ borderRadius: "50%",
21
+ background: color ?? "currentColor",
22
+ opacity: color ? 1 : 0.45,
23
+ } }));
24
+ return (_jsx(PhiHoverText, { title: label, children: _jsxs("span", { style: { display: "inline-flex", alignItems: "center", gap: 8, minWidth: 0 }, children: [children, dot] }) }));
25
+ }
@@ -9,6 +9,7 @@ import { flushSync } from "react-dom";
9
9
  import { Children, cloneElement, createContext, isValidElement, useCallback, useContext, useEffect, useMemo, useRef, useState, } from "react";
10
10
  import { PHI_GREGORY_CALENDAR_ADAPTER_KEY } from "../../types/calendar-keys";
11
11
  import { PHI_VISUAL_ANCHOR_PART_ATTRIBUTE } from "../../types/visual-anchors";
12
+ import { PhiTruncatedHoverText } from "./phi-truncated-hover-text";
12
13
  import { PhiColorControl } from "./phi-color-control";
13
14
  import { PhiCheckboxControl } from "./phi-checkbox-control";
14
15
  import { PhiCheckboxGroupControl } from "./phi-checkbox-group-control";
@@ -370,6 +371,12 @@ function buildRowMove(rows, rowIdentityPath, parentRowIdentityPath, movedRowIden
370
371
  afterRowIdentity: placement === "after" ? targetRowIdentity : null,
371
372
  };
372
373
  }
374
+ /* The box that cuts a column's name short is the one the hover text measures. */
375
+ const PHI_TABLE_COLUMN_TITLE_STYLE = { display: "block", minWidth: 0, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" };
376
+ /** A column's name, cut with an ellipsis where the column is narrower, and then said whole in the house tooltip. */
377
+ function renderPhiTableColumnTitle(title) {
378
+ return (_jsx(PhiTruncatedHoverText, { title: title, children: _jsx("span", { style: PHI_TABLE_COLUMN_TITLE_STYLE, children: title }) }));
379
+ }
373
380
  export function PhiTableControl({ rows, rowIdentityPath, columns, columnOrder, sortingMode, sorts, onSortsChange, columnReordering = false, onColumnOrderChange, rowSelection, pagination = false, tree, rowReordering, editing, loading = false, bordered, striped = false, stickyHeader = false, showHeader, footer, summary, size, emptyText, layout, rowStyle, onRowActivate, onExternalRowDragOver, onExternalRowDrop, onExternalDragOver, onExternalDrop, }) {
374
381
  const { token } = usePhiConfig();
375
382
  const [editingRowIdentityState, setEditingRowIdentity] = useState(null);
@@ -582,7 +589,7 @@ export function PhiTableControl({ rows, rowIdentityPath, columns, columnOrder, s
582
589
  const reorderIndex = columnOrder.indexOf(column.key);
583
590
  const canReorder = columnReordering && column.fixed === undefined && reorderIndex >= 0;
584
591
  const columnStyle = buildColumnStyle(column.sizing);
585
- const title = canReorder ? (_jsxs(Flex, { align: "center", gap: 4, children: [_jsx("span", { children: column.title }), _jsx("span", { onClick: (event) => event.stopPropagation(), children: _jsx(PhiButtonControl, { type: "text", size: "small", icon: _jsx(PhiIcon, { name: "left", size: "inherit" }), disabled: reorderIndex === 0, ariaLabel: "Move column left", tooltip: "Move column left", onClick: () => onColumnOrderChange?.(moveColumn(columnOrder, column.key, -1)) }) }), _jsx("span", { onClick: (event) => event.stopPropagation(), children: _jsx(PhiButtonControl, { type: "text", size: "small", icon: _jsx(PhiIcon, { name: "right", size: "inherit" }), disabled: reorderIndex === columnOrder.length - 1, ariaLabel: "Move column right", tooltip: "Move column right", onClick: () => onColumnOrderChange?.(moveColumn(columnOrder, column.key, 1)) }) })] })) : column.title;
592
+ const title = canReorder ? (_jsxs(Flex, { align: "center", gap: 4, style: { minWidth: 0 }, children: [renderPhiTableColumnTitle(column.title), _jsx("span", { onClick: (event) => event.stopPropagation(), children: _jsx(PhiButtonControl, { type: "text", size: "small", icon: _jsx(PhiIcon, { name: "left", size: "inherit" }), disabled: reorderIndex === 0, ariaLabel: "Move column left", tooltip: "Move column left", onClick: () => onColumnOrderChange?.(moveColumn(columnOrder, column.key, -1)) }) }), _jsx("span", { onClick: (event) => event.stopPropagation(), children: _jsx(PhiButtonControl, { type: "text", size: "small", icon: _jsx(PhiIcon, { name: "right", size: "inherit" }), disabled: reorderIndex === columnOrder.length - 1, ariaLabel: "Move column right", tooltip: "Move column right", onClick: () => onColumnOrderChange?.(moveColumn(columnOrder, column.key, 1)) }) })] })) : renderPhiTableColumnTitle(column.title);
586
593
  return {
587
594
  key: column.key,
588
595
  columnKey: sortField,
@@ -9,6 +9,7 @@ import { PhiTextControl } from "./phi-text-control";
9
9
  import { PhiConfirmControl } from "./phi-confirm-control";
10
10
  import { PhiExpandIndicator } from "./phi-expand-indicator";
11
11
  import { PhiLink } from "../navigation/phi-link";
12
+ import { resolvePhiTableRowActionLink } from "../../helpers/table-action-row-link";
12
13
  import { PhiSkeletonControl } from "./phi-skeleton-control";
13
14
  function readPath(value, path) {
14
15
  if (!path)
@@ -102,16 +103,16 @@ function PhiTreeNodeTitle({ node, presentation, editing, actions, controlSize, o
102
103
  beforeNodeIdentity: dropMode === "before" ? node.identity : null,
103
104
  afterNodeIdentity: dropMode === "after" ? node.identity : null,
104
105
  });
105
- }, children: [iconEditable ? (_jsx(PhiIconPickerControl, { value: typeof icon === "string" ? icon : null, buttonSize: controlSize, buttonType: "text", onChange: (value) => void onCommitField?.(node.identity, iconFieldKey, value) })) : presentation.showIcon !== false && typeof icon === "string" ? _jsx(PhiIcon, { name: icon }) : null, _jsxs("div", { style: { display: "grid", flex: 1, minWidth: 0 }, children: [titleEditable ? (_jsx(PhiTextControl, { value: draftTitle, size: controlSize, variant: presentation.node.titleEditor?.variant ?? "underlined", onChange: (value) => setDraftTitle(value ?? ""), onPressEnter: commitTitle, onBlur: commitTitle })) : _jsx("span", { children: title }), description != null && description !== "" ? (_jsx(Typography.Text, { type: "secondary", ellipsis: true, style: { fontSize: "inherit" }, children: String(description) })) : null] }), actions.length ? (_jsx(Flex, { align: "center", gap: 2, onClick: (event) => event.stopPropagation(), children: actions.map((action) => (_jsx(PhiTreeActionButton, { action: action.execution === "link" && action.hrefPath
106
- ? { ...action, href: String(readPath(node.record, action.hrefPath) ?? "") }
106
+ }, children: [iconEditable ? (_jsx(PhiIconPickerControl, { value: typeof icon === "string" ? icon : null, buttonSize: controlSize, buttonType: "text", onChange: (value) => void onCommitField?.(node.identity, iconFieldKey, value) })) : presentation.showIcon !== false && typeof icon === "string" ? _jsx(PhiIcon, { name: icon }) : null, _jsxs("div", { style: { display: "grid", flex: 1, minWidth: 0 }, children: [titleEditable ? (_jsx(PhiTextControl, { value: draftTitle, size: controlSize, variant: presentation.node.titleEditor?.variant ?? "underlined", onChange: (value) => setDraftTitle(value ?? ""), onPressEnter: commitTitle, onBlur: commitTitle })) : _jsx("span", { children: title }), description != null && description !== "" ? (_jsx(Typography.Text, { type: "secondary", ellipsis: true, style: { fontSize: "inherit" }, children: String(description) })) : null] }), actions.length ? (_jsx(Flex, { align: "center", gap: 2, onClick: (event) => event.stopPropagation(), children: actions.map((action) => (_jsx(PhiTreeActionButton, { action: action.execution === "link"
107
+ ? resolvePhiTableRowActionLink(action, action.hrefPath ? readPath(node.record, action.hrefPath) : undefined)
107
108
  : action, size: controlSize, onActivate: () => onAction?.(action, node.identity) }, action.key))) })) : null] }));
108
109
  }
109
110
  export function PhiTreeActionButton({ action, size = "small", disabled = false, onActivate, }) {
110
111
  const display = action.display ?? "label";
111
112
  const button = (_jsx(Button, { size: size, type: action.mode === "primary" ? "primary" : "default", danger: action.mode === "danger", disabled: disabled, icon: display !== "label" && action.icon ? _jsx(PhiIcon, { name: action.icon }) : undefined, "aria-label": action.label, onClick: () => { if (!action.confirm)
112
113
  onActivate(); }, children: display !== "icon" ? action.label : null }));
113
- const actionable = action.execution === "link" && action.href
114
- ? _jsx(PhiLink, { href: action.href, external: action.newTab, newTab: action.newTab, children: button })
114
+ const actionable = action.execution === "link" && action.link
115
+ ? _jsx(PhiLink, { href: action.link.href, external: action.link.external, newTab: action.link.newTab, children: button })
115
116
  : button;
116
117
  return action.confirm && action.execution !== "link" ? (_jsx(PhiConfirmControl, { title: action.confirm.title, description: action.confirm.description, confirmLabel: action.confirm.okText, cancelLabel: action.confirm.cancelText, danger: action.mode === "danger", disabled: disabled, onConfirm: onActivate, children: actionable })) : actionable;
117
118
  }
@@ -11,6 +11,7 @@ function buildPhiTreeSelectNodes(options) {
11
11
  value: option.value,
12
12
  label: option.label,
13
13
  ...(option.description ? { description: option.description } : {}),
14
+ ...(option.icon ? { icon: option.icon } : {}),
14
15
  }, presentation: "tree" })),
15
16
  label: _jsx(PhiControlOptionContent, { option: { value: option.value, label: option.label }, presentation: "selection" }),
16
17
  searchLabel: `${option.label} ${option.description ?? ""}`.trim(),
@@ -122,6 +122,10 @@ export declare function getPhiAuthAdminSettingsLabels(options: PhiGlobalTranslat
122
122
  clientIdRequired: string;
123
123
  tenant: string;
124
124
  tenantPlaceholder: string;
125
+ teamId: string;
126
+ teamIdHint: string;
127
+ keyId: string;
128
+ keyIdHint: string;
125
129
  clientSecret: string;
126
130
  secretStatusConfigured: string;
127
131
  secretStatusMissing: string;
@@ -48,16 +48,20 @@ const PHI_AUTH_ADMIN_SETTINGS_LABEL_SET = definePhiLabelSet({
48
48
  provider_client_secret_label: "Client secret",
49
49
  provider_secret_status_configured: "configured",
50
50
  provider_secret_status_missing: "missing",
51
- provider_secret_hint: definePhiMessageLabel("Leave empty to keep the currently stored secret."),
51
+ provider_secret_hint: definePhiMessageLabel("Leave empty to keep the currently stored secret. For Apple, the contents of the .p8 key file."),
52
+ provider_team_id_label: "Team ID",
53
+ provider_team_id_hint: definePhiMessageLabel("The ten characters shown at the top right of the Apple Developer account."),
54
+ provider_key_id_label: "Key ID",
55
+ provider_key_id_hint: definePhiMessageLabel("The ten characters of the Sign in with Apple key under Keys."),
52
56
  provider_enabled_label: "Installation enabled",
53
57
  provider_login_enabled_label: "Offer on login",
54
58
  provider_sort_order_label: "Order",
55
59
  provider_scopes_label: "Scopes",
56
- provider_scopes_hint: definePhiMessageLabel("Space separated. Empty asks the provider for the login defaults: read:user user:email at GitHub, openid email profile elsewhere."),
60
+ provider_scopes_hint: definePhiMessageLabel("Space separated. Empty asks the provider for the login defaults: read:user user:email at GitHub, openid email at Apple, openid email profile elsewhere."),
57
61
  provider_restrictions_label: "Restrict sign-in to",
58
62
  provider_restrictions_hint: definePhiMessageLabel("Space separated, and empty admits everyone the provider admits. GitHub organizations for GitHub, hosted domains for Google; an organization needs read:org in the scopes as well."),
59
63
  provider_prompt_label: "Prompt",
60
- provider_prompt_hint: definePhiMessageLabel("OpenID providers only: login, consent, or select_account. GitHub has no such setting."),
64
+ provider_prompt_hint: definePhiMessageLabel("Google and Microsoft only: login, consent, or select_account."),
61
65
  provider_trusted_email_link_label: "Trust for email linking",
62
66
  provider_trusted_email_link_hint: definePhiMessageLabel("Lets a verified address from this provider join an existing account without a further proof, where the site policy allows it. Only for a provider that verifies addresses itself."),
63
67
  provider_save_label: "Save",
@@ -197,6 +201,10 @@ export async function getPhiAuthAdminSettingsLabels(options) {
197
201
  clientIdRequired: labels.provider_client_id_required,
198
202
  tenant: labels.provider_tenant_label,
199
203
  tenantPlaceholder: labels.provider_tenant_placeholder,
204
+ teamId: labels.provider_team_id_label,
205
+ teamIdHint: labels.provider_team_id_hint,
206
+ keyId: labels.provider_key_id_label,
207
+ keyIdHint: labels.provider_key_id_hint,
200
208
  clientSecret: labels.provider_client_secret_label,
201
209
  secretStatusConfigured: labels.provider_secret_status_configured,
202
210
  secretStatusMissing: labels.provider_secret_status_missing,
@@ -299,7 +299,7 @@ export declare const PHI_SHARED_FORM_FIELD_TYPE_PROVIDER_DESCRIPTORS: readonly [
299
299
  }, {
300
300
  readonly key: "separator";
301
301
  readonly type: "string";
302
- readonly label: "Separator";
302
+ readonly label: "Separator character";
303
303
  }, {
304
304
  readonly key: "rootValue";
305
305
  readonly type: "string";
@@ -166,7 +166,7 @@ export const PHI_SHARED_FORM_FIELD_TYPE_PROVIDER_DESCRIPTORS = [
166
166
  presentation: "control",
167
167
  settingsFields: [
168
168
  { key: "allowRoot", type: "boolean", label: "Allow Root" },
169
- { key: "separator", type: "string", label: "Separator" },
169
+ { key: "separator", type: "string", label: "Separator character" },
170
170
  { key: "rootValue", type: "string", label: "Root Value" },
171
171
  {
172
172
  key: "normalize",
@@ -1,6 +1,7 @@
1
1
  import type { CSSProperties, HTMLAttributes, ReactNode } from "react";
2
2
  import type { PhiCmsInstanceId } from "../../../types/cms-instance-id";
3
3
  import { type PhiSurface } from "../../../types/surface";
4
+ import type { PhiCmsSplitCardRatio } from "../../../constants/cms-layout-proportions";
4
5
  export type PhiSplitCardHalfProps = Omit<HTMLAttributes<HTMLDivElement>, "style" | "children"> & {
5
6
  [attribute: `data-${string}`]: string | undefined;
6
7
  blockId: PhiCmsInstanceId | string | number | null | undefined;
@@ -11,6 +12,8 @@ export type PhiSplitCardHalfProps = Omit<HTMLAttributes<HTMLDivElement>, "style"
11
12
  gap: string;
12
13
  /** Whether the left card is the larger one; the right card's part of the Background follows it. */
13
14
  swapped?: boolean;
15
+ /** The ratio the cards stand in; the right card's part of the Background follows it. */
16
+ ratio?: PhiCmsSplitCardRatio;
14
17
  style?: CSSProperties;
15
18
  children?: ReactNode;
16
19
  };
@@ -25,4 +28,4 @@ export type PhiSplitCardHalfProps = Omit<HTMLAttributes<HTMLDivElement>, "style"
25
28
  * for the Split Card (`usePhiLayoutSignalSurface`). A moving Background does not move here: each card
26
29
  * would move its own copy, and two copies of one picture moving are not one picture.
27
30
  */
28
- export declare function PhiSplitCardHalf({ blockId, surface, side, gap, swapped, style, className, children, ...attributes }: PhiSplitCardHalfProps): import("react").JSX.Element;
31
+ export declare function PhiSplitCardHalf({ blockId, surface, side, gap, swapped, ratio, style, className, children, ...attributes }: PhiSplitCardHalfProps): import("react").JSX.Element;
@@ -19,7 +19,7 @@ import { joinPhiClassNames } from "../../../helpers/class-names";
19
19
  * for the Split Card (`usePhiLayoutSignalSurface`). A moving Background does not move here: each card
20
20
  * would move its own copy, and two copies of one picture moving are not one picture.
21
21
  */
22
- export function PhiSplitCardHalf({ blockId, surface, side, gap, swapped, style, className, children, ...attributes }) {
22
+ export function PhiSplitCardHalf({ blockId, surface, side, gap, swapped, ratio, style, className, children, ...attributes }) {
23
23
  const signalled = usePhiLayoutSignalSurface(blockId, surface);
24
24
  const still = signalled?.background?.motion
25
25
  ? { ...signalled, background: { ...signalled.background, motion: null } }
@@ -30,5 +30,5 @@ export function PhiSplitCardHalf({ blockId, surface, side, gap, swapped, style,
30
30
  forceGroundLayer: true,
31
31
  });
32
32
  const toneClassName = resolvePhiSurfaceToneClassName(still?.tone);
33
- return (_jsxs("div", { ...attributes, className: joinPhiClassNames(className, toneClassName), style: { ...card.style, ...style }, children: [_jsx(PhiSurfaceGroundLayer, { ground: card.ground, frame: resolvePhiSplitCardGroundFrame(side, gap, swapped) }), toneClassName ? _jsx(PhiSurfaceTone, { tone: still?.tone, children: children }) : children] }));
33
+ return (_jsxs("div", { ...attributes, className: joinPhiClassNames(className, toneClassName), style: { ...card.style, ...style }, children: [_jsx(PhiSurfaceGroundLayer, { ground: card.ground, frame: resolvePhiSplitCardGroundFrame(side, gap, swapped, ratio) }), toneClassName ? _jsx(PhiSurfaceTone, { tone: still?.tone, children: children }) : children] }));
34
34
  }
@@ -1,8 +1,9 @@
1
1
  import type { CSSProperties, ReactNode } from "react";
2
2
  import { type PhiBaseLayoutProps } from "../phi-layout-view-model";
3
3
  import type { PhiAnchorWidgetPlacement } from "../../controls/phi-anchor-control-contract";
4
+ import { type PhiCmsSplitCardRatio } from "../../../constants/cms-layout-proportions";
4
5
  /**
5
- * Two cards on the golden ratio.
6
+ * Two cards side by side, on the golden ratio unless `ratio` says otherwise.
6
7
  *
7
8
  * The Layout's Surface is worn by both: each card draws its edge, corner,
8
9
  * depth, pane and mode (`PhiSplitCardHalf`), and the Background runs once across the two and shows only
@@ -13,8 +14,10 @@ import type { PhiAnchorWidgetPlacement } from "../../controls/phi-anchor-control
13
14
  export type PhiSplitCardLayoutProps = Omit<PhiBaseLayoutProps, "slots"> & {
14
15
  slots: ReactNode[];
15
16
  gap?: CSSProperties["gap"];
16
- /** The larger card on the left instead of the right. */
17
+ /** The larger card on the left instead of the right; nothing to swap at `50-50`. */
17
18
  swapRatio?: boolean;
19
+ /** The ratio the cards stand in: φ (`golden`, the default), `50-50` or `20-80`. */
20
+ ratio?: PhiCmsSplitCardRatio;
18
21
  editSlotAnchor?: PhiAnchorWidgetPlacement | null;
19
22
  };
20
- export declare function PhiSplitCardLayout({ blockId, slots, gap, swapRatio, editSlotAction, editRenderInsertControl, editSlotAnchor, renderMode, layoutKind, labelEnd, padding, paddingTop, paddingRight, paddingBottom, paddingLeft, surface, style, }: PhiSplitCardLayoutProps): import("react").JSX.Element;
23
+ export declare function PhiSplitCardLayout({ blockId, slots, gap, swapRatio, ratio, editSlotAction, editRenderInsertControl, editSlotAnchor, renderMode, layoutKind, labelEnd, padding, paddingTop, paddingRight, paddingBottom, paddingLeft, surface, style, }: PhiSplitCardLayoutProps): import("react").JSX.Element;
@@ -7,11 +7,12 @@ import { isPhiLayoutAuthoringRender, phiLayoutDebugLayerMarker, phiLayoutSlotCla
7
7
  import { PhiLayoutSurfaceBox } from "../phi-layout-surface-box";
8
8
  import { PhiSplitCardHalf } from "./phi-split-card-half";
9
9
  import { resolvePhiSplitCardColumns } from "../split-card-geometry";
10
+ import { PHI_CMS_SPLIT_CARD_DEFAULT_RATIO, } from "../../../constants/cms-layout-proportions";
10
11
  const PHI_SPLIT_CARD_LAYOUT_DEFAULTS = resolvePhiLayoutDefaults("split");
11
12
  function renderSplitCardSlot(isAuthoringRender, key, child, slotRole, slotIndex, editSlotAnchor, editSlotAction, editRenderInsertControl, label, card) {
12
13
  const hasContent = child !== null && child !== undefined && child !== false;
13
14
  const showInsertButton = typeof editSlotAction === "function" && editRenderInsertControl != null;
14
- return (_jsxs(PhiSplitCardHalf, { blockId: card.blockId, surface: card.surface, side: slotRole, gap: card.gap, swapped: card.swapped, "data-layout-kind": "split", className: phiLayoutSlotClassName(isAuthoringRender), "data-phi-layout-has-content": phiLayoutSlotContentMarker(isAuthoringRender, hasContent), style: {
15
+ return (_jsxs(PhiSplitCardHalf, { blockId: card.blockId, surface: card.surface, side: slotRole, gap: card.gap, swapped: card.swapped, ratio: card.ratio, "data-layout-kind": "split", className: phiLayoutSlotClassName(isAuthoringRender), "data-phi-layout-has-content": phiLayoutSlotContentMarker(isAuthoringRender, hasContent), style: {
15
16
  position: "relative",
16
17
  /*
17
18
  * No `height: 100%` and no `minHeight: 0`: the grid stretches both cards to the row already, and
@@ -39,7 +40,7 @@ function renderSplitCardSlot(isAuthoringRender, key, child, slotRole, slotIndex,
39
40
  })
40
41
  : null] }, key));
41
42
  }
42
- export function PhiSplitCardLayout({ blockId, slots, gap, swapRatio = false, editSlotAction, editRenderInsertControl, editSlotAnchor = "center", renderMode = "live", layoutKind = "split", labelEnd, padding, paddingTop, paddingRight, paddingBottom, paddingLeft, surface, style, }) {
43
+ export function PhiSplitCardLayout({ blockId, slots, gap, swapRatio = false, ratio = PHI_CMS_SPLIT_CARD_DEFAULT_RATIO, editSlotAction, editRenderInsertControl, editSlotAnchor = "center", renderMode = "live", layoutKind = "split", labelEnd, padding, paddingTop, paddingRight, paddingBottom, paddingLeft, surface, style, }) {
43
44
  const isAuthoringRender = isPhiLayoutAuthoringRender({ editSlotAction, renderMode });
44
45
  const resolvedRenderMode = renderMode ?? "live";
45
46
  const resolvedGap = normalizePhiCssSize(gap) ?? PHI_SPLIT_CARD_LAYOUT_DEFAULTS.gap;
@@ -59,6 +60,7 @@ export function PhiSplitCardLayout({ blockId, slots, gap, swapRatio = false, edi
59
60
  surface,
60
61
  gap: gapLength,
61
62
  swapped: swapRatio,
63
+ ratio,
62
64
  inset: resolvePhiPaddingStyle({ padding, paddingTop, paddingRight, paddingBottom, paddingLeft }),
63
65
  };
64
66
  /*
@@ -78,7 +80,7 @@ export function PhiSplitCardLayout({ blockId, slots, gap, swapRatio = false, edi
78
80
  ...style,
79
81
  };
80
82
  const gridStyle = {
81
- "--phi-split-card-columns": resolvePhiSplitCardColumns(swapRatio),
83
+ "--phi-split-card-columns": resolvePhiSplitCardColumns(swapRatio, ratio),
82
84
  gap: resolvedGap,
83
85
  };
84
86
  return (_jsx(PhiLayoutSurfaceBox, { blockId: blockId, surface: undefined, ground: null, "data-layout-kind": layoutKind, "data-phi-block-render-mode": resolvedRenderMode, "data-phi-layout-debug-layer": phiLayoutDebugLayerMarker(isAuthoringRender), "data-phi-layout-has-explicit-layout-background": hasExplicitLayoutBackground ? "true" : "false", className: "phi-layout", style: resolvedStyle, children: _jsxs("div", { className: "phi-split-card__grid", style: gridStyle, children: [renderSplitCardSlot(isAuthoringRender, "slot-1", slots[0] ?? null, "left", 0, editSlotAnchor, editSlotAction, editRenderInsertControl, "Slot 1", card), renderSplitCardSlot(isAuthoringRender, "slot-2", slots[1] ?? null, "right", 1, editSlotAnchor, editSlotAction, editRenderInsertControl, "Slot 2", card)] }) }));
@@ -1,10 +1,13 @@
1
1
  import type { CSSProperties, ReactNode } from "react";
2
2
  import { type PhiBaseLayoutProps } from "../phi-layout-view-model";
3
+ import { type PhiCmsThreeColumnSideShare } from "../../../constants/cms-layout-proportions";
3
4
  import type { PhiAnchorWidgetPlacement } from "../../controls/phi-anchor-control-contract";
4
5
  import type { PhiRenderableBlockResponsiveSize, PhiRenderableBlockSize } from "../../../types";
5
6
  export type PhiThreeColumnLayoutProps = Pick<PhiBaseLayoutProps, "blockId" | "gap" | "surface" | "renderMode" | "zIndex" | "layoutKind" | "labelEnd" | "padding" | "paddingTop" | "paddingRight" | "paddingBottom" | "paddingLeft" | "editSlotAction" | "editRenderInsertControl" | "style"> & {
6
7
  slots: ReactNode[];
7
8
  balancedSides?: boolean;
9
+ /** What each balanced side takes of the row, in percent; the middle takes the rest. Default 25. */
10
+ sideShare?: PhiCmsThreeColumnSideShare;
8
11
  wrap?: boolean | CSSProperties["flexWrap"];
9
12
  align?: CSSProperties["alignItems"];
10
13
  justify?: CSSProperties["justifyContent"];
@@ -17,4 +20,20 @@ export type PhiThreeColumnLayoutProps = Pick<PhiBaseLayoutProps, "blockId" | "ga
17
20
  collapsedSizeHint?: PhiRenderableBlockSize | null;
18
21
  editSlotAnchor?: PhiAnchorWidgetPlacement | null;
19
22
  };
20
- export declare function PhiThreeColumnLayout({ blockId, slots, balancedSides, gap, wrap, align, justify, leftWidth, middleWidth, rightWidth, editSlotAnchor, editSlotAction, editRenderInsertControl, renderMode, ...layoutProps }: PhiThreeColumnLayoutProps): import("react").JSX.Element;
23
+ /**
24
+ * The `flex` of each column.
25
+ *
26
+ * A balanced side grows by its share and the middle by what two sides leave of a hundred, so 25 is
27
+ * 25 : 50 : 25 -- the 1 : 2 : 1 the Layout always had -- and 33 is 33 : 34 : 33. Growth, not a percent
28
+ * width: the gaps come out of the row first and the rest is shared, where three percent widths and two
29
+ * gaps would be wider than the row.
30
+ *
31
+ * On a phone (`styles/layout.css`) the variables give way to sides as wide as their content and a middle
32
+ * taking the rest, whatever the share. A fixed width wins over both, on every screen.
33
+ */
34
+ export declare function resolvePhiThreeColumnFlex({ balancedSides, sideShare, leftWidth, middleWidth, rightWidth, }: Pick<PhiThreeColumnLayoutProps, "balancedSides" | "sideShare" | "leftWidth" | "middleWidth" | "rightWidth">): {
35
+ left: string;
36
+ middle: string;
37
+ right: string;
38
+ };
39
+ export declare function PhiThreeColumnLayout({ blockId, slots, balancedSides, sideShare, gap, wrap, align, justify, leftWidth, middleWidth, rightWidth, editSlotAnchor, editSlotAction, editRenderInsertControl, renderMode, ...layoutProps }: PhiThreeColumnLayoutProps): import("react").JSX.Element;
@@ -3,6 +3,7 @@ import { normalizePhiCssSize, resolvePhiLayoutBox, phiFlexPlacementWord, resolve
3
3
  import { resolvePhiBaseLayoutChrome } from "../phi-layout-view-model";
4
4
  import { resolvePhiLayoutDefaults } from "../../../helpers/cms-layout-defaults";
5
5
  import { PHI_CMS_THREE_COLUMN_LAYOUT_SLOTS } from "../../../constants/cms-layout-types";
6
+ import { PHI_CMS_THREE_COLUMN_DEFAULT_SIDE_SHARE, } from "../../../constants/cms-layout-proportions";
6
7
  import { isPhiLayoutAuthoringRender, phiLayoutDebugLayerMarker, phiLayoutSlotClassName, phiLayoutSlotContentMarker, } from "../../../helpers/layout-authoring-markers";
7
8
  import { PhiLayoutSurfaceBox } from "../phi-layout-surface-box";
8
9
  import { resolvePhiLayoutSlotChildSizing } from "./phi-layout-anchored-overlay";
@@ -77,12 +78,20 @@ function renderColumn(isAuthoringRender, key, child, width, flex, anchor, slotRo
77
78
  width: "100%",
78
79
  } })) : null] }, key));
79
80
  }
80
- /** How much faster the middle slot grows than each balanced side. */
81
- const PHI_THREE_COLUMN_MIDDLE_GROW = 2;
82
- export function PhiThreeColumnLayout({ blockId, slots, balancedSides = true, gap = PHI_THREE_COLUMN_LAYOUT_DEFAULTS.gap, wrap = PHI_THREE_COLUMN_LAYOUT_DEFAULTS.wrap, align, justify, leftWidth, middleWidth, rightWidth, editSlotAnchor = "center", editSlotAction, editRenderInsertControl, renderMode = "live", ...layoutProps }) {
83
- const isAuthoringRender = isPhiLayoutAuthoringRender({ editSlotAction, renderMode });
84
- const { style, layoutKind = "threecol", padding, paddingTop, paddingRight, paddingBottom, paddingLeft, surface, labelEnd, size, minSize, maxSize, collapsedSizeHint, } = layoutProps;
85
- const resolvedRenderMode = renderMode ?? "live";
81
+ /** How much faster the middle slot grows than a side that does not grow at all: it takes the rest. */
82
+ const PHI_THREE_COLUMN_UNBALANCED_MIDDLE_GROW = 2;
83
+ /**
84
+ * The `flex` of each column.
85
+ *
86
+ * A balanced side grows by its share and the middle by what two sides leave of a hundred, so 25 is
87
+ * 25 : 50 : 25 -- the 1 : 2 : 1 the Layout always had -- and 33 is 33 : 34 : 33. Growth, not a percent
88
+ * width: the gaps come out of the row first and the rest is shared, where three percent widths and two
89
+ * gaps would be wider than the row.
90
+ *
91
+ * On a phone (`styles/layout.css`) the variables give way to sides as wide as their content and a middle
92
+ * taking the rest, whatever the share. A fixed width wins over both, on every screen.
93
+ */
94
+ export function resolvePhiThreeColumnFlex({ balancedSides = true, sideShare = PHI_CMS_THREE_COLUMN_DEFAULT_SIDE_SHARE, leftWidth, middleWidth, rightWidth, }) {
86
95
  const resolvedLeftWidth = normalizePhiCssSize(leftWidth);
87
96
  const resolvedMiddleWidth = normalizePhiCssSize(middleWidth);
88
97
  const resolvedRightWidth = normalizePhiCssSize(rightWidth);
@@ -91,17 +100,24 @@ export function PhiThreeColumnLayout({ blockId, slots, balancedSides = true, gap
91
100
  * side as wide as its content and nothing when empty, and the middle takes the rest. A centred middle
92
101
  * was worth two equal sides of a 390px row; a link of 83px in a side of 81 was not.
93
102
  */
94
- const balancedSideFlex = "var(--phi-three-column-side-flex, 1 1 0)";
95
- const leftFlex = resolvedLeftWidth ? `0 0 ${resolvedLeftWidth}` : balancedSides ? balancedSideFlex : "0 1 auto";
103
+ const sideFlex = balancedSides ? `var(--phi-three-column-side-flex, ${sideShare} 1 0)` : "0 1 auto";
96
104
  /*
97
- * The middle is the main thing and takes the larger share: with balanced sides it grows twice as fast as
98
- * each side, so the sides stay equal to each other and the middle stays centred; without, it takes what
99
- * the sides' content leaves.
105
+ * The middle is the main thing: with balanced sides it grows by the rest of the hundred, so the sides
106
+ * stay equal to each other and the middle stays centred; without, it takes what the sides' content
107
+ * leaves.
100
108
  */
101
- const middleFlex = resolvedMiddleWidth
102
- ? `0 0 ${resolvedMiddleWidth}`
103
- : `var(--phi-three-column-middle-flex, ${PHI_THREE_COLUMN_MIDDLE_GROW} 1 0)`;
104
- const rightFlex = resolvedRightWidth ? `0 0 ${resolvedRightWidth}` : balancedSides ? balancedSideFlex : "0 1 auto";
109
+ const middleGrow = balancedSides ? 100 - 2 * sideShare : PHI_THREE_COLUMN_UNBALANCED_MIDDLE_GROW;
110
+ return {
111
+ left: resolvedLeftWidth ? `0 0 ${resolvedLeftWidth}` : sideFlex,
112
+ middle: resolvedMiddleWidth ? `0 0 ${resolvedMiddleWidth}` : `var(--phi-three-column-middle-flex, ${middleGrow} 1 0)`,
113
+ right: resolvedRightWidth ? `0 0 ${resolvedRightWidth}` : sideFlex,
114
+ };
115
+ }
116
+ export function PhiThreeColumnLayout({ blockId, slots, balancedSides = true, sideShare = PHI_CMS_THREE_COLUMN_DEFAULT_SIDE_SHARE, gap = PHI_THREE_COLUMN_LAYOUT_DEFAULTS.gap, wrap = PHI_THREE_COLUMN_LAYOUT_DEFAULTS.wrap, align, justify, leftWidth, middleWidth, rightWidth, editSlotAnchor = "center", editSlotAction, editRenderInsertControl, renderMode = "live", ...layoutProps }) {
117
+ const isAuthoringRender = isPhiLayoutAuthoringRender({ editSlotAction, renderMode });
118
+ const { style, layoutKind = "threecol", padding, paddingTop, paddingRight, paddingBottom, paddingLeft, surface, labelEnd, size, minSize, maxSize, collapsedSizeHint, } = layoutProps;
119
+ const resolvedRenderMode = renderMode ?? "live";
120
+ const { left: leftFlex, middle: middleFlex, right: rightFlex, } = resolvePhiThreeColumnFlex({ balancedSides, sideShare, leftWidth, middleWidth, rightWidth });
105
121
  const showInsertButton = resolvedRenderMode === "editor";
106
122
  const layoutBox = resolvePhiLayoutBox({ size, minSize, maxSize, collapsedSizeHint });
107
123
  const { style: resolvedLayoutStyle, ground, hasExplicitLayoutBackground, } = resolvePhiBaseLayoutChrome({