@phis/ui 0.4.16 → 0.4.18

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 (110) hide show
  1. package/README.md +1 -1
  2. package/components/cms/phi-cms-render-error-boundary.d.ts +8 -0
  3. package/components/cms/phi-cms-render-error-boundary.js +2 -1
  4. package/components/controls/phi-table-control.js +15 -0
  5. package/components/forms/compound-form-controls.js +2 -1
  6. package/components/widgets/label-sets/observability-logs.d.ts +2 -0
  7. package/components/widgets/label-sets/observability-logs.js +4 -0
  8. package/components/widgets/label-sets/search.js +2 -0
  9. package/components/widgets/label-types/search.d.ts +2 -0
  10. package/components/widgets/label-types/search.js +1 -0
  11. package/constants/cms-widget-types.js +3 -2
  12. package/helpers/site-runtime.js +3 -0
  13. package/module-references.d.ts +19 -0
  14. package/module-references.js +18 -0
  15. package/net/log.d.ts +1 -0
  16. package/net/log.js +19 -1
  17. package/net/phi-next-proxy.js +9 -1
  18. package/package.json +6 -1
  19. package/plugins/runtime-modules/app/presets.js +0 -23
  20. package/plugins/runtime-modules/area-contributions/app.d.ts +1 -1
  21. package/plugins/runtime-modules/area-contributions/app.js +2 -0
  22. package/plugins/runtime-modules/area-contributions/public.d.ts +1 -1
  23. package/plugins/runtime-modules/area-contributions/public.js +2 -0
  24. package/plugins/runtime-modules/area-module-defaults.js +21 -2
  25. package/plugins/runtime-modules/builder/render-root-node-scaffold.js +54 -54
  26. package/plugins/runtime-modules/client-authoring-providers/app.d.ts +1 -1
  27. package/plugins/runtime-modules/client-authoring-providers/app.js +6 -0
  28. package/plugins/runtime-modules/client-authoring-providers/public.d.ts +1 -1
  29. package/plugins/runtime-modules/client-authoring-providers/public.js +6 -0
  30. package/plugins/runtime-modules/client-manifests/common.js +2 -2
  31. package/plugins/runtime-modules/core/authoring-widgets.js +0 -4
  32. package/plugins/runtime-modules/core/widgets/collection-view/asset-binding.js +1 -1
  33. package/plugins/runtime-modules/core/widgets/markdown-toc/client.js +1 -1
  34. package/plugins/runtime-modules/core/widgets/table/client.js +7 -5
  35. package/plugins/runtime-modules/core/widgets/table/config.js +8 -1
  36. package/plugins/runtime-modules/core/widgets/tree/client.js +1 -1
  37. package/plugins/runtime-modules/core/widgets.js +0 -17
  38. package/plugins/runtime-modules/groups/trees/group-tables.d.ts +44 -0
  39. package/plugins/runtime-modules/groups/trees/group-tables.js +150 -0
  40. package/plugins/runtime-modules/groups/trees/phi-default-admin-groups-page-tree.js +28 -136
  41. package/plugins/runtime-modules/groups/trees/phi-default-app-groups-page-tree.js +9 -106
  42. package/plugins/runtime-modules/localization/trees/phi-default-admin-locales-page-tree.js +17 -5
  43. package/plugins/runtime-modules/observability/data-providers.d.ts +9 -0
  44. package/plugins/runtime-modules/observability/data-providers.js +5 -0
  45. package/plugins/runtime-modules/observability/definition.d.ts +9 -0
  46. package/plugins/runtime-modules/observability/module.d.ts +9 -0
  47. package/plugins/runtime-modules/observability/services/table.js +4 -0
  48. package/plugins/runtime-modules/observability/trees/phi-default-admin-logs-page-tree.js +13 -0
  49. package/plugins/runtime-modules/phi-default-site-area-preset-tree.js +21 -0
  50. package/plugins/runtime-modules/preset-contracts/pub-area.d.ts +1 -1
  51. package/plugins/runtime-modules/preset-contracts/pub-area.js +1 -0
  52. package/plugins/runtime-modules/public/presets.d.ts +0 -16
  53. package/plugins/runtime-modules/public/presets.js +0 -22
  54. package/plugins/runtime-modules/public-base-page-references.d.ts +0 -1
  55. package/plugins/runtime-modules/public-base-page-references.js +0 -1
  56. package/plugins/runtime-modules/search/authoring-widgets.d.ts +2 -0
  57. package/plugins/runtime-modules/search/authoring-widgets.js +8 -0
  58. package/plugins/runtime-modules/search/authoring.d.ts +1 -0
  59. package/plugins/runtime-modules/search/authoring.js +8 -0
  60. package/plugins/runtime-modules/search/definition.d.ts +21 -0
  61. package/plugins/runtime-modules/search/definition.js +23 -0
  62. package/plugins/runtime-modules/search/ids.d.ts +6 -0
  63. package/plugins/runtime-modules/search/ids.js +7 -0
  64. package/plugins/runtime-modules/search/module.d.ts +10 -0
  65. package/plugins/runtime-modules/search/module.js +4 -0
  66. package/plugins/runtime-modules/search/page-references.d.ts +8 -0
  67. package/plugins/runtime-modules/search/page-references.js +17 -0
  68. package/plugins/runtime-modules/{search-page-tree.d.ts → search/page-tree.d.ts} +1 -1
  69. package/plugins/runtime-modules/{search-page-tree.js → search/page-tree.js} +9 -7
  70. package/plugins/runtime-modules/search/presets.d.ts +12 -0
  71. package/plugins/runtime-modules/search/presets.js +33 -0
  72. package/plugins/runtime-modules/search/server.d.ts +1 -0
  73. package/plugins/runtime-modules/search/server.js +16 -0
  74. package/plugins/runtime-modules/search/widgets/search-box/authoring.d.ts +8 -0
  75. package/plugins/runtime-modules/search/widgets/search-box/authoring.js +21 -0
  76. package/plugins/runtime-modules/search/widgets/search-box/client.d.ts +39 -0
  77. package/plugins/runtime-modules/search/widgets/search-box/client.js +114 -0
  78. package/plugins/runtime-modules/search/widgets/search-box/config.d.ts +96 -0
  79. package/plugins/runtime-modules/search/widgets/search-box/config.js +67 -0
  80. package/plugins/runtime-modules/{core → search}/widgets/search-box/plugin.js +1 -4
  81. package/plugins/runtime-modules/search/widgets/search-box/server.d.ts +15 -0
  82. package/plugins/runtime-modules/{core → search}/widgets/search-box/server.js +13 -14
  83. package/plugins/runtime-modules/{core → search}/widgets/search-results/config.d.ts +0 -1
  84. package/plugins/runtime-modules/{core → search}/widgets/search-results/config.js +0 -1
  85. package/plugins/runtime-modules/{core → search}/widgets/search-results/plugin.js +1 -3
  86. package/plugins/runtime-modules/{core → search}/widgets/search-results/server.d.ts +1 -2
  87. package/plugins/runtime-modules/{core → search}/widgets/search-results/server.js +2 -2
  88. package/plugins/runtime-modules/search/widgets.d.ts +2 -0
  89. package/plugins/runtime-modules/search/widgets.js +20 -0
  90. package/server-helpers/search-index.js +9 -0
  91. package/styles/shell.css +142 -0
  92. package/theme/phi-theme-tokens.d.ts +1 -1
  93. package/theme/phi-theme-tokens.js +2 -0
  94. package/types/table-widget.d.ts +10 -1
  95. package/types/table-widget.js +1 -0
  96. package/plugins/runtime-modules/core/widgets/search-box/authoring.d.ts +0 -6
  97. package/plugins/runtime-modules/core/widgets/search-box/authoring.js +0 -10
  98. package/plugins/runtime-modules/core/widgets/search-box/client.d.ts +0 -21
  99. package/plugins/runtime-modules/core/widgets/search-box/client.js +0 -17
  100. package/plugins/runtime-modules/core/widgets/search-box/config.d.ts +0 -63
  101. package/plugins/runtime-modules/core/widgets/search-box/config.js +0 -48
  102. package/plugins/runtime-modules/core/widgets/search-box/server.d.ts +0 -21
  103. package/plugins/runtime-modules/search-page-references.d.ts +0 -20
  104. package/plugins/runtime-modules/search-page-references.js +0 -35
  105. /package/plugins/runtime-modules/{core → search}/widgets/search-box/plugin.d.ts +0 -0
  106. /package/plugins/runtime-modules/{core → search}/widgets/search-results/authoring.d.ts +0 -0
  107. /package/plugins/runtime-modules/{core → search}/widgets/search-results/authoring.js +0 -0
  108. /package/plugins/runtime-modules/{core → search}/widgets/search-results/client.d.ts +0 -0
  109. /package/plugins/runtime-modules/{core → search}/widgets/search-results/client.js +0 -0
  110. /package/plugins/runtime-modules/{core → search}/widgets/search-results/plugin.d.ts +0 -0
package/README.md CHANGED
@@ -73,7 +73,7 @@ The root export (`@phis/ui`) is not an integration surface; import from the grou
73
73
  | --- | --- |
74
74
  | Next.js Site | `next/config` (`withPhiNextConfig` for the Site's `next.config`), `next/area-route`, `next/areas/<area>`, `next/areas/<area>-client`, `next/root-route`, `next/root-error-page`, `next/global-error`, `next/site-bridge`, `next/site-proxy`, `next/proxy-runtime`, `next/route-handlers`, `next/seo-routes`, `next/overlay-zones`, `next/overlay-zones-client`, `next/cache-handler`, `next/runtime-module-client-boundary` |
75
75
  | CMS rendering | `cms`, `cms/root-layout`, `cms/root-page`, `cms/root-slot-page`, `cms/error-page`, `cms/request`, `cms/plugins`, `cms/plugins/<area>` |
76
- | Module packages | `module`, `module/client`, `module/authoring-client`, `module/labels`, `module/dashboard-cards`, `module/records`, `module/projection`, `module/projection/client`, `module/projection/authoring-client`, `module/site-modules`, `module/site-modules-client` |
76
+ | Module packages | `module`, `module/client`, `module/authoring-client`, `module/labels`, `module/dashboard-cards`, `module/records`, `module/references`, `module/projection`, `module/projection/client`, `module/projection/authoring-client`, `module/site-modules`, `module/site-modules-client` |
77
77
  | Runtime Clients | `runtime`, `runtime/controller-client`, `runtime/render-client`, `runtime/signal-client`, `runtime/data-provider-client`, `runtime/authoring-client`, `runtime/authoring-manifest-client`, `runtime/calendar-adapter-client`, `runtime/user-state-client`, `runtime/client-manifests/<area>` |
78
78
  | UI | `widgets`, `core-widgets`, `widget-config`, `controls`, `controls/config`, `controls/date-time`, `layouts`, `shells`, `root`, `navigation`, `forms`, `forms/client`, `media`, `references`, `state`, `theme` |
79
79
  | Builder | `builder-api-route` |
@@ -6,6 +6,14 @@ export type PhiCmsRenderErrorBoundaryProps = {
6
6
  blockId?: PhiCmsInstanceId | null;
7
7
  typeKey?: string | null;
8
8
  moduleId?: PhiCmsRenderIssue["moduleId"];
9
+ /**
10
+ * Where the diagnostic of a failed render is drawn, for a host that frames its nodes.
11
+ *
12
+ * The Builder draws every node in a scaffold that selects and removes it, and that scaffold is part
13
+ * of what failed. Handed the diagnostic, the host frames it again, so a node that throws can still
14
+ * be taken out of the tree it broke.
15
+ */
16
+ renderDiagnostic?: (diagnostic: ReactNode) => ReactNode;
9
17
  children: ReactNode;
10
18
  };
11
19
  type PhiCmsRenderErrorBoundaryState = {
@@ -20,7 +20,7 @@ export class PhiCmsRenderErrorBoundary extends Component {
20
20
  }
21
21
  render() {
22
22
  if (this.state.error) {
23
- return _jsx(PhiCmsRenderDiagnostic, { issue: {
23
+ const diagnostic = _jsx(PhiCmsRenderDiagnostic, { issue: {
24
24
  code: resolvePhiRenderFailureCode(this.state.error),
25
25
  kind: this.props.kind,
26
26
  type: this.props.typeKey ?? "unknown",
@@ -28,6 +28,7 @@ export class PhiCmsRenderErrorBoundary extends Component {
28
28
  moduleId: this.props.moduleId,
29
29
  detail: this.state.error.message,
30
30
  } });
31
+ return this.props.renderDiagnostic ? this.props.renderDiagnostic(diagnostic) : diagnostic;
31
32
  }
32
33
  return this.props.children;
33
34
  }
@@ -337,6 +337,21 @@ function EditableTableCell({ value, editor, onCommit }) {
337
337
  // A row that offers its own choices: the value can only be one of them.
338
338
  return _jsx(PhiSelectControl, { value: typeof draft === "string" && draft ? draft : undefined, disabled: disabled, size: "small", variant: variant, options: editor.options ?? [], style: { width: "100%" }, onChange: (next) => { draftRef.current = next; setDraft(next); onCommit(next); } });
339
339
  }
340
+ if (editor.type === "string" && editor.control === "textarea") {
341
+ /*
342
+ * Several lines in a cell: the area is as tall as its text, so a long value wraps instead of
343
+ * running out of the column. Enter still commits, as in every other cell; Shift+Enter is the line
344
+ * break. No clear glyph -- it would stand over the first line's end.
345
+ */
346
+ return _jsx(PhiTextControl, { presentation: "textarea", autoSize: { minRows: 1 }, value: typeof draft === "string" ? draft : "", variant: variant, disabled: disabled, size: "small", style: { width: "100%" }, onChange: (next) => { draftRef.current = next; setDraft(next); }, onBlur: commitOnBlur, onKeyDown: (event) => {
347
+ if (event.key !== "Enter" || event.shiftKey || event.nativeEvent.isComposing)
348
+ return;
349
+ event.preventDefault();
350
+ skipNextBlurRef.current = true;
351
+ commit();
352
+ event.currentTarget.blur();
353
+ } });
354
+ }
340
355
  return _jsx(PhiTextControl, { value: typeof draft === "string" ? draft : "", variant: variant, inputRef: textInputRef, disabled: disabled, allowClear: !editor.required, size: "small", style: { width: "100%" }, onChange: (next) => { draftRef.current = next; setDraft(next); }, onBlur: commitOnBlur, onPressEnter: () => {
341
356
  skipNextBlurRef.current = true;
342
357
  commit();
@@ -75,7 +75,8 @@ function readTableCellEditor(value) {
75
75
  editor.control === "segmented" ||
76
76
  editor.control === "multi-select" ||
77
77
  editor.control === "checkbox-group" ||
78
- editor.control === "icon-picker"
78
+ editor.control === "icon-picker" ||
79
+ editor.control === "textarea"
79
80
  ? editor.control
80
81
  : undefined,
81
82
  required: editor.required === true,
@@ -48,4 +48,6 @@ export declare function getPhiObservabilityLogsWidgetLabels(options: PhiGlobalTr
48
48
  title: string;
49
49
  text: string;
50
50
  };
51
+ countFooter: string;
52
+ truncatedFooter: string;
51
53
  }>;
@@ -40,6 +40,8 @@ const PHI_OBSERVABILITY_LOGS_WIDGET_LABEL_SET = definePhiLabelSet({
40
40
  detail_status: "Status",
41
41
  empty_title: definePhiMessageLabel("No logs found."),
42
42
  empty_text: definePhiMessageLabel("Adjust the filters or extend the time window."),
43
+ count_footer: definePhiMessageLabel("%1 entries found."),
44
+ truncated_footer: definePhiMessageLabel("%1 entries found. Only the newest %2 of this time window were read; choose a shorter window to see the older ones."),
43
45
  },
44
46
  });
45
47
  export async function getPhiObservabilityLogsWidgetLabels(options) {
@@ -92,5 +94,7 @@ export async function getPhiObservabilityLogsWidgetLabels(options) {
92
94
  title: labels.empty_title,
93
95
  text: labels.empty_text,
94
96
  },
97
+ countFooter: labels.count_footer,
98
+ truncatedFooter: labels.truncated_footer,
95
99
  };
96
100
  }
@@ -11,6 +11,7 @@ const PHI_SEARCH_WIDGET_LABEL_SET = definePhiLabelSet({
11
11
  aria_label: PHI_SEARCH_WIDGET_DEFAULT_LABELS.ariaLabel,
12
12
  clear_label: PHI_SEARCH_WIDGET_DEFAULT_LABELS.clearLabel,
13
13
  submit_label: PHI_SEARCH_WIDGET_DEFAULT_LABELS.submitLabel,
14
+ close_label: PHI_SEARCH_WIDGET_DEFAULT_LABELS.closeLabel,
14
15
  },
15
16
  });
16
17
  export async function getPhiSearchWidgetLabels(options) {
@@ -21,5 +22,6 @@ export async function getPhiSearchWidgetLabels(options) {
21
22
  ariaLabel: labels.aria_label,
22
23
  clearLabel: labels.clear_label,
23
24
  submitLabel: labels.submit_label,
25
+ closeLabel: labels.close_label,
24
26
  };
25
27
  }
@@ -4,5 +4,7 @@ export type PhiSearchWidgetLabels = {
4
4
  ariaLabel: string;
5
5
  clearLabel: string;
6
6
  submitLabel: string;
7
+ /** The magnifier's way back: the phone's search row closes without searching. */
8
+ closeLabel: string;
7
9
  };
8
10
  export declare const PHI_SEARCH_WIDGET_DEFAULT_LABELS: PhiSearchWidgetLabels;
@@ -4,4 +4,5 @@ export const PHI_SEARCH_WIDGET_DEFAULT_LABELS = {
4
4
  ariaLabel: "Search input",
5
5
  clearLabel: "Clear search",
6
6
  submitLabel: "Search",
7
+ closeLabel: "Close search",
7
8
  };
@@ -18,6 +18,7 @@ const PHI_CMS_WIDGET_PLUGIN_KEYS = {
18
18
  "core": `${PHI_CMS_WIDGET_PLUGIN_KEY_BASE}/core/widgets`,
19
19
  "news": `${PHI_CMS_WIDGET_PLUGIN_KEY_BASE}/news/widgets`,
20
20
  "observability": `${PHI_CMS_WIDGET_PLUGIN_KEY_BASE}/observability/widgets`,
21
+ "search": `${PHI_CMS_WIDGET_PLUGIN_KEY_BASE}/search/widgets`,
21
22
  "theme": `${PHI_CMS_WIDGET_PLUGIN_KEY_BASE}/theme/widgets`,
22
23
  "threads": `${PHI_CMS_WIDGET_PLUGIN_KEY_BASE}/threads/widgets`,
23
24
  "video": `${PHI_CMS_WIDGET_PLUGIN_KEY_BASE}/video/widgets`,
@@ -101,8 +102,8 @@ const PHI_CMS_WIDGET_MODULE_BY_TYPE_KEY = {
101
102
  "record": "core",
102
103
  "rate": "core",
103
104
  "result": "core",
104
- "search-box": "core",
105
- "search-results": "core",
105
+ "search-box": "search",
106
+ "search-results": "search",
106
107
  "segmented": "core",
107
108
  "select-box": "core",
108
109
  "sidebar-navigation": "core",
@@ -1,6 +1,7 @@
1
1
  import "server-only";
2
2
  import { existsSync, readFileSync } from "node:fs";
3
3
  import path from "node:path";
4
+ import { notePhiLogSiteKey } from "../net/log";
4
5
  const DEFAULT_TIMEOUT_MS = 8000;
5
6
  function asObject(value) {
6
7
  return value && typeof value === "object" ? value : {};
@@ -62,6 +63,8 @@ export function readPhiSiteRuntimeConfigSync() {
62
63
  },
63
64
  };
64
65
  siteRuntimeConfig = { configPath, value };
66
+ // Every record this process writes belongs to this Site (net/log.ts).
67
+ notePhiLogSiteKey(value.site.key);
65
68
  return value;
66
69
  }
67
70
  export function getPhiInternalApiTimeoutMs() {
@@ -0,0 +1,19 @@
1
+ /**
2
+ * What a Module package needs to resolve a Page target it chose while rendering, and nothing else
3
+ * (REFERENCES.md, "Resolving a target a Widget chose itself").
4
+ *
5
+ * A render's targets are resolved once, before anything draws, from what the stored configs name; a
6
+ * Widget is handed the answers as `links`. A target the Widget decides on while it renders is not among
7
+ * them -- the Search Box leading to the results Page of the Area it stands in, a shop's Basket leading to
8
+ * the cart of that Area -- because no config says it. This is the resolver the render itself uses, for
9
+ * exactly those: one round trip for the targets handed to it, answered per Area as every link is.
10
+ *
11
+ * Narrow for the reason `@phis/ui/module/labels` is: a package outside this one reads it from the Server
12
+ * half every route of the Site imports, and the `server-helpers` barrel would bring `cms-root` and
13
+ * `next/headers` along. The first-party Modules import `server-helpers/cms-link-targets` by its path.
14
+ *
15
+ * Turning an answer into an address is `resolvePhiLinkHref` from `@phis/ui/references`, as for `links`.
16
+ */
17
+ import "server-only";
18
+ export { resolvePhiLinkTargetReferences } from "./server-helpers/cms-link-targets";
19
+ export type { PhiLinkTargetReference } from "./helpers/link-target";
@@ -0,0 +1,18 @@
1
+ /**
2
+ * What a Module package needs to resolve a Page target it chose while rendering, and nothing else
3
+ * (REFERENCES.md, "Resolving a target a Widget chose itself").
4
+ *
5
+ * A render's targets are resolved once, before anything draws, from what the stored configs name; a
6
+ * Widget is handed the answers as `links`. A target the Widget decides on while it renders is not among
7
+ * them -- the Search Box leading to the results Page of the Area it stands in, a shop's Basket leading to
8
+ * the cart of that Area -- because no config says it. This is the resolver the render itself uses, for
9
+ * exactly those: one round trip for the targets handed to it, answered per Area as every link is.
10
+ *
11
+ * Narrow for the reason `@phis/ui/module/labels` is: a package outside this one reads it from the Server
12
+ * half every route of the Site imports, and the `server-helpers` barrel would bring `cms-root` and
13
+ * `next/headers` along. The first-party Modules import `server-helpers/cms-link-targets` by its path.
14
+ *
15
+ * Turning an answer into an address is `resolvePhiLinkHref` from `@phis/ui/references`, as for `links`.
16
+ */
17
+ import "server-only";
18
+ export { resolvePhiLinkTargetReferences } from "./server-helpers/cms-link-targets";
package/net/log.d.ts CHANGED
@@ -1,3 +1,4 @@
1
1
  export type { PhiLogEvent, PhiLogLevel, PhiLogService, PhiLogger, PhiLoggerContext, } from "@phis/contracts/logging";
2
2
  import type { PhiLogEvent, PhiLogLevel, PhiLoggerContext } from "@phis/contracts/logging";
3
+ export declare function notePhiLogSiteKey(siteKey: string): void;
3
4
  export declare function logRuntimeEvent(level: PhiLogLevel, event: string, input?: PhiLogEvent & Partial<PhiLoggerContext>): void;
package/net/log.js CHANGED
@@ -30,13 +30,31 @@ function emit(level, payload) {
30
30
  }
31
31
  console.info(line);
32
32
  }
33
+ /*
34
+ * The Site this process serves, stamped on every record that does not name one.
35
+ *
36
+ * A Site process serves exactly one Site, but its callers almost never passed `siteKey`, so nearly every
37
+ * record carried null and the Site's admin log, which shows only that Site's records, came up empty. The
38
+ * Site's runtime reader notes the key when it reads the configuration (`notePhiLogSiteKey`); in the browser
39
+ * nothing does, and a record there stays as it was. Kept on `globalThis` because the server bundles this
40
+ * file once per layer, and the key noted in one layer must be read in the others.
41
+ */
42
+ const PHI_LOG_SITE_KEY = Symbol.for("phis.log.siteKey");
43
+ export function notePhiLogSiteKey(siteKey) {
44
+ if (siteKey)
45
+ globalThis[PHI_LOG_SITE_KEY] = siteKey;
46
+ }
47
+ function readNotedSiteKey() {
48
+ const value = globalThis[PHI_LOG_SITE_KEY];
49
+ return typeof value === "string" ? value : null;
50
+ }
33
51
  function normalizeContext(context) {
34
52
  if (!context.service) {
35
53
  throw new Error("Logger service is required.");
36
54
  }
37
55
  return {
38
56
  service: context.service,
39
- siteKey: context.siteKey ?? null,
57
+ siteKey: context.siteKey ?? readNotedSiteKey(),
40
58
  area: context.area ?? null,
41
59
  requestId: context.requestId ?? null,
42
60
  userId: context.userId ?? null,
@@ -155,8 +155,16 @@ async function proxyRequest(request, path, config) {
155
155
  },
156
156
  });
157
157
  }
158
+ /*
159
+ * How loud a status is depends on what it says. A 5xx is the Server failing: an error. A 409 is a write
160
+ * the Server refused because it collides with what is there -- someone tried something and it did not
161
+ * happen: a warning. Every other 4xx is the Server answering as designed -- no draft is a 404, a visitor
162
+ * who is not signed in a 401 on every page -- and warned about, those buried the rest under hundreds of
163
+ * lines a day. They stay in the log as debug, where a search for one request finds them.
164
+ */
158
165
  if (!targetResponse.ok) {
159
- logRuntimeEvent("warn", "proxy.request.unhealthy_response", {
166
+ const level = targetResponse.status >= 500 ? "error" : targetResponse.status === 409 ? "warn" : "debug";
167
+ logRuntimeEvent(level, "proxy.request.unhealthy_response", {
160
168
  area: "proxy",
161
169
  message: "Proxy upstream responded with a non-OK status.",
162
170
  method: request.method,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@phis/ui",
3
- "version": "0.4.16",
3
+ "version": "0.4.18",
4
4
  "license": "Apache-2.0",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -282,6 +282,11 @@
282
282
  "import": "./module-records.js",
283
283
  "default": "./module-records.js"
284
284
  },
285
+ "./module/references": {
286
+ "types": "./module-references.d.ts",
287
+ "import": "./module-references.js",
288
+ "default": "./module-references.js"
289
+ },
285
290
  "./module/projection": {
286
291
  "types": "./module-projection.d.ts",
287
292
  "import": "./module-projection.js",
@@ -1,7 +1,5 @@
1
1
  import { PHI_BASE_PAGE_LAYOUT_VERSION } from "../../../components/regions/presets/phi-base-page-layout";
2
- import { PhiCmsFlags } from "../../../constants/phi-cms";
3
2
  import { buildPhiAreaRootRoutePresetDescriptor } from "../area-root-route";
4
- import { PHI_APP_SEARCH_PAGE_PRESET_KEY } from "../search-page-references";
5
3
  import { PHI_APP_RUNTIME_MODULE_ID } from "./ids";
6
4
  /* What the App base Module brings: its Area shell, the Area root and the profile Page. */
7
5
  export const PHI_APP_RUNTIME_MODULE_AREA_SHELLS = [
@@ -66,25 +64,4 @@ export const PHI_APP_RUNTIME_MODULE_ROUTES = [
66
64
  loadTree: ({ page, runtime }) => import("./trees/phi-default-app-profile-page-tree")
67
65
  .then((module) => module.buildPhiDefaultAppProfilePageTree({ page, runtime })),
68
66
  },
69
- /*
70
- * The App's own results Page (SEARCH.md). A signed-in member searches the App and the Public Site
71
- * at once, and that is decided by where the results Widget stands: on this Page, in the App. The box
72
- * in the App's sider leads here. No menu entry and `NoIndex`, as for the Public one.
73
- */
74
- {
75
- ownerModuleId: PHI_APP_RUNTIME_MODULE_ID,
76
- presetKey: PHI_APP_SEARCH_PAGE_PRESET_KEY,
77
- presetVersion: 1,
78
- area: "app",
79
- title: "Search",
80
- path: "/search",
81
- navigation: [],
82
- defaultPageFlags: PhiCmsFlags.NoIndex,
83
- loadTree: ({ page }) => import("../search-page-tree")
84
- .then((module) => module.buildPhiDefaultSearchPageTree({
85
- page,
86
- ownerModuleId: PHI_APP_RUNTIME_MODULE_ID,
87
- presetKey: PHI_APP_SEARCH_PAGE_PRESET_KEY,
88
- })),
89
- },
90
67
  ];
@@ -1 +1 @@
1
- export declare const PHI_APP_RUNTIME_MODULE_AREA_CONTRIBUTIONS: readonly [import("../area-contributions").PhiRuntimeModuleServerAreaContribution, import("../area-contributions").PhiRuntimeModuleServerAreaContribution, import("../area-contributions").PhiRuntimeModuleServerAreaContribution, import("../area-contributions").PhiRuntimeModuleServerAreaContribution, import("../area-contributions").PhiRuntimeModuleServerAreaContribution, import("../area-contributions").PhiRuntimeModuleServerAreaContribution, import("../area-contributions").PhiRuntimeModuleServerAreaContribution, import("../area-contributions").PhiRuntimeModuleServerAreaContribution, import("../area-contributions").PhiRuntimeModuleServerAreaContribution, import("../area-contributions").PhiRuntimeModuleServerAreaContribution];
1
+ export declare const PHI_APP_RUNTIME_MODULE_AREA_CONTRIBUTIONS: readonly [import("../area-contributions").PhiRuntimeModuleServerAreaContribution, import("../area-contributions").PhiRuntimeModuleServerAreaContribution, import("../area-contributions").PhiRuntimeModuleServerAreaContribution, import("../area-contributions").PhiRuntimeModuleServerAreaContribution, import("../area-contributions").PhiRuntimeModuleServerAreaContribution, import("../area-contributions").PhiRuntimeModuleServerAreaContribution, import("../area-contributions").PhiRuntimeModuleServerAreaContribution, import("../area-contributions").PhiRuntimeModuleServerAreaContribution, import("../area-contributions").PhiRuntimeModuleServerAreaContribution, import("../area-contributions").PhiRuntimeModuleServerAreaContribution, import("../area-contributions").PhiRuntimeModuleServerAreaContribution];
@@ -4,6 +4,7 @@ import { createPhiDashboardRuntimeModuleServerAreaContribution } from "../dashbo
4
4
  import { createPhiGroupsRuntimeModuleServerAreaContribution } from "../groups/server";
5
5
  import { createPhiAuthRuntimeModuleServerAreaContribution } from "../auth/server";
6
6
  import { createPhiVideoRuntimeModuleServerAreaContribution } from "../video/server";
7
+ import { createPhiSearchRuntimeModuleServerAreaContribution } from "../search/server";
7
8
  import { PHI_APP_RUNTIME_MODULE_SERVER_AREA_CONTRIBUTION } from "../app/server";
8
9
  export const PHI_APP_RUNTIME_MODULE_AREA_CONTRIBUTIONS = [
9
10
  ...createPhiCommonRuntimeModuleServerAreaContributions(),
@@ -12,5 +13,6 @@ export const PHI_APP_RUNTIME_MODULE_AREA_CONTRIBUTIONS = [
12
13
  createPhiGroupsRuntimeModuleServerAreaContribution(),
13
14
  createPhiAvatarRuntimeModuleServerAreaContribution(),
14
15
  createPhiVideoRuntimeModuleServerAreaContribution(),
16
+ createPhiSearchRuntimeModuleServerAreaContribution(),
15
17
  PHI_APP_RUNTIME_MODULE_SERVER_AREA_CONTRIBUTION,
16
18
  ];
@@ -1 +1 @@
1
- export declare const PHI_PUBLIC_RUNTIME_MODULE_AREA_CONTRIBUTIONS: readonly [import("../area-contributions").PhiRuntimeModuleServerAreaContribution, import("../area-contributions").PhiRuntimeModuleServerAreaContribution, import("../area-contributions").PhiRuntimeModuleServerAreaContribution, import("../area-contributions").PhiRuntimeModuleServerAreaContribution, import("../area-contributions").PhiRuntimeModuleServerAreaContribution, import("../area-contributions").PhiRuntimeModuleServerAreaContribution, import("../area-contributions").PhiRuntimeModuleServerAreaContribution, import("../area-contributions").PhiRuntimeModuleServerAreaContribution, import("../area-contributions").PhiRuntimeModuleServerAreaContribution];
1
+ export declare const PHI_PUBLIC_RUNTIME_MODULE_AREA_CONTRIBUTIONS: readonly [import("../area-contributions").PhiRuntimeModuleServerAreaContribution, import("../area-contributions").PhiRuntimeModuleServerAreaContribution, import("../area-contributions").PhiRuntimeModuleServerAreaContribution, import("../area-contributions").PhiRuntimeModuleServerAreaContribution, import("../area-contributions").PhiRuntimeModuleServerAreaContribution, import("../area-contributions").PhiRuntimeModuleServerAreaContribution, import("../area-contributions").PhiRuntimeModuleServerAreaContribution, import("../area-contributions").PhiRuntimeModuleServerAreaContribution, import("../area-contributions").PhiRuntimeModuleServerAreaContribution, import("../area-contributions").PhiRuntimeModuleServerAreaContribution];
@@ -4,6 +4,7 @@ import { createPhiNewsRuntimeModuleServerAreaContribution } from "../news/server
4
4
  import { createPhiBlogRuntimeModuleServerAreaContribution } from "../blog/server";
5
5
  import { PHI_PUBLIC_RUNTIME_MODULE_SERVER_AREA_CONTRIBUTION } from "../public/server";
6
6
  import { createPhiVideoRuntimeModuleServerAreaContribution } from "../video/server";
7
+ import { createPhiSearchRuntimeModuleServerAreaContribution } from "../search/server";
7
8
  export const PHI_PUBLIC_RUNTIME_MODULE_AREA_CONTRIBUTIONS = [
8
9
  ...createPhiCommonRuntimeModuleServerAreaContributions(),
9
10
  PHI_PUBLIC_RUNTIME_MODULE_SERVER_AREA_CONTRIBUTION,
@@ -11,4 +12,5 @@ export const PHI_PUBLIC_RUNTIME_MODULE_AREA_CONTRIBUTIONS = [
11
12
  createPhiNewsRuntimeModuleServerAreaContribution(),
12
13
  createPhiBlogRuntimeModuleServerAreaContribution(),
13
14
  createPhiVideoRuntimeModuleServerAreaContribution(),
15
+ createPhiSearchRuntimeModuleServerAreaContribution(),
14
16
  ];
@@ -15,18 +15,37 @@ const PHI_USER_MANAGEMENT_RUNTIME_MODULE_ID = firstPartyModuleId("user-managemen
15
15
  const PHI_DASHBOARD_RUNTIME_MODULE_ID = firstPartyModuleId("dashboard");
16
16
  const PHI_NEWS_RUNTIME_MODULE_ID = firstPartyModuleId("news");
17
17
  const PHI_REVISIONS_RUNTIME_MODULE_ID = firstPartyModuleId("revisions");
18
+ /*
19
+ * The Site's search starts on where it is read (SEARCH.md): the Public header carries its magnifier and
20
+ * the App's sider its box, and both go with the Module when a Site switches it off.
21
+ */
22
+ const PHI_SEARCH_RUNTIME_MODULE_ID = firstPartyModuleId("search");
18
23
  /*
19
24
  * Conversations are a Site's communication system, so every Area with a sidebar starts with them: the
20
25
  * Area ships the Page and its sidebar offers the entry, and a default without the Module would offer an
21
26
  * entry leading nowhere. Public has neither.
22
27
  */
23
28
  const PHI_THREADS_RUNTIME_MODULE_ID = firstPartyModuleId("threads");
29
+ /*
30
+ * Tours explain the working Areas, so every Area but Public starts with the Module that runs them: the
31
+ * Pages carry their Tours either way, and without it their buttons stay hidden. Public has no Tour to give.
32
+ */
33
+ const PHI_TOUR_RUNTIME_MODULE_ID = firstPartyModuleId("tour");
24
34
  export function createPhiDefaultAreaRuntimeModuleIds(area) {
35
+ const moduleIds = listAreaRuntimeModuleIds(area);
36
+ return area === "public" ? moduleIds : [...moduleIds, PHI_TOUR_RUNTIME_MODULE_ID];
37
+ }
38
+ function listAreaRuntimeModuleIds(area) {
25
39
  if (area === "public") {
26
- return [PHI_AUTH_RUNTIME_MODULE_ID];
40
+ return [PHI_AUTH_RUNTIME_MODULE_ID, PHI_SEARCH_RUNTIME_MODULE_ID];
27
41
  }
28
42
  if (area === "app") {
29
- return [PHI_AUTH_RUNTIME_MODULE_ID, PHI_DASHBOARD_RUNTIME_MODULE_ID, PHI_THREADS_RUNTIME_MODULE_ID];
43
+ return [
44
+ PHI_AUTH_RUNTIME_MODULE_ID,
45
+ PHI_DASHBOARD_RUNTIME_MODULE_ID,
46
+ PHI_THREADS_RUNTIME_MODULE_ID,
47
+ PHI_SEARCH_RUNTIME_MODULE_ID,
48
+ ];
30
49
  }
31
50
  if (area === "builder") {
32
51
  return [
@@ -61,86 +61,74 @@ function renderPhiLayoutInsertControl(control, resolveDropTarget, parentLayoutNo
61
61
  function renderPhiLayoutTitleControl(control) {
62
62
  return (_jsx(PhiInlineTextEditor, { autoFocus: true, variant: "underlined", value: control.value, onChange: control.onChange, onCommit: control.onCommit, onCancel: control.onCancel, collapsibleTitleControl: true, ariaLabel: control.ariaLabel, style: control.style }));
63
63
  }
64
- function PhiAuthoringWidgetLoader({ widget, config, slotSizePolicy, demandControllerContext, children, }) {
64
+ function PhiAuthoringWidgetLoader({ widget, config, slotSizePolicy, demandControllerContext, renderUnavailable, children, }) {
65
65
  const type = widget.widgetType;
66
66
  const blockId = widget.id;
67
67
  const activeModules = usePhiRuntimeModuleState();
68
68
  const definition = activeModules.widgetDefinitionsByType.get(type);
69
69
  const authoringModule = usePhiRuntimeModuleAuthoringRegistration(definition?.ownerModuleId);
70
+ const frameUnavailable = (diagnostic) => renderUnavailable ? renderUnavailable(diagnostic) : diagnostic;
71
+ const unavailable = (issue) => frameUnavailable(_jsx(PhiCmsRenderDiagnostic, { issue: { kind: "widget", type, blockId, ...issue } }));
70
72
  if (!definition) {
71
73
  const moduleIsInactive = !activeModules.widgetTypes.has(type);
72
- return _jsx(PhiCmsRenderDiagnostic, { issue: {
73
- code: moduleIsInactive ? "missing-module" : "missing-renderer",
74
- kind: "widget",
75
- type,
76
- blockId,
77
- detail: moduleIsInactive
78
- ? "No active Canvas module provides this widget type."
79
- : "Active widget metadata is unavailable in the Canvas runtime context.",
80
- } });
74
+ return unavailable({
75
+ code: moduleIsInactive ? "missing-module" : "missing-renderer",
76
+ detail: moduleIsInactive
77
+ ? "No active Canvas module provides this widget type."
78
+ : "Active widget metadata is unavailable in the Canvas runtime context.",
79
+ });
81
80
  }
82
81
  if (!activeModules.moduleIds.has(definition.ownerModuleId) ||
83
82
  !activeModules.widgetTypes.has(type)) {
84
- return _jsx(PhiCmsRenderDiagnostic, { issue: {
85
- code: "missing-module",
86
- kind: "widget",
87
- type,
88
- blockId,
89
- moduleId: definition.ownerModuleId,
90
- detail: "Widget owner module is not active in the current Canvas sandbox.",
91
- } });
83
+ return unavailable({
84
+ code: "missing-module",
85
+ moduleId: definition.ownerModuleId,
86
+ detail: "Widget owner module is not active in the current Canvas sandbox.",
87
+ });
92
88
  }
93
89
  if (!authoringModule) {
94
- return _jsx(PhiCmsRenderDiagnostic, { issue: {
95
- code: "missing-renderer",
96
- kind: "widget",
97
- type,
98
- blockId,
99
- moduleId: definition.ownerModuleId,
100
- detail: "Widget owner module does not provide its declared AuthoringClient.",
101
- } });
90
+ return unavailable({
91
+ code: "missing-renderer",
92
+ moduleId: definition.ownerModuleId,
93
+ detail: "Widget owner module does not provide its declared AuthoringClient.",
94
+ });
102
95
  }
103
96
  const WidgetModule = authoringModule.WidgetModule;
104
- return (_jsx(PhiCmsRenderErrorBoundary, { kind: "widget", blockId: blockId, typeKey: type, moduleId: definition.ownerModuleId, children: _jsx(Suspense, { fallback: (_jsx(PhiSlotChildFrame, { kind: "widget", slotSizePolicy: slotSizePolicy ?? definition.slotSizePolicy, surfacePolicy: definition.surface, blockId: null, config: config, disableEffects: true, runtimeSignalEmissionsEnabled: false, className: "phi-widget-authoring-loading", children: _jsx(PhiWidgetPreviewFallback, { widget: widget, pluginTitle: definition.title }) })), children: _jsx(WidgetModule, { type: type, children: (plugin) => plugin
97
+ return (_jsx(PhiCmsRenderErrorBoundary, { kind: "widget", blockId: blockId, typeKey: type, moduleId: definition.ownerModuleId, renderDiagnostic: renderUnavailable, children: _jsx(Suspense, { fallback: (_jsx(PhiSlotChildFrame, { kind: "widget", slotSizePolicy: slotSizePolicy ?? definition.slotSizePolicy, surfacePolicy: definition.surface, blockId: null, config: config, disableEffects: true, runtimeSignalEmissionsEnabled: false, className: "phi-widget-authoring-loading", children: _jsx(PhiWidgetPreviewFallback, { widget: widget, pluginTitle: definition.title }) })), children: _jsx(WidgetModule, { type: type, children: (plugin) => plugin
105
98
  ? demandControllerContext && plugin.requiredRuntimeControllers
106
99
  ? (_jsx(PhiBuilderDemandControllerRegistration, { area: demandControllerContext.area, ownerKey: demandControllerContext.ownerKey, ownerMountScope: demandControllerContext.ownerMountScope, pageKey: demandControllerContext.pageKey, widget: widget, tree: demandControllerContext.tree, plugin: plugin, children: children(plugin, definition) }))
107
100
  : children(plugin, definition)
108
- : _jsx(PhiCmsRenderDiagnostic, { issue: {
109
- code: "missing-renderer",
110
- kind: "widget",
111
- type,
112
- blockId,
113
- moduleId: definition.ownerModuleId,
114
- detail: "Widget is not registered in its owner module's authoring catalog.",
115
- } }) }) }) }));
101
+ : unavailable({
102
+ code: "missing-renderer",
103
+ moduleId: definition.ownerModuleId,
104
+ detail: "Widget is not registered in its owner module's authoring catalog.",
105
+ }) }) }) }));
116
106
  }
117
- function PhiAuthoringLayoutLoader({ type, kind, blockId, children, }) {
107
+ function PhiAuthoringLayoutLoader({ type, kind, blockId, renderUnavailable, children, }) {
118
108
  const activeModules = usePhiRuntimeModuleState();
119
109
  const layoutType = resolvePhiAuthoringLayoutType(type);
120
110
  const resolveLayoutDefinition = usePhiAuthoringLayoutDefinitionResolver();
121
111
  const definition = resolveLayoutDefinition(layoutType);
112
+ const unavailable = (issue) => {
113
+ const diagnostic = _jsx(PhiCmsRenderDiagnostic, { issue: { kind, type, blockId, ...issue } });
114
+ return renderUnavailable ? renderUnavailable(diagnostic) : diagnostic;
115
+ };
122
116
  if (!definition) {
123
- return _jsx(PhiCmsRenderDiagnostic, { issue: {
124
- code: "missing-renderer",
125
- kind,
126
- type,
127
- blockId,
128
- detail: "Layout does not provide a client authoring loader.",
129
- } });
117
+ return unavailable({
118
+ code: "missing-renderer",
119
+ detail: "Layout does not provide a client authoring loader.",
120
+ });
130
121
  }
131
122
  if (!activeModules.moduleIds.has(definition.ownerModuleId) ||
132
123
  !activeModules.layoutTypes.has(layoutType)) {
133
- return _jsx(PhiCmsRenderDiagnostic, { issue: {
134
- code: "missing-module",
135
- kind,
136
- type,
137
- blockId,
138
- moduleId: definition.ownerModuleId,
139
- detail: "Layout owner module is not active in the current Canvas sandbox.",
140
- } });
124
+ return unavailable({
125
+ code: "missing-module",
126
+ moduleId: definition.ownerModuleId,
127
+ detail: "Layout owner module is not active in the current Canvas sandbox.",
128
+ });
141
129
  }
142
130
  const LazyAuthoringLayout = definition.component;
143
- return (_jsx(PhiCmsRenderErrorBoundary, { kind: kind, blockId: blockId, typeKey: type, moduleId: definition.ownerModuleId, children: _jsx(Suspense, { fallback: null, children: _jsx(LazyAuthoringLayout, { children: (plugin) => children(plugin, definition, activeModules.widgetDefinitionsByType, resolveLayoutDefinition) }) }) }));
131
+ return (_jsx(PhiCmsRenderErrorBoundary, { kind: kind, blockId: blockId, typeKey: type, moduleId: definition.ownerModuleId, renderDiagnostic: renderUnavailable, children: _jsx(Suspense, { fallback: null, children: _jsx(LazyAuthoringLayout, { children: (plugin) => children(plugin, definition, activeModules.widgetDefinitionsByType, resolveLayoutDefinition) }) }) }));
144
132
  }
145
133
  function resolveRootNodeEditSlotAnchor(rootNode) {
146
134
  return rootNode.editSlotAnchor ?? undefined;
@@ -636,7 +624,7 @@ function resolvePhiRootNodeRenderedBody(rootNode, renderMode, plugin, definition
636
624
  const renderWidgetNode = (widget) => {
637
625
  const renderableBlockConfig = mergeRenderableBlockDefaults(widget.config);
638
626
  const widgetViewportFlags = intersectPhiInheritedViewportFlags(resolvedViewportFlags, widget.config.viewportFlags);
639
- return (_jsx(PhiAuthoringWidgetLoader, { widget: widget, config: { ...renderableBlockConfig, renderMode: "editor" }, slotSizePolicy: widgetDefinitionsByType.get(widget.widgetType)?.slotSizePolicy, demandControllerContext: demandControllerContext, children: (plugin, definition) => {
627
+ return (_jsx(PhiAuthoringWidgetLoader, { widget: widget, config: { ...renderableBlockConfig, renderMode: "editor" }, slotSizePolicy: widgetDefinitionsByType.get(widget.widgetType)?.slotSizePolicy, demandControllerContext: demandControllerContext, renderUnavailable: renderMode === "editor" && onDeleteWidgetNode ? (diagnostic) => (_jsx(PhiWidgetEffectsPreviewFrame, { kind: "widget", blockId: widget.id, regionKey: regionKey, config: { renderMode: "editor" }, title: widget.label ?? widget.widgetType, onSelect: () => undefined, tools: (_jsx(PhiLayoutDeleteButtonOverlay, { ariaLabel: `Delete ${widget.label ?? widget.widgetType}`, top: -10, bottom: "auto", transform: "translateY(-50%)", zIndex: 40, nodeKind: "widget", onDelete: () => onDeleteWidgetNode({ ...widget }) })), style: { position: "relative", zIndex: 30 }, children: diagnostic }, `widget-${widget.id}`)) : undefined, children: (plugin, definition) => {
640
628
  const resolvedConfig = plugin.parseConfig(widget.config ?? {});
641
629
  const widgetTypeTitle = plugin.title ?? widget.widgetType;
642
630
  const widgetTitle = widget.label ?? widgetTypeTitle;
@@ -870,7 +858,19 @@ export function renderPhiRootNodeScaffold(rootNode, onOpenInsert, onOpenInspecto
870
858
  renderInsertPicker: options?.renderInsertPicker,
871
859
  }) }));
872
860
  };
873
- const scaffold = (_jsx(PhiAuthoringLayoutLoader, { type: normalizedRootNode.typeKey, kind: "layout", blockId: normalizedRootNode.id ?? -1, children: (plugin, definition, widgetDefinitionsByType, resolveLayoutDefinition) => {
861
+ /*
862
+ * A Layout that cannot be drawn, framed like one that can: the drawer takes the click, so it stops at
863
+ * this Layout instead of selecting its parent, and its only tool removes it. Removing a Layout takes
864
+ * what is in it along, as it does from a Layout that draws.
865
+ */
866
+ const renderUnavailableRoot = typeof onDeleteRootNode === "function" && normalizedRootNode.id != null
867
+ ? (diagnostic) => (_jsx(PhiEditScaffoldDrawer, { className: "phi-builder-root-scaffold", kind: "layout", nodeId: normalizedRootNode.id, regionKey: regionKey, title: rootTitle, scaffoldLabel: formatLayoutScaffoldLabel(normalizedRootNode.typeKey, normalizedRootNode.kind, null, normalizedRootNode.title), onClick: () => undefined, chrome: (_jsx(PhiLayoutDeleteButtonOverlay, { ariaLabel: `Delete ${rootTitle}`, nodeKind: "layout", onDelete: () => onDeleteRootNode({
868
+ nodeId: normalizedRootNode.id ?? null,
869
+ nodeKey: normalizedRootNode.typeKey,
870
+ nodeKind: normalizedRootNode.kind,
871
+ }) })), children: diagnostic }))
872
+ : undefined;
873
+ const scaffold = (_jsx(PhiAuthoringLayoutLoader, { type: normalizedRootNode.typeKey, kind: "layout", blockId: normalizedRootNode.id ?? -1, renderUnavailable: renderUnavailableRoot, children: (plugin, definition, widgetDefinitionsByType, resolveLayoutDefinition) => {
874
874
  const rendered = resolvePhiRootNodeRenderedBody(normalizedRootNode, "editor", plugin, definition, widgetDefinitionsByType, regionKey, renderChildLayoutNodeWith(resolveLayoutDefinition), onDeleteRootNode
875
875
  ? (widget) => onDeleteRootNode({
876
876
  nodeId: widget.id,
@@ -1 +1 @@
1
- export declare const PHI_APP_RUNTIME_MODULE_AUTHORING_CLIENT_CONTRIBUTIONS: readonly [import("../authoring-contributions-client").PhiRuntimeModuleAuthoringClientContribution, import("../authoring-contributions-client").PhiRuntimeModuleAuthoringClientContribution, import("../authoring-contributions-client").PhiRuntimeModuleAuthoringClientContribution, import("../authoring-contributions-client").PhiRuntimeModuleAuthoringClientContribution, import("../authoring-contributions-client").PhiRuntimeModuleAuthoringClientContribution, import("../authoring-contributions-client").PhiRuntimeModuleAuthoringClientContribution, import("../authoring-contributions-client").PhiRuntimeModuleAuthoringClientContribution, import("../authoring-contributions-client").PhiRuntimeModuleAuthoringClientContribution, import("../authoring-contributions-client").PhiRuntimeModuleAuthoringClientContribution, import("../authoring-contributions-client").PhiRuntimeModuleAuthoringClientContribution];
1
+ export declare const PHI_APP_RUNTIME_MODULE_AUTHORING_CLIENT_CONTRIBUTIONS: readonly [import("../authoring-contributions-client").PhiRuntimeModuleAuthoringClientContribution, import("../authoring-contributions-client").PhiRuntimeModuleAuthoringClientContribution, import("../authoring-contributions-client").PhiRuntimeModuleAuthoringClientContribution, import("../authoring-contributions-client").PhiRuntimeModuleAuthoringClientContribution, import("../authoring-contributions-client").PhiRuntimeModuleAuthoringClientContribution, import("../authoring-contributions-client").PhiRuntimeModuleAuthoringClientContribution, import("../authoring-contributions-client").PhiRuntimeModuleAuthoringClientContribution, import("../authoring-contributions-client").PhiRuntimeModuleAuthoringClientContribution, import("../authoring-contributions-client").PhiRuntimeModuleAuthoringClientContribution, import("../authoring-contributions-client").PhiRuntimeModuleAuthoringClientContribution, import("../authoring-contributions-client").PhiRuntimeModuleAuthoringClientContribution];
@@ -5,6 +5,7 @@ import { PHI_AUTH_RUNTIME_MODULE_ID } from "../auth/ids";
5
5
  import { PHI_GROUPS_RUNTIME_MODULE_ID } from "../groups/ids";
6
6
  import { PHI_AVATAR_RUNTIME_MODULE_ID } from "../avatar/ids";
7
7
  import { PHI_VIDEO_RUNTIME_MODULE_ID } from "../video/ids";
8
+ import { PHI_SEARCH_RUNTIME_MODULE_ID } from "../search/ids";
8
9
  import { PHI_COMMON_RUNTIME_MODULE_AUTHORING_CLIENT_CONTRIBUTIONS } from "./common";
9
10
  import { PHI_DASHBOARD_RUNTIME_MODULE_AUTHORING_CLIENT_CONTRIBUTION } from "../dashboard/authoring-client";
10
11
  export const PHI_APP_RUNTIME_MODULE_AUTHORING_CLIENT_CONTRIBUTIONS = [
@@ -25,6 +26,11 @@ export const PHI_APP_RUNTIME_MODULE_AUTHORING_CLIENT_CONTRIBUTIONS = [
25
26
  loadAuthoring: () => import("../avatar/authoring")
26
27
  .then((module) => module.PhiAvatarRuntimeModuleAuthoringClient),
27
28
  }),
29
+ definePhiRuntimeModuleAuthoringClientContribution({
30
+ moduleId: PHI_SEARCH_RUNTIME_MODULE_ID,
31
+ loadAuthoring: () => import("../search/authoring")
32
+ .then((module) => module.PhiSearchRuntimeModuleAuthoringClient),
33
+ }),
28
34
  definePhiRuntimeModuleAuthoringClientContribution({
29
35
  moduleId: PHI_VIDEO_RUNTIME_MODULE_ID,
30
36
  loadAuthoring: () => import("../video/authoring")
@@ -1 +1 @@
1
- export declare const PHI_PUBLIC_RUNTIME_MODULE_AUTHORING_CLIENT_CONTRIBUTIONS: readonly [import("../authoring-contributions-client").PhiRuntimeModuleAuthoringClientContribution, import("../authoring-contributions-client").PhiRuntimeModuleAuthoringClientContribution, import("../authoring-contributions-client").PhiRuntimeModuleAuthoringClientContribution, import("../authoring-contributions-client").PhiRuntimeModuleAuthoringClientContribution, import("../authoring-contributions-client").PhiRuntimeModuleAuthoringClientContribution, import("../authoring-contributions-client").PhiRuntimeModuleAuthoringClientContribution, import("../authoring-contributions-client").PhiRuntimeModuleAuthoringClientContribution, import("../authoring-contributions-client").PhiRuntimeModuleAuthoringClientContribution, import("../authoring-contributions-client").PhiRuntimeModuleAuthoringClientContribution];
1
+ export declare const PHI_PUBLIC_RUNTIME_MODULE_AUTHORING_CLIENT_CONTRIBUTIONS: readonly [import("../authoring-contributions-client").PhiRuntimeModuleAuthoringClientContribution, import("../authoring-contributions-client").PhiRuntimeModuleAuthoringClientContribution, import("../authoring-contributions-client").PhiRuntimeModuleAuthoringClientContribution, import("../authoring-contributions-client").PhiRuntimeModuleAuthoringClientContribution, import("../authoring-contributions-client").PhiRuntimeModuleAuthoringClientContribution, import("../authoring-contributions-client").PhiRuntimeModuleAuthoringClientContribution, import("../authoring-contributions-client").PhiRuntimeModuleAuthoringClientContribution, import("../authoring-contributions-client").PhiRuntimeModuleAuthoringClientContribution, import("../authoring-contributions-client").PhiRuntimeModuleAuthoringClientContribution, import("../authoring-contributions-client").PhiRuntimeModuleAuthoringClientContribution];