@phis/ui 0.4.15 → 0.4.17

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 (120) hide show
  1. package/components/cms/phi-cms-layout-renderer.js +2 -1
  2. package/components/controls/phi-table-control.js +15 -0
  3. package/components/forms/compound-form-controls.js +2 -1
  4. package/components/regions/clients/cms-region-container-client.d.ts +3 -1
  5. package/components/regions/clients/cms-region-container-client.js +2 -1
  6. package/components/regions/phi-cms-region-container.d.ts +3 -1
  7. package/components/regions/phi-cms-region-container.js +3 -2
  8. package/components/regions/phi-cms-region-shell.d.ts +16 -1
  9. package/components/regions/phi-cms-region-shell.js +39 -10
  10. package/components/regions/phi-cms-region-static.d.ts +3 -1
  11. package/components/regions/phi-cms-region-static.js +2 -1
  12. package/components/widgets/label-sets/observability-logs.d.ts +2 -0
  13. package/components/widgets/label-sets/observability-logs.js +4 -0
  14. package/components/widgets/label-sets/search.js +2 -0
  15. package/components/widgets/label-types/search.d.ts +2 -0
  16. package/components/widgets/label-types/search.js +1 -0
  17. package/constants/cms-widget-types.js +3 -2
  18. package/helpers/renderable-block-defaults.js +1 -0
  19. package/helpers/renderable-block-serialization.js +7 -1
  20. package/helpers/site-runtime.js +3 -0
  21. package/net/log.d.ts +1 -0
  22. package/net/log.js +19 -1
  23. package/net/phi-next-proxy.js +9 -1
  24. package/package.json +2 -2
  25. package/plugins/runtime/phi-slot-child-viewport-effects-observer.js +13 -0
  26. package/plugins/runtime-modules/app/presets.js +0 -23
  27. package/plugins/runtime-modules/area-contributions/app.d.ts +1 -1
  28. package/plugins/runtime-modules/area-contributions/app.js +2 -0
  29. package/plugins/runtime-modules/area-contributions/public.d.ts +1 -1
  30. package/plugins/runtime-modules/area-contributions/public.js +2 -0
  31. package/plugins/runtime-modules/area-module-defaults.js +21 -2
  32. package/plugins/runtime-modules/builder/page-meta-form.js +11 -0
  33. package/plugins/runtime-modules/client-authoring-providers/app.d.ts +1 -1
  34. package/plugins/runtime-modules/client-authoring-providers/app.js +6 -0
  35. package/plugins/runtime-modules/client-authoring-providers/public.d.ts +1 -1
  36. package/plugins/runtime-modules/client-authoring-providers/public.js +6 -0
  37. package/plugins/runtime-modules/client-manifests/common.js +2 -2
  38. package/plugins/runtime-modules/core/authoring-widgets.js +0 -4
  39. package/plugins/runtime-modules/core/widgets/collection-view/asset-binding.js +1 -1
  40. package/plugins/runtime-modules/core/widgets/markdown-toc/client.js +1 -1
  41. package/plugins/runtime-modules/core/widgets/table/client.js +7 -5
  42. package/plugins/runtime-modules/core/widgets/table/config.js +8 -1
  43. package/plugins/runtime-modules/core/widgets/tree/client.js +1 -1
  44. package/plugins/runtime-modules/core/widgets.js +0 -17
  45. package/plugins/runtime-modules/groups/trees/group-tables.d.ts +44 -0
  46. package/plugins/runtime-modules/groups/trees/group-tables.js +150 -0
  47. package/plugins/runtime-modules/groups/trees/phi-default-admin-groups-page-tree.js +28 -136
  48. package/plugins/runtime-modules/groups/trees/phi-default-app-groups-page-tree.js +9 -106
  49. package/plugins/runtime-modules/localization/trees/phi-default-admin-locales-page-tree.js +17 -5
  50. package/plugins/runtime-modules/observability/data-providers.d.ts +9 -0
  51. package/plugins/runtime-modules/observability/data-providers.js +5 -0
  52. package/plugins/runtime-modules/observability/definition.d.ts +9 -0
  53. package/plugins/runtime-modules/observability/module.d.ts +9 -0
  54. package/plugins/runtime-modules/observability/services/table.js +4 -0
  55. package/plugins/runtime-modules/observability/trees/phi-default-admin-logs-page-tree.js +13 -0
  56. package/plugins/runtime-modules/phi-default-site-area-preset-tree.js +21 -0
  57. package/plugins/runtime-modules/preset-contracts/pub-area.d.ts +1 -1
  58. package/plugins/runtime-modules/preset-contracts/pub-area.js +1 -0
  59. package/plugins/runtime-modules/public/presets.d.ts +0 -16
  60. package/plugins/runtime-modules/public/presets.js +0 -22
  61. package/plugins/runtime-modules/public-base-page-references.d.ts +0 -1
  62. package/plugins/runtime-modules/public-base-page-references.js +0 -1
  63. package/plugins/runtime-modules/search/authoring-widgets.d.ts +2 -0
  64. package/plugins/runtime-modules/search/authoring-widgets.js +8 -0
  65. package/plugins/runtime-modules/search/authoring.d.ts +1 -0
  66. package/plugins/runtime-modules/search/authoring.js +8 -0
  67. package/plugins/runtime-modules/search/definition.d.ts +21 -0
  68. package/plugins/runtime-modules/search/definition.js +23 -0
  69. package/plugins/runtime-modules/search/ids.d.ts +6 -0
  70. package/plugins/runtime-modules/search/ids.js +7 -0
  71. package/plugins/runtime-modules/search/module.d.ts +10 -0
  72. package/plugins/runtime-modules/search/module.js +4 -0
  73. package/plugins/runtime-modules/search/page-references.d.ts +8 -0
  74. package/plugins/runtime-modules/search/page-references.js +17 -0
  75. package/plugins/runtime-modules/{search-page-tree.d.ts → search/page-tree.d.ts} +1 -1
  76. package/plugins/runtime-modules/{search-page-tree.js → search/page-tree.js} +9 -7
  77. package/plugins/runtime-modules/search/presets.d.ts +12 -0
  78. package/plugins/runtime-modules/search/presets.js +33 -0
  79. package/plugins/runtime-modules/search/server.d.ts +1 -0
  80. package/plugins/runtime-modules/search/server.js +16 -0
  81. package/plugins/runtime-modules/search/widgets/search-box/authoring.d.ts +8 -0
  82. package/plugins/runtime-modules/search/widgets/search-box/authoring.js +21 -0
  83. package/plugins/runtime-modules/search/widgets/search-box/client.d.ts +39 -0
  84. package/plugins/runtime-modules/search/widgets/search-box/client.js +114 -0
  85. package/plugins/runtime-modules/search/widgets/search-box/config.d.ts +96 -0
  86. package/plugins/runtime-modules/search/widgets/search-box/config.js +67 -0
  87. package/plugins/runtime-modules/{core → search}/widgets/search-box/plugin.js +1 -4
  88. package/plugins/runtime-modules/search/widgets/search-box/server.d.ts +15 -0
  89. package/plugins/runtime-modules/{core → search}/widgets/search-box/server.js +13 -14
  90. package/plugins/runtime-modules/{core → search}/widgets/search-results/config.d.ts +0 -1
  91. package/plugins/runtime-modules/{core → search}/widgets/search-results/config.js +0 -1
  92. package/plugins/runtime-modules/{core → search}/widgets/search-results/plugin.js +1 -3
  93. package/plugins/runtime-modules/{core → search}/widgets/search-results/server.d.ts +1 -2
  94. package/plugins/runtime-modules/{core → search}/widgets/search-results/server.js +2 -2
  95. package/plugins/runtime-modules/search/widgets.d.ts +2 -0
  96. package/plugins/runtime-modules/search/widgets.js +20 -0
  97. package/plugins/runtime-modules/theme/widgets/brand-controls/client.js +15 -1
  98. package/server-helpers/search-index.js +9 -0
  99. package/styles/root.css +2 -0
  100. package/styles/shell.css +178 -18
  101. package/theme/phi-theme-tokens.d.ts +1 -1
  102. package/theme/phi-theme-tokens.js +2 -0
  103. package/types/renderable-block.d.ts +5 -0
  104. package/types/table-widget.d.ts +10 -1
  105. package/types/table-widget.js +1 -0
  106. package/plugins/runtime-modules/core/widgets/search-box/authoring.d.ts +0 -6
  107. package/plugins/runtime-modules/core/widgets/search-box/authoring.js +0 -10
  108. package/plugins/runtime-modules/core/widgets/search-box/client.d.ts +0 -21
  109. package/plugins/runtime-modules/core/widgets/search-box/client.js +0 -17
  110. package/plugins/runtime-modules/core/widgets/search-box/config.d.ts +0 -63
  111. package/plugins/runtime-modules/core/widgets/search-box/config.js +0 -48
  112. package/plugins/runtime-modules/core/widgets/search-box/server.d.ts +0 -21
  113. package/plugins/runtime-modules/search-page-references.d.ts +0 -20
  114. package/plugins/runtime-modules/search-page-references.js +0 -35
  115. /package/plugins/runtime-modules/{core → search}/widgets/search-box/plugin.d.ts +0 -0
  116. /package/plugins/runtime-modules/{core → search}/widgets/search-results/authoring.d.ts +0 -0
  117. /package/plugins/runtime-modules/{core → search}/widgets/search-results/authoring.js +0 -0
  118. /package/plugins/runtime-modules/{core → search}/widgets/search-results/client.d.ts +0 -0
  119. /package/plugins/runtime-modules/{core → search}/widgets/search-results/client.js +0 -0
  120. /package/plugins/runtime-modules/{core → search}/widgets/search-results/plugin.d.ts +0 -0
@@ -321,6 +321,7 @@ export function validatePhiTableWidgetBinding(config, resource) {
321
321
  (field?.type === "enum" && (column.editor.control === "select" || column.editor.control === "radio" ||
322
322
  column.editor.control === "segmented")) ||
323
323
  (field?.type === "string" && Boolean(field.rowOptionsPath) && column.editor.control === "select") ||
324
+ (field?.type === "string" && column.editor.control === "textarea") ||
324
325
  (field?.type === "enum[]" && (column.editor.control === "multi-select" ||
325
326
  column.editor.control === "checkbox-group"));
326
327
  if (column.editor && !editorControlCompatible) {
@@ -1,6 +0,0 @@
1
- import { type PhiSearchBoxWidgetConfig } from "./config";
2
- /**
3
- * What the Builder says about a box that is a form the browser submits: where it leads, not a field to
4
- * type into on the canvas -- a submit there would leave the Builder for the results Page.
5
- */
6
- export declare const PHI_SEARCH_BOX_WIDGET_BUILDER_PLUGIN: import("../../../../../types").PhiCmsBuilderWidgetPlugin<PhiSearchBoxWidgetConfig>;
@@ -1,10 +0,0 @@
1
- "use client";
2
- import { Fragment as _Fragment, jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
3
- import { createPhiCmsBuilderWidgetPlugin } from "../../../../../plugins/factories/widget-builder-plugin";
4
- import { PhiWidgetEditorPlaceholder } from "../../../../../components/widgets/builder/widget-editor-placeholder";
5
- import { PHI_SEARCH_BOX_WIDGET_DEFINITION } from "./config";
6
- /**
7
- * What the Builder says about a box that is a form the browser submits: where it leads, not a field to
8
- * type into on the canvas -- a submit there would leave the Builder for the results Page.
9
- */
10
- export const PHI_SEARCH_BOX_WIDGET_BUILDER_PLUGIN = createPhiCmsBuilderWidgetPlugin(PHI_SEARCH_BOX_WIDGET_DEFINITION, ({ widget, config }) => (_jsx(PhiWidgetEditorPlaceholder, { widget: widget, pluginTitle: PHI_SEARCH_BOX_WIDGET_DEFINITION.title, summary: _jsxs(_Fragment, { children: ["A search field that sends what a visitor types to ", config?.linkTarget ? "the chosen results page" : "this Area's search page", config?.placeholder ? _jsxs(_Fragment, { children: ["; it reads \u201C", config.placeholder, "\u201D while empty"] }) : null, "."] }) })));
@@ -1,21 +0,0 @@
1
- import type { PhiSearchWidgetLabels } from "../../../../../components/widgets/label-types/search";
2
- import type { PhiClientBlockBaseProps } from "../../../../../types";
3
- import type { PhiControlSize } from "../../../../../types/control";
4
- export type PhiSearchBoxWidgetClientConfig = {
5
- /** The results Page, as the form's address. */
6
- action: string;
7
- placeholder: string;
8
- size?: PhiControlSize;
9
- /** The query the page is answering, so the box shows what was searched for. */
10
- initialQuery: string;
11
- };
12
- export type PhiSearchBoxWidgetClientProps = PhiClientBlockBaseProps<PhiSearchWidgetLabels, PhiSearchBoxWidgetClientConfig>;
13
- /**
14
- * A `GET` form around one search field (SEARCH.md).
15
- *
16
- * The browser submits it: Enter, or the keyboard's search key, sends `?q=` to the results Page without
17
- * a script, and a static Public page needs none. The field is the house's text Control with the form's
18
- * field name, so it clears, labels and sizes like every other field, and the form is a landmark a screen
19
- * reader lists.
20
- */
21
- export declare function PhiSearchBoxWidgetClient({ labels, config }: PhiSearchBoxWidgetClientProps): import("react").JSX.Element;
@@ -1,17 +0,0 @@
1
- "use client";
2
- import { jsx as _jsx } from "react/jsx-runtime";
3
- import { useState } from "react";
4
- import { PHI_SEARCH_QUERY_PARAM } from "@phis/contracts/search";
5
- import { PhiTextControl } from "../../../../../components/controls/phi-text-control";
6
- /**
7
- * A `GET` form around one search field (SEARCH.md).
8
- *
9
- * The browser submits it: Enter, or the keyboard's search key, sends `?q=` to the results Page without
10
- * a script, and a static Public page needs none. The field is the house's text Control with the form's
11
- * field name, so it clears, labels and sizes like every other field, and the form is a landmark a screen
12
- * reader lists.
13
- */
14
- export function PhiSearchBoxWidgetClient({ labels, config }) {
15
- const [draft, setDraft] = useState(config?.initialQuery ?? "");
16
- return (_jsx("form", { method: "get", action: config?.action, role: "search", "aria-label": labels.title, style: { width: "100%" }, children: _jsx(PhiTextControl, { name: PHI_SEARCH_QUERY_PARAM, inputType: "search", ariaLabel: labels.ariaLabel, placeholder: config?.placeholder || labels.placeholder, clearLabel: labels.clearLabel, size: config?.size, value: draft, onChange: (value) => setDraft(value ?? ""), onClear: () => setDraft(""), style: { width: "100%" } }) }));
17
- }
@@ -1,63 +0,0 @@
1
- import type { PhiControlSize } from "../../../../../types/control";
2
- import { type PhiLinkTarget } from "../../../../../types/references";
3
- import { type PhiCmsWidgetConfigBase } from "../../../../../components/widgets/config/parser-primitives";
4
- /**
5
- * The box a visitor types a search into (SEARCH.md).
6
- *
7
- * It is a form the browser submits: `GET` to the results Page, the query in the URL. So it works before
8
- * anything hydrated and in a static render, where no script has run yet; and the results Page reads the
9
- * same URL whether it was reached from here, from a bookmark or from a link somebody pasted.
10
- */
11
- export type PhiSearchBoxWidgetConfig = PhiCmsWidgetConfigBase & {
12
- /** What the empty box says; empty for the label set's word. The author's text, translated. */
13
- placeholder: string;
14
- /**
15
- * Where the query goes: a results Page, as a reference (REFERENCES.md). Absent, the Area's own search
16
- * Page -- the App's in App, the Public one everywhere else -- so a box dropped into a Page works
17
- * without being told where.
18
- */
19
- linkTarget?: PhiLinkTarget;
20
- /** The field's size; `size` is the block's own geometry and cannot be this. */
21
- controlSize?: PhiControlSize;
22
- };
23
- declare function normalizePhiSearchBoxWidgetConfig(raw: Record<string, unknown>): PhiSearchBoxWidgetConfig;
24
- export declare const PHI_SEARCH_BOX_WIDGET_DEFINITION: {
25
- kind: "widget";
26
- pluginKey: string;
27
- typeKey: string;
28
- title: string;
29
- description: string;
30
- category: "navigation";
31
- tags: string[];
32
- translatesOwnText: true;
33
- icon: string;
34
- slotSizePolicy: "fill-inline";
35
- fields: ({
36
- key: string;
37
- type: "string";
38
- label: string;
39
- description: string;
40
- heading?: undefined;
41
- options?: undefined;
42
- } | {
43
- key: string;
44
- type: "link-target";
45
- heading: string;
46
- label: string;
47
- description: string;
48
- options?: undefined;
49
- } | {
50
- key: string;
51
- type: "choice";
52
- label: string;
53
- options: {
54
- value: string;
55
- label: string;
56
- }[];
57
- description?: undefined;
58
- heading?: undefined;
59
- })[];
60
- defaultConfig: PhiSearchBoxWidgetConfig;
61
- parseConfig: typeof normalizePhiSearchBoxWidgetConfig;
62
- };
63
- export {};
@@ -1,48 +0,0 @@
1
- import { resolvePhiCmsWidgetPluginKey } from "../../../../../constants/cms-widget-types";
2
- import { readPhiLinkTarget } from "../../../../../types/references";
3
- import { readRenderableBlockConfig, readString, } from "../../../../../components/widgets/config/parser-primitives";
4
- const PHI_SEARCH_BOX_SIZES = ["small", "medium", "large"];
5
- function normalizePhiSearchBoxWidgetConfig(raw) {
6
- return {
7
- ...readRenderableBlockConfig(raw),
8
- placeholder: readString(raw.placeholder)?.trim() ?? "",
9
- linkTarget: readPhiLinkTarget(raw.linkTarget) ?? undefined,
10
- controlSize: PHI_SEARCH_BOX_SIZES.includes(raw.controlSize)
11
- ? raw.controlSize
12
- : undefined,
13
- };
14
- }
15
- export const PHI_SEARCH_BOX_WIDGET_DEFINITION = {
16
- kind: "widget",
17
- pluginKey: resolvePhiCmsWidgetPluginKey("search-box"),
18
- typeKey: "search-box",
19
- title: "Search Box",
20
- description: "A box that sends what a visitor types to the Site's search results page.",
21
- category: "navigation",
22
- tags: ["search", "find", "navigation"],
23
- translatesOwnText: true,
24
- icon: "antd:search",
25
- slotSizePolicy: "fill-inline",
26
- fields: [
27
- { key: "placeholder", type: "string", label: "Placeholder", description: "Empty shows \"Search\"." },
28
- {
29
- key: "linkTarget",
30
- type: "link-target",
31
- heading: "Results",
32
- label: "Results page",
33
- description: "Where the query is answered. Empty is this Area's own search page.",
34
- },
35
- {
36
- key: "controlSize",
37
- type: "choice",
38
- label: "Size",
39
- options: [
40
- { value: "small", label: "Small" },
41
- { value: "medium", label: "Medium" },
42
- { value: "large", label: "Large" },
43
- ],
44
- },
45
- ],
46
- defaultConfig: normalizePhiSearchBoxWidgetConfig({}),
47
- parseConfig: normalizePhiSearchBoxWidgetConfig,
48
- };
@@ -1,21 +0,0 @@
1
- import type { PhiNoLabels, PhiServerBlockBaseProps } from "../../../../../types";
2
- import type { PhiResolvedLinkTargets } from "../../../../../types/references";
3
- import type { PhiSearchBoxWidgetConfig } from "./config";
4
- export type PhiSearchBoxWidgetProps = PhiServerBlockBaseProps<PhiNoLabels, PhiSearchBoxWidgetConfig> & {
5
- /** The page's resolved link targets, where the author chose a results Page. */
6
- links?: PhiResolvedLinkTargets | null;
7
- /** Whether the placeholder is translated: the node's `NoTranslate` flag, read by the plugin. */
8
- translate?: boolean;
9
- };
10
- /**
11
- * The search box, resolved on the server: where the form goes, what the box says, what it already holds.
12
- *
13
- * The results Page is a reference, resolved as every link is -- through the page's targets where the
14
- * author picked one, or alone where the box takes the Area's own Page. An Area whose search Page does not
15
- * resolve -- a Module switched off, a Page unpublished -- draws no box at all rather than one that
16
- * leads to "not found".
17
- *
18
- * On the results Page itself the box shows the query it is answering, read from the same URL parameter
19
- * the results Widget reads.
20
- */
21
- export declare function PhiSearchBoxWidget({ config, runtime, links, translate }: PhiSearchBoxWidgetProps): Promise<import("react").JSX.Element | null>;
@@ -1,20 +0,0 @@
1
- import { type PhiLinkTarget } from "../../types/references";
2
- import type { PhiCmsAreaKey } from "../../constants/cms-areas";
3
- /**
4
- * The search results Pages (SEARCH.md), one per Area that is indexed, named once.
5
- *
6
- * The App base brings its own rather than sending a signed-in reader to the Public one: the App's
7
- * results Page searches App and Public, the Public one only Public, and which Area a reader stands in
8
- * is what decides between them. The Search Box Widget reads the Area it is placed in and links to that
9
- * Area's Page unless its author chose another; the Pages themselves are declared beside the other base
10
- * Pages of their Modules, with the keys from here so the two cannot drift.
11
- *
12
- * Kept apart from the Module folders for the reason `public-base-page-references.ts` is: a Core Widget
13
- * links to these Pages, and importing them from beside the trees would compile the whole Module with it.
14
- */
15
- export declare const PHI_APP_SEARCH_PAGE_PRESET_KEY = "app-search-page";
16
- /**
17
- * Where a Search Box in `area` sends its query when its author chose no Page: the Area's own results
18
- * Page, and for an Area that has none -- the operator's chrome -- the Public one, resolved in Public.
19
- */
20
- export declare function resolvePhiSearchPageLinkTarget(area: PhiCmsAreaKey): PhiLinkTarget;
@@ -1,35 +0,0 @@
1
- import { createPhiPageReference } from "../../types/references";
2
- import { PHI_SHARED_PACKAGE_NAME } from "../../constants/package";
3
- import { createPhiRuntimeModuleId } from "../../constants/module-identity";
4
- import { PHI_PUBLIC_BASE_PAGE_REFERENCES } from "./public-base-page-references";
5
- /**
6
- * The search results Pages (SEARCH.md), one per Area that is indexed, named once.
7
- *
8
- * The App base brings its own rather than sending a signed-in reader to the Public one: the App's
9
- * results Page searches App and Public, the Public one only Public, and which Area a reader stands in
10
- * is what decides between them. The Search Box Widget reads the Area it is placed in and links to that
11
- * Area's Page unless its author chose another; the Pages themselves are declared beside the other base
12
- * Pages of their Modules, with the keys from here so the two cannot drift.
13
- *
14
- * Kept apart from the Module folders for the reason `public-base-page-references.ts` is: a Core Widget
15
- * links to these Pages, and importing them from beside the trees would compile the whole Module with it.
16
- */
17
- export const PHI_APP_SEARCH_PAGE_PRESET_KEY = "app-search-page";
18
- const PHI_APP_RUNTIME_MODULE_ID = createPhiRuntimeModuleId(PHI_SHARED_PACKAGE_NAME, "app");
19
- const PHI_APP_SEARCH_PAGE_REFERENCE = createPhiPageReference({
20
- kind: "module",
21
- ownerModuleId: PHI_APP_RUNTIME_MODULE_ID,
22
- presetKey: PHI_APP_SEARCH_PAGE_PRESET_KEY,
23
- });
24
- /**
25
- * Where a Search Box in `area` sends its query when its author chose no Page: the Area's own results
26
- * Page, and for an Area that has none -- the operator's chrome -- the Public one, resolved in Public.
27
- */
28
- export function resolvePhiSearchPageLinkTarget(area) {
29
- if (area === "app") {
30
- return { kind: "page", reference: PHI_APP_SEARCH_PAGE_REFERENCE };
31
- }
32
- return area === "public"
33
- ? { kind: "page", reference: PHI_PUBLIC_BASE_PAGE_REFERENCES.search }
34
- : { kind: "page", reference: PHI_PUBLIC_BASE_PAGE_REFERENCES.search, area: "public" };
35
- }