@phis/ui 0.4.5 → 0.4.7
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/cms/phi-cms-root-layout.js +1 -1
- package/components/controls/phi-button-control.d.ts +3 -1
- package/components/controls/phi-button-control.js +2 -2
- package/components/controls/phi-collapse-control.d.ts +6 -2
- package/components/controls/phi-collapse-control.js +2 -2
- package/components/controls/phi-dialog-control.d.ts +11 -5
- package/components/controls/phi-dialog-control.js +19 -13
- package/components/controls/phi-menu-control-vocabulary.d.ts +7 -0
- package/components/controls/phi-menu-control-vocabulary.js +10 -0
- package/components/controls/phi-menu-control.d.ts +4 -1
- package/components/controls/phi-menu-control.js +6 -1
- package/components/controls/phi-text-control.d.ts +6 -1
- package/components/controls/phi-text-control.js +2 -1
- package/components/layouts/clients/phi-split-card-layout-client.js +13 -5
- package/components/layouts/clients/phi-three-column-layout-client.js +9 -3
- package/components/layouts/split-card-geometry.js +6 -2
- package/components/media/aspect-ratios.d.ts +2 -2
- package/components/menus/phi-account-menu.js +3 -1
- package/components/navigation/phi-link.js +7 -2
- package/components/navigation/use-phi-protected-mail.d.ts +11 -0
- package/components/navigation/use-phi-protected-mail.js +29 -0
- package/components/regions/clients/cms-region-container-client.js +5 -1
- package/components/regions/phi-cms-region-shell.d.ts +1 -0
- package/components/regions/phi-cms-region-shell.js +11 -0
- package/components/regions/presets/phi-area-shell-preset-nodes.d.ts +5 -0
- package/components/regions/presets/phi-area-shell-preset-nodes.js +19 -3
- package/components/root/phi-config-provider.js +16 -0
- package/components/shell/phi-cms-shell.d.ts +3 -1
- package/components/shell/phi-cms-shell.js +7 -3
- package/components/shell/phi-nav-link.js +7 -2
- package/components/shell/phi-shell-sider-drawer.d.ts +17 -0
- package/components/shell/phi-shell-sider-drawer.js +88 -0
- package/components/widgets/helpers/internal-reference-resolver.server.d.ts +1 -0
- package/components/widgets/helpers/internal-reference-resolver.server.js +4 -1
- package/components/widgets/label-sets/inspector.js +2 -0
- package/components/widgets/label-sets/search-results.d.ts +4 -0
- package/components/widgets/label-sets/search-results.js +35 -0
- package/components/widgets/label-types/inspector.d.ts +2 -0
- package/components/widgets/label-types/inspector.js +1 -0
- package/components/widgets/label-types/search-results.d.ts +15 -0
- package/components/widgets/label-types/search-results.js +10 -0
- package/components/widgets/server/navigation-request.js +13 -1
- package/components/widgets/shared/card-body-client.d.ts +2 -0
- package/components/widgets/shared/card-body-client.js +8 -7
- package/components/widgets/shared/card-vocabulary.d.ts +36 -0
- package/components/widgets/shared/card-vocabulary.js +52 -0
- package/components/widgets/shared/markdown-body-client.d.ts +29 -0
- package/components/widgets/shared/markdown-body-client.js +60 -5
- package/components/widgets/shared/markdown-image-vocabulary.d.ts +31 -0
- package/components/widgets/shared/markdown-image-vocabulary.js +68 -0
- package/components/widgets/shared/markdown-render.d.ts +5 -0
- package/components/widgets/shared/markdown-render.js +123 -8
- package/components/widgets/shared/markdown-sections.d.ts +40 -0
- package/components/widgets/shared/markdown-sections.js +111 -0
- package/constants/cms-widget-types.d.ts +2 -0
- package/constants/cms-widget-types.js +4 -0
- package/gateway/site-area.d.ts +10 -7
- package/gateway/site-area.js +13 -11
- package/gateway/site-config.js +7 -1
- package/gateway/site-read-marker-listeners.d.ts +24 -0
- package/gateway/site-read-marker-listeners.js +22 -0
- package/gateway/site-search.d.ts +37 -0
- package/gateway/site-search.js +116 -0
- package/helpers/external-href.js +1 -1
- package/helpers/protected-mail.d.ts +16 -0
- package/helpers/protected-mail.js +81 -0
- package/next/areas/app.js +5 -1
- package/next/areas/public.js +5 -1
- package/next/seo-routes.js +2 -2
- package/package.json +2 -2
- package/plugins/runtime-modules/app/presets.js +23 -0
- package/plugins/runtime-modules/app/trees/phi-default-app-area-preset-tree.d.ts +2 -1
- package/plugins/runtime-modules/app/trees/phi-default-app-area-preset-tree.js +3 -2
- package/plugins/runtime-modules/builder/clients/region-inspector.js +20 -1
- package/plugins/runtime-modules/client-manifests/common.js +8 -0
- package/plugins/runtime-modules/core/authoring-widgets.js +4 -0
- package/plugins/runtime-modules/core/widgets/card/config.d.ts +8 -1
- package/plugins/runtime-modules/core/widgets/card/config.js +22 -1
- package/plugins/runtime-modules/core/widgets/card/editor.js +9 -1
- package/plugins/runtime-modules/core/widgets/card/plugin.js +18 -0
- package/plugins/runtime-modules/core/widgets/card/server.js +9 -1
- package/plugins/runtime-modules/core/widgets/description/plugin.js +10 -0
- package/plugins/runtime-modules/core/widgets/entry-list/view.server.js +2 -1
- package/plugins/runtime-modules/core/widgets/gallery/config.d.ts +3 -3
- package/plugins/runtime-modules/core/widgets/header-navigation/client.d.ts +6 -1
- package/plugins/runtime-modules/core/widgets/header-navigation/client.js +40 -13
- package/plugins/runtime-modules/core/widgets/header-navigation/config.d.ts +26 -1
- package/plugins/runtime-modules/core/widgets/header-navigation/config.js +27 -0
- package/plugins/runtime-modules/core/widgets/header-navigation/plugin.js +1 -1
- package/plugins/runtime-modules/core/widgets/header-navigation/server.d.ts +2 -2
- package/plugins/runtime-modules/core/widgets/header-navigation/server.js +3 -1
- package/plugins/runtime-modules/core/widgets/html/plugin.js +16 -1
- package/plugins/runtime-modules/core/widgets/html/server.d.ts +6 -0
- package/plugins/runtime-modules/core/widgets/html/server.js +12 -4
- package/plugins/runtime-modules/core/widgets/image/client.js +11 -7
- package/plugins/runtime-modules/core/widgets/markdown/config.d.ts +16 -0
- package/plugins/runtime-modules/core/widgets/markdown/config.js +46 -1
- package/plugins/runtime-modules/core/widgets/markdown/plugin.js +16 -0
- package/plugins/runtime-modules/core/widgets/markdown/server.js +22 -8
- package/plugins/runtime-modules/core/widgets/search-box/authoring.d.ts +6 -0
- package/plugins/runtime-modules/core/widgets/search-box/authoring.js +10 -0
- package/plugins/runtime-modules/core/widgets/search-box/client.d.ts +21 -0
- package/plugins/runtime-modules/core/widgets/search-box/client.js +17 -0
- package/plugins/runtime-modules/core/widgets/search-box/config.d.ts +63 -0
- package/plugins/runtime-modules/core/widgets/search-box/config.js +48 -0
- package/plugins/runtime-modules/core/widgets/search-box/plugin.d.ts +3 -0
- package/plugins/runtime-modules/core/widgets/search-box/plugin.js +11 -0
- package/plugins/runtime-modules/core/widgets/search-box/server.d.ts +21 -0
- package/plugins/runtime-modules/core/widgets/search-box/server.js +48 -0
- package/plugins/runtime-modules/core/widgets/search-results/authoring.d.ts +6 -0
- package/plugins/runtime-modules/core/widgets/search-results/authoring.js +10 -0
- package/plugins/runtime-modules/core/widgets/search-results/client.d.ts +34 -0
- package/plugins/runtime-modules/core/widgets/search-results/client.js +32 -0
- package/plugins/runtime-modules/core/widgets/search-results/config.d.ts +41 -0
- package/plugins/runtime-modules/core/widgets/search-results/config.js +39 -0
- package/plugins/runtime-modules/core/widgets/search-results/plugin.d.ts +3 -0
- package/plugins/runtime-modules/core/widgets/search-results/plugin.js +10 -0
- package/plugins/runtime-modules/core/widgets/search-results/server.d.ts +20 -0
- package/plugins/runtime-modules/core/widgets/search-results/server.js +73 -0
- package/plugins/runtime-modules/core/widgets/simple-text/plugin.js +11 -0
- package/plugins/runtime-modules/core/widgets/simple-text/server.js +11 -1
- package/plugins/runtime-modules/core/widgets.js +17 -0
- package/plugins/runtime-modules/public/presets.d.ts +16 -0
- package/plugins/runtime-modules/public/presets.js +22 -0
- package/plugins/runtime-modules/public-base-page-references.d.ts +1 -0
- package/plugins/runtime-modules/public-base-page-references.js +1 -0
- package/plugins/runtime-modules/search-page-references.d.ts +20 -0
- package/plugins/runtime-modules/search-page-references.js +35 -0
- package/plugins/runtime-modules/search-page-tree.d.ts +14 -0
- package/plugins/runtime-modules/search-page-tree.js +63 -0
- package/server-helpers/search-index.d.ts +28 -0
- package/server-helpers/search-index.js +299 -0
- package/server-helpers/search-text.d.ts +40 -0
- package/server-helpers/search-text.js +152 -0
- package/server-helpers.d.ts +1 -0
- package/server-helpers.js +1 -0
- package/styles/controls.css +108 -10
- package/styles/layout.css +35 -0
- package/styles/shell.css +142 -0
- package/theme/phi-tokens.d.ts +6 -0
- package/theme/phi-tokens.js +6 -0
- package/theme.d.ts +1 -0
- package/theme.js +6 -0
- package/types/cms-plugins.d.ts +20 -2
- package/types/core-widget-placements.d.ts +5 -0
package/gateway/site-area.js
CHANGED
|
@@ -35,9 +35,9 @@ export const getExactSiteArea = definePhiRequestMemo(async function getExactSite
|
|
|
35
35
|
}
|
|
36
36
|
return payload;
|
|
37
37
|
});
|
|
38
|
-
function
|
|
38
|
+
function readPublishedPage(entry) {
|
|
39
39
|
if (!isPhiRecord(entry)) {
|
|
40
|
-
throw new Error("Invalid published
|
|
40
|
+
throw new Error("Invalid published Page projection.");
|
|
41
41
|
}
|
|
42
42
|
const value = entry;
|
|
43
43
|
const isNullableString = (field) => field === null || typeof field === "string";
|
|
@@ -46,7 +46,7 @@ function readPublishedPublicPage(entry) {
|
|
|
46
46
|
!isNullableString(value.presetKey) ||
|
|
47
47
|
!Number.isSafeInteger(value.revisionId) ||
|
|
48
48
|
typeof value.publishedAt !== "string") {
|
|
49
|
-
throw new Error("Invalid published
|
|
49
|
+
throw new Error("Invalid published Page projection.");
|
|
50
50
|
}
|
|
51
51
|
return {
|
|
52
52
|
path: value.path,
|
|
@@ -57,36 +57,38 @@ function readPublishedPublicPage(entry) {
|
|
|
57
57
|
};
|
|
58
58
|
}
|
|
59
59
|
/**
|
|
60
|
-
*
|
|
60
|
+
* A published Area together with its published Pages, as the sitemap and the search index read them.
|
|
61
61
|
*
|
|
62
62
|
* One request for both: the sitemap needs the Area's `index` and `sitemap` switches and the Pages it
|
|
63
63
|
* may list, and the server adds the second to the first on `include=publishedPages`. The Pages are
|
|
64
64
|
* candidates, not answers -- whether one is listed the caller finds out by resolving it. Live and
|
|
65
|
-
* anonymous only, so no cookie is sent and no draft can be asked for.
|
|
65
|
+
* anonymous only, so no cookie is sent and no draft can be asked for. Core answers it for the Public
|
|
66
|
+
* and the App Area, the two anything indexes (SEARCH.md).
|
|
66
67
|
*/
|
|
67
|
-
export async function
|
|
68
|
+
export async function getSiteAreaWithPublishedPages({ apiBaseUrl, internalToken, siteKey, locale, sourcePreset, area = "public", }) {
|
|
68
69
|
const payload = await fetchPhiSiteApi({
|
|
69
|
-
context: "
|
|
70
|
+
context: "getSiteAreaWithPublishedPages",
|
|
70
71
|
apiBaseUrl,
|
|
71
72
|
internalToken,
|
|
72
73
|
siteKey,
|
|
73
74
|
path: "/api/v1/site/area",
|
|
74
75
|
searchParams: {
|
|
75
|
-
path
|
|
76
|
+
// Core reads the Area off the path's first segment; Public has none.
|
|
77
|
+
path: area === "public" ? "/" : `/${area}`,
|
|
76
78
|
ownerModuleId: sourcePreset.ownerModuleId,
|
|
77
79
|
presetKey: sourcePreset.presetKey,
|
|
78
80
|
include: "publishedPages",
|
|
79
81
|
},
|
|
80
82
|
locale,
|
|
81
|
-
failure:
|
|
83
|
+
failure: `Failed to fetch the ${area} Area with its Pages`,
|
|
82
84
|
userAgent: "phis-ui-sitemap/1.0",
|
|
83
85
|
});
|
|
84
86
|
if (!payload || !Array.isArray(payload.publishedPages)) {
|
|
85
|
-
throw new Error("Missing published
|
|
87
|
+
throw new Error("Missing published Page projection.");
|
|
86
88
|
}
|
|
87
89
|
return {
|
|
88
90
|
area: payload.preset ? payload : null,
|
|
89
|
-
publishedPages: payload.publishedPages.map(
|
|
91
|
+
publishedPages: payload.publishedPages.map(readPublishedPage),
|
|
90
92
|
};
|
|
91
93
|
}
|
|
92
94
|
function readAreaStructurePayload(value, area, kind) {
|
package/gateway/site-config.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import "server-only";
|
|
2
2
|
import { syncPhiTranslationChangeMarkers } from "../helpers/translation-cache";
|
|
3
3
|
import { clearPhiSiteReadCache, readPhiSiteReadCache } from "./site-read-cache";
|
|
4
|
+
import { emitPhiSiteReadMarker } from "./site-read-marker-listeners";
|
|
4
5
|
import { fetchPhiSiteApi } from "./site-api-request";
|
|
5
6
|
/**
|
|
6
7
|
* How long a Site process keeps its config before asking Core again. The config is small and carries the
|
|
@@ -72,8 +73,13 @@ async function fetchSiteConfig({ apiBaseUrl, internalToken, siteKey }, cacheKey)
|
|
|
72
73
|
const markerKey = siteKey.trim().toLowerCase();
|
|
73
74
|
const previous = seen.get(markerKey);
|
|
74
75
|
seen.set(markerKey, payload.site.readMarker);
|
|
75
|
-
|
|
76
|
+
const moved = previous !== undefined && previous !== payload.site.readMarker;
|
|
77
|
+
if (moved) {
|
|
76
78
|
clearPhiSiteReadCache({ keep: cacheKey });
|
|
77
79
|
}
|
|
80
|
+
// The first sight and every move: whoever rebuilds from a publish listens here (site-read-marker-listeners.ts).
|
|
81
|
+
if (previous === undefined || moved) {
|
|
82
|
+
emitPhiSiteReadMarker({ siteKey: markerKey, marker: payload.site.readMarker, moved });
|
|
83
|
+
}
|
|
78
84
|
return payload.site;
|
|
79
85
|
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import "server-only";
|
|
2
|
+
/**
|
|
3
|
+
* Who wants to know that a Site's read marker was seen (gateway/site-config.ts).
|
|
4
|
+
*
|
|
5
|
+
* The config read is where a process learns that something was published, possibly through another
|
|
6
|
+
* process, and it empties its caches there. Other work follows the same signal -- the search index is
|
|
7
|
+
* rebuilt from it (server-helpers/search-index.ts) -- but the config read must not know about it: the
|
|
8
|
+
* gateway is the floor of the house, and a reader of it that imported the indexer would pull the whole
|
|
9
|
+
* page resolution into every config fetch. So the read says what it saw, and whoever registered listens.
|
|
10
|
+
*
|
|
11
|
+
* On `globalThis`, like the read cache: the config read and the listener can be bundled separately.
|
|
12
|
+
*/
|
|
13
|
+
export type PhiSiteReadMarkerEvent = {
|
|
14
|
+
siteKey: string;
|
|
15
|
+
marker: string;
|
|
16
|
+
/** `false` the first time this process sees the Site's marker; `true` when it differs from the last one. */
|
|
17
|
+
moved: boolean;
|
|
18
|
+
};
|
|
19
|
+
type Listener = (event: PhiSiteReadMarkerEvent) => void;
|
|
20
|
+
/** Registers `listener`; registering the same function twice registers it once. */
|
|
21
|
+
export declare function onPhiSiteReadMarker(listener: Listener): void;
|
|
22
|
+
/** Tells every listener; a listener that throws is reported and does not stop the others or the read. */
|
|
23
|
+
export declare function emitPhiSiteReadMarker(event: PhiSiteReadMarkerEvent): void;
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import "server-only";
|
|
2
|
+
const LISTENERS_KEY = Symbol.for("phis-ui.site-read-marker-listeners");
|
|
3
|
+
function readListeners() {
|
|
4
|
+
const holder = globalThis;
|
|
5
|
+
holder[LISTENERS_KEY] ??= new Set();
|
|
6
|
+
return holder[LISTENERS_KEY];
|
|
7
|
+
}
|
|
8
|
+
/** Registers `listener`; registering the same function twice registers it once. */
|
|
9
|
+
export function onPhiSiteReadMarker(listener) {
|
|
10
|
+
readListeners().add(listener);
|
|
11
|
+
}
|
|
12
|
+
/** Tells every listener; a listener that throws is reported and does not stop the others or the read. */
|
|
13
|
+
export function emitPhiSiteReadMarker(event) {
|
|
14
|
+
for (const listener of readListeners()) {
|
|
15
|
+
try {
|
|
16
|
+
listener(event);
|
|
17
|
+
}
|
|
18
|
+
catch (error) {
|
|
19
|
+
console.error("[phis-ui] A read marker listener failed.", error);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import "server-only";
|
|
2
|
+
import { type PhiSearchDocument, type PhiSearchIndexState, type PhiSearchIndexWriteResult, type PhiSearchResponse } from "@phis/contracts/search";
|
|
3
|
+
import type { PhiCmsAreaKey } from "../constants/cms-areas";
|
|
4
|
+
type PhiSiteSearchCredentials = {
|
|
5
|
+
apiBaseUrl: string;
|
|
6
|
+
internalToken: string;
|
|
7
|
+
siteKey: string;
|
|
8
|
+
};
|
|
9
|
+
export type FetchPhiSiteSearchOptions = PhiSiteSearchCredentials & {
|
|
10
|
+
/** The query as `readPhiSearchQuery` read it. */
|
|
11
|
+
query: string;
|
|
12
|
+
locale: string;
|
|
13
|
+
/** The Areas this visitor may search; the Widget decided from where it stands. */
|
|
14
|
+
areas: readonly PhiCmsAreaKey[];
|
|
15
|
+
limit: number;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* The Pages matching a visitor's query, read while the results Page is drawn (SEARCH.md).
|
|
19
|
+
*
|
|
20
|
+
* A Gateway read with the internal token: Core answers only the Site, and the Site has already decided
|
|
21
|
+
* which Areas this visitor may search. The request carries a query, so the Page is never static and
|
|
22
|
+
* every visitor gets their own answer.
|
|
23
|
+
*/
|
|
24
|
+
export declare function fetchPhiSiteSearch(options: FetchPhiSiteSearchOptions): Promise<PhiSearchResponse>;
|
|
25
|
+
/** The sets Core holds of this Site, so the indexer writes only the ones that are behind. */
|
|
26
|
+
export declare function fetchPhiSiteSearchIndexStates(credentials: PhiSiteSearchCredentials): Promise<PhiSearchIndexState[]>;
|
|
27
|
+
export type PutPhiSiteSearchIndexSetOptions = PhiSiteSearchCredentials & {
|
|
28
|
+
area: PhiCmsAreaKey;
|
|
29
|
+
locale: string;
|
|
30
|
+
fingerprint: string;
|
|
31
|
+
documents: readonly PhiSearchDocument[];
|
|
32
|
+
};
|
|
33
|
+
/** One set, replacing what Core held of that Area and language. */
|
|
34
|
+
export declare function putPhiSiteSearchIndexSet(options: PutPhiSiteSearchIndexSetOptions): Promise<PhiSearchIndexWriteResult & {
|
|
35
|
+
dropped: number;
|
|
36
|
+
}>;
|
|
37
|
+
export {};
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import "server-only";
|
|
2
|
+
import { PHI_SEARCH_QUERY_PARAM, } from "@phis/contracts/search";
|
|
3
|
+
import { isPhiRecord } from "../helpers/is-record";
|
|
4
|
+
import { fetchPhiSiteApi } from "./site-api-request";
|
|
5
|
+
function readString(value) {
|
|
6
|
+
return typeof value === "string" ? value : "";
|
|
7
|
+
}
|
|
8
|
+
function readHit(value) {
|
|
9
|
+
if (!isPhiRecord(value))
|
|
10
|
+
return null;
|
|
11
|
+
const path = readString(value.path);
|
|
12
|
+
if (!path)
|
|
13
|
+
return null;
|
|
14
|
+
return {
|
|
15
|
+
path,
|
|
16
|
+
areaMask: typeof value.areaMask === "number" ? value.areaMask : 1,
|
|
17
|
+
title: readString(value.title),
|
|
18
|
+
description: readString(value.description),
|
|
19
|
+
snippet: Array.isArray(value.snippet)
|
|
20
|
+
? value.snippet.flatMap((segment) => isPhiRecord(segment) && typeof segment.text === "string"
|
|
21
|
+
? [{ text: segment.text, match: segment.match === true }]
|
|
22
|
+
: [])
|
|
23
|
+
: [],
|
|
24
|
+
rank: typeof value.rank === "number" ? value.rank : 0,
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* The Pages matching a visitor's query, read while the results Page is drawn (SEARCH.md).
|
|
29
|
+
*
|
|
30
|
+
* A Gateway read with the internal token: Core answers only the Site, and the Site has already decided
|
|
31
|
+
* which Areas this visitor may search. The request carries a query, so the Page is never static and
|
|
32
|
+
* every visitor gets their own answer.
|
|
33
|
+
*/
|
|
34
|
+
export async function fetchPhiSiteSearch(options) {
|
|
35
|
+
const payload = await fetchPhiSiteApi({
|
|
36
|
+
context: "fetchPhiSiteSearch",
|
|
37
|
+
apiBaseUrl: options.apiBaseUrl,
|
|
38
|
+
internalToken: options.internalToken,
|
|
39
|
+
siteKey: options.siteKey,
|
|
40
|
+
path: "/api/v1/site/search",
|
|
41
|
+
searchParams: {
|
|
42
|
+
[PHI_SEARCH_QUERY_PARAM]: options.query,
|
|
43
|
+
areas: options.areas.join(","),
|
|
44
|
+
limit: String(options.limit),
|
|
45
|
+
},
|
|
46
|
+
locale: options.locale,
|
|
47
|
+
failure: "Search failed",
|
|
48
|
+
userAgent: "phis-ui-search/1.0",
|
|
49
|
+
});
|
|
50
|
+
if (!isPhiRecord(payload) || !Array.isArray(payload.hits)) {
|
|
51
|
+
throw new Error("Search answered without a list.");
|
|
52
|
+
}
|
|
53
|
+
return {
|
|
54
|
+
query: readString(payload.query),
|
|
55
|
+
locale: readString(payload.locale) || options.locale,
|
|
56
|
+
areaMask: typeof payload.areaMask === "number" ? payload.areaMask : 0,
|
|
57
|
+
hits: payload.hits.map(readHit).filter((hit) => hit !== null),
|
|
58
|
+
total: typeof payload.total === "number" ? payload.total : 0,
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
function readState(value) {
|
|
62
|
+
if (!isPhiRecord(value))
|
|
63
|
+
return null;
|
|
64
|
+
if (typeof value.areaMask !== "number" || typeof value.locale !== "string" || typeof value.fingerprint !== "string") {
|
|
65
|
+
return null;
|
|
66
|
+
}
|
|
67
|
+
return {
|
|
68
|
+
areaMask: value.areaMask,
|
|
69
|
+
locale: value.locale,
|
|
70
|
+
fingerprint: value.fingerprint,
|
|
71
|
+
documentCount: typeof value.documentCount === "number" ? value.documentCount : 0,
|
|
72
|
+
indexedAt: readString(value.indexedAt),
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
/** The sets Core holds of this Site, so the indexer writes only the ones that are behind. */
|
|
76
|
+
export async function fetchPhiSiteSearchIndexStates(credentials) {
|
|
77
|
+
const payload = await fetchPhiSiteApi({
|
|
78
|
+
context: "fetchPhiSiteSearchIndexStates",
|
|
79
|
+
...credentials,
|
|
80
|
+
path: "/api/v1/site/search/index",
|
|
81
|
+
failure: "Search index states fetch failed",
|
|
82
|
+
userAgent: "phis-ui-search-index/1.0",
|
|
83
|
+
});
|
|
84
|
+
if (!isPhiRecord(payload) || !Array.isArray(payload.sets)) {
|
|
85
|
+
throw new Error("The search index answered without its sets.");
|
|
86
|
+
}
|
|
87
|
+
return payload.sets.map(readState).filter((state) => state !== null);
|
|
88
|
+
}
|
|
89
|
+
/** One set, replacing what Core held of that Area and language. */
|
|
90
|
+
export async function putPhiSiteSearchIndexSet(options) {
|
|
91
|
+
const payload = await fetchPhiSiteApi({
|
|
92
|
+
context: "putPhiSiteSearchIndexSet",
|
|
93
|
+
apiBaseUrl: options.apiBaseUrl,
|
|
94
|
+
internalToken: options.internalToken,
|
|
95
|
+
siteKey: options.siteKey,
|
|
96
|
+
path: "/api/v1/site/search/index",
|
|
97
|
+
method: "PUT",
|
|
98
|
+
body: {
|
|
99
|
+
area: options.area,
|
|
100
|
+
locale: options.locale,
|
|
101
|
+
fingerprint: options.fingerprint,
|
|
102
|
+
documents: options.documents,
|
|
103
|
+
},
|
|
104
|
+
failure: `Search index write failed (${options.area}, ${options.locale})`,
|
|
105
|
+
userAgent: "phis-ui-search-index/1.0",
|
|
106
|
+
});
|
|
107
|
+
const state = isPhiRecord(payload) ? readState(payload.state) : null;
|
|
108
|
+
if (!isPhiRecord(payload) || !state) {
|
|
109
|
+
throw new Error("The search index write answered without its state.");
|
|
110
|
+
}
|
|
111
|
+
return {
|
|
112
|
+
accepted: payload.accepted === true,
|
|
113
|
+
state,
|
|
114
|
+
dropped: typeof payload.dropped === "number" ? payload.dropped : 0,
|
|
115
|
+
};
|
|
116
|
+
}
|
package/helpers/external-href.js
CHANGED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** Scrambles `value` -- a whole `mailto:` href or a bare address -- into a `phi-mail:` string. */
|
|
2
|
+
export declare function encodePhiProtectedMail(value: string): string;
|
|
3
|
+
export declare function isPhiProtectedMail(value: string | null | undefined): value is string;
|
|
4
|
+
/** The value `encodePhiProtectedMail` was given, or `null` for anything it did not write. */
|
|
5
|
+
export declare function decodePhiProtectedMail(value: string): string | null;
|
|
6
|
+
/** A `mailto:` href protected; every other href as it is. */
|
|
7
|
+
export declare function protectPhiMailHref<T extends string | null | undefined>(href: T): T | string;
|
|
8
|
+
export type PhiMailTextSegment = {
|
|
9
|
+
kind: "text";
|
|
10
|
+
text: string;
|
|
11
|
+
} | {
|
|
12
|
+
kind: "mail";
|
|
13
|
+
token: string;
|
|
14
|
+
};
|
|
15
|
+
/** A text cut where it names an address, each address protected; one text segment when it names none. */
|
|
16
|
+
export declare function splitPhiMailAddresses(text: string): PhiMailTextSegment[];
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* An e-mail address kept out of the page's source, for crawlers that harvest them.
|
|
3
|
+
*
|
|
4
|
+
* A crawler reads the HTML and the React payload beside it and runs no script; a reader's browser runs
|
|
5
|
+
* one. So the server writes an address as `phi-mail:` and a scrambled hex string, and the client turns it
|
|
6
|
+
* back into the address after the page has mounted (`components/navigation/use-phi-protected-mail.ts`).
|
|
7
|
+
* It is obfuscation, not secrecy: anybody who runs the page sees the address, which is the point.
|
|
8
|
+
*
|
|
9
|
+
* **Only where a page is delivered.** A stored config keeps `mailto:` as the operator wrote it -- the
|
|
10
|
+
* Builder shows the field it edits -- and the server renderer protects it on the way out. A value that
|
|
11
|
+
* only ever reaches the client as data, a table's rows, is beyond this: the rows are in the payload.
|
|
12
|
+
*
|
|
13
|
+
* The key is derived from the address, not drawn at random, so the server and a client render of the same
|
|
14
|
+
* value write the same string and hydration agrees.
|
|
15
|
+
*/
|
|
16
|
+
const PHI_PROTECTED_MAIL_PREFIX = "phi-mail:";
|
|
17
|
+
const PHI_MAIL_ADDRESS_PATTERN = /[A-Za-z0-9._%+-]+@[A-Za-z0-9-]+(?:\.[A-Za-z0-9-]+)*\.[A-Za-z]{2,}/gu;
|
|
18
|
+
function derivePhiMailKey(value) {
|
|
19
|
+
let hash = 0x811c9dc5;
|
|
20
|
+
for (let index = 0; index < value.length; index += 1) {
|
|
21
|
+
hash = Math.imul(hash ^ value.charCodeAt(index), 0x01000193) >>> 0;
|
|
22
|
+
}
|
|
23
|
+
return (hash % 255) + 1;
|
|
24
|
+
}
|
|
25
|
+
function toHex(byte) {
|
|
26
|
+
return byte.toString(16).padStart(2, "0");
|
|
27
|
+
}
|
|
28
|
+
/** Scrambles `value` -- a whole `mailto:` href or a bare address -- into a `phi-mail:` string. */
|
|
29
|
+
export function encodePhiProtectedMail(value) {
|
|
30
|
+
const key = derivePhiMailKey(value);
|
|
31
|
+
const bytes = new TextEncoder().encode(value);
|
|
32
|
+
let hex = toHex(key);
|
|
33
|
+
bytes.forEach((byte, index) => {
|
|
34
|
+
hex += toHex(byte ^ ((key + index * 31) & 0xff));
|
|
35
|
+
});
|
|
36
|
+
return `${PHI_PROTECTED_MAIL_PREFIX}${hex}`;
|
|
37
|
+
}
|
|
38
|
+
export function isPhiProtectedMail(value) {
|
|
39
|
+
return typeof value === "string" && value.startsWith(PHI_PROTECTED_MAIL_PREFIX);
|
|
40
|
+
}
|
|
41
|
+
/** The value `encodePhiProtectedMail` was given, or `null` for anything it did not write. */
|
|
42
|
+
export function decodePhiProtectedMail(value) {
|
|
43
|
+
if (!isPhiProtectedMail(value))
|
|
44
|
+
return null;
|
|
45
|
+
const hex = value.slice(PHI_PROTECTED_MAIL_PREFIX.length);
|
|
46
|
+
if (hex.length < 2 || hex.length % 2 !== 0 || !/^[0-9a-f]+$/u.test(hex))
|
|
47
|
+
return null;
|
|
48
|
+
const key = Number.parseInt(hex.slice(0, 2), 16);
|
|
49
|
+
const bytes = new Uint8Array((hex.length - 2) / 2);
|
|
50
|
+
for (let index = 0; index < bytes.length; index += 1) {
|
|
51
|
+
const byte = Number.parseInt(hex.slice(2 + index * 2, 4 + index * 2), 16);
|
|
52
|
+
bytes[index] = byte ^ ((key + index * 31) & 0xff);
|
|
53
|
+
}
|
|
54
|
+
try {
|
|
55
|
+
return new TextDecoder("utf-8", { fatal: true }).decode(bytes);
|
|
56
|
+
}
|
|
57
|
+
catch {
|
|
58
|
+
return null;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
/** A `mailto:` href protected; every other href as it is. */
|
|
62
|
+
export function protectPhiMailHref(href) {
|
|
63
|
+
if (typeof href !== "string")
|
|
64
|
+
return href;
|
|
65
|
+
return /^mailto:/iu.test(href.trim()) ? encodePhiProtectedMail(href.trim()) : href;
|
|
66
|
+
}
|
|
67
|
+
/** A text cut where it names an address, each address protected; one text segment when it names none. */
|
|
68
|
+
export function splitPhiMailAddresses(text) {
|
|
69
|
+
const segments = [];
|
|
70
|
+
let cursor = 0;
|
|
71
|
+
for (const match of text.matchAll(PHI_MAIL_ADDRESS_PATTERN)) {
|
|
72
|
+
const start = match.index ?? 0;
|
|
73
|
+
if (start > cursor)
|
|
74
|
+
segments.push({ kind: "text", text: text.slice(cursor, start) });
|
|
75
|
+
segments.push({ kind: "mail", token: encodePhiProtectedMail(match[0]) });
|
|
76
|
+
cursor = start + match[0].length;
|
|
77
|
+
}
|
|
78
|
+
if (cursor < text.length || segments.length === 0)
|
|
79
|
+
segments.push({ kind: "text", text: text.slice(cursor) });
|
|
80
|
+
return segments;
|
|
81
|
+
}
|
package/next/areas/app.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import "server-only";
|
|
2
2
|
import { createPhiAppRuntimeModuleCatalog } from "../../plugins/runtime-modules/area-catalogs/app";
|
|
3
|
+
import { registerPhiSearchIndexArea } from "../../server-helpers/search-index";
|
|
3
4
|
import { createPhiNextCmsSiteBridge } from "../site-bridge";
|
|
4
5
|
/**
|
|
5
6
|
* The Area host, given what this Site installed.
|
|
@@ -8,8 +9,11 @@ import { createPhiNextCmsSiteBridge } from "../site-bridge";
|
|
|
8
9
|
* inside `@phis/ui`; the Skeleton passes it in once and never changes again when a Module is added.
|
|
9
10
|
*/
|
|
10
11
|
export function createPhiAppCmsSiteBridge(siteModules = {}) {
|
|
11
|
-
|
|
12
|
+
const bridge = createPhiNextCmsSiteBridge({
|
|
12
13
|
runtimeModuleCatalog: createPhiAppRuntimeModuleCatalog(siteModules),
|
|
13
14
|
});
|
|
15
|
+
// The App Pages are indexed for the Site's search from this Bridge (SEARCH.md).
|
|
16
|
+
registerPhiSearchIndexArea("app", bridge);
|
|
17
|
+
return bridge;
|
|
14
18
|
}
|
|
15
19
|
export const PHI_APP_CMS_SITE_BRIDGE = createPhiAppCmsSiteBridge();
|
package/next/areas/public.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import "server-only";
|
|
2
2
|
import { createPhiPublicRuntimeModuleCatalog } from "../../plugins/runtime-modules/area-catalogs/public";
|
|
3
|
+
import { registerPhiSearchIndexArea } from "../../server-helpers/search-index";
|
|
3
4
|
import { createPhiNextCmsSiteBridge } from "../site-bridge";
|
|
4
5
|
/**
|
|
5
6
|
* The Area host, given what this Site installed.
|
|
@@ -8,8 +9,11 @@ import { createPhiNextCmsSiteBridge } from "../site-bridge";
|
|
|
8
9
|
* inside `@phis/ui`; the Skeleton passes it in once and never changes again when a Module is added.
|
|
9
10
|
*/
|
|
10
11
|
export function createPhiPublicCmsSiteBridge(siteModules = {}) {
|
|
11
|
-
|
|
12
|
+
const bridge = createPhiNextCmsSiteBridge({
|
|
12
13
|
runtimeModuleCatalog: createPhiPublicRuntimeModuleCatalog(siteModules),
|
|
13
14
|
});
|
|
15
|
+
// The Public Pages are indexed for the Site's search from this Bridge (SEARCH.md).
|
|
16
|
+
registerPhiSearchIndexArea("public", bridge);
|
|
17
|
+
return bridge;
|
|
14
18
|
}
|
|
15
19
|
export const PHI_PUBLIC_CMS_SITE_BRIDGE = createPhiPublicCmsSiteBridge();
|
package/next/seo-routes.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "server-only";
|
|
2
2
|
import { createHash } from "node:crypto";
|
|
3
3
|
import { resolvePhiCmsPageRedirect } from "../components/cms/phi-cms-page-redirect";
|
|
4
|
-
import {
|
|
4
|
+
import { getSiteAreaWithPublishedPages } from "../gateway/site-area";
|
|
5
5
|
import { PHI_AREA_META_PUBLIC_DEFAULTS, readPhiAreaLandingSelection, readPhiAreaMeta, readPhiAreaPublicRoutePaths, } from "../helpers/cms-area-config";
|
|
6
6
|
import { collectPhiSitemapCandidates, renderPhiRobotsTxt, renderPhiSitemapXml, resolvePhiSitePublicBase, } from "../helpers/phi-seo";
|
|
7
7
|
import { createPhiFingerprintCache } from "../helpers/phi-sitemap-cache";
|
|
@@ -40,7 +40,7 @@ async function loadPhiPublicSeoContext(bridge, { withPublishedPages }) {
|
|
|
40
40
|
presetKey: shellBinding.descriptor.presetKey,
|
|
41
41
|
};
|
|
42
42
|
const { area: areaPreset, publishedPages } = withPublishedPages
|
|
43
|
-
? await
|
|
43
|
+
? await getSiteAreaWithPublishedPages({ apiBaseUrl, internalToken, siteKey, locale, sourcePreset })
|
|
44
44
|
: {
|
|
45
45
|
area: await getPhiExactSiteArea({
|
|
46
46
|
path: "/",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@phis/ui",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.7",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -503,7 +503,7 @@
|
|
|
503
503
|
"@lexical/rich-text": "0.50.0",
|
|
504
504
|
"@lexical/selection": "0.50.0",
|
|
505
505
|
"@lexical/utils": "0.50.0",
|
|
506
|
-
"@phis/contracts": "^0.7.
|
|
506
|
+
"@phis/contracts": "^0.7.3",
|
|
507
507
|
"dayjs": "^1.11.23",
|
|
508
508
|
"dom-serializer": "^2.0.0",
|
|
509
509
|
"htmlparser2": "^10.1.0",
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { PHI_BASE_PAGE_LAYOUT_VERSION } from "../../../components/regions/presets/phi-base-page-layout";
|
|
2
|
+
import { PhiCmsFlags } from "../../../constants/phi-cms";
|
|
2
3
|
import { buildPhiAreaRootRoutePresetDescriptor } from "../area-root-route";
|
|
4
|
+
import { PHI_APP_SEARCH_PAGE_PRESET_KEY } from "../search-page-references";
|
|
3
5
|
import { PHI_APP_RUNTIME_MODULE_ID } from "./ids";
|
|
4
6
|
/* What the App base Module brings: its Area shell, the Area root and the profile Page. */
|
|
5
7
|
export const PHI_APP_RUNTIME_MODULE_AREA_SHELLS = [
|
|
@@ -64,4 +66,25 @@ export const PHI_APP_RUNTIME_MODULE_ROUTES = [
|
|
|
64
66
|
loadTree: ({ page, runtime }) => import("./trees/phi-default-app-profile-page-tree")
|
|
65
67
|
.then((module) => module.buildPhiDefaultAppProfilePageTree({ page, runtime })),
|
|
66
68
|
},
|
|
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
|
+
},
|
|
67
90
|
];
|
|
@@ -10,7 +10,8 @@ import type { PhiBlockRuntime } from "../../../../types";
|
|
|
10
10
|
*
|
|
11
11
|
* The sider is where the Area's navigation belongs, and the reason is in SETTINGS.md section 3: a
|
|
12
12
|
* shell Region outlives a move between Pages, while a Page-owned one is built again for each of them.
|
|
13
|
-
* Navigation placed in the latter rebuilds itself under the hand that just used it.
|
|
13
|
+
* Navigation placed in the latter rebuilds itself under the hand that just used it. The search box
|
|
14
|
+
* stands above it for the same reason (SEARCH.md): a member searches from wherever they are.
|
|
14
15
|
*/
|
|
15
16
|
export declare function buildPhiDefaultAppAreaPresetTree({ page, runtime, }: {
|
|
16
17
|
page: PhiCmsPageNode;
|
|
@@ -15,7 +15,7 @@ const SYNTHETIC_APP_WIDGET_IDS = createPhiPresetCmsInstanceIdMap({
|
|
|
15
15
|
domain: "area",
|
|
16
16
|
ownerModuleId: PHI_APP_RUNTIME_MODULE_ID,
|
|
17
17
|
presetKey: "app-area-preset",
|
|
18
|
-
}, ["widgetSiderLeftNav"]);
|
|
18
|
+
}, ["widgetSiderLeftNav", "widgetSiderLeftSearch"]);
|
|
19
19
|
/**
|
|
20
20
|
* The App's own left sider, laid over the Site shell rather than replacing it.
|
|
21
21
|
*
|
|
@@ -26,7 +26,8 @@ const SYNTHETIC_APP_WIDGET_IDS = createPhiPresetCmsInstanceIdMap({
|
|
|
26
26
|
*
|
|
27
27
|
* The sider is where the Area's navigation belongs, and the reason is in SETTINGS.md section 3: a
|
|
28
28
|
* shell Region outlives a move between Pages, while a Page-owned one is built again for each of them.
|
|
29
|
-
* Navigation placed in the latter rebuilds itself under the hand that just used it.
|
|
29
|
+
* Navigation placed in the latter rebuilds itself under the hand that just used it. The search box
|
|
30
|
+
* stands above it for the same reason (SEARCH.md): a member searches from wherever they are.
|
|
30
31
|
*/
|
|
31
32
|
export async function buildPhiDefaultAppAreaPresetTree({ page, runtime, }) {
|
|
32
33
|
const nodes = createPhiCmsPresetNodes(page);
|
|
@@ -11,6 +11,8 @@ import { PhiTypographyControl } from "../../../../components/controls/phi-typogr
|
|
|
11
11
|
import { PHI_INSPECTOR_WIDGET_DEFAULT_LABELS } from "../../../../components/widgets/label-types/inspector";
|
|
12
12
|
import { PhiRegionVisibilityFields } from "./region-visibility-fields";
|
|
13
13
|
import { renderPhiInspectorConfigField } from "./inspector-config-field";
|
|
14
|
+
import { hasPhiFlag, readPhiFlags } from "../../../../helpers/flags";
|
|
15
|
+
import { PhiCmsFlags } from "../../../../constants/phi-cms";
|
|
14
16
|
const PHI_GAP_SM = "var(--ant-padding-sm)";
|
|
15
17
|
const REGION_PADDING_KEYS = [
|
|
16
18
|
"padding",
|
|
@@ -93,7 +95,24 @@ export function PhiDeveloperBuilderRegionInspectorWidgetClient({ section, builde
|
|
|
93
95
|
{
|
|
94
96
|
key: "viewport",
|
|
95
97
|
title: geometryLabels?.fields.viewport ?? "Viewport",
|
|
96
|
-
children: (_jsx(PhiViewportVisibilityControl, { disabled: isPreviewMode || !onDraftChange, value: effectiveDraft.viewportFlags, labels: geometryLabels?.viewport, onChange: (viewportFlags) => updateDraft({ viewportFlags }) })
|
|
98
|
+
children: (_jsxs("div", { style: { display: "grid", gap: PHI_GAP_SM, width: "100%" }, children: [_jsx(PhiViewportVisibilityControl, { disabled: isPreviewMode || !onDraftChange, value: effectiveDraft.viewportFlags, labels: geometryLabels?.viewport, onChange: (viewportFlags) => updateDraft({ viewportFlags }) }), selectedRegionKey === "sider_left" ? renderPhiInspectorConfigField({
|
|
99
|
+
field: { key: "mobileDrawer", type: "boolean", label: visibilityLabels.siderMobileDrawer },
|
|
100
|
+
value: hasPhiFlag(readPhiFlags(effectiveDraft.regionConfig?.flags), PhiCmsFlags.MobileDrawer),
|
|
101
|
+
defaultValue: false,
|
|
102
|
+
config: effectiveDraft.regionConfig ?? {},
|
|
103
|
+
disabled: isPreviewMode || !onDraftChange,
|
|
104
|
+
onChange: (patch) => {
|
|
105
|
+
const flags = readPhiFlags(effectiveDraft.regionConfig?.flags);
|
|
106
|
+
updateDraft({
|
|
107
|
+
regionConfig: {
|
|
108
|
+
...(effectiveDraft.regionConfig ?? {}),
|
|
109
|
+
flags: patch.mobileDrawer === true
|
|
110
|
+
? flags | PhiCmsFlags.MobileDrawer
|
|
111
|
+
: flags & ~PhiCmsFlags.MobileDrawer,
|
|
112
|
+
},
|
|
113
|
+
});
|
|
114
|
+
},
|
|
115
|
+
}) : null] })),
|
|
97
116
|
},
|
|
98
117
|
{
|
|
99
118
|
key: "visibility",
|
|
@@ -255,6 +255,14 @@ export const PHI_COMMON_RUNTIME_MODULE_RENDER_CLIENT_MANIFEST = createPhiRuntime
|
|
|
255
255
|
PhiCmsWidgetType.EntryList,
|
|
256
256
|
definePhiRuntimeModuleRenderClient(dynamic(() => import("../core/widgets/entry-list/client").then((module) => module.PhiEntryListWidgetClient))),
|
|
257
257
|
],
|
|
258
|
+
[
|
|
259
|
+
PhiCmsWidgetType.SearchBox,
|
|
260
|
+
definePhiRuntimeModuleRenderClient(dynamic(() => import("../core/widgets/search-box/client").then((module) => module.PhiSearchBoxWidgetClient))),
|
|
261
|
+
],
|
|
262
|
+
[
|
|
263
|
+
PhiCmsWidgetType.SearchResults,
|
|
264
|
+
definePhiRuntimeModuleRenderClient(dynamic(() => import("../core/widgets/search-results/client").then((module) => module.PhiSearchResultsWidgetClient))),
|
|
265
|
+
],
|
|
258
266
|
[
|
|
259
267
|
PhiCmsWidgetType.EntryDetail,
|
|
260
268
|
definePhiRuntimeModuleRenderClient(dynamic(() => import("../core/widgets/entry-detail/client").then((module) => module.PhiEntryDetailWidgetClient))),
|
|
@@ -45,6 +45,8 @@ import { PHI_GALLERY_WIDGET_DEFINITION } from "./widgets/gallery/config";
|
|
|
45
45
|
import { PHI_STEPS_WIDGET_DEFINITION } from "./widgets/steps/config";
|
|
46
46
|
import { PHI_TIMELINE_WIDGET_DEFINITION } from "./widgets/timeline/config";
|
|
47
47
|
import { PHI_ENTRY_LIST_WIDGET_DEFINITION } from "./widgets/entry-list/config";
|
|
48
|
+
import { PHI_SEARCH_BOX_WIDGET_DEFINITION } from "./widgets/search-box/config";
|
|
49
|
+
import { PHI_SEARCH_RESULTS_WIDGET_DEFINITION } from "./widgets/search-results/config";
|
|
48
50
|
import { PHI_ENTRY_DETAIL_WIDGET_DEFINITION } from "./widgets/entry-detail/config";
|
|
49
51
|
import { PHI_ENTRY_HEADER_WIDGET_DEFINITION } from "./widgets/entry-header/config";
|
|
50
52
|
import { PHI_THREAD_CONVERSATION_WIDGET_DEFINITION } from "./widgets/thread-conversation/config";
|
|
@@ -103,6 +105,8 @@ export default createPhiAuthoringWidgetModule([
|
|
|
103
105
|
definePhiAuthoringWidgetModuleLoader(PHI_GALLERY_WIDGET_DEFINITION, () => import("./widgets/gallery/authoring").then((module) => module.PHI_GALLERY_WIDGET_BUILDER_PLUGIN)),
|
|
104
106
|
definePhiAuthoringWidgetModuleLoader(PHI_STEPS_WIDGET_DEFINITION, () => import("./widgets/steps/authoring").then((module) => module.PHI_STEPS_WIDGET_BUILDER_PLUGIN)),
|
|
105
107
|
definePhiAuthoringWidgetModuleLoader(PHI_TIMELINE_WIDGET_DEFINITION, () => import("./widgets/timeline/authoring").then((module) => module.PHI_TIMELINE_WIDGET_BUILDER_PLUGIN)),
|
|
108
|
+
definePhiAuthoringWidgetModuleLoader(PHI_SEARCH_BOX_WIDGET_DEFINITION, () => import("./widgets/search-box/authoring").then((module) => module.PHI_SEARCH_BOX_WIDGET_BUILDER_PLUGIN)),
|
|
109
|
+
definePhiAuthoringWidgetModuleLoader(PHI_SEARCH_RESULTS_WIDGET_DEFINITION, () => import("./widgets/search-results/authoring").then((module) => module.PHI_SEARCH_RESULTS_WIDGET_BUILDER_PLUGIN)),
|
|
106
110
|
definePhiAuthoringWidgetModuleLoader(PHI_ENTRY_LIST_WIDGET_DEFINITION, () => import("./widgets/entry-list/authoring").then((module) => module.PHI_ENTRY_LIST_WIDGET_BUILDER_PLUGIN)),
|
|
107
111
|
definePhiAuthoringWidgetModuleLoader(PHI_ENTRY_DETAIL_WIDGET_DEFINITION, () => import("./widgets/entry-detail/authoring").then((module) => module.PHI_ENTRY_DETAIL_WIDGET_BUILDER_PLUGIN)),
|
|
108
112
|
definePhiAuthoringWidgetModuleLoader(PHI_ENTRY_HEADER_WIDGET_DEFINITION, () => import("./widgets/entry-header/authoring").then((module) => module.PHI_ENTRY_HEADER_WIDGET_BUILDER_PLUGIN)),
|