@phis/ui 0.4.14 → 0.4.16

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 (48) hide show
  1. package/README.md +0 -1
  2. package/components/cms/phi-cms-layout-renderer.js +2 -1
  3. package/components/cms/phi-cms-root-layout.js +1 -1
  4. package/components/layouts/clients/phi-split-card-layout-client.js +6 -2
  5. package/components/regions/clients/cms-region-container-client.d.ts +3 -1
  6. package/components/regions/clients/cms-region-container-client.js +2 -1
  7. package/components/regions/phi-cms-region-container.d.ts +3 -1
  8. package/components/regions/phi-cms-region-container.js +3 -2
  9. package/components/regions/phi-cms-region-shell.d.ts +16 -1
  10. package/components/regions/phi-cms-region-shell.js +40 -11
  11. package/components/regions/phi-cms-region-static.d.ts +3 -1
  12. package/components/regions/phi-cms-region-static.js +2 -1
  13. package/components/regions/presets/phi-area-shell-preset-nodes.js +3 -2
  14. package/components/root/phi-antd-registry.d.ts +15 -0
  15. package/components/root/phi-antd-registry.js +29 -0
  16. package/components/root/phi-root-layout.js +2 -2
  17. package/components/shell/phi-shell-sider-drawer.d.ts +1 -1
  18. package/components/shell/phi-shell-sider-drawer.js +1 -1
  19. package/components/widgets/config/text-case-vocabulary.d.ts +33 -0
  20. package/components/widgets/config/text-case-vocabulary.js +29 -0
  21. package/components/widgets/label-types/inspector.d.ts +1 -1
  22. package/components/widgets/shared/card-body-client.js +2 -1
  23. package/components/widgets/shared/eyebrow-style.d.ts +9 -0
  24. package/components/widgets/shared/eyebrow-style.js +9 -0
  25. package/components/widgets/shared/markdown-body-client.d.ts +7 -3
  26. package/components/widgets/shared/markdown-body-client.js +26 -11
  27. package/helpers/renderable-block-defaults.js +1 -0
  28. package/helpers/renderable-block-serialization.js +7 -1
  29. package/package.json +3 -4
  30. package/plugins/runtime/phi-slot-child-viewport-effects-observer.js +13 -0
  31. package/plugins/runtime-modules/builder/clients/region-inspector.js +6 -5
  32. package/plugins/runtime-modules/builder/page-meta-form.js +11 -0
  33. package/plugins/runtime-modules/core/widgets/entry-list/client.js +1 -1
  34. package/plugins/runtime-modules/core/widgets/markdown/config.d.ts +6 -0
  35. package/plugins/runtime-modules/core/widgets/markdown/config.js +2 -0
  36. package/plugins/runtime-modules/core/widgets/markdown/plugin.js +7 -2
  37. package/plugins/runtime-modules/core/widgets/markdown/server.js +7 -1
  38. package/plugins/runtime-modules/core/widgets/quick-links/client.js +11 -8
  39. package/plugins/runtime-modules/core/widgets/simple-text/client.d.ts +3 -0
  40. package/plugins/runtime-modules/core/widgets/simple-text/client.js +3 -0
  41. package/plugins/runtime-modules/core/widgets/simple-text/config.d.ts +30 -0
  42. package/plugins/runtime-modules/core/widgets/simple-text/config.js +15 -0
  43. package/plugins/runtime-modules/theme/widgets/brand-controls/client.js +15 -1
  44. package/styles/layout.css +33 -0
  45. package/styles/root.css +2 -0
  46. package/styles/shell.css +41 -18
  47. package/types/core-widget-placements.d.ts +7 -0
  48. package/types/renderable-block.d.ts +5 -0
@@ -185,6 +185,7 @@ function normalizeRenderableBlockViewportEffect(value) {
185
185
  const rangeEnd = normalizeRenderableBlockViewportEffectRangePoint(value.rangeEnd);
186
186
  const easing = normalizeRenderableBlockTransitionEasing(value.easing);
187
187
  const clamp = typeof value.clamp === "boolean" ? value.clamp : undefined;
188
+ const perspectivePx = normalizeRenderableBlockTransitionNumber(value.perspectivePx, 0, 10000);
188
189
  if (!axis &&
189
190
  !property &&
190
191
  from == null &&
@@ -193,7 +194,8 @@ function normalizeRenderableBlockViewportEffect(value) {
193
194
  rangeStart == null &&
194
195
  rangeEnd == null &&
195
196
  !easing &&
196
- clamp == null) {
197
+ clamp == null &&
198
+ perspectivePx == null) {
197
199
  return undefined;
198
200
  }
199
201
  return {
@@ -206,6 +208,7 @@ function normalizeRenderableBlockViewportEffect(value) {
206
208
  ...(rangeEnd == null ? {} : { rangeEnd }),
207
209
  ...(easing ? { easing } : {}),
208
210
  ...(clamp == null ? {} : { clamp }),
211
+ ...(perspectivePx == null ? {} : { perspectivePx }),
209
212
  };
210
213
  }
211
214
  function normalizeRenderableBlockViewportEffects(value) {
@@ -400,6 +403,9 @@ function stripRenderableBlockEffects(value) {
400
403
  if (merged.clamp !== PHI_RENDERABLE_BLOCK_DEFAULT_VIEWPORT_EFFECT.clamp) {
401
404
  nextViewportEffect.clamp = merged.clamp;
402
405
  }
406
+ if (merged.perspectivePx !== PHI_RENDERABLE_BLOCK_DEFAULT_VIEWPORT_EFFECT.perspectivePx) {
407
+ nextViewportEffect.perspectivePx = merged.perspectivePx;
408
+ }
403
409
  return nextViewportEffect;
404
410
  });
405
411
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@phis/ui",
3
- "version": "0.4.14",
3
+ "version": "0.4.16",
4
4
  "license": "Apache-2.0",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -481,8 +481,7 @@
481
481
  ],
482
482
  "peerDependencies": {
483
483
  "@ant-design/icons": "^6.3.2",
484
- "@ant-design/nextjs-registry": "^1.3.0",
485
- "antd": "^6.5.1",
484
+ "antd": "^6.7.0",
486
485
  "next": "^16.2.11",
487
486
  "react": "^19.2.8",
488
487
  "react-dom": "^19.2.8"
@@ -503,7 +502,7 @@
503
502
  "@lexical/rich-text": "0.50.0",
504
503
  "@lexical/selection": "0.50.0",
505
504
  "@lexical/utils": "0.50.0",
506
- "@phis/contracts": "^0.7.6",
505
+ "@phis/contracts": "^0.7.7",
507
506
  "dayjs": "^1.11.23",
508
507
  "dom-serializer": "^2.0.0",
509
508
  "htmlparser2": "^10.1.0",
@@ -57,6 +57,7 @@ function resolveViewportEffectValues(effects, target) {
57
57
  rotateZ: "0deg",
58
58
  scale: "1",
59
59
  opacity: null,
60
+ perspective: null,
60
61
  };
61
62
  for (const effect of effects) {
62
63
  const property = effect.property ?? PHI_RENDERABLE_BLOCK_DEFAULT_VIEWPORT_EFFECT.property ?? "translate";
@@ -84,6 +85,12 @@ function resolveViewportEffectValues(effects, target) {
84
85
  else {
85
86
  values.rotateY = rotateValue;
86
87
  }
88
+ // A turn about `x` or `y` tilts into the page only when seen from a distance; the first that names one
89
+ // holds for the element, as one transform has one eye.
90
+ const perspectivePx = effect.perspectivePx ?? PHI_RENDERABLE_BLOCK_DEFAULT_VIEWPORT_EFFECT.perspectivePx;
91
+ if (axis !== "z" && values.perspective == null && perspectivePx) {
92
+ values.perspective = `perspective(${perspectivePx}px)`;
93
+ }
87
94
  continue;
88
95
  }
89
96
  const translateValue = formatViewportEffectValue(nextValue, effect.unit ?? "px");
@@ -103,6 +110,12 @@ function applyViewportEffectValues(target, values) {
103
110
  target.style.setProperty("--phi-effects-viewport-rotate-y", values.rotateY);
104
111
  target.style.setProperty("--phi-effects-viewport-rotate-z", values.rotateZ);
105
112
  target.style.setProperty("--phi-effects-viewport-scale", values.scale);
113
+ if (values.perspective == null) {
114
+ target.style.removeProperty("--phi-effects-viewport-perspective");
115
+ }
116
+ else {
117
+ target.style.setProperty("--phi-effects-viewport-perspective", values.perspective);
118
+ }
106
119
  if (values.opacity == null) {
107
120
  target.style.removeProperty("--phi-effects-viewport-opacity");
108
121
  }
@@ -97,8 +97,9 @@ export function PhiDeveloperBuilderRegionInspectorWidgetClient({ section, builde
97
97
  title: geometryLabels?.fields.viewport ?? "Viewport",
98
98
  children: (_jsxs("div", { style: { display: "grid", gap: PHI_GAP_SM, width: "100%" }, children: [_jsx(PhiViewportVisibilityControl, { disabled: isPreviewMode || !onDraftChange, value: effectiveDraft.viewportFlags, labels: geometryLabels?.viewport, onChange: (viewportFlags) => updateDraft({ viewportFlags }) }), selectedRegionKey === "sider_left" ? renderPhiInspectorConfigField({
99
99
  field: { key: "mobileDrawer", type: "boolean", label: visibilityLabels.siderMobileDrawer },
100
- value: hasPhiFlag(readPhiFlags(effectiveDraft.regionConfig?.flags), PhiCmsFlags.MobileDrawer),
101
- defaultValue: false,
100
+ // On unless the Sider says it keeps its column (`MobileColumn`).
101
+ value: !hasPhiFlag(readPhiFlags(effectiveDraft.regionConfig?.flags), PhiCmsFlags.MobileColumn),
102
+ defaultValue: true,
102
103
  config: effectiveDraft.regionConfig ?? {},
103
104
  disabled: isPreviewMode || !onDraftChange,
104
105
  onChange: (patch) => {
@@ -106,9 +107,9 @@ export function PhiDeveloperBuilderRegionInspectorWidgetClient({ section, builde
106
107
  updateDraft({
107
108
  regionConfig: {
108
109
  ...(effectiveDraft.regionConfig ?? {}),
109
- flags: patch.mobileDrawer === true
110
- ? flags | PhiCmsFlags.MobileDrawer
111
- : flags & ~PhiCmsFlags.MobileDrawer,
110
+ flags: patch.mobileDrawer === false
111
+ ? flags | PhiCmsFlags.MobileColumn
112
+ : flags & ~PhiCmsFlags.MobileColumn,
112
113
  },
113
114
  });
114
115
  },
@@ -390,6 +390,14 @@ const effectsDescriptors = {
390
390
  label: label("fields.clamp", "Clamp"),
391
391
  initialValue: true,
392
392
  },
393
+ {
394
+ key: "viewportPerspectivePx",
395
+ fieldProviderKey: PHI_FORM_FIELD_PROVIDER_KEYS.number,
396
+ label: label("fields.perspective", "Perspective"),
397
+ initialValue: 800,
398
+ config: { min: 0 },
399
+ visibleWhen: formEquals("viewportProperty", "rotate"),
400
+ },
393
401
  {
394
402
  key: "viewportEffects",
395
403
  fieldProviderKey: PHI_FORM_FIELD_PROVIDER_KEYS.table,
@@ -413,6 +421,7 @@ const effectsDescriptors = {
413
421
  rangeEnd: "exit",
414
422
  easing: "linear",
415
423
  clamp: true,
424
+ perspectivePx: 800,
416
425
  },
417
426
  sourceFields: {
418
427
  property: "viewportProperty",
@@ -424,6 +433,7 @@ const effectsDescriptors = {
424
433
  rangeEnd: "viewportRangeEnd",
425
434
  easing: "viewportEasing",
426
435
  clamp: "viewportClamp",
436
+ perspectivePx: "viewportPerspectivePx",
427
437
  },
428
438
  resetFields: {
429
439
  viewportProperty: "translate",
@@ -435,6 +445,7 @@ const effectsDescriptors = {
435
445
  viewportRangeEnd: "exit",
436
446
  viewportEasing: "linear",
437
447
  viewportClamp: true,
448
+ viewportPerspectivePx: 800,
438
449
  },
439
450
  },
440
451
  remove: { enabled: true, label: "Remove viewport effect" },
@@ -93,7 +93,7 @@ export function PhiEntryMeta({ entry, parts, titleLevel = 3, byline = "above", a
93
93
  * contributes nothing to the page's table of contents.
94
94
  */
95
95
  export function PhiEntryBody({ entry, parts, labels, }) {
96
- return (_jsxs(PhiFlexControl, { vertical: true, gap: PHI_SPACE.xs, children: [entry.blocks.length > 0 ? _jsx(PhiMarkdownWidgetClient, { config: { blocks: entry.blocks } }) : null, hasPhiContentEntryPart(parts, PhiContentEntryPart.Tags) ? _jsx(PhiEntryTags, { tags: entry.tags }) : null, hasPhiContentEntryPart(parts, PhiContentEntryPart.Link) && entry.link ? (_jsx(PhiLink, { href: entry.link.href, external: entry.link.external, newTab: entry.link.newTab, children: labels.readMore })) : null] }));
96
+ return (_jsxs(PhiFlexControl, { vertical: true, gap: PHI_SPACE.xs, children: [entry.blocks.length > 0 ? _jsx(PhiMarkdownWidgetClient, { labels: {}, config: { blocks: entry.blocks } }) : null, hasPhiContentEntryPart(parts, PhiContentEntryPart.Tags) ? _jsx(PhiEntryTags, { tags: entry.tags }) : null, hasPhiContentEntryPart(parts, PhiContentEntryPart.Link) && entry.link ? (_jsx(PhiLink, { href: entry.link.href, external: entry.link.external, newTab: entry.link.newTab, children: labels.readMore })) : null] }));
97
97
  }
98
98
  /**
99
99
  * The parts a list entry's meta shows, and the one left for after its text. The tags lead with the byline
@@ -6,6 +6,12 @@ import type { PhiCmsResolvedContent } from "../../../../../types/cms";
6
6
  import { type PhiBulletListStyle } from "../../../../../components/widgets/shared/bullet-list-vocabulary";
7
7
  import { type PhiCmsWidgetConfigBase } from "../../../../../components/widgets/config/parser-primitives";
8
8
  export type PhiCmsMarkdownWidgetConfig = PhiCmsWidgetConfigBase & {
9
+ /**
10
+ * A section's label above the text -- "The story", "Why phis" -- drawn as a Card's eyebrow is
11
+ * (`eyebrow-style.ts`) and translated like the text. Markdown has no form for it, and a bold line
12
+ * reads as a small title.
13
+ */
14
+ eyebrow?: string;
9
15
  sourceMode?: "inline" | "url";
10
16
  markdown?: string;
11
17
  widgetId?: string | number | null;
@@ -43,6 +43,7 @@ export function parsePhiCmsMarkdownWidgetConfig(config) {
43
43
  const sourceUrl = readString(config.sourceUrl);
44
44
  return {
45
45
  ...readRenderableBlockConfig(config),
46
+ eyebrow: readString(config.eyebrow),
46
47
  sourceMode: readMarkdownSourceMode(config.sourceMode) ?? (sourceUrl ? "url" : "inline"),
47
48
  widgetId: typeof config.widgetId === "number" || typeof config.widgetId === "string" ? config.widgetId : undefined,
48
49
  markdown: readString(config.markdown),
@@ -105,6 +106,7 @@ export const PHI_MARKDOWN_WIDGET_DEFINITION = {
105
106
  },
106
107
  },
107
108
  fields: [
109
+ { key: "eyebrow", type: "string", label: "Eyebrow" },
108
110
  {
109
111
  key: "sourceMode",
110
112
  type: "choice",
@@ -3,7 +3,7 @@ import { PhiWidgetInertPreview } from "../../../../../components/widgets/built-i
3
3
  import { resolveMarkdownRenderData } from "../../../../../components/widgets/shared/markdown-render";
4
4
  import { PhiCmsFlags } from "../../../../../constants/phi-cms";
5
5
  import { hasPhiFlag } from "../../../../../helpers/flags";
6
- import { readPhiMarkdownSearchText } from "../../../../../server-helpers/search-text";
6
+ import { readPhiMarkdownSearchText, translatePhiSearchWidgetTexts } from "../../../../../server-helpers/search-text";
7
7
  import { PhiMarkdownWidget } from "./server";
8
8
  import { PHI_MARKDOWN_WIDGET_DEFINITION, PHI_MARKDOWN_WIDGET_PLUGIN_TYPE, } from "./config";
9
9
  export const PHI_MARKDOWN_WIDGET_PLUGIN = {
@@ -20,7 +20,12 @@ export const PHI_MARKDOWN_WIDGET_PLUGIN = {
20
20
  resolvedContent: widget.resolvedContent ?? null,
21
21
  translate: !hasPhiFlag(widget.flags, PhiCmsFlags.NoTranslate),
22
22
  }, runtime);
23
- return "error" in data ? [] : readPhiMarkdownSearchText(data.blocks);
23
+ if ("error" in data)
24
+ return [];
25
+ const eyebrow = await translatePhiSearchWidgetTexts(runtime, [config.eyebrow], {
26
+ translate: !hasPhiFlag(widget.flags, PhiCmsFlags.NoTranslate),
27
+ });
28
+ return [...eyebrow, ...readPhiMarkdownSearchText(data.blocks)];
24
29
  },
25
30
  render: ({ widget, config, runtime }) => (_jsx(PhiMarkdownWidget, { config: {
26
31
  ...config,
@@ -1,5 +1,6 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { PhiCmsWidgetType } from "../../../../../constants/cms-widget-types";
3
+ import { trBulk, trBulkForLocale } from "../../../../../server-helpers/translate";
3
4
  import { PhiRuntimeModuleRenderClientHost } from "../../../../../components/runtime/runtime-module-render-client-manifest";
4
5
  import { resolveMarkdownRenderData } from "../../../../../components/widgets/shared/markdown-render";
5
6
  import { buildPhiMarkdownFaqStructuredData, resolvePhiMarkdownFoldLevel } from "../../../../../components/widgets/shared/markdown-sections";
@@ -16,7 +17,11 @@ export async function PhiMarkdownWidget({ config, runtime, }) {
16
17
  * out of a Content record -- went to the page's payload as well, every address in it in the clear while
17
18
  * the blocks protected them (`helpers/protected-mail.ts`).
18
19
  */
19
- const { markdown: _markdown, resolvedContent: _resolvedContent, ...presentation } = config ?? {};
20
+ const { markdown: _markdown, resolvedContent: _resolvedContent, eyebrow: sourceEyebrow, ...presentation } = config ?? {};
21
+ // The label above the text, translated as the text is: not where the node says `NoTranslate`.
22
+ const [eyebrow] = sourceEyebrow && config?.translate !== false
23
+ ? await (runtime?.locale.current ? trBulkForLocale(runtime.locale.current, [sourceEyebrow]) : trBulk([sourceEyebrow]))
24
+ : [sourceEyebrow];
20
25
  /*
21
26
  * The folding sections as questions and answers, written into the page for search engines: data, never
22
27
  * run, and its `<` escaped so no answer can close the element it stands in.
@@ -25,6 +30,7 @@ export async function PhiMarkdownWidget({ config, runtime, }) {
25
30
  ? buildPhiMarkdownFaqStructuredData(renderData.blocks, resolvePhiMarkdownFoldLevel(config.headingOffset))
26
31
  : null;
27
32
  return (_jsxs(_Fragment, { children: [faq ? (_jsx("script", { type: "application/ld+json", dangerouslySetInnerHTML: { __html: JSON.stringify(faq).replace(/</gu, "\\u003c") } })) : null, _jsx(PhiRuntimeModuleRenderClientHost, { type: PhiCmsWidgetType.Markdown, componentProps: {
33
+ labels: { eyebrow: eyebrow || undefined },
28
34
  config: {
29
35
  ...presentation,
30
36
  blocks: renderData.blocks,
@@ -4,7 +4,7 @@ import { useEffect, useState } from "react";
4
4
  import { PhiLink } from "../../../../../components/navigation/phi-link";
5
5
  import { PhiIcon } from "../../../../../components/shell/phi-icon";
6
6
  import { usePhiConfig } from "../../../../../components/root/phi-config-provider";
7
- import { PHI_CONTAINER_BREAKPOINT_COL2, PHI_CONTAINER_BREAKPOINT_COL3, } from "../../../../../theme/phi-container-breakpoints";
7
+ import { PHI_CONTAINER_BREAKPOINT_COL2 } from "../../../../../theme/phi-container-breakpoints";
8
8
  import { PhiFlexControl } from "../../../../../components/controls/phi-flex-control";
9
9
  import { PhiTypographyControl } from "../../../../../components/controls/phi-typography-control";
10
10
  import { usePhiPathname } from "../../../../../components/runtime/use-phi-pathname";
@@ -15,10 +15,6 @@ function useQuickLinksContainerWidth() {
15
15
  */
16
16
  const [node, ref] = useState(null);
17
17
  const [width, setWidth] = useState(0);
18
- const breakpoints = {
19
- col2: PHI_CONTAINER_BREAKPOINT_COL2,
20
- col3: PHI_CONTAINER_BREAKPOINT_COL3,
21
- };
22
18
  useEffect(() => {
23
19
  if (!node) {
24
20
  return;
@@ -39,7 +35,7 @@ function useQuickLinksContainerWidth() {
39
35
  observer.disconnect();
40
36
  };
41
37
  }, [node]);
42
- return { ref, width, breakpoints };
38
+ return { ref, width };
43
39
  }
44
40
  function groupQuickLinksItems(items, columns) {
45
41
  const resolvedColumnCount = Math.min(columns, Math.max(1, items.length));
@@ -56,12 +52,19 @@ function groupQuickLinksItems(items, columns) {
56
52
  }
57
53
  export function PhiQuickLinksWidgetClient({ labels, config, }) {
58
54
  const { token } = usePhiConfig();
59
- const { ref, width, breakpoints } = useQuickLinksContainerWidth();
55
+ const { ref, width } = useQuickLinksContainerWidth();
60
56
  const pathname = usePhiPathname();
61
57
  const maxColumns = config?.columns === 1 || config?.columns === 3 ? config.columns : 2;
62
58
  const interactive = config?.interactive !== false;
63
59
  const items = config?.items ?? [];
64
- const effectiveColumnsByWidth = width >= breakpoints.col3 ? 3 : width >= breakpoints.col2 ? 2 : 1;
60
+ /*
61
+ * As many columns as fit with each at least `PHI_CONTAINER_BREAKPOINT_COL2` wide, the space between
62
+ * two columns (`paddingMD` on either side of their edge) counted. The ruler's step was once read as
63
+ * the width two columns need together, so a footer 275px wide still split "Terms & Conditions" across
64
+ * two lines beside a second column.
65
+ */
66
+ const columnGutter = token.paddingMD * 2;
67
+ const effectiveColumnsByWidth = Math.max(1, Math.min(3, Math.floor((width + columnGutter) / (PHI_CONTAINER_BREAKPOINT_COL2 + columnGutter))));
65
68
  const effectiveColumns = maxColumns === 1
66
69
  ? 1
67
70
  : maxColumns === 2
@@ -1,3 +1,4 @@
1
+ import { type PhiLetterSpacingStep, type PhiTextTransform } from "../../../../../components/widgets/config/text-case-vocabulary";
1
2
  import type { PhiClientBlockBaseProps, PhiCmsInstanceId, PhiRenderableBlockRenderMode } from "../../../../../types";
2
3
  import type { PhiTextTone } from "../../../../../components/widgets/config/text-tone";
3
4
  import type { PhiSimpleTextMark } from "../../../../../types/core-widget-placements";
@@ -16,6 +17,8 @@ export type PhiSimpleTextWidgetClientConfig = {
16
17
  newTab?: boolean;
17
18
  tone?: PhiTextTone;
18
19
  marks?: PhiSimpleTextMark[];
20
+ textTransform?: PhiTextTransform;
21
+ letterSpacing?: PhiLetterSpacingStep;
19
22
  disabled?: boolean;
20
23
  };
21
24
  export type PhiSimpleTextWidgetClientProps = PhiClientBlockBaseProps<PhiSimpleTextWidgetClientLabels, PhiSimpleTextWidgetClientConfig> & {
@@ -1,5 +1,6 @@
1
1
  "use client";
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { PHI_LETTER_SPACING_STEPS, } from "../../../../../components/widgets/config/text-case-vocabulary";
3
4
  import { isPhiRecord } from "../../../../../helpers/is-record";
4
5
  import { useState } from "react";
5
6
  import { createPhiRenderableBlockReceiver, usePhiRenderableBlockSignalListener, } from "../../../../../components/runtime/renderable-block-runtime";
@@ -123,6 +124,8 @@ export function PhiSimpleTextWidgetClient({ blockId, labels, config, }) {
123
124
  fontSize: resolvedFontSize ?? "inherit",
124
125
  lineHeight: resolvedFontSize ? PHI_LINE_HEIGHT_LG : "inherit",
125
126
  ...(resolvedFontFamily ? { fontFamily: resolvedFontFamily } : {}),
127
+ ...(config?.textTransform === "uppercase" ? { textTransform: "uppercase" } : {}),
128
+ ...(config?.letterSpacing ? { letterSpacing: PHI_LETTER_SPACING_STEPS[config.letterSpacing] } : {}),
126
129
  }, children: textValue })] }));
127
130
  if (!hasHref) {
128
131
  return contentNode;
@@ -3,6 +3,7 @@ import { type PhiSimpleTextMark } from "../../../../../types/core-widget-placeme
3
3
  import type { PhiCmsResolvedContent } from "../../../../../types";
4
4
  import type { PhiWidgetFontFamilyKey, PhiWidgetFontSizeKey } from "../../../../../types/site-theme";
5
5
  import { type PhiCmsWidgetConfigBase } from "../../../../../components/widgets/config/parser-primitives";
6
+ import { type PhiLetterSpacingStep, type PhiTextTransform } from "../../../../../components/widgets/config/text-case-vocabulary";
6
7
  import { type PhiTextTone } from "../../../../../components/widgets/config/text-tone";
7
8
  export type PhiCmsSimpleTextWidgetConfig = PhiCmsWidgetConfigBase & {
8
9
  text?: string;
@@ -15,6 +16,10 @@ export type PhiCmsSimpleTextWidgetConfig = PhiCmsWidgetConfigBase & {
15
16
  newTab?: boolean;
16
17
  tone?: PhiTextTone;
17
18
  marks?: PhiSimpleTextMark[];
19
+ /** Capitals for a label (`text-case-vocabulary.ts`); absent, as written. */
20
+ textTransform?: PhiTextTransform;
21
+ /** A spacing step for a label in capitals; absent, normal. */
22
+ letterSpacing?: PhiLetterSpacingStep;
18
23
  disabled?: boolean;
19
24
  /** `"preset"` while the words are a Preset's and translated globally (`helpers/text-source.ts`). */
20
25
  textSource?: PhiTextSource;
@@ -355,6 +360,31 @@ export declare const PHI_SIMPLE_TEXT_WIDGET_DEFINITION: {
355
360
  readonly value: "danger";
356
361
  readonly label: "Danger";
357
362
  })[];
363
+ } | {
364
+ key: string;
365
+ type: "choice";
366
+ label: string;
367
+ options: ({
368
+ readonly value: "none";
369
+ readonly label: "As written";
370
+ } | {
371
+ readonly value: "uppercase";
372
+ readonly label: "Capitals";
373
+ })[];
374
+ } | {
375
+ key: string;
376
+ type: "choice";
377
+ label: string;
378
+ options: ({
379
+ readonly value: "normal";
380
+ readonly label: "Normal";
381
+ } | {
382
+ readonly value: "wide";
383
+ readonly label: "Wide";
384
+ } | {
385
+ readonly value: "wider";
386
+ readonly label: "Wider";
387
+ })[];
358
388
  })[];
359
389
  defaultConfig: {
360
390
  maxSize: {
@@ -6,6 +6,7 @@ import { PHI_RENDERABLE_BLOCK_GEOMETRY_FIELDS } from "../../../../../helpers/ren
6
6
  import { readBoolean, readRenderableBlockConfig, readString, } from "../../../../../components/widgets/config/parser-primitives";
7
7
  import { PHI_WIDGET_FONT_FAMILY_OPTIONS, readPhiWidgetFontFamily, } from "../../../../../components/widgets/helpers/font-family";
8
8
  import { PHI_WIDGET_FONT_SIZE_OPTIONS, readPhiWidgetFontSize, } from "../../../../../components/widgets/helpers/font-size";
9
+ import { PHI_LETTER_SPACING_FIELD_OPTIONS, PHI_TEXT_TRANSFORM_FIELD_OPTIONS, readPhiLetterSpacingStep, readPhiTextTransform, } from "../../../../../components/widgets/config/text-case-vocabulary";
9
10
  import { PHI_TEXT_TONE_FIELD_OPTIONS, readPhiTextTone, } from "../../../../../components/widgets/config/text-tone";
10
11
  function readSimpleTextMarks(value) {
11
12
  if (!Array.isArray(value)) {
@@ -27,6 +28,8 @@ function parsePhiCmsSimpleTextWidgetConfig(config) {
27
28
  newTab: readBoolean(config.newTab),
28
29
  tone: readPhiTextTone(config.tone),
29
30
  marks: readSimpleTextMarks(config.marks),
31
+ textTransform: readPhiTextTransform(config.textTransform),
32
+ letterSpacing: readPhiLetterSpacingStep(config.letterSpacing),
30
33
  disabled: readBoolean(config.disabled),
31
34
  textSource: readPhiTextSource(config.textSource),
32
35
  };
@@ -72,6 +75,18 @@ export const PHI_SIMPLE_TEXT_WIDGET_DEFINITION = {
72
75
  label: "Tone",
73
76
  options: [...PHI_TEXT_TONE_FIELD_OPTIONS],
74
77
  },
78
+ {
79
+ key: "textTransform",
80
+ type: "choice",
81
+ label: "Case",
82
+ options: [...PHI_TEXT_TRANSFORM_FIELD_OPTIONS],
83
+ },
84
+ {
85
+ key: "letterSpacing",
86
+ type: "choice",
87
+ label: "Letter Spacing",
88
+ options: [...PHI_LETTER_SPACING_FIELD_OPTIONS],
89
+ },
75
90
  { key: "external", type: "boolean", label: "External" },
76
91
  { key: "newTab", type: "boolean", label: "Open In New Tab" },
77
92
  { key: "marks", type: "string", label: "Marks", editorPlacement: "toolbar" },
@@ -25,6 +25,7 @@ import { PHI_CONTROL_HEIGHTS, PHI_PADDING, PHI_RADII, } from "../../../../../the
25
25
  import { PHI_COLOR_PICKER_NEUTRAL_PRESETS, PHI_COLOR_PICKER_PRESETS } from "../../../../../components/widgets/config/color-picker-presets";
26
26
  import { PHI_SPACING_TOKEN_KEYS } from "../../../../../components/widgets/config/spacing-options";
27
27
  import { PhiColorFieldControl } from "../../../../../components/controls/phi-color-field-control";
28
+ import { usePhiColorControlPresets } from "../../../../../components/controls/use-phi-color-control-presets";
28
29
  import { PhiBrandControl, resolvePhiBrandLogoUrl } from "../../../../../components/controls/phi-brand-control";
29
30
  import { PhiBackgroundControl } from "../../../../../components/controls/phi-background-control";
30
31
  import { PHI_ROOT_BACKGROUND_BASE_KINDS, PHI_ROOT_BACKGROUND_IMAGE_SOURCE_KINDS, PHI_ROOT_BACKGROUND_FILTERS, PHI_ROOT_BACKGROUND_MOTION_MODES, resolvePhiRootBackgroundPaintStyle, } from "../../../../../components/root/phi-root-background";
@@ -1550,6 +1551,19 @@ export function PhiBuilderBrandIdentityControlsWidgetClient({ runtime, config, }
1550
1551
  const resolvedDraft = resolvePhiThemeRuntimePayload(state.draft, themeBlocks).theme;
1551
1552
  return resolveBrandDraftAliasTokens(resolvedDraft, resolveThemePayloadPreset(resolvedDraft, themePresets), mode);
1552
1553
  }, [mode, state.draft, themeBlocks, themePresets]);
1554
+ /*
1555
+ * A Wordmark part picks from what every colour field of the Theme offers: the draft's custom colours in
1556
+ * the mode being authored, the primary and text ladders, then the fixed palettes. It stores the colour,
1557
+ * not the role -- the Theme is where those roles are set.
1558
+ */
1559
+ const wordmarkCustomColors = useMemo(() => {
1560
+ const palette = resolveThemeCustomPalette(state.draft, resolveThemePayloadPreset(state.draft, themePresets), mode);
1561
+ return PHI_THEME_CUSTOM_COLOR_KEYS.map((key, index) => ({ key, label: `Custom ${index + 1}`, value: palette[key] }));
1562
+ }, [mode, state.draft, themePresets]);
1563
+ const wordmarkColorPresets = usePhiColorControlPresets({
1564
+ customColors: wordmarkCustomColors,
1565
+ presets: PHI_COLOR_PICKER_PRESETS,
1566
+ });
1553
1567
  const [activeIdentitySection, changeActiveIdentitySection] = usePhiBrandAccordionSection(BRAND_THEME_IDENTITY_COLLAPSE_STORAGE_KEY, BRAND_THEME_IDENTITY_SECTION_KEYS);
1554
1568
  const brand = state.draft.brand ?? {};
1555
1569
  /*
@@ -1677,7 +1691,7 @@ export function PhiBuilderBrandIdentityControlsWidgetClient({ runtime, config, }
1677
1691
  ? _jsxs(_Fragment, { children: ["The Site name as it is set. One part per colour: a two-tone name is one word written in two. With no part at all the frame shows ", fallbackWordmark, "."] })
1678
1692
  : _jsx(_Fragment, { children: "The Brand is the Logo alone. The name is not drawn, and neither is the Eyebrow above it." }) }), _jsx(PhiSwitchControl, { label: "Show name", checked: showsWordmark, checkedLabel: "On", uncheckedLabel: "Off", onChange: (checked) => publishDraft(mergeThemeWordmarkShows(state.draft, checked)) }), showsWordmark && (_jsxs(_Fragment, { children: [editableWordmarkParts.map((part, index) => (_jsx(PhiLabeledControl, { label: `Part #${index + 1}`, fill: true, children: _jsxs(PhiFlexControl, { gap: clientToken.paddingXXS, align: "center", style: { width: "100%", minWidth: 0 }, children: [_jsx(PhiTextControl, { value: part.text, placeholder: index === 0 ? fallbackWordmark : "Part", ariaLabel: `Wordmark part ${index + 1}`, allowClear: false, onChange: (next) => updateWordmarkPart(index, { text: next ?? "" }) }), _jsx(PhiColorControl, { mode: "single", allowClear: true,
1679
1693
  // A part's row is narrow: the swatch says the colour, the value would overflow it.
1680
- showText: false, value: part.color ?? null, presets: PHI_COLOR_PICKER_PRESETS, onChange: (next) => updateWordmarkPart(index, { color: next }) }), _jsx(PhiButtonControl, { type: "text", size: "small", danger: true, disabled: wordmarkParts.length === 0, icon: _jsx(PhiIcon, { name: "delete", size: "inherit" }), ariaLabel: "Remove this part of the Wordmark", onClick: () => {
1694
+ showText: false, value: part.color ?? null, presets: wordmarkColorPresets, onChange: (next) => updateWordmarkPart(index, { color: next }) }), _jsx(PhiButtonControl, { type: "text", size: "small", danger: true, disabled: wordmarkParts.length === 0, icon: _jsx(PhiIcon, { name: "delete", size: "inherit" }), ariaLabel: "Remove this part of the Wordmark", onClick: () => {
1681
1695
  setWordmarkPartKeys((current) => ({
1682
1696
  ...current,
1683
1697
  keys: current.keys.filter((_, at) => at !== index),
package/styles/layout.css CHANGED
@@ -696,6 +696,39 @@
696
696
  height: 100%;
697
697
  }
698
698
 
699
+ /*
700
+ * A card is at least as tall as its content, and its content fills it by stretching, never by a
701
+ * percentage.
702
+ *
703
+ * The grid row takes its height from the cards. With `min-height: 0` on the card and its anchor, and
704
+ * `height: 100%` down the chain under it -- anchor, its content, the slot child, the Layout -- the
705
+ * content gave the row no lower bound of its own. Safari then keeps the row's height when the Split
706
+ * Card's width changes (fresh layouts are right): the window narrows, the text wraps onto more lines,
707
+ * and it runs out of a card that stays as tall as it was; widened again, the card stays too tall.
708
+ * `min-height: auto` on the card and the anchor carries the content's height into the row, which is
709
+ * what fixes it; stretching instead of percentages keeps the content filling the card. Every step is
710
+ * a flex row, so stretching gives the same height. Only the direct chain, child by child: a Layout
711
+ * further in keeps its own rules. `!important` where the anchor and the slot child state the old values
712
+ * inline.
713
+ */
714
+ /* The card itself: `:where([data-layout-kind])` gives every Layout element `min-height: 0`. */
715
+ .phi-split-card__grid > * {
716
+ min-height: auto;
717
+ }
718
+
719
+ .phi-split-card__grid > * > .phi-layout-scaffold-anchor--flow {
720
+ height: auto !important;
721
+ min-height: auto !important;
722
+ }
723
+
724
+ .phi-split-card__grid > * > .phi-layout-scaffold-anchor--flow > .phi-layout-scaffold-anchor__content[data-phi-slot-size-block="fill"],
725
+ .phi-split-card__grid > * > .phi-layout-scaffold-anchor--flow > .phi-layout-scaffold-anchor__content > .phi-slot-child--block-fill,
726
+ .phi-split-card__grid > * > .phi-layout-scaffold-anchor--flow > .phi-layout-scaffold-anchor__content > .phi-slot-child--block-fill > .phi-layout {
727
+ height: auto !important;
728
+ max-height: none !important;
729
+ align-self: stretch;
730
+ }
731
+
699
732
  @container phi-split-card (width < 36rem) {
700
733
  .phi-split-card__grid {
701
734
  grid-template-columns: minmax(0, 1fr);
package/styles/root.css CHANGED
@@ -91,7 +91,9 @@ samp {
91
91
  }
92
92
 
93
93
  :where([data-phi-renderable-block="true"][data-phi-effects-transition], [data-phi-renderable-block="true"][data-phi-effects-viewport]) {
94
+ /* `--phi-effects-viewport-perspective` is unset unless a viewport effect turns about x or y; it must lead. */
94
95
  --phi-effects-viewport-transform:
96
+ var(--phi-effects-viewport-perspective,)
95
97
  translate3d(var(--phi-effects-viewport-x, 0px), var(--phi-effects-viewport-y, 0px), 0)
96
98
  rotateX(var(--phi-effects-viewport-rotate-x, 0deg))
97
99
  rotateY(var(--phi-effects-viewport-rotate-y, 0deg))
package/styles/shell.css CHANGED
@@ -469,33 +469,36 @@
469
469
  }
470
470
 
471
471
  /*
472
- * A toned band takes no paint from its family's pane (LAYOUTING.md "Surface tone").
472
+ * A band with a ground of its own takes no paint from its family's pane (SHELL.md "A band with a ground
473
+ * of its own").
473
474
  *
474
- * A toned Chrome Region paints its own ground -- the tone's container ground, a stated Background, or
475
- * the Overlay of its tone's mode -- and never carries the marker. The pane behind it keeps the page's
476
- * mode, so where that ground lets anything through, the page-mode glass showed under the tone's. The
477
- * pane cannot be cut around one band without knowing its height, so it stops painting for the whole
478
- * family and the family's marker bands paint the Overlay themselves, as they do without panes. Its
479
- * geometry and Shadow stay: the frame's edge is where it was, and the Header still stands over the
480
- * Sider. The pane's paint is inline and reads these properties on the pane itself, so they are set
481
- * there. Untoned families match nothing here.
475
+ * The band carries `data-phi-shell-own-ground` when it paints its own ground: a tone (LAYOUTING.md
476
+ * "Surface tone"), an authored Background other than the Theme's Overlay taken as the Shell's, or a top
477
+ * Layout that paints one -- the floating Header bar. Such a band never carries the marker. The pane
478
+ * behind it would paint the frame under a ground that is already there: a second frosting under a
479
+ * glass band, the page-mode glass under a tone's, a full-width strip behind a floating bar. The pane
480
+ * cannot be cut around one band without knowing its height, so it stops painting for the whole family
481
+ * and the family's marker bands paint the Overlay themselves, as they do without panes. Its geometry and
482
+ * Shadow stay: the frame's edge is where it was, and the Header still stands over the Sider. The pane's
483
+ * paint is inline and reads these properties on the pane itself, so they are set there. Families
484
+ * without such a band match nothing here.
482
485
  */
483
- .shell-sider-full:has(> :is([data-phi-region-key="header_top"], [data-phi-region-key="header_main"], [data-phi-region-key="header_bottom"]):is(.phi-tone-light, .phi-tone-dark, .phi-tone-inverse)) > .phi-shell-chrome-pane--header,
484
- .shell-sider-embedded:has(> :is([data-phi-region-key="header_top"], [data-phi-region-key="header_main"]):is(.phi-tone-light, .phi-tone-dark, .phi-tone-inverse)) > .phi-shell-chrome-pane--header,
485
- .shell-sider-embedded:has(> [data-phi-region-key="header_bottom"]:is(.phi-tone-light, .phi-tone-dark, .phi-tone-inverse)) > .phi-shell-chrome-pane--header-bottom,
486
- [data-phi-shell-chrome-panes="true"]:has(> [data-phi-region-key="sider_left"]:is(.phi-tone-light, .phi-tone-dark, .phi-tone-inverse)) > .phi-shell-chrome-pane--sider,
487
- [data-phi-shell-chrome-panes="true"]:has(> [data-phi-region-key="sider_right"]:is(.phi-tone-light, .phi-tone-dark, .phi-tone-inverse)) > .phi-shell-chrome-pane--sider-right,
488
- [data-phi-shell-chrome-panes="true"]:has(> :is([data-phi-region-key="footer_top"], [data-phi-region-key="footer_main"], [data-phi-region-key="footer_bottom"]):is(.phi-tone-light, .phi-tone-dark, .phi-tone-inverse)) > .phi-shell-chrome-pane--footer {
486
+ .shell-sider-full:has(> :is([data-phi-region-key="header_top"], [data-phi-region-key="header_main"], [data-phi-region-key="header_bottom"])[data-phi-shell-own-ground]) > .phi-shell-chrome-pane--header,
487
+ .shell-sider-embedded:has(> :is([data-phi-region-key="header_top"], [data-phi-region-key="header_main"])[data-phi-shell-own-ground]) > .phi-shell-chrome-pane--header,
488
+ .shell-sider-embedded:has(> [data-phi-region-key="header_bottom"][data-phi-shell-own-ground]) > .phi-shell-chrome-pane--header-bottom,
489
+ [data-phi-shell-chrome-panes="true"]:has(> [data-phi-region-key="sider_left"][data-phi-shell-own-ground]) > .phi-shell-chrome-pane--sider,
490
+ [data-phi-shell-chrome-panes="true"]:has(> [data-phi-region-key="sider_right"][data-phi-shell-own-ground]) > .phi-shell-chrome-pane--sider-right,
491
+ [data-phi-shell-chrome-panes="true"]:has(> :is([data-phi-region-key="footer_top"], [data-phi-region-key="footer_main"], [data-phi-region-key="footer_bottom"])[data-phi-shell-own-ground]) > .phi-shell-chrome-pane--footer {
489
492
  --phi-shell-chrome-image: none;
490
493
  --phi-shell-chrome-color: transparent;
491
494
  --phi-shell-chrome-filter: none;
492
495
  }
493
496
 
494
- .shell-sider-full:has(> :is([data-phi-region-key="header_top"], [data-phi-region-key="header_main"], [data-phi-region-key="header_bottom"]):is(.phi-tone-light, .phi-tone-dark, .phi-tone-inverse))
497
+ .shell-sider-full:has(> :is([data-phi-region-key="header_top"], [data-phi-region-key="header_main"], [data-phi-region-key="header_bottom"])[data-phi-shell-own-ground])
495
498
  > .phi-cms-region-shell[data-phi-shell-chrome="true"]:is([data-phi-region-key="header_top"], [data-phi-region-key="header_main"], [data-phi-region-key="header_bottom"]),
496
- .shell-sider-embedded:has(> :is([data-phi-region-key="header_top"], [data-phi-region-key="header_main"]):is(.phi-tone-light, .phi-tone-dark, .phi-tone-inverse))
499
+ .shell-sider-embedded:has(> :is([data-phi-region-key="header_top"], [data-phi-region-key="header_main"])[data-phi-shell-own-ground])
497
500
  > .phi-cms-region-shell[data-phi-shell-chrome="true"]:is([data-phi-region-key="header_top"], [data-phi-region-key="header_main"]),
498
- [data-phi-shell-chrome-panes="true"]:has(> :is([data-phi-region-key="footer_top"], [data-phi-region-key="footer_main"], [data-phi-region-key="footer_bottom"]):is(.phi-tone-light, .phi-tone-dark, .phi-tone-inverse))
501
+ [data-phi-shell-chrome-panes="true"]:has(> :is([data-phi-region-key="footer_top"], [data-phi-region-key="footer_main"], [data-phi-region-key="footer_bottom"])[data-phi-shell-own-ground])
499
502
  > .phi-cms-region-shell[data-phi-shell-chrome="true"]:is([data-phi-region-key="footer_top"], [data-phi-region-key="footer_main"], [data-phi-region-key="footer_bottom"]) {
500
503
  --phi-region-chrome-image: var(--phi-shell-chrome-image, none);
501
504
  --phi-region-chrome-color: var(--phi-shell-chrome-color, transparent);
@@ -503,6 +506,26 @@
503
506
  --phi-region-chrome-attachment: fixed;
504
507
  }
505
508
 
509
+ /*
510
+ * A bar inside the band (`box`: the band's top Layout paints the ground, not the band) takes the pane's
511
+ * Shadow away as well. The Shadow marks the frame's edge across the full width, and the frame has stepped
512
+ * aside for a bar that is narrower and wears its own edge. A tone or a band's own Background keeps it.
513
+ */
514
+ .shell-sider-full:has(> :is([data-phi-region-key="header_top"], [data-phi-region-key="header_main"], [data-phi-region-key="header_bottom"])[data-phi-shell-own-ground="box"]) > .phi-shell-chrome-pane--header,
515
+ .shell-sider-embedded:has(> :is([data-phi-region-key="header_top"], [data-phi-region-key="header_main"])[data-phi-shell-own-ground="box"]) > .phi-shell-chrome-pane--header,
516
+ .shell-sider-embedded:has(> [data-phi-region-key="header_bottom"][data-phi-shell-own-ground="box"]) > .phi-shell-chrome-pane--header-bottom {
517
+ --phi-shell-chrome-shadow-header: none;
518
+ }
519
+ [data-phi-shell-chrome-panes="true"]:has(> [data-phi-region-key="sider_left"][data-phi-shell-own-ground="box"]) > .phi-shell-chrome-pane--sider {
520
+ --phi-shell-chrome-shadow-sider-left: none;
521
+ }
522
+ [data-phi-shell-chrome-panes="true"]:has(> [data-phi-region-key="sider_right"][data-phi-shell-own-ground="box"]) > .phi-shell-chrome-pane--sider-right {
523
+ --phi-shell-chrome-shadow-sider-right: none;
524
+ }
525
+ [data-phi-shell-chrome-panes="true"]:has(> :is([data-phi-region-key="footer_top"], [data-phi-region-key="footer_main"], [data-phi-region-key="footer_bottom"])[data-phi-shell-own-ground="box"]) > .phi-shell-chrome-pane--footer {
526
+ --phi-shell-chrome-shadow-footer: none;
527
+ }
528
+
506
529
  /* ---------------------------------------------------------------------------------------------
507
530
  Revealing `header_top` (SHELL.md "Region visibility per Page")
508
531