@phis/ui 0.4.10 → 0.4.13

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 (69) hide show
  1. package/components/cms/phi-cms-area-access-guard.js +9 -1
  2. package/components/cms/phi-cms-area-render-scope.d.ts +8 -4
  3. package/components/cms/phi-cms-area-render-scope.js +26 -11
  4. package/components/cms/phi-cms-root-layout.js +4 -2
  5. package/components/controls/phi-background-control.js +2 -1
  6. package/components/controls/phi-border-control.d.ts +1 -1
  7. package/components/controls/phi-border-control.js +5 -2
  8. package/components/controls/phi-color-control.d.ts +5 -0
  9. package/components/controls/phi-color-control.js +28 -4
  10. package/components/controls/phi-color-field-control.d.ts +3 -1
  11. package/components/controls/phi-color-field-control.js +2 -2
  12. package/components/controls/use-phi-color-control-presets.d.ts +11 -1
  13. package/components/controls/use-phi-color-control-presets.js +20 -1
  14. package/components/forms/auth-admin-settings-labels.d.ts +35 -0
  15. package/components/forms/auth-admin-settings-labels.js +27 -0
  16. package/components/layouts/clients/phi-flex-layout-client.js +7 -1
  17. package/components/root/phi-root-theme-resolver.js +5 -1
  18. package/components/runtime/runtime-controller-server-host.js +20 -9
  19. package/components/shell/phi-antd-icon.d.ts +3 -0
  20. package/components/shell/phi-antd-icon.js +9 -0
  21. package/components/tables/phi-plain-table.d.ts +4 -0
  22. package/components/tables/phi-plain-table.js +1 -1
  23. package/components/widgets/client/shared/phi-widget-tool-buttons.js +1 -1
  24. package/components/widgets/shared/markdown-body-client.d.ts +7 -0
  25. package/components/widgets/shared/markdown-body-client.js +2 -0
  26. package/components/widgets/shared/markdown-render.js +48 -1
  27. package/controls.d.ts +2 -0
  28. package/controls.js +3 -0
  29. package/helpers/cms-region-keys.d.ts +1 -1
  30. package/helpers/page-layout-check.d.ts +17 -0
  31. package/helpers/page-layout-check.js +121 -0
  32. package/helpers.d.ts +1 -0
  33. package/helpers.js +2 -0
  34. package/package.json +2 -2
  35. package/plugins/runtime-modules/auth/data-providers.d.ts +5 -0
  36. package/plugins/runtime-modules/auth/data-providers.js +3 -0
  37. package/plugins/runtime-modules/auth/definition.d.ts +5 -0
  38. package/plugins/runtime-modules/auth/services/installations-table.js +3 -1
  39. package/plugins/runtime-modules/auth/trees/phi-default-admin-auth-settings-page-tree.js +24 -9
  40. package/plugins/runtime-modules/auth/widgets/security/client.js +5 -1
  41. package/plugins/runtime-modules/builder/clients/inspector-config-field.js +1 -1
  42. package/plugins/runtime-modules/builder/render-root-node-scaffold.js +0 -1
  43. package/plugins/runtime-modules/client-authoring-module.js +18 -1
  44. package/plugins/runtime-modules/core/widgets/collection-view/asset-binding.js +1 -1
  45. package/plugins/runtime-modules/core/widgets/result/config.d.ts +3 -0
  46. package/plugins/runtime-modules/core/widgets/result/config.js +15 -10
  47. package/plugins/runtime-modules/core/widgets/result/server.js +1 -1
  48. package/plugins/runtime-modules/core/widgets/table/client.js +1 -1
  49. package/plugins/runtime-modules/core/widgets/tree/client.js +1 -1
  50. package/plugins/runtime-modules/phi-default-site-area-preset-tree.js +4 -109
  51. package/plugins/runtime-modules/preset-contracts/pub-area.d.ts +2 -2
  52. package/plugins/runtime-modules/preset-contracts/pub-area.js +0 -4
  53. package/plugins/runtime-modules/pub-area-preset.js +0 -20
  54. package/plugins/runtime-modules/public/trees/phi-default-pub-error-page-tree.js +5 -5
  55. package/plugins/runtime-modules/theme/widgets/brand-controls/client.js +5 -3
  56. package/plugins/runtime-modules/threads/trees/phi-default-threads-page-tree.js +8 -6
  57. package/plugins/runtime-modules/user-management/trees/phi-default-admin-users-page-tree.js +1 -1
  58. package/server-helpers/cms-root.js +21 -13
  59. package/server-helpers/runtime.js +0 -1
  60. package/styles/controls.css +11 -0
  61. package/styles/shell.css +11 -1
  62. package/theme/antd-css-var-contract.d.ts +24 -1
  63. package/theme/antd-css-var-contract.js +33 -1
  64. package/theme/phi-theme-palette.d.ts +6 -0
  65. package/theme/phi-theme-palette.js +13 -0
  66. package/theme/phi-theme-tokens.d.ts +3 -2
  67. package/theme/phi-theme-tokens.js +12 -1
  68. package/types/site-config.d.ts +0 -4
  69. package/types/widget-runtime.d.ts +0 -3
@@ -184,7 +184,7 @@ export function PhiTreeWidgetClient({ config, labels, renderMode }) {
184
184
  const toolbar = selfContained && ((config.features.actions?.selection?.length ?? 0) > 0 ||
185
185
  (config.features.actions?.toolbar?.length ?? 0) > 0 ||
186
186
  hasResettableQuery && tools?.reset !== false ||
187
- tools?.reload === true) ? (_jsxs(PhiToolbarControl, { size: controlSize, compact: true, children: [(config.features.actions?.toolbar ?? []).map((action) => (_jsx(PhiTreeActionButton, { action: action, size: controlSize, onActivate: () => activate(action) }, action.key))), (config.features.actions?.selection ?? []).map((action) => (_jsx(PhiTreeActionButton, { action: action, size: controlSize, disabled: binding.selectedNodeIdentities.length === 0, onActivate: () => activate(action) }, action.key))), hasResettableQuery && tools?.reset !== false ? (_jsx(PhiButtonControl, { icon: _jsx(PhiIcon, { name: "undo", size: "inherit" }), ariaLabel: labels.reset, size: controlSize, onClick: resetTools })) : null, tools?.reload ? (_jsx(PhiButtonControl, { icon: _jsx(PhiIcon, { name: "reload", size: "inherit" }), ariaLabel: labels.reload, tooltip: labels.reload, size: controlSize, onClick: binding.reload })) : null] })) : null;
187
+ tools?.reload === true) ? (_jsxs(PhiToolbarControl, { size: controlSize, compact: true, children: [(config.features.actions?.toolbar ?? []).map((action) => (_jsx(PhiTreeActionButton, { action: action, size: controlSize, onActivate: () => activate(action) }, action.key))), (config.features.actions?.selection ?? []).map((action) => (_jsx(PhiTreeActionButton, { action: action, size: controlSize, disabled: binding.selectedNodeIdentities.length === 0, onActivate: () => activate(action) }, action.key))), hasResettableQuery && tools?.reset !== false ? (_jsx(PhiButtonControl, { icon: _jsx(PhiIcon, { name: "clear-outlined", size: "inherit" }), ariaLabel: labels.reset, tooltip: labels.reset, size: controlSize, onClick: resetTools })) : null, tools?.reload ? (_jsx(PhiButtonControl, { icon: _jsx(PhiIcon, { name: "reload", size: "inherit" }), ariaLabel: labels.reload, tooltip: labels.reload, size: controlSize, onClick: binding.reload })) : null] })) : null;
188
188
  /*
189
189
  * The source's failures end the Tree here: a binding that does not hold, a resource the configuration
190
190
  * does not fit, a read that failed. A refused change stays in `binding.error` alone, said above the
@@ -15,7 +15,6 @@ import { PHI_DEFAULT_PUB_AREA_PRESET } from "./pub-area-preset";
15
15
  import { createPhiDefaultAreaRuntimeModuleIds } from "./area-module-defaults";
16
16
  import { PHI_DEFAULT_PUB_AREA_LAYOUT_NODE_KEYS, PHI_DEFAULT_PUB_AREA_WIDGET_NODE_KEYS, } from "./preset-contracts/pub-area";
17
17
  const SYNTHETIC_REGION_IDS = {
18
- regionHeaderTop: -1,
19
18
  regionHeaderMain: -2,
20
19
  regionFooterTop: -27,
21
20
  regionFooterMain: -28,
@@ -33,7 +32,6 @@ export async function buildPhiDefaultSiteAreaPresetTree({ page, runtime, presetK
33
32
  presetKey,
34
33
  }, PHI_DEFAULT_PUB_AREA_WIDGET_NODE_KEYS);
35
34
  const headerMainRegion = PHI_DEFAULT_PUB_AREA_PRESET.regions.find((region) => region.key === "header_main");
36
- const headerTopRegion = PHI_DEFAULT_PUB_AREA_PRESET.regions.find((region) => region.key === "header_top");
37
35
  const footerMainRegion = PHI_DEFAULT_PUB_AREA_PRESET.regions.find((region) => region.key === "footer_main");
38
36
  const footerTopRegion = PHI_DEFAULT_PUB_AREA_PRESET.regions.find((region) => region.key === "footer_top");
39
37
  const footerBottomRegion = PHI_DEFAULT_PUB_AREA_PRESET.regions.find((region) => region.key === "footer_bottom");
@@ -41,7 +39,8 @@ export async function buildPhiDefaultSiteAreaPresetTree({ page, runtime, presetK
41
39
  /*
42
40
  * The Preset's words stay in the source language and say they are the Preset's; the Widgets translate
43
41
  * them through the global store (`helpers/text-source.ts`). The contact label is the Preset's only
44
- * while the Site's theme names none.
42
+ * while the Site's theme names none. It stands in the Footer; the Header has no strip above its main
43
+ * band, which a Site adds in the Builder when it wants one.
45
44
  */
46
45
  const contactLabelIsPreset = !runtime.site.theme?.contact?.label?.trim();
47
46
  /*
@@ -53,11 +52,6 @@ export async function buildPhiDefaultSiteAreaPresetTree({ page, runtime, presetK
53
52
  * `helpers/text-placeholders.ts` has the names it may use.
54
53
  */
55
54
  const footerBottomText = "© {year} {site.name}. All rights reserved.";
56
- const shellHeaderTopHeight = resolvePhiShellHeaderHeight(runtime.site.theme?.shell, "top");
57
- const shellHeaderTopOffsetTop = resolvePhiShellMetric(runtime.site.theme?.shell, "offsetTop", {
58
- family: "header",
59
- region: "top",
60
- });
61
55
  const shellHeaderMainHeight = resolvePhiShellHeaderHeight(runtime.site.theme?.shell, "main");
62
56
  const shellHeaderMainOffsetTop = resolvePhiShellMetric(runtime.site.theme?.shell, "offsetTop", {
63
57
  family: "header",
@@ -81,24 +75,6 @@ export async function buildPhiDefaultSiteAreaPresetTree({ page, runtime, presetK
81
75
  runtimeModuleIds: createPhiDefaultAreaRuntimeModuleIds(runtimeModuleArea),
82
76
  overlays: [],
83
77
  regions: [
84
- ...(headerTopRegion
85
- ? [
86
- nodes.region({
87
- id: SYNTHETIC_REGION_IDS.regionHeaderTop,
88
- regionType: PhiCmsRegionType.HeaderTop,
89
- rootLayoutNodeId: PHI_DEFAULT_PUB_AREA_LAYOUT_IDS.layoutHeaderTop,
90
- status: headerTopRegion.status,
91
- flags: headerTopRegion.flags,
92
- visibilityMask: headerTopRegion.visibilityMask,
93
- sortOrder: headerTopRegion.sortOrder,
94
- config: {
95
- ...headerTopRegion.config,
96
- size: { ...(headerTopRegion.config.size ?? {}), height: `${shellHeaderTopHeight}px` },
97
- ...(typeof shellHeaderTopOffsetTop === "number" ? { offsetTop: shellHeaderTopOffsetTop } : {}),
98
- },
99
- }),
100
- ]
101
- : []),
102
78
  ...(headerMainRegion
103
79
  ? [
104
80
  nodes.region({
@@ -176,26 +152,6 @@ export async function buildPhiDefaultSiteAreaPresetTree({ page, runtime, presetK
176
152
  : []),
177
153
  ],
178
154
  layoutNodes: [
179
- ...(headerTopRegion
180
- ? [
181
- {
182
- id: PHI_DEFAULT_PUB_AREA_LAYOUT_IDS.layoutHeaderTop,
183
- siteId: page.siteId,
184
- parentLayoutNodeId: null,
185
- widgetType: buildPhiCmsLayoutNamespacedTypeKey(resolvePhiCmsLayoutPluginKey("three-column"), "three-column"),
186
- slotIndex: PHI_CMS_DEFAULT_SLOT_INDEX,
187
- sortOrder: -10,
188
- status: 1,
189
- flags: 0,
190
- visibilityMask: page.visibilityMask,
191
- label: "pub header top three column",
192
- config: {
193
- ...resolvePhiLayoutCreationPreset("threecol", "panel"),
194
- balancedSides: true,
195
- },
196
- },
197
- ]
198
- : []),
199
155
  {
200
156
  id: PHI_DEFAULT_PUB_AREA_LAYOUT_IDS.layoutHeaderMain,
201
157
  siteId: page.siteId,
@@ -323,69 +279,6 @@ export async function buildPhiDefaultSiteAreaPresetTree({ page, runtime, presetK
323
279
  : []),
324
280
  ],
325
281
  contentWidgets: [
326
- ...(headerTopRegion
327
- ? [
328
- /*
329
- * The Brand's own two lines, drawn by the Brand Widget rather than copied into a Text one.
330
- *
331
- * They say what the Site says about itself, so they are read from the Theme record when the
332
- * page renders and are set where the rest of the Brand is set, in the Theme workspace. A
333
- * Site that has stated neither shows neither: the strip keeps its shape, and an invented
334
- * slogan in everybody's header was never this Preset's to write.
335
- */
336
- {
337
- id: PHI_DEFAULT_PUB_AREA_WIDGET_IDS.widgetHeaderTopLeft,
338
- siteId: page.siteId,
339
- parentLayoutNodeId: PHI_DEFAULT_PUB_AREA_LAYOUT_IDS.layoutHeaderTop,
340
- widgetType: buildPhiCmsWidgetNamespacedTypeKey(resolvePhiCmsWidgetPluginKey("brand"), "brand"),
341
- slotIndex: PHI_CMS_THREE_COLUMN_LAYOUT_SLOT_INDEX.Left,
342
- sortOrder: 0,
343
- status: 1,
344
- flags: PhiCmsFlags.NoTranslate,
345
- visibilityMask: page.visibilityMask,
346
- label: "pub header top left",
347
- config: {
348
- mode: "slogan",
349
- },
350
- contentVersionId: null,
351
- },
352
- {
353
- id: PHI_DEFAULT_PUB_AREA_WIDGET_IDS.widgetHeaderTopMiddle,
354
- siteId: page.siteId,
355
- parentLayoutNodeId: PHI_DEFAULT_PUB_AREA_LAYOUT_IDS.layoutHeaderTop,
356
- widgetType: buildPhiCmsWidgetNamespacedTypeKey(resolvePhiCmsWidgetPluginKey("brand"), "brand"),
357
- slotIndex: PHI_CMS_THREE_COLUMN_LAYOUT_SLOT_INDEX.Middle,
358
- sortOrder: 10,
359
- status: 1,
360
- flags: PhiCmsFlags.NoTranslate,
361
- visibilityMask: page.visibilityMask,
362
- label: "pub header top middle",
363
- config: {
364
- mode: "location",
365
- },
366
- contentVersionId: null,
367
- },
368
- {
369
- id: PHI_DEFAULT_PUB_AREA_WIDGET_IDS.widgetHeaderTopRight,
370
- siteId: page.siteId,
371
- parentLayoutNodeId: PHI_DEFAULT_PUB_AREA_LAYOUT_IDS.layoutHeaderTop,
372
- widgetType: buildPhiCmsWidgetNamespacedTypeKey(resolvePhiCmsWidgetPluginKey("simple-text"), "simple-text"),
373
- slotIndex: PHI_CMS_THREE_COLUMN_LAYOUT_SLOT_INDEX.Right,
374
- sortOrder: 20,
375
- status: 1,
376
- flags: 0,
377
- visibilityMask: page.visibilityMask,
378
- label: "pub header top right",
379
- config: {
380
- text: contactLabel,
381
- ...(contactLabelIsPreset ? { textSource: PHI_TEXT_SOURCE_PRESET } : {}),
382
- href: contactHref,
383
- icon: contactIcon,
384
- },
385
- contentVersionId: null,
386
- },
387
- ]
388
- : []),
389
282
  {
390
283
  id: PHI_DEFAULT_PUB_AREA_WIDGET_IDS.widgetBrand,
391
284
  siteId: page.siteId,
@@ -412,8 +305,10 @@ export async function buildPhiDefaultSiteAreaPresetTree({ page, runtime, presetK
412
305
  flags: 0,
413
306
  visibilityMask: page.visibilityMask,
414
307
  label: "pub header main navigation",
308
+ /* The current entry on a rounded ground rather than a bar under it, in either mode. */
415
309
  config: {
416
310
  navKey: `${runtimeModuleArea}:header`,
311
+ selectionStyle: "pill",
417
312
  },
418
313
  contentVersionId: null,
419
314
  },
@@ -1,4 +1,4 @@
1
1
  export declare const PHI_DEFAULT_PUB_AREA_PRESET_KEY = "public-area-preset";
2
- export declare const PHI_DEFAULT_PUB_AREA_LAYOUT_NODE_KEYS: readonly ["layoutHeaderTop", "layoutHeaderMain", "layoutHeaderActions", "layoutHeaderBottom", "layoutSiderRight", "layoutFooterTop", "layoutFooterMain", "layoutFooterBottom"];
3
- export declare const PHI_DEFAULT_PUB_AREA_WIDGET_NODE_KEYS: readonly ["widgetHeaderTopLeft", "widgetHeaderTopMiddle", "widgetHeaderTopRight", "widgetBrand", "widgetNav", "widgetLocale", "widgetAccount", "widgetSiderRightNav", "widgetFooterLeft", "widgetFooterMiddle", "widgetFooterRight", "widgetFooterBottomText"];
2
+ export declare const PHI_DEFAULT_PUB_AREA_LAYOUT_NODE_KEYS: readonly ["layoutHeaderMain", "layoutHeaderActions", "layoutHeaderBottom", "layoutSiderRight", "layoutFooterTop", "layoutFooterMain", "layoutFooterBottom"];
3
+ export declare const PHI_DEFAULT_PUB_AREA_WIDGET_NODE_KEYS: readonly ["widgetBrand", "widgetNav", "widgetLocale", "widgetAccount", "widgetSiderRightNav", "widgetFooterLeft", "widgetFooterMiddle", "widgetFooterRight", "widgetFooterBottomText"];
4
4
  export declare const PHI_DEFAULT_PUB_AREA_COMPOSITION_NODE_KEYS: readonly ["widgetBrand", "widgetNav", "widgetLocale"];
@@ -1,6 +1,5 @@
1
1
  export const PHI_DEFAULT_PUB_AREA_PRESET_KEY = "public-area-preset";
2
2
  export const PHI_DEFAULT_PUB_AREA_LAYOUT_NODE_KEYS = [
3
- "layoutHeaderTop",
4
3
  "layoutHeaderMain",
5
4
  "layoutHeaderActions",
6
5
  "layoutHeaderBottom",
@@ -10,9 +9,6 @@ export const PHI_DEFAULT_PUB_AREA_LAYOUT_NODE_KEYS = [
10
9
  "layoutFooterBottom",
11
10
  ];
12
11
  export const PHI_DEFAULT_PUB_AREA_WIDGET_NODE_KEYS = [
13
- "widgetHeaderTopLeft",
14
- "widgetHeaderTopMiddle",
15
- "widgetHeaderTopRight",
16
12
  "widgetBrand",
17
13
  "widgetNav",
18
14
  "widgetLocale",
@@ -1,25 +1,6 @@
1
1
  import { PhiCmsFlags } from "../../constants/phi-cms";
2
2
  import { PHI_PADDING } from "../../theme/phi-tokens";
3
3
  import { createPhiDefaultAreaRuntimeModuleIds } from "./area-module-defaults";
4
- const PUB_HEADER_TOP_REGION = {
5
- key: "header_top",
6
- status: 1,
7
- flags: 0,
8
- visibilityMask: 0,
9
- sortOrder: -10,
10
- config: {
11
- offsetTop: 0,
12
- /*
13
- * The strip of Brand lines stands on the Area's own `/` alone. A rule the Region carries, so it is
14
- * still the rule after an author has saved the Area and the code no longer answers.
15
- */
16
- pageScope: { mode: "root" },
17
- },
18
- rootLayoutNodeId: null,
19
- rootLayoutNode: null,
20
- source: "fallback",
21
- allowedPageSlotInjections: [],
22
- };
23
4
  const PUB_HEADER_MAIN_REGION = {
24
5
  key: "header_main",
25
6
  status: 1,
@@ -125,7 +106,6 @@ export const PHI_DEFAULT_PUB_AREA_PRESET = {
125
106
  runtimeModules: createPhiDefaultAreaRuntimeModuleIds("public"),
126
107
  },
127
108
  regions: [
128
- PUB_HEADER_TOP_REGION,
129
109
  PUB_HEADER_MAIN_REGION,
130
110
  PUB_CONTENT_REGION,
131
111
  PUB_FOOTER_TOP_REGION,
@@ -96,12 +96,12 @@ export async function buildPhiDefaultPubErrorPageTree({ code, page, }) {
96
96
  title: copy.title,
97
97
  subTitle: copy.subTitle,
98
98
  /*
99
- * Only the 404 offers the way out, and only because only the 404 has one.
100
- *
101
- * The link goes to the root of the Area the refusal happened in. For a missing page that is
102
- * somewhere the visitor may go; for 401 and 403 it is the same door that just refused them.
99
+ * Every error page offers a way out: it draws no Shell, so there is nothing else to press. A
100
+ * missing page goes to the root of its own Area, which the visitor may open. A refusal goes to
101
+ * the Site's public home instead -- the Area's root is the same door that just refused them.
103
102
  */
104
- homeLink: code === 404,
103
+ homeLink: true,
104
+ homeLinkTarget: code === 404 ? "area" : "site",
105
105
  },
106
106
  }),
107
107
  ],
@@ -10,7 +10,7 @@ import { PHI_SIGNAL_VALUE_SCHEMAS } from "../../../../../types/signals";
10
10
  import { createPhiThemeControllerAddress } from "../../../../../plugins/runtime-modules/theme/controller/address";
11
11
  import { PHI_THEME_SIGNAL_CHANNELS } from "../../../../../plugins/runtime-modules/theme/controller/signals";
12
12
  import { PHI_THEME_CUSTOM_COLOR_KEYS, isPhiThemePaletteModeSeedKey, mergePhiThemePalettes, resolvePhiThemeColorTokens, } from "../../../../../theme/phi-theme-presets";
13
- import { buildPhiThemeCustomColorPalette, resolvePhiThemePaletteCustomColors } from "../../../../../theme/phi-theme-palette";
13
+ import { buildPhiThemeCustomColorPalette, buildPhiThemeCustomColorTokens, resolvePhiThemePaletteCustomColors, } from "../../../../../theme/phi-theme-palette";
14
14
  import { buildPhiThemeGradientTokens, PHI_THEME_GRADIENT_KEYS, readPhiThemeGradient, readPhiThemeGradientTextTone, readPhiThemeGradientKey, resolvePhiThemeGradients, resolvePhiThemeGradientText, resolvePhiThemeGradientContrast, resolvePhiThemeGradientAutoTextTone, resolvePhiThemeGradientInks, PHI_GRADIENT_HOVER_FILTER, } from "../../../../../theme/phi-theme-gradients";
15
15
  import { usePhiConfig } from "../../../../../components/root/phi-config-provider";
16
16
  import { usePhiThemeBlockCatalog } from "../../../../../components/root/phi-theme-block-catalog-provider";
@@ -534,11 +534,13 @@ function resolveBrandDraftAliasTokens(resolvedTheme, preset, mode, fonts = {}) {
534
534
  ...(fonts.body ? { fontFamily: fonts.body } : {}),
535
535
  ...(fonts.mono ? { fontFamilyCode: fonts.mono } : {}),
536
536
  });
537
- // The gradient slots and the primary Buttons' run, as the root lays them over its tokens.
537
+ // The custom colours, the gradient slots and the primary Buttons' run, as the root lays them over its tokens.
538
+ const mergedPalette = mergePhiThemePalettes(preset.palette, resolvedTheme.palette);
538
539
  return {
539
540
  ...aliasTokens,
541
+ ...buildPhiThemeCustomColorTokens(mergedPalette, mode),
540
542
  ...buildPhiThemeGradientTokens({
541
- gradients: mergePhiThemePalettes(preset.palette, resolvedTheme.palette).modes?.[mode]?.gradients,
543
+ gradients: mergedPalette.modes?.[mode]?.gradients,
542
544
  token: aliasTokens,
543
545
  primaryButtonGradient: readPhiThemeGradientKey(resolvedTheme.buttons?.primaryGradient),
544
546
  }),
@@ -427,7 +427,7 @@ export async function buildPhiDefaultThreadsPageTree({ page, runtime, area, }) {
427
427
  sorting: { mode: "none" },
428
428
  search: { enabled: false },
429
429
  // An inbox goes stale by itself: the messages that change it are written by other people.
430
- tools: { mode: "self-contained", reload: true },
430
+ tools: { mode: "self-contained", reset: false, reload: true },
431
431
  /*
432
432
  * Two of the three filters the resource declares. `kind` is left out deliberately: this
433
433
  * Page is every conversation a person is in, and a Site that wants one kind pins it in the
@@ -474,14 +474,15 @@ export async function buildPhiDefaultThreadsPageTree({ page, runtime, area, }) {
474
474
  * second opinion about it.
475
475
  */
476
476
  /*
477
- * Named rather than drawn. Only one of the two is ever on a row, so there is no column of
478
- * repeated buttons to compress -- and the icon vocabulary has no mark for archiving that
479
- * does not already mean deleting or retiring, which is the one thing this must not say.
477
+ * Drawn, with the name in the tooltip, like every other row action. Archiving is the inbox
478
+ * tray -- put away, not deleted -- and reopening the step back out of it. Only one of the two
479
+ * is ever on a row, so both are icons or the column changes width from row to row.
480
480
  */
481
481
  row: [{
482
482
  key: "archive",
483
483
  label: labels.actions.archive,
484
- display: "label",
484
+ icon: "antd:inbox",
485
+ display: "icon",
485
486
  execution: "provider",
486
487
  confirm: {
487
488
  title: labels.actions.archiveConfirmTitle,
@@ -492,7 +493,8 @@ export async function buildPhiDefaultThreadsPageTree({ page, runtime, area, }) {
492
493
  }, {
493
494
  key: "reopen",
494
495
  label: labels.actions.reopen,
495
- display: "label",
496
+ icon: "antd:rollback",
497
+ display: "icon",
496
498
  execution: "provider",
497
499
  }],
498
500
  },
@@ -294,7 +294,7 @@ export async function buildPhiDefaultAdminUsersPageTree({ page, runtime, }) {
294
294
  { key: "lastLoginAt", fieldKey: "lastLoginAt", title: widgetLabels.columns.lastLogin, renderer: "datetime", sizing: { mode: "content" }, sortable: true },
295
295
  { key: "createdAt", fieldKey: "createdAt", title: widgetLabels.columns.created, renderer: "datetime", sizing: { mode: "content" }, sortable: true },
296
296
  ],
297
- emptyState: widgetLabels.empty,
297
+ emptyState: { title: widgetLabels.empty.title, description: widgetLabels.empty.text },
298
298
  footer: {
299
299
  template: widgetLabels.footer,
300
300
  values: [
@@ -79,26 +79,20 @@ const loadPhiCmsRootScopeCached = cache(async function loadPhiCmsRootScopeCached
79
79
  const { request, cookieHeader } = await loadPhiCmsServerRequest(cmsBridge, root, path);
80
80
  const effectivePath = path && path.length > 0 ? path : derivePathSegmentsFromRequestPath(root, request.pathname);
81
81
  const resolvedRoute = await resolveCmsRootRoute(root, effectivePath, bridgeRuntime);
82
- const baseRequestContext = await loadPhiSiteRequestContext(siteKey, resolvedRoute.locale, cookieHeader, bridgeRuntime?.apiBaseUrl, bridgeRuntime?.internalToken);
83
- const requestContext = await resolvePhiCmsThemeReviewRequestContext({
84
- requestContext: baseRequestContext,
85
- searchParams: request.searchParams,
86
- cookieHeader,
87
- });
88
82
  const resolvedAreaMask = resolvePhiCmsAreaMask(resolvedRoute.area);
89
83
  const review = resolvePhiCmsReviewParams(request.searchParams);
90
- const runtime = buildPhiBlockRuntime({
91
- requestContext,
92
- areaMask: resolvedAreaMask,
93
- request,
94
- });
95
- setPhiRequestRuntime(runtime);
96
84
  const descriptorCatalog = resolvePhiCmsDescriptorCatalog(cmsBridge.runtimeModuleCatalog);
97
85
  const areaShellBinding = resolvePhiCmsAreaShellPresetBinding(descriptorCatalog, resolvedRoute.area);
98
86
  if (!areaShellBinding) {
99
87
  throw new Error(`Area "${resolvedRoute.area}" has no shell preset binding.`);
100
88
  }
101
- const exactAreaPreset = await getPhiExactSiteArea({
89
+ /*
90
+ * The stored Area needs the route, the cookie and the review, none of which the request context
91
+ * supplies, so its read starts here and travels beside the context's. A failure is kept for the
92
+ * `await` below; the empty handler only stops it from being reported as unhandled when the context
93
+ * read fails first and that `await` is never reached.
94
+ */
95
+ const exactAreaPresetRead = getPhiExactSiteArea({
102
96
  path: resolvedRoute.cmsPath,
103
97
  apiBaseUrl: bridgeRuntime?.apiBaseUrl,
104
98
  internalToken: bridgeRuntime?.internalToken,
@@ -112,6 +106,20 @@ const loadPhiCmsRootScopeCached = cache(async function loadPhiCmsRootScopeCached
112
106
  presetKey: areaShellBinding.descriptor.presetKey,
113
107
  },
114
108
  });
109
+ exactAreaPresetRead.catch(() => undefined);
110
+ const baseRequestContext = await loadPhiSiteRequestContext(siteKey, resolvedRoute.locale, cookieHeader, bridgeRuntime?.apiBaseUrl, bridgeRuntime?.internalToken);
111
+ const requestContext = await resolvePhiCmsThemeReviewRequestContext({
112
+ requestContext: baseRequestContext,
113
+ searchParams: request.searchParams,
114
+ cookieHeader,
115
+ });
116
+ const runtime = buildPhiBlockRuntime({
117
+ requestContext,
118
+ areaMask: resolvedAreaMask,
119
+ request,
120
+ });
121
+ setPhiRequestRuntime(runtime);
122
+ const exactAreaPreset = await exactAreaPresetRead;
115
123
  /*
116
124
  * The code-owned Shell only where the Site has none stored. Building it beside the read, to save the
117
125
  * round trip on a Site that never saved its Area, cost every other Site a full Shell instantiation --
@@ -41,7 +41,6 @@ async function getPhiCmsRuntimeInfo({ apiBaseUrl, internalToken, siteKey, cookie
41
41
  defaultLocale: site.defaultLocale,
42
42
  sourceLocale: site.sourceLocale,
43
43
  timeZone: site.timeZone,
44
- store: site.store,
45
44
  themeRevision: site.themeRevision,
46
45
  /*
47
46
  * The Theme record whole, with the mode decided: a Site that never chose one is light, which is the
@@ -698,11 +698,22 @@ h5.phi-typography, .phi-typography h5 {
698
698
  color: var(--ant-color-text);
699
699
  }
700
700
 
701
+ /*
702
+ * No syllable breaks in a cell: a column is narrow by nature, and running text's `hyphens: auto` cut its
703
+ * words into pieces there. A cell breaks between words, and a word longer than its column still breaks
704
+ * rather than running into the next.
705
+ */
701
706
  .phi-plain-table th,
702
707
  .phi-plain-table td {
703
708
  padding: var(--ant-padding-xs) var(--ant-padding-sm);
704
709
  text-align: start;
705
710
  vertical-align: top;
711
+ hyphens: manual;
712
+ }
713
+
714
+ /* A column of short entries stays on one line; the scroll box above takes what does not fit. */
715
+ .phi-plain-table .phi-plain-table__nowrap {
716
+ white-space: nowrap;
706
717
  }
707
718
 
708
719
  .phi-plain-table th {
package/styles/shell.css CHANGED
@@ -626,8 +626,14 @@
626
626
  * and stands at the inline start, off screen, until `PhiShellSiderDrawer` marks the Shell open. The
627
627
  * `!important`s win over the Region's inline geometry, which is the column's. Fixed inside the Shell
628
628
  * means fixed to the Shell, a container: `--phi-shell-sider-drawer-top` moves it to the viewport's top.
629
+ *
630
+ * The button is portalled into `header_main`, and a Region's children are `display: flex` by a rule of
631
+ * two classes (`.shell-sider-full .phi-shell-region > *`). One class lost to it: the button stood under
632
+ * the brand on every width. Both display rules for the button are therefore stated through the Region
633
+ * as well, three classes, so the width decides and not the order of the sheet.
629
634
  * ---------------------------------------------------------------------------------------------- */
630
635
  .phi-shell-sider-drawer-button,
636
+ .phi-shell-region > .phi-shell-sider-drawer-button.phi-shell-sider-drawer-button,
631
637
  .phi-shell-sider-drawer-mask {
632
638
  display: none;
633
639
  }
@@ -690,8 +696,12 @@
690
696
  background: var(--ant-color-bg-mask);
691
697
  }
692
698
 
693
- .phi-shell-sider-drawer-button {
699
+ .phi-shell-sider-drawer-button,
700
+ .phi-shell-region > .phi-shell-sider-drawer-button.phi-shell-sider-drawer-button {
694
701
  display: inline-flex;
702
+ }
703
+
704
+ .phi-shell-sider-drawer-button {
695
705
  position: absolute;
696
706
  inset-inline-start: var(--ant-padding-xs);
697
707
  top: 50%;
@@ -5,15 +5,28 @@
5
5
  * `usePhiConfig().token` when they need the resolved value in JavaScript.
6
6
  */
7
7
  export declare const PHI_COLOR: {
8
- readonly primary: "var(--ant-color-primary)";
8
+ readonly primaryBg: "var(--ant-color-primary-bg)";
9
+ readonly primaryBgHover: "var(--ant-color-primary-bg-hover)";
10
+ readonly primaryBorder: "var(--ant-color-primary-border)";
11
+ readonly primaryBorderHover: "var(--ant-color-primary-border-hover)";
9
12
  readonly primaryHover: "var(--ant-color-primary-hover)";
13
+ readonly primary: "var(--ant-color-primary)";
10
14
  readonly primaryActive: "var(--ant-color-primary-active)";
15
+ readonly primaryTextHover: "var(--ant-color-primary-text-hover)";
16
+ readonly primaryText: "var(--ant-color-primary-text)";
17
+ readonly primaryTextActive: "var(--ant-color-primary-text-active)";
11
18
  readonly link: "var(--ant-color-link)";
12
19
  readonly linkHover: "var(--ant-color-link-hover)";
20
+ readonly textBase: "var(--ant-color-text-base)";
13
21
  readonly text: "var(--ant-color-text)";
14
22
  readonly textSecondary: "var(--ant-color-text-secondary)";
15
23
  readonly textTertiary: "var(--ant-color-text-tertiary)";
24
+ readonly textQuaternary: "var(--ant-color-text-quaternary)";
16
25
  readonly textHeading: "var(--ant-color-text-heading)";
26
+ readonly textLabel: "var(--ant-color-text-label)";
27
+ readonly textDescription: "var(--ant-color-text-description)";
28
+ readonly textPlaceholder: "var(--ant-color-text-placeholder)";
29
+ readonly textDisabled: "var(--ant-color-text-disabled)";
17
30
  readonly textLightSolid: "var(--ant-color-text-light-solid)";
18
31
  readonly bgContainer: "var(--ant-color-bg-container)";
19
32
  readonly bgLayout: "var(--ant-color-bg-layout)";
@@ -30,6 +43,16 @@ export declare const PHI_COLOR: {
30
43
  readonly error: "var(--ant-color-error)";
31
44
  readonly success: "var(--ant-color-success)";
32
45
  readonly warning: "var(--ant-color-warning)";
46
+ readonly custom1: "var(--ant-phi-custom-1)";
47
+ readonly custom2: "var(--ant-phi-custom-2)";
48
+ readonly custom3: "var(--ant-phi-custom-3)";
49
+ readonly custom4: "var(--ant-phi-custom-4)";
50
+ readonly custom5: "var(--ant-phi-custom-5)";
51
+ readonly custom6: "var(--ant-phi-custom-6)";
52
+ readonly custom7: "var(--ant-phi-custom-7)";
53
+ readonly custom8: "var(--ant-phi-custom-8)";
54
+ readonly custom9: "var(--ant-phi-custom-9)";
55
+ readonly custom10: "var(--ant-phi-custom-10)";
33
56
  };
34
57
  /**
35
58
  * Every distance a Phi surface states, inside a frame (`padding`) and between two things (`gap`), on the
@@ -5,15 +5,33 @@
5
5
  * `usePhiConfig().token` when they need the resolved value in JavaScript.
6
6
  */
7
7
  export const PHI_COLOR = {
8
- primary: "var(--ant-color-primary)",
8
+ /*
9
+ * The primary colour's ladder, as the Theme derives it per mode -- the same ten the colour picker offers
10
+ * as the Theme's primary swatches, so a colour picked there is stored as its role and follows the Theme.
11
+ */
12
+ primaryBg: "var(--ant-color-primary-bg)",
13
+ primaryBgHover: "var(--ant-color-primary-bg-hover)",
14
+ primaryBorder: "var(--ant-color-primary-border)",
15
+ primaryBorderHover: "var(--ant-color-primary-border-hover)",
9
16
  primaryHover: "var(--ant-color-primary-hover)",
17
+ primary: "var(--ant-color-primary)",
10
18
  primaryActive: "var(--ant-color-primary-active)",
19
+ primaryTextHover: "var(--ant-color-primary-text-hover)",
20
+ primaryText: "var(--ant-color-primary-text)",
21
+ primaryTextActive: "var(--ant-color-primary-text-active)",
11
22
  link: "var(--ant-color-link)",
12
23
  linkHover: "var(--ant-color-link-hover)",
24
+ /* The text ladder, likewise the picker's text swatches. */
25
+ textBase: "var(--ant-color-text-base)",
13
26
  text: "var(--ant-color-text)",
14
27
  textSecondary: "var(--ant-color-text-secondary)",
15
28
  textTertiary: "var(--ant-color-text-tertiary)",
29
+ textQuaternary: "var(--ant-color-text-quaternary)",
16
30
  textHeading: "var(--ant-color-text-heading)",
31
+ textLabel: "var(--ant-color-text-label)",
32
+ textDescription: "var(--ant-color-text-description)",
33
+ textPlaceholder: "var(--ant-color-text-placeholder)",
34
+ textDisabled: "var(--ant-color-text-disabled)",
17
35
  textLightSolid: "var(--ant-color-text-light-solid)",
18
36
  bgContainer: "var(--ant-color-bg-container)",
19
37
  bgLayout: "var(--ant-color-bg-layout)",
@@ -30,6 +48,20 @@ export const PHI_COLOR = {
30
48
  error: "var(--ant-color-error)",
31
49
  success: "var(--ant-color-success)",
32
50
  warning: "var(--ant-color-warning)",
51
+ /*
52
+ * The palette's ten custom colours, per mode, written by the Theme as tokens of its own
53
+ * (`phiCustom1` ... `phiCustom10`, theme/phi-theme-palette.ts).
54
+ */
55
+ custom1: "var(--ant-phi-custom-1)",
56
+ custom2: "var(--ant-phi-custom-2)",
57
+ custom3: "var(--ant-phi-custom-3)",
58
+ custom4: "var(--ant-phi-custom-4)",
59
+ custom5: "var(--ant-phi-custom-5)",
60
+ custom6: "var(--ant-phi-custom-6)",
61
+ custom7: "var(--ant-phi-custom-7)",
62
+ custom8: "var(--ant-phi-custom-8)",
63
+ custom9: "var(--ant-phi-custom-9)",
64
+ custom10: "var(--ant-phi-custom-10)",
33
65
  };
34
66
  /**
35
67
  * Every distance a Phi surface states, inside a frame (`padding`) and between two things (`gap`), on the
@@ -13,4 +13,10 @@ export declare function buildPhiThemeCustomColorPalette(seedColor: string): PhiT
13
13
  export declare function resolvePhiThemePaletteCustomColors(palette: PhiThemePalette | null | undefined, mode: PhiThemeMode): PhiThemeCustomColorPalette;
14
14
  /** The custom colours a Site renders: the palette it follows with the Site's own palette on top. */
15
15
  export declare function resolvePhiPublishedThemeCustomColors(siteTheme: PhiThemeCustomColorSource, mode: PhiThemeMode, presets: readonly PhiThemePresetPlugin[]): PhiThemeCustomColorPalette;
16
+ /**
17
+ * The custom colours of one mode as tokens of the Theme's own, laid over the resolved ones like the
18
+ * gradient slots, so Ant Design writes them per mode and per Surface tone (`--ant-phi-custom-1` ...) and a
19
+ * config can name one by its role (`PHI_COLOR.custom1`) instead of copying its value.
20
+ */
21
+ export declare function buildPhiThemeCustomColorTokens(palette: PhiThemePalette | null | undefined, mode: PhiThemeMode): Record<string, string>;
16
22
  export {};
@@ -30,3 +30,16 @@ export function resolvePhiPublishedThemeCustomColors(siteTheme, mode, presets) {
30
30
  const preset = resolvePhiThemePresetPlugin(presets, siteTheme.preset);
31
31
  return resolvePhiThemePaletteCustomColors(mergePhiThemePalettes(preset.palette, siteTheme.palette), mode);
32
32
  }
33
+ /** The token a custom colour rides as, and so the custom property Ant Design writes for it. */
34
+ function resolvePhiThemeCustomColorTokenName(key) {
35
+ return `phiCustom${key.slice("custom".length)}`;
36
+ }
37
+ /**
38
+ * The custom colours of one mode as tokens of the Theme's own, laid over the resolved ones like the
39
+ * gradient slots, so Ant Design writes them per mode and per Surface tone (`--ant-phi-custom-1` ...) and a
40
+ * config can name one by its role (`PHI_COLOR.custom1`) instead of copying its value.
41
+ */
42
+ export function buildPhiThemeCustomColorTokens(palette, mode) {
43
+ const colors = resolvePhiThemePaletteCustomColors(palette, mode);
44
+ return Object.fromEntries(PHI_THEME_CUSTOM_COLOR_KEYS.map((key) => [resolvePhiThemeCustomColorTokenName(key), colors[key]]));
45
+ }
@@ -37,9 +37,10 @@ export declare const PHI_THEME_TOKEN_KEYS: readonly ["colorBgContainer", "colorB
37
37
  *
38
38
  * The `phiGradient*` names are the Theme's gradient slots and the primary Buttons' run
39
39
  * (theme/phi-theme-gradients.ts): tokens of this package's own, laid over the resolved ones so Ant
40
- * Design writes them per mode and per Surface tone like every other.
40
+ * Design writes them per mode and per Surface tone like every other. The `phiCustom*` names are the
41
+ * palette's custom colours, laid over the same way (theme/phi-theme-palette.ts).
41
42
  */
42
- export declare const PHI_THEME_OWN_TOKEN_KEYS: readonly ["paddingXXL", "phiGradient1", "phiGradient1Text", "phiGradient2", "phiGradient2Text", "phiGradient3", "phiGradient3Text", "phiPrimaryButtonGradient", "phiPrimaryButtonGradientHover", "phiPrimaryButtonGradientActive", "phiPrimaryButtonGradientText"];
43
+ export declare const PHI_THEME_OWN_TOKEN_KEYS: readonly ["paddingXXL", "phiGradient1", "phiGradient1Text", "phiGradient2", "phiGradient2Text", "phiGradient3", "phiGradient3Text", "phiPrimaryButtonGradient", "phiPrimaryButtonGradientHover", "phiPrimaryButtonGradientActive", "phiPrimaryButtonGradientText", "phiCustom1", "phiCustom2", "phiCustom3", "phiCustom4", "phiCustom5", "phiCustom6", "phiCustom7", "phiCustom8", "phiCustom9", "phiCustom10"];
43
44
  export type PhiThemeTokenKey = (typeof PHI_THEME_TOKEN_KEYS)[number];
44
45
  /**
45
46
  * The resolved Theme, in the names above and their Ant Design value types.
@@ -165,7 +165,8 @@ export const PHI_THEME_TOKEN_KEYS = [
165
165
  *
166
166
  * The `phiGradient*` names are the Theme's gradient slots and the primary Buttons' run
167
167
  * (theme/phi-theme-gradients.ts): tokens of this package's own, laid over the resolved ones so Ant
168
- * Design writes them per mode and per Surface tone like every other.
168
+ * Design writes them per mode and per Surface tone like every other. The `phiCustom*` names are the
169
+ * palette's custom colours, laid over the same way (theme/phi-theme-palette.ts).
169
170
  */
170
171
  export const PHI_THEME_OWN_TOKEN_KEYS = [
171
172
  "paddingXXL",
@@ -179,6 +180,16 @@ export const PHI_THEME_OWN_TOKEN_KEYS = [
179
180
  "phiPrimaryButtonGradientHover",
180
181
  "phiPrimaryButtonGradientActive",
181
182
  "phiPrimaryButtonGradientText",
183
+ "phiCustom1",
184
+ "phiCustom2",
185
+ "phiCustom3",
186
+ "phiCustom4",
187
+ "phiCustom5",
188
+ "phiCustom6",
189
+ "phiCustom7",
190
+ "phiCustom8",
191
+ "phiCustom9",
192
+ "phiCustom10",
182
193
  ];
183
194
  /**
184
195
  * The colours a palette seeds, shared by both modes.