@phis/ui 0.4.16 → 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.
- package/components/controls/phi-table-control.js +15 -0
- package/components/forms/compound-form-controls.js +2 -1
- package/components/widgets/label-sets/observability-logs.d.ts +2 -0
- package/components/widgets/label-sets/observability-logs.js +4 -0
- package/components/widgets/label-sets/search.js +2 -0
- package/components/widgets/label-types/search.d.ts +2 -0
- package/components/widgets/label-types/search.js +1 -0
- package/constants/cms-widget-types.js +3 -2
- package/helpers/site-runtime.js +3 -0
- package/net/log.d.ts +1 -0
- package/net/log.js +19 -1
- package/net/phi-next-proxy.js +9 -1
- package/package.json +1 -1
- package/plugins/runtime-modules/app/presets.js +0 -23
- package/plugins/runtime-modules/area-contributions/app.d.ts +1 -1
- package/plugins/runtime-modules/area-contributions/app.js +2 -0
- package/plugins/runtime-modules/area-contributions/public.d.ts +1 -1
- package/plugins/runtime-modules/area-contributions/public.js +2 -0
- package/plugins/runtime-modules/area-module-defaults.js +21 -2
- package/plugins/runtime-modules/client-authoring-providers/app.d.ts +1 -1
- package/plugins/runtime-modules/client-authoring-providers/app.js +6 -0
- package/plugins/runtime-modules/client-authoring-providers/public.d.ts +1 -1
- package/plugins/runtime-modules/client-authoring-providers/public.js +6 -0
- package/plugins/runtime-modules/client-manifests/common.js +2 -2
- package/plugins/runtime-modules/core/authoring-widgets.js +0 -4
- package/plugins/runtime-modules/core/widgets/collection-view/asset-binding.js +1 -1
- package/plugins/runtime-modules/core/widgets/markdown-toc/client.js +1 -1
- package/plugins/runtime-modules/core/widgets/table/client.js +7 -5
- package/plugins/runtime-modules/core/widgets/table/config.js +8 -1
- package/plugins/runtime-modules/core/widgets/tree/client.js +1 -1
- package/plugins/runtime-modules/core/widgets.js +0 -17
- package/plugins/runtime-modules/groups/trees/group-tables.d.ts +44 -0
- package/plugins/runtime-modules/groups/trees/group-tables.js +150 -0
- package/plugins/runtime-modules/groups/trees/phi-default-admin-groups-page-tree.js +28 -136
- package/plugins/runtime-modules/groups/trees/phi-default-app-groups-page-tree.js +9 -106
- package/plugins/runtime-modules/localization/trees/phi-default-admin-locales-page-tree.js +17 -5
- package/plugins/runtime-modules/observability/data-providers.d.ts +9 -0
- package/plugins/runtime-modules/observability/data-providers.js +5 -0
- package/plugins/runtime-modules/observability/definition.d.ts +9 -0
- package/plugins/runtime-modules/observability/module.d.ts +9 -0
- package/plugins/runtime-modules/observability/services/table.js +4 -0
- package/plugins/runtime-modules/observability/trees/phi-default-admin-logs-page-tree.js +13 -0
- package/plugins/runtime-modules/phi-default-site-area-preset-tree.js +21 -0
- package/plugins/runtime-modules/preset-contracts/pub-area.d.ts +1 -1
- package/plugins/runtime-modules/preset-contracts/pub-area.js +1 -0
- package/plugins/runtime-modules/public/presets.d.ts +0 -16
- package/plugins/runtime-modules/public/presets.js +0 -22
- package/plugins/runtime-modules/public-base-page-references.d.ts +0 -1
- package/plugins/runtime-modules/public-base-page-references.js +0 -1
- package/plugins/runtime-modules/search/authoring-widgets.d.ts +2 -0
- package/plugins/runtime-modules/search/authoring-widgets.js +8 -0
- package/plugins/runtime-modules/search/authoring.d.ts +1 -0
- package/plugins/runtime-modules/search/authoring.js +8 -0
- package/plugins/runtime-modules/search/definition.d.ts +21 -0
- package/plugins/runtime-modules/search/definition.js +23 -0
- package/plugins/runtime-modules/search/ids.d.ts +6 -0
- package/plugins/runtime-modules/search/ids.js +7 -0
- package/plugins/runtime-modules/search/module.d.ts +10 -0
- package/plugins/runtime-modules/search/module.js +4 -0
- package/plugins/runtime-modules/search/page-references.d.ts +8 -0
- package/plugins/runtime-modules/search/page-references.js +17 -0
- package/plugins/runtime-modules/{search-page-tree.d.ts → search/page-tree.d.ts} +1 -1
- package/plugins/runtime-modules/{search-page-tree.js → search/page-tree.js} +9 -7
- package/plugins/runtime-modules/search/presets.d.ts +12 -0
- package/plugins/runtime-modules/search/presets.js +33 -0
- package/plugins/runtime-modules/search/server.d.ts +1 -0
- package/plugins/runtime-modules/search/server.js +16 -0
- package/plugins/runtime-modules/search/widgets/search-box/authoring.d.ts +8 -0
- package/plugins/runtime-modules/search/widgets/search-box/authoring.js +21 -0
- package/plugins/runtime-modules/search/widgets/search-box/client.d.ts +39 -0
- package/plugins/runtime-modules/search/widgets/search-box/client.js +114 -0
- package/plugins/runtime-modules/search/widgets/search-box/config.d.ts +96 -0
- package/plugins/runtime-modules/search/widgets/search-box/config.js +67 -0
- package/plugins/runtime-modules/{core → search}/widgets/search-box/plugin.js +1 -4
- package/plugins/runtime-modules/search/widgets/search-box/server.d.ts +15 -0
- package/plugins/runtime-modules/{core → search}/widgets/search-box/server.js +13 -14
- package/plugins/runtime-modules/{core → search}/widgets/search-results/config.d.ts +0 -1
- package/plugins/runtime-modules/{core → search}/widgets/search-results/config.js +0 -1
- package/plugins/runtime-modules/{core → search}/widgets/search-results/plugin.js +1 -3
- package/plugins/runtime-modules/{core → search}/widgets/search-results/server.d.ts +1 -2
- package/plugins/runtime-modules/{core → search}/widgets/search-results/server.js +2 -2
- package/plugins/runtime-modules/search/widgets.d.ts +2 -0
- package/plugins/runtime-modules/search/widgets.js +20 -0
- package/server-helpers/search-index.js +9 -0
- package/styles/shell.css +137 -0
- package/theme/phi-theme-tokens.d.ts +1 -1
- package/theme/phi-theme-tokens.js +2 -0
- package/types/table-widget.d.ts +10 -1
- package/types/table-widget.js +1 -0
- package/plugins/runtime-modules/core/widgets/search-box/authoring.d.ts +0 -6
- package/plugins/runtime-modules/core/widgets/search-box/authoring.js +0 -10
- package/plugins/runtime-modules/core/widgets/search-box/client.d.ts +0 -21
- package/plugins/runtime-modules/core/widgets/search-box/client.js +0 -17
- package/plugins/runtime-modules/core/widgets/search-box/config.d.ts +0 -63
- package/plugins/runtime-modules/core/widgets/search-box/config.js +0 -48
- package/plugins/runtime-modules/core/widgets/search-box/server.d.ts +0 -21
- package/plugins/runtime-modules/search-page-references.d.ts +0 -20
- package/plugins/runtime-modules/search-page-references.js +0 -35
- /package/plugins/runtime-modules/{core → search}/widgets/search-box/plugin.d.ts +0 -0
- /package/plugins/runtime-modules/{core → search}/widgets/search-results/authoring.d.ts +0 -0
- /package/plugins/runtime-modules/{core → search}/widgets/search-results/authoring.js +0 -0
- /package/plugins/runtime-modules/{core → search}/widgets/search-results/client.d.ts +0 -0
- /package/plugins/runtime-modules/{core → search}/widgets/search-results/client.js +0 -0
- /package/plugins/runtime-modules/{core → search}/widgets/search-results/plugin.d.ts +0 -0
|
@@ -41,6 +41,11 @@ export const PHI_OBSERVABILITY_RUNTIME_DATA_PROVIDER_DESCRIPTORS = [
|
|
|
41
41
|
pagination: "offset",
|
|
42
42
|
total: true,
|
|
43
43
|
},
|
|
44
|
+
// A period with more records than one request reads is cut to the newest; the page says so.
|
|
45
|
+
summaryFields: [
|
|
46
|
+
{ key: "truncated", title: "Cut at the record limit", type: "boolean" },
|
|
47
|
+
{ key: "recordLimit", title: "Record limit", type: "number" },
|
|
48
|
+
],
|
|
44
49
|
recordRead: true,
|
|
45
50
|
}],
|
|
46
51
|
},
|
|
@@ -51,6 +51,15 @@ export declare const PHI_OBSERVABILITY_RUNTIME_MODULE_DEFINITION: {
|
|
|
51
51
|
pagination: "offset";
|
|
52
52
|
total: true;
|
|
53
53
|
};
|
|
54
|
+
summaryFields: ({
|
|
55
|
+
key: string;
|
|
56
|
+
title: string;
|
|
57
|
+
type: "boolean";
|
|
58
|
+
} | {
|
|
59
|
+
key: string;
|
|
60
|
+
title: string;
|
|
61
|
+
type: "number";
|
|
62
|
+
})[];
|
|
54
63
|
recordRead: true;
|
|
55
64
|
}[];
|
|
56
65
|
}[];
|
|
@@ -51,6 +51,15 @@ export declare const PHI_OBSERVABILITY_RUNTIME_MODULE: {
|
|
|
51
51
|
pagination: "offset";
|
|
52
52
|
total: true;
|
|
53
53
|
};
|
|
54
|
+
summaryFields: ({
|
|
55
|
+
key: string;
|
|
56
|
+
title: string;
|
|
57
|
+
type: "boolean";
|
|
58
|
+
} | {
|
|
59
|
+
key: string;
|
|
60
|
+
title: string;
|
|
61
|
+
type: "number";
|
|
62
|
+
})[];
|
|
54
63
|
recordRead: true;
|
|
55
64
|
}[];
|
|
56
65
|
}[];
|
|
@@ -45,6 +45,10 @@ async function loadRows({ resourceKey, query, signal, }) {
|
|
|
45
45
|
return {
|
|
46
46
|
rows,
|
|
47
47
|
total: typeof payload.total === "number" && Number.isFinite(payload.total) ? payload.total : undefined,
|
|
48
|
+
summary: {
|
|
49
|
+
truncated: payload.summary?.truncated === true,
|
|
50
|
+
recordLimit: typeof payload.summary?.recordLimit === "number" ? payload.summary.recordLimit : null,
|
|
51
|
+
},
|
|
48
52
|
};
|
|
49
53
|
}
|
|
50
54
|
async function readRecord({ resourceKey, rowIdentity, signal, }) {
|
|
@@ -150,6 +150,19 @@ export async function buildPhiDefaultAdminLogsPageTree({ page, runtime, }) {
|
|
|
150
150
|
title: widgetLabels.empty.title,
|
|
151
151
|
description: widgetLabels.empty.text,
|
|
152
152
|
},
|
|
153
|
+
// How many entries the window holds; where the Provider cut it, the line says so too.
|
|
154
|
+
footer: {
|
|
155
|
+
template: widgetLabels.countFooter,
|
|
156
|
+
values: [{ key: "total", value: { source: "core", fieldKey: "totalRows" } }],
|
|
157
|
+
variants: [{
|
|
158
|
+
when: { value: { source: "provider", fieldKey: "truncated" }, operator: "truthy" },
|
|
159
|
+
template: widgetLabels.truncatedFooter,
|
|
160
|
+
values: [
|
|
161
|
+
{ key: "total", value: { source: "core", fieldKey: "totalRows" } },
|
|
162
|
+
{ key: "limit", value: { source: "provider", fieldKey: "recordLimit" } },
|
|
163
|
+
],
|
|
164
|
+
}],
|
|
165
|
+
},
|
|
153
166
|
controlSize: "small",
|
|
154
167
|
},
|
|
155
168
|
features: {
|
|
@@ -312,6 +312,27 @@ export async function buildPhiDefaultSiteAreaPresetTree({ page, runtime, presetK
|
|
|
312
312
|
},
|
|
313
313
|
contentVersionId: null,
|
|
314
314
|
},
|
|
315
|
+
/*
|
|
316
|
+
* The magnifier, in Public only: the Area every visitor reads, and the one whose results Page it
|
|
317
|
+
* opens. The App carries its box in its Sider where its preset puts one; the operator's Areas are
|
|
318
|
+
* not searched. Before the locale switch, in the slot nothing else of this preset takes.
|
|
319
|
+
*/
|
|
320
|
+
...(runtimeModuleArea === "public"
|
|
321
|
+
? [{
|
|
322
|
+
id: PHI_DEFAULT_PUB_AREA_WIDGET_IDS.widgetSearch,
|
|
323
|
+
siteId: page.siteId,
|
|
324
|
+
parentLayoutNodeId: PHI_DEFAULT_PUB_AREA_LAYOUT_IDS.layoutHeaderActions,
|
|
325
|
+
widgetType: buildPhiCmsWidgetNamespacedTypeKey(resolvePhiCmsWidgetPluginKey("search-box"), "search-box"),
|
|
326
|
+
slotIndex: PHI_CMS_SEQUENTIAL_LAYOUT_SLOTS[0].slotIndex,
|
|
327
|
+
sortOrder: 5,
|
|
328
|
+
status: 1,
|
|
329
|
+
flags: 0,
|
|
330
|
+
visibilityMask: page.visibilityMask,
|
|
331
|
+
label: "pub header main search",
|
|
332
|
+
config: { variant: "icon-only" },
|
|
333
|
+
contentVersionId: null,
|
|
334
|
+
}]
|
|
335
|
+
: []),
|
|
315
336
|
{
|
|
316
337
|
id: PHI_DEFAULT_PUB_AREA_WIDGET_IDS.widgetLocale,
|
|
317
338
|
siteId: page.siteId,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export declare const PHI_DEFAULT_PUB_AREA_PRESET_KEY = "public-area-preset";
|
|
2
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"];
|
|
3
|
+
export declare const PHI_DEFAULT_PUB_AREA_WIDGET_NODE_KEYS: readonly ["widgetBrand", "widgetNav", "widgetSearch", "widgetLocale", "widgetAccount", "widgetSiderRightNav", "widgetFooterLeft", "widgetFooterMiddle", "widgetFooterRight", "widgetFooterBottomText"];
|
|
4
4
|
export declare const PHI_DEFAULT_PUB_AREA_COMPOSITION_NODE_KEYS: readonly ["widgetBrand", "widgetNav", "widgetLocale"];
|
|
@@ -25,7 +25,6 @@ export declare const PHI_PUBLIC_RUNTIME_MODULE_ROUTES: ({
|
|
|
25
25
|
path: string;
|
|
26
26
|
loadTree: ({ page, runtime }: PhiCmsDescriptorBuildContext) => Promise<import("../../../types").PhiResolvedCmsPageTree>;
|
|
27
27
|
navigation?: undefined;
|
|
28
|
-
defaultPageFlags?: undefined;
|
|
29
28
|
} | {
|
|
30
29
|
ownerModuleId: "@phis/ui/modules/public";
|
|
31
30
|
presetKey: "public-home-page";
|
|
@@ -47,7 +46,6 @@ export declare const PHI_PUBLIC_RUNTIME_MODULE_ROUTES: ({
|
|
|
47
46
|
};
|
|
48
47
|
}[];
|
|
49
48
|
loadTree: ({ page }: PhiCmsDescriptorBuildContext) => Promise<import("../../../types").PhiResolvedCmsPageTree>;
|
|
50
|
-
defaultPageFlags?: undefined;
|
|
51
49
|
} | {
|
|
52
50
|
ownerModuleId: "@phis/ui/modules/public";
|
|
53
51
|
presetKey: "public-terms-page";
|
|
@@ -60,20 +58,6 @@ export declare const PHI_PUBLIC_RUNTIME_MODULE_ROUTES: ({
|
|
|
60
58
|
params: Readonly<Record<string, string>>;
|
|
61
59
|
}) => Promise<import("../../../types").PhiResolvedCmsPageTree>;
|
|
62
60
|
navigation?: undefined;
|
|
63
|
-
defaultPageFlags?: undefined;
|
|
64
|
-
} | {
|
|
65
|
-
ownerModuleId: "@phis/ui/modules/public";
|
|
66
|
-
presetKey: "public-search-page";
|
|
67
|
-
presetVersion: number;
|
|
68
|
-
area: "public";
|
|
69
|
-
title: string;
|
|
70
|
-
path: string;
|
|
71
|
-
navigation: never[];
|
|
72
|
-
defaultPageFlags: number;
|
|
73
|
-
loadTree: ({ page }: PhiCmsDescriptorBuildContext & {
|
|
74
|
-
activeModuleIds: ReadonlySet<import("../contracts").PhiRuntimeModuleId>;
|
|
75
|
-
params: Readonly<Record<string, string>>;
|
|
76
|
-
}) => Promise<import("../../../types").PhiResolvedCmsPageTree>;
|
|
77
61
|
})[];
|
|
78
62
|
/**
|
|
79
63
|
* The Public form pages, in their own list because they appear only where Forms are allowed. The
|
|
@@ -101,28 +101,6 @@ export const PHI_PUBLIC_RUNTIME_MODULE_ROUTES = [
|
|
|
101
101
|
loadTree: ({ page }) => import("./trees/phi-default-pub-terms-page-tree")
|
|
102
102
|
.then((module) => module.buildPhiDefaultPubTermsPageTree({ page })),
|
|
103
103
|
},
|
|
104
|
-
/*
|
|
105
|
-
* Where a search goes (SEARCH.md): the box on any Page sends its query here, and the results Widget
|
|
106
|
-
* reads it from the address. Core's, because the box is Core's and a box without a Page to answer it is
|
|
107
|
-
* a field that leads nowhere. No menu entry -- nobody browses to a results Page -- and `NoIndex`, so
|
|
108
|
-
* neither a crawler nor the Site's own index lists a Page whose words are whatever was last searched.
|
|
109
|
-
*/
|
|
110
|
-
{
|
|
111
|
-
ownerModuleId: PHI_PUBLIC_RUNTIME_MODULE_ID,
|
|
112
|
-
presetKey: PHI_PUBLIC_BASE_PAGE_PRESET_KEYS.search,
|
|
113
|
-
presetVersion: 1,
|
|
114
|
-
area: "public",
|
|
115
|
-
title: "Search",
|
|
116
|
-
path: "/search",
|
|
117
|
-
navigation: [],
|
|
118
|
-
defaultPageFlags: PhiCmsFlags.NoIndex,
|
|
119
|
-
loadTree: ({ page }) => import("../search-page-tree")
|
|
120
|
-
.then((module) => module.buildPhiDefaultSearchPageTree({
|
|
121
|
-
page,
|
|
122
|
-
ownerModuleId: PHI_PUBLIC_RUNTIME_MODULE_ID,
|
|
123
|
-
presetKey: PHI_PUBLIC_BASE_PAGE_PRESET_KEYS.search,
|
|
124
|
-
})),
|
|
125
|
-
},
|
|
126
104
|
];
|
|
127
105
|
/**
|
|
128
106
|
* The Public form pages, in their own list because they appear only where Forms are allowed. The
|
|
@@ -17,7 +17,6 @@ export declare const PHI_PUBLIC_BASE_PAGE_PRESET_KEYS: {
|
|
|
17
17
|
readonly terms: "public-terms-page";
|
|
18
18
|
readonly contact: "public-contact-page";
|
|
19
19
|
readonly unsubscribe: "public-unsubscribe-page";
|
|
20
|
-
readonly search: "public-search-page";
|
|
21
20
|
};
|
|
22
21
|
/**
|
|
23
22
|
* Ready-made references to the Pages every Site has, for a Module that links to one.
|
|
@@ -19,7 +19,6 @@ export const PHI_PUBLIC_BASE_PAGE_PRESET_KEYS = {
|
|
|
19
19
|
terms: "public-terms-page",
|
|
20
20
|
contact: "public-contact-page",
|
|
21
21
|
unsubscribe: "public-unsubscribe-page",
|
|
22
|
-
search: "public-search-page",
|
|
23
22
|
};
|
|
24
23
|
// Named by id, as data, for the same reason: `public/ids` would bind the door to the Module folder.
|
|
25
24
|
const PHI_PUBLIC_RUNTIME_MODULE_ID = createPhiRuntimeModuleId(PHI_SHARED_PACKAGE_NAME, "public");
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { PHI_SEARCH_BOX_WIDGET_DEFINITION } from "./widgets/search-box/config";
|
|
3
|
+
import { PHI_SEARCH_RESULTS_WIDGET_DEFINITION } from "./widgets/search-results/config";
|
|
4
|
+
import { createPhiAuthoringWidgetModule, definePhiAuthoringWidgetModuleLoader, } from "../client-authoring-widget-module";
|
|
5
|
+
export default createPhiAuthoringWidgetModule([
|
|
6
|
+
definePhiAuthoringWidgetModuleLoader(PHI_SEARCH_BOX_WIDGET_DEFINITION, () => import("./widgets/search-box/authoring").then((module) => module.PHI_SEARCH_BOX_WIDGET_BUILDER_PLUGIN)),
|
|
7
|
+
definePhiAuthoringWidgetModuleLoader(PHI_SEARCH_RESULTS_WIDGET_DEFINITION, () => import("./widgets/search-results/authoring").then((module) => module.PHI_SEARCH_RESULTS_WIDGET_BUILDER_PLUGIN)),
|
|
8
|
+
]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const PhiSearchRuntimeModuleAuthoringClient: import("react").ComponentType<import("../contracts").PhiRuntimeModuleAuthoringClientProps>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import WidgetModule from "./authoring-widgets";
|
|
3
|
+
import { createPhiRuntimeModuleAuthoringClient } from "../client-authoring-module";
|
|
4
|
+
import { PHI_SEARCH_RUNTIME_MODULE_ID } from "./ids";
|
|
5
|
+
export const PhiSearchRuntimeModuleAuthoringClient = createPhiRuntimeModuleAuthoringClient({
|
|
6
|
+
moduleId: PHI_SEARCH_RUNTIME_MODULE_ID,
|
|
7
|
+
WidgetModule,
|
|
8
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Site's own search (SEARCH.md): the box, the results, and the Page the box leads to, in each Area
|
|
3
|
+
* whose Pages are indexed.
|
|
4
|
+
*
|
|
5
|
+
* A Module rather than Core, because the box is only worth placing where something answers it, and what
|
|
6
|
+
* answers it is the Module's own results Page -- never a Page somebody picked that may hold no results.
|
|
7
|
+
* Switched off, the box goes with the Page and the indexer leaves the Area alone; a package that brings a
|
|
8
|
+
* search of its own brings its own box, Page and results the same way, over the same Core endpoints.
|
|
9
|
+
*
|
|
10
|
+
* Public and App: the Areas whose Pages the index holds. The operator's Areas are not searched.
|
|
11
|
+
*/
|
|
12
|
+
export declare const PHI_SEARCH_RUNTIME_MODULE_DEFINITION: {
|
|
13
|
+
moduleId: "@phis/ui/modules/search";
|
|
14
|
+
kind: "module";
|
|
15
|
+
eligibleAreas: readonly ["public", "app"];
|
|
16
|
+
serverBinding: import("../../../types").PhiRuntimeModuleServerBinding;
|
|
17
|
+
title: string;
|
|
18
|
+
description: string;
|
|
19
|
+
category: "content";
|
|
20
|
+
icon: string;
|
|
21
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { PHI_CORE_SERVER_BINDING } from "../../../types/server-capabilities";
|
|
2
|
+
import { PHI_SEARCH_RUNTIME_MODULE_ID } from "./ids";
|
|
3
|
+
/**
|
|
4
|
+
* The Site's own search (SEARCH.md): the box, the results, and the Page the box leads to, in each Area
|
|
5
|
+
* whose Pages are indexed.
|
|
6
|
+
*
|
|
7
|
+
* A Module rather than Core, because the box is only worth placing where something answers it, and what
|
|
8
|
+
* answers it is the Module's own results Page -- never a Page somebody picked that may hold no results.
|
|
9
|
+
* Switched off, the box goes with the Page and the indexer leaves the Area alone; a package that brings a
|
|
10
|
+
* search of its own brings its own box, Page and results the same way, over the same Core endpoints.
|
|
11
|
+
*
|
|
12
|
+
* Public and App: the Areas whose Pages the index holds. The operator's Areas are not searched.
|
|
13
|
+
*/
|
|
14
|
+
export const PHI_SEARCH_RUNTIME_MODULE_DEFINITION = {
|
|
15
|
+
moduleId: PHI_SEARCH_RUNTIME_MODULE_ID,
|
|
16
|
+
kind: "module",
|
|
17
|
+
eligibleAreas: ["public", "app"],
|
|
18
|
+
serverBinding: PHI_CORE_SERVER_BINDING,
|
|
19
|
+
title: "Search",
|
|
20
|
+
description: "A search over the Site's own Pages: a box, a results Page, and the index behind them.",
|
|
21
|
+
category: "content",
|
|
22
|
+
icon: "antd:search",
|
|
23
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const PHI_SEARCH_RUNTIME_MODULE_ID: "@phis/ui/modules/search";
|
|
2
|
+
/** The results Page each Area the Module serves brings, under the Module's own name (SEARCH.md). */
|
|
3
|
+
export declare const PHI_SEARCH_PAGE_PRESET_KEYS: {
|
|
4
|
+
readonly public: "public-search-page";
|
|
5
|
+
readonly app: "app-search-page";
|
|
6
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { PHI_SHARED_PACKAGE_NAME } from "../../../types/signals";
|
|
2
|
+
export const PHI_SEARCH_RUNTIME_MODULE_ID = `${PHI_SHARED_PACKAGE_NAME}/modules/search`;
|
|
3
|
+
/** The results Page each Area the Module serves brings, under the Module's own name (SEARCH.md). */
|
|
4
|
+
export const PHI_SEARCH_PAGE_PRESET_KEYS = {
|
|
5
|
+
public: "public-search-page",
|
|
6
|
+
app: "app-search-page",
|
|
7
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const PHI_SEARCH_RUNTIME_MODULE: {
|
|
2
|
+
moduleId: "@phis/ui/modules/search";
|
|
3
|
+
kind: "module";
|
|
4
|
+
eligibleAreas: readonly ["public", "app"];
|
|
5
|
+
serverBinding: import("../../../types").PhiRuntimeModuleServerBinding;
|
|
6
|
+
title: string;
|
|
7
|
+
description: string;
|
|
8
|
+
category: "content";
|
|
9
|
+
icon: string;
|
|
10
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { PhiCmsAreaKey } from "../../../constants/cms-areas";
|
|
2
|
+
import { type PhiLinkTarget } from "../../../types/references";
|
|
3
|
+
/**
|
|
4
|
+
* Where a Search Box sends its query when its author chose no Page: this Module's results Page of the
|
|
5
|
+
* Area it stands in -- the App's in App, the Public one in Public (SEARCH.md). The Module serves no other
|
|
6
|
+
* Area; a box rendered for one all the same leads to the Public Page, resolved in Public.
|
|
7
|
+
*/
|
|
8
|
+
export declare function resolvePhiSearchPageLinkTarget(area: PhiCmsAreaKey): PhiLinkTarget;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { createPhiPageReference } from "../../../types/references";
|
|
2
|
+
import { PHI_SEARCH_PAGE_PRESET_KEYS, PHI_SEARCH_RUNTIME_MODULE_ID } from "./ids";
|
|
3
|
+
/**
|
|
4
|
+
* Where a Search Box sends its query when its author chose no Page: this Module's results Page of the
|
|
5
|
+
* Area it stands in -- the App's in App, the Public one in Public (SEARCH.md). The Module serves no other
|
|
6
|
+
* Area; a box rendered for one all the same leads to the Public Page, resolved in Public.
|
|
7
|
+
*/
|
|
8
|
+
export function resolvePhiSearchPageLinkTarget(area) {
|
|
9
|
+
const reference = createPhiPageReference({
|
|
10
|
+
kind: "module",
|
|
11
|
+
ownerModuleId: PHI_SEARCH_RUNTIME_MODULE_ID,
|
|
12
|
+
presetKey: area === "app" ? PHI_SEARCH_PAGE_PRESET_KEYS.app : PHI_SEARCH_PAGE_PRESET_KEYS.public,
|
|
13
|
+
});
|
|
14
|
+
if (area === "app" || area === "public")
|
|
15
|
+
return { kind: "page", reference };
|
|
16
|
+
return { kind: "page", reference, area: "public" };
|
|
17
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { PhiCmsPageNode, PhiResolvedCmsPageTree } from "
|
|
1
|
+
import type { PhiCmsPageNode, PhiResolvedCmsPageTree } from "../../../types/cms";
|
|
2
2
|
/**
|
|
3
3
|
* The results Page every indexed Area brings (SEARCH.md): the box, so a reader can search again without
|
|
4
4
|
* going back, and under it the results, which read the query from the page's address.
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { buildPhiBasePageContentScaffold, PHI_BASE_PAGE_LAYOUT_NODE_ID, } from "
|
|
2
|
-
import { PHI_CMS_DEFAULT_SLOT_INDEX } from "
|
|
3
|
-
import { PhiCmsPageType } from "
|
|
4
|
-
import { createPhiCmsPresetNodes } from "
|
|
5
|
-
import { PHI_SPACE } from "
|
|
6
|
-
import {
|
|
1
|
+
import { buildPhiBasePageContentScaffold, PHI_BASE_PAGE_LAYOUT_NODE_ID, } from "../../../components/regions/presets/phi-base-page-layout";
|
|
2
|
+
import { PHI_CMS_DEFAULT_SLOT_INDEX } from "../../../constants/cms-layout-types";
|
|
3
|
+
import { PhiCmsPageType } from "../../../constants/phi-cms";
|
|
4
|
+
import { createPhiCmsPresetNodes } from "../../../helpers/cms-preset-nodes";
|
|
5
|
+
import { PHI_SPACE } from "../../../theme/antd-css-var-contract";
|
|
6
|
+
import { PHI_LAYOUT } from "../../../theme/phi-tokens";
|
|
7
|
+
import { createPhiPresetCmsInstanceIdMap } from "../../../types/cms-instance-id";
|
|
7
8
|
/** Synthetic Region id; negative, and unique among the base Presets. */
|
|
8
9
|
const SYNTHETIC_SEARCH_REGION_IDS = {
|
|
9
10
|
regionContent: -260,
|
|
@@ -46,7 +47,8 @@ export async function buildPhiDefaultSearchPageTree({ page, ownerModuleId, prese
|
|
|
46
47
|
slotIndex: PHI_CMS_DEFAULT_SLOT_INDEX,
|
|
47
48
|
sortOrder: 0,
|
|
48
49
|
label: "search page box",
|
|
49
|
-
|
|
50
|
+
// The field at the house's size, no wider than a form: a query is a few words, not a line of prose.
|
|
51
|
+
config: { controlSize: "medium", maxSize: { width: PHI_LAYOUT.contentMax } },
|
|
50
52
|
}),
|
|
51
53
|
nodes.widget({
|
|
52
54
|
typeKey: "search-results",
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { PhiCmsDescriptorBuildContext } from "../../../types/cms-module-descriptors";
|
|
2
|
+
export declare const PHI_SEARCH_RUNTIME_MODULE_ROUTES: {
|
|
3
|
+
ownerModuleId: "@phis/ui/modules/search";
|
|
4
|
+
presetKey: "public-search-page" | "app-search-page";
|
|
5
|
+
presetVersion: number;
|
|
6
|
+
area: "public" | "app";
|
|
7
|
+
title: string;
|
|
8
|
+
path: string;
|
|
9
|
+
navigation: never[];
|
|
10
|
+
defaultPageFlags: number;
|
|
11
|
+
loadTree: ({ page }: PhiCmsDescriptorBuildContext) => Promise<import("../../../types").PhiResolvedCmsPageTree>;
|
|
12
|
+
}[];
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { PhiCmsFlags } from "../../../constants/phi-cms";
|
|
2
|
+
import { PHI_SEARCH_PAGE_PRESET_KEYS, PHI_SEARCH_RUNTIME_MODULE_ID } from "./ids";
|
|
3
|
+
/**
|
|
4
|
+
* The results Pages (SEARCH.md), one per Area the Module serves, the same tree in both: the box and the
|
|
5
|
+
* results. Which Areas are searched is decided by where the results Widget stands -- on the App's Page
|
|
6
|
+
* the App and Public, on the Public one Public -- not written into the tree.
|
|
7
|
+
*
|
|
8
|
+
* No menu entry -- nobody browses to a results Page -- and `NoIndex`, so neither a crawler nor the Site's
|
|
9
|
+
* own index lists a Page whose words are whatever was last searched.
|
|
10
|
+
*/
|
|
11
|
+
function defineSearchPageRoute(area) {
|
|
12
|
+
const presetKey = PHI_SEARCH_PAGE_PRESET_KEYS[area];
|
|
13
|
+
return {
|
|
14
|
+
ownerModuleId: PHI_SEARCH_RUNTIME_MODULE_ID,
|
|
15
|
+
presetKey,
|
|
16
|
+
presetVersion: 1,
|
|
17
|
+
area,
|
|
18
|
+
title: "Search",
|
|
19
|
+
path: "/search",
|
|
20
|
+
navigation: [],
|
|
21
|
+
defaultPageFlags: PhiCmsFlags.NoIndex,
|
|
22
|
+
loadTree: ({ page }) => import("./page-tree")
|
|
23
|
+
.then((module) => module.buildPhiDefaultSearchPageTree({
|
|
24
|
+
page,
|
|
25
|
+
ownerModuleId: PHI_SEARCH_RUNTIME_MODULE_ID,
|
|
26
|
+
presetKey,
|
|
27
|
+
})),
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
export const PHI_SEARCH_RUNTIME_MODULE_ROUTES = [
|
|
31
|
+
defineSearchPageRoute("public"),
|
|
32
|
+
defineSearchPageRoute("app"),
|
|
33
|
+
];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function createPhiSearchRuntimeModuleServerAreaContribution(): import("../area-contributions").PhiRuntimeModuleServerAreaContribution;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { definePhiRuntimeModuleServerAreaContribution } from "../area-contributions";
|
|
2
|
+
import { PHI_SEARCH_RUNTIME_MODULE_DEFINITION } from "./definition";
|
|
3
|
+
import { PHI_SEARCH_RUNTIME_MODULE_ROUTES } from "./presets";
|
|
4
|
+
import { PHI_SEARCH_RUNTIME_MODULE_WIDGETS } from "./widgets";
|
|
5
|
+
export function createPhiSearchRuntimeModuleServerAreaContribution() {
|
|
6
|
+
return definePhiRuntimeModuleServerAreaContribution({
|
|
7
|
+
moduleId: PHI_SEARCH_RUNTIME_MODULE_DEFINITION.moduleId,
|
|
8
|
+
catalogEntry: {
|
|
9
|
+
definition: PHI_SEARCH_RUNTIME_MODULE_DEFINITION,
|
|
10
|
+
widgets: PHI_SEARCH_RUNTIME_MODULE_WIDGETS,
|
|
11
|
+
layouts: [],
|
|
12
|
+
routes: PHI_SEARCH_RUNTIME_MODULE_ROUTES,
|
|
13
|
+
load: () => import("./module").then((module) => module.PHI_SEARCH_RUNTIME_MODULE),
|
|
14
|
+
},
|
|
15
|
+
});
|
|
16
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { PhiCmsBuilderWidgetPlugin } from "../../../../../types";
|
|
2
|
+
import { type PhiSearchBoxWidgetConfig } from "./config";
|
|
3
|
+
/**
|
|
4
|
+
* The box as a visitor sees it -- the field, or the magnifier -- in the size and words its author chose,
|
|
5
|
+
* but inert: a submit on the canvas would leave the Builder for the results Page, so the field takes no
|
|
6
|
+
* input and the magnifier does not open.
|
|
7
|
+
*/
|
|
8
|
+
export declare const PHI_SEARCH_BOX_WIDGET_BUILDER_PLUGIN: PhiCmsBuilderWidgetPlugin<PhiSearchBoxWidgetConfig>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { PHI_SEARCH_WIDGET_DEFAULT_LABELS } from "../../../../../components/widgets/label-types/search";
|
|
4
|
+
import { PhiSearchBoxWidgetClient } from "./client";
|
|
5
|
+
import { PHI_SEARCH_BOX_WIDGET_DEFINITION } from "./config";
|
|
6
|
+
/**
|
|
7
|
+
* The box as a visitor sees it -- the field, or the magnifier -- in the size and words its author chose,
|
|
8
|
+
* but inert: a submit on the canvas would leave the Builder for the results Page, so the field takes no
|
|
9
|
+
* input and the magnifier does not open.
|
|
10
|
+
*/
|
|
11
|
+
export const PHI_SEARCH_BOX_WIDGET_BUILDER_PLUGIN = {
|
|
12
|
+
...PHI_SEARCH_BOX_WIDGET_DEFINITION,
|
|
13
|
+
renderEditor: ({ config }) => (_jsx(PhiSearchBoxWidgetClient, { labels: PHI_SEARCH_WIDGET_DEFAULT_LABELS, config: {
|
|
14
|
+
// The author's words as stored; the canvas does not translate them.
|
|
15
|
+
placeholder: config?.placeholder ?? "",
|
|
16
|
+
initialQuery: "",
|
|
17
|
+
interactive: false,
|
|
18
|
+
...(config?.controlSize ? { size: config.controlSize } : {}),
|
|
19
|
+
...(config?.variant ? { variant: config.variant } : {}),
|
|
20
|
+
} })),
|
|
21
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { PhiSearchWidgetLabels } from "../../../../../components/widgets/label-types/search";
|
|
2
|
+
import type { PhiClientBlockBaseProps } from "../../../../../types";
|
|
3
|
+
import type { PhiControlSize } from "../../../../../types/control";
|
|
4
|
+
import type { PhiSearchBoxVariant } from "./config";
|
|
5
|
+
export type PhiSearchBoxWidgetClientConfig = {
|
|
6
|
+
/** The results Page, as the form's address. Absent on the Builder's canvas, where nothing submits. */
|
|
7
|
+
action?: string;
|
|
8
|
+
placeholder: string;
|
|
9
|
+
size?: PhiControlSize;
|
|
10
|
+
/** The query the page is answering, so the box shows what was searched for. */
|
|
11
|
+
initialQuery: string;
|
|
12
|
+
/** Absent is `input`. */
|
|
13
|
+
variant?: PhiSearchBoxVariant;
|
|
14
|
+
/**
|
|
15
|
+
* False on the Builder's canvas: the box is drawn as a visitor sees it, but a submit there would leave
|
|
16
|
+
* the Builder for the results Page, so the field takes no input and the magnifier does not open.
|
|
17
|
+
*/
|
|
18
|
+
interactive?: boolean;
|
|
19
|
+
};
|
|
20
|
+
export type PhiSearchBoxWidgetClientProps = PhiClientBlockBaseProps<PhiSearchWidgetLabels, PhiSearchBoxWidgetClientConfig>;
|
|
21
|
+
/**
|
|
22
|
+
* A `GET` form around one search field (SEARCH.md), as the input or as a magnifier alone that opens into one (`icon-only`).
|
|
23
|
+
*
|
|
24
|
+
* The browser submits it: Enter, or the keyboard's search key, sends `?q=` to the results Page without
|
|
25
|
+
* a script, and a static Public page needs none. The field is the house's text Control with the form's
|
|
26
|
+
* field name, so it clears, labels and sizes like every other field, and the form is a landmark a screen
|
|
27
|
+
* reader lists.
|
|
28
|
+
*
|
|
29
|
+
* The magnifier is a link to the results Page until the page has hydrated, so it leads somewhere without
|
|
30
|
+
* a script too. After that it opens the field where it stands -- the field grows out of it -- or, on a
|
|
31
|
+
* phone, as a row over the whole band it stands in: a header on a phone has no room for a field beside
|
|
32
|
+
* the brand and the menu button, and one that wrapped would push the page down. Escape, the close mark,
|
|
33
|
+
* or leaving the field empty closes it again, the field folding back into the magnifier as it came.
|
|
34
|
+
*
|
|
35
|
+
* `auto` draws both the field and the magnifier and `styles/shell.css` shows one, the way the Header
|
|
36
|
+
* Navigation draws its row and its menu button: whether this is a phone is the Shell's width, known to
|
|
37
|
+
* CSS on the first paint.
|
|
38
|
+
*/
|
|
39
|
+
export declare function PhiSearchBoxWidgetClient({ labels, config }: PhiSearchBoxWidgetClientProps): import("react").JSX.Element;
|